@frak-labs/components 1.0.12-beta.ca3911f0 → 1.0.12-beta.dfcc05ea

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/cdn/Banner.Dl3YwoEL.js +183 -0
  2. package/cdn/ButtonShare.B1CGO6_9.js +1 -0
  3. package/cdn/ButtonWallet.BJmwiurL.js +40 -0
  4. package/cdn/{GiftIcon.DT1i36Fm.js → GiftIcon.C2M59Q4m.js} +1 -1
  5. package/cdn/OpenInAppButton.D7NlWUqu.js +1 -0
  6. package/cdn/PostPurchase.CA3F9d3o.js +89 -0
  7. package/cdn/actions-CMPlZ7CH.DZFAhfKm.js +1 -0
  8. package/cdn/clientReady.CPe9C8dP.js +1 -0
  9. package/cdn/components.js +1 -1
  10. package/cdn/defaults.Cc2Npf8m.js +58 -0
  11. package/cdn/embeddedWallet.D3GODltA.js +1 -0
  12. package/cdn/loader.js +1 -154
  13. package/cdn/rewards.BHoSugMr.js +1 -0
  14. package/cdn/sharedBaseCss.css.BDzFcWnD.js +154 -0
  15. package/cdn/sharingPage.B8z2OScU.js +1 -0
  16. package/cdn/sharingPageProducts.Be0kIfZy.js +1 -0
  17. package/cdn/src-Bigq2qnT.CyWI_ZK9.js +1 -0
  18. package/cdn/styleManager.Cun1-fKi.js +1 -0
  19. package/cdn/useGlobalComponents.ChIY6Foy.js +1 -0
  20. package/cdn/useLightDomStyles.BHMFG8TC.js +1 -0
  21. package/cdn/useReward.Dn6zovBQ.js +1 -0
  22. package/dist/{GiftIcon-BEzYdiux.js → GiftIcon-BhL0bhVu.js} +10 -4
  23. package/dist/banner.d.ts +1 -16
  24. package/dist/banner.js +24 -8
  25. package/dist/buttonShare.d.ts +1 -10
  26. package/dist/buttonShare.js +6 -6
  27. package/dist/buttonWallet.d.ts +1 -7
  28. package/dist/buttonWallet.js +3 -3
  29. package/dist/i18n/defaults.d.ts +3 -2
  30. package/dist/openInApp.d.ts +1 -5
  31. package/dist/openInApp.js +2 -2
  32. package/dist/postPurchase.d.ts +1 -19
  33. package/dist/postPurchase.js +5 -5
  34. package/dist/{rewards-VoZGH2Ko.js → rewards-BtPHdGcI.js} +4 -3
  35. package/dist/{useGlobalComponents-CZ7Sh2tZ.js → useGlobalComponents-Cl7MBkeo.js} +1 -1
  36. package/dist/{useLightDomStyles-DphuQhvx.js → useLightDomStyles-CyWohXRl.js} +1 -1
  37. package/dist/{useReward-BGgymGoH.js → useReward-B-yZ7nhY.js} +1 -1
  38. package/package.json +5 -5
  39. package/cdn/Banner.CgCiMrqn.js +0 -167
  40. package/cdn/ButtonShare.DJqup6VY.js +0 -1
  41. package/cdn/ButtonWallet.BKuPBrKl.js +0 -40
  42. package/cdn/OpenInAppButton.D1UzTuHx.js +0 -1
  43. package/cdn/PostPurchase.CkqSCboo.js +0 -89
  44. package/cdn/defaults.kWEdCyGS.js +0 -58
  45. package/cdn/embeddedWallet.CDUxjdX2.js +0 -1
  46. package/cdn/rewards.CIu9qbmI.js +0 -1
  47. package/cdn/useGlobalComponents.BC6Jgzg5.js +0 -1
  48. package/cdn/useLightDomStyles.imPXuAtf.js +0 -1
  49. package/cdn/useReward.BAmvPaVu.js +0 -1
  50. /package/cdn/{replay-V6FXES7X.CNozpSRg.js → replay-V6FXES7X.CgBxdfNp.js} +0 -0
  51. /package/dist/{embeddedWallet-By3_p5Xc.js → embeddedWallet-CxgyuwtP.js} +0 -0
  52. /package/dist/{usePlacement-4PoDbn2X.js → usePlacement-BhNse5cN.js} +0 -0
@@ -1,9 +1,9 @@
1
- import { i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-4PoDbn2X.js";
2
- import { t as openEmbeddedWallet } from "./embeddedWallet-By3_p5Xc.js";
3
- import { t as useGlobalComponents } from "./useGlobalComponents-CZ7Sh2tZ.js";
4
- import { t as useLightDomStyles } from "./useLightDomStyles-DphuQhvx.js";
5
- import { r as b } from "./rewards-VoZGH2Ko.js";
6
- import { t as useReward } from "./useReward-BGgymGoH.js";
1
+ import { i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-BhNse5cN.js";
2
+ import { t as openEmbeddedWallet } from "./embeddedWallet-CxgyuwtP.js";
3
+ import { t as useGlobalComponents } from "./useGlobalComponents-Cl7MBkeo.js";
4
+ import { t as useLightDomStyles } from "./useLightDomStyles-CyWohXRl.js";
5
+ import { r as b } from "./rewards-BtPHdGcI.js";
6
+ import { t as useReward } from "./useReward-B-yZ7nhY.js";
7
7
  import { componentDefaults } from "./i18n/defaults.js";
8
8
  import { trackEvent } from "@frak-labs/core-sdk";
9
9
  import { useCallback, useMemo } from "preact/hooks";
@@ -1,5 +1,4 @@
1
1
  import { InteractionTypeKey } from "@frak-labs/core-sdk";
2
-
3
2
  //#region src/components/ButtonWallet/types.d.ts
4
3
  /**
5
4
  * The props type for {@link ButtonWallet}.
@@ -64,12 +63,7 @@ type ButtonWalletProps = {
64
63
  * @see {@link @frak-labs/core-sdk!actions.modalBuilder | `modalBuilder()`} for more info about the modal display
65
64
  * @see {@link @frak-labs/core-sdk!actions.getMerchantInformation | `getMerchantInformation()`} for more info about the estimated reward fetching
66
65
  */
67
- declare function ButtonWallet({
68
- placement: placementId,
69
- classname,
70
- useReward: rawUseReward,
71
- targetInteraction
72
- }: ButtonWalletProps): import("preact").JSX.Element | null;
66
+ declare function ButtonWallet({ placement: placementId, classname, useReward: rawUseReward, targetInteraction }: ButtonWalletProps): import("preact").JSX.Element | null;
73
67
  //#endregion
74
68
  //#region src/components/ButtonWallet/index.d.ts
75
69
  /**
@@ -1,6 +1,6 @@
1
- import { i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-4PoDbn2X.js";
2
- import { t as openEmbeddedWallet } from "./embeddedWallet-By3_p5Xc.js";
3
- import { t as useReward } from "./useReward-BGgymGoH.js";
1
+ import { i as useLang, n as buildStyleContent, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-BhNse5cN.js";
2
+ import { t as openEmbeddedWallet } from "./embeddedWallet-CxgyuwtP.js";
3
+ import { t as useReward } from "./useReward-B-yZ7nhY.js";
4
4
  import { componentDefaults } from "./i18n/defaults.js";
5
5
  import { useEffect, useMemo, useState } from "preact/hooks";
6
6
  import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
@@ -1,5 +1,4 @@
1
1
  import { Language } from "@frak-labs/core-sdk";
2
-
3
2
  //#region src/i18n/defaults.d.ts
4
3
  /**
5
4
  * Shape of the built-in copy for every SDK Web Component. Declared explicitly
@@ -26,7 +25,9 @@ type ComponentCopy = {
26
25
  ariaLabel: string;
27
26
  };
28
27
  banner: {
29
- /** Referral title used when an estimated reward is available (carries the `{REWARD}` token). */referralTitleReward: string; /** Referral title used when no reward could be resolved. */
28
+ /** Referral title used when an estimated reward is available (carries the `{REWARD}` token). */
29
+ referralTitleReward: string;
30
+ /** Referral title used when no reward could be resolved. */
30
31
  referralTitle: string;
31
32
  referralDescription: string;
32
33
  referralCta: string;
@@ -45,11 +45,7 @@ type OpenInAppButtonProps = {
45
45
  * <frak-open-in-app classname="button button-primary"></frak-open-in-app>
46
46
  * ```
47
47
  */
48
- declare function OpenInAppButton({
49
- placement: placementId,
50
- text,
51
- classname
52
- }: OpenInAppButtonProps): import("preact").JSX.Element | null;
48
+ declare function OpenInAppButton({ placement: placementId, text, classname }: OpenInAppButtonProps): import("preact").JSX.Element | null;
53
49
  //#endregion
54
50
  //#region src/components/OpenInAppButton/index.d.ts
55
51
  /**
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-4PoDbn2X.js";
2
- import { t as useLightDomStyles } from "./useLightDomStyles-DphuQhvx.js";
1
+ import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-BhNse5cN.js";
2
+ import { t as useLightDomStyles } from "./useLightDomStyles-CyWohXRl.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";
@@ -1,5 +1,4 @@
1
1
  import { SharingPageProduct } from "@frak-labs/core-sdk";
2
-
3
2
  //#region src/components/PostPurchase/types.d.ts
4
3
  /**
5
4
  * Props for the {@link PostPurchase} component.
@@ -125,24 +124,7 @@ type PostPurchaseProps = {
125
124
  * ></frak-post-purchase>
126
125
  * ```
127
126
  */
128
- declare function PostPurchase({
129
- customerId,
130
- orderId,
131
- token,
132
- sharingUrl,
133
- merchantId,
134
- placement: placementId,
135
- classname,
136
- variant: forcedVariant,
137
- badgeText: propBadgeText,
138
- referrerText: propReferrerText,
139
- refereeText: propRefereeText,
140
- ctaText: propCtaText,
141
- preview,
142
- previewVariant,
143
- products,
144
- imageUrl: propImageUrl
145
- }: PostPurchaseProps): import("preact").JSX.Element | null;
127
+ declare function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, placement: placementId, classname, variant: forcedVariant, badgeText: propBadgeText, referrerText: propReferrerText, refereeText: propRefereeText, ctaText: propCtaText, preview, previewVariant, products, imageUrl: propImageUrl }: PostPurchaseProps): import("preact").JSX.Element | null;
146
128
  //#endregion
147
129
  //#region src/components/PostPurchase/index.d.ts
148
130
  /**
@@ -1,9 +1,9 @@
1
- import { c as sanitizeProductList, i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-4PoDbn2X.js";
2
- import { t as useGlobalComponents } from "./useGlobalComponents-CZ7Sh2tZ.js";
3
- import { t as useLightDomStyles } from "./useLightDomStyles-DphuQhvx.js";
4
- import { i as y, n as T, r as b } from "./rewards-VoZGH2Ko.js";
1
+ import { c as sanitizeProductList, i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-BhNse5cN.js";
2
+ import { t as useGlobalComponents } from "./useGlobalComponents-Cl7MBkeo.js";
3
+ import { t as useLightDomStyles } from "./useLightDomStyles-CyWohXRl.js";
4
+ import { i as y, n as T, r as b } from "./rewards-BtPHdGcI.js";
5
5
  import { componentDefaults } from "./i18n/defaults.js";
6
- import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-BEzYdiux.js";
6
+ import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-BhL0bhVu.js";
7
7
  import { 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";
@@ -1,4 +1,4 @@
1
- //#region ../core/dist/getCurrencyAmountKey-DQcwjJiB.js
1
+ //#region ../core/dist/getCurrencyAmountKey-C-1W-BRg.js
2
2
  const e = {
3
3
  eur: `fr-FR`,
4
4
  usd: `en-US`,
@@ -48,11 +48,12 @@ function a(e, t, n) {
48
48
  }
49
49
  return o;
50
50
  }
51
- const o = new Set([
51
+ const o = /* @__PURE__ */ new Set([
52
52
  `gt`,
53
53
  `gte`,
54
54
  `between`
55
- ]), s = new Set([`gt`, `gte`]);
55
+ ]);
56
+ const s = /* @__PURE__ */ new Set([`gt`, `gte`]);
56
57
  function c(e) {
57
58
  let t = a(e, `purchase.amount`, o);
58
59
  return t.length > 0 ? Math.min(...t) : void 0;
@@ -1,4 +1,4 @@
1
- import { a as subscribeSdkConfig } from "./usePlacement-4PoDbn2X.js";
1
+ import { a as subscribeSdkConfig } from "./usePlacement-BhNse5cN.js";
2
2
  import { sdkConfigStore } from "@frak-labs/core-sdk";
3
3
  import { useSyncExternalStore } from "preact/compat";
4
4
  //#region src/hooks/useGlobalComponents.ts
@@ -1,4 +1,4 @@
1
- import { r as lightDomBaseCss } from "./usePlacement-4PoDbn2X.js";
1
+ import { r as lightDomBaseCss } from "./usePlacement-BhNse5cN.js";
2
2
  import { useEffect } from "preact/hooks";
3
3
  //#region src/styles/styleManager.ts
4
4
  function ensureStyle(id, css) {
@@ -1,4 +1,4 @@
1
- import { t as E } from "./rewards-VoZGH2Ko.js";
1
+ import { t as E } from "./rewards-BtPHdGcI.js";
2
2
  import { getMerchantInformation } from "@frak-labs/core-sdk/actions";
3
3
  import { useEffect, useState } from "preact/hooks";
4
4
  //#region src/hooks/useReward.ts
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "1.0.12-beta.ca3911f0",
14
+ "version": "1.0.12-beta.dfcc05ea",
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",
@@ -92,8 +92,8 @@
92
92
  "publish": "echo 'Publishing components...'"
93
93
  },
94
94
  "dependencies": {
95
- "@frak-labs/core-sdk": "1.2.0-beta.ca3911f0",
96
- "@frak-labs/frame-connector": "0.2.0-beta.ca3911f0",
95
+ "@frak-labs/core-sdk": "1.2.0-beta.dfcc05ea",
96
+ "@frak-labs/frame-connector": "0.2.0-beta.dfcc05ea",
97
97
  "preact": "^10.29.0",
98
98
  "preact-custom-element": "^4.6.0",
99
99
  "@frak-labs/design-system": "0.0.0"
@@ -109,10 +109,10 @@
109
109
  "@types/node": "^25.6.0",
110
110
  "@types/preact-custom-element": "^4.0.4",
111
111
  "@typescript/native": "npm:typescript@^7.0.2",
112
- "@vanilla-extract/css": "^1.20.1",
112
+ "@vanilla-extract/css": "^1.21.1",
113
113
  "@vanilla-extract/integration": "^8.0.10",
114
114
  "@vanilla-extract/sprinkles": "^1.6.5",
115
- "@vanilla-extract/vite-plugin": "^5.2.1",
115
+ "@vanilla-extract/vite-plugin": "^5.2.4",
116
116
  "@vitest/coverage-v8": "^4.1.0",
117
117
  "@vitest/ui": "^4.1.0",
118
118
  "jsdom": "^29.0.0",
@@ -1,167 +0,0 @@
1
- import{T as e,b as t,f as n,h as r,s as i,u as a}from"./loader.js";import{a as o,d as s,f as c,h as l,l as u,m as d,n as ee,p as f,s as te,t as p,u as m}from"./defaults.kWEdCyGS.js";import{a as h,i as g,n as _,r as v,t as y}from"./GiftIcon.DT1i36Fm.js";import{t as b}from"./useGlobalComponents.BC6Jgzg5.js";import{t as ne}from"./useLightDomStyles.imPXuAtf.js";import{r as x}from"./rewards.CIu9qbmI.js";import{t as re}from"./useReward.BAmvPaVu.js";const S=`@keyframes keyframes_fadeIn__mnqmlt0 {
2
- from {
3
- opacity: 0;
4
- transform: translateY(-4px);
5
- }
6
- to {
7
- opacity: 1;
8
- transform: translateY(0);
9
- }
10
- }`,C=`.inAppBanner_container__1ibpiy70 {
11
- position: fixed;
12
- top: max(8px, env(safe-area-inset-top));
13
- left: 16px;
14
- right: 16px;
15
- z-index: 1000;
16
- display: flex;
17
- flex-direction: column;
18
- gap: 4px;
19
- padding: 12px 16px;
20
- padding-right: 32px;
21
- border-radius: 12px;
22
- background-color: #000000cc;
23
- backdrop-filter: blur(12px);
24
- -webkit-backdrop-filter: blur(12px);
25
- color: var(--text-onAction__pbq4ak6);
26
- animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
27
- }
28
- .inAppBanner_header__1ibpiy71 {
29
- display: flex;
30
- align-items: center;
31
- gap: 8px;
32
- }
33
- .inAppBanner_iconWrapper__1ibpiy72 {
34
- flex-shrink: 0;
35
- width: 20px;
36
- height: 20px;
37
- display: flex;
38
- align-items: center;
39
- justify-content: center;
40
- color: var(--text-onAction__pbq4ak6);
41
- }
42
- .inAppBanner_title__1ibpiy73 {
43
- margin: 0;
44
- padding: 0;
45
- font-size: 16px;
46
- font-weight: 500;
47
- line-height: 26px;
48
- color: var(--text-onAction__pbq4ak6);
49
- }
50
- .inAppBanner_body__1ibpiy74 {
51
- display: flex;
52
- flex-wrap: wrap;
53
- align-items: baseline;
54
- gap: 0 4px;
55
- }
56
- .inAppBanner_description__1ibpiy75 {
57
- margin: 0;
58
- padding: 0;
59
- font-size: 14px;
60
- color: var(--text-onAction__pbq4ak6);
61
- line-height: 22px;
62
- opacity: 0.96;
63
- }
64
- .inAppBanner_cta__1ibpiy76 {
65
- all: unset;
66
- display: inline-flex;
67
- align-items: center;
68
- gap: 4px;
69
- color: #2bb2ff;
70
- font-size: 14px;
71
- font-weight: 600;
72
- text-decoration: underline;
73
- text-underline-offset: 2px;
74
- cursor: pointer;
75
- }
76
- .inAppBanner_cta__1ibpiy76:focus-visible {
77
- outline: 2px solid #2bb2ff;
78
- outline-offset: 2px;
79
- border-radius: 4px;
80
- }
81
- .inAppBanner_closeButton__1ibpiy77 {
82
- all: unset;
83
- position: absolute;
84
- top: 8px;
85
- right: 8px;
86
- width: 28px;
87
- height: 28px;
88
- display: flex;
89
- align-items: center;
90
- justify-content: center;
91
- border-radius: 9999px;
92
- color: #ffffff99;
93
- cursor: pointer;
94
- }
95
- .inAppBanner_closeButton__1ibpiy77:focus-visible {
96
- outline: 2px solid var(--text-onAction__pbq4ak6);
97
- outline-offset: 2px;
98
- }`;var w=`inAppBanner_body__1ibpiy74`,T=`inAppBanner_closeButton__1ibpiy77`,E=`inAppBanner_container__1ibpiy70`,D=`inAppBanner_cta__1ibpiy76`,O=`inAppBanner_description__1ibpiy75`,k=`inAppBanner_header__1ibpiy71`,A=`inAppBanner_iconWrapper__1ibpiy72`,j=`inAppBanner_title__1ibpiy73`;S+C;function M({title:e,description:t,cta:n,dismissLabel:r,onAction:i,onDismiss:a,className:o,classNames:s}){return d(`div`,{className:`${E}${o?` ${o}`:``}`,role:`alert`,children:[d(`div`,{className:k,children:[d(`span`,{className:`${A}${s?.icon?` ${s.icon}`:``}`,children:d(_,{width:20,height:20})}),d(`p`,{className:`${j}${s?.title?` ${s.title}`:``}`,children:e})]}),d(`div`,{className:w,children:[d(`p`,{className:`${O}${s?.description?` ${s.description}`:``}`,children:t}),d(`button`,{type:`button`,className:`${D}${s?.cta?` ${s.cta}`:``}`,onClick:i,children:[n,d(g,{width:14,height:14})]})]}),d(`button`,{type:`button`,className:`${T}${s?.close?` ${s.close}`:``}`,onClick:a,"aria-label":r,children:d(h,{width:16,height:16})})]})}var ie=`Banner_frakLogo__1gnumzi9`,ae=`Banner_iconSvg__1gnumzi1`,oe=`Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0`,se=`Banner_referralBody__1gnumzi5`,ce=`Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0`,le=`Banner_referralDescription__1gnumzi7 reset_base__1831jhd0`,ue=`Banner_referralIconWrapper__1gnumzi3`,N=`Banner_referralImage__1gnumzi4`,P=`Banner_referralTitle__1gnumzi6 reset_base__1831jhd0`;const F=S+C+`.Banner_rootBase__1gnumzi0 {
99
- position: relative;
100
- display: flex;
101
- animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
102
- }
103
- .Banner_iconSvg__1gnumzi1 {
104
- width: 100%;
105
- height: 100%;
106
- }
107
- .Banner_referral__1gnumzi2 {
108
- flex-direction: row;
109
- align-items: center;
110
- gap: 16px;
111
- padding: 16px;
112
- background-color: #ffffff;
113
- color: var(--text-primary__pbq4ak0);
114
- border: 1px solid var(--border-default__pbq4akv);
115
- border-radius: 12px;
116
- }
117
- .Banner_referralIconWrapper__1gnumzi3 {
118
- flex-shrink: 0;
119
- align-self: flex-start;
120
- display: flex;
121
- align-items: center;
122
- justify-content: center;
123
- width: 40px;
124
- height: 40px;
125
- overflow: hidden;
126
- }
127
- .Banner_referralImage__1gnumzi4 {
128
- max-width: 100%;
129
- max-height: 100%;
130
- width: auto;
131
- height: auto;
132
- object-fit: contain;
133
- display: block;
134
- }
135
- .Banner_referralBody__1gnumzi5 {
136
- flex: 1;
137
- min-width: 0;
138
- }
139
- .Banner_referralTitle__1gnumzi6 {
140
- font-size: 16px;
141
- font-weight: 600;
142
- color: var(--text-primary__pbq4ak0);
143
- line-height: 22px;
144
- }
145
- .Banner_referralDescription__1gnumzi7 {
146
- margin-bottom: 8px;
147
- font-size: 14px;
148
- color: #979797;
149
- line-height: 22px;
150
- }
151
- .Banner_referralCta__1gnumzi8 {
152
- display: inline-block;
153
- padding: 8px 16px;
154
- border: 1px solid #000000;
155
- border-radius: 9999px;
156
- color: var(--text-primary__pbq4ak0);
157
- font-size: 10px;
158
- font-weight: 700;
159
- line-height: 12px;
160
- text-transform: uppercase;
161
- }
162
- .Banner_frakLogo__1gnumzi9 {
163
- position: absolute;
164
- right: 16px;
165
- bottom: 12px;
166
- pointer-events: none;
167
- }`;function I({placement:l,classname:h=``,interaction:g,referralTitle:_,referralDescription:S,referralCta:C,inappTitle:w,inappDescription:T,inappCta:E,imageUrl:D,preview:O,previewMode:k,allowInappRedirect:A}){let j=!!O,I=o(),L=k===`inapp`?`inapp`:`referral`,R=A===!0||A===`true`,z=ee(l),{shouldRender:B,isHidden:V,isClientReady:H}=te();ne(`frak-banner`,l,z?.components?.banner?.css,F,e);let[U,W]=s(!1),[G,K]=s(()=>j?L:R&&r?`inapp`:null),q=u(null);f(()=>{j&&K(L)},[j,L]);let{reward:J}=re(G===`referral`&&H,g,`referee`),[Y,de]=s(null);f(()=>{let e=window.FrakSetup?.client;G!==`inapp`||j||!H||!e||i(e).then(e=>de(e)).catch(()=>{})},[G,j,H]),f(()=>{j||!G||U||q.current!==G&&H&&(t(window.FrakSetup?.client,`banner_impression`,{placement:l,variant:G,has_reward:G===`referral`?!!J:void 0}),q.current=G)},[G,U,H,j,l]),f(()=>{if(j||G===`inapp`)return;let e=()=>K(`referral`);return window.addEventListener(a,e),()=>window.removeEventListener(a,e)},[j,G]);let X=c(async()=>{if(j)return;if(t(window.FrakSetup?.client,`banner_resolved`,{placement:l,variant:G??`referral`,outcome:`clicked`}),G===`referral`){W(!0);return}let e=Y;if(!e&&window.FrakSetup?.client)try{e=await i(window.FrakSetup?.client)}catch{}let r=window.location.href;if(e){let t=new URL(r);t.searchParams.set(`fmt`,e),r=t.toString()}n(r)},[j,G,Y,l]),fe=c(()=>{j||(t(window.FrakSetup?.client,`banner_resolved`,{placement:l,variant:G??`referral`,outcome:`dismissed`}),W(!0))},[j,G,l]),pe=b(),Z=z?.components?.banner??pe?.banner,Q=D??Z?.imageUrl,$=m(()=>{let e=p[I].banner;if(G===`referral`){let t=J?e.referralTitleReward:e.referralTitle;return{title:x(_??Z?.referralTitle??t,J),description:x(S??Z?.referralDescription??e.referralDescription,J),cta:C??Z?.referralCta??e.referralCta}}return{title:x(w??Z?.inappTitle??e.inappTitle,void 0),description:x(T??Z?.inappDescription??e.inappDescription,void 0),cta:E??Z?.inappCta??e.inappCta}},[I,G,J,Z,_,S,C,w,T,E]);if(!G||!j&&(!B||V||U))return null;let me=[oe,`frak-banner`,`frak-banner--${G}`,h].filter(Boolean).join(` `);return G===`inapp`?d(M,{title:$.title,description:$.description,cta:$.cta,dismissLabel:p[I].banner.dismissLabel,onAction:X,onDismiss:fe,className:[`frak-banner`,`frak-banner--inapp`,h].filter(Boolean).join(` `),classNames:{icon:`frak-banner__icon`,title:`frak-banner__title`,description:`frak-banner__description`,cta:`frak-banner__cta`,close:`frak-banner__close`}}):d(`div`,{class:me,role:`alert`,children:[d(`div`,{class:`${ue} frak-banner__icon`,children:Q?d(`img`,{src:Q,alt:``,class:N}):d(y,{class:ae})}),d(`div`,{class:`${se} frak-banner__text`,children:[d(`p`,{class:`${P} frak-banner__title`,children:$.title}),d(`p`,{class:`${le} frak-banner__description`,children:$.description}),d(`button`,{type:`button`,class:`${ce} frak-banner__cta`,onClick:X,children:$.cta})]}),d(v,{class:`${ie} frak-banner__logo`,width:42,height:24})]})}l(I,`frak-banner`,[`placement`,`classname`,`interaction`,`referralTitle`,`referralDescription`,`referralCta`,`inappTitle`,`inappDescription`,`inappCta`,`preview`,`previewMode`,`imageUrl`,`allowInappRedirect`],{shadow:!1});export{I as Banner};
@@ -1 +0,0 @@
1
- import{b as e,i as t}from"./loader.js";import{a as n,f as r,h as i,m as a,n as o,s,t as c,u as l}from"./defaults.kWEdCyGS.js";import{t as u}from"./useGlobalComponents.BC6Jgzg5.js";import{t as d}from"./useLightDomStyles.imPXuAtf.js";import{r as f}from"./rewards.CIu9qbmI.js";import{t as p}from"./useReward.BAmvPaVu.js";import{t as m}from"./embeddedWallet.CDUxjdX2.js";function h({placement:i,text:h,classname:g=``,noRewardText:_,targetInteraction:v,clickAction:y,preview:b}){let x=!!b,S=n(),C=o(i),w=u(),T=C?.components?.buttonShare??w?.buttonShare;d(`frak-button-share`,i,T?.css);let E=l(()=>C?.targetInteraction===void 0?v:C.targetInteraction,[C?.targetInteraction,v]),D=T?.text??h??c[S].buttonShare.text,O=T?.noRewardText??_,k=l(()=>D.includes(`{REWARD}`),[D]),A=l(()=>T?.clickAction??y??`sharing-page`,[T?.clickAction,y]),{shouldRender:j,isHidden:M,isClientReady:N}=s(),{reward:P}=p(k&&N,E),F=l(()=>k?P?f(D,P):O??f(D,void 0):D,[k,D,O,P]),I=r(()=>{if(!x){if(e(window.FrakSetup.client,`share_button_clicked`,{placement:i,target_interaction:E,has_reward:!!P,click_action:A}),A===`embedded-wallet`){m(E,i);return}t(E,i)}},[x,A,E,i,P]);if(!x&&(!j||M))return null;let L=[`button`,`button__fadeIn`,g].filter(Boolean).join(` `);return a(`button`,{type:`button`,disabled:!x&&!N,class:L,onClick:I,children:F})}i(h,`frak-button-share`,[`text`,`placement`,`classname`,`clickAction`,`noRewardText`,`targetInteraction`,`preview`],{shadow:!1});export{h as ButtonShare};
@@ -1,40 +0,0 @@
1
- import{a as e,d as t,g as n,h as r,m as i,n as a,p as o,r as s,s as c,t as l,u}from"./defaults.kWEdCyGS.js";import{t as d}from"./useReward.BAmvPaVu.js";import{t as f}from"./embeddedWallet.CDUxjdX2.js";function p(e){return i(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[i(`title`,{children:`Gift icon`}),i(`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:r,classname:f=``,useReward:m,targetInteraction:g}){let _=e(),v=a(r),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(o(()=>{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 i(n,{children:[i(`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)}),i(`button`,{type:`button`,"aria-label":l[_].buttonWallet.ariaLabel,part:`button`,disabled:!C,class:D,onClick:()=>{h(y,r)},children:[i(p,{}),w&&i(`span`,{class:`reward`,children:w})]})]})}r(g,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{g as ButtonWallet};
@@ -1 +0,0 @@
1
- import{b as e,d as t,m as n,p 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.kWEdCyGS.js";import{t as d}from"./useLightDomStyles.imPXuAtf.js";function f(t=`wallet`,i){let a=window.FrakSetup?.client;a&&e(a,`open_in_app_clicked`,{path:t,placement:i}),n(`${r}${t}`,{onFallback:()=>{a&&e(a,`app_not_installed`,{path:t,placement:i})}})}function p(){return{isMobile:u(()=>t(),[])}}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{S as e,T as t,a as n,b as r,c as i,i as a,o,r as ee,x as s}from"./loader.js";import{a as c,d as l,f as te,h as u,l as ne,m as d,n as f,p,s as m,t as h,u as g}from"./defaults.kWEdCyGS.js";import{r as re,t as ie}from"./GiftIcon.DT1i36Fm.js";import{t as ae}from"./useGlobalComponents.BC6Jgzg5.js";import{t as oe}from"./useLightDomStyles.imPXuAtf.js";import{i as se,n as _,r as v}from"./rewards.CIu9qbmI.js";var y=`PostPurchase_card__5fv5lh0`,ce=`PostPurchase_cardLayout__5fv5lh1`,b=`PostPurchase_cardLeft__5fv5lh2`,x=`PostPurchase_cardRight__5fv5lh3`,S=`PostPurchase_cta__5fv5lh6 sharedBaseCss_buttonReset__7cswil0`,le=`PostPurchase_customImage__5fv5lha`,ue=`PostPurchase_frakLogo__5fv5lhb`,de=`PostPurchase_giftIcon__5fv5lh8`,fe=`PostPurchase_icon__5fv5lh7`,pe=`PostPurchase_imageWrapper__5fv5lh9`,me=`PostPurchase_message__5fv5lh5`;function he(e,t,n){let r=e?.isReferred?`referee`:`referrer`,i=_(t.rewards,{targetInteraction:`purchase`,currency:n,audience:r});if(!i)return null;let{campaign:a}=i,o=e?.isReferred&&a.referee?`referee`:`referrer`;return{variant:o,reward:o===`referee`?a.referee:a.referrer,merchantDomain:t.onChainMetadata.domain}}function C({customerId:u,orderId:_,token:C,sharingUrl:ge,merchantId:w,placement:T,classname:E=``,variant:D,badgeText:O,referrerText:k,refereeText:A,ctaText:j,preview:M,previewVariant:N,products:P,imageUrl:F}){let I=!!M,{shouldRender:L,isHidden:R,isClientReady:z}=m(),B=f(T),V=c();oe(`frak-post-purchase`,T,B?.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
- }`,t);let[H,_e]=l(null),[U,W]=l(!1);p(()=>{I||!z||!u||!_||!C||n({customerId:u,orderId:_,token:C,merchantId:w}).catch(()=>{})},[I,z,u,_,C,w]),p(()=>{if(I||!z||U)return;let t=window.FrakSetup?.client;t&&Promise.all([o(t),i(t)]).then(([e,n])=>{W(!0),_e(he(e,n,t.config.metadata?.currency))}).catch(t=>{if(t instanceof e&&t.code===s.configError){W(!0);return}console.warn(`[Frak] Post-purchase context error`,t)})},[I,z,U]);let G=ne(null),K=D??H?.variant??(I?N??`referrer`:void 0),q=ge??H?.merchantDomain,J=g(()=>{if(!H?.reward)return;let e=window.FrakSetup?.client?.config?.metadata?.currency;return se(H.reward,e)},[H?.reward]),ve=ae(),Y=B?.components?.postPurchase??ve?.postPurchase,X=O??Y?.badgeText,Z=F??Y?.imageUrl,Q=g(()=>{let e=h[V].postPurchase;return{message:K===`referee`?J?v(A??Y?.refereeText??e.refereeText,J):A??Y?.refereeNoRewardText??e.refereeNoRewardText:J?v(k??Y?.referrerText??e.referrerText,J):k??Y?.referrerNoRewardText??e.referrerNoRewardText,cta:J?v(j??Y?.ctaText??e.ctaText,J):j??Y?.ctaNoRewardText??e.ctaNoRewardText}},[V,K,J,Y,k,A,j]);p(()=>{K&&G.current!==K&&z&&(!I&&(!L||R)||(r(window.FrakSetup?.client,`post_purchase_impression`,{placement:T,variant:K,has_reward:!!H?.reward}),G.current=K))},[K,L,R,z,I,T,H?.reward]);let $=g(()=>ee(P),[P]),ye=te(()=>{K&&(r(window.FrakSetup?.client,`post_purchase_clicked`,{placement:T,variant:K}),a(void 0,T,{link:q,products:$}))},[K,T,q,$]);return!K||!I&&(!L||R||!H)?null:d(`div`,{className:[y,E].filter(Boolean).join(` `),children:d(`div`,{class:ce,children:[d(`div`,{class:b,children:[X&&d(`span`,{class:`PostPurchase_badge__5fv5lh4`,children:X}),d(`p`,{class:me,children:Q.message}),d(`button`,{type:`button`,className:`${S} button`,disabled:!I&&!z,onClick:I?void 0:ye,children:[Q.cta,d(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`${fe} button`,children:d(`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`})})]})]}),d(`div`,{class:x,children:[Z?d(`span`,{class:pe,children:d(`img`,{src:Z,alt:``,class:le})}):d(ie,{className:de,width:80,height:80}),d(re,{className:ue,width:42,height:24})]})]})})}u(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};