@frak-labs/components 1.0.13-beta.7dd0a654 → 1.0.13-beta.8cb0895d
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.CkdY2dLE.js → Banner.iJ5x28tk.js} +1 -1
- package/cdn/{ButtonShare.TML2w73z.js → ButtonShare.BZeKR-hd.js} +1 -1
- package/cdn/{ButtonWallet.B5dTOAAD.js → ButtonWallet.Dj1jDVJP.js} +1 -1
- package/cdn/{GiftIcon.Cwj0ODQr.js → GiftIcon.CaLXpf_N.js} +1 -1
- package/cdn/{OpenInAppButton.0v0WDxZL.js → OpenInAppButton.yXwlwLXg.js} +1 -1
- package/cdn/{PostPurchase.8Mm3PHA9.js → PostPurchase.BV89VKum.js} +1 -1
- package/cdn/{actions-CMPlZ7CH.CnK_0vla.js → actions-ZwjR7wGC.D_6Fe2BY.js} +1 -1
- package/cdn/clientReady.C1tlF1t3.js +1 -0
- package/cdn/components.js +1 -1
- package/cdn/{defaults.euOM2Ohv.js → defaults.BJwYl9e_.js} +1 -1
- package/cdn/{embeddedWallet.tIACkcKW.js → embeddedWallet.BQia5qIm.js} +1 -1
- package/cdn/loader.js +1 -1
- package/cdn/{rewards.CRzXPu4f.js → rewards.BEQfxfW5.js} +1 -1
- package/cdn/{sharingPage.BCDR1vjG.js → sharingPage.BtQp1-Ya.js} +1 -1
- package/cdn/{sharingPageProducts.DfJLxzSf.js → sharingPageProducts.tTg9fwRY.js} +1 -1
- package/cdn/useGlobalComponents.fw13Q-cs.js +1 -0
- package/cdn/{useLightDomStyles.DtTuCZg-.js → useLightDomStyles.D3a-XyzN.js} +1 -1
- package/cdn/useReward.BmakZwgd.js +1 -0
- package/package.json +18 -18
- package/cdn/clientReady.0RgyPOYT.js +0 -1
- package/cdn/useGlobalComponents.BokCTIp3.js +0 -1
- package/cdn/useReward.0RnHa3DJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{a as t,i as n,x as r}from"./clientReady.
|
|
1
|
+
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{a as t,i as n,x as r}from"./clientReady.C1tlF1t3.js";import{d as i,v as a}from"./actions-ZwjR7wGC.D_6Fe2BY.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.BJwYl9e_.js";import{a as h,i as g,n as _,r as v,t as y}from"./GiftIcon.CaLXpf_N.js";import{t as b}from"./useGlobalComponents.fw13Q-cs.js";import{t as x}from"./useLightDomStyles.D3a-XyzN.js";import{r as S}from"./rewards.BEQfxfW5.js";import{t as C}from"./useReward.BmakZwgd.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
2
|
from {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as e}from"./clientReady.
|
|
1
|
+
import{x as e}from"./clientReady.C1tlF1t3.js";import{t}from"./sharingPage.BtQp1-Ya.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.BJwYl9e_.js";import{t as l}from"./useGlobalComponents.fw13Q-cs.js";import{t as u}from"./useLightDomStyles.D3a-XyzN.js";import{r as d}from"./rewards.BEQfxfW5.js";import{t as f}from"./useReward.BmakZwgd.js";import{t as p}from"./embeddedWallet.BQia5qIm.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
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.
|
|
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.BJwYl9e_.js";import{t as u}from"./useReward.BmakZwgd.js";import{t as d}from"./embeddedWallet.BQia5qIm.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
2
|
.button {
|
|
3
3
|
all: unset;
|
|
4
4
|
position: fixed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./defaults.
|
|
1
|
+
import{m as e}from"./defaults.BJwYl9e_.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,h as t,m as n,x as r}from"./clientReady.
|
|
1
|
+
import{f as e,h as t,m as n,x as r}from"./clientReady.C1tlF1t3.js";import{a as i,m as a,n as o,s,t as c,u as l}from"./defaults.BJwYl9e_.js";import{t as u}from"./useLightDomStyles.D3a-XyzN.js";function d(t=`wallet`,i){let a=window.FrakSetup?.client;a&&r(a,`open_in_app_clicked`,{path:t,placement:i}),e(`${n}${t}`,{onFallback:()=>{a&&r(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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{B as t,x as n,z as r}from"./clientReady.
|
|
1
|
+
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{B as t,x as n,z as r}from"./clientReady.C1tlF1t3.js";import{m as i,r as a,u as o}from"./actions-ZwjR7wGC.D_6Fe2BY.js";import{t as s}from"./sharingPage.BtQp1-Ya.js";import{n as c}from"./sharingPageProducts.tTg9fwRY.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.BJwYl9e_.js";import{r as ne,t as re}from"./GiftIcon.CaLXpf_N.js";import{t as ie}from"./useGlobalComponents.fw13Q-cs.js";import{t as ae}from"./useLightDomStyles.D3a-XyzN.js";import{i as oe,n as _,r as v}from"./rewards.BEQfxfW5.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
2
|
padding: 16px;
|
|
3
3
|
border-radius: 12px;
|
|
4
4
|
background-color: var(--surface-background__pbq4akc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,L as t,M as n,N as r,O as i,R as a,b as o,j as s,k as c,x as l}from"./clientReady.
|
|
1
|
+
import{I as e,L as t,M as n,N as r,O as i,R as a,b as o,j as s,k as c,x as l}from"./clientReady.C1tlF1t3.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 r=e();if(!r)return;let i=await o.resolveMerchantId();if(!i)return;let a=`frak-identity-ensured-${i}`;if(!window.sessionStorage.getItem(a))try{let e=n();(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":r},body:JSON.stringify({merchantId:i})})).ok&&window.sessionStorage.setItem(a,`1`)}catch{}}async function m(e,n){return t(()=>e.request({method:`frak_getMerchantInformation`}),{cacheKey:`frak_getMerchantInformation`,cacheTime:n?.cacheTime})}async function h(e,n){return t(()=>e.request({method:`frak_getMergeToken`}),{cacheKey:`frak_getMergeToken`,cacheTime:n?.cacheTime})}async function g(e,n){return t(()=>e.request({method:`frak_getUserReferralStatus`}),{cacheKey:`frak_getUserReferralStatus`,cacheTime:n?.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 c(t)?(l(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):i(t)?(l(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,n){return c(t)?t.w&&n?.wallet?r(t.w,n.wallet):t.c?e()===t.c:!1:i(t)&&n?.wallet?r(t.r,n.wallet):!1}function S(e,{walletStatus:t,frakContext:n,options:r}){if(!n)return`no-referrer`;if(x(n,t))return`self-referral`;if(!y(e,n,t))return`no-referrer`;let i=c(n)?n.m:r?.merchantId,a=r?.alwaysAppendUrl&&i?b(i,t?.wallet):null;return s.replaceUrl({url:window.location?.href,context:a}),l(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 r=window.sessionStorage.getItem(`frak-wallet-interaction-token`),i=e();if(!r&&!i){console.warn(`[Frak] No identity found, skipping purchase check`);return}let a=t.merchantId??await o.resolveMerchantId();if(!a){console.warn(`[Frak] No merchant id found, skipping purchase check`);return}let s={Accept:`application/json`,"Content-Type":`application/json`};r&&(s[`x-wallet-sdk-auth`]=r),i&&(s[`x-frak-client-id`]=i);let c=n();await fetch(`${c}/user/track/purchase`,{method:`POST`,headers:s,body:JSON.stringify({customerId:t.customerId,orderId:t.orderId,token:t.token,merchantId:a})})}function D(e,t){if(!t)return e.request({method:`frak_listenToWalletStatus`}).then(t=>(O(e,t),t));let n=new a,r=!1;return e.listenerRequest({method:`frak_listenToWalletStatus`},i=>{O(e,i),t(i),r||=(n.resolve(i),!0)}),n.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 ee(){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 te(){return(w??ee())?.config}function ne(){let e=w??ee();return e?Date.now()-e.timestamp<3e4:!1}function re(e){if(!(!S||!e.isResolved))try{let t={config:e,timestamp:Date.now()};localStorage.setItem(x.key,JSON.stringify(t)),w=t}catch{}}function ie(){if(S){w=null;try{localStorage.removeItem(x.key)}catch{}}}function ae(){S&&(window[v]||(window[v]=te()??C()))}function T(){return S?(ae(),window[v]??C()):C()}function E(e){S&&window.dispatchEvent(new CustomEvent(`frak:config`,{detail:e}))}function oe(e){return e??(S?window.location.hostname:``)}async function se(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 D={getConfig:T,get isResolved(){return T().isResolved},get isCacheFresh(){return ne()},setCacheScope(e,t){let n=`${e}:${t??``}`;x.key=`${y}:${n}`,w=null},setConfig(e){if(S&&(window[v]=e),re(e),E(e),S&&e.merchantId)try{sessionStorage.setItem(b,e.merchantId)}catch{}},reset(){let e=te()??C();S&&(window[v]=e),E(e)},clearCache(){if(ie(),p(),S)try{sessionStorage.removeItem(b)}catch{}},resolve(e,t,n){let r=oe(e);return r?f(async()=>{let e=await se(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=T();if(e.isResolved&&e.merchantId)return e.merchantId;if(S)try{return sessionStorage.getItem(b)??void 0}catch{}},async resolveMerchantId(e,t){return D.getMerchantId()||(await D.resolve(e,t))?.merchantId}};function O(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function k(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 A(e){return O(i(e))}function j(e,t,n,r,i,a){let o=A(ce({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 ce(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 M=`menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800`,N=`frak-sso`;async function le(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??j(i??`https://wallet.frak.id`,a,await D.resolveMerchantId()??``,n.name,c(),r?.css),s=window.open(o,N,M);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 ue(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 de(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 P(e,t){let n=t.toLowerCase(),r=[...e.keys()].filter(e=>e.toLowerCase()===n);for(let t of r)e.delete(t)}const fe=/^0x[a-fA-F0-9]{40}$/;function F(e){return typeof e==`string`&&fe.test(e)}function pe(e,t){return e.toLowerCase()===t.toLowerCase()}function me(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 he=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ge(e){let t=`0x`;for(let n=0;n<20;n++)t+=he[e[n]];return t}function _e(e){return`r`in e&&!(`v`in e)}function I(e){return`v`in e&&e.v===2}const ve=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function L(e){return typeof e==`string`&&ve.test(e)}function R(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 z(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 ye(e){if(!L(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`&&F(e.w);if(!t&&!n||t&&!L(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(R(e.m),a),a+=16,i.setUint32(a,e.t,!1),a+=4,t&&(r.set(R(e.c),a),a+=16),n&&(r.set(me(e.w),a),a+=20),r}function be(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=z(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=z(e.subarray(a,a+16)),a+=16),r){let t=ge(e.subarray(a,a+20));if(!F(t))return null;c.w=t,a+=20}return c}const B=`fCtx`;function V(e){if(e)try{if(I(e)){let t=ye(e);return t?O(t):void 0}return O(me(e.r))}catch(t){console.error(`Error compressing Frak context`,{e:t,context:e})}}function H(e){if(!(!e||e.length===0))try{let t=k(e);if(t.length!==20)return be(t)||void 0;let n=ge(t);if(F(n))return{r:n}}catch(t){console.error(`Error decompressing Frak context`,{e:t,context:e})}}function xe({url:e}){if(!e)return null;let t=de(new URL(e).searchParams,B);return t?H(t):null}function Se(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 Ce(e,t){let n=Se(t??{});for(let[t,r]of Object.entries(n))r!==void 0&&r!==``&&(e.searchParams.has(t)||e.searchParams.set(t,r))}function U({url:e,context:t,attribution:n}){if(!e)return null;let r=V(t);if(!r)return null;let i=new URL(e);return P(i.searchParams,B),i.searchParams.set(B,r),Ce(i,n),i.toString()}function W(e){let t=new URL(e);return P(t.searchParams,B),t.toString()}function we({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?W(n):U({url:n,context:t}),r&&window.history.replaceState(null,``,r.toString())}const Te={compress:V,decompress:H,parse:xe,update:U,remove:W,replaceUrl:we},G={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function K(e){return e&&e in G?e:`eur`}function Ee(e){return e?G[e]??G.eur:G.eur}function De(e,t){let n=Ee(t),r=K(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function Oe(e){return e?`${e}Amount`:`eurAmount`}var ke=class{constructor(e){this.baseUrl=e.baseUrl,this.headers={"Content-Type":`application/json`,...e.defaultHeaders},this.maxRetries=e.maxRetries??3,this.initialRetryDelay=e.initialRetryDelay??500}async resolveHeaders(){let e={};for(let[t,n]of Object.entries(this.headers)){let r=await n;r!==null&&(e[t]=r)}return e}addHeader(e,t){this.headers[e]=t}async post(e,t,n,r){try{let r=await fetch(e,{method:`POST`,headers:await this.resolveHeaders(),body:t?JSON.stringify(t??{}):void 0,keepalive:!0,...n});if(r.status===401)return null;if(r.status!==200&&r.status!==202)throw Error(`HTTP error! status: ${r.status}`);let i=await r.text();return i?JSON.parse(i):null}catch(i){if(r<this.maxRetries){let i=this.initialRetryDelay*2**r;return await new Promise(e=>setTimeout(e,i)),this.post(e,t,n,r+1)}return console.error(`Max retries reached:`,i),null}}async fetch(e,t,n={}){let r=`${this.baseUrl}${e}`;return this.post(r,t,n,0)}},Ae=class{constructor(e){this.groups=[],this.queue=[],this.options=e;let t={"openpanel-client-id":e.clientId};e.clientSecret&&(t[`openpanel-client-secret`]=e.clientSecret),t[`openpanel-sdk-name`]=e.sdk||`node`,t[`openpanel-sdk-version`]=e.sdkVersion||`1.3.1`,this.api=new ke({baseUrl:e.apiUrl||`https://api.openpanel.dev`,defaultHeaders:t})}init(){}ready(){this.options.disabled=!1,this.options.waitForProfile=!1,this.flush()}shouldQueue(e){return!!(this.options.disabled||this.options.waitForProfile&&!this.profileId||e.type===`replay`&&!this.sessionId)}addQueue(e){e.type===`track`&&(e.payload.properties={...e.payload.properties??{},__timestamp:new Date().toISOString()}),this.queue.push(e)}async send(e){if(this.options.filter&&!this.options.filter(e))return Promise.resolve();if(this.shouldQueue(e))return this.addQueue(e),Promise.resolve();let t=await this.api.fetch(`/track`,e,{keepalive:e.type!==`replay`});this.deviceId=t?.deviceId;let n=!!this.sessionId;return this.sessionId=t?.sessionId,!n&&this.sessionId&&this.flush(),t}setGlobalProperties(e){this.global={...this.global,...e}}track(e,t){this.log(`track event`,e,t);let{groups:n,profileId:r,...i}=t??{},a=[...new Set([...this.groups,...n??[]])];return this.send({type:`track`,payload:{name:e,profileId:r??this.profileId,groups:a.length>0?a:void 0,properties:{...this.global??{},...i}}})}identify(e){if(this.log(`identify user`,e),e.profileId&&(this.profileId=e.profileId,this.flush()),e.profileId&&Object.keys(e).length>1)return this.send({type:`identify`,payload:{...e,properties:{...this.global,...e.properties}}})}upsertGroup(e){return this.log(`upsert group`,e),this.send({type:`group`,payload:e})}setGroup(e){return this.log(`set group`,e),this.groups.includes(e)||(this.groups=[...this.groups,e]),this.send({type:`assign_group`,payload:{groupIds:[e],profileId:this.profileId}})}setGroups(e){return this.log(`set groups`,e),this.groups=[...new Set([...this.groups,...e])],this.send({type:`assign_group`,payload:{groupIds:e,profileId:this.profileId}})}alias(e){}increment(e){return this.send({type:`increment`,payload:e})}decrement(e){return this.send({type:`decrement`,payload:e})}revenue(e,t){let n=t?.deviceId;return delete t?.deviceId,this.track(`revenue`,{...t??{},...n?{__deviceId:n}:{},__revenue:e})}getDeviceId(){return this.deviceId??``}getSessionId(){return this.sessionId??``}fetchDeviceId(){return Promise.resolve(this.deviceId??``)}clear(){this.profileId=void 0,this.groups=[],this.deviceId=void 0,this.sessionId=void 0}buildFlushPayload(e){if(e.type===`replay`)return e.payload;if(e.type===`track`){let t=`groups`in e.payload?e.payload.groups??[]:[],n=[...new Set([...this.groups,...t])];return{...e.payload,profileId:e.payload.profileId??this.profileId,groups:n.length>0?n:void 0}}return e.type===`identify`||e.type===`increment`||e.type===`decrement`||e.type===`assign_group`?{...e.payload,profileId:e.payload.profileId??this.profileId}:e.payload}flush(){let e=[];for(let t of this.queue){if(this.shouldQueue(t)){e.push(t);continue}let n=this.buildFlushPayload(t);this.send({...t,payload:n})}this.queue=e}log(...e){this.options.debug&&console.log(`[OpenPanel.dev]`,...e)}},je=typeof document<`u`?document.currentScript:null;function Me(e){return e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``))}var Ne=class extends Ae{constructor(e){if(super({sdk:`web`,sdkVersion:`1.4.1`,...e}),this.options=e,this.lastPath=``,this.pendingRevenues=[],!this.isServer()){try{let e=sessionStorage.getItem(`openpanel-pending-revenues`);if(e){let t=JSON.parse(e);Array.isArray(t)&&(this.pendingRevenues=t)}}catch{this.pendingRevenues=[]}if(this.setGlobalProperties({__referrer:document.referrer}),this.options.trackScreenViews&&(this.trackScreenViews(),setTimeout(()=>this.screenView(),0)),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackAttributes&&this.trackAttributes(),this.options.sessionReplay?.enabled){let e=this.options.sessionReplay.sampleRate??1;Math.random()<e&&this.loadReplayModule().then(e=>{e&&e.startReplayRecorder(this.options.sessionReplay,e=>{this.send({type:`replay`,payload:{...e}})})})}}}async loadReplayModule(){try{if(typeof __OPENPANEL_REPLAY_URL__<`u`){let e=je,t=this.options.sessionReplay?.scriptUrl||e?.src?.replace(`.js`,`-replay.js`)||`https://openpanel.dev/op1-replay.js`;return window.__openpanel_replay?window.__openpanel_replay:new Promise(e=>{let n=document.createElement(`script`);n.src=t,n.onload=()=>{e(window.__openpanel_replay??null)},n.onerror=()=>{console.warn(`[OpenPanel] Failed to load replay script from`,t),e(null)},document.head.appendChild(n)})}return await import(`./replay-V6FXES7X.CgBxdfNp.js`)}catch(e){return console.warn(`[OpenPanel] Failed to load replay module`,e),null}}debounce(e,t){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(e,t)}isServer(){return typeof document>`u`}trackOutgoingLinks(){this.isServer()||document.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`a`);if(n&&t){let e=n.getAttribute(`href`);if(e?.startsWith(`http`))try{let r=new URL(e),i=window.location.hostname;r.hostname!==i&&super.track(`link_out`,{href:e,text:n.innerText||n.getAttribute(`title`)||t.getAttribute(`alt`)||t.getAttribute(`title`)})}catch{}}})}trackScreenViews(){if(this.isServer())return;let e=history.pushState;history.pushState=function(...t){let n=e.apply(this,t);return window.dispatchEvent(new Event(`pushstate`)),window.dispatchEvent(new Event(`locationchange`)),n};let t=history.replaceState;history.replaceState=function(...e){let n=t.apply(this,e);return window.dispatchEvent(new Event(`replacestate`)),window.dispatchEvent(new Event(`locationchange`)),n},window.addEventListener(`popstate`,()=>{window.dispatchEvent(new Event(`locationchange`))});let n=()=>this.debounce(()=>this.screenView(),50);this.options.trackHashChanges?window.addEventListener(`hashchange`,n):window.addEventListener(`locationchange`,n)}trackAttributes(){this.isServer()||document.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`button`),r=t.closest(`a`),i=n?.getAttribute(`data-track`)?n:r?.getAttribute(`data-track`)?r:null;if(i){let e={};for(let t of i.attributes)t.name.startsWith(`data-`)&&t.name!==`data-track`&&(e[Me(t.name.replace(/^data-/,``))]=t.value);let t=i.getAttribute(`data-track`);t&&super.track(t,e)}})}track(e,t){return super.track(e,{...t,__path:this.lastPath})}screenView(e,t){if(this.isServer())return;let n,r;typeof e==`string`?(n=e,r=t):(n=window.location.href,r=e),this.lastPath!==n&&(this.lastPath=n,super.track(`screen_view`,{...r??{},__path:n,__title:document.title}))}async flushRevenue(){let e=this.pendingRevenues.map(e=>super.revenue(e.amount,e.properties));await Promise.all(e),this.clearRevenue()}clearRevenue(){if(this.pendingRevenues=[],!this.isServer())try{sessionStorage.removeItem(`openpanel-pending-revenues`)}catch{}}pendingRevenue(e,t){if(this.pendingRevenues.push({amount:e,properties:t}),!this.isServer())try{sessionStorage.setItem(`openpanel-pending-revenues`,JSON.stringify(this.pendingRevenues))}catch{}}};const q=`nexus-wallet-backup`,J=`frakwallet://`;function Y(e){let t=e?.split(`-`)[0]?.toLowerCase();return t===`en`||t===`fr`?t:void 0}function Pe(){return(typeof document<`u`?Y(document.documentElement.lang):void 0)||(typeof navigator<`u`?Y(navigator.language):void 0)}function Fe(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href),r=n.searchParams.get(`sso`);r&&(t.then(()=>{e.sendLifecycle({clientLifecycle:`sso-redirect-complete`,data:{compressed:r}}),console.log(`[SSO URL Listener] Forwarded compressed SSO data to iframe`)}).catch(e=>{console.error(`[SSO URL Listener] Failed to forward SSO data:`,e)}),n.searchParams.delete(`sso`),window.history.replaceState({},``,n.toString()),console.log(`[SSO URL Listener] SSO parameter detected and URL cleaned`))}function Ie(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}const Le=J.replace(`://`,``);function Re(e){return`intent://${e.slice(13)}#Intent;scheme=${Le};end`}function ze(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=Ie()&&Be(e)?Re(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function Be(e){return e.startsWith(J)}function Ve(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;return!!(/iPhone|iPad|iPod/i.test(e)||/Macintosh/i.test(e)&&navigator.maxTouchPoints>1)}const X=Ve();function He(){return typeof navigator>`u`?!1:X?!0:/Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Ue(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent.toLowerCase();return e.includes(`instagram`)||e.includes(`fban`)||e.includes(`fbav`)||e.includes(`facebook`)}const We=Ue();function Ge(e){X&&e.startsWith(`https://`)?window.location.href=`x-safari-https://${e.slice(8)}`:X&&e.startsWith(`http://`)?window.location.href=`x-safari-http://${e.slice(7)}`:window.location.href=`https://backend.frak.id/common/social?u=${encodeURIComponent(e)}`}const Z={id:`frak-wallet`,name:`frak-wallet`,title:`Frak Wallet`,allow:`publickey-credentials-get *; clipboard-write; web-share *`,style:{width:`0`,height:`0`,border:`0`,position:`absolute`,zIndex:2000001,top:`-1000px`,left:`-1000px`,colorScheme:`auto`}};function Ke({walletBaseUrl:e,config:t}){let n=document.querySelector(`#frak-wallet`);n&&n.remove();let r=document.createElement(`iframe`);r.id=Z.id,r.name=Z.name,r.allow=Z.allow,r.style.zIndex=Z.style.zIndex.toString(),Q({iframe:r,isVisible:!1});let i=t?.walletUrl??e??`https://wallet.frak.id`,a=c();return Ye(i),Ye(_(i)),r.src=qe({walletUrl:i,clientId:a,preload:t?.preload}),new Promise(e=>{r.addEventListener(`load`,()=>e(r)),document.body.appendChild(r)})}function qe({walletUrl:e,clientId:t,preload:n}){let r=`${e}/listener?clientId=${encodeURIComponent(t)}`;return!n||n.length===0?r:`${r}#preload=${n.join(`,`)}`}function Q({iframe:e,isVisible:t}){if(!t){e.style.width=`0`,e.style.height=`0`,e.style.border=`0`,e.style.position=`fixed`,e.style.top=`-1000px`,e.style.left=`-1000px`;return}e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`auto`}function Je(e=`/listener`){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function Ye(e){if(!(typeof document>`u`))try{let t=new URL(e).origin,n=`link[rel="preconnect"][data-frak-preconnect="${t}"]`;if(document.head.querySelector(n))return;let r=document.createElement(`link`);r.rel=`preconnect`,r.href=t,r.crossOrigin=``,r.dataset.frakPreconnect=t,document.head.appendChild(r)}catch{}}const Xe=X&&We;function Ze(e){e?localStorage.setItem(q,e):localStorage.removeItem(q)}function $(e,t){try{let n=new URL(e);if(!n.searchParams.has(`u`))return e;let r=et(window.location.href,t);return n.searchParams.delete(`u`),n.searchParams.append(`u`,r),n.toString()}catch{return e}}function Qe(e){let t=new URL(window.location.href);e&&t.searchParams.set(`fmt`,e);let n=t.protocol===`http:`?`x-safari-http`:`x-safari-https`;window.location.href=`${n}://${t.host}${t.pathname}${t.search}${t.hash}`}function $e(e){return e.includes(`/common/social`)}function et(e,t){if(!t)return e;try{let n=new URL(e);return n.searchParams.set(`fmt`,t),n.toString()}catch{return`${e}${e.includes(`?`)?`&`:`?`}fmt=${encodeURIComponent(t)}`}}function tt(e,t,n,r,i){if(i){let e=$(t,r);window.open(e,`_blank`);return}if(Be(t)){let i=$(t,r);ze(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}})}else if(Xe&&$e(t))Qe(r);else{let e=$(t,r);window.location.href=e}}function nt({iframe:e,targetOrigin:t}){let r=new n;return{handleEvent:n=>{if(!(`iframeLifecycle`in n))return;let{iframeLifecycle:i,data:a}=n;switch(i){case`connected`:r.resolve(!0);break;case`do-backup`:Ze(a.backup);break;case`remove-backup`:localStorage.removeItem(q);break;case`show`:case`hide`:Q({iframe:e,isVisible:i===`show`});break;case`redirect`:tt(e,a.baseRedirectUrl,t,a.mergeToken,a.openInNewTab);break}},isConnected:r.promise}}function rt({config:i,iframe:a}){let o=i?.walletUrl??`https://wallet.frak.id`,s=i.metadata.lang??Pe(),l=i.domain??(typeof window<`u`?window.location.hostname:``);D.setCacheScope(l,s),D.reset();let u=D.isCacheFresh?void 0:D.resolve(i.domain,i.walletUrl,s),d=nt({iframe:a,targetOrigin:o}),f=new n,m=Date.now();if(!a.contentWindow)throw new t(e.configError,`The iframe does not have a content window`);let h=r({emittingTransport:a.contentWindow,listeningTransport:window,targetOrigin:o,middleware:[{async onRequest(n,r){if(!await d.isConnected)throw new t(e.clientNotConnected,`The iframe provider isn't connected yet`);return await f.promise,r}}],lifecycleHandlers:{iframeLifecycle:(e,t)=>{d.handleEvent(e)}}}),g=it(h,d),_=async()=>{g(),h.cleanup(),a.remove(),p(),D.clearCache(),D.reset()},v;{console.log(`[Frak SDK] Initializing OpenPanel`),v=new Ne({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdk_version`in t.properties||(t.properties={...t.properties,sdk_version:`1.2.1`,user_anonymous_client_id:c()}),!0)}),v.setGlobalProperties({sdk_version:`1.2.1`,user_anonymous_client_id:c()}),v.init(),v.track(`sdk_initialized`,{sdk_version:`1.2.1`});let e=!1,t=setTimeout(()=>{e||(e=!0,v?.track(`sdk_iframe_handshake_failed`,{reason:`timeout`}))},3e4);d.isConnected.then(()=>{e||(e=!0,clearTimeout(t),v?.track(`sdk_iframe_connected`,{handshake_duration_ms:Date.now()-m}))}).catch(()=>{e||(e=!0,clearTimeout(t),v?.track(`sdk_iframe_handshake_failed`,{reason:`unknown`}))})}let y=at({config:i,rpcClient:h,lifecycleManager:d,configPromise:u,contextSent:f,openPanel:v}).then(()=>{}).catch(e=>{throw f.reject(e),e});return{config:i,waitForConnection:d.isConnected,waitForSetup:y,request:h.request,listenerRequest:h.listen,destroy:_,openPanel:v}}function it(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,250),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function at({config:e,rpcClient:t,lifecycleManager:n,configPromise:r,contextSent:i,openPanel:a}){await n.isConnected,Fe(t,n.isConnected);let o=new URL(window.location.href),s=o.searchParams.get(`fmt`)??void 0;s&&(o.searchParams.delete(`fmt`),window.history.replaceState({},``,o.toString()));let l=t=>{let n=t?.merchantId??e.metadata.merchantId??``,r=t?.domain??``,i=t?.allowedDomains??[],a=t?.sdkConfig,o=a?.attribution||e.attribution?{...e.attribution,...a?.attribution}:void 0;D.setConfig(a?{isResolved:!0,merchantId:n,domain:r,allowedDomains:i,hasRawSdkConfig:!0,name:a.name??e.metadata.name,logoUrl:a.logoUrl??e.metadata.logoUrl,homepageLink:a.homepageLink??e.metadata.homepageLink,lang:a.lang??e.metadata.lang,currency:a.currency??e.metadata.currency,hidden:a.hidden,css:a.css,translations:a.translations,placements:a.placements,components:a.components,attribution:o}:{isResolved:!0,merchantId:n,domain:r,allowedDomains:i,name:e.metadata.name,logoUrl:e.metadata.logoUrl,homepageLink:e.metadata.homepageLink,lang:e.metadata.lang,currency:e.metadata.currency,attribution:o})},u=!1,d=e=>{let n=u?void 0:s;u=!0;let r=e.hasRawSdkConfig?{name:e.name,logoUrl:e.logoUrl,homepageLink:e.homepageLink,lang:e.lang,currency:e.currency,hidden:e.hidden,css:e.css,translations:e.translations,placements:e.placements,attribution:e.attribution}:e.attribution?{attribution:e.attribution}:void 0,i=c();if(a){let t=a.global??{};a.setGlobalProperties({...t,merchant_id:e.merchantId,domain:e.domain??``})}t.sendLifecycle({clientLifecycle:`resolved-config`,data:{merchantId:e.merchantId,domain:e.domain??``,allowedDomains:e.allowedDomains??[],sourceUrl:window.location.href,...i&&{sdkAnonymousId:i},...n&&{pendingMergeToken:n},...r&&{sdkConfig:r}}})};D.isResolved&&(d(D.getConfig()),i.resolve()),r&&(l(await r),d(D.getConfig()),i.resolve());async function f(){let n=e.customizations?.css;n&&t.sendLifecycle({clientLifecycle:`modal-css`,data:{cssLink:n}})}async function p(){let n=e.customizations?.i18n;n&&t.sendLifecycle({clientLifecycle:`modal-i18n`,data:{i18n:n}})}async function m(){if(typeof window>`u`)return;let e=window.localStorage.getItem(q);e&&t.sendLifecycle({clientLifecycle:`restore-backup`,data:{backup:e}})}(await Promise.allSettled([f(),p(),m()])).some(e=>e.status===`rejected`)&&a?.track(`sdk_iframe_handshake_failed`,{reason:`asset_push`})}function ot(e){return a(k(e))}async function st({config:e}){let t=ct(e),n=await Ke({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=rt({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function ct(e){let t=K(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}function lt({perCall:e,defaults:t,productUtmContent:n}){if(e===null)return;let r=e!==void 0,i=t!==void 0&&Object.keys(t).length>0;if(!r&&!i&&(n===void 0||n===``))return;let a={...t,...e??{}},o=n??e?.utmContent;return o!==void 0&&o!==``?a.utmContent=o:delete a.utmContent,a}const ut=`frak:client`;function dt(){let e=new CustomEvent(ut);window.dispatchEvent(e)}function ft(e,t){if(window.FrakSetup?.client&&e===`add`){t();return}(e===`add`?window.addEventListener:window.removeEventListener)(ut,t,!1)}export{p as A,t as B,P as C,le as D,O as E,k as F,c as I,f as L,_ as M,pe as N,_e as O,j as P,n as R,de as S,N as T,De as _,We as a,D as b,lt as c,Z as d,ze as f,Oe as g,He as h,Ge as i,Te as j,I as k,st as l,J as m,ft as n,ot as o,Pe as p,X as r,rt as s,dt as t,Je as u,K as v,M as w,ue as x,A as y,e as z};
|
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=1785161687459`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as e,n as t,p as n}from"./clientReady.0RgyPOYT.js";var r,i,a,o,s,c,l,u,d,f,p,m,h,g,_={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function x(e,t){for(var n in t)e[n]=t[n];return e}function S(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function C(e,t,n){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?r.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return w(e,s,i,a,null)}function w(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++a,__i:-1,__u:0};return o==null&&i.vnode!=null&&i.vnode(s),s}function T(e){return e.children}function E(e,t){this.props=e,this.context=t}function D(e,t){if(t==null)return e.__?D(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`?D(e):null}function O(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],a=[],o=x({},t);o.__v=t.__v+1,i.vnode&&i.vnode(o),ie(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??D(t),!!(32&t.__u),a),o.__v=t.__v,o.__.__k[o.__i]=o,oe(r,o,a),t.__e=t.__=null,o.__e!=n&&k(o)}}function k(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}),k(e)}function A(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!j.__r++||s!=i.debounceRendering)&&((s=i.debounceRendering)||c)(j)}function j(){try{for(var e,t=1;o.length;)o.length>t&&o.sort(l),e=o.shift(),t=o.length,O(e)}finally{o.length=j.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,y,b=r&&r.__k||v,x=t.length;for(c=M(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||_,p.__i=d,g=ie(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&I(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=N(p,c,e,y),y&&f.__e&&(f.__e=null)):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function M(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]=w(null,o,null,null,null):b(o)?o=e.__k[a]=w(T,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=w(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=D(s)),le(s,s));return r}function N(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=N(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=D(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function P(e,t){return t||=[],e==null||typeof e==`boolean`||(b(e)?e.some(function(e){P(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`||y.test(t)?n:n+`px`}function F(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||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(p,`$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[f]=r[f]:(n[f]=m,e.addEventListener(t,a?g:h,a)):e.removeEventListener(t,a?g:h,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[d]==null)t[d]=m++;else if(t[d]<n[f])return;return n(i.event?i.event(t):t)}}}function ie(e,t,n,r,a,o,s,c,l,u){var d,f,p,m,h,g,_,y,C,w,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=i.__b)&&d(t);n:if(typeof N==`function`){f=s.length;try{if(C=t.props,w=N.prototype&&N.prototype.render,D=(d=N.contextType)&&r[d.__c],O=d?D?D.props.value:d.__:r,n.__c?y=(p=t.__c=n.__c).__=p.__E:(w?t.__c=p=new N(C,O):(t.__c=p=new E(C,O),p.constructor=N,p.render=ue),D&&D.sub(p),p.state||={},p.__n=r,m=p.__d=!0,p.__h=[],p._sb=[]),w&&p.__s==null&&(p.__s=p.state),w&&N.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=x({},p.__s)),x(p.__s,N.getDerivedStateFromProps(C,p.__s))),h=p.props,g=p.state,p.__v=t,m)w&&N.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),w&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(w&&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)}),v.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),w&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,g,_)})}if(p.context=O,p.props=C,p.__P=e,p.__e=!1,k=i.__r,A=0,w)p.state=p.__s,p.__d=!1,k&&k(t),d=p.render(p.props,p.state,p.context),v.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,k&&k(t),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++A<25);p.state=p.__s,p.getChildContext!=null&&(r=x(x({},r),p.getChildContext())),w&&!m&&p.getSnapshotBeforeUpdate!=null&&(_=p.getSnapshotBeforeUpdate(h,g)),j=d!=null&&d.type===T&&d.key==null?se(d.props.children):d,c=ee(e,b(j)?j:[j],t,n,r,a,o,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),y&&(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--;)S(o[M])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||ae(t),i.__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,r,a,o,s,l,u);return(d=i.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 r=0;r<n.length;r++)I(n[r],n[++r],n[++r]);i.__c&&i.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){i.__e(e,t.__v)}})}function se(e){return typeof e!=`object`||!e||e.__b>0?e:b(e)?e.map(se):e.constructor===void 0?x({},e):null}function ce(e,t,n,a,o,s,c,l,u){var d,f,p,m,h,g,v,y=n.props||_,x=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(x);e=document.createElementNS(o,C,x.is&&x),l&&=(i.__m&&i.__m(t,s),!1),s=null}if(C==null)y===x||l&&e.data==x||(e.data=x);else{if(s=C==`textarea`&&x.defaultValue!=null?null:s&&r.call(e.childNodes),!l&&s!=null)for(y={},d=0;d<e.attributes.length;d++)y[(h=e.attributes[d]).name]=h.value;for(d in y)h=y[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in x||d==`value`&&`defaultValue`in x||d==`checked`&&`defaultChecked`in x||F(e,d,null,h,o);for(d in x)h=x[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?v=h:l&&typeof h!=`function`||y[d]===h||F(e,d,h,y[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,b(m)?m:[m],t,n,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:n.__k&&D(n,0),l,u),s!=null)for(d=s.length;d--;)S(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&g==null?e.removeAttribute(`value`):g!=null&&(g!==e[d]||C==`progress`&&!g||C==`option`&&g!=y[d])&&F(e,d,g,y[d],o),d=`checked`,v!=null&&v!=e[d]&&F(e,d,v,y[d],o))}return e}function I(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){i.__e(e,n)}}function le(e,t,n){var r,a;if(i.unmount&&i.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||I(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){i.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&le(r[a],t,n||typeof e.type!=`function`);n||S(e.__e),e.__c=e.__=e.__e=void 0}function ue(e,t,n){return this.constructor(e,n)}r=v.slice,i={__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}},a=0,E.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=x({},this.state);typeof e==`function`&&(e=e(x({},n),this.props)),e&&x(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),A(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},E.prototype.render=T,o=[],c=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},j.__r=0,u=Math.random().toString(8),d=`__d`+u,f=`__a`+u,p=/(PointerCapture)$|Capture$/i,m=0,h=re(!1),g=re(!0);var de=0;Array.isArray;function fe(e,t,n,r,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 i.vnode&&i.vnode(u),u}var L,R,z,pe,B=0,me=[],V=i,he=V.__b,ge=V.__r,_e=V.diffed,ve=V.__c,ye=V.unmount,be=V.__;function H(e,t){V.__h&&V.__h(R,e,B||t),B=0;var n=R.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function U(e){return B=1,xe(Oe,e)}function xe(e,t,n){var r=H(L++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Oe(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=R,!R.__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};R.__f=!0;var a=R.shouldComponentUpdate,o=R.componentWillUpdate;R.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)},R.shouldComponentUpdate=i}return r.__N||r.__}function W(e,t){var n=H(L++,3);!V.__s&&J(n.__H,t)&&(n.__=e,n.u=t,R.__H.__h.push(n))}function Se(e,t){var n=H(L++,4);!V.__s&&J(n.__H,t)&&(n.__=e,n.u=t,R.__h.push(n))}function Ce(e){return B=5,G(function(){return{current:e}},[])}function G(e,t){var n=H(L++,7);return J(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function we(e,t){return B=8,G(function(){return e},t)}function Te(){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=[],V.__e(n,e.__v)}}}V.__b=function(e){R=null,he&&he(e)},V.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),be&&be(e,t)},V.__r=function(e){ge&&ge(e),L=0;var t=(R=e.__c).__H;t&&(z===R?(t.__h=[],R.__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=[],L=0)),z=R},V.diffed=function(e){_e&&_e(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(me.push(t)!==1&&pe===V.requestAnimationFrame||((pe=V.requestAnimationFrame)||De)(Te)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),z=R=null},V.__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=[],V.__e(n,e.__v)}}),ve&&ve(e,t)},V.unmount=function(e){ye&&ye(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&&V.__e(t,n.__v))};var Ee=typeof requestAnimationFrame==`function`;function De(e){var t,n=function(){clearTimeout(r),Ee&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ee&&(t=requestAnimationFrame(n))}function K(e){var t=R,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),R=t}function q(e){var t=R;e.__c=e.__(),R=t}function J(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Oe(e,t){return typeof t==`function`?t(e):t}function ke(e,t){for(var n in t)e[n]=t[n];return e}function Ae(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 Se(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 je(e,t){this.props=e,this.context=t}(je.prototype=new E).isPureReactComponent=!0,je.prototype.shouldComponentUpdate=function(e,t){return Ae(this.props,e)||Ae(this.state,t)};var Me=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Me&&Me(e)},typeof Symbol<`u`&&Symbol.for;var Ne=i.__e;i.__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)}Ne(e,t,n,r)};var Pe=i.unmount;function Fe(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=ke({},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 Fe(e,t,n)})),e}function Ie(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ie(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 Le(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Q(){this.i=null,this.l=null}i.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pe&&Pe(e)},(Z.prototype=new E).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=Le(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]=Ie(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]=Fe(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&C(T,null,e.fallback);return i&&(i.__u&=-33),[C(T,null,t.__a?null:e.children),i]};var Re=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 E).__a=function(e){var t=this,n=Le(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Re(t,e,r)):i()};n?n(a):a()}},Q.prototype.render=function(e){this.i=null,this.l=new Map;var t=P(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Q.prototype.componentDidUpdate=Q.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Re(e,n,t)})};var ze=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Be=/^(?: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]/,Ve=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,He=/[A-Z0-9]/g,Ue=typeof document<`u`,We=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};E.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ge=i.event;i.event=function(e){return Ge&&(e=Ge(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Ke={configurable:!0,get:function(){return this.class}},qe=i.vnode;i.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||Ue&&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`||We(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Ve.test(a)&&(a=s):s=a=`oninput`:i&&Be.test(a)?a=a.replace(He,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=P(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=P(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",Ke)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=ze,qe&&qe(e)};var Je=i.__r;i.__r=function(e){Je&&Je(e),e.__c};var Ye=i.diffed;i.diffed=function(e){Ye&&Ye(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 Xe(){let[n,r]=U(()=>window.FrakSetup?.config?.waitForBackendConfig===!1||e.isResolved),[i,a]=U(()=>e.getConfig().hidden??!1),[o,s]=U(()=>!!window.FrakSetup?.client);return W(()=>{let n=e.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 t(`add`,o),()=>{window.removeEventListener(`frak:config`,i),t(`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 Ze(){return Y($,()=>e.getConfig().lang??n()??`en`)}const Qe=`
|
|
1
|
+
import{b as e,n as t,p as n}from"./clientReady.C1tlF1t3.js";var r,i,a,o,s,c,l,u,d,f,p,m,h,g,_={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function x(e,t){for(var n in t)e[n]=t[n];return e}function S(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function C(e,t,n){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?r.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return w(e,s,i,a,null)}function w(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++a,__i:-1,__u:0};return o==null&&i.vnode!=null&&i.vnode(s),s}function T(e){return e.children}function E(e,t){this.props=e,this.context=t}function D(e,t){if(t==null)return e.__?D(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`?D(e):null}function O(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],a=[],o=x({},t);o.__v=t.__v+1,i.vnode&&i.vnode(o),ie(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??D(t),!!(32&t.__u),a),o.__v=t.__v,o.__.__k[o.__i]=o,oe(r,o,a),t.__e=t.__=null,o.__e!=n&&k(o)}}function k(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}),k(e)}function A(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!j.__r++||s!=i.debounceRendering)&&((s=i.debounceRendering)||c)(j)}function j(){try{for(var e,t=1;o.length;)o.length>t&&o.sort(l),e=o.shift(),t=o.length,O(e)}finally{o.length=j.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,y,b=r&&r.__k||v,x=t.length;for(c=M(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||_,p.__i=d,g=ie(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&I(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=N(p,c,e,y),y&&f.__e&&(f.__e=null)):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function M(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]=w(null,o,null,null,null):b(o)?o=e.__k[a]=w(T,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=w(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=D(s)),le(s,s));return r}function N(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=N(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=D(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function P(e,t){return t||=[],e==null||typeof e==`boolean`||(b(e)?e.some(function(e){P(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`||y.test(t)?n:n+`px`}function F(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||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(p,`$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[f]=r[f]:(n[f]=m,e.addEventListener(t,a?g:h,a)):e.removeEventListener(t,a?g:h,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[d]==null)t[d]=m++;else if(t[d]<n[f])return;return n(i.event?i.event(t):t)}}}function ie(e,t,n,r,a,o,s,c,l,u){var d,f,p,m,h,g,_,y,C,w,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=i.__b)&&d(t);n:if(typeof N==`function`){f=s.length;try{if(C=t.props,w=N.prototype&&N.prototype.render,D=(d=N.contextType)&&r[d.__c],O=d?D?D.props.value:d.__:r,n.__c?y=(p=t.__c=n.__c).__=p.__E:(w?t.__c=p=new N(C,O):(t.__c=p=new E(C,O),p.constructor=N,p.render=ue),D&&D.sub(p),p.state||={},p.__n=r,m=p.__d=!0,p.__h=[],p._sb=[]),w&&p.__s==null&&(p.__s=p.state),w&&N.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=x({},p.__s)),x(p.__s,N.getDerivedStateFromProps(C,p.__s))),h=p.props,g=p.state,p.__v=t,m)w&&N.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),w&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(w&&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)}),v.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),w&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,g,_)})}if(p.context=O,p.props=C,p.__P=e,p.__e=!1,k=i.__r,A=0,w)p.state=p.__s,p.__d=!1,k&&k(t),d=p.render(p.props,p.state,p.context),v.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,k&&k(t),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++A<25);p.state=p.__s,p.getChildContext!=null&&(r=x(x({},r),p.getChildContext())),w&&!m&&p.getSnapshotBeforeUpdate!=null&&(_=p.getSnapshotBeforeUpdate(h,g)),j=d!=null&&d.type===T&&d.key==null?se(d.props.children):d,c=ee(e,b(j)?j:[j],t,n,r,a,o,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),y&&(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--;)S(o[M])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||ae(t),i.__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,r,a,o,s,l,u);return(d=i.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 r=0;r<n.length;r++)I(n[r],n[++r],n[++r]);i.__c&&i.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){i.__e(e,t.__v)}})}function se(e){return typeof e!=`object`||!e||e.__b>0?e:b(e)?e.map(se):e.constructor===void 0?x({},e):null}function ce(e,t,n,a,o,s,c,l,u){var d,f,p,m,h,g,v,y=n.props||_,x=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(x);e=document.createElementNS(o,C,x.is&&x),l&&=(i.__m&&i.__m(t,s),!1),s=null}if(C==null)y===x||l&&e.data==x||(e.data=x);else{if(s=C==`textarea`&&x.defaultValue!=null?null:s&&r.call(e.childNodes),!l&&s!=null)for(y={},d=0;d<e.attributes.length;d++)y[(h=e.attributes[d]).name]=h.value;for(d in y)h=y[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in x||d==`value`&&`defaultValue`in x||d==`checked`&&`defaultChecked`in x||F(e,d,null,h,o);for(d in x)h=x[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?v=h:l&&typeof h!=`function`||y[d]===h||F(e,d,h,y[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,b(m)?m:[m],t,n,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:n.__k&&D(n,0),l,u),s!=null)for(d=s.length;d--;)S(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&g==null?e.removeAttribute(`value`):g!=null&&(g!==e[d]||C==`progress`&&!g||C==`option`&&g!=y[d])&&F(e,d,g,y[d],o),d=`checked`,v!=null&&v!=e[d]&&F(e,d,v,y[d],o))}return e}function I(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){i.__e(e,n)}}function le(e,t,n){var r,a;if(i.unmount&&i.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||I(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){i.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&le(r[a],t,n||typeof e.type!=`function`);n||S(e.__e),e.__c=e.__=e.__e=void 0}function ue(e,t,n){return this.constructor(e,n)}r=v.slice,i={__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}},a=0,E.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=x({},this.state);typeof e==`function`&&(e=e(x({},n),this.props)),e&&x(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),A(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},E.prototype.render=T,o=[],c=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},j.__r=0,u=Math.random().toString(8),d=`__d`+u,f=`__a`+u,p=/(PointerCapture)$|Capture$/i,m=0,h=re(!1),g=re(!0);var de=0;Array.isArray;function fe(e,t,n,r,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 i.vnode&&i.vnode(u),u}var L,R,z,pe,B=0,me=[],V=i,he=V.__b,ge=V.__r,_e=V.diffed,ve=V.__c,ye=V.unmount,be=V.__;function H(e,t){V.__h&&V.__h(R,e,B||t),B=0;var n=R.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function U(e){return B=1,xe(Oe,e)}function xe(e,t,n){var r=H(L++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Oe(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=R,!R.__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};R.__f=!0;var a=R.shouldComponentUpdate,o=R.componentWillUpdate;R.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)},R.shouldComponentUpdate=i}return r.__N||r.__}function W(e,t){var n=H(L++,3);!V.__s&&J(n.__H,t)&&(n.__=e,n.u=t,R.__H.__h.push(n))}function Se(e,t){var n=H(L++,4);!V.__s&&J(n.__H,t)&&(n.__=e,n.u=t,R.__h.push(n))}function Ce(e){return B=5,G(function(){return{current:e}},[])}function G(e,t){var n=H(L++,7);return J(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function we(e,t){return B=8,G(function(){return e},t)}function Te(){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=[],V.__e(n,e.__v)}}}V.__b=function(e){R=null,he&&he(e)},V.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),be&&be(e,t)},V.__r=function(e){ge&&ge(e),L=0;var t=(R=e.__c).__H;t&&(z===R?(t.__h=[],R.__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=[],L=0)),z=R},V.diffed=function(e){_e&&_e(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(me.push(t)!==1&&pe===V.requestAnimationFrame||((pe=V.requestAnimationFrame)||De)(Te)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),z=R=null},V.__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=[],V.__e(n,e.__v)}}),ve&&ve(e,t)},V.unmount=function(e){ye&&ye(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&&V.__e(t,n.__v))};var Ee=typeof requestAnimationFrame==`function`;function De(e){var t,n=function(){clearTimeout(r),Ee&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ee&&(t=requestAnimationFrame(n))}function K(e){var t=R,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),R=t}function q(e){var t=R;e.__c=e.__(),R=t}function J(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Oe(e,t){return typeof t==`function`?t(e):t}function ke(e,t){for(var n in t)e[n]=t[n];return e}function Ae(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 Se(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 je(e,t){this.props=e,this.context=t}(je.prototype=new E).isPureReactComponent=!0,je.prototype.shouldComponentUpdate=function(e,t){return Ae(this.props,e)||Ae(this.state,t)};var Me=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Me&&Me(e)},typeof Symbol<`u`&&Symbol.for;var Ne=i.__e;i.__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)}Ne(e,t,n,r)};var Pe=i.unmount;function Fe(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=ke({},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 Fe(e,t,n)})),e}function Ie(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ie(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 Le(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Q(){this.i=null,this.l=null}i.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pe&&Pe(e)},(Z.prototype=new E).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=Le(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]=Ie(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]=Fe(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&C(T,null,e.fallback);return i&&(i.__u&=-33),[C(T,null,t.__a?null:e.children),i]};var Re=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 E).__a=function(e){var t=this,n=Le(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Re(t,e,r)):i()};n?n(a):a()}},Q.prototype.render=function(e){this.i=null,this.l=new Map;var t=P(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Q.prototype.componentDidUpdate=Q.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Re(e,n,t)})};var ze=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Be=/^(?: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]/,Ve=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,He=/[A-Z0-9]/g,Ue=typeof document<`u`,We=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};E.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ge=i.event;i.event=function(e){return Ge&&(e=Ge(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Ke={configurable:!0,get:function(){return this.class}},qe=i.vnode;i.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||Ue&&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`||We(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Ve.test(a)&&(a=s):s=a=`oninput`:i&&Be.test(a)?a=a.replace(He,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=P(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=P(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",Ke)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=ze,qe&&qe(e)};var Je=i.__r;i.__r=function(e){Je&&Je(e),e.__c};var Ye=i.diffed;i.diffed=function(e){Ye&&Ye(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 Xe(){let[n,r]=U(()=>window.FrakSetup?.config?.waitForBackendConfig===!1||e.isResolved),[i,a]=U(()=>e.getConfig().hidden??!1),[o,s]=U(()=>!!window.FrakSetup?.client);return W(()=>{let n=e.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 t(`add`,o),()=>{window.removeEventListener(`frak:config`,i),t(`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 Ze(){return Y($,()=>e.getConfig().lang??n()??`en`)}const Qe=`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./actions-
|
|
1
|
+
import{g as e}from"./actions-ZwjR7wGC.D_6Fe2BY.js";async function t(t,n){if(!window.FrakSetup?.client){console.error(`Frak client not found`);return}let r=window.FrakSetup?.modalWalletConfig??{};await e(window.FrakSetup.client,t?{...r,metadata:{...r.metadata,targetInteraction:t}}:r,n)}export{t};
|
package/cdn/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{t}from"./styleManager.Cun1-fKi.js";import{A as n,C as r,D as i,E as a,F as ee,I as o,L as s,M as c,N as te,P as ne,S as l,T as re,_ as ie,a as u,b as d,c as f,d as p,f as m,g as h,h as g,i as _,j as v,l as y,m as b,o as x,p as S,r as C,s as w,t as T,u as E,v as D,w as O,x as k,y as A}from"./clientReady.
|
|
1
|
+
import{t as e}from"./sharedBaseCss.css.BDzFcWnD.js";import{t}from"./styleManager.Cun1-fKi.js";import{A as n,C as r,D as i,E as a,F as ee,I as o,L as s,M as c,N as te,P as ne,S as l,T as re,_ as ie,a as u,b as d,c as f,d as p,f as m,g as h,h as g,i as _,j as v,l as y,m as b,o as x,p as S,r as C,s as w,t as T,u as E,v as D,w as O,x as k,y as A}from"./clientReady.C1tlF1t3.js";import{_ as j,a as M,c as N,d as P,f as F,g as I,h as L,i as ae,l as R,m as z,n as B,o as V,p as H,r as U,s as W,t as G,u as K,v as q}from"./actions-ZwjR7wGC.D_6Fe2BY.js";import{t as J}from"./sharingPage.BtQp1-Ya.js";import{t as oe}from"./sharingPageProducts.tTg9fwRY.js";var Y=Object.defineProperty,X=(e,t)=>{let n={};for(var r in e)Y(n,r,{get:e[r],enumerable:!0});return t||Y(n,Symbol.toStringTag,{value:`Module`}),n};function se(e){document.readyState===`complete`||document.readyState===`interactive`?setTimeout(e,1):document.addEventListener(`DOMContentLoaded`,e)}var ce=X({DEEP_LINK_SCHEME:()=>b,FrakContextManager:()=>v,areAddressesEqual:()=>te,base64urlDecode:()=>ee,base64urlEncode:()=>a,baseIframeProps:()=>p,clearAllCache:()=>n,compressJsonToB64:()=>A,createIFrameFrakClient:()=>w,decompressJsonFromB64:()=>x,deleteQueryParamCaseInsensitive:()=>r,detectPageLanguage:()=>S,findIframeInOpener:()=>E,formatAmount:()=>ie,generateSsoUrl:()=>ne,getBackendUrl:()=>c,getClientId:()=>o,getCurrencyAmountKey:()=>h,getQueryParamCaseInsensitive:()=>l,getSupportedCurrency:()=>D,isIOS:()=>C,isInAppBrowser:()=>u,isMobile:()=>g,mergeAttribution:()=>f,redirectToExternalBrowser:()=>_,sdkConfigStore:()=>d,setupClient:()=>y,ssoPopupFeatures:()=>O,ssoPopupName:()=>re,trackEvent:()=>k,triggerDeepLinkWithFallback:()=>m,withCache:()=>s}),le=X({REFERRAL_SUCCESS_EVENT:()=>q,displayEmbeddedWallet:()=>I,displayModal:()=>N,displaySharingPage:()=>R,ensureIdentity:()=>L,getMerchantInformation:()=>z,getMergeToken:()=>P,getUserReferralStatus:()=>K,modalBuilder:()=>H,openSso:()=>i,prepareSso:()=>W,processReferral:()=>M,referralInteraction:()=>G,sendInteraction:()=>j,sendTransaction:()=>F,setupReferral:()=>V,siweAuthenticate:()=>ae,trackPurchaseStatus:()=>U,watchWalletStatus:()=>B});const ue=[`frak-button-share`,`frak-button-wallet`,`frak-open-in-app`,`frak-post-purchase`,`frak-banner`].join(`,`);function de(){return typeof document>`u`||document.querySelector(ue)===null?[]:[`sharing`]}function Z(){return window.FrakSetup.core={...ce,...le},window.FrakSetup?.client?Promise.resolve():s(()=>fe(),{cacheKey:`frak-sdk-init`,cacheTime:1/0}).catch(e=>{k(window.FrakSetup?.client,`sdk_init_failed`,{reason:e instanceof Error?e.message:typeof e==`string`?e:`unknown`,config_missing:!window.FrakSetup?.config})})}async function fe(){if(!window.FrakSetup?.config)throw Error(`[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set.`);console.log(`[Frak SDK] Starting initialization`);let e=await y({config:pe(window.FrakSetup.config)});if(!e)throw Error(`[Frak SDK] Failed to create client`);window.FrakSetup.client=e,console.log(`[Frak SDK] Client initialized successfully`),T(),V(e),me()}function pe(e){return e.preload===void 0?{...e,preload:de()}:e}function me(){let e=new URL(window.location.href);if(l(e.searchParams,`frakAction`)?.toLowerCase()!==`share`)return;console.log(`[Frak SDK] Auto open share via query param`);let t=l(e.searchParams,`link`)??void 0,n=l(e.searchParams,`placement`)??void 0,i=oe(l(e.searchParams,`products`));r(e.searchParams,`frakAction`),r(e.searchParams,`link`),r(e.searchParams,`placement`),r(e.searchParams,`products`),window.history.replaceState({},``,e.toString()),J(void 0,n,{link:t,products:i})}t.injectBase(`shared`,e),t.injectBase(`fouce`,`frak-button-share:not(:defined), frak-button-wallet:not(:defined), frak-open-in-app:not(:defined), frak-post-purchase:not(:defined), frak-banner:not(:defined) { display: none !important; }`),se(Z);const Q={"button-share":()=>import(`./ButtonShare.BZeKR-hd.js`),"button-wallet":()=>import(`./ButtonWallet.Dj1jDVJP.js`),"open-in-app":()=>import(`./OpenInAppButton.yXwlwLXg.js`),"post-purchase":()=>import(`./PostPurchase.BV89VKum.js`),banner:()=>import(`./Banner.iJ5x28tk.js`)},he=new MutationObserver(e=>{for(let{addedNodes:t}of e)for(let e of Array.from(t))e.nodeType===Node.ELEMENT_NODE&&$(e)});async function $(e){let t=e instanceof Element?e.tagName.toLowerCase():``,n=t?.startsWith(`frak-`),r=Array.from(e.querySelectorAll(`:not(:defined)`)).map(e=>e.tagName.toLowerCase()).filter(e=>e.startsWith(`frak-`));n&&!customElements.get(t)&&r.push(t);let i=[...new Set(r)];await Promise.allSettled(i.map(e=>ge(e)))}async function ge(e){if(customElements.get(e))return Promise.resolve();try{let t=e.replace(/^frak-/i,``);if(!(t in Q))throw Error(`Component ${e} is not supported.`);await Q[t]()}catch(e){console.error(e)}}$(document.body),he.observe(document.documentElement,{subtree:!0,childList:!0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,g as t,v as n}from"./clientReady.
|
|
1
|
+
import{_ as e,g as t,v as n}from"./clientReady.C1tlF1t3.js";function r(e){return Array.isArray(e)?e:e.conditions}function i(e){if(typeof e==`number`)return e;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:void 0}}function a(e,t,n){let o=[];for(let s of r(e)){if(`logic`in s){o.push(...a(s,t,n));continue}if(s.field===t&&n.has(s.operator)){let e=i(s.value);e!=null&&o.push(e)}}return o}const o=new Set([`gt`,`gte`,`between`]),s=new Set([`gt`,`gte`]);function c(e){let t=a(e,`purchase.amount`,o);return t.length>0?Math.min(...t):void 0}function l(e){let t=a(e,`time.timestamp`,s);if(t.length!==0)return new Date(Math.min(...t)*1e3)}function u(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`percentage`:return e.maxAmount?.[t]??0;case`tiered`:return e.tiers.reduce((e,n)=>`amount`in n?Math.max(e,n.amount[t]):e,0)}}function d(e){return e.payoutType===`percentage`?e.percent:e.payoutType===`tiered`?e.tiers.reduce((e,t)=>`percent`in t?Math.max(e,t.percent):e,0):0}function f(e,t){let n=u(e,t);return n>0?n:d(e)*1e-6}function p(r,i){let a=n(i),o=t(a);switch(r.payoutType){case`fixed`:return e(Math.round(r.amount[o]),a);case`percentage`:return`${r.percent} %`;case`tiered`:{let t=u(r,o);if(t>0)return e(Math.round(t),a);let n=d(r);return n>0?`${n} %`:e(0,a)}}}function m(e,r){if(e&&!(f(e,t(n(r)))<=0))return p(e,r)}function h(e,t){return t?e.replaceAll(`{REWARD}`,t):e.replaceAll(`{REWARD}`,``)}function g(e,t){return e.expiresAt!=null&&new Date(e.expiresAt).getTime()<=t}function _(e,t){let n=l(e.conditions);return n==null||n.getTime()<=t}function v(e,t){return t===`referee`?e.referee:e.referrer}function y(e,t,n){let r=v(e,n);return r?f(r,t):0}function b(e,r={}){let i=(r.now??new Date).getTime(),a=r.audience??`referrer`,o=t(n(r.currency)),s=(r.targetInteraction?e.filter(e=>e.interactionTypeKey===r.targetInteraction):e).filter(e=>!g(e,i)),c=s.filter(e=>_(e,i));if(c.length>0)return{campaign:c.reduce((e,t)=>y(t,o,a)>y(e,o,a)?t:e),status:`live`};let u=s.map(e=>({campaign:e,startsAt:l(e.conditions)})).filter(e=>e.startsAt!=null);if(u.length===0)return;let d=u.reduce((e,t)=>t.startsAt.getTime()<e.startsAt.getTime()?t:e);return{campaign:d.campaign,status:`upcoming`,startsAt:d.startsAt}}function x(t,n={}){let r=b(t,n);if(!r)return;let i=v(r.campaign,n.audience??`referrer`);if(!i)return;let a=m(i,n.currency);if(!a)return;let o=c(r.campaign.conditions),s=o==null?void 0:e(o,n.currency),l=r.campaign.defaultLockupSeconds,u=l&&l>0?Math.round(l/86400):void 0;return{formatted:a,payoutType:i.payoutType,minPurchaseAmount:s,lockupDurationDays:u,referrerReward:r.campaign.referrer,refereeReward:r.campaign.referee,minPurchaseValue:o??void 0}}export{m as i,b as n,h as r,x as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./actions-
|
|
1
|
+
import{l as e}from"./actions-ZwjR7wGC.D_6Fe2BY.js";async function t(t,n,r){if(!window.FrakSetup?.client){console.error(`Frak client not found`);return}await e(window.FrakSetup.client,{...r?.link&&{link:r.link},...r?.products?.length&&{products:r.products},...t&&{metadata:{targetInteraction:t}}},n)}export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./clientReady.
|
|
1
|
+
import{o as e}from"./clientReady.C1tlF1t3.js";function t(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function n(e){if(!e)return null;if(Array.isArray(e))return e;if(typeof e!=`string`)return null;try{let t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function r(e){if(!e||typeof e!=`object`)return null;let n=e,r=typeof n.title==`string`?n.title.trim():``;if(r===``)return null;let i={title:r};return typeof n.imageUrl==`string`&&t(n.imageUrl)&&(i.imageUrl=n.imageUrl),typeof n.link==`string`&&t(n.link)&&(i.link=n.link),typeof n.utmContent==`string`&&n.utmContent!==``&&(i.utmContent=n.utmContent),i}function i(e){let t=n(e);if(!t)return;let i=[];for(let e of t){let t=r(e);t&&i.push(t)}return i.length>0?i:void 0}function a(t){if(!t)return;let n;try{n=e(t)}catch{return}if(n!==null)return i(n)}export{i as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./clientReady.C1tlF1t3.js";import{c as t,o as n}from"./defaults.BJwYl9e_.js";function r(){return t(n,()=>e.getConfig().components)}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./styleManager.Cun1-fKi.js";import{f as t,i as n}from"./defaults.
|
|
1
|
+
import{t as e}from"./styleManager.Cun1-fKi.js";import{f as t,i as n}from"./defaults.BJwYl9e_.js";function r(r,i,a,o,s){t(()=>{s&&e.injectBase(`shared`,s),e.injectBase(r,o??n)},[r]),t(()=>{!i||!a||e.injectPlacement(r,i,a)},[r,i,a])}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as e}from"./actions-ZwjR7wGC.D_6Fe2BY.js";import{d as t,f as n}from"./defaults.BJwYl9e_.js";import{t as r}from"./rewards.BEQfxfW5.js";function i(i,a,o){let[s,c]=t(void 0);return n(()=>{if(!i)return;let t=window.FrakSetup?.client;t&&e(t).then(e=>{let n=r(e.rewards,{currency:t.config.metadata?.currency,targetInteraction:a,audience:o});n&&n.payoutType!==`percentage`&&c(n.formatted)}).catch(()=>{})},[i,a,o]),{reward:s}}export{i as t};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "1.0.13-beta.
|
|
14
|
+
"version": "1.0.13-beta.8cb0895d",
|
|
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,32 +92,32 @@
|
|
|
92
92
|
"publish": "echo 'Publishing components...'"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@frak-labs/core-sdk": "1.2.1-beta.
|
|
96
|
-
"@frak-labs/
|
|
97
|
-
"
|
|
98
|
-
"preact
|
|
99
|
-
"
|
|
95
|
+
"@frak-labs/core-sdk": "1.2.1-beta.8cb0895d",
|
|
96
|
+
"@frak-labs/design-system": "0.0.0",
|
|
97
|
+
"@frak-labs/frame-connector": "0.2.0-beta.8cb0895d",
|
|
98
|
+
"preact": "^10.29.7",
|
|
99
|
+
"preact-custom-element": "^4.6.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@frak-labs/test-foundation": "0.1.0",
|
|
103
|
-
"@preact/preset-vite": "^2.10.
|
|
103
|
+
"@preact/preset-vite": "^2.10.6",
|
|
104
104
|
"@rolldown/plugin-node-polyfills": "^1.0.3",
|
|
105
|
-
"@testing-library/jest-dom": "^
|
|
105
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
106
106
|
"@testing-library/preact": "^3.2.4",
|
|
107
107
|
"@testing-library/user-event": "^14.6.1",
|
|
108
|
-
"@types/jsdom": "^28.0.
|
|
109
|
-
"@types/node": "^25.
|
|
108
|
+
"@types/jsdom": "^28.0.3",
|
|
109
|
+
"@types/node": "^25.9.5",
|
|
110
110
|
"@types/preact-custom-element": "^4.0.4",
|
|
111
111
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
112
|
-
"@vanilla-extract/css": "^1.21.
|
|
112
|
+
"@vanilla-extract/css": "^1.21.2",
|
|
113
113
|
"@vanilla-extract/integration": "^8.0.10",
|
|
114
|
-
"@vanilla-extract/sprinkles": "^1.
|
|
115
|
-
"@vanilla-extract/vite-plugin": "^5.2.
|
|
116
|
-
"@vitest/coverage-v8": "^4.1.
|
|
117
|
-
"@vitest/ui": "^4.1.
|
|
118
|
-
"jsdom": "^29.
|
|
119
|
-
"tsdown": "^0.22.
|
|
114
|
+
"@vanilla-extract/sprinkles": "^1.7.0",
|
|
115
|
+
"@vanilla-extract/vite-plugin": "^5.2.6",
|
|
116
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
117
|
+
"@vitest/ui": "^4.1.10",
|
|
118
|
+
"jsdom": "^29.1.1",
|
|
119
|
+
"tsdown": "^0.22.14",
|
|
120
120
|
"typescript": "^6.0.3",
|
|
121
|
-
"vitest": "^4.1.
|
|
121
|
+
"vitest": "^4.1.10"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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 ee(){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 te(){return(w??ee())?.config}function ne(){let e=w??ee();return e?Date.now()-e.timestamp<3e4:!1}function re(e){if(!(!S||!e.isResolved))try{let t={config:e,timestamp:Date.now()};localStorage.setItem(x.key,JSON.stringify(t)),w=t}catch{}}function ie(){if(S){w=null;try{localStorage.removeItem(x.key)}catch{}}}function ae(){S&&(window[v]||(window[v]=te()??C()))}function T(){return S?(ae(),window[v]??C()):C()}function E(e){S&&window.dispatchEvent(new CustomEvent(`frak:config`,{detail:e}))}function oe(e){return e??(S?window.location.hostname:``)}async function se(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 D={getConfig:T,get isResolved(){return T().isResolved},get isCacheFresh(){return ne()},setCacheScope(e,t){let n=`${e}:${t??``}`;x.key=`${y}:${n}`,w=null},setConfig(e){if(S&&(window[v]=e),re(e),E(e),S&&e.merchantId)try{sessionStorage.setItem(b,e.merchantId)}catch{}},reset(){let e=te()??C();S&&(window[v]=e),E(e)},clearCache(){if(ie(),p(),S)try{sessionStorage.removeItem(b)}catch{}},resolve(e,t,n){let r=oe(e);return r?f(async()=>{let e=await se(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=T();if(e.isResolved&&e.merchantId)return e.merchantId;if(S)try{return sessionStorage.getItem(b)??void 0}catch{}},async resolveMerchantId(e,t){return D.getMerchantId()||(await D.resolve(e,t))?.merchantId}};function O(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function k(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 A(e){return O(i(e))}function j(e,t,n,r,i,a){let o=A(ce({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 ce(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 M=`menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800`,N=`frak-sso`;async function le(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??j(i??`https://wallet.frak.id`,a,await D.resolveMerchantId()??``,n.name,c(),r?.css),s=window.open(o,N,M);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 ue(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 de(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 P(e,t){let n=t.toLowerCase(),r=[...e.keys()].filter(e=>e.toLowerCase()===n);for(let t of r)e.delete(t)}const fe=/^0x[a-fA-F0-9]{40}$/;function F(e){return typeof e==`string`&&fe.test(e)}function pe(e,t){return e.toLowerCase()===t.toLowerCase()}function me(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 he=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ge(e){let t=`0x`;for(let n=0;n<20;n++)t+=he[e[n]];return t}function _e(e){return`r`in e&&!(`v`in e)}function I(e){return`v`in e&&e.v===2}const ve=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function L(e){return typeof e==`string`&&ve.test(e)}function R(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 z(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 ye(e){if(!L(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`&&F(e.w);if(!t&&!n||t&&!L(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(R(e.m),a),a+=16,i.setUint32(a,e.t,!1),a+=4,t&&(r.set(R(e.c),a),a+=16),n&&(r.set(me(e.w),a),a+=20),r}function be(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=z(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=z(e.subarray(a,a+16)),a+=16),r){let t=ge(e.subarray(a,a+20));if(!F(t))return null;c.w=t,a+=20}return c}const B=`fCtx`;function V(e){if(e)try{if(I(e)){let t=ye(e);return t?O(t):void 0}return O(me(e.r))}catch(t){console.error(`Error compressing Frak context`,{e:t,context:e})}}function H(e){if(!(!e||e.length===0))try{let t=k(e);if(t.length!==20)return be(t)||void 0;let n=ge(t);if(F(n))return{r:n}}catch(t){console.error(`Error decompressing Frak context`,{e:t,context:e})}}function xe({url:e}){if(!e)return null;let t=de(new URL(e).searchParams,B);return t?H(t):null}function Se(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 Ce(e,t){let n=Se(t??{});for(let[t,r]of Object.entries(n))r===void 0||r===``||e.searchParams.has(t)||e.searchParams.set(t,r)}function U({url:e,context:t,attribution:n}){if(!e)return null;let r=V(t);if(!r)return null;let i=new URL(e);return P(i.searchParams,B),i.searchParams.set(B,r),Ce(i,n),i.toString()}function W(e){let t=new URL(e);return P(t.searchParams,B),t.toString()}function we({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?W(n):U({url:n,context:t}),r&&window.history.replaceState(null,``,r.toString())}const Te={compress:V,decompress:H,parse:xe,update:U,remove:W,replaceUrl:we},G={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function K(e){return e&&e in G?e:`eur`}function Ee(e){return e?G[e]??G.eur:G.eur}function De(e,t){let n=Ee(t),r=K(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function Oe(e){return e?`${e}Amount`:`eurAmount`}var ke=class{constructor(e){this.baseUrl=e.baseUrl,this.headers={"Content-Type":`application/json`,...e.defaultHeaders},this.maxRetries=e.maxRetries??3,this.initialRetryDelay=e.initialRetryDelay??500}async resolveHeaders(){let e={};for(let[t,n]of Object.entries(this.headers)){let r=await n;r!==null&&(e[t]=r)}return e}addHeader(e,t){this.headers[e]=t}async post(e,t,n,r){try{let r=await fetch(e,{method:`POST`,headers:await this.resolveHeaders(),body:t?JSON.stringify(t??{}):void 0,keepalive:!0,...n});if(r.status===401)return null;if(r.status!==200&&r.status!==202)throw Error(`HTTP error! status: ${r.status}`);let i=await r.text();return i?JSON.parse(i):null}catch(i){if(r<this.maxRetries){let i=this.initialRetryDelay*2**r;return await new Promise(e=>setTimeout(e,i)),this.post(e,t,n,r+1)}return console.error(`Max retries reached:`,i),null}}async fetch(e,t,n={}){let r=`${this.baseUrl}${e}`;return this.post(r,t,n,0)}},Ae=class{constructor(e){this.groups=[],this.queue=[],this.options=e;let t={"openpanel-client-id":e.clientId};e.clientSecret&&(t[`openpanel-client-secret`]=e.clientSecret),t[`openpanel-sdk-name`]=e.sdk||`node`,t[`openpanel-sdk-version`]=e.sdkVersion||`1.3.1`,this.api=new ke({baseUrl:e.apiUrl||`https://api.openpanel.dev`,defaultHeaders:t})}init(){}ready(){this.options.disabled=!1,this.options.waitForProfile=!1,this.flush()}shouldQueue(e){return!!(this.options.disabled||this.options.waitForProfile&&!this.profileId||e.type===`replay`&&!this.sessionId)}addQueue(e){e.type===`track`&&(e.payload.properties={...e.payload.properties??{},__timestamp:new Date().toISOString()}),this.queue.push(e)}async send(e){if(this.options.filter&&!this.options.filter(e))return Promise.resolve();if(this.shouldQueue(e))return this.addQueue(e),Promise.resolve();let t=await this.api.fetch(`/track`,e,{keepalive:e.type!==`replay`});this.deviceId=t?.deviceId;let n=!!this.sessionId;return this.sessionId=t?.sessionId,!n&&this.sessionId&&this.flush(),t}setGlobalProperties(e){this.global={...this.global,...e}}track(e,t){this.log(`track event`,e,t);let{groups:n,profileId:r,...i}=t??{},a=[...new Set([...this.groups,...n??[]])];return this.send({type:`track`,payload:{name:e,profileId:r??this.profileId,groups:a.length>0?a:void 0,properties:{...this.global??{},...i}}})}identify(e){if(this.log(`identify user`,e),e.profileId&&(this.profileId=e.profileId,this.flush()),e.profileId&&Object.keys(e).length>1)return this.send({type:`identify`,payload:{...e,properties:{...this.global,...e.properties}}})}upsertGroup(e){return this.log(`upsert group`,e),this.send({type:`group`,payload:e})}setGroup(e){return this.log(`set group`,e),this.groups.includes(e)||(this.groups=[...this.groups,e]),this.send({type:`assign_group`,payload:{groupIds:[e],profileId:this.profileId}})}setGroups(e){return this.log(`set groups`,e),this.groups=[...new Set([...this.groups,...e])],this.send({type:`assign_group`,payload:{groupIds:e,profileId:this.profileId}})}alias(e){}increment(e){return this.send({type:`increment`,payload:e})}decrement(e){return this.send({type:`decrement`,payload:e})}revenue(e,t){let n=t?.deviceId;return delete t?.deviceId,this.track(`revenue`,{...t??{},...n?{__deviceId:n}:{},__revenue:e})}getDeviceId(){return this.deviceId??``}getSessionId(){return this.sessionId??``}fetchDeviceId(){return Promise.resolve(this.deviceId??``)}clear(){this.profileId=void 0,this.groups=[],this.deviceId=void 0,this.sessionId=void 0}buildFlushPayload(e){if(e.type===`replay`)return e.payload;if(e.type===`track`){let t=`groups`in e.payload?e.payload.groups??[]:[],n=[...new Set([...this.groups,...t])];return{...e.payload,profileId:e.payload.profileId??this.profileId,groups:n.length>0?n:void 0}}return e.type===`identify`||e.type===`increment`||e.type===`decrement`||e.type===`assign_group`?{...e.payload,profileId:e.payload.profileId??this.profileId}:e.payload}flush(){let e=[];for(let t of this.queue){if(this.shouldQueue(t)){e.push(t);continue}let n=this.buildFlushPayload(t);this.send({...t,payload:n})}this.queue=e}log(...e){this.options.debug&&console.log(`[OpenPanel.dev]`,...e)}},je=typeof document<`u`?document.currentScript:null;function Me(e){return e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``))}var Ne=class extends Ae{constructor(e){if(super({sdk:`web`,sdkVersion:`1.4.1`,...e}),this.options=e,this.lastPath=``,this.pendingRevenues=[],!this.isServer()){try{let e=sessionStorage.getItem(`openpanel-pending-revenues`);if(e){let t=JSON.parse(e);Array.isArray(t)&&(this.pendingRevenues=t)}}catch{this.pendingRevenues=[]}if(this.setGlobalProperties({__referrer:document.referrer}),this.options.trackScreenViews&&(this.trackScreenViews(),setTimeout(()=>this.screenView(),0)),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackAttributes&&this.trackAttributes(),this.options.sessionReplay?.enabled){let e=this.options.sessionReplay.sampleRate??1;Math.random()<e&&this.loadReplayModule().then(e=>{e&&e.startReplayRecorder(this.options.sessionReplay,e=>{this.send({type:`replay`,payload:{...e}})})})}}}async loadReplayModule(){try{if(typeof __OPENPANEL_REPLAY_URL__<`u`){let e=je,t=this.options.sessionReplay?.scriptUrl||e?.src?.replace(`.js`,`-replay.js`)||`https://openpanel.dev/op1-replay.js`;return window.__openpanel_replay?window.__openpanel_replay:new Promise(e=>{let n=document.createElement(`script`);n.src=t,n.onload=()=>{e(window.__openpanel_replay??null)},n.onerror=()=>{console.warn(`[OpenPanel] Failed to load replay script from`,t),e(null)},document.head.appendChild(n)})}return await import(`./replay-V6FXES7X.CgBxdfNp.js`)}catch(e){return console.warn(`[OpenPanel] Failed to load replay module`,e),null}}debounce(e,t){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(e,t)}isServer(){return typeof document>`u`}trackOutgoingLinks(){this.isServer()||document.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`a`);if(n&&t){let e=n.getAttribute(`href`);if(e?.startsWith(`http`))try{let r=new URL(e),i=window.location.hostname;r.hostname!==i&&super.track(`link_out`,{href:e,text:n.innerText||n.getAttribute(`title`)||t.getAttribute(`alt`)||t.getAttribute(`title`)})}catch{}}})}trackScreenViews(){if(this.isServer())return;let e=history.pushState;history.pushState=function(...t){let n=e.apply(this,t);return window.dispatchEvent(new Event(`pushstate`)),window.dispatchEvent(new Event(`locationchange`)),n};let t=history.replaceState;history.replaceState=function(...e){let n=t.apply(this,e);return window.dispatchEvent(new Event(`replacestate`)),window.dispatchEvent(new Event(`locationchange`)),n},window.addEventListener(`popstate`,()=>{window.dispatchEvent(new Event(`locationchange`))});let n=()=>this.debounce(()=>this.screenView(),50);this.options.trackHashChanges?window.addEventListener(`hashchange`,n):window.addEventListener(`locationchange`,n)}trackAttributes(){this.isServer()||document.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`button`),r=t.closest(`a`),i=n?.getAttribute(`data-track`)?n:r?.getAttribute(`data-track`)?r:null;if(i){let e={};for(let t of i.attributes)t.name.startsWith(`data-`)&&t.name!==`data-track`&&(e[Me(t.name.replace(/^data-/,``))]=t.value);let t=i.getAttribute(`data-track`);t&&super.track(t,e)}})}track(e,t){return super.track(e,{...t,__path:this.lastPath})}screenView(e,t){if(this.isServer())return;let n,r;typeof e==`string`?(n=e,r=t):(n=window.location.href,r=e),this.lastPath!==n&&(this.lastPath=n,super.track(`screen_view`,{...r??{},__path:n,__title:document.title}))}async flushRevenue(){let e=this.pendingRevenues.map(e=>super.revenue(e.amount,e.properties));await Promise.all(e),this.clearRevenue()}clearRevenue(){if(this.pendingRevenues=[],!this.isServer())try{sessionStorage.removeItem(`openpanel-pending-revenues`)}catch{}}pendingRevenue(e,t){if(this.pendingRevenues.push({amount:e,properties:t}),!this.isServer())try{sessionStorage.setItem(`openpanel-pending-revenues`,JSON.stringify(this.pendingRevenues))}catch{}}};const q=`nexus-wallet-backup`,J=`frakwallet://`;function Y(e){let t=e?.split(`-`)[0]?.toLowerCase();return t===`en`||t===`fr`?t:void 0}function Pe(){return(typeof document<`u`?Y(document.documentElement.lang):void 0)||(typeof navigator<`u`?Y(navigator.language):void 0)}function Fe(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href),r=n.searchParams.get(`sso`);r&&(t.then(()=>{e.sendLifecycle({clientLifecycle:`sso-redirect-complete`,data:{compressed:r}}),console.log(`[SSO URL Listener] Forwarded compressed SSO data to iframe`)}).catch(e=>{console.error(`[SSO URL Listener] Failed to forward SSO data:`,e)}),n.searchParams.delete(`sso`),window.history.replaceState({},``,n.toString()),console.log(`[SSO URL Listener] SSO parameter detected and URL cleaned`))}function Ie(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}const Le=J.replace(`://`,``);function Re(e){return`intent://${e.slice(13)}#Intent;scheme=${Le};end`}function ze(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=Ie()&&Be(e)?Re(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function Be(e){return e.startsWith(J)}function Ve(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;return!!(/iPhone|iPad|iPod/i.test(e)||/Macintosh/i.test(e)&&navigator.maxTouchPoints>1)}const X=Ve();function He(){return typeof navigator>`u`?!1:X?!0:/Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Ue(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent.toLowerCase();return e.includes(`instagram`)||e.includes(`fban`)||e.includes(`fbav`)||e.includes(`facebook`)}const We=Ue();function Ge(e){X&&e.startsWith(`https://`)?window.location.href=`x-safari-https://${e.slice(8)}`:X&&e.startsWith(`http://`)?window.location.href=`x-safari-http://${e.slice(7)}`:window.location.href=`https://backend.frak.id/common/social?u=${encodeURIComponent(e)}`}const Z={id:`frak-wallet`,name:`frak-wallet`,title:`Frak Wallet`,allow:`publickey-credentials-get *; clipboard-write; web-share *`,style:{width:`0`,height:`0`,border:`0`,position:`absolute`,zIndex:2000001,top:`-1000px`,left:`-1000px`,colorScheme:`auto`}};function Ke({walletBaseUrl:e,config:t}){let n=document.querySelector(`#frak-wallet`);n&&n.remove();let r=document.createElement(`iframe`);r.id=Z.id,r.name=Z.name,r.allow=Z.allow,r.style.zIndex=Z.style.zIndex.toString(),Q({iframe:r,isVisible:!1});let i=t?.walletUrl??e??`https://wallet.frak.id`,a=c();return Ye(i),Ye(_(i)),r.src=qe({walletUrl:i,clientId:a,preload:t?.preload}),new Promise(e=>{r.addEventListener(`load`,()=>e(r)),document.body.appendChild(r)})}function qe({walletUrl:e,clientId:t,preload:n}){let r=`${e}/listener?clientId=${encodeURIComponent(t)}`;return!n||n.length===0?r:`${r}#preload=${n.join(`,`)}`}function Q({iframe:e,isVisible:t}){if(!t){e.style.width=`0`,e.style.height=`0`,e.style.border=`0`,e.style.position=`fixed`,e.style.top=`-1000px`,e.style.left=`-1000px`;return}e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`auto`}function Je(e=`/listener`){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function Ye(e){if(!(typeof document>`u`))try{let t=new URL(e).origin,n=`link[rel="preconnect"][data-frak-preconnect="${t}"]`;if(document.head.querySelector(n))return;let r=document.createElement(`link`);r.rel=`preconnect`,r.href=t,r.crossOrigin=``,r.dataset.frakPreconnect=t,document.head.appendChild(r)}catch{}}const Xe=X&&We;function Ze(e){e?localStorage.setItem(q,e):localStorage.removeItem(q)}function $(e,t){try{let n=new URL(e);if(!n.searchParams.has(`u`))return e;let r=et(window.location.href,t);return n.searchParams.delete(`u`),n.searchParams.append(`u`,r),n.toString()}catch{return e}}function Qe(e){let t=new URL(window.location.href);e&&t.searchParams.set(`fmt`,e);let n=t.protocol===`http:`?`x-safari-http`:`x-safari-https`;window.location.href=`${n}://${t.host}${t.pathname}${t.search}${t.hash}`}function $e(e){return e.includes(`/common/social`)}function et(e,t){if(!t)return e;try{let n=new URL(e);return n.searchParams.set(`fmt`,t),n.toString()}catch{return`${e}${e.includes(`?`)?`&`:`?`}fmt=${encodeURIComponent(t)}`}}function tt(e,t,n,r,i){if(i){let e=$(t,r);window.open(e,`_blank`);return}if(Be(t)){let i=$(t,r);ze(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}})}else if(Xe&&$e(t))Qe(r);else{let e=$(t,r);window.location.href=e}}function nt({iframe:e,targetOrigin:t}){let r=new n;return{handleEvent:n=>{if(!(`iframeLifecycle`in n))return;let{iframeLifecycle:i,data:a}=n;switch(i){case`connected`:r.resolve(!0);break;case`do-backup`:Ze(a.backup);break;case`remove-backup`:localStorage.removeItem(q);break;case`show`:case`hide`:Q({iframe:e,isVisible:i===`show`});break;case`redirect`:tt(e,a.baseRedirectUrl,t,a.mergeToken,a.openInNewTab);break}},isConnected:r.promise}}function rt({config:i,iframe:a}){let o=i?.walletUrl??`https://wallet.frak.id`,s=i.metadata.lang??Pe(),l=i.domain??(typeof window<`u`?window.location.hostname:``);D.setCacheScope(l,s),D.reset();let u=D.isCacheFresh?void 0:D.resolve(i.domain,i.walletUrl,s),d=nt({iframe:a,targetOrigin:o}),f=new n,m=Date.now();if(!a.contentWindow)throw new t(e.configError,`The iframe does not have a content window`);let h=r({emittingTransport:a.contentWindow,listeningTransport:window,targetOrigin:o,middleware:[{async onRequest(n,r){if(!await d.isConnected)throw new t(e.clientNotConnected,`The iframe provider isn't connected yet`);return await f.promise,r}}],lifecycleHandlers:{iframeLifecycle:(e,t)=>{d.handleEvent(e)}}}),g=it(h,d),_=async()=>{g(),h.cleanup(),a.remove(),p(),D.clearCache(),D.reset()},v;{console.log(`[Frak SDK] Initializing OpenPanel`),v=new Ne({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdk_version`in t.properties||(t.properties={...t.properties,sdk_version:`1.2.1`,user_anonymous_client_id:c()}),!0)}),v.setGlobalProperties({sdk_version:`1.2.1`,user_anonymous_client_id:c()}),v.init(),v.track(`sdk_initialized`,{sdk_version:`1.2.1`});let e=!1,t=setTimeout(()=>{e||(e=!0,v?.track(`sdk_iframe_handshake_failed`,{reason:`timeout`}))},3e4);d.isConnected.then(()=>{e||(e=!0,clearTimeout(t),v?.track(`sdk_iframe_connected`,{handshake_duration_ms:Date.now()-m}))}).catch(()=>{e||(e=!0,clearTimeout(t),v?.track(`sdk_iframe_handshake_failed`,{reason:`unknown`}))})}let y=at({config:i,rpcClient:h,lifecycleManager:d,configPromise:u,contextSent:f,openPanel:v}).then(()=>{}).catch(e=>{throw f.reject(e),e});return{config:i,waitForConnection:d.isConnected,waitForSetup:y,request:h.request,listenerRequest:h.listen,destroy:_,openPanel:v}}function it(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,250),r=setTimeout(()=>{o(),console.log(`Heartbeat timeout: connection failed`)},3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}async function at({config:e,rpcClient:t,lifecycleManager:n,configPromise:r,contextSent:i,openPanel:a}){await n.isConnected,Fe(t,n.isConnected);let o=new URL(window.location.href),s=o.searchParams.get(`fmt`)??void 0;s&&(o.searchParams.delete(`fmt`),window.history.replaceState({},``,o.toString()));let l=t=>{let n=t?.merchantId??e.metadata.merchantId??``,r=t?.domain??``,i=t?.allowedDomains??[],a=t?.sdkConfig,o=a?.attribution||e.attribution?{...e.attribution,...a?.attribution}:void 0;D.setConfig(a?{isResolved:!0,merchantId:n,domain:r,allowedDomains:i,hasRawSdkConfig:!0,name:a.name??e.metadata.name,logoUrl:a.logoUrl??e.metadata.logoUrl,homepageLink:a.homepageLink??e.metadata.homepageLink,lang:a.lang??e.metadata.lang,currency:a.currency??e.metadata.currency,hidden:a.hidden,css:a.css,translations:a.translations,placements:a.placements,components:a.components,attribution:o}:{isResolved:!0,merchantId:n,domain:r,allowedDomains:i,name:e.metadata.name,logoUrl:e.metadata.logoUrl,homepageLink:e.metadata.homepageLink,lang:e.metadata.lang,currency:e.metadata.currency,attribution:o})},u=!1,d=e=>{let n=u?void 0:s;u=!0;let r=e.hasRawSdkConfig?{name:e.name,logoUrl:e.logoUrl,homepageLink:e.homepageLink,lang:e.lang,currency:e.currency,hidden:e.hidden,css:e.css,translations:e.translations,placements:e.placements,attribution:e.attribution}:e.attribution?{attribution:e.attribution}:void 0,i=c();if(a){let t=a.global??{};a.setGlobalProperties({...t,merchant_id:e.merchantId,domain:e.domain??``})}t.sendLifecycle({clientLifecycle:`resolved-config`,data:{merchantId:e.merchantId,domain:e.domain??``,allowedDomains:e.allowedDomains??[],sourceUrl:window.location.href,...i&&{sdkAnonymousId:i},...n&&{pendingMergeToken:n},...r&&{sdkConfig:r}}})};D.isResolved&&(d(D.getConfig()),i.resolve()),r&&(l(await r),d(D.getConfig()),i.resolve());async function f(){let n=e.customizations?.css;n&&t.sendLifecycle({clientLifecycle:`modal-css`,data:{cssLink:n}})}async function p(){let n=e.customizations?.i18n;n&&t.sendLifecycle({clientLifecycle:`modal-i18n`,data:{i18n:n}})}async function m(){if(typeof window>`u`)return;let e=window.localStorage.getItem(q);e&&t.sendLifecycle({clientLifecycle:`restore-backup`,data:{backup:e}})}(await Promise.allSettled([f(),p(),m()])).some(e=>e.status===`rejected`)&&a?.track(`sdk_iframe_handshake_failed`,{reason:`asset_push`})}function ot(e){return a(k(e))}async function st({config:e}){let t=ct(e),n=await Ke({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=rt({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection){console.error(`Failed to connect to client`);return}return r}function ct(e){let t=K(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}function lt({perCall:e,defaults:t,productUtmContent:n}){if(e===null)return;let r=e!==void 0,i=t!==void 0&&Object.keys(t).length>0;if(!r&&!i&&!(n!==void 0&&n!==``))return;let a={...t,...e??{}},o=n??e?.utmContent;return o!==void 0&&o!==``?a.utmContent=o:delete a.utmContent,a}const ut=`frak:client`;function dt(){let e=new CustomEvent(ut);window.dispatchEvent(e)}function ft(e,t){if(window.FrakSetup?.client&&e===`add`){t();return}(e===`add`?window.addEventListener:window.removeEventListener)(ut,t,!1)}export{p as A,t as B,P as C,le as D,O as E,k as F,c as I,f as L,_ as M,pe as N,_e as O,j as P,n as R,de as S,N as T,De as _,We as a,D as b,lt as c,Z as d,ze as f,Oe as g,He as h,Ge as i,Te as j,I as k,st as l,J as m,ft as n,ot as o,Pe as p,X as r,rt as s,dt as t,Je as u,K as v,M as w,ue as x,A as y,e as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./clientReady.0RgyPOYT.js";import{c as t,o as n}from"./defaults.euOM2Ohv.js";function r(){return t(n,()=>e.getConfig().components)}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as e}from"./actions-CMPlZ7CH.CnK_0vla.js";import{d as t,f as n}from"./defaults.euOM2Ohv.js";import{t as r}from"./rewards.CRzXPu4f.js";function i(i,a,o){let[s,c]=t(void 0);return n(()=>{if(!i)return;let t=window.FrakSetup?.client;t&&e(t).then(e=>{let n=r(e.rewards,{currency:t.config.metadata?.currency,targetInteraction:a,audience:o});n&&n.payoutType!==`percentage`&&c(n.formatted)}).catch(()=>{})},[i,a,o]),{reward:s}}export{i as t};
|