@frak-labs/components 1.3.4 → 1.5.0-beta.04afaf6b
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/cdn/Ambassador.Cmb0kX5D.js +519 -0
- package/cdn/Banner.2WJ4pT6E.js +227 -0
- package/cdn/ButtonShare.DSGvJfJ-.js +1 -0
- package/cdn/{ButtonWallet.CIesaq0l.js → ButtonWallet.DHpHCl4c.js} +2 -2
- package/cdn/GiftIcon.DYg5xgHg.js +1 -0
- package/cdn/InstallQr.CHImaq56.js +1 -0
- package/cdn/{OpenInAppButton.BtXknsxK.js → OpenInAppButton.CxBzRNKw.js} +1 -1
- package/cdn/PostPurchase.C75q-9BM.js +124 -0
- package/cdn/RewardReminder.C6o8lgak.js +369 -0
- package/cdn/components.js +1 -1
- package/cdn/format.D2Ai5cCn.js +1 -0
- package/cdn/{GiftIcon.CX0gLPUJ.js → icons.CdzHzZIJ.js} +1 -1
- package/cdn/jsxRuntime.module.7FJBZ9bf.js +58 -0
- package/cdn/loader.js +20 -16
- package/cdn/mountRewardReminder.BlmSRJDe.js +1 -0
- package/cdn/previewSummary.DxyobqED.js +1 -0
- package/cdn/replay-V6FXES7X.CgBxdfNp.js +1 -0
- package/cdn/rewardSummaryStore.DyjI-vPH.js +1 -0
- package/cdn/{rewards.F9iOJSNk.js → rewards.CeNLrK54.js} +1 -1
- package/cdn/useGlobalComponents.CNnOzerU.js +1 -0
- package/cdn/{useLightDomStyles.CpiH8nO2.js → useLightDomStyles.557xWurb.js} +1 -1
- package/cdn/usePlacement.DYgmdkfr.js +1 -0
- package/cdn/{useReward.B9ibElG0.js → useReward.BzUL3ijd.js} +1 -1
- package/dist/GiftIcon-Csu31jtf.js +62 -0
- package/dist/InstallQr-kpb44cfg.js +84 -0
- package/dist/ambassador.d.ts +16 -1
- package/dist/ambassador.js +626 -191
- package/dist/banner.d.ts +20 -6
- package/dist/banner.js +237 -15
- package/dist/buttonShare.js +2 -2
- package/dist/buttonWallet.js +1 -1
- package/dist/format-zGdbUoX_.js +283 -0
- package/dist/i18n/defaults.d.ts +72 -0
- package/dist/i18n/defaults.js +108 -6
- package/dist/{GiftIcon-B9k_syq6.js → icons-iN3qH_Bv.js} +1 -61
- package/dist/postPurchase.d.ts +6 -1
- package/dist/postPurchase.js +188 -34
- package/dist/previewSummary-CMc6q8vI.js +37 -0
- package/dist/rewardReminder.d.ts +50 -0
- package/dist/rewardReminder.js +809 -0
- package/dist/{rewards-CfGynCt6.js → rewards-BuNthAR2.js} +49 -46
- package/dist/{sharedBaseCss.css-nYy9vlzH.js → sharedBaseCss.css-D2HG4Ty8.js} +1 -1
- package/dist/{useReward-DmukZKoh.js → useReward-cQ54x8q-.js} +1 -1
- package/package.json +18 -12
- package/cdn/Ambassador.tWpfYThv.js +0 -392
- package/cdn/Banner.RSZt2Kn_.js +0 -208
- package/cdn/ButtonShare.Buy6qEfW.js +0 -1
- package/cdn/PostPurchase.Btgp2kLc.js +0 -102
- package/cdn/jsxRuntime.module.CUZaa90V.js +0 -58
- package/cdn/replay-V6FXES7X.efKsNT6s.js +0 -1
- package/cdn/useGlobalComponents.CXuceSQ0.js +0 -1
- package/cdn/usePlacement.Cq64cZ9Q.js +0 -1
package/dist/ambassador.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-SKmJGZgN.js";
|
|
2
|
-
import { i as w } from "./rewards-
|
|
2
|
+
import { i as w } from "./rewards-BuNthAR2.js";
|
|
3
3
|
import { t as useGlobalComponents } from "./useGlobalComponents-BF47jsBt.js";
|
|
4
4
|
import { t as useLightDomStyles } from "./useLightDomStyles-wGaNXHqN.js";
|
|
5
|
-
import { t as useReward } from "./useReward-
|
|
5
|
+
import { t as useReward } from "./useReward-cQ54x8q-.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
|
-
import { t as cssSource$2 } from "./sharedBaseCss.css-
|
|
8
|
-
import {
|
|
7
|
+
import { t as cssSource$2 } from "./sharedBaseCss.css-D2HG4Ty8.js";
|
|
8
|
+
import { a as resolveRewardCurrency, c as isClaimable, d as useInlineReminderRegistration, i as pickFiat, l as markClaimStarted, n as formatFiat, o as getRewardCountdown, r as formatRewardDate, s as useRewardSummary, t as fillReminderText } from "./format-zGdbUoX_.js";
|
|
9
|
+
import { n as QrSvg, r as useInstallQr, t as InstallQr } from "./InstallQr-kpb44cfg.js";
|
|
10
|
+
import { getEnvironment, isMobile, trackEvent } from "@frak-labs/core-sdk";
|
|
9
11
|
import { getInstallUrl } from "@frak-labs/core-sdk/actions";
|
|
10
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
12
|
+
import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
11
13
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
12
14
|
// src/hooks/useHostTheme.ts
|
|
13
15
|
const QUIET_BORDER_DISTANCE = 120;
|
|
@@ -17,6 +19,8 @@ const VISIBLE_CONTRAST = 1.5;
|
|
|
17
19
|
const VISIBLE_DISTANCE = 60;
|
|
18
20
|
const DEFAULT_ACCENT = "rgb(17, 17, 17)";
|
|
19
21
|
const DEFAULT_TAG_BG = "rgb(255, 255, 255)";
|
|
22
|
+
const WHITE = "rgb(255, 255, 255)";
|
|
23
|
+
const HEX_COLOR = /^#[0-9a-f]{6}$/i;
|
|
20
24
|
const TAG_TINT = .08;
|
|
21
25
|
const RESET_HEADING_RATIO = 1.25;
|
|
22
26
|
const WIDGET_WORDS = /cookie|consent|newsletter|popup|modal|sr-only|visually-hidden|skip-to/i;
|
|
@@ -35,6 +39,11 @@ const FONT_KNOBS = [
|
|
|
35
39
|
"h2-family",
|
|
36
40
|
"h2-transform"
|
|
37
41
|
];
|
|
42
|
+
const ACCENT_KNOBS = [
|
|
43
|
+
"accent",
|
|
44
|
+
"accent-ink",
|
|
45
|
+
"accent-text"
|
|
46
|
+
];
|
|
38
47
|
const REFERENCE_HEADINGS = "[data-frak-amb-ref]";
|
|
39
48
|
function alphaOf(value) {
|
|
40
49
|
const slash = /\/\s*([\d.]+)(%?)\s*\)/.exec(value);
|
|
@@ -265,7 +274,8 @@ function knobsFrom(source) {
|
|
|
265
274
|
...typographyOf(source.button, "cta", source.buttonBg, false)
|
|
266
275
|
];
|
|
267
276
|
if (source.radius) knobs.push(["radius", source.radius]);
|
|
268
|
-
knobs.push(...accentKnobs(source)
|
|
277
|
+
knobs.push(...accentKnobs(source));
|
|
278
|
+
knobs.push(...tagKnobs(source));
|
|
269
279
|
if (source.button) {
|
|
270
280
|
const from = getComputedStyle(source.button);
|
|
271
281
|
knobs.push(["cta-radius", from.borderRadius.split(" ")[0]], ["cta-transform", from.textTransform]);
|
|
@@ -275,16 +285,62 @@ function knobsFrom(source) {
|
|
|
275
285
|
function knobsSignature(knobs) {
|
|
276
286
|
return knobs.map(([name, value]) => `${name}=${value}`).sort().join("|");
|
|
277
287
|
}
|
|
278
|
-
|
|
288
|
+
/** The `--frak-amb-*` knobs among `names` that already resolve on the anchor: the merchant's own. */
|
|
289
|
+
function merchantKnobs(anchor, names) {
|
|
279
290
|
const current = getComputedStyle(anchor);
|
|
280
|
-
|
|
291
|
+
return new Set(names.filter((name) => current.getPropertyValue(`--frak-amb-${name}`).trim()));
|
|
292
|
+
}
|
|
293
|
+
function writeKnobs(anchor, knobs) {
|
|
294
|
+
const merchantSet = merchantKnobs(anchor, knobs.map(([name]) => name));
|
|
295
|
+
const written = [];
|
|
281
296
|
for (const [name, value] of knobs) {
|
|
282
297
|
if (!value || isTransparent(value)) continue;
|
|
283
298
|
if (merchantSet.has(name)) continue;
|
|
284
299
|
if (name === "accent-text" && merchantSet.has("accent")) continue;
|
|
285
300
|
anchor.style.setProperty(`--frak-amb-${name}`, value);
|
|
301
|
+
written.push(name);
|
|
286
302
|
}
|
|
287
303
|
markFontKnobs(anchor);
|
|
304
|
+
return written;
|
|
305
|
+
}
|
|
306
|
+
function rgbFromHex(hex) {
|
|
307
|
+
const channel = (at) => Number.parseInt(hex.slice(at, at + 2), 16);
|
|
308
|
+
return `rgb(${channel(1)}, ${channel(3)}, ${channel(5)})`;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* The dashboard accent, its ink and the figures' text. A light accent on a
|
|
312
|
+
* light page (or a dark one on a dark page) sends the text to the page's own
|
|
313
|
+
* colour, the same rule the sampled accent follows.
|
|
314
|
+
*/
|
|
315
|
+
function dashboardKnobs(anchor, hex) {
|
|
316
|
+
const fill = rgbFromHex(hex);
|
|
317
|
+
const ink = contrastRatio(fill, WHITE) >= READABLE_CONTRAST ? "#fff" : "#000";
|
|
318
|
+
const knobs = [["accent", hex], ["accent-ink", ink]];
|
|
319
|
+
if (!(contrastRatio(fill, backdropOf(anchor)) >= READABLE_CONTRAST)) knobs.push(["accent-text", "currentColor"]);
|
|
320
|
+
return knobs;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Writes the dashboard accent synchronously, so it neither waits for the
|
|
324
|
+
* sampler nor depends on it. A merchant's CSS accent takes it over entirely.
|
|
325
|
+
*/
|
|
326
|
+
function writeDashboardAccent(anchor, hex) {
|
|
327
|
+
if (!HEX_COLOR.test(hex)) return [];
|
|
328
|
+
const knobs = dashboardKnobs(anchor, hex);
|
|
329
|
+
const merchantSet = merchantKnobs(anchor, knobs.map(([name]) => name));
|
|
330
|
+
if (merchantSet.has("accent")) return [];
|
|
331
|
+
const written = [];
|
|
332
|
+
for (const [name, value] of knobs) {
|
|
333
|
+
if (merchantSet.has(name)) continue;
|
|
334
|
+
anchor.style.setProperty(`--frak-amb-${name}`, value);
|
|
335
|
+
written.push(name);
|
|
336
|
+
}
|
|
337
|
+
return written;
|
|
338
|
+
}
|
|
339
|
+
/** The one place that decides who owns the accent: the dashboard, else the sample. */
|
|
340
|
+
function writeAccent(anchor, dashboardHex, sampled) {
|
|
341
|
+
const dashboard = dashboardHex ? writeDashboardAccent(anchor, dashboardHex) : [];
|
|
342
|
+
if (dashboard.includes("accent")) return dashboard;
|
|
343
|
+
return sampled ? writeKnobs(anchor, sampled) : [];
|
|
288
344
|
}
|
|
289
345
|
/**
|
|
290
346
|
* Heading font rules apply only behind this attribute: an unset `var()` in
|
|
@@ -305,28 +361,52 @@ async function settled() {
|
|
|
305
361
|
if (document.fonts?.ready) await document.fonts.ready;
|
|
306
362
|
await nextFrame();
|
|
307
363
|
}
|
|
308
|
-
|
|
364
|
+
/**
|
|
365
|
+
* Themes the page from the host. `accentColor` (the dashboard setting) outranks
|
|
366
|
+
* the sampled button colour; the merchant's own `--frak-amb-accent` outranks both.
|
|
367
|
+
*/
|
|
368
|
+
function useHostTheme(target, accentColor) {
|
|
369
|
+
const [sampledAccent, setSampledAccent] = useState();
|
|
309
370
|
useEffect(() => {
|
|
310
371
|
let cancelled = false;
|
|
372
|
+
const anchor = target.current;
|
|
373
|
+
const written = [];
|
|
311
374
|
const run = async () => {
|
|
312
375
|
try {
|
|
313
376
|
await settled();
|
|
314
377
|
if (cancelled) return;
|
|
315
|
-
const
|
|
316
|
-
if (!
|
|
317
|
-
const first = knobsFrom(sampleTheme(
|
|
378
|
+
const current = target.current;
|
|
379
|
+
if (!current) return;
|
|
380
|
+
const first = knobsFrom(sampleTheme(current));
|
|
318
381
|
await nextFrame();
|
|
319
382
|
if (cancelled) return;
|
|
320
|
-
const second = knobsFrom(sampleTheme(
|
|
383
|
+
const second = knobsFrom(sampleTheme(current));
|
|
321
384
|
if (knobsSignature(first) !== knobsSignature(second)) return;
|
|
322
|
-
|
|
385
|
+
const isAccent = ([name]) => ACCENT_KNOBS.includes(name);
|
|
386
|
+
written.push(...writeKnobs(current, first.filter((k) => !isAccent(k))));
|
|
387
|
+
setSampledAccent(first.filter(isAccent));
|
|
323
388
|
} catch {}
|
|
324
389
|
};
|
|
325
390
|
run();
|
|
326
391
|
return () => {
|
|
327
392
|
cancelled = true;
|
|
393
|
+
if (!anchor) return;
|
|
394
|
+
for (const name of written) anchor.style.removeProperty(`--frak-amb-${name}`);
|
|
395
|
+
markFontKnobs(anchor);
|
|
328
396
|
};
|
|
329
397
|
}, [target]);
|
|
398
|
+
useLayoutEffect(() => {
|
|
399
|
+
const anchor = target.current;
|
|
400
|
+
if (!anchor) return;
|
|
401
|
+
const written = writeAccent(anchor, accentColor, sampledAccent);
|
|
402
|
+
return () => {
|
|
403
|
+
for (const name of written) anchor.style.removeProperty(`--frak-amb-${name}`);
|
|
404
|
+
};
|
|
405
|
+
}, [
|
|
406
|
+
target,
|
|
407
|
+
accentColor,
|
|
408
|
+
sampledAccent
|
|
409
|
+
]);
|
|
330
410
|
}
|
|
331
411
|
// \0ve-inline:src/components/Ambassador/Ambassador.css.ts.vanilla.js
|
|
332
412
|
const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
@@ -559,13 +639,140 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
559
639
|
display: block;
|
|
560
640
|
}
|
|
561
641
|
|
|
562
|
-
.
|
|
642
|
+
.Ambassador_myRewards__awpcg0r {
|
|
643
|
+
text-align: center;
|
|
644
|
+
justify-items: center;
|
|
645
|
+
gap: 1em;
|
|
646
|
+
padding: 2em 1.75em;
|
|
647
|
+
display: grid;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.Ambassador_myRewardsWithStub__awpcg0s {
|
|
651
|
+
text-align: start;
|
|
652
|
+
flex-wrap: wrap;
|
|
653
|
+
align-items: stretch;
|
|
654
|
+
gap: 0;
|
|
655
|
+
padding: 0;
|
|
656
|
+
display: flex;
|
|
657
|
+
overflow: hidden;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.Ambassador_myRewardsMain__awpcg0t {
|
|
661
|
+
flex: 999 24em;
|
|
662
|
+
align-content: center;
|
|
663
|
+
justify-items: start;
|
|
664
|
+
gap: .9em;
|
|
665
|
+
min-width: 0;
|
|
666
|
+
padding: 2.25em 2.5em;
|
|
667
|
+
display: grid;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.Ambassador_myRewardsStub__awpcg0u {
|
|
671
|
+
color: #111;
|
|
672
|
+
text-align: center;
|
|
673
|
+
background-color: #fff;
|
|
674
|
+
border-left: 2px dashed #11111138;
|
|
675
|
+
flex: 1 0 auto;
|
|
676
|
+
align-content: center;
|
|
677
|
+
justify-items: center;
|
|
678
|
+
gap: .75em;
|
|
679
|
+
padding: 2em 1.75em;
|
|
680
|
+
display: grid;
|
|
681
|
+
-webkit-mask-image: radial-gradient(.75em at 0 0, #0000 97%, #000 100%), radial-gradient(.75em at 0 100%, #0000 97%, #000 100%);
|
|
682
|
+
mask-image: radial-gradient(.75em at 0 0, #0000 97%, #000 100%), radial-gradient(.75em at 0 100%, #0000 97%, #000 100%);
|
|
683
|
+
-webkit-mask-position: top, bottom;
|
|
684
|
+
mask-position: top, bottom;
|
|
685
|
+
-webkit-mask-size: 100% 51%;
|
|
686
|
+
mask-size: 100% 51%;
|
|
687
|
+
-webkit-mask-repeat: no-repeat;
|
|
688
|
+
mask-repeat: no-repeat;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.Ambassador_myRewardsStubHeading__awpcg0v {
|
|
692
|
+
margin: 0;
|
|
693
|
+
font-size: 1.05em;
|
|
694
|
+
font-weight: 700;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.Ambassador_myRewardsStubQr__awpcg0w {
|
|
698
|
+
display: block;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.Ambassador_myRewardsStubQrPlaceholder__awpcg0x {
|
|
702
|
+
background-color: #f3f4f6;
|
|
703
|
+
width: 200px;
|
|
704
|
+
height: 200px;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.Ambassador_myRewardsStubCaption__awpcg0y {
|
|
708
|
+
color: #555;
|
|
709
|
+
max-width: 14em;
|
|
710
|
+
margin: 0;
|
|
711
|
+
font-size: .85em;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.Ambassador_myRewardsAmount__awpcg0z {
|
|
715
|
+
margin: 0;
|
|
716
|
+
font-size: clamp(3em, 12vw, 5.5em);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.Ambassador_myRewardsBreakdown__awpcg010 {
|
|
720
|
+
gap: .4em;
|
|
721
|
+
width: 100%;
|
|
722
|
+
max-width: 26em;
|
|
723
|
+
margin: 0;
|
|
724
|
+
padding: 0;
|
|
725
|
+
list-style: none;
|
|
726
|
+
display: grid;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.Ambassador_myRewardsRow__awpcg011 {
|
|
730
|
+
justify-content: space-between;
|
|
731
|
+
gap: 1em;
|
|
732
|
+
margin: 0;
|
|
733
|
+
display: flex;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
.Ambassador_myRewardsRowValue__awpcg012 {
|
|
737
|
+
font-weight: 700;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.Ambassador_myRewardsCountdown__awpcg013 {
|
|
741
|
+
margin: 0;
|
|
742
|
+
font-weight: 700;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.Ambassador_myRewardsActions__awpcg014 {
|
|
746
|
+
flex-wrap: wrap;
|
|
747
|
+
justify-content: center;
|
|
748
|
+
align-items: center;
|
|
749
|
+
gap: 1em 1.5em;
|
|
750
|
+
display: flex;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.Ambassador_myRewardsActionsStart__awpcg015 {
|
|
754
|
+
justify-content: flex-start;
|
|
755
|
+
gap: .75em;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.Ambassador_myRewardsSecondaryCta__awpcg016 {
|
|
759
|
+
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
760
|
+
border: 1px solid var(--frak-amb-border, #11111126);
|
|
761
|
+
background-color: #0000;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.Ambassador_myRewardsSecondaryCta__awpcg016:hover {
|
|
765
|
+
opacity: 1;
|
|
766
|
+
background-color: var(--frak-amb-surface, #1111110a);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.Ambassador_stepsGrid__awpcg017 {
|
|
563
770
|
grid-template-columns: repeat(auto-fit, minmax(min(15em, 100%), 1fr));
|
|
564
771
|
gap: 1.25em;
|
|
565
772
|
display: grid;
|
|
566
773
|
}
|
|
567
774
|
|
|
568
|
-
.
|
|
775
|
+
.Ambassador_stepNumber__awpcg018 {
|
|
569
776
|
border-radius: var(--frak-amb-cta-radius, 999px);
|
|
570
777
|
background-color: var(--frak-amb-accent, #111);
|
|
571
778
|
block-size: 1.9em;
|
|
@@ -578,19 +785,19 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
578
785
|
display: grid;
|
|
579
786
|
}
|
|
580
787
|
|
|
581
|
-
.
|
|
788
|
+
.Ambassador_stepIcon__awpcg019 {
|
|
582
789
|
object-fit: contain;
|
|
583
790
|
width: 40px;
|
|
584
791
|
height: 40px;
|
|
585
792
|
}
|
|
586
793
|
|
|
587
|
-
.
|
|
794
|
+
.Ambassador_stepTitle__awpcg01a {
|
|
588
795
|
margin: 0;
|
|
589
796
|
font-size: 1.05em;
|
|
590
797
|
line-height: 1.3;
|
|
591
798
|
}
|
|
592
799
|
|
|
593
|
-
.
|
|
800
|
+
.Ambassador_winWinCards__awpcg01b {
|
|
594
801
|
grid-template-columns: repeat(auto-fit, minmax(min(15em, 100%), 1fr));
|
|
595
802
|
gap: 1.25em;
|
|
596
803
|
width: 100%;
|
|
@@ -598,21 +805,21 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
598
805
|
display: grid;
|
|
599
806
|
}
|
|
600
807
|
|
|
601
|
-
.
|
|
808
|
+
.Ambassador_winWinCard__awpcg01c {
|
|
602
809
|
text-align: center;
|
|
603
810
|
justify-items: center;
|
|
604
811
|
}
|
|
605
812
|
|
|
606
|
-
.
|
|
813
|
+
.Ambassador_winWinCardAmount__awpcg01d {
|
|
607
814
|
margin: 0;
|
|
608
815
|
font-size: clamp(2em, 6vw, 3em);
|
|
609
816
|
}
|
|
610
817
|
|
|
611
|
-
.
|
|
818
|
+
.Ambassador_referralCta__awpcg01e {
|
|
612
819
|
justify-self: start;
|
|
613
820
|
}
|
|
614
821
|
|
|
615
|
-
.
|
|
822
|
+
.Ambassador_store__awpcg01f {
|
|
616
823
|
grid-template-columns: repeat(auto-fit, minmax(min(14em, 100%), 1fr));
|
|
617
824
|
align-items: center;
|
|
618
825
|
gap: 1.75em;
|
|
@@ -620,14 +827,14 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
620
827
|
display: grid;
|
|
621
828
|
}
|
|
622
829
|
|
|
623
|
-
.
|
|
830
|
+
.Ambassador_storeBody__awpcg01g {
|
|
624
831
|
align-content: start;
|
|
625
832
|
gap: .75em;
|
|
626
833
|
min-width: 0;
|
|
627
834
|
display: grid;
|
|
628
835
|
}
|
|
629
836
|
|
|
630
|
-
.
|
|
837
|
+
.Ambassador_storeQr__awpcg01h {
|
|
631
838
|
text-align: center;
|
|
632
839
|
justify-items: center;
|
|
633
840
|
gap: .5em;
|
|
@@ -635,14 +842,14 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
635
842
|
display: grid;
|
|
636
843
|
}
|
|
637
844
|
|
|
638
|
-
.
|
|
845
|
+
.Ambassador_storeBadges__awpcg01i {
|
|
639
846
|
flex-wrap: wrap;
|
|
640
847
|
align-items: center;
|
|
641
848
|
gap: .75em;
|
|
642
849
|
display: flex;
|
|
643
850
|
}
|
|
644
851
|
|
|
645
|
-
.
|
|
852
|
+
.Ambassador_storeBadge__awpcg01j {
|
|
646
853
|
border-radius: 8px;
|
|
647
854
|
align-items: center;
|
|
648
855
|
line-height: 0;
|
|
@@ -653,12 +860,12 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
653
860
|
background-color: #000 !important;
|
|
654
861
|
}
|
|
655
862
|
|
|
656
|
-
.
|
|
863
|
+
.Ambassador_storeBadge__awpcg01j:focus-visible {
|
|
657
864
|
outline-color: #000;
|
|
658
865
|
box-shadow: 0 0 0 2px #fff;
|
|
659
866
|
}
|
|
660
867
|
|
|
661
|
-
.
|
|
868
|
+
.Ambassador_storeBadgeArt__awpcg01k {
|
|
662
869
|
display: block;
|
|
663
870
|
border: 0 !important;
|
|
664
871
|
border-radius: 0 !important;
|
|
@@ -668,22 +875,22 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
668
875
|
margin: 0 !important;
|
|
669
876
|
}
|
|
670
877
|
|
|
671
|
-
.
|
|
878
|
+
.Ambassador_faqItem__awpcg01l {
|
|
672
879
|
border-bottom: 1px solid var(--frak-amb-border, #11111126);
|
|
673
880
|
padding: .9em 0;
|
|
674
881
|
}
|
|
675
882
|
|
|
676
|
-
.
|
|
883
|
+
.Ambassador_faqQuestion__awpcg01m {
|
|
677
884
|
cursor: pointer;
|
|
678
885
|
font-weight: 700;
|
|
679
886
|
list-style: none;
|
|
680
887
|
}
|
|
681
888
|
|
|
682
|
-
.
|
|
889
|
+
.Ambassador_faqQuestion__awpcg01m::-webkit-details-marker {
|
|
683
890
|
display: none;
|
|
684
891
|
}
|
|
685
892
|
|
|
686
|
-
.
|
|
893
|
+
.Ambassador_faqQuestion__awpcg01m:after {
|
|
687
894
|
content: "+";
|
|
688
895
|
float: right;
|
|
689
896
|
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
@@ -691,20 +898,20 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
691
898
|
font-weight: 700;
|
|
692
899
|
}
|
|
693
900
|
|
|
694
|
-
.
|
|
901
|
+
.Ambassador_faqItem__awpcg01l[open] .Ambassador_faqQuestion__awpcg01m:after {
|
|
695
902
|
content: "–";
|
|
696
903
|
}
|
|
697
904
|
|
|
698
|
-
.
|
|
905
|
+
.Ambassador_faqAnswer__awpcg01n {
|
|
699
906
|
opacity: .75;
|
|
700
907
|
margin: .6em 0 0;
|
|
701
908
|
}
|
|
702
909
|
|
|
703
|
-
.
|
|
910
|
+
.Ambassador_faqAttribution__awpcg01o {
|
|
704
911
|
text-align: center;
|
|
705
912
|
}
|
|
706
913
|
|
|
707
|
-
.
|
|
914
|
+
.Ambassador_frakLink__awpcg01p {
|
|
708
915
|
color: inherit;
|
|
709
916
|
text-underline-offset: .15em;
|
|
710
917
|
text-decoration: underline;
|
|
@@ -716,7 +923,7 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
716
923
|
border: 1px solid var(--frak-amb-border, color-mix(in srgb, var(--frak-amb-accent, #111) 15%, transparent));
|
|
717
924
|
}
|
|
718
925
|
|
|
719
|
-
.
|
|
926
|
+
.Ambassador_faqItem__awpcg01l {
|
|
720
927
|
border-bottom: 1px solid var(--frak-amb-border, color-mix(in srgb, var(--frak-amb-accent, #111) 15%, transparent));
|
|
721
928
|
}
|
|
722
929
|
}
|
|
@@ -725,12 +932,12 @@ const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
|
725
932
|
var amountUnit = "Ambassador_amountUnit__awpcg0a";
|
|
726
933
|
var amountWords = "Ambassador_amountWords__awpcg0b";
|
|
727
934
|
var faq = "Ambassador_region__awpcg03";
|
|
728
|
-
var faqAnswer = "
|
|
729
|
-
var faqAttribution = "
|
|
730
|
-
var faqItem = "
|
|
731
|
-
var faqQuestion = "
|
|
935
|
+
var faqAnswer = "Ambassador_faqAnswer__awpcg01n";
|
|
936
|
+
var faqAttribution = "Ambassador_faqAttribution__awpcg01o Ambassador_mutedSmall__awpcg07";
|
|
937
|
+
var faqItem = "Ambassador_faqItem__awpcg01l";
|
|
938
|
+
var faqQuestion = "Ambassador_faqQuestion__awpcg01m";
|
|
732
939
|
var faqTitle = "Ambassador_regionTitle__awpcg05";
|
|
733
|
-
var frakLink = "
|
|
940
|
+
var frakLink = "Ambassador_frakLink__awpcg01p";
|
|
734
941
|
var hero = "Ambassador_hero__awpcg0d Ambassador_region__awpcg03";
|
|
735
942
|
var heroAmount = "Ambassador_heroAmount__awpcg0l";
|
|
736
943
|
var heroArt = "Ambassador_heroArt__awpcg0g Ambassador_panel__awpcg00";
|
|
@@ -746,8 +953,29 @@ var heroRewardCaption = "Ambassador_heroRewardCaption__awpcg0m";
|
|
|
746
953
|
var heroTag = "Ambassador_heroTag__awpcg0j";
|
|
747
954
|
var heroTagMain = "Ambassador_heroTagMain__awpcg0k";
|
|
748
955
|
var heroTitle = "Ambassador_heroTitle__awpcg0f";
|
|
956
|
+
var myRewards = "Ambassador_myRewards__awpcg0r Ambassador_panel__awpcg00";
|
|
957
|
+
var myRewardsActions = "Ambassador_myRewardsActions__awpcg014";
|
|
958
|
+
var myRewardsActionsStart = "Ambassador_myRewardsActionsStart__awpcg015";
|
|
959
|
+
var myRewardsAmount = "Ambassador_myRewardsAmount__awpcg0z Ambassador_bigFigure__awpcg0c";
|
|
960
|
+
var myRewardsBreakdown = "Ambassador_myRewardsBreakdown__awpcg010";
|
|
961
|
+
var myRewardsCountdown = "Ambassador_myRewardsCountdown__awpcg013";
|
|
962
|
+
var myRewardsCta = "Ambassador_ctaButton__awpcg02 sharedBaseCss_buttonReset__7cswil0";
|
|
963
|
+
var myRewardsEyebrow = "Ambassador_mutedSmall__awpcg07";
|
|
964
|
+
var myRewardsFooter = "Ambassador_mutedSmall__awpcg07";
|
|
965
|
+
var myRewardsHeading = "Ambassador_regionTitle__awpcg05";
|
|
966
|
+
var myRewardsMain = "Ambassador_myRewardsMain__awpcg0t";
|
|
967
|
+
var myRewardsNote = "Ambassador_mutedSmall__awpcg07";
|
|
968
|
+
var myRewardsRow = "Ambassador_myRewardsRow__awpcg011";
|
|
969
|
+
var myRewardsRowValue = "Ambassador_myRewardsRowValue__awpcg012";
|
|
970
|
+
var myRewardsSecondaryCta = "Ambassador_myRewardsSecondaryCta__awpcg016 Ambassador_ctaButton__awpcg02 sharedBaseCss_buttonReset__7cswil0";
|
|
971
|
+
var myRewardsStub = "Ambassador_myRewardsStub__awpcg0u";
|
|
972
|
+
var myRewardsStubCaption = "Ambassador_myRewardsStubCaption__awpcg0y";
|
|
973
|
+
var myRewardsStubHeading = "Ambassador_myRewardsStubHeading__awpcg0v";
|
|
974
|
+
var myRewardsStubQr = "Ambassador_myRewardsStubQr__awpcg0w";
|
|
975
|
+
var myRewardsStubQrPlaceholder = "Ambassador_myRewardsStubQrPlaceholder__awpcg0x";
|
|
976
|
+
var myRewardsWithStub = "Ambassador_myRewardsWithStub__awpcg0s";
|
|
749
977
|
var referral = "Ambassador_region__awpcg03";
|
|
750
|
-
var referralCta = "
|
|
978
|
+
var referralCta = "Ambassador_referralCta__awpcg01e Ambassador_ctaButton__awpcg02 sharedBaseCss_buttonReset__7cswil0";
|
|
751
979
|
var referralLede = "Ambassador_lede__awpcg06";
|
|
752
980
|
var referralTitle = "Ambassador_regionTitle__awpcg05";
|
|
753
981
|
var reward = "Ambassador_centeredRegion__awpcg04 Ambassador_region__awpcg03";
|
|
@@ -762,97 +990,274 @@ var rewardLede = "Ambassador_lede__awpcg06";
|
|
|
762
990
|
var root = "Ambassador_root__awpcg01";
|
|
763
991
|
var step = "Ambassador_card__awpcg09 Ambassador_panel__awpcg00";
|
|
764
992
|
var stepDescription = "Ambassador_muted__awpcg08";
|
|
765
|
-
var stepIcon = "
|
|
766
|
-
var stepNumber = "
|
|
767
|
-
var stepTitle = "
|
|
993
|
+
var stepIcon = "Ambassador_stepIcon__awpcg019";
|
|
994
|
+
var stepNumber = "Ambassador_stepNumber__awpcg018";
|
|
995
|
+
var stepTitle = "Ambassador_stepTitle__awpcg01a";
|
|
768
996
|
var steps = "Ambassador_region__awpcg03";
|
|
769
|
-
var stepsGrid = "
|
|
997
|
+
var stepsGrid = "Ambassador_stepsGrid__awpcg017";
|
|
770
998
|
var stepsLede = "Ambassador_lede__awpcg06";
|
|
771
999
|
var stepsTitle = "Ambassador_regionTitle__awpcg05";
|
|
772
|
-
var store = "
|
|
773
|
-
var storeBadge = "
|
|
774
|
-
var storeBadgeArt = "
|
|
775
|
-
var storeBadges = "
|
|
776
|
-
var storeBody = "
|
|
1000
|
+
var store = "Ambassador_store__awpcg01f Ambassador_panel__awpcg00";
|
|
1001
|
+
var storeBadge = "Ambassador_storeBadge__awpcg01j sharedBaseCss_buttonReset__7cswil0";
|
|
1002
|
+
var storeBadgeArt = "Ambassador_storeBadgeArt__awpcg01k";
|
|
1003
|
+
var storeBadges = "Ambassador_storeBadges__awpcg01i";
|
|
1004
|
+
var storeBody = "Ambassador_storeBody__awpcg01g";
|
|
777
1005
|
var storeLede = "Ambassador_lede__awpcg06";
|
|
778
|
-
var storeQr = "
|
|
1006
|
+
var storeQr = "Ambassador_storeQr__awpcg01h";
|
|
779
1007
|
var storeQrCaption = "Ambassador_mutedSmall__awpcg07";
|
|
780
1008
|
var storeTitle = "Ambassador_regionTitle__awpcg05";
|
|
781
1009
|
var winWin = "Ambassador_centeredRegion__awpcg04 Ambassador_region__awpcg03";
|
|
782
|
-
var winWinCard = "
|
|
783
|
-
var winWinCardAmount = "
|
|
1010
|
+
var winWinCard = "Ambassador_winWinCard__awpcg01c Ambassador_card__awpcg09 Ambassador_panel__awpcg00";
|
|
1011
|
+
var winWinCardAmount = "Ambassador_winWinCardAmount__awpcg01d Ambassador_bigFigure__awpcg0c";
|
|
784
1012
|
var winWinCardDescription = "Ambassador_muted__awpcg08";
|
|
785
1013
|
var winWinCardLabel = "Ambassador_mutedSmall__awpcg07";
|
|
786
|
-
var winWinCards = "
|
|
1014
|
+
var winWinCards = "Ambassador_winWinCards__awpcg01b";
|
|
787
1015
|
var winWinLede = "Ambassador_lede__awpcg06";
|
|
788
1016
|
var winWinTitle = "Ambassador_regionTitle__awpcg05";
|
|
789
1017
|
const cssSource = cssSource$1;
|
|
790
|
-
// src/components/Ambassador/
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
1018
|
+
// src/components/Ambassador/Figure.tsx
|
|
1019
|
+
const FIGURE = /^(\D*?)(\d[\d\s.,\u00A0\u202F]*?)(\D*)$/;
|
|
1020
|
+
/** Draws the currency of a formatted amount smaller; wording without a figure passes through. */
|
|
1021
|
+
function Figure({ amount }) {
|
|
1022
|
+
const parts = FIGURE.exec(amount);
|
|
1023
|
+
if (!parts) return /* @__PURE__ */ jsx("span", {
|
|
1024
|
+
class: `${amountWords} frak-ambassador__amount-words`,
|
|
1025
|
+
children: amount
|
|
1026
|
+
});
|
|
1027
|
+
const [, before, figure, after] = parts;
|
|
1028
|
+
const unit = (text) => text ? /* @__PURE__ */ jsx("small", {
|
|
1029
|
+
class: `${amountUnit} frak-ambassador__amount-unit`,
|
|
1030
|
+
children: text
|
|
1031
|
+
}) : null;
|
|
1032
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1033
|
+
unit(before),
|
|
1034
|
+
figure,
|
|
1035
|
+
unit(after)
|
|
1036
|
+
] });
|
|
1037
|
+
}
|
|
1038
|
+
// src/components/Ambassador/MyRewards.tsx
|
|
1039
|
+
/** Unlinked visitors with something waiting claim it; linked ones see what this merchant paid or owes. */
|
|
1040
|
+
function resolveMyRewardsView(summary) {
|
|
1041
|
+
if (!summary) return null;
|
|
1042
|
+
if (isClaimable(summary)) return "claim";
|
|
1043
|
+
if (!summary.linked) return null;
|
|
1044
|
+
const hasEarned = !!summary.earned && pickFiat(summary.earned.total, resolveRewardCurrency()) > 0;
|
|
1045
|
+
const hasPending = !!summary.pending && summary.pending.count > 0;
|
|
1046
|
+
return hasEarned || hasPending ? "earned" : null;
|
|
1047
|
+
}
|
|
1048
|
+
function formatDate(iso, lang) {
|
|
1049
|
+
if (!iso || Number.isNaN(Date.parse(iso))) return void 0;
|
|
1050
|
+
return formatRewardDate(new Date(iso), lang);
|
|
1051
|
+
}
|
|
1052
|
+
function countdownText(copy, countdown, lang) {
|
|
1053
|
+
if (!countdown) return void 0;
|
|
1054
|
+
let template = copy.myRewardsCountdown;
|
|
1055
|
+
if (countdown.days === 0) template = copy.myRewardsCountdownToday;
|
|
1056
|
+
else if (countdown.days === 1) template = copy.myRewardsCountdownOneDay;
|
|
1057
|
+
return fillReminderText(template, {
|
|
1058
|
+
days: countdown.days,
|
|
1059
|
+
date: formatRewardDate(countdown.date, lang)
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
function ClaimStub({ copy, grid, qrLabel }) {
|
|
1063
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1064
|
+
class: `${myRewardsStub} frak-ambassador__my-rewards-stub`,
|
|
1065
|
+
children: [
|
|
1066
|
+
/* @__PURE__ */ jsx("p", {
|
|
1067
|
+
class: myRewardsStubHeading,
|
|
1068
|
+
children: copy.myRewardsQrHeading
|
|
1069
|
+
}),
|
|
1070
|
+
grid ? /* @__PURE__ */ jsx(QrSvg, {
|
|
1071
|
+
grid,
|
|
1072
|
+
label: qrLabel,
|
|
1073
|
+
class: myRewardsStubQr
|
|
1074
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
1075
|
+
class: myRewardsStubQrPlaceholder,
|
|
1076
|
+
"aria-hidden": "true"
|
|
1077
|
+
}),
|
|
1078
|
+
/* @__PURE__ */ jsx("p", {
|
|
1079
|
+
class: myRewardsStubCaption,
|
|
1080
|
+
children: copy.myRewardsQrCaption
|
|
1081
|
+
})
|
|
1082
|
+
]
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
function ClaimRewards({ summary, lang, brand, overrides, installUrl, isClientReady, onShare, footer, qrLabel, isDesktop }) {
|
|
1086
|
+
const { wide, grid } = useInstallQr(isDesktop ? installUrl : void 0);
|
|
1087
|
+
const withStub = isDesktop && wide;
|
|
1088
|
+
const { pending } = summary;
|
|
1089
|
+
const copy = componentDefaults[lang].ambassador;
|
|
1090
|
+
const currency = resolveRewardCurrency();
|
|
1091
|
+
const total = formatFiat(pending.total, currency);
|
|
1092
|
+
const countdown = getRewardCountdown(pending.expiresAt);
|
|
1093
|
+
const locked = pending.lockedCount > 0;
|
|
1094
|
+
const unlockDate = locked ? formatDate(pending.nextUnlockAt, lang) : void 0;
|
|
1095
|
+
const reminder = {
|
|
1096
|
+
surface: "ambassador",
|
|
1097
|
+
days_left: countdown?.days,
|
|
1098
|
+
locked
|
|
1099
|
+
};
|
|
1100
|
+
const allLocked = pending.lockedCount >= pending.count;
|
|
1101
|
+
const impressionTracked = useRef(false);
|
|
1102
|
+
const eyebrowId = useId();
|
|
1103
|
+
const inert = installUrl === void 0;
|
|
1104
|
+
useInlineReminderRegistration(true);
|
|
805
1105
|
useEffect(() => {
|
|
806
|
-
if (
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
1106
|
+
if (impressionTracked.current) return;
|
|
1107
|
+
impressionTracked.current = true;
|
|
1108
|
+
trackEvent(window.FrakSetup?.client, "reward_reminder_impression", reminder);
|
|
1109
|
+
}, [reminder]);
|
|
1110
|
+
const rows = [[copy.myRewardsCashbackLabel, pending.cashback], [copy.myRewardsFriendsLabel, pending.fromFriends]];
|
|
1111
|
+
const countdownLine = countdownText(copy, countdown, lang);
|
|
1112
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1113
|
+
/* @__PURE__ */ jsx("p", {
|
|
1114
|
+
id: eyebrowId,
|
|
1115
|
+
class: `${myRewardsEyebrow} frak-ambassador__my-rewards-eyebrow`,
|
|
1116
|
+
children: overrides.myRewardsEyebrow ?? copy.myRewardsEyebrow
|
|
1117
|
+
}),
|
|
1118
|
+
/* @__PURE__ */ jsx("p", {
|
|
1119
|
+
class: `${myRewardsAmount} frak-ambassador__my-rewards-amount`,
|
|
1120
|
+
children: /* @__PURE__ */ jsx(Figure, { amount: total })
|
|
1121
|
+
}),
|
|
1122
|
+
/* @__PURE__ */ jsx("div", {
|
|
1123
|
+
class: `${myRewardsBreakdown} frak-ambassador__my-rewards-breakdown`,
|
|
1124
|
+
children: rows.filter(([, amounts]) => pickFiat(amounts, currency) > 0).map(([label, amounts]) => /* @__PURE__ */ jsxs("p", {
|
|
1125
|
+
class: `${myRewardsRow} frak-ambassador__my-rewards-row`,
|
|
1126
|
+
children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx("span", {
|
|
1127
|
+
class: myRewardsRowValue,
|
|
1128
|
+
children: formatFiat(amounts, currency)
|
|
1129
|
+
})]
|
|
1130
|
+
}, label))
|
|
1131
|
+
}),
|
|
1132
|
+
countdownLine ? /* @__PURE__ */ jsx("p", {
|
|
1133
|
+
class: `${myRewardsCountdown} frak-ambassador__my-rewards-countdown`,
|
|
1134
|
+
children: countdownLine
|
|
1135
|
+
}) : null,
|
|
1136
|
+
unlockDate ? /* @__PURE__ */ jsx("p", {
|
|
1137
|
+
class: `${myRewardsNote} frak-ambassador__my-rewards-unlock`,
|
|
1138
|
+
children: fillReminderText(allLocked ? copy.myRewardsUnlockNoteAll : copy.myRewardsUnlockNote, { date: unlockDate })
|
|
1139
|
+
}) : null,
|
|
1140
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1141
|
+
class: `${myRewardsActions}${withStub ? ` ${myRewardsActionsStart}` : ""} frak-ambassador__my-rewards-actions`,
|
|
1142
|
+
children: [/* @__PURE__ */ jsx("a", {
|
|
1143
|
+
class: `${myRewardsCta} frak-ambassador__my-rewards-cta`,
|
|
1144
|
+
href: installUrl,
|
|
1145
|
+
role: inert ? "link" : void 0,
|
|
1146
|
+
tabIndex: inert ? 0 : void 0,
|
|
1147
|
+
"aria-disabled": inert ? "true" : void 0,
|
|
1148
|
+
onClick: (event) => {
|
|
1149
|
+
if (inert) {
|
|
1150
|
+
event.preventDefault();
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
markClaimStarted();
|
|
1154
|
+
trackEvent(window.FrakSetup?.client, "reward_reminder_claim_clicked", reminder);
|
|
1155
|
+
},
|
|
1156
|
+
children: fillReminderText(overrides.myRewardsClaimCtaLabel ?? copy.myRewardsClaimCta, {
|
|
1157
|
+
reward: total,
|
|
1158
|
+
brand
|
|
1159
|
+
})
|
|
1160
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1161
|
+
type: "button",
|
|
1162
|
+
class: `${myRewardsSecondaryCta} frak-ambassador__my-rewards-share`,
|
|
1163
|
+
disabled: !isClientReady,
|
|
1164
|
+
onClick: onShare,
|
|
1165
|
+
children: fillReminderText(overrides.myRewardsShareCtaLabel ?? copy.myRewardsShareCta, { brand })
|
|
838
1166
|
})]
|
|
839
|
-
}),
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
1167
|
+
}),
|
|
1168
|
+
/* @__PURE__ */ jsx("p", {
|
|
1169
|
+
class: `${myRewardsFooter} frak-ambassador__my-rewards-footer`,
|
|
1170
|
+
children: footer
|
|
1171
|
+
})
|
|
1172
|
+
] });
|
|
1173
|
+
return /* @__PURE__ */ jsx("section", {
|
|
1174
|
+
"aria-labelledby": eyebrowId,
|
|
1175
|
+
class: `${myRewards}${withStub ? ` ${myRewardsWithStub}` : ""} frak-ambassador__my-rewards frak-ambassador__my-rewards--claim`,
|
|
1176
|
+
children: withStub ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
1177
|
+
class: `${myRewardsMain} frak-ambassador__my-rewards-main`,
|
|
1178
|
+
children: content
|
|
1179
|
+
}), /* @__PURE__ */ jsx(ClaimStub, {
|
|
1180
|
+
copy,
|
|
1181
|
+
grid,
|
|
1182
|
+
qrLabel
|
|
1183
|
+
})] }) : content
|
|
843
1184
|
});
|
|
844
1185
|
}
|
|
845
|
-
function
|
|
846
|
-
|
|
847
|
-
|
|
1186
|
+
function EarnedRewards({ summary, lang, brand, overrides, isClientReady, onShare }) {
|
|
1187
|
+
const copy = componentDefaults[lang].ambassador;
|
|
1188
|
+
const currency = resolveRewardCurrency();
|
|
1189
|
+
const { earned, pending } = summary;
|
|
1190
|
+
const receivedTotal = earned && pickFiat(earned.total, currency) > 0 ? formatFiat(earned.total, currency) : void 0;
|
|
1191
|
+
const unlockDate = pending && pending.lockedCount > 0 ? formatDate(pending.nextUnlockAt, lang) : void 0;
|
|
1192
|
+
const pendingTemplate = unlockDate ? copy.myRewardsOnItsWayUnlock : copy.myRewardsOnItsWay;
|
|
1193
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
1194
|
+
class: `${myRewards} frak-ambassador__my-rewards frak-ambassador__my-rewards--earned`,
|
|
1195
|
+
children: [
|
|
1196
|
+
/* @__PURE__ */ jsx("h2", {
|
|
1197
|
+
class: `${myRewardsHeading} frak-ambassador__my-rewards-heading`,
|
|
1198
|
+
children: fillReminderText(overrides.myRewardsLinkedHeading ?? copy.myRewardsLinkedHeading, { brand })
|
|
1199
|
+
}),
|
|
1200
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1201
|
+
class: `${myRewardsBreakdown} frak-ambassador__my-rewards-breakdown`,
|
|
1202
|
+
children: [receivedTotal ? /* @__PURE__ */ jsx("p", {
|
|
1203
|
+
class: `${myRewardsCountdown} frak-ambassador__my-rewards-earned`,
|
|
1204
|
+
children: fillReminderText(copy.myRewardsReceived, { reward: receivedTotal })
|
|
1205
|
+
}) : null, pending && pending.count > 0 ? /* @__PURE__ */ jsx("p", {
|
|
1206
|
+
class: `${myRewardsCountdown} frak-ambassador__my-rewards-pending`,
|
|
1207
|
+
children: fillReminderText(pendingTemplate, {
|
|
1208
|
+
reward: formatFiat(pending.total, currency),
|
|
1209
|
+
date: unlockDate
|
|
1210
|
+
})
|
|
1211
|
+
}) : null]
|
|
1212
|
+
}),
|
|
1213
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1214
|
+
class: `${myRewardsActions} frak-ambassador__my-rewards-actions`,
|
|
1215
|
+
children: [/* @__PURE__ */ jsx("a", {
|
|
1216
|
+
class: `${myRewardsCta} frak-ambassador__my-rewards-cta`,
|
|
1217
|
+
href: `${getEnvironment().wallet}/wallet`,
|
|
1218
|
+
target: "_blank",
|
|
1219
|
+
rel: "noopener",
|
|
1220
|
+
children: fillReminderText(overrides.myRewardsWalletCtaLabel ?? copy.myRewardsWalletCta, { brand })
|
|
1221
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1222
|
+
type: "button",
|
|
1223
|
+
class: `${myRewardsSecondaryCta} frak-ambassador__my-rewards-share`,
|
|
1224
|
+
disabled: !isClientReady,
|
|
1225
|
+
onClick: onShare,
|
|
1226
|
+
children: fillReminderText(overrides.myRewardsShareAgainCtaLabel ?? copy.myRewardsShareAgainCta, { brand })
|
|
1227
|
+
})]
|
|
1228
|
+
})
|
|
1229
|
+
]
|
|
1230
|
+
});
|
|
848
1231
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1232
|
+
/** The page's reward summary, plus the formatted pending total while it can be claimed. */
|
|
1233
|
+
function useMyRewards(isClientReady) {
|
|
1234
|
+
const { summary } = useRewardSummary(isClientReady);
|
|
1235
|
+
return {
|
|
1236
|
+
summary,
|
|
1237
|
+
claimReward: isClaimable(summary) ? formatFiat(summary.pending.total, resolveRewardCurrency()) : void 0
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
/** While a reward waits, the store block sells the claim unless the merchant wrote its own heading. */
|
|
1241
|
+
function claimStoreHeading(defaults, override, claimReward, brand) {
|
|
1242
|
+
if (!claimReward || override !== void 0) return void 0;
|
|
1243
|
+
return fillReminderText(defaults.storeHeadingClaim, {
|
|
1244
|
+
reward: claimReward,
|
|
1245
|
+
brand
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
/** The claim prompt sits above the hero, the linked recap below it. */
|
|
1249
|
+
function MyRewardsSlot({ placement, summary, ...props }) {
|
|
1250
|
+
const view = resolveMyRewardsView(summary);
|
|
1251
|
+
if (placement === "above" && view === "claim" && isClaimable(summary)) return /* @__PURE__ */ jsx(ClaimRewards, {
|
|
1252
|
+
...props,
|
|
1253
|
+
summary,
|
|
1254
|
+
isDesktop: !isMobile()
|
|
1255
|
+
});
|
|
1256
|
+
if (placement === "below" && view === "earned" && summary) return /* @__PURE__ */ jsx(EarnedRewards, {
|
|
1257
|
+
...props,
|
|
1258
|
+
summary
|
|
1259
|
+
});
|
|
1260
|
+
return null;
|
|
856
1261
|
}
|
|
857
1262
|
// src/components/Ambassador/storeBadges.tsx
|
|
858
1263
|
function AppStoreBadgeArtFr(props) {
|
|
@@ -1109,6 +1514,58 @@ function PlayStoreBadgeArt({ lang, ...props }) {
|
|
|
1109
1514
|
...props
|
|
1110
1515
|
});
|
|
1111
1516
|
}
|
|
1517
|
+
// src/components/Ambassador/Store.tsx
|
|
1518
|
+
function StoreSection({ lang, installUrl, heading, lede, appBadgeAriaLabel, playBadgeAriaLabel, qrLabel, qrCaption }) {
|
|
1519
|
+
const inert = installUrl === void 0;
|
|
1520
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
1521
|
+
class: `${store} frak-ambassador__store`,
|
|
1522
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1523
|
+
class: `${storeBody} frak-ambassador__store-body`,
|
|
1524
|
+
children: [
|
|
1525
|
+
/* @__PURE__ */ jsx("h2", {
|
|
1526
|
+
class: `${storeTitle} frak-ambassador__store-title`,
|
|
1527
|
+
children: heading
|
|
1528
|
+
}),
|
|
1529
|
+
/* @__PURE__ */ jsx("p", {
|
|
1530
|
+
class: `${storeLede} frak-ambassador__store-lede`,
|
|
1531
|
+
children: lede
|
|
1532
|
+
}),
|
|
1533
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1534
|
+
class: `${storeBadges} frak-ambassador__store-badges`,
|
|
1535
|
+
children: [/* @__PURE__ */ jsx("a", {
|
|
1536
|
+
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--app`,
|
|
1537
|
+
"aria-label": appBadgeAriaLabel,
|
|
1538
|
+
href: installUrl,
|
|
1539
|
+
role: inert ? "link" : void 0,
|
|
1540
|
+
tabIndex: inert ? 0 : void 0,
|
|
1541
|
+
"aria-disabled": inert ? "true" : void 0,
|
|
1542
|
+
children: /* @__PURE__ */ jsx(AppStoreBadgeArt, {
|
|
1543
|
+
lang,
|
|
1544
|
+
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1545
|
+
})
|
|
1546
|
+
}), /* @__PURE__ */ jsx("a", {
|
|
1547
|
+
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--play`,
|
|
1548
|
+
"aria-label": playBadgeAriaLabel,
|
|
1549
|
+
href: installUrl,
|
|
1550
|
+
role: inert ? "link" : void 0,
|
|
1551
|
+
tabIndex: inert ? 0 : void 0,
|
|
1552
|
+
"aria-disabled": inert ? "true" : void 0,
|
|
1553
|
+
children: /* @__PURE__ */ jsx(PlayStoreBadgeArt, {
|
|
1554
|
+
lang,
|
|
1555
|
+
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1556
|
+
})
|
|
1557
|
+
})]
|
|
1558
|
+
})
|
|
1559
|
+
]
|
|
1560
|
+
}), /* @__PURE__ */ jsx(InstallQr, {
|
|
1561
|
+
url: installUrl,
|
|
1562
|
+
label: qrLabel,
|
|
1563
|
+
caption: qrCaption,
|
|
1564
|
+
class: `${storeQr} frak-ambassador__store-qr`,
|
|
1565
|
+
captionClass: `${storeQrCaption} frak-ambassador__store-qr-caption`
|
|
1566
|
+
})]
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1112
1569
|
// src/components/Ambassador/Ambassador.tsx
|
|
1113
1570
|
const FRAK_URL = "https://frak.id";
|
|
1114
1571
|
/**
|
|
@@ -1119,25 +1576,6 @@ const FRAK_URL = "https://frak.id";
|
|
|
1119
1576
|
function resolveBrandName() {
|
|
1120
1577
|
return window.FrakSetup?.config?.metadata?.name || document.querySelector("meta[property=\"og:site_name\"]")?.getAttribute("content") || window.location.hostname.replace(/^www\./, "");
|
|
1121
1578
|
}
|
|
1122
|
-
const FIGURE = /^(\D*?)(\d[\d\s.,\u00A0\u202F]*?)(\D*)$/;
|
|
1123
|
-
/** Draws the currency of a formatted amount smaller; wording without a figure passes through. */
|
|
1124
|
-
function Figure({ amount }) {
|
|
1125
|
-
const parts = FIGURE.exec(amount);
|
|
1126
|
-
if (!parts) return /* @__PURE__ */ jsx("span", {
|
|
1127
|
-
class: `${amountWords} frak-ambassador__amount-words`,
|
|
1128
|
-
children: amount
|
|
1129
|
-
});
|
|
1130
|
-
const [, before, figure, after] = parts;
|
|
1131
|
-
const unit = (text) => text ? /* @__PURE__ */ jsx("small", {
|
|
1132
|
-
class: `${amountUnit} frak-ambassador__amount-unit`,
|
|
1133
|
-
children: text
|
|
1134
|
-
}) : null;
|
|
1135
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1136
|
-
unit(before),
|
|
1137
|
-
figure,
|
|
1138
|
-
unit(after)
|
|
1139
|
-
] });
|
|
1140
|
-
}
|
|
1141
1579
|
function headingText(text) {
|
|
1142
1580
|
return text ? /* @__PURE__ */ jsx("span", {
|
|
1143
1581
|
class: `${rewardHeadingText} frak-ambassador__reward-heading-text`,
|
|
@@ -1225,19 +1663,29 @@ function Ambassador(props) {
|
|
|
1225
1663
|
const dashboard = useGlobalComponents()?.ambassador;
|
|
1226
1664
|
const merged = {
|
|
1227
1665
|
...props,
|
|
1228
|
-
faq5Answer: dashboard?.faq5Answer
|
|
1666
|
+
faq5Answer: dashboard?.faq5Answer,
|
|
1667
|
+
accentColor: dashboard?.accentColor
|
|
1229
1668
|
};
|
|
1230
1669
|
for (const field of DASHBOARD_FIELDS) merged[field] = props[field] ?? dashboard?.[field];
|
|
1231
1670
|
return /* @__PURE__ */ jsx(AmbassadorPage, { ...merged });
|
|
1232
1671
|
}
|
|
1233
|
-
function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle: propHeroTitle, heroEyebrow: propHeroEyebrow, heroLede: propHeroLede, heroCtaLabel: propHeroCtaLabel, heroFacesCaption: propHeroFacesCaption, heroImageUrl, heroImageAlt: propHeroImageAlt, heroRewardCaption: propHeroRewardCaption, heroRewardRefereePill: propHeroRewardRefereePill, rewardEyebrow: propRewardEyebrow, rewardHeading: propRewardHeading, rewardEstimateCaption: propRewardEstimateCaption, rewardLede: propRewardLede, rewardCtaLabel: propRewardCtaLabel, rewardFooterCaption: propRewardFooterCaption, rewardNoBankDetails: propRewardNoBankDetails, rewardFallbackLabel: propRewardFallbackLabel, explainerTitle: propExplainerTitle, explainerLede: propExplainerLede, step1Title: propStep1Title, step1Description: propStep1Description, step1ImageUrl, step1ImageAlt: propStep1ImageAlt, step2Title: propStep2Title, step2Description: propStep2Description, step2ImageUrl, step2ImageAlt: propStep2ImageAlt, step3Title: propStep3Title, step3Description: propStep3Description, step3ImageUrl, step3ImageAlt: propStep3ImageAlt, winWinHeading: propWinWinHeading, winWinLede: propWinWinLede, winWinCard1Title: propWinWinCard1Title, winWinCard1Description: propWinWinCard1Description, winWinCard2Title: propWinWinCard2Title, winWinCard2Description: propWinWinCard2Description, referralHeading: propReferralHeading, referralLede: propReferralLede, referralCtaLabel: propReferralCtaLabel, storeHeading: propStoreHeading, storeLede: propStoreLede, storeAppBadgeAriaLabel: propStoreAppBadgeAriaLabel, storePlayBadgeAriaLabel: propStorePlayBadgeAriaLabel, storeQrLabel: propStoreQrLabel, storeQrCaption: propStoreQrCaption, faqHeading: propFaqHeading, faq1Question: propFaq1Question, faq1Answer: propFaq1Answer, faq2Question: propFaq2Question, faq2Answer: propFaq2Answer, faq3Question: propFaq3Question, faq3Answer: propFaq3Answer, faq4Question: propFaq4Question, faq4Answer: propFaq4Answer, faq5Question: propFaq5Question, faq5AnswerBeforeLink: propFaq5AnswerBeforeLink, faq5AnswerLinkText: propFaq5AnswerLinkText, faq5AnswerAfterLink: propFaq5AnswerAfterLink, attributionBeforeLink: propAttributionBeforeLink, attributionLinkText: propAttributionLinkText, faq5Answer: dashboardFaq5Answer }) {
|
|
1672
|
+
function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle: propHeroTitle, heroEyebrow: propHeroEyebrow, heroLede: propHeroLede, heroCtaLabel: propHeroCtaLabel, heroFacesCaption: propHeroFacesCaption, heroImageUrl, heroImageAlt: propHeroImageAlt, heroRewardCaption: propHeroRewardCaption, heroRewardRefereePill: propHeroRewardRefereePill, rewardEyebrow: propRewardEyebrow, rewardHeading: propRewardHeading, rewardEstimateCaption: propRewardEstimateCaption, rewardLede: propRewardLede, rewardCtaLabel: propRewardCtaLabel, rewardFooterCaption: propRewardFooterCaption, rewardNoBankDetails: propRewardNoBankDetails, rewardFallbackLabel: propRewardFallbackLabel, explainerTitle: propExplainerTitle, explainerLede: propExplainerLede, step1Title: propStep1Title, step1Description: propStep1Description, step1ImageUrl, step1ImageAlt: propStep1ImageAlt, step2Title: propStep2Title, step2Description: propStep2Description, step2ImageUrl, step2ImageAlt: propStep2ImageAlt, step3Title: propStep3Title, step3Description: propStep3Description, step3ImageUrl, step3ImageAlt: propStep3ImageAlt, winWinHeading: propWinWinHeading, winWinLede: propWinWinLede, winWinCard1Title: propWinWinCard1Title, winWinCard1Description: propWinWinCard1Description, winWinCard2Title: propWinWinCard2Title, winWinCard2Description: propWinWinCard2Description, referralHeading: propReferralHeading, referralLede: propReferralLede, referralCtaLabel: propReferralCtaLabel, storeHeading: propStoreHeading, storeLede: propStoreLede, storeAppBadgeAriaLabel: propStoreAppBadgeAriaLabel, storePlayBadgeAriaLabel: propStorePlayBadgeAriaLabel, storeQrLabel: propStoreQrLabel, storeQrCaption: propStoreQrCaption, faqHeading: propFaqHeading, faq1Question: propFaq1Question, faq1Answer: propFaq1Answer, faq2Question: propFaq2Question, faq2Answer: propFaq2Answer, faq3Question: propFaq3Question, faq3Answer: propFaq3Answer, faq4Question: propFaq4Question, faq4Answer: propFaq4Answer, faq5Question: propFaq5Question, faq5AnswerBeforeLink: propFaq5AnswerBeforeLink, faq5AnswerLinkText: propFaq5AnswerLinkText, faq5AnswerAfterLink: propFaq5AnswerAfterLink, attributionBeforeLink: propAttributionBeforeLink, attributionLinkText: propAttributionLinkText, myRewardsEyebrow, myRewardsLinkedHeading, myRewardsClaimCtaLabel, myRewardsShareCtaLabel, myRewardsWalletCtaLabel, myRewardsShareAgainCtaLabel, faq5Answer: dashboardFaq5Answer, accentColor }) {
|
|
1234
1673
|
const { shouldRender, isHidden, isClientReady } = useClientReady();
|
|
1235
1674
|
const lang = useLang();
|
|
1236
1675
|
const rootRef = useRef(null);
|
|
1237
|
-
useHostTheme(rootRef);
|
|
1676
|
+
useHostTheme(rootRef, isHidden ? void 0 : accentColor);
|
|
1238
1677
|
useLightDomStyles("frak-ambassador", void 0, void 0, cssSource, cssSource$2);
|
|
1239
1678
|
const { reward: reward$1 } = useReward(isClientReady, void 0, "referrer");
|
|
1240
1679
|
const { reward: refereeReward, hasReward: hasRefereeReward } = useReward(isClientReady, void 0, "referee");
|
|
1680
|
+
const { summary, claimReward } = useMyRewards(isClientReady);
|
|
1681
|
+
const myRewardsOverrides = {
|
|
1682
|
+
myRewardsEyebrow,
|
|
1683
|
+
myRewardsLinkedHeading,
|
|
1684
|
+
myRewardsClaimCtaLabel,
|
|
1685
|
+
myRewardsShareCtaLabel,
|
|
1686
|
+
myRewardsWalletCtaLabel,
|
|
1687
|
+
myRewardsShareAgainCtaLabel
|
|
1688
|
+
};
|
|
1241
1689
|
const [installUrl, setInstallUrl] = useState(void 0);
|
|
1242
1690
|
const [failedHeroUrl, setFailedHeroUrl] = useState();
|
|
1243
1691
|
useEffect(() => {
|
|
@@ -1265,7 +1713,6 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1265
1713
|
openSharingPage("ambassador");
|
|
1266
1714
|
}, [isClientReady]);
|
|
1267
1715
|
const brand = resolveBrandName();
|
|
1268
|
-
const inert = installUrl === void 0;
|
|
1269
1716
|
const texts = useMemo(() => {
|
|
1270
1717
|
const defaults = componentDefaults[lang].ambassador;
|
|
1271
1718
|
const brandize = (text) => text.replaceAll("{BRAND}", () => brand);
|
|
@@ -1349,7 +1796,7 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1349
1796
|
referralHeading: resolve(propReferralHeading, defaults.referralHeading),
|
|
1350
1797
|
referralLede: resolve(propReferralLede, defaults.referralLede),
|
|
1351
1798
|
referralCtaLabel: resolve(propReferralCtaLabel, defaults.referralCtaLabel),
|
|
1352
|
-
storeHeading: resolve(propStoreHeading, defaults.storeHeading),
|
|
1799
|
+
storeHeading: claimStoreHeading(defaults, propStoreHeading, claimReward, brand) ?? resolve(propStoreHeading, defaults.storeHeading),
|
|
1353
1800
|
storeLede: resolve(propStoreLede, defaults.storeLede),
|
|
1354
1801
|
storeAppBadgeAriaLabel: resolve(propStoreAppBadgeAriaLabel, defaults.storeAppBadgeAriaLabel),
|
|
1355
1802
|
storePlayBadgeAriaLabel: resolve(propStorePlayBadgeAriaLabel, defaults.storePlayBadgeAriaLabel),
|
|
@@ -1375,6 +1822,7 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1375
1822
|
refereeReward,
|
|
1376
1823
|
hasRefereeReward,
|
|
1377
1824
|
brand,
|
|
1825
|
+
claimReward,
|
|
1378
1826
|
propHeroTitle,
|
|
1379
1827
|
propHeroEyebrow,
|
|
1380
1828
|
propHeroLede,
|
|
@@ -1444,11 +1892,26 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1444
1892
|
"frak-ambassador",
|
|
1445
1893
|
classname
|
|
1446
1894
|
].filter(Boolean).join(" ");
|
|
1895
|
+
const myRewardsProps = {
|
|
1896
|
+
summary,
|
|
1897
|
+
lang,
|
|
1898
|
+
brand,
|
|
1899
|
+
overrides: myRewardsOverrides,
|
|
1900
|
+
isClientReady,
|
|
1901
|
+
onShare: handleShare,
|
|
1902
|
+
installUrl,
|
|
1903
|
+
footer: texts.rewardFooterCaption,
|
|
1904
|
+
qrLabel: texts.storeQrLabel
|
|
1905
|
+
};
|
|
1447
1906
|
return /* @__PURE__ */ jsxs("div", {
|
|
1448
1907
|
ref: rootRef,
|
|
1449
1908
|
class: rootClass,
|
|
1450
1909
|
lang,
|
|
1451
1910
|
children: [
|
|
1911
|
+
/* @__PURE__ */ jsx(MyRewardsSlot, {
|
|
1912
|
+
placement: "above",
|
|
1913
|
+
...myRewardsProps
|
|
1914
|
+
}),
|
|
1452
1915
|
/* @__PURE__ */ jsxs("section", {
|
|
1453
1916
|
class: `${hero} frak-ambassador__hero`,
|
|
1454
1917
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1507,6 +1970,10 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1507
1970
|
})]
|
|
1508
1971
|
})]
|
|
1509
1972
|
}),
|
|
1973
|
+
/* @__PURE__ */ jsx(MyRewardsSlot, {
|
|
1974
|
+
placement: "below",
|
|
1975
|
+
...myRewardsProps
|
|
1976
|
+
}),
|
|
1510
1977
|
/* @__PURE__ */ jsxs("section", {
|
|
1511
1978
|
class: `${reward} frak-ambassador__reward`,
|
|
1512
1979
|
children: [
|
|
@@ -1637,53 +2104,15 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1637
2104
|
})
|
|
1638
2105
|
]
|
|
1639
2106
|
}),
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
/* @__PURE__ */ jsx("p", {
|
|
1650
|
-
class: `${storeLede} frak-ambassador__store-lede`,
|
|
1651
|
-
children: texts.storeLede
|
|
1652
|
-
}),
|
|
1653
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1654
|
-
class: `${storeBadges} frak-ambassador__store-badges`,
|
|
1655
|
-
children: [/* @__PURE__ */ jsx("a", {
|
|
1656
|
-
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--app`,
|
|
1657
|
-
"aria-label": texts.storeAppBadgeAriaLabel,
|
|
1658
|
-
href: installUrl,
|
|
1659
|
-
role: inert ? "link" : void 0,
|
|
1660
|
-
tabIndex: inert ? 0 : void 0,
|
|
1661
|
-
"aria-disabled": inert ? "true" : void 0,
|
|
1662
|
-
children: /* @__PURE__ */ jsx(AppStoreBadgeArt, {
|
|
1663
|
-
lang,
|
|
1664
|
-
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1665
|
-
})
|
|
1666
|
-
}), /* @__PURE__ */ jsx("a", {
|
|
1667
|
-
class: `${storeBadge} frak-ambassador__store-badge frak-ambassador__store-badge--play`,
|
|
1668
|
-
"aria-label": texts.storePlayBadgeAriaLabel,
|
|
1669
|
-
href: installUrl,
|
|
1670
|
-
role: inert ? "link" : void 0,
|
|
1671
|
-
tabIndex: inert ? 0 : void 0,
|
|
1672
|
-
"aria-disabled": inert ? "true" : void 0,
|
|
1673
|
-
children: /* @__PURE__ */ jsx(PlayStoreBadgeArt, {
|
|
1674
|
-
lang,
|
|
1675
|
-
class: `${storeBadgeArt} frak-ambassador__store-badge-art`
|
|
1676
|
-
})
|
|
1677
|
-
})]
|
|
1678
|
-
})
|
|
1679
|
-
]
|
|
1680
|
-
}), /* @__PURE__ */ jsx(InstallQr, {
|
|
1681
|
-
url: installUrl,
|
|
1682
|
-
label: texts.storeQrLabel,
|
|
1683
|
-
caption: texts.storeQrCaption,
|
|
1684
|
-
class: `${storeQr} frak-ambassador__store-qr`,
|
|
1685
|
-
captionClass: `${storeQrCaption} frak-ambassador__store-qr-caption`
|
|
1686
|
-
})]
|
|
2107
|
+
summary?.linked ? null : /* @__PURE__ */ jsx(StoreSection, {
|
|
2108
|
+
lang,
|
|
2109
|
+
installUrl,
|
|
2110
|
+
heading: texts.storeHeading,
|
|
2111
|
+
lede: texts.storeLede,
|
|
2112
|
+
appBadgeAriaLabel: texts.storeAppBadgeAriaLabel,
|
|
2113
|
+
playBadgeAriaLabel: texts.storePlayBadgeAriaLabel,
|
|
2114
|
+
qrLabel: texts.storeQrLabel,
|
|
2115
|
+
qrCaption: texts.storeQrCaption
|
|
1687
2116
|
}),
|
|
1688
2117
|
/* @__PURE__ */ jsxs("section", {
|
|
1689
2118
|
class: `${faq} frak-ambassador__faq`,
|
|
@@ -1713,7 +2142,7 @@ function AmbassadorPage({ merchantId: propMerchantId, classname = "", heroTitle:
|
|
|
1713
2142
|
children: texts.faq5Answer ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1714
2143
|
texts.faq5AnswerBeforeLink,
|
|
1715
2144
|
/* @__PURE__ */ jsx("a", {
|
|
1716
|
-
class: `
|
|
2145
|
+
class: `Ambassador_frakLink__awpcg01p frak-ambassador__faq-answer-link frak-link`,
|
|
1717
2146
|
href: FRAK_URL,
|
|
1718
2147
|
target: "_blank",
|
|
1719
2148
|
rel: "noopener",
|
|
@@ -1802,6 +2231,12 @@ registerWebComponent(Ambassador, "frak-ambassador", [...[
|
|
|
1802
2231
|
"faq5AnswerLinkText",
|
|
1803
2232
|
"faq5AnswerAfterLink",
|
|
1804
2233
|
"attributionBeforeLink",
|
|
1805
|
-
"attributionLinkText"
|
|
2234
|
+
"attributionLinkText",
|
|
2235
|
+
"myRewardsEyebrow",
|
|
2236
|
+
"myRewardsLinkedHeading",
|
|
2237
|
+
"myRewardsClaimCtaLabel",
|
|
2238
|
+
"myRewardsShareCtaLabel",
|
|
2239
|
+
"myRewardsWalletCtaLabel",
|
|
2240
|
+
"myRewardsShareAgainCtaLabel"
|
|
1806
2241
|
]], { shadow: false });
|
|
1807
2242
|
export { Ambassador };
|