text: (this["webpackJsonpergo-node-interface"]=this["webpackJsonpergo-node-interface"]||[]).push([[0],{103:function(e,t,a){e.exports=a(143)},114:function(e,t,a){},131:function(e,t,a){},135:function(e,t,a){},136:function(e,t,a){},137:function(e,t,a){},138:function(e,t,a){},139:function(e,t,a){},141:function(e,t,a){},143:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(13),c=a.n(l),o=a(49),s=a(9),i=a(39),m=a(7),u=a(11),d=a(10),p=Object(d.c)({name:"nodeSlice",initialState:{network:"mainnet"},reducers:{setNetwork:function(e,t){var a=t.payload;e.network=a}}}),f=Object(d.b)("getNetwork"),b=Object(u.a)(Object(u.a)({},p.actions),{},{getNetwork:f}),h=a(19),E=a(21),v=a(40),y="/swagger",g="https://ergoplatform.org",w=1e9,N=a(14),O=a(15),j=a(18),k=a(17),S=a(90),_=a(79),C=function(e){return e.node},x=(Object(_.a)(C,(function(e){return e.network})),Object(_.a)(C,(function(e){return"mainnet"===e.network?"explorer":e.network}))),W=r.a.createElement(h.a,{icon:S.a}),A=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){return Object(N.a)(this,a),t.apply(this,arguments)}return Object(O.a)(a,[{key:"render",value:function(){var e=this.props.explorerSubdomain;return r.a.createElement("a",{ref:this.exporerRef,key:"Explorer",className:Object(v.a)("list-group-item list-group-item-action"),href:"https://".concat(e,".ergoplatform.com"),rel:"noopener noreferrer",target:"_blank"},W," ","Explorer")}}]),a}(n.Component),I=Object(s.b)((function(e){return{explorerSubdomain:x(e)}}),null)(A),B={dashboard:{href:"/",icon:r.a.createElement(h.a,{icon:E.b}),title:"Dashboard"},wallet:{href:"/wallet",icon:r.a.createElement(h.a,{icon:E.d}),title:"Wallet"}},P={swaggerInterface:{href:y,icon:r.a.createElement(h.a,{icon:E.a}),title:"Swagger"},website:{href:g,icon:r.a.createElement(h.a,{icon:E.f}),title:"Website"}},F=Object(m.f)((function(e){var t=e.location.pathname;return r.a.createElement("div",null,r.a.createElement("p",{className:"h5 pl-3 pt-4"},"Menu"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(B).map((function(e,a){var n=e.href,l=e.icon,c=e.title;return r.a.createElement(i.b,{key:c,className:Object(v.a)("list-group-item list-group-item-action",{"list-group-item-dark":n===t,active:n===t,"border-top-0":0===a}),to:n},l," ",c)}))),r.a.createElement("p",{className:"h5 pl-3 pt-4"},"External links"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(P).map((function(e,t){var a=e.href,n=e.icon,l=e.title;return r.a.createElement("a",{key:l,className:Object(v.a)("list-group-item list-group-item-action",{"border-top-0":0===t}),href:a,rel:"noopener noreferrer",target:"_blank"},n," ",l)})),r.a.createElement(I,null)))})),z=(a(114),Object(_.a)((function(e){return e.app}),(function(e){return e.apiKey}))),T=function(e){return e.wallet},L=Object(_.a)(T,(function(e){return e.isWalletUnlocked})),M=Object(_.a)(T,(function(e){return e.isWalletInitialized})),H=Object(_.a)(T,(function(e){return e.walletStatusData})),K=Object(_.a)(T,(function(e){return e.walletBalanceData})),R=Object(_.a)(T,(function(e){return e.walletAddresses})),U=Object(_.a)(T,(function(e){return e.ergPrice})),D=Object(d.c)({name:"walletSlice",initialState:{isWalletUnlocked:null,isWalletInitialized:null,walletStatusData:null,walletBalanceData:null,ergPrice:null,walletAddresses:null},reducers:{setIsWalletUnlocked:function(e,t){var a=t.payload;e.isWalletUnlocked=a},setIsWalletInitialized:function(e,t){var a=t.payload;e.isWalletInitialized=a},setWalletStatusData:function(e,t){var a=t.payload;e.walletStatusData=a},setWalletBalanceData:function(e,t){var a=t.payload;e.walletBalanceData=a},setErgPrice:function(e,t){var a=t.payload;e.ergPrice=a},setWalletAddresses:function(e,t){var a=t.payload;e.walletAddresses=a}}}),G=Object(d.b)("checkWalletStatus"),V=Object(d.b)("getWalletBalance"),Y=Object(d.b)("getErgPrice"),q=Object(d.b)("getWalletAddresses"),Z=Object(u.a)(Object(u.a)({},D.actions),{},{checkWalletStatus:G,getWalletBalance:V,getErgPrice:Y,getWalletAddresses:q}),J=a(5),$=a(152),Q=Object(d.c)({name:"appSlice",initialState:{apiKey:""},reducers:{setApiKey:function(e,t){e.apiKey=t.payload}}}),X=Object(u.a)({},Q.actions),ee=a(91),te=a.n(ee),ae=Object(u.a)({},{nodeApiLink:"/",oracleApiLink:"https://erg-usd-ergo-oracle.emurgo.io"});function ne(e){var t=e.status,a=e.message,n=e.data,r=e.statusText;this.name="NetworkError",this.message=a||r,this.status=t,this.data=n}ne.prototype=Object.create(Error.prototype);var re=te.a.create({baseURL:ae.nodeApiLink,timeout:1e4,crossDomain:!0,headers:{"Content-Type":"application/json"}});re.interceptors.response.use((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(new ne(e.response||e))}));var le=re,ce=(a(131),{success:function(e,t){return o.a.success(e,Object(u.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--success",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--success"},t))},error:function(e,t){return o.a.error(e,Object(u.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--error",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--error"},t))},info:o.a.info}),oe=function(e,t,a){return ce[e]?ce[e](t,a):new Error("Bad toast state")},se=a(43),ie=a(29),me=a(12),ue=a(153),de=function(e){var t=e.showModal,a=e.handleHide,n=e.submitForm,l=e.apiKey,c=e.handleShow,o=Object(ue.a)();return r.a.createElement("div",null,function(e,t){return""===e?r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-primary"},"Set API key"):r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-outline-primary"},"Update API key")}(l,c),r.a.createElement(ie.a,{show:t,onHide:function(){return a()},centered:!0},r.a.createElement(me.c,{initialValues:Object(se.a)({},"apiKey".concat(o),l),onSubmit:function(e){return n(e,o)}},(function(){return r.a.createElement(me.b,null,r.a.createElement(ie.a.Header,{closeButton:!0},r.a.createElement(ie.a.Title,null,"Authorization")),r.a.createElement(ie.a.Body,null,r.a.createElement("p",{className:"text"},"Set API key to access Node requests"),r.a.createElement("div",{className:"input-group"},r.a.createElement(me.a,{type:"text",name:"apiKey".concat(o),className:"form-control",placeholder:"Enter API key"}))),r.a.createElement(ie.a.Footer,null,r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary",onClick:a},"Close"),r.a.createElement("button",{type:"submit",className:"btn btn-primary"},"Save changes")))}))))},pe=Object(s.b)((function(e){return{apiKey:z(e)}}),(function(e){return{dispatchSetApiKey:function(t){return e(X.setApiKey(t))}}}))(Object(n.memo)((function(e){var t=e.dispatchSetApiKey,a=e.apiKey,l=Object(n.useState)(!1),c=Object(J.a)(l,2),o=c[0],s=c[1],i=function(){s(!1)};return r.a.createElement(de,{showModal:o,apiKey:a,handleHide:i,submitForm:function(e,a){le.get("/wallet/status",{headers:{api_key:e["apiKey".concat(a)]}}).then((function(){t(e["apiKey".concat(a)].trim()),oe("success","API key is set successfully"),i()})).catch((function(){oe("error","Bad API key")}))},handleShow:function(){s(!0)}})}))),fe="INIT",be="STATUS",he=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){var e;Object(N.a)(this,a);for(var n=arguments.length,l=new Array(n),c=0;c<n;c++)l[c]=arguments[c];return(e=t.call.apply(t,[this].concat(l))).state={showModal:!1},e.handleShow=function(){e.props.onOpen(be),e.setState({showModal:!0})},e.handleHide=function(){e.props.onOpen(null),e.setState({showModal:!1})},e.walletUnlock=function(t){return le.post("/wallet/unlock",{pass:t},{headers:{api_key:e.props.apiKey}})},e.walletLock=function(){return le.get("/wallet/lock",{headers:{api_key:e.props.apiKey}})},e.submitWalletUnlockForm=function(t,a){var n=t.pass,r=a.setSubmitting,l=a.resetForm;(0,a.setStatus)({status:"submitting"}),e.walletUnlock(n).then((function(){l({pass:""}),oe("success","Your wallet is unlocked successfully"),e.props.dispatchSetIsWalletUnlocked(!0),e.handleHide()})).catch((function(e){var t=e.data?e.data.detail:e.message;oe("error",t),r(!1)}))},e.submitWalletLockForm=function(){confirm("Are you sure want to lock wallet?")&&e.walletLock().then((function(){oe("success","Your wallet is locked successfully"),e.props.dispatchSetIsWalletUnlocked(!1)})).catch((function(e){var t=e.data?e.data.detail:e.message;oe("error",t)}))},e.renderButton=function(){return e.props.isWalletUnlocked?r.a.createElement("button",{type:"button",onClick:e.submitWalletLockForm,className:"btn btn-outline-info"},"Lock wallet"):r.a.createElement("button",{type:"button",onClick:e.handleShow,className:"btn btn-info"},"Unlock wallet")},e}return Object(O.a)(a,[{key:"render",value:function(){var e=this;return r.a.createElement("div",null,this.renderButton(),r.a.createElement(ie.a,{show:this.state.showModal,onHide:function(){return e.handleHide()},centered:!0,"aria-labelledby":"example-custom-modal-styling-title"},r.a.createElement(me.c,{initialValues:{pass:""},onSubmit:this.submitWalletUnlockForm},(function(t){var a=t.isSubmitting;return r.a.createElement(me.b,null,r.a.createElement(ie.a.Header,{closeButton:!0},r.a.createElement(ie.a.Title,{id:"example-custom-modal-styling-title"},"Unlock wallet form")),r.a.createElement(ie.a.Body,null,r.a.createElement("div",{className:"form-group"},r.a.createElement("label",{htmlFor:"wallet-password-input"},"Wallet password *"),r.a.createElement(me.a,{name:"pass",type:"password",id:"wallet-password-input",className:"form-control",placeholder:"Enter wallet password"}),r.a.createElement("small",{id:"walletPasswordHelp",className:"form-text text-muted"},"* If you have it ",r.a.createElement("b",null,"or leave field empty")))),r.a.createElement(ie.a.Footer,null,r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary",onClick:e.handleHide},"Close"),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:a},"Save changes")))}))))}}]),a}(n.Component),Ee=Object(s.b)((function(e){return{isWalletUnlocked:L(e),apiKey:z(e)}}),(function(e){return{dispatchSetIsWalletUnlocked:function(t){return e(Z.setIsWalletUnlocked(t))}}}))(Object(n.memo)(he)),ve=a(34),ye=a.n(ve),ge=a(45),we=a(95),Ne=a.n(we),Oe=a(154),je=a(150),ke=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(e){var n;return Object(N.a)(this,a),(n=t.call(this,e)).startTimer=function(){var e=setTimeout((function(){return n.setState({showTooltip:!1})}),1500);n.setState({timerId:e})},n.onCopy=function(e){e.preventDefault(),Ne()(n.props.children),n.setState({showTooltip:!0}),n.startTimer()},n.handleOnTooltipClose=function(){n.setState({showTooltip:!1})},n.myRef=r.a.createRef(),n.state={showTooltip:!1},n}return Object(O.a)(a,[{key:"componentWillUnmount",value:function(){clearTimeout(this.state.timerId)}},{key:"render",value:function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement("a",{href:"#copyClipboard",ref:this.myRef,onClick:this.onCopy,className:"font-weight-bold text-decoration-none"},this.props.children),r.a.createElement(Oe.a,{target:this.myRef.current,show:this.state.showTooltip,placement:"right"},r.a.createElement(je.a,null,"Copied!")))}}]),a}(r.a.PureComponent),Se={walletPassword:"",mnemonicPass:""},_e=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){var e;Object(N.a)(this,a);for(var n=arguments.length,l=new Array(n),c=0;c<n;c++)l[c]=arguments[c];return(e=t.call.apply(t,[this].concat(l))).state={isShowMnemonic:!1},e.walletInit=function(){var t=Object(ge.a)(ye.a.mark((function t(a){var n,r,l,c;return ye.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.walletPassword,r=a.mnemonicPass,t.next=3,le.post("/wallet/init",{pass:n,mnemonicPass:r},{headers:{api_key:e.props.apiKey}});case 3:return l=t.sent,c=l.data,t.abrupt("return",c);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.handleSubmit=function(t,a){var n=a.setSubmitting,l=a.resetForm,c=a.setStatus;c({status:"submitting"}),e.walletInit(t).then((function(t){l(Se),c({state:"success",msg:r.a.createElement(r.a.Fragment,null,"Your wallet successfully initialized. Please, save your mnemonic -"," ",r.a.createElement(ke,null,t.mnemonic))}),e.setState({isShowMnemonic:!0})})).catch((function(e){var t=e.data?e.data.detail:e.message;oe("error",t),n(!1)}))},e}return Object(O.a)(a,[{key:"render",value:function(){var e=this;return r.a.createElement("div",{className:"card bg-white p-4 mb-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Initialize wallet"),r.a.createElement(me.c,{initialValues:Se,onSubmit:this.handleSubmit},(function(t){var a=t.status,n=t.isSubmitting;return r.a.createElement(me.b,null,a&&"error"===a.state&&r.a.createElement("div",{className:"alert alert-danger",role:"alert"},a.msg),a&&"success"===a.state&&e.state.isShowMnemonic&&r.a.createElement("div",{className:"alert alert-success alert-dismissible"},r.a.createElement("button",{type:"button",className:"close",onClick:function(){return e.setState({isShowMnemonic:!1})}},r.a.createElement("span",{"aria-hidden":"true"},"\xd7")),a.msg),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",{htmlFor:"wallet-password-input"},"Wallet password"),r.a.createElement(me.a,{name:"walletPassword",type:"password",id:"wallet-password-input",className:"form-control",placeholder:"Enter wallet password"})),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",{htmlFor:"mnemonic-password-input"},"Mnemonic password"),r.a.createElement(me.a,{name:"mnemonicPass",type:"password",id:"mnemonic-password-input",className:"form-control",placeholder:"Enter mnemonic password"})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:n},"Send"))})))}}]),a}(n.Component),Ce=Object(n.memo)(_e),xe={walletPassword:"",mnemonicPass:"",mnemonic:""},We=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){var e;Object(N.a)(this,a);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return(e=t.call.apply(t,[this].concat(r))).walletRestore=function(){var t=Object(ge.a)(ye.a.mark((function t(a,n){var r,l,c;return ye.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=a.walletPassword,l=a.mnemonicPass,c=void 0===l?"":l,a["mnemonic".concat(n)]&&String(a["mnemonic".concat(n)]).trim()){t.next=3;break}throw Error("Need to set mnemonic");case 3:return t.abrupt("return",le.post("/wallet/restore",{pass:r||"",mnemonicPass:c||"",mnemonic:a["mnemonic".concat(n)]},{headers:{api_key:e.props.apiKey}}));case 4:case"end":return t.stop()}}),t)})));return function(e,a){return t.apply(this,arguments)}}(),e.handleSubmit=function(t,a,n){var r=a.setSubmitting,l=a.resetForm;(0,a.setStatus)({status:"submitting"}),e.walletRestore(t,n).then((function(){l(xe),oe("success","Your wallet successfully re-stored")})).catch((function(e){var t=e.data?e.data.detail:e.message;oe("error",t),r(!1)}))},e}return Object(O.a)(a,[{key:"render",value:function(){var e=this,t=Object(ue.a)();return r.a.createElement("div",{className:"card bg-white p-4 mb-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Re-store wallet"),r.a.createElement(me.c,{initialValues:Object(se.a)({walletPassword:"",mnemonicPass:""},"mnemonic".concat(t),""),onSubmit:function(a,n){return e.handleSubmit(a,n,t)}},(function(e){var a=e.status,n=e.isSubmitting;return r.a.createElement(me.b,null,a&&"error"===a.state&&r.a.createElement("div",{className:"alert alert-danger",role:"alert"},a.msg),a&&"success"===a.state&&r.a.createElement("div",{className:"alert alert-success"},a.msg),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",{htmlFor:"restore-mnemonic-input"},"Mnemonic"),r.a.createElement(me.a,{name:"mnemonic".concat(t),type:"text",id:"restore-mnemonic-input",className:"form-control",placeholder:"Enter mnemonic",required:!0})),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",{htmlFor:"restore-wallet-password-input"},"Wallet password"),r.a.createElement(me.a,{name:"walletPassword",type:"password",id:"restore-wallet-password-input",className:"form-control",placeholder:"Enter wallet password"})),r.a.createElement("div",{className:"form-group"},r.a.createElement("label",{htmlFor:"restore-mnemonic-password-input"},"Mnemonic password"),r.a.createElement(me.a,{name:"mnemonicPass",type:"password",id:"restore-mnemonic-password-input",className:"form-control",placeholder:"Enter mnemonic password"})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:n},"Send"))})))}}]),a}(n.Component),Ae=Object(n.memo)(We),Ie=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){var e;Object(N.a)(this,a);for(var n=arguments.length,l=new Array(n),c=0;c<n;c++)l[c]=arguments[c];return(e=t.call.apply(t,[this].concat(l))).state={showModal:!1},e.handleShow=function(){e.props.onOpen(fe),e.setState({showModal:!0})},e.handleHide=function(){e.props.onOpen(null),e.props.dispatchCheckWalletStatus(),e.setState({showModal:!1})},e.renderButton=function(){return r.a.createElement("button",{type:"button",onClick:e.handleShow,className:"btn btn-primary"},"Initialize wallet")},e}return Object(O.a)(a,[{key:"render",value:function(){var e=this,t=this.props.apiKey;return r.a.createElement("div",null,this.renderButton(),r.a.createElement(ie.a,{show:this.state.showModal,onHide:function(){return e.handleHide()},centered:!0,size:"lg"},r.a.createElement(ie.a.Header,{closeButton:!0},r.a.createElement(ie.a.Title,{id:"example-custom-modal-styling-title"},"Wallet initialization")),r.a.createElement(ie.a.Body,{className:"row"},r.a.createElement("div",{className:"col-6"},r.a.createElement(Ce,{apiKey:t})),r.a.createElement("div",{className:"col-6"},r.a.createElement(Ae,{apiKey:t}))),r.a.createElement(ie.a.Footer,null,r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary",onClick:this.handleHide},"Close"))))}}]),a}(n.Component),Be=Object(s.b)((function(e){return{apiKey:z(e)}}),(function(e){return{dispatchCheckWalletStatus:function(){return e(Z.checkWalletStatus())},dispatchSetApiKey:function(t){return e(X.setApiKey(t))}}}))(Object(n.memo)(Ie)),Pe=a(97),Fe=a.n(Pe),ze=Object(n.memo)((function(e){var t=e.isApiKeySetted,a=e.isWalletInitialized,l=Object(n.useState)(null),c=Object(J.a)(l,2),o=c[0],s=c[1];return r.a.createElement($.a,{className:"navbar-background",expand:"lg"},r.a.createElement($.a.Brand,{className:"navbar-brand"},r.a.createElement(i.b,{to:"/"},r.a.createElement("img",{src:Fe.a,alt:"logotype",className:"logotype"}))),r.a.createElement("div",{className:"ml-4"},r.a.createElement(pe,null)),t&&function(e,t,a){return null===e?r.a.createElement(r.a.Fragment,null):e&&t!==fe?r.a.createElement("div",{className:"ml-4"},r.a.createElement(Ee,{onOpen:a})):r.a.createElement("div",{className:"ml-4"},r.a.createElement(Be,{onOpen:a}))}(a,o,s))})),Te=Object(s.b)((function(e){return{apiKey:z(e),isWalletInitialized:M(e)}}),(function(e){return{dispatchCheckWalletStatus:function(){return e(Z.checkWalletStatus())}}}))(Object(n.memo)((function(e){var t=e.apiKey,a=e.dispatchCheckWalletStatus,l=e.isWalletInitialized;Object(n.useEffect)((function(){""!==t&&a()}),[t,a]);var c=""!==t;return r.a.createElement(ze,{isApiKeySetted:c,isWalletInitialized:l})}))),Le=Object(m.f)((function(e){return r.a.createElement("div",null,r.a.createElement(Te,null),r.a.createElement("div",{className:"sidebar"},r.a.createElement(F,null)),r.a.createElement("main",{className:"main-container"},r.a.createElement("div",{className:"content"},e.children)))})),Me=a(151),He=(a(135),function(e){var t=e.color,a=e.children,n=e.className;return r.a.createElement("div",{className:Object(v.a)({"info-card":!0,"info-card--green":"green"===t,"info-card--orange":"orange"===t},n)},a)}),Ke=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){var e;Object(N.a)(this,a);for(var n=arguments.length,l=new Array(n),c=0;c<n;c++)l[c]=arguments[c];return(e=t.call.apply(t,[this].concat(l))).renderActiveSynchronization=function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"info-card__title"},"Synchronization state"),r.a.createElement("p",{className:"info-card__label text-warning"},r.a.createElement(h.a,{icon:E.g,spin:!0})," Active synchronization"))},e.renderCompleteSynchronization=function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"info-card__title"},"Synchronization state"),r.a.createElement("p",{className:"info-card__label text-success"},r.a.createElement(h.a,{icon:E.c})," Node is synced"))},e.renderSynchronizationState=function(t){return{active:e.renderActiveSynchronization,complete:e.renderCompleteSynchronization}[t]},e.getSynchronizationState=function(e){var t=e.fullHeight,a=e.headersHeight;return null!==t&&null!==a&&t===a?"complete":"active"},e}return Object(O.a)(a,[{key:"shouldComponentUpdate",value:function(e){return this.getSynchronizationState(e)!==this.getSynchronizationState(this.props.nodeInfo)}},{key:"render",value:function(){var e=this.getSynchronizationState(this.props.nodeInfo);return r.a.createElement(He,{className:this.props.className},this.renderSynchronizationState(e)())}}]),a}(n.Component),Re=function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){var e;Object(N.a)(this,a);for(var n=arguments.length,l=new Array(n),c=0;c<n;c++)l[c]=arguments[c];return(e=t.call.apply(t,[this].concat(l))).renderActiveSynchronization=function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"info-card__title"},"Synchronization state"),r.a.createElement("p",{className:"info-card__label text-warning"},r.a.createElement(h.a,{icon:E.g,spin:!0})," Active synchronization"))},e.renderCompleteSynchronization=function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"info-card__title"},"Synchronization state"),r.a.createElement("p",{className:"info-card__label text-success"},r.a.createElement(h.a,{icon:E.c})," Wallet is synced"))},e.renderErrorSynchronization=function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:"info-card__title"},"Synchronization state"),r.a.createElement("p",{className:"info-card__label text-danger"},r.a.createElement(h.a,{icon:E.h})," Error - ",e.props.walletStatusData.error))},e.renderSynchronizationState=function(t){return{active:e.renderActiveSynchronization,complete:e.renderCompleteSynchronization,error:e.renderErrorSynchronization}[t]},e.getSynchronizationState=function(e,t){var a;return 0!==(null===(a=e.error)||void 0===a?void 0:a.trim().length)?"error":null!==e.walletHeight&&null!==t&&e.walletHeight===t?"complete":"active"},e}return Object(O.a)(a,[{key:"render",value:function(){var e=this.props,t=e.walletStatusData,a=e.headersHeight,n=this.getSynchronizationState(t,a);return r.a.createElement(He,{className:this.props.className},this.renderSynchronizationState(n)())}}]),a}(n.Component),Ue=(a(136),function(){return r.a.createElement("div",{className:"ergo-loader"},r.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"59",height:"59",viewBox:"0 0 59 59",fill:"none"},r.a.createElement("path",{d:"M29.8011 59C29.6868 59 29.5679 58.988 29.452 58.9654C29.3377 58.9443 29.2234 58.9097 29.115 58.8661L9.47084 50.981C9.24366 50.8892 9.03902 50.7554 8.8675 50.5869C8.69749 50.4199 8.55905 50.2182 8.46427 49.9926L0.148981 30.5258C0.100837 30.4145 0.0646582 30.2987 0.0390817 30.1798C0.0150097 30.064 0.00146924 29.9436 0.00146924 29.8218L0 29.7992C0.0015045 29.6804 0.012033 29.563 0.0346005 29.4501C0.057168 29.3358 0.0902552 29.2215 0.13539 29.1116L8.02049 9.47043C8.11076 9.24325 8.24618 9.03864 8.41468 8.86562C8.58168 8.69561 8.78324 8.55717 9.00892 8.46239L28.4741 0.148566C28.5869 0.100422 28.7028 0.0643173 28.8202 0.0387408C28.9375 0.0146689 29.0594 0.00112837 29.1812 0.00112837C29.1842 -0.000376124 29.2114 -0.000376124 29.2144 0.00112837C29.3302 0.00112837 29.4461 0.0131614 29.5559 0.0357289C29.6687 0.0567919 29.7786 0.0898761 29.8884 0.133507L49.5311 8.0186C49.7583 8.11038 49.9629 8.24422 50.1344 8.41273C50.3059 8.57973 50.4428 8.78136 50.5391 9.00703L58.853 28.4707C58.9493 28.6964 58.9989 28.9371 59.0019 29.1778C59.0034 29.417 58.9583 29.6578 58.8665 29.885L50.9814 49.5277C50.8911 49.7549 50.7558 49.9594 50.5873 50.131C50.4203 50.3025 50.2186 50.4409 49.9944 50.5357L30.5293 58.8496C30.4134 58.8992 30.2946 58.9368 30.1742 58.9608C30.0478 58.9864 29.923 59 29.8011 59V59ZM12.6559 46.7203L29.7635 53.5868L46.7177 46.3472L53.5857 29.2395L46.346 12.2868L29.2384 5.41732L12.2812 12.6599L5.41318 29.7676L12.6559 46.7203V46.7203Z",fill:"black"}),r.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.6272 37.0656H39.0463V42.372H19.9558V37.5485L27.4677 29.2332L19.9919 21.4429V16.606H39.0463V21.9108H27.871L34.7991 29.167L27.6272 37.0656Z",fill:"black"})))}),De=function(e){var t=e.error,a=e.nodeInfo,n=e.isWalletInitialized,l=e.walletStatusData,c=e.walletBalanceData,o=e.ergPrice;if(null!==t)return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"container-fluid vh-100 d-flex align-items-center justify-content-center"},r.a.createElement("h3",{className:"text-danger"},r.a.createElement(h.a,{icon:E.e}),"\xa0",t)));if(null===a)return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"container-fluid vh-100 d-flex align-items-center justify-content-center"},r.a.createElement(Ue,null)));var s=a.peersCount,i=a.bestHeaderId,m=a.launchTime,u=a.fullHeight,d=a.appVersion,p=a.isMining;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"dashboard"},r.a.createElement("h2",{className:"dashboard__title"},"Node Information"),r.a.createElement("div",{className:"dashboard__container"},r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"card rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Version"),r.a.createElement("p",{className:"info-card__label"},d))),r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(Ke,{nodeInfo:a})),r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Started at"),r.a.createElement("p",{className:"info-card__label"},Object(Me.a)(new Date(m),"MM-dd-yyyy HH:mm:ss")))),null===u?null:r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Current height"),r.a.createElement("p",{className:"info-card__label"},u))),null===i?null:r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Best block id"),r.a.createElement("p",{className:"info-card__label"},i))),r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Mining enabled"),r.a.createElement("p",{className:"info-card__label"},p?"Yes":"No"))),r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Peers connected"),r.a.createElement("p",{className:"info-card__label"},s))))),o&&r.a.createElement("div",{className:"dashboard"},r.a.createElement("h2",{className:"dashboard__title"},"ERG Information"),r.a.createElement("div",{className:"dashboard__container"},r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"ERG price in $ ",r.a.createElement("br",null),"(based on oracle pool data)"),r.a.createElement("p",{className:"info-card__label"},o))))),l&&r.a.createElement("div",{className:"dashboard"},r.a.createElement("h2",{className:"dashboard__title"},"Wallet Information"),r.a.createElement("div",{className:"dashboard__container"},r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Initialization state"),r.a.createElement("p",{className:"info-card__label"},function(e){return e?"Initialized":"Not initialized"}(n)))),r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Lock state"),r.a.createElement("p",{className:"info-card__label"},l.isUnlocked?"Unlocked":"Locked"))),r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(Re,{walletStatusData:l,headersHeight:a.headersHeight})),c&&r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Balance"),r.a.createElement("p",{className:"info-card__label"},c.balance/w," ERG"," ",o&&"~ $".concat(Number(o*(c.balance/w)).toFixed(2))))),c&&r.a.createElement("div",{className:"dashboard__item"},r.a.createElement(He,{className:"rounded-0 shadow-none"},r.a.createElement("p",{className:"info-card__title"},"Assets"),r.a.createElement("p",{className:"info-card__label"},Object.values(c.assets).length||"0"))))))};var Ge=function(e){var t=Object(n.useRef)();return Object(n.useEffect)((function(){t.current=e}),[e]),t.current},Ve=Object(s.b)((function(e){return{apiKey:z(e),isWalletInitialized:M(e),isWalletUnlocked:L(e),walletStatusData:H(e),walletBalanceData:K(e),ergPrice:U(e)}}),(function(e){return{dispatchCheckWalletStatus:function(){return e(Z.checkWalletStatus())},dispatchGetWalletBalance:function(){return e(Z.getWalletBalance())},dispatchGetErgPrice:function(){return e(Z.getErgPrice())}}}))(Object(n.memo)((function(e){var t=e.isWalletInitialized,a=e.isWalletUnlocked,l=e.apiKey,c=e.dispatchCheckWalletStatus,o=e.dispatchGetWalletBalance,s=e.dispatchGetErgPrice,i=e.walletStatusData,m=e.walletBalanceData,u=e.ergPrice,d=Object(n.useState)(null),p=Object(J.a)(d,2),f=p[0],b=p[1],h=Object(n.useState)(null),E=Object(J.a)(h,2),v=E[0],y=E[1],g=Object(n.useState)(null),w=Object(J.a)(g,2),N=w[0],O=w[1],j=Object(n.useCallback)(Object(ge.a)(ye.a.mark((function e(){var t,a;return ye.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,le.get("/info");case 3:t=e.sent,a=t.data,b(a),y(null),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),y("Node connection is lost.");case 12:case"end":return e.stop()}}),e,null,[[0,9]])}))),[]),k=Object(n.useCallback)((function(){var e=setInterval((function(){j(),s(),l&&(c(),o())}),2e3);O(e)}),[l,c,s,o,j]),S=Ge(v);return Object(n.useEffect)((function(){S&&S!==v&&(c(),o(),s())}),[c,s,o,v,S]),Object(n.useEffect)((function(){j(),s(),l&&(c(),o()),k()}),[l]),Object(n.useEffect)((function(){return function(){clearInterval(N)}}),[N,l]),r.a.createElement(De,{error:v,nodeInfo:f,isWalletInitialized:t,isWalletUnlocked:a,apiKey:l,walletStatusData:i,walletBalanceData:m,ergPrice:u})}))),Ye=(a(137),Ve),qe=a(22),Ze=function(){var e=Object(n.useState)(!1),t=Object(J.a)(e,2),a=t[0],r=t[1];return Object(n.useEffect)((function(){r(Boolean("undefined"!==typeof window&&window.document&&window.document.createElement))}),[]),{isBrowser:a,isServer:!a}},Je=function(e){var t=document.createElement("div");return t.setAttribute("id",e),t},$e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Math.random().toString(32).slice(2,10),t="id-".concat(e),a=Ze().isBrowser,r=Object(n.useState)(a?Je(t):null),l=Object(J.a)(r,2),c=l[0],o=l[1];return Object(n.useEffect)((function(){var e=document.querySelector("#".concat(t)),a=e||Je(t);e||document.body.appendChild(a),o(a)}),[]),c},Qe={scrollLayer:!1},Xe=new Map,et=function(e){return!!(e.touches&&e.touches.length>1)||(e.preventDefault(),!1)},tt=function(e,t){if("undefined"===typeof document)return[!1,function(e){return e}];var a=e||Object(n.useRef)(document.body),r=Object(n.useState)(!1),l=Object(J.a)(r,2),c=l[0],o=l[1],s=Object(u.a)(Object(u.a)({},Qe),t||{}),i=function(){return!s.scrollLayer&&(!("undefined"===typeof window||!window.navigator)&&/iP(ad|hone|od)/.test(window.navigator.platform))};return Object(n.useEffect)((function(){if(a&&a.current){var e=a.current.style.overflow;if(c){if(Xe.has(a.current))return;return i()?document.addEventListener("touchmove",et,{passive:!1}):a.current.style.overflow="hidden",void Xe.set(a.current,{last:e})}if(Xe.has(a.current)){if(i())document.removeEventListener("touchmove",et);else{var t=Xe.get(a.current);a.current.style.overflow=t.last}Xe.delete(a.current)}}}),[c,a]),[c,o]},at=function(e){var t=Object(n.useState)((function(){return"function"===typeof e?e():e})),a=Object(J.a)(t,2),r=a[0],l=a[1],c=Object(n.useRef)(e);Object(n.useEffect)((function(){c.current=r}),[r]);return[r,function(e){var t="function"===typeof e?e(c.current):e;c.current=t,l(t)},c]},nt=a(66),rt=a(4),lt=a.n(rt),ct=function(e){var t=e.children,a=e.variant,n=e.component,l=e.color,c=e.className,o=e.dangerouslySetInnerHTML,s=Object(nt.a)(e,["children","variant","component","color","className","dangerouslySetInnerHTML"]),i=a,m=n||"p";return o?r.a.createElement(r.a.Fragment,null,r.a.createElement(m,Object.assign({className:lt()({colored:l},i,c),dangerouslySetInnerHTML:o},s)),r.a.createElement("style",null,"\n          .colored {\n            color: var(--".concat(l,");\n          }\n        "))):r.a.createElement(m,Object.assign({className:lt()({colored:l},i,c)},s),t,r.a.createElement("style",null,"\n        .colored {\n          color: var(--".concat(l,");\n        }\n      ")))},ot=function(e,t){return e.defaultProps=t,e},st=ot((function(e){var t=e.children,a=e.className,l=e.visible,c=e.enterTime,o=e.leaveTime,s=e.clearTime,i=e.name,m=Object(nt.a)(e,["children","className","visible","enterTime","leaveTime","clearTime","name"]),d=Object(n.useState)(""),p=Object(J.a)(d,2),f=p[0],b=p[1],h=Object(n.useState)(l),E=Object(J.a)(h,2),v=E[0],y=E[1];return Object(n.useEffect)((function(){var e=l?"enter":"leave",t=l?c:o;l&&!v&&y(!0),b("".concat(i,"-").concat(e));var a=setTimeout((function(){b("".concat(i,"-").concat(e," ").concat(i,"-").concat(e,"-active")),clearTimeout(a)}),t),n=setTimeout((function(){l||(b(""),y(!1)),clearTimeout(n)}),t+s);return function(){clearTimeout(a),clearTimeout(n)}}),[l,v]),r.a.isValidElement(t)&&v?r.a.cloneElement(t,Object(u.a)(Object(u.a)({},m),{},{className:"".concat(t.props.className," ").concat(a," ").concat(f)})):null}),{visible:!1,enterTime:60,leaveTime:60,clearTime:60,className:"",name:"transition"}),it=a(68),mt=a.n(it),ut=ot(r.a.memo((function(e){var t=e.children,a=e.onClick,l=e.visible,c=e.className,o=at(!1),s=Object(J.a)(o,3),i=s[1],m=s[2],u=Object(n.useCallback)((function(e){e.stopPropagation()}),[]);return r.a.createElement(st,{visible:l,clearTime:300},r.a.createElement("div",{className:mt.a.backdrop,onClick:function(e){m.current||a&&a(e)},onMouseUp:function(){if(m.current)var e=setTimeout((function(){i(!1),clearTimeout(e)}),0)}},r.a.createElement("div",{className:mt.a.layer}),r.a.createElement("div",{onClick:u,className:lt()(mt.a.content,c),onMouseDown:function(){return i(!0)}},t)))})),{onClick:function(){},visible:!1}),dt=r.a.createContext({});function pt(){return(pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function ft(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var bt=r.a.createElement("path",{d:"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z",fill:"#76767A"}),ht=function(e){var t=e.svgRef,a=e.title,n=ft(e,["svgRef","title"]);return r.a.createElement("svg",pt({width:32,height:32,viewBox:"0 0 32 32",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,bt)},Et=r.a.forwardRef((function(e,t){return r.a.createElement(ht,pt({svgRef:t},e))}));a.p;a.p;function vt(){return(vt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function yt(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var gt=r.a.createElement("path",{d:"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z",fill:"#0078FF"}),wt=function(e){var t=e.svgRef,a=e.title,n=yt(e,["svgRef","title"]);return r.a.createElement("svg",vt({width:16,height:16,viewBox:"0 0 16 16",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,gt)},Nt=r.a.forwardRef((function(e,t){return r.a.createElement(wt,vt({svgRef:t},e))})),Ot=(a.p,function(e,t){return r.a.createElement(e,{className:t,focusable:"false"})}),jt=function(e){var t=e.className;return Ot(Nt,t)},kt=function(e){var t=e.className;return Ot(Et,t)},St=function(e){var t=e.title,a=e.description,c=e.primaryButtonContent,o=e.secondaryButtonContent,s=e.disableBackdropClick,i=e.onClose,m=e.onOpen,u=e.onPrimaryHandler,d=e.onSecondaryHandler,p=e.open,f=$e("modal"),b=tt(null,{scrollLayer:!0}),h=Object(J.a)(b,2)[1],E=at(!1),v=Object(J.a)(E,3),y=v[0],g=v[1],w=v[2],N=Object(n.useCallback)((function(){i&&i(),g(!1),h(!1)}),[i,g,h]);Object(n.useEffect)((function(){void 0!==p&&(p&&m&&m(),!p&&w.current&&i&&i(),g(p),h(p))}),[p]);var O=Object(n.useMemo)((function(){return{close:N}}),[N]);return f?Object(l.createPortal)(r.a.createElement(dt.Provider,{value:O},r.a.createElement(ut,{onClick:function(){s||N()},visible:y,className:"info-modal-backdrop"},r.a.createElement(st,{name:"wrapper",visible:y,clearTime:300},r.a.createElement("div",{className:"info-modal"},r.a.createElement("div",{className:"info-modal__content"},r.a.createElement("h3",{className:"mb-3"},t),r.a.createElement(ct,{xl:"body-text1",sm:"small-text1",className:"mb-40 mb-md-56 pr-40 pr-md-0"},a),r.a.createElement("button",{type:"button",className:"btn btn-primary px-4",onClick:function(){u&&u(),i&&i()}},c),r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary px-4 ml-3",onClick:function(){d&&d(),i&&i()}},o)),r.a.createElement("button",{type:"button",className:"info-modal__button--close",onClick:N},r.a.createElement(kt,null)),r.a.createElement("style",null,"\n              .wrapper-enter {\n                opacity: 0;\n                transform: translate3d(0px, -40px, 0px);\n              }\n              .wrapper-enter-active {\n                opacity: 1;\n                transform: translate3d(0px, 0px, 0px);\n              }\n              .wrapper-leave {\n                opacity: 1;\n                transform: translate3d(0px, 0px, 0px);\n              }\n              .wrapper-leave-active {\n                opacity: 0;\n                transform: translate3d(0px, -50px, 0px);\n              }\n            "))))),f):null};St.defaultProps={width:"26rem",wrapClassName:"",disableBackdropClick:!1};var _t=St,Ct=function(e){var t=e.apiKey,a=e.walletBalanceData,l=e.getWalletBalance,c=e.explorerSubdomain,o=null===a||void 0===a?void 0:a.balance,s=Object(n.useState)(null),i=Object(J.a)(s,2),m=i[0],u=i[1],d=Object(n.useState)(!1),p=Object(J.a)(d,2),f=p[0],b=p[1],h=Object(n.useState)(!1),E=Object(J.a)(h,2),v=E[0],y=E[1],g=Object(n.useCallback)((function(e){var a=e.recipientAddress,n=e.amount,r=e.fee,l=e.asset,c=e.assetAmount,o={address:a.trim(),value:Number((parseFloat(n)*w).toFixed(1)),assets:v&&"none"!==l&&c>0?[{tokenId:l,amount:Number(c)}]:[]};return le.post("/wallet/transaction/send",{requests:[o],fee:Number((parseFloat(r)*w).toFixed(1))},{headers:{api_key:t}})}),[v,t]),N=Object(n.useCallback)((function(e){""!==e.recipientAddress.trim()&&e.recipientAddress&&g(e).then((function(e){var t=e.data;u(t),b(!0),l()})).catch((function(e){var t=e.data?e.data.detail:e.message;oe("error",t)}))}),[g,l]),O=Object(n.useCallback)((function(e){var t,n={},r=(Number(e.amount)+Number(e.fee))*w;return e.recipientAddress&&""!==(null===(t=e.recipientAddress)||void 0===t?void 0:t.trim())||(n.recipientAddress="The field cannot be empty"),(!e.fee||e.fee<.001)&&(n.fee="Minimum 0.001 ERG"),"none"===e.asset&&(n.asset="You need to choose asset"),a&&e.assetAmount&&"none"!==e.asset&&e.assetAmount>a.assets[e.asset]&&(n.assetAmount="Maximum ".concat(a.assets[e.asset])),v&&!e.assetAmount&&(n.assetAmount="The field can't be empty"),o<r&&(n.amount="Maximum ".concat(Math.abs(o/w-Number(e.fee))," ERG")),e.amount<0&&(n.amount="Amount can't be negative"),0===o&&(n.amount="Your balance is empty"),e.fee<0&&(n.fee="Fee can't be negative"),n}),[v,a,o]);return r.a.createElement("div",{className:""},r.a.createElement("div",{className:"card bg-white p-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Payment send"),r.a.createElement(qe.b,{onSubmit:N,validate:O,initialValues:{fee:.001,amount:.01},render:function(e){var t=e.handleSubmit,n=e.submitting,l=e.pristine,s=e.form,i=e.values,u=e.errors;return r.a.createElement(r.a.Fragment,null,r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"recipient-address"},"Recipient address"),r.a.createElement(qe.a,{name:"recipientAddress",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"recipient-address",className:lt()("form-control",{"is-invalid":a.touched&&a.error}),type:"text",placeholder:"Enter recipient address"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3 amount-container"},r.a.createElement("label",{htmlFor:"amount"},"Amount"),r.a.createElement(qe.a,{name:"amount",className:lt()("form-control"),render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"amount",className:lt()("form-control",{"is-invalid":a.touched&&a.error}),type:"number",placeholder:"0,000"},t)),0!==o&&r.a.createElement("button",{className:"btn btn-link btn-sm btn-add-all",type:"button",onClick:function(){i.amount=Math.abs((o-i.fee*w)/w),s.blur("amount")}},"Maximum"),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),Object.keys((null===a||void 0===a?void 0:a.assets)||{}).length>0&&r.a.createElement("div",{className:"form-check mb-2"},r.a.createElement("input",{className:"form-check-input",type:"checkbox",checked:v,onChange:function(e){y(e.target.checked)},id:"assetCheckbox"}),r.a.createElement("label",{className:"form-check-label",htmlFor:"assetCheckbox"},"Add asset")),v&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"asset"},"Asset"),r.a.createElement(qe.a,{name:"asset",component:"select",className:lt()("form-control")},r.a.createElement("option",{value:"none"},"Choose asset"),Object.keys((null===a||void 0===a?void 0:a.assets)||{}).map((function(e){return r.a.createElement("option",{key:e,value:e},e)})))),i.asset&&"none"!==i.asset&&r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"assetAmount"},"Asset amount"),r.a.createElement(qe.a,{name:"assetAmount",className:lt()("form-control"),render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"assetAmount",className:lt()("form-control",{"is-invalid":a.touched&&a.error}),type:"float",placeholder:"0,000"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}}))),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"fee"},"Fee (in ERG)"),r.a.createElement(qe.a,{name:"fee",value:"0.001",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"fee",className:lt()("form-control",{"is-invalid":a.touched&&a.error}),type:"float",placeholder:"Minimum 0.001 ERG"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:n||Object.keys(u).length>0||l||"none"===i.asset},"Send")),r.a.createElement(_t,{open:f,onClose:function(){b(!1)},title:"Payment sent",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("p",null,"Your payment has been sent successfully. The transaction ID is -"," ",r.a.createElement(ke,null,m)),r.a.createElement("p",null,r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://".concat(c,".ergoplatform.com/en/transactions/").concat(m)},"Click Here To Go To The Explorer"))),primaryButtonContent:r.a.createElement("span",{className:"pl-3 pr-3"},"OK"),secondaryButtonContent:"Send again",onPrimaryHandler:function(){return function(e){e.restart(),b(!1)}(s)}}))}})))},xt=function(e){var t=e.apiKey,a=e.getWalletBalance,l=e.explorerSubdomain,c=Object(n.useState)(null),o=Object(J.a)(c,2),s=o[0],i=o[1],m=Object(n.useState)(!1),u=Object(J.a)(m,2),d=u[0],p=u[1],f=Object(n.useState)(null),b=Object(J.a)(f,2),h=b[0],E=b[1],v=Object(n.useState)(null),y=Object(J.a)(v,2),g=y[0],N=y[1],O=Object(n.useCallback)((function(e){var a=e.name,n=e.amount,r=e.decimals,l=e.description,c=e.fee;E(n),N(a);var o={name:a,amount:n,decimals:r,description:l};return le.post("/wallet/transaction/send",{requests:[o],fee:Number((parseFloat(c)*w).toFixed(1))},{headers:{api_key:t}})}),[t,E,N]),j=Object(n.useCallback)((function(e){return O(e).then((function(e){var t=e.data;i(t),p(!0),a()})).catch((function(e){var t=e.data?e.data.detail:e.message;oe("error",t)}))}),[O,a]);return r.a.createElement("div",{className:"card bg-white p-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Issue Tokens"),r.a.createElement(qe.b,{onSubmit:j,validate:function(e){var t={};return e.name||(t.name="The field cannot be empty"),e.amount||(t.amount="The field cannot be empty"),e.decimals||(t.decimals="The field cannot be empty"),e.description||(t.description="The field cannot be empty"),(!e.fee||Number(e.fee)<.001)&&(t.fee="Minimum 0.001 ERG"),!Number.isInteger(Number(e.amount))&&e.amount&&(t.amount="Should be an integer"),!Number.isInteger(Number(e.decimals))&&e.decimals&&(t.decimals="Should be an integer"),Number(e.fee)<0&&(t.fee="Fee can't be negative"),t},initialValues:{fee:.001},render:function(e){var t=e.handleSubmit,a=e.submitting,n=e.pristine,c=e.form,o=e.errors;return r.a.createElement(r.a.Fragment,null,r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"name"},"Asset name"),r.a.createElement(qe.a,{name:"name",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"name",type:"text",placeholder:"Enter asset name",className:lt()("form-control",{"is-invalid":a.touched&&a.error})},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"amount"},"Net amount"),r.a.createElement(qe.a,{name:"amount",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"amount",type:"text",placeholder:"Enter net amount",className:lt()("form-control",{"is-invalid":a.touched&&a.error})},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"decimals"},"Decimal places"),r.a.createElement(qe.a,{name:"decimals",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"decimals",type:"text",placeholder:"Enter decimals as integer",className:lt()("form-control",{"is-invalid":a.touched&&a.error})},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"description"},"Brief description"),r.a.createElement(qe.a,{name:"description",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("textarea",Object.assign({id:"description",className:lt()("form-control",{"is-invalid":a.touched&&a.error}),placeholder:"Add asset description"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"fee"},"Fee (in ERG)"),r.a.createElement(qe.a,{name:"fee",value:"0.001",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"fee",className:lt()("form-control",{"is-invalid":a.touched&&a.error}),type:"float",placeholder:"Minimum 0.001 ERG"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:a||Object.keys(o).length>0||n},"Issue")),r.a.createElement(_t,{open:d,onClose:function(){p(!1)},title:"Congratulations!",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("p",null,"You have successfully issued ".concat(h," ").concat(g," tokens! The transaction ID is\n"),r.a.createElement(ke,null,s)),r.a.createElement("p",null,r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://".concat(l,".ergoplatform.com/en/transactions/").concat(s)},"Click Here To View Transaction"))),primaryButtonContent:r.a.createElement("span",{className:"pl-3 pr-3"},"OK"),secondaryButtonContent:"Send again",onPrimaryHandler:function(){return function(e){e.restart(),p(!1)}(c)}}))}}))};a(138);function Wt(){return(Wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}function At(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)a=l[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var It=r.a.createElement("g",null,r.a.createElement("path",{d:"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z"})),Bt=r.a.createElement("g",null),Pt=r.a.createElement("g",null),Ft=r.a.createElement("g",null),zt=r.a.createElement("g",null),Tt=r.a.createElement("g",null),Lt=r.a.createElement("g",null),Mt=r.a.createElement("g",null),Ht=r.a.createElement("g",null),Kt=r.a.createElement("g",null),Rt=r.a.createElement("g",null),Ut=r.a.createElement("g",null),Dt=r.a.createElement("g",null),Gt=r.a.createElement("g",null),Vt=r.a.createElement("g",null),Yt=r.a.createElement("g",null),qt=function(e){var t=e.svgRef,a=e.title,n=At(e,["svgRef","title"]);return r.a.createElement("svg",Wt({id:"Capa_1",x:"0px",y:"0px",width:"32px",height:"32px",viewBox:"0 0 40.499 40.5",style:{enableBackground:"new 0 0 40.499 40.5"},xmlSpace:"preserve",ref:t},n),a?r.a.createElement("title",null,a):null,It,Bt,Pt,Ft,zt,Tt,Lt,Mt,Ht,Kt,Rt,Ut,Dt,Gt,Vt,Yt)},Zt=r.a.forwardRef((function(e,t){return r.a.createElement(qt,Wt({svgRef:t},e))})),Jt=(a.p,function(e){var t=e.className;return Ot(Zt,t)}),$t=function(e){var t,a,l=e.name,c=e.value,o=Object(n.useState)(!1),s=Object(J.a)(o,2),i=s[0],m=s[1];return Array.isArray(c)?(t=c.length,a=r.a.createElement("div",null,c.map((function(e){return r.a.createElement("div",{key:e.name},r.a.createElement("div",null,e.value||""," ",e.name||""),r.a.createElement("br",null))})))):(t=c,a=c),r.a.createElement("div",{className:"wallet-table__item"},r.a.createElement("div",{className:lt()("wallet-table-item-header",{"wallet-table-item-header--opened":i})},r.a.createElement("div",{className:"wallet-table-item-header__title"},l),r.a.createElement("div",{className:"wallet-table-item-header__right-side"},!i&&r.a.createElement("div",{className:"wallet-table-item-header__opacity-paragraph"},t),r.a.createElement("a",{className:"wallet-table-item-header__link",onClick:function(){return m((function(e){return!e}))}},!i&&"More",i&&r.a.createElement(jt,null)))),i&&r.a.createElement("div",{className:"wallet-table-item-body"},a))},Qt=Object(s.b)((function(e){return{walletBalance:K(e),ergPrice:U(e),walletAddresses:R(e),explorerSubdomain:x(e)}}),(function(e){return{dispatchGetWalletBalance:function(){return e(Z.getWalletBalance())},dispatchGetErgPrice:function(){return e(Z.getErgPrice())},dispatchGetWalletAddresses:function(){return e(Z.getWalletAddresses())}}}))((function(e){var t=e.walletBalance,a=e.dispatchGetWalletBalance,l=e.dispatchGetErgPrice,c=e.dispatchGetWalletAddresses,o=e.walletAddresses,s=e.explorerSubdomain,i=Object(n.useCallback)((function(){a(),l(),c()}),[a,l,c]),m=Object(n.useCallback)((function(e,t){return 0===e.length?0:e.map((function(e){return{value:r.a.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://".concat(t,".ergoplatform.com/en/addresses/").concat(e)},e)}}))}),[]),u=Object(n.useCallback)((function(e){return 0===Object.values(e).length?0:Object.keys(e).map((function(t){return{name:r.a.createElement("span",{className:"text-muted"},t),value:r.a.createElement("span",{className:"font-weight-bold"},e[t])}}))}),[]);Object(n.useEffect)((function(){i()}),[i]);var d=Object(n.useMemo)((function(){return[{name:"Balance",value:t?"".concat(t.balance/w," ERG"):"loading..."},{name:"Assets",value:t?u(t.assets):"Loading..."},{name:"Addresses",value:o?m(o,s):"Loading..."}]}),[t,u,o,m,s]),p=Object(n.useCallback)((function(){i()}),[i]);return r.a.createElement("div",{className:"wallet-table"},r.a.createElement("div",{className:"wallet-table__header"},r.a.createElement("h2",{className:"wallet-table__title"},"Wallet Information"," ",r.a.createElement("button",{type:"button",className:"wallet-table__icon-redo",onClick:p},r.a.createElement(Jt,null)))),r.a.createElement("div",{className:"wallet-table__body"},d.map((function(e){var t=e.value,a=e.name;return r.a.createElement($t,{key:a,name:a,value:t})}))))})),Xt=(a(139),function(e){Object(j.a)(a,e);var t=Object(k.a)(a);function a(){var e;Object(N.a)(this,a);for(var n=arguments.length,l=new Array(n),c=0;c<n;c++)l[c]=arguments[c];return(e=t.call.apply(t,[this].concat(l))).renderState=function(t){return{unlocked:function(t,a,n,r){return e.renderWalletUnlockedState(t,a,n,r)},locked:function(){return e.renderWalletLockedState()},initialized:function(t){return e.renderInitializedState(t)}}[t]},e.renderWalletLockedState=function(){return r.a.createElement("div",{className:"container-fluid pt-4"},r.a.createElement("p",null,"The wallet UI is locked. You need to unlock the wallet to access its UI."))},e.renderInitializedState=function(){return r.a.createElement("div",{className:"container-fluid pt-4"},r.a.createElement("p",null,"You need to initialize your wallet to access wallet UI."))},e.renderWalletUnlockedState=function(e,t,a,n){return r.a.createElement("div",{className:"wallet-container"},r.a.createElement("div",null,r.a.createElement(Qt,null)),r.a.createElement("div",null,r.a.createElement(Ct,{apiKey:e,walletBalanceData:t,getWalletBalance:a,explorerSubdomain:n})),r.a.createElement("div",null,r.a.createElement(xt,{apiKey:e,getWalletBalance:a,explorerSubdomain:n})))},e}return Object(O.a)(a,[{key:"render",value:function(){var e=this.props,t=e.apiKey,a=e.isWalletUnlocked,n=e.isWalletInitialized,l=e.walletBalanceData,c=e.dispatchGetWalletBalance,o=e.explorerSubdomain;return""===t?r.a.createElement("div",{className:"container-fluid pt-4"},r.a.createElement("p",null,"To continue, please set your API key.")):n?a?this.renderState("unlocked")(t,l,c,o):this.renderState("locked")():this.renderState("initialized")(t)}}]),a}(n.Component)),ea=Object(s.b)((function(e){return{apiKey:z(e),isWalletInitialized:M(e),isWalletUnlocked:L(e),walletBalanceData:K(e),explorerSubdomain:x(e)}}),(function(e){return{dispatchGetWalletBalance:function(){return e(Z.getWalletBalance())}}}))(Object(n.memo)(Xt)),ta=Object(s.b)(null,(function(e){return{dispatchGetNetwork:function(){return e(b.getNetwork())}}}))(Object(n.memo)((function(e){var t=e.dispatchGetNetwork;return Object(n.useEffect)((function(){t()}),[]),r.a.createElement(i.a,{basename:"/panel"},r.a.createElement(Le,null,r.a.createElement(m.c,null,r.a.createElement(m.a,{exact:!0,path:"/",component:Ye}),r.a.createElement(m.a,{exact:!0,path:"/wallet",component:ea}))))}))),aa=a(99),na=a(27),ra=Object(na.combineReducers)({app:Q.reducer,node:p.reducer,wallet:D.reducer}),la=function(e){return function(t){return function(a){var n=e.dispatch,r=e.getState,l=z(r());switch(a.type){case Z.checkWalletStatus.type:le.get("/wallet/status",{headers:{api_key:l}}).then((function(e){var t=e.data;n(Z.setIsWalletUnlocked(t.isUnlocked)),n(Z.setIsWalletInitialized(t.isInitialized)),n(Z.setWalletStatusData(t))})).catch((function(){}));break;case Z.getWalletBalance.type:le.get("/wallet/balances",{headers:{api_key:l}}).then((function(e){var t=e.data;n(Z.setWalletBalanceData(t))})).catch((function(){}));break;case Z.getWalletAddresses.type:le.get("/wallet/addresses",{headers:{api_key:l}}).then((function(e){var t=e.data;n(Z.setWalletAddresses(t))})).catch((function(){}))}t(a)}}},ca=function(e){return function(t){return function(a){var n=e.dispatch;switch(a.type){case b.getNetwork.type:le.get("/info",{}).then((function(e){var t=e.data;n(b.setNetwork(t.network))})).catch((function(){}))}t(a)}}};a(140),a(141),a(142);o.a.configure();var oa=Object(d.a)({reducer:ra,middleware:[].concat(Object(aa.a)(Object(d.d)()),[la,ca])}),sa=function(){return r.a.createElement(s.a,{store:oa},r.a.createElement(ta,null))};c.a.render(r.a.createElement(sa,null),document.getElementById("root"))},68:function(e,t,a){e.exports={backdrop:"Backdrop_backdrop__PmdBI",content:"Backdrop_content__2Kmrw",layer:"Backdrop_layer__3V2YH"}},97:function(e,t,a){e.exports=a.p+"static/media/logotype_white.4dcfd639.svg"}},[[103,1,2]]]);
  //# sourceMappingURL=main.2df85f5c.chunk.js.map