@frak-labs/components 1.3.0 → 1.3.1-beta.98f81202
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/README.md +1 -1
- package/cdn/Ambassador.CRPtw_VT.js +392 -0
- package/cdn/Banner.gDEO8VKX.js +208 -0
- package/cdn/{ButtonShare.CgF4rWEO.js → ButtonShare.OuDvPMdk.js} +1 -1
- package/cdn/ButtonWallet.DNE6ZhkT.js +40 -0
- package/cdn/GiftIcon.NTATj1WE.js +1 -0
- package/cdn/OpenInAppButton.Dv7oAwl1.js +1 -0
- package/cdn/PostPurchase.Co0QSBMO.js +102 -0
- package/cdn/components.js +1 -1
- package/cdn/{jsxRuntime.module.CgbYebLx.js → jsxRuntime.module.C5UTjP_H.js} +1 -1
- package/cdn/loader.js +58 -36
- package/cdn/qr.vkJgq9pN.js +5 -0
- package/cdn/replay-V6FXES7X.CgBxdfNp.js +1 -0
- package/cdn/rewards.COyZ6-7W.js +1 -0
- package/cdn/useGlobalComponents.DoG1wfeq.js +1 -0
- package/cdn/{useLightDomStyles.CkTNHin8.js → useLightDomStyles.B0_CS0Kq.js} +1 -1
- package/cdn/{usePlacement.b__OilKu.js → usePlacement.B5JX9OU-.js} +1 -1
- package/cdn/{useReward.Duy0EWvi.js → useReward.By-xuybY.js} +1 -1
- package/dist/{GiftIcon-DNqgjTjb.js → GiftIcon-JVhSFEhP.js} +0 -1
- package/dist/ambassador.js +239 -104
- package/dist/banner.js +84 -59
- package/dist/postPurchase.js +43 -30
- package/dist/sharedBaseCss.css-BkMpQeRx.js +5 -0
- package/package.json +5 -4
- package/cdn/Ambassador.LCnsy5iT.js +0 -320
- package/cdn/Banner.BnzLkajr.js +0 -183
- package/cdn/ButtonWallet.JbMXw9dW.js +0 -40
- package/cdn/GiftIcon.Be-UU58r.js +0 -1
- package/cdn/OpenInAppButton.BaRZ25xH.js +0 -1
- package/cdn/PostPurchase.c3eqzVRl.js +0 -89
- package/cdn/qr.Bdg4-2EI.js +0 -5
- package/cdn/replay-V6FXES7X.efKsNT6s.js +0 -1
- package/cdn/rewards.B_p05JY_.js +0 -1
- package/cdn/useGlobalComponents.da05dAlQ.js +0 -1
- package/dist/sharedBaseCss.css-ChRUA1zY.js +0 -5
package/dist/ambassador.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t as useGlobalComponents } from "./useGlobalComponents-B3s2UQFk.js";
|
|
|
4
4
|
import { t as useLightDomStyles } from "./useLightDomStyles-BQ5FvCPi.js";
|
|
5
5
|
import { t as useReward } from "./useReward-DEhiMfgl.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
|
-
import { t as cssSource$2 } from "./sharedBaseCss.css-
|
|
7
|
+
import { t as cssSource$2 } from "./sharedBaseCss.css-BkMpQeRx.js";
|
|
8
8
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
9
9
|
import { getInstallUrl } from "@frak-labs/core-sdk/actions";
|
|
10
10
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
@@ -13,6 +13,12 @@ import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
|
13
13
|
const QUIET_BORDER_DISTANCE = 120;
|
|
14
14
|
const FLAT_FILL_DISTANCE = 30;
|
|
15
15
|
const READABLE_CONTRAST = 3;
|
|
16
|
+
const VISIBLE_CONTRAST = 1.5;
|
|
17
|
+
const VISIBLE_DISTANCE = 60;
|
|
18
|
+
const DEFAULT_ACCENT = "rgb(17, 17, 17)";
|
|
19
|
+
const DEFAULT_TAG_BG = "rgb(255, 255, 255)";
|
|
20
|
+
const TAG_TINT = .08;
|
|
21
|
+
const RESET_HEADING_RATIO = 1.25;
|
|
16
22
|
const WIDGET_WORDS = /cookie|consent|newsletter|popup|modal|sr-only|visually-hidden|skip-to/i;
|
|
17
23
|
const CHROME = "header,nav,[role=banner]";
|
|
18
24
|
const LOGO_HINT = /logo|brand|site-title|wordmark/i;
|
|
@@ -22,6 +28,14 @@ const CLIPPING_OVERFLOW = /* @__PURE__ */ new Set([
|
|
|
22
28
|
"auto",
|
|
23
29
|
"scroll"
|
|
24
30
|
]);
|
|
31
|
+
const FONT_ATTRIBUTE = "data-frak-amb-font";
|
|
32
|
+
const FONT_KNOBS = [
|
|
33
|
+
"h1-family",
|
|
34
|
+
"h1-transform",
|
|
35
|
+
"h2-family",
|
|
36
|
+
"h2-transform"
|
|
37
|
+
];
|
|
38
|
+
const REFERENCE_HEADINGS = "[data-frak-amb-ref]";
|
|
25
39
|
function alphaOf(value) {
|
|
26
40
|
const slash = /\/\s*([\d.]+)(%?)\s*\)/.exec(value);
|
|
27
41
|
if (slash) return Number(slash[1]) / (slash[2] ? 100 : 1);
|
|
@@ -101,6 +115,7 @@ function isOverlayBox(el) {
|
|
|
101
115
|
}
|
|
102
116
|
function insideWidget(el) {
|
|
103
117
|
if (inSignupForm(el)) return true;
|
|
118
|
+
if (el.closest("form[action*=\"/localization\"]")) return true;
|
|
104
119
|
const cart = inCartForm(el);
|
|
105
120
|
let node = el;
|
|
106
121
|
while (node && node !== document.body) {
|
|
@@ -179,6 +194,8 @@ function isContentHeading(el) {
|
|
|
179
194
|
}
|
|
180
195
|
function hostElement(page, selector) {
|
|
181
196
|
const theirs = Array.from(document.querySelectorAll(selector)).filter((el) => !page.contains(el));
|
|
197
|
+
const reference = theirs.find((el) => el.closest(REFERENCE_HEADINGS));
|
|
198
|
+
if (reference) return reference;
|
|
182
199
|
return theirs.filter((el) => el.offsetHeight > 0).find(isContentHeading) ?? theirs.find(isContentHeading);
|
|
183
200
|
}
|
|
184
201
|
const MAX_SIZE = {
|
|
@@ -198,11 +215,26 @@ function typographyOf(el, role, backdrop, withColour) {
|
|
|
198
215
|
if (withColour && readable) knobs.push([`${role}-color`, s.color]);
|
|
199
216
|
return knobs;
|
|
200
217
|
}
|
|
218
|
+
function headingKnobs(el, role, source) {
|
|
219
|
+
if (!el) return [];
|
|
220
|
+
const s = getComputedStyle(el);
|
|
221
|
+
const knobs = [
|
|
222
|
+
...typographyOf(el, role, source.backdrop, true),
|
|
223
|
+
[`${role}-family`, s.fontFamily],
|
|
224
|
+
[`${role}-transform`, s.textTransform]
|
|
225
|
+
];
|
|
226
|
+
const bodySize = Number.parseFloat(source.bodySize);
|
|
227
|
+
return role === "h1" && Number.parseFloat(s.fontSize) <= RESET_HEADING_RATIO * bodySize ? knobs.filter(([name]) => name !== "h1-size") : knobs;
|
|
228
|
+
}
|
|
201
229
|
function sampleTheme(page) {
|
|
202
230
|
const pageBg = pageBackground();
|
|
203
231
|
const button = findPrimaryButton(page);
|
|
232
|
+
const backdrop = backdropOf(page);
|
|
233
|
+
const ours = getComputedStyle(page);
|
|
204
234
|
return {
|
|
205
|
-
backdrop
|
|
235
|
+
backdrop,
|
|
236
|
+
text: composite(ours.color, backdrop),
|
|
237
|
+
bodySize: ours.fontSize,
|
|
206
238
|
buttonBg: button ? getComputedStyle(button).backgroundColor : pageBg,
|
|
207
239
|
h1: hostElement(page, "h1"),
|
|
208
240
|
h2: hostElement(page, "h2"),
|
|
@@ -210,17 +242,33 @@ function sampleTheme(page) {
|
|
|
210
242
|
radius: sampleCardRadius(page)
|
|
211
243
|
};
|
|
212
244
|
}
|
|
245
|
+
function accentKnobs(source) {
|
|
246
|
+
const from = source.button ? getComputedStyle(source.button) : void 0;
|
|
247
|
+
const fill = composite(from?.backgroundColor ?? DEFAULT_ACCENT, source.backdrop);
|
|
248
|
+
const contrast = contrastRatio(fill, source.backdrop);
|
|
249
|
+
if (contrast < VISIBLE_CONTRAST && colourDistance(fill, source.backdrop) <= VISIBLE_DISTANCE) return [["accent", source.text], ["accent-ink", source.backdrop]];
|
|
250
|
+
if (!from) return [];
|
|
251
|
+
const knobs = [["accent", from.backgroundColor], ["accent-ink", from.color]];
|
|
252
|
+
if (!(contrast >= READABLE_CONTRAST)) knobs.push(["accent-text", "currentColor"]);
|
|
253
|
+
return knobs;
|
|
254
|
+
}
|
|
255
|
+
/** The tag keeps our inherited text colour, so light text needs a dark tag. */
|
|
256
|
+
function tagKnobs(source) {
|
|
257
|
+
if (!(contrastRatio(source.text, DEFAULT_TAG_BG) < READABLE_CONTRAST)) return [];
|
|
258
|
+
const [r, g, b] = rgbOf(source.text);
|
|
259
|
+
return [["tag-bg", composite(`rgba(${r}, ${g}, ${b}, ${TAG_TINT})`, source.backdrop)]];
|
|
260
|
+
}
|
|
213
261
|
function knobsFrom(source) {
|
|
214
262
|
const knobs = [
|
|
215
|
-
...
|
|
216
|
-
...
|
|
263
|
+
...headingKnobs(source.h1, "h1", source),
|
|
264
|
+
...headingKnobs(source.h2, "h2", source),
|
|
217
265
|
...typographyOf(source.button, "cta", source.buttonBg, false)
|
|
218
266
|
];
|
|
219
267
|
if (source.radius) knobs.push(["radius", source.radius]);
|
|
268
|
+
knobs.push(...accentKnobs(source), ...tagKnobs(source));
|
|
220
269
|
if (source.button) {
|
|
221
270
|
const from = getComputedStyle(source.button);
|
|
222
|
-
knobs.push(["
|
|
223
|
-
if (!(contrastRatio(composite(from.backgroundColor, source.backdrop), source.backdrop) >= READABLE_CONTRAST)) knobs.push(["accent-text", "currentColor"]);
|
|
271
|
+
knobs.push(["cta-radius", from.borderRadius.split(" ")[0]], ["cta-transform", from.textTransform]);
|
|
224
272
|
}
|
|
225
273
|
return knobs;
|
|
226
274
|
}
|
|
@@ -236,6 +284,17 @@ function writeKnobs(anchor, knobs) {
|
|
|
236
284
|
if (name === "accent-text" && merchantSet.has("accent")) continue;
|
|
237
285
|
anchor.style.setProperty(`--frak-amb-${name}`, value);
|
|
238
286
|
}
|
|
287
|
+
markFontKnobs(anchor);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Heading font rules apply only behind this attribute: an unset `var()` in
|
|
291
|
+
* `font-family` computes to `inherit` and would beat the theme's `h1 {}` rule.
|
|
292
|
+
*/
|
|
293
|
+
function markFontKnobs(anchor) {
|
|
294
|
+
const resolved = getComputedStyle(anchor);
|
|
295
|
+
const present = FONT_KNOBS.filter((name) => resolved.getPropertyValue(`--frak-amb-${name}`).trim());
|
|
296
|
+
if (present.length) anchor.setAttribute(FONT_ATTRIBUTE, present.join(" "));
|
|
297
|
+
else anchor.removeAttribute(FONT_ATTRIBUTE);
|
|
239
298
|
}
|
|
240
299
|
function nextFrame() {
|
|
241
300
|
return new Promise((resolve) => {
|
|
@@ -272,325 +331,397 @@ function useHostTheme(target) {
|
|
|
272
331
|
//#endregion
|
|
273
332
|
//#region \0ve-inline:src/components/Ambassador/Ambassador.css.ts.vanilla.js
|
|
274
333
|
const cssSource$1 = `.Ambassador_panel__awpcg00 {
|
|
275
|
-
background-color: var(--frak-amb-surface,
|
|
276
|
-
border: 1px solid var(--frak-amb-border,
|
|
334
|
+
background-color: var(--frak-amb-surface, #1111110a);
|
|
335
|
+
border: 1px solid var(--frak-amb-border, #11111126);
|
|
277
336
|
border-radius: var(--frak-amb-radius, 12px);
|
|
278
337
|
}
|
|
338
|
+
|
|
279
339
|
.Ambassador_root__awpcg01 {
|
|
280
|
-
|
|
340
|
+
text-align: start;
|
|
341
|
+
box-sizing: border-box;
|
|
281
342
|
flex-direction: column;
|
|
282
343
|
gap: clamp(3em, 7vw, 5.5em);
|
|
283
344
|
width: 100%;
|
|
284
345
|
max-width: 100%;
|
|
285
|
-
|
|
346
|
+
display: flex;
|
|
286
347
|
}
|
|
348
|
+
|
|
287
349
|
.Ambassador_ctaButton__awpcg02 {
|
|
288
|
-
display: inline-flex;
|
|
289
|
-
align-items: center;
|
|
290
|
-
justify-content: center;
|
|
291
|
-
padding: 0.95em 2em;
|
|
292
350
|
border-radius: var(--frak-amb-cta-radius, 999px);
|
|
293
351
|
background-color: var(--frak-amb-cta-bg, var(--frak-amb-accent, #111));
|
|
294
352
|
color: var(--frak-amb-accent-ink, #fff);
|
|
295
|
-
font-size: var(--frak-amb-cta-size,
|
|
353
|
+
font-size: var(--frak-amb-cta-size, .9em);
|
|
296
354
|
font-weight: var(--frak-amb-cta-weight, 700);
|
|
297
|
-
letter-spacing: var(--frak-amb-cta-spacing,
|
|
355
|
+
letter-spacing: var(--frak-amb-cta-spacing, .06em);
|
|
298
356
|
text-transform: var(--frak-amb-cta-transform, uppercase);
|
|
299
|
-
text-decoration: none;
|
|
300
357
|
cursor: pointer;
|
|
358
|
+
justify-content: center;
|
|
359
|
+
align-items: center;
|
|
360
|
+
padding: .95em 2em;
|
|
361
|
+
text-decoration: none;
|
|
362
|
+
display: inline-flex;
|
|
301
363
|
}
|
|
364
|
+
|
|
302
365
|
.Ambassador_ctaButton__awpcg02:hover {
|
|
303
|
-
opacity:
|
|
366
|
+
opacity: .85;
|
|
304
367
|
}
|
|
368
|
+
|
|
305
369
|
.Ambassador_ctaButton__awpcg02:disabled {
|
|
306
|
-
opacity:
|
|
370
|
+
opacity: .5;
|
|
307
371
|
cursor: default;
|
|
308
372
|
}
|
|
373
|
+
|
|
309
374
|
.Ambassador_ctaButton__awpcg02:focus-visible {
|
|
310
375
|
outline-color: #000;
|
|
311
376
|
box-shadow: 0 0 0 2px #fff;
|
|
312
377
|
}
|
|
378
|
+
|
|
313
379
|
.Ambassador_region__awpcg03 {
|
|
314
|
-
display: grid;
|
|
315
|
-
gap: 0.85em;
|
|
316
380
|
align-content: start;
|
|
381
|
+
gap: .85em;
|
|
317
382
|
min-width: 0;
|
|
318
383
|
margin: 0;
|
|
384
|
+
display: grid;
|
|
319
385
|
}
|
|
386
|
+
|
|
320
387
|
.Ambassador_centeredRegion__awpcg04 {
|
|
321
|
-
justify-items: center;
|
|
322
388
|
text-align: center;
|
|
389
|
+
justify-items: center;
|
|
323
390
|
}
|
|
391
|
+
|
|
324
392
|
.Ambassador_regionTitle__awpcg05 {
|
|
325
|
-
margin: 0;
|
|
326
393
|
font-size: var(--frak-amb-h2-size, clamp(1.4em, 2.6vw, 2em));
|
|
327
394
|
line-height: 1.2;
|
|
328
395
|
font-weight: var(--frak-amb-h2-weight, inherit);
|
|
329
396
|
letter-spacing: var(--frak-amb-h2-spacing, normal);
|
|
330
397
|
color: var(--frak-amb-h2-color, inherit);
|
|
398
|
+
margin: 0;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
[data-frak-amb-font~="h2-family"] .Ambassador_regionTitle__awpcg05 {
|
|
402
|
+
font-family: var(--frak-amb-h2-family);
|
|
331
403
|
}
|
|
404
|
+
|
|
405
|
+
[data-frak-amb-font~="h2-transform"] .Ambassador_regionTitle__awpcg05 {
|
|
406
|
+
text-transform: var(--frak-amb-h2-transform);
|
|
407
|
+
}
|
|
408
|
+
|
|
332
409
|
.Ambassador_lede__awpcg06 {
|
|
333
|
-
|
|
410
|
+
opacity: .75;
|
|
334
411
|
max-width: 52ch;
|
|
335
|
-
|
|
412
|
+
margin: 0;
|
|
336
413
|
}
|
|
414
|
+
|
|
337
415
|
.Ambassador_mutedSmall__awpcg07 {
|
|
416
|
+
opacity: .7;
|
|
338
417
|
margin: 0;
|
|
339
|
-
font-size:
|
|
340
|
-
opacity: 0.7;
|
|
418
|
+
font-size: .85em;
|
|
341
419
|
}
|
|
420
|
+
|
|
342
421
|
.Ambassador_muted__awpcg08 {
|
|
422
|
+
opacity: .7;
|
|
343
423
|
margin: 0;
|
|
344
|
-
opacity: 0.7;
|
|
345
424
|
}
|
|
425
|
+
|
|
346
426
|
.Ambassador_card__awpcg09 {
|
|
347
|
-
display: grid;
|
|
348
|
-
gap: 0.5em;
|
|
349
427
|
align-content: start;
|
|
428
|
+
gap: .5em;
|
|
350
429
|
padding: 1.4em;
|
|
430
|
+
display: grid;
|
|
351
431
|
}
|
|
432
|
+
|
|
352
433
|
.Ambassador_amountUnit__awpcg0a {
|
|
353
|
-
font-size: 0.32em;
|
|
354
|
-
font-weight: 700;
|
|
355
434
|
letter-spacing: normal;
|
|
435
|
+
font-size: .32em;
|
|
436
|
+
font-weight: 700;
|
|
356
437
|
}
|
|
438
|
+
|
|
357
439
|
.Ambassador_amountWords__awpcg0b {
|
|
358
|
-
|
|
359
|
-
font-size:
|
|
440
|
+
letter-spacing: -.02em;
|
|
441
|
+
font-size: .45em;
|
|
360
442
|
line-height: 1.1;
|
|
361
|
-
|
|
443
|
+
display: inline-block;
|
|
362
444
|
}
|
|
445
|
+
|
|
363
446
|
.Ambassador_bigFigure__awpcg0c {
|
|
364
|
-
|
|
365
|
-
line-height: 0.85;
|
|
366
|
-
letter-spacing: -0.04em;
|
|
447
|
+
letter-spacing: -.04em;
|
|
367
448
|
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
449
|
+
font-weight: 800;
|
|
450
|
+
line-height: .85;
|
|
368
451
|
}
|
|
452
|
+
|
|
369
453
|
.Ambassador_hero__awpcg0d {
|
|
370
|
-
gap: 2.5em;
|
|
371
454
|
grid-template-columns: repeat(auto-fit, minmax(min(18em, 100%), 1fr));
|
|
372
455
|
align-items: center;
|
|
456
|
+
gap: 2.5em;
|
|
373
457
|
}
|
|
458
|
+
|
|
374
459
|
.Ambassador_heroBody__awpcg0e {
|
|
375
|
-
display: grid;
|
|
376
|
-
gap: 1em;
|
|
377
460
|
align-content: start;
|
|
378
461
|
justify-items: start;
|
|
462
|
+
gap: 1em;
|
|
379
463
|
min-width: 0;
|
|
464
|
+
display: grid;
|
|
380
465
|
}
|
|
466
|
+
|
|
381
467
|
.Ambassador_heroTitle__awpcg0f {
|
|
382
|
-
margin: 0;
|
|
383
468
|
font-size: var(--frak-amb-h1-size, clamp(2em, 4.6vw, 3.2em));
|
|
384
469
|
line-height: 1.1;
|
|
385
470
|
font-weight: var(--frak-amb-h1-weight, inherit);
|
|
386
471
|
letter-spacing: var(--frak-amb-h1-spacing, normal);
|
|
387
472
|
color: var(--frak-amb-h1-color, inherit);
|
|
473
|
+
margin: 0;
|
|
388
474
|
}
|
|
475
|
+
|
|
476
|
+
[data-frak-amb-font~="h1-family"] .Ambassador_heroTitle__awpcg0f {
|
|
477
|
+
font-family: var(--frak-amb-h1-family);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
[data-frak-amb-font~="h1-transform"] .Ambassador_heroTitle__awpcg0f {
|
|
481
|
+
text-transform: var(--frak-amb-h1-transform);
|
|
482
|
+
}
|
|
483
|
+
|
|
389
484
|
.Ambassador_heroArt__awpcg0g {
|
|
390
|
-
|
|
391
|
-
display: grid;
|
|
485
|
+
background: var(--frak-amb-image, none) center/cover;
|
|
392
486
|
place-items: center;
|
|
393
487
|
padding: 1em;
|
|
394
|
-
|
|
488
|
+
display: grid;
|
|
489
|
+
position: relative;
|
|
395
490
|
}
|
|
491
|
+
|
|
396
492
|
.Ambassador_heroArtFramed__awpcg0h {
|
|
397
493
|
aspect-ratio: 4 / 5;
|
|
398
494
|
align-content: end;
|
|
399
495
|
}
|
|
496
|
+
|
|
400
497
|
.Ambassador_heroImage__awpcg0i {
|
|
498
|
+
object-fit: cover;
|
|
401
499
|
position: absolute;
|
|
402
500
|
inset: 0;
|
|
403
|
-
|
|
501
|
+
border-radius: var(--frak-amb-radius, 12px) !important;
|
|
502
|
+
border: 0 !important;
|
|
404
503
|
width: 100% !important;
|
|
405
|
-
height: 100% !important;
|
|
406
504
|
max-width: none !important;
|
|
505
|
+
height: 100% !important;
|
|
407
506
|
margin: 0 !important;
|
|
408
|
-
border: 0 !important;
|
|
409
|
-
border-radius: var(--frak-amb-radius, 12px) !important;
|
|
410
507
|
}
|
|
508
|
+
|
|
411
509
|
.Ambassador_heroTag__awpcg0j {
|
|
412
|
-
position: relative;
|
|
413
|
-
display: flex;
|
|
414
|
-
flex-wrap: wrap;
|
|
415
|
-
align-items: center;
|
|
416
|
-
gap: 0.75em;
|
|
417
510
|
box-sizing: border-box;
|
|
418
|
-
width: 100%;
|
|
419
|
-
padding: 0.9em 1em;
|
|
420
511
|
border-radius: var(--frak-amb-radius, 12px);
|
|
421
512
|
background-color: var(--frak-amb-tag-bg, #fff);
|
|
422
513
|
text-align: start;
|
|
514
|
+
flex-wrap: wrap;
|
|
515
|
+
align-items: center;
|
|
516
|
+
gap: .75em;
|
|
517
|
+
width: 100%;
|
|
518
|
+
padding: .9em 1em;
|
|
519
|
+
display: flex;
|
|
520
|
+
position: relative;
|
|
423
521
|
}
|
|
522
|
+
|
|
424
523
|
.Ambassador_heroTagMain__awpcg0k {
|
|
425
524
|
display: grid;
|
|
426
525
|
}
|
|
526
|
+
|
|
427
527
|
.Ambassador_heroAmount__awpcg0l {
|
|
528
|
+
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
428
529
|
font-size: 1.4em;
|
|
429
530
|
line-height: 1.1;
|
|
430
|
-
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
431
531
|
}
|
|
532
|
+
|
|
432
533
|
.Ambassador_heroRewardCaption__awpcg0m {
|
|
433
|
-
|
|
434
|
-
|
|
534
|
+
opacity: .7;
|
|
535
|
+
font-size: .8em;
|
|
435
536
|
}
|
|
537
|
+
|
|
436
538
|
.Ambassador_heroPill__awpcg0n {
|
|
437
|
-
margin-inline-start: auto;
|
|
438
|
-
padding: 0.45em 0.8em;
|
|
439
539
|
border-radius: var(--frak-amb-cta-radius, 999px);
|
|
440
540
|
background-color: var(--frak-amb-accent, #111);
|
|
441
541
|
color: var(--frak-amb-accent-ink, #fff);
|
|
442
|
-
|
|
542
|
+
letter-spacing: .04em;
|
|
543
|
+
margin-inline-start: auto;
|
|
544
|
+
padding: .45em .8em;
|
|
545
|
+
font-size: .72em;
|
|
443
546
|
font-weight: 700;
|
|
444
|
-
letter-spacing: 0.04em;
|
|
445
547
|
}
|
|
548
|
+
|
|
446
549
|
.Ambassador_rewardHeading__awpcg0o {
|
|
447
550
|
font-size: 1em;
|
|
448
551
|
}
|
|
552
|
+
|
|
449
553
|
.Ambassador_rewardHeadingText__awpcg0p {
|
|
450
554
|
font-size: var(--frak-amb-h2-size, clamp(1.4em, 2.6vw, 2em));
|
|
451
555
|
}
|
|
556
|
+
|
|
452
557
|
.Ambassador_rewardAmount__awpcg0q {
|
|
453
|
-
|
|
454
|
-
margin-block-end: 0.12em;
|
|
558
|
+
margin-block-end: .12em;
|
|
455
559
|
font-size: clamp(3.5em, 14vw, 7em);
|
|
560
|
+
display: block;
|
|
456
561
|
}
|
|
562
|
+
|
|
457
563
|
.Ambassador_stepsGrid__awpcg0r {
|
|
458
|
-
display: grid;
|
|
459
|
-
gap: 1.25em;
|
|
460
564
|
grid-template-columns: repeat(auto-fit, minmax(min(15em, 100%), 1fr));
|
|
565
|
+
gap: 1.25em;
|
|
566
|
+
display: grid;
|
|
461
567
|
}
|
|
568
|
+
|
|
462
569
|
.Ambassador_stepNumber__awpcg0s {
|
|
463
|
-
display: grid;
|
|
464
|
-
place-items: center;
|
|
465
|
-
inline-size: 1.9em;
|
|
466
|
-
block-size: 1.9em;
|
|
467
|
-
margin: 0;
|
|
468
570
|
border-radius: var(--frak-amb-cta-radius, 999px);
|
|
469
571
|
background-color: var(--frak-amb-accent, #111);
|
|
572
|
+
block-size: 1.9em;
|
|
573
|
+
inline-size: 1.9em;
|
|
470
574
|
color: var(--frak-amb-accent-ink, #fff);
|
|
471
|
-
|
|
575
|
+
place-items: center;
|
|
576
|
+
margin: 0;
|
|
577
|
+
font-size: .9em;
|
|
472
578
|
font-weight: 700;
|
|
579
|
+
display: grid;
|
|
473
580
|
}
|
|
581
|
+
|
|
474
582
|
.Ambassador_stepIcon__awpcg0t {
|
|
583
|
+
object-fit: contain;
|
|
475
584
|
width: 40px;
|
|
476
585
|
height: 40px;
|
|
477
|
-
object-fit: contain;
|
|
478
586
|
}
|
|
587
|
+
|
|
479
588
|
.Ambassador_stepTitle__awpcg0u {
|
|
480
589
|
margin: 0;
|
|
481
590
|
font-size: 1.05em;
|
|
482
591
|
line-height: 1.3;
|
|
483
592
|
}
|
|
593
|
+
|
|
484
594
|
.Ambassador_winWinCards__awpcg0v {
|
|
485
|
-
display: grid;
|
|
486
|
-
gap: 1.25em;
|
|
487
595
|
grid-template-columns: repeat(auto-fit, minmax(min(15em, 100%), 1fr));
|
|
596
|
+
gap: 1.25em;
|
|
488
597
|
width: 100%;
|
|
489
598
|
max-width: 40em;
|
|
599
|
+
display: grid;
|
|
490
600
|
}
|
|
601
|
+
|
|
491
602
|
.Ambassador_winWinCard__awpcg0w {
|
|
492
|
-
justify-items: center;
|
|
493
603
|
text-align: center;
|
|
604
|
+
justify-items: center;
|
|
494
605
|
}
|
|
606
|
+
|
|
495
607
|
.Ambassador_winWinCardAmount__awpcg0x {
|
|
496
608
|
margin: 0;
|
|
497
609
|
font-size: clamp(2em, 6vw, 3em);
|
|
498
610
|
}
|
|
611
|
+
|
|
499
612
|
.Ambassador_referralCta__awpcg0y {
|
|
500
613
|
justify-self: start;
|
|
501
614
|
}
|
|
615
|
+
|
|
502
616
|
.Ambassador_store__awpcg0z {
|
|
503
|
-
display: grid;
|
|
504
|
-
gap: 1.75em;
|
|
505
617
|
grid-template-columns: repeat(auto-fit, minmax(min(14em, 100%), 1fr));
|
|
506
618
|
align-items: center;
|
|
619
|
+
gap: 1.75em;
|
|
507
620
|
padding: 1.75em;
|
|
621
|
+
display: grid;
|
|
508
622
|
}
|
|
623
|
+
|
|
509
624
|
.Ambassador_storeBody__awpcg010 {
|
|
510
|
-
display: grid;
|
|
511
|
-
gap: 0.75em;
|
|
512
625
|
align-content: start;
|
|
626
|
+
gap: .75em;
|
|
513
627
|
min-width: 0;
|
|
628
|
+
display: grid;
|
|
514
629
|
}
|
|
630
|
+
|
|
515
631
|
.Ambassador_storeQr__awpcg011 {
|
|
516
|
-
|
|
632
|
+
text-align: center;
|
|
517
633
|
justify-items: center;
|
|
518
|
-
gap:
|
|
634
|
+
gap: .5em;
|
|
519
635
|
margin: 0;
|
|
520
|
-
|
|
636
|
+
display: grid;
|
|
521
637
|
}
|
|
638
|
+
|
|
522
639
|
.Ambassador_storeBadges__awpcg012 {
|
|
523
|
-
display: flex;
|
|
524
640
|
flex-wrap: wrap;
|
|
525
641
|
align-items: center;
|
|
526
|
-
gap:
|
|
642
|
+
gap: .75em;
|
|
643
|
+
display: flex;
|
|
527
644
|
}
|
|
645
|
+
|
|
528
646
|
.Ambassador_storeBadge__awpcg013 {
|
|
529
|
-
|
|
647
|
+
border-radius: 8px;
|
|
530
648
|
align-items: center;
|
|
649
|
+
line-height: 0;
|
|
531
650
|
text-decoration: none;
|
|
532
|
-
|
|
533
|
-
color: #fff !important;
|
|
534
|
-
border-radius: 8px;
|
|
651
|
+
display: inline-flex;
|
|
535
652
|
overflow: hidden;
|
|
536
|
-
|
|
653
|
+
color: #fff !important;
|
|
654
|
+
background-color: #000 !important;
|
|
537
655
|
}
|
|
656
|
+
|
|
538
657
|
.Ambassador_storeBadge__awpcg013:focus-visible {
|
|
539
658
|
outline-color: #000;
|
|
540
659
|
box-shadow: 0 0 0 2px #fff;
|
|
541
660
|
}
|
|
661
|
+
|
|
542
662
|
.Ambassador_storeBadgeArt__awpcg014 {
|
|
543
663
|
display: block;
|
|
664
|
+
border: 0 !important;
|
|
665
|
+
border-radius: 0 !important;
|
|
544
666
|
width: auto !important;
|
|
545
|
-
height: 40px !important;
|
|
546
667
|
max-width: none !important;
|
|
668
|
+
height: 40px !important;
|
|
547
669
|
margin: 0 !important;
|
|
548
|
-
border: 0 !important;
|
|
549
|
-
border-radius: 0 !important;
|
|
550
670
|
}
|
|
671
|
+
|
|
551
672
|
.Ambassador_faqItem__awpcg015 {
|
|
552
|
-
|
|
553
|
-
|
|
673
|
+
border-bottom: 1px solid var(--frak-amb-border, #11111126);
|
|
674
|
+
padding: .9em 0;
|
|
554
675
|
}
|
|
676
|
+
|
|
555
677
|
.Ambassador_faqQuestion__awpcg016 {
|
|
556
678
|
cursor: pointer;
|
|
557
679
|
font-weight: 700;
|
|
558
680
|
list-style: none;
|
|
559
681
|
}
|
|
682
|
+
|
|
560
683
|
.Ambassador_faqQuestion__awpcg016::-webkit-details-marker {
|
|
561
684
|
display: none;
|
|
562
685
|
}
|
|
563
|
-
|
|
686
|
+
|
|
687
|
+
.Ambassador_faqQuestion__awpcg016:after {
|
|
564
688
|
content: "+";
|
|
565
689
|
float: right;
|
|
566
|
-
margin-inline-start: 1em;
|
|
567
690
|
color: var(--frak-amb-accent-text, var(--frak-amb-accent, #111));
|
|
691
|
+
margin-inline-start: 1em;
|
|
568
692
|
font-weight: 700;
|
|
569
693
|
}
|
|
570
|
-
|
|
694
|
+
|
|
695
|
+
.Ambassador_faqItem__awpcg015[open] .Ambassador_faqQuestion__awpcg016:after {
|
|
571
696
|
content: "–";
|
|
572
697
|
}
|
|
698
|
+
|
|
573
699
|
.Ambassador_faqAnswer__awpcg017 {
|
|
574
|
-
|
|
575
|
-
|
|
700
|
+
opacity: .75;
|
|
701
|
+
margin: .6em 0 0;
|
|
576
702
|
}
|
|
703
|
+
|
|
577
704
|
.Ambassador_faqAttribution__awpcg018 {
|
|
578
705
|
text-align: center;
|
|
579
706
|
}
|
|
707
|
+
|
|
580
708
|
.Ambassador_frakLink__awpcg019 {
|
|
581
709
|
color: inherit;
|
|
710
|
+
text-underline-offset: .15em;
|
|
582
711
|
text-decoration: underline;
|
|
583
|
-
text-underline-offset: 0.15em;
|
|
584
712
|
}
|
|
713
|
+
|
|
585
714
|
@supports (color: color-mix(in srgb, red 4%, transparent)) {
|
|
586
715
|
.Ambassador_panel__awpcg00 {
|
|
587
716
|
background-color: var(--frak-amb-surface, color-mix(in srgb, var(--frak-amb-accent, #111) 4%, transparent));
|
|
588
717
|
border: 1px solid var(--frak-amb-border, color-mix(in srgb, var(--frak-amb-accent, #111) 15%, transparent));
|
|
589
718
|
}
|
|
719
|
+
|
|
590
720
|
.Ambassador_faqItem__awpcg015 {
|
|
591
721
|
border-bottom: 1px solid var(--frak-amb-border, color-mix(in srgb, var(--frak-amb-accent, #111) 15%, transparent));
|
|
592
722
|
}
|
|
593
|
-
}
|
|
723
|
+
}
|
|
724
|
+
`;
|
|
594
725
|
//#endregion
|
|
595
726
|
//#region src/components/Ambassador/Ambassador.css.ts
|
|
596
727
|
var amountUnit = "Ambassador_amountUnit__awpcg0a";
|
|
@@ -662,6 +793,7 @@ const cssSource = cssSource$1;
|
|
|
662
793
|
//#region src/components/Ambassador/InstallQr.tsx
|
|
663
794
|
const WIDE_QUERY = "(min-width: 768px)";
|
|
664
795
|
const QUIET_ZONE = 4;
|
|
796
|
+
const ECC = "low";
|
|
665
797
|
const QR_SIZE = 200;
|
|
666
798
|
function InstallQr({ url, label, caption, class: className, captionClass }) {
|
|
667
799
|
const [query] = useState(readWideQuery);
|
|
@@ -678,7 +810,10 @@ function InstallQr({ url, label, caption, class: className, captionClass }) {
|
|
|
678
810
|
let cancelled = false;
|
|
679
811
|
import("qr").then(({ encodeQR }) => {
|
|
680
812
|
if (cancelled) return;
|
|
681
|
-
setGrid(encodeQR(url, "raw", {
|
|
813
|
+
setGrid(encodeQR(url, "raw", {
|
|
814
|
+
border: QUIET_ZONE,
|
|
815
|
+
ecc: ECC
|
|
816
|
+
}));
|
|
682
817
|
}).catch(() => {});
|
|
683
818
|
return () => {
|
|
684
819
|
cancelled = true;
|