diff --git a/assets/index.636a998f.js b/assets/index.08d54968.js similarity index 97% rename from assets/index.636a998f.js rename to assets/index.08d54968.js index 3b89a626..caed0737 100644 --- a/assets/index.636a998f.js +++ b/assets/index.08d54968.js @@ -1,6 +1,6 @@ -const Kw=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}};Kw();function wr(){}function Ji(t,e){for(const r in e)t[r]=e[r];return t}function Hw(t){return t&&typeof t=="object"&&typeof t.then=="function"}function Cm(t){return t()}function Xd(){return Object.create(null)}function ri(t){t.forEach(Cm)}function Qp(t){return typeof t=="function"}function ln(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Ww(t){return Object.keys(t).length===0}function Jp(t,...e){if(t==null)return wr;const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function Ra(t){let e;return Jp(t,r=>e=r)(),e}function Ur(t,e,r){t.$$.on_destroy.push(Jp(e,r))}function Zp(t,e,r,n){if(t){const i=Nm(t,e,r,n);return t[0](i)}}function Nm(t,e,r,n){return t[1]&&n?Ji(r.ctx.slice(),t[1](n(e))):r.ctx}function ed(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const a=[],s=Math.max(e.dirty.length,i.length);for(let u=0;u32){const e=[],r=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,r,n)}function Ve(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}function Qd(t,e){const r=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:r[n]&&r[n].set?t[n]=e[n]:Ve(t,n,e[n])}function Yw(t){return Array.from(t.childNodes)}function br(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ku(t,e){t.value=e??""}function yo(t,e,r,n){r===null?t.style.removeProperty(e):t.style.setProperty(e,r,n?"important":"")}function Jd(t,e,r){t.classList[r?"add":"remove"](e)}function Xw(t,e,{bubbles:r=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r,n,e),i}let Ss;function di(t){Ss=t}function Va(){if(!Ss)throw new Error("Function called outside component initialization");return Ss}function jm(t){Va().$$.on_mount.push(t)}function Qw(t){Va().$$.on_destroy.push(t)}function nc(){const t=Va();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const a=Xw(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,a)}),!a.defaultPrevented}return!0}}function ms(t,e){return Va().$$.context.set(t,e),e}function Oi(t){return Va().$$.context.get(t)}const vs=[],Zd=[],Lu=[],eh=[],Lm=Promise.resolve();let hp=!1;function Mm(){hp||(hp=!0,Lm.then(nd))}function Jw(){return Mm(),Lm}function yp(t){Lu.push(t)}const Df=new Set;let Su=0;function nd(){const t=Ss;do{for(;Su{Mu.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function th(t,e){const r=e.token={};function n(i,a,s,u){if(e.token!==r)return;e.resolved=u;let c=e.ctx;s!==void 0&&(c=c.slice(),c[s]=u);const f=i&&(e.current=i)(c);let l=!1;e.block&&(e.blocks?e.blocks.forEach((o,w)=>{w!==a&&o&&(Dn(),mr(o,1,1,()=>{e.blocks[w]===o&&(e.blocks[w]=null)}),Un())}):e.block.d(1),f.c(),dr(f,1),f.m(e.mount(),e.anchor),l=!0),e.block=f,e.blocks&&(e.blocks[a]=f),l&&nd()}if(Hw(t)){const i=Va();if(t.then(a=>{di(i),n(e.then,1,e.value,a),di(null)},a=>{if(di(i),n(e.catch,2,e.error,a),di(null),!e.hasCatch)throw a}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,t),!0;e.resolved=t}}function e2(t,e,r){const n=e.slice(),{resolved:i}=t;t.current===t.then&&(n[t.value]=i),t.current===t.catch&&(n[t.error]=i),t.block.p(n,r)}function Dm(t,e){const r={},n={},i={$$scope:1};let a=t.length;for(;a--;){const s=t[a],u=e[a];if(u){for(const c in s)c in u||(n[c]=1);for(const c in u)i[c]||(r[c]=u[c],i[c]=1);t[a]=u}else for(const c in s)i[c]=1}for(const s in n)s in r||(r[s]=void 0);return r}function rh(t){return typeof t=="object"&&t!==null?t:{}}function Xr(t){t&&t.c()}function Gr(t,e,r,n){const{fragment:i,on_mount:a,on_destroy:s,after_update:u}=t.$$;i&&i.m(e,r),n||yp(()=>{const c=a.map(Cm).filter(Qp);s?s.push(...c):ri(c),t.$$.on_mount=[]}),u.forEach(yp)}function Yr(t,e){const r=t.$$;r.fragment!==null&&(ri(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function t2(t,e){t.$$.dirty[0]===-1&&(vs.push(t),Mm(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=p.length?p[0]:w;return f.ctx&&i(f.ctx[o],f.ctx[o]=d)&&(!f.skip_bound&&f.bound[o]&&f.bound[o](d),l&&t2(t,o)),w}):[],f.update(),l=!0,ri(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const o=Yw(e.target);f.fragment&&f.fragment.l(o),o.forEach(Wt)}else f.fragment&&f.fragment.c();e.intro&&dr(t.$$.fragment),Gr(t,e.target,e.anchor,e.customElement),nd()}di(c)}class yn{$destroy(){Yr(this,1),this.$destroy=wr}$on(e,r){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Ww(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const nh=t=>typeof t>"u",Um=t=>typeof t=="function",Fm=t=>typeof t=="number";function r2(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Bm(){let t=0;return()=>t++}function n2(){return Math.random().toString(36).substring(2)}const Ai=typeof window>"u";function $m(t,e,r){return t.addEventListener(e,r),()=>t.removeEventListener(e,r)}const _a=[];function o2(t,e){return{subscribe:Sn(t,e).subscribe}}function Sn(t,e=wr){let r;const n=new Set;function i(u){if(ln(t,u)&&(t=u,r)){const c=!_a.length;for(const f of n)f[1](),_a.push(f,t);if(c){for(let f=0;f<_a.length;f+=2)_a[f][0](_a[f+1]);_a.length=0}}}function a(u){i(u(t))}function s(u,c=wr){const f=[u,c];return n.add(f),n.size===1&&(r=e(i)||wr),u(t),()=>{n.delete(f),n.size===0&&(r(),r=null)}}return{set:i,update:a,subscribe:s}}function i2(t,e,r){const n=!Array.isArray(t),i=n?[t]:t,a=e.length<2;return o2(r,s=>{let u=!1;const c=[];let f=0,l=wr;const o=()=>{if(f)return;l();const p=e(n?c[0]:c,s);a?s(p):l=Qp(p)?p:wr},w=i.map((p,d)=>Jp(p,S=>{c[d]=S,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,vp=xs("LOCATION"),Ca=xs("ROUTER"),Vm=xs("ROUTE"),a2=xs("ROUTE_PARAMS"),s2=xs("FOCUS_ELEM"),qm=/^:(.+)/,mp=(t,e)=>t.substr(0,e.length)===e,u2=t=>t==="",c2=t=>qm.test(t),zm=t=>t[0]==="*",l2=t=>t.replace(/\*.*$/,""),Km=t=>t.replace(/(^\/+|\/+$)/g,"");function ei(t,e=!1){const r=Km(t).split("/");return e?r.filter(Boolean):r}const Uf=(t,e)=>t+(e?`?${e}`:""),od=t=>`/${Km(t)}`;function Ps(...t){const e=n=>ei(n,!0).join("/"),r=t.map(e).join("/");return od(r)}const id=1,oc=2,Zi=3,f2=4,Hm=5,p2=6,Wm=7,d2=8,h2=9,Gm=10,Ym=11,y2={[id]:"Link",[oc]:"Route",[Zi]:"Router",[f2]:"useFocus",[Hm]:"useLocation",[p2]:"useMatch",[Wm]:"useNavigate",[d2]:"useParams",[h2]:"useResolvable",[Gm]:"useResolve",[Ym]:"navigate"},ad=t=>y2[t];function v2(t,e){let r;return t===oc?r=e.path?`path="${e.path}"`:"default":t===id?r=`to="${e.to}"`:t===Zi&&(r=`basepath="${e.basepath||""}"`),`<${ad(t)} ${r||""} />`}function m2(t,e,r,n){const i=r&&v2(n||t,r),a=i?` +const Kw=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}};Kw();function wr(){}function Ji(t,e){for(const r in e)t[r]=e[r];return t}function Hw(t){return t&&typeof t=="object"&&typeof t.then=="function"}function Cm(t){return t()}function Xd(){return Object.create(null)}function ri(t){t.forEach(Cm)}function Qp(t){return typeof t=="function"}function ln(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Ww(t){return Object.keys(t).length===0}function Jp(t,...e){if(t==null)return wr;const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function Ra(t){let e;return Jp(t,r=>e=r)(),e}function Ur(t,e,r){t.$$.on_destroy.push(Jp(e,r))}function Zp(t,e,r,n){if(t){const i=Nm(t,e,r,n);return t[0](i)}}function Nm(t,e,r,n){return t[1]&&n?Ji(r.ctx.slice(),t[1](n(e))):r.ctx}function ed(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const a=[],s=Math.max(e.dirty.length,i.length);for(let u=0;u32){const e=[],r=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,r,n)}function Ve(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}function Qd(t,e){const r=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:r[n]&&r[n].set?t[n]=e[n]:Ve(t,n,e[n])}function Yw(t){return Array.from(t.childNodes)}function br(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ku(t,e){t.value=e??""}function yo(t,e,r,n){r===null?t.style.removeProperty(e):t.style.setProperty(e,r,n?"important":"")}function Jd(t,e,r){t.classList[r?"add":"remove"](e)}function Xw(t,e,{bubbles:r=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r,n,e),i}let Ss;function di(t){Ss=t}function Va(){if(!Ss)throw new Error("Function called outside component initialization");return Ss}function jm(t){Va().$$.on_mount.push(t)}function Qw(t){Va().$$.on_destroy.push(t)}function nc(){const t=Va();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const a=Xw(e,r,{cancelable:n});return i.slice().forEach(s=>{s.call(t,a)}),!a.defaultPrevented}return!0}}function ms(t,e){return Va().$$.context.set(t,e),e}function Oi(t){return Va().$$.context.get(t)}const vs=[],Zd=[],Lu=[],eh=[],Lm=Promise.resolve();let hp=!1;function Mm(){hp||(hp=!0,Lm.then(nd))}function Jw(){return Mm(),Lm}function yp(t){Lu.push(t)}const Df=new Set;let Su=0;function nd(){const t=Ss;do{for(;Su{Mu.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function th(t,e){const r=e.token={};function n(i,a,s,u){if(e.token!==r)return;e.resolved=u;let c=e.ctx;s!==void 0&&(c=c.slice(),c[s]=u);const f=i&&(e.current=i)(c);let l=!1;e.block&&(e.blocks?e.blocks.forEach((o,w)=>{w!==a&&o&&(Dn(),mr(o,1,1,()=>{e.blocks[w]===o&&(e.blocks[w]=null)}),Un())}):e.block.d(1),f.c(),dr(f,1),f.m(e.mount(),e.anchor),l=!0),e.block=f,e.blocks&&(e.blocks[a]=f),l&&nd()}if(Hw(t)){const i=Va();if(t.then(a=>{di(i),n(e.then,1,e.value,a),di(null)},a=>{if(di(i),n(e.catch,2,e.error,a),di(null),!e.hasCatch)throw a}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,t),!0;e.resolved=t}}function e2(t,e,r){const n=e.slice(),{resolved:i}=t;t.current===t.then&&(n[t.value]=i),t.current===t.catch&&(n[t.error]=i),t.block.p(n,r)}function Dm(t,e){const r={},n={},i={$$scope:1};let a=t.length;for(;a--;){const s=t[a],u=e[a];if(u){for(const c in s)c in u||(n[c]=1);for(const c in u)i[c]||(r[c]=u[c],i[c]=1);t[a]=u}else for(const c in s)i[c]=1}for(const s in n)s in r||(r[s]=void 0);return r}function rh(t){return typeof t=="object"&&t!==null?t:{}}function Xr(t){t&&t.c()}function Gr(t,e,r,n){const{fragment:i,on_mount:a,on_destroy:s,after_update:u}=t.$$;i&&i.m(e,r),n||yp(()=>{const c=a.map(Cm).filter(Qp);s?s.push(...c):ri(c),t.$$.on_mount=[]}),u.forEach(yp)}function Yr(t,e){const r=t.$$;r.fragment!==null&&(ri(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function t2(t,e){t.$$.dirty[0]===-1&&(vs.push(t),Mm(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=p.length?p[0]:w;return f.ctx&&i(f.ctx[o],f.ctx[o]=d)&&(!f.skip_bound&&f.bound[o]&&f.bound[o](d),l&&t2(t,o)),w}):[],f.update(),l=!0,ri(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const o=Yw(e.target);f.fragment&&f.fragment.l(o),o.forEach(Wt)}else f.fragment&&f.fragment.c();e.intro&&dr(t.$$.fragment),Gr(t,e.target,e.anchor,e.customElement),nd()}di(c)}class yn{$destroy(){Yr(this,1),this.$destroy=wr}$on(e,r){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!Ww(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const nh=t=>typeof t>"u",Um=t=>typeof t=="function",Fm=t=>typeof t=="number";function r2(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Bm(){let t=0;return()=>t++}function n2(){return Math.random().toString(36).substring(2)}const Ai=typeof window>"u";function $m(t,e,r){return t.addEventListener(e,r),()=>t.removeEventListener(e,r)}const _a=[];function o2(t,e){return{subscribe:Sn(t,e).subscribe}}function Sn(t,e=wr){let r;const n=new Set;function i(u){if(ln(t,u)&&(t=u,r)){const c=!_a.length;for(const f of n)f[1](),_a.push(f,t);if(c){for(let f=0;f<_a.length;f+=2)_a[f][0](_a[f+1]);_a.length=0}}}function a(u){i(u(t))}function s(u,c=wr){const f=[u,c];return n.add(f),n.size===1&&(r=e(i)||wr),u(t),()=>{n.delete(f),n.size===0&&(r(),r=null)}}return{set:i,update:a,subscribe:s}}function i2(t,e,r){const n=!Array.isArray(t),i=n?[t]:t,a=e.length<2;return o2(r,s=>{let u=!1;const c=[];let f=0,l=wr;const o=()=>{if(f)return;l();const p=e(n?c[0]:c,s);a?s(p):l=Qp(p)?p:wr},w=i.map((p,d)=>Jp(p,S=>{c[d]=S,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,vp=xs("LOCATION"),Ca=xs("ROUTER"),Vm=xs("ROUTE"),a2=xs("ROUTE_PARAMS"),s2=xs("FOCUS_ELEM"),qm=/^:(.+)/,mp=(t,e)=>t.substr(0,e.length)===e,u2=t=>t==="",c2=t=>qm.test(t),zm=t=>t[0]==="*",l2=t=>t.replace(/\*.*$/,""),Km=t=>t.replace(/(^\/+|\/+$)/g,"");function ei(t,e=!1){const r=Km(t).split("/");return e?r.filter(Boolean):r}const Uf=(t,e)=>t+(e?`?${e}`:""),od=t=>`/${Km(t)}`;function Ps(...t){const e=n=>ei(n,!0).join("/"),r=t.map(e).join("/");return od(r)}const id=1,oc=2,Zi=3,f2=4,Hm=5,p2=6,Wm=7,d2=8,h2=9,Gm=10,Ym=11,y2={[id]:"Link",[oc]:"Route",[Zi]:"Router",[f2]:"useFocus",[Hm]:"useLocation",[p2]:"useMatch",[Wm]:"useNavigate",[d2]:"useParams",[h2]:"useResolvable",[Gm]:"useResolve",[Ym]:"navigate"},ad=t=>y2[t];function v2(t,e){let r;return t===oc?r=e.path?`path="${e.path}"`:"default":t===id?r=`to="${e.to}"`:t===Zi&&(r=`basepath="${e.basepath||""}"`),`<${ad(t)} ${r||""} />`}function m2(t,e,r,n){const i=r&&v2(n||t,r),a=i?` -Occurred in: ${i}`:"",s=ad(t),u=Um(e)?e(s):e;return`<${s}> ${u}${a}`}const Xm=t=>(...e)=>t(m2(...e)),Qm=Xm(t=>{throw new Error(t)}),Hu=Xm(console.warn),oh=4,g2=3,b2=2,_2=1,w2=1;function S2(t,e){const r=t.default?0:ei(t.fullPath).reduce((n,i)=>{let a=n;return a+=oh,u2(i)?a+=w2:c2(i)?a+=b2:zm(i)?a-=oh+_2:a+=g2,a},0);return{route:t,score:r,index:e}}function E2(t){return t.map(S2).sort((e,r)=>e.scorer.score?-1:e.index-r.index)}function Jm(t,e){let r,n;const[i]=e.split("?"),a=ei(i),s=a[0]==="",u=E2(t);for(let c=0,f=u.length;c({...l,params:w,uri:O});if(l.default){n=p(e);continue}const d=ei(l.fullPath),S=Math.max(a.length,d.length);let v=0;for(;v{f===".."?c.pop():f!=="."&&c.push(f)}),Uf(`/${c.join("/")}`,n)}function ih(t,e){const{pathname:r,hash:n="",search:i="",state:a}=t,s=ei(e,!0),u=ei(r,!0);for(;s.length;)s[0]!==u[0]&&Qm(Zi,`Invalid state: All locations must begin with the basepath "${e}", found "${r}"`),s.shift(),u.shift();return{pathname:Ps(...u),hash:n,search:i,state:a}}const ah=t=>t.length===1?"":t;function e0(t){const e=t.indexOf("?"),r=t.indexOf("#"),n=e!==-1,i=r!==-1,a=i?ah(t.substr(r)):"",s=i?t.substr(0,r):t,u=n?ah(s.substr(e)):"";return{pathname:n?s.substr(0,e):s,search:u,hash:a}}function A2(t,e,r){return Ps(r,O2(t,e))}function T2(t,e){const r=od(l2(t)),n=ei(r,!0),i=ei(e,!0).slice(0,n.length),a=Zm({fullPath:r},Ps(...i));return a&&a.uri}const Ff="POP",x2="PUSH",P2="REPLACE";function Bf(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function I2(t){let e=[],r=Bf(t),n=Ff;const i=(a=e)=>a.forEach(s=>s({location:r,action:n}));return{get location(){return r},listen(a){e.push(a);const s=()=>{r=Bf(t),n=Ff,i([a])};i([a]);const u=$m(t,"popstate",s);return()=>{u(),e=e.filter(c=>c!==a)}},navigate(a,s){const{state:u={},replace:c=!1}=s||{};if(n=c?P2:x2,Fm(a))s&&Hu(Ym,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Ff,t.history.go(a);else{const f={...u,_key:n2()};try{t.history[c?"replaceState":"pushState"](f,"",a)}catch{t.location[c?"replace":"assign"](a)}}r=Bf(t),i()}}}function $f(t,e){return{...e0(e),state:t}}function k2(t="/"){let e=0,r=[$f(null,t)];return{get entries(){return r},get location(){return r[e]},addEventListener(){},removeEventListener(){},history:{get state(){return r[e].state},pushState(n,i,a){e++,r=r.slice(0,e),r.push($f(n,a))},replaceState(n,i,a){r[e]=$f(n,a)},go(n){const i=e+n;i<0||i>r.length-1||(e=i)}}}}const R2=!!(!Ai&&window.document&&window.document.createElement),C2=!Ai&&window.location.origin==="null",N2=I2(R2&&!C2?window:k2());let pi=null,t0=!0;function j2(t,e){const r=document.querySelectorAll("[data-svnav-router]");for(let n=0;npi.level||t.level===pi.level&&j2(t.routerId,pi.routerId))&&(pi=t)}function M2(){pi=null}function D2(){t0=!1}function sh(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let r;r=$m(t,"blur",()=>{t.removeAttribute(e),r()})}return t.focus(),document.activeElement===t}catch{return!1}}function U2(t,e){return Number(t.dataset.svnavRouteEnd)===e}function F2(t){return/^H[1-6]$/i.test(t.tagName)}function uh(t,e=document){return e.querySelector(t)}function B2(t){let r=uh(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!U2(r,t);){if(F2(r))return r;const n=uh("h1,h2,h3,h4,h5,h6",r);if(n)return n;r=r.nextElementSibling}return null}function $2(t){Promise.resolve(Ra(t.focusElement)).then(e=>{const r=e||B2(t.id);r||Hu(Zi,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,oc),!sh(r)&&sh(document.documentElement)})}const V2=(t,e,r)=>(n,i)=>Jw().then(()=>{if(!pi||t0){D2();return}if(n&&$2(pi.route),t.announcements&&i){const{path:a,fullPath:s,meta:u,params:c,uri:f}=pi.route,l=t.createAnnouncement({path:a,fullPath:s,meta:u,params:c,uri:f},Ra(r));Promise.resolve(l).then(o=>{e.set(o)})}M2()}),q2="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function z2(t){let e,r;return{c(){e=Ct("div"),r=hr(t[0]),Ve(e,"role","status"),Ve(e,"aria-atomic","true"),Ve(e,"aria-live","polite"),Ve(e,"style",q2)},m(n,i){Gt(n,e,i),nt(e,r)},p(n,i){i[0]&1&&br(r,n[0])},d(n){n&&Wt(e)}}}function K2(t){let e,r,n,i,a;const s=t[20].default,u=Zp(s,t,t[19],null);let c=t[2]&&t[4]&&t[1].announcements&&z2(t);return{c(){e=Ct("div"),r=pr(),u&&u.c(),n=pr(),c&&c.c(),i=so(),yo(e,"display","none"),Ve(e,"aria-hidden","true"),Ve(e,"data-svnav-router",t[3])},m(f,l){Gt(f,e,l),Gt(f,r,l),u&&u.m(f,l),Gt(f,n,l),c&&c.m(f,l),Gt(f,i,l),a=!0},p(f,l){u&&u.p&&(!a||l[0]&524288)&&td(u,s,f,f[19],a?ed(s,f[19],l,null):rd(f[19]),null),f[2]&&f[4]&&f[1].announcements&&c.p(f,l)},i(f){a||(dr(u,f),a=!0)},o(f){mr(u,f),a=!1},d(f){f&&Wt(e),f&&Wt(r),u&&u.d(f),f&&Wt(n),c&&c.d(f),f&&Wt(i)}}}const H2=Bm(),ch="/";function W2(t,e,r){let n,i,a,s,u,{$$slots:c={},$$scope:f}=e,{basepath:l=ch}=e,{url:o=null}=e,{history:w=N2}=e,{primary:p=!0}=e,{a11y:d={}}=e;const S={createAnnouncement:K=>`Navigated to ${K.uri}`,announcements:!0,...d},v=l,O=od(l),h=Oi(vp),g=Oi(Ca),A=!h,m=H2(),x=p&&!(g&&!g.manageFocus),y=Sn("");Ur(t,y,K=>r(0,u=K));const _=Sn([]);Ur(t,_,K=>r(18,s=K));const L=Sn(null);Ur(t,L,K=>r(16,i=K));let b=!1;const T=A?0:g.level+1,k=A?Sn((()=>ih(Ai?e0(o):w.location,O))()):h;Ur(t,k,K=>r(15,n=K));const N=Sn(n);Ur(t,N,K=>r(17,a=K));const C=V2(S,y,k),D=K=>z=>z.filter(H=>H.id!==K);function X(K){if(Ai){if(b)return;const z=Zm(K,n.pathname);if(z)return b=!0,z}else _.update(z=>{const H=D(K.id)(z);return H.push(K),H})}function ae(K){_.update(D(K))}return!A&&l!==ch&&Hu(Zi,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:l}),A&&(jm(()=>w.listen(z=>{const H=ih(z.location,O);N.set(n),k.set(H)})),ms(vp,k)),ms(Ca,{activeRoute:L,registerRoute:X,unregisterRoute:ae,manageFocus:x,level:T,id:m,history:A?w:g.history,basepath:A?O:g.basepath}),t.$$set=K=>{"basepath"in K&&r(10,l=K.basepath),"url"in K&&r(11,o=K.url),"history"in K&&r(12,w=K.history),"primary"in K&&r(13,p=K.primary),"a11y"in K&&r(14,d=K.a11y),"$$scope"in K&&r(19,f=K.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&1024&&l!==v&&Hu(Zi,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&294912){const K=Jm(s,n.pathname);L.set(K)}if(t.$$.dirty[0]&163840&&A){const K=!!n.hash,z=!K&&x,H=!K||n.pathname!==a.pathname;C(z,H)}t.$$.dirty[0]&65536&&x&&i&&i.primary&&L2({level:T,routerId:m,route:i})},[u,S,A,m,x,y,_,L,k,N,l,o,w,p,d,n,i,a,s,f,c]}class r0 extends yn{constructor(e){super(),hn(this,e,W2,K2,ln,{basepath:10,url:11,history:12,primary:13,a11y:14},null,[-1,-1])}}function Is(t,e,r=Ca,n=Zi){Oi(r)||Qm(t,a=>`You cannot use ${a} outside of a ${ad(n)}.`,e)}const G2=t=>{const{subscribe:e}=Oi(t);return{subscribe:e}};function n0(){return Is(Hm),G2(vp)}function o0(){const{history:t}=Oi(Ca);return t}function i0(){const t=Oi(Vm);return t?i2(t,e=>e.base):Sn("/")}function a0(){Is(Gm);const t=i0(),{basepath:e}=Oi(Ca);return n=>A2(n,Ra(t),e)}function Y2(){Is(Wm);const t=a0(),{navigate:e}=o0();return(n,i)=>{const a=Fm(n)?n:t(n);return e(a,i)}}const X2=t=>({params:t&16,location:t&8}),lh=t=>({params:Ai?Ra(t[9]):t[4],location:t[3],navigate:t[10]});function fh(t){let e,r;return e=new r0({props:{primary:t[1],$$slots:{default:[Z2]},$$scope:{ctx:t}}}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&2&&(a.primary=n[1]),i&264217&&(a.$$scope={dirty:i,ctx:n}),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function Q2(t){let e;const r=t[17].default,n=Zp(r,t,t[18],lh);return{c(){n&&n.c()},m(i,a){n&&n.m(i,a),e=!0},p(i,a){n&&n.p&&(!e||a&262168)&&td(n,r,i,i[18],e?ed(r,i[18],a,X2):rd(i[18]),lh)},i(i){e||(dr(n,i),e=!0)},o(i){mr(n,i),e=!1},d(i){n&&n.d(i)}}}function J2(t){let e,r,n;const i=[{location:t[3]},{navigate:t[10]},Ai?Ra(t[9]):t[4],t[11]];var a=t[0];function s(u){let c={};for(let f=0;f{Yr(l,1)}),Un()}a?(e=new a(s()),Xr(e.$$.fragment),dr(e.$$.fragment,1),Gr(e,r.parentNode,r)):e=null}else a&&e.$set(f)},i(u){n||(e&&dr(e.$$.fragment,u),n=!0)},o(u){e&&mr(e.$$.fragment,u),n=!1},d(u){u&&Wt(r),e&&Yr(e,u)}}}function Z2(t){let e,r,n,i;const a=[J2,Q2],s=[];function u(c,f){return c[0]!==null?0:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,f){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}function eS(t){let e,r,n,i,a,s=t[2]&&fh(t);return{c(){e=Ct("div"),r=pr(),s&&s.c(),n=pr(),i=Ct("div"),yo(e,"display","none"),Ve(e,"aria-hidden","true"),Ve(e,"data-svnav-route-start",t[5]),yo(i,"display","none"),Ve(i,"aria-hidden","true"),Ve(i,"data-svnav-route-end",t[5])},m(u,c){Gt(u,e,c),Gt(u,r,c),s&&s.m(u,c),Gt(u,n,c),Gt(u,i,c),a=!0},p(u,[c]){u[2]?s?(s.p(u,c),c&4&&dr(s,1)):(s=fh(u),s.c(),dr(s,1),s.m(n.parentNode,n)):s&&(Dn(),mr(s,1,1,()=>{s=null}),Un())},i(u){a||(dr(s),a=!0)},o(u){mr(s),a=!1},d(u){u&&Wt(e),u&&Wt(r),s&&s.d(u),u&&Wt(n),u&&Wt(i)}}}const tS=Bm();function rS(t,e,r){let n;const i=["path","component","meta","primary"];let a=zu(e,i),s,u,c,f,{$$slots:l={},$$scope:o}=e,{path:w=""}=e,{component:p=null}=e,{meta:d={}}=e,{primary:S=!0}=e;Is(oc,e);const v=tS(),{registerRoute:O,unregisterRoute:h,activeRoute:g}=Oi(Ca);Ur(t,g,T=>r(15,s=T));const A=i0();Ur(t,A,T=>r(16,c=T));const m=n0();Ur(t,m,T=>r(3,u=T));const x=Sn(null);let y;const _=Sn(),L=Sn({});Ur(t,L,T=>r(4,f=T)),ms(Vm,_),ms(a2,L),ms(s2,x);const b=Y2();return Ai||Qw(()=>h(v)),t.$$set=T=>{r(23,e=Ji(Ji({},e),qu(T))),r(11,a=zu(e,i)),"path"in T&&r(12,w=T.path),"component"in T&&r(0,p=T.component),"meta"in T&&r(13,d=T.meta),"primary"in T&&r(1,S=T.primary),"$$scope"in T&&r(18,o=T.$$scope)},t.$$.update=()=>{if(t.$$.dirty&77834){const T=w==="",I=Ps(c,w),k={id:v,path:w,meta:d,default:T,fullPath:T?"":I,base:T?c:T2(I,u.pathname),primary:S,focusElement:x};_.set(k),r(14,y=O(k))}if(t.$$.dirty&49152&&r(2,n=!!(y||s&&s.id===v)),t.$$.dirty&49156&&n){const{params:T}=y||s;L.set(T)}},e=qu(e),[p,S,n,u,f,v,g,A,m,L,b,a,w,d,y,s,c,l,o]}class Eu extends yn{constructor(e){super(),hn(this,e,rS,eS,ln,{path:12,component:0,meta:13,primary:1})}}function nS(t){let e,r,n,i;const a=t[13].default,s=Zp(a,t,t[12],null);let u=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fr(11,l=x));const h=nc(),g=a0(),{navigate:A}=o0();function m(x){h("click",x),r2(x)&&(x.preventDefault(),A(n,{state:S,replace:a||d}))}return t.$$set=x=>{r(18,e=Ji(Ji({},e),qu(x))),r(17,f=zu(e,c)),"to"in x&&r(5,p=x.to),"replace"in x&&r(6,d=x.replace),"state"in x&&r(7,S=x.state),"getProps"in x&&r(8,v=x.getProps),"$$scope"in x&&r(12,w=x.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&r(0,n=g(p,l)),t.$$.dirty&2049&&r(10,i=mp(l.pathname,n)),t.$$.dirty&2049&&r(9,a=n===l.pathname),t.$$.dirty&512&&r(2,s=a?{"aria-current":"page"}:{}),r(1,u=(()=>{if(Um(v)){const x=v({location:l,href:n,isPartiallyCurrent:i,isCurrent:a});return{...f,...x}}return f})())},e=qu(e),[n,u,s,O,m,p,d,S,v,a,i,l,w,o]}class xa extends yn{constructor(e){super(),hn(this,e,oS,nS,ln,{to:5,replace:6,state:7,getProps:8})}}const iS="modulepreload",ph={},aS="/",s0=function(e,r){return!r||r.length===0?e():Promise.all(r.map(n=>{if(n=`${aS}${n}`,n in ph)return;ph[n]=!0;const i=n.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${a}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":iS,i||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),i)return new Promise((u,c)=>{s.addEventListener("load",u),s.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e())};var u0=(t=>(t.ENGLISH="en",t.SPANISH="es",t))(u0||{});const c0="Account:",l0="Allow",f0="Amount:",p0="Asset A:",d0="Asset B:",h0="Asset you are using to pay:",y0="Asset:",v0="Authorization:",m0="The account is authorized to maintain orders, but not to perform other transactions",g0="The account is authorized to transact with the asset",b0="Balance ID:",_0="Bump to:",w0="Buy Amount:",S0="Buying Asset:",E0="Buying:",O0="Cancel",A0="Claimants:",T0="Clear Flags:",x0="Close",P0="Confirm",I0="Connect",k0="Data:",R0="Description:",C0="Destination Asset:",N0="Destination inflation:",j0="Destination:",L0="Disallow",M0="ed25519PubpcKey:",D0="en",U0="English",F0="Error",B0="Sorry, the recipient's data wasn't provided.",$0="Expand all",V0="Extend to:",q0="Payment failed. Please try again.",z0="You will sign to pay the",K0="of the transaction below",H0="FEE BUMP",W0="Fee",G0="From:",Y0="Function type:",X0="Go to Connect",Q0="Go to Sign",J0="Go to Payment",Z0="Hide all",eg="Hide key",tg="High Threshold:",rg="Hint:",ng="Home Domain:",og="Install",ig="Invalid key",ag="Is authorized to maintain liabilities:",sg="Is authorized:",ug="Is clawback enabled:",cg="Limit:",lg="Liquidity Pool ID:",fg="Loading...",pg="Logout",dg="Low Threshold:",hg="Master Weight:",yg="Max Amount A:",vg="Max Amount B:",mg="Max Amount:",gg="Max time:",bg="Maximum Price:",_g="Medium Threshold:",wg="Min Amount A:",Sg="Min Amount B:",Eg="Min time:",Og="Minimum amount of destination asset to be received:",Ag="Minimum Price:",Tg="Name:",xg="Network Fee:",Pg="Network",Ig="Authorization: The account is not authorized to transact with the asset",kg="The recipient hasn't established a trustline with the asset.",Rg="Offer ID:",Cg="Account Merge",Ng="Trust",jg="Begin Sponsoring Future Reserves",Lg="Bump Sequence",Mg="Change Trust",Dg="Claim Claimable Balance",Ug="Clawback Claimable Balance",Fg="Clawback",Bg="Create Account",$g="Create Claimable Balance",Vg="Create Passive Sell Offer",qg="End Sponsoring Future Reserves",zg="Extend footprint TTL",Kg="Invoke Host Function",Hg="Liquidity Pool Deposit",Wg="Liquidity Pool Withdraw",Gg="Manage Buy Offer",Yg="Manage Data",Xg="Manage Sell Offer",Qg="Path Payment Strict Receive",Jg="Path Payment Strict Send",Zg="Payment",e1="Restore footprint",t1="Revoke Account Sponsorship",r1="Revoke Claimable Balance Sponsorship",n1="Revoke Data Sponsorship",o1="Revoke Liquidity Pool Sponsorship",i1="Revoke Offer Sponsorship",a1="Revoke Signer Sponsorship",s1="Revoke Trustline Sponsorship",u1="Set Options",c1="Set Trustline Flags",l1="Operation type",f1="Operation:",p1="Operations list",d1="Path:",h1="Pay",y1="preAuthTx:",v1="Price:",m1="Private Key",g1="Select Wallet",b1="Seller:",_1="Selling Asset:",w1="Selling:",S1="Sequence Number:",E1="Set Flags:",O1="sha256Hash:",A1="Show key",T1="Sign Transaction with",x1="Sign",P1="Signature:",I1="Signatures:",k1="Signer:",R1="Source Account:",C1="es",N1="Spanish",j1="Sponsored ID:",L1="Starting Balance:",M1="The payment was successful!",D1="Time Bounds:",U1="to the account",F1="Transaction:",B1="Trustor:",$1="User is not connected",V1="This transaction is asking to add another signer to your account, which could lead to them taking over your funds. Please evaluate it carefully.",q1="Weight:",z1="Sorry, the XDR is invalid",K1="Sorry, an XDR wasn't provided",H1="You are paying",W1="Your Account";var sS={ACCOUNT:c0,ALLOW_TRUST:l0,AMOUNT:f0,ASSET_A:p0,ASSET_B:d0,ASSET_TO_PAY:h0,ASSET:y0,AUTHORIZATION:v0,AUTHORIZED_TO_MAINTAIN_ORDERS:m0,AUTHORIZED_TO_TRANSACT:g0,BALANCE_ID:b0,BUMP_TO:_0,BUY_AMOUNT:w0,BUYING_ASSET:S0,BUYING:E0,CANCEL:O0,CLAIMANTS:A0,CLEAR_FLAGS:T0,CLOSE:x0,CONFIRM:P0,CONNECT_WITH_PRIVATE_KEY:I0,DATA:k0,DESCRIPTION:R0,DESTINATION_ASSET:C0,DESTINATION_INFLATION:N0,DESTINATION:j0,DISALLOW_TRUST:L0,ED5519PUBPCKEY:M0,ENGLISH_ISO:D0,ENGLISH:U0,ERROR:F0,ERROR_MISSING_RECEIVER_DATA:B0,EXPAND_ALL:$0,EXTEND_TO:V0,FAILED_PAYMENT:q0,FEE_BUMP_DESCRIPTION_1:z0,FEE_BUMP_DESCRIPTION_2:K0,FEE_BUMP:H0,FEE:W0,FROM:G0,FUNCTION_TYPE:Y0,GO_TO_CONNECT:X0,GO_TO_SIGN:Q0,GO_TO_PAYMENT:J0,HIDE_ALL:Z0,HIDE_KEY:eg,HIGH_THRESHOLD:tg,HINT:rg,HOME_DOMAIN:ng,INSTALL:og,INVALID_KEY:ig,IS_AUTHORIZED_TO_MAINTAIN_LIABILITIES:ag,IS_AUTHORIZED:sg,IS_CLAWBACK_ENABLED:ug,LIMIT:cg,LIQUIDITY_POOL_ID:lg,LOADING:fg,LOGOUT:pg,LOW_THRESHOLD:dg,MASTER_WEIGHT:hg,MAX_AMOUNT_A:yg,MAX_AMOUNT_B:vg,MAX_AMOUNT:mg,MAX_TIME:gg,MAXIMUM_PRICE:bg,MEDIUM_THRESHOLD:_g,MIN_AMOUNT_A:wg,MIN_AMOUNT_B:Sg,MIN_TIME:Eg,MINIMUM_AMOUNT_DESTINATION_ASSET:Og,MINIMUM_PRICE:Ag,NAME:Tg,NETWORK_FEE:xg,NETWORK:Pg,NOT_AUTHORIZED_TO_TRANSACT:Ig,NO_TRUSTLINE:kg,OFFER_ID:Rg,OPERATION_ACCOUNT_MERGE:Cg,OPERATION_ACCOUNT_TRUST:Ng,OPERATION_BEGIN_SPONSORING_FUTURE_RESERVES:jg,OPERATION_BUMP_SEQUENCE:Lg,OPERATION_CHANGE_TRUST:Mg,OPERATION_CLAIM_CLAIMABLE_BALANCE:Dg,OPERATION_CLAWBACK_CLAIMABLE_BALANCE:Ug,OPERATION_CLAWBACK:Fg,OPERATION_CREATE_ACCOUNT:Bg,OPERATION_CREATE_CLAIMABLE_BALANCE:$g,OPERATION_CREATE_PASSIVE_SELL_OFFER:Vg,OPERATION_END_SPONSORING_FUTURE_RESERVES:qg,OPERATION_EXTEND_FOOTPRINT_TTL:zg,OPERATION_INVOKE_HOST_FUNCTION:Kg,OPERATION_LIQUIDITY_POOL_DEPOSIT:Hg,OPERATION_LIQUIDITY_POOL_WITHDRAW:Wg,OPERATION_MANAGE_BUY_OFFER:Gg,OPERATION_MANAGE_DATA:Yg,OPERATION_MANAGE_SELL_OFFER:Xg,OPERATION_PATH_PAYMENT_STRICT_RECEIVE:Qg,OPERATION_PATH_PAYMENT_STRICT_SEND:Jg,OPERATION_PAYMENT:Zg,OPERATION_RESTORE_FOOTPRINT:e1,OPERATION_REVOKE_ACCOUNT_SPONSORSHIP:t1,OPERATION_REVOKE_CLAIMABLE_BALANCE_SPONSORSHIP:r1,OPERATION_REVOKE_DATA_SPONSORSHIP:n1,OPERATION_REVOKE_LIQUIDITY_POOL_SPONSORSHIP:o1,OPERATION_REVOKE_OFFER_SPONSORSHIP:i1,OPERATION_REVOKE_SIGNER_SPONSORSHIP:a1,OPERATION_REVOKE_TRUSTLINE_SPONSORSHIP:s1,OPERATION_SET_OPTIONS:u1,OPERATION_SET_TRUSTLINE_FLAGS:c1,OPERATION_TYPE:l1,OPERATION:f1,OPERATIONS_LIST:p1,PATH:d1,PAY:h1,PREAUTH_TX:y1,PRICE:v1,PRIVATE_KEY:m1,SELECT_WALLET:g1,SELLER:b1,SELLING_ASSET:_1,SELLING:w1,SEQUENCE_NUMBER:S1,SET_FLAGS:E1,SHA256HASH:O1,SHOW_KEY:A1,SIGN_TRANSACTION:T1,SIGN:x1,SIGNATURE:P1,SIGNATURES:I1,SIGNER:k1,SOURCE_ACCOUNT:R1,SPANISH_ISO:C1,SPANISH:N1,SPONSORED_ID:j1,STARTING_BALANCE:L1,SUCCESSFUL_PAYMENT:M1,TIME_BOUNDS:D1,TO_THE_ACCOUNT:U1,TRANSACTION:F1,TRUSTOR:B1,USER_IS_NOT_CONNECTED:$1,WARNING_TX_DESCRIPTION:V1,WEIGHT:q1,XDR_INVALID:z1,XDR_NOT_PROVIDED:K1,YOU_ARE_PAYING:H1,YOUR_ACCOUNT:W1},uS=Object.freeze(Object.defineProperty({__proto__:null,ACCOUNT:c0,ALLOW_TRUST:l0,AMOUNT:f0,ASSET_A:p0,ASSET_B:d0,ASSET_TO_PAY:h0,ASSET:y0,AUTHORIZATION:v0,AUTHORIZED_TO_MAINTAIN_ORDERS:m0,AUTHORIZED_TO_TRANSACT:g0,BALANCE_ID:b0,BUMP_TO:_0,BUY_AMOUNT:w0,BUYING_ASSET:S0,BUYING:E0,CANCEL:O0,CLAIMANTS:A0,CLEAR_FLAGS:T0,CLOSE:x0,CONFIRM:P0,CONNECT_WITH_PRIVATE_KEY:I0,DATA:k0,DESCRIPTION:R0,DESTINATION_ASSET:C0,DESTINATION_INFLATION:N0,DESTINATION:j0,DISALLOW_TRUST:L0,ED5519PUBPCKEY:M0,ENGLISH_ISO:D0,ENGLISH:U0,ERROR:F0,ERROR_MISSING_RECEIVER_DATA:B0,EXPAND_ALL:$0,EXTEND_TO:V0,FAILED_PAYMENT:q0,FEE_BUMP_DESCRIPTION_1:z0,FEE_BUMP_DESCRIPTION_2:K0,FEE_BUMP:H0,FEE:W0,FROM:G0,FUNCTION_TYPE:Y0,GO_TO_CONNECT:X0,GO_TO_SIGN:Q0,GO_TO_PAYMENT:J0,HIDE_ALL:Z0,HIDE_KEY:eg,HIGH_THRESHOLD:tg,HINT:rg,HOME_DOMAIN:ng,INSTALL:og,INVALID_KEY:ig,IS_AUTHORIZED_TO_MAINTAIN_LIABILITIES:ag,IS_AUTHORIZED:sg,IS_CLAWBACK_ENABLED:ug,LIMIT:cg,LIQUIDITY_POOL_ID:lg,LOADING:fg,LOGOUT:pg,LOW_THRESHOLD:dg,MASTER_WEIGHT:hg,MAX_AMOUNT_A:yg,MAX_AMOUNT_B:vg,MAX_AMOUNT:mg,MAX_TIME:gg,MAXIMUM_PRICE:bg,MEDIUM_THRESHOLD:_g,MIN_AMOUNT_A:wg,MIN_AMOUNT_B:Sg,MIN_TIME:Eg,MINIMUM_AMOUNT_DESTINATION_ASSET:Og,MINIMUM_PRICE:Ag,NAME:Tg,NETWORK_FEE:xg,NETWORK:Pg,NOT_AUTHORIZED_TO_TRANSACT:Ig,NO_TRUSTLINE:kg,OFFER_ID:Rg,OPERATION_ACCOUNT_MERGE:Cg,OPERATION_ACCOUNT_TRUST:Ng,OPERATION_BEGIN_SPONSORING_FUTURE_RESERVES:jg,OPERATION_BUMP_SEQUENCE:Lg,OPERATION_CHANGE_TRUST:Mg,OPERATION_CLAIM_CLAIMABLE_BALANCE:Dg,OPERATION_CLAWBACK_CLAIMABLE_BALANCE:Ug,OPERATION_CLAWBACK:Fg,OPERATION_CREATE_ACCOUNT:Bg,OPERATION_CREATE_CLAIMABLE_BALANCE:$g,OPERATION_CREATE_PASSIVE_SELL_OFFER:Vg,OPERATION_END_SPONSORING_FUTURE_RESERVES:qg,OPERATION_EXTEND_FOOTPRINT_TTL:zg,OPERATION_INVOKE_HOST_FUNCTION:Kg,OPERATION_LIQUIDITY_POOL_DEPOSIT:Hg,OPERATION_LIQUIDITY_POOL_WITHDRAW:Wg,OPERATION_MANAGE_BUY_OFFER:Gg,OPERATION_MANAGE_DATA:Yg,OPERATION_MANAGE_SELL_OFFER:Xg,OPERATION_PATH_PAYMENT_STRICT_RECEIVE:Qg,OPERATION_PATH_PAYMENT_STRICT_SEND:Jg,OPERATION_PAYMENT:Zg,OPERATION_RESTORE_FOOTPRINT:e1,OPERATION_REVOKE_ACCOUNT_SPONSORSHIP:t1,OPERATION_REVOKE_CLAIMABLE_BALANCE_SPONSORSHIP:r1,OPERATION_REVOKE_DATA_SPONSORSHIP:n1,OPERATION_REVOKE_LIQUIDITY_POOL_SPONSORSHIP:o1,OPERATION_REVOKE_OFFER_SPONSORSHIP:i1,OPERATION_REVOKE_SIGNER_SPONSORSHIP:a1,OPERATION_REVOKE_TRUSTLINE_SPONSORSHIP:s1,OPERATION_SET_OPTIONS:u1,OPERATION_SET_TRUSTLINE_FLAGS:c1,OPERATION_TYPE:l1,OPERATION:f1,OPERATIONS_LIST:p1,PATH:d1,PAY:h1,PREAUTH_TX:y1,PRICE:v1,PRIVATE_KEY:m1,SELECT_WALLET:g1,SELLER:b1,SELLING_ASSET:_1,SELLING:w1,SEQUENCE_NUMBER:S1,SET_FLAGS:E1,SHA256HASH:O1,SHOW_KEY:A1,SIGN_TRANSACTION:T1,SIGN:x1,SIGNATURE:P1,SIGNATURES:I1,SIGNER:k1,SOURCE_ACCOUNT:R1,SPANISH_ISO:C1,SPANISH:N1,SPONSORED_ID:j1,STARTING_BALANCE:L1,SUCCESSFUL_PAYMENT:M1,TIME_BOUNDS:D1,TO_THE_ACCOUNT:U1,TRANSACTION:F1,TRUSTOR:B1,USER_IS_NOT_CONNECTED:$1,WARNING_TX_DESCRIPTION:V1,WEIGHT:q1,XDR_INVALID:z1,XDR_NOT_PROVIDED:K1,YOU_ARE_PAYING:H1,YOUR_ACCOUNT:W1,default:sS},Symbol.toStringTag,{value:"Module"}));class cS{async create(e){let r;switch(e){case u0.SPANISH:r=(await s0(()=>import("./spanish.24416b4e.js"),[])).default;break;default:r=uS;break}return r}}class G1{getLanguage(){const e="en";return(navigator.languages&&navigator.languages[0]&&navigator.language||e).substr(0,2)}async getText(e){return await new cS().create(e||this.getLanguage())}}const Y1=new G1,go=Sn({}),X1=Sn(Y1.getLanguage()),Q1=Sn(!0),Na=Sn(!1),dh=Sn();Y1.getText().then(t=>{go.set(t),Q1.set(!1)});class Es{clearStorage(e){e?window.localStorage.removeItem(e):window.localStorage.clear()}getItem(e){return window.localStorage.getItem(e)}storeItem(e,r){return window.localStorage.setItem(e,r)}}function lS(t,e){function r(n){t.contains(n.target)||e()}return document.body.addEventListener("click",r),{update(n){e=n},destroy(){document.body.removeEventListener("click",r)}}}const ja=Sn(!1);function fS(t){let e,r,n,i;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),Ve(r,"d","M0 0h24v24H0z"),Ve(r,"fill","none"),Ve(n,"d","M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"height","21px"),Ve(e,"viewBox","0 0 24 24"),Ve(e,"width","21px"),Ve(e,"class",i="simple-signer language-icon "+(t[0]?"active":"inactive")+" svelte-1nbczl1")},m(a,s){Gt(a,e,s),nt(e,r),nt(e,n)},p(a,[s]){s&1&&i!==(i="simple-signer language-icon "+(a[0]?"active":"inactive")+" svelte-1nbczl1")&&Ve(e,"class",i)},i:wr,o:wr,d(a){a&&Wt(e)}}}function pS(t,e,r){let{isActive:n}=e;return t.$$set=i=>{"isActive"in i&&r(0,n=i.isActive)},[n]}class dS extends yn{constructor(e){super(),hn(this,e,pS,fS,ln,{isActive:0})}}const hS=new G1;async function yS(t){const e=await hS.getText(t);go.set(e)}function hh(t,e,r){const n=t.slice();return n[6]=e[r],n}function yh(t){let e,r,n,i,a=t[6].text+"",s,u,c,f,l;return{c(){e=Ct("label"),r=Ct("input"),i=pr(),s=hr(a),u=pr(),Ve(r,"class","simple-signer hide-circle svelte-1flk32j"),r.__value=n=t[6].iso,r.value=r.__value,Ve(r,"type","radio"),Ve(r,"name","language"),t[3][0].push(r),Ve(e,"class",c="simple-signer language "+(t[1]===t[6].iso?"active":"default")+" svelte-1flk32j")},m(o,w){Gt(o,e,w),nt(e,r),r.checked=r.__value===t[1],nt(e,i),nt(e,s),nt(e,u),f||(l=[Cn(r,"change",t[2]),Cn(e,"change",t[4])],f=!0)},p(o,w){w&1&&n!==(n=o[6].iso)&&(r.__value=n,r.value=r.__value),w&2&&(r.checked=r.__value===o[1]),w&1&&a!==(a=o[6].text+"")&&br(s,a),w&3&&c!==(c="simple-signer language "+(o[1]===o[6].iso?"active":"default")+" svelte-1flk32j")&&Ve(e,"class",c)},d(o){o&&Wt(e),t[3][0].splice(t[3][0].indexOf(r),1),f=!1,ri(l)}}}function vS(t){let e,r=t[0],n=[];for(let i=0;ir(5,n=f));let i=n,{languageInputsProps:a}=e;const s=[[]];function u(){i=this.__value,r(1,i)}const c=()=>yS(i);return t.$$set=f=>{"languageInputsProps"in f&&r(0,a=f.languageInputsProps)},[a,i,u,s,c]}class gS extends yn{constructor(e){super(),hn(this,e,mS,vS,ln,{languageInputsProps:0})}}function bS(t){let e,r,n,i,a,s,u,c,f,l,o,w;return i=new dS({props:{isActive:t[0]}}),u=new gS({props:{languageInputsProps:[{iso:t[1].SPANISH_ISO,text:t[1].SPANISH},{iso:t[1].ENGLISH_ISO,text:t[1].ENGLISH}]}}),{c(){e=Ct("div"),r=Ct("div"),n=Ct("button"),Xr(i.$$.fragment),a=pr(),s=Ct("div"),Xr(u.$$.fragment),Ve(n,"class","simple-signer invisible-button svelte-1lj29ho"),Ve(s,"class",c="simple-signer language-selector-container "+(t[0]?"":"hidden")+" svelte-1lj29ho"),Ve(r,"class",f="simple-signer language-container-icon "+(t[0]&&"active")+" svelte-1lj29ho"),Ve(e,"class","simple-signer language-container svelte-1lj29ho")},m(p,d){Gt(p,e,d),nt(e,r),nt(r,n),Gr(i,n,null),nt(r,a),nt(r,s),Gr(u,s,null),l=!0,o||(w=Cn(n,"click",t[2]),o=!0)},p(p,[d]){const S={};d&1&&(S.isActive=p[0]),i.$set(S);const v={};d&2&&(v.languageInputsProps=[{iso:p[1].SPANISH_ISO,text:p[1].SPANISH},{iso:p[1].ENGLISH_ISO,text:p[1].ENGLISH}]),u.$set(v),(!l||d&1&&c!==(c="simple-signer language-selector-container "+(p[0]?"":"hidden")+" svelte-1lj29ho"))&&Ve(s,"class",c),(!l||d&1&&f!==(f="simple-signer language-container-icon "+(p[0]&&"active")+" svelte-1lj29ho"))&&Ve(r,"class",f)},i(p){l||(dr(i.$$.fragment,p),dr(u.$$.fragment,p),l=!0)},o(p){mr(i.$$.fragment,p),mr(u.$$.fragment,p),l=!1},d(p){p&&Wt(e),Yr(i),Yr(u),o=!1,w()}}}function _S(t,e,r){let n,i,a;Ur(t,Na,u=>r(3,n=u)),Ur(t,ja,u=>r(0,i=u)),Ur(t,go,u=>r(1,a=u));function s(){dn(ja,i=!i,i),dn(Na,n=!1,n)}return[i,a,s]}class wS extends yn{constructor(e){super(),hn(this,e,_S,bS,ln,{})}}function SS(t){let e,r,n,i;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),Ve(r,"d","M0 0h24v24H0z"),Ve(r,"fill","none"),Ve(n,"d","M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"height","21px"),Ve(e,"viewBox","0 0 24 24"),Ve(e,"width","21px"),Ve(e,"class",i="simple-signer icon "+(t[0]?"active":"inactive")+" svelte-ea2dfr")},m(a,s){Gt(a,e,s),nt(e,r),nt(e,n)},p(a,[s]){s&1&&i!==(i="simple-signer icon "+(a[0]?"active":"inactive")+" svelte-ea2dfr")&&Ve(e,"class",i)},i:wr,o:wr,d(a){a&&Wt(e)}}}function ES(t,e,r){let{isActive:n}=e;return t.$$set=i=>{"isActive"in i&&r(0,n=i.isActive)},[n]}class OS extends yn{constructor(e){super(),hn(this,e,ES,SS,ln,{isActive:0})}}function AS(t){let e,r,n,i=t[1].LOGOUT+"",a,s,u;return{c(){e=Ct("label"),r=Ct("input"),n=pr(),a=hr(i),Ve(r,"class","simple-signer hide-circle svelte-3egqvj"),Ve(r,"type","radio"),Ve(r,"name","logout"),Ve(e,"class","simple-signer logout-active svelte-3egqvj")},m(c,f){Gt(c,e,f),nt(e,r),nt(e,n),nt(e,a),s||(u=Cn(e,"click",t[6]),s=!0)},p(c,f){f&2&&i!==(i=c[1].LOGOUT+"")&&br(a,i)},d(c){c&&Wt(e),s=!1,u()}}}function TS(t){let e,r,n,i,a,s,u,c,f,l,o,w;return i=new OS({props:{isActive:t[0]}}),u=new xa({props:{to:"/connect",$$slots:{default:[AS]},$$scope:{ctx:t}}}),{c(){e=Ct("div"),r=Ct("div"),n=Ct("button"),Xr(i.$$.fragment),a=pr(),s=Ct("div"),Xr(u.$$.fragment),Ve(n,"class","simple-signer logout-button svelte-3egqvj"),Ve(s,"class",c="simple-signer logout-selector-container "+(t[0]?"":"hidden")+" svelte-3egqvj"),Ve(r,"class",f="simple-signer logout-container-icon "+(t[0]&&"active")+" svelte-3egqvj"),Ve(e,"class","simple-signer logout-container svelte-3egqvj")},m(p,d){Gt(p,e,d),nt(e,r),nt(r,n),Gr(i,n,null),nt(r,a),nt(r,s),Gr(u,s,null),l=!0,o||(w=Cn(n,"click",t[2]),o=!0)},p(p,[d]){const S={};d&1&&(S.isActive=p[0]),i.$set(S);const v={};d&258&&(v.$$scope={dirty:d,ctx:p}),u.$set(v),(!l||d&1&&c!==(c="simple-signer logout-selector-container "+(p[0]?"":"hidden")+" svelte-3egqvj"))&&Ve(s,"class",c),(!l||d&1&&f!==(f="simple-signer logout-container-icon "+(p[0]&&"active")+" svelte-3egqvj"))&&Ve(r,"class",f)},i(p){l||(dr(i.$$.fragment,p),dr(u.$$.fragment,p),l=!0)},o(p){mr(i.$$.fragment,p),mr(u.$$.fragment,p),l=!1},d(p){p&&Wt(e),Yr(i),Yr(u),o=!1,w()}}}function xS(t,e,r){let n,i,a;Ur(t,ja,o=>r(7,n=o)),Ur(t,Na,o=>r(0,i=o)),Ur(t,go,o=>r(1,a=o));let{storage:s}=e,{walletConnectService:u}=e;function c(){dn(Na,i=!i,i),dn(ja,n=!1,n)}async function f(){u.disconnectAllSessions(),s.clearStorage()}const l=async()=>await f();return t.$$set=o=>{"storage"in o&&r(4,s=o.storage),"walletConnectService"in o&&r(5,u=o.walletConnectService)},[i,a,c,f,s,u,l]}class PS extends yn{constructor(e){super(),hn(this,e,xS,TS,ln,{storage:4,walletConnectService:5})}}function IS(t){let e,r;return e=new PS({props:{storage:t[1],walletConnectService:t[0]}}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function kS(t){let e,r,n,i,a,s,u,c,f,l,o=t[2]&&IS(t);return u=new wS({}),{c(){e=Ct("header"),r=Ct("div"),n=Ct("div"),o&&o.c(),i=pr(),a=Ct("div"),s=Ct("div"),Xr(u.$$.fragment),Ve(n,"class","simple-signer logout-container"),Ve(s,"class","simple-signer column-center svelte-1rd4vjy"),Ve(a,"class","simple-signer language-container"),Ve(r,"class","simple-signer logout-language-container row-space-between-center svelte-1rd4vjy"),Ve(e,"class","simple-signer header row-space-between-center header-border svelte-1rd4vjy")},m(w,p){Gt(w,e,p),nt(e,r),nt(r,n),o&&o.m(n,null),nt(r,i),nt(r,a),nt(a,s),Gr(u,s,null),c=!0,f||(l=Gw(lS.call(null,r,t[3])),f=!0)},p(w,[p]){w[2]&&o.p(w,p)},i(w){c||(dr(o),dr(u.$$.fragment,w),c=!0)},o(w){mr(o),mr(u.$$.fragment,w),c=!1},d(w){w&&Wt(e),o&&o.d(),Yr(u),f=!1,l()}}}function RS(t,e,r){let n,i;Ur(t,Na,f=>r(4,n=f)),Ur(t,ja,f=>r(5,i=f));let{walletConnectService:a}=e;const s=new Es,u=s.getItem("wallet");function c(){dn(ja,i=!1,i),dn(Na,n=!1,n)}return t.$$set=f=>{"walletConnectService"in f&&r(0,a=f.walletConnectService)},[a,s,u,c]}class CS extends yn{constructor(e){super(),hn(this,e,RS,kS,ln,{walletConnectService:0})}}const{VITE_PROJECT_ID_FOR_WALLET_CONNECT:NS,VITE_DAPP_BASE_URL:jS,VITE_HORIZON_NETWORK_PASSPHRASE:LS,VITE_STELLAR_NETWORK:MS,VITE_HORIZON_URL:DS}={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0};class Ou extends Error{}class US extends Error{}class vh extends Error{}class FS extends Error{}class BS extends Error{}class $S extends Error{}var Kn=(t=>(t.PUBLIC="public",t.TESTNET="testnet",t.FUTURENET="futurenet",t))(Kn||{});const J1=LS,Ti=MS,VS=Symbol(),mh=Object.getPrototypeOf,gp=new WeakMap,qS=t=>t&&(gp.has(t)?gp.get(t):mh(t)===Object.prototype||mh(t)===Array.prototype),zS=t=>qS(t)&&t[VS]||null,gh=(t,e=!0)=>{gp.set(t,e)},Vf=t=>typeof t=="object"&&t!==null,bi=new WeakMap,Au=new WeakSet,KS=(t=Object.is,e=(l,o)=>new Proxy(l,o),r=l=>Vf(l)&&!Au.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>l.configurable&&l.enumerable&&l.writable,i=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},a=new WeakMap,s=(l,o,w=i)=>{const p=a.get(l);if(p?.[0]===o)return p[1];const d=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return gh(d,!0),a.set(l,[o,d]),Reflect.ownKeys(l).forEach(S=>{if(Object.getOwnPropertyDescriptor(d,S))return;const v=Reflect.get(l,S),O={value:v,enumerable:!0,configurable:!0};if(Au.has(v))gh(v,!1);else if(v instanceof Promise)delete O.value,O.get=()=>w(v);else if(bi.has(v)){const[h,g]=bi.get(v);O.value=s(h,g(),w)}Object.defineProperty(d,S,O)}),Object.preventExtensions(d)},u=new WeakMap,c=[1,1],f=l=>{if(!Vf(l))throw new Error("object required");const o=u.get(l);if(o)return o;let w=c[0];const p=new Set,d=(T,I=++c[0])=>{w!==I&&(w=I,p.forEach(k=>k(T,I)))};let S=c[1];const v=(T=++c[1])=>(S!==T&&!p.size&&(S=T,h.forEach(([I])=>{const k=I[1](T);k>w&&(w=k)})),w),O=T=>(I,k)=>{const N=[...I];N[1]=[T,...N[1]],d(N,k)},h=new Map,g=(T,I)=>{if(p.size){const k=I[3](O(T));h.set(T,[I,k])}else h.set(T,[I])},A=T=>{var I;const k=h.get(T);k&&(h.delete(T),(I=k[1])==null||I.call(k))},m=T=>(p.add(T),p.size===1&&h.forEach(([k,N],C)=>{const D=k[3](O(C));h.set(C,[k,D])}),()=>{p.delete(T),p.size===0&&h.forEach(([k,N],C)=>{N&&(N(),h.set(C,[k]))})}),x=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),y=(T,I,k,N,C)=>{if(T&&(t(I,N)||u.has(N)&&t(I,u.get(N))))return;A(k),Vf(N)&&(N=zS(N)||N);let D=N;if(N instanceof Promise)N.then(X=>{N.status="fulfilled",N.value=X,d(["resolve",[k],X])}).catch(X=>{N.status="rejected",N.reason=X,d(["reject",[k],X])});else{!bi.has(N)&&r(N)&&(D=f(N));const X=!Au.has(D)&&bi.get(D);X&&g(k,X)}C(D),d(["set",[k],N,I])},L=e(x,{deleteProperty(T,I){const k=Reflect.get(T,I);A(I);const N=Reflect.deleteProperty(T,I);return N&&d(["delete",[I],k]),N},set(T,I,k,N){const C=Reflect.has(T,I),D=Reflect.get(T,I,N);return y(C,D,I,k,X=>{Reflect.set(T,I,X,N)}),!0},defineProperty(T,I,k){if(n(k)){const N=Reflect.getOwnPropertyDescriptor(T,I);if(!N||n(N))return y(!!N&&"value"in N,N?.value,I,k.value,C=>{Reflect.defineProperty(T,I,{...k,value:C})}),!0}return Reflect.defineProperty(T,I,k)}});u.set(l,L);const b=[x,v,s,m];return bi.set(L,b),Reflect.ownKeys(l).forEach(T=>{const I=Object.getOwnPropertyDescriptor(l,T);"value"in I&&(L[T]=l[T],delete I.value,delete I.writable),Object.defineProperty(x,T,I)}),L})=>[f,bi,Au,t,e,r,n,i,a,s,u,c],[HS]=KS();function Ci(t={}){return HS(t)}function ia(t,e,r){const n=bi.get(t);let i;const a=[],s=n[3];let u=!1;const f=s(l=>{if(a.push(l),r){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(a.splice(0))}))});return u=!0,()=>{u=!1,f()}}function WS(t,e){const r=bi.get(t),[n,i,a]=r;return a(n,i(),e)}const Gn=Ci({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Z1={state:Gn,subscribe(t){return ia(Gn,()=>t(Gn))},push(t,e){t!==Gn.view&&(Gn.view=t,e&&(Gn.data=e),Gn.history.push(t))},reset(t){Gn.view=t,Gn.history=[t]},replace(t){Gn.history.length>1&&(Gn.history[Gn.history.length-1]=t,Gn.view=t)},goBack(){if(Gn.history.length>1){Gn.history.pop();const[t]=Gn.history.slice(-1);Gn.view=t}},setData(t){Gn.data=t}},ao={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return ao.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return ao.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(ao.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!ao.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(ao.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(ao.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(ao.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(ao.WCM_VERSION,"2.6.1")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=Z1.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},GS=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),oo=Ci({enabled:GS,userSessionId:"",events:[],connectedWalletId:void 0}),YS={state:oo,subscribe(t){return ia(oo.events,()=>t(WS(oo.events[oo.events.length-1])))},initialize(){oo.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(oo.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){oo.connectedWalletId=t},click(t){if(oo.enabled){const e={type:"CLICK",name:t.name,userSessionId:oo.userSessionId,timestamp:Date.now(),data:t};oo.events.push(e)}},track(t){if(oo.enabled){const e={type:"TRACK",name:t.name,userSessionId:oo.userSessionId,timestamp:Date.now(),data:t};oo.events.push(e)}},view(t){if(oo.enabled){const e={type:"VIEW",name:t.name,userSessionId:oo.userSessionId,timestamp:Date.now(),data:t};oo.events.push(e)}}},Ho=Ci({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Uo={state:Ho,subscribe(t){return ia(Ho,()=>t(Ho))},setChains(t){Ho.chains=t},setWalletConnectUri(t){Ho.walletConnectUri=t},setIsCustomDesktop(t){Ho.isCustomDesktop=t},setIsCustomMobile(t){Ho.isCustomMobile=t},setIsDataLoaded(t){Ho.isDataLoaded=t},setIsUiLoaded(t){Ho.isUiLoaded=t},setIsAuth(t){Ho.isAuth=t}},Tu=Ci({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),La={state:Tu,subscribe(t){return ia(Tu,()=>t(Tu))},setConfig(t){var e,r;YS.initialize(),Uo.setChains(t.chains),Uo.setIsAuth(Boolean(t.enableAuthMode)),Uo.setIsCustomMobile(Boolean((e=t.mobileWallets)==null?void 0:e.length)),Uo.setIsCustomDesktop(Boolean((r=t.desktopWallets)==null?void 0:r.length)),ao.setModalVersionInStorage(),Object.assign(Tu,t)}};var XS=Object.defineProperty,bh=Object.getOwnPropertySymbols,QS=Object.prototype.hasOwnProperty,JS=Object.prototype.propertyIsEnumerable,_h=(t,e,r)=>e in t?XS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ZS=(t,e)=>{for(var r in e||(e={}))QS.call(e,r)&&_h(t,r,e[r]);if(bh)for(var r of bh(e))JS.call(e,r)&&_h(t,r,e[r]);return t};const bp="https://explorer-api.walletconnect.com",_p="wcm",wp="js-2.6.1";async function xu(t,e){const r=ZS({sdkType:_p,sdkVersion:wp},e),n=new URL(t,bp);return n.searchParams.append("projectId",La.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Bi={async getDesktopListings(t){return xu("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return xu("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return xu("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return xu("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${bp}/w3m/v1/getWalletImage/${t}?projectId=${La.state.projectId}&sdkType=${_p}&sdkVersion=${wp}`},getAssetImageUrl(t){return`${bp}/w3m/v1/getAssetImage/${t}?projectId=${La.state.projectId}&sdkType=${_p}&sdkVersion=${wp}`}};var eE=Object.defineProperty,wh=Object.getOwnPropertySymbols,tE=Object.prototype.hasOwnProperty,rE=Object.prototype.propertyIsEnumerable,Sh=(t,e,r)=>e in t?eE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,nE=(t,e)=>{for(var r in e||(e={}))tE.call(e,r)&&Sh(t,r,e[r]);if(wh)for(var r of wh(e))rE.call(e,r)&&Sh(t,r,e[r]);return t};const Eh=ao.isMobile(),Wo=Ci({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),v$={state:Wo,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=La.state;if(t==="NONE"||e==="ALL"&&!t)return Wo.recomendedWallets;if(ao.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await Bi.getAllListings(r),i=Object.values(n);i.sort((a,s)=>{const u=t.indexOf(a.id),c=t.indexOf(s.id);return u-c}),Wo.recomendedWallets=i}else{const{chains:r,isAuth:n}=Uo.state,i=r?.join(","),a=ao.isArray(e),s={page:1,sdks:n?"auth_v1":void 0,entries:ao.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:u}=Eh?await Bi.getMobileListings(s):await Bi.getDesktopListings(s);Wo.recomendedWallets=Object.values(u)}return Wo.recomendedWallets},async getWallets(t){const e=nE({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=La.state,{recomendedWallets:i}=Wo;if(n==="ALL")return Wo.wallets;i.length?e.excludedIds=i.map(o=>o.id).join(","):ao.isArray(r)&&(e.excludedIds=r.join(",")),ao.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Uo.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:s}=t,{listings:u,total:c}=Eh?await Bi.getMobileListings(e):await Bi.getDesktopListings(e),f=Object.values(u),l=s?"search":"wallets";return Wo[l]={listings:[...Wo[l].listings,...f],total:c,page:a??1},{listings:f,total:c}},getWalletImageUrl(t){return Bi.getWalletImageUrl(t)},getAssetImageUrl(t){return Bi.getAssetImageUrl(t)},resetSearch(){Wo.search={listings:[],total:0,page:1}}},wa=Ci({open:!1}),qf={state:wa,subscribe(t){return ia(wa,()=>t(wa))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Uo.state;if(ao.removeWalletConnectDeepLink(),Uo.setWalletConnectUri(t?.uri),Uo.setChains(t?.chains),Z1.reset("ConnectWallet"),r&&n)wa.open=!0,e();else{const i=setInterval(()=>{const a=Uo.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),wa.open=!0,e())},200)}})},close(){wa.open=!1}};var oE=Object.defineProperty,Oh=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,aE=Object.prototype.propertyIsEnumerable,Ah=(t,e,r)=>e in t?oE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sE=(t,e)=>{for(var r in e||(e={}))iE.call(e,r)&&Ah(t,r,e[r]);if(Oh)for(var r of Oh(e))aE.call(e,r)&&Ah(t,r,e[r]);return t};function uE(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const us=Ci({themeMode:uE()?"dark":"light"}),Th={state:us,subscribe(t){return ia(us,()=>t(us))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(us.themeMode=e),r&&(us.themeVariables=sE({},r))}},$i=Ci({open:!1,message:"",variant:"success"}),m$={state:$i,subscribe(t){return ia($i,()=>t($i))},openToast(t,e){$i.open=!0,$i.message=t,$i.variant=e},closeToast(){$i.open=!1}};class cE{constructor(e){this.openModal=qf.open,this.closeModal=qf.close,this.subscribeModal=qf.subscribe,this.setTheme=Th.setThemeConfig,Th.setThemeConfig(e),La.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await s0(()=>import("./index.2a88596f.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Uo.setIsUiLoaded(!0)}}}var Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eb(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),e}function tb(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var So={exports:{}},Pa=typeof Reflect=="object"?Reflect:null,xh=Pa&&typeof Pa.apply=="function"?Pa.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Du;Pa&&typeof Pa.ownKeys=="function"?Du=Pa.ownKeys:Object.getOwnPropertySymbols?Du=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Du=function(e){return Object.getOwnPropertyNames(e)};function lE(t){console&&console.warn&&console.warn(t)}var rb=Number.isNaN||function(e){return e!==e};function En(){En.init.call(this)}So.exports=En;So.exports.once=hE;En.EventEmitter=En;En.prototype._events=void 0;En.prototype._eventsCount=0;En.prototype._maxListeners=void 0;var Ph=10;function ic(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(En,"defaultMaxListeners",{enumerable:!0,get:function(){return Ph},set:function(t){if(typeof t!="number"||t<0||rb(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ph=t}});En.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};En.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||rb(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function nb(t){return t._maxListeners===void 0?En.defaultMaxListeners:t._maxListeners}En.prototype.getMaxListeners=function(){return nb(this)};En.prototype.emit=function(e){for(var r=[],n=1;n0&&(s=r[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=a[e];if(c===void 0)return!1;if(typeof c=="function")xh(c,this,r);else for(var f=c.length,l=ub(c,f),n=0;n0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,lE(u)}return t}En.prototype.addListener=function(e,r){return ob(this,e,r,!1)};En.prototype.on=En.prototype.addListener;En.prototype.prependListener=function(e,r){return ob(this,e,r,!0)};function fE(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ib(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=fE.bind(n);return i.listener=r,n.wrapFn=i,i}En.prototype.once=function(e,r){return ic(r),this.on(e,ib(this,e,r)),this};En.prototype.prependOnceListener=function(e,r){return ic(r),this.prependListener(e,ib(this,e,r)),this};En.prototype.removeListener=function(e,r){var n,i,a,s,u;if(ic(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(a=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){u=n[s].listener,a=s;break}if(a<0)return this;a===0?n.shift():pE(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this};En.prototype.off=En.prototype.removeListener;En.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),s;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function ab(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?dE(i):ub(i,i.length)}En.prototype.listeners=function(e){return ab(this,e,!0)};En.prototype.rawListeners=function(e){return ab(this,e,!1)};En.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):sb.call(t,e)};En.prototype.listenerCount=sb;function sb(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}En.prototype.eventNames=function(){return this._eventsCount>0?Du(this._events):[]};function ub(t,e){for(var r=new Array(e),n=0;n ${u}${a}`}const Xm=t=>(...e)=>t(m2(...e)),Qm=Xm(t=>{throw new Error(t)}),Hu=Xm(console.warn),oh=4,g2=3,b2=2,_2=1,w2=1;function S2(t,e){const r=t.default?0:ei(t.fullPath).reduce((n,i)=>{let a=n;return a+=oh,u2(i)?a+=w2:c2(i)?a+=b2:zm(i)?a-=oh+_2:a+=g2,a},0);return{route:t,score:r,index:e}}function E2(t){return t.map(S2).sort((e,r)=>e.scorer.score?-1:e.index-r.index)}function Jm(t,e){let r,n;const[i]=e.split("?"),a=ei(i),s=a[0]==="",u=E2(t);for(let c=0,f=u.length;c({...l,params:w,uri:O});if(l.default){n=p(e);continue}const d=ei(l.fullPath),S=Math.max(a.length,d.length);let v=0;for(;v{f===".."?c.pop():f!=="."&&c.push(f)}),Uf(`/${c.join("/")}`,n)}function ih(t,e){const{pathname:r,hash:n="",search:i="",state:a}=t,s=ei(e,!0),u=ei(r,!0);for(;s.length;)s[0]!==u[0]&&Qm(Zi,`Invalid state: All locations must begin with the basepath "${e}", found "${r}"`),s.shift(),u.shift();return{pathname:Ps(...u),hash:n,search:i,state:a}}const ah=t=>t.length===1?"":t;function e0(t){const e=t.indexOf("?"),r=t.indexOf("#"),n=e!==-1,i=r!==-1,a=i?ah(t.substr(r)):"",s=i?t.substr(0,r):t,u=n?ah(s.substr(e)):"";return{pathname:n?s.substr(0,e):s,search:u,hash:a}}function A2(t,e,r){return Ps(r,O2(t,e))}function T2(t,e){const r=od(l2(t)),n=ei(r,!0),i=ei(e,!0).slice(0,n.length),a=Zm({fullPath:r},Ps(...i));return a&&a.uri}const Ff="POP",x2="PUSH",P2="REPLACE";function Bf(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function I2(t){let e=[],r=Bf(t),n=Ff;const i=(a=e)=>a.forEach(s=>s({location:r,action:n}));return{get location(){return r},listen(a){e.push(a);const s=()=>{r=Bf(t),n=Ff,i([a])};i([a]);const u=$m(t,"popstate",s);return()=>{u(),e=e.filter(c=>c!==a)}},navigate(a,s){const{state:u={},replace:c=!1}=s||{};if(n=c?P2:x2,Fm(a))s&&Hu(Ym,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Ff,t.history.go(a);else{const f={...u,_key:n2()};try{t.history[c?"replaceState":"pushState"](f,"",a)}catch{t.location[c?"replace":"assign"](a)}}r=Bf(t),i()}}}function $f(t,e){return{...e0(e),state:t}}function k2(t="/"){let e=0,r=[$f(null,t)];return{get entries(){return r},get location(){return r[e]},addEventListener(){},removeEventListener(){},history:{get state(){return r[e].state},pushState(n,i,a){e++,r=r.slice(0,e),r.push($f(n,a))},replaceState(n,i,a){r[e]=$f(n,a)},go(n){const i=e+n;i<0||i>r.length-1||(e=i)}}}}const R2=!!(!Ai&&window.document&&window.document.createElement),C2=!Ai&&window.location.origin==="null",N2=I2(R2&&!C2?window:k2());let pi=null,t0=!0;function j2(t,e){const r=document.querySelectorAll("[data-svnav-router]");for(let n=0;npi.level||t.level===pi.level&&j2(t.routerId,pi.routerId))&&(pi=t)}function M2(){pi=null}function D2(){t0=!1}function sh(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let r;r=$m(t,"blur",()=>{t.removeAttribute(e),r()})}return t.focus(),document.activeElement===t}catch{return!1}}function U2(t,e){return Number(t.dataset.svnavRouteEnd)===e}function F2(t){return/^H[1-6]$/i.test(t.tagName)}function uh(t,e=document){return e.querySelector(t)}function B2(t){let r=uh(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!U2(r,t);){if(F2(r))return r;const n=uh("h1,h2,h3,h4,h5,h6",r);if(n)return n;r=r.nextElementSibling}return null}function $2(t){Promise.resolve(Ra(t.focusElement)).then(e=>{const r=e||B2(t.id);r||Hu(Zi,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,oc),!sh(r)&&sh(document.documentElement)})}const V2=(t,e,r)=>(n,i)=>Jw().then(()=>{if(!pi||t0){D2();return}if(n&&$2(pi.route),t.announcements&&i){const{path:a,fullPath:s,meta:u,params:c,uri:f}=pi.route,l=t.createAnnouncement({path:a,fullPath:s,meta:u,params:c,uri:f},Ra(r));Promise.resolve(l).then(o=>{e.set(o)})}M2()}),q2="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function z2(t){let e,r;return{c(){e=Ct("div"),r=pr(t[0]),Ve(e,"role","status"),Ve(e,"aria-atomic","true"),Ve(e,"aria-live","polite"),Ve(e,"style",q2)},m(n,i){Gt(n,e,i),nt(e,r)},p(n,i){i[0]&1&&br(r,n[0])},d(n){n&&Wt(e)}}}function K2(t){let e,r,n,i,a;const s=t[20].default,u=Zp(s,t,t[19],null);let c=t[2]&&t[4]&&t[1].announcements&&z2(t);return{c(){e=Ct("div"),r=hr(),u&&u.c(),n=hr(),c&&c.c(),i=so(),yo(e,"display","none"),Ve(e,"aria-hidden","true"),Ve(e,"data-svnav-router",t[3])},m(f,l){Gt(f,e,l),Gt(f,r,l),u&&u.m(f,l),Gt(f,n,l),c&&c.m(f,l),Gt(f,i,l),a=!0},p(f,l){u&&u.p&&(!a||l[0]&524288)&&td(u,s,f,f[19],a?ed(s,f[19],l,null):rd(f[19]),null),f[2]&&f[4]&&f[1].announcements&&c.p(f,l)},i(f){a||(dr(u,f),a=!0)},o(f){mr(u,f),a=!1},d(f){f&&Wt(e),f&&Wt(r),u&&u.d(f),f&&Wt(n),c&&c.d(f),f&&Wt(i)}}}const H2=Bm(),ch="/";function W2(t,e,r){let n,i,a,s,u,{$$slots:c={},$$scope:f}=e,{basepath:l=ch}=e,{url:o=null}=e,{history:w=N2}=e,{primary:p=!0}=e,{a11y:d={}}=e;const S={createAnnouncement:K=>`Navigated to ${K.uri}`,announcements:!0,...d},v=l,O=od(l),h=Oi(vp),g=Oi(Ca),A=!h,m=H2(),x=p&&!(g&&!g.manageFocus),y=Sn("");Ur(t,y,K=>r(0,u=K));const _=Sn([]);Ur(t,_,K=>r(18,s=K));const L=Sn(null);Ur(t,L,K=>r(16,i=K));let b=!1;const T=A?0:g.level+1,k=A?Sn((()=>ih(Ai?e0(o):w.location,O))()):h;Ur(t,k,K=>r(15,n=K));const N=Sn(n);Ur(t,N,K=>r(17,a=K));const C=V2(S,y,k),D=K=>z=>z.filter(H=>H.id!==K);function X(K){if(Ai){if(b)return;const z=Zm(K,n.pathname);if(z)return b=!0,z}else _.update(z=>{const H=D(K.id)(z);return H.push(K),H})}function ae(K){_.update(D(K))}return!A&&l!==ch&&Hu(Zi,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:l}),A&&(jm(()=>w.listen(z=>{const H=ih(z.location,O);N.set(n),k.set(H)})),ms(vp,k)),ms(Ca,{activeRoute:L,registerRoute:X,unregisterRoute:ae,manageFocus:x,level:T,id:m,history:A?w:g.history,basepath:A?O:g.basepath}),t.$$set=K=>{"basepath"in K&&r(10,l=K.basepath),"url"in K&&r(11,o=K.url),"history"in K&&r(12,w=K.history),"primary"in K&&r(13,p=K.primary),"a11y"in K&&r(14,d=K.a11y),"$$scope"in K&&r(19,f=K.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&1024&&l!==v&&Hu(Zi,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&294912){const K=Jm(s,n.pathname);L.set(K)}if(t.$$.dirty[0]&163840&&A){const K=!!n.hash,z=!K&&x,H=!K||n.pathname!==a.pathname;C(z,H)}t.$$.dirty[0]&65536&&x&&i&&i.primary&&L2({level:T,routerId:m,route:i})},[u,S,A,m,x,y,_,L,k,N,l,o,w,p,d,n,i,a,s,f,c]}class r0 extends yn{constructor(e){super(),hn(this,e,W2,K2,ln,{basepath:10,url:11,history:12,primary:13,a11y:14},null,[-1,-1])}}function Is(t,e,r=Ca,n=Zi){Oi(r)||Qm(t,a=>`You cannot use ${a} outside of a ${ad(n)}.`,e)}const G2=t=>{const{subscribe:e}=Oi(t);return{subscribe:e}};function n0(){return Is(Hm),G2(vp)}function o0(){const{history:t}=Oi(Ca);return t}function i0(){const t=Oi(Vm);return t?i2(t,e=>e.base):Sn("/")}function a0(){Is(Gm);const t=i0(),{basepath:e}=Oi(Ca);return n=>A2(n,Ra(t),e)}function Y2(){Is(Wm);const t=a0(),{navigate:e}=o0();return(n,i)=>{const a=Fm(n)?n:t(n);return e(a,i)}}const X2=t=>({params:t&16,location:t&8}),lh=t=>({params:Ai?Ra(t[9]):t[4],location:t[3],navigate:t[10]});function fh(t){let e,r;return e=new r0({props:{primary:t[1],$$slots:{default:[Z2]},$$scope:{ctx:t}}}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&2&&(a.primary=n[1]),i&264217&&(a.$$scope={dirty:i,ctx:n}),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function Q2(t){let e;const r=t[17].default,n=Zp(r,t,t[18],lh);return{c(){n&&n.c()},m(i,a){n&&n.m(i,a),e=!0},p(i,a){n&&n.p&&(!e||a&262168)&&td(n,r,i,i[18],e?ed(r,i[18],a,X2):rd(i[18]),lh)},i(i){e||(dr(n,i),e=!0)},o(i){mr(n,i),e=!1},d(i){n&&n.d(i)}}}function J2(t){let e,r,n;const i=[{location:t[3]},{navigate:t[10]},Ai?Ra(t[9]):t[4],t[11]];var a=t[0];function s(u){let c={};for(let f=0;f{Yr(l,1)}),Un()}a?(e=new a(s()),Xr(e.$$.fragment),dr(e.$$.fragment,1),Gr(e,r.parentNode,r)):e=null}else a&&e.$set(f)},i(u){n||(e&&dr(e.$$.fragment,u),n=!0)},o(u){e&&mr(e.$$.fragment,u),n=!1},d(u){u&&Wt(r),e&&Yr(e,u)}}}function Z2(t){let e,r,n,i;const a=[J2,Q2],s=[];function u(c,f){return c[0]!==null?0:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,f){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}function eS(t){let e,r,n,i,a,s=t[2]&&fh(t);return{c(){e=Ct("div"),r=hr(),s&&s.c(),n=hr(),i=Ct("div"),yo(e,"display","none"),Ve(e,"aria-hidden","true"),Ve(e,"data-svnav-route-start",t[5]),yo(i,"display","none"),Ve(i,"aria-hidden","true"),Ve(i,"data-svnav-route-end",t[5])},m(u,c){Gt(u,e,c),Gt(u,r,c),s&&s.m(u,c),Gt(u,n,c),Gt(u,i,c),a=!0},p(u,[c]){u[2]?s?(s.p(u,c),c&4&&dr(s,1)):(s=fh(u),s.c(),dr(s,1),s.m(n.parentNode,n)):s&&(Dn(),mr(s,1,1,()=>{s=null}),Un())},i(u){a||(dr(s),a=!0)},o(u){mr(s),a=!1},d(u){u&&Wt(e),u&&Wt(r),s&&s.d(u),u&&Wt(n),u&&Wt(i)}}}const tS=Bm();function rS(t,e,r){let n;const i=["path","component","meta","primary"];let a=zu(e,i),s,u,c,f,{$$slots:l={},$$scope:o}=e,{path:w=""}=e,{component:p=null}=e,{meta:d={}}=e,{primary:S=!0}=e;Is(oc,e);const v=tS(),{registerRoute:O,unregisterRoute:h,activeRoute:g}=Oi(Ca);Ur(t,g,T=>r(15,s=T));const A=i0();Ur(t,A,T=>r(16,c=T));const m=n0();Ur(t,m,T=>r(3,u=T));const x=Sn(null);let y;const _=Sn(),L=Sn({});Ur(t,L,T=>r(4,f=T)),ms(Vm,_),ms(a2,L),ms(s2,x);const b=Y2();return Ai||Qw(()=>h(v)),t.$$set=T=>{r(23,e=Ji(Ji({},e),qu(T))),r(11,a=zu(e,i)),"path"in T&&r(12,w=T.path),"component"in T&&r(0,p=T.component),"meta"in T&&r(13,d=T.meta),"primary"in T&&r(1,S=T.primary),"$$scope"in T&&r(18,o=T.$$scope)},t.$$.update=()=>{if(t.$$.dirty&77834){const T=w==="",I=Ps(c,w),k={id:v,path:w,meta:d,default:T,fullPath:T?"":I,base:T?c:T2(I,u.pathname),primary:S,focusElement:x};_.set(k),r(14,y=O(k))}if(t.$$.dirty&49152&&r(2,n=!!(y||s&&s.id===v)),t.$$.dirty&49156&&n){const{params:T}=y||s;L.set(T)}},e=qu(e),[p,S,n,u,f,v,g,A,m,L,b,a,w,d,y,s,c,l,o]}class Eu extends yn{constructor(e){super(),hn(this,e,rS,eS,ln,{path:12,component:0,meta:13,primary:1})}}function nS(t){let e,r,n,i;const a=t[13].default,s=Zp(a,t,t[12],null);let u=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fr(11,l=x));const h=nc(),g=a0(),{navigate:A}=o0();function m(x){h("click",x),r2(x)&&(x.preventDefault(),A(n,{state:S,replace:a||d}))}return t.$$set=x=>{r(18,e=Ji(Ji({},e),qu(x))),r(17,f=zu(e,c)),"to"in x&&r(5,p=x.to),"replace"in x&&r(6,d=x.replace),"state"in x&&r(7,S=x.state),"getProps"in x&&r(8,v=x.getProps),"$$scope"in x&&r(12,w=x.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&r(0,n=g(p,l)),t.$$.dirty&2049&&r(10,i=mp(l.pathname,n)),t.$$.dirty&2049&&r(9,a=n===l.pathname),t.$$.dirty&512&&r(2,s=a?{"aria-current":"page"}:{}),r(1,u=(()=>{if(Um(v)){const x=v({location:l,href:n,isPartiallyCurrent:i,isCurrent:a});return{...f,...x}}return f})())},e=qu(e),[n,u,s,O,m,p,d,S,v,a,i,l,w,o]}class xa extends yn{constructor(e){super(),hn(this,e,oS,nS,ln,{to:5,replace:6,state:7,getProps:8})}}const iS="modulepreload",ph={},aS="/",s0=function(e,r){return!r||r.length===0?e():Promise.all(r.map(n=>{if(n=`${aS}${n}`,n in ph)return;ph[n]=!0;const i=n.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${n}"]${a}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":iS,i||(s.as="script",s.crossOrigin=""),s.href=n,document.head.appendChild(s),i)return new Promise((u,c)=>{s.addEventListener("load",u),s.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e())};var u0=(t=>(t.ENGLISH="en",t.SPANISH="es",t))(u0||{});const c0="Account:",l0="Allow",f0="Amount:",p0="Asset A:",d0="Asset B:",h0="Asset you are using to pay:",y0="Asset:",v0="Authorization:",m0="The account is authorized to maintain orders, but not to perform other transactions",g0="The account is authorized to transact with the asset",b0="Balance ID:",_0="Bump to:",w0="Buy Amount:",S0="Buying Asset:",E0="Buying:",O0="Cancel",A0="Claimants:",T0="Clear Flags:",x0="Close",P0="Confirm",I0="Connect",k0="Data:",R0="Description:",C0="Destination Asset:",N0="Destination inflation:",j0="Destination:",L0="Disallow",M0="ed25519PubpcKey:",D0="en",U0="English",F0="Error",B0="Sorry, the recipient's data wasn't provided.",$0="Expand all",V0="Extend to:",q0="Payment failed. Please try again.",z0="You will sign to pay the",K0="of the transaction below",H0="FEE BUMP",W0="Fee",G0="From:",Y0="Function type:",X0="Go to Connect",Q0="Go to Sign",J0="Go to Payment",Z0="Hide all",eg="Hide key",tg="High Threshold:",rg="Hint:",ng="Home Domain:",og="Install",ig="Invalid key",ag="Is authorized to maintain liabilities:",sg="Is authorized:",ug="Is clawback enabled:",cg="Limit:",lg="Liquidity Pool ID:",fg="Loading...",pg="Logout",dg="Low Threshold:",hg="Master Weight:",yg="Max Amount A:",vg="Max Amount B:",mg="Max Amount:",gg="Max time:",bg="Maximum Price:",_g="Medium Threshold:",wg="Min Amount A:",Sg="Min Amount B:",Eg="Min time:",Og="Minimum amount of destination asset to be received:",Ag="Minimum Price:",Tg="Name:",xg="Network Fee:",Pg="Network",Ig="Authorization: The account is not authorized to transact with the asset",kg="The recipient hasn't established a trustline with the asset.",Rg="Offer ID:",Cg="Account Merge",Ng="Trust",jg="Begin Sponsoring Future Reserves",Lg="Bump Sequence",Mg="Change Trust",Dg="Claim Claimable Balance",Ug="Clawback Claimable Balance",Fg="Clawback",Bg="Create Account",$g="Create Claimable Balance",Vg="Create Passive Sell Offer",qg="End Sponsoring Future Reserves",zg="Extend footprint TTL",Kg="Invoke Host Function",Hg="Liquidity Pool Deposit",Wg="Liquidity Pool Withdraw",Gg="Manage Buy Offer",Yg="Manage Data",Xg="Manage Sell Offer",Qg="Path Payment Strict Receive",Jg="Path Payment Strict Send",Zg="Payment",e1="Restore footprint",t1="Revoke Account Sponsorship",r1="Revoke Claimable Balance Sponsorship",n1="Revoke Data Sponsorship",o1="Revoke Liquidity Pool Sponsorship",i1="Revoke Offer Sponsorship",a1="Revoke Signer Sponsorship",s1="Revoke Trustline Sponsorship",u1="Set Options",c1="Set Trustline Flags",l1="Operation type",f1="Operation:",p1="Operations list",d1="Path:",h1="Pay",y1="preAuthTx:",v1="Price:",m1="Private Key",g1="Select Wallet",b1="Seller:",_1="Selling Asset:",w1="Selling:",S1="Sequence Number:",E1="Set Flags:",O1="sha256Hash:",A1="Show key",T1="Sign Transaction with",x1="Sign",P1="Signature:",I1="Signatures:",k1="Signer:",R1="Source Account:",C1="es",N1="Spanish",j1="Sponsored ID:",L1="Starting Balance:",M1="The payment was successful!",D1="Time Bounds:",U1="to the account",F1="Transaction:",B1="Trustor:",$1="User is not connected",V1="This transaction is asking to add another signer to your account, which could lead to them taking over your funds. Please evaluate it carefully.",q1="Weight:",z1="Sorry, the XDR is invalid",K1="Sorry, an XDR wasn't provided",H1="You are paying",W1="Your Account";var sS={ACCOUNT:c0,ALLOW_TRUST:l0,AMOUNT:f0,ASSET_A:p0,ASSET_B:d0,ASSET_TO_PAY:h0,ASSET:y0,AUTHORIZATION:v0,AUTHORIZED_TO_MAINTAIN_ORDERS:m0,AUTHORIZED_TO_TRANSACT:g0,BALANCE_ID:b0,BUMP_TO:_0,BUY_AMOUNT:w0,BUYING_ASSET:S0,BUYING:E0,CANCEL:O0,CLAIMANTS:A0,CLEAR_FLAGS:T0,CLOSE:x0,CONFIRM:P0,CONNECT_WITH_PRIVATE_KEY:I0,DATA:k0,DESCRIPTION:R0,DESTINATION_ASSET:C0,DESTINATION_INFLATION:N0,DESTINATION:j0,DISALLOW_TRUST:L0,ED5519PUBPCKEY:M0,ENGLISH_ISO:D0,ENGLISH:U0,ERROR:F0,ERROR_MISSING_RECEIVER_DATA:B0,EXPAND_ALL:$0,EXTEND_TO:V0,FAILED_PAYMENT:q0,FEE_BUMP_DESCRIPTION_1:z0,FEE_BUMP_DESCRIPTION_2:K0,FEE_BUMP:H0,FEE:W0,FROM:G0,FUNCTION_TYPE:Y0,GO_TO_CONNECT:X0,GO_TO_SIGN:Q0,GO_TO_PAYMENT:J0,HIDE_ALL:Z0,HIDE_KEY:eg,HIGH_THRESHOLD:tg,HINT:rg,HOME_DOMAIN:ng,INSTALL:og,INVALID_KEY:ig,IS_AUTHORIZED_TO_MAINTAIN_LIABILITIES:ag,IS_AUTHORIZED:sg,IS_CLAWBACK_ENABLED:ug,LIMIT:cg,LIQUIDITY_POOL_ID:lg,LOADING:fg,LOGOUT:pg,LOW_THRESHOLD:dg,MASTER_WEIGHT:hg,MAX_AMOUNT_A:yg,MAX_AMOUNT_B:vg,MAX_AMOUNT:mg,MAX_TIME:gg,MAXIMUM_PRICE:bg,MEDIUM_THRESHOLD:_g,MIN_AMOUNT_A:wg,MIN_AMOUNT_B:Sg,MIN_TIME:Eg,MINIMUM_AMOUNT_DESTINATION_ASSET:Og,MINIMUM_PRICE:Ag,NAME:Tg,NETWORK_FEE:xg,NETWORK:Pg,NOT_AUTHORIZED_TO_TRANSACT:Ig,NO_TRUSTLINE:kg,OFFER_ID:Rg,OPERATION_ACCOUNT_MERGE:Cg,OPERATION_ACCOUNT_TRUST:Ng,OPERATION_BEGIN_SPONSORING_FUTURE_RESERVES:jg,OPERATION_BUMP_SEQUENCE:Lg,OPERATION_CHANGE_TRUST:Mg,OPERATION_CLAIM_CLAIMABLE_BALANCE:Dg,OPERATION_CLAWBACK_CLAIMABLE_BALANCE:Ug,OPERATION_CLAWBACK:Fg,OPERATION_CREATE_ACCOUNT:Bg,OPERATION_CREATE_CLAIMABLE_BALANCE:$g,OPERATION_CREATE_PASSIVE_SELL_OFFER:Vg,OPERATION_END_SPONSORING_FUTURE_RESERVES:qg,OPERATION_EXTEND_FOOTPRINT_TTL:zg,OPERATION_INVOKE_HOST_FUNCTION:Kg,OPERATION_LIQUIDITY_POOL_DEPOSIT:Hg,OPERATION_LIQUIDITY_POOL_WITHDRAW:Wg,OPERATION_MANAGE_BUY_OFFER:Gg,OPERATION_MANAGE_DATA:Yg,OPERATION_MANAGE_SELL_OFFER:Xg,OPERATION_PATH_PAYMENT_STRICT_RECEIVE:Qg,OPERATION_PATH_PAYMENT_STRICT_SEND:Jg,OPERATION_PAYMENT:Zg,OPERATION_RESTORE_FOOTPRINT:e1,OPERATION_REVOKE_ACCOUNT_SPONSORSHIP:t1,OPERATION_REVOKE_CLAIMABLE_BALANCE_SPONSORSHIP:r1,OPERATION_REVOKE_DATA_SPONSORSHIP:n1,OPERATION_REVOKE_LIQUIDITY_POOL_SPONSORSHIP:o1,OPERATION_REVOKE_OFFER_SPONSORSHIP:i1,OPERATION_REVOKE_SIGNER_SPONSORSHIP:a1,OPERATION_REVOKE_TRUSTLINE_SPONSORSHIP:s1,OPERATION_SET_OPTIONS:u1,OPERATION_SET_TRUSTLINE_FLAGS:c1,OPERATION_TYPE:l1,OPERATION:f1,OPERATIONS_LIST:p1,PATH:d1,PAY:h1,PREAUTH_TX:y1,PRICE:v1,PRIVATE_KEY:m1,SELECT_WALLET:g1,SELLER:b1,SELLING_ASSET:_1,SELLING:w1,SEQUENCE_NUMBER:S1,SET_FLAGS:E1,SHA256HASH:O1,SHOW_KEY:A1,SIGN_TRANSACTION:T1,SIGN:x1,SIGNATURE:P1,SIGNATURES:I1,SIGNER:k1,SOURCE_ACCOUNT:R1,SPANISH_ISO:C1,SPANISH:N1,SPONSORED_ID:j1,STARTING_BALANCE:L1,SUCCESSFUL_PAYMENT:M1,TIME_BOUNDS:D1,TO_THE_ACCOUNT:U1,TRANSACTION:F1,TRUSTOR:B1,USER_IS_NOT_CONNECTED:$1,WARNING_TX_DESCRIPTION:V1,WEIGHT:q1,XDR_INVALID:z1,XDR_NOT_PROVIDED:K1,YOU_ARE_PAYING:H1,YOUR_ACCOUNT:W1},uS=Object.freeze(Object.defineProperty({__proto__:null,ACCOUNT:c0,ALLOW_TRUST:l0,AMOUNT:f0,ASSET_A:p0,ASSET_B:d0,ASSET_TO_PAY:h0,ASSET:y0,AUTHORIZATION:v0,AUTHORIZED_TO_MAINTAIN_ORDERS:m0,AUTHORIZED_TO_TRANSACT:g0,BALANCE_ID:b0,BUMP_TO:_0,BUY_AMOUNT:w0,BUYING_ASSET:S0,BUYING:E0,CANCEL:O0,CLAIMANTS:A0,CLEAR_FLAGS:T0,CLOSE:x0,CONFIRM:P0,CONNECT_WITH_PRIVATE_KEY:I0,DATA:k0,DESCRIPTION:R0,DESTINATION_ASSET:C0,DESTINATION_INFLATION:N0,DESTINATION:j0,DISALLOW_TRUST:L0,ED5519PUBPCKEY:M0,ENGLISH_ISO:D0,ENGLISH:U0,ERROR:F0,ERROR_MISSING_RECEIVER_DATA:B0,EXPAND_ALL:$0,EXTEND_TO:V0,FAILED_PAYMENT:q0,FEE_BUMP_DESCRIPTION_1:z0,FEE_BUMP_DESCRIPTION_2:K0,FEE_BUMP:H0,FEE:W0,FROM:G0,FUNCTION_TYPE:Y0,GO_TO_CONNECT:X0,GO_TO_SIGN:Q0,GO_TO_PAYMENT:J0,HIDE_ALL:Z0,HIDE_KEY:eg,HIGH_THRESHOLD:tg,HINT:rg,HOME_DOMAIN:ng,INSTALL:og,INVALID_KEY:ig,IS_AUTHORIZED_TO_MAINTAIN_LIABILITIES:ag,IS_AUTHORIZED:sg,IS_CLAWBACK_ENABLED:ug,LIMIT:cg,LIQUIDITY_POOL_ID:lg,LOADING:fg,LOGOUT:pg,LOW_THRESHOLD:dg,MASTER_WEIGHT:hg,MAX_AMOUNT_A:yg,MAX_AMOUNT_B:vg,MAX_AMOUNT:mg,MAX_TIME:gg,MAXIMUM_PRICE:bg,MEDIUM_THRESHOLD:_g,MIN_AMOUNT_A:wg,MIN_AMOUNT_B:Sg,MIN_TIME:Eg,MINIMUM_AMOUNT_DESTINATION_ASSET:Og,MINIMUM_PRICE:Ag,NAME:Tg,NETWORK_FEE:xg,NETWORK:Pg,NOT_AUTHORIZED_TO_TRANSACT:Ig,NO_TRUSTLINE:kg,OFFER_ID:Rg,OPERATION_ACCOUNT_MERGE:Cg,OPERATION_ACCOUNT_TRUST:Ng,OPERATION_BEGIN_SPONSORING_FUTURE_RESERVES:jg,OPERATION_BUMP_SEQUENCE:Lg,OPERATION_CHANGE_TRUST:Mg,OPERATION_CLAIM_CLAIMABLE_BALANCE:Dg,OPERATION_CLAWBACK_CLAIMABLE_BALANCE:Ug,OPERATION_CLAWBACK:Fg,OPERATION_CREATE_ACCOUNT:Bg,OPERATION_CREATE_CLAIMABLE_BALANCE:$g,OPERATION_CREATE_PASSIVE_SELL_OFFER:Vg,OPERATION_END_SPONSORING_FUTURE_RESERVES:qg,OPERATION_EXTEND_FOOTPRINT_TTL:zg,OPERATION_INVOKE_HOST_FUNCTION:Kg,OPERATION_LIQUIDITY_POOL_DEPOSIT:Hg,OPERATION_LIQUIDITY_POOL_WITHDRAW:Wg,OPERATION_MANAGE_BUY_OFFER:Gg,OPERATION_MANAGE_DATA:Yg,OPERATION_MANAGE_SELL_OFFER:Xg,OPERATION_PATH_PAYMENT_STRICT_RECEIVE:Qg,OPERATION_PATH_PAYMENT_STRICT_SEND:Jg,OPERATION_PAYMENT:Zg,OPERATION_RESTORE_FOOTPRINT:e1,OPERATION_REVOKE_ACCOUNT_SPONSORSHIP:t1,OPERATION_REVOKE_CLAIMABLE_BALANCE_SPONSORSHIP:r1,OPERATION_REVOKE_DATA_SPONSORSHIP:n1,OPERATION_REVOKE_LIQUIDITY_POOL_SPONSORSHIP:o1,OPERATION_REVOKE_OFFER_SPONSORSHIP:i1,OPERATION_REVOKE_SIGNER_SPONSORSHIP:a1,OPERATION_REVOKE_TRUSTLINE_SPONSORSHIP:s1,OPERATION_SET_OPTIONS:u1,OPERATION_SET_TRUSTLINE_FLAGS:c1,OPERATION_TYPE:l1,OPERATION:f1,OPERATIONS_LIST:p1,PATH:d1,PAY:h1,PREAUTH_TX:y1,PRICE:v1,PRIVATE_KEY:m1,SELECT_WALLET:g1,SELLER:b1,SELLING_ASSET:_1,SELLING:w1,SEQUENCE_NUMBER:S1,SET_FLAGS:E1,SHA256HASH:O1,SHOW_KEY:A1,SIGN_TRANSACTION:T1,SIGN:x1,SIGNATURE:P1,SIGNATURES:I1,SIGNER:k1,SOURCE_ACCOUNT:R1,SPANISH_ISO:C1,SPANISH:N1,SPONSORED_ID:j1,STARTING_BALANCE:L1,SUCCESSFUL_PAYMENT:M1,TIME_BOUNDS:D1,TO_THE_ACCOUNT:U1,TRANSACTION:F1,TRUSTOR:B1,USER_IS_NOT_CONNECTED:$1,WARNING_TX_DESCRIPTION:V1,WEIGHT:q1,XDR_INVALID:z1,XDR_NOT_PROVIDED:K1,YOU_ARE_PAYING:H1,YOUR_ACCOUNT:W1,default:sS},Symbol.toStringTag,{value:"Module"}));class cS{async create(e){let r;switch(e){case u0.SPANISH:r=(await s0(()=>import("./spanish.24416b4e.js"),[])).default;break;default:r=uS;break}return r}}class G1{getLanguage(){const e="en";return(navigator.languages&&navigator.languages[0]&&navigator.language||e).substr(0,2)}async getText(e){return await new cS().create(e||this.getLanguage())}}const Y1=new G1,go=Sn({}),X1=Sn(Y1.getLanguage()),Q1=Sn(!0),Na=Sn(!1),dh=Sn();Y1.getText().then(t=>{go.set(t),Q1.set(!1)});class Es{clearStorage(e){e?window.localStorage.removeItem(e):window.localStorage.clear()}getItem(e){return window.localStorage.getItem(e)}storeItem(e,r){return window.localStorage.setItem(e,r)}}function lS(t,e){function r(n){t.contains(n.target)||e()}return document.body.addEventListener("click",r),{update(n){e=n},destroy(){document.body.removeEventListener("click",r)}}}const ja=Sn(!1);function fS(t){let e,r,n,i;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),Ve(r,"d","M0 0h24v24H0z"),Ve(r,"fill","none"),Ve(n,"d","M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"height","21px"),Ve(e,"viewBox","0 0 24 24"),Ve(e,"width","21px"),Ve(e,"class",i="simple-signer language-icon "+(t[0]?"active":"inactive")+" svelte-1nbczl1")},m(a,s){Gt(a,e,s),nt(e,r),nt(e,n)},p(a,[s]){s&1&&i!==(i="simple-signer language-icon "+(a[0]?"active":"inactive")+" svelte-1nbczl1")&&Ve(e,"class",i)},i:wr,o:wr,d(a){a&&Wt(e)}}}function pS(t,e,r){let{isActive:n}=e;return t.$$set=i=>{"isActive"in i&&r(0,n=i.isActive)},[n]}class dS extends yn{constructor(e){super(),hn(this,e,pS,fS,ln,{isActive:0})}}const hS=new G1;async function yS(t){const e=await hS.getText(t);go.set(e)}function hh(t,e,r){const n=t.slice();return n[6]=e[r],n}function yh(t){let e,r,n,i,a=t[6].text+"",s,u,c,f,l;return{c(){e=Ct("label"),r=Ct("input"),i=hr(),s=pr(a),u=hr(),Ve(r,"class","simple-signer hide-circle svelte-1flk32j"),r.__value=n=t[6].iso,r.value=r.__value,Ve(r,"type","radio"),Ve(r,"name","language"),t[3][0].push(r),Ve(e,"class",c="simple-signer language "+(t[1]===t[6].iso?"active":"default")+" svelte-1flk32j")},m(o,w){Gt(o,e,w),nt(e,r),r.checked=r.__value===t[1],nt(e,i),nt(e,s),nt(e,u),f||(l=[Cn(r,"change",t[2]),Cn(e,"change",t[4])],f=!0)},p(o,w){w&1&&n!==(n=o[6].iso)&&(r.__value=n,r.value=r.__value),w&2&&(r.checked=r.__value===o[1]),w&1&&a!==(a=o[6].text+"")&&br(s,a),w&3&&c!==(c="simple-signer language "+(o[1]===o[6].iso?"active":"default")+" svelte-1flk32j")&&Ve(e,"class",c)},d(o){o&&Wt(e),t[3][0].splice(t[3][0].indexOf(r),1),f=!1,ri(l)}}}function vS(t){let e,r=t[0],n=[];for(let i=0;ir(5,n=f));let i=n,{languageInputsProps:a}=e;const s=[[]];function u(){i=this.__value,r(1,i)}const c=()=>yS(i);return t.$$set=f=>{"languageInputsProps"in f&&r(0,a=f.languageInputsProps)},[a,i,u,s,c]}class gS extends yn{constructor(e){super(),hn(this,e,mS,vS,ln,{languageInputsProps:0})}}function bS(t){let e,r,n,i,a,s,u,c,f,l,o,w;return i=new dS({props:{isActive:t[0]}}),u=new gS({props:{languageInputsProps:[{iso:t[1].SPANISH_ISO,text:t[1].SPANISH},{iso:t[1].ENGLISH_ISO,text:t[1].ENGLISH}]}}),{c(){e=Ct("div"),r=Ct("div"),n=Ct("button"),Xr(i.$$.fragment),a=hr(),s=Ct("div"),Xr(u.$$.fragment),Ve(n,"class","simple-signer invisible-button svelte-1lj29ho"),Ve(s,"class",c="simple-signer language-selector-container "+(t[0]?"":"hidden")+" svelte-1lj29ho"),Ve(r,"class",f="simple-signer language-container-icon "+(t[0]&&"active")+" svelte-1lj29ho"),Ve(e,"class","simple-signer language-container svelte-1lj29ho")},m(p,d){Gt(p,e,d),nt(e,r),nt(r,n),Gr(i,n,null),nt(r,a),nt(r,s),Gr(u,s,null),l=!0,o||(w=Cn(n,"click",t[2]),o=!0)},p(p,[d]){const S={};d&1&&(S.isActive=p[0]),i.$set(S);const v={};d&2&&(v.languageInputsProps=[{iso:p[1].SPANISH_ISO,text:p[1].SPANISH},{iso:p[1].ENGLISH_ISO,text:p[1].ENGLISH}]),u.$set(v),(!l||d&1&&c!==(c="simple-signer language-selector-container "+(p[0]?"":"hidden")+" svelte-1lj29ho"))&&Ve(s,"class",c),(!l||d&1&&f!==(f="simple-signer language-container-icon "+(p[0]&&"active")+" svelte-1lj29ho"))&&Ve(r,"class",f)},i(p){l||(dr(i.$$.fragment,p),dr(u.$$.fragment,p),l=!0)},o(p){mr(i.$$.fragment,p),mr(u.$$.fragment,p),l=!1},d(p){p&&Wt(e),Yr(i),Yr(u),o=!1,w()}}}function _S(t,e,r){let n,i,a;Ur(t,Na,u=>r(3,n=u)),Ur(t,ja,u=>r(0,i=u)),Ur(t,go,u=>r(1,a=u));function s(){dn(ja,i=!i,i),dn(Na,n=!1,n)}return[i,a,s]}class wS extends yn{constructor(e){super(),hn(this,e,_S,bS,ln,{})}}function SS(t){let e,r,n,i;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),Ve(r,"d","M0 0h24v24H0z"),Ve(r,"fill","none"),Ve(n,"d","M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"height","21px"),Ve(e,"viewBox","0 0 24 24"),Ve(e,"width","21px"),Ve(e,"class",i="simple-signer icon "+(t[0]?"active":"inactive")+" svelte-ea2dfr")},m(a,s){Gt(a,e,s),nt(e,r),nt(e,n)},p(a,[s]){s&1&&i!==(i="simple-signer icon "+(a[0]?"active":"inactive")+" svelte-ea2dfr")&&Ve(e,"class",i)},i:wr,o:wr,d(a){a&&Wt(e)}}}function ES(t,e,r){let{isActive:n}=e;return t.$$set=i=>{"isActive"in i&&r(0,n=i.isActive)},[n]}class OS extends yn{constructor(e){super(),hn(this,e,ES,SS,ln,{isActive:0})}}function AS(t){let e,r,n,i=t[1].LOGOUT+"",a,s,u;return{c(){e=Ct("label"),r=Ct("input"),n=hr(),a=pr(i),Ve(r,"class","simple-signer hide-circle svelte-3egqvj"),Ve(r,"type","radio"),Ve(r,"name","logout"),Ve(e,"class","simple-signer logout-active svelte-3egqvj")},m(c,f){Gt(c,e,f),nt(e,r),nt(e,n),nt(e,a),s||(u=Cn(e,"click",t[6]),s=!0)},p(c,f){f&2&&i!==(i=c[1].LOGOUT+"")&&br(a,i)},d(c){c&&Wt(e),s=!1,u()}}}function TS(t){let e,r,n,i,a,s,u,c,f,l,o,w;return i=new OS({props:{isActive:t[0]}}),u=new xa({props:{to:"/connect",$$slots:{default:[AS]},$$scope:{ctx:t}}}),{c(){e=Ct("div"),r=Ct("div"),n=Ct("button"),Xr(i.$$.fragment),a=hr(),s=Ct("div"),Xr(u.$$.fragment),Ve(n,"class","simple-signer logout-button svelte-3egqvj"),Ve(s,"class",c="simple-signer logout-selector-container "+(t[0]?"":"hidden")+" svelte-3egqvj"),Ve(r,"class",f="simple-signer logout-container-icon "+(t[0]&&"active")+" svelte-3egqvj"),Ve(e,"class","simple-signer logout-container svelte-3egqvj")},m(p,d){Gt(p,e,d),nt(e,r),nt(r,n),Gr(i,n,null),nt(r,a),nt(r,s),Gr(u,s,null),l=!0,o||(w=Cn(n,"click",t[2]),o=!0)},p(p,[d]){const S={};d&1&&(S.isActive=p[0]),i.$set(S);const v={};d&258&&(v.$$scope={dirty:d,ctx:p}),u.$set(v),(!l||d&1&&c!==(c="simple-signer logout-selector-container "+(p[0]?"":"hidden")+" svelte-3egqvj"))&&Ve(s,"class",c),(!l||d&1&&f!==(f="simple-signer logout-container-icon "+(p[0]&&"active")+" svelte-3egqvj"))&&Ve(r,"class",f)},i(p){l||(dr(i.$$.fragment,p),dr(u.$$.fragment,p),l=!0)},o(p){mr(i.$$.fragment,p),mr(u.$$.fragment,p),l=!1},d(p){p&&Wt(e),Yr(i),Yr(u),o=!1,w()}}}function xS(t,e,r){let n,i,a;Ur(t,ja,o=>r(7,n=o)),Ur(t,Na,o=>r(0,i=o)),Ur(t,go,o=>r(1,a=o));let{storage:s}=e,{walletConnectService:u}=e;function c(){dn(Na,i=!i,i),dn(ja,n=!1,n)}async function f(){u.disconnectAllSessions(),s.clearStorage()}const l=async()=>await f();return t.$$set=o=>{"storage"in o&&r(4,s=o.storage),"walletConnectService"in o&&r(5,u=o.walletConnectService)},[i,a,c,f,s,u,l]}class PS extends yn{constructor(e){super(),hn(this,e,xS,TS,ln,{storage:4,walletConnectService:5})}}function IS(t){let e,r;return e=new PS({props:{storage:t[1],walletConnectService:t[0]}}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function kS(t){let e,r,n,i,a,s,u,c,f,l,o=t[2]&&IS(t);return u=new wS({}),{c(){e=Ct("header"),r=Ct("div"),n=Ct("div"),o&&o.c(),i=hr(),a=Ct("div"),s=Ct("div"),Xr(u.$$.fragment),Ve(n,"class","simple-signer logout-container"),Ve(s,"class","simple-signer column-center svelte-1rd4vjy"),Ve(a,"class","simple-signer language-container"),Ve(r,"class","simple-signer logout-language-container row-space-between-center svelte-1rd4vjy"),Ve(e,"class","simple-signer header row-space-between-center header-border svelte-1rd4vjy")},m(w,p){Gt(w,e,p),nt(e,r),nt(r,n),o&&o.m(n,null),nt(r,i),nt(r,a),nt(a,s),Gr(u,s,null),c=!0,f||(l=Gw(lS.call(null,r,t[3])),f=!0)},p(w,[p]){w[2]&&o.p(w,p)},i(w){c||(dr(o),dr(u.$$.fragment,w),c=!0)},o(w){mr(o),mr(u.$$.fragment,w),c=!1},d(w){w&&Wt(e),o&&o.d(),Yr(u),f=!1,l()}}}function RS(t,e,r){let n,i;Ur(t,Na,f=>r(4,n=f)),Ur(t,ja,f=>r(5,i=f));let{walletConnectService:a}=e;const s=new Es,u=s.getItem("wallet");function c(){dn(ja,i=!1,i),dn(Na,n=!1,n)}return t.$$set=f=>{"walletConnectService"in f&&r(0,a=f.walletConnectService)},[a,s,u,c]}class CS extends yn{constructor(e){super(),hn(this,e,RS,kS,ln,{walletConnectService:0})}}const{VITE_PROJECT_ID_FOR_WALLET_CONNECT:NS,VITE_DAPP_BASE_URL:jS,VITE_HORIZON_NETWORK_PASSPHRASE:LS,VITE_STELLAR_NETWORK:MS,VITE_HORIZON_URL:DS}={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0};class Ou extends Error{}class US extends Error{}class vh extends Error{}class FS extends Error{}class BS extends Error{}class $S extends Error{}var Kn=(t=>(t.PUBLIC="public",t.TESTNET="testnet",t.FUTURENET="futurenet",t))(Kn||{});const J1=LS,Ti=MS,VS=Symbol(),mh=Object.getPrototypeOf,gp=new WeakMap,qS=t=>t&&(gp.has(t)?gp.get(t):mh(t)===Object.prototype||mh(t)===Array.prototype),zS=t=>qS(t)&&t[VS]||null,gh=(t,e=!0)=>{gp.set(t,e)},Vf=t=>typeof t=="object"&&t!==null,bi=new WeakMap,Au=new WeakSet,KS=(t=Object.is,e=(l,o)=>new Proxy(l,o),r=l=>Vf(l)&&!Au.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),n=l=>l.configurable&&l.enumerable&&l.writable,i=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},a=new WeakMap,s=(l,o,w=i)=>{const p=a.get(l);if(p?.[0]===o)return p[1];const d=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return gh(d,!0),a.set(l,[o,d]),Reflect.ownKeys(l).forEach(S=>{if(Object.getOwnPropertyDescriptor(d,S))return;const v=Reflect.get(l,S),O={value:v,enumerable:!0,configurable:!0};if(Au.has(v))gh(v,!1);else if(v instanceof Promise)delete O.value,O.get=()=>w(v);else if(bi.has(v)){const[h,g]=bi.get(v);O.value=s(h,g(),w)}Object.defineProperty(d,S,O)}),Object.preventExtensions(d)},u=new WeakMap,c=[1,1],f=l=>{if(!Vf(l))throw new Error("object required");const o=u.get(l);if(o)return o;let w=c[0];const p=new Set,d=(T,I=++c[0])=>{w!==I&&(w=I,p.forEach(k=>k(T,I)))};let S=c[1];const v=(T=++c[1])=>(S!==T&&!p.size&&(S=T,h.forEach(([I])=>{const k=I[1](T);k>w&&(w=k)})),w),O=T=>(I,k)=>{const N=[...I];N[1]=[T,...N[1]],d(N,k)},h=new Map,g=(T,I)=>{if(p.size){const k=I[3](O(T));h.set(T,[I,k])}else h.set(T,[I])},A=T=>{var I;const k=h.get(T);k&&(h.delete(T),(I=k[1])==null||I.call(k))},m=T=>(p.add(T),p.size===1&&h.forEach(([k,N],C)=>{const D=k[3](O(C));h.set(C,[k,D])}),()=>{p.delete(T),p.size===0&&h.forEach(([k,N],C)=>{N&&(N(),h.set(C,[k]))})}),x=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),y=(T,I,k,N,C)=>{if(T&&(t(I,N)||u.has(N)&&t(I,u.get(N))))return;A(k),Vf(N)&&(N=zS(N)||N);let D=N;if(N instanceof Promise)N.then(X=>{N.status="fulfilled",N.value=X,d(["resolve",[k],X])}).catch(X=>{N.status="rejected",N.reason=X,d(["reject",[k],X])});else{!bi.has(N)&&r(N)&&(D=f(N));const X=!Au.has(D)&&bi.get(D);X&&g(k,X)}C(D),d(["set",[k],N,I])},L=e(x,{deleteProperty(T,I){const k=Reflect.get(T,I);A(I);const N=Reflect.deleteProperty(T,I);return N&&d(["delete",[I],k]),N},set(T,I,k,N){const C=Reflect.has(T,I),D=Reflect.get(T,I,N);return y(C,D,I,k,X=>{Reflect.set(T,I,X,N)}),!0},defineProperty(T,I,k){if(n(k)){const N=Reflect.getOwnPropertyDescriptor(T,I);if(!N||n(N))return y(!!N&&"value"in N,N?.value,I,k.value,C=>{Reflect.defineProperty(T,I,{...k,value:C})}),!0}return Reflect.defineProperty(T,I,k)}});u.set(l,L);const b=[x,v,s,m];return bi.set(L,b),Reflect.ownKeys(l).forEach(T=>{const I=Object.getOwnPropertyDescriptor(l,T);"value"in I&&(L[T]=l[T],delete I.value,delete I.writable),Object.defineProperty(x,T,I)}),L})=>[f,bi,Au,t,e,r,n,i,a,s,u,c],[HS]=KS();function Ci(t={}){return HS(t)}function ia(t,e,r){const n=bi.get(t);let i;const a=[],s=n[3];let u=!1;const f=s(l=>{if(a.push(l),r){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(a.splice(0))}))});return u=!0,()=>{u=!1,f()}}function WS(t,e){const r=bi.get(t),[n,i,a]=r;return a(n,i(),e)}const Gn=Ci({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Z1={state:Gn,subscribe(t){return ia(Gn,()=>t(Gn))},push(t,e){t!==Gn.view&&(Gn.view=t,e&&(Gn.data=e),Gn.history.push(t))},reset(t){Gn.view=t,Gn.history=[t]},replace(t){Gn.history.length>1&&(Gn.history[Gn.history.length-1]=t,Gn.view=t)},goBack(){if(Gn.history.length>1){Gn.history.pop();const[t]=Gn.history.slice(-1);Gn.view=t}},setData(t){Gn.data=t}},ao={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return ao.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return ao.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(ao.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!ao.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(ao.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(ao.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(ao.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(ao.WCM_VERSION,"2.6.1")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=Z1.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},GS=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),oo=Ci({enabled:GS,userSessionId:"",events:[],connectedWalletId:void 0}),YS={state:oo,subscribe(t){return ia(oo.events,()=>t(WS(oo.events[oo.events.length-1])))},initialize(){oo.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(oo.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){oo.connectedWalletId=t},click(t){if(oo.enabled){const e={type:"CLICK",name:t.name,userSessionId:oo.userSessionId,timestamp:Date.now(),data:t};oo.events.push(e)}},track(t){if(oo.enabled){const e={type:"TRACK",name:t.name,userSessionId:oo.userSessionId,timestamp:Date.now(),data:t};oo.events.push(e)}},view(t){if(oo.enabled){const e={type:"VIEW",name:t.name,userSessionId:oo.userSessionId,timestamp:Date.now(),data:t};oo.events.push(e)}}},Ho=Ci({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Uo={state:Ho,subscribe(t){return ia(Ho,()=>t(Ho))},setChains(t){Ho.chains=t},setWalletConnectUri(t){Ho.walletConnectUri=t},setIsCustomDesktop(t){Ho.isCustomDesktop=t},setIsCustomMobile(t){Ho.isCustomMobile=t},setIsDataLoaded(t){Ho.isDataLoaded=t},setIsUiLoaded(t){Ho.isUiLoaded=t},setIsAuth(t){Ho.isAuth=t}},Tu=Ci({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),La={state:Tu,subscribe(t){return ia(Tu,()=>t(Tu))},setConfig(t){var e,r;YS.initialize(),Uo.setChains(t.chains),Uo.setIsAuth(Boolean(t.enableAuthMode)),Uo.setIsCustomMobile(Boolean((e=t.mobileWallets)==null?void 0:e.length)),Uo.setIsCustomDesktop(Boolean((r=t.desktopWallets)==null?void 0:r.length)),ao.setModalVersionInStorage(),Object.assign(Tu,t)}};var XS=Object.defineProperty,bh=Object.getOwnPropertySymbols,QS=Object.prototype.hasOwnProperty,JS=Object.prototype.propertyIsEnumerable,_h=(t,e,r)=>e in t?XS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ZS=(t,e)=>{for(var r in e||(e={}))QS.call(e,r)&&_h(t,r,e[r]);if(bh)for(var r of bh(e))JS.call(e,r)&&_h(t,r,e[r]);return t};const bp="https://explorer-api.walletconnect.com",_p="wcm",wp="js-2.6.1";async function xu(t,e){const r=ZS({sdkType:_p,sdkVersion:wp},e),n=new URL(t,bp);return n.searchParams.append("projectId",La.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Bi={async getDesktopListings(t){return xu("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return xu("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return xu("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return xu("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${bp}/w3m/v1/getWalletImage/${t}?projectId=${La.state.projectId}&sdkType=${_p}&sdkVersion=${wp}`},getAssetImageUrl(t){return`${bp}/w3m/v1/getAssetImage/${t}?projectId=${La.state.projectId}&sdkType=${_p}&sdkVersion=${wp}`}};var eE=Object.defineProperty,wh=Object.getOwnPropertySymbols,tE=Object.prototype.hasOwnProperty,rE=Object.prototype.propertyIsEnumerable,Sh=(t,e,r)=>e in t?eE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,nE=(t,e)=>{for(var r in e||(e={}))tE.call(e,r)&&Sh(t,r,e[r]);if(wh)for(var r of wh(e))rE.call(e,r)&&Sh(t,r,e[r]);return t};const Eh=ao.isMobile(),Wo=Ci({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),v$={state:Wo,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=La.state;if(t==="NONE"||e==="ALL"&&!t)return Wo.recomendedWallets;if(ao.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await Bi.getAllListings(r),i=Object.values(n);i.sort((a,s)=>{const u=t.indexOf(a.id),c=t.indexOf(s.id);return u-c}),Wo.recomendedWallets=i}else{const{chains:r,isAuth:n}=Uo.state,i=r?.join(","),a=ao.isArray(e),s={page:1,sdks:n?"auth_v1":void 0,entries:ao.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:u}=Eh?await Bi.getMobileListings(s):await Bi.getDesktopListings(s);Wo.recomendedWallets=Object.values(u)}return Wo.recomendedWallets},async getWallets(t){const e=nE({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=La.state,{recomendedWallets:i}=Wo;if(n==="ALL")return Wo.wallets;i.length?e.excludedIds=i.map(o=>o.id).join(","):ao.isArray(r)&&(e.excludedIds=r.join(",")),ao.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Uo.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:s}=t,{listings:u,total:c}=Eh?await Bi.getMobileListings(e):await Bi.getDesktopListings(e),f=Object.values(u),l=s?"search":"wallets";return Wo[l]={listings:[...Wo[l].listings,...f],total:c,page:a??1},{listings:f,total:c}},getWalletImageUrl(t){return Bi.getWalletImageUrl(t)},getAssetImageUrl(t){return Bi.getAssetImageUrl(t)},resetSearch(){Wo.search={listings:[],total:0,page:1}}},wa=Ci({open:!1}),qf={state:wa,subscribe(t){return ia(wa,()=>t(wa))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Uo.state;if(ao.removeWalletConnectDeepLink(),Uo.setWalletConnectUri(t?.uri),Uo.setChains(t?.chains),Z1.reset("ConnectWallet"),r&&n)wa.open=!0,e();else{const i=setInterval(()=>{const a=Uo.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),wa.open=!0,e())},200)}})},close(){wa.open=!1}};var oE=Object.defineProperty,Oh=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,aE=Object.prototype.propertyIsEnumerable,Ah=(t,e,r)=>e in t?oE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sE=(t,e)=>{for(var r in e||(e={}))iE.call(e,r)&&Ah(t,r,e[r]);if(Oh)for(var r of Oh(e))aE.call(e,r)&&Ah(t,r,e[r]);return t};function uE(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const us=Ci({themeMode:uE()?"dark":"light"}),Th={state:us,subscribe(t){return ia(us,()=>t(us))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(us.themeMode=e),r&&(us.themeVariables=sE({},r))}},$i=Ci({open:!1,message:"",variant:"success"}),m$={state:$i,subscribe(t){return ia($i,()=>t($i))},openToast(t,e){$i.open=!0,$i.message=t,$i.variant=e},closeToast(){$i.open=!1}};class cE{constructor(e){this.openModal=qf.open,this.closeModal=qf.close,this.subscribeModal=qf.subscribe,this.setTheme=Th.setThemeConfig,Th.setThemeConfig(e),La.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await s0(()=>import("./index.8dc8db66.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Uo.setIsUiLoaded(!0)}}}var Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eb(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),e}function tb(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var So={exports:{}},Pa=typeof Reflect=="object"?Reflect:null,xh=Pa&&typeof Pa.apply=="function"?Pa.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Du;Pa&&typeof Pa.ownKeys=="function"?Du=Pa.ownKeys:Object.getOwnPropertySymbols?Du=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Du=function(e){return Object.getOwnPropertyNames(e)};function lE(t){console&&console.warn&&console.warn(t)}var rb=Number.isNaN||function(e){return e!==e};function En(){En.init.call(this)}So.exports=En;So.exports.once=hE;En.EventEmitter=En;En.prototype._events=void 0;En.prototype._eventsCount=0;En.prototype._maxListeners=void 0;var Ph=10;function ic(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(En,"defaultMaxListeners",{enumerable:!0,get:function(){return Ph},set:function(t){if(typeof t!="number"||t<0||rb(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ph=t}});En.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};En.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||rb(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function nb(t){return t._maxListeners===void 0?En.defaultMaxListeners:t._maxListeners}En.prototype.getMaxListeners=function(){return nb(this)};En.prototype.emit=function(e){for(var r=[],n=1;n0&&(s=r[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=a[e];if(c===void 0)return!1;if(typeof c=="function")xh(c,this,r);else for(var f=c.length,l=ub(c,f),n=0;n0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,lE(u)}return t}En.prototype.addListener=function(e,r){return ob(this,e,r,!1)};En.prototype.on=En.prototype.addListener;En.prototype.prependListener=function(e,r){return ob(this,e,r,!0)};function fE(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ib(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=fE.bind(n);return i.listener=r,n.wrapFn=i,i}En.prototype.once=function(e,r){return ic(r),this.on(e,ib(this,e,r)),this};En.prototype.prependOnceListener=function(e,r){return ic(r),this.prependListener(e,ib(this,e,r)),this};En.prototype.removeListener=function(e,r){var n,i,a,s,u;if(ic(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(a=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){u=n[s].listener,a=s;break}if(a<0)return this;a===0?n.shift():pE(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this};En.prototype.off=En.prototype.removeListener;En.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),s;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function ab(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?dE(i):ub(i,i.length)}En.prototype.listeners=function(e){return ab(this,e,!0)};En.prototype.rawListeners=function(e){return ab(this,e,!1)};En.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):sb.call(t,e)};En.prototype.listenerCount=sb;function sb(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}En.prototype.eventNames=function(){return this._eventsCount>0?Du(this._events):[]};function ub(t,e){for(var r=new Array(e),n=0;n=0;X--)(D=b[X])&&(C=(N<3?D(C):N>3?D(T,I,C):D(T,I))||C);return N>3&&C&&Object.defineProperty(T,I,C),C},a=function(b,T){return function(I,k){T(I,k,b)}},s=function(b,T){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(b,T)},u=function(b,T,I,k){function N(C){return C instanceof I?C:new I(function(D){D(C)})}return new(I||(I=Promise))(function(C,D){function X(z){try{K(k.next(z))}catch(H){D(H)}}function ae(z){try{K(k.throw(z))}catch(H){D(H)}}function K(z){z.done?C(z.value):N(z.value).then(X,ae)}K((k=k.apply(b,T||[])).next())})},c=function(b,T){var I={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},k,N,C,D;return D={next:X(0),throw:X(1),return:X(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function X(K){return function(z){return ae([K,z])}}function ae(K){if(k)throw new TypeError("Generator is already executing.");for(;I;)try{if(k=1,N&&(C=K[0]&2?N.return:K[0]?N.throw||((C=N.return)&&C.call(N),0):N.next)&&!(C=C.call(N,K[1])).done)return C;switch(N=0,C&&(K=[K[0]&2,C.value]),K[0]){case 0:case 1:C=K;break;case 4:return I.label++,{value:K[1],done:!1};case 5:I.label++,N=K[1],K=[0];continue;case 7:K=I.ops.pop(),I.trys.pop();continue;default:if(C=I.trys,!(C=C.length>0&&C[C.length-1])&&(K[0]===6||K[0]===2)){I=0;continue}if(K[0]===3&&(!C||K[1]>C[0]&&K[1]=b.length&&(b=void 0),{value:b&&b[k++],done:!b}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(b,T){var I=typeof Symbol=="function"&&b[Symbol.iterator];if(!I)return b;var k=I.call(b),N,C=[],D;try{for(;(T===void 0||T-- >0)&&!(N=k.next()).done;)C.push(N.value)}catch(X){D={error:X}}finally{try{N&&!N.done&&(I=k.return)&&I.call(k)}finally{if(D)throw D.error}}return C},w=function(){for(var b=[],T=0;T1||X(E,F)})})}function X(E,F){try{ae(k[E](F))}catch(J){H(C[0][3],J)}}function ae(E){E.value instanceof d?Promise.resolve(E.value.v).then(K,z):H(C[0][2],E)}function K(E){X("next",E)}function z(E){X("throw",E)}function H(E,F){E(F),C.shift(),C.length&&X(C[0][0],C[0][1])}},v=function(b){var T,I;return T={},k("next"),k("throw",function(N){throw N}),k("return"),T[Symbol.iterator]=function(){return this},T;function k(N,C){T[N]=b[N]?function(D){return(I=!I)?{value:d(b[N](D)),done:N==="return"}:C?C(D):D}:C}},O=function(b){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var T=b[Symbol.asyncIterator],I;return T?T.call(b):(b=typeof l=="function"?l(b):b[Symbol.iterator](),I={},k("next"),k("throw"),k("return"),I[Symbol.asyncIterator]=function(){return this},I);function k(C){I[C]=b[C]&&function(D){return new Promise(function(X,ae){D=b[C](D),N(X,ae,D.done,D.value)})}}function N(C,D,X,ae){Promise.resolve(ae).then(function(K){C({value:K,done:X})},D)}},h=function(b,T){return Object.defineProperty?Object.defineProperty(b,"raw",{value:T}):b.raw=T,b},g=function(b){if(b&&b.__esModule)return b;var T={};if(b!=null)for(var I in b)Object.hasOwnProperty.call(b,I)&&(T[I]=b[I]);return T.default=b,T},A=function(b){return b&&b.__esModule?b:{default:b}},m=function(b,T){if(!T.has(b))throw new TypeError("attempted to get private field on non-instance");return T.get(b)},x=function(b,T,I){if(!T.has(b))throw new TypeError("attempted to set private field on non-instance");return T.set(b,I),I},_("__extends",e),_("__assign",r),_("__rest",n),_("__decorate",i),_("__param",a),_("__metadata",s),_("__awaiter",u),_("__generator",c),_("__exportStar",f),_("__createBinding",y),_("__values",l),_("__read",o),_("__spread",w),_("__spreadArrays",p),_("__await",d),_("__asyncGenerator",S),_("__asyncDelegator",v),_("__asyncValues",O),_("__makeTemplateObject",h),_("__importStar",g),_("__importDefault",A),_("__classPrivateFieldGet",m),_("__classPrivateFieldSet",x)})})(g_);var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.isBrowserCryptoAvailable=Si.getSubtleCrypto=Si.getBrowerCrypto=void 0;function xd(){return Et?.crypto||Et?.msCrypto||{}}Si.getBrowerCrypto=xd;function b_(){const t=xd();return t.subtle||t.webkitSubtle}Si.getSubtleCrypto=b_;function TA(){return!!xd()&&!!b_()}Si.isBrowserCryptoAvailable=TA;var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.isBrowser=Ei.isNode=Ei.isReactNative=void 0;function __(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ei.isReactNative=__;function w_(){return typeof kr<"u"&&typeof kr.versions<"u"&&typeof kr.versions.node<"u"}Ei.isNode=w_;function xA(){return!__()&&!w_()}Ei.isBrowser=xA;(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=g_.exports;e.__exportStar(Si,t),e.__exportStar(Ei,t)})(m_);function S_(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Pd(t=6){return BigInt(S_(t))}function _c(t,e,r){return{id:r||S_(),jsonrpc:"2.0",method:t,params:e}}function Id(t,e){return{id:t,jsonrpc:"2.0",result:e}}function kd(t,e,r){return{id:t,jsonrpc:"2.0",error:PA(e,r)}}function PA(t,e){return typeof t>"u"?ay(y_):(typeof t=="string"&&(t=Object.assign(Object.assign({},ay(Td)),{message:t})),typeof e<"u"&&(t.data=e),EA(t.code)&&(t=OA(t.code)),t)}class IA{}class kA extends IA{constructor(){super()}}class RA extends kA{constructor(e){super()}}const CA="^wss?:";function NA(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function jA(t,e){const r=NA(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function sy(t){return jA(t,CA)}function LA(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function E_(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Rd(t){return E_(t)&&"method"in t}function wc(t){return E_(t)&&(fi(t)||Do(t))}function fi(t){return"result"in t}function Do(t){return"error"in t}class MA extends RA{constructor(e){super(e),this.events=new So.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(_c(e.method,e.params||[],e.id||Pd().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{Do(a)?i(a.error):n(a.result)});try{await this.connection.send(e,r)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),wc(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const DA=()=>typeof WebSocket<"u"?WebSocket:typeof mo<"u"&&typeof mo.WebSocket<"u"?mo.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),UA=()=>typeof WebSocket<"u"||typeof mo<"u"&&typeof mo.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",uy=t=>t.split("?")[0],cy=10,FA=DA();class BA{constructor(e){if(this.url=e,this.events=new So.exports.EventEmitter,this.registering=!1,!sy(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(pd(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!sy(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=m_.isReactNative()?void 0:{rejectUnauthorized:!LA(e)},a=new FA(e,[],i);UA()?a.onerror=s=>{const u=s;n(this.emitError(u.error))}:a.on("error",s=>{n(this.emitError(s))}),a.onopen=()=>{this.onOpen(a),r(a)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Ab(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=kd(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return AA(e,uy(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>cy&&this.events.setMaxListeners(cy)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${uy(this.url)}`));return this.events.emit("register_error",r),r}}var Mp={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,u="[object Arguments]",c="[object Array]",f="[object AsyncFunction]",l="[object Boolean]",o="[object Date]",w="[object Error]",p="[object Function]",d="[object GeneratorFunction]",S="[object Map]",v="[object Number]",O="[object Null]",h="[object Object]",g="[object Promise]",A="[object Proxy]",m="[object RegExp]",x="[object Set]",y="[object String]",_="[object Symbol]",L="[object Undefined]",b="[object WeakMap]",T="[object ArrayBuffer]",I="[object DataView]",k="[object Float32Array]",N="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",X="[object Int32Array]",ae="[object Uint8Array]",K="[object Uint8ClampedArray]",z="[object Uint16Array]",H="[object Uint32Array]",E=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,Q={};Q[k]=Q[N]=Q[C]=Q[D]=Q[X]=Q[ae]=Q[K]=Q[z]=Q[H]=!0,Q[u]=Q[c]=Q[T]=Q[l]=Q[I]=Q[o]=Q[w]=Q[p]=Q[S]=Q[v]=Q[h]=Q[m]=Q[x]=Q[y]=Q[b]=!1;var fe=typeof Et=="object"&&Et&&Et.Object===Object&&Et,Z=typeof self=="object"&&self&&self.Object===Object&&self,pe=fe||Z||Function("return this")(),ge=e&&!e.nodeType&&e,j=ge&&!0&&t&&!t.nodeType&&t,te=j&&j.exports===ge,ye=te&&fe.process,_e=function(){try{return ye&&ye.binding&&ye.binding("util")}catch{}}(),Ye=_e&&_e.isTypedArray;function Ke(et,St){for(var Jt=-1,yr=et==null?0:et.length,nn=0,jr=[];++Jt-1}function Ft(et,St){var Jt=this.__data__,yr=Ot(Jt,et);return yr<0?(++this.size,Jt.push([et,St])):Jt[yr][1]=St,this}qt.prototype.clear=zt,qt.prototype.delete=rr,qt.prototype.get=gt,qt.prototype.has=kt,qt.prototype.set=Ft;function Mt(et){var St=-1,Jt=et==null?0:et.length;for(this.clear();++StIn))return!1;var zr=jr.get(et);if(zr&&jr.get(St))return zr==St;var xn=-1,Qr=!0,gn=Jt&a?new Fe:void 0;for(jr.set(et,St),jr.set(St,et);++xn-1&&et%1==0&&et-1&&et%1==0&&et<=s}function ci(et){var St=typeof et;return et!=null&&(St=="object"||St=="function")}function To(et){return et!=null&&typeof et=="object"}var Zn=Ye?Ne(Ye):Er;function li(et){return Fi(et)?mt(et):Tr(et)}function xo(){return[]}function zo(){return!1}t.exports=qo})(Mp,Mp.exports);var $A=Mp.exports;function VA(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(g);O!==h;){for(var m=d[O],x=0,y=g-1;(m!==0||x>>0,A[y]=m%u>>>0,m=m/u>>>0;if(m!==0)throw new Error("Non-zero carry");v=x,O++}for(var _=g-v;_!==g&&A[_]===0;)_++;for(var L=c.repeat(S);_>>0,g=new Uint8Array(h);d[S];){var A=r[d.charCodeAt(S)];if(A===255)return;for(var m=0,x=h-1;(A!==0||m>>0,g[x]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");O=m,S++}if(d[S]!==" "){for(var y=h-O;y!==h&&g[y]===0;)y++;for(var _=new Uint8Array(v+(h-y)),L=v;y!==h;)_[L++]=g[y++];return _}}}function p(d){var S=w(d);if(S)return S;throw new Error(`Non-${e} character`)}return{encode:o,decodeUnsafe:w,decode:p}}var qA=VA,zA=qA;const O_=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},KA=t=>new TextEncoder().encode(t),HA=t=>new TextDecoder().decode(t);class WA{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class GA{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return A_(this,e)}}class YA{constructor(e){this.decoders=e}or(e){return A_(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const A_=(t,e)=>new YA({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class XA{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new WA(e,r,n),this.decoder=new GA(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Sc=({name:t,prefix:e,encode:r,decode:n})=>new XA(t,e,r,n),Us=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=zA(r,e);return Sc({prefix:t,name:e,encode:n,decode:a=>O_(i(a))})},QA=(t,e,r,n)=>{const i={};for(let l=0;l=8&&(u-=8,s[f++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return s},JA=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&u>>s];if(s&&(a+=e[i&u<Sc({prefix:e,name:t,encode(i){return JA(i,n,r)},decode(i){return QA(i,n,r,t)}}),ZA=Sc({prefix:"\0",name:"identity",encode:t=>HA(t),decode:t=>KA(t)});var eT=Object.freeze({__proto__:null,identity:ZA});const tT=ro({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var rT=Object.freeze({__proto__:null,base2:tT});const nT=ro({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var oT=Object.freeze({__proto__:null,base8:nT});const iT=Us({prefix:"9",name:"base10",alphabet:"0123456789"});var aT=Object.freeze({__proto__:null,base10:iT});const sT=ro({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),uT=ro({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var cT=Object.freeze({__proto__:null,base16:sT,base16upper:uT});const lT=ro({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),fT=ro({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),pT=ro({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dT=ro({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hT=ro({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yT=ro({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vT=ro({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),mT=ro({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),gT=ro({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var bT=Object.freeze({__proto__:null,base32:lT,base32upper:fT,base32pad:pT,base32padupper:dT,base32hex:hT,base32hexupper:yT,base32hexpad:vT,base32hexpadupper:mT,base32z:gT});const _T=Us({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),wT=Us({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ST=Object.freeze({__proto__:null,base36:_T,base36upper:wT});const ET=Us({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),OT=Us({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var AT=Object.freeze({__proto__:null,base58btc:ET,base58flickr:OT});const TT=ro({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),xT=ro({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),PT=ro({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),IT=ro({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var kT=Object.freeze({__proto__:null,base64:TT,base64pad:xT,base64url:PT,base64urlpad:IT});const T_=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),RT=T_.reduce((t,e,r)=>(t[r]=e,t),[]),CT=T_.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function NT(t){return t.reduce((e,r)=>(e+=RT[r],e),"")}function jT(t){const e=[];for(const r of t){const n=CT[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const LT=Sc({prefix:"\u{1F680}",name:"base256emoji",encode:NT,decode:jT});var MT=Object.freeze({__proto__:null,base256emoji:LT}),DT=x_,ly=128,UT=127,FT=~UT,BT=Math.pow(2,31);function x_(t,e,r){e=e||[],r=r||0;for(var n=r;t>=BT;)e[r++]=t&255|ly,t/=128;for(;t&FT;)e[r++]=t&255|ly,t>>>=7;return e[r]=t|0,x_.bytes=r-n+1,e}var $T=Dp,VT=128,fy=127;function Dp(t,n){var r=0,n=n||0,i=0,a=n,s,u=t.length;do{if(a>=u)throw Dp.bytes=0,new RangeError("Could not decode varint");s=t[a++],r+=i<28?(s&fy)<=VT);return Dp.bytes=a-n,r}var qT=Math.pow(2,7),zT=Math.pow(2,14),KT=Math.pow(2,21),HT=Math.pow(2,28),WT=Math.pow(2,35),GT=Math.pow(2,42),YT=Math.pow(2,49),XT=Math.pow(2,56),QT=Math.pow(2,63),JT=function(t){return t(P_.encode(t,e,r),e),dy=t=>P_.encodingLength(t),Up=(t,e)=>{const r=e.byteLength,n=dy(t),i=n+dy(r),a=new Uint8Array(i+r);return py(t,a,0),py(r,a,n),a.set(e,i),new ex(t,r,e,a)};class ex{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const I_=({name:t,code:e,encode:r})=>new tx(t,e,r);class tx{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Up(this.code,r):r.then(n=>Up(this.code,n))}else throw Error("Unknown type, must be binary type")}}const k_=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),rx=I_({name:"sha2-256",code:18,encode:k_("SHA-256")}),nx=I_({name:"sha2-512",code:19,encode:k_("SHA-512")});var ox=Object.freeze({__proto__:null,sha256:rx,sha512:nx});const R_=0,ix="identity",C_=O_,ax=t=>Up(R_,C_(t)),sx={code:R_,name:ix,encode:C_,digest:ax};var ux=Object.freeze({__proto__:null,identity:sx});new TextEncoder,new TextDecoder;const hy={...eT,...rT,...oT,...aT,...cT,...bT,...ST,...AT,...kT,...MT};({...ox,...ux});function N_(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function cx(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?N_(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function j_(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const yy=j_("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Gf=j_("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=cx(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:a}=gr("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=rn.generateChildLogger(r,this.name)}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,c_(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?l_(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $x{constructor(e,r,n){this.core=e,this.logger=r,this.name=yx,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),a=Fh(i);return Gb(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=f3();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),s=Fh(a),u=jp();return await bO(u,i,vx,s)},this.generateSharedKey=(i,a,s)=>{this.isInitialized();const u=this.getPrivateKey(i),c=p3(u,a);return this.setSymKey(c,s)},this.setSymKey=async(i,a)=>{this.isInitialized();const s=a||d3(i);return await this.keychain.set(s,i),s},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,a,s)=>{this.isInitialized();const u=s_(s),c=pd(a);if(Xh(u)){const w=u.senderPublicKey,p=u.receiverPublicKey;i=await this.generateSharedKey(w,p)}const f=this.getSymKey(i),{type:l,senderPublicKey:o}=u;return y3({type:l,symKey:f,message:c,senderPublicKey:o})},this.decode=async(i,a,s)=>{this.isInitialized();const u=g3(a,s);if(Xh(u)){const c=u.receiverPublicKey,f=u.senderPublicKey;i=await this.generateSharedKey(c,f)}try{const c=this.getSymKey(i),f=v3({symKey:c,encoded:a});return Ab(f)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=i=>{const a=Xu(i);return Ms(a.type)},this.getPayloadSenderPublicKey=i=>{const a=Xu(i);return a.senderPublicKey?fo(a.senderPublicKey,lo):void 0},this.core=e,this.logger=rn.generateChildLogger(r,this.name),this.keychain=n||new Bx(this.core,this.logger)}get context(){return rn.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(vy)}catch{e=jp(),await this.keychain.set(vy,e)}return fx(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Vx extends e5{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=bx,this.version=_x,this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const a=Ia(i);let s=this.messages.get(n);return typeof s>"u"&&(s={}),typeof s[a]<"u"||(s[a]=i,this.messages.set(n,s),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),s=Ia(i);return typeof a[s]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=rn.generateChildLogger(e,this.name),this.core=r}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,c_(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?l_(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class qx extends t5{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new So.exports.EventEmitter,this.name=Sx,this.queue=new Map,this.publishTimeout=Or.toMiliseconds(Or.TEN_SECONDS),this.queueTimeout=Or.toMiliseconds(Or.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});try{const s=a?.ttl||wx,u=Lp(a),c=a?.prompt||!1,f=a?.tag||0,l=a?.id||Pd().toString(),o={topic:n,message:i,opts:{ttl:s,relay:u,prompt:c,tag:f,id:l}},w=setTimeout(()=>this.queue.set(l,o),this.queueTimeout);try{await await Qu(this.rpcPublish(n,i,s,u,c,f,l),this.publishTimeout),clearTimeout(w),this.relayer.events.emit(Ln.publish,o)}catch{this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0;return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}})}catch(s){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(s),s}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=rn.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return rn.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,a,s,u){var c,f,l,o;const w={method:Fu(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:a,tag:s},id:u};return co((c=w.params)==null?void 0:c.prompt)&&((f=w.params)==null||delete f.prompt),co((l=w.params)==null?void 0:l.tag)&&((o=w.params)==null||delete o.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:w}),this.relayer.request(w)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ln.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ln.message_ack,e=>{this.onPublish(e.id.toString())})}}class zx{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(a=>a!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Kx=Object.defineProperty,Hx=Object.defineProperties,Wx=Object.getOwnPropertyDescriptors,by=Object.getOwnPropertySymbols,Gx=Object.prototype.hasOwnProperty,Yx=Object.prototype.propertyIsEnumerable,_y=(t,e,r)=>e in t?Kx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fs=(t,e)=>{for(var r in e||(e={}))Gx.call(e,r)&&_y(t,r,e[r]);if(by)for(var r of by(e))Yx.call(e,r)&&_y(t,r,e[r]);return t},Xf=(t,e)=>Hx(t,Wx(e));class Xx extends o5{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new zx,this.events=new So.exports.EventEmitter,this.name=Rx,this.version=Cx,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=xi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const a=Lp(i),s={topic:n,relay:a};this.pending.set(n,s);const u=await this.rpcSubscribe(n,a);return this.onSubscribe(u,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,a)=>{const s=new Or.Watch;s.start(this.pendingSubscriptionWatchLabel);const u=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(u),s.stop(this.pendingSubscriptionWatchLabel),i(!0)),s.elapsed(this.pendingSubscriptionWatchLabel)>=Nx&&(clearInterval(u),s.stop(this.pendingSubscriptionWatchLabel),a(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=rn.generateChildLogger(r,this.name),this.clientId=""}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Lp(n);await this.rpcUnsubscribe(e,r,i);const a=Yn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:Fu(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Qu(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ln.connection_stalled)}return Ia(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Fu(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Qu(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Ln.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:Fu(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,Xf(fs({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,fs({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,fs({},r)),this.topicMap.set(r.topic,e),this.events.emit(Xo.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Xo.deleted,Xf(fs({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Xo.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Ds(r)&&this.onBatchSubscribe(r.map((n,i)=>Xf(fs({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Ln.connect,async()=>{await this.onConnect()}),this.relayer.on(Ln.disconnect,()=>{this.onDisconnect()}),this.events.on(Xo.created,async e=>{const r=Xo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Xo.deleted,async e=>{const r=Xo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var Qx=Object.defineProperty,wy=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Zx=Object.prototype.propertyIsEnumerable,Sy=(t,e,r)=>e in t?Qx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e4=(t,e)=>{for(var r in e||(e={}))Jx.call(e,r)&&Sy(t,r,e[r]);if(wy)for(var r of wy(e))Zx.call(e,r)&&Sy(t,r,e[r]);return t};class t4 extends r5{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new So.exports.EventEmitter,this.name=Ox,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?rn.generateChildLogger(e.logger,this.name):rn.pino(rn.getDefaultLoggerOptions({level:e.logger||Ex})),this.messages=new Vx(this.logger,e.core),this.subscriber=new Xx(this,this.logger),this.publisher=new qx(this,this.logger),this.relayUrl=e?.relayUrl||D_,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${my}...`),await this.restartTransport(my)}this.registerEventListeners(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},Px)}get context(){return rn.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";return i||(await Promise.all([new Promise(a=>{this.subscriber.once(Xo.created,s=>{s.topic===e&&a()})}),new Promise(async a=>{i=await this.subscriber.subscribe(e,r),a()})]),i)}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(Ln.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(Xo.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await Qu(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(Ln.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(Ln.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(Ln.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise(r=>{this.provider.once(cs.disconnect,()=>{r()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new MA(new BA(I3({sdkVersion:xx,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Rd(e)){if(!e.method.endsWith(Ax))return;const r=e.params,{topic:n,message:i,publishedAt:a}=r.data,s={topic:n,message:i,publishedAt:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(e4({type:"event",event:r.id},s)),this.events.emit(r.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else wc(e)&&this.events.emit(Ln.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ln.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Id(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(cs.payload,e=>this.onProviderPayload(e)),this.provider.on(cs.connect,()=>{this.events.emit(Ln.connect)}),this.provider.on(cs.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(cs.error,e=>{this.logger.error(e),this.events.emit(Ln.error,e)})}registerEventListeners(){this.events.on(Ln.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(Ln.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},Or.toMiliseconds(Tx))}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var r4=Object.defineProperty,Ey=Object.getOwnPropertySymbols,n4=Object.prototype.hasOwnProperty,o4=Object.prototype.propertyIsEnumerable,Oy=(t,e,r)=>e in t?r4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ay=(t,e)=>{for(var r in e||(e={}))n4.call(e,r)&&Oy(t,r,e[r]);if(Ey)for(var r of Ey(e))o4.call(e,r)&&Oy(t,r,e[r]);return t};class Ec extends n5{constructor(e,r,n,i=xi,a=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Ix,this.cached=[],this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{this.getKey&&s!==null&&!co(s)?this.map.set(this.getKey(s),s):J3(s)?this.map.set(s.id,s):Z3(s)&&this.map.set(s.topic,s)}),this.cached=[],this.initialized=!0)},this.set=async(s,u)=>{this.isInitialized(),this.map.has(s)?await this.update(s,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:u}),this.map.set(s,u),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(u=>Object.keys(s).every(c=>$A(u[c],s[c]))):this.values),this.update=async(s,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:u});const c=Ay(Ay({},this.getData(s)),u);this.map.set(s,c),await this.persist()},this.delete=async(s,u)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:u}),this.map.delete(s),await this.persist())},this.logger=rn.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=a}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class i4{constructor(e,r){this.core=e,this.logger=r,this.name=jx,this.version=Lx,this.events=new lb,this.initialized=!1,this.storagePrefix=xi,this.ignoredPayloadTypes=[ua],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=jp(),i=await this.core.crypto.setSymKey(n),a=Mo(Or.FIVE_MINUTES),s={protocol:M_},u={topic:i,expiry:a,relay:s,active:!1},c=V3({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:s});return await this.pairings.set(i,u),await this.core.relayer.subscribe(i),this.core.expirer.set(i,a),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:a,relay:s}=F3(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const u=Mo(Or.FIVE_MINUTES),c={topic:i,relay:s,expiry:u,active:!1};return await this.pairings.set(i,c),await this.core.crypto.setSymKey(a,i),await this.core.relayer.subscribe(i,{relay:s}),this.core.expirer.set(i,u),n.activatePairing&&await this.activate({topic:i}),c},this.activate=async({topic:n})=>{this.isInitialized();const i=Mo(Or.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:u,reject:c}=Aa();this.events.once($n("pairing_ping",a),({error:f})=>{f?c(f):u()}),await s()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Yn("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,a)=>{const s=_c(i,a),u=await this.core.crypto.encode(n,s),c=ls[i].req;return this.core.history.set(n,s),this.core.relayer.publish(n,u,c),s.id},this.sendResult=async(n,i,a)=>{const s=Id(n,a),u=await this.core.crypto.encode(i,s),c=await this.core.history.get(i,n),f=ls[c.request.method].res;await this.core.relayer.publish(i,u,f),await this.core.history.resolve(s)},this.sendError=async(n,i,a)=>{const s=kd(n,a),u=await this.core.crypto.encode(i,s),c=await this.core.history.get(i,n),f=ls[c.request.method]?ls[c.request.method].res:ls.unregistered_method.res;await this.core.relayer.publish(i,u,f),await this.core.history.resolve(s)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Yn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>_i(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,s=(await this.core.history.get(i,a.id)).request.method;switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit("pairing_ping",{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{fi(i)?this.events.emit($n("pairing_ping",a),{}):Do(i)&&this.events.emit($n("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:s}=i;try{if(this.registeredMethods.includes(s))return;const u=Yn("WC_METHOD_UNSUPPORTED",s);await this.sendError(a,n,u),this.logger.error(u)}catch(u){await this.sendError(a,n,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Yn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!po(n)){const{message:i}=gr("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Q3(n.uri)){const{message:i}=gr("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!po(n)){const{message:a}=gr("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!po(n)){const{message:a}=gr("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Xn(n,!1)){const{message:i}=gr("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=gr("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(_i(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=gr("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=rn.generateChildLogger(r,this.name),this.pairings=new Ec(this.core,this.logger,this.name,this.storagePrefix)}get context(){return rn.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ln.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{Rd(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):wc(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(ko.expired,async e=>{const{topic:r}=p_(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class a4 extends ZE{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new So.exports.EventEmitter,this.name=Mx,this.version=Dx,this.cached=[],this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const s={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Mo(Or.THIRTY_DAYS)};this.records.set(s.id,s),this.events.emit(Yo.created,s)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Do(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Yo.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(Yo.deleted,a)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=rn.generateChildLogger(r,this.name)}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:_c(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Yo.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Yo.created,e=>{const r=Yo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Yo.updated,e=>{const r=Yo.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Yo.deleted,e=>{const r=Yo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Or.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class s4 extends i5{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new So.exports.EventEmitter,this.name=Ux,this.version=Fx,this.cached=[],this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const a=this.formatTarget(n),s={target:a,expiry:i};this.expirations.set(a,s),this.checkExpiry(a,s),this.events.emit(ko.created,{target:a,expiration:s})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(ko.deleted,{target:i,expiration:a})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=rn.generateChildLogger(r,this.name)}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return k3(e);if(typeof e=="number")return R3(e);const{message:r}=gr("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(ko.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Or.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(ko.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(ko.created,e=>{const r=ko.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ko.expired,e=>{const r=ko.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ko.deleted,e=>{const r=ko.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class u4 extends a5{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=Yf,this.initialized=!1,this.init=async n=>{u_()||!Ed()||(this.verifyUrl=n?.verifyUrl||gy,await this.createIframe())},this.register=async n=>{var i;if(this.initialized||await this.init(),!!this.iframe)try{(i=this.iframe.contentWindow)==null||i.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async n=>{var i;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const a=this.startAbortTimer(Or.FIVE_SECONDS),s=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(a),s.status===200?(i=await s.json())==null?void 0:i.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,i)=>{if(document.getElementById(Yf))return n();const a=document.createElement("iframe");a.setAttribute("id",Yf),a.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),a.style.display="none",a.addEventListener("load",()=>{this.initialized=!0,n()}),a.addEventListener("error",s=>{i(s)}),document.body.append(a),this.iframe=a}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),Or.toMiliseconds(Or.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=rn.generateChildLogger(r,this.name),this.verifyUrl=gy,this.abortController=new AbortController,this.isDevEnv=Sd()&&{}.IS_VITEST}get context(){return rn.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout(()=>this.abortController.abort(),Or.toMiliseconds(e))}}var c4=Object.defineProperty,Ty=Object.getOwnPropertySymbols,l4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,xy=(t,e,r)=>e in t?c4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Py=(t,e)=>{for(var r in e||(e={}))l4.call(e,r)&&xy(t,r,e[r]);if(Ty)for(var r of Ty(e))f4.call(e,r)&&xy(t,r,e[r]);return t};class Nd extends JE{constructor(e){super(e),this.protocol=L_,this.version=px,this.name=Cd,this.events=new So.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||D_;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:rn.pino(rn.getDefaultLoggerOptions({level:e?.logger||dx.logger}));this.logger=rn.generateChildLogger(r,this.name),this.heartbeat=new qa.HeartBeat,this.crypto=new $x(this,this.logger,e?.keychain),this.history=new a4(this,this.logger),this.expirer=new s4(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new EE(Py(Py({},hx),e?.storageOptions)),this.relayer=new t4({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new i4(this,this.logger),this.verify=new u4(this.projectId||"",this.logger)}static async init(e){const r=new Nd(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(kx,n),r}get context(){return rn.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const p4=Nd,U_="wc",F_=2,B_="client",jd=`${U_}@${F_}:${B_}:`,Qf={name:B_,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Iy="WALLETCONNECT_DEEPLINK_CHOICE",d4="proposal",h4="Proposal expired",y4="session",Iu=Or.SEVEN_DAYS,v4="engine",ps={wc_sessionPropose:{req:{ttl:Or.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Or.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Or.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Or.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Or.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Or.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Or.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Or.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Or.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Or.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Or.THIRTY_SECONDS,prompt:!1,tag:1115}}},Jf={min:Or.FIVE_MINUTES,max:Or.SEVEN_DAYS},ds={idle:"idle",active:"active"},m4="request",g4=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var b4=Object.defineProperty,_4=Object.defineProperties,w4=Object.getOwnPropertyDescriptors,ky=Object.getOwnPropertySymbols,S4=Object.prototype.hasOwnProperty,E4=Object.prototype.propertyIsEnumerable,Ry=(t,e,r)=>e in t?b4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Io=(t,e)=>{for(var r in e||(e={}))S4.call(e,r)&&Ry(t,r,e[r]);if(ky)for(var r of ky(e))E4.call(e,r)&&Ry(t,r,e[r]);return t},Zf=(t,e)=>_4(t,w4(e));class O4 extends u5{constructor(e){super(e),this.name=v4,this.events=new lb,this.initialized=!1,this.ignoredPayloadTypes=[ua],this.requestQueue={state:ds.idle,requests:[]},this.requestQueueDelay=Or.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(ps)}),this.initialized=!0,setTimeout(()=>{this.requestQueue.requests=this.getPendingSessionRequests(),this.processRequestQueue()},Or.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized();const n=Zf(Io({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:s,sessionProperties:u,relays:c}=n;let f=i,l,o=!1;if(f&&(o=this.client.core.pairing.pairings.get(f).active),!f||!o){const{topic:g,uri:A}=await this.client.core.pairing.create();f=g,l=A}const w=await this.client.core.crypto.generateKeyPair(),p=Io({requiredNamespaces:a,optionalNamespaces:s,relays:c??[{protocol:M_}],proposer:{publicKey:w,metadata:this.client.metadata}},u&&{sessionProperties:u}),{reject:d,resolve:S,done:v}=Aa(Or.FIVE_MINUTES,h4);if(this.events.once($n("session_connect"),async({error:g,session:A})=>{if(g)d(g);else if(A){A.self.publicKey=w;const m=Zf(Io({},A),{requiredNamespaces:A.requiredNamespaces,optionalNamespaces:A.optionalNamespaces});await this.client.session.set(A.topic,m),await this.setExpiry(A.topic,A.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:A.peer.metadata}),S(m)}}),!f){const{message:g}=gr("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(g)}const O=await this.sendRequest(f,"wc_sessionPropose",p),h=Mo(Or.FIVE_MINUTES);return await this.setProposal(O,Io({id:O,expiry:h},p)),{uri:l,approval:v}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:a,sessionProperties:s}=r,u=this.client.proposal.get(n);let{pairingTopic:c,proposer:f,requiredNamespaces:l,optionalNamespaces:o}=u;c=c||"",gs(l)||(l=H3(a,"approve()"));const w=await this.client.core.crypto.generateKeyPair(),p=f.publicKey,d=await this.client.core.crypto.generateSharedKey(w,p);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:f.metadata}),await this.sendResult(n,c,{relay:{protocol:i??"irn"},responderPublicKey:w}),await this.client.proposal.delete(n,Yn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const S=Io({relay:{protocol:i??"irn"},namespaces:a,requiredNamespaces:l,optionalNamespaces:o,pairingTopic:c,controller:{publicKey:w,metadata:this.client.metadata},expiry:Mo(Iu)},s&&{sessionProperties:s});await this.client.core.relayer.subscribe(d),await this.sendRequest(d,"wc_sessionSettle",S);const v=Zf(Io({},S),{topic:d,pairingTopic:c,acknowledged:!1,self:S.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:w});return await this.client.session.set(d,v),await this.setExpiry(d,Mo(Iu)),{topic:d,acknowledged:()=>new Promise(O=>setTimeout(()=>O(this.client.session.get(d)),500))}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:a}=this.client.proposal.get(n);a&&(await this.sendError(n,a,i),await this.client.proposal.delete(n,Yn("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,a=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:s,resolve:u,reject:c}=Aa();return this.events.once($n("session_update",a),({error:f})=>{f?c(f):u()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:a,resolve:s,reject:u}=Aa();return this.events.once($n("session_extend",i),({error:c})=>{c?u(c):s()}),await this.setExpiry(n,Mo(Iu)),{acknowledged:a}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:a,expiry:s}=r,u=await this.sendRequest(a,"wc_sessionRequest",{request:i,chainId:n},s),{done:c,resolve:f,reject:l}=Aa(s);this.events.once($n("session_request",u),({error:w,result:p})=>{w?l(w):f(p)}),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:u});const o=await this.client.core.storage.getItem(Iy);return C3({id:u,topic:a,wcDeepLink:o}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:a}=i;fi(i)?await this.sendResult(a,n,i.result):Do(i)&&await this.sendError(a,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:a,resolve:s,reject:u}=Aa();this.events.once($n("session_ping",i),({error:c})=>{c?u(c):s()}),await a()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:a}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:a})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=Pd().toString();let a;const s=u=>{u?.id.toString()===i&&(this.client.core.relayer.events.removeListener(Ln.message_ack,s),a())};await Promise.all([new Promise(u=>{a=u,this.client.core.relayer.on(Ln.message_ack,s)}),this.sendRequest(n,"wc_sessionDelete",Yn("USER_DISCONNECTED"),void 0,i)]),await this.deleteSession(n)}else await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Y3(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var s,u;return((s=a.peerMetadata)==null?void 0:s.url)&&((u=a.peerMetadata)==null?void 0:u.url)===r.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,Yn("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(Iy).catch(a=>this.client.logger.warn(a))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Yn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.requestQueue.requests=this.requestQueue.requests.filter(a=>a.id!==r),i&&(this.requestQueue.state=ds.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=ps.wc_sessionRequest.req.ttl,{id:i,topic:a,params:s}=r;await this.client.pendingRequest.set(i,{id:i,topic:a,params:s}),n&&this.client.core.expirer.set(i,Mo(n))},this.sendRequest=async(r,n,i,a,s)=>{const u=_c(n,i);if(Ed()&&g4.includes(n)){const l=Ia(JSON.stringify(u));await this.client.core.verify.register({attestationId:l})}const c=await this.client.core.crypto.encode(r,u),f=ps[n].req;return a&&(f.ttl=a),s&&(f.id=s),this.client.core.history.set(r,u),this.client.core.relayer.publish(r,c,f),u.id},this.sendResult=async(r,n,i)=>{const a=Id(r,i),s=await this.client.core.crypto.encode(n,a),u=await this.client.core.history.get(n,r),c=ps[u.request.method].res;this.client.core.relayer.publish(n,s,c),await this.client.core.history.resolve(a)},this.sendError=async(r,n,i)=>{const a=kd(r,i),s=await this.client.core.crypto.encode(n,a),u=await this.client.core.history.get(n,r),c=ps[u.request.method].res;this.client.core.relayer.publish(n,s,c),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{_i(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{_i(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,a=i.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${a}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${a}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=gr("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:a}=n;try{this.isValidConnect(Io({},n.params));const s=Mo(Or.FIVE_MINUTES),u=Io({id:a,pairingTopic:r,expiry:s},i);await this.setProposal(a,u);const c=Ia(JSON.stringify(n)),f=await this.getVerifyContext(c,u.proposer.metadata);this.client.events.emit("session_proposal",{id:a,params:u,verifyContext:f})}catch(s){await this.sendError(a,r,s),this.client.logger.error(s)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(fi(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const u=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const c=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const f=await this.client.core.crypto.generateSharedKey(u,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const l=await this.client.core.relayer.subscribe(f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:r})}else Do(n)&&(await this.client.proposal.delete(i,Yn("USER_DISCONNECTED")),this.events.emit($n("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:s,controller:u,expiry:c,namespaces:f,requiredNamespaces:l,optionalNamespaces:o,sessionProperties:w,pairingTopic:p}=n.params,d=Io({topic:r,relay:s,expiry:c,namespaces:f,acknowledged:!0,pairingTopic:p,requiredNamespaces:l,optionalNamespaces:o,controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},w&&{sessionProperties:w});await this.sendResult(n.id,r,!0),this.events.emit($n("session_connect"),{session:d}),this.cleanupDuplicatePairings(d)}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;fi(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit($n("session_approve",i),{})):Do(n)&&(await this.client.session.delete(r,Yn("USER_DISCONNECTED")),this.events.emit($n("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:a}=n;try{this.isValidUpdate(Io({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(a,r,!0),this.client.events.emit("session_update",{id:a,topic:r,params:i})}catch(s){await this.sendError(a,r,s),this.client.logger.error(s)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;fi(n)?this.events.emit($n("session_update",i),{}):Do(n)&&this.events.emit($n("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Mo(Iu)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(a){await this.sendError(i,r,a),this.client.logger.error(a)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;fi(n)?this.events.emit($n("session_extend",i),{}):Do(n)&&this.events.emit($n("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(a){await this.sendError(i,r,a),this.client.logger.error(a)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{fi(n)?this.events.emit($n("session_ping",i),{}):Do(n)&&this.events.emit($n("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once(Ln.publish,async()=>{a(await this.deleteSession(r))})}),this.sendResult(i,r,!0)]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidRequest(Io({topic:r},a)),await this.setPendingSessionRequest({id:i,topic:r,params:a}),this.addRequestToQueue({id:i,topic:r,params:a}),await this.processRequestQueue()}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;fi(n)?this.events.emit($n("session_request",i),{result:n.result}):Do(n)&&this.events.emit($n("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidEmit(Io({topic:r},a)),this.client.events.emit("session_event",{id:i,topic:r,params:a})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.addRequestToQueue=r=>{this.requestQueue.requests.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.requestQueue.state=ds.idle,this.processRequestQueue()},Or.toMiliseconds(this.requestQueueDelay))},this.processRequestQueue=async()=>{if(this.requestQueue.state===ds.active){this.client.logger.info("session request queue is already active.");return}const r=this.requestQueue.requests[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{const{id:n,topic:i,params:a}=r,s=Ia(JSON.stringify({id:n,params:a})),u=this.client.session.get(i),c=await this.getVerifyContext(s,u.peer.metadata);this.requestQueue.state=ds.active,this.client.events.emit("session_request",{id:n,topic:i,params:a,verifyContext:c})}catch(n){this.client.logger.error(n)}},this.isValidConnect=async r=>{if(!po(r)){const{message:c}=gr("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:s,relays:u}=r;if(co(n)||await this.isValidPairingTopic(n),!sA(u,!0)){const{message:c}=gr("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(c)}!co(i)&&gs(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!co(a)&&gs(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),co(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=aA(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!po(r))throw new Error(gr("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:s}=r;await this.isValidProposalId(n);const u=this.client.proposal.get(n),c=Bu(i,"approve()");if(c)throw new Error(c.message);const f=oy(u.requiredNamespaces,i,"approve()");if(f)throw new Error(f.message);if(!Xn(a,!0)){const{message:l}=gr("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(l)}co(s)||this.validateSessionProps(s,"sessionProperties")},this.isValidReject=async r=>{if(!po(r)){const{message:a}=gr("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(a)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!cA(i)){const{message:a}=gr("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=r=>{if(!po(r)){const{message:f}=gr("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(f)}const{relay:n,controller:i,namespaces:a,expiry:s}=r;if(!h_(n)){const{message:f}=gr("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(f)}const u=eA(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);const c=Bu(a,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(_i(s)){const{message:f}=gr("EXPIRED","onSessionSettleRequest()");throw new Error(f)}},this.isValidUpdate=async r=>{if(!po(r)){const{message:c}=gr("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const a=this.client.session.get(n),s=Bu(i,"update()");if(s)throw new Error(s.message);const u=oy(a.requiredNamespaces,i,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async r=>{if(!po(r)){const{message:i}=gr("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!po(r)){const{message:c}=gr("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:a,expiry:s}=r;await this.isValidSessionTopic(n);const{namespaces:u}=this.client.session.get(n);if(!ny(u,a)){const{message:c}=gr("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(c)}if(!lA(i)){const{message:c}=gr("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!dA(u,a,i.method)){const{message:c}=gr("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(s&&!mA(s,Jf)){const{message:c}=gr("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${Jf.min} and ${Jf.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!po(r)){const{message:a}=gr("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!fA(i)){const{message:a}=gr("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidPing=async r=>{if(!po(r)){const{message:i}=gr("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!po(r)){const{message:u}=gr("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(u)}const{topic:n,event:i,chainId:a}=r;await this.isValidSessionTopic(n);const{namespaces:s}=this.client.session.get(n);if(!ny(s,a)){const{message:u}=gr("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!pA(i)){const{message:u}=gr("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}if(!hA(s,a,i.name)){const{message:u}=gr("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}},this.isValidDisconnect=async r=>{if(!po(r)){const{message:i}=gr("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const a=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});a&&(i.verified.origin=a,i.verified.validation=a===n.url?"VALID":"INVALID")}catch(a){this.client.logger.error(a)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!Xn(i,!1)){const{message:a}=gr("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})}}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Ln.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);try{Rd(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):wc(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(a){this.client.logger.error(a)}})}registerExpirerEvents(){this.client.core.expirer.on(ko.expired,async e=>{const{topic:r,id:n}=p_(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,gr("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!Xn(e,!1)){const{message:r}=gr("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=gr("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(_i(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=gr("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Xn(e,!1)){const{message:r}=gr("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=gr("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(_i(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=gr("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Xn(e,!1)){const{message:r}=gr("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=gr("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!uA(e)){const{message:r}=gr("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=gr("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(_i(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=gr("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class A4 extends Ec{constructor(e,r){super(e,r,d4,jd),this.core=e,this.logger=r}}class T4 extends Ec{constructor(e,r){super(e,r,y4,jd),this.core=e,this.logger=r}}class x4 extends Ec{constructor(e,r){super(e,r,m4,jd,n=>n.id),this.core=e,this.logger=r}}class Ld extends s5{constructor(e){super(e),this.protocol=U_,this.version=F_,this.name=Qf.name,this.events=new So.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||Qf.name,this.metadata=e?.metadata||A3();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:rn.pino(rn.getDefaultLoggerOptions({level:e?.logger||Qf.logger}));this.core=e?.core||new p4(e),this.logger=rn.generateChildLogger(r,this.name),this.session=new T4(this.core,this.logger),this.proposal=new A4(this.core,this.logger),this.pendingRequest=new x4(this.core,this.logger),this.engine=new O4(this)}static async init(e){const r=new Ld(e);return await r.initialize(),r}get context(){return rn.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}const P4=Ld;var Fp=(t=>(t.SIGN="stellar_signXDR",t))(Fp||{});class Cy{constructor(e){this.client=e,this.client=e}PROJECT_ID=NS;PROJECT_URL=jS;PROJECT_NAME="Simple Stellar Signer";PROJECT_DESCRIPTION="Simple Signer provides an easy and secure way to implement log in and transaction signing functionality on your website for the Stellar network.";async createClient(){try{return this.client=await P4.init({projectId:this.PROJECT_ID,metadata:{name:this.PROJECT_NAME,url:this.PROJECT_URL,description:this.PROJECT_DESCRIPTION,icons:[]}}),this.client}catch(e){throw console.error(e),new vh}}async connect(e){if(!this.client)throw new Ou;const{network:r,methods:n}=e,i=new cE({projectId:this.PROJECT_ID}),a=r===Kn.PUBLIC?["stellar:pubnet"]:["stellar:testnet"],s={requiredNamespaces:{stellar:{methods:n,chains:a,events:[]}}};try{const{uri:u,approval:c}=await this.client.connect(s);return new Promise((f,l)=>{u&&i.openModal({uri:u}),c().then(o=>{i.closeModal(),f(o)}).catch(o=>{i.closeModal(),l(o)})})}catch(u){throw console.error(u),new vh}}async disconnect(e){if(!this.client)throw new Ou;try{await this.client.disconnect({topic:e,reason:{message:"Session closed",code:-1}})}catch(r){throw console.error(r),new $S}}async disconnectAllSessions(){if(!this.client)throw new Ou;const e=this.client.session.getAll();if(e.length){const r=e.map(n=>this.disconnect(n.topic));await Promise.all(r)}}async makeRequest(e){if(!this.client)throw new Ou;const{xdr:r,network:n,method:i}=e,a=this.client.session.getAll().length-1,s=this.client.session.getAll()[a];if(!s)throw new FS;const u=n===Kn.PUBLIC?"stellar:pubnet":"stellar:testnet";try{return await this.client.request({topic:s.topic,chainId:u,request:{method:i,params:{xdr:r}}})}catch(c){throw console.error(c),new BS}}}function I4(t){let e=t[0].GO_TO_CONNECT+"",r;return{c(){r=hr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&1&&e!==(e=n[0].GO_TO_CONNECT+"")&&br(r,e)},d(n){n&&Wt(r)}}}function k4(t){let e=t[0].GO_TO_SIGN+"",r;return{c(){r=hr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&1&&e!==(e=n[0].GO_TO_SIGN+"")&&br(r,e)},d(n){n&&Wt(r)}}}function R4(t){let e=t[0].GO_TO_PAYMENT+"",r;return{c(){r=hr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&1&&e!==(e=n[0].GO_TO_PAYMENT+"")&&br(r,e)},d(n){n&&Wt(r)}}}function C4(t){let e,r,n,i,a,s,u,c,f,l,o,w;return a=new xa({props:{to:"/connect",$$slots:{default:[I4]},$$scope:{ctx:t}}}),c=new xa({props:{to:"/sign",$$slots:{default:[k4]},$$scope:{ctx:t}}}),o=new xa({props:{to:"/payment",$$slots:{default:[R4]},$$scope:{ctx:t}}}),{c(){e=Ct("h1"),e.textContent="Simple Signer",r=pr(),n=Ct("div"),i=Ct("div"),Xr(a.$$.fragment),s=pr(),u=Ct("div"),Xr(c.$$.fragment),f=pr(),l=Ct("div"),Xr(o.$$.fragment)},m(p,d){Gt(p,e,d),Gt(p,r,d),Gt(p,n,d),nt(n,i),Gr(a,i,null),nt(n,s),nt(n,u),Gr(c,u,null),nt(n,f),nt(n,l),Gr(o,l,null),w=!0},p(p,[d]){const S={};d&3&&(S.$$scope={dirty:d,ctx:p}),a.$set(S);const v={};d&3&&(v.$$scope={dirty:d,ctx:p}),c.$set(v);const O={};d&3&&(O.$$scope={dirty:d,ctx:p}),o.$set(O)},i(p){w||(dr(a.$$.fragment,p),dr(c.$$.fragment,p),dr(o.$$.fragment,p),w=!0)},o(p){mr(a.$$.fragment,p),mr(c.$$.fragment,p),mr(o.$$.fragment,p),w=!1},d(p){p&&Wt(e),p&&Wt(r),p&&Wt(n),Yr(a),Yr(c),Yr(o)}}}function N4(t,e,r){let n;return Ur(t,go,i=>r(0,n=i)),[n]}class j4 extends yn{constructor(e){super(),hn(this,e,N4,C4,ln,{})}}class ku{static createOnReadyEvent(e){return{type:Ta.ON_READY,message:"Simple Signer is ready to operate",page:e}}static createOnCancelEvent(e){return{type:Ta.ON_CANCEL,message:"The operation was canceled by the user",page:e}}static createOnConnectEvent(e,r){return{type:Ta.ON_CONNECT,message:{publicKey:e,wallet:r},page:Wi.CONNECT}}static createOnSignEvent(e){return{type:Ta.ON_SIGN,message:{signedXDR:e},page:Wi.SIGN}}static createOnPaymentRequest(e,r,n,i){return{type:Ta.ON_PAYMENT,message:{receiver:e,amount:r,assetCode:n,issuer:i},page:Wi.PAYMENT}}}var Ta=(t=>(t.ON_CONNECT="onConnect",t.ON_READY="onReady",t.ON_SIGN="onSign",t.ON_CANCEL="onCancel",t.ON_PAYMENT="onPayment",t))(Ta||{}),Wi=(t=>(t.CONNECT="connect",t.SIGN="sign",t.PAYMENT="payment",t))(Wi||{});class Md{constructor(e){this.pageType=e,window.addEventListener("beforeunload",()=>{this.mainActionPerformed||this.sendMessage(ku.createOnCancelEvent(this.pageType))}),window.addEventListener("message",r=>this.messageHandler(r))}mainActionPerformed=!1;availableWalletsMessageHandlers=[];transactionMessageHandlers=[];paymentMessageHandlers=[];sendSignedTx(e){this.mainActionPerformed=!0,this.sendMessage(ku.createOnSignEvent(e)),this.closeWindow()}sendOnReadyEvent(){this.sendMessage(ku.createOnReadyEvent(this.pageType))}sendOnCancelEvent(){this.closeWindow()}sendOnConnectEvent(e,r){this.mainActionPerformed=!0,this.sendMessage(ku.createOnConnectEvent(e,r))}addAvailableWalletsMessageHandler(e){this.availableWalletsMessageHandlers.push(e)}addTransactionMessageHandler(e){this.transactionMessageHandlers.push(e)}addPaymentMessageHandler(e){this.paymentMessageHandlers.push(e)}getTransactionMessageFromUrl(e){const r=new URLSearchParams(e||window.location.search),n=r.get("xdr"),i=r.get("description");let a;return n&&i?(a=n.replace(/\s/g,"+"),{xdr:a,description:i,operationGroups:[]}):n?(a=n.replace(/\s/g,"+"),{xdr:a,description:void 0,operationGroups:[]}):null}getPaymentMessageFromUrl(e){const r=new URLSearchParams(e||window.location.search),n=r.get("receiver"),i=r.get("amount"),a=r.get("assetCode"),s=r.get("issuer");return n&&i&&a&&s?{receiver:n,amount:i,assetCode:a,issuer:s}:null}getWalletsFromUrl(){const e=window.location.search;return new URLSearchParams(e).getAll("wallets")}getRedirectFromUrl(){const e=window.location.search;return new URLSearchParams(e).get("redirect")}messageHandler(e){if("wallets"in e.data){const r=e.data;this.availableWalletsMessageHandlers.forEach(n=>n(r));return}if("xdr"in e.data){const r=e.data;this.transactionMessageHandlers.forEach(n=>n(r));return}if("receiver"in e.data&&"amount"in e.data&&"assetCode"in e.data&&"issuer"in e.data){const r=e.data;this.paymentMessageHandlers.forEach(n=>n(r));return}}closeWindow(){return window.close()}sendMessage(e){window.opener&&window.opener.postMessage(e,"*")}}function Dd(t,e,r,n){const i=window.outerWidth{if(t[0]==="#"&&(t=t.slice(1)),t.length===3){let n="";t.split("").forEach(i=>{n+=i,n+=i}),t=n}return`rgba(${(t.match(/.{2}/g)||[]).map(n=>parseInt(n,16)).join(", ")}, ${e})`},Ny=(t,e=0)=>[...Array(t).keys()].map(r=>r+e);function jy(t,e,r){const n=t.slice();return n[6]=e[r],n}function Ly(t){let e,r;return{c(){e=Ct("div"),Ve(e,"class",r="lines small-lines "+t[6]+" svelte-bnawe9"),yo(e,"--color",t[0]),yo(e,"--duration",t[2]),Jd(e,"pause-animation",t[4])},m(n,i){Gt(n,e,i)},p(n,i){i&1&&yo(e,"--color",n[0]),i&4&&yo(e,"--duration",n[2]),i&16&&Jd(e,"pause-animation",n[4])},d(n){n&&Wt(e)}}}function M4(t){let e,r=Ny(2,1),n=[];for(let i=0;i{"color"in f&&r(0,n=f.color),"unit"in f&&r(1,i=f.unit),"duration"in f&&r(2,a=f.duration),"size"in f&&r(3,s=f.size),"pause"in f&&r(4,u=f.pause)},t.$$.update=()=>{t.$$.dirty&1&&r(5,c=L4(n,.2))},[n,i,a,s,u,c]}class U4 extends yn{constructor(e){super(),hn(this,e,D4,M4,ln,{color:0,unit:1,duration:2,size:3,pause:4})}}function F4(t){let e,r,n,i;return{c(){e=Nr("svg"),r=Nr("title"),n=Nr("g"),i=Nr("path"),Ve(n,"id","icomoon-ignore"),Ve(i,"fill","#0691b7"),Ve(i,"d","M463.313 7.189h-42.172l-426.917 1009.083 1.276 0.54h113.923l85.432-201.929c177.536 59.84 369.945 58.838 546.847-2.85l86.639 204.779h60.61l1.277-0.54-426.918-1009.083zM464.169 820.903c-86.461-0.017-172.354-13.977-254.369-41.343l259.081-612.373 257.936 609.659c-84.494 29.173-173.259 44.062-262.648 44.056z"),Ve(e,"version","1.1"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"width","90%"),Ve(e,"height","auto"),Ve(e,"viewBox","0 0 896 1024")},m(a,s){Gt(a,e,s),nt(e,r),nt(e,n),nt(e,i)},p:wr,i:wr,o:wr,d(a){a&&Wt(e)}}}class B4 extends yn{constructor(e){super(),hn(this,e,null,F4,ln,{})}}function $4(t){let e,r,n,i,a,s,u,c,f,l;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),i=Nr("path"),a=Nr("path"),s=Nr("path"),u=Nr("path"),c=Nr("path"),f=Nr("path"),l=Nr("path"),Ve(r,"d","M50.3536 40.4768C51.9984 37.6281 53.9091 36.4415 55.849 36.326C59.784 36.0659 68.5813 42.545 65.7979 46.3922L71.0121 55.4883C74.3432 58.28 77.7166 60.4787 81.173 61.939C80.5269 64.6437 82.0311 65.613 83.5484 66.5672C81.5248 63.0244 85.4875 61.0567 87.6233 64.5717C89.8297 67.6662 90.4205 70.8777 89.0991 73.3792C87.1454 77.1252 81.9036 79.9011 79.5282 83.3869C84.3643 79.0053 90.8699 79.497 93.442 74.4055C95.0438 71.2525 91.0389 61.9105 89.1698 58.7575C86.2742 53.9126 82.6626 55.3151 82.2547 56.8774C78.418 54.7799 75.0032 51.4537 71.5176 48.6763C73.1478 47.2453 74.0758 45.177 72.2919 44.063C68.6374 41.7497 64.3935 34.8365 58.8843 33.4909C58.3358 33.3552 57.7771 33.2818 57.2221 33.2818C54.3506 33.2818 51.5424 35.2293 50.3536 40.4768Z"),Ve(r,"fill","#4E4B66"),Ve(n,"d","M59.7556 123C64.0818 123 68.2987 122.419 72.2956 121.341C47.6898 127.955 32.6498 99.7837 51.3516 79.9737C44.465 78.1086 40.039 71.1662 40.4739 62.8789C3.31645 90.1261 20.9402 123 59.7556 123ZM72.3029 121.339C72.3415 121.328 72.3794 121.319 72.418 121.308C72.3801 121.318 72.3408 121.329 72.3029 121.339ZM72.2956 121.341C72.2985 121.34 72.3 121.34 72.3029 121.339C72.3007 121.34 72.2978 121.34 72.2956 121.341Z"),Ve(n,"fill","#C19CFC"),Ve(i,"d","M64.3505 32.9562C65.9538 33.9975 67.4566 35.3858 68.8479 36.7884C81.876 33.9398 73.6403 21.3278 80.414 16.3967C71.8556 19.3757 77.238 33.346 64.3505 32.9562Z"),Ve(i,"fill","#C19CFC"),Ve(a,"d","M43.0321 43.1814L50.3536 40.4767C48.5689 25.7245 68.8624 19.7372 62.0042 5.00001C61.7092 21.6892 41.3873 22.0656 43.0321 43.1814Z"),Ve(a,"fill","#C19CFC"),Ve(s,"d","M61.5686 75.2015C65.2078 73.5238 68.834 71.2524 72.474 72.3229C68.4822 69.7059 63.5783 70.9638 58.6308 71.3109C51.9838 71.7734 45.2385 71.1947 40.4738 62.879C42.4982 73.3934 51.8717 79.6701 61.5686 75.2015Z"),Ve(s,"fill","#C19CFC"),Ve(u,"d","M58.8982 21.6605C54.752 27.2146 49.398 32.5948 50.3537 40.4765C51.7727 34.214 55.4979 32.6518 58.8844 33.4906C64.3935 34.8362 68.6374 41.7494 72.2919 44.0628C74.0759 45.1767 73.1479 47.245 71.5176 48.676C75.0032 51.4534 78.4181 54.7796 82.2547 56.8771C82.6627 55.3148 86.2743 53.9123 89.1698 58.7572C91.039 61.9102 95.0439 71.2522 93.4421 74.4052C90.8699 79.4967 84.3643 79.005 79.5282 83.3866C76.5773 77.9202 70.6755 76.5311 64.7024 75.6495C67.1339 73.7837 69.6069 72.106 72.4741 72.3227C68.8341 71.2522 65.2079 73.5236 61.5686 75.2013C51.8717 79.6699 42.4982 73.3932 40.4739 62.8787C40.039 71.166 44.465 78.1084 51.3516 79.9735C32.6185 99.8164 47.7401 128.048 72.418 121.308C93.4705 115.551 109 95.8104 109 72.3227C109 51.4969 96.7863 33.6068 79.3323 25.8113C80.1336 30.4246 81.1453 34.8789 73.0641 40.9825C70.5204 38.7838 67.6817 35.1113 64.3505 32.9561C71.8694 33.1877 73.1624 28.5302 74.6521 24.0181C69.8517 22.4491 64.8401 21.6523 59.8029 21.6523C59.5014 21.6523 59.1998 21.6553 58.8982 21.6605ZM58.5471 46.5943C59.4744 46.7817 60.4163 47.5628 61.2736 48.4451C62.6649 49.877 63.9863 50.1236 65.6719 48.6191L71.0121 55.488L65.7979 46.3919C65.728 47.1153 65.1518 47.2884 64.4496 47.245C63.2273 47.1678 61.6852 46.2907 60.0673 46.2899C59.5655 46.2899 59.0563 46.3746 58.5471 46.5943ZM83.5485 66.5669C84.4058 65.0774 85.5713 64.1081 87.6233 64.5714C86.8351 63.2738 85.7979 62.7235 84.9048 62.7235C83.3773 62.7235 82.2715 64.3315 83.5485 66.5669Z"),Ve(u,"fill","#C19CFC"),Ve(c,"d","M55.1038 26.6073C52.1383 30.6126 49.693 34.9238 50.3537 40.4771C51.7727 34.2146 55.4979 32.6524 58.8844 33.4912C64.3935 34.8368 68.6374 41.75 72.292 44.0634C74.0759 45.1773 73.1479 47.2456 71.5176 48.6767C75.0032 51.4541 78.4181 54.7802 82.2548 56.8777C82.6627 55.3155 86.2743 53.9129 89.1698 58.7578C91.039 61.9108 95.0439 71.2528 93.4421 74.4058C90.87 79.4973 84.3643 79.0056 79.5282 83.3872C76.5773 77.9209 70.6755 76.5317 64.7024 75.6502C67.1339 73.7843 69.6069 72.1066 72.4741 72.3233C68.8341 71.2528 65.2079 73.5242 61.5687 75.2019C51.8717 79.6705 42.4982 73.3938 40.4739 62.8794C40.039 71.1666 44.465 78.109 51.3516 79.9741C39.1533 92.8896 41.3036 109.362 51.0981 117.432C78.5594 122.985 104.418 101.422 104.418 72.3233C104.418 54.3612 94.4116 38.8137 79.8101 31.2498C79.5428 34.1569 77.9971 37.2664 73.0641 40.9831C70.5204 38.7844 67.6817 35.112 64.3505 32.9567C69.3396 33.1014 71.6021 31.1059 72.9796 28.4147C68.6942 27.0488 64.2143 26.3629 59.7308 26.3629C58.1865 26.3629 56.6415 26.4438 55.1038 26.6073Z"),Ve(c,"fill","#14142B"),Ve(f,"d","M51.3516 79.9735C32.6185 99.8164 47.7401 128.048 72.418 121.308C44.1846 122.58 46.981 89.5771 64.8852 80.1909C71.3217 81.0875 77.9541 82.2307 81.1453 88.1303C85.9654 83.7637 92.4718 84.2404 95.0577 79.1489C96.0979 77.1106 94.7773 72.4681 93.217 68.591C93.8354 70.9786 94.0736 73.1765 93.442 74.4052C90.8699 79.4967 84.3643 79.005 79.5282 83.3866C76.5773 77.9202 70.6755 76.5311 64.7024 75.6495C67.1339 73.7837 69.6069 72.106 72.474 72.3227C68.8341 71.2522 65.2079 73.5236 61.5686 75.2013C51.8717 79.6699 42.4982 73.3932 40.4739 62.8787C40.039 71.166 44.465 78.1084 51.3516 79.9735Z"),Ve(f,"fill","#262338"),Ve(l,"d","M46.6267 42.3333L53.9481 40.9619C52.1635 26.2097 70.36 22.6667 63.4378 9.00001C63.4378 22.6667 44.2245 22.4853 46.6267 42.3333Z"),Ve(l,"fill","#14142B"),Ve(e,"width","100%"),Ve(e,"height","auto"),Ve(e,"viewBox","0 0 128 128"),Ve(e,"fill","none"),Ve(e,"xmlns","http://www.w3.org/2000/svg")},m(o,w){Gt(o,e,w),nt(e,r),nt(e,n),nt(e,i),nt(e,a),nt(e,s),nt(e,u),nt(e,c),nt(e,f),nt(e,l)},p:wr,i:wr,o:wr,d(o){o&&Wt(e)}}}class V4 extends yn{constructor(e){super(),hn(this,e,null,$4,ln,{})}}function q4(t){let e,r,n;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),Ve(r,"d","M0 0h24v24H0z"),Ve(r,"fill","none"),Ve(n,"d","M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"height","100%"),Ve(e,"viewBox","0 0 24 24"),Ve(e,"width","auto"),Ve(e,"fill","#000000")},m(i,a){Gt(i,e,a),nt(e,r),nt(e,n)},p:wr,i:wr,o:wr,d(i){i&&Wt(e)}}}class My extends yn{constructor(e){super(),hn(this,e,null,q4,ln,{})}}function z4(t){let e,r,n,i,a,s,u,c;return{c(){e=Nr("svg"),r=Nr("rect"),n=Nr("path"),i=Nr("path"),a=Nr("defs"),s=Nr("linearGradient"),u=Nr("stop"),c=Nr("stop"),Ve(r,"width","48"),Ve(r,"height","48"),Ve(r,"rx","13.5"),Ve(r,"fill","url(#paint0_linear_137_303)"),Ve(n,"fill-rule","evenodd"),Ve(n,"clip-rule","evenodd"),Ve(n,"d","M22.4986 16C21.9066 13.6997 19.8185 12 17.3333 12C14.3878 12 12 14.3878 12 17.3333C12 20.2789 14.3878 22.6667 17.3333 22.6667C19.8185 22.6667 21.9066 20.967 22.4986 18.6667H27.1111V23.1111H29.7778V18.6667H31.5556V23.1111H34.2222V18.6667H36V16H22.4986ZM20 17.3333C20 18.8061 18.8061 20 17.3333 20C15.8606 20 14.6667 18.8061 14.6667 17.3333C14.6667 15.8606 15.8606 14.6667 17.3333 14.6667C18.8061 14.6667 20 15.8606 20 17.3333Z"),Ve(n,"fill","white"),Ve(i,"fill-rule","evenodd"),Ve(i,"clip-rule","evenodd"),Ve(i,"d","M25.5014 32C26.0934 34.3003 28.1815 36 30.6667 36C33.6122 36 36 33.6122 36 30.6667C36 27.7211 33.6122 25.3333 30.6667 25.3333C28.1815 25.3333 26.0934 27.033 25.5014 29.3333H20.8889V24.8889H18.2222L18.2222 29.3333H16.4444L16.4444 24.8889H13.7778L13.7778 29.3333H12L12 32H25.5014ZM28 30.6667C28 29.1939 29.1939 28 30.6667 28C32.1394 28 33.3333 29.1939 33.3333 30.6667C33.3333 32.1394 32.1394 33.3333 30.6667 33.3333C29.1939 33.3333 28 32.1394 28 30.6667Z"),Ve(i,"fill","white"),Ve(u,"stop-color","#CDADFF"),Ve(c,"offset","1"),Ve(c,"stop-color","#6432F1"),Ve(s,"id","paint0_linear_137_303"),Ve(s,"x1","48"),Ve(s,"y1","0"),Ve(s,"x2","1.14441e-05"),Ve(s,"y2","48"),Ve(s,"gradientUnits","userSpaceOnUse"),Ve(e,"height","100%"),Ve(e,"width","auto"),Ve(e,"viewBox","0 0 48 48"),Ve(e,"fill","none"),Ve(e,"xmlns","http://www.w3.org/2000/svg")},m(f,l){Gt(f,e,l),nt(e,r),nt(e,n),nt(e,i),nt(e,a),nt(a,s),nt(s,u),nt(s,c)},p:wr,i:wr,o:wr,d(f){f&&Wt(e)}}}class K4 extends yn{constructor(e){super(),hn(this,e,null,z4,ln,{})}}function H4(t){let e,r,n,i,a;return{c(){e=Nr("svg"),r=Nr("g"),n=Nr("path"),i=Nr("path"),a=Nr("path"),Ve(n,"fill","#B8BAC4"),Ve(n,"d","M11.61 44.536c-1.093.661-2.508.751-3.732.075l-3.206-1.774c-3.292-1.82-4.472-5.97-2.627-9.25l3.115-5.534 4.85 14.48c.29.882.876 1.57 1.6 2.003zM22.186 15.72l-4.13 12.334-6.445-11.452L20.637.564c.448-.798 1.655-.547 1.75.361l.696 6.54c.298 2.784-.009 5.6-.897 8.255z"),Ve(i,"fill","#000"),Ve(i,"d","M18.056 28.053l-4.846 14.48c-.294.877-.876 1.566-1.6 2.003-.724-.432-1.31-1.12-1.601-2.002l-4.85-14.481L11.61 16.6l6.447 11.452z"),Ve(a,"fill","#B8BAC4"),Ve(a,"d","M11.61 16.6L5.16 28.054 1.031 15.719C.143 13.065-.164 10.25.134 7.464L.83.924C.928.013 2.132-.238 2.58.561L11.61 16.6zM18.544 42.837l-3.202 1.774c-1.227.676-2.639.586-3.732-.075.724-.436 1.305-1.125 1.6-2.002l4.846-14.481 3.115 5.533c1.845 3.281.665 7.43-2.627 9.251z"),Ve(r,"fill","none"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"viewBox","0 0 24 46"),Ve(e,"class","rabet-logo svelte-1unkihb")},m(s,u){Gt(s,e,u),nt(e,r),nt(r,n),nt(r,i),nt(r,a)},p:wr,i:wr,o:wr,d(s){s&&Wt(e)}}}class W4 extends yn{constructor(e){super(),hn(this,e,null,H4,ln,{})}}function G4(t){let e,r,n,i,a,s,u,c,f;return{c(){e=Nr("svg"),r=Nr("style"),n=hr(`.st0 { +***************************************************************************** */(function(t){var e,r,n,i,a,s,u,c,f,l,o,w,p,d,S,v,O,h,g,A,m,x,y;(function(_){var L=typeof Et=="object"?Et:typeof self=="object"?self:typeof this=="object"?this:{};_(b(L,b(t.exports)));function b(T,I){return T!==L&&(typeof Object.create=="function"?Object.defineProperty(T,"__esModule",{value:!0}):T.__esModule=!0),function(k,N){return T[k]=I?I(k,N):N}}})(function(_){var L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,T){b.__proto__=T}||function(b,T){for(var I in T)T.hasOwnProperty(I)&&(b[I]=T[I])};e=function(b,T){L(b,T);function I(){this.constructor=b}b.prototype=T===null?Object.create(T):(I.prototype=T.prototype,new I)},r=Object.assign||function(b){for(var T,I=1,k=arguments.length;I=0;X--)(D=b[X])&&(C=(N<3?D(C):N>3?D(T,I,C):D(T,I))||C);return N>3&&C&&Object.defineProperty(T,I,C),C},a=function(b,T){return function(I,k){T(I,k,b)}},s=function(b,T){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(b,T)},u=function(b,T,I,k){function N(C){return C instanceof I?C:new I(function(D){D(C)})}return new(I||(I=Promise))(function(C,D){function X(z){try{K(k.next(z))}catch(H){D(H)}}function ae(z){try{K(k.throw(z))}catch(H){D(H)}}function K(z){z.done?C(z.value):N(z.value).then(X,ae)}K((k=k.apply(b,T||[])).next())})},c=function(b,T){var I={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},k,N,C,D;return D={next:X(0),throw:X(1),return:X(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function X(K){return function(z){return ae([K,z])}}function ae(K){if(k)throw new TypeError("Generator is already executing.");for(;I;)try{if(k=1,N&&(C=K[0]&2?N.return:K[0]?N.throw||((C=N.return)&&C.call(N),0):N.next)&&!(C=C.call(N,K[1])).done)return C;switch(N=0,C&&(K=[K[0]&2,C.value]),K[0]){case 0:case 1:C=K;break;case 4:return I.label++,{value:K[1],done:!1};case 5:I.label++,N=K[1],K=[0];continue;case 7:K=I.ops.pop(),I.trys.pop();continue;default:if(C=I.trys,!(C=C.length>0&&C[C.length-1])&&(K[0]===6||K[0]===2)){I=0;continue}if(K[0]===3&&(!C||K[1]>C[0]&&K[1]=b.length&&(b=void 0),{value:b&&b[k++],done:!b}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(b,T){var I=typeof Symbol=="function"&&b[Symbol.iterator];if(!I)return b;var k=I.call(b),N,C=[],D;try{for(;(T===void 0||T-- >0)&&!(N=k.next()).done;)C.push(N.value)}catch(X){D={error:X}}finally{try{N&&!N.done&&(I=k.return)&&I.call(k)}finally{if(D)throw D.error}}return C},w=function(){for(var b=[],T=0;T1||X(E,F)})})}function X(E,F){try{ae(k[E](F))}catch(J){H(C[0][3],J)}}function ae(E){E.value instanceof d?Promise.resolve(E.value.v).then(K,z):H(C[0][2],E)}function K(E){X("next",E)}function z(E){X("throw",E)}function H(E,F){E(F),C.shift(),C.length&&X(C[0][0],C[0][1])}},v=function(b){var T,I;return T={},k("next"),k("throw",function(N){throw N}),k("return"),T[Symbol.iterator]=function(){return this},T;function k(N,C){T[N]=b[N]?function(D){return(I=!I)?{value:d(b[N](D)),done:N==="return"}:C?C(D):D}:C}},O=function(b){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var T=b[Symbol.asyncIterator],I;return T?T.call(b):(b=typeof l=="function"?l(b):b[Symbol.iterator](),I={},k("next"),k("throw"),k("return"),I[Symbol.asyncIterator]=function(){return this},I);function k(C){I[C]=b[C]&&function(D){return new Promise(function(X,ae){D=b[C](D),N(X,ae,D.done,D.value)})}}function N(C,D,X,ae){Promise.resolve(ae).then(function(K){C({value:K,done:X})},D)}},h=function(b,T){return Object.defineProperty?Object.defineProperty(b,"raw",{value:T}):b.raw=T,b},g=function(b){if(b&&b.__esModule)return b;var T={};if(b!=null)for(var I in b)Object.hasOwnProperty.call(b,I)&&(T[I]=b[I]);return T.default=b,T},A=function(b){return b&&b.__esModule?b:{default:b}},m=function(b,T){if(!T.has(b))throw new TypeError("attempted to get private field on non-instance");return T.get(b)},x=function(b,T,I){if(!T.has(b))throw new TypeError("attempted to set private field on non-instance");return T.set(b,I),I},_("__extends",e),_("__assign",r),_("__rest",n),_("__decorate",i),_("__param",a),_("__metadata",s),_("__awaiter",u),_("__generator",c),_("__exportStar",f),_("__createBinding",y),_("__values",l),_("__read",o),_("__spread",w),_("__spreadArrays",p),_("__await",d),_("__asyncGenerator",S),_("__asyncDelegator",v),_("__asyncValues",O),_("__makeTemplateObject",h),_("__importStar",g),_("__importDefault",A),_("__classPrivateFieldGet",m),_("__classPrivateFieldSet",x)})})(g_);var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.isBrowserCryptoAvailable=Si.getSubtleCrypto=Si.getBrowerCrypto=void 0;function xd(){return Et?.crypto||Et?.msCrypto||{}}Si.getBrowerCrypto=xd;function b_(){const t=xd();return t.subtle||t.webkitSubtle}Si.getSubtleCrypto=b_;function TA(){return!!xd()&&!!b_()}Si.isBrowserCryptoAvailable=TA;var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.isBrowser=Ei.isNode=Ei.isReactNative=void 0;function __(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ei.isReactNative=__;function w_(){return typeof kr<"u"&&typeof kr.versions<"u"&&typeof kr.versions.node<"u"}Ei.isNode=w_;function xA(){return!__()&&!w_()}Ei.isBrowser=xA;(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=g_.exports;e.__exportStar(Si,t),e.__exportStar(Ei,t)})(m_);function S_(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Pd(t=6){return BigInt(S_(t))}function _c(t,e,r){return{id:r||S_(),jsonrpc:"2.0",method:t,params:e}}function Id(t,e){return{id:t,jsonrpc:"2.0",result:e}}function kd(t,e,r){return{id:t,jsonrpc:"2.0",error:PA(e,r)}}function PA(t,e){return typeof t>"u"?ay(y_):(typeof t=="string"&&(t=Object.assign(Object.assign({},ay(Td)),{message:t})),typeof e<"u"&&(t.data=e),EA(t.code)&&(t=OA(t.code)),t)}class IA{}class kA extends IA{constructor(){super()}}class RA extends kA{constructor(e){super()}}const CA="^wss?:";function NA(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function jA(t,e){const r=NA(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function sy(t){return jA(t,CA)}function LA(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function E_(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Rd(t){return E_(t)&&"method"in t}function wc(t){return E_(t)&&(fi(t)||Do(t))}function fi(t){return"result"in t}function Do(t){return"error"in t}class MA extends RA{constructor(e){super(e),this.events=new So.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(_c(e.method,e.params||[],e.id||Pd().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{Do(a)?i(a.error):n(a.result)});try{await this.connection.send(e,r)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),wc(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const DA=()=>typeof WebSocket<"u"?WebSocket:typeof mo<"u"&&typeof mo.WebSocket<"u"?mo.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),UA=()=>typeof WebSocket<"u"||typeof mo<"u"&&typeof mo.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",uy=t=>t.split("?")[0],cy=10,FA=DA();class BA{constructor(e){if(this.url=e,this.events=new So.exports.EventEmitter,this.registering=!1,!sy(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e,r){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(pd(e))}catch(n){this.onError(e.id,n)}}register(e=this.url){if(!sy(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=m_.isReactNative()?void 0:{rejectUnauthorized:!LA(e)},a=new FA(e,[],i);UA()?a.onerror=s=>{const u=s;n(this.emitError(u.error))}:a.on("error",s=>{n(this.emitError(s))}),a.onopen=()=>{this.onOpen(a),r(a)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Ab(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=kd(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return AA(e,uy(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>cy&&this.events.setMaxListeners(cy)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${uy(this.url)}`));return this.events.emit("register_error",r),r}}var Mp={exports:{}};(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,u="[object Arguments]",c="[object Array]",f="[object AsyncFunction]",l="[object Boolean]",o="[object Date]",w="[object Error]",p="[object Function]",d="[object GeneratorFunction]",S="[object Map]",v="[object Number]",O="[object Null]",h="[object Object]",g="[object Promise]",A="[object Proxy]",m="[object RegExp]",x="[object Set]",y="[object String]",_="[object Symbol]",L="[object Undefined]",b="[object WeakMap]",T="[object ArrayBuffer]",I="[object DataView]",k="[object Float32Array]",N="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",X="[object Int32Array]",ae="[object Uint8Array]",K="[object Uint8ClampedArray]",z="[object Uint16Array]",H="[object Uint32Array]",E=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,Q={};Q[k]=Q[N]=Q[C]=Q[D]=Q[X]=Q[ae]=Q[K]=Q[z]=Q[H]=!0,Q[u]=Q[c]=Q[T]=Q[l]=Q[I]=Q[o]=Q[w]=Q[p]=Q[S]=Q[v]=Q[h]=Q[m]=Q[x]=Q[y]=Q[b]=!1;var fe=typeof Et=="object"&&Et&&Et.Object===Object&&Et,Z=typeof self=="object"&&self&&self.Object===Object&&self,pe=fe||Z||Function("return this")(),ge=e&&!e.nodeType&&e,j=ge&&!0&&t&&!t.nodeType&&t,te=j&&j.exports===ge,ye=te&&fe.process,_e=function(){try{return ye&&ye.binding&&ye.binding("util")}catch{}}(),Ye=_e&&_e.isTypedArray;function Ke(et,St){for(var Jt=-1,yr=et==null?0:et.length,nn=0,jr=[];++Jt-1}function Ft(et,St){var Jt=this.__data__,yr=Ot(Jt,et);return yr<0?(++this.size,Jt.push([et,St])):Jt[yr][1]=St,this}qt.prototype.clear=zt,qt.prototype.delete=rr,qt.prototype.get=gt,qt.prototype.has=kt,qt.prototype.set=Ft;function Mt(et){var St=-1,Jt=et==null?0:et.length;for(this.clear();++StIn))return!1;var zr=jr.get(et);if(zr&&jr.get(St))return zr==St;var xn=-1,Qr=!0,gn=Jt&a?new Fe:void 0;for(jr.set(et,St),jr.set(St,et);++xn-1&&et%1==0&&et-1&&et%1==0&&et<=s}function ci(et){var St=typeof et;return et!=null&&(St=="object"||St=="function")}function To(et){return et!=null&&typeof et=="object"}var Zn=Ye?Ne(Ye):Er;function li(et){return Fi(et)?mt(et):Tr(et)}function xo(){return[]}function zo(){return!1}t.exports=qo})(Mp,Mp.exports);var $A=Mp.exports;function VA(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,A=new Uint8Array(g);O!==h;){for(var m=d[O],x=0,y=g-1;(m!==0||x>>0,A[y]=m%u>>>0,m=m/u>>>0;if(m!==0)throw new Error("Non-zero carry");v=x,O++}for(var _=g-v;_!==g&&A[_]===0;)_++;for(var L=c.repeat(S);_>>0,g=new Uint8Array(h);d[S];){var A=r[d.charCodeAt(S)];if(A===255)return;for(var m=0,x=h-1;(A!==0||m>>0,g[x]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");O=m,S++}if(d[S]!==" "){for(var y=h-O;y!==h&&g[y]===0;)y++;for(var _=new Uint8Array(v+(h-y)),L=v;y!==h;)_[L++]=g[y++];return _}}}function p(d){var S=w(d);if(S)return S;throw new Error(`Non-${e} character`)}return{encode:o,decodeUnsafe:w,decode:p}}var qA=VA,zA=qA;const O_=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},KA=t=>new TextEncoder().encode(t),HA=t=>new TextDecoder().decode(t);class WA{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class GA{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return A_(this,e)}}class YA{constructor(e){this.decoders=e}or(e){return A_(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const A_=(t,e)=>new YA({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class XA{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new WA(e,r,n),this.decoder=new GA(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Sc=({name:t,prefix:e,encode:r,decode:n})=>new XA(t,e,r,n),Us=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=zA(r,e);return Sc({prefix:t,name:e,encode:n,decode:a=>O_(i(a))})},QA=(t,e,r,n)=>{const i={};for(let l=0;l=8&&(u-=8,s[f++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return s},JA=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&u>>s];if(s&&(a+=e[i&u<Sc({prefix:e,name:t,encode(i){return JA(i,n,r)},decode(i){return QA(i,n,r,t)}}),ZA=Sc({prefix:"\0",name:"identity",encode:t=>HA(t),decode:t=>KA(t)});var eT=Object.freeze({__proto__:null,identity:ZA});const tT=ro({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var rT=Object.freeze({__proto__:null,base2:tT});const nT=ro({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var oT=Object.freeze({__proto__:null,base8:nT});const iT=Us({prefix:"9",name:"base10",alphabet:"0123456789"});var aT=Object.freeze({__proto__:null,base10:iT});const sT=ro({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),uT=ro({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var cT=Object.freeze({__proto__:null,base16:sT,base16upper:uT});const lT=ro({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),fT=ro({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),pT=ro({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dT=ro({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),hT=ro({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),yT=ro({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vT=ro({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),mT=ro({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),gT=ro({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var bT=Object.freeze({__proto__:null,base32:lT,base32upper:fT,base32pad:pT,base32padupper:dT,base32hex:hT,base32hexupper:yT,base32hexpad:vT,base32hexpadupper:mT,base32z:gT});const _T=Us({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),wT=Us({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ST=Object.freeze({__proto__:null,base36:_T,base36upper:wT});const ET=Us({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),OT=Us({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var AT=Object.freeze({__proto__:null,base58btc:ET,base58flickr:OT});const TT=ro({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),xT=ro({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),PT=ro({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),IT=ro({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var kT=Object.freeze({__proto__:null,base64:TT,base64pad:xT,base64url:PT,base64urlpad:IT});const T_=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),RT=T_.reduce((t,e,r)=>(t[r]=e,t),[]),CT=T_.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function NT(t){return t.reduce((e,r)=>(e+=RT[r],e),"")}function jT(t){const e=[];for(const r of t){const n=CT[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const LT=Sc({prefix:"\u{1F680}",name:"base256emoji",encode:NT,decode:jT});var MT=Object.freeze({__proto__:null,base256emoji:LT}),DT=x_,ly=128,UT=127,FT=~UT,BT=Math.pow(2,31);function x_(t,e,r){e=e||[],r=r||0;for(var n=r;t>=BT;)e[r++]=t&255|ly,t/=128;for(;t&FT;)e[r++]=t&255|ly,t>>>=7;return e[r]=t|0,x_.bytes=r-n+1,e}var $T=Dp,VT=128,fy=127;function Dp(t,n){var r=0,n=n||0,i=0,a=n,s,u=t.length;do{if(a>=u)throw Dp.bytes=0,new RangeError("Could not decode varint");s=t[a++],r+=i<28?(s&fy)<=VT);return Dp.bytes=a-n,r}var qT=Math.pow(2,7),zT=Math.pow(2,14),KT=Math.pow(2,21),HT=Math.pow(2,28),WT=Math.pow(2,35),GT=Math.pow(2,42),YT=Math.pow(2,49),XT=Math.pow(2,56),QT=Math.pow(2,63),JT=function(t){return t(P_.encode(t,e,r),e),dy=t=>P_.encodingLength(t),Up=(t,e)=>{const r=e.byteLength,n=dy(t),i=n+dy(r),a=new Uint8Array(i+r);return py(t,a,0),py(r,a,n),a.set(e,i),new ex(t,r,e,a)};class ex{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const I_=({name:t,code:e,encode:r})=>new tx(t,e,r);class tx{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Up(this.code,r):r.then(n=>Up(this.code,n))}else throw Error("Unknown type, must be binary type")}}const k_=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),rx=I_({name:"sha2-256",code:18,encode:k_("SHA-256")}),nx=I_({name:"sha2-512",code:19,encode:k_("SHA-512")});var ox=Object.freeze({__proto__:null,sha256:rx,sha512:nx});const R_=0,ix="identity",C_=O_,ax=t=>Up(R_,C_(t)),sx={code:R_,name:ix,encode:C_,digest:ax};var ux=Object.freeze({__proto__:null,identity:sx});new TextEncoder,new TextDecoder;const hy={...eT,...rT,...oT,...aT,...cT,...bT,...ST,...AT,...kT,...MT};({...ox,...ux});function N_(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function cx(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?N_(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function j_(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const yy=j_("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Gf=j_("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=cx(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:a}=gr("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=rn.generateChildLogger(r,this.name)}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,c_(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?l_(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class $x{constructor(e,r,n){this.core=e,this.logger=r,this.name=yx,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),a=Fh(i);return Gb(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=f3();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),s=Fh(a),u=jp();return await bO(u,i,vx,s)},this.generateSharedKey=(i,a,s)=>{this.isInitialized();const u=this.getPrivateKey(i),c=p3(u,a);return this.setSymKey(c,s)},this.setSymKey=async(i,a)=>{this.isInitialized();const s=a||d3(i);return await this.keychain.set(s,i),s},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,a,s)=>{this.isInitialized();const u=s_(s),c=pd(a);if(Xh(u)){const w=u.senderPublicKey,p=u.receiverPublicKey;i=await this.generateSharedKey(w,p)}const f=this.getSymKey(i),{type:l,senderPublicKey:o}=u;return y3({type:l,symKey:f,message:c,senderPublicKey:o})},this.decode=async(i,a,s)=>{this.isInitialized();const u=g3(a,s);if(Xh(u)){const c=u.receiverPublicKey,f=u.senderPublicKey;i=await this.generateSharedKey(c,f)}try{const c=this.getSymKey(i),f=v3({symKey:c,encoded:a});return Ab(f)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=i=>{const a=Xu(i);return Ms(a.type)},this.getPayloadSenderPublicKey=i=>{const a=Xu(i);return a.senderPublicKey?fo(a.senderPublicKey,lo):void 0},this.core=e,this.logger=rn.generateChildLogger(r,this.name),this.keychain=n||new Bx(this.core,this.logger)}get context(){return rn.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(vy)}catch{e=jp(),await this.keychain.set(vy,e)}return fx(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Vx extends e5{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=bx,this.version=_x,this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const a=Ia(i);let s=this.messages.get(n);return typeof s>"u"&&(s={}),typeof s[a]<"u"||(s[a]=i,this.messages.set(n,s),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),s=Ia(i);return typeof a[s]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=rn.generateChildLogger(e,this.name),this.core=r}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,c_(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?l_(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class qx extends t5{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new So.exports.EventEmitter,this.name=Sx,this.queue=new Map,this.publishTimeout=Or.toMiliseconds(Or.TEN_SECONDS),this.queueTimeout=Or.toMiliseconds(Or.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});try{const s=a?.ttl||wx,u=Lp(a),c=a?.prompt||!1,f=a?.tag||0,l=a?.id||Pd().toString(),o={topic:n,message:i,opts:{ttl:s,relay:u,prompt:c,tag:f,id:l}},w=setTimeout(()=>this.queue.set(l,o),this.queueTimeout);try{await await Qu(this.rpcPublish(n,i,s,u,c,f,l),this.publishTimeout),clearTimeout(w),this.relayer.events.emit(Ln.publish,o)}catch{this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0;return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}})}catch(s){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(s),s}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=rn.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return rn.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,a,s,u){var c,f,l,o;const w={method:Fu(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:a,tag:s},id:u};return co((c=w.params)==null?void 0:c.prompt)&&((f=w.params)==null||delete f.prompt),co((l=w.params)==null?void 0:l.tag)&&((o=w.params)==null||delete o.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:w}),this.relayer.request(w)}onPublish(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ln.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ln.message_ack,e=>{this.onPublish(e.id.toString())})}}class zx{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(a=>a!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Kx=Object.defineProperty,Hx=Object.defineProperties,Wx=Object.getOwnPropertyDescriptors,by=Object.getOwnPropertySymbols,Gx=Object.prototype.hasOwnProperty,Yx=Object.prototype.propertyIsEnumerable,_y=(t,e,r)=>e in t?Kx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fs=(t,e)=>{for(var r in e||(e={}))Gx.call(e,r)&&_y(t,r,e[r]);if(by)for(var r of by(e))Yx.call(e,r)&&_y(t,r,e[r]);return t},Xf=(t,e)=>Hx(t,Wx(e));class Xx extends o5{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new zx,this.events=new So.exports.EventEmitter,this.name=Rx,this.version=Cx,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=xi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const a=Lp(i),s={topic:n,relay:a};this.pending.set(n,s);const u=await this.rpcSubscribe(n,a);return this.onSubscribe(u,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof i?.id<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,a)=>{const s=new Or.Watch;s.start(this.pendingSubscriptionWatchLabel);const u=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(u),s.stop(this.pendingSubscriptionWatchLabel),i(!0)),s.elapsed(this.pendingSubscriptionWatchLabel)>=Nx&&(clearInterval(u),s.stop(this.pendingSubscriptionWatchLabel),a(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=rn.generateChildLogger(r,this.name),this.clientId=""}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Lp(n);await this.rpcUnsubscribe(e,r,i);const a=Yn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:Fu(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Qu(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ln.connection_stalled)}return Ia(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Fu(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await Qu(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Ln.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:Fu(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,Xf(fs({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,fs({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,fs({},r)),this.topicMap.set(r.topic,e),this.events.emit(Xo.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Xo.deleted,Xf(fs({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Xo.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);Ds(r)&&this.onBatchSubscribe(r.map((n,i)=>Xf(fs({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Ln.connect,async()=>{await this.onConnect()}),this.relayer.on(Ln.disconnect,()=>{this.onDisconnect()}),this.events.on(Xo.created,async e=>{const r=Xo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Xo.deleted,async e=>{const r=Xo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var Qx=Object.defineProperty,wy=Object.getOwnPropertySymbols,Jx=Object.prototype.hasOwnProperty,Zx=Object.prototype.propertyIsEnumerable,Sy=(t,e,r)=>e in t?Qx(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e4=(t,e)=>{for(var r in e||(e={}))Jx.call(e,r)&&Sy(t,r,e[r]);if(wy)for(var r of wy(e))Zx.call(e,r)&&Sy(t,r,e[r]);return t};class t4 extends r5{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new So.exports.EventEmitter,this.name=Ox,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?rn.generateChildLogger(e.logger,this.name):rn.pino(rn.getDefaultLoggerOptions({level:e.logger||Ex})),this.messages=new Vx(this.logger,e.core),this.subscriber=new Xx(this,this.logger),this.publisher=new qx(this,this.logger),this.relayUrl=e?.relayUrl||D_,this.projectId=e.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${my}...`),await this.restartTransport(my)}this.registerEventListeners(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},Px)}get context(){return rn.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";return i||(await Promise.all([new Promise(a=>{this.subscriber.once(Xo.created,s=>{s.topic===e&&a()})}),new Promise(async a=>{i=await this.subscriber.subscribe(e,r),a()})]),i)}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(Ln.transport_closed))}async transportOpen(e){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=e||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(r=>{this.initialized||r(),this.subscriber.once(Xo.resubscribed,()=>{r()})}),await Promise.race([new Promise(async(r,n)=>{await Qu(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(i=>n(i)).then(()=>r()).finally(()=>this.removeListener(Ln.transport_closed,this.rejectTransportOpen))}),new Promise(r=>this.once(Ln.transport_closed,this.rejectTransportOpen))])])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.events.emit(Ln.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(e){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=e||this.relayUrl,this.connected&&await Promise.all([new Promise(r=>{this.provider.once(cs.disconnect,()=>{r()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new MA(new BA(I3({sdkVersion:xx,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Rd(e)){if(!e.method.endsWith(Ax))return;const r=e.params,{topic:n,message:i,publishedAt:a}=r.data,s={topic:n,message:i,publishedAt:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(e4({type:"event",event:r.id},s)),this.events.emit(r.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else wc(e)&&this.events.emit(Ln.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ln.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Id(e.id,!0);await this.provider.connection.send(r)}registerProviderListeners(){this.provider.on(cs.payload,e=>this.onProviderPayload(e)),this.provider.on(cs.connect,()=>{this.events.emit(Ln.connect)}),this.provider.on(cs.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(cs.error,e=>{this.logger.error(e),this.events.emit(Ln.error,e)})}registerEventListeners(){this.events.on(Ln.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(Ln.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},Or.toMiliseconds(Tx))}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var r4=Object.defineProperty,Ey=Object.getOwnPropertySymbols,n4=Object.prototype.hasOwnProperty,o4=Object.prototype.propertyIsEnumerable,Oy=(t,e,r)=>e in t?r4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ay=(t,e)=>{for(var r in e||(e={}))n4.call(e,r)&&Oy(t,r,e[r]);if(Ey)for(var r of Ey(e))o4.call(e,r)&&Oy(t,r,e[r]);return t};class Ec extends n5{constructor(e,r,n,i=xi,a=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=Ix,this.cached=[],this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{this.getKey&&s!==null&&!co(s)?this.map.set(this.getKey(s),s):J3(s)?this.map.set(s.id,s):Z3(s)&&this.map.set(s.topic,s)}),this.cached=[],this.initialized=!0)},this.set=async(s,u)=>{this.isInitialized(),this.map.has(s)?await this.update(s,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:u}),this.map.set(s,u),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(u=>Object.keys(s).every(c=>$A(u[c],s[c]))):this.values),this.update=async(s,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:u});const c=Ay(Ay({},this.getData(s)),u);this.map.set(s,c),await this.persist()},this.delete=async(s,u)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:u}),this.map.delete(s),await this.persist())},this.logger=rn.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=a}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class i4{constructor(e,r){this.core=e,this.logger=r,this.name=jx,this.version=Lx,this.events=new lb,this.initialized=!1,this.storagePrefix=xi,this.ignoredPayloadTypes=[ua],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=jp(),i=await this.core.crypto.setSymKey(n),a=Mo(Or.FIVE_MINUTES),s={protocol:M_},u={topic:i,expiry:a,relay:s,active:!1},c=V3({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:s});return await this.pairings.set(i,u),await this.core.relayer.subscribe(i),this.core.expirer.set(i,a),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:a,relay:s}=F3(n.uri);if(this.pairings.keys.includes(i))throw new Error(`Pairing already exists: ${i}`);if(this.core.crypto.hasKeys(i))throw new Error(`Keychain already exists: ${i}`);const u=Mo(Or.FIVE_MINUTES),c={topic:i,relay:s,expiry:u,active:!1};return await this.pairings.set(i,c),await this.core.crypto.setSymKey(a,i),await this.core.relayer.subscribe(i,{relay:s}),this.core.expirer.set(i,u),n.activatePairing&&await this.activate({topic:i}),c},this.activate=async({topic:n})=>{this.isInitialized();const i=Mo(Or.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:u,reject:c}=Aa();this.events.once($n("pairing_ping",a),({error:f})=>{f?c(f):u()}),await s()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Yn("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,a)=>{const s=_c(i,a),u=await this.core.crypto.encode(n,s),c=ls[i].req;return this.core.history.set(n,s),this.core.relayer.publish(n,u,c),s.id},this.sendResult=async(n,i,a)=>{const s=Id(n,a),u=await this.core.crypto.encode(i,s),c=await this.core.history.get(i,n),f=ls[c.request.method].res;await this.core.relayer.publish(i,u,f),await this.core.history.resolve(s)},this.sendError=async(n,i,a)=>{const s=kd(n,a),u=await this.core.crypto.encode(i,s),c=await this.core.history.get(i,n),f=ls[c.request.method]?ls[c.request.method].res:ls.unregistered_method.res;await this.core.relayer.publish(i,u,f),await this.core.history.resolve(s)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Yn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>_i(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,s=(await this.core.history.get(i,a.id)).request.method;switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit("pairing_ping",{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{fi(i)?this.events.emit($n("pairing_ping",a),{}):Do(i)&&this.events.emit($n("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:s}=i;try{if(this.registeredMethods.includes(s))return;const u=Yn("WC_METHOD_UNSUPPORTED",s);await this.sendError(a,n,u),this.logger.error(u)}catch(u){await this.sendError(a,n,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Yn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!po(n)){const{message:i}=gr("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(i)}if(!Q3(n.uri)){const{message:i}=gr("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(i)}},this.isValidPing=async n=>{if(!po(n)){const{message:a}=gr("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!po(n)){const{message:a}=gr("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Xn(n,!1)){const{message:i}=gr("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=gr("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(_i(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=gr("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=rn.generateChildLogger(r,this.name),this.pairings=new Ec(this.core,this.logger,this.name,this.storagePrefix)}get context(){return rn.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ln.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{Rd(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):wc(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(ko.expired,async e=>{const{topic:r}=p_(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit("pairing_expire",{topic:r}))})}}class a4 extends ZE{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new So.exports.EventEmitter,this.name=Mx,this.version=Dx,this.cached=[],this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const s={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Mo(Or.THIRTY_DAYS)};this.records.set(s.id,s),this.events.emit(Yo.created,s)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=Do(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(Yo.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(Yo.deleted,a)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=rn.generateChildLogger(r,this.name)}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:_c(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Yo.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Yo.created,e=>{const r=Yo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Yo.updated,e=>{const r=Yo.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(Yo.deleted,e=>{const r=Yo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{Or.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class s4 extends i5{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new So.exports.EventEmitter,this.name=Ux,this.version=Fx,this.cached=[],this.initialized=!1,this.storagePrefix=xi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const a=this.formatTarget(n),s={target:a,expiry:i};this.expirations.set(a,s),this.checkExpiry(a,s),this.events.emit(ko.created,{target:a,expiration:s})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(ko.deleted,{target:i,expiration:a})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=rn.generateChildLogger(r,this.name)}get context(){return rn.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return k3(e);if(typeof e=="number")return R3(e);const{message:r}=gr("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(ko.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=gr("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=gr("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;Or.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(ko.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(qa.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(ko.created,e=>{const r=ko.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ko.expired,e=>{const r=ko.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(ko.deleted,e=>{const r=ko.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}}class u4 extends a5{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=Yf,this.initialized=!1,this.init=async n=>{u_()||!Ed()||(this.verifyUrl=n?.verifyUrl||gy,await this.createIframe())},this.register=async n=>{var i;if(this.initialized||await this.init(),!!this.iframe)try{(i=this.iframe.contentWindow)==null||i.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async n=>{var i;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const a=this.startAbortTimer(Or.FIVE_SECONDS),s=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(a),s.status===200?(i=await s.json())==null?void 0:i.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,i)=>{if(document.getElementById(Yf))return n();const a=document.createElement("iframe");a.setAttribute("id",Yf),a.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),a.style.display="none",a.addEventListener("load",()=>{this.initialized=!0,n()}),a.addEventListener("error",s=>{i(s)}),document.body.append(a),this.iframe=a}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),Or.toMiliseconds(Or.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=rn.generateChildLogger(r,this.name),this.verifyUrl=gy,this.abortController=new AbortController,this.isDevEnv=Sd()&&{}.IS_VITEST}get context(){return rn.getLoggerContext(this.logger)}startAbortTimer(e){return setTimeout(()=>this.abortController.abort(),Or.toMiliseconds(e))}}var c4=Object.defineProperty,Ty=Object.getOwnPropertySymbols,l4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,xy=(t,e,r)=>e in t?c4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Py=(t,e)=>{for(var r in e||(e={}))l4.call(e,r)&&xy(t,r,e[r]);if(Ty)for(var r of Ty(e))f4.call(e,r)&&xy(t,r,e[r]);return t};class Nd extends JE{constructor(e){super(e),this.protocol=L_,this.version=px,this.name=Cd,this.events=new So.exports.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||D_;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:rn.pino(rn.getDefaultLoggerOptions({level:e?.logger||dx.logger}));this.logger=rn.generateChildLogger(r,this.name),this.heartbeat=new qa.HeartBeat,this.crypto=new $x(this,this.logger,e?.keychain),this.history=new a4(this,this.logger),this.expirer=new s4(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new EE(Py(Py({},hx),e?.storageOptions)),this.relayer=new t4({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new i4(this,this.logger),this.verify=new u4(this.projectId||"",this.logger)}static async init(e){const r=new Nd(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(kx,n),r}get context(){return rn.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const p4=Nd,U_="wc",F_=2,B_="client",jd=`${U_}@${F_}:${B_}:`,Qf={name:B_,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Iy="WALLETCONNECT_DEEPLINK_CHOICE",d4="proposal",h4="Proposal expired",y4="session",Iu=Or.SEVEN_DAYS,v4="engine",ps={wc_sessionPropose:{req:{ttl:Or.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Or.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Or.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Or.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Or.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Or.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Or.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Or.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Or.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Or.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Or.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:Or.THIRTY_SECONDS,prompt:!1,tag:1115}}},Jf={min:Or.FIVE_MINUTES,max:Or.SEVEN_DAYS},ds={idle:"idle",active:"active"},m4="request",g4=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var b4=Object.defineProperty,_4=Object.defineProperties,w4=Object.getOwnPropertyDescriptors,ky=Object.getOwnPropertySymbols,S4=Object.prototype.hasOwnProperty,E4=Object.prototype.propertyIsEnumerable,Ry=(t,e,r)=>e in t?b4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Io=(t,e)=>{for(var r in e||(e={}))S4.call(e,r)&&Ry(t,r,e[r]);if(ky)for(var r of ky(e))E4.call(e,r)&&Ry(t,r,e[r]);return t},Zf=(t,e)=>_4(t,w4(e));class O4 extends u5{constructor(e){super(e),this.name=v4,this.events=new lb,this.initialized=!1,this.ignoredPayloadTypes=[ua],this.requestQueue={state:ds.idle,requests:[]},this.requestQueueDelay=Or.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(ps)}),this.initialized=!0,setTimeout(()=>{this.requestQueue.requests=this.getPendingSessionRequests(),this.processRequestQueue()},Or.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized();const n=Zf(Io({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:s,sessionProperties:u,relays:c}=n;let f=i,l,o=!1;if(f&&(o=this.client.core.pairing.pairings.get(f).active),!f||!o){const{topic:g,uri:A}=await this.client.core.pairing.create();f=g,l=A}const w=await this.client.core.crypto.generateKeyPair(),p=Io({requiredNamespaces:a,optionalNamespaces:s,relays:c??[{protocol:M_}],proposer:{publicKey:w,metadata:this.client.metadata}},u&&{sessionProperties:u}),{reject:d,resolve:S,done:v}=Aa(Or.FIVE_MINUTES,h4);if(this.events.once($n("session_connect"),async({error:g,session:A})=>{if(g)d(g);else if(A){A.self.publicKey=w;const m=Zf(Io({},A),{requiredNamespaces:A.requiredNamespaces,optionalNamespaces:A.optionalNamespaces});await this.client.session.set(A.topic,m),await this.setExpiry(A.topic,A.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:A.peer.metadata}),S(m)}}),!f){const{message:g}=gr("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(g)}const O=await this.sendRequest(f,"wc_sessionPropose",p),h=Mo(Or.FIVE_MINUTES);return await this.setProposal(O,Io({id:O,expiry:h},p)),{uri:l,approval:v}},this.pair=async r=>(this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:a,sessionProperties:s}=r,u=this.client.proposal.get(n);let{pairingTopic:c,proposer:f,requiredNamespaces:l,optionalNamespaces:o}=u;c=c||"",gs(l)||(l=H3(a,"approve()"));const w=await this.client.core.crypto.generateKeyPair(),p=f.publicKey,d=await this.client.core.crypto.generateSharedKey(w,p);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:f.metadata}),await this.sendResult(n,c,{relay:{protocol:i??"irn"},responderPublicKey:w}),await this.client.proposal.delete(n,Yn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const S=Io({relay:{protocol:i??"irn"},namespaces:a,requiredNamespaces:l,optionalNamespaces:o,pairingTopic:c,controller:{publicKey:w,metadata:this.client.metadata},expiry:Mo(Iu)},s&&{sessionProperties:s});await this.client.core.relayer.subscribe(d),await this.sendRequest(d,"wc_sessionSettle",S);const v=Zf(Io({},S),{topic:d,pairingTopic:c,acknowledged:!1,self:S.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:w});return await this.client.session.set(d,v),await this.setExpiry(d,Mo(Iu)),{topic:d,acknowledged:()=>new Promise(O=>setTimeout(()=>O(this.client.session.get(d)),500))}},this.reject=async r=>{this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:a}=this.client.proposal.get(n);a&&(await this.sendError(n,a,i),await this.client.proposal.delete(n,Yn("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,a=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:i}),{done:s,resolve:u,reject:c}=Aa();return this.events.once($n("session_update",a),({error:f})=>{f?c(f):u()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:s}},this.extend=async r=>{this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest(n,"wc_sessionExtend",{}),{done:a,resolve:s,reject:u}=Aa();return this.events.once($n("session_extend",i),({error:c})=>{c?u(c):s()}),await this.setExpiry(n,Mo(Iu)),{acknowledged:a}},this.request=async r=>{this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:a,expiry:s}=r,u=await this.sendRequest(a,"wc_sessionRequest",{request:i,chainId:n},s),{done:c,resolve:f,reject:l}=Aa(s);this.events.once($n("session_request",u),({error:w,result:p})=>{w?l(w):f(p)}),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:u});const o=await this.client.core.storage.getItem(Iy);return C3({id:u,topic:a,wcDeepLink:o}),await c()},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:a}=i;fi(i)?await this.sendResult(a,n,i.result):Do(i)&&await this.sendError(a,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest(n,"wc_sessionPing",{}),{done:a,resolve:s,reject:u}=Aa();this.events.once($n("session_ping",i),({error:c})=>{c?u(c):s()}),await a()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:a}=r;await this.sendRequest(n,"wc_sessionEvent",{event:i,chainId:a})},this.disconnect=async r=>{this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=Pd().toString();let a;const s=u=>{u?.id.toString()===i&&(this.client.core.relayer.events.removeListener(Ln.message_ack,s),a())};await Promise.all([new Promise(u=>{a=u,this.client.core.relayer.on(Ln.message_ack,s)}),this.sendRequest(n,"wc_sessionDelete",Yn("USER_DISCONNECTED"),void 0,i)]),await this.deleteSession(n)}else await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Y3(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var s,u;return((s=a.peerMetadata)==null?void 0:s.url)&&((u=a.peerMetadata)==null?void 0:u.url)===r.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,Yn("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(Iy).catch(a=>this.client.logger.warn(a))},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Yn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.requestQueue.requests=this.requestQueue.requests.filter(a=>a.id!==r),i&&(this.requestQueue.state=ds.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=ps.wc_sessionRequest.req.ttl,{id:i,topic:a,params:s}=r;await this.client.pendingRequest.set(i,{id:i,topic:a,params:s}),n&&this.client.core.expirer.set(i,Mo(n))},this.sendRequest=async(r,n,i,a,s)=>{const u=_c(n,i);if(Ed()&&g4.includes(n)){const l=Ia(JSON.stringify(u));await this.client.core.verify.register({attestationId:l})}const c=await this.client.core.crypto.encode(r,u),f=ps[n].req;return a&&(f.ttl=a),s&&(f.id=s),this.client.core.history.set(r,u),this.client.core.relayer.publish(r,c,f),u.id},this.sendResult=async(r,n,i)=>{const a=Id(r,i),s=await this.client.core.crypto.encode(n,a),u=await this.client.core.history.get(n,r),c=ps[u.request.method].res;this.client.core.relayer.publish(n,s,c),await this.client.core.history.resolve(a)},this.sendError=async(r,n,i)=>{const a=kd(r,i),s=await this.client.core.crypto.encode(n,a),u=await this.client.core.history.get(n,r),c=ps[u.request.method].res;this.client.core.relayer.publish(n,s,c),await this.client.core.history.resolve(a)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{_i(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{_i(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=r=>{const{topic:n,payload:i}=r,a=i.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${a}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${a}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=gr("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:a}=n;try{this.isValidConnect(Io({},n.params));const s=Mo(Or.FIVE_MINUTES),u=Io({id:a,pairingTopic:r,expiry:s},i);await this.setProposal(a,u);const c=Ia(JSON.stringify(n)),f=await this.getVerifyContext(c,u.proposer.metadata);this.client.events.emit("session_proposal",{id:a,params:u,verifyContext:f})}catch(s){await this.sendError(a,r,s),this.client.logger.error(s)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(fi(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const s=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const u=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const c=a.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const f=await this.client.core.crypto.generateSharedKey(u,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:f});const l=await this.client.core.relayer.subscribe(f);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:r})}else Do(n)&&(await this.client.proposal.delete(i,Yn("USER_DISCONNECTED")),this.events.emit($n("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:s,controller:u,expiry:c,namespaces:f,requiredNamespaces:l,optionalNamespaces:o,sessionProperties:w,pairingTopic:p}=n.params,d=Io({topic:r,relay:s,expiry:c,namespaces:f,acknowledged:!0,pairingTopic:p,requiredNamespaces:l,optionalNamespaces:o,controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},w&&{sessionProperties:w});await this.sendResult(n.id,r,!0),this.events.emit($n("session_connect"),{session:d}),this.cleanupDuplicatePairings(d)}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;fi(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit($n("session_approve",i),{})):Do(n)&&(await this.client.session.delete(r,Yn("USER_DISCONNECTED")),this.events.emit($n("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:a}=n;try{this.isValidUpdate(Io({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult(a,r,!0),this.client.events.emit("session_update",{id:a,topic:r,params:i})}catch(s){await this.sendError(a,r,s),this.client.logger.error(s)}},this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;fi(n)?this.events.emit($n("session_update",i),{}):Do(n)&&this.events.emit($n("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Mo(Iu)),await this.sendResult(i,r,!0),this.client.events.emit("session_extend",{id:i,topic:r})}catch(a){await this.sendError(i,r,a),this.client.logger.error(a)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;fi(n)?this.events.emit($n("session_extend",i),{}):Do(n)&&this.events.emit($n("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult(i,r,!0),this.client.events.emit("session_ping",{id:i,topic:r})}catch(a){await this.sendError(i,r,a),this.client.logger.error(a)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{fi(n)?this.events.emit($n("session_ping",i),{}):Do(n)&&this.events.emit($n("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(a=>{this.client.core.relayer.once(Ln.publish,async()=>{a(await this.deleteSession(r))})}),this.sendResult(i,r,!0)]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidRequest(Io({topic:r},a)),await this.setPendingSessionRequest({id:i,topic:r,params:a}),this.addRequestToQueue({id:i,topic:r,params:a}),await this.processRequestQueue()}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;fi(n)?this.events.emit($n("session_request",i),{result:n.result}):Do(n)&&this.events.emit($n("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidEmit(Io({topic:r},a)),this.client.events.emit("session_event",{id:i,topic:r,params:a})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.addRequestToQueue=r=>{this.requestQueue.requests.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.requestQueue.state=ds.idle,this.processRequestQueue()},Or.toMiliseconds(this.requestQueueDelay))},this.processRequestQueue=async()=>{if(this.requestQueue.state===ds.active){this.client.logger.info("session request queue is already active.");return}const r=this.requestQueue.requests[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{const{id:n,topic:i,params:a}=r,s=Ia(JSON.stringify({id:n,params:a})),u=this.client.session.get(i),c=await this.getVerifyContext(s,u.peer.metadata);this.requestQueue.state=ds.active,this.client.events.emit("session_request",{id:n,topic:i,params:a,verifyContext:c})}catch(n){this.client.logger.error(n)}},this.isValidConnect=async r=>{if(!po(r)){const{message:c}=gr("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:s,relays:u}=r;if(co(n)||await this.isValidPairingTopic(n),!sA(u,!0)){const{message:c}=gr("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(c)}!co(i)&&gs(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!co(a)&&gs(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),co(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=aA(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!po(r))throw new Error(gr("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:s}=r;await this.isValidProposalId(n);const u=this.client.proposal.get(n),c=Bu(i,"approve()");if(c)throw new Error(c.message);const f=oy(u.requiredNamespaces,i,"approve()");if(f)throw new Error(f.message);if(!Xn(a,!0)){const{message:l}=gr("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(l)}co(s)||this.validateSessionProps(s,"sessionProperties")},this.isValidReject=async r=>{if(!po(r)){const{message:a}=gr("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(a)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!cA(i)){const{message:a}=gr("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=r=>{if(!po(r)){const{message:f}=gr("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(f)}const{relay:n,controller:i,namespaces:a,expiry:s}=r;if(!h_(n)){const{message:f}=gr("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(f)}const u=eA(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);const c=Bu(a,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(_i(s)){const{message:f}=gr("EXPIRED","onSessionSettleRequest()");throw new Error(f)}},this.isValidUpdate=async r=>{if(!po(r)){const{message:c}=gr("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const a=this.client.session.get(n),s=Bu(i,"update()");if(s)throw new Error(s.message);const u=oy(a.requiredNamespaces,i,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async r=>{if(!po(r)){const{message:i}=gr("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!po(r)){const{message:c}=gr("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:a,expiry:s}=r;await this.isValidSessionTopic(n);const{namespaces:u}=this.client.session.get(n);if(!ny(u,a)){const{message:c}=gr("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(c)}if(!lA(i)){const{message:c}=gr("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!dA(u,a,i.method)){const{message:c}=gr("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(s&&!mA(s,Jf)){const{message:c}=gr("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${Jf.min} and ${Jf.max}`);throw new Error(c)}},this.isValidRespond=async r=>{if(!po(r)){const{message:a}=gr("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}const{topic:n,response:i}=r;if(await this.isValidSessionTopic(n),!fA(i)){const{message:a}=gr("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidPing=async r=>{if(!po(r)){const{message:i}=gr("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!po(r)){const{message:u}=gr("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(u)}const{topic:n,event:i,chainId:a}=r;await this.isValidSessionTopic(n);const{namespaces:s}=this.client.session.get(n);if(!ny(s,a)){const{message:u}=gr("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!pA(i)){const{message:u}=gr("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}if(!hA(s,a,i.name)){const{message:u}=gr("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(u)}},this.isValidDisconnect=async r=>{if(!po(r)){const{message:i}=gr("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const a=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});a&&(i.verified.origin=a,i.verified.validation=a===n.url?"VALID":"INVALID")}catch(a){this.client.logger.error(a)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!Xn(i,!1)){const{message:a}=gr("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})}}isInitialized(){if(!this.initialized){const{message:e}=gr("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.client.core.relayer.on(Ln.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);try{Rd(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):wc(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(a){this.client.logger.error(a)}})}registerExpirerEvents(){this.client.core.expirer.on(ko.expired,async e=>{const{topic:r,id:n}=p_(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,gr("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(e){if(!Xn(e,!1)){const{message:r}=gr("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=gr("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(_i(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=gr("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Xn(e,!1)){const{message:r}=gr("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=gr("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(_i(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=gr("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Xn(e,!1)){const{message:r}=gr("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=gr("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!uA(e)){const{message:r}=gr("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=gr("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(_i(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=gr("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class A4 extends Ec{constructor(e,r){super(e,r,d4,jd),this.core=e,this.logger=r}}class T4 extends Ec{constructor(e,r){super(e,r,y4,jd),this.core=e,this.logger=r}}class x4 extends Ec{constructor(e,r){super(e,r,m4,jd,n=>n.id),this.core=e,this.logger=r}}class Ld extends s5{constructor(e){super(e),this.protocol=U_,this.version=F_,this.name=Qf.name,this.events=new So.exports.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||Qf.name,this.metadata=e?.metadata||A3();const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:rn.pino(rn.getDefaultLoggerOptions({level:e?.logger||Qf.logger}));this.core=e?.core||new p4(e),this.logger=rn.generateChildLogger(r,this.name),this.session=new T4(this.core,this.logger),this.proposal=new A4(this.core,this.logger),this.pendingRequest=new x4(this.core,this.logger),this.engine=new O4(this)}static async init(e){const r=new Ld(e);return await r.initialize(),r}get context(){return rn.getLoggerContext(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}const P4=Ld;var Fp=(t=>(t.SIGN="stellar_signXDR",t))(Fp||{});class Cy{constructor(e){this.client=e,this.client=e}PROJECT_ID=NS;PROJECT_URL=jS;PROJECT_NAME="Simple Stellar Signer";PROJECT_DESCRIPTION="Simple Signer provides an easy and secure way to implement log in and transaction signing functionality on your website for the Stellar network.";async createClient(){try{return this.client=await P4.init({projectId:this.PROJECT_ID,metadata:{name:this.PROJECT_NAME,url:this.PROJECT_URL,description:this.PROJECT_DESCRIPTION,icons:[]}}),this.client}catch(e){throw console.error(e),new vh}}async connect(e){if(!this.client)throw new Ou;const{network:r,methods:n}=e,i=new cE({projectId:this.PROJECT_ID}),a=r===Kn.PUBLIC?["stellar:pubnet"]:["stellar:testnet"],s={requiredNamespaces:{stellar:{methods:n,chains:a,events:[]}}};try{const{uri:u,approval:c}=await this.client.connect(s);return new Promise((f,l)=>{u&&i.openModal({uri:u}),c().then(o=>{i.closeModal(),f(o)}).catch(o=>{i.closeModal(),l(o)})})}catch(u){throw console.error(u),new vh}}async disconnect(e){if(!this.client)throw new Ou;try{await this.client.disconnect({topic:e,reason:{message:"Session closed",code:-1}})}catch(r){throw console.error(r),new $S}}async disconnectAllSessions(){if(!this.client)throw new Ou;const e=this.client.session.getAll();if(e.length){const r=e.map(n=>this.disconnect(n.topic));await Promise.all(r)}}async makeRequest(e){if(!this.client)throw new Ou;const{xdr:r,network:n,method:i}=e,a=this.client.session.getAll().length-1,s=this.client.session.getAll()[a];if(!s)throw new FS;const u=n===Kn.PUBLIC?"stellar:pubnet":"stellar:testnet";try{return await this.client.request({topic:s.topic,chainId:u,request:{method:i,params:{xdr:r}}})}catch(c){throw console.error(c),new BS}}}function I4(t){let e=t[0].GO_TO_CONNECT+"",r;return{c(){r=pr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&1&&e!==(e=n[0].GO_TO_CONNECT+"")&&br(r,e)},d(n){n&&Wt(r)}}}function k4(t){let e=t[0].GO_TO_SIGN+"",r;return{c(){r=pr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&1&&e!==(e=n[0].GO_TO_SIGN+"")&&br(r,e)},d(n){n&&Wt(r)}}}function R4(t){let e=t[0].GO_TO_PAYMENT+"",r;return{c(){r=pr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&1&&e!==(e=n[0].GO_TO_PAYMENT+"")&&br(r,e)},d(n){n&&Wt(r)}}}function C4(t){let e,r,n,i,a,s,u,c,f,l,o,w;return a=new xa({props:{to:"/connect",$$slots:{default:[I4]},$$scope:{ctx:t}}}),c=new xa({props:{to:"/sign",$$slots:{default:[k4]},$$scope:{ctx:t}}}),o=new xa({props:{to:"/payment",$$slots:{default:[R4]},$$scope:{ctx:t}}}),{c(){e=Ct("h1"),e.textContent="Simple Signer",r=hr(),n=Ct("div"),i=Ct("div"),Xr(a.$$.fragment),s=hr(),u=Ct("div"),Xr(c.$$.fragment),f=hr(),l=Ct("div"),Xr(o.$$.fragment)},m(p,d){Gt(p,e,d),Gt(p,r,d),Gt(p,n,d),nt(n,i),Gr(a,i,null),nt(n,s),nt(n,u),Gr(c,u,null),nt(n,f),nt(n,l),Gr(o,l,null),w=!0},p(p,[d]){const S={};d&3&&(S.$$scope={dirty:d,ctx:p}),a.$set(S);const v={};d&3&&(v.$$scope={dirty:d,ctx:p}),c.$set(v);const O={};d&3&&(O.$$scope={dirty:d,ctx:p}),o.$set(O)},i(p){w||(dr(a.$$.fragment,p),dr(c.$$.fragment,p),dr(o.$$.fragment,p),w=!0)},o(p){mr(a.$$.fragment,p),mr(c.$$.fragment,p),mr(o.$$.fragment,p),w=!1},d(p){p&&Wt(e),p&&Wt(r),p&&Wt(n),Yr(a),Yr(c),Yr(o)}}}function N4(t,e,r){let n;return Ur(t,go,i=>r(0,n=i)),[n]}class j4 extends yn{constructor(e){super(),hn(this,e,N4,C4,ln,{})}}class ku{static createOnReadyEvent(e){return{type:Ta.ON_READY,message:"Simple Signer is ready to operate",page:e}}static createOnCancelEvent(e){return{type:Ta.ON_CANCEL,message:"The operation was canceled by the user",page:e}}static createOnConnectEvent(e,r){return{type:Ta.ON_CONNECT,message:{publicKey:e,wallet:r},page:Wi.CONNECT}}static createOnSignEvent(e){return{type:Ta.ON_SIGN,message:{signedXDR:e},page:Wi.SIGN}}static createOnPaymentRequest(e,r,n,i){return{type:Ta.ON_PAYMENT,message:{receiver:e,amount:r,assetCode:n,issuer:i},page:Wi.PAYMENT}}}var Ta=(t=>(t.ON_CONNECT="onConnect",t.ON_READY="onReady",t.ON_SIGN="onSign",t.ON_CANCEL="onCancel",t.ON_PAYMENT="onPayment",t))(Ta||{}),Wi=(t=>(t.CONNECT="connect",t.SIGN="sign",t.PAYMENT="payment",t))(Wi||{});class Md{constructor(e){this.pageType=e,window.addEventListener("beforeunload",()=>{this.mainActionPerformed||this.sendMessage(ku.createOnCancelEvent(this.pageType))}),window.addEventListener("message",r=>this.messageHandler(r))}mainActionPerformed=!1;availableWalletsMessageHandlers=[];transactionMessageHandlers=[];paymentMessageHandlers=[];sendSignedTx(e){this.mainActionPerformed=!0,this.sendMessage(ku.createOnSignEvent(e)),this.closeWindow()}sendOnReadyEvent(){this.sendMessage(ku.createOnReadyEvent(this.pageType))}sendOnCancelEvent(){this.closeWindow()}sendOnConnectEvent(e,r){this.mainActionPerformed=!0,this.sendMessage(ku.createOnConnectEvent(e,r))}addAvailableWalletsMessageHandler(e){this.availableWalletsMessageHandlers.push(e)}addTransactionMessageHandler(e){this.transactionMessageHandlers.push(e)}addPaymentMessageHandler(e){this.paymentMessageHandlers.push(e)}getTransactionMessageFromUrl(e){const r=new URLSearchParams(e||window.location.search),n=r.get("xdr"),i=r.get("description");let a;return n&&i?(a=n.replace(/\s/g,"+"),{xdr:a,description:i,operationGroups:[]}):n?(a=n.replace(/\s/g,"+"),{xdr:a,description:void 0,operationGroups:[]}):null}getPaymentMessageFromUrl(e){const r=new URLSearchParams(e||window.location.search),n=r.get("receiver"),i=r.get("amount"),a=r.get("assetCode"),s=r.get("issuer");return n&&i&&a&&s?{receiver:n,amount:i,assetCode:a,issuer:s}:null}getWalletsFromUrl(){const e=window.location.search;return new URLSearchParams(e).getAll("wallets")}getRedirectFromUrl(){const e=window.location.search;return new URLSearchParams(e).get("redirect")}messageHandler(e){if("wallets"in e.data){const r=e.data;this.availableWalletsMessageHandlers.forEach(n=>n(r));return}if("xdr"in e.data){const r=e.data;this.transactionMessageHandlers.forEach(n=>n(r));return}if("receiver"in e.data&&"amount"in e.data&&"assetCode"in e.data&&"issuer"in e.data){const r=e.data;this.paymentMessageHandlers.forEach(n=>n(r));return}}closeWindow(){return window.close()}sendMessage(e){window.opener&&window.opener.postMessage(e,"*")}}function Dd(t,e,r,n){const i=window.outerWidth{if(t[0]==="#"&&(t=t.slice(1)),t.length===3){let n="";t.split("").forEach(i=>{n+=i,n+=i}),t=n}return`rgba(${(t.match(/.{2}/g)||[]).map(n=>parseInt(n,16)).join(", ")}, ${e})`},Ny=(t,e=0)=>[...Array(t).keys()].map(r=>r+e);function jy(t,e,r){const n=t.slice();return n[6]=e[r],n}function Ly(t){let e,r;return{c(){e=Ct("div"),Ve(e,"class",r="lines small-lines "+t[6]+" svelte-bnawe9"),yo(e,"--color",t[0]),yo(e,"--duration",t[2]),Jd(e,"pause-animation",t[4])},m(n,i){Gt(n,e,i)},p(n,i){i&1&&yo(e,"--color",n[0]),i&4&&yo(e,"--duration",n[2]),i&16&&Jd(e,"pause-animation",n[4])},d(n){n&&Wt(e)}}}function M4(t){let e,r=Ny(2,1),n=[];for(let i=0;i{"color"in f&&r(0,n=f.color),"unit"in f&&r(1,i=f.unit),"duration"in f&&r(2,a=f.duration),"size"in f&&r(3,s=f.size),"pause"in f&&r(4,u=f.pause)},t.$$.update=()=>{t.$$.dirty&1&&r(5,c=L4(n,.2))},[n,i,a,s,u,c]}class U4 extends yn{constructor(e){super(),hn(this,e,D4,M4,ln,{color:0,unit:1,duration:2,size:3,pause:4})}}function F4(t){let e,r,n,i;return{c(){e=Nr("svg"),r=Nr("title"),n=Nr("g"),i=Nr("path"),Ve(n,"id","icomoon-ignore"),Ve(i,"fill","#0691b7"),Ve(i,"d","M463.313 7.189h-42.172l-426.917 1009.083 1.276 0.54h113.923l85.432-201.929c177.536 59.84 369.945 58.838 546.847-2.85l86.639 204.779h60.61l1.277-0.54-426.918-1009.083zM464.169 820.903c-86.461-0.017-172.354-13.977-254.369-41.343l259.081-612.373 257.936 609.659c-84.494 29.173-173.259 44.062-262.648 44.056z"),Ve(e,"version","1.1"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"width","90%"),Ve(e,"height","auto"),Ve(e,"viewBox","0 0 896 1024")},m(a,s){Gt(a,e,s),nt(e,r),nt(e,n),nt(e,i)},p:wr,i:wr,o:wr,d(a){a&&Wt(e)}}}class B4 extends yn{constructor(e){super(),hn(this,e,null,F4,ln,{})}}function $4(t){let e,r,n,i,a,s,u,c,f,l;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),i=Nr("path"),a=Nr("path"),s=Nr("path"),u=Nr("path"),c=Nr("path"),f=Nr("path"),l=Nr("path"),Ve(r,"d","M50.3536 40.4768C51.9984 37.6281 53.9091 36.4415 55.849 36.326C59.784 36.0659 68.5813 42.545 65.7979 46.3922L71.0121 55.4883C74.3432 58.28 77.7166 60.4787 81.173 61.939C80.5269 64.6437 82.0311 65.613 83.5484 66.5672C81.5248 63.0244 85.4875 61.0567 87.6233 64.5717C89.8297 67.6662 90.4205 70.8777 89.0991 73.3792C87.1454 77.1252 81.9036 79.9011 79.5282 83.3869C84.3643 79.0053 90.8699 79.497 93.442 74.4055C95.0438 71.2525 91.0389 61.9105 89.1698 58.7575C86.2742 53.9126 82.6626 55.3151 82.2547 56.8774C78.418 54.7799 75.0032 51.4537 71.5176 48.6763C73.1478 47.2453 74.0758 45.177 72.2919 44.063C68.6374 41.7497 64.3935 34.8365 58.8843 33.4909C58.3358 33.3552 57.7771 33.2818 57.2221 33.2818C54.3506 33.2818 51.5424 35.2293 50.3536 40.4768Z"),Ve(r,"fill","#4E4B66"),Ve(n,"d","M59.7556 123C64.0818 123 68.2987 122.419 72.2956 121.341C47.6898 127.955 32.6498 99.7837 51.3516 79.9737C44.465 78.1086 40.039 71.1662 40.4739 62.8789C3.31645 90.1261 20.9402 123 59.7556 123ZM72.3029 121.339C72.3415 121.328 72.3794 121.319 72.418 121.308C72.3801 121.318 72.3408 121.329 72.3029 121.339ZM72.2956 121.341C72.2985 121.34 72.3 121.34 72.3029 121.339C72.3007 121.34 72.2978 121.34 72.2956 121.341Z"),Ve(n,"fill","#C19CFC"),Ve(i,"d","M64.3505 32.9562C65.9538 33.9975 67.4566 35.3858 68.8479 36.7884C81.876 33.9398 73.6403 21.3278 80.414 16.3967C71.8556 19.3757 77.238 33.346 64.3505 32.9562Z"),Ve(i,"fill","#C19CFC"),Ve(a,"d","M43.0321 43.1814L50.3536 40.4767C48.5689 25.7245 68.8624 19.7372 62.0042 5.00001C61.7092 21.6892 41.3873 22.0656 43.0321 43.1814Z"),Ve(a,"fill","#C19CFC"),Ve(s,"d","M61.5686 75.2015C65.2078 73.5238 68.834 71.2524 72.474 72.3229C68.4822 69.7059 63.5783 70.9638 58.6308 71.3109C51.9838 71.7734 45.2385 71.1947 40.4738 62.879C42.4982 73.3934 51.8717 79.6701 61.5686 75.2015Z"),Ve(s,"fill","#C19CFC"),Ve(u,"d","M58.8982 21.6605C54.752 27.2146 49.398 32.5948 50.3537 40.4765C51.7727 34.214 55.4979 32.6518 58.8844 33.4906C64.3935 34.8362 68.6374 41.7494 72.2919 44.0628C74.0759 45.1767 73.1479 47.245 71.5176 48.676C75.0032 51.4534 78.4181 54.7796 82.2547 56.8771C82.6627 55.3148 86.2743 53.9123 89.1698 58.7572C91.039 61.9102 95.0439 71.2522 93.4421 74.4052C90.8699 79.4967 84.3643 79.005 79.5282 83.3866C76.5773 77.9202 70.6755 76.5311 64.7024 75.6495C67.1339 73.7837 69.6069 72.106 72.4741 72.3227C68.8341 71.2522 65.2079 73.5236 61.5686 75.2013C51.8717 79.6699 42.4982 73.3932 40.4739 62.8787C40.039 71.166 44.465 78.1084 51.3516 79.9735C32.6185 99.8164 47.7401 128.048 72.418 121.308C93.4705 115.551 109 95.8104 109 72.3227C109 51.4969 96.7863 33.6068 79.3323 25.8113C80.1336 30.4246 81.1453 34.8789 73.0641 40.9825C70.5204 38.7838 67.6817 35.1113 64.3505 32.9561C71.8694 33.1877 73.1624 28.5302 74.6521 24.0181C69.8517 22.4491 64.8401 21.6523 59.8029 21.6523C59.5014 21.6523 59.1998 21.6553 58.8982 21.6605ZM58.5471 46.5943C59.4744 46.7817 60.4163 47.5628 61.2736 48.4451C62.6649 49.877 63.9863 50.1236 65.6719 48.6191L71.0121 55.488L65.7979 46.3919C65.728 47.1153 65.1518 47.2884 64.4496 47.245C63.2273 47.1678 61.6852 46.2907 60.0673 46.2899C59.5655 46.2899 59.0563 46.3746 58.5471 46.5943ZM83.5485 66.5669C84.4058 65.0774 85.5713 64.1081 87.6233 64.5714C86.8351 63.2738 85.7979 62.7235 84.9048 62.7235C83.3773 62.7235 82.2715 64.3315 83.5485 66.5669Z"),Ve(u,"fill","#C19CFC"),Ve(c,"d","M55.1038 26.6073C52.1383 30.6126 49.693 34.9238 50.3537 40.4771C51.7727 34.2146 55.4979 32.6524 58.8844 33.4912C64.3935 34.8368 68.6374 41.75 72.292 44.0634C74.0759 45.1773 73.1479 47.2456 71.5176 48.6767C75.0032 51.4541 78.4181 54.7802 82.2548 56.8777C82.6627 55.3155 86.2743 53.9129 89.1698 58.7578C91.039 61.9108 95.0439 71.2528 93.4421 74.4058C90.87 79.4973 84.3643 79.0056 79.5282 83.3872C76.5773 77.9209 70.6755 76.5317 64.7024 75.6502C67.1339 73.7843 69.6069 72.1066 72.4741 72.3233C68.8341 71.2528 65.2079 73.5242 61.5687 75.2019C51.8717 79.6705 42.4982 73.3938 40.4739 62.8794C40.039 71.1666 44.465 78.109 51.3516 79.9741C39.1533 92.8896 41.3036 109.362 51.0981 117.432C78.5594 122.985 104.418 101.422 104.418 72.3233C104.418 54.3612 94.4116 38.8137 79.8101 31.2498C79.5428 34.1569 77.9971 37.2664 73.0641 40.9831C70.5204 38.7844 67.6817 35.112 64.3505 32.9567C69.3396 33.1014 71.6021 31.1059 72.9796 28.4147C68.6942 27.0488 64.2143 26.3629 59.7308 26.3629C58.1865 26.3629 56.6415 26.4438 55.1038 26.6073Z"),Ve(c,"fill","#14142B"),Ve(f,"d","M51.3516 79.9735C32.6185 99.8164 47.7401 128.048 72.418 121.308C44.1846 122.58 46.981 89.5771 64.8852 80.1909C71.3217 81.0875 77.9541 82.2307 81.1453 88.1303C85.9654 83.7637 92.4718 84.2404 95.0577 79.1489C96.0979 77.1106 94.7773 72.4681 93.217 68.591C93.8354 70.9786 94.0736 73.1765 93.442 74.4052C90.8699 79.4967 84.3643 79.005 79.5282 83.3866C76.5773 77.9202 70.6755 76.5311 64.7024 75.6495C67.1339 73.7837 69.6069 72.106 72.474 72.3227C68.8341 71.2522 65.2079 73.5236 61.5686 75.2013C51.8717 79.6699 42.4982 73.3932 40.4739 62.8787C40.039 71.166 44.465 78.1084 51.3516 79.9735Z"),Ve(f,"fill","#262338"),Ve(l,"d","M46.6267 42.3333L53.9481 40.9619C52.1635 26.2097 70.36 22.6667 63.4378 9.00001C63.4378 22.6667 44.2245 22.4853 46.6267 42.3333Z"),Ve(l,"fill","#14142B"),Ve(e,"width","100%"),Ve(e,"height","auto"),Ve(e,"viewBox","0 0 128 128"),Ve(e,"fill","none"),Ve(e,"xmlns","http://www.w3.org/2000/svg")},m(o,w){Gt(o,e,w),nt(e,r),nt(e,n),nt(e,i),nt(e,a),nt(e,s),nt(e,u),nt(e,c),nt(e,f),nt(e,l)},p:wr,i:wr,o:wr,d(o){o&&Wt(e)}}}class V4 extends yn{constructor(e){super(),hn(this,e,null,$4,ln,{})}}function q4(t){let e,r,n;return{c(){e=Nr("svg"),r=Nr("path"),n=Nr("path"),Ve(r,"d","M0 0h24v24H0z"),Ve(r,"fill","none"),Ve(n,"d","M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"height","100%"),Ve(e,"viewBox","0 0 24 24"),Ve(e,"width","auto"),Ve(e,"fill","#000000")},m(i,a){Gt(i,e,a),nt(e,r),nt(e,n)},p:wr,i:wr,o:wr,d(i){i&&Wt(e)}}}class My extends yn{constructor(e){super(),hn(this,e,null,q4,ln,{})}}function z4(t){let e,r,n,i,a,s,u,c;return{c(){e=Nr("svg"),r=Nr("rect"),n=Nr("path"),i=Nr("path"),a=Nr("defs"),s=Nr("linearGradient"),u=Nr("stop"),c=Nr("stop"),Ve(r,"width","48"),Ve(r,"height","48"),Ve(r,"rx","13.5"),Ve(r,"fill","url(#paint0_linear_137_303)"),Ve(n,"fill-rule","evenodd"),Ve(n,"clip-rule","evenodd"),Ve(n,"d","M22.4986 16C21.9066 13.6997 19.8185 12 17.3333 12C14.3878 12 12 14.3878 12 17.3333C12 20.2789 14.3878 22.6667 17.3333 22.6667C19.8185 22.6667 21.9066 20.967 22.4986 18.6667H27.1111V23.1111H29.7778V18.6667H31.5556V23.1111H34.2222V18.6667H36V16H22.4986ZM20 17.3333C20 18.8061 18.8061 20 17.3333 20C15.8606 20 14.6667 18.8061 14.6667 17.3333C14.6667 15.8606 15.8606 14.6667 17.3333 14.6667C18.8061 14.6667 20 15.8606 20 17.3333Z"),Ve(n,"fill","white"),Ve(i,"fill-rule","evenodd"),Ve(i,"clip-rule","evenodd"),Ve(i,"d","M25.5014 32C26.0934 34.3003 28.1815 36 30.6667 36C33.6122 36 36 33.6122 36 30.6667C36 27.7211 33.6122 25.3333 30.6667 25.3333C28.1815 25.3333 26.0934 27.033 25.5014 29.3333H20.8889V24.8889H18.2222L18.2222 29.3333H16.4444L16.4444 24.8889H13.7778L13.7778 29.3333H12L12 32H25.5014ZM28 30.6667C28 29.1939 29.1939 28 30.6667 28C32.1394 28 33.3333 29.1939 33.3333 30.6667C33.3333 32.1394 32.1394 33.3333 30.6667 33.3333C29.1939 33.3333 28 32.1394 28 30.6667Z"),Ve(i,"fill","white"),Ve(u,"stop-color","#CDADFF"),Ve(c,"offset","1"),Ve(c,"stop-color","#6432F1"),Ve(s,"id","paint0_linear_137_303"),Ve(s,"x1","48"),Ve(s,"y1","0"),Ve(s,"x2","1.14441e-05"),Ve(s,"y2","48"),Ve(s,"gradientUnits","userSpaceOnUse"),Ve(e,"height","100%"),Ve(e,"width","auto"),Ve(e,"viewBox","0 0 48 48"),Ve(e,"fill","none"),Ve(e,"xmlns","http://www.w3.org/2000/svg")},m(f,l){Gt(f,e,l),nt(e,r),nt(e,n),nt(e,i),nt(e,a),nt(a,s),nt(s,u),nt(s,c)},p:wr,i:wr,o:wr,d(f){f&&Wt(e)}}}class K4 extends yn{constructor(e){super(),hn(this,e,null,z4,ln,{})}}function H4(t){let e,r,n,i,a;return{c(){e=Nr("svg"),r=Nr("g"),n=Nr("path"),i=Nr("path"),a=Nr("path"),Ve(n,"fill","#B8BAC4"),Ve(n,"d","M11.61 44.536c-1.093.661-2.508.751-3.732.075l-3.206-1.774c-3.292-1.82-4.472-5.97-2.627-9.25l3.115-5.534 4.85 14.48c.29.882.876 1.57 1.6 2.003zM22.186 15.72l-4.13 12.334-6.445-11.452L20.637.564c.448-.798 1.655-.547 1.75.361l.696 6.54c.298 2.784-.009 5.6-.897 8.255z"),Ve(i,"fill","#000"),Ve(i,"d","M18.056 28.053l-4.846 14.48c-.294.877-.876 1.566-1.6 2.003-.724-.432-1.31-1.12-1.601-2.002l-4.85-14.481L11.61 16.6l6.447 11.452z"),Ve(a,"fill","#B8BAC4"),Ve(a,"d","M11.61 16.6L5.16 28.054 1.031 15.719C.143 13.065-.164 10.25.134 7.464L.83.924C.928.013 2.132-.238 2.58.561L11.61 16.6zM18.544 42.837l-3.202 1.774c-1.227.676-2.639.586-3.732-.075.724-.436 1.305-1.125 1.6-2.002l4.846-14.481 3.115 5.533c1.845 3.281.665 7.43-2.627 9.251z"),Ve(r,"fill","none"),Ve(e,"xmlns","http://www.w3.org/2000/svg"),Ve(e,"viewBox","0 0 24 46"),Ve(e,"class","rabet-logo svelte-1unkihb")},m(s,u){Gt(s,e,u),nt(e,r),nt(r,n),nt(r,i),nt(r,a)},p:wr,i:wr,o:wr,d(s){s&&Wt(e)}}}class W4 extends yn{constructor(e){super(),hn(this,e,null,H4,ln,{})}}function G4(t){let e,r,n,i,a,s,u,c,f;return{c(){e=Nr("svg"),r=Nr("style"),n=pr(`.st0 { fill-rule: evenodd; clip-rule: evenodd; fill: url(#SVGID_1_); @@ -127,10 +127,12 @@ Use Chrome, Firefox or Internet Explorer 11`)}},4281:a=>{var s={};function u(f,l * @license MIT */var hP=50;tr.TYPED_ARRAY_SUPPORT=mo.TYPED_ARRAY_SUPPORT!==void 0?mo.TYPED_ARRAY_SUPPORT:!0;Zu();function Zu(){return tr.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function hi(t,e){if(Zu()=Zu())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Zu().toString(16)+" bytes");return t|0}tr.isBuffer=UP;function ti(t){return!!(t!=null&&t._isBuffer)}tr.compare=function(e,r){if(!ti(e)||!ti(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,a=0,s=Math.min(n,i);a>>1;case"base64":return ew(t).length;default:if(n)return ec(t).length;e=(""+e).toLowerCase(),n=!0}}tr.byteLength=W_;function bP(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return IP(this,e,r);case"utf8":case"utf-8":return X_(this,e,r);case"ascii":return xP(this,e,r);case"latin1":case"binary":return PP(this,e,r);case"base64":return AP(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kP(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}tr.prototype._isBuffer=!0;function Ki(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}tr.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""};tr.prototype.compare=function(e,r,n,i,a){if(!ti(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var s=a-i,u=n-r,c=Math.min(s,u),f=this.slice(i,a),l=e.slice(r,n),o=0;o2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=tr.from(e,n)),ti(e))return e.length===0?-1:Uy(t,e,r,n,i);if(typeof e=="number")return e=e&255,tr.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Uy(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Uy(t,e,r,n,i){var a=1,s=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(p,d){return a===1?p[d]:p.readUInt16BE(d*a)}var f;if(i){var l=-1;for(f=r;fs&&(r=s-u),f=r;f>=0;f--){for(var o=!0,w=0;wi&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;sa)&&(n=a),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return _P(this,e,r,n);case"utf8":case"utf-8":return wP(this,e,r,n);case"ascii":return Y_(this,e,r,n);case"latin1":case"binary":return SP(this,e,r,n);case"base64":return EP(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return OP(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};tr.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function AP(t,e,r){return e===0&&r===t.length?Dy(t):Dy(t.slice(e,r))}function X_(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+u<=r){var c,f,l,o;switch(u){case 1:a<128&&(s=a);break;case 2:c=t[i+1],(c&192)===128&&(o=(a&31)<<6|c&63,o>127&&(s=o));break;case 3:c=t[i+1],f=t[i+2],(c&192)===128&&(f&192)===128&&(o=(a&15)<<12|(c&63)<<6|f&63,o>2047&&(o<55296||o>57343)&&(s=o));break;case 4:c=t[i+1],f=t[i+2],l=t[i+3],(c&192)===128&&(f&192)===128&&(l&192)===128&&(o=(a&15)<<18|(c&63)<<12|(f&63)<<6|l&63,o>65535&&o<1114112&&(s=o))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=u}return TP(n)}var Fy=4096;function TP(t){var e=t.length;if(e<=Fy)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",a=e;an&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}tr.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||Qn(e,r,this.length);for(var i=this[e],a=1,s=0;++s0&&(a*=256);)i+=this[e+--r]*a;return i};tr.prototype.readUInt8=function(e,r){return r||Qn(e,1,this.length),this[e]};tr.prototype.readUInt16LE=function(e,r){return r||Qn(e,2,this.length),this[e]|this[e+1]<<8};tr.prototype.readUInt16BE=function(e,r){return r||Qn(e,2,this.length),this[e]<<8|this[e+1]};tr.prototype.readUInt32LE=function(e,r){return r||Qn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};tr.prototype.readUInt32BE=function(e,r){return r||Qn(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};tr.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||Qn(e,r,this.length);for(var i=this[e],a=1,s=0;++s=a&&(i-=Math.pow(2,8*r)),i};tr.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||Qn(e,r,this.length);for(var i=r,a=1,s=this[e+--i];i>0&&(a*=256);)s+=this[e+--i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*r)),s};tr.prototype.readInt8=function(e,r){return r||Qn(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};tr.prototype.readInt16LE=function(e,r){r||Qn(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};tr.prototype.readInt16BE=function(e,r){r||Qn(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};tr.prototype.readInt32LE=function(e,r){return r||Qn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};tr.prototype.readInt32BE=function(e,r){return r||Qn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};tr.prototype.readFloatLE=function(e,r){return r||Qn(e,4,this.length),Oc(this,e,!0,23,4)};tr.prototype.readFloatBE=function(e,r){return r||Qn(e,4,this.length),Oc(this,e,!1,23,4)};tr.prototype.readDoubleLE=function(e,r){return r||Qn(e,8,this.length),Oc(this,e,!0,52,8)};tr.prototype.readDoubleBE=function(e,r){return r||Qn(e,8,this.length),Oc(this,e,!1,52,8)};function bo(t,e,r,n,i,a){if(!ti(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}tr.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;bo(this,e,r,n,a,0)}var s=1,u=0;for(this[r]=e&255;++u=0&&(u*=256);)this[r+s]=e/u&255;return r+n};tr.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,1,255,0),tr.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function Ac(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i>>(n?i:1-i)*8}tr.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,2,65535,0),tr.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):Ac(this,e,r,!0),r+2};tr.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,2,65535,0),tr.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):Ac(this,e,r,!1),r+2};function Tc(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i>>(n?i:3-i)*8&255}tr.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,4,4294967295,0),tr.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):Tc(this,e,r,!0),r+4};tr.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,4,4294967295,0),tr.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):Tc(this,e,r,!1),r+4};tr.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var a=Math.pow(2,8*n-1);bo(this,e,r,n,a-1,-a)}var s=0,u=1,c=0;for(this[r]=e&255;++s>0)-c&255;return r+n};tr.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var a=Math.pow(2,8*n-1);bo(this,e,r,n,a-1,-a)}var s=n-1,u=1,c=0;for(this[r+s]=e&255;--s>=0&&(u*=256);)e<0&&c===0&&this[r+s+1]!==0&&(c=1),this[r+s]=(e/u>>0)-c&255;return r+n};tr.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,1,127,-128),tr.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};tr.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,2,32767,-32768),tr.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):Ac(this,e,r,!0),r+2};tr.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,2,32767,-32768),tr.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):Ac(this,e,r,!1),r+2};tr.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,4,2147483647,-2147483648),tr.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):Tc(this,e,r,!0),r+4};tr.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||bo(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),tr.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):Tc(this,e,r,!1),r+4};function Q_(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function J_(t,e,r,n,i){return i||Q_(t,e,r,4),q_(t,e,r,n,23,4),r+4}tr.prototype.writeFloatLE=function(e,r,n){return J_(this,e,r,!0,n)};tr.prototype.writeFloatBE=function(e,r,n){return J_(this,e,r,!1,n)};function Z_(t,e,r,n,i){return i||Q_(t,e,r,8),q_(t,e,r,n,52,8),r+8}tr.prototype.writeDoubleLE=function(e,r,n){return Z_(this,e,r,!0,n)};tr.prototype.writeDoubleBE=function(e,r,n){return Z_(this,e,r,!1,n)};tr.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--s)e[s+r]=this[s+n];else if(a<1e3||!tr.TYPED_ARRAY_SUPPORT)for(s=0;s>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function LP(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function ew(t){return lP(CP(t))}function xc(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function DP(t){return t!==t}function UP(t){return t!=null&&(!!t._isBuffer||tw(t)||FP(t))}function tw(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function FP(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&tw(t.slice(0,0))}var rw={exports:{}};(function(t){(function(e,r){t.exports?t.exports=r():(e.nacl||(e.nacl={}),e.nacl.util=r())})(Et,function(){var e={};function r(n){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(n))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(n){if(typeof n!="string")throw new TypeError("expected string");var i,a=unescape(encodeURIComponent(n)),s=new Uint8Array(a.length);for(i=0;i"u"?typeof tr.from<"u"?(e.encodeBase64=function(n){return tr.from(n).toString("base64")},e.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(tr.from(n,"base64"),0))}):(e.encodeBase64=function(n){return new tr(n).toString("base64")},e.decodeBase64=function(n){return r(n),new Uint8Array(Array.prototype.slice.call(new tr(n,"base64"),0))}):(e.encodeBase64=function(n){var i,a=[],s=n.length;for(i=0;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$y=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Vy=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(u=s.next()).done;)c.push(u.value)}catch(l){f={error:l}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(f)throw f.error}}return c},r=Et&&Et.__spreadArray||function(n,i){for(var a=0,s=i.length,u=n.length;a0)&&!(c=u.next()).done;)f.push(c.value)}catch(o){l={error:o}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(l)throw l.error}}return f},r=Et&&Et.__spreadArray||function(i,a){for(var s=0,u=a.length,c=i.length;s=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.AnonymousSubject=Fn.Subject=void 0;var Wy=bn,zp=Vn,C8=Vs,N8=Fo,np=Pi,pw=function(t){fw(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Kp(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new C8.ObjectUnsubscribedError},e.prototype.next=function(r){var n=this;np.errorContext(function(){var i,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=R8(n.currentObservers),u=s.next();!u.done;u=s.next()){var c=u.value;c.next(r)}}catch(f){i={error:f}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;np.errorContext(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;np.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,s=i.isStopped,u=i.observers;return a||s?zp.EMPTY_SUBSCRIPTION:(this.currentObservers=null,u.push(r),new zp.Subscription(function(){n.currentObservers=null,N8.arrRemove(u,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,s=n.isStopped;i?r.error(a):s&&r.complete()},e.prototype.asObservable=function(){var r=new Wy.Observable;return r.source=this,r},e.create=function(r,n){return new Kp(r,n)},e}(Wy.Observable);Fn.Subject=pw;var Kp=function(t){fw(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:zp.EMPTY_SUBSCRIPTION},e}(pw);Fn.AnonymousSubject=Kp;var qs={},j8=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(qs,"__esModule",{value:!0});qs.BehaviorSubject=void 0;var L8=Fn,M8=function(t){j8(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(L8.Subject);qs.BehaviorSubject=M8;var Xa={},kc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}})(kc);var D8=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ReplaySubject=void 0;var U8=Fn,F8=kc,B8=function(t){D8(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=F8.dateTimestampProvider);var a=t.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return e.prototype.next=function(r){var n=this,i=n.isStopped,a=n._buffer,s=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;i||(a.push(r),!s&&a.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,a=i._infiniteTimeWindow,s=i._buffer,u=s.slice(),c=0;c0)&&!(u=s.next()).done;)c.push(u.value)}catch(l){f={error:l}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(f)throw f.error}}return c},r=Et&&Et.__spreadArray||function(n,i){for(var a=0,s=i.length,u=n.length;a0)&&!(l=f.next()).done;)o.push(l.value)}catch(p){w={error:p}}finally{try{l&&!l.done&&(c=f.return)&&c.call(f)}finally{if(w)throw w.error}}return o},r=Et&&Et.__spreadArray||function(s,u){for(var c=0,f=u.length,l=s.length;c0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=Xy.immediateProvider.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.some(function(a){return a.id===n})||(Xy.immediateProvider.clearImmediate(n),r._scheduled=void 0)},e}(Z8.AsyncAction);Rc.AsapAction=eI;var Nc={},Mi={},zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.Scheduler=void 0;var tI=kc,rI=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=tI.dateTimestampProvider.now,t}();zs.Scheduler=rI;var nI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mi,"__esModule",{value:!0});Mi.AsyncScheduler=void 0;var Qy=zs,oI=function(t){nI(e,t);function e(r,n){n===void 0&&(n=Qy.Scheduler.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Qy.Scheduler);Mi.AsyncScheduler=oI;var iI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Nc,"__esModule",{value:!0});Nc.AsapScheduler=void 0;var aI=Mi,sI=function(t){iI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(aI.AsyncScheduler);Nc.AsapScheduler=sI;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var e=Rc,r=Nc;t.asapScheduler=new r.AsapScheduler(e.AsapAction),t.asap=t.asapScheduler})(dw);var _o={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var e=Li,r=Mi;t.asyncScheduler=new r.AsyncScheduler(e.AsyncAction),t.async=t.asyncScheduler})(_o);var vw={},jc={},uI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(jc,"__esModule",{value:!0});jc.QueueAction=void 0;var cI=Li,lI=function(t){uI(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(cI.AsyncAction);jc.QueueAction=lI;var Lc={},fI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Lc,"__esModule",{value:!0});Lc.QueueScheduler=void 0;var pI=Mi,dI=function(t){fI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(pI.AsyncScheduler);Lc.QueueScheduler=dI;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var e=jc,r=Lc;t.queueScheduler=new r.QueueScheduler(e.QueueAction),t.queue=t.queueScheduler})(vw);var mw={},Mc={},hI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mc,"__esModule",{value:!0});Mc.AnimationFrameAction=void 0;var yI=Li,Jy=zd,vI=function(t){hI(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=Jy.animationFrameProvider.requestAnimationFrame(function(){return r.flush(void 0)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.some(function(a){return a.id===n})||(Jy.animationFrameProvider.cancelAnimationFrame(n),r._scheduled=void 0)},e}(yI.AsyncAction);Mc.AnimationFrameAction=vI;var Dc={},mI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Dc,"__esModule",{value:!0});Dc.AnimationFrameScheduler=void 0;var gI=Mi,bI=function(t){mI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(gI.AsyncScheduler);Dc.AnimationFrameScheduler=bI;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var e=Mc,r=Dc;t.animationFrameScheduler=new r.AnimationFrameScheduler(e.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler})(mw);var Ba={},gw=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ba,"__esModule",{value:!0});Ba.VirtualAction=Ba.VirtualTimeScheduler=void 0;var _I=Li,wI=Vn,SI=Mi,EI=function(t){gw(e,t);function e(r,n){r===void 0&&(r=bw),n===void 0&&(n=1/0);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,a,s;(s=n[0])&&s.delay<=i&&(n.shift(),this.frame=s.delay,!(a=s.execute(s.state,s.delay))););if(a){for(;s=n.shift();)s.unsubscribe();throw a}},e.frameTimeFactor=10,e}(SI.AsyncScheduler);Ba.VirtualTimeScheduler=EI;var bw=function(t){gw(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var a=t.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.index=i,a.active=!0,a.index=r.index=i,a}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}else return wI.Subscription.EMPTY},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var a=r.actions;return a.push(this),a.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(_I.AsyncAction);Ba.VirtualAction=bw;var Uc={},No={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var e=bn;t.EMPTY=new e.Observable(function(i){return i.complete()});function r(i){return i?n(i):t.EMPTY}t.empty=r;function n(i){return new e.Observable(function(a){return i.schedule(function(){return a.complete()})})}})(No);var Ja={},qn={},fa={};Object.defineProperty(fa,"__esModule",{value:!0});fa.isScheduler=void 0;var OI=fn;function AI(t){return t&&OI.isFunction(t.schedule)}fa.isScheduler=AI;Object.defineProperty(qn,"__esModule",{value:!0});qn.popNumber=qn.popScheduler=qn.popResultSelector=void 0;var TI=fn,xI=fa;function Kd(t){return t[t.length-1]}function PI(t){return TI.isFunction(Kd(t))?t.pop():void 0}qn.popResultSelector=PI;function II(t){return xI.isScheduler(Kd(t))?t.pop():void 0}qn.popScheduler=II;function kI(t,e){return typeof Kd(t)=="number"?t.pop():e}qn.popNumber=kI;var Oo={},Ks={},Fc={},Mr={},Za={};Object.defineProperty(Za,"__esModule",{value:!0});Za.isArrayLike=void 0;Za.isArrayLike=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.isPromise=void 0;var RI=fn;function CI(t){return RI.isFunction(t?.then)}Hs.isPromise=CI;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.isInteropObservable=void 0;var NI=ca,jI=fn;function LI(t){return jI.isFunction(t[NI.observable])}Ws.isInteropObservable=LI;var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.isAsyncIterable=void 0;var MI=fn;function DI(t){return Symbol.asyncIterator&&MI.isFunction(t?.[Symbol.asyncIterator])}Gs.isAsyncIterable=DI;var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.createInvalidObservableTypeError=void 0;function UI(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}Ys.createInvalidObservableTypeError=UI;var Xs={},ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.iterator=ta.getSymbolIterator=void 0;function _w(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}ta.getSymbolIterator=_w;ta.iterator=_w();Object.defineProperty(Xs,"__esModule",{value:!0});Xs.isIterable=void 0;var FI=ta,BI=fn;function $I(t){return BI.isFunction(t?.[FI.iterator])}Xs.isIterable=$I;var Ii={},VI=Et&&Et.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]1||u(w,p)})})}function u(w,p){try{c(n[w](p))}catch(d){o(a[0][3],d)}}function c(w){w.value instanceof ka?Promise.resolve(w.value.v).then(f,l):o(a[0][2],w)}function f(w){u("next",w)}function l(w){u("throw",w)}function o(w,p){w(p),a.shift(),a.length&&u(a[0][0],a[0][1])}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.isReadableStreamLike=Ii.readableStreamLikeToAsyncGenerator=void 0;var zI=fn;function KI(t){return qI(this,arguments,function(){var r,n,i,a;return VI(this,function(s){switch(s.label){case 0:r=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,ka(r.read())];case 3:return n=s.sent(),i=n.value,a=n.done,a?[4,ka(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,ka(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}Ii.readableStreamLikeToAsyncGenerator=KI;function HI(t){return zI.isFunction(t?.getReader)}Ii.isReadableStreamLike=HI;var WI=Et&&Et.__awaiter||function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function u(l){try{f(n.next(l))}catch(o){s(o)}}function c(l){try{f(n.throw(l))}catch(o){s(o)}}function f(l){l.done?a(l.value):i(l.value).then(u,c)}f((n=n.apply(t,e||[])).next())})},GI=Et&&Et.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.fromReadableStreamLike=Mr.fromAsyncIterable=Mr.fromIterable=Mr.fromPromise=Mr.fromArrayLike=Mr.fromInteropObservable=Mr.innerFrom=void 0;var XI=Za,QI=Hs,es=bn,JI=Ws,ZI=Gs,ek=Ys,tk=Xs,ww=Ii,rk=fn,nk=Bs,ok=ca;function ik(t){if(t instanceof es.Observable)return t;if(t!=null){if(JI.isInteropObservable(t))return Sw(t);if(XI.isArrayLike(t))return Ew(t);if(QI.isPromise(t))return Ow(t);if(ZI.isAsyncIterable(t))return Hd(t);if(tk.isIterable(t))return Aw(t);if(ww.isReadableStreamLike(t))return Tw(t)}throw ek.createInvalidObservableTypeError(t)}Mr.innerFrom=ik;function Sw(t){return new es.Observable(function(e){var r=t[ok.observable]();if(rk.isFunction(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}Mr.fromInteropObservable=Sw;function Ew(t){return new es.Observable(function(e){for(var r=0;r0&&T(d)},void 0,void 0,function(){_?.closed||_?.unsubscribe(),L=null})),!b&&T(p!=null?typeof p=="number"?p:+p-h.now():d)})}t.timeout=c;function f(l){throw new t.TimeoutError(l)}})(rc);var Hc={},nu={},ii={},ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.map=void 0;var dR=vr,hR=Sr;function yR(t,e){return dR.operate(function(r,n){var i=0;r.subscribe(hR.createOperatorSubscriber(n,function(a){n.next(t.call(e,a,i++))}))})}ai.map=yR;var vR=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},mR=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},rv=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};Object.defineProperty(Xc,"__esModule",{value:!0});Xc.fromEvent=void 0;var xC=Mr,PC=bn,IC=$o,kC=Za,ra=fn,RC=ii,CC=["addListener","removeListener"],NC=["addEventListener","removeEventListener"],jC=["on","off"];function Gp(t,e,r,n){if(ra.isFunction(r)&&(n=r,r=void 0),n)return Gp(t,e,r).pipe(RC.mapOneOrManyArgs(n));var i=TC(DC(t)?NC.map(function(u){return function(c){return t[u](e,c,r)}}):LC(t)?CC.map(av(t,e)):MC(t)?jC.map(av(t,e)):[],2),a=i[0],s=i[1];if(!a&&kC.isArrayLike(t))return IC.mergeMap(function(u){return Gp(u,e,r)})(xC.innerFrom(t));if(!a)throw new TypeError("Invalid event target");return new PC.Observable(function(u){var c=function(){for(var f=[],l=0;l0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},lN=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0){var u=void 0;try{u=pN.innerFrom(a.shift())}catch{s();return}var c=hN.createOperatorSubscriber(i,void 0,cv.noop,cv.noop);u.subscribe(c),c.add(s)}else i.complete()};s()})}rl.onErrorResumeNext=yN;Object.defineProperty(tl,"__esModule",{value:!0});tl.onErrorResumeNext=void 0;var vN=No,mN=rl,gN=mi;function bN(){for(var t=[],e=0;e0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},BN=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ll,"__esModule",{value:!0});ll.bufferCount=void 0;var o9=vr,i9=Sr,a9=Fo;function s9(t,e){return e===void 0&&(e=null),e=e??t,o9.operate(function(r,n){var i=[],a=0;r.subscribe(i9.createOperatorSubscriber(n,function(s){var u,c,f,l,o=null;a++%e===0&&i.push([]);try{for(var w=ap(i),p=w.next();!p.done;p=w.next()){var d=p.value;d.push(s),t<=d.length&&(o=o??[],o.push(d))}}catch(O){u={error:O}}finally{try{p&&!p.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}if(o)try{for(var S=ap(o),v=S.next();!v.done;v=S.next()){var d=v.value;a9.arrRemove(i,d),n.next(d)}}catch(O){f={error:O}}finally{try{v&&!v.done&&(l=S.return)&&l.call(S)}finally{if(f)throw f.error}}},function(){var s,u;try{for(var c=ap(i),f=c.next();!f.done;f=c.next()){var l=f.value;n.next(l)}}catch(o){s={error:o}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(s)throw s.error}}n.complete()},void 0,function(){i=null}))})}ll.bufferCount=s9;var fl={},u9=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(fl,"__esModule",{value:!0});fl.bufferTime=void 0;var c9=Vn,l9=vr,f9=Sr,p9=Fo,d9=_o,h9=qn,hv=Bo;function y9(t){for(var e,r,n=[],i=1;i=0?hv.executeSchedule(f,a,p,s,!0):o=!0,p();var d=f9.createOperatorSubscriber(f,function(S){var v,O,h=l.slice();try{for(var g=u9(h),A=g.next();!A.done;A=g.next()){var m=A.value,x=m.buffer;x.push(S),u<=x.length&&w(m)}}catch(y){v={error:y}}finally{try{A&&!A.done&&(O=g.return)&&O.call(g)}finally{if(v)throw v.error}}},function(){for(;l?.length;)f.next(l.shift().buffer);d?.unsubscribe(),f.complete(),f.unsubscribe()},void 0,function(){return l=null});c.subscribe(d)})}fl.bufferTime=y9;var pl={},v9=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(pl,"__esModule",{value:!0});pl.bufferToggle=void 0;var m9=Vn,g9=vr,yv=Mr,sp=Sr,vv=Hn,b9=Fo;function _9(t,e){return g9.operate(function(r,n){var i=[];yv.innerFrom(t).subscribe(sp.createOperatorSubscriber(n,function(a){var s=[];i.push(s);var u=new m9.Subscription,c=function(){b9.arrRemove(i,s),n.next(s),u.unsubscribe()};u.add(yv.innerFrom(e(a)).subscribe(sp.createOperatorSubscriber(n,c,vv.noop)))},vv.noop)),r.subscribe(sp.createOperatorSubscriber(n,function(a){var s,u;try{for(var c=v9(i),f=c.next();!f.done;f=c.next()){var l=f.value;l.push(a)}}catch(o){s={error:o}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(s)throw s.error}}},function(){for(;i.length>0;)n.next(i.shift());n.complete()}))})}pl.bufferToggle=_9;var dl={};Object.defineProperty(dl,"__esModule",{value:!0});dl.bufferWhen=void 0;var w9=vr,S9=Hn,mv=Sr,E9=Mr;function O9(t){return w9.operate(function(e,r){var n=null,i=null,a=function(){i?.unsubscribe();var s=n;n=[],s&&r.next(s),E9.innerFrom(t()).subscribe(i=mv.createOperatorSubscriber(r,a,S9.noop))};a(),e.subscribe(mv.createOperatorSubscriber(r,function(s){return n?.push(s)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}dl.bufferWhen=O9;var hl={};Object.defineProperty(hl,"__esModule",{value:!0});hl.catchError=void 0;var A9=Mr,T9=Sr,x9=vr;function Lw(t){return x9.operate(function(e,r){var n=null,i=!1,a;n=e.subscribe(T9.createOperatorSubscriber(r,void 0,void 0,function(s){a=A9.innerFrom(t(s,Lw(t)(e))),n?(n.unsubscribe(),n=null,a.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,a.subscribe(r))})}hl.catchError=Lw;var yl={},uu={},cu={},lu={},Di={},fu={};Object.defineProperty(fu,"__esModule",{value:!0});fu.scanInternals=void 0;var P9=Sr;function I9(t,e,r,n,i){return function(a,s){var u=r,c=e,f=0;a.subscribe(P9.createOperatorSubscriber(s,function(l){var o=f++;c=u?t(c,l,o):(u=!0,l),n&&s.next(c)},i&&function(){u&&s.next(c),s.complete()}))}}fu.scanInternals=I9;Object.defineProperty(Di,"__esModule",{value:!0});Di.reduce=void 0;var k9=fu,R9=vr;function C9(t,e){return R9.operate(k9.scanInternals(t,e,arguments.length>=2,!1,!0))}Di.reduce=C9;Object.defineProperty(lu,"__esModule",{value:!0});lu.toArray=void 0;var N9=Di,j9=vr,L9=function(t,e){return t.push(e),t};function M9(){return j9.operate(function(t,e){N9.reduce(L9,[])(t).subscribe(e)})}lu.toArray=M9;Object.defineProperty(cu,"__esModule",{value:!0});cu.joinAllInternals=void 0;var D9=Jn,U9=ii,F9=vi,B9=$o,$9=lu;function V9(t,e){return F9.pipe($9.toArray(),B9.mergeMap(function(r){return t(r)}),e?U9.mapOneOrManyArgs(e):D9.identity)}cu.joinAllInternals=V9;Object.defineProperty(uu,"__esModule",{value:!0});uu.combineLatestAll=void 0;var q9=ki,z9=cu;function K9(t){return z9.joinAllInternals(q9.combineLatest,t)}uu.combineLatestAll=K9;Object.defineProperty(yl,"__esModule",{value:!0});yl.combineAll=void 0;var H9=uu;yl.combineAll=H9.combineLatestAll;var vl={},ml={},gv=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},bv=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},ej=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},uj=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},yj=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=2;return function(n){return n.pipe(S7.filter(function(i,a){return a===t}),A7.take(1),r?O7.defaultIfEmpty(e):E7.throwIfEmpty(function(){return new Av.ArgumentOutOfRangeError}))}}Il.elementAt=T7;var kl={},x7=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},P7=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=2;return function(n){return n.pipe(t?Z7.filter(function(i,a){return t(i,a,n)}):nL.identity,eL.take(1),r?tL.defaultIfEmpty(e):rL.throwIfEmpty(function(){return new J7.EmptyError}))}}Dl.first=oL;var Ul={};Object.defineProperty(Ul,"__esModule",{value:!0});Ul.groupBy=void 0;var iL=bn,aL=Mr,sL=Fn,uL=vr,Iv=Sr;function cL(t,e,r,n){return uL.operate(function(i,a){var s;!e||typeof e=="function"?s=e:(r=e.duration,s=e.element,n=e.connector);var u=new Map,c=function(d){u.forEach(d),d(a)},f=function(d){return c(function(S){return S.error(d)})},l=0,o=!1,w=new Iv.OperatorSubscriber(a,function(d){try{var S=t(d),v=u.get(S);if(!v){u.set(S,v=n?n():new sL.Subject);var O=p(S,v);if(a.next(O),r){var h=Iv.createOperatorSubscriber(v,function(){v.complete(),h?.unsubscribe()},void 0,void 0,function(){return u.delete(S)});w.add(aL.innerFrom(r(O)).subscribe(h))}}v.next(s?s(d):d)}catch(g){f(g)}},function(){return c(function(d){return d.complete()})},f,function(){return u.clear()},function(){return o=!0,l===0});i.subscribe(w);function p(d,S){var v=new iL.Observable(function(O){l++;var h=S.subscribe(O);return function(){h.unsubscribe(),--l===0&&o&&w.unsubscribe()}});return v.key=d,v}})}Ul.groupBy=cL;var Fl={};Object.defineProperty(Fl,"__esModule",{value:!0});Fl.isEmpty=void 0;var lL=vr,fL=Sr;function pL(){return lL.operate(function(t,e){t.subscribe(fL.createOperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}Fl.isEmpty=pL;var Bl={},gu={},dL=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(gu,"__esModule",{value:!0});gu.takeLast=void 0;var hL=No,yL=vr,vL=Sr;function mL(t){return t<=0?function(){return hL.EMPTY}:yL.operate(function(e,r){var n=[];e.subscribe(vL.createOperatorSubscriber(r,function(i){n.push(i),t=2;return function(n){return n.pipe(t?bL.filter(function(i,a){return t(i,a,n)}):EL.identity,_L.takeLast(1),r?SL.defaultIfEmpty(e):wL.throwIfEmpty(function(){return new gL.EmptyError}))}}Bl.last=OL;var $l={};Object.defineProperty($l,"__esModule",{value:!0});$l.materialize=void 0;var up=Uc,AL=vr,TL=Sr;function xL(){return AL.operate(function(t,e){t.subscribe(TL.createOperatorSubscriber(e,function(r){e.next(up.Notification.createNext(r))},function(){e.next(up.Notification.createComplete()),e.complete()},function(r){e.next(up.Notification.createError(r)),e.complete()}))})}$l.materialize=xL;var Vl={};Object.defineProperty(Vl,"__esModule",{value:!0});Vl.max=void 0;var PL=Di,IL=fn;function kL(t){return PL.reduce(IL.isFunction(t)?function(e,r){return t(e,r)>0?e:r}:function(e,r){return e>r?e:r})}Vl.max=kL;var ql={};Object.defineProperty(ql,"__esModule",{value:!0});ql.flatMap=void 0;var RL=$o;ql.flatMap=RL.mergeMap;var zl={};Object.defineProperty(zl,"__esModule",{value:!0});zl.mergeMapTo=void 0;var kv=$o,CL=fn;function NL(t,e,r){return r===void 0&&(r=1/0),CL.isFunction(e)?kv.mergeMap(function(){return t},e,r):(typeof e=="number"&&(r=e),kv.mergeMap(function(){return t},r))}zl.mergeMapTo=NL;var Kl={};Object.defineProperty(Kl,"__esModule",{value:!0});Kl.mergeScan=void 0;var jL=vr,LL=ns;function ML(t,e,r){return r===void 0&&(r=1/0),jL.operate(function(n,i){var a=e;return LL.mergeInternals(n,i,function(s,u){return t(a,s,u)},r,function(s){a=s},!1,void 0,function(){return a=null})})}Kl.mergeScan=ML;var Hl={},Wl={},DL=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},UL=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},KL=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},bM=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=2,!0))}uf.scan=YM;var cf={};Object.defineProperty(cf,"__esModule",{value:!0});cf.sequenceEqual=void 0;var XM=vr,QM=Sr;function JM(t,e){return e===void 0&&(e=function(r,n){return r===n}),XM.operate(function(r,n){var i=Fv(),a=Fv(),s=function(c){n.next(c),n.complete()},u=function(c,f){var l=QM.createOperatorSubscriber(n,function(o){var w=f.buffer,p=f.complete;w.length===0?p?s(!1):c.buffer.push(o):!e(o,w.shift())&&s(!1)},function(){c.complete=!0;var o=f.complete,w=f.buffer;o&&s(w.length===0),l?.unsubscribe()});return l};r.subscribe(u(i,a)),t.subscribe(u(a,i))})}cf.sequenceEqual=JM;function Fv(){return{buffer:[],complete:!1}}var _u={},ZM=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},eD=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(xf,"__esModule",{value:!0});xf.windowCount=void 0;var Wv=Fn,_U=vr,wU=Sr;function SU(t,e){e===void 0&&(e=0);var r=e>0?e:t;return _U.operate(function(n,i){var a=[new Wv.Subject],s=0;i.next(a[0].asObservable()),n.subscribe(wU.createOperatorSubscriber(i,function(u){var c,f;try{for(var l=bU(a),o=l.next();!o.done;o=l.next()){var w=o.value;w.next(u)}}catch(S){c={error:S}}finally{try{o&&!o.done&&(f=l.return)&&f.call(l)}finally{if(c)throw c.error}}var p=s-t+1;if(p>=0&&p%r===0&&a.shift().complete(),++s%r===0){var d=new Wv.Subject;a.push(d),i.next(d.asObservable())}},function(){for(;a.length>0;)a.shift().complete();i.complete()},function(u){for(;a.length>0;)a.shift().error(u);i.error(u)},function(){a=null}))})}xf.windowCount=SU;var Pf={};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.windowTime=void 0;var EU=Fn,OU=_o,AU=Vn,TU=vr,xU=Sr,PU=Fo,IU=qn,Gv=Bo;function kU(t){for(var e,r,n=[],i=1;i=0?Gv.executeSchedule(f,a,p,s,!0):o=!0,p();var d=function(v){return l.slice().forEach(v)},S=function(v){d(function(O){var h=O.window;return v(h)}),v(f),f.unsubscribe()};return c.subscribe(xU.createOperatorSubscriber(f,function(v){d(function(O){O.window.next(v),u<=++O.seen&&w(O)})},function(){return S(function(v){return v.complete()})},function(v){return S(function(O){return O.error(v)})})),function(){l=null}})}Pf.windowTime=kU;var If={},RU=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(If,"__esModule",{value:!0});If.windowToggle=void 0;var CU=Fn,NU=Vn,jU=vr,Yv=Mr,lp=Sr,Xv=Hn,LU=Fo;function MU(t,e){return jU.operate(function(r,n){var i=[],a=function(s){for(;00)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Zv=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},QU=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},rF=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r{var a;!((a=this.target)===null||a===void 0)&&a.closed&&this.closeCurrentPromises$.next()}),this.onInititalResponseSubscription=this.initialResponse$.pipe((0,cn.takeUntil)(this.closeObservables$)).subscribe(a=>{const s=this.decryptFromReceiver({oneTimeCode:a.data.oneTimeCode,payload:a.data.message,senderPublicKey:a.data.publicKey});JSON.parse(s).providedSession===this.session()&&(this.targetPublicKey=a.data.publicKey,this.initialResponseCompleted$.next())}),this.onConnectResponseSubscription=this.connectResponse$.pipe((0,cn.takeUntil)(this.closeObservables$)).subscribe(a=>{if(!this.targetPublicKey){this.connectResult$.next({success:!1,message:"Wallet encryption public key is not provided, request rejected."});return}if(!a.data.success){this.connectResult$.next({success:!1,message:"Request rejected from the wallet"});return}const s=this.decryptFromReceiver({oneTimeCode:a.data.oneTimeCode,payload:a.data.message,senderPublicKey:this.targetPublicKey}),u=JSON.parse(s);this.connectResult$.next({success:!0,publicKey:u.publicKey})}),this.onSignResponseSubscription=this.signResponse$.pipe((0,cn.takeUntil)(this.closeObservables$)).subscribe(a=>{if(!this.targetPublicKey){this.signResult$.next({success:!1,message:"Wallet encryption public key is not provided, request rejected."});return}if(!a.data.success){this.signResult$.next({success:!1,message:"Request rejected from the wallet"});return}const s=this.decryptFromReceiver({oneTimeCode:a.data.oneTimeCode,payload:a.data.message,senderPublicKey:this.targetPublicKey}),u=JSON.parse(s);this.signResult$.next({success:!0,xdr:u.xdr})}),this.preferredTarget=e?.preferredTarget||"extension",this.walletUrl=e?.url||"https://wallet.xbull.app/connect";const r=hs.box.keyPair(),n=(0,Lo.encodeBase64)((0,hs.randomBytes)(24));this.encryptForReceiver=a=>{const s=(0,hs.randomBytes)(24),u=(0,hs.box)((0,Lo.decodeUTF8)(a.data),s,a.receiverPublicKey,r.secretKey);return{message:(0,Lo.encodeBase64)(u),oneTimeCode:(0,Lo.encodeBase64)(s)}},this.decryptFromReceiver=a=>{const s=hs.box.open((0,Lo.decodeBase64)(a.payload),(0,Lo.decodeBase64)(a.oneTimeCode),(0,Lo.decodeBase64)(a.senderPublicKey),r.secretKey);if(!s)throw new Error("Decrypted message is null");return(0,Lo.encodeUTF8)(s)},this.publicKey=()=>r.publicKey,this.session=()=>n.slice();const i=a=>{switch(a.data.type){case ys.EventType.XBULL_INITIAL_RESPONSE:this.initialResponse$.next(a);break;case ys.EventType.XBULL_CONNECT_RESPONSE:this.connectResponse$.next(a);break;case ys.EventType.XBULL_SIGN_RESPONSE:this.signResponse$.next(a);break}};window.addEventListener("message",i),this.closeObservables$.asObservable().pipe((0,cn.take)(1)).subscribe(()=>{window.removeEventListener("message",i)})}openWallet(){return!!this.target&&!this.target.closed&&(this.target.close(),this.target=null,this.closeCurrentPromises$.next()),this.target=window.open(`${this.walletUrl}?public=${encodeURIComponent((0,Lo.encodeBase64)(this.publicKey()))}&session=${encodeURIComponent(this.session())}`,"xBull_Wallet_app","width=380,height=640,left=100,top=100"),(0,cn.firstValueFrom)(this.initialResponseCompleted$.pipe((0,cn.takeUntil)(this.closeCurrentPromises$)).pipe((0,cn.takeUntil)(this.closeObservables$)))}closeWallet(){var e;this.target&&((e=this.target)===null||e===void 0||e.close(),this.target=null)}connect(e={canRequestPublicKey:!0,canRequestSign:!0}){return tm(this,void 0,void 0,function*(){const r=window.xBullSDK;if(!!r&&this.preferredTarget==="extension")return yield r.connect(e),r.getPublicKey();{if(yield this.openWallet(),!this.target||!this.targetPublicKey)throw new Error("xBull Wallet is not open, we can't connect with it");const{message:n,oneTimeCode:i}=this.encryptForReceiver({data:JSON.stringify(e),receiverPublicKey:(0,Lo.decodeBase64)(this.targetPublicKey)}),a={type:ys.EventType.XBULL_CONNECT,message:n,oneTimeCode:i};this.target.postMessage(a,"*");const s=this.connectResult$.asObservable().pipe((0,cn.switchMap)(u=>u.success?(this.closeWallet(),(0,cn.of)(u.publicKey)):(this.closeWallet(),(0,cn.throwError)(()=>new Error(u.message))))).pipe((0,cn.take)(1)).pipe((0,cn.takeUntil)(this.closeCurrentPromises$)).pipe((0,cn.takeUntil)(this.closeObservables$));return(0,cn.firstValueFrom)(s)}})}sign(e){return tm(this,void 0,void 0,function*(){const r=window.xBullSDK;if(!!r&&this.preferredTarget==="extension"){const{xdr:n}=e,i=iF(e,["xdr"]);return r.signXDR(n,i)}else{if(yield this.openWallet(),!this.target||!this.targetPublicKey)throw new Error("xBull Wallet is not open, we can't connect with it");if(typeof e.xdr!="string")throw new Error("XDR provided needs to be a string value");const{message:n,oneTimeCode:i}=this.encryptForReceiver({data:JSON.stringify(e),receiverPublicKey:(0,Lo.decodeBase64)(this.targetPublicKey)}),a={type:ys.EventType.XBULL_SIGN,message:n,oneTimeCode:i};this.target.postMessage(a,"*");const s=this.signResult$.asObservable().pipe((0,cn.switchMap)(u=>u.success?(this.closeWallet(),(0,cn.of)(u.xdr)):(this.closeWallet(),(0,cn.throwError)(()=>new Error(u.message))))).pipe((0,cn.take)(1)).pipe((0,cn.takeUntil)(this.closeCurrentPromises$)).pipe((0,cn.takeUntil)(this.closeObservables$));return(0,cn.firstValueFrom)(s)}})}closeConnections(){this.closeObservables$.next(),this.closeCurrentPromises$.next(),this.closeObservables$.complete(),this.closeCurrentPromises$.complete()}}Xp=Ud.xBullWalletConnect=aF;class Qi extends Ga{static NAME="xbull";static FRIENDLY_NAME="xBull";static XBullExtension="https://wallet.xbull.app";XBullNetwork;constructor(e){super(e),Ti===Kn.PUBLIC?this.XBullNetwork=Kn.PUBLIC:Ti===Kn.TESTNET?this.XBullNetwork=Kn.TESTNET:this.XBullNetwork=Kn.FUTURENET}async getPublicKey(){const e=new Xp,r=await e.connect();return e.closeConnections(),super.persistWallet(),r}async sign(e){const r=new Xp,n=await r.sign({xdr:e.toXDR(),network:this.XBullNetwork});return r.closeConnections(),n}getFriendlyName(){return Qi.FRIENDLY_NAME}getName(){return Qi.NAME}getSvgIcon(){return V4}getExtension(){return Qi.XBullExtension}isInstalled(){return new Promise(r=>{r(!0)})}}class Gd{createAll(){return[Gi.NAME,Qi.NAME,Xi.NAME,Yi.NAME,Co.NAME].map(this.create)}create(e){let r;const n=new Es;switch(e){case Gi.NAME:r=new Gi(n);break;case Qi.NAME:r=new Qi(n);break;case Xi.NAME:r=new Xi(n);break;case Yi.NAME:r=new Yi(n);break;case Co.NAME:r=new Co(n);break;default:throw new tP}return r}createWalletConnect(e){const r=new Es;return new yi(r,e)}}function sF(t){let e;return{c(){e=Ct("div"),Ve(e,"class","loading-wallet svelte-1iz68ga")},m(r,n){Gt(r,e,n)},p:wr,i:wr,o:wr,d(r){r&&Wt(e)}}}class uF extends yn{constructor(e){super(),hn(this,e,null,sF,ln,{})}}function rm(t){let e,r=(t[1]?"":t[2].INSTALL)+"",n,i,a;return{c(){e=Ct("a"),n=hr(r),Ve(e,"class",i="simple-signer "+(t[1]?"":"install-wallet")+" svelte-1af29be"),Ve(e,"target","_blank"),Ve(e,"href",a=t[0].getExtension())},m(s,u){Gt(s,e,u),nt(e,n)},p(s,u){u&6&&r!==(r=(s[1]?"":s[2].INSTALL)+"")&&br(n,r),u&2&&i!==(i="simple-signer "+(s[1]?"":"install-wallet")+" svelte-1af29be")&&Ve(e,"class",i),u&1&&a!==(a=s[0].getExtension())&&Ve(e,"href",a)},d(s){s&&Wt(e)}}}function cF(t){let e,r,n,i,a,s,u,c=t[0].getFriendlyName()+"",f,l,o,w,p=t[0].getName()!==yi.NAME,d,S,v,O;var h=t[0].getSvgIcon();function g(m){return{}}h&&(a=new h(g()));let A=p&&rm(t);return{c(){e=Ct("div"),r=Ct("div"),n=Ct("div"),i=Ct("div"),a&&Xr(a.$$.fragment),s=pr(),u=Ct("span"),f=hr(c),w=pr(),A&&A.c(),Ve(i,"id","wallet-icon"),Ve(i,"class","simple-signer wallet-logo svelte-1af29be"),Ve(u,"class",l="simple-signer wallet-title "+(t[1]?"":"wallet-title-opacity")+" svelte-1af29be"),Ve(n,"class",o="simple-signer wallet-items "+(t[1]?"":"wallet-opacity")+" svelte-1af29be"),Ve(r,"class",d="simple-signer wallet-items-container "+(t[1]?"shadow":"")+" svelte-1af29be"),Ve(e,"class","simple-signer wallet-container svelte-1af29be")},m(m,x){Gt(m,e,x),nt(e,r),nt(r,n),nt(n,i),a&&Gr(a,i,null),nt(n,s),nt(n,u),nt(u,f),nt(r,w),A&&A.m(r,null),S=!0,v||(O=Cn(r,"click",t[3]),v=!0)},p(m,[x]){if(h!==(h=m[0].getSvgIcon())){if(a){Dn();const y=a;mr(y.$$.fragment,1,0,()=>{Yr(y,1)}),Un()}h?(a=new h(g()),Xr(a.$$.fragment),dr(a.$$.fragment,1),Gr(a,i,null)):a=null}(!S||x&1)&&c!==(c=m[0].getFriendlyName()+"")&&br(f,c),(!S||x&2&&l!==(l="simple-signer wallet-title "+(m[1]?"":"wallet-title-opacity")+" svelte-1af29be"))&&Ve(u,"class",l),(!S||x&2&&o!==(o="simple-signer wallet-items "+(m[1]?"":"wallet-opacity")+" svelte-1af29be"))&&Ve(n,"class",o),x&1&&(p=m[0].getName()!==yi.NAME),p?A?A.p(m,x):(A=rm(m),A.c(),A.m(r,null)):A&&(A.d(1),A=null),(!S||x&2&&d!==(d="simple-signer wallet-items-container "+(m[1]?"shadow":"")+" svelte-1af29be"))&&Ve(r,"class",d)},i(m){S||(a&&dr(a.$$.fragment,m),S=!0)},o(m){a&&mr(a.$$.fragment,m),S=!1},d(m){m&&Wt(e),a&&Yr(a),A&&A.d(),v=!1,O()}}}function lF(t,e,r){let n;Ur(t,go,c=>r(2,n=c));let{wallet:i}=e,{isInstalled:a}=e;const s=nc();async function u(){let c;i.getName()===Co.NAME?c=null:c=(await i.getPublicKey()).toUpperCase(),s("connect",{wallet:i,publicKey:c})}return t.$$set=c=>{"wallet"in c&&r(0,i=c.wallet),"isInstalled"in c&&r(1,a=c.isInstalled)},[i,a,n,u]}class fF extends yn{constructor(e){super(),hn(this,e,lF,cF,ln,{wallet:0,isInstalled:1})}}const nm=Sn(!1),fp=Sn(!1),Ru=Sn(!1),Cu=Sn("");function om(t,e,r){const n=t.slice();return n[22]=e[r],n}function pF(t){let e,r,n=t[1],i=[];for(let s=0;smr(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;s{Yr(Z,1)}),Un()}D?(a=new D(X()),Xr(a.$$.fragment),dr(a.$$.fragment,1),Gr(a,i,null)):a=null}K===(K=ae(J))&&z?z.p(J,Q):(z.d(1),z=K(J),z&&(z.c(),z.m(l,o))),(!k||Q&32)&&p!==(p=J[5].INVALID_KEY+"")&&br(d,p),(!k||Q&8&&S!==(S="simple-signer error-private-key "+(J[3]?"":"hidden")+" svelte-1pv6jos"))&&Ve(w,"class",S);let fe=h;h=F(J),h!==fe&&(Dn(),mr(E[fe],1,1,()=>{E[fe]=null}),Un(),g=E[h],g||(g=E[h]=H[h](J),g.c()),dr(g,1),g.m(O,null)),(!k||Q&32)&&y!==(y=J[5].CANCEL+"")&&br(_,y),(!k||Q&32)&&T!==(T=J[5].CONNECT_WITH_PRIVATE_KEY+"")&&br(I,T)},i(J){k||(a&&dr(a.$$.fragment,J),dr(g),k=!0)},o(J){a&&mr(a.$$.fragment,J),mr(g),k=!1},d(J){J&&Wt(e),a&&Yr(a),z.d(),E[h].d(),N=!1,ri(C)}}}function yF(t){return{c:wr,m:wr,p:wr,i:wr,o:wr,d:wr}}function vF(t){let e,r,n;return e=new fF({props:{wallet:t[22],isInstalled:t[25]}}),e.$on("connect",t[7]),{c(){Xr(e.$$.fragment),r=pr()},m(i,a){Gr(e,i,a),Gt(i,r,a),n=!0},p(i,a){const s={};a&2&&(s.wallet=i[22]),a&2&&(s.isInstalled=i[25]),e.$set(s)},i(i){n||(dr(e.$$.fragment,i),n=!0)},o(i){mr(e.$$.fragment,i),n=!1},d(i){Yr(e,i),i&&Wt(r)}}}function mF(t){let e,r,n;return e=new uF({}),{c(){Xr(e.$$.fragment),r=pr()},m(i,a){Gr(e,i,a),Gt(i,r,a),n=!0},p:wr,i(i){n||(dr(e.$$.fragment,i),n=!0)},o(i){mr(e.$$.fragment,i),n=!1},d(i){Yr(e,i),i&&Wt(r)}}}function im(t){let e,r,n,i={ctx:t,current:null,token:null,hasCatch:!1,pending:mF,then:vF,catch:yF,value:25,blocks:[,,,]};return th(r=t[22].isInstalled(),i),{c(){e=so(),i.block.c()},m(a,s){Gt(a,e,s),i.block.m(a,i.anchor=s),i.mount=()=>e.parentNode,i.anchor=e,n=!0},p(a,s){t=a,i.ctx=t,s&2&&r!==(r=t[22].isInstalled())&&th(r,i)||e2(i,t,s)},i(a){n||(dr(i.block),n=!0)},o(a){for(let s=0;s<3;s+=1){const u=i.blocks[s];mr(u)}n=!1},d(a){a&&Wt(e),i.block.d(a),i.token=null,i=null}}}function gF(t){let e,r,n,i;return{c(){e=Ct("input"),Ve(e,"class",r="simple-signer input-private-key "+(t[3]?"invalid-key":"")+" svelte-1pv6jos"),Ve(e,"id","input-key"),Ve(e,"type","password"),Ve(e,"placeholder","Input key here")},m(a,s){Gt(a,e,s),Ku(e,t[0]),n||(i=Cn(e,"input",t[12]),n=!0)},p(a,s){s&8&&r!==(r="simple-signer input-private-key "+(a[3]?"invalid-key":"")+" svelte-1pv6jos")&&Ve(e,"class",r),s&1&&e.value!==a[0]&&Ku(e,a[0])},d(a){a&&Wt(e),n=!1,i()}}}function bF(t){let e,r,n,i;return{c(){e=Ct("input"),Ve(e,"class",r="simple-signer input-private-key "+(t[3]?"invalid-key":"")+" svelte-1pv6jos"),Ve(e,"id","input-key"),Ve(e,"type","text"),Ve(e,"placeholder","Input key here")},m(a,s){Gt(a,e,s),Ku(e,t[0]),n||(i=Cn(e,"input",t[11]),n=!0)},p(a,s){s&8&&r!==(r="simple-signer input-private-key "+(a[3]?"invalid-key":"")+" svelte-1pv6jos")&&Ve(e,"class",r),s&1&&e.value!==a[0]&&Ku(e,a[0])},d(a){a&&Wt(e),n=!1,i()}}}function _F(t){let e,r;return e=new Z4({}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function wF(t){let e,r;return e=new Q4({}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function SF(t){let e,r,n,i;const a=[hF,dF,pF],s=[];function u(c,f){return c[2]?0:c[1].length?2:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,[f]){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}async function am(t){const e=[];for(let r of t)await r.isInstalled()?e.unshift(r):e.push(r);return e}function EF(t,e,r){let n,i,a,s,u;Ur(t,Cu,L=>r(0,n=L)),Ur(t,fp,L=>r(2,i=L)),Ur(t,Ru,L=>r(3,a=L)),Ur(t,nm,L=>r(4,s=L)),Ur(t,go,L=>r(5,u=L));let{wallets:c}=e,{walletConnectService:f}=e;const l=new Gd,o=nc();function w(){const L=l.createAll(),b=l.createWalletConnect(f);return L.concat(b)}let p,d=[];c.length?(p=eP(c).map(L=>L===yi.NAME?l.createWalletConnect(f):l.create(L)),(async()=>r(1,d=await am(p)))()):(async()=>(p=w(),r(1,d=await am(p))))();async function S(L){const b=l.create(Co.NAME);O(L);const T=await b.getPublicKey(L);h(b,T)}function v(L){const b=L.detail.wallet,T=L.detail.publicKey;b.getName()===Co.NAME?dn(fp,i=!0,i):h(b,T)}function O(L){/^S[A-Za-z0-9]{55}$/.test(L)?dn(Ru,a=!1,a):dn(Ru,a=!0,a)}function h(L,b){o("connect",{wallet:L,publicKey:b})}function g(){dn(fp,i=!i,i),dn(Cu,n="",n)}function A(){n=this.value,Cu.set(n)}function m(){n=this.value,Cu.set(n)}const x=()=>dn(nm,s=!s,s),y=()=>g(),_=()=>S(n);return t.$$set=L=>{"wallets"in L&&r(9,c=L.wallets),"walletConnectService"in L&&r(10,f=L.walletConnectService)},t.$$.update=()=>{t.$$.dirty&1&&(n.length||dn(Ru,a=!1,a))},[n,d,i,a,s,u,S,v,g,c,f,A,m,x,y,_]}class $w extends yn{constructor(e){super(),hn(this,e,EF,SF,ln,{wallets:9,walletConnectService:10})}}const sm=Sn(!0),um=Sn(!1),pp=Sn([]);function cm(t){let e,r;return e=new $w({props:{wallets:t[2],walletConnectService:t[0]}}),e.$on("connect",t[5]),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&4&&(a.wallets=n[2]),i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function lm(t){let e,r;return e=new $w({props:{wallets:t[2],walletConnectService:t[0]}}),e.$on("connect",t[5]),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&4&&(a.wallets=n[2]),i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function OF(t){let e,r,n,i=t[4].SELECT_WALLET+"",a,s,u,c,f=t[3]&&cm(t),l=t[1]&&lm(t);return{c(){e=Ct("div"),r=Ct("div"),n=Ct("span"),a=hr(i),s=pr(),f&&f.c(),u=pr(),l&&l.c(),Ve(n,"class","simple-signer select-wallet svelte-1jy14ob"),Ve(r,"class","simple-signer-wallets svelte-1jy14ob"),Ve(e,"class","simple-signer-container svelte-1jy14ob")},m(o,w){Gt(o,e,w),nt(e,r),nt(r,n),nt(n,a),nt(r,s),f&&f.m(r,null),nt(r,u),l&&l.m(r,null),c=!0},p(o,[w]){(!c||w&16)&&i!==(i=o[4].SELECT_WALLET+"")&&br(a,i),o[3]?f?(f.p(o,w),w&8&&dr(f,1)):(f=cm(o),f.c(),dr(f,1),f.m(r,u)):f&&(Dn(),mr(f,1,1,()=>{f=null}),Un()),o[1]?l?(l.p(o,w),w&2&&dr(l,1)):(l=lm(o),l.c(),dr(l,1),l.m(r,null)):l&&(Dn(),mr(l,1,1,()=>{l=null}),Un())},i(o){c||(dr(f),dr(l),c=!0)},o(o){mr(f),mr(l),c=!1},d(o){o&&Wt(e),f&&f.d(),l&&l.d()}}}const AF=600,TF=340,xF=360,PF=650;function IF(t,e,r){let n,i,a,s;Ur(t,um,w=>r(1,n=w)),Ur(t,pp,w=>r(2,i=w)),Ur(t,sm,w=>r(3,a=w)),Ur(t,go,w=>r(4,s=w));let{walletConnectService:u}=e;const c=window.opener,f=new Md(Wi.CONNECT),l=f.getRedirectFromUrl();dn(pp,i=f.getWalletsFromUrl(),i),c&&!i.length&&f.addAvailableWalletsMessageHandler(w=>{dn(sm,a=!1,a),dn(pp,i=w.wallets,i),dn(um,n=!0,n)});function o(w){const p=w.detail,d=p.publicKey,S=p.wallet;f.sendOnConnectEvent(d,S.getName()),l?window.location.href=`/${l}`:f.closeWindow()}return f.sendOnReadyEvent(),Dd(AF,TF,PF,xF),t.$$set=w=>{"walletConnectService"in w&&r(0,u=w.walletConnectService)},[u,n,i,a,s,o]}class kF extends yn{constructor(e){super(),hn(this,e,IF,OF,ln,{walletConnectService:0})}}const Yd=new kn.exports.Horizon.Server(DS);async function RF(t,e,r){try{const n=await Yd.loadAccount(t);for(const i of n.balances)if(e==="native"&&i.asset_type==="native"||"asset_code"in i&&i.asset_code===e&&i.asset_issuer===r)return!0;return!1}catch(n){throw new Error(JSON.stringify(n))}}async function CF(t,e,r,n,i){const a=n==="native"?kn.exports.Asset.native():new kn.exports.Asset(n,i);try{const s=await Yd.loadAccount(t);return new kn.exports.TransactionBuilder(s,{fee:kn.exports.BASE_FEE,networkPassphrase:J1}).addOperation(kn.exports.Operation.payment({destination:e,asset:a,amount:r})).setTimeout(30).build()}catch(s){throw new Error(JSON.stringify(s))}}function NF(t){let e,r,n,i;const a=[MF,LF],s=[];function u(c,f){return!c[1]||!c[2]||!c[3]||!c[4]||c[7]===c[8].NO_TRUSTLINE?0:1}return r=u(t),n=s[r]=a[r](t),{c(){e=Ct("div"),n.c(),Ve(e,"class","simple-signer tx-data-container svelte-m2lfo9")},m(c,f){Gt(c,e,f),s[r].m(e,null),i=!0},p(c,f){let l=r;r=u(c),r===l?s[r].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),n=s[r],n?n.p(c,f):(n=s[r]=a[r](c),n.c()),dr(n,1),n.m(e,null))},i(c){i||(dr(n),i=!0)},o(c){mr(n),i=!1},d(c){c&&Wt(e),s[r].d()}}}function jF(t){let e,r,n,i,a,s=t[8].CLOSE+"",u,c,f;return{c(){e=Ct("div"),r=Ct("div"),n=hr(t[6]),i=pr(),a=Ct("button"),u=hr(s),Ve(r,"class","simple-signer payment-result-text svelte-m2lfo9"),Ve(a,"class","simple-signer accept-button svelte-m2lfo9"),Ve(e,"class","simple-signer payment-result-message svelte-m2lfo9")},m(l,o){Gt(l,e,o),nt(e,r),nt(r,n),nt(e,i),nt(e,a),nt(a,u),c||(f=Cn(a,"click",t[10]),c=!0)},p(l,o){o&64&&br(n,l[6]),o&256&&s!==(s=l[8].CLOSE+"")&&br(u,s)},i:wr,o:wr,d(l){l&&Wt(e),c=!1,f()}}}function LF(t){let e,r=t[8].PAY+"",n,i,a,s,u,c=t[8].NETWORK+"",f,l,o,w,p,d,S=t[8].YOU_ARE_PAYING+"",v,O,h,g,A,m,x=(t[3]==="native"?"XLM":t[3])+"",y,_,L=t[8].TO_THE_ACCOUNT+"",b,T,I,k,N,C,D,X,ae,K,z,H;const E=[UF,DF],F=[];function J(Q,fe){return Q[0]?0:1}return ae=J(t),K=F[ae]=E[ae](t),{c(){e=Ct("h1"),n=hr(r),i=pr(),a=Ct("div"),s=Ct("div"),u=Ct("p"),f=hr(c),l=hr(":"),o=pr(),w=Ct("p"),w.textContent=`${Ti}`,p=pr(),d=Ct("div"),v=hr(S),O=pr(),h=Ct("strong"),g=hr(t[2]),A=pr(),m=Ct("strong"),y=hr(x),_=pr(),b=hr(L),T=pr(),I=Ct("br"),k=pr(),N=Ct("strong"),C=hr(t[1]),D=hr("."),X=pr(),K.c(),z=so(),Ve(e,"class","simple-signer pay-title svelte-m2lfo9"),Ve(w,"class","simple-signer pay-network-text svelte-m2lfo9"),Ve(s,"class","simple-signer pay-network-container svelte-m2lfo9"),Ve(a,"class","simple-signer tx-network-container svelte-m2lfo9"),Ve(d,"class","simple-signer receiver svelte-m2lfo9")},m(Q,fe){Gt(Q,e,fe),nt(e,n),Gt(Q,i,fe),Gt(Q,a,fe),nt(a,s),nt(s,u),nt(u,f),nt(u,l),nt(s,o),nt(s,w),Gt(Q,p,fe),Gt(Q,d,fe),nt(d,v),nt(d,O),nt(d,h),nt(h,g),nt(d,A),nt(d,m),nt(m,y),nt(d,_),nt(d,b),nt(d,T),nt(d,I),nt(d,k),nt(d,N),nt(N,C),nt(N,D),Gt(Q,X,fe),F[ae].m(Q,fe),Gt(Q,z,fe),H=!0},p(Q,fe){(!H||fe&256)&&r!==(r=Q[8].PAY+"")&&br(n,r),(!H||fe&256)&&c!==(c=Q[8].NETWORK+"")&&br(f,c),(!H||fe&256)&&S!==(S=Q[8].YOU_ARE_PAYING+"")&&br(v,S),(!H||fe&4)&&br(g,Q[2]),(!H||fe&8)&&x!==(x=(Q[3]==="native"?"XLM":Q[3])+"")&&br(y,x),(!H||fe&256)&&L!==(L=Q[8].TO_THE_ACCOUNT+"")&&br(b,L),(!H||fe&2)&&br(C,Q[1]);let Z=ae;ae=J(Q),ae===Z?F[ae].p(Q,fe):(Dn(),mr(F[Z],1,1,()=>{F[Z]=null}),Un(),K=F[ae],K?K.p(Q,fe):(K=F[ae]=E[ae](Q),K.c()),dr(K,1),K.m(z.parentNode,z))},i(Q){H||(dr(K),H=!0)},o(Q){mr(K),H=!1},d(Q){Q&&Wt(e),Q&&Wt(i),Q&&Wt(a),Q&&Wt(p),Q&&Wt(d),Q&&Wt(X),F[ae].d(Q),Q&&Wt(z)}}}function MF(t){let e,r=t[8].ERROR+"",n,i,a,s,u=(t[7]===t[8].NO_TRUSTLINE?t[7]:t[8].ERROR_MISSING_RECEIVER_DATA)+"",c,f,l,o=t[8].CLOSE+"",w,p,d;return{c(){e=Ct("h1"),n=hr(r),i=pr(),a=Ct("div"),s=Ct("p"),c=hr(u),f=pr(),l=Ct("button"),w=hr(o),Ve(e,"class","simple-signer error-title svelte-m2lfo9"),Ve(s,"class","simple-signer"),Ve(l,"class","simple-signer accept-button svelte-m2lfo9"),Ve(a,"class","simple-signer information-container svelte-m2lfo9")},m(S,v){Gt(S,e,v),nt(e,n),Gt(S,i,v),Gt(S,a,v),nt(a,s),nt(s,c),nt(a,f),nt(a,l),nt(l,w),p||(d=Cn(l,"click",t[10]),p=!0)},p(S,v){v&256&&r!==(r=S[8].ERROR+"")&&br(n,r),v&384&&u!==(u=(S[7]===S[8].NO_TRUSTLINE?S[7]:S[8].ERROR_MISSING_RECEIVER_DATA)+"")&&br(c,u),v&256&&o!==(o=S[8].CLOSE+"")&&br(w,o)},i:wr,o:wr,d(S){S&&Wt(e),S&&Wt(i),S&&Wt(a),p=!1,d()}}}function DF(t){let e,r,n=t[8].USER_IS_NOT_CONNECTED+"",i,a,s,u,c;return u=new xa({props:{to:`/connect/?redirect=${t[11]}`,$$slots:{default:[FF]},$$scope:{ctx:t}}}),{c(){e=Ct("div"),r=Ct("p"),i=hr(n),a=pr(),s=Ct("button"),Xr(u.$$.fragment),Ve(r,"class","simple-signer user-not-connected"),Ve(s,"class","simple-signer payment-btn svelte-m2lfo9"),Ve(e,"class","simple-signer information-container svelte-m2lfo9")},m(f,l){Gt(f,e,l),nt(e,r),nt(r,i),nt(e,a),nt(e,s),Gr(u,s,null),c=!0},p(f,l){(!c||l&256)&&n!==(n=f[8].USER_IS_NOT_CONNECTED+"")&&br(i,n);const o={};l&2097408&&(o.$$scope={dirty:l,ctx:f}),u.$set(o)},i(f){c||(dr(u.$$.fragment,f),c=!0)},o(f){mr(u.$$.fragment,f),c=!1},d(f){f&&Wt(e),Yr(u)}}}function UF(t){let e,r,n=t[8].CANCEL+"",i,a,s,u,c;function f(w,p){return w[5]?$F:BF}let l=f(t),o=l(t);return{c(){e=Ct("div"),r=Ct("button"),i=hr(n),a=pr(),s=Ct("button"),o.c(),Ve(r,"class","simple-signer cancel-button svelte-m2lfo9"),r.disabled=t[5],s.disabled=t[5],Ve(s,"class","simple-signer payment-btn svelte-m2lfo9"),Ve(e,"class","simple-signer confirmation-buttons svelte-m2lfo9")},m(w,p){Gt(w,e,p),nt(e,r),nt(r,i),nt(e,a),nt(e,s),o.m(s,null),u||(c=[Cn(r,"click",t[13]),Cn(s,"click",t[9])],u=!0)},p(w,p){p&256&&n!==(n=w[8].CANCEL+"")&&br(i,n),p&32&&(r.disabled=w[5]),l===(l=f(w))&&o?o.p(w,p):(o.d(1),o=l(w),o&&(o.c(),o.m(s,null))),p&32&&(s.disabled=w[5])},i:wr,o:wr,d(w){w&&Wt(e),o.d(),u=!1,ri(c)}}}function FF(t){let e=t[8].GO_TO_CONNECT+"",r;return{c(){r=hr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&256&&e!==(e=n[8].GO_TO_CONNECT+"")&&br(r,e)},d(n){n&&Wt(r)}}}function BF(t){let e=t[8].PAY+"",r;return{c(){r=hr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&256&&e!==(e=n[8].PAY+"")&&br(r,e)},d(n){n&&Wt(r)}}}function $F(t){let e;return{c(){e=Ct("span"),Ve(e,"class","simple-signer spinner svelte-m2lfo9")},m(r,n){Gt(r,e,n)},p:wr,d(r){r&&Wt(e)}}}function VF(t){let e,r,n,i;const a=[jF,NF],s=[];function u(c,f){return c[6]?0:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,[f]){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}const qF=600,zF=340,KF=360,HF=650;function WF(t,e,r){let n;Ur(t,go,_=>r(8,n=_));let{walletConnectService:i}=e;const a=new Es;let s;const u=a.getItem("wallet"),c=new Gd;u&&(u===yi.NAME?s=c.createWalletConnect(i):s=c.create(u));let f="",l="",o="",w="";const p=new Md(Wi.PAYMENT),d=p.getPaymentMessageFromUrl();d?({receiver:f,amount:l,assetCode:o,issuer:w}=d,h()):p.addPaymentMessageHandler(_=>{r(1,{receiver:f,amount:l,assetCode:o,issuer:w}=_,f,r(2,l),r(3,o),r(4,w)),h()});let S=!1,v="",O="";async function h(){await RF(f,o,w)||r(7,O=n.NO_TRUSTLINE)}async function g(){if(S)return;r(5,S=!0);const _=await s.getPublicKey();try{const L=await CF(_,f,l,o,w);await s.sign(L),await Yd.submitTransaction(L),r(6,v=n.SUCCESSFUL_PAYMENT)}catch(L){console.error(L),r(6,v=n.FAILED_PAYMENT)}finally{r(5,S=!1)}}const A=()=>{r(6,v=""),x()},m=encodeURIComponent(`payment?receiver=${f}&amount=${l}&assetCode=${o}&issuer=${w}`);function x(){p.sendOnCancelEvent()}p.sendOnReadyEvent(),Dd(qF,zF,HF,KF);const y=()=>A();return t.$$set=_=>{"walletConnectService"in _&&r(12,i=_.walletConnectService)},[s,f,l,o,w,S,v,O,n,g,A,m,i,y]}class GF extends yn{constructor(e){super(),hn(this,e,WF,VF,ln,{walletConnectService:12})}}function fm(t,e,r){const n=t.slice();return n[2]=e[r],n[4]=r,n}function pm(t){let e,r,n=t[1].SIGNATURES+"",i,a,s,u=t[0],c=[];for(let f=0;f0&&pm(t);return{c(){r&&r.c(),e=so()},m(n,i){r&&r.m(n,i),Gt(n,e,i)},p(n,[i]){n[0].length>0?r?r.p(n,i):(r=pm(n),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:wr,o:wr,d(n){r&&r.d(n),n&&Wt(e)}}}function XF(t,e,r){let n;Ur(t,go,a=>r(1,n=a));let{signatures:i}=e;return t.$$set=a=>{"signatures"in a&&r(0,i=a.signatures)},[i,n]}class QF extends yn{constructor(e){super(),hn(this,e,XF,YF,ln,{signatures:0})}}class Vw extends Error{operationsLength;lastGroupOperation;constructor(e,r){super(),this.operationsLength=e,this.lastGroupOperation=r+1,this.message=`There are fewer operations than the groups says. (${this.operationsLength}) operations | (${this.lastGroupOperation}) operations on the groups`}}class qw extends Error{positions;constructor(e){super(),this.positions=e,this.message=`The groups aren't sorted sequentially [${this.positions}]`}}class JF extends Error{}class sn{props;constructor(e){this.props=e}}class ZF extends sn{constructor(e,r){super({title:"OPERATION_ACCOUNT_MERGE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"DESTINATION",value:r.destination}]})}}class eB extends sn{constructor(e,r){let n;r.authorize===2?n="AUTHORIZED_TO_MAINTAIN_ORDERS":r.authorize?n="AUTHORIZED_TO_TRANSACT":n="NOT_AUTHORIZED_TO_TRANSACT",super({title:r.authorize?"ALLOW_TRUST":"DISALLOW_TRUST",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET",value:r.assetCode},{title:"AUTHORIZATION",value:"",translatedValue:n}]})}}class tB extends sn{constructor(e,r){super({title:"OPERATION_BEGIN_SPONSORING_FUTURE_RESERVES",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SPONSORED_ID",value:r.sponsoredId}]})}}class rB extends sn{constructor(e,r){super({title:"OPERATION_BUMP_SEQUENCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BUMP_TO",value:r.bumpTo}]})}}class nB extends sn{constructor(e,r){let n;r.line instanceof kn.exports.Asset?n=[{title:"ASSET",value:r.line.code}]:n=[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET_A",value:r.line.assetA.code},{title:"ASSET_B",value:r.line.assetB.code}],n.unshift({title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"}),n.push({title:"LIMIT",value:r.limit}),super({title:"OPERATION_CHANGE_TRUST",operationItems:n})}}class oB extends sn{constructor(e,r){super({title:"OPERATION_CLAIM_CLAIMABLE_BALANCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BALANCE_ID",value:r.balanceId}]})}}class iB extends sn{constructor(e,r){super({title:"OPERATION_CLAWBACK",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET",value:r.asset.code},{title:"AMOUNT",value:r.amount},{title:"FROM",value:r.from}]})}}class aB extends sn{constructor(e,r){super({title:"OPERATION_CLAIM_CLAIMABLE_BALANCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BALANCE_ID",value:r.balanceId}]})}}class sB extends sn{constructor(e,r){super({title:"OPERATION_CREATE_ACCOUNT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"DESTINATION",value:r.destination},{title:"STARTING_BALANCE",value:r.startingBalance}]})}}class uB extends sn{constructor(e,r){const n=r.claimants.map(i=>i.destination);super({title:"OPERATION_CREATE_CLAIMABLE_BALANCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"AMOUNT",value:r.amount},{title:"ASSET",value:r.asset.code},{title:"CLAIMANTS",value:n}]})}}class cB extends sn{constructor(e,r){super({title:"OPERATION_CREATE_PASSIVE_SELL_OFFER",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLING",value:r.selling.code},{title:"BUYING",value:r.buying.code},{title:"AMOUNT",value:r.amount},{title:"PRICE",value:r.price}]})}}class lB extends sn{constructor(e,r){super({title:"OPERATION_END_SPONSORING_FUTURE_RESERVES",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"}]})}}class fB extends sn{constructor(e,r){super({title:"OPERATION_EXTEND_FOOTPRINT_TTL",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"EXTEND_TO",value:r.extendTo}]})}}var Vu=(t=>(t.UploadWasm="Upload Contract WASM",t.InvokeContract="Invoke Contract",t.CreateContract="Create Contract",t))(Vu||{});class pB extends sn{constructor(e,r){const n=r.func.value();let i=Vu.UploadWasm;n instanceof kn.exports.xdr.InvokeContractArgs&&(i=Vu.InvokeContract),n instanceof kn.exports.xdr.CreateContractArgs&&(i=Vu.CreateContract),super({title:"OPERATION_INVOKE_HOST_FUNCTION",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"FUNCTION_TYPE",value:i}]})}}class dB extends sn{constructor(e,r){super({title:"OPERATION_LIQUIDITY_POOL_DEPOSIT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"LIQUIDITY_POOL_ID",value:r.liquidityPoolId},{title:"MAX_AMOUNT_A",value:r.maxAmountA},{title:"MAX_AMOUNT_B",value:r.maxAmountB},{title:"MINIMUM_PRICE",value:r.minPrice},{title:"MAXIMUM_PRICE",value:r.maxPrice}]})}}class hB extends sn{constructor(e,r){super({title:"OPERATION_LIQUIDITY_POOL_WITHDRAW",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"LIQUIDITY_POOL_ID",value:r.liquidityPoolId},{title:"AMOUNT",value:r.amount},{title:"MIN_AMOUNT_A",value:r.minAmountA},{title:"MIN_AMOUNT_B",value:r.minAmountB}]})}}class yB extends sn{constructor(e,r){super({title:"OPERATION_MANAGE_BUY_OFFER",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLING_ASSET",value:r.selling.code},{title:"BUYING_ASSET",value:r.buying.code},{title:"BUY_AMOUNT",value:r.buyAmount},{title:"PRICE",value:r.price},{title:"OFFER_ID",value:r.offerId}]})}}class vB extends sn{constructor(e,r){super({title:"OPERATION_MANAGE_DATA",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"NAME",value:r.name},r.value?{title:"DATA",value:r.value}:void 0]})}}class mB extends sn{constructor(e,r){super({title:"OPERATION_MANAGE_SELL_OFFER",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLING_ASSET",value:r.selling.code},{title:"BUYING_ASSET",value:r.buying.code},{title:"AMOUNT",value:r.amount},{title:"PRICE",value:r.price},{title:"OFFER_ID",value:r.offerId}]})}}class gB extends sn{constructor(e,r){const n=r.path.map(i=>i.code);super({title:"OPERATION_PATH_PAYMENT_STRICT_RECEIVE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET_TO_PAY",value:r.sendAsset.code},{title:"MAX_AMOUNT",value:r.sendMax},{title:"DESTINATION",value:r.destination},{title:"DESTINATION_ASSET",value:r.destAsset.code},{title:"AMOUNT",value:r.destAmount},{title:"PATH",value:n}]})}}class bB extends sn{constructor(e,r){const n=r.path.map(i=>i.code);super({title:"OPERATION_PATH_PAYMENT_STRICT_RECEIVE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET_TO_PAY",value:r.sendAsset.code},{title:"AMOUNT",value:r.sendAmount},{title:"DESTINATION",value:r.destination},{title:"DESTINATION_ASSET",value:r.destAsset.code},{title:"MINIMUM_AMOUNT_DESTINATION_ASSET",value:r.destMin},{title:"PATH",value:n}]})}}class _B extends sn{constructor(e,r){super({title:"OPERATION_PAYMENT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"AMOUNT",value:r.amount},{title:"ASSET",value:r.asset.code},{title:"DESTINATION",value:r.destination}]})}}class wB extends sn{constructor(e,r){super({title:"OPERATION_RESTORE_FOOTPRINT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"}]})}}class SB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_ACCOUNT_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account}]})}}class EB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_CLAIMABLE_BALANCE_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BALANCE_ID",value:r.balanceId}]})}}class OB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_DATA_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account},{title:"NAME",value:r.name}]})}}class AB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_LIQUIDITY_POOL_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"LIQUIDITY_POOL_ID",value:r.liquidityPoolId}]})}}class TB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_OFFER_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLER",value:r.seller},{title:"OFFER_ID",value:r.offerId}]})}}class xB extends Error{}function PB(t){if("ed25519PublicKey"in t)return t.ed25519PublicKey;if("sha256Hash"in t)return typeof t.sha256Hash=="string"?t.sha256Hash:kn.exports.StrKey.encodeSha256Hash(t.sha256Hash);if("preAuthTx"in t)return typeof t.preAuthTx=="string"?t.preAuthTx:kn.exports.StrKey.encodePreAuthTx(t.preAuthTx);throw new xB}class IB extends sn{constructor(e,r){const n=PB(r.signer);super({title:"OPERATION_REVOKE_SIGNER_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account},{title:"SIGNER",value:n}]})}}class kB extends sn{constructor(e,r){let n;r.asset instanceof kn.exports.Asset?n=r.asset.code:n=r.asset,super({title:"OPERATION_REVOKE_TRUSTLINE_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account},{title:"ASSET",value:n}]})}}function RB(t){if(t.signer)return"ed25519PublicKey"in t.signer?[t.signer.ed25519PublicKey,t.signer.weight?"1":"0"]:"sha256Hash"in t.signer?[`sha256Hash: ${kn.exports.StrKey.encodeSha256Hash(t.signer.sha256Hash)}`,t.signer.weight?"1":"0"]:"preAuthTx"in t.signer?[`preAuthTx: ${kn.exports.StrKey.encodePreAuthTx(t.signer.preAuthTx)}`,t.signer.weight?"1":"0"]:void 0}class CB extends sn{constructor(e,r){const n=RB(r);super({title:"OPERATION_SET_OPTIONS",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},r.inflationDest?{title:"DESTINATION_INFLATION",value:r.inflationDest}:void 0,r.clearFlags?{title:"CLEAR_FLAGS",value:r.clearFlags}:void 0,r.setFlags?{title:"SET_FLAGS",value:r.setFlags}:void 0,r.masterWeight?{title:"MASTER_WEIGHT",value:r.masterWeight}:void 0,r.lowThreshold?{title:"LOW_THRESHOLD",value:r.lowThreshold}:void 0,r.medThreshold?{title:"MEDIUM_THRESHOLD",value:r.medThreshold}:void 0,r.highThreshold?{title:"HIGH_THRESHOLD",value:r.highThreshold}:void 0,r.homeDomain?{title:"HOME_DOMAIN",value:r.homeDomain}:void 0,n?{title:"SIGNER",value:n,highlightTxDescription:"WARNING_TX_DESCRIPTION"}:void 0]})}}class NB extends sn{constructor(e,r){super({title:"OPERATION_SET_TRUSTLINE_FLAGS",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"TRUSTOR",value:r.trustor},{title:"ASSET",value:r.asset.code},{title:"IS_AUTHORIZED",value:r.flags.authorized?"True":"False"},{title:"IS_AUTHORIZED_TO_MAINTAIN_LIABILITIES",value:r.flags.authorizedToMaintainLiabilities?"True":"False"},{title:"IS_CLAWBACK_ENABLED",value:r.flags.clawbackEnabled?"True":"False"}]})}}class jB{create(e,r){let n;switch(r.type){case"payment":n=new _B(e,r);break;case"createAccount":n=new sB(e,r);break;case"beginSponsoringFutureReserves":n=new tB(e,r);break;case"pathPaymentStrictSend":n=new bB(e,r);break;case"pathPaymentStrictReceive":n=new gB(e,r);break;case"manageBuyOffer":n=new yB(e,r);break;case"manageSellOffer":n=new mB(e,r);break;case"createPassiveSellOffer":n=new cB(e,r);break;case"setOptions":n=new CB(e,r);break;case"changeTrust":n=new nB(e,r);break;case"accountMerge":n=new ZF(e,r);break;case"manageData":n=new vB(e,r);break;case"bumpSequence":n=new rB(e,r);break;case"createClaimableBalance":n=new uB(e,r);break;case"endSponsoringFutureReserves":n=new lB(e,r);break;case"revokeAccountSponsorship":n=new SB(e,r);break;case"revokeClaimableBalanceSponsorship":n=new EB(e,r);break;case"revokeDataSponsorship":n=new OB(e,r);break;case"revokeLiquidityPoolSponsorship":n=new AB(e,r);break;case"revokeOfferSponsorship":n=new TB(e,r);break;case"revokeSignerSponsorship":n=new IB(e,r);break;case"allowTrust":n=new eB(e,r);break;case"claimClaimableBalance":n=new oB(e,r);break;case"clawback":n=new iB(e,r);break;case"setTrustLineFlags":n=new NB(e,r);break;case"liquidityPoolDeposit":n=new dB(e,r);break;case"liquidityPoolWithdraw":n=new hB(e,r);break;case"revokeTrustlineSponsorship":n=new kB(e,r);break;case"clawbackClaimableBalance":n=new aB(e,r);break;case"invokeHostFunction":n=new pB(e,r);break;case"restoreFootprint":n=new wB(e,r);break;case"extendFootprintTtl":n=new fB(e,r);break}if(n)return n;throw new JF}}const Nu=Sn(!1),ws=Sn(!1),hm=Sn(!1),ju=Sn([]);function ym(t,e,r){const n=t.slice();return n[5]=e[r],n[7]=r,n}function vm(t,e,r){const n=t.slice();return n[8]=e[r],n}function mm(t){let e,r,n=t[3][t[5].title]+"",i,a,s,u,c;function f(p,d){return d&1&&(s=null),s==null&&(s=!!Array.isArray(p[5].value)),s?MB:LB}let l=f(t,-1),o=l(t),w=t[5].highlightTxDescription!=null&&bm(t);return{c(){e=Ct("div"),r=Ct("p"),i=hr(n),a=pr(),o.c(),u=pr(),w&&w.c(),c=pr(),Ve(r,"class","simple-signer operation-info-title"),Ve(e,"class","simple-signer operation-info")},m(p,d){Gt(p,e,d),nt(e,r),nt(r,i),nt(e,a),o.m(e,null),nt(e,u),w&&w.m(e,null),nt(e,c)},p(p,d){d&9&&n!==(n=p[3][p[5].title]+"")&&br(i,n),l===(l=f(p,d))&&o?o.p(p,d):(o.d(1),o=l(p),o&&(o.c(),o.m(e,u))),p[5].highlightTxDescription!=null?w?w.p(p,d):(w=bm(p),w.c(),w.m(e,c)):w&&(w.d(1),w=null)},d(p){p&&Wt(e),o.d(),w&&w.d()}}}function LB(t){let e,r=(t[5].translatedValue?t[3][t[5].translatedValue]:t[5].value)+"",n,i,a,s=t[7]===wm&&DB(t);return{c(){e=Ct("p"),n=hr(r),i=pr(),s&&s.c(),a=so(),Ve(e,"class","simple-signer break-key svelte-ve2qp2")},m(u,c){Gt(u,e,c),nt(e,n),Gt(u,i,c),s&&s.m(u,c),Gt(u,a,c)},p(u,c){c&9&&r!==(r=(u[5].translatedValue?u[3][u[5].translatedValue]:u[5].value)+"")&&br(n,r),u[7]===wm&&s.p(u,c)},d(u){u&&Wt(e),u&&Wt(i),s&&s.d(u),u&&Wt(a)}}}function MB(t){let e,r=t[5].value,n=[];for(let i=0;ir(2,n=c)),Ur(t,go,c=>r(3,i=c));let{operationItems:a}=e,{shortedSourceAccount:s}=e;function u(){dn(ws,n=!n,n)}return t.$$set=c=>{"operationItems"in c&&r(0,a=c.operationItems),"shortedSourceAccount"in c&&r(1,s=c.shortedSourceAccount)},[a,s,n,i,u]}class zw extends yn{constructor(e){super(),hn(this,e,FB,UB,ln,{operationItems:0,shortedSourceAccount:1})}}function Sm(t,e,r){const n=t.slice();return n[4]=e[r],n}function Em(t){let e,r,n,i=t[3][t[4].props.title]+"",a,s,u,c;return u=new zw({props:{shortedSourceAccount:t[2],operationItems:t[4].props.operationItems}}),{c(){e=Ct("ul"),r=Ct("li"),n=Ct("span"),a=hr(i),s=pr(),Xr(u.$$.fragment),Ve(n,"class","simple-signer operation-title-head operation-info-title svelte-1nq74ua"),Ve(r,"class","svelte-1nq74ua"),Ve(e,"class","svelte-1nq74ua")},m(f,l){Gt(f,e,l),nt(e,r),nt(r,n),nt(n,a),Gt(f,s,l),Gr(u,f,l),c=!0},p(f,l){(!c||l&10)&&i!==(i=f[3][f[4].props.title]+"")&&br(a,i);const o={};l&4&&(o.shortedSourceAccount=f[2]),l&2&&(o.operationItems=f[4].props.operationItems),u.$set(o)},i(f){c||(dr(u.$$.fragment,f),c=!0)},o(f){mr(u.$$.fragment,f),c=!1},d(f){f&&Wt(e),f&&Wt(s),Yr(u,f)}}}function BB(t){let e,r,n,i,a,s,u=t[1],c=[];for(let l=0;lmr(c[l],1,1,()=>{c[l]=null});return{c(){e=Ct("div"),r=Ct("div"),n=Ct("p"),i=hr(t[0]),a=pr();for(let l=0;lr(3,n=u));let{description:i}=e,{operationComponents:a}=e,{shortedSourceAccount:s}=e;return t.$$set=u=>{"description"in u&&r(0,i=u.description),"operationComponents"in u&&r(1,a=u.operationComponents),"shortedSourceAccount"in u&&r(2,s=u.shortedSourceAccount)},[i,a,s,n]}class VB extends yn{constructor(e){super(),hn(this,e,$B,BB,ln,{description:0,operationComponents:1,shortedSourceAccount:2})}}function qB(t,e){const r=e.map(a=>[...new Array(a.to-a.from+1).keys()].map(s=>a.from+s)).flat();if([...r].sort((a,s)=>a-s).join()!==r.join())throw new qw(r.join());const n=e[e.length-1],i=[];if(n&&!t[n.to])throw new Vw(t.length,n.to);{let a=0;for(let s=0;s=e[s].from&&fe===!0)}function HB(t){return t.every(e=>e===!1)}function Om(t,e,r){const n=t.slice();return n[26]=e[r],n[28]=r,n}function WB(t){let e,r=t[11].ERROR+"",n,i,a,s,u=t[11].XDR_INVALID+"",c,f,l,o,w=t[11].CLOSE+"",p,d,S;return{c(){e=Ct("h1"),n=hr(r),i=pr(),a=Ct("div"),s=Ct("p"),c=hr(u),f=pr(),l=Ct("div"),o=Ct("button"),p=hr(w),Ve(e,"class","simple-signer error-title svelte-baj9kn"),Ve(s,"class","simple-signer xdr-invalid svelte-baj9kn"),Ve(o,"class","simple-signer sign-tx-button svelte-baj9kn"),Ve(l,"class","simple-signer close-button svelte-baj9kn"),Ve(a,"class","simple-signer information-container svelte-baj9kn")},m(v,O){Gt(v,e,O),nt(e,n),Gt(v,i,O),Gt(v,a,O),nt(a,s),nt(s,c),nt(a,f),nt(a,l),nt(l,o),nt(o,p),d||(S=Cn(o,"click",t[20]),d=!0)},p(v,O){O&2048&&r!==(r=v[11].ERROR+"")&&br(n,r),O&2048&&u!==(u=v[11].XDR_INVALID+"")&&br(c,u),O&2048&&w!==(w=v[11].CLOSE+"")&&br(p,w)},i:wr,o:wr,d(v){v&&Wt(e),v&&Wt(i),v&&Wt(a),d=!1,S()}}}function GB(t){let e,r=t[11].SIGN+"",n,i,a,s,u,c,f,l,o=t[3]&&Am(t),w=t[0].description&&Tm(t);const p=[XB,YB],d=[];function S(v,O){return v[2]?0:1}return u=S(t),c=d[u]=p[u](t),{c(){e=Ct("h1"),n=hr(r),i=pr(),o&&o.c(),a=pr(),w&&w.c(),s=pr(),c.c(),f=so(),Ve(e,"class","simple-signer tx-title svelte-baj9kn")},m(v,O){Gt(v,e,O),nt(e,n),Gt(v,i,O),o&&o.m(v,O),Gt(v,a,O),w&&w.m(v,O),Gt(v,s,O),d[u].m(v,O),Gt(v,f,O),l=!0},p(v,O){(!l||O&2048)&&r!==(r=v[11].SIGN+"")&&br(n,r),v[3]?o?o.p(v,O):(o=Am(v),o.c(),o.m(a.parentNode,a)):o&&(o.d(1),o=null),v[0].description?w?w.p(v,O):(w=Tm(v),w.c(),w.m(s.parentNode,s)):w&&(w.d(1),w=null);let h=u;u=S(v),u===h?d[u].p(v,O):(Dn(),mr(d[h],1,1,()=>{d[h]=null}),Un(),c=d[u],c?c.p(v,O):(c=d[u]=p[u](v),c.c()),dr(c,1),c.m(f.parentNode,f))},i(v){l||(dr(c),l=!0)},o(v){mr(c),l=!1},d(v){v&&Wt(e),v&&Wt(i),o&&o.d(v),v&&Wt(a),w&&w.d(v),v&&Wt(s),d[u].d(v),v&&Wt(f)}}}function Am(t){let e,r=t[11].FEE_BUMP+"",n;return{c(){e=Ct("h2"),n=hr(r),Ve(e,"class","simple-signer tx-title svelte-baj9kn")},m(i,a){Gt(i,e,a),nt(e,n)},p(i,a){a&2048&&r!==(r=i[11].FEE_BUMP+"")&&br(n,r)},d(i){i&&Wt(e)}}}function Tm(t){let e,r,n=t[0].description+"",i;return{c(){e=Ct("div"),r=Ct("p"),i=hr(n),Ve(r,"class","simple-signer tx-description-text svelte-baj9kn"),Ve(e,"class","simple-signer tx-description-container")},m(a,s){Gt(a,e,s),nt(e,r),nt(r,i)},p(a,s){s&1&&n!==(n=a[0].description+"")&&br(i,n)},d(a){a&&Wt(e)}}}function YB(t){let e,r=t[11].USER_IS_NOT_CONNECTED+"",n,i,a,s,u;return s=new xa({props:{to:"/connect",$$slots:{default:[QB]},$$scope:{ctx:t}}}),{c(){e=Ct("p"),n=hr(r),i=pr(),a=Ct("button"),Xr(s.$$.fragment),Ve(e,"class","simple-signer user-not-connected svelte-baj9kn"),Ve(a,"class","simple-signer connect-btn")},m(c,f){Gt(c,e,f),nt(e,n),Gt(c,i,f),Gt(c,a,f),Gr(s,a,null),u=!0},p(c,f){(!u||f&2048)&&r!==(r=c[11].USER_IS_NOT_CONNECTED+"")&&br(n,r);const l={};f&536872960&&(l.$$scope={dirty:f,ctx:c}),s.$set(l)},i(c){u||(dr(s.$$.fragment,c),u=!0)},o(c){mr(s.$$.fragment,c),u=!1},d(c){c&&Wt(e),c&&Wt(i),c&&Wt(a),Yr(s)}}}function XB(t){let e,r,n,i,a=t[11].NETWORK+"",s,u,c,f,l,o,w,p,d=t[11].SEQUENCE_NUMBER+"",S,v,O=(t[4]?t[4].sequence:"")+"",h,g,A,m,x=t[11].SOURCE_ACCOUNT+"",y,_,L,b=(t[10]?t[4].source:t[7])+"",T,I,k,N,C,D,X,ae,K,z=t[11].OPERATIONS_LIST+"",H,E,F,J,Q=(t[9]?t[11].HIDE_ALL:t[11].EXPAND_ALL)+"",fe,Z,pe,ge,j,te,ye,_e,Ye,Ke=t[11].NETWORK_FEE+"",Me,Ue,Ce,Ne=km(t[3]?t[3].fee:t[4].fee)+"",ze,yt,Qe,R,q,M,ee=t[11].CANCEL+"",ce,P,B,G=t[11].CONFIRM+"",U,Y,oe,ve,Ie=t[3]&&xm(t);k=new QF({props:{signatures:t[4].signatures}});let vt=t[6],wt=[];for(let Lt=0;Ltmr(wt[Lt],1,1,()=>{wt[Lt]=null});let jt=t[4].memo.value&&Im(t);return{c(){e=Ct("div"),Ie&&Ie.c(),r=pr(),n=Ct("div"),i=Ct("p"),s=hr(a),u=hr(":"),c=hr(` + `):"",this.name="UnsubscriptionError",this.errors=r}});var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.arrRemove=void 0;function qP(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}Fo.arrRemove=qP;var By=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$y=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Vy=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(u=s.next()).done;)c.push(u.value)}catch(l){f={error:l}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(f)throw f.error}}return c},r=Et&&Et.__spreadArray||function(n,i){for(var a=0,s=i.length,u=n.length;a0)&&!(c=u.next()).done;)f.push(c.value)}catch(o){l={error:o}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(l)throw l.error}}return f},r=Et&&Et.__spreadArray||function(i,a){for(var s=0,u=a.length,c=i.length;s=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.AnonymousSubject=Fn.Subject=void 0;var Wy=bn,zp=Vn,C8=Vs,N8=Fo,np=Pi,pw=function(t){fw(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new Kp(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new C8.ObjectUnsubscribedError},e.prototype.next=function(r){var n=this;np.errorContext(function(){var i,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=R8(n.currentObservers),u=s.next();!u.done;u=s.next()){var c=u.value;c.next(r)}}catch(f){i={error:f}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}}})},e.prototype.error=function(r){var n=this;np.errorContext(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},e.prototype.complete=function(){var r=this;np.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,i=this,a=i.hasError,s=i.isStopped,u=i.observers;return a||s?zp.EMPTY_SUBSCRIPTION:(this.currentObservers=null,u.push(r),new zp.Subscription(function(){n.currentObservers=null,N8.arrRemove(u,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,a=n.thrownError,s=n.isStopped;i?r.error(a):s&&r.complete()},e.prototype.asObservable=function(){var r=new Wy.Observable;return r.source=this,r},e.create=function(r,n){return new Kp(r,n)},e}(Wy.Observable);Fn.Subject=pw;var Kp=function(t){fw(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},e.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:zp.EMPTY_SUBSCRIPTION},e}(pw);Fn.AnonymousSubject=Kp;var qs={},j8=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(qs,"__esModule",{value:!0});qs.BehaviorSubject=void 0;var L8=Fn,M8=function(t){j8(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(L8.Subject);qs.BehaviorSubject=M8;var Xa={},kc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.dateTimestampProvider=void 0,t.dateTimestampProvider={now:function(){return(t.dateTimestampProvider.delegate||Date).now()},delegate:void 0}})(kc);var D8=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ReplaySubject=void 0;var U8=Fn,F8=kc,B8=function(t){D8(e,t);function e(r,n,i){r===void 0&&(r=1/0),n===void 0&&(n=1/0),i===void 0&&(i=F8.dateTimestampProvider);var a=t.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return e.prototype.next=function(r){var n=this,i=n.isStopped,a=n._buffer,s=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;i||(a.push(r),!s&&a.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),i=this,a=i._infiniteTimeWindow,s=i._buffer,u=s.slice(),c=0;c0)&&!(u=s.next()).done;)c.push(u.value)}catch(l){f={error:l}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(f)throw f.error}}return c},r=Et&&Et.__spreadArray||function(n,i){for(var a=0,s=i.length,u=n.length;a0)&&!(l=f.next()).done;)o.push(l.value)}catch(p){w={error:p}}finally{try{l&&!l.done&&(c=f.return)&&c.call(f)}finally{if(w)throw w.error}}return o},r=Et&&Et.__spreadArray||function(s,u){for(var c=0,f=u.length,l=s.length;c0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=Xy.immediateProvider.setImmediate(r.flush.bind(r,void 0))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.some(function(a){return a.id===n})||(Xy.immediateProvider.clearImmediate(n),r._scheduled=void 0)},e}(Z8.AsyncAction);Rc.AsapAction=eI;var Nc={},Mi={},zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.Scheduler=void 0;var tI=kc,rI=function(){function t(e,r){r===void 0&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,e).schedule(n,r)},t.now=tI.dateTimestampProvider.now,t}();zs.Scheduler=rI;var nI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mi,"__esModule",{value:!0});Mi.AsyncScheduler=void 0;var Qy=zs,oI=function(t){nI(e,t);function e(r,n){n===void 0&&(n=Qy.Scheduler.now);var i=t.call(this,r,n)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return e.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Qy.Scheduler);Mi.AsyncScheduler=oI;var iI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Nc,"__esModule",{value:!0});Nc.AsapScheduler=void 0;var aI=Mi,sI=function(t){iI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(aI.AsyncScheduler);Nc.AsapScheduler=sI;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.asap=t.asapScheduler=void 0;var e=Rc,r=Nc;t.asapScheduler=new r.AsapScheduler(e.AsapAction),t.asap=t.asapScheduler})(dw);var _o={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.async=t.asyncScheduler=void 0;var e=Li,r=Mi;t.asyncScheduler=new r.AsyncScheduler(e.AsyncAction),t.async=t.asyncScheduler})(_o);var vw={},jc={},uI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(jc,"__esModule",{value:!0});jc.QueueAction=void 0;var cI=Li,lI=function(t){uI(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(cI.AsyncAction);jc.QueueAction=lI;var Lc={},fI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Lc,"__esModule",{value:!0});Lc.QueueScheduler=void 0;var pI=Mi,dI=function(t){fI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(pI.AsyncScheduler);Lc.QueueScheduler=dI;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.queue=t.queueScheduler=void 0;var e=jc,r=Lc;t.queueScheduler=new r.QueueScheduler(e.QueueAction),t.queue=t.queueScheduler})(vw);var mw={},Mc={},hI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Mc,"__esModule",{value:!0});Mc.AnimationFrameAction=void 0;var yI=Li,Jy=zd,vI=function(t){hI(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r._scheduled||(r._scheduled=Jy.animationFrameProvider.requestAnimationFrame(function(){return r.flush(void 0)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.some(function(a){return a.id===n})||(Jy.animationFrameProvider.cancelAnimationFrame(n),r._scheduled=void 0)},e}(yI.AsyncAction);Mc.AnimationFrameAction=vI;var Dc={},mI=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Dc,"__esModule",{value:!0});Dc.AnimationFrameScheduler=void 0;var gI=Mi,bI=function(t){mI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var i=this.actions,a;r=r||i.shift();do if(a=r.execute(r.state,r.delay))break;while((r=i[0])&&r.id===n&&i.shift());if(this._active=!1,a){for(;(r=i[0])&&r.id===n&&i.shift();)r.unsubscribe();throw a}},e}(gI.AsyncScheduler);Dc.AnimationFrameScheduler=bI;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrame=t.animationFrameScheduler=void 0;var e=Mc,r=Dc;t.animationFrameScheduler=new r.AnimationFrameScheduler(e.AnimationFrameAction),t.animationFrame=t.animationFrameScheduler})(mw);var Ba={},gw=Et&&Et.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(Ba,"__esModule",{value:!0});Ba.VirtualAction=Ba.VirtualTimeScheduler=void 0;var _I=Li,wI=Vn,SI=Mi,EI=function(t){gw(e,t);function e(r,n){r===void 0&&(r=bw),n===void 0&&(n=1/0);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,a,s;(s=n[0])&&s.delay<=i&&(n.shift(),this.frame=s.delay,!(a=s.execute(s.state,s.delay))););if(a){for(;s=n.shift();)s.unsubscribe();throw a}},e.frameTimeFactor=10,e}(SI.AsyncScheduler);Ba.VirtualTimeScheduler=EI;var bw=function(t){gw(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var a=t.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.index=i,a.active=!0,a.index=r.index=i,a}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),Number.isFinite(n)){if(!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}else return wI.Subscription.EMPTY},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var a=r.actions;return a.push(this),a.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(_I.AsyncAction);Ba.VirtualAction=bw;var Uc={},No={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.empty=t.EMPTY=void 0;var e=bn;t.EMPTY=new e.Observable(function(i){return i.complete()});function r(i){return i?n(i):t.EMPTY}t.empty=r;function n(i){return new e.Observable(function(a){return i.schedule(function(){return a.complete()})})}})(No);var Ja={},qn={},fa={};Object.defineProperty(fa,"__esModule",{value:!0});fa.isScheduler=void 0;var OI=fn;function AI(t){return t&&OI.isFunction(t.schedule)}fa.isScheduler=AI;Object.defineProperty(qn,"__esModule",{value:!0});qn.popNumber=qn.popScheduler=qn.popResultSelector=void 0;var TI=fn,xI=fa;function Kd(t){return t[t.length-1]}function PI(t){return TI.isFunction(Kd(t))?t.pop():void 0}qn.popResultSelector=PI;function II(t){return xI.isScheduler(Kd(t))?t.pop():void 0}qn.popScheduler=II;function kI(t,e){return typeof Kd(t)=="number"?t.pop():e}qn.popNumber=kI;var Oo={},Ks={},Fc={},Mr={},Za={};Object.defineProperty(Za,"__esModule",{value:!0});Za.isArrayLike=void 0;Za.isArrayLike=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.isPromise=void 0;var RI=fn;function CI(t){return RI.isFunction(t?.then)}Hs.isPromise=CI;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.isInteropObservable=void 0;var NI=ca,jI=fn;function LI(t){return jI.isFunction(t[NI.observable])}Ws.isInteropObservable=LI;var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.isAsyncIterable=void 0;var MI=fn;function DI(t){return Symbol.asyncIterator&&MI.isFunction(t?.[Symbol.asyncIterator])}Gs.isAsyncIterable=DI;var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.createInvalidObservableTypeError=void 0;function UI(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}Ys.createInvalidObservableTypeError=UI;var Xs={},ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.iterator=ta.getSymbolIterator=void 0;function _w(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}ta.getSymbolIterator=_w;ta.iterator=_w();Object.defineProperty(Xs,"__esModule",{value:!0});Xs.isIterable=void 0;var FI=ta,BI=fn;function $I(t){return BI.isFunction(t?.[FI.iterator])}Xs.isIterable=$I;var Ii={},VI=Et&&Et.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]1||u(w,p)})})}function u(w,p){try{c(n[w](p))}catch(d){o(a[0][3],d)}}function c(w){w.value instanceof ka?Promise.resolve(w.value.v).then(f,l):o(a[0][2],w)}function f(w){u("next",w)}function l(w){u("throw",w)}function o(w,p){w(p),a.shift(),a.length&&u(a[0][0],a[0][1])}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.isReadableStreamLike=Ii.readableStreamLikeToAsyncGenerator=void 0;var zI=fn;function KI(t){return qI(this,arguments,function(){var r,n,i,a;return VI(this,function(s){switch(s.label){case 0:r=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,ka(r.read())];case 3:return n=s.sent(),i=n.value,a=n.done,a?[4,ka(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,ka(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}Ii.readableStreamLikeToAsyncGenerator=KI;function HI(t){return zI.isFunction(t?.getReader)}Ii.isReadableStreamLike=HI;var WI=Et&&Et.__awaiter||function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function u(l){try{f(n.next(l))}catch(o){s(o)}}function c(l){try{f(n.throw(l))}catch(o){s(o)}}function f(l){l.done?a(l.value):i(l.value).then(u,c)}f((n=n.apply(t,e||[])).next())})},GI=Et&&Et.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.fromReadableStreamLike=Mr.fromAsyncIterable=Mr.fromIterable=Mr.fromPromise=Mr.fromArrayLike=Mr.fromInteropObservable=Mr.innerFrom=void 0;var XI=Za,QI=Hs,es=bn,JI=Ws,ZI=Gs,ek=Ys,tk=Xs,ww=Ii,rk=fn,nk=Bs,ok=ca;function ik(t){if(t instanceof es.Observable)return t;if(t!=null){if(JI.isInteropObservable(t))return Sw(t);if(XI.isArrayLike(t))return Ew(t);if(QI.isPromise(t))return Ow(t);if(ZI.isAsyncIterable(t))return Hd(t);if(tk.isIterable(t))return Aw(t);if(ww.isReadableStreamLike(t))return Tw(t)}throw ek.createInvalidObservableTypeError(t)}Mr.innerFrom=ik;function Sw(t){return new es.Observable(function(e){var r=t[ok.observable]();if(rk.isFunction(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}Mr.fromInteropObservable=Sw;function Ew(t){return new es.Observable(function(e){for(var r=0;r0&&T(d)},void 0,void 0,function(){_?.closed||_?.unsubscribe(),L=null})),!b&&T(p!=null?typeof p=="number"?p:+p-h.now():d)})}t.timeout=c;function f(l){throw new t.TimeoutError(l)}})(rc);var Hc={},nu={},ii={},ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.map=void 0;var dR=vr,hR=Sr;function yR(t,e){return dR.operate(function(r,n){var i=0;r.subscribe(hR.createOperatorSubscriber(n,function(a){n.next(t.call(e,a,i++))}))})}ai.map=yR;var vR=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},mR=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},rv=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};Object.defineProperty(Xc,"__esModule",{value:!0});Xc.fromEvent=void 0;var xC=Mr,PC=bn,IC=$o,kC=Za,ra=fn,RC=ii,CC=["addListener","removeListener"],NC=["addEventListener","removeEventListener"],jC=["on","off"];function Gp(t,e,r,n){if(ra.isFunction(r)&&(n=r,r=void 0),n)return Gp(t,e,r).pipe(RC.mapOneOrManyArgs(n));var i=TC(DC(t)?NC.map(function(u){return function(c){return t[u](e,c,r)}}):LC(t)?CC.map(av(t,e)):MC(t)?jC.map(av(t,e)):[],2),a=i[0],s=i[1];if(!a&&kC.isArrayLike(t))return IC.mergeMap(function(u){return Gp(u,e,r)})(xC.innerFrom(t));if(!a)throw new TypeError("Invalid event target");return new PC.Observable(function(u){var c=function(){for(var f=[],l=0;l0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},lN=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0){var u=void 0;try{u=pN.innerFrom(a.shift())}catch{s();return}var c=hN.createOperatorSubscriber(i,void 0,cv.noop,cv.noop);u.subscribe(c),c.add(s)}else i.complete()};s()})}rl.onErrorResumeNext=yN;Object.defineProperty(tl,"__esModule",{value:!0});tl.onErrorResumeNext=void 0;var vN=No,mN=rl,gN=mi;function bN(){for(var t=[],e=0;e0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},BN=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(ll,"__esModule",{value:!0});ll.bufferCount=void 0;var o9=vr,i9=Sr,a9=Fo;function s9(t,e){return e===void 0&&(e=null),e=e??t,o9.operate(function(r,n){var i=[],a=0;r.subscribe(i9.createOperatorSubscriber(n,function(s){var u,c,f,l,o=null;a++%e===0&&i.push([]);try{for(var w=ap(i),p=w.next();!p.done;p=w.next()){var d=p.value;d.push(s),t<=d.length&&(o=o??[],o.push(d))}}catch(O){u={error:O}}finally{try{p&&!p.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}if(o)try{for(var S=ap(o),v=S.next();!v.done;v=S.next()){var d=v.value;a9.arrRemove(i,d),n.next(d)}}catch(O){f={error:O}}finally{try{v&&!v.done&&(l=S.return)&&l.call(S)}finally{if(f)throw f.error}}},function(){var s,u;try{for(var c=ap(i),f=c.next();!f.done;f=c.next()){var l=f.value;n.next(l)}}catch(o){s={error:o}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(s)throw s.error}}n.complete()},void 0,function(){i=null}))})}ll.bufferCount=s9;var fl={},u9=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(fl,"__esModule",{value:!0});fl.bufferTime=void 0;var c9=Vn,l9=vr,f9=Sr,p9=Fo,d9=_o,h9=qn,hv=Bo;function y9(t){for(var e,r,n=[],i=1;i=0?hv.executeSchedule(f,a,p,s,!0):o=!0,p();var d=f9.createOperatorSubscriber(f,function(S){var v,O,h=l.slice();try{for(var g=u9(h),A=g.next();!A.done;A=g.next()){var m=A.value,x=m.buffer;x.push(S),u<=x.length&&w(m)}}catch(y){v={error:y}}finally{try{A&&!A.done&&(O=g.return)&&O.call(g)}finally{if(v)throw v.error}}},function(){for(;l?.length;)f.next(l.shift().buffer);d?.unsubscribe(),f.complete(),f.unsubscribe()},void 0,function(){return l=null});c.subscribe(d)})}fl.bufferTime=y9;var pl={},v9=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(pl,"__esModule",{value:!0});pl.bufferToggle=void 0;var m9=Vn,g9=vr,yv=Mr,sp=Sr,vv=Hn,b9=Fo;function _9(t,e){return g9.operate(function(r,n){var i=[];yv.innerFrom(t).subscribe(sp.createOperatorSubscriber(n,function(a){var s=[];i.push(s);var u=new m9.Subscription,c=function(){b9.arrRemove(i,s),n.next(s),u.unsubscribe()};u.add(yv.innerFrom(e(a)).subscribe(sp.createOperatorSubscriber(n,c,vv.noop)))},vv.noop)),r.subscribe(sp.createOperatorSubscriber(n,function(a){var s,u;try{for(var c=v9(i),f=c.next();!f.done;f=c.next()){var l=f.value;l.push(a)}}catch(o){s={error:o}}finally{try{f&&!f.done&&(u=c.return)&&u.call(c)}finally{if(s)throw s.error}}},function(){for(;i.length>0;)n.next(i.shift());n.complete()}))})}pl.bufferToggle=_9;var dl={};Object.defineProperty(dl,"__esModule",{value:!0});dl.bufferWhen=void 0;var w9=vr,S9=Hn,mv=Sr,E9=Mr;function O9(t){return w9.operate(function(e,r){var n=null,i=null,a=function(){i?.unsubscribe();var s=n;n=[],s&&r.next(s),E9.innerFrom(t()).subscribe(i=mv.createOperatorSubscriber(r,a,S9.noop))};a(),e.subscribe(mv.createOperatorSubscriber(r,function(s){return n?.push(s)},function(){n&&r.next(n),r.complete()},void 0,function(){return n=i=null}))})}dl.bufferWhen=O9;var hl={};Object.defineProperty(hl,"__esModule",{value:!0});hl.catchError=void 0;var A9=Mr,T9=Sr,x9=vr;function Lw(t){return x9.operate(function(e,r){var n=null,i=!1,a;n=e.subscribe(T9.createOperatorSubscriber(r,void 0,void 0,function(s){a=A9.innerFrom(t(s,Lw(t)(e))),n?(n.unsubscribe(),n=null,a.subscribe(r)):i=!0})),i&&(n.unsubscribe(),n=null,a.subscribe(r))})}hl.catchError=Lw;var yl={},uu={},cu={},lu={},Di={},fu={};Object.defineProperty(fu,"__esModule",{value:!0});fu.scanInternals=void 0;var P9=Sr;function I9(t,e,r,n,i){return function(a,s){var u=r,c=e,f=0;a.subscribe(P9.createOperatorSubscriber(s,function(l){var o=f++;c=u?t(c,l,o):(u=!0,l),n&&s.next(c)},i&&function(){u&&s.next(c),s.complete()}))}}fu.scanInternals=I9;Object.defineProperty(Di,"__esModule",{value:!0});Di.reduce=void 0;var k9=fu,R9=vr;function C9(t,e){return R9.operate(k9.scanInternals(t,e,arguments.length>=2,!1,!0))}Di.reduce=C9;Object.defineProperty(lu,"__esModule",{value:!0});lu.toArray=void 0;var N9=Di,j9=vr,L9=function(t,e){return t.push(e),t};function M9(){return j9.operate(function(t,e){N9.reduce(L9,[])(t).subscribe(e)})}lu.toArray=M9;Object.defineProperty(cu,"__esModule",{value:!0});cu.joinAllInternals=void 0;var D9=Jn,U9=ii,F9=vi,B9=$o,$9=lu;function V9(t,e){return F9.pipe($9.toArray(),B9.mergeMap(function(r){return t(r)}),e?U9.mapOneOrManyArgs(e):D9.identity)}cu.joinAllInternals=V9;Object.defineProperty(uu,"__esModule",{value:!0});uu.combineLatestAll=void 0;var q9=ki,z9=cu;function K9(t){return z9.joinAllInternals(q9.combineLatest,t)}uu.combineLatestAll=K9;Object.defineProperty(yl,"__esModule",{value:!0});yl.combineAll=void 0;var H9=uu;yl.combineAll=H9.combineLatestAll;var vl={},ml={},gv=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},bv=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},ej=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},uj=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},yj=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=2;return function(n){return n.pipe(S7.filter(function(i,a){return a===t}),A7.take(1),r?O7.defaultIfEmpty(e):E7.throwIfEmpty(function(){return new Av.ArgumentOutOfRangeError}))}}Il.elementAt=T7;var kl={},x7=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},P7=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=2;return function(n){return n.pipe(t?Z7.filter(function(i,a){return t(i,a,n)}):nL.identity,eL.take(1),r?tL.defaultIfEmpty(e):rL.throwIfEmpty(function(){return new J7.EmptyError}))}}Dl.first=oL;var Ul={};Object.defineProperty(Ul,"__esModule",{value:!0});Ul.groupBy=void 0;var iL=bn,aL=Mr,sL=Fn,uL=vr,Iv=Sr;function cL(t,e,r,n){return uL.operate(function(i,a){var s;!e||typeof e=="function"?s=e:(r=e.duration,s=e.element,n=e.connector);var u=new Map,c=function(d){u.forEach(d),d(a)},f=function(d){return c(function(S){return S.error(d)})},l=0,o=!1,w=new Iv.OperatorSubscriber(a,function(d){try{var S=t(d),v=u.get(S);if(!v){u.set(S,v=n?n():new sL.Subject);var O=p(S,v);if(a.next(O),r){var h=Iv.createOperatorSubscriber(v,function(){v.complete(),h?.unsubscribe()},void 0,void 0,function(){return u.delete(S)});w.add(aL.innerFrom(r(O)).subscribe(h))}}v.next(s?s(d):d)}catch(g){f(g)}},function(){return c(function(d){return d.complete()})},f,function(){return u.clear()},function(){return o=!0,l===0});i.subscribe(w);function p(d,S){var v=new iL.Observable(function(O){l++;var h=S.subscribe(O);return function(){h.unsubscribe(),--l===0&&o&&w.unsubscribe()}});return v.key=d,v}})}Ul.groupBy=cL;var Fl={};Object.defineProperty(Fl,"__esModule",{value:!0});Fl.isEmpty=void 0;var lL=vr,fL=Sr;function pL(){return lL.operate(function(t,e){t.subscribe(fL.createOperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}Fl.isEmpty=pL;var Bl={},gu={},dL=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(gu,"__esModule",{value:!0});gu.takeLast=void 0;var hL=No,yL=vr,vL=Sr;function mL(t){return t<=0?function(){return hL.EMPTY}:yL.operate(function(e,r){var n=[];e.subscribe(vL.createOperatorSubscriber(r,function(i){n.push(i),t=2;return function(n){return n.pipe(t?bL.filter(function(i,a){return t(i,a,n)}):EL.identity,_L.takeLast(1),r?SL.defaultIfEmpty(e):wL.throwIfEmpty(function(){return new gL.EmptyError}))}}Bl.last=OL;var $l={};Object.defineProperty($l,"__esModule",{value:!0});$l.materialize=void 0;var up=Uc,AL=vr,TL=Sr;function xL(){return AL.operate(function(t,e){t.subscribe(TL.createOperatorSubscriber(e,function(r){e.next(up.Notification.createNext(r))},function(){e.next(up.Notification.createComplete()),e.complete()},function(r){e.next(up.Notification.createError(r)),e.complete()}))})}$l.materialize=xL;var Vl={};Object.defineProperty(Vl,"__esModule",{value:!0});Vl.max=void 0;var PL=Di,IL=fn;function kL(t){return PL.reduce(IL.isFunction(t)?function(e,r){return t(e,r)>0?e:r}:function(e,r){return e>r?e:r})}Vl.max=kL;var ql={};Object.defineProperty(ql,"__esModule",{value:!0});ql.flatMap=void 0;var RL=$o;ql.flatMap=RL.mergeMap;var zl={};Object.defineProperty(zl,"__esModule",{value:!0});zl.mergeMapTo=void 0;var kv=$o,CL=fn;function NL(t,e,r){return r===void 0&&(r=1/0),CL.isFunction(e)?kv.mergeMap(function(){return t},e,r):(typeof e=="number"&&(r=e),kv.mergeMap(function(){return t},r))}zl.mergeMapTo=NL;var Kl={};Object.defineProperty(Kl,"__esModule",{value:!0});Kl.mergeScan=void 0;var jL=vr,LL=ns;function ML(t,e,r){return r===void 0&&(r=1/0),jL.operate(function(n,i){var a=e;return LL.mergeInternals(n,i,function(s,u){return t(a,s,u)},r,function(s){a=s},!1,void 0,function(){return a=null})})}Kl.mergeScan=ML;var Hl={},Wl={},DL=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},UL=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},KL=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},bM=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=2,!0))}uf.scan=YM;var cf={};Object.defineProperty(cf,"__esModule",{value:!0});cf.sequenceEqual=void 0;var XM=vr,QM=Sr;function JM(t,e){return e===void 0&&(e=function(r,n){return r===n}),XM.operate(function(r,n){var i=Fv(),a=Fv(),s=function(c){n.next(c),n.complete()},u=function(c,f){var l=QM.createOperatorSubscriber(n,function(o){var w=f.buffer,p=f.complete;w.length===0?p?s(!1):c.buffer.push(o):!e(o,w.shift())&&s(!1)},function(){c.complete=!0;var o=f.complete,w=f.buffer;o&&s(w.length===0),l?.unsubscribe()});return l};r.subscribe(u(i,a)),t.subscribe(u(a,i))})}cf.sequenceEqual=JM;function Fv(){return{buffer:[],complete:!1}}var _u={},ZM=Et&&Et.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},eD=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(xf,"__esModule",{value:!0});xf.windowCount=void 0;var Wv=Fn,_U=vr,wU=Sr;function SU(t,e){e===void 0&&(e=0);var r=e>0?e:t;return _U.operate(function(n,i){var a=[new Wv.Subject],s=0;i.next(a[0].asObservable()),n.subscribe(wU.createOperatorSubscriber(i,function(u){var c,f;try{for(var l=bU(a),o=l.next();!o.done;o=l.next()){var w=o.value;w.next(u)}}catch(S){c={error:S}}finally{try{o&&!o.done&&(f=l.return)&&f.call(l)}finally{if(c)throw c.error}}var p=s-t+1;if(p>=0&&p%r===0&&a.shift().complete(),++s%r===0){var d=new Wv.Subject;a.push(d),i.next(d.asObservable())}},function(){for(;a.length>0;)a.shift().complete();i.complete()},function(u){for(;a.length>0;)a.shift().error(u);i.error(u)},function(){a=null}))})}xf.windowCount=SU;var Pf={};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.windowTime=void 0;var EU=Fn,OU=_o,AU=Vn,TU=vr,xU=Sr,PU=Fo,IU=qn,Gv=Bo;function kU(t){for(var e,r,n=[],i=1;i=0?Gv.executeSchedule(f,a,p,s,!0):o=!0,p();var d=function(v){return l.slice().forEach(v)},S=function(v){d(function(O){var h=O.window;return v(h)}),v(f),f.unsubscribe()};return c.subscribe(xU.createOperatorSubscriber(f,function(v){d(function(O){O.window.next(v),u<=++O.seen&&w(O)})},function(){return S(function(v){return v.complete()})},function(v){return S(function(O){return O.error(v)})})),function(){l=null}})}Pf.windowTime=kU;var If={},RU=Et&&Et.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(If,"__esModule",{value:!0});If.windowToggle=void 0;var CU=Fn,NU=Vn,jU=vr,Yv=Mr,lp=Sr,Xv=Hn,LU=Fo;function MU(t,e){return jU.operate(function(r,n){var i=[],a=function(s){for(;00)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},Zv=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},QU=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r0)&&!(i=n.next()).done;)a.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a},rF=Et&&Et.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r{var a;!((a=this.target)===null||a===void 0)&&a.closed&&this.closeCurrentPromises$.next()}),this.onInititalResponseSubscription=this.initialResponse$.pipe((0,cn.takeUntil)(this.closeObservables$)).subscribe(a=>{const s=this.decryptFromReceiver({oneTimeCode:a.data.oneTimeCode,payload:a.data.message,senderPublicKey:a.data.publicKey});JSON.parse(s).providedSession===this.session()&&(this.targetPublicKey=a.data.publicKey,this.initialResponseCompleted$.next())}),this.onConnectResponseSubscription=this.connectResponse$.pipe((0,cn.takeUntil)(this.closeObservables$)).subscribe(a=>{if(!this.targetPublicKey){this.connectResult$.next({success:!1,message:"Wallet encryption public key is not provided, request rejected."});return}if(!a.data.success){this.connectResult$.next({success:!1,message:"Request rejected from the wallet"});return}const s=this.decryptFromReceiver({oneTimeCode:a.data.oneTimeCode,payload:a.data.message,senderPublicKey:this.targetPublicKey}),u=JSON.parse(s);this.connectResult$.next({success:!0,publicKey:u.publicKey})}),this.onSignResponseSubscription=this.signResponse$.pipe((0,cn.takeUntil)(this.closeObservables$)).subscribe(a=>{if(!this.targetPublicKey){this.signResult$.next({success:!1,message:"Wallet encryption public key is not provided, request rejected."});return}if(!a.data.success){this.signResult$.next({success:!1,message:"Request rejected from the wallet"});return}const s=this.decryptFromReceiver({oneTimeCode:a.data.oneTimeCode,payload:a.data.message,senderPublicKey:this.targetPublicKey}),u=JSON.parse(s);this.signResult$.next({success:!0,xdr:u.xdr})}),this.preferredTarget=e?.preferredTarget||"extension",this.walletUrl=e?.url||"https://wallet.xbull.app/connect";const r=hs.box.keyPair(),n=(0,Lo.encodeBase64)((0,hs.randomBytes)(24));this.encryptForReceiver=a=>{const s=(0,hs.randomBytes)(24),u=(0,hs.box)((0,Lo.decodeUTF8)(a.data),s,a.receiverPublicKey,r.secretKey);return{message:(0,Lo.encodeBase64)(u),oneTimeCode:(0,Lo.encodeBase64)(s)}},this.decryptFromReceiver=a=>{const s=hs.box.open((0,Lo.decodeBase64)(a.payload),(0,Lo.decodeBase64)(a.oneTimeCode),(0,Lo.decodeBase64)(a.senderPublicKey),r.secretKey);if(!s)throw new Error("Decrypted message is null");return(0,Lo.encodeUTF8)(s)},this.publicKey=()=>r.publicKey,this.session=()=>n.slice();const i=a=>{switch(a.data.type){case ys.EventType.XBULL_INITIAL_RESPONSE:this.initialResponse$.next(a);break;case ys.EventType.XBULL_CONNECT_RESPONSE:this.connectResponse$.next(a);break;case ys.EventType.XBULL_SIGN_RESPONSE:this.signResponse$.next(a);break}};window.addEventListener("message",i),this.closeObservables$.asObservable().pipe((0,cn.take)(1)).subscribe(()=>{window.removeEventListener("message",i)})}openWallet(){return!!this.target&&!this.target.closed&&(this.target.close(),this.target=null,this.closeCurrentPromises$.next()),this.target=window.open(`${this.walletUrl}?public=${encodeURIComponent((0,Lo.encodeBase64)(this.publicKey()))}&session=${encodeURIComponent(this.session())}`,"xBull_Wallet_app","width=380,height=640,left=100,top=100"),(0,cn.firstValueFrom)(this.initialResponseCompleted$.pipe((0,cn.takeUntil)(this.closeCurrentPromises$)).pipe((0,cn.takeUntil)(this.closeObservables$)))}closeWallet(){var e;this.target&&((e=this.target)===null||e===void 0||e.close(),this.target=null)}connect(e={canRequestPublicKey:!0,canRequestSign:!0}){return tm(this,void 0,void 0,function*(){const r=window.xBullSDK;if(!!r&&this.preferredTarget==="extension")return yield r.connect(e),r.getPublicKey();{if(yield this.openWallet(),!this.target||!this.targetPublicKey)throw new Error("xBull Wallet is not open, we can't connect with it");const{message:n,oneTimeCode:i}=this.encryptForReceiver({data:JSON.stringify(e),receiverPublicKey:(0,Lo.decodeBase64)(this.targetPublicKey)}),a={type:ys.EventType.XBULL_CONNECT,message:n,oneTimeCode:i};this.target.postMessage(a,"*");const s=this.connectResult$.asObservable().pipe((0,cn.switchMap)(u=>u.success?(this.closeWallet(),(0,cn.of)(u.publicKey)):(this.closeWallet(),(0,cn.throwError)(()=>new Error(u.message))))).pipe((0,cn.take)(1)).pipe((0,cn.takeUntil)(this.closeCurrentPromises$)).pipe((0,cn.takeUntil)(this.closeObservables$));return(0,cn.firstValueFrom)(s)}})}sign(e){return tm(this,void 0,void 0,function*(){const r=window.xBullSDK;if(!!r&&this.preferredTarget==="extension"){const{xdr:n}=e,i=iF(e,["xdr"]);return r.signXDR(n,i)}else{if(yield this.openWallet(),!this.target||!this.targetPublicKey)throw new Error("xBull Wallet is not open, we can't connect with it");if(typeof e.xdr!="string")throw new Error("XDR provided needs to be a string value");const{message:n,oneTimeCode:i}=this.encryptForReceiver({data:JSON.stringify(e),receiverPublicKey:(0,Lo.decodeBase64)(this.targetPublicKey)}),a={type:ys.EventType.XBULL_SIGN,message:n,oneTimeCode:i};this.target.postMessage(a,"*");const s=this.signResult$.asObservable().pipe((0,cn.switchMap)(u=>u.success?(this.closeWallet(),(0,cn.of)(u.xdr)):(this.closeWallet(),(0,cn.throwError)(()=>new Error(u.message))))).pipe((0,cn.take)(1)).pipe((0,cn.takeUntil)(this.closeCurrentPromises$)).pipe((0,cn.takeUntil)(this.closeObservables$));return(0,cn.firstValueFrom)(s)}})}closeConnections(){this.closeObservables$.next(),this.closeCurrentPromises$.next(),this.closeObservables$.complete(),this.closeCurrentPromises$.complete()}}Xp=Ud.xBullWalletConnect=aF;class Qi extends Ga{static NAME="xbull";static FRIENDLY_NAME="xBull";static XBullExtension="https://wallet.xbull.app";XBullNetwork;constructor(e){super(e),Ti===Kn.PUBLIC?this.XBullNetwork=Kn.PUBLIC:Ti===Kn.TESTNET?this.XBullNetwork=Kn.TESTNET:this.XBullNetwork=Kn.FUTURENET}async getPublicKey(){const e=new Xp,r=await e.connect();return e.closeConnections(),super.persistWallet(),r}async sign(e){const r=new Xp,n=await r.sign({xdr:e.toXDR(),network:this.XBullNetwork});return r.closeConnections(),n}getFriendlyName(){return Qi.FRIENDLY_NAME}getName(){return Qi.NAME}getSvgIcon(){return V4}getExtension(){return Qi.XBullExtension}isInstalled(){return new Promise(r=>{r(!0)})}}class Gd{createAll(){return[Gi.NAME,Qi.NAME,Xi.NAME,Yi.NAME,Co.NAME].map(this.create)}create(e){let r;const n=new Es;switch(e){case Gi.NAME:r=new Gi(n);break;case Qi.NAME:r=new Qi(n);break;case Xi.NAME:r=new Xi(n);break;case Yi.NAME:r=new Yi(n);break;case Co.NAME:r=new Co(n);break;default:throw new tP}return r}createWalletConnect(e){const r=new Es;return new yi(r,e)}}function sF(t){let e;return{c(){e=Ct("div"),Ve(e,"class","loading-wallet svelte-1iz68ga")},m(r,n){Gt(r,e,n)},p:wr,i:wr,o:wr,d(r){r&&Wt(e)}}}class uF extends yn{constructor(e){super(),hn(this,e,null,sF,ln,{})}}function rm(t){let e,r=(t[1]?"":t[2].INSTALL)+"",n,i,a;return{c(){e=Ct("a"),n=pr(r),Ve(e,"class",i="simple-signer "+(t[1]?"":"install-wallet")+" svelte-1af29be"),Ve(e,"target","_blank"),Ve(e,"href",a=t[0].getExtension())},m(s,u){Gt(s,e,u),nt(e,n)},p(s,u){u&6&&r!==(r=(s[1]?"":s[2].INSTALL)+"")&&br(n,r),u&2&&i!==(i="simple-signer "+(s[1]?"":"install-wallet")+" svelte-1af29be")&&Ve(e,"class",i),u&1&&a!==(a=s[0].getExtension())&&Ve(e,"href",a)},d(s){s&&Wt(e)}}}function cF(t){let e,r,n,i,a,s,u,c=t[0].getFriendlyName()+"",f,l,o,w,p=t[0].getName()!==yi.NAME,d,S,v,O;var h=t[0].getSvgIcon();function g(m){return{}}h&&(a=new h(g()));let A=p&&rm(t);return{c(){e=Ct("div"),r=Ct("div"),n=Ct("div"),i=Ct("div"),a&&Xr(a.$$.fragment),s=hr(),u=Ct("span"),f=pr(c),w=hr(),A&&A.c(),Ve(i,"id","wallet-icon"),Ve(i,"class","simple-signer wallet-logo svelte-1af29be"),Ve(u,"class",l="simple-signer wallet-title "+(t[1]?"":"wallet-title-opacity")+" svelte-1af29be"),Ve(n,"class",o="simple-signer wallet-items "+(t[1]?"":"wallet-opacity")+" svelte-1af29be"),Ve(r,"class",d="simple-signer wallet-items-container "+(t[1]?"shadow":"")+" svelte-1af29be"),Ve(e,"class","simple-signer wallet-container svelte-1af29be")},m(m,x){Gt(m,e,x),nt(e,r),nt(r,n),nt(n,i),a&&Gr(a,i,null),nt(n,s),nt(n,u),nt(u,f),nt(r,w),A&&A.m(r,null),S=!0,v||(O=Cn(r,"click",t[3]),v=!0)},p(m,[x]){if(h!==(h=m[0].getSvgIcon())){if(a){Dn();const y=a;mr(y.$$.fragment,1,0,()=>{Yr(y,1)}),Un()}h?(a=new h(g()),Xr(a.$$.fragment),dr(a.$$.fragment,1),Gr(a,i,null)):a=null}(!S||x&1)&&c!==(c=m[0].getFriendlyName()+"")&&br(f,c),(!S||x&2&&l!==(l="simple-signer wallet-title "+(m[1]?"":"wallet-title-opacity")+" svelte-1af29be"))&&Ve(u,"class",l),(!S||x&2&&o!==(o="simple-signer wallet-items "+(m[1]?"":"wallet-opacity")+" svelte-1af29be"))&&Ve(n,"class",o),x&1&&(p=m[0].getName()!==yi.NAME),p?A?A.p(m,x):(A=rm(m),A.c(),A.m(r,null)):A&&(A.d(1),A=null),(!S||x&2&&d!==(d="simple-signer wallet-items-container "+(m[1]?"shadow":"")+" svelte-1af29be"))&&Ve(r,"class",d)},i(m){S||(a&&dr(a.$$.fragment,m),S=!0)},o(m){a&&mr(a.$$.fragment,m),S=!1},d(m){m&&Wt(e),a&&Yr(a),A&&A.d(),v=!1,O()}}}function lF(t,e,r){let n;Ur(t,go,c=>r(2,n=c));let{wallet:i}=e,{isInstalled:a}=e;const s=nc();async function u(){let c;i.getName()===Co.NAME?c=null:c=(await i.getPublicKey()).toUpperCase(),s("connect",{wallet:i,publicKey:c})}return t.$$set=c=>{"wallet"in c&&r(0,i=c.wallet),"isInstalled"in c&&r(1,a=c.isInstalled)},[i,a,n,u]}class fF extends yn{constructor(e){super(),hn(this,e,lF,cF,ln,{wallet:0,isInstalled:1})}}const nm=Sn(!1),fp=Sn(!1),Ru=Sn(!1),Cu=Sn("");function om(t,e,r){const n=t.slice();return n[22]=e[r],n}function pF(t){let e,r,n=t[1],i=[];for(let s=0;smr(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;s{Yr(Z,1)}),Un()}D?(a=new D(X()),Xr(a.$$.fragment),dr(a.$$.fragment,1),Gr(a,i,null)):a=null}K===(K=ae(J))&&z?z.p(J,Q):(z.d(1),z=K(J),z&&(z.c(),z.m(l,o))),(!k||Q&32)&&p!==(p=J[5].INVALID_KEY+"")&&br(d,p),(!k||Q&8&&S!==(S="simple-signer error-private-key "+(J[3]?"":"hidden")+" svelte-1pv6jos"))&&Ve(w,"class",S);let fe=h;h=F(J),h!==fe&&(Dn(),mr(E[fe],1,1,()=>{E[fe]=null}),Un(),g=E[h],g||(g=E[h]=H[h](J),g.c()),dr(g,1),g.m(O,null)),(!k||Q&32)&&y!==(y=J[5].CANCEL+"")&&br(_,y),(!k||Q&32)&&T!==(T=J[5].CONNECT_WITH_PRIVATE_KEY+"")&&br(I,T)},i(J){k||(a&&dr(a.$$.fragment,J),dr(g),k=!0)},o(J){a&&mr(a.$$.fragment,J),mr(g),k=!1},d(J){J&&Wt(e),a&&Yr(a),z.d(),E[h].d(),N=!1,ri(C)}}}function yF(t){return{c:wr,m:wr,p:wr,i:wr,o:wr,d:wr}}function vF(t){let e,r,n;return e=new fF({props:{wallet:t[22],isInstalled:t[25]}}),e.$on("connect",t[7]),{c(){Xr(e.$$.fragment),r=hr()},m(i,a){Gr(e,i,a),Gt(i,r,a),n=!0},p(i,a){const s={};a&2&&(s.wallet=i[22]),a&2&&(s.isInstalled=i[25]),e.$set(s)},i(i){n||(dr(e.$$.fragment,i),n=!0)},o(i){mr(e.$$.fragment,i),n=!1},d(i){Yr(e,i),i&&Wt(r)}}}function mF(t){let e,r,n;return e=new uF({}),{c(){Xr(e.$$.fragment),r=hr()},m(i,a){Gr(e,i,a),Gt(i,r,a),n=!0},p:wr,i(i){n||(dr(e.$$.fragment,i),n=!0)},o(i){mr(e.$$.fragment,i),n=!1},d(i){Yr(e,i),i&&Wt(r)}}}function im(t){let e,r,n,i={ctx:t,current:null,token:null,hasCatch:!1,pending:mF,then:vF,catch:yF,value:25,blocks:[,,,]};return th(r=t[22].isInstalled(),i),{c(){e=so(),i.block.c()},m(a,s){Gt(a,e,s),i.block.m(a,i.anchor=s),i.mount=()=>e.parentNode,i.anchor=e,n=!0},p(a,s){t=a,i.ctx=t,s&2&&r!==(r=t[22].isInstalled())&&th(r,i)||e2(i,t,s)},i(a){n||(dr(i.block),n=!0)},o(a){for(let s=0;s<3;s+=1){const u=i.blocks[s];mr(u)}n=!1},d(a){a&&Wt(e),i.block.d(a),i.token=null,i=null}}}function gF(t){let e,r,n,i;return{c(){e=Ct("input"),Ve(e,"class",r="simple-signer input-private-key "+(t[3]?"invalid-key":"")+" svelte-1pv6jos"),Ve(e,"id","input-key"),Ve(e,"type","password"),Ve(e,"placeholder","Input key here")},m(a,s){Gt(a,e,s),Ku(e,t[0]),n||(i=Cn(e,"input",t[12]),n=!0)},p(a,s){s&8&&r!==(r="simple-signer input-private-key "+(a[3]?"invalid-key":"")+" svelte-1pv6jos")&&Ve(e,"class",r),s&1&&e.value!==a[0]&&Ku(e,a[0])},d(a){a&&Wt(e),n=!1,i()}}}function bF(t){let e,r,n,i;return{c(){e=Ct("input"),Ve(e,"class",r="simple-signer input-private-key "+(t[3]?"invalid-key":"")+" svelte-1pv6jos"),Ve(e,"id","input-key"),Ve(e,"type","text"),Ve(e,"placeholder","Input key here")},m(a,s){Gt(a,e,s),Ku(e,t[0]),n||(i=Cn(e,"input",t[11]),n=!0)},p(a,s){s&8&&r!==(r="simple-signer input-private-key "+(a[3]?"invalid-key":"")+" svelte-1pv6jos")&&Ve(e,"class",r),s&1&&e.value!==a[0]&&Ku(e,a[0])},d(a){a&&Wt(e),n=!1,i()}}}function _F(t){let e,r;return e=new Z4({}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function wF(t){let e,r;return e=new Q4({}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function SF(t){let e,r,n,i;const a=[hF,dF,pF],s=[];function u(c,f){return c[2]?0:c[1].length?2:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,[f]){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}async function am(t){const e=[];for(let r of t)await r.isInstalled()?e.unshift(r):e.push(r);return e}function EF(t,e,r){let n,i,a,s,u;Ur(t,Cu,L=>r(0,n=L)),Ur(t,fp,L=>r(2,i=L)),Ur(t,Ru,L=>r(3,a=L)),Ur(t,nm,L=>r(4,s=L)),Ur(t,go,L=>r(5,u=L));let{wallets:c}=e,{walletConnectService:f}=e;const l=new Gd,o=nc();function w(){const L=l.createAll(),b=l.createWalletConnect(f);return L.concat(b)}let p,d=[];c.length?(p=eP(c).map(L=>L===yi.NAME?l.createWalletConnect(f):l.create(L)),(async()=>r(1,d=await am(p)))()):(async()=>(p=w(),r(1,d=await am(p))))();async function S(L){const b=l.create(Co.NAME);O(L);const T=await b.getPublicKey(L);h(b,T)}function v(L){const b=L.detail.wallet,T=L.detail.publicKey;b.getName()===Co.NAME?dn(fp,i=!0,i):h(b,T)}function O(L){/^S[A-Za-z0-9]{55}$/.test(L)?dn(Ru,a=!1,a):dn(Ru,a=!0,a)}function h(L,b){o("connect",{wallet:L,publicKey:b})}function g(){dn(fp,i=!i,i),dn(Cu,n="",n)}function A(){n=this.value,Cu.set(n)}function m(){n=this.value,Cu.set(n)}const x=()=>dn(nm,s=!s,s),y=()=>g(),_=()=>S(n);return t.$$set=L=>{"wallets"in L&&r(9,c=L.wallets),"walletConnectService"in L&&r(10,f=L.walletConnectService)},t.$$.update=()=>{t.$$.dirty&1&&(n.length||dn(Ru,a=!1,a))},[n,d,i,a,s,u,S,v,g,c,f,A,m,x,y,_]}class $w extends yn{constructor(e){super(),hn(this,e,EF,SF,ln,{wallets:9,walletConnectService:10})}}const sm=Sn(!0),um=Sn(!1),pp=Sn([]);function cm(t){let e,r;return e=new $w({props:{wallets:t[2],walletConnectService:t[0]}}),e.$on("connect",t[5]),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&4&&(a.wallets=n[2]),i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function lm(t){let e,r;return e=new $w({props:{wallets:t[2],walletConnectService:t[0]}}),e.$on("connect",t[5]),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&4&&(a.wallets=n[2]),i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function OF(t){let e,r,n,i=t[4].SELECT_WALLET+"",a,s,u,c,f=t[3]&&cm(t),l=t[1]&&lm(t);return{c(){e=Ct("div"),r=Ct("div"),n=Ct("span"),a=pr(i),s=hr(),f&&f.c(),u=hr(),l&&l.c(),Ve(n,"class","simple-signer select-wallet svelte-1jy14ob"),Ve(r,"class","simple-signer-wallets svelte-1jy14ob"),Ve(e,"class","simple-signer-container svelte-1jy14ob")},m(o,w){Gt(o,e,w),nt(e,r),nt(r,n),nt(n,a),nt(r,s),f&&f.m(r,null),nt(r,u),l&&l.m(r,null),c=!0},p(o,[w]){(!c||w&16)&&i!==(i=o[4].SELECT_WALLET+"")&&br(a,i),o[3]?f?(f.p(o,w),w&8&&dr(f,1)):(f=cm(o),f.c(),dr(f,1),f.m(r,u)):f&&(Dn(),mr(f,1,1,()=>{f=null}),Un()),o[1]?l?(l.p(o,w),w&2&&dr(l,1)):(l=lm(o),l.c(),dr(l,1),l.m(r,null)):l&&(Dn(),mr(l,1,1,()=>{l=null}),Un())},i(o){c||(dr(f),dr(l),c=!0)},o(o){mr(f),mr(l),c=!1},d(o){o&&Wt(e),f&&f.d(),l&&l.d()}}}const AF=600,TF=340,xF=360,PF=650;function IF(t,e,r){let n,i,a,s;Ur(t,um,w=>r(1,n=w)),Ur(t,pp,w=>r(2,i=w)),Ur(t,sm,w=>r(3,a=w)),Ur(t,go,w=>r(4,s=w));let{walletConnectService:u}=e;const c=window.opener,f=new Md(Wi.CONNECT),l=f.getRedirectFromUrl();dn(pp,i=f.getWalletsFromUrl(),i),c&&!i.length&&f.addAvailableWalletsMessageHandler(w=>{dn(sm,a=!1,a),dn(pp,i=w.wallets,i),dn(um,n=!0,n)});function o(w){const p=w.detail,d=p.publicKey,S=p.wallet;f.sendOnConnectEvent(d,S.getName()),l?window.location.href=`/${l}`:f.closeWindow()}return f.sendOnReadyEvent(),Dd(AF,TF,PF,xF),t.$$set=w=>{"walletConnectService"in w&&r(0,u=w.walletConnectService)},[u,n,i,a,s,o]}class kF extends yn{constructor(e){super(),hn(this,e,IF,OF,ln,{walletConnectService:0})}}const Yd=new kn.exports.Horizon.Server(DS);async function RF(t,e,r){try{const n=await Yd.loadAccount(t);for(const i of n.balances)if(e==="native"&&i.asset_type==="native"||"asset_code"in i&&i.asset_code===e&&i.asset_issuer===r)return!0;return!1}catch(n){throw new Error(JSON.stringify(n))}}async function CF(t,e,r,n,i){const a=n==="native"?kn.exports.Asset.native():new kn.exports.Asset(n,i);try{const s=await Yd.loadAccount(t);return new kn.exports.TransactionBuilder(s,{fee:kn.exports.BASE_FEE,networkPassphrase:J1}).addOperation(kn.exports.Operation.payment({destination:e,asset:a,amount:r})).setTimeout(30).build()}catch(s){throw new Error(JSON.stringify(s))}}function NF(t){let e,r,n,i;const a=[MF,LF],s=[];function u(c,f){return!c[1]||!c[2]||!c[3]||!c[4]||c[7]===c[8].NO_TRUSTLINE?0:1}return r=u(t),n=s[r]=a[r](t),{c(){e=Ct("div"),n.c(),Ve(e,"class","simple-signer tx-data-container svelte-m2lfo9")},m(c,f){Gt(c,e,f),s[r].m(e,null),i=!0},p(c,f){let l=r;r=u(c),r===l?s[r].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),n=s[r],n?n.p(c,f):(n=s[r]=a[r](c),n.c()),dr(n,1),n.m(e,null))},i(c){i||(dr(n),i=!0)},o(c){mr(n),i=!1},d(c){c&&Wt(e),s[r].d()}}}function jF(t){let e,r,n,i,a,s=t[8].CLOSE+"",u,c,f;return{c(){e=Ct("div"),r=Ct("div"),n=pr(t[6]),i=hr(),a=Ct("button"),u=pr(s),Ve(r,"class","simple-signer payment-result-text svelte-m2lfo9"),Ve(a,"class","simple-signer accept-button svelte-m2lfo9"),Ve(e,"class","simple-signer payment-result-message svelte-m2lfo9")},m(l,o){Gt(l,e,o),nt(e,r),nt(r,n),nt(e,i),nt(e,a),nt(a,u),c||(f=Cn(a,"click",t[10]),c=!0)},p(l,o){o&64&&br(n,l[6]),o&256&&s!==(s=l[8].CLOSE+"")&&br(u,s)},i:wr,o:wr,d(l){l&&Wt(e),c=!1,f()}}}function LF(t){let e,r=t[8].PAY+"",n,i,a,s,u,c=t[8].NETWORK+"",f,l,o,w,p,d,S=t[8].YOU_ARE_PAYING+"",v,O,h,g,A,m,x=(t[3]==="native"?"XLM":t[3])+"",y,_,L=t[8].TO_THE_ACCOUNT+"",b,T,I,k,N,C,D,X,ae,K,z,H;const E=[UF,DF],F=[];function J(Q,fe){return Q[0]?0:1}return ae=J(t),K=F[ae]=E[ae](t),{c(){e=Ct("h1"),n=pr(r),i=hr(),a=Ct("div"),s=Ct("div"),u=Ct("p"),f=pr(c),l=pr(":"),o=pr(` + \xA0 + `),w=Ct("p"),w.textContent=`${Ti}`,p=hr(),d=Ct("div"),v=pr(S),O=hr(),h=Ct("strong"),g=pr(t[2]),A=hr(),m=Ct("strong"),y=pr(x),_=hr(),b=pr(L),T=hr(),I=Ct("br"),k=hr(),N=Ct("strong"),C=pr(t[1]),D=pr("."),X=hr(),K.c(),z=so(),Ve(e,"class","simple-signer pay-title svelte-m2lfo9"),Ve(w,"class","simple-signer pay-network-text svelte-m2lfo9"),Ve(s,"class","simple-signer pay-network-container svelte-m2lfo9"),Ve(a,"class","simple-signer tx-network-container svelte-m2lfo9"),Ve(d,"class","simple-signer receiver svelte-m2lfo9")},m(Q,fe){Gt(Q,e,fe),nt(e,n),Gt(Q,i,fe),Gt(Q,a,fe),nt(a,s),nt(s,u),nt(u,f),nt(u,l),nt(s,o),nt(s,w),Gt(Q,p,fe),Gt(Q,d,fe),nt(d,v),nt(d,O),nt(d,h),nt(h,g),nt(d,A),nt(d,m),nt(m,y),nt(d,_),nt(d,b),nt(d,T),nt(d,I),nt(d,k),nt(d,N),nt(N,C),nt(N,D),Gt(Q,X,fe),F[ae].m(Q,fe),Gt(Q,z,fe),H=!0},p(Q,fe){(!H||fe&256)&&r!==(r=Q[8].PAY+"")&&br(n,r),(!H||fe&256)&&c!==(c=Q[8].NETWORK+"")&&br(f,c),(!H||fe&256)&&S!==(S=Q[8].YOU_ARE_PAYING+"")&&br(v,S),(!H||fe&4)&&br(g,Q[2]),(!H||fe&8)&&x!==(x=(Q[3]==="native"?"XLM":Q[3])+"")&&br(y,x),(!H||fe&256)&&L!==(L=Q[8].TO_THE_ACCOUNT+"")&&br(b,L),(!H||fe&2)&&br(C,Q[1]);let Z=ae;ae=J(Q),ae===Z?F[ae].p(Q,fe):(Dn(),mr(F[Z],1,1,()=>{F[Z]=null}),Un(),K=F[ae],K?K.p(Q,fe):(K=F[ae]=E[ae](Q),K.c()),dr(K,1),K.m(z.parentNode,z))},i(Q){H||(dr(K),H=!0)},o(Q){mr(K),H=!1},d(Q){Q&&Wt(e),Q&&Wt(i),Q&&Wt(a),Q&&Wt(p),Q&&Wt(d),Q&&Wt(X),F[ae].d(Q),Q&&Wt(z)}}}function MF(t){let e,r=t[8].ERROR+"",n,i,a,s,u=(t[7]===t[8].NO_TRUSTLINE?t[7]:t[8].ERROR_MISSING_RECEIVER_DATA)+"",c,f,l,o=t[8].CLOSE+"",w,p,d;return{c(){e=Ct("h1"),n=pr(r),i=hr(),a=Ct("div"),s=Ct("p"),c=pr(u),f=hr(),l=Ct("button"),w=pr(o),Ve(e,"class","simple-signer error-title svelte-m2lfo9"),Ve(s,"class","simple-signer"),Ve(l,"class","simple-signer accept-button svelte-m2lfo9"),Ve(a,"class","simple-signer information-container svelte-m2lfo9")},m(S,v){Gt(S,e,v),nt(e,n),Gt(S,i,v),Gt(S,a,v),nt(a,s),nt(s,c),nt(a,f),nt(a,l),nt(l,w),p||(d=Cn(l,"click",t[10]),p=!0)},p(S,v){v&256&&r!==(r=S[8].ERROR+"")&&br(n,r),v&384&&u!==(u=(S[7]===S[8].NO_TRUSTLINE?S[7]:S[8].ERROR_MISSING_RECEIVER_DATA)+"")&&br(c,u),v&256&&o!==(o=S[8].CLOSE+"")&&br(w,o)},i:wr,o:wr,d(S){S&&Wt(e),S&&Wt(i),S&&Wt(a),p=!1,d()}}}function DF(t){let e,r,n=t[8].USER_IS_NOT_CONNECTED+"",i,a,s,u,c;return u=new xa({props:{to:`/connect/?redirect=${t[11]}`,$$slots:{default:[FF]},$$scope:{ctx:t}}}),{c(){e=Ct("div"),r=Ct("p"),i=pr(n),a=hr(),s=Ct("button"),Xr(u.$$.fragment),Ve(r,"class","simple-signer user-not-connected"),Ve(s,"class","simple-signer payment-btn svelte-m2lfo9"),Ve(e,"class","simple-signer information-container svelte-m2lfo9")},m(f,l){Gt(f,e,l),nt(e,r),nt(r,i),nt(e,a),nt(e,s),Gr(u,s,null),c=!0},p(f,l){(!c||l&256)&&n!==(n=f[8].USER_IS_NOT_CONNECTED+"")&&br(i,n);const o={};l&2097408&&(o.$$scope={dirty:l,ctx:f}),u.$set(o)},i(f){c||(dr(u.$$.fragment,f),c=!0)},o(f){mr(u.$$.fragment,f),c=!1},d(f){f&&Wt(e),Yr(u)}}}function UF(t){let e,r,n=t[8].CANCEL+"",i,a,s,u,c;function f(w,p){return w[5]?$F:BF}let l=f(t),o=l(t);return{c(){e=Ct("div"),r=Ct("button"),i=pr(n),a=hr(),s=Ct("button"),o.c(),Ve(r,"class","simple-signer cancel-button svelte-m2lfo9"),r.disabled=t[5],s.disabled=t[5],Ve(s,"class","simple-signer payment-btn svelte-m2lfo9"),Ve(e,"class","simple-signer confirmation-buttons svelte-m2lfo9")},m(w,p){Gt(w,e,p),nt(e,r),nt(r,i),nt(e,a),nt(e,s),o.m(s,null),u||(c=[Cn(r,"click",t[13]),Cn(s,"click",t[9])],u=!0)},p(w,p){p&256&&n!==(n=w[8].CANCEL+"")&&br(i,n),p&32&&(r.disabled=w[5]),l===(l=f(w))&&o?o.p(w,p):(o.d(1),o=l(w),o&&(o.c(),o.m(s,null))),p&32&&(s.disabled=w[5])},i:wr,o:wr,d(w){w&&Wt(e),o.d(),u=!1,ri(c)}}}function FF(t){let e=t[8].GO_TO_CONNECT+"",r;return{c(){r=pr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&256&&e!==(e=n[8].GO_TO_CONNECT+"")&&br(r,e)},d(n){n&&Wt(r)}}}function BF(t){let e=t[8].PAY+"",r;return{c(){r=pr(e)},m(n,i){Gt(n,r,i)},p(n,i){i&256&&e!==(e=n[8].PAY+"")&&br(r,e)},d(n){n&&Wt(r)}}}function $F(t){let e;return{c(){e=Ct("span"),Ve(e,"class","simple-signer spinner svelte-m2lfo9")},m(r,n){Gt(r,e,n)},p:wr,d(r){r&&Wt(e)}}}function VF(t){let e,r,n,i;const a=[jF,NF],s=[];function u(c,f){return c[6]?0:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,[f]){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}const qF=600,zF=340,KF=360,HF=650;function WF(t,e,r){let n;Ur(t,go,_=>r(8,n=_));let{walletConnectService:i}=e;const a=new Es;let s;const u=a.getItem("wallet"),c=new Gd;u&&(u===yi.NAME?s=c.createWalletConnect(i):s=c.create(u));let f="",l="",o="",w="";const p=new Md(Wi.PAYMENT),d=p.getPaymentMessageFromUrl();d?({receiver:f,amount:l,assetCode:o,issuer:w}=d,h()):p.addPaymentMessageHandler(_=>{r(1,{receiver:f,amount:l,assetCode:o,issuer:w}=_,f,r(2,l),r(3,o),r(4,w)),h()});let S=!1,v="",O="";async function h(){await RF(f,o,w)||r(7,O=n.NO_TRUSTLINE)}async function g(){if(S)return;r(5,S=!0);const _=await s.getPublicKey();try{const L=await CF(_,f,l,o,w);await s.sign(L),await Yd.submitTransaction(L),r(6,v=n.SUCCESSFUL_PAYMENT)}catch(L){console.error(L),r(6,v=n.FAILED_PAYMENT)}finally{r(5,S=!1)}}const A=()=>{r(6,v=""),x()},m=encodeURIComponent(`payment?receiver=${f}&amount=${l}&assetCode=${o}&issuer=${w}`);function x(){p.sendOnCancelEvent()}p.sendOnReadyEvent(),Dd(qF,zF,HF,KF);const y=()=>A();return t.$$set=_=>{"walletConnectService"in _&&r(12,i=_.walletConnectService)},[s,f,l,o,w,S,v,O,n,g,A,m,i,y]}class GF extends yn{constructor(e){super(),hn(this,e,WF,VF,ln,{walletConnectService:12})}}function fm(t,e,r){const n=t.slice();return n[2]=e[r],n[4]=r,n}function pm(t){let e,r,n=t[1].SIGNATURES+"",i,a,s,u=t[0],c=[];for(let f=0;f0&&pm(t);return{c(){r&&r.c(),e=so()},m(n,i){r&&r.m(n,i),Gt(n,e,i)},p(n,[i]){n[0].length>0?r?r.p(n,i):(r=pm(n),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:wr,o:wr,d(n){r&&r.d(n),n&&Wt(e)}}}function XF(t,e,r){let n;Ur(t,go,a=>r(1,n=a));let{signatures:i}=e;return t.$$set=a=>{"signatures"in a&&r(0,i=a.signatures)},[i,n]}class QF extends yn{constructor(e){super(),hn(this,e,XF,YF,ln,{signatures:0})}}class Vw extends Error{operationsLength;lastGroupOperation;constructor(e,r){super(),this.operationsLength=e,this.lastGroupOperation=r+1,this.message=`There are fewer operations than the groups says. (${this.operationsLength}) operations | (${this.lastGroupOperation}) operations on the groups`}}class qw extends Error{positions;constructor(e){super(),this.positions=e,this.message=`The groups aren't sorted sequentially [${this.positions}]`}}class JF extends Error{}class sn{props;constructor(e){this.props=e}}class ZF extends sn{constructor(e,r){super({title:"OPERATION_ACCOUNT_MERGE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"DESTINATION",value:r.destination}]})}}class eB extends sn{constructor(e,r){let n;r.authorize===2?n="AUTHORIZED_TO_MAINTAIN_ORDERS":r.authorize?n="AUTHORIZED_TO_TRANSACT":n="NOT_AUTHORIZED_TO_TRANSACT",super({title:r.authorize?"ALLOW_TRUST":"DISALLOW_TRUST",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET",value:r.assetCode},{title:"AUTHORIZATION",value:"",translatedValue:n}]})}}class tB extends sn{constructor(e,r){super({title:"OPERATION_BEGIN_SPONSORING_FUTURE_RESERVES",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SPONSORED_ID",value:r.sponsoredId}]})}}class rB extends sn{constructor(e,r){super({title:"OPERATION_BUMP_SEQUENCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BUMP_TO",value:r.bumpTo}]})}}class nB extends sn{constructor(e,r){let n;r.line instanceof kn.exports.Asset?n=[{title:"ASSET",value:r.line.code}]:n=[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET_A",value:r.line.assetA.code},{title:"ASSET_B",value:r.line.assetB.code}],n.unshift({title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"}),n.push({title:"LIMIT",value:r.limit}),super({title:"OPERATION_CHANGE_TRUST",operationItems:n})}}class oB extends sn{constructor(e,r){super({title:"OPERATION_CLAIM_CLAIMABLE_BALANCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BALANCE_ID",value:r.balanceId}]})}}class iB extends sn{constructor(e,r){super({title:"OPERATION_CLAWBACK",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET",value:r.asset.code},{title:"AMOUNT",value:r.amount},{title:"FROM",value:r.from}]})}}class aB extends sn{constructor(e,r){super({title:"OPERATION_CLAIM_CLAIMABLE_BALANCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BALANCE_ID",value:r.balanceId}]})}}class sB extends sn{constructor(e,r){super({title:"OPERATION_CREATE_ACCOUNT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"DESTINATION",value:r.destination},{title:"STARTING_BALANCE",value:r.startingBalance}]})}}class uB extends sn{constructor(e,r){const n=r.claimants.map(i=>i.destination);super({title:"OPERATION_CREATE_CLAIMABLE_BALANCE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"AMOUNT",value:r.amount},{title:"ASSET",value:r.asset.code},{title:"CLAIMANTS",value:n}]})}}class cB extends sn{constructor(e,r){super({title:"OPERATION_CREATE_PASSIVE_SELL_OFFER",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLING",value:r.selling.code},{title:"BUYING",value:r.buying.code},{title:"AMOUNT",value:r.amount},{title:"PRICE",value:r.price}]})}}class lB extends sn{constructor(e,r){super({title:"OPERATION_END_SPONSORING_FUTURE_RESERVES",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"}]})}}class fB extends sn{constructor(e,r){super({title:"OPERATION_EXTEND_FOOTPRINT_TTL",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"EXTEND_TO",value:r.extendTo}]})}}var Vu=(t=>(t.UploadWasm="Upload Contract WASM",t.InvokeContract="Invoke Contract",t.CreateContract="Create Contract",t))(Vu||{});class pB extends sn{constructor(e,r){const n=r.func.value();let i=Vu.UploadWasm;n instanceof kn.exports.xdr.InvokeContractArgs&&(i=Vu.InvokeContract),n instanceof kn.exports.xdr.CreateContractArgs&&(i=Vu.CreateContract),super({title:"OPERATION_INVOKE_HOST_FUNCTION",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"FUNCTION_TYPE",value:i}]})}}class dB extends sn{constructor(e,r){super({title:"OPERATION_LIQUIDITY_POOL_DEPOSIT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"LIQUIDITY_POOL_ID",value:r.liquidityPoolId},{title:"MAX_AMOUNT_A",value:r.maxAmountA},{title:"MAX_AMOUNT_B",value:r.maxAmountB},{title:"MINIMUM_PRICE",value:r.minPrice},{title:"MAXIMUM_PRICE",value:r.maxPrice}]})}}class hB extends sn{constructor(e,r){super({title:"OPERATION_LIQUIDITY_POOL_WITHDRAW",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"LIQUIDITY_POOL_ID",value:r.liquidityPoolId},{title:"AMOUNT",value:r.amount},{title:"MIN_AMOUNT_A",value:r.minAmountA},{title:"MIN_AMOUNT_B",value:r.minAmountB}]})}}class yB extends sn{constructor(e,r){super({title:"OPERATION_MANAGE_BUY_OFFER",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLING_ASSET",value:r.selling.code},{title:"BUYING_ASSET",value:r.buying.code},{title:"BUY_AMOUNT",value:r.buyAmount},{title:"PRICE",value:r.price},{title:"OFFER_ID",value:r.offerId}]})}}class vB extends sn{constructor(e,r){super({title:"OPERATION_MANAGE_DATA",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"NAME",value:r.name},r.value?{title:"DATA",value:r.value}:void 0]})}}class mB extends sn{constructor(e,r){super({title:"OPERATION_MANAGE_SELL_OFFER",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLING_ASSET",value:r.selling.code},{title:"BUYING_ASSET",value:r.buying.code},{title:"AMOUNT",value:r.amount},{title:"PRICE",value:r.price},{title:"OFFER_ID",value:r.offerId}]})}}class gB extends sn{constructor(e,r){const n=r.path.map(i=>i.code);super({title:"OPERATION_PATH_PAYMENT_STRICT_RECEIVE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET_TO_PAY",value:r.sendAsset.code},{title:"MAX_AMOUNT",value:r.sendMax},{title:"DESTINATION",value:r.destination},{title:"DESTINATION_ASSET",value:r.destAsset.code},{title:"AMOUNT",value:r.destAmount},{title:"PATH",value:n}]})}}class bB extends sn{constructor(e,r){const n=r.path.map(i=>i.code);super({title:"OPERATION_PATH_PAYMENT_STRICT_RECEIVE",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ASSET_TO_PAY",value:r.sendAsset.code},{title:"AMOUNT",value:r.sendAmount},{title:"DESTINATION",value:r.destination},{title:"DESTINATION_ASSET",value:r.destAsset.code},{title:"MINIMUM_AMOUNT_DESTINATION_ASSET",value:r.destMin},{title:"PATH",value:n}]})}}class _B extends sn{constructor(e,r){super({title:"OPERATION_PAYMENT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"AMOUNT",value:r.amount},{title:"ASSET",value:r.asset.code},{title:"DESTINATION",value:r.destination}]})}}class wB extends sn{constructor(e,r){super({title:"OPERATION_RESTORE_FOOTPRINT",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"}]})}}class SB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_ACCOUNT_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account}]})}}class EB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_CLAIMABLE_BALANCE_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"BALANCE_ID",value:r.balanceId}]})}}class OB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_DATA_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account},{title:"NAME",value:r.name}]})}}class AB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_LIQUIDITY_POOL_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"LIQUIDITY_POOL_ID",value:r.liquidityPoolId}]})}}class TB extends sn{constructor(e,r){super({title:"OPERATION_REVOKE_OFFER_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"SELLER",value:r.seller},{title:"OFFER_ID",value:r.offerId}]})}}class xB extends Error{}function PB(t){if("ed25519PublicKey"in t)return t.ed25519PublicKey;if("sha256Hash"in t)return typeof t.sha256Hash=="string"?t.sha256Hash:kn.exports.StrKey.encodeSha256Hash(t.sha256Hash);if("preAuthTx"in t)return typeof t.preAuthTx=="string"?t.preAuthTx:kn.exports.StrKey.encodePreAuthTx(t.preAuthTx);throw new xB}class IB extends sn{constructor(e,r){const n=PB(r.signer);super({title:"OPERATION_REVOKE_SIGNER_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account},{title:"SIGNER",value:n}]})}}class kB extends sn{constructor(e,r){let n;r.asset instanceof kn.exports.Asset?n=r.asset.code:n=r.asset,super({title:"OPERATION_REVOKE_TRUSTLINE_SPONSORSHIP",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"ACCOUNT",value:r.account},{title:"ASSET",value:n}]})}}function RB(t){if(t.signer)return"ed25519PublicKey"in t.signer?[t.signer.ed25519PublicKey,t.signer.weight?"1":"0"]:"sha256Hash"in t.signer?[`sha256Hash: ${kn.exports.StrKey.encodeSha256Hash(t.signer.sha256Hash)}`,t.signer.weight?"1":"0"]:"preAuthTx"in t.signer?[`preAuthTx: ${kn.exports.StrKey.encodePreAuthTx(t.signer.preAuthTx)}`,t.signer.weight?"1":"0"]:void 0}class CB extends sn{constructor(e,r){const n=RB(r);super({title:"OPERATION_SET_OPTIONS",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},r.inflationDest?{title:"DESTINATION_INFLATION",value:r.inflationDest}:void 0,r.clearFlags?{title:"CLEAR_FLAGS",value:r.clearFlags}:void 0,r.setFlags?{title:"SET_FLAGS",value:r.setFlags}:void 0,r.masterWeight?{title:"MASTER_WEIGHT",value:r.masterWeight}:void 0,r.lowThreshold?{title:"LOW_THRESHOLD",value:r.lowThreshold}:void 0,r.medThreshold?{title:"MEDIUM_THRESHOLD",value:r.medThreshold}:void 0,r.highThreshold?{title:"HIGH_THRESHOLD",value:r.highThreshold}:void 0,r.homeDomain?{title:"HOME_DOMAIN",value:r.homeDomain}:void 0,n?{title:"SIGNER",value:n,highlightTxDescription:"WARNING_TX_DESCRIPTION"}:void 0]})}}class NB extends sn{constructor(e,r){super({title:"OPERATION_SET_TRUSTLINE_FLAGS",operationItems:[{title:"SOURCE_ACCOUNT",value:r.source||e.source,translatedValue:"YOUR_ACCOUNT"},{title:"TRUSTOR",value:r.trustor},{title:"ASSET",value:r.asset.code},{title:"IS_AUTHORIZED",value:r.flags.authorized?"True":"False"},{title:"IS_AUTHORIZED_TO_MAINTAIN_LIABILITIES",value:r.flags.authorizedToMaintainLiabilities?"True":"False"},{title:"IS_CLAWBACK_ENABLED",value:r.flags.clawbackEnabled?"True":"False"}]})}}class jB{create(e,r){let n;switch(r.type){case"payment":n=new _B(e,r);break;case"createAccount":n=new sB(e,r);break;case"beginSponsoringFutureReserves":n=new tB(e,r);break;case"pathPaymentStrictSend":n=new bB(e,r);break;case"pathPaymentStrictReceive":n=new gB(e,r);break;case"manageBuyOffer":n=new yB(e,r);break;case"manageSellOffer":n=new mB(e,r);break;case"createPassiveSellOffer":n=new cB(e,r);break;case"setOptions":n=new CB(e,r);break;case"changeTrust":n=new nB(e,r);break;case"accountMerge":n=new ZF(e,r);break;case"manageData":n=new vB(e,r);break;case"bumpSequence":n=new rB(e,r);break;case"createClaimableBalance":n=new uB(e,r);break;case"endSponsoringFutureReserves":n=new lB(e,r);break;case"revokeAccountSponsorship":n=new SB(e,r);break;case"revokeClaimableBalanceSponsorship":n=new EB(e,r);break;case"revokeDataSponsorship":n=new OB(e,r);break;case"revokeLiquidityPoolSponsorship":n=new AB(e,r);break;case"revokeOfferSponsorship":n=new TB(e,r);break;case"revokeSignerSponsorship":n=new IB(e,r);break;case"allowTrust":n=new eB(e,r);break;case"claimClaimableBalance":n=new oB(e,r);break;case"clawback":n=new iB(e,r);break;case"setTrustLineFlags":n=new NB(e,r);break;case"liquidityPoolDeposit":n=new dB(e,r);break;case"liquidityPoolWithdraw":n=new hB(e,r);break;case"revokeTrustlineSponsorship":n=new kB(e,r);break;case"clawbackClaimableBalance":n=new aB(e,r);break;case"invokeHostFunction":n=new pB(e,r);break;case"restoreFootprint":n=new wB(e,r);break;case"extendFootprintTtl":n=new fB(e,r);break}if(n)return n;throw new JF}}const Nu=Sn(!1),ws=Sn(!1),hm=Sn(!1),ju=Sn([]);function ym(t,e,r){const n=t.slice();return n[5]=e[r],n[7]=r,n}function vm(t,e,r){const n=t.slice();return n[8]=e[r],n}function mm(t){let e,r,n=t[3][t[5].title]+"",i,a,s,u,c;function f(p,d){return d&1&&(s=null),s==null&&(s=!!Array.isArray(p[5].value)),s?MB:LB}let l=f(t,-1),o=l(t),w=t[5].highlightTxDescription!=null&&bm(t);return{c(){e=Ct("div"),r=Ct("p"),i=pr(n),a=hr(),o.c(),u=hr(),w&&w.c(),c=hr(),Ve(r,"class","simple-signer operation-info-title"),Ve(e,"class","simple-signer operation-info")},m(p,d){Gt(p,e,d),nt(e,r),nt(r,i),nt(e,a),o.m(e,null),nt(e,u),w&&w.m(e,null),nt(e,c)},p(p,d){d&9&&n!==(n=p[3][p[5].title]+"")&&br(i,n),l===(l=f(p,d))&&o?o.p(p,d):(o.d(1),o=l(p),o&&(o.c(),o.m(e,u))),p[5].highlightTxDescription!=null?w?w.p(p,d):(w=bm(p),w.c(),w.m(e,c)):w&&(w.d(1),w=null)},d(p){p&&Wt(e),o.d(),w&&w.d()}}}function LB(t){let e,r=(t[5].translatedValue?t[3][t[5].translatedValue]:t[5].value)+"",n,i,a,s=t[7]===wm&&DB(t);return{c(){e=Ct("p"),n=pr(r),i=hr(),s&&s.c(),a=so(),Ve(e,"class","simple-signer break-key svelte-ve2qp2")},m(u,c){Gt(u,e,c),nt(e,n),Gt(u,i,c),s&&s.m(u,c),Gt(u,a,c)},p(u,c){c&9&&r!==(r=(u[5].translatedValue?u[3][u[5].translatedValue]:u[5].value)+"")&&br(n,r),u[7]===wm&&s.p(u,c)},d(u){u&&Wt(e),u&&Wt(i),s&&s.d(u),u&&Wt(a)}}}function MB(t){let e,r=t[5].value,n=[];for(let i=0;ir(2,n=c)),Ur(t,go,c=>r(3,i=c));let{operationItems:a}=e,{shortedSourceAccount:s}=e;function u(){dn(ws,n=!n,n)}return t.$$set=c=>{"operationItems"in c&&r(0,a=c.operationItems),"shortedSourceAccount"in c&&r(1,s=c.shortedSourceAccount)},[a,s,n,i,u]}class zw extends yn{constructor(e){super(),hn(this,e,FB,UB,ln,{operationItems:0,shortedSourceAccount:1})}}function Sm(t,e,r){const n=t.slice();return n[4]=e[r],n}function Em(t){let e,r,n,i=t[3][t[4].props.title]+"",a,s,u,c;return u=new zw({props:{shortedSourceAccount:t[2],operationItems:t[4].props.operationItems}}),{c(){e=Ct("ul"),r=Ct("li"),n=Ct("span"),a=pr(i),s=hr(),Xr(u.$$.fragment),Ve(n,"class","simple-signer operation-title-head operation-info-title svelte-1nq74ua"),Ve(r,"class","svelte-1nq74ua"),Ve(e,"class","svelte-1nq74ua")},m(f,l){Gt(f,e,l),nt(e,r),nt(r,n),nt(n,a),Gt(f,s,l),Gr(u,f,l),c=!0},p(f,l){(!c||l&10)&&i!==(i=f[3][f[4].props.title]+"")&&br(a,i);const o={};l&4&&(o.shortedSourceAccount=f[2]),l&2&&(o.operationItems=f[4].props.operationItems),u.$set(o)},i(f){c||(dr(u.$$.fragment,f),c=!0)},o(f){mr(u.$$.fragment,f),c=!1},d(f){f&&Wt(e),f&&Wt(s),Yr(u,f)}}}function BB(t){let e,r,n,i,a,s,u=t[1],c=[];for(let l=0;lmr(c[l],1,1,()=>{c[l]=null});return{c(){e=Ct("div"),r=Ct("div"),n=Ct("p"),i=pr(t[0]),a=hr();for(let l=0;lr(3,n=u));let{description:i}=e,{operationComponents:a}=e,{shortedSourceAccount:s}=e;return t.$$set=u=>{"description"in u&&r(0,i=u.description),"operationComponents"in u&&r(1,a=u.operationComponents),"shortedSourceAccount"in u&&r(2,s=u.shortedSourceAccount)},[i,a,s,n]}class VB extends yn{constructor(e){super(),hn(this,e,$B,BB,ln,{description:0,operationComponents:1,shortedSourceAccount:2})}}function qB(t,e){const r=e.map(a=>[...new Array(a.to-a.from+1).keys()].map(s=>a.from+s)).flat();if([...r].sort((a,s)=>a-s).join()!==r.join())throw new qw(r.join());const n=e[e.length-1],i=[];if(n&&!t[n.to])throw new Vw(t.length,n.to);{let a=0;for(let s=0;s=e[s].from&&fe===!0)}function HB(t){return t.every(e=>e===!1)}function Om(t,e,r){const n=t.slice();return n[26]=e[r],n[28]=r,n}function WB(t){let e,r=t[11].ERROR+"",n,i,a,s,u=t[11].XDR_INVALID+"",c,f,l,o,w=t[11].CLOSE+"",p,d,S;return{c(){e=Ct("h1"),n=pr(r),i=hr(),a=Ct("div"),s=Ct("p"),c=pr(u),f=hr(),l=Ct("div"),o=Ct("button"),p=pr(w),Ve(e,"class","simple-signer error-title svelte-baj9kn"),Ve(s,"class","simple-signer xdr-invalid svelte-baj9kn"),Ve(o,"class","simple-signer sign-tx-button svelte-baj9kn"),Ve(l,"class","simple-signer close-button svelte-baj9kn"),Ve(a,"class","simple-signer information-container svelte-baj9kn")},m(v,O){Gt(v,e,O),nt(e,n),Gt(v,i,O),Gt(v,a,O),nt(a,s),nt(s,c),nt(a,f),nt(a,l),nt(l,o),nt(o,p),d||(S=Cn(o,"click",t[20]),d=!0)},p(v,O){O&2048&&r!==(r=v[11].ERROR+"")&&br(n,r),O&2048&&u!==(u=v[11].XDR_INVALID+"")&&br(c,u),O&2048&&w!==(w=v[11].CLOSE+"")&&br(p,w)},i:wr,o:wr,d(v){v&&Wt(e),v&&Wt(i),v&&Wt(a),d=!1,S()}}}function GB(t){let e,r=t[11].SIGN+"",n,i,a,s,u,c,f,l,o=t[3]&&Am(t),w=t[0].description&&Tm(t);const p=[XB,YB],d=[];function S(v,O){return v[2]?0:1}return u=S(t),c=d[u]=p[u](t),{c(){e=Ct("h1"),n=pr(r),i=hr(),o&&o.c(),a=hr(),w&&w.c(),s=hr(),c.c(),f=so(),Ve(e,"class","simple-signer tx-title svelte-baj9kn")},m(v,O){Gt(v,e,O),nt(e,n),Gt(v,i,O),o&&o.m(v,O),Gt(v,a,O),w&&w.m(v,O),Gt(v,s,O),d[u].m(v,O),Gt(v,f,O),l=!0},p(v,O){(!l||O&2048)&&r!==(r=v[11].SIGN+"")&&br(n,r),v[3]?o?o.p(v,O):(o=Am(v),o.c(),o.m(a.parentNode,a)):o&&(o.d(1),o=null),v[0].description?w?w.p(v,O):(w=Tm(v),w.c(),w.m(s.parentNode,s)):w&&(w.d(1),w=null);let h=u;u=S(v),u===h?d[u].p(v,O):(Dn(),mr(d[h],1,1,()=>{d[h]=null}),Un(),c=d[u],c?c.p(v,O):(c=d[u]=p[u](v),c.c()),dr(c,1),c.m(f.parentNode,f))},i(v){l||(dr(c),l=!0)},o(v){mr(c),l=!1},d(v){v&&Wt(e),v&&Wt(i),o&&o.d(v),v&&Wt(a),w&&w.d(v),v&&Wt(s),d[u].d(v),v&&Wt(f)}}}function Am(t){let e,r=t[11].FEE_BUMP+"",n;return{c(){e=Ct("h2"),n=pr(r),Ve(e,"class","simple-signer tx-title svelte-baj9kn")},m(i,a){Gt(i,e,a),nt(e,n)},p(i,a){a&2048&&r!==(r=i[11].FEE_BUMP+"")&&br(n,r)},d(i){i&&Wt(e)}}}function Tm(t){let e,r,n=t[0].description+"",i;return{c(){e=Ct("div"),r=Ct("p"),i=pr(n),Ve(r,"class","simple-signer tx-description-text svelte-baj9kn"),Ve(e,"class","simple-signer tx-description-container")},m(a,s){Gt(a,e,s),nt(e,r),nt(r,i)},p(a,s){s&1&&n!==(n=a[0].description+"")&&br(i,n)},d(a){a&&Wt(e)}}}function YB(t){let e,r=t[11].USER_IS_NOT_CONNECTED+"",n,i,a,s,u;return s=new xa({props:{to:"/connect",$$slots:{default:[QB]},$$scope:{ctx:t}}}),{c(){e=Ct("p"),n=pr(r),i=hr(),a=Ct("button"),Xr(s.$$.fragment),Ve(e,"class","simple-signer user-not-connected svelte-baj9kn"),Ve(a,"class","simple-signer connect-btn")},m(c,f){Gt(c,e,f),nt(e,n),Gt(c,i,f),Gt(c,a,f),Gr(s,a,null),u=!0},p(c,f){(!u||f&2048)&&r!==(r=c[11].USER_IS_NOT_CONNECTED+"")&&br(n,r);const l={};f&536872960&&(l.$$scope={dirty:f,ctx:c}),s.$set(l)},i(c){u||(dr(s.$$.fragment,c),u=!0)},o(c){mr(s.$$.fragment,c),u=!1},d(c){c&&Wt(e),c&&Wt(i),c&&Wt(a),Yr(s)}}}function XB(t){let e,r,n,i,a=t[11].NETWORK+"",s,u,c,f,l,o,w,p,d=t[11].SEQUENCE_NUMBER+"",S,v,O=(t[4]?t[4].sequence:"")+"",h,g,A,m,x=t[11].SOURCE_ACCOUNT+"",y,_,L,b=(t[10]?t[4].source:t[7])+"",T,I,k,N,C,D,X,ae,K,z=t[11].OPERATIONS_LIST+"",H,E,F,J,Q=(t[9]?t[11].HIDE_ALL:t[11].EXPAND_ALL)+"",fe,Z,pe,ge,j,te,ye,_e,Ye,Ke=t[11].NETWORK_FEE+"",Me,Ue,Ce,Ne=km(t[3]?t[3].fee:t[4].fee)+"",ze,yt,Qe,R,q,M,ee=t[11].CANCEL+"",ce,P,B,G=t[11].CONFIRM+"",U,Y,oe,ve,Ie=t[3]&&xm(t);k=new QF({props:{signatures:t[4].signatures}});let vt=t[6],wt=[];for(let Lt=0;Ltmr(wt[Lt],1,1,()=>{wt[Lt]=null});let jt=t[4].memo.value&&Im(t);return{c(){e=Ct("div"),Ie&&Ie.c(),r=hr(),n=Ct("div"),i=Ct("p"),s=pr(a),u=pr(":"),c=pr(` \xA0 - `),f=Ct("p"),l=hr(t[5]),o=pr(),w=Ct("div"),p=Ct("p"),S=hr(d),v=pr(),h=hr(O),g=pr(),A=Ct("div"),m=Ct("p"),y=hr(x),_=pr(),L=Ct("span"),T=hr(b),I=pr(),Xr(k.$$.fragment),N=pr(),C=Ct("hr"),D=pr(),X=Ct("div"),ae=Ct("div"),K=Ct("h1"),H=hr(z),E=pr(),F=Ct("button"),J=Ct("span"),fe=hr(Q),Z=pr(),pe=Ct("div");for(let Lt=0;Lt{L[k]=null}),Un(),v=L[S],v?v.p(t,I):(v=L[S]=_[S](t),v.c()),dr(v,1),v.m(d,null)),(!A||I&2&&O!==(O="simple-signer tx-operation-container "+(t[1][t[28]]?"show-operation":"")+" svelte-baj9kn"))&&Ve(d,"class",O),(!A||I&2&&g!==(g="simple-signer operation-border "+(t[1][t[28]]?"operation-show-margin":"")+" svelte-baj9kn"))&&Ve(p,"class",g)},i(T){A||(dr(v),A=!0)},o(T){mr(v),A=!1},d(T){T&&Wt(e),T&&Wt(w),T&&Wt(p),L[S].d(),m=!1,x()}}}function Im(t){let e,r,n,i,a=t[4].memo.value+"",s;return{c(){e=Ct("div"),r=Ct("p"),r.textContent="Memo:",n=hr(` + `),Ce=Ct("p"),ze=pr(Ne),yt=pr(" XLM"),Qe=hr(),jt&&jt.c(),R=hr(),q=Ct("div"),M=Ct("button"),ce=pr(ee),P=hr(),B=Ct("button"),U=pr(G),Ve(i,"class","svelte-baj9kn"),Ve(f,"class","simple-signer tx-network-text svelte-baj9kn"),Ve(n,"class","simple-signer tx-network-container svelte-baj9kn"),Ve(p,"class","sequence-number svelte-baj9kn"),Ve(w,"class","simple-signer tx-sequence-number svelte-baj9kn"),Ve(L,"class","simple-signer user-publickey svelte-baj9kn"),Ve(m,"class","simple-signer source-account svelte-baj9kn"),Ve(A,"class","simple-signer tx-source-account svelte-baj9kn"),Ve(e,"class","simple-signer tx-data-container svelte-baj9kn"),Ve(C,"class","simple-signer tx-separator svelte-baj9kn"),Ve(K,"class","simple-signer tx-operation-list-title svelte-baj9kn"),Ve(J,"class","svelte-baj9kn"),Ve(F,"class","simple-signer expand-all-button svelte-baj9kn"),Ve(ae,"class","operation-list-title-container svelte-baj9kn"),Ve(pe,"class","simple-signer operation-list-container svelte-baj9kn"),Ve(X,"class","simple-signer operations-container svelte-baj9kn"),Ve(j,"class","simple-signer tx-separator svelte-baj9kn"),Ve(Ye,"class","simple-signer operation-info-title bottom-info-title svelte-baj9kn"),Ve(Ce,"class","simple-signer bottom-info-paragraph svelte-baj9kn"),Ve(_e,"class","simple-signer tx-fee-container svelte-baj9kn"),Ve(ye,"class","simple-signer bottom-info-container svelte-baj9kn"),Ve(M,"class","simple-signer cancel-button svelte-baj9kn"),Ve(B,"class","simple-signer sign-tx-button svelte-baj9kn"),Ve(q,"class","simple-signer confirmation-buttons svelte-baj9kn")},m(Lt,de){Gt(Lt,e,de),Ie&&Ie.m(e,null),nt(e,r),nt(e,n),nt(n,i),nt(i,s),nt(i,u),nt(n,c),nt(n,f),nt(f,l),nt(e,o),nt(e,w),nt(w,p),nt(p,S),nt(p,v),nt(p,h),nt(e,g),nt(e,A),nt(A,m),nt(m,y),nt(m,_),nt(m,L),nt(L,T),Gt(Lt,I,de),Gr(k,Lt,de),Gt(Lt,N,de),Gt(Lt,C,de),Gt(Lt,D,de),Gt(Lt,X,de),nt(X,ae),nt(ae,K),nt(K,H),nt(ae,E),nt(ae,F),nt(F,J),nt(J,fe),nt(X,Z),nt(X,pe);for(let xe=0;xe{L[k]=null}),Un(),v=L[S],v?v.p(t,I):(v=L[S]=_[S](t),v.c()),dr(v,1),v.m(d,null)),(!A||I&2&&O!==(O="simple-signer tx-operation-container "+(t[1][t[28]]?"show-operation":"")+" svelte-baj9kn"))&&Ve(d,"class",O),(!A||I&2&&g!==(g="simple-signer operation-border "+(t[1][t[28]]?"operation-show-margin":"")+" svelte-baj9kn"))&&Ve(p,"class",g)},i(T){A||(dr(v),A=!0)},o(T){mr(v),A=!1},d(T){T&&Wt(e),T&&Wt(w),T&&Wt(p),L[S].d(),m=!1,x()}}}function Im(t){let e,r,n,i,a=t[4].memo.value+"",s;return{c(){e=Ct("div"),r=Ct("p"),r.textContent="Memo:",n=pr(` \xA0 - `),i=Ct("p"),s=hr(a),Ve(r,"class","simple-signer operation-info-title bottom-info-title svelte-baj9kn"),Ve(i,"class","simple-signer bottom-info-paragraph svelte-baj9kn"),Ve(e,"class","simple-signer memo-container svelte-baj9kn")},m(u,c){Gt(u,e,c),nt(e,r),nt(e,n),nt(e,i),nt(i,s)},p(u,c){c&16&&a!==(a=u[4].memo.value+"")&&br(s,a)},d(u){u&&Wt(e)}}}function e$(t){let e,r,n,i;const a=[GB,WB],s=[];function u(c,f){return c[8]?0:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,[f]){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}function km(t){return Number(t)/1e7}function t$(t,e,r){let n,i,a,s,u;Ur(t,ju,k=>r(1,n=k)),Ur(t,Nu,k=>r(9,i=k)),Ur(t,hm,k=>r(10,a=k)),Ur(t,ws,k=>r(22,s=k)),Ur(t,go,k=>r(11,u=k));let{transactionMessage:c}=e,{walletConnectService:f}=e;const l=new Es,o=nc(),w=l.getItem("wallet"),p=new Gd;let d,S,v,O,h=[],g=[],A,m=!1;w&&(w===yi.NAME?d=p.createWalletConnect(f):d=p.create(w));function x(k){dn(ju,n[k]=!n[k],n),dn(ws,s=!1,s)}function y(){dn(Nu,i=!i,i),dn(ju,n=n.map(()=>i),n),dn(ws,s=!1,s)}function _(){dn(hm,a=!a,a)}try{m=kn.exports.xdr.TransactionEnvelope.validateXDR(c.xdr,"base64");const k=kn.exports.TransactionBuilder.fromXDR(c.xdr,J1);k instanceof kn.exports.FeeBumpTransaction?(S=k,v=k.innerTransaction):v=k,O=Ti,A=zB(v.source);const N=new jB;h=v.operations.map(C=>N.create(v,C)),c.operationGroups&&c.operationGroups.length>0?g=qB(h,c.operationGroups):(console.info("A transaction group object wasn't provided"),g=h)}catch(k){console.error(k),(k instanceof qw||Vw)&&(g=h)}dn(ju,n=g.map(()=>!1),n);const L=k=>{x(k)},b=()=>o("cancel"),T=async()=>o("confirm",await d.sign(S||v)),I=()=>o("cancel");return t.$$set=k=>{"transactionMessage"in k&&r(0,c=k.transactionMessage),"walletConnectService"in k&&r(16,f=k.walletConnectService)},t.$$.update=()=>{t.$$.dirty&2&&(HB(n)?dn(Nu,i=!1,i):KB(n)&&dn(Nu,i=!0,i))},[c,n,d,S,v,O,g,A,m,i,a,u,o,x,y,_,f,L,b,T,I]}class r$ extends yn{constructor(e){super(),hn(this,e,t$,e$,ln,{transactionMessage:0,walletConnectService:16})}}const dp=Sn({});function n$(t){let e,r=t[2].ERROR+"",n,i,a,s,u=t[2].XDR_NOT_PROVIDED+"",c,f,l,o,w=t[2].CLOSE+"",p,d,S;return{c(){e=Ct("h1"),n=hr(r),i=pr(),a=Ct("div"),s=Ct("p"),c=hr(u),f=pr(),l=Ct("div"),o=Ct("button"),p=hr(w),Ve(e,"class","simple-signer error-title svelte-1fufh79"),Ve(s,"class","simple-signer xdr-not-provided svelte-1fufh79"),Ve(o,"class","simple-signer sign-tx-button svelte-1fufh79"),Ve(l,"class","simple-signer close-button svelte-1fufh79"),Ve(a,"class","simple-signer information-container svelte-1fufh79")},m(v,O){Gt(v,e,O),nt(e,n),Gt(v,i,O),Gt(v,a,O),nt(a,s),nt(s,c),nt(a,f),nt(a,l),nt(l,o),nt(o,p),d||(S=Cn(o,"click",t[3]),d=!0)},p(v,O){O&4&&r!==(r=v[2].ERROR+"")&&br(n,r),O&4&&u!==(u=v[2].XDR_NOT_PROVIDED+"")&&br(c,u),O&4&&w!==(w=v[2].CLOSE+"")&&br(p,w)},i:wr,o:wr,d(v){v&&Wt(e),v&&Wt(i),v&&Wt(a),d=!1,S()}}}function o$(t){let e,r;return e=new r$({props:{transactionMessage:t[1],walletConnectService:t[0]}}),e.$on("cancel",t[3]),e.$on("confirm",t[4]),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&2&&(a.transactionMessage=n[1]),i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function i$(t){let e,r,n,i,a;const s=[o$,n$],u=[];function c(f,l){return f[1]?.xdr?0:f[1].xdr?-1:1}return~(n=c(t))&&(i=u[n]=s[n](t)),{c(){e=Ct("div"),r=Ct("div"),i&&i.c(),Ve(r,"class","simple-signer tx-container svelte-1fufh79"),Ve(e,"class","simple-signer sign-container svelte-1fufh79")},m(f,l){Gt(f,e,l),nt(e,r),~n&&u[n].m(r,null),a=!0},p(f,[l]){let o=n;n=c(f),n===o?~n&&u[n].p(f,l):(i&&(Dn(),mr(u[o],1,1,()=>{u[o]=null}),Un()),~n?(i=u[n],i?i.p(f,l):(i=u[n]=s[n](f),i.c()),dr(i,1),i.m(r,null)):i=null)},i(f){a||(dr(i),a=!0)},o(f){mr(i),a=!1},d(f){f&&Wt(e),~n&&u[n].d()}}}const a$=570,s$=360,u$=570,c$=360;function l$(t,e,r){let n,i;Ur(t,dp,l=>r(1,n=l)),Ur(t,go,l=>r(2,i=l));let{walletConnectService:a}=e;const s=new Md(Wi.SIGN),u=s.getTransactionMessageFromUrl();u?dn(dp,n=u,n):s.addTransactionMessageHandler(l=>{dn(dp,n=l,n)});function c(){s.sendOnCancelEvent()}function f(l){const o=l.detail;s.sendSignedTx(o)}return s.sendOnReadyEvent(),Dd(a$,s$,u$,c$),t.$$set=l=>{"walletConnectService"in l&&r(0,a=l.walletConnectService)},[a,n,i,c,f]}class f$ extends yn{constructor(e){super(),hn(this,e,l$,i$,ln,{walletConnectService:0})}}function Rm(t){let e,r;return e=new r0({props:{primary:!1,$$slots:{default:[p$]},$$scope:{ctx:t}}}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&17&&(a.$$scope={dirty:i,ctx:n}),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function p$(t){let e,r,n,i,a,s,u,c,f,l,o;return r=new CS({props:{walletConnectService:t[0]}}),i=new Eu({props:{path:"/",component:j4}}),s=new Eu({props:{path:"/connect",component:kF,walletConnectService:t[0]}}),c=new Eu({props:{path:"/sign",component:f$,walletConnectService:t[0]}}),l=new Eu({props:{path:"/payment",component:GF,walletConnectService:t[0]}}),{c(){e=Ct("main"),Xr(r.$$.fragment),n=pr(),Xr(i.$$.fragment),a=pr(),Xr(s.$$.fragment),u=pr(),Xr(c.$$.fragment),f=pr(),Xr(l.$$.fragment)},m(w,p){Gt(w,e,p),Gr(r,e,null),nt(e,n),Gr(i,e,null),nt(e,a),Gr(s,e,null),nt(e,u),Gr(c,e,null),nt(e,f),Gr(l,e,null),o=!0},p(w,p){const d={};p&1&&(d.walletConnectService=w[0]),r.$set(d);const S={};p&1&&(S.walletConnectService=w[0]),s.$set(S);const v={};p&1&&(v.walletConnectService=w[0]),c.$set(v);const O={};p&1&&(O.walletConnectService=w[0]),l.$set(O)},i(w){o||(dr(r.$$.fragment,w),dr(i.$$.fragment,w),dr(s.$$.fragment,w),dr(c.$$.fragment,w),dr(l.$$.fragment,w),o=!0)},o(w){mr(r.$$.fragment,w),mr(i.$$.fragment,w),mr(s.$$.fragment,w),mr(c.$$.fragment,w),mr(l.$$.fragment,w),o=!1},d(w){w&&Wt(e),Yr(r),Yr(i),Yr(s),Yr(c),Yr(l)}}}function d$(t){let e,r,n=t[1]&&!t[2]&&Rm(t);return{c(){n&&n.c(),e=so()},m(i,a){n&&n.m(i,a),Gt(i,e,a),r=!0},p(i,[a]){i[1]&&!i[2]?n?(n.p(i,a),a&6&&dr(n,1)):(n=Rm(i),n.c(),dr(n,1),n.m(e.parentNode,e)):n&&(Dn(),mr(n,1,1,()=>{n=null}),Un())},i(i){r||(dr(n),r=!0)},o(i){mr(n),r=!1},d(i){n&&n.d(i),i&&Wt(e)}}}function h$(t,e,r){let n,i,a;Ur(t,dh,u=>r(3,n=u)),Ur(t,X1,u=>r(1,i=u)),Ur(t,Q1,u=>r(2,a=u));let s;return jm(async()=>{n?r(0,s=new Cy(n)):(r(0,s=new Cy),dn(dh,n=await s.createClient(),n))}),[s,i,a]}class y$ extends yn{constructor(e){super(),hn(this,e,h$,d$,ln,{})}}new y$({target:document.getElementById("app")});export{YS as R,Z1 as T,ao as a,Th as n,m$ as o,Uo as p,qf as s,v$ as t,La as y}; + `),i=Ct("p"),s=pr(a),Ve(r,"class","simple-signer operation-info-title bottom-info-title svelte-baj9kn"),Ve(i,"class","simple-signer bottom-info-paragraph svelte-baj9kn"),Ve(e,"class","simple-signer memo-container svelte-baj9kn")},m(u,c){Gt(u,e,c),nt(e,r),nt(e,n),nt(e,i),nt(i,s)},p(u,c){c&16&&a!==(a=u[4].memo.value+"")&&br(s,a)},d(u){u&&Wt(e)}}}function e$(t){let e,r,n,i;const a=[GB,WB],s=[];function u(c,f){return c[8]?0:1}return e=u(t),r=s[e]=a[e](t),{c(){r.c(),n=so()},m(c,f){s[e].m(c,f),Gt(c,n,f),i=!0},p(c,[f]){let l=e;e=u(c),e===l?s[e].p(c,f):(Dn(),mr(s[l],1,1,()=>{s[l]=null}),Un(),r=s[e],r?r.p(c,f):(r=s[e]=a[e](c),r.c()),dr(r,1),r.m(n.parentNode,n))},i(c){i||(dr(r),i=!0)},o(c){mr(r),i=!1},d(c){s[e].d(c),c&&Wt(n)}}}function km(t){return Number(t)/1e7}function t$(t,e,r){let n,i,a,s,u;Ur(t,ju,k=>r(1,n=k)),Ur(t,Nu,k=>r(9,i=k)),Ur(t,hm,k=>r(10,a=k)),Ur(t,ws,k=>r(22,s=k)),Ur(t,go,k=>r(11,u=k));let{transactionMessage:c}=e,{walletConnectService:f}=e;const l=new Es,o=nc(),w=l.getItem("wallet"),p=new Gd;let d,S,v,O,h=[],g=[],A,m=!1;w&&(w===yi.NAME?d=p.createWalletConnect(f):d=p.create(w));function x(k){dn(ju,n[k]=!n[k],n),dn(ws,s=!1,s)}function y(){dn(Nu,i=!i,i),dn(ju,n=n.map(()=>i),n),dn(ws,s=!1,s)}function _(){dn(hm,a=!a,a)}try{m=kn.exports.xdr.TransactionEnvelope.validateXDR(c.xdr,"base64");const k=kn.exports.TransactionBuilder.fromXDR(c.xdr,J1);k instanceof kn.exports.FeeBumpTransaction?(S=k,v=k.innerTransaction):v=k,O=Ti,A=zB(v.source);const N=new jB;h=v.operations.map(C=>N.create(v,C)),c.operationGroups&&c.operationGroups.length>0?g=qB(h,c.operationGroups):(console.info("A transaction group object wasn't provided"),g=h)}catch(k){console.error(k),(k instanceof qw||Vw)&&(g=h)}dn(ju,n=g.map(()=>!1),n);const L=k=>{x(k)},b=()=>o("cancel"),T=async()=>o("confirm",await d.sign(S||v)),I=()=>o("cancel");return t.$$set=k=>{"transactionMessage"in k&&r(0,c=k.transactionMessage),"walletConnectService"in k&&r(16,f=k.walletConnectService)},t.$$.update=()=>{t.$$.dirty&2&&(HB(n)?dn(Nu,i=!1,i):KB(n)&&dn(Nu,i=!0,i))},[c,n,d,S,v,O,g,A,m,i,a,u,o,x,y,_,f,L,b,T,I]}class r$ extends yn{constructor(e){super(),hn(this,e,t$,e$,ln,{transactionMessage:0,walletConnectService:16})}}const dp=Sn({});function n$(t){let e,r=t[2].ERROR+"",n,i,a,s,u=t[2].XDR_NOT_PROVIDED+"",c,f,l,o,w=t[2].CLOSE+"",p,d,S;return{c(){e=Ct("h1"),n=pr(r),i=hr(),a=Ct("div"),s=Ct("p"),c=pr(u),f=hr(),l=Ct("div"),o=Ct("button"),p=pr(w),Ve(e,"class","simple-signer error-title svelte-1fufh79"),Ve(s,"class","simple-signer xdr-not-provided svelte-1fufh79"),Ve(o,"class","simple-signer sign-tx-button svelte-1fufh79"),Ve(l,"class","simple-signer close-button svelte-1fufh79"),Ve(a,"class","simple-signer information-container svelte-1fufh79")},m(v,O){Gt(v,e,O),nt(e,n),Gt(v,i,O),Gt(v,a,O),nt(a,s),nt(s,c),nt(a,f),nt(a,l),nt(l,o),nt(o,p),d||(S=Cn(o,"click",t[3]),d=!0)},p(v,O){O&4&&r!==(r=v[2].ERROR+"")&&br(n,r),O&4&&u!==(u=v[2].XDR_NOT_PROVIDED+"")&&br(c,u),O&4&&w!==(w=v[2].CLOSE+"")&&br(p,w)},i:wr,o:wr,d(v){v&&Wt(e),v&&Wt(i),v&&Wt(a),d=!1,S()}}}function o$(t){let e,r;return e=new r$({props:{transactionMessage:t[1],walletConnectService:t[0]}}),e.$on("cancel",t[3]),e.$on("confirm",t[4]),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&2&&(a.transactionMessage=n[1]),i&1&&(a.walletConnectService=n[0]),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function i$(t){let e,r,n,i,a;const s=[o$,n$],u=[];function c(f,l){return f[1]?.xdr?0:f[1].xdr?-1:1}return~(n=c(t))&&(i=u[n]=s[n](t)),{c(){e=Ct("div"),r=Ct("div"),i&&i.c(),Ve(r,"class","simple-signer tx-container svelte-1fufh79"),Ve(e,"class","simple-signer sign-container svelte-1fufh79")},m(f,l){Gt(f,e,l),nt(e,r),~n&&u[n].m(r,null),a=!0},p(f,[l]){let o=n;n=c(f),n===o?~n&&u[n].p(f,l):(i&&(Dn(),mr(u[o],1,1,()=>{u[o]=null}),Un()),~n?(i=u[n],i?i.p(f,l):(i=u[n]=s[n](f),i.c()),dr(i,1),i.m(r,null)):i=null)},i(f){a||(dr(i),a=!0)},o(f){mr(i),a=!1},d(f){f&&Wt(e),~n&&u[n].d()}}}const a$=570,s$=360,u$=570,c$=360;function l$(t,e,r){let n,i;Ur(t,dp,l=>r(1,n=l)),Ur(t,go,l=>r(2,i=l));let{walletConnectService:a}=e;const s=new Md(Wi.SIGN),u=s.getTransactionMessageFromUrl();u?dn(dp,n=u,n):s.addTransactionMessageHandler(l=>{dn(dp,n=l,n)});function c(){s.sendOnCancelEvent()}function f(l){const o=l.detail;s.sendSignedTx(o)}return s.sendOnReadyEvent(),Dd(a$,s$,u$,c$),t.$$set=l=>{"walletConnectService"in l&&r(0,a=l.walletConnectService)},[a,n,i,c,f]}class f$ extends yn{constructor(e){super(),hn(this,e,l$,i$,ln,{walletConnectService:0})}}function Rm(t){let e,r;return e=new r0({props:{primary:!1,$$slots:{default:[p$]},$$scope:{ctx:t}}}),{c(){Xr(e.$$.fragment)},m(n,i){Gr(e,n,i),r=!0},p(n,i){const a={};i&17&&(a.$$scope={dirty:i,ctx:n}),e.$set(a)},i(n){r||(dr(e.$$.fragment,n),r=!0)},o(n){mr(e.$$.fragment,n),r=!1},d(n){Yr(e,n)}}}function p$(t){let e,r,n,i,a,s,u,c,f,l,o;return r=new CS({props:{walletConnectService:t[0]}}),i=new Eu({props:{path:"/",component:j4}}),s=new Eu({props:{path:"/connect",component:kF,walletConnectService:t[0]}}),c=new Eu({props:{path:"/sign",component:f$,walletConnectService:t[0]}}),l=new Eu({props:{path:"/payment",component:GF,walletConnectService:t[0]}}),{c(){e=Ct("main"),Xr(r.$$.fragment),n=hr(),Xr(i.$$.fragment),a=hr(),Xr(s.$$.fragment),u=hr(),Xr(c.$$.fragment),f=hr(),Xr(l.$$.fragment)},m(w,p){Gt(w,e,p),Gr(r,e,null),nt(e,n),Gr(i,e,null),nt(e,a),Gr(s,e,null),nt(e,u),Gr(c,e,null),nt(e,f),Gr(l,e,null),o=!0},p(w,p){const d={};p&1&&(d.walletConnectService=w[0]),r.$set(d);const S={};p&1&&(S.walletConnectService=w[0]),s.$set(S);const v={};p&1&&(v.walletConnectService=w[0]),c.$set(v);const O={};p&1&&(O.walletConnectService=w[0]),l.$set(O)},i(w){o||(dr(r.$$.fragment,w),dr(i.$$.fragment,w),dr(s.$$.fragment,w),dr(c.$$.fragment,w),dr(l.$$.fragment,w),o=!0)},o(w){mr(r.$$.fragment,w),mr(i.$$.fragment,w),mr(s.$$.fragment,w),mr(c.$$.fragment,w),mr(l.$$.fragment,w),o=!1},d(w){w&&Wt(e),Yr(r),Yr(i),Yr(s),Yr(c),Yr(l)}}}function d$(t){let e,r,n=t[1]&&!t[2]&&Rm(t);return{c(){n&&n.c(),e=so()},m(i,a){n&&n.m(i,a),Gt(i,e,a),r=!0},p(i,[a]){i[1]&&!i[2]?n?(n.p(i,a),a&6&&dr(n,1)):(n=Rm(i),n.c(),dr(n,1),n.m(e.parentNode,e)):n&&(Dn(),mr(n,1,1,()=>{n=null}),Un())},i(i){r||(dr(n),r=!0)},o(i){mr(n),r=!1},d(i){n&&n.d(i),i&&Wt(e)}}}function h$(t,e,r){let n,i,a;Ur(t,dh,u=>r(3,n=u)),Ur(t,X1,u=>r(1,i=u)),Ur(t,Q1,u=>r(2,a=u));let s;return jm(async()=>{n?r(0,s=new Cy(n)):(r(0,s=new Cy),dn(dh,n=await s.createClient(),n))}),[s,i,a]}class y$ extends yn{constructor(e){super(),hn(this,e,h$,d$,ln,{})}}new y$({target:document.getElementById("app")});export{YS as R,Z1 as T,ao as a,Th as n,m$ as o,Uo as p,qf as s,v$ as t,La as y}; diff --git a/assets/index.2a88596f.js b/assets/index.8dc8db66.js similarity index 99% rename from assets/index.2a88596f.js rename to assets/index.8dc8db66.js index f27b41aa..5db2e00a 100644 --- a/assets/index.2a88596f.js +++ b/assets/index.8dc8db66.js @@ -1,4 +1,4 @@ -import{n as _t,s as ce,T as N,t as U,a as E,o as ot,R as Uo,y as gt,p as q}from"./index.636a998f.js";/** +import{n as _t,s as ce,T as N,t as U,a as E,o as ot,R as Uo,y as gt,p as q}from"./index.08d54968.js";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/index.html b/index.html index eef11982..7447f0fe 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ /> Simple Signer - +