From 74b6e3284b007ed239a859d6ca91760b89c3df90 Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Mon, 4 Apr 2022 09:56:50 +0200 Subject: [PATCH] feat: add static api-key and dist --- .gitignore | 4 +++ index.js | 8 +++--- package.json | 5 ++++ release.sh | 6 +++++ src/api-key.js | 13 +++++++-- src/config-yaml.js | 3 ++- src/electron.js | 11 ++++---- src/launcher.js | 27 ++++++++++--------- src/path.js | 18 +++++++++++++ src/server.js | 7 ++--- src/status.js | 5 ++-- static/dashboard/asset-manifest.json | 6 ++--- static/dashboard/index.html | 2 +- .../static/js/main.16628c3e.chunk.js | 2 -- .../static/js/main.16628c3e.chunk.js.map | 1 - .../static/js/main.cfa2d25c.chunk.js | 2 ++ .../static/js/main.cfa2d25c.chunk.js.map | 1 + 17 files changed, 84 insertions(+), 37 deletions(-) create mode 100755 release.sh create mode 100644 src/path.js delete mode 100644 static/dashboard/static/js/main.16628c3e.chunk.js delete mode 100644 static/dashboard/static/js/main.16628c3e.chunk.js.map create mode 100644 static/dashboard/static/js/main.cfa2d25c.chunk.js create mode 100644 static/dashboard/static/js/main.cfa2d25c.chunk.js.map diff --git a/.gitignore b/.gitignore index 3b20d82..7e2a2fe 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,7 @@ build bee data-dir config.yaml +api-key.txt + +# secret +.env diff --git a/index.js b/index.js index 0208d65..3b06418 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ const { shell } = require('electron') -const { apiKey } = require('./src/api-key') +const { getApiKey } = require('./src/api-key') const { runElectronTray } = require('./src/electron') const { runLauncher } = require('./src/launcher') const { findFreePort, port } = require('./src/port') @@ -8,13 +8,13 @@ const { getStatus } = require('./src/status') async function main() { await findFreePort() + runServer() + runElectronTray() if (getStatus().status === 2) { runLauncher() } else { - shell.openExternal(`http://localhost:${port.value}/installer/?v=${apiKey}`) + shell.openExternal(`http://localhost:${port.value}/installer/?v=${getApiKey()}`) } - runElectronTray() - runServer() } main() diff --git a/package.json b/package.json index 66bef74..52d76e9 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,10 @@ "devDependencies": { "electron": "^17.1.0", "electron-builder": "^22.14.13" + }, + "build": { + "mac": { + "target": "mas" + } } } diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..e096683 --- /dev/null +++ b/release.sh @@ -0,0 +1,6 @@ +npm run dist +cp bee dist/mas-arm64/ +cp icon.png dist/mas-arm64/ +cp tray.png dist/mas-arm64/ +cp tray@2x.png dist/mas-arm64/ +cp -r static dist/mas-arm64/ \ No newline at end of file diff --git a/src/api-key.js b/src/api-key.js index b5cc332..8a9d20c 100644 --- a/src/api-key.js +++ b/src/api-key.js @@ -1,5 +1,14 @@ +const { existsSync, writeFileSync, readFileSync } = require('fs') const { v4 } = require('uuid') +const { resolvePath } = require('./path') -const apiKey = v4() +function getApiKey() { + if (!existsSync(resolvePath('api-key.txt'))) { + const apiKey = v4() + writeFileSync(resolvePath('api-key.txt'), apiKey) + return apiKey + } + return readFileSync(resolvePath('api-key.txt'), 'utf-8') +} -module.exports = { apiKey } +module.exports = { getApiKey } diff --git a/src/config-yaml.js b/src/config-yaml.js index ca508a2..80bbfc9 100644 --- a/src/config-yaml.js +++ b/src/config-yaml.js @@ -1,9 +1,10 @@ const { load, dump } = require('js-yaml') const { readFileSync, writeFileSync } = require('fs') const { FAILSAFE_SCHEMA } = require('js-yaml') +const { resolvePath } = require('./path') function getPath() { - return 'config.yaml' + return resolvePath('config.yaml') } function readConfigYaml() { diff --git a/src/electron.js b/src/electron.js index f015834..65d361c 100644 --- a/src/electron.js +++ b/src/electron.js @@ -1,7 +1,8 @@ const { app, Tray, Menu, shell } = require('electron') -const { apiKey } = require('./api-key') +const { getApiKey } = require('./api-key') const { runLauncher } = require('./launcher') const { BeeManager } = require('./lifecycle') +const { resolvePath } = require('./path') const { port } = require('./port') const { getStatus } = require('./status') @@ -15,7 +16,7 @@ function rebuildElectronTray() { const contextMenu = Menu.buildFromTemplate([ { label: 'Open Installer', - click: () => shell.openExternal(`http://localhost:${port.value}/installer/?v=${apiKey}`) + click: () => shell.openExternal(`http://localhost:${port.value}/installer/?v=${getApiKey()}`) }, { type: 'separator' }, { @@ -42,7 +43,7 @@ function rebuildElectronTray() { { type: 'separator' }, { label: 'Open Web UI', - click: () => shell.openExternal(`http://localhost:${port.value}/dashboard/?v=${apiKey}#/`) + click: () => shell.openExternal(`http://localhost:${port.value}/dashboard/?v=${getApiKey()}#/`) }, { type: 'separator' }, { @@ -59,9 +60,9 @@ function rebuildElectronTray() { function main() { app.whenReady().then(() => { - app.dock.setIcon('icon.png') + app.dock.setIcon(resolvePath('icon.png')) app.dock.hide() - tray = new Tray('tray.png') + tray = new Tray(resolvePath('tray.png')) rebuildElectronTray() }) } diff --git a/src/launcher.js b/src/launcher.js index ddb9dd0..c32bd0d 100644 --- a/src/launcher.js +++ b/src/launcher.js @@ -4,44 +4,45 @@ const { exit } = require('process') const { resolve } = require('path') const { spawn } = require('child_process') const { BeeManager } = require('./lifecycle') +const { resolvePath } = require('./path') async function createConfigFileAndAddress() { - writeFileSync('config.yaml', createStubConfiguration()) + writeFileSync(resolvePath('config.yaml'), createStubConfiguration()) await initializeBee() } async function createInitialTransaction() { - const config = readFileSync('config.yaml', 'utf-8') + const config = readFileSync(resolvePath('config.yaml'), 'utf-8') if (!config.includes('block-hash')) { - const { address } = JSON.parse(readFileSync('data-dir/keys/swarm.key')) + const { address } = JSON.parse(readFileSync(resolvePath('data-dir/keys/swarm.key'))) console.log('Sending transaction to address', address) const { transaction, blockHash } = await sendTransaction(address) - writeFileSync('config.yaml', createConfiguration(transaction, blockHash)) + writeFileSync(resolvePath('config.yaml'), createConfiguration(transaction, blockHash)) } } async function main() { const { rebuildElectronTray } = require('./electron') const abortController = new AbortController() - if (!existsSync('bee')) { + if (!existsSync(resolvePath('bee'))) { console.error(`Please compile bee and place it as follows: ${resolve('bee')}`) exit(1) } - if (!existsSync('data-dir')) { - mkdirSync('data-dir') + if (!existsSync(resolvePath('data-dir'))) { + mkdirSync(resolvePath('data-dir')) } - if (!existsSync('config.yaml')) { - writeFileSync('config.yaml', createStubConfiguration()) + if (!existsSync(resolvePath('config.yaml'))) { + writeFileSync(resolvePath('config.yaml'), createStubConfiguration()) } - if (!existsSync('data-dir/keys/swarm.key')) { + if (!existsSync(resolvePath('data-dir/keys/swarm.key'))) { await launchBee().catch(() => {}) } - const config = readFileSync('config.yaml', 'utf-8') + const config = readFileSync(resolvePath('config.yaml'), 'utf-8') if (!config.includes('block-hash')) { - const { address } = JSON.parse(readFileSync('data-dir/keys/swarm.key')) + const { address } = JSON.parse(readFileSync(resolvePath('data-dir/keys/swarm.key'))) console.log('Sending transaction to address', address) const { transaction, blockHash } = await sendTransaction(address) - writeFileSync('config.yaml', createConfiguration(transaction, blockHash)) + writeFileSync(resolvePath('config.yaml'), createConfiguration(transaction, blockHash)) } const subprocess = launchBee(abortController).catch(reason => { console.error(reason) diff --git a/src/path.js b/src/path.js new file mode 100644 index 0000000..f98e5a6 --- /dev/null +++ b/src/path.js @@ -0,0 +1,18 @@ +const { join } = require('path') +const { app } = require('electron') + +function resolvePath(path) { + if (process.execPath.includes('node_modules/electron/dist/Electron.app')) { + return path + } + const appName = `${app.getName()}.app` + let execPath = process.execPath + if (execPath.includes(appName)) { + execPath = execPath.split(appName)[0] + } + return join(execPath, path) +} + +module.exports = { + resolvePath +} diff --git a/src/server.js b/src/server.js index 83f806a..8a7cd87 100644 --- a/src/server.js +++ b/src/server.js @@ -2,16 +2,17 @@ const Router = require('@koa/router') const Koa = require('koa') const koaBodyparser = require('koa-bodyparser') const serve = require('koa-static') -const { apiKey } = require('./api-key') +const { getApiKey } = require('./api-key') const { writeConfigYaml, readConfigYaml } = require('./config-yaml') const { createInitialTransaction, createConfigFileAndAddress, runLauncher } = require('./launcher') const { BeeManager } = require('./lifecycle') +const { resolvePath } = require('./path') const { port } = require('./port') const { getStatus } = require('./status') function runServer() { const app = new Koa() - app.use(serve('static')) + app.use(serve(resolvePath('static'))) app.use(async (context, next) => { context.set('Access-Control-Allow-Origin', `http://localhost:${port.value}`) context.set('Access-Control-Allow-Credentials', 'true') @@ -24,7 +25,7 @@ function runServer() { }) app.use(async (context, next) => { const { authorization } = context.headers - if (authorization !== apiKey) { + if (authorization !== getApiKey()) { context.status = 401 context.body = 'Unauthorized' return diff --git a/src/status.js b/src/status.js index 7ad7e0b..24a213d 100644 --- a/src/status.js +++ b/src/status.js @@ -1,5 +1,6 @@ const { readFileSync, existsSync } = require('fs') const { readConfigYaml } = require('./config-yaml') +const { resolvePath } = require('./path') function getStatus() { const statusObject = { @@ -7,11 +8,11 @@ function getStatus() { address: null, config: null } - if (!existsSync('config.yaml') || !existsSync('data-dir')) { + if (!existsSync(resolvePath('config.yaml')) || !existsSync(resolvePath('data-dir'))) { return statusObject } statusObject.config = readConfigYaml() - const { address } = JSON.parse(readFileSync('data-dir/keys/swarm.key')) + const { address } = JSON.parse(readFileSync(resolvePath('data-dir/keys/swarm.key'))) statusObject.address = address if (!statusObject.config['block-hash']) { statusObject.status = 1 diff --git a/static/dashboard/asset-manifest.json b/static/dashboard/asset-manifest.json index 2db7176..6960e28 100644 --- a/static/dashboard/asset-manifest.json +++ b/static/dashboard/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { "main.css": "./static/css/main.59b0af6f.chunk.css", - "main.js": "./static/js/main.16628c3e.chunk.js", - "main.js.map": "./static/js/main.16628c3e.chunk.js.map", + "main.js": "./static/js/main.cfa2d25c.chunk.js", + "main.js.map": "./static/js/main.cfa2d25c.chunk.js.map", "runtime-main.js": "./static/js/runtime-main.fb7b86cd.js", "runtime-main.js.map": "./static/js/runtime-main.fb7b86cd.js.map", "static/js/2.b42b2095.chunk.js": "./static/js/2.b42b2095.chunk.js", @@ -19,6 +19,6 @@ "static/js/runtime-main.fb7b86cd.js", "static/js/2.b42b2095.chunk.js", "static/css/main.59b0af6f.chunk.css", - "static/js/main.16628c3e.chunk.js" + "static/js/main.cfa2d25c.chunk.js" ] } \ No newline at end of file diff --git a/static/dashboard/index.html b/static/dashboard/index.html index f53b088..de28309 100644 --- a/static/dashboard/index.html +++ b/static/dashboard/index.html @@ -1 +1 @@ -Bee Dashboard
\ No newline at end of file +Bee Dashboard
\ No newline at end of file diff --git a/static/dashboard/static/js/main.16628c3e.chunk.js b/static/dashboard/static/js/main.16628c3e.chunk.js deleted file mode 100644 index e402b67..0000000 --- a/static/dashboard/static/js/main.16628c3e.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{360:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},38:function(e,t,n){"use strict";n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"k",(function(){return b})),n.d(t,"h",(function(){return j})),n.d(t,"d",(function(){return h})),n.d(t,"l",(function(){return p})),n.d(t,"e",(function(){return O})),n.d(t,"i",(function(){return f})),n.d(t,"c",(function(){return x})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"j",(function(){return v}));var a=n(3),r=n.n(a),c=n(27),i=n(51),o=n(39);function s(e){return i.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function l(e){if(i.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new i.BigNumber(e);if("bigint"===typeof e)return new i.BigNumber(e.toString());if("number"===typeof e)return new i.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}function u(e){return d.apply(this,arguments)}function d(){return(d=Object(c.a)(r.a.mark((function e(t){return r.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)}function b(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"}))}}function j(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(c.a)(r.a.mark((function a(c,i){var o,s;return r.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:o=0;case 1:if(!(o>t/4).toString(16)}))}function O(e){return(e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replaceAll("_"," ")}function f(e){var t=e;return t<120?"".concat(e," seconds"):(t/=60)<120?"".concat(Math.round(t)," minutes"):(t/=60)<48?"".concat(Math.round(t)," hours"):(t/=24)<14?"".concat(Math.round(t)," days"):(t/=7)<52?"".concat(Math.round(t)," weeks"):"".concat((t/=52).toFixed(1)," years")}function x(e){return 4096*Math.pow(2,e)}function m(e,t){return 5*e/t}function g(e,t){return new o.a(t*BigInt(Math.pow(2,e)))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"[\u2026]";return e.length<=2*t+n.length?e:"".concat(e.slice(0,t)).concat(n).concat(e.slice(-t))}},39:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(12),r=n(13),c=n(51),i=n(38),o=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(a.a)(this,e),this.amount=void 0,this.decimals=void 0;var r=Object(i.g)(t);if(!Object(i.f)(r)||!o.includes(n))throw new TypeError("Not a valid token values");this.amount=r,this.decimals=n}return Object(r.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 c.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new c.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:"toSignificantDigits",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t=this.toDecimal.toFixed(16),n=-1,a=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:16,a=Object(i.g)(t),r=a.multipliedBy(new c.BigNumber(10).pow(n));return new e(r,n)}}]),e}()},409:function(e,t,n){},414:function(e,t,n){},483:function(e,t){},485:function(e,t){},497:function(e,t){},499:function(e,t){},525:function(e,t){},526:function(e,t){},53:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"f",(function(){return m}));var a=n(3),r=n.n(a),c=n(27),i=n(134),o=n.n(i),s=n(38);function l(){var t=new Uint8Array(32);return crypto.getRandomValues(t),new o.a(e.from(t))}function u(e,t){var n=e.findIndex((function(e){return e.uuid===t.uuid}));-1!==n&&e.splice(n,1),e.unshift(t),localStorage.setItem("feeds",JSON.stringify(e))}function d(e){localStorage.setItem("feeds",JSON.stringify(e))}function b(e,t,n,a){return j.apply(this,arguments)}function j(){return(j=Object(c.a)(r.a.mark((function e(t,n,a,c){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("V3"!==n||c){e.next=2;break}throw Error("V3 passwords require password");case 2:if("PRIVATE_KEY"!==n){e.next=6;break}e.t0=t.getPrivateKeyString(),e.next=9;break;case 6:return e.next=8,t.toV3String(c);case 8:e.t0=e.sent;case 9:return i=e.t0,e.abrupt("return",{uuid:Object(s.l)(),name:a,type:c?"V3":"PRIVATE_KEY",address:t.getAddressString(),identity:i});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e,t){return p.apply(this,arguments)}function p(){return(p=Object(c.a)(r.a.mark((function e(t,n){var a,c,i,o;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64!==n.length){e.next=5;break}return e.next=3,f("PRIVATE_KEY",n);case 3:return a=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:a.getAddressString()});case 5:if(66!==n.length||!n.toLowerCase().startsWith("0x")){e.next=10;break}return e.next=8,f("PRIVATE_KEY",n.slice(2));case 8:return c=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:c.getAddressString()});case 10:return e.prev=10,i=JSON.parse(n),o=i.address,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"V3",identity:n,address:o});case 15:return e.prev=15,e.t0=e.catch(10),e.abrupt("return",null);case 18:case"end":return e.stop()}}),e,null,[[10,15]])})))).apply(this,arguments)}function O(e,t){return f(e.type,e.identity,t)}function f(e,t,n){return x.apply(this,arguments)}function x(){return(x=Object(c.a)(r.a.mark((function t(n,a,c){return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("PRIVATE_KEY"!==n){t.next=4;break}t.t0=o.a.fromPrivateKey(e.from(v(a),"hex")),t.next=7;break;case 4:return t.next=6,o.a.fromV3(a,c);case 6:t.t0=t.sent;case 7:return t.abrupt("return",t.t0);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(e,t,n,a,r){return g.apply(this,arguments)}function g(){return(g=Object(c.a)(r.a.mark((function e(t,n,a,c,i){var o,s;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(n,i);case 2:if(o=e.sent,n.feedHash){e.next=7;break}return e.next=6,t.createFeedManifest(c,"sequence","00".repeat(32),o.getAddressString());case 6:n.feedHash=e.sent;case 7:return s=t.makeFeedWriter("sequence","00".repeat(32),o.getPrivateKeyString()),e.next=10,s.upload(c,a);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return e.toLowerCase().startsWith("0x")?e.slice(2):e}}).call(this,n(26).Buffer)},531:function(e,t){},533:function(e,t){},540:function(e,t){},558:function(e,t){},574:function(e,t){},579:function(e,t){},587:function(e,t){},589:function(e,t){},60:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var a=n(12);function r(t){return"object"===typeof e&&Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BEE_HOST:"http://localhost:1633",REACT_APP_BEE_DEBUG_HOST:"http://localhost:1635",REACT_APP_BEE_DOCS_HOST:"https://docs.ethswarm.org/docs/",REACT_APP_BEE_DISCORD_HOST:"https://discord.gg/eKr9XPv7",REACT_APP_BLOCKCHAIN_EXPLORER_URL:"https://blockscout.com/xdai/mainnet",REACT_APP_BEE_GITHUB_REPO_URL:"https://api.github.com/repos/ethersphere/bee"})[t]}var c=new function e(){Object(a.a)(this,e),this.BEE_API_HOST=void 0,this.BEE_DEBUG_API_HOST=void 0,this.BLOCKCHAIN_EXPLORER_URL=void 0,this.BEE_DOCS_HOST=void 0,this.BEE_DISCORD_HOST=void 0,this.GITHUB_REPO_URL=void 0,this.BEE_API_HOST=sessionStorage.getItem("api_host")||r("REACT_APP_BEE_HOST")||"http://localhost:1633",this.BEE_DEBUG_API_HOST=sessionStorage.getItem("debug_api_host")||r("REACT_APP_BEE_DEBUG_HOST")||"http://localhost:1635",this.BLOCKCHAIN_EXPLORER_URL=r("REACT_APP_BLOCKCHAIN_EXPLORER_URL")||"https://blockscout.com/xdai/mainnet",this.BEE_DOCS_HOST=r("REACT_APP_BEE_DOCS_HOST")||"https://docs.ethswarm.org/docs/",this.BEE_DISCORD_HOST=r("REACT_APP_BEE_DISCORD_HOST")||"https://discord.gg/eKr9XPv7",this.GITHUB_REPO_URL=r("REACT_APP_BEE_GITHUB_REPO_URL")||"https://api.github.com/repos/ethersphere/bee"};t.b=c}).call(this,n(30))},829:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(29),i=n.n(c),o=(n(409),n(945)),s=n(944),l=n(31),u=n(48),d=(n(414),n(900)),b=n(901),j=n(834),h=n(387),p=n(12),O=n(13),f=n(14),x=n(15),m=n(1),g=function(e){Object(f.a)(n,e);var t=Object(x.a)(n);function n(e){var a;return Object(p.a)(this,n),(a=t.call(this,e)).state={error:null},a}return Object(O.a)(n,[{key:"componentDidCatch",value:function(e,t){console.error({error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.error?Object(m.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),v=n(941),y=n(885),w=n(911),k=n(942),S=n(903),C=n(916),A=n(937),E=n(934),P=n(938),T=n(921),B=n(929),N=n(939),D=n(940),I=n(943),_=n.p+"static/media/logo.3d1155fe.svg",L=n(60),R=n(20),U=n(10),F=n(835),W=n(882),H=n(119),M=n(833),V=n(883),q=n(884),z=Object(j.a)((function(e){return Object(h.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function Y(e){var t=e.children,n=e.label,r=e.level,c=e.defaultOpen,i=e.info,o=z(),s=Object(a.useState)(Boolean(c)),l=Object(U.a)(s,2),u=l[0],d=l[1],b="",j="h1",h=o.contentLevel0;return 1===r?(b=o.rootLevel1,j="h2",h=o.contentLevel12):2===r&&(b=o.rootLevel2,j="h3",h=o.contentLevel12),Object(m.jsxs)("div",{className:"".concat(o.root," ").concat(b),children:[Object(m.jsxs)(F.a,{button:!0,onClick:function(){d(!u)},className:o.header,children:[Object(m.jsx)(W.a,{primary:Object(m.jsx)(H.a,{variant:j,children:n})}),Object(m.jsxs)("div",{style:{display:"flex"},children:[!u&&Object(m.jsx)(H.a,{variant:"body2",className:o.infoText,children:i}),u?Object(m.jsx)(V.a,{}):Object(m.jsx)(q.a,{})]})]}),Object(m.jsx)(M.a,{in:u,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)("div",{className:h,children:t})})]})}var Z=n(951),G=n(888),K=n(889),J=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),wordBreak:"break-word"},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}}})}));function X(e){var t=e.label,n=e.value,a=e.tooltip,r=J();return Object(m.jsx)(F.a,{className:r.header,children:Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(m.jsx)(H.a,{variant:"body1",children:t}),n&&Object(m.jsxs)(H.a,{variant:"body2",children:[n,a&&Object(m.jsx)(Z.a,{title:a,placement:"top",arrow:!0,children:Object(m.jsx)(G.a,{size:"small",className:r.copyValue,children:Object(m.jsx)(K.a,{strokeWidth:1})})})]})]})})}var $=Object(j.a)((function(e){return Object(h.a)({wrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap"},action:{marginBottom:e.spacing(1),marginRight:e.spacing(1)}})}));function Q(e){var t=e.children,n=$();return Array.isArray(t)?Object(m.jsx)("div",{className:n.wrapper,children:t.filter((function(e){return e})).map((function(e,t){return Object(m.jsx)("div",{className:n.action,children:e},t)}))}):Object(m.jsx)(y.a,{container:!0,direction:"row",children:Object(m.jsx)(y.a,{className:n.action,children:t})})}var ee=n(114),te=n.n(ee),ne=n(890),ae=n(891),re=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(2),marginBottom:e.spacing(2)},keyMargin:{marginRight:e.spacing(1)}})}));function ce(e){var t,n=e.label,r=e.value,c=re(),i=Object(a.useState)(!1),o=Object(U.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(!1),d=Object(U.a)(u,2),b=d[0],j=d[1],h=function(){return l(!s)},p=function(){return j(!0)},O=function(){return j(!1)},f=function(e){var t=function(e){return e.replace(/^0x/i,"").length}(e);return t%6===0?e.match(/(0x|.{6})/gi)||[]:e.match(/(0x|.{1,8})/gi)||[]}(r),x="string"===typeof(t=r)&&/^0x[0-9a-f]+$/i.test(t),g="".concat(x?"".concat(f[0]," ").concat(f[1]):f[0],"[\u2026]").concat(f[f.length-1]);return Object(m.jsx)(F.a,{className:"".concat(c.header," ").concat(s?c.headerOpen:""),children:Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[n&&Object(m.jsx)(H.a,{variant:"body1",children:n}),Object(m.jsx)(H.a,{variant:"body2",children:Object(m.jsxs)("div",{children:[!s&&Object(m.jsx)("span",{className:c.copyValue,children:Object(m.jsx)(Z.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:O,children:Object(m.jsx)(ee.CopyToClipboard,{text:r,children:Object(m.jsx)("span",{onClick:p,children:r?g:""})})})}),Object(m.jsx)(G.a,{size:"small",className:c.copyValue,children:s?Object(m.jsx)(ne.a,{onClick:h,strokeWidth:1}):Object(m.jsx)(ae.a,{onClick:h,strokeWidth:1})})]})})]}),Object(m.jsx)(M.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)("div",{className:c.content,children:Object(m.jsx)(Z.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:O,children:Object(m.jsx)(ee.CopyToClipboard,{text:r,children:Object(m.jsx)("span",{onClick:p,children:Object(m.jsx)("span",{className:c.copyValue,children:f.map((function(e,t){return Object(m.jsx)(H.a,{variant:"body2",className:c.keyMargin,component:"span",children:e},t)}))})})})})})})]})})}var ie=n(896),oe=n(894),se=n(902),le=n(898),ue=n(899),de=n(895),be=n(897),je=n(137),he={apiUrl:L.a.BEE_API_HOST,apiDebugUrl:L.a.BEE_DEBUG_API_HOST,beeApi:null,beeDebugApi:null,setApiUrl:function(){},setDebugApiUrl:function(){},lockedApiSettings:!1},pe=Object(a.createContext)(he);pe.Consumer;function Oe(e){var t=e.children,n=e.beeApiUrl,r=e.beeDebugApiUrl,c=e.lockedApiSettings,i=Object(a.useState)(he.apiUrl),o=Object(U.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(he.apiDebugUrl),d=Object(U.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(null),p=Object(U.a)(h,2),O=p[0],f=p[1],x=Object(a.useState)(null),g=Object(U.a)(x,2),v=g[0],y=g[1],w=Object(a.useState)(Boolean(c)),k=Object(U.a)(w,1)[0],S=n||s,C=r||b;return Object(a.useEffect)((function(){try{f(new je.Bee(S)),sessionStorage.setItem("api_host",S)}catch(e){f(null)}}),[S]),Object(a.useEffect)((function(){try{y(new je.BeeDebug(C)),sessionStorage.setItem("debug_api_host",C)}catch(e){y(null)}}),[C]),Object(m.jsx)(pe.Provider,{value:{apiUrl:S,apiDebugUrl:C,beeApi:O,beeDebugApi:v,setApiUrl:l,setDebugApiUrl:j,lockedApiSettings:k},children:t})}var fe=n(358),xe=n.n(fe),me=n(892);function ge(e){var t=e.value,n=Object(l.b)().enqueueSnackbar;return Object(m.jsx)("div",{style:{marginRight:"3px",marginLeft:"3px"},children:Object(m.jsx)(G.a,{color:"primary",size:"small",onClick:function(){return n("Copied: ".concat(t),{variant:"success"})},children:Object(m.jsx)(ee.CopyToClipboard,{text:t,children:Object(m.jsx)(me.a,{style:{height:"20px"}})})})})}var ve=n(359),ye=n.n(ve),we=n(893);function ke(e){var t=Object(a.useState)(!1),n=Object(U.a)(t,2),r=n[0],c=n[1];return Object(m.jsxs)("div",{children:[Object(m.jsx)(G.a,{color:"primary",size:"small",onClick:function(){c(!0)},children:Object(m.jsx)(we.a,{})}),Object(m.jsx)(oe.a,{onClose:function(){c(!1)},"aria-labelledby":"simple-dialog-title",open:r,children:Object(m.jsxs)("div",{style:{padding:"30px",textAlign:"center"},children:[Object(m.jsx)(de.a,{id:"simple-dialog-title",children:e.label}),Object(m.jsx)(ye.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}function Se(e){return Object(m.jsx)(H.a,{component:"div",variant:"subtitle1",children:e.address?Object(m.jsxs)("div",{style:{display:"flex"},children:[e.hideBlockie?null:Object(m.jsx)("div",{style:{paddingTop:"5px",marginRight:"10px"},children:Object(m.jsx)(xe.a,{size:20,string:e.address})}),Object(m.jsx)("div",{children:Object(m.jsx)("a",{style:e.truncate?{marginRight:"7px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}:{marginRight:"7px"},href:"".concat(L.a.BLOCKCHAIN_EXPLORER_URL,"/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(m.jsx)(ke,{value:e.address,label:"Ethereum Address"}),Object(m.jsx)(ge,{value:e.address})]}):"-"})}function Ce(e){var t=e.peerId,n=e.uncashedAmount,r=Object(a.useState)(!1),c=Object(U.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(!1),u=Object(U.a)(s,2),j=u[0],h=u[1],p=Object(l.b)().enqueueSnackbar,O=Object(a.useContext)(pe).beeDebugApi,f=function(){o(!1)};return Object(m.jsxs)("div",{children:[Object(m.jsxs)(ie.a,{variant:"contained",onClick:function(){o(!0)},startIcon:Object(m.jsx)(be.a,{size:"1rem"}),children:["Cash out peer ",t.substr(0,8),"[\u2026]"]}),Object(m.jsxs)(oe.a,{open:i,onClose:f,"aria-labelledby":"form-dialog-title",children:[Object(m.jsx)(de.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(m.jsx)(le.a,{children:Object(m.jsxs)(ue.a,{style:{marginTop:"20px",overflowWrap:"break-word"},children:[j&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("span",{children:["Cashing out ",Object(m.jsx)("strong",{children:n})," from Peer ",Object(m.jsx)("strong",{children:t}),". Please wait..."]}),Object(m.jsx)(d.a,{style:{textAlign:"center",padding:"50px"},children:Object(m.jsx)(b.a,{})})]}),!j&&Object(m.jsxs)("span",{children:["Are you sure you want to cashout ",Object(m.jsxs)("strong",{children:[n," BZZ"]})," from Peer"," ",Object(m.jsx)("strong",{children:t}),"?"]})]})}),Object(m.jsxs)(se.a,{children:[Object(m.jsx)(ie.a,{onClick:f,color:"primary",children:"Cancel"}),Object(m.jsx)(ie.a,{onClick:function(){O&&(t?(h(!0),O.cashoutLastCheque(t).then((function(e){o(!1),p(Object(m.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(m.jsx)(Se,{hideBlockie:!0,transaction:!0,address:e})]}),{variant:"success"})})).catch((function(e){p(Object(m.jsxs)("span",{children:["Error: ",e.message]}),{variant:"error"})})).finally((function(){h(!1)}))):p(Object(m.jsx)("span",{children:"Peer Id invalid"}),{variant:"error"}))},color:"primary",disabled:j,children:"Yes Cashout"})]})]})]})}function Ae(e){var t=e.accounting,n=e.isLoadingUncashed,a=e.totalUncashed;return Object(m.jsxs)(Y,{label:"Peers (".concat((null===t||void 0===t?void 0:t.length)||0,")"),info:"".concat(a.toFixedDecimal()," BZZ (uncashed)"),children:[Object(m.jsx)(X,{label:"Uncashed Amount Total",value:"".concat(a.toFixedDecimal()," BZZ")}),null===t||void 0===t?void 0:t.map((function(e){var t=e.peer,a=e.balance,r=e.received,c=e.sent,i=e.uncashedAmount,o=e.total;return Object(m.jsxs)(Y,{label:"Peer ".concat(t.substr(0,8),"[\u2026]"),level:1,info:"".concat(i.toFixedDecimal()," BZZ (uncashed)"),children:[Object(m.jsx)(ce,{label:"Peer ID",value:t}),Object(m.jsx)(X,{label:"Outstanding Balance",value:"".concat(a.toFixedDecimal()," BZZ")}),Object(m.jsx)(X,{label:"Settlements Sent / Received",value:"-".concat(c.toFixedDecimal()," / ").concat(r.toFixedDecimal()," BZZ")}),Object(m.jsx)(X,{label:"Total",value:"".concat(o.toFixedDecimal()," BZZ")}),Object(m.jsx)(X,{label:"Uncashed Amount",value:n?"loading\u2026":"".concat(i.toFixedDecimal()," BZZ")}),i.toBigNumber.isGreaterThan("0")&&Object(m.jsx)(Q,{children:Object(m.jsx)(Ce,{uncashedAmount:i.toFixedDecimal(),peerId:t})})]},t)}))]})}var Ee=n(904),Pe=Object(j.a)((function(e){return Object(h.a)({root:{height:"100%"},content:{maxWidth:500,marginBottom:e.spacing(4),"&:last-child":{marginBottom:0}},icon:{height:"1rem"}})}));function Te(){var e=Pe();return Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",className:e.root,children:[Object(m.jsx)(y.a,{item:!0,className:e.content,children:Object(m.jsx)(H.a,{variant:"h1",align:"center",children:"Uh oh, it looks like your node is not connected."})}),Object(m.jsx)(y.a,{item:!0,className:e.content,children:Object(m.jsxs)(H.a,{align:"center",children:["Please check your node status to fix the problem. You can also check out the"," ",Object(m.jsx)(S.a,{href:L.a.BEE_DOCS_HOST,target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})," ","or ask for support on the"," ",Object(m.jsx)(S.a,{href:L.a.BEE_DISCORD_HOST,target:"_blank",rel:"noreferrer",children:"Ethereum Swarm Discord"}),"."]})}),Object(m.jsx)(y.a,{item:!0,className:e.content,children:Object(m.jsx)(H.a,{align:"center",children:Object(m.jsx)(ie.a,{component:u.b,variant:"contained",startIcon:Object(m.jsx)(Ee.a,{className:e.icon}),to:pr.STATUS,children:"Check node status"})})})]})}var Be=n(3),Ne=n.n(Be),De=n(27),Ie=n(50),_e=n(155),Le=n.n(_e),Re=n(360),Ue=n(361),Fe=n.n(Ue),We=n(39),He=window.location.search.includes("devMode=1"),Me={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,nodeInfo:null,topology:null,chequebookAddress:null,peers:null,chequebookBalance:null,peerBalances:null,peerCheques:null,settlements:null,chainState:null,latestBeeRelease:null,isLoading:!0,isRefreshing:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},Ve=Object(a.createContext)(Me);Ve.Consumer;function qe(e,t,n,a,r,c,i,o){var s,l=He||Boolean(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BEE_HOST:"http://localhost:1633",REACT_APP_BEE_DEBUG_HOST:"http://localhost:1635",REACT_APP_BEE_DOCS_HOST:"https://docs.ethswarm.org/docs/",REACT_APP_BEE_DISCORD_HOST:"https://discord.gg/eKr9XPv7",REACT_APP_BLOCKCHAIN_EXPLORER_URL:"https://blockscout.com/xdai/mainnet",REACT_APP_BEE_GITHUB_REPO_URL:"https://api.github.com/repos/ethersphere/bee"}).REACT_APP_DEV_MODE)||"dev"===(null===n||void 0===n?void 0:n.beeMode),u={version:Boolean(e&&Le.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:a,topology:Boolean((null===r||void 0===r?void 0:r.connected)&&(null===r||void 0===r?void 0:r.connected)>0)||l,chequebook:Boolean(null===c||void 0===c?void 0:c.chequebookAddress)&&null!==i&&(null===i||void 0===i?void 0:i.totalBalance.toBigNumber.isGreaterThan(0))||l||(s=null===n||void 0===n?void 0:n.beeMode,"ultra-light"===s)};return Object(Ie.a)(Object(Ie.a)({},u),{},{all:!o&&Object.values(u).every((function(e){return e}))})}function ze(e){var t,n,r=e.children,c=Object(a.useContext)(pe),i=c.beeApi,o=c.beeDebugApi,s=Object(a.useState)(!1),l=Object(U.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(null),j=Object(U.a)(b,2),h=j[0],p=j[1],O=Object(a.useState)(null),f=Object(U.a)(O,2),x=f[0],g=f[1],v=Object(a.useState)(null),y=Object(U.a)(v,2),w=y[0],k=y[1],S=Object(a.useState)(null),C=Object(U.a)(S,2),A=C[0],E=C[1],P=Object(a.useState)(null),T=Object(U.a)(P,2),B=T[0],N=T[1],D=Object(a.useState)(null),I=Object(U.a)(D,2),_=I[0],R=I[1],F=Object(a.useState)(null),W=Object(U.a)(F,2),H=W[0],M=W[1],V=Object(a.useState)(null),q=Object(U.a)(V,2),z=q[0],Y=q[1],Z=Object(a.useState)(null),G=Object(U.a)(Z,2),K=G[0],J=G[1],X=Object(a.useState)(null),$=Object(U.a)(X,2),Q=$[0],ee=$[1],te=Object(a.useState)(null),ne=Object(U.a)(te,2),ae=ne[0],re=ne[1],ce=function(){var e=Object(a.useState)(null),t=Object(U.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),i=Object(U.a)(c,2),o=i[0],s=i[1],l=Object(a.useState)(null),u=Object(U.a)(l,2),d=u[0],b=u[1];return Object(a.useEffect)((function(){Fe.a.get("".concat(L.a.GITHUB_REPO_URL,"/releases/latest")).then((function(e){r(e.data)})).catch((function(e){b(e)})).finally((function(){s(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:o,error:d}}(),ie=ce.latestBeeRelease,oe=Object(a.useState)(Me.error),se=Object(U.a)(oe,2),le=se[0],ue=se[1],de=Object(a.useState)(Me.isLoading),be=Object(U.a)(de,2),je=be[0],he=be[1],Oe=Object(a.useState)(Me.isRefreshing),fe=Object(U.a)(Oe,2),xe=fe[0],me=fe[1],ge=Object(a.useState)(Me.lastUpdate),ve=Object(U.a)(ge,2),ye=ve[0],we=ve[1],ke=Object(a.useState)(3e4),Se=Object(U.a)(ke,2),Ce=Se[0],Ae=Se[1],Ee=null===(t=Le.a.coerce(null===ie||void 0===ie?void 0:ie.name))||void 0===t?void 0:t.version,Pe=null===(n=Le.a.coerce(null===h||void 0===h?void 0:h.version))||void 0===n?void 0:n.version,Te=null===h||void 0===h?void 0:h.version;Object(a.useEffect)((function(){he(!0),d(!1),Be()}),[i]),Object(a.useEffect)((function(){he(!0),p(null),g(null),E(null),k(null),R(null),N(null),M(null),Y(null),J(null),ee(null),re(null),Be()}),[o]);var Be=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n,a,r;return Ne.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&&o){e.next=5;break}return he(!1),e.abrupt("return");case 5:return e.prev=5,me(!0),ue(null),t=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n,a;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getChequebookBalance();case 2:return t=e.sent,n=t.totalBalance,a=t.availableBalance,e.abrupt("return",{totalBalance:new We.a(n),availableBalance:new We.a(a)});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.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 We.a(n)}})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n,a,r;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getAllSettlements();case 2:return t=e.sent,n=t.totalReceived,a=t.settlements,r=t.totalSent,e.abrupt("return",{totalReceived:new We.a(n),totalSent:new We.a(r),settlements:a.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new We.a(n),sent:new We.a(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)})),o.getHealth().then(p).catch((function(){return p(null)})),o.getNodeAddresses().then(g).catch((function(){return g(null)})),o.getNodeInfo().then(k).catch((function(){return k(null)})),o.getTopology().then(E).catch((function(){return E(null)})),o.getPeers().then(R).catch((function(){return R(null)})),o.getChequebookAddress().then(N).catch((function(){return N(null)})),o.getLastCheques().then(J).catch((function(){return J(null)})),o.getChainState().then(re).catch((function(){return re(null)})),t().then(M).catch((function(){return M(null)})),n().then(Y).catch((function(){return Y(null)})),a().then(ee).catch((function(){return ee(null)}))],e.next=14,Promise.allSettled(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),ue(e.t0);case 19:return e.prev=19,he(!1),me(!1),we(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(Be(),Ce){var e=setInterval(Be,Ce);return function(){return clearInterval(e)}}}),[Ce,o,i]),Object(m.jsx)(Ve.Provider,{value:{status:qe(h,x,w,u,A,B,H,le),latestUserVersion:Pe,latestUserVersionExact:Te,latestPublishedVersion:Ee,isLatestBeeVersion:Boolean(Ee&&Pe&&Le.a.satisfies(Ee,Pe,{includePrerelease:!0})),latestBeeVersionUrl:(null===ie||void 0===ie?void 0:ie.html_url)||"https://github.com/ethersphere/bee/releases/latest",error:le,apiHealth:u,debugApiHealth:h,nodeAddresses:x,nodeInfo:w,topology:A,chequebookAddress:B,peers:_,chequebookBalance:H,peerBalances:z,peerCheques:K,settlements:Q,chainState:ae,latestBeeRelease:ie,isLoading:je,isRefreshing:xe,lastUpdate:ye,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return Ae(e)},stop:function(){return Ae(null)},refresh:Be},children:r})}var Ye=n(38);var Ze=function(e,t,n){var r=Object(a.useState)(!1),c=Object(U.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(void 0),l=Object(U.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){if(!i&&e&&t&&!u){o(!0);var n=t.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(t){var n=t.peer;return Object(Ye.h)((function(){return e.getLastCashoutAction(n)}))}));Promise.allSettled(n).then((function(e){var t=Object(Ye.k)(e);d(t.fulfilled),o(!1)}))}}),[t,i,u,e]);var b=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 We.a("0"),received:new We.a("0"),uncashedAmount:new We.a("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,r=e.received;return a[t]=Object(Ie.a)(Object(Ie.a)({},a[t]),{},{sent:n,received:r,total:new We.a(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 We.a(n)})),Object.values(a).sort((function(e,t){var n=t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber();return 0!==n?n:e.peer22?n.slice(0,19)+"...":n;function O(){"NEW_WINDOW"===i?window.open(r||n):h(r||n)}return Object(m.jsx)(F.a,{className:l.header,children:Object(m.jsx)(y.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(m.jsx)(H.a,{variant:"body1",children:t}),Object(m.jsx)(H.a,{variant:"body2",children:Object(m.jsxs)("div",{children:[s&&Object(m.jsx)("span",{className:l.copyValue,children:Object(m.jsx)(Z.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:function(){return j(!1)},children:Object(m.jsx)(te.a,{text:n,children:Object(m.jsx)("span",{onClick:function(){return j(!0)},children:p})})})}),!s&&Object(m.jsx)("span",{onClick:O,children:p}),Object(m.jsxs)(G.a,{size:"small",className:l.openLinkIcon,children:["NEW_WINDOW"===i&&Object(m.jsx)(C.a,{onClick:O,strokeWidth:1}),"HISTORY_PUSH"===i&&Object(m.jsx)(Kt.a,{onClick:O,strokeWidth:1})]})]})})]})})})}var $t=n(379),Qt=n(918),en=n(919),tn=n(920),nn=["index.html","index.htm"];function an(e){var t=e.map(on);if(!t.length)return!1;var n=t.find((function(e){return nn.includes(e)}));if(n)return{indexPath:n};var a=t[0].split("/")[0]+"/";if(t.every((function(e){return e.startsWith(a)}))){var r=t.find((function(e){return nn.map((function(e){return a+e})).includes(e)}));if(r)return{indexPath:r,commonPrefix:a}}return!1}function rn(e){return e>=1e15?(e/1e15).toFixed(2)+" PB":e>=1e12?(e/1e12).toFixed(2)+" TB":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":e>=1e3?(e/1e3).toFixed(2)+" kB":e+" bytes"}function cn(e){if(1===e.length)return e[0].name;if(e.length>0){var t=on(e[0]).split("/")[0];if(e.every((function(e){return on(e).split("/")[0]===t})))return t}return"unknown"}function on(e){return(e.path||e.webkitRelativePath||e.name).replace(/^\//g,"")}function sn(e){var t=on(e);return{path:t,fullPath:t,webkitRelativePath:t,lastModified:e.lastModified,name:e.name,size:e.size,type:e.type,stream:e.stream,slice:e.slice,text:e.text,arrayBuffer:function(){var t=Object(De.a)(Ne.a.mark((function t(){return Ne.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.arrayBuffer();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}function ln(e,t,n){return new Promise((function(a,r){if(!e.size||!e.type||!["image/bmp","image/gif","image/vnd.microsoft.icon","image/jpeg","image/png","image/svg+xml","image/tiff","image/webp"].includes(e.type))return r("File not supported!");try{var c=new FileReader;c.readAsDataURL(e),c.onload=function(e){var r,c=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.result;if(!c||"string"!==typeof c)throw new Error("Failed to load the image source");var i=new Image;i.src=c,i.onload=function(){var e=function(e,t,n,a){var r=n?e/n:1,c=a?t/a:1,i=Math.max(r,c);return i<=1?{width:e,height:t}:{width:e/i,height:t/i}}(i.width,i.height,t,n),r=document.createElement("canvas");r.width=e.width,r.height=e.height;var c=r.getContext("2d");if(!c)throw new Error("Failed to create canvas context");c.drawImage(i,0,0,r.width,r.height),c.canvas.toBlob((function(e){if(!e)throw new Error("Failed to extract the blob from canvas");a(e)}),"image/jpeg",1)}},c.onerror=function(e){return r(e)}}catch(i){r(i)}}))}var un=".swarmgatewaymeta.json",dn=".swarmgatewaypreview.jpeg",bn=250,jn=175,hn={origin:"UPLOAD"},pn={files:[],setFiles:function(){},uploadOrigin:hn,setUploadOrigin:function(){}},On=Object(a.createContext)(pn);On.Consumer;function fn(e){var t=e.children,n=Object(a.useState)(pn.files),r=Object(U.a)(n,2),c=r[0],i=r[1],o=Object(a.useState)(pn.uploadOrigin),s=Object(U.a)(o,2),l=s[0],u=s[1],d=Object(a.useState)(void 0),b=Object(U.a)(d,2),j=b[0],h=b[1],p=Object(a.useState)(void 0),O=Object(U.a)(p,2),f=O[0],x=O[1],g=Object(a.useState)(void 0),v=Object(U.a)(g,2),y=v[0],w=v[1];return Object(a.useEffect)((function(){if(h(function(e){var t=e.reduce((function(e,t){return e+t.size}),0),n=Boolean(an(e));return{size:t,name:cn(e),type:1===e.length?e[0].type:"folder",isWebsite:n,count:e.length}}(c)),f&&(URL.revokeObjectURL(f),x(void 0),w(void 0)),1===c.length&&c[0].type.startsWith("image"))return ln(c[0],bn,jn).then((function(e){x(URL.createObjectURL(e)),w(e)})),function(){f&&URL.revokeObjectURL(f)}}),[c]),Object(m.jsx)(On.Provider,{value:{files:c,setFiles:i,uploadOrigin:l,setUploadOrigin:u,metadata:j,previewUri:f,previewBlob:y},children:t})}var xn=Object(j.a)((function(e){return Object(h.a)({areaWrapper:{position:"relative",marginBottom:e.spacing(2)},dropzone:{background:e.palette.background.default,outline:"none",color:"transparent",zIndex:1,"& svg":{opacity:0}},buttonWrapper:{top:"0",left:"0",position:"absolute",display:"flex",width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},button:{marginLeft:e.spacing(.5),marginRight:e.spacing(.5),zIndex:2}})}));function mn(e){var t=e.uploadOrigin,n=e.showHelp,r=Object(a.useContext)(On),c=r.setFiles,i=r.setUploadOrigin,o=xn(),s=Object(R.g)(),u=Object(l.b)().enqueueSnackbar,d=Object(a.useState)(!1),b=Object(U.a)(d,2),j=b[0],h=b[1],p=Object(a.useState)(0),O=Object(U.a)(p,2),f=O[0],x=O[1],g=function(){return document.querySelector(".MuiDropzoneArea-root input")},v=function(){var e=g();e&&(e.setAttribute("directory",""),e.setAttribute("webkitdirectory",""),e.setAttribute("mozdirectory",""),e.click())};return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("div",{className:o.areaWrapper,children:[Object(m.jsx)($t.a,{dropzoneClass:o.dropzone,onChange:function(e){if(e){var n=e,a=1===e.length?e[0].name:an(n)||void 0;if(e.length&&j&&!a)return u("To upload a website, there must be an index.html or index.htm in the root of the folder.",{variant:"error"}),void setTimeout((function(){x((function(e){return e+1})),c([])}),0);c(n),e.length&&(i(t),s(pr.UPLOAD_IN_PROGRESS))}},filesLimit:1e9,maxFileSize:1e9,showPreviews:!1},f),Object(m.jsxs)("div",{className:o.buttonWrapper,children:[Object(m.jsx)(st,{className:o.button,onClick:function(){var e=g();e&&(e.removeAttribute("directory"),e.removeAttribute("webkitdirectory"),e.removeAttribute("mozdirectory"),e.click())},iconType:Qt.a,children:"Add File"}),Object(m.jsx)(st,{className:o.button,onClick:function(){v(),h(!1)},iconType:en.a,children:"Add Folder"}),Object(m.jsx)(st,{className:o.button,onClick:function(){v(),h(!0)},iconType:tn.a,children:"Add Website"})]})]}),n&&Object(m.jsx)(Ut,{children:"You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm, make sure that your folder contains an \u201cindex.html\u201d file."})]})}function gn(){var e=Object(a.useContext)(ut).identities,t=Object(R.h)().uuid,n=Object(a.useContext)(pe).beeApi,r=Object(a.useContext)(Ve).status,c=Object(R.g)(),i=Object(a.useState)(!1),o=Object(U.a)(i,2),s=o[0],l=o[1],u=e.find((function(e){return e.uuid===t}));if(Object(a.useEffect)((function(){if(u&&u.feedHash)try{null===n||void 0===n||n.downloadData(u.feedHash).then((function(){return l(!0)}))}catch(e){l(!1)}}),[n,t,u]),!u||!r.all)return c(pr.FEEDS,{replace:!0}),Object(m.jsx)(m.Fragment,{});return Object(m.jsxs)("div",{children:[Object(m.jsx)(Ht,{children:"".concat(u.name," Website")}),Object(m.jsx)(mn,{showHelp:!1,uploadOrigin:{origin:"FEED",uuid:t}}),s&&u.feedHash?Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(rt.a,{mb:.25,children:Object(m.jsx)(ce,{label:"Feed hash",value:u.feedHash})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(Xt,{label:"BZZ Link",value:"https://".concat(Gt.encodeFeedReference(u.feedHash),".bzz.link")})})]}):Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsxs)(Ut,{children:["This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the"," ",Object(m.jsx)("a",{href:"https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"}),"."]})}),Object(m.jsx)(Q,{children:Object(m.jsx)(st,{iconType:jt.a,onClick:function(){c(pr.FEEDS)},cancel:!0,children:"Close"})})]})}var vn=n(117),yn={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},wn=Object(a.createContext)(yn);wn.Consumer;function kn(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),r="".concat(Math.ceil(100*a),"%");return Object(Ie.a)(Object(Ie.a)({},e),{},{usage:a,usageText:r})}function Sn(e){var t=e.children,n=Object(a.useContext)(pe).beeDebugApi,r=Object(a.useState)(yn.stamps),c=Object(U.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(yn.error),l=Object(U.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(yn.isLoading),j=Object(U.a)(b,2),h=j[0],p=j[1],O=Object(a.useState)(yn.lastUpdate),f=Object(U.a)(O,2),x=f[0],g=f[1],v=Object(a.useState)(null),y=Object(U.a)(v,2),w=y[0],k=y[1],S=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){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,p(!0),e.next=8,n.getAllPostageBatch();case 8:t=e.sent,o(t.map(kn)),g(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,p(!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(S(),w){var e=setInterval(S,w);return function(){return clearInterval(e)}}}),[w]),Object(m.jsx)(wn.Provider,{value:{stamps:i,error:u,isLoading:h,lastUpdate:x,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return k(e)},stop:function(){return k(null)},refresh:S},children:t})}function Cn(e){var t=e.feedName,n=e.onProceed,r=e.onCancel,c=e.loading,i=Object(a.useState)(""),o=Object(U.a)(i,2),s=o[0],l=o[1];return Object(m.jsxs)(ht,{children:[Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(mt,{onClose:r,children:"Update Feed"})}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsxs)(H.a,{children:["Please enter the password for \u201c",t,"\u201d:"]})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(Dt,{label:"Password",name:"password",onChange:function(e){l(e.target.value)},password:!0})}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{iconType:Et.a,onClick:function(){return n(s)},disabled:c,loading:c,children:"Proceed"}),Object(m.jsx)(st,{iconType:jt.a,onClick:r,cancel:!0,disabled:c,children:"Cancel"})]})]})}function An(){var e=Object(a.useContext)(ut),t=e.identities,n=e.setIdentities,r=Object(a.useContext)(pe),c=r.beeApi,i=r.beeDebugApi,o=Object(a.useContext)(wn),s=o.stamps,u=o.refresh,d=Object(a.useContext)(Ve).status,b=Object(R.h)().hash,j=Object(a.useState)(null),h=Object(U.a)(j,2),p=h[0],O=h[1],f=Object(a.useState)(null),x=Object(U.a)(f,2),g=x[0],v=x[1],w=Object(a.useState)(!1),k=Object(U.a)(w,2),S=k[0],C=k[1],A=Object(l.b)().enqueueSnackbar,E=Object(a.useState)(!1),P=Object(U.a)(E,2),B=P[0],N=P[1],D=Object(R.g)();function I(e,t){return _.apply(this,arguments)}function _(){return(_=Object(De.a)(Ne.a.mark((function e(a,r){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C(!0),c&&i&&p){e.next=5;break}return A(Object(m.jsx)("span",{children:"Bee API unavailabe"}),{variant:"error"}),C(!1),e.abrupt("return");case 5:return e.prev=5,e.next=8,Object(bt.f)(c,a,b,p,r);case 8:Object(bt.e)(t,a),n(Object(vn.a)(t)),D(pr.FEEDS_PAGE.replace(":uuid",a.uuid)),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(5),C(!1),("object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")||"").includes("possibly wrong passphrase")?A("Wrong password, please try again",{variant:"error"}):A("Could not update feed at this time, please try again later",{variant:"error"});case 18:case"end":return e.stop()}}),e,null,[[5,13]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){u()}),[]),d.all?Object(m.jsxs)("div",{children:[B&&g&&Object(m.jsx)(Cn,{feedName:g.name+" Website",onCancel:function(){N(!1)},onProceed:function(e){I(g,e)},loading:S}),Object(m.jsx)(Ht,{children:"Update feed"}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(y.a,{container:!0,children:Object(m.jsx)(zt,{options:t.map((function(e){return{value:e.uuid,label:"".concat(e.name," Website")}})),onChange:function(e){var n=e.target.value;v(t.find((function(e){return e.uuid===n}))||null)},label:"Feed"})})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(y.a,{container:!0,children:s?Object(m.jsx)(zt,{options:s.map((function(e){return{value:e.batchID,label:e.batchID.slice(0,8)}})),onChange:function(e){var t=e.target.value;O(t)},label:"Stamp"}):Object(m.jsx)(H.a,{children:"You need to buy a stamp first to be able to update a feed."})})}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:function(){g&&("V3"===g.type?N(!0):I(g))},iconType:T.a,loading:!B&&S,disabled:S||!p||!g,children:"Update Selected Feed"}),Object(m.jsx)(st,{onClick:function(){D(-1)},iconType:jt.a,disabled:S,cancel:!0,children:"Close"})]})]}):Object(m.jsx)(Te,{})}var En=n(198),Pn=n(385),Tn=n(922),Bn=n(923),Nn=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:"#F7F7F7",marginBottom:e.spacing(.25)},typography:{color:"#242424"}})}));function Dn(e){var t=e.children,n=Nn();return Object(m.jsx)(F.a,{className:n.header,children:Object(m.jsx)(H.a,{variant:"body1",className:n.typography,children:t})})}var In,_n=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},keyMargin:{marginRight:e.spacing(1)},unselectableLabel:{cursor:"default",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}})}));function Ln(e){var t=e.label,n=e.value,r=e.onConfirm,c=e.onChange,i=e.confirmLabel,o=e.confirmLabelDisabled,s=e.expandedOnly,l=e.helperText,u=e.placeholder,d=e.loading,b=e.mapperFn,j=e.locked,h=_n(),p=Object(a.useState)(Boolean(s)),O=Object(U.a)(p,2),f=O[0],x=O[1],g=Object(a.useState)(n||""),v=Object(U.a)(g,2),w=v[0],k=v[1],S=function(){return x(!f)};return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(F.a,{className:"".concat(h.header," ").concat(f?h.headerOpen:""),children:Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(m.jsx)(H.a,{variant:"body1",className:h.unselectableLabel,children:t}),Object(m.jsx)(H.a,{variant:"body2",children:Object(m.jsxs)("div",{children:[!f&&n,!s&&!j&&Object(m.jsx)(G.a,{size:"small",className:h.copyValue,children:f?Object(m.jsx)(ne.a,{onClick:S,strokeWidth:1}):Object(m.jsx)(Tn.a,{onClick:S,strokeWidth:1})})]})})]}),Object(m.jsx)(M.a,{in:f,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)(Pn.a,{value:w,placeholder:u,onChange:function(e){b&&(e.target.value=b(e.target.value)),k(e.target.value),c&&c(e.target.value)},fullWidth:!0,className:h.content,autoFocus:!0,hidden:j})})]})}),Object(m.jsxs)(M.a,{in:f,timeout:"auto",unmountOnExit:!0,children:[l&&Object(m.jsx)(Dn,{children:l}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{disabled:d||w===n||Boolean(o)||""===w&&void 0===n,loading:d,iconType:Bn.a,onClick:function(){return r(w)},children:i||"Save"}),Object(m.jsx)(st,{disabled:d||w===n||""===w,iconType:jt.a,onClick:function(){return k(n||"")},cancel:!0,children:"Cancel"})]})]})]})}function Rn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return"".concat(e.slice(0,t),"[\u2026]").concat(e.slice(-t))}function Un(e,t,n){var a=Fn(e),r=a.findIndex((function(e){return e.hash===t}));-1!==r&&a.splice(r,1),a.unshift({createdAt:Date.now(),hash:t,name:n}),a.length>10&&(a.length=10),localStorage.setItem(e,JSON.stringify(a))}function Fn(e){var t=localStorage.getItem(e);if(!t)return[];try{var n=JSON.parse(t);return Array.isArray(n)&&n.every(Wn)?n:[]}catch(a){return[]}}function Wn(e){return"object"===typeof e&&null!==e&&("createdAt"in e&&"hash"in e)}function Hn(e,t){return"index.html"===t?"Website ".concat(Rn(e,4)):t||"Folder ".concat(Rn(e,4))}function Mn(e){var t=e.title,n=e.localStorageKey,r=Object(a.useState)([]),c=Object(U.a)(r,2),i=c[0],o=c[1];return Object(a.useEffect)((function(){o(Fn(n))}),[n]),i.length?Object(m.jsx)(Y,{label:t,defaultOpen:!0,children:i.map((function(e,t){return Object(m.jsx)(Xt,{label:(n=new Date(e.createdAt),n.toString().split("GMT")[0].trim()),value:e.name,link:"/files/hash/"+e.hash,navigationType:"HISTORY_PUSH",allowClipboard:!1},t);var n}))}):null}!function(e){e.UPLOAD_HISTORY="UPLOAD_HISTORY",e.DOWNLOAD_HISTORY="DOWNLOAD_HISTORY"}(In||(In={}));var Vn=n(948),qn=n(924),zn=Object(j.a)((function(e){return Object(h.a)({root:{flexGrow:1,marginBottom:e.spacing(4)},leftTab:{marginRight:e.spacing(.5)},rightTab:{marginLeft:e.spacing(.5)}})}));function Yn(e){var t=e.active,n=zn(),a=Object(R.g)();return Object(m.jsx)("div",{className:n.root,children:Object(m.jsxs)(Vn.a,{value:"UPLOAD"===t?0:1,onChange:function(e,t){a(1===t?pr.DOWNLOAD:pr.UPLOAD)},variant:"fullWidth",children:[Object(m.jsx)(qn.a,{className:n.leftTab,label:"Upload"},"UPLOAD"),Object(m.jsx)(qn.a,{className:n.rightTab,label:"Download"},"DOWNLOAD")]})})}function Zn(){var e=Object(a.useState)(!1),t=Object(U.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(pe).beeApi,i=Object(a.useState)(void 0),o=Object(U.a)(i,2),s=o[0],u=o[1],d=Object(a.useContext)(On).setUploadOrigin,b=Object(l.b)().enqueueSnackbar,j=Object(R.g)();function h(){return(h=Object(De.a)(Ne.a.mark((function e(t){var n,a,i,o;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r(!0),c){e.next=4;break}return r(!1),e.abrupt("return");case 4:return e.prev=4,n=new En.ManifestJs(c),e.next=8,n.resolveFeedManifest(t);case 8:return(a=e.sent)&&(t=a),e.next=12,n.isManifest(t);case 12:if(e.sent){e.next=15;break}throw Error("The specified hash does not contain valid content.");case 15:return e.next=17,n.getIndexDocumentPath(t);case 17:i=e.sent,Un(In.DOWNLOAD_HISTORY,t,Hn(t,i)),d(hn),j(pr.HASH.replace(":hash",t)),e.next=29;break;case 23:e.prev=23,e.t0=e.catch(4),(o="object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")).includes("path address not found")&&(o="The specified hash does not have an index document set."),o.includes("Not Found: Not Found")&&(o="The specified hash was not found."),b(Object(m.jsxs)("span",{children:["Error: ",o||"Unknown"]}),{variant:"error"});case 29:return e.prev=29,r(!1),e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[4,23,29,32]])})))).apply(this,arguments)}return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Yn,{active:"DOWNLOAD"}),Object(m.jsx)(Ln,{label:"Swarm Hash",onConfirm:function(e){return function(e){return h.apply(this,arguments)}(e)},onChange:function(e){je.Utils.isHexString(e,64)||je.Utils.isHexString(e,128)||!e.trim().length?u(void 0):u("Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.")},helperText:s,confirmLabel:"Find",confirmLabelDisabled:Boolean(s)||n,placeholder:"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605",expandedOnly:!0,mapperFn:function(e){return function(e){return e.length<64?e:Object(Ye.d)(e)||e}(e)},loading:n}),Object(m.jsx)(Mn,{title:"Download History",localStorageKey:In.DOWNLOAD_HISTORY})]})}var Gn=n(373),Kn=n.n(Gn);function Jn(){return Object(m.jsx)(y.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",children:Object(m.jsx)(b.a,{})})}var Xn=n(926),$n=n(925),Qn=n(927),ea=Object(j.a)((function(){return Object(h.a)({image:{width:"100%",height:"100%",objectFit:"cover"}})}));function ta(e){var t=ea(),n={};return e.maxHeight&&(n.maxHeight=e.maxHeight),e.maxWidth&&(n.maxWidth=e.maxWidth),Object(m.jsx)("img",{className:t.image,alt:e.alt,src:e.src,style:n})}var na=Object(j.a)((function(){return Object(h.a)({wrapper:{display:"flex",justifyContent:"center",alignItems:"center",width:"175px",height:"175px",background:"repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )"}})}));function aa(e){var t=e.children,n=na();return Object(m.jsx)("div",{className:n.wrapper,children:t})}function ra(e){var t=e.icon;return Object(m.jsx)(aa,{children:t})}function ca(e){var t=e.metadata,n=e.previewUri,a=Object(m.jsx)($n.a,{}),r=null===t||void 0===t?void 0:t.type;return(null===t||void 0===t?void 0:t.isWebsite)?(a=Object(m.jsx)(Xn.a,{}),r="Website"):"folder"===(null===t||void 0===t?void 0:t.type)&&(a=Object(m.jsx)(Qn.a,{}),r="Folder"),Object(m.jsxs)(rt.a,{mb:4,children:[Object(m.jsx)(rt.a,{bgcolor:"background.paper",children:Object(m.jsxs)(y.a,{container:!0,direction:"row",children:[n?Object(m.jsx)(ta,{maxWidth:"250px",maxHeight:"175px",alt:"Upload Preview",src:n}):Object(m.jsx)(ra,{icon:a}),Object(m.jsxs)(rt.a,{p:2,children:[(null===t||void 0===t?void 0:t.hash)&&Object(m.jsxs)(H.a,{children:["Swarm Hash: ",Rn(t.hash)]}),(null===t||void 0===t?void 0:t.name)&&(null===t||void 0===t?void 0:t.name)!==(null===t||void 0===t?void 0:t.hash)&&Object(m.jsxs)(H.a,{children:["folder"===(null===t||void 0===t?void 0:t.type)?"Folder Name":"Filename",": ",Object(Ye.j)(null===t||void 0===t?void 0:t.name)]}),Object(m.jsxs)(H.a,{children:["Kind: ",r]}),(null===t||void 0===t?void 0:t.size)?Object(m.jsxs)(H.a,{children:["Size: ",rn(t.size)]}):null]})]})}),"folder"===(null===t||void 0===t?void 0:t.type)&&t.count&&Object(m.jsx)(rt.a,{mt:.25,p:2,bgcolor:"background.paper",children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(m.jsx)(H.a,{variant:"subtitle2",children:"Folder content"}),Object(m.jsxs)(H.a,{variant:"subtitle2",children:[t.count," items"]})]})})]})}function ia(e){var t=e.isWebsite,n=e.hash;return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)(rt.a,{mb:4,children:[Object(m.jsx)(ce,{label:"Swarm hash",value:n}),Object(m.jsx)(Xt,{label:"Share on Swarm Gateway",value:"https://gateway.ethswarm.org/access/".concat(n)}),t&&Object(m.jsx)(Xt,{label:"BZZ Link",value:"https://".concat(Gt.encodeManifestReference(n).toString(),".bzz.link")})]}),Object(m.jsxs)(Ut,{children:["The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided for testing purposes only. Learn more at"," ",Object(m.jsx)("a",{href:"https://gateway.ethswarm.org/",children:"https://gateway.ethswarm.org/"}),"."]})]})}var oa=n(928);function sa(e){var t=e.onOpen,n=e.onCancel,a=e.onDownload,r=e.onUpdateFeed,c=e.hasIndexDocument,i=e.loading;return Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsxs)(Q,{children:[c&&Object(m.jsx)(st,{onClick:t,iconType:oa.a,disabled:i,children:"View Website"}),Object(m.jsx)(st,{onClick:a,iconType:tt.a,disabled:i,loading:i,children:"Download"}),Object(m.jsx)(st,{onClick:n,iconType:jt.a,disabled:i,cancel:!0,children:"Close"})]}),Object(m.jsx)(rt.a,{mb:1,mr:1,children:Object(m.jsx)(st,{onClick:r,iconType:T.a,disabled:i,children:"Update Feed"})})]})}function la(){var e=Object(a.useContext)(pe),t=e.apiUrl,n=e.beeApi,r=Object(a.useContext)(Ve).status,c=Object(R.h)().hash,i=c,o=Object(R.g)(),s=Object(l.b)().enqueueSnackbar,u=Object(a.useState)(!0),d=Object(U.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),p=Object(U.a)(h,2),O=p[0],f=p[1],x=Object(a.useState)({}),g=Object(U.a)(x,2),v=g[0],y=g[1],w=Object(a.useState)(null),k=Object(U.a)(w,2),S=k[0],C=k[1],A=Object(a.useState)(!1),E=Object(U.a)(A,2),P=E[0],T=E[1],B=Object(a.useState)(void 0),N=Object(U.a)(B,2),D=N[0],I=N[1],_=Object(a.useState)(),F=Object(U.a)(_,2),W=F[0],M=F[1];function V(){return V=Object(De.a)(Ne.a.mark((function e(){var t,a,o,l,u,d,b,j;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&r.all){e.next=2;break}return e.abrupt("return");case 2:return t=new En.ManifestJs(n),e.next=5,t.isManifest(i);case 5:if(e.sent){e.next=10;break}return T(!0),s("The specified hash does not contain valid content.",{variant:"error"}),e.abrupt("return");case 10:return e.next=12,t.getHashes(i);case 12:return a=e.sent,e.next=15,t.getIndexDocumentPath(i);case 15:return o=e.sent,C(o),l=a[dn],delete a[un],delete a[dn],y(a),u=Object.keys(a).length,d={hash:c,size:0,type:u>1?"folder":"unknown",name:i,isWebsite:Boolean(o)&&u>1,count:u},e.prev=23,e.next=26,n.downloadFile(i,un);case 26:b=e.sent,j=b.data.text(),d=Object(Ie.a)(Object(Ie.a)({},d),JSON.parse(j)),e.next=33;break;case 31:e.prev=31,e.t0=e.catch(23);case 33:l&&I("".concat(L.b.BEE_API_HOST,"/bzz/").concat(i,"/").concat(dn)),M(d);case 35:case"end":return e.stop()}}),e,null,[[23,31]])}))),V.apply(this,arguments)}function q(){return(q=Object(De.a)(Ne.a.mark((function e(){var a,r,c,o,s,l,u;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(Un(In.DOWNLOAD_HISTORY,i,Hn(i,S)),f(!0),1!==Object.keys(v).length){e.next=8;break}window.open("".concat(t,"/bzz/").concat(i,"/"),"_blank"),e.next=25;break;case 8:a=new Kn.a,r=0,c=Object.entries(v);case 10:if(!(r0?o(-1):o(pr.UPLOAD)},onDownload:function(){return q.apply(this,arguments)},onUpdateFeed:function(){o(pr.FEEDS_UPDATE.replace(":hash",i))},hasIndexDocument:Boolean(null===W||void 0===W?void 0:W.isWebsite),loading:O})]}):Object(m.jsx)(Te,{})}var ua=Object(j.a)((function(){return Object(h.a)({wrapper:{height:"52px",display:"flex",flex:1,justifyContent:"center",alignItems:"center"},todo:{background:"#f7f7f7",color:"#c9c9c9"},inProgress:{background:"#ffffff",color:"#242424",height:"52px"},done:{background:"#f7f7f7",color:"#606060",height:"52px"}})}));function da(e){var t=e.steps,n=e.index,a=ua();function r(e){return e===n?a.inProgress:e255)return"-";var n=Object(Ye.a)(e,t);return"".concat(n.toSignificantDigits()," BZZ")}return Object(m.jsx)(Tt.c,{initialValues:ba,onSubmit:function(){var e=Object(De.a)(Ne.a.mark((function e(n,a){var o,s,l;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.depth&&n.amount){e.next=3;break}return e.abrupt("return");case 3:if(c){e.next=5;break}return e.abrupt("return");case 5:return o=BigInt(n.amount),s=Number.parseInt(n.depth),l=n.label?{label:n.label}:void 0,e.next=10,c.createPostageBatch(o.toString(),s,l);case 10:return a.resetForm(),e.next=13,r();case 13:t(),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),i("Error: ".concat(e.t0.message),{variant:"error"}),a.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 Ke.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 Ke.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 t,n=e.submitForm,a=e.isValid,r=e.isSubmitting,c=e.values;return Object(m.jsxs)(Tt.b,{children:[Object(m.jsxs)(rt.a,{mb:2,children:[Object(m.jsx)(Dt,{name:"depth",label:"Depth",formik:!0}),Object(m.jsx)(rt.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsx)(H.a,{children:"Corresponding file size"}),Object(m.jsx)(H.a,{children:(t=parseInt(c.depth||"0",10),isNaN(t)||t<17||t>255?"-":"~".concat(rn(Object(Ye.c)(t))))})]})})]}),Object(m.jsxs)(rt.a,{mb:2,children:[Object(m.jsx)(Dt,{name:"amount",label:"Amount",formik:!0}),Object(m.jsx)(rt.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsx)(H.a,{children:"Corresponding TTL (Time to live)"}),Object(m.jsx)(H.a,{children:o(Number.parseInt(c.amount||"0",10))})]})})]}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(Dt,{name:"label",label:"Label",optional:!0,formik:!0})}),Object(m.jsx)(rt.a,{mb:4,sx:{bgcolor:"#fcf2e8"},p:2,children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsx)(H.a,{children:"Indicative Price"}),Object(m.jsx)(H.a,{children:s(parseInt(c.depth||"0",10),BigInt(c.amount||"0"))})]})}),Object(m.jsx)(st,{disabled:r||!a||!c.amount||!c.depth,onClick:n,iconType:Et.a,loading:r,children:"Buy New Stamp"})]})}})}function ha(e){var t=e.onSelect,n=e.defaultValue,r=Object(a.useContext)(wn).stamps;return Object(m.jsx)(zt,{options:(r||[]).map((function(e){return{label:e.batchID.slice(0,8),value:e.batchID}})),onChange:function(e){return function(e){if(r){var n=r.find((function(t){return t.batchID===e}));n&&t(n)}}(e.target.value)},defaultValue:n})}function pa(e){var t=e.width,n=e.usage,a=Math.round(100*n),r=a+"%",c=98-a+"%";return Object(m.jsx)("div",{style:{display:"flex",alignItems:"center",height:"100%",width:t},children:Object(m.jsxs)("div",{style:{display:"flex",height:"4px",width:"100%"},children:[Object(m.jsx)("div",{style:{width:r,background:"#dd7200"}}),Object(m.jsx)("div",{style:{width:"2%"}}),Object(m.jsx)("div",{style:{width:c,background:"#c9c9c9"}})]})})}function Oa(e){var t=e.stamp,n=e.shorten;return Object(m.jsx)(rt.a,{p:2,width:"100%",children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(m.jsx)(H.a,{variant:"subtitle2",children:n?t.batchID.slice(0,8):t.batchID}),Object(m.jsx)(pa,{width:"100px",usage:t.usage})]})})}function fa(e){var t=e.stamp;return Object(m.jsxs)(rt.a,{mb:4,children:[Object(m.jsx)(rt.a,{mb:.25,p:2,bgcolor:"background.paper",children:Object(m.jsx)(H.a,{variant:"subtitle2",children:"Associated postage stamp:"})}),Object(m.jsx)(rt.a,{bgcolor:"background.paper",children:Object(m.jsx)(Oa,{stamp:t,shorten:!0})})]})}var xa=n(930);function ma(e){var t=e.step,n=e.onUpload,a=e.onCancel,r=e.onGoBack,c=e.onProceed,i=e.isUploading,o=e.hasStamp,s=e.uploadLabel,l=e.stampMode,u=e.setStampMode;return 0===t?Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(rt.a,{mb:1,children:Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:c,iconType:B.a,children:"Add Postage Stamp"}),Object(m.jsx)(st,{onClick:a,iconType:jt.a,cancel:!0,children:"Cancel"})]})}),Object(m.jsx)(Ut,{children:"You need a postage stamp to upload."})]}):1===t?Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",children:[Object(m.jsxs)(Q,{children:["SELECT"===l&&Object(m.jsx)(st,{onClick:c,iconType:Et.a,disabled:!o,children:"Proceed With Selected Stamp"}),Object(m.jsx)(st,{onClick:r,iconType:xa.a,cancel:!0,children:"Back To Preview"})]}),Object(m.jsx)(st,{onClick:function(){return u("BUY"===l?"SELECT":"BUY")},iconType:"BUY"===l?B.a:ct.a,children:"BUY"===l?"Use Existing Stamp":"Buy New Stamp"})]}):2===t?Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:n,iconType:Et.a,disabled:i,loading:i,children:s}),Object(m.jsx)(st,{onClick:r,iconType:xa.a,disabled:i,cancel:!0,children:"Change Postage Stamp"})]}):Object(m.jsx)(m.Fragment,{})}function ga(){var e=Object(a.useState)(0),t=Object(U.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)("SELECT"),i=Object(U.a)(c,2),o=i[0],s=i[1],u=Object(a.useState)(null),d=Object(U.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),p=Object(U.a)(h,2),O=p[0],f=p[1],x=Object(a.useState)(!1),g=Object(U.a)(x,2),v=g[0],y=g[1],w=Object(a.useContext)(wn).refresh,k=Object(a.useContext)(pe).beeApi,S=Object(a.useContext)(On),C=S.files,A=S.setFiles,E=S.uploadOrigin,P=S.metadata,T=S.previewUri,B=S.previewBlob,N=Object(a.useContext)(ut),D=N.identities,I=N.setIdentities,_=Object(a.useContext)(Ve).status,L=Object(l.b)().enqueueSnackbar,F=Object(R.g)();if(Object(a.useEffect)((function(){w()}),[]),!_.all)return Object(m.jsx)(Te,{});if(!C.length)return A([]),F(pr.UPLOAD,{replace:!0}),Object(m.jsx)(m.Fragment,{});var W=E.uuid?D.find((function(e){return e.uuid===E.uuid})):null,H=function(e){if(k&&C.length&&b&&P){var t=C.map(sn),n=void 0;if(1===C.length)n=C[0].name;else if(C.length>1){var a=an(C);if(a)if(a.commonPrefix){var r=a.commonPrefix.length;n=a.indexPath.substr(r),t=t.map((function(e){var t=e.path.substr(r);return Object(Ie.a)(Object(Ie.a)({},e),{},{path:t,webkitRelativePath:t,fullPath:t})}))}else n=a.indexPath}var c=C[0].lastModified,i={name:P.name,size:P.size};1===C.length&&(i.type=P.type);var o=new File([JSON.stringify(i)],un,{type:"application/json",lastModified:c});if(t.push(sn(o)),B){var s=new File([B],dn,{type:"image/jpeg",lastModified:c});t.push(sn(s))}f(!0),k.uploadFiles(b.batchID,t,{indexDocument:n}).then((function(t){Un(In.UPLOAD_HISTORY,t.reference,cn(C)),"UPLOAD"===E.origin?F(pr.HASH.replace(":hash",t.reference),{replace:!0}):Object(bt.f)(k,W,t.reference,b.batchID,e).then((function(){Object(bt.e)(D,W),I(Object(vn.a)(D)),F(pr.FEEDS_PAGE.replace(":uuid",E.uuid),{replace:!0})}))})).catch((function(e){L("Error uploading: ".concat(e.message),{variant:"error"}),f(!1)}))}};return Object(m.jsxs)(m.Fragment,{children:[v&&Object(m.jsx)(Cn,{loading:O,feedName:W.name,onCancel:function(){return y(!1)},onProceed:function(e){H(e)}}),W&&Object(m.jsx)(Ht,{children:'Update "'.concat(W.name,'"')}),!W&&Object(m.jsx)(Ht,{children:"Upload"}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(da,{steps:["Preview","Add postage stamp","Upload to node"],index:n})}),(0===n||2===n)&&Object(m.jsx)(ca,{metadata:P,previewUri:T}),1===n&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(rt.a,{mb:2,children:"SELECT"===o?Object(m.jsx)(ha,{onSelect:function(e){return j(e)},defaultValue:null===b||void 0===b?void 0:b.batchID}):Object(m.jsx)(ja,{onFinished:function(){return s("SELECT")}})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsxs)(Ut,{children:["Please refer to the"," ",Object(m.jsx)("a",{href:"https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"})," ","to understand these values."]})})]}),2===n&&b&&Object(m.jsx)(fa,{stamp:b}),Object(m.jsx)(ma,{step:n,onCancel:function(){r(0),A([]),j(null),f(!1)},onGoBack:function(){return r((function(e){return e-1}))},onProceed:function(){return r((function(e){return e+1}))},onUpload:function(){"UPLOAD"===E.origin||"PRIVATE_KEY"===W.type?H():y(!0)},isUploading:O,hasStamp:Boolean(b),uploadLabel:W?"Update Feed":"Upload To Your Node",stampMode:o,setStampMode:s})]})}function va(){return Object(a.useContext)(Ve).status.all?Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Yn,{active:"UPLOAD"}),Object(m.jsx)(mn,{showHelp:!0,uploadOrigin:hn}),Object(m.jsx)(Mn,{title:"Upload History",localStorageKey:In.UPLOAD_HISTORY})]}):Object(m.jsx)(Te,{})}var ya=n(193),wa=1e5,ka="There may be issues with your Bee node or connection.",Sa={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. "+ka,score:0}],population:[{minimumValue:wa,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(wa.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. "+ka,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. "+ka,score:0}]};function Ca(e,t){var n,a=Sa[e],r=a[0].score,c=Object(ya.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(s){c.e(s)}finally{c.f()}var o=a[a.length-1];return{score:o.score,maximumScore:r,explanation:o.explanation}}var Aa=function(e){var t,n,a,r,c,i,o={connectedPeers:Ca("connectedPeers",(null===(t=e.topology)||void 0===t?void 0:t.connected)||0),population:Ca("population",(null===(n=e.topology)||void 0===n?void 0:n.population)||0),depth:Ca("depth",(null===(a=e.topology)||void 0===a?void 0:a.depth)||0)},s=Object.values(o).reduce((function(e,t){return e+t.maximumScore}),0),l=Object.values(o).reduce((function(e,t){return e+t.score}),0),u=Math.round(l/s*100)+"%";return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(X,{label:"Overall Health Indicator",value:u}),Object(m.jsx)(X,{label:"Connected Peers",value:null===(r=e.topology)||void 0===r?void 0:r.connected.toString(),tooltip:o.connectedPeers.explanation}),Object(m.jsx)(X,{label:"Population",value:null===(c=e.topology)||void 0===c?void 0:c.population.toString(),tooltip:o.population.explanation}),Object(m.jsx)(X,{label:"Depth",value:null===(i=e.topology)||void 0===i?void 0:i.depth.toString(),tooltip:o.depth.explanation})]})};function Ea(){var e=Object(a.useContext)(Ve),t=e.nodeInfo,n=e.status,r=e.latestUserVersion,c=e.isLatestBeeVersion,i=e.latestBeeVersionUrl,o=e.topology,s=e.nodeAddresses,l=e.chequebookAddress;return n.all?Object(m.jsxs)("div",{children:[Object(m.jsxs)(Y,{label:"Bee Node",defaultOpen:!0,children:[Object(m.jsx)(X,{label:"Mode",value:(null===t||void 0===t?void 0:t.beeMode)||"Unknown"}),Object(m.jsx)(X,{label:"Agent",value:Object(m.jsxs)("div",{children:[Object(m.jsx)("a",{href:"https://github.com/ethersphere/bee",rel:"noreferrer",target:"_blank",children:"Bee"})," ".concat(r||"-"," "),Object(m.jsx)(ie.a,{size:"small",variant:"outlined",href:i,target:"_blank",children:c?"latest":"update"})]})}),Object(m.jsx)(ce,{label:"Public key",value:(null===s||void 0===s?void 0:s.publicKey)||""}),Object(m.jsx)(ce,{label:"PSS public key",value:(null===s||void 0===s?void 0:s.pssPublicKey)||""}),Object(m.jsx)(ce,{label:"Overlay address (Peer ID)",value:(null===s||void 0===s?void 0:s.overlay)||""}),Object(m.jsx)(Y,{level:1,label:"Underlay addresses",children:null===s||void 0===s?void 0:s.underlay.map((function(e){return Object(m.jsx)(X,{value:e},e)}))})]}),Object(m.jsxs)(Y,{label:"Blockchain",defaultOpen:!0,children:[Object(m.jsx)(ce,{label:"Ethereum address",value:(null===s||void 0===s?void 0:s.ethereum)||""}),Object(m.jsx)(ce,{label:"Chequebook contract address",value:(null===l||void 0===l?void 0:l.chequebookAddress)||""})]}),Object(m.jsx)(Y,{label:"Connectivity",defaultOpen:!0,children:Object(m.jsx)(Aa,{topology:o})})]}):Object(m.jsx)(Te,{})}function Pa(){var e=Object(a.useContext)(pe),t=e.apiUrl,n=e.apiDebugUrl,r=e.setApiUrl,c=e.setDebugApiUrl,i=e.lockedApiSettings;return Object(m.jsxs)(Y,{label:"API Settings",defaultOpen:!0,children:[Object(m.jsx)(Ln,{label:"Bee API",value:t,onConfirm:r,locked:i}),Object(m.jsx)(Ln,{label:"Bee Debug API",value:n,onConfirm:c,locked:i})]})}var Ta=Object(j.a)((function(e){return Object(h.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function Ba(e){var t=e.children,n=e.expandable,r=e.defaultOpen,c=Ta(),i=Object(a.useState)(Boolean(r)),o=Object(U.a)(i,2),s=o[0],l=o[1];return Object(m.jsxs)("div",{className:"".concat(c.root," ").concat(c.rootLevel2),children:[Object(m.jsxs)(F.a,{button:!0,onClick:function(){l(!s)},className:c.header,children:[t,s?Object(m.jsx)(V.a,{}):Object(m.jsx)(q.a,{})]}),Object(m.jsx)(M.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)("div",{className:c.contentLevel12,children:n})})]})}var Na=function(e){var t=e.postageStamps;return null===t?null:Object(m.jsx)(Y,{label:"Postage Stamps",defaultOpen:!0,children:t.map((function(e){return Object(m.jsx)(Ba,{expandable:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(ce,{label:"Batch ID",value:e.batchID}),Object(m.jsx)(X,{label:"Depth",value:String(e.depth)}),Object(m.jsx)(X,{label:"Capacity",value:"".concat(rn(4096*Math.pow(2,e.depth)*e.usage)," / ").concat(rn(4096*Math.pow(2,e.depth)))}),Object(m.jsx)(X,{label:"Amount",value:parseInt(e.amount,10).toLocaleString()})]}),children:Object(m.jsx)(Oa,{stamp:e,shorten:!0})},e.batchID)}))})},Da=Object(j.a)((function(){return Object(h.a)({root:{width:"100%",display:"grid"},actions:{display:"flex",width:"100%",flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function Ia(){var e=Da(),t=Object(R.g)(),n=Object(a.useContext)(wn),r=n.stamps,c=n.isLoading,i=n.error,o=n.start,s=n.stop,l=Object(a.useContext)(Ve).status;if(Object(a.useEffect)((function(){if(l.all)return o(),function(){return s()}}),[l]),!l.all)return Object(m.jsx)(Te,{});return Object(m.jsxs)("div",{className:e.root,children:[i&&Object(m.jsxs)(d.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",i.message]}),!i&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("div",{className:e.actions,children:[Object(m.jsx)(st,{onClick:function(){t(pr.STAMPS_NEW)},iconType:ct.a,children:"Buy New Postage Stamp"}),Object(m.jsx)("div",{style:{height:"5px"},children:c&&Object(m.jsx)(b.a,{})})]}),Object(m.jsx)(Na,{postageStamps:r})]})]})}function _a(){var e=Object(R.g)();return Object(m.jsxs)("div",{children:[Object(m.jsx)(Ht,{children:"Buy new postage stamp"}),Object(m.jsx)(ja,{onFinished:function(){e(pr.STAMPS)}})]})}var La=n(949),Ra=n(380),Ua=["children","value","index"];function Fa(e){var t=e.children,n=e.value,a=e.index,r=Object(Ra.a)(e,Ua);return Object(m.jsx)("div",Object(Ie.a)(Object(Ie.a)({role:"tabpanel",hidden:n!==a},r),{},{children:n===a&&t}))}var Wa=Object(j.a)((function(e){return Object(h.a)({root:{flexGrow:1},content:{marginTop:e.spacing(2)}})}));function Ha(e){var t=e.values,n=e.index,a=e.indexChanged,c=Wa(),i=r.a.useState(n||0),o=Object(U.a)(i,2),s=o[0],l=o[1],u=void 0!==n?n:s;return Object(m.jsxs)("div",{className:c.root,children:[Object(m.jsx)(Vn.a,{value:u,onChange:function(e,t){a?a(t):l(t)},variant:"fullWidth",children:t.map((function(e,t){var n=e.label;return Object(m.jsx)(qn.a,{label:n},t)}))}),Object(m.jsx)("div",{className:c.content,children:t.map((function(e,t){var n=e.component;return Object(m.jsx)(Fa,{value:u,index:t,children:n},t)}))})]})}var Ma,Va,qa=n(950),za=function(e){return Object(m.jsx)("div",{style:{textAlign:"left"},children:Object(m.jsx)(qa.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"}(Ma||(Ma={})),function(e){e[e.macOS=Ma.macOS]="macOS",e[e.Linux=Ma.Linux]="Linux"}(Va||(Va={}));var Ya={platform:Va.macOS,setPlatform:function(){}},Za=Object(a.createContext)(Ya);Za.Consumer;function Ga(e){var t=e.children,n=Object(a.useState)(Va.Linux),r=Object(U.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)?Ma.macOS:["iPhone","iPad","iPod"].includes(t)?Ma.iOS:["Win32","Win64","Windows","WinCE"].includes(t)?Ma.Windows:/Android/.test(e)?Ma.Android:/Linux/.test(t)?Ma.Linux:null}();i(function(e){return Object.keys(Va).includes(e)}(e)?e:Va.Linux)}),[]),Object(m.jsx)(Za.Provider,{value:{platform:c,setPlatform:i},children:t})}function Ka(e){var t=Object(a.useContext)(Za),n=t.platform,r=t.setPlatform;return Object(m.jsx)(Ha,{index:n,indexChanged:r,values:[{label:"Linux",component:Object(m.jsx)(za,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})},{label:"macOS",component:Object(m.jsx)(za,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})}]})}function Ja(e){var t=e.isOk,n=e.size,a=e.className,r=n||"1rem";return e.isLoading?Object(m.jsx)(b.a,{size:r,className:a}):Object(m.jsx)("span",{className:a,style:{backgroundColor:t?"#1de600":"#ff3a52",height:r,width:r,borderRadius:"50%",display:"inline-block"}})}function Xa(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=Object(a.useContext)(pe),c=r.setDebugApiUrl,i=r.apiDebugUrl,o=t.debugApiConnection;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:o,isLoading:n})," Connection to Bee Debug API"]}),children:[Object(m.jsx)(Dn,{children:o?"The connection to the Bee nodes debug API has been successful":"We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue."}),Object(m.jsx)(Ln,{label:"Bee Debug API",value:i,onConfirm:c}),!o&&Object(m.jsx)(Y,{level:1,label:"Troubleshoot",children:Object(m.jsx)(X,{label:Object(m.jsxs)("ol",{children:[Object(m.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(m.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(m.jsx)(La.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(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(m.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(m.jsx)(Ka,{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(m.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(m.jsx)("strong",{children:"debug-api-enable"})," must be set to ",Object(m.jsx)("strong",{children:"true"})," and"," ",Object(m.jsx)("strong",{children:"cors-allowed-origins"})," must be set to your host domain or IP (you can also use the wildcard ",Object(m.jsx)("code",{children:"cors-allowed-origins: ['*']"}),"). If edits are made to the configuration run the restart command below for changes to take effect."]}),Object(m.jsx)(Ka,{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 $a(){var e=Object(a.useContext)(pe),t=e.setApiUrl,n=e.apiUrl,r=Object(a.useContext)(Ve),c=r.status,i=r.isLoading,o=c.apiConnection;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:o,isLoading:i})," Connection to Bee API"]}),children:[Object(m.jsx)(Dn,{children:o?"The connection to the Bee nodes API has been successful":"Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it."}),Object(m.jsx)(Ln,{label:"Bee API",value:n,onConfirm:t}),!o&&Object(m.jsx)(Y,{level:1,label:"Troubleshoot",children:Object(m.jsx)(X,{label:Object(m.jsxs)("ol",{children:[Object(m.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(m.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(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(m.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(m.jsx)(Ka,{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 Qa(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.latestUserVersion,c=e.latestPublishedVersion,i=e.latestBeeVersionUrl,o=t.version;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:o,isLoading:n})," Bee Version"]}),children:[Object(m.jsx)(Dn,{children:o?"You are running the latest version of Bee.":Object(m.jsxs)(m.Fragment,{children:["Your Bee version is out of date. Please update to the"," ",Object(m.jsx)("a",{href:i,rel:"noreferrer",target:"_blank",children:"latest"})," ","before continuing. Rerun the installation script below to upgrade. For more information please see the"," ",Object(m.jsx)("a",{href:"https://docs.ethswarm.org/docs/installation/manual#upgrading-bee",rel:"noreferrer",target:"_blank",children:"Docs"}),".",Object(m.jsx)(Ka,{showLineNumbers:!0,linux:"bee version\nwget https://github.com/ethersphere/bee/releases/download/".concat(c,"/bee_").concat(c,"_amd64.deb\nsudo dpkg -i bee_").concat(c,"_amd64.deb"),mac:"bee version\nbrew tap ethersphere/tap\nbrew install swarm-bee\nbrew services start swarm-bee"})]})}),Object(m.jsx)(X,{label:"Your Version",value:r||"-"}),Object(m.jsx)(X,{label:"Latest Version",value:c||"-"})]})}function er(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.nodeAddresses,c=t.blockchainConnection;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:c,isLoading:n})," Connection to Blockchain"]}),children:[Object(m.jsx)(Dn,{children:c?"Your node is connected to the xDai blockchain":Object(m.jsxs)(m.Fragment,{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(m.jsx)("a",{href:"https://www.xdaichain.com/",rel:"noreferrer",target:"_blank",children:"your own xDai node"}),", or use a provider instead - we recommend"," ",Object(m.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(m.jsx)("strong",{children:"swap-endpoint"})," in your configuration file."]})}),(null===r||void 0===r?void 0:r.ethereum)&&Object(m.jsx)(ce,{label:"Ethereum Address",value:null===r||void 0===r?void 0:r.ethereum})]})}var tr=function(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.chequebookAddress,c=t.chequebook;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:c,isLoading:n})," Chequebook Deployment & Funding"]}),children:[Object(m.jsx)(Dn,{children:c?"Your chequebook is deployed and funded":Object(m.jsxs)(m.Fragment,{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 (e.g. ",Object(m.jsx)("a",{href:"https://bzz.exchange/",children:"bzz.exchange"}),") and bridge it to the xDai network through the ",Object(m.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(m.jsx)("a",{href:"https://bridge.xdaichain.com/",children:"xDai Bridge"}),". See the"," ",Object(m.jsx)("a",{href:"https://www.xdaichain.com/#xdai-stable-chain",children:"official xDai website"})," for more information."]})}),r&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(ce,{label:"Chequebook Address",value:r.chequebookAddress}),Object(m.jsx)(Q,{children:Object(m.jsx)(nt,{})})]})]})};function nr(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.topology,c=t.topology;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:c,isLoading:n})," Connection to Peers"]}),children:[Object(m.jsx)(Dn,{children:c?"You are connected to other Bee nodes":"Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file."}),Object(m.jsx)(Aa,{topology:r})]})}function ar(){return Object(m.jsxs)("div",{children:[Object(m.jsx)(Xa,{}),Object(m.jsx)(Qa,{}),Object(m.jsx)(er,{}),Object(m.jsx)(tr,{}),Object(m.jsx)($a,{}),Object(m.jsx)(nr,{})]})}var rr=n(932),cr=n(933);function ir(e){return or.apply(this,arguments)}function or(){return(or=Object(De.a)(Ne.a.mark((function e(t){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("https://xbzz-faucet.apyos.dev/xbzz/".concat(t),{method:"POST"});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sr=n(946),lr=n(186),ur="https://rpc.gnosischain.com/";function dr(){return(dr=Object(De.a)(Ne.a.mark((function e(t){var n,a;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(ur,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",method:"eth_getBalance",params:[t,"latest"],id:1})});case 2:return n=e.sent,e.next=5,n.json();case 5:return a=e.sent,e.abrupt("return",a.result);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var br=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,type:"function"}],jr=new sr.a.JsonRpcProvider(ur);function hr(){return hr=Object(De.a)(Ne.a.mark((function e(t){var n,a,r,c=arguments;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:"0xdbf3ea6f5bee45c02255b2c26a16f300502f68da",a=new lr.a(n,br,jr),e.next=4,a.balanceOf(t);case 4:return r=e.sent,e.abrupt("return",r.toString());case 6:case"end":return e.stop()}}),e)}))),hr.apply(this,arguments)}var pr,Or={eth_getBalance:function(e){return dr.apply(this,arguments)},eth_getBalanceERC20:function(e){return hr.apply(this,arguments)}};function fr(){var e=Object(a.useContext)(Ve),t=e.nodeInfo,n=e.chequebookAddress,r=e.nodeAddresses,c=Object(l.b)().enqueueSnackbar,i=Object(a.useState)(null),o=Object(U.a)(i,2),s=o[0],u=o[1],d=Object(a.useState)(null),b=Object(U.a)(d,2),j=b[0],h=b[1],p=Object(a.useState)(!1),O=Object(U.a)(p,2),f=O[0],x=O[1],g=Object(a.useState)("https://rpc.gnosischain.com/"),v=Object(U.a)(g,2),y=v[0],w=v[1],k=parseInt(window.location.host.split(":")[1],10);function S(){return(S=Object(De.a)(Ne.a.mark((function e(){var t,n,a,r;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.prev=1,e.next=4,fetch("http://localhost:".concat(k,"/status")).then((function(e){return e.json()}));case 4:return t=e.sent,n=t.address,e.next=8,fetch("http://getxdai.co/".concat(n,"/0.1"),{method:"POST"});case 8:return e.next=10,Or.eth_getBalance(n);case 10:return a=e.sent,u(a),e.next=14,Or.eth_getBalance(n);case 14:r=e.sent,h(r),c("Wallet funded successfully",{variant:"success"});case 17:return e.prev=17,x(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[1,,17,20]])})))).apply(this,arguments)}function C(){return(C=Object(De.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===n||void 0===n?void 0:n.chequebookAddress)){e.next=5;break}return x(!0),e.next=4,ir(null===n||void 0===n?void 0:n.chequebookAddress).finally((function(){return x(!1)}));case 4:c("Successfully funded chequebook address",{variant:"success"});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(){return(A=Object(De.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===r||void 0===r?void 0:r.ethereum)){e.next=5;break}return x(!0),e.next=4,ir(null===r||void 0===r?void 0:r.ethereum).finally((function(){return x(!1)}));case 4:c("Successfully funded overlay address",{variant:"success"});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(){return(P=Object(De.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.prev=1,e.next=4,fetch("http://localhost:".concat(k,"/config"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({"chain-enable":!0,"swap-enable":!0,"swap-endpoint":y})});case 4:return e.next=6,fetch("http://localhost:".concat(k,"/restart"),{method:"POST"});case 6:c("Restarting Bee in Light Mode...",{variant:"success"});case 7:return e.prev=7,x(!1),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[1,,7,10]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){fetch("http://localhost:".concat(k,"/status")).then((function(e){return e.json()})).then((function(e){return Or.eth_getBalance(e.address)})).then((function(e){return u(e)})),fetch("http://localhost:".concat(k,"/status")).then((function(e){return e.json()})).then((function(e){return Or.eth_getBalanceERC20(e.address)})).then((function(e){return h(e)}))}),[k]),t?Object(m.jsxs)("div",{children:[Object(m.jsx)(Ht,{children:"Upgrade"}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(rr.a,{variant:"outlined",children:Object(m.jsxs)(rt.a,{p:2,children:[Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(H.a,{variant:"h1",children:"Wallet"})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsxs)(H.a,{children:["Your current balance is ",new We.a(s||"0",18).toSignificantDigits(4)," xDAI and"," ",new We.a(j||"0",16).toSignificantDigits(4)," xBZZ. Fund your node with xDAI so chequebook can be deployed."]})}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:function(){return S.apply(this,arguments)},iconType:cr.a,loading:f,disabled:f,variant:"outlined",children:"Fund xDAI"}),(null===n||void 0===n?void 0:n.chequebookAddress)&&"0x0000000000000000000000000000000000000000"!==(null===n||void 0===n?void 0:n.chequebookAddress)&&Object(m.jsx)(st,{onClick:function(){return C.apply(this,arguments)},iconType:cr.a,loading:f,disabled:f,variant:"outlined",children:"Fund xBZZ (Chequebook)"}),Object(m.jsx)(st,{onClick:function(){return A.apply(this,arguments)},iconType:cr.a,loading:f,disabled:f,variant:"outlined",children:"Fund xBZZ (Overlay)"})]})]})})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(rr.a,{variant:"outlined",children:Object(m.jsxs)(rt.a,{p:2,children:[Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(H.a,{variant:"h1",children:"RPC Provider"})}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(Dt,{label:"RPC Provider",name:"rpc-provider",defaultValue:"https://rpc.gnosischain.com/",onChange:function(e){w(e.target.value)}})})]})})}),Object(m.jsx)(rr.a,{variant:"outlined",children:Object(m.jsxs)(rt.a,{p:2,children:[Object(m.jsx)(H.a,{variant:"h1",children:"Upgrade Node"}),!s&&Object(m.jsx)(rt.a,{mt:2,children:Object(m.jsx)(H.a,{children:"Fund your node to unlock upgrading."})}),Object(m.jsx)(rt.a,{mt:4,children:Object(m.jsx)(st,{onClick:function(){return P.apply(this,arguments)},iconType:E.a,loading:f,disabled:f||!s,variant:"outlined",children:"Switch to Light Mode"})})]})})]}):Object(m.jsx)(Jn,{})}!function(e){e.INFO="/",e.UPGRADE="/upgrade",e.FILES="/files",e.UPLOAD="/files/upload",e.UPLOAD_IN_PROGRESS="/files/upload/workflow",e.DOWNLOAD="/files/download",e.HASH="/files/hash/:hash",e.ACCOUNTING="/accounting",e.SETTINGS="/settings",e.STAMPS="/stamps",e.STAMPS_NEW="/stamps/new",e.STATUS="/status",e.FEEDS="/feeds",e.FEEDS_NEW="/feeds/new",e.FEEDS_UPDATE="/feeds/update/:hash",e.FEEDS_PAGE="/feeds/:uuid"}(pr||(pr={}));var xr=function(){return Object(m.jsxs)(R.c,{children:[Object(m.jsx)(R.a,{path:pr.UPLOAD_IN_PROGRESS,element:Object(m.jsx)(ga,{})}),Object(m.jsx)(R.a,{path:pr.UPLOAD,element:Object(m.jsx)(va,{})}),Object(m.jsx)(R.a,{path:pr.DOWNLOAD,element:Object(m.jsx)(Zn,{})}),Object(m.jsx)(R.a,{path:pr.UPGRADE,element:Object(m.jsx)(fr,{})}),Object(m.jsx)(R.a,{path:pr.HASH,element:Object(m.jsx)(la,{})}),Object(m.jsx)(R.a,{path:pr.ACCOUNTING,element:Object(m.jsx)(at,{})}),Object(m.jsx)(R.a,{path:pr.SETTINGS,element:Object(m.jsx)(Pa,{})}),Object(m.jsx)(R.a,{path:pr.STAMPS,element:Object(m.jsx)(Ia,{})}),Object(m.jsx)(R.a,{path:pr.STAMPS_NEW,element:Object(m.jsx)(_a,{})}),Object(m.jsx)(R.a,{path:pr.STATUS,element:Object(m.jsx)(ar,{})}),Object(m.jsx)(R.a,{path:pr.FEEDS,element:Object(m.jsx)(Lt,{})}),Object(m.jsx)(R.a,{path:pr.FEEDS_NEW,element:Object(m.jsx)(Zt,{})}),Object(m.jsx)(R.a,{path:pr.FEEDS_UPDATE,element:Object(m.jsx)(An,{})}),Object(m.jsx)(R.a,{path:pr.FEEDS_PAGE,element:Object(m.jsx)(gn,{})}),Object(m.jsx)(R.a,{path:pr.INFO,element:Object(m.jsx)(Ea,{})})]})},mr=n(11),gr=n(935),vr=Object(mr.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"}}}}}))(F.a),yr=Object(j.a)((function(e){return Object(h.a)({icon:{color:"inherit"},activeIcon:{color:e.palette.primary.main}})}));function wr(e){var t=e.iconStart,n=e.iconEnd,a=e.path,r=e.label,c=yr(),i=Object(R.f)(),o=Boolean(a&&Object(R.d)(i.pathname,a));return Object(m.jsxs)(vr,{button:!0,selected:o,disableRipple:!0,children:[Object(m.jsx)(gr.a,{className:o?c.activeIcon:c.icon,children:t}),Object(m.jsx)(W.a,{primary:r}),Object(m.jsx)(gr.a,{className:o?c.activeIcon:c.icon,children:n})]})}var kr=n(936),Sr=Object(j.a)((function(e){return Object(h.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",color:"white","@media (hover: none)":{backgroundColor:"#2c2c2c",color:"white"}}},smallerText:{fontSize:"0.9rem"}})}));function Cr(e){var t=e.path,n=Object(a.useContext)(Ve),r=n.status,c=n.isLoading,i=Sr(),o=Object(R.f)(),s=Boolean(t&&Object(R.d)(o.pathname,t));return Object(m.jsxs)(F.a,{button:!0,classes:{root:"".concat(i.root," ").concat(r.all?"":i.rootError),button:i.button},selected:s,disableRipple:!0,children:[Object(m.jsx)(gr.a,{style:{marginLeft:"30px"},children:Object(m.jsx)(Ja,{isOk:r.all,isLoading:c})}),Object(m.jsx)(W.a,{primary:Object(m.jsx)(H.a,{className:i.smallerText,children:"Node ".concat(r.all?"OK":"Error")})}),Object(m.jsx)(gr.a,{className:i.icon,children:r.all?null:Object(m.jsx)(kr.a,{className:i.iconSmall})})]})}var Ar=[{label:"Info",path:pr.INFO,icon:A.a},{label:"Upgrade",path:pr.UPGRADE,icon:E.a},{label:"Files",path:pr.UPLOAD,icon:P.a},{label:"Feeds",path:pr.FEEDS,icon:T.a},{label:"Stamps",path:pr.STAMPS,icon:B.a},{label:"Accounting",path:pr.ACCOUNTING,icon:N.a},{label:"Settings",path:pr.SETTINGS,icon:D.a}],Er=Object(j.a)((function(e){return Object(h.a)({root:{flexWrap:"nowrap",minHeight:"100vh",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)},drawer:{width:300,flexShrink:0},drawerPaper:{width:300,backgroundColor:"#212121"},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 Pr(){var e=Er();return Object(m.jsx)(v.a,{className:e.drawer,variant:"permanent",anchor:"left",classes:{paper:e.drawerPaper},children:Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"space-between",className:e.root,children:[Object(m.jsx)(y.a,{className:e.logo,children:Object(m.jsx)(u.b,{to:pr.INFO,children:Object(m.jsx)("img",{alt:"swarm",src:_})})}),Object(m.jsxs)(y.a,{children:[Object(m.jsx)(w.a,{children:Ar.map((function(t){return Object(m.jsx)(u.b,{to:t.path,className:e.link,children:Object(m.jsx)(wr,{iconStart:Object(m.jsx)(t.icon,{className:e.icon}),path:t.path,label:t.label},t.path)},t.path)}))}),Object(m.jsx)(k.a,{className:e.divider}),Object(m.jsx)(w.a,{children:Object(m.jsx)(S.a,{href:L.a.BEE_DOCS_HOST,target:"_blank",className:e.link,children:Object(m.jsx)(wr,{iconStart:Object(m.jsx)(I.a,{className:e.icon}),iconEnd:Object(m.jsx)(C.a,{className:e.iconSmall}),label:Object(m.jsx)("span",{children:"Docs"})})})})]}),Object(m.jsx)(y.a,{children:Object(m.jsx)(u.b,{to:pr.STATUS,className:e.link,children:Object(m.jsx)(Cr,{path:pr.STATUS})})})]})})}var Tr,Br=Object(j.a)((function(e){return Object(h.a)({content:{backgroundColor:e.palette.background.default,minHeight:"100vh"}})})),Nr=function(e){var t=Br(),n=Object(a.useContext)(Ve).isLoading;return Object(m.jsxs)("div",{style:{display:"flex"},children:[Object(m.jsx)(Pr,{}),Object(m.jsx)(d.a,{className:t.content,children:Object(m.jsx)(g,{children:Object(m.jsx)(m.Fragment,{children:n?Object(m.jsx)("div",{style:{textAlign:"center",width:"100%"},children:Object(m.jsx)(b.a,{})}):e.children})})})]})},Dr=n(378),Ir=n(201),_r=Object(Dr.a)({palette:{type:"light",background:{default:"#efefef"},primary:{light:"#fcf2e8",main:"#dd7700",dark:Ir.a[800]},secondary:{main:"#333333"}},typography:{fontFamily:["Work Sans","Montserrat","Nunito","Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(","),h1:{fontSize:"1.3rem",fontWeight:500},h2:{fontSize:"1rem",fontWeight:500},h3:{fontSize:"0.8rem",fontWeight:500},body2:{fontFamily:'"IBM Plex Mono", monospace',fontWeight:500,fontSize:"1rem"}}});_r.overrides={MuiListItem:{button:{"&:hover":{backgroundColor:"#fcf2e8",color:(Tr=_r).palette.primary.main,"@media (hover: none)":{backgroundColor:"#fcf2e8",color:Tr.palette.primary.main}}}},MuiContainer:{root:{padding:Tr.spacing(8)},maxWidthXs:{padding:Tr.spacing(8)},maxWidthSm:{padding:Tr.spacing(8)},maxWidthMd:{padding:Tr.spacing(8)},maxWidthLg:{padding:Tr.spacing(8)},maxWidthXl:{padding:Tr.spacing(8)}},MuiButton:{startIcon:{marginLeft:Tr.spacing(1)},endIcon:{marginRight:Tr.spacing(1)},outlined:{border:"none",borderRadius:Tr.spacing(10),color:Tr.palette.primary.main,backgroundColor:"#fcf2e8"},outlinedSizeSmall:{padding:Tr.spacing(1),paddingLeft:Tr.spacing(2),paddingRight:Tr.spacing(2),boxShadow:"none","&:hover":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none"}}},outlinedSizeLarge:{padding:Tr.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeLarge:{padding:Tr.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeSmall:{padding:Tr.spacing(1),paddingLeft:Tr.spacing(2),paddingRight:Tr.spacing(2),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none"}}},contained:{padding:Tr.spacing(2),backgroundColor:"white",boxShadow:"none",borderRadius:0,"&:hover":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Tr.palette.primary.main,color:"white",boxShadow:"none"}},"&:focus":{backgroundColor:Tr.palette.primary.main,color:"white"},"&:active":{backgroundColor:Tr.palette.primary.main,color:"white"},"&:disabled":{backgroundColor:"white"}}},MuiTab:{root:{backgroundColor:Tr.palette.background.paper,"&:hover":{backgroundColor:"#fcf2e8",color:Tr.palette.primary.main,opacity:1},"&$selected":{fontWeight:Tr.typography.fontWeightMedium}},textColorInherit:{opacity:.5}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:"transparent"}}},_r.props={MuiTab:{disableRipple:!0},MuiButtonBase:{disableRipple:!0}};var Lr=function(e){var t=e.beeApiUrl,n=e.beeDebugApiUrl,a=e.lockedApiSettings;return Object(m.jsx)("div",{className:"App",children:Object(m.jsx)(s.a,{theme:_r,children:Object(m.jsx)(Oe,{beeApiUrl:t,beeDebugApiUrl:n,lockedApiSettings:a,children:Object(m.jsx)(ze,{children:Object(m.jsx)(Sn,{children:Object(m.jsx)(fn,{children:Object(m.jsx)(dt,{children:Object(m.jsx)(Ga,{children:Object(m.jsx)(l.a,{children:Object(m.jsx)(u.a,{children:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(o.a,{}),Object(m.jsx)(Nr,{children:Object(m.jsx)(xr,{})})]})})})})})})})})})})})},Rr=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,953)).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(m.jsx)(r.a.StrictMode,{children:Object(m.jsx)(Lr,{})}),document.getElementById("root")),Rr()}},[[829,1,2]]]); -//# sourceMappingURL=main.16628c3e.chunk.js.map \ No newline at end of file diff --git a/static/dashboard/static/js/main.16628c3e.chunk.js.map b/static/dashboard/static/js/main.16628c3e.chunk.js.map deleted file mode 100644 index f06a1d8..0000000 --- a/static/dashboard/static/js/main.16628c3e.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["utils/index.ts","models/Token.ts","utils/identity.ts","config.ts","components/ErrorBoundary.tsx","assets/logo.svg","components/ExpandableList.tsx","components/ExpandableListItem.tsx","components/ExpandableListItemActions.tsx","components/ExpandableListItemKey.tsx","providers/Settings.tsx","components/ClipboardCopy.tsx","components/QRCodeModal.tsx","components/EthereumAddress.tsx","components/CashoutModal.tsx","pages/accounting/PeerBalances.tsx","components/TroubleshootConnectionCard.tsx","providers/Bee.tsx","hooks/apiHooks.tsx","hooks/accounting.ts","components/WithdrawDepositModal.tsx","containers/WithdrawModal.tsx","containers/DepositModal.tsx","pages/accounting/index.tsx","components/SwarmButton.tsx","providers/Feeds.tsx","components/SwarmDialog.tsx","components/CloseButton.tsx","components/TitleWithClose.tsx","pages/feeds/DeleteFeedDialog.tsx","components/Code.tsx","pages/feeds/ExportFeedDialog.tsx","components/SwarmTextInput.tsx","pages/feeds/ImportFeedDialog.tsx","pages/feeds/index.tsx","components/DocumentationText.tsx","components/HistoryHeader.tsx","components/SwarmSelect.tsx","pages/feeds/CreateNewFeed.tsx","components/ExpandableListItemLink.tsx","utils/file.ts","utils/image.ts","constants.ts","providers/File.tsx","pages/files/UploadArea.tsx","pages/feeds/FeedSubpage.tsx","providers/Stamps.tsx","pages/feeds/FeedPasswordDialog.tsx","pages/feeds/UpdateFeed.tsx","components/ExpandableListItemNote.tsx","components/ExpandableListItemInput.tsx","utils/local-storage.ts","utils/hash.ts","components/History.tsx","utils/date.ts","pages/files/FileNavigation.tsx","pages/files/Download.tsx","components/Loading.tsx","components/FitImage.tsx","components/StripedWrapper.tsx","pages/files/AssetIcon.tsx","pages/files/AssetPreview.tsx","pages/files/AssetSummary.tsx","pages/files/DownloadActionBar.tsx","pages/files/Share.tsx","components/ProgressIndicator.tsx","pages/stamps/PostageStampCreation.tsx","pages/stamps/PostageStampSelector.tsx","components/Capacity.tsx","pages/stamps/PostageStamp.tsx","pages/files/StampPreview.tsx","pages/files/UploadActionBar.tsx","pages/files/Upload.tsx","pages/files/UploadLander.tsx","utils/threshold.ts","components/TopologyStats.tsx","pages/info/index.tsx","pages/settings/index.tsx","components/ExpandableElement.tsx","pages/stamps/StampsTable.tsx","pages/stamps/index.tsx","pages/stamps/CreatePostageStampPage.tsx","components/TabsContainer.tsx","providers/Platform.tsx","components/CodeBlock.tsx","components/CodeBlockTabs.tsx","components/StatusIcon.tsx","pages/status/SetupSteps/DebugConnectionCheck.tsx","pages/status/SetupSteps/NodeConnectionCheck.tsx","pages/status/SetupSteps/VersionCheck.tsx","pages/status/SetupSteps/EthereumConnectionCheck.tsx","pages/status/SetupSteps/ChequebookDeployFund.tsx","pages/status/SetupSteps/PeerConnection.tsx","pages/status/index.tsx","utils/bzz-faucet.ts","utils/rpc.ts","routes.tsx","pages/upgrade/index.tsx","components/SideBarItem.tsx","components/SideBarStatus.tsx","components/SideBar.tsx","layout/Dashboard.tsx","theme.tsx","App.tsx","reportWebVitals.ts","index.tsx"],"names":["isInteger","value","BigNumber","isBigNumber","makeBigNumber","toString","TypeError","sleepMs","ms","a","Promise","resolve","setTimeout","unwrapPromiseSettlements","promiseSettledResults","promises","values","fulfilled","filter","promise","status","rejected","map","x","reason","String","makeRetriablePromise","fn","maxRetries","delayMs","reject","tries","results","extractSwarmHash","string","matches","match","uuidV4","replace","s","c","parseInt","crypto","getRandomValues","Uint8Array","formatEnum","charAt","toUpperCase","slice","toLowerCase","replaceAll","secondsToTimeString","seconds","unit","Math","round","toFixed","convertDepthToBytes","depth","convertAmountToSeconds","amount","pricePerBlock","calculateStampPrice","Token","BigInt","shortenText","text","length","separator","POSSIBLE_DECIMALS","decimals","includes","this","dividedBy","pow","digits","toDecimal","asString","indexOfSignificantDigit","reachedDecimalPoint","i","char","t","multipliedBy","generateWallet","buffer","Wallet","Buffer","from","persistIdentity","identities","identity","existingIndex","findIndex","uuid","splice","unshift","localStorage","setItem","JSON","stringify","persistIdentitiesWithoutUpdate","convertWalletToIdentity","type","name","password","Error","getPrivateKeyString","toV3String","identityString","address","getAddressString","importIdentity","data","getWallet","wallet","startsWith","parse","getWalletFromIdentity","fromPrivateKey","trimHexString","fromV3","updateFeed","beeApi","hash","stamp","feedHash","createFeedManifest","repeat","writer","makeFeedWriter","upload","getProcessEnv","key","process","config","BEE_API_HOST","BEE_DEBUG_API_HOST","BLOCKCHAIN_EXPLORER_URL","BEE_DOCS_HOST","BEE_DISCORD_HOST","GITHUB_REPO_URL","sessionStorage","getItem","ErrorBoundary","props","state","error","errorInfo","console","message","children","Component","useStyles","makeStyles","theme","createStyles","root","width","padding","margin","marginTop","spacing","rootLevel1","rootLevel2","header","backgroundColor","palette","background","paper","contentLevel0","contentLevel12","infoText","color","ExpandableList","label","level","defaultOpen","info","classes","useState","Boolean","open","setOpen","rootLevelClass","typographyVariant","contentLevelClass","className","ListItem","button","onClick","ListItemText","primary","Typography","variant","style","display","ExpandLess","ExpandMore","Collapse","in","timeout","unmountOnExit","marginBottom","wordBreak","copyValue","cursor","borderRadius","main","ExpandableListItem","tooltip","Grid","container","direction","justifyContent","alignItems","Tooltip","title","placement","arrow","IconButton","size","strokeWidth","wrapper","flexDirection","flexWrap","action","marginRight","ExpandableListItemActions","Array","isArray","borderLeft","headerOpen","content","keyMargin","ExpandableListItemKey","copied","setCopied","toggleOpen","tooltipClickHandler","tooltipCloseHandler","splitValues","nonPrefixLength","lengthWithoutPrefix","split","hasPrefix","test","spanText","onClose","component","initialValues","apiUrl","apiDebugUrl","beeDebugApi","setApiUrl","setDebugApiUrl","lockedApiSettings","Context","createContext","Consumer","Provider","beeApiUrl","beeDebugApiUrl","extLockedApiSettings","setBeeApi","setBeeDebugApi","url","debugUrl","useEffect","Bee","e","BeeDebug","ClipboardCopy","enqueueSnackbar","useSnackbar","marginLeft","height","QRCodeModal","FilterCenterFocusSharp","Dialog","textAlign","DialogTitle","id","bgColor","fgColor","includeMargin","renderAs","EthereumAddress","hideBlockie","paddingTop","truncate","maxWidth","overflow","textOverflow","whiteSpace","href","transaction","target","rel","CheckoutModal","peerId","uncashedAmount","loadingCashout","setLoadingCashout","useContext","SettingsContext","handleClose","Button","startIcon","substr","DialogContent","DialogContentText","overflowWrap","Container","CircularProgress","DialogActions","cashoutLastCheque","then","res","catch","finally","disabled","PeerBalances","accounting","isLoadingUncashed","totalUncashed","toFixedDecimal","peer","balance","received","sent","total","toBigNumber","isGreaterThan","icon","TroubleshootConnectionCard","item","align","Link","to","ROUTES","STATUS","startedInDevMode","window","location","search","all","version","blockchainConnection","debugApiConnection","apiConnection","topology","chequebook","latestPublishedVersion","undefined","latestUserVersion","latestUserVersionExact","isLatestBeeVersion","latestBeeVersionUrl","apiHealth","debugApiHealth","nodeAddresses","nodeInfo","chequebookAddress","peers","chequebookBalance","peerBalances","peerCheques","settlements","chainState","latestBeeRelease","isLoading","isRefreshing","lastUpdate","start","stop","refresh","getStatus","devMode","REACT_APP_DEV_MODE","beeMode","semver","satisfies","engines","bee","includePrerelease","ethereum","connected","totalBalance","Object","every","v","setApiHealth","setDebugApiHealth","setNodeAddresses","setNodeInfo","setNodeTopology","setChequebookAddress","setPeers","setChequebookBalance","setPeerBalances","setPeerCheques","setSettlements","setChainState","setLatestBeeRelease","isLoadingLatestBeeRelease","setLoading","setError","axios","get","useLatestBeeRelease","setIsLoading","setIsRefreshing","setLastUpdate","frequency","setFrequency","coerce","chequeBalanceWrapper","getChequebookBalance","availableBalance","peerBalanceWrapper","getAllBalances","balances","settlementsWrapper","getAllSettlements","totalReceived","totalSent","isConnected","getHealth","getNodeAddresses","getNodeInfo","getTopology","getPeers","getChequebookAddress","getLastCheques","getChainState","allSettled","Date","now","interval","setInterval","clearInterval","html_url","freq","useAccounting","setIsloadingUncashed","uncashedAmounts","setUncashedAmounts","gt","getLastCashoutAction","forEach","plus","minus","sort","b","diff","toNumber","mergeAccounting","WithdrawDepositModal","successMessage","errorMessage","dialogMessage","min","max","setAmount","amountToken","setAmountToken","amountError","setAmountError","handleAction","toBigInt","transactionHash","stopPropagation","Input","autoFocus","placeholder","fullWidth","onChange","fromDecimal","isLessThan","FormHelperText","WithdrawModal","withdrawTokens","DepositModal","depositTokens","Accounting","BeeContext","position","stroke","transition","cancelButton","spinnerWrapper","left","top","transform","SwarmButton","iconType","loading","cancel","React","createElement","join","event","currentTarget","blur","setIdentities","SwarmDialog","PaperProps","Box","p","sx","CloseButton","Close","fontWeight","TitleWithClose","DeleteFeedDialog","onConfirm","mb","Trash","X","pre","maxHeight","prettifyString","Code","prettify","ExportFeedDialog","Download","saveAs","Blob","Clipboard","navigator","clipboard","writeText","field","border","SwarmTextInput","optional","formik","defaultValue","TextField","required","InputProps","disableUnderline","textarea","displayNone","ImportFeedDialog","textareaValue","setTextareaValue","setName","fileInputRef","useRef","feed","onFeedReady","fileReader","FileReader","file","files","onload","result","readAsText","ref","TextareaAutosize","minRows","Upload","current","click","Check","Feeds","IdentityContext","navigate","useNavigate","selectedIdentity","setSelectedIdentity","showImport","setShowImport","showExport","setShowExport","showDelete","setShowDelete","onDialogClose","updatedFeeds","onDelete","PlusSquare","FEEDS_NEW","mt","FEEDS_PAGE","Info","fontSize","DocumentationText","pressable","HistoryHeader","mr","ArrowBack","select","option","SwarmSelect","options","Select","MenuProps","MenuListProps","disablePadding","square","MenuItem","identityName","CreateNewFeed","FeedsContext","getAllPostageBatch","stamps","FEEDS","onSubmit","submitForm","bgcolor","openLinkIcon","ExpandableListItemLink","link","navigationType","allowClipboard","displayValue","onNavigation","OpenInNewSharp","ArrowForward","indexHtmls","detectIndexHtml","paths","getPath","exactMatch","find","indexPath","prefix","y","commonPrefix","getHumanReadableFileSize","bytes","getAssetNameFromFiles","f","path","webkitRelativePath","packageFile","fullPath","lastModified","stream","arrayBuffer","resize","reader","readAsDataURL","src","img","Image","dimensions","imgWidth","imgHeight","ratioWidth","ratioHeight","ratio","getDimensions","elem","document","ctx","getContext","drawImage","canvas","toBlob","blob","onerror","META_FILE_NAME","PREVIEW_FILE_NAME","PREVIEW_DIMENSIONS","defaultUploadOrigin","origin","setFiles","uploadOrigin","setUploadOrigin","metadata","setMetadata","previewUri","setPreviewUri","previewBlob","setPreviewBlob","reduce","isWebsite","count","getMetadata","URL","revokeObjectURL","createObjectURL","areaWrapper","dropzone","default","outline","zIndex","opacity","buttonWrapper","UploadArea","showHelp","strictWebsiteMode","setStrictWebsiteMode","setVersion","getDropzoneInputDomElement","querySelector","onUploadCollectionClick","element","setAttribute","dropzoneClass","FilePaths","indexDocument","UPLOAD_IN_PROGRESS","filesLimit","maxFileSize","showPreviews","removeAttribute","FilePlus","FolderPlus","PlusCircle","FeedSubpage","useParams","available","setAvailable","downloadData","swarmCid","enrichStamp","postageBatch","bucketDepth","usage","utilization","usageText","ceil","setStamps","FeedPasswordDialog","feedName","onProceed","onCancel","setPassword","UpdateFeed","StampContext","selectedStamp","setSelectedStamp","showPasswordPrompt","setShowPasswordPrompt","onFeedUpdate","Reflect","batchID","batchId","Bookmark","typography","ExpandableListItemNote","HISTORY_KEYS","unselectableLabel","userSelect","WebkitUserSelect","MozUserSelect","msUserSelect","confirmLabel","confirmLabelDisabled","expandedOnly","helperText","mapperFn","locked","inputValue","setInputValue","InputBase","hidden","Search","shortenHash","sliceLength","putHistory","history","getHistorySafe","createdAt","items","parsed","isHistoryItem","determineHistoryName","History","localStorageKey","setItems","date","trim","flexGrow","leftTab","rightTab","FileNavigation","active","Tabs","newValue","DOWNLOAD","UPLOAD","Tab","referenceError","setReferenceError","identifier","manifestJs","ManifestJs","resolveFeedManifest","feedIdentifier","isManifest","getIndexDocumentPath","DOWNLOAD_HISTORY","HASH","onSwarmIdentifier","Utils","isHexString","recognizeSwarmHash","Loading","image","objectFit","FitImage","inlineStyles","alt","StripedWrapper","AssetIcon","AssetPreview","previewComponent","Web","AssetSummary","DownloadActionBar","onOpen","onDownload","onUpdateFeed","hasIndexDocument","Share","reference","downloading","setDownloading","swarmEntries","setSwarmEntries","setIndexDocument","notFound","setNotFound","preview","setPreview","getHashes","entries","previewFile","keys","downloadFile","mtdt","remoteMetadata","zip","JSZip","generateAsync","prepare","FEEDS_UPDATE","flex","todo","inProgress","done","ProgressIndicator","steps","index","pickClass","initialFormValues","PostageStampCreation","onFinished","StampsContext","getTtl","isCurrentPriceAvailable","currentPrice","Number","getPrice","isNaN","price","toSignificantDigits","actions","createPostageBatch","resetForm","setSubmitting","validate","errors","isLessThanOrEqualTo","isValid","isSubmitting","PostageStampSelector","onSelect","stampId","Capacity","integerUsage","used","free","PostageStamp","shorten","StampPreview","UploadActionBar","step","onUpload","onGoBack","isUploading","hasStamp","uploadLabel","stampMode","setStampMode","Layers","ArrowLeft","setStep","setStamp","setUploading","FileContext","uploadFiles","fls","idx","substrStart","mtd","metafile","File","push","UPLOAD_HISTORY","UploadLander","OPTIMAL_POPULATION","GENERIC_ERROR","THRESHOLDS","connectedPeers","minimumValue","explanation","score","population","toLocaleString","pickThreshold","thresholds","maximumScore","last","TopologyStats","maximumTotalScore","sum","actualTotalScore","percentageText","Status","publicKey","pssPublicKey","overlay","underlay","addr","Settings","ExpandableElement","expandable","StampsTable","postageStamps","Stamp","STAMPS_NEW","CreatePostageStampPage","STAMPS","TabPanel","other","role","SimpleTabs","indexChanged","setValue","Platforms","SupportedPlatforms","CodeBlock","language","showLineNumbers","code","macOS","Linux","platform","setPlatform","os","userAgent","iOS","Windows","Android","getOS","isSupportedPlatform","CodeBlockTabs","linux","mac","StatusIcon","isOk","NodeConnectionCheck","elevation","severity","VersionCheck","EthereumConnectionCheck","ChequebookDeployFund","PeerConnection","NodeSetupWorkflow","requestBzz","fetch","method","PROVIDER","headers","body","jsonrpc","params","response","json","partialERC20tokenABI","constant","inputs","outputs","payable","provider","providers","JsonRpcProvider","tokenAddress","contract","Contract","balanceOf","Rpc","eth_getBalance","eth_getBalanceERC20","UpgradePage","setBalance","balanceBzz","setBalanceBzz","rpcProvider","setRpcProvider","port","host","Card","Send","ArrowUp","BaseRouter","UPGRADE","ACCOUNTING","SETTINGS","INFO","StyledListItem","withStyles","paddingLeft","paddingRight","activeIcon","SideBarItem","iconStart","iconEnd","useLocation","isSelected","matchPath","pathname","selected","disableRipple","ListItemIcon","iconSmall","rootError","smallerText","navBarItems","Home","FileText","DollarSign","minHeight","paddingBottom","drawer","flexShrink","drawerPaper","logo","divider","textDecoration","SideBar","Drawer","anchor","Logo","List","Divider","Dashboard","createTheme","light","dark","orange","secondary","fontFamily","h1","h2","h3","body2","overrides","MuiListItem","MuiContainer","maxWidthXs","maxWidthSm","maxWidthMd","maxWidthLg","maxWidthXl","MuiButton","endIcon","outlined","outlinedSizeSmall","boxShadow","outlinedSizeLarge","containedSizeLarge","containedSizeSmall","contained","MuiTab","fontWeightMedium","textColorInherit","MuiTabs","borderBottom","indicator","MuiButtonBase","App","ThemeProvider","CssBaseline","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"srBAUO,SAASA,EAAUC,GACxB,OAAQC,YAAUC,YAAYF,IAAUA,EAAMD,aAAiC,kBAAVC,EAYhE,SAASG,EAAcH,GAC5B,GAAIC,YAAUC,YAAYF,GAAQ,OAAOA,EAEzC,GAAqB,kBAAVA,EAAoB,OAAO,IAAIC,YAAUD,GAEpD,GAAqB,kBAAVA,EAAoB,OAAO,IAAIC,YAAUD,EAAMI,YAG1D,GAAqB,kBAAVJ,EAAwD,OAAO,IAAIC,YAAUD,GAExF,MAAM,IAAIK,UAAJ,uEAA8EL,EAA9E,mBAA8FA,IAa/F,SAAeM,EAAtB,kC,4CAAO,WAAuBC,GAAvB,SAAAC,EAAA,sEACC,IAAIC,SAAc,SAAAC,GAAO,OAC7BC,YAAW,WACTD,MACCH,MAJA,4C,sBA4BA,SAASK,EACdC,GAEA,IAjBuCC,EAiBjCC,EAbC,CAAEC,WAJ8BF,EAiBFD,GAhBVI,QAAO,SAAAC,GAAO,MAAuB,cAAnBA,EAAQC,UAGjCC,SAFHN,EAASG,QAAO,SAAAC,GAAO,MAAuB,aAAnBA,EAAQC,WAmBpD,MAAO,CAAEH,UAHSD,EAAOC,UAAUK,KAAI,SAAAC,GAAC,OAAIA,EAAEtB,SAG1BoB,SAFHL,EAAOK,SAASC,KAAI,SAAAC,GAAC,OAAKA,EAAEC,OAASC,OAAOF,EAAEC,QAAU,oBAYpE,SAASE,EAAwBC,GAAmE,IAA7CC,EAA4C,uDAA/B,EAAGC,EAA4B,uDAAlB,IACtF,OAAO,IAAInB,QAAJ,uCAAY,WAAOC,EAASmB,GAAhB,iBAAArB,EA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aAAuBC,UACxC,8BAAqBvwB,MAAK,YAAkD,IAA/CwwB,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCHdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,GAAD,MAEF5b,SAAS6b,eAAe,SAM1BX,O","file":"static/js/main.16628c3e.chunk.js","sourcesContent":["import { BigNumber } from 'bignumber.js'\nimport { Token } from '../models/Token'\n\n/**\n * Test if value is an integer\n *\n * @param value Value to be tested if it is an integer\n *\n * @returns True if the passed in value is integer\n */\nexport function isInteger(value: unknown): value is BigNumber | bigint {\n return (BigNumber.isBigNumber(value) && value.isInteger()) || typeof value === 'bigint'\n}\n\n/**\n *Convert value into a BigNumber if not already\n *\n * @param value Value to be converted\n *\n * @throws {TypeError} if the value is not convertible to a BigNumber\n *\n * @returns BigNumber - but it may still be NaN or Infinite\n */\nexport function makeBigNumber(value: BigNumber | BigInt | number | string): BigNumber | never {\n if (BigNumber.isBigNumber(value)) return value\n\n if (typeof value === 'string') return new BigNumber(value)\n\n if (typeof value === 'bigint') return new BigNumber(value.toString())\n\n // FIXME: bee-js still returns some values as numbers and even outside of SAFE INTEGER bounds\n if (typeof value === 'number' /* && Number.isSafeInteger(value)*/) return new BigNumber(value)\n\n throw new TypeError(`Not a BigNumber or BigNumber convertible value. Type: ${typeof value} value: ${value}`)\n}\n\nexport type PromiseSettlements = {\n fulfilled: PromiseFulfilledResult[]\n rejected: PromiseRejectedResult[]\n}\n\nexport type UnwrappedPromiseSettlements = {\n fulfilled: T[]\n rejected: string[]\n}\n\nexport async function sleepMs(ms: number): Promise {\n await new Promise(resolve =>\n setTimeout(() => {\n resolve()\n }, ms),\n )\n}\n\n/**\n * Maps the returned results of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * The results still need to be unwrapped to get the fulfilled values or rejection reasons.\n */\nexport function mapPromiseSettlements(promises: PromiseSettledResult[]): PromiseSettlements {\n const fulfilled = promises.filter(promise => promise.status === 'fulfilled') as PromiseFulfilledResult[]\n const rejected = promises.filter(promise => promise.status === 'rejected') as PromiseRejectedResult[]\n\n return { fulfilled, rejected }\n}\n\n/**\n * Maps the returned values of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * For rejected promises, the value is the stringified `reason`,\n * or `'Unknown error'` string when it is unavailable.\n */\nexport function unwrapPromiseSettlements(\n promiseSettledResults: PromiseSettledResult[],\n): UnwrappedPromiseSettlements {\n const values = mapPromiseSettlements(promiseSettledResults)\n const fulfilled = values.fulfilled.map(x => x.value)\n const rejected = values.rejected.map(x => (x.reason ? String(x.reason) : 'Unknown error'))\n\n return { fulfilled, rejected }\n}\n\n/**\n * Wraps a `Promise` or async function inside a new `Promise`,\n * which retries the original function up to `maxRetries` times,\n * waiting `delayMs` milliseconds between failed attempts.\n *\n * If all attempts fail, then this `Promise` also rejects.\n */\nexport function makeRetriablePromise(fn: () => Promise, maxRetries = 3, delayMs = 1000): Promise {\n return new Promise(async (resolve, reject) => {\n for (let tries = 0; tries < maxRetries; tries++) {\n try {\n const results = await fn()\n resolve(results)\n\n return\n } catch (error) {\n if (tries < maxRetries - 1) {\n await sleepMs(delayMs)\n } else {\n reject(error)\n }\n }\n }\n })\n}\n\nexport function extractSwarmHash(string: string): string | null {\n const matches = string.match(/[a-fA-F0-9]{64,128}/)\n\n return (matches && matches[0]) || null\n}\n\nexport function uuidV4(): string {\n const pattern = '10000000-1000-4000-8000-100000000000'\n\n return pattern.replace(/[018]/g, (s: string) => {\n const c = parseInt(s, 10)\n\n return (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n })\n}\n\nexport function formatEnum(string: string): string {\n return (string.charAt(0).toUpperCase() + string.slice(1).toLowerCase()).replaceAll('_', ' ')\n}\n\nexport function secondsToTimeString(seconds: number): string {\n let unit = seconds\n\n if (unit < 120) {\n return `${seconds} seconds`\n }\n unit /= 60\n\n if (unit < 120) {\n return `${Math.round(unit)} minutes`\n }\n unit /= 60\n\n if (unit < 48) {\n return `${Math.round(unit)} hours`\n }\n unit /= 24\n\n if (unit < 14) {\n return `${Math.round(unit)} days`\n }\n unit /= 7\n\n if (unit < 52) {\n return `${Math.round(unit)} weeks`\n }\n unit /= 52\n\n return `${unit.toFixed(1)} years`\n}\n\nexport function convertDepthToBytes(depth: number): number {\n return 2 ** depth * 4096\n}\n\nexport function convertAmountToSeconds(amount: number, pricePerBlock: number): number {\n // TODO: blocktime should come directly from the blockchain as it may differ between different networks\n const blockTime = 5 // On mainnet there is 5 seconds between blocks\n\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return (amount * blockTime) / pricePerBlock\n}\n\nexport function calculateStampPrice(depth: number, amount: bigint): Token {\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return new Token(amount * BigInt(2 ** depth)) // FIXME: the 2 ** depth should be performed on bigint already\n}\n\nexport function shortenText(text: string, length = 20, separator = '[…]'): string {\n if (text.length <= length * 2 + separator.length) {\n return text\n }\n\n return `${text.slice(0, length)}${separator}${text.slice(-length)}`\n}\n","import { BigNumber } from 'bignumber.js'\nimport { isInteger, makeBigNumber } from '../utils'\n\nconst POSSIBLE_DECIMALS = [18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\ntype digits = typeof POSSIBLE_DECIMALS[number]\n\nconst BZZ_DECIMALS = 16\n\nexport class Token {\n private amount: BigNumber // Represented in the base units, so it is always an integer value\n private readonly decimals: digits\n\n constructor(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS) {\n const a = makeBigNumber(amount)\n\n if (!isInteger(a) || !POSSIBLE_DECIMALS.includes(decimals)) throw new TypeError('Not a valid token values')\n\n this.amount = a\n this.decimals = decimals\n }\n\n /**\n * Construct new Token from a digit representation\n *\n * @param amount Amount of a token in the digits (1 token = 10^decimals)\n * @param decimals Number of decimals for the token (must be integer)\n *\n * @throws {TypeError} If the decimals is not an integer or the amount after conversion is not an integer\n *\n * @returns new Token\n */\n static fromDecimal(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS): Token | never {\n const a = makeBigNumber(amount)\n\n // No need to do any validation here, it is done when the new token is created\n const t = a.multipliedBy(new BigNumber(10).pow(decimals))\n\n return new Token(t, decimals)\n }\n\n get toBigInt(): BigInt {\n return BigInt(this.amount.toFixed(0))\n }\n\n get toString(): string {\n return this.amount.toFixed(0)\n }\n\n get toBigNumber(): BigNumber {\n return new BigNumber(this.amount)\n }\n\n get toDecimal(): BigNumber {\n return this.amount.dividedBy(new BigNumber(10).pow(this.decimals))\n }\n\n toFixedDecimal(digits = 7): string {\n return this.toDecimal.toFixed(digits)\n }\n\n toSignificantDigits(digits = 4): string {\n const asString = this.toDecimal.toFixed(16)\n\n let indexOfSignificantDigit = -1\n let reachedDecimalPoint = false\n\n for (let i = 0; i < asString.length; i++) {\n const char = asString[i]\n\n if (char === '.') {\n reachedDecimalPoint = true\n indexOfSignificantDigit = i + 1\n } else if (reachedDecimalPoint && char !== '0') {\n indexOfSignificantDigit = i\n break\n }\n }\n\n return asString.slice(0, indexOfSignificantDigit + digits)\n }\n}\n","import { Bee, Reference } from '@ethersphere/bee-js'\nimport Wallet from 'ethereumjs-wallet'\nimport { uuidV4 } from '.'\nimport { Identity, IdentityType } from '../providers/Feeds'\n\nexport function generateWallet(): Wallet {\n const buffer = new Uint8Array(32)\n crypto.getRandomValues(buffer)\n const wallet = new Wallet(Buffer.from(buffer))\n\n return wallet\n}\n\nexport function persistIdentity(identities: Identity[], identity: Identity): void {\n const existingIndex = identities.findIndex(x => x.uuid === identity.uuid)\n\n if (existingIndex !== -1) {\n identities.splice(existingIndex, 1)\n }\n identities.unshift(identity)\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport function persistIdentitiesWithoutUpdate(identities: Identity[]): void {\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport async function convertWalletToIdentity(\n identity: Wallet,\n type: IdentityType,\n name: string,\n password?: string,\n): Promise {\n if (type === 'V3' && !password) {\n throw Error('V3 passwords require password')\n }\n\n const identityString =\n type === 'PRIVATE_KEY' ? identity.getPrivateKeyString() : await identity.toV3String(password as string)\n\n return {\n uuid: uuidV4(),\n name,\n type: password ? 'V3' : 'PRIVATE_KEY',\n address: identity.getAddressString(),\n identity: identityString,\n }\n}\n\nexport async function importIdentity(name: string, data: string): Promise {\n if (data.length === 64) {\n const wallet = await getWallet('PRIVATE_KEY', data)\n\n return {\n uuid: uuidV4(),\n name,\n type: 'PRIVATE_KEY',\n identity: data,\n address: wallet.getAddressString(),\n }\n }\n\n if (data.length === 66 && data.toLowerCase().startsWith('0x')) {\n const wallet = await getWallet('PRIVATE_KEY', data.slice(2))\n\n return { uuid: uuidV4(), name, type: 'PRIVATE_KEY', identity: data, address: wallet.getAddressString() }\n }\n try {\n const { address } = JSON.parse(data)\n\n return { uuid: uuidV4(), name, type: 'V3', identity: data, address }\n } catch {\n return null\n }\n}\n\nfunction getWalletFromIdentity(identity: Identity, password?: string): Promise {\n return getWallet(identity.type, identity.identity, password)\n}\n\nasync function getWallet(type: IdentityType, data: string, password?: string): Promise {\n return type === 'PRIVATE_KEY'\n ? Wallet.fromPrivateKey(Buffer.from(trimHexString(data), 'hex'))\n : await Wallet.fromV3(data, password as string)\n}\n\nexport async function updateFeed(\n beeApi: Bee,\n identity: Identity,\n hash: string,\n stamp: string,\n password?: string,\n): Promise {\n const wallet = await getWalletFromIdentity(identity, password)\n\n if (!identity.feedHash) {\n identity.feedHash = await beeApi.createFeedManifest(stamp, 'sequence', '00'.repeat(32), wallet.getAddressString())\n }\n\n const writer = beeApi.makeFeedWriter('sequence', '00'.repeat(32), wallet.getPrivateKeyString())\n await writer.upload(stamp, hash as Reference)\n}\n\nfunction trimHexString(string: string): string {\n if (string.toLowerCase().startsWith('0x')) {\n return string.slice(2)\n }\n\n return string\n}\n","function getProcessEnv(key: string): string | undefined | false {\n return typeof process === 'object' && process.env[key]\n}\n\nclass Config {\n public readonly BEE_API_HOST: string\n public readonly BEE_DEBUG_API_HOST: string\n public readonly BLOCKCHAIN_EXPLORER_URL: string\n public readonly BEE_DOCS_HOST: string\n public readonly BEE_DISCORD_HOST: string\n public readonly GITHUB_REPO_URL: string\n\n constructor() {\n this.BEE_API_HOST =\n sessionStorage.getItem('api_host') || getProcessEnv('REACT_APP_BEE_HOST') || 'http://localhost:1633'\n this.BEE_DEBUG_API_HOST =\n sessionStorage.getItem('debug_api_host') || getProcessEnv('REACT_APP_BEE_DEBUG_HOST') || 'http://localhost:1635'\n this.BLOCKCHAIN_EXPLORER_URL =\n getProcessEnv('REACT_APP_BLOCKCHAIN_EXPLORER_URL') || 'https://blockscout.com/xdai/mainnet'\n this.BEE_DOCS_HOST = getProcessEnv('REACT_APP_BEE_DOCS_HOST') || 'https://docs.ethswarm.org/docs/'\n this.BEE_DISCORD_HOST = getProcessEnv('REACT_APP_BEE_DISCORD_HOST') || 'https://discord.gg/eKr9XPv7'\n this.GITHUB_REPO_URL =\n getProcessEnv('REACT_APP_BEE_GITHUB_REPO_URL') || 'https://api.github.com/repos/ethersphere/bee'\n }\n}\n\nexport const config = new Config()\n\nexport default config\n","import { Component, ErrorInfo, ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement\n}\n\ninterface State {\n error: Error | null\n}\n\nexport default class ErrorBoundary extends Component {\n constructor(props: Props) {\n super(props)\n this.state = { error: null }\n }\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n // Update state so the next render will show the fallback UI.\n return { error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // You can also log the error to an error reporting service\n console.error({ error, errorInfo }) // eslint-disable-line\n }\n\n render(): ReactElement {\n if (this.state.error) {\n // You can render any custom fallback UI\n return

Something went wrong. Error: {this.state.error.message}

\n }\n\n return this.props.children\n }\n}\n","export default __webpack_public_path__ + \"static/media/logo.3d1155fe.svg\";","import { ReactElement, ReactNode, useState } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Collapse, ListItem, ListItemText, Typography } from '@material-ui/core'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode\n label: ReactNode\n info?: ReactNode\n level?: 0 | 1 | 2\n defaultOpen?: boolean\n}\n\nexport default function ExpandableList({ children, label, level, defaultOpen, info }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n let rootLevelClass = ''\n let typographyVariant: 'h1' | 'h2' | 'h3' = 'h1'\n let contentLevelClass = classes.contentLevel0\n\n if (level === 1) {\n rootLevelClass = classes.rootLevel1\n typographyVariant = 'h2'\n contentLevelClass = classes.contentLevel12\n } else if (level === 2) {\n rootLevelClass = classes.rootLevel2\n typographyVariant = 'h3'\n contentLevelClass = classes.contentLevel12\n }\n\n return (\n
\n \n {label}} />\n
\n {!open && (\n \n {info}\n \n )}\n {open ? : }\n
\n
\n \n
{children}
\n
\n
\n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography, Grid, IconButton, Tooltip } from '@material-ui/core'\nimport { Info } from 'react-feather'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n wordBreak: 'break-word',\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label?: ReactNode\n value?: ReactNode\n tooltip?: string\n}\n\nexport default function ExpandableListItem({ label, value, tooltip }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {label && {label}}\n {value && (\n \n {value}\n {tooltip && (\n \n \n \n \n \n )}\n \n )}\n \n \n )\n}\n","import { Grid } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, ReactNode } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n action: {\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n children: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemActions({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n if (Array.isArray(children)) {\n return (\n
\n {children\n // Exclude falsy values to allow conditional rendering\n .filter(x => x)\n .map((a, i) => (\n
\n {a}\n
\n ))}\n
\n )\n }\n\n return (\n \n {children}\n \n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, useState } from 'react'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Eye, Minus } from 'react-feather'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n}\n\nconst lengthWithoutPrefix = (s: string) => s.replace(/^0x/i, '').length\n\nfunction isPrefixedHexString(s: unknown): boolean {\n return typeof s === 'string' && /^0x[0-9a-f]+$/i.test(s)\n}\n\nconst split = (s: string): string[] => {\n const nonPrefixLength = lengthWithoutPrefix(s)\n\n if (nonPrefixLength % 6 === 0) return s.match(/(0x|.{6})/gi) || []\n\n return s.match(/(0x|.{1,8})/gi) || []\n}\n\nexport default function ExpandableListItemKey({ label, value }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(false)\n const [copied, setCopied] = useState(false)\n const toggleOpen = () => setOpen(!open)\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const splitValues = split(value)\n const hasPrefix = isPrefixedHexString(value)\n const spanText = `${hasPrefix ? `${splitValues[0]} ${splitValues[1]}` : splitValues[0]}[…]${\n splitValues[splitValues.length - 1]\n }`\n\n return (\n \n \n \n {label && {label}}\n \n
\n {!open && (\n \n \n \n {value ? spanText : ''}\n \n \n \n )}\n \n {open ? : }\n \n
\n
\n
\n \n
\n \n \n {/* This has to be wrapped in two spans otherwise either the tooltip or the highlighting does not work*/}\n \n \n {splitValues.map((s, i) => (\n \n {s}\n \n ))}\n \n \n \n \n
\n
\n
\n
\n )\n}\n","import { Bee, BeeDebug } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\nimport { config } from '../config'\n\ninterface ContextInterface {\n apiUrl: string\n apiDebugUrl: string\n beeApi: Bee | null\n beeDebugApi: BeeDebug | null\n setApiUrl: (url: string) => void\n setDebugApiUrl: (url: string) => void\n lockedApiSettings: boolean\n}\n\nconst initialValues: ContextInterface = {\n apiUrl: config.BEE_API_HOST,\n apiDebugUrl: config.BEE_DEBUG_API_HOST,\n beeApi: null,\n beeDebugApi: null,\n setApiUrl: () => {}, // eslint-disable-line\n setDebugApiUrl: () => {}, // eslint-disable-line\n lockedApiSettings: false,\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nexport function Provider({\n children,\n beeApiUrl,\n beeDebugApiUrl,\n lockedApiSettings: extLockedApiSettings,\n}: Props): ReactElement {\n const [apiUrl, setApiUrl] = useState(initialValues.apiUrl)\n const [apiDebugUrl, setDebugApiUrl] = useState(initialValues.apiDebugUrl)\n const [beeApi, setBeeApi] = useState(null)\n const [beeDebugApi, setBeeDebugApi] = useState(null)\n const [lockedApiSettings] = useState(Boolean(extLockedApiSettings))\n\n const url = beeApiUrl || apiUrl\n const debugUrl = beeDebugApiUrl || apiDebugUrl\n\n useEffect(() => {\n try {\n setBeeApi(new Bee(url))\n sessionStorage.setItem('api_host', url)\n } catch (e) {\n setBeeApi(null)\n }\n }, [url])\n\n useEffect(() => {\n try {\n setBeeDebugApi(new BeeDebug(debugUrl))\n sessionStorage.setItem('debug_api_host', debugUrl)\n } catch (e) {\n setBeeDebugApi(null)\n }\n }, [debugUrl])\n\n return (\n \n {children}\n \n )\n}\n","import type { ReactElement } from 'react'\nimport IconButton from '@material-ui/core/IconButton'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Clipboard } from 'react-feather'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n value: string\n}\n\nexport default function ClipboardCopy({ value }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n const handleCopy = () => enqueueSnackbar(`Copied: ${value}`, { variant: 'success' })\n\n return (\n
\n \n \n \n \n \n
\n )\n}\n","import { ReactElement, useState } from 'react'\nimport QRCode from 'qrcode.react'\nimport { IconButton, Dialog, DialogTitle } from '@material-ui/core'\nimport { FilterCenterFocusSharp } from '@material-ui/icons'\n\ninterface Props {\n value: string\n label: string\n}\n\nexport default function QRCodeModal(props: Props): ReactElement {\n const [open, setOpen] = useState(false)\n\n const handleOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n return (\n
\n \n \n \n \n
\n {props.label}\n \n
\n
\n
\n )\n}\n","import { Typography } from '@material-ui/core/'\nimport { ReactElement } from 'react'\nimport Identicon from 'react-identicons'\nimport { config } from '../config'\nimport ClipboardCopy from './ClipboardCopy'\nimport QRCodeModal from './QRCodeModal'\n\ninterface Props {\n address: string | undefined\n hideBlockie?: boolean\n transaction?: boolean\n truncate?: boolean\n}\n\nexport default function EthereumAddress(props: Props): ReactElement {\n return (\n \n {props.address ? (\n
\n {props.hideBlockie ? null : (\n
\n \n
\n )}\n
\n \n {props.address}\n \n
\n \n \n
\n ) : (\n '-'\n )}\n
\n )\n}\n","import { CircularProgress, Container } from '@material-ui/core'\nimport Button from '@material-ui/core/Button'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useState, useContext } from 'react'\nimport { Zap } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\nimport EthereumAddress from './EthereumAddress'\n\ninterface Props {\n peerId: string\n uncashedAmount: string\n}\n\nexport default function CheckoutModal({ peerId, uncashedAmount }: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [loadingCashout, setLoadingCashout] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const { beeDebugApi } = useContext(SettingsContext)\n\n const handleClickOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleCashout = () => {\n if (!beeDebugApi) return\n\n if (peerId) {\n setLoadingCashout(true)\n beeDebugApi\n .cashoutLastCheque(peerId)\n .then(res => {\n setOpen(false)\n enqueueSnackbar(\n \n Successfully cashed out cheque. Transaction\n \n ,\n { variant: 'success' },\n )\n })\n .catch((e: Error) => {\n enqueueSnackbar(Error: {e.message}, { variant: 'error' })\n })\n .finally(() => {\n setLoadingCashout(false)\n })\n } else {\n enqueueSnackbar(Peer Id invalid, { variant: 'error' })\n }\n }\n\n return (\n
\n \n \n Cashout Cheque\n \n \n {loadingCashout && (\n <>\n \n Cashing out {uncashedAmount} from Peer {peerId}. Please wait...\n \n \n \n \n \n )}\n {!loadingCashout && (\n \n Are you sure you want to cashout {uncashedAmount} BZZ from Peer{' '}\n {peerId}?\n \n )}\n \n \n \n \n \n \n \n
\n )\n}\n","import type { ReactElement } from 'react'\n\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\n\nimport CashoutModal from '../../components/CashoutModal'\nimport { Accounting } from '../../hooks/accounting'\nimport type { Token } from '../../models/Token'\n\ninterface Props {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport default function PeerBalances({ accounting, isLoadingUncashed, totalUncashed }: Props): ReactElement | null {\n return (\n \n \n {accounting?.map(({ peer, balance, received, sent, uncashedAmount, total }) => (\n \n \n \n \n \n \n {uncashedAmount.toBigNumber.isGreaterThan('0') && (\n \n \n \n )}\n \n ))}\n \n )\n}\n","import { Button, Grid, Link as MuiLink, Typography } from '@material-ui/core/'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport type { ReactElement } from 'react'\nimport { Activity } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n content: {\n maxWidth: 500,\n marginBottom: theme.spacing(4),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n icon: {\n height: '1rem',\n },\n }),\n)\n\nexport default function TroubleshootConnectionCard(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n Uh oh, it looks like your node is not connected.\n \n \n \n \n Please check your node status to fix the problem. You can also check out the{' '}\n \n Swarm Bee Docs\n {' '}\n or ask for support on the{' '}\n \n Ethereum Swarm Discord\n \n .\n \n \n \n \n }\n to={ROUTES.STATUS}\n >\n Check node status\n \n \n \n \n )\n}\n","import type {\n ChainState,\n ChequebookAddressResponse,\n Health,\n LastChequesResponse,\n NodeAddresses,\n NodesInfo,\n Peer,\n Topology,\n} from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport semver from 'semver'\nimport { engines } from '../../package.json'\nimport { useLatestBeeRelease } from '../hooks/apiHooks'\nimport { Token } from '../models/Token'\nimport type { Balance, ChequebookBalance, Settlements } from '../types'\nimport { Context as SettingsContext } from './Settings'\n\ninterface Status {\n all: boolean\n version: boolean\n blockchainConnection: boolean\n debugApiConnection: boolean\n apiConnection: boolean\n topology: boolean\n chequebook: boolean\n}\n\ninterface ContextInterface {\n status: Status\n latestPublishedVersion?: string\n latestUserVersion?: string\n latestUserVersionExact?: string\n isLatestBeeVersion: boolean\n latestBeeVersionUrl: string\n error: Error | null\n apiHealth: boolean\n debugApiHealth: Health | null\n nodeAddresses: NodeAddresses | null\n nodeInfo: NodesInfo | null\n topology: Topology | null\n chequebookAddress: ChequebookAddressResponse | null\n peers: Peer[] | null\n chequebookBalance: ChequebookBalance | null\n peerBalances: Balance[] | null\n peerCheques: LastChequesResponse | null\n settlements: Settlements | null\n chainState: ChainState | null\n latestBeeRelease: LatestBeeRelease | null\n isLoading: boolean\n isRefreshing: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst startedInDevMode = window.location.search.includes('devMode=1')\n\nconst initialValues: ContextInterface = {\n status: {\n all: false,\n version: false,\n blockchainConnection: false,\n debugApiConnection: false,\n apiConnection: false,\n topology: false,\n chequebook: false,\n },\n latestPublishedVersion: undefined,\n latestUserVersion: undefined,\n latestUserVersionExact: undefined,\n isLatestBeeVersion: false,\n latestBeeVersionUrl: 'https://github.com/ethersphere/bee/releases/latest',\n error: null,\n apiHealth: false,\n debugApiHealth: null,\n nodeAddresses: null,\n nodeInfo: null,\n topology: null,\n chequebookAddress: null,\n peers: null,\n chequebookBalance: null,\n peerBalances: null,\n peerCheques: null,\n settlements: null,\n chainState: null,\n latestBeeRelease: null,\n isLoading: true,\n isRefreshing: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction isUltraLight(string?: string) {\n return string === 'ultra-light'\n}\n\nfunction getStatus(\n debugApiHealth: Health | null,\n nodeAddresses: NodeAddresses | null,\n nodeInfo: NodesInfo | null,\n apiHealth: boolean,\n topology: Topology | null,\n chequebookAddress: ChequebookAddressResponse | null,\n chequebookBalance: ChequebookBalance | null,\n error: Error | null,\n): Status {\n // FIXME: `devMode` is a temporary workaround to be able to develop with only one node\n const devMode = startedInDevMode || Boolean(process.env.REACT_APP_DEV_MODE) || nodeInfo?.beeMode === 'dev'\n const status = {\n version: Boolean(\n debugApiHealth &&\n semver.satisfies(debugApiHealth.version, engines.bee, {\n includePrerelease: true,\n }),\n ),\n blockchainConnection: Boolean(nodeAddresses?.ethereum),\n debugApiConnection: Boolean(debugApiHealth?.status === 'ok'),\n apiConnection: apiHealth,\n topology: Boolean(topology?.connected && topology?.connected > 0) || devMode,\n chequebook:\n (Boolean(chequebookAddress?.chequebookAddress) &&\n chequebookBalance !== null &&\n chequebookBalance?.totalBalance.toBigNumber.isGreaterThan(0)) ||\n devMode ||\n isUltraLight(nodeInfo?.beeMode),\n }\n\n return { ...status, all: !error && Object.values(status).every(v => v) }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const [apiHealth, setApiHealth] = useState(false)\n const [debugApiHealth, setDebugApiHealth] = useState(null)\n const [nodeAddresses, setNodeAddresses] = useState(null)\n const [nodeInfo, setNodeInfo] = useState(null)\n const [topology, setNodeTopology] = useState(null)\n const [chequebookAddress, setChequebookAddress] = useState(null)\n const [peers, setPeers] = useState(null)\n const [chequebookBalance, setChequebookBalance] = useState(null)\n const [peerBalances, setPeerBalances] = useState(null)\n const [peerCheques, setPeerCheques] = useState(null)\n const [settlements, setSettlements] = useState(null)\n const [chainState, setChainState] = useState(null)\n\n const { latestBeeRelease } = useLatestBeeRelease()\n\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [isRefreshing, setIsRefreshing] = useState(initialValues.isRefreshing)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(30000)\n\n const latestPublishedVersion = semver.coerce(latestBeeRelease?.name)?.version\n const latestUserVersion = semver.coerce(debugApiHealth?.version)?.version\n const latestUserVersionExact = debugApiHealth?.version\n\n useEffect(() => {\n setIsLoading(true)\n\n setApiHealth(false)\n\n refresh()\n }, [beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n setIsLoading(true)\n\n setDebugApiHealth(null)\n setNodeAddresses(null)\n setNodeTopology(null)\n setNodeInfo(null)\n setPeers(null)\n setChequebookAddress(null)\n setChequebookBalance(null)\n setPeerBalances(null)\n setPeerCheques(null)\n setSettlements(null)\n setChainState(null)\n\n refresh()\n }, [beeDebugApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isRefreshing) return\n\n // Not a valid bee api\n if (!beeApi || !beeDebugApi) {\n setIsLoading(false)\n\n return\n }\n\n try {\n setIsRefreshing(true)\n setError(null)\n\n // Wrap the chequebook balance call to return BZZ values as Token object\n const chequeBalanceWrapper = async () => {\n const { totalBalance, availableBalance } = await beeDebugApi.getChequebookBalance()\n\n return {\n totalBalance: new Token(totalBalance),\n availableBalance: new Token(availableBalance),\n }\n }\n\n // Wrap the balances call to return BZZ values as Token object\n const peerBalanceWrapper = async () => {\n const { balances } = await beeDebugApi.getAllBalances()\n\n return balances.map(({ peer, balance }) => ({ peer, balance: new Token(balance) }))\n }\n\n // Wrap the settlements call to return BZZ values as Token object\n const settlementsWrapper = async () => {\n const { totalReceived, settlements, totalSent } = await beeDebugApi.getAllSettlements()\n\n return {\n totalReceived: new Token(totalReceived),\n totalSent: new Token(totalSent),\n settlements: settlements.map(({ peer, received, sent }) => ({\n peer,\n received: new Token(received),\n sent: new Token(sent),\n })),\n }\n }\n\n const promises = [\n // API health\n beeApi\n .isConnected()\n .then(setApiHealth)\n .catch(() => setApiHealth(false)),\n\n // Debug API health\n beeDebugApi\n .getHealth()\n .then(setDebugApiHealth)\n .catch(() => setDebugApiHealth(null)),\n\n // Node Addresses\n beeDebugApi\n .getNodeAddresses()\n .then(setNodeAddresses)\n .catch(() => setNodeAddresses(null)),\n\n // NodeInfo\n beeDebugApi\n .getNodeInfo()\n .then(setNodeInfo)\n .catch(() => setNodeInfo(null)),\n\n // Network Topology\n beeDebugApi\n .getTopology()\n .then(setNodeTopology)\n .catch(() => setNodeTopology(null)),\n\n // Peers\n beeDebugApi\n .getPeers()\n .then(setPeers)\n .catch(() => setPeers(null)),\n\n // Chequebook address\n beeDebugApi\n .getChequebookAddress()\n .then(setChequebookAddress)\n .catch(() => setChequebookAddress(null)),\n\n // Cheques\n beeDebugApi\n .getLastCheques()\n .then(setPeerCheques)\n .catch(() => setPeerCheques(null)),\n\n // Chain state\n beeDebugApi\n .getChainState()\n .then(setChainState)\n .catch(() => setChainState(null)),\n\n // Chequebook balance\n chequeBalanceWrapper()\n .then(setChequebookBalance)\n .catch(() => setChequebookBalance(null)),\n\n // Peer balances\n peerBalanceWrapper()\n .then(setPeerBalances)\n .catch(() => setPeerBalances(null)),\n\n // Settlements\n settlementsWrapper()\n .then(setSettlements)\n .catch(() => setSettlements(null)),\n ]\n\n await Promise.allSettled(promises)\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n setIsRefreshing(false)\n setLastUpdate(Date.now())\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency, beeDebugApi, beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import axios from 'axios'\nimport { useEffect, useState } from 'react'\nimport { config } from '../config'\n\nexport interface LatestBeeReleaseHook {\n latestBeeRelease: LatestBeeRelease | null\n isLoadingLatestBeeRelease: boolean\n error: Error | null\n}\n\nexport const useLatestBeeRelease = (): LatestBeeReleaseHook => {\n const [latestBeeRelease, setLatestBeeRelease] = useState(null)\n const [isLoadingLatestBeeRelease, setLoading] = useState(false)\n const [error, setError] = useState(null)\n\n useEffect(() => {\n axios\n .get(`${config.GITHUB_REPO_URL}/releases/latest`)\n .then(res => {\n setLatestBeeRelease(res.data)\n })\n .catch((error: Error) => {\n setError(error)\n })\n .finally(() => {\n setLoading(false)\n })\n }, [])\n\n return { latestBeeRelease, isLoadingLatestBeeRelease, error }\n}\n","import { LastCashoutActionResponse, BeeDebug } from '@ethersphere/bee-js'\nimport { useEffect, useState } from 'react'\nimport { Token } from '../models/Token'\nimport { makeRetriablePromise, unwrapPromiseSettlements } from '../utils'\nimport { Balance, Settlements, Settlement } from '../types'\n\ninterface UseAccountingHook {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport interface Accounting {\n peer: string\n uncashedAmount: Token\n balance: Token\n received: Token\n sent: Token\n total: Token\n}\n\n/**\n * Merges the balances, settlements and uncashedAmounts arrays into single array which is sorted by uncashed amounts (if any)\n *\n * @param balances Balances for all peers\n * @param settlements Settlements for all peers which has some settlement\n * @param uncashedAmounts Array of getPeerLastCashout responses which is needed to calculate uncashed amount\n *\n * @returns\n */\nfunction mergeAccounting(\n balances: Balance[] | null,\n settlements?: Settlement[],\n uncashedAmounts?: LastCashoutActionResponse[],\n): Accounting[] | null {\n // Settlements or balances are still loading or there is an error -> return null\n if (!balances || !settlements) return null\n\n const accounting: Record = {}\n\n balances.forEach(\n // Some peers may not have settlement but all have balance (therefore initialize sent, received and uncashed to 0)\n ({ peer, balance }) =>\n (accounting[peer] = {\n peer,\n balance,\n sent: new Token('0'),\n received: new Token('0'),\n uncashedAmount: new Token('0'),\n total: balance,\n }),\n )\n\n settlements.forEach(\n ({ peer, sent, received }) =>\n (accounting[peer] = {\n ...accounting[peer],\n sent,\n received,\n total: new Token(accounting[peer].balance.toBigNumber.plus(received.toBigNumber).minus(sent.toBigNumber)),\n }),\n )\n\n // If there are no cheques (and hence last cashout actions)\n if (!uncashedAmounts) return Object.values(accounting).sort((a, b) => (a.peer < b.peer ? -1 : 1))\n\n uncashedAmounts?.forEach(({ peer, uncashedAmount }) => {\n accounting[peer].uncashedAmount = new Token(uncashedAmount)\n })\n\n // Return sorted by the uncashed amount first and then by the peer id\n return Object.values(accounting).sort((a, b) => {\n const diff = b.uncashedAmount.toBigNumber.minus(a.uncashedAmount.toBigNumber).toNumber()\n\n if (diff !== 0) return diff\n\n return a.peer < b.peer ? -1 : 1\n })\n}\n\nexport const useAccounting = (\n beeDebugApi: BeeDebug | null,\n settlements: Settlements | null,\n balances: Balance[] | null,\n): UseAccountingHook => {\n const [isLoadingUncashed, setIsloadingUncashed] = useState(false)\n const [uncashedAmounts, setUncashedAmounts] = useState(undefined)\n\n useEffect(() => {\n // We don't have any settlements loaded yet or we are already loading/have loaded the uncashed amounts\n if (isLoadingUncashed || !beeDebugApi || !settlements || uncashedAmounts) return\n\n setIsloadingUncashed(true)\n const promises = settlements.settlements\n .filter(({ received }) => received.toBigNumber.gt('0'))\n .map(({ peer }) => makeRetriablePromise(() => beeDebugApi.getLastCashoutAction(peer)))\n\n Promise.allSettled(promises).then(settlements => {\n const results = unwrapPromiseSettlements(settlements)\n setUncashedAmounts(results.fulfilled)\n setIsloadingUncashed(false)\n })\n }, [settlements, isLoadingUncashed, uncashedAmounts, beeDebugApi])\n\n const accounting = mergeAccounting(balances, settlements?.settlements, uncashedAmounts)\n\n let totalUncashed: Token = new Token('0')\n accounting?.forEach(\n ({ uncashedAmount }) => (totalUncashed = new Token(totalUncashed.toBigNumber.plus(uncashedAmount.toBigNumber))),\n )\n\n return {\n isLoadingUncashed,\n totalUncashed,\n accounting,\n }\n}\n","import { ReactElement, ReactNode, useState } from 'react'\nimport Button from '@material-ui/core/Button'\nimport Input from '@material-ui/core/Input'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport FormHelperText from '@material-ui/core/FormHelperText'\nimport { Token } from '../models/Token'\nimport type { BigNumber } from 'bignumber.js'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n successMessage: string\n errorMessage: string\n dialogMessage: string\n label: string\n max?: BigNumber\n min?: BigNumber\n action: (amount: bigint) => Promise\n icon?: ReactNode\n}\n\nexport default function WithdrawDepositModal({\n successMessage,\n errorMessage,\n dialogMessage,\n min,\n max,\n label,\n action,\n icon,\n}: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [amount, setAmount] = useState('')\n const [amountToken, setAmountToken] = useState(null)\n const [amountError, setAmountError] = useState(null)\n const { enqueueSnackbar } = useSnackbar()\n\n const handleClickOpen = (e: React.MouseEvent) => {\n setOpen(true)\n e.stopPropagation()\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleAction = async () => {\n if (amountToken === null) return\n\n try {\n const transactionHash = await action(amountToken.toBigInt as bigint)\n setOpen(false)\n enqueueSnackbar(`${successMessage} Transaction ${transactionHash}`, { variant: 'success' })\n } catch (e) {\n enqueueSnackbar(`${errorMessage} Error: ${(e as Error).message}`, { variant: 'error' })\n }\n }\n\n const handleChange = (e: React.ChangeEvent) => {\n const value = e.target.value\n setAmount(value)\n setAmountError(null)\n try {\n const t = Token.fromDecimal(value)\n setAmountToken(t)\n\n if (min && t.toDecimal.isLessThan(min)) setAmountError(new Error(`Needs to be more than ${min}`))\n\n if (max && t.toDecimal.isGreaterThan(max)) setAmountError(new Error(`Needs to be less than ${max}`))\n } catch (e) {\n setAmountError(e as Error)\n }\n }\n\n return (\n
\n \n \n {label}\n \n {dialogMessage}\n \n {amountError && (\n \n Please provide valid BZZ amount (max 16 decimals). Error: {amountError.message}\n \n )}\n \n \n \n \n \n \n
\n )\n}\n","import { BigNumber } from 'bignumber.js'\nimport { ReactElement, useContext } from 'react'\nimport { Upload } from 'react-feather'\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nexport default function WithdrawModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.withdrawTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { Download } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { BigNumber } from 'bignumber.js'\n\nexport default function DepositModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.depositTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport PeerBalances from './PeerBalances'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { useAccounting } from '../../hooks/accounting'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport WithdrawModal from '../../containers/WithdrawModal'\nimport DepositModal from '../../containers/DepositModal'\n\nexport default function Accounting(): ReactElement {\n const { status, nodeAddresses, chequebookAddress, chequebookBalance, settlements, peerBalances } =\n useContext(BeeContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { accounting, totalUncashed, isLoadingUncashed } = useAccounting(beeDebugApi, settlements, peerBalances)\n\n if (!status.all) return \n\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n )\n}\n","import { Button, CircularProgress, createStyles, makeStyles } from '@material-ui/core'\nimport React, { ReactElement } from 'react'\nimport { IconProps } from 'react-feather'\n\ninterface Props {\n onClick: () => void\n iconType: React.ComponentType\n children: string\n className?: string\n disabled?: boolean\n loading?: boolean\n cancel?: boolean\n variant?: 'text' | 'contained' | 'outlined' | undefined\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n button: {\n height: '52px',\n position: 'relative',\n whiteSpace: 'nowrap',\n color: '#242424',\n '&:hover, &:focus': {\n '& svg': {\n stroke: '#fff',\n transition: '0.1s',\n },\n },\n },\n cancelButton: {\n background: '#f7f7f7',\n color: '#606060',\n },\n spinnerWrapper: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n width: '40px',\n height: '40px',\n transform: 'translate(-50%, -50%)',\n },\n }),\n)\n\nexport function SwarmButton({\n children,\n onClick,\n iconType,\n className,\n disabled,\n loading,\n cancel,\n variant = 'contained',\n}: Props): ReactElement {\n const classes = useStyles()\n\n function getIconColor() {\n if (loading || disabled) {\n return 'rgba(0, 0, 0, 0.26)'\n }\n\n return cancel ? '#606060' : '#dd7700'\n }\n\n function getButtonClassName() {\n return [className, classes.button, cancel && classes.cancelButton].filter(x => x).join(' ')\n }\n\n const icon = React.createElement(iconType, {\n size: '1.25rem',\n color: getIconColor(),\n })\n\n return (\n ) => {\n onClick()\n event.currentTarget.blur()\n }}\n variant={variant}\n startIcon={icon}\n disabled={disabled}\n >\n {children}\n {loading && (\n
\n \n
\n )}\n \n )\n}\n","import { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\n\nexport type IdentityType = 'V3' | 'PRIVATE_KEY'\n\nexport interface Identity {\n uuid: string\n name: string\n feedHash?: string\n identity: string\n address: string\n type: IdentityType\n}\n\ninterface ContextInterface {\n identities: Identity[]\n setIdentities: (identities: Identity[]) => void\n}\n\nconst initialValues: ContextInterface = {\n identities: [],\n setIdentities: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [identities, setIdentities] = useState(initialValues.identities)\n\n useEffect(() => {\n try {\n setIdentities(JSON.parse(localStorage.getItem('feeds') || '[]'))\n } catch {\n setIdentities([])\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {children}\n}\n","import { Box, Dialog, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nexport function SwarmDialog({ children }: Props): ReactElement {\n return (\n \n \n \n {children}\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { Close } from '@material-ui/icons'\nimport { ReactElement } from 'react'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n padding: theme.spacing(1),\n cursor: 'pointer',\n },\n }),\n)\n\nexport function CloseButton({ onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
\n \n
\n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { CloseButton } from './CloseButton'\n\ninterface Props {\n children: string\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontWeight: 'bold',\n },\n }),\n)\n\nexport function TitleWithClose({ children, onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n \n  \n \n {children}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Trash, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onConfirm: (identity: Identity) => void\n onClose: () => void\n}\n\nexport function DeleteFeedDialog({ identity, onConfirm, onClose }: Props): ReactElement {\n return (\n \n \n Delete\n \n \n {`You are about to delete feed ${identity.name} Website. It is strongly advised to export this feed first.`}\n \n \n onConfirm(identity)}>\n Delete\n \n \n Cancel\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: string\n prettify?: boolean\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n overflow: 'scroll',\n background: '#ffffff',\n },\n pre: {\n maxHeight: '6em',\n padding: theme.spacing(2),\n },\n }),\n)\n\nfunction prettifyString(string: string): string {\n try {\n return JSON.stringify(JSON.parse(string), null, 4)\n } catch {\n return string\n }\n}\n\nexport function Code({ children, prettify }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
\n
{prettify ? prettifyString(children) : children}
\n
\n )\n}\n","import { Box, createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement } from 'react'\nimport { Clipboard, Download } from 'react-feather'\nimport { Code } from '../../components/Code'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n maxWidth: '100%',\n },\n }),\n)\n\nexport function ExportFeedDialog({ identity, onClose }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n function onDownload() {\n saveAs(\n new Blob([identity.identity], {\n type: 'application/json',\n }),\n identity.name + '.json',\n )\n }\n\n function getExportText() {\n return identity.type === 'V3' ? 'JSON file' : 'the private key string'\n }\n\n function onCopy() {\n navigator.clipboard\n .writeText(identity.identity)\n .then(() => enqueueSnackbar('Copied to Clipboard', { variant: 'success' }))\n }\n\n return (\n \n \n Export\n \n \n {`We exported the identity associated with this feed as ${getExportText()}.`}\n \n \n {identity.identity}\n \n \n \n Download JSON File\n \n \n Copy To Clipboard\n \n \n \n )\n}\n","import { createStyles, makeStyles, TextField as SimpleTextField, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { TextField } from 'formik-material-ui'\nimport { ChangeEvent, ReactElement } from 'react'\n\ninterface Props {\n name: string\n label: string\n password?: boolean\n formik?: boolean\n optional?: boolean\n defaultValue?: string\n onChange?: (event: ChangeEvent) => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n field: {\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .Mui-focused': {\n background: theme.palette.background.paper,\n },\n '& .MuiInputBase-root': {\n background: theme.palette.background.paper,\n },\n '& .MuiFilledInput-root': {\n borderRadius: 0,\n },\n },\n }),\n)\n\nexport function SwarmTextInput({\n name,\n label,\n password,\n optional,\n formik,\n onChange,\n defaultValue,\n}: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n \n )\n }\n\n return (\n \n )\n}\n","import { Box, createStyles, makeStyles, TextareaAutosize, Theme } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport React, { ReactElement, useContext, useRef, useState } from 'react'\nimport { Check, Upload } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Context, Identity } from '../../providers/Feeds'\nimport { importIdentity, persistIdentity } from '../../utils/identity'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textarea: {\n width: '100%',\n border: 0,\n padding: theme.spacing(1),\n },\n displayNone: {\n display: 'none',\n },\n }),\n)\n\nexport function ImportFeedDialog({ onClose }: Props): ReactElement {\n const [textareaValue, setTextareaValue] = useState('')\n const [name, setName] = useState('')\n const fileInputRef = useRef(null)\n\n const { identities, setIdentities } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n async function onImport() {\n const feed = await importIdentity(name, textareaValue)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n\n function onUploadIdentityFile() {\n if (fileInputRef.current) {\n const input = fileInputRef.current as HTMLInputElement\n input.click()\n }\n }\n\n function onIdentityFileSelected(event: React.ChangeEvent) {\n const fileReader = new FileReader()\n const file = event.target?.files?.[0]\n fileReader.onload = async event => {\n const string = event.target?.result\n\n if (string) {\n const feed = await importIdentity(name, string as string)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n }\n\n if (file) {\n fileReader.readAsText(file)\n }\n }\n\n function onFeedReady(identity: Identity) {\n persistIdentity(identities, identity)\n setIdentities(identities)\n enqueueSnackbar('Feed imported successfully', { variant: 'success' })\n onClose()\n }\n\n return (\n \n \n \n Import\n \n \n setName(event.target.value)} />\n \n \n setTextareaValue(event.target.value)}\n />\n \n \n \n Upload Json File\n \n \n Use Pasted Text\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Download, Info, PlusSquare, Trash } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { ROUTES } from '../../routes'\nimport { formatEnum } from '../../utils'\nimport { persistIdentitiesWithoutUpdate } from '../../utils/identity'\nimport { DeleteFeedDialog } from './DeleteFeedDialog'\nimport { ExportFeedDialog } from './ExportFeedDialog'\nimport { ImportFeedDialog } from './ImportFeedDialog'\n\nexport default function Feeds(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [showImport, setShowImport] = useState(false)\n const [showExport, setShowExport] = useState(false)\n const [showDelete, setShowDelete] = useState(false)\n\n function createNewFeed() {\n return navigate(ROUTES.FEEDS_NEW)\n }\n\n function viewFeed(uuid: string) {\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uuid))\n }\n\n function onDialogClose() {\n setShowDelete(false)\n setShowExport(false)\n setShowImport(false)\n setSelectedIdentity(null)\n }\n\n function onDelete(identity: Identity) {\n onDialogClose()\n const updatedFeeds = identities.filter(x => x.uuid !== identity.uuid)\n setIdentities(updatedFeeds)\n persistIdentitiesWithoutUpdate(updatedFeeds)\n }\n\n function onShowExport(identity: Identity) {\n setSelectedIdentity(identity)\n setShowExport(true)\n }\n\n function onShowDelete(identity: Identity) {\n setSelectedIdentity(identity)\n setShowDelete(true)\n }\n\n if (!status.all) return \n\n return (\n
\n {showImport && setShowImport(false)} />}\n {showExport && selectedIdentity && }\n {showDelete && selectedIdentity && (\n onDelete(identity)}\n />\n )}\n \n Feeds\n \n \n \n \n Create New Feed\n \n setShowImport(true)}>\n Import Feed\n \n \n \n {identities.map((x, i) => (\n \n \n \n \n \n \n \n \n {x.feedHash && }\n \n \n viewFeed(x.uuid)} iconType={Info}>\n View Feed Page\n \n onShowExport(x)} iconType={Download}>\n Export...\n \n onShowDelete(x)} iconType={Trash}>\n Delete...\n \n \n \n \n ))}\n
\n )\n}\n","import { createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: (string | ReactElement)[] | (string | ReactElement)\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontSize: '0.9rem',\n },\n }),\n)\n\nexport function DocumentationText({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return {children}\n}\n","import { Box, createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ArrowBack } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\ninterface Props {\n children: string\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n pressable: {\n cursor: 'pointer',\n },\n icon: {\n color: '#242424',\n },\n }),\n)\n\nexport function HistoryHeader({ children }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function goBack() {\n navigate(-1)\n }\n\n return (\n \n \n \n
\n \n
\n
\n {children}\n
\n
\n )\n}\n","import { createStyles, FormHelperText, makeStyles, MenuItem, Select as SimpleSelect, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { Select } from 'formik-material-ui'\nimport { ReactElement } from 'react'\n\nexport type SelectEvent = React.ChangeEvent<{\n name?: string | undefined\n value: unknown\n}>\n\ninterface Props {\n label?: string\n name?: string\n options: { value: string; label: string }[]\n onChange?: (event: SelectEvent) => void\n formik?: boolean\n defaultValue?: string\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n select: {\n borderRadius: 0,\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .MuiSelect-select': {\n '&:focus': {\n background: theme.palette.background.paper,\n },\n },\n },\n option: {\n height: '52px',\n },\n }),\n)\n\nexport function SwarmSelect({ defaultValue, formik, name, options, onChange, label }: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n }\n\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Form, Formik } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as FeedsContext, IdentityType } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { convertWalletToIdentity, generateWallet, persistIdentity } from '../../utils/identity'\n\ninterface FormValues {\n identityName?: string\n type?: IdentityType\n password?: string\n}\n\nconst initialValues: FormValues = {\n identityName: '',\n type: 'PRIVATE_KEY',\n password: '',\n}\n\nexport default function CreateNewFeed(): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { identities, setIdentities } = useContext(FeedsContext)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n\n const navigate = useNavigate()\n\n async function onSubmit(values: FormValues) {\n setLoading(true)\n\n if (!beeApi) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n const wallet = generateWallet()\n const stamps = await beeDebugApi?.getAllPostageBatch()\n\n if (!stamps || !stamps.length) {\n enqueueSnackbar(No stamp available, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n if (!values.identityName || !values.type) {\n enqueueSnackbar(Form is unfinished, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n const identity = await convertWalletToIdentity(wallet, values.type, values.identityName, values.password)\n persistIdentity(identities, identity)\n setIdentities(identities)\n navigate(ROUTES.FEEDS)\n setLoading(false)\n }\n\n function cancel() {\n navigate(-1)\n }\n\n return (\n
\n Create new feed\n \n \n To create a feed you will need to create an identity. Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand how feeds work.\n \n \n \n {({ submitForm, values }) => (\n
\n \n \n \n \n \n \n {values.type === 'V3' && }\n \n \n \n \n \n Feeds name\n {values.identityName} Website\n \n \n \n \n \n Create Feed\n \n \n Cancel\n \n \n \n \n )}\n
\n
\n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ArrowForward, OpenInNewSharp } from '@material-ui/icons'\nimport { ReactElement, useState } from 'react'\nimport CopyToClipboard from 'react-copy-to-clipboard'\nimport { useNavigate } from 'react-router'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n openLinkIcon: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n link?: string\n navigationType?: 'NEW_WINDOW' | 'HISTORY_PUSH'\n allowClipboard?: boolean\n}\n\nexport default function ExpandableListItemLink({\n label,\n value,\n link,\n navigationType = 'NEW_WINDOW',\n allowClipboard = true,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [copied, setCopied] = useState(false)\n const navigate = useNavigate()\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const displayValue = value.length > 22 ? value.slice(0, 19) + '...' : value\n\n function onNavigation() {\n if (navigationType === 'NEW_WINDOW') {\n window.open(link || value)\n } else {\n navigate(link || value)\n }\n }\n\n return (\n \n \n \n {label && {label}}\n \n
\n {allowClipboard && (\n \n \n \n {displayValue}\n \n \n \n )}\n {!allowClipboard && {displayValue}}\n \n {navigationType === 'NEW_WINDOW' && }\n {navigationType === 'HISTORY_PUSH' && }\n \n
\n
\n
\n
\n
\n )\n}\n","const indexHtmls = ['index.html', 'index.htm']\n\ninterface DetectedIndex {\n indexPath: string\n commonPrefix?: string\n}\n\nexport function detectIndexHtml(files: FilePath[]): DetectedIndex | false {\n const paths = files.map(getPath)\n\n if (!paths.length) {\n return false\n }\n\n const exactMatch = paths.find(x => indexHtmls.includes(x))\n\n if (exactMatch) {\n return { indexPath: exactMatch }\n }\n\n const prefix = paths[0].split('/')[0] + '/'\n\n const allStartWithSamePrefix = paths.every(x => x.startsWith(prefix))\n\n if (allStartWithSamePrefix) {\n const match = paths.find(x => indexHtmls.map(y => prefix + y).includes(x))\n\n if (match) {\n return { indexPath: match, commonPrefix: prefix }\n }\n }\n\n return false\n}\n\nexport function getHumanReadableFileSize(bytes: number): string {\n if (bytes >= 1e15) {\n return (bytes / 1e15).toFixed(2) + ' PB'\n }\n\n if (bytes >= 1e12) {\n return (bytes / 1e12).toFixed(2) + ' TB'\n }\n\n if (bytes >= 1e9) {\n return (bytes / 1e9).toFixed(2) + ' GB'\n }\n\n if (bytes >= 1e6) {\n return (bytes / 1e6).toFixed(2) + ' MB'\n }\n\n if (bytes >= 1e3) {\n return (bytes / 1e3).toFixed(2) + ' kB'\n }\n\n return bytes + ' bytes'\n}\n\nexport function getAssetNameFromFiles(files: FilePath[]): string {\n if (files.length === 1) return files[0].name\n\n if (files.length > 0) {\n const prefix = getPath(files[0]).split('/')[0]\n\n // Only if all files have a common prefix we can use it as a folder name\n if (files.every(f => getPath(f).split('/')[0] === prefix)) return prefix\n }\n\n return 'unknown'\n}\n\nexport function getMetadata(files: FilePath[]): Metadata {\n const size = files.reduce((total, item) => total + item.size, 0)\n const isWebsite = Boolean(detectIndexHtml(files))\n const name = getAssetNameFromFiles(files)\n const type = files.length === 1 ? files[0].type : 'folder'\n const count = files.length\n\n return { size, name, type, isWebsite, count }\n}\n\nexport function getPath(file: FilePath): string {\n return (file.path || file.webkitRelativePath || file.name).replace(/^\\//g, '') // remove the starting slash\n}\n\n/**\n * Utility function that is needed to have correct directory structure as webkitRelativePath is read only\n */\nexport function packageFile(file: FilePath): FilePath {\n const path = getPath(file)\n\n return {\n path: path,\n fullPath: path,\n webkitRelativePath: path,\n lastModified: file.lastModified,\n name: file.name,\n size: file.size,\n type: file.type,\n stream: file.stream,\n slice: file.slice,\n text: file.text,\n arrayBuffer: async () => await file.arrayBuffer(), // This is needed for successful upload and can not simply be { arrayBuffer: file.arrayBuffer }\n }\n}\n","interface Dimensions {\n width: number\n height: number\n}\n\n/**\n * Get the dimensions of the image after resize\n *\n * @param imgWidth Current image width\n * @param imgHeight Current image height\n * @param maxWidth Desired max width\n * @param maxHeight Desired max height\n *\n * @returns Downscaled dimensions of the image to fit in the bounding box\n */\nexport function getDimensions(imgWidth: number, imgHeight: number, maxWidth?: number, maxHeight?: number): Dimensions {\n const ratioWidth = maxWidth ? imgWidth / maxWidth : 1\n const ratioHeight = maxHeight ? imgHeight / maxHeight : 1\n\n const ratio = Math.max(ratioWidth, ratioHeight)\n\n // No need to resize\n if (ratio <= 1) return { width: imgWidth, height: imgHeight }\n\n return { width: imgWidth / ratio, height: imgHeight / ratio }\n}\n\n/**\n * Resize image passed to fit in the bounding box defined with maxWidth and maxHeight.\n * Note that one or both of the bounding box dimensions may be omitted\n *\n * @param file Image file to be resized\n * @param maxWidth Maximal image width\n * @param maxHeight Maximal image height\n *\n * @returns Promise that resolves into the resized image blob\n */\nexport function resize(file: File, maxWidth?: number, maxHeight?: number): Promise {\n return new Promise((resolve, reject) => {\n const allowedTypes = [\n 'image/bmp',\n 'image/gif',\n 'image/vnd.microsoft.icon',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp',\n ]\n\n if (!file.size || !file.type || !allowedTypes.includes(file.type)) return reject('File not supported!')\n\n try {\n const reader = new FileReader()\n reader.readAsDataURL(file)\n reader.onload = event => {\n const src = event?.target?.result\n\n if (!src || typeof src !== 'string') throw new Error('Failed to load the image source')\n\n const img = new Image()\n img.src = src\n img.onload = () => {\n const dimensions = getDimensions(img.width, img.height, maxWidth, maxHeight)\n const elem = document.createElement('canvas')\n elem.width = dimensions.width\n elem.height = dimensions.height\n const ctx = elem.getContext('2d')\n\n if (!ctx) throw new Error('Failed to create canvas context')\n\n ctx.drawImage(img, 0, 0, elem.width, elem.height)\n ctx.canvas.toBlob(\n blob => {\n if (!blob) throw new Error('Failed to extract the blob from canvas')\n\n resolve(blob)\n },\n 'image/jpeg',\n 1,\n )\n }\n }\n reader.onerror = error => reject(error)\n } catch (error) {\n reject(error)\n }\n })\n}\n","export const META_FILE_NAME = '.swarmgatewaymeta.json'\nexport const PREVIEW_FILE_NAME = '.swarmgatewaypreview.jpeg'\nexport const PREVIEW_DIMENSIONS = { maxWidth: 250, maxHeight: 175 }\n","/* eslint-disable @typescript-eslint/no-empty-function */\n\nimport { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\nimport { getMetadata } from '../utils/file'\nimport { resize } from '../utils/image'\nimport { PREVIEW_DIMENSIONS } from '../constants'\n\nexport type UploadOrigin = { origin: 'UPLOAD' | 'FEED'; uuid?: string }\n\nexport const defaultUploadOrigin: UploadOrigin = { origin: 'UPLOAD' }\n\ninterface ContextInterface {\n files: FilePath[]\n setFiles: (files: FilePath[]) => void\n uploadOrigin: UploadOrigin\n setUploadOrigin: (uploadOrigin: UploadOrigin) => void\n metadata?: Metadata\n previewUri?: string\n previewBlob?: Blob\n}\n\nconst initialValues: ContextInterface = {\n files: [],\n setFiles: () => {},\n uploadOrigin: defaultUploadOrigin,\n setUploadOrigin: () => {},\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [files, setFiles] = useState(initialValues.files)\n const [uploadOrigin, setUploadOrigin] = useState(initialValues.uploadOrigin)\n const [metadata, setMetadata] = useState(undefined)\n const [previewUri, setPreviewUri] = useState(undefined)\n const [previewBlob, setPreviewBlob] = useState(undefined)\n\n useEffect(() => {\n setMetadata(getMetadata(files))\n\n if (previewUri) {\n URL.revokeObjectURL(previewUri) // Clear the preview from memory\n setPreviewUri(undefined)\n setPreviewBlob(undefined)\n }\n\n if (files.length !== 1 || !files[0].type.startsWith('image')) return\n\n resize(files[0], PREVIEW_DIMENSIONS.maxWidth, PREVIEW_DIMENSIONS.maxHeight).then(blob => {\n setPreviewUri(URL.createObjectURL(blob)) // NOTE: Until it is cleared with URL.revokeObjectURL, the file stays allocated in memory\n setPreviewBlob(blob)\n })\n\n return () => {\n if (previewUri) {\n URL.revokeObjectURL(previewUri)\n }\n }\n }, [files]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { DropzoneArea } from 'material-ui-dropzone'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { FilePlus, FolderPlus, PlusCircle } from 'react-feather'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context, UploadOrigin } from '../../providers/File'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml } from '../../utils/file'\n\ninterface Props {\n uploadOrigin: UploadOrigin\n showHelp: boolean\n}\n\nconst MAX_FILE_SIZE = 1_000_000_000 // 1 gigabyte\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n areaWrapper: { position: 'relative', marginBottom: theme.spacing(2) },\n dropzone: {\n background: theme.palette.background.default,\n outline: 'none',\n color: 'transparent',\n zIndex: 1,\n '& svg': {\n opacity: 0,\n },\n },\n buttonWrapper: {\n top: '0',\n left: '0',\n position: 'absolute',\n display: 'flex',\n width: '100%',\n height: '100%',\n justifyContent: 'center',\n alignItems: 'center',\n },\n button: {\n marginLeft: theme.spacing(0.5),\n marginRight: theme.spacing(0.5),\n zIndex: 2,\n },\n }),\n)\n\nexport function UploadArea({ uploadOrigin, showHelp }: Props): ReactElement {\n const { setFiles, setUploadOrigin } = useContext(Context)\n const classes = useStyles()\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n const [strictWebsiteMode, setStrictWebsiteMode] = useState(false)\n const [version, setVersion] = useState(0)\n\n const getDropzoneInputDomElement = () => document.querySelector('.MuiDropzoneArea-root input') as HTMLInputElement\n\n const onUploadCollectionClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.setAttribute('directory', '')\n element.setAttribute('webkitdirectory', '')\n element.setAttribute('mozdirectory', '')\n element.click()\n }\n }\n\n const onUploadWebsiteClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(true)\n }\n\n const onUploadFolderClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(false)\n }\n\n const onUploadFileClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.removeAttribute('directory')\n element.removeAttribute('webkitdirectory')\n element.removeAttribute('mozdirectory')\n element.click()\n }\n }\n\n const resetComponentOnAddingInvalidContent = () => {\n setTimeout(() => {\n setVersion(x => x + 1)\n setFiles([])\n }, 0)\n }\n\n const handleChange = (files?: File[]) => {\n if (files) {\n const FilePaths = files as FilePath[]\n const indexDocument = files.length === 1 ? files[0].name : detectIndexHtml(FilePaths) || undefined\n\n if (files.length && strictWebsiteMode && !indexDocument) {\n enqueueSnackbar('To upload a website, there must be an index.html or index.htm in the root of the folder.', {\n variant: 'error',\n })\n resetComponentOnAddingInvalidContent()\n\n return\n }\n\n setFiles(FilePaths)\n\n if (files.length) {\n setUploadOrigin(uploadOrigin)\n navigate(ROUTES.UPLOAD_IN_PROGRESS)\n }\n }\n }\n\n return (\n <>\n
\n \n
\n \n Add File\n \n \n Add Folder\n \n \n Add Website\n \n
\n
\n {showHelp && (\n \n You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm,\n make sure that your folder contains an “index.html” file.\n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { UploadArea } from '../files/UploadArea'\n\nexport function FeedSubpage(): ReactElement {\n const { identities } = useContext(IdentityContext)\n const { uuid } = useParams()\n const { beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [available, setAvailable] = useState(false)\n\n const identity = identities.find(x => x.uuid === uuid)\n\n useEffect(() => {\n if (!identity || !identity.feedHash) {\n return\n }\n\n try {\n beeApi?.downloadData(identity.feedHash).then(() => setAvailable(true))\n } catch {\n setAvailable(false)\n }\n }, [beeApi, uuid, identity])\n\n if (!identity || !status.all) {\n navigate(ROUTES.FEEDS, { replace: true })\n\n return <>\n }\n\n function onClose() {\n navigate(ROUTES.FEEDS)\n }\n\n return (\n
\n {`${identity.name} Website`}\n \n {available && identity.feedHash ? (\n <>\n \n \n \n \n \n \n \n ) : (\n \n \n This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the{' '}\n \n official Bee documentation\n \n .\n \n \n )}\n \n \n Close\n \n \n
\n )\n}\n","import { PostageBatch } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport { Context as SettingsContext } from './Settings'\n\nexport interface EnrichedPostageBatch extends PostageBatch {\n usage: number\n usageText: string\n}\n\ninterface ContextInterface {\n stamps: EnrichedPostageBatch[] | null\n error: Error | null\n isLoading: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst initialValues: ContextInterface = {\n stamps: null,\n error: null,\n isLoading: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction enrichStamp(postageBatch: PostageBatch): EnrichedPostageBatch {\n const { depth, bucketDepth, utilization } = postageBatch\n\n const usage = utilization / Math.pow(2, depth - bucketDepth)\n const usageText = `${Math.ceil(usage * 100)}%`\n\n return {\n ...postageBatch,\n usage,\n usageText,\n }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n const [stamps, setStamps] = useState(initialValues.stamps)\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(null)\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isLoading) return\n\n if (!beeDebugApi) return\n\n try {\n setIsLoading(true)\n const stamps = await beeDebugApi.getAllPostageBatch()\n\n setStamps(stamps.map(enrichStamp))\n setLastUpdate(Date.now())\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\n\ninterface Props {\n feedName: string\n onProceed: (password: string) => void\n onCancel: () => void\n loading: boolean\n}\n\nexport function FeedPasswordDialog({ feedName, onProceed, onCancel, loading }: Props): ReactElement {\n const [password, setPassword] = useState('')\n\n function onProceedClick() {\n return onProceed(password)\n }\n\n return (\n \n \n Update Feed\n \n \n Please enter the password for “{feedName}”:\n \n \n {\n setPassword(event.target.value)\n }}\n password\n />\n \n \n \n Proceed\n \n \n Cancel\n \n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { Bookmark, X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SelectEvent, SwarmSelect } from '../../components/SwarmSelect'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { FeedPasswordDialog } from './FeedPasswordDialog'\n\nexport default function UpdateFeed(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { stamps, refresh } = useContext(StampContext)\n const { status } = useContext(BeeContext)\n const { hash } = useParams()\n\n const [selectedStamp, setSelectedStamp] = useState(null)\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n function onFeedChange(event: SelectEvent) {\n const uuid = event.target.value\n setSelectedIdentity(identities.find(x => x.uuid === uuid) || null)\n }\n\n function onStampChange(event: SelectEvent) {\n const batchId = event.target.value as string\n setSelectedStamp(batchId)\n }\n\n function onCancel() {\n navigate(-1)\n }\n\n function onBeginUpdatingFeed() {\n if (!selectedIdentity) {\n return\n }\n\n if (selectedIdentity.type === 'V3') {\n setShowPasswordPrompt(true)\n } else {\n onFeedUpdate(selectedIdentity)\n }\n }\n\n async function onFeedUpdate(identity: Identity, password?: string) {\n setLoading(true)\n\n if (!beeApi || !beeDebugApi || !selectedStamp) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n try {\n await updateFeed(beeApi, identity, hash!, selectedStamp, password as string) // eslint-disable-line\n persistIdentity(identities, identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', identity.uuid))\n } catch (error: unknown) {\n setLoading(false)\n\n const message = (typeof error === 'object' && error !== null && Reflect.get(error, 'message')) || ''\n\n if (message.includes('possibly wrong passphrase')) {\n enqueueSnackbar('Wrong password, please try again', { variant: 'error' })\n } else {\n enqueueSnackbar('Could not update feed at this time, please try again later', { variant: 'error' })\n }\n }\n }\n\n if (!status.all) return \n\n return (\n
\n {showPasswordPrompt && selectedIdentity && (\n {\n setShowPasswordPrompt(false)\n }}\n onProceed={(password: string) => {\n onFeedUpdate(selectedIdentity, password)\n }}\n loading={loading}\n />\n )}\n Update feed\n \n \n ({ value: x.uuid, label: `${x.name} Website` }))}\n onChange={onFeedChange}\n label=\"Feed\"\n />\n \n \n\n \n \n {stamps ? (\n ({ value: x.batchID, label: x.batchID.slice(0, 8) }))}\n onChange={onStampChange}\n label=\"Stamp\"\n />\n ) : (\n You need to buy a stamp first to be able to update a feed.\n )}\n \n \n \n \n Update Selected Feed\n \n \n Close\n \n \n
\n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography } from '@material-ui/core'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: '#F7F7F7',\n marginBottom: theme.spacing(0.25),\n },\n typography: {\n color: '#242424',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemNote({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {children}\n \n \n )\n}\n","import { Grid, IconButton, InputBase, ListItem, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ChangeEvent, ReactElement, useState } from 'react'\nimport { Edit, Minus, Search, X } from 'react-feather'\nimport ExpandableListItemActions from './ExpandableListItemActions'\nimport ExpandableListItemNote from './ExpandableListItemNote'\nimport { SwarmButton } from './SwarmButton'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n unselectableLabel: {\n cursor: 'default',\n userSelect: 'none',\n // Many browsers don't support yet the general user-select css property\n WebkitUserSelect: 'none',\n MozUserSelect: 'none',\n msUserSelect: 'none',\n },\n }),\n)\n\ninterface Props {\n label: string\n value?: string\n placeholder?: string\n helperText?: string\n expandedOnly?: boolean\n confirmLabel?: string\n confirmLabelDisabled?: boolean\n loading?: boolean\n onChange?: (value: string) => void\n onConfirm: (value: string) => void\n mapperFn?: (value: string) => string\n locked?: boolean\n}\n\nexport default function ExpandableListItemKey({\n label,\n value,\n onConfirm,\n onChange,\n confirmLabel,\n confirmLabelDisabled,\n expandedOnly,\n helperText,\n placeholder,\n loading,\n mapperFn,\n locked,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(expandedOnly))\n const [inputValue, setInputValue] = useState(value || '')\n const toggleOpen = () => setOpen(!open)\n const handleChange = (e: ChangeEvent) => {\n if (mapperFn) {\n e.target.value = mapperFn(e.target.value)\n }\n\n setInputValue(e.target.value)\n\n if (onChange) onChange(e.target.value)\n }\n\n return (\n <>\n \n \n \n {label && (\n \n {label}\n \n )}\n \n
\n {!open && value}\n {!expandedOnly && !locked && (\n \n {open ? (\n \n ) : (\n \n )}\n \n )}\n
\n
\n
\n \n \n
\n
\n \n {helperText && {helperText}}\n \n onConfirm(inputValue)}\n >\n {confirmLabel || 'Save'}\n \n setInputValue(value || '')}\n cancel\n >\n Cancel\n \n \n \n \n )\n}\n","import { shortenHash } from './hash'\n\nexport enum HISTORY_KEYS {\n UPLOAD_HISTORY = 'UPLOAD_HISTORY',\n DOWNLOAD_HISTORY = 'DOWNLOAD_HISTORY',\n}\n\nexport interface HistoryItem {\n createdAt: number\n name: string\n hash: string\n}\n\nexport function putHistory(key: string, hash: string, name: string): void {\n const history = getHistorySafe(key)\n\n const existingIndex = history.findIndex(x => x.hash === hash)\n\n if (existingIndex !== -1) {\n history.splice(existingIndex, 1)\n }\n\n history.unshift({\n createdAt: Date.now(),\n hash,\n name,\n })\n\n if (history.length > 10) {\n history.length = 10\n }\n localStorage.setItem(key, JSON.stringify(history))\n}\n\nexport function getHistorySafe(key: string): HistoryItem[] {\n const items = localStorage.getItem(key)\n\n if (!items) {\n return []\n }\n try {\n const parsed = JSON.parse(items)\n\n if (!Array.isArray(parsed) || !parsed.every(isHistoryItem)) {\n return []\n }\n\n return parsed\n } catch {\n return []\n }\n}\n\nfunction isHistoryItem(x: unknown): x is HistoryItem {\n if (typeof x !== 'object' || x === null) {\n return false\n }\n\n return 'createdAt' in x && 'hash' in x\n}\n\nexport function determineHistoryName(hash: string, indexDocument?: string | null): string {\n if (indexDocument === 'index.html') {\n return `Website ${shortenHash(hash, 4)}`\n } else if (indexDocument) {\n return indexDocument\n }\n\n return `Folder ${shortenHash(hash, 4)}`\n}\n","export function shortenHash(hash: string, sliceLength = 8): string {\n return `${hash.slice(0, sliceLength)}[…]${hash.slice(-sliceLength)}`\n}\n","import { ReactElement, useEffect, useState } from 'react'\nimport { getPrettyDateString } from '../utils/date'\nimport { getHistorySafe, HistoryItem, HISTORY_KEYS } from '../utils/local-storage'\nimport ExpandableList from './ExpandableList'\nimport ExpandableListItemLink from './ExpandableListItemLink'\n\ninterface Props {\n title: string\n localStorageKey: HISTORY_KEYS\n}\n\nexport function History({ title, localStorageKey }: Props): ReactElement | null {\n const [items, setItems] = useState([])\n\n useEffect(() => {\n setItems(getHistorySafe(localStorageKey))\n }, [localStorageKey])\n\n if (!items.length) {\n return null\n }\n\n return (\n \n {items.map((x, i) => (\n \n ))}\n \n )\n}\n","export function getPrettyDateString(date: Date): string {\n const string = date.toString()\n\n return string.split('GMT')[0].trim()\n}\n","import { createStyles, makeStyles, Tab, Tabs, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { ROUTES } from '../../routes'\n\ninterface Props {\n active: 'UPLOAD' | 'DOWNLOAD'\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n marginBottom: theme.spacing(4),\n },\n leftTab: {\n marginRight: theme.spacing(0.5),\n },\n rightTab: {\n marginLeft: theme.spacing(0.5),\n },\n }),\n)\n\nexport function FileNavigation({ active }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function onChange(event: React.ChangeEvent>, newValue: number) {\n navigate(newValue === 1 ? ROUTES.DOWNLOAD : ROUTES.UPLOAD)\n }\n\n return (\n
\n \n \n \n \n
\n )\n}\n","import { Utils } from '@ethersphere/bee-js'\nimport { ManifestJs } from '@ethersphere/manifest-js'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { History } from '../../components/History'\nimport { Context, defaultUploadOrigin } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { extractSwarmHash } from '../../utils'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\n\nexport function Download(): ReactElement {\n const [loading, setLoading] = useState(false)\n const { beeApi } = useContext(SettingsContext)\n const [referenceError, setReferenceError] = useState(undefined)\n\n const { setUploadOrigin } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n const validateChange = (value: string) => {\n if (Utils.isHexString(value, 64) || Utils.isHexString(value, 128) || !value.trim().length) {\n setReferenceError(undefined)\n } else {\n setReferenceError('Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.')\n }\n }\n\n async function onSwarmIdentifier(identifier: string) {\n setLoading(true)\n\n if (!beeApi) {\n setLoading(false)\n\n return\n }\n\n try {\n const manifestJs = new ManifestJs(beeApi)\n const feedIdentifier = await manifestJs.resolveFeedManifest(identifier)\n\n if (feedIdentifier) {\n identifier = feedIdentifier\n }\n const isManifest = await manifestJs.isManifest(identifier)\n\n if (!isManifest) {\n throw Error('The specified hash does not contain valid content.')\n }\n const indexDocument = await manifestJs.getIndexDocumentPath(identifier)\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, identifier, determineHistoryName(identifier, indexDocument))\n setUploadOrigin(defaultUploadOrigin)\n navigate(ROUTES.HASH.replace(':hash', identifier))\n } catch (error: unknown) {\n let message = typeof error === 'object' && error !== null && Reflect.get(error, 'message')\n\n if (message.includes('path address not found')) {\n message = 'The specified hash does not have an index document set.'\n }\n\n if (message.includes('Not Found: Not Found')) {\n message = 'The specified hash was not found.'\n }\n enqueueSnackbar(Error: {message || 'Unknown'}, { variant: 'error' })\n } finally {\n setLoading(false)\n }\n }\n\n function recognizeSwarmHash(value: string) {\n if (value.length < 64) {\n return value\n }\n\n const hash = extractSwarmHash(value)\n\n if (hash) {\n return hash\n }\n\n return value\n }\n\n return (\n <>\n \n onSwarmIdentifier(value)}\n onChange={validateChange}\n helperText={referenceError}\n confirmLabel={'Find'}\n confirmLabelDisabled={Boolean(referenceError) || loading}\n placeholder=\"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605\"\n expandedOnly\n mapperFn={value => recognizeSwarmHash(value)}\n loading={loading}\n />\n \n \n )\n}\n","import { CircularProgress, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nexport function Loading(): ReactElement {\n return (\n \n \n \n )\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n image: {\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n },\n }),\n)\n\ninterface Props {\n alt: string\n src: string | undefined\n maxHeight?: string\n maxWidth?: string\n}\n\nexport function FitImage(props: Props): ReactElement {\n const classes = useStyles()\n\n const inlineStyles: Record = {}\n\n props.maxHeight && (inlineStyles.maxHeight = props.maxHeight)\n props.maxWidth && (inlineStyles.maxWidth = props.maxWidth)\n\n return {props.alt}\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n width: '175px',\n height: '175px',\n background: `repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )`,\n },\n }),\n)\n\nexport function StripedWrapper({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return
{children}
\n}\n","import { ReactElement } from 'react'\nimport { StripedWrapper } from '../../components/StripedWrapper'\n\ninterface Props {\n icon: ReactElement\n}\n\nexport function AssetIcon({ icon }: Props): ReactElement {\n return {icon}\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Web } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { File, Folder } from 'react-feather'\nimport { FitImage } from '../../components/FitImage'\nimport { shortenText } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { shortenHash } from '../../utils/hash'\nimport { AssetIcon } from './AssetIcon'\n\ninterface Props {\n previewUri?: string\n metadata?: Metadata\n}\n\n// TODO: add optional prop for indexDocument when it is already known (e.g. downloading a manifest)\n\nexport function AssetPreview({ metadata, previewUri }: Props): ReactElement | null {\n let previewComponent = \n let type = metadata?.type\n\n if (metadata?.isWebsite) {\n previewComponent = \n type = 'Website'\n } else if (metadata?.type === 'folder') {\n previewComponent = \n type = 'Folder'\n }\n\n return (\n \n \n \n {previewUri ? (\n \n ) : (\n \n )}\n \n {metadata?.hash && Swarm Hash: {shortenHash(metadata.hash)}}\n {metadata?.name && metadata?.name !== metadata?.hash && (\n \n {metadata?.type === 'folder' ? 'Folder Name' : 'Filename'}: {shortenText(metadata?.name)}\n \n )}\n Kind: {type}\n {metadata?.size ? Size: {getHumanReadableFileSize(metadata.size)} : null}\n \n \n \n {metadata?.type === 'folder' && metadata.count && (\n \n \n Folder content\n {metadata.count} items\n \n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\n\ninterface Props {\n isWebsite?: boolean\n hash: string\n}\n\nexport function AssetSummary({ isWebsite, hash }: Props): ReactElement {\n return (\n <>\n \n \n \n {isWebsite && (\n \n )}\n \n \n The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided\n for testing purposes only. Learn more at{' '}\n https://gateway.ethswarm.org/.\n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Bookmark, Download, Link, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n onOpen: () => void\n onCancel: () => void\n onDownload: () => void\n onUpdateFeed: () => void\n hasIndexDocument: boolean\n loading: boolean\n}\n\nexport function DownloadActionBar({\n onOpen,\n onCancel,\n onDownload,\n onUpdateFeed,\n hasIndexDocument,\n loading,\n}: Props): ReactElement {\n return (\n \n \n {hasIndexDocument && (\n \n View Website\n \n )}\n \n Download\n \n \n Close\n \n \n \n \n Update Feed\n \n \n \n )\n}\n","import { ManifestJs } from '@ethersphere/manifest-js'\nimport { Box, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport JSZip from 'jszip'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate, useParams } from 'react-router-dom'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { Loading } from '../../components/Loading'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport config from '../../config'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { AssetPreview } from './AssetPreview'\nimport { AssetSummary } from './AssetSummary'\nimport { DownloadActionBar } from './DownloadActionBar'\n\nexport function Share(): ReactElement {\n const { apiUrl, beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const { hash } = useParams()\n const reference = hash! // eslint-disable-line\n\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n\n const [loading, setLoading] = useState(true)\n const [downloading, setDownloading] = useState(false)\n const [swarmEntries, setSwarmEntries] = useState>({})\n const [indexDocument, setIndexDocument] = useState(null)\n const [notFound, setNotFound] = useState(false)\n const [preview, setPreview] = useState(undefined)\n const [metadata, setMetadata] = useState()\n\n async function prepare() {\n if (!beeApi || !status.all) {\n return\n }\n\n const manifestJs = new ManifestJs(beeApi)\n const isManifest = await manifestJs.isManifest(reference)\n\n if (!isManifest) {\n setNotFound(true)\n enqueueSnackbar('The specified hash does not contain valid content.', { variant: 'error' })\n\n return\n }\n const entries = await manifestJs.getHashes(reference)\n const indexDocument = await manifestJs.getIndexDocumentPath(reference)\n setIndexDocument(indexDocument)\n\n const previewFile = entries[PREVIEW_FILE_NAME]\n\n delete entries[META_FILE_NAME]\n delete entries[PREVIEW_FILE_NAME]\n setSwarmEntries(entries)\n\n const count = Object.keys(entries).length\n\n let metadata: Metadata | undefined = {\n hash,\n size: 0,\n type: count > 1 ? 'folder' : 'unknown',\n name: reference,\n isWebsite: Boolean(indexDocument) && count > 1,\n count,\n }\n\n try {\n const mtdt = await beeApi.downloadFile(reference, META_FILE_NAME)\n const remoteMetadata = mtdt.data.text()\n metadata = { ...metadata, ...(JSON.parse(remoteMetadata) as Metadata) }\n } catch (e) {} // eslint-disable-line no-empty\n\n if (previewFile) {\n setPreview(`${config.BEE_API_HOST}/bzz/${reference}/${PREVIEW_FILE_NAME}`)\n }\n\n setMetadata(metadata)\n }\n\n function onOpen() {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n }\n\n function onClose() {\n if (navigate.length > 0) {\n // There is at least one different route in browser history that we can return to\n navigate(-1)\n } else {\n // This is the first page user opened, navigate to upload page instead of going back\n navigate(ROUTES.UPLOAD)\n }\n }\n\n function onUpdateFeed() {\n navigate(ROUTES.FEEDS_UPDATE.replace(':hash', reference))\n }\n\n useEffect(() => {\n setLoading(true)\n prepare().finally(() => {\n setLoading(false)\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reference])\n\n async function onDownload() {\n if (!beeApi) {\n return\n }\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, reference, determineHistoryName(reference, indexDocument))\n setDownloading(true)\n\n if (Object.keys(swarmEntries).length === 1) {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n } else {\n const zip = new JSZip()\n for (const [path, hash] of Object.entries(swarmEntries)) {\n zip.file(path, await beeApi.downloadData(hash))\n }\n const content = await zip.generateAsync({ type: 'blob' })\n saveAs(content, reference + '.zip')\n }\n setDownloading(false)\n }\n\n if (!status.all) return \n\n if (loading) {\n return \n }\n\n if (notFound) {\n return (\n <>\n Not Found\n The specified hash is not found.\n \n )\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n steps: string[]\n index: number\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n height: '52px',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n todo: {\n background: '#f7f7f7',\n color: '#c9c9c9',\n },\n inProgress: {\n background: '#ffffff',\n color: '#242424',\n height: '52px',\n },\n done: {\n background: '#f7f7f7',\n color: '#606060',\n height: '52px',\n },\n }),\n)\n\nexport function ProgressIndicator({ steps, index }: Props): ReactElement {\n const classes = useStyles()\n\n function pickClass(i: number): string {\n if (i === index) {\n return classes.inProgress\n }\n\n return i < index ? classes.done : classes.todo\n }\n\n return (\n \n {steps.map((x, i) => (\n
\n {x}\n
\n ))}\n
\n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport BigNumber from 'bignumber.js'\nimport { Form, Formik, FormikHelpers } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext } from 'react'\nimport { Check } from 'react-feather'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { calculateStampPrice, convertAmountToSeconds, convertDepthToBytes, secondsToTimeString } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\n\ninterface FormValues {\n depth?: string\n amount?: string\n label?: string\n}\ntype FormErrors = Partial\nconst initialFormValues: FormValues = {\n depth: '',\n amount: '',\n label: '',\n}\n\ninterface Props {\n onFinished: () => void\n}\n\nexport function PostageStampCreation({ onFinished }: Props): ReactElement {\n const { chainState } = useContext(BeeContext)\n const { refresh } = useContext(StampsContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { enqueueSnackbar } = useSnackbar()\n\n function getFileSize(depth: number): string {\n if (isNaN(depth) || depth < 17 || depth > 255) {\n return '-'\n }\n\n return `~${getHumanReadableFileSize(convertDepthToBytes(depth))}`\n }\n\n function getTtl(amount: number): string {\n const isCurrentPriceAvailable = chainState && chainState.currentPrice\n\n if (amount <= 0 || !isCurrentPriceAvailable) {\n return '-'\n }\n\n const pricePerBlock = Number.parseInt(chainState.currentPrice, 10)\n\n return `${secondsToTimeString(convertAmountToSeconds(amount, pricePerBlock))} (with price of 0 per block)`\n }\n\n function getPrice(depth: number, amount: bigint): string {\n const hasInvalidInput = amount <= 0 || isNaN(depth) || depth < 17 || depth > 255\n\n if (hasInvalidInput) {\n return '-'\n }\n\n const price = calculateStampPrice(depth, amount)\n\n return `${price.toSignificantDigits()} BZZ`\n }\n\n return (\n ) => {\n try {\n // This is really just a typeguard, the validation pretty much guarantees these will have the right values\n if (!values.depth || !values.amount) return\n\n if (!beeDebugApi) return\n\n const amount = BigInt(values.amount)\n const depth = Number.parseInt(values.depth)\n const options = values.label ? { label: values.label } : undefined\n await beeDebugApi.createPostageBatch(amount.toString(), depth, options)\n actions.resetForm()\n await refresh()\n onFinished()\n } catch (e) {\n enqueueSnackbar(`Error: ${(e as Error).message}`, { variant: 'error' })\n actions.setSubmitting(false)\n }\n }}\n validate={(values: FormValues) => {\n const errors: FormErrors = {}\n\n // Depth\n if (!values.depth) errors.depth = 'Required field'\n else {\n const depth = new BigNumber(values.depth)\n\n if (!depth.isInteger()) errors.depth = 'Depth must be an integer'\n else if (depth.isLessThan(16)) errors.depth = 'Minimal depth is 16'\n else if (depth.isGreaterThan(255)) errors.depth = 'Depth has to be at most 255'\n }\n\n // Amount\n if (!values.amount) errors.amount = 'Required field'\n else {\n const amount = new BigNumber(values.amount)\n\n if (!amount.isInteger()) errors.amount = 'Amount must be an integer'\n else if (amount.isLessThanOrEqualTo(0)) errors.amount = 'Amount must be greater than 0'\n }\n\n // Label\n if (values.label && !/^[0-9a-z]*$/i.test(values.label)) errors.label = 'Label must be an alphanumeric string'\n\n return errors\n }}\n >\n {({ submitForm, isValid, isSubmitting, values }) => (\n
\n \n \n \n \n Corresponding file size\n {getFileSize(parseInt(values.depth || '0', 10))}\n \n \n \n \n \n \n \n Corresponding TTL (Time to live)\n {getTtl(Number.parseInt(values.amount || '0', 10))}\n \n \n \n \n \n \n \n \n Indicative Price\n {getPrice(parseInt(values.depth || '0', 10), BigInt(values.amount || '0'))}\n \n \n \n Buy New Stamp\n \n \n )}\n \n )\n}\n","import React, { ReactElement, useContext } from 'react'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { Context, EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n onSelect: (stamp: EnrichedPostageBatch) => void\n defaultValue?: string\n}\n\nexport function PostageStampSelector({ onSelect, defaultValue }: Props): ReactElement {\n const { stamps } = useContext(Context)\n\n function onChange(stampId: string) {\n if (!stamps) {\n return\n }\n const stamp = stamps.find(x => x.batchID === stampId)\n\n if (stamp) {\n onSelect(stamp)\n }\n }\n\n return (\n ({ label: x.batchID.slice(0, 8), value: x.batchID }))}\n onChange={event => onChange(event.target.value as string)}\n defaultValue={defaultValue}\n />\n )\n}\n","import { ReactElement } from 'react'\n\ninterface Props {\n width: string\n usage: number\n}\n\nexport function Capacity({ width, usage }: Props): ReactElement {\n const integerUsage = Math.round(usage * 100)\n const used = integerUsage + '%'\n const free = 100 - 2 - integerUsage + '%'\n\n return (\n
\n
\n
\n
\n
\n
\n
\n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Capacity } from '../../components/Capacity'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n shorten?: boolean\n}\n\nexport function PostageStamp({ stamp, shorten }: Props): ReactElement {\n return (\n \n \n {shorten ? stamp.batchID.slice(0, 8) : stamp.batchID}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { PostageStamp } from '../stamps/PostageStamp'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n}\n\nexport function StampPreview({ stamp }: Props): ReactElement {\n return (\n \n \n Associated postage stamp:\n \n \n \n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { ArrowLeft, Check, Layers, PlusSquare, X } from 'react-feather'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n step: number\n onUpload: () => void\n onCancel: () => void\n onGoBack: () => void\n onProceed: () => void\n isUploading: boolean\n hasStamp: boolean\n uploadLabel: string\n stampMode: 'BUY' | 'SELECT'\n setStampMode: (mode: 'BUY' | 'SELECT') => void\n}\n\nexport function UploadActionBar({\n step,\n onUpload,\n onCancel,\n onGoBack,\n onProceed,\n isUploading,\n hasStamp,\n uploadLabel,\n stampMode,\n setStampMode,\n}: Props): ReactElement {\n if (step === 0) {\n return (\n <>\n \n \n \n Add Postage Stamp\n \n \n Cancel\n \n \n \n You need a postage stamp to upload.\n \n )\n }\n\n if (step === 1) {\n return (\n \n \n {stampMode === 'SELECT' && (\n \n Proceed With Selected Stamp\n \n )}\n \n Back To Preview\n \n \n setStampMode(stampMode === 'BUY' ? 'SELECT' : 'BUY')}\n iconType={stampMode === 'BUY' ? Layers : PlusSquare}\n >\n {stampMode === 'BUY' ? 'Use Existing Stamp' : 'Buy New Stamp'}\n \n \n )\n }\n\n if (step === 2) {\n return (\n \n \n {uploadLabel}\n \n \n Change Postage Stamp\n \n \n )\n }\n\n return <>\n}\n","import { Box } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ProgressIndicator } from '../../components/ProgressIndicator'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as FileContext } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext, EnrichedPostageBatch } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml, getAssetNameFromFiles, packageFile } from '../../utils/file'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FeedPasswordDialog } from '../feeds/FeedPasswordDialog'\nimport { PostageStampCreation } from '../stamps/PostageStampCreation'\nimport { PostageStampSelector } from '../stamps/PostageStampSelector'\nimport { AssetPreview } from './AssetPreview'\nimport { StampPreview } from './StampPreview'\nimport { UploadActionBar } from './UploadActionBar'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\n\nexport function Upload(): ReactElement {\n const [step, setStep] = useState(0)\n const [stampMode, setStampMode] = useState<'SELECT' | 'BUY'>('SELECT')\n const [stamp, setStamp] = useState(null)\n const [isUploading, setUploading] = useState(false)\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const { refresh } = useContext(StampsContext)\n const { beeApi } = useContext(SettingsContext)\n const { files, setFiles, uploadOrigin, metadata, previewUri, previewBlob } = useContext(FileContext)\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n if (!files.length) {\n setFiles([])\n navigate(ROUTES.UPLOAD, { replace: true })\n\n return <>\n }\n\n const identity = uploadOrigin.uuid ? identities.find(x => x.uuid === uploadOrigin.uuid) : null\n\n const onUpload = () => {\n if (uploadOrigin.origin === 'UPLOAD') {\n uploadFiles()\n } else {\n if ((identity as Identity).type === 'PRIVATE_KEY') {\n uploadFiles()\n } else {\n setShowPasswordPrompt(true)\n }\n }\n }\n\n const uploadFiles = (password?: string) => {\n if (!beeApi || !files.length || !stamp || !metadata) {\n return\n }\n\n let fls = files.map(packageFile) // Apart from packaging, this is needed to not modify the original files array as it can trigger effects\n let indexDocument: string | undefined = undefined // This means we assume it's folder\n\n if (files.length === 1) indexDocument = files[0].name\n else if (files.length > 1) {\n const idx = detectIndexHtml(files)\n\n // This is a website\n if (idx) {\n // The website is in some directory, remove it\n if (idx.commonPrefix) {\n const substrStart = idx.commonPrefix.length\n indexDocument = idx.indexPath.substr(substrStart)\n fls = fls.map(f => {\n const path = (f.path as string).substr(substrStart)\n\n return { ...f, path, webkitRelativePath: path, fullPath: path }\n })\n } else {\n // The website is not packed in a directory\n indexDocument = idx.indexPath\n }\n }\n }\n const lastModified = files[0].lastModified\n\n // We want to store only some metadata\n const mtd: SwarmMetadata = {\n name: metadata.name,\n size: metadata.size,\n }\n\n // Type of the file only makes sense for a single file\n if (files.length === 1) mtd.type = metadata.type\n\n const metafile = new File([JSON.stringify(mtd)], META_FILE_NAME, {\n type: 'application/json',\n lastModified,\n })\n fls.push(packageFile(metafile))\n\n if (previewBlob) {\n const previewFile = new File([previewBlob], PREVIEW_FILE_NAME, {\n type: 'image/jpeg',\n lastModified,\n })\n fls.push(packageFile(previewFile))\n }\n\n setUploading(true)\n\n beeApi\n .uploadFiles(stamp.batchID, fls, { indexDocument })\n .then(hash => {\n putHistory(HISTORY_KEYS.UPLOAD_HISTORY, hash.reference, getAssetNameFromFiles(files))\n\n if (uploadOrigin.origin === 'UPLOAD') {\n navigate(ROUTES.HASH.replace(':hash', hash.reference), { replace: true })\n } else {\n updateFeed(beeApi, identity as Identity, hash.reference, stamp.batchID, password as string).then(() => {\n persistIdentity(identities, identity as Identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uploadOrigin.uuid as string), { replace: true })\n })\n }\n })\n .catch(e => {\n enqueueSnackbar(`Error uploading: ${e.message}`, { variant: 'error' })\n setUploading(false)\n })\n }\n\n const reset = () => {\n setStep(0)\n setFiles([])\n setStamp(null)\n setUploading(false)\n }\n\n const onFeedPasswordGiven = (password: string) => {\n uploadFiles(password)\n }\n\n return (\n <>\n {showPasswordPrompt && (\n setShowPasswordPrompt(false)}\n onProceed={onFeedPasswordGiven}\n />\n )}\n {identity && {`Update \"${identity.name}\"`}}\n {!identity && Upload}\n \n \n \n {(step === 0 || step === 2) && }\n {step === 1 && (\n <>\n \n {stampMode === 'SELECT' ? (\n setStamp(stamp)} defaultValue={stamp?.batchID} />\n ) : (\n setStampMode('SELECT')} />\n )}\n \n \n \n Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand these values.\n \n \n \n )}\n {step === 2 && stamp && }\n setStep(step => step - 1)}\n onProceed={() => setStep(step => step + 1)}\n onUpload={onUpload}\n isUploading={isUploading}\n hasStamp={Boolean(stamp)}\n uploadLabel={identity ? 'Update Feed' : 'Upload To Your Node'}\n stampMode={stampMode}\n setStampMode={setStampMode}\n />\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { History } from '../../components/History'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { defaultUploadOrigin } from '../../providers/File'\nimport { HISTORY_KEYS } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\nimport { UploadArea } from './UploadArea'\n\nexport function UploadLander(): ReactElement {\n const { status } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n <>\n \n \n \n \n )\n}\n","const OPTIMAL_CONNECTED_PEERS = 200\nconst OPTIMAL_POPULATION = 100000\nconst OPTIMAL_DEPTH = 12\n\ninterface Threshold {\n minimumValue: number\n explanation: string\n score: number\n}\n\ntype Thresholds = {\n connectedPeers: Threshold[]\n population: Threshold[]\n depth: Threshold[]\n}\n\ntype ThresholdValue = {\n score: number\n maximumScore: number\n explanation: string\n}\n\nexport type ThresholdValues = {\n connectedPeers: ThresholdValue\n population: ThresholdValue\n depth: ThresholdValue\n}\n\nconst GENERIC_ERROR = 'There may be issues with your Bee node or connection.'\n\nconst THRESHOLDS: Thresholds = {\n connectedPeers: [\n {\n minimumValue: OPTIMAL_CONNECTED_PEERS,\n explanation: `Perfect! ${OPTIMAL_CONNECTED_PEERS} or more connected peers indicate a healthy topology.`,\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is connected to peers, but this number should ideally be above ${OPTIMAL_CONNECTED_PEERS}. If you have only started your Bee node, this number may increase quickly.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not connected to any peers. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n population: [\n {\n minimumValue: OPTIMAL_POPULATION,\n explanation:\n 'Perfect! Your Bee node seems to have a realistic value for the network size, which means everything is working well on your end.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Population is usually above ${OPTIMAL_POPULATION.toLocaleString()}. If the number does not increase within a few hours, there may be issues with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has no information on the network population. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n depth: [\n {\n minimumValue: OPTIMAL_DEPTH,\n explanation: 'Perfect! Your Bee node has the highest available depth.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is supposed to reach a depth of ${OPTIMAL_DEPTH} eventually. Stagnation or decrease in this number may indicate problems with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not started building its topology yet. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n}\n\nexport function pickThreshold(key: keyof Thresholds, value: number): ThresholdValue {\n const thresholds = THRESHOLDS[key]\n const maximumScore = thresholds[0].score\n for (const item of thresholds) {\n if (value >= item.minimumValue) {\n return {\n score: item.score,\n maximumScore,\n explanation: item.explanation,\n }\n }\n }\n const last = thresholds[thresholds.length - 1]\n\n return {\n score: last.score,\n maximumScore,\n explanation: last.explanation,\n }\n}\n","import type { Topology } from '@ethersphere/bee-js'\nimport type { ReactElement } from 'react'\nimport { pickThreshold, ThresholdValues } from '../utils/threshold'\nimport ExpandableListItem from './ExpandableListItem'\n\ninterface Props {\n topology: Topology | null\n}\n\nconst TopologyStats = (props: Props): ReactElement => {\n const thresholds: ThresholdValues = {\n connectedPeers: pickThreshold('connectedPeers', props.topology?.connected || 0),\n population: pickThreshold('population', props.topology?.population || 0),\n depth: pickThreshold('depth', props.topology?.depth || 0),\n }\n\n const maximumTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.maximumScore, 0)\n const actualTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.score, 0)\n const percentageText = Math.round((actualTotalScore / maximumTotalScore) * 100) + '%'\n\n return (\n <>\n \n \n \n \n \n )\n}\n\nexport default TopologyStats\n","import { Button } from '@material-ui/core'\nimport { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport TopologyStats from '../../components/TopologyStats'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\n\nexport default function Status(): ReactElement {\n const {\n nodeInfo,\n status,\n latestUserVersion,\n isLatestBeeVersion,\n latestBeeVersionUrl,\n topology,\n nodeAddresses,\n chequebookAddress,\n } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n
\n \n \n \n \n Bee\n \n {` ${latestUserVersion || '-'} `}\n \n
\n }\n />\n \n \n \n\n \n {nodeAddresses?.underlay.map(addr => (\n \n ))}\n \n \n \n \n \n \n \n \n \n
\n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { Context as SettingsContext } from '../../providers/Settings'\n\nexport default function Settings(): ReactElement {\n const { apiUrl, apiDebugUrl, setApiUrl, setDebugApiUrl, lockedApiSettings } = useContext(SettingsContext)\n\n return (\n \n \n \n \n )\n}\n","import { Collapse, ListItem } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\nimport { ReactElement, ReactNode, useState } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children: ReactNode\n expandable: ReactNode\n defaultOpen?: boolean\n}\n\nexport default function ExpandableElement({ children, expandable, defaultOpen }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n return (\n
\n \n {children}\n {open ? : }\n \n \n
{expandable}
\n
\n
\n )\n}\n","import type { ReactElement } from 'react'\nimport ExpandableElement from '../../components/ExpandableElement'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { PostageStamp } from './PostageStamp'\n\ninterface Props {\n postageStamps: EnrichedPostageBatch[] | null\n}\n\nfunction StampsTable({ postageStamps }: Props): ReactElement | null {\n if (postageStamps === null) return null\n\n return (\n \n {postageStamps.map(stamp => (\n \n \n \n \n \n \n }\n >\n \n \n ))}\n \n )\n}\n\nexport default StampsTable\n","import { CircularProgress, Container } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport { ReactElement, useContext, useEffect } from 'react'\nimport { PlusSquare } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport StampsTable from './StampsTable'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n root: {\n width: '100%',\n display: 'grid',\n },\n actions: {\n display: 'flex',\n width: '100%',\n flex: '0 1 auto',\n flexWrap: 'wrap',\n alignItems: 'center',\n },\n }),\n)\n\nexport default function Stamp(): ReactElement {\n const classes = useStyles()\n\n const navigate = useNavigate()\n\n const { stamps, isLoading, error, start, stop } = useContext(StampsContext)\n const { status } = useContext(BeeContext)\n\n useEffect(() => {\n if (!status.all) return\n start()\n\n return () => stop()\n }, [status]) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n function navigateToNewStamp() {\n navigate(ROUTES.STAMPS_NEW)\n }\n\n return (\n
\n {error && (\n \n Error loading postage stamps details: {error.message}\n \n )}\n {!error && (\n <>\n
\n \n Buy New Postage Stamp\n \n
{isLoading && }
\n
\n \n \n )}\n
\n )\n}\n","import { ReactElement } from 'react'\nimport { useNavigate } from 'react-router'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ROUTES } from '../../routes'\nimport { PostageStampCreation } from './PostageStampCreation'\n\nexport function CreatePostageStampPage(): ReactElement {\n const navigate = useNavigate()\n\n function onFinished() {\n navigate(ROUTES.STAMPS)\n }\n\n return (\n
\n Buy new postage stamp\n \n
\n )\n}\n","import React, { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Tab, Tabs } from '@material-ui/core'\n\ninterface TabPanelProps {\n children?: ReactNode\n index: number\n value: number\n}\n\nfunction TabPanel(props: TabPanelProps) {\n const { children, value, index, ...other } = props\n\n return (\n \n )\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n },\n content: {\n marginTop: theme.spacing(2),\n },\n }),\n)\n\ninterface TabsValues {\n component: ReactNode\n label: ReactNode\n}\n\ninterface Props {\n values: TabsValues[]\n index?: number\n indexChanged?: (index: number) => void\n}\n\nexport default function SimpleTabs({ values, index, indexChanged }: Props): ReactElement {\n const classes = useStyles()\n const [value, setValue] = React.useState(index || 0)\n\n const handleChange = (event: React.ChangeEvent>, newValue: number) => {\n if (indexChanged) indexChanged(newValue)\n else setValue(newValue)\n }\n\n const v = index !== undefined ? index : value\n\n return (\n
\n \n {values.map(({ label }, idx) => (\n \n ))}\n \n
\n {values.map(({ component }, idx) => (\n \n {component}\n \n ))}\n
\n
\n )\n}\n","import { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\n\n// These need to be numeric values as they are used as indexes in the TabsContainer\nexport enum Platforms {\n macOS = 0,\n Linux,\n Windows,\n iOS,\n Android,\n}\n\nexport enum SupportedPlatforms {\n macOS = Platforms.macOS,\n Linux = Platforms.Linux,\n}\n\ninterface ContextInterface {\n platform: SupportedPlatforms\n setPlatform: (platform: SupportedPlatforms) => void\n}\n\nconst initialValues: ContextInterface = {\n platform: SupportedPlatforms.macOS,\n setPlatform: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction isSupportedPlatform(platform: unknown): platform is SupportedPlatforms {\n return Object.keys(SupportedPlatforms).includes(platform as string)\n}\n\nfunction getOS(): Platforms | null {\n const userAgent = window.navigator.userAgent\n const platform = window.navigator.platform\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']\n const iosPlatforms = ['iPhone', 'iPad', 'iPod']\n\n if (macosPlatforms.includes(platform)) return Platforms.macOS\n\n if (iosPlatforms.includes(platform)) return Platforms.iOS\n\n if (windowsPlatforms.includes(platform)) return Platforms.Windows\n\n if (/Android/.test(userAgent)) return Platforms.Android\n\n if (/Linux/.test(platform)) return Platforms.Linux\n\n return null\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [platform, setPlatform] = useState(SupportedPlatforms.Linux)\n\n // This is in useEffect as it really just needs to run once and not on each re-render\n useEffect(() => {\n const os = getOS()\n\n setPlatform(isSupportedPlatform(os) ? os : SupportedPlatforms.Linux)\n }, [])\n\n return {children}\n}\n","import type { ReactElement } from 'react'\nimport SyntaxHighlighter from 'react-syntax-highlighter'\n\ninterface Props {\n code: string\n language: string\n showLineNumbers?: boolean\n}\n\nconst CodeBlock = (props: Props): ReactElement => {\n return (\n
\n \n {props.code}\n \n
\n )\n}\n\nexport default CodeBlock\n","import { ReactElement, useContext } from 'react'\nimport TabsContainer from './TabsContainer'\nimport CodeBlock from './CodeBlock'\nimport { Context } from '../providers/Platform'\n\ninterface Props {\n linux: string\n mac: string\n showLineNumbers?: boolean\n}\n\nexport default function CodeBlockTabs(props: Props): ReactElement {\n const { platform, setPlatform } = useContext(Context)\n\n return (\n ,\n },\n {\n label: 'macOS',\n component: ,\n },\n ]}\n />\n )\n}\n","import type { ReactElement } from 'react'\nimport { CircularProgress } from '@material-ui/core'\n\ninterface Props {\n isOk: boolean\n isLoading?: boolean\n size?: number | string\n className?: string\n}\n\nexport default function StatusIcon({ isOk, size, className, isLoading }: Props): ReactElement {\n const s = size || '1rem'\n\n if (isLoading) return \n\n return (\n \n )\n}\n","import MuiAlert from '@material-ui/lab/Alert'\nimport { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\nimport { Context as SettingsContext } from '../../../providers/Settings'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { status, isLoading } = useContext(Context)\n const { setDebugApiUrl, apiDebugUrl } = useContext(SettingsContext)\n const isOk = status.debugApiConnection\n\n return (\n \n Connection to Bee Debug API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes debug API has been successful'\n : 'We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue.'}\n \n \n\n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1635 (or your custom\n specified port) is bound to localhost. If your node is not running try executing the below command to\n start your bee node\n
  • \n \n Your debug node API should never be completely open to the internet. If you want to connect remotely,\n make sure your firewall settings are set to only allow specific trusted IP addresses and block all\n other ports. A simple google search for "what is my ip" will show you your computers public\n IP address to allow.\n \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n
  • \n Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross\n Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter{' '}\n debug-api-enable must be set to true and{' '}\n cors-allowed-origins must be set to your host domain or IP (you can also use the\n wildcard {\"cors-allowed-origins: ['*']\"}). If edits are made to the configuration run the\n restart command below for changes to take effect.\n
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport { Context as SettingsContext } from '../../../providers/Settings'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { setApiUrl, apiUrl } = useContext(SettingsContext)\n const { status, isLoading } = useContext(Context)\n const isOk = status.apiConnection\n\n return (\n \n Connection to Bee API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes API has been successful'\n : 'Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it.'}\n \n \n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1633 (or your custom\n specified port) is exposed to the internet. If your node is not running try executing the below\n command to start your bee node\n
  • \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function VersionCheck(): ReactElement | null {\n const { status, isLoading, latestUserVersion, latestPublishedVersion, latestBeeVersionUrl } = useContext(Context)\n const isOk = status.version\n\n return (\n \n Bee Version\n \n }\n >\n \n {isOk ? (\n 'You are running the latest version of Bee.'\n ) : (\n <>\n Your Bee version is out of date. Please update to the{' '}\n \n latest\n {' '}\n before continuing. Rerun the installation script below to upgrade. For more information please see the{' '}\n \n Docs\n \n .\n \n \n )}\n \n \n \n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function EthereumConnectionCheck(): ReactElement | null {\n const { status, isLoading, nodeAddresses } = useContext(Context)\n const isOk = status.blockchainConnection\n\n return (\n \n Connection to Blockchain\n \n }\n >\n \n {isOk ? (\n 'Your node is connected to the xDai blockchain'\n ) : (\n <>\n Your Bee node must have access to the xDai blockchain, so that it can interact and deploy your chequebook\n contract. You can run{' '}\n \n your own xDai node\n \n , or use a provider instead - we recommend{' '}\n \n Getblock\n \n . By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change\n the swap-endpoint in your configuration file.\n \n )}\n \n {nodeAddresses?.ethereum && }\n \n )\n}\n","import { useContext } from 'react'\nimport DepositModal from '../../../containers/DepositModal'\nimport type { ReactElement } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemActions from '../../../components/ExpandableListItemActions'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nconst ChequebookDeployFund = (): ReactElement | null => {\n const { status, isLoading, chequebookAddress } = useContext(Context)\n const isOk = status.chequebook\n\n return (\n \n Chequebook Deployment & Funding\n \n }\n >\n \n {isOk ? (\n 'Your chequebook is deployed and funded'\n ) : (\n <>\n Your chequebook is either not deployed or funded. To run the node you will need xDAI and xBZZ on the xDai\n network. You may need to aquire BZZ (e.g. bzz.exchange) and bridge it to\n the xDai network through the omni bridge. To pay the\n transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai\n network through the xDai Bridge. See the{' '}\n official xDai website for more information.\n \n )}\n \n {chequebookAddress && (\n <>\n \n \n \n \n \n )}\n \n )\n}\n\nexport default ChequebookDeployFund\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport TopologyStats from '../../../components/TopologyStats'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function PeerConnection(): ReactElement | null {\n const { status, isLoading, topology } = useContext(Context)\n const isOk = status.topology\n\n return (\n \n Connection to Peers\n \n }\n >\n \n {isOk\n ? 'You are connected to other Bee nodes'\n : 'Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file.'}\n \n\n \n \n )\n}\n","import type { ReactElement } from 'react'\n\nimport DebugConnectionCheck from './SetupSteps/DebugConnectionCheck'\nimport NodeConnectionCheck from './SetupSteps/NodeConnectionCheck'\nimport VersionCheck from './SetupSteps/VersionCheck'\nimport EthereumConnectionCheck from './SetupSteps/EthereumConnectionCheck'\nimport ChequebookDeployFund from './SetupSteps/ChequebookDeployFund'\nimport PeerConnection from './SetupSteps/PeerConnection'\n\nexport default function NodeSetupWorkflow(): ReactElement {\n return (\n
    \n \n \n \n \n \n \n
    \n )\n}\n","export async function requestBzz(address: string): Promise {\n await fetch(`https://xbzz-faucet.apyos.dev/xbzz/${address}`, {\n method: 'POST',\n })\n}\n","import { Contract, providers } from 'ethers'\n\nconst PROVIDER = 'https://rpc.gnosischain.com/'\n\nasync function eth_getBalance(address: string): Promise {\n const response = await fetch(PROVIDER, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n jsonrpc: '2.0',\n method: 'eth_getBalance',\n params: [address, 'latest'],\n id: 1,\n }),\n })\n const json = await response.json()\n\n return json.result\n}\n\nconst partialERC20tokenABI = [\n {\n constant: true,\n inputs: [\n {\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n name: 'balance',\n type: 'uint256',\n },\n ],\n payable: false,\n type: 'function',\n },\n]\n\nconst provider = new providers.JsonRpcProvider(PROVIDER)\n\nasync function eth_getBalanceERC20(\n address: string,\n tokenAddress = '0xdbf3ea6f5bee45c02255b2c26a16f300502f68da',\n): Promise {\n const contract = new Contract(tokenAddress, partialERC20tokenABI, provider)\n const balance = await contract.balanceOf(address)\n\n return balance.toString()\n}\n\nexport const Rpc = {\n eth_getBalance,\n eth_getBalanceERC20,\n}\n","import type { ReactElement } from 'react'\nimport { Route, Routes } from 'react-router-dom'\nimport Accounting from './pages/accounting'\nimport Feeds from './pages/feeds'\nimport CreateNewFeed from './pages/feeds/CreateNewFeed'\nimport { FeedSubpage } from './pages/feeds/FeedSubpage'\nimport UpdateFeed from './pages/feeds/UpdateFeed'\nimport { Download } from './pages/files/Download'\nimport { Share } from './pages/files/Share'\nimport { Upload } from './pages/files/Upload'\nimport { UploadLander } from './pages/files/UploadLander'\nimport Info from './pages/info'\nimport Settings from './pages/settings'\nimport Stamps from './pages/stamps'\nimport { CreatePostageStampPage } from './pages/stamps/CreatePostageStampPage'\nimport Status from './pages/status'\nimport Upgrade from './pages/upgrade'\n\nexport enum ROUTES {\n INFO = '/',\n UPGRADE = '/upgrade',\n FILES = '/files',\n UPLOAD = '/files/upload',\n UPLOAD_IN_PROGRESS = '/files/upload/workflow',\n DOWNLOAD = '/files/download',\n HASH = '/files/hash/:hash',\n ACCOUNTING = '/accounting',\n SETTINGS = '/settings',\n STAMPS = '/stamps',\n STAMPS_NEW = '/stamps/new',\n STATUS = '/status',\n FEEDS = '/feeds',\n FEEDS_NEW = '/feeds/new',\n FEEDS_UPDATE = '/feeds/update/:hash',\n FEEDS_PAGE = '/feeds/:uuid',\n}\n\nconst BaseRouter = (): ReactElement => (\n \n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n \n)\n\nexport default BaseRouter\n","import { Box, Card, Typography } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { ArrowUp, Send } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { Loading } from '../../components/Loading'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Token } from '../../models/Token'\nimport { Context } from '../../providers/Bee'\nimport { requestBzz } from '../../utils/bzz-faucet'\nimport { Rpc } from '../../utils/rpc'\n\nexport default function UpgradePage(): ReactElement {\n const { nodeInfo, chequebookAddress, nodeAddresses } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n\n const [balance, setBalance] = useState(null)\n const [balanceBzz, setBalanceBzz] = useState(null)\n const [loading, setLoading] = useState(false)\n const [rpcProvider, setRpcProvider] = useState('https://rpc.gnosischain.com/')\n\n const port = parseInt(window.location.host.split(':')[1], 10)\n\n useEffect(() => {\n fetch(`http://localhost:${port}/status`)\n .then(response => response.json())\n .then(status => Rpc.eth_getBalance(status.address))\n .then(balance => setBalance(balance))\n\n fetch(`http://localhost:${port}/status`)\n .then(response => response.json())\n .then(status => Rpc.eth_getBalanceERC20(status.address))\n .then(balanceBzz => setBalanceBzz(balanceBzz))\n }, [port])\n\n async function onFund() {\n setLoading(true)\n try {\n const { address } = await fetch(`http://localhost:${port}/status`).then(response => response.json())\n await fetch(`http://getxdai.co/${address}/0.1`, {\n method: 'POST',\n })\n const balance = await Rpc.eth_getBalance(address)\n setBalance(balance)\n const balanceBzz = await Rpc.eth_getBalance(address)\n setBalanceBzz(balanceBzz)\n enqueueSnackbar('Wallet funded successfully', { variant: 'success' })\n } finally {\n setLoading(false)\n }\n }\n\n async function onChequebookBzzFund() {\n if (chequebookAddress?.chequebookAddress) {\n setLoading(true)\n await requestBzz(chequebookAddress?.chequebookAddress).finally(() => setLoading(false))\n enqueueSnackbar('Successfully funded chequebook address', { variant: 'success' })\n }\n }\n\n async function onOverlayBzzFund() {\n if (nodeAddresses?.ethereum) {\n setLoading(true)\n await requestBzz(nodeAddresses?.ethereum).finally(() => setLoading(false))\n enqueueSnackbar('Successfully funded overlay address', { variant: 'success' })\n }\n }\n\n async function onUpgrade() {\n setLoading(true)\n try {\n await fetch(`http://localhost:${port}/config`, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n 'chain-enable': true,\n 'swap-enable': true,\n 'swap-endpoint': rpcProvider,\n }),\n })\n await fetch(`http://localhost:${port}/restart`, {\n method: 'POST',\n })\n enqueueSnackbar('Restarting Bee in Light Mode...', { variant: 'success' })\n } finally {\n setLoading(false)\n }\n }\n\n if (!nodeInfo) {\n return \n }\n\n return (\n
    \n Upgrade\n \n \n \n \n Wallet\n \n \n \n Your current balance is {new Token(balance || '0', 18).toSignificantDigits(4)} xDAI and{' '}\n {new Token(balanceBzz || '0', 16).toSignificantDigits(4)} xBZZ. Fund your node with xDAI so chequebook\n can be deployed.\n \n \n \n \n Fund xDAI\n \n {chequebookAddress?.chequebookAddress &&\n chequebookAddress?.chequebookAddress !== '0x0000000000000000000000000000000000000000' && (\n \n Fund xBZZ (Chequebook)\n \n )}\n \n Fund xBZZ (Overlay)\n \n \n \n \n \n \n \n \n \n RPC Provider\n \n \n {\n setRpcProvider(event.target.value)\n }}\n />\n \n \n \n \n \n \n Upgrade Node\n {!balance && (\n \n Fund your node to unlock upgrading.\n \n )}\n \n \n Switch to Light Mode\n \n \n \n \n
    \n )\n}\n","import type { ReactElement, ReactNode } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\n\nimport { createStyles, Theme, makeStyles, withStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem } from '@material-ui/core'\n\nconst StyledListItem = withStyles((theme: Theme) => ({\n root: {\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n borderLeft: '4px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `4px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n },\n}))(ListItem)\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n activeIcon: {\n color: theme.palette.primary.main,\n },\n }),\n)\n\ninterface Props {\n iconStart?: ReactNode\n iconEnd?: ReactNode\n path?: string\n label: ReactNode\n}\n\nexport default function SideBarItem({ iconStart, iconEnd, path, label }: Props): ReactElement {\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n {iconStart}\n \n {iconEnd}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\nimport { ArrowRight } from 'react-feather'\n\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem, Typography } from '@material-ui/core'\nimport { Context } from '../providers/Bee'\nimport StatusIcon from './StatusIcon'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n\n root: {\n height: theme.spacing(4),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(4),\n color: '#f9f9f9',\n borderLeft: '0px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `0px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n },\n },\n rootError: {\n backgroundColor: 'rgba(255, 58, 82, 0.25)',\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n },\n },\n },\n smallerText: {\n fontSize: '0.9rem',\n },\n }),\n)\n\ninterface Props {\n path?: string\n}\n\nexport default function SideBarItem({ path }: Props): ReactElement {\n const { status, isLoading } = useContext(Context)\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n \n \n \n {`Node ${status.all ? 'OK' : 'Error'}`}}\n />\n \n {status.all ? null : }\n \n \n )\n}\n","import { Divider, Drawer, Grid, Link as MUILink, List } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { OpenInNewSharp } from '@material-ui/icons'\nimport type { ReactElement } from 'react'\nimport { ArrowUp, Bookmark, BookOpen, DollarSign, FileText, Home, Layers, Settings } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport Logo from '../assets/logo.svg'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\nimport SideBarItem from './SideBarItem'\nimport SideBarStatus from './SideBarStatus'\n\nconst navBarItems = [\n {\n label: 'Info',\n path: ROUTES.INFO,\n icon: Home,\n },\n {\n label: 'Upgrade',\n path: ROUTES.UPGRADE,\n icon: ArrowUp,\n },\n {\n label: 'Files',\n path: ROUTES.UPLOAD,\n icon: FileText,\n },\n {\n label: 'Feeds',\n path: ROUTES.FEEDS,\n icon: Bookmark,\n },\n {\n label: 'Stamps',\n path: ROUTES.STAMPS,\n icon: Layers,\n },\n {\n label: 'Accounting',\n path: ROUTES.ACCOUNTING,\n icon: DollarSign,\n },\n {\n label: 'Settings',\n path: ROUTES.SETTINGS,\n icon: Settings,\n },\n]\n\nconst drawerWidth = 300\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexWrap: 'nowrap',\n minHeight: '100vh',\n paddingTop: theme.spacing(8),\n paddingBottom: theme.spacing(8),\n },\n drawer: {\n width: drawerWidth,\n flexShrink: 0,\n },\n drawerPaper: {\n width: drawerWidth,\n backgroundColor: '#212121',\n },\n logo: {\n marginLeft: theme.spacing(8),\n marginRight: theme.spacing(8),\n },\n icon: {\n height: theme.spacing(4),\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n divider: {\n backgroundColor: '#2c2c2c',\n marginLeft: theme.spacing(4),\n marginRight: theme.spacing(4),\n },\n link: {\n color: '#9f9f9f',\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'none',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n textDecoration: 'none',\n },\n },\n },\n }),\n)\n\nexport default function SideBar(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n \n \"swarm\"\n \n \n \n \n {navBarItems.map(p => (\n \n }\n path={p.path}\n label={p.label}\n />\n \n ))}\n \n \n \n \n }\n iconEnd={}\n label={Docs}\n />\n \n \n \n \n \n \n \n \n \n \n )\n}\n","import { CircularProgress, Container } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, useContext } from 'react'\nimport ErrorBoundary from '../components/ErrorBoundary'\nimport SideBar from '../components/SideBar'\nimport { Context } from '../providers/Bee'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n content: {\n backgroundColor: theme.palette.background.default,\n minHeight: '100vh',\n },\n }),\n)\n\ninterface Props {\n children?: ReactElement\n}\n\nconst Dashboard = (props: Props): ReactElement => {\n const classes = useStyles()\n\n const { isLoading } = useContext(Context)\n\n return (\n
    \n \n \n \n <>\n {isLoading ? (\n
    \n \n
    \n ) : (\n props.children\n )}\n \n
    \n
    \n
    \n )\n}\n\nexport default Dashboard\n","import { createTheme, Theme } from '@material-ui/core/styles'\nimport { orange } from '@material-ui/core/colors'\n\ndeclare module '@material-ui/core/styles/createPalette' {\n interface TypeBackground {\n appBar: string\n }\n}\n\n// Overwriting default components styles\nconst componentsOverrides = (theme: Theme) => ({\n MuiListItem: {\n button: {\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n },\n },\n MuiContainer: {\n root: { padding: theme.spacing(8) },\n maxWidthXs: { padding: theme.spacing(8) },\n maxWidthSm: { padding: theme.spacing(8) },\n maxWidthMd: { padding: theme.spacing(8) },\n maxWidthLg: { padding: theme.spacing(8) },\n maxWidthXl: { padding: theme.spacing(8) },\n },\n MuiButton: {\n startIcon: { marginLeft: theme.spacing(1) },\n endIcon: { marginRight: theme.spacing(1) },\n outlined: {\n border: 'none',\n borderRadius: theme.spacing(10),\n color: theme.palette.primary.main,\n backgroundColor: '#fcf2e8',\n },\n outlinedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n outlinedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n contained: {\n padding: theme.spacing(2),\n backgroundColor: 'white',\n boxShadow: 'none',\n borderRadius: 0,\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n '&:focus': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:active': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:disabled': {\n backgroundColor: 'white',\n },\n },\n },\n MuiTab: {\n root: {\n backgroundColor: theme.palette.background.paper,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n opacity: 1,\n },\n '&$selected': {\n fontWeight: theme.typography.fontWeightMedium,\n },\n },\n textColorInherit: {\n opacity: 0.5,\n },\n },\n MuiTabs: {\n root: {\n borderBottom: 'none',\n },\n indicator: {\n backgroundColor: 'transparent',\n },\n },\n})\n\nconst propsOverrides = {\n MuiTab: {\n disableRipple: true,\n },\n MuiButtonBase: {\n disableRipple: true,\n },\n}\n\nexport const theme = createTheme({\n palette: {\n type: 'light',\n background: {\n default: '#efefef',\n },\n primary: {\n light: '#fcf2e8',\n main: '#dd7700',\n dark: orange[800],\n },\n secondary: {\n main: '#333333',\n },\n },\n typography: {\n fontFamily: ['Work Sans', 'Montserrat', 'Nunito', 'Roboto', '\"Helvetica Neue\"', 'Arial', 'sans-serif'].join(','),\n h1: {\n fontSize: '1.3rem',\n fontWeight: 500,\n },\n h2: {\n fontSize: '1rem',\n fontWeight: 500,\n },\n h3: {\n fontSize: '0.8rem',\n fontWeight: 500,\n },\n body2: {\n fontFamily: '\"IBM Plex Mono\", monospace',\n fontWeight: 500,\n fontSize: '1rem',\n },\n },\n})\n\ntheme.overrides = componentsOverrides(theme)\ntheme.props = propsOverrides\n","import CssBaseline from '@material-ui/core/CssBaseline'\nimport { ThemeProvider } from '@material-ui/core/styles'\nimport { SnackbarProvider } from 'notistack'\nimport React, { ReactElement } from 'react'\nimport { HashRouter as Router } from 'react-router-dom'\nimport './App.css'\nimport Dashboard from './layout/Dashboard'\nimport { Provider as BeeProvider } from './providers/Bee'\nimport { Provider as FeedsProvider } from './providers/Feeds'\nimport { Provider as FileProvider } from './providers/File'\nimport { Provider as PlatformProvider } from './providers/Platform'\nimport { Provider as SettingsProvider } from './providers/Settings'\nimport { Provider as StampsProvider } from './providers/Stamps'\nimport BaseRouter from './routes'\nimport { theme } from './theme'\n\ninterface Props {\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nconst App = ({ beeApiUrl, beeDebugApiUrl, lockedApiSettings }: Props): ReactElement => (\n
    \n \n \n \n \n \n \n \n \n \n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n)\n\nexport default App\n","import { ReportHandler } from 'web-vitals'\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler): void => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry)\n getFID(onPerfEntry)\n getFCP(onPerfEntry)\n getLCP(onPerfEntry)\n getTTFB(onPerfEntry)\n })\n }\n}\n\nexport default reportWebVitals\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root'),\n)\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/dashboard/static/js/main.cfa2d25c.chunk.js b/static/dashboard/static/js/main.cfa2d25c.chunk.js new file mode 100644 index 0000000..2e9cd53 --- /dev/null +++ b/static/dashboard/static/js/main.cfa2d25c.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{360:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},38:function(e,t,n){"use strict";n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"k",(function(){return b})),n.d(t,"h",(function(){return j})),n.d(t,"d",(function(){return h})),n.d(t,"l",(function(){return p})),n.d(t,"e",(function(){return O})),n.d(t,"i",(function(){return f})),n.d(t,"c",(function(){return x})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"j",(function(){return v}));var a=n(3),r=n.n(a),c=n(27),i=n(51),o=n(39);function s(e){return i.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function l(e){if(i.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new i.BigNumber(e);if("bigint"===typeof e)return new i.BigNumber(e.toString());if("number"===typeof e)return new i.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}function u(e){return d.apply(this,arguments)}function d(){return(d=Object(c.a)(r.a.mark((function e(t){return r.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)}function b(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"}))}}function j(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(c.a)(r.a.mark((function a(c,i){var o,s;return r.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:o=0;case 1:if(!(o>t/4).toString(16)}))}function O(e){return(e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replaceAll("_"," ")}function f(e){var t=e;return t<120?"".concat(e," seconds"):(t/=60)<120?"".concat(Math.round(t)," minutes"):(t/=60)<48?"".concat(Math.round(t)," hours"):(t/=24)<14?"".concat(Math.round(t)," days"):(t/=7)<52?"".concat(Math.round(t)," weeks"):"".concat((t/=52).toFixed(1)," years")}function x(e){return 4096*Math.pow(2,e)}function m(e,t){return 5*e/t}function g(e,t){return new o.a(t*BigInt(Math.pow(2,e)))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"[\u2026]";return e.length<=2*t+n.length?e:"".concat(e.slice(0,t)).concat(n).concat(e.slice(-t))}},39:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(12),r=n(13),c=n(51),i=n(38),o=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(a.a)(this,e),this.amount=void 0,this.decimals=void 0;var r=Object(i.g)(t);if(!Object(i.f)(r)||!o.includes(n))throw new TypeError("Not a valid token values");this.amount=r,this.decimals=n}return Object(r.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 c.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new c.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:"toSignificantDigits",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t=this.toDecimal.toFixed(16),n=-1,a=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:16,a=Object(i.g)(t),r=a.multipliedBy(new c.BigNumber(10).pow(n));return new e(r,n)}}]),e}()},409:function(e,t,n){},414:function(e,t,n){},483:function(e,t){},485:function(e,t){},497:function(e,t){},499:function(e,t){},525:function(e,t){},526:function(e,t){},53:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"f",(function(){return m}));var a=n(3),r=n.n(a),c=n(27),i=n(134),o=n.n(i),s=n(38);function l(){var t=new Uint8Array(32);return crypto.getRandomValues(t),new o.a(e.from(t))}function u(e,t){var n=e.findIndex((function(e){return e.uuid===t.uuid}));-1!==n&&e.splice(n,1),e.unshift(t),localStorage.setItem("feeds",JSON.stringify(e))}function d(e){localStorage.setItem("feeds",JSON.stringify(e))}function b(e,t,n,a){return j.apply(this,arguments)}function j(){return(j=Object(c.a)(r.a.mark((function e(t,n,a,c){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("V3"!==n||c){e.next=2;break}throw Error("V3 passwords require password");case 2:if("PRIVATE_KEY"!==n){e.next=6;break}e.t0=t.getPrivateKeyString(),e.next=9;break;case 6:return e.next=8,t.toV3String(c);case 8:e.t0=e.sent;case 9:return i=e.t0,e.abrupt("return",{uuid:Object(s.l)(),name:a,type:c?"V3":"PRIVATE_KEY",address:t.getAddressString(),identity:i});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e,t){return p.apply(this,arguments)}function p(){return(p=Object(c.a)(r.a.mark((function e(t,n){var a,c,i,o;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64!==n.length){e.next=5;break}return e.next=3,f("PRIVATE_KEY",n);case 3:return a=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:a.getAddressString()});case 5:if(66!==n.length||!n.toLowerCase().startsWith("0x")){e.next=10;break}return e.next=8,f("PRIVATE_KEY",n.slice(2));case 8:return c=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:c.getAddressString()});case 10:return e.prev=10,i=JSON.parse(n),o=i.address,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"V3",identity:n,address:o});case 15:return e.prev=15,e.t0=e.catch(10),e.abrupt("return",null);case 18:case"end":return e.stop()}}),e,null,[[10,15]])})))).apply(this,arguments)}function O(e,t){return f(e.type,e.identity,t)}function f(e,t,n){return x.apply(this,arguments)}function x(){return(x=Object(c.a)(r.a.mark((function t(n,a,c){return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("PRIVATE_KEY"!==n){t.next=4;break}t.t0=o.a.fromPrivateKey(e.from(v(a),"hex")),t.next=7;break;case 4:return t.next=6,o.a.fromV3(a,c);case 6:t.t0=t.sent;case 7:return t.abrupt("return",t.t0);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(e,t,n,a,r){return g.apply(this,arguments)}function g(){return(g=Object(c.a)(r.a.mark((function e(t,n,a,c,i){var o,s;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(n,i);case 2:if(o=e.sent,n.feedHash){e.next=7;break}return e.next=6,t.createFeedManifest(c,"sequence","00".repeat(32),o.getAddressString());case 6:n.feedHash=e.sent;case 7:return s=t.makeFeedWriter("sequence","00".repeat(32),o.getPrivateKeyString()),e.next=10,s.upload(c,a);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return e.toLowerCase().startsWith("0x")?e.slice(2):e}}).call(this,n(26).Buffer)},531:function(e,t){},533:function(e,t){},540:function(e,t){},558:function(e,t){},574:function(e,t){},579:function(e,t){},587:function(e,t){},589:function(e,t){},60:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var a=n(12);function r(t){return"object"===typeof e&&Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BEE_HOST:"http://localhost:1633",REACT_APP_BEE_DEBUG_HOST:"http://localhost:1635",REACT_APP_BEE_DOCS_HOST:"https://docs.ethswarm.org/docs/",REACT_APP_BEE_DISCORD_HOST:"https://discord.gg/eKr9XPv7",REACT_APP_BLOCKCHAIN_EXPLORER_URL:"https://blockscout.com/xdai/mainnet",REACT_APP_BEE_GITHUB_REPO_URL:"https://api.github.com/repos/ethersphere/bee"})[t]}var c=new function e(){Object(a.a)(this,e),this.BEE_API_HOST=void 0,this.BEE_DEBUG_API_HOST=void 0,this.BLOCKCHAIN_EXPLORER_URL=void 0,this.BEE_DOCS_HOST=void 0,this.BEE_DISCORD_HOST=void 0,this.GITHUB_REPO_URL=void 0,this.BEE_API_HOST=sessionStorage.getItem("api_host")||r("REACT_APP_BEE_HOST")||"http://localhost:1633",this.BEE_DEBUG_API_HOST=sessionStorage.getItem("debug_api_host")||r("REACT_APP_BEE_DEBUG_HOST")||"http://localhost:1635",this.BLOCKCHAIN_EXPLORER_URL=r("REACT_APP_BLOCKCHAIN_EXPLORER_URL")||"https://blockscout.com/xdai/mainnet",this.BEE_DOCS_HOST=r("REACT_APP_BEE_DOCS_HOST")||"https://docs.ethswarm.org/docs/",this.BEE_DISCORD_HOST=r("REACT_APP_BEE_DISCORD_HOST")||"https://discord.gg/eKr9XPv7",this.GITHUB_REPO_URL=r("REACT_APP_BEE_GITHUB_REPO_URL")||"https://api.github.com/repos/ethersphere/bee"};t.b=c}).call(this,n(30))},829:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(29),i=n.n(c),o=(n(409),n(945)),s=n(944),l=n(31),u=n(48),d=(n(414),n(900)),b=n(901),j=n(834),h=n(387),p=n(12),O=n(13),f=n(14),x=n(15),m=n(1),g=function(e){Object(f.a)(n,e);var t=Object(x.a)(n);function n(e){var a;return Object(p.a)(this,n),(a=t.call(this,e)).state={error:null},a}return Object(O.a)(n,[{key:"componentDidCatch",value:function(e,t){console.error({error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.error?Object(m.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),v=n(941),y=n(885),w=n(911),k=n(942),S=n(903),C=n(916),A=n(937),E=n(934),P=n(938),T=n(921),B=n(929),N=n(939),D=n(940),I=n(943),_=n.p+"static/media/logo.3d1155fe.svg",L=n(60),R=n(20),U=n(10),F=n(835),W=n(882),H=n(119),M=n(833),V=n(883),z=n(884),q=Object(j.a)((function(e){return Object(h.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function Y(e){var t=e.children,n=e.label,r=e.level,c=e.defaultOpen,i=e.info,o=q(),s=Object(a.useState)(Boolean(c)),l=Object(U.a)(s,2),u=l[0],d=l[1],b="",j="h1",h=o.contentLevel0;return 1===r?(b=o.rootLevel1,j="h2",h=o.contentLevel12):2===r&&(b=o.rootLevel2,j="h3",h=o.contentLevel12),Object(m.jsxs)("div",{className:"".concat(o.root," ").concat(b),children:[Object(m.jsxs)(F.a,{button:!0,onClick:function(){d(!u)},className:o.header,children:[Object(m.jsx)(W.a,{primary:Object(m.jsx)(H.a,{variant:j,children:n})}),Object(m.jsxs)("div",{style:{display:"flex"},children:[!u&&Object(m.jsx)(H.a,{variant:"body2",className:o.infoText,children:i}),u?Object(m.jsx)(V.a,{}):Object(m.jsx)(z.a,{})]})]}),Object(m.jsx)(M.a,{in:u,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)("div",{className:h,children:t})})]})}var Z=n(951),G=n(888),K=n(889),J=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),wordBreak:"break-word"},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}}})}));function X(e){var t=e.label,n=e.value,a=e.tooltip,r=J();return Object(m.jsx)(F.a,{className:r.header,children:Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(m.jsx)(H.a,{variant:"body1",children:t}),n&&Object(m.jsxs)(H.a,{variant:"body2",children:[n,a&&Object(m.jsx)(Z.a,{title:a,placement:"top",arrow:!0,children:Object(m.jsx)(G.a,{size:"small",className:r.copyValue,children:Object(m.jsx)(K.a,{strokeWidth:1})})})]})]})})}var $=Object(j.a)((function(e){return Object(h.a)({wrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap"},action:{marginBottom:e.spacing(1),marginRight:e.spacing(1)}})}));function Q(e){var t=e.children,n=$();return Array.isArray(t)?Object(m.jsx)("div",{className:n.wrapper,children:t.filter((function(e){return e})).map((function(e,t){return Object(m.jsx)("div",{className:n.action,children:e},t)}))}):Object(m.jsx)(y.a,{container:!0,direction:"row",children:Object(m.jsx)(y.a,{className:n.action,children:t})})}var ee=n(114),te=n.n(ee),ne=n(890),ae=n(891),re=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(2),marginBottom:e.spacing(2)},keyMargin:{marginRight:e.spacing(1)}})}));function ce(e){var t,n=e.label,r=e.value,c=re(),i=Object(a.useState)(!1),o=Object(U.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(!1),d=Object(U.a)(u,2),b=d[0],j=d[1],h=function(){return l(!s)},p=function(){return j(!0)},O=function(){return j(!1)},f=function(e){var t=function(e){return e.replace(/^0x/i,"").length}(e);return t%6===0?e.match(/(0x|.{6})/gi)||[]:e.match(/(0x|.{1,8})/gi)||[]}(r),x="string"===typeof(t=r)&&/^0x[0-9a-f]+$/i.test(t),g="".concat(x?"".concat(f[0]," ").concat(f[1]):f[0],"[\u2026]").concat(f[f.length-1]);return Object(m.jsx)(F.a,{className:"".concat(c.header," ").concat(s?c.headerOpen:""),children:Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[n&&Object(m.jsx)(H.a,{variant:"body1",children:n}),Object(m.jsx)(H.a,{variant:"body2",children:Object(m.jsxs)("div",{children:[!s&&Object(m.jsx)("span",{className:c.copyValue,children:Object(m.jsx)(Z.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:O,children:Object(m.jsx)(ee.CopyToClipboard,{text:r,children:Object(m.jsx)("span",{onClick:p,children:r?g:""})})})}),Object(m.jsx)(G.a,{size:"small",className:c.copyValue,children:s?Object(m.jsx)(ne.a,{onClick:h,strokeWidth:1}):Object(m.jsx)(ae.a,{onClick:h,strokeWidth:1})})]})})]}),Object(m.jsx)(M.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)("div",{className:c.content,children:Object(m.jsx)(Z.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:O,children:Object(m.jsx)(ee.CopyToClipboard,{text:r,children:Object(m.jsx)("span",{onClick:p,children:Object(m.jsx)("span",{className:c.copyValue,children:f.map((function(e,t){return Object(m.jsx)(H.a,{variant:"body2",className:c.keyMargin,component:"span",children:e},t)}))})})})})})})]})})}var ie=n(896),oe=n(894),se=n(902),le=n(898),ue=n(899),de=n(895),be=n(897),je=n(137),he={apiUrl:L.a.BEE_API_HOST,apiDebugUrl:L.a.BEE_DEBUG_API_HOST,beeApi:null,beeDebugApi:null,setApiUrl:function(){},setDebugApiUrl:function(){},lockedApiSettings:!1},pe=Object(a.createContext)(he);pe.Consumer;function Oe(e){var t=e.children,n=e.beeApiUrl,r=e.beeDebugApiUrl,c=e.lockedApiSettings,i=Object(a.useState)(he.apiUrl),o=Object(U.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(he.apiDebugUrl),d=Object(U.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(null),p=Object(U.a)(h,2),O=p[0],f=p[1],x=Object(a.useState)(null),g=Object(U.a)(x,2),v=g[0],y=g[1],w=Object(a.useState)(Boolean(c)),k=Object(U.a)(w,1)[0],S=n||s,C=r||b;return Object(a.useEffect)((function(){try{f(new je.Bee(S)),sessionStorage.setItem("api_host",S)}catch(e){f(null)}}),[S]),Object(a.useEffect)((function(){try{y(new je.BeeDebug(C)),sessionStorage.setItem("debug_api_host",C)}catch(e){y(null)}}),[C]),Object(m.jsx)(pe.Provider,{value:{apiUrl:S,apiDebugUrl:C,beeApi:O,beeDebugApi:v,setApiUrl:l,setDebugApiUrl:j,lockedApiSettings:k},children:t})}var fe=n(358),xe=n.n(fe),me=n(892);function ge(e){var t=e.value,n=Object(l.b)().enqueueSnackbar;return Object(m.jsx)("div",{style:{marginRight:"3px",marginLeft:"3px"},children:Object(m.jsx)(G.a,{color:"primary",size:"small",onClick:function(){return n("Copied: ".concat(t),{variant:"success"})},children:Object(m.jsx)(ee.CopyToClipboard,{text:t,children:Object(m.jsx)(me.a,{style:{height:"20px"}})})})})}var ve=n(359),ye=n.n(ve),we=n(893);function ke(e){var t=Object(a.useState)(!1),n=Object(U.a)(t,2),r=n[0],c=n[1];return Object(m.jsxs)("div",{children:[Object(m.jsx)(G.a,{color:"primary",size:"small",onClick:function(){c(!0)},children:Object(m.jsx)(we.a,{})}),Object(m.jsx)(oe.a,{onClose:function(){c(!1)},"aria-labelledby":"simple-dialog-title",open:r,children:Object(m.jsxs)("div",{style:{padding:"30px",textAlign:"center"},children:[Object(m.jsx)(de.a,{id:"simple-dialog-title",children:e.label}),Object(m.jsx)(ye.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}function Se(e){return Object(m.jsx)(H.a,{component:"div",variant:"subtitle1",children:e.address?Object(m.jsxs)("div",{style:{display:"flex"},children:[e.hideBlockie?null:Object(m.jsx)("div",{style:{paddingTop:"5px",marginRight:"10px"},children:Object(m.jsx)(xe.a,{size:20,string:e.address})}),Object(m.jsx)("div",{children:Object(m.jsx)("a",{style:e.truncate?{marginRight:"7px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}:{marginRight:"7px"},href:"".concat(L.a.BLOCKCHAIN_EXPLORER_URL,"/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(m.jsx)(ke,{value:e.address,label:"Ethereum Address"}),Object(m.jsx)(ge,{value:e.address})]}):"-"})}function Ce(e){var t=e.peerId,n=e.uncashedAmount,r=Object(a.useState)(!1),c=Object(U.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(!1),u=Object(U.a)(s,2),j=u[0],h=u[1],p=Object(l.b)().enqueueSnackbar,O=Object(a.useContext)(pe).beeDebugApi,f=function(){o(!1)};return Object(m.jsxs)("div",{children:[Object(m.jsxs)(ie.a,{variant:"contained",onClick:function(){o(!0)},startIcon:Object(m.jsx)(be.a,{size:"1rem"}),children:["Cash out peer ",t.substr(0,8),"[\u2026]"]}),Object(m.jsxs)(oe.a,{open:i,onClose:f,"aria-labelledby":"form-dialog-title",children:[Object(m.jsx)(de.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(m.jsx)(le.a,{children:Object(m.jsxs)(ue.a,{style:{marginTop:"20px",overflowWrap:"break-word"},children:[j&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("span",{children:["Cashing out ",Object(m.jsx)("strong",{children:n})," from Peer ",Object(m.jsx)("strong",{children:t}),". Please wait..."]}),Object(m.jsx)(d.a,{style:{textAlign:"center",padding:"50px"},children:Object(m.jsx)(b.a,{})})]}),!j&&Object(m.jsxs)("span",{children:["Are you sure you want to cashout ",Object(m.jsxs)("strong",{children:[n," BZZ"]})," from Peer"," ",Object(m.jsx)("strong",{children:t}),"?"]})]})}),Object(m.jsxs)(se.a,{children:[Object(m.jsx)(ie.a,{onClick:f,color:"primary",children:"Cancel"}),Object(m.jsx)(ie.a,{onClick:function(){O&&(t?(h(!0),O.cashoutLastCheque(t).then((function(e){o(!1),p(Object(m.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(m.jsx)(Se,{hideBlockie:!0,transaction:!0,address:e})]}),{variant:"success"})})).catch((function(e){p(Object(m.jsxs)("span",{children:["Error: ",e.message]}),{variant:"error"})})).finally((function(){h(!1)}))):p(Object(m.jsx)("span",{children:"Peer Id invalid"}),{variant:"error"}))},color:"primary",disabled:j,children:"Yes Cashout"})]})]})]})}function Ae(e){var t=e.accounting,n=e.isLoadingUncashed,a=e.totalUncashed;return Object(m.jsxs)(Y,{label:"Peers (".concat((null===t||void 0===t?void 0:t.length)||0,")"),info:"".concat(a.toFixedDecimal()," BZZ (uncashed)"),children:[Object(m.jsx)(X,{label:"Uncashed Amount Total",value:"".concat(a.toFixedDecimal()," BZZ")}),null===t||void 0===t?void 0:t.map((function(e){var t=e.peer,a=e.balance,r=e.received,c=e.sent,i=e.uncashedAmount,o=e.total;return Object(m.jsxs)(Y,{label:"Peer ".concat(t.substr(0,8),"[\u2026]"),level:1,info:"".concat(i.toFixedDecimal()," BZZ (uncashed)"),children:[Object(m.jsx)(ce,{label:"Peer ID",value:t}),Object(m.jsx)(X,{label:"Outstanding Balance",value:"".concat(a.toFixedDecimal()," BZZ")}),Object(m.jsx)(X,{label:"Settlements Sent / Received",value:"-".concat(c.toFixedDecimal()," / ").concat(r.toFixedDecimal()," BZZ")}),Object(m.jsx)(X,{label:"Total",value:"".concat(o.toFixedDecimal()," BZZ")}),Object(m.jsx)(X,{label:"Uncashed Amount",value:n?"loading\u2026":"".concat(i.toFixedDecimal()," BZZ")}),i.toBigNumber.isGreaterThan("0")&&Object(m.jsx)(Q,{children:Object(m.jsx)(Ce,{uncashedAmount:i.toFixedDecimal(),peerId:t})})]},t)}))]})}var Ee=n(904),Pe=Object(j.a)((function(e){return Object(h.a)({root:{height:"100%"},content:{maxWidth:500,marginBottom:e.spacing(4),"&:last-child":{marginBottom:0}},icon:{height:"1rem"}})}));function Te(){var e=Pe();return Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",className:e.root,children:[Object(m.jsx)(y.a,{item:!0,className:e.content,children:Object(m.jsx)(H.a,{variant:"h1",align:"center",children:"Uh oh, it looks like your node is not connected."})}),Object(m.jsx)(y.a,{item:!0,className:e.content,children:Object(m.jsxs)(H.a,{align:"center",children:["Please check your node status to fix the problem. You can also check out the"," ",Object(m.jsx)(S.a,{href:L.a.BEE_DOCS_HOST,target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})," ","or ask for support on the"," ",Object(m.jsx)(S.a,{href:L.a.BEE_DISCORD_HOST,target:"_blank",rel:"noreferrer",children:"Ethereum Swarm Discord"}),"."]})}),Object(m.jsx)(y.a,{item:!0,className:e.content,children:Object(m.jsx)(H.a,{align:"center",children:Object(m.jsx)(ie.a,{component:u.b,variant:"contained",startIcon:Object(m.jsx)(Ee.a,{className:e.icon}),to:mr.STATUS,children:"Check node status"})})})]})}var Be=n(3),Ne=n.n(Be),De=n(27),Ie=n(50),_e=n(155),Le=n.n(_e),Re=n(360),Ue=n(361),Fe=n.n(Ue),We=n(39),He=new URLSearchParams(window.location.search).get("v");He&&(localStorage.setItem("apiKey",He),window.location.search="");var Me={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,nodeInfo:null,topology:null,chequebookAddress:null,peers:null,chequebookBalance:null,peerBalances:null,peerCheques:null,settlements:null,chainState:null,latestBeeRelease:null,isLoading:!0,isRefreshing:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},Ve=Object(a.createContext)(Me);Ve.Consumer;function ze(e,t,n,a,r,c,i,o){var s,l=Boolean(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BEE_HOST:"http://localhost:1633",REACT_APP_BEE_DEBUG_HOST:"http://localhost:1635",REACT_APP_BEE_DOCS_HOST:"https://docs.ethswarm.org/docs/",REACT_APP_BEE_DISCORD_HOST:"https://discord.gg/eKr9XPv7",REACT_APP_BLOCKCHAIN_EXPLORER_URL:"https://blockscout.com/xdai/mainnet",REACT_APP_BEE_GITHUB_REPO_URL:"https://api.github.com/repos/ethersphere/bee"}).REACT_APP_DEV_MODE)||"dev"===(null===n||void 0===n?void 0:n.beeMode),u={version:Boolean(e&&Le.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:a,topology:Boolean((null===r||void 0===r?void 0:r.connected)&&(null===r||void 0===r?void 0:r.connected)>0)||l,chequebook:Boolean(null===c||void 0===c?void 0:c.chequebookAddress)&&null!==i&&(null===i||void 0===i?void 0:i.totalBalance.toBigNumber.isGreaterThan(0))||l||(s=null===n||void 0===n?void 0:n.beeMode,"ultra-light"===s)};return Object(Ie.a)(Object(Ie.a)({},u),{},{all:!o&&Object.values(u).every((function(e){return e}))})}function qe(e){var t,n,r=e.children,c=Object(a.useContext)(pe),i=c.beeApi,o=c.beeDebugApi,s=Object(a.useState)(!1),l=Object(U.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(null),j=Object(U.a)(b,2),h=j[0],p=j[1],O=Object(a.useState)(null),f=Object(U.a)(O,2),x=f[0],g=f[1],v=Object(a.useState)(null),y=Object(U.a)(v,2),w=y[0],k=y[1],S=Object(a.useState)(null),C=Object(U.a)(S,2),A=C[0],E=C[1],P=Object(a.useState)(null),T=Object(U.a)(P,2),B=T[0],N=T[1],D=Object(a.useState)(null),I=Object(U.a)(D,2),_=I[0],R=I[1],F=Object(a.useState)(null),W=Object(U.a)(F,2),H=W[0],M=W[1],V=Object(a.useState)(null),z=Object(U.a)(V,2),q=z[0],Y=z[1],Z=Object(a.useState)(null),G=Object(U.a)(Z,2),K=G[0],J=G[1],X=Object(a.useState)(null),$=Object(U.a)(X,2),Q=$[0],ee=$[1],te=Object(a.useState)(null),ne=Object(U.a)(te,2),ae=ne[0],re=ne[1],ce=function(){var e=Object(a.useState)(null),t=Object(U.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),i=Object(U.a)(c,2),o=i[0],s=i[1],l=Object(a.useState)(null),u=Object(U.a)(l,2),d=u[0],b=u[1];return Object(a.useEffect)((function(){Fe.a.get("".concat(L.a.GITHUB_REPO_URL,"/releases/latest")).then((function(e){r(e.data)})).catch((function(e){b(e)})).finally((function(){s(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:o,error:d}}(),ie=ce.latestBeeRelease,oe=Object(a.useState)(Me.error),se=Object(U.a)(oe,2),le=se[0],ue=se[1],de=Object(a.useState)(Me.isLoading),be=Object(U.a)(de,2),je=be[0],he=be[1],Oe=Object(a.useState)(Me.isRefreshing),fe=Object(U.a)(Oe,2),xe=fe[0],me=fe[1],ge=Object(a.useState)(Me.lastUpdate),ve=Object(U.a)(ge,2),ye=ve[0],we=ve[1],ke=Object(a.useState)(3e4),Se=Object(U.a)(ke,2),Ce=Se[0],Ae=Se[1],Ee=null===(t=Le.a.coerce(null===ie||void 0===ie?void 0:ie.name))||void 0===t?void 0:t.version,Pe=null===(n=Le.a.coerce(null===h||void 0===h?void 0:h.version))||void 0===n?void 0:n.version,Te=null===h||void 0===h?void 0:h.version;Object(a.useEffect)((function(){he(!0),d(!1),Be()}),[i]),Object(a.useEffect)((function(){he(!0),p(null),g(null),E(null),k(null),R(null),N(null),M(null),Y(null),J(null),ee(null),re(null),Be()}),[o]);var Be=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n,a,r;return Ne.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&&o){e.next=5;break}return he(!1),e.abrupt("return");case 5:return e.prev=5,me(!0),ue(null),t=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n,a;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getChequebookBalance();case 2:return t=e.sent,n=t.totalBalance,a=t.availableBalance,e.abrupt("return",{totalBalance:new We.a(n),availableBalance:new We.a(a)});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.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 We.a(n)}})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t,n,a,r;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getAllSettlements();case 2:return t=e.sent,n=t.totalReceived,a=t.settlements,r=t.totalSent,e.abrupt("return",{totalReceived:new We.a(n),totalSent:new We.a(r),settlements:a.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new We.a(n),sent:new We.a(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)})),o.getHealth().then(p).catch((function(){return p(null)})),o.getNodeAddresses().then(g).catch((function(){return g(null)})),o.getNodeInfo().then(k).catch((function(){return k(null)})),o.getTopology().then(E).catch((function(){return E(null)})),o.getPeers().then(R).catch((function(){return R(null)})),o.getChequebookAddress().then(N).catch((function(){return N(null)})),o.getLastCheques().then(J).catch((function(){return J(null)})),o.getChainState().then(re).catch((function(){return re(null)})),t().then(M).catch((function(){return M(null)})),n().then(Y).catch((function(){return Y(null)})),a().then(ee).catch((function(){return ee(null)}))],e.next=14,Promise.allSettled(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),ue(e.t0);case 19:return e.prev=19,he(!1),me(!1),we(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(Be(),Ce){var e=setInterval(Be,Ce);return function(){return clearInterval(e)}}}),[Ce,o,i]),Object(m.jsx)(Ve.Provider,{value:{status:ze(h,x,w,u,A,B,H,le),latestUserVersion:Pe,latestUserVersionExact:Te,latestPublishedVersion:Ee,isLatestBeeVersion:Boolean(Ee&&Pe&&Le.a.satisfies(Ee,Pe,{includePrerelease:!0})),latestBeeVersionUrl:(null===ie||void 0===ie?void 0:ie.html_url)||"https://github.com/ethersphere/bee/releases/latest",error:le,apiHealth:u,debugApiHealth:h,nodeAddresses:x,nodeInfo:w,topology:A,chequebookAddress:B,peers:_,chequebookBalance:H,peerBalances:q,peerCheques:K,settlements:Q,chainState:ae,latestBeeRelease:ie,isLoading:je,isRefreshing:xe,lastUpdate:ye,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return Ae(e)},stop:function(){return Ae(null)},refresh:Be},children:r})}var Ye=n(38);var Ze=function(e,t,n){var r=Object(a.useState)(!1),c=Object(U.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(void 0),l=Object(U.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){if(!i&&e&&t&&!u){o(!0);var n=t.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(t){var n=t.peer;return Object(Ye.h)((function(){return e.getLastCashoutAction(n)}))}));Promise.allSettled(n).then((function(e){var t=Object(Ye.k)(e);d(t.fulfilled),o(!1)}))}}),[t,i,u,e]);var b=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 We.a("0"),received:new We.a("0"),uncashedAmount:new We.a("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,r=e.received;return a[t]=Object(Ie.a)(Object(Ie.a)({},a[t]),{},{sent:n,received:r,total:new We.a(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 We.a(n)})),Object.values(a).sort((function(e,t){var n=t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber();return 0!==n?n:e.peer22?n.slice(0,19)+"...":n;function O(){"NEW_WINDOW"===i?window.open(r||n):h(r||n)}return Object(m.jsx)(F.a,{className:l.header,children:Object(m.jsx)(y.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(m.jsx)(H.a,{variant:"body1",children:t}),Object(m.jsx)(H.a,{variant:"body2",children:Object(m.jsxs)("div",{children:[s&&Object(m.jsx)("span",{className:l.copyValue,children:Object(m.jsx)(Z.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:function(){return j(!1)},children:Object(m.jsx)(te.a,{text:n,children:Object(m.jsx)("span",{onClick:function(){return j(!0)},children:p})})})}),!s&&Object(m.jsx)("span",{onClick:O,children:p}),Object(m.jsxs)(G.a,{size:"small",className:l.openLinkIcon,children:["NEW_WINDOW"===i&&Object(m.jsx)(C.a,{onClick:O,strokeWidth:1}),"HISTORY_PUSH"===i&&Object(m.jsx)(Kt.a,{onClick:O,strokeWidth:1})]})]})})]})})})}var $t=n(379),Qt=n(918),en=n(919),tn=n(920),nn=["index.html","index.htm"];function an(e){var t=e.map(on);if(!t.length)return!1;var n=t.find((function(e){return nn.includes(e)}));if(n)return{indexPath:n};var a=t[0].split("/")[0]+"/";if(t.every((function(e){return e.startsWith(a)}))){var r=t.find((function(e){return nn.map((function(e){return a+e})).includes(e)}));if(r)return{indexPath:r,commonPrefix:a}}return!1}function rn(e){return e>=1e15?(e/1e15).toFixed(2)+" PB":e>=1e12?(e/1e12).toFixed(2)+" TB":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":e>=1e3?(e/1e3).toFixed(2)+" kB":e+" bytes"}function cn(e){if(1===e.length)return e[0].name;if(e.length>0){var t=on(e[0]).split("/")[0];if(e.every((function(e){return on(e).split("/")[0]===t})))return t}return"unknown"}function on(e){return(e.path||e.webkitRelativePath||e.name).replace(/^\//g,"")}function sn(e){var t=on(e);return{path:t,fullPath:t,webkitRelativePath:t,lastModified:e.lastModified,name:e.name,size:e.size,type:e.type,stream:e.stream,slice:e.slice,text:e.text,arrayBuffer:function(){var t=Object(De.a)(Ne.a.mark((function t(){return Ne.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.arrayBuffer();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}function ln(e,t,n){return new Promise((function(a,r){if(!e.size||!e.type||!["image/bmp","image/gif","image/vnd.microsoft.icon","image/jpeg","image/png","image/svg+xml","image/tiff","image/webp"].includes(e.type))return r("File not supported!");try{var c=new FileReader;c.readAsDataURL(e),c.onload=function(e){var r,c=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.result;if(!c||"string"!==typeof c)throw new Error("Failed to load the image source");var i=new Image;i.src=c,i.onload=function(){var e=function(e,t,n,a){var r=n?e/n:1,c=a?t/a:1,i=Math.max(r,c);return i<=1?{width:e,height:t}:{width:e/i,height:t/i}}(i.width,i.height,t,n),r=document.createElement("canvas");r.width=e.width,r.height=e.height;var c=r.getContext("2d");if(!c)throw new Error("Failed to create canvas context");c.drawImage(i,0,0,r.width,r.height),c.canvas.toBlob((function(e){if(!e)throw new Error("Failed to extract the blob from canvas");a(e)}),"image/jpeg",1)}},c.onerror=function(e){return r(e)}}catch(i){r(i)}}))}var un=".swarmgatewaymeta.json",dn=".swarmgatewaypreview.jpeg",bn=250,jn=175,hn={origin:"UPLOAD"},pn={files:[],setFiles:function(){},uploadOrigin:hn,setUploadOrigin:function(){}},On=Object(a.createContext)(pn);On.Consumer;function fn(e){var t=e.children,n=Object(a.useState)(pn.files),r=Object(U.a)(n,2),c=r[0],i=r[1],o=Object(a.useState)(pn.uploadOrigin),s=Object(U.a)(o,2),l=s[0],u=s[1],d=Object(a.useState)(void 0),b=Object(U.a)(d,2),j=b[0],h=b[1],p=Object(a.useState)(void 0),O=Object(U.a)(p,2),f=O[0],x=O[1],g=Object(a.useState)(void 0),v=Object(U.a)(g,2),y=v[0],w=v[1];return Object(a.useEffect)((function(){if(h(function(e){var t=e.reduce((function(e,t){return e+t.size}),0),n=Boolean(an(e));return{size:t,name:cn(e),type:1===e.length?e[0].type:"folder",isWebsite:n,count:e.length}}(c)),f&&(URL.revokeObjectURL(f),x(void 0),w(void 0)),1===c.length&&c[0].type.startsWith("image"))return ln(c[0],bn,jn).then((function(e){x(URL.createObjectURL(e)),w(e)})),function(){f&&URL.revokeObjectURL(f)}}),[c]),Object(m.jsx)(On.Provider,{value:{files:c,setFiles:i,uploadOrigin:l,setUploadOrigin:u,metadata:j,previewUri:f,previewBlob:y},children:t})}var xn=Object(j.a)((function(e){return Object(h.a)({areaWrapper:{position:"relative",marginBottom:e.spacing(2)},dropzone:{background:e.palette.background.default,outline:"none",color:"transparent",zIndex:1,"& svg":{opacity:0}},buttonWrapper:{top:"0",left:"0",position:"absolute",display:"flex",width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},button:{marginLeft:e.spacing(.5),marginRight:e.spacing(.5),zIndex:2}})}));function mn(e){var t=e.uploadOrigin,n=e.showHelp,r=Object(a.useContext)(On),c=r.setFiles,i=r.setUploadOrigin,o=xn(),s=Object(R.g)(),u=Object(l.b)().enqueueSnackbar,d=Object(a.useState)(!1),b=Object(U.a)(d,2),j=b[0],h=b[1],p=Object(a.useState)(0),O=Object(U.a)(p,2),f=O[0],x=O[1],g=function(){return document.querySelector(".MuiDropzoneArea-root input")},v=function(){var e=g();e&&(e.setAttribute("directory",""),e.setAttribute("webkitdirectory",""),e.setAttribute("mozdirectory",""),e.click())};return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("div",{className:o.areaWrapper,children:[Object(m.jsx)($t.a,{dropzoneClass:o.dropzone,onChange:function(e){if(e){var n=e,a=1===e.length?e[0].name:an(n)||void 0;if(e.length&&j&&!a)return u("To upload a website, there must be an index.html or index.htm in the root of the folder.",{variant:"error"}),void setTimeout((function(){x((function(e){return e+1})),c([])}),0);c(n),e.length&&(i(t),s(mr.UPLOAD_IN_PROGRESS))}},filesLimit:1e9,maxFileSize:1e9,showPreviews:!1},f),Object(m.jsxs)("div",{className:o.buttonWrapper,children:[Object(m.jsx)(st,{className:o.button,onClick:function(){var e=g();e&&(e.removeAttribute("directory"),e.removeAttribute("webkitdirectory"),e.removeAttribute("mozdirectory"),e.click())},iconType:Qt.a,children:"Add File"}),Object(m.jsx)(st,{className:o.button,onClick:function(){v(),h(!1)},iconType:en.a,children:"Add Folder"}),Object(m.jsx)(st,{className:o.button,onClick:function(){v(),h(!0)},iconType:tn.a,children:"Add Website"})]})]}),n&&Object(m.jsx)(Ut,{children:"You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm, make sure that your folder contains an \u201cindex.html\u201d file."})]})}function gn(){var e=Object(a.useContext)(ut).identities,t=Object(R.h)().uuid,n=Object(a.useContext)(pe).beeApi,r=Object(a.useContext)(Ve).status,c=Object(R.g)(),i=Object(a.useState)(!1),o=Object(U.a)(i,2),s=o[0],l=o[1],u=e.find((function(e){return e.uuid===t}));if(Object(a.useEffect)((function(){if(u&&u.feedHash)try{null===n||void 0===n||n.downloadData(u.feedHash).then((function(){return l(!0)}))}catch(e){l(!1)}}),[n,t,u]),!u||!r.all)return c(mr.FEEDS,{replace:!0}),Object(m.jsx)(m.Fragment,{});return Object(m.jsxs)("div",{children:[Object(m.jsx)(Ht,{children:"".concat(u.name," Website")}),Object(m.jsx)(mn,{showHelp:!1,uploadOrigin:{origin:"FEED",uuid:t}}),s&&u.feedHash?Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(rt.a,{mb:.25,children:Object(m.jsx)(ce,{label:"Feed hash",value:u.feedHash})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(Xt,{label:"BZZ Link",value:"https://".concat(Gt.encodeFeedReference(u.feedHash),".bzz.link")})})]}):Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsxs)(Ut,{children:["This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the"," ",Object(m.jsx)("a",{href:"https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"}),"."]})}),Object(m.jsx)(Q,{children:Object(m.jsx)(st,{iconType:jt.a,onClick:function(){c(mr.FEEDS)},cancel:!0,children:"Close"})})]})}var vn=n(117),yn={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},wn=Object(a.createContext)(yn);wn.Consumer;function kn(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),r="".concat(Math.ceil(100*a),"%");return Object(Ie.a)(Object(Ie.a)({},e),{},{usage:a,usageText:r})}function Sn(e){var t=e.children,n=Object(a.useContext)(pe).beeDebugApi,r=Object(a.useState)(yn.stamps),c=Object(U.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(yn.error),l=Object(U.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(yn.isLoading),j=Object(U.a)(b,2),h=j[0],p=j[1],O=Object(a.useState)(yn.lastUpdate),f=Object(U.a)(O,2),x=f[0],g=f[1],v=Object(a.useState)(null),y=Object(U.a)(v,2),w=y[0],k=y[1],S=function(){var e=Object(De.a)(Ne.a.mark((function e(){var t;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){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,p(!0),e.next=8,n.getAllPostageBatch();case 8:t=e.sent,o(t.map(kn)),g(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,p(!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(S(),w){var e=setInterval(S,w);return function(){return clearInterval(e)}}}),[w]),Object(m.jsx)(wn.Provider,{value:{stamps:i,error:u,isLoading:h,lastUpdate:x,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return k(e)},stop:function(){return k(null)},refresh:S},children:t})}function Cn(e){var t=e.feedName,n=e.onProceed,r=e.onCancel,c=e.loading,i=Object(a.useState)(""),o=Object(U.a)(i,2),s=o[0],l=o[1];return Object(m.jsxs)(ht,{children:[Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(mt,{onClose:r,children:"Update Feed"})}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsxs)(H.a,{children:["Please enter the password for \u201c",t,"\u201d:"]})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(Dt,{label:"Password",name:"password",onChange:function(e){l(e.target.value)},password:!0})}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{iconType:Et.a,onClick:function(){return n(s)},disabled:c,loading:c,children:"Proceed"}),Object(m.jsx)(st,{iconType:jt.a,onClick:r,cancel:!0,disabled:c,children:"Cancel"})]})]})}function An(){var e=Object(a.useContext)(ut),t=e.identities,n=e.setIdentities,r=Object(a.useContext)(pe),c=r.beeApi,i=r.beeDebugApi,o=Object(a.useContext)(wn),s=o.stamps,u=o.refresh,d=Object(a.useContext)(Ve).status,b=Object(R.h)().hash,j=Object(a.useState)(null),h=Object(U.a)(j,2),p=h[0],O=h[1],f=Object(a.useState)(null),x=Object(U.a)(f,2),g=x[0],v=x[1],w=Object(a.useState)(!1),k=Object(U.a)(w,2),S=k[0],C=k[1],A=Object(l.b)().enqueueSnackbar,E=Object(a.useState)(!1),P=Object(U.a)(E,2),B=P[0],N=P[1],D=Object(R.g)();function I(e,t){return _.apply(this,arguments)}function _(){return(_=Object(De.a)(Ne.a.mark((function e(a,r){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C(!0),c&&i&&p){e.next=5;break}return A(Object(m.jsx)("span",{children:"Bee API unavailabe"}),{variant:"error"}),C(!1),e.abrupt("return");case 5:return e.prev=5,e.next=8,Object(bt.f)(c,a,b,p,r);case 8:Object(bt.e)(t,a),n(Object(vn.a)(t)),D(mr.FEEDS_PAGE.replace(":uuid",a.uuid)),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(5),C(!1),("object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")||"").includes("possibly wrong passphrase")?A("Wrong password, please try again",{variant:"error"}):A("Could not update feed at this time, please try again later",{variant:"error"});case 18:case"end":return e.stop()}}),e,null,[[5,13]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){u()}),[]),d.all?Object(m.jsxs)("div",{children:[B&&g&&Object(m.jsx)(Cn,{feedName:g.name+" Website",onCancel:function(){N(!1)},onProceed:function(e){I(g,e)},loading:S}),Object(m.jsx)(Ht,{children:"Update feed"}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(y.a,{container:!0,children:Object(m.jsx)(qt,{options:t.map((function(e){return{value:e.uuid,label:"".concat(e.name," Website")}})),onChange:function(e){var n=e.target.value;v(t.find((function(e){return e.uuid===n}))||null)},label:"Feed"})})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(y.a,{container:!0,children:s?Object(m.jsx)(qt,{options:s.map((function(e){return{value:e.batchID,label:e.batchID.slice(0,8)}})),onChange:function(e){var t=e.target.value;O(t)},label:"Stamp"}):Object(m.jsx)(H.a,{children:"You need to buy a stamp first to be able to update a feed."})})}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:function(){g&&("V3"===g.type?N(!0):I(g))},iconType:T.a,loading:!B&&S,disabled:S||!p||!g,children:"Update Selected Feed"}),Object(m.jsx)(st,{onClick:function(){D(-1)},iconType:jt.a,disabled:S,cancel:!0,children:"Close"})]})]}):Object(m.jsx)(Te,{})}var En=n(198),Pn=n(385),Tn=n(922),Bn=n(923),Nn=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:"#F7F7F7",marginBottom:e.spacing(.25)},typography:{color:"#242424"}})}));function Dn(e){var t=e.children,n=Nn();return Object(m.jsx)(F.a,{className:n.header,children:Object(m.jsx)(H.a,{variant:"body1",className:n.typography,children:t})})}var In,_n=Object(j.a)((function(e){return Object(h.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},keyMargin:{marginRight:e.spacing(1)},unselectableLabel:{cursor:"default",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}})}));function Ln(e){var t=e.label,n=e.value,r=e.onConfirm,c=e.onChange,i=e.confirmLabel,o=e.confirmLabelDisabled,s=e.expandedOnly,l=e.helperText,u=e.placeholder,d=e.loading,b=e.mapperFn,j=e.locked,h=_n(),p=Object(a.useState)(Boolean(s)),O=Object(U.a)(p,2),f=O[0],x=O[1],g=Object(a.useState)(n||""),v=Object(U.a)(g,2),w=v[0],k=v[1],S=function(){return x(!f)};return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(F.a,{className:"".concat(h.header," ").concat(f?h.headerOpen:""),children:Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(m.jsx)(H.a,{variant:"body1",className:h.unselectableLabel,children:t}),Object(m.jsx)(H.a,{variant:"body2",children:Object(m.jsxs)("div",{children:[!f&&n,!s&&!j&&Object(m.jsx)(G.a,{size:"small",className:h.copyValue,children:f?Object(m.jsx)(ne.a,{onClick:S,strokeWidth:1}):Object(m.jsx)(Tn.a,{onClick:S,strokeWidth:1})})]})})]}),Object(m.jsx)(M.a,{in:f,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)(Pn.a,{value:w,placeholder:u,onChange:function(e){b&&(e.target.value=b(e.target.value)),k(e.target.value),c&&c(e.target.value)},fullWidth:!0,className:h.content,autoFocus:!0,hidden:j})})]})}),Object(m.jsxs)(M.a,{in:f,timeout:"auto",unmountOnExit:!0,children:[l&&Object(m.jsx)(Dn,{children:l}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{disabled:d||w===n||Boolean(o)||""===w&&void 0===n,loading:d,iconType:Bn.a,onClick:function(){return r(w)},children:i||"Save"}),Object(m.jsx)(st,{disabled:d||w===n||""===w,iconType:jt.a,onClick:function(){return k(n||"")},cancel:!0,children:"Cancel"})]})]})]})}function Rn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return"".concat(e.slice(0,t),"[\u2026]").concat(e.slice(-t))}function Un(e,t,n){var a=Fn(e),r=a.findIndex((function(e){return e.hash===t}));-1!==r&&a.splice(r,1),a.unshift({createdAt:Date.now(),hash:t,name:n}),a.length>10&&(a.length=10),localStorage.setItem(e,JSON.stringify(a))}function Fn(e){var t=localStorage.getItem(e);if(!t)return[];try{var n=JSON.parse(t);return Array.isArray(n)&&n.every(Wn)?n:[]}catch(a){return[]}}function Wn(e){return"object"===typeof e&&null!==e&&("createdAt"in e&&"hash"in e)}function Hn(e,t){return"index.html"===t?"Website ".concat(Rn(e,4)):t||"Folder ".concat(Rn(e,4))}function Mn(e){var t=e.title,n=e.localStorageKey,r=Object(a.useState)([]),c=Object(U.a)(r,2),i=c[0],o=c[1];return Object(a.useEffect)((function(){o(Fn(n))}),[n]),i.length?Object(m.jsx)(Y,{label:t,defaultOpen:!0,children:i.map((function(e,t){return Object(m.jsx)(Xt,{label:(n=new Date(e.createdAt),n.toString().split("GMT")[0].trim()),value:e.name,link:"/files/hash/"+e.hash,navigationType:"HISTORY_PUSH",allowClipboard:!1},t);var n}))}):null}!function(e){e.UPLOAD_HISTORY="UPLOAD_HISTORY",e.DOWNLOAD_HISTORY="DOWNLOAD_HISTORY"}(In||(In={}));var Vn=n(948),zn=n(924),qn=Object(j.a)((function(e){return Object(h.a)({root:{flexGrow:1,marginBottom:e.spacing(4)},leftTab:{marginRight:e.spacing(.5)},rightTab:{marginLeft:e.spacing(.5)}})}));function Yn(e){var t=e.active,n=qn(),a=Object(R.g)();return Object(m.jsx)("div",{className:n.root,children:Object(m.jsxs)(Vn.a,{value:"UPLOAD"===t?0:1,onChange:function(e,t){a(1===t?mr.DOWNLOAD:mr.UPLOAD)},variant:"fullWidth",children:[Object(m.jsx)(zn.a,{className:n.leftTab,label:"Upload"},"UPLOAD"),Object(m.jsx)(zn.a,{className:n.rightTab,label:"Download"},"DOWNLOAD")]})})}function Zn(){var e=Object(a.useState)(!1),t=Object(U.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(pe).beeApi,i=Object(a.useState)(void 0),o=Object(U.a)(i,2),s=o[0],u=o[1],d=Object(a.useContext)(On).setUploadOrigin,b=Object(l.b)().enqueueSnackbar,j=Object(R.g)();function h(){return(h=Object(De.a)(Ne.a.mark((function e(t){var n,a,i,o;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r(!0),c){e.next=4;break}return r(!1),e.abrupt("return");case 4:return e.prev=4,n=new En.ManifestJs(c),e.next=8,n.resolveFeedManifest(t);case 8:return(a=e.sent)&&(t=a),e.next=12,n.isManifest(t);case 12:if(e.sent){e.next=15;break}throw Error("The specified hash does not contain valid content.");case 15:return e.next=17,n.getIndexDocumentPath(t);case 17:i=e.sent,Un(In.DOWNLOAD_HISTORY,t,Hn(t,i)),d(hn),j(mr.HASH.replace(":hash",t)),e.next=29;break;case 23:e.prev=23,e.t0=e.catch(4),(o="object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")).includes("path address not found")&&(o="The specified hash does not have an index document set."),o.includes("Not Found: Not Found")&&(o="The specified hash was not found."),b(Object(m.jsxs)("span",{children:["Error: ",o||"Unknown"]}),{variant:"error"});case 29:return e.prev=29,r(!1),e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[4,23,29,32]])})))).apply(this,arguments)}return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Yn,{active:"DOWNLOAD"}),Object(m.jsx)(Ln,{label:"Swarm Hash",onConfirm:function(e){return function(e){return h.apply(this,arguments)}(e)},onChange:function(e){je.Utils.isHexString(e,64)||je.Utils.isHexString(e,128)||!e.trim().length?u(void 0):u("Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.")},helperText:s,confirmLabel:"Find",confirmLabelDisabled:Boolean(s)||n,placeholder:"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605",expandedOnly:!0,mapperFn:function(e){return function(e){return e.length<64?e:Object(Ye.d)(e)||e}(e)},loading:n}),Object(m.jsx)(Mn,{title:"Download History",localStorageKey:In.DOWNLOAD_HISTORY})]})}var Gn=n(373),Kn=n.n(Gn);function Jn(){return Object(m.jsx)(y.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",children:Object(m.jsx)(b.a,{})})}var Xn=n(926),$n=n(925),Qn=n(927),ea=Object(j.a)((function(){return Object(h.a)({image:{width:"100%",height:"100%",objectFit:"cover"}})}));function ta(e){var t=ea(),n={};return e.maxHeight&&(n.maxHeight=e.maxHeight),e.maxWidth&&(n.maxWidth=e.maxWidth),Object(m.jsx)("img",{className:t.image,alt:e.alt,src:e.src,style:n})}var na=Object(j.a)((function(){return Object(h.a)({wrapper:{display:"flex",justifyContent:"center",alignItems:"center",width:"175px",height:"175px",background:"repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )"}})}));function aa(e){var t=e.children,n=na();return Object(m.jsx)("div",{className:n.wrapper,children:t})}function ra(e){var t=e.icon;return Object(m.jsx)(aa,{children:t})}function ca(e){var t=e.metadata,n=e.previewUri,a=Object(m.jsx)($n.a,{}),r=null===t||void 0===t?void 0:t.type;return(null===t||void 0===t?void 0:t.isWebsite)?(a=Object(m.jsx)(Xn.a,{}),r="Website"):"folder"===(null===t||void 0===t?void 0:t.type)&&(a=Object(m.jsx)(Qn.a,{}),r="Folder"),Object(m.jsxs)(rt.a,{mb:4,children:[Object(m.jsx)(rt.a,{bgcolor:"background.paper",children:Object(m.jsxs)(y.a,{container:!0,direction:"row",children:[n?Object(m.jsx)(ta,{maxWidth:"250px",maxHeight:"175px",alt:"Upload Preview",src:n}):Object(m.jsx)(ra,{icon:a}),Object(m.jsxs)(rt.a,{p:2,children:[(null===t||void 0===t?void 0:t.hash)&&Object(m.jsxs)(H.a,{children:["Swarm Hash: ",Rn(t.hash)]}),(null===t||void 0===t?void 0:t.name)&&(null===t||void 0===t?void 0:t.name)!==(null===t||void 0===t?void 0:t.hash)&&Object(m.jsxs)(H.a,{children:["folder"===(null===t||void 0===t?void 0:t.type)?"Folder Name":"Filename",": ",Object(Ye.j)(null===t||void 0===t?void 0:t.name)]}),Object(m.jsxs)(H.a,{children:["Kind: ",r]}),(null===t||void 0===t?void 0:t.size)?Object(m.jsxs)(H.a,{children:["Size: ",rn(t.size)]}):null]})]})}),"folder"===(null===t||void 0===t?void 0:t.type)&&t.count&&Object(m.jsx)(rt.a,{mt:.25,p:2,bgcolor:"background.paper",children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(m.jsx)(H.a,{variant:"subtitle2",children:"Folder content"}),Object(m.jsxs)(H.a,{variant:"subtitle2",children:[t.count," items"]})]})})]})}function ia(e){var t=e.isWebsite,n=e.hash;return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)(rt.a,{mb:4,children:[Object(m.jsx)(ce,{label:"Swarm hash",value:n}),Object(m.jsx)(Xt,{label:"Share on Swarm Gateway",value:"https://gateway.ethswarm.org/access/".concat(n)}),t&&Object(m.jsx)(Xt,{label:"BZZ Link",value:"https://".concat(Gt.encodeManifestReference(n).toString(),".bzz.link")})]}),Object(m.jsxs)(Ut,{children:["The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided for testing purposes only. Learn more at"," ",Object(m.jsx)("a",{href:"https://gateway.ethswarm.org/",children:"https://gateway.ethswarm.org/"}),"."]})]})}var oa=n(928);function sa(e){var t=e.onOpen,n=e.onCancel,a=e.onDownload,r=e.onUpdateFeed,c=e.hasIndexDocument,i=e.loading;return Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsxs)(Q,{children:[c&&Object(m.jsx)(st,{onClick:t,iconType:oa.a,disabled:i,children:"View Website"}),Object(m.jsx)(st,{onClick:a,iconType:tt.a,disabled:i,loading:i,children:"Download"}),Object(m.jsx)(st,{onClick:n,iconType:jt.a,disabled:i,cancel:!0,children:"Close"})]}),Object(m.jsx)(rt.a,{mb:1,mr:1,children:Object(m.jsx)(st,{onClick:r,iconType:T.a,disabled:i,children:"Update Feed"})})]})}function la(){var e=Object(a.useContext)(pe),t=e.apiUrl,n=e.beeApi,r=Object(a.useContext)(Ve).status,c=Object(R.h)().hash,i=c,o=Object(R.g)(),s=Object(l.b)().enqueueSnackbar,u=Object(a.useState)(!0),d=Object(U.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),p=Object(U.a)(h,2),O=p[0],f=p[1],x=Object(a.useState)({}),g=Object(U.a)(x,2),v=g[0],y=g[1],w=Object(a.useState)(null),k=Object(U.a)(w,2),S=k[0],C=k[1],A=Object(a.useState)(!1),E=Object(U.a)(A,2),P=E[0],T=E[1],B=Object(a.useState)(void 0),N=Object(U.a)(B,2),D=N[0],I=N[1],_=Object(a.useState)(),F=Object(U.a)(_,2),W=F[0],M=F[1];function V(){return V=Object(De.a)(Ne.a.mark((function e(){var t,a,o,l,u,d,b,j;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&r.all){e.next=2;break}return e.abrupt("return");case 2:return t=new En.ManifestJs(n),e.next=5,t.isManifest(i);case 5:if(e.sent){e.next=10;break}return T(!0),s("The specified hash does not contain valid content.",{variant:"error"}),e.abrupt("return");case 10:return e.next=12,t.getHashes(i);case 12:return a=e.sent,e.next=15,t.getIndexDocumentPath(i);case 15:return o=e.sent,C(o),l=a[dn],delete a[un],delete a[dn],y(a),u=Object.keys(a).length,d={hash:c,size:0,type:u>1?"folder":"unknown",name:i,isWebsite:Boolean(o)&&u>1,count:u},e.prev=23,e.next=26,n.downloadFile(i,un);case 26:b=e.sent,j=b.data.text(),d=Object(Ie.a)(Object(Ie.a)({},d),JSON.parse(j)),e.next=33;break;case 31:e.prev=31,e.t0=e.catch(23);case 33:l&&I("".concat(L.b.BEE_API_HOST,"/bzz/").concat(i,"/").concat(dn)),M(d);case 35:case"end":return e.stop()}}),e,null,[[23,31]])}))),V.apply(this,arguments)}function z(){return(z=Object(De.a)(Ne.a.mark((function e(){var a,r,c,o,s,l,u;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(Un(In.DOWNLOAD_HISTORY,i,Hn(i,S)),f(!0),1!==Object.keys(v).length){e.next=8;break}window.open("".concat(t,"/bzz/").concat(i,"/"),"_blank"),e.next=25;break;case 8:a=new Kn.a,r=0,c=Object.entries(v);case 10:if(!(r0?o(-1):o(mr.UPLOAD)},onDownload:function(){return z.apply(this,arguments)},onUpdateFeed:function(){o(mr.FEEDS_UPDATE.replace(":hash",i))},hasIndexDocument:Boolean(null===W||void 0===W?void 0:W.isWebsite),loading:O})]}):Object(m.jsx)(Te,{})}var ua=Object(j.a)((function(){return Object(h.a)({wrapper:{height:"52px",display:"flex",flex:1,justifyContent:"center",alignItems:"center"},todo:{background:"#f7f7f7",color:"#c9c9c9"},inProgress:{background:"#ffffff",color:"#242424",height:"52px"},done:{background:"#f7f7f7",color:"#606060",height:"52px"}})}));function da(e){var t=e.steps,n=e.index,a=ua();function r(e){return e===n?a.inProgress:e255)return"-";var n=Object(Ye.a)(e,t);return"".concat(n.toSignificantDigits()," BZZ")}return Object(m.jsx)(Tt.c,{initialValues:ba,onSubmit:function(){var e=Object(De.a)(Ne.a.mark((function e(n,a){var o,s,l;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.depth&&n.amount){e.next=3;break}return e.abrupt("return");case 3:if(c){e.next=5;break}return e.abrupt("return");case 5:return o=BigInt(n.amount),s=Number.parseInt(n.depth),l=n.label?{label:n.label}:void 0,e.next=10,c.createPostageBatch(o.toString(),s,l);case 10:return a.resetForm(),e.next=13,r();case 13:t(),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),i("Error: ".concat(e.t0.message),{variant:"error"}),a.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 Ke.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 Ke.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 t,n=e.submitForm,a=e.isValid,r=e.isSubmitting,c=e.values;return Object(m.jsxs)(Tt.b,{children:[Object(m.jsxs)(rt.a,{mb:2,children:[Object(m.jsx)(Dt,{name:"depth",label:"Depth",formik:!0}),Object(m.jsx)(rt.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsx)(H.a,{children:"Corresponding file size"}),Object(m.jsx)(H.a,{children:(t=parseInt(c.depth||"0",10),isNaN(t)||t<17||t>255?"-":"~".concat(rn(Object(Ye.c)(t))))})]})})]}),Object(m.jsxs)(rt.a,{mb:2,children:[Object(m.jsx)(Dt,{name:"amount",label:"Amount",formik:!0}),Object(m.jsx)(rt.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsx)(H.a,{children:"Corresponding TTL (Time to live)"}),Object(m.jsx)(H.a,{children:o(Number.parseInt(c.amount||"0",10))})]})})]}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(Dt,{name:"label",label:"Label",optional:!0,formik:!0})}),Object(m.jsx)(rt.a,{mb:4,sx:{bgcolor:"#fcf2e8"},p:2,children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",children:[Object(m.jsx)(H.a,{children:"Indicative Price"}),Object(m.jsx)(H.a,{children:s(parseInt(c.depth||"0",10),BigInt(c.amount||"0"))})]})}),Object(m.jsx)(st,{disabled:r||!a||!c.amount||!c.depth,onClick:n,iconType:Et.a,loading:r,children:"Buy New Stamp"})]})}})}function ha(e){var t=e.onSelect,n=e.defaultValue,r=Object(a.useContext)(wn).stamps;return Object(m.jsx)(qt,{options:(r||[]).map((function(e){return{label:e.batchID.slice(0,8),value:e.batchID}})),onChange:function(e){return function(e){if(r){var n=r.find((function(t){return t.batchID===e}));n&&t(n)}}(e.target.value)},defaultValue:n})}function pa(e){var t=e.width,n=e.usage,a=Math.round(100*n),r=a+"%",c=98-a+"%";return Object(m.jsx)("div",{style:{display:"flex",alignItems:"center",height:"100%",width:t},children:Object(m.jsxs)("div",{style:{display:"flex",height:"4px",width:"100%"},children:[Object(m.jsx)("div",{style:{width:r,background:"#dd7200"}}),Object(m.jsx)("div",{style:{width:"2%"}}),Object(m.jsx)("div",{style:{width:c,background:"#c9c9c9"}})]})})}function Oa(e){var t=e.stamp,n=e.shorten;return Object(m.jsx)(rt.a,{p:2,width:"100%",children:Object(m.jsxs)(y.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(m.jsx)(H.a,{variant:"subtitle2",children:n?t.batchID.slice(0,8):t.batchID}),Object(m.jsx)(pa,{width:"100px",usage:t.usage})]})})}function fa(e){var t=e.stamp;return Object(m.jsxs)(rt.a,{mb:4,children:[Object(m.jsx)(rt.a,{mb:.25,p:2,bgcolor:"background.paper",children:Object(m.jsx)(H.a,{variant:"subtitle2",children:"Associated postage stamp:"})}),Object(m.jsx)(rt.a,{bgcolor:"background.paper",children:Object(m.jsx)(Oa,{stamp:t,shorten:!0})})]})}var xa=n(930);function ma(e){var t=e.step,n=e.onUpload,a=e.onCancel,r=e.onGoBack,c=e.onProceed,i=e.isUploading,o=e.hasStamp,s=e.uploadLabel,l=e.stampMode,u=e.setStampMode;return 0===t?Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(rt.a,{mb:1,children:Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:c,iconType:B.a,children:"Add Postage Stamp"}),Object(m.jsx)(st,{onClick:a,iconType:jt.a,cancel:!0,children:"Cancel"})]})}),Object(m.jsx)(Ut,{children:"You need a postage stamp to upload."})]}):1===t?Object(m.jsxs)(y.a,{container:!0,direction:"row",justifyContent:"space-between",children:[Object(m.jsxs)(Q,{children:["SELECT"===l&&Object(m.jsx)(st,{onClick:c,iconType:Et.a,disabled:!o,children:"Proceed With Selected Stamp"}),Object(m.jsx)(st,{onClick:r,iconType:xa.a,cancel:!0,children:"Back To Preview"})]}),Object(m.jsx)(st,{onClick:function(){return u("BUY"===l?"SELECT":"BUY")},iconType:"BUY"===l?B.a:ct.a,children:"BUY"===l?"Use Existing Stamp":"Buy New Stamp"})]}):2===t?Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:n,iconType:Et.a,disabled:i,loading:i,children:s}),Object(m.jsx)(st,{onClick:r,iconType:xa.a,disabled:i,cancel:!0,children:"Change Postage Stamp"})]}):Object(m.jsx)(m.Fragment,{})}function ga(){var e=Object(a.useState)(0),t=Object(U.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)("SELECT"),i=Object(U.a)(c,2),o=i[0],s=i[1],u=Object(a.useState)(null),d=Object(U.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),p=Object(U.a)(h,2),O=p[0],f=p[1],x=Object(a.useState)(!1),g=Object(U.a)(x,2),v=g[0],y=g[1],w=Object(a.useContext)(wn).refresh,k=Object(a.useContext)(pe).beeApi,S=Object(a.useContext)(On),C=S.files,A=S.setFiles,E=S.uploadOrigin,P=S.metadata,T=S.previewUri,B=S.previewBlob,N=Object(a.useContext)(ut),D=N.identities,I=N.setIdentities,_=Object(a.useContext)(Ve).status,L=Object(l.b)().enqueueSnackbar,F=Object(R.g)();if(Object(a.useEffect)((function(){w()}),[]),!_.all)return Object(m.jsx)(Te,{});if(!C.length)return A([]),F(mr.UPLOAD,{replace:!0}),Object(m.jsx)(m.Fragment,{});var W=E.uuid?D.find((function(e){return e.uuid===E.uuid})):null,H=function(e){if(k&&C.length&&b&&P){var t=C.map(sn),n=void 0;if(1===C.length)n=C[0].name;else if(C.length>1){var a=an(C);if(a)if(a.commonPrefix){var r=a.commonPrefix.length;n=a.indexPath.substr(r),t=t.map((function(e){var t=e.path.substr(r);return Object(Ie.a)(Object(Ie.a)({},e),{},{path:t,webkitRelativePath:t,fullPath:t})}))}else n=a.indexPath}var c=C[0].lastModified,i={name:P.name,size:P.size};1===C.length&&(i.type=P.type);var o=new File([JSON.stringify(i)],un,{type:"application/json",lastModified:c});if(t.push(sn(o)),B){var s=new File([B],dn,{type:"image/jpeg",lastModified:c});t.push(sn(s))}f(!0),k.uploadFiles(b.batchID,t,{indexDocument:n}).then((function(t){Un(In.UPLOAD_HISTORY,t.reference,cn(C)),"UPLOAD"===E.origin?F(mr.HASH.replace(":hash",t.reference),{replace:!0}):Object(bt.f)(k,W,t.reference,b.batchID,e).then((function(){Object(bt.e)(D,W),I(Object(vn.a)(D)),F(mr.FEEDS_PAGE.replace(":uuid",E.uuid),{replace:!0})}))})).catch((function(e){L("Error uploading: ".concat(e.message),{variant:"error"}),f(!1)}))}};return Object(m.jsxs)(m.Fragment,{children:[v&&Object(m.jsx)(Cn,{loading:O,feedName:W.name,onCancel:function(){return y(!1)},onProceed:function(e){H(e)}}),W&&Object(m.jsx)(Ht,{children:'Update "'.concat(W.name,'"')}),!W&&Object(m.jsx)(Ht,{children:"Upload"}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(da,{steps:["Preview","Add postage stamp","Upload to node"],index:n})}),(0===n||2===n)&&Object(m.jsx)(ca,{metadata:P,previewUri:T}),1===n&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(rt.a,{mb:2,children:"SELECT"===o?Object(m.jsx)(ha,{onSelect:function(e){return j(e)},defaultValue:null===b||void 0===b?void 0:b.batchID}):Object(m.jsx)(ja,{onFinished:function(){return s("SELECT")}})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsxs)(Ut,{children:["Please refer to the"," ",Object(m.jsx)("a",{href:"https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"})," ","to understand these values."]})})]}),2===n&&b&&Object(m.jsx)(fa,{stamp:b}),Object(m.jsx)(ma,{step:n,onCancel:function(){r(0),A([]),j(null),f(!1)},onGoBack:function(){return r((function(e){return e-1}))},onProceed:function(){return r((function(e){return e+1}))},onUpload:function(){"UPLOAD"===E.origin||"PRIVATE_KEY"===W.type?H():y(!0)},isUploading:O,hasStamp:Boolean(b),uploadLabel:W?"Update Feed":"Upload To Your Node",stampMode:o,setStampMode:s})]})}function va(){return Object(a.useContext)(Ve).status.all?Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Yn,{active:"UPLOAD"}),Object(m.jsx)(mn,{showHelp:!0,uploadOrigin:hn}),Object(m.jsx)(Mn,{title:"Upload History",localStorageKey:In.UPLOAD_HISTORY})]}):Object(m.jsx)(Te,{})}var ya=n(193),wa=1e5,ka="There may be issues with your Bee node or connection.",Sa={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. "+ka,score:0}],population:[{minimumValue:wa,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(wa.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. "+ka,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. "+ka,score:0}]};function Ca(e,t){var n,a=Sa[e],r=a[0].score,c=Object(ya.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(s){c.e(s)}finally{c.f()}var o=a[a.length-1];return{score:o.score,maximumScore:r,explanation:o.explanation}}var Aa=function(e){var t,n,a,r,c,i,o={connectedPeers:Ca("connectedPeers",(null===(t=e.topology)||void 0===t?void 0:t.connected)||0),population:Ca("population",(null===(n=e.topology)||void 0===n?void 0:n.population)||0),depth:Ca("depth",(null===(a=e.topology)||void 0===a?void 0:a.depth)||0)},s=Object.values(o).reduce((function(e,t){return e+t.maximumScore}),0),l=Object.values(o).reduce((function(e,t){return e+t.score}),0),u=Math.round(l/s*100)+"%";return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(X,{label:"Overall Health Indicator",value:u}),Object(m.jsx)(X,{label:"Connected Peers",value:null===(r=e.topology)||void 0===r?void 0:r.connected.toString(),tooltip:o.connectedPeers.explanation}),Object(m.jsx)(X,{label:"Population",value:null===(c=e.topology)||void 0===c?void 0:c.population.toString(),tooltip:o.population.explanation}),Object(m.jsx)(X,{label:"Depth",value:null===(i=e.topology)||void 0===i?void 0:i.depth.toString(),tooltip:o.depth.explanation})]})};function Ea(){var e=Object(a.useContext)(Ve),t=e.nodeInfo,n=e.status,r=e.latestUserVersion,c=e.isLatestBeeVersion,i=e.latestBeeVersionUrl,o=e.topology,s=e.nodeAddresses,l=e.chequebookAddress;return n.all?Object(m.jsxs)("div",{children:[Object(m.jsxs)(Y,{label:"Bee Node",defaultOpen:!0,children:[Object(m.jsx)(X,{label:"Mode",value:(null===t||void 0===t?void 0:t.beeMode)||"Unknown"}),Object(m.jsx)(X,{label:"Agent",value:Object(m.jsxs)("div",{children:[Object(m.jsx)("a",{href:"https://github.com/ethersphere/bee",rel:"noreferrer",target:"_blank",children:"Bee"})," ".concat(r||"-"," "),Object(m.jsx)(ie.a,{size:"small",variant:"outlined",href:i,target:"_blank",children:c?"latest":"update"})]})}),Object(m.jsx)(ce,{label:"Public key",value:(null===s||void 0===s?void 0:s.publicKey)||""}),Object(m.jsx)(ce,{label:"PSS public key",value:(null===s||void 0===s?void 0:s.pssPublicKey)||""}),Object(m.jsx)(ce,{label:"Overlay address (Peer ID)",value:(null===s||void 0===s?void 0:s.overlay)||""}),Object(m.jsx)(Y,{level:1,label:"Underlay addresses",children:null===s||void 0===s?void 0:s.underlay.map((function(e){return Object(m.jsx)(X,{value:e},e)}))})]}),Object(m.jsxs)(Y,{label:"Blockchain",defaultOpen:!0,children:[Object(m.jsx)(ce,{label:"Ethereum address",value:(null===s||void 0===s?void 0:s.ethereum)||""}),Object(m.jsx)(ce,{label:"Chequebook contract address",value:(null===l||void 0===l?void 0:l.chequebookAddress)||""})]}),Object(m.jsx)(Y,{label:"Connectivity",defaultOpen:!0,children:Object(m.jsx)(Aa,{topology:o})})]}):Object(m.jsx)(Te,{})}function Pa(){var e=Object(a.useContext)(pe),t=e.apiUrl,n=e.apiDebugUrl,r=e.setApiUrl,c=e.setDebugApiUrl,i=e.lockedApiSettings;return Object(m.jsxs)(Y,{label:"API Settings",defaultOpen:!0,children:[Object(m.jsx)(Ln,{label:"Bee API",value:t,onConfirm:r,locked:i}),Object(m.jsx)(Ln,{label:"Bee Debug API",value:n,onConfirm:c,locked:i})]})}var Ta=Object(j.a)((function(e){return Object(h.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function Ba(e){var t=e.children,n=e.expandable,r=e.defaultOpen,c=Ta(),i=Object(a.useState)(Boolean(r)),o=Object(U.a)(i,2),s=o[0],l=o[1];return Object(m.jsxs)("div",{className:"".concat(c.root," ").concat(c.rootLevel2),children:[Object(m.jsxs)(F.a,{button:!0,onClick:function(){l(!s)},className:c.header,children:[t,s?Object(m.jsx)(V.a,{}):Object(m.jsx)(z.a,{})]}),Object(m.jsx)(M.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(m.jsx)("div",{className:c.contentLevel12,children:n})})]})}var Na=function(e){var t=e.postageStamps;return null===t?null:Object(m.jsx)(Y,{label:"Postage Stamps",defaultOpen:!0,children:t.map((function(e){return Object(m.jsx)(Ba,{expandable:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(ce,{label:"Batch ID",value:e.batchID}),Object(m.jsx)(X,{label:"Depth",value:String(e.depth)}),Object(m.jsx)(X,{label:"Capacity",value:"".concat(rn(4096*Math.pow(2,e.depth)*e.usage)," / ").concat(rn(4096*Math.pow(2,e.depth)))}),Object(m.jsx)(X,{label:"Amount",value:parseInt(e.amount,10).toLocaleString()})]}),children:Object(m.jsx)(Oa,{stamp:e,shorten:!0})},e.batchID)}))})},Da=Object(j.a)((function(){return Object(h.a)({root:{width:"100%",display:"grid"},actions:{display:"flex",width:"100%",flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function Ia(){var e=Da(),t=Object(R.g)(),n=Object(a.useContext)(wn),r=n.stamps,c=n.isLoading,i=n.error,o=n.start,s=n.stop,l=Object(a.useContext)(Ve).status;if(Object(a.useEffect)((function(){if(l.all)return o(),function(){return s()}}),[l]),!l.all)return Object(m.jsx)(Te,{});return Object(m.jsxs)("div",{className:e.root,children:[i&&Object(m.jsxs)(d.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",i.message]}),!i&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)("div",{className:e.actions,children:[Object(m.jsx)(st,{onClick:function(){t(mr.STAMPS_NEW)},iconType:ct.a,children:"Buy New Postage Stamp"}),Object(m.jsx)("div",{style:{height:"5px"},children:c&&Object(m.jsx)(b.a,{})})]}),Object(m.jsx)(Na,{postageStamps:r})]})]})}function _a(){var e=Object(R.g)();return Object(m.jsxs)("div",{children:[Object(m.jsx)(Ht,{children:"Buy new postage stamp"}),Object(m.jsx)(ja,{onFinished:function(){e(mr.STAMPS)}})]})}var La=n(949),Ra=n(380),Ua=["children","value","index"];function Fa(e){var t=e.children,n=e.value,a=e.index,r=Object(Ra.a)(e,Ua);return Object(m.jsx)("div",Object(Ie.a)(Object(Ie.a)({role:"tabpanel",hidden:n!==a},r),{},{children:n===a&&t}))}var Wa=Object(j.a)((function(e){return Object(h.a)({root:{flexGrow:1},content:{marginTop:e.spacing(2)}})}));function Ha(e){var t=e.values,n=e.index,a=e.indexChanged,c=Wa(),i=r.a.useState(n||0),o=Object(U.a)(i,2),s=o[0],l=o[1],u=void 0!==n?n:s;return Object(m.jsxs)("div",{className:c.root,children:[Object(m.jsx)(Vn.a,{value:u,onChange:function(e,t){a?a(t):l(t)},variant:"fullWidth",children:t.map((function(e,t){var n=e.label;return Object(m.jsx)(zn.a,{label:n},t)}))}),Object(m.jsx)("div",{className:c.content,children:t.map((function(e,t){var n=e.component;return Object(m.jsx)(Fa,{value:u,index:t,children:n},t)}))})]})}var Ma,Va,za=n(950),qa=function(e){return Object(m.jsx)("div",{style:{textAlign:"left"},children:Object(m.jsx)(za.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"}(Ma||(Ma={})),function(e){e[e.macOS=Ma.macOS]="macOS",e[e.Linux=Ma.Linux]="Linux"}(Va||(Va={}));var Ya={platform:Va.macOS,setPlatform:function(){}},Za=Object(a.createContext)(Ya);Za.Consumer;function Ga(e){var t=e.children,n=Object(a.useState)(Va.Linux),r=Object(U.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)?Ma.macOS:["iPhone","iPad","iPod"].includes(t)?Ma.iOS:["Win32","Win64","Windows","WinCE"].includes(t)?Ma.Windows:/Android/.test(e)?Ma.Android:/Linux/.test(t)?Ma.Linux:null}();i(function(e){return Object.keys(Va).includes(e)}(e)?e:Va.Linux)}),[]),Object(m.jsx)(Za.Provider,{value:{platform:c,setPlatform:i},children:t})}function Ka(e){var t=Object(a.useContext)(Za),n=t.platform,r=t.setPlatform;return Object(m.jsx)(Ha,{index:n,indexChanged:r,values:[{label:"Linux",component:Object(m.jsx)(qa,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})},{label:"macOS",component:Object(m.jsx)(qa,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})}]})}function Ja(e){var t=e.isOk,n=e.size,a=e.className,r=n||"1rem";return e.isLoading?Object(m.jsx)(b.a,{size:r,className:a}):Object(m.jsx)("span",{className:a,style:{backgroundColor:t?"#1de600":"#ff3a52",height:r,width:r,borderRadius:"50%",display:"inline-block"}})}function Xa(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=Object(a.useContext)(pe),c=r.setDebugApiUrl,i=r.apiDebugUrl,o=t.debugApiConnection;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:o,isLoading:n})," Connection to Bee Debug API"]}),children:[Object(m.jsx)(Dn,{children:o?"The connection to the Bee nodes debug API has been successful":"We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue."}),Object(m.jsx)(Ln,{label:"Bee Debug API",value:i,onConfirm:c}),!o&&Object(m.jsx)(Y,{level:1,label:"Troubleshoot",children:Object(m.jsx)(X,{label:Object(m.jsxs)("ol",{children:[Object(m.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(m.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(m.jsx)(La.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(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(m.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(m.jsx)(Ka,{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(m.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(m.jsx)("strong",{children:"debug-api-enable"})," must be set to ",Object(m.jsx)("strong",{children:"true"})," and"," ",Object(m.jsx)("strong",{children:"cors-allowed-origins"})," must be set to your host domain or IP (you can also use the wildcard ",Object(m.jsx)("code",{children:"cors-allowed-origins: ['*']"}),"). If edits are made to the configuration run the restart command below for changes to take effect."]}),Object(m.jsx)(Ka,{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 $a(){var e=Object(a.useContext)(pe),t=e.setApiUrl,n=e.apiUrl,r=Object(a.useContext)(Ve),c=r.status,i=r.isLoading,o=c.apiConnection;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:o,isLoading:i})," Connection to Bee API"]}),children:[Object(m.jsx)(Dn,{children:o?"The connection to the Bee nodes API has been successful":"Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it."}),Object(m.jsx)(Ln,{label:"Bee API",value:n,onConfirm:t}),!o&&Object(m.jsx)(Y,{level:1,label:"Troubleshoot",children:Object(m.jsx)(X,{label:Object(m.jsxs)("ol",{children:[Object(m.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(m.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(m.jsx)(Ka,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(m.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(m.jsx)(Ka,{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 Qa(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.latestUserVersion,c=e.latestPublishedVersion,i=e.latestBeeVersionUrl,o=t.version;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:o,isLoading:n})," Bee Version"]}),children:[Object(m.jsx)(Dn,{children:o?"You are running the latest version of Bee.":Object(m.jsxs)(m.Fragment,{children:["Your Bee version is out of date. Please update to the"," ",Object(m.jsx)("a",{href:i,rel:"noreferrer",target:"_blank",children:"latest"})," ","before continuing. Rerun the installation script below to upgrade. For more information please see the"," ",Object(m.jsx)("a",{href:"https://docs.ethswarm.org/docs/installation/manual#upgrading-bee",rel:"noreferrer",target:"_blank",children:"Docs"}),".",Object(m.jsx)(Ka,{showLineNumbers:!0,linux:"bee version\nwget https://github.com/ethersphere/bee/releases/download/".concat(c,"/bee_").concat(c,"_amd64.deb\nsudo dpkg -i bee_").concat(c,"_amd64.deb"),mac:"bee version\nbrew tap ethersphere/tap\nbrew install swarm-bee\nbrew services start swarm-bee"})]})}),Object(m.jsx)(X,{label:"Your Version",value:r||"-"}),Object(m.jsx)(X,{label:"Latest Version",value:c||"-"})]})}function er(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.nodeAddresses,c=t.blockchainConnection;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:c,isLoading:n})," Connection to Blockchain"]}),children:[Object(m.jsx)(Dn,{children:c?"Your node is connected to the xDai blockchain":Object(m.jsxs)(m.Fragment,{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(m.jsx)("a",{href:"https://www.xdaichain.com/",rel:"noreferrer",target:"_blank",children:"your own xDai node"}),", or use a provider instead - we recommend"," ",Object(m.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(m.jsx)("strong",{children:"swap-endpoint"})," in your configuration file."]})}),(null===r||void 0===r?void 0:r.ethereum)&&Object(m.jsx)(ce,{label:"Ethereum Address",value:null===r||void 0===r?void 0:r.ethereum})]})}var tr=function(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.chequebookAddress,c=t.chequebook;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:c,isLoading:n})," Chequebook Deployment & Funding"]}),children:[Object(m.jsx)(Dn,{children:c?"Your chequebook is deployed and funded":Object(m.jsxs)(m.Fragment,{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 (e.g. ",Object(m.jsx)("a",{href:"https://bzz.exchange/",children:"bzz.exchange"}),") and bridge it to the xDai network through the ",Object(m.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(m.jsx)("a",{href:"https://bridge.xdaichain.com/",children:"xDai Bridge"}),". See the"," ",Object(m.jsx)("a",{href:"https://www.xdaichain.com/#xdai-stable-chain",children:"official xDai website"})," for more information."]})}),r&&Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(ce,{label:"Chequebook Address",value:r.chequebookAddress}),Object(m.jsx)(Q,{children:Object(m.jsx)(nt,{})})]})]})};function nr(){var e=Object(a.useContext)(Ve),t=e.status,n=e.isLoading,r=e.topology,c=t.topology;return Object(m.jsxs)(Y,{label:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(Ja,{isOk:c,isLoading:n})," Connection to Peers"]}),children:[Object(m.jsx)(Dn,{children:c?"You are connected to other Bee nodes":"Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file."}),Object(m.jsx)(Aa,{topology:r})]})}function ar(){return Object(m.jsxs)("div",{children:[Object(m.jsx)(Xa,{}),Object(m.jsx)(Qa,{}),Object(m.jsx)(er,{}),Object(m.jsx)(tr,{}),Object(m.jsx)($a,{}),Object(m.jsx)(nr,{})]})}var rr=n(932),cr=n(933);function ir(e){return or.apply(this,arguments)}function or(){return(or=Object(De.a)(Ne.a.mark((function e(t){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("https://xbzz-faucet.apyos.dev/xbzz/".concat(t),{method:"POST"});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sr(e){return ur(e,"GET")}function lr(e,t){return ur(e,"POST",t)}function ur(e,t,n){return dr.apply(this,arguments)}function dr(){return(dr=Object(De.a)(Ne.a.mark((function e(t,n,a){var r,c,i,o;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=localStorage.getItem("apiKey")){e.next=3;break}throw Error("API key not found in local storage");case 3:return c={"content-type":"application/json",authorization:r},e.next=6,fetch(t,{method:n,headers:c,body:a?JSON.stringify(a):void 0});case 6:return i=e.sent,e.next=9,i.json();case 9:return o=e.sent,e.abrupt("return",o);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var br=n(946),jr=n(186),hr="https://rpc.gnosischain.com/";function pr(){return(pr=Object(De.a)(Ne.a.mark((function e(t){var n,a;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(hr,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",method:"eth_getBalance",params:[t,"latest"],id:1})});case 2:return n=e.sent,e.next=5,n.json();case 5:return a=e.sent,e.abrupt("return",a.result);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Or=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,type:"function"}],fr=new br.a.JsonRpcProvider(hr);function xr(){return xr=Object(De.a)(Ne.a.mark((function e(t){var n,a,r,c=arguments;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:"0xdbf3ea6f5bee45c02255b2c26a16f300502f68da",a=new jr.a(n,Or,fr),e.next=4,a.balanceOf(t);case 4:return r=e.sent,e.abrupt("return",r.toString());case 6:case"end":return e.stop()}}),e)}))),xr.apply(this,arguments)}var mr,gr={eth_getBalance:function(e){return pr.apply(this,arguments)},eth_getBalanceERC20:function(e){return xr.apply(this,arguments)}};function vr(){var e=Object(a.useContext)(Ve),t=e.nodeInfo,n=e.chequebookAddress,r=e.nodeAddresses,c=Object(l.b)().enqueueSnackbar,i=Object(a.useState)(null),o=Object(U.a)(i,2),s=o[0],u=o[1],d=Object(a.useState)(null),b=Object(U.a)(d,2),j=b[0],h=b[1],p=Object(a.useState)(!1),O=Object(U.a)(p,2),f=O[0],x=O[1],g=Object(a.useState)("https://rpc.gnosischain.com/"),v=Object(U.a)(g,2),y=v[0],w=v[1],k=parseInt(window.location.host.split(":")[1],10);function S(){return(S=Object(De.a)(Ne.a.mark((function e(){var t,n,a,r;return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.prev=1,e.next=4,sr("http://localhost:".concat(k,"/status"));case 4:return t=e.sent,n=t.address,e.next=8,fetch("http://getxdai.co/".concat(n,"/0.1"),{method:"POST"});case 8:return e.next=10,gr.eth_getBalance(n);case 10:return a=e.sent,u(a),e.next=14,gr.eth_getBalance(n);case 14:r=e.sent,h(r),c("Wallet funded successfully",{variant:"success"});case 17:return e.prev=17,x(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[1,,17,20]])})))).apply(this,arguments)}function C(){return(C=Object(De.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===n||void 0===n?void 0:n.chequebookAddress)){e.next=5;break}return x(!0),e.next=4,ir(null===n||void 0===n?void 0:n.chequebookAddress).finally((function(){return x(!1)}));case 4:c("Successfully funded chequebook address",{variant:"success"});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(){return(A=Object(De.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===r||void 0===r?void 0:r.ethereum)){e.next=5;break}return x(!0),e.next=4,ir(null===r||void 0===r?void 0:r.ethereum).finally((function(){return x(!1)}));case 4:c("Successfully funded overlay address",{variant:"success"});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(){return(P=Object(De.a)(Ne.a.mark((function e(){return Ne.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.prev=1,e.next=4,lr("http://localhost:".concat(k,"/config"),{"chain-enable":!0,"swap-enable":!0,"swap-endpoint":y});case 4:return e.next=6,lr("http://localhost:".concat(k,"/restart"));case 6:c("Restarting Bee in Light Mode...",{variant:"success"});case 7:return e.prev=7,x(!1),e.finish(7);case 10:case"end":return e.stop()}}),e,null,[[1,,7,10]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){sr("http://localhost:".concat(k,"/status")).then((function(e){return gr.eth_getBalance(e.address)})).then((function(e){return u(e)})),sr("http://localhost:".concat(k,"/status")).then((function(e){return gr.eth_getBalanceERC20(e.address)})).then((function(e){return h(e)}))}),[k]),t?Object(m.jsxs)("div",{children:[Object(m.jsx)(Ht,{children:"Upgrade"}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(rr.a,{variant:"outlined",children:Object(m.jsxs)(rt.a,{p:2,children:[Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(H.a,{variant:"h1",children:"Wallet"})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsxs)(H.a,{children:["Your current balance is ",new We.a(s||"0",18).toSignificantDigits(4)," xDAI and"," ",new We.a(j||"0",16).toSignificantDigits(4)," xBZZ. Fund your node with xDAI so chequebook can be deployed."]})}),Object(m.jsxs)(Q,{children:[Object(m.jsx)(st,{onClick:function(){return S.apply(this,arguments)},iconType:cr.a,loading:f,disabled:f,variant:"outlined",children:"Fund xDAI"}),(null===n||void 0===n?void 0:n.chequebookAddress)&&"0x0000000000000000000000000000000000000000"!==(null===n||void 0===n?void 0:n.chequebookAddress)&&Object(m.jsx)(st,{onClick:function(){return C.apply(this,arguments)},iconType:cr.a,loading:f,disabled:f,variant:"outlined",children:"Fund xBZZ (Chequebook)"}),Object(m.jsx)(st,{onClick:function(){return A.apply(this,arguments)},iconType:cr.a,loading:f,disabled:f,variant:"outlined",children:"Fund xBZZ (Overlay)"})]})]})})}),Object(m.jsx)(rt.a,{mb:4,children:Object(m.jsx)(rr.a,{variant:"outlined",children:Object(m.jsxs)(rt.a,{p:2,children:[Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(H.a,{variant:"h1",children:"RPC Provider"})}),Object(m.jsx)(rt.a,{mb:2,children:Object(m.jsx)(Dt,{label:"RPC Provider",name:"rpc-provider",defaultValue:"https://rpc.gnosischain.com/",onChange:function(e){w(e.target.value)}})})]})})}),Object(m.jsx)(rr.a,{variant:"outlined",children:Object(m.jsxs)(rt.a,{p:2,children:[Object(m.jsx)(H.a,{variant:"h1",children:"Upgrade Node"}),!s&&Object(m.jsx)(rt.a,{mt:2,children:Object(m.jsx)(H.a,{children:"Fund your node to unlock upgrading."})}),Object(m.jsx)(rt.a,{mt:4,children:Object(m.jsx)(st,{onClick:function(){return P.apply(this,arguments)},iconType:E.a,loading:f,disabled:f||!s,variant:"outlined",children:"Switch to Light Mode"})})]})})]}):Object(m.jsx)(Jn,{})}!function(e){e.INFO="/",e.UPGRADE="/upgrade",e.FILES="/files",e.UPLOAD="/files/upload",e.UPLOAD_IN_PROGRESS="/files/upload/workflow",e.DOWNLOAD="/files/download",e.HASH="/files/hash/:hash",e.ACCOUNTING="/accounting",e.SETTINGS="/settings",e.STAMPS="/stamps",e.STAMPS_NEW="/stamps/new",e.STATUS="/status",e.FEEDS="/feeds",e.FEEDS_NEW="/feeds/new",e.FEEDS_UPDATE="/feeds/update/:hash",e.FEEDS_PAGE="/feeds/:uuid"}(mr||(mr={}));var yr=function(){return Object(m.jsxs)(R.c,{children:[Object(m.jsx)(R.a,{path:mr.UPLOAD_IN_PROGRESS,element:Object(m.jsx)(ga,{})}),Object(m.jsx)(R.a,{path:mr.UPLOAD,element:Object(m.jsx)(va,{})}),Object(m.jsx)(R.a,{path:mr.DOWNLOAD,element:Object(m.jsx)(Zn,{})}),Object(m.jsx)(R.a,{path:mr.UPGRADE,element:Object(m.jsx)(vr,{})}),Object(m.jsx)(R.a,{path:mr.HASH,element:Object(m.jsx)(la,{})}),Object(m.jsx)(R.a,{path:mr.ACCOUNTING,element:Object(m.jsx)(at,{})}),Object(m.jsx)(R.a,{path:mr.SETTINGS,element:Object(m.jsx)(Pa,{})}),Object(m.jsx)(R.a,{path:mr.STAMPS,element:Object(m.jsx)(Ia,{})}),Object(m.jsx)(R.a,{path:mr.STAMPS_NEW,element:Object(m.jsx)(_a,{})}),Object(m.jsx)(R.a,{path:mr.STATUS,element:Object(m.jsx)(ar,{})}),Object(m.jsx)(R.a,{path:mr.FEEDS,element:Object(m.jsx)(Lt,{})}),Object(m.jsx)(R.a,{path:mr.FEEDS_NEW,element:Object(m.jsx)(Zt,{})}),Object(m.jsx)(R.a,{path:mr.FEEDS_UPDATE,element:Object(m.jsx)(An,{})}),Object(m.jsx)(R.a,{path:mr.FEEDS_PAGE,element:Object(m.jsx)(gn,{})}),Object(m.jsx)(R.a,{path:mr.INFO,element:Object(m.jsx)(Ea,{})})]})},wr=n(11),kr=n(935),Sr=Object(wr.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"}}}}}))(F.a),Cr=Object(j.a)((function(e){return Object(h.a)({icon:{color:"inherit"},activeIcon:{color:e.palette.primary.main}})}));function Ar(e){var t=e.iconStart,n=e.iconEnd,a=e.path,r=e.label,c=Cr(),i=Object(R.f)(),o=Boolean(a&&Object(R.d)(i.pathname,a));return Object(m.jsxs)(Sr,{button:!0,selected:o,disableRipple:!0,children:[Object(m.jsx)(kr.a,{className:o?c.activeIcon:c.icon,children:t}),Object(m.jsx)(W.a,{primary:r}),Object(m.jsx)(kr.a,{className:o?c.activeIcon:c.icon,children:n})]})}var Er=n(936),Pr=Object(j.a)((function(e){return Object(h.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",color:"white","@media (hover: none)":{backgroundColor:"#2c2c2c",color:"white"}}},smallerText:{fontSize:"0.9rem"}})}));function Tr(e){var t=e.path,n=Object(a.useContext)(Ve),r=n.status,c=n.isLoading,i=Pr(),o=Object(R.f)(),s=Boolean(t&&Object(R.d)(o.pathname,t));return Object(m.jsxs)(F.a,{button:!0,classes:{root:"".concat(i.root," ").concat(r.all?"":i.rootError),button:i.button},selected:s,disableRipple:!0,children:[Object(m.jsx)(kr.a,{style:{marginLeft:"30px"},children:Object(m.jsx)(Ja,{isOk:r.all,isLoading:c})}),Object(m.jsx)(W.a,{primary:Object(m.jsx)(H.a,{className:i.smallerText,children:"Node ".concat(r.all?"OK":"Error")})}),Object(m.jsx)(kr.a,{className:i.icon,children:r.all?null:Object(m.jsx)(Er.a,{className:i.iconSmall})})]})}var Br=[{label:"Info",path:mr.INFO,icon:A.a},{label:"Upgrade",path:mr.UPGRADE,icon:E.a},{label:"Files",path:mr.UPLOAD,icon:P.a},{label:"Feeds",path:mr.FEEDS,icon:T.a},{label:"Stamps",path:mr.STAMPS,icon:B.a},{label:"Accounting",path:mr.ACCOUNTING,icon:N.a},{label:"Settings",path:mr.SETTINGS,icon:D.a}],Nr=Object(j.a)((function(e){return Object(h.a)({root:{flexWrap:"nowrap",minHeight:"100vh",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)},drawer:{width:300,flexShrink:0},drawerPaper:{width:300,backgroundColor:"#212121"},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 Dr(){var e=Nr();return Object(m.jsx)(v.a,{className:e.drawer,variant:"permanent",anchor:"left",classes:{paper:e.drawerPaper},children:Object(m.jsxs)(y.a,{container:!0,direction:"column",justifyContent:"space-between",className:e.root,children:[Object(m.jsx)(y.a,{className:e.logo,children:Object(m.jsx)(u.b,{to:mr.INFO,children:Object(m.jsx)("img",{alt:"swarm",src:_})})}),Object(m.jsxs)(y.a,{children:[Object(m.jsx)(w.a,{children:Br.map((function(t){return Object(m.jsx)(u.b,{to:t.path,className:e.link,children:Object(m.jsx)(Ar,{iconStart:Object(m.jsx)(t.icon,{className:e.icon}),path:t.path,label:t.label},t.path)},t.path)}))}),Object(m.jsx)(k.a,{className:e.divider}),Object(m.jsx)(w.a,{children:Object(m.jsx)(S.a,{href:L.a.BEE_DOCS_HOST,target:"_blank",className:e.link,children:Object(m.jsx)(Ar,{iconStart:Object(m.jsx)(I.a,{className:e.icon}),iconEnd:Object(m.jsx)(C.a,{className:e.iconSmall}),label:Object(m.jsx)("span",{children:"Docs"})})})})]}),Object(m.jsx)(y.a,{children:Object(m.jsx)(u.b,{to:mr.STATUS,className:e.link,children:Object(m.jsx)(Tr,{path:mr.STATUS})})})]})})}var Ir,_r=Object(j.a)((function(e){return Object(h.a)({content:{backgroundColor:e.palette.background.default,minHeight:"100vh"}})})),Lr=function(e){var t=_r(),n=Object(a.useContext)(Ve).isLoading;return Object(m.jsxs)("div",{style:{display:"flex"},children:[Object(m.jsx)(Dr,{}),Object(m.jsx)(d.a,{className:t.content,children:Object(m.jsx)(g,{children:Object(m.jsx)(m.Fragment,{children:n?Object(m.jsx)("div",{style:{textAlign:"center",width:"100%"},children:Object(m.jsx)(b.a,{})}):e.children})})})]})},Rr=n(378),Ur=n(201),Fr=Object(Rr.a)({palette:{type:"light",background:{default:"#efefef"},primary:{light:"#fcf2e8",main:"#dd7700",dark:Ur.a[800]},secondary:{main:"#333333"}},typography:{fontFamily:["Work Sans","Montserrat","Nunito","Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(","),h1:{fontSize:"1.3rem",fontWeight:500},h2:{fontSize:"1rem",fontWeight:500},h3:{fontSize:"0.8rem",fontWeight:500},body2:{fontFamily:'"IBM Plex Mono", monospace',fontWeight:500,fontSize:"1rem"}}});Fr.overrides={MuiListItem:{button:{"&:hover":{backgroundColor:"#fcf2e8",color:(Ir=Fr).palette.primary.main,"@media (hover: none)":{backgroundColor:"#fcf2e8",color:Ir.palette.primary.main}}}},MuiContainer:{root:{padding:Ir.spacing(8)},maxWidthXs:{padding:Ir.spacing(8)},maxWidthSm:{padding:Ir.spacing(8)},maxWidthMd:{padding:Ir.spacing(8)},maxWidthLg:{padding:Ir.spacing(8)},maxWidthXl:{padding:Ir.spacing(8)}},MuiButton:{startIcon:{marginLeft:Ir.spacing(1)},endIcon:{marginRight:Ir.spacing(1)},outlined:{border:"none",borderRadius:Ir.spacing(10),color:Ir.palette.primary.main,backgroundColor:"#fcf2e8"},outlinedSizeSmall:{padding:Ir.spacing(1),paddingLeft:Ir.spacing(2),paddingRight:Ir.spacing(2),boxShadow:"none","&:hover":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none"}}},outlinedSizeLarge:{padding:Ir.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeLarge:{padding:Ir.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeSmall:{padding:Ir.spacing(1),paddingLeft:Ir.spacing(2),paddingRight:Ir.spacing(2),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none"}}},contained:{padding:Ir.spacing(2),backgroundColor:"white",boxShadow:"none",borderRadius:0,"&:hover":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ir.palette.primary.main,color:"white",boxShadow:"none"}},"&:focus":{backgroundColor:Ir.palette.primary.main,color:"white"},"&:active":{backgroundColor:Ir.palette.primary.main,color:"white"},"&:disabled":{backgroundColor:"white"}}},MuiTab:{root:{backgroundColor:Ir.palette.background.paper,"&:hover":{backgroundColor:"#fcf2e8",color:Ir.palette.primary.main,opacity:1},"&$selected":{fontWeight:Ir.typography.fontWeightMedium}},textColorInherit:{opacity:.5}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:"transparent"}}},Fr.props={MuiTab:{disableRipple:!0},MuiButtonBase:{disableRipple:!0}};var Wr=function(e){var t=e.beeApiUrl,n=e.beeDebugApiUrl,a=e.lockedApiSettings;return Object(m.jsx)("div",{className:"App",children:Object(m.jsx)(s.a,{theme:Fr,children:Object(m.jsx)(Oe,{beeApiUrl:t,beeDebugApiUrl:n,lockedApiSettings:a,children:Object(m.jsx)(qe,{children:Object(m.jsx)(Sn,{children:Object(m.jsx)(fn,{children:Object(m.jsx)(dt,{children:Object(m.jsx)(Ga,{children:Object(m.jsx)(l.a,{children:Object(m.jsx)(u.a,{children:Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)(o.a,{}),Object(m.jsx)(Lr,{children:Object(m.jsx)(yr,{})})]})})})})})})})})})})})},Hr=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,953)).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(m.jsx)(r.a.StrictMode,{children:Object(m.jsx)(Wr,{})}),document.getElementById("root")),Hr()}},[[829,1,2]]]); +//# sourceMappingURL=main.cfa2d25c.chunk.js.map \ No newline at end of file diff --git a/static/dashboard/static/js/main.cfa2d25c.chunk.js.map b/static/dashboard/static/js/main.cfa2d25c.chunk.js.map new file mode 100644 index 0000000..9a5d766 --- /dev/null +++ b/static/dashboard/static/js/main.cfa2d25c.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["utils/index.ts","models/Token.ts","utils/identity.ts","config.ts","components/ErrorBoundary.tsx","assets/logo.svg","components/ExpandableList.tsx","components/ExpandableListItem.tsx","components/ExpandableListItemActions.tsx","components/ExpandableListItemKey.tsx","providers/Settings.tsx","components/ClipboardCopy.tsx","components/QRCodeModal.tsx","components/EthereumAddress.tsx","components/CashoutModal.tsx","pages/accounting/PeerBalances.tsx","components/TroubleshootConnectionCard.tsx","providers/Bee.tsx","hooks/apiHooks.tsx","hooks/accounting.ts","components/WithdrawDepositModal.tsx","containers/WithdrawModal.tsx","containers/DepositModal.tsx","pages/accounting/index.tsx","components/SwarmButton.tsx","providers/Feeds.tsx","components/SwarmDialog.tsx","components/CloseButton.tsx","components/TitleWithClose.tsx","pages/feeds/DeleteFeedDialog.tsx","components/Code.tsx","pages/feeds/ExportFeedDialog.tsx","components/SwarmTextInput.tsx","pages/feeds/ImportFeedDialog.tsx","pages/feeds/index.tsx","components/DocumentationText.tsx","components/HistoryHeader.tsx","components/SwarmSelect.tsx","pages/feeds/CreateNewFeed.tsx","components/ExpandableListItemLink.tsx","utils/file.ts","utils/image.ts","constants.ts","providers/File.tsx","pages/files/UploadArea.tsx","pages/feeds/FeedSubpage.tsx","providers/Stamps.tsx","pages/feeds/FeedPasswordDialog.tsx","pages/feeds/UpdateFeed.tsx","components/ExpandableListItemNote.tsx","components/ExpandableListItemInput.tsx","utils/local-storage.ts","utils/hash.ts","components/History.tsx","utils/date.ts","pages/files/FileNavigation.tsx","pages/files/Download.tsx","components/Loading.tsx","components/FitImage.tsx","components/StripedWrapper.tsx","pages/files/AssetIcon.tsx","pages/files/AssetPreview.tsx","pages/files/AssetSummary.tsx","pages/files/DownloadActionBar.tsx","pages/files/Share.tsx","components/ProgressIndicator.tsx","pages/stamps/PostageStampCreation.tsx","pages/stamps/PostageStampSelector.tsx","components/Capacity.tsx","pages/stamps/PostageStamp.tsx","pages/files/StampPreview.tsx","pages/files/UploadActionBar.tsx","pages/files/Upload.tsx","pages/files/UploadLander.tsx","utils/threshold.ts","components/TopologyStats.tsx","pages/info/index.tsx","pages/settings/index.tsx","components/ExpandableElement.tsx","pages/stamps/StampsTable.tsx","pages/stamps/index.tsx","pages/stamps/CreatePostageStampPage.tsx","components/TabsContainer.tsx","providers/Platform.tsx","components/CodeBlock.tsx","components/CodeBlockTabs.tsx","components/StatusIcon.tsx","pages/status/SetupSteps/DebugConnectionCheck.tsx","pages/status/SetupSteps/NodeConnectionCheck.tsx","pages/status/SetupSteps/VersionCheck.tsx","pages/status/SetupSteps/EthereumConnectionCheck.tsx","pages/status/SetupSteps/ChequebookDeployFund.tsx","pages/status/SetupSteps/PeerConnection.tsx","pages/status/index.tsx","utils/bzz-faucet.ts","utils/net.ts","utils/rpc.ts","routes.tsx","pages/upgrade/index.tsx","components/SideBarItem.tsx","components/SideBarStatus.tsx","components/SideBar.tsx","layout/Dashboard.tsx","theme.tsx","App.tsx","reportWebVitals.ts","index.tsx"],"names":["isInteger","value","BigNumber","isBigNumber","makeBigNumber","toString","TypeError","sleepMs","ms","a","Promise","resolve","setTimeout","unwrapPromiseSettlements","promiseSettledResults","promises","values","fulfilled","filter","promise","status","rejected","map","x","reason","String","makeRetriablePromise","fn","maxRetries","delayMs","reject","tries","results","extractSwarmHash","string","matches","match","uuidV4","replace","s","c","parseInt","crypto","getRandomValues","Uint8Array","formatEnum","charAt","toUpperCase","slice","toLowerCase","replaceAll","secondsToTimeString","seconds","unit","Math","round","toFixed","convertDepthToBytes","depth","convertAmountToSeconds","amount","pricePerBlock","calculateStampPrice","Token","BigInt","shortenText","text","length","separator","POSSIBLE_DECIMALS","decimals","includes","this","dividedBy","pow","digits","toDecimal","asString","indexOfSignificantDigit","reachedDecimalPoint","i","char","t","multipliedBy","generateWallet","buffer","Wallet","Buffer","from","persistIdentity","identities","identity","existingIndex","findIndex","uuid","splice","unshift","localStorage","setItem","JSON","stringify","persistIdentitiesWithoutUpdate","convertWalletToIdentity","type","name","password","Error","getPrivateKeyString","toV3String","identityString","address","getAddressString","importIdentity","data","getWallet","wallet","startsWith","parse","getWalletFromIdentity","fromPrivateKey","trimHexString","fromV3","updateFeed","beeApi","hash","stamp","feedHash","createFeedManifest","repeat","writer","makeFeedWriter","upload","getProcessEnv","key","process","config","BEE_API_HOST","BEE_DEBUG_API_HOST","BLOCKCHAIN_EXPLORER_URL","BEE_DOCS_HOST","BEE_DISCORD_HOST","GITHUB_REPO_URL","sessionStorage","getItem","ErrorBoundary","props","state","error","errorInfo","console","message","children","Component","useStyles","makeStyles","theme","createStyles","root","width","padding","margin","marginTop","spacing","rootLevel1","rootLevel2","header","backgroundColor","palette","background","paper","contentLevel0","contentLevel12","infoText","color","ExpandableList","label","level","defaultOpen","info","classes","useState","Boolean","open","setOpen","rootLevelClass","typographyVariant","contentLevelClass","className","ListItem","button","onClick","ListItemText","primary","Typography","variant","style","display","ExpandLess","ExpandMore","Collapse","in","timeout","unmountOnExit","marginBottom","wordBreak","copyValue","cursor","borderRadius","main","ExpandableListItem","tooltip","Grid","container","direction","justifyContent","alignItems","Tooltip","title","placement","arrow","IconButton","size","strokeWidth","wrapper","flexDirection","flexWrap","action","marginRight","ExpandableListItemActions","Array","isArray","borderLeft","headerOpen","content","keyMargin","ExpandableListItemKey","copied","setCopied","toggleOpen","tooltipClickHandler","tooltipCloseHandler","splitValues","nonPrefixLength","lengthWithoutPrefix","split","hasPrefix","test","spanText","onClose","component","initialValues","apiUrl","apiDebugUrl","beeDebugApi","setApiUrl","setDebugApiUrl","lockedApiSettings","Context","createContext","Consumer","Provider","beeApiUrl","beeDebugApiUrl","extLockedApiSettings","setBeeApi","setBeeDebugApi","url","debugUrl","useEffect","Bee","e","BeeDebug","ClipboardCopy","enqueueSnackbar","useSnackbar","marginLeft","height","QRCodeModal","FilterCenterFocusSharp","Dialog","textAlign","DialogTitle","id","bgColor","fgColor","includeMargin","renderAs","EthereumAddress","hideBlockie","paddingTop","truncate","maxWidth","overflow","textOverflow","whiteSpace","href","transaction","target","rel","CheckoutModal","peerId","uncashedAmount","loadingCashout","setLoadingCashout","useContext","SettingsContext","handleClose","Button","startIcon","substr","DialogContent","DialogContentText","overflowWrap","Container","CircularProgress","DialogActions","cashoutLastCheque","then","res","catch","finally","disabled","PeerBalances","accounting","isLoadingUncashed","totalUncashed","toFixedDecimal","peer","balance","received","sent","total","toBigNumber","isGreaterThan","icon","TroubleshootConnectionCard","item","align","Link","to","ROUTES","STATUS","newApiKey","URLSearchParams","window","location","search","get","all","version","blockchainConnection","debugApiConnection","apiConnection","topology","chequebook","latestPublishedVersion","undefined","latestUserVersion","latestUserVersionExact","isLatestBeeVersion","latestBeeVersionUrl","apiHealth","debugApiHealth","nodeAddresses","nodeInfo","chequebookAddress","peers","chequebookBalance","peerBalances","peerCheques","settlements","chainState","latestBeeRelease","isLoading","isRefreshing","lastUpdate","start","stop","refresh","getStatus","devMode","REACT_APP_DEV_MODE","beeMode","semver","satisfies","engines","bee","includePrerelease","ethereum","connected","totalBalance","Object","every","v","setApiHealth","setDebugApiHealth","setNodeAddresses","setNodeInfo","setNodeTopology","setChequebookAddress","setPeers","setChequebookBalance","setPeerBalances","setPeerCheques","setSettlements","setChainState","setLatestBeeRelease","isLoadingLatestBeeRelease","setLoading","setError","axios","useLatestBeeRelease","setIsLoading","setIsRefreshing","setLastUpdate","frequency","setFrequency","coerce","chequeBalanceWrapper","getChequebookBalance","availableBalance","peerBalanceWrapper","getAllBalances","balances","settlementsWrapper","getAllSettlements","totalReceived","totalSent","isConnected","getHealth","getNodeAddresses","getNodeInfo","getTopology","getPeers","getChequebookAddress","getLastCheques","getChainState","allSettled","Date","now","interval","setInterval","clearInterval","html_url","freq","useAccounting","setIsloadingUncashed","uncashedAmounts","setUncashedAmounts","gt","getLastCashoutAction","forEach","plus","minus","sort","b","diff","toNumber","mergeAccounting","WithdrawDepositModal","successMessage","errorMessage","dialogMessage","min","max","setAmount","amountToken","setAmountToken","amountError","setAmountError","handleAction","toBigInt","transactionHash","stopPropagation","Input","autoFocus","placeholder","fullWidth","onChange","fromDecimal","isLessThan","FormHelperText","WithdrawModal","withdrawTokens","DepositModal","depositTokens","Accounting","BeeContext","position","stroke","transition","cancelButton","spinnerWrapper","left","top","transform","SwarmButton","iconType","loading","cancel","React","createElement","join","event","currentTarget","blur","setIdentities","SwarmDialog","PaperProps","Box","p","sx","CloseButton","Close","fontWeight","TitleWithClose","DeleteFeedDialog","onConfirm","mb","Trash","X","pre","maxHeight","prettifyString","Code","prettify","ExportFeedDialog","Download","saveAs","Blob","Clipboard","navigator","clipboard","writeText","field","border","SwarmTextInput","optional","formik","defaultValue","TextField","required","InputProps","disableUnderline","textarea","displayNone","ImportFeedDialog","textareaValue","setTextareaValue","setName","fileInputRef","useRef","feed","onFeedReady","fileReader","FileReader","file","files","onload","result","readAsText","ref","TextareaAutosize","minRows","Upload","current","click","Check","Feeds","IdentityContext","navigate","useNavigate","selectedIdentity","setSelectedIdentity","showImport","setShowImport","showExport","setShowExport","showDelete","setShowDelete","onDialogClose","updatedFeeds","onDelete","PlusSquare","FEEDS_NEW","mt","FEEDS_PAGE","Info","fontSize","DocumentationText","pressable","HistoryHeader","mr","ArrowBack","select","option","SwarmSelect","options","Select","MenuProps","MenuListProps","disablePadding","square","MenuItem","identityName","CreateNewFeed","FeedsContext","getAllPostageBatch","stamps","FEEDS","onSubmit","submitForm","bgcolor","openLinkIcon","ExpandableListItemLink","link","navigationType","allowClipboard","displayValue","onNavigation","OpenInNewSharp","ArrowForward","indexHtmls","detectIndexHtml","paths","getPath","exactMatch","find","indexPath","prefix","y","commonPrefix","getHumanReadableFileSize","bytes","getAssetNameFromFiles","f","path","webkitRelativePath","packageFile","fullPath","lastModified","stream","arrayBuffer","resize","reader","readAsDataURL","src","img","Image","dimensions","imgWidth","imgHeight","ratioWidth","ratioHeight","ratio","getDimensions","elem","document","ctx","getContext","drawImage","canvas","toBlob","blob","onerror","META_FILE_NAME","PREVIEW_FILE_NAME","PREVIEW_DIMENSIONS","defaultUploadOrigin","origin","setFiles","uploadOrigin","setUploadOrigin","metadata","setMetadata","previewUri","setPreviewUri","previewBlob","setPreviewBlob","reduce","isWebsite","count","getMetadata","URL","revokeObjectURL","createObjectURL","areaWrapper","dropzone","default","outline","zIndex","opacity","buttonWrapper","UploadArea","showHelp","strictWebsiteMode","setStrictWebsiteMode","setVersion","getDropzoneInputDomElement","querySelector","onUploadCollectionClick","element","setAttribute","dropzoneClass","FilePaths","indexDocument","UPLOAD_IN_PROGRESS","filesLimit","maxFileSize","showPreviews","removeAttribute","FilePlus","FolderPlus","PlusCircle","FeedSubpage","useParams","available","setAvailable","downloadData","swarmCid","enrichStamp","postageBatch","bucketDepth","usage","utilization","usageText","ceil","setStamps","FeedPasswordDialog","feedName","onProceed","onCancel","setPassword","UpdateFeed","StampContext","selectedStamp","setSelectedStamp","showPasswordPrompt","setShowPasswordPrompt","onFeedUpdate","Reflect","batchID","batchId","Bookmark","typography","ExpandableListItemNote","HISTORY_KEYS","unselectableLabel","userSelect","WebkitUserSelect","MozUserSelect","msUserSelect","confirmLabel","confirmLabelDisabled","expandedOnly","helperText","mapperFn","locked","inputValue","setInputValue","InputBase","hidden","Search","shortenHash","sliceLength","putHistory","history","getHistorySafe","createdAt","items","parsed","isHistoryItem","determineHistoryName","History","localStorageKey","setItems","date","trim","flexGrow","leftTab","rightTab","FileNavigation","active","Tabs","newValue","DOWNLOAD","UPLOAD","Tab","referenceError","setReferenceError","identifier","manifestJs","ManifestJs","resolveFeedManifest","feedIdentifier","isManifest","getIndexDocumentPath","DOWNLOAD_HISTORY","HASH","onSwarmIdentifier","Utils","isHexString","recognizeSwarmHash","Loading","image","objectFit","FitImage","inlineStyles","alt","StripedWrapper","AssetIcon","AssetPreview","previewComponent","Web","AssetSummary","DownloadActionBar","onOpen","onDownload","onUpdateFeed","hasIndexDocument","Share","reference","downloading","setDownloading","swarmEntries","setSwarmEntries","setIndexDocument","notFound","setNotFound","preview","setPreview","getHashes","entries","previewFile","keys","downloadFile","mtdt","remoteMetadata","zip","JSZip","generateAsync","prepare","FEEDS_UPDATE","flex","todo","inProgress","done","ProgressIndicator","steps","index","pickClass","initialFormValues","PostageStampCreation","onFinished","StampsContext","getTtl","isCurrentPriceAvailable","currentPrice","Number","getPrice","isNaN","price","toSignificantDigits","actions","createPostageBatch","resetForm","setSubmitting","validate","errors","isLessThanOrEqualTo","isValid","isSubmitting","PostageStampSelector","onSelect","stampId","Capacity","integerUsage","used","free","PostageStamp","shorten","StampPreview","UploadActionBar","step","onUpload","onGoBack","isUploading","hasStamp","uploadLabel","stampMode","setStampMode","Layers","ArrowLeft","setStep","setStamp","setUploading","FileContext","uploadFiles","fls","idx","substrStart","mtd","metafile","File","push","UPLOAD_HISTORY","UploadLander","OPTIMAL_POPULATION","GENERIC_ERROR","THRESHOLDS","connectedPeers","minimumValue","explanation","score","population","toLocaleString","pickThreshold","thresholds","maximumScore","last","TopologyStats","maximumTotalScore","sum","actualTotalScore","percentageText","Status","publicKey","pssPublicKey","overlay","underlay","addr","Settings","ExpandableElement","expandable","StampsTable","postageStamps","Stamp","STAMPS_NEW","CreatePostageStampPage","STAMPS","TabPanel","other","role","SimpleTabs","indexChanged","setValue","Platforms","SupportedPlatforms","CodeBlock","language","showLineNumbers","code","macOS","Linux","platform","setPlatform","os","userAgent","iOS","Windows","Android","getOS","isSupportedPlatform","CodeBlockTabs","linux","mac","StatusIcon","isOk","NodeConnectionCheck","elevation","severity","VersionCheck","EthereumConnectionCheck","ChequebookDeployFund","PeerConnection","NodeSetupWorkflow","requestBzz","fetch","method","getJson","sendRequest","postJson","body","authorization","headers","response","json","PROVIDER","jsonrpc","params","partialERC20tokenABI","constant","inputs","outputs","payable","provider","providers","JsonRpcProvider","tokenAddress","contract","Contract","balanceOf","Rpc","eth_getBalance","eth_getBalanceERC20","UpgradePage","setBalance","balanceBzz","setBalanceBzz","rpcProvider","setRpcProvider","port","host","Card","Send","ArrowUp","BaseRouter","UPGRADE","ACCOUNTING","SETTINGS","INFO","StyledListItem","withStyles","paddingLeft","paddingRight","activeIcon","SideBarItem","iconStart","iconEnd","useLocation","isSelected","matchPath","pathname","selected","disableRipple","ListItemIcon","iconSmall","rootError","smallerText","navBarItems","Home","FileText","DollarSign","minHeight","paddingBottom","drawer","flexShrink","drawerPaper","logo","divider","textDecoration","SideBar","Drawer","anchor","Logo","List","Divider","Dashboard","createTheme","light","dark","orange","secondary","fontFamily","h1","h2","h3","body2","overrides","MuiListItem","MuiContainer","maxWidthXs","maxWidthSm","maxWidthMd","maxWidthLg","maxWidthXl","MuiButton","endIcon","outlined","outlinedSizeSmall","boxShadow","outlinedSizeLarge","containedSizeLarge","containedSizeSmall","contained","MuiTab","fontWeightMedium","textColorInherit","MuiTabs","borderBottom","indicator","MuiButtonBase","App","ThemeProvider","CssBaseline","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"srBAUO,SAASA,EAAUC,GACxB,OAAQC,YAAUC,YAAYF,IAAUA,EAAMD,aAAiC,kBAAVC,EAYhE,SAASG,EAAcH,GAC5B,GAAIC,YAAUC,YAAYF,GAAQ,OAAOA,EAEzC,GAAqB,kBAAVA,EAAoB,OAAO,IAAIC,YAAUD,GAEpD,GAAqB,kBAAVA,EAAoB,OAAO,IAAIC,YAAUD,EAAMI,YAG1D,GAAqB,kBAAVJ,EAAwD,OAAO,IAAIC,YAAUD,GAExF,MAAM,IAAIK,UAAJ,uEAA8EL,EAA9E,mBAA8FA,IAa/F,SAAeM,EAAtB,kC,4CAAO,WAAuBC,GAAvB,SAAAC,EAAA,sEACC,IAAIC,SAAc,SAAAC,GAAO,OAC7BC,YAAW,WACTD,MACCH,MAJA,4C,sBA4BA,SAASK,EACdC,GAEA,IAjBuCC,EAiBjCC,EAbC,CAAEC,WAJ8BF,EAiBFD,GAhBVI,QAAO,SAAAC,GAAO,MAAuB,cAAnBA,EAAQC,UAGjCC,SAFHN,EAASG,QAAO,SAAAC,GAAO,MAAuB,aAAnBA,EAAQC,WAmBpD,MAAO,CAAEH,UAHSD,EAAOC,UAAUK,KAAI,SAAAC,GAAC,OAAIA,EAAEtB,SAG1BoB,SAFHL,EAAOK,S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B46B,OAAQ,CACNnD,eAAe,GAEjByD,cAAe,CACbzD,eAAe,IClJnB,IA6Be0D,GA7BH,SAAC,GAAD,IAAG/zB,EAAH,EAAGA,UAAWC,EAAd,EAAcA,eAAgBN,EAA9B,EAA8BA,kBAA9B,OACV,qBAAKrE,UAAU,MAAf,SACE,cAAC04B,EAAA,EAAD,CAAe16B,MAAOA,GAAtB,SACE,cAAC,GAAD,CAAkB0G,UAAWA,EAAWC,eAAgBA,EAAgBN,kBAAmBA,EAA3F,SACE,cAAC,GAAD,UACE,cAAC,GAAD,UACE,cAAC,GAAD,UACE,cAAC,GAAD,UACE,cAAC,GAAD,UACE,cAAC,IAAD,UACE,cAAC,IAAD,UACE,qCACE,cAACs0B,EAAA,EAAD,IACA,cAAC,GAAD,UACE,cAAC,GAAD,8BCtBXC,GAZS,SAACC,GACnBA,GAAeA,aAAuBC,UACxC,8BAAqB5wB,MAAK,YAAkD,IAA/C6wB,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCHdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,GAAD,MAEFhc,SAASic,eAAe,SAM1BX,O","file":"static/js/main.cfa2d25c.chunk.js","sourcesContent":["import { BigNumber } from 'bignumber.js'\nimport { Token } from '../models/Token'\n\n/**\n * Test if value is an integer\n *\n * @param value Value to be tested if it is an integer\n *\n * @returns True if the passed in value is integer\n */\nexport function isInteger(value: unknown): value is BigNumber | bigint {\n return (BigNumber.isBigNumber(value) && value.isInteger()) || typeof value === 'bigint'\n}\n\n/**\n *Convert value into a BigNumber if not already\n *\n * @param value Value to be converted\n *\n * @throws {TypeError} if the value is not convertible to a BigNumber\n *\n * @returns BigNumber - but it may still be NaN or Infinite\n */\nexport function makeBigNumber(value: BigNumber | BigInt | number | string): BigNumber | never {\n if (BigNumber.isBigNumber(value)) return value\n\n if (typeof value === 'string') return new BigNumber(value)\n\n if (typeof value === 'bigint') return new BigNumber(value.toString())\n\n // FIXME: bee-js still returns some values as numbers and even outside of SAFE INTEGER bounds\n if (typeof value === 'number' /* && Number.isSafeInteger(value)*/) return new BigNumber(value)\n\n throw new TypeError(`Not a BigNumber or BigNumber convertible value. Type: ${typeof value} value: ${value}`)\n}\n\nexport type PromiseSettlements = {\n fulfilled: PromiseFulfilledResult[]\n rejected: PromiseRejectedResult[]\n}\n\nexport type UnwrappedPromiseSettlements = {\n fulfilled: T[]\n rejected: string[]\n}\n\nexport async function sleepMs(ms: number): Promise {\n await new Promise(resolve =>\n setTimeout(() => {\n resolve()\n }, ms),\n )\n}\n\n/**\n * Maps the returned results of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * The results still need to be unwrapped to get the fulfilled values or rejection reasons.\n */\nexport function mapPromiseSettlements(promises: PromiseSettledResult[]): PromiseSettlements {\n const fulfilled = promises.filter(promise => promise.status === 'fulfilled') as PromiseFulfilledResult[]\n const rejected = promises.filter(promise => promise.status === 'rejected') as PromiseRejectedResult[]\n\n return { fulfilled, rejected }\n}\n\n/**\n * Maps the returned values of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * For rejected promises, the value is the stringified `reason`,\n * or `'Unknown error'` string when it is unavailable.\n */\nexport function unwrapPromiseSettlements(\n promiseSettledResults: PromiseSettledResult[],\n): UnwrappedPromiseSettlements {\n const values = mapPromiseSettlements(promiseSettledResults)\n const fulfilled = values.fulfilled.map(x => x.value)\n const rejected = values.rejected.map(x => (x.reason ? String(x.reason) : 'Unknown error'))\n\n return { fulfilled, rejected }\n}\n\n/**\n * Wraps a `Promise` or async function inside a new `Promise`,\n * which retries the original function up to `maxRetries` times,\n * waiting `delayMs` milliseconds between failed attempts.\n *\n * If all attempts fail, then this `Promise` also rejects.\n */\nexport function makeRetriablePromise(fn: () => Promise, maxRetries = 3, delayMs = 1000): Promise {\n return new Promise(async (resolve, reject) => {\n for (let tries = 0; tries < maxRetries; tries++) {\n try {\n const results = await fn()\n resolve(results)\n\n return\n } catch (error) {\n if (tries < maxRetries - 1) {\n await sleepMs(delayMs)\n } else {\n reject(error)\n }\n }\n }\n })\n}\n\nexport function extractSwarmHash(string: string): string | null {\n const matches = string.match(/[a-fA-F0-9]{64,128}/)\n\n return (matches && matches[0]) || null\n}\n\nexport function uuidV4(): string {\n const pattern = '10000000-1000-4000-8000-100000000000'\n\n return pattern.replace(/[018]/g, (s: string) => {\n const c = parseInt(s, 10)\n\n return (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n })\n}\n\nexport function formatEnum(string: string): string {\n return (string.charAt(0).toUpperCase() + string.slice(1).toLowerCase()).replaceAll('_', ' ')\n}\n\nexport function secondsToTimeString(seconds: number): string {\n let unit = seconds\n\n if (unit < 120) {\n return `${seconds} seconds`\n }\n unit /= 60\n\n if (unit < 120) {\n return `${Math.round(unit)} minutes`\n }\n unit /= 60\n\n if (unit < 48) {\n return `${Math.round(unit)} hours`\n }\n unit /= 24\n\n if (unit < 14) {\n return `${Math.round(unit)} days`\n }\n unit /= 7\n\n if (unit < 52) {\n return `${Math.round(unit)} weeks`\n }\n unit /= 52\n\n return `${unit.toFixed(1)} years`\n}\n\nexport function convertDepthToBytes(depth: number): number {\n return 2 ** depth * 4096\n}\n\nexport function convertAmountToSeconds(amount: number, pricePerBlock: number): number {\n // TODO: blocktime should come directly from the blockchain as it may differ between different networks\n const blockTime = 5 // On mainnet there is 5 seconds between blocks\n\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return (amount * blockTime) / pricePerBlock\n}\n\nexport function calculateStampPrice(depth: number, amount: bigint): Token {\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return new Token(amount * BigInt(2 ** depth)) // FIXME: the 2 ** depth should be performed on bigint already\n}\n\nexport function shortenText(text: string, length = 20, separator = '[…]'): string {\n if (text.length <= length * 2 + separator.length) {\n return text\n }\n\n return `${text.slice(0, length)}${separator}${text.slice(-length)}`\n}\n","import { BigNumber } from 'bignumber.js'\nimport { isInteger, makeBigNumber } from '../utils'\n\nconst POSSIBLE_DECIMALS = [18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\ntype digits = typeof POSSIBLE_DECIMALS[number]\n\nconst BZZ_DECIMALS = 16\n\nexport class Token {\n private amount: BigNumber // Represented in the base units, so it is always an integer value\n private readonly decimals: digits\n\n constructor(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS) {\n const a = makeBigNumber(amount)\n\n if (!isInteger(a) || !POSSIBLE_DECIMALS.includes(decimals)) throw new TypeError('Not a valid token values')\n\n this.amount = a\n this.decimals = decimals\n }\n\n /**\n * Construct new Token from a digit representation\n *\n * @param amount Amount of a token in the digits (1 token = 10^decimals)\n * @param decimals Number of decimals for the token (must be integer)\n *\n * @throws {TypeError} If the decimals is not an integer or the amount after conversion is not an integer\n *\n * @returns new Token\n */\n static fromDecimal(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS): Token | never {\n const a = makeBigNumber(amount)\n\n // No need to do any validation here, it is done when the new token is created\n const t = a.multipliedBy(new BigNumber(10).pow(decimals))\n\n return new Token(t, decimals)\n }\n\n get toBigInt(): BigInt {\n return BigInt(this.amount.toFixed(0))\n }\n\n get toString(): string {\n return this.amount.toFixed(0)\n }\n\n get toBigNumber(): BigNumber {\n return new BigNumber(this.amount)\n }\n\n get toDecimal(): BigNumber {\n return this.amount.dividedBy(new BigNumber(10).pow(this.decimals))\n }\n\n toFixedDecimal(digits = 7): string {\n return this.toDecimal.toFixed(digits)\n }\n\n toSignificantDigits(digits = 4): string {\n const asString = this.toDecimal.toFixed(16)\n\n let indexOfSignificantDigit = -1\n let reachedDecimalPoint = false\n\n for (let i = 0; i < asString.length; i++) {\n const char = asString[i]\n\n if (char === '.') {\n reachedDecimalPoint = true\n indexOfSignificantDigit = i + 1\n } else if (reachedDecimalPoint && char !== '0') {\n indexOfSignificantDigit = i\n break\n }\n }\n\n return asString.slice(0, indexOfSignificantDigit + digits)\n }\n}\n","import { Bee, Reference } from '@ethersphere/bee-js'\nimport Wallet from 'ethereumjs-wallet'\nimport { uuidV4 } from '.'\nimport { Identity, IdentityType } from '../providers/Feeds'\n\nexport function generateWallet(): Wallet {\n const buffer = new Uint8Array(32)\n crypto.getRandomValues(buffer)\n const wallet = new Wallet(Buffer.from(buffer))\n\n return wallet\n}\n\nexport function persistIdentity(identities: Identity[], identity: Identity): void {\n const existingIndex = identities.findIndex(x => x.uuid === identity.uuid)\n\n if (existingIndex !== -1) {\n identities.splice(existingIndex, 1)\n }\n identities.unshift(identity)\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport function persistIdentitiesWithoutUpdate(identities: Identity[]): void {\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport async function convertWalletToIdentity(\n identity: Wallet,\n type: IdentityType,\n name: string,\n password?: string,\n): Promise {\n if (type === 'V3' && !password) {\n throw Error('V3 passwords require password')\n }\n\n const identityString =\n type === 'PRIVATE_KEY' ? identity.getPrivateKeyString() : await identity.toV3String(password as string)\n\n return {\n uuid: uuidV4(),\n name,\n type: password ? 'V3' : 'PRIVATE_KEY',\n address: identity.getAddressString(),\n identity: identityString,\n }\n}\n\nexport async function importIdentity(name: string, data: string): Promise {\n if (data.length === 64) {\n const wallet = await getWallet('PRIVATE_KEY', data)\n\n return {\n uuid: uuidV4(),\n name,\n type: 'PRIVATE_KEY',\n identity: data,\n address: wallet.getAddressString(),\n }\n }\n\n if (data.length === 66 && data.toLowerCase().startsWith('0x')) {\n const wallet = await getWallet('PRIVATE_KEY', data.slice(2))\n\n return { uuid: uuidV4(), name, type: 'PRIVATE_KEY', identity: data, address: wallet.getAddressString() }\n }\n try {\n const { address } = JSON.parse(data)\n\n return { uuid: uuidV4(), name, type: 'V3', identity: data, address }\n } catch {\n return null\n }\n}\n\nfunction getWalletFromIdentity(identity: Identity, password?: string): Promise {\n return getWallet(identity.type, identity.identity, password)\n}\n\nasync function getWallet(type: IdentityType, data: string, password?: string): Promise {\n return type === 'PRIVATE_KEY'\n ? Wallet.fromPrivateKey(Buffer.from(trimHexString(data), 'hex'))\n : await Wallet.fromV3(data, password as string)\n}\n\nexport async function updateFeed(\n beeApi: Bee,\n identity: Identity,\n hash: string,\n stamp: string,\n password?: string,\n): Promise {\n const wallet = await getWalletFromIdentity(identity, password)\n\n if (!identity.feedHash) {\n identity.feedHash = await beeApi.createFeedManifest(stamp, 'sequence', '00'.repeat(32), wallet.getAddressString())\n }\n\n const writer = beeApi.makeFeedWriter('sequence', '00'.repeat(32), wallet.getPrivateKeyString())\n await writer.upload(stamp, hash as Reference)\n}\n\nfunction trimHexString(string: string): string {\n if (string.toLowerCase().startsWith('0x')) {\n return string.slice(2)\n }\n\n return string\n}\n","function getProcessEnv(key: string): string | undefined | false {\n return typeof process === 'object' && process.env[key]\n}\n\nclass Config {\n public readonly BEE_API_HOST: string\n public readonly BEE_DEBUG_API_HOST: string\n public readonly BLOCKCHAIN_EXPLORER_URL: string\n public readonly BEE_DOCS_HOST: string\n public readonly BEE_DISCORD_HOST: string\n public readonly GITHUB_REPO_URL: string\n\n constructor() {\n this.BEE_API_HOST =\n sessionStorage.getItem('api_host') || getProcessEnv('REACT_APP_BEE_HOST') || 'http://localhost:1633'\n this.BEE_DEBUG_API_HOST =\n sessionStorage.getItem('debug_api_host') || getProcessEnv('REACT_APP_BEE_DEBUG_HOST') || 'http://localhost:1635'\n this.BLOCKCHAIN_EXPLORER_URL =\n getProcessEnv('REACT_APP_BLOCKCHAIN_EXPLORER_URL') || 'https://blockscout.com/xdai/mainnet'\n this.BEE_DOCS_HOST = getProcessEnv('REACT_APP_BEE_DOCS_HOST') || 'https://docs.ethswarm.org/docs/'\n this.BEE_DISCORD_HOST = getProcessEnv('REACT_APP_BEE_DISCORD_HOST') || 'https://discord.gg/eKr9XPv7'\n this.GITHUB_REPO_URL =\n getProcessEnv('REACT_APP_BEE_GITHUB_REPO_URL') || 'https://api.github.com/repos/ethersphere/bee'\n }\n}\n\nexport const config = new Config()\n\nexport default config\n","import { Component, ErrorInfo, ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement\n}\n\ninterface State {\n error: Error | null\n}\n\nexport default class ErrorBoundary extends Component {\n constructor(props: Props) {\n super(props)\n this.state = { error: null }\n }\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n // Update state so the next render will show the fallback UI.\n return { error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // You can also log the error to an error reporting service\n console.error({ error, errorInfo }) // eslint-disable-line\n }\n\n render(): ReactElement {\n if (this.state.error) {\n // You can render any custom fallback UI\n return

    Something went wrong. Error: {this.state.error.message}

    \n }\n\n return this.props.children\n }\n}\n","export default __webpack_public_path__ + \"static/media/logo.3d1155fe.svg\";","import { ReactElement, ReactNode, useState } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Collapse, ListItem, ListItemText, Typography } from '@material-ui/core'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode\n label: ReactNode\n info?: ReactNode\n level?: 0 | 1 | 2\n defaultOpen?: boolean\n}\n\nexport default function ExpandableList({ children, label, level, defaultOpen, info }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n let rootLevelClass = ''\n let typographyVariant: 'h1' | 'h2' | 'h3' = 'h1'\n let contentLevelClass = classes.contentLevel0\n\n if (level === 1) {\n rootLevelClass = classes.rootLevel1\n typographyVariant = 'h2'\n contentLevelClass = classes.contentLevel12\n } else if (level === 2) {\n rootLevelClass = classes.rootLevel2\n typographyVariant = 'h3'\n contentLevelClass = classes.contentLevel12\n }\n\n return (\n
    \n \n {label}} />\n
    \n {!open && (\n \n {info}\n \n )}\n {open ? : }\n
    \n
    \n \n
    {children}
    \n
    \n
    \n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography, Grid, IconButton, Tooltip } from '@material-ui/core'\nimport { Info } from 'react-feather'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n wordBreak: 'break-word',\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label?: ReactNode\n value?: ReactNode\n tooltip?: string\n}\n\nexport default function ExpandableListItem({ label, value, tooltip }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {label && {label}}\n {value && (\n \n {value}\n {tooltip && (\n \n \n \n \n \n )}\n \n )}\n \n \n )\n}\n","import { Grid } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, ReactNode } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n action: {\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n children: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemActions({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n if (Array.isArray(children)) {\n return (\n
    \n {children\n // Exclude falsy values to allow conditional rendering\n .filter(x => x)\n .map((a, i) => (\n
    \n {a}\n
    \n ))}\n
    \n )\n }\n\n return (\n \n {children}\n \n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, useState } from 'react'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Eye, Minus } from 'react-feather'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n}\n\nconst lengthWithoutPrefix = (s: string) => s.replace(/^0x/i, '').length\n\nfunction isPrefixedHexString(s: unknown): boolean {\n return typeof s === 'string' && /^0x[0-9a-f]+$/i.test(s)\n}\n\nconst split = (s: string): string[] => {\n const nonPrefixLength = lengthWithoutPrefix(s)\n\n if (nonPrefixLength % 6 === 0) return s.match(/(0x|.{6})/gi) || []\n\n return s.match(/(0x|.{1,8})/gi) || []\n}\n\nexport default function ExpandableListItemKey({ label, value }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(false)\n const [copied, setCopied] = useState(false)\n const toggleOpen = () => setOpen(!open)\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const splitValues = split(value)\n const hasPrefix = isPrefixedHexString(value)\n const spanText = `${hasPrefix ? `${splitValues[0]} ${splitValues[1]}` : splitValues[0]}[…]${\n splitValues[splitValues.length - 1]\n }`\n\n return (\n \n \n \n {label && {label}}\n \n
    \n {!open && (\n \n \n \n {value ? spanText : ''}\n \n \n \n )}\n \n {open ? : }\n \n
    \n
    \n
    \n \n
    \n \n \n {/* This has to be wrapped in two spans otherwise either the tooltip or the highlighting does not work*/}\n \n \n {splitValues.map((s, i) => (\n \n {s}\n \n ))}\n \n \n \n \n
    \n
    \n
    \n
    \n )\n}\n","import { Bee, BeeDebug } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\nimport { config } from '../config'\n\ninterface ContextInterface {\n apiUrl: string\n apiDebugUrl: string\n beeApi: Bee | null\n beeDebugApi: BeeDebug | null\n setApiUrl: (url: string) => void\n setDebugApiUrl: (url: string) => void\n lockedApiSettings: boolean\n}\n\nconst initialValues: ContextInterface = {\n apiUrl: config.BEE_API_HOST,\n apiDebugUrl: config.BEE_DEBUG_API_HOST,\n beeApi: null,\n beeDebugApi: null,\n setApiUrl: () => {}, // eslint-disable-line\n setDebugApiUrl: () => {}, // eslint-disable-line\n lockedApiSettings: false,\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nexport function Provider({\n children,\n beeApiUrl,\n beeDebugApiUrl,\n lockedApiSettings: extLockedApiSettings,\n}: Props): ReactElement {\n const [apiUrl, setApiUrl] = useState(initialValues.apiUrl)\n const [apiDebugUrl, setDebugApiUrl] = useState(initialValues.apiDebugUrl)\n const [beeApi, setBeeApi] = useState(null)\n const [beeDebugApi, setBeeDebugApi] = useState(null)\n const [lockedApiSettings] = useState(Boolean(extLockedApiSettings))\n\n const url = beeApiUrl || apiUrl\n const debugUrl = beeDebugApiUrl || apiDebugUrl\n\n useEffect(() => {\n try {\n setBeeApi(new Bee(url))\n sessionStorage.setItem('api_host', url)\n } catch (e) {\n setBeeApi(null)\n }\n }, [url])\n\n useEffect(() => {\n try {\n setBeeDebugApi(new BeeDebug(debugUrl))\n sessionStorage.setItem('debug_api_host', debugUrl)\n } catch (e) {\n setBeeDebugApi(null)\n }\n }, [debugUrl])\n\n return (\n \n {children}\n \n )\n}\n","import type { ReactElement } from 'react'\nimport IconButton from '@material-ui/core/IconButton'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Clipboard } from 'react-feather'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n value: string\n}\n\nexport default function ClipboardCopy({ value }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n const handleCopy = () => enqueueSnackbar(`Copied: ${value}`, { variant: 'success' })\n\n return (\n
    \n \n \n \n \n \n
    \n )\n}\n","import { ReactElement, useState } from 'react'\nimport QRCode from 'qrcode.react'\nimport { IconButton, Dialog, DialogTitle } from '@material-ui/core'\nimport { FilterCenterFocusSharp } from '@material-ui/icons'\n\ninterface Props {\n value: string\n label: string\n}\n\nexport default function QRCodeModal(props: Props): ReactElement {\n const [open, setOpen] = useState(false)\n\n const handleOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n return (\n
    \n \n \n \n \n
    \n {props.label}\n \n
    \n
    \n
    \n )\n}\n","import { Typography } from '@material-ui/core/'\nimport { ReactElement } from 'react'\nimport Identicon from 'react-identicons'\nimport { config } from '../config'\nimport ClipboardCopy from './ClipboardCopy'\nimport QRCodeModal from './QRCodeModal'\n\ninterface Props {\n address: string | undefined\n hideBlockie?: boolean\n transaction?: boolean\n truncate?: boolean\n}\n\nexport default function EthereumAddress(props: Props): ReactElement {\n return (\n \n {props.address ? (\n
    \n {props.hideBlockie ? null : (\n
    \n \n
    \n )}\n
    \n \n {props.address}\n \n
    \n \n \n
    \n ) : (\n '-'\n )}\n
    \n )\n}\n","import { CircularProgress, Container } from '@material-ui/core'\nimport Button from '@material-ui/core/Button'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useState, useContext } from 'react'\nimport { Zap } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\nimport EthereumAddress from './EthereumAddress'\n\ninterface Props {\n peerId: string\n uncashedAmount: string\n}\n\nexport default function CheckoutModal({ peerId, uncashedAmount }: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [loadingCashout, setLoadingCashout] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const { beeDebugApi } = useContext(SettingsContext)\n\n const handleClickOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleCashout = () => {\n if (!beeDebugApi) return\n\n if (peerId) {\n setLoadingCashout(true)\n beeDebugApi\n .cashoutLastCheque(peerId)\n .then(res => {\n setOpen(false)\n enqueueSnackbar(\n \n Successfully cashed out cheque. Transaction\n \n ,\n { variant: 'success' },\n )\n })\n .catch((e: Error) => {\n enqueueSnackbar(Error: {e.message}, { variant: 'error' })\n })\n .finally(() => {\n setLoadingCashout(false)\n })\n } else {\n enqueueSnackbar(Peer Id invalid, { variant: 'error' })\n }\n }\n\n return (\n
    \n \n \n Cashout Cheque\n \n \n {loadingCashout && (\n <>\n \n Cashing out {uncashedAmount} from Peer {peerId}. Please wait...\n \n \n \n \n \n )}\n {!loadingCashout && (\n \n Are you sure you want to cashout {uncashedAmount} BZZ from Peer{' '}\n {peerId}?\n \n )}\n \n \n \n \n \n \n \n
    \n )\n}\n","import type { ReactElement } from 'react'\n\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\n\nimport CashoutModal from '../../components/CashoutModal'\nimport { Accounting } from '../../hooks/accounting'\nimport type { Token } from '../../models/Token'\n\ninterface Props {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport default function PeerBalances({ accounting, isLoadingUncashed, totalUncashed }: Props): ReactElement | null {\n return (\n \n \n {accounting?.map(({ peer, balance, received, sent, uncashedAmount, total }) => (\n \n \n \n \n \n \n {uncashedAmount.toBigNumber.isGreaterThan('0') && (\n \n \n \n )}\n \n ))}\n \n )\n}\n","import { Button, Grid, Link as MuiLink, Typography } from '@material-ui/core/'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport type { ReactElement } from 'react'\nimport { Activity } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n content: {\n maxWidth: 500,\n marginBottom: theme.spacing(4),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n icon: {\n height: '1rem',\n },\n }),\n)\n\nexport default function TroubleshootConnectionCard(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n Uh oh, it looks like your node is not connected.\n \n \n \n \n Please check your node status to fix the problem. You can also check out the{' '}\n \n Swarm Bee Docs\n {' '}\n or ask for support on the{' '}\n \n Ethereum Swarm Discord\n \n .\n \n \n \n \n }\n to={ROUTES.STATUS}\n >\n Check node status\n \n \n \n \n )\n}\n","import type {\n ChainState,\n ChequebookAddressResponse,\n Health,\n LastChequesResponse,\n NodeAddresses,\n NodesInfo,\n Peer,\n Topology,\n} from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport semver from 'semver'\nimport { engines } from '../../package.json'\nimport { useLatestBeeRelease } from '../hooks/apiHooks'\nimport { Token } from '../models/Token'\nimport type { Balance, ChequebookBalance, Settlements } from '../types'\nimport { Context as SettingsContext } from './Settings'\n\ninterface Status {\n all: boolean\n version: boolean\n blockchainConnection: boolean\n debugApiConnection: boolean\n apiConnection: boolean\n topology: boolean\n chequebook: boolean\n}\n\ninterface ContextInterface {\n status: Status\n latestPublishedVersion?: string\n latestUserVersion?: string\n latestUserVersionExact?: string\n isLatestBeeVersion: boolean\n latestBeeVersionUrl: string\n error: Error | null\n apiHealth: boolean\n debugApiHealth: Health | null\n nodeAddresses: NodeAddresses | null\n nodeInfo: NodesInfo | null\n topology: Topology | null\n chequebookAddress: ChequebookAddressResponse | null\n peers: Peer[] | null\n chequebookBalance: ChequebookBalance | null\n peerBalances: Balance[] | null\n peerCheques: LastChequesResponse | null\n settlements: Settlements | null\n chainState: ChainState | null\n latestBeeRelease: LatestBeeRelease | null\n isLoading: boolean\n isRefreshing: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst urlSearchParams = new URLSearchParams(window.location.search)\nconst newApiKey = urlSearchParams.get('v')\n\nif (newApiKey) {\n localStorage.setItem('apiKey', newApiKey)\n window.location.search = ''\n}\n\nconst initialValues: ContextInterface = {\n status: {\n all: false,\n version: false,\n blockchainConnection: false,\n debugApiConnection: false,\n apiConnection: false,\n topology: false,\n chequebook: false,\n },\n latestPublishedVersion: undefined,\n latestUserVersion: undefined,\n latestUserVersionExact: undefined,\n isLatestBeeVersion: false,\n latestBeeVersionUrl: 'https://github.com/ethersphere/bee/releases/latest',\n error: null,\n apiHealth: false,\n debugApiHealth: null,\n nodeAddresses: null,\n nodeInfo: null,\n topology: null,\n chequebookAddress: null,\n peers: null,\n chequebookBalance: null,\n peerBalances: null,\n peerCheques: null,\n settlements: null,\n chainState: null,\n latestBeeRelease: null,\n isLoading: true,\n isRefreshing: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction isUltraLight(string?: string) {\n return string === 'ultra-light'\n}\n\nfunction getStatus(\n debugApiHealth: Health | null,\n nodeAddresses: NodeAddresses | null,\n nodeInfo: NodesInfo | null,\n apiHealth: boolean,\n topology: Topology | null,\n chequebookAddress: ChequebookAddressResponse | null,\n chequebookBalance: ChequebookBalance | null,\n error: Error | null,\n): Status {\n // FIXME: `devMode` is a temporary workaround to be able to develop with only one node\n const devMode = Boolean(process.env.REACT_APP_DEV_MODE) || nodeInfo?.beeMode === 'dev'\n const status = {\n version: Boolean(\n debugApiHealth &&\n semver.satisfies(debugApiHealth.version, engines.bee, {\n includePrerelease: true,\n }),\n ),\n blockchainConnection: Boolean(nodeAddresses?.ethereum),\n debugApiConnection: Boolean(debugApiHealth?.status === 'ok'),\n apiConnection: apiHealth,\n topology: Boolean(topology?.connected && topology?.connected > 0) || devMode,\n chequebook:\n (Boolean(chequebookAddress?.chequebookAddress) &&\n chequebookBalance !== null &&\n chequebookBalance?.totalBalance.toBigNumber.isGreaterThan(0)) ||\n devMode ||\n isUltraLight(nodeInfo?.beeMode),\n }\n\n return { ...status, all: !error && Object.values(status).every(v => v) }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const [apiHealth, setApiHealth] = useState(false)\n const [debugApiHealth, setDebugApiHealth] = useState(null)\n const [nodeAddresses, setNodeAddresses] = useState(null)\n const [nodeInfo, setNodeInfo] = useState(null)\n const [topology, setNodeTopology] = useState(null)\n const [chequebookAddress, setChequebookAddress] = useState(null)\n const [peers, setPeers] = useState(null)\n const [chequebookBalance, setChequebookBalance] = useState(null)\n const [peerBalances, setPeerBalances] = useState(null)\n const [peerCheques, setPeerCheques] = useState(null)\n const [settlements, setSettlements] = useState(null)\n const [chainState, setChainState] = useState(null)\n\n const { latestBeeRelease } = useLatestBeeRelease()\n\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [isRefreshing, setIsRefreshing] = useState(initialValues.isRefreshing)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(30000)\n\n const latestPublishedVersion = semver.coerce(latestBeeRelease?.name)?.version\n const latestUserVersion = semver.coerce(debugApiHealth?.version)?.version\n const latestUserVersionExact = debugApiHealth?.version\n\n useEffect(() => {\n setIsLoading(true)\n\n setApiHealth(false)\n\n refresh()\n }, [beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n setIsLoading(true)\n\n setDebugApiHealth(null)\n setNodeAddresses(null)\n setNodeTopology(null)\n setNodeInfo(null)\n setPeers(null)\n setChequebookAddress(null)\n setChequebookBalance(null)\n setPeerBalances(null)\n setPeerCheques(null)\n setSettlements(null)\n setChainState(null)\n\n refresh()\n }, [beeDebugApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isRefreshing) return\n\n // Not a valid bee api\n if (!beeApi || !beeDebugApi) {\n setIsLoading(false)\n\n return\n }\n\n try {\n setIsRefreshing(true)\n setError(null)\n\n // Wrap the chequebook balance call to return BZZ values as Token object\n const chequeBalanceWrapper = async () => {\n const { totalBalance, availableBalance } = await beeDebugApi.getChequebookBalance()\n\n return {\n totalBalance: new Token(totalBalance),\n availableBalance: new Token(availableBalance),\n }\n }\n\n // Wrap the balances call to return BZZ values as Token object\n const peerBalanceWrapper = async () => {\n const { balances } = await beeDebugApi.getAllBalances()\n\n return balances.map(({ peer, balance }) => ({ peer, balance: new Token(balance) }))\n }\n\n // Wrap the settlements call to return BZZ values as Token object\n const settlementsWrapper = async () => {\n const { totalReceived, settlements, totalSent } = await beeDebugApi.getAllSettlements()\n\n return {\n totalReceived: new Token(totalReceived),\n totalSent: new Token(totalSent),\n settlements: settlements.map(({ peer, received, sent }) => ({\n peer,\n received: new Token(received),\n sent: new Token(sent),\n })),\n }\n }\n\n const promises = [\n // API health\n beeApi\n .isConnected()\n .then(setApiHealth)\n .catch(() => setApiHealth(false)),\n\n // Debug API health\n beeDebugApi\n .getHealth()\n .then(setDebugApiHealth)\n .catch(() => setDebugApiHealth(null)),\n\n // Node Addresses\n beeDebugApi\n .getNodeAddresses()\n .then(setNodeAddresses)\n .catch(() => setNodeAddresses(null)),\n\n // NodeInfo\n beeDebugApi\n .getNodeInfo()\n .then(setNodeInfo)\n .catch(() => setNodeInfo(null)),\n\n // Network Topology\n beeDebugApi\n .getTopology()\n .then(setNodeTopology)\n .catch(() => setNodeTopology(null)),\n\n // Peers\n beeDebugApi\n .getPeers()\n .then(setPeers)\n .catch(() => setPeers(null)),\n\n // Chequebook address\n beeDebugApi\n .getChequebookAddress()\n .then(setChequebookAddress)\n .catch(() => setChequebookAddress(null)),\n\n // Cheques\n beeDebugApi\n .getLastCheques()\n .then(setPeerCheques)\n .catch(() => setPeerCheques(null)),\n\n // Chain state\n beeDebugApi\n .getChainState()\n .then(setChainState)\n .catch(() => setChainState(null)),\n\n // Chequebook balance\n chequeBalanceWrapper()\n .then(setChequebookBalance)\n .catch(() => setChequebookBalance(null)),\n\n // Peer balances\n peerBalanceWrapper()\n .then(setPeerBalances)\n .catch(() => setPeerBalances(null)),\n\n // Settlements\n settlementsWrapper()\n .then(setSettlements)\n .catch(() => setSettlements(null)),\n ]\n\n await Promise.allSettled(promises)\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n setIsRefreshing(false)\n setLastUpdate(Date.now())\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency, beeDebugApi, beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import axios from 'axios'\nimport { useEffect, useState } from 'react'\nimport { config } from '../config'\n\nexport interface LatestBeeReleaseHook {\n latestBeeRelease: LatestBeeRelease | null\n isLoadingLatestBeeRelease: boolean\n error: Error | null\n}\n\nexport const useLatestBeeRelease = (): LatestBeeReleaseHook => {\n const [latestBeeRelease, setLatestBeeRelease] = useState(null)\n const [isLoadingLatestBeeRelease, setLoading] = useState(false)\n const [error, setError] = useState(null)\n\n useEffect(() => {\n axios\n .get(`${config.GITHUB_REPO_URL}/releases/latest`)\n .then(res => {\n setLatestBeeRelease(res.data)\n })\n .catch((error: Error) => {\n setError(error)\n })\n .finally(() => {\n setLoading(false)\n })\n }, [])\n\n return { latestBeeRelease, isLoadingLatestBeeRelease, error }\n}\n","import { LastCashoutActionResponse, BeeDebug } from '@ethersphere/bee-js'\nimport { useEffect, useState } from 'react'\nimport { Token } from '../models/Token'\nimport { makeRetriablePromise, unwrapPromiseSettlements } from '../utils'\nimport { Balance, Settlements, Settlement } from '../types'\n\ninterface UseAccountingHook {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport interface Accounting {\n peer: string\n uncashedAmount: Token\n balance: Token\n received: Token\n sent: Token\n total: Token\n}\n\n/**\n * Merges the balances, settlements and uncashedAmounts arrays into single array which is sorted by uncashed amounts (if any)\n *\n * @param balances Balances for all peers\n * @param settlements Settlements for all peers which has some settlement\n * @param uncashedAmounts Array of getPeerLastCashout responses which is needed to calculate uncashed amount\n *\n * @returns\n */\nfunction mergeAccounting(\n balances: Balance[] | null,\n settlements?: Settlement[],\n uncashedAmounts?: LastCashoutActionResponse[],\n): Accounting[] | null {\n // Settlements or balances are still loading or there is an error -> return null\n if (!balances || !settlements) return null\n\n const accounting: Record = {}\n\n balances.forEach(\n // Some peers may not have settlement but all have balance (therefore initialize sent, received and uncashed to 0)\n ({ peer, balance }) =>\n (accounting[peer] = {\n peer,\n balance,\n sent: new Token('0'),\n received: new Token('0'),\n uncashedAmount: new Token('0'),\n total: balance,\n }),\n )\n\n settlements.forEach(\n ({ peer, sent, received }) =>\n (accounting[peer] = {\n ...accounting[peer],\n sent,\n received,\n total: new Token(accounting[peer].balance.toBigNumber.plus(received.toBigNumber).minus(sent.toBigNumber)),\n }),\n )\n\n // If there are no cheques (and hence last cashout actions)\n if (!uncashedAmounts) return Object.values(accounting).sort((a, b) => (a.peer < b.peer ? -1 : 1))\n\n uncashedAmounts?.forEach(({ peer, uncashedAmount }) => {\n accounting[peer].uncashedAmount = new Token(uncashedAmount)\n })\n\n // Return sorted by the uncashed amount first and then by the peer id\n return Object.values(accounting).sort((a, b) => {\n const diff = b.uncashedAmount.toBigNumber.minus(a.uncashedAmount.toBigNumber).toNumber()\n\n if (diff !== 0) return diff\n\n return a.peer < b.peer ? -1 : 1\n })\n}\n\nexport const useAccounting = (\n beeDebugApi: BeeDebug | null,\n settlements: Settlements | null,\n balances: Balance[] | null,\n): UseAccountingHook => {\n const [isLoadingUncashed, setIsloadingUncashed] = useState(false)\n const [uncashedAmounts, setUncashedAmounts] = useState(undefined)\n\n useEffect(() => {\n // We don't have any settlements loaded yet or we are already loading/have loaded the uncashed amounts\n if (isLoadingUncashed || !beeDebugApi || !settlements || uncashedAmounts) return\n\n setIsloadingUncashed(true)\n const promises = settlements.settlements\n .filter(({ received }) => received.toBigNumber.gt('0'))\n .map(({ peer }) => makeRetriablePromise(() => beeDebugApi.getLastCashoutAction(peer)))\n\n Promise.allSettled(promises).then(settlements => {\n const results = unwrapPromiseSettlements(settlements)\n setUncashedAmounts(results.fulfilled)\n setIsloadingUncashed(false)\n })\n }, [settlements, isLoadingUncashed, uncashedAmounts, beeDebugApi])\n\n const accounting = mergeAccounting(balances, settlements?.settlements, uncashedAmounts)\n\n let totalUncashed: Token = new Token('0')\n accounting?.forEach(\n ({ uncashedAmount }) => (totalUncashed = new Token(totalUncashed.toBigNumber.plus(uncashedAmount.toBigNumber))),\n )\n\n return {\n isLoadingUncashed,\n totalUncashed,\n accounting,\n }\n}\n","import { ReactElement, ReactNode, useState } from 'react'\nimport Button from '@material-ui/core/Button'\nimport Input from '@material-ui/core/Input'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport FormHelperText from '@material-ui/core/FormHelperText'\nimport { Token } from '../models/Token'\nimport type { BigNumber } from 'bignumber.js'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n successMessage: string\n errorMessage: string\n dialogMessage: string\n label: string\n max?: BigNumber\n min?: BigNumber\n action: (amount: bigint) => Promise\n icon?: ReactNode\n}\n\nexport default function WithdrawDepositModal({\n successMessage,\n errorMessage,\n dialogMessage,\n min,\n max,\n label,\n action,\n icon,\n}: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [amount, setAmount] = useState('')\n const [amountToken, setAmountToken] = useState(null)\n const [amountError, setAmountError] = useState(null)\n const { enqueueSnackbar } = useSnackbar()\n\n const handleClickOpen = (e: React.MouseEvent) => {\n setOpen(true)\n e.stopPropagation()\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleAction = async () => {\n if (amountToken === null) return\n\n try {\n const transactionHash = await action(amountToken.toBigInt as bigint)\n setOpen(false)\n enqueueSnackbar(`${successMessage} Transaction ${transactionHash}`, { variant: 'success' })\n } catch (e) {\n enqueueSnackbar(`${errorMessage} Error: ${(e as Error).message}`, { variant: 'error' })\n }\n }\n\n const handleChange = (e: React.ChangeEvent) => {\n const value = e.target.value\n setAmount(value)\n setAmountError(null)\n try {\n const t = Token.fromDecimal(value)\n setAmountToken(t)\n\n if (min && t.toDecimal.isLessThan(min)) setAmountError(new Error(`Needs to be more than ${min}`))\n\n if (max && t.toDecimal.isGreaterThan(max)) setAmountError(new Error(`Needs to be less than ${max}`))\n } catch (e) {\n setAmountError(e as Error)\n }\n }\n\n return (\n
    \n \n \n {label}\n \n {dialogMessage}\n \n {amountError && (\n \n Please provide valid BZZ amount (max 16 decimals). Error: {amountError.message}\n \n )}\n \n \n \n \n \n \n
    \n )\n}\n","import { BigNumber } from 'bignumber.js'\nimport { ReactElement, useContext } from 'react'\nimport { Upload } from 'react-feather'\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nexport default function WithdrawModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.withdrawTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { Download } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { BigNumber } from 'bignumber.js'\n\nexport default function DepositModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.depositTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport PeerBalances from './PeerBalances'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { useAccounting } from '../../hooks/accounting'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport WithdrawModal from '../../containers/WithdrawModal'\nimport DepositModal from '../../containers/DepositModal'\n\nexport default function Accounting(): ReactElement {\n const { status, nodeAddresses, chequebookAddress, chequebookBalance, settlements, peerBalances } =\n useContext(BeeContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { accounting, totalUncashed, isLoadingUncashed } = useAccounting(beeDebugApi, settlements, peerBalances)\n\n if (!status.all) return \n\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n )\n}\n","import { Button, CircularProgress, createStyles, makeStyles } from '@material-ui/core'\nimport React, { ReactElement } from 'react'\nimport { IconProps } from 'react-feather'\n\ninterface Props {\n onClick: () => void\n iconType: React.ComponentType\n children: string\n className?: string\n disabled?: boolean\n loading?: boolean\n cancel?: boolean\n variant?: 'text' | 'contained' | 'outlined' | undefined\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n button: {\n height: '52px',\n position: 'relative',\n whiteSpace: 'nowrap',\n color: '#242424',\n '&:hover, &:focus': {\n '& svg': {\n stroke: '#fff',\n transition: '0.1s',\n },\n },\n },\n cancelButton: {\n background: '#f7f7f7',\n color: '#606060',\n },\n spinnerWrapper: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n width: '40px',\n height: '40px',\n transform: 'translate(-50%, -50%)',\n },\n }),\n)\n\nexport function SwarmButton({\n children,\n onClick,\n iconType,\n className,\n disabled,\n loading,\n cancel,\n variant = 'contained',\n}: Props): ReactElement {\n const classes = useStyles()\n\n function getIconColor() {\n if (loading || disabled) {\n return 'rgba(0, 0, 0, 0.26)'\n }\n\n return cancel ? '#606060' : '#dd7700'\n }\n\n function getButtonClassName() {\n return [className, classes.button, cancel && classes.cancelButton].filter(x => x).join(' ')\n }\n\n const icon = React.createElement(iconType, {\n size: '1.25rem',\n color: getIconColor(),\n })\n\n return (\n ) => {\n onClick()\n event.currentTarget.blur()\n }}\n variant={variant}\n startIcon={icon}\n disabled={disabled}\n >\n {children}\n {loading && (\n
    \n \n
    \n )}\n \n )\n}\n","import { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\n\nexport type IdentityType = 'V3' | 'PRIVATE_KEY'\n\nexport interface Identity {\n uuid: string\n name: string\n feedHash?: string\n identity: string\n address: string\n type: IdentityType\n}\n\ninterface ContextInterface {\n identities: Identity[]\n setIdentities: (identities: Identity[]) => void\n}\n\nconst initialValues: ContextInterface = {\n identities: [],\n setIdentities: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [identities, setIdentities] = useState(initialValues.identities)\n\n useEffect(() => {\n try {\n setIdentities(JSON.parse(localStorage.getItem('feeds') || '[]'))\n } catch {\n setIdentities([])\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {children}\n}\n","import { Box, Dialog, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nexport function SwarmDialog({ children }: Props): ReactElement {\n return (\n \n \n \n {children}\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { Close } from '@material-ui/icons'\nimport { ReactElement } from 'react'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n padding: theme.spacing(1),\n cursor: 'pointer',\n },\n }),\n)\n\nexport function CloseButton({ onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
    \n \n
    \n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { CloseButton } from './CloseButton'\n\ninterface Props {\n children: string\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontWeight: 'bold',\n },\n }),\n)\n\nexport function TitleWithClose({ children, onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n \n  \n \n {children}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Trash, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onConfirm: (identity: Identity) => void\n onClose: () => void\n}\n\nexport function DeleteFeedDialog({ identity, onConfirm, onClose }: Props): ReactElement {\n return (\n \n \n Delete\n \n \n {`You are about to delete feed ${identity.name} Website. It is strongly advised to export this feed first.`}\n \n \n onConfirm(identity)}>\n Delete\n \n \n Cancel\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: string\n prettify?: boolean\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n overflow: 'scroll',\n background: '#ffffff',\n },\n pre: {\n maxHeight: '6em',\n padding: theme.spacing(2),\n },\n }),\n)\n\nfunction prettifyString(string: string): string {\n try {\n return JSON.stringify(JSON.parse(string), null, 4)\n } catch {\n return string\n }\n}\n\nexport function Code({ children, prettify }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
    \n
    {prettify ? prettifyString(children) : children}
    \n
    \n )\n}\n","import { Box, createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement } from 'react'\nimport { Clipboard, Download } from 'react-feather'\nimport { Code } from '../../components/Code'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n maxWidth: '100%',\n },\n }),\n)\n\nexport function ExportFeedDialog({ identity, onClose }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n function onDownload() {\n saveAs(\n new Blob([identity.identity], {\n type: 'application/json',\n }),\n identity.name + '.json',\n )\n }\n\n function getExportText() {\n return identity.type === 'V3' ? 'JSON file' : 'the private key string'\n }\n\n function onCopy() {\n navigator.clipboard\n .writeText(identity.identity)\n .then(() => enqueueSnackbar('Copied to Clipboard', { variant: 'success' }))\n }\n\n return (\n \n \n Export\n \n \n {`We exported the identity associated with this feed as ${getExportText()}.`}\n \n \n {identity.identity}\n \n \n \n Download JSON File\n \n \n Copy To Clipboard\n \n \n \n )\n}\n","import { createStyles, makeStyles, TextField as SimpleTextField, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { TextField } from 'formik-material-ui'\nimport { ChangeEvent, ReactElement } from 'react'\n\ninterface Props {\n name: string\n label: string\n password?: boolean\n formik?: boolean\n optional?: boolean\n defaultValue?: string\n onChange?: (event: ChangeEvent) => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n field: {\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .Mui-focused': {\n background: theme.palette.background.paper,\n },\n '& .MuiInputBase-root': {\n background: theme.palette.background.paper,\n },\n '& .MuiFilledInput-root': {\n borderRadius: 0,\n },\n },\n }),\n)\n\nexport function SwarmTextInput({\n name,\n label,\n password,\n optional,\n formik,\n onChange,\n defaultValue,\n}: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n \n )\n }\n\n return (\n \n )\n}\n","import { Box, createStyles, makeStyles, TextareaAutosize, Theme } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport React, { ReactElement, useContext, useRef, useState } from 'react'\nimport { Check, Upload } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Context, Identity } from '../../providers/Feeds'\nimport { importIdentity, persistIdentity } from '../../utils/identity'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textarea: {\n width: '100%',\n border: 0,\n padding: theme.spacing(1),\n },\n displayNone: {\n display: 'none',\n },\n }),\n)\n\nexport function ImportFeedDialog({ onClose }: Props): ReactElement {\n const [textareaValue, setTextareaValue] = useState('')\n const [name, setName] = useState('')\n const fileInputRef = useRef(null)\n\n const { identities, setIdentities } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n async function onImport() {\n const feed = await importIdentity(name, textareaValue)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n\n function onUploadIdentityFile() {\n if (fileInputRef.current) {\n const input = fileInputRef.current as HTMLInputElement\n input.click()\n }\n }\n\n function onIdentityFileSelected(event: React.ChangeEvent) {\n const fileReader = new FileReader()\n const file = event.target?.files?.[0]\n fileReader.onload = async event => {\n const string = event.target?.result\n\n if (string) {\n const feed = await importIdentity(name, string as string)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n }\n\n if (file) {\n fileReader.readAsText(file)\n }\n }\n\n function onFeedReady(identity: Identity) {\n persistIdentity(identities, identity)\n setIdentities(identities)\n enqueueSnackbar('Feed imported successfully', { variant: 'success' })\n onClose()\n }\n\n return (\n \n \n \n Import\n \n \n setName(event.target.value)} />\n \n \n setTextareaValue(event.target.value)}\n />\n \n \n \n Upload Json File\n \n \n Use Pasted Text\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Download, Info, PlusSquare, Trash } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { ROUTES } from '../../routes'\nimport { formatEnum } from '../../utils'\nimport { persistIdentitiesWithoutUpdate } from '../../utils/identity'\nimport { DeleteFeedDialog } from './DeleteFeedDialog'\nimport { ExportFeedDialog } from './ExportFeedDialog'\nimport { ImportFeedDialog } from './ImportFeedDialog'\n\nexport default function Feeds(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [showImport, setShowImport] = useState(false)\n const [showExport, setShowExport] = useState(false)\n const [showDelete, setShowDelete] = useState(false)\n\n function createNewFeed() {\n return navigate(ROUTES.FEEDS_NEW)\n }\n\n function viewFeed(uuid: string) {\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uuid))\n }\n\n function onDialogClose() {\n setShowDelete(false)\n setShowExport(false)\n setShowImport(false)\n setSelectedIdentity(null)\n }\n\n function onDelete(identity: Identity) {\n onDialogClose()\n const updatedFeeds = identities.filter(x => x.uuid !== identity.uuid)\n setIdentities(updatedFeeds)\n persistIdentitiesWithoutUpdate(updatedFeeds)\n }\n\n function onShowExport(identity: Identity) {\n setSelectedIdentity(identity)\n setShowExport(true)\n }\n\n function onShowDelete(identity: Identity) {\n setSelectedIdentity(identity)\n setShowDelete(true)\n }\n\n if (!status.all) return \n\n return (\n
    \n {showImport && setShowImport(false)} />}\n {showExport && selectedIdentity && }\n {showDelete && selectedIdentity && (\n onDelete(identity)}\n />\n )}\n \n Feeds\n \n \n \n \n Create New Feed\n \n setShowImport(true)}>\n Import Feed\n \n \n \n {identities.map((x, i) => (\n \n \n \n \n \n \n \n \n {x.feedHash && }\n \n \n viewFeed(x.uuid)} iconType={Info}>\n View Feed Page\n \n onShowExport(x)} iconType={Download}>\n Export...\n \n onShowDelete(x)} iconType={Trash}>\n Delete...\n \n \n \n \n ))}\n
    \n )\n}\n","import { createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: (string | ReactElement)[] | (string | ReactElement)\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontSize: '0.9rem',\n },\n }),\n)\n\nexport function DocumentationText({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return {children}\n}\n","import { Box, createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ArrowBack } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\ninterface Props {\n children: string\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n pressable: {\n cursor: 'pointer',\n },\n icon: {\n color: '#242424',\n },\n }),\n)\n\nexport function HistoryHeader({ children }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function goBack() {\n navigate(-1)\n }\n\n return (\n \n \n \n
    \n \n
    \n
    \n {children}\n
    \n
    \n )\n}\n","import { createStyles, FormHelperText, makeStyles, MenuItem, Select as SimpleSelect, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { Select } from 'formik-material-ui'\nimport { ReactElement } from 'react'\n\nexport type SelectEvent = React.ChangeEvent<{\n name?: string | undefined\n value: unknown\n}>\n\ninterface Props {\n label?: string\n name?: string\n options: { value: string; label: string }[]\n onChange?: (event: SelectEvent) => void\n formik?: boolean\n defaultValue?: string\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n select: {\n borderRadius: 0,\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .MuiSelect-select': {\n '&:focus': {\n background: theme.palette.background.paper,\n },\n },\n },\n option: {\n height: '52px',\n },\n }),\n)\n\nexport function SwarmSelect({ defaultValue, formik, name, options, onChange, label }: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n }\n\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Form, Formik } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as FeedsContext, IdentityType } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { convertWalletToIdentity, generateWallet, persistIdentity } from '../../utils/identity'\n\ninterface FormValues {\n identityName?: string\n type?: IdentityType\n password?: string\n}\n\nconst initialValues: FormValues = {\n identityName: '',\n type: 'PRIVATE_KEY',\n password: '',\n}\n\nexport default function CreateNewFeed(): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { identities, setIdentities } = useContext(FeedsContext)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n\n const navigate = useNavigate()\n\n async function onSubmit(values: FormValues) {\n setLoading(true)\n\n if (!beeApi) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n const wallet = generateWallet()\n const stamps = await beeDebugApi?.getAllPostageBatch()\n\n if (!stamps || !stamps.length) {\n enqueueSnackbar(No stamp available, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n if (!values.identityName || !values.type) {\n enqueueSnackbar(Form is unfinished, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n const identity = await convertWalletToIdentity(wallet, values.type, values.identityName, values.password)\n persistIdentity(identities, identity)\n setIdentities(identities)\n navigate(ROUTES.FEEDS)\n setLoading(false)\n }\n\n function cancel() {\n navigate(-1)\n }\n\n return (\n
    \n Create new feed\n \n \n To create a feed you will need to create an identity. Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand how feeds work.\n \n \n \n {({ submitForm, values }) => (\n
    \n \n \n \n \n \n \n {values.type === 'V3' && }\n \n \n \n \n \n Feeds name\n {values.identityName} Website\n \n \n \n \n \n Create Feed\n \n \n Cancel\n \n \n \n \n )}\n
    \n
    \n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ArrowForward, OpenInNewSharp } from '@material-ui/icons'\nimport { ReactElement, useState } from 'react'\nimport CopyToClipboard from 'react-copy-to-clipboard'\nimport { useNavigate } from 'react-router'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n openLinkIcon: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n link?: string\n navigationType?: 'NEW_WINDOW' | 'HISTORY_PUSH'\n allowClipboard?: boolean\n}\n\nexport default function ExpandableListItemLink({\n label,\n value,\n link,\n navigationType = 'NEW_WINDOW',\n allowClipboard = true,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [copied, setCopied] = useState(false)\n const navigate = useNavigate()\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const displayValue = value.length > 22 ? value.slice(0, 19) + '...' : value\n\n function onNavigation() {\n if (navigationType === 'NEW_WINDOW') {\n window.open(link || value)\n } else {\n navigate(link || value)\n }\n }\n\n return (\n \n \n \n {label && {label}}\n \n
    \n {allowClipboard && (\n \n \n \n {displayValue}\n \n \n \n )}\n {!allowClipboard && {displayValue}}\n \n {navigationType === 'NEW_WINDOW' && }\n {navigationType === 'HISTORY_PUSH' && }\n \n
    \n
    \n
    \n
    \n
    \n )\n}\n","const indexHtmls = ['index.html', 'index.htm']\n\ninterface DetectedIndex {\n indexPath: string\n commonPrefix?: string\n}\n\nexport function detectIndexHtml(files: FilePath[]): DetectedIndex | false {\n const paths = files.map(getPath)\n\n if (!paths.length) {\n return false\n }\n\n const exactMatch = paths.find(x => indexHtmls.includes(x))\n\n if (exactMatch) {\n return { indexPath: exactMatch }\n }\n\n const prefix = paths[0].split('/')[0] + '/'\n\n const allStartWithSamePrefix = paths.every(x => x.startsWith(prefix))\n\n if (allStartWithSamePrefix) {\n const match = paths.find(x => indexHtmls.map(y => prefix + y).includes(x))\n\n if (match) {\n return { indexPath: match, commonPrefix: prefix }\n }\n }\n\n return false\n}\n\nexport function getHumanReadableFileSize(bytes: number): string {\n if (bytes >= 1e15) {\n return (bytes / 1e15).toFixed(2) + ' PB'\n }\n\n if (bytes >= 1e12) {\n return (bytes / 1e12).toFixed(2) + ' TB'\n }\n\n if (bytes >= 1e9) {\n return (bytes / 1e9).toFixed(2) + ' GB'\n }\n\n if (bytes >= 1e6) {\n return (bytes / 1e6).toFixed(2) + ' MB'\n }\n\n if (bytes >= 1e3) {\n return (bytes / 1e3).toFixed(2) + ' kB'\n }\n\n return bytes + ' bytes'\n}\n\nexport function getAssetNameFromFiles(files: FilePath[]): string {\n if (files.length === 1) return files[0].name\n\n if (files.length > 0) {\n const prefix = getPath(files[0]).split('/')[0]\n\n // Only if all files have a common prefix we can use it as a folder name\n if (files.every(f => getPath(f).split('/')[0] === prefix)) return prefix\n }\n\n return 'unknown'\n}\n\nexport function getMetadata(files: FilePath[]): Metadata {\n const size = files.reduce((total, item) => total + item.size, 0)\n const isWebsite = Boolean(detectIndexHtml(files))\n const name = getAssetNameFromFiles(files)\n const type = files.length === 1 ? files[0].type : 'folder'\n const count = files.length\n\n return { size, name, type, isWebsite, count }\n}\n\nexport function getPath(file: FilePath): string {\n return (file.path || file.webkitRelativePath || file.name).replace(/^\\//g, '') // remove the starting slash\n}\n\n/**\n * Utility function that is needed to have correct directory structure as webkitRelativePath is read only\n */\nexport function packageFile(file: FilePath): FilePath {\n const path = getPath(file)\n\n return {\n path: path,\n fullPath: path,\n webkitRelativePath: path,\n lastModified: file.lastModified,\n name: file.name,\n size: file.size,\n type: file.type,\n stream: file.stream,\n slice: file.slice,\n text: file.text,\n arrayBuffer: async () => await file.arrayBuffer(), // This is needed for successful upload and can not simply be { arrayBuffer: file.arrayBuffer }\n }\n}\n","interface Dimensions {\n width: number\n height: number\n}\n\n/**\n * Get the dimensions of the image after resize\n *\n * @param imgWidth Current image width\n * @param imgHeight Current image height\n * @param maxWidth Desired max width\n * @param maxHeight Desired max height\n *\n * @returns Downscaled dimensions of the image to fit in the bounding box\n */\nexport function getDimensions(imgWidth: number, imgHeight: number, maxWidth?: number, maxHeight?: number): Dimensions {\n const ratioWidth = maxWidth ? imgWidth / maxWidth : 1\n const ratioHeight = maxHeight ? imgHeight / maxHeight : 1\n\n const ratio = Math.max(ratioWidth, ratioHeight)\n\n // No need to resize\n if (ratio <= 1) return { width: imgWidth, height: imgHeight }\n\n return { width: imgWidth / ratio, height: imgHeight / ratio }\n}\n\n/**\n * Resize image passed to fit in the bounding box defined with maxWidth and maxHeight.\n * Note that one or both of the bounding box dimensions may be omitted\n *\n * @param file Image file to be resized\n * @param maxWidth Maximal image width\n * @param maxHeight Maximal image height\n *\n * @returns Promise that resolves into the resized image blob\n */\nexport function resize(file: File, maxWidth?: number, maxHeight?: number): Promise {\n return new Promise((resolve, reject) => {\n const allowedTypes = [\n 'image/bmp',\n 'image/gif',\n 'image/vnd.microsoft.icon',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp',\n ]\n\n if (!file.size || !file.type || !allowedTypes.includes(file.type)) return reject('File not supported!')\n\n try {\n const reader = new FileReader()\n reader.readAsDataURL(file)\n reader.onload = event => {\n const src = event?.target?.result\n\n if (!src || typeof src !== 'string') throw new Error('Failed to load the image source')\n\n const img = new Image()\n img.src = src\n img.onload = () => {\n const dimensions = getDimensions(img.width, img.height, maxWidth, maxHeight)\n const elem = document.createElement('canvas')\n elem.width = dimensions.width\n elem.height = dimensions.height\n const ctx = elem.getContext('2d')\n\n if (!ctx) throw new Error('Failed to create canvas context')\n\n ctx.drawImage(img, 0, 0, elem.width, elem.height)\n ctx.canvas.toBlob(\n blob => {\n if (!blob) throw new Error('Failed to extract the blob from canvas')\n\n resolve(blob)\n },\n 'image/jpeg',\n 1,\n )\n }\n }\n reader.onerror = error => reject(error)\n } catch (error) {\n reject(error)\n }\n })\n}\n","export const META_FILE_NAME = '.swarmgatewaymeta.json'\nexport const PREVIEW_FILE_NAME = '.swarmgatewaypreview.jpeg'\nexport const PREVIEW_DIMENSIONS = { maxWidth: 250, maxHeight: 175 }\n","/* eslint-disable @typescript-eslint/no-empty-function */\n\nimport { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\nimport { getMetadata } from '../utils/file'\nimport { resize } from '../utils/image'\nimport { PREVIEW_DIMENSIONS } from '../constants'\n\nexport type UploadOrigin = { origin: 'UPLOAD' | 'FEED'; uuid?: string }\n\nexport const defaultUploadOrigin: UploadOrigin = { origin: 'UPLOAD' }\n\ninterface ContextInterface {\n files: FilePath[]\n setFiles: (files: FilePath[]) => void\n uploadOrigin: UploadOrigin\n setUploadOrigin: (uploadOrigin: UploadOrigin) => void\n metadata?: Metadata\n previewUri?: string\n previewBlob?: Blob\n}\n\nconst initialValues: ContextInterface = {\n files: [],\n setFiles: () => {},\n uploadOrigin: defaultUploadOrigin,\n setUploadOrigin: () => {},\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [files, setFiles] = useState(initialValues.files)\n const [uploadOrigin, setUploadOrigin] = useState(initialValues.uploadOrigin)\n const [metadata, setMetadata] = useState(undefined)\n const [previewUri, setPreviewUri] = useState(undefined)\n const [previewBlob, setPreviewBlob] = useState(undefined)\n\n useEffect(() => {\n setMetadata(getMetadata(files))\n\n if (previewUri) {\n URL.revokeObjectURL(previewUri) // Clear the preview from memory\n setPreviewUri(undefined)\n setPreviewBlob(undefined)\n }\n\n if (files.length !== 1 || !files[0].type.startsWith('image')) return\n\n resize(files[0], PREVIEW_DIMENSIONS.maxWidth, PREVIEW_DIMENSIONS.maxHeight).then(blob => {\n setPreviewUri(URL.createObjectURL(blob)) // NOTE: Until it is cleared with URL.revokeObjectURL, the file stays allocated in memory\n setPreviewBlob(blob)\n })\n\n return () => {\n if (previewUri) {\n URL.revokeObjectURL(previewUri)\n }\n }\n }, [files]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { DropzoneArea } from 'material-ui-dropzone'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { FilePlus, FolderPlus, PlusCircle } from 'react-feather'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context, UploadOrigin } from '../../providers/File'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml } from '../../utils/file'\n\ninterface Props {\n uploadOrigin: UploadOrigin\n showHelp: boolean\n}\n\nconst MAX_FILE_SIZE = 1_000_000_000 // 1 gigabyte\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n areaWrapper: { position: 'relative', marginBottom: theme.spacing(2) },\n dropzone: {\n background: theme.palette.background.default,\n outline: 'none',\n color: 'transparent',\n zIndex: 1,\n '& svg': {\n opacity: 0,\n },\n },\n buttonWrapper: {\n top: '0',\n left: '0',\n position: 'absolute',\n display: 'flex',\n width: '100%',\n height: '100%',\n justifyContent: 'center',\n alignItems: 'center',\n },\n button: {\n marginLeft: theme.spacing(0.5),\n marginRight: theme.spacing(0.5),\n zIndex: 2,\n },\n }),\n)\n\nexport function UploadArea({ uploadOrigin, showHelp }: Props): ReactElement {\n const { setFiles, setUploadOrigin } = useContext(Context)\n const classes = useStyles()\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n const [strictWebsiteMode, setStrictWebsiteMode] = useState(false)\n const [version, setVersion] = useState(0)\n\n const getDropzoneInputDomElement = () => document.querySelector('.MuiDropzoneArea-root input') as HTMLInputElement\n\n const onUploadCollectionClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.setAttribute('directory', '')\n element.setAttribute('webkitdirectory', '')\n element.setAttribute('mozdirectory', '')\n element.click()\n }\n }\n\n const onUploadWebsiteClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(true)\n }\n\n const onUploadFolderClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(false)\n }\n\n const onUploadFileClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.removeAttribute('directory')\n element.removeAttribute('webkitdirectory')\n element.removeAttribute('mozdirectory')\n element.click()\n }\n }\n\n const resetComponentOnAddingInvalidContent = () => {\n setTimeout(() => {\n setVersion(x => x + 1)\n setFiles([])\n }, 0)\n }\n\n const handleChange = (files?: File[]) => {\n if (files) {\n const FilePaths = files as FilePath[]\n const indexDocument = files.length === 1 ? files[0].name : detectIndexHtml(FilePaths) || undefined\n\n if (files.length && strictWebsiteMode && !indexDocument) {\n enqueueSnackbar('To upload a website, there must be an index.html or index.htm in the root of the folder.', {\n variant: 'error',\n })\n resetComponentOnAddingInvalidContent()\n\n return\n }\n\n setFiles(FilePaths)\n\n if (files.length) {\n setUploadOrigin(uploadOrigin)\n navigate(ROUTES.UPLOAD_IN_PROGRESS)\n }\n }\n }\n\n return (\n <>\n
    \n \n
    \n \n Add File\n \n \n Add Folder\n \n \n Add Website\n \n
    \n
    \n {showHelp && (\n \n You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm,\n make sure that your folder contains an “index.html” file.\n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { UploadArea } from '../files/UploadArea'\n\nexport function FeedSubpage(): ReactElement {\n const { identities } = useContext(IdentityContext)\n const { uuid } = useParams()\n const { beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [available, setAvailable] = useState(false)\n\n const identity = identities.find(x => x.uuid === uuid)\n\n useEffect(() => {\n if (!identity || !identity.feedHash) {\n return\n }\n\n try {\n beeApi?.downloadData(identity.feedHash).then(() => setAvailable(true))\n } catch {\n setAvailable(false)\n }\n }, [beeApi, uuid, identity])\n\n if (!identity || !status.all) {\n navigate(ROUTES.FEEDS, { replace: true })\n\n return <>\n }\n\n function onClose() {\n navigate(ROUTES.FEEDS)\n }\n\n return (\n
    \n {`${identity.name} Website`}\n \n {available && identity.feedHash ? (\n <>\n \n \n \n \n \n \n \n ) : (\n \n \n This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the{' '}\n \n official Bee documentation\n \n .\n \n \n )}\n \n \n Close\n \n \n
    \n )\n}\n","import { PostageBatch } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport { Context as SettingsContext } from './Settings'\n\nexport interface EnrichedPostageBatch extends PostageBatch {\n usage: number\n usageText: string\n}\n\ninterface ContextInterface {\n stamps: EnrichedPostageBatch[] | null\n error: Error | null\n isLoading: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst initialValues: ContextInterface = {\n stamps: null,\n error: null,\n isLoading: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction enrichStamp(postageBatch: PostageBatch): EnrichedPostageBatch {\n const { depth, bucketDepth, utilization } = postageBatch\n\n const usage = utilization / Math.pow(2, depth - bucketDepth)\n const usageText = `${Math.ceil(usage * 100)}%`\n\n return {\n ...postageBatch,\n usage,\n usageText,\n }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n const [stamps, setStamps] = useState(initialValues.stamps)\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(null)\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isLoading) return\n\n if (!beeDebugApi) return\n\n try {\n setIsLoading(true)\n const stamps = await beeDebugApi.getAllPostageBatch()\n\n setStamps(stamps.map(enrichStamp))\n setLastUpdate(Date.now())\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\n\ninterface Props {\n feedName: string\n onProceed: (password: string) => void\n onCancel: () => void\n loading: boolean\n}\n\nexport function FeedPasswordDialog({ feedName, onProceed, onCancel, loading }: Props): ReactElement {\n const [password, setPassword] = useState('')\n\n function onProceedClick() {\n return onProceed(password)\n }\n\n return (\n \n \n Update Feed\n \n \n Please enter the password for “{feedName}”:\n \n \n {\n setPassword(event.target.value)\n }}\n password\n />\n \n \n \n Proceed\n \n \n Cancel\n \n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { Bookmark, X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SelectEvent, SwarmSelect } from '../../components/SwarmSelect'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { FeedPasswordDialog } from './FeedPasswordDialog'\n\nexport default function UpdateFeed(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { stamps, refresh } = useContext(StampContext)\n const { status } = useContext(BeeContext)\n const { hash } = useParams()\n\n const [selectedStamp, setSelectedStamp] = useState(null)\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n function onFeedChange(event: SelectEvent) {\n const uuid = event.target.value\n setSelectedIdentity(identities.find(x => x.uuid === uuid) || null)\n }\n\n function onStampChange(event: SelectEvent) {\n const batchId = event.target.value as string\n setSelectedStamp(batchId)\n }\n\n function onCancel() {\n navigate(-1)\n }\n\n function onBeginUpdatingFeed() {\n if (!selectedIdentity) {\n return\n }\n\n if (selectedIdentity.type === 'V3') {\n setShowPasswordPrompt(true)\n } else {\n onFeedUpdate(selectedIdentity)\n }\n }\n\n async function onFeedUpdate(identity: Identity, password?: string) {\n setLoading(true)\n\n if (!beeApi || !beeDebugApi || !selectedStamp) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n try {\n await updateFeed(beeApi, identity, hash!, selectedStamp, password as string) // eslint-disable-line\n persistIdentity(identities, identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', identity.uuid))\n } catch (error: unknown) {\n setLoading(false)\n\n const message = (typeof error === 'object' && error !== null && Reflect.get(error, 'message')) || ''\n\n if (message.includes('possibly wrong passphrase')) {\n enqueueSnackbar('Wrong password, please try again', { variant: 'error' })\n } else {\n enqueueSnackbar('Could not update feed at this time, please try again later', { variant: 'error' })\n }\n }\n }\n\n if (!status.all) return \n\n return (\n
    \n {showPasswordPrompt && selectedIdentity && (\n {\n setShowPasswordPrompt(false)\n }}\n onProceed={(password: string) => {\n onFeedUpdate(selectedIdentity, password)\n }}\n loading={loading}\n />\n )}\n Update feed\n \n \n ({ value: x.uuid, label: `${x.name} Website` }))}\n onChange={onFeedChange}\n label=\"Feed\"\n />\n \n \n\n \n \n {stamps ? (\n ({ value: x.batchID, label: x.batchID.slice(0, 8) }))}\n onChange={onStampChange}\n label=\"Stamp\"\n />\n ) : (\n You need to buy a stamp first to be able to update a feed.\n )}\n \n \n \n \n Update Selected Feed\n \n \n Close\n \n \n
    \n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography } from '@material-ui/core'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: '#F7F7F7',\n marginBottom: theme.spacing(0.25),\n },\n typography: {\n color: '#242424',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemNote({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {children}\n \n \n )\n}\n","import { Grid, IconButton, InputBase, ListItem, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ChangeEvent, ReactElement, useState } from 'react'\nimport { Edit, Minus, Search, X } from 'react-feather'\nimport ExpandableListItemActions from './ExpandableListItemActions'\nimport ExpandableListItemNote from './ExpandableListItemNote'\nimport { SwarmButton } from './SwarmButton'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n unselectableLabel: {\n cursor: 'default',\n userSelect: 'none',\n // Many browsers don't support yet the general user-select css property\n WebkitUserSelect: 'none',\n MozUserSelect: 'none',\n msUserSelect: 'none',\n },\n }),\n)\n\ninterface Props {\n label: string\n value?: string\n placeholder?: string\n helperText?: string\n expandedOnly?: boolean\n confirmLabel?: string\n confirmLabelDisabled?: boolean\n loading?: boolean\n onChange?: (value: string) => void\n onConfirm: (value: string) => void\n mapperFn?: (value: string) => string\n locked?: boolean\n}\n\nexport default function ExpandableListItemKey({\n label,\n value,\n onConfirm,\n onChange,\n confirmLabel,\n confirmLabelDisabled,\n expandedOnly,\n helperText,\n placeholder,\n loading,\n mapperFn,\n locked,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(expandedOnly))\n const [inputValue, setInputValue] = useState(value || '')\n const toggleOpen = () => setOpen(!open)\n const handleChange = (e: ChangeEvent) => {\n if (mapperFn) {\n e.target.value = mapperFn(e.target.value)\n }\n\n setInputValue(e.target.value)\n\n if (onChange) onChange(e.target.value)\n }\n\n return (\n <>\n \n \n \n {label && (\n \n {label}\n \n )}\n \n
    \n {!open && value}\n {!expandedOnly && !locked && (\n \n {open ? (\n \n ) : (\n \n )}\n \n )}\n
    \n
    \n
    \n \n \n
    \n
    \n \n {helperText && {helperText}}\n \n onConfirm(inputValue)}\n >\n {confirmLabel || 'Save'}\n \n setInputValue(value || '')}\n cancel\n >\n Cancel\n \n \n \n \n )\n}\n","import { shortenHash } from './hash'\n\nexport enum HISTORY_KEYS {\n UPLOAD_HISTORY = 'UPLOAD_HISTORY',\n DOWNLOAD_HISTORY = 'DOWNLOAD_HISTORY',\n}\n\nexport interface HistoryItem {\n createdAt: number\n name: string\n hash: string\n}\n\nexport function putHistory(key: string, hash: string, name: string): void {\n const history = getHistorySafe(key)\n\n const existingIndex = history.findIndex(x => x.hash === hash)\n\n if (existingIndex !== -1) {\n history.splice(existingIndex, 1)\n }\n\n history.unshift({\n createdAt: Date.now(),\n hash,\n name,\n })\n\n if (history.length > 10) {\n history.length = 10\n }\n localStorage.setItem(key, JSON.stringify(history))\n}\n\nexport function getHistorySafe(key: string): HistoryItem[] {\n const items = localStorage.getItem(key)\n\n if (!items) {\n return []\n }\n try {\n const parsed = JSON.parse(items)\n\n if (!Array.isArray(parsed) || !parsed.every(isHistoryItem)) {\n return []\n }\n\n return parsed\n } catch {\n return []\n }\n}\n\nfunction isHistoryItem(x: unknown): x is HistoryItem {\n if (typeof x !== 'object' || x === null) {\n return false\n }\n\n return 'createdAt' in x && 'hash' in x\n}\n\nexport function determineHistoryName(hash: string, indexDocument?: string | null): string {\n if (indexDocument === 'index.html') {\n return `Website ${shortenHash(hash, 4)}`\n } else if (indexDocument) {\n return indexDocument\n }\n\n return `Folder ${shortenHash(hash, 4)}`\n}\n","export function shortenHash(hash: string, sliceLength = 8): string {\n return `${hash.slice(0, sliceLength)}[…]${hash.slice(-sliceLength)}`\n}\n","import { ReactElement, useEffect, useState } from 'react'\nimport { getPrettyDateString } from '../utils/date'\nimport { getHistorySafe, HistoryItem, HISTORY_KEYS } from '../utils/local-storage'\nimport ExpandableList from './ExpandableList'\nimport ExpandableListItemLink from './ExpandableListItemLink'\n\ninterface Props {\n title: string\n localStorageKey: HISTORY_KEYS\n}\n\nexport function History({ title, localStorageKey }: Props): ReactElement | null {\n const [items, setItems] = useState([])\n\n useEffect(() => {\n setItems(getHistorySafe(localStorageKey))\n }, [localStorageKey])\n\n if (!items.length) {\n return null\n }\n\n return (\n \n {items.map((x, i) => (\n \n ))}\n \n )\n}\n","export function getPrettyDateString(date: Date): string {\n const string = date.toString()\n\n return string.split('GMT')[0].trim()\n}\n","import { createStyles, makeStyles, Tab, Tabs, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { ROUTES } from '../../routes'\n\ninterface Props {\n active: 'UPLOAD' | 'DOWNLOAD'\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n marginBottom: theme.spacing(4),\n },\n leftTab: {\n marginRight: theme.spacing(0.5),\n },\n rightTab: {\n marginLeft: theme.spacing(0.5),\n },\n }),\n)\n\nexport function FileNavigation({ active }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function onChange(event: React.ChangeEvent>, newValue: number) {\n navigate(newValue === 1 ? ROUTES.DOWNLOAD : ROUTES.UPLOAD)\n }\n\n return (\n
    \n \n \n \n \n
    \n )\n}\n","import { Utils } from '@ethersphere/bee-js'\nimport { ManifestJs } from '@ethersphere/manifest-js'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { History } from '../../components/History'\nimport { Context, defaultUploadOrigin } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { extractSwarmHash } from '../../utils'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\n\nexport function Download(): ReactElement {\n const [loading, setLoading] = useState(false)\n const { beeApi } = useContext(SettingsContext)\n const [referenceError, setReferenceError] = useState(undefined)\n\n const { setUploadOrigin } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n const validateChange = (value: string) => {\n if (Utils.isHexString(value, 64) || Utils.isHexString(value, 128) || !value.trim().length) {\n setReferenceError(undefined)\n } else {\n setReferenceError('Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.')\n }\n }\n\n async function onSwarmIdentifier(identifier: string) {\n setLoading(true)\n\n if (!beeApi) {\n setLoading(false)\n\n return\n }\n\n try {\n const manifestJs = new ManifestJs(beeApi)\n const feedIdentifier = await manifestJs.resolveFeedManifest(identifier)\n\n if (feedIdentifier) {\n identifier = feedIdentifier\n }\n const isManifest = await manifestJs.isManifest(identifier)\n\n if (!isManifest) {\n throw Error('The specified hash does not contain valid content.')\n }\n const indexDocument = await manifestJs.getIndexDocumentPath(identifier)\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, identifier, determineHistoryName(identifier, indexDocument))\n setUploadOrigin(defaultUploadOrigin)\n navigate(ROUTES.HASH.replace(':hash', identifier))\n } catch (error: unknown) {\n let message = typeof error === 'object' && error !== null && Reflect.get(error, 'message')\n\n if (message.includes('path address not found')) {\n message = 'The specified hash does not have an index document set.'\n }\n\n if (message.includes('Not Found: Not Found')) {\n message = 'The specified hash was not found.'\n }\n enqueueSnackbar(Error: {message || 'Unknown'}, { variant: 'error' })\n } finally {\n setLoading(false)\n }\n }\n\n function recognizeSwarmHash(value: string) {\n if (value.length < 64) {\n return value\n }\n\n const hash = extractSwarmHash(value)\n\n if (hash) {\n return hash\n }\n\n return value\n }\n\n return (\n <>\n \n onSwarmIdentifier(value)}\n onChange={validateChange}\n helperText={referenceError}\n confirmLabel={'Find'}\n confirmLabelDisabled={Boolean(referenceError) || loading}\n placeholder=\"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605\"\n expandedOnly\n mapperFn={value => recognizeSwarmHash(value)}\n loading={loading}\n />\n \n \n )\n}\n","import { CircularProgress, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nexport function Loading(): ReactElement {\n return (\n \n \n \n )\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n image: {\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n },\n }),\n)\n\ninterface Props {\n alt: string\n src: string | undefined\n maxHeight?: string\n maxWidth?: string\n}\n\nexport function FitImage(props: Props): ReactElement {\n const classes = useStyles()\n\n const inlineStyles: Record = {}\n\n props.maxHeight && (inlineStyles.maxHeight = props.maxHeight)\n props.maxWidth && (inlineStyles.maxWidth = props.maxWidth)\n\n return {props.alt}\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n width: '175px',\n height: '175px',\n background: `repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )`,\n },\n }),\n)\n\nexport function StripedWrapper({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return
    {children}
    \n}\n","import { ReactElement } from 'react'\nimport { StripedWrapper } from '../../components/StripedWrapper'\n\ninterface Props {\n icon: ReactElement\n}\n\nexport function AssetIcon({ icon }: Props): ReactElement {\n return {icon}\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Web } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { File, Folder } from 'react-feather'\nimport { FitImage } from '../../components/FitImage'\nimport { shortenText } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { shortenHash } from '../../utils/hash'\nimport { AssetIcon } from './AssetIcon'\n\ninterface Props {\n previewUri?: string\n metadata?: Metadata\n}\n\n// TODO: add optional prop for indexDocument when it is already known (e.g. downloading a manifest)\n\nexport function AssetPreview({ metadata, previewUri }: Props): ReactElement | null {\n let previewComponent = \n let type = metadata?.type\n\n if (metadata?.isWebsite) {\n previewComponent = \n type = 'Website'\n } else if (metadata?.type === 'folder') {\n previewComponent = \n type = 'Folder'\n }\n\n return (\n \n \n \n {previewUri ? (\n \n ) : (\n \n )}\n \n {metadata?.hash && Swarm Hash: {shortenHash(metadata.hash)}}\n {metadata?.name && metadata?.name !== metadata?.hash && (\n \n {metadata?.type === 'folder' ? 'Folder Name' : 'Filename'}: {shortenText(metadata?.name)}\n \n )}\n Kind: {type}\n {metadata?.size ? Size: {getHumanReadableFileSize(metadata.size)} : null}\n \n \n \n {metadata?.type === 'folder' && metadata.count && (\n \n \n Folder content\n {metadata.count} items\n \n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\n\ninterface Props {\n isWebsite?: boolean\n hash: string\n}\n\nexport function AssetSummary({ isWebsite, hash }: Props): ReactElement {\n return (\n <>\n \n \n \n {isWebsite && (\n \n )}\n \n \n The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided\n for testing purposes only. Learn more at{' '}\n https://gateway.ethswarm.org/.\n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Bookmark, Download, Link, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n onOpen: () => void\n onCancel: () => void\n onDownload: () => void\n onUpdateFeed: () => void\n hasIndexDocument: boolean\n loading: boolean\n}\n\nexport function DownloadActionBar({\n onOpen,\n onCancel,\n onDownload,\n onUpdateFeed,\n hasIndexDocument,\n loading,\n}: Props): ReactElement {\n return (\n \n \n {hasIndexDocument && (\n \n View Website\n \n )}\n \n Download\n \n \n Close\n \n \n \n \n Update Feed\n \n \n \n )\n}\n","import { ManifestJs } from '@ethersphere/manifest-js'\nimport { Box, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport JSZip from 'jszip'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate, useParams } from 'react-router-dom'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { Loading } from '../../components/Loading'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport config from '../../config'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { AssetPreview } from './AssetPreview'\nimport { AssetSummary } from './AssetSummary'\nimport { DownloadActionBar } from './DownloadActionBar'\n\nexport function Share(): ReactElement {\n const { apiUrl, beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const { hash } = useParams()\n const reference = hash! // eslint-disable-line\n\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n\n const [loading, setLoading] = useState(true)\n const [downloading, setDownloading] = useState(false)\n const [swarmEntries, setSwarmEntries] = useState>({})\n const [indexDocument, setIndexDocument] = useState(null)\n const [notFound, setNotFound] = useState(false)\n const [preview, setPreview] = useState(undefined)\n const [metadata, setMetadata] = useState()\n\n async function prepare() {\n if (!beeApi || !status.all) {\n return\n }\n\n const manifestJs = new ManifestJs(beeApi)\n const isManifest = await manifestJs.isManifest(reference)\n\n if (!isManifest) {\n setNotFound(true)\n enqueueSnackbar('The specified hash does not contain valid content.', { variant: 'error' })\n\n return\n }\n const entries = await manifestJs.getHashes(reference)\n const indexDocument = await manifestJs.getIndexDocumentPath(reference)\n setIndexDocument(indexDocument)\n\n const previewFile = entries[PREVIEW_FILE_NAME]\n\n delete entries[META_FILE_NAME]\n delete entries[PREVIEW_FILE_NAME]\n setSwarmEntries(entries)\n\n const count = Object.keys(entries).length\n\n let metadata: Metadata | undefined = {\n hash,\n size: 0,\n type: count > 1 ? 'folder' : 'unknown',\n name: reference,\n isWebsite: Boolean(indexDocument) && count > 1,\n count,\n }\n\n try {\n const mtdt = await beeApi.downloadFile(reference, META_FILE_NAME)\n const remoteMetadata = mtdt.data.text()\n metadata = { ...metadata, ...(JSON.parse(remoteMetadata) as Metadata) }\n } catch (e) {} // eslint-disable-line no-empty\n\n if (previewFile) {\n setPreview(`${config.BEE_API_HOST}/bzz/${reference}/${PREVIEW_FILE_NAME}`)\n }\n\n setMetadata(metadata)\n }\n\n function onOpen() {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n }\n\n function onClose() {\n if (navigate.length > 0) {\n // There is at least one different route in browser history that we can return to\n navigate(-1)\n } else {\n // This is the first page user opened, navigate to upload page instead of going back\n navigate(ROUTES.UPLOAD)\n }\n }\n\n function onUpdateFeed() {\n navigate(ROUTES.FEEDS_UPDATE.replace(':hash', reference))\n }\n\n useEffect(() => {\n setLoading(true)\n prepare().finally(() => {\n setLoading(false)\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reference])\n\n async function onDownload() {\n if (!beeApi) {\n return\n }\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, reference, determineHistoryName(reference, indexDocument))\n setDownloading(true)\n\n if (Object.keys(swarmEntries).length === 1) {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n } else {\n const zip = new JSZip()\n for (const [path, hash] of Object.entries(swarmEntries)) {\n zip.file(path, await beeApi.downloadData(hash))\n }\n const content = await zip.generateAsync({ type: 'blob' })\n saveAs(content, reference + '.zip')\n }\n setDownloading(false)\n }\n\n if (!status.all) return \n\n if (loading) {\n return \n }\n\n if (notFound) {\n return (\n <>\n Not Found\n The specified hash is not found.\n \n )\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n steps: string[]\n index: number\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n height: '52px',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n todo: {\n background: '#f7f7f7',\n color: '#c9c9c9',\n },\n inProgress: {\n background: '#ffffff',\n color: '#242424',\n height: '52px',\n },\n done: {\n background: '#f7f7f7',\n color: '#606060',\n height: '52px',\n },\n }),\n)\n\nexport function ProgressIndicator({ steps, index }: Props): ReactElement {\n const classes = useStyles()\n\n function pickClass(i: number): string {\n if (i === index) {\n return classes.inProgress\n }\n\n return i < index ? classes.done : classes.todo\n }\n\n return (\n \n {steps.map((x, i) => (\n
    \n {x}\n
    \n ))}\n
    \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport BigNumber from 'bignumber.js'\nimport { Form, Formik, FormikHelpers } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext } from 'react'\nimport { Check } from 'react-feather'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { calculateStampPrice, convertAmountToSeconds, convertDepthToBytes, secondsToTimeString } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\n\ninterface FormValues {\n depth?: string\n amount?: string\n label?: string\n}\ntype FormErrors = Partial\nconst initialFormValues: FormValues = {\n depth: '',\n amount: '',\n label: '',\n}\n\ninterface Props {\n onFinished: () => void\n}\n\nexport function PostageStampCreation({ onFinished }: Props): ReactElement {\n const { chainState } = useContext(BeeContext)\n const { refresh } = useContext(StampsContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { enqueueSnackbar } = useSnackbar()\n\n function getFileSize(depth: number): string {\n if (isNaN(depth) || depth < 17 || depth > 255) {\n return '-'\n }\n\n return `~${getHumanReadableFileSize(convertDepthToBytes(depth))}`\n }\n\n function getTtl(amount: number): string {\n const isCurrentPriceAvailable = chainState && chainState.currentPrice\n\n if (amount <= 0 || !isCurrentPriceAvailable) {\n return '-'\n }\n\n const pricePerBlock = Number.parseInt(chainState.currentPrice, 10)\n\n return `${secondsToTimeString(convertAmountToSeconds(amount, pricePerBlock))} (with price of 0 per block)`\n }\n\n function getPrice(depth: number, amount: bigint): string {\n const hasInvalidInput = amount <= 0 || isNaN(depth) || depth < 17 || depth > 255\n\n if (hasInvalidInput) {\n return '-'\n }\n\n const price = calculateStampPrice(depth, amount)\n\n return `${price.toSignificantDigits()} BZZ`\n }\n\n return (\n ) => {\n try {\n // This is really just a typeguard, the validation pretty much guarantees these will have the right values\n if (!values.depth || !values.amount) return\n\n if (!beeDebugApi) return\n\n const amount = BigInt(values.amount)\n const depth = Number.parseInt(values.depth)\n const options = values.label ? { label: values.label } : undefined\n await beeDebugApi.createPostageBatch(amount.toString(), depth, options)\n actions.resetForm()\n await refresh()\n onFinished()\n } catch (e) {\n enqueueSnackbar(`Error: ${(e as Error).message}`, { variant: 'error' })\n actions.setSubmitting(false)\n }\n }}\n validate={(values: FormValues) => {\n const errors: FormErrors = {}\n\n // Depth\n if (!values.depth) errors.depth = 'Required field'\n else {\n const depth = new BigNumber(values.depth)\n\n if (!depth.isInteger()) errors.depth = 'Depth must be an integer'\n else if (depth.isLessThan(16)) errors.depth = 'Minimal depth is 16'\n else if (depth.isGreaterThan(255)) errors.depth = 'Depth has to be at most 255'\n }\n\n // Amount\n if (!values.amount) errors.amount = 'Required field'\n else {\n const amount = new BigNumber(values.amount)\n\n if (!amount.isInteger()) errors.amount = 'Amount must be an integer'\n else if (amount.isLessThanOrEqualTo(0)) errors.amount = 'Amount must be greater than 0'\n }\n\n // Label\n if (values.label && !/^[0-9a-z]*$/i.test(values.label)) errors.label = 'Label must be an alphanumeric string'\n\n return errors\n }}\n >\n {({ submitForm, isValid, isSubmitting, values }) => (\n
    \n \n \n \n \n Corresponding file size\n {getFileSize(parseInt(values.depth || '0', 10))}\n \n \n \n \n \n \n \n Corresponding TTL (Time to live)\n {getTtl(Number.parseInt(values.amount || '0', 10))}\n \n \n \n \n \n \n \n \n Indicative Price\n {getPrice(parseInt(values.depth || '0', 10), BigInt(values.amount || '0'))}\n \n \n \n Buy New Stamp\n \n \n )}\n \n )\n}\n","import React, { ReactElement, useContext } from 'react'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { Context, EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n onSelect: (stamp: EnrichedPostageBatch) => void\n defaultValue?: string\n}\n\nexport function PostageStampSelector({ onSelect, defaultValue }: Props): ReactElement {\n const { stamps } = useContext(Context)\n\n function onChange(stampId: string) {\n if (!stamps) {\n return\n }\n const stamp = stamps.find(x => x.batchID === stampId)\n\n if (stamp) {\n onSelect(stamp)\n }\n }\n\n return (\n ({ label: x.batchID.slice(0, 8), value: x.batchID }))}\n onChange={event => onChange(event.target.value as string)}\n defaultValue={defaultValue}\n />\n )\n}\n","import { ReactElement } from 'react'\n\ninterface Props {\n width: string\n usage: number\n}\n\nexport function Capacity({ width, usage }: Props): ReactElement {\n const integerUsage = Math.round(usage * 100)\n const used = integerUsage + '%'\n const free = 100 - 2 - integerUsage + '%'\n\n return (\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Capacity } from '../../components/Capacity'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n shorten?: boolean\n}\n\nexport function PostageStamp({ stamp, shorten }: Props): ReactElement {\n return (\n \n \n {shorten ? stamp.batchID.slice(0, 8) : stamp.batchID}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { PostageStamp } from '../stamps/PostageStamp'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n}\n\nexport function StampPreview({ stamp }: Props): ReactElement {\n return (\n \n \n Associated postage stamp:\n \n \n \n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { ArrowLeft, Check, Layers, PlusSquare, X } from 'react-feather'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n step: number\n onUpload: () => void\n onCancel: () => void\n onGoBack: () => void\n onProceed: () => void\n isUploading: boolean\n hasStamp: boolean\n uploadLabel: string\n stampMode: 'BUY' | 'SELECT'\n setStampMode: (mode: 'BUY' | 'SELECT') => void\n}\n\nexport function UploadActionBar({\n step,\n onUpload,\n onCancel,\n onGoBack,\n onProceed,\n isUploading,\n hasStamp,\n uploadLabel,\n stampMode,\n setStampMode,\n}: Props): ReactElement {\n if (step === 0) {\n return (\n <>\n \n \n \n Add Postage Stamp\n \n \n Cancel\n \n \n \n You need a postage stamp to upload.\n \n )\n }\n\n if (step === 1) {\n return (\n \n \n {stampMode === 'SELECT' && (\n \n Proceed With Selected Stamp\n \n )}\n \n Back To Preview\n \n \n setStampMode(stampMode === 'BUY' ? 'SELECT' : 'BUY')}\n iconType={stampMode === 'BUY' ? Layers : PlusSquare}\n >\n {stampMode === 'BUY' ? 'Use Existing Stamp' : 'Buy New Stamp'}\n \n \n )\n }\n\n if (step === 2) {\n return (\n \n \n {uploadLabel}\n \n \n Change Postage Stamp\n \n \n )\n }\n\n return <>\n}\n","import { Box } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ProgressIndicator } from '../../components/ProgressIndicator'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as FileContext } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext, EnrichedPostageBatch } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml, getAssetNameFromFiles, packageFile } from '../../utils/file'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FeedPasswordDialog } from '../feeds/FeedPasswordDialog'\nimport { PostageStampCreation } from '../stamps/PostageStampCreation'\nimport { PostageStampSelector } from '../stamps/PostageStampSelector'\nimport { AssetPreview } from './AssetPreview'\nimport { StampPreview } from './StampPreview'\nimport { UploadActionBar } from './UploadActionBar'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\n\nexport function Upload(): ReactElement {\n const [step, setStep] = useState(0)\n const [stampMode, setStampMode] = useState<'SELECT' | 'BUY'>('SELECT')\n const [stamp, setStamp] = useState(null)\n const [isUploading, setUploading] = useState(false)\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const { refresh } = useContext(StampsContext)\n const { beeApi } = useContext(SettingsContext)\n const { files, setFiles, uploadOrigin, metadata, previewUri, previewBlob } = useContext(FileContext)\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n if (!files.length) {\n setFiles([])\n navigate(ROUTES.UPLOAD, { replace: true })\n\n return <>\n }\n\n const identity = uploadOrigin.uuid ? identities.find(x => x.uuid === uploadOrigin.uuid) : null\n\n const onUpload = () => {\n if (uploadOrigin.origin === 'UPLOAD') {\n uploadFiles()\n } else {\n if ((identity as Identity).type === 'PRIVATE_KEY') {\n uploadFiles()\n } else {\n setShowPasswordPrompt(true)\n }\n }\n }\n\n const uploadFiles = (password?: string) => {\n if (!beeApi || !files.length || !stamp || !metadata) {\n return\n }\n\n let fls = files.map(packageFile) // Apart from packaging, this is needed to not modify the original files array as it can trigger effects\n let indexDocument: string | undefined = undefined // This means we assume it's folder\n\n if (files.length === 1) indexDocument = files[0].name\n else if (files.length > 1) {\n const idx = detectIndexHtml(files)\n\n // This is a website\n if (idx) {\n // The website is in some directory, remove it\n if (idx.commonPrefix) {\n const substrStart = idx.commonPrefix.length\n indexDocument = idx.indexPath.substr(substrStart)\n fls = fls.map(f => {\n const path = (f.path as string).substr(substrStart)\n\n return { ...f, path, webkitRelativePath: path, fullPath: path }\n })\n } else {\n // The website is not packed in a directory\n indexDocument = idx.indexPath\n }\n }\n }\n const lastModified = files[0].lastModified\n\n // We want to store only some metadata\n const mtd: SwarmMetadata = {\n name: metadata.name,\n size: metadata.size,\n }\n\n // Type of the file only makes sense for a single file\n if (files.length === 1) mtd.type = metadata.type\n\n const metafile = new File([JSON.stringify(mtd)], META_FILE_NAME, {\n type: 'application/json',\n lastModified,\n })\n fls.push(packageFile(metafile))\n\n if (previewBlob) {\n const previewFile = new File([previewBlob], PREVIEW_FILE_NAME, {\n type: 'image/jpeg',\n lastModified,\n })\n fls.push(packageFile(previewFile))\n }\n\n setUploading(true)\n\n beeApi\n .uploadFiles(stamp.batchID, fls, { indexDocument })\n .then(hash => {\n putHistory(HISTORY_KEYS.UPLOAD_HISTORY, hash.reference, getAssetNameFromFiles(files))\n\n if (uploadOrigin.origin === 'UPLOAD') {\n navigate(ROUTES.HASH.replace(':hash', hash.reference), { replace: true })\n } else {\n updateFeed(beeApi, identity as Identity, hash.reference, stamp.batchID, password as string).then(() => {\n persistIdentity(identities, identity as Identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uploadOrigin.uuid as string), { replace: true })\n })\n }\n })\n .catch(e => {\n enqueueSnackbar(`Error uploading: ${e.message}`, { variant: 'error' })\n setUploading(false)\n })\n }\n\n const reset = () => {\n setStep(0)\n setFiles([])\n setStamp(null)\n setUploading(false)\n }\n\n const onFeedPasswordGiven = (password: string) => {\n uploadFiles(password)\n }\n\n return (\n <>\n {showPasswordPrompt && (\n setShowPasswordPrompt(false)}\n onProceed={onFeedPasswordGiven}\n />\n )}\n {identity && {`Update \"${identity.name}\"`}}\n {!identity && Upload}\n \n \n \n {(step === 0 || step === 2) && }\n {step === 1 && (\n <>\n \n {stampMode === 'SELECT' ? (\n setStamp(stamp)} defaultValue={stamp?.batchID} />\n ) : (\n setStampMode('SELECT')} />\n )}\n \n \n \n Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand these values.\n \n \n \n )}\n {step === 2 && stamp && }\n setStep(step => step - 1)}\n onProceed={() => setStep(step => step + 1)}\n onUpload={onUpload}\n isUploading={isUploading}\n hasStamp={Boolean(stamp)}\n uploadLabel={identity ? 'Update Feed' : 'Upload To Your Node'}\n stampMode={stampMode}\n setStampMode={setStampMode}\n />\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { History } from '../../components/History'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { defaultUploadOrigin } from '../../providers/File'\nimport { HISTORY_KEYS } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\nimport { UploadArea } from './UploadArea'\n\nexport function UploadLander(): ReactElement {\n const { status } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n <>\n \n \n \n \n )\n}\n","const OPTIMAL_CONNECTED_PEERS = 200\nconst OPTIMAL_POPULATION = 100000\nconst OPTIMAL_DEPTH = 12\n\ninterface Threshold {\n minimumValue: number\n explanation: string\n score: number\n}\n\ntype Thresholds = {\n connectedPeers: Threshold[]\n population: Threshold[]\n depth: Threshold[]\n}\n\ntype ThresholdValue = {\n score: number\n maximumScore: number\n explanation: string\n}\n\nexport type ThresholdValues = {\n connectedPeers: ThresholdValue\n population: ThresholdValue\n depth: ThresholdValue\n}\n\nconst GENERIC_ERROR = 'There may be issues with your Bee node or connection.'\n\nconst THRESHOLDS: Thresholds = {\n connectedPeers: [\n {\n minimumValue: OPTIMAL_CONNECTED_PEERS,\n explanation: `Perfect! ${OPTIMAL_CONNECTED_PEERS} or more connected peers indicate a healthy topology.`,\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is connected to peers, but this number should ideally be above ${OPTIMAL_CONNECTED_PEERS}. If you have only started your Bee node, this number may increase quickly.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not connected to any peers. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n population: [\n {\n minimumValue: OPTIMAL_POPULATION,\n explanation:\n 'Perfect! Your Bee node seems to have a realistic value for the network size, which means everything is working well on your end.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Population is usually above ${OPTIMAL_POPULATION.toLocaleString()}. If the number does not increase within a few hours, there may be issues with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has no information on the network population. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n depth: [\n {\n minimumValue: OPTIMAL_DEPTH,\n explanation: 'Perfect! Your Bee node has the highest available depth.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is supposed to reach a depth of ${OPTIMAL_DEPTH} eventually. Stagnation or decrease in this number may indicate problems with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not started building its topology yet. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n}\n\nexport function pickThreshold(key: keyof Thresholds, value: number): ThresholdValue {\n const thresholds = THRESHOLDS[key]\n const maximumScore = thresholds[0].score\n for (const item of thresholds) {\n if (value >= item.minimumValue) {\n return {\n score: item.score,\n maximumScore,\n explanation: item.explanation,\n }\n }\n }\n const last = thresholds[thresholds.length - 1]\n\n return {\n score: last.score,\n maximumScore,\n explanation: last.explanation,\n }\n}\n","import type { Topology } from '@ethersphere/bee-js'\nimport type { ReactElement } from 'react'\nimport { pickThreshold, ThresholdValues } from '../utils/threshold'\nimport ExpandableListItem from './ExpandableListItem'\n\ninterface Props {\n topology: Topology | null\n}\n\nconst TopologyStats = (props: Props): ReactElement => {\n const thresholds: ThresholdValues = {\n connectedPeers: pickThreshold('connectedPeers', props.topology?.connected || 0),\n population: pickThreshold('population', props.topology?.population || 0),\n depth: pickThreshold('depth', props.topology?.depth || 0),\n }\n\n const maximumTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.maximumScore, 0)\n const actualTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.score, 0)\n const percentageText = Math.round((actualTotalScore / maximumTotalScore) * 100) + '%'\n\n return (\n <>\n \n \n \n \n \n )\n}\n\nexport default TopologyStats\n","import { Button } from '@material-ui/core'\nimport { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport TopologyStats from '../../components/TopologyStats'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\n\nexport default function Status(): ReactElement {\n const {\n nodeInfo,\n status,\n latestUserVersion,\n isLatestBeeVersion,\n latestBeeVersionUrl,\n topology,\n nodeAddresses,\n chequebookAddress,\n } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n
    \n \n \n \n \n Bee\n \n {` ${latestUserVersion || '-'} `}\n \n
    \n }\n />\n \n \n \n\n \n {nodeAddresses?.underlay.map(addr => (\n \n ))}\n \n \n \n \n \n \n \n \n \n
    \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { Context as SettingsContext } from '../../providers/Settings'\n\nexport default function Settings(): ReactElement {\n const { apiUrl, apiDebugUrl, setApiUrl, setDebugApiUrl, lockedApiSettings } = useContext(SettingsContext)\n\n return (\n \n \n \n \n )\n}\n","import { Collapse, ListItem } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\nimport { ReactElement, ReactNode, useState } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children: ReactNode\n expandable: ReactNode\n defaultOpen?: boolean\n}\n\nexport default function ExpandableElement({ children, expandable, defaultOpen }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n return (\n
    \n \n {children}\n {open ? : }\n \n \n
    {expandable}
    \n
    \n
    \n )\n}\n","import type { ReactElement } from 'react'\nimport ExpandableElement from '../../components/ExpandableElement'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { PostageStamp } from './PostageStamp'\n\ninterface Props {\n postageStamps: EnrichedPostageBatch[] | null\n}\n\nfunction StampsTable({ postageStamps }: Props): ReactElement | null {\n if (postageStamps === null) return null\n\n return (\n \n {postageStamps.map(stamp => (\n \n \n \n \n \n \n }\n >\n \n \n ))}\n \n )\n}\n\nexport default StampsTable\n","import { CircularProgress, Container } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport { ReactElement, useContext, useEffect } from 'react'\nimport { PlusSquare } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport StampsTable from './StampsTable'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n root: {\n width: '100%',\n display: 'grid',\n },\n actions: {\n display: 'flex',\n width: '100%',\n flex: '0 1 auto',\n flexWrap: 'wrap',\n alignItems: 'center',\n },\n }),\n)\n\nexport default function Stamp(): ReactElement {\n const classes = useStyles()\n\n const navigate = useNavigate()\n\n const { stamps, isLoading, error, start, stop } = useContext(StampsContext)\n const { status } = useContext(BeeContext)\n\n useEffect(() => {\n if (!status.all) return\n start()\n\n return () => stop()\n }, [status]) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n function navigateToNewStamp() {\n navigate(ROUTES.STAMPS_NEW)\n }\n\n return (\n
    \n {error && (\n \n Error loading postage stamps details: {error.message}\n \n )}\n {!error && (\n <>\n
    \n \n Buy New Postage Stamp\n \n
    {isLoading && }
    \n
    \n \n \n )}\n
    \n )\n}\n","import { ReactElement } from 'react'\nimport { useNavigate } from 'react-router'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ROUTES } from '../../routes'\nimport { PostageStampCreation } from './PostageStampCreation'\n\nexport function CreatePostageStampPage(): ReactElement {\n const navigate = useNavigate()\n\n function onFinished() {\n navigate(ROUTES.STAMPS)\n }\n\n return (\n
    \n Buy new postage stamp\n \n
    \n )\n}\n","import React, { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Tab, Tabs } from '@material-ui/core'\n\ninterface TabPanelProps {\n children?: ReactNode\n index: number\n value: number\n}\n\nfunction TabPanel(props: TabPanelProps) {\n const { children, value, index, ...other } = props\n\n return (\n \n )\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n },\n content: {\n marginTop: theme.spacing(2),\n },\n }),\n)\n\ninterface TabsValues {\n component: ReactNode\n label: ReactNode\n}\n\ninterface Props {\n values: TabsValues[]\n index?: number\n indexChanged?: (index: number) => void\n}\n\nexport default function SimpleTabs({ values, index, indexChanged }: Props): ReactElement {\n const classes = useStyles()\n const [value, setValue] = React.useState(index || 0)\n\n const handleChange = (event: React.ChangeEvent>, newValue: number) => {\n if (indexChanged) indexChanged(newValue)\n else setValue(newValue)\n }\n\n const v = index !== undefined ? index : value\n\n return (\n
    \n \n {values.map(({ label }, idx) => (\n \n ))}\n \n
    \n {values.map(({ component }, idx) => (\n \n {component}\n \n ))}\n
    \n
    \n )\n}\n","import { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\n\n// These need to be numeric values as they are used as indexes in the TabsContainer\nexport enum Platforms {\n macOS = 0,\n Linux,\n Windows,\n iOS,\n Android,\n}\n\nexport enum SupportedPlatforms {\n macOS = Platforms.macOS,\n Linux = Platforms.Linux,\n}\n\ninterface ContextInterface {\n platform: SupportedPlatforms\n setPlatform: (platform: SupportedPlatforms) => void\n}\n\nconst initialValues: ContextInterface = {\n platform: SupportedPlatforms.macOS,\n setPlatform: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction isSupportedPlatform(platform: unknown): platform is SupportedPlatforms {\n return Object.keys(SupportedPlatforms).includes(platform as string)\n}\n\nfunction getOS(): Platforms | null {\n const userAgent = window.navigator.userAgent\n const platform = window.navigator.platform\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']\n const iosPlatforms = ['iPhone', 'iPad', 'iPod']\n\n if (macosPlatforms.includes(platform)) return Platforms.macOS\n\n if (iosPlatforms.includes(platform)) return Platforms.iOS\n\n if (windowsPlatforms.includes(platform)) return Platforms.Windows\n\n if (/Android/.test(userAgent)) return Platforms.Android\n\n if (/Linux/.test(platform)) return Platforms.Linux\n\n return null\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [platform, setPlatform] = useState(SupportedPlatforms.Linux)\n\n // This is in useEffect as it really just needs to run once and not on each re-render\n useEffect(() => {\n const os = getOS()\n\n setPlatform(isSupportedPlatform(os) ? os : SupportedPlatforms.Linux)\n }, [])\n\n return {children}\n}\n","import type { ReactElement } from 'react'\nimport SyntaxHighlighter from 'react-syntax-highlighter'\n\ninterface Props {\n code: string\n language: string\n showLineNumbers?: boolean\n}\n\nconst CodeBlock = (props: Props): ReactElement => {\n return (\n
    \n \n {props.code}\n \n
    \n )\n}\n\nexport default CodeBlock\n","import { ReactElement, useContext } from 'react'\nimport TabsContainer from './TabsContainer'\nimport CodeBlock from './CodeBlock'\nimport { Context } from '../providers/Platform'\n\ninterface Props {\n linux: string\n mac: string\n showLineNumbers?: boolean\n}\n\nexport default function CodeBlockTabs(props: Props): ReactElement {\n const { platform, setPlatform } = useContext(Context)\n\n return (\n ,\n },\n {\n label: 'macOS',\n component: ,\n },\n ]}\n />\n )\n}\n","import type { ReactElement } from 'react'\nimport { CircularProgress } from '@material-ui/core'\n\ninterface Props {\n isOk: boolean\n isLoading?: boolean\n size?: number | string\n className?: string\n}\n\nexport default function StatusIcon({ isOk, size, className, isLoading }: Props): ReactElement {\n const s = size || '1rem'\n\n if (isLoading) return \n\n return (\n \n )\n}\n","import MuiAlert from '@material-ui/lab/Alert'\nimport { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\nimport { Context as SettingsContext } from '../../../providers/Settings'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { status, isLoading } = useContext(Context)\n const { setDebugApiUrl, apiDebugUrl } = useContext(SettingsContext)\n const isOk = status.debugApiConnection\n\n return (\n \n Connection to Bee Debug API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes debug API has been successful'\n : 'We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue.'}\n \n \n\n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1635 (or your custom\n specified port) is bound to localhost. If your node is not running try executing the below command to\n start your bee node\n
  • \n \n Your debug node API should never be completely open to the internet. If you want to connect remotely,\n make sure your firewall settings are set to only allow specific trusted IP addresses and block all\n other ports. A simple google search for "what is my ip" will show you your computers public\n IP address to allow.\n \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n
  • \n Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross\n Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter{' '}\n debug-api-enable must be set to true and{' '}\n cors-allowed-origins must be set to your host domain or IP (you can also use the\n wildcard {\"cors-allowed-origins: ['*']\"}). If edits are made to the configuration run the\n restart command below for changes to take effect.\n
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport { Context as SettingsContext } from '../../../providers/Settings'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { setApiUrl, apiUrl } = useContext(SettingsContext)\n const { status, isLoading } = useContext(Context)\n const isOk = status.apiConnection\n\n return (\n \n Connection to Bee API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes API has been successful'\n : 'Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it.'}\n \n \n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1633 (or your custom\n specified port) is exposed to the internet. If your node is not running try executing the below\n command to start your bee node\n
  • \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function VersionCheck(): ReactElement | null {\n const { status, isLoading, latestUserVersion, latestPublishedVersion, latestBeeVersionUrl } = useContext(Context)\n const isOk = status.version\n\n return (\n \n Bee Version\n \n }\n >\n \n {isOk ? (\n 'You are running the latest version of Bee.'\n ) : (\n <>\n Your Bee version is out of date. Please update to the{' '}\n \n latest\n {' '}\n before continuing. Rerun the installation script below to upgrade. For more information please see the{' '}\n \n Docs\n \n .\n \n \n )}\n \n \n \n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function EthereumConnectionCheck(): ReactElement | null {\n const { status, isLoading, nodeAddresses } = useContext(Context)\n const isOk = status.blockchainConnection\n\n return (\n \n Connection to Blockchain\n \n }\n >\n \n {isOk ? (\n 'Your node is connected to the xDai blockchain'\n ) : (\n <>\n Your Bee node must have access to the xDai blockchain, so that it can interact and deploy your chequebook\n contract. You can run{' '}\n \n your own xDai node\n \n , or use a provider instead - we recommend{' '}\n \n Getblock\n \n . By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change\n the swap-endpoint in your configuration file.\n \n )}\n \n {nodeAddresses?.ethereum && }\n \n )\n}\n","import { useContext } from 'react'\nimport DepositModal from '../../../containers/DepositModal'\nimport type { ReactElement } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemActions from '../../../components/ExpandableListItemActions'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nconst ChequebookDeployFund = (): ReactElement | null => {\n const { status, isLoading, chequebookAddress } = useContext(Context)\n const isOk = status.chequebook\n\n return (\n \n Chequebook Deployment & Funding\n \n }\n >\n \n {isOk ? (\n 'Your chequebook is deployed and funded'\n ) : (\n <>\n Your chequebook is either not deployed or funded. To run the node you will need xDAI and xBZZ on the xDai\n network. You may need to aquire BZZ (e.g. bzz.exchange) and bridge it to\n the xDai network through the omni bridge. To pay the\n transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai\n network through the xDai Bridge. See the{' '}\n official xDai website for more information.\n \n )}\n \n {chequebookAddress && (\n <>\n \n \n \n \n \n )}\n \n )\n}\n\nexport default ChequebookDeployFund\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport TopologyStats from '../../../components/TopologyStats'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function PeerConnection(): ReactElement | null {\n const { status, isLoading, topology } = useContext(Context)\n const isOk = status.topology\n\n return (\n \n Connection to Peers\n \n }\n >\n \n {isOk\n ? 'You are connected to other Bee nodes'\n : 'Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file.'}\n \n\n \n \n )\n}\n","import type { ReactElement } from 'react'\n\nimport DebugConnectionCheck from './SetupSteps/DebugConnectionCheck'\nimport NodeConnectionCheck from './SetupSteps/NodeConnectionCheck'\nimport VersionCheck from './SetupSteps/VersionCheck'\nimport EthereumConnectionCheck from './SetupSteps/EthereumConnectionCheck'\nimport ChequebookDeployFund from './SetupSteps/ChequebookDeployFund'\nimport PeerConnection from './SetupSteps/PeerConnection'\n\nexport default function NodeSetupWorkflow(): ReactElement {\n return (\n
    \n \n \n \n \n \n \n
    \n )\n}\n","export async function requestBzz(address: string): Promise {\n await fetch(`https://xbzz-faucet.apyos.dev/xbzz/${address}`, {\n method: 'POST',\n })\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport function getJson(url: string): Promise> {\n return sendRequest(url, 'GET')\n}\n\nexport function postJson(url: string, data?: Record): Promise> {\n return sendRequest(url, 'POST', data)\n}\n\nasync function sendRequest(\n url: string,\n method: 'GET' | 'POST',\n body?: Record,\n): Promise> {\n const authorization = localStorage.getItem('apiKey')\n\n if (!authorization) {\n throw Error('API key not found in local storage')\n }\n const headers = {\n 'content-type': 'application/json',\n authorization,\n }\n const response = await fetch(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n })\n const json = await response.json()\n\n return json\n}\n","import { Contract, providers } from 'ethers'\n\nconst PROVIDER = 'https://rpc.gnosischain.com/'\n\nasync function eth_getBalance(address: string): Promise {\n const response = await fetch(PROVIDER, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n jsonrpc: '2.0',\n method: 'eth_getBalance',\n params: [address, 'latest'],\n id: 1,\n }),\n })\n const json = await response.json()\n\n return json.result\n}\n\nconst partialERC20tokenABI = [\n {\n constant: true,\n inputs: [\n {\n name: '_owner',\n type: 'address',\n },\n ],\n name: 'balanceOf',\n outputs: [\n {\n name: 'balance',\n type: 'uint256',\n },\n ],\n payable: false,\n type: 'function',\n },\n]\n\nconst provider = new providers.JsonRpcProvider(PROVIDER)\n\nasync function eth_getBalanceERC20(\n address: string,\n tokenAddress = '0xdbf3ea6f5bee45c02255b2c26a16f300502f68da',\n): Promise {\n const contract = new Contract(tokenAddress, partialERC20tokenABI, provider)\n const balance = await contract.balanceOf(address)\n\n return balance.toString()\n}\n\nexport const Rpc = {\n eth_getBalance,\n eth_getBalanceERC20,\n}\n","import type { ReactElement } from 'react'\nimport { Route, Routes } from 'react-router-dom'\nimport Accounting from './pages/accounting'\nimport Feeds from './pages/feeds'\nimport CreateNewFeed from './pages/feeds/CreateNewFeed'\nimport { FeedSubpage } from './pages/feeds/FeedSubpage'\nimport UpdateFeed from './pages/feeds/UpdateFeed'\nimport { Download } from './pages/files/Download'\nimport { Share } from './pages/files/Share'\nimport { Upload } from './pages/files/Upload'\nimport { UploadLander } from './pages/files/UploadLander'\nimport Info from './pages/info'\nimport Settings from './pages/settings'\nimport Stamps from './pages/stamps'\nimport { CreatePostageStampPage } from './pages/stamps/CreatePostageStampPage'\nimport Status from './pages/status'\nimport Upgrade from './pages/upgrade'\n\nexport enum ROUTES {\n INFO = '/',\n UPGRADE = '/upgrade',\n FILES = '/files',\n UPLOAD = '/files/upload',\n UPLOAD_IN_PROGRESS = '/files/upload/workflow',\n DOWNLOAD = '/files/download',\n HASH = '/files/hash/:hash',\n ACCOUNTING = '/accounting',\n SETTINGS = '/settings',\n STAMPS = '/stamps',\n STAMPS_NEW = '/stamps/new',\n STATUS = '/status',\n FEEDS = '/feeds',\n FEEDS_NEW = '/feeds/new',\n FEEDS_UPDATE = '/feeds/update/:hash',\n FEEDS_PAGE = '/feeds/:uuid',\n}\n\nconst BaseRouter = (): ReactElement => (\n \n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n \n)\n\nexport default BaseRouter\n","import { Box, Card, Typography } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { ArrowUp, Send } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { Loading } from '../../components/Loading'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Token } from '../../models/Token'\nimport { Context } from '../../providers/Bee'\nimport { requestBzz } from '../../utils/bzz-faucet'\nimport { getJson, postJson } from '../../utils/net'\nimport { Rpc } from '../../utils/rpc'\n\nexport default function UpgradePage(): ReactElement {\n const { nodeInfo, chequebookAddress, nodeAddresses } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n\n const [balance, setBalance] = useState(null)\n const [balanceBzz, setBalanceBzz] = useState(null)\n const [loading, setLoading] = useState(false)\n const [rpcProvider, setRpcProvider] = useState('https://rpc.gnosischain.com/')\n\n const port = parseInt(window.location.host.split(':')[1], 10)\n\n useEffect(() => {\n getJson(`http://localhost:${port}/status`)\n .then(status => Rpc.eth_getBalance(status.address))\n .then(balance => setBalance(balance))\n\n getJson(`http://localhost:${port}/status`)\n .then(status => Rpc.eth_getBalanceERC20(status.address))\n .then(balanceBzz => setBalanceBzz(balanceBzz))\n }, [port])\n\n async function onFund() {\n setLoading(true)\n try {\n const { address } = await getJson(`http://localhost:${port}/status`)\n await fetch(`http://getxdai.co/${address}/0.1`, {\n method: 'POST',\n })\n const balance = await Rpc.eth_getBalance(address)\n setBalance(balance)\n const balanceBzz = await Rpc.eth_getBalance(address)\n setBalanceBzz(balanceBzz)\n enqueueSnackbar('Wallet funded successfully', { variant: 'success' })\n } finally {\n setLoading(false)\n }\n }\n\n async function onChequebookBzzFund() {\n if (chequebookAddress?.chequebookAddress) {\n setLoading(true)\n await requestBzz(chequebookAddress?.chequebookAddress).finally(() => setLoading(false))\n enqueueSnackbar('Successfully funded chequebook address', { variant: 'success' })\n }\n }\n\n async function onOverlayBzzFund() {\n if (nodeAddresses?.ethereum) {\n setLoading(true)\n await requestBzz(nodeAddresses?.ethereum).finally(() => setLoading(false))\n enqueueSnackbar('Successfully funded overlay address', { variant: 'success' })\n }\n }\n\n async function onUpgrade() {\n setLoading(true)\n try {\n await postJson(`http://localhost:${port}/config`, {\n 'chain-enable': true,\n 'swap-enable': true,\n 'swap-endpoint': rpcProvider,\n })\n await postJson(`http://localhost:${port}/restart`)\n enqueueSnackbar('Restarting Bee in Light Mode...', { variant: 'success' })\n } finally {\n setLoading(false)\n }\n }\n\n if (!nodeInfo) {\n return \n }\n\n return (\n
    \n Upgrade\n \n \n \n \n Wallet\n \n \n \n Your current balance is {new Token(balance || '0', 18).toSignificantDigits(4)} xDAI and{' '}\n {new Token(balanceBzz || '0', 16).toSignificantDigits(4)} xBZZ. Fund your node with xDAI so chequebook\n can be deployed.\n \n \n \n \n Fund xDAI\n \n {chequebookAddress?.chequebookAddress &&\n chequebookAddress?.chequebookAddress !== '0x0000000000000000000000000000000000000000' && (\n \n Fund xBZZ (Chequebook)\n \n )}\n \n Fund xBZZ (Overlay)\n \n \n \n \n \n \n \n \n \n RPC Provider\n \n \n {\n setRpcProvider(event.target.value)\n }}\n />\n \n \n \n \n \n \n Upgrade Node\n {!balance && (\n \n Fund your node to unlock upgrading.\n \n )}\n \n \n Switch to Light Mode\n \n \n \n \n
    \n )\n}\n","import type { ReactElement, ReactNode } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\n\nimport { createStyles, Theme, makeStyles, withStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem } from '@material-ui/core'\n\nconst StyledListItem = withStyles((theme: Theme) => ({\n root: {\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n borderLeft: '4px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `4px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n },\n}))(ListItem)\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n activeIcon: {\n color: theme.palette.primary.main,\n },\n }),\n)\n\ninterface Props {\n iconStart?: ReactNode\n iconEnd?: ReactNode\n path?: string\n label: ReactNode\n}\n\nexport default function SideBarItem({ iconStart, iconEnd, path, label }: Props): ReactElement {\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n {iconStart}\n \n {iconEnd}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\nimport { ArrowRight } from 'react-feather'\n\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem, Typography } from '@material-ui/core'\nimport { Context } from '../providers/Bee'\nimport StatusIcon from './StatusIcon'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n\n root: {\n height: theme.spacing(4),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(4),\n color: '#f9f9f9',\n borderLeft: '0px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `0px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n },\n },\n rootError: {\n backgroundColor: 'rgba(255, 58, 82, 0.25)',\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n },\n },\n },\n smallerText: {\n fontSize: '0.9rem',\n },\n }),\n)\n\ninterface Props {\n path?: string\n}\n\nexport default function SideBarItem({ path }: Props): ReactElement {\n const { status, isLoading } = useContext(Context)\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n \n \n \n {`Node ${status.all ? 'OK' : 'Error'}`}}\n />\n \n {status.all ? null : }\n \n \n )\n}\n","import { Divider, Drawer, Grid, Link as MUILink, List } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { OpenInNewSharp } from '@material-ui/icons'\nimport type { ReactElement } from 'react'\nimport { ArrowUp, Bookmark, BookOpen, DollarSign, FileText, Home, Layers, Settings } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport Logo from '../assets/logo.svg'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\nimport SideBarItem from './SideBarItem'\nimport SideBarStatus from './SideBarStatus'\n\nconst navBarItems = [\n {\n label: 'Info',\n path: ROUTES.INFO,\n icon: Home,\n },\n {\n label: 'Upgrade',\n path: ROUTES.UPGRADE,\n icon: ArrowUp,\n },\n {\n label: 'Files',\n path: ROUTES.UPLOAD,\n icon: FileText,\n },\n {\n label: 'Feeds',\n path: ROUTES.FEEDS,\n icon: Bookmark,\n },\n {\n label: 'Stamps',\n path: ROUTES.STAMPS,\n icon: Layers,\n },\n {\n label: 'Accounting',\n path: ROUTES.ACCOUNTING,\n icon: DollarSign,\n },\n {\n label: 'Settings',\n path: ROUTES.SETTINGS,\n icon: Settings,\n },\n]\n\nconst drawerWidth = 300\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexWrap: 'nowrap',\n minHeight: '100vh',\n paddingTop: theme.spacing(8),\n paddingBottom: theme.spacing(8),\n },\n drawer: {\n width: drawerWidth,\n flexShrink: 0,\n },\n drawerPaper: {\n width: drawerWidth,\n backgroundColor: '#212121',\n },\n logo: {\n marginLeft: theme.spacing(8),\n marginRight: theme.spacing(8),\n },\n icon: {\n height: theme.spacing(4),\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n divider: {\n backgroundColor: '#2c2c2c',\n marginLeft: theme.spacing(4),\n marginRight: theme.spacing(4),\n },\n link: {\n color: '#9f9f9f',\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'none',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n textDecoration: 'none',\n },\n },\n },\n }),\n)\n\nexport default function SideBar(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n \n \"swarm\"\n \n \n \n \n {navBarItems.map(p => (\n \n }\n path={p.path}\n label={p.label}\n />\n \n ))}\n \n \n \n \n }\n iconEnd={}\n label={Docs}\n />\n \n \n \n \n \n \n \n \n \n \n )\n}\n","import { CircularProgress, Container } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, useContext } from 'react'\nimport ErrorBoundary from '../components/ErrorBoundary'\nimport SideBar from '../components/SideBar'\nimport { Context } from '../providers/Bee'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n content: {\n backgroundColor: theme.palette.background.default,\n minHeight: '100vh',\n },\n }),\n)\n\ninterface Props {\n children?: ReactElement\n}\n\nconst Dashboard = (props: Props): ReactElement => {\n const classes = useStyles()\n\n const { isLoading } = useContext(Context)\n\n return (\n
    \n \n \n \n <>\n {isLoading ? (\n
    \n \n
    \n ) : (\n props.children\n )}\n \n
    \n
    \n
    \n )\n}\n\nexport default Dashboard\n","import { createTheme, Theme } from '@material-ui/core/styles'\nimport { orange } from '@material-ui/core/colors'\n\ndeclare module '@material-ui/core/styles/createPalette' {\n interface TypeBackground {\n appBar: string\n }\n}\n\n// Overwriting default components styles\nconst componentsOverrides = (theme: Theme) => ({\n MuiListItem: {\n button: {\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n },\n },\n MuiContainer: {\n root: { padding: theme.spacing(8) },\n maxWidthXs: { padding: theme.spacing(8) },\n maxWidthSm: { padding: theme.spacing(8) },\n maxWidthMd: { padding: theme.spacing(8) },\n maxWidthLg: { padding: theme.spacing(8) },\n maxWidthXl: { padding: theme.spacing(8) },\n },\n MuiButton: {\n startIcon: { marginLeft: theme.spacing(1) },\n endIcon: { marginRight: theme.spacing(1) },\n outlined: {\n border: 'none',\n borderRadius: theme.spacing(10),\n color: theme.palette.primary.main,\n backgroundColor: '#fcf2e8',\n },\n outlinedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n outlinedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n contained: {\n padding: theme.spacing(2),\n backgroundColor: 'white',\n boxShadow: 'none',\n borderRadius: 0,\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n '&:focus': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:active': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:disabled': {\n backgroundColor: 'white',\n },\n },\n },\n MuiTab: {\n root: {\n backgroundColor: theme.palette.background.paper,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n opacity: 1,\n },\n '&$selected': {\n fontWeight: theme.typography.fontWeightMedium,\n },\n },\n textColorInherit: {\n opacity: 0.5,\n },\n },\n MuiTabs: {\n root: {\n borderBottom: 'none',\n },\n indicator: {\n backgroundColor: 'transparent',\n },\n },\n})\n\nconst propsOverrides = {\n MuiTab: {\n disableRipple: true,\n },\n MuiButtonBase: {\n disableRipple: true,\n },\n}\n\nexport const theme = createTheme({\n palette: {\n type: 'light',\n background: {\n default: '#efefef',\n },\n primary: {\n light: '#fcf2e8',\n main: '#dd7700',\n dark: orange[800],\n },\n secondary: {\n main: '#333333',\n },\n },\n typography: {\n fontFamily: ['Work Sans', 'Montserrat', 'Nunito', 'Roboto', '\"Helvetica Neue\"', 'Arial', 'sans-serif'].join(','),\n h1: {\n fontSize: '1.3rem',\n fontWeight: 500,\n },\n h2: {\n fontSize: '1rem',\n fontWeight: 500,\n },\n h3: {\n fontSize: '0.8rem',\n fontWeight: 500,\n },\n body2: {\n fontFamily: '\"IBM Plex Mono\", monospace',\n fontWeight: 500,\n fontSize: '1rem',\n },\n },\n})\n\ntheme.overrides = componentsOverrides(theme)\ntheme.props = propsOverrides\n","import CssBaseline from '@material-ui/core/CssBaseline'\nimport { ThemeProvider } from '@material-ui/core/styles'\nimport { SnackbarProvider } from 'notistack'\nimport React, { ReactElement } from 'react'\nimport { HashRouter as Router } from 'react-router-dom'\nimport './App.css'\nimport Dashboard from './layout/Dashboard'\nimport { Provider as BeeProvider } from './providers/Bee'\nimport { Provider as FeedsProvider } from './providers/Feeds'\nimport { Provider as FileProvider } from './providers/File'\nimport { Provider as PlatformProvider } from './providers/Platform'\nimport { Provider as SettingsProvider } from './providers/Settings'\nimport { Provider as StampsProvider } from './providers/Stamps'\nimport BaseRouter from './routes'\nimport { theme } from './theme'\n\ninterface Props {\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nconst App = ({ beeApiUrl, beeDebugApiUrl, lockedApiSettings }: Props): ReactElement => (\n
    \n \n \n \n \n \n \n \n \n \n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n)\n\nexport default App\n","import { ReportHandler } from 'web-vitals'\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler): void => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry)\n getFID(onPerfEntry)\n getFCP(onPerfEntry)\n getLCP(onPerfEntry)\n getTTFB(onPerfEntry)\n })\n }\n}\n\nexport default reportWebVitals\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root'),\n)\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n"],"sourceRoot":""} \ No newline at end of file