@saasquatch/mint-components 1.15.0-115 → 1.15.0-117

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 (76) hide show
  1. package/dist/cjs/RewardExchangeListData-a787ce54.js +1144 -0
  2. package/dist/cjs/{ShadowViewAddon-74752e56.js → ShadowViewAddon-f1bd9b26.js} +1 -1
  3. package/dist/cjs/{copy-text-view-c13907f9.js → copy-text-view-44dfefc7.js} +5 -7
  4. package/dist/cjs/copy-text-view-f0313f78.js +121 -0
  5. package/dist/cjs/sqm-big-stat_43.cjs.entry.js +2 -2
  6. package/dist/cjs/sqm-coupon-code-view-a869384e.js +35 -0
  7. package/dist/cjs/sqm-coupon-code.cjs.entry.js +285 -0
  8. package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
  9. package/dist/cjs/sqm-referral-code.cjs.entry.js +177 -0
  10. package/dist/cjs/sqm-reward-exchange-list.cjs.entry.js +1018 -0
  11. package/dist/cjs/sqm-share-code.cjs.entry.js +147 -0
  12. package/dist/cjs/sqm-share-link.cjs.entry.js +102 -0
  13. package/dist/cjs/sqm-stencilbook.cjs.entry.js +3 -3
  14. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +1 -1
  15. package/dist/collection/components/views/copy-text-view.js +5 -7
  16. package/dist/esm/RewardExchangeListData-11c043e3.js +1122 -0
  17. package/dist/esm/{ShadowViewAddon-ee0c8c4b.js → ShadowViewAddon-c0600f22.js} +1 -1
  18. package/dist/esm/copy-text-view-3129fb22.js +119 -0
  19. package/dist/esm/{copy-text-view-61bd1ac1.js → copy-text-view-a319c261.js} +5 -7
  20. package/dist/esm/sqm-big-stat_43.entry.js +2 -2
  21. package/dist/esm/sqm-coupon-code-view-af016712.js +33 -0
  22. package/dist/esm/sqm-coupon-code.entry.js +281 -0
  23. package/dist/esm/sqm-pagination_3.entry.js +1 -1
  24. package/dist/esm/sqm-referral-code.entry.js +173 -0
  25. package/dist/esm/sqm-reward-exchange-list.entry.js +1014 -0
  26. package/dist/esm/sqm-share-code.entry.js +143 -0
  27. package/dist/esm/sqm-share-link.entry.js +98 -0
  28. package/dist/esm/sqm-stencilbook.entry.js +3 -3
  29. package/dist/esm-es5/RewardExchangeListData-11c043e3.js +1 -0
  30. package/dist/esm-es5/{ShadowViewAddon-ee0c8c4b.js → ShadowViewAddon-c0600f22.js} +1 -1
  31. package/dist/esm-es5/copy-text-view-3129fb22.js +1 -0
  32. package/dist/esm-es5/copy-text-view-a319c261.js +1 -0
  33. package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
  34. package/dist/esm-es5/sqm-coupon-code-view-af016712.js +1 -0
  35. package/dist/esm-es5/sqm-coupon-code.entry.js +1 -0
  36. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  37. package/dist/esm-es5/sqm-referral-code.entry.js +1 -0
  38. package/dist/esm-es5/sqm-reward-exchange-list.entry.js +1 -0
  39. package/dist/esm-es5/sqm-share-code.entry.js +1 -0
  40. package/dist/esm-es5/sqm-share-link.entry.js +1 -0
  41. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  42. package/dist/mint-components/RewardExchangeListData-11c043e3.js +1122 -0
  43. package/dist/mint-components/RewardExchangeListData-546ffbb9.system.js +1 -0
  44. package/dist/mint-components/copy-text-view-3129fb22.js +119 -0
  45. package/dist/mint-components/copy-text-view-33cac657.system.js +1 -0
  46. package/dist/mint-components/mint-components.esm.js +1 -1
  47. package/dist/mint-components/{p-2bf5998b.entry.js → p-1276830a.entry.js} +1 -1
  48. package/dist/mint-components/p-1de49f76.js +1 -0
  49. package/dist/mint-components/{p-94952e33.js → p-6b904749.js} +1 -1
  50. package/dist/mint-components/p-a89baf7b.system.js +1 -1
  51. package/dist/mint-components/{p-ba0c9f88.system.entry.js → p-aa77d858.system.entry.js} +1 -1
  52. package/dist/mint-components/{p-45736fa8.system.js → p-bdc86ee3.system.js} +1 -1
  53. package/dist/mint-components/{p-680894bd.system.entry.js → p-be770d69.system.entry.js} +1 -1
  54. package/dist/mint-components/{p-0bac31a6.entry.js → p-e34b460e.entry.js} +1 -1
  55. package/dist/mint-components/{p-4e3ec053.system.entry.js → p-ed69dc98.system.entry.js} +1 -1
  56. package/dist/mint-components/p-f4f57363.system.js +1 -0
  57. package/dist/mint-components/{p-dba96a48.entry.js → p-f9f67437.entry.js} +2 -2
  58. package/dist/mint-components/sqm-coupon-code-view-40fd8d8b.system.js +1 -0
  59. package/dist/mint-components/sqm-coupon-code-view-af016712.js +33 -0
  60. package/dist/mint-components/sqm-coupon-code.entry.js +281 -0
  61. package/dist/mint-components/sqm-coupon-code.system.entry.js +1 -0
  62. package/dist/mint-components/sqm-referral-code.entry.js +173 -0
  63. package/dist/mint-components/sqm-referral-code.system.entry.js +1 -0
  64. package/dist/mint-components/sqm-reward-exchange-list.entry.js +1014 -0
  65. package/dist/mint-components/sqm-reward-exchange-list.system.entry.js +1 -0
  66. package/dist/mint-components/sqm-share-code.entry.js +143 -0
  67. package/dist/mint-components/sqm-share-code.system.entry.js +1 -0
  68. package/dist/mint-components/sqm-share-link.entry.js +98 -0
  69. package/dist/mint-components/sqm-share-link.system.entry.js +1 -0
  70. package/dist/mint-components/sqm-stencilbook.entry.js +20330 -0
  71. package/dist/mint-components/sqm-stencilbook.system.entry.js +1 -0
  72. package/docs/docs.docx +0 -0
  73. package/package.json +1 -1
  74. package/dist/esm-es5/copy-text-view-61bd1ac1.js +0 -1
  75. package/dist/mint-components/p-c5ca5b5f.js +0 -1
  76. package/dist/mint-components/p-efeab858.system.js +0 -1
@@ -0,0 +1,1144 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-ad175903.js');
4
+ const global = require('./global-aae86f09.js');
5
+ const JSS = require('./JSS-518e9b4d.js');
6
+ const mixins = require('./mixins-f51b04f1.js');
7
+ const copyTextView = require('./copy-text-view-f0313f78.js');
8
+
9
+ const LeftArrow = () => (index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { marginBottom: "-2px", marginRight: "5px" } },
10
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.34655 1.90573C7.75405 2.31323 7.75405 2.97392 7.34655 3.38143L3.56266 7.16531H14.9565C15.5328 7.16531 16 7.6325 16 8.20879C16 8.78509 15.5328 9.25227 14.9565 9.25227H3.56266L7.69437 13.384C8.10188 13.7915 8.10188 14.4522 7.69437 14.8597C7.28687 15.2672 6.62617 15.2672 6.21867 14.8597L0.305628 8.94664C-0.101876 8.53914 -0.101876 7.87845 0.305628 7.47094L5.87084 1.90573C6.27835 1.49822 6.93904 1.49822 7.34655 1.90573Z", fill: "#858585" })));
11
+ const ExchangeArrows = () => (index.h("svg", { width: 19, height: 15, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
12
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M5.125 14.783a.6.6 0 0 1-.851 0l-3.9-3.923a.6.6 0 1 1 .85-.846L4.1 12.905V1.52a.6.6 0 0 1 1.2 0v11.385l2.875-2.891a.6.6 0 1 1 .85.846l-3.9 3.923Zm9.6-13.686a.6.6 0 0 0-.851 0l-3.9 3.923a.6.6 0 0 0 .85.846L13.7 2.975V14.36a.6.6 0 1 0 1.2 0V2.975l2.875 2.891a.6.6 0 1 0 .85-.846l-3.9-3.923Z", fill: "#333" })));
13
+ const CheckMark = () => (index.h("svg", { width: 12, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.58.23c.475.371.56 1.057.19 1.532L5.69 9.554a1.091 1.091 0 0 1-1.631.1L.32 5.915a1.09 1.09 0 1 1 1.542-1.542L4.73 7.239 10.049.42A1.09 1.09 0 0 1 11.58.23Z", fill: "#fff" })));
15
+ const CheckmarkFilled = () => (index.h("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
16
+ index.h("path", { d: "M0 9C0 4.02944 4.02944 0 9 0C13.9706 0 18 4.02944 18 9C18 13.9706 13.9706 18 9 18C4.02944 18 0 13.9706 0 9Z", fill: "currentColor" }),
17
+ index.h("path", { d: "M5.68394 8.77046C5.28103 8.39273 4.64819 8.41315 4.27046 8.81606C3.89273 9.21897 3.91315 9.85181 4.31606 10.2295L5.68394 8.77046ZM7.66667 12L6.98273 12.7295C7.36738 13.0902 7.96595 13.0902 8.35061 12.7295L7.66667 12ZM13.6839 7.72954C14.0869 7.35181 14.1073 6.71897 13.7295 6.31606C13.3518 5.91315 12.719 5.89273 12.3161 6.27046L13.6839 7.72954ZM4.31606 10.2295L6.98273 12.7295L8.35061 11.2705L5.68394 8.77046L4.31606 10.2295ZM8.35061 12.7295L13.6839 7.72954L12.3161 6.27046L6.98273 11.2705L8.35061 12.7295Z", fill: "white" })));
18
+ const Gift = () => (index.h("svg", { width: 156, height: 157, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
19
+ index.h("path", { d: "M40.18 126h83.663a3 3 0 0 0 3-3V73.966a3 3 0 0 0-3-3H40.18a3 3 0 0 0-3 3V123a3 3 0 0 0 3 3Z", fill: "#FFD34F" }),
20
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M37.18 73.862v7.966h89.663v-7.966H37.18Z", fill: "#E9BB30" }),
21
+ index.h("path", { d: "M133.039 74.224a2.18 2.18 0 0 0 2.187-2.172v-19.19c0-1.2-.98-2.172-2.187-2.172H31.347a2.18 2.18 0 0 0-2.187 2.172v19.19c0 1.2.98 2.172 2.187 2.172H133.04Z", fill: "#FFC000" }),
22
+ index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M123.287 35.172c0 6.056-9.155 15.226-13.76 15.654H88.888V126H75.141V50.826H58.534c-9.462-2.038-17.803-9.258-17.803-16.944 0-7.49 3.274-13.422 9.23-15.983 5.693-2.446 12.265-1.105 17.46 2.479 6.378 4.398 9.956 12.654 13.202 20.144.284.657.567 1.308.848 1.95.274-.608.55-1.228.83-1.856 3.216-7.22 6.887-15.464 13.057-19.89 5.454-3.913 12.387-5.39 18.38-2.711 6.197 2.77 9.549 9.127 9.549 17.157Zm-23.306-8.266c3.305-2.37 7.262-2.8 10.645 0 2.946 2.44 3.103 3.588 3.482 6.351l.067.483c0 4.09-3.549 10.252-7.097 10.252-2.515 0-4.489-.022-6.34-.041-3.375-.036-6.337-.068-11.403.04.966-1.86 1.737-3.644 2.473-5.346 1.967-4.553 3.678-8.515 8.173-11.739Zm-39.034 0c-1.6-1.103-5.268-.61-6.79.043-1.257.54-3.134 2.19-3.134 6.933 0 4.61 7.511 8.59 7.511 8.59s5.962 1.52 16.607 1.52c-3.624-8.922-8.757-13.336-14.194-17.086Z", fill: "#EB5757" }),
23
+ index.h("path", { d: "M75.086 74.224h13.85v7.604h-13.85v-7.604Z", fill: "#DD4747" }),
24
+ index.h("g", { filter: "url(#a)" },
25
+ index.h("ellipse", { cx: 82.008, cy: 141.207, rx: 36.813, ry: 5.793, fill: "#E0DDDD", "fill-opacity": 0.8 })),
26
+ index.h("path", { d: "M150.446 79.134a.5.5 0 0 1 .9 0l1.133 2.336c.05.102.132.184.234.233l2.344 1.122a.5.5 0 0 1 0 .902l-2.344 1.122a.503.503 0 0 0-.234.233l-1.133 2.336a.5.5 0 0 1-.9 0l-1.134-2.336a.499.499 0 0 0-.234-.233l-2.343-1.122a.5.5 0 0 1 0-.902l2.343-1.122a.499.499 0 0 0 .234-.233l1.134-2.336Z", fill: "#FAB6B6" }),
27
+ index.h("path", { d: "M14.86 29.168a.5.5 0 0 1 .9 0l1.133 2.336a.5.5 0 0 0 .234.233l2.344 1.122a.5.5 0 0 1 0 .902l-2.344 1.122a.5.5 0 0 0-.234.233l-1.133 2.336a.5.5 0 0 1-.9 0l-1.134-2.336a.5.5 0 0 0-.234-.233l-2.343-1.122a.5.5 0 0 1 0-.902l2.344-1.122a.5.5 0 0 0 .233-.233l1.134-2.336Z", fill: "#F4EFBC" }),
28
+ index.h("path", { d: "m125.382 0 .712 1.466 1.475.706-1.475.707-.712 1.466-.711-1.466-1.476-.707 1.476-.706.711-1.466Z", fill: "#FDA802" }),
29
+ index.h("path", { d: "m2.187 103.552.711 1.466 1.476.706-1.476.707-.711 1.466-.711-1.466L0 105.724l1.476-.706.71-1.466Z", fill: "#E4599C" }),
30
+ index.h("defs", null,
31
+ index.h("filter", { id: "a", x: 35.195, y: 125.414, width: 93.625, height: 31.586, filterUnits: "userSpaceOnUse", "color-interpolation-filters": "s-rGB" },
32
+ index.h("feFlood", { "flood-opacity": 0, result: "BackgroundImageFix" }),
33
+ index.h("feBlend", { in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
34
+ index.h("feGaussianBlur", { stdDeviation: 5, result: "effect1_foregroundBlur_653_17907" })))));
35
+
36
+ function Dot({ active, completed, incomplete, stage, }) {
37
+ return (index.h("div", { style: {
38
+ display: "flex",
39
+ } },
40
+ index.h("div", { style: {
41
+ backgroundColor: completed
42
+ ? "var(--sqm-success-color-icon)"
43
+ : incomplete
44
+ ? "var(--sqm-border-color)"
45
+ : "white",
46
+ border: active
47
+ ? "1px solid var(--sqm-success-color-border)"
48
+ : incomplete
49
+ ? "1px solid var(--sqm-border-color)"
50
+ : "1px solid var(--sqm-success-color-border)",
51
+ borderRadius: "50%",
52
+ width: "23px",
53
+ height: "23px",
54
+ margin: "-11px",
55
+ zIndex: "1",
56
+ boxSizing: "content-box",
57
+ } }, completed ? (index.h("div", { style: { top: "-10.5%", left: "23.5%", position: "relative" } },
58
+ index.h(CheckMark, null))) : (index.h("div", { style: {
59
+ color: active
60
+ ? "var(--sqm-success-color-border)"
61
+ : "var(--sqm-text-subdued)",
62
+ width: "23px",
63
+ lineHeight: "24px",
64
+ textAlign: "center",
65
+ position: "relative",
66
+ } }, stage + 1)))));
67
+ }
68
+ function ProgressLine({ incomplete = false, active = false, invisible = false, }) {
69
+ return (index.h("div", { style: {
70
+ content: "''",
71
+ flex: "0.5 0.5 0",
72
+ height: "4px",
73
+ borderRadius: "4px",
74
+ background: incomplete || active
75
+ ? "var(--sqm-border-color)"
76
+ : "var(--sqm-success-color-icon)",
77
+ position: "relative",
78
+ bottom: "0",
79
+ left: "0",
80
+ display: "flex",
81
+ justifyContent: "center",
82
+ columnGap: "50px",
83
+ marginRight: "-2px",
84
+ boxSizing: "content-box",
85
+ opacity: invisible ? "0" : "1",
86
+ } }));
87
+ }
88
+ function Progress({ active, completed, incomplete, stage }) {
89
+ return [
90
+ index.h(ProgressLine, { incomplete: incomplete, invisible: stage === 0 }),
91
+ index.h(Dot, { active: active, completed: completed, incomplete: incomplete, stage: stage }),
92
+ index.h(ProgressLine, { incomplete: incomplete, active: active, invisible: stage === 2 }),
93
+ ];
94
+ }
95
+ function ProgressBar({ stageCount, currentStage, }) {
96
+ return (index.h("div", { style: { display: "flex", columnGap: "-2px" } }, Array.from(Array(stageCount).keys()).map((stage) => (index.h(Progress, { active: currentStage === stage, completed: currentStage > stage, incomplete: currentStage < stage, stage: stage })))));
97
+ }
98
+
99
+ const style = {
100
+ HostBlock: mixins.HostBlock,
101
+ Container: {
102
+ minWidth: "300px",
103
+ position: "relative",
104
+ },
105
+ FullImage: {
106
+ objectFit: "contain",
107
+ maxWidth: "100%",
108
+ height: "250px",
109
+ display: "flex",
110
+ margin: "0 auto",
111
+ },
112
+ Select: {
113
+ "&::part(base)": {
114
+ borderRadius: "var(--sqm-input-border-radius)",
115
+ },
116
+ "&::part(label)": {
117
+ color: "var(--sqm-input-label-color)",
118
+ },
119
+ "&::part(menu)": {
120
+ maxHeight: "450px",
121
+ },
122
+ "& sl-menu-item::part(checked-icon)": {
123
+ top: "8px",
124
+ color: "var(--sqm-text)",
125
+ },
126
+ "& sl-menu-item::part(base)": {
127
+ flexDirection: "column",
128
+ },
129
+ "& sl-menu-item::part(base):focus": {
130
+ background: "var(--sqm-accent-color-background)",
131
+ color: "var(--sqm-text)",
132
+ },
133
+ },
134
+ ProgressBar: {
135
+ maxWidth: "350px",
136
+ width: "100%",
137
+ margin: "auto",
138
+ marginBottom: "var(--sl-spacing-xxx-large)",
139
+ "& .text-area": {
140
+ marginTop: "5px",
141
+ display: "flex",
142
+ justifyContent: "center",
143
+ textAlign: "center",
144
+ whiteSpace: "nowrap",
145
+ marginBottom: "6px",
146
+ "& .text": {
147
+ marginBottom: "var(--sl-spacing-x-small)",
148
+ flex: "1 1 0",
149
+ },
150
+ "& .text.subdued": {
151
+ color: "var(--sqm-text-subdued)",
152
+ },
153
+ },
154
+ },
155
+ CardLayout: {
156
+ display: "flex",
157
+ width: "100%",
158
+ borderRadius: "3px",
159
+ background: "rgba(0, 0, 0, 0)",
160
+ },
161
+ Card: {
162
+ display: "flex",
163
+ userSelect: "none",
164
+ height: "120px",
165
+ "&::part(base)": {
166
+ background: "var(--sqm-portal-background)",
167
+ border: "var(--sqm-border-thickness) solid var(--sqm-border-color)",
168
+ borderRadius: "var(--sqm-border-radius-normal)",
169
+ boxShadow: "none",
170
+ width: "100%",
171
+ },
172
+ "&::part(body)": {
173
+ display: "flex",
174
+ padding: 0,
175
+ },
176
+ "& .selected": {
177
+ borderRadius: "var(--sqm-border-radius-normal)",
178
+ position: "relative",
179
+ top: "-2%",
180
+ left: "100%",
181
+ color: "var(--sqm-primary-color)",
182
+ margin: "-9px",
183
+ },
184
+ },
185
+ Title: {
186
+ fontSize: "var(--sl-font-size-large)",
187
+ fontWeight: "var(--sl-font-weight-semibold)",
188
+ margin: "var(--sl-spacing-large) 0",
189
+ },
190
+ Image: {
191
+ padding: "var(--sl-spacing-small)",
192
+ minWidth: "96px",
193
+ maxWidth: "96px",
194
+ "& .image": {
195
+ width: "100%",
196
+ height: "100%",
197
+ objectFit: "contain",
198
+ borderRadius: "4px",
199
+ },
200
+ "& .image.subdued": {
201
+ filter: "brightness(0.95)",
202
+ opacity: "0.5",
203
+ },
204
+ },
205
+ TextArea: {
206
+ textAlign: "left",
207
+ padding: "var(--sl-spacing-small)",
208
+ paddingLeft: "0",
209
+ "& .title": {
210
+ fontSize: "var(--sl-font-size-medium)",
211
+ lineHeight: "var(--sl-line-height-dense)",
212
+ fontWeight: "600",
213
+ color: "var(--sqm-text)",
214
+ display: "-webkit-box",
215
+ "-webkit-line-clamp": "1",
216
+ "-webkit-box-orient": "vertical",
217
+ overflow: "hidden",
218
+ },
219
+ "& .amount": {
220
+ fontSize: "var(--sl-font-size-small)",
221
+ lineHeight: "var(--sl-line-height-dense)",
222
+ marginTop: "var(--sl-spacing-x-small)",
223
+ color: "var(--sqm-text-subdued)",
224
+ display: "-webkit-box",
225
+ "-webkit-line-clamp": "1",
226
+ "-webkit-box-orient": "vertical",
227
+ overflow: "hidden",
228
+ },
229
+ "& .error": {
230
+ fontSize: "var(--sl-font-size-small)",
231
+ lineHeight: "var(--sl-line-height-dense)",
232
+ marginTop: "var(--sl-spacing-x-small)",
233
+ fontWeight: "600",
234
+ color: "var(--sqm-warning-color-icon)",
235
+ display: "-webkit-box",
236
+ "-webkit-line-clamp": "1",
237
+ "-webkit-box-orient": "vertical",
238
+ overflow: "hidden",
239
+ "& .icon": {
240
+ position: "relative",
241
+ top: "0.1em",
242
+ marginRight: "var(--sl-spacing-xx-small)",
243
+ },
244
+ },
245
+ },
246
+ ChooseAmount: {
247
+ maxWidth: "800px",
248
+ margin: "auto",
249
+ "& .wrapper": {
250
+ display: "flex",
251
+ gap: "var(--sl-spacing-xx-large)",
252
+ "@media (max-width: 799px)": {
253
+ flexDirection: "column",
254
+ },
255
+ },
256
+ "& .image": {
257
+ width: "50%",
258
+ objectFit: "contain",
259
+ maxWidth: "100%",
260
+ height: "250px",
261
+ display: "flex",
262
+ "@media (max-width: 799px)": {
263
+ width: "auto",
264
+ },
265
+ },
266
+ "& .text": {
267
+ width: "50%",
268
+ maxWidth: "400px",
269
+ "@media (max-width: 799px)": {
270
+ width: "auto",
271
+ margin: "auto",
272
+ },
273
+ },
274
+ "& .title": {
275
+ fontSize: "var(--sl-font-size-large)",
276
+ fontWeight: "var(--sl-font-weight-semibold)",
277
+ color: "var(--sqm-text)",
278
+ },
279
+ "& .points": {
280
+ fontSize: "var(--sl-font-size-large)",
281
+ fontWeight: "var(--sl-font-weight-semibold)",
282
+ color: "var(--sqm-accent-color-text)",
283
+ },
284
+ "& .description": {
285
+ fontSize: "var(--sl-font-size-medium)",
286
+ fontWeight: "var(--sl-font-weight-normal)",
287
+ color: "var(--sqm-text-subdued)",
288
+ margin: "var(--sl-spacing-medium) 0",
289
+ lineHeight: "var(--sl-line-height-dense)",
290
+ marginTop: "var(--sl-spacing-xx-small)",
291
+ },
292
+ "& .space": {
293
+ marginBottom: "var(--sl-spacing-xxx-large)",
294
+ },
295
+ "& sl-menu-item[disabled]::part(label)": {
296
+ color: "var(sqm-text-subdued)",
297
+ },
298
+ "& sl-menu-item[disabled]": {
299
+ "& .step-cost": {
300
+ color: "var(sqm-text-subdued)",
301
+ },
302
+ "& .step-value": {
303
+ color: "var(sqm-text-subdued)",
304
+ },
305
+ },
306
+ },
307
+ SelectItem: {
308
+ display: "flex",
309
+ flexDirection: "column",
310
+ "&::part(label)": {
311
+ color: "var(--sqm-text)",
312
+ margin: "0",
313
+ },
314
+ "& .step-cost": {
315
+ color: "var(--sqm-text-subdued)",
316
+ marginBottom: "var(--sl-spacing-x-small)",
317
+ },
318
+ "& .step-unavailable": {
319
+ fontSize: "var(--sl-font-size-small)",
320
+ color: "var(--sqm-warning-color-text)",
321
+ margin: "0",
322
+ },
323
+ },
324
+ Success: {
325
+ textAlign: "center",
326
+ "& .title": {
327
+ fontSize: "var(--sl-font-size-large)",
328
+ fontWeight: "var(--sl-font-weight-semibold)",
329
+ color: "var(--sqm-text)",
330
+ },
331
+ "& .description": {
332
+ color: "var(--sqm-text-subued)",
333
+ maxWidth: "350px",
334
+ margin: "0 auto",
335
+ lineHeight: "var(--sl-line-height-dense)",
336
+ marginBottom: "var(--sl-spacing-xx-large)",
337
+ marginTop: "var(--sl-spacing-xx-small)",
338
+ },
339
+ "& .promo": {
340
+ maxWidth: "350px",
341
+ margin: "-30px auto var(--sl-spacing-xxx-large) auto",
342
+ textAlign: "left",
343
+ color: "var(--sqm-text-subdued)",
344
+ },
345
+ },
346
+ Grid: {
347
+ display: "grid",
348
+ justifyContent: "center",
349
+ gap: "20px",
350
+ gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
351
+ },
352
+ Confirmation: {
353
+ maxWidth: "800px",
354
+ margin: "auto",
355
+ "& .wrapper": {
356
+ display: "flex",
357
+ "@media (max-width: 499px)": {
358
+ flexDirection: "column",
359
+ },
360
+ },
361
+ "& .reward-item-container": {
362
+ "@media (max-width: 499px)": {
363
+ display: "flex",
364
+ flexDirection: "row-reverse",
365
+ justifyContent: "flex-end",
366
+ alignItems: "center",
367
+ },
368
+ },
369
+ "& .reward-item-container .reward-title": {
370
+ paddingBottom: "var(--sl-spacing-medium)",
371
+ lineHeight: "20px",
372
+ "@media (max-width: 499px)": {
373
+ paddingBottom: "none",
374
+ paddingLeft: "var(--sl-spacing-small)",
375
+ },
376
+ },
377
+ "& .padding": {
378
+ padding: "var(--sl-spacing-medium) 0",
379
+ "@media (max-width: 499px)": {
380
+ padding: "var(--sl-spacing-small) 0",
381
+ },
382
+ },
383
+ "& .field": {
384
+ width: "30%",
385
+ fontSize: "var(--sl-font-size-medium)",
386
+ fontWeight: "var(--sl-font-weight-normal)",
387
+ color: "var(--sqm-text-subdued)",
388
+ textAlign: "left",
389
+ paddingRight: "var(--sl-spacing-xxx-large)",
390
+ "@media (max-width: 499px)": {
391
+ width: "100%",
392
+ paddingRight: "0",
393
+ paddingBottom: "0",
394
+ },
395
+ },
396
+ "& .value": {
397
+ fontSize: "var(--sl-font-size-large)",
398
+ fontWeight: "var(--sl-font-weight-semibold)",
399
+ },
400
+ "& .top-border": {
401
+ borderTop: "var(--sqm-border-thickness) solid var(--sqm-border-color)",
402
+ },
403
+ "& .image": {
404
+ width: "200px",
405
+ "@media (max-width: 499px)": {
406
+ width: "100px",
407
+ },
408
+ },
409
+ },
410
+ Button: {
411
+ display: "flex",
412
+ flexWrap: "wrap-reverse",
413
+ margin: "var(--sl-spacing-medium) 0",
414
+ "& .cancel": {
415
+ marginLeft: "auto",
416
+ marginRight: "var(--sl-spacing-medium)",
417
+ "@media (max-width: 499px)": {
418
+ width: "100%",
419
+ marginRight: "0",
420
+ marginTop: "var(--sl-spacing-small)",
421
+ },
422
+ },
423
+ "& .continue": {
424
+ "@media (max-width: 499px)": {
425
+ width: "100%",
426
+ },
427
+ },
428
+ "& .continue.right": {
429
+ marginLeft: "auto",
430
+ },
431
+ "& .continue.center": {
432
+ margin: "0 auto",
433
+ },
434
+ },
435
+ Confetti: {
436
+ pointerEvents: "none",
437
+ position: "absolute",
438
+ width: "100%",
439
+ height: "100%",
440
+ top: "0%",
441
+ left: "0%",
442
+ zIndex: "1",
443
+ },
444
+ };
445
+ // JSS config
446
+ const sheet = JSS.createStyleSheet(style);
447
+ const styleString = sheet.toString();
448
+ const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
449
+ function RewardExchangeView(props) {
450
+ const { states, data, callbacks, refs } = props;
451
+ const { selectedItem, selectedStep } = states;
452
+ const stageProgressList = {
453
+ chooseReward: states.content.text.chooseRewardTitle,
454
+ chooseAmount: states.content.text.chooseAmountTitle,
455
+ confirmation: states.content.text.confirmationTitle,
456
+ };
457
+ function getInput() {
458
+ var _a, _b, _c;
459
+ const item = states.selectedItem;
460
+ if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
461
+ return index.h("span", { class: "points" }, item === null || item === void 0 ? void 0 : item.prettySourceValue);
462
+ if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
463
+ return (index.h("p", null, global.intl.formatMessage({
464
+ id: "notEnoughError",
465
+ defaultMessage: states.content.text.notEnoughError,
466
+ }, {
467
+ sourceUnit: item.sourceUnit,
468
+ })));
469
+ }
470
+ return (index.h("sl-select", { style: { width: "auto" }, label: (_b = states === null || states === void 0 ? void 0 : states.content) === null || _b === void 0 ? void 0 : _b.text.selectText, class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
471
+ var _a, _b, _c, _d, _e;
472
+ return callbacks.setExchangeState({
473
+ amount: (_c = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.sourceValue,
474
+ selectedStep: (_e = (_d = e.detail) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.value,
475
+ });
476
+ } }, (_c = item.steps) === null || _c === void 0 ? void 0 : _c.map((step) => {
477
+ var _a, _b;
478
+ return (index.h("sl-menu-item", { value: step, disabled: !step.available, class: sheet.classes.SelectItem },
479
+ step.prettyDestinationValue,
480
+ index.h("br", null),
481
+ index.h("div", { class: "step-cost", slot: "suffix" },
482
+ step.prettySourceValue,
483
+ step.unavailableReasonCode && (index.h("p", { class: "step-unavailable" }, global.intl.formatMessage({
484
+ id: "unavailableCode",
485
+ defaultMessage: (_b = (_a = states.content) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.notAvailableError,
486
+ }, {
487
+ unavailableReasonCode: step.unavailableReasonCode,
488
+ sourceUnit: item.sourceUnit,
489
+ sourceValue: step.prettySourceValue || item.prettySourceMinValue,
490
+ }))))));
491
+ })));
492
+ }
493
+ function chooseReward() {
494
+ var _a;
495
+ return [
496
+ index.h("div", { part: "choose-reward-container" },
497
+ index.h("div", { class: sheet.classes.Title }, states.content.text.rewardTitle),
498
+ states.loading || states.queryError ? (loading()) : (index.h("div", { class: sheet.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
499
+ var _a, _b, _c, _d, _e;
500
+ const style = {
501
+ boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
502
+ ? "0 0 0 2px var(--sqm-primary-color)"
503
+ : "none",
504
+ borderRadius: "var(--sqm-border-radius-normal)",
505
+ borderColor: "none",
506
+ };
507
+ return (index.h("div", { key: item.key, style: style },
508
+ index.h("sl-card", { exportparts: "base: exchange-card-container", class: sheet.classes.Card, style: {
509
+ cursor: item.unavailableReasonCode
510
+ ? "not-allowed"
511
+ : "pointer",
512
+ }, onClick: () => item.available &&
513
+ callbacks.setExchangeState({ selectedItem: item }) },
514
+ item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (index.h("div", { class: "selected" },
515
+ index.h(CheckmarkFilled, null))),
516
+ index.h("div", { style: {
517
+ display: "flex",
518
+ width: "100%",
519
+ height: "120px",
520
+ borderRadius: "3px",
521
+ background: item.unavailableReasonCode
522
+ ? "rgba(0, 0, 0, 0.05)"
523
+ : "rgba(0, 0, 0, 0)",
524
+ } },
525
+ index.h("div", { class: sheet.classes.Image, style: {
526
+ opacity: item.unavailableReasonCode ? "0.5" : "1",
527
+ } },
528
+ index.h("img", { class: item.unavailableReasonCode
529
+ ? "image subdued"
530
+ : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
531
+ index.getAssetPath("./assets/Reward-image.png") })),
532
+ index.h("div", { class: sheet.classes.TextArea, style: {
533
+ opacity: item.unavailableReasonCode ? "0.5" : "1",
534
+ } },
535
+ index.h("div", { class: "title", style: {
536
+ "-webkit-line-clamp": item.unavailableReasonCode
537
+ ? "1"
538
+ : "2",
539
+ } }, (_a = item.name) !== null && _a !== void 0 ? _a : ""),
540
+ index.h("div", { class: "amount", style: {
541
+ "-webkit-line-clamp": item.unavailableReasonCode
542
+ ? "1"
543
+ : "2",
544
+ } }, global.intl.formatMessage({
545
+ id: "sourceAmountMessage",
546
+ defaultMessage: (_c = (_b = states.content) === null || _b === void 0 ? void 0 : _b.text) === null || _c === void 0 ? void 0 : _c.sourceAmountMessage,
547
+ }, {
548
+ ruleType: item.ruleType,
549
+ sourceValue: item.prettySourceValue,
550
+ sourceMinValue: item.prettySourceMinValue,
551
+ sourceMaxValue: item.prettySourceMaxValue,
552
+ })),
553
+ item.unavailableReasonCode && (index.h("div", { class: "error" },
554
+ index.h("sl-icon", { class: "icon", name: "exclamation-triangle-fill" }),
555
+ global.intl.formatMessage({
556
+ id: "unavailableCode",
557
+ defaultMessage: (_e = (_d = states.content) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e.notAvailableError,
558
+ }, {
559
+ unavailableReasonCode: item.unavailableReasonCode,
560
+ sourceUnit: item.sourceUnit,
561
+ sourceValue: item.prettySourceValue ||
562
+ item.prettySourceMinValue,
563
+ }))))))));
564
+ }))),
565
+ index.h("div", { class: sheet.classes.Button },
566
+ index.h("sl-button", { exportparts: "base: primarybutton-base", type: "primary", class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText))),
567
+ ];
568
+ }
569
+ function chooseAmount() {
570
+ var _a, _b, _c, _d;
571
+ const input = getInput();
572
+ const isDisabled = ((_a = states.selectedItem) === null || _a === void 0 ? void 0 : _a.ruleType) === "FIXED_GLOBAL_REWARD"
573
+ ? false
574
+ : input && !states.amount;
575
+ return (index.h("div", null,
576
+ index.h("div", { class: sheet.classes.ChooseAmount, part: "choose-amount-container" },
577
+ index.h("div", { class: "wrapper" },
578
+ index.h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
579
+ index.getAssetPath("./assets/Reward-image.png") }),
580
+ index.h("div", { class: "text" },
581
+ index.h("div", { class: "title" }, (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : ""),
582
+ ((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (index.h("div", { class: "points" }, input)) : (index.h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
583
+ ((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.ruleType) === "FIXED_GLOBAL_REWARD" ? (index.h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (index.h("div", null, input)),
584
+ index.h("div", { class: "space" }))),
585
+ index.h("div", { class: sheet.classes.Button },
586
+ index.h("sl-button", { exportparts: "base: secondarybutton-base", class: "cancel", size: "large", type: "secondary", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
587
+ index.h("sl-button", { exportparts: "base: primarybutton-base", class: "continue", size: "large", type: "primary", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText)))));
588
+ }
589
+ function confirmation() {
590
+ const cost = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettySourceValue) || selectedItem.prettySourceValue;
591
+ const amount = selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue;
592
+ return (index.h("div", null,
593
+ index.h("div", { class: sheet.classes.Confirmation, part: "confirmation-container" },
594
+ index.h("div", { class: sheet.classes.Title }, states.content.text.redeemTitle),
595
+ index.h("div", { class: "wrapper" },
596
+ index.h("div", { class: "field" }, states.content.text.rewardNameTitle),
597
+ index.h("div", { class: "reward-item-container" },
598
+ index.h("div", { class: "reward-title" }, selectedItem.name),
599
+ index.h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
600
+ index.getAssetPath("./assets/Reward-image.png") }))),
601
+ index.h("div", { class: "wrapper padding" },
602
+ index.h("div", { class: "field" })),
603
+ amount && (index.h("div", { class: "wrapper top-border padding" },
604
+ index.h("div", { class: "field" }, states.content.text.rewardAmountTitle),
605
+ index.h("div", null, amount))),
606
+ index.h("div", { class: "wrapper top-border padding" },
607
+ index.h("div", { class: "field" }, states.content.text.costTitle),
608
+ index.h("div", { class: "value" }, cost)),
609
+ index.h("div", { class: sheet.classes.Button },
610
+ index.h("sl-button", { class: "cancel", type: "secondary", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
611
+ index.h("sl-button", { class: "continue", size: "large", type: "primary", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText)))));
612
+ }
613
+ function success() {
614
+ var _a, _b, _c, _d, _e, _f;
615
+ return (index.h("div", { class: sheet.classes.Success, part: "success-container" },
616
+ index.h(Gift, null),
617
+ index.h(Confetti, null),
618
+ index.h("div", { class: "title" }, (_a = states.content.text) === null || _a === void 0 ? void 0 : _a.rewardRedeemedText),
619
+ index.h("div", { class: "description" }, global.intl.formatMessage({
620
+ id: "successMessage",
621
+ defaultMessage: states.content.text.redemptionSuccessText,
622
+ }, {
623
+ sourceValue: (_b = states.selectedItem.prettySourceValue) !== null && _b !== void 0 ? _b : (_c = states.selectedStep) === null || _c === void 0 ? void 0 : _c.prettySourceValue,
624
+ destinationValue: ((_d = states.selectedStep) === null || _d === void 0 ? void 0 : _d.prettyDestinationValue) || ((_e = states.selectedItem) === null || _e === void 0 ? void 0 : _e.name) ||
625
+ states.selectedItem.globalRewardKey,
626
+ })),
627
+ (data === null || data === void 0 ? void 0 : data.fuelTankCode) && (index.h("div", { class: "promo" },
628
+ states.content.text.promoCode,
629
+ index.h(copyTextView.CopyTextView, { copyString: data.fuelTankCode, tooltiptext: (_f = states === null || states === void 0 ? void 0 : states.content) === null || _f === void 0 ? void 0 : _f.text.tooltipText, open: states.open, onClick: callbacks.copyFuelTankCode }))),
630
+ index.h("div", { class: sheet.classes.Button },
631
+ index.h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
632
+ }
633
+ const stages = {
634
+ chooseReward: () => chooseReward(),
635
+ chooseAmount: () => chooseAmount(),
636
+ confirmation: () => confirmation(),
637
+ success: () => success(),
638
+ };
639
+ const currentStage = stages[states.redeemStage];
640
+ function stageMap() {
641
+ const stageNumber = stageList.indexOf(states.redeemStage);
642
+ return (index.h("div", { class: sheet.classes.ProgressBar },
643
+ index.h("div", { class: "text-area" }, Object.keys(stageProgressList).map((stage) => {
644
+ if (stageList.indexOf(stage) <= stageNumber) {
645
+ return index.h("span", { class: "text" }, stageProgressList[stage]);
646
+ }
647
+ else {
648
+ return (index.h("span", { class: "text subdued" }, stageProgressList[stage]));
649
+ }
650
+ })),
651
+ index.h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
652
+ }
653
+ function loading() {
654
+ return (index.h("div", { class: sheet.classes.Grid, part: "loading-container" }, [...Array(states.content.text.skeletonCardNum)].map(() => {
655
+ return (index.h("div", null,
656
+ index.h("sl-card", { class: sheet.classes.Card },
657
+ index.h("div", { class: sheet.classes.CardLayout },
658
+ index.h("div", null,
659
+ index.h("sl-skeleton", { style: {
660
+ width: "100px",
661
+ height: "100px",
662
+ margin: "9px",
663
+ "--border-radius": "var(--sqm-border-radius-normal)",
664
+ } })),
665
+ index.h("div", { style: {
666
+ margin: "var(--sl-spacing-small) var(--sl-spacing-small) 0 0",
667
+ width: "100%",
668
+ } },
669
+ index.h("sl-skeleton", { style: { marginBottom: "var(--sl-spacing-small)" } }),
670
+ index.h("sl-skeleton", { style: { marginBottom: "var(--sl-spacing-small)" } }),
671
+ index.h("sl-skeleton", { style: { width: "45%" } }))))));
672
+ })));
673
+ }
674
+ function errorMessage() {
675
+ return (index.h("sl-alert", { type: "danger", open: true },
676
+ index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
677
+ states.content.text.redemptionError));
678
+ }
679
+ function queryErrorMessage() {
680
+ return (index.h("sl-alert", { type: "danger", open: true },
681
+ index.h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
682
+ states.content.text.queryError));
683
+ }
684
+ function Confetti() {
685
+ return (index.h("canvas", { ref: (canvas) => {
686
+ if (!(refs === null || refs === void 0 ? void 0 : refs.canvasRef))
687
+ return;
688
+ refs.canvasRef.current = canvas;
689
+ }, id: "my-canvas", class: sheet.classes.Confetti }));
690
+ }
691
+ if (states.noExchangeOptions)
692
+ return states.content.text.empty;
693
+ return (index.h("div", { class: sheet.classes.Container, part: "sqm-base" },
694
+ index.h("style", { type: "text/css" }, styleString),
695
+ index.h("div", null,
696
+ stageMap(),
697
+ states.exchangeError && errorMessage(),
698
+ states.queryError && !states.exchangeError && queryErrorMessage(),
699
+ currentStage && currentStage(),
700
+ states.redeemStage === "success")));
701
+ }
702
+
703
+ const baseResponse = (data, stage = "chooseReward", selectedItem = null, selectedStep = null, exchangeError = false, loading = false, fueltank = null, noExchangeOptions = false, queryError = false) => ({
704
+ states: {
705
+ content: {
706
+ text: {
707
+ notAvailableError: "{unavailableReasonCode, select, NOT_CHAMPION {CUSTOM ERROR MESSAGE } US_TAX {Exceeds tax limit for this year} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} AVAILABILITY_PREDICATE {Not available} other {unavailableReasonCode} }",
708
+ chooseRewardTitle: "Rewards",
709
+ chooseAmountTitle: "Select",
710
+ confirmationTitle: "Confirm",
711
+ rewardTitle: "Choose a reward",
712
+ cancelText: "Cancel",
713
+ backText: "Back",
714
+ continueText: "Continue",
715
+ continueToConfirmationText: "Continue to confirmation",
716
+ redeemText: "Redeem",
717
+ redeemTitle: "Confirm and redeem",
718
+ redemptionSuccessText: "Redeemed {sourceValue} for {destinationValue}",
719
+ doneText: "Done",
720
+ tooltipText: "Copied!",
721
+ selectText: "Select amount to receive",
722
+ sourceAmountMessage: "{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}",
723
+ rewardRedeemedText: "Reward redeemed",
724
+ redemptionError: "An error occured trying to redeem this reward. Please try again",
725
+ queryError: "Unable to load reward exchange list. Please try again",
726
+ promoCode: "Promo code",
727
+ skeletonCardNum: 8,
728
+ rewardNameTitle: "Reward Name",
729
+ rewardAmountTitle: "Reward Amount",
730
+ costTitle: "Cost",
731
+ notEnoughError: "Sorry not enough!",
732
+ empty: (index.h("sqm-empty", { emptyStateImage: "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_exchange2.png", emptyStateHeader: "Redeem rewards", emptyStateText: "Use your points to redeem rewards once they become available" })),
733
+ },
734
+ },
735
+ queryError: queryError,
736
+ redeemStage: stage,
737
+ amount: 0,
738
+ exchangeError: exchangeError,
739
+ loading: loading,
740
+ selectedItem: selectedItem,
741
+ selectedStep: selectedStep,
742
+ noExchangeOptions: noExchangeOptions,
743
+ open: false,
744
+ },
745
+ data: {
746
+ exchangeList: data,
747
+ fuelTankCode: fueltank,
748
+ },
749
+ callbacks: {
750
+ exchangeReward: null,
751
+ resetState: null,
752
+ setStage: null,
753
+ setExchangeState: null,
754
+ copyFuelTankCode: null,
755
+ },
756
+ refs: null,
757
+ });
758
+ const baseReward = {
759
+ key: "reward",
760
+ name: "Demo Reward",
761
+ description: "Description of reward. Lorem ipsum dolor sit amet, consectetur adipiscing. Id nec semper sapien dignissim rhoncus nunc.",
762
+ imageUrl: "https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png",
763
+ available: true,
764
+ unavailableReasonCode: null,
765
+ ruleType: "FIXED_GLOBAL_REWARD",
766
+ sourceUnit: "POINT",
767
+ sourceValue: 10,
768
+ prettySourceValue: "10 SaaSquatch Points",
769
+ sourceMinValue: null,
770
+ prettySourceMinValue: null,
771
+ sourceMaxValue: null,
772
+ prettySourceMaxValue: null,
773
+ destinationMinValue: null,
774
+ prettyDestinationMinValue: null,
775
+ destinationMaxValue: null,
776
+ prettyDestinationMaxValue: null,
777
+ globalRewardKey: "",
778
+ destinationUnit: null,
779
+ steps: [
780
+ {
781
+ prettyDestinationValue: "Reward Step 1",
782
+ prettySourceValue: "50 Points",
783
+ available: true,
784
+ unavailableReasonCode: null,
785
+ destinationValue: 10,
786
+ sourceValue: 1,
787
+ globalRewardKey: "reward1",
788
+ rewardInput: {
789
+ accountId: "zach",
790
+ userId: "zach",
791
+ },
792
+ },
793
+ {
794
+ prettyDestinationValue: "Reward Step 2",
795
+ prettySourceValue: "100 Points",
796
+ available: false,
797
+ unavailableReasonCode: "Not enough points",
798
+ destinationValue: 10,
799
+ sourceValue: 1,
800
+ globalRewardKey: "reward1",
801
+ rewardInput: {
802
+ accountId: "zach",
803
+ userId: "zach",
804
+ },
805
+ },
806
+ ],
807
+ };
808
+ const notEnoughPoints = {
809
+ available: false,
810
+ unavailableReasonCode: "INSUFFICIENT_REDEEMABLE_CREDIT",
811
+ };
812
+ const usTax = {
813
+ available: false,
814
+ unavailableReasonCode: "US_TAX",
815
+ };
816
+ const customError = {
817
+ available: false,
818
+ unavailableReasonCode: "NOT_CHAMPION",
819
+ };
820
+ const selected = {
821
+ key: "r1",
822
+ };
823
+ const imageUrl = (props) => ({
824
+ imageUrl: props,
825
+ });
826
+ const name = (props) => ({
827
+ name: props,
828
+ });
829
+ const description = (props) => ({
830
+ description: props,
831
+ });
832
+ const fixedValue = (props) => ({
833
+ prettySourceValue: props,
834
+ });
835
+ const variableValue = (min, max, unit) => ({
836
+ ruleType: "VARIABLE_CREDIT_REWARD",
837
+ sourceMinValue: min,
838
+ prettySourceMinValue: min + " " + unit,
839
+ sourceMaxValue: max,
840
+ prettySourceMaxValue: max + " " + unit,
841
+ });
842
+ const demoData = [
843
+ {
844
+ ...baseReward,
845
+ ...name("Free swag with a promo code"),
846
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png"),
847
+ ...fixedValue("40 Points"),
848
+ },
849
+ {
850
+ ...baseReward,
851
+ ...selected,
852
+ ...name("Visa® Prepaid Card USD"),
853
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
854
+ ...variableValue(20, 80, "Points"),
855
+ },
856
+ {
857
+ ...baseReward,
858
+ ...name("$50 Store credit"),
859
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png"),
860
+ ...fixedValue("100 Points"),
861
+ },
862
+ {
863
+ ...baseReward,
864
+ ...name("Variable amount of store credit"),
865
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000240/squatch-assets/Jn2fE0s.png"),
866
+ ...variableValue(20, 100, "Points"),
867
+ },
868
+ ];
869
+ const data = [
870
+ {
871
+ ...baseReward,
872
+ ...name("Free swag with a promo code"),
873
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1643653103/squatch-assets/default_rewards_1.png"),
874
+ ...fixedValue("40 SaaSquatch Points"),
875
+ },
876
+ {
877
+ ...baseReward,
878
+ ...selected,
879
+ ...name("Visa® Prepaid Card USD"),
880
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
881
+ ...variableValue(20, 80, "Points"),
882
+ },
883
+ {
884
+ ...baseReward,
885
+ ...name("A very exclusive gift box"),
886
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/93BvEgH.png"),
887
+ ...fixedValue("30 SaaSquatch Points"),
888
+ },
889
+ {
890
+ ...baseReward,
891
+ ...name("$50 Store credit"),
892
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png"),
893
+ ...fixedValue("100 SaaSquatch Points"),
894
+ },
895
+ {
896
+ ...baseReward,
897
+ ...name("Variable amount of store credit"),
898
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000240/squatch-assets/Jn2fE0s.png"),
899
+ ...variableValue(20, 100, "Points"),
900
+ },
901
+ {
902
+ ...baseReward,
903
+ ...notEnoughPoints,
904
+ ...name("A very rare cactus"),
905
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000224/squatch-assets/hhlF2Ey.png"),
906
+ ...fixedValue("2000 SaaSquatch Points"),
907
+ },
908
+ {
909
+ ...baseReward,
910
+ ...usTax,
911
+ ...name("$1000 Store credit with a really super long name in the front page"),
912
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000273/squatch-assets/y9HSls1.png"),
913
+ ...fixedValue("2000 SaaSquatch Long Points"),
914
+ },
915
+ {
916
+ ...baseReward,
917
+ ...notEnoughPoints,
918
+ ...name("A holiday gift box"),
919
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/dWEdB3p.png"),
920
+ ...fixedValue("100 SaaSquatch Points"),
921
+ },
922
+ ];
923
+ const rewardExchange = {
924
+ ...baseResponse(data),
925
+ };
926
+ const demoRewardExchange = {
927
+ ...baseResponse(demoData),
928
+ };
929
+ const rewardExchangeLongText = {
930
+ ...baseResponse([
931
+ {
932
+ ...baseReward,
933
+ ...notEnoughPoints,
934
+ ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
935
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/dWEdB3p.png"),
936
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
937
+ },
938
+ {
939
+ ...baseReward,
940
+ ...name("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
941
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000273/squatch-assets/y9HSls1.png"),
942
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
943
+ },
944
+ {
945
+ ...baseReward,
946
+ ...name("Suuuuuuuuper aweeeeesssssoooommme reward!!!!!!"),
947
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000270/squatch-assets/WkCMVSE.png"),
948
+ ...fixedValue("Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt ratione a itaque non obcaecati iste, amet repudiandae at consequatur adipisci culpa nam, incidunt exercitationem aliquid."),
949
+ },
950
+ ...data,
951
+ ]),
952
+ };
953
+ const rewardExchangeCustomErrorMsg = {
954
+ ...baseResponse([
955
+ {
956
+ ...baseReward,
957
+ ...customError,
958
+ ...name("A very rare cactus"),
959
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000224/squatch-assets/hhlF2Ey.png"),
960
+ ...fixedValue("2000 SaaSquatch Points"),
961
+ },
962
+ ...data,
963
+ ]),
964
+ };
965
+ const rewardExchangeSelected = {
966
+ ...baseResponse(data, "chooseReward", {
967
+ ...baseReward,
968
+ ...selected,
969
+ ...name("Visa® Prepaid Card USD"),
970
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
971
+ ...variableValue(20, 80, "Points"),
972
+ }),
973
+ };
974
+ const stepsData = (start, end, inc) => {
975
+ const steps = [];
976
+ for (let i = start; i <= end; i += inc) {
977
+ steps.push({
978
+ sourceValue: i,
979
+ prettySourceValue: i + " SaaSquatch Points",
980
+ destinationValue: i,
981
+ prettyDestinationValue: "$" + i,
982
+ available: true,
983
+ unavailableReasonCode: null,
984
+ });
985
+ }
986
+ return steps;
987
+ };
988
+ const baseStep = (dst, dstUnit, src, srcUnit, available = true, unavailableReason = null) => ({
989
+ destinationValue: dst,
990
+ prettyDestinationValue: dstUnit + dst,
991
+ sourceValue: src,
992
+ prettySourceValue: src + " " + srcUnit,
993
+ available: available,
994
+ unavailableReasonCode: unavailableReason,
995
+ });
996
+ const chooseAmountVariable = {
997
+ ...baseResponse(data, "chooseAmount", {
998
+ ...baseReward,
999
+ ...name("Visa® Prepaid Card USD"),
1000
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1001
+ ...variableValue(20, 80, "Points"),
1002
+ steps: [
1003
+ baseStep(20, "$", 40, "Points"),
1004
+ baseStep(30, "$", 60, "Points"),
1005
+ baseStep(40, "$", 80, "Points"),
1006
+ baseStep(50, "$", 100, "Points"),
1007
+ baseStep(60, "$", 120, "Points"),
1008
+ ],
1009
+ }),
1010
+ };
1011
+ const chooseAmountVariableNoDescription = {
1012
+ ...baseResponse(data, "chooseAmount", {
1013
+ ...baseReward,
1014
+ ...name("Visa® Prepaid Card USD"),
1015
+ ...description(""),
1016
+ ...imageUrl("https://i.imgur.com/veHErQX.png"),
1017
+ ...variableValue(20, 80, "Points"),
1018
+ steps: [
1019
+ baseStep(20, "$", 40, "Points"),
1020
+ baseStep(30, "$", 60, "Points"),
1021
+ baseStep(40, "$", 80, "Points"),
1022
+ baseStep(50, "$", 100, "Points"),
1023
+ baseStep(60, "$", 120, "Points"),
1024
+ ],
1025
+ }),
1026
+ };
1027
+ const chooseAmountVariableDisabled = {
1028
+ ...baseResponse(data, "chooseAmount", {
1029
+ ...baseReward,
1030
+ ...name("Visa® Prepaid Card USD"),
1031
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1032
+ ...variableValue(20, 80, "Points"),
1033
+ steps: [
1034
+ baseStep(20, "$", 40, "Points"),
1035
+ baseStep(30, "$", 60, "Points"),
1036
+ baseStep(40, "$", 80, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
1037
+ baseStep(50, "$", 100, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
1038
+ baseStep(60, "$", 120, "Points", false, "INSUFFICIENT_REDEEMABLE_CREDIT"),
1039
+ ],
1040
+ }),
1041
+ };
1042
+ const chooseAmountVariableUnavailable = {
1043
+ ...baseResponse(data, "chooseAmount", {
1044
+ ...baseReward,
1045
+ ...name("Visa® Prepaid Card USD"),
1046
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1047
+ ...variableValue(20, 80, "Points"),
1048
+ steps: [
1049
+ baseStep(20, "$", 40, "Points"),
1050
+ baseStep(30, "$", 60, "Points"),
1051
+ baseStep(40, "$", 80, "Points", false, "US_TAX"),
1052
+ baseStep(50, "$", 100, "Points", false, "US_TAX"),
1053
+ baseStep(60, "$", 120, "Points", false, "US_TAX"),
1054
+ ],
1055
+ }),
1056
+ };
1057
+ const chooseAmountFixed = {
1058
+ ...baseResponse(data, "chooseAmount", {
1059
+ ...baseReward,
1060
+ ...name("Free swag with a promo code"),
1061
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png"),
1062
+ ...fixedValue("40 SaaSquatch Points"),
1063
+ }),
1064
+ };
1065
+ const chooseAmountFixedNoDescription = {
1066
+ ...baseResponse(data, "chooseAmount", {
1067
+ ...baseReward,
1068
+ ...description(""),
1069
+ ...name("Free swag with a promo code"),
1070
+ ...imageUrl("https://i.imgur.com/n7vC4BR.png"),
1071
+ ...fixedValue("40 SaaSquatch Points"),
1072
+ }),
1073
+ };
1074
+ const confirmFixed = {
1075
+ ...baseResponse(data, "confirmation", {
1076
+ ...baseReward,
1077
+ ...name("Free swag with a promo code"),
1078
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png"),
1079
+ ...fixedValue("40 SaaSquatch Points"),
1080
+ }),
1081
+ };
1082
+ const confirmVariable = {
1083
+ ...baseResponse(data, "confirmation", {
1084
+ ...baseReward,
1085
+ ...name("Visa® Prepaid Card USD"),
1086
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1087
+ ...variableValue(20, 80, "Points"),
1088
+ }, baseStep(20, "$", 40, "Points")),
1089
+ };
1090
+ const redemptionError = {
1091
+ ...baseResponse(data, "confirmation", {
1092
+ ...baseReward,
1093
+ ...name("Visa® Prepaid Card USD"),
1094
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000268/squatch-assets/veHErQX.png"),
1095
+ ...variableValue(20, 80, "Points"),
1096
+ }, baseStep(20, "$", 40, "Points"), true),
1097
+ };
1098
+ const queryError = {
1099
+ ...baseResponse(undefined, "chooseReward", undefined, undefined, undefined, undefined, undefined, undefined, true),
1100
+ };
1101
+ const success = {
1102
+ ...baseResponse(data, "success", {
1103
+ ...baseReward,
1104
+ ...name("Free swag with a promo code"),
1105
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000252/squatch-assets/n7vC4BR.png"),
1106
+ ...fixedValue("40 SaaSquatch Points"),
1107
+ }, undefined, undefined, undefined, "4ah2-hh46-gk7r"),
1108
+ };
1109
+ const successVariable = {
1110
+ ...baseResponse(data, "success", {
1111
+ ...baseReward,
1112
+ ...name("Visa® Prepaid Card USD"),
1113
+ ...imageUrl("https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/93BvEgH.png"),
1114
+ ...variableValue(20, 80, "Points"),
1115
+ }, baseStep(20, "$", 40, "Points")),
1116
+ };
1117
+ const loading = {
1118
+ ...baseResponse(null, "chooseReward", null, null, false, true),
1119
+ };
1120
+ const empty = {
1121
+ ...baseResponse(null, "chooseReward", null, null, false, false, null, true),
1122
+ };
1123
+
1124
+ exports.ProgressBar = ProgressBar;
1125
+ exports.RewardExchangeView = RewardExchangeView;
1126
+ exports.chooseAmountFixed = chooseAmountFixed;
1127
+ exports.chooseAmountFixedNoDescription = chooseAmountFixedNoDescription;
1128
+ exports.chooseAmountVariable = chooseAmountVariable;
1129
+ exports.chooseAmountVariableDisabled = chooseAmountVariableDisabled;
1130
+ exports.chooseAmountVariableNoDescription = chooseAmountVariableNoDescription;
1131
+ exports.chooseAmountVariableUnavailable = chooseAmountVariableUnavailable;
1132
+ exports.confirmFixed = confirmFixed;
1133
+ exports.confirmVariable = confirmVariable;
1134
+ exports.demoRewardExchange = demoRewardExchange;
1135
+ exports.empty = empty;
1136
+ exports.loading = loading;
1137
+ exports.queryError = queryError;
1138
+ exports.redemptionError = redemptionError;
1139
+ exports.rewardExchange = rewardExchange;
1140
+ exports.rewardExchangeCustomErrorMsg = rewardExchangeCustomErrorMsg;
1141
+ exports.rewardExchangeLongText = rewardExchangeLongText;
1142
+ exports.rewardExchangeSelected = rewardExchangeSelected;
1143
+ exports.success = success;
1144
+ exports.successVariable = successVariable;