@frak-labs/components 1.0.12-beta.8ffb7167 → 1.0.12-beta.b9160b52
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.DwcQ2YSM.js +183 -0
- package/cdn/ButtonShare.CjdlM3aT.js +1 -0
- package/cdn/ButtonWallet.DpIXKZFj.js +40 -0
- package/cdn/{GiftIcon.DT1i36Fm.js → GiftIcon.C59t_j9U.js} +1 -1
- package/cdn/OpenInAppButton.C7jeqGw5.js +1 -0
- package/cdn/PostPurchase.B4UygOrN.js +89 -0
- package/cdn/actions-CMPlZ7CH.DZFAhfKm.js +1 -0
- package/cdn/clientReady.CPe9C8dP.js +1 -0
- package/cdn/components.js +1 -1
- package/cdn/defaults.BjpGmLqu.js +58 -0
- package/cdn/embeddedWallet.D3GODltA.js +1 -0
- package/cdn/loader.js +1 -154
- package/cdn/rewards.BHoSugMr.js +1 -0
- package/cdn/sharedBaseCss.css.BDzFcWnD.js +154 -0
- package/cdn/sharingPage.B8z2OScU.js +1 -0
- package/cdn/sharingPageProducts.Be0kIfZy.js +1 -0
- package/cdn/src-Bigq2qnT.CyWI_ZK9.js +1 -0
- package/cdn/styleManager.Cun1-fKi.js +1 -0
- package/cdn/useGlobalComponents.J2aYwBMq.js +1 -0
- package/cdn/useLightDomStyles.D9RCvVzN.js +1 -0
- package/cdn/useReward.DA85BqOf.js +1 -0
- package/dist/{GiftIcon-BEzYdiux.js → GiftIcon-BhL0bhVu.js} +10 -4
- package/dist/banner.d.ts +1 -16
- package/dist/banner.js +24 -8
- package/dist/buttonShare.d.ts +1 -10
- package/dist/buttonShare.js +6 -6
- package/dist/buttonWallet.d.ts +1 -7
- package/dist/buttonWallet.js +3 -3
- package/dist/i18n/defaults.d.ts +3 -2
- package/dist/i18n/defaults.js +1 -1
- package/dist/openInApp.d.ts +1 -5
- package/dist/openInApp.js +2 -2
- package/dist/postPurchase.d.ts +1 -19
- package/dist/postPurchase.js +5 -5
- package/dist/{rewards-VoZGH2Ko.js → rewards-BtPHdGcI.js} +4 -3
- package/dist/{useGlobalComponents-CZ7Sh2tZ.js → useGlobalComponents-Cl7MBkeo.js} +1 -1
- package/dist/{useLightDomStyles-DphuQhvx.js → useLightDomStyles-CyWohXRl.js} +1 -1
- package/dist/{useReward-BGgymGoH.js → useReward-B-yZ7nhY.js} +1 -1
- package/package.json +8 -7
- package/cdn/Banner.CgCiMrqn.js +0 -167
- package/cdn/ButtonShare.DJqup6VY.js +0 -1
- package/cdn/ButtonWallet.BKuPBrKl.js +0 -40
- package/cdn/OpenInAppButton.D1UzTuHx.js +0 -1
- package/cdn/PostPurchase.CkqSCboo.js +0 -89
- package/cdn/defaults.kWEdCyGS.js +0 -58
- package/cdn/embeddedWallet.CDUxjdX2.js +0 -1
- package/cdn/rewards.CIu9qbmI.js +0 -1
- package/cdn/useGlobalComponents.BC6Jgzg5.js +0 -1
- package/cdn/useLightDomStyles.imPXuAtf.js +0 -1
- package/cdn/useReward.BAmvPaVu.js +0 -1
- /package/cdn/{replay-V6FXES7X.CNozpSRg.js → replay-V6FXES7X.CgBxdfNp.js} +0 -0
- /package/dist/{embeddedWallet-By3_p5Xc.js → embeddedWallet-CxgyuwtP.js} +0 -0
- /package/dist/{usePlacement-4PoDbn2X.js → usePlacement-BhNse5cN.js} +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{c as t}from"./clientReady.CPe9C8dP.js";import{d as n,o as r}from"./src-Bigq2qnT.CyWI_ZK9.js";import{d as i,v as a}from"./actions-CMPlZ7CH.DZFAhfKm.js";import{a as o,d as s,f as c,l,m as u,n as d,p as f,s as p,t as m,u as ee}from"./defaults.BjpGmLqu.js";import{a as h,i as g,n as _,r as v,t as y}from"./GiftIcon.C59t_j9U.js";import{t as b}from"./useGlobalComponents.J2aYwBMq.js";import{t as x}from"./useLightDomStyles.D9RCvVzN.js";import{r as S}from"./rewards.BHoSugMr.js";import{t as C}from"./useReward.DA85BqOf.js";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`;function te({title:e,description:t,cta:n,dismissLabel:r,onAction:i,onDismiss:a,className:o,classNames:s}){return u(`div`,{className:`${E}${o?` ${o}`:``}`,role:`alert`,children:[u(`div`,{className:k,children:[u(`span`,{className:`${A}${s?.icon?` ${s.icon}`:``}`,children:u(_,{width:20,height:20})}),u(`p`,{className:`${j}${s?.title?` ${s.title}`:``}`,children:e})]}),u(`div`,{className:w,children:[u(`p`,{className:`${O}${s?.description?` ${s.description}`:``}`,children:t}),u(`button`,{type:`button`,className:`${D}${s?.cta?` ${s.cta}`:``}`,onClick:i,children:[n,u(g,{width:14,height:14})]})]}),u(`button`,{type:`button`,className:`${T}${s?.close?` ${s.close}`:``}`,onClick:a,"aria-label":r,children:u(h,{width:16,height:16})})]})}var ne=`Banner_frakLogo__1gnumzi9`,re=`Banner_iconSvg__1gnumzi1`,ie=`Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0`,ae=`Banner_referralBody__1gnumzi5`,oe=`Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0`,se=`Banner_referralDescription__1gnumzi7 reset_base__1831jhd0`,ce=`Banner_referralIconWrapper__1gnumzi3`,le=`Banner_referralImage__1gnumzi4`,ue=`Banner_referralTitle__1gnumzi6 reset_base__1831jhd0`;function M({placement:h,classname:g=``,interaction:_,referralTitle:w,referralDescription:T,referralCta:E,inappTitle:D,inappDescription:O,inappCta:k,imageUrl:A,preview:j,previewMode:M,allowInappRedirect:N}){let P=!!j,F=o(),I=M===`inapp`?`inapp`:`referral`,L=N===!0||N===`true`,R=d(h),{shouldRender:z,isHidden:B,isClientReady:V}=p();x(`frak-banner`,h,R?.components?.banner?.css,`@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
opacity: 1;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@keyframes keyframes_fadeOut__mnqmlt1 {
|
|
10
|
+
from {
|
|
11
|
+
opacity: 1;
|
|
12
|
+
}
|
|
13
|
+
to {
|
|
14
|
+
opacity: 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
@keyframes keyframes_fadeInDown__mnqmlt2 {
|
|
18
|
+
from {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
transform: translateY(-4px);
|
|
21
|
+
}
|
|
22
|
+
to {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
transform: translateY(0);
|
|
25
|
+
}
|
|
26
|
+
}.inAppBanner_container__1ibpiy70 {
|
|
27
|
+
position: fixed;
|
|
28
|
+
top: max(8px, env(safe-area-inset-top));
|
|
29
|
+
left: 16px;
|
|
30
|
+
right: 16px;
|
|
31
|
+
z-index: 1000;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 4px;
|
|
35
|
+
padding: 12px 16px;
|
|
36
|
+
padding-right: 32px;
|
|
37
|
+
border-radius: 12px;
|
|
38
|
+
background-color: #000000cc;
|
|
39
|
+
backdrop-filter: blur(12px);
|
|
40
|
+
-webkit-backdrop-filter: blur(12px);
|
|
41
|
+
color: var(--text-onAction__pbq4ak6);
|
|
42
|
+
animation: keyframes_fadeInDown__mnqmlt2 300ms ease-out;
|
|
43
|
+
}
|
|
44
|
+
.inAppBanner_header__1ibpiy71 {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 8px;
|
|
48
|
+
}
|
|
49
|
+
.inAppBanner_iconWrapper__1ibpiy72 {
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
width: 20px;
|
|
52
|
+
height: 20px;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
color: var(--text-onAction__pbq4ak6);
|
|
57
|
+
}
|
|
58
|
+
.inAppBanner_title__1ibpiy73 {
|
|
59
|
+
margin: 0;
|
|
60
|
+
padding: 0;
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
line-height: 26px;
|
|
64
|
+
color: var(--text-onAction__pbq4ak6);
|
|
65
|
+
}
|
|
66
|
+
.inAppBanner_body__1ibpiy74 {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
align-items: baseline;
|
|
70
|
+
gap: 0 4px;
|
|
71
|
+
}
|
|
72
|
+
.inAppBanner_description__1ibpiy75 {
|
|
73
|
+
margin: 0;
|
|
74
|
+
padding: 0;
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
color: var(--text-onAction__pbq4ak6);
|
|
77
|
+
line-height: 22px;
|
|
78
|
+
opacity: 0.96;
|
|
79
|
+
}
|
|
80
|
+
.inAppBanner_cta__1ibpiy76 {
|
|
81
|
+
all: unset;
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
gap: 4px;
|
|
85
|
+
color: #2bb2ff;
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
text-decoration: underline;
|
|
89
|
+
text-underline-offset: 2px;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
.inAppBanner_cta__1ibpiy76:focus-visible {
|
|
93
|
+
outline: 2px solid #2bb2ff;
|
|
94
|
+
outline-offset: 2px;
|
|
95
|
+
border-radius: 4px;
|
|
96
|
+
}
|
|
97
|
+
.inAppBanner_closeButton__1ibpiy77 {
|
|
98
|
+
all: unset;
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 8px;
|
|
101
|
+
right: 8px;
|
|
102
|
+
width: 28px;
|
|
103
|
+
height: 28px;
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
border-radius: 9999px;
|
|
108
|
+
color: #ffffff99;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
}
|
|
111
|
+
.inAppBanner_closeButton__1ibpiy77:focus-visible {
|
|
112
|
+
outline: 2px solid var(--text-onAction__pbq4ak6);
|
|
113
|
+
outline-offset: 2px;
|
|
114
|
+
}.Banner_rootBase__1gnumzi0 {
|
|
115
|
+
position: relative;
|
|
116
|
+
display: flex;
|
|
117
|
+
animation: keyframes_fadeInDown__mnqmlt2 300ms ease-out;
|
|
118
|
+
}
|
|
119
|
+
.Banner_iconSvg__1gnumzi1 {
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 100%;
|
|
122
|
+
}
|
|
123
|
+
.Banner_referral__1gnumzi2 {
|
|
124
|
+
flex-direction: row;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: 16px;
|
|
127
|
+
padding: 16px;
|
|
128
|
+
background-color: #ffffff;
|
|
129
|
+
color: var(--text-primary__pbq4ak0);
|
|
130
|
+
border: 1px solid var(--border-default__pbq4akv);
|
|
131
|
+
border-radius: 12px;
|
|
132
|
+
}
|
|
133
|
+
.Banner_referralIconWrapper__1gnumzi3 {
|
|
134
|
+
flex-shrink: 0;
|
|
135
|
+
align-self: flex-start;
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
width: 40px;
|
|
140
|
+
height: 40px;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
}
|
|
143
|
+
.Banner_referralImage__1gnumzi4 {
|
|
144
|
+
max-width: 100%;
|
|
145
|
+
max-height: 100%;
|
|
146
|
+
width: auto;
|
|
147
|
+
height: auto;
|
|
148
|
+
object-fit: contain;
|
|
149
|
+
display: block;
|
|
150
|
+
}
|
|
151
|
+
.Banner_referralBody__1gnumzi5 {
|
|
152
|
+
flex: 1;
|
|
153
|
+
min-width: 0;
|
|
154
|
+
}
|
|
155
|
+
.Banner_referralTitle__1gnumzi6 {
|
|
156
|
+
font-size: 16px;
|
|
157
|
+
font-weight: 600;
|
|
158
|
+
color: var(--text-primary__pbq4ak0);
|
|
159
|
+
line-height: 22px;
|
|
160
|
+
}
|
|
161
|
+
.Banner_referralDescription__1gnumzi7 {
|
|
162
|
+
margin-bottom: 8px;
|
|
163
|
+
font-size: 14px;
|
|
164
|
+
color: #979797;
|
|
165
|
+
line-height: 22px;
|
|
166
|
+
}
|
|
167
|
+
.Banner_referralCta__1gnumzi8 {
|
|
168
|
+
display: inline-block;
|
|
169
|
+
padding: 8px 16px;
|
|
170
|
+
border: 1px solid #000000;
|
|
171
|
+
border-radius: 9999px;
|
|
172
|
+
color: var(--text-primary__pbq4ak0);
|
|
173
|
+
font-size: 10px;
|
|
174
|
+
font-weight: 700;
|
|
175
|
+
line-height: 12px;
|
|
176
|
+
text-transform: uppercase;
|
|
177
|
+
}
|
|
178
|
+
.Banner_frakLogo__1gnumzi9 {
|
|
179
|
+
position: absolute;
|
|
180
|
+
right: 16px;
|
|
181
|
+
bottom: 12px;
|
|
182
|
+
pointer-events: none;
|
|
183
|
+
}`,e);let[H,U]=s(!1),[W,G]=s(()=>P?I:L&&n?`inapp`:null),K=l(null);c(()=>{P&&G(I)},[P,I]);let{reward:q}=C(W===`referral`&&V,_,`referee`),[J,de]=s(null);c(()=>{let e=window.FrakSetup?.client;W!==`inapp`||P||!V||!e||i(e).then(e=>de(e)).catch(()=>{})},[W,P,V]),c(()=>{P||!W||H||K.current!==W&&V&&(t(window.FrakSetup?.client,`banner_impression`,{placement:h,variant:W,has_reward:W===`referral`?!!q:void 0}),K.current=W)},[W,H,V,P,h]),c(()=>{if(P||W===`inapp`)return;let e=()=>G(`referral`);return window.addEventListener(a,e),()=>window.removeEventListener(a,e)},[P,W]);let Y=f(async()=>{if(P)return;if(t(window.FrakSetup?.client,`banner_resolved`,{placement:h,variant:W??`referral`,outcome:`clicked`}),W===`referral`){U(!0);return}let e=J;if(!e&&window.FrakSetup?.client)try{e=await i(window.FrakSetup?.client)}catch{}let n=window.location.href;if(e){let t=new URL(n);t.searchParams.set(`fmt`,e),n=t.toString()}r(n)},[P,W,J,h]),fe=f(()=>{P||(t(window.FrakSetup?.client,`banner_resolved`,{placement:h,variant:W??`referral`,outcome:`dismissed`}),U(!0))},[P,W,h]),X=b(),Z=R?.components?.banner??X?.banner,Q=A??Z?.imageUrl,$=ee(()=>{let e=m[F].banner;if(W===`referral`){let t=q?e.referralTitleReward:e.referralTitle;return{title:S(w??Z?.referralTitle??t,q),description:S(T??Z?.referralDescription??e.referralDescription,q),cta:E??Z?.referralCta??e.referralCta}}return{title:S(D??Z?.inappTitle??e.inappTitle,void 0),description:S(O??Z?.inappDescription??e.inappDescription,void 0),cta:k??Z?.inappCta??e.inappCta}},[F,W,q,Z,w,T,E,D,O,k]);if(!W||!P&&(!z||B||H))return null;let pe=[ie,`frak-banner`,`frak-banner--${W}`,g].filter(Boolean).join(` `);return W===`inapp`?u(te,{title:$.title,description:$.description,cta:$.cta,dismissLabel:m[F].banner.dismissLabel,onAction:Y,onDismiss:fe,className:[`frak-banner`,`frak-banner--inapp`,g].filter(Boolean).join(` `),classNames:{icon:`frak-banner__icon`,title:`frak-banner__title`,description:`frak-banner__description`,cta:`frak-banner__cta`,close:`frak-banner__close`}}):u(`div`,{class:pe,role:`alert`,children:[u(`div`,{class:`${ce} frak-banner__icon`,children:Q?u(`img`,{src:Q,alt:``,class:le}):u(y,{class:re})}),u(`div`,{class:`${ae} frak-banner__text`,children:[u(`p`,{class:`${ue} frak-banner__title`,children:$.title}),u(`p`,{class:`${se} frak-banner__description`,children:$.description}),u(`button`,{type:`button`,class:`${oe} frak-banner__cta`,onClick:Y,children:$.cta})]}),u(v,{class:`${ne} frak-banner__logo`,width:42,height:24})]})}export{M as Banner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./clientReady.CPe9C8dP.js";import{t}from"./sharingPage.B8z2OScU.js";import{a as n,m as r,n as i,p as a,s as o,t as s,u as c}from"./defaults.BjpGmLqu.js";import{t as l}from"./useGlobalComponents.J2aYwBMq.js";import{t as u}from"./useLightDomStyles.D9RCvVzN.js";import{r as d}from"./rewards.BHoSugMr.js";import{t as f}from"./useReward.DA85BqOf.js";import{t as p}from"./embeddedWallet.D3GODltA.js";function m({placement:m,text:h,classname:g=``,noRewardText:_,targetInteraction:v,clickAction:y,preview:b}){let x=!!b,S=n(),C=i(m),w=l(),T=C?.components?.buttonShare??w?.buttonShare;u(`frak-button-share`,m,T?.css);let E=c(()=>C?.targetInteraction===void 0?v:C.targetInteraction,[C?.targetInteraction,v]),D=T?.text??h??s[S].buttonShare.text,O=T?.noRewardText??_,k=c(()=>D.includes(`{REWARD}`),[D]),A=c(()=>T?.clickAction??y??`sharing-page`,[T?.clickAction,y]),{shouldRender:j,isHidden:M,isClientReady:N}=o(),{reward:P}=f(k&&N,E),F=c(()=>k?P?d(D,P):O??d(D,void 0):D,[k,D,O,P]),I=a(()=>{if(!x){if(e(window.FrakSetup.client,`share_button_clicked`,{placement:m,target_interaction:E,has_reward:!!P,click_action:A}),A===`embedded-wallet`){p(E,m);return}t(E,m)}},[x,A,E,m,P]);if(!x&&(!j||M))return null;let L=[`button`,`button__fadeIn`,g].filter(Boolean).join(` `);return r(`button`,{type:`button`,disabled:!x&&!N,class:L,onClick:I,children:F})}export{m as ButtonShare};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{a as e,d as t,f as n,h as r,m as i,n as a,r as o,s,t as c,u as l}from"./defaults.BjpGmLqu.js";import{t as u}from"./useReward.DA85BqOf.js";import{t as d}from"./embeddedWallet.D3GODltA.js";function f(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 p(){`vibrate`in navigator?navigator.vibrate(10):console.log(`Vibration not supported`)}function m(e,t){p(),d(e,t)}function h({placement:d,classname:p=``,useReward:h,targetInteraction:g}){let _=e(),v=a(d),y=l(()=>v?.targetInteraction===void 0?g:v.targetInteraction,[v?.targetInteraction,g]),b=l(()=>h===!0,[h]),{shouldRender:x,isHidden:S,isClientReady:C}=s(),{reward:w}=u(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`,p].filter(Boolean).join(` `);return i(r,{children:[i(`style`,{children:o(`
|
|
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":c[_].buttonWallet.ariaLabel,part:`button`,disabled:!C,class:D,onClick:()=>{m(y,d)},children:[i(f,{}),w&&i(`span`,{class:`reward`,children:w})]})]})}export{h as ButtonWallet};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./defaults.
|
|
1
|
+
import{m as e}from"./defaults.BjpGmLqu.js";function t(t){return e(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,"aria-hidden":`true`,...t,children:e(`path`,{d:`M7.33 0C11.38 0 14.67 3.28 14.67 7.33C14.67 11.38 11.38 14.67 7.33 14.67C3.28 14.67 0 11.38 0 7.33C0 3.28 3.28 0 7.33 0ZM10.39 4.28C10.15 4.04 9.76 4.04 9.52 4.28L7.33 6.47L5.14 4.28C4.9 4.04 4.52 4.04 4.28 4.28C4.04 4.52 4.04 4.9 4.28 5.14L6.47 7.33L4.28 9.52C4.04 9.76 4.04 10.15 4.28 10.39C4.52 10.63 4.9 10.63 5.14 10.39L7.33 8.2L9.52 10.39C9.76 10.63 10.15 10.63 10.39 10.39C10.63 10.15 10.63 9.76 10.39 9.52L8.2 7.33L10.39 5.14C10.63 4.9 10.63 4.52 10.39 4.28Z`,fill:`currentColor`})})}function n(t){return e(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,...t,children:e(`path`,{d:`M5.46 0C5.76 0 6 0.24 6 0.55C6 0.85 5.76 1.09 5.46 1.09H4.36C3.05 1.09 2.28 1.36 1.82 1.82C1.36 2.28 1.09 3.05 1.09 4.36V7.64C1.09 8.95 1.36 9.72 1.82 10.18C2.28 10.64 3.05 10.91 4.36 10.91H7.64C8.95 10.91 9.72 10.64 10.18 10.18C10.64 9.72 10.91 8.95 10.91 7.64V6.55C10.91 6.24 11.15 6 11.46 6C11.76 6 12 6.24 12 6.55V7.64C12 9.05 11.72 10.19 10.95 10.95C10.19 11.72 9.05 12 7.64 12H4.36C2.95 12 1.81 11.72 1.05 10.95C0.28 10.19 6.04e-05 9.05 0 7.64V4.36C0 2.95 0.28 1.81 1.05 1.05C1.81 0.28 2.95 0 4.36 0H5.46ZM11.45 0C11.76 2.2e-05 12 0.24 12 0.55V3.16C12 3.47 11.76 3.71 11.45 3.71C11.15 3.71 10.91 3.46 10.91 3.16V1.86L6.93 5.84C6.72 6.05 6.37 6.05 6.16 5.84C5.95 5.63 5.95 5.28 6.16 5.07L10.14 1.09H8.84C8.54 1.09 8.29 0.85 8.29 0.55C8.29 0.24 8.53 0 8.84 0H11.45Z`,fill:`currentColor`})})}function r(t){return e(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:t.width??`63`,height:t.height??`24`,fill:`none`,viewBox:`0 0 63 24`,...t,children:[e(`title`,{children:`Frak`}),e(`rect`,{width:`24`,height:`24`,rx:`6`,fill:`#0043EF`}),e(`path`,{fill:`white`,d:`M9.77 15.91L5.15 14.35C5.06 14.32 4.97 14.38 4.97 14.47V17.33C4.97 17.39 5.01 17.44 5.06 17.46L9.68 19.02C9.77 19.05 9.86 18.98 9.86 18.89V16.04C9.86 15.98 9.82 15.93 9.77 15.91ZM14.58 10.44L9.95 12C9.9 12.02 9.86 12.07 9.86 12.13V14.98C9.86 15.08 9.95 15.14 10.04 15.11L14.66 13.55C14.72 13.53 14.76 13.48 14.76 13.42V10.57C14.76 10.47 14.66 10.41 14.58 10.44ZM18.92 5.02L11.18 7.51C11.12 7.53 11.08 7.58 11.08 7.64V10.57C11.08 10.62 11.14 10.66 11.2 10.65L18.94 8.15C18.99 8.14 19.03 8.08 19.03 8.02V5.1C19.03 5.04 18.97 5 18.92 5.02Z`}),e(`path`,{fill:`currentColor`,d:`M52.72 9.51C52.83 9.51 52.91 9.6 52.91 9.7L52.84 18.21C52.84 18.31 52.76 18.39 52.66 18.39L52.64 18.39H51.3C51.15 18.39 50.78 18.25 50.39 18C49.86 18.25 49.27 18.39 48.64 18.39H48.39C47.24 18.39 46.19 17.91 45.43 17.14C44.67 16.38 44.2 15.32 44.2 14.15C44.2 12.98 44.67 11.92 45.43 11.15C46.16 10.41 47.16 9.94 48.26 9.91C49.17 9.86 49.99 9.99 50.49 10.5V9.7C50.49 9.6 50.57 9.51 50.68 9.51H52.72ZM35.35 5.62H36.96C37.09 5.62 37.19 5.72 37.19 5.85V7.81C37.19 7.94 37.09 8.04 36.96 8.04H34.92C34.32 8.04 33.63 8.64 33.63 9.25V10.61C34.26 9.98 34.93 9.65 35.35 9.63H36.46C36.59 9.63 36.69 9.73 36.69 9.86V11.82C36.69 11.95 36.59 12.05 36.46 12.05H34.92C34.31 12.05 33.63 12.65 33.63 13.27V18.2C33.63 18.3 33.54 18.39 33.44 18.39H31.39C31.29 18.39 31.21 18.3 31.21 18.2V9.94C31.21 9.87 31.2 9.8 31.2 9.73C31.24 8.88 31.15 5.44 35.35 5.62ZM39.93 9.63C40.04 9.63 40.12 9.72 40.12 9.82V10.61C40.76 9.98 41.58 9.63 41.85 9.63H43.46C43.58 9.63 43.68 9.73 43.69 9.86V11.82C43.68 11.95 43.58 12.05 43.46 12.05H41.41C40.81 12.05 40.12 12.65 40.12 13.27V18.2C40.12 18.3 40.04 18.39 39.93 18.39H37.89C37.79 18.39 37.7 18.3 37.7 18.2V9.82C37.7 9.72 37.79 9.63 37.89 9.63H39.93ZM56.2 7.01C56.3 7.01 56.39 7.09 56.39 7.2V13.45L59.83 10.19C59.87 10.16 59.91 10.14 59.96 10.14H62.28C62.45 10.14 62.54 10.34 62.42 10.46L59.3 13.63L62.8 18.07C62.9 18.2 62.81 18.39 62.65 18.39H60.24C60.18 18.39 60.13 18.36 60.09 18.31L57.67 15.32C57.6 15.23 57.47 15.22 57.39 15.3L56.39 16.29V18.19C56.39 18.3 56.3 18.39 56.2 18.39H54.19C54.08 18.39 54 18.3 54 18.19V7.2C54 7.09 54.08 7.01 54.19 7.01H56.2ZM48.37 11.96C47.78 11.96 47.24 12.21 46.85 12.6C46.46 13 46.22 13.54 46.22 14.14C46.22 14.73 46.46 15.28 46.85 15.67C47.24 16.07 47.78 16.31 48.37 16.31H48.66C49.25 16.31 49.79 16.07 50.18 15.67C50.57 15.28 50.81 14.73 50.81 14.14C50.81 13.54 50.57 12.99 50.18 12.6C49.79 12.21 49.25 11.96 48.66 11.96H48.37Z`})]})}2*Math.PI*11;function i(t){return e(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,...t,children:e(`path`,{d:`M8 0C12.42 0 16 3.58 16 8C16 12.42 12.42 16 8 16C3.58 16 0 12.42 0 8C0 3.58 3.58 0 8 0ZM8 1.5C4.41 1.5 1.5 4.41 1.5 8C1.5 11.59 4.41 14.5 8 14.5C11.59 14.5 14.5 11.59 14.5 8C14.5 4.41 11.59 1.5 8 1.5ZM8.1 10.21C8.82 10.21 9.24 10.63 9.24 11.33C9.24 12.03 8.82 12.46 8.1 12.46C7.36 12.46 6.97 12.03 6.97 11.33C6.97 10.63 7.36 10.21 8.1 10.21ZM8.85 3.54C9.01 3.54 9.15 3.68 9.15 3.84V4.75L8.84 8.37C8.83 8.53 8.7 8.65 8.54 8.65H7.63C7.47 8.65 7.34 8.52 7.33 8.37L7.08 4.75V3.84C7.09 3.68 7.22 3.54 7.38 3.54H8.85Z`,fill:`currentColor`})})}function a(t){return e(`svg`,{viewBox:`0 0 100 100`,fill:`none`,"aria-hidden":`true`,...t,children:[e(`circle`,{cx:`38`,cy:`28`,r:`23`,fill:`#FFF533`}),e(`path`,{d:`M50 38C30 10 12 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`path`,{d:`M50 38C70 10 88 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`rect`,{x:`10`,y:`38`,width:`80`,height:`16`,rx:`2`,stroke:`#222222`,"stroke-width":`4`}),e(`path`,{d:`M15 54V89C15 90.6 16.4 92 18 92H82C83.6 92 85 90.6 85 89V54`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),e(`line`,{x1:`50`,y1:`54`,x2:`50`,y2:`92`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`})]})}export{t as a,n as i,i as n,r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./clientReady.CPe9C8dP.js";import{a as t,l as n,u as r}from"./src-Bigq2qnT.CyWI_ZK9.js";import{a as i,m as a,n as o,s,t as c,u as l}from"./defaults.BjpGmLqu.js";import{t as u}from"./useLightDomStyles.D9RCvVzN.js";function d(t=`wallet`,i){let a=window.FrakSetup?.client;a&&e(a,`open_in_app_clicked`,{path:t,placement:i}),r(`${n}${t}`,{onFallback:()=>{a&&e(a,`app_not_installed`,{path:t,placement:i})}})}function f(){return{isMobile:l(()=>t(),[])}}function p({placement:e,text:t,classname:n=``}){let r=i(),l=o(e),{shouldRender:p,isHidden:m,isClientReady:h}=s(),{isMobile:g}=f();u(`frak-open-in-app`,e,l?.components?.openInApp?.css);let _=l?.components?.openInApp?.text??t??c[r].openInApp.text;if(!g||!p||m)return null;let v=()=>{d(void 0,e)},y=[`button`,`button__fadeIn`,n].filter(Boolean).join(` `);return a(`button`,{type:`button`,"aria-label":c[r].openInApp.ariaLabel,disabled:!h,class:y,onClick:v,children:_})}export{p as OpenInAppButton};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{E as t,c as n,k as r}from"./clientReady.CPe9C8dP.js";import{m as i,r as a,u as o}from"./actions-CMPlZ7CH.DZFAhfKm.js";import{t as s}from"./sharingPage.B8z2OScU.js";import{n as c}from"./sharingPageProducts.Be0kIfZy.js";import{a as ee,d as l,f as u,l as te,m as d,n as f,p,s as m,t as h,u as g}from"./defaults.BjpGmLqu.js";import{r as ne,t as re}from"./GiftIcon.C59t_j9U.js";import{t as ie}from"./useGlobalComponents.J2aYwBMq.js";import{t as ae}from"./useLightDomStyles.D9RCvVzN.js";import{i as oe,n as _,r as v}from"./rewards.BHoSugMr.js";var y=`PostPurchase_card__5fv5lh0`,se=`PostPurchase_cardLayout__5fv5lh1`,ce=`PostPurchase_cardLeft__5fv5lh2`,b=`PostPurchase_cardRight__5fv5lh3`,x=`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 S({customerId:_,orderId:S,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=ee();ae(`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
|
+
}`,e);let[H,_e]=l(null),[U,W]=l(!1);u(()=>{I||!z||!_||!S||!C||a({customerId:_,orderId:S,token:C,merchantId:w}).catch(()=>{})},[I,z,_,S,C,w]),u(()=>{if(I||!z||U)return;let e=window.FrakSetup?.client;e&&Promise.all([o(e),i(e)]).then(([t,n])=>{W(!0),_e(he(t,n,e.config.metadata?.currency))}).catch(e=>{if(e instanceof r&&e.code===t.configError){W(!0);return}console.warn(`[Frak] Post-purchase context error`,e)})},[I,z,U]);let G=te(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 oe(H.reward,e)},[H?.reward]),ve=ie(),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]);u(()=>{K&&G.current!==K&&z&&(!I&&(!L||R)||(n(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(()=>c(P),[P]),ye=p(()=>{K&&(n(window.FrakSetup?.client,`post_purchase_clicked`,{placement:T,variant:K}),s(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:se,children:[d(`div`,{class:ce,children:[X&&d(`span`,{class:`PostPurchase_badge__5fv5lh4`,children:X}),d(`p`,{class:me,children:Q.message}),d(`button`,{type:`button`,className:`${x} 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:b,children:[Z?d(`span`,{class:pe,children:d(`img`,{src:Z,alt:``,class:le})}):d(re,{className:de,width:80,height:80}),d(ne,{className:ue,width:42,height:24})]})]})})}export{S as PostPurchase};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,T as t,b as n,c as r,g as i,h as a,s as o,v as s,w as c,y as l}from"./clientReady.CPe9C8dP.js";async function u(e,t,n){return await e.request({method:`frak_displayEmbeddedWallet`,params:n?[t,e.config.metadata,n]:[t,e.config.metadata]})}async function d(e,{steps:t,metadata:n},r){return await e.request({method:`frak_displayModal`,params:r?[t,n,e.config.metadata,r]:[t,n,e.config.metadata]})}async function f(e,t,n){return await e.request({method:`frak_displaySharingPage`,params:n?[t,e.config.metadata,n]:[t,e.config.metadata]})}async function p(t){if(typeof window>`u`)return;let n=e();if(!n)return;let r=await o.resolveMerchantId();if(!r)return;let i=`frak-identity-ensured-${r}`;if(!window.sessionStorage.getItem(i))try{let e=l();(await fetch(`${e}/user/identity/ensure`,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`,"x-wallet-sdk-auth":t,"x-frak-client-id":n},body:JSON.stringify({merchantId:r})})).ok&&window.sessionStorage.setItem(i,`1`)}catch{}}async function m(e,t){return c(()=>e.request({method:`frak_getMerchantInformation`}),{cacheKey:`frak_getMerchantInformation`,cacheTime:t?.cacheTime})}async function h(e,t){return c(()=>e.request({method:`frak_getMergeToken`}),{cacheKey:`frak_getMergeToken`,cacheTime:t?.cacheTime})}async function g(e,t){return c(()=>e.request({method:`frak_getUserReferralStatus`}),{cacheKey:`frak_getUserReferralStatus`,cacheTime:t?.cacheTime})}async function _(e,t){let{metadata:n,customizations:r}=e.config;return await e.request({method:`frak_prepareSso`,params:[t,n.name,r?.css]})}async function v(t,n){try{await t.request({method:`frak_sendInteraction`,params:[n,{clientId:e()}]})}catch{console.warn(`[Frak SDK] Failed to send interaction:`,n.type)}}function y(e,t,n){return i(t)?(r(e,`user_referred_started`,{referrer_client_id:t.c,referrer_wallet:t.w,wallet_status:n?.key}),v(e,{type:`arrival`,referrerClientId:t.c,referrerMerchantId:t.m,referrerWallet:t.w,referralTimestamp:t.t}),!0):a(t)?(r(e,`user_referred_started`,{referrer:t.r,wallet_status:n?.key}),v(e,{type:`arrival`,referrerWallet:t.r}),!0):!1}function b(t,n){let r=e();return!r&&!n?null:{v:2,m:t,t:Math.floor(Date.now()/1e3),...r?{c:r}:{},...n?{w:n}:{}}}function x(t,r){return i(t)?t.w&&r?.wallet?n(t.w,r.wallet):t.c?e()===t.c:!1:a(t)&&r?.wallet?n(t.r,r.wallet):!1}function S(e,{walletStatus:t,frakContext:n,options:a}){if(!n)return`no-referrer`;if(x(n,t))return`self-referral`;if(!y(e,n,t))return`no-referrer`;let o=i(n)?n.m:a?.merchantId,c=a?.alwaysAppendUrl&&o?b(o,t?.wallet):null;return s.replaceUrl({url:window.location?.href,context:c}),r(e,`user_referred_completed`,{status:`success`}),`success`}async function C(e,{options:t}={}){let n=s.parse({url:window.location.href}),r=await D(e);try{return S(e,{walletStatus:r,frakContext:n,options:t})}catch(e){console.warn(`Error processing referral`,{error:e})}}const w=`frak:referral-success`;async function T(e){try{await C(e)===`success`&&window.dispatchEvent(new Event(w))}catch(e){console.warn(`[Frak] Referral setup failed`,e)}}async function E(t){if(typeof window>`u`){console.warn(`[Frak] No window found, can't track purchase`);return}let n=window.sessionStorage.getItem(`frak-wallet-interaction-token`),r=e();if(!n&&!r){console.warn(`[Frak] No identity found, skipping purchase check`);return}let i=t.merchantId??await o.resolveMerchantId();if(!i){console.warn(`[Frak] No merchant id found, skipping purchase check`);return}let a={Accept:`application/json`,"Content-Type":`application/json`};n&&(a[`x-wallet-sdk-auth`]=n),r&&(a[`x-frak-client-id`]=r);let s=l();await fetch(`${s}/user/track/purchase`,{method:`POST`,headers:a,body:JSON.stringify({customerId:t.customerId,orderId:t.orderId,token:t.token,merchantId:i})})}function D(e,n){if(!n)return e.request({method:`frak_listenToWalletStatus`}).then(t=>(O(e,t),t));let r=new t,i=!1;return e.listenerRequest({method:`frak_listenToWalletStatus`},t=>{O(e,t),n(t),i||=(r.resolve(t),!0)}),r.promise}function O(e,t){typeof window>`u`||(e.openPanel?.setGlobalProperties({wallet:t.wallet??null}),t.interactionToken?(window.sessionStorage.setItem(`frak-wallet-interaction-token`,t.interactionToken),p(t.interactionToken)):window.sessionStorage.removeItem(`frak-wallet-interaction-token`))}function k(e,{metadata:t,login:n}){return A(e,{steps:{login:n??{}},metadata:t})}function A(e,t){function n(n){return A(e,{...t,steps:{...t.steps,sendTransaction:n}})}function r(n){return A(e,{...t,steps:{...t.steps,final:{...n,action:{key:`reward`}}}})}function i(n,r){return A(e,{...t,steps:{...t.steps,final:{...r,action:{key:`sharing`,options:n}}}})}async function a(n,r){return n&&(t.metadata=n(t.metadata??{})),await d(e,t,r)}return{params:t,sendTx:n,reward:r,sharing:i,display:a}}async function j(e,{tx:t,metadata:n}){return(await d(e,{metadata:n,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}function M(e=96){let t=Math.ceil(e/2),n=``;if(typeof crypto<`u`&&crypto.getRandomValues){let e=new Uint8Array(t);crypto.getRandomValues(e);for(let t=0;t<e.length;t++)n+=e[t].toString(16).padStart(2,`0`)}else for(let e=0;e<t;e++)n+=(Math.random()*256|0).toString(16).padStart(2,`0`);return n.substring(0,e)}async function N(e,{siwe:t,metadata:n}){let r=e.config?.domain??window.location.host,i=t?.statement??`I confirm that I want to use my Frak wallet on: ${e.config.metadata.name}`;return(await d(e,{metadata:n,steps:{login:{},siweAuthenticate:{siwe:{...t,statement:i,nonce:t?.nonce??M(),uri:t?.uri??`https://${r}`,version:t?.version??`1`,domain:r}}}})).siweAuthenticate}export{v as _,S as a,d as c,h as d,j as f,u as g,p as h,N as i,f as l,m,D as n,T as o,k as p,E as r,_ as s,C as t,g as u,w as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006,userRejected:-32007};var t=class extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.data=n}toJSON(){return{code:this.code,message:this.message,data:this.data}}},n=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve=e=>{this._resolve?.(e)};reject=e=>{this._reject?.(e)}};function r(e){let{emittingTransport:r,listeningTransport:i,targetOrigin:a,middleware:o=[],lifecycleHandlers:s}=e,c=new Map;function l(e){return typeof e!=`object`||!e?!1:`clientLifecycle`in e||`iframeLifecycle`in e}function u(e){return typeof e!=`object`||!e?!1:`id`in e&&`topic`in e&&`data`in e}async function d(e){try{`clientLifecycle`in e&&s?.clientLifecycle?await s.clientLifecycle(e,{origin:a,source:null}):`iframeLifecycle`in e&&s?.iframeLifecycle&&await s.iframeLifecycle(e,{origin:a,source:null})}catch(e){console.error(`[RPC Client] Lifecycle handler error:`,e)}}async function f(e){let t={origin:a,source:null};for(let n of o)n.onRequest&&await n.onRequest(e,t);return e}async function p(e,t){let n={origin:a,source:null},r=t;for(let t of o)t.onResponse&&(r=await t.onResponse(e,r,n));return r}async function m(e){try{let t=new URL(e.origin).origin.toLowerCase(),n=new URL(a).origin.toLowerCase();if(t!==n){console.log(`Not expected origin`,t,n);return}}catch(e){console.error(`[RPC Client] Invalid origin`,e);return}if(l(e.data)){await d(e.data);return}if(!u(e.data))return;let t;try{let n=e.data.data,r=n instanceof Uint8Array||ArrayBuffer.isView(n)?{result:n}:n;t=await p(e.data,r)}catch(e){console.error(`[RPC Client] Middleware error on response:`,e);return}let n=c.get(e.data.id);n&&n(t)}async function h(e){let t=e;try{t=await f(e)}catch(e){throw console.error(`[RPC Client] Middleware error on request:`,e),e}r.postMessage(t,a)}function g(e){r.postMessage(e,a)}function _(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}i.addEventListener(`message`,m);function v(e){let r=_(),i=new n;return c.set(r,e=>{e.error?i.reject(new t(e.error.code,e.error.message,e.error.data)):i.resolve(e.result),c.delete(r)}),h({id:r,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{c.delete(r),i.reject(e)}),i.promise}function y(e,t){let n=_();return c.set(n,e=>{e.error?(console.error(`[RPC Client] Listener error:`,e.error),c.delete(n)):t(e.result)}),h({id:n,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{console.error(`[RPC Client] Failed to send listener request:`,e),c.delete(n)}),()=>{c.delete(n)}}function b(){i.removeEventListener(`message`,m),c.clear()}return{request:v,listen:y,sendLifecycle:g,cleanup:b}}function i(e){return new TextEncoder().encode(JSON.stringify(e))}function a(e){try{return JSON.parse(new TextDecoder().decode(e))}catch{return null}}const o=`frak-client-id`;function s(){return typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function c(){if(typeof window>`u`||!window.localStorage)return console.warn(`[Frak SDK] No Window / localStorage available to save the clientId`),s();let e=localStorage.getItem(o);return e||(e=s(),localStorage.setItem(o,e)),e}var l=class extends Map{maxSize;constructor(e){super(),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=super.keys().next().value;e!==void 0&&super.delete(e)}return this}};let u;function d(){return u||={promiseCache:new l(1024),responseCache:new l(1024),failureCache:new l(1024)},u}async function f(e,{cacheKey:t,cacheTime:n=3e4}){let{promiseCache:r,responseCache:i,failureCache:a}=d();if(n>0){let e=i.get(t);if(e&&Date.now()-e.created<n)return e.data}let o=a.get(t);if(o&&Date.now()-o<1e3)throw Error(`Cache: ${t} recently failed, backing off`);let s=r.get(t);s||(s=e(),r.set(t,s));try{let e=await s;return i.set(t,{data:e,created:Date.now()}),a.delete(t),e}catch(e){throw a.set(t,Date.now()),e}finally{r.delete(t)}}function p(){u&&(u.promiseCache.clear(),u.responseCache.clear(),u.failureCache.clear())}const m=`https://backend.frak.id`;function h(e){return e.includes(`localhost:3000`)||e.includes(`localhost:3010`)}function g(e){return h(e)?`https://localhost:3030`:e.includes(`wallet-dev.frak.id`)||e.includes(`wallet.gcp-dev.frak.id`)?`https://backend.gcp-dev.frak.id`:m}function _(e){if(e)return g(e);if(typeof window<`u`){let e=window.FrakSetup?.client?.config?.walletUrl;if(e)return g(e)}return m}const v=`__frakSdkConfig`,y=`frak-config-cache`,b=`frak-merchant-id`,x={key:y},S=typeof window<`u`;function C(){return{isResolved:!1,merchantId:``}}let w=null;function T(){if(!S)return null;try{let e=localStorage.getItem(x.key);if(!e)return null;let t=JSON.parse(e);return t.config?.isResolved?(w=t,t):null}catch{return null}}function E(){return(w??T())?.config}function ee(){let e=w??T();return e?Date.now()-e.timestamp<3e4:!1}function te(e){if(!(!S||!e.isResolved))try{let t={config:e,timestamp:Date.now()};localStorage.setItem(x.key,JSON.stringify(t)),w=t}catch{}}function ne(){if(S){w=null;try{localStorage.removeItem(x.key)}catch{}}}function re(){S&&(window[v]||(window[v]=E()??C()))}function D(){return S?(re(),window[v]??C()):C()}function O(e){S&&window.dispatchEvent(new CustomEvent(`frak:config`,{detail:e}))}function k(e){return e??(S?window.location.hostname:``)}async function ie(e,t,n){try{let r=_(t),i=n?`&lang=${encodeURIComponent(n)}`:``,a=await fetch(`${r}/user/merchant/resolve?domain=${encodeURIComponent(e)}${i}`);if(!a.ok){console.warn(`[Frak SDK] Merchant lookup failed for domain ${e}: ${a.status}`);return}let o=await a.json();if(S)try{sessionStorage.setItem(b,o.merchantId)}catch{}return o}catch(e){console.warn(`[Frak SDK] Failed to fetch merchant config:`,e);return}}const A={getConfig:D,get isResolved(){return D().isResolved},get isCacheFresh(){return ee()},setCacheScope(e,t){let n=`${e}:${t??``}`;x.key=`${y}:${n}`,w=null},setConfig(e){if(S&&(window[v]=e),te(e),O(e),S&&e.merchantId)try{sessionStorage.setItem(b,e.merchantId)}catch{}},reset(){let e=E()??C();S&&(window[v]=e),O(e)},clearCache(){if(ne(),p(),S)try{sessionStorage.removeItem(b)}catch{}},resolve(e,t,n){let r=k(e);return r?f(async()=>{let e=await ie(r,t,n);if(!e)throw Error(`Config resolution returned empty`);return e},{cacheKey:`sdkConfig:${r}:${n??``}`,cacheTime:1/0}).catch(()=>void 0):Promise.resolve(void 0)},getMerchantId(){let e=D();if(e.isResolved&&e.merchantId)return e.merchantId;if(S)try{return sessionStorage.getItem(b)??void 0}catch{}},async resolveMerchantId(e,t){return A.getMerchantId()||(await A.resolve(e,t))?.merchantId}};function j(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function M(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(e.length+(t===0?0:4-t),`=`)),e=>e.charCodeAt(0))}function N(e){return j(i(e))}function P(e,t,n,r,i,a){let o=N(ae({redirectUrl:t.redirectUrl,directExit:t.directExit,lang:t.lang,merchantId:n,metadata:{name:r,css:a,logoUrl:t.metadata?.logoUrl,homepageLink:t.metadata?.homepageLink},clientId:i})),s=new URL(e);return s.pathname=`/sso`,s.searchParams.set(`p`,o),s.toString()}function ae(e){return{r:e.redirectUrl,cId:e.clientId,d:e.directExit,l:e.lang,m:e.merchantId,md:{n:e.metadata?.name,css:e.metadata?.css,l:e.metadata?.logoUrl,h:e.metadata?.homepageLink}}}const F=`menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800`,I=`frak-sso`;async function oe(e,t){let{metadata:n,customizations:r,walletUrl:i}=e.config,a={...t,directExit:t.directExit??!t.redirectUrl};if(a.openInSameWindow??!!a.redirectUrl)return await e.request({method:`frak_openSso`,params:[a,n.name,r?.css]});let o=a.ssoPopupUrl??P(i??`https://wallet.frak.id`,a,await A.resolveMerchantId()??``,n.name,c(),r?.css),s=window.open(o,I,F);if(!s)throw Error(`Popup was blocked. Please allow popups for this site.`);return s.focus(),await e.request({method:`frak_openSso`,params:[a,n.name,r?.css]})??{}}function se(e,t,n){if(!e){console.debug(`[Frak] No client provided, skipping event tracking`);return}try{e.openPanel?.track(t,n)}catch(e){console.debug(`[Frak] Failed to track event:`,t,e)}}function L(e,t){let n=e.get(t);if(n!==null)return n;let r=t.toLowerCase();for(let[t,n]of e)if(t.toLowerCase()===r)return n;return null}function R(e,t){let n=t.toLowerCase(),r=[...e.keys()].filter(e=>e.toLowerCase()===n);for(let t of r)e.delete(t)}const ce=/^0x[a-fA-F0-9]{40}$/;function z(e){return typeof e==`string`&&ce.test(e)}function le(e,t){return e.toLowerCase()===t.toLowerCase()}function B(e){let t=new Uint8Array(20);for(let n=0;n<20;n++){let r=Number.parseInt(e.substring(2+n*2,4+n*2),16);if(Number.isNaN(r))throw Error(`Invalid address: ${e}`);t[n]=r}return t}const ue=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function V(e){let t=`0x`;for(let n=0;n<20;n++)t+=ue[e[n]];return t}function de(e){return`r`in e&&!(`v`in e)}function H(e){return`v`in e&&e.v===2}const fe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function U(e){return typeof e==`string`&&fe.test(e)}function W(e){let t=e.replace(/-/g,``),n=new Uint8Array(16);for(let e=0;e<16;e++)n[e]=Number.parseInt(t.substring(e*2,e*2+2),16);return n}function G(e){let t=``;for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`}function pe(e){if(!U(e.m)||!Number.isInteger(e.t)||e.t<0||e.t>4294967295)return null;let t=typeof e.c==`string`&&e.c.length>0,n=typeof e.w==`string`&&z(e.w);if(!t&&!n||t&&!U(e.c))return null;let r=new Uint8Array(21+(t?16:0)+(n?20:0)),i=new DataView(r.buffer,r.byteOffset,r.byteLength),a=0;return r[a++]=2|(t?16:0)|(n?32:0),r.set(W(e.m),a),a+=16,i.setUint32(a,e.t,!1),a+=4,t&&(r.set(W(e.c),a),a+=16),n&&(r.set(B(e.w),a),a+=20),r}function me(e){if(e.length<21)return null;let t=e[0];if((t&15)!=2||t&192)return null;let n=(t&16)!=0,r=(t&32)!=0;if(!n&&!r)return null;let i=21+(n?16:0)+(r?20:0);if(e.length!==i)return null;let a=1,o=G(e.subarray(a,a+16));a+=16;let s=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(a,!1);a+=4;let c={v:2,m:o,t:s};if(n&&(c.c=G(e.subarray(a,a+16)),a+=16),r){let t=V(e.subarray(a,a+20));if(!z(t))return null;c.w=t,a+=20}return c}const K=`fCtx`;function q(e){if(e)try{if(H(e)){let t=pe(e);return t?j(t):void 0}return j(B(e.r))}catch(t){console.error(`Error compressing Frak context`,{e:t,context:e})}}function J(e){if(!(!e||e.length===0))try{let t=M(e);if(t.length!==20)return me(t)||void 0;let n=V(t);if(z(n))return{r:n}}catch(t){console.error(`Error decompressing Frak context`,{e:t,context:e})}}function he({url:e}){if(!e)return null;let t=L(new URL(e).searchParams,K);return t?J(t):null}function ge(e){return{utm_source:e.utmSource??`frak`,utm_medium:e.utmMedium??void 0,utm_campaign:e.utmCampaign??void 0,utm_content:e.utmContent,utm_term:e.utmTerm,via:e.via??void 0,ref:e.ref??void 0}}function _e(e,t){let n=ge(t??{});for(let[t,r]of Object.entries(n))r===void 0||r===``||e.searchParams.has(t)||e.searchParams.set(t,r)}function Y({url:e,context:t,attribution:n}){if(!e)return null;let r=q(t);if(!r)return null;let i=new URL(e);return R(i.searchParams,K),i.searchParams.set(K,r),_e(i,n),i.toString()}function X(e){let t=new URL(e);return R(t.searchParams,K),t.toString()}function ve({url:e,context:t}){if(!window.location?.href||typeof window>`u`){console.error(`No window found, can't update context`);return}let n=e??window.location.href,r;r=t===null?X(n):Y({url:n,context:t}),r&&window.history.replaceState(null,``,r.toString())}const ye={compress:q,decompress:J,parse:he,update:Y,remove:X,replaceUrl:ve},Z={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function Q(e){return e&&e in Z?e:`eur`}function be(e){return e?Z[e]??Z.eur:Z.eur}function xe(e,t){let n=be(t),r=Q(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function Se(e){return e?`${e}Amount`:`eurAmount`}const $=`frak:client`;function Ce(){let e=new CustomEvent($);window.dispatchEvent(e)}function we(e,t){if(window.FrakSetup?.client&&e===`add`){t();return}(e===`add`?window.addEventListener:window.removeEventListener)($,t,!1)}export{c as C,a as D,e as E,r as O,M as S,n as T,p as _,Q as a,le as b,se as c,F as d,I as f,H as g,de as h,xe as i,t as k,L as l,oe as m,we as n,N as o,j as p,Se as r,A as s,Ce as t,R as u,ye as v,f as w,P as x,_ as y};
|
package/cdn/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import(`https://cdn.jsdelivr.net/npm/@frak-labs/components@beta/cdn/loader.js?v=
|
|
1
|
+
import(`https://cdn.jsdelivr.net/npm/@frak-labs/components@beta/cdn/loader.js?v=1784124825508`);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import{n as e,s as t}from"./clientReady.CPe9C8dP.js";var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g={},_=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function b(e,t){for(var n in t)e[n]=t[n];return e}function x(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,t,r){var i,a,o,s={};for(o in t)o==`key`?i=t[o]:o==`ref`?a=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?n.call(arguments,2):r),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return C(e,s,i,a,null)}function C(e,t,n,a,o){var s={type:e,props:t,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++i,__i:-1,__u:0};return o==null&&r.vnode!=null&&r.vnode(s),s}function w(e){return e.children}function T(e,t){this.props=e,this.context=t}function E(e,t){if(t==null)return e.__?E(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`?E(e):null}function D(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],a=[],o=b({},t);o.__v=t.__v+1,r.vnode&&r.vnode(o),ie(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,n??E(t),!!(32&t.__u),a),o.__v=t.__v,o.__.__k[o.__i]=o,oe(i,o,a),t.__e=t.__=null,o.__e!=n&&O(o)}}function O(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}),O(e)}function k(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!A.__r++||o!=r.debounceRendering)&&((o=r.debounceRendering)||s)(A)}function A(){try{for(var e,t=1;a.length;)a.length>t&&a.sort(c),e=a.shift(),t=a.length,D(e)}finally{a.length=A.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,v,y,b=r&&r.__k||_,x=t.length;for(c=j(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||g,p.__i=d,v=ie(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&F(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(y=!!(4&p.__u))||f.__k===p.__k?(c=M(p,c,e,y),y&&f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function j(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]=C(null,o,null,null,null):y(o)?o=e.__k[a]=C(w,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=C(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=te(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=E(s)),le(s,s));return r}function M(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=M(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=E(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function N(e,t){return t||=[],e==null||typeof e==`boolean`||(y(e)?e.some(function(e){N(e,t)}):t.push(e)),t}function te(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 ne(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||v.test(t)?n:n+`px`}function P(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||ne(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ne(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(f,`$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[d]=r[d]:(n[d]=p,e.addEventListener(t,a?h:m,a)):e.removeEventListener(t,a?h:m,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 re(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[u]==null)t[u]=p++;else if(t[u]<n[d])return;return n(r.event?r.event(t):t)}}}function ie(e,t,n,i,a,o,s,c,l,u){var d,f,p,m,h,g,v,S,C,E,D,O,k,A,j,M,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[c=t.__e=n.__e]),(d=r.__b)&&d(t);n:if(typeof N==`function`){f=s.length;try{if(C=t.props,E=N.prototype&&N.prototype.render,D=(d=N.contextType)&&i[d.__c],O=d?D?D.props.value:d.__:i,n.__c?S=(p=t.__c=n.__c).__=p.__E:(E?t.__c=p=new N(C,O):(t.__c=p=new T(C,O),p.constructor=N,p.render=ue),D&&D.sub(p),p.state||={},p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),E&&p.__s==null&&(p.__s=p.state),E&&N.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=b({},p.__s)),b(p.__s,N.getDerivedStateFromProps(C,p.__s))),h=p.props,g=p.state,p.__v=t,m)E&&N.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),E&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(E&&N.getDerivedStateFromProps==null&&C!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(C,O),t.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(C,p.__s,O)){t.__v!=n.__v&&(p.props=C,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),_.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(C,p.__s,O),E&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,g,v)})}if(p.context=O,p.props=C,p.__P=e,p.__e=!1,k=r.__r,A=0,E)p.state=p.__s,p.__d=!1,k&&k(t),d=p.render(p.props,p.state,p.context),_.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&&(i=b(b({},i),p.getChildContext())),E&&!m&&p.getSnapshotBeforeUpdate!=null&&(v=p.getSnapshotBeforeUpdate(h,g)),j=d!=null&&d.type===w&&d.key==null?se(d.props.children):d,c=ee(e,y(j)?j:[j],t,n,i,a,o,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),S&&(p.__E=p.__=null)}catch(e){if(s.length=f,t.__v=null,l||o!=null){if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),t.__e=c}else if(o!=null)for(M=o.length;M--;)x(o[M])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||ae(t),r.__e(e,t,n)}}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=ce(n.__e,t,n,i,a,o,s,l,u);return(d=r.diffed)&&d(t),128&t.__u?void 0:c}function ae(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ae))}function oe(e,t,n){for(var i=0;i<n.length;i++)F(n[i],n[++i],n[++i]);r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function se(e){return typeof e!=`object`||!e||e.__b>0?e:y(e)?e.map(se):e.constructor===void 0?b({},e):null}function ce(e,t,i,a,o,s,c,l,u){var d,f,p,m,h,_,v,b=i.props||g,S=t.props,C=t.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!C&&(C?h.localName==C:h.nodeType==3)){e=h,s[d]=null;break}}if(e==null){if(C==null)return document.createTextNode(S);e=document.createElementNS(o,C,S.is&&S),l&&=(r.__m&&r.__m(t,s),!1),s=null}if(C==null)b===S||l&&e.data==S||(e.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&n.call(e.childNodes),!l&&s!=null)for(b={},d=0;d<e.attributes.length;d++)b[(h=e.attributes[d]).name]=h.value;for(d in b)h=b[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||P(e,d,null,h,o);for(d in S)h=S[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?_=h:d==`checked`?v=h:l&&typeof h!=`function`||b[d]===h||P(e,d,h,b[d],o);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,y(m)?m:[m],t,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&E(i,0),l,u),s!=null)for(d=s.length;d--;)x(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&_==null?e.removeAttribute(`value`):_!=null&&(_!==e[d]||C==`progress`&&!_||C==`option`&&_!=b[d])&&P(e,d,_,b[d],o),d=`checked`,v!=null&&v!=e[d]&&P(e,d,v,b[d],o))}return e}function F(e,t,n){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(e){r.__e(e,n)}}function le(e,t,n){var i,a;if(r.unmount&&r.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||F(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){r.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&le(i[a],t,n||typeof e.type!=`function`);n||x(e.__e),e.__c=e.__=e.__e=void 0}function ue(e,t,n){return this.constructor(e,n)}n=_.slice,r={__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}},i=0,T.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=b({},this.state);typeof e==`function`&&(e=e(b({},n),this.props)),e&&b(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),k(this))},T.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),k(this))},T.prototype.render=w,a=[],s=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},A.__r=0,l=Math.random().toString(8),u=`__d`+l,d=`__a`+l,f=/(PointerCapture)$|Capture$/i,p=0,m=re(!1),h=re(!0);var de=0;Array.isArray;function fe(e,t,n,i,a,o){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:--de,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return r.vnode&&r.vnode(u),u}var I,L,R,pe,z=0,me=[],B=r,he=B.__b,ge=B.__r,_e=B.diffed,ve=B.__c,V=B.unmount,ye=B.__;function H(e,t){B.__h&&B.__h(L,e,z||t),z=0;var n=L.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function U(e){return z=1,be(De,e)}function be(e,t,n){var r=H(I++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):De(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=L,!L.__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};L.__f=!0;var a=L.shouldComponentUpdate,o=L.componentWillUpdate;L.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)},L.shouldComponentUpdate=i}return r.__N||r.__}function W(e,t){var n=H(I++,3);!B.__s&&J(n.__H,t)&&(n.__=e,n.u=t,L.__H.__h.push(n))}function xe(e,t){var n=H(I++,4);!B.__s&&J(n.__H,t)&&(n.__=e,n.u=t,L.__h.push(n))}function Se(e){return z=5,G(function(){return{current:e}},[])}function G(e,t){var n=H(I++,7);return J(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ce(e,t){return z=8,G(function(){return e},t)}function we(){for(var e;e=me.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(K),t.__h.some(q),t.__h=[]}catch(n){t.__h=[],B.__e(n,e.__v)}}}B.__b=function(e){L=null,he&&he(e)},B.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ye&&ye(e,t)},B.__r=function(e){ge&&ge(e),I=0;var t=(L=e.__c).__H;t&&(R===L?(t.__h=[],L.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(K),t.__h.some(q),t.__h=[],I=0)),R=L},B.diffed=function(e){_e&&_e(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(me.push(t)!==1&&pe===B.requestAnimationFrame||((pe=B.requestAnimationFrame)||Ee)(we)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),R=L=null},B.__c=function(e,t){t.some(function(e){try{e.__h.some(K),e.__h=e.__h.filter(function(e){return!e.__||q(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],B.__e(n,e.__v)}}),ve&&ve(e,t)},B.unmount=function(e){V&&V(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{K(e)}catch(e){t=e}}),n.__H=void 0,t&&B.__e(t,n.__v))};var Te=typeof requestAnimationFrame==`function`;function Ee(e){var t,n=function(){clearTimeout(r),Te&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Te&&(t=requestAnimationFrame(n))}function K(e){var t=L,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),L=t}function q(e){var t=L;e.__c=e.__(),L=t}function J(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function De(e,t){return typeof t==`function`?t(e):t}function Oe(e,t){for(var n in t)e[n]=t[n];return e}function ke(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 Y(e,t){var n=t(),r=U({t:{__:n,u:t}}),i=r[0].t,a=r[1];return xe(function(){i.__=n,i.u=t,X(i)&&a({t:i})},[e,n,t]),W(function(){return X(i)&&a({t:i}),e(function(){X(i)&&a({t:i})})},[e]),n}function X(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 Ae(e,t){this.props=e,this.context=t}(Ae.prototype=new T).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(e,t){return ke(this.props,e)||ke(this.state,t)};var je=r.__b;r.__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 Me=r.__e;r.__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)}Me(e,t,n,r)};var Ne=r.unmount;function Pe(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=Oe({},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 Pe(e,t,n)})),e}function Fe(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Fe(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 Z(){this.__u=0,this.o=null,this.__b=null}function Ie(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Q(){this.i=null,this.l=null}r.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ne&&Ne(e)},(Z.prototype=new T).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=Ie(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]=Fe(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)},Z.prototype.componentWillUnmount=function(){this.o=[]},Z.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]=Pe(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&S(w,null,e.fallback);return i&&(i.__u&=-33),[S(w,null,t.__a?null:e.children),i]};var Le=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]}};(Q.prototype=new T).__a=function(e){var t=this,n=Ie(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Le(t,e,r)):i()};n?n(a):a()}},Q.prototype.render=function(e){this.i=null,this.l=new Map;var t=N(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},Q.prototype.componentDidUpdate=Q.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Le(e,n,t)})};var Re=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,ze=/^(?: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]/,Be=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ve=/[A-Z0-9]/g,He=typeof document<`u`,Ue=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};T.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(T.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var We=r.event;r.event=function(e){return We&&(e=We(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Ge={configurable:!0,get:function(){return this.class}},Ke=r.vnode;r.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||He&&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`||Ue(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Be.test(a)&&(a=s):s=a=`oninput`:i&&ze.test(a)?a=a.replace(Ve,`-$&`).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=N(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=N(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",Ge)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Re,Ke&&Ke(e)};var qe=r.__r;r.__r=function(e){qe&&qe(e),e.__c};var Je=r.diffed;r.diffed=function(e){Je&&Je(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 Ye(){let[n,r]=U(()=>window.FrakSetup?.config?.waitForBackendConfig===!1||t.isResolved),[i,a]=U(()=>t.getConfig().hidden??!1),[o,s]=U(()=>!!window.FrakSetup?.client);return W(()=>{let n=t.getConfig();n.isResolved&&(r(!0),a(n.hidden??!1)),window.FrakSetup?.client&&s(!0);let i=e=>{let t=e.detail;t.isResolved&&r(!0),a(t.hidden??!1)};window.addEventListener(`frak:config`,i);let o=()=>s(!0);return e(`add`,o),()=>{window.removeEventListener(`frak:config`,i),e(`remove`,o)}},[]),{shouldRender:n,isHidden:i,isClientReady:o}}function $(e){return typeof window>`u`?()=>{}:(window.addEventListener(`frak:config`,e),()=>window.removeEventListener(`frak:config`,e))}function Xe(){return typeof navigator>`u`?`en`:navigator.language?.split(`-`)[0]===`fr`?`fr`:`en`}function Ze(){return Y($,()=>t.getConfig().lang??Xe())}const Qe=`
|
|
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 $e(e,t){return t?`${Qe}\n${e}\n${t}`:`${Qe}\n${e}`}const et=`
|
|
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 tt(e){return t.getConfig().placements?.[e]}function nt(e){return Y($,Ce(()=>e?tt(e):void 0,[e]))}const rt={en:{buttonShare:{text:`Share and earn!`},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 on this site`,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 !`},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 sur ce site`,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{Ze as a,Y as c,U as d,W as f,w as h,et as i,Se as l,fe as m,nt as n,$ as o,Ce as p,$e as r,Ye as s,rt as t,G as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e}from"./actions-CMPlZ7CH.DZFAhfKm.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};
|