@frak-labs/core-sdk 0.1.0 → 0.1.1-beta.1e44255d

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 (131) hide show
  1. package/README.md +58 -0
  2. package/cdn/bundle.js +3 -8
  3. package/dist/actions.cjs +1 -1
  4. package/dist/actions.d.cts +3 -1400
  5. package/dist/actions.d.ts +3 -1400
  6. package/dist/actions.js +1 -1
  7. package/dist/bundle.cjs +1 -13
  8. package/dist/bundle.d.cts +4 -1927
  9. package/dist/bundle.d.ts +4 -1927
  10. package/dist/bundle.js +1 -13
  11. package/dist/computeLegacyProductId-BkyJ4rEY.d.ts +538 -0
  12. package/dist/computeLegacyProductId-Raks6FXg.d.cts +538 -0
  13. package/dist/index.cjs +1 -13
  14. package/dist/index.d.cts +3 -1269
  15. package/dist/index.d.ts +3 -1269
  16. package/dist/index.js +1 -13
  17. package/dist/openSso-BCJGchIb.d.cts +1022 -0
  18. package/dist/openSso-DG-_9CED.d.ts +1022 -0
  19. package/dist/setupClient-Cfwpu08d.js +13 -0
  20. package/dist/setupClient-Dh8ljuhV.cjs +13 -0
  21. package/dist/siweAuthenticate-BH7Dn7nZ.d.cts +536 -0
  22. package/dist/siweAuthenticate-BJHbtty4.js +1 -0
  23. package/dist/siweAuthenticate-Btem4QHs.d.ts +536 -0
  24. package/dist/siweAuthenticate-Cwj3HP0m.cjs +1 -0
  25. package/dist/trackEvent-M2RLTQ2p.js +1 -0
  26. package/dist/trackEvent-T_R9ER2S.cjs +1 -0
  27. package/package.json +25 -31
  28. package/src/actions/displayEmbeddedWallet.test.ts +194 -0
  29. package/src/actions/displayEmbeddedWallet.ts +21 -0
  30. package/src/actions/displayModal.test.ts +388 -0
  31. package/src/actions/displayModal.ts +120 -0
  32. package/src/actions/ensureIdentity.ts +68 -0
  33. package/src/actions/getMerchantInformation.test.ts +116 -0
  34. package/src/actions/getMerchantInformation.ts +16 -0
  35. package/src/actions/index.ts +30 -0
  36. package/src/actions/openSso.ts +118 -0
  37. package/src/actions/prepareSso.test.ts +223 -0
  38. package/src/actions/prepareSso.ts +48 -0
  39. package/src/actions/referral/processReferral.test.ts +248 -0
  40. package/src/actions/referral/processReferral.ts +232 -0
  41. package/src/actions/referral/referralInteraction.test.ts +147 -0
  42. package/src/actions/referral/referralInteraction.ts +52 -0
  43. package/src/actions/sendInteraction.ts +56 -0
  44. package/src/actions/trackPurchaseStatus.test.ts +500 -0
  45. package/src/actions/trackPurchaseStatus.ts +90 -0
  46. package/src/actions/watchWalletStatus.test.ts +372 -0
  47. package/src/actions/watchWalletStatus.ts +93 -0
  48. package/src/actions/wrapper/modalBuilder.test.ts +239 -0
  49. package/src/actions/wrapper/modalBuilder.ts +203 -0
  50. package/src/actions/wrapper/sendTransaction.test.ts +164 -0
  51. package/src/actions/wrapper/sendTransaction.ts +62 -0
  52. package/src/actions/wrapper/siweAuthenticate.test.ts +290 -0
  53. package/src/actions/wrapper/siweAuthenticate.ts +94 -0
  54. package/src/bundle.ts +2 -0
  55. package/src/clients/DebugInfo.test.ts +418 -0
  56. package/src/clients/DebugInfo.ts +182 -0
  57. package/src/clients/createIFrameFrakClient.ts +292 -0
  58. package/src/clients/index.ts +3 -0
  59. package/src/clients/setupClient.test.ts +343 -0
  60. package/src/clients/setupClient.ts +73 -0
  61. package/src/clients/transports/iframeLifecycleManager.test.ts +558 -0
  62. package/src/clients/transports/iframeLifecycleManager.ts +229 -0
  63. package/src/constants/interactionTypes.ts +15 -0
  64. package/src/constants/locales.ts +14 -0
  65. package/src/index.ts +109 -0
  66. package/src/types/client.ts +14 -0
  67. package/src/types/compression.ts +22 -0
  68. package/src/types/config.ts +117 -0
  69. package/src/types/context.ts +13 -0
  70. package/src/types/index.ts +74 -0
  71. package/src/types/lifecycle/client.ts +69 -0
  72. package/src/types/lifecycle/iframe.ts +41 -0
  73. package/src/types/lifecycle/index.ts +2 -0
  74. package/src/types/rpc/displayModal.ts +82 -0
  75. package/src/types/rpc/embedded/index.ts +68 -0
  76. package/src/types/rpc/embedded/loggedIn.ts +55 -0
  77. package/src/types/rpc/embedded/loggedOut.ts +28 -0
  78. package/src/types/rpc/interaction.ts +30 -0
  79. package/src/types/rpc/merchantInformation.ts +77 -0
  80. package/src/types/rpc/modal/final.ts +46 -0
  81. package/src/types/rpc/modal/generic.ts +46 -0
  82. package/src/types/rpc/modal/index.ts +16 -0
  83. package/src/types/rpc/modal/login.ts +36 -0
  84. package/src/types/rpc/modal/siweAuthenticate.ts +37 -0
  85. package/src/types/rpc/modal/transaction.ts +33 -0
  86. package/src/types/rpc/sso.ts +80 -0
  87. package/src/types/rpc/walletStatus.ts +29 -0
  88. package/src/types/rpc.ts +150 -0
  89. package/src/types/tracking.ts +60 -0
  90. package/src/types/transport.ts +34 -0
  91. package/src/utils/FrakContext.test.ts +407 -0
  92. package/src/utils/FrakContext.ts +158 -0
  93. package/src/utils/backendUrl.test.ts +83 -0
  94. package/src/utils/backendUrl.ts +62 -0
  95. package/src/utils/clientId.test.ts +41 -0
  96. package/src/utils/clientId.ts +43 -0
  97. package/src/utils/compression/b64.test.ts +181 -0
  98. package/src/utils/compression/b64.ts +29 -0
  99. package/src/utils/compression/compress.test.ts +123 -0
  100. package/src/utils/compression/compress.ts +11 -0
  101. package/src/utils/compression/decompress.test.ts +149 -0
  102. package/src/utils/compression/decompress.ts +11 -0
  103. package/src/utils/compression/index.ts +3 -0
  104. package/src/utils/computeLegacyProductId.ts +11 -0
  105. package/src/utils/constants.test.ts +23 -0
  106. package/src/utils/constants.ts +9 -0
  107. package/src/utils/deepLinkWithFallback.test.ts +243 -0
  108. package/src/utils/deepLinkWithFallback.ts +103 -0
  109. package/src/utils/formatAmount.test.ts +113 -0
  110. package/src/utils/formatAmount.ts +24 -0
  111. package/src/utils/getCurrencyAmountKey.test.ts +44 -0
  112. package/src/utils/getCurrencyAmountKey.ts +15 -0
  113. package/src/utils/getSupportedCurrency.test.ts +51 -0
  114. package/src/utils/getSupportedCurrency.ts +14 -0
  115. package/src/utils/getSupportedLocale.test.ts +64 -0
  116. package/src/utils/getSupportedLocale.ts +16 -0
  117. package/src/utils/iframeHelper.test.ts +463 -0
  118. package/src/utils/iframeHelper.ts +150 -0
  119. package/src/utils/index.ts +36 -0
  120. package/src/utils/merchantId.test.ts +653 -0
  121. package/src/utils/merchantId.ts +143 -0
  122. package/src/utils/sso.ts +126 -0
  123. package/src/utils/ssoUrlListener.test.ts +252 -0
  124. package/src/utils/ssoUrlListener.ts +60 -0
  125. package/src/utils/trackEvent.test.ts +180 -0
  126. package/src/utils/trackEvent.ts +41 -0
  127. package/cdn/bundle.js.LICENSE.txt +0 -10
  128. package/dist/interactions.cjs +0 -1
  129. package/dist/interactions.d.cts +0 -182
  130. package/dist/interactions.d.ts +0 -182
  131. package/dist/interactions.js +0 -1
package/dist/bundle.js CHANGED
@@ -1,13 +1 @@
1
- import{Deferred as e,FrakRpcError as t,RpcErrorCodes as n,compressJson as r,createRpcClient as a,decompressJson as o}from"@frak-labs/frame-connector";import{createClientCompressionMiddleware as i}from"@frak-labs/frame-connector/middleware";import{OpenPanel as s}from"@openpanel/web";import{bytesToHex as c,concatHex as l,encodeAbiParameters as u,hexToBytes as d,isAddressEqual as f,keccak256 as p,pad as m,toHex as w}from"viem";import{generateSiweNonce as h}from"viem/siwe";let g="nexus-wallet-backup";class y{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let n=this.getIframeStatus(),r=this.getNavigatorInfo(),a="Unknown";return e instanceof t?a=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?a=e.message:"string"==typeof e&&(a=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:r?this.base64Encode(r):"no-navigator",iframeStatus:n?this.base64Encode(n):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:a}}static empty(){return new y}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
2
- Debug Information:
3
- -----------------
4
- Timestamp: ${t.timestamp}
5
- URL: ${t.encodedUrl}
6
- Config: ${t.encodedConfig}
7
- Navigator Info: ${t.navigatorInfo}
8
- IFrame Status: ${t.iframeStatus}
9
- Last Request: ${t.lastRequest}
10
- Last Response: ${t.lastResponse}
11
- Client Status: ${t.clientStatus}
12
- Error: ${t.error}
13
- `.trim()}}let k={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 b({walletBaseUrl:e,config:t}){let n=document.querySelector("#frak-wallet");n&&n.remove();let r=document.createElement("iframe");return r.id=k.id,r.name=k.name,r.allow=k.allow,r.style.zIndex=k.style.zIndex.toString(),S({iframe:r,isVisible:!1}),document.body.appendChild(r),new Promise(n=>{r?.addEventListener("load",()=>n(r)),r.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}function S({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 I({config:r,iframe:o}){let c,l=r?.walletUrl??"https://wallet.frak.id",u=function({iframe:t}){let n=new e;return{handleEvent:async e=>{if(!("iframeLifecycle"in e))return;let{iframeLifecycle:r,data:a}=e;switch(r){case"connected":n.resolve(!0);break;case"do-backup":a.backup?localStorage.setItem(g,a.backup):localStorage.removeItem(g);break;case"remove-backup":localStorage.removeItem(g);break;case"show":case"hide":S({iframe:t,isVisible:"show"===r});break;case"handshake":t.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:a.token,currentUrl:window.location.href}},"*");break;case"redirect":{let e=new URL(a.baseRedirectUrl);e.searchParams.has("u")?(e.searchParams.delete("u"),e.searchParams.append("u",window.location.href),window.location.href=e.toString()):window.location.href=a.baseRedirectUrl}}},isConnected:n.promise}}({iframe:o}),d=new y(r,o);if(!o.contentWindow)throw new t(n.configError,"The iframe does not have a content window");let f=a({emittingTransport:o.contentWindow,listeningTransport:window,targetOrigin:l,middleware:[{async onRequest(e,r){if(!await u.isConnected)throw new t(n.clientNotConnected,"The iframe provider isn't connected yet");return r}},i(),{onRequest:(e,t)=>(d.setLastRequest(e),t),onResponse:(e,t)=>(d.setLastResponse(e,t),t)}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await u.handleEvent(e)}}}),p=function(e,t){let n,r,a=()=>e.sendLifecycle({clientLifecycle:"heartbeat"});function o(){n&&clearInterval(n),r&&clearTimeout(r)}return async function(){a(),n=setInterval(a,1e3),r=setTimeout(()=>{o(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,o()}(),o}(f,u),m=async()=>{p(),f.cleanup(),o.remove()};console.log("[Frak SDK] Initializing OpenPanel"),(c=new s({apiUrl:"https://op-api.gcp.frak.id",clientId:"f305d11d-b93b-487c-80d4-92deb7903e98",trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>!("track"===e&&t?.properties)||("sdkVersion"in t.properties||(t.properties={...t.properties,sdkVersion:"0.1.0"}),!0)})).setGlobalProperties({sdkVersion:"0.1.0"}),c.init();let w=v({config:r,rpcClient:f,lifecycleManager:u}).then(()=>d.updateSetupStatus(!0));return{config:r,debugInfo:d,waitForConnection:u.isConnected,waitForSetup:w,request:f.request,listenerRequest:f.listen,destroy:m,openPanel:c}}async function v({config:e,rpcClient:t,lifecycleManager:n}){async function r(){let n=e.customizations?.css;n&&t.sendLifecycle({clientLifecycle:"modal-css",data:{cssLink:n}})}async function a(){let n=e.customizations?.i18n;n&&t.sendLifecycle({clientLifecycle:"modal-i18n",data:{i18n:n}})}async function o(){if("undefined"==typeof window)return;let e=window.localStorage.getItem(g);e&&t.sendLifecycle({clientLifecycle:"restore-backup",data:{backup:e}})}await n.isConnected,function(e,t){if("undefined"==typeof window)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"))}(t,n.isConnected),await Promise.allSettled([r(),a(),o()])}let R={eur:"fr-FR",usd:"en-US",gbp:"en-GB"};function L(e){return e&&e in R?e:"eur"}async function x({config:e}){let t=function(e){let t=L(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}(e),n=await b({config:t});if(!n)return void console.error("Failed to create iframe");let r=I({config:t,iframe:n});return(await r.waitForSetup,await r.waitForConnection)?r:void console.error("Failed to connect to client")}function F(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function C(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0))}function T(e){return F(r(e))}function E(e){return o(C(e))}let D="fCtx";function P(e){if(e?.r)try{let t=d(e.r);return F(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function U(e){if(e&&0!==e.length)try{let t=C(e);return{r:c(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function q({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(D);return t?U(t):null}function A({url:e,context:t}){if(!e)return null;let n=q({url:e}),r=n?{...n,...t}:t;if(!r.r)return null;let a=P(r);if(!a)return null;let o=new URL(e);return o.searchParams.set(D,a),o.toString()}function $(e){let t=new URL(e);return t.searchParams.delete(D),t.toString()}let O={compress:P,decompress:U,parse:q,update:A,remove:$,replaceUrl:function({url:e,context:t}){let n;if(!window.location?.href||"undefined"==typeof window)return void console.error("No window found, can't update context");let r=e??window.location.href;(n=null!==t?A({url:r,context:t}):$(r))&&window.history.replaceState(null,"",n.toString())}};function W(e){return e?R[e]??R.eur:R.eur}function z(e){return e?`${e}Amount`:"eurAmount"}function N(e,t){let n=W(t),r=L(t);return e.toLocaleString(n,{style:"currency",currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function _(e,t,n={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,n)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}let M={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},V=Object.entries(M).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{}),B={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"},retail:{customerMeeting:"0x74489004"}};function j(t,n){if(!n)return t.request({method:"frak_listenToWalletStatus"}).then(e=>(G(t,e),e));let r=new e,a=!1;return t.listenerRequest({method:"frak_listenToWalletStatus"},e=>{G(t,e),n(e),a||(r.resolve(e),a=!0)}),r.promise}function G(e,t){"undefined"!=typeof window&&(e.openPanel?.setGlobalProperties({wallet:t.wallet??null}),t.interactionToken?window.sessionStorage.setItem("frak-wallet-interaction-token",t.interactionToken):window.sessionStorage.removeItem("frak-wallet-interaction-token"))}async function J(e,{productId:t,interaction:n,validation:r}){let a=t??function({domain:e}){return p(w((e??window.location.host).replace("www.","")))}(e.config);return await e.request({method:"frak_sendInteraction",params:[a,n,r]})}async function H(e,{steps:t,metadata:n}){return await e.request({method:"frak_displayModal",params:[t,n,e.config.metadata]})}async function K(e,t){return await e.request({method:"frak_displayEmbeddedWallet",params:[t,e.config.metadata]})}async function Q(e,t){let{metadata:n,customizations:r}=e.config;return await e.request({method:"frak_sso",params:[t,n.name,r?.css]})??{}}async function X(e){return await e.request({method:"frak_getProductInformation"})}async function Y(e){if("undefined"==typeof window)return void console.warn("[Frak] No window found, can't track purchase");let t=window.sessionStorage.getItem("frak-wallet-interaction-token");if(!t)return void console.warn("[Frak] No frak session found, skipping purchase check");await fetch("https://backend.frak.id/interactions/listenForPurchase",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","x-wallet-sdk-auth":t},body:JSON.stringify(e)})}async function Z(e,{siwe:t,metadata:n}){let r=e.config?.domain??window.location.host,a=t?.statement??`I confirm that I want to use my Frak wallet on: ${e.config.metadata.name}`,o={...t,statement:a,nonce:t?.nonce??h(),uri:t?.uri??`https://${r}`,version:t?.version??"1",domain:r};return(await H(e,{metadata:n,steps:{login:{},siweAuthenticate:{siwe:o}}})).siweAuthenticate}async function ee(e,{tx:t,metadata:n}){return(await H(e,{metadata:n,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}function et(e,{metadata:t,login:n,openSession:r}){return function e(t,n){async function r(e){return e&&(n.metadata=e(n.metadata??{})),await H(t,n)}return{params:n,sendTx:function(r){return e(t,{...n,steps:{...n.steps,sendTransaction:r}})},reward:function(r){return e(t,{...n,steps:{...n.steps,final:{...r,action:{key:"reward"}}}})},sharing:function(r,a){return e(t,{...n,steps:{...n.steps,final:{...a,action:{key:"sharing",options:r}}}})},display:r}}(e,{steps:{login:n??{},openSession:r??{}},metadata:t})}let en={createLink:()=>({handlerTypeDenominator:w(M.referral),interactionData:B.referral.createLink}),referred({referrer:e}){let t=l([B.referral.referred,m(e,{size:32})]);return{handlerTypeDenominator:w(M.referral),interactionData:t}}};async function er(e,{walletStatus:r,frakContext:a,modalConfig:o,productId:i,options:s}){let c=!1;async function l(){if(!c)return c=!0,eo(e,{modalConfig:{...o,loggedIn:{action:{key:"referred"}}},walletStatus:r})}async function u(t){let n=en.referred({referrer:t});await Promise.allSettled([J(e,{productId:i,interaction:n}),_(e,"user_referred",{properties:{referrer:t}})])}try{let{status:e,currentWallet:t}=await ea({initialWalletStatus:r,getFreshWalletStatus:l,pushReferralInteraction:u,frakContext:a});return O.replaceUrl({url:window.location?.href,context:s?.alwaysAppendUrl?{r:t}:null}),e}catch(e){return console.log("Error processing referral",{error:e}),O.replaceUrl({url:window.location?.href,context:s?.alwaysAppendUrl?{r:r?.wallet}:null}),function(e){if(e instanceof t)switch(e.code){case n.walletNotConnected:return"no-wallet";case n.serverErrorForInteractionDelegation:return"no-session"}return"error"}(e)}}async function ea({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:n,frakContext:r}){let a=e?.wallet;return r?.r?(a||(a=await t()),a&&f(r.r,a))?{status:"self-referral",currentWallet:a}:(e?.interactionSession||(a=await t()),await n(r.r),{status:"success",currentWallet:a}):{status:"no-referrer",currentWallet:a}}async function eo(e,{modalConfig:t,walletStatus:n}){if(!n?.interactionSession){let n=await K(e,t??{});return n?.wallet??void 0}return n.wallet??void 0}async function ei(e,{productId:t,modalConfig:n,options:r}={}){let a=O.parse({url:window.location.href}),o=await j(e);try{return await er(e,{walletStatus:o,frakContext:a,modalConfig:n,productId:t,options:r})}catch(e){console.warn("Error processing referral",{error:e})}}let es={openArticle({articleId:e}){let t=l([B.press.openArticle,m(e,{size:32})]);return{handlerTypeDenominator:w(M.press),interactionData:t}},readArticle({articleId:e}){let t=l([B.press.readArticle,m(e,{size:32})]);return{handlerTypeDenominator:w(M.press),interactionData:t}}},ec={startPurchase({purchaseId:e}){let t=l([B.purchase.started,m(e,{size:32})]);return{handlerTypeDenominator:w(M.purchase),interactionData:t}},completedPurchase({purchaseId:e,proof:t}){let n=u([{type:"uint256"},{type:"bytes32[]"}],[BigInt(e),t]),r=l([B.purchase.completed,n]);return{handlerTypeDenominator:w(M.purchase),interactionData:r}},unsafeCompletedPurchase({purchaseId:e}){let t=l([B.purchase.unsafeCompleted,m(e,{size:32})]);return{handlerTypeDenominator:w(M.purchase),interactionData:t}}},el={open:()=>({handlerTypeDenominator:w(M.webshop),interactionData:B.webshop.open})},eu={customerMeeting({agencyId:e}){let t=l([B.retail.customerMeeting,m(e,{size:32})]);return{handlerTypeDenominator:w(M.retail),interactionData:t}}};export{y as DebugInfoGatherer,O as FrakContextManager,es as PressInteractionEncoder,ec as PurchaseInteractionEncoder,en as ReferralInteractionEncoder,eu as RetailInteractionEncoder,el as WebShopInteractionEncoder,C as base64urlDecode,F as base64urlEncode,k as baseIframeProps,T as compressJsonToB64,I as createIFrameFrakClient,b as createIframe,E as decompressJsonFromB64,K as displayEmbeddedWallet,H as displayModal,N as formatAmount,z as getCurrencyAmountKey,X as getProductInformation,L as getSupportedCurrency,W as getSupportedLocale,B as interactionTypes,R as locales,et as modalBuilder,Q as openSso,er as processReferral,M as productTypes,V as productTypesMask,ei as referralInteraction,J as sendInteraction,ee as sendTransaction,x as setupClient,Z as siweAuthenticate,_ as trackEvent,Y as trackPurchaseStatus,j as watchWalletStatus};
1
+ import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./trackEvent-M2RLTQ2p.js";import{_ as h,a as g,c as _,d as v,f as y,g as b,h as x,i as S,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A,u as j}from"./setupClient-Cfwpu08d.js";import{a as M,c as N,d as P,f as F,i as I,l as L,n as R,o as z,p as B,r as V,s as H,t as U,u as W}from"./siweAuthenticate-BJHbtty4.js";export{b as DEEP_LINK_SCHEME,O as DebugInfoGatherer,e as FrakContextManager,r as base64urlDecode,u as base64urlEncode,S as baseIframeProps,c as clearMerchantIdCache,n as compressJsonToB64,s as computeLegacyProductId,T as createIFrameFrakClient,g as createIframe,h as decompressJsonFromB64,B as displayEmbeddedWallet,F as displayModal,P as ensureIdentity,d as fetchMerchantId,E as findIframeInOpener,_ as formatAmount,m as generateSsoUrl,l as getBackendUrl,i as getClientId,k as getCurrencyAmountKey,W as getMerchantInformation,j as getSupportedCurrency,C as getSupportedLocale,y as isChromiumAndroid,D as isFrakDeepLink,v as locales,V as modalBuilder,f as openSso,L as prepareSso,H as processReferral,z as referralInteraction,a as resolveMerchantId,N as sendInteraction,R as sendTransaction,A as setupClient,U as siweAuthenticate,t as ssoPopupFeatures,o as ssoPopupName,w as toAndroidIntentUrl,p as trackEvent,M as trackPurchaseStatus,x as triggerDeepLinkWithFallback,I as watchWalletStatus};
@@ -0,0 +1,538 @@
1
+ import { F as PrepareSsoParamsType, G as FrakWalletSdkConfig, L as SsoMetadata, W as Currency, a as FrakClient, i as FrakContext, p as TokenAmountType } from "./openSso-DG-_9CED.js";
2
+ import { Address, Hex } from "viem";
3
+ import { RpcMessage, RpcResponse } from "@frak-labs/frame-connector";
4
+
5
+ //#region src/types/compression.d.ts
6
+ /**
7
+ * The received encoded data from a client
8
+ * -> The encoded should contain a HashProtectedData once decoded
9
+ * @ignore
10
+ */
11
+ type CompressedData = Uint8Array;
12
+ /**
13
+ * The encoded data to send to a client / received by a client
14
+ * @ignore
15
+ */
16
+ type HashProtectedData<DataType> = Readonly<DataType & {
17
+ validationHash: string;
18
+ }>;
19
+ /**
20
+ * Represent a key provider used for the hashed and secure compression
21
+ * @ignore
22
+ */
23
+ type KeyProvider<DataType> = (value: DataType) => string[];
24
+ //#endregion
25
+ //#region src/types/tracking.d.ts
26
+ /**
27
+ * UTM parameters for marketing attribution
28
+ * @category Tracking
29
+ */
30
+ type UtmParams = {
31
+ source?: string;
32
+ medium?: string;
33
+ campaign?: string;
34
+ term?: string;
35
+ content?: string;
36
+ };
37
+ /**
38
+ * Parameters for tracking an arrival event
39
+ * @category Tracking
40
+ */
41
+ type TrackArrivalParams = {
42
+ /**
43
+ * The referrer wallet address (from fCtx URL param)
44
+ */
45
+ referrerWallet?: Address;
46
+ /**
47
+ * The landing page URL (defaults to current page)
48
+ */
49
+ landingUrl?: string;
50
+ /**
51
+ * UTM parameters for marketing attribution
52
+ */
53
+ utmParams?: UtmParams;
54
+ };
55
+ /**
56
+ * Result from tracking an arrival event
57
+ * @category Tracking
58
+ */
59
+ type TrackArrivalResult = {
60
+ success: boolean;
61
+ identityGroupId?: string;
62
+ touchpointId?: string;
63
+ error?: string;
64
+ };
65
+ //#endregion
66
+ //#region src/clients/createIFrameFrakClient.d.ts
67
+ /**
68
+ * Create a new iframe Frak client
69
+ * @param args
70
+ * @param args.config - The configuration to use for the Frak Wallet SDK.
71
+ * When `config.domain` is set, it is forwarded to the iframe handshake so the listener resolves the correct merchant in tunneled/proxied environments (e.g. Shopify dev with Cloudflare tunnel).
72
+ * @param args.iframe - The iframe to use for the communication
73
+ * @returns The created Frak Client
74
+ *
75
+ * @example
76
+ * const frakConfig: FrakWalletSdkConfig = {
77
+ * metadata: {
78
+ * name: "My app title",
79
+ * },
80
+ * }
81
+ * const iframe = await createIframe({ config: frakConfig });
82
+ * const client = createIFrameFrakClient({ config: frakConfig, iframe });
83
+ */
84
+ declare function createIFrameFrakClient({
85
+ config,
86
+ iframe
87
+ }: {
88
+ config: FrakWalletSdkConfig;
89
+ iframe: HTMLIFrameElement;
90
+ }): FrakClient;
91
+ //#endregion
92
+ //#region src/clients/DebugInfo.d.ts
93
+ /** @ignore */
94
+ declare class DebugInfoGatherer {
95
+ private config?;
96
+ private iframe?;
97
+ private isSetupDone;
98
+ private lastResponse;
99
+ private lastRequest;
100
+ constructor(config?: FrakWalletSdkConfig, iframe?: HTMLIFrameElement);
101
+ setLastResponse(message: RpcMessage, response: RpcResponse): void;
102
+ setLastRequest(event: RpcMessage): void;
103
+ updateSetupStatus(status: boolean): void;
104
+ private base64Encode;
105
+ /**
106
+ * Extract information from the iframe status
107
+ */
108
+ private getIframeStatus;
109
+ private getNavigatorInfo;
110
+ private gatherDebugInfo;
111
+ static empty(): DebugInfoGatherer;
112
+ /**
113
+ * Format Frak debug information
114
+ */
115
+ formatDebugInfo(error: Error | unknown | string): string;
116
+ }
117
+ //#endregion
118
+ //#region src/clients/setupClient.d.ts
119
+ /**
120
+ * Directly setup the Frak client with an iframe
121
+ * Return when the FrakClient is ready (setup and communication estbalished with the wallet)
122
+ *
123
+ * @param config - The configuration to use for the Frak Wallet SDK
124
+ * @returns a Promise with the Frak Client
125
+ *
126
+ * @example
127
+ * const frakConfig: FrakWalletSdkConfig = {
128
+ * metadata: {
129
+ * name: "My app title",
130
+ * },
131
+ * }
132
+ * const client = await setupClient({ config: frakConfig });
133
+ */
134
+ declare function setupClient({
135
+ config
136
+ }: {
137
+ config: FrakWalletSdkConfig;
138
+ }): Promise<FrakClient | undefined>;
139
+ //#endregion
140
+ //#region src/constants/locales.d.ts
141
+ /**
142
+ * The keys for each locales
143
+ * @inline
144
+ */
145
+ type LocalesKey = keyof typeof locales;
146
+ /**
147
+ * Map the currency to the locale
148
+ */
149
+ declare const locales: {
150
+ readonly eur: "fr-FR";
151
+ readonly usd: "en-US";
152
+ readonly gbp: "en-GB";
153
+ };
154
+ //#endregion
155
+ //#region src/utils/backendUrl.d.ts
156
+ /**
157
+ * Get the backend URL for API calls
158
+ * Tries to derive from SDK config, falls back to production
159
+ *
160
+ * @param walletUrl - Optional wallet URL to derive from (overrides global config)
161
+ */
162
+ declare function getBackendUrl(walletUrl?: string): string;
163
+ //#endregion
164
+ //#region src/utils/clientId.d.ts
165
+ /**
166
+ * Client ID utilities for anonymous tracking
167
+ * Generates and persists a UUID fingerprint for referral attribution
168
+ */
169
+ /**
170
+ * Get the client ID from localStorage, creating one if it doesn't exist
171
+ * @returns The client ID (UUID format)
172
+ */
173
+ declare function getClientId(): string;
174
+ //#endregion
175
+ //#region src/utils/compression/b64.d.ts
176
+ /**
177
+ * Encode a buffer to a base64url encoded string
178
+ * @param buffer The buffer to encode
179
+ * @returns The encoded string
180
+ */
181
+ declare function base64urlEncode(buffer: Uint8Array): string;
182
+ /**
183
+ * Decode a base64url encoded string
184
+ * @param value The value to decode
185
+ * @returns The decoded value
186
+ */
187
+ declare function base64urlDecode(value: string): Uint8Array;
188
+ //#endregion
189
+ //#region src/utils/compression/compress.d.ts
190
+ /**
191
+ * Compress json data
192
+ * @param data
193
+ * @ignore
194
+ */
195
+ declare function compressJsonToB64(data: unknown): string;
196
+ //#endregion
197
+ //#region src/utils/compression/decompress.d.ts
198
+ /**
199
+ * Decompress json data
200
+ * @param data
201
+ * @ignore
202
+ */
203
+ declare function decompressJsonFromB64<T>(data: string): T | null;
204
+ //#endregion
205
+ //#region src/utils/constants.d.ts
206
+ /**
207
+ * Deep link scheme for Frak Wallet mobile app
208
+ */
209
+ declare const DEEP_LINK_SCHEME = "frakwallet://";
210
+ //#endregion
211
+ //#region src/utils/deepLinkWithFallback.d.ts
212
+ /**
213
+ * Options for deep link with fallback
214
+ */
215
+ type DeepLinkFallbackOptions = {
216
+ /** Timeout in ms before triggering fallback (default: 2500ms) */timeout?: number; /** Callback invoked when fallback is triggered (app not installed) */
217
+ onFallback?: () => void;
218
+ };
219
+ /**
220
+ * Check if running on a Chromium-based Android browser.
221
+ *
222
+ * On Chrome Android, custom scheme deep links (e.g. frakwallet://) trigger
223
+ * a confirmation bar ("Continue to Frak Wallet?"). Using intent:// URLs
224
+ * instead bypasses this for Chromium browsers while keeping custom scheme
225
+ * fallback for non-Chromium browsers (e.g. Firefox) where it works fine.
226
+ */
227
+ declare function isChromiumAndroid(): boolean;
228
+ /**
229
+ * Convert a frakwallet:// deep link to an Android intent:// URL.
230
+ *
231
+ * Intent URLs let Chromium browsers open the app directly without
232
+ * showing the "Continue to app?" confirmation bar.
233
+ *
234
+ * Note: We intentionally omit the `package` parameter. Including it
235
+ * causes Chrome to redirect to the Play Store when the app is not
236
+ * installed, which breaks the visibility-based fallback detection.
237
+ * Without `package`, Chrome simply does nothing when the app is
238
+ * missing, allowing the fallback mechanism to fire correctly.
239
+ *
240
+ * Format: intent://path#Intent;scheme=frakwallet;end
241
+ */
242
+ declare function toAndroidIntentUrl(deepLink: string): string;
243
+ /**
244
+ * Trigger a deep link with visibility-based fallback detection.
245
+ *
246
+ * Uses the Page Visibility API to detect if the app opened (page goes hidden).
247
+ * If the page remains visible after the timeout, assumes app is not installed
248
+ * and invokes the onFallback callback.
249
+ *
250
+ * On Chromium Android, converts custom scheme to intent:// URL to avoid
251
+ * the "Continue to app?" confirmation bar.
252
+ *
253
+ * @param deepLink - The deep link URL to trigger (e.g., "frakwallet://wallet")
254
+ * @param options - Optional configuration (timeout, onFallback callback)
255
+ */
256
+ declare function triggerDeepLinkWithFallback(deepLink: string, options?: DeepLinkFallbackOptions): void;
257
+ /**
258
+ * Check if a URL is a Frak deep link
259
+ */
260
+ declare function isFrakDeepLink(url: string): boolean;
261
+ //#endregion
262
+ //#region src/utils/FrakContext.d.ts
263
+ /**
264
+ * Compress the current Frak context
265
+ * @param context - The context to be compressed
266
+ * @returns A compressed string containing the Frak context
267
+ */
268
+ declare function compress(context?: Partial<FrakContext>): string | undefined;
269
+ /**
270
+ * Decompress the given Frak context
271
+ * @param context - The raw context to be decompressed into a `FrakContext`
272
+ * @returns The decompressed Frak context, or undefined if it fails
273
+ */
274
+ declare function decompress(context?: string): FrakContext | undefined;
275
+ /**
276
+ * Parse the current URL into a Frak Context
277
+ * @param args
278
+ * @param args.url - The url to parse
279
+ * @returns The parsed Frak context
280
+ */
281
+ declare function parse({
282
+ url
283
+ }: {
284
+ url: string;
285
+ }): FrakContext | null | undefined;
286
+ /**
287
+ * Populate the current url with the given Frak context
288
+ * @param args
289
+ * @param args.url - The url to update
290
+ * @param args.context - The context to update
291
+ * @returns The new url with the Frak context
292
+ */
293
+ declare function update({
294
+ url,
295
+ context
296
+ }: {
297
+ url?: string;
298
+ context: Partial<FrakContext>;
299
+ }): string | null;
300
+ /**
301
+ * Remove Frak context from current url
302
+ * @param url - The url to update
303
+ * @returns The new url without the Frak context
304
+ */
305
+ declare function remove(url: string): string;
306
+ /**
307
+ * Replace the current url with the given Frak context
308
+ * @param args
309
+ * @param args.url - The url to update
310
+ * @param args.context - The context to update
311
+ */
312
+ declare function replaceUrl({
313
+ url: baseUrl,
314
+ context
315
+ }: {
316
+ url?: string;
317
+ context: Partial<FrakContext> | null;
318
+ }): void;
319
+ /**
320
+ * Export our frak context
321
+ */
322
+ declare const FrakContextManager: {
323
+ compress: typeof compress;
324
+ decompress: typeof decompress;
325
+ parse: typeof parse;
326
+ update: typeof update;
327
+ remove: typeof remove;
328
+ replaceUrl: typeof replaceUrl;
329
+ };
330
+ //#endregion
331
+ //#region src/utils/formatAmount.d.ts
332
+ /**
333
+ * Format a numeric amount as a localized currency string
334
+ * @param amount - The raw numeric amount to format
335
+ * @param currency - Optional currency config; defaults to EUR/fr-FR when omitted
336
+ * @returns Localized currency string (e.g. "1 500 €", "$1,500")
337
+ */
338
+ declare function formatAmount(amount: number, currency?: Currency): string;
339
+ //#endregion
340
+ //#region src/utils/getCurrencyAmountKey.d.ts
341
+ /**
342
+ * Get the currency amount key for a given currency
343
+ * @param currency - The currency to use
344
+ * @returns The currency amount key
345
+ */
346
+ declare function getCurrencyAmountKey(currency?: Currency): keyof TokenAmountType;
347
+ //#endregion
348
+ //#region src/utils/getSupportedCurrency.d.ts
349
+ /**
350
+ * Get the supported currency for a given currency
351
+ * @param currency - The currency to use
352
+ * @returns The supported currency
353
+ */
354
+ declare function getSupportedCurrency(currency?: Currency): Currency;
355
+ //#endregion
356
+ //#region src/utils/getSupportedLocale.d.ts
357
+ /**
358
+ * Get the supported locale for a given currency
359
+ * @param currency - The currency to use
360
+ * @returns The supported locale
361
+ */
362
+ declare function getSupportedLocale(currency?: Currency): (typeof locales)[LocalesKey];
363
+ //#endregion
364
+ //#region src/utils/iframeHelper.d.ts
365
+ /**
366
+ * Base props for the iframe
367
+ * @ignore
368
+ */
369
+ declare const baseIframeProps: {
370
+ id: string;
371
+ name: string;
372
+ title: string;
373
+ allow: string;
374
+ style: {
375
+ width: string;
376
+ height: string;
377
+ border: string;
378
+ position: string;
379
+ zIndex: number;
380
+ top: string;
381
+ left: string;
382
+ colorScheme: string;
383
+ };
384
+ };
385
+ /**
386
+ * Create the Frak iframe
387
+ * @param args
388
+ * @param args.walletBaseUrl - Use `config.walletUrl` instead. Will be removed in future versions.
389
+ * @param args.config - The configuration object containing iframe options, including the replacement for `walletBaseUrl`.
390
+ */
391
+ declare function createIframe({
392
+ walletBaseUrl,
393
+ config
394
+ }: {
395
+ walletBaseUrl?: string;
396
+ config?: FrakWalletSdkConfig;
397
+ }): Promise<HTMLIFrameElement | undefined>;
398
+ /**
399
+ * Find an iframe within window.opener by pathname
400
+ *
401
+ * When a popup is opened via window.open from an iframe, window.opener points to
402
+ * the parent window, not the iframe itself. This utility searches through all frames
403
+ * in window.opener to find an iframe matching the specified pathname.
404
+ *
405
+ * @param pathname - The pathname to search for (default: "/listener")
406
+ * @returns The matching iframe window, or null if not found
407
+ *
408
+ * @example
409
+ * ```typescript
410
+ * // Find the default /listener iframe
411
+ * const listenerIframe = findIframeInOpener();
412
+ *
413
+ * // Find a custom iframe
414
+ * const customIframe = findIframeInOpener("/my-custom-iframe");
415
+ * ```
416
+ */
417
+ declare function findIframeInOpener(pathname?: string): Window | null;
418
+ //#endregion
419
+ //#region src/utils/merchantId.d.ts
420
+ /**
421
+ * Merchant ID utilities for auto-fetching from backend
422
+ */
423
+ /**
424
+ * Fetch merchantId from backend by domain
425
+ *
426
+ * @param domain - The domain to lookup (defaults to current hostname)
427
+ * @param walletUrl - Optional wallet URL to derive backend URL
428
+ * @returns The merchantId if found, undefined otherwise
429
+ *
430
+ * @example
431
+ * ```ts
432
+ * const merchantId = await fetchMerchantId("shop.example.com");
433
+ * if (merchantId) {
434
+ * // Use merchantId for tracking
435
+ * }
436
+ * ```
437
+ */
438
+ declare function fetchMerchantId(domain?: string, walletUrl?: string): Promise<string | undefined>;
439
+ /**
440
+ * Clear the cached merchantId
441
+ * Useful for testing or when switching domains
442
+ */
443
+ declare function clearMerchantIdCache(): void;
444
+ /**
445
+ * Get merchantId from config or auto-fetch from backend
446
+ *
447
+ * @param config - The SDK config that may contain merchantId
448
+ * @param walletUrl - Optional wallet URL to derive backend URL
449
+ * @returns The merchantId if available (from config or fetch), undefined otherwise
450
+ */
451
+ declare function resolveMerchantId(config: {
452
+ metadata?: {
453
+ merchantId?: string;
454
+ };
455
+ }, walletUrl?: string): Promise<string | undefined>;
456
+ //#endregion
457
+ //#region src/utils/sso.d.ts
458
+ type AppSpecificSsoMetadata = SsoMetadata & {
459
+ name: string;
460
+ css?: string;
461
+ };
462
+ /**
463
+ * The full SSO params that will be used for compression
464
+ */
465
+ type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
466
+ metadata: AppSpecificSsoMetadata;
467
+ merchantId: string;
468
+ clientId: string;
469
+ };
470
+ /**
471
+ * Generate SSO URL with compressed parameters
472
+ * This mirrors the wallet's getOpenSsoLink() function
473
+ *
474
+ * @param walletUrl - Base wallet URL (e.g., "https://wallet.frak.id")
475
+ * @param params - SSO parameters
476
+ * @param merchantId - Merchant identifier
477
+ * @param name - Application name
478
+ * @param clientId - Client identifier for identity tracking
479
+ * @param css - Optional custom CSS
480
+ * @returns Complete SSO URL ready to open in popup or redirect
481
+ *
482
+ * @example
483
+ * ```ts
484
+ * const ssoUrl = generateSsoUrl(
485
+ * "https://wallet.frak.id",
486
+ * { metadata: { logoUrl: "..." }, directExit: true },
487
+ * "0x123...",
488
+ * "My App"
489
+ * );
490
+ * // Returns: https://wallet.frak.id/sso?p=<compressed_base64>
491
+ * ```
492
+ */
493
+ declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, merchantId: string, name: string, clientId: string, css?: string): string;
494
+ /**
495
+ * Type of compressed the sso data
496
+ */
497
+ type CompressedSsoData = {
498
+ id?: Hex;
499
+ cId: string;
500
+ r?: string;
501
+ d?: boolean;
502
+ l?: "en" | "fr";
503
+ m: string;
504
+ md: {
505
+ n: string;
506
+ css?: string;
507
+ l?: string;
508
+ h?: string;
509
+ };
510
+ };
511
+ //#endregion
512
+ //#region src/utils/trackEvent.d.ts
513
+ /**
514
+ * Analytics event names emitted by the SDK
515
+ */
516
+ type FrakEvent = "share_button_clicked" | "wallet_button_clicked" | "open_in_app_clicked" | "open_in_app_login_clicked" | "app_not_installed" | "share_modal_error" | "user_referred_started" | "user_referred_completed" | "user_referred_error";
517
+ type EventProps = Record<string, unknown>;
518
+ /**
519
+ * Track an analytics event via OpenPanel.
520
+ * Fire-and-forget: silently catches errors.
521
+ * @param client - The Frak client instance (no-op if undefined)
522
+ * @param event - The event name to track
523
+ * @param props - Optional event properties
524
+ */
525
+ declare function trackEvent(client: FrakClient | undefined, event: FrakEvent, props?: EventProps): void;
526
+ //#endregion
527
+ //#region src/utils/computeLegacyProductId.d.ts
528
+ /**
529
+ * Compute the legacy product id from a domain
530
+ * @ignore
531
+ */
532
+ declare function computeLegacyProductId({
533
+ domain
534
+ }?: {
535
+ domain?: string;
536
+ }): `0x${string}`;
537
+ //#endregion
538
+ export { getBackendUrl as A, HashProtectedData as B, triggerDeepLinkWithFallback as C, base64urlDecode as D, compressJsonToB64 as E, createIFrameFrakClient as F, TrackArrivalParams as I, TrackArrivalResult as L, locales as M, setupClient as N, base64urlEncode as O, DebugInfoGatherer as P, UtmParams as R, toAndroidIntentUrl as S, decompressJsonFromB64 as T, KeyProvider as V, formatAmount as _, CompressedSsoData as a, isChromiumAndroid as b, clearMerchantIdCache as c, baseIframeProps as d, createIframe as f, getCurrencyAmountKey as g, getSupportedCurrency as h, AppSpecificSsoMetadata as i, LocalesKey as j, getClientId as k, fetchMerchantId as l, getSupportedLocale as m, FrakEvent as n, FullSsoParams as o, findIframeInOpener as p, trackEvent as r, generateSsoUrl as s, computeLegacyProductId as t, resolveMerchantId as u, FrakContextManager as v, DEEP_LINK_SCHEME as w, isFrakDeepLink as x, DeepLinkFallbackOptions as y, CompressedData as z };