import{s as D,e as p,c as d,h as x,g as b,d as f,z as O,a as y,A as $,b as z,i as S,k as m,B as E,l as I,n as P,C as A,o as B,D as L,f as T,t as N,j as k,m as q,q as w}from"./scheduler.bDsl0G2p.js";import{S as j,i as V,c as M,a as F,m as G,t as H,b as J,d as K}from"./index.DtyFm6kT.js";import{b as Q}from"./0.D1YHP6Ug.js";function R(c){let e,t,a,r="mainnet",n,h="devnet",s,_="testnet",o,l="custom",i,g;return{c(){e=p("div"),t=p("select"),a=p("option"),a.textContent=r,n=p("option"),n.textContent=h,s=p("option"),s.textContent=_,o=p("option"),o.textContent=l,this.h()},l(u){e=d(u,"DIV",{style:!0});var v=x(e);t=d(v,"SELECT",{"nets-choices":!0,class:!0});var C=x(t);a=d(C,"OPTION",{"data-svelte-h":!0}),b(a)!=="svelte-1sx3bry"&&(a.textContent=r),n=d(C,"OPTION",{"data-svelte-h":!0}),b(n)!=="svelte-3ac022"&&(n.textContent=h),s=d(C,"OPTION",{"data-svelte-h":!0}),b(s)!=="svelte-14n6jr0"&&(s.textContent=_),o=d(C,"OPTION",{"data-svelte-h":!0}),b(o)!=="svelte-28xsy2"&&(o.textContent=l),C.forEach(f),v.forEach(f),this.h()},h(){a.__value="mainnet",O(a,a.__value),n.__value="devnet",O(n,n.__value),s.__value="testnet",O(s,s.__value),o.__value="custom",O(o,o.__value),y(t,"nets-choices",""),y(t,"class","select"),c[0]===void 0&&$(()=>c[3].call(t)),z(e,"max-width","200px")},m(u,v){S(u,e,v),m(e,t),m(t,a),m(t,n),m(t,s),m(t,o),E(t,c[0],!0),i||(g=[I(t,"change",c[3]),I(t,"change",c[1])],i=!0)},p(u,[v]){v&1&&E(t,u[0])},i:P,o:P,d(u){u&&f(e),i=!1,A(g)}}}function U(c,e,t){let{on_change:a}=e;const r={mainnet:{name:"mainnet",path:"https://api.mainnet.aptoslabs.com/v1"},testnet:{name:"testnet",path:"https://api.testnet.aptoslabs.com/v1"},devnet:{name:"devnet",path:"https://api.devnet.aptoslabs.com/v1"},custom:{name:"custom",path:""}};let{net_name:n="mainnet"}=e;const h=async _=>{console.log("net_name",n);const o=r[n];if(n==="custom"){a({net:o});return}const{enhanced:l}=await Q({net_path:o.path}),{chain_id:i}=l;a({net:o,chain_id:i})};B(()=>{h()});function s(){n=L(this),t(0,n)}return c.$$set=_=>{"on_change"in _&&t(2,a=_.on_change),"net_name"in _&&t(0,n=_.net_name)},[n,h,a,s]}class W extends j{constructor(e){super(),V(this,e,U,R,D,{on_change:2,net_name:0})}}function X(c){let e,t,a,r,n,h,s,_,o;return t=new W({props:{on_change:c[2]}}),{c(){e=p("div"),M(t.$$.fragment),a=T(),r=p("p"),n=N(c[0]),h=T(),s=p("p"),_=N(c[1])},l(l){e=d(l,"DIV",{});var i=x(e);F(t.$$.fragment,i),a=k(i),r=d(i,"P",{});var g=x(r);n=q(g,c[0]),g.forEach(f),h=k(i),s=d(i,"P",{});var u=x(s);_=q(u,c[1]),u.forEach(f),i.forEach(f)},m(l,i){S(l,e,i),G(t,e,null),m(e,a),m(e,r),m(r,n),m(e,h),m(e,s),m(s,_),o=!0},p(l,[i]){(!o||i&1)&&w(n,l[0]),(!o||i&2)&&w(_,l[1])},i(l){o||(H(t.$$.fragment,l),o=!0)},o(l){J(t.$$.fragment,l),o=!1},d(l){l&&f(e),K(t)}}}function Y(c,e,t){let a="",r="";return[a,r,({net:h,chain_id:s})=>{console.log("on_change",{net:h,_chain_id:s}),t(0,a=h.path),t(1,r=s)}]}class nt extends j{constructor(e){super(),V(this,e,Y,X,D,{})}}export{nt as default};
//# sourceMappingURL=Trinket.Bv2nFs3N.js.map
