@saasquatch/mint-components 1.5.0-2 → 1.5.0-3
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/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-brand_31.cjs.entry.js +295 -121
- package/dist/cjs/sqm-program-explainer-step-view-98958ab1.js +64 -0
- package/dist/cjs/sqm-program-explainer-step.cjs.entry.js +3 -16
- package/dist/cjs/sqm-program-explainer-view-ba7ed24a.js +44 -0
- package/dist/cjs/sqm-program-explainer.cjs.entry.js +4 -33
- package/dist/collection/components/sqm-program-explainer/ProgramExplainer.stories.js +42 -29
- package/dist/collection/components/sqm-program-explainer/sqm-program-explainer-view.js +35 -28
- package/dist/collection/components/sqm-program-explainer/sqm-program-explainer.js +112 -5
- package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step-view.js +35 -20
- package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step.js +23 -46
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +5 -3
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +38 -19
- package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +3 -0
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +133 -87
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +349 -3
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +17 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-brand_31.entry.js +295 -121
- package/dist/esm/sqm-program-explainer-step-view-64fc0c37.js +62 -0
- package/dist/esm/sqm-program-explainer-step.entry.js +3 -16
- package/dist/esm/sqm-program-explainer-view-68f0d242.js +42 -0
- package/dist/esm/sqm-program-explainer.entry.js +7 -36
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-brand_31.entry.js +2 -2
- package/dist/esm-es5/sqm-program-explainer-step-view-64fc0c37.js +1 -0
- package/dist/esm-es5/sqm-program-explainer-step.entry.js +1 -1
- package/dist/esm-es5/sqm-program-explainer-view-68f0d242.js +1 -0
- package/dist/esm-es5/sqm-program-explainer.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/p-1435350e.system.js +1 -0
- package/dist/mint-components/p-16f5a7cb.system.js +1 -1
- package/dist/mint-components/p-259d31fc.entry.js +1 -0
- package/dist/mint-components/p-5cda79ed.system.entry.js +1 -0
- package/dist/mint-components/p-6d6be8bd.system.js +1 -0
- package/dist/mint-components/p-864f49d2.system.entry.js +1 -0
- package/dist/mint-components/p-8c4931a5.js +1 -0
- package/dist/mint-components/p-adcde089.system.entry.js +58 -0
- package/dist/mint-components/p-bf7fcf0c.js +1 -0
- package/dist/mint-components/{p-7300b0ae.entry.js → p-dd865aa8.entry.js} +15 -15
- package/dist/mint-components/p-f52bc20c.entry.js +1 -0
- package/dist/types/components/sqm-program-explainer/ProgramExplainer.stories.d.ts +3 -1
- package/dist/types/components/sqm-program-explainer/sqm-program-explainer-view.d.ts +9 -0
- package/dist/types/components/sqm-program-explainer/sqm-program-explainer.d.ts +23 -3
- package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step.d.ts +9 -12
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +2 -0
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +85 -0
- package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +3 -0
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +53 -0
- package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +16 -0
- package/dist/types/components.d.ts +166 -19
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/sqm-program-explainer-step-view-0e66bea1.js +0 -49
- package/dist/esm/sqm-program-explainer-step-view-26920cf9.js +0 -47
- package/dist/esm-es5/sqm-program-explainer-step-view-26920cf9.js +0 -1
- package/dist/mint-components/p-1ea0804d.js +0 -1
- package/dist/mint-components/p-244f3d9b.system.entry.js +0 -1
- package/dist/mint-components/p-4fd17832.entry.js +0 -1
- package/dist/mint-components/p-9bda1dc4.system.entry.js +0 -1
- package/dist/mint-components/p-d12c666e.system.js +0 -1
- package/dist/mint-components/p-ded1509b.entry.js +0 -1
- package/dist/mint-components/p-f8c5f710.system.entry.js +0 -58
|
@@ -13,8 +13,8 @@ import { P as PortalSectionView } from './sqm-portal-section-view-f0876545.js';
|
|
|
13
13
|
import { T as TextSpanView } from './sqm-text-span-view-1781df94.js';
|
|
14
14
|
import { g as gql, L as LeaderboardRankView } from './sqm-leaderboard-rank-view-47844836.js';
|
|
15
15
|
import { u as useRerenderListener, a as useRequestRerender } from './re-render-e06f2f7f.js';
|
|
16
|
-
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-c3b955b7.js';
|
|
17
16
|
import { S as ShareLinkView } from './sqm-share-link-view-9282b8e8.js';
|
|
17
|
+
import { p as pathToRegexp, B as BigStatView, u as useBigStat, a as useDemoBigStat } from './useDemoBigStat-c3b955b7.js';
|
|
18
18
|
import { L as LeaderboardView, u as useLeaderboard, S as ShadowViewAddon } from './ShadowViewAddon-a3f510db.js';
|
|
19
19
|
import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-2242502c.js';
|
|
20
20
|
import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-f2304ad9.js';
|
|
@@ -28,7 +28,8 @@ import { A as AssetCardView } from './sqm-asset-card-view-6f360937.js';
|
|
|
28
28
|
import { P as PoweredByImg$1, a as PortalFooterView } from './sqm-portal-footer-view-d9fe0bf8.js';
|
|
29
29
|
import { H as HeroView } from './sqm-hero-view-bfd8abd1.js';
|
|
30
30
|
import { N as NameFieldsView } from './sqm-name-fields-view-4162fb7b.js';
|
|
31
|
-
import { P as
|
|
31
|
+
import { P as ProgramExplainerView } from './sqm-program-explainer-view-68f0d242.js';
|
|
32
|
+
import { P as ProgramExplainerStepView } from './sqm-program-explainer-step-view-64fc0c37.js';
|
|
32
33
|
|
|
33
34
|
var chroma = createCommonjsModule(function (module, exports) {
|
|
34
35
|
/**
|
|
@@ -18034,6 +18035,7 @@ const ReferralTableUserCell = class {
|
|
|
18034
18035
|
}
|
|
18035
18036
|
};
|
|
18036
18037
|
|
|
18038
|
+
// TODO: add rewardInput once it works
|
|
18037
18039
|
const GET_EXCHANGE_LIST = dist.gql `
|
|
18038
18040
|
query getExchangeList {
|
|
18039
18041
|
viewer {
|
|
@@ -18099,10 +18101,11 @@ function useRewardExchangeList(props) {
|
|
|
18099
18101
|
amount: 0,
|
|
18100
18102
|
exchangeError: false,
|
|
18101
18103
|
});
|
|
18104
|
+
const [open, setOpen] = useState(false);
|
|
18102
18105
|
const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
|
|
18103
18106
|
const user = T$1();
|
|
18104
|
-
const [exchange, { data: exchangeResponse, errors }] = be(EXCHANGE);
|
|
18105
|
-
const { data, loading, refetch } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
18107
|
+
const [exchange, { data: exchangeResponse, loading: exchangeLoading, errors },] = be(EXCHANGE);
|
|
18108
|
+
const { data, loading, refetch, errors: queryError, } = en(GET_EXCHANGE_LIST, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
18106
18109
|
useEffect(() => {
|
|
18107
18110
|
var _a, _b;
|
|
18108
18111
|
if ((_b = (_a = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _a === void 0 ? void 0 : _a.reward) === null || _b === void 0 ? void 0 : _b.id) {
|
|
@@ -18192,6 +18195,14 @@ function useRewardExchangeList(props) {
|
|
|
18192
18195
|
function setStage(stage) {
|
|
18193
18196
|
setExchangeState({ redeemStage: stage });
|
|
18194
18197
|
}
|
|
18198
|
+
function copyFuelTankCode() {
|
|
18199
|
+
var _a, _b;
|
|
18200
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
18201
|
+
// Only if called from a user-initiated event
|
|
18202
|
+
navigator.clipboard.writeText((_b = (_a = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _a === void 0 ? void 0 : _a.reward) === null || _b === void 0 ? void 0 : _b.fuelTankCode);
|
|
18203
|
+
setOpen(true);
|
|
18204
|
+
setTimeout(() => setOpen(false), 1000);
|
|
18205
|
+
}
|
|
18195
18206
|
return {
|
|
18196
18207
|
states: {
|
|
18197
18208
|
content: {
|
|
@@ -18202,7 +18213,9 @@ function useRewardExchangeList(props) {
|
|
|
18202
18213
|
amount,
|
|
18203
18214
|
selectedStep,
|
|
18204
18215
|
exchangeError,
|
|
18205
|
-
|
|
18216
|
+
queryError: !!queryError,
|
|
18217
|
+
loading: loading || exchangeLoading,
|
|
18218
|
+
open,
|
|
18206
18219
|
},
|
|
18207
18220
|
data: {
|
|
18208
18221
|
exchangeList: (_b = (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.visibleRewardExchangeItems) === null || _b === void 0 ? void 0 : _b.data,
|
|
@@ -18213,6 +18226,7 @@ function useRewardExchangeList(props) {
|
|
|
18213
18226
|
setExchangeState,
|
|
18214
18227
|
setStage,
|
|
18215
18228
|
resetState,
|
|
18229
|
+
copyFuelTankCode,
|
|
18216
18230
|
},
|
|
18217
18231
|
};
|
|
18218
18232
|
}
|
|
@@ -18221,6 +18235,9 @@ const ExchangeArrows = () => (h$1("svg", { width: 19, height: 15, fill: "none",
|
|
|
18221
18235
|
h$1("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" })));
|
|
18222
18236
|
const CheckMark = () => (h$1("svg", { width: 12, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
18223
18237
|
h$1("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" })));
|
|
18238
|
+
const CheckmarkFilled = () => (h$1("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
18239
|
+
h$1("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" }),
|
|
18240
|
+
h$1("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" })));
|
|
18224
18241
|
const Gift = () => (h$1("svg", { width: 156, height: 157, fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
18225
18242
|
h$1("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" }),
|
|
18226
18243
|
h$1("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M37.18 73.862v7.966h89.663v-7.966H37.18Z", fill: "#E9BB30" }),
|
|
@@ -18303,12 +18320,14 @@ function ProgressBar({ stageCount, currentStage, }) {
|
|
|
18303
18320
|
}
|
|
18304
18321
|
|
|
18305
18322
|
const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
|
|
18306
|
-
const stageProgressList = {
|
|
18307
|
-
chooseReward: "Choose reward",
|
|
18308
|
-
chooseAmount: "Amount",
|
|
18309
|
-
confirmation: "Confirm",
|
|
18310
|
-
};
|
|
18311
18323
|
function RewardExchangeView(props) {
|
|
18324
|
+
const { states, data, callbacks } = props;
|
|
18325
|
+
const { selectedItem, selectedStep } = states;
|
|
18326
|
+
const stageProgressList = {
|
|
18327
|
+
chooseReward: states.content.text.chooseRewardTitle,
|
|
18328
|
+
chooseAmount: states.content.text.chooseAmountTitle,
|
|
18329
|
+
confirmation: states.content.text.confirmationTitle,
|
|
18330
|
+
};
|
|
18312
18331
|
const style = {
|
|
18313
18332
|
HostBlock: HostBlock,
|
|
18314
18333
|
Container: {
|
|
@@ -18372,17 +18391,6 @@ function RewardExchangeView(props) {
|
|
|
18372
18391
|
color: "var(--sl-color-primary-500)",
|
|
18373
18392
|
},
|
|
18374
18393
|
},
|
|
18375
|
-
Buttons: {
|
|
18376
|
-
marginLeft: "auto",
|
|
18377
|
-
width: "100%",
|
|
18378
|
-
maxWidth: "300px",
|
|
18379
|
-
},
|
|
18380
|
-
Button: {
|
|
18381
|
-
margin: "10px 0",
|
|
18382
|
-
display: "block",
|
|
18383
|
-
textAlign: "center",
|
|
18384
|
-
cursor: "pointer",
|
|
18385
|
-
},
|
|
18386
18394
|
ProgressBar: {
|
|
18387
18395
|
maxWidth: "350px",
|
|
18388
18396
|
width: "100%",
|
|
@@ -18404,7 +18412,13 @@ function RewardExchangeView(props) {
|
|
|
18404
18412
|
},
|
|
18405
18413
|
},
|
|
18406
18414
|
},
|
|
18407
|
-
|
|
18415
|
+
CardLayout: {
|
|
18416
|
+
display: "flex",
|
|
18417
|
+
width: "100%",
|
|
18418
|
+
borderRadius: "3px",
|
|
18419
|
+
background: "rgba(0, 0, 0, 0)",
|
|
18420
|
+
},
|
|
18421
|
+
Card: {
|
|
18408
18422
|
display: "flex",
|
|
18409
18423
|
userSelect: "none",
|
|
18410
18424
|
height: "120px",
|
|
@@ -18416,21 +18430,12 @@ function RewardExchangeView(props) {
|
|
|
18416
18430
|
display: "flex",
|
|
18417
18431
|
padding: 0,
|
|
18418
18432
|
},
|
|
18419
|
-
"& .selected
|
|
18420
|
-
width: "18px",
|
|
18421
|
-
height: "18px",
|
|
18422
|
-
minWidth: "18px",
|
|
18423
|
-
borderRadius: "50%",
|
|
18424
|
-
background: "var(--sl-color-primary-500)",
|
|
18433
|
+
"& .selected": {
|
|
18425
18434
|
position: "relative",
|
|
18426
|
-
|
|
18435
|
+
top: "-2%",
|
|
18427
18436
|
left: "100%",
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
position: "relative",
|
|
18431
|
-
left: "12%",
|
|
18432
|
-
top: "-29%",
|
|
18433
|
-
transform: "scale(0.8)",
|
|
18437
|
+
color: "var(--sl-color-primary-500)",
|
|
18438
|
+
margin: "-9px",
|
|
18434
18439
|
},
|
|
18435
18440
|
},
|
|
18436
18441
|
Square: {
|
|
@@ -18449,14 +18454,18 @@ function RewardExchangeView(props) {
|
|
|
18449
18454
|
},
|
|
18450
18455
|
},
|
|
18451
18456
|
Image: {
|
|
18457
|
+
padding: "8px",
|
|
18458
|
+
minWidth: "96px",
|
|
18459
|
+
maxWidth: "96px",
|
|
18452
18460
|
"& .image": {
|
|
18461
|
+
width: "100%",
|
|
18462
|
+
height: "100%",
|
|
18453
18463
|
objectFit: "contain",
|
|
18454
|
-
|
|
18455
|
-
height: "118px",
|
|
18456
|
-
flex: 0.33,
|
|
18464
|
+
borderRadius: "4px",
|
|
18457
18465
|
},
|
|
18458
|
-
"& .image.
|
|
18459
|
-
filter: "brightness(
|
|
18466
|
+
"& .image.subdued": {
|
|
18467
|
+
filter: "brightness(0.95)",
|
|
18468
|
+
opacity: "0.5",
|
|
18460
18469
|
},
|
|
18461
18470
|
},
|
|
18462
18471
|
TextArea: {
|
|
@@ -18467,12 +18476,20 @@ function RewardExchangeView(props) {
|
|
|
18467
18476
|
lineHeight: "20px",
|
|
18468
18477
|
fontWeight: "600",
|
|
18469
18478
|
color: "var(--sl-color-neutral-1000)",
|
|
18479
|
+
display: "-webkit-box",
|
|
18480
|
+
"-webkit-line-clamp": "1",
|
|
18481
|
+
"-webkit-box-orient": "vertical",
|
|
18482
|
+
overflow: "hidden",
|
|
18470
18483
|
},
|
|
18471
18484
|
"& .amount": {
|
|
18472
18485
|
fontSize: "14px",
|
|
18473
18486
|
lineHeight: "18px",
|
|
18474
18487
|
marginTop: "8px",
|
|
18475
18488
|
color: "var(--sl-color-neutral-500)",
|
|
18489
|
+
display: "-webkit-box",
|
|
18490
|
+
"-webkit-line-clamp": "1",
|
|
18491
|
+
"-webkit-box-orient": "vertical",
|
|
18492
|
+
overflow: "hidden",
|
|
18476
18493
|
},
|
|
18477
18494
|
"& .error": {
|
|
18478
18495
|
fontSize: "14px",
|
|
@@ -18480,6 +18497,10 @@ function RewardExchangeView(props) {
|
|
|
18480
18497
|
marginTop: "8px",
|
|
18481
18498
|
fontWeight: "600",
|
|
18482
18499
|
color: "var(--sl-color-warning-500)",
|
|
18500
|
+
display: "-webkit-box",
|
|
18501
|
+
"-webkit-line-clamp": "1",
|
|
18502
|
+
"-webkit-box-orient": "vertical",
|
|
18503
|
+
overflow: "hidden",
|
|
18483
18504
|
},
|
|
18484
18505
|
},
|
|
18485
18506
|
ChooseAmount: {
|
|
@@ -18494,7 +18515,7 @@ function RewardExchangeView(props) {
|
|
|
18494
18515
|
//fontSize: "var(--sl-font-size-large)",
|
|
18495
18516
|
fontSize: "113%",
|
|
18496
18517
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
18497
|
-
color: "var(--sl-color-
|
|
18518
|
+
color: "var(--sl-color-primary-500)",
|
|
18498
18519
|
},
|
|
18499
18520
|
"& .description": {
|
|
18500
18521
|
fontSize: "var(--sl-font-size-medium)",
|
|
@@ -18531,7 +18552,7 @@ function RewardExchangeView(props) {
|
|
|
18531
18552
|
gap: "20px",
|
|
18532
18553
|
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
18533
18554
|
},
|
|
18534
|
-
|
|
18555
|
+
Button: {
|
|
18535
18556
|
display: "flex",
|
|
18536
18557
|
flexWrap: "wrap-reverse",
|
|
18537
18558
|
margin: "var(--sl-spacing-medium) 0",
|
|
@@ -18570,18 +18591,18 @@ function RewardExchangeView(props) {
|
|
|
18570
18591
|
jss.setup(create());
|
|
18571
18592
|
const sheet = jss.createStyleSheet(style);
|
|
18572
18593
|
const styleString = sheet.toString();
|
|
18573
|
-
const { states, data, callbacks } = props;
|
|
18574
|
-
const { selectedItem, selectedStep } = states;
|
|
18575
18594
|
function getInput() {
|
|
18576
18595
|
var _a, _b;
|
|
18577
18596
|
const item = states.selectedItem;
|
|
18578
18597
|
if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
|
|
18579
18598
|
return h$1("span", null, item === null || item === void 0 ? void 0 : item.prettySourceValue);
|
|
18580
18599
|
if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
18581
|
-
return h$1("p", null,
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
|
|
18600
|
+
return (h$1("p", null, intl.formatMessage({
|
|
18601
|
+
id: "notEnoughError",
|
|
18602
|
+
defaultMessage: states.content.text.notEnoughError,
|
|
18603
|
+
}, {
|
|
18604
|
+
sourceUnit: item.sourceUnit,
|
|
18605
|
+
})));
|
|
18585
18606
|
}
|
|
18586
18607
|
return (h$1("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
|
|
18587
18608
|
var _a, _b, _c, _d, _e;
|
|
@@ -18600,6 +18621,7 @@ function RewardExchangeView(props) {
|
|
|
18600
18621
|
defaultMessage: (_b = (_a = states.content) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.notAvailableError,
|
|
18601
18622
|
}, {
|
|
18602
18623
|
unavailableReason: step.unavailableReasonCode,
|
|
18624
|
+
sourceValue: step.prettySourceValue || item.prettySourceMinValue,
|
|
18603
18625
|
}))))));
|
|
18604
18626
|
})));
|
|
18605
18627
|
}
|
|
@@ -18607,57 +18629,70 @@ function RewardExchangeView(props) {
|
|
|
18607
18629
|
var _a;
|
|
18608
18630
|
return [
|
|
18609
18631
|
h$1("div", { class: sheet.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
18610
|
-
var _a, _b;
|
|
18632
|
+
var _a, _b, _c, _d, _e;
|
|
18611
18633
|
const style = {
|
|
18612
18634
|
boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
|
|
18613
18635
|
? "0 0 0 2px var(--sl-color-primary-500)"
|
|
18614
18636
|
: "none",
|
|
18637
|
+
borderRadius: "4px",
|
|
18615
18638
|
};
|
|
18616
18639
|
const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
|
|
18617
18640
|
? item.prettySourceValue
|
|
18618
|
-
: item.
|
|
18619
|
-
? `${item.
|
|
18620
|
-
:
|
|
18641
|
+
: item.ruleType === "STEPPED_FIXED_GLOBAL_REWARD"
|
|
18642
|
+
? `${(_a = item.steps[0]) === null || _a === void 0 ? void 0 : _a.sourceValue} to ${(_b = item.steps.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.prettySourceValue}`
|
|
18643
|
+
: `${item.prettySourceMinValue} to ${item.prettySourceMaxValue}`;
|
|
18621
18644
|
return (h$1("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
|
|
18622
|
-
h$1("sl-card", { class: sheet.classes.
|
|
18645
|
+
h$1("sl-card", { class: sheet.classes.Card, style: {
|
|
18623
18646
|
cursor: item.unavailableReasonCode
|
|
18624
18647
|
? "not-allowed"
|
|
18625
18648
|
: "pointer",
|
|
18626
18649
|
}, onClick: () => item.available &&
|
|
18627
18650
|
callbacks.setExchangeState({ selectedItem: item }) },
|
|
18628
|
-
item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h$1("div", { class: "selected
|
|
18629
|
-
h$1(
|
|
18630
|
-
h$1(CheckMark, null)))),
|
|
18651
|
+
item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h$1("div", { class: "selected" },
|
|
18652
|
+
h$1(CheckmarkFilled, null))),
|
|
18631
18653
|
h$1("div", { style: {
|
|
18632
18654
|
display: "flex",
|
|
18633
18655
|
width: "100%",
|
|
18656
|
+
height: "120px",
|
|
18634
18657
|
borderRadius: "3px",
|
|
18635
18658
|
background: item.unavailableReasonCode
|
|
18636
18659
|
? "rgba(0, 0, 0, 0.05)"
|
|
18637
18660
|
: "rgba(0, 0, 0, 0)",
|
|
18638
18661
|
} },
|
|
18639
|
-
h$1("div", { class: sheet.classes.
|
|
18662
|
+
h$1("div", { class: sheet.classes.Image, style: {
|
|
18663
|
+
opacity: item.unavailableReasonCode ? "0.5" : "1",
|
|
18664
|
+
} },
|
|
18640
18665
|
h$1("img", { class: item.unavailableReasonCode ? "image subdued" : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
|
|
18641
18666
|
getAssetPath("./assets/placeholder.png") })),
|
|
18642
18667
|
h$1("div", { class: sheet.classes.TextArea, style: {
|
|
18643
18668
|
opacity: item.unavailableReasonCode ? "0.5" : "1",
|
|
18644
18669
|
} },
|
|
18645
|
-
h$1("div", { class: "title"
|
|
18646
|
-
|
|
18670
|
+
h$1("div", { class: "title", style: {
|
|
18671
|
+
"-webkit-line-clamp": item.unavailableReasonCode
|
|
18672
|
+
? "1"
|
|
18673
|
+
: "2",
|
|
18674
|
+
} }, (_c = item.name) !== null && _c !== void 0 ? _c : ""),
|
|
18675
|
+
h$1("div", { class: "amount", style: {
|
|
18676
|
+
"-webkit-line-clamp": item.unavailableReasonCode
|
|
18677
|
+
? "1"
|
|
18678
|
+
: "2",
|
|
18679
|
+
} }, amount),
|
|
18647
18680
|
item.unavailableReasonCode && (h$1("div", { class: "error" }, intl.formatMessage({
|
|
18648
18681
|
id: "unavailableCode",
|
|
18649
|
-
defaultMessage: (
|
|
18682
|
+
defaultMessage: (_e = (_d = states.content) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e.notAvailableError,
|
|
18650
18683
|
}, {
|
|
18651
18684
|
unavailableReason: item.unavailableReason ||
|
|
18652
18685
|
item.unavailableReasonCode,
|
|
18686
|
+
sourceValue: item.prettySourceValue ||
|
|
18687
|
+
item.prettySourceMinValue,
|
|
18653
18688
|
}))))))));
|
|
18654
18689
|
})),
|
|
18655
|
-
h$1("div", { class: sheet.classes.
|
|
18656
|
-
h$1("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), disabled: !states.selectedItem },
|
|
18690
|
+
h$1("div", { class: sheet.classes.Button },
|
|
18691
|
+
h$1("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText)),
|
|
18657
18692
|
];
|
|
18658
18693
|
}
|
|
18659
18694
|
function chooseAmount() {
|
|
18660
|
-
var _a, _b, _c;
|
|
18695
|
+
var _a, _b, _c, _d;
|
|
18661
18696
|
const input = getInput();
|
|
18662
18697
|
const isDisabled = ((_a = states.selectedItem) === null || _a === void 0 ? void 0 : _a.ruleType) === "FIXED_GLOBAL_REWARD"
|
|
18663
18698
|
? false
|
|
@@ -18666,17 +18701,18 @@ function RewardExchangeView(props) {
|
|
|
18666
18701
|
h$1("div", null, h$1("img", { class: sheet.classes.FullImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
18667
18702
|
getAssetPath("./assets/placeholder.png") })),
|
|
18668
18703
|
h$1("div", { class: sheet.classes.ChooseAmount },
|
|
18669
|
-
h$1("div", { class: "title" }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name)
|
|
18670
|
-
((
|
|
18671
|
-
((
|
|
18704
|
+
h$1("div", { class: "title" }, (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : ""),
|
|
18705
|
+
((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (h$1("div", { class: "points" }, input)) : (h$1("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
|
|
18706
|
+
((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.ruleType) === "FIXED_GLOBAL_REWARD" ? (h$1("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (h$1("div", { class: "points" }, input)),
|
|
18672
18707
|
h$1("div", { class: "space" })),
|
|
18673
|
-
h$1("div", { class: sheet.classes.
|
|
18674
|
-
h$1("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() },
|
|
18675
|
-
h$1("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled },
|
|
18708
|
+
h$1("div", { class: sheet.classes.Button },
|
|
18709
|
+
h$1("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
|
|
18710
|
+
h$1("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText))));
|
|
18676
18711
|
}
|
|
18677
18712
|
function confirmation() {
|
|
18713
|
+
var _a, _b;
|
|
18678
18714
|
return (h$1("div", null,
|
|
18679
|
-
h$1("h2", { style: { margin: "20px 0" } },
|
|
18715
|
+
h$1("h2", { style: { margin: "20px 0" } }, states.content.text.redeemTitle),
|
|
18680
18716
|
h$1("div", { style: {
|
|
18681
18717
|
textAlign: "center",
|
|
18682
18718
|
marginBottom: "var(--sl-spacing-xxx-large)",
|
|
@@ -18691,27 +18727,39 @@ function RewardExchangeView(props) {
|
|
|
18691
18727
|
flex: "1",
|
|
18692
18728
|
minWidth: "100%",
|
|
18693
18729
|
} },
|
|
18694
|
-
h$1("sl-card", { style: { width: "auto", maxWidth: "350px", margin: "auto" }, class: sheet.classes.
|
|
18730
|
+
h$1("sl-card", { style: { width: "auto", maxWidth: "350px", margin: "auto" }, class: sheet.classes.Card },
|
|
18695
18731
|
h$1("div", { class: sheet.classes.Square },
|
|
18696
18732
|
h$1("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
18697
18733
|
getAssetPath("./assets/placeholder.png") })),
|
|
18698
18734
|
h$1("div", { class: sheet.classes.TextArea, style: {
|
|
18699
18735
|
lineHeight: "18px",
|
|
18700
18736
|
alignSelf: "center",
|
|
18701
|
-
} }, (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) ? (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) +
|
|
18702
|
-
" " + (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) || ""
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
h$1("sl-button", { class: "
|
|
18706
|
-
h$1("sl-button", { class: "continue", size: "large", onClick: callbacks.exchangeReward }, "Redeem"))));
|
|
18737
|
+
} }, (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) ? (_a = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) +
|
|
18738
|
+
" " + (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name)) !== null && _a !== void 0 ? _a : "" : (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : "")))),
|
|
18739
|
+
h$1("div", { class: sheet.classes.Button },
|
|
18740
|
+
h$1("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
|
|
18741
|
+
h$1("sl-button", { class: "continue", size: "large", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText))));
|
|
18707
18742
|
}
|
|
18708
18743
|
function success() {
|
|
18744
|
+
var _a, _b, _c;
|
|
18709
18745
|
return (h$1("div", { class: sheet.classes.Success },
|
|
18710
18746
|
h$1(Gift, null),
|
|
18711
|
-
h$1("div", { class: "title" },
|
|
18712
|
-
h$1("div", { class: "description" },
|
|
18713
|
-
|
|
18714
|
-
|
|
18747
|
+
h$1("div", { class: "title" }, states.content.text.rewardRedeemedText),
|
|
18748
|
+
h$1("div", { class: "description" }, intl.formatMessage({
|
|
18749
|
+
id: "successMessage",
|
|
18750
|
+
defaultMessage: states.content.text.redemptionSuccessText,
|
|
18751
|
+
}, {
|
|
18752
|
+
sourceValue: (_a = states.selectedItem.prettySourceValue) !== null && _a !== void 0 ? _a : (_b = states.selectedStep) === null || _b === void 0 ? void 0 : _b.prettySourceValue,
|
|
18753
|
+
destinationValue: ((_c = states.selectedStep) === null || _c === void 0 ? void 0 : _c.prettyDestinationValue) ||
|
|
18754
|
+
states.selectedItem.globalRewardKey,
|
|
18755
|
+
})),
|
|
18756
|
+
(data === null || data === void 0 ? void 0 : data.fuelTankCode) && (h$1("div", { style: {
|
|
18757
|
+
width: "40%",
|
|
18758
|
+
margin: "-30px auto var(--sl-spacing-xxx-large) auto",
|
|
18759
|
+
} },
|
|
18760
|
+
h$1(ShareLinkView, { shareString: data.fuelTankCode, tooltiptext: "Copied", open: states.open, onClick: callbacks.copyFuelTankCode }))),
|
|
18761
|
+
h$1("div", { class: sheet.classes.Button },
|
|
18762
|
+
h$1("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
|
|
18715
18763
|
}
|
|
18716
18764
|
const stages = {
|
|
18717
18765
|
chooseReward: () => chooseReward(),
|
|
@@ -18734,26 +18782,40 @@ function RewardExchangeView(props) {
|
|
|
18734
18782
|
h$1(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
|
|
18735
18783
|
}
|
|
18736
18784
|
function loading() {
|
|
18737
|
-
return (h$1("div", {
|
|
18738
|
-
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18785
|
+
return (h$1("div", { class: sheet.classes.Grid }, [...Array(8)].map(() => {
|
|
18786
|
+
return (h$1("div", { class: sheet.classes.CardContainer },
|
|
18787
|
+
h$1("sl-card", { class: sheet.classes.Card },
|
|
18788
|
+
h$1("div", { class: sheet.classes.CardLayout },
|
|
18789
|
+
h$1("div", null,
|
|
18790
|
+
h$1("sl-skeleton", { style: {
|
|
18791
|
+
width: "100px",
|
|
18792
|
+
height: "100px",
|
|
18793
|
+
margin: "9px",
|
|
18794
|
+
"--border-radius": "4px",
|
|
18795
|
+
} })),
|
|
18796
|
+
h$1("div", { style: { margin: "12px 12px 0 0", width: "100%" } },
|
|
18797
|
+
h$1("sl-skeleton", { style: { marginBottom: "12px" } }),
|
|
18798
|
+
h$1("sl-skeleton", { style: { marginBottom: "12px" } }),
|
|
18799
|
+
h$1("sl-skeleton", { style: { width: "45%" } }))))));
|
|
18800
|
+
})));
|
|
18745
18801
|
}
|
|
18746
18802
|
function errorMessage() {
|
|
18747
18803
|
return (h$1("sl-alert", { type: "danger", open: true },
|
|
18748
18804
|
h$1("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
|
|
18749
|
-
|
|
18805
|
+
states.content.text.redemptionError));
|
|
18806
|
+
}
|
|
18807
|
+
function queryErrorMessage() {
|
|
18808
|
+
return (h$1("sl-alert", { type: "danger", open: true },
|
|
18809
|
+
h$1("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
|
|
18810
|
+
states.content.text.queryError));
|
|
18750
18811
|
}
|
|
18751
18812
|
return (h$1("div", { class: sheet.classes.Container },
|
|
18752
18813
|
h$1("style", { type: "text/css" }, styleString),
|
|
18753
18814
|
h$1("div", null,
|
|
18754
18815
|
stageMap(),
|
|
18755
|
-
states.loading && loading(),
|
|
18816
|
+
states.redeemStage === "chooseReward" && states.loading && loading(),
|
|
18756
18817
|
states.exchangeError && errorMessage(),
|
|
18818
|
+
states.queryError && queryErrorMessage(),
|
|
18757
18819
|
currentStage && currentStage())));
|
|
18758
18820
|
}
|
|
18759
18821
|
|
|
@@ -18768,7 +18830,60 @@ const SqmRewardExchangeList = class {
|
|
|
18768
18830
|
/**
|
|
18769
18831
|
* @uiName Exchange button text
|
|
18770
18832
|
*/
|
|
18771
|
-
this.notAvailableError = "{unavailableReason, select, US_TAX {US Tax limit} INSUFFICIENT_REDEEMABLE_CREDIT {
|
|
18833
|
+
this.notAvailableError = "{unavailableReason, select, US_TAX {US Tax limit} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} other {Not available} }";
|
|
18834
|
+
/**
|
|
18835
|
+
* @uiName Choose Reward Progress Title
|
|
18836
|
+
*/
|
|
18837
|
+
this.chooseRewardTitle = "Choose reward";
|
|
18838
|
+
/**
|
|
18839
|
+
* @uiName Choose Amount Progress Title
|
|
18840
|
+
*/
|
|
18841
|
+
this.chooseAmountTitle = "Amount";
|
|
18842
|
+
/**
|
|
18843
|
+
* @uiName Confirmation Progress Title
|
|
18844
|
+
*/
|
|
18845
|
+
this.confirmationTitle = "Confirm";
|
|
18846
|
+
/**
|
|
18847
|
+
* @uiName Cancel Button Text
|
|
18848
|
+
*/
|
|
18849
|
+
this.cancelText = "Cancel";
|
|
18850
|
+
/**
|
|
18851
|
+
* @uiName Back Button Text
|
|
18852
|
+
*/
|
|
18853
|
+
this.backText = "Back";
|
|
18854
|
+
/**
|
|
18855
|
+
* @uiName Continue Button Text
|
|
18856
|
+
*/
|
|
18857
|
+
this.continueText = "Continue";
|
|
18858
|
+
/**
|
|
18859
|
+
* @uiName Continue to Confirmation Button Text
|
|
18860
|
+
*/
|
|
18861
|
+
this.continueToConfirmationText = "Continue to confirmation";
|
|
18862
|
+
/**
|
|
18863
|
+
* @uiName Redeem Button Text
|
|
18864
|
+
*/
|
|
18865
|
+
this.redeemText = "Redeem";
|
|
18866
|
+
/**
|
|
18867
|
+
* @uiName Confirmation Title Text
|
|
18868
|
+
*/
|
|
18869
|
+
this.redeemTitle = "Confirm and redeem";
|
|
18870
|
+
this.redemptionSuccessText = "Successfully redeemed {sourceValue} for {destinationValue}";
|
|
18871
|
+
/**
|
|
18872
|
+
* @uiName Done Text
|
|
18873
|
+
*/
|
|
18874
|
+
this.doneText = "Done";
|
|
18875
|
+
/**
|
|
18876
|
+
* @uiName Reward List Error Message
|
|
18877
|
+
*/
|
|
18878
|
+
this.queryError = "Unable to load reward exchange list";
|
|
18879
|
+
/**
|
|
18880
|
+
* @uiName Redemption Error Message
|
|
18881
|
+
*/
|
|
18882
|
+
this.redemptionError = "An error occured trying to redeem this reward. Please try again";
|
|
18883
|
+
/**
|
|
18884
|
+
* @uiName Not Enough Available Error Message
|
|
18885
|
+
*/
|
|
18886
|
+
this.notEnoughError = "Not enough {sourceUnit} to redeem for this reward";
|
|
18772
18887
|
h(this);
|
|
18773
18888
|
}
|
|
18774
18889
|
disconnectedCallback() { }
|
|
@@ -18799,6 +18914,7 @@ function useRewardExchangeListDemo(props) {
|
|
|
18799
18914
|
amount: 0,
|
|
18800
18915
|
selectedStep: undefined,
|
|
18801
18916
|
exchangeError: false,
|
|
18917
|
+
queryError: false,
|
|
18802
18918
|
loading: false,
|
|
18803
18919
|
},
|
|
18804
18920
|
data: {
|
|
@@ -18809,6 +18925,7 @@ function useRewardExchangeListDemo(props) {
|
|
|
18809
18925
|
setExchangeState: (_) => { },
|
|
18810
18926
|
setStage: (_) => { },
|
|
18811
18927
|
resetState: () => { },
|
|
18928
|
+
copyFuelTankCode: () => { },
|
|
18812
18929
|
},
|
|
18813
18930
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
18814
18931
|
}
|
|
@@ -29194,7 +29311,7 @@ const NameFields$1 = /*#__PURE__*/Object.freeze({
|
|
|
29194
29311
|
NameFieldsWithErrors: NameFieldsWithErrors
|
|
29195
29312
|
});
|
|
29196
29313
|
|
|
29197
|
-
const baseResponse = (data, stage = "chooseReward", selectedItem = null, selectedStep = null, error = false, loading = false) => ({
|
|
29314
|
+
const baseResponse = (data, stage = "chooseReward", selectedItem = null, selectedStep = null, error = false, loading = false, fueltank = null) => ({
|
|
29198
29315
|
states: {
|
|
29199
29316
|
content: {
|
|
29200
29317
|
text: {
|
|
@@ -29207,15 +29324,18 @@ const baseResponse = (data, stage = "chooseReward", selectedItem = null, selecte
|
|
|
29207
29324
|
loading: loading,
|
|
29208
29325
|
selectedItem: selectedItem,
|
|
29209
29326
|
selectedStep: selectedStep,
|
|
29327
|
+
open: false,
|
|
29210
29328
|
},
|
|
29211
29329
|
data: {
|
|
29212
29330
|
exchangeList: data,
|
|
29331
|
+
fuelTankCode: fueltank,
|
|
29213
29332
|
},
|
|
29214
29333
|
callbacks: {
|
|
29215
29334
|
exchangeReward: null,
|
|
29216
29335
|
resetState: null,
|
|
29217
29336
|
setStage: null,
|
|
29218
29337
|
setExchangeState: null,
|
|
29338
|
+
copyFuelTankCode: null,
|
|
29219
29339
|
refs: null,
|
|
29220
29340
|
},
|
|
29221
29341
|
refs: null,
|
|
@@ -29264,12 +29384,12 @@ const name = (props) => ({
|
|
|
29264
29384
|
const fixedValue = (props) => ({
|
|
29265
29385
|
prettySourceValue: props,
|
|
29266
29386
|
});
|
|
29267
|
-
const variableValue = (min, max,
|
|
29387
|
+
const variableValue = (min, max, unit) => ({
|
|
29268
29388
|
ruleType: "VARIABLE_CREDIT_REWARD",
|
|
29269
29389
|
sourceMinValue: min,
|
|
29270
|
-
prettySourceMinValue: min + " " +
|
|
29390
|
+
prettySourceMinValue: min + " " + unit,
|
|
29271
29391
|
sourceMaxValue: max,
|
|
29272
|
-
prettySourceMaxValue: max + " " +
|
|
29392
|
+
prettySourceMaxValue: max + " " + unit,
|
|
29273
29393
|
});
|
|
29274
29394
|
const data = [
|
|
29275
29395
|
{
|
|
@@ -29283,7 +29403,7 @@ const data = [
|
|
|
29283
29403
|
...selected,
|
|
29284
29404
|
...name("Visa® Prepaid Card USD"),
|
|
29285
29405
|
...imageUrl("https://i.imgur.com/veHErQX.png"),
|
|
29286
|
-
...variableValue(20, 80, "
|
|
29406
|
+
...variableValue(20, 80, "Points"),
|
|
29287
29407
|
},
|
|
29288
29408
|
{
|
|
29289
29409
|
...baseReward$2,
|
|
@@ -29301,7 +29421,7 @@ const data = [
|
|
|
29301
29421
|
...baseReward$2,
|
|
29302
29422
|
...name("Variable amount of store credit"),
|
|
29303
29423
|
...imageUrl("https://i.imgur.com/Jn2fE0s.png"),
|
|
29304
|
-
...variableValue(20, 100, "
|
|
29424
|
+
...variableValue(20, 100, "Points"),
|
|
29305
29425
|
},
|
|
29306
29426
|
{
|
|
29307
29427
|
...baseReward$2,
|
|
@@ -29313,9 +29433,9 @@ const data = [
|
|
|
29313
29433
|
{
|
|
29314
29434
|
...baseReward$2,
|
|
29315
29435
|
...usTax,
|
|
29316
|
-
...name("$1000 Store credit"),
|
|
29436
|
+
...name("$1000 Store credit with a really super long name in the front page"),
|
|
29317
29437
|
...imageUrl("https://i.imgur.com/y9HSls1.png"),
|
|
29318
|
-
...fixedValue("2000 SaaSquatch Points"),
|
|
29438
|
+
...fixedValue("2000 SaaSquatch Long Points"),
|
|
29319
29439
|
},
|
|
29320
29440
|
{
|
|
29321
29441
|
...baseReward$2,
|
|
@@ -29334,7 +29454,7 @@ const rewardExchangeSelected = {
|
|
|
29334
29454
|
...selected,
|
|
29335
29455
|
...name("Visa® Prepaid Card USD"),
|
|
29336
29456
|
...imageUrl("https://i.imgur.com/veHErQX.png"),
|
|
29337
|
-
...variableValue(20, 80, "
|
|
29457
|
+
...variableValue(20, 80, "Points"),
|
|
29338
29458
|
}),
|
|
29339
29459
|
};
|
|
29340
29460
|
const baseStep = (dst, dstUnit, src, srcUnit, available = true) => ({
|
|
@@ -29351,13 +29471,13 @@ const chooseAmountVariable = {
|
|
|
29351
29471
|
...baseReward$2,
|
|
29352
29472
|
...name("Visa® Prepaid Card USD"),
|
|
29353
29473
|
...imageUrl("https://i.imgur.com/veHErQX.png"),
|
|
29354
|
-
...variableValue(20, 80, "
|
|
29474
|
+
...variableValue(20, 80, "Points"),
|
|
29355
29475
|
steps: [
|
|
29356
|
-
baseStep(20, "$", 40, "
|
|
29357
|
-
baseStep(30, "$", 60, "
|
|
29358
|
-
baseStep(40, "$", 80, "
|
|
29359
|
-
baseStep(50, "$", 100, "
|
|
29360
|
-
baseStep(60, "$", 120, "
|
|
29476
|
+
baseStep(20, "$", 40, "Points"),
|
|
29477
|
+
baseStep(30, "$", 60, "Points"),
|
|
29478
|
+
baseStep(40, "$", 80, "Points"),
|
|
29479
|
+
baseStep(50, "$", 100, "Points"),
|
|
29480
|
+
baseStep(60, "$", 120, "Points"),
|
|
29361
29481
|
],
|
|
29362
29482
|
}),
|
|
29363
29483
|
};
|
|
@@ -29382,16 +29502,16 @@ const confirmVariable = {
|
|
|
29382
29502
|
...baseReward$2,
|
|
29383
29503
|
...name("Visa® Prepaid Card USD"),
|
|
29384
29504
|
...imageUrl("https://i.imgur.com/veHErQX.png"),
|
|
29385
|
-
...variableValue(20, 80, "
|
|
29386
|
-
}, baseStep(20, "$", 40, "
|
|
29505
|
+
...variableValue(20, 80, "Points"),
|
|
29506
|
+
}, baseStep(20, "$", 40, "Points")),
|
|
29387
29507
|
};
|
|
29388
29508
|
const error$1 = {
|
|
29389
29509
|
...baseResponse(data, "confirmation", {
|
|
29390
29510
|
...baseReward$2,
|
|
29391
29511
|
...name("Visa® Prepaid Card USD"),
|
|
29392
29512
|
...imageUrl("https://i.imgur.com/veHErQX.png"),
|
|
29393
|
-
...variableValue(20, 80, "
|
|
29394
|
-
}, baseStep(20, "$", 40, "
|
|
29513
|
+
...variableValue(20, 80, "Points"),
|
|
29514
|
+
}, baseStep(20, "$", 40, "Points"), true),
|
|
29395
29515
|
};
|
|
29396
29516
|
const success = {
|
|
29397
29517
|
...baseResponse(data, "success", {
|
|
@@ -29401,6 +29521,22 @@ const success = {
|
|
|
29401
29521
|
...fixedValue("30 SaaSquatch Points"),
|
|
29402
29522
|
}),
|
|
29403
29523
|
};
|
|
29524
|
+
const success2 = {
|
|
29525
|
+
...baseResponse(data, "success", {
|
|
29526
|
+
...baseReward$2,
|
|
29527
|
+
...name("Visa® Prepaid Card USD"),
|
|
29528
|
+
...imageUrl("https://i.imgur.com/93BvEgH.png"),
|
|
29529
|
+
...variableValue(20, 80, "Points"),
|
|
29530
|
+
}, baseStep(20, "$", 40, "Points")),
|
|
29531
|
+
};
|
|
29532
|
+
const success3 = {
|
|
29533
|
+
...baseResponse(data, "success", {
|
|
29534
|
+
...baseReward$2,
|
|
29535
|
+
...name("A very exclusive gift box"),
|
|
29536
|
+
...imageUrl("https://i.imgur.com/93BvEgH.png"),
|
|
29537
|
+
...fixedValue("30 SaaSquatch Points"),
|
|
29538
|
+
}, undefined, undefined, undefined, "4ah2-hh46-gk7r"),
|
|
29539
|
+
};
|
|
29404
29540
|
const loading = {
|
|
29405
29541
|
...baseResponse(null, "chooseReward", null, null, false, true),
|
|
29406
29542
|
};
|
|
@@ -29409,8 +29545,8 @@ const RewardExchangeList_stories = {
|
|
|
29409
29545
|
title: "Components/Reward Exchange List",
|
|
29410
29546
|
};
|
|
29411
29547
|
const StoryBase = (props) => () => {
|
|
29412
|
-
return h$1(Resizer, null,
|
|
29413
|
-
h$1(RewardExchangeView, Object.assign({}, props)));
|
|
29548
|
+
return (h$1(Resizer, null,
|
|
29549
|
+
h$1(RewardExchangeView, Object.assign({}, props))));
|
|
29414
29550
|
};
|
|
29415
29551
|
const ChooseReward = StoryBase(rewardExchange);
|
|
29416
29552
|
const ChooseRewardSelected = StoryBase(rewardExchangeSelected);
|
|
@@ -29420,6 +29556,8 @@ const Confirm = StoryBase(confirmFixed);
|
|
|
29420
29556
|
const ConfirmVariable = StoryBase(confirmVariable);
|
|
29421
29557
|
const Error$3 = StoryBase(error$1);
|
|
29422
29558
|
const Success$2 = StoryBase(success);
|
|
29559
|
+
const SuccessVariable = StoryBase(success2);
|
|
29560
|
+
const SuccessPromo = StoryBase(success3);
|
|
29423
29561
|
const Loading$3 = StoryBase(loading);
|
|
29424
29562
|
|
|
29425
29563
|
const RewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
@@ -29433,25 +29571,61 @@ const RewardExchangeList = /*#__PURE__*/Object.freeze({
|
|
|
29433
29571
|
ConfirmVariable: ConfirmVariable,
|
|
29434
29572
|
Error: Error$3,
|
|
29435
29573
|
Success: Success$2,
|
|
29574
|
+
SuccessVariable: SuccessVariable,
|
|
29575
|
+
SuccessPromo: SuccessPromo,
|
|
29436
29576
|
Loading: Loading$3
|
|
29437
29577
|
});
|
|
29438
29578
|
|
|
29439
29579
|
const ProgramExplainer_stories = {
|
|
29440
29580
|
title: "Components/Program Explainer",
|
|
29441
29581
|
};
|
|
29442
|
-
const
|
|
29443
|
-
|
|
29444
|
-
|
|
29445
|
-
|
|
29446
|
-
|
|
29447
|
-
|
|
29448
|
-
|
|
29582
|
+
const props$2 = {
|
|
29583
|
+
header: "Klip Rewards",
|
|
29584
|
+
title: "Earn rewards with our loyalty program",
|
|
29585
|
+
description: "Earn points by completing tasks like uploading your first video or sharing videos with friends. Use your points to redeem rewards like one free month of Klip Enterprise or two plane tickets to anywhere in North America.",
|
|
29586
|
+
color: "black",
|
|
29587
|
+
background: "#F3F0EC",
|
|
29588
|
+
};
|
|
29589
|
+
const steps1 = {
|
|
29590
|
+
title: "Invite your friends to Klip",
|
|
29591
|
+
description: "Earn up to $1200 in rewards for each referral",
|
|
29592
|
+
color: "white",
|
|
29593
|
+
background: "#5B3EDA",
|
|
29594
|
+
};
|
|
29595
|
+
const steps2 = {
|
|
29596
|
+
title: "If your friend signs up for a Klip Business plan",
|
|
29597
|
+
description: "Get a $50 VISA giftcard when they pay for their first month",
|
|
29598
|
+
color: "black",
|
|
29599
|
+
background: "#F3CC66",
|
|
29600
|
+
};
|
|
29601
|
+
const steps3 = {
|
|
29602
|
+
title: "If your friend signs up for a Klip Enterprise plan",
|
|
29603
|
+
description: "Get up to $1200 in rewards - a $200 VISA giftcard when our sales team qualifies them as a good fit for Klip, and a $1000 VISA giftcard when they become a paying customer",
|
|
29604
|
+
color: "black",
|
|
29605
|
+
background: "#D3CCF5",
|
|
29606
|
+
};
|
|
29607
|
+
const OneStep = () => {
|
|
29608
|
+
return (h$1(ProgramExplainerView, Object.assign({}, props$2),
|
|
29609
|
+
h$1(ProgramExplainerStepView, Object.assign({}, steps1))));
|
|
29610
|
+
};
|
|
29611
|
+
const TwoSteps = () => {
|
|
29612
|
+
return (h$1(ProgramExplainerView, Object.assign({}, props$2),
|
|
29613
|
+
h$1(ProgramExplainerStepView, Object.assign({}, steps1)),
|
|
29614
|
+
h$1(ProgramExplainerStepView, Object.assign({}, steps2))));
|
|
29615
|
+
};
|
|
29616
|
+
const ThreeSteps = () => {
|
|
29617
|
+
return (h$1(ProgramExplainerView, Object.assign({}, props$2),
|
|
29618
|
+
h$1(ProgramExplainerStepView, Object.assign({}, steps1)),
|
|
29619
|
+
h$1(ProgramExplainerStepView, Object.assign({}, steps2)),
|
|
29620
|
+
h$1(ProgramExplainerStepView, Object.assign({}, steps3))));
|
|
29449
29621
|
};
|
|
29450
29622
|
|
|
29451
29623
|
const ProgramExplainer = /*#__PURE__*/Object.freeze({
|
|
29452
29624
|
__proto__: null,
|
|
29453
29625
|
'default': ProgramExplainer_stories,
|
|
29454
|
-
|
|
29626
|
+
OneStep: OneStep,
|
|
29627
|
+
TwoSteps: TwoSteps,
|
|
29628
|
+
ThreeSteps: ThreeSteps
|
|
29455
29629
|
});
|
|
29456
29630
|
|
|
29457
29631
|
const ProgramExplainerStep_stories = {
|