@ethersphere/bee-dashboard 0.7.0 → 0.11.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.
- package/CHANGELOG.md +63 -0
- package/README.md +27 -12
- package/build/asset-manifest.json +12 -12
- package/build/index.html +1 -1
- package/build/static/js/2.4ff98457.chunk.js +3 -0
- package/build/static/js/{2.8c0609fe.chunk.js.LICENSE.txt → 2.4ff98457.chunk.js.LICENSE.txt} +13 -0
- package/build/static/js/2.4ff98457.chunk.js.map +1 -0
- package/build/static/js/3.11a1627e.chunk.js +2 -0
- package/build/static/js/3.11a1627e.chunk.js.map +1 -0
- package/build/static/js/main.2ee7499d.chunk.js +2 -0
- package/build/static/js/main.2ee7499d.chunk.js.map +1 -0
- package/build/static/js/{runtime-main.ffdbbcc1.js → runtime-main.6c2da3b6.js} +2 -2
- package/build/static/js/{runtime-main.ffdbbcc1.js.map → runtime-main.6c2da3b6.js.map} +1 -1
- package/lib/App.js +105277 -0
- package/package.json +69 -39
- package/serve.js +0 -0
- package/build/static/js/2.8c0609fe.chunk.js +0 -3
- package/build/static/js/2.8c0609fe.chunk.js.map +0 -1
- package/build/static/js/3.86164d1b.chunk.js +0 -2
- package/build/static/js/3.86164d1b.chunk.js.map +0 -1
- package/build/static/js/main.396e3ebb.chunk.js +0 -2
- package/build/static/js/main.396e3ebb.chunk.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[3],{646:function(e,t,n){"use strict";n.r(t),n.d(t,"getCLS",(function(){return m})),n.d(t,"getFCP",(function(){return g})),n.d(t,"getFID",(function(){return F})),n.d(t,"getLCP",(function(){return k})),n.d(t,"getTTFB",(function(){return C}));var i,a,r,o,c=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:"v1-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},u=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},s=function(e,t){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},f=function(e){addEventListener("pageshow",(function(t){t.persisted&&e(t)}),!0)},d="function"==typeof WeakSet?new WeakSet:new Set,p=function(e,t,n){var i;return function(){t.value>=0&&(n||d.has(t)||"hidden"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},m=function(e,t){var n,i=c("CLS",0),a=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},r=u("layout-shift",a);r&&(n=p(e,i,t),s((function(){r.takeRecords().map(a),n()})),f((function(){i=c("CLS",0),n=p(e,i,t)})))},v=-1,l=function(){return"hidden"===document.visibilityState?0:1/0},h=function(){s((function(e){var t=e.timeStamp;v=t}),!0)},S=function(){return v<0&&(v=l(),h(),f((function(){setTimeout((function(){v=l(),h()}),0)}))),{get timeStamp(){return v}}},g=function(e,t){var n,i=S(),a=c("FCP"),r=u("paint",(function(e){"first-contentful-paint"===e.name&&(r&&r.disconnect(),e.startTime<i.timeStamp&&(a.value=e.startTime,a.entries.push(e),d.add(a),n()))}));r&&(n=p(e,a,t),f((function(i){a=c("FCP"),n=p(e,a,t),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,d.add(a),n()}))}))})))},y={passive:!0,capture:!0},w=new Date,E=function(e,t){i||(i=t,a=e,r=new Date,T(removeEventListener),L())},L=function(){if(a>=0&&a<r-w){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+a};o.forEach((function(t){t(e)})),o=[]}},b=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){E(e,t),a()},i=function(){a()},a=function(){removeEventListener("pointerup",n,y),removeEventListener("pointercancel",i,y)};addEventListener("pointerup",n,y),addEventListener("pointercancel",i,y)}(t,e):E(t,e)}},T=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,b,y)}))},F=function(e,t){var n,r=S(),m=c("FID"),v=function(e){e.startTime<r.timeStamp&&(m.value=e.processingStart-e.startTime,m.entries.push(e),d.add(m),n())},l=u("first-input",v);n=p(e,m,t),l&&s((function(){l.takeRecords().map(v),l.disconnect()}),!0),l&&f((function(){var r;m=c("FID"),n=p(e,m,t),o=[],a=-1,i=null,T(addEventListener),r=v,o.push(r),L()}))},k=function(e,t){var n,i=S(),a=c("LCP"),r=function(e){var t=e.startTime;t<i.timeStamp&&(a.value=t,a.entries.push(e)),n()},o=u("largest-contentful-paint",r);if(o){n=p(e,a,t);var m=function(){d.has(a)||(o.takeRecords().map(r),o.disconnect(),d.add(a),n())};["keydown","click"].forEach((function(e){addEventListener(e,m,{once:!0,capture:!0})})),s(m,!0),f((function(i){a=c("LCP"),n=p(e,a,t),requestAnimationFrame((function(){requestAnimationFrame((function(){a.value=performance.now()-i.timeStamp,d.add(a),n()}))}))}))}},C=function(e){var t,n=c("TTFB");t=function(){try{var t=performance.getEntriesByType("navigation")[0]||function(){var e=performance.timing,t={entryType:"navigation",startTime:0};for(var n in e)"navigationStart"!==n&&"toJSON"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();n.value=n.delta=t.responseStart,n.entries=[t],e(n)}catch(e){}},"complete"===document.readyState?setTimeout(t,0):addEventListener("pageshow",t)}}}]);
|
|
2
|
-
//# sourceMappingURL=3.86164d1b.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../node_modules/web-vitals/dist/web-vitals.js"],"names":["e","t","n","i","a","name","value","delta","entries","id","concat","Date","now","Math","floor","random","r","PerformanceObserver","supportedEntryTypes","includes","getEntries","map","observe","type","buffered","o","document","visibilityState","removeEventListener","addEventListener","c","persisted","u","WeakSet","Set","s","has","f","hadRecentInput","push","takeRecords","m","v","d","timeStamp","p","setTimeout","l","disconnect","startTime","add","requestAnimationFrame","performance","h","passive","capture","S","y","w","g","entryType","target","cancelable","processingStart","forEach","E","L","T","once","b","getEntriesByType","timing","max","navigationStart","responseStart","readyState"],"mappings":"gJAAA,+MAAIA,EAAEC,EAAEC,EAAEC,EAAEC,EAAE,SAASJ,EAAEC,GAAG,MAAM,CAACI,KAAKL,EAAEM,WAAM,IAASL,GAAG,EAAEA,EAAEM,MAAM,EAAEC,QAAQ,GAAGC,GAAG,MAAMC,OAAOC,KAAKC,MAAM,KAAKF,OAAOG,KAAKC,MAAM,cAAcD,KAAKE,UAAU,QAAQC,EAAE,SAAShB,EAAEC,GAAG,IAAI,GAAGgB,oBAAoBC,oBAAoBC,SAASnB,GAAG,CAAC,IAAIE,EAAE,IAAIe,qBAAqB,SAASjB,GAAG,OAAOA,EAAEoB,aAAaC,IAAIpB,MAAM,OAAOC,EAAEoB,QAAQ,CAACC,KAAKvB,EAAEwB,UAAS,IAAKtB,GAAG,MAAMF,MAAMyB,EAAE,SAASzB,EAAEC,GAAG,IAAIC,EAAE,SAASA,EAAEC,GAAG,aAAaA,EAAEoB,MAAM,WAAWG,SAASC,kBAAkB3B,EAAEG,GAAGF,IAAI2B,oBAAoB,mBAAmB1B,GAAE,GAAI0B,oBAAoB,WAAW1B,GAAE,MAAO2B,iBAAiB,mBAAmB3B,GAAE,GAAI2B,iBAAiB,WAAW3B,GAAE,IAAK4B,EAAE,SAAS9B,GAAG6B,iBAAiB,YAAY,SAAS5B,GAAGA,EAAE8B,WAAW/B,EAAEC,MAAK,IAAK+B,EAAE,mBAAmBC,QAAQ,IAAIA,QAAQ,IAAIC,IAAIC,EAAE,SAASnC,EAAEC,EAAEC,GAAG,IAAIC,EAAE,OAAO,WAAWF,EAAEK,OAAO,IAAIJ,GAAG8B,EAAEI,IAAInC,IAAI,WAAWyB,SAASC,mBAAmB1B,EAAEM,MAAMN,EAAEK,OAAOH,GAAG,IAAIF,EAAEM,YAAO,IAASJ,KAAKA,EAAEF,EAAEK,MAAMN,EAAEC,OAAOoC,EAAE,SAASrC,EAAEC,GAAG,IAAIC,EAAEC,EAAEC,EAAE,MAAM,GAAG4B,EAAE,SAAShC,GAAGA,EAAEsC,iBAAiBnC,EAAEG,OAAON,EAAEM,MAAMH,EAAEK,QAAQ+B,KAAKvC,GAAGE,MAAMmC,EAAErB,EAAE,eAAegB,GAAGK,IAAInC,EAAEiC,EAAEnC,EAAEG,EAAEF,GAAGwB,GAAG,WAAWY,EAAEG,cAAcnB,IAAIW,GAAG9B,OAAO4B,GAAG,WAAW3B,EAAEC,EAAE,MAAM,GAAGF,EAAEiC,EAAEnC,EAAEG,EAAEF,QAAQwC,GAAG,EAAEC,EAAE,WAAW,MAAM,WAAWhB,SAASC,gBAAgB,EAAE,KAAKgB,EAAE,WAAWlB,GAAG,SAASzB,GAAG,IAAIC,EAAED,EAAE4C,UAAUH,EAAExC,KAAI,IAAK4C,EAAE,WAAW,OAAOJ,EAAE,IAAIA,EAAEC,IAAIC,IAAIb,GAAG,WAAWgB,YAAY,WAAWL,EAAEC,IAAIC,MAAM,OAAO,CAAC,gBAAgB,OAAOF,KAAKM,EAAE,SAAS/C,EAAEC,GAAG,IAAIC,EAAEC,EAAE0C,IAAIpB,EAAErB,EAAE,OAAOiC,EAAErB,EAAE,SAAS,SAAShB,GAAG,2BAA2BA,EAAEK,OAAOgC,GAAGA,EAAEW,aAAahD,EAAEiD,UAAU9C,EAAEyC,YAAYnB,EAAEnB,MAAMN,EAAEiD,UAAUxB,EAAEjB,QAAQ+B,KAAKvC,GAAGgC,EAAEkB,IAAIzB,GAAGvB,SAASmC,IAAInC,EAAEiC,EAAEnC,EAAEyB,EAAExB,GAAG6B,GAAG,SAAS3B,GAAGsB,EAAErB,EAAE,OAAOF,EAAEiC,EAAEnC,EAAEyB,EAAExB,GAAGkD,uBAAuB,WAAWA,uBAAuB,WAAW1B,EAAEnB,MAAM8C,YAAYxC,MAAMT,EAAEyC,UAAUZ,EAAEkB,IAAIzB,GAAGvB,eAAemD,EAAE,CAACC,SAAQ,EAAGC,SAAQ,GAAIC,EAAE,IAAI7C,KAAK8C,EAAE,SAAStD,EAAEC,GAAGJ,IAAIA,EAAEI,EAAEH,EAAEE,EAAED,EAAE,IAAIS,KAAK+C,EAAE9B,qBAAqB+B,MAAMA,EAAE,WAAW,GAAG1D,GAAG,GAAGA,EAAEC,EAAEsD,EAAE,CAAC,IAAIpD,EAAE,CAACwD,UAAU,cAAcvD,KAAKL,EAAEuB,KAAKsC,OAAO7D,EAAE6D,OAAOC,WAAW9D,EAAE8D,WAAWb,UAAUjD,EAAE4C,UAAUmB,gBAAgB/D,EAAE4C,UAAU3C,GAAGE,EAAE6D,SAAS,SAAShE,GAAGA,EAAEI,MAAMD,EAAE,KAAK8D,EAAE,SAASjE,GAAG,GAAGA,EAAE8D,WAAW,CAAC,IAAI7D,GAAGD,EAAE4C,UAAU,KAAK,IAAIjC,KAAKyC,YAAYxC,OAAOZ,EAAE4C,UAAU,eAAe5C,EAAEuB,KAAK,SAASvB,EAAEC,GAAG,IAAIC,EAAE,WAAWuD,EAAEzD,EAAEC,GAAGG,KAAKD,EAAE,WAAWC,KAAKA,EAAE,WAAWwB,oBAAoB,YAAY1B,EAAEmD,GAAGzB,oBAAoB,gBAAgBzB,EAAEkD,IAAIxB,iBAAiB,YAAY3B,EAAEmD,GAAGxB,iBAAiB,gBAAgB1B,EAAEkD,GAA9N,CAAkOpD,EAAED,GAAGyD,EAAExD,EAAED,KAAK0D,EAAE,SAAS1D,GAAG,CAAC,YAAY,UAAU,aAAa,eAAegE,SAAS,SAAS/D,GAAG,OAAOD,EAAEC,EAAEgE,EAAEZ,OAAOa,EAAE,SAAShE,EAAEmC,GAAG,IAAII,EAAEC,EAAEG,IAAIF,EAAEvC,EAAE,OAAO2C,EAAE,SAAS/C,GAAGA,EAAEiD,UAAUP,EAAEE,YAAYD,EAAErC,MAAMN,EAAE+D,gBAAgB/D,EAAEiD,UAAUN,EAAEnC,QAAQ+B,KAAKvC,GAAGgC,EAAEkB,IAAIP,GAAGF,MAAMY,EAAErC,EAAE,cAAc+B,GAAGN,EAAEN,EAAEjC,EAAEyC,EAAEN,GAAGgB,GAAG5B,GAAG,WAAW4B,EAAEb,cAAcnB,IAAI0B,GAAGM,EAAEL,gBAAe,GAAIK,GAAGvB,GAAG,WAAW,IAAId,EAAE2B,EAAEvC,EAAE,OAAOqC,EAAEN,EAAEjC,EAAEyC,EAAEN,GAAGlC,EAAE,GAAGF,GAAG,EAAED,EAAE,KAAK0D,EAAE7B,kBAAkBb,EAAE+B,EAAE5C,EAAEoC,KAAKvB,GAAG2C,QAAQQ,EAAE,SAASnE,EAAEC,GAAG,IAAIC,EAAEC,EAAE0C,IAAIR,EAAEjC,EAAE,OAAOqC,EAAE,SAASzC,GAAG,IAAIC,EAAED,EAAEiD,UAAUhD,EAAEE,EAAEyC,YAAYP,EAAE/B,MAAML,EAAEoC,EAAE7B,QAAQ+B,KAAKvC,IAAIE,KAAKwC,EAAE1B,EAAE,2BAA2ByB,GAAG,GAAGC,EAAE,CAACxC,EAAEiC,EAAEnC,EAAEqC,EAAEpC,GAAG,IAAI0C,EAAE,WAAWX,EAAEI,IAAIC,KAAKK,EAAEF,cAAcnB,IAAIoB,GAAGC,EAAEM,aAAahB,EAAEkB,IAAIb,GAAGnC,MAAM,CAAC,UAAU,SAAS8D,SAAS,SAAShE,GAAG6B,iBAAiB7B,EAAE2C,EAAE,CAACyB,MAAK,EAAGb,SAAQ,OAAQ9B,EAAEkB,GAAE,GAAIb,GAAG,SAAS3B,GAAGkC,EAAEjC,EAAE,OAAOF,EAAEiC,EAAEnC,EAAEqC,EAAEpC,GAAGkD,uBAAuB,WAAWA,uBAAuB,WAAWd,EAAE/B,MAAM8C,YAAYxC,MAAMT,EAAEyC,UAAUZ,EAAEkB,IAAIb,GAAGnC,eAAemE,EAAE,SAASrE,GAAG,IAAIC,EAAEC,EAAEE,EAAE,QAAQH,EAAE,WAAW,IAAI,IAAIA,EAAEmD,YAAYkB,iBAAiB,cAAc,IAAI,WAAW,IAAItE,EAAEoD,YAAYmB,OAAOtE,EAAE,CAAC2D,UAAU,aAAaX,UAAU,GAAG,IAAI,IAAI/C,KAAKF,EAAE,oBAAoBE,GAAG,WAAWA,IAAID,EAAEC,GAAGW,KAAK2D,IAAIxE,EAAEE,GAAGF,EAAEyE,gBAAgB,IAAI,OAAOxE,EAAhL,GAAqLC,EAAEI,MAAMJ,EAAEK,MAAMN,EAAEyE,cAAcxE,EAAEM,QAAQ,CAACP,GAAGD,EAAEE,GAAG,MAAMF,MAAM,aAAa0B,SAASiD,WAAW7B,WAAW7C,EAAE,GAAG4B,iBAAiB,WAAW5B","file":"static/js/3.86164d1b.chunk.js","sourcesContent":["var e,t,n,i,a=function(e,t){return{name:e,value:void 0===t?-1:t,delta:0,entries:[],id:\"v1-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12)}},r=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},o=function(e,t){var n=function n(i){\"pagehide\"!==i.type&&\"hidden\"!==document.visibilityState||(e(i),t&&(removeEventListener(\"visibilitychange\",n,!0),removeEventListener(\"pagehide\",n,!0)))};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},c=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&e(t)}),!0)},u=\"function\"==typeof WeakSet?new WeakSet:new Set,s=function(e,t,n){var i;return function(){t.value>=0&&(n||u.has(t)||\"hidden\"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=function(e,t){var n,i=a(\"CLS\",0),u=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},f=r(\"layout-shift\",u);f&&(n=s(e,i,t),o((function(){f.takeRecords().map(u),n()})),c((function(){i=a(\"CLS\",0),n=s(e,i,t)})))},m=-1,v=function(){return\"hidden\"===document.visibilityState?0:1/0},d=function(){o((function(e){var t=e.timeStamp;m=t}),!0)},p=function(){return m<0&&(m=v(),d(),c((function(){setTimeout((function(){m=v(),d()}),0)}))),{get timeStamp(){return m}}},l=function(e,t){var n,i=p(),o=a(\"FCP\"),f=r(\"paint\",(function(e){\"first-contentful-paint\"===e.name&&(f&&f.disconnect(),e.startTime<i.timeStamp&&(o.value=e.startTime,o.entries.push(e),u.add(o),n()))}));f&&(n=s(e,o,t),c((function(i){o=a(\"FCP\"),n=s(e,o,t),requestAnimationFrame((function(){requestAnimationFrame((function(){o.value=performance.now()-i.timeStamp,u.add(o),n()}))}))})))},h={passive:!0,capture:!0},S=new Date,y=function(i,a){e||(e=a,t=i,n=new Date,w(removeEventListener),g())},g=function(){if(t>=0&&t<n-S){var a={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};i.forEach((function(e){e(a)})),i=[]}},E=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){y(e,t),a()},i=function(){a()},a=function(){removeEventListener(\"pointerup\",n,h),removeEventListener(\"pointercancel\",i,h)};addEventListener(\"pointerup\",n,h),addEventListener(\"pointercancel\",i,h)}(t,e):y(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,E,h)}))},L=function(n,f){var m,v=p(),d=a(\"FID\"),l=function(e){e.startTime<v.timeStamp&&(d.value=e.processingStart-e.startTime,d.entries.push(e),u.add(d),m())},h=r(\"first-input\",l);m=s(n,d,f),h&&o((function(){h.takeRecords().map(l),h.disconnect()}),!0),h&&c((function(){var r;d=a(\"FID\"),m=s(n,d,f),i=[],t=-1,e=null,w(addEventListener),r=l,i.push(r),g()}))},T=function(e,t){var n,i=p(),f=a(\"LCP\"),m=function(e){var t=e.startTime;t<i.timeStamp&&(f.value=t,f.entries.push(e)),n()},v=r(\"largest-contentful-paint\",m);if(v){n=s(e,f,t);var d=function(){u.has(f)||(v.takeRecords().map(m),v.disconnect(),u.add(f),n())};[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,d,{once:!0,capture:!0})})),o(d,!0),c((function(i){f=a(\"LCP\"),n=s(e,f,t),requestAnimationFrame((function(){requestAnimationFrame((function(){f.value=performance.now()-i.timeStamp,u.add(f),n()}))}))}))}},b=function(e){var t,n=a(\"TTFB\");t=function(){try{var t=performance.getEntriesByType(\"navigation\")[0]||function(){var e=performance.timing,t={entryType:\"navigation\",startTime:0};for(var n in e)\"navigationStart\"!==n&&\"toJSON\"!==n&&(t[n]=Math.max(e[n]-e.navigationStart,0));return t}();n.value=n.delta=t.responseStart,n.entries=[t],e(n)}catch(e){}},\"complete\"===document.readyState?setTimeout(t,0):addEventListener(\"pageshow\",t)};export{f as getCLS,l as getFCP,L as getFID,T as getLCP,b as getTTFB};\n"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{191:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},240:function(e,t,n){},241:function(e,t,n){},522:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(13),i=n.n(c),s=(n(240),n(33)),o=(n(241),n(634)),l=n(635),u=n(43),d=n(20),j=n(525),b=n(220),h=n(7),p=n(579),x=n(580),O=n(71),m=n(640),g=n(581),f=n(582),v=n(583),y=n(1),w=Object(j.a)((function(){return Object(b.a)({root:{display:"flex",flex:"1 1 auto",flexDirection:"column"},status:{color:"#2145a0",backgroundColor:"#e1effe"}})}));var k=function(e){var t=e.userBeeVersion,n=e.nodeAddresses,r=e.nodeTopology,c=e.isLatestBeeVersion,i=e.latestUrl,o=w(),l=Object(a.useState)(!1),u=Object(h.a)(l,2),d=u[0],j=u[1];return Object(y.jsx)(p.a,{children:Object(y.jsx)(x.a,{className:o.root,children:Object(y.jsxs)(y.Fragment,{children:[Object(y.jsxs)("div",{style:{marginBottom:"20px"},children:[Object(y.jsxs)("span",{style:{marginRight:"20px"},children:["Discovered Nodes: ",null===r||void 0===r?void 0:r.population]}),Object(y.jsxs)("span",{style:{marginRight:"20px"},children:[Object(y.jsx)("span",{children:"Connected Peers: "}),Object(y.jsx)(s.b,{to:Sn.PEERS,children:null===r||void 0===r?void 0:r.connected})]})]}),Object(y.jsxs)("div",{children:[Object(y.jsxs)(O.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(y.jsx)("span",{children:"AGENT: "}),Object(y.jsx)("a",{href:"https://github.com/ethersphere/bee",rel:"noreferrer",target:"_blank",children:"Bee"})," ",Object(y.jsx)("span",{children:t||"-"}),c?Object(y.jsx)(m.a,{style:{marginLeft:"7px",color:"#2145a0"},size:"small",label:"latest",className:o.status}):Object(y.jsx)(g.a,{size:"small",variant:"outlined",href:i,children:"update"})]}),Object(y.jsxs)(O.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(y.jsx)("span",{children:"PUBLIC KEY: "}),Object(y.jsx)("span",{children:(null===n||void 0===n?void 0:n.publicKey)?n.publicKey:"-"})]}),Object(y.jsxs)(O.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(y.jsx)("span",{children:"PSS PUBLIC KEY: "}),Object(y.jsx)("span",{children:(null===n||void 0===n?void 0:n.pssPublicKey)?n.pssPublicKey:"-"})]}),Object(y.jsxs)(O.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(y.jsx)("span",{children:"OVERLAY ADDRESS (PEER ID): "}),Object(y.jsx)("span",{children:(null===n||void 0===n?void 0:n.overlay)?n.overlay:"-"})]}),Object(y.jsxs)(O.a,{component:"div",variant:"subtitle2",gutterBottom:!0,children:[Object(y.jsx)(O.a,{component:"div",onClick:function(){return j(!d)},children:Object(y.jsxs)(g.a,{color:"primary",style:{padding:0,marginTop:"6px"},children:[d?Object(y.jsx)(f.a,{style:{fontSize:"12px"}}):Object(y.jsx)(v.a,{style:{fontSize:"12px"}}),Object(y.jsx)("span",{children:"Underlay Addresses"})]})}),d&&Object(y.jsx)("div",{children:null===n||void 0===n?void 0:n.underlay.map((function(e){return Object(y.jsx)("li",{children:e},e)}))})]})]})]})})})},S=n(188),B=n.n(S),C=n(526),A=n(585),N=n(587),I=n(584);function P(e){var t=Object(a.useState)(!1),n=Object(h.a)(t,2),r=n[0],c=n[1];return Object(y.jsxs)("div",{children:[Object(y.jsx)(C.a,{color:"primary",size:"small",onClick:function(){c(!0)},children:Object(y.jsx)(I.a,{})}),Object(y.jsx)(A.a,{onClose:function(){c(!1)},"aria-labelledby":"simple-dialog-title",open:r,children:Object(y.jsxs)("div",{style:{padding:"30px",textAlign:"center"},children:[Object(y.jsx)(N.a,{id:"simple-dialog-title",children:e.label}),Object(y.jsx)(B.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}var L=n(189),T=n(588);function D(e){var t=e.value,n=Object(u.b)().enqueueSnackbar;return Object(y.jsx)("div",{style:{marginRight:"3px",marginLeft:"3px"},children:Object(y.jsx)(C.a,{color:"primary",size:"small",onClick:function(){return n("Copied: ".concat(t),{variant:"success"})},children:Object(y.jsx)(L.CopyToClipboard,{text:t,children:Object(y.jsx)(T.a,{style:{height:"20px"}})})})})}var E=n(190),U=n.n(E);function R(e){return Object(y.jsx)(O.a,{component:"div",variant:"subtitle1",children:e.address?Object(y.jsxs)("div",{style:{display:"flex"},children:[e.hideBlockie?null:Object(y.jsx)("div",{style:{paddingTop:"5px",marginRight:"10px"},children:Object(y.jsx)(U.a,{size:20,string:e.address})}),Object(y.jsx)("div",{children:Object(y.jsx)("a",{style:e.truncate?{marginRight:"7px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}:{marginRight:"7px"},href:"".concat("https://blockscout.com/xdai/mainnet","/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(y.jsx)(P,{value:e.address,label:"Ethereum Address"}),Object(y.jsx)(D,{value:e.address})]}):"-"})}var F=Object(j.a)((function(){return Object(b.a)({root:{display:"flex",alignItems:"center",justifyContent:"space-around",flexWrap:"wrap"},details:{display:"flex",flexDirection:"column"},content:{flex:"1 0 auto"}})}));var q=function(e){var t,n,a=F();return Object(y.jsxs)(p.a,{className:a.root,children:[Object(y.jsx)("div",{className:a.details,children:Object(y.jsxs)(x.a,{className:a.content,children:[Object(y.jsx)(O.a,{variant:"subtitle1",gutterBottom:!0,children:"Ethereum Address"}),Object(y.jsx)(R,{address:null===(t=e.nodeAddresses)||void 0===t?void 0:t.ethereum})]})}),Object(y.jsx)("div",{className:a.details,children:Object(y.jsxs)(x.a,{className:a.content,children:[Object(y.jsx)(O.a,{variant:"subtitle1",gutterBottom:!0,children:"Chequebook Contract Address"}),Object(y.jsx)(R,{address:null===(n=e.chequebookAddress)||void 0===n?void 0:n.chequebookAddress})]})})]})},V=Object(j.a)({root:{flexGrow:1,marginTop:"20px"},title:{textAlign:"center",fontSize:26}});function z(){var e=V();return Object(y.jsx)(p.a,{className:e.root,children:Object(y.jsxs)(x.a,{children:[Object(y.jsx)(O.a,{className:e.title,gutterBottom:!0,children:"Looks like your node is not connected"}),Object(y.jsx)("div",{style:{marginBottom:"20px",textAlign:"center"},children:Object(y.jsxs)("strong",{children:[Object(y.jsx)(s.b,{to:Sn.STATUS,children:"Click to run status checks"})," on your nodes connection or check out the"," ",Object(y.jsx)("a",{href:"https://docs.ethswarm.org/docs/",target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})]})}),Object(y.jsx)("div",{style:{marginBottom:"20px",textAlign:"center"},children:Object(y.jsxs)("p",{style:{marginTop:"50px"},children:["Still not working? Drop us a message on the Ethereum Swarm"," ",Object(y.jsx)("a",{href:"https://discord.gg/eKr9XPv7",target:"_blank",rel:"noreferrer",children:"Discord"})]})})]})})}var W=n(17),M=n.n(W),_=n(35),Z=n(18),G=n(120),Y=n(121),H=n(29),K=n.n(H);function J(e){return H.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function X(e){if(H.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new H.BigNumber(e);if("bigint"===typeof e)return new H.BigNumber(e.toString());if("number"===typeof e)return new H.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}function $(e){return Q.apply(this,arguments)}function Q(){return(Q=Object(_.a)(M.a.mark((function e(t){return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){return setTimeout((function(){e()}),t)}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ee=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],te=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(G.a)(this,e),this.amount=void 0,this.decimals=void 0;var a=X(t);if(!J(a)||!ee.includes(n))throw new TypeError("Not a valid token values");this.amount=a,this.decimals=n}return Object(Y.a)(e,[{key:"toBigInt",get:function(){return BigInt(this.amount.toFixed(0))}},{key:"toString",get:function(){return this.amount.toFixed(0)}},{key:"toBigNumber",get:function(){return new H.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new H.BigNumber(10).pow(this.decimals))}},{key:"toFixedDecimal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return this.toDecimal.toFixed(e)}}],[{key:"fromDecimal",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,a=X(t),r=a.multipliedBy(new H.BigNumber(10).pow(n));return new e(r,n)}}]),e}(),ne=n(95),ae=n.n(ne),re=n(191),ce=n(58),ie={apiUrl:sessionStorage.getItem("api_host")||"http://localhost:1633",apiDebugUrl:sessionStorage.getItem("debug_api_host")||"http://localhost:1635",beeApi:null,beeDebugApi:null,setApiUrl:function(){},setDebugApiUrl:function(){}},se=Object(a.createContext)(ie);se.Consumer;function oe(e){var t=e.children,n=Object(a.useState)(ie.apiUrl),r=Object(h.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)(ie.apiDebugUrl),o=Object(h.a)(s,2),l=o[0],u=o[1],d=Object(a.useState)(null),j=Object(h.a)(d,2),b=j[0],p=j[1],x=Object(a.useState)(null),O=Object(h.a)(x,2),m=O[0],g=O[1];return Object(a.useEffect)((function(){try{p(new ce.Bee(c)),sessionStorage.setItem("api_host",c)}catch(e){p(null)}}),[c]),Object(a.useEffect)((function(){try{g(new ce.BeeDebug(l)),sessionStorage.setItem("debug_api_host",l)}catch(e){g(null)}}),[l]),Object(y.jsx)(se.Provider,{value:{apiUrl:c,apiDebugUrl:l,beeApi:b,beeDebugApi:m,setApiUrl:i,setDebugApiUrl:u},children:t})}var le=n(192),ue=n.n(le),de={status:{all:!1,version:!1,blockchainConnection:!1,debugApiConnection:!1,apiConnection:!1,topology:!1,chequebook:!1},latestPublishedVersion:void 0,latestUserVersion:void 0,latestUserVersionExact:void 0,isLatestBeeVersion:!1,latestBeeVersionUrl:"https://github.com/ethersphere/bee/releases/latest",error:null,apiHealth:!1,debugApiHealth:null,nodeAddresses:null,topology:null,chequebookAddress:null,peers:null,chequebookBalance:null,peerBalances:null,peerCheques:null,settlements:null,latestBeeRelease:null,isLoading:!0,isRefreshing:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},je=Object(a.createContext)(de);je.Consumer;function be(e,t,n,a,r,c,i){var s={version:Boolean(e&&ae.a.satisfies(e.version,re.a.bee,{includePrerelease:!0})),blockchainConnection:Boolean(null===t||void 0===t?void 0:t.ethereum),debugApiConnection:Boolean("ok"===(null===e||void 0===e?void 0:e.status)),apiConnection:n,topology:Boolean((null===a||void 0===a?void 0:a.connected)&&(null===a||void 0===a?void 0:a.connected)>0),chequebook:Boolean(null===r||void 0===r?void 0:r.chequebookAddress)&&null!==c&&(null===c||void 0===c?void 0:c.totalBalance.toBigNumber.isGreaterThan(0))};return Object(Z.a)(Object(Z.a)({},s),{},{all:!i&&Object.values(s).every((function(e){return e}))})}function he(e){var t,n,r=e.children,c=Object(a.useContext)(se),i=c.beeApi,s=c.beeDebugApi,o=Object(a.useState)(!1),l=Object(h.a)(o,2),u=l[0],d=l[1],j=Object(a.useState)(null),b=Object(h.a)(j,2),p=b[0],x=b[1],O=Object(a.useState)(null),m=Object(h.a)(O,2),g=m[0],f=m[1],v=Object(a.useState)(null),w=Object(h.a)(v,2),k=w[0],S=w[1],B=Object(a.useState)(null),C=Object(h.a)(B,2),A=C[0],N=C[1],I=Object(a.useState)(null),P=Object(h.a)(I,2),L=P[0],T=P[1],D=Object(a.useState)(null),E=Object(h.a)(D,2),U=E[0],R=E[1],F=Object(a.useState)(null),q=Object(h.a)(F,2),V=q[0],z=q[1],W=Object(a.useState)(null),Z=Object(h.a)(W,2),G=Z[0],Y=Z[1],H=Object(a.useState)(null),K=Object(h.a)(H,2),J=K[0],X=K[1],$=function(){var e=Object(a.useState)(null),t=Object(h.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),i=Object(h.a)(c,2),s=i[0],o=i[1],l=Object(a.useState)(null),u=Object(h.a)(l,2),d=u[0],j=u[1];return Object(a.useEffect)((function(){ue.a.get("".concat("https://api.github.com/repos/ethersphere/bee","/releases/latest")).then((function(e){r(e.data)})).catch((function(e){j(e)})).finally((function(){o(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:s,error:d}}().latestBeeRelease,Q=Object(a.useState)(de.error),ee=Object(h.a)(Q,2),ne=ee[0],re=ee[1],ce=Object(a.useState)(de.isLoading),ie=Object(h.a)(ce,2),oe=ie[0],le=ie[1],he=Object(a.useState)(de.isRefreshing),pe=Object(h.a)(he,2),xe=pe[0],Oe=pe[1],me=Object(a.useState)(de.lastUpdate),ge=Object(h.a)(me,2),fe=ge[0],ve=ge[1],ye=Object(a.useState)(3e4),we=Object(h.a)(ye,2),ke=we[0],Se=we[1],Be=null===(t=ae.a.coerce(null===$||void 0===$?void 0:$.name))||void 0===t?void 0:t.version,Ce=null===(n=ae.a.coerce(null===p||void 0===p?void 0:p.version))||void 0===n?void 0:n.version,Ae=null===p||void 0===p?void 0:p.version;Object(a.useEffect)((function(){le(!0),d(!1),Ne()}),[i]),Object(a.useEffect)((function(){le(!0),x(null),f(null),S(null),T(null),N(null),R(null),z(null),Y(null),X(null),Ne()}),[s]);var Ne=function(){var e=Object(_.a)(M.a.mark((function e(){var t,n,a,r;return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!xe){e.next=2;break}return e.abrupt("return");case 2:if(i&&s){e.next=5;break}return le(!1),e.abrupt("return");case 5:return e.prev=5,Oe(!0),re(null),t=function(){var e=Object(_.a)(M.a.mark((function e(){var t,n,a;return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.getChequebookBalance();case 2:return t=e.sent,n=t.totalBalance,a=t.availableBalance,e.abrupt("return",{totalBalance:new te(n),availableBalance:new te(a)});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=Object(_.a)(M.a.mark((function e(){var t,n;return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.getAllBalances();case 2:return t=e.sent,n=t.balances,e.abrupt("return",n.map((function(e){var t=e.peer,n=e.balance;return{peer:t,balance:new te(n)}})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=Object(_.a)(M.a.mark((function e(){var t,n,a,r;return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.getAllSettlements();case 2:return t=e.sent,n=t.totalReceived,a=t.settlements,r=t.totalSent,e.abrupt("return",{totalReceived:new te(n),totalSent:new te(r),settlements:a.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new te(n),sent:new te(a)}}))});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),r=[i.isConnected().then(d).catch((function(){return d(!1)})),s.getHealth().then(x).catch((function(){return x(null)})),s.getNodeAddresses().then(f).catch((function(){return f(null)})),s.getTopology().then(S).catch((function(){return S(null)})),s.getPeers().then(T).catch((function(){return T(null)})),s.getChequebookAddress().then(N).catch((function(){return N(null)})),s.getLastCheques().then(Y).catch((function(){return Y(null)})),t().then(R).catch((function(){return R(null)})),n().then(z).catch((function(){return z(null)})),a().then(X).catch((function(){return X(null)}))],e.next=14,Promise.allSettled(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),re(e.t0);case 19:return e.prev=19,le(!1),Oe(!1),ve(Date.now()),e.finish(19);case 24:case"end":return e.stop()}}),e,null,[[5,16,19,24]])})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){if(Ne(),ke){var e=setInterval(Ne,ke);return function(){return clearInterval(e)}}}),[ke,s,i]),Object(y.jsx)(je.Provider,{value:{status:be(p,g,u,k,A,U,ne),latestUserVersion:Ce,latestUserVersionExact:Ae,latestPublishedVersion:Be,isLatestBeeVersion:Boolean(Be&&Ce&&ae.a.satisfies(Be,Ce,{includePrerelease:!0})),latestBeeVersionUrl:(null===$||void 0===$?void 0:$.html_url)||"https://github.com/ethersphere/bee/releases/latest",error:ne,apiHealth:u,debugApiHealth:p,nodeAddresses:g,topology:k,chequebookAddress:A,peers:L,chequebookBalance:U,peerBalances:V,peerCheques:G,settlements:J,latestBeeRelease:$,isLoading:oe,isRefreshing:xe,lastUpdate:fe,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return Se(e)},stop:function(){return Se(null)},refresh:Ne},children:r})}var pe=Object(j.a)((function(e){return Object(b.a)({root:{width:"100%",display:"grid",rowGap:e.spacing(3)}})}));function xe(){var e=pe(),t=Object(a.useContext)(je),n=t.status,r=t.latestUserVersion,c=t.isLatestBeeVersion,i=t.latestBeeVersionUrl,s=t.topology,o=t.nodeAddresses,l=t.chequebookAddress;return n.all?Object(y.jsxs)("div",{className:e.root,children:[Object(y.jsx)(k,{userBeeVersion:r,isLatestBeeVersion:c,isOk:n.all,nodeTopology:s,latestUrl:i,nodeAddresses:o}),o&&l&&Object(y.jsx)(q,{nodeAddresses:o,chequebookAddress:l})]}):Object(y.jsx)(z,{})}var Oe=n(153),me=n(642),ge=n(599),fe=n(534),ve=n(603),ye=n(605),we=n(600),ke=n(601),Se=n(602),Be=n(604),Ce=n(594),Ae=n(641),Ne=n(593),Ie=n(595),Pe=n(638),Le=n(589);function Te(e){var t=Object(a.useState)(!1),n=Object(h.a)(t,2),r=n[0],c=n[1],i=Object(a.useState)(""),s=Object(h.a)(i,2),o=s[0],l=s[1];return Object(y.jsx)("div",{children:r?Object(y.jsxs)("div",{style:{display:"flex"},children:[Object(y.jsx)(Le.a,{defaultValue:e.defaultHost,label:"Enter host",variant:"outlined",size:"small",onChange:function(e){return l(e.target.value)},style:{marginRight:"15px",minWidth:"300px"}}),Object(y.jsx)(g.a,{onClick:function(){o&&(e.setHost(o),c(!r))},size:"small",variant:"outlined",children:"Connect"}),Object(y.jsx)(g.a,{style:{marginLeft:"7px"},onClick:function(){return c(!r)},size:"small",children:"Cancel"})]}):Object(y.jsx)(g.a,{onClick:function(){return c(!r)},size:"small",variant:"outlined",children:"Change host"})})}var De=n(212),Ee=n(637),Ue=n(592),Re=n(636),Fe=["children","value","index"];function qe(e){var t=e.children,n=e.value,a=e.index,r=Object(De.a)(e,Fe);return Object(y.jsx)("div",Object(Z.a)(Object(Z.a)({role:"tabpanel",hidden:n!==a},r),{},{children:n===a&&Object(y.jsx)(Re.a,{p:3,children:Object(y.jsx)(O.a,{children:t})})}))}var Ve=Object(j.a)((function(){return{root:{flexGrow:1}}}));function ze(e){var t=e.values,n=e.index,a=e.indexChanged,c=Ve(),i=r.a.useState(n||0),s=Object(h.a)(i,2),o=s[0],l=s[1],u=void 0!==n?n:o;return Object(y.jsxs)("div",{className:c.root,children:[Object(y.jsx)(Ee.a,{value:u,onChange:function(e,t){a?a(t):l(t)},children:t.map((function(e,t){var n=e.label;return Object(y.jsx)(Ue.a,{label:n},t)}))}),t.map((function(e,t){var n=e.component;return Object(y.jsx)(qe,{value:u,index:t,children:n},t)}))]})}var We,Me,_e=n(639),Ze=function(e){return Object(y.jsx)("div",{style:{textAlign:"left"},children:Object(y.jsx)(_e.a,{language:e.language,showLineNumbers:e.showLineNumbers,children:e.code})})};!function(e){e[e.macOS=0]="macOS",e[e.Linux=1]="Linux",e[e.Windows=2]="Windows",e[e.iOS=3]="iOS",e[e.Android=4]="Android"}(We||(We={})),function(e){e[e.macOS=We.macOS]="macOS",e[e.Linux=We.Linux]="Linux"}(Me||(Me={}));var Ge={platform:Me.macOS,setPlatform:function(){}},Ye=Object(a.createContext)(Ge);Ye.Consumer;function He(e){var t=e.children,n=Object(a.useState)(Me.Linux),r=Object(h.a)(n,2),c=r[0],i=r[1];return Object(a.useEffect)((function(){var e=function(){var e=window.navigator.userAgent,t=window.navigator.platform;return["Macintosh","MacIntel","MacPPC","Mac68K"].includes(t)?We.macOS:["iPhone","iPad","iPod"].includes(t)?We.iOS:["Win32","Win64","Windows","WinCE"].includes(t)?We.Windows:/Android/.test(e)?We.Android:/Linux/.test(t)?We.Linux:null}();i(function(e){return Object.keys(Me).includes(e)}(e)?e:Me.Linux)}),[]),Object(y.jsx)(Ye.Provider,{value:{platform:c,setPlatform:i},children:t})}function Ke(e){var t=Object(a.useContext)(Ye),n=t.platform,r=t.setPlatform;return Object(y.jsx)(ze,{index:n,indexChanged:r,values:[{label:"Linux",component:Object(y.jsx)(Ze,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})},{label:"macOS",component:Object(y.jsx)(Ze,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})}]})}function Je(e){var t=e.isOk,n=Object(a.useContext)(se),r=n.setDebugApiUrl,c=n.apiDebugUrl,i=Object(y.jsxs)("div",{style:{display:"flex",marginTop:"25px",marginBottom:"25px"},children:[Object(y.jsxs)("span",{style:{marginRight:"15px"},children:["Debug API (",Object(y.jsx)(O.a,{variant:"button",children:c}),")"]}),Object(y.jsx)(Te,{setHost:function(e){console.log(e),r(e)},defaultHost:c})]});return t?i:Object(y.jsxs)("div",{children:[i,Object(y.jsx)("div",{children:Object(y.jsxs)(O.a,{component:"div",variant:"body2",gutterBottom:!0,style:{margin:"15px"},children:["We cannot connect to your nodes debug API at ",Object(y.jsx)(O.a,{variant:"button",children:c}),". Please check the following to troubleshoot your issue.",Object(y.jsxs)(Ae.a,{style:{marginTop:"20px"},children:[Object(y.jsx)(Ne.a,{expandIcon:Object(y.jsx)(Ce.a,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:Object(y.jsx)(O.a,{children:"Troubleshoot"})}),Object(y.jsx)(Ie.a,{children:Object(y.jsx)(O.a,{component:"div",children:Object(y.jsxs)("ol",{children:[Object(y.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(y.jsx)("li",{children:"If your node is running, check your firewall settings to make sure that port 1635 (or your custom specified port) is bound to localhost. If your node is not running try executing the below command to start your bee node"}),Object(y.jsx)(Pe.a,{style:{marginTop:"10px",marginBottom:"10px"},elevation:6,variant:"filled",severity:"error",children:'Your debug node API should never be completely open to the internet. If you want to connect remotely, make sure your firewall settings are set to only allow specific trusted IP addresses and block all other ports. A simple google search for "what is my ip" will show you your computers public IP address to allow.'}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(y.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"sudo systemctl status bee \njournalctl --lines=100 --follow --unit bee",mac:"brew services list \ntail -f /usr/local/var/log/swarm-bee/bee.log"}),Object(y.jsxs)("li",{children:["Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter"," ",Object(y.jsx)("strong",{children:"debug-api-enable"})," must be set to ",Object(y.jsx)("strong",{children:"true"})," and"," ",Object(y.jsx)("strong",{children:"cors-allowed-origins"})," must be set to your host domain or IP (you can also use the wildcard ",Object(y.jsx)("code",{children:"cors-allowed-origins: ['*']"}),"). If edits are made to the configuration run the restart command below for changes to take effect."]}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"sudo vi /etc/bee/bee.yaml\nsudo systemctl restart bee",mac:"sudo vi /usr/local/etc/swarm-bee/bee.yaml \nbrew services restart swarm-bee"})]})})})]})]})})]})}function Xe(e){var t=e.isOk,n=Object(a.useContext)(se),r=n.setApiUrl,c=n.apiUrl;return Object(y.jsxs)("div",{children:[Object(y.jsxs)("div",{style:{display:"flex",marginBottom:"25px"},children:[Object(y.jsxs)("span",{style:{marginRight:"15px"},children:["Node API (",Object(y.jsx)(O.a,{variant:"button",children:c}),")"]}),Object(y.jsx)(Te,{setHost:r,defaultHost:c})]}),Object(y.jsx)("div",{children:!t&&Object(y.jsxs)(O.a,{component:"div",variant:"body2",gutterBottom:!0,style:{margin:"15px"},children:["We cannot connect to your nodes API at ",Object(y.jsx)(O.a,{variant:"button",children:c}),". Please check the following to troubleshoot your issue.",Object(y.jsxs)(Ae.a,{style:{marginTop:"20px"},children:[Object(y.jsx)(Ne.a,{expandIcon:Object(y.jsx)(Ce.a,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:Object(y.jsx)(O.a,{children:"Troubleshoot"})}),Object(y.jsx)(Ie.a,{children:Object(y.jsx)(O.a,{component:"div",children:Object(y.jsxs)("ol",{children:[Object(y.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(y.jsx)("li",{children:"If your node is running, check your firewall settings to make sure that port 1633 (or your custom specified port) is exposed to the internet. If your node is not running try executing the below command to start your bee node"}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(y.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"sudo systemctl status bee \njournalctl --lines=100 --follow --unit bee",mac:"brew services list \ntail -f /usr/local/var/log/swarm-bee/bee.log"})]})})})]})]})})]})}function $e(e){var t=e.isOk,n=e.userVersion,a=e.latestVersion,r=e.latestUrl,c=Object(y.jsxs)("div",{style:{display:"flex"},children:[Object(y.jsxs)("div",{style:{marginRight:"30px"},children:[Object(y.jsx)("p",{children:Object(y.jsx)("span",{children:"User Version"})}),Object(y.jsx)(O.a,{component:"h5",variant:"h5",children:Object(y.jsx)("span",{children:n})})]}),Object(y.jsxs)("div",{children:[Object(y.jsx)("p",{children:Object(y.jsx)("span",{children:"Latest Version"})}),Object(y.jsx)(O.a,{component:"h5",variant:"h5",children:Object(y.jsx)("span",{children:a})})]})]});return t?Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)("span",{children:"You are running the latest version of Bee"}),c]}):Object(y.jsxs)(y.Fragment,{children:[Object(y.jsxs)("span",{children:["Your Bee version is out of date. Please update to the"," ",Object(y.jsx)("a",{href:r,rel:"noreferrer",target:"_blank",children:"latest"})," ","before continuing. Rerun the installation script below to upgrade. Reference the docs for help with updating."," ",Object(y.jsx)("a",{href:"https://docs.ethswarm.org/docs/installation/manual#upgrading-bee",rel:"noreferrer",target:"_blank",children:"Docs"})]}),Object(y.jsx)(Ke,{showLineNumbers:!0,linux:"bee version\nwget https://github.com/ethersphere/bee/releases/download/".concat(a,"/bee_").concat(a,"_amd64.deb\nsudo dpkg -i bee_").concat(a,"_amd64.deb"),mac:"bee version\nbrew tap ethersphere/tap\nbrew install swarm-bee\nbrew services start swarm-bee"}),c]})}function Qe(e){var t=e.isOk,n=e.nodeAddresses;return t?Object(y.jsxs)("div",{children:[Object(y.jsx)(O.a,{variant:"subtitle1",gutterBottom:!0,children:"Node Address"}),Object(y.jsx)(R,{address:null===n||void 0===n?void 0:n.ethereum})]}):Object(y.jsxs)("p",{children:["Your Bee node must have access to the xDai blockchain, so that it can interact and deploy your chequebook contract. You can run"," ",Object(y.jsx)("a",{href:"https://www.xdaichain.com/",rel:"noreferrer",target:"_blank",children:"your own xDai node"}),", or use a provider instead - we recommend"," ",Object(y.jsx)("a",{href:"https://getblock.io/",rel:"noreferrer",target:"_blank",children:"Getblock"}),". By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change the"," ",Object(y.jsx)("strong",{children:"swap-endpoint"})," in your configuration file."]})}var et=n(527),tt=n(598),nt=n(596),at=n(597),rt=n(530);function ct(e){var t=e.successMessage,n=e.errorMessage,r=e.dialogMessage,c=e.min,i=e.max,s=e.label,o=e.action,l=Object(a.useState)(!1),d=Object(h.a)(l,2),j=d[0],b=d[1],p=Object(a.useState)(""),x=Object(h.a)(p,2),O=x[0],m=x[1],f=Object(a.useState)(null),v=Object(h.a)(f,2),w=v[0],k=v[1],S=Object(a.useState)(null),B=Object(h.a)(S,2),C=B[0],I=B[1],P=Object(u.b)().enqueueSnackbar,L=function(){b(!1)},T=function(){var e=Object(_.a)(M.a.mark((function e(){var a;return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==w){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,o(w.toBigInt);case 5:a=e.sent,b(!1),P("".concat(t," Transaction ").concat(a),{variant:"success"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),P("".concat(n," Error: ").concat(e.t0.message),{variant:"error"});case 13:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(){return e.apply(this,arguments)}}();return Object(y.jsxs)("div",{children:[Object(y.jsx)(g.a,{variant:"outlined",color:"primary",onClick:function(){b(!0)},children:s}),Object(y.jsxs)(A.a,{open:j,onClose:L,"aria-labelledby":"form-dialog-title",children:[Object(y.jsx)(N.a,{id:"form-dialog-title",children:s}),Object(y.jsxs)(nt.a,{children:[Object(y.jsx)(at.a,{children:r}),Object(y.jsx)(et.a,{autoFocus:!0,margin:"dense",id:"name",type:"text",placeholder:"Amount",fullWidth:!0,value:O,onChange:function(e){var t=e.target.value;m(t),I(null);try{var n=te.fromDecimal(t);k(n),c&&n.toDecimal.isLessThan(c)&&I(new Error("Needs to be more than ".concat(c))),i&&n.toDecimal.isGreaterThan(i)&&I(new Error("Needs to be less than ".concat(i)))}catch(e){I(e)}}}),C&&Object(y.jsxs)(rt.a,{error:!0,children:["Please provide valid BZZ amount (max 16 decimals). Error: ",C.message]})]}),Object(y.jsxs)(tt.a,{children:[Object(y.jsx)(g.a,{onClick:L,color:"primary",children:"Cancel"}),Object(y.jsx)(g.a,{onClick:T,color:"primary",children:s})]})]})]})}function it(){var e=Object(a.useContext)(se).beeDebugApi;return Object(y.jsx)(ct,{successMessage:"Successful deposit.",errorMessage:"Error with depositing",dialogMessage:"Specify the amount of BZZ you would like to withdraw from your node.",label:"Deposit",min:new H.BigNumber(0),action:function(t){if(!e)throw new Error("Bee Debug URL is not valid");return e.depositTokens(t.toString())}})}var st=function(e){var t=e.chequebookAddress,n=e.isOk;return Object(y.jsxs)("div",{children:[Object(y.jsx)("p",{style:{marginBottom:"20px",display:"flex"},children:t&&Object(y.jsx)(it,{})}),Object(y.jsx)("div",{style:{marginBottom:"10px"},children:!n&&Object(y.jsx)("div",{children:Object(y.jsxs)("span",{children:["Your chequebook is either not deployed or funded. To run the node you will need xDAI and xBZZ on the xDai network. You may need to aquire BZZ through (e.g. ",Object(y.jsx)("a",{href:"https://bzz.exchange/",children:"bzz.exchange"}),") and bridge it to the xDai network through the ",Object(y.jsx)("a",{href:"https://omni.xdaichain.com/bridge",children:"omni bridge"}),". To pay the transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai network through the ",Object(y.jsx)("a",{href:"https://bridge.xdaichain.com/",children:"xDai Bridge"}),". See the"," ",Object(y.jsx)("a",{href:"https://www.xdaichain.com/#xdai-stable-chain",children:"official xDai website"})," for more information."]})})}),Object(y.jsx)(O.a,{variant:"subtitle1",gutterBottom:!0,children:"Chequebook Address"}),Object(y.jsx)(R,{address:t})]})};function ot(e){var t=e.isOk,n=e.topology,a=Object(y.jsxs)("div",{style:{display:"flex",marginTop:"15px"},children:[Object(y.jsxs)("div",{style:{marginRight:"30px"},children:[Object(y.jsx)(O.a,{component:"div",variant:"subtitle1",gutterBottom:!0,color:"textSecondary",children:Object(y.jsx)("span",{children:"Connected Peers"})}),Object(y.jsx)(O.a,{component:"h2",variant:"h5",children:(null===n||void 0===n?void 0:n.connected)?n.connected:"-"})]}),Object(y.jsxs)("div",{children:[Object(y.jsx)(O.a,{component:"div",variant:"subtitle1",gutterBottom:!0,color:"textSecondary",children:Object(y.jsx)("span",{children:"Discovered Nodes"})}),Object(y.jsx)(O.a,{component:"h2",variant:"h5",children:(null===n||void 0===n?void 0:n.population)?n.population:"-"})]})]});return t?Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)("span",{children:"You are connected to peers!"}),a]}):Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)("span",{children:"Your node is not connected to any peers"}),a]})}var lt=Object(j.a)((function(e){return Object(b.a)({root:{padding:e.spacing(2),width:"100%"},button:{marginTop:e.spacing(1),marginRight:e.spacing(1)},actionsContainer:{margin:e.spacing(2)}})}));function ut(){var e=lt(),t=Object(a.useState)(-1),n=Object(h.a)(t,2),r=n[0],c=n[1],i=Object(a.useContext)(je),s=i.status,o=i.isLoading,l=i.latestUserVersion,u=i.latestPublishedVersion,d=i.isLatestBeeVersion,j=i.latestBeeVersionUrl,b=i.topology,p=i.nodeAddresses,x=i.chequebookAddress,m=[{label:"Connected to Node DebugAPI",isOk:s.debugApiConnection,component:Object(y.jsx)(Je,{isOk:s.debugApiConnection})},{label:"Running latest Bee version",isOk:s.version,component:Object(y.jsx)($e,{isOk:s.version,isLatestBeeVersion:d,userVersion:l,latestVersion:u,latestUrl:j})},{label:"Connected to xDai Blockchain",isOk:s.blockchainConnection,component:Object(y.jsx)(Qe,{isOk:s.blockchainConnection,nodeAddresses:p})},{label:"Deployed and Funded Chequebook",isOk:s.chequebook,component:Object(y.jsx)(st,{chequebookAddress:null===x||void 0===x?void 0:x.chequebookAddress,isOk:s.chequebook})},{label:"Connected to Node API",isOk:s.apiConnection,component:Object(y.jsx)(Xe,{isOk:s.apiConnection})},{label:"Connected to Peers",isOk:s.topology,component:Object(y.jsx)(ot,{isOk:s.topology,topology:b})}],f=function(){c((function(e){return e+1}))},v=function(){c((function(e){return e-1}))};return Object(y.jsxs)(Oe.a,{className:e.root,children:[Object(y.jsx)(O.a,{variant:"h5",gutterBottom:!0,children:"Node Setup"}),Object(y.jsx)(me.a,{nonLinear:!0,activeStep:r,orientation:"vertical",children:m.map((function(t,n){var a=t.label,i=t.isOk,s=t.component;return Object(y.jsxs)(ge.a,{children:[Object(y.jsx)(fe.a,{onClick:function(){return c(n===r?m.length:n)},StepIconComponent:function(){return o?Object(y.jsx)(we.a,{style:{height:"25px",cursor:"pointer"}}):i?Object(y.jsx)(ke.a,{style:{color:"#32c48d",height:"25px",cursor:"pointer"}}):Object(y.jsx)(Se.a,{style:{color:"#c9201f",height:"25px",cursor:"pointer"}})},children:Object(y.jsx)(ve.a,{disabled:o,onClick:function(){return c(n===r?m.length:n)},style:{justifyContent:"space-between"},children:Object(y.jsxs)("div",{style:{display:"flex"},children:[Object(y.jsx)("div",{style:{marginTop:"5px"},children:a}),Object(y.jsx)("div",{style:{marginLeft:"12px"},children:n===r?Object(y.jsx)(Be.a,{}):Object(y.jsx)(Ce.a,{})})]})})}),Object(y.jsxs)(ye.a,{children:[Object(y.jsx)(O.a,{component:"div",children:s}),Object(y.jsx)("div",{className:e.actionsContainer,children:Object(y.jsxs)("div",{children:[Object(y.jsx)(g.a,{disabled:0===r,onClick:v,className:e.button,children:"Back"}),Object(y.jsx)(g.a,{variant:"contained",color:"primary",onClick:f,className:e.button,children:n<m.length-1?"Next":"Finish"})]})})]})]},a)}))})]})}var dt=n(612),jt=n(221),bt=n(606),ht=Object(j.a)((function(e){return Object(b.a)({root:{padding:e.spacing(.25),display:"flex",alignItems:"center"},input:{marginLeft:e.spacing(1),flex:1},iconButton:{padding:10},divider:{height:28,margin:4}})}));function pt(){var e=ht(),t=Object(a.useContext)(se).apiUrl,n=Object(a.useState)(""),r=Object(h.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)(null),o=Object(h.a)(s,2),l=o[0],u=o[1];return Object(y.jsxs)(y.Fragment,{children:[Object(y.jsxs)(Oe.a,{className:e.root,children:[Object(y.jsx)(jt.a,{className:e.input,placeholder:"Enter swarm reference e.g. 0773a91efd6547c754fc1d95fb1c62c7d1b47f959c2caa685dfec8736da95c1c",inputProps:{"aria-label":"retrieve file from swarm"},value:c,onChange:function(e){i(e.target.value),ce.Utils.Hex.isHexString(e.target.value,64)||ce.Utils.Hex.isHexString(e.target.value,128)?u(null):u(new Error("Incorrect format of swarm hash"))}}),Object(y.jsx)(C.a,{href:"".concat(t,"/bzz/").concat(c),target:"_blank",disabled:null!==l||!c,className:e.iconButton,"aria-label":"download",children:Object(y.jsx)(bt.a,{})})]}),l&&Object(y.jsx)(rt.a,{error:!0,children:l.message})]})}var xt=n(609),Ot=n(643),mt=n(208),gt=n(216),ft=n(608),vt=Object(j.a)((function(e){return Object(b.a)({root:{width:"100%",marginTop:e.spacing(2),marginBottom:e.spacing(2)}})}));function yt(e){var t=vt(),n=e.file.size>=1e8;return Object(y.jsx)(gt.a,{in:n,children:Object(y.jsx)("div",{className:t.root,children:Object(y.jsxs)(Pe.a,{severity:"warning",children:[Object(y.jsx)(ft.a,{children:"Warning"}),"The file you are trying to upload is above the recommended size. The chunks may not be synchronised properly over the network."]})})})}function wt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return"".concat(e.substring(0,t),"...").concat(e.substring(e.length-n,e.length))}function kt(e){var t=e.peerId,n=e.characterLength;return Object(y.jsx)(O.a,{variant:"button",style:{fontFamily:"monospace, monospace"},children:wt(t,n,n)})}var St={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},Bt=Object(a.createContext)(St);Bt.Consumer;function Ct(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),r="".concat(Math.ceil(100*a),"%");return Object(Z.a)(Object(Z.a)({},e),{},{usage:a,usageText:r})}function At(e){var t=e.children,n=Object(a.useContext)(se).beeApi,r=Object(a.useState)(St.stamps),c=Object(h.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)(St.error),l=Object(h.a)(o,2),u=l[0],d=l[1],j=Object(a.useState)(St.isLoading),b=Object(h.a)(j,2),p=b[0],x=b[1],O=Object(a.useState)(St.lastUpdate),m=Object(h.a)(O,2),g=m[0],f=m[1],v=Object(a.useState)(null),w=Object(h.a)(v,2),k=w[0],S=w[1],B=function(){var e=Object(_.a)(M.a.mark((function e(){var t;return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p){e.next=2;break}return e.abrupt("return");case 2:if(n){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,x(!0),e.next=8,n.getAllPostageBatch();case 8:t=e.sent,s(t.map(Ct)),f(Date.now()),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),d(e.t0);case 16:return e.prev=16,x(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,13,16,19]])})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){if(B(),k){var e=setInterval(B,k);return function(){return clearInterval(e)}}}),[k]),Object(y.jsx)(Bt.Provider,{value:{stamps:i,error:u,isLoading:p,lastUpdate:g,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return S(e)},stop:function(){return S(null)},refresh:B},children:t})}var Nt=n(50),It=n(129),Pt={depth:"",amount:"",label:""},Lt=Object(j.a)((function(e){return Object(b.a)({wrapper:{margin:e.spacing(1),position:"relative"},field:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},buttonProgress:{position:"absolute",top:"50%",left:"50%",marginTop:-12,marginBottom:-12}})}));function Tt(e){var t=e.label,n=Lt(),c=r.a.useState(!1),i=Object(h.a)(c,2),s=i[0],o=i[1],l=Object(a.useContext)(Bt).refresh,d=Object(a.useContext)(se).beeApi,j=function(){return o(!0)},b=function(){return o(!1)},p=Object(u.b)().enqueueSnackbar;return Object(y.jsx)(Nt.c,{initialValues:Pt,onSubmit:function(){var e=Object(_.a)(M.a.mark((function e(t,n){var a,r,c;return M.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t.depth&&t.amount){e.next=3;break}return e.abrupt("return");case 3:if(d){e.next=5;break}return e.abrupt("return");case 5:return a=BigInt(t.amount),r=Number.parseInt(t.depth),c=t.label?{label:t.label}:void 0,e.next=10,d.createPostageBatch(a.toString(),r,c);case 10:return n.resetForm(),e.next=13,l();case 13:b(),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),p("Error: ".concat(e.t0.message),{variant:"error"}),n.setSubmitting(!1);case 20:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t,n){return e.apply(this,arguments)}}(),validate:function(e){var t={};if(e.depth){var n=new K.a(e.depth);n.isInteger()?n.isLessThan(16)?t.depth="Minimal depth is 16":n.isGreaterThan(255)&&(t.depth="Depth has to be at most 255"):t.depth="Depth must be an integer"}else t.depth="Required field";if(e.amount){var a=new K.a(e.amount);a.isInteger()?a.isLessThanOrEqualTo(0)&&(t.amount="Amount must be greater than 0"):t.amount="Amount must be an integer"}else t.amount="Required field";return e.label&&!/^[0-9a-z]*$/i.test(e.label)&&(t.label="Label must be an alphanumeric string"),t},children:function(e){var a=e.submitForm,r=e.isValid,c=e.isSubmitting,i=e.values;return Object(y.jsxs)(Nt.b,{children:[Object(y.jsxs)(g.a,{variant:"outlined",color:"primary",onClick:j,children:[t||"Buy Postage Stamp",c&&Object(y.jsx)(xt.a,{size:24,className:n.buttonProgress})]}),Object(y.jsxs)(A.a,{open:s,onClose:b,"aria-labelledby":"form-dialog-title",children:[Object(y.jsx)(N.a,{id:"form-dialog-title",children:"Purchase new postage stamp"}),Object(y.jsxs)(nt.a,{children:[Object(y.jsxs)(at.a,{children:["Provide the depth, amount and optionally the label of the postage stamp. Please refer to the"," ",Object(y.jsx)("a",{href:"https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive",target:"blank",children:"official bee docs"})," ","to understand these values."]}),Object(y.jsx)(Nt.a,{component:It.a,required:!0,name:"depth",autoFocus:!0,label:"Depth",fullWidth:!0,className:n.field}),Object(y.jsx)(Nt.a,{component:It.a,required:!0,name:"amount",label:"Amount",fullWidth:!0,className:n.field}),Object(y.jsx)(Nt.a,{component:It.a,name:"label",label:"Label",fullWidth:!0,className:n.field})]}),Object(y.jsxs)(tt.a,{children:[Object(y.jsx)(g.a,{onClick:b,color:"primary",children:"Cancel"}),Object(y.jsx)("div",{className:n.wrapper,children:Object(y.jsxs)(g.a,{color:"primary",disabled:c||!r||!i.amount||!i.depth,type:"submit",variant:"contained",onClick:a,children:["Create",c&&Object(y.jsx)(xt.a,{size:24,className:n.buttonProgress})]})})]})]})]})}})}var Dt=n(611),Et=n(210),Ut=n(610);function Rt(e){var t=e.stamps,n=e.selectedStamp,a=e.setSelected,c=r.a.useState(null),i=Object(h.a)(c,2),s=i[0],o=i[1];if(!t)return null;var l=function(){return o(null)};return Object(y.jsxs)("div",{children:[Object(y.jsx)(g.a,{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:function(e){o(e.currentTarget)},children:"Change"}),Object(y.jsx)(Et.a,{id:"simple-menu",anchorEl:s,keepMounted:!0,open:Boolean(s),onClose:l,children:t.map((function(e){return Object(y.jsxs)(Ut.a,{onClick:function(){a(e),l()},selected:e.batchID===(null===n||void 0===n?void 0:n.batchID),children:[Object(y.jsx)(Dt.a,{children:e.usageText}),Object(y.jsx)(kt,{peerId:e.batchID})]},e.batchID)}))})]})}function Ft(){var e=Object(a.useState)(0),t=Object(h.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(null),i=Object(h.a)(c,2),s=i[0],o=i[1],l=Object(a.useState)(""),d=Object(h.a)(l,2),j=d[0],b=d[1],p=Object(a.useState)(!1),x=Object(h.a)(p,2),O=x[0],f=x[1],v=Object(a.useState)(null),w=Object(h.a)(v,2),k=w[0],S=w[1],B=Object(a.useContext)(Bt),C=B.isLoading,A=B.error,N=B.stamps,I=Object(a.useContext)(se).beeApi,P=Object(u.b)().enqueueSnackbar;Object(a.useEffect)((function(){if(!k&&N&&N.length>0){var e=N.reduce((function(e,t){return t.usage<e.usage?t:e}),N[0]);S(e)}}),[C,A,N,k]);return Object(y.jsx)("div",{children:Object(y.jsxs)("div",{children:[Object(y.jsx)(mt.a,{onChange:function(e){e&&o(e[0])},filesLimit:1,maxFileSize:1e9},"dropzone-"+n),Object(y.jsxs)("div",{style:{marginTop:"15px"},children:[k&&Object(y.jsxs)("div",{style:{display:"flex"},children:[Object(y.jsxs)("small",{children:["with Postage Stamp"," ",Object(y.jsx)(m.a,{avatar:Object(y.jsx)(Ot.a,{children:k.usageText}),label:Object(y.jsx)(kt,{peerId:k.batchID,characterLength:6}),deleteIcon:Object(y.jsx)(D,{value:k.batchID}),onDelete:function(){},variant:"outlined"})]}),Object(y.jsx)(Rt,{stamps:N,selectedStamp:k,setSelected:S})]}),!k&&Object(y.jsx)(Tt,{}),Object(y.jsx)(g.a,{disabled:!s&&O&&!k,onClick:function(){null!==s&&null!==k&&I&&(f(!0),I.uploadFile(k.batchID,s).then((function(e){window.setTimeout((function(){o(null),b(e),r(n+1)}),0)})).catch((function(e){return P("Error uploading: ".concat(e.message),{variant:"error"})})).finally((function(){f(!1)})))},children:"Upload"}),s&&Object(y.jsx)(yt,{file:s}),O&&Object(y.jsx)(dt.a,{style:{textAlign:"center",padding:"50px"},children:Object(y.jsx)(xt.a,{})}),j&&Object(y.jsxs)("div",{style:{marginBottom:"15px",display:"flex"},children:[Object(y.jsx)("span",{children:j}),Object(y.jsx)(D,{value:j})]})]})]})})}function qt(){return Object(a.useContext)(je).status.all?Object(y.jsx)(dt.a,{maxWidth:"sm",children:Object(y.jsx)(ze,{values:[{label:"download",component:Object(y.jsx)(pt,{})},{label:"upload",component:Object(y.jsx)(Ft,{})}]})}):Object(y.jsx)(z,{})}var Vt=n(85),zt=n(613),Wt=n(614),Mt=n(615),_t=n(616),Zt=n(617),Gt=n(618),Yt=n(644),Ht=Object(j.a)({table:{minWidth:650}});function Kt(e,t){var n,a,r;return(null===(n=e[t.address])||void 0===n?void 0:n.loading)?Object(y.jsx)(xt.a,{size:20}):(null===(a=e[t.address])||void 0===a?void 0:a.rtt)?Object(y.jsx)("span",{children:null===(r=e[t.address])||void 0===r?void 0:r.rtt}):Object(y.jsx)(we.a,{})}var Jt=function(e){var t,n=Ht(),r=Object(a.useContext)(se).beeDebugApi,c=Object(a.useState)({}),i=Object(h.a)(c,2),s=i[0],o=i[1];return Object(y.jsx)("div",{children:Object(y.jsx)(zt.a,{component:Oe.a,children:Object(y.jsxs)(Wt.a,{className:n.table,children:[Object(y.jsx)(Mt.a,{children:Object(y.jsxs)(_t.a,{children:[Object(y.jsx)(Zt.a,{children:"Index"}),Object(y.jsx)(Zt.a,{children:"Peer Id"}),Object(y.jsx)(Zt.a,{align:"right",children:"Actions"})]})}),Object(y.jsx)(Gt.a,{children:null===(t=e.peers)||void 0===t?void 0:t.map((function(e,t){return Object(y.jsxs)(_t.a,{children:[Object(y.jsx)(Zt.a,{component:"th",scope:"row",children:t+1}),Object(y.jsx)(Zt.a,{children:e.address}),Object(y.jsx)(Zt.a,{align:"right",children:Object(y.jsx)(Yt.a,{title:"Ping node",children:Object(y.jsx)(g.a,{color:"primary",onClick:function(){return t=e.address,o((function(e){return Object(Z.a)(Object(Z.a)({},e),{},Object(Vt.a)({},t,{rtt:"",loading:!0}))})),void(null===r||void 0===r||r.pingPeer(t).then((function(e){o((function(n){return Object(Z.a)(Object(Z.a)({},n),{},Object(Vt.a)({},t,{rtt:e.rtt,loading:!1}))}))})).catch((function(){o((function(e){return Object(Z.a)(Object(Z.a)({},e),{},Object(Vt.a)({},t,{rtt:"error",loading:!1}))}))})));var t},children:Kt(s,e)})})})]},e.address)}))})]})})})},Xt=n(607),$t=n(206),Qt=1e5,en="There may be issues with your Bee node or connection.",tn={connectedPeers:[{minimumValue:200,explanation:"Perfect! ".concat(200," or more connected peers indicate a healthy topology."),score:2},{minimumValue:1,explanation:"Your Bee node is connected to peers, but this number should ideally be above ".concat(200,". If you have only started your Bee node, this number may increase quickly."),score:1},{minimumValue:0,explanation:"Your Bee node has not connected to any peers. "+en,score:0}],population:[{minimumValue:Qt,explanation:"Perfect! Your Bee node seems to have a realistic value for the network size, which means everything is working well on your end.",score:2},{minimumValue:1,explanation:"Population is usually above ".concat(Qt.toLocaleString(),". If the number does not increase within a few hours, there may be issues with your Bee node."),score:1},{minimumValue:0,explanation:"Your Bee node has no information on the network population. "+en,score:0}],depth:[{minimumValue:12,explanation:"Perfect! Your Bee node has the highest available depth.",score:2},{minimumValue:1,explanation:"Your Bee node is supposed to reach a depth of ".concat(12," eventually. Stagnation or decrease in this number may indicate problems with your Bee node."),score:1},{minimumValue:0,explanation:"Your Bee node has not started building its topology yet. "+en,score:0}]};function nn(e,t){var n,a=tn[e],r=a[0].score,c=Object($t.a)(a);try{for(c.s();!(n=c.n()).done;){var i=n.value;if(t>=i.minimumValue)return{score:i.score,maximumScore:r,explanation:i.explanation}}}catch(o){c.e(o)}finally{c.f()}var s=a[a.length-1];return{score:s.score,maximumScore:r,explanation:s.explanation}}var an=n(620),rn=n(619),cn=Object(j.a)({title:{fontSize:16}});function sn(e){var t=e.label,n=e.tooltip,a=cn();return n?Object(y.jsx)(Yt.a,{title:n,children:Object(y.jsx)("span",{children:Object(y.jsxs)(Xt.a,{container:!0,direction:"row",justify:"space-between",children:[Object(y.jsx)(O.a,{className:a.title,color:"textSecondary",gutterBottom:!0,children:t}),Object(y.jsx)(rn.a,{})]})})}):Object(y.jsx)(O.a,{className:a.title,color:"textSecondary",gutterBottom:!0,children:t})}var on=Object(j.a)({root:{minWidth:275}});function ln(e){var t=e.loading,n=e.label,a=e.statistic,r=e.tooltip,c=on();return Object(y.jsx)(p.a,{className:c.root,children:Object(y.jsxs)(x.a,{children:[t&&Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(an.a,{width:180,height:25,animation:"wave"}),Object(y.jsx)(an.a,{width:180,height:35,animation:"wave"})]}),!t&&Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(sn,{label:n,tooltip:r}),Object(y.jsx)(O.a,{variant:"h5",component:"h2",children:a})]})]})})}var un=function(e){var t=e.thresholds,n=Object.values(t).reduce((function(e,t){return e+t.maximumScore}),0),a=Object.values(t).reduce((function(e,t){return e+t.score}),0),r=Math.round(a/n*100)+"%";return Object(y.jsx)("div",{style:{marginBottom:"20px"},children:Object(y.jsx)(ln,{label:"Overall Health Indicator",statistic:r})})},dn=function(e){var t=e.topology,n=e.thresholds;return Object(y.jsx)(Xt.a,{style:{marginBottom:"20px",flexGrow:1},children:Object(y.jsxs)(Xt.a,{container:!0,spacing:3,children:[Object(y.jsx)(Xt.a,{item:!0,xs:12,sm:12,md:6,lg:4,xl:4,children:Object(y.jsx)(ln,{label:"Connected Peers",statistic:null===t||void 0===t?void 0:t.connected.toString(),tooltip:n.connectedPeers.explanation})},1),Object(y.jsx)(Xt.a,{item:!0,xs:12,sm:12,md:6,lg:4,xl:4,children:Object(y.jsx)(ln,{label:"Population",statistic:null===t||void 0===t?void 0:t.population.toString(),tooltip:n.population.explanation})},2),Object(y.jsx)(Xt.a,{item:!0,xs:12,sm:12,md:6,lg:4,xl:4,children:Object(y.jsx)(ln,{label:"Depth",statistic:null===t||void 0===t?void 0:t.depth.toString(),tooltip:n.depth.explanation})},3)]})})},jn=function(e){var t,n,a,r={connectedPeers:nn("connectedPeers",(null===(t=e.topology)||void 0===t?void 0:t.connected)||0),population:nn("population",(null===(n=e.topology)||void 0===n?void 0:n.population)||0),depth:nn("depth",(null===(a=e.topology)||void 0===a?void 0:a.depth)||0)};return Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(un,Object(Z.a)(Object(Z.a)({},e),{},{thresholds:r})),Object(y.jsx)(dn,Object(Z.a)(Object(Z.a)({},e),{},{thresholds:r}))]})};function bn(){var e=Object(a.useContext)(je),t=e.topology,n=e.peers;return e.status.all?Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(jn,{topology:t}),Object(y.jsx)(Jt,{peers:n})]}):Object(y.jsx)(z,{})}function hn(){var e=Object(a.useContext)(se).beeDebugApi;return Object(y.jsx)(ct,{successMessage:"Successful withdrawl.",errorMessage:"Error with withdrawing.",dialogMessage:"Specify the amount of BZZ you would like to withdraw from your node.",label:"Withdraw",min:new H.BigNumber(0),action:function(t){if(!e)throw new Error("Bee Debug URL is not valid");return e.withdrawTokens(t.toString())}})}var pn=Object(j.a)((function(e){return Object(b.a)({root:{display:"flex"},buttons:{display:"flex",columnGap:e.spacing(1)},gridContainer:{display:"flex",width:"100%",marginLeft:e.spacing(1),marginRight:e.spacing(1),columnGap:e.spacing(1),rowGap:e.spacing(1),flex:"0 1 auto",flexWrap:"wrap",justifyContent:"space-between"},chequebookActions:{justifyContent:"space-between",display:"flex",marginBottom:e.spacing(1)}})}));var xn=function(e){var t=e.totalreceived,n=e.totalsent,a=e.chequebookBalance,r=pn();return Object(y.jsxs)("div",{children:[Object(y.jsxs)("div",{className:r.chequebookActions,children:[Object(y.jsx)(O.a,{component:"h2",variant:"h6",children:"Chequebook"}),Object(y.jsxs)("div",{className:r.buttons,children:[Object(y.jsx)(hn,{}),Object(y.jsx)(it,{})]})]}),Object(y.jsx)(p.a,{className:r.root,children:Object(y.jsxs)(x.a,{className:r.gridContainer,children:[Object(y.jsxs)("div",{children:[Object(y.jsx)(O.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:"Total Balance"}),Object(y.jsxs)(O.a,{variant:"h5",children:[null===a||void 0===a?void 0:a.totalBalance.toFixedDecimal()," BZZ"]})]}),Object(y.jsxs)("div",{children:[Object(y.jsx)(O.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:"Available Uncommitted Balance"}),Object(y.jsxs)(O.a,{variant:"h5",children:[null===a||void 0===a?void 0:a.availableBalance.toFixedDecimal()," BZZ"]})]}),Object(y.jsxs)("div",{children:[Object(y.jsx)(O.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:"Total Sent / Received"}),Object(y.jsxs)(O.a,{variant:"h5",children:[null===n||void 0===n?void 0:n.toFixedDecimal()," / ",null===t||void 0===t?void 0:t.toFixedDecimal()," BZZ"]})]})]})})]})};function On(e){var t=e.peerId,n=e.uncashedAmount,r=Object(a.useState)(!1),c=Object(h.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)(!1),l=Object(h.a)(o,2),d=l[0],j=l[1],b=Object(u.b)().enqueueSnackbar,p=Object(a.useContext)(se).beeDebugApi,x=function(){s(!1)};return Object(y.jsxs)("div",{children:[Object(y.jsx)(g.a,{variant:"contained",color:"primary",onClick:function(){s(!0)},style:{marginLeft:"7px"},children:"Cashout"}),Object(y.jsxs)(A.a,{open:i,onClose:x,"aria-labelledby":"form-dialog-title",children:[Object(y.jsx)(N.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(y.jsx)(nt.a,{children:Object(y.jsxs)(at.a,{style:{marginTop:"20px",overflowWrap:"break-word"},children:[d&&Object(y.jsxs)(y.Fragment,{children:[Object(y.jsxs)("span",{children:["Cashing out ",Object(y.jsx)("strong",{children:n})," from Peer ",Object(y.jsx)("strong",{children:t}),". Please wait..."]}),Object(y.jsx)(dt.a,{style:{textAlign:"center",padding:"50px"},children:Object(y.jsx)(xt.a,{})})]}),!d&&Object(y.jsxs)("span",{children:["Are you sure you want to cashout ",Object(y.jsxs)("strong",{children:[n," BZZ"]})," from Peer"," ",Object(y.jsx)("strong",{children:t}),"?"]})]})}),Object(y.jsxs)(tt.a,{children:[Object(y.jsx)(g.a,{onClick:x,color:"primary",children:"Cancel"}),Object(y.jsx)(g.a,{onClick:function(){p&&(t?(j(!0),p.cashoutLastCheque(t).then((function(e){s(!1),b(Object(y.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(y.jsx)(R,{hideBlockie:!0,transaction:!0,address:e})]}),{variant:"success"})})).catch((function(e){b(Object(y.jsxs)("span",{children:["Error: ",e.message]}),{variant:"error"})})).finally((function(){j(!1)}))):b(Object(y.jsx)("span",{children:"Peer Id invalid"}),{variant:"error"}))},color:"primary",disabled:d,children:"Yes Cashout"})]})]})]})}var mn=Object(j.a)({table:{minWidth:650},values:{textAlign:"right",fontFamily:"monospace, monospace"}});var gn=function(e){var t=e.accounting,n=e.isLoadingUncashed;if(null===t)return null;var a=mn();return Object(y.jsx)(zt.a,{component:Oe.a,children:Object(y.jsxs)(Wt.a,{className:a.table,size:"small","aria-label":"Balances Table",children:[Object(y.jsx)(Mt.a,{children:Object(y.jsxs)(_t.a,{children:[Object(y.jsx)(Zt.a,{children:"Peer"}),Object(y.jsx)(Zt.a,{align:"right",children:"Outstanding Balance"}),Object(y.jsx)(Zt.a,{align:"right",children:"Settlements Sent / Received"}),Object(y.jsx)(Zt.a,{align:"right",children:"Total"}),Object(y.jsx)(Zt.a,{align:"right",children:"Uncashed Amount"}),Object(y.jsx)(Zt.a,{})]})}),Object(y.jsx)(Gt.a,{children:t.map((function(e){var t=e.peer,r=e.balance,c=e.received,i=e.sent,s=e.uncashedAmount,o=e.total;return Object(y.jsxs)(_t.a,{children:[Object(y.jsx)(Zt.a,{children:Object(y.jsxs)("div",{style:{display:"flex"},children:[Object(y.jsx)("small",{children:Object(y.jsx)(kt,{peerId:t})}),Object(y.jsx)(D,{value:t})]})}),Object(y.jsxs)(Zt.a,{className:a.values,children:[Object(y.jsx)("span",{style:{color:r.toBigNumber.isPositive()?"#32c48d":"#c9201f"},children:r.toFixedDecimal()})," ","BZZ"]}),Object(y.jsxs)(Zt.a,{className:a.values,children:["-",i.toFixedDecimal()," / ",c.toFixedDecimal()," BZZ"]}),Object(y.jsxs)(Zt.a,{className:a.values,children:[Object(y.jsx)("span",{style:{color:o.toBigNumber.isPositive()?"#32c48d":"#c9201f"},children:o.toFixedDecimal()})," ","BZZ"]}),Object(y.jsxs)(Zt.a,{className:a.values,children:[n&&"loading...",!n&&Object(y.jsxs)(y.Fragment,{children:[s.toBigNumber.isGreaterThan("0")?s.toFixedDecimal():"0"," BZZ"]})]}),Object(y.jsx)(Zt.a,{className:a.values,children:s.toBigNumber.isGreaterThan("0")&&Object(y.jsx)(On,{uncashedAmount:s.toFixedDecimal(),peerId:t})})]},t)}))})]})})};var fn=function(e,t,n){var r=Object(a.useState)(!1),c=Object(h.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)(void 0),l=Object(h.a)(o,2),u=l[0],d=l[1];Object(a.useEffect)((function(){if(!i&&e&&t&&!u){s(!0);var n=t.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(t){var n=t.peer;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;return new Promise(function(){var a=Object(_.a)(M.a.mark((function a(r,c){var i,s;return M.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:i=0;case 1:if(!(i<t)){a.next=21;break}return a.prev=2,a.next=5,e();case 5:return s=a.sent,r(s),a.abrupt("return");case 10:if(a.prev=10,a.t0=a.catch(2),!(i<t-1)){a.next=17;break}return a.next=15,$(n);case 15:a.next=18;break;case 17:c(a.t0);case 18:i++,a.next=1;break;case 21:case"end":return a.stop()}}),a,null,[[2,10]])})));return function(e,t){return a.apply(this,arguments)}}())}((function(){return e.getLastCashoutAction(n)}))}));Promise.allSettled(n).then((function(e){var t=function(e){var t,n={fulfilled:(t=e).filter((function(e){return"fulfilled"===e.status})),rejected:t.filter((function(e){return"rejected"===e.status}))};return{fulfilled:n.fulfilled.map((function(e){return e.value})),rejected:n.rejected.map((function(e){return e.reason?String(e.reason):"Unknown error"}))}}(e);d(t.fulfilled),s(!1)}))}}),[t,i,u]);var j=function(e,t,n){if(!e||!t)return null;var a={};return e.forEach((function(e){var t=e.peer,n=e.balance;return a[t]={peer:t,balance:n,sent:new te("0"),received:new te("0"),uncashedAmount:new te("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,r=e.received;return a[t]=Object(Z.a)(Object(Z.a)({},a[t]),{},{sent:n,received:r,total:new te(a[t].balance.toBigNumber.plus(r.toBigNumber).minus(n.toBigNumber))})})),n?(null===n||void 0===n||n.forEach((function(e){var t=e.peer,n=e.uncashedAmount;a[t].uncashedAmount=new te(n)})),Object.values(a).sort((function(e,t){return t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber()}))):Object.values(a)}(n,null===t||void 0===t?void 0:t.settlements,u);return{isLoadingUncashed:i,accounting:j}},vn=Object(j.a)((function(e){return Object(b.a)({root:{width:"100%",display:"grid",rowGap:e.spacing(3)}})}));function yn(){var e=vn(),t=Object(a.useContext)(je),n=t.status,r=t.nodeAddresses,c=t.chequebookAddress,i=t.chequebookBalance,s=t.settlements,o=t.peerBalances,l=Object(a.useContext)(se).beeDebugApi,u=fn(l,s,o),d=u.accounting,j=u.isLoadingUncashed;return n.all?Object(y.jsxs)("div",{className:e.root,children:[Object(y.jsx)(xn,{chequebookAddress:c,chequebookBalance:i,totalsent:null===s||void 0===s?void 0:s.totalSent,totalreceived:null===s||void 0===s?void 0:s.totalReceived}),Object(y.jsx)(q,{nodeAddresses:r,chequebookAddress:c}),Object(y.jsx)(gn,{accounting:d,isLoadingUncashed:j})]}):Object(y.jsx)(z,{})}function wn(){var e=Object(a.useContext)(se),t=e.apiUrl,n=e.apiDebugUrl,r=e.setApiUrl,c=e.setDebugApiUrl,i=Object(a.useState)(t),s=Object(h.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(n),d=Object(h.a)(u,2),j=d[0],b=d[1],p=o!==t||j!==n;return Object(y.jsx)("div",{children:Object(y.jsxs)(dt.a,{children:[Object(y.jsx)(O.a,{variant:"h4",gutterBottom:!0,children:"Settings"}),Object(y.jsx)(Oe.a,{children:Object(y.jsx)(Le.a,{label:"API Endpoint",style:{margin:0},placeholder:"ex: 127.0.0.0.1:1633",helperText:"Enter node host override / port",fullWidth:!0,defaultValue:t,margin:"normal",InputLabelProps:{shrink:!0},onChange:function(e){l(e.target.value)},variant:"filled"})}),Object(y.jsx)(Oe.a,{style:{marginTop:"20px"},children:Object(y.jsx)(Le.a,{label:"Debug API Endpoint",style:{margin:0},placeholder:"ex: 127.0.0.0.1:1635",helperText:"Enter node debug host override / port",fullWidth:!0,defaultValue:n,onChange:function(e){b(e.target.value)},margin:"normal",InputLabelProps:{shrink:!0},variant:"filled"})}),p?Object(y.jsx)("div",{style:{marginTop:"20px"},children:Object(y.jsx)(g.a,{variant:"outlined",color:"primary",onClick:function(){o!==t&&r(o),j!==n&&c(j)},children:"Save"})}):null]})})}var kn=Object(j.a)({table:{minWidth:650},values:{textAlign:"right",fontFamily:"monospace, monospace"}});var Sn,Bn=function(e){var t=e.postageStamps;if(null===t)return null;var n=kn();return Object(y.jsx)(zt.a,{component:Oe.a,children:Object(y.jsxs)(Wt.a,{className:n.table,size:"small","aria-label":"Balances Table",children:[Object(y.jsx)(Mt.a,{children:Object(y.jsxs)(_t.a,{children:[Object(y.jsx)(Zt.a,{children:"Batch ID"}),Object(y.jsx)(Zt.a,{align:"right",children:"Usage"})]})}),Object(y.jsx)(Gt.a,{children:t.map((function(e){var t=e.batchID,a=e.usageText;return Object(y.jsxs)(_t.a,{children:[Object(y.jsx)(Zt.a,{children:Object(y.jsxs)("div",{style:{display:"flex"},children:[Object(y.jsx)("small",{children:Object(y.jsx)(kt,{peerId:t})}),Object(y.jsx)(D,{value:t})]})}),Object(y.jsx)(Zt.a,{className:n.values,children:a})]},t)}))})]})})},Cn=Object(j.a)((function(e){return Object(b.a)({root:{width:"100%",display:"grid",rowGap:e.spacing(2)},actions:{display:"flex",width:"100%",columnGap:e.spacing(1),rowGap:e.spacing(1),flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function An(){var e=Cn(),t=Object(a.useContext)(je),n=Object(a.useContext)(Bt),r=n.stamps,c=n.isLoading,i=n.error,s=n.start,o=n.stop;return Object(a.useEffect)((function(){return s(),function(){return o()}}),[]),t.isLoading?Object(y.jsx)(dt.a,{style:{textAlign:"center",padding:"50px"},children:Object(y.jsx)(xt.a,{})}):t.status.all?Object(y.jsxs)("div",{className:e.root,children:[i&&Object(y.jsxs)(dt.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",i.message]}),!i&&Object(y.jsxs)(y.Fragment,{children:[Object(y.jsxs)("div",{className:e.actions,children:[Object(y.jsx)(Tt,{}),Object(y.jsx)("div",{style:{height:"5px"},children:c&&Object(y.jsx)(xt.a,{})})]}),Object(y.jsx)(Bn,{postageStamps:r})]})]}):Object(y.jsx)(z,{})}!function(e){e.INFO="/",e.FILES="/files",e.PEERS="/peers",e.ACCOUNTING="/accounting",e.SETTINGS="/settings",e.STAMPS="/stamps",e.STATUS="/status"}(Sn||(Sn={}));var Nn=function(){return Object(y.jsxs)(d.c,{children:[Object(y.jsx)(d.a,{exact:!0,path:Sn.INFO,component:xe}),Object(y.jsx)(d.a,{exact:!0,path:Sn.FILES,component:qt}),Object(y.jsx)(d.a,{exact:!0,path:Sn.PEERS,component:bn}),Object(y.jsx)(d.a,{exact:!0,path:Sn.ACCOUNTING,component:yn}),Object(y.jsx)(d.a,{exact:!0,path:Sn.SETTINGS,component:wn}),Object(y.jsx)(d.a,{exact:!0,path:Sn.STAMPS,component:An}),Object(y.jsx)(d.a,{exact:!0,path:Sn.STATUS,component:ut})]})},In=n(211),Pn=n(209),Ln=function(e){Object(In.a)(n,e);var t=Object(Pn.a)(n);function n(e){var a;return Object(G.a)(this,n),(a=t.call(this,e)).state={error:null},a}return Object(Y.a)(n,[{key:"componentDidCatch",value:function(e,t){console.error({error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.error?Object(y.jsxs)("h1",{children:["Something went wrong. Error: ",this.state.error.message]}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{error:e}}}]),n}(a.Component),Tn=n(123),Dn=n.n(Tn),En=Object(j.a)((function(e){return Object(b.a)({root:{width:"100%",marginBottom:e.spacing(2)}})}));function Un(){var e=En(),t=Object(a.useContext)(je),n=t.isLoading,r=t.latestUserVersionExact,c=Object(a.useState)(!0),i=Object(h.a)(c,2),s=i[0],o=i[1],l=ce.SUPPORTED_BEE_VERSION_EXACT===r;return n||!r?null:Object(y.jsx)(gt.a,{in:!l&&s,children:Object(y.jsx)("div",{className:e.root,children:Object(y.jsxs)(Pe.a,{severity:"warning",action:Object(y.jsx)(C.a,{"aria-label":"close",color:"inherit",size:"small",onClick:function(){o(!1)},children:Object(y.jsx)(Dn.a,{fontSize:"inherit"})}),children:[Object(y.jsx)(ft.a,{children:"Warning"}),"Your Bee node version (",Object(y.jsx)("code",{children:r}),") does not exactly match the Bee version we tested the Bee Dashboard against (",Object(y.jsx)("code",{children:ce.SUPPORTED_BEE_VERSION_EXACT}),"). Please note that some functionality may not work properly."]})})})}var Rn=n(633),Fn=n(629),qn=n(591),Vn=n(630),zn=n(631),Wn=n(623),Mn=n(624),_n=n(625),Zn=n(626),Gn=n(627),Yn=n(628),Hn=n(632),Kn=n(6),Jn=n(531),Xn=n(621),$n=Object(Kn.a)((function(e){return{root:{paddingLeft:e.spacing(4),paddingRight:e.spacing(4),borderLeft:"4px solid rgba(0,0,0,0)","&.Mui-selected, &.Mui-selected:hover":{borderLeft:"4px solid ".concat(e.palette.primary.main),backgroundColor:"#2c2c2c",color:"#f9f9f9"}},button:{"&:hover":{backgroundColor:"#2c2c2c",color:"#f9f9f9","@media (hover: none)":{backgroundColor:"#2c2c2c",color:"#f9f9f9"}}}}}))(Jn.a),Qn=Object(j.a)((function(e){return Object(b.a)({icon:{color:"inherit"},activeIcon:{color:e.palette.primary.main}})}));function ea(e){var t=e.iconStart,n=e.iconEnd,a=e.path,r=e.label,c=Qn(),i=Object(d.f)(),s=Boolean(Object(d.e)(i.pathname,{path:a,exact:!0}));return Object(y.jsxs)($n,{button:!0,selected:s,disableRipple:!0,children:[Object(y.jsx)(Dt.a,{className:s?c.activeIcon:c.icon,children:t}),Object(y.jsx)(Xn.a,{primary:r}),Object(y.jsx)(Dt.a,{className:s?c.activeIcon:c.icon,children:n})]})}var ta=n(622),na=Object(j.a)((function(e){return Object(b.a)({icon:{color:"inherit"},iconSmall:{height:e.spacing(2)},root:{height:e.spacing(4),paddingLeft:e.spacing(1),paddingRight:e.spacing(4),color:"#f9f9f9",borderLeft:"0px solid rgba(0,0,0,0)","&.Mui-selected, &.Mui-selected:hover":{borderLeft:"0px solid ".concat(e.palette.primary.main),backgroundColor:"#2c2c2c"}},rootError:{backgroundColor:"rgba(255, 58, 82, 0.25)"},button:{"&:hover":{backgroundColor:"#2c2c2c","@media (hover: none)":{backgroundColor:"#2c2c2c"}}},smallerText:{fontSize:"0.9rem"}})}));function aa(e){var t=e.path,n=Object(a.useContext)(je).status,r=na(),c=Object(d.f)(),i=Boolean(Object(d.e)(c.pathname,{path:t,exact:!0}));return Object(y.jsxs)(Jn.a,{button:!0,classes:{root:"".concat(r.root," ").concat(n.all?"":r.rootError),button:r.button},selected:i,disableRipple:!0,children:[Object(y.jsx)(Dt.a,{children:Object(y.jsx)("span",{style:{backgroundColor:n.all?"#1de600":"#ff3a52",height:"14px",width:"14px",borderRadius:"50%",display:"inline-block",marginLeft:30}})}),Object(y.jsx)(Xn.a,{primary:Object(y.jsx)(O.a,{className:r.smallerText,children:"Node ".concat(n.all?"OK":"Error")})}),Object(y.jsx)(Dt.a,{className:r.icon,children:n.all?null:Object(y.jsx)(ta.a,{className:r.iconSmall})})]})}var ra=n.p+"static/media/logo.3d1155fe.svg",ca=[{label:"Info",path:Sn.INFO,icon:Wn.a},{label:"Files",path:Sn.FILES,icon:Mn.a},{label:"Stamps",path:Sn.STAMPS,icon:_n.a},{label:"Accounting",path:Sn.ACCOUNTING,icon:Zn.a},{label:"Peers",path:Sn.PEERS,icon:Gn.a},{label:"Settings",path:Sn.SETTINGS,icon:Yn.a}],ia=Object(j.a)((function(e){return Object(b.a)({root:{flexWrap:"nowrap",minHeight:"100vh",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)},logo:{marginLeft:e.spacing(8),marginRight:e.spacing(8)},icon:{height:e.spacing(4)},iconSmall:{height:e.spacing(2)},divider:{backgroundColor:"#2c2c2c",marginLeft:e.spacing(4),marginRight:e.spacing(4)},link:{color:"#9f9f9f",textDecoration:"none","&:hover":{textDecoration:"none","@media (hover: none)":{textDecoration:"none"}}}})}));function sa(){var e=ia();return Object(y.jsx)(Fn.a,{variant:"permanent",children:Object(y.jsxs)(Xt.a,{container:!0,direction:"column",justifyContent:"space-between",className:e.root,children:[Object(y.jsx)(Xt.a,{className:e.logo,children:Object(y.jsx)(s.b,{to:Sn.INFO,children:Object(y.jsx)("img",{alt:"swarm",src:ra})})}),Object(y.jsxs)(Xt.a,{children:[Object(y.jsx)(qn.a,{children:ca.map((function(t){return Object(y.jsx)(s.b,{to:t.path,className:e.link,children:Object(y.jsx)(ea,{iconStart:Object(y.jsx)(t.icon,{className:e.icon}),path:t.path,label:t.label},t.path)},t.path)}))}),Object(y.jsx)(Vn.a,{className:e.divider}),Object(y.jsx)(qn.a,{children:Object(y.jsx)(zn.a,{href:"https://docs.ethswarm.org/docs/",target:"_blank",className:e.link,children:Object(y.jsx)(ea,{iconStart:Object(y.jsx)(Hn.a,{className:e.icon}),iconEnd:Object(y.jsx)(Rn.a,{className:e.iconSmall}),label:Object(y.jsx)("span",{children:"Docs"})})})})]}),Object(y.jsx)(Xt.a,{children:Object(y.jsx)(s.b,{to:Sn.STATUS,className:e.link,children:Object(y.jsx)(aa,{path:Sn.STATUS})})})]})})}var oa,la=Object(j.a)((function(e){return Object(b.a)({content:{marginLeft:300,flexGrow:1,backgroundColor:e.palette.background.default,padding:e.spacing(3),paddingBottom:"65px"}})})),ua=function(e){var t=la(),n=Object(a.useContext)(je).isLoading;return Object(y.jsxs)("div",{children:[Object(y.jsx)(sa,{}),Object(y.jsx)(Ln,{children:Object(y.jsxs)("main",{className:t.content,children:[Object(y.jsx)(Un,{}),n?Object(y.jsx)(dt.a,{style:{textAlign:"center",padding:"50px"},children:Object(y.jsx)(xt.a,{})}):e.children]})})]})},da=n(207),ja=n(128),ba=Object(da.a)({palette:{type:"light",background:{default:"#fafafa"},primary:{light:ja.a.A200,main:"#dd7700",dark:ja.a[800]},secondary:{main:"#333333"}},typography:{fontFamily:["Work Sans","Montserrat","Nunito","Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(",")}});ba.overrides={MuiDrawer:{paper:{width:300,backgroundColor:"#212121"}},MuiTab:{root:{backgroundColor:"transparent",fontWeight:(oa=ba).typography.fontWeightRegular,marginRight:oa.spacing(4),fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(","),"&:hover":{color:oa.palette.secondary,opacity:1},"&$selected":{color:oa.palette.secondary,fontWeight:oa.typography.fontWeightMedium},"&:focus":{color:oa.palette.secondary}}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:oa.palette.primary.main}}},ba.props={MuiTab:{disableRipple:!0}};var ha=function(){return Object(y.jsx)("div",{className:"App",children:Object(y.jsx)(o.a,{theme:ba,children:Object(y.jsx)(oe,{children:Object(y.jsx)(he,{children:Object(y.jsx)(At,{children:Object(y.jsx)(He,{children:Object(y.jsx)(u.a,{children:Object(y.jsx)(s.a,{children:Object(y.jsxs)(y.Fragment,{children:[Object(y.jsx)(l.a,{}),Object(y.jsx)(ua,{children:Object(y.jsx)(Nn,{})})]})})})})})})})})})},pa=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,646)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,i=t.getTTFB;n(e),a(e),r(e),c(e),i(e)}))};i.a.render(Object(y.jsx)(r.a.StrictMode,{children:Object(y.jsx)(ha,{})}),document.getElementById("root")),pa()}},[[522,1,2]]]);
|
|
2
|
-
//# sourceMappingURL=main.396e3ebb.chunk.js.map
|