@frak-labs/components 1.1.0-beta.474b3fdb → 1.1.0-beta.65694f73
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/{Banner.DGYexiiS.js → Banner.Dh-KYDLv.js} +2 -2
- package/cdn/ButtonShare.CiEtGubR.js +1 -0
- package/cdn/ButtonWallet.B-80TBVO.js +40 -0
- package/cdn/{GiftIcon.C1uAOx7A.js → GiftIcon.CPyeWQNR.js} +1 -1
- package/cdn/OpenInAppButton.DYfr8q7L.js +1 -0
- package/cdn/PostPurchase.CxEoeBs_.js +89 -0
- package/cdn/components.js +1 -1
- package/cdn/defaults.CmUvOlLQ.js +58 -0
- package/cdn/loader.js +10 -6
- package/cdn/rewards.DjfrchZd.js +1 -0
- package/cdn/useGlobalComponents.C7wnXWOg.js +1 -0
- package/cdn/useLightDomStyles.BLyrWEBn.js +1 -0
- package/cdn/{useReward.CXgeQcsH.js → useReward.fvxtDVaA.js} +1 -1
- package/dist/{GiftIcon-BhL0bhVu.js → GiftIcon-DI0rUKHp.js} +7 -7
- package/dist/banner.js +6 -6
- package/dist/buttonShare.d.ts +7 -5
- package/dist/buttonShare.js +5 -10
- package/dist/buttonWallet.d.ts +7 -2
- package/dist/buttonWallet.js +34 -10
- package/dist/i18n/defaults.js +2 -2
- package/dist/openInApp.js +4 -3
- package/dist/postPurchase.d.ts +3 -1
- package/dist/postPurchase.js +11 -8
- package/dist/{rewards-Cxn-bgzC.js → rewards-CZkWSndn.js} +3 -6
- package/dist/{useGlobalComponents-CeTO2xYs.js → useGlobalComponents-DFv33ujB.js} +1 -1
- package/dist/{useLightDomStyles-B2U96tzU.js → useLightDomStyles-B_IbOqJZ.js} +1 -1
- package/dist/{usePlacement-Bpo25qjA.js → usePlacement-DtwWaLHO.js} +3 -1
- package/dist/{useReward-BMYSGY-o.js → useReward-D5zzFR11.js} +1 -1
- package/package.json +3 -3
- package/cdn/ButtonShare.DFg0XCDd.js +0 -1
- package/cdn/ButtonWallet.sGDvcAXt.js +0 -40
- package/cdn/OpenInAppButton.CxLPpqFO.js +0 -1
- package/cdn/PostPurchase.D6Mzbjtu.js +0 -89
- package/cdn/defaults.BEvoSiy5.js +0 -58
- package/cdn/embeddedWallet.BjQSXLkP.js +0 -1
- package/cdn/rewards.B2smvfIs.js +0 -1
- package/cdn/useGlobalComponents.CqTI84Mw.js +0 -1
- package/cdn/useLightDomStyles.CKtA4k-_.js +0 -1
- package/dist/embeddedWallet-CxgyuwtP.js +0 -18
package/dist/buttonShare.d.ts
CHANGED
|
@@ -43,15 +43,17 @@ type ButtonShareProps = {
|
|
|
43
43
|
*/
|
|
44
44
|
products?: SharingPageProduct[] | string;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Reported on the `share_button_clicked` event.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* It no longer selects anything: every click opens the full-page sharing
|
|
49
|
+
* UI. Retired values (`"share-modal"`, `"embedded-wallet"`) stay accepted
|
|
50
|
+
* because merchant configs and saved plugin markup still carry them, and
|
|
51
|
+
* the resolved value is reported as-is so a legacy config stays visible in
|
|
52
|
+
* analytics.
|
|
51
53
|
*
|
|
52
54
|
* @defaultValue `"sharing-page"`
|
|
53
55
|
*/
|
|
54
|
-
clickAction?: "
|
|
56
|
+
clickAction?: "sharing-page" | (string & {});
|
|
55
57
|
/**
|
|
56
58
|
* When set, renders the button in preview mode (e.g. Shopify/WP editor).
|
|
57
59
|
* Skips the client-ready gating so the button is always enabled visually,
|
package/dist/buttonShare.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as useReward } from "./useReward-BMYSGY-o.js";
|
|
1
|
+
import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-DtwWaLHO.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-DFv33ujB.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-B_IbOqJZ.js";
|
|
4
|
+
import { i as w } from "./rewards-CZkWSndn.js";
|
|
5
|
+
import { t as useReward } from "./useReward-D5zzFR11.js";
|
|
7
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
8
7
|
import { sanitizeSharingProducts, trackEvent } from "@frak-labs/core-sdk";
|
|
9
8
|
import { useCallback, useMemo } from "preact/hooks";
|
|
@@ -94,10 +93,6 @@ function ButtonShare({ placement: placementId, text, classname = "", noRewardTex
|
|
|
94
93
|
has_reward: Boolean(reward),
|
|
95
94
|
click_action: resolvedClickAction
|
|
96
95
|
});
|
|
97
|
-
if (resolvedClickAction === "embedded-wallet") {
|
|
98
|
-
openEmbeddedWallet(resolvedTargetInteraction, placementId);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
96
|
openSharingPage(resolvedTargetInteraction, placementId, { products: parsedProducts });
|
|
102
97
|
}, [
|
|
103
98
|
isPreview,
|
package/dist/buttonWallet.d.ts
CHANGED
|
@@ -23,7 +23,12 @@ type ButtonWalletProps = {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/components/ButtonWallet/ButtonWallet.d.ts
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Floating circular button that opens the Frak sharing page.
|
|
27
|
+
*
|
|
28
|
+
* Historically this opened the embedded wallet drawer; that surface was
|
|
29
|
+
* retired, so the button now routes to the full-page sharing UI like every
|
|
30
|
+
* other share CTA. The `frak-button-wallet` tag name is kept because it is
|
|
31
|
+
* public API (merchant markup, Magento template).
|
|
27
32
|
*
|
|
28
33
|
* @param args
|
|
29
34
|
* @returns The wallet button with `<button>` tag
|
|
@@ -60,7 +65,7 @@ type ButtonWalletProps = {
|
|
|
60
65
|
* <frak-button-wallet placement="hero-wallet"></frak-button-wallet>
|
|
61
66
|
* ```
|
|
62
67
|
*
|
|
63
|
-
* @see {@link @frak-labs/core-sdk!actions.
|
|
68
|
+
* @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing page
|
|
64
69
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
65
70
|
*/
|
|
66
71
|
declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
|
package/dist/buttonWallet.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as useReward } from "./useReward-BMYSGY-o.js";
|
|
1
|
+
import { c as openSharingPage, i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-DtwWaLHO.js";
|
|
2
|
+
import { t as useReward } from "./useReward-D5zzFR11.js";
|
|
4
3
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
5
|
-
import {
|
|
4
|
+
import { trackEvent } from "@frak-labs/core-sdk";
|
|
5
|
+
import { useCallback, useEffect, useMemo, useState } from "preact/hooks";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
7
7
|
//#region src/components/ButtonWallet/assets/GiftIcon.tsx
|
|
8
8
|
function GiftIcon(props) {
|
|
@@ -32,9 +32,17 @@ function safeVibrate() {
|
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/components/ButtonWallet/utils.ts
|
|
35
|
+
/**
|
|
36
|
+
* Open the sharing surface behind `<frak-button-wallet>`.
|
|
37
|
+
*
|
|
38
|
+
* The button used to open the embedded wallet drawer; that surface was
|
|
39
|
+
* retired in favour of the full-page sharing UI, so the tag now routes
|
|
40
|
+
* there like every other share CTA. The tag name is kept because it is
|
|
41
|
+
* public API (merchant markup, Magento template).
|
|
42
|
+
*/
|
|
35
43
|
function openWalletModal(targetInteraction, placement) {
|
|
36
44
|
safeVibrate();
|
|
37
|
-
|
|
45
|
+
openSharingPage(targetInteraction, placement);
|
|
38
46
|
}
|
|
39
47
|
//#endregion
|
|
40
48
|
//#region src/components/ButtonWallet/ButtonWallet.tsx
|
|
@@ -79,7 +87,12 @@ const componentCss = `
|
|
|
79
87
|
}
|
|
80
88
|
`;
|
|
81
89
|
/**
|
|
82
|
-
*
|
|
90
|
+
* Floating circular button that opens the Frak sharing page.
|
|
91
|
+
*
|
|
92
|
+
* Historically this opened the embedded wallet drawer; that surface was
|
|
93
|
+
* retired, so the button now routes to the full-page sharing UI like every
|
|
94
|
+
* other share CTA. The `frak-button-wallet` tag name is kept because it is
|
|
95
|
+
* public API (merchant markup, Magento template).
|
|
83
96
|
*
|
|
84
97
|
* @param args
|
|
85
98
|
* @returns The wallet button with `<button>` tag
|
|
@@ -116,7 +129,7 @@ const componentCss = `
|
|
|
116
129
|
* <frak-button-wallet placement="hero-wallet"></frak-button-wallet>
|
|
117
130
|
* ```
|
|
118
131
|
*
|
|
119
|
-
* @see {@link @frak-labs/core-sdk!actions.
|
|
132
|
+
* @see {@link @frak-labs/core-sdk!actions.displaySharingPage | `displaySharingPage()`} for more info about the sharing page
|
|
120
133
|
* @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
|
|
121
134
|
*/
|
|
122
135
|
function ButtonWallet({ placement: placementId, classname = "", useReward: rawUseReward, targetInteraction }) {
|
|
@@ -127,6 +140,19 @@ function ButtonWallet({ placement: placementId, classname = "", useReward: rawUs
|
|
|
127
140
|
const { shouldRender, isHidden, isClientReady } = useClientReady();
|
|
128
141
|
const { reward } = useReward(shouldUseReward && isClientReady, resolvedTargetInteraction);
|
|
129
142
|
const [position, setPosition] = useState("right");
|
|
143
|
+
const onClick = useCallback(() => {
|
|
144
|
+
trackEvent(window.FrakSetup.client, "share_button_clicked", {
|
|
145
|
+
placement: placementId,
|
|
146
|
+
target_interaction: resolvedTargetInteraction,
|
|
147
|
+
has_reward: Boolean(reward),
|
|
148
|
+
click_action: "sharing-page"
|
|
149
|
+
});
|
|
150
|
+
openWalletModal(resolvedTargetInteraction, placementId);
|
|
151
|
+
}, [
|
|
152
|
+
placementId,
|
|
153
|
+
resolvedTargetInteraction,
|
|
154
|
+
reward
|
|
155
|
+
]);
|
|
130
156
|
useEffect(() => {
|
|
131
157
|
const placementPosition = placement?.components?.buttonWallet?.position;
|
|
132
158
|
const configPosition = window.FrakSetup?.modalWalletConfig?.metadata?.position;
|
|
@@ -145,9 +171,7 @@ function ButtonWallet({ placement: placementId, classname = "", useReward: rawUs
|
|
|
145
171
|
part: "button",
|
|
146
172
|
disabled: !isClientReady,
|
|
147
173
|
class: buttonClass,
|
|
148
|
-
onClick
|
|
149
|
-
openWalletModal(resolvedTargetInteraction, placementId);
|
|
150
|
-
},
|
|
174
|
+
onClick,
|
|
151
175
|
children: [/* @__PURE__ */ jsx(GiftIcon, {}), reward && /* @__PURE__ */ jsx("span", {
|
|
152
176
|
class: "reward",
|
|
153
177
|
children: reward
|
package/dist/i18n/defaults.js
CHANGED
|
@@ -27,7 +27,7 @@ const componentDefaults = {
|
|
|
27
27
|
text: "Open in App",
|
|
28
28
|
ariaLabel: "Open in Frak Wallet app"
|
|
29
29
|
},
|
|
30
|
-
buttonWallet: { ariaLabel: "
|
|
30
|
+
buttonWallet: { ariaLabel: "Share and earn rewards" },
|
|
31
31
|
banner: {
|
|
32
32
|
referralTitleReward: "Earn {REWARD} on purchases",
|
|
33
33
|
referralTitle: "You've been referred!",
|
|
@@ -53,7 +53,7 @@ const componentDefaults = {
|
|
|
53
53
|
text: "Ouvrir dans l'app",
|
|
54
54
|
ariaLabel: "Ouvrir dans l'app Frak Wallet"
|
|
55
55
|
},
|
|
56
|
-
buttonWallet: { ariaLabel: "
|
|
56
|
+
buttonWallet: { ariaLabel: "Partagez et gagnez des récompenses" },
|
|
57
57
|
banner: {
|
|
58
58
|
referralTitleReward: "Gagnez {REWARD} sur vos achats",
|
|
59
59
|
referralTitle: "Vous avez été parrainé !",
|
package/dist/openInApp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
1
|
+
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-DtwWaLHO.js";
|
|
2
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-B_IbOqJZ.js";
|
|
3
3
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
4
4
|
import { DEEP_LINK_SCHEME, isMobile, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
|
|
5
5
|
import { useMemo } from "preact/hooks";
|
|
@@ -19,7 +19,8 @@ function openFrakWalletApp(path = DEFAULT_PATH, placement) {
|
|
|
19
19
|
path,
|
|
20
20
|
placement
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
const deepLink = `${DEEP_LINK_SCHEME}${path}`;
|
|
23
|
+
triggerDeepLinkWithFallback(deepLink, { onFallback: () => {
|
|
23
24
|
if (client) trackEvent(client, "app_not_installed", {
|
|
24
25
|
path,
|
|
25
26
|
placement
|
package/dist/postPurchase.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ type PostPurchaseProps = {
|
|
|
16
16
|
*/
|
|
17
17
|
orderId?: string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Opaque per-order token. Feeds purchase tracking, and travels to the
|
|
20
|
+
* sharing page so the install CTA still carries a credential when the
|
|
21
|
+
* anonymous id is unavailable.
|
|
20
22
|
*/
|
|
21
23
|
token?: string;
|
|
22
24
|
/**
|
package/dist/postPurchase.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
3
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
4
|
-
import { i as w, n as K, t as C } from "./rewards-
|
|
1
|
+
import { c as openSharingPage, i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-DtwWaLHO.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-DFv33ujB.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-B_IbOqJZ.js";
|
|
4
|
+
import { i as w, n as K, t as C } from "./rewards-CZkWSndn.js";
|
|
5
5
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
6
|
-
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-
|
|
6
|
+
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-DI0rUKHp.js";
|
|
7
7
|
import { sanitizeSharingProducts, trackEvent } from "@frak-labs/core-sdk";
|
|
8
8
|
import { getMerchantInformation, getUserReferralStatus, trackPurchaseStatus } from "@frak-labs/core-sdk/actions";
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
@@ -270,18 +270,21 @@ function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, plac
|
|
|
270
270
|
});
|
|
271
271
|
openSharingPage(void 0, placementId, {
|
|
272
272
|
link: resolvedSharingUrl,
|
|
273
|
-
products: parsedProducts
|
|
273
|
+
products: parsedProducts,
|
|
274
|
+
checkoutToken: token
|
|
274
275
|
});
|
|
275
276
|
}, [
|
|
276
277
|
resolvedVariant,
|
|
277
278
|
placementId,
|
|
278
279
|
resolvedSharingUrl,
|
|
279
|
-
parsedProducts
|
|
280
|
+
parsedProducts,
|
|
281
|
+
token
|
|
280
282
|
]);
|
|
281
283
|
if (!resolvedVariant) return null;
|
|
282
284
|
if (!isPreview && (!shouldRender || isHidden || !context)) return null;
|
|
285
|
+
const cardClass = [card, classname].filter(Boolean).join(" ");
|
|
283
286
|
return /* @__PURE__ */ jsx("div", {
|
|
284
|
-
className:
|
|
287
|
+
className: cardClass,
|
|
285
288
|
children: /* @__PURE__ */ jsxs("div", {
|
|
286
289
|
class: cardLayout,
|
|
287
290
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../core/dist/getCurrencyAmountKey-
|
|
1
|
+
//#region ../core/dist/getCurrencyAmountKey-mJ3_Eamt.js
|
|
2
2
|
const e = {
|
|
3
3
|
eur: `fr-FR`,
|
|
4
4
|
usd: `en-US`,
|
|
@@ -38,10 +38,7 @@ function a$1(e, r) {
|
|
|
38
38
|
case `fraction`:
|
|
39
39
|
u += e.value;
|
|
40
40
|
break;
|
|
41
|
-
case `currency`:
|
|
42
|
-
d = e.value, f = p ? `suffix` : `prefix`;
|
|
43
|
-
break;
|
|
44
|
-
default: break;
|
|
41
|
+
case `currency`: d = e.value, f = p ? `suffix` : `prefix`;
|
|
45
42
|
}
|
|
46
43
|
return {
|
|
47
44
|
integer: l,
|
|
@@ -141,7 +138,7 @@ function S(t$1, a) {
|
|
|
141
138
|
}
|
|
142
139
|
}
|
|
143
140
|
function C(t$2, n) {
|
|
144
|
-
if (t$2
|
|
141
|
+
if (!(!t$2 || y(t$2, s$1(t(n))) <= 0)) return x(t$2, n);
|
|
145
142
|
}
|
|
146
143
|
function w(e, t) {
|
|
147
144
|
return t ? e.replaceAll(`{REWARD}`, t) : e.replaceAll(`{REWARD}`, ``);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as subscribeSdkConfig } from "./usePlacement-
|
|
1
|
+
import { a as subscribeSdkConfig } from "./usePlacement-DtwWaLHO.js";
|
|
2
2
|
import { sdkConfigStore } from "@frak-labs/core-sdk";
|
|
3
3
|
import { useSyncExternalStore } from "preact/compat";
|
|
4
4
|
//#region src/hooks/useGlobalComponents.ts
|
|
@@ -14,6 +14,7 @@ async function openSharingPage(targetInteraction, placement, options) {
|
|
|
14
14
|
await displaySharingPage(window.FrakSetup.client, {
|
|
15
15
|
...options?.link && { link: options.link },
|
|
16
16
|
...options?.products?.length && { products: options.products },
|
|
17
|
+
...options?.checkoutToken && { checkoutToken: options.checkoutToken },
|
|
17
18
|
...targetInteraction && { metadata: { targetInteraction } }
|
|
18
19
|
}, placement);
|
|
19
20
|
}
|
|
@@ -347,7 +348,8 @@ function getPlacement(id) {
|
|
|
347
348
|
* only re-renders when that placement actually changes.
|
|
348
349
|
*/
|
|
349
350
|
function usePlacement(placementId) {
|
|
350
|
-
|
|
351
|
+
const getSnapshot = useCallback(() => placementId ? getPlacement(placementId) : void 0, [placementId]);
|
|
352
|
+
return useSyncExternalStore(subscribeSdkConfig, getSnapshot);
|
|
351
353
|
}
|
|
352
354
|
//#endregion
|
|
353
355
|
export { subscribeSdkConfig as a, openSharingPage as c, useLang as i, buildStyleContent as n, useClientReady as o, lightDomBaseCss as r, registerWebComponent as s, usePlacement as t };
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "1.1.0-beta.
|
|
14
|
+
"version": "1.1.0-beta.65694f73",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
"publish": "echo 'Publishing components...'"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@frak-labs/core-sdk": "1.3.0-beta.
|
|
106
|
+
"@frak-labs/core-sdk": "1.3.0-beta.65694f73",
|
|
107
107
|
"@frak-labs/design-system": "0.0.0",
|
|
108
|
-
"@frak-labs/frame-connector": "1.3.0-beta.
|
|
108
|
+
"@frak-labs/frame-connector": "1.3.0-beta.65694f73",
|
|
109
109
|
"preact": "^10.29.7",
|
|
110
110
|
"preact-custom-element": "^4.6.0"
|
|
111
111
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,u as t,w as n}from"./loader.js";import{a as r,h as i,m as a,n as o,p as s,s as c,t as l,u}from"./defaults.BEvoSiy5.js";import{t as d}from"./useGlobalComponents.CqTI84Mw.js";import{t as f}from"./useLightDomStyles.CKtA4k-_.js";import{i as p}from"./rewards.B2smvfIs.js";import{t as m}from"./useReward.CXgeQcsH.js";import{t as h}from"./embeddedWallet.BjQSXLkP.js";function g({placement:i,text:g,classname:_=``,noRewardText:v,targetInteraction:y,products:b,clickAction:x,preview:S}){let C=!!S,w=r(),T=o(i),E=d(),D=T?.components?.buttonShare??E?.buttonShare;f(`frak-button-share`,i,D?.css);let O=u(()=>T?.targetInteraction===void 0?y:T.targetInteraction,[T?.targetInteraction,y]),k=D?.text??g??l[w].buttonShare.text,A=D?.noRewardText??v,j=u(()=>k.includes(`{REWARD}`),[k]),M=u(()=>D?.clickAction??x??`sharing-page`,[D?.clickAction,x]),{shouldRender:N,isHidden:P,isClientReady:F}=c(),I=u(()=>t(b),[b]),{reward:L}=m(j&&F,O,void 0,I),R=u(()=>j?L?p(k,L):A??p(k,void 0):k,[j,k,A,L]),z=s(()=>{if(!C){if(n(window.FrakSetup.client,`share_button_clicked`,{placement:i,target_interaction:O,has_reward:!!L,click_action:M}),M===`embedded-wallet`){h(O,i);return}e(O,i,{products:I})}},[C,M,O,i,L,I]);if(!C&&(!N||P))return null;let B=[`button`,`button__fadeIn`,_].filter(Boolean).join(` `);return a(`button`,{type:`button`,disabled:!C&&!F,class:B,onClick:z,children:R})}i(g,`frak-button-share`,[`text`,`placement`,`classname`,`clickAction`,`noRewardText`,`targetInteraction`,`products`,`preview`],{shadow:!1});export{g as ButtonShare};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{a as e,d as t,f as n,g as r,h as i,m as a,n as o,r as s,s as c,t as l,u}from"./defaults.BEvoSiy5.js";import{t as d}from"./useReward.CXgeQcsH.js";import{t as f}from"./embeddedWallet.BjQSXLkP.js";function p(e){return a(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[a(`title`,{children:`Gift icon`}),a(`path`,{d:`m23.14 14v11.43h-18.29v-11.43m9.14 11.43v-17.14m0 0h-5.14c-0.76 0-1.48-0.3-2.02-0.84s-0.84-1.26-0.84-2.020.3-1.480.84-2.02 1.26-0.84 2.02-0.84c4 0 5.14 5.71 5.14 5.71zm0 0h5.14c0.76 0 1.48-0.3 2.02-0.84s0.84-1.260.84-2.02-0.3-1.48-0.84-2.02-1.26-0.84-2.02-0.84c-4 0-5.14 5.71-5.14 5.71zm-11.43 0h22.86v5.71h-22.86z`,stroke:`#fff`,"stroke-linecap":`round`,"stroke-linejoin":`round`})]})}function m(){`vibrate`in navigator?navigator.vibrate(10):console.log(`Vibration not supported`)}function h(e,t){m(),f(e,t)}function g({placement:i,classname:f=``,useReward:m,targetInteraction:g}){let _=e(),v=o(i),y=u(()=>v?.targetInteraction===void 0?g:v.targetInteraction,[v?.targetInteraction,g]),b=u(()=>m===!0,[m]),{shouldRender:x,isHidden:S,isClientReady:C}=c(),{reward:w}=d(b&&C,y),[T,E]=t(`right`);if(n(()=>{let e=v?.components?.buttonWallet?.position,t=window.FrakSetup?.modalWalletConfig?.metadata?.position;E(e??t??`right`)},[v?.components?.buttonWallet?.position]),!x||S)return null;let D=[`button`,`button__fadeIn`,T===`left`?`button__left`:`button__right`,f].filter(Boolean).join(` `);return a(r,{children:[a(`style`,{children:s(`
|
|
2
|
-
.button {
|
|
3
|
-
all: unset;
|
|
4
|
-
position: fixed;
|
|
5
|
-
bottom: 20px;
|
|
6
|
-
z-index: 2000000;
|
|
7
|
-
display: flex;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
align-items: center;
|
|
10
|
-
background-color: #3e557e;
|
|
11
|
-
width: 45px;
|
|
12
|
-
height: 45px;
|
|
13
|
-
border-radius: 50%;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
text-align: center;
|
|
16
|
-
font-size: 24px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.button__left {
|
|
20
|
-
left: 20px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.button__right {
|
|
24
|
-
right: 20px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.reward {
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: -4px;
|
|
30
|
-
right: 27px;
|
|
31
|
-
padding: 2px 3px;
|
|
32
|
-
border-radius: 5px;
|
|
33
|
-
background: #ff3f3f;
|
|
34
|
-
font-size: 9px;
|
|
35
|
-
color: #fff;
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
white-space: nowrap;
|
|
38
|
-
line-height: 9px;
|
|
39
|
-
}
|
|
40
|
-
`,v?.components?.buttonWallet?.css)}),a(`button`,{type:`button`,"aria-label":l[_].buttonWallet.ariaLabel,part:`button`,disabled:!C,class:D,onClick:()=>{h(y,i)},children:[a(p,{}),w&&a(`span`,{class:`reward`,children:w})]})]})}i(g,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{g as ButtonWallet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as e,g as t,h as n,w as r}from"./loader.js";import{a as i,h as a,m as o,n as s,s as c,t as l,u}from"./defaults.BEvoSiy5.js";import{t as d}from"./useLightDomStyles.CKtA4k-_.js";function f(n=`wallet`,i){let a=window.FrakSetup?.client;a&&r(a,`open_in_app_clicked`,{path:n,placement:i}),t(`${e}${n}`,{onFallback:()=>{a&&r(a,`app_not_installed`,{path:n,placement:i})}})}function p(){return{isMobile:u(()=>n(),[])}}function m({placement:e,text:t,classname:n=``}){let r=i(),a=s(e),{shouldRender:u,isHidden:m,isClientReady:h}=c(),{isMobile:g}=p();d(`frak-open-in-app`,e,a?.components?.openInApp?.css);let _=a?.components?.openInApp?.text??t??l[r].openInApp.text;if(!g||!u||m)return null;let v=()=>{f(void 0,e)},y=[`button`,`button__fadeIn`,n].filter(Boolean).join(` `);return o(`button`,{type:`button`,"aria-label":l[r].openInApp.ariaLabel,disabled:!h,class:y,onClick:v,children:_})}a(m,`frak-open-in-app`,[`text`,`placement`,`classname`],{shadow:!1});export{m as OpenInAppButton};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import{E as e,T as t,i as n,k as r,l as i,o as a,r as o,u as s,w as c}from"./loader.js";import{a as ee,d as l,f as u,h as d,l as te,m as f,n as p,p as m,s as h,t as ne,u as g}from"./defaults.BEvoSiy5.js";import{r as re,t as ie}from"./GiftIcon.C1uAOx7A.js";import{t as ae}from"./useGlobalComponents.CqTI84Mw.js";import{t as oe}from"./useLightDomStyles.CKtA4k-_.js";import{i as _,n as v,t as se}from"./rewards.B2smvfIs.js";var ce=`PostPurchase_card__5fv5lh0`,y=`PostPurchase_cardLayout__5fv5lh1`,b=`PostPurchase_cardLeft__5fv5lh2`,le=`PostPurchase_cardRight__5fv5lh3`,ue=`PostPurchase_cta__5fv5lh6 sharedBaseCss_buttonReset__7cswil0`,x=`PostPurchase_customImage__5fv5lha`,S=`PostPurchase_frakLogo__5fv5lhb`,de=`PostPurchase_giftIcon__5fv5lh8`,fe=`PostPurchase_icon__5fv5lh7`,pe=`PostPurchase_imageWrapper__5fv5lh9`,me=`PostPurchase_message__5fv5lh5`;function he(e,t,n,r){let i=e?.isReferred?`referee`:`referrer`,a=v(t.rewards,{targetInteraction:`purchase`,currency:n,audience:i,products:r});if(!a)return null;let{campaign:o}=a,s=e?.isReferred&&o.referee?`referee`:`referrer`;return{variant:s,reward:s===`referee`?o.referee:o.referrer,merchantDomain:t.onChainMetadata.domain}}function C({customerId:d,orderId:v,token:C,sharingUrl:ge,merchantId:w,placement:T,classname:_e=``,variant:E,badgeText:D,referrerText:O,refereeText:k,ctaText:A,preview:j,previewVariant:M,products:N,imageUrl:P}){let F=!!j,{shouldRender:I,isHidden:L,isClientReady:R}=h(),z=p(T),B=ee(),V=g(()=>s(N),[N]);oe(`frak-post-purchase`,T,z?.components?.postPurchase?.css,`.PostPurchase_card__5fv5lh0 {
|
|
2
|
-
padding: 16px;
|
|
3
|
-
border-radius: 12px;
|
|
4
|
-
background-color: var(--surface-background__pbq4akc);
|
|
5
|
-
border: 1px solid var(--border-default__pbq4akv);
|
|
6
|
-
}
|
|
7
|
-
.PostPurchase_cardLayout__5fv5lh1 {
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
align-items: center;
|
|
11
|
-
gap: 32px;
|
|
12
|
-
}
|
|
13
|
-
.PostPurchase_cardLeft__5fv5lh2 {
|
|
14
|
-
flex-grow: 1;
|
|
15
|
-
min-width: 0;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: 8px;
|
|
19
|
-
}
|
|
20
|
-
.PostPurchase_cardRight__5fv5lh3 {
|
|
21
|
-
flex-shrink: 0;
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
align-items: flex-end;
|
|
25
|
-
gap: 8px;
|
|
26
|
-
text-align: right;
|
|
27
|
-
}
|
|
28
|
-
.PostPurchase_badge__5fv5lh4 {
|
|
29
|
-
align-self: flex-start;
|
|
30
|
-
background-color: #FFF534;
|
|
31
|
-
border-radius: 4px;
|
|
32
|
-
padding: 4px 8px;
|
|
33
|
-
font-size: 12px;
|
|
34
|
-
font-weight: 600;
|
|
35
|
-
line-height: 12px;
|
|
36
|
-
color: var(--text-primary__pbq4ak0);
|
|
37
|
-
}
|
|
38
|
-
.PostPurchase_message__5fv5lh5 {
|
|
39
|
-
margin: 0;
|
|
40
|
-
font-size: 16px;
|
|
41
|
-
line-height: 22px;
|
|
42
|
-
color: var(--text-primary__pbq4ak0);
|
|
43
|
-
font-weight: 600;
|
|
44
|
-
}
|
|
45
|
-
.PostPurchase_cta__5fv5lh6 {
|
|
46
|
-
display: inline-flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
gap: 4px;
|
|
50
|
-
padding: 12px 16px;
|
|
51
|
-
border-radius: 9999px;
|
|
52
|
-
background-color: var(--text-primary__pbq4ak0);
|
|
53
|
-
color: var(--text-onAction__pbq4ak6);
|
|
54
|
-
font-size: 12px;
|
|
55
|
-
font-weight: bold;
|
|
56
|
-
text-transform: uppercase;
|
|
57
|
-
}
|
|
58
|
-
.PostPurchase_cta__5fv5lh6:disabled {
|
|
59
|
-
opacity: 0.7;
|
|
60
|
-
cursor: default;
|
|
61
|
-
}
|
|
62
|
-
.PostPurchase_icon__5fv5lh7 {
|
|
63
|
-
margin: -2px 0;
|
|
64
|
-
}
|
|
65
|
-
.PostPurchase_giftIcon__5fv5lh8 {
|
|
66
|
-
display: block;
|
|
67
|
-
flex-shrink: 0;
|
|
68
|
-
}
|
|
69
|
-
.PostPurchase_imageWrapper__5fv5lh9 {
|
|
70
|
-
flex-shrink: 0;
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
width: 80px;
|
|
75
|
-
height: 80px;
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
}
|
|
78
|
-
.PostPurchase_customImage__5fv5lha {
|
|
79
|
-
max-width: 100%;
|
|
80
|
-
max-height: 100%;
|
|
81
|
-
width: auto;
|
|
82
|
-
height: auto;
|
|
83
|
-
object-fit: contain;
|
|
84
|
-
display: block;
|
|
85
|
-
}
|
|
86
|
-
.PostPurchase_frakLogo__5fv5lhb {
|
|
87
|
-
display: block;
|
|
88
|
-
margin-left: auto;
|
|
89
|
-
}`,r);let[H,ve]=l(null),[U,W]=l(!1);u(()=>{F||!R||!d||!v||!C||n({customerId:d,orderId:v,token:C,merchantId:w}).catch(()=>{})},[F,R,d,v,C,w]),u(()=>{if(F||!R||U)return;let n=window.FrakSetup?.client;n&&Promise.all([a(n),i(n)]).then(([e,t])=>{W(!0),ve({referralStatus:e,merchantInfo:t})}).catch(n=>{if(n instanceof e&&n.code===t.configError){W(!0);return}console.warn(`[Frak] Post-purchase context error`,n)})},[F,R,U]);let G=g(()=>H?he(H.referralStatus,H.merchantInfo,window.FrakSetup?.client?.config?.metadata?.currency,V):null,[H,V]),K=te(null),q=E??G?.variant??(F?M??`referrer`:void 0),J=ge??G?.merchantDomain,Y=g(()=>{if(!G?.reward)return;let e=window.FrakSetup?.client?.config?.metadata?.currency;return se(G.reward,e)},[G?.reward]),ye=ae(),X=z?.components?.postPurchase??ye?.postPurchase,Z=D??X?.badgeText,Q=P??X?.imageUrl,$=g(()=>{let e=ne[B].postPurchase;return{message:q===`referee`?Y?_(k??X?.refereeText??e.refereeText,Y):k??X?.refereeNoRewardText??e.refereeNoRewardText:Y?_(O??X?.referrerText??e.referrerText,Y):O??X?.referrerNoRewardText??e.referrerNoRewardText,cta:Y?_(A??X?.ctaText??e.ctaText,Y):A??X?.ctaNoRewardText??e.ctaNoRewardText}},[B,q,Y,X,O,k,A]);u(()=>{q&&K.current!==q&&R&&(!F&&(!I||L)||(c(window.FrakSetup?.client,`post_purchase_impression`,{placement:T,variant:q,has_reward:!!G?.reward}),K.current=q))},[q,I,L,R,F,T,G?.reward]);let be=m(()=>{q&&(c(window.FrakSetup?.client,`post_purchase_clicked`,{placement:T,variant:q}),o(void 0,T,{link:J,products:V}))},[q,T,J,V]);return!q||!F&&(!I||L||!G)?null:f(`div`,{className:[ce,_e].filter(Boolean).join(` `),children:f(`div`,{class:y,children:[f(`div`,{class:b,children:[Z&&f(`span`,{class:`PostPurchase_badge__5fv5lh4`,children:Z}),f(`p`,{class:me,children:$.message}),f(`button`,{type:`button`,className:`${ue} button`,disabled:!F&&!R,onClick:F?void 0:be,children:[$.cta,f(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`${fe} button`,children:f(`path`,{d:`M13.9 11.14C13.99 11.05 14.15 11.11 14.15 11.24V11.64C14.15 13.05 12.63 14.19 10.75 14.19C8.87 14.19 7.34 13.05 7.34 11.64V11.24C7.34 11.11 7.51 11.05 7.59 11.14C8.35 11.93 9.48 12.43 10.75 12.43C12.01 12.43 13.15 11.93 13.9 11.14ZM1.85 9.65C1.85 9.51 2.01 9.44 2.1 9.54C2.85 10.32 3.99 10.82 5.25 10.82C5.52 10.82 5.79 10.8 6.04 10.76C6.26 10.72 6.47 10.88 6.47 11.1V12.17C6.47 12.32 6.37 12.45 6.22 12.48C5.92 12.55 5.59 12.59 5.25 12.59C3.37 12.59 1.85 11.45 1.85 10.04V9.65ZM10.75 6.21C12.63 6.21 14.15 7.35 14.15 8.75C14.15 10.16 12.63 11.3 10.75 11.3C8.87 11.3 7.34 10.16 7.34 8.75C7.34 7.35 8.87 6.21 10.75 6.21ZM1.85 6.85C1.85 6.71 2.01 6.65 2.1 6.74C2.85 7.53 3.99 8.03 5.25 8.03C5.52 8.03 5.79 8 6.04 7.96C6.26 7.92 6.47 8.09 6.47 8.3V9.37C6.47 9.52 6.37 9.65 6.22 9.69C5.92 9.75 5.59 9.79 5.25 9.79C3.37 9.79 1.85 8.65 1.85 7.24V6.85ZM5.25 1.81C7.13 1.81 8.66 2.95 8.66 4.36C8.66 5.76 7.13 6.9 5.25 6.9C3.37 6.9 1.85 5.76 1.85 4.36C1.85 2.95 3.37 1.81 5.25 1.81Z`,fill:`currentColor`})})]})]}),f(`div`,{class:le,children:[Q?f(`span`,{class:pe,children:f(`img`,{src:Q,alt:``,class:x})}):f(ie,{className:de,width:80,height:80}),f(re,{className:S,width:42,height:24})]})]})})}d(C,`frak-post-purchase`,[`customerId`,`orderId`,`token`,`sharingUrl`,`merchantId`,`placement`,`classname`,`variant`,`badgeText`,`referrerText`,`refereeText`,`ctaText`,`products`,`preview`,`previewVariant`,`imageUrl`],{shadow:!1});export{C as PostPurchase};
|
package/cdn/defaults.BEvoSiy5.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import{C as e,D as t,_ as n,n as r,t as i}from"./loader.js";var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y={},b=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,S=Array.isArray;function C(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function T(e,t,n){var r,i,o,s={};for(o in t)o==`key`?r=t[o]:o==`ref`?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?a.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return E(e,s,r,i,null)}function E(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++s,__i:-1,__u:0};return i==null&&o.vnode!=null&&o.vnode(a),a}function D(e){return e.children}function O(e,t){this.props=e,this.context=t}function k(e,t){if(t==null)return e.__?k(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?k(e):null}function A(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=C({},t);a.__v=t.__v+1,o.vnode&&o.vnode(a),I(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??k(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,se(r,a,i),t.__e=t.__=null,a.__e!=n&&j(a)}}function j(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),j(e)}function M(e){(!e.__d&&(e.__d=!0)&&c.push(e)&&!N.__r++||l!=o.debounceRendering)&&((l=o.debounceRendering)||u)(N)}function N(){try{for(var e,t=1;c.length;)c.length>t&&c.sort(d),e=c.shift(),t=c.length,A(e)}finally{c.length=N.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=r&&r.__k||b,x=t.length;for(c=te(n,t,v,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&v[p.__i]||y,p.__i=d,g=I(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&L(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(_=!!(4&p.__u))||f.__k===p.__k?(c=ne(p,c,e,_),_&&f.__e&&(f.__e=null)):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function te(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=E(null,o,null,null,null):S(o)?o=e.__k[a]=E(D,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=E(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=re(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=k(s)),ue(s,s));return r}function ne(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=ne(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=k(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function P(e,t){return t||=[],e==null||typeof e==`boolean`||(S(e)?e.some(function(e){P(e,t)}):t.push(e)),t}function re(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ie(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||x.test(t)?n:n+`px`}function F(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ie(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ie(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(h,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[m]=r[m]:(n[m]=g,e.addEventListener(t,a?v:_,a)):e.removeEventListener(t,a?v:_,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function ae(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[p]==null)t[p]=g++;else if(t[p]<n[m])return;return n(o.event?o.event(t):t)}}}function I(e,t,n,r,i,a,s,c,l,u){var d,f,p,m,h,g,_,v,y,x,T,E,k,A,j,M,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);n:if(typeof N==`function`){f=s.length;try{if(y=t.props,x=N.prototype&&N.prototype.render,T=(d=N.contextType)&&r[d.__c],E=d?T?T.props.value:d.__:r,n.__c?v=(p=t.__c=n.__c).__=p.__E:(x?t.__c=p=new N(y,E):(t.__c=p=new O(y,E),p.constructor=N,p.render=de),T&&T.sub(p),p.state||={},p.__n=r,m=p.__d=!0,p.__h=[],p._sb=[]),x&&p.__s==null&&(p.__s=p.state),x&&N.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=C({},p.__s)),C(p.__s,N.getDerivedStateFromProps(y,p.__s))),h=p.props,g=p.state,p.__v=t,m)x&&N.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),x&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(x&&N.getDerivedStateFromProps==null&&y!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(y,E),t.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(y,p.__s,E)){t.__v!=n.__v&&(p.props=y,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),b.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(y,p.__s,E),x&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,g,_)})}if(p.context=E,p.props=y,p.__P=e,p.__e=!1,k=o.__r,A=0,x)p.state=p.__s,p.__d=!1,k&&k(t),d=p.render(p.props,p.state,p.context),b.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,k&&k(t),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++A<25);p.state=p.__s,p.getChildContext!=null&&(r=C(C({},r),p.getChildContext())),x&&!m&&p.getSnapshotBeforeUpdate!=null&&(_=p.getSnapshotBeforeUpdate(h,g)),j=d!=null&&d.type===D&&d.key==null?ce(d.props.children):d,c=ee(e,S(j)?j:[j],t,n,r,i,a,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),v&&(p.__E=p.__=null)}catch(e){if(s.length=f,t.__v=null,l||a!=null){if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;a!=null&&(a[a.indexOf(c)]=null),t.__e=c}else if(a!=null)for(M=a.length;M--;)w(a[M])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||oe(t),o.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=le(n.__e,t,n,r,i,a,s,l,u);return(d=o.diffed)&&d(t),128&t.__u?void 0:c}function oe(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(oe))}function se(e,t,n){for(var r=0;r<n.length;r++)L(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function ce(e){return typeof e!=`object`||!e||e.__b>0?e:S(e)?e.map(ce):e.constructor===void 0?C({},e):null}function le(e,t,n,r,i,s,c,l,u){var d,f,p,m,h,g,_,v=n.props||y,b=t.props,x=t.type;if(x==`svg`?i=`http://www.w3.org/2000/svg`:x==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!x&&(x?h.localName==x:h.nodeType==3)){e=h,s[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(i,x,b.is&&b),l&&=(o.__m&&o.__m(t,s),!1),s=null}if(x==null)v===b||l&&e.data==b||(e.data=b);else{if(s=x==`textarea`&&b.defaultValue!=null?null:s&&a.call(e.childNodes),!l&&s!=null)for(v={},d=0;d<e.attributes.length;d++)v[(h=e.attributes[d]).name]=h.value;for(d in v)h=v[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in b||d==`value`&&`defaultValue`in b||d==`checked`&&`defaultChecked`in b||F(e,d,null,h,i);for(d in b)h=b[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?_=h:l&&typeof h!=`function`||v[d]===h||F(e,d,h,v[d],i);if(f)l||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(p&&(e.innerHTML=``),ee(t.type==`template`?e.content:e,S(m)?m:[m],t,n,r,x==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,s,c,s?s[0]:n.__k&&k(n,0),l,u),s!=null)for(d=s.length;d--;)w(s[d]);l&&x!=`textarea`||(d=`value`,x==`progress`&&g==null?e.removeAttribute(`value`):g!=null&&(g!==e[d]||x==`progress`&&!g||x==`option`&&g!=v[d])&&F(e,d,g,v[d],i),d=`checked`,_!=null&&_!=e[d]&&F(e,d,_,v[d],i))}return e}function L(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function ue(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||L(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ue(r[i],t,n||typeof e.type!=`function`);n||w(e.__e),e.__c=e.__=e.__e=void 0}function de(e,t,n){return this.constructor(e,n)}function R(e,t,n){var r,i,s,c;t==document&&(t=document.documentElement),o.__&&o.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,s=[],c=[],I(t,e=(!r&&n||t).__k=T(D,null,[e]),i||y,y,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?a.call(t.childNodes):null,s,!r&&n?n:i?i.__e:t.firstChild,r,c),se(s,e,c),e.props.children=null}function fe(e,t){R(e,t,fe)}function pe(e,t,n){var r,i,o,s,c=C({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o==`key`?r=t[o]:o==`ref`?i=t[o]:c[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?a.call(arguments,2):n),E(e.type,c,r||e.key,i||e.ref,null)}a=b.slice,o={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},s=0,O.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state);typeof e==`function`&&(e=e(C({},n),this.props)),e&&C(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),M(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},O.prototype.render=D,c=[],u=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,f=Math.random().toString(8),p=`__d`+f,m=`__a`+f,h=/(PointerCapture)$|Capture$/i,g=0,_=ae(!1),v=ae(!0);function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(this,arguments)}function me(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}var he=[`context`,`children`],ge=[`useFragment`];function _e(e,t,n,r){function i(){var t,n=Reflect.construct(HTMLElement,[],i);return n._vdomComponent=e,r&&r.shadow?(n._root=n.attachShadow({mode:r.mode||`open`,serializable:(t=r.serializable)!=null&&t}),r.adoptedStyleSheets&&(n._root.adoptedStyleSheets=r.adoptedStyleSheets)):n._root=n,n}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=function(){ye.call(this,r)},i.prototype.attributeChangedCallback=xe,i.prototype.disconnectedCallback=Se,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,e.formAssociated&&(i.formAssociated=!0),n.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||={},this._props[e]=t);var n=typeof t;t!=null&&n!==`string`&&n!==`boolean`&&n!==`number`||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i),i}function ve(e){this.getChildContext=function(){return e.context};var t=e.children;return pe(t,me(e,he))}function ye(e){var t=new CustomEvent(`_preact`,{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=T(ve,z({},this._props,{context:t.detail.context}),we(this,this._vdomComponent,e)),(this.hasAttribute(`hydrate`)?fe:R)(this._vdom,this._root)}function be(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():``})}function xe(e,t,n){if(this._vdom){var r={};r[e]=n??=void 0,r[be(e)]=n,this._vdom=pe(this._vdom,r),R(this._vdom,this._root)}}function Se(){R(this._vdom=null,this._root)}function Ce(e,t){var n=this,r=e.useFragment,i=me(e,ge);return T(r?D:`slot`,z({},i,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener(`_preact`,n._listener))):n.ref.removeEventListener(`_preact`,n._listener)}}))}function we(e,t,n){if(e.nodeType===3)return e.data;if(e.nodeType!==1)return null;var r=[],i={},a=0,o=e.attributes,s=e.childNodes;for(a=o.length;a--;)o[a].name!==`slot`&&(i[o[a].name]=o[a].value,i[be(o[a].name)]=o[a].value);for(a=s.length;a--;){var c=we(s[a],null,n),l=s[a].slot;l?i[l]=T(Ce,{name:l},c):r[a]=c}var u=!(!n||!n.shadow),d=t?T(Ce,{useFragment:!u},r):r;return!u&&t&&(e.innerHTML=``),T(t||e.nodeName.toLowerCase(),i,d)}function Te(e,n,r=[],a={shadow:!0}){typeof window<`u`&&(t(i),customElements.get(n)||_e(e,n,r,a))}var Ee=0;Array.isArray;function De(e,t,n,r,i,a){t||={};var s,c,l=t;if(`ref`in l)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ee,__i:-1,__u:0,__source:i,__self:a};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return o.vnode&&o.vnode(u),u}var B,V,H,Oe,U=0,ke=[],W=o,Ae=W.__b,je=W.__r,Me=W.diffed,Ne=W.__c,Pe=W.unmount,Fe=W.__;function G(e,t){W.__h&&W.__h(V,e,U||t),U=0;var n=V.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return U=1,Ie(Ue,e)}function Ie(e,t,n){var r=G(B++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ue(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=V,!V.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};V.__f=!0;var a=V.shouldComponentUpdate,o=V.componentWillUpdate;V.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},V.shouldComponentUpdate=i}return r.__N||r.__}function q(e,t){var n=G(B++,3);!W.__s&&Z(n.__H,t)&&(n.__=e,n.u=t,V.__H.__h.push(n))}function Le(e,t){var n=G(B++,4);!W.__s&&Z(n.__H,t)&&(n.__=e,n.u=t,V.__h.push(n))}function Re(e){return U=5,J(function(){return{current:e}},[])}function J(e,t){var n=G(B++,7);return Z(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ze(e,t){return U=8,J(function(){return e},t)}function Be(){for(var e;e=ke.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Y),t.__h.some(X),t.__h=[]}catch(n){t.__h=[],W.__e(n,e.__v)}}}W.__b=function(e){V=null,Ae&&Ae(e)},W.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fe&&Fe(e,t)},W.__r=function(e){je&&je(e),B=0;var t=(V=e.__c).__H;t&&(H===V?(t.__h=[],V.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Y),t.__h.some(X),t.__h=[],B=0)),H=V},W.diffed=function(e){Me&&Me(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ke.push(t)!==1&&Oe===W.requestAnimationFrame||((Oe=W.requestAnimationFrame)||He)(Be)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),H=V=null},W.__c=function(e,t){t.some(function(e){try{e.__h.some(Y),e.__h=e.__h.filter(function(e){return!e.__||X(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],W.__e(n,e.__v)}}),Ne&&Ne(e,t)},W.unmount=function(e){Pe&&Pe(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Y(e)}catch(e){t=e}}),n.__H=void 0,t&&W.__e(t,n.__v))};var Ve=typeof requestAnimationFrame==`function`;function He(e){var t,n=function(){clearTimeout(r),Ve&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ve&&(t=requestAnimationFrame(n))}function Y(e){var t=V,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),V=t}function X(e){var t=V;e.__c=e.__(),V=t}function Z(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Ue(e,t){return typeof t==`function`?t(e):t}function We(e,t){for(var n in t)e[n]=t[n];return e}function Ge(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function Q(e,t){var n=t(),r=K({t:{__:n,u:t}}),i=r[0].t,a=r[1];return Le(function(){i.__=n,i.u=t,Ke(i)&&a({t:i})},[e,n,t]),q(function(){return Ke(i)&&a({t:i}),e(function(){Ke(i)&&a({t:i})})},[e]),n}function Ke(e){try{return!((t=e.__)===(n=e.u())&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}var t,n}function qe(e,t){this.props=e,this.context=t}(qe.prototype=new O).isPureReactComponent=!0,qe.prototype.shouldComponentUpdate=function(e,t){return Ge(this.props,e)||Ge(this.state,t)};var Je=o.__b;o.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Je&&Je(e)},typeof Symbol<`u`&&Symbol.for;var Ye=o.__e;o.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k||[]),i.__c(e,t)}Ye(e,t,n,r)};var Xe=o.unmount;function Ze(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=We({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ze(e,t,n)})),e}function Qe(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Qe(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function $e(){this.__u=0,this.o=null,this.__b=null}function et(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function $(){this.i=null,this.l=null}o.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Xe&&Xe(e)},($e.prototype=new O).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=et(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Qe(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},$e.prototype.componentWillUnmount=function(){this.o=[]},$e.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=Ze(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&T(D,null,e.fallback);return i&&(i.__u&=-33),[T(D,null,t.__a?null:e.children),i]};var tt=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};($.prototype=new O).__a=function(e){var t=this,n=et(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),tt(t,e,r)):i()};n?n(a):a()}},$.prototype.render=function(e){this.i=null,this.l=new Map;var t=P(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},$.prototype.componentDidUpdate=$.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){tt(e,n,t)})};var nt=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,rt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,it=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,at=/[A-Z0-9]/g,ot=typeof document<`u`,st=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};O.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(O.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ct=o.event;o.event=function(e){return ct&&(e=ct(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var lt={configurable:!0,get:function(){return this.class}},ut=o.vnode;o.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||ot&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||st(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:it.test(a)&&(a=s):s=a=`oninput`:i&&rt.test(a)?a=a.replace(at,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=P(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=P(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",lt)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=nt,ut&&ut(e)};var dt=o.__r;o.__r=function(e){dt&&dt(e),e.__c};var ft=o.diffed;o.diffed=function(e){ft&&ft(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};function pt(){let[t,n]=K(()=>window.FrakSetup?.config?.waitForBackendConfig===!1||e.isResolved),[i,a]=K(()=>e.getConfig().hidden??!1),[o,s]=K(()=>!!window.FrakSetup?.client);return q(()=>{let t=e.getConfig();t.isResolved&&(n(!0),a(t.hidden??!1)),window.FrakSetup?.client&&s(!0);let i=e=>{let t=e.detail;t.isResolved&&n(!0),a(t.hidden??!1)};window.addEventListener(`frak:config`,i);let o=()=>s(!0);return r(`add`,o),()=>{window.removeEventListener(`frak:config`,i),r(`remove`,o)}},[]),{shouldRender:t,isHidden:i,isClientReady:o}}function mt(e){return typeof window>`u`?()=>{}:(window.addEventListener(`frak:config`,e),()=>window.removeEventListener(`frak:config`,e))}function ht(){return Q(mt,()=>e.getConfig().lang??n()??`en`)}const gt=`
|
|
2
|
-
:host {
|
|
3
|
-
display: contents;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:host([hidden]) {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.button:disabled {
|
|
11
|
-
opacity: 0.7;
|
|
12
|
-
cursor: default;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.button__fadeIn {
|
|
16
|
-
animation: frak-fadeIn 300ms ease-in;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@keyframes frak-fadeIn {
|
|
20
|
-
from {
|
|
21
|
-
opacity: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
to {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;function _t(e,t){return t?`${gt}\n${e}\n${t}`:`${gt}\n${e}`}const vt=`
|
|
29
|
-
:where(frak-button-share, frak-open-in-app) {
|
|
30
|
-
display: contents;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:where(frak-button-share .button, frak-open-in-app .button) {
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
gap: 10px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:where(frak-button-share .button:disabled, frak-open-in-app .button:disabled) {
|
|
41
|
-
opacity: 0.7;
|
|
42
|
-
cursor: default;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:where(frak-button-share .button__fadeIn, frak-open-in-app .button__fadeIn) {
|
|
46
|
-
animation: frak-fadeIn 300ms ease-in;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes frak-fadeIn {
|
|
50
|
-
from {
|
|
51
|
-
opacity: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
to {
|
|
55
|
-
opacity: 1;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
`;function yt(t){return e.getConfig().placements?.[t]}function bt(e){return Q(mt,ze(()=>e?yt(e):void 0,[e]))}const xt={en:{buttonShare:{text:`Share & earn {REWARD}!`},postPurchase:{refereeText:`You just earned {REWARD}! Share with friends to earn even more.`,refereeNoRewardText:`You just earned a reward! Share with friends to earn even more.`,referrerText:`Earn {REWARD} by sharing this with your friends!`,referrerNoRewardText:`Share this with your friends and earn rewards!`,ctaText:`Share & earn {REWARD}`,ctaNoRewardText:`Share & earn`},openInApp:{text:`Open in App`,ariaLabel:`Open in Frak Wallet app`},buttonWallet:{ariaLabel:`Open wallet`},banner:{referralTitleReward:`Earn {REWARD} on purchases`,referralTitle:`You've been referred!`,referralDescription:`Earn rewards after your purchase via the Frak partner app.`,referralCta:`Got it`,inappTitle:`Open in your browser`,inappDescription:`For a better experience and to earn your rewards, open this page in your default browser.`,inappCta:`Open browser`,dismissLabel:`Dismiss`}},fr:{buttonShare:{text:`Partagez et gagnez {REWARD} !`},postPurchase:{refereeText:`Vous venez de gagner {REWARD} ! Partagez avec vos amis pour gagner encore plus.`,refereeNoRewardText:`Vous venez de gagner une récompense ! Partagez avec vos amis pour gagner encore plus.`,referrerText:`Gagnez {REWARD} en partageant avec vos amis !`,referrerNoRewardText:`Partagez avec vos amis et gagnez des récompenses !`,ctaText:`Partagez et gagnez {REWARD}`,ctaNoRewardText:`Partagez et gagnez`},openInApp:{text:`Ouvrir dans l'app`,ariaLabel:`Ouvrir dans l'app Frak Wallet`},buttonWallet:{ariaLabel:`Ouvrir le porte-monnaie`},banner:{referralTitleReward:`Gagnez {REWARD} sur vos achats`,referralTitle:`Vous avez été parrainé !`,referralDescription:`Gagnez des récompenses après votre achat via l'application partenaire Frak.`,referralCta:`J'ai compris`,inappTitle:`Ouvrez dans votre navigateur`,inappDescription:`Pour une meilleure expérience et pour gagner vos récompenses, ouvrez cette page dans votre navigateur par défaut.`,inappCta:`Ouvrir le navigateur`,dismissLabel:`Fermer`}}};export{ht as a,Q as c,K as d,q as f,D as g,Te as h,vt as i,Re as l,De as m,bt as n,mt as o,ze as p,_t as r,pt as s,xt as t,J as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e}from"./loader.js";async function t(t,n){if(!window.FrakSetup?.client){console.error(`Frak client not found`);return}let r=window.FrakSetup?.modalWalletConfig??{};await e(window.FrakSetup.client,t?{...r,metadata:{...r.metadata,targetInteraction:t}}:r,n)}export{t};
|
package/cdn/rewards.B2smvfIs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,b as t,v as n,x as r,y as i}from"./loader.js";function a(e){return Array.isArray(e)?e:e.conditions}function o(e){if(typeof e==`number`)return e;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:void 0}}function s(e,t,n){let r=[];for(let i of a(e)){if(`logic`in i){r.push(...s(i,t,n));continue}if(i.field===t&&n.has(i.operator)){let e=o(i.value);e!=null&&r.push(e)}}return r}const c=new Set([`gt`,`gte`,`between`]),l=new Set([`gt`,`gte`]);function u(e){let t=s(e,`purchase.amount`,c);return t.length>0?Math.min(...t):void 0}function d(e){let t=s(e,`time.timestamp`,l);if(t.length!==0)return new Date(Math.min(...t)*1e3)}function f(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`percentage`:return e.maxAmount?.[t]??0;case`tiered`:return e.tiers.reduce((e,n)=>`amount`in n?Math.max(e,n.amount[t]):e,0)}}function p(e){return e.payoutType===`percentage`?e.percent:e.payoutType===`tiered`?e.tiers.reduce((e,t)=>`percent`in t?Math.max(e,t.percent):e,0):0}function m(e,t){let n=f(e,t);return n>0?n:p(e)*1e-6}function h(n,i){let a=e(i),o=r(a);switch(n.payoutType){case`fixed`:return t(Math.round(n.amount[o]),a);case`percentage`:return`${n.percent} %`;case`tiered`:{let e=f(n,o);if(e>0)return t(Math.round(e),a);let r=p(n);return r>0?`${r} %`:t(0,a)}}}function g(t,a){let o=e(a),s=r(o);switch(t.payoutType){case`fixed`:return n(Math.round(t.amount[s]),o);case`percentage`:return i(t.percent);case`tiered`:{let e=f(t,s);if(e>0)return n(Math.round(e),o);let r=p(t);return r>0?i(r):n(0,o)}}}function _(t,n){if(t&&!(m(t,r(e(n)))<=0))return h(t,n)}function v(e,t){return t?e.replaceAll(`{REWARD}`,t):e.replaceAll(`{REWARD}`,``)}const y=new Set([`eq`,`neq`,`gt`,`gte`,`lt`,`lte`,`between`]),b=new Set([`contains`,`starts_with`,`ends_with`]);function x(e){return`logic`in e&&`conditions`in e}function S(e,t){return e[t]}function C(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:void 0}}function w(e,t){let n=C(e),r=C(t);return n!==void 0&&r!==void 0?n-r:String(e).localeCompare(String(t))}function T(e,t,n){if(!Array.isArray(n))return e===`not_in`;if(t===void 0)return;let r=n.includes(t);return e===`in`?r:!r}function E(e,t,n,r){switch(e){case`eq`:return t===n;case`neq`:return t!==n;case`gt`:return w(t,n)>0;case`gte`:return w(t,n)>=0;case`lt`:return w(t,n)<0;case`lte`:return w(t,n)<=0;case`between`:return r==null||Array.isArray(r)?void 0:w(t,n)>=0&&w(t,r)<=0}}function D(e,t,n){if(typeof t==`string`&&typeof n==`string`)return e===`contains`?t.includes(n):e===`starts_with`?t.startsWith(n):t.endsWith(n)}function O(e,t){let n=S(t,e.field),{operator:r,value:i,valueTo:a}=e;if(r===`exists`)return n!==void 0;if(r===`not_exists`)return n===void 0;if(r===`in`||r===`not_in`)return T(r,n,i);if(!(Array.isArray(i)||n===void 0||i===null)){if(y.has(r))return E(r,n,i,a);if(b.has(r))return D(r,n,i)}}function k(e,t){if(x(e)){let n=e.conditions.map(e=>k(e,t));return e.logic===`all`?n.every(Boolean):e.logic===`any`?n.some(Boolean):e.logic!==`none`||!n.some(Boolean)}return O(e,t)??!0}function A(e,t){return e?Array.isArray(e)?e.every(e=>k(e,t)):k(e,t):!0}function j(e,t){return e.expiresAt!=null&&new Date(e.expiresAt).getTime()<=t}function M(e,t){let n=d(e.conditions);return n==null||n.getTime()<=t}function N(e,t){return t===`referee`?e.referee:e.referrer}function P(e,t,n){let r=N(e,n);return r?m(r,t):0}function F(e,t){if(!t||t.length===0||!e.productScope)return;let n=t.filter(t=>A(e.productScope,t));return n.length>0?n:void 0}function I(e,t){return!t||t.length===0||!e.productScope||t.some(t=>A(e.productScope,t))}function L(t,n={}){let i=(n.now??new Date).getTime(),a=n.audience??`referrer`,o=r(e(n.currency)),s=(n.targetInteraction?t.filter(e=>e.interactionTypeKey===n.targetInteraction):t).filter(e=>!j(e,i)),c=s.filter(e=>M(e,i));if(c.length>0){let e=c.reduce((e,t)=>{let r=I(e,n.products),i=I(t,n.products);return r===i?P(t,o,a)>P(e,o,a)?t:e:i?t:e});return{campaign:e,status:`live`,matchedProducts:F(e,n.products)}}let l=s.map(e=>({campaign:e,startsAt:d(e.conditions)})).filter(e=>e.startsAt!=null);if(l.length===0)return;let u=l.reduce((e,t)=>{let r=I(e.campaign,n.products),i=I(t.campaign,n.products);return r===i?t.startsAt.getTime()<e.startsAt.getTime()?t:e:i?t:e});return{campaign:u.campaign,status:`upcoming`,startsAt:u.startsAt,matchedProducts:F(u.campaign,n.products)}}function R(e,n={}){let r=L(e,n);if(!r)return;let i=N(r.campaign,n.audience??`referrer`);if(!i)return;let a=_(i,n.currency);if(!a)return;let o=u(r.campaign.conditions),s=o==null?void 0:t(o,n.currency),c=r.campaign.defaultLockupSeconds,l=c&&c>0?Math.round(c/86400):void 0;return{formatted:a,parts:g(i,n.currency),payoutType:i.payoutType,minPurchaseAmount:s,lockupDurationDays:l,referrerReward:r.campaign.referrer,refereeReward:r.campaign.referee,minPurchaseValue:o??void 0,isProductScoped:r.campaign.productScope!=null,matchedProducts:r.matchedProducts}}export{v as i,L as n,R as r,_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e}from"./loader.js";import{c as t,o as n}from"./defaults.BEvoSiy5.js";function r(){return t(n,()=>e.getConfig().components)}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as e}from"./loader.js";import{f as t,i as n}from"./defaults.BEvoSiy5.js";function r(r,i,a,o,s){t(()=>{s&&e.injectBase(`shared`,s),e.injectBase(r,o??n)},[r]),t(()=>{!i||!a||e.injectPlacement(r,i,a)},[r,i,a])}export{r as t};
|