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