@frak-labs/components 1.3.2 → 1.3.3-beta.a79006c4
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/{Ambassador.DugUIOLT.js → Ambassador.7wEDPaYu.js} +2 -2
- package/cdn/{Banner.gDEO8VKX.js → Banner.8NeKFnVj.js} +2 -2
- package/cdn/{ButtonShare.OuDvPMdk.js → ButtonShare.BTT49Sbn.js} +1 -1
- package/cdn/{ButtonWallet.DNE6ZhkT.js → ButtonWallet.CB0Ysymx.js} +1 -1
- package/cdn/{GiftIcon.NTATj1WE.js → GiftIcon.CX0gLPUJ.js} +1 -1
- package/cdn/{OpenInAppButton.Dv7oAwl1.js → OpenInAppButton.DdL3xii8.js} +1 -1
- package/cdn/PostPurchase.ClgDFxmZ.js +102 -0
- package/cdn/components.js +1 -1
- package/cdn/{jsxRuntime.module.C5UTjP_H.js → jsxRuntime.module.CUZaa90V.js} +1 -1
- package/cdn/loader.js +8 -8
- package/cdn/replay-V6FXES7X.CgBxdfNp.js +1 -0
- package/cdn/rewards.F9iOJSNk.js +1 -0
- package/cdn/useGlobalComponents.CXuceSQ0.js +1 -0
- package/cdn/{useLightDomStyles.B0_CS0Kq.js → useLightDomStyles.C3oQ3HLu.js} +1 -1
- package/cdn/{usePlacement.B5JX9OU-.js → usePlacement.Cq64cZ9Q.js} +1 -1
- package/cdn/{useReward.By-xuybY.js → useReward.BpO3D675.js} +1 -1
- package/dist/ambassador.d.ts +2 -1
- package/dist/ambassador.js +2 -2
- package/dist/banner.d.ts +2 -1
- package/dist/banner.js +2 -2
- package/dist/buttonShare.d.ts +2 -1
- package/dist/buttonShare.js +2 -2
- package/dist/buttonWallet.d.ts +2 -1
- package/dist/buttonWallet.js +1 -1
- package/dist/i18n/defaults.d.ts +3 -2
- package/dist/openInApp.d.ts +2 -1
- package/dist/postPurchase.d.ts +2 -1
- package/dist/postPurchase.js +1 -1
- package/dist/{rewards-DoVY1pWr.js → rewards-HJlTkTcY.js} +4 -9
- package/dist/{useReward-DEhiMfgl.js → useReward-WmsNOFlz.js} +1 -1
- package/package.json +5 -5
- package/cdn/PostPurchase.DCNA-GAT.js +0 -102
- package/cdn/replay-V6FXES7X.efKsNT6s.js +0 -1
- package/cdn/rewards.COyZ6-7W.js +0 -1
- package/cdn/useGlobalComponents.DoG1wfeq.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as e,g as t,n,t as r,w as i}from"./loader.js";var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y={},b=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,S=Array.isArray;function C(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function T(e,t,n){var r,i,o,s={};for(o in t)o==`key`?r=t[o]:o==`ref`?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?a.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 E(e,s,r,i,null)}function E(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++s,__i:-1,__u:0};return i==null&&o.vnode!=null&&o.vnode(a),a}function D(e){return e.children}function O(e,t){this.props=e,this.context=t}function k(e,t){if(t==null)return e.__?k(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`?k(e):null}function A(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=C({},t);a.__v=t.__v+1,o.vnode&&o.vnode(a),L(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??k(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,oe(r,a,i),t.__e=t.__=null,a.__e!=n&&j(a)}}function j(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}),j(e)}function M(e){(!e.__d&&(e.__d=!0)&&c.push(e)&&!N.__r++||l!=o.debounceRendering)&&((l=o.debounceRendering)||u)(N)}function N(){try{for(var e,t=1;c.length;)c.length>t&&c.sort(d),e=c.shift(),t=c.length,A(e)}finally{c.length=N.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_=r&&r.__k||b,v=t.length;for(c=P(n,t,_,c,v),d=0;d<v;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||y,p.__i=d,g=L(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&R(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=te(p,c,e),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 P(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]=E(null,o,null,null,null):S(o)?o=e.__k[a]=E(D,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=E(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=ne(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=k(s)),le(s,s));return r}function te(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=te(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=k(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function F(e,t){return t||=[],e==null||typeof e==`boolean`||(S(e)?e.some(function(e){F(e,t)}):t.push(e)),t}function ne(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);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 re(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||x.test(t)?n:n+`px`}function I(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||re(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||re(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(h,`$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[m]=r[m]:(n[m]=g,e.addEventListener(t,a?v:_,a)):e.removeEventListener(t,a?v:_,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 ie(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[p]==null)t[p]=g++;else if(t[p]<n[m])return;return n(o.event?o.event(t):t)}}}function L(e,t,n,r,i,a,s,c,l,u){var d,f,p,m,h,g,_,v,y,x,T,E,A,j,M,N,P=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);n:if(typeof P==`function`){f=s.length;try{if(y=t.props,x=P.prototype&&P.prototype.render,T=(d=P.contextType)&&r[d.__c],E=d?T?T.props.value:d.__:r,n.__c?v=(p=t.__c=n.__c).__=p.__E:(x?t.__c=p=new P(y,E):(t.__c=p=new O(y,E),p.constructor=P,p.render=ue),T&&T.sub(p),p.state||(p.state={}),p.__n=r,m=p.__d=!0,p.__h=[],p._sb=[]),x&&p.__s==null&&(p.__s=p.state),x&&P.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=C({},p.__s)),C(p.__s,P.getDerivedStateFromProps(y,p.__s))),h=p.props,g=p.state,p.__v=t,m)x&&P.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),x&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(x&&P.getDerivedStateFromProps==null&&y!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(y,E),t.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(y,p.__s,E)){t.__v!=n.__v&&(p.props=y,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),b.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=k(n);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(y,p.__s,E),x&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,g,_)})}if(p.context=E,p.props=y,p.__P=e,p.__e=!1,A=o.__r,j=0,x)p.state=p.__s,p.__d=!1,A&&A(t),d=p.render(p.props,p.state,p.context),b.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,A&&A(t),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++j<25);p.state=p.__s,p.getChildContext!=null&&(r=C(C({},r),p.getChildContext())),x&&!m&&p.getSnapshotBeforeUpdate!=null&&(_=p.getSnapshotBeforeUpdate(h,g)),M=d!=null&&d.type===D&&d.key==null?se(d.props.children):d,c=ee(e,S(M)?M:[M],t,n,r,i,a,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),v&&(p.__E=p.__=null)}catch(e){if(s.length=f,t.__v=null,l||a!=null){if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;a!=null&&(a[a.indexOf(c)]=null),t.__e=c}else if(a!=null)for(N=a.length;N--;)w(a[N])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||ae(t),o.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=ce(n.__e,t,n,r,i,a,s,l,u);return(d=o.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++)R(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function se(e){return typeof e!=`object`||!e||e.__b>0?e:S(e)?e.map(se):e.constructor===void 0?C({},e):null}function ce(e,t,n,r,i,s,c,l,u){var d,f,p,m,h,g,_,v=n.props||y,b=t.props,x=t.type;if(x==`svg`?i=`http://www.w3.org/2000/svg`:x==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!x&&(x?h.localName==x:h.nodeType==3)){e=h,s[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(i,x,b.is&&b),l&&=(o.__m&&o.__m(t,s),!1),s=null}if(x==null)v===b||l&&e.data==b||(e.data=b);else{if(s=x==`textarea`&&b.defaultValue!=null?null:s&&a.call(e.childNodes),!l&&s!=null)for(v={},d=0;d<e.attributes.length;d++)v[(h=e.attributes[d]).name]=h.value;for(d in v)h=v[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in b||d==`value`&&`defaultValue`in b||d==`checked`&&`defaultChecked`in b||I(e,d,null,h,i);for(d in b)h=b[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?_=h:l&&typeof h!=`function`||v[d]===h||I(e,d,h,v[d],i);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,S(m)?m:[m],t,n,r,x==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,s,c,s?s[0]:n.__k&&k(n,0),l,u),s!=null)for(d=s.length;d--;)w(s[d]);l&&x!=`textarea`||(d=`value`,x==`progress`&&g==null?e.removeAttribute(`value`):g!=null&&(g!==e[d]||x==`progress`&&!g||x==`option`&&g!=v[d])&&I(e,d,g,v[d],i),d=`checked`,_!=null&&_!=e[d]&&I(e,d,_,v[d],i))}return e}function R(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){o.__e(e,n)}}function le(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||R(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&le(r[i],t,n||typeof e.type!=`function`);n||w(e.__e),e.__c=e.__=e.__e=void 0}function ue(e,t,n){return this.constructor(e,n)}function z(e,t,n){var r,i,s,c;t==document&&(t=document.documentElement),o.__&&o.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,s=[],c=[],L(t,e=(!r&&n||t).__k=T(D,null,[e]),i||y,y,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?a.call(t.childNodes):null,s,!r&&n?n:i?i.__e:t.firstChild,r,c),oe(s,e,c),e.props.children=null}function de(e,t){z(e,t,de)}function fe(e,t,n){var r,i,o,s,c=C({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o==`key`?r=t[o]:o==`ref`?i=t[o]:c[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?a.call(arguments,2):n),E(e.type,c,r||e.key,i||e.ref,null)}a=b.slice,o={__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}},s=0,O.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state);typeof e==`function`&&(e=e(C({},n),this.props)),e&&C(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),M(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},O.prototype.render=D,c=[],u=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,f=Math.random().toString(8),p=`__d`+f,m=`__a`+f,h=/(PointerCapture)$|Capture$/i,g=0,_=ie(!1),v=ie(!0);function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}function pe(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}var me=[`context`,`children`],he=[`useFragment`];function ge(e,t,n,r){function i(){var t,n=Reflect.construct(HTMLElement,[],i);return n._vdomComponent=e,r&&r.shadow?(n._root=n.attachShadow({mode:r.mode||`open`,serializable:(t=r.serializable)!=null&&t}),r.adoptedStyleSheets&&(n._root.adoptedStyleSheets=r.adoptedStyleSheets)):n._root=n,n}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=function(){ve.call(this,r)},i.prototype.attributeChangedCallback=be,i.prototype.disconnectedCallback=xe,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,e.formAssociated&&(i.formAssociated=!0),n.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||={},this._props[e]=t);var n=typeof t;t!=null&&n!==`string`&&n!==`boolean`&&n!==`number`||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i),i}function _e(e){this.getChildContext=function(){return e.context};var t=e.children;return fe(t,pe(e,me))}function ve(e){var t=new CustomEvent(`_preact`,{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=T(_e,B({},this._props,{context:t.detail.context}),Ce(this,this._vdomComponent,e)),(this.hasAttribute(`hydrate`)?de:z)(this._vdom,this._root)}function ye(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():``})}function be(e,t,n){if(this._vdom){var r={};r[e]=n??=void 0,r[ye(e)]=n,this._vdom=fe(this._vdom,r),z(this._vdom,this._root)}}function xe(){z(this._vdom=null,this._root)}function Se(e,t){var n=this,r=e.useFragment,i=pe(e,he);return T(r?D:`slot`,B({},i,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener(`_preact`,n._listener))):n.ref.removeEventListener(`_preact`,n._listener)}}))}function Ce(e,t,n){if(e.nodeType===3)return e.data;if(e.nodeType!==1)return null;var r=[],i={},a=0,o=e.attributes,s=e.childNodes;for(a=o.length;a--;)o[a].name!==`slot`&&(i[o[a].name]=o[a].value,i[ye(o[a].name)]=o[a].value);for(a=s.length;a--;){var c=Ce(s[a],null,n),l=s[a].slot;l?i[l]=T(Se,{name:l},c):r[a]=c}var u=!(!n||!n.shadow),d=t?T(Se,{useFragment:!u},r):r;return!u&&t&&(e.innerHTML=``),T(t||e.nodeName.toLowerCase(),i,d)}function we(t,n,i=[],a={shadow:!0}){if(typeof window<`u`&&(e(r),!customElements.get(n))){let e=i.map(String),r=e.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).filter(t=>!e.includes(t));ge(t,n,[...e,...r],a)}}var V,H,U,Te,W=0,Ee=[],G=o,De=G.__b,Oe=G.__r,ke=G.diffed,Ae=G.__c,je=G.unmount,Me=G.__;function K(e,t){G.__h&&G.__h(H,e,W||t),W=0;var n=H.__H||(H.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function q(e){return W=1,Ne(Be,e)}function Ne(e,t,n){var r=K(V++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Be(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=H,!H.__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};H.__f=!0;var a=H.shouldComponentUpdate,o=H.componentWillUpdate;H.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)},H.shouldComponentUpdate=i}return r.__N||r.__}function J(e,t){var n=K(V++,3);!G.__s&&Q(n.__H,t)&&(n.__=e,n.u=t,H.__H.__h.push(n))}function Pe(e,t){var n=K(V++,4);!G.__s&&Q(n.__H,t)&&(n.__=e,n.u=t,H.__h.push(n))}function Fe(e){return W=5,Y(function(){return{current:e}},[])}function Y(e,t){var n=K(V++,7);return Q(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ie(e,t){return W=8,Y(function(){return e},t)}function Le(){for(var e;e=Ee.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(X),t.__h.some(Z),t.__h=[]}catch(n){t.__h=[],G.__e(n,e.__v)}}}G.__b=function(e){H=null,De&&De(e)},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Me&&Me(e,t)},G.__r=function(e){Oe&&Oe(e),V=0;var t=(H=e.__c).__H;t&&(U===H?(t.__h=[],H.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(X),t.__h.some(Z),t.__h=[],V=0)),U=H},G.diffed=function(e){ke&&ke(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ee.push(t)!==1&&Te===G.requestAnimationFrame||((Te=G.requestAnimationFrame)||ze)(Le)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),U=H=null},G.__c=function(e,t){t.some(function(e){try{e.__h.some(X),e.__h=e.__h.filter(function(e){return!e.__||Z(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],G.__e(n,e.__v)}}),Ae&&Ae(e,t)},G.unmount=function(e){je&&je(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{X(e)}catch(e){t=e}}),n.__H=void 0,t&&G.__e(t,n.__v))};var Re=typeof requestAnimationFrame==`function`;function ze(e){var t,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Re&&(t=requestAnimationFrame(n))}function X(e){var t=H,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),H=t}function Z(e){var t=H;e.__c=e.__(),H=t}function Q(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Be(e,t){return typeof t==`function`?t(e):t}function Ve(){let[e,t]=q(()=>window.FrakSetup?.config?.waitForBackendConfig===!1||i.isResolved),[r,a]=q(()=>i.getConfig().hidden??!1),[o,s]=q(()=>!!window.FrakSetup?.client);return J(()=>{let e=i.getConfig();e.isResolved&&(t(!0),a(e.hidden??!1)),window.FrakSetup?.client&&s(!0);let r=e=>{let n=e.detail;n.isResolved&&t(!0),a(n.hidden??!1)};window.addEventListener(`frak:config`,r);let o=()=>s(!0);return n(`add`,o),()=>{window.removeEventListener(`frak:config`,r),n(`remove`,o)}},[]),{shouldRender:e,isHidden:r,isClientReady:o}}function He(e,t){for(var n in t)e[n]=t[n];return e}function Ue(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 We(e,t){var n=t(),r=q({t:{__:n,u:t}}),i=r[0].t,a=r[1];return Pe(function(){i.__=n,i.u=t,Ge(i)&&a({t:i})},[e,n,t]),J(function(){return Ge(i)&&a({t:i}),e(function(){Ge(i)&&a({t:i})})},[e]),n}function Ge(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 Ke(e,t){this.props=e,this.context=t}(Ke.prototype=new O).isPureReactComponent=!0,Ke.prototype.shouldComponentUpdate=function(e,t){return Ue(this.props,e)||Ue(this.state,t)};var qe=o.__b;o.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),qe&&qe(e)},typeof Symbol<`u`&&Symbol.for;var Je=o.__e;o.__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)}Je(e,t,n,r)};var Ye=o.unmount;function Xe(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=He({},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 Xe(e,t,n)})),e}function Ze(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ze(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 Qe(){this.__u=0,this.o=null,this.__b=null}function $e(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function $(){this.i=null,this.l=null}o.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ye&&Ye(e)},(Qe.prototype=new O).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=$e(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]=Ze(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)},Qe.prototype.componentWillUnmount=function(){this.o=[]},Qe.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]=Xe(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&T(D,null,e.fallback);return i&&(i.__u&=-33),[T(D,null,t.__a?null:e.children),i]};var et=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]}};($.prototype=new O).__a=function(e){var t=this,n=$e(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),et(t,e,r)):i()};n?n(a):a()}},$.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */ new Map;var t=F(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},$.prototype.componentDidUpdate=$.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){et(e,n,t)})};var tt=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,nt=/^(?: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]/,rt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,it=/[A-Z0-9]/g,at=typeof document<`u`,ot=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};O.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(O.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var st=o.event;o.event=function(e){return st&&(e=st(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var ct={configurable:!0,get:function(){return this.class}},lt=o.vnode;o.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||at&&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`||ot(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:rt.test(a)&&(a=s):s=a=`oninput`:i&&nt.test(a)?a=a.replace(it,`-$&`).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=F(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=F(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",ct)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=tt,lt&<(e)};var ut=o.__r;o.__r=function(e){ut&&ut(e),e.__c};var dt=o.diffed;o.diffed=function(e){dt&&dt(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 ft(e){return typeof window>`u`?()=>{}:(window.addEventListener(`frak:config`,e),()=>window.removeEventListener(`frak:config`,e))}function pt(){return We(ft,()=>i.getConfig().lang??t()??`en`)}const mt=`
|
|
1
|
+
import{D as e,h as t,n,t as r,w as i}from"./loader.js";var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y={},b=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,S=Array.isArray;function C(e,t){for(var n in t)e[n]=t[n];return e}function w(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function T(e,t,n){var r,i,o,s={};for(o in t)o==`key`?r=t[o]:o==`ref`?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?a.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 E(e,s,r,i,null)}function E(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++s,__i:-1,__u:0};return i==null&&o.vnode!=null&&o.vnode(a),a}function D(e){return e.children}function O(e,t){this.props=e,this.context=t}function k(e,t){if(t==null)return e.__?k(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`?k(e):null}function A(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=C({},t);a.__v=t.__v+1,o.vnode&&o.vnode(a),L(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??k(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,oe(r,a,i),t.__e=t.__=null,a.__e!=n&&j(a)}}function j(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}),j(e)}function M(e){(!e.__d&&(e.__d=!0)&&c.push(e)&&!N.__r++||l!=o.debounceRendering)&&((l=o.debounceRendering)||u)(N)}function N(){try{for(var e,t=1;c.length;)c.length>t&&c.sort(d),e=c.shift(),t=c.length,A(e)}finally{c.length=N.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_=r&&r.__k||b,v=t.length;for(c=P(n,t,_,c,v),d=0;d<v;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||y,p.__i=d,g=L(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&R(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=te(p,c,e),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 P(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]=E(null,o,null,null,null):S(o)?o=e.__k[a]=E(D,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=E(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=ne(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=k(s)),le(s,s));return r}function te(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=te(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=k(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function F(e,t){return t||=[],e==null||typeof e==`boolean`||(S(e)?e.some(function(e){F(e,t)}):t.push(e)),t}function ne(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);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 re(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||x.test(t)?n:n+`px`}function I(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||re(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||re(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(h,`$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[m]=r[m]:(n[m]=g,e.addEventListener(t,a?v:_,a)):e.removeEventListener(t,a?v:_,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 ie(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[p]==null)t[p]=g++;else if(t[p]<n[m])return;return n(o.event?o.event(t):t)}}}function L(e,t,n,r,i,a,s,c,l,u){var d,f,p,m,h,g,_,v,y,x,T,E,A,j,M,N,P=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);n:if(typeof P==`function`){f=s.length;try{if(y=t.props,x=P.prototype&&P.prototype.render,T=(d=P.contextType)&&r[d.__c],E=d?T?T.props.value:d.__:r,n.__c?v=(p=t.__c=n.__c).__=p.__E:(x?t.__c=p=new P(y,E):(t.__c=p=new O(y,E),p.constructor=P,p.render=ue),T&&T.sub(p),p.state||(p.state={}),p.__n=r,m=p.__d=!0,p.__h=[],p._sb=[]),x&&p.__s==null&&(p.__s=p.state),x&&P.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=C({},p.__s)),C(p.__s,P.getDerivedStateFromProps(y,p.__s))),h=p.props,g=p.state,p.__v=t,m)x&&P.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),x&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(x&&P.getDerivedStateFromProps==null&&y!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(y,E),t.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(y,p.__s,E)){t.__v!=n.__v&&(p.props=y,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),b.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=k(n);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(y,p.__s,E),x&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,g,_)})}if(p.context=E,p.props=y,p.__P=e,p.__e=!1,A=o.__r,j=0,x)p.state=p.__s,p.__d=!1,A&&A(t),d=p.render(p.props,p.state,p.context),b.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,A&&A(t),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++j<25);p.state=p.__s,p.getChildContext!=null&&(r=C(C({},r),p.getChildContext())),x&&!m&&p.getSnapshotBeforeUpdate!=null&&(_=p.getSnapshotBeforeUpdate(h,g)),M=d!=null&&d.type===D&&d.key==null?se(d.props.children):d,c=ee(e,S(M)?M:[M],t,n,r,i,a,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),v&&(p.__E=p.__=null)}catch(e){if(s.length=f,t.__v=null,l||a!=null){if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;a!=null&&(a[a.indexOf(c)]=null),t.__e=c}else if(a!=null)for(N=a.length;N--;)w(a[N])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||ae(t),o.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=ce(n.__e,t,n,r,i,a,s,l,u);return(d=o.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++)R(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function se(e){return typeof e!=`object`||!e||e.__b>0?e:S(e)?e.map(se):e.constructor===void 0?C({},e):null}function ce(e,t,n,r,i,s,c,l,u){var d,f,p,m,h,g,_,v=n.props||y,b=t.props,x=t.type;if(x==`svg`?i=`http://www.w3.org/2000/svg`:x==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!x&&(x?h.localName==x:h.nodeType==3)){e=h,s[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(i,x,b.is&&b),l&&=(o.__m&&o.__m(t,s),!1),s=null}if(x==null)v===b||l&&e.data==b||(e.data=b);else{if(s=x==`textarea`&&b.defaultValue!=null?null:s&&a.call(e.childNodes),!l&&s!=null)for(v={},d=0;d<e.attributes.length;d++)v[(h=e.attributes[d]).name]=h.value;for(d in v)h=v[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in b||d==`value`&&`defaultValue`in b||d==`checked`&&`defaultChecked`in b||I(e,d,null,h,i);for(d in b)h=b[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?_=h:l&&typeof h!=`function`||v[d]===h||I(e,d,h,v[d],i);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,S(m)?m:[m],t,n,r,x==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,s,c,s?s[0]:n.__k&&k(n,0),l,u),s!=null)for(d=s.length;d--;)w(s[d]);l&&x!=`textarea`||(d=`value`,x==`progress`&&g==null?e.removeAttribute(`value`):g!=null&&(g!==e[d]||x==`progress`&&!g||x==`option`&&g!=v[d])&&I(e,d,g,v[d],i),d=`checked`,_!=null&&_!=e[d]&&I(e,d,_,v[d],i))}return e}function R(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){o.__e(e,n)}}function le(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||R(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&le(r[i],t,n||typeof e.type!=`function`);n||w(e.__e),e.__c=e.__=e.__e=void 0}function ue(e,t,n){return this.constructor(e,n)}function z(e,t,n){var r,i,s,c;t==document&&(t=document.documentElement),o.__&&o.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,s=[],c=[],L(t,e=(!r&&n||t).__k=T(D,null,[e]),i||y,y,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?a.call(t.childNodes):null,s,!r&&n?n:i?i.__e:t.firstChild,r,c),oe(s,e,c),e.props.children=null}function de(e,t){z(e,t,de)}function fe(e,t,n){var r,i,o,s,c=C({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o==`key`?r=t[o]:o==`ref`?i=t[o]:c[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?a.call(arguments,2):n),E(e.type,c,r||e.key,i||e.ref,null)}a=b.slice,o={__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}},s=0,O.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state);typeof e==`function`&&(e=e(C({},n),this.props)),e&&C(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),M(this))},O.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},O.prototype.render=D,c=[],u=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,f=Math.random().toString(8),p=`__d`+f,m=`__a`+f,h=/(PointerCapture)$|Capture$/i,g=0,_=ie(!1),v=ie(!0);function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}function pe(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}var me=[`context`,`children`],he=[`useFragment`];function ge(e,t,n,r){function i(){var t,n=Reflect.construct(HTMLElement,[],i);return n._vdomComponent=e,r&&r.shadow?(n._root=n.attachShadow({mode:r.mode||`open`,serializable:(t=r.serializable)!=null&&t}),r.adoptedStyleSheets&&(n._root.adoptedStyleSheets=r.adoptedStyleSheets)):n._root=n,n}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=function(){ve.call(this,r)},i.prototype.attributeChangedCallback=be,i.prototype.disconnectedCallback=xe,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,e.formAssociated&&(i.formAssociated=!0),n.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||={},this._props[e]=t);var n=typeof t;t!=null&&n!==`string`&&n!==`boolean`&&n!==`number`||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i),i}function _e(e){this.getChildContext=function(){return e.context};var t=e.children;return fe(t,pe(e,me))}function ve(e){var t=new CustomEvent(`_preact`,{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=T(_e,B({},this._props,{context:t.detail.context}),Ce(this,this._vdomComponent,e)),(this.hasAttribute(`hydrate`)?de:z)(this._vdom,this._root)}function ye(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():``})}function be(e,t,n){if(this._vdom){var r={};r[e]=n??=void 0,r[ye(e)]=n,this._vdom=fe(this._vdom,r),z(this._vdom,this._root)}}function xe(){z(this._vdom=null,this._root)}function Se(e,t){var n=this,r=e.useFragment,i=pe(e,he);return T(r?D:`slot`,B({},i,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener(`_preact`,n._listener))):n.ref.removeEventListener(`_preact`,n._listener)}}))}function Ce(e,t,n){if(e.nodeType===3)return e.data;if(e.nodeType!==1)return null;var r=[],i={},a=0,o=e.attributes,s=e.childNodes;for(a=o.length;a--;)o[a].name!==`slot`&&(i[o[a].name]=o[a].value,i[ye(o[a].name)]=o[a].value);for(a=s.length;a--;){var c=Ce(s[a],null,n),l=s[a].slot;l?i[l]=T(Se,{name:l},c):r[a]=c}var u=!(!n||!n.shadow),d=t?T(Se,{useFragment:!u},r):r;return!u&&t&&(e.innerHTML=``),T(t||e.nodeName.toLowerCase(),i,d)}function we(t,n,i=[],a={shadow:!0}){if(typeof window<`u`&&(e(r),!customElements.get(n))){let e=i.map(String),r=e.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).filter(t=>!e.includes(t));ge(t,n,[...e,...r],a)}}var V,H,U,Te,W=0,Ee=[],G=o,De=G.__b,Oe=G.__r,ke=G.diffed,Ae=G.__c,je=G.unmount,Me=G.__;function K(e,t){G.__h&&G.__h(H,e,W||t),W=0;var n=H.__H||(H.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function q(e){return W=1,Ne(Be,e)}function Ne(e,t,n){var r=K(V++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Be(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=H,!H.__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};H.__f=!0;var a=H.shouldComponentUpdate,o=H.componentWillUpdate;H.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)},H.shouldComponentUpdate=i}return r.__N||r.__}function J(e,t){var n=K(V++,3);!G.__s&&Q(n.__H,t)&&(n.__=e,n.u=t,H.__H.__h.push(n))}function Pe(e,t){var n=K(V++,4);!G.__s&&Q(n.__H,t)&&(n.__=e,n.u=t,H.__h.push(n))}function Fe(e){return W=5,Y(function(){return{current:e}},[])}function Y(e,t){var n=K(V++,7);return Q(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ie(e,t){return W=8,Y(function(){return e},t)}function Le(){for(var e;e=Ee.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(X),t.__h.some(Z),t.__h=[]}catch(n){t.__h=[],G.__e(n,e.__v)}}}G.__b=function(e){H=null,De&&De(e)},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Me&&Me(e,t)},G.__r=function(e){Oe&&Oe(e),V=0;var t=(H=e.__c).__H;t&&(U===H?(t.__h=[],H.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(X),t.__h.some(Z),t.__h=[],V=0)),U=H},G.diffed=function(e){ke&&ke(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ee.push(t)!==1&&Te===G.requestAnimationFrame||((Te=G.requestAnimationFrame)||ze)(Le)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),U=H=null},G.__c=function(e,t){t.some(function(e){try{e.__h.some(X),e.__h=e.__h.filter(function(e){return!e.__||Z(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],G.__e(n,e.__v)}}),Ae&&Ae(e,t)},G.unmount=function(e){je&&je(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{X(e)}catch(e){t=e}}),n.__H=void 0,t&&G.__e(t,n.__v))};var Re=typeof requestAnimationFrame==`function`;function ze(e){var t,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Re&&(t=requestAnimationFrame(n))}function X(e){var t=H,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),H=t}function Z(e){var t=H;e.__c=e.__(),H=t}function Q(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Be(e,t){return typeof t==`function`?t(e):t}function Ve(){let[e,t]=q(()=>window.FrakSetup?.config?.waitForBackendConfig===!1||i.isResolved),[r,a]=q(()=>i.getConfig().hidden??!1),[o,s]=q(()=>!!window.FrakSetup?.client);return J(()=>{let e=i.getConfig();e.isResolved&&(t(!0),a(e.hidden??!1)),window.FrakSetup?.client&&s(!0);let r=e=>{let n=e.detail;n.isResolved&&t(!0),a(n.hidden??!1)};window.addEventListener(`frak:config`,r);let o=()=>s(!0);return n(`add`,o),()=>{window.removeEventListener(`frak:config`,r),n(`remove`,o)}},[]),{shouldRender:e,isHidden:r,isClientReady:o}}function He(e,t){for(var n in t)e[n]=t[n];return e}function Ue(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 We(e,t){var n=t(),r=q({t:{__:n,u:t}}),i=r[0].t,a=r[1];return Pe(function(){i.__=n,i.u=t,Ge(i)&&a({t:i})},[e,n,t]),J(function(){return Ge(i)&&a({t:i}),e(function(){Ge(i)&&a({t:i})})},[e]),n}function Ge(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 Ke(e,t){this.props=e,this.context=t}(Ke.prototype=new O).isPureReactComponent=!0,Ke.prototype.shouldComponentUpdate=function(e,t){return Ue(this.props,e)||Ue(this.state,t)};var qe=o.__b;o.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),qe&&qe(e)},typeof Symbol<`u`&&Symbol.for;var Je=o.__e;o.__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)}Je(e,t,n,r)};var Ye=o.unmount;function Xe(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=He({},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 Xe(e,t,n)})),e}function Ze(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ze(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 Qe(){this.__u=0,this.o=null,this.__b=null}function $e(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function $(){this.i=null,this.l=null}o.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ye&&Ye(e)},(Qe.prototype=new O).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=$e(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]=Ze(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)},Qe.prototype.componentWillUnmount=function(){this.o=[]},Qe.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]=Xe(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&T(D,null,e.fallback);return i&&(i.__u&=-33),[T(D,null,t.__a?null:e.children),i]};var et=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]}};($.prototype=new O).__a=function(e){var t=this,n=$e(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),et(t,e,r)):i()};n?n(a):a()}},$.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */ new Map;var t=F(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},$.prototype.componentDidUpdate=$.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){et(e,n,t)})};var tt=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,nt=/^(?: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]/,rt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,it=/[A-Z0-9]/g,at=typeof document<`u`,ot=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};O.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(O.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var st=o.event;o.event=function(e){return st&&(e=st(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var ct={configurable:!0,get:function(){return this.class}},lt=o.vnode;o.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||at&&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`||ot(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:rt.test(a)&&(a=s):s=a=`oninput`:i&&nt.test(a)?a=a.replace(it,`-$&`).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=F(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=F(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",ct)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=tt,lt&<(e)};var ut=o.__r;o.__r=function(e){ut&&ut(e),e.__c};var dt=o.diffed;o.diffed=function(e){dt&&dt(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 ft(e){return typeof window>`u`?()=>{}:(window.addEventListener(`frak:config`,e),()=>window.removeEventListener(`frak:config`,e))}function pt(){return We(ft,()=>i.getConfig().lang??t()??`en`)}const mt=`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
package/cdn/loader.js
CHANGED
|
@@ -117,7 +117,7 @@ var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],en
|
|
|
117
117
|
.sharedBaseCss_buttonReset__7cswil0:focus-visible {
|
|
118
118
|
outline-color: currentColor;
|
|
119
119
|
}
|
|
120
|
-
`;function r(e,t){let n=document.getElementById(e);if(n){n.textContent!==t&&(n.textContent=t);return}let r=document.createElement(`style`);r.id=e,r.textContent=t,document.head.appendChild(r)}function i(e,t){let n=`frak-base-${e}`;if(document.getElementById(n)||!t)return;let r=document.createElement(`style`);r.id=n,r.textContent=t,document.head.appendChild(r)}function a(e,t,n){r(`frak-placement-${e}-${t}`,n)}const o={injectBase:i,injectPlacement:a};function s(e){document.readyState===`complete`||document.readyState===`interactive`?setTimeout(e,1):document.addEventListener(`DOMContentLoaded`,e)}const c=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,l=new TextEncoder;function u(e,t){if(!c.test(e))throw Error(`${t} must be a UUID string, got: ${e}`);return h(e.replace(/-/g,``))}function d(e,t,n){if(!Number.isInteger(n)||n<0)throw Error(`ts must be a non-negative integer: ${n}`);let r=BigInt(n);for(let n=7;n>=0;n--)e[t+n]=Number(r&255n),r>>=8n}function f(e){if(e.binding.length!==0&&e.binding.length!==32)throw Error(`binding must be empty or 32 bytes, got ${e.binding.length}`);let t=l.encode(e.op),n=new Uint8Array(t.length+32+32+8),r=0;return n.set(t,r),r+=t.length,n.set(u(e.merchantId,`merchantId`),r),r+=16,n.set(u(e.anonymousId,`anonymousId`),r),r+=16,n.set(e.binding,r),r+=32,d(n,r,e.ts),n}function p(e){if(e.length<16)throw Error(`deriveClientIdFromHash requires at least 16 bytes, got ${e.length}`);let t=e.slice(0,16);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=m(t);return[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20,32)].join(`-`)}function m(e){return Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function h(e){return Uint8Array.from(e.match(/../g)??[],e=>Number.parseInt(e,16))}function g(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function _(e){if(e.pk.length!==65)throw Error(`pk must be 65 bytes, got ${e.pk.length}`);if(e.sig.length!==64)throw Error(`sig must be 64 bytes, got ${e.sig.length}`);let t=/* @__PURE__ */ new Uint8Array(138);return t[0]=e.v,t.set(e.pk,1),d(t,66,e.ts),t.set(e.sig,74),g(t)}const v=e=>e/2**32|0,ee=e=>e>>>0;function te(e,t,n,r){let i=v(n),a=ee(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}function y(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}const b=e=>e?`"${e}" `:``;function x(e,t=``){if(typeof e!=`number`)throw TypeError(b(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(b(t)+`expected integer >= 0, got `+e);return e}function S(e,t,n=``){if(y(e)&&(t===void 0||e.length===t))return e;t!==void 0&&x(t,`length`);let r=y(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=b(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}function ne(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(x(e.outputLen),x(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}const re=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)},C=(e,t)=>{re(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`"${t}.__proto__" is not allowed`)};function w(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function T(e,t){S(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function ie(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function E(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function D(e,t){return e<<32-t|e>>>t}const O=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,ae=/* @__PURE__ */ Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function k(e){if(S(e),O)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=ae[e[n]];return t}function oe(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function se(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(O)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=oe(e.charCodeAt(i)),a=oe(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function ce(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];S(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function le(e,t,n=`opts`){return C(e,`defaults`),t!==void 0&&C(t,n),Object.assign(Object.create(null),e,t)}function ue(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=le({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}function de(e=32){x(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const fe=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function pe(e,t,n){return e&t^~e&n}function me(e,t,n){return e&t^e&n^t&n}var he=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=E(this.buffer)}update(e){w(this),S(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=E(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0
|
|
120
|
+
`;function r(e,t){let n=document.getElementById(e);if(n){n.textContent!==t&&(n.textContent=t);return}let r=document.createElement(`style`);r.id=e,r.textContent=t,document.head.appendChild(r)}function i(e,t){let n=`frak-base-${e}`;if(document.getElementById(n)||!t)return;let r=document.createElement(`style`);r.id=n,r.textContent=t,document.head.appendChild(r)}function a(e,t,n){r(`frak-placement-${e}-${t}`,n)}const o={injectBase:i,injectPlacement:a};function s(e){document.readyState===`complete`||document.readyState===`interactive`?setTimeout(e,1):document.addEventListener(`DOMContentLoaded`,e)}const c=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,l=new TextEncoder;function u(e,t){if(!c.test(e))throw Error(`${t} must be a UUID string, got: ${e}`);return h(e.replace(/-/g,``))}function d(e,t,n){if(!Number.isInteger(n)||n<0)throw Error(`ts must be a non-negative integer: ${n}`);let r=BigInt(n);for(let n=7;n>=0;n--)e[t+n]=Number(r&255n),r>>=8n}function f(e){if(e.binding.length!==0&&e.binding.length!==32)throw Error(`binding must be empty or 32 bytes, got ${e.binding.length}`);let t=l.encode(e.op),n=new Uint8Array(t.length+32+32+8),r=0;return n.set(t,r),r+=t.length,n.set(u(e.merchantId,`merchantId`),r),r+=16,n.set(u(e.anonymousId,`anonymousId`),r),r+=16,n.set(e.binding,r),r+=32,d(n,r,e.ts),n}function p(e){if(e.length<16)throw Error(`deriveClientIdFromHash requires at least 16 bytes, got ${e.length}`);let t=e.slice(0,16);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=m(t);return[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20,32)].join(`-`)}function m(e){return Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function h(e){return Uint8Array.from(e.match(/../g)??[],e=>Number.parseInt(e,16))}function g(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function _(e){if(e.pk.length!==65)throw Error(`pk must be 65 bytes, got ${e.pk.length}`);if(e.sig.length!==64)throw Error(`sig must be 64 bytes, got ${e.sig.length}`);let t=/* @__PURE__ */ new Uint8Array(138);return t[0]=e.v,t.set(e.pk,1),d(t,66,e.ts),t.set(e.sig,74),g(t)}const v=e=>e/2**32|0,ee=e=>e>>>0;function te(e,t,n,r){let i=v(n),a=ee(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}function y(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}const b=e=>e?`"${e}" `:``;function x(e,t=``){if(typeof e!=`number`)throw TypeError(b(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(b(t)+`expected integer >= 0, got `+e);return e}function S(e,t,n=``){if(y(e)&&(t===void 0||e.length===t))return e;t!==void 0&&x(t,`length`);let r=y(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=b(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}function ne(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(x(e.outputLen),x(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}const re=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`"${t}" `)+`expected object, got type=`+typeof e)},C=(e,t)=>{re(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`"${t}.__proto__" is not allowed`)};function w(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function T(e,t){S(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`"output" expected length >= `+n)}function ie(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function E(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function D(e,t){return e<<32-t|e>>>t}const O=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,ae=/* @__PURE__ */ Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function k(e){if(S(e),O)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=ae[e[n]];return t}function oe(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function se(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(O)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=oe(e.charCodeAt(i)),a=oe(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function ce(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];S(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function le(e,t,n=`opts`){return C(e,`defaults`),t!==void 0&&C(t,n),Object.assign(Object.create(null),e,t)}function ue(e,t={}){if(typeof e!=`function`)throw TypeError(`"hashCons" expected function, got type=`+typeof e);t=le({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}function de(e=32){x(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const fe=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function pe(e,t,n){return e&t^~e&n}function me(e,t,n){return e&t^e&n^t&n}var he=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=E(this.buffer)}update(e){w(this),S(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=E(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0}else n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){w(this),T(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),te(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:E(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}};const ge=/* @__PURE__ */ Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_e=/* @__PURE__ */ Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),A=/* @__PURE__ */ new Uint32Array(64);var ve=class extends he{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,t){super(64,e,8,!1),this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)A[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=A[e-15],n=A[e-2],r=D(t,7)^D(t,18)^t>>>3,i=D(n,17)^D(n,19)^n>>>10;A[e]=i+A[e-7]+r+A[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=D(o,6)^D(o,11)^D(o,25),u=l+t+pe(o,s,c)+_e[e]+A[e]|0,d=(D(n,2)^D(n,13)^D(n,22))+me(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){ie(A)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ie(this.buffer)}},ye=class extends ve{constructor(){super(32,ge)}};const be=/* @__PURE__ */ ue(()=>new ye,/* @__PURE__ */ fe(1));
|
|
121
121
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
122
122
|
function xe(e,t,n=()=>{}){if(!Array.isArray(e))throw TypeError(`"${t}" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)n(e[r],`${t}[${r}]`);return e}const j=(e,t,n)=>S(e,t,n),Se=x;function Ce(e,t=``){if(typeof e!=`string`){let n=t&&`"${t}" `;throw TypeError(n+`expected string, got type=`+typeof e)}return e}function M(e,t=`object`){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(t===`object`?`expected valid options object`:`"${t}" expected object, got type=${typeof e}`);return e}function we(e,t){if(typeof e!=`function`)throw TypeError(`"${t}" is invalid: expected function, got ${typeof e}`);return e}const Te=k,N=(...e)=>ce(...e),Ee=e=>se(e),De=y,Oe=e=>de(e),ke=/* @__PURE__ */ BigInt(0),Ae=/* @__PURE__ */ BigInt(1),je=e=>e?`"${e}" `:``;function P(e,t=``){if(typeof e!=`boolean`)throw TypeError(je(t)+`expected boolean, got type=`+typeof e);return e}function Me(e){if(typeof e==`bigint`){if(!I(e))throw RangeError(`positive bigint expected, got `+e)}else Se(e);return e}function Ne(e,t=``){if(typeof e!=`number`){let n=t&&`"${t}" `;throw TypeError(n+`expected number, got type=`+typeof e)}if(!Number.isSafeInteger(e)){let n=t&&`"${t}" `;throw RangeError(n+`expected safe integer, got `+e)}}function Pe(e){let t=Me(e).toString(16);return t.length&1?`0`+t:t}function Fe(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);return e===``?ke:BigInt(`0x`+e)}function F(e){return Fe(k(e))}function Ie(e){return Fe(k(ze(S(e)).reverse()))}function Le(e,t){if(x(t),t===0)throw Error(`zero output length is invalid`);e=Me(e);let n=t*2,r=e.toString(16);if(r.length>n)throw RangeError(`number is too large`);return se(r.padStart(n,`0`))}function Re(e,t){return Le(e,t).reverse()}function ze(e){return Uint8Array.from(j(e))}function I(e){return typeof e==`bigint`&&ke<=e}function Be(e,t,n){return I(e)&&I(t)&&I(n)&&t<=e&&e<n}function Ve(e,t,n,r){if(!Be(t,n,r))throw RangeError(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function He(e){if(e<ke)throw Error(`expected non-negative bigint, got `+e);return e===ke?0:e.toString(2).length}const Ue=e=>(Ne(e,`n`),(Ae<<BigInt(e))-Ae);function We(e,t,n){if(x(e,`hashLen`),x(t,`qByteLen`),typeof n!=`function`)throw TypeError(`hmacFn must be a function`);let r=e=>new Uint8Array(e),i=Uint8Array.of(),a=Uint8Array.of(0),o=Uint8Array.of(1),s=r(e),c=r(e),l=0,u=()=>{s.fill(1),c.fill(0),l=0},d=(...e)=>n(c,N(s,...e)),f=(e=i)=>{c=d(a,e),s=d(),e.length!==0&&(c=d(o,e),s=d())},p=()=>{if(l++>=1e3)throw Error(`drbg: tried max amount of iterations`);let e=0,n=[];for(;e<t;){s=d();let t=s.slice();n.push(t),e+=s.length}return N(...n)};return(e,t)=>{u(),f(e);let n;for(;(n=t(p()))===void 0;)f();return u(),n}}function L(e,t={},n={},r=`object`){M(e,r),M(t,`fields`),M(n,`optFields`);function i(t,n,i){let a=r===`object`?`param "${String(t)}"`:`"${r}.${String(t)}"`,o=e[t];if(!Object.hasOwn(e,t)&&(i?o!==void 0:n!==`function`))throw TypeError(`${a} is invalid: expected own property`);if(i&&o===void 0)return;let s=typeof o;if(s!==n||o===null)throw TypeError(`${a} is invalid: expected ${n}, got ${s}`)}let a=(e,t)=>Object.entries(e).forEach(([e,n])=>i(e,n,t));a(t,!1),a(n,!0)}
|
|
123
123
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
@@ -131,16 +131,16 @@ super(e)}},_tlv:{encode:(e,t)=>{let{Err:n}=H;if(Ne(e,`tag`),e<0||e>255)throw new
|
|
|
131
131
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
132
132
|
const G=/* @__PURE__ */ an(/* @__PURE__ */ en({p:BigInt(`0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff`),n:BigInt(`0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551`),h:BigInt(1),a:BigInt(`0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc`),b:BigInt(`0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b`),Gx:BigInt(`0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296`),Gy:BigInt(`0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5`)}),be),on=`pkcs8`,sn=on,cn=`spki`
|
|
133
133
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
134
|
-
;function K(){let e=globalThis?.crypto?.subtle;if(typeof e==`object`&&e)return e;throw Error(`crypto.subtle must be defined`)}function ln(e,t){return async function(n){let r=await e();return{secretKey:r,publicKey:await t(r)}}}function un(e){let t=e.match(/[0-9a-f]{2}/gi);if(!t||t.length*2!==e.length)throw Error(`invalid hex`);return Uint8Array.from(t,e=>Number.parseInt(e,16))}function dn(e){let t={...e};for(let[e,n]of Object.entries(t))Array.isArray(n)&&(t[e]=n.slice());return t}function fn(e,t){if(t.type!==e)throw Error(`invalid key type, expected ${e}`)}function pn(e,t,n,r){let i=t?[`deriveBits`]:[`sign`],a=t?[]:[`verify`],o=(e,t)=>t===`jwk`?e:new Uint8Array(e),s={async import(t,n){let r=await K().importKey(n,t,e,!0,a);return fn(`public`,r),r},async export(e,t){fn(`public`,e);let n=await K().exportKey(t,e);return o(n,t)},async convert(e,t,n){return s.export(await s.import(e,t),n)}},c={async import(a,o){let s=K(),c;if(o===`raw`){let t=j(a,n,`secretKey`),o=un(r),l=new Uint8Array(o.length+t.length);l.set(o,0),l.set(t,o.length),c=await s.importKey(on,l,e,!0,i)}else t&&o===`jwk`&&(a={...a,key_ops:i}),c=await s.importKey(o,a,e,!0,i);return fn(`private`,c),c},async export(e,t){let r=K();if(fn(`private`,e),t===`raw`){let t=(await r.exportKey(`jwk`,e)).d.replace(/-/g,`+`).replace(/_/g,`/`),i=t.length%4?`=`.repeat(4-t.length%4):``,a=atob(t+i),o=Uint8Array.from(a,e=>e.charCodeAt(0)),s=new Uint8Array(n);return s.set(o,n-o.length),s}let i=await r.exportKey(t,e);return o(i,t)},async convert(e,t,n){return c.export(await c.import(e,t),n)}};async function l(e,t={}){L(t,{},{formatSec:`string`,formatPub:`string`},`opts`);let n=t.formatSec??sn,r=t.formatPub??cn,i=n===`jwk`?{...e}:await c.convert(e,n,`jwk`);return delete i.d,i.key_ops=a,r===`jwk`?i:s.convert(i,`jwk`,r)}async function u(t=sn){let n=await K().generateKey(e,!0,i);return c.export(n.privateKey,t)}let d;return{pub:s,priv:c,async isSupported(){if(d!==void 0)return d;try{let n=K(),r=await n.generateKey(e,!0,i);return await c.export(r.privateKey,`jwk`),t&&await n.deriveBits({name:typeof e==`string`?e:e.name,public:r.publicKey},r.privateKey,8),d=!0}catch{return d=!1}},getPublicKey:l,keygen:ln(u,l),utils:Object.freeze({randomSecretKey:u,convertPublicKey:s.convert,convertSecretKey:c.convert})}}function mn(e,t){return{async sign(n,r,i={}){L(i,{},{formatSec:`string`,formatPub:`string`},`opts`);let a=ze(j(n,void 0,`message`)),o=await e.priv.import(r,i.formatSec??sn),s=await K().sign(t,o,a);return new Uint8Array(s)},async verify(n,r,i,a={}){L(a,{},{formatSec:`string`,formatPub:`string`},`opts`);let o=ze(j(n,void 0,`signature`)),s=ze(j(r,void 0,`message`)),c=await e.pub.import(i,a.formatPub??cn);return await K().verify(t,c,o,s)}}}function hn(e,t,n){return{async getSharedSecret(r,i,a={}){L(a,{},{formatSec:`string`,formatPub:`string`},`opts`);let o=a.formatSec===void 0?sn:a.formatSec,s=a.formatPub===void 0?cn:a.formatPub,c=De(i)?ze(j(i,void 0,`publicKey`)):dn(i),l=await e.priv.import(r,o),u=await e.pub.import(c,s),d=await K().deriveBits({name:typeof t==`string`?t:t.name,public:u},l,8*n);return new Uint8Array(d)}}}function gn(e,t,n,r){let i={name:`ECDH`,namedCurve:e},a=pn({name:`ECDSA`,namedCurve:e},!1,n,r),o=pn(i,!0,n,r);return Object.freeze({name:e,isSupported:a.isSupported,getPublicKey:a.getPublicKey,keygen:ln(a.utils.randomSecretKey,a.getPublicKey),...mn(a,{name:`ECDSA`,hash:{name:t}}),...hn(o,i,n),utils:Object.freeze({...a.utils,async convertSecretKey(e,t,n){let r=t===`jwk`?e:void 0;return Array.isArray(r?.key_ops)&&r.key_ops.length===1&&r.key_ops[0]===`deriveBits`?o.utils.convertSecretKey(e,t,n):a.utils.convertSecretKey(e,t,n)}})})}const _n=/* @__PURE__ */ gn(`P-256`,`SHA-256`,32,`3041020100301306072a8648ce3d020106082a8648ce3d030107042730250201010420`),vn={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 yn=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}}},bn=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 xn(e){let{emittingTransport:t,listeningTransport:n,targetOrigin:r,middleware:i=[],lifecycleHandlers:a}=e,o=/* @__PURE__ */ new Map;function s(e){return typeof e!=`object`||!e?!1:`clientLifecycle`in e||`iframeLifecycle`in e}function c(e){return typeof e!=`object`||!e?!1:`id`in e&&`topic`in e&&`data`in e}async function l(e){try{`clientLifecycle`in e&&a?.clientLifecycle?await a.clientLifecycle(e,{origin:r,source:null}):`iframeLifecycle`in e&&a?.iframeLifecycle&&await a.iframeLifecycle(e,{origin:r,source:null})}catch{}}async function u(e){let t={origin:r,source:null};for(let n of i)n.onRequest&&await n.onRequest(e,t);return e}async function d(e,t){let n={origin:r,source:null},a=t;for(let t of i)t.onResponse&&(a=await t.onResponse(e,a,n));return a}async function f(e){try{if(new URL(e.origin).origin.toLowerCase()!==new URL(r).origin.toLowerCase())return}catch{return}if(s(e.data)){await l(e.data);return}if(!c(e.data))return;let t;try{let n=e.data.data,r=n instanceof Uint8Array||ArrayBuffer.isView(n)?{result:n}:n;t=await d(e.data,r)}catch{return}let n=o.get(e.data.id);n&&n(t)}async function p(e){let n=await u(e);t.postMessage(n,r)}function m(e){t.postMessage(e,r)}function h(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}n.addEventListener(`message`,f);function g(e){let t=h(),n=new bn;return o.set(t,e=>{e.error?n.reject(new yn(e.error.code,e.error.message,e.error.data)):n.resolve(e.result),o.delete(t)}),p({id:t,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{o.delete(t),n.reject(e)}),n.promise}function _(e,t){let n=h();return o.set(n,e=>{e.error?o.delete(n):t(e.result)}),p({id:n,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{o.delete(n)}),()=>{o.delete(n)}}function v(){n.removeEventListener(`message`,f),o.clear()}return{request:g,listen:_,sendLifecycle:m,cleanup:v}}function Sn(e){return new TextEncoder().encode(JSON.stringify(e))}function Cn(e){try{return JSON.parse(new TextDecoder().decode(e))}catch{return null}}const wn=`__frakEnv`,Tn={prod:{wallet:`https://wallet.frak.id`,backend:`https://backend.frak.id`},dev:{wallet:`https://wallet-dev.frak.id`,backend:`https://backend.gcp-dev.frak.id`}};function En(){return typeof window<`u`}let Dn=Tn.prod;function On(e){return e.replace(/\/+$/,``)}function kn(e){return typeof e==`string`?Object.hasOwn(Tn,e)?Tn[e]:Tn.prod:!e?.wallet||!e?.backend?Tn.prod:{wallet:On(e.wallet),backend:On(e.backend)}}function An(e){if(!e)return jn();let t=kn(e),n=En()?window[wn]:void 0;return n&&(n.wallet!==t.wallet||(n.backend,t.backend)),Dn=t,En()&&(window[wn]=t),t}function jn(){return En()?window[wn]??Dn:Dn}function Mn(){return jn().wallet}function q(){return jn().backend}var Nn=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 Pn;function Fn(){return Pn||={promiseCache:new Nn(1024),responseCache:new Nn(1024),failureCache:new Nn(1024)},Pn}async function In(e,{cacheKey:t,cacheTime:n=3e4}){let{promiseCache:r,responseCache:i,failureCache:a}=Fn();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 Ln(){Pn&&(Pn.promiseCache.clear(),Pn.responseCache.clear(),Pn.failureCache.clear())}const Rn=`__frakSdkConfig`,zn=`frak-config-cache`,Bn=`frak-merchant-id`,Vn={key:zn},J=typeof window<`u`;function Hn(){return{isResolved:!1,merchantId:``}}let Un=null;function Wn(){if(!J)return null;try{let e=localStorage.getItem(Vn.key);if(!e)return null;let t=JSON.parse(e);return t.config?.isResolved?(Un=t,t):null}catch{return null}}function Gn(){return(Un??Wn())?.config}function Kn(){let e=Un??Wn();return e?Date.now()-e.timestamp<3e4:!1}function qn(e){if(J&&e.isResolved)try{let t={config:e,timestamp:Date.now()};localStorage.setItem(Vn.key,JSON.stringify(t)),Un=t}catch{}}function Jn(){if(J){Un=null;try{localStorage.removeItem(Vn.key)}catch{}}}function Yn(){J&&(window[Rn]||(window[Rn]=Gn()??Hn()))}function Xn(){return J?(Yn(),window[Rn]??Hn()):Hn()}function Zn(e){J&&window.dispatchEvent(new CustomEvent(`frak:config`,{detail:e}))}function Qn(e){return e??(J?window.location.hostname:``)}async function $n(e,t){try{let n=q(),r=t?`&lang=${encodeURIComponent(t)}`:``,i=await fetch(`${n}/user/merchant/resolve?domain=${encodeURIComponent(e)}${r}`);if(!i.ok)return;let a=await i.json();if(J)try{sessionStorage.setItem(Bn,a.merchantId)}catch{}return a}catch{return}}const Y={getConfig:Xn,get isResolved(){return Xn().isResolved},get isCacheFresh(){return Kn()},setCacheScope(e,t){let n=`${zn}:${e}:${t??``}`;n!==Vn.key&&(Vn.key=n,Un=null)},setConfig(e){if(J&&(window[Rn]=e),qn(e),Zn(e),J&&e.merchantId)try{sessionStorage.setItem(Bn,e.merchantId)}catch{}},reset(){let e=Gn()??Hn();J&&(window[Rn]=e),Zn(e)},clearCache(){if(Jn(),Ln(),J)try{sessionStorage.removeItem(Bn)}catch{}},resolve(e,t){let n=Qn(e);return n?In(async()=>{let e=await $n(n,t);if(!e)throw Error(`Config resolution returned empty`);return e},{cacheKey:`sdkConfig:${n}:${t??``}`,cacheTime:1/0}).catch(()=>void 0):Promise.resolve(void 0)},getMerchantId(){let e=Xn();if(e.isResolved&&e.merchantId)return e.merchantId;if(J)try{return sessionStorage.getItem(Bn)??void 0}catch{}},async resolveMerchantId(e){return Y.getMerchantId()||(await Y.resolve(e))?.merchantId}};function er(){if(typeof navigator<`u`)return navigator.locks}async function tr(e,t,n={}){let r=er();if(!r)return t();if(n.ifAvailable){let n=!1;try{return await r.request(e,{ifAvailable:!0},async e=>{if(e)return n=!0,t()})}catch(e){if(n)throw e;return t()}}let i=new AbortController,a=setTimeout(()=>i.abort(),5e3),o=!1;try{return await r.request(e,{signal:i.signal},()=>(o=!0,t()))}catch(e){if(o)throw e;return t()}finally{clearTimeout(a)}}async function nr(e){return p(be(e))}const rr=`frak-client-id`,ir=`frak-client-key`,ar=`frak-client-id-legacy`,or=/* @__PURE__ */ h(`308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b0201010420`),sr=/* @__PURE__ */ h(`a144034200`),cr={formatSec:`pkcs8`,formatPub:`raw`};function lr(e,t){let n=new Uint8Array(or.length+32+sr.length+65),r=0;for(let i of[or,e,sr,t])n.set(i,r),r+=i.length;return n}const ur=/* @__PURE__ */ (/* @__PURE__ */ new Uint8Array(32)).fill(1),dr=/* @__PURE__ */ new Uint8Array(32);let fr=null;async function pr(){try{if(!await _n.isSupported())return G;let e=lr(ur,G.getPublicKey(ur,!1));return await _n.sign(dr,e,cr),_n}catch{return G}}function mr(){return fr??=pr(),fr}function hr(e,t,n,r){if(e===_n){let e=lr(n,r);return _n.sign(t,e,cr)}return Promise.resolve(G.sign(t,n,{prehash:!0}))}const gr=()=>typeof window<`u`&&!!window.localStorage;let _r=null;function vr(e){let t=m(e);if(_r?.keyHex===t)return _r.publicKey;let n=G.getPublicKey(e,!1);return _r={keyHex:t,publicKey:n},n}function yr(){if(gr())return localStorage.getItem(ar)??void 0}function br(){gr()&&localStorage.removeItem(ar)}function xr(){let e=localStorage.getItem(ir);if(!e)return null;if(!/^[0-9a-f]{64}$/i.test(e))throw Error(`[Frak SDK] Corrupt client key`);return h(e)}function Sr(e){try{for(let[t,n]of e)localStorage.setItem(t,n)}catch{}}async function Cr(){if(!gr())throw Error(`[Frak SDK] No window/localStorage available to derive a client id`);if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`[Frak SDK] crypto.getRandomValues unavailable, cannot derive a client id`);return tr(`frak-identity-key`,wr)}async function wr(){let e=localStorage.getItem(rr),t,n,r;try{t=xr(),n=t??G.utils.randomSecretKey(),r=await nr(vr(n))}catch(e){throw localStorage.removeItem(ir),_r=null,e}if(t){e!==r&&Sr([[rr,r]]);let t=yr();return{clientId:r,...t&&{pendingLegacyId:t}}}return Sr([...e?[[ar,e]]:[],[ir,m(n)],[rr,r]]),{clientId:r,...e&&{pendingLegacyId:e}}}async function X(e){if(!gr())return null;try{let t=xr();if(!t)return null;let n=e.ts??Math.floor(Date.now()/1e3),r=f({op:e.op,merchantId:e.merchantId,anonymousId:e.anonymousId,binding:e.binding??/* @__PURE__ */ new Uint8Array,ts:n}),i=vr(t),a=await mr(),o;try{o=await hr(a,r,t,i)}catch(e){if(a===G)throw e;fr=Promise.resolve(G),o=await hr(G,r,t,i)}return _({v:1,pk:i,ts:n,sig:o})}catch{return null}}function Tr(){return{"x-frak-sdk-version":`1.5.2`}}const Er=/* @__PURE__ */ new Set([`PROOF_REQUIRED`,`PROOF_OR_TOKEN_REQUIRED`,`MISSING_ANONYMOUS_ID`]);async function Dr(e){if(e.status>=500||e.status===403)return!0;try{let t=await e.clone().json();return typeof t.code==`string`&&Er.has(t.code)}catch{return!1}}async function Or({legacyId:e,derivedId:t}){if(typeof window<`u`){if(!e||e===t){br();return}await tr(`frak-legacy-merge`,async()=>{yr()===e&&await kr({legacyId:e,derivedId:t})},{ifAvailable:!0})}}async function kr({legacyId:e,derivedId:t}){try{let n=await Y.resolveMerchantId();if(!n)return;let r=await X({op:`frak-merge-v1`,merchantId:n,anonymousId:t});if(!r)return;let i=q(),a=await fetch(`${i}/user/identity/merge/initiate`,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`,...Tr()},body:JSON.stringify({sourceAnonymousId:t,merchantId:n,proof:r})});if(!a.ok){await Dr(a)||br();return}let{mergeToken:o}=await a.json();if(!o)return;let s=await fetch(`${i}/user/identity/merge/execute`,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`,...Tr()},body:JSON.stringify({mergeToken:o,targetAnonymousId:e,merchantId:n})});if(s.ok){br();return}await Dr(s)||br()}catch{}}let Ar=null,jr=null;async function Mr(){return Ar||jr||(jr=Cr().then(({clientId:e,pendingLegacyId:t})=>(Ar=e,t&&Or({legacyId:t,derivedId:e}),e)),jr)}function Nr(){if(Ar)return Ar;Mr().catch(()=>{})}async function Z(){return Ar||Mr()}function Pr(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Fr(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 Ir(e){return Pr(Sn(e))}function Lr(e,t,n,r,i,a,o){let s=Ir(Rr({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,proof:o})),c=new URL(e);return c.pathname=`/sso`,c.searchParams.set(`p`,s),c.toString()}function Rr(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},pf:e.proof}}function zr(e){return{...e,directExit:e.directExit??!e.redirectUrl}}async function Br(e,t){let{metadata:n,customizations:r}=e.config,i=Nr()??await Z().catch(()=>void 0),a=await Y.resolveMerchantId()??``,o=i&&a?await X({op:`frak-sso-v1`,merchantId:a,anonymousId:i}):null;return{ssoUrl:Lr(Mn(),zr(t),a,n.name,i,r?.css,o??void 0)}}const Vr=`menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800`,Hr=`frak-sso`;async function Ur(e,t){let{metadata:n,customizations:r}=e.config;if(`ssoUrl`in t)return Wr(t.ssoUrl),await e.request({method:`frak_openSso`,params:[{},n.name,r?.css]})??{};let i=zr(t);return i.openInSameWindow??!!i.redirectUrl?await e.request({method:`frak_openSso`,params:[i,n.name,r?.css]}):(Wr(i.ssoPopupUrl??(await Br(e,i)).ssoUrl),await e.request({method:`frak_openSso`,params:[i,n.name,r?.css]})??{})}function Wr(e){let t=window.open(e,Hr,Vr);if(!t)throw Error(`Popup was blocked. Please allow popups for this site.`);t.focus()}function Q(e,t,n){if(e)try{e.openPanel?.track(t,n)}catch{}}function Gr(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 $(e,t){let n=t.toLowerCase(),r=[...e.keys()].filter(e=>e.toLowerCase()===n);for(let t of r)e.delete(t)}const Kr=/^0x[a-fA-F0-9]{40}$/;function qr(e){return typeof e==`string`&&Kr.test(e)}function Jr(e,t){return e.toLowerCase()===t.toLowerCase()}function Yr(e){let t=/* @__PURE__ */ 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 Xr=/*#__PURE__*/ Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Zr(e){let t=`0x`;for(let n=0;n<20;n++)t+=Xr[e[n]];return t}function Qr(e){return`r`in e&&!(`v`in e)}function $r(e){return`v`in e&&e.v===2}const ei=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ti(e){return typeof e==`string`&&ei.test(e)}function ni(e){let t=e.replace(/-/g,``),n=/* @__PURE__ */ 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 ri(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 ii(e){if(!ti(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`&&qr(e.w);if(!t&&!n||t&&!ti(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(ni(e.m),a),a+=16,i.setUint32(a,e.t,!1),a+=4,t&&(r.set(ni(e.c),a),a+=16),n&&(r.set(Yr(e.w),a),a+=20),r}function ai(e){if(e.length<21)return null;let t=e[0];if((t&15)!=2||t&192)return null;let n=!!(t&16),r=!!(t&32);if(!n&&!r)return null;let i=21+(n?16:0)+(r?20:0);if(e.length!==i)return null;let a=1,o=ri(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=ri(e.subarray(a,a+16)),a+=16),r){let t=Zr(e.subarray(a,a+20));if(!qr(t))return null;c.w=t,a+=20}return c}const oi=`fCtx`;function si(e){try{return new URL(e)}catch{return null}}function ci(e){if(e)try{if($r(e)){let t=ii(e);return t?Pr(t):void 0}return Pr(Yr(e.r))}catch{}}function li(e){if(e&&e.length!==0)try{let t=Fr(e);if(t.length!==20)return ai(t)||void 0;let n=Zr(t);if(qr(n))return{r:n}}catch{}}function ui({url:e}){if(!e)return null;let t=si(e);if(!t)return null;let n=Gr(t.searchParams,oi);return n?li(n):null}function di(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 fi(e,t){let n=di(t??{});for(let[t,r]of Object.entries(n))r!==void 0&&r!==``&&(e.searchParams.has(t)||e.searchParams.set(t,r))}function pi({url:e,context:t,attribution:n}){if(!e)return null;let r=ci(t);if(!r)return null;let i=si(e);return i?($(i.searchParams,oi),i.searchParams.set(oi,r),fi(i,n),i.toString()):null}function mi(e){let t=si(e);return t?($(t.searchParams,oi),t.toString()):e}function hi({url:e,context:t}){if(typeof window>`u`||!window.location?.href)return;let n=e??window.location.href,r;r=t===null?mi(n):pi({url:n,context:t}),r&&window.history.replaceState(null,``,r.toString())}const gi={compress:ci,decompress:li,parse:ui,update:pi,remove:mi,replaceUrl:hi},_i={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function vi(e){return e&&e in _i?e:`eur`}function yi(e){return e?_i[e]??_i.eur:_i.eur}function bi(e,t){let n=yi(t),r=vi(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function xi(e){return e.formatToParts(1.1).find(e=>e.type===`decimal`)?.value??`.`}function Si(e,t){let n=yi(t),r=vi(t),i=new Intl.NumberFormat(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2}),a=i.formatToParts(e),o=``,s=``,c=``,l=`suffix`,u=!1;for(let e of a)switch(e.type){case`integer`:case`group`:o+=e.value,u=!0;break;case`decimal`:case`fraction`:s+=e.value;break;case`currency`:c=e.value,l=u?`suffix`:`prefix`}return{integer:o,decimals:s||`${xi(i)}00`,unit:c,unitPosition:l}}function Ci(e){return{integer:String(e),unit:`%`,unitPosition:`suffix`}}function wi(e){return e?`${e}Amount`:`eurAmount`}var Ti=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{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 null}}async fetch(e,t,n={}){let r=`${this.baseUrl}${e}`;return this.post(r,t,n,0)}},Ei=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 Ti({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:(/* @__PURE__ */ 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=[.../* @__PURE__ */ 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=[.../* @__PURE__ */ 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=[.../* @__PURE__ */ 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}},Di=typeof document<`u`?document.currentScript:null;function Oi(e){return e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``))}var ki=class extends Ei{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=Di,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=()=>{e(null)},document.head.appendChild(n)})}return await import(`./replay-V6FXES7X.efKsNT6s.js`)}catch{return 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[Oi(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{}}};function Ai(e){let t=e?.split(`-`)[0]?.toLowerCase();return t===`en`||t===`fr`?t:void 0}function ji(){return(typeof document<`u`?Ai(document.documentElement.lang):void 0)||(typeof navigator<`u`?Ai(navigator.language):void 0)}function Mi(e){let t=e.metadata.lang??ji(),n=e.domain??(typeof window<`u`?window.location.hostname:``);return Y.setCacheScope(n,t),Y.reset(),t}const Ni=`nexus-wallet-backup`,Pi=`frakwallet://`;function Fi(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}})}).catch(e=>{}),n.searchParams.delete(`sso`),window.history.replaceState({},``,n.toString()))}function Ii(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}const Li=/* @__PURE__ */ Pi.replace(`://`,``);function Ri(e){return`intent://${e.slice(13)}#Intent;scheme=${Li};end`}function zi(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=Ii()&&Bi(e)?Ri(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function Bi(e){return e.startsWith(Pi)}function Vi(){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 Hi=/* @__PURE__ */ Vi();function Ui(){return typeof navigator>`u`?!1:Hi?!0:/Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Wi(){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 Gi=/* @__PURE__ */ Wi();function Ki(e){Hi&&e.startsWith(`https://`)?window.location.href=`x-safari-https://${e.slice(8)}`:Hi&&e.startsWith(`http://`)?window.location.href=`x-safari-http://${e.slice(7)}`:window.location.href=`${q()}/common/social?u=${encodeURIComponent(e)}`}const qi={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`}};async function Ji({config:e}){let t=document.querySelector(`#frak-wallet`);t&&t.remove();let n=document.createElement(`iframe`);n.id=qi.id,n.name=qi.name,n.allow=qi.allow,n.style.zIndex=qi.style.zIndex.toString(),Xi({iframe:n,isVisible:!1});let r=An(e?.env).wallet,i=await Mr().catch(e=>{});return ea(r),ea(q()),n.src=Yi({walletUrl:r,clientId:i,preload:e?.preload}),new Promise(e=>{n.addEventListener(`load`,()=>e(n)),document.body.appendChild(n)})}function Yi({walletUrl:e=Mn(),clientId:t,preload:n}){let r=t?`${e}/listener?clientId=${encodeURIComponent(t)}`:`${e}/listener`;return!n||n.length===0?r:`${r}#preload=${n.join(`,`)}`}function Xi({iframe:e,isVisible:t}){if(!t){Qi(e),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.backgroundColor=`transparent`,e.style.border=`0`,e.style.margin=`0`,e.style.padding=`0`,e.style.pointerEvents=`auto`,Zi(e)}function Zi(e){if(typeof e.showPopover==`function`&&!e.hasAttribute(`popover`))try{e.setAttribute(`popover`,`manual`),e.showPopover()}catch{e.removeAttribute(`popover`)}}function Qi(e){if(typeof e.hidePopover==`function`){try{e.hidePopover()}catch{}e.removeAttribute(`popover`)}}function $i(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{return null}}function ea(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 ta=Hi&&Gi;function na(e){e?localStorage.setItem(Ni,e):localStorage.removeItem(Ni)}function ra(e,t){try{let n=new URL(e);if(!n.searchParams.has(`u`))return e;let r=oa(window.location.href,t);return n.searchParams.delete(`u`),n.searchParams.append(`u`,r),n.toString()}catch{return e}}function ia(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 aa(e){return e.includes(`/common/social`)}function oa(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 sa(e,t,n,r,i){if(i){let e=ra(t,r);window.open(e,`_blank`);return}if(Bi(t)){let i=ra(t,r);zi(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}})}else if(ta&&aa(t))ia(r);else{let e=ra(t,r);window.location.href=e}}function ca({iframe:e,targetOrigin:t}){let n=new bn;return{handleEvent:r=>{if(!(`iframeLifecycle`in r))return;let{iframeLifecycle:i,data:a}=r;switch(i){case`connected`:n.resolve(!0);break;case`do-backup`:na(a.backup);break;case`remove-backup`:localStorage.removeItem(Ni);break;case`show`:case`hide`:Xi({iframe:e,isVisible:i===`show`});break;case`redirect`:sa(e,a.baseRedirectUrl,t,a.mergeToken,a.openInNewTab)}},isConnected:n.promise}}async function la({config:e,iframe:t}){let n=An(e.env).wallet,r=Mi(e),i=Y.isCacheFresh?void 0:Y.resolve(e.domain,r),a=await Z().catch(()=>void 0),o=ca({iframe:t,targetOrigin:n}),s=new bn,c=Date.now();if(!t.contentWindow)throw new yn(vn.configError,`The iframe does not have a content window`);let l=xn({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await o.isConnected)throw new yn(vn.clientNotConnected,`The iframe provider isn't connected yet`);return await s.promise,t}}],lifecycleHandlers:{iframeLifecycle:(e,t)=>{o.handleEvent(e)}}}),u=ua(l,o),d,f=!1,p=async()=>{f=!0,u(),d?.(),l.cleanup(),t.remove(),Ln(),Y.clearCache(),Y.reset()},m;{m=new ki({apiUrl:`https://op-api.gcp.frak.id`,clientId:`f305d11d-b93b-487c-80d4-92deb7903e98`,trackScreenViews:!1,trackOutgoingLinks:!1,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdk_version`in t.properties||(t.properties={...t.properties,sdk_version:`1.5.2`,...a&&{user_anonymous_client_id:a,__deviceId:a}}),!0)}),m.setGlobalProperties({sdk_version:`1.5.2`,...a&&{user_anonymous_client_id:a,__deviceId:a}}),m.init(),m.track(`sdk_initialized`,{sdk_version:`1.5.2`});let e=!1,t=setTimeout(()=>{e||(e=!0,m?.track(`sdk_iframe_handshake_failed`,{reason:`timeout`}))},3e4);o.isConnected.then(()=>{e||(e=!0,clearTimeout(t),m?.track(`sdk_iframe_connected`,{handshake_duration_ms:Date.now()-c}))}).catch(()=>{e||(e=!0,clearTimeout(t),m?.track(`sdk_iframe_handshake_failed`,{reason:`unknown`}))})}let h=ha({config:e,rpcClient:l,lifecycleManager:o,configPromise:i,contextSent:s,openPanel:m,clientId:a}).then(e=>{if(f){e();return}d=e}).catch(e=>{throw s.reject(e),e});return{config:e,waitForConnection:o.isConnected,waitForSetup:h,request:l.request,listenerRequest:l.listen,destroy:p,openPanel:m}}function ua(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,250),r=setTimeout(o,3e4),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}function da(e){return 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}function fa(e,t){if(!e)return;let n=e.global??{};e.setGlobalProperties({...n,merchant_id:t.merchantId,domain:t.domain??``})}async function pa(e){let t=new TextEncoder().encode(e);if(typeof crypto<`u`&&crypto.subtle)try{let e=await crypto.subtle.digest(`SHA-256`,t);return new Uint8Array(e)}catch{}try{return be(t)}catch{return}}async function ma({merchantId:e,anonymousId:t,pendingMergeToken:n}){let r=n?await pa(n):void 0,[i,a,o]=await Promise.all([r?X({op:`frak-merge-v1`,merchantId:e,anonymousId:t,binding:r}):Promise.resolve(null),X({op:`frak-merge-v1`,merchantId:e,anonymousId:t}),X({op:`frak-install-v1`,merchantId:e,anonymousId:t})]);if(i||a||o)return{anonymousId:t,proofs:{...i&&{merge:i},...a&&{mergeSource:a},...o&&{install:o}}}}async function ha({config:e,rpcClient:t,lifecycleManager:n,configPromise:r,contextSent:i,openPanel:a,clientId:o}){await n.isConnected,Fi(t,n.isConnected);let s=new URL(window.location.href),c=s.searchParams.get(`fmt`)??void 0;c&&(s.searchParams.delete(`fmt`),window.history.replaceState({},``,s.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;Y.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=Promise.resolve(),f=e=>{let n=u?void 0:c;u=!0;let r=da(e),i=o,s=window.location.href;return fa(a,e),d=d.then(async()=>{t.sendLifecycle({clientLifecycle:`resolved-config`,data:{merchantId:e.merchantId,domain:e.domain??``,allowedDomains:e.allowedDomains??[],sourceUrl:s,...i&&{sdkAnonymousId:i},...n&&{pendingMergeToken:n},...r&&{sdkConfig:r},...i&&{sdkIdentity:await ma({merchantId:e.merchantId,anonymousId:i,pendingMergeToken:n})}}})}).catch(e=>{}),d};Y.isResolved&&f(Y.getConfig()).then(i.resolve),r&&(l(await r),f(Y.getConfig()).then(i.resolve));async function p(){let n=e.customizations?.css;n&&t.sendLifecycle({clientLifecycle:`modal-css`,data:{cssLink:n}})}async function m(){let n=e.customizations?.i18n;n&&t.sendLifecycle({clientLifecycle:`modal-i18n`,data:{i18n:n}})}async function h(){if(typeof window>`u`)return;let e=window.localStorage.getItem(Ni);e&&t.sendLifecycle({clientLifecycle:`restore-backup`,data:{backup:e}})}return(await Promise.allSettled([p(),m(),h()])).some(e=>e.status===`rejected`)&&a?.track(`sdk_iframe_handshake_failed`,{reason:`asset_push`}),ga(f)}function ga(e){if(typeof document>`u`)return()=>{};let t=0,n=n=>{if(document.visibilityState!==`visible`||!Y.isResolved)return;let r=Date.now();n&&r-t<6e4||(t=r,e(Y.getConfig()))},r=()=>n(!0),i=setInterval(()=>n(!1),3e5);return document.addEventListener(`visibilitychange`,r),()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,r)}}function _a(e){return Cn(Fr(e))}function va(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function ya(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 ba(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`string`&&e.trim()!==``){let t=Number.parseFloat(e);return Number.isFinite(t)?t:void 0}}function xa(e){if(typeof e!=`string`)return;let t=e.trim();return t===``?void 0:t}function Sa(e){if(!e||typeof e!=`object`)return;let t=e,n={},r=xa(t.productId);r!==void 0&&(n.productId=r);let i=xa(t.sku);i!==void 0&&(n.sku=i);let a=xa(t.name);a!==void 0&&(n.name=a);let o=ba(t.quantity);o!==void 0&&(n.quantity=o);let s=ba(t.unitPrice);s!==void 0&&(n.unitPrice=s);let c=ba(t.totalPrice);return c!==void 0&&(n.totalPrice=c),Object.keys(n).length>0?n:void 0}function Ca(e){let t=ya(e);if(!t)return;let n=[];for(let e of t){let t=Sa(e);t&&n.push(t)}return n.length>0?n:void 0}function wa(e){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.title==`string`?t.title.trim():``,r=Sa(e);if(n===``&&!r)return null;let i={...r};return n!==``&&(i.title=n),typeof t.imageUrl==`string`&&va(t.imageUrl)&&(i.imageUrl=t.imageUrl),typeof t.link==`string`&&va(t.link)&&(i.link=t.link),typeof t.utmContent==`string`&&t.utmContent!==``&&(i.utmContent=t.utmContent),i}function Ta(e){let t=ya(e);if(!t)return;let n=[];for(let e of t){let t=wa(e);t&&n.push(t)}return n.length>0?n:void 0}function Ea(e){if(!e)return;let t;try{t=_a(e)}catch{return}if(t!==null)return Ta(t)}async function Da({config:e}){let t=Oa(e);Mi(t);let n=await Ji({config:t});if(!n)return;let r=await la({config:t,iframe:n});if(await r.waitForSetup,await r.waitForConnection)return r}function Oa(e){let t=vi(e.metadata.currency);return{...e,metadata:{...e.metadata,currency:t}}}function ka({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}var Aa=/* @__PURE__ */ t({DEEP_LINK_SCHEME:()=>Pi,FrakContextManager:()=>gi,areAddressesEqual:()=>Jr,base64urlDecode:()=>Fr,base64urlEncode:()=>Pr,baseIframeProps:()=>qi,buildListenerUrl:()=>Yi,clearAllCache:()=>Ln,coerceProductCandidates:()=>ya,compressJsonToB64:()=>Ir,createIFrameFrakClient:()=>la,decodeProductsParam:()=>Ea,decompressJsonFromB64:()=>_a,deleteQueryParamCaseInsensitive:()=>$,detectPageLanguage:()=>ji,findIframeInOpener:()=>$i,formatAmount:()=>bi,formatAmountParts:()=>Si,generateSsoUrl:()=>Lr,getBackendUrl:()=>q,getClientId:()=>Nr,getClientIdAsync:()=>Z,getCurrencyAmountKey:()=>wi,getEnvironment:()=>jn,getQueryParamCaseInsensitive:()=>Gr,getSupportedCurrency:()=>vi,isIOS:()=>Hi,isInAppBrowser:()=>Gi,isMobile:()=>Ui,mergeAttribution:()=>ka,normalizeProductDetails:()=>Sa,normalizeSharingProduct:()=>wa,redirectToExternalBrowser:()=>Ki,sanitizeProductDetailsList:()=>Ca,sanitizeSharingProducts:()=>Ta,sdkConfigStore:()=>Y,setEnvironment:()=>An,setupClient:()=>Da,ssoPopupFeatures:()=>Vr,ssoPopupName:()=>Hr,trackEvent:()=>Q,triggerDeepLinkWithFallback:()=>zi,withCache:()=>In});const ja=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ma(e){if(ja.test(e))return g(u(e,`uuid`))}async function Na(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 Pa(e,t,n){return await e.request({method:`frak_displaySharingPage`,params:n?[t,e.config.metadata,n]:[t,e.config.metadata]})}async function Fa(e){if(typeof window>`u`)return;let t=await Z().catch(()=>void 0);if(!t)return;let n=await Y.resolveMerchantId();if(!n)return;let r=`frak-identity-ensured-${n}-${t}`;if(!window.sessionStorage.getItem(r))try{let i=q(),a=await X({op:`frak-ensure-v1`,merchantId:n,anonymousId:t});(await fetch(`${i}/user/identity/ensure`,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`,"x-wallet-sdk-auth":e,"x-frak-client-id":t,...Tr()},body:JSON.stringify({merchantId:n,...a&&{proof:a}})})).ok&&window.sessionStorage.setItem(r,`1`)}catch{}}async function Ia({merchantId:e,checkoutToken:t}={}){let n=e??await Y.resolveMerchantId();if(!n)return;let r=Mn(),i=encodeURIComponent(Ma(n)??n),a=t?`&checkoutToken=${encodeURIComponent(t)}`:``,o=`${r}/i?m=${i}`,s=await Z().catch(()=>void 0);if(!s)return`${o}${a}`;let c=await X({op:`frak-install-v1`,merchantId:n,anonymousId:s});return c?`${o}${a}#p=${encodeURIComponent(c)}`:`${o}&a=${encodeURIComponent(Ma(s)??s)}${a}`}async function La(e,t){return In(()=>e.request({method:`frak_getMerchantInformation`}),{cacheKey:`frak_getMerchantInformation`,cacheTime:t?.cacheTime})}async function Ra(e,t){return In(async()=>{let t=await Z().catch(()=>void 0),n=await Y.resolveMerchantId(),r=t&&n?await X({op:`frak-merge-v1`,merchantId:n,anonymousId:t}):null;return e.request({method:`frak_getMergeToken`,params:r?[r]:void 0})},{cacheKey:`frak_getMergeToken`,cacheTime:t?.cacheTime})}async function za(e,t){return In(()=>e.request({method:`frak_getUserReferralStatus`}),{cacheKey:`frak_getUserReferralStatus`,cacheTime:t?.cacheTime})}async function Ba(e,t){let{metadata:n,customizations:r}=e.config;return await e.request({method:`frak_prepareSso`,params:[t,n.name,r?.css]})}async function Va(e,t){try{let n=await Z().catch(()=>void 0);await e.request({method:`frak_sendInteraction`,params:[t,{clientId:n}]})}catch{}}function Ha(e,t,n){return $r(t)?(Q(e,`user_referred_started`,{referrer_client_id:t.c,referrer_wallet:t.w,wallet_status:n?.key}),Va(e,{type:`arrival`,referrerClientId:t.c,referrerMerchantId:t.m,referrerWallet:t.w,referralTimestamp:t.t}),!0):Qr(t)?(Q(e,`user_referred_started`,{referrer:t.r,wallet_status:n?.key}),Va(e,{type:`arrival`,referrerWallet:t.r}),!0):!1}function Ua(e,t,n){return!t&&!n?null:{v:2,m:e,t:Math.floor(Date.now()/1e3),...t?{c:t}:{},...n?{w:n}:{}}}function Wa(e,t,n){return $r(e)?e.w&&n?.wallet?Jr(e.w,n.wallet):e.c?t===e.c:!1:Qr(e)&&n?.wallet?Jr(e.r,n.wallet):!1}async function Ga(e,{walletStatus:t,frakContext:n,options:r}){if(!n)return`no-referrer`;let i=await Z().catch(()=>void 0);if(Wa(n,i,t))return`self-referral`;if(!Ha(e,n,t))return`no-referrer`;let a=$r(n)?n.m:r?.merchantId,o=r?.alwaysAppendUrl&&a?Ua(a,i,t?.wallet):null;return gi.replaceUrl({url:window.location.href,context:o}),Q(e,`user_referred_completed`,{status:`success`}),`success`}async function Ka(e,{options:t}={}){let n=gi.parse({url:window.location.href}),r=await Xa(e);try{return await Ga(e,{walletStatus:r,frakContext:n,options:t})}catch{}}const qa=`frak:referral-success`;async function Ja(e){try{await Ka(e)===`success`&&window.dispatchEvent(new Event(qa))}catch{}}async function Ya(e){if(typeof window>`u`)return;let t=window.sessionStorage.getItem(`frak-wallet-interaction-token`),n=await Z().catch(()=>void 0);if(!t&&!n)return;let r=e.merchantId??await Y.resolveMerchantId();if(!r)return;let i={Accept:`application/json`,"Content-Type":`application/json`};t&&(i[`x-wallet-sdk-auth`]=t),n&&(i[`x-frak-client-id`]=n);let a=q();await fetch(`${a}/user/track/purchase`,{method:`POST`,headers:i,body:JSON.stringify({customerId:e.customerId,orderId:e.orderId,token:e.token,merchantId:r})})}function Xa(e,t){if(!t)return e.request({method:`frak_listenToWalletStatus`}).then(t=>(Za(e,t),t));let n=new bn,r=!1;return e.listenerRequest({method:`frak_listenToWalletStatus`},i=>{Za(e,i),t(i),r||=(n.resolve(i),!0)}),n.promise}function Za(e,t){typeof window<`u`&&(e.openPanel?.setGlobalProperties({wallet:t.wallet??null}),t.interactionToken?(window.sessionStorage.setItem(`frak-wallet-interaction-token`,t.interactionToken),Fa(t.interactionToken)):window.sessionStorage.removeItem(`frak-wallet-interaction-token`))}function Qa(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`}}}})}async function i(n,r){return n&&(t.metadata=n(t.metadata??{})),await Na(e,t,r)}return{params:t,sendTx:n,reward:r,display:i}}async function eo(e,{tx:t,metadata:n}){return(await Na(e,{metadata:n,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}function to(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 no(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 Na(e,{metadata:n,steps:{login:{},siweAuthenticate:{siwe:{...t,statement:i,nonce:t?.nonce??to(),uri:t?.uri??`https://${r}`,version:t?.version??`1`,domain:r}}}})).siweAuthenticate}var ro=/* @__PURE__ */ t({REFERRAL_SUCCESS_EVENT:()=>qa,displayModal:()=>Na,displaySharingPage:()=>Pa,ensureIdentity:()=>Fa,getInstallUrl:()=>Ia,getMerchantInformation:()=>La,getMergeToken:()=>Ra,getUserReferralStatus:()=>za,modalBuilder:()=>Qa,openSso:()=>Ur,prepareSso:()=>Ba,prepareSsoUrl:()=>Br,processReferral:()=>Ga,referralInteraction:()=>Ka,sendInteraction:()=>Va,sendTransaction:()=>eo,setupReferral:()=>Ja,siweAuthenticate:()=>no,trackPurchaseStatus:()=>Ya,watchWalletStatus:()=>Xa});async function io(e,t,n,r){window.FrakSetup?.client&&await Pa(window.FrakSetup.client,{...r?.link&&{link:r.link},...r?.products?.length&&{products:r.products},...r?.checkoutToken&&{checkoutToken:r.checkoutToken},metadata:{entryPoint:e,...t&&{targetInteraction:t}}},n).catch(e=>void 0)}const ao=[`frak-button-share`,`frak-button-wallet`,`frak-open-in-app`,`frak-post-purchase`,`frak-banner`].join(`,`);function oo(){return typeof document>`u`||document.querySelector(ao)===null?[]:[`sharing`]}const so=`frak:client`;function co(){let e=new CustomEvent(so);window.dispatchEvent(e)}function lo(e,t){if(window.FrakSetup?.client&&e===`add`){t();return}(e===`add`?window.addEventListener:window.removeEventListener)(so,t,!1)}function uo(){return window.FrakSetup.core={...Aa,...ro},window.FrakSetup?.client?Promise.resolve():In(()=>fo(),{cacheKey:`frak-sdk-init`,cacheTime:1/0}).catch(e=>{Q(window.FrakSetup?.client,`sdk_init_failed`,{reason:e instanceof Error?e.message:typeof e==`string`?e:`unknown`,config_missing:!window.FrakSetup?.config})})}async function fo(){if(!window.FrakSetup?.config)throw Error(`[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set.`);let e=await Da({config:po(window.FrakSetup.config)});if(!e)throw Error(`[Frak SDK] Failed to create client`);window.FrakSetup.client=e,co(),Ja(e),mo()}function po(e){return e.preload===void 0?{...e,preload:oo()}:e}function mo(){let e=new URL(window.location.href);if(Gr(e.searchParams,`frakAction`)?.toLowerCase()!==`share`)return;let t=Gr(e.searchParams,`link`)??void 0,n=Gr(e.searchParams,`placement`)??void 0,r=Ea(Gr(e.searchParams,`products`));$(e.searchParams,`frakAction`),$(e.searchParams,`link`),$(e.searchParams,`placement`),$(e.searchParams,`products`),window.history.replaceState({},``,e.toString()),Q(window.FrakSetup?.client,`sharing_page_auto_opened`,{placement:n,has_link:!!t,has_products:!!r?.length}),io(`auto_open`,void 0,n,{link:t,products:r})}o.injectBase(`shared`,n),o.injectBase(`fouce`,`frak-ambassador:not(:defined), 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; }`),s(uo);const ho={ambassador:()=>import(
|
|
134
|
+
;function K(){let e=globalThis?.crypto?.subtle;if(typeof e==`object`&&e)return e;throw Error(`crypto.subtle must be defined`)}function ln(e,t){return async function(n){let r=await e();return{secretKey:r,publicKey:await t(r)}}}function un(e){let t=e.match(/[0-9a-f]{2}/gi);if(!t||t.length*2!==e.length)throw Error(`invalid hex`);return Uint8Array.from(t,e=>Number.parseInt(e,16))}function dn(e){let t={...e};for(let[e,n]of Object.entries(t))Array.isArray(n)&&(t[e]=n.slice());return t}function fn(e,t){if(t.type!==e)throw Error(`invalid key type, expected ${e}`)}function pn(e,t,n,r){let i=t?[`deriveBits`]:[`sign`],a=t?[]:[`verify`],o=(e,t)=>t===`jwk`?e:new Uint8Array(e),s={async import(t,n){let r=await K().importKey(n,t,e,!0,a);return fn(`public`,r),r},async export(e,t){fn(`public`,e);let n=await K().exportKey(t,e);return o(n,t)},async convert(e,t,n){return s.export(await s.import(e,t),n)}},c={async import(a,o){let s=K(),c;if(o===`raw`){let t=j(a,n,`secretKey`),o=un(r),l=new Uint8Array(o.length+t.length);l.set(o,0),l.set(t,o.length),c=await s.importKey(on,l,e,!0,i)}else t&&o===`jwk`&&(a={...a,key_ops:i}),c=await s.importKey(o,a,e,!0,i);return fn(`private`,c),c},async export(e,t){let r=K();if(fn(`private`,e),t===`raw`){let t=(await r.exportKey(`jwk`,e)).d.replace(/-/g,`+`).replace(/_/g,`/`),i=t.length%4?`=`.repeat(4-t.length%4):``,a=atob(t+i),o=Uint8Array.from(a,e=>e.charCodeAt(0)),s=new Uint8Array(n);return s.set(o,n-o.length),s}let i=await r.exportKey(t,e);return o(i,t)},async convert(e,t,n){return c.export(await c.import(e,t),n)}};async function l(e,t={}){L(t,{},{formatSec:`string`,formatPub:`string`},`opts`);let n=t.formatSec??sn,r=t.formatPub??cn,i=n===`jwk`?{...e}:await c.convert(e,n,`jwk`);return delete i.d,i.key_ops=a,r===`jwk`?i:s.convert(i,`jwk`,r)}async function u(t=sn){let n=await K().generateKey(e,!0,i);return c.export(n.privateKey,t)}let d;return{pub:s,priv:c,async isSupported(){if(d!==void 0)return d;try{let n=K(),r=await n.generateKey(e,!0,i);return await c.export(r.privateKey,`jwk`),t&&await n.deriveBits({name:typeof e==`string`?e:e.name,public:r.publicKey},r.privateKey,8),d=!0}catch{return d=!1}},getPublicKey:l,keygen:ln(u,l),utils:Object.freeze({randomSecretKey:u,convertPublicKey:s.convert,convertSecretKey:c.convert})}}function mn(e,t){return{async sign(n,r,i={}){L(i,{},{formatSec:`string`,formatPub:`string`},`opts`);let a=ze(j(n,void 0,`message`)),o=await e.priv.import(r,i.formatSec??sn),s=await K().sign(t,o,a);return new Uint8Array(s)},async verify(n,r,i,a={}){L(a,{},{formatSec:`string`,formatPub:`string`},`opts`);let o=ze(j(n,void 0,`signature`)),s=ze(j(r,void 0,`message`)),c=await e.pub.import(i,a.formatPub??cn);return await K().verify(t,c,o,s)}}}function hn(e,t,n){return{async getSharedSecret(r,i,a={}){L(a,{},{formatSec:`string`,formatPub:`string`},`opts`);let o=a.formatSec===void 0?sn:a.formatSec,s=a.formatPub===void 0?cn:a.formatPub,c=De(i)?ze(j(i,void 0,`publicKey`)):dn(i),l=await e.priv.import(r,o),u=await e.pub.import(c,s),d=await K().deriveBits({name:typeof t==`string`?t:t.name,public:u},l,8*n);return new Uint8Array(d)}}}function gn(e,t,n,r){let i={name:`ECDH`,namedCurve:e},a=pn({name:`ECDSA`,namedCurve:e},!1,n,r),o=pn(i,!0,n,r);return Object.freeze({name:e,isSupported:a.isSupported,getPublicKey:a.getPublicKey,keygen:ln(a.utils.randomSecretKey,a.getPublicKey),...mn(a,{name:`ECDSA`,hash:{name:t}}),...hn(o,i,n),utils:Object.freeze({...a.utils,async convertSecretKey(e,t,n){let r=t===`jwk`?e:void 0;return Array.isArray(r?.key_ops)&&r.key_ops.length===1&&r.key_ops[0]===`deriveBits`?o.utils.convertSecretKey(e,t,n):a.utils.convertSecretKey(e,t,n)}})})}const _n=/* @__PURE__ */ gn(`P-256`,`SHA-256`,32,`3041020100301306072a8648ce3d020106082a8648ce3d030107042730250201010420`),vn={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 yn=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}}},bn=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 xn(e){let{emittingTransport:t,listeningTransport:n,targetOrigin:r,middleware:i=[],lifecycleHandlers:a}=e,o=/* @__PURE__ */ new Map;function s(e){return typeof e!=`object`||!e?!1:`clientLifecycle`in e||`iframeLifecycle`in e}function c(e){return typeof e!=`object`||!e?!1:`id`in e&&`topic`in e&&`data`in e}async function l(e){try{`clientLifecycle`in e&&a?.clientLifecycle?await a.clientLifecycle(e,{origin:r,source:null}):`iframeLifecycle`in e&&a?.iframeLifecycle&&await a.iframeLifecycle(e,{origin:r,source:null})}catch(e){console.error(`[RPC Client] Lifecycle handler error:`,e)}}async function u(e){let t={origin:r,source:null};for(let n of i)n.onRequest&&await n.onRequest(e,t);return e}async function d(e,t){let n={origin:r,source:null},a=t;for(let t of i)t.onResponse&&(a=await t.onResponse(e,a,n));return a}async function f(e){try{if(new URL(e.origin).origin.toLowerCase()!==new URL(r).origin.toLowerCase())return}catch(e){console.error(`[RPC Client] Invalid origin`,e);return}if(s(e.data)){await l(e.data);return}if(!c(e.data))return;let t;try{let n=e.data.data,r=n instanceof Uint8Array||ArrayBuffer.isView(n)?{result:n}:n;t=await d(e.data,r)}catch(e){console.error(`[RPC Client] Middleware error on response:`,e);return}let n=o.get(e.data.id);n&&n(t)}async function p(e){let n=await u(e);t.postMessage(n,r)}function m(e){t.postMessage(e,r)}function h(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}n.addEventListener(`message`,f);function g(e){let t=h(),n=new bn;return o.set(t,e=>{e.error?n.reject(new yn(e.error.code,e.error.message,e.error.data)):n.resolve(e.result),o.delete(t)}),p({id:t,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{o.delete(t),n.reject(e)}),n.promise}function _(e,t){let n=h();return o.set(n,e=>{e.error?(console.error(`[RPC Client] Listener error:`,e.error),o.delete(n)):t(e.result)}),p({id:n,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{console.error(`[RPC Client] Failed to send listener request:`,e),o.delete(n)}),()=>{o.delete(n)}}function v(){n.removeEventListener(`message`,f),o.clear()}return{request:g,listen:_,sendLifecycle:m,cleanup:v}}function Sn(e){return new TextEncoder().encode(JSON.stringify(e))}function Cn(e){try{return JSON.parse(new TextDecoder().decode(e))}catch{return null}}const wn=`__frakEnv`,Tn={prod:{wallet:`https://wallet.frak.id`,backend:`https://backend.frak.id`},dev:{wallet:`https://wallet-dev.frak.id`,backend:`https://backend.gcp-dev.frak.id`}};function En(){return typeof window<`u`}let Dn=Tn.prod;function On(e){return e.replace(/\/+$/,``)}function kn(e){return typeof e==`string`?Object.hasOwn(Tn,e)?Tn[e]:(console.error(`[Frak SDK] Unknown env "${e}", falling back to production. Expected "prod", "dev", or { wallet, backend }.`),Tn.prod):!e?.wallet||!e?.backend?(console.error("[Frak SDK] env must state both `wallet` and `backend` origins, falling back to production. Received:",e),Tn.prod):{wallet:On(e.wallet),backend:On(e.backend)}}function An(e){if(!e)return jn();let t=kn(e),n=En()?window[wn]:void 0;return n&&(n.wallet!==t.wallet||n.backend!==t.backend)&&console.warn(`[Frak SDK] env changed after being published; the last value wins for every SDK call on this page.`,{previous:n,next:t}),Dn=t,En()&&(window[wn]=t),t}function jn(){return En()?window[wn]??Dn:Dn}function Mn(){return jn().wallet}function q(){return jn().backend}var Nn=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 Pn;function Fn(){return Pn||={promiseCache:new Nn(1024),responseCache:new Nn(1024),failureCache:new Nn(1024)},Pn}async function In(e,{cacheKey:t,cacheTime:n=3e4}){let{promiseCache:r,responseCache:i,failureCache:a}=Fn();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 Ln(){Pn&&(Pn.promiseCache.clear(),Pn.responseCache.clear(),Pn.failureCache.clear())}const Rn=`__frakSdkConfig`,zn=`frak-config-cache`,Bn=`frak-merchant-id`,Vn={key:zn},J=typeof window<`u`;function Hn(){return{isResolved:!1,merchantId:``}}let Un=null;function Wn(){if(!J)return null;try{let e=localStorage.getItem(Vn.key);if(!e)return null;let t=JSON.parse(e);return t.config?.isResolved?(Un=t,t):null}catch{return null}}function Gn(){return(Un??Wn())?.config}function Kn(){let e=Un??Wn();return e?Date.now()-e.timestamp<3e4:!1}function qn(e){if(J&&e.isResolved)try{let t={config:e,timestamp:Date.now()};localStorage.setItem(Vn.key,JSON.stringify(t)),Un=t}catch{}}function Jn(){if(J){Un=null;try{localStorage.removeItem(Vn.key)}catch{}}}function Yn(){J&&(window[Rn]||(window[Rn]=Gn()??Hn()))}function Xn(){return J?(Yn(),window[Rn]??Hn()):Hn()}function Zn(e){J&&window.dispatchEvent(new CustomEvent(`frak:config`,{detail:e}))}function Qn(e){return e??(J?window.location.hostname:``)}async function $n(e,t){try{let n=q(),r=t?`&lang=${encodeURIComponent(t)}`:``,i=await fetch(`${n}/user/merchant/resolve?domain=${encodeURIComponent(e)}${r}`);if(!i.ok){console.warn(`[Frak SDK] Merchant lookup failed for domain ${e}: ${i.status}`);return}let a=await i.json();if(J)try{sessionStorage.setItem(Bn,a.merchantId)}catch{}return a}catch(e){console.warn(`[Frak SDK] Failed to fetch merchant config:`,e);return}}const Y={getConfig:Xn,get isResolved(){return Xn().isResolved},get isCacheFresh(){return Kn()},setCacheScope(e,t){let n=`${zn}:${e}:${t??``}`;n!==Vn.key&&(Vn.key=n,Un=null)},setConfig(e){if(J&&(window[Rn]=e),qn(e),Zn(e),J&&e.merchantId)try{sessionStorage.setItem(Bn,e.merchantId)}catch{}},reset(){let e=Gn()??Hn();J&&(window[Rn]=e),Zn(e)},clearCache(){if(Jn(),Ln(),J)try{sessionStorage.removeItem(Bn)}catch{}},resolve(e,t){let n=Qn(e);return n?In(async()=>{let e=await $n(n,t);if(!e)throw Error(`Config resolution returned empty`);return e},{cacheKey:`sdkConfig:${n}:${t??``}`,cacheTime:1/0}).catch(()=>void 0):Promise.resolve(void 0)},getMerchantId(){let e=Xn();if(e.isResolved&&e.merchantId)return e.merchantId;if(J)try{return sessionStorage.getItem(Bn)??void 0}catch{}},async resolveMerchantId(e){return Y.getMerchantId()||(await Y.resolve(e))?.merchantId}};function er(){if(typeof navigator<`u`)return navigator.locks}async function tr(e,t,n={}){let r=er();if(!r)return t();if(n.ifAvailable){let n=!1;try{return await r.request(e,{ifAvailable:!0},async e=>{if(e)return n=!0,t()})}catch(e){if(n)throw e;return t()}}let i=new AbortController,a=setTimeout(()=>i.abort(),5e3),o=!1;try{return await r.request(e,{signal:i.signal},()=>(o=!0,t()))}catch(e){if(o)throw e;return t()}finally{clearTimeout(a)}}async function nr(e){return p(be(e))}const rr=`frak-client-id`,ir=`frak-client-key`,ar=`frak-client-id-legacy`,or=/* @__PURE__ */ h(`308187020100301306072a8648ce3d020106082a8648ce3d030107046d306b0201010420`),sr=/* @__PURE__ */ h(`a144034200`),cr={formatSec:`pkcs8`,formatPub:`raw`};function lr(e,t){let n=new Uint8Array(or.length+32+sr.length+65),r=0;for(let i of[or,e,sr,t])n.set(i,r),r+=i.length;return n}const ur=/* @__PURE__ */ (/* @__PURE__ */ new Uint8Array(32)).fill(1),dr=/* @__PURE__ */ new Uint8Array(32);let fr=null;async function pr(){try{if(!await _n.isSupported())return G;let e=lr(ur,G.getPublicKey(ur,!1));return await _n.sign(dr,e,cr),_n}catch{return G}}function mr(){return fr??=pr(),fr}function hr(e,t,n,r){if(e===_n){let e=lr(n,r);return _n.sign(t,e,cr)}return Promise.resolve(G.sign(t,n,{prehash:!0}))}const gr=()=>typeof window<`u`&&!!window.localStorage;let _r=null;function vr(e){let t=m(e);if(_r?.keyHex===t)return _r.publicKey;let n=G.getPublicKey(e,!1);return _r={keyHex:t,publicKey:n},n}function yr(){if(gr())return localStorage.getItem(ar)??void 0}function br(){gr()&&localStorage.removeItem(ar)}function xr(){let e=localStorage.getItem(ir);if(!e)return null;if(!/^[0-9a-f]{64}$/i.test(e))throw Error(`[Frak SDK] Corrupt client key`);return h(e)}function Sr(e){try{for(let[t,n]of e)localStorage.setItem(t,n)}catch{}}async function Cr(){if(!gr())throw Error(`[Frak SDK] No window/localStorage available to derive a client id`);if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`[Frak SDK] crypto.getRandomValues unavailable, cannot derive a client id`);return tr(`frak-identity-key`,wr)}async function wr(){let e=localStorage.getItem(rr),t,n,r;try{t=xr(),n=t??G.utils.randomSecretKey(),r=await nr(vr(n))}catch(e){throw localStorage.removeItem(ir),_r=null,e}if(t){e!==r&&Sr([[rr,r]]);let t=yr();return{clientId:r,...t&&{pendingLegacyId:t}}}return Sr([...e?[[ar,e]]:[],[ir,m(n)],[rr,r]]),{clientId:r,...e&&{pendingLegacyId:e}}}async function X(e){if(!gr())return null;try{let t=xr();if(!t)return null;let n=e.ts??Math.floor(Date.now()/1e3),r=f({op:e.op,merchantId:e.merchantId,anonymousId:e.anonymousId,binding:e.binding??/* @__PURE__ */ new Uint8Array,ts:n}),i=vr(t),a=await mr(),o;try{o=await hr(a,r,t,i)}catch(e){if(a===G)throw e;fr=Promise.resolve(G),o=await hr(G,r,t,i)}return _({v:1,pk:i,ts:n,sig:o})}catch{return null}}function Tr(){return{"x-frak-sdk-version":`1.5.3-beta.a79006c4`}}const Er=/* @__PURE__ */ new Set([`PROOF_REQUIRED`,`PROOF_OR_TOKEN_REQUIRED`,`MISSING_ANONYMOUS_ID`]);async function Dr(e){if(e.status>=500||e.status===403)return!0;try{let t=await e.clone().json();return typeof t.code==`string`&&Er.has(t.code)}catch{return!1}}async function Or({legacyId:e,derivedId:t}){typeof window<`u`&&(!e||e===t?br():await tr(`frak-legacy-merge`,async()=>{yr()===e&&await kr({legacyId:e,derivedId:t})},{ifAvailable:!0}))}async function kr({legacyId:e,derivedId:t}){try{let n=await Y.resolveMerchantId();if(!n)return;let r=await X({op:`frak-merge-v1`,merchantId:n,anonymousId:t});if(!r)return;let i=q(),a=await fetch(`${i}/user/identity/merge/initiate`,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`,...Tr()},body:JSON.stringify({sourceAnonymousId:t,merchantId:n,proof:r})});if(!a.ok){await Dr(a)||br();return}let{mergeToken:o}=await a.json();if(!o)return;let s=await fetch(`${i}/user/identity/merge/execute`,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`,...Tr()},body:JSON.stringify({mergeToken:o,targetAnonymousId:e,merchantId:n})});if(s.ok){br();return}await Dr(s)||br()}catch{}}let Ar=null,jr=null;async function Mr(){return Ar||jr||(jr=Cr().then(({clientId:e,pendingLegacyId:t})=>(Ar=e,t&&Or({legacyId:t,derivedId:e}),e)),jr)}function Nr(){if(Ar)return Ar;Mr().catch(()=>{})}async function Z(){return Ar||Mr()}function Pr(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Fr(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 Ir(e){return Pr(Sn(e))}function Lr(e,t,n,r,i,a,o){let s=Ir(Rr({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,proof:o})),c=new URL(e);return c.pathname=`/sso`,c.searchParams.set(`p`,s),c.toString()}function Rr(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},pf:e.proof}}function zr(e){return{...e,directExit:e.directExit??!e.redirectUrl}}async function Br(e,t){let{metadata:n,customizations:r}=e.config,i=Nr()??await Z().catch(()=>void 0),a=await Y.resolveMerchantId()??``,o=i&&a?await X({op:`frak-sso-v1`,merchantId:a,anonymousId:i}):null;return{ssoUrl:Lr(Mn(),zr(t),a,n.name,i,r?.css,o??void 0)}}const Vr=`menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800`,Hr=`frak-sso`;async function Ur(e,t){let{metadata:n,customizations:r}=e.config;if(`ssoUrl`in t)return Wr(t.ssoUrl),await e.request({method:`frak_openSso`,params:[{},n.name,r?.css]})??{};let i=zr(t);return i.openInSameWindow??!!i.redirectUrl?await e.request({method:`frak_openSso`,params:[i,n.name,r?.css]}):(Wr(i.ssoPopupUrl??(await Br(e,i)).ssoUrl),await e.request({method:`frak_openSso`,params:[i,n.name,r?.css]})??{})}function Wr(e){let t=window.open(e,Hr,Vr);if(!t)throw Error(`Popup was blocked. Please allow popups for this site.`);t.focus()}function Q(e,t,n){if(e)try{e.openPanel?.track(t,n)}catch(e){console.debug(`[Frak] Failed to track event:`,t,e)}}function Gr(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 $(e,t){let n=t.toLowerCase(),r=[...e.keys()].filter(e=>e.toLowerCase()===n);for(let t of r)e.delete(t)}const Kr=/^0x[a-fA-F0-9]{40}$/;function qr(e){return typeof e==`string`&&Kr.test(e)}function Jr(e,t){return e.toLowerCase()===t.toLowerCase()}function Yr(e){let t=/* @__PURE__ */ 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 Xr=/*#__PURE__*/ Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Zr(e){let t=`0x`;for(let n=0;n<20;n++)t+=Xr[e[n]];return t}function Qr(e){return`r`in e&&!(`v`in e)}function $r(e){return`v`in e&&e.v===2}const ei=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ti(e){return typeof e==`string`&&ei.test(e)}function ni(e){let t=e.replace(/-/g,``),n=/* @__PURE__ */ 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 ri(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 ii(e){if(!ti(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`&&qr(e.w);if(!t&&!n||t&&!ti(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(ni(e.m),a),a+=16,i.setUint32(a,e.t,!1),a+=4,t&&(r.set(ni(e.c),a),a+=16),n&&(r.set(Yr(e.w),a),a+=20),r}function ai(e){if(e.length<21)return null;let t=e[0];if((t&15)!=2||t&192)return null;let n=!!(t&16),r=!!(t&32);if(!n&&!r)return null;let i=21+(n?16:0)+(r?20:0);if(e.length!==i)return null;let a=1,o=ri(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=ri(e.subarray(a,a+16)),a+=16),r){let t=Zr(e.subarray(a,a+20));if(!qr(t))return null;c.w=t,a+=20}return c}const oi=`fCtx`;function si(e){try{return new URL(e)}catch{return null}}function ci(e){if(e)try{if($r(e)){let t=ii(e);return t?Pr(t):void 0}return Pr(Yr(e.r))}catch(t){console.error(`Error compressing Frak context`,{e:t,context:e})}}function li(e){if(e&&e.length!==0)try{let t=Fr(e);if(t.length!==20)return ai(t)||void 0;let n=Zr(t);if(qr(n))return{r:n}}catch(t){console.error(`Error decompressing Frak context`,{e:t,context:e})}}function ui({url:e}){if(!e)return null;let t=si(e);if(!t)return null;let n=Gr(t.searchParams,oi);return n?li(n):null}function di(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 fi(e,t){let n=di(t??{});for(let[t,r]of Object.entries(n))r!==void 0&&r!==``&&(e.searchParams.has(t)||e.searchParams.set(t,r))}function pi({url:e,context:t,attribution:n}){if(!e)return null;let r=ci(t);if(!r)return null;let i=si(e);return i?($(i.searchParams,oi),i.searchParams.set(oi,r),fi(i,n),i.toString()):null}function mi(e){let t=si(e);return t?($(t.searchParams,oi),t.toString()):e}function hi({url:e,context:t}){if(typeof window>`u`||!window.location?.href){console.error(`No window found, can't update context`);return}let n=e??window.location.href,r;r=t===null?mi(n):pi({url:n,context:t}),r&&window.history.replaceState(null,``,r.toString())}const gi={compress:ci,decompress:li,parse:ui,update:pi,remove:mi,replaceUrl:hi},_i={eur:`fr-FR`,usd:`en-US`,gbp:`en-GB`};function vi(e){return e&&e in _i?e:`eur`}function yi(e){return e?_i[e]??_i.eur:_i.eur}function bi(e,t){let n=yi(t),r=vi(t);return e.toLocaleString(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function xi(e){return e.formatToParts(1.1).find(e=>e.type===`decimal`)?.value??`.`}function Si(e,t){let n=yi(t),r=vi(t),i=new Intl.NumberFormat(n,{style:`currency`,currency:r,minimumFractionDigits:0,maximumFractionDigits:2}),a=i.formatToParts(e),o=``,s=``,c=``,l=`suffix`,u=!1;for(let e of a)switch(e.type){case`integer`:case`group`:o+=e.value,u=!0;break;case`decimal`:case`fraction`:s+=e.value;break;case`currency`:c=e.value,l=u?`suffix`:`prefix`}return{integer:o,decimals:s||`${xi(i)}00`,unit:c,unitPosition:l}}function Ci(e){return{integer:String(e),unit:`%`,unitPosition:`suffix`}}function wi(e){return e?`${e}Amount`:`eurAmount`}var Ti=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)}},Ei=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 Ti({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:(/* @__PURE__ */ 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=[.../* @__PURE__ */ 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=[.../* @__PURE__ */ 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=[.../* @__PURE__ */ 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)}},Di=typeof document<`u`?document.currentScript:null;function Oi(e){return e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``))}var ki=class extends Ei{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=Di,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[Oi(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{}}};function Ai(e){let t=e?.split(`-`)[0]?.toLowerCase();return t===`en`||t===`fr`?t:void 0}function ji(){return(typeof document<`u`?Ai(document.documentElement.lang):void 0)||(typeof navigator<`u`?Ai(navigator.language):void 0)}function Mi(e){let t=e.metadata.lang??ji(),n=e.domain??(typeof window<`u`?window.location.hostname:``);return Y.setCacheScope(n,t),Y.reset(),t}const Ni=`nexus-wallet-backup`,Pi=`frakwallet://`,Fi=/* @__PURE__ */ new WeakMap,Ii=/* @__PURE__ */ new WeakMap;function Li(e,t){let n=new URL(t).origin,r={createdAt:Date.now(),listenerSeen:!1};Fi.set(e,r),e.addEventListener(`load`,()=>{r.loadedAt??=Date.now()},{once:!0});let i=t=>{if(t.origin!==n||t.source!==e.contentWindow)return;r.listenerSeen=!0;let i=t.data;if(typeof i==`object`&&i){if(i.iframeLifecycle===`boot-error`){let e=i.data?.message;typeof e==`string`&&(r.bootError=e.slice(0,200))}else i.iframeLifecycle===`connected`&&Ri(e)}};window.addEventListener(`message`,i),Ii.set(e,()=>window.removeEventListener(`message`,i))}function Ri(e){Ii.get(e)?.(),Ii.delete(e)}function zi(e){return Fi.get(e)}const Bi=3e4;function Vi({track:e,isConnected:t,iframe:n,startedAt:r}){let i=!1,a=!1,o=document.visibilityState===`hidden`,s=()=>{document.visibilityState===`hidden`&&(o=!0)};document.addEventListener(`visibilitychange`,s);let c=()=>{clearTimeout(l),document.removeEventListener(`visibilitychange`,s)},l=setTimeout(()=>{a||(i=!0,c(),e(`sdk_iframe_handshake_failed`,{reason:`timeout`,...Hi(n,o)}),Ri(n))},Bi);t.then(()=>{a||(a=!0,c(),e(`sdk_iframe_connected`,{handshake_duration_ms:Date.now()-r,...i&&{after_timeout:!0}}))}).catch(()=>{a||i||(a=!0,c(),e(`sdk_iframe_handshake_failed`,{reason:`unknown`}))})}function Hi(e,t){let n=zi(e);return{visibility_state:document.visibilityState,was_hidden:t,online:navigator.onLine,...n&&{listener_seen:n.listenerSeen,...n.bootError&&{listener_error:n.bootError},...n.loadedAt!==void 0&&{iframe_load_ms:n.loadedAt-n.createdAt}}}}function Ui(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}})}).catch(e=>{console.error(`[SSO URL Listener] Failed to forward SSO data:`,e)}),n.searchParams.delete(`sso`),window.history.replaceState({},``,n.toString()))}function Wi(){let e=navigator.userAgent;return/Android/i.test(e)&&/Chrome\/\d+/i.test(e)}const Gi=/* @__PURE__ */ Pi.replace(`://`,``);function Ki(e){return`intent://${e.slice(13)}#Intent;scheme=${Gi};end`}function qi(e,t){let n=t?.timeout??2500,r=!1,i=()=>{document.hidden&&(r=!0)};document.addEventListener(`visibilitychange`,i);let a=Wi()&&Ji(e)?Ki(e):e;window.location.href=a,setTimeout(()=>{document.removeEventListener(`visibilitychange`,i),r||t?.onFallback?.()},n)}function Ji(e){return e.startsWith(Pi)}function Yi(){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 Xi=/* @__PURE__ */ Yi();function Zi(){return typeof navigator>`u`?!1:Xi?!0:/Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Qi(){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 $i=/* @__PURE__ */ Qi();function ea(){return typeof navigator>`u`?!1:navigator.userAgent.toLowerCase().includes(`instagram`)}const ta=/* @__PURE__ */ ea();function na(e){Xi&&ta&&/^https?:\/\//.test(e)?window.location.href=`instagram://extbrowser/?url=${encodeURIComponent(e)}`:Xi&&e.startsWith(`https://`)?window.location.href=`x-safari-https://${e.slice(8)}`:Xi&&e.startsWith(`http://`)?window.location.href=`x-safari-http://${e.slice(7)}`:window.location.href=`${q()}/common/social?u=${encodeURIComponent(e)}`}const ra={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`}};async function ia({config:e}){let t=document.querySelector(`#frak-wallet`);t&&t.remove();let n=document.createElement(`iframe`);n.id=ra.id,n.name=ra.name,n.allow=ra.allow,n.style.zIndex=ra.style.zIndex.toString(),oa({iframe:n,isVisible:!1});let r=An(e?.env).wallet,i=await Mr().catch(e=>{console.warn(`[Frak SDK] Unable to derive a client id`,e)});return ua(r),ua(q()),Li(n,r),n.src=aa({walletUrl:r,clientId:i,preload:e?.preload}),new Promise(e=>{n.addEventListener(`load`,()=>e(n)),document.body.appendChild(n)})}function aa({walletUrl:e=Mn(),clientId:t,preload:n}){let r=t?`${e}/listener?clientId=${encodeURIComponent(t)}`:`${e}/listener`;return!n||n.length===0?r:`${r}#preload=${n.join(`,`)}`}function oa({iframe:e,isVisible:t}){t?(e.style.position=`fixed`,e.style.top=`0`,e.style.left=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.backgroundColor=`transparent`,e.style.border=`0`,e.style.margin=`0`,e.style.padding=`0`,e.style.pointerEvents=`auto`,sa(e)):(ca(e),e.style.width=`0`,e.style.height=`0`,e.style.border=`0`,e.style.position=`fixed`,e.style.top=`-1000px`,e.style.left=`-1000px`)}function sa(e){if(typeof e.showPopover==`function`&&!e.hasAttribute(`popover`))try{e.setAttribute(`popover`,`manual`),e.showPopover()}catch{e.removeAttribute(`popover`)}}function ca(e){if(typeof e.hidePopover==`function`){try{e.hidePopover()}catch{}e.removeAttribute(`popover`)}}function la(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 ua(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 da=Xi&&$i;function fa(e){e?localStorage.setItem(Ni,e):localStorage.removeItem(Ni)}function pa(e,t){try{let n=new URL(e);if(!n.searchParams.has(`u`))return e;let r=ha(window.location.href,t);return n.searchParams.delete(`u`),n.searchParams.append(`u`,r),n.toString()}catch{return e}}function ma(e){return e.includes(`/common/social`)}function ha(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 ga(e,t,n,r,i){if(i){let e=pa(t,r);window.open(e,`_blank`)}else if(Ji(t)){let i=pa(t,r);qi(i,{onFallback:()=>{e.contentWindow?.postMessage({clientLifecycle:`deep-link-failed`,data:{originalUrl:i}},n)}})}else if(da&&ma(t))na(ha(window.location.href,r));else{let e=pa(t,r);window.location.href=e}}function _a({iframe:e,targetOrigin:t}){let n=new bn;return{handleEvent:r=>{if(!(`iframeLifecycle`in r))return;let{iframeLifecycle:i,data:a}=r;switch(i){case`connected`:n.resolve(!0);break;case`do-backup`:fa(a.backup);break;case`remove-backup`:localStorage.removeItem(Ni);break;case`show`:case`hide`:oa({iframe:e,isVisible:i===`show`});break;case`redirect`:ga(e,a.baseRedirectUrl,t,a.mergeToken,a.openInNewTab)}},isConnected:n.promise}}async function va({config:e,iframe:t}){let n=An(e.env).wallet,r=Mi(e),i=Y.isCacheFresh?void 0:Y.resolve(e.domain,r),a=await Z().catch(()=>void 0),o=_a({iframe:t,targetOrigin:n}),s=new bn,c=Date.now();if(!t.contentWindow)throw new yn(vn.configError,`The iframe does not have a content window`);let l=xn({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await o.isConnected)throw new yn(vn.clientNotConnected,`The iframe provider isn't connected yet`);return await s.promise,t}}],lifecycleHandlers:{iframeLifecycle:(e,t)=>{o.handleEvent(e)}}}),u=ya(l,o),d,f=!1,p=async()=>{f=!0,u(),d?.(),l.cleanup(),t.remove(),Ln(),Y.clearCache(),Y.reset()},m;{m=new ki({apiUrl:`https://op-api.gcp.frak.id`,clientId:`6eacc8d7-49ac-4936-95e9-81ef29449570`,trackScreenViews:!1,trackOutgoingLinks:!1,trackAttributes:!1,filter:({type:e,payload:t})=>(e!==`track`||!t?.properties||`sdk_version`in t.properties||(t.properties={...t.properties,sdk_version:`1.5.3-beta.a79006c4`,...a&&{user_anonymous_client_id:a,__deviceId:a}}),!0)}),m.setGlobalProperties({sdk_version:`1.5.3-beta.a79006c4`,...a&&{user_anonymous_client_id:a,__deviceId:a}}),m.init(),m.track(`sdk_initialized`,{sdk_version:`1.5.3-beta.a79006c4`});let e=m;Vi({track:(t,n)=>e.track(t,n),isConnected:o.isConnected,iframe:t,startedAt:c})}let h=wa({config:e,rpcClient:l,lifecycleManager:o,configPromise:i,contextSent:s,openPanel:m,clientId:a}).then(e=>{f?e():d=e}).catch(e=>{throw s.reject(e),e});return{config:e,waitForConnection:o.isConnected,waitForSetup:h,request:l.request,listenerRequest:l.listen,destroy:p,openPanel:m}}function ya(e,t){let n,r,i=()=>e.sendLifecycle({clientLifecycle:`heartbeat`});async function a(){i(),n=setInterval(i,250),r=setTimeout(o,Bi),await t.isConnected,o()}function o(){n&&clearInterval(n),r&&clearTimeout(r)}return a(),o}function ba(e){return 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}function xa(e,t){if(!e)return;let n=e.global??{};e.setGlobalProperties({...n,merchant_id:t.merchantId,domain:t.domain??``})}async function Sa(e){let t=new TextEncoder().encode(e);if(typeof crypto<`u`&&crypto.subtle)try{let e=await crypto.subtle.digest(`SHA-256`,t);return new Uint8Array(e)}catch{}try{return be(t)}catch{return}}async function Ca({merchantId:e,anonymousId:t,pendingMergeToken:n}){let r=n?await Sa(n):void 0,[i,a,o]=await Promise.all([r?X({op:`frak-merge-v1`,merchantId:e,anonymousId:t,binding:r}):Promise.resolve(null),X({op:`frak-merge-v1`,merchantId:e,anonymousId:t}),X({op:`frak-install-v1`,merchantId:e,anonymousId:t})]);if(i||a||o)return{anonymousId:t,proofs:{...i&&{merge:i},...a&&{mergeSource:a},...o&&{install:o}}}}async function wa({config:e,rpcClient:t,lifecycleManager:n,configPromise:r,contextSent:i,openPanel:a,clientId:o}){await n.isConnected,Ui(t,n.isConnected);let s=new URL(window.location.href),c=s.searchParams.get(`fmt`)??void 0;c&&(s.searchParams.delete(`fmt`),window.history.replaceState({},``,s.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;Y.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=Promise.resolve(),f=e=>{let n=u?void 0:c;u=!0;let r=ba(e),i=o,s=window.location.href;return xa(a,e),d=d.then(async()=>{t.sendLifecycle({clientLifecycle:`resolved-config`,data:{merchantId:e.merchantId,domain:e.domain??``,allowedDomains:e.allowedDomains??[],sourceUrl:s,...i&&{sdkAnonymousId:i},...n&&{pendingMergeToken:n},...r&&{sdkConfig:r},...i&&{sdkIdentity:await Ca({merchantId:e.merchantId,anonymousId:i,pendingMergeToken:n})}}})}).catch(e=>{console.error(`Failed to send lifecycle config`,e)}),d};Y.isResolved&&f(Y.getConfig()).then(i.resolve),r&&(l(await r),f(Y.getConfig()).then(i.resolve));async function p(){let n=e.customizations?.css;n&&t.sendLifecycle({clientLifecycle:`modal-css`,data:{cssLink:n}})}async function m(){let n=e.customizations?.i18n;n&&t.sendLifecycle({clientLifecycle:`modal-i18n`,data:{i18n:n}})}async function h(){if(typeof window>`u`)return;let e=window.localStorage.getItem(Ni);e&&t.sendLifecycle({clientLifecycle:`restore-backup`,data:{backup:e}})}return(await Promise.allSettled([p(),m(),h()])).some(e=>e.status===`rejected`)&&a?.track(`sdk_iframe_handshake_failed`,{reason:`asset_push`}),Ta(f)}function Ta(e){if(typeof document>`u`)return()=>{};let t=0,n=n=>{if(document.visibilityState!==`visible`||!Y.isResolved)return;let r=Date.now();n&&r-t<6e4||(t=r,e(Y.getConfig()))},r=()=>n(!0),i=setInterval(()=>n(!1),3e5);return document.addEventListener(`visibilitychange`,r),()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,r)}}function Ea(e){return Cn(Fr(e))}function Da(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function Oa(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 ka(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`string`&&e.trim()!==``){let t=Number.parseFloat(e);return Number.isFinite(t)?t:void 0}}function Aa(e){if(typeof e!=`string`)return;let t=e.trim();return t===``?void 0:t}function ja(e){if(!e||typeof e!=`object`)return;let t=e,n={},r=Aa(t.productId);r!==void 0&&(n.productId=r);let i=Aa(t.sku);i!==void 0&&(n.sku=i);let a=Aa(t.name);a!==void 0&&(n.name=a);let o=ka(t.quantity);o!==void 0&&(n.quantity=o);let s=ka(t.unitPrice);s!==void 0&&(n.unitPrice=s);let c=ka(t.totalPrice);return c!==void 0&&(n.totalPrice=c),Object.keys(n).length>0?n:void 0}function Ma(e){let t=Oa(e);if(!t)return;let n=[];for(let e of t){let t=ja(e);t&&n.push(t)}return n.length>0?n:void 0}function Na(e){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.title==`string`?t.title.trim():``,r=ja(e);if(n===``&&!r)return null;let i={...r};return n!==``&&(i.title=n),typeof t.imageUrl==`string`&&Da(t.imageUrl)&&(i.imageUrl=t.imageUrl),typeof t.link==`string`&&Da(t.link)&&(i.link=t.link),typeof t.utmContent==`string`&&t.utmContent!==``&&(i.utmContent=t.utmContent),i}function Pa(e){let t=Oa(e);if(!t)return;let n=[];for(let e of t){let t=Na(e);t&&n.push(t)}return n.length>0?n:void 0}function Fa(e){if(!e)return;let t;try{t=Ea(e)}catch{return}if(t!==null)return Pa(t)}async function Ia({config:e}){let t=La(e);Mi(t);let n=await ia({config:t});if(!n){console.error(`Failed to create iframe`);return}let r=await va({config:t,iframe:n});if(await r.waitForSetup,!await r.waitForConnection)console.error(`Failed to connect to client`);else return r}function La(e){let t=vi(e.metadata.currency);return{...e,metadata:{...e.metadata,currency:t}}}function Ra({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}var za=/* @__PURE__ */ t({DEEP_LINK_SCHEME:()=>Pi,FrakContextManager:()=>gi,areAddressesEqual:()=>Jr,base64urlDecode:()=>Fr,base64urlEncode:()=>Pr,baseIframeProps:()=>ra,buildListenerUrl:()=>aa,clearAllCache:()=>Ln,coerceProductCandidates:()=>Oa,compressJsonToB64:()=>Ir,createIFrameFrakClient:()=>va,decodeProductsParam:()=>Fa,decompressJsonFromB64:()=>Ea,deleteQueryParamCaseInsensitive:()=>$,detectPageLanguage:()=>ji,findIframeInOpener:()=>la,formatAmount:()=>bi,formatAmountParts:()=>Si,generateSsoUrl:()=>Lr,getBackendUrl:()=>q,getClientId:()=>Nr,getClientIdAsync:()=>Z,getCurrencyAmountKey:()=>wi,getEnvironment:()=>jn,getQueryParamCaseInsensitive:()=>Gr,getSupportedCurrency:()=>vi,isIOS:()=>Xi,isInAppBrowser:()=>$i,isInstagramBrowser:()=>ta,isMobile:()=>Zi,mergeAttribution:()=>Ra,normalizeProductDetails:()=>ja,normalizeSharingProduct:()=>Na,redirectToExternalBrowser:()=>na,sanitizeProductDetailsList:()=>Ma,sanitizeSharingProducts:()=>Pa,sdkConfigStore:()=>Y,setEnvironment:()=>An,setupClient:()=>Ia,ssoPopupFeatures:()=>Vr,ssoPopupName:()=>Hr,trackEvent:()=>Q,triggerDeepLinkWithFallback:()=>qi,withCache:()=>In});const Ba=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Va(e){if(Ba.test(e))return g(u(e,`uuid`))}async function Ha(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 Ua(e,t,n){return await e.request({method:`frak_displaySharingPage`,params:n?[t,e.config.metadata,n]:[t,e.config.metadata]})}async function Wa(e){if(typeof window>`u`)return;let t=await Z().catch(()=>void 0);if(!t)return;let n=await Y.resolveMerchantId();if(!n)return;let r=`frak-identity-ensured-${n}-${t}`;if(!window.sessionStorage.getItem(r))try{let i=q(),a=await X({op:`frak-ensure-v1`,merchantId:n,anonymousId:t});(await fetch(`${i}/user/identity/ensure`,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`,"x-wallet-sdk-auth":e,"x-frak-client-id":t,...Tr()},body:JSON.stringify({merchantId:n,...a&&{proof:a}})})).ok&&window.sessionStorage.setItem(r,`1`)}catch{}}async function Ga({merchantId:e,checkoutToken:t}={}){let n=e??await Y.resolveMerchantId();if(!n)return;let r=Mn(),i=encodeURIComponent(Va(n)??n),a=t?`&checkoutToken=${encodeURIComponent(t)}`:``,o=`${r}/i?m=${i}`,s=await Z().catch(()=>void 0);if(!s)return`${o}${a}`;let c=await X({op:`frak-install-v1`,merchantId:n,anonymousId:s});return c?`${o}${a}#p=${encodeURIComponent(c)}`:`${o}&a=${encodeURIComponent(Va(s)??s)}${a}`}async function Ka(e,t){return In(()=>e.request({method:`frak_getMerchantInformation`}),{cacheKey:`frak_getMerchantInformation`,cacheTime:t?.cacheTime})}async function qa(e,t){return In(async()=>{let t=await Z().catch(()=>void 0),n=await Y.resolveMerchantId(),r=t&&n?await X({op:`frak-merge-v1`,merchantId:n,anonymousId:t}):null;return e.request({method:`frak_getMergeToken`,params:r?[r]:void 0})},{cacheKey:`frak_getMergeToken`,cacheTime:t?.cacheTime})}async function Ja(e,t){return In(()=>e.request({method:`frak_getUserReferralStatus`}),{cacheKey:`frak_getUserReferralStatus`,cacheTime:t?.cacheTime})}async function Ya(e,t){let{metadata:n,customizations:r}=e.config;return await e.request({method:`frak_prepareSso`,params:[t,n.name,r?.css]})}async function Xa(e,t){try{let n=await Z().catch(()=>void 0);await e.request({method:`frak_sendInteraction`,params:[t,{clientId:n}]})}catch{console.warn(`[Frak SDK] Failed to send interaction:`,t.type)}}function Za(e,t,n){return $r(t)?(Q(e,`user_referred_started`,{referrer_client_id:t.c,referrer_wallet:t.w,wallet_status:n?.key}),Xa(e,{type:`arrival`,referrerClientId:t.c,referrerMerchantId:t.m,referrerWallet:t.w,referralTimestamp:t.t}),!0):Qr(t)?(Q(e,`user_referred_started`,{referrer:t.r,wallet_status:n?.key}),Xa(e,{type:`arrival`,referrerWallet:t.r}),!0):!1}function Qa(e,t,n){return!t&&!n?null:{v:2,m:e,t:Math.floor(Date.now()/1e3),...t?{c:t}:{},...n?{w:n}:{}}}function $a(e,t,n){return $r(e)?e.w&&n?.wallet?Jr(e.w,n.wallet):e.c?t===e.c:!1:Qr(e)&&n?.wallet?Jr(e.r,n.wallet):!1}async function eo(e,{walletStatus:t,frakContext:n,options:r}){if(!n)return`no-referrer`;let i=await Z().catch(()=>void 0);if($a(n,i,t))return`self-referral`;if(!Za(e,n,t))return`no-referrer`;let a=$r(n)?n.m:r?.merchantId,o=r?.alwaysAppendUrl&&a?Qa(a,i,t?.wallet):null;return gi.replaceUrl({url:window.location.href,context:o}),Q(e,`user_referred_completed`,{status:`success`}),`success`}async function to(e,{options:t}={}){let n=gi.parse({url:window.location.href}),r=await ao(e);try{return await eo(e,{walletStatus:r,frakContext:n,options:t})}catch(e){console.warn(`Error processing referral`,{error:e})}}const no=`frak:referral-success`;async function ro(e){try{await to(e)===`success`&&window.dispatchEvent(new Event(no))}catch(e){console.warn(`[Frak] Referral setup failed`,e)}}async function io(e){if(typeof window>`u`){console.warn(`[Frak] No window found, can't track purchase`);return}let t=window.sessionStorage.getItem(`frak-wallet-interaction-token`),n=await Z().catch(()=>void 0);if(!t&&!n){console.warn(`[Frak] No identity found, skipping purchase check`);return}let r=e.merchantId??await Y.resolveMerchantId();if(!r){console.warn(`[Frak] No merchant id found, skipping purchase check`);return}let i={Accept:`application/json`,"Content-Type":`application/json`};t&&(i[`x-wallet-sdk-auth`]=t),n&&(i[`x-frak-client-id`]=n);let a=q();await fetch(`${a}/user/track/purchase`,{method:`POST`,headers:i,body:JSON.stringify({customerId:e.customerId,orderId:e.orderId,token:e.token,merchantId:r})})}function ao(e,t){if(!t)return e.request({method:`frak_listenToWalletStatus`}).then(t=>(oo(e,t),t));let n=new bn,r=!1;return e.listenerRequest({method:`frak_listenToWalletStatus`},i=>{oo(e,i),t(i),r||=(n.resolve(i),!0)}),n.promise}function oo(e,t){typeof window<`u`&&(e.openPanel?.setGlobalProperties({wallet:t.wallet??null}),t.interactionToken?(window.sessionStorage.setItem(`frak-wallet-interaction-token`,t.interactionToken),Wa(t.interactionToken)):window.sessionStorage.removeItem(`frak-wallet-interaction-token`))}function so(e,{metadata:t,login:n}){return co(e,{steps:{login:n??{}},metadata:t})}function co(e,t){function n(n){return co(e,{...t,steps:{...t.steps,sendTransaction:n}})}function r(n){return co(e,{...t,steps:{...t.steps,final:{...n,action:{key:`reward`}}}})}async function i(n,r){return n&&(t.metadata=n(t.metadata??{})),await Ha(e,t,r)}return{params:t,sendTx:n,reward:r,display:i}}async function lo(e,{tx:t,metadata:n}){return(await Ha(e,{metadata:n,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}function uo(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 fo(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 Ha(e,{metadata:n,steps:{login:{},siweAuthenticate:{siwe:{...t,statement:i,nonce:t?.nonce??uo(),uri:t?.uri??`https://${r}`,version:t?.version??`1`,domain:r}}}})).siweAuthenticate}var po=/* @__PURE__ */ t({REFERRAL_SUCCESS_EVENT:()=>no,displayModal:()=>Ha,displaySharingPage:()=>Ua,ensureIdentity:()=>Wa,getInstallUrl:()=>Ga,getMerchantInformation:()=>Ka,getMergeToken:()=>qa,getUserReferralStatus:()=>Ja,modalBuilder:()=>so,openSso:()=>Ur,prepareSso:()=>Ya,prepareSsoUrl:()=>Br,processReferral:()=>eo,referralInteraction:()=>to,sendInteraction:()=>Xa,sendTransaction:()=>lo,setupReferral:()=>ro,siweAuthenticate:()=>fo,trackPurchaseStatus:()=>io,watchWalletStatus:()=>ao});async function mo(e,t,n,r){window.FrakSetup?.client?await Ua(window.FrakSetup.client,{...r?.link&&{link:r.link},...r?.products?.length&&{products:r.products},...r?.checkoutToken&&{checkoutToken:r.checkoutToken},metadata:{entryPoint:e,...t&&{targetInteraction:t}}},n).catch(e=>console.error(`Frak sharing page failed`,e)):console.error(`Frak client not found`)}const ho=[`frak-button-share`,`frak-button-wallet`,`frak-open-in-app`,`frak-post-purchase`,`frak-banner`].join(`,`);function go(){return typeof document>`u`||document.querySelector(ho)===null?[]:[`sharing`]}const _o=`frak:client`;function vo(){let e=new CustomEvent(_o);window.dispatchEvent(e)}function yo(e,t){window.FrakSetup?.client&&e===`add`?t():(e===`add`?window.addEventListener:window.removeEventListener)(_o,t,!1)}function bo(){return window.FrakSetup.core={...za,...po},window.FrakSetup?.client?Promise.resolve():In(()=>xo(),{cacheKey:`frak-sdk-init`,cacheTime:1/0}).catch(e=>{Q(window.FrakSetup?.client,`sdk_init_failed`,{reason:e instanceof Error?e.message:typeof e==`string`?e:`unknown`,config_missing:!window.FrakSetup?.config})})}async function xo(){if(!window.FrakSetup?.config)throw Error(`[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set.`);let e=await Ia({config:So(window.FrakSetup.config)});if(!e)throw Error(`[Frak SDK] Failed to create client`);window.FrakSetup.client=e,vo(),ro(e),Co()}function So(e){return e.preload===void 0?{...e,preload:go()}:e}function Co(){let e=new URL(window.location.href);if(Gr(e.searchParams,`frakAction`)?.toLowerCase()!==`share`)return;let t=Gr(e.searchParams,`link`)??void 0,n=Gr(e.searchParams,`placement`)??void 0,r=Fa(Gr(e.searchParams,`products`));$(e.searchParams,`frakAction`),$(e.searchParams,`link`),$(e.searchParams,`placement`),$(e.searchParams,`products`),window.history.replaceState({},``,e.toString()),Q(window.FrakSetup?.client,`sharing_page_auto_opened`,{placement:n,has_link:!!t,has_products:!!r?.length}),mo(`auto_open`,void 0,n,{link:t,products:r})}o.injectBase(`shared`,n),o.injectBase(`fouce`,`frak-ambassador:not(:defined), 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; }`),s(bo);const wo={ambassador:()=>import(
|
|
135
135
|
/* webpackChunkName: "ambassador" */
|
|
136
|
-
`./Ambassador.
|
|
136
|
+
`./Ambassador.7wEDPaYu.js`),"button-share":()=>import(
|
|
137
137
|
/* webpackChunkName: "button-share" */
|
|
138
|
-
`./ButtonShare.
|
|
138
|
+
`./ButtonShare.BTT49Sbn.js`),"button-wallet":()=>import(
|
|
139
139
|
/* webpackChunkName: "button-wallet" */
|
|
140
|
-
`./ButtonWallet.
|
|
140
|
+
`./ButtonWallet.CB0Ysymx.js`),"open-in-app":()=>import(
|
|
141
141
|
/* webpackChunkName: "open-in-app" */
|
|
142
|
-
`./OpenInAppButton.
|
|
142
|
+
`./OpenInAppButton.DdL3xii8.js`),"post-purchase":()=>import(
|
|
143
143
|
/* webpackChunkName: "post-purchase" */
|
|
144
|
-
`./PostPurchase.
|
|
144
|
+
`./PostPurchase.ClgDFxmZ.js`),banner:()=>import(
|
|
145
145
|
/* webpackChunkName: "banner" */
|
|
146
|
-
`./Banner.
|
|
146
|
+
`./Banner.8NeKFnVj.js`)},To=new MutationObserver(e=>{for(let{addedNodes:t}of e)for(let e of Array.from(t))e.nodeType===Node.ELEMENT_NODE&&Eo(e)});async function Eo(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=>Do(e)))}async function Do(e){if(customElements.get(e))return Promise.resolve();let t=e.replace(/^frak-/i,``);if(!(t in wo))console.error(`Component ${e} is not supported.`);else try{await wo[t]()}catch(e){console.error(e)}}Eo(document.body),To.observe(document.documentElement,{subtree:!0,childList:!0});export{Q as C,s as D,yn as E,o as O,vi as S,vn as T,Ma as _,no as a,bi as b,Ka as c,$i as d,na as f,Pi as g,ji as h,io as i,n as k,qa as l,Zi as m,yo as n,Ga as o,qi as p,mo as r,Ja as s,bo as t,Pa as u,Si as v,Y as w,wi as x,Ci as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return()=>{}}var t=null;function n(n,r){if(typeof document>`u`||typeof window>`u`)return;t&&t();let i=n.maxEventsPerChunk??200,a=n.flushIntervalMs??1e4,o=n.maxPayloadBytes??1048576,s=[],c=0,l=null;function u(e){if(s.length===0)return;let t=JSON.stringify(s);if(new TextEncoder().encode(t).length>o){if(s.length>1){let t=Math.floor(s.length/2),n=s.slice(0,t),r=s.slice(t),i=e&&n.some(e=>e.type===2);s=n,u(i),s=r,u(!1);return}s=[];return}let n=s[0].timestamp,i=s[s.length-1].timestamp;try{r({chunk_index:c,events_count:s.length,is_full_snapshot:e,started_at:new Date(n).toISOString(),ended_at:new Date(i).toISOString(),payload:t}),c+=1,s=[]}catch(e){throw console.error(`[ReplayRecorder] sendChunk failed`,e),e}}function d(e){let t=e||s.some(e=>e.type===2);s.length>=i?u(t):e&&s.length>0&&u(!0)}let f=n.maskAllText!==!1,p=n.unmaskTextSelector,m=e({emit(e,t){s.push(e),d(!!t)},checkoutEveryNms:a,maskAllInputs:n.maskAllInputs??!0,maskTextSelector:f?`*`:`[data-openpanel-replay-mask]`,maskTextFn:f&&p?(e,t)=>t?.closest(p)?e:e.replace(/\S/g,`*`):void 0,blockSelector:n.blockSelector??`[data-openpanel-replay-block]`,blockClass:n.blockClass,ignoreSelector:n.ignoreSelector});l=setInterval(()=>{s.length>0&&u(s.some(e=>e.type===2))},a);function h(){document.visibilityState===`hidden`&&s.length>0&&u(s.some(e=>e.type===2))}function g(){s.length>0&&u(s.some(e=>e.type===2))}document.addEventListener(`visibilitychange`,h),window.addEventListener(`pagehide`,g),t=()=>{s.length>0&&u(s.some(e=>e.type===2)),l&&=(clearInterval(l),null),document.removeEventListener(`visibilitychange`,h),window.removeEventListener(`pagehide`,g),m?.(),t=null}}function r(){t&&t()}export{n as startReplayRecorder,r as stopReplayRecorder};
|
|
@@ -0,0 +1 @@
|
|
|
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));else if(i.field===t&&n.has(i.operator)){let e=o(i.value);e!=null&&r.push(e)}return r}const c=/* @__PURE__ */ new Set([`gt`,`gte`,`between`]),l=/* @__PURE__ */ 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/* @__PURE__ */ 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=/* @__PURE__ */ new Set([`eq`,`neq`,`gt`,`gte`,`lt`,`lte`,`between`]),b=/* @__PURE__ */ 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??/* @__PURE__ */ 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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./loader.js";import{o as t,s as n}from"./jsxRuntime.module.CUZaa90V.js";function r(){return n(t,()=>e.getConfig().components)}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as e}from"./loader.js";import{f as t,i as n}from"./jsxRuntime.module.
|
|
1
|
+
import{O as e}from"./loader.js";import{f as t,i as n}from"./jsxRuntime.module.CUZaa90V.js";function r(r,i,a,o,s){t(()=>{s&&e.injectBase(`shared`,s),e.injectBase(r,o??n)},[r]),t(()=>{a&&e.injectPlacement(r,i??``,a)},[r,i,a])}export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as e}from"./loader.js";import{o as t,p as n,s as r}from"./jsxRuntime.module.
|
|
1
|
+
import{w as e}from"./loader.js";import{o as t,p as n,s as r}from"./jsxRuntime.module.CUZaa90V.js";function i(t){return e.getConfig().placements?.[t]}function a(e){let a=n(()=>e?i(e):void 0,[e]);return r(t,a)}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./loader.js";import{d as t,f as n}from"./jsxRuntime.module.
|
|
1
|
+
import{c as e}from"./loader.js";import{d as t,f as n}from"./jsxRuntime.module.CUZaa90V.js";import{r}from"./rewards.F9iOJSNk.js";function i(i,a,o,s){let[c,l]=t(void 0),[u,d]=t(!1);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,products:s});d(n!==void 0),n&&n.payoutType!==`percentage`&&l(n.formatted)}).catch(()=>{})},[i,a,o,s]),{reward:c,hasReward:u}}export{i as t};
|
package/dist/ambassador.d.ts
CHANGED
package/dist/ambassador.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-CPNmnpXA.js";
|
|
2
|
-
import { i as w } from "./rewards-
|
|
2
|
+
import { i as w } from "./rewards-HJlTkTcY.js";
|
|
3
3
|
import { t as useGlobalComponents } from "./useGlobalComponents-B3s2UQFk.js";
|
|
4
4
|
import { t as useLightDomStyles } from "./useLightDomStyles-BQ5FvCPi.js";
|
|
5
|
-
import { t as useReward } from "./useReward-
|
|
5
|
+
import { t as useReward } from "./useReward-WmsNOFlz.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
7
|
import { t as cssSource$2 } from "./sharedBaseCss.css-BkMpQeRx.js";
|
|
8
8
|
import { trackEvent } from "@frak-labs/core-sdk";
|
package/dist/banner.d.ts
CHANGED
package/dist/banner.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as useClientReady, o as registerWebComponent, r as useLang } from "./sharedCss-CPNmnpXA.js";
|
|
2
|
-
import { i as w } from "./rewards-
|
|
2
|
+
import { i as w } from "./rewards-HJlTkTcY.js";
|
|
3
3
|
import { t as useGlobalComponents } from "./useGlobalComponents-B3s2UQFk.js";
|
|
4
4
|
import { t as useLightDomStyles } from "./useLightDomStyles-BQ5FvCPi.js";
|
|
5
|
-
import { t as useReward } from "./useReward-
|
|
5
|
+
import { t as useReward } from "./useReward-WmsNOFlz.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
7
|
import { t as cssSource$5 } from "./sharedBaseCss.css-BkMpQeRx.js";
|
|
8
8
|
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
package/dist/buttonShare.d.ts
CHANGED
package/dist/buttonShare.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage } from "./sharedCss-CPNmnpXA.js";
|
|
2
|
-
import { i as w } from "./rewards-
|
|
2
|
+
import { i as w } from "./rewards-HJlTkTcY.js";
|
|
3
3
|
import { t as useGlobalComponents } from "./useGlobalComponents-B3s2UQFk.js";
|
|
4
4
|
import { t as useLightDomStyles } from "./useLightDomStyles-BQ5FvCPi.js";
|
|
5
|
-
import { t as useReward } from "./useReward-
|
|
5
|
+
import { t as useReward } from "./useReward-WmsNOFlz.js";
|
|
6
6
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
7
7
|
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
|
8
8
|
import { sanitizeSharingProducts, trackEvent } from "@frak-labs/core-sdk";
|
package/dist/buttonWallet.d.ts
CHANGED
package/dist/buttonWallet.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as useClientReady, o as registerWebComponent, r as useLang, s as openSharingPage, t as buildStyleContent } from "./sharedCss-CPNmnpXA.js";
|
|
2
|
-
import { t as useReward } from "./useReward-
|
|
2
|
+
import { t as useReward } from "./useReward-WmsNOFlz.js";
|
|
3
3
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
4
4
|
import { t as usePlacement } from "./usePlacement-BpaIbzun.js";
|
|
5
5
|
import { trackEvent } from "@frak-labs/core-sdk";
|