@tokenflight/swap 0.3.0-rc.0 → 0.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/ReceiveComponent-Cyn4ECRG.js +1 -0
  2. package/dist/ReceiveComponent.module-BGpemTAX.js +1 -0
  3. package/dist/SwapComponent-BwfaI3D9.js +1 -0
  4. package/dist/bridge-Bq0QUltI.js +1 -0
  5. package/dist/bridge.d.ts +17 -1
  6. package/dist/bridge.js +1 -1
  7. package/dist/custom-elements.d.ts +1 -27
  8. package/dist/defaults-loader-DfcaO9j5.js +1 -0
  9. package/dist/en-US-CU2aSy93.js +1 -0
  10. package/dist/errors-Nd9setTj.js +3 -0
  11. package/dist/iframe-entry.d.ts +21 -0
  12. package/dist/iframe-entry.js +29 -0
  13. package/dist/iframe-receiver-PfhKUIZW.js +1 -0
  14. package/dist/iframe.d.ts +78 -10
  15. package/dist/iframe.js +45 -1
  16. package/dist/ja-JP-BoipV6-j.js +1 -0
  17. package/dist/ko-KR-DyFXZJsF.js +1 -0
  18. package/dist/protocol-CDxgudrl.js +1 -0
  19. package/dist/rank-offers-CR-1NeiW.js +1 -0
  20. package/dist/register-defaults-C_q7CG7x.js +1 -0
  21. package/dist/register-widget-DOzDJD94.js +1 -0
  22. package/dist/shared.module-C-kWMzqW.js +1 -0
  23. package/dist/solid-iWr5Czxc.js +1 -0
  24. package/dist/swap.css +1 -1
  25. package/dist/theme-C9tsVWlo.js +2 -0
  26. package/dist/tokenflight-swap.d.ts +88 -250
  27. package/dist/tokenflight-swap.js +1 -2
  28. package/dist/tokenflight-swap.umd.cjs +5 -6
  29. package/dist/widget-BadYytj9.js +2 -0
  30. package/dist/widget.d.ts +307 -25
  31. package/dist/widget.js +1 -1
  32. package/dist/zh-CN-epCUm9Io.js +1 -0
  33. package/dist/zh-TW-DSEboEJV.js +1 -0
  34. package/package.json +6 -2
  35. package/dist/bridge-C9uFKAdS.js +0 -1
  36. package/dist/en-US-ChmhdVUe.js +0 -1
  37. package/dist/ja-JP-BAX9fLqV.js +0 -1
  38. package/dist/ko-KR-jwhmhUqJ.js +0 -1
  39. package/dist/register-defaults-lIJMUU-P.js +0 -1
  40. package/dist/register-widget-DQAzucnZ.js +0 -5
  41. package/dist/zh-CN-fKcRI4Y8.js +0 -1
  42. package/dist/zh-TW-gFEUAIR6.js +0 -1
  43. /package/dist/{active-bridge-DTyKObda.js → active-bridge-V8lTJ2Js.js} +0 -0
@@ -1 +0,0 @@
1
- var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}function r(){return{...e.context,id:e.getNextContextId(),count:0}}var i=(e,t)=>e===t,a=Symbol(`solid-proxy`),o=typeof Proxy==`function`,s=Symbol(`solid-track`),c={equals:i},l=null,u=pe,d=1,f=2,p={owned:null,cleanups:null,context:null,owner:null},m={},h=null,g=null,_=null,v=null,y=null,b=null,x=null,S=0;function C(e,t){let n=y,r=h,i=e.length===0,a=t===void 0?r:t,o=i?p:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>k(()=>V(o)));h=o,y=null;try{return z(s,!0)}finally{y=n,h=r}}function w(e,t){t=t?Object.assign({},c,t):c;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[le.bind(n),e=>(typeof e==`function`&&(e=g&&g.running&&g.sources.has(n)?e(n.tValue):e(n.value)),ue(n,e))]}function ee(e,t,n){let r=L(e,t,!0,d);_&&g&&g.running?b.push(r):I(r)}function T(e,t,n){let r=L(e,t,!1,d);_&&g&&g.running?b.push(r):I(r)}function E(e,t,n){u=he;let r=L(e,t,!1,d),i=F&&P(F);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),x?x.push(r):I(r)}function D(e,t,n){n=n?Object.assign({},c,n):c;let r=L(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,_&&g&&g.running?(r.tState=d,b.push(r)):I(r),le.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function ne(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=m,l=null,u=!1,d=!1,f=`initialValue`in o,p=typeof i==`function`&&D(i),_=new Set,[v,b]=(o.storage||w)(o.initialValue),[x,S]=w(void 0),[C,T]=w(void 0,{equals:!1}),[E,ne]=w(f?`ready`:`unresolved`);e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function O(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=m,g&&e&&u?(g.promises.delete(e),u=!1,z(()=>{g.running=!0,A(t,n)},!1)):A(t,n)),t}function A(e,t){z(()=>{t===void 0&&b(()=>e),ne(t===void 0?f?`ready`:`unresolved`:`errored`),S(t);for(let e of _.keys())e.decrement();_.clear()},!1)}function j(){let e=F&&P(F),t=v(),n=x();if(n!==void 0&&!s)throw n;return y&&!y.user&&e&&ee(()=>{C(),s&&(e.resolved&&g&&u?g.promises.add(s):_.has(e)||(e.increment(),_.add(e)))}),t}function M(e=!0){if(e!==!1&&d)return;d=!1;let t=p?p():i;if(u=g&&g.running,t==null||t===!1){O(s,k(v));return}g&&s&&g.promises.delete(s);let n,r=c===m?k(()=>{try{return a(t,{value:v(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0){O(s,void 0,H(n),t);return}else if(!te(r))return O(s,r,void 0,t),r;return s=r,`v`in r?(r.s===1?O(s,r.v,void 0,t):O(s,void 0,H(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),z(()=>{ne(f?`refreshing`:`pending`),T()},!1),r.then(e=>O(r,e,void 0,t),e=>O(r,void 0,H(e),t)))}Object.defineProperties(j,{state:{get:()=>E()},error:{get:()=>x()},loading:{get(){let e=E();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return j();let e=x();if(e&&!s)throw e;return v()}}});let N=h;return p?ee(()=>(N=h,M(!1))):M(!1),[j,{refetch:e=>re(N,()=>M(e)),mutate:b}]}function O(e){return z(e,!1)}function k(e){if(!v&&y===null)return e();let t=y;y=null;try{return v?v.untrack(e):e()}finally{y=t}}function A(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=k(()=>t(o,i,n));return i=o,s}}function j(e){E(()=>k(e))}function M(e){return h===null||(h.cleanups===null?h.cleanups=[e]:h.cleanups.push(e)),e}function N(){return y}function re(e,t){let n=h,r=y;h=e,y=null;try{return z(t,!0)}catch(e){U(e)}finally{h=n,y=r}}function ie(e){if(g&&g.running)return e(),g.done;let t=y,n=h;return Promise.resolve().then(()=>{y=t,h=n;let r;return(_||F)&&(r=g||(g={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(e=>r.resolve=e)),r.running=!0),z(e,!1),y=h=null,r?r.done:void 0})}var[ae,oe]=w(!1);function se(e,t){let n=Symbol(`context`);return{id:n,Provider:be(n),defaultValue:e}}function P(e){let t;return h&&h.context&&(t=h.context[e.id])!==void 0?t:e.defaultValue}function ce(e){let t=D(e),n=D(()=>ye(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var F;function le(){let e=g&&g.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===d)I(this);else{let e=b;b=null,z(()=>B(this),!1),b=e}if(y){let e=this.observers?this.observers.length:0;y.sources?(y.sources.push(this),y.sourceSlots.push(e)):(y.sources=[this],y.sourceSlots=[e]),this.observers?(this.observers.push(y),this.observerSlots.push(y.sources.length-1)):(this.observers=[y],this.observerSlots=[y.sources.length-1])}return e&&g.sources.has(this)?this.tValue:this.value}function ue(e,t,n){let r=g&&g.running&&g.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(g){let r=g.running;(r||!n&&g.sources.has(e))&&(g.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&z(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=g&&g.running;r&&g.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?b.push(n):x.push(n),n.observers&&ge(n)),r?n.tState=d:n.state=d)}if(b.length>1e6)throw b=[],Error()},!1)}return t}function I(e){if(!e.fn)return;V(e);let t=S;de(e,g&&g.running&&g.sources.has(e)?e.tValue:e.value,t),g&&!g.running&&g.sources.has(e)&&queueMicrotask(()=>{z(()=>{g&&(g.running=!0),y=h=e,de(e,e.tValue,t),y=h=null},!1)})}function de(e,t,n){let r,i=h,a=y;y=h=e;try{r=e.fn(t)}catch(t){return e.pure&&(g&&g.running?(e.tState=d,e.tOwned&&e.tOwned.forEach(V),e.tOwned=void 0):(e.state=d,e.owned&&e.owned.forEach(V),e.owned=null)),e.updatedAt=n+1,U(t)}finally{y=a,h=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?ue(e,r,!0):g&&g.running&&e.pure?(g.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function L(e,t,n,r=d,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:h,context:h?h.context:null,pure:n};if(g&&g.running&&(a.state=0,a.tState=r),h===null||h!==p&&(g&&g.running&&h.pure?h.tOwned?h.tOwned.push(a):h.tOwned=[a]:h.owned?h.owned.push(a):h.owned=[a]),v&&a.fn){let[e,t]=w(void 0,{equals:!1}),n=v.factory(a.fn,t);M(()=>n.dispose());let r=v.factory(a.fn,()=>ie(t).then(()=>r.dispose()));a.fn=t=>(e(),g&&g.running?r.track(t):n.track(t))}return a}function R(e){let t=g&&g.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===f)return B(e);if(e.suspense&&k(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<S);){if(t&&g.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(g.disposed.has(t))return}if((t?e.tState:e.state)===d)I(e);else if((t?e.tState:e.state)===f){let t=b;b=null,z(()=>B(e,n[0]),!1),b=t}}}function z(e,t){if(b)return e();let n=!1;t||(b=[]),x?n=!0:x=[],S++;try{let t=e();return fe(n),t}catch(e){n||(x=null),b=null,U(e)}}function fe(e){if(b&&(_&&g&&g.running?me(b):pe(b),b=null),e)return;let t;if(g){if(!g.promises.size&&!g.queue.size){let e=g.sources,n=g.disposed;x.push.apply(x,g.effects),t=g.resolve;for(let e of x)`tState`in e&&(e.state=e.tState),delete e.tState;g=null,z(()=>{for(let e of n)V(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)V(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}oe(!1)},!1)}else if(g.running){g.running=!1,g.effects.push.apply(g.effects,x),x=null,oe(!0);return}}let n=x;x=null,n.length&&z(()=>u(n),!1),t&&t()}function pe(e){for(let t=0;t<e.length;t++)R(e[t])}function me(e){for(let t=0;t<e.length;t++){let n=e[t],r=g.queue;r.has(n)||(r.add(n),_(()=>{r.delete(n),z(()=>{g.running=!0,R(n)},!1),g&&(g.running=!1)}))}}function he(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:R(e)}if(e.context){if(e.count){e.effects||(e.effects=[]),e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)R(t[r])}function B(e,t){let n=g&&g.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===d?i!==t&&(!i.updatedAt||i.updatedAt<S)&&R(i):e===f&&B(i,t)}}}function ge(e){let t=g&&g.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=f:r.state=f,r.pure?b.push(r):x.push(r),r.observers&&ge(r))}}function V(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)V(e.tOwned[t]);delete e.tOwned}if(g&&g.running&&e.pure)_e(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)V(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}g&&g.running?e.tState=0:e.state=0}function _e(e,t){if(t||(e.tState=0,g.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)_e(e.owned[t])}function H(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function ve(e,t,n){try{for(let n of t)n(e)}catch(e){U(e,n&&n.owner||null)}}function U(e,t=h){let n=l&&t&&t.context&&t.context[l],r=H(e);if(!n)throw r;x?x.push({fn(){ve(r,n,t)},state:d}):ve(r,n,t)}function ye(e){if(typeof e==`function`&&!e.length)return ye(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=ye(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function be(e,t){return function(t){let n;return T(()=>n=k(()=>(h.context={...h.context,[e]:t.value},ce(()=>t.children))),void 0),n}}var xe=Symbol(`fallback`);function W(e){for(let t=0;t<e.length;t++)e[t]()}function Se(e,t,n={}){let r=[],i=[],a=[],o=0,c=t.length>1?[]:null;return M(()=>W(a)),()=>{let l=e()||[],u=l.length,d,f;return l[s],k(()=>{let e,t,s,m,h,g,_,v,y;if(u===0)o!==0&&(W(a),a=[],r=[],i=[],o=0,c&&(c=[])),n.fallback&&(r=[xe],i[0]=C(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=C(p);o=u}else{for(s=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(o,u);g<_&&r[g]===l[g];g++);for(_=o-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)s[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(s[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in s?(i[f]=s[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=C(p);i=i.slice(0,o=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=w(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function Ce(e,t,n={}){let r=[],i=[],a=[],o=[],c=0,l;return M(()=>W(a)),()=>{let u=e()||[],d=u.length;return u[s],k(()=>{if(d===0)return c!==0&&(W(a),a=[],r=[],i=[],c=0,o=[]),n.fallback&&(r=[xe],i[0]=C(e=>(a[0]=e,n.fallback())),c=1),i;for(r[0]===xe&&(a[0](),a=[],r=[],i=[],c=0),l=0;l<d;l++)l<r.length&&r[l]!==u[l]?o[l](()=>u[l]):l>=r.length&&(i[l]=C(f));for(;l<r.length;l++)a[l]();return c=o.length=a.length=d,r=u.slice(0),i=i.slice(0,c)});function f(e){a[l]=e;let[n,r]=w(u[l]);return o[l]=r,t(n,l)}}}var we=!1;function Te(t,i){if(we&&e.context){let a=e.context;n(r());let o=k(()=>t(i||{}));return n(a),o}return k(()=>t(i||{}))}function G(){return!0}var K={get(e,t,n){return t===a?n:e.get(t)},has(e,t){return t===a?!0:e.has(t)},set:G,deleteProperty:G,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:G,deleteProperty:G}},ownKeys(e){return e.keys()}};function q(e){return(e=typeof e==`function`?e():e)?e:{}}function Ee(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function De(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t=t||!!r&&a in r,e[n]=typeof r==`function`?(t=!0,D(r)):r}if(o&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=q(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in q(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(q(e[n])));return[...new Set(t)]}},K);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Ee.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function Oe(e,...t){let n=t.length;if(o&&a in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},K));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return r.includes(t)?!1:t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},K)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}var ke=e=>`Stale read from <${e}>.`;function Ae(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return D(Se(()=>e.each,e.children,t||void 0))}function je(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return D(Ce(()=>e.each,e.children,t||void 0))}function Me(e){let t=e.keyed,n=D(()=>e.when,void 0,void 0),r=t?n:D(n,void 0,{equals:(e,t)=>!e==!t});return D(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?k(()=>a(t?i:()=>{if(!k(r))throw ke(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Ne(e){let t=ce(()=>e.children),n=D(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=D(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:D(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return D(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?k(()=>o(a.keyed?i():()=>{if(k(n)()?.[0]!==r)throw ke(`Match`);return i()})):o},void 0,void 0)}function Pe(e){return e}var J;function Fe(e){return{lang:e?.lang??J?.lang,message:e?.message,abortEarly:e?.abortEarly??J?.abortEarly,abortPipeEarly:e?.abortPipeEarly??J?.abortPipeEarly}}var Ie;function Le(e){return Ie?.get(e)}var Re;function ze(e){return Re?.get(e)}var Be;function Ve(e,t){return Be?.get(e)?.get(t)}function He(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function Y(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??He(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??Ve(e.reference,c.lang)??(l?ze(c.lang):null)??r.message??Le(c.lang);u!==void 0&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}function X(e){return{version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},Fe())}}}function Ue(e,t){return Object.hasOwn(e,t)&&t!==`__proto__`&&t!==`prototype`&&t!==`constructor`}function We(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}function Ge(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function Ke(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function qe(e,t){return{kind:`schema`,type:`array`,reference:qe,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return X(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else Y(this,`type`,e,t);return e}}}function Z(e){return{kind:`schema`,type:`boolean`,reference:Z,expects:`boolean`,async:!1,message:e,get"~standard"(){return X(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:Y(this,`type`,e,t),e}}}function Je(e){return{kind:`schema`,type:`number`,reference:Je,expects:`number`,async:!1,message:e,get"~standard"(){return X(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:Y(this,`type`,e,t),e}}}function Ye(e,t){return{kind:`schema`,type:`object`,reference:Ye,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return X(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:Ke(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=Ge(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(Y(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else Y(this,`type`,e,t);return e}}}function Xe(e,t){return{kind:`schema`,type:`optional`,reference:Xe,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return X(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=Ke(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Ze(e,t){return{kind:`schema`,type:`picklist`,reference:Ze,expects:We(e.map(He),`|`),async:!1,options:e,message:t,get"~standard"(){return X(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:Y(this,`type`,e,t),e}}}function Qe(e,t,n){return{kind:`schema`,type:`record`,reference:Qe,expects:`Object`,async:!1,key:e,value:t,message:n,get"~standard"(){return X(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in n)if(Ue(n,r)){let i=n[r],a=this.key[`~run`]({value:r},t);if(a.issues){let o={type:`object`,origin:`key`,input:n,key:r,value:i};for(let t of a.issues)t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}let o=this.value[`~run`]({value:i},t);if(o.issues){let a={type:`object`,origin:`value`,input:n,key:r,value:i};for(let t of o.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}(!a.typed||!o.typed)&&(e.typed=!1),a.typed&&(e.value[a.value]=o.value)}}else Y(this,`type`,e,t);return e}}}function Q(e){return{kind:`schema`,type:`string`,reference:Q,expects:`string`,async:!1,message:e,get"~standard"(){return X(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:Y(this,`type`,e,t),e}}}function $e(e,t){let n={};for(let r in e.entries)n[r]=!t||t.includes(r)?Xe(e.entries[r]):e.entries[r];return{...e,entries:n,get"~standard"(){return X(this)}}}function et(e,t,n){let r=e[`~run`]({value:t},Fe(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var tt=$e(Ye({apiEndpoint:Q(),fiatApiEndpoint:Q(),theme:Ze([`light`,`dark`,`auto`]),locale:Q(),customColors:Qe(Q(),Q()),hideTitle:Z(),hidePoweredBy:Z(),noBackground:Z(),noBorder:Z(),methods:qe(Ze([`crypto`,`card`])),supportedChainIds:qe(Je()),rpcOverrides:Qe(Q(),Q()),reownProjectId:Q()})),nt=`https://embed.tokenflight.ai/api/config/defaults.json`,rt=5e3,$=null;function it(){return $||(typeof fetch==`function`?($=(async()=>{let e=new AbortController,t=setTimeout(()=>e.abort(),rt);try{let t=await fetch(nt,{credentials:`omit`,signal:e.signal});if(!t.ok)return null;let n=et(tt,await t.json());return n.success?n.output:null}catch{return null}finally{clearTimeout(t)}})(),$):($=Promise.resolve(null),$))}function at(e){if(e!=null){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.trim().toLowerCase();if(t===``||t===`true`||t===`1`||t===`yes`)return!0;if(t===`false`||t===`0`||t===`no`)return!1}}}var[ot,st]=w(),[ct,lt]=w(),[ut,dt]=w(),[ft,pt]=w(),[mt,ht]=w(),[gt,_t]=w(),[vt,yt]=w(),[bt,xt]=w(),[St,Ct]=w(),[wt,Tt]=w(),[Et,Dt]=w(),[Ot,kt]=w(),[At,jt]=w(),[Mt,Nt]=w(),[Pt,Ft]=w();function It(e){`walletAdapter`in e&&st(()=>e.walletAdapter),`callbacks`in e&&lt(()=>e.callbacks),`customColors`in e&&dt(()=>e.customColors),`apiEndpoint`in e&&pt(e.apiEndpoint),`fiatApiEndpoint`in e&&ht(e.fiatApiEndpoint),`theme`in e&&_t(e.theme),`locale`in e&&yt(e.locale),`textOverrides`in e&&xt(()=>e.textOverrides),`hideTitle`in e&&Ct(e.hideTitle),`hidePoweredBy`in e&&Tt(e.hidePoweredBy),`noBackground`in e&&Dt(e.noBackground),`noBorder`in e&&kt(e.noBorder),`methods`in e&&jt(()=>e.methods),`rpcOverrides`in e&&Nt(()=>e.rpcOverrides),`supportedChainIds`in e&&Ft(()=>e.supportedChainIds)}function Lt(e){xt(()=>e)}function Rt(){typeof window>`u`||it().then(e=>{e&&k(()=>{e.apiEndpoint!==void 0&&ft()===void 0&&pt(e.apiEndpoint),e.fiatApiEndpoint!==void 0&&mt()===void 0&&ht(e.fiatApiEndpoint),e.theme!==void 0&&gt()===void 0&&_t(e.theme),e.locale!==void 0&&vt()===void 0&&yt(e.locale),e.customColors!==void 0&&ut()===void 0&&dt(()=>e.customColors),e.hideTitle!==void 0&&St()===void 0&&Ct(e.hideTitle),e.hidePoweredBy!==void 0&&wt()===void 0&&Tt(e.hidePoweredBy),e.noBackground!==void 0&&Et()===void 0&&Dt(e.noBackground),e.noBorder!==void 0&&Ot()===void 0&&kt(e.noBorder),e.methods!==void 0&&At()===void 0&&jt(()=>e.methods),e.rpcOverrides!==void 0&&Mt()===void 0&&Nt(()=>e.rpcOverrides),e.supportedChainIds!==void 0&&Pt()===void 0&&Ft(()=>e.supportedChainIds)})})}Rt();export{E as A,j as B,Pe as C,Te as D,O as E,w as F,Oe as H,N as I,De as L,T as M,ne as N,ee as O,C as P,A as R,je as S,Ne as T,k as U,e as V,P as W,Lt as _,mt as a,s as b,vt as c,Ot as d,Mt as f,at as g,ot as h,ut as i,D as j,se as k,At as l,gt as m,ft as n,wt as o,bt as p,ct as r,St as s,It as t,Et as u,it as v,Me as w,Ae as x,a as y,M as z};