@frak-labs/components 1.3.0-beta.feb13924 → 1.3.1-beta.393ef9ec

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/cdn/Ambassador.CRPtw_VT.js +392 -0
  2. package/cdn/Banner.gDEO8VKX.js +208 -0
  3. package/cdn/{ButtonShare.UhoAxsGt.js → ButtonShare.OuDvPMdk.js} +1 -1
  4. package/cdn/ButtonWallet.DNE6ZhkT.js +40 -0
  5. package/cdn/GiftIcon.NTATj1WE.js +1 -0
  6. package/cdn/{OpenInAppButton.BfMQFzoN.js → OpenInAppButton.Dv7oAwl1.js} +1 -1
  7. package/cdn/PostPurchase.Co0QSBMO.js +102 -0
  8. package/cdn/components.js +1 -1
  9. package/cdn/{jsxRuntime.module.DCugjvlV.js → jsxRuntime.module.C5UTjP_H.js} +1 -1
  10. package/cdn/loader.js +58 -36
  11. package/cdn/qr.vkJgq9pN.js +5 -0
  12. package/cdn/rewards.COyZ6-7W.js +1 -0
  13. package/cdn/useGlobalComponents.DoG1wfeq.js +1 -0
  14. package/cdn/{useLightDomStyles.BS4EHEmn.js → useLightDomStyles.B0_CS0Kq.js} +1 -1
  15. package/cdn/{usePlacement.CUkTnqlu.js → usePlacement.B5JX9OU-.js} +1 -1
  16. package/cdn/{useReward.Dnfj2E2g.js → useReward.By-xuybY.js} +1 -1
  17. package/dist/{GiftIcon-DNqgjTjb.js → GiftIcon-JVhSFEhP.js} +0 -1
  18. package/dist/ambassador.js +162 -99
  19. package/dist/banner.js +84 -59
  20. package/dist/postPurchase.js +43 -30
  21. package/dist/sharedBaseCss.css-BkMpQeRx.js +5 -0
  22. package/package.json +6 -7
  23. package/cdn/Ambassador.dWFL3OMZ.js +0 -333
  24. package/cdn/Banner.BaEY18ZO.js +0 -183
  25. package/cdn/ButtonWallet.DROPSw9u.js +0 -40
  26. package/cdn/GiftIcon.DNEaYOmS.js +0 -1
  27. package/cdn/PostPurchase.D-aOKaLH.js +0 -89
  28. package/cdn/qr.Bdg4-2EI.js +0 -5
  29. package/cdn/rewards.B_p05JY_.js +0 -1
  30. package/cdn/useGlobalComponents.CXXK4kVf.js +0 -1
  31. package/dist/sharedBaseCss.css-ChRUA1zY.js +0 -5
@@ -1,40 +0,0 @@
1
- import{C as e,r as t}from"./loader.js";import{a as n,c as r,f as i,h as a,l as o,m as s,n as c,p as l,r as u,t as d}from"./jsxRuntime.module.DCugjvlV.js";import{t as f}from"./useReward.Dnfj2E2g.js";import{t as p}from"./usePlacement.CUkTnqlu.js";function m(){`vibrate`in navigator&&navigator.vibrate(10)}function h(e){return d(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[d(`title`,{children:`Gift icon`}),d(`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 g({placement:s,classname:g=``,useReward:_,targetInteraction:v}){let y=n(),b=p(s),x=b?.targetInteraction===void 0?v:b.targetInteraction,S=_===!0,{shouldRender:C,isHidden:w,isClientReady:T}=r(),{reward:E}=f(S&&T,x),D=b?.components?.buttonWallet?.position??window.FrakSetup?.modalWalletConfig?.metadata?.position??`right`,O=o(!1);i(()=>{O.current||T&&C&&!w&&(e(window.FrakSetup?.client,`share_button_impression`,{placement:s,target_interaction:x,has_reward:!!E}),O.current=!0)},[T,C,w,s,x]);let k=l(()=>{e(window.FrakSetup.client,`share_button_clicked`,{placement:s,target_interaction:x,has_reward:!!E,click_action:`sharing-page`}),m(),t(`share_button`,x,s)},[s,x,E]);if(!C||w)return null;let A=[`button`,`button__fadeIn`,D===`left`?`button__left`:`button__right`,g].filter(Boolean).join(` `);return d(a,{children:[d(`style`,{children:u(`
2
- .button {
3
- all: unset;
4
- position: fixed;
5
- bottom: 20px;
6
- z-index: 2000000;
7
- display: flex;
8
- justify-content: center;
9
- align-items: center;
10
- background-color: #3e557e;
11
- width: 45px;
12
- height: 45px;
13
- border-radius: 50%;
14
- cursor: pointer;
15
- text-align: center;
16
- font-size: 24px;
17
- }
18
-
19
- .button__left {
20
- left: 20px;
21
- }
22
-
23
- .button__right {
24
- right: 20px;
25
- }
26
-
27
- .reward {
28
- position: absolute;
29
- top: -4px;
30
- right: 27px;
31
- padding: 2px 3px;
32
- border-radius: 5px;
33
- background: #ff3f3f;
34
- font-size: 9px;
35
- color: #fff;
36
- font-weight: 600;
37
- white-space: nowrap;
38
- line-height: 9px;
39
- }
40
- `,b?.components?.buttonWallet?.css)}),d(`button`,{type:`button`,"aria-label":c[y].buttonWallet.ariaLabel,part:`button`,disabled:!T,class:A,onClick:k,children:[d(h,{}),E&&d(`span`,{class:`reward`,children:E})]})]})}s(g,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{g as ButtonWallet};
@@ -1 +0,0 @@
1
- import{t as e}from"./jsxRuntime.module.DCugjvlV.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,89 +0,0 @@
1
- import{C as e,E as t,T as n,a as r,k as i,l as a,r as o,s,u as ee}from"./loader.js";import{a as c,c as l,d as u,f as d,l as te,m as f,n as p,p as ne,t as m,u as h}from"./jsxRuntime.module.DCugjvlV.js";import{i as g,n as _,t as re}from"./rewards.B_p05JY_.js";import{t as v}from"./useGlobalComponents.CXXK4kVf.js";import{t as y}from"./useLightDomStyles.BS4EHEmn.js";import{r as b,t as x}from"./GiftIcon.DNEaYOmS.js";import{t as ie}from"./usePlacement.CUkTnqlu.js";var ae=`PostPurchase_card__5fv5lh0`,oe=`PostPurchase_cardLayout__5fv5lh1`,se=`PostPurchase_cardLeft__5fv5lh2`,ce=`PostPurchase_cardRight__5fv5lh3`,le=`PostPurchase_cta__5fv5lh6 sharedBaseCss_buttonReset__7cswil0`,ue=`PostPurchase_customImage__5fv5lha`,de=`PostPurchase_frakLogo__5fv5lhb`,fe=`PostPurchase_giftIcon__5fv5lh8`,pe=`PostPurchase_icon__5fv5lh7`,me=`PostPurchase_imageWrapper__5fv5lh9`,he=`PostPurchase_message__5fv5lh5`;function ge(e){let t=e?.trim();if(!t)return;let n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{return new URL(n).toString()}catch{return}}function _e(e,t,n,r){let i=e?.isReferred?`referee`:`referrer`,a=_(t.rewards,{targetInteraction:`purchase`,currency:n,audience:i,products:r});if(!a)return null;let{campaign:o}=a,s=e?.isReferred&&o.referee?`referee`:`referrer`;return{variant:s,reward:s===`referee`?o.referee:o.referrer,merchantDomain:t.onChainMetadata.domain}}function S({customerId:f,orderId:_,token:S,sharingUrl:ve,merchantId:C,placement:w,classname:T=``,variant:E,badgeText:D,referrerText:O,refereeText:k,ctaText:A,preview:j,previewVariant:M,products:N,imageUrl:P}){let F=!!j,{shouldRender:I,isHidden:L,isClientReady:R}=l(),z=ie(w),B=c(),V=h(()=>ee(N),[N]);y(`frak-post-purchase`,w,z?.components?.postPurchase?.css,`.PostPurchase_card__5fv5lh0 {
2
- padding: 16px;
3
- border-radius: 12px;
4
- background-color: var(--surface-background__pbq4akc);
5
- border: 1px solid var(--border-default__pbq4akv);
6
- }
7
- .PostPurchase_cardLayout__5fv5lh1 {
8
- display: flex;
9
- flex-direction: row;
10
- align-items: center;
11
- gap: 32px;
12
- }
13
- .PostPurchase_cardLeft__5fv5lh2 {
14
- flex-grow: 1;
15
- min-width: 0;
16
- display: flex;
17
- flex-direction: column;
18
- gap: 8px;
19
- }
20
- .PostPurchase_cardRight__5fv5lh3 {
21
- flex-shrink: 0;
22
- display: flex;
23
- flex-direction: column;
24
- align-items: flex-end;
25
- gap: 8px;
26
- text-align: right;
27
- }
28
- .PostPurchase_badge__5fv5lh4 {
29
- align-self: flex-start;
30
- background-color: #FFF534;
31
- border-radius: 4px;
32
- padding: 4px 8px;
33
- font-size: 12px;
34
- font-weight: 600;
35
- line-height: 12px;
36
- color: var(--text-primary__pbq4ak0);
37
- }
38
- .PostPurchase_message__5fv5lh5 {
39
- margin: 0;
40
- font-size: 16px;
41
- line-height: 22px;
42
- color: var(--text-primary__pbq4ak0);
43
- font-weight: 600;
44
- }
45
- .PostPurchase_cta__5fv5lh6 {
46
- display: inline-flex;
47
- align-items: center;
48
- justify-content: center;
49
- gap: 4px;
50
- padding: 12px 16px;
51
- border-radius: 9999px;
52
- background-color: var(--text-primary__pbq4ak0);
53
- color: var(--text-onAction__pbq4ak6);
54
- font-size: 12px;
55
- font-weight: bold;
56
- text-transform: uppercase;
57
- }
58
- .PostPurchase_cta__5fv5lh6:disabled {
59
- opacity: 0.7;
60
- cursor: default;
61
- }
62
- .PostPurchase_icon__5fv5lh7 {
63
- margin: -2px 0;
64
- }
65
- .PostPurchase_giftIcon__5fv5lh8 {
66
- display: block;
67
- flex-shrink: 0;
68
- }
69
- .PostPurchase_imageWrapper__5fv5lh9 {
70
- flex-shrink: 0;
71
- display: flex;
72
- align-items: center;
73
- justify-content: center;
74
- width: 80px;
75
- height: 80px;
76
- overflow: hidden;
77
- }
78
- .PostPurchase_customImage__5fv5lha {
79
- max-width: 100%;
80
- max-height: 100%;
81
- width: auto;
82
- height: auto;
83
- object-fit: contain;
84
- display: block;
85
- }
86
- .PostPurchase_frakLogo__5fv5lhb {
87
- display: block;
88
- margin-left: auto;
89
- }`,i);let[H,ye]=u(null),[U,W]=u(!1);d(()=>{F||R&&f&&_&&S&&s({customerId:f,orderId:_,token:S,merchantId:C}).catch(()=>{})},[F,R,f,_,S,C]),d(()=>{if(F||!R||U)return;let e=window.FrakSetup?.client;e&&Promise.all([a(e),r(e)]).then(([e,t])=>{W(!0),ye({referralStatus:e,merchantInfo:t})}).catch(e=>{if(e instanceof t&&e.code===n.configError){W(!0);return}console.warn(`[Frak] Post-purchase context error`,e)})},[F,R,U]);let G=h(()=>H?_e(H.referralStatus,H.merchantInfo,window.FrakSetup?.client?.config?.metadata?.currency,V):null,[H,V]),K=te(null),q=E??G?.variant??(F?M??`referrer`:void 0),J=ge(ve??G?.merchantDomain),Y=h(()=>{if(!G?.reward)return;let e=window.FrakSetup?.client?.config?.metadata?.currency;return re(G.reward,e)},[G?.reward]),be=v(),X=z?.components?.postPurchase??be?.postPurchase,Z=D??X?.badgeText,Q=P??X?.imageUrl,$=h(()=>{let e=p[B].postPurchase;return{message:q===`referee`?Y?g(k??X?.refereeText??e.refereeText,Y):k??X?.refereeNoRewardText??e.refereeNoRewardText:Y?g(O??X?.referrerText??e.referrerText,Y):O??X?.referrerNoRewardText??e.referrerNoRewardText,cta:Y?g(A??X?.ctaText??e.ctaText,Y):A??X?.ctaNoRewardText??e.ctaNoRewardText}},[B,q,Y,X,O,k,A]);d(()=>{q&&K.current!==q&&R&&(F||I&&!L)&&(e(window.FrakSetup?.client,`post_purchase_impression`,{placement:w,variant:q,has_reward:!!G?.reward}),K.current=q)},[q,I,L,R,F,w,G?.reward]);let xe=ne(()=>{q&&(e(window.FrakSetup?.client,`post_purchase_clicked`,{placement:w,variant:q}),o(`post_purchase`,void 0,w,{link:J,products:V,checkoutToken:S}))},[q,w,J,V,S]);if(!q||!F&&(!I||L||!G))return null;let Se=[ae,T].filter(Boolean).join(` `);return m(`div`,{className:Se,children:m(`div`,{class:oe,children:[m(`div`,{class:se,children:[Z&&m(`span`,{class:`PostPurchase_badge__5fv5lh4`,children:Z}),m(`p`,{class:he,children:$.message}),m(`button`,{type:`button`,className:`${le} button`,disabled:!F&&!R,onClick:F?void 0:xe,children:[$.cta,m(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`${pe} button`,children:m(`path`,{d:`M13.9 11.14C13.99 11.05 14.15 11.11 14.15 11.24V11.64C14.15 13.05 12.63 14.19 10.75 14.19C8.87 14.19 7.34 13.05 7.34 11.64V11.24C7.34 11.11 7.51 11.05 7.59 11.14C8.35 11.93 9.48 12.43 10.75 12.43C12.01 12.43 13.15 11.93 13.9 11.14ZM1.85 9.65C1.85 9.51 2.01 9.44 2.1 9.54C2.85 10.32 3.99 10.82 5.25 10.82C5.52 10.82 5.79 10.8 6.04 10.76C6.26 10.72 6.47 10.88 6.47 11.1V12.17C6.47 12.32 6.37 12.45 6.22 12.48C5.92 12.55 5.59 12.59 5.25 12.59C3.37 12.59 1.85 11.45 1.85 10.04V9.65ZM10.75 6.21C12.63 6.21 14.15 7.35 14.15 8.75C14.15 10.16 12.63 11.3 10.75 11.3C8.87 11.3 7.34 10.16 7.34 8.75C7.34 7.35 8.87 6.21 10.75 6.21ZM1.85 6.85C1.85 6.71 2.01 6.65 2.1 6.74C2.85 7.53 3.99 8.03 5.25 8.03C5.52 8.03 5.79 8 6.04 7.96C6.26 7.92 6.47 8.09 6.47 8.3V9.37C6.47 9.52 6.37 9.65 6.22 9.69C5.92 9.75 5.59 9.79 5.25 9.79C3.37 9.79 1.85 8.65 1.85 7.24V6.85ZM5.25 1.81C7.13 1.81 8.66 2.95 8.66 4.36C8.66 5.76 7.13 6.9 5.25 6.9C3.37 6.9 1.85 5.76 1.85 4.36C1.85 2.95 3.37 1.81 5.25 1.81Z`,fill:`currentColor`})})]})]}),m(`div`,{class:ce,children:[Q?m(`span`,{class:me,children:m(`img`,{src:Q,alt:``,class:ue})}):m(x,{className:fe,width:80,height:80}),m(b,{className:de,width:42,height:24})]})]})})}f(S,`frak-post-purchase`,[`customerId`,`orderId`,`token`,`sharingUrl`,`merchantId`,`placement`,`classname`,`variant`,`badgeText`,`referrerText`,`refereeText`,`ctaText`,`products`,`preview`,`previewVariant`,`imageUrl`],{shadow:!1});export{S as PostPurchase};
@@ -1,5 +0,0 @@
1
- /*!
2
- * Copyright (c) 2023 Paul Miller (paulmillr.com)
3
- * SPDX-License-Identifier: MIT OR Apache-2.0
4
- */
5
- const e=(()=>{let e=[];for(let t=1;t<=40;t++){let n=(16*t+128)*t+64;if(t>=2){let e=Math.floor(t/7)+2;n-=(25*e-10)*e-55,t>=7&&(n-=36)}e.push(n>>>3)}return e})(),t=[`low`,`medium`,`quartile`,`high`],n={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},r={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},i={low:1,medium:0,quartile:3,high:2},a=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;function o(e){if(e=v(e),e===1)return[];let t=21+4*(e-1)-7,n=Math.ceil((t-6)/28),r=Math.floor((t-6)/n);r%2?r+=1:(t-6)%n*2>=n&&(r+=2);let i=[6];for(let e=1;e<n;e++)i.push(t-(n-e)*r);return i.push(t),i}function s(e,t){let n=i[e]<<3|t,r=n;for(let e=0;e<10;e++)r=r<<1^(r>>9)*1335;return(n<<10|r)^21522}function c(e){let t=e;for(let e=0;e<12;e++)t=t<<1^(t>>11)*7973;return e<<12|t}const l={numeric:1,alphanumeric:2,byte:4},u={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16]},d=(()=>{let e=new Uint8Array(510),t=new Uint8Array(256);for(let n=0,r=1;n<255;n++)e[n]=e[n+255]=r,t[r]=n,r<<=1,r&256&&(r^=285);return{exp:e,log:t}})();function f(e){let{exp:t,log:n}=d,r=new Uint8Array(e);r[e-1]=1;for(let i=0,a=1;i<e;i++){for(let i=0;i<e;i++){let o=r[i];r[i]=(o?t[n[o]+n[a]]:0)^(i+1<e?r[i+1]:0)}a=t[n[a]+1]}return r}const p=[];function m(e){let t=p[e];if(t!==void 0)return t;let n=f(e),{exp:r,log:i}=d,a=new Uint8Array(256*e);for(let t=1;t<256;t++){let o=i[t],s=t*e;for(let t=0;t<e;t++){let e=n[t];e&&(a[s+t]=r[i[e]+o])}}return p[e]={gen:n,mul:a}}function h(e,t,n){let{exp:r,log:i}=d,a=t.length,o=new Uint8Array(a);if(n!==void 0){let t=a-1;for(let r=0;r<e.length;r++){let i=(e[r]^o[0])*a;for(let e=0;e<t;e++)o[e]=o[e+1]^n[i+e];o[t]=n[i+t]}return o}for(let n=0;n<e.length;n++){let s=e[n]^o[0];if(o.copyWithin(0,1),o[a-1]=0,s)for(let e=0;e<a;e++)t[e]&&(o[e]^=r[i[t[e]]+i[s]])}return o}function g(t,i){let a=e[t-1],o=n[i][t-1],s=r[i][t-1],c=Math.floor(a/s)-o;return{words:o,numBlocks:s,shortBlocks:s-a%s,blockLen:c,capacity:(a-o*s)*8}}const _=e=>{throw Error(e)};function v(e){if(typeof e!=`number`)throw TypeError(`"ver" expected number, got type=${typeof e}`);if(!Number.isSafeInteger(e))throw RangeError(`"ver" expected safe integer, got ${e}`);if(e<1||e>40)throw RangeError(`Invalid version=${e}. Expected number [1..40]`);return e}function y(e){let t=`numeric`;for(let n=0;n<e.length;n++){let r=b[e.charCodeAt(n)];if(!(r>=0))return`byte`;r>9&&(t=`alphanumeric`)}return t}const b=(()=>{let e=new Int8Array(128).fill(-1);for(let t=0;t<45;t++)e[a.charCodeAt(t)]=t;return e})();function x(e,t,n,r,i){let a=g(e,t),o=u[r][Math.floor((e+7)/17)],s=r===`byte`?i.length:n.length;s>=1<<o&&_(`Capacity overflow`);let c=new Uint8Array(a.capacity>>>3),d=0,f=0,p=0,v=(e,t)=>{for(d=d<<t|e,f+=t;f>=8;)c[p++]=d>>>(f-=8)&255};if(v(l[r],4),v(s,o),r===`numeric`)for(let e=0;e<s;e+=3){let t=Math.min(3,s-e);v(Number(n.slice(e,e+t)),[0,4,7,10][t])}else if(r===`alphanumeric`){for(let e=0;e+1<s;e+=2)v(b[n.charCodeAt(e)]*45+b[n.charCodeAt(e+1)],11);s&1&&v(b[n.charCodeAt(s-1)],6)}else for(let e=0;e<i.length;e++)v(i[e],8);let y=p*8+f;y>a.capacity&&_(`Capacity overflow`),f&&(c[p]=d<<8-f&255),y+=Math.min(4,a.capacity-y),y&7&&(y+=8-(y&7));for(let e=y>>>3,t=0;e<c.length;e++,t^=1)c[e]=t?17:236;let{words:x,numBlocks:S,shortBlocks:C,blockLen:w}=a,T=m(x),E=[],D=[];for(let e=0,t=0;e<S;e++){let n=w+(e<C?0:1);E.push(c.subarray(t,t+n)),D.push(h(E[e],T.gen,T.mul)),t+=n}let O=new Uint8Array(c.length+x*S),k=0;for(let e=0;e<=w;e++)for(let t of E)e<t.length&&(O[k++]=t[e]);for(let e=0;e<x;e++)for(let t of D)O[k++]=t[e];return O}function S(e,t){let n=e%2,r=t%2,i=e%3,a=t%3*i%3,o=n&r,s=0;return n===r&&(s|=1),r===0&&(s|=2),i===0&&(s|=4),(e+t)%3==0&&(s|=8),(Math.floor(t/2)+Math.floor(e/3))%2==0&&(s|=16),o+a===0&&(s|=32),(o+a)%2==0&&(s|=64),((n^r)+a)%2==0&&(s|=128),s}const C=(()=>{let e=new Uint8Array(65536);for(let t=1;t<e.length;t++)e[t]=e[t>>>1]+(t&1);return e})(),w=e=>C[e&65535]+C[e>>>16],T=new Uint32Array(32);function E(e){let t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){let r=t[n]>>>0,i=1<<n;for(let t=0;t<32;t+=i<<1)for(let n=0;n<i;n++){let a=e[t+n]>>>0,o=e[t+n+i]>>>0,s=(a>>>i^o)&r;e[t+n]=(a^s<<i)>>>0,e[t+n+i]=(o^s)>>>0}}}const D=e=>{let t=e+31>>>5;return{size:e,words:t,v:new Uint32Array(t*e)}},O=(e,t,n)=>e.v[n*e.words+(t>>>5)]>>>(t&31)&1,k=(e,t,n,r)=>{let i=n*e.words+(t>>>5),a=1<<(t&31);e.v[i]=r?e.v[i]|a:e.v[i]&~a};function A(e,t){let{size:n,words:r,v:i}=e,a=T;for(let e=0;e<n;e+=32)for(let o=0;o<r;o++){let s=Math.min(32,n-e);for(let t=0;t<s;t++)a[t]=i[(e+t)*r+o];a.fill(0,s),E(a);for(let r=0,i=o*32;r<32&&i<n;r++,i++)t.v[i*t.words+(e>>>5)]=a[r]}}function j(e){let{size:t,words:n,v:r}=e,i=t&31?(1<<(t&31))-1>>>0:4294967295,a=0;for(let e=0;e<n;e++){let o=e===n-1?i:4294967295,s=r[3*n+e],c=4294967295,l=r[e]^r[n+e],u=r[n+e]^r[2*n+e],d=r[2*n+e]^s;for(let i=0,f=4*n+e;i<=t-5;i++,f+=n){let e=r[f],t=s^e,n=~(l|u|d|t)&o;n&&(a+=w(n>>>0)+2*w((n&c)>>>0)),c=l,l=u,u=d,d=t,s=e}}return a}function M(e){let{size:t,words:n,v:r}=e,i=t&31?(1<<(t&31))-1>>>0:4294967295,a=0;for(let e=0;e<n;e++){let o=e===n-1?i:4294967295;for(let i=0;i<=t-11;i++){let t=i*n+e,s=r[t],c=r[t+=n],l=r[t+=n],u=r[t+=n],d=r[t+=n],f=r[t+=n],p=r[t+=n],m=r[t+=n],h=r[t+=n],g=r[t+=n],_=r[t+n],v=o&s&~c&l&u&d&~f&p&~(m|h|g|_),y=o&~(s|c|l|u)&d&~f&p&m&h&~g&_;a+=w(v>>>0)+w(y>>>0)}}return a}function N(e,t,n=1/0){let{size:r,words:i,v:a}=e,o=j(e)+j(t);if(o>=n)return o;let s=(1<<r-32*(i-1)-1)-1>>>0,c=0,l=0;for(let e=0;e<r;e++)for(let t=0;t<i;t++){let n=a[e*i+t];if(l+=w(n>>>0),e===r-1)continue;let o=a[(e+1)*i+t],u=t+1<i?a[e*i+t+1]:0,d=t+1<i?a[(e+1)*i+t+1]:0,f=~(n^o),p=~(n^(n>>>1|u<<31)),m=~(o^(o>>>1|d<<31)),h=f&p&m;t===i-1&&(h&=s),c+=w(h>>>0)}let u=r*r,d=Math.ceil(Math.max(0,Math.abs(l*100-u*50)-u*5)/(u*5)),f=o+3*c+10*d;return f>=n?f:f+40*(M(e)+M(t))}function P(e,t,n,r){let i=e.size,a=s(n,r);for(let t=0;t<15;t++){let n=a>>t&1;t<6?k(e,8,t,n):t<8?k(e,8,t+1,n):t===8?k(e,7,8,n):k(e,14-t,8,n),t<8?k(e,i-1-t,8,n):k(e,8,i-15+t,n)}if(k(e,8,i-8,1),t>=7){let n=c(t);for(let t=0;t<18;t++){let r=n>>t&1,a=i-11+t%3,o=t/3|0;k(e,a,o,r),k(e,o,a,r)}}}let F;function I(e){let t=21+4*(e-1),n=D(t),r=new Uint8Array(t*t),i=(e,i,a)=>{k(n,e,i,a),r[i*t+e]=1};for(let[e,n]of[[0,0],[t-7,0],[0,t-7]])for(let r=-1;r<8;r++)for(let a=-1;a<8;a++){let o=e+a,s=n+r;o<0||s<0||o>=t||s>=t||i(o,s,+(a>=0&&a<7&&r>=0&&r<7&&(a===0||a===6||r===0||r===6||a>1&&a<5&&r>1&&r<5)))}let a=o(e);for(let e of a)for(let n of a)if(!r[e*t+n])for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++){let a=Math.max(Math.abs(r),Math.abs(t))!==1;i(n+r,e+t,+!!a)}for(let e=0;e<t;e++)r[6*t+e]||i(e,6,+(e%2==0)),r[e*t+6]||i(6,e,+(e%2==0));for(let e=0;e<9;e++)e!==6&&(i(8,e,0),i(e,8,0)),e<8&&(i(t-1-e,8,0),i(8,t-1-e,0));if(e>=7)for(let e=0;e<18;e++){let n=t-11+e%3,r=e/3|0;i(n,r,0),i(r,n,0)}let s=[];for(let e=0;e<8;e++)s.push(D(t));let c=new Uint16Array(t*t),l=0;for(let e=t-1,i=-1,a=t-1;e>0;e-=2,i=-i)for(e===6&&(e=5);;a+=i){for(let i=0;i<2;i++){let o=e-i;if(r[a*t+o])continue;let u=a*n.words+(o>>>5);c[l++]=u<<5|o&31;for(let e=0,t=S(o,a);t;e++,t>>=1)t&1&&(s[e].v[u]|=1<<(o&31))}if(a+i<0||a+i>=t)break}let u=s.map(e=>{let n=D(t);return A(e,n),n.v});return{ver:e,tpl:n.v,pos:c.slice(0,l),planes:s.map(e=>e.v),planesT:u,work:[D(t),D(t),D(t),D(t)]}}function L(e,t,n,r,i=!1){(F===void 0||F.ver!==e)&&(F=I(e));let{tpl:a,pos:o,planes:s,planesT:c,work:l}=F,[u,d,f,p]=l;u.v.set(a);let m=Math.min(8*n.length,o.length);for(let e=0;e<m;e++)if(n[e>>>3]&128>>>(e&7)){let t=o[e];u.v[t>>>5]|=1<<(t&31)}let h=r;if(h===void 0){A(u,d);let e=1/0;for(let t=0;t<8;t++){let n=s[t],r=c[t];for(let e=0;e<f.v.length;e++)f.v[e]=u.v[e]^n[e],p.v[e]=d.v[e]^r[e];let i=N(f,p,e);i<e&&(e=i,h=t)}}let g=s[h];for(let e=0;e<u.v.length;e++)u.v[e]^=g[e];return i||P(u,e,t,h),u}const R=(e,t)=>{if(typeof e!=`number`)throw TypeError(`"${t}" expected number, got type=${typeof e}`);if(!Number.isSafeInteger(e))throw RangeError(`"${t}" expected safe integer, got ${e}`);return e},z=(e,t)=>{if(typeof e!=`string`)throw TypeError(`"${t}" expected string, got type=${typeof e}`);return e};function B(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<128)t++;else if(r<2048)t+=2;else if(r<55296||r>57343)t+=3;else if(r<=56319&&n+1<e.length){let r=e.charCodeAt(n+1);r>=56320&&r<=57343?(t+=4,n++):t+=3}else t+=3}return t}function V(e,t){let n=u.byte[Math.floor((e+7)/17)];return Math.min((1<<n)-1,Math.floor((g(e,t).capacity-4-n)/8))}function H(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}const U=(e,t,n)=>e.map[t]>=0&&e.map[n]>=0&&O(e.m,e.map[t],e.map[n])===1,W=[10,27],G=String.fromCharCode(W[0]);function K(e){let t=e.W,n=Array(t);for(let r=0;r<t;r++){let i=Array(t);for(let n=0;n<t;n++)i[n]=U(e,n,r);n[r]=i}return n}function q(e){let t=e.W,n=``;for(let r=0;r<t;r+=2){for(let i=0;i<t;i++){let a=U(e,i,r),o=r+1>=t||U(e,i,r+1);n+=!a&&!o?`█`:!a&&o?`▀`:a&&!o?`▄`:` `}n+=G}return n}function J(e){let t=e.W,n=String.fromCharCode(W[1]),r=n+`[0m`,i=``;for(let a=0;a<t;a++){for(let o=0;o<t;o++)i+=U(e,o,a)?`${n}[40m ${r}`:`${n}[1;47m ${r}`;i+=G}return i}function Y(e,t){let n=e.W,r=`<svg viewBox="0 0 ${n} ${n}" xmlns="http://www.w3.org/2000/svg">`,i=``,a;for(let o=0;o<n;o++)for(let s=0;s<n;s++){if(!U(e,s,o))continue;if(!t){r+=`<rect x="${s}" y="${o}" width="1" height="1" />`;continue}let n=`M${s} ${o}`;if(a){let e=`m${s-a.x} ${o-a.y}`;e.length<=n.length&&(n=e)}i+=`${n}h1v1${s<10?`H${s}`:`h-1`}Z`,a={x:s,y:o}}return t&&(r+=`<path d="${i}"/>`),r+`</svg>`}function X(e){let t=e.W,n=t*t,r=Math.floor(n/126),i=n%126,a=new Uint8Array(408+r*128+2+i+4),o=0,s=e=>{a[o++]=e&255,a[o++]=e>>>8};for(let e of[71,73,70,56,55,97])a[o++]=e;s(t),s(t),a[o++]=246,o+=2,a[o++]=255,a[o++]=255,a[o++]=255,o+=381,a[o++]=44,o+=4,s(t),s(t),a[o++]=0,a[o++]=7;let{m:c,map:l}=e,u=new Uint8Array(t),d=-2;for(let e=0,r=0;e<t;e++){let i=l[e];if(i!==d&&(d=i,u.fill(0),i>=0))for(let e=0;e<t;e++)l[e]>=0&&(u[e]=O(c,l[e],i));for(let e=0;e<t;){if(r%126==0){let e=n-r;a[o++]=(e<126?e:126)+1,a[o++]=128}let i=Math.min(126-r%126,t-e);a.set(u.subarray(e,e+i),o),o+=i,e+=i,r+=i}}return i===0&&(a[o++]=1,a[o++]=128),a[o++]=1,a[o++]=129,a[o++]=0,a[o++]=59,a}function Z(e){let t=e,n;if(typeof t.toBase64==`function`)n=t.toBase64();else{let e=``;for(let n=0;n<t.length;n+=8192)e+=String.fromCharCode(...t.subarray(n,n+8192));n=btoa(e)}return`data:image/gif;base64,`+n}function Q(e,n=`raw`,r={}){if(z(e,`text`),z(n,`output`),typeof r!=`object`||!r||Array.isArray(r))throw TypeError(`"opts" expected object, got type=${typeof r}`);let i=r.version;i!==void 0&&(i=v(i));let o=r.ecc===void 0?`medium`:r.ecc;t.includes(o)||_(`invalid ecc=${o}`);let s=r.encoding===void 0?y(e):r.encoding;if(u[s]||_(`invalid encoding=${s}`),s!==`byte`){let t=s===`numeric`?a.slice(0,10):a;for(let n of e)t.includes(n)||_(`Unknown letter: "${n}". Allowed: ${t}`)}r.mask!==void 0&&(R(r.mask,`opts.mask`)<0||r.mask>7)&&_(`invalid mask=${r.mask}`);let c=r.textEncoder;if(s===`byte`&&c===void 0){let t=V(i===void 0?40:i,o);(e.length>t||B(e)>t)&&_(`Capacity overflow`)}let l=s===`byte`?(c===void 0?e=>new TextEncoder().encode(e):c)(e):void 0;if(l!==void 0&&!H(l))throw TypeError(`"opts.textEncoder" expected Uint8Array, got type=${typeof l}`);let d=s===`byte`?l.length:e.length,f=s===`numeric`?Math.floor(d/3)*10+[0,4,7][d%3]:s===`alphanumeric`?Math.floor(d/2)*11+d%2*6:d*8;if(i===void 0){for(i=1;i<=40;i++){let e=u[s][Math.floor((i+7)/17)];if(d<1<<e&&4+e+f<=g(i,o).capacity)break}i>40&&_(`Capacity overflow`)}else{let e=u[s][Math.floor((i+7)/17)];(d>=1<<e||4+e+f>g(i,o).capacity)&&_(`Capacity overflow`)}let p=x(i,o,e,s,l),m=L(i,o,p,r.mask),h=r.border===void 0?2:R(r.border,`opts.border`);if(h<=0)throw RangeError(`invalid border=${h}`);let b=r.scale===void 0?1:R(r.scale,`opts.scale`);if(b<=0||b>1024)throw RangeError(`invalid scale factor: ${b}`);let S=(m.size+2*h)*b,C=n===`ascii`||n===`gif`||n===`data-url`?4096:1024;if(S>C)throw RangeError(`invalid opts: output is ${S}x${S} (max ${C}), reduce border/scale`);let w=new Int32Array(S);for(let e=0;e<S;e++){let t=Math.floor(e/b)-h;w[e]=t>=0&&t<m.size?t:-1}let T={m,W:S,map:w};return n===`raw`?K(T):n===`ascii`?q(T):n===`term`?J(T):n===`svg`?Y(T,r.optimize===void 0||r.optimize):n===`gif`?X(T):n===`data-url`?Z(X(T)):_(`Unknown output: ${n}`)}export{Q as default,Q as encodeQR};
@@ -1 +0,0 @@
1
- import{S as e,b as t,v as n,x as r,y as i}from"./loader.js";function a(e){return Array.isArray(e)?e:e.conditions}function o(e){if(typeof e==`number`)return e;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:void 0}}function s(e,t,n){let r=[];for(let i of a(e)){if(`logic`in i){r.push(...s(i,t,n));continue}if(i.field===t&&n.has(i.operator)){let e=o(i.value);e!=null&&r.push(e)}}return r}const c=new Set([`gt`,`gte`,`between`]),l=new Set([`gt`,`gte`]);function u(e){let t=s(e,`purchase.amount`,c);return t.length>0?Math.min(...t):void 0}function d(e){let t=s(e,`time.timestamp`,l);if(t.length!==0)return new Date(Math.min(...t)*1e3)}function f(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`percentage`:return e.maxAmount?.[t]??0;case`tiered`:return e.tiers.reduce((e,n)=>`amount`in n?Math.max(e,n.amount[t]):e,0)}}function p(e){return e.payoutType===`percentage`?e.percent:e.payoutType===`tiered`?e.tiers.reduce((e,t)=>`percent`in t?Math.max(e,t.percent):e,0):0}function m(e,t){let n=f(e,t);return n>0?n:p(e)*1e-6}function h(n,i){let a=e(i),o=r(a);switch(n.payoutType){case`fixed`:return t(Math.round(n.amount[o]),a);case`percentage`:return`${n.percent} %`;case`tiered`:{let e=f(n,o);if(e>0)return t(Math.round(e),a);let r=p(n);return r>0?`${r} %`:t(0,a)}}}function g(t,a){let o=e(a),s=r(o);switch(t.payoutType){case`fixed`:return n(Math.round(t.amount[s]),o);case`percentage`:return i(t.percent);case`tiered`:{let e=f(t,s);if(e>0)return n(Math.round(e),o);let r=p(t);return r>0?i(r):n(0,o)}}}function _(t,n){if(!(!t||m(t,r(e(n)))<=0))return h(t,n)}function v(e,t){return t?e.replaceAll(`{REWARD}`,t):e.replaceAll(`{REWARD}`,``)}const y=new Set([`eq`,`neq`,`gt`,`gte`,`lt`,`lte`,`between`]),b=new Set([`contains`,`starts_with`,`ends_with`]);function x(e){return`logic`in e&&`conditions`in e}function S(e,t){return e[t]}function C(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:void 0}}function w(e,t){let n=C(e),r=C(t);return n!==void 0&&r!==void 0?n-r:String(e).localeCompare(String(t))}function T(e,t,n){if(!Array.isArray(n))return e===`not_in`;if(t==null)return;let r=n.includes(t);return e===`in`?r:!r}function E(e,t,n,r){switch(e){case`eq`:return t===n;case`neq`:return t!==n;case`gt`:return w(t,n)>0;case`gte`:return w(t,n)>=0;case`lt`:return w(t,n)<0;case`lte`:return w(t,n)<=0;case`between`:return r==null||Array.isArray(r)?void 0:w(t,n)>=0&&w(t,r)<=0}}function D(e,t,n){if(typeof t==`string`&&typeof n==`string`)return e===`contains`?t.includes(n):e===`starts_with`?t.startsWith(n):t.endsWith(n)}function O(e,t){let n=S(t,e.field),{operator:r,value:i,valueTo:a}=e;if(r===`exists`)return n!=null;if(r===`not_exists`)return n==null;if(r===`in`||r===`not_in`)return T(r,n,i);if(!(Array.isArray(i)||n==null||i==null)){if(y.has(r))return E(r,n,i,a);if(b.has(r))return D(r,n,i)}}function k(e,t){if(x(e)){let n=e.conditions.map(e=>k(e,t));return e.logic===`all`?n.every(Boolean):e.logic===`any`?n.some(Boolean):e.logic!==`none`||!n.some(Boolean)}return O(e,t)??!0}function A(e,t){return e?Array.isArray(e)?e.every(e=>k(e,t)):k(e,t):!0}function j(e,t){return e.expiresAt!=null&&new Date(e.expiresAt).getTime()<=t}function M(e,t){let n=d(e.conditions);return n==null||n.getTime()<=t}function N(e,t){return t===`referee`?e.referee:e.referrer}function P(e,t,n){let r=N(e,n);return r?m(r,t):0}function F(e,t){if(!t||t.length===0||!e.productScope)return;let n=t.filter(t=>A(e.productScope,t));return n.length>0?n:void 0}function I(e,t){return!t||t.length===0||!e.productScope||t.some(t=>A(e.productScope,t))}function L(t,n={}){let i=(n.now??new Date).getTime(),a=n.audience??`referrer`,o=r(e(n.currency)),s=(n.targetInteraction?t.filter(e=>e.interactionTypeKey===n.targetInteraction):t).filter(e=>!j(e,i)),c=s.filter(e=>M(e,i));if(c.length>0){let e=c.reduce((e,t)=>{let r=I(e,n.products),i=I(t,n.products);return r===i?P(t,o,a)>P(e,o,a)?t:e:i?t:e});return{campaign:e,status:`live`,matchedProducts:F(e,n.products)}}let l=s.map(e=>({campaign:e,startsAt:d(e.conditions)})).filter(e=>e.startsAt!=null);if(l.length===0)return;let u=l.reduce((e,t)=>{let r=I(e.campaign,n.products),i=I(t.campaign,n.products);return r===i?t.startsAt.getTime()<e.startsAt.getTime()?t:e:i?t:e});return{campaign:u.campaign,status:`upcoming`,startsAt:u.startsAt,matchedProducts:F(u.campaign,n.products)}}function R(e,n={}){let r=L(e,n);if(!r)return;let i=N(r.campaign,n.audience??`referrer`);if(!i)return;let a=_(i,n.currency);if(!a)return;let o=u(r.campaign.conditions),s=o==null?void 0:t(o,n.currency),c=r.campaign.defaultLockupSeconds,l=c&&c>0?Math.round(c/86400):void 0;return{formatted:a,parts:g(i,n.currency),payoutType:i.payoutType,minPurchaseAmount:s,lockupDurationDays:l,referrerReward:r.campaign.referrer,refereeReward:r.campaign.referee,minPurchaseValue:o??void 0,isProductScoped:r.campaign.productScope!=null,matchedProducts:r.matchedProducts}}export{v as i,L as n,R as r,_ as t};
@@ -1 +0,0 @@
1
- import{w as e}from"./loader.js";import{o as t,s as n}from"./jsxRuntime.module.DCugjvlV.js";function r(){return n(t,()=>e.getConfig().components)}export{r as t};
@@ -1,5 +0,0 @@
1
- //#endregion
2
- //#region src/styles/sharedBaseCss.css.ts
3
- const cssSource = ".reset_base__1831jhd0 {\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n font-size: 100%;\n font: inherit;\n vertical-align: baseline;\n -webkit-tap-highlight-color: transparent;\n}\n.reset_focusRing__1831jhd1 {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.reset_focusRing__1831jhd1:focus-visible {\n outline-color: currentColor;\n}\n.reset_fieldAppearance__1831jhd2 {\n appearance: none;\n background-color: transparent;\n}\n.reset_visuallyHidden__1831jhd3 {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.reset_element_ul__1831jhd4 {\n list-style: none;\n}\n.reset_element_ol__1831jhd5 {\n list-style: none;\n}\n.reset_element_button__1831jhd6 {\n cursor: pointer;\n}\n.reset_element_a__1831jhd7 {\n text-decoration: none;\n color: inherit;\n}\n.reset_element_table__1831jhdb {\n border-collapse: collapse;\n border-spacing: 0;\n}\n.reset_element_img__1831jhdc {\n display: block;\n max-width: 100%;\n}:root {\n --text-primary__pbq4ak0: #000000;\n --text-secondary__pbq4ak1: #525252;\n --text-tertiary__pbq4ak2: #a3a3a3;\n --text-disabled__pbq4ak3: #a3a3a3;\n --text-action__pbq4ak4: #0043ef;\n --text-actionHover__pbq4ak5: #0036bf;\n --text-onAction__pbq4ak6: #ffffff;\n --text-error__pbq4ak7: #e31c31;\n --text-success__pbq4ak8: #09be67;\n --text-warning__pbq4ak9: #ec7e00;\n --surface-primary__pbq4aka: #0043ef;\n --surface-secondary__pbq4akb: #f2f6fe;\n --surface-background__pbq4akc: #ffffff;\n --surface-background2__pbq4akd: #f9fafb;\n --surface-elevated__pbq4ake: #ffffff;\n --surface-muted__pbq4akf: #f7f7f7;\n --surface-tertiary__pbq4akg: #f7f7f7;\n --surface-overlay__pbq4akh: #000000b2;\n --surface-disabled__pbq4aki: #e2e2e2;\n --surface-primaryHover__pbq4akj: #0036bf;\n --surface-primaryPressed__pbq4akk: #00288f;\n --surface-secondaryHover__pbq4akl: #e5ecfd;\n --surface-secondaryPressed__pbq4akm: #ccd9fc;\n --surface-error__pbq4akn: #fce8ea;\n --surface-success__pbq4ako: #f3fcf7;\n --surface-warning__pbq4akp: #fef9f2;\n --border-subtle__pbq4akq: #f5f5f5;\n --border-focus__pbq4akr: #a3a3a3;\n --border-error__pbq4aks: #e31c31;\n --border-success__pbq4akt: #09be67;\n --border-warning__pbq4aku: #ec7e00;\n --border-default__pbq4akv: #e2e2e2;\n --icon-primary__pbq4akw: #000000;\n --icon-secondary__pbq4akx: #525252;\n --icon-tertiary__pbq4aky: #a3a3a3;\n --icon-disabled__pbq4akz: #a3a3a3;\n --icon-action__pbq4ak10: #0043ef;\n --icon-actionHover__pbq4ak11: #0036bf;\n --icon-onAction__pbq4ak12: #ffffff;\n --icon-error__pbq4ak13: #e31c31;\n --icon-success__pbq4ak14: #09be67;\n --icon-warning__pbq4ak15: #ec7e00;\n}.sharedBaseCss_buttonReset__7cswil0 {\n margin: 0;\n border: 0;\n appearance: none;\n background-color: transparent;\n box-sizing: border-box;\n font-family: inherit;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.sharedBaseCss_buttonReset__7cswil0:focus-visible {\n outline-color: currentColor;\n}";
4
- //#endregion
5
- export { cssSource as t };