diff --git a/noise-js/index.js b/noise-js/index.js
index 852dbf8..fb5e68a 100644
--- a/noise-js/index.js
+++ b/noise-js/index.js
@@ -16,7 +16,128 @@
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _waku_create__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @waku/create */ \"./node_modules/@waku/create/dist/index.js\");\n/* harmony import */ var _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @waku/utils/bytes */ \"./node_modules/@waku/utils/dist/bytes/index.js\");\n/* harmony import */ var _waku_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @waku/core */ \"./node_modules/@waku/core/dist/index.js\");\n/* harmony import */ var _waku_interfaces__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @waku/interfaces */ \"./node_modules/@waku/interfaces/dist/index.js\");\n/* harmony import */ var _waku_noise__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @waku/noise */ \"./node_modules/@waku/noise/dist/index.js\");\n/* harmony import */ var protobufjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! protobufjs */ \"./node_modules/protobufjs/index.js\");\n/* harmony import */ var protobufjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(protobufjs__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var qrcode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! qrcode */ \"./node_modules/qrcode/lib/browser.js\");\n\n\n\n\n\n\n\n\n// Protobuf\nconst ProtoChatMessage = new (protobufjs__WEBPACK_IMPORTED_MODULE_5___default().Type)(\"ChatMessage\")\n .add(new (protobufjs__WEBPACK_IMPORTED_MODULE_5___default().Field)(\"timestamp\", 1, \"uint64\"))\n .add(new (protobufjs__WEBPACK_IMPORTED_MODULE_5___default().Field)(\"nick\", 2, \"string\"))\n .add(new (protobufjs__WEBPACK_IMPORTED_MODULE_5___default().Field)(\"text\", 3, \"bytes\"));\n\nmain();\n\nasync function main() {\n const ui = initUI();\n ui.waku.connecting();\n\n // Starting the node\n const node = await (0,_waku_create__WEBPACK_IMPORTED_MODULE_0__.createLightNode)({\n defaultBootstrap: true,\n });\n\n try {\n await node.start();\n await (0,_waku_core__WEBPACK_IMPORTED_MODULE_2__.waitForRemotePeer)(node, [_waku_interfaces__WEBPACK_IMPORTED_MODULE_3__.Protocols.Filter, _waku_interfaces__WEBPACK_IMPORTED_MODULE_3__.Protocols.LightPush]);\n\n ui.waku.connected();\n\n const responder = getResponder(node);\n const myStaticKey = _waku_noise__WEBPACK_IMPORTED_MODULE_4__.generateX25519KeyPair();\n const urlPairingInfo = getPairingInfoFromURL();\n\n const pairingObj = new _waku_noise__WEBPACK_IMPORTED_MODULE_4__.WakuPairing(\n node.lightPush,\n responder,\n myStaticKey,\n urlPairingInfo || new _waku_noise__WEBPACK_IMPORTED_MODULE_4__.ResponderParameters()\n );\n const pExecute = pairingObj.execute(120000); // timeout after 2m\n\n scheduleHandshakeAuthConfirmation(pairingObj, ui);\n\n let encoder;\n let decoder;\n\n try {\n ui.handshake.waiting();\n\n if (!urlPairingInfo) {\n const pairingURL = buildPairingURLFromObj(pairingObj);\n ui.shareInfo.setURL(pairingURL);\n ui.shareInfo.renderQR(pairingURL);\n ui.shareInfo.show();\n }\n\n [encoder, decoder] = await pExecute;\n\n ui.handshake.connected();\n ui.shareInfo.hide();\n } catch (err) {\n ui.handshake.error(err.message);\n ui.hide();\n }\n\n ui.message.display();\n\n await node.filter.subscribe(\n [decoder],\n ui.message.onReceive.bind(ui.message)\n );\n\n ui.message.onSend(async (text, nick) => {\n const timestamp = Math.floor(Date.now() / 1000);\n const message = ProtoChatMessage.create({\n nick,\n timestamp,\n text: _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.utf8ToBytes(text),\n });\n const payload = ProtoChatMessage.encode(message).finish();\n\n await node.lightPush.send(encoder, { payload, timestamp });\n });\n } catch (err) {\n ui.waku.error(err.message);\n ui.hide();\n }\n}\n\nfunction buildPairingURLFromObj(pairingObj) {\n const pInfo = pairingObj.getPairingInfo();\n\n // Data to encode in the QR code. The qrMessageNametag too to the QR string (separated by )\n const messageNameTagParam = `messageNameTag=${_waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.bytesToHex(\n pInfo.qrMessageNameTag\n )}`;\n const qrCodeParam = `qrCode=${encodeURIComponent(pInfo.qrCode)}`;\n\n return `${window.location.href}?${messageNameTagParam}&${qrCodeParam}`;\n}\n\nfunction getPairingInfoFromURL() {\n const urlParams = new URLSearchParams(window.location.search);\n\n const messageNameTag = urlParams.get(\"messageNameTag\");\n const qrCodeString = urlParams.get(\"qrCode\");\n\n if (!(messageNameTag && qrCodeString)) {\n return undefined;\n }\n\n return new _waku_noise__WEBPACK_IMPORTED_MODULE_4__.InitiatorParameters(\n decodeURIComponent(qrCodeString),\n _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.hexToBytes(messageNameTag)\n );\n}\n\nfunction getResponder(node) {\n const msgQueue = new Array();\n const subscriptions = new Map();\n const intervals = new Map();\n\n const responder = {\n async subscribe(decoder) {\n const subscription = await node.filter.subscribe(\n [decoder],\n (wakuMessage) => {\n msgQueue.push(wakuMessage);\n }\n );\n subscriptions.set(decoder.contentTopic, subscription);\n },\n async nextMessage(contentTopic) {\n if (msgQueue.length != 0) {\n const oldestMsg = msgQueue.shift();\n if (oldestMsg.contentTopic === contentTopic) {\n return oldestMsg;\n }\n }\n\n return new Promise((resolve) => {\n const interval = setInterval(() => {\n if (msgQueue.length != 0) {\n clearInterval(interval);\n const oldestMsg = msgQueue.shift();\n if (oldestMsg.contentTopic === contentTopic) {\n resolve(oldestMsg);\n }\n }\n }, 100);\n intervals.set(contentTopic, interval);\n });\n },\n async stop(contentTopic) {\n if (intervals.has(contentTopic)) {\n clearInterval(intervals.get(contentTopic));\n intervals.delete(contentTopic);\n }\n if (subscriptions.has(contentTopic)) {\n await subscriptions.get(contentTopic)();\n subscriptions.delete(contentTopic);\n } else {\n console.log(\"Subscriptipon doesnt exist\");\n }\n },\n };\n\n return responder;\n}\n\nasync function scheduleHandshakeAuthConfirmation(pairingObj, ui) {\n const authCode = await pairingObj.getAuthCode();\n ui.handshake.connecting();\n pairingObj.validateAuthCode(confirm(\"Confirm that authcode is: \" + authCode));\n}\n\nfunction initUI() {\n const messagesList = document.getElementById(\"messages\");\n const nicknameInput = document.getElementById(\"nick-input\");\n const textInput = document.getElementById(\"text-input\");\n const sendButton = document.getElementById(\"send-btn\");\n const chatArea = document.getElementById(\"chat-area\");\n const wakuStatusSpan = document.getElementById(\"waku-status\");\n const handshakeStatusSpan = document.getElementById(\"handshake-status\");\n\n const qrCanvas = document.getElementById(\"qr-canvas\");\n const qrUrlContainer = document.getElementById(\"qr-url-container\");\n const qrUrl = document.getElementById(\"qr-url\");\n const copyURLButton = document.getElementById(\"copy-url\");\n const openTabButton = document.getElementById(\"open-tab\");\n\n copyURLButton.onclick = () => {\n const copyText = document.getElementById(\"qr-url\"); // need to get it each time otherwise copying does not work\n copyText.select();\n copyText.setSelectionRange(0, 99999);\n navigator.clipboard.writeText(copyText.value);\n };\n\n openTabButton.onclick = () => {\n window.open(qrUrl.value, \"_blank\");\n };\n\n const disableChatUIStateIfNeeded = () => {\n const readyToSend = nicknameInput.value !== \"\";\n textInput.disabled = !readyToSend;\n sendButton.disabled = !readyToSend;\n };\n nicknameInput.onchange = disableChatUIStateIfNeeded;\n nicknameInput.onblur = disableChatUIStateIfNeeded;\n\n return {\n shareInfo: {\n setURL(url) {\n qrUrl.value = url;\n },\n hide() {\n qrUrlContainer.style.display = \"none\";\n },\n show() {\n qrUrlContainer.style.display = \"flex\";\n },\n renderQR(url) {\n qrcode__WEBPACK_IMPORTED_MODULE_6__.toCanvas(qrCanvas, url, (err) => {\n if (err) {\n throw err;\n }\n });\n },\n },\n waku: {\n _val(msg) {\n wakuStatusSpan.innerText = msg;\n },\n _class(name) {\n wakuStatusSpan.className = name;\n },\n connecting() {\n this._val(\"connecting...\");\n this._class(\"progress\");\n },\n connected() {\n this._val(\"connected\");\n this._class(\"success\");\n },\n error(msg) {\n this._val(msg);\n this._class(\"error\");\n },\n },\n handshake: {\n _val(val) {\n handshakeStatusSpan.innerText = val;\n },\n _class(name) {\n handshakeStatusSpan.className = name;\n },\n error(msg) {\n this._val(msg);\n this._class(\"error\");\n },\n waiting() {\n this._val(\"waiting for handshake...\");\n this._class(\"progress\");\n },\n generating() {\n this._val(\"generating QR code...\");\n this._class(\"progress\");\n },\n connecting() {\n this._val(\"executing handshake...\");\n this._class(\"progress\");\n },\n connected() {\n this._val(\"handshake completed!\");\n this._class(\"success\");\n },\n },\n message: {\n _render({ time, text, nick }) {\n messagesList.innerHTML += `\n
\n (${nick})\n ${text}\n [${new Date(time).toISOString()}]\n \n `;\n },\n _status(text, className) {\n sendButton.className = className;\n },\n onReceive({ payload }) {\n const { timestamp, nick, text } = ProtoChatMessage.decode(payload);\n\n this._render({\n nick,\n time: timestamp * 1000,\n text: _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.bytesToUtf8(text),\n });\n },\n onSend(cb) {\n sendButton.addEventListener(\"click\", async () => {\n try {\n this._status(\"sending...\", \"progress\");\n await cb(textInput.value, nicknameInput.value);\n this._status(\"sent\", \"success\");\n\n this._render({\n time: Date.now(), // a bit different from what receiver will see but for the matter of example is good enough\n text: textInput.value,\n nick: nicknameInput.value,\n });\n textInput.value = \"\";\n } catch (e) {\n this._status(`error: ${e.message}`, \"error\");\n }\n });\n },\n display() {\n chatArea.style.display = \"block\";\n this._status(\"waiting for input\", \"progress\");\n },\n },\n hide() {\n this.shareInfo.hide();\n chatArea.style.display = \"none\";\n },\n };\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./index.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _waku_create__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @waku/create */ \"./node_modules/@waku/create/dist/index.js\");\n/* harmony import */ var _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @waku/utils/bytes */ \"./node_modules/@waku/utils/dist/bytes/index.js\");\n/* harmony import */ var _waku_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @waku/core */ \"./node_modules/@waku/core/dist/index.js\");\n/* harmony import */ var _waku_noise__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @waku/noise */ \"./node_modules/@waku/noise/dist/index.js\");\n/* harmony import */ var protobufjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! protobufjs */ \"./node_modules/protobufjs/index.js\");\n/* harmony import */ var protobufjs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(protobufjs__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var qrcode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! qrcode */ \"./node_modules/qrcode/lib/browser.js\");\n\n\n\n\n\n\n\n// Protobuf\nconst ProtoChatMessage = new (protobufjs__WEBPACK_IMPORTED_MODULE_4___default().Type)(\"ChatMessage\")\n .add(new (protobufjs__WEBPACK_IMPORTED_MODULE_4___default().Field)(\"timestamp\", 1, \"uint64\"))\n .add(new (protobufjs__WEBPACK_IMPORTED_MODULE_4___default().Field)(\"nick\", 2, \"string\"))\n .add(new (protobufjs__WEBPACK_IMPORTED_MODULE_4___default().Field)(\"text\", 3, \"bytes\"));\n\nmain();\n\nasync function main() {\n const ui = initUI();\n ui.waku.connecting();\n\n // Starting the node\n const node = await (0,_waku_create__WEBPACK_IMPORTED_MODULE_0__.createLightNode)({\n defaultBootstrap: true,\n });\n\n try {\n await node.start();\n await (0,_waku_core__WEBPACK_IMPORTED_MODULE_2__.waitForRemotePeer)(node, [\"filter\", \"lightpush\"]);\n\n ui.waku.connected();\n\n const myStaticKey = _waku_noise__WEBPACK_IMPORTED_MODULE_3__.generateX25519KeyPair();\n const urlPairingInfo = getPairingInfoFromURL();\n\n const pairingObj = new _waku_noise__WEBPACK_IMPORTED_MODULE_3__.WakuPairing(\n node.lightPush,\n node.filter,\n myStaticKey,\n urlPairingInfo || new _waku_noise__WEBPACK_IMPORTED_MODULE_3__.ResponderParameters()\n );\n const pExecute = pairingObj.execute(120000); // timeout after 2m\n\n scheduleHandshakeAuthConfirmation(pairingObj, ui);\n\n let encoder;\n let decoder;\n\n try {\n ui.handshake.waiting();\n\n if (!urlPairingInfo) {\n const pairingURL = buildPairingURLFromObj(pairingObj);\n ui.shareInfo.setURL(pairingURL);\n ui.shareInfo.renderQR(pairingURL);\n ui.shareInfo.show();\n }\n\n [encoder, decoder] = await pExecute;\n\n ui.handshake.connected();\n ui.shareInfo.hide();\n } catch (err) {\n ui.handshake.error(err.message);\n ui.hide();\n }\n\n ui.message.display();\n\n await node.filter.subscribe(\n [decoder],\n ui.message.onReceive.bind(ui.message)\n );\n\n ui.message.onSend(async (text, nick) => {\n const timestamp = Math.floor(Date.now() / 1000);\n const message = ProtoChatMessage.create({\n nick,\n timestamp,\n text: _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.utf8ToBytes(text),\n });\n const payload = ProtoChatMessage.encode(message).finish();\n\n await node.lightPush.send(encoder, { payload, timestamp });\n });\n } catch (err) {\n ui.waku.error(err.message);\n ui.hide();\n }\n}\n\nfunction buildPairingURLFromObj(pairingObj) {\n const pInfo = pairingObj.getPairingInfo();\n\n // Data to encode in the QR code. The qrMessageNametag too to the QR string (separated by )\n const messageNameTagParam = `messageNameTag=${_waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.bytesToHex(\n pInfo.qrMessageNameTag\n )}`;\n const qrCodeParam = `qrCode=${encodeURIComponent(pInfo.qrCode)}`;\n\n return `${window.location.href}?${messageNameTagParam}&${qrCodeParam}`;\n}\n\nfunction getPairingInfoFromURL() {\n const urlParams = new URLSearchParams(window.location.search);\n\n const messageNameTag = urlParams.get(\"messageNameTag\");\n const qrCodeString = urlParams.get(\"qrCode\");\n\n if (!(messageNameTag && qrCodeString)) {\n return undefined;\n }\n\n return new _waku_noise__WEBPACK_IMPORTED_MODULE_3__.InitiatorParameters(\n decodeURIComponent(qrCodeString),\n _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.hexToBytes(messageNameTag)\n );\n}\n\nasync function scheduleHandshakeAuthConfirmation(pairingObj, ui) {\n const authCode = await pairingObj.getAuthCode();\n ui.handshake.connecting();\n pairingObj.validateAuthCode(confirm(\"Confirm that authcode is: \" + authCode));\n}\n\nfunction initUI() {\n const messagesList = document.getElementById(\"messages\");\n const nicknameInput = document.getElementById(\"nick-input\");\n const textInput = document.getElementById(\"text-input\");\n const sendButton = document.getElementById(\"send-btn\");\n const chatArea = document.getElementById(\"chat-area\");\n const wakuStatusSpan = document.getElementById(\"waku-status\");\n const handshakeStatusSpan = document.getElementById(\"handshake-status\");\n\n const qrCanvas = document.getElementById(\"qr-canvas\");\n const qrUrlContainer = document.getElementById(\"qr-url-container\");\n const qrUrl = document.getElementById(\"qr-url\");\n const copyURLButton = document.getElementById(\"copy-url\");\n const openTabButton = document.getElementById(\"open-tab\");\n\n copyURLButton.onclick = () => {\n const copyText = document.getElementById(\"qr-url\"); // need to get it each time otherwise copying does not work\n copyText.select();\n copyText.setSelectionRange(0, 99999);\n navigator.clipboard.writeText(copyText.value);\n };\n\n openTabButton.onclick = () => {\n window.open(qrUrl.value, \"_blank\");\n };\n\n const disableChatUIStateIfNeeded = () => {\n const readyToSend = nicknameInput.value !== \"\";\n textInput.disabled = !readyToSend;\n sendButton.disabled = !readyToSend;\n };\n nicknameInput.onchange = disableChatUIStateIfNeeded;\n nicknameInput.onblur = disableChatUIStateIfNeeded;\n\n return {\n shareInfo: {\n setURL(url) {\n qrUrl.value = url;\n },\n hide() {\n qrUrlContainer.style.display = \"none\";\n },\n show() {\n qrUrlContainer.style.display = \"flex\";\n },\n renderQR(url) {\n qrcode__WEBPACK_IMPORTED_MODULE_5__.toCanvas(qrCanvas, url, (err) => {\n if (err) {\n throw err;\n }\n });\n },\n },\n waku: {\n _val(msg) {\n wakuStatusSpan.innerText = msg;\n },\n _class(name) {\n wakuStatusSpan.className = name;\n },\n connecting() {\n this._val(\"connecting...\");\n this._class(\"progress\");\n },\n connected() {\n this._val(\"connected\");\n this._class(\"success\");\n },\n error(msg) {\n this._val(msg);\n this._class(\"error\");\n },\n },\n handshake: {\n _val(val) {\n handshakeStatusSpan.innerText = val;\n },\n _class(name) {\n handshakeStatusSpan.className = name;\n },\n error(msg) {\n this._val(msg);\n this._class(\"error\");\n },\n waiting() {\n this._val(\"waiting for handshake...\");\n this._class(\"progress\");\n },\n generating() {\n this._val(\"generating QR code...\");\n this._class(\"progress\");\n },\n connecting() {\n this._val(\"executing handshake...\");\n this._class(\"progress\");\n },\n connected() {\n this._val(\"handshake completed!\");\n this._class(\"success\");\n },\n },\n message: {\n _render({ time, text, nick }) {\n messagesList.innerHTML += `\n \n (${nick})\n ${text}\n [${new Date(time).toISOString()}]\n \n `;\n },\n _status(text, className) {\n sendButton.className = className;\n },\n onReceive({ payload }) {\n const { timestamp, nick, text } = ProtoChatMessage.decode(payload);\n\n this._render({\n nick,\n time: timestamp * 1000,\n text: _waku_utils_bytes__WEBPACK_IMPORTED_MODULE_1__.bytesToUtf8(text),\n });\n },\n onSend(cb) {\n sendButton.addEventListener(\"click\", async () => {\n try {\n this._status(\"sending...\", \"progress\");\n await cb(textInput.value, nicknameInput.value);\n this._status(\"sent\", \"success\");\n\n this._render({\n time: Date.now(), // a bit different from what receiver will see but for the matter of example is good enough\n text: textInput.value,\n nick: nicknameInput.value,\n });\n textInput.value = \"\";\n } catch (e) {\n this._status(`error: ${e.message}`, \"error\");\n }\n });\n },\n display() {\n chatArea.style.display = \"block\";\n this._status(\"waiting for input\", \"progress\");\n },\n },\n hide() {\n this.shareInfo.hide();\n chatArea.style.display = \"none\";\n },\n };\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/minimal.js":
+/*!*************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/minimal.js ***!
+ \*************************************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+eval("// minimal library entry point.\n\n\nmodule.exports = __webpack_require__(/*! ./src/index-minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/index-minimal.js\");\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/minimal.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/index-minimal.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/index-minimal.js ***!
+ \***********************************************************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+"use strict";
+eval("\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = __webpack_require__(/*! ./writer */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer.js\");\nprotobuf.BufferWriter = __webpack_require__(/*! ./writer_buffer */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer_buffer.js\");\nprotobuf.Reader = __webpack_require__(/*! ./reader */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader.js\");\nprotobuf.BufferReader = __webpack_require__(/*! ./reader_buffer */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader_buffer.js\");\n\n// Utility\nprotobuf.util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js\");\nprotobuf.rpc = __webpack_require__(/*! ./rpc */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc.js\");\nprotobuf.roots = __webpack_require__(/*! ./roots */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/roots.js\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/index-minimal.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader.js":
+/*!****************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader.js ***!
+ \****************************************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+eval("\nmodule.exports = Reader;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader_buffer.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader_buffer.js ***!
+ \***********************************************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+eval("\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = __webpack_require__(/*! ./reader */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader.js\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/reader_buffer.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/roots.js":
+/*!***************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/roots.js ***!
+ \***************************************************************************************/
+/***/ ((module) => {
+
+"use strict";
+eval("\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/roots.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc.js":
+/*!*************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc.js ***!
+ \*************************************************************************************/
+/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
+
+"use strict";
+eval("\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = __webpack_require__(/*! ./rpc/service */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc/service.js\");\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc/service.js":
+/*!*********************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc/service.js ***!
+ \*********************************************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+eval("\nmodule.exports = Service;\n\nvar util = __webpack_require__(/*! ../util/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/rpc/service.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/longbits.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/longbits.js ***!
+ \***********************************************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+eval("\nmodule.exports = LongBits;\n\nvar util = __webpack_require__(/*! ../util/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/longbits.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js":
+/*!**********************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js ***!
+ \**********************************************************************************************/
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+
+"use strict";
+eval("\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = __webpack_require__(/*! @protobufjs/aspromise */ \"./node_modules/@protobufjs/aspromise/index.js\");\n\n// converts to / from base64 encoded strings\nutil.base64 = __webpack_require__(/*! @protobufjs/base64 */ \"./node_modules/@protobufjs/base64/index.js\");\n\n// base class of rpc.Service\nutil.EventEmitter = __webpack_require__(/*! @protobufjs/eventemitter */ \"./node_modules/@protobufjs/eventemitter/index.js\");\n\n// float handling accross browsers\nutil.float = __webpack_require__(/*! @protobufjs/float */ \"./node_modules/@protobufjs/float/index.js\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = __webpack_require__(/*! @protobufjs/inquire */ \"./node_modules/@protobufjs/inquire/index.js\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = __webpack_require__(/*! @protobufjs/utf8 */ \"./node_modules/@protobufjs/utf8/index.js\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = __webpack_require__(/*! @protobufjs/pool */ \"./node_modules/@protobufjs/pool/index.js\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = __webpack_require__(/*! ./longbits */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/longbits.js\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof __webpack_require__.g !== \"undefined\"\n && __webpack_require__.g\n && __webpack_require__.g.process\n && __webpack_require__.g.process.versions\n && __webpack_require__.g.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && __webpack_require__.g\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer.js":
+/*!****************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer.js ***!
+ \****************************************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+eval("\nmodule.exports = Writer;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer_buffer.js":
+/*!***********************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer_buffer.js ***!
+ \***********************************************************************************************/
+/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
+
+"use strict";
+eval("\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = __webpack_require__(/*! ./writer */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer.js\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/src/writer_buffer.js?");
/***/ }),
@@ -383,269 +504,6 @@ eval("\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file
/***/ }),
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/minimal.js":
-/*!********************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/minimal.js ***!
- \********************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("// minimal library entry point.\n\n\nmodule.exports = __webpack_require__(/*! ./src/index-minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/index-minimal.js\");\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/minimal.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/index-minimal.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/index-minimal.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-eval("\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = __webpack_require__(/*! ./writer */ \"./node_modules/@waku/core/node_modules/protobufjs/src/writer.js\");\nprotobuf.BufferWriter = __webpack_require__(/*! ./writer_buffer */ \"./node_modules/@waku/core/node_modules/protobufjs/src/writer_buffer.js\");\nprotobuf.Reader = __webpack_require__(/*! ./reader */ \"./node_modules/@waku/core/node_modules/protobufjs/src/reader.js\");\nprotobuf.BufferReader = __webpack_require__(/*! ./reader_buffer */ \"./node_modules/@waku/core/node_modules/protobufjs/src/reader_buffer.js\");\n\n// Utility\nprotobuf.util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js\");\nprotobuf.rpc = __webpack_require__(/*! ./rpc */ \"./node_modules/@waku/core/node_modules/protobufjs/src/rpc.js\");\nprotobuf.roots = __webpack_require__(/*! ./roots */ \"./node_modules/@waku/core/node_modules/protobufjs/src/roots.js\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/index-minimal.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/reader.js":
-/*!***********************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/reader.js ***!
- \***********************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = Reader;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/reader.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/reader_buffer.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/reader_buffer.js ***!
- \******************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = __webpack_require__(/*! ./reader */ \"./node_modules/@waku/core/node_modules/protobufjs/src/reader.js\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/reader_buffer.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/roots.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/roots.js ***!
- \**********************************************************************/
-/***/ ((module) => {
-
-"use strict";
-eval("\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/roots.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/rpc.js":
-/*!********************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/rpc.js ***!
- \********************************************************************/
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-eval("\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = __webpack_require__(/*! ./rpc/service */ \"./node_modules/@waku/core/node_modules/protobufjs/src/rpc/service.js\");\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/rpc.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/rpc/service.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/rpc/service.js ***!
- \****************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = Service;\n\nvar util = __webpack_require__(/*! ../util/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/rpc/service.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/util/longbits.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/util/longbits.js ***!
- \******************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = LongBits;\n\nvar util = __webpack_require__(/*! ../util/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/util/longbits.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js ***!
- \*****************************************************************************/
-/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-
-"use strict";
-eval("\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = __webpack_require__(/*! @protobufjs/aspromise */ \"./node_modules/@protobufjs/aspromise/index.js\");\n\n// converts to / from base64 encoded strings\nutil.base64 = __webpack_require__(/*! @protobufjs/base64 */ \"./node_modules/@protobufjs/base64/index.js\");\n\n// base class of rpc.Service\nutil.EventEmitter = __webpack_require__(/*! @protobufjs/eventemitter */ \"./node_modules/@protobufjs/eventemitter/index.js\");\n\n// float handling accross browsers\nutil.float = __webpack_require__(/*! @protobufjs/float */ \"./node_modules/@protobufjs/float/index.js\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = __webpack_require__(/*! @protobufjs/inquire */ \"./node_modules/@protobufjs/inquire/index.js\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = __webpack_require__(/*! @protobufjs/utf8 */ \"./node_modules/@protobufjs/utf8/index.js\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = __webpack_require__(/*! @protobufjs/pool */ \"./node_modules/@protobufjs/pool/index.js\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = __webpack_require__(/*! ./longbits */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/longbits.js\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof __webpack_require__.g !== \"undefined\"\n && __webpack_require__.g\n && __webpack_require__.g.process\n && __webpack_require__.g.process.versions\n && __webpack_require__.g.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && __webpack_require__.g\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/writer.js":
-/*!***********************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/writer.js ***!
- \***********************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = Writer;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/writer.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protobufjs/src/writer_buffer.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protobufjs/src/writer_buffer.js ***!
- \******************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = __webpack_require__(/*! ./writer */ \"./node_modules/@waku/core/node_modules/protobufjs/src/writer.js\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protobufjs/src/writer_buffer.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/reader.js":
-/*!****************************************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/reader.js ***!
- \****************************************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = Reader;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/reader.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/reader_buffer.js":
-/*!***********************************************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/reader_buffer.js ***!
- \***********************************************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = __webpack_require__(/*! ./reader */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/reader.js\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/reader_buffer.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/longbits.js":
-/*!***********************************************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/longbits.js ***!
- \***********************************************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = LongBits;\n\nvar util = __webpack_require__(/*! ../util/minimal */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/longbits.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js":
-/*!**********************************************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js ***!
- \**********************************************************************************************************/
-/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-
-"use strict";
-eval("\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = __webpack_require__(/*! @protobufjs/aspromise */ \"./node_modules/@protobufjs/aspromise/index.js\");\n\n// converts to / from base64 encoded strings\nutil.base64 = __webpack_require__(/*! @protobufjs/base64 */ \"./node_modules/@protobufjs/base64/index.js\");\n\n// base class of rpc.Service\nutil.EventEmitter = __webpack_require__(/*! @protobufjs/eventemitter */ \"./node_modules/@protobufjs/eventemitter/index.js\");\n\n// float handling accross browsers\nutil.float = __webpack_require__(/*! @protobufjs/float */ \"./node_modules/@protobufjs/float/index.js\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = __webpack_require__(/*! @protobufjs/inquire */ \"./node_modules/@protobufjs/inquire/index.js\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = __webpack_require__(/*! @protobufjs/utf8 */ \"./node_modules/@protobufjs/utf8/index.js\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = __webpack_require__(/*! @protobufjs/pool */ \"./node_modules/@protobufjs/pool/index.js\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = __webpack_require__(/*! ./longbits */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/longbits.js\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof __webpack_require__.g !== \"undefined\"\n && __webpack_require__.g\n && __webpack_require__.g.process\n && __webpack_require__.g.process.versions\n && __webpack_require__.g.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && __webpack_require__.g\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get: function get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value: function value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/writer.js":
-/*!****************************************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/writer.js ***!
- \****************************************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = Writer;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/writer.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/writer_buffer.js":
-/*!***********************************************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/writer_buffer.js ***!
- \***********************************************************************************************************/
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-eval("\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = __webpack_require__(/*! ./writer */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/writer.js\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = __webpack_require__(/*! ./util/minimal */ \"./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/util/minimal.js\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/protons-runtime/node_modules/protobufjs/src/writer_buffer.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/native.js":
-/*!******************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/native.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nconst randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n randomUUID\n});\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/native.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/regex.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/regex.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/regex.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/rng.js":
-/*!***************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/rng.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ rng)\n/* harmony export */ });\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nfunction rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/rng.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/stringify.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/stringify.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"unsafeStringify\": () => (/* binding */ unsafeStringify)\n/* harmony export */ });\n/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ \"./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/validate.js\");\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nfunction unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/stringify.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/v4.js":
-/*!**************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/v4.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _native_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./native.js */ \"./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/native.js\");\n/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rng.js */ \"./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/rng.js\");\n/* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stringify.js */ \"./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/stringify.js\");\n\n\n\n\nfunction v4(options, buf, offset) {\n if (_native_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].randomUUID && !buf && !options) {\n return _native_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_2__.unsafeStringify)(rnds);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v4);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/v4.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/validate.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/validate.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regex.js */ \"./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/regex.js\");\n\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].test(uuid);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validate);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/uuid/dist/esm-browser/validate.js?");
-
-/***/ }),
-
-/***/ "./node_modules/any-signal/index.js":
-/*!******************************************!*\
- !*** ./node_modules/any-signal/index.js ***!
- \******************************************/
-/***/ ((module) => {
-
-eval("/**\n * Takes an array of AbortSignals and returns a single signal.\n * If any signals are aborted, the returned signal will be aborted.\n * @param {Array} signals\n * @returns {AbortSignal}\n */\nfunction anySignal (signals) {\n const controller = new globalThis.AbortController()\n\n function onAbort () {\n controller.abort()\n\n for (const signal of signals) {\n if (!signal || !signal.removeEventListener) continue\n signal.removeEventListener('abort', onAbort)\n }\n }\n\n for (const signal of signals) {\n if (!signal || !signal.addEventListener) continue\n if (signal.aborted) {\n onAbort()\n break\n }\n signal.addEventListener('abort', onAbort)\n }\n\n return controller.signal\n}\n\nmodule.exports = anySignal\nmodule.exports.anySignal = anySignal\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/any-signal/index.js?");
-
-/***/ }),
-
/***/ "./node_modules/bn.js/lib/bn.js":
/*!**************************************!*\
!*** ./node_modules/bn.js/lib/bn.js ***!
@@ -780,7 +638,7 @@ eval("module.exports = class FixedFIFO {\n constructor (hwm) {\n if (!(hwm >
\*****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-eval("const FixedFIFO = __webpack_require__(/*! ./fixed-size */ \"./node_modules/fast-fifo/fixed-size.js\")\n\nmodule.exports = class FastFIFO {\n constructor (hwm) {\n this.hwm = hwm || 16\n this.head = new FixedFIFO(this.hwm)\n this.tail = this.head\n }\n\n push (val) {\n if (!this.head.push(val)) {\n const prev = this.head\n this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length)\n this.head.push(val)\n }\n }\n\n shift () {\n const val = this.tail.shift()\n if (val === undefined && this.tail.next) {\n const next = this.tail.next\n this.tail.next = null\n this.tail = next\n return this.tail.shift()\n }\n return val\n }\n\n peek () {\n return this.tail.peek()\n }\n\n isEmpty () {\n return this.head.isEmpty()\n }\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/fast-fifo/index.js?");
+eval("const FixedFIFO = __webpack_require__(/*! ./fixed-size */ \"./node_modules/fast-fifo/fixed-size.js\")\n\nmodule.exports = class FastFIFO {\n constructor (hwm) {\n this.hwm = hwm || 16\n this.head = new FixedFIFO(this.hwm)\n this.tail = this.head\n this.length = 0\n }\n\n push (val) {\n this.length++\n if (!this.head.push(val)) {\n const prev = this.head\n this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length)\n this.head.push(val)\n }\n }\n\n shift () {\n if (this.length !== 0) this.length--\n const val = this.tail.shift()\n if (val === undefined && this.tail.next) {\n const next = this.tail.next\n this.tail.next = null\n this.tail = next\n return this.tail.shift()\n }\n\n return val\n }\n\n peek () {\n return this.tail.peek()\n }\n\n isEmpty () {\n return this.head.isEmpty()\n }\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/fast-fifo/index.js?");
/***/ }),
@@ -868,6 +726,16 @@ eval("var __WEBPACK_AMD_DEFINE_RESULT__;/**\n * [js-sha3]{@link https://github.c
/***/ }),
+/***/ "./node_modules/libp2p/node_modules/any-signal/index.js":
+/*!**************************************************************!*\
+ !*** ./node_modules/libp2p/node_modules/any-signal/index.js ***!
+ \**************************************************************/
+/***/ ((module) => {
+
+eval("/**\n * Takes an array of AbortSignals and returns a single signal.\n * If any signals are aborted, the returned signal will be aborted.\n * @param {Array} signals\n * @returns {AbortSignal}\n */\nfunction anySignal (signals) {\n const controller = new globalThis.AbortController()\n\n function onAbort () {\n controller.abort()\n\n for (const signal of signals) {\n if (!signal || !signal.removeEventListener) continue\n signal.removeEventListener('abort', onAbort)\n }\n }\n\n for (const signal of signals) {\n if (!signal || !signal.addEventListener) continue\n if (signal.aborted) {\n onAbort()\n break\n }\n signal.addEventListener('abort', onAbort)\n }\n\n return controller.signal\n}\n\nmodule.exports = anySignal\nmodule.exports.anySignal = anySignal\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/libp2p/node_modules/any-signal/index.js?");
+
+/***/ }),
+
/***/ "./node_modules/merge-options/index.js":
/*!*********************************************!*\
!*** ./node_modules/merge-options/index.js ***!
@@ -1424,7 +1292,7 @@ eval("\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionOb
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
-eval("\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize = __webpack_require__(/*! ./tokenize */ \"./node_modules/protobufjs/src/tokenize.js\"),\n Root = __webpack_require__(/*! ./root */ \"./node_modules/protobufjs/src/root.js\"),\n Type = __webpack_require__(/*! ./type */ \"./node_modules/protobufjs/src/type.js\"),\n Field = __webpack_require__(/*! ./field */ \"./node_modules/protobufjs/src/field.js\"),\n MapField = __webpack_require__(/*! ./mapfield */ \"./node_modules/protobufjs/src/mapfield.js\"),\n OneOf = __webpack_require__(/*! ./oneof */ \"./node_modules/protobufjs/src/oneof.js\"),\n Enum = __webpack_require__(/*! ./enum */ \"./node_modules/protobufjs/src/enum.js\"),\n Service = __webpack_require__(/*! ./service */ \"./node_modules/protobufjs/src/service.js\"),\n Method = __webpack_require__(/*! ./method */ \"./node_modules/protobufjs/src/method.js\"),\n types = __webpack_require__(/*! ./types */ \"./node_modules/protobufjs/src/types.js\"),\n util = __webpack_require__(/*! ./util */ \"./node_modules/protobufjs/src/util.js\");\n\nvar base10Re = /^[1-9][0-9]*$/,\n base10NegRe = /^-?[1-9][0-9]*$/,\n base16Re = /^0[x][0-9a-fA-F]+$/,\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n base8Re = /^0[0-7]+$/,\n base8NegRe = /^-?0[0-7]+$/,\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n /* eslint-disable callback-return */\n if (!(root instanceof Root)) {\n options = root;\n root = new Root();\n }\n if (!options)\n options = parse.defaults;\n\n var preferTrailingComment = options.preferTrailingComment || false;\n var tn = tokenize(source, options.alternateCommentMode || false),\n next = tn.next,\n push = tn.push,\n peek = tn.peek,\n skip = tn.skip,\n cmnt = tn.cmnt;\n\n var head = true,\n pkg,\n imports,\n weakImports,\n syntax,\n isProto3 = false;\n\n var ptr = root;\n\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n /* istanbul ignore next */\n function illegal(token, name, insideTryCatch) {\n var filename = parse.filename;\n if (!insideTryCatch)\n parse.filename = null;\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n }\n\n function readString() {\n var values = [],\n token;\n do {\n /* istanbul ignore if */\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\n throw illegal(token);\n\n values.push(next());\n skip(token);\n token = peek();\n } while (token === \"\\\"\" || token === \"'\");\n return values.join(\"\");\n }\n\n function readValue(acceptTypeRef) {\n var token = next();\n switch (token) {\n case \"'\":\n case \"\\\"\":\n push(token);\n return readString();\n case \"true\": case \"TRUE\":\n return true;\n case \"false\": case \"FALSE\":\n return false;\n }\n try {\n return parseNumber(token, /* insideTryCatch */ true);\n } catch (e) {\n\n /* istanbul ignore else */\n if (acceptTypeRef && typeRefRe.test(token))\n return token;\n\n /* istanbul ignore next */\n throw illegal(token, \"value\");\n }\n }\n\n function readRanges(target, acceptStrings) {\n var token, start;\n do {\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\n target.push(readString());\n else\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n } while (skip(\",\", true));\n skip(\";\");\n }\n\n function parseNumber(token, insideTryCatch) {\n var sign = 1;\n if (token.charAt(0) === \"-\") {\n sign = -1;\n token = token.substring(1);\n }\n switch (token) {\n case \"inf\": case \"INF\": case \"Inf\":\n return sign * Infinity;\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n return NaN;\n case \"0\":\n return 0;\n }\n if (base10Re.test(token))\n return sign * parseInt(token, 10);\n if (base16Re.test(token))\n return sign * parseInt(token, 16);\n if (base8Re.test(token))\n return sign * parseInt(token, 8);\n\n /* istanbul ignore else */\n if (numberRe.test(token))\n return sign * parseFloat(token);\n\n /* istanbul ignore next */\n throw illegal(token, \"number\", insideTryCatch);\n }\n\n function parseId(token, acceptNegative) {\n switch (token) {\n case \"max\": case \"MAX\": case \"Max\":\n return 536870911;\n case \"0\":\n return 0;\n }\n\n /* istanbul ignore if */\n if (!acceptNegative && token.charAt(0) === \"-\")\n throw illegal(token, \"id\");\n\n if (base10NegRe.test(token))\n return parseInt(token, 10);\n if (base16NegRe.test(token))\n return parseInt(token, 16);\n\n /* istanbul ignore else */\n if (base8NegRe.test(token))\n return parseInt(token, 8);\n\n /* istanbul ignore next */\n throw illegal(token, \"id\");\n }\n\n function parsePackage() {\n\n /* istanbul ignore if */\n if (pkg !== undefined)\n throw illegal(\"package\");\n\n pkg = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(pkg))\n throw illegal(pkg, \"name\");\n\n ptr = ptr.define(pkg);\n skip(\";\");\n }\n\n function parseImport() {\n var token = peek();\n var whichImports;\n switch (token) {\n case \"weak\":\n whichImports = weakImports || (weakImports = []);\n next();\n break;\n case \"public\":\n next();\n // eslint-disable-line no-fallthrough\n default:\n whichImports = imports || (imports = []);\n break;\n }\n token = readString();\n skip(\";\");\n whichImports.push(token);\n }\n\n function parseSyntax() {\n skip(\"=\");\n syntax = readString();\n isProto3 = syntax === \"proto3\";\n\n /* istanbul ignore if */\n if (!isProto3 && syntax !== \"proto2\")\n throw illegal(syntax, \"syntax\");\n\n skip(\";\");\n }\n\n function parseCommon(parent, token) {\n switch (token) {\n\n case \"option\":\n parseOption(parent, token);\n skip(\";\");\n return true;\n\n case \"message\":\n parseType(parent, token);\n return true;\n\n case \"enum\":\n parseEnum(parent, token);\n return true;\n\n case \"service\":\n parseService(parent, token);\n return true;\n\n case \"extend\":\n parseExtension(parent, token);\n return true;\n }\n return false;\n }\n\n function ifBlock(obj, fnIf, fnElse) {\n var trailingLine = tn.line;\n if (obj) {\n if(typeof obj.comment !== \"string\") {\n obj.comment = cmnt(); // try block-type comment\n }\n obj.filename = parse.filename;\n }\n if (skip(\"{\", true)) {\n var token;\n while ((token = next()) !== \"}\")\n fnIf(token);\n skip(\";\", true);\n } else {\n if (fnElse)\n fnElse();\n skip(\";\");\n if (obj && (typeof obj.comment !== \"string\" || preferTrailingComment))\n obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment\n }\n }\n\n function parseType(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"type name\");\n\n var type = new Type(token);\n ifBlock(type, function parseType_block(token) {\n if (parseCommon(type, token))\n return;\n\n switch (token) {\n\n case \"map\":\n parseMapField(type, token);\n break;\n\n case \"required\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (isProto3) {\n parseField(type, \"proto3_optional\");\n } else {\n parseField(type, \"optional\");\n }\n break;\n\n case \"oneof\":\n parseOneOf(type, token);\n break;\n\n case \"extensions\":\n readRanges(type.extensions || (type.extensions = []));\n break;\n\n case \"reserved\":\n readRanges(type.reserved || (type.reserved = []), true);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n\n push(token);\n parseField(type, \"optional\");\n break;\n }\n });\n parent.add(type);\n }\n\n function parseField(parent, rule, extend) {\n var type = next();\n if (type === \"group\") {\n parseGroup(parent, rule);\n return;\n }\n\n /* istanbul ignore if */\n if (!typeRefRe.test(type))\n throw illegal(type, \"type\");\n\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n name = applyCase(name);\n skip(\"=\");\n\n var field = new Field(name, parseId(next()), type, rule, extend);\n ifBlock(field, function parseField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseField_line() {\n parseInlineOptions(field);\n });\n\n if (rule === \"proto3_optional\") {\n // for proto3 optional fields, we create a single-member Oneof to mimic \"optional\" behavior\n var oneof = new OneOf(\"_\" + name);\n field.setOption(\"proto3_optional\", true);\n oneof.add(field);\n parent.add(oneof);\n } else {\n parent.add(field);\n }\n\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\n // parsing proto2 descriptors without the option, where applicable. This must be done for\n // all known packable types and anything that could be an enum (= is not a basic type).\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\n field.setOption(\"packed\", false, /* ifNotSet */ true);\n }\n\n function parseGroup(parent, rule) {\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n var fieldName = util.lcFirst(name);\n if (name === fieldName)\n name = util.ucFirst(name);\n skip(\"=\");\n var id = parseId(next());\n var type = new Type(name);\n type.group = true;\n var field = new Field(fieldName, id, name, rule);\n field.filename = parse.filename;\n ifBlock(type, function parseGroup_block(token) {\n switch (token) {\n\n case \"option\":\n parseOption(type, token);\n skip(\";\");\n break;\n\n case \"required\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (isProto3) {\n parseField(type, \"proto3_optional\");\n } else {\n parseField(type, \"optional\");\n }\n break;\n\n case \"message\":\n parseType(type, token);\n break;\n\n case \"enum\":\n parseEnum(type, token);\n break;\n\n /* istanbul ignore next */\n default:\n throw illegal(token); // there are no groups with proto3 semantics\n }\n });\n parent.add(type)\n .add(field);\n }\n\n function parseMapField(parent) {\n skip(\"<\");\n var keyType = next();\n\n /* istanbul ignore if */\n if (types.mapKey[keyType] === undefined)\n throw illegal(keyType, \"type\");\n\n skip(\",\");\n var valueType = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(valueType))\n throw illegal(valueType, \"type\");\n\n skip(\">\");\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n skip(\"=\");\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n ifBlock(field, function parseMapField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseMapField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n }\n\n function parseOneOf(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var oneof = new OneOf(applyCase(token));\n ifBlock(oneof, function parseOneOf_block(token) {\n if (token === \"option\") {\n parseOption(oneof, token);\n skip(\";\");\n } else {\n push(token);\n parseField(oneof, \"optional\");\n }\n });\n parent.add(oneof);\n }\n\n function parseEnum(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var enm = new Enum(token);\n ifBlock(enm, function parseEnum_block(token) {\n switch(token) {\n case \"option\":\n parseOption(enm, token);\n skip(\";\");\n break;\n\n case \"reserved\":\n readRanges(enm.reserved || (enm.reserved = []), true);\n break;\n\n default:\n parseEnumValue(enm, token);\n }\n });\n parent.add(enm);\n }\n\n function parseEnumValue(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token))\n throw illegal(token, \"name\");\n\n skip(\"=\");\n var value = parseId(next(), true),\n dummy = {\n options: undefined\n };\n dummy.setOption = function(name, value) {\n if (this.options === undefined)\n this.options = {};\n this.options[name] = value;\n };\n ifBlock(dummy, function parseEnumValue_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseEnumValue_line() {\n parseInlineOptions(dummy); // skip\n });\n parent.add(token, value, dummy.comment, dummy.options);\n }\n\n function parseOption(parent, token) {\n var isCustom = skip(\"(\", true);\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token;\n var option = name;\n var propName;\n\n if (isCustom) {\n skip(\")\");\n name = \"(\" + name + \")\";\n option = name;\n token = peek();\n if (fqTypeRefRe.test(token)) {\n propName = token.slice(1); //remove '.' before property name\n name += token;\n next();\n }\n }\n skip(\"=\");\n var optionValue = parseOptionValue(parent, name);\n setParsedOption(parent, option, optionValue, propName);\n }\n\n function parseOptionValue(parent, name) {\n // { a: \"foo\" b { c: \"bar\" } }\n if (skip(\"{\", true)) {\n var objectResult = {};\n\n while (!skip(\"}\", true)) {\n /* istanbul ignore if */\n if (!nameRe.test(token = next())) {\n throw illegal(token, \"name\");\n }\n\n var value;\n var propName = token;\n\n skip(\":\", true);\n\n if (peek() === \"{\")\n value = parseOptionValue(parent, name + \".\" + token);\n else if (peek() === \"[\") {\n // option (my_option) = {\n // repeated_value: [ \"foo\", \"bar\" ]\n // };\n value = [];\n var lastValue;\n if (skip(\"[\", true)) {\n do {\n lastValue = readValue(true);\n value.push(lastValue);\n } while (skip(\",\", true));\n skip(\"]\");\n if (typeof lastValue !== \"undefined\") {\n setOption(parent, name + \".\" + token, lastValue);\n }\n }\n } else {\n value = readValue(true);\n setOption(parent, name + \".\" + token, value);\n }\n\n var prevValue = objectResult[propName];\n\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n\n objectResult[propName] = value;\n\n // Semicolons and commas can be optional\n skip(\",\", true);\n skip(\";\", true);\n }\n\n return objectResult;\n }\n\n var simpleValue = readValue(true);\n setOption(parent, name, simpleValue);\n return simpleValue;\n // Does not enforce a delimiter to be universal\n }\n\n function setOption(parent, name, value) {\n if (parent.setOption)\n parent.setOption(name, value);\n }\n\n function setParsedOption(parent, name, value, propName) {\n if (parent.setParsedOption)\n parent.setParsedOption(name, value, propName);\n }\n\n function parseInlineOptions(parent) {\n if (skip(\"[\", true)) {\n do {\n parseOption(parent, \"option\");\n } while (skip(\",\", true));\n skip(\"]\");\n }\n return parent;\n }\n\n function parseService(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"service name\");\n\n var service = new Service(token);\n ifBlock(service, function parseService_block(token) {\n if (parseCommon(service, token))\n return;\n\n /* istanbul ignore else */\n if (token === \"rpc\")\n parseMethod(service, token);\n else\n throw illegal(token);\n });\n parent.add(service);\n }\n\n function parseMethod(parent, token) {\n // Get the comment of the preceding line now (if one exists) in case the\n // method is defined across multiple lines.\n var commentText = cmnt();\n\n var type = token;\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token,\n requestType, requestStream,\n responseType, responseStream;\n\n skip(\"(\");\n if (skip(\"stream\", true))\n requestStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n requestType = token;\n skip(\")\"); skip(\"returns\"); skip(\"(\");\n if (skip(\"stream\", true))\n responseStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n responseType = token;\n skip(\")\");\n\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n method.comment = commentText;\n ifBlock(method, function parseMethod_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(method, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n });\n parent.add(method);\n }\n\n function parseExtension(parent, token) {\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"reference\");\n\n var reference = token;\n ifBlock(null, function parseExtension_block(token) {\n switch (token) {\n\n case \"required\":\n case \"repeated\":\n parseField(parent, token, reference);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (isProto3) {\n parseField(parent, \"proto3_optional\", reference);\n } else {\n parseField(parent, \"optional\", reference);\n }\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n push(token);\n parseField(parent, \"optional\", reference);\n break;\n }\n });\n }\n\n var token;\n while ((token = next()) !== null) {\n switch (token) {\n\n case \"package\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parsePackage();\n break;\n\n case \"import\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseImport();\n break;\n\n case \"syntax\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseSyntax();\n break;\n\n case \"option\":\n\n parseOption(ptr, token);\n skip(\";\");\n break;\n\n default:\n\n /* istanbul ignore else */\n if (parseCommon(ptr, token)) {\n head = false;\n continue;\n }\n\n /* istanbul ignore next */\n throw illegal(token);\n }\n }\n\n parse.filename = null;\n return {\n \"package\" : pkg,\n \"imports\" : imports,\n weakImports : weakImports,\n syntax : syntax,\n root : root\n };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/protobufjs/src/parse.js?");
+eval("\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize = __webpack_require__(/*! ./tokenize */ \"./node_modules/protobufjs/src/tokenize.js\"),\n Root = __webpack_require__(/*! ./root */ \"./node_modules/protobufjs/src/root.js\"),\n Type = __webpack_require__(/*! ./type */ \"./node_modules/protobufjs/src/type.js\"),\n Field = __webpack_require__(/*! ./field */ \"./node_modules/protobufjs/src/field.js\"),\n MapField = __webpack_require__(/*! ./mapfield */ \"./node_modules/protobufjs/src/mapfield.js\"),\n OneOf = __webpack_require__(/*! ./oneof */ \"./node_modules/protobufjs/src/oneof.js\"),\n Enum = __webpack_require__(/*! ./enum */ \"./node_modules/protobufjs/src/enum.js\"),\n Service = __webpack_require__(/*! ./service */ \"./node_modules/protobufjs/src/service.js\"),\n Method = __webpack_require__(/*! ./method */ \"./node_modules/protobufjs/src/method.js\"),\n types = __webpack_require__(/*! ./types */ \"./node_modules/protobufjs/src/types.js\"),\n util = __webpack_require__(/*! ./util */ \"./node_modules/protobufjs/src/util.js\");\n\nvar base10Re = /^[1-9][0-9]*$/,\n base10NegRe = /^-?[1-9][0-9]*$/,\n base16Re = /^0[x][0-9a-fA-F]+$/,\n base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n base8Re = /^0[0-7]+$/,\n base8NegRe = /^-?0[0-7]+$/,\n numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n typeRefRe = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\n fqTypeRefRe = /^(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {string|undefined} syntax Syntax, if specified (either `\"proto2\"` or `\"proto3\"`)\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n /* eslint-disable callback-return */\n if (!(root instanceof Root)) {\n options = root;\n root = new Root();\n }\n if (!options)\n options = parse.defaults;\n\n var preferTrailingComment = options.preferTrailingComment || false;\n var tn = tokenize(source, options.alternateCommentMode || false),\n next = tn.next,\n push = tn.push,\n peek = tn.peek,\n skip = tn.skip,\n cmnt = tn.cmnt;\n\n var head = true,\n pkg,\n imports,\n weakImports,\n syntax,\n isProto3 = false;\n\n var ptr = root;\n\n var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n /* istanbul ignore next */\n function illegal(token, name, insideTryCatch) {\n var filename = parse.filename;\n if (!insideTryCatch)\n parse.filename = null;\n return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n }\n\n function readString() {\n var values = [],\n token;\n do {\n /* istanbul ignore if */\n if ((token = next()) !== \"\\\"\" && token !== \"'\")\n throw illegal(token);\n\n values.push(next());\n skip(token);\n token = peek();\n } while (token === \"\\\"\" || token === \"'\");\n return values.join(\"\");\n }\n\n function readValue(acceptTypeRef) {\n var token = next();\n switch (token) {\n case \"'\":\n case \"\\\"\":\n push(token);\n return readString();\n case \"true\": case \"TRUE\":\n return true;\n case \"false\": case \"FALSE\":\n return false;\n }\n try {\n return parseNumber(token, /* insideTryCatch */ true);\n } catch (e) {\n\n /* istanbul ignore else */\n if (acceptTypeRef && typeRefRe.test(token))\n return token;\n\n /* istanbul ignore next */\n throw illegal(token, \"value\");\n }\n }\n\n function readRanges(target, acceptStrings) {\n var token, start;\n do {\n if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\"))\n target.push(readString());\n else\n target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n } while (skip(\",\", true));\n skip(\";\");\n }\n\n function parseNumber(token, insideTryCatch) {\n var sign = 1;\n if (token.charAt(0) === \"-\") {\n sign = -1;\n token = token.substring(1);\n }\n switch (token) {\n case \"inf\": case \"INF\": case \"Inf\":\n return sign * Infinity;\n case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n return NaN;\n case \"0\":\n return 0;\n }\n if (base10Re.test(token))\n return sign * parseInt(token, 10);\n if (base16Re.test(token))\n return sign * parseInt(token, 16);\n if (base8Re.test(token))\n return sign * parseInt(token, 8);\n\n /* istanbul ignore else */\n if (numberRe.test(token))\n return sign * parseFloat(token);\n\n /* istanbul ignore next */\n throw illegal(token, \"number\", insideTryCatch);\n }\n\n function parseId(token, acceptNegative) {\n switch (token) {\n case \"max\": case \"MAX\": case \"Max\":\n return 536870911;\n case \"0\":\n return 0;\n }\n\n /* istanbul ignore if */\n if (!acceptNegative && token.charAt(0) === \"-\")\n throw illegal(token, \"id\");\n\n if (base10NegRe.test(token))\n return parseInt(token, 10);\n if (base16NegRe.test(token))\n return parseInt(token, 16);\n\n /* istanbul ignore else */\n if (base8NegRe.test(token))\n return parseInt(token, 8);\n\n /* istanbul ignore next */\n throw illegal(token, \"id\");\n }\n\n function parsePackage() {\n\n /* istanbul ignore if */\n if (pkg !== undefined)\n throw illegal(\"package\");\n\n pkg = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(pkg))\n throw illegal(pkg, \"name\");\n\n ptr = ptr.define(pkg);\n skip(\";\");\n }\n\n function parseImport() {\n var token = peek();\n var whichImports;\n switch (token) {\n case \"weak\":\n whichImports = weakImports || (weakImports = []);\n next();\n break;\n case \"public\":\n next();\n // eslint-disable-line no-fallthrough\n default:\n whichImports = imports || (imports = []);\n break;\n }\n token = readString();\n skip(\";\");\n whichImports.push(token);\n }\n\n function parseSyntax() {\n skip(\"=\");\n syntax = readString();\n isProto3 = syntax === \"proto3\";\n\n /* istanbul ignore if */\n if (!isProto3 && syntax !== \"proto2\")\n throw illegal(syntax, \"syntax\");\n\n skip(\";\");\n }\n\n function parseCommon(parent, token) {\n switch (token) {\n\n case \"option\":\n parseOption(parent, token);\n skip(\";\");\n return true;\n\n case \"message\":\n parseType(parent, token);\n return true;\n\n case \"enum\":\n parseEnum(parent, token);\n return true;\n\n case \"service\":\n parseService(parent, token);\n return true;\n\n case \"extend\":\n parseExtension(parent, token);\n return true;\n }\n return false;\n }\n\n function ifBlock(obj, fnIf, fnElse) {\n var trailingLine = tn.line;\n if (obj) {\n if(typeof obj.comment !== \"string\") {\n obj.comment = cmnt(); // try block-type comment\n }\n obj.filename = parse.filename;\n }\n if (skip(\"{\", true)) {\n var token;\n while ((token = next()) !== \"}\")\n fnIf(token);\n skip(\";\", true);\n } else {\n if (fnElse)\n fnElse();\n skip(\";\");\n if (obj && (typeof obj.comment !== \"string\" || preferTrailingComment))\n obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment\n }\n }\n\n function parseType(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"type name\");\n\n var type = new Type(token);\n ifBlock(type, function parseType_block(token) {\n if (parseCommon(type, token))\n return;\n\n switch (token) {\n\n case \"map\":\n parseMapField(type, token);\n break;\n\n case \"required\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (isProto3) {\n parseField(type, \"proto3_optional\");\n } else {\n parseField(type, \"optional\");\n }\n break;\n\n case \"oneof\":\n parseOneOf(type, token);\n break;\n\n case \"extensions\":\n readRanges(type.extensions || (type.extensions = []));\n break;\n\n case \"reserved\":\n readRanges(type.reserved || (type.reserved = []), true);\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n\n push(token);\n parseField(type, \"optional\");\n break;\n }\n });\n parent.add(type);\n }\n\n function parseField(parent, rule, extend) {\n var type = next();\n if (type === \"group\") {\n parseGroup(parent, rule);\n return;\n }\n // Type names can consume multiple tokens, in multiple variants:\n // package.subpackage field tokens: \"package.subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // package . subpackage field tokens: \"package\" \".\" \"subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // package. subpackage field tokens: \"package.\" \"subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // package .subpackage field tokens: \"package\" \".subpackage\" [TYPE NAME ENDS HERE] \"field\"\n // Keep reading tokens until we get a type name with no period at the end,\n // and the next token does not start with a period.\n while (type.endsWith(\".\") || peek().startsWith(\".\")) {\n type += next();\n }\n\n /* istanbul ignore if */\n if (!typeRefRe.test(type))\n throw illegal(type, \"type\");\n\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n name = applyCase(name);\n skip(\"=\");\n\n var field = new Field(name, parseId(next()), type, rule, extend);\n ifBlock(field, function parseField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseField_line() {\n parseInlineOptions(field);\n });\n\n if (rule === \"proto3_optional\") {\n // for proto3 optional fields, we create a single-member Oneof to mimic \"optional\" behavior\n var oneof = new OneOf(\"_\" + name);\n field.setOption(\"proto3_optional\", true);\n oneof.add(field);\n parent.add(oneof);\n } else {\n parent.add(field);\n }\n\n // JSON defaults to packed=true if not set so we have to set packed=false explicity when\n // parsing proto2 descriptors without the option, where applicable. This must be done for\n // all known packable types and anything that could be an enum (= is not a basic type).\n if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined))\n field.setOption(\"packed\", false, /* ifNotSet */ true);\n }\n\n function parseGroup(parent, rule) {\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n var fieldName = util.lcFirst(name);\n if (name === fieldName)\n name = util.ucFirst(name);\n skip(\"=\");\n var id = parseId(next());\n var type = new Type(name);\n type.group = true;\n var field = new Field(fieldName, id, name, rule);\n field.filename = parse.filename;\n ifBlock(type, function parseGroup_block(token) {\n switch (token) {\n\n case \"option\":\n parseOption(type, token);\n skip(\";\");\n break;\n\n case \"required\":\n case \"repeated\":\n parseField(type, token);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (isProto3) {\n parseField(type, \"proto3_optional\");\n } else {\n parseField(type, \"optional\");\n }\n break;\n\n case \"message\":\n parseType(type, token);\n break;\n\n case \"enum\":\n parseEnum(type, token);\n break;\n\n /* istanbul ignore next */\n default:\n throw illegal(token); // there are no groups with proto3 semantics\n }\n });\n parent.add(type)\n .add(field);\n }\n\n function parseMapField(parent) {\n skip(\"<\");\n var keyType = next();\n\n /* istanbul ignore if */\n if (types.mapKey[keyType] === undefined)\n throw illegal(keyType, \"type\");\n\n skip(\",\");\n var valueType = next();\n\n /* istanbul ignore if */\n if (!typeRefRe.test(valueType))\n throw illegal(valueType, \"type\");\n\n skip(\">\");\n var name = next();\n\n /* istanbul ignore if */\n if (!nameRe.test(name))\n throw illegal(name, \"name\");\n\n skip(\"=\");\n var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n ifBlock(field, function parseMapField_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(field, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseMapField_line() {\n parseInlineOptions(field);\n });\n parent.add(field);\n }\n\n function parseOneOf(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var oneof = new OneOf(applyCase(token));\n ifBlock(oneof, function parseOneOf_block(token) {\n if (token === \"option\") {\n parseOption(oneof, token);\n skip(\";\");\n } else {\n push(token);\n parseField(oneof, \"optional\");\n }\n });\n parent.add(oneof);\n }\n\n function parseEnum(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var enm = new Enum(token);\n ifBlock(enm, function parseEnum_block(token) {\n switch(token) {\n case \"option\":\n parseOption(enm, token);\n skip(\";\");\n break;\n\n case \"reserved\":\n readRanges(enm.reserved || (enm.reserved = []), true);\n break;\n\n default:\n parseEnumValue(enm, token);\n }\n });\n parent.add(enm);\n }\n\n function parseEnumValue(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token))\n throw illegal(token, \"name\");\n\n skip(\"=\");\n var value = parseId(next(), true),\n dummy = {\n options: undefined\n };\n dummy.setOption = function(name, value) {\n if (this.options === undefined)\n this.options = {};\n this.options[name] = value;\n };\n ifBlock(dummy, function parseEnumValue_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(dummy, token); // skip\n skip(\";\");\n } else\n throw illegal(token);\n\n }, function parseEnumValue_line() {\n parseInlineOptions(dummy); // skip\n });\n parent.add(token, value, dummy.comment, dummy.options);\n }\n\n function parseOption(parent, token) {\n var isCustom = skip(\"(\", true);\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token;\n var option = name;\n var propName;\n\n if (isCustom) {\n skip(\")\");\n name = \"(\" + name + \")\";\n option = name;\n token = peek();\n if (fqTypeRefRe.test(token)) {\n propName = token.slice(1); //remove '.' before property name\n name += token;\n next();\n }\n }\n skip(\"=\");\n var optionValue = parseOptionValue(parent, name);\n setParsedOption(parent, option, optionValue, propName);\n }\n\n function parseOptionValue(parent, name) {\n // { a: \"foo\" b { c: \"bar\" } }\n if (skip(\"{\", true)) {\n var objectResult = {};\n\n while (!skip(\"}\", true)) {\n /* istanbul ignore if */\n if (!nameRe.test(token = next())) {\n throw illegal(token, \"name\");\n }\n\n var value;\n var propName = token;\n\n skip(\":\", true);\n\n if (peek() === \"{\")\n value = parseOptionValue(parent, name + \".\" + token);\n else if (peek() === \"[\") {\n // option (my_option) = {\n // repeated_value: [ \"foo\", \"bar\" ]\n // };\n value = [];\n var lastValue;\n if (skip(\"[\", true)) {\n do {\n lastValue = readValue(true);\n value.push(lastValue);\n } while (skip(\",\", true));\n skip(\"]\");\n if (typeof lastValue !== \"undefined\") {\n setOption(parent, name + \".\" + token, lastValue);\n }\n }\n } else {\n value = readValue(true);\n setOption(parent, name + \".\" + token, value);\n }\n\n var prevValue = objectResult[propName];\n\n if (prevValue)\n value = [].concat(prevValue).concat(value);\n\n objectResult[propName] = value;\n\n // Semicolons and commas can be optional\n skip(\",\", true);\n skip(\";\", true);\n }\n\n return objectResult;\n }\n\n var simpleValue = readValue(true);\n setOption(parent, name, simpleValue);\n return simpleValue;\n // Does not enforce a delimiter to be universal\n }\n\n function setOption(parent, name, value) {\n if (parent.setOption)\n parent.setOption(name, value);\n }\n\n function setParsedOption(parent, name, value, propName) {\n if (parent.setParsedOption)\n parent.setParsedOption(name, value, propName);\n }\n\n function parseInlineOptions(parent) {\n if (skip(\"[\", true)) {\n do {\n parseOption(parent, \"option\");\n } while (skip(\",\", true));\n skip(\"]\");\n }\n return parent;\n }\n\n function parseService(parent, token) {\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"service name\");\n\n var service = new Service(token);\n ifBlock(service, function parseService_block(token) {\n if (parseCommon(service, token))\n return;\n\n /* istanbul ignore else */\n if (token === \"rpc\")\n parseMethod(service, token);\n else\n throw illegal(token);\n });\n parent.add(service);\n }\n\n function parseMethod(parent, token) {\n // Get the comment of the preceding line now (if one exists) in case the\n // method is defined across multiple lines.\n var commentText = cmnt();\n\n var type = token;\n\n /* istanbul ignore if */\n if (!nameRe.test(token = next()))\n throw illegal(token, \"name\");\n\n var name = token,\n requestType, requestStream,\n responseType, responseStream;\n\n skip(\"(\");\n if (skip(\"stream\", true))\n requestStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n requestType = token;\n skip(\")\"); skip(\"returns\"); skip(\"(\");\n if (skip(\"stream\", true))\n responseStream = true;\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token);\n\n responseType = token;\n skip(\")\");\n\n var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n method.comment = commentText;\n ifBlock(method, function parseMethod_block(token) {\n\n /* istanbul ignore else */\n if (token === \"option\") {\n parseOption(method, token);\n skip(\";\");\n } else\n throw illegal(token);\n\n });\n parent.add(method);\n }\n\n function parseExtension(parent, token) {\n\n /* istanbul ignore if */\n if (!typeRefRe.test(token = next()))\n throw illegal(token, \"reference\");\n\n var reference = token;\n ifBlock(null, function parseExtension_block(token) {\n switch (token) {\n\n case \"required\":\n case \"repeated\":\n parseField(parent, token, reference);\n break;\n\n case \"optional\":\n /* istanbul ignore if */\n if (isProto3) {\n parseField(parent, \"proto3_optional\", reference);\n } else {\n parseField(parent, \"optional\", reference);\n }\n break;\n\n default:\n /* istanbul ignore if */\n if (!isProto3 || !typeRefRe.test(token))\n throw illegal(token);\n push(token);\n parseField(parent, \"optional\", reference);\n break;\n }\n });\n }\n\n var token;\n while ((token = next()) !== null) {\n switch (token) {\n\n case \"package\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parsePackage();\n break;\n\n case \"import\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseImport();\n break;\n\n case \"syntax\":\n\n /* istanbul ignore if */\n if (!head)\n throw illegal(token);\n\n parseSyntax();\n break;\n\n case \"option\":\n\n parseOption(ptr, token);\n skip(\";\");\n break;\n\n default:\n\n /* istanbul ignore else */\n if (parseCommon(ptr, token)) {\n head = false;\n continue;\n }\n\n /* istanbul ignore next */\n throw illegal(token);\n }\n }\n\n parse.filename = null;\n return {\n \"package\" : pkg,\n \"imports\" : imports,\n weakImports : weakImports,\n syntax : syntax,\n root : root\n };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/protobufjs/src/parse.js?");
/***/ }),
@@ -1457,7 +1325,7 @@ eval("\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = __webp
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
-eval("\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = __webpack_require__(/*! ./namespace */ \"./node_modules/protobufjs/src/namespace.js\");\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = __webpack_require__(/*! ./field */ \"./node_modules/protobufjs/src/field.js\"),\n Enum = __webpack_require__(/*! ./enum */ \"./node_modules/protobufjs/src/enum.js\"),\n OneOf = __webpack_require__(/*! ./oneof */ \"./node_modules/protobufjs/src/oneof.js\"),\n util = __webpack_require__(/*! ./util */ \"./node_modules/protobufjs/src/util.js\");\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/protobufjs/src/root.js?");
+eval("\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = __webpack_require__(/*! ./namespace */ \"./node_modules/protobufjs/src/namespace.js\");\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field = __webpack_require__(/*! ./field */ \"./node_modules/protobufjs/src/field.js\"),\n Enum = __webpack_require__(/*! ./enum */ \"./node_modules/protobufjs/src/enum.js\"),\n OneOf = __webpack_require__(/*! ./oneof */ \"./node_modules/protobufjs/src/oneof.js\"),\n util = __webpack_require__(/*! ./util */ \"./node_modules/protobufjs/src/util.js\");\n\nvar Type, // cyclic\n parse, // might be excluded\n common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.} [options] Top level options\n */\nfunction Root(options) {\n Namespace.call(this, \"\", options);\n\n /**\n * Deferred extension fields.\n * @type {Field[]}\n */\n this.deferred = [];\n\n /**\n * Resolved file names of loaded files.\n * @type {string[]}\n */\n this.files = [];\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Nameespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n if (!root)\n root = new Root();\n if (json.options)\n root.setOptions(json.options);\n return root.addJSON(json.nested);\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = undefined;\n }\n var self = this;\n if (!callback)\n return util.asPromise(load, self, filename, options);\n\n var sync = callback === SYNC; // undocumented\n\n // Finishes loading by calling the callback (exactly once)\n function finish(err, root) {\n /* istanbul ignore if */\n if (!callback)\n return;\n var cb = callback;\n callback = null;\n if (sync)\n throw err;\n cb(err, root);\n }\n\n // Bundled definition existence checking\n function getBundledFileName(filename) {\n var idx = filename.lastIndexOf(\"google/protobuf/\");\n if (idx > -1) {\n var altname = filename.substring(idx);\n if (altname in common) return altname;\n }\n return null;\n }\n\n // Processes a single file\n function process(filename, source) {\n try {\n if (util.isString(source) && source.charAt(0) === \"{\")\n source = JSON.parse(source);\n if (!util.isString(source))\n self.setOptions(source.options).addJSON(source.nested);\n else {\n parse.filename = filename;\n var parsed = parse(source, self, options),\n resolved,\n i = 0;\n if (parsed.imports)\n for (; i < parsed.imports.length; ++i)\n if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n fetch(resolved);\n if (parsed.weakImports)\n for (i = 0; i < parsed.weakImports.length; ++i)\n if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n fetch(resolved, true);\n }\n } catch (err) {\n finish(err);\n }\n if (!sync && !queued)\n finish(null, self); // only once anyway\n }\n\n // Fetches a single file\n function fetch(filename, weak) {\n filename = getBundledFileName(filename) || filename;\n\n // Skip if already loaded / attempted\n if (self.files.indexOf(filename) > -1)\n return;\n self.files.push(filename);\n\n // Shortcut bundled definitions\n if (filename in common) {\n if (sync)\n process(filename, common[filename]);\n else {\n ++queued;\n setTimeout(function() {\n --queued;\n process(filename, common[filename]);\n });\n }\n return;\n }\n\n // Otherwise fetch from disk or network\n if (sync) {\n var source;\n try {\n source = util.fs.readFileSync(filename).toString(\"utf8\");\n } catch (err) {\n if (!weak)\n finish(err);\n return;\n }\n process(filename, source);\n } else {\n ++queued;\n self.fetch(filename, function(err, source) {\n --queued;\n /* istanbul ignore if */\n if (!callback)\n return; // terminated meanwhile\n if (err) {\n /* istanbul ignore else */\n if (!weak)\n finish(err);\n else if (!queued) // can't be covered reliably\n finish(null, self);\n return;\n }\n process(filename, source);\n });\n }\n }\n var queued = 0;\n\n // Assembling the root namespace doesn't require working type\n // references anymore, so we can load everything in parallel\n if (util.isString(filename))\n filename = [ filename ];\n for (var i = 0, resolved; i < filename.length; ++i)\n if (resolved = self.resolvePath(\"\", filename[i]))\n fetch(resolved);\n\n if (sync)\n return self;\n if (!queued)\n finish(null, self);\n return undefined;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n if (!util.isNode)\n throw Error(\"not supported\");\n return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n if (this.deferred.length)\n throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n }).join(\", \"));\n return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n var extendedType = field.parent.lookup(field.extend);\n if (extendedType) {\n var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n //do not allow to extend same field twice to prevent the error\n if (extendedType.get(sisterField.name)) {\n return true;\n }\n sisterField.declaringField = field;\n field.extensionField = sisterField;\n extendedType.add(sisterField);\n return true;\n }\n return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n if (object instanceof Field) {\n\n if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n if (!tryHandleExtension(this, object))\n this.deferred.push(object);\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n if (object instanceof Type) // Try to handle any deferred extensions\n for (var i = 0; i < this.deferred.length;)\n if (tryHandleExtension(this, this.deferred[i]))\n this.deferred.splice(i, 1);\n else\n ++i;\n for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n this._handleAdd(object._nestedArray[j]);\n if (exposeRe.test(object.name))\n object.parent[object.name] = object; // expose namespace as property of its parent\n }\n\n // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n // properties of namespaces just like static code does. This allows using a .d.ts generated for\n // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n if (object instanceof Field) {\n\n if (/* an extension field */ object.extend !== undefined) {\n if (/* already handled */ object.extensionField) { // remove its sister field\n object.extensionField.parent.remove(object.extensionField);\n object.extensionField = null;\n } else { // cancel the extension\n var index = this.deferred.indexOf(object);\n /* istanbul ignore else */\n if (index > -1)\n this.deferred.splice(index, 1);\n }\n }\n\n } else if (object instanceof Enum) {\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose enum values\n\n } else if (object instanceof Namespace) {\n\n for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n this._handleRemove(object._nestedArray[i]);\n\n if (exposeRe.test(object.name))\n delete object.parent[object.name]; // unexpose namespaces\n\n }\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n Type = Type_;\n parse = parse_;\n common = common_;\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/protobufjs/src/root.js?");
/***/ }),
@@ -1567,7 +1435,7 @@ eval("\nmodule.exports = LongBits;\n\nvar util = __webpack_require__(/*! ../util
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-eval("\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = __webpack_require__(/*! @protobufjs/aspromise */ \"./node_modules/@protobufjs/aspromise/index.js\");\n\n// converts to / from base64 encoded strings\nutil.base64 = __webpack_require__(/*! @protobufjs/base64 */ \"./node_modules/@protobufjs/base64/index.js\");\n\n// base class of rpc.Service\nutil.EventEmitter = __webpack_require__(/*! @protobufjs/eventemitter */ \"./node_modules/@protobufjs/eventemitter/index.js\");\n\n// float handling accross browsers\nutil.float = __webpack_require__(/*! @protobufjs/float */ \"./node_modules/@protobufjs/float/index.js\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = __webpack_require__(/*! @protobufjs/inquire */ \"./node_modules/@protobufjs/inquire/index.js\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = __webpack_require__(/*! @protobufjs/utf8 */ \"./node_modules/@protobufjs/utf8/index.js\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = __webpack_require__(/*! @protobufjs/pool */ \"./node_modules/@protobufjs/pool/index.js\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = __webpack_require__(/*! ./longbits */ \"./node_modules/protobufjs/src/util/longbits.js\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof __webpack_require__.g !== \"undefined\"\n && __webpack_require__.g\n && __webpack_require__.g.process\n && __webpack_require__.g.process.versions\n && __webpack_require__.g.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && __webpack_require__.g\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/protobufjs/src/util/minimal.js?");
+eval("\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = __webpack_require__(/*! @protobufjs/aspromise */ \"./node_modules/@protobufjs/aspromise/index.js\");\n\n// converts to / from base64 encoded strings\nutil.base64 = __webpack_require__(/*! @protobufjs/base64 */ \"./node_modules/@protobufjs/base64/index.js\");\n\n// base class of rpc.Service\nutil.EventEmitter = __webpack_require__(/*! @protobufjs/eventemitter */ \"./node_modules/@protobufjs/eventemitter/index.js\");\n\n// float handling accross browsers\nutil.float = __webpack_require__(/*! @protobufjs/float */ \"./node_modules/@protobufjs/float/index.js\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = __webpack_require__(/*! @protobufjs/inquire */ \"./node_modules/@protobufjs/inquire/index.js\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = __webpack_require__(/*! @protobufjs/utf8 */ \"./node_modules/@protobufjs/utf8/index.js\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = __webpack_require__(/*! @protobufjs/pool */ \"./node_modules/@protobufjs/pool/index.js\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = __webpack_require__(/*! ./longbits */ \"./node_modules/protobufjs/src/util/longbits.js\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof __webpack_require__.g !== \"undefined\"\n && __webpack_require__.g\n && __webpack_require__.g.process\n && __webpack_require__.g.process.versions\n && __webpack_require__.g.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && __webpack_require__.g\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get: function get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value: function value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/protobufjs/src/util/minimal.js?");
/***/ }),
@@ -2184,6 +2052,72 @@ eval("\n\nfunction isHighSurrogate(codePoint) {\n return codePoint >= 0xd800 &&
/***/ }),
+/***/ "./node_modules/uuid/dist/esm-browser/native.js":
+/*!******************************************************!*\
+ !*** ./node_modules/uuid/dist/esm-browser/native.js ***!
+ \******************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nconst randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n randomUUID\n});\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/uuid/dist/esm-browser/native.js?");
+
+/***/ }),
+
+/***/ "./node_modules/uuid/dist/esm-browser/regex.js":
+/*!*****************************************************!*\
+ !*** ./node_modules/uuid/dist/esm-browser/regex.js ***!
+ \*****************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/uuid/dist/esm-browser/regex.js?");
+
+/***/ }),
+
+/***/ "./node_modules/uuid/dist/esm-browser/rng.js":
+/*!***************************************************!*\
+ !*** ./node_modules/uuid/dist/esm-browser/rng.js ***!
+ \***************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ rng)\n/* harmony export */ });\n// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nfunction rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/uuid/dist/esm-browser/rng.js?");
+
+/***/ }),
+
+/***/ "./node_modules/uuid/dist/esm-browser/stringify.js":
+/*!*********************************************************!*\
+ !*** ./node_modules/uuid/dist/esm-browser/stringify.js ***!
+ \*********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"unsafeStringify\": () => (/* binding */ unsafeStringify)\n/* harmony export */ });\n/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validate.js */ \"./node_modules/uuid/dist/esm-browser/validate.js\");\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nfunction unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0,_validate_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/uuid/dist/esm-browser/stringify.js?");
+
+/***/ }),
+
+/***/ "./node_modules/uuid/dist/esm-browser/v4.js":
+/*!**************************************************!*\
+ !*** ./node_modules/uuid/dist/esm-browser/v4.js ***!
+ \**************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _native_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./native.js */ \"./node_modules/uuid/dist/esm-browser/native.js\");\n/* harmony import */ var _rng_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rng.js */ \"./node_modules/uuid/dist/esm-browser/rng.js\");\n/* harmony import */ var _stringify_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stringify.js */ \"./node_modules/uuid/dist/esm-browser/stringify.js\");\n\n\n\n\nfunction v4(options, buf, offset) {\n if (_native_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].randomUUID && !buf && !options) {\n return _native_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || _rng_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0,_stringify_js__WEBPACK_IMPORTED_MODULE_2__.unsafeStringify)(rnds);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (v4);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/uuid/dist/esm-browser/v4.js?");
+
+/***/ }),
+
+/***/ "./node_modules/uuid/dist/esm-browser/validate.js":
+/*!********************************************************!*\
+ !*** ./node_modules/uuid/dist/esm-browser/validate.js ***!
+ \********************************************************/
+/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _regex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./regex.js */ \"./node_modules/uuid/dist/esm-browser/regex.js\");\n\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].test(uuid);\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (validate);\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/uuid/dist/esm-browser/validate.js?");
+
+/***/ }),
+
/***/ "./node_modules/varint/decode.js":
/*!***************************************!*\
!*** ./node_modules/varint/decode.js ***!
@@ -2294,13 +2228,13 @@ eval("/* (ignored) */\n\n//# sourceURL=webpack://@waku/noise-example/crypto_(ign
/***/ }),
-/***/ "./node_modules/@waku/core/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.cjs":
-/*!***************************************************************************************************!*\
- !*** ./node_modules/@waku/core/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.cjs ***!
- \***************************************************************************************************/
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.cjs":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.cjs ***!
+ \***************************************************************************/
/***/ (function(module, exports, __webpack_require__) {
-eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// @ts-nocheck\n/*eslint-disable*/\n(function(global, factory) { /* global define, require, module */\n\n /* AMD */ if (true)\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! protobufjs/minimal */ \"./node_modules/@waku/core/node_modules/protobufjs/minimal.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n /* CommonJS */ else {}\n\n})(this, function($protobuf) {\n \"use strict\";\n\n // Common aliases\n var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n // Exported root namespace\n var $root = $protobuf.roots[\"default\"] || ($protobuf.roots[\"default\"] = {});\n\n $root.RPC = (function() {\n\n /**\n * Properties of a RPC.\n * @exports IRPC\n * @interface IRPC\n * @property {Array.|null} [subscriptions] RPC subscriptions\n * @property {Array.|null} [messages] RPC messages\n * @property {RPC.IControlMessage|null} [control] RPC control\n */\n\n /**\n * Constructs a new RPC.\n * @exports RPC\n * @classdesc Represents a RPC.\n * @implements IRPC\n * @constructor\n * @param {IRPC=} [p] Properties to set\n */\n function RPC(p) {\n this.subscriptions = [];\n this.messages = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * RPC subscriptions.\n * @member {Array.} subscriptions\n * @memberof RPC\n * @instance\n */\n RPC.prototype.subscriptions = $util.emptyArray;\n\n /**\n * RPC messages.\n * @member {Array.} messages\n * @memberof RPC\n * @instance\n */\n RPC.prototype.messages = $util.emptyArray;\n\n /**\n * RPC control.\n * @member {RPC.IControlMessage|null|undefined} control\n * @memberof RPC\n * @instance\n */\n RPC.prototype.control = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * RPC _control.\n * @member {\"control\"|undefined} _control\n * @memberof RPC\n * @instance\n */\n Object.defineProperty(RPC.prototype, \"_control\", {\n get: $util.oneOfGetter($oneOfFields = [\"control\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified RPC message. Does not implicitly {@link RPC.verify|verify} messages.\n * @function encode\n * @memberof RPC\n * @static\n * @param {IRPC} m RPC message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n RPC.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.subscriptions != null && m.subscriptions.length) {\n for (var i = 0; i < m.subscriptions.length; ++i)\n $root.RPC.SubOpts.encode(m.subscriptions[i], w.uint32(10).fork()).ldelim();\n }\n if (m.messages != null && m.messages.length) {\n for (var i = 0; i < m.messages.length; ++i)\n $root.RPC.Message.encode(m.messages[i], w.uint32(18).fork()).ldelim();\n }\n if (m.control != null && Object.hasOwnProperty.call(m, \"control\"))\n $root.RPC.ControlMessage.encode(m.control, w.uint32(26).fork()).ldelim();\n return w;\n };\n\n /**\n * Decodes a RPC message from the specified reader or buffer.\n * @function decode\n * @memberof RPC\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC} RPC\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n RPC.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.subscriptions && m.subscriptions.length))\n m.subscriptions = [];\n m.subscriptions.push($root.RPC.SubOpts.decode(r, r.uint32()));\n break;\n case 2:\n if (!(m.messages && m.messages.length))\n m.messages = [];\n m.messages.push($root.RPC.Message.decode(r, r.uint32()));\n break;\n case 3:\n m.control = $root.RPC.ControlMessage.decode(r, r.uint32());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a RPC message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC} RPC\n */\n RPC.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC)\n return d;\n var m = new $root.RPC();\n if (d.subscriptions) {\n if (!Array.isArray(d.subscriptions))\n throw TypeError(\".RPC.subscriptions: array expected\");\n m.subscriptions = [];\n for (var i = 0; i < d.subscriptions.length; ++i) {\n if (typeof d.subscriptions[i] !== \"object\")\n throw TypeError(\".RPC.subscriptions: object expected\");\n m.subscriptions[i] = $root.RPC.SubOpts.fromObject(d.subscriptions[i]);\n }\n }\n if (d.messages) {\n if (!Array.isArray(d.messages))\n throw TypeError(\".RPC.messages: array expected\");\n m.messages = [];\n for (var i = 0; i < d.messages.length; ++i) {\n if (typeof d.messages[i] !== \"object\")\n throw TypeError(\".RPC.messages: object expected\");\n m.messages[i] = $root.RPC.Message.fromObject(d.messages[i]);\n }\n }\n if (d.control != null) {\n if (typeof d.control !== \"object\")\n throw TypeError(\".RPC.control: object expected\");\n m.control = $root.RPC.ControlMessage.fromObject(d.control);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a RPC message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC\n * @static\n * @param {RPC} m RPC\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n RPC.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.subscriptions = [];\n d.messages = [];\n }\n if (m.subscriptions && m.subscriptions.length) {\n d.subscriptions = [];\n for (var j = 0; j < m.subscriptions.length; ++j) {\n d.subscriptions[j] = $root.RPC.SubOpts.toObject(m.subscriptions[j], o);\n }\n }\n if (m.messages && m.messages.length) {\n d.messages = [];\n for (var j = 0; j < m.messages.length; ++j) {\n d.messages[j] = $root.RPC.Message.toObject(m.messages[j], o);\n }\n }\n if (m.control != null && m.hasOwnProperty(\"control\")) {\n d.control = $root.RPC.ControlMessage.toObject(m.control, o);\n if (o.oneofs)\n d._control = \"control\";\n }\n return d;\n };\n\n /**\n * Converts this RPC to JSON.\n * @function toJSON\n * @memberof RPC\n * @instance\n * @returns {Object.} JSON object\n */\n RPC.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n RPC.SubOpts = (function() {\n\n /**\n * Properties of a SubOpts.\n * @memberof RPC\n * @interface ISubOpts\n * @property {boolean|null} [subscribe] SubOpts subscribe\n * @property {string|null} [topic] SubOpts topic\n */\n\n /**\n * Constructs a new SubOpts.\n * @memberof RPC\n * @classdesc Represents a SubOpts.\n * @implements ISubOpts\n * @constructor\n * @param {RPC.ISubOpts=} [p] Properties to set\n */\n function SubOpts(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * SubOpts subscribe.\n * @member {boolean|null|undefined} subscribe\n * @memberof RPC.SubOpts\n * @instance\n */\n SubOpts.prototype.subscribe = null;\n\n /**\n * SubOpts topic.\n * @member {string|null|undefined} topic\n * @memberof RPC.SubOpts\n * @instance\n */\n SubOpts.prototype.topic = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * SubOpts _subscribe.\n * @member {\"subscribe\"|undefined} _subscribe\n * @memberof RPC.SubOpts\n * @instance\n */\n Object.defineProperty(SubOpts.prototype, \"_subscribe\", {\n get: $util.oneOfGetter($oneOfFields = [\"subscribe\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * SubOpts _topic.\n * @member {\"topic\"|undefined} _topic\n * @memberof RPC.SubOpts\n * @instance\n */\n Object.defineProperty(SubOpts.prototype, \"_topic\", {\n get: $util.oneOfGetter($oneOfFields = [\"topic\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified SubOpts message. Does not implicitly {@link RPC.SubOpts.verify|verify} messages.\n * @function encode\n * @memberof RPC.SubOpts\n * @static\n * @param {RPC.ISubOpts} m SubOpts message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SubOpts.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.subscribe != null && Object.hasOwnProperty.call(m, \"subscribe\"))\n w.uint32(8).bool(m.subscribe);\n if (m.topic != null && Object.hasOwnProperty.call(m, \"topic\"))\n w.uint32(18).string(m.topic);\n return w;\n };\n\n /**\n * Decodes a SubOpts message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.SubOpts\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.SubOpts} SubOpts\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SubOpts.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.SubOpts();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.subscribe = r.bool();\n break;\n case 2:\n m.topic = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a SubOpts message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.SubOpts\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.SubOpts} SubOpts\n */\n SubOpts.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.SubOpts)\n return d;\n var m = new $root.RPC.SubOpts();\n if (d.subscribe != null) {\n m.subscribe = Boolean(d.subscribe);\n }\n if (d.topic != null) {\n m.topic = String(d.topic);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a SubOpts message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.SubOpts\n * @static\n * @param {RPC.SubOpts} m SubOpts\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n SubOpts.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (m.subscribe != null && m.hasOwnProperty(\"subscribe\")) {\n d.subscribe = m.subscribe;\n if (o.oneofs)\n d._subscribe = \"subscribe\";\n }\n if (m.topic != null && m.hasOwnProperty(\"topic\")) {\n d.topic = m.topic;\n if (o.oneofs)\n d._topic = \"topic\";\n }\n return d;\n };\n\n /**\n * Converts this SubOpts to JSON.\n * @function toJSON\n * @memberof RPC.SubOpts\n * @instance\n * @returns {Object.} JSON object\n */\n SubOpts.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return SubOpts;\n })();\n\n RPC.Message = (function() {\n\n /**\n * Properties of a Message.\n * @memberof RPC\n * @interface IMessage\n * @property {Uint8Array|null} [from] Message from\n * @property {Uint8Array|null} [data] Message data\n * @property {Uint8Array|null} [seqno] Message seqno\n * @property {string} topic Message topic\n * @property {Uint8Array|null} [signature] Message signature\n * @property {Uint8Array|null} [key] Message key\n */\n\n /**\n * Constructs a new Message.\n * @memberof RPC\n * @classdesc Represents a Message.\n * @implements IMessage\n * @constructor\n * @param {RPC.IMessage=} [p] Properties to set\n */\n function Message(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * Message from.\n * @member {Uint8Array|null|undefined} from\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.from = null;\n\n /**\n * Message data.\n * @member {Uint8Array|null|undefined} data\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.data = null;\n\n /**\n * Message seqno.\n * @member {Uint8Array|null|undefined} seqno\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.seqno = null;\n\n /**\n * Message topic.\n * @member {string} topic\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.topic = \"\";\n\n /**\n * Message signature.\n * @member {Uint8Array|null|undefined} signature\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.signature = null;\n\n /**\n * Message key.\n * @member {Uint8Array|null|undefined} key\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.key = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * Message _from.\n * @member {\"from\"|undefined} _from\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_from\", {\n get: $util.oneOfGetter($oneOfFields = [\"from\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _data.\n * @member {\"data\"|undefined} _data\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_data\", {\n get: $util.oneOfGetter($oneOfFields = [\"data\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _seqno.\n * @member {\"seqno\"|undefined} _seqno\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_seqno\", {\n get: $util.oneOfGetter($oneOfFields = [\"seqno\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _signature.\n * @member {\"signature\"|undefined} _signature\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_signature\", {\n get: $util.oneOfGetter($oneOfFields = [\"signature\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _key.\n * @member {\"key\"|undefined} _key\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_key\", {\n get: $util.oneOfGetter($oneOfFields = [\"key\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified Message message. Does not implicitly {@link RPC.Message.verify|verify} messages.\n * @function encode\n * @memberof RPC.Message\n * @static\n * @param {RPC.IMessage} m Message message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Message.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.from != null && Object.hasOwnProperty.call(m, \"from\"))\n w.uint32(10).bytes(m.from);\n if (m.data != null && Object.hasOwnProperty.call(m, \"data\"))\n w.uint32(18).bytes(m.data);\n if (m.seqno != null && Object.hasOwnProperty.call(m, \"seqno\"))\n w.uint32(26).bytes(m.seqno);\n w.uint32(34).string(m.topic);\n if (m.signature != null && Object.hasOwnProperty.call(m, \"signature\"))\n w.uint32(42).bytes(m.signature);\n if (m.key != null && Object.hasOwnProperty.call(m, \"key\"))\n w.uint32(50).bytes(m.key);\n return w;\n };\n\n /**\n * Decodes a Message message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.Message\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.Message} Message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Message.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.Message();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.from = r.bytes();\n break;\n case 2:\n m.data = r.bytes();\n break;\n case 3:\n m.seqno = r.bytes();\n break;\n case 4:\n m.topic = r.string();\n break;\n case 5:\n m.signature = r.bytes();\n break;\n case 6:\n m.key = r.bytes();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n if (!m.hasOwnProperty(\"topic\"))\n throw $util.ProtocolError(\"missing required 'topic'\", { instance: m });\n return m;\n };\n\n /**\n * Creates a Message message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.Message\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.Message} Message\n */\n Message.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.Message)\n return d;\n var m = new $root.RPC.Message();\n if (d.from != null) {\n if (typeof d.from === \"string\")\n $util.base64.decode(d.from, m.from = $util.newBuffer($util.base64.length(d.from)), 0);\n else if (d.from.length)\n m.from = d.from;\n }\n if (d.data != null) {\n if (typeof d.data === \"string\")\n $util.base64.decode(d.data, m.data = $util.newBuffer($util.base64.length(d.data)), 0);\n else if (d.data.length)\n m.data = d.data;\n }\n if (d.seqno != null) {\n if (typeof d.seqno === \"string\")\n $util.base64.decode(d.seqno, m.seqno = $util.newBuffer($util.base64.length(d.seqno)), 0);\n else if (d.seqno.length)\n m.seqno = d.seqno;\n }\n if (d.topic != null) {\n m.topic = String(d.topic);\n }\n if (d.signature != null) {\n if (typeof d.signature === \"string\")\n $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);\n else if (d.signature.length)\n m.signature = d.signature;\n }\n if (d.key != null) {\n if (typeof d.key === \"string\")\n $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0);\n else if (d.key.length)\n m.key = d.key;\n }\n return m;\n };\n\n /**\n * Creates a plain object from a Message message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.Message\n * @static\n * @param {RPC.Message} m Message\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n Message.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.defaults) {\n d.topic = \"\";\n }\n if (m.from != null && m.hasOwnProperty(\"from\")) {\n d.from = o.bytes === String ? $util.base64.encode(m.from, 0, m.from.length) : o.bytes === Array ? Array.prototype.slice.call(m.from) : m.from;\n if (o.oneofs)\n d._from = \"from\";\n }\n if (m.data != null && m.hasOwnProperty(\"data\")) {\n d.data = o.bytes === String ? $util.base64.encode(m.data, 0, m.data.length) : o.bytes === Array ? Array.prototype.slice.call(m.data) : m.data;\n if (o.oneofs)\n d._data = \"data\";\n }\n if (m.seqno != null && m.hasOwnProperty(\"seqno\")) {\n d.seqno = o.bytes === String ? $util.base64.encode(m.seqno, 0, m.seqno.length) : o.bytes === Array ? Array.prototype.slice.call(m.seqno) : m.seqno;\n if (o.oneofs)\n d._seqno = \"seqno\";\n }\n if (m.topic != null && m.hasOwnProperty(\"topic\")) {\n d.topic = m.topic;\n }\n if (m.signature != null && m.hasOwnProperty(\"signature\")) {\n d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;\n if (o.oneofs)\n d._signature = \"signature\";\n }\n if (m.key != null && m.hasOwnProperty(\"key\")) {\n d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key;\n if (o.oneofs)\n d._key = \"key\";\n }\n return d;\n };\n\n /**\n * Converts this Message to JSON.\n * @function toJSON\n * @memberof RPC.Message\n * @instance\n * @returns {Object.} JSON object\n */\n Message.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return Message;\n })();\n\n RPC.ControlMessage = (function() {\n\n /**\n * Properties of a ControlMessage.\n * @memberof RPC\n * @interface IControlMessage\n * @property {Array.|null} [ihave] ControlMessage ihave\n * @property {Array.|null} [iwant] ControlMessage iwant\n * @property {Array.|null} [graft] ControlMessage graft\n * @property {Array.|null} [prune] ControlMessage prune\n */\n\n /**\n * Constructs a new ControlMessage.\n * @memberof RPC\n * @classdesc Represents a ControlMessage.\n * @implements IControlMessage\n * @constructor\n * @param {RPC.IControlMessage=} [p] Properties to set\n */\n function ControlMessage(p) {\n this.ihave = [];\n this.iwant = [];\n this.graft = [];\n this.prune = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlMessage ihave.\n * @member {Array.} ihave\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.ihave = $util.emptyArray;\n\n /**\n * ControlMessage iwant.\n * @member {Array.} iwant\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.iwant = $util.emptyArray;\n\n /**\n * ControlMessage graft.\n * @member {Array.} graft\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.graft = $util.emptyArray;\n\n /**\n * ControlMessage prune.\n * @member {Array.} prune\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.prune = $util.emptyArray;\n\n /**\n * Encodes the specified ControlMessage message. Does not implicitly {@link RPC.ControlMessage.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlMessage\n * @static\n * @param {RPC.IControlMessage} m ControlMessage message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlMessage.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.ihave != null && m.ihave.length) {\n for (var i = 0; i < m.ihave.length; ++i)\n $root.RPC.ControlIHave.encode(m.ihave[i], w.uint32(10).fork()).ldelim();\n }\n if (m.iwant != null && m.iwant.length) {\n for (var i = 0; i < m.iwant.length; ++i)\n $root.RPC.ControlIWant.encode(m.iwant[i], w.uint32(18).fork()).ldelim();\n }\n if (m.graft != null && m.graft.length) {\n for (var i = 0; i < m.graft.length; ++i)\n $root.RPC.ControlGraft.encode(m.graft[i], w.uint32(26).fork()).ldelim();\n }\n if (m.prune != null && m.prune.length) {\n for (var i = 0; i < m.prune.length; ++i)\n $root.RPC.ControlPrune.encode(m.prune[i], w.uint32(34).fork()).ldelim();\n }\n return w;\n };\n\n /**\n * Decodes a ControlMessage message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlMessage\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlMessage} ControlMessage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlMessage.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlMessage();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.ihave && m.ihave.length))\n m.ihave = [];\n m.ihave.push($root.RPC.ControlIHave.decode(r, r.uint32()));\n break;\n case 2:\n if (!(m.iwant && m.iwant.length))\n m.iwant = [];\n m.iwant.push($root.RPC.ControlIWant.decode(r, r.uint32()));\n break;\n case 3:\n if (!(m.graft && m.graft.length))\n m.graft = [];\n m.graft.push($root.RPC.ControlGraft.decode(r, r.uint32()));\n break;\n case 4:\n if (!(m.prune && m.prune.length))\n m.prune = [];\n m.prune.push($root.RPC.ControlPrune.decode(r, r.uint32()));\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlMessage message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlMessage\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlMessage} ControlMessage\n */\n ControlMessage.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlMessage)\n return d;\n var m = new $root.RPC.ControlMessage();\n if (d.ihave) {\n if (!Array.isArray(d.ihave))\n throw TypeError(\".RPC.ControlMessage.ihave: array expected\");\n m.ihave = [];\n for (var i = 0; i < d.ihave.length; ++i) {\n if (typeof d.ihave[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.ihave: object expected\");\n m.ihave[i] = $root.RPC.ControlIHave.fromObject(d.ihave[i]);\n }\n }\n if (d.iwant) {\n if (!Array.isArray(d.iwant))\n throw TypeError(\".RPC.ControlMessage.iwant: array expected\");\n m.iwant = [];\n for (var i = 0; i < d.iwant.length; ++i) {\n if (typeof d.iwant[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.iwant: object expected\");\n m.iwant[i] = $root.RPC.ControlIWant.fromObject(d.iwant[i]);\n }\n }\n if (d.graft) {\n if (!Array.isArray(d.graft))\n throw TypeError(\".RPC.ControlMessage.graft: array expected\");\n m.graft = [];\n for (var i = 0; i < d.graft.length; ++i) {\n if (typeof d.graft[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.graft: object expected\");\n m.graft[i] = $root.RPC.ControlGraft.fromObject(d.graft[i]);\n }\n }\n if (d.prune) {\n if (!Array.isArray(d.prune))\n throw TypeError(\".RPC.ControlMessage.prune: array expected\");\n m.prune = [];\n for (var i = 0; i < d.prune.length; ++i) {\n if (typeof d.prune[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.prune: object expected\");\n m.prune[i] = $root.RPC.ControlPrune.fromObject(d.prune[i]);\n }\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlMessage message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlMessage\n * @static\n * @param {RPC.ControlMessage} m ControlMessage\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlMessage.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.ihave = [];\n d.iwant = [];\n d.graft = [];\n d.prune = [];\n }\n if (m.ihave && m.ihave.length) {\n d.ihave = [];\n for (var j = 0; j < m.ihave.length; ++j) {\n d.ihave[j] = $root.RPC.ControlIHave.toObject(m.ihave[j], o);\n }\n }\n if (m.iwant && m.iwant.length) {\n d.iwant = [];\n for (var j = 0; j < m.iwant.length; ++j) {\n d.iwant[j] = $root.RPC.ControlIWant.toObject(m.iwant[j], o);\n }\n }\n if (m.graft && m.graft.length) {\n d.graft = [];\n for (var j = 0; j < m.graft.length; ++j) {\n d.graft[j] = $root.RPC.ControlGraft.toObject(m.graft[j], o);\n }\n }\n if (m.prune && m.prune.length) {\n d.prune = [];\n for (var j = 0; j < m.prune.length; ++j) {\n d.prune[j] = $root.RPC.ControlPrune.toObject(m.prune[j], o);\n }\n }\n return d;\n };\n\n /**\n * Converts this ControlMessage to JSON.\n * @function toJSON\n * @memberof RPC.ControlMessage\n * @instance\n * @returns {Object.} JSON object\n */\n ControlMessage.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlMessage;\n })();\n\n RPC.ControlIHave = (function() {\n\n /**\n * Properties of a ControlIHave.\n * @memberof RPC\n * @interface IControlIHave\n * @property {string|null} [topicID] ControlIHave topicID\n * @property {Array.|null} [messageIDs] ControlIHave messageIDs\n */\n\n /**\n * Constructs a new ControlIHave.\n * @memberof RPC\n * @classdesc Represents a ControlIHave.\n * @implements IControlIHave\n * @constructor\n * @param {RPC.IControlIHave=} [p] Properties to set\n */\n function ControlIHave(p) {\n this.messageIDs = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlIHave topicID.\n * @member {string|null|undefined} topicID\n * @memberof RPC.ControlIHave\n * @instance\n */\n ControlIHave.prototype.topicID = null;\n\n /**\n * ControlIHave messageIDs.\n * @member {Array.} messageIDs\n * @memberof RPC.ControlIHave\n * @instance\n */\n ControlIHave.prototype.messageIDs = $util.emptyArray;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * ControlIHave _topicID.\n * @member {\"topicID\"|undefined} _topicID\n * @memberof RPC.ControlIHave\n * @instance\n */\n Object.defineProperty(ControlIHave.prototype, \"_topicID\", {\n get: $util.oneOfGetter($oneOfFields = [\"topicID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified ControlIHave message. Does not implicitly {@link RPC.ControlIHave.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlIHave\n * @static\n * @param {RPC.IControlIHave} m ControlIHave message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlIHave.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.topicID != null && Object.hasOwnProperty.call(m, \"topicID\"))\n w.uint32(10).string(m.topicID);\n if (m.messageIDs != null && m.messageIDs.length) {\n for (var i = 0; i < m.messageIDs.length; ++i)\n w.uint32(18).bytes(m.messageIDs[i]);\n }\n return w;\n };\n\n /**\n * Decodes a ControlIHave message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlIHave\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlIHave} ControlIHave\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlIHave.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlIHave();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n case 2:\n if (!(m.messageIDs && m.messageIDs.length))\n m.messageIDs = [];\n m.messageIDs.push(r.bytes());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlIHave message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlIHave\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlIHave} ControlIHave\n */\n ControlIHave.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlIHave)\n return d;\n var m = new $root.RPC.ControlIHave();\n if (d.topicID != null) {\n m.topicID = String(d.topicID);\n }\n if (d.messageIDs) {\n if (!Array.isArray(d.messageIDs))\n throw TypeError(\".RPC.ControlIHave.messageIDs: array expected\");\n m.messageIDs = [];\n for (var i = 0; i < d.messageIDs.length; ++i) {\n if (typeof d.messageIDs[i] === \"string\")\n $util.base64.decode(d.messageIDs[i], m.messageIDs[i] = $util.newBuffer($util.base64.length(d.messageIDs[i])), 0);\n else if (d.messageIDs[i].length)\n m.messageIDs[i] = d.messageIDs[i];\n }\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlIHave message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlIHave\n * @static\n * @param {RPC.ControlIHave} m ControlIHave\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlIHave.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.messageIDs = [];\n }\n if (m.topicID != null && m.hasOwnProperty(\"topicID\")) {\n d.topicID = m.topicID;\n if (o.oneofs)\n d._topicID = \"topicID\";\n }\n if (m.messageIDs && m.messageIDs.length) {\n d.messageIDs = [];\n for (var j = 0; j < m.messageIDs.length; ++j) {\n d.messageIDs[j] = o.bytes === String ? $util.base64.encode(m.messageIDs[j], 0, m.messageIDs[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.messageIDs[j]) : m.messageIDs[j];\n }\n }\n return d;\n };\n\n /**\n * Converts this ControlIHave to JSON.\n * @function toJSON\n * @memberof RPC.ControlIHave\n * @instance\n * @returns {Object.} JSON object\n */\n ControlIHave.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlIHave;\n })();\n\n RPC.ControlIWant = (function() {\n\n /**\n * Properties of a ControlIWant.\n * @memberof RPC\n * @interface IControlIWant\n * @property {Array.|null} [messageIDs] ControlIWant messageIDs\n */\n\n /**\n * Constructs a new ControlIWant.\n * @memberof RPC\n * @classdesc Represents a ControlIWant.\n * @implements IControlIWant\n * @constructor\n * @param {RPC.IControlIWant=} [p] Properties to set\n */\n function ControlIWant(p) {\n this.messageIDs = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlIWant messageIDs.\n * @member {Array.} messageIDs\n * @memberof RPC.ControlIWant\n * @instance\n */\n ControlIWant.prototype.messageIDs = $util.emptyArray;\n\n /**\n * Encodes the specified ControlIWant message. Does not implicitly {@link RPC.ControlIWant.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlIWant\n * @static\n * @param {RPC.IControlIWant} m ControlIWant message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlIWant.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.messageIDs != null && m.messageIDs.length) {\n for (var i = 0; i < m.messageIDs.length; ++i)\n w.uint32(10).bytes(m.messageIDs[i]);\n }\n return w;\n };\n\n /**\n * Decodes a ControlIWant message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlIWant\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlIWant} ControlIWant\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlIWant.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlIWant();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.messageIDs && m.messageIDs.length))\n m.messageIDs = [];\n m.messageIDs.push(r.bytes());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlIWant message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlIWant\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlIWant} ControlIWant\n */\n ControlIWant.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlIWant)\n return d;\n var m = new $root.RPC.ControlIWant();\n if (d.messageIDs) {\n if (!Array.isArray(d.messageIDs))\n throw TypeError(\".RPC.ControlIWant.messageIDs: array expected\");\n m.messageIDs = [];\n for (var i = 0; i < d.messageIDs.length; ++i) {\n if (typeof d.messageIDs[i] === \"string\")\n $util.base64.decode(d.messageIDs[i], m.messageIDs[i] = $util.newBuffer($util.base64.length(d.messageIDs[i])), 0);\n else if (d.messageIDs[i].length)\n m.messageIDs[i] = d.messageIDs[i];\n }\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlIWant message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlIWant\n * @static\n * @param {RPC.ControlIWant} m ControlIWant\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlIWant.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.messageIDs = [];\n }\n if (m.messageIDs && m.messageIDs.length) {\n d.messageIDs = [];\n for (var j = 0; j < m.messageIDs.length; ++j) {\n d.messageIDs[j] = o.bytes === String ? $util.base64.encode(m.messageIDs[j], 0, m.messageIDs[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.messageIDs[j]) : m.messageIDs[j];\n }\n }\n return d;\n };\n\n /**\n * Converts this ControlIWant to JSON.\n * @function toJSON\n * @memberof RPC.ControlIWant\n * @instance\n * @returns {Object.} JSON object\n */\n ControlIWant.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlIWant;\n })();\n\n RPC.ControlGraft = (function() {\n\n /**\n * Properties of a ControlGraft.\n * @memberof RPC\n * @interface IControlGraft\n * @property {string|null} [topicID] ControlGraft topicID\n */\n\n /**\n * Constructs a new ControlGraft.\n * @memberof RPC\n * @classdesc Represents a ControlGraft.\n * @implements IControlGraft\n * @constructor\n * @param {RPC.IControlGraft=} [p] Properties to set\n */\n function ControlGraft(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlGraft topicID.\n * @member {string|null|undefined} topicID\n * @memberof RPC.ControlGraft\n * @instance\n */\n ControlGraft.prototype.topicID = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * ControlGraft _topicID.\n * @member {\"topicID\"|undefined} _topicID\n * @memberof RPC.ControlGraft\n * @instance\n */\n Object.defineProperty(ControlGraft.prototype, \"_topicID\", {\n get: $util.oneOfGetter($oneOfFields = [\"topicID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified ControlGraft message. Does not implicitly {@link RPC.ControlGraft.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlGraft\n * @static\n * @param {RPC.IControlGraft} m ControlGraft message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlGraft.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.topicID != null && Object.hasOwnProperty.call(m, \"topicID\"))\n w.uint32(10).string(m.topicID);\n return w;\n };\n\n /**\n * Decodes a ControlGraft message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlGraft\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlGraft} ControlGraft\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlGraft.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlGraft();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlGraft message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlGraft\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlGraft} ControlGraft\n */\n ControlGraft.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlGraft)\n return d;\n var m = new $root.RPC.ControlGraft();\n if (d.topicID != null) {\n m.topicID = String(d.topicID);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlGraft message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlGraft\n * @static\n * @param {RPC.ControlGraft} m ControlGraft\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlGraft.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (m.topicID != null && m.hasOwnProperty(\"topicID\")) {\n d.topicID = m.topicID;\n if (o.oneofs)\n d._topicID = \"topicID\";\n }\n return d;\n };\n\n /**\n * Converts this ControlGraft to JSON.\n * @function toJSON\n * @memberof RPC.ControlGraft\n * @instance\n * @returns {Object.} JSON object\n */\n ControlGraft.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlGraft;\n })();\n\n RPC.ControlPrune = (function() {\n\n /**\n * Properties of a ControlPrune.\n * @memberof RPC\n * @interface IControlPrune\n * @property {string|null} [topicID] ControlPrune topicID\n * @property {Array.|null} [peers] ControlPrune peers\n * @property {number|null} [backoff] ControlPrune backoff\n */\n\n /**\n * Constructs a new ControlPrune.\n * @memberof RPC\n * @classdesc Represents a ControlPrune.\n * @implements IControlPrune\n * @constructor\n * @param {RPC.IControlPrune=} [p] Properties to set\n */\n function ControlPrune(p) {\n this.peers = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlPrune topicID.\n * @member {string|null|undefined} topicID\n * @memberof RPC.ControlPrune\n * @instance\n */\n ControlPrune.prototype.topicID = null;\n\n /**\n * ControlPrune peers.\n * @member {Array.} peers\n * @memberof RPC.ControlPrune\n * @instance\n */\n ControlPrune.prototype.peers = $util.emptyArray;\n\n /**\n * ControlPrune backoff.\n * @member {number|null|undefined} backoff\n * @memberof RPC.ControlPrune\n * @instance\n */\n ControlPrune.prototype.backoff = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * ControlPrune _topicID.\n * @member {\"topicID\"|undefined} _topicID\n * @memberof RPC.ControlPrune\n * @instance\n */\n Object.defineProperty(ControlPrune.prototype, \"_topicID\", {\n get: $util.oneOfGetter($oneOfFields = [\"topicID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * ControlPrune _backoff.\n * @member {\"backoff\"|undefined} _backoff\n * @memberof RPC.ControlPrune\n * @instance\n */\n Object.defineProperty(ControlPrune.prototype, \"_backoff\", {\n get: $util.oneOfGetter($oneOfFields = [\"backoff\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified ControlPrune message. Does not implicitly {@link RPC.ControlPrune.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlPrune\n * @static\n * @param {RPC.IControlPrune} m ControlPrune message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlPrune.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.topicID != null && Object.hasOwnProperty.call(m, \"topicID\"))\n w.uint32(10).string(m.topicID);\n if (m.peers != null && m.peers.length) {\n for (var i = 0; i < m.peers.length; ++i)\n $root.RPC.PeerInfo.encode(m.peers[i], w.uint32(18).fork()).ldelim();\n }\n if (m.backoff != null && Object.hasOwnProperty.call(m, \"backoff\"))\n w.uint32(24).uint64(m.backoff);\n return w;\n };\n\n /**\n * Decodes a ControlPrune message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlPrune\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlPrune} ControlPrune\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlPrune.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlPrune();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n case 2:\n if (!(m.peers && m.peers.length))\n m.peers = [];\n m.peers.push($root.RPC.PeerInfo.decode(r, r.uint32()));\n break;\n case 3:\n m.backoff = r.uint64();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlPrune message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlPrune\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlPrune} ControlPrune\n */\n ControlPrune.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlPrune)\n return d;\n var m = new $root.RPC.ControlPrune();\n if (d.topicID != null) {\n m.topicID = String(d.topicID);\n }\n if (d.peers) {\n if (!Array.isArray(d.peers))\n throw TypeError(\".RPC.ControlPrune.peers: array expected\");\n m.peers = [];\n for (var i = 0; i < d.peers.length; ++i) {\n if (typeof d.peers[i] !== \"object\")\n throw TypeError(\".RPC.ControlPrune.peers: object expected\");\n m.peers[i] = $root.RPC.PeerInfo.fromObject(d.peers[i]);\n }\n }\n if (d.backoff != null) {\n if ($util.Long)\n (m.backoff = $util.Long.fromValue(d.backoff)).unsigned = true;\n else if (typeof d.backoff === \"string\")\n m.backoff = parseInt(d.backoff, 10);\n else if (typeof d.backoff === \"number\")\n m.backoff = d.backoff;\n else if (typeof d.backoff === \"object\")\n m.backoff = new $util.LongBits(d.backoff.low >>> 0, d.backoff.high >>> 0).toNumber(true);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlPrune message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlPrune\n * @static\n * @param {RPC.ControlPrune} m ControlPrune\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlPrune.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.peers = [];\n }\n if (m.topicID != null && m.hasOwnProperty(\"topicID\")) {\n d.topicID = m.topicID;\n if (o.oneofs)\n d._topicID = \"topicID\";\n }\n if (m.peers && m.peers.length) {\n d.peers = [];\n for (var j = 0; j < m.peers.length; ++j) {\n d.peers[j] = $root.RPC.PeerInfo.toObject(m.peers[j], o);\n }\n }\n if (m.backoff != null && m.hasOwnProperty(\"backoff\")) {\n if (typeof m.backoff === \"number\")\n d.backoff = o.longs === String ? String(m.backoff) : m.backoff;\n else\n d.backoff = o.longs === String ? $util.Long.prototype.toString.call(m.backoff) : o.longs === Number ? new $util.LongBits(m.backoff.low >>> 0, m.backoff.high >>> 0).toNumber(true) : m.backoff;\n if (o.oneofs)\n d._backoff = \"backoff\";\n }\n return d;\n };\n\n /**\n * Converts this ControlPrune to JSON.\n * @function toJSON\n * @memberof RPC.ControlPrune\n * @instance\n * @returns {Object.} JSON object\n */\n ControlPrune.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlPrune;\n })();\n\n RPC.PeerInfo = (function() {\n\n /**\n * Properties of a PeerInfo.\n * @memberof RPC\n * @interface IPeerInfo\n * @property {Uint8Array|null} [peerID] PeerInfo peerID\n * @property {Uint8Array|null} [signedPeerRecord] PeerInfo signedPeerRecord\n */\n\n /**\n * Constructs a new PeerInfo.\n * @memberof RPC\n * @classdesc Represents a PeerInfo.\n * @implements IPeerInfo\n * @constructor\n * @param {RPC.IPeerInfo=} [p] Properties to set\n */\n function PeerInfo(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * PeerInfo peerID.\n * @member {Uint8Array|null|undefined} peerID\n * @memberof RPC.PeerInfo\n * @instance\n */\n PeerInfo.prototype.peerID = null;\n\n /**\n * PeerInfo signedPeerRecord.\n * @member {Uint8Array|null|undefined} signedPeerRecord\n * @memberof RPC.PeerInfo\n * @instance\n */\n PeerInfo.prototype.signedPeerRecord = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * PeerInfo _peerID.\n * @member {\"peerID\"|undefined} _peerID\n * @memberof RPC.PeerInfo\n * @instance\n */\n Object.defineProperty(PeerInfo.prototype, \"_peerID\", {\n get: $util.oneOfGetter($oneOfFields = [\"peerID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * PeerInfo _signedPeerRecord.\n * @member {\"signedPeerRecord\"|undefined} _signedPeerRecord\n * @memberof RPC.PeerInfo\n * @instance\n */\n Object.defineProperty(PeerInfo.prototype, \"_signedPeerRecord\", {\n get: $util.oneOfGetter($oneOfFields = [\"signedPeerRecord\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified PeerInfo message. Does not implicitly {@link RPC.PeerInfo.verify|verify} messages.\n * @function encode\n * @memberof RPC.PeerInfo\n * @static\n * @param {RPC.IPeerInfo} m PeerInfo message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PeerInfo.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.peerID != null && Object.hasOwnProperty.call(m, \"peerID\"))\n w.uint32(10).bytes(m.peerID);\n if (m.signedPeerRecord != null && Object.hasOwnProperty.call(m, \"signedPeerRecord\"))\n w.uint32(18).bytes(m.signedPeerRecord);\n return w;\n };\n\n /**\n * Decodes a PeerInfo message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.PeerInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.PeerInfo} PeerInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PeerInfo.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.PeerInfo();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.peerID = r.bytes();\n break;\n case 2:\n m.signedPeerRecord = r.bytes();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.PeerInfo\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.PeerInfo} PeerInfo\n */\n PeerInfo.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.PeerInfo)\n return d;\n var m = new $root.RPC.PeerInfo();\n if (d.peerID != null) {\n if (typeof d.peerID === \"string\")\n $util.base64.decode(d.peerID, m.peerID = $util.newBuffer($util.base64.length(d.peerID)), 0);\n else if (d.peerID.length)\n m.peerID = d.peerID;\n }\n if (d.signedPeerRecord != null) {\n if (typeof d.signedPeerRecord === \"string\")\n $util.base64.decode(d.signedPeerRecord, m.signedPeerRecord = $util.newBuffer($util.base64.length(d.signedPeerRecord)), 0);\n else if (d.signedPeerRecord.length)\n m.signedPeerRecord = d.signedPeerRecord;\n }\n return m;\n };\n\n /**\n * Creates a plain object from a PeerInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.PeerInfo\n * @static\n * @param {RPC.PeerInfo} m PeerInfo\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n PeerInfo.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (m.peerID != null && m.hasOwnProperty(\"peerID\")) {\n d.peerID = o.bytes === String ? $util.base64.encode(m.peerID, 0, m.peerID.length) : o.bytes === Array ? Array.prototype.slice.call(m.peerID) : m.peerID;\n if (o.oneofs)\n d._peerID = \"peerID\";\n }\n if (m.signedPeerRecord != null && m.hasOwnProperty(\"signedPeerRecord\")) {\n d.signedPeerRecord = o.bytes === String ? $util.base64.encode(m.signedPeerRecord, 0, m.signedPeerRecord.length) : o.bytes === Array ? Array.prototype.slice.call(m.signedPeerRecord) : m.signedPeerRecord;\n if (o.oneofs)\n d._signedPeerRecord = \"signedPeerRecord\";\n }\n return d;\n };\n\n /**\n * Converts this PeerInfo to JSON.\n * @function toJSON\n * @memberof RPC.PeerInfo\n * @instance\n * @returns {Object.} JSON object\n */\n PeerInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return PeerInfo;\n })();\n\n return RPC;\n })();\n\n return $root;\n});\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@waku/core/node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.cjs?");
+eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// @ts-nocheck\n/*eslint-disable*/\n(function(global, factory) { /* global define, require, module */\n\n /* AMD */ if (true)\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! protobufjs/minimal */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/minimal.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n /* CommonJS */ else {}\n\n})(this, function($protobuf) {\n \"use strict\";\n\n // Common aliases\n var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n // Exported root namespace\n var $root = $protobuf.roots[\"default\"] || ($protobuf.roots[\"default\"] = {});\n\n $root.RPC = (function() {\n\n /**\n * Properties of a RPC.\n * @exports IRPC\n * @interface IRPC\n * @property {Array.|null} [subscriptions] RPC subscriptions\n * @property {Array.|null} [messages] RPC messages\n * @property {RPC.IControlMessage|null} [control] RPC control\n */\n\n /**\n * Constructs a new RPC.\n * @exports RPC\n * @classdesc Represents a RPC.\n * @implements IRPC\n * @constructor\n * @param {IRPC=} [p] Properties to set\n */\n function RPC(p) {\n this.subscriptions = [];\n this.messages = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * RPC subscriptions.\n * @member {Array.} subscriptions\n * @memberof RPC\n * @instance\n */\n RPC.prototype.subscriptions = $util.emptyArray;\n\n /**\n * RPC messages.\n * @member {Array.} messages\n * @memberof RPC\n * @instance\n */\n RPC.prototype.messages = $util.emptyArray;\n\n /**\n * RPC control.\n * @member {RPC.IControlMessage|null|undefined} control\n * @memberof RPC\n * @instance\n */\n RPC.prototype.control = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * RPC _control.\n * @member {\"control\"|undefined} _control\n * @memberof RPC\n * @instance\n */\n Object.defineProperty(RPC.prototype, \"_control\", {\n get: $util.oneOfGetter($oneOfFields = [\"control\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified RPC message. Does not implicitly {@link RPC.verify|verify} messages.\n * @function encode\n * @memberof RPC\n * @static\n * @param {IRPC} m RPC message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n RPC.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.subscriptions != null && m.subscriptions.length) {\n for (var i = 0; i < m.subscriptions.length; ++i)\n $root.RPC.SubOpts.encode(m.subscriptions[i], w.uint32(10).fork()).ldelim();\n }\n if (m.messages != null && m.messages.length) {\n for (var i = 0; i < m.messages.length; ++i)\n $root.RPC.Message.encode(m.messages[i], w.uint32(18).fork()).ldelim();\n }\n if (m.control != null && Object.hasOwnProperty.call(m, \"control\"))\n $root.RPC.ControlMessage.encode(m.control, w.uint32(26).fork()).ldelim();\n return w;\n };\n\n /**\n * Decodes a RPC message from the specified reader or buffer.\n * @function decode\n * @memberof RPC\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC} RPC\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n RPC.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.subscriptions && m.subscriptions.length))\n m.subscriptions = [];\n m.subscriptions.push($root.RPC.SubOpts.decode(r, r.uint32()));\n break;\n case 2:\n if (!(m.messages && m.messages.length))\n m.messages = [];\n m.messages.push($root.RPC.Message.decode(r, r.uint32()));\n break;\n case 3:\n m.control = $root.RPC.ControlMessage.decode(r, r.uint32());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a RPC message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC} RPC\n */\n RPC.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC)\n return d;\n var m = new $root.RPC();\n if (d.subscriptions) {\n if (!Array.isArray(d.subscriptions))\n throw TypeError(\".RPC.subscriptions: array expected\");\n m.subscriptions = [];\n for (var i = 0; i < d.subscriptions.length; ++i) {\n if (typeof d.subscriptions[i] !== \"object\")\n throw TypeError(\".RPC.subscriptions: object expected\");\n m.subscriptions[i] = $root.RPC.SubOpts.fromObject(d.subscriptions[i]);\n }\n }\n if (d.messages) {\n if (!Array.isArray(d.messages))\n throw TypeError(\".RPC.messages: array expected\");\n m.messages = [];\n for (var i = 0; i < d.messages.length; ++i) {\n if (typeof d.messages[i] !== \"object\")\n throw TypeError(\".RPC.messages: object expected\");\n m.messages[i] = $root.RPC.Message.fromObject(d.messages[i]);\n }\n }\n if (d.control != null) {\n if (typeof d.control !== \"object\")\n throw TypeError(\".RPC.control: object expected\");\n m.control = $root.RPC.ControlMessage.fromObject(d.control);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a RPC message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC\n * @static\n * @param {RPC} m RPC\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n RPC.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.subscriptions = [];\n d.messages = [];\n }\n if (m.subscriptions && m.subscriptions.length) {\n d.subscriptions = [];\n for (var j = 0; j < m.subscriptions.length; ++j) {\n d.subscriptions[j] = $root.RPC.SubOpts.toObject(m.subscriptions[j], o);\n }\n }\n if (m.messages && m.messages.length) {\n d.messages = [];\n for (var j = 0; j < m.messages.length; ++j) {\n d.messages[j] = $root.RPC.Message.toObject(m.messages[j], o);\n }\n }\n if (m.control != null && m.hasOwnProperty(\"control\")) {\n d.control = $root.RPC.ControlMessage.toObject(m.control, o);\n if (o.oneofs)\n d._control = \"control\";\n }\n return d;\n };\n\n /**\n * Converts this RPC to JSON.\n * @function toJSON\n * @memberof RPC\n * @instance\n * @returns {Object.} JSON object\n */\n RPC.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n RPC.SubOpts = (function() {\n\n /**\n * Properties of a SubOpts.\n * @memberof RPC\n * @interface ISubOpts\n * @property {boolean|null} [subscribe] SubOpts subscribe\n * @property {string|null} [topic] SubOpts topic\n */\n\n /**\n * Constructs a new SubOpts.\n * @memberof RPC\n * @classdesc Represents a SubOpts.\n * @implements ISubOpts\n * @constructor\n * @param {RPC.ISubOpts=} [p] Properties to set\n */\n function SubOpts(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * SubOpts subscribe.\n * @member {boolean|null|undefined} subscribe\n * @memberof RPC.SubOpts\n * @instance\n */\n SubOpts.prototype.subscribe = null;\n\n /**\n * SubOpts topic.\n * @member {string|null|undefined} topic\n * @memberof RPC.SubOpts\n * @instance\n */\n SubOpts.prototype.topic = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * SubOpts _subscribe.\n * @member {\"subscribe\"|undefined} _subscribe\n * @memberof RPC.SubOpts\n * @instance\n */\n Object.defineProperty(SubOpts.prototype, \"_subscribe\", {\n get: $util.oneOfGetter($oneOfFields = [\"subscribe\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * SubOpts _topic.\n * @member {\"topic\"|undefined} _topic\n * @memberof RPC.SubOpts\n * @instance\n */\n Object.defineProperty(SubOpts.prototype, \"_topic\", {\n get: $util.oneOfGetter($oneOfFields = [\"topic\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified SubOpts message. Does not implicitly {@link RPC.SubOpts.verify|verify} messages.\n * @function encode\n * @memberof RPC.SubOpts\n * @static\n * @param {RPC.ISubOpts} m SubOpts message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n SubOpts.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.subscribe != null && Object.hasOwnProperty.call(m, \"subscribe\"))\n w.uint32(8).bool(m.subscribe);\n if (m.topic != null && Object.hasOwnProperty.call(m, \"topic\"))\n w.uint32(18).string(m.topic);\n return w;\n };\n\n /**\n * Decodes a SubOpts message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.SubOpts\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.SubOpts} SubOpts\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n SubOpts.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.SubOpts();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.subscribe = r.bool();\n break;\n case 2:\n m.topic = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a SubOpts message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.SubOpts\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.SubOpts} SubOpts\n */\n SubOpts.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.SubOpts)\n return d;\n var m = new $root.RPC.SubOpts();\n if (d.subscribe != null) {\n m.subscribe = Boolean(d.subscribe);\n }\n if (d.topic != null) {\n m.topic = String(d.topic);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a SubOpts message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.SubOpts\n * @static\n * @param {RPC.SubOpts} m SubOpts\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n SubOpts.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (m.subscribe != null && m.hasOwnProperty(\"subscribe\")) {\n d.subscribe = m.subscribe;\n if (o.oneofs)\n d._subscribe = \"subscribe\";\n }\n if (m.topic != null && m.hasOwnProperty(\"topic\")) {\n d.topic = m.topic;\n if (o.oneofs)\n d._topic = \"topic\";\n }\n return d;\n };\n\n /**\n * Converts this SubOpts to JSON.\n * @function toJSON\n * @memberof RPC.SubOpts\n * @instance\n * @returns {Object.} JSON object\n */\n SubOpts.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return SubOpts;\n })();\n\n RPC.Message = (function() {\n\n /**\n * Properties of a Message.\n * @memberof RPC\n * @interface IMessage\n * @property {Uint8Array|null} [from] Message from\n * @property {Uint8Array|null} [data] Message data\n * @property {Uint8Array|null} [seqno] Message seqno\n * @property {string} topic Message topic\n * @property {Uint8Array|null} [signature] Message signature\n * @property {Uint8Array|null} [key] Message key\n */\n\n /**\n * Constructs a new Message.\n * @memberof RPC\n * @classdesc Represents a Message.\n * @implements IMessage\n * @constructor\n * @param {RPC.IMessage=} [p] Properties to set\n */\n function Message(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * Message from.\n * @member {Uint8Array|null|undefined} from\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.from = null;\n\n /**\n * Message data.\n * @member {Uint8Array|null|undefined} data\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.data = null;\n\n /**\n * Message seqno.\n * @member {Uint8Array|null|undefined} seqno\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.seqno = null;\n\n /**\n * Message topic.\n * @member {string} topic\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.topic = \"\";\n\n /**\n * Message signature.\n * @member {Uint8Array|null|undefined} signature\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.signature = null;\n\n /**\n * Message key.\n * @member {Uint8Array|null|undefined} key\n * @memberof RPC.Message\n * @instance\n */\n Message.prototype.key = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * Message _from.\n * @member {\"from\"|undefined} _from\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_from\", {\n get: $util.oneOfGetter($oneOfFields = [\"from\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _data.\n * @member {\"data\"|undefined} _data\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_data\", {\n get: $util.oneOfGetter($oneOfFields = [\"data\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _seqno.\n * @member {\"seqno\"|undefined} _seqno\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_seqno\", {\n get: $util.oneOfGetter($oneOfFields = [\"seqno\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _signature.\n * @member {\"signature\"|undefined} _signature\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_signature\", {\n get: $util.oneOfGetter($oneOfFields = [\"signature\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Message _key.\n * @member {\"key\"|undefined} _key\n * @memberof RPC.Message\n * @instance\n */\n Object.defineProperty(Message.prototype, \"_key\", {\n get: $util.oneOfGetter($oneOfFields = [\"key\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified Message message. Does not implicitly {@link RPC.Message.verify|verify} messages.\n * @function encode\n * @memberof RPC.Message\n * @static\n * @param {RPC.IMessage} m Message message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n Message.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.from != null && Object.hasOwnProperty.call(m, \"from\"))\n w.uint32(10).bytes(m.from);\n if (m.data != null && Object.hasOwnProperty.call(m, \"data\"))\n w.uint32(18).bytes(m.data);\n if (m.seqno != null && Object.hasOwnProperty.call(m, \"seqno\"))\n w.uint32(26).bytes(m.seqno);\n w.uint32(34).string(m.topic);\n if (m.signature != null && Object.hasOwnProperty.call(m, \"signature\"))\n w.uint32(42).bytes(m.signature);\n if (m.key != null && Object.hasOwnProperty.call(m, \"key\"))\n w.uint32(50).bytes(m.key);\n return w;\n };\n\n /**\n * Decodes a Message message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.Message\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.Message} Message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n Message.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.Message();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.from = r.bytes();\n break;\n case 2:\n m.data = r.bytes();\n break;\n case 3:\n m.seqno = r.bytes();\n break;\n case 4:\n m.topic = r.string();\n break;\n case 5:\n m.signature = r.bytes();\n break;\n case 6:\n m.key = r.bytes();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n if (!m.hasOwnProperty(\"topic\"))\n throw $util.ProtocolError(\"missing required 'topic'\", { instance: m });\n return m;\n };\n\n /**\n * Creates a Message message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.Message\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.Message} Message\n */\n Message.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.Message)\n return d;\n var m = new $root.RPC.Message();\n if (d.from != null) {\n if (typeof d.from === \"string\")\n $util.base64.decode(d.from, m.from = $util.newBuffer($util.base64.length(d.from)), 0);\n else if (d.from.length)\n m.from = d.from;\n }\n if (d.data != null) {\n if (typeof d.data === \"string\")\n $util.base64.decode(d.data, m.data = $util.newBuffer($util.base64.length(d.data)), 0);\n else if (d.data.length)\n m.data = d.data;\n }\n if (d.seqno != null) {\n if (typeof d.seqno === \"string\")\n $util.base64.decode(d.seqno, m.seqno = $util.newBuffer($util.base64.length(d.seqno)), 0);\n else if (d.seqno.length)\n m.seqno = d.seqno;\n }\n if (d.topic != null) {\n m.topic = String(d.topic);\n }\n if (d.signature != null) {\n if (typeof d.signature === \"string\")\n $util.base64.decode(d.signature, m.signature = $util.newBuffer($util.base64.length(d.signature)), 0);\n else if (d.signature.length)\n m.signature = d.signature;\n }\n if (d.key != null) {\n if (typeof d.key === \"string\")\n $util.base64.decode(d.key, m.key = $util.newBuffer($util.base64.length(d.key)), 0);\n else if (d.key.length)\n m.key = d.key;\n }\n return m;\n };\n\n /**\n * Creates a plain object from a Message message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.Message\n * @static\n * @param {RPC.Message} m Message\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n Message.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.defaults) {\n d.topic = \"\";\n }\n if (m.from != null && m.hasOwnProperty(\"from\")) {\n d.from = o.bytes === String ? $util.base64.encode(m.from, 0, m.from.length) : o.bytes === Array ? Array.prototype.slice.call(m.from) : m.from;\n if (o.oneofs)\n d._from = \"from\";\n }\n if (m.data != null && m.hasOwnProperty(\"data\")) {\n d.data = o.bytes === String ? $util.base64.encode(m.data, 0, m.data.length) : o.bytes === Array ? Array.prototype.slice.call(m.data) : m.data;\n if (o.oneofs)\n d._data = \"data\";\n }\n if (m.seqno != null && m.hasOwnProperty(\"seqno\")) {\n d.seqno = o.bytes === String ? $util.base64.encode(m.seqno, 0, m.seqno.length) : o.bytes === Array ? Array.prototype.slice.call(m.seqno) : m.seqno;\n if (o.oneofs)\n d._seqno = \"seqno\";\n }\n if (m.topic != null && m.hasOwnProperty(\"topic\")) {\n d.topic = m.topic;\n }\n if (m.signature != null && m.hasOwnProperty(\"signature\")) {\n d.signature = o.bytes === String ? $util.base64.encode(m.signature, 0, m.signature.length) : o.bytes === Array ? Array.prototype.slice.call(m.signature) : m.signature;\n if (o.oneofs)\n d._signature = \"signature\";\n }\n if (m.key != null && m.hasOwnProperty(\"key\")) {\n d.key = o.bytes === String ? $util.base64.encode(m.key, 0, m.key.length) : o.bytes === Array ? Array.prototype.slice.call(m.key) : m.key;\n if (o.oneofs)\n d._key = \"key\";\n }\n return d;\n };\n\n /**\n * Converts this Message to JSON.\n * @function toJSON\n * @memberof RPC.Message\n * @instance\n * @returns {Object.} JSON object\n */\n Message.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return Message;\n })();\n\n RPC.ControlMessage = (function() {\n\n /**\n * Properties of a ControlMessage.\n * @memberof RPC\n * @interface IControlMessage\n * @property {Array.|null} [ihave] ControlMessage ihave\n * @property {Array.|null} [iwant] ControlMessage iwant\n * @property {Array.|null} [graft] ControlMessage graft\n * @property {Array.|null} [prune] ControlMessage prune\n */\n\n /**\n * Constructs a new ControlMessage.\n * @memberof RPC\n * @classdesc Represents a ControlMessage.\n * @implements IControlMessage\n * @constructor\n * @param {RPC.IControlMessage=} [p] Properties to set\n */\n function ControlMessage(p) {\n this.ihave = [];\n this.iwant = [];\n this.graft = [];\n this.prune = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlMessage ihave.\n * @member {Array.} ihave\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.ihave = $util.emptyArray;\n\n /**\n * ControlMessage iwant.\n * @member {Array.} iwant\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.iwant = $util.emptyArray;\n\n /**\n * ControlMessage graft.\n * @member {Array.} graft\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.graft = $util.emptyArray;\n\n /**\n * ControlMessage prune.\n * @member {Array.} prune\n * @memberof RPC.ControlMessage\n * @instance\n */\n ControlMessage.prototype.prune = $util.emptyArray;\n\n /**\n * Encodes the specified ControlMessage message. Does not implicitly {@link RPC.ControlMessage.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlMessage\n * @static\n * @param {RPC.IControlMessage} m ControlMessage message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlMessage.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.ihave != null && m.ihave.length) {\n for (var i = 0; i < m.ihave.length; ++i)\n $root.RPC.ControlIHave.encode(m.ihave[i], w.uint32(10).fork()).ldelim();\n }\n if (m.iwant != null && m.iwant.length) {\n for (var i = 0; i < m.iwant.length; ++i)\n $root.RPC.ControlIWant.encode(m.iwant[i], w.uint32(18).fork()).ldelim();\n }\n if (m.graft != null && m.graft.length) {\n for (var i = 0; i < m.graft.length; ++i)\n $root.RPC.ControlGraft.encode(m.graft[i], w.uint32(26).fork()).ldelim();\n }\n if (m.prune != null && m.prune.length) {\n for (var i = 0; i < m.prune.length; ++i)\n $root.RPC.ControlPrune.encode(m.prune[i], w.uint32(34).fork()).ldelim();\n }\n return w;\n };\n\n /**\n * Decodes a ControlMessage message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlMessage\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlMessage} ControlMessage\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlMessage.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlMessage();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.ihave && m.ihave.length))\n m.ihave = [];\n m.ihave.push($root.RPC.ControlIHave.decode(r, r.uint32()));\n break;\n case 2:\n if (!(m.iwant && m.iwant.length))\n m.iwant = [];\n m.iwant.push($root.RPC.ControlIWant.decode(r, r.uint32()));\n break;\n case 3:\n if (!(m.graft && m.graft.length))\n m.graft = [];\n m.graft.push($root.RPC.ControlGraft.decode(r, r.uint32()));\n break;\n case 4:\n if (!(m.prune && m.prune.length))\n m.prune = [];\n m.prune.push($root.RPC.ControlPrune.decode(r, r.uint32()));\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlMessage message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlMessage\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlMessage} ControlMessage\n */\n ControlMessage.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlMessage)\n return d;\n var m = new $root.RPC.ControlMessage();\n if (d.ihave) {\n if (!Array.isArray(d.ihave))\n throw TypeError(\".RPC.ControlMessage.ihave: array expected\");\n m.ihave = [];\n for (var i = 0; i < d.ihave.length; ++i) {\n if (typeof d.ihave[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.ihave: object expected\");\n m.ihave[i] = $root.RPC.ControlIHave.fromObject(d.ihave[i]);\n }\n }\n if (d.iwant) {\n if (!Array.isArray(d.iwant))\n throw TypeError(\".RPC.ControlMessage.iwant: array expected\");\n m.iwant = [];\n for (var i = 0; i < d.iwant.length; ++i) {\n if (typeof d.iwant[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.iwant: object expected\");\n m.iwant[i] = $root.RPC.ControlIWant.fromObject(d.iwant[i]);\n }\n }\n if (d.graft) {\n if (!Array.isArray(d.graft))\n throw TypeError(\".RPC.ControlMessage.graft: array expected\");\n m.graft = [];\n for (var i = 0; i < d.graft.length; ++i) {\n if (typeof d.graft[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.graft: object expected\");\n m.graft[i] = $root.RPC.ControlGraft.fromObject(d.graft[i]);\n }\n }\n if (d.prune) {\n if (!Array.isArray(d.prune))\n throw TypeError(\".RPC.ControlMessage.prune: array expected\");\n m.prune = [];\n for (var i = 0; i < d.prune.length; ++i) {\n if (typeof d.prune[i] !== \"object\")\n throw TypeError(\".RPC.ControlMessage.prune: object expected\");\n m.prune[i] = $root.RPC.ControlPrune.fromObject(d.prune[i]);\n }\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlMessage message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlMessage\n * @static\n * @param {RPC.ControlMessage} m ControlMessage\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlMessage.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.ihave = [];\n d.iwant = [];\n d.graft = [];\n d.prune = [];\n }\n if (m.ihave && m.ihave.length) {\n d.ihave = [];\n for (var j = 0; j < m.ihave.length; ++j) {\n d.ihave[j] = $root.RPC.ControlIHave.toObject(m.ihave[j], o);\n }\n }\n if (m.iwant && m.iwant.length) {\n d.iwant = [];\n for (var j = 0; j < m.iwant.length; ++j) {\n d.iwant[j] = $root.RPC.ControlIWant.toObject(m.iwant[j], o);\n }\n }\n if (m.graft && m.graft.length) {\n d.graft = [];\n for (var j = 0; j < m.graft.length; ++j) {\n d.graft[j] = $root.RPC.ControlGraft.toObject(m.graft[j], o);\n }\n }\n if (m.prune && m.prune.length) {\n d.prune = [];\n for (var j = 0; j < m.prune.length; ++j) {\n d.prune[j] = $root.RPC.ControlPrune.toObject(m.prune[j], o);\n }\n }\n return d;\n };\n\n /**\n * Converts this ControlMessage to JSON.\n * @function toJSON\n * @memberof RPC.ControlMessage\n * @instance\n * @returns {Object.} JSON object\n */\n ControlMessage.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlMessage;\n })();\n\n RPC.ControlIHave = (function() {\n\n /**\n * Properties of a ControlIHave.\n * @memberof RPC\n * @interface IControlIHave\n * @property {string|null} [topicID] ControlIHave topicID\n * @property {Array.|null} [messageIDs] ControlIHave messageIDs\n */\n\n /**\n * Constructs a new ControlIHave.\n * @memberof RPC\n * @classdesc Represents a ControlIHave.\n * @implements IControlIHave\n * @constructor\n * @param {RPC.IControlIHave=} [p] Properties to set\n */\n function ControlIHave(p) {\n this.messageIDs = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlIHave topicID.\n * @member {string|null|undefined} topicID\n * @memberof RPC.ControlIHave\n * @instance\n */\n ControlIHave.prototype.topicID = null;\n\n /**\n * ControlIHave messageIDs.\n * @member {Array.} messageIDs\n * @memberof RPC.ControlIHave\n * @instance\n */\n ControlIHave.prototype.messageIDs = $util.emptyArray;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * ControlIHave _topicID.\n * @member {\"topicID\"|undefined} _topicID\n * @memberof RPC.ControlIHave\n * @instance\n */\n Object.defineProperty(ControlIHave.prototype, \"_topicID\", {\n get: $util.oneOfGetter($oneOfFields = [\"topicID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified ControlIHave message. Does not implicitly {@link RPC.ControlIHave.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlIHave\n * @static\n * @param {RPC.IControlIHave} m ControlIHave message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlIHave.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.topicID != null && Object.hasOwnProperty.call(m, \"topicID\"))\n w.uint32(10).string(m.topicID);\n if (m.messageIDs != null && m.messageIDs.length) {\n for (var i = 0; i < m.messageIDs.length; ++i)\n w.uint32(18).bytes(m.messageIDs[i]);\n }\n return w;\n };\n\n /**\n * Decodes a ControlIHave message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlIHave\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlIHave} ControlIHave\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlIHave.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlIHave();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n case 2:\n if (!(m.messageIDs && m.messageIDs.length))\n m.messageIDs = [];\n m.messageIDs.push(r.bytes());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlIHave message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlIHave\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlIHave} ControlIHave\n */\n ControlIHave.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlIHave)\n return d;\n var m = new $root.RPC.ControlIHave();\n if (d.topicID != null) {\n m.topicID = String(d.topicID);\n }\n if (d.messageIDs) {\n if (!Array.isArray(d.messageIDs))\n throw TypeError(\".RPC.ControlIHave.messageIDs: array expected\");\n m.messageIDs = [];\n for (var i = 0; i < d.messageIDs.length; ++i) {\n if (typeof d.messageIDs[i] === \"string\")\n $util.base64.decode(d.messageIDs[i], m.messageIDs[i] = $util.newBuffer($util.base64.length(d.messageIDs[i])), 0);\n else if (d.messageIDs[i].length)\n m.messageIDs[i] = d.messageIDs[i];\n }\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlIHave message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlIHave\n * @static\n * @param {RPC.ControlIHave} m ControlIHave\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlIHave.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.messageIDs = [];\n }\n if (m.topicID != null && m.hasOwnProperty(\"topicID\")) {\n d.topicID = m.topicID;\n if (o.oneofs)\n d._topicID = \"topicID\";\n }\n if (m.messageIDs && m.messageIDs.length) {\n d.messageIDs = [];\n for (var j = 0; j < m.messageIDs.length; ++j) {\n d.messageIDs[j] = o.bytes === String ? $util.base64.encode(m.messageIDs[j], 0, m.messageIDs[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.messageIDs[j]) : m.messageIDs[j];\n }\n }\n return d;\n };\n\n /**\n * Converts this ControlIHave to JSON.\n * @function toJSON\n * @memberof RPC.ControlIHave\n * @instance\n * @returns {Object.} JSON object\n */\n ControlIHave.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlIHave;\n })();\n\n RPC.ControlIWant = (function() {\n\n /**\n * Properties of a ControlIWant.\n * @memberof RPC\n * @interface IControlIWant\n * @property {Array.|null} [messageIDs] ControlIWant messageIDs\n */\n\n /**\n * Constructs a new ControlIWant.\n * @memberof RPC\n * @classdesc Represents a ControlIWant.\n * @implements IControlIWant\n * @constructor\n * @param {RPC.IControlIWant=} [p] Properties to set\n */\n function ControlIWant(p) {\n this.messageIDs = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlIWant messageIDs.\n * @member {Array.} messageIDs\n * @memberof RPC.ControlIWant\n * @instance\n */\n ControlIWant.prototype.messageIDs = $util.emptyArray;\n\n /**\n * Encodes the specified ControlIWant message. Does not implicitly {@link RPC.ControlIWant.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlIWant\n * @static\n * @param {RPC.IControlIWant} m ControlIWant message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlIWant.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.messageIDs != null && m.messageIDs.length) {\n for (var i = 0; i < m.messageIDs.length; ++i)\n w.uint32(10).bytes(m.messageIDs[i]);\n }\n return w;\n };\n\n /**\n * Decodes a ControlIWant message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlIWant\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlIWant} ControlIWant\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlIWant.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlIWant();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.messageIDs && m.messageIDs.length))\n m.messageIDs = [];\n m.messageIDs.push(r.bytes());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlIWant message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlIWant\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlIWant} ControlIWant\n */\n ControlIWant.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlIWant)\n return d;\n var m = new $root.RPC.ControlIWant();\n if (d.messageIDs) {\n if (!Array.isArray(d.messageIDs))\n throw TypeError(\".RPC.ControlIWant.messageIDs: array expected\");\n m.messageIDs = [];\n for (var i = 0; i < d.messageIDs.length; ++i) {\n if (typeof d.messageIDs[i] === \"string\")\n $util.base64.decode(d.messageIDs[i], m.messageIDs[i] = $util.newBuffer($util.base64.length(d.messageIDs[i])), 0);\n else if (d.messageIDs[i].length)\n m.messageIDs[i] = d.messageIDs[i];\n }\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlIWant message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlIWant\n * @static\n * @param {RPC.ControlIWant} m ControlIWant\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlIWant.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.messageIDs = [];\n }\n if (m.messageIDs && m.messageIDs.length) {\n d.messageIDs = [];\n for (var j = 0; j < m.messageIDs.length; ++j) {\n d.messageIDs[j] = o.bytes === String ? $util.base64.encode(m.messageIDs[j], 0, m.messageIDs[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.messageIDs[j]) : m.messageIDs[j];\n }\n }\n return d;\n };\n\n /**\n * Converts this ControlIWant to JSON.\n * @function toJSON\n * @memberof RPC.ControlIWant\n * @instance\n * @returns {Object.} JSON object\n */\n ControlIWant.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlIWant;\n })();\n\n RPC.ControlGraft = (function() {\n\n /**\n * Properties of a ControlGraft.\n * @memberof RPC\n * @interface IControlGraft\n * @property {string|null} [topicID] ControlGraft topicID\n */\n\n /**\n * Constructs a new ControlGraft.\n * @memberof RPC\n * @classdesc Represents a ControlGraft.\n * @implements IControlGraft\n * @constructor\n * @param {RPC.IControlGraft=} [p] Properties to set\n */\n function ControlGraft(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlGraft topicID.\n * @member {string|null|undefined} topicID\n * @memberof RPC.ControlGraft\n * @instance\n */\n ControlGraft.prototype.topicID = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * ControlGraft _topicID.\n * @member {\"topicID\"|undefined} _topicID\n * @memberof RPC.ControlGraft\n * @instance\n */\n Object.defineProperty(ControlGraft.prototype, \"_topicID\", {\n get: $util.oneOfGetter($oneOfFields = [\"topicID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified ControlGraft message. Does not implicitly {@link RPC.ControlGraft.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlGraft\n * @static\n * @param {RPC.IControlGraft} m ControlGraft message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlGraft.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.topicID != null && Object.hasOwnProperty.call(m, \"topicID\"))\n w.uint32(10).string(m.topicID);\n return w;\n };\n\n /**\n * Decodes a ControlGraft message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlGraft\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlGraft} ControlGraft\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlGraft.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlGraft();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlGraft message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlGraft\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlGraft} ControlGraft\n */\n ControlGraft.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlGraft)\n return d;\n var m = new $root.RPC.ControlGraft();\n if (d.topicID != null) {\n m.topicID = String(d.topicID);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlGraft message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlGraft\n * @static\n * @param {RPC.ControlGraft} m ControlGraft\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlGraft.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (m.topicID != null && m.hasOwnProperty(\"topicID\")) {\n d.topicID = m.topicID;\n if (o.oneofs)\n d._topicID = \"topicID\";\n }\n return d;\n };\n\n /**\n * Converts this ControlGraft to JSON.\n * @function toJSON\n * @memberof RPC.ControlGraft\n * @instance\n * @returns {Object.} JSON object\n */\n ControlGraft.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlGraft;\n })();\n\n RPC.ControlPrune = (function() {\n\n /**\n * Properties of a ControlPrune.\n * @memberof RPC\n * @interface IControlPrune\n * @property {string|null} [topicID] ControlPrune topicID\n * @property {Array.|null} [peers] ControlPrune peers\n * @property {number|null} [backoff] ControlPrune backoff\n */\n\n /**\n * Constructs a new ControlPrune.\n * @memberof RPC\n * @classdesc Represents a ControlPrune.\n * @implements IControlPrune\n * @constructor\n * @param {RPC.IControlPrune=} [p] Properties to set\n */\n function ControlPrune(p) {\n this.peers = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * ControlPrune topicID.\n * @member {string|null|undefined} topicID\n * @memberof RPC.ControlPrune\n * @instance\n */\n ControlPrune.prototype.topicID = null;\n\n /**\n * ControlPrune peers.\n * @member {Array.} peers\n * @memberof RPC.ControlPrune\n * @instance\n */\n ControlPrune.prototype.peers = $util.emptyArray;\n\n /**\n * ControlPrune backoff.\n * @member {number|null|undefined} backoff\n * @memberof RPC.ControlPrune\n * @instance\n */\n ControlPrune.prototype.backoff = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * ControlPrune _topicID.\n * @member {\"topicID\"|undefined} _topicID\n * @memberof RPC.ControlPrune\n * @instance\n */\n Object.defineProperty(ControlPrune.prototype, \"_topicID\", {\n get: $util.oneOfGetter($oneOfFields = [\"topicID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * ControlPrune _backoff.\n * @member {\"backoff\"|undefined} _backoff\n * @memberof RPC.ControlPrune\n * @instance\n */\n Object.defineProperty(ControlPrune.prototype, \"_backoff\", {\n get: $util.oneOfGetter($oneOfFields = [\"backoff\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified ControlPrune message. Does not implicitly {@link RPC.ControlPrune.verify|verify} messages.\n * @function encode\n * @memberof RPC.ControlPrune\n * @static\n * @param {RPC.IControlPrune} m ControlPrune message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n ControlPrune.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.topicID != null && Object.hasOwnProperty.call(m, \"topicID\"))\n w.uint32(10).string(m.topicID);\n if (m.peers != null && m.peers.length) {\n for (var i = 0; i < m.peers.length; ++i)\n $root.RPC.PeerInfo.encode(m.peers[i], w.uint32(18).fork()).ldelim();\n }\n if (m.backoff != null && Object.hasOwnProperty.call(m, \"backoff\"))\n w.uint32(24).uint64(m.backoff);\n return w;\n };\n\n /**\n * Decodes a ControlPrune message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.ControlPrune\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.ControlPrune} ControlPrune\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n ControlPrune.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.ControlPrune();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n case 2:\n if (!(m.peers && m.peers.length))\n m.peers = [];\n m.peers.push($root.RPC.PeerInfo.decode(r, r.uint32()));\n break;\n case 3:\n m.backoff = r.uint64();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a ControlPrune message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.ControlPrune\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.ControlPrune} ControlPrune\n */\n ControlPrune.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.ControlPrune)\n return d;\n var m = new $root.RPC.ControlPrune();\n if (d.topicID != null) {\n m.topicID = String(d.topicID);\n }\n if (d.peers) {\n if (!Array.isArray(d.peers))\n throw TypeError(\".RPC.ControlPrune.peers: array expected\");\n m.peers = [];\n for (var i = 0; i < d.peers.length; ++i) {\n if (typeof d.peers[i] !== \"object\")\n throw TypeError(\".RPC.ControlPrune.peers: object expected\");\n m.peers[i] = $root.RPC.PeerInfo.fromObject(d.peers[i]);\n }\n }\n if (d.backoff != null) {\n if ($util.Long)\n (m.backoff = $util.Long.fromValue(d.backoff)).unsigned = true;\n else if (typeof d.backoff === \"string\")\n m.backoff = parseInt(d.backoff, 10);\n else if (typeof d.backoff === \"number\")\n m.backoff = d.backoff;\n else if (typeof d.backoff === \"object\")\n m.backoff = new $util.LongBits(d.backoff.low >>> 0, d.backoff.high >>> 0).toNumber(true);\n }\n return m;\n };\n\n /**\n * Creates a plain object from a ControlPrune message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.ControlPrune\n * @static\n * @param {RPC.ControlPrune} m ControlPrune\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n ControlPrune.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.peers = [];\n }\n if (m.topicID != null && m.hasOwnProperty(\"topicID\")) {\n d.topicID = m.topicID;\n if (o.oneofs)\n d._topicID = \"topicID\";\n }\n if (m.peers && m.peers.length) {\n d.peers = [];\n for (var j = 0; j < m.peers.length; ++j) {\n d.peers[j] = $root.RPC.PeerInfo.toObject(m.peers[j], o);\n }\n }\n if (m.backoff != null && m.hasOwnProperty(\"backoff\")) {\n if (typeof m.backoff === \"number\")\n d.backoff = o.longs === String ? String(m.backoff) : m.backoff;\n else\n d.backoff = o.longs === String ? $util.Long.prototype.toString.call(m.backoff) : o.longs === Number ? new $util.LongBits(m.backoff.low >>> 0, m.backoff.high >>> 0).toNumber(true) : m.backoff;\n if (o.oneofs)\n d._backoff = \"backoff\";\n }\n return d;\n };\n\n /**\n * Converts this ControlPrune to JSON.\n * @function toJSON\n * @memberof RPC.ControlPrune\n * @instance\n * @returns {Object.} JSON object\n */\n ControlPrune.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return ControlPrune;\n })();\n\n RPC.PeerInfo = (function() {\n\n /**\n * Properties of a PeerInfo.\n * @memberof RPC\n * @interface IPeerInfo\n * @property {Uint8Array|null} [peerID] PeerInfo peerID\n * @property {Uint8Array|null} [signedPeerRecord] PeerInfo signedPeerRecord\n */\n\n /**\n * Constructs a new PeerInfo.\n * @memberof RPC\n * @classdesc Represents a PeerInfo.\n * @implements IPeerInfo\n * @constructor\n * @param {RPC.IPeerInfo=} [p] Properties to set\n */\n function PeerInfo(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n\n /**\n * PeerInfo peerID.\n * @member {Uint8Array|null|undefined} peerID\n * @memberof RPC.PeerInfo\n * @instance\n */\n PeerInfo.prototype.peerID = null;\n\n /**\n * PeerInfo signedPeerRecord.\n * @member {Uint8Array|null|undefined} signedPeerRecord\n * @memberof RPC.PeerInfo\n * @instance\n */\n PeerInfo.prototype.signedPeerRecord = null;\n\n // OneOf field names bound to virtual getters and setters\n var $oneOfFields;\n\n /**\n * PeerInfo _peerID.\n * @member {\"peerID\"|undefined} _peerID\n * @memberof RPC.PeerInfo\n * @instance\n */\n Object.defineProperty(PeerInfo.prototype, \"_peerID\", {\n get: $util.oneOfGetter($oneOfFields = [\"peerID\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * PeerInfo _signedPeerRecord.\n * @member {\"signedPeerRecord\"|undefined} _signedPeerRecord\n * @memberof RPC.PeerInfo\n * @instance\n */\n Object.defineProperty(PeerInfo.prototype, \"_signedPeerRecord\", {\n get: $util.oneOfGetter($oneOfFields = [\"signedPeerRecord\"]),\n set: $util.oneOfSetter($oneOfFields)\n });\n\n /**\n * Encodes the specified PeerInfo message. Does not implicitly {@link RPC.PeerInfo.verify|verify} messages.\n * @function encode\n * @memberof RPC.PeerInfo\n * @static\n * @param {RPC.IPeerInfo} m PeerInfo message or plain object to encode\n * @param {$protobuf.Writer} [w] Writer to encode to\n * @returns {$protobuf.Writer} Writer\n */\n PeerInfo.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.peerID != null && Object.hasOwnProperty.call(m, \"peerID\"))\n w.uint32(10).bytes(m.peerID);\n if (m.signedPeerRecord != null && Object.hasOwnProperty.call(m, \"signedPeerRecord\"))\n w.uint32(18).bytes(m.signedPeerRecord);\n return w;\n };\n\n /**\n * Decodes a PeerInfo message from the specified reader or buffer.\n * @function decode\n * @memberof RPC.PeerInfo\n * @static\n * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from\n * @param {number} [l] Message length if known beforehand\n * @returns {RPC.PeerInfo} PeerInfo\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {$protobuf.util.ProtocolError} If required fields are missing\n */\n PeerInfo.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.RPC.PeerInfo();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.peerID = r.bytes();\n break;\n case 2:\n m.signedPeerRecord = r.bytes();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n\n /**\n * Creates a PeerInfo message from a plain object. Also converts values to their respective internal types.\n * @function fromObject\n * @memberof RPC.PeerInfo\n * @static\n * @param {Object.} d Plain object\n * @returns {RPC.PeerInfo} PeerInfo\n */\n PeerInfo.fromObject = function fromObject(d) {\n if (d instanceof $root.RPC.PeerInfo)\n return d;\n var m = new $root.RPC.PeerInfo();\n if (d.peerID != null) {\n if (typeof d.peerID === \"string\")\n $util.base64.decode(d.peerID, m.peerID = $util.newBuffer($util.base64.length(d.peerID)), 0);\n else if (d.peerID.length)\n m.peerID = d.peerID;\n }\n if (d.signedPeerRecord != null) {\n if (typeof d.signedPeerRecord === \"string\")\n $util.base64.decode(d.signedPeerRecord, m.signedPeerRecord = $util.newBuffer($util.base64.length(d.signedPeerRecord)), 0);\n else if (d.signedPeerRecord.length)\n m.signedPeerRecord = d.signedPeerRecord;\n }\n return m;\n };\n\n /**\n * Creates a plain object from a PeerInfo message. Also converts values to other types if specified.\n * @function toObject\n * @memberof RPC.PeerInfo\n * @static\n * @param {RPC.PeerInfo} m PeerInfo\n * @param {$protobuf.IConversionOptions} [o] Conversion options\n * @returns {Object.} Plain object\n */\n PeerInfo.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (m.peerID != null && m.hasOwnProperty(\"peerID\")) {\n d.peerID = o.bytes === String ? $util.base64.encode(m.peerID, 0, m.peerID.length) : o.bytes === Array ? Array.prototype.slice.call(m.peerID) : m.peerID;\n if (o.oneofs)\n d._peerID = \"peerID\";\n }\n if (m.signedPeerRecord != null && m.hasOwnProperty(\"signedPeerRecord\")) {\n d.signedPeerRecord = o.bytes === String ? $util.base64.encode(m.signedPeerRecord, 0, m.signedPeerRecord.length) : o.bytes === Array ? Array.prototype.slice.call(m.signedPeerRecord) : m.signedPeerRecord;\n if (o.oneofs)\n d._signedPeerRecord = \"signedPeerRecord\";\n }\n return d;\n };\n\n /**\n * Converts this PeerInfo to JSON.\n * @function toJSON\n * @memberof RPC.PeerInfo\n * @instance\n * @returns {Object.} JSON object\n */\n PeerInfo.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n };\n\n return PeerInfo;\n })();\n\n return RPC;\n })();\n\n return $root;\n});\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.cjs?");
/***/ }),
@@ -2348,6 +2282,545 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ }),
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/constants.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/constants.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ACCEPT_FROM_WHITELIST_DURATION_MS\": () => (/* binding */ ACCEPT_FROM_WHITELIST_DURATION_MS),\n/* harmony export */ \"ACCEPT_FROM_WHITELIST_MAX_MESSAGES\": () => (/* binding */ ACCEPT_FROM_WHITELIST_MAX_MESSAGES),\n/* harmony export */ \"ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE\": () => (/* binding */ ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE),\n/* harmony export */ \"DEFAULT_METRIC_MESH_MESSAGE_DELIVERIES_WINDOWS\": () => (/* binding */ DEFAULT_METRIC_MESH_MESSAGE_DELIVERIES_WINDOWS),\n/* harmony export */ \"ERR_TOPIC_VALIDATOR_IGNORE\": () => (/* binding */ ERR_TOPIC_VALIDATOR_IGNORE),\n/* harmony export */ \"ERR_TOPIC_VALIDATOR_REJECT\": () => (/* binding */ ERR_TOPIC_VALIDATOR_REJECT),\n/* harmony export */ \"FloodsubID\": () => (/* binding */ FloodsubID),\n/* harmony export */ \"GossipsubConnectionTimeout\": () => (/* binding */ GossipsubConnectionTimeout),\n/* harmony export */ \"GossipsubConnectors\": () => (/* binding */ GossipsubConnectors),\n/* harmony export */ \"GossipsubD\": () => (/* binding */ GossipsubD),\n/* harmony export */ \"GossipsubDhi\": () => (/* binding */ GossipsubDhi),\n/* harmony export */ \"GossipsubDirectConnectInitialDelay\": () => (/* binding */ GossipsubDirectConnectInitialDelay),\n/* harmony export */ \"GossipsubDirectConnectTicks\": () => (/* binding */ GossipsubDirectConnectTicks),\n/* harmony export */ \"GossipsubDlazy\": () => (/* binding */ GossipsubDlazy),\n/* harmony export */ \"GossipsubDlo\": () => (/* binding */ GossipsubDlo),\n/* harmony export */ \"GossipsubDout\": () => (/* binding */ GossipsubDout),\n/* harmony export */ \"GossipsubDscore\": () => (/* binding */ GossipsubDscore),\n/* harmony export */ \"GossipsubFanoutTTL\": () => (/* binding */ GossipsubFanoutTTL),\n/* harmony export */ \"GossipsubGossipFactor\": () => (/* binding */ GossipsubGossipFactor),\n/* harmony export */ \"GossipsubGossipRetransmission\": () => (/* binding */ GossipsubGossipRetransmission),\n/* harmony export */ \"GossipsubGraftFloodThreshold\": () => (/* binding */ GossipsubGraftFloodThreshold),\n/* harmony export */ \"GossipsubHeartbeatInitialDelay\": () => (/* binding */ GossipsubHeartbeatInitialDelay),\n/* harmony export */ \"GossipsubHeartbeatInterval\": () => (/* binding */ GossipsubHeartbeatInterval),\n/* harmony export */ \"GossipsubHistoryGossip\": () => (/* binding */ GossipsubHistoryGossip),\n/* harmony export */ \"GossipsubHistoryLength\": () => (/* binding */ GossipsubHistoryLength),\n/* harmony export */ \"GossipsubIDv10\": () => (/* binding */ GossipsubIDv10),\n/* harmony export */ \"GossipsubIDv11\": () => (/* binding */ GossipsubIDv11),\n/* harmony export */ \"GossipsubIWantFollowupTime\": () => (/* binding */ GossipsubIWantFollowupTime),\n/* harmony export */ \"GossipsubMaxIHaveLength\": () => (/* binding */ GossipsubMaxIHaveLength),\n/* harmony export */ \"GossipsubMaxIHaveMessages\": () => (/* binding */ GossipsubMaxIHaveMessages),\n/* harmony export */ \"GossipsubMaxPendingConnections\": () => (/* binding */ GossipsubMaxPendingConnections),\n/* harmony export */ \"GossipsubOpportunisticGraftPeers\": () => (/* binding */ GossipsubOpportunisticGraftPeers),\n/* harmony export */ \"GossipsubOpportunisticGraftTicks\": () => (/* binding */ GossipsubOpportunisticGraftTicks),\n/* harmony export */ \"GossipsubPruneBackoff\": () => (/* binding */ GossipsubPruneBackoff),\n/* harmony export */ \"GossipsubPruneBackoffTicks\": () => (/* binding */ GossipsubPruneBackoffTicks),\n/* harmony export */ \"GossipsubPrunePeers\": () => (/* binding */ GossipsubPrunePeers),\n/* harmony export */ \"GossipsubSeenTTL\": () => (/* binding */ GossipsubSeenTTL),\n/* harmony export */ \"TimeCacheDuration\": () => (/* binding */ TimeCacheDuration),\n/* harmony export */ \"minute\": () => (/* binding */ minute),\n/* harmony export */ \"second\": () => (/* binding */ second)\n/* harmony export */ });\nconst second = 1000;\nconst minute = 60 * second;\n// Protocol identifiers\nconst FloodsubID = '/floodsub/1.0.0';\n/**\n * The protocol ID for version 1.0.0 of the Gossipsub protocol\n * It is advertised along with GossipsubIDv11 for backwards compatability\n */\nconst GossipsubIDv10 = '/meshsub/1.0.0';\n/**\n * The protocol ID for version 1.1.0 of the Gossipsub protocol\n * See the spec for details about how v1.1.0 compares to v1.0.0:\n * https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md\n */\nconst GossipsubIDv11 = '/meshsub/1.1.0';\n// Overlay parameters\n/**\n * GossipsubD sets the optimal degree for a Gossipsub topic mesh. For example, if GossipsubD == 6,\n * each peer will want to have about six peers in their mesh for each topic they're subscribed to.\n * GossipsubD should be set somewhere between GossipsubDlo and GossipsubDhi.\n */\nconst GossipsubD = 6;\n/**\n * GossipsubDlo sets the lower bound on the number of peers we keep in a Gossipsub topic mesh.\n * If we have fewer than GossipsubDlo peers, we will attempt to graft some more into the mesh at\n * the next heartbeat.\n */\nconst GossipsubDlo = 4;\n/**\n * GossipsubDhi sets the upper bound on the number of peers we keep in a Gossipsub topic mesh.\n * If we have more than GossipsubDhi peers, we will select some to prune from the mesh at the next heartbeat.\n */\nconst GossipsubDhi = 12;\n/**\n * GossipsubDscore affects how peers are selected when pruning a mesh due to over subscription.\n * At least GossipsubDscore of the retained peers will be high-scoring, while the remainder are\n * chosen randomly.\n */\nconst GossipsubDscore = 4;\n/**\n * GossipsubDout sets the quota for the number of outbound connections to maintain in a topic mesh.\n * When the mesh is pruned due to over subscription, we make sure that we have outbound connections\n * to at least GossipsubDout of the survivor peers. This prevents sybil attackers from overwhelming\n * our mesh with incoming connections.\n *\n * GossipsubDout must be set below GossipsubDlo, and must not exceed GossipsubD / 2.\n */\nconst GossipsubDout = 2;\n// Gossip parameters\n/**\n * GossipsubHistoryLength controls the size of the message cache used for gossip.\n * The message cache will remember messages for GossipsubHistoryLength heartbeats.\n */\nconst GossipsubHistoryLength = 5;\n/**\n * GossipsubHistoryGossip controls how many cached message ids we will advertise in\n * IHAVE gossip messages. When asked for our seen message IDs, we will return\n * only those from the most recent GossipsubHistoryGossip heartbeats. The slack between\n * GossipsubHistoryGossip and GossipsubHistoryLength allows us to avoid advertising messages\n * that will be expired by the time they're requested.\n *\n * GossipsubHistoryGossip must be less than or equal to GossipsubHistoryLength to\n * avoid a runtime panic.\n */\nconst GossipsubHistoryGossip = 3;\n/**\n * GossipsubDlazy affects how many peers we will emit gossip to at each heartbeat.\n * We will send gossip to at least GossipsubDlazy peers outside our mesh. The actual\n * number may be more, depending on GossipsubGossipFactor and how many peers we're\n * connected to.\n */\nconst GossipsubDlazy = 6;\n/**\n * GossipsubGossipFactor affects how many peers we will emit gossip to at each heartbeat.\n * We will send gossip to GossipsubGossipFactor * (total number of non-mesh peers), or\n * GossipsubDlazy, whichever is greater.\n */\nconst GossipsubGossipFactor = 0.25;\n/**\n * GossipsubGossipRetransmission controls how many times we will allow a peer to request\n * the same message id through IWANT gossip before we start ignoring them. This is designed\n * to prevent peers from spamming us with requests and wasting our resources.\n */\nconst GossipsubGossipRetransmission = 3;\n// Heartbeat interval\n/**\n * GossipsubHeartbeatInitialDelay is the short delay before the heartbeat timer begins\n * after the router is initialized.\n */\nconst GossipsubHeartbeatInitialDelay = 100;\n/**\n * GossipsubHeartbeatInterval controls the time between heartbeats.\n */\nconst GossipsubHeartbeatInterval = second;\n/**\n * GossipsubFanoutTTL controls how long we keep track of the fanout state. If it's been\n * GossipsubFanoutTTL since we've published to a topic that we're not subscribed to,\n * we'll delete the fanout map for that topic.\n */\nconst GossipsubFanoutTTL = minute;\n/**\n * GossipsubPrunePeers controls the number of peers to include in prune Peer eXchange.\n * When we prune a peer that's eligible for PX (has a good score, etc), we will try to\n * send them signed peer records for up to GossipsubPrunePeers other peers that we\n * know of.\n */\nconst GossipsubPrunePeers = 16;\n/**\n * GossipsubPruneBackoff controls the backoff time for pruned peers. This is how long\n * a peer must wait before attempting to graft into our mesh again after being pruned.\n * When pruning a peer, we send them our value of GossipsubPruneBackoff so they know\n * the minimum time to wait. Peers running older versions may not send a backoff time,\n * so if we receive a prune message without one, we will wait at least GossipsubPruneBackoff\n * before attempting to re-graft.\n */\nconst GossipsubPruneBackoff = minute;\n/**\n * GossipsubPruneBackoffTicks is the number of heartbeat ticks for attempting to prune expired\n * backoff timers.\n */\nconst GossipsubPruneBackoffTicks = 15;\n/**\n * GossipsubConnectors controls the number of active connection attempts for peers obtained through PX.\n */\nconst GossipsubConnectors = 8;\n/**\n * GossipsubMaxPendingConnections sets the maximum number of pending connections for peers attempted through px.\n */\nconst GossipsubMaxPendingConnections = 128;\n/**\n * GossipsubConnectionTimeout controls the timeout for connection attempts.\n */\nconst GossipsubConnectionTimeout = 30 * second;\n/**\n * GossipsubDirectConnectTicks is the number of heartbeat ticks for attempting to reconnect direct peers\n * that are not currently connected.\n */\nconst GossipsubDirectConnectTicks = 300;\n/**\n * GossipsubDirectConnectInitialDelay is the initial delay before opening connections to direct peers\n */\nconst GossipsubDirectConnectInitialDelay = second;\n/**\n * GossipsubOpportunisticGraftTicks is the number of heartbeat ticks for attempting to improve the mesh\n * with opportunistic grafting. Every GossipsubOpportunisticGraftTicks we will attempt to select some\n * high-scoring mesh peers to replace lower-scoring ones, if the median score of our mesh peers falls\n * below a threshold\n */\nconst GossipsubOpportunisticGraftTicks = 60;\n/**\n * GossipsubOpportunisticGraftPeers is the number of peers to opportunistically graft.\n */\nconst GossipsubOpportunisticGraftPeers = 2;\n/**\n * If a GRAFT comes before GossipsubGraftFloodThreshold has elapsed since the last PRUNE,\n * then there is an extra score penalty applied to the peer through P7.\n */\nconst GossipsubGraftFloodThreshold = 10 * second;\n/**\n * GossipsubMaxIHaveLength is the maximum number of messages to include in an IHAVE message.\n * Also controls the maximum number of IHAVE ids we will accept and request with IWANT from a\n * peer within a heartbeat, to protect from IHAVE floods. You should adjust this value from the\n * default if your system is pushing more than 5000 messages in GossipsubHistoryGossip heartbeats;\n * with the defaults this is 1666 messages/s.\n */\nconst GossipsubMaxIHaveLength = 5000;\n/**\n * GossipsubMaxIHaveMessages is the maximum number of IHAVE messages to accept from a peer within a heartbeat.\n */\nconst GossipsubMaxIHaveMessages = 10;\n/**\n * Time to wait for a message requested through IWANT following an IHAVE advertisement.\n * If the message is not received within this window, a broken promise is declared and\n * the router may apply bahavioural penalties.\n */\nconst GossipsubIWantFollowupTime = 3 * second;\n/**\n * Time in milliseconds to keep message ids in the seen cache\n */\nconst GossipsubSeenTTL = 2 * minute;\nconst TimeCacheDuration = 120 * 1000;\nconst ERR_TOPIC_VALIDATOR_REJECT = 'ERR_TOPIC_VALIDATOR_REJECT';\nconst ERR_TOPIC_VALIDATOR_IGNORE = 'ERR_TOPIC_VALIDATOR_IGNORE';\n/**\n * If peer score is better than this, we accept messages from this peer\n * within ACCEPT_FROM_WHITELIST_DURATION_MS from the last time computing score.\n **/\nconst ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE = 0;\n/**\n * If peer score >= ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE, accept up to this\n * number of messages from that peer.\n */\nconst ACCEPT_FROM_WHITELIST_MAX_MESSAGES = 128;\n/**\n * If peer score >= ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE, accept messages from\n * this peer up to this time duration.\n */\nconst ACCEPT_FROM_WHITELIST_DURATION_MS = 1000;\n/**\n * The default MeshMessageDeliveriesWindow to be used in metrics.\n */\nconst DEFAULT_METRIC_MESH_MESSAGE_DELIVERIES_WINDOWS = 1000;\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/constants.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js":
+/*!********************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js ***!
+ \********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"GossipSub\": () => (/* binding */ GossipSub),\n/* harmony export */ \"gossipsub\": () => (/* binding */ gossipsub),\n/* harmony export */ \"multicodec\": () => (/* binding */ multicodec)\n/* harmony export */ });\n/* harmony import */ var it_pipe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! it-pipe */ \"./node_modules/it-pipe/dist/src/index.js\");\n/* harmony import */ var _libp2p_peer_record__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/peer-record */ \"./node_modules/@libp2p/peer-record/dist/src/index.js\");\n/* harmony import */ var _libp2p_peer_id__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @libp2p/peer-id */ \"./node_modules/@libp2p/peer-id/dist/src/index.js\");\n/* harmony import */ var _libp2p_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @libp2p/logger */ \"./node_modules/@libp2p/logger/dist/src/index.js\");\n/* harmony import */ var _libp2p_topology__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @libp2p/topology */ \"./node_modules/@libp2p/topology/dist/src/index.js\");\n/* harmony import */ var _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @libp2p/interfaces/events */ \"./node_modules/@libp2p/interfaces/dist/src/events.js\");\n/* harmony import */ var _message_cache_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./message-cache.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.js\");\n/* harmony import */ var _message_rpc_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./message/rpc.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/constants.js\");\n/* harmony import */ var _utils_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/index.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/index.js\");\n/* harmony import */ var _score_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./score/index.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.js\");\n/* harmony import */ var _tracer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./tracer.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.js\");\n/* harmony import */ var _utils_time_cache_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/time-cache.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/time-cache.js\");\n/* harmony import */ var _metrics_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./metrics.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.js\");\n/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./types.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js\");\n/* harmony import */ var _utils_buildRawMessage_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/buildRawMessage.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js\");\n/* harmony import */ var _utils_msgIdFn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/msgIdFn.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js\");\n/* harmony import */ var _score_scoreMetrics_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./score/scoreMetrics.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/scoreMetrics.js\");\n/* harmony import */ var _utils_publishConfig_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./utils/publishConfig.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js\");\n/* harmony import */ var _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @libp2p/interface-pubsub */ \"./node_modules/@libp2p/interface-pubsub/dist/src/index.js\");\n/* harmony import */ var _utils_set_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./utils/set.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.js\");\n/* harmony import */ var it_pushable__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! it-pushable */ \"./node_modules/it-pushable/dist/src/index.js\");\n/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./stream.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.js\");\n/* harmony import */ var _message_decodeRpc_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./message/decodeRpc.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decodeRpc.js\");\n/* harmony import */ var _utils_multiaddr_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./utils/multiaddr.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/multiaddr.js\");\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\nconst multicodec = _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubIDv11;\nvar GossipStatusCode;\n(function (GossipStatusCode) {\n GossipStatusCode[GossipStatusCode[\"started\"] = 0] = \"started\";\n GossipStatusCode[GossipStatusCode[\"stopped\"] = 1] = \"stopped\";\n})(GossipStatusCode || (GossipStatusCode = {}));\nclass GossipSub extends _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__.EventEmitter {\n constructor(components, options = {}) {\n super();\n this.multicodecs = [_constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubIDv11, _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubIDv10];\n // State\n this.peers = new Set();\n this.streamsInbound = new Map();\n this.streamsOutbound = new Map();\n /** Ensures outbound streams are created sequentially */\n this.outboundInflightQueue = (0,it_pushable__WEBPACK_IMPORTED_MODULE_21__.pushable)({ objectMode: true });\n /** Direct peers */\n this.direct = new Set();\n /** Floodsub peers */\n this.floodsubPeers = new Set();\n /**\n * Map of peer id and AcceptRequestWhileListEntry\n */\n this.acceptFromWhitelist = new Map();\n /**\n * Map of topics to which peers are subscribed to\n */\n this.topics = new Map();\n /**\n * List of our subscriptions\n */\n this.subscriptions = new Set();\n /**\n * Map of topic meshes\n * topic => peer id set\n */\n this.mesh = new Map();\n /**\n * Map of topics to set of peers. These mesh peers are the ones to which we are publishing without a topic membership\n * topic => peer id set\n */\n this.fanout = new Map();\n /**\n * Map of last publish time for fanout topics\n * topic => last publish time\n */\n this.fanoutLastpub = new Map();\n /**\n * Map of pending messages to gossip\n * peer id => control messages\n */\n this.gossip = new Map();\n /**\n * Map of control messages\n * peer id => control message\n */\n this.control = new Map();\n /**\n * Number of IHAVEs received from peer in the last heartbeat\n */\n this.peerhave = new Map();\n /** Number of messages we have asked from peer in the last heartbeat */\n this.iasked = new Map();\n /** Prune backoff map */\n this.backoff = new Map();\n /**\n * Connection direction cache, marks peers with outbound connections\n * peer id => direction\n */\n this.outbound = new Map();\n /**\n * Custom validator function per topic.\n * Must return or resolve quickly (< 100ms) to prevent causing penalties for late messages.\n * If you need to apply validation that may require longer times use `asyncValidation` option and callback the\n * validation result through `Gossipsub.reportValidationResult`\n */\n this.topicValidators = new Map();\n /**\n * Number of heartbeats since the beginning of time\n * This allows us to amortize some resource cleanup -- eg: backoff cleanup\n */\n this.heartbeatTicks = 0;\n this.directPeerInitial = null;\n this.status = { code: GossipStatusCode.stopped };\n this.heartbeatTimer = null;\n this.runHeartbeat = () => {\n const timer = this.metrics?.heartbeatDuration.startTimer();\n this.heartbeat()\n .catch((err) => {\n this.log('Error running heartbeat', err);\n })\n .finally(() => {\n if (timer != null) {\n timer();\n }\n // Schedule the next run if still in started status\n if (this.status.code === GossipStatusCode.started) {\n // Clear previous timeout before overwriting `status.heartbeatTimeout`, it should be completed tho.\n clearTimeout(this.status.heartbeatTimeout);\n // NodeJS setInterval function is innexact, calls drift by a few miliseconds on each call.\n // To run the heartbeat precisely setTimeout() must be used recomputing the delay on every loop.\n let msToNextHeartbeat = this.opts.heartbeatInterval - ((Date.now() - this.status.hearbeatStartMs) % this.opts.heartbeatInterval);\n // If too close to next heartbeat, skip one\n if (msToNextHeartbeat < this.opts.heartbeatInterval * 0.25) {\n msToNextHeartbeat += this.opts.heartbeatInterval;\n this.metrics?.heartbeatSkipped.inc();\n }\n this.status.heartbeatTimeout = setTimeout(this.runHeartbeat, msToNextHeartbeat);\n }\n });\n };\n const opts = {\n fallbackToFloodsub: true,\n floodPublish: true,\n doPX: false,\n directPeers: [],\n D: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubD,\n Dlo: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubDlo,\n Dhi: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubDhi,\n Dscore: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubDscore,\n Dout: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubDout,\n Dlazy: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubDlazy,\n heartbeatInterval: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubHeartbeatInterval,\n fanoutTTL: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubFanoutTTL,\n mcacheLength: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubHistoryLength,\n mcacheGossip: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubHistoryGossip,\n seenTTL: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubSeenTTL,\n gossipsubIWantFollowupMs: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubIWantFollowupTime,\n prunePeers: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubPrunePeers,\n pruneBackoff: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubPruneBackoff,\n graftFloodThreshold: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubGraftFloodThreshold,\n opportunisticGraftPeers: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubOpportunisticGraftPeers,\n opportunisticGraftTicks: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubOpportunisticGraftTicks,\n directConnectTicks: _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubDirectConnectTicks,\n ...options,\n scoreParams: (0,_score_index_js__WEBPACK_IMPORTED_MODULE_10__.createPeerScoreParams)(options.scoreParams),\n scoreThresholds: (0,_score_index_js__WEBPACK_IMPORTED_MODULE_10__.createPeerScoreThresholds)(options.scoreThresholds)\n };\n this.components = components;\n this.decodeRpcLimits = opts.decodeRpcLimits ?? _message_decodeRpc_js__WEBPACK_IMPORTED_MODULE_23__.defaultDecodeRpcLimits;\n this.globalSignaturePolicy = opts.globalSignaturePolicy ?? _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.StrictSign;\n // Also wants to get notified of peers connected using floodsub\n if (opts.fallbackToFloodsub) {\n this.multicodecs.push(_constants_js__WEBPACK_IMPORTED_MODULE_8__.FloodsubID);\n }\n // From pubsub\n this.log = (0,_libp2p_logger__WEBPACK_IMPORTED_MODULE_3__.logger)(opts.debugName ?? 'libp2p:gossipsub');\n // Gossipsub\n this.opts = opts;\n this.direct = new Set(opts.directPeers.map((p) => p.id.toString()));\n this.seenCache = new _utils_time_cache_js__WEBPACK_IMPORTED_MODULE_12__.SimpleTimeCache({ validityMs: opts.seenTTL });\n this.publishedMessageIds = new _utils_time_cache_js__WEBPACK_IMPORTED_MODULE_12__.SimpleTimeCache({ validityMs: opts.seenTTL });\n if (options.msgIdFn) {\n // Use custom function\n this.msgIdFn = options.msgIdFn;\n }\n else {\n switch (this.globalSignaturePolicy) {\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.StrictSign:\n this.msgIdFn = _utils_msgIdFn_js__WEBPACK_IMPORTED_MODULE_16__.msgIdFnStrictSign;\n break;\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.StrictNoSign:\n this.msgIdFn = _utils_msgIdFn_js__WEBPACK_IMPORTED_MODULE_16__.msgIdFnStrictNoSign;\n break;\n }\n }\n if (options.fastMsgIdFn) {\n this.fastMsgIdFn = options.fastMsgIdFn;\n this.fastMsgIdCache = new _utils_time_cache_js__WEBPACK_IMPORTED_MODULE_12__.SimpleTimeCache({ validityMs: opts.seenTTL });\n }\n // By default, gossipsub only provide a browser friendly function to convert Uint8Array message id to string.\n this.msgIdToStrFn = options.msgIdToStrFn ?? _utils_index_js__WEBPACK_IMPORTED_MODULE_9__.messageIdToString;\n this.mcache = options.messageCache || new _message_cache_js__WEBPACK_IMPORTED_MODULE_6__.MessageCache(opts.mcacheGossip, opts.mcacheLength, this.msgIdToStrFn);\n if (options.dataTransform) {\n this.dataTransform = options.dataTransform;\n }\n if (options.metricsRegister) {\n if (!options.metricsTopicStrToLabel) {\n throw Error('Must set metricsTopicStrToLabel with metrics');\n }\n // in theory, each topic has its own meshMessageDeliveriesWindow param\n // however in lodestar, we configure it mostly the same so just pick the max of positive ones\n // (some topics have meshMessageDeliveriesWindow as 0)\n const maxMeshMessageDeliveriesWindowMs = Math.max(...Object.values(opts.scoreParams.topics).map((topicParam) => topicParam.meshMessageDeliveriesWindow), _constants_js__WEBPACK_IMPORTED_MODULE_8__.DEFAULT_METRIC_MESH_MESSAGE_DELIVERIES_WINDOWS);\n const metrics = (0,_metrics_js__WEBPACK_IMPORTED_MODULE_13__.getMetrics)(options.metricsRegister, options.metricsTopicStrToLabel, {\n gossipPromiseExpireSec: this.opts.gossipsubIWantFollowupMs / 1000,\n behaviourPenaltyThreshold: opts.scoreParams.behaviourPenaltyThreshold,\n maxMeshMessageDeliveriesWindowSec: maxMeshMessageDeliveriesWindowMs / 1000\n });\n metrics.mcacheSize.addCollect(() => this.onScrapeMetrics(metrics));\n for (const protocol of this.multicodecs) {\n metrics.protocolsEnabled.set({ protocol }, 1);\n }\n this.metrics = metrics;\n }\n else {\n this.metrics = null;\n }\n this.gossipTracer = new _tracer_js__WEBPACK_IMPORTED_MODULE_11__.IWantTracer(this.opts.gossipsubIWantFollowupMs, this.msgIdToStrFn, this.metrics);\n /**\n * libp2p\n */\n this.score = new _score_index_js__WEBPACK_IMPORTED_MODULE_10__.PeerScore(this.opts.scoreParams, this.metrics, {\n scoreCacheValidityMs: opts.heartbeatInterval\n });\n this.maxInboundStreams = options.maxInboundStreams;\n this.maxOutboundStreams = options.maxOutboundStreams;\n this.allowedTopics = opts.allowedTopics ? new Set(opts.allowedTopics) : null;\n }\n getPeers() {\n return [...this.peers.keys()].map((str) => (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_2__.peerIdFromString)(str));\n }\n isStarted() {\n return this.status.code === GossipStatusCode.started;\n }\n // LIFECYCLE METHODS\n /**\n * Mounts the gossipsub protocol onto the libp2p node and sends our\n * our subscriptions to every peer connected\n */\n async start() {\n // From pubsub\n if (this.isStarted()) {\n return;\n }\n this.log('starting');\n this.publishConfig = await (0,_utils_publishConfig_js__WEBPACK_IMPORTED_MODULE_18__.getPublishConfigFromPeerId)(this.globalSignaturePolicy, this.components.peerId);\n // Create the outbound inflight queue\n // This ensures that outbound stream creation happens sequentially\n this.outboundInflightQueue = (0,it_pushable__WEBPACK_IMPORTED_MODULE_21__.pushable)({ objectMode: true });\n (0,it_pipe__WEBPACK_IMPORTED_MODULE_0__.pipe)(this.outboundInflightQueue, async (source) => {\n for await (const { peerId, connection } of source) {\n await this.createOutboundStream(peerId, connection);\n }\n }).catch((e) => this.log.error('outbound inflight queue error', e));\n // set direct peer addresses in the address book\n await Promise.all(this.opts.directPeers.map(async (p) => {\n await this.components.peerStore.addressBook.add(p.id, p.addrs);\n }));\n const registrar = this.components.registrar;\n // Incoming streams\n // Called after a peer dials us\n await Promise.all(this.multicodecs.map((multicodec) => registrar.handle(multicodec, this.onIncomingStream.bind(this), {\n maxInboundStreams: this.maxInboundStreams,\n maxOutboundStreams: this.maxOutboundStreams\n })));\n // # How does Gossipsub interact with libp2p? Rough guide from Mar 2022\n //\n // ## Setup:\n // Gossipsub requests libp2p to callback, TBD\n //\n // `this.libp2p.handle()` registers a handler for `/meshsub/1.1.0` and other Gossipsub protocols\n // The handler callback is registered in libp2p Upgrader.protocols map.\n //\n // Upgrader receives an inbound connection from some transport and (`Upgrader.upgradeInbound`):\n // - Adds encryption (NOISE in our case)\n // - Multiplex stream\n // - Create a muxer and register that for each new stream call Upgrader.protocols handler\n //\n // ## Topology\n // - new instance of Topology (unlinked to libp2p) with handlers\n // - registar.register(topology)\n // register protocol with topology\n // Topology callbacks called on connection manager changes\n const topology = (0,_libp2p_topology__WEBPACK_IMPORTED_MODULE_4__.createTopology)({\n onConnect: this.onPeerConnected.bind(this),\n onDisconnect: this.onPeerDisconnected.bind(this)\n });\n const registrarTopologyIds = await Promise.all(this.multicodecs.map((multicodec) => registrar.register(multicodec, topology)));\n // Schedule to start heartbeat after `GossipsubHeartbeatInitialDelay`\n const heartbeatTimeout = setTimeout(this.runHeartbeat, _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubHeartbeatInitialDelay);\n // Then, run heartbeat every `heartbeatInterval` offset by `GossipsubHeartbeatInitialDelay`\n this.status = {\n code: GossipStatusCode.started,\n registrarTopologyIds,\n heartbeatTimeout: heartbeatTimeout,\n hearbeatStartMs: Date.now() + _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubHeartbeatInitialDelay\n };\n this.score.start();\n // connect to direct peers\n this.directPeerInitial = setTimeout(() => {\n Promise.resolve()\n .then(async () => {\n await Promise.all(Array.from(this.direct).map(async (id) => await this.connect(id)));\n })\n .catch((err) => {\n this.log(err);\n });\n }, _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubDirectConnectInitialDelay);\n this.log('started');\n }\n /**\n * Unmounts the gossipsub protocol and shuts down every connection\n */\n async stop() {\n this.log('stopping');\n // From pubsub\n if (this.status.code !== GossipStatusCode.started) {\n return;\n }\n const { registrarTopologyIds } = this.status;\n this.status = { code: GossipStatusCode.stopped };\n // unregister protocol and handlers\n const registrar = this.components.registrar;\n registrarTopologyIds.forEach((id) => registrar.unregister(id));\n this.outboundInflightQueue.end();\n for (const outboundStream of this.streamsOutbound.values()) {\n outboundStream.close();\n }\n this.streamsOutbound.clear();\n for (const inboundStream of this.streamsInbound.values()) {\n inboundStream.close();\n }\n this.streamsInbound.clear();\n this.peers.clear();\n this.subscriptions.clear();\n // Gossipsub\n if (this.heartbeatTimer) {\n this.heartbeatTimer.cancel();\n this.heartbeatTimer = null;\n }\n this.score.stop();\n this.mesh.clear();\n this.fanout.clear();\n this.fanoutLastpub.clear();\n this.gossip.clear();\n this.control.clear();\n this.peerhave.clear();\n this.iasked.clear();\n this.backoff.clear();\n this.outbound.clear();\n this.gossipTracer.clear();\n this.seenCache.clear();\n if (this.fastMsgIdCache)\n this.fastMsgIdCache.clear();\n if (this.directPeerInitial)\n clearTimeout(this.directPeerInitial);\n this.log('stopped');\n }\n /** FOR DEBUG ONLY - Dump peer stats for all peers. Data is cloned, safe to mutate */\n dumpPeerScoreStats() {\n return this.score.dumpPeerScoreStats();\n }\n /**\n * On an inbound stream opened\n */\n onIncomingStream({ stream, connection }) {\n if (!this.isStarted()) {\n return;\n }\n const peerId = connection.remotePeer;\n // add peer to router\n this.addPeer(peerId, connection.stat.direction, connection.remoteAddr);\n // create inbound stream\n this.createInboundStream(peerId, stream);\n // attempt to create outbound stream\n this.outboundInflightQueue.push({ peerId, connection });\n }\n /**\n * Registrar notifies an established connection with pubsub protocol\n */\n onPeerConnected(peerId, connection) {\n this.metrics?.newConnectionCount.inc({ status: connection.stat.status });\n // libp2p may emit a closed connection and never issue peer:disconnect event\n // see https://github.com/ChainSafe/js-libp2p-gossipsub/issues/398\n if (!this.isStarted() || connection.stat.status !== 'OPEN') {\n return;\n }\n this.addPeer(peerId, connection.stat.direction, connection.remoteAddr);\n this.outboundInflightQueue.push({ peerId, connection });\n }\n /**\n * Registrar notifies a closing connection with pubsub protocol\n */\n onPeerDisconnected(peerId) {\n this.log('connection ended %p', peerId);\n this.removePeer(peerId);\n }\n async createOutboundStream(peerId, connection) {\n if (!this.isStarted()) {\n return;\n }\n const id = peerId.toString();\n if (!this.peers.has(id)) {\n return;\n }\n // TODO make this behavior more robust\n // This behavior is different than for inbound streams\n // If an outbound stream already exists, don't create a new stream\n if (this.streamsOutbound.has(id)) {\n return;\n }\n try {\n const stream = new _stream_js__WEBPACK_IMPORTED_MODULE_22__.OutboundStream(await connection.newStream(this.multicodecs), (e) => this.log.error('outbound pipe error', e), { maxBufferSize: this.opts.maxOutboundBufferSize });\n this.log('create outbound stream %p', peerId);\n this.streamsOutbound.set(id, stream);\n const protocol = stream.protocol;\n if (protocol === _constants_js__WEBPACK_IMPORTED_MODULE_8__.FloodsubID) {\n this.floodsubPeers.add(id);\n }\n this.metrics?.peersPerProtocol.inc({ protocol }, 1);\n // Immediately send own subscriptions via the newly attached stream\n if (this.subscriptions.size > 0) {\n this.log('send subscriptions to', id);\n this.sendSubscriptions(id, Array.from(this.subscriptions), true);\n }\n }\n catch (e) {\n this.log.error('createOutboundStream error', e);\n }\n }\n async createInboundStream(peerId, stream) {\n if (!this.isStarted()) {\n return;\n }\n const id = peerId.toString();\n if (!this.peers.has(id)) {\n return;\n }\n // TODO make this behavior more robust\n // This behavior is different than for outbound streams\n // If a peer initiates a new inbound connection\n // we assume that one is the new canonical inbound stream\n const priorInboundStream = this.streamsInbound.get(id);\n if (priorInboundStream !== undefined) {\n this.log('replacing existing inbound steam %s', id);\n priorInboundStream.close();\n }\n this.log('create inbound stream %s', id);\n const inboundStream = new _stream_js__WEBPACK_IMPORTED_MODULE_22__.InboundStream(stream, { maxDataLength: this.opts.maxInboundDataLength });\n this.streamsInbound.set(id, inboundStream);\n this.pipePeerReadStream(peerId, inboundStream.source).catch((err) => this.log(err));\n }\n /**\n * Add a peer to the router\n */\n addPeer(peerId, direction, addr) {\n const id = peerId.toString();\n if (!this.peers.has(id)) {\n this.log('new peer %p', peerId);\n this.peers.add(id);\n // Add to peer scoring\n this.score.addPeer(id);\n const currentIP = (0,_utils_multiaddr_js__WEBPACK_IMPORTED_MODULE_24__.multiaddrToIPStr)(addr);\n if (currentIP !== null) {\n this.score.addIP(id, currentIP);\n }\n else {\n this.log('Added peer has no IP in current address %s %s', id, addr.toString());\n }\n // track the connection direction. Don't allow to unset outbound\n if (!this.outbound.has(id)) {\n this.outbound.set(id, direction === 'outbound');\n }\n }\n }\n /**\n * Removes a peer from the router\n */\n removePeer(peerId) {\n const id = peerId.toString();\n if (!this.peers.has(id)) {\n return;\n }\n // delete peer\n this.log('delete peer %p', peerId);\n this.peers.delete(id);\n const outboundStream = this.streamsOutbound.get(id);\n const inboundStream = this.streamsInbound.get(id);\n if (outboundStream) {\n this.metrics?.peersPerProtocol.inc({ protocol: outboundStream.protocol }, -1);\n }\n // close streams\n outboundStream?.close();\n inboundStream?.close();\n // remove streams\n this.streamsOutbound.delete(id);\n this.streamsInbound.delete(id);\n // remove peer from topics map\n for (const peers of this.topics.values()) {\n peers.delete(id);\n }\n // Remove this peer from the mesh\n for (const [topicStr, peers] of this.mesh) {\n if (peers.delete(id) === true) {\n this.metrics?.onRemoveFromMesh(topicStr, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.ChurnReason.Dc, 1);\n }\n }\n // Remove this peer from the fanout\n for (const peers of this.fanout.values()) {\n peers.delete(id);\n }\n // Remove from floodsubPeers\n this.floodsubPeers.delete(id);\n // Remove from gossip mapping\n this.gossip.delete(id);\n // Remove from control mapping\n this.control.delete(id);\n // Remove from backoff mapping\n this.outbound.delete(id);\n // Remove from peer scoring\n this.score.removePeer(id);\n this.acceptFromWhitelist.delete(id);\n }\n // API METHODS\n get started() {\n return this.status.code === GossipStatusCode.started;\n }\n /**\n * Get a the peer-ids in a topic mesh\n */\n getMeshPeers(topic) {\n const peersInTopic = this.mesh.get(topic);\n return peersInTopic ? Array.from(peersInTopic) : [];\n }\n /**\n * Get a list of the peer-ids that are subscribed to one topic.\n */\n getSubscribers(topic) {\n const peersInTopic = this.topics.get(topic);\n return (peersInTopic ? Array.from(peersInTopic) : []).map((str) => (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_2__.peerIdFromString)(str));\n }\n /**\n * Get the list of topics which the peer is subscribed to.\n */\n getTopics() {\n return Array.from(this.subscriptions);\n }\n // TODO: Reviewing Pubsub API\n // MESSAGE METHODS\n /**\n * Responsible for processing each RPC message received by other peers.\n */\n async pipePeerReadStream(peerId, stream) {\n try {\n await (0,it_pipe__WEBPACK_IMPORTED_MODULE_0__.pipe)(stream, async (source) => {\n for await (const data of source) {\n try {\n // TODO: Check max gossip message size, before decodeRpc()\n const rpcBytes = data.subarray();\n // Note: This function may throw, it must be wrapped in a try {} catch {} to prevent closing the stream.\n // TODO: What should we do if the entire RPC is invalid?\n const rpc = (0,_message_decodeRpc_js__WEBPACK_IMPORTED_MODULE_23__.decodeRpc)(rpcBytes, this.decodeRpcLimits);\n this.metrics?.onRpcRecv(rpc, rpcBytes.length);\n // Since processRpc may be overridden entirely in unsafe ways,\n // the simplest/safest option here is to wrap in a function and capture all errors\n // to prevent a top-level unhandled exception\n // This processing of rpc messages should happen without awaiting full validation/execution of prior messages\n if (this.opts.awaitRpcHandler) {\n try {\n await this.handleReceivedRpc(peerId, rpc);\n }\n catch (err) {\n this.metrics?.onRpcRecvError();\n this.log(err);\n }\n }\n else {\n this.handleReceivedRpc(peerId, rpc).catch((err) => {\n this.metrics?.onRpcRecvError();\n this.log(err);\n });\n }\n }\n catch (e) {\n this.metrics?.onRpcDataError();\n this.log(e);\n }\n }\n });\n }\n catch (err) {\n this.metrics?.onPeerReadStreamError();\n this.handlePeerReadStreamError(err, peerId);\n }\n }\n /**\n * Handle error when read stream pipe throws, less of the functional use but more\n * to for testing purposes to spy on the error handling\n * */\n handlePeerReadStreamError(err, peerId) {\n this.log.error(err);\n this.onPeerDisconnected(peerId);\n }\n /**\n * Handles an rpc request from a peer\n */\n async handleReceivedRpc(from, rpc) {\n // Check if peer is graylisted in which case we ignore the event\n if (!this.acceptFrom(from.toString())) {\n this.log('received message from unacceptable peer %p', from);\n this.metrics?.rpcRecvNotAccepted.inc();\n return;\n }\n const subscriptions = rpc.subscriptions ? rpc.subscriptions.length : 0;\n const messages = rpc.messages ? rpc.messages.length : 0;\n let ihave = 0;\n let iwant = 0;\n let graft = 0;\n let prune = 0;\n if (rpc.control) {\n if (rpc.control.ihave)\n ihave = rpc.control.ihave.length;\n if (rpc.control.iwant)\n iwant = rpc.control.iwant.length;\n if (rpc.control.graft)\n graft = rpc.control.graft.length;\n if (rpc.control.prune)\n prune = rpc.control.prune.length;\n }\n this.log(`rpc.from ${from.toString()} subscriptions ${subscriptions} messages ${messages} ihave ${ihave} iwant ${iwant} graft ${graft} prune ${prune}`);\n // Handle received subscriptions\n if (rpc.subscriptions && rpc.subscriptions.length > 0) {\n // update peer subscriptions\n const subscriptions = [];\n rpc.subscriptions.forEach((subOpt) => {\n const topic = subOpt.topic;\n const subscribe = subOpt.subscribe === true;\n if (topic != null) {\n if (this.allowedTopics && !this.allowedTopics.has(topic)) {\n // Not allowed: subscription data-structures are not bounded by topic count\n // TODO: Should apply behaviour penalties?\n return;\n }\n this.handleReceivedSubscription(from, topic, subscribe);\n subscriptions.push({ topic, subscribe });\n }\n });\n this.dispatchEvent(new _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__.CustomEvent('subscription-change', {\n detail: { peerId: from, subscriptions }\n }));\n }\n // Handle messages\n // TODO: (up to limit)\n if (rpc.messages) {\n for (const message of rpc.messages) {\n if (this.allowedTopics && !this.allowedTopics.has(message.topic)) {\n // Not allowed: message cache data-structures are not bounded by topic count\n // TODO: Should apply behaviour penalties?\n continue;\n }\n const handleReceivedMessagePromise = this.handleReceivedMessage(from, message)\n // Should never throw, but handle just in case\n .catch((err) => {\n this.metrics?.onMsgRecvError(message.topic);\n this.log(err);\n });\n if (this.opts.awaitRpcMessageHandler) {\n await handleReceivedMessagePromise;\n }\n }\n }\n // Handle control messages\n if (rpc.control) {\n await this.handleControlMessage(from.toString(), rpc.control);\n }\n }\n /**\n * Handles a subscription change from a peer\n */\n handleReceivedSubscription(from, topic, subscribe) {\n this.log('subscription update from %p topic %s', from, topic);\n let topicSet = this.topics.get(topic);\n if (topicSet == null) {\n topicSet = new Set();\n this.topics.set(topic, topicSet);\n }\n if (subscribe) {\n // subscribe peer to new topic\n topicSet.add(from.toString());\n }\n else {\n // unsubscribe from existing topic\n topicSet.delete(from.toString());\n }\n // TODO: rust-libp2p has A LOT more logic here\n }\n /**\n * Handles a newly received message from an RPC.\n * May forward to all peers in the mesh.\n */\n async handleReceivedMessage(from, rpcMsg) {\n this.metrics?.onMsgRecvPreValidation(rpcMsg.topic);\n const validationResult = await this.validateReceivedMessage(from, rpcMsg);\n this.metrics?.onMsgRecvResult(rpcMsg.topic, validationResult.code);\n switch (validationResult.code) {\n case _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.duplicate:\n // Report the duplicate\n this.score.duplicateMessage(from.toString(), validationResult.msgIdStr, rpcMsg.topic);\n // due to the collision of fastMsgIdFn, 2 different messages may end up the same fastMsgId\n // so we need to also mark the duplicate message as delivered or the promise is not resolved\n // and peer gets penalized. See https://github.com/ChainSafe/js-libp2p-gossipsub/pull/385\n this.gossipTracer.deliverMessage(validationResult.msgIdStr, true);\n this.mcache.observeDuplicate(validationResult.msgIdStr, from.toString());\n return;\n case _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.invalid:\n // invalid messages received\n // metrics.register_invalid_message(&raw_message.topic)\n // Tell peer_score about reject\n // Reject the original source, and any duplicates we've seen from other peers.\n if (validationResult.msgIdStr) {\n const msgIdStr = validationResult.msgIdStr;\n this.score.rejectMessage(from.toString(), msgIdStr, rpcMsg.topic, validationResult.reason);\n this.gossipTracer.rejectMessage(msgIdStr, validationResult.reason);\n }\n else {\n this.score.rejectInvalidMessage(from.toString(), rpcMsg.topic);\n }\n this.metrics?.onMsgRecvInvalid(rpcMsg.topic, validationResult);\n return;\n case _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.valid:\n // Tells score that message arrived (but is maybe not fully validated yet).\n // Consider the message as delivered for gossip promises.\n this.score.validateMessage(validationResult.messageId.msgIdStr);\n this.gossipTracer.deliverMessage(validationResult.messageId.msgIdStr);\n // Add the message to our memcache\n // if no validation is required, mark the message as validated\n this.mcache.put(validationResult.messageId, rpcMsg, !this.opts.asyncValidation);\n // Dispatch the message to the user if we are subscribed to the topic\n if (this.subscriptions.has(rpcMsg.topic)) {\n const isFromSelf = this.components.peerId.equals(from);\n if (!isFromSelf || this.opts.emitSelf) {\n super.dispatchEvent(new _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__.CustomEvent('gossipsub:message', {\n detail: {\n propagationSource: from,\n msgId: validationResult.messageId.msgIdStr,\n msg: validationResult.msg\n }\n }));\n // TODO: Add option to switch between emit per topic or all messages in one\n super.dispatchEvent(new _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__.CustomEvent('message', { detail: validationResult.msg }));\n }\n }\n // Forward the message to mesh peers, if no validation is required\n // If asyncValidation is ON, expect the app layer to call reportMessageValidationResult(), then forward\n if (!this.opts.asyncValidation) {\n // TODO: in rust-libp2p\n // .forward_msg(&msg_id, raw_message, Some(propagation_source))\n this.forwardMessage(validationResult.messageId.msgIdStr, rpcMsg, from.toString());\n }\n }\n }\n /**\n * Handles a newly received message from an RPC.\n * May forward to all peers in the mesh.\n */\n async validateReceivedMessage(propagationSource, rpcMsg) {\n // Fast message ID stuff\n const fastMsgIdStr = this.fastMsgIdFn?.(rpcMsg);\n const msgIdCached = fastMsgIdStr !== undefined ? this.fastMsgIdCache?.get(fastMsgIdStr) : undefined;\n if (msgIdCached) {\n // This message has been seen previously. Ignore it\n return { code: _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.duplicate, msgIdStr: msgIdCached };\n }\n // Perform basic validation on message and convert to RawGossipsubMessage for fastMsgIdFn()\n const validationResult = await (0,_utils_buildRawMessage_js__WEBPACK_IMPORTED_MODULE_15__.validateToRawMessage)(this.globalSignaturePolicy, rpcMsg);\n if (!validationResult.valid) {\n return { code: _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.invalid, reason: _types_js__WEBPACK_IMPORTED_MODULE_14__.RejectReason.Error, error: validationResult.error };\n }\n const msg = validationResult.message;\n // Try and perform the data transform to the message. If it fails, consider it invalid.\n try {\n if (this.dataTransform) {\n msg.data = this.dataTransform.inboundTransform(rpcMsg.topic, msg.data);\n }\n }\n catch (e) {\n this.log('Invalid message, transform failed', e);\n return { code: _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.invalid, reason: _types_js__WEBPACK_IMPORTED_MODULE_14__.RejectReason.Error, error: _types_js__WEBPACK_IMPORTED_MODULE_14__.ValidateError.TransformFailed };\n }\n // TODO: Check if message is from a blacklisted source or propagation origin\n // - Reject any message from a blacklisted peer\n // - Also reject any message that originated from a blacklisted peer\n // - reject messages claiming to be from ourselves but not locally published\n // Calculate the message id on the transformed data.\n const msgId = await this.msgIdFn(msg);\n const msgIdStr = this.msgIdToStrFn(msgId);\n const messageId = { msgId, msgIdStr };\n // Add the message to the duplicate caches\n if (fastMsgIdStr !== undefined && this.fastMsgIdCache) {\n const collision = this.fastMsgIdCache.put(fastMsgIdStr, msgIdStr);\n if (collision) {\n this.metrics?.fastMsgIdCacheCollision.inc();\n }\n }\n if (this.seenCache.has(msgIdStr)) {\n return { code: _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.duplicate, msgIdStr };\n }\n else {\n this.seenCache.put(msgIdStr);\n }\n // (Optional) Provide custom validation here with dynamic validators per topic\n // NOTE: This custom topicValidator() must resolve fast (< 100ms) to allow scores\n // to not penalize peers for long validation times.\n const topicValidator = this.topicValidators.get(rpcMsg.topic);\n if (topicValidator != null) {\n let acceptance;\n // Use try {} catch {} in case topicValidator() is synchronous\n try {\n acceptance = await topicValidator(propagationSource, msg);\n }\n catch (e) {\n const errCode = e.code;\n if (errCode === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ERR_TOPIC_VALIDATOR_IGNORE)\n acceptance = _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.TopicValidatorResult.Ignore;\n if (errCode === _constants_js__WEBPACK_IMPORTED_MODULE_8__.ERR_TOPIC_VALIDATOR_REJECT)\n acceptance = _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.TopicValidatorResult.Reject;\n else\n acceptance = _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.TopicValidatorResult.Ignore;\n }\n if (acceptance !== _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.TopicValidatorResult.Accept) {\n return { code: _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.invalid, reason: (0,_types_js__WEBPACK_IMPORTED_MODULE_14__.rejectReasonFromAcceptance)(acceptance), msgIdStr };\n }\n }\n return { code: _types_js__WEBPACK_IMPORTED_MODULE_14__.MessageStatus.valid, messageId, msg };\n }\n /**\n * Return score of a peer.\n */\n getScore(peerId) {\n return this.score.score(peerId);\n }\n /**\n * Send an rpc object to a peer with subscriptions\n */\n sendSubscriptions(toPeer, topics, subscribe) {\n this.sendRpc(toPeer, {\n subscriptions: topics.map((topic) => ({ topic, subscribe }))\n });\n }\n /**\n * Handles an rpc control message from a peer\n */\n async handleControlMessage(id, controlMsg) {\n if (controlMsg === undefined) {\n return;\n }\n const iwant = controlMsg.ihave ? this.handleIHave(id, controlMsg.ihave) : [];\n const ihave = controlMsg.iwant ? this.handleIWant(id, controlMsg.iwant) : [];\n const prune = controlMsg.graft ? await this.handleGraft(id, controlMsg.graft) : [];\n controlMsg.prune && (await this.handlePrune(id, controlMsg.prune));\n if (!iwant.length && !ihave.length && !prune.length) {\n return;\n }\n const sent = this.sendRpc(id, { messages: ihave, control: { iwant, prune } });\n const iwantMessageIds = iwant[0]?.messageIDs;\n if (iwantMessageIds) {\n if (sent) {\n this.gossipTracer.addPromise(id, iwantMessageIds);\n }\n else {\n this.metrics?.iwantPromiseUntracked.inc(1);\n }\n }\n }\n /**\n * Whether to accept a message from a peer\n */\n acceptFrom(id) {\n if (this.direct.has(id)) {\n return true;\n }\n const now = Date.now();\n const entry = this.acceptFromWhitelist.get(id);\n if (entry && entry.messagesAccepted < _constants_js__WEBPACK_IMPORTED_MODULE_8__.ACCEPT_FROM_WHITELIST_MAX_MESSAGES && entry.acceptUntil >= now) {\n entry.messagesAccepted += 1;\n return true;\n }\n const score = this.score.score(id);\n if (score >= _constants_js__WEBPACK_IMPORTED_MODULE_8__.ACCEPT_FROM_WHITELIST_THRESHOLD_SCORE) {\n // peer is unlikely to be able to drop its score to `graylistThreshold`\n // after 128 messages or 1s\n this.acceptFromWhitelist.set(id, {\n messagesAccepted: 0,\n acceptUntil: now + _constants_js__WEBPACK_IMPORTED_MODULE_8__.ACCEPT_FROM_WHITELIST_DURATION_MS\n });\n }\n else {\n this.acceptFromWhitelist.delete(id);\n }\n return score >= this.opts.scoreThresholds.graylistThreshold;\n }\n /**\n * Handles IHAVE messages\n */\n handleIHave(id, ihave) {\n if (!ihave.length) {\n return [];\n }\n // we ignore IHAVE gossip from any peer whose score is below the gossips threshold\n const score = this.score.score(id);\n if (score < this.opts.scoreThresholds.gossipThreshold) {\n this.log('IHAVE: ignoring peer %s with score below threshold [ score = %d ]', id, score);\n this.metrics?.ihaveRcvIgnored.inc({ reason: _metrics_js__WEBPACK_IMPORTED_MODULE_13__.IHaveIgnoreReason.LowScore });\n return [];\n }\n // IHAVE flood protection\n const peerhave = (this.peerhave.get(id) ?? 0) + 1;\n this.peerhave.set(id, peerhave);\n if (peerhave > _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubMaxIHaveMessages) {\n this.log('IHAVE: peer %s has advertised too many times (%d) within this heartbeat interval; ignoring', id, peerhave);\n this.metrics?.ihaveRcvIgnored.inc({ reason: _metrics_js__WEBPACK_IMPORTED_MODULE_13__.IHaveIgnoreReason.MaxIhave });\n return [];\n }\n const iasked = this.iasked.get(id) ?? 0;\n if (iasked >= _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubMaxIHaveLength) {\n this.log('IHAVE: peer %s has already advertised too many messages (%d); ignoring', id, iasked);\n this.metrics?.ihaveRcvIgnored.inc({ reason: _metrics_js__WEBPACK_IMPORTED_MODULE_13__.IHaveIgnoreReason.MaxIasked });\n return [];\n }\n // string msgId => msgId\n const iwant = new Map();\n ihave.forEach(({ topicID, messageIDs }) => {\n if (!topicID || !messageIDs || !this.mesh.has(topicID)) {\n return;\n }\n let idonthave = 0;\n messageIDs.forEach((msgId) => {\n const msgIdStr = this.msgIdToStrFn(msgId);\n if (!this.seenCache.has(msgIdStr)) {\n iwant.set(msgIdStr, msgId);\n idonthave++;\n }\n });\n this.metrics?.onIhaveRcv(topicID, messageIDs.length, idonthave);\n });\n if (!iwant.size) {\n return [];\n }\n let iask = iwant.size;\n if (iask + iasked > _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubMaxIHaveLength) {\n iask = _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubMaxIHaveLength - iasked;\n }\n this.log('IHAVE: Asking for %d out of %d messages from %s', iask, iwant.size, id);\n let iwantList = Array.from(iwant.values());\n // ask in random order\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(iwantList);\n // truncate to the messages we are actually asking for and update the iasked counter\n iwantList = iwantList.slice(0, iask);\n this.iasked.set(id, iasked + iask);\n // do not add gossipTracer promise here until a successful sendRpc()\n return [\n {\n messageIDs: iwantList\n }\n ];\n }\n /**\n * Handles IWANT messages\n * Returns messages to send back to peer\n */\n handleIWant(id, iwant) {\n if (!iwant.length) {\n return [];\n }\n // we don't respond to IWANT requests from any per whose score is below the gossip threshold\n const score = this.score.score(id);\n if (score < this.opts.scoreThresholds.gossipThreshold) {\n this.log('IWANT: ignoring peer %s with score below threshold [score = %d]', id, score);\n return [];\n }\n const ihave = new Map();\n const iwantByTopic = new Map();\n let iwantDonthave = 0;\n iwant.forEach(({ messageIDs }) => {\n messageIDs &&\n messageIDs.forEach((msgId) => {\n const msgIdStr = this.msgIdToStrFn(msgId);\n const entry = this.mcache.getWithIWantCount(msgIdStr, id);\n if (entry == null) {\n iwantDonthave++;\n return;\n }\n iwantByTopic.set(entry.msg.topic, 1 + (iwantByTopic.get(entry.msg.topic) ?? 0));\n if (entry.count > _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubGossipRetransmission) {\n this.log('IWANT: Peer %s has asked for message %s too many times: ignoring request', id, msgId);\n return;\n }\n ihave.set(msgIdStr, entry.msg);\n });\n });\n this.metrics?.onIwantRcv(iwantByTopic, iwantDonthave);\n if (!ihave.size) {\n this.log('IWANT: Could not provide any wanted messages to %s', id);\n return [];\n }\n this.log('IWANT: Sending %d messages to %s', ihave.size, id);\n return Array.from(ihave.values());\n }\n /**\n * Handles Graft messages\n */\n async handleGraft(id, graft) {\n const prune = [];\n const score = this.score.score(id);\n const now = Date.now();\n let doPX = this.opts.doPX;\n graft.forEach(({ topicID }) => {\n if (!topicID) {\n return;\n }\n const peersInMesh = this.mesh.get(topicID);\n if (!peersInMesh) {\n // don't do PX when there is an unknown topic to avoid leaking our peers\n doPX = false;\n // spam hardening: ignore GRAFTs for unknown topics\n return;\n }\n // check if peer is already in the mesh; if so do nothing\n if (peersInMesh.has(id)) {\n return;\n }\n // we don't GRAFT to/from direct peers; complain loudly if this happens\n if (this.direct.has(id)) {\n this.log('GRAFT: ignoring request from direct peer %s', id);\n // this is possibly a bug from a non-reciprical configuration; send a PRUNE\n prune.push(topicID);\n // but don't px\n doPX = false;\n return;\n }\n // make sure we are not backing off that peer\n const expire = this.backoff.get(topicID)?.get(id);\n if (typeof expire === 'number' && now < expire) {\n this.log('GRAFT: ignoring backed off peer %s', id);\n // add behavioral penalty\n this.score.addPenalty(id, 1, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.ScorePenalty.GraftBackoff);\n // no PX\n doPX = false;\n // check the flood cutoff -- is the GRAFT coming too fast?\n const floodCutoff = expire + this.opts.graftFloodThreshold - this.opts.pruneBackoff;\n if (now < floodCutoff) {\n // extra penalty\n this.score.addPenalty(id, 1, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.ScorePenalty.GraftBackoff);\n }\n // refresh the backoff\n this.addBackoff(id, topicID);\n prune.push(topicID);\n return;\n }\n // check the score\n if (score < 0) {\n // we don't GRAFT peers with negative score\n this.log('GRAFT: ignoring peer %s with negative score: score=%d, topic=%s', id, score, topicID);\n // we do send them PRUNE however, because it's a matter of protocol correctness\n prune.push(topicID);\n // but we won't PX to them\n doPX = false;\n // add/refresh backoff so that we don't reGRAFT too early even if the score decays\n this.addBackoff(id, topicID);\n return;\n }\n // check the number of mesh peers; if it is at (or over) Dhi, we only accept grafts\n // from peers with outbound connections; this is a defensive check to restrict potential\n // mesh takeover attacks combined with love bombing\n if (peersInMesh.size >= this.opts.Dhi && !this.outbound.get(id)) {\n prune.push(topicID);\n this.addBackoff(id, topicID);\n return;\n }\n this.log('GRAFT: Add mesh link from %s in %s', id, topicID);\n this.score.graft(id, topicID);\n peersInMesh.add(id);\n this.metrics?.onAddToMesh(topicID, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.InclusionReason.Subscribed, 1);\n });\n if (!prune.length) {\n return [];\n }\n return await Promise.all(prune.map((topic) => this.makePrune(id, topic, doPX)));\n }\n /**\n * Handles Prune messages\n */\n async handlePrune(id, prune) {\n const score = this.score.score(id);\n for (const { topicID, backoff, peers } of prune) {\n if (topicID == null) {\n continue;\n }\n const peersInMesh = this.mesh.get(topicID);\n if (!peersInMesh) {\n return;\n }\n this.log('PRUNE: Remove mesh link to %s in %s', id, topicID);\n this.score.prune(id, topicID);\n if (peersInMesh.has(id)) {\n peersInMesh.delete(id);\n this.metrics?.onRemoveFromMesh(topicID, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.ChurnReason.Unsub, 1);\n }\n // is there a backoff specified by the peer? if so obey it\n if (typeof backoff === 'number' && backoff > 0) {\n this.doAddBackoff(id, topicID, backoff * 1000);\n }\n else {\n this.addBackoff(id, topicID);\n }\n // PX\n if (peers && peers.length) {\n // we ignore PX from peers with insufficient scores\n if (score < this.opts.scoreThresholds.acceptPXThreshold) {\n this.log('PRUNE: ignoring PX from peer %s with insufficient score [score = %d, topic = %s]', id, score, topicID);\n continue;\n }\n await this.pxConnect(peers);\n }\n }\n }\n /**\n * Add standard backoff log for a peer in a topic\n */\n addBackoff(id, topic) {\n this.doAddBackoff(id, topic, this.opts.pruneBackoff);\n }\n /**\n * Add backoff expiry interval for a peer in a topic\n *\n * @param id\n * @param topic\n * @param interval - backoff duration in milliseconds\n */\n doAddBackoff(id, topic, interval) {\n let backoff = this.backoff.get(topic);\n if (!backoff) {\n backoff = new Map();\n this.backoff.set(topic, backoff);\n }\n const expire = Date.now() + interval;\n const existingExpire = backoff.get(id) ?? 0;\n if (existingExpire < expire) {\n backoff.set(id, expire);\n }\n }\n /**\n * Apply penalties from broken IHAVE/IWANT promises\n */\n applyIwantPenalties() {\n this.gossipTracer.getBrokenPromises().forEach((count, p) => {\n this.log(\"peer %s didn't follow up in %d IWANT requests; adding penalty\", p, count);\n this.score.addPenalty(p, count, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.ScorePenalty.BrokenPromise);\n });\n }\n /**\n * Clear expired backoff expiries\n */\n clearBackoff() {\n // we only clear once every GossipsubPruneBackoffTicks ticks to avoid iterating over the maps too much\n if (this.heartbeatTicks % _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubPruneBackoffTicks !== 0) {\n return;\n }\n const now = Date.now();\n this.backoff.forEach((backoff, topic) => {\n backoff.forEach((expire, id) => {\n if (expire < now) {\n backoff.delete(id);\n }\n });\n if (backoff.size === 0) {\n this.backoff.delete(topic);\n }\n });\n }\n /**\n * Maybe reconnect to direct peers\n */\n async directConnect() {\n const toconnect = [];\n this.direct.forEach((id) => {\n if (!this.streamsOutbound.has(id)) {\n toconnect.push(id);\n }\n });\n await Promise.all(toconnect.map(async (id) => await this.connect(id)));\n }\n /**\n * Maybe attempt connection given signed peer records\n */\n async pxConnect(peers) {\n if (peers.length > this.opts.prunePeers) {\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(peers);\n peers = peers.slice(0, this.opts.prunePeers);\n }\n const toconnect = [];\n await Promise.all(peers.map(async (pi) => {\n if (!pi.peerID) {\n return;\n }\n const p = (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_2__.peerIdFromBytes)(pi.peerID).toString();\n if (this.peers.has(p)) {\n return;\n }\n if (!pi.signedPeerRecord) {\n toconnect.push(p);\n return;\n }\n // The peer sent us a signed record\n // This is not a record from the peer who sent the record, but another peer who is connected with it\n // Ensure that it is valid\n try {\n const envelope = await _libp2p_peer_record__WEBPACK_IMPORTED_MODULE_1__.RecordEnvelope.openAndCertify(pi.signedPeerRecord, 'libp2p-peer-record');\n const eid = envelope.peerId;\n if (!envelope.peerId.equals(p)) {\n this.log(\"bogus peer record obtained through px: peer ID %p doesn't match expected peer %p\", eid, p);\n return;\n }\n if (!(await this.components.peerStore.addressBook.consumePeerRecord(envelope))) {\n this.log('bogus peer record obtained through px: could not add peer record to address book');\n return;\n }\n toconnect.push(p);\n }\n catch (e) {\n this.log('bogus peer record obtained through px: invalid signature or not a peer record');\n }\n }));\n if (!toconnect.length) {\n return;\n }\n await Promise.all(toconnect.map(async (id) => await this.connect(id)));\n }\n /**\n * Connect to a peer using the gossipsub protocol\n */\n async connect(id) {\n this.log('Initiating connection with %s', id);\n const peerId = (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_2__.peerIdFromString)(id);\n const connection = await this.components.connectionManager.openConnection(peerId);\n for (const multicodec of this.multicodecs) {\n for (const topology of this.components.registrar.getTopologies(multicodec)) {\n topology.onConnect(peerId, connection);\n }\n }\n }\n /**\n * Subscribes to a topic\n */\n subscribe(topic) {\n if (this.status.code !== GossipStatusCode.started) {\n throw new Error('Pubsub has not started');\n }\n if (!this.subscriptions.has(topic)) {\n this.subscriptions.add(topic);\n for (const peerId of this.peers.keys()) {\n this.sendSubscriptions(peerId, [topic], true);\n }\n }\n this.join(topic);\n }\n /**\n * Unsubscribe to a topic\n */\n unsubscribe(topic) {\n if (this.status.code !== GossipStatusCode.started) {\n throw new Error('Pubsub is not started');\n }\n const wasSubscribed = this.subscriptions.delete(topic);\n this.log('unsubscribe from %s - am subscribed %s', topic, wasSubscribed);\n if (wasSubscribed) {\n for (const peerId of this.peers.keys()) {\n this.sendSubscriptions(peerId, [topic], false);\n }\n }\n this.leave(topic);\n }\n /**\n * Join topic\n */\n join(topic) {\n if (this.status.code !== GossipStatusCode.started) {\n throw new Error('Gossipsub has not started');\n }\n // if we are already in the mesh, return\n if (this.mesh.has(topic)) {\n return;\n }\n this.log('JOIN %s', topic);\n this.metrics?.onJoin(topic);\n const toAdd = new Set();\n // check if we have mesh_n peers in fanout[topic] and add them to the mesh if we do,\n // removing the fanout entry.\n const fanoutPeers = this.fanout.get(topic);\n if (fanoutPeers) {\n // Remove fanout entry and the last published time\n this.fanout.delete(topic);\n this.fanoutLastpub.delete(topic);\n // remove explicit peers, peers with negative scores, and backoffed peers\n fanoutPeers.forEach((id) => {\n // TODO:rust-libp2p checks `self.backoffs.is_backoff_with_slack()`\n if (!this.direct.has(id) && this.score.score(id) >= 0) {\n toAdd.add(id);\n }\n });\n this.metrics?.onAddToMesh(topic, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.InclusionReason.Fanout, toAdd.size);\n }\n // check if we need to get more peers, which we randomly select\n if (toAdd.size < this.opts.D) {\n const fanoutCount = toAdd.size;\n const newPeers = this.getRandomGossipPeers(topic, this.opts.D, (id) => \n // filter direct peers and peers with negative score\n !toAdd.has(id) && !this.direct.has(id) && this.score.score(id) >= 0);\n newPeers.forEach((peer) => {\n toAdd.add(peer);\n });\n this.metrics?.onAddToMesh(topic, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.InclusionReason.Random, toAdd.size - fanoutCount);\n }\n this.mesh.set(topic, toAdd);\n toAdd.forEach((id) => {\n this.log('JOIN: Add mesh link to %s in %s', id, topic);\n this.sendGraft(id, topic);\n // rust-libp2p\n // - peer_score.graft()\n // - Self::control_pool_add()\n // - peer_added_to_mesh()\n });\n }\n /**\n * Leave topic\n */\n leave(topic) {\n if (this.status.code !== GossipStatusCode.started) {\n throw new Error('Gossipsub has not started');\n }\n this.log('LEAVE %s', topic);\n this.metrics?.onLeave(topic);\n // Send PRUNE to mesh peers\n const meshPeers = this.mesh.get(topic);\n if (meshPeers) {\n Promise.all(Array.from(meshPeers).map(async (id) => {\n this.log('LEAVE: Remove mesh link to %s in %s', id, topic);\n return await this.sendPrune(id, topic);\n })).catch((err) => {\n this.log('Error sending prunes to mesh peers', err);\n });\n this.mesh.delete(topic);\n }\n }\n selectPeersToForward(topic, propagationSource, excludePeers) {\n const tosend = new Set();\n // Add explicit peers\n const peersInTopic = this.topics.get(topic);\n if (peersInTopic) {\n this.direct.forEach((peer) => {\n if (peersInTopic.has(peer) && propagationSource !== peer && !excludePeers?.has(peer)) {\n tosend.add(peer);\n }\n });\n // As of Mar 2022, spec + golang-libp2p include this while rust-libp2p does not\n // rust-libp2p: https://github.com/libp2p/rust-libp2p/blob/6cc3b4ec52c922bfcf562a29b5805c3150e37c75/protocols/gossipsub/src/behaviour.rs#L2693\n // spec: https://github.com/libp2p/specs/blob/10712c55ab309086a52eec7d25f294df4fa96528/pubsub/gossipsub/gossipsub-v1.0.md?plain=1#L361\n this.floodsubPeers.forEach((peer) => {\n if (peersInTopic.has(peer) &&\n propagationSource !== peer &&\n !excludePeers?.has(peer) &&\n this.score.score(peer) >= this.opts.scoreThresholds.publishThreshold) {\n tosend.add(peer);\n }\n });\n }\n // add mesh peers\n const meshPeers = this.mesh.get(topic);\n if (meshPeers && meshPeers.size > 0) {\n meshPeers.forEach((peer) => {\n if (propagationSource !== peer && !excludePeers?.has(peer)) {\n tosend.add(peer);\n }\n });\n }\n return tosend;\n }\n selectPeersToPublish(topic) {\n const tosend = new Set();\n const tosendCount = {\n direct: 0,\n floodsub: 0,\n mesh: 0,\n fanout: 0\n };\n const peersInTopic = this.topics.get(topic);\n if (peersInTopic) {\n // flood-publish behavior\n // send to direct peers and _all_ peers meeting the publishThreshold\n if (this.opts.floodPublish) {\n peersInTopic.forEach((id) => {\n if (this.direct.has(id)) {\n tosend.add(id);\n tosendCount.direct++;\n }\n else if (this.score.score(id) >= this.opts.scoreThresholds.publishThreshold) {\n tosend.add(id);\n tosendCount.floodsub++;\n }\n });\n }\n else {\n // non-flood-publish behavior\n // send to direct peers, subscribed floodsub peers\n // and some mesh peers above publishThreshold\n // direct peers (if subscribed)\n this.direct.forEach((id) => {\n if (peersInTopic.has(id)) {\n tosend.add(id);\n tosendCount.direct++;\n }\n });\n // floodsub peers\n // Note: if there are no floodsub peers, we save a loop through peersInTopic Map\n this.floodsubPeers.forEach((id) => {\n if (peersInTopic.has(id) && this.score.score(id) >= this.opts.scoreThresholds.publishThreshold) {\n tosend.add(id);\n tosendCount.floodsub++;\n }\n });\n // Gossipsub peers handling\n const meshPeers = this.mesh.get(topic);\n if (meshPeers && meshPeers.size > 0) {\n meshPeers.forEach((peer) => {\n tosend.add(peer);\n tosendCount.mesh++;\n });\n }\n // We are not in the mesh for topic, use fanout peers\n else {\n const fanoutPeers = this.fanout.get(topic);\n if (fanoutPeers && fanoutPeers.size > 0) {\n fanoutPeers.forEach((peer) => {\n tosend.add(peer);\n tosendCount.fanout++;\n });\n }\n // We have no fanout peers, select mesh_n of them and add them to the fanout\n else {\n // If we are not in the fanout, then pick peers in topic above the publishThreshold\n const newFanoutPeers = this.getRandomGossipPeers(topic, this.opts.D, (id) => {\n return this.score.score(id) >= this.opts.scoreThresholds.publishThreshold;\n });\n if (newFanoutPeers.size > 0) {\n // eslint-disable-line max-depth\n this.fanout.set(topic, newFanoutPeers);\n newFanoutPeers.forEach((peer) => {\n // eslint-disable-line max-depth\n tosend.add(peer);\n tosendCount.fanout++;\n });\n }\n }\n // We are publishing to fanout peers - update the time we published\n this.fanoutLastpub.set(topic, Date.now());\n }\n }\n }\n return { tosend, tosendCount };\n }\n /**\n * Forwards a message from our peers.\n *\n * For messages published by us (the app layer), this class uses `publish`\n */\n forwardMessage(msgIdStr, rawMsg, propagationSource, excludePeers) {\n // message is fully validated inform peer_score\n if (propagationSource) {\n this.score.deliverMessage(propagationSource, msgIdStr, rawMsg.topic);\n }\n const tosend = this.selectPeersToForward(rawMsg.topic, propagationSource, excludePeers);\n // Note: Don't throw if tosend is empty, we can have a mesh with a single peer\n // forward the message to peers\n tosend.forEach((id) => {\n // sendRpc may mutate RPC message on piggyback, create a new message for each peer\n this.sendRpc(id, { messages: [rawMsg] });\n });\n this.metrics?.onForwardMsg(rawMsg.topic, tosend.size);\n }\n /**\n * App layer publishes a message to peers, return number of peers this message is published to\n * Note: `async` due to crypto only if `StrictSign`, otherwise it's a sync fn.\n *\n * For messages not from us, this class uses `forwardMessage`.\n */\n async publish(topic, data, opts) {\n const transformedData = this.dataTransform ? this.dataTransform.outboundTransform(topic, data) : data;\n if (this.publishConfig == null) {\n throw Error('PublishError.Uninitialized');\n }\n // Prepare raw message with user's publishConfig\n const { raw: rawMsg, msg } = await (0,_utils_buildRawMessage_js__WEBPACK_IMPORTED_MODULE_15__.buildRawMessage)(this.publishConfig, topic, data, transformedData);\n // calculate the message id from the un-transformed data\n const msgId = await this.msgIdFn(msg);\n const msgIdStr = this.msgIdToStrFn(msgId);\n // Current publish opt takes precedence global opts, while preserving false value\n const ignoreDuplicatePublishError = opts?.ignoreDuplicatePublishError ?? this.opts.ignoreDuplicatePublishError;\n if (this.seenCache.has(msgIdStr)) {\n // This message has already been seen. We don't re-publish messages that have already\n // been published on the network.\n if (ignoreDuplicatePublishError) {\n this.metrics?.onPublishDuplicateMsg(topic);\n return { recipients: [] };\n }\n throw Error('PublishError.Duplicate');\n }\n const { tosend, tosendCount } = this.selectPeersToPublish(topic);\n const willSendToSelf = this.opts.emitSelf === true && this.subscriptions.has(topic);\n // Current publish opt takes precedence global opts, while preserving false value\n const allowPublishToZeroPeers = opts?.allowPublishToZeroPeers ?? this.opts.allowPublishToZeroPeers;\n if (tosend.size === 0 && !allowPublishToZeroPeers && !willSendToSelf) {\n throw Error('PublishError.InsufficientPeers');\n }\n // If the message isn't a duplicate and we have sent it to some peers add it to the\n // duplicate cache and memcache.\n this.seenCache.put(msgIdStr);\n // all published messages are valid\n this.mcache.put({ msgId, msgIdStr }, rawMsg, true);\n // If the message is anonymous or has a random author add it to the published message ids cache.\n this.publishedMessageIds.put(msgIdStr);\n // Send to set of peers aggregated from direct, mesh, fanout\n for (const id of tosend) {\n // sendRpc may mutate RPC message on piggyback, create a new message for each peer\n const sent = this.sendRpc(id, { messages: [rawMsg] });\n // did not actually send the message\n if (!sent) {\n tosend.delete(id);\n }\n }\n this.metrics?.onPublishMsg(topic, tosendCount, tosend.size, rawMsg.data != null ? rawMsg.data.length : 0);\n // Dispatch the message to the user if we are subscribed to the topic\n if (willSendToSelf) {\n tosend.add(this.components.peerId.toString());\n super.dispatchEvent(new _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__.CustomEvent('gossipsub:message', {\n detail: {\n propagationSource: this.components.peerId,\n msgId: msgIdStr,\n msg\n }\n }));\n // TODO: Add option to switch between emit per topic or all messages in one\n super.dispatchEvent(new _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__.CustomEvent('message', { detail: msg }));\n }\n return {\n recipients: Array.from(tosend.values()).map((str) => (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_2__.peerIdFromString)(str))\n };\n }\n /**\n * This function should be called when `asyncValidation` is `true` after\n * the message got validated by the caller. Messages are stored in the `mcache` and\n * validation is expected to be fast enough that the messages should still exist in the cache.\n * There are three possible validation outcomes and the outcome is given in acceptance.\n *\n * If acceptance = `MessageAcceptance.Accept` the message will get propagated to the\n * network. The `propagation_source` parameter indicates who the message was received by and\n * will not be forwarded back to that peer.\n *\n * If acceptance = `MessageAcceptance.Reject` the message will be deleted from the memcache\n * and the P₄ penalty will be applied to the `propagationSource`.\n *\n * If acceptance = `MessageAcceptance.Ignore` the message will be deleted from the memcache\n * but no P₄ penalty will be applied.\n *\n * This function will return true if the message was found in the cache and false if was not\n * in the cache anymore.\n *\n * This should only be called once per message.\n */\n reportMessageValidationResult(msgId, propagationSource, acceptance) {\n if (acceptance === _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_19__.TopicValidatorResult.Accept) {\n const cacheEntry = this.mcache.validate(msgId);\n this.metrics?.onReportValidationMcacheHit(cacheEntry !== null);\n if (cacheEntry != null) {\n const { message: rawMsg, originatingPeers } = cacheEntry;\n // message is fully validated inform peer_score\n this.score.deliverMessage(propagationSource.toString(), msgId, rawMsg.topic);\n this.forwardMessage(msgId, cacheEntry.message, propagationSource.toString(), originatingPeers);\n this.metrics?.onReportValidation(rawMsg.topic, acceptance);\n }\n // else, Message not in cache. Ignoring forwarding\n }\n // Not valid\n else {\n const cacheEntry = this.mcache.remove(msgId);\n this.metrics?.onReportValidationMcacheHit(cacheEntry !== null);\n if (cacheEntry) {\n const rejectReason = (0,_types_js__WEBPACK_IMPORTED_MODULE_14__.rejectReasonFromAcceptance)(acceptance);\n const { message: rawMsg, originatingPeers } = cacheEntry;\n // Tell peer_score about reject\n // Reject the original source, and any duplicates we've seen from other peers.\n this.score.rejectMessage(propagationSource.toString(), msgId, rawMsg.topic, rejectReason);\n for (const peer of originatingPeers) {\n this.score.rejectMessage(peer, msgId, rawMsg.topic, rejectReason);\n }\n this.metrics?.onReportValidation(rawMsg.topic, acceptance);\n }\n // else, Message not in cache. Ignoring forwarding\n }\n }\n /**\n * Sends a GRAFT message to a peer\n */\n sendGraft(id, topic) {\n const graft = [\n {\n topicID: topic\n }\n ];\n this.sendRpc(id, { control: { graft } });\n }\n /**\n * Sends a PRUNE message to a peer\n */\n async sendPrune(id, topic) {\n const prune = [await this.makePrune(id, topic, this.opts.doPX)];\n this.sendRpc(id, { control: { prune } });\n }\n /**\n * Send an rpc object to a peer\n */\n sendRpc(id, rpc) {\n const outboundStream = this.streamsOutbound.get(id);\n if (!outboundStream) {\n this.log(`Cannot send RPC to ${id} as there is no open stream to it available`);\n return false;\n }\n // piggyback control message retries\n const ctrl = this.control.get(id);\n if (ctrl) {\n this.piggybackControl(id, rpc, ctrl);\n this.control.delete(id);\n }\n // piggyback gossip\n const ihave = this.gossip.get(id);\n if (ihave) {\n this.piggybackGossip(id, rpc, ihave);\n this.gossip.delete(id);\n }\n const rpcBytes = _message_rpc_js__WEBPACK_IMPORTED_MODULE_7__.RPC.encode(rpc).finish();\n try {\n outboundStream.push(rpcBytes);\n }\n catch (e) {\n this.log.error(`Cannot send rpc to ${id}`, e);\n // if the peer had control messages or gossip, re-attach\n if (ctrl) {\n this.control.set(id, ctrl);\n }\n if (ihave) {\n this.gossip.set(id, ihave);\n }\n return false;\n }\n this.metrics?.onRpcSent(rpc, rpcBytes.length);\n return true;\n }\n /** Mutates `outRpc` adding graft and prune control messages */\n piggybackControl(id, outRpc, ctrl) {\n if (ctrl.graft) {\n if (!outRpc.control)\n outRpc.control = {};\n if (!outRpc.control.graft)\n outRpc.control.graft = [];\n for (const graft of ctrl.graft) {\n if (graft.topicID && this.mesh.get(graft.topicID)?.has(id)) {\n outRpc.control.graft.push(graft);\n }\n }\n }\n if (ctrl.prune) {\n if (!outRpc.control)\n outRpc.control = {};\n if (!outRpc.control.prune)\n outRpc.control.prune = [];\n for (const prune of ctrl.prune) {\n if (prune.topicID && !this.mesh.get(prune.topicID)?.has(id)) {\n outRpc.control.prune.push(prune);\n }\n }\n }\n }\n /** Mutates `outRpc` adding ihave control messages */\n piggybackGossip(id, outRpc, ihave) {\n if (!outRpc.control)\n outRpc.control = {};\n outRpc.control.ihave = ihave;\n }\n /**\n * Send graft and prune messages\n *\n * @param tograft - peer id => topic[]\n * @param toprune - peer id => topic[]\n */\n async sendGraftPrune(tograft, toprune, noPX) {\n const doPX = this.opts.doPX;\n for (const [id, topics] of tograft) {\n const graft = topics.map((topicID) => ({ topicID }));\n let prune = [];\n // If a peer also has prunes, process them now\n const pruning = toprune.get(id);\n if (pruning) {\n prune = await Promise.all(pruning.map(async (topicID) => await this.makePrune(id, topicID, doPX && !(noPX.get(id) ?? false))));\n toprune.delete(id);\n }\n this.sendRpc(id, { control: { graft, prune } });\n }\n for (const [id, topics] of toprune) {\n const prune = await Promise.all(topics.map(async (topicID) => await this.makePrune(id, topicID, doPX && !(noPX.get(id) ?? false))));\n this.sendRpc(id, { control: { prune } });\n }\n }\n /**\n * Emits gossip - Send IHAVE messages to a random set of gossip peers\n */\n emitGossip(peersToGossipByTopic) {\n const gossipIDsByTopic = this.mcache.getGossipIDs(new Set(peersToGossipByTopic.keys()));\n for (const [topic, peersToGossip] of peersToGossipByTopic) {\n this.doEmitGossip(topic, peersToGossip, gossipIDsByTopic.get(topic) ?? []);\n }\n }\n /**\n * Send gossip messages to GossipFactor peers above threshold with a minimum of D_lazy\n * Peers are randomly selected from the heartbeat which exclude mesh + fanout peers\n * We also exclude direct peers, as there is no reason to emit gossip to them\n * @param topic\n * @param candidateToGossip - peers to gossip\n * @param messageIDs - message ids to gossip\n */\n doEmitGossip(topic, candidateToGossip, messageIDs) {\n if (!messageIDs.length) {\n return;\n }\n // shuffle to emit in random order\n (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(messageIDs);\n // if we are emitting more than GossipsubMaxIHaveLength ids, truncate the list\n if (messageIDs.length > _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubMaxIHaveLength) {\n // we do the truncation (with shuffling) per peer below\n this.log('too many messages for gossip; will truncate IHAVE list (%d messages)', messageIDs.length);\n }\n if (!candidateToGossip.size)\n return;\n let target = this.opts.Dlazy;\n const factor = _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubGossipFactor * candidateToGossip.size;\n let peersToGossip = candidateToGossip;\n if (factor > target) {\n target = factor;\n }\n if (target > peersToGossip.size) {\n target = peersToGossip.size;\n }\n else {\n // only shuffle if needed\n peersToGossip = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(Array.from(peersToGossip)).slice(0, target);\n }\n // Emit the IHAVE gossip to the selected peers up to the target\n peersToGossip.forEach((id) => {\n let peerMessageIDs = messageIDs;\n if (messageIDs.length > _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubMaxIHaveLength) {\n // shuffle and slice message IDs per peer so that we emit a different set for each peer\n // we have enough reduncancy in the system that this will significantly increase the message\n // coverage when we do truncate\n peerMessageIDs = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(peerMessageIDs.slice()).slice(0, _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubMaxIHaveLength);\n }\n this.pushGossip(id, {\n topicID: topic,\n messageIDs: peerMessageIDs\n });\n });\n }\n /**\n * Flush gossip and control messages\n */\n flush() {\n // send gossip first, which will also piggyback control\n for (const [peer, ihave] of this.gossip.entries()) {\n this.gossip.delete(peer);\n this.sendRpc(peer, { control: { ihave } });\n }\n // send the remaining control messages\n for (const [peer, control] of this.control.entries()) {\n this.control.delete(peer);\n this.sendRpc(peer, { control: { graft: control.graft, prune: control.prune } });\n }\n }\n /**\n * Adds new IHAVE messages to pending gossip\n */\n pushGossip(id, controlIHaveMsgs) {\n this.log('Add gossip to %s', id);\n const gossip = this.gossip.get(id) || [];\n this.gossip.set(id, gossip.concat(controlIHaveMsgs));\n }\n /**\n * Make a PRUNE control message for a peer in a topic\n */\n async makePrune(id, topic, doPX) {\n this.score.prune(id, topic);\n if (this.streamsOutbound.get(id).protocol === _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubIDv10) {\n // Gossipsub v1.0 -- no backoff, the peer won't be able to parse it anyway\n return {\n topicID: topic,\n peers: []\n };\n }\n // backoff is measured in seconds\n // GossipsubPruneBackoff is measured in milliseconds\n // The protobuf has it as a uint64\n const backoff = this.opts.pruneBackoff / 1000;\n if (!doPX) {\n return {\n topicID: topic,\n peers: [],\n backoff: backoff\n };\n }\n // select peers for Peer eXchange\n const peers = this.getRandomGossipPeers(topic, this.opts.prunePeers, (xid) => {\n return xid !== id && this.score.score(xid) >= 0;\n });\n const px = await Promise.all(Array.from(peers).map(async (peerId) => {\n // see if we have a signed record to send back; if we don't, just send\n // the peer ID and let the pruned peer find them in the DHT -- we can't trust\n // unsigned address records through PX anyways\n // Finding signed records in the DHT is not supported at the time of writing in js-libp2p\n const id = (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_2__.peerIdFromString)(peerId);\n return {\n peerID: id.toBytes(),\n signedPeerRecord: await this.components.peerStore.addressBook.getRawEnvelope(id)\n };\n }));\n return {\n topicID: topic,\n peers: px,\n backoff: backoff\n };\n }\n /**\n * Maintains the mesh and fanout maps in gossipsub.\n */\n async heartbeat() {\n const { D, Dlo, Dhi, Dscore, Dout, fanoutTTL } = this.opts;\n this.heartbeatTicks++;\n // cache scores throught the heartbeat\n const scores = new Map();\n const getScore = (id) => {\n let s = scores.get(id);\n if (s === undefined) {\n s = this.score.score(id);\n scores.set(id, s);\n }\n return s;\n };\n // peer id => topic[]\n const tograft = new Map();\n // peer id => topic[]\n const toprune = new Map();\n // peer id => don't px\n const noPX = new Map();\n // clean up expired backoffs\n this.clearBackoff();\n // clean up peerhave/iasked counters\n this.peerhave.clear();\n this.metrics?.cacheSize.set({ cache: 'iasked' }, this.iasked.size);\n this.iasked.clear();\n // apply IWANT request penalties\n this.applyIwantPenalties();\n // ensure direct peers are connected\n if (this.heartbeatTicks % this.opts.directConnectTicks === 0) {\n // we only do this every few ticks to allow pending connections to complete and account for restarts/downtime\n await this.directConnect();\n }\n // EXTRA: Prune caches\n this.fastMsgIdCache?.prune();\n this.seenCache.prune();\n this.gossipTracer.prune();\n this.publishedMessageIds.prune();\n /**\n * Instead of calling getRandomGossipPeers multiple times to:\n * + get more mesh peers\n * + more outbound peers\n * + oppportunistic grafting\n * + emitGossip\n *\n * We want to loop through the topic peers only a single time and prepare gossip peers for all topics to improve the performance\n */\n const peersToGossipByTopic = new Map();\n // maintain the mesh for topics we have joined\n this.mesh.forEach((peers, topic) => {\n const peersInTopic = this.topics.get(topic);\n const candidateMeshPeers = new Set();\n const peersToGossip = new Set();\n peersToGossipByTopic.set(topic, peersToGossip);\n if (peersInTopic) {\n const shuffledPeers = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(Array.from(peersInTopic));\n const backoff = this.backoff.get(topic);\n for (const id of shuffledPeers) {\n const peerStreams = this.streamsOutbound.get(id);\n if (peerStreams &&\n this.multicodecs.includes(peerStreams.protocol) &&\n !peers.has(id) &&\n !this.direct.has(id)) {\n const score = getScore(id);\n if ((!backoff || !backoff.has(id)) && score >= 0)\n candidateMeshPeers.add(id);\n // instead of having to find gossip peers after heartbeat which require another loop\n // we prepare peers to gossip in a topic within heartbeat to improve performance\n if (score >= this.opts.scoreThresholds.gossipThreshold)\n peersToGossip.add(id);\n }\n }\n }\n // prune/graft helper functions (defined per topic)\n const prunePeer = (id, reason) => {\n this.log('HEARTBEAT: Remove mesh link to %s in %s', id, topic);\n // no need to update peer score here as we do it in makePrune\n // add prune backoff record\n this.addBackoff(id, topic);\n // remove peer from mesh\n peers.delete(id);\n // after pruning a peer from mesh, we want to gossip topic to it if its score meet the gossip threshold\n if (getScore(id) >= this.opts.scoreThresholds.gossipThreshold)\n peersToGossip.add(id);\n this.metrics?.onRemoveFromMesh(topic, reason, 1);\n // add to toprune\n const topics = toprune.get(id);\n if (!topics) {\n toprune.set(id, [topic]);\n }\n else {\n topics.push(topic);\n }\n };\n const graftPeer = (id, reason) => {\n this.log('HEARTBEAT: Add mesh link to %s in %s', id, topic);\n // update peer score\n this.score.graft(id, topic);\n // add peer to mesh\n peers.add(id);\n // when we add a new mesh peer, we don't want to gossip messages to it\n peersToGossip.delete(id);\n this.metrics?.onAddToMesh(topic, reason, 1);\n // add to tograft\n const topics = tograft.get(id);\n if (!topics) {\n tograft.set(id, [topic]);\n }\n else {\n topics.push(topic);\n }\n };\n // drop all peers with negative score, without PX\n peers.forEach((id) => {\n const score = getScore(id);\n // Record the score\n if (score < 0) {\n this.log('HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s', id, score, topic);\n prunePeer(id, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.ChurnReason.BadScore);\n noPX.set(id, true);\n }\n });\n // do we have enough peers?\n if (peers.size < Dlo) {\n const ineed = D - peers.size;\n // slice up to first `ineed` items and remove them from candidateMeshPeers\n // same to `const newMeshPeers = candidateMeshPeers.slice(0, ineed)`\n const newMeshPeers = (0,_utils_set_js__WEBPACK_IMPORTED_MODULE_20__.removeFirstNItemsFromSet)(candidateMeshPeers, ineed);\n newMeshPeers.forEach((p) => {\n graftPeer(p, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.InclusionReason.NotEnough);\n });\n }\n // do we have to many peers?\n if (peers.size > Dhi) {\n let peersArray = Array.from(peers);\n // sort by score\n peersArray.sort((a, b) => getScore(b) - getScore(a));\n // We keep the first D_score peers by score and the remaining up to D randomly\n // under the constraint that we keep D_out peers in the mesh (if we have that many)\n peersArray = peersArray.slice(0, Dscore).concat((0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(peersArray.slice(Dscore)));\n // count the outbound peers we are keeping\n let outbound = 0;\n peersArray.slice(0, D).forEach((p) => {\n if (this.outbound.get(p)) {\n outbound++;\n }\n });\n // if it's less than D_out, bubble up some outbound peers from the random selection\n if (outbound < Dout) {\n const rotate = (i) => {\n // rotate the peersArray to the right and put the ith peer in the front\n const p = peersArray[i];\n for (let j = i; j > 0; j--) {\n peersArray[j] = peersArray[j - 1];\n }\n peersArray[0] = p;\n };\n // first bubble up all outbound peers already in the selection to the front\n if (outbound > 0) {\n let ihave = outbound;\n for (let i = 1; i < D && ihave > 0; i++) {\n if (this.outbound.get(peersArray[i])) {\n rotate(i);\n ihave--;\n }\n }\n }\n // now bubble up enough outbound peers outside the selection to the front\n let ineed = D - outbound;\n for (let i = D; i < peersArray.length && ineed > 0; i++) {\n if (this.outbound.get(peersArray[i])) {\n rotate(i);\n ineed--;\n }\n }\n }\n // prune the excess peers\n peersArray.slice(D).forEach((p) => {\n prunePeer(p, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.ChurnReason.Excess);\n });\n }\n // do we have enough outbound peers?\n if (peers.size >= Dlo) {\n // count the outbound peers we have\n let outbound = 0;\n peers.forEach((p) => {\n if (this.outbound.get(p)) {\n outbound++;\n }\n });\n // if it's less than D_out, select some peers with outbound connections and graft them\n if (outbound < Dout) {\n const ineed = Dout - outbound;\n const newMeshPeers = (0,_utils_set_js__WEBPACK_IMPORTED_MODULE_20__.removeItemsFromSet)(candidateMeshPeers, ineed, (id) => this.outbound.get(id) === true);\n newMeshPeers.forEach((p) => {\n graftPeer(p, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.InclusionReason.Outbound);\n });\n }\n }\n // should we try to improve the mesh with opportunistic grafting?\n if (this.heartbeatTicks % this.opts.opportunisticGraftTicks === 0 && peers.size > 1) {\n // Opportunistic grafting works as follows: we check the median score of peers in the\n // mesh; if this score is below the opportunisticGraftThreshold, we select a few peers at\n // random with score over the median.\n // The intention is to (slowly) improve an underperforming mesh by introducing good\n // scoring peers that may have been gossiping at us. This allows us to get out of sticky\n // situations where we are stuck with poor peers and also recover from churn of good peers.\n // now compute the median peer score in the mesh\n const peersList = Array.from(peers).sort((a, b) => getScore(a) - getScore(b));\n const medianIndex = Math.floor(peers.size / 2);\n const medianScore = getScore(peersList[medianIndex]);\n // if the median score is below the threshold, select a better peer (if any) and GRAFT\n if (medianScore < this.opts.scoreThresholds.opportunisticGraftThreshold) {\n const ineed = this.opts.opportunisticGraftPeers;\n const newMeshPeers = (0,_utils_set_js__WEBPACK_IMPORTED_MODULE_20__.removeItemsFromSet)(candidateMeshPeers, ineed, (id) => getScore(id) > medianScore);\n for (const id of newMeshPeers) {\n this.log('HEARTBEAT: Opportunistically graft peer %s on topic %s', id, topic);\n graftPeer(id, _metrics_js__WEBPACK_IMPORTED_MODULE_13__.InclusionReason.Opportunistic);\n }\n }\n }\n });\n // expire fanout for topics we haven't published to in a while\n const now = Date.now();\n this.fanoutLastpub.forEach((lastpb, topic) => {\n if (lastpb + fanoutTTL < now) {\n this.fanout.delete(topic);\n this.fanoutLastpub.delete(topic);\n }\n });\n // maintain our fanout for topics we are publishing but we have not joined\n this.fanout.forEach((fanoutPeers, topic) => {\n // checks whether our peers are still in the topic and have a score above the publish threshold\n const topicPeers = this.topics.get(topic);\n fanoutPeers.forEach((id) => {\n if (!topicPeers.has(id) || getScore(id) < this.opts.scoreThresholds.publishThreshold) {\n fanoutPeers.delete(id);\n }\n });\n const peersInTopic = this.topics.get(topic);\n const candidateFanoutPeers = [];\n // the fanout map contains topics to which we are not subscribed.\n const peersToGossip = new Set();\n peersToGossipByTopic.set(topic, peersToGossip);\n if (peersInTopic) {\n const shuffledPeers = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(Array.from(peersInTopic));\n for (const id of shuffledPeers) {\n const peerStreams = this.streamsOutbound.get(id);\n if (peerStreams &&\n this.multicodecs.includes(peerStreams.protocol) &&\n !fanoutPeers.has(id) &&\n !this.direct.has(id)) {\n const score = getScore(id);\n if (score >= this.opts.scoreThresholds.publishThreshold)\n candidateFanoutPeers.push(id);\n // instead of having to find gossip peers after heartbeat which require another loop\n // we prepare peers to gossip in a topic within heartbeat to improve performance\n if (score >= this.opts.scoreThresholds.gossipThreshold)\n peersToGossip.add(id);\n }\n }\n }\n // do we need more peers?\n if (fanoutPeers.size < D) {\n const ineed = D - fanoutPeers.size;\n candidateFanoutPeers.slice(0, ineed).forEach((id) => {\n fanoutPeers.add(id);\n peersToGossip?.delete(id);\n });\n }\n });\n this.emitGossip(peersToGossipByTopic);\n // send coalesced GRAFT/PRUNE messages (will piggyback gossip)\n await this.sendGraftPrune(tograft, toprune, noPX);\n // flush pending gossip that wasn't piggybacked above\n this.flush();\n // advance the message history window\n this.mcache.shift();\n this.dispatchEvent(new _libp2p_interfaces_events__WEBPACK_IMPORTED_MODULE_5__.CustomEvent('gossipsub:heartbeat'));\n }\n /**\n * Given a topic, returns up to count peers subscribed to that topic\n * that pass an optional filter function\n *\n * @param topic\n * @param count\n * @param filter - a function to filter acceptable peers\n */\n getRandomGossipPeers(topic, count, filter = () => true) {\n const peersInTopic = this.topics.get(topic);\n if (!peersInTopic) {\n return new Set();\n }\n // Adds all peers using our protocol\n // that also pass the filter function\n let peers = [];\n peersInTopic.forEach((id) => {\n const peerStreams = this.streamsOutbound.get(id);\n if (!peerStreams) {\n return;\n }\n if (this.multicodecs.includes(peerStreams.protocol) && filter(id)) {\n peers.push(id);\n }\n });\n // Pseudo-randomly shuffles peers\n peers = (0,_utils_index_js__WEBPACK_IMPORTED_MODULE_9__.shuffle)(peers);\n if (count > 0 && peers.length > count) {\n peers = peers.slice(0, count);\n }\n return new Set(peers);\n }\n onScrapeMetrics(metrics) {\n /* Data structure sizes */\n metrics.mcacheSize.set(this.mcache.size);\n metrics.mcacheNotValidatedCount.set(this.mcache.notValidatedCount);\n // Arbitrary size\n metrics.cacheSize.set({ cache: 'direct' }, this.direct.size);\n metrics.cacheSize.set({ cache: 'seenCache' }, this.seenCache.size);\n metrics.cacheSize.set({ cache: 'fastMsgIdCache' }, this.fastMsgIdCache?.size ?? 0);\n metrics.cacheSize.set({ cache: 'publishedMessageIds' }, this.publishedMessageIds.size);\n metrics.cacheSize.set({ cache: 'mcache' }, this.mcache.size);\n metrics.cacheSize.set({ cache: 'score' }, this.score.size);\n metrics.cacheSize.set({ cache: 'gossipTracer.promises' }, this.gossipTracer.size);\n metrics.cacheSize.set({ cache: 'gossipTracer.requests' }, this.gossipTracer.requestMsByMsgSize);\n // Bounded by topic\n metrics.cacheSize.set({ cache: 'topics' }, this.topics.size);\n metrics.cacheSize.set({ cache: 'subscriptions' }, this.subscriptions.size);\n metrics.cacheSize.set({ cache: 'mesh' }, this.mesh.size);\n metrics.cacheSize.set({ cache: 'fanout' }, this.fanout.size);\n // Bounded by peer\n metrics.cacheSize.set({ cache: 'peers' }, this.peers.size);\n metrics.cacheSize.set({ cache: 'streamsOutbound' }, this.streamsOutbound.size);\n metrics.cacheSize.set({ cache: 'streamsInbound' }, this.streamsInbound.size);\n metrics.cacheSize.set({ cache: 'acceptFromWhitelist' }, this.acceptFromWhitelist.size);\n metrics.cacheSize.set({ cache: 'gossip' }, this.gossip.size);\n metrics.cacheSize.set({ cache: 'control' }, this.control.size);\n metrics.cacheSize.set({ cache: 'peerhave' }, this.peerhave.size);\n metrics.cacheSize.set({ cache: 'outbound' }, this.outbound.size);\n // 2D nested data structure\n let backoffSize = 0;\n for (const backoff of this.backoff.values()) {\n backoffSize += backoff.size;\n }\n metrics.cacheSize.set({ cache: 'backoff' }, backoffSize);\n // Peer counts\n for (const [topicStr, peers] of this.topics) {\n metrics.topicPeersCount.set({ topicStr }, peers.size);\n }\n for (const [topicStr, peers] of this.mesh) {\n metrics.meshPeerCounts.set({ topicStr }, peers.size);\n }\n // Peer scores\n const scores = [];\n const scoreByPeer = new Map();\n metrics.behaviourPenalty.reset();\n for (const peerIdStr of this.peers.keys()) {\n const score = this.score.score(peerIdStr);\n scores.push(score);\n scoreByPeer.set(peerIdStr, score);\n metrics.behaviourPenalty.observe(this.score.peerStats.get(peerIdStr)?.behaviourPenalty ?? 0);\n }\n metrics.registerScores(scores, this.opts.scoreThresholds);\n // Breakdown score per mesh topicLabel\n metrics.registerScorePerMesh(this.mesh, scoreByPeer);\n // Breakdown on each score weight\n const sw = (0,_score_scoreMetrics_js__WEBPACK_IMPORTED_MODULE_17__.computeAllPeersScoreWeights)(this.peers.keys(), this.score.peerStats, this.score.params, this.score.peerIPs, metrics.topicStrToLabel);\n metrics.registerScoreWeights(sw);\n }\n}\nGossipSub.multicodec = _constants_js__WEBPACK_IMPORTED_MODULE_8__.GossipsubIDv11;\nfunction gossipsub(init = {}) {\n return (components) => new GossipSub(components, init);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MessageCache\": () => (/* binding */ MessageCache)\n/* harmony export */ });\nclass MessageCache {\n /**\n * Holds history of messages in timebounded history arrays\n */\n constructor(\n /**\n * The number of indices in the cache history used for gossiping. That means that a message\n * won't get gossiped anymore when shift got called `gossip` many times after inserting the\n * message in the cache.\n */\n gossip, historyCapacity, msgIdToStrFn) {\n this.gossip = gossip;\n this.msgs = new Map();\n this.history = [];\n /** Track with accounting of messages in the mcache that are not yet validated */\n this.notValidatedCount = 0;\n this.msgIdToStrFn = msgIdToStrFn;\n for (let i = 0; i < historyCapacity; i++) {\n this.history[i] = [];\n }\n }\n get size() {\n return this.msgs.size;\n }\n /**\n * Adds a message to the current window and the cache\n * Returns true if the message is not known and is inserted in the cache\n */\n put(messageId, msg, validated = false) {\n const { msgIdStr } = messageId;\n // Don't add duplicate entries to the cache.\n if (this.msgs.has(msgIdStr)) {\n return false;\n }\n this.msgs.set(msgIdStr, {\n message: msg,\n validated,\n originatingPeers: new Set(),\n iwantCounts: new Map()\n });\n this.history[0].push({ ...messageId, topic: msg.topic });\n if (!validated) {\n this.notValidatedCount++;\n }\n return true;\n }\n observeDuplicate(msgId, fromPeerIdStr) {\n const entry = this.msgs.get(msgId);\n if (entry &&\n // if the message is already validated, we don't need to store extra peers sending us\n // duplicates as the message has already been forwarded\n !entry.validated) {\n entry.originatingPeers.add(fromPeerIdStr);\n }\n }\n /**\n * Retrieves a message from the cache by its ID, if it is still present\n */\n get(msgId) {\n return this.msgs.get(this.msgIdToStrFn(msgId))?.message;\n }\n /**\n * Increases the iwant count for the given message by one and returns the message together\n * with the iwant if the message exists.\n */\n getWithIWantCount(msgIdStr, p) {\n const msg = this.msgs.get(msgIdStr);\n if (!msg) {\n return null;\n }\n const count = (msg.iwantCounts.get(p) ?? 0) + 1;\n msg.iwantCounts.set(p, count);\n return { msg: msg.message, count };\n }\n /**\n * Retrieves a list of message IDs for a set of topics\n */\n getGossipIDs(topics) {\n const msgIdsByTopic = new Map();\n for (let i = 0; i < this.gossip; i++) {\n this.history[i].forEach((entry) => {\n const msg = this.msgs.get(entry.msgIdStr);\n if (msg && msg.validated && topics.has(entry.topic)) {\n let msgIds = msgIdsByTopic.get(entry.topic);\n if (!msgIds) {\n msgIds = [];\n msgIdsByTopic.set(entry.topic, msgIds);\n }\n msgIds.push(entry.msgId);\n }\n });\n }\n return msgIdsByTopic;\n }\n /**\n * Gets a message with msgId and tags it as validated.\n * This function also returns the known peers that have sent us this message. This is used to\n * prevent us sending redundant messages to peers who have already propagated it.\n */\n validate(msgId) {\n const entry = this.msgs.get(msgId);\n if (!entry) {\n return null;\n }\n if (!entry.validated) {\n this.notValidatedCount--;\n }\n const { message, originatingPeers } = entry;\n entry.validated = true;\n // Clear the known peers list (after a message is validated, it is forwarded and we no\n // longer need to store the originating peers).\n entry.originatingPeers = new Set();\n return { message, originatingPeers };\n }\n /**\n * Shifts the current window, discarding messages older than this.history.length of the cache\n */\n shift() {\n const lastCacheEntries = this.history[this.history.length - 1];\n lastCacheEntries.forEach((cacheEntry) => {\n const entry = this.msgs.get(cacheEntry.msgIdStr);\n if (entry) {\n this.msgs.delete(cacheEntry.msgIdStr);\n if (!entry.validated) {\n this.notValidatedCount--;\n }\n }\n });\n this.history.pop();\n this.history.unshift([]);\n }\n remove(msgId) {\n const entry = this.msgs.get(msgId);\n if (!entry) {\n return null;\n }\n // Keep the message on the history vector, it will be dropped on a shift()\n this.msgs.delete(msgId);\n return entry;\n }\n}\n//# sourceMappingURL=message-cache.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decodeRpc.js":
+/*!********************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decodeRpc.js ***!
+ \********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decodeRpc\": () => (/* binding */ decodeRpc),\n/* harmony export */ \"defaultDecodeRpcLimits\": () => (/* binding */ defaultDecodeRpcLimits)\n/* harmony export */ });\n/* harmony import */ var protobufjs_minimal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! protobufjs/minimal.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/protobufjs/minimal.js\");\n\nconst defaultDecodeRpcLimits = {\n maxSubscriptions: Infinity,\n maxMessages: Infinity,\n maxIhaveMessageIDs: Infinity,\n maxIwantMessageIDs: Infinity,\n maxControlMessages: Infinity,\n maxPeerInfos: Infinity\n};\n/**\n * Copied code from src/message/rpc.cjs but with decode limits to prevent OOM attacks\n */\nfunction decodeRpc(bytes, opts) {\n // Mutate to use the option as stateful counter. Must limit the total count of messageIDs across all IWANT, IHAVE\n // else one count put 100 messageIDs into each 100 IWANT and \"get around\" the limit\n opts = { ...opts };\n const r = protobufjs_minimal_js__WEBPACK_IMPORTED_MODULE_0__.Reader.create(bytes);\n const l = bytes.length;\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.subscriptions && m.subscriptions.length))\n m.subscriptions = [];\n if (m.subscriptions.length < opts.maxSubscriptions)\n m.subscriptions.push(decodeSubOpts(r, r.uint32()));\n else\n r.skipType(t & 7);\n break;\n case 2:\n if (!(m.messages && m.messages.length))\n m.messages = [];\n if (m.messages.length < opts.maxMessages)\n m.messages.push(decodeMessage(r, r.uint32()));\n else\n r.skipType(t & 7);\n break;\n case 3:\n m.control = decodeControlMessage(r, r.uint32(), opts);\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\nfunction decodeSubOpts(r, l) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.subscribe = r.bool();\n break;\n case 2:\n m.topic = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\nfunction decodeMessage(r, l) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.from = r.bytes();\n break;\n case 2:\n m.data = r.bytes();\n break;\n case 3:\n m.seqno = r.bytes();\n break;\n case 4:\n m.topic = r.string();\n break;\n case 5:\n m.signature = r.bytes();\n break;\n case 6:\n m.key = r.bytes();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n if (!m.topic)\n throw Error(\"missing required 'topic'\");\n return m;\n}\nfunction decodeControlMessage(r, l, opts) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.ihave && m.ihave.length))\n m.ihave = [];\n if (m.ihave.length < opts.maxControlMessages)\n m.ihave.push(decodeControlIHave(r, r.uint32(), opts));\n else\n r.skipType(t & 7);\n break;\n case 2:\n if (!(m.iwant && m.iwant.length))\n m.iwant = [];\n if (m.iwant.length < opts.maxControlMessages)\n m.iwant.push(decodeControlIWant(r, r.uint32(), opts));\n else\n r.skipType(t & 7);\n break;\n case 3:\n if (!(m.graft && m.graft.length))\n m.graft = [];\n if (m.graft.length < opts.maxControlMessages)\n m.graft.push(decodeControlGraft(r, r.uint32()));\n else\n r.skipType(t & 7);\n break;\n case 4:\n if (!(m.prune && m.prune.length))\n m.prune = [];\n if (m.prune.length < opts.maxControlMessages)\n m.prune.push(decodeControlPrune(r, r.uint32(), opts));\n else\n r.skipType(t & 7);\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\nfunction decodeControlIHave(r, l, opts) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n case 2:\n if (!(m.messageIDs && m.messageIDs.length))\n m.messageIDs = [];\n if (opts.maxIhaveMessageIDs-- > 0)\n m.messageIDs.push(r.bytes());\n else\n r.skipType(t & 7);\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\nfunction decodeControlIWant(r, l, opts) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n if (!(m.messageIDs && m.messageIDs.length))\n m.messageIDs = [];\n if (opts.maxIwantMessageIDs-- > 0)\n m.messageIDs.push(r.bytes());\n else\n r.skipType(t & 7);\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\nfunction decodeControlGraft(r, l) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\nfunction decodeControlPrune(r, l, opts) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.topicID = r.string();\n break;\n case 2:\n if (!(m.peers && m.peers.length))\n m.peers = [];\n if (opts.maxPeerInfos-- > 0)\n m.peers.push(decodePeerInfo(r, r.uint32()));\n else\n r.skipType(t & 7);\n break;\n case 3:\n m.backoff = r.uint64();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\nfunction decodePeerInfo(r, l) {\n const c = l === undefined ? r.len : r.pos + l;\n const m = {};\n while (r.pos < c) {\n const t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.peerID = r.bytes();\n break;\n case 2:\n m.signedPeerRecord = r.bytes();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n}\n//# sourceMappingURL=decodeRpc.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/decodeRpc.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js":
+/*!**************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js ***!
+ \**************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RPC\": () => (/* binding */ RPC)\n/* harmony export */ });\n/* harmony import */ var _rpc_cjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rpc.cjs */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.cjs\");\n\n\nconst {RPC} = _rpc_cjs__WEBPACK_IMPORTED_MODULE_0__\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.js":
+/*!**********************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.js ***!
+ \**********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ChurnReason\": () => (/* binding */ ChurnReason),\n/* harmony export */ \"IHaveIgnoreReason\": () => (/* binding */ IHaveIgnoreReason),\n/* harmony export */ \"InclusionReason\": () => (/* binding */ InclusionReason),\n/* harmony export */ \"MessageSource\": () => (/* binding */ MessageSource),\n/* harmony export */ \"ScorePenalty\": () => (/* binding */ ScorePenalty),\n/* harmony export */ \"ScoreThreshold\": () => (/* binding */ ScoreThreshold),\n/* harmony export */ \"getMetrics\": () => (/* binding */ getMetrics)\n/* harmony export */ });\n/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js\");\n\nvar MessageSource;\n(function (MessageSource) {\n MessageSource[\"forward\"] = \"forward\";\n MessageSource[\"publish\"] = \"publish\";\n})(MessageSource || (MessageSource = {}));\nvar InclusionReason;\n(function (InclusionReason) {\n /** Peer was a fanaout peer. */\n InclusionReason[\"Fanout\"] = \"fanout\";\n /** Included from random selection. */\n InclusionReason[\"Random\"] = \"random\";\n /** Peer subscribed. */\n InclusionReason[\"Subscribed\"] = \"subscribed\";\n /** On heartbeat, peer was included to fill the outbound quota. */\n InclusionReason[\"Outbound\"] = \"outbound\";\n /** On heartbeat, not enough peers in mesh */\n InclusionReason[\"NotEnough\"] = \"not_enough\";\n /** On heartbeat opportunistic grafting due to low mesh score */\n InclusionReason[\"Opportunistic\"] = \"opportunistic\";\n})(InclusionReason || (InclusionReason = {}));\n/// Reasons why a peer was removed from the mesh.\nvar ChurnReason;\n(function (ChurnReason) {\n /// Peer disconnected.\n ChurnReason[\"Dc\"] = \"disconnected\";\n /// Peer had a bad score.\n ChurnReason[\"BadScore\"] = \"bad_score\";\n /// Peer sent a PRUNE.\n ChurnReason[\"Prune\"] = \"prune\";\n /// Peer unsubscribed.\n ChurnReason[\"Unsub\"] = \"unsubscribed\";\n /// Too many peers.\n ChurnReason[\"Excess\"] = \"excess\";\n})(ChurnReason || (ChurnReason = {}));\n/// Kinds of reasons a peer's score has been penalized\nvar ScorePenalty;\n(function (ScorePenalty) {\n /// A peer grafted before waiting the back-off time.\n ScorePenalty[\"GraftBackoff\"] = \"graft_backoff\";\n /// A Peer did not respond to an IWANT request in time.\n ScorePenalty[\"BrokenPromise\"] = \"broken_promise\";\n /// A Peer did not send enough messages as expected.\n ScorePenalty[\"MessageDeficit\"] = \"message_deficit\";\n /// Too many peers under one IP address.\n ScorePenalty[\"IPColocation\"] = \"IP_colocation\";\n})(ScorePenalty || (ScorePenalty = {}));\nvar IHaveIgnoreReason;\n(function (IHaveIgnoreReason) {\n IHaveIgnoreReason[\"LowScore\"] = \"low_score\";\n IHaveIgnoreReason[\"MaxIhave\"] = \"max_ihave\";\n IHaveIgnoreReason[\"MaxIasked\"] = \"max_iasked\";\n})(IHaveIgnoreReason || (IHaveIgnoreReason = {}));\nvar ScoreThreshold;\n(function (ScoreThreshold) {\n ScoreThreshold[\"graylist\"] = \"graylist\";\n ScoreThreshold[\"publish\"] = \"publish\";\n ScoreThreshold[\"gossip\"] = \"gossip\";\n ScoreThreshold[\"mesh\"] = \"mesh\";\n})(ScoreThreshold || (ScoreThreshold = {}));\n/**\n * A collection of metrics used throughout the Gossipsub behaviour.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction getMetrics(register, topicStrToLabel, opts) {\n // Using function style instead of class to prevent having to re-declare all MetricsPrometheus types.\n return {\n /* Metrics for static config */\n protocolsEnabled: register.gauge({\n name: 'gossipsub_protocol',\n help: 'Status of enabled protocols',\n labelNames: ['protocol']\n }),\n /* Metrics per known topic */\n /** Status of our subscription to this topic. This metric allows analyzing other topic metrics\n * filtered by our current subscription status.\n * = rust-libp2p `topic_subscription_status` */\n topicSubscriptionStatus: register.gauge({\n name: 'gossipsub_topic_subscription_status',\n help: 'Status of our subscription to this topic',\n labelNames: ['topicStr']\n }),\n /** Number of peers subscribed to each topic. This allows us to analyze a topic's behaviour\n * regardless of our subscription status. */\n topicPeersCount: register.gauge({\n name: 'gossipsub_topic_peer_count',\n help: 'Number of peers subscribed to each topic',\n labelNames: ['topicStr']\n }),\n /* Metrics regarding mesh state */\n /** Number of peers in our mesh. This metric should be updated with the count of peers for a\n * topic in the mesh regardless of inclusion and churn events.\n * = rust-libp2p `mesh_peer_counts` */\n meshPeerCounts: register.gauge({\n name: 'gossipsub_mesh_peer_count',\n help: 'Number of peers in our mesh',\n labelNames: ['topicStr']\n }),\n /** Number of times we include peers in a topic mesh for different reasons.\n * = rust-libp2p `mesh_peer_inclusion_events` */\n meshPeerInclusionEvents: register.gauge({\n name: 'gossipsub_mesh_peer_inclusion_events_total',\n help: 'Number of times we include peers in a topic mesh for different reasons',\n labelNames: ['topic', 'reason']\n }),\n /** Number of times we remove peers in a topic mesh for different reasons.\n * = rust-libp2p `mesh_peer_churn_events` */\n meshPeerChurnEvents: register.gauge({\n name: 'gossipsub_peer_churn_events_total',\n help: 'Number of times we remove peers in a topic mesh for different reasons',\n labelNames: ['topic', 'reason']\n }),\n /* General Metrics */\n /** Gossipsub supports floodsub, gossipsub v1.0 and gossipsub v1.1. Peers are classified based\n * on which protocol they support. This metric keeps track of the number of peers that are\n * connected of each type. */\n peersPerProtocol: register.gauge({\n name: 'gossipsub_peers_per_protocol_count',\n help: 'Peers connected for each topic',\n labelNames: ['protocol']\n }),\n /** The time it takes to complete one iteration of the heartbeat. */\n heartbeatDuration: register.histogram({\n name: 'gossipsub_heartbeat_duration_seconds',\n help: 'The time it takes to complete one iteration of the heartbeat',\n // Should take <10ms, over 1s it's a huge issue that needs debugging, since a heartbeat will be cancelled\n buckets: [0.01, 0.1, 1]\n }),\n /** Heartbeat run took longer than heartbeat interval so next is skipped */\n heartbeatSkipped: register.gauge({\n name: 'gossipsub_heartbeat_skipped',\n help: 'Heartbeat run took longer than heartbeat interval so next is skipped'\n }),\n /** Message validation results for each topic.\n * Invalid == Reject?\n * = rust-libp2p `invalid_messages`, `accepted_messages`, `ignored_messages`, `rejected_messages` */\n asyncValidationResult: register.gauge({\n name: 'gossipsub_async_validation_result_total',\n help: 'Message validation result for each topic',\n labelNames: ['topic', 'acceptance']\n }),\n /** When the user validates a message, it tries to re propagate it to its mesh peers. If the\n * message expires from the memcache before it can be validated, we count this a cache miss\n * and it is an indicator that the memcache size should be increased.\n * = rust-libp2p `mcache_misses` */\n asyncValidationMcacheHit: register.gauge({\n name: 'gossipsub_async_validation_mcache_hit_total',\n help: 'Async validation result reported by the user layer',\n labelNames: ['hit']\n }),\n // peer stream\n peerReadStreamError: register.gauge({\n name: 'gossipsub_peer_read_stream_err_count_total',\n help: 'Peer read stream error'\n }),\n // RPC outgoing. Track byte length + data structure sizes\n rpcRecvBytes: register.gauge({ name: 'gossipsub_rpc_recv_bytes_total', help: 'RPC recv' }),\n rpcRecvCount: register.gauge({ name: 'gossipsub_rpc_recv_count_total', help: 'RPC recv' }),\n rpcRecvSubscription: register.gauge({ name: 'gossipsub_rpc_recv_subscription_total', help: 'RPC recv' }),\n rpcRecvMessage: register.gauge({ name: 'gossipsub_rpc_recv_message_total', help: 'RPC recv' }),\n rpcRecvControl: register.gauge({ name: 'gossipsub_rpc_recv_control_total', help: 'RPC recv' }),\n rpcRecvIHave: register.gauge({ name: 'gossipsub_rpc_recv_ihave_total', help: 'RPC recv' }),\n rpcRecvIWant: register.gauge({ name: 'gossipsub_rpc_recv_iwant_total', help: 'RPC recv' }),\n rpcRecvGraft: register.gauge({ name: 'gossipsub_rpc_recv_graft_total', help: 'RPC recv' }),\n rpcRecvPrune: register.gauge({ name: 'gossipsub_rpc_recv_prune_total', help: 'RPC recv' }),\n rpcDataError: register.gauge({ name: 'gossipsub_rpc_data_err_count_total', help: 'RPC data error' }),\n rpcRecvError: register.gauge({ name: 'gossipsub_rpc_recv_err_count_total', help: 'RPC recv error' }),\n /** Total count of RPC dropped because acceptFrom() == false */\n rpcRecvNotAccepted: register.gauge({\n name: 'gossipsub_rpc_rcv_not_accepted_total',\n help: 'Total count of RPC dropped because acceptFrom() == false'\n }),\n // RPC incoming. Track byte length + data structure sizes\n rpcSentBytes: register.gauge({ name: 'gossipsub_rpc_sent_bytes_total', help: 'RPC sent' }),\n rpcSentCount: register.gauge({ name: 'gossipsub_rpc_sent_count_total', help: 'RPC sent' }),\n rpcSentSubscription: register.gauge({ name: 'gossipsub_rpc_sent_subscription_total', help: 'RPC sent' }),\n rpcSentMessage: register.gauge({ name: 'gossipsub_rpc_sent_message_total', help: 'RPC sent' }),\n rpcSentControl: register.gauge({ name: 'gossipsub_rpc_sent_control_total', help: 'RPC sent' }),\n rpcSentIHave: register.gauge({ name: 'gossipsub_rpc_sent_ihave_total', help: 'RPC sent' }),\n rpcSentIWant: register.gauge({ name: 'gossipsub_rpc_sent_iwant_total', help: 'RPC sent' }),\n rpcSentGraft: register.gauge({ name: 'gossipsub_rpc_sent_graft_total', help: 'RPC sent' }),\n rpcSentPrune: register.gauge({ name: 'gossipsub_rpc_sent_prune_total', help: 'RPC sent' }),\n // publish message. Track peers sent to and bytes\n /** Total count of msg published by topic */\n msgPublishCount: register.gauge({\n name: 'gossipsub_msg_publish_count_total',\n help: 'Total count of msg published by topic',\n labelNames: ['topic']\n }),\n /** Total count of peers that we publish a msg to */\n msgPublishPeers: register.gauge({\n name: 'gossipsub_msg_publish_peers_total',\n help: 'Total count of peers that we publish a msg to',\n labelNames: ['topic']\n }),\n /** Total count of peers (by group) that we publish a msg to */\n // NOTE: Do not use 'group' label since it's a generic already used by Prometheus to group instances\n msgPublishPeersByGroup: register.gauge({\n name: 'gossipsub_msg_publish_peers_by_group',\n help: 'Total count of peers (by group) that we publish a msg to',\n labelNames: ['topic', 'peerGroup']\n }),\n /** Total count of msg publish data.length bytes */\n msgPublishBytes: register.gauge({\n name: 'gossipsub_msg_publish_bytes_total',\n help: 'Total count of msg publish data.length bytes',\n labelNames: ['topic']\n }),\n /** Total count of msg forwarded by topic */\n msgForwardCount: register.gauge({\n name: 'gossipsub_msg_forward_count_total',\n help: 'Total count of msg forwarded by topic',\n labelNames: ['topic']\n }),\n /** Total count of peers that we forward a msg to */\n msgForwardPeers: register.gauge({\n name: 'gossipsub_msg_forward_peers_total',\n help: 'Total count of peers that we forward a msg to',\n labelNames: ['topic']\n }),\n /** Total count of recv msgs before any validation */\n msgReceivedPreValidation: register.gauge({\n name: 'gossipsub_msg_received_prevalidation_total',\n help: 'Total count of recv msgs before any validation',\n labelNames: ['topic']\n }),\n /** Total count of recv msgs error */\n msgReceivedError: register.gauge({\n name: 'gossipsub_msg_received_error_total',\n help: 'Total count of recv msgs error',\n labelNames: ['topic']\n }),\n /** Tracks distribution of recv msgs by duplicate, invalid, valid */\n msgReceivedStatus: register.gauge({\n name: 'gossipsub_msg_received_status_total',\n help: 'Tracks distribution of recv msgs by duplicate, invalid, valid',\n labelNames: ['topic', 'status']\n }),\n /** Tracks specific reason of invalid */\n msgReceivedInvalid: register.gauge({\n name: 'gossipsub_msg_received_invalid_total',\n help: 'Tracks specific reason of invalid',\n labelNames: ['topic', 'error']\n }),\n /** Track duplicate message delivery time */\n duplicateMsgDeliveryDelay: register.histogram({\n name: 'gossisub_duplicate_msg_delivery_delay_seconds',\n help: 'Time since the 1st duplicated message validated',\n labelNames: ['topic'],\n buckets: [\n 0.25 * opts.maxMeshMessageDeliveriesWindowSec,\n 0.5 * opts.maxMeshMessageDeliveriesWindowSec,\n 1 * opts.maxMeshMessageDeliveriesWindowSec,\n 2 * opts.maxMeshMessageDeliveriesWindowSec,\n 4 * opts.maxMeshMessageDeliveriesWindowSec\n ]\n }),\n /** Total count of late msg delivery total by topic */\n duplicateMsgLateDelivery: register.gauge({\n name: 'gossisub_duplicate_msg_late_delivery_total',\n help: 'Total count of late duplicate message delivery by topic, which triggers P3 penalty',\n labelNames: ['topic']\n }),\n duplicateMsgIgnored: register.gauge({\n name: 'gossisub_ignored_published_duplicate_msgs_total',\n help: 'Total count of published duplicate message ignored by topic',\n labelNames: ['topic']\n }),\n /* Metrics related to scoring */\n /** Total times score() is called */\n scoreFnCalls: register.gauge({\n name: 'gossipsub_score_fn_calls_total',\n help: 'Total times score() is called'\n }),\n /** Total times score() call actually computed computeScore(), no cache */\n scoreFnRuns: register.gauge({\n name: 'gossipsub_score_fn_runs_total',\n help: 'Total times score() call actually computed computeScore(), no cache'\n }),\n scoreCachedDelta: register.histogram({\n name: 'gossipsub_score_cache_delta',\n help: 'Delta of score between cached values that expired',\n buckets: [10, 100, 1000]\n }),\n /** Current count of peers by score threshold */\n peersByScoreThreshold: register.gauge({\n name: 'gossipsub_peers_by_score_threshold_count',\n help: 'Current count of peers by score threshold',\n labelNames: ['threshold']\n }),\n score: register.avgMinMax({\n name: 'gossipsub_score',\n help: 'Avg min max of gossip scores',\n labelNames: ['topic', 'p']\n }),\n /** Separate score weights */\n scoreWeights: register.avgMinMax({\n name: 'gossipsub_score_weights',\n help: 'Separate score weights',\n labelNames: ['topic', 'p']\n }),\n /** Histogram of the scores for each mesh topic. */\n // TODO: Not implemented\n scorePerMesh: register.avgMinMax({\n name: 'gossipsub_score_per_mesh',\n help: 'Histogram of the scores for each mesh topic',\n labelNames: ['topic']\n }),\n /** A counter of the kind of penalties being applied to peers. */\n // TODO: Not fully implemented\n scoringPenalties: register.gauge({\n name: 'gossipsub_scoring_penalties_total',\n help: 'A counter of the kind of penalties being applied to peers',\n labelNames: ['penalty']\n }),\n behaviourPenalty: register.histogram({\n name: 'gossipsub_peer_stat_behaviour_penalty',\n help: 'Current peer stat behaviour_penalty at each scrape',\n buckets: [\n 0.25 * opts.behaviourPenaltyThreshold,\n 0.5 * opts.behaviourPenaltyThreshold,\n 1 * opts.behaviourPenaltyThreshold,\n 2 * opts.behaviourPenaltyThreshold,\n 4 * opts.behaviourPenaltyThreshold\n ]\n }),\n // TODO:\n // - iasked per peer (on heartbeat)\n // - when promise is resolved, track messages from promises\n /** Total received IHAVE messages that we ignore for some reason */\n ihaveRcvIgnored: register.gauge({\n name: 'gossipsub_ihave_rcv_ignored_total',\n help: 'Total received IHAVE messages that we ignore for some reason',\n labelNames: ['reason']\n }),\n /** Total received IHAVE messages by topic */\n ihaveRcvMsgids: register.gauge({\n name: 'gossipsub_ihave_rcv_msgids_total',\n help: 'Total received IHAVE messages by topic',\n labelNames: ['topic']\n }),\n /** Total messages per topic we don't have. Not actual requests.\n * The number of times we have decided that an IWANT control message is required for this\n * topic. A very high metric might indicate an underperforming network.\n * = rust-libp2p `topic_iwant_msgs` */\n ihaveRcvNotSeenMsgids: register.gauge({\n name: 'gossipsub_ihave_rcv_not_seen_msgids_total',\n help: 'Total messages per topic we do not have, not actual requests',\n labelNames: ['topic']\n }),\n /** Total received IWANT messages by topic */\n iwantRcvMsgids: register.gauge({\n name: 'gossipsub_iwant_rcv_msgids_total',\n help: 'Total received IWANT messages by topic',\n labelNames: ['topic']\n }),\n /** Total requested messageIDs that we don't have */\n iwantRcvDonthaveMsgids: register.gauge({\n name: 'gossipsub_iwant_rcv_dont_have_msgids_total',\n help: 'Total requested messageIDs that we do not have'\n }),\n iwantPromiseStarted: register.gauge({\n name: 'gossipsub_iwant_promise_sent_total',\n help: 'Total count of started IWANT promises'\n }),\n /** Total count of resolved IWANT promises */\n iwantPromiseResolved: register.gauge({\n name: 'gossipsub_iwant_promise_resolved_total',\n help: 'Total count of resolved IWANT promises'\n }),\n /** Total count of resolved IWANT promises from duplicate messages */\n iwantPromiseResolvedFromDuplicate: register.gauge({\n name: 'gossipsub_iwant_promise_resolved_from_duplicate_total',\n help: 'Total count of resolved IWANT promises from duplicate messages'\n }),\n /** Total count of peers we have asked IWANT promises that are resolved */\n iwantPromiseResolvedPeers: register.gauge({\n name: 'gossipsub_iwant_promise_resolved_peers',\n help: 'Total count of peers we have asked IWANT promises that are resolved'\n }),\n iwantPromiseBroken: register.gauge({\n name: 'gossipsub_iwant_promise_broken',\n help: 'Total count of broken IWANT promises'\n }),\n iwantMessagePruned: register.gauge({\n name: 'gossipsub_iwant_message_pruned',\n help: 'Total count of pruned IWANT messages'\n }),\n /** Histogram of delivery time of resolved IWANT promises */\n iwantPromiseDeliveryTime: register.histogram({\n name: 'gossipsub_iwant_promise_delivery_seconds',\n help: 'Histogram of delivery time of resolved IWANT promises',\n buckets: [\n 0.5 * opts.gossipPromiseExpireSec,\n 1 * opts.gossipPromiseExpireSec,\n 2 * opts.gossipPromiseExpireSec,\n 4 * opts.gossipPromiseExpireSec\n ]\n }),\n iwantPromiseUntracked: register.gauge({\n name: 'gossip_iwant_promise_untracked',\n help: 'Total count of untracked IWANT promise'\n }),\n /* Data structure sizes */\n /** Unbounded cache sizes */\n cacheSize: register.gauge({\n name: 'gossipsub_cache_size',\n help: 'Unbounded cache sizes',\n labelNames: ['cache']\n }),\n /** Current mcache msg count */\n mcacheSize: register.gauge({\n name: 'gossipsub_mcache_size',\n help: 'Current mcache msg count'\n }),\n mcacheNotValidatedCount: register.gauge({\n name: 'gossipsub_mcache_not_validated_count',\n help: 'Current mcache msg count not validated'\n }),\n fastMsgIdCacheCollision: register.gauge({\n name: 'gossipsub_fastmsgid_cache_collision_total',\n help: 'Total count of key collisions on fastmsgid cache put'\n }),\n newConnectionCount: register.gauge({\n name: 'gossipsub_new_connection_total',\n help: 'Total new connection by status',\n labelNames: ['status']\n }),\n topicStrToLabel: topicStrToLabel,\n toTopic(topicStr) {\n return this.topicStrToLabel.get(topicStr) ?? topicStr;\n },\n /** We joined a topic */\n onJoin(topicStr) {\n this.topicSubscriptionStatus.set({ topicStr }, 1);\n this.meshPeerCounts.set({ topicStr }, 0); // Reset count\n },\n /** We left a topic */\n onLeave(topicStr) {\n this.topicSubscriptionStatus.set({ topicStr }, 0);\n this.meshPeerCounts.set({ topicStr }, 0); // Reset count\n },\n /** Register the inclusion of peers in our mesh due to some reason. */\n onAddToMesh(topicStr, reason, count) {\n const topic = this.toTopic(topicStr);\n this.meshPeerInclusionEvents.inc({ topic, reason }, count);\n },\n /** Register the removal of peers in our mesh due to some reason */\n // - remove_peer_from_mesh()\n // - heartbeat() Churn::BadScore\n // - heartbeat() Churn::Excess\n // - on_disconnect() Churn::Ds\n onRemoveFromMesh(topicStr, reason, count) {\n const topic = this.toTopic(topicStr);\n this.meshPeerChurnEvents.inc({ topic, reason }, count);\n },\n onReportValidationMcacheHit(hit) {\n this.asyncValidationMcacheHit.inc({ hit: hit ? 'hit' : 'miss' });\n },\n onReportValidation(topicStr, acceptance) {\n const topic = this.toTopic(topicStr);\n this.asyncValidationResult.inc({ topic: topic, acceptance });\n },\n /**\n * - in handle_graft() Penalty::GraftBackoff\n * - in apply_iwant_penalties() Penalty::BrokenPromise\n * - in metric_score() P3 Penalty::MessageDeficit\n * - in metric_score() P6 Penalty::IPColocation\n */\n onScorePenalty(penalty) {\n // Can this be labeled by topic too?\n this.scoringPenalties.inc({ penalty }, 1);\n },\n onIhaveRcv(topicStr, ihave, idonthave) {\n const topic = this.toTopic(topicStr);\n this.ihaveRcvMsgids.inc({ topic }, ihave);\n this.ihaveRcvNotSeenMsgids.inc({ topic }, idonthave);\n },\n onIwantRcv(iwantByTopic, iwantDonthave) {\n for (const [topicStr, iwant] of iwantByTopic) {\n const topic = this.toTopic(topicStr);\n this.iwantRcvMsgids.inc({ topic }, iwant);\n }\n this.iwantRcvDonthaveMsgids.inc(iwantDonthave);\n },\n onForwardMsg(topicStr, tosendCount) {\n const topic = this.toTopic(topicStr);\n this.msgForwardCount.inc({ topic }, 1);\n this.msgForwardPeers.inc({ topic }, tosendCount);\n },\n onPublishMsg(topicStr, tosendGroupCount, tosendCount, dataLen) {\n const topic = this.toTopic(topicStr);\n this.msgPublishCount.inc({ topic }, 1);\n this.msgPublishBytes.inc({ topic }, tosendCount * dataLen);\n this.msgPublishPeers.inc({ topic }, tosendCount);\n this.msgPublishPeersByGroup.inc({ topic, peerGroup: 'direct' }, tosendGroupCount.direct);\n this.msgPublishPeersByGroup.inc({ topic, peerGroup: 'floodsub' }, tosendGroupCount.floodsub);\n this.msgPublishPeersByGroup.inc({ topic, peerGroup: 'mesh' }, tosendGroupCount.mesh);\n this.msgPublishPeersByGroup.inc({ topic, peerGroup: 'fanout' }, tosendGroupCount.fanout);\n },\n onMsgRecvPreValidation(topicStr) {\n const topic = this.toTopic(topicStr);\n this.msgReceivedPreValidation.inc({ topic }, 1);\n },\n onMsgRecvError(topicStr) {\n const topic = this.toTopic(topicStr);\n this.msgReceivedError.inc({ topic }, 1);\n },\n onMsgRecvResult(topicStr, status) {\n const topic = this.toTopic(topicStr);\n this.msgReceivedStatus.inc({ topic, status });\n },\n onMsgRecvInvalid(topicStr, reason) {\n const topic = this.toTopic(topicStr);\n const error = reason.reason === _types_js__WEBPACK_IMPORTED_MODULE_0__.RejectReason.Error ? reason.error : reason.reason;\n this.msgReceivedInvalid.inc({ topic, error }, 1);\n },\n onDuplicateMsgDelivery(topicStr, deliveryDelayMs, isLateDelivery) {\n this.duplicateMsgDeliveryDelay.observe(deliveryDelayMs / 1000);\n if (isLateDelivery) {\n const topic = this.toTopic(topicStr);\n this.duplicateMsgLateDelivery.inc({ topic }, 1);\n }\n },\n onPublishDuplicateMsg(topicStr) {\n const topic = this.toTopic(topicStr);\n this.duplicateMsgIgnored.inc({ topic }, 1);\n },\n onPeerReadStreamError() {\n this.peerReadStreamError.inc(1);\n },\n onRpcRecvError() {\n this.rpcRecvError.inc(1);\n },\n onRpcDataError() {\n this.rpcDataError.inc(1);\n },\n onRpcRecv(rpc, rpcBytes) {\n this.rpcRecvBytes.inc(rpcBytes);\n this.rpcRecvCount.inc(1);\n if (rpc.subscriptions)\n this.rpcRecvSubscription.inc(rpc.subscriptions.length);\n if (rpc.messages)\n this.rpcRecvMessage.inc(rpc.messages.length);\n if (rpc.control) {\n this.rpcRecvControl.inc(1);\n if (rpc.control.ihave)\n this.rpcRecvIHave.inc(rpc.control.ihave.length);\n if (rpc.control.iwant)\n this.rpcRecvIWant.inc(rpc.control.iwant.length);\n if (rpc.control.graft)\n this.rpcRecvGraft.inc(rpc.control.graft.length);\n if (rpc.control.prune)\n this.rpcRecvPrune.inc(rpc.control.prune.length);\n }\n },\n onRpcSent(rpc, rpcBytes) {\n this.rpcSentBytes.inc(rpcBytes);\n this.rpcSentCount.inc(1);\n if (rpc.subscriptions)\n this.rpcSentSubscription.inc(rpc.subscriptions.length);\n if (rpc.messages)\n this.rpcSentMessage.inc(rpc.messages.length);\n if (rpc.control) {\n const ihave = rpc.control.ihave?.length ?? 0;\n const iwant = rpc.control.iwant?.length ?? 0;\n const graft = rpc.control.graft?.length ?? 0;\n const prune = rpc.control.prune?.length ?? 0;\n if (ihave > 0)\n this.rpcSentIHave.inc(ihave);\n if (iwant > 0)\n this.rpcSentIWant.inc(iwant);\n if (graft > 0)\n this.rpcSentGraft.inc(graft);\n if (prune > 0)\n this.rpcSentPrune.inc(prune);\n if (ihave > 0 || iwant > 0 || graft > 0 || prune > 0)\n this.rpcSentControl.inc(1);\n }\n },\n registerScores(scores, scoreThresholds) {\n let graylist = 0;\n let publish = 0;\n let gossip = 0;\n let mesh = 0;\n for (const score of scores) {\n if (score >= scoreThresholds.graylistThreshold)\n graylist++;\n if (score >= scoreThresholds.publishThreshold)\n publish++;\n if (score >= scoreThresholds.gossipThreshold)\n gossip++;\n if (score >= 0)\n mesh++;\n }\n this.peersByScoreThreshold.set({ threshold: ScoreThreshold.graylist }, graylist);\n this.peersByScoreThreshold.set({ threshold: ScoreThreshold.publish }, publish);\n this.peersByScoreThreshold.set({ threshold: ScoreThreshold.gossip }, gossip);\n this.peersByScoreThreshold.set({ threshold: ScoreThreshold.mesh }, mesh);\n // Register full score too\n this.score.set(scores);\n },\n registerScoreWeights(sw) {\n for (const [topic, wsTopic] of sw.byTopic) {\n this.scoreWeights.set({ topic, p: 'p1' }, wsTopic.p1w);\n this.scoreWeights.set({ topic, p: 'p2' }, wsTopic.p2w);\n this.scoreWeights.set({ topic, p: 'p3' }, wsTopic.p3w);\n this.scoreWeights.set({ topic, p: 'p3b' }, wsTopic.p3bw);\n this.scoreWeights.set({ topic, p: 'p4' }, wsTopic.p4w);\n }\n this.scoreWeights.set({ p: 'p5' }, sw.p5w);\n this.scoreWeights.set({ p: 'p6' }, sw.p6w);\n this.scoreWeights.set({ p: 'p7' }, sw.p7w);\n },\n registerScorePerMesh(mesh, scoreByPeer) {\n const peersPerTopicLabel = new Map();\n mesh.forEach((peers, topicStr) => {\n // Aggregate by known topicLabel or throw to 'unknown'. This prevent too high cardinality\n const topicLabel = this.topicStrToLabel.get(topicStr) ?? 'unknown';\n let peersInMesh = peersPerTopicLabel.get(topicLabel);\n if (!peersInMesh) {\n peersInMesh = new Set();\n peersPerTopicLabel.set(topicLabel, peersInMesh);\n }\n peers.forEach((p) => peersInMesh?.add(p));\n });\n for (const [topic, peers] of peersPerTopicLabel) {\n const meshScores = [];\n peers.forEach((peer) => {\n meshScores.push(scoreByPeer.get(peer) ?? 0);\n });\n this.scorePerMesh.set({ topic }, meshScores);\n }\n }\n };\n}\n//# sourceMappingURL=metrics.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.js":
+/*!**********************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.js ***!
+ \**********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"computeScore\": () => (/* binding */ computeScore)\n/* harmony export */ });\nfunction computeScore(peer, pstats, params, peerIPs) {\n let score = 0;\n // topic stores\n Object.entries(pstats.topics).forEach(([topic, tstats]) => {\n // the topic parameters\n const topicParams = params.topics[topic];\n if (topicParams === undefined) {\n // we are not scoring this topic\n return;\n }\n let topicScore = 0;\n // P1: time in Mesh\n if (tstats.inMesh) {\n let p1 = tstats.meshTime / topicParams.timeInMeshQuantum;\n if (p1 > topicParams.timeInMeshCap) {\n p1 = topicParams.timeInMeshCap;\n }\n topicScore += p1 * topicParams.timeInMeshWeight;\n }\n // P2: first message deliveries\n let p2 = tstats.firstMessageDeliveries;\n if (p2 > topicParams.firstMessageDeliveriesCap) {\n p2 = topicParams.firstMessageDeliveriesCap;\n }\n topicScore += p2 * topicParams.firstMessageDeliveriesWeight;\n // P3: mesh message deliveries\n if (tstats.meshMessageDeliveriesActive &&\n tstats.meshMessageDeliveries < topicParams.meshMessageDeliveriesThreshold) {\n const deficit = topicParams.meshMessageDeliveriesThreshold - tstats.meshMessageDeliveries;\n const p3 = deficit * deficit;\n topicScore += p3 * topicParams.meshMessageDeliveriesWeight;\n }\n // P3b:\n // NOTE: the weight of P3b is negative (validated in validateTopicScoreParams) so this detracts\n const p3b = tstats.meshFailurePenalty;\n topicScore += p3b * topicParams.meshFailurePenaltyWeight;\n // P4: invalid messages\n // NOTE: the weight of P4 is negative (validated in validateTopicScoreParams) so this detracts\n const p4 = tstats.invalidMessageDeliveries * tstats.invalidMessageDeliveries;\n topicScore += p4 * topicParams.invalidMessageDeliveriesWeight;\n // update score, mixing with topic weight\n score += topicScore * topicParams.topicWeight;\n });\n // apply the topic score cap, if any\n if (params.topicScoreCap > 0 && score > params.topicScoreCap) {\n score = params.topicScoreCap;\n }\n // P5: application-specific score\n const p5 = params.appSpecificScore(peer);\n score += p5 * params.appSpecificWeight;\n // P6: IP colocation factor\n pstats.knownIPs.forEach((ip) => {\n if (params.IPColocationFactorWhitelist.has(ip)) {\n return;\n }\n // P6 has a cliff (IPColocationFactorThreshold)\n // It's only applied if at least that many peers are connected to us from that source IP addr.\n // It is quadratic, and the weight is negative (validated in validatePeerScoreParams)\n const peersInIP = peerIPs.get(ip);\n const numPeersInIP = peersInIP ? peersInIP.size : 0;\n if (numPeersInIP > params.IPColocationFactorThreshold) {\n const surplus = numPeersInIP - params.IPColocationFactorThreshold;\n const p6 = surplus * surplus;\n score += p6 * params.IPColocationFactorWeight;\n }\n });\n // P7: behavioural pattern penalty\n if (pstats.behaviourPenalty > params.behaviourPenaltyThreshold) {\n const excess = pstats.behaviourPenalty - params.behaviourPenaltyThreshold;\n const p7 = excess * excess;\n score += p7 * params.behaviourPenaltyWeight;\n }\n return score;\n}\n//# sourceMappingURL=compute-score.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ERR_INVALID_PEER_SCORE_PARAMS\": () => (/* binding */ ERR_INVALID_PEER_SCORE_PARAMS),\n/* harmony export */ \"ERR_INVALID_PEER_SCORE_THRESHOLDS\": () => (/* binding */ ERR_INVALID_PEER_SCORE_THRESHOLDS)\n/* harmony export */ });\nconst ERR_INVALID_PEER_SCORE_PARAMS = 'ERR_INVALID_PEER_SCORE_PARAMS';\nconst ERR_INVALID_PEER_SCORE_THRESHOLDS = 'ERR_INVALID_PEER_SCORE_THRESHOLDS';\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.js":
+/*!**************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.js ***!
+ \**************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PeerScore\": () => (/* reexport safe */ _peer_score_js__WEBPACK_IMPORTED_MODULE_2__.PeerScore),\n/* harmony export */ \"createPeerScoreParams\": () => (/* reexport safe */ _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__.createPeerScoreParams),\n/* harmony export */ \"createPeerScoreThresholds\": () => (/* reexport safe */ _peer_score_thresholds_js__WEBPACK_IMPORTED_MODULE_1__.createPeerScoreThresholds),\n/* harmony export */ \"createTopicScoreParams\": () => (/* reexport safe */ _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__.createTopicScoreParams),\n/* harmony export */ \"defaultPeerScoreParams\": () => (/* reexport safe */ _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__.defaultPeerScoreParams),\n/* harmony export */ \"defaultPeerScoreThresholds\": () => (/* reexport safe */ _peer_score_thresholds_js__WEBPACK_IMPORTED_MODULE_1__.defaultPeerScoreThresholds),\n/* harmony export */ \"defaultTopicScoreParams\": () => (/* reexport safe */ _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__.defaultTopicScoreParams),\n/* harmony export */ \"validatePeerScoreParams\": () => (/* reexport safe */ _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__.validatePeerScoreParams),\n/* harmony export */ \"validatePeerScoreThresholds\": () => (/* reexport safe */ _peer_score_thresholds_js__WEBPACK_IMPORTED_MODULE_1__.validatePeerScoreThresholds),\n/* harmony export */ \"validateTopicScoreParams\": () => (/* reexport safe */ _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__.validateTopicScoreParams)\n/* harmony export */ });\n/* harmony import */ var _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./peer-score-params.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js\");\n/* harmony import */ var _peer_score_thresholds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./peer-score-thresholds.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js\");\n/* harmony import */ var _peer_score_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./peer-score.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js\");\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.js":
+/*!***************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.js ***!
+ \***************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DeliveryRecordStatus\": () => (/* binding */ DeliveryRecordStatus),\n/* harmony export */ \"MessageDeliveries\": () => (/* binding */ MessageDeliveries)\n/* harmony export */ });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/constants.js\");\n/* harmony import */ var denque__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! denque */ \"./node_modules/denque/index.js\");\n\n\nvar DeliveryRecordStatus;\n(function (DeliveryRecordStatus) {\n /**\n * we don't know (yet) if the message is valid\n */\n DeliveryRecordStatus[DeliveryRecordStatus[\"unknown\"] = 0] = \"unknown\";\n /**\n * we know the message is valid\n */\n DeliveryRecordStatus[DeliveryRecordStatus[\"valid\"] = 1] = \"valid\";\n /**\n * we know the message is invalid\n */\n DeliveryRecordStatus[DeliveryRecordStatus[\"invalid\"] = 2] = \"invalid\";\n /**\n * we were instructed by the validator to ignore the message\n */\n DeliveryRecordStatus[DeliveryRecordStatus[\"ignored\"] = 3] = \"ignored\";\n})(DeliveryRecordStatus || (DeliveryRecordStatus = {}));\n/**\n * Map of canonical message ID to DeliveryRecord\n *\n * Maintains an internal queue for efficient gc of old messages\n */\nclass MessageDeliveries {\n constructor() {\n this.records = new Map();\n this.queue = new denque__WEBPACK_IMPORTED_MODULE_1__();\n }\n ensureRecord(msgIdStr) {\n let drec = this.records.get(msgIdStr);\n if (drec) {\n return drec;\n }\n // record doesn't exist yet\n // create record\n drec = {\n status: DeliveryRecordStatus.unknown,\n firstSeen: Date.now(),\n validated: 0,\n peers: new Set()\n };\n this.records.set(msgIdStr, drec);\n // and add msgId to the queue\n const entry = {\n msgId: msgIdStr,\n expire: Date.now() + _constants_js__WEBPACK_IMPORTED_MODULE_0__.TimeCacheDuration\n };\n this.queue.push(entry);\n return drec;\n }\n gc() {\n const now = Date.now();\n // queue is sorted by expiry time\n // remove expired messages, remove from queue until first un-expired message found\n let head = this.queue.peekFront();\n while (head && head.expire < now) {\n this.records.delete(head.msgId);\n this.queue.shift();\n head = this.queue.peekFront();\n }\n }\n clear() {\n this.records.clear();\n this.queue.clear();\n }\n}\n//# sourceMappingURL=message-deliveries.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js":
+/*!**************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js ***!
+ \**************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createPeerScoreParams\": () => (/* binding */ createPeerScoreParams),\n/* harmony export */ \"createTopicScoreParams\": () => (/* binding */ createTopicScoreParams),\n/* harmony export */ \"defaultPeerScoreParams\": () => (/* binding */ defaultPeerScoreParams),\n/* harmony export */ \"defaultTopicScoreParams\": () => (/* binding */ defaultTopicScoreParams),\n/* harmony export */ \"validatePeerScoreParams\": () => (/* binding */ validatePeerScoreParams),\n/* harmony export */ \"validateTopicScoreParams\": () => (/* binding */ validateTopicScoreParams)\n/* harmony export */ });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n\n\nconst defaultPeerScoreParams = {\n topics: {},\n topicScoreCap: 10.0,\n appSpecificScore: () => 0.0,\n appSpecificWeight: 10.0,\n IPColocationFactorWeight: -5.0,\n IPColocationFactorThreshold: 10.0,\n IPColocationFactorWhitelist: new Set(),\n behaviourPenaltyWeight: -10.0,\n behaviourPenaltyThreshold: 0.0,\n behaviourPenaltyDecay: 0.2,\n decayInterval: 1000.0,\n decayToZero: 0.1,\n retainScore: 3600 * 1000\n};\nconst defaultTopicScoreParams = {\n topicWeight: 0.5,\n timeInMeshWeight: 1,\n timeInMeshQuantum: 1,\n timeInMeshCap: 3600,\n firstMessageDeliveriesWeight: 1,\n firstMessageDeliveriesDecay: 0.5,\n firstMessageDeliveriesCap: 2000,\n meshMessageDeliveriesWeight: -1,\n meshMessageDeliveriesDecay: 0.5,\n meshMessageDeliveriesCap: 100,\n meshMessageDeliveriesThreshold: 20,\n meshMessageDeliveriesWindow: 10,\n meshMessageDeliveriesActivation: 5000,\n meshFailurePenaltyWeight: -1,\n meshFailurePenaltyDecay: 0.5,\n invalidMessageDeliveriesWeight: -1,\n invalidMessageDeliveriesDecay: 0.3\n};\nfunction createPeerScoreParams(p = {}) {\n return {\n ...defaultPeerScoreParams,\n ...p,\n topics: p.topics\n ? Object.entries(p.topics).reduce((topics, [topic, topicScoreParams]) => {\n topics[topic] = createTopicScoreParams(topicScoreParams);\n return topics;\n }, {})\n : {}\n };\n}\nfunction createTopicScoreParams(p = {}) {\n return {\n ...defaultTopicScoreParams,\n ...p\n };\n}\n// peer score parameter validation\nfunction validatePeerScoreParams(p) {\n for (const [topic, params] of Object.entries(p.topics)) {\n try {\n validateTopicScoreParams(params);\n }\n catch (e) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError(`invalid score parameters for topic ${topic}: ${e.message}`, _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n }\n // check that the topic score is 0 or something positive\n if (p.topicScoreCap < 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid topic score cap; must be positive (or 0 for no cap)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check that we have an app specific score; the weight can be anything (but expected positive)\n if (p.appSpecificScore === null || p.appSpecificScore === undefined) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('missing application specific score function', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check the IP colocation factor\n if (p.IPColocationFactorWeight > 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid IPColocationFactorWeight; must be negative (or 0 to disable)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.IPColocationFactorWeight !== 0 && p.IPColocationFactorThreshold < 1) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid IPColocationFactorThreshold; must be at least 1', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check the behaviour penalty\n if (p.behaviourPenaltyWeight > 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.behaviourPenaltyWeight !== 0 && (p.behaviourPenaltyDecay <= 0 || p.behaviourPenaltyDecay >= 1)) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid BehaviourPenaltyDecay; must be between 0 and 1', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check the decay parameters\n if (p.decayInterval < 1000) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid DecayInterval; must be at least 1s', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.decayToZero <= 0 || p.decayToZero >= 1) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid DecayToZero; must be between 0 and 1', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // no need to check the score retention; a value of 0 means that we don't retain scores\n}\nfunction validateTopicScoreParams(p) {\n // make sure we have a sane topic weight\n if (p.topicWeight < 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid topic weight; must be >= 0', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check P1\n if (p.timeInMeshQuantum === 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid TimeInMeshQuantum; must be non zero', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.timeInMeshWeight < 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid TimeInMeshWeight; must be positive (or 0 to disable)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.timeInMeshWeight !== 0 && p.timeInMeshQuantum <= 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid TimeInMeshQuantum; must be positive', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.timeInMeshWeight !== 0 && p.timeInMeshCap <= 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid TimeInMeshCap; must be positive', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check P2\n if (p.firstMessageDeliveriesWeight < 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.firstMessageDeliveriesWeight !== 0 &&\n (p.firstMessageDeliveriesDecay <= 0 || p.firstMessageDeliveriesDecay >= 1)) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid FirstMessageDeliveriesDecay; must be between 0 and 1', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.firstMessageDeliveriesWeight !== 0 && p.firstMessageDeliveriesCap <= 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid FirstMessageDeliveriesCap; must be positive', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check P3\n if (p.meshMessageDeliveriesWeight > 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.meshMessageDeliveriesWeight !== 0 && (p.meshMessageDeliveriesDecay <= 0 || p.meshMessageDeliveriesDecay >= 1)) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshMessageDeliveriesDecay; must be between 0 and 1', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesCap <= 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshMessageDeliveriesCap; must be positive', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesThreshold <= 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshMessageDeliveriesThreshold; must be positive', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.meshMessageDeliveriesWindow < 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshMessageDeliveriesWindow; must be non-negative', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.meshMessageDeliveriesWeight !== 0 && p.meshMessageDeliveriesActivation < 1000) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshMessageDeliveriesActivation; must be at least 1s', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check P3b\n if (p.meshFailurePenaltyWeight > 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.meshFailurePenaltyWeight !== 0 && (p.meshFailurePenaltyDecay <= 0 || p.meshFailurePenaltyDecay >= 1)) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid MeshFailurePenaltyDecay; must be between 0 and 1', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n // check P4\n if (p.invalidMessageDeliveriesWeight > 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n if (p.invalidMessageDeliveriesDecay <= 0 || p.invalidMessageDeliveriesDecay >= 1) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid InvalidMessageDeliveriesDecay; must be between 0 and 1', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_PARAMS);\n }\n}\n//# sourceMappingURL=peer-score-params.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js":
+/*!******************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js ***!
+ \******************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createPeerScoreThresholds\": () => (/* binding */ createPeerScoreThresholds),\n/* harmony export */ \"defaultPeerScoreThresholds\": () => (/* binding */ defaultPeerScoreThresholds),\n/* harmony export */ \"validatePeerScoreThresholds\": () => (/* binding */ validatePeerScoreThresholds)\n/* harmony export */ });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/constants.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n\n\nconst defaultPeerScoreThresholds = {\n gossipThreshold: -10,\n publishThreshold: -50,\n graylistThreshold: -80,\n acceptPXThreshold: 10,\n opportunisticGraftThreshold: 20\n};\nfunction createPeerScoreThresholds(p = {}) {\n return {\n ...defaultPeerScoreThresholds,\n ...p\n };\n}\nfunction validatePeerScoreThresholds(p) {\n if (p.gossipThreshold > 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid gossip threshold; it must be <= 0', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_THRESHOLDS);\n }\n if (p.publishThreshold > 0 || p.publishThreshold > p.gossipThreshold) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid publish threshold; it must be <= 0 and <= gossip threshold', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_THRESHOLDS);\n }\n if (p.graylistThreshold > 0 || p.graylistThreshold > p.publishThreshold) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid graylist threshold; it must be <= 0 and <= publish threshold', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_THRESHOLDS);\n }\n if (p.acceptPXThreshold < 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid accept PX threshold; it must be >= 0', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_THRESHOLDS);\n }\n if (p.opportunisticGraftThreshold < 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('invalid opportunistic grafting threshold; it must be >= 0', _constants_js__WEBPACK_IMPORTED_MODULE_0__.ERR_INVALID_PEER_SCORE_THRESHOLDS);\n }\n}\n//# sourceMappingURL=peer-score-thresholds.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js":
+/*!*******************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js ***!
+ \*******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PeerScore\": () => (/* binding */ PeerScore)\n/* harmony export */ });\n/* harmony import */ var _peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./peer-score-params.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.js\");\n/* harmony import */ var _compute_score_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compute-score.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.js\");\n/* harmony import */ var _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./message-deliveries.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.js\");\n/* harmony import */ var _libp2p_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @libp2p/logger */ \"./node_modules/@libp2p/logger/dist/src/index.js\");\n/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../types.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js\");\n/* harmony import */ var _utils_set_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/set.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.js\");\n\n\n\n\n\n\nconst log = (0,_libp2p_logger__WEBPACK_IMPORTED_MODULE_3__.logger)('libp2p:gossipsub:score');\nclass PeerScore {\n constructor(params, metrics, opts) {\n this.params = params;\n this.metrics = metrics;\n /**\n * Per-peer stats for score calculation\n */\n this.peerStats = new Map();\n /**\n * IP colocation tracking; maps IP => set of peers.\n */\n this.peerIPs = new _utils_set_js__WEBPACK_IMPORTED_MODULE_5__.MapDef(() => new Set());\n /**\n * Cache score up to decayInterval if topic stats are unchanged.\n */\n this.scoreCache = new Map();\n /**\n * Recent message delivery timing/participants\n */\n this.deliveryRecords = new _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.MessageDeliveries();\n (0,_peer_score_params_js__WEBPACK_IMPORTED_MODULE_0__.validatePeerScoreParams)(params);\n this.scoreCacheValidityMs = opts.scoreCacheValidityMs;\n this.computeScore = opts.computeScore ?? _compute_score_js__WEBPACK_IMPORTED_MODULE_1__.computeScore;\n }\n get size() {\n return this.peerStats.size;\n }\n /**\n * Start PeerScore instance\n */\n start() {\n if (this._backgroundInterval) {\n log('Peer score already running');\n return;\n }\n this._backgroundInterval = setInterval(() => this.background(), this.params.decayInterval);\n log('started');\n }\n /**\n * Stop PeerScore instance\n */\n stop() {\n if (!this._backgroundInterval) {\n log('Peer score already stopped');\n return;\n }\n clearInterval(this._backgroundInterval);\n delete this._backgroundInterval;\n this.peerIPs.clear();\n this.peerStats.clear();\n this.deliveryRecords.clear();\n log('stopped');\n }\n /**\n * Periodic maintenance\n */\n background() {\n this.refreshScores();\n this.deliveryRecords.gc();\n }\n dumpPeerScoreStats() {\n return Object.fromEntries(Array.from(this.peerStats.entries()).map(([peer, stats]) => [peer, stats]));\n }\n /**\n * Decays scores, and purges score records for disconnected peers once their expiry has elapsed.\n */\n refreshScores() {\n const now = Date.now();\n const decayToZero = this.params.decayToZero;\n this.peerStats.forEach((pstats, id) => {\n if (!pstats.connected) {\n // has the retention period expired?\n if (now > pstats.expire) {\n // yes, throw it away (but clean up the IP tracking first)\n this.removeIPsForPeer(id, pstats.knownIPs);\n this.peerStats.delete(id);\n this.scoreCache.delete(id);\n }\n // we don't decay retained scores, as the peer is not active.\n // this way the peer cannot reset a negative score by simply disconnecting and reconnecting,\n // unless the retention period has elapsed.\n // similarly, a well behaved peer does not lose its score by getting disconnected.\n return;\n }\n Object.entries(pstats.topics).forEach(([topic, tstats]) => {\n const tparams = this.params.topics[topic];\n if (tparams === undefined) {\n // we are not scoring this topic\n // should be unreachable, we only add scored topics to pstats\n return;\n }\n // decay counters\n tstats.firstMessageDeliveries *= tparams.firstMessageDeliveriesDecay;\n if (tstats.firstMessageDeliveries < decayToZero) {\n tstats.firstMessageDeliveries = 0;\n }\n tstats.meshMessageDeliveries *= tparams.meshMessageDeliveriesDecay;\n if (tstats.meshMessageDeliveries < decayToZero) {\n tstats.meshMessageDeliveries = 0;\n }\n tstats.meshFailurePenalty *= tparams.meshFailurePenaltyDecay;\n if (tstats.meshFailurePenalty < decayToZero) {\n tstats.meshFailurePenalty = 0;\n }\n tstats.invalidMessageDeliveries *= tparams.invalidMessageDeliveriesDecay;\n if (tstats.invalidMessageDeliveries < decayToZero) {\n tstats.invalidMessageDeliveries = 0;\n }\n // update mesh time and activate mesh message delivery parameter if need be\n if (tstats.inMesh) {\n tstats.meshTime = now - tstats.graftTime;\n if (tstats.meshTime > tparams.meshMessageDeliveriesActivation) {\n tstats.meshMessageDeliveriesActive = true;\n }\n }\n });\n // decay P7 counter\n pstats.behaviourPenalty *= this.params.behaviourPenaltyDecay;\n if (pstats.behaviourPenalty < decayToZero) {\n pstats.behaviourPenalty = 0;\n }\n });\n }\n /**\n * Return the score for a peer\n */\n score(id) {\n this.metrics?.scoreFnCalls.inc();\n const pstats = this.peerStats.get(id);\n if (!pstats) {\n return 0;\n }\n const now = Date.now();\n const cacheEntry = this.scoreCache.get(id);\n // Found cached score within validity period\n if (cacheEntry && cacheEntry.cacheUntil > now) {\n return cacheEntry.score;\n }\n this.metrics?.scoreFnRuns.inc();\n const score = this.computeScore(id, pstats, this.params, this.peerIPs);\n const cacheUntil = now + this.scoreCacheValidityMs;\n if (cacheEntry) {\n this.metrics?.scoreCachedDelta.observe(Math.abs(score - cacheEntry.score));\n cacheEntry.score = score;\n cacheEntry.cacheUntil = cacheUntil;\n }\n else {\n this.scoreCache.set(id, { score, cacheUntil });\n }\n return score;\n }\n /**\n * Apply a behavioural penalty to a peer\n */\n addPenalty(id, penalty, penaltyLabel) {\n const pstats = this.peerStats.get(id);\n if (pstats) {\n pstats.behaviourPenalty += penalty;\n this.metrics?.onScorePenalty(penaltyLabel);\n }\n }\n addPeer(id) {\n // create peer stats (not including topic stats for each topic to be scored)\n // topic stats will be added as needed\n const pstats = {\n connected: true,\n expire: 0,\n topics: {},\n knownIPs: new Set(),\n behaviourPenalty: 0\n };\n this.peerStats.set(id, pstats);\n }\n /** Adds a new IP to a peer, if the peer is not known the update is ignored */\n addIP(id, ip) {\n const pstats = this.peerStats.get(id);\n if (pstats) {\n pstats.knownIPs.add(ip);\n }\n this.peerIPs.getOrDefault(ip).add(id);\n }\n /** Remove peer association with IP */\n removeIP(id, ip) {\n const pstats = this.peerStats.get(id);\n if (pstats) {\n pstats.knownIPs.delete(ip);\n }\n const peersWithIP = this.peerIPs.get(ip);\n if (peersWithIP) {\n peersWithIP.delete(id);\n if (peersWithIP.size === 0) {\n this.peerIPs.delete(ip);\n }\n }\n }\n removePeer(id) {\n const pstats = this.peerStats.get(id);\n if (!pstats) {\n return;\n }\n // decide whether to retain the score; this currently only retains non-positive scores\n // to dissuade attacks on the score function.\n if (this.score(id) > 0) {\n this.removeIPsForPeer(id, pstats.knownIPs);\n this.peerStats.delete(id);\n return;\n }\n // furthermore, when we decide to retain the score, the firstMessageDelivery counters are\n // reset to 0 and mesh delivery penalties applied.\n Object.entries(pstats.topics).forEach(([topic, tstats]) => {\n tstats.firstMessageDeliveries = 0;\n const threshold = this.params.topics[topic].meshMessageDeliveriesThreshold;\n if (tstats.inMesh && tstats.meshMessageDeliveriesActive && tstats.meshMessageDeliveries < threshold) {\n const deficit = threshold - tstats.meshMessageDeliveries;\n tstats.meshFailurePenalty += deficit * deficit;\n }\n tstats.inMesh = false;\n tstats.meshMessageDeliveriesActive = false;\n });\n pstats.connected = false;\n pstats.expire = Date.now() + this.params.retainScore;\n }\n /** Handles scoring functionality as a peer GRAFTs to a topic. */\n graft(id, topic) {\n const pstats = this.peerStats.get(id);\n if (pstats) {\n const tstats = this.getPtopicStats(pstats, topic);\n if (tstats) {\n // if we are scoring the topic, update the mesh status.\n tstats.inMesh = true;\n tstats.graftTime = Date.now();\n tstats.meshTime = 0;\n tstats.meshMessageDeliveriesActive = false;\n }\n }\n }\n /** Handles scoring functionality as a peer PRUNEs from a topic. */\n prune(id, topic) {\n const pstats = this.peerStats.get(id);\n if (pstats) {\n const tstats = this.getPtopicStats(pstats, topic);\n if (tstats) {\n // sticky mesh delivery rate failure penalty\n const threshold = this.params.topics[topic].meshMessageDeliveriesThreshold;\n if (tstats.meshMessageDeliveriesActive && tstats.meshMessageDeliveries < threshold) {\n const deficit = threshold - tstats.meshMessageDeliveries;\n tstats.meshFailurePenalty += deficit * deficit;\n }\n tstats.meshMessageDeliveriesActive = false;\n tstats.inMesh = false;\n // TODO: Consider clearing score cache on important penalties\n // this.scoreCache.delete(id)\n }\n }\n }\n validateMessage(msgIdStr) {\n this.deliveryRecords.ensureRecord(msgIdStr);\n }\n deliverMessage(from, msgIdStr, topic) {\n this.markFirstMessageDelivery(from, topic);\n const drec = this.deliveryRecords.ensureRecord(msgIdStr);\n const now = Date.now();\n // defensive check that this is the first delivery trace -- delivery status should be unknown\n if (drec.status !== _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.unknown) {\n log('unexpected delivery: message from %s was first seen %s ago and has delivery status %s', from, now - drec.firstSeen, _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus[drec.status]);\n return;\n }\n // mark the message as valid and reward mesh peers that have already forwarded it to us\n drec.status = _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.valid;\n drec.validated = now;\n drec.peers.forEach((p) => {\n // this check is to make sure a peer can't send us a message twice and get a double count\n // if it is a first delivery.\n if (p !== from.toString()) {\n this.markDuplicateMessageDelivery(p, topic);\n }\n });\n }\n /**\n * Similar to `rejectMessage` except does not require the message id or reason for an invalid message.\n */\n rejectInvalidMessage(from, topic) {\n this.markInvalidMessageDelivery(from, topic);\n }\n rejectMessage(from, msgIdStr, topic, reason) {\n switch (reason) {\n // these messages are not tracked, but the peer is penalized as they are invalid\n case _types_js__WEBPACK_IMPORTED_MODULE_4__.RejectReason.Error:\n this.markInvalidMessageDelivery(from, topic);\n return;\n // we ignore those messages, so do nothing.\n case _types_js__WEBPACK_IMPORTED_MODULE_4__.RejectReason.Blacklisted:\n return;\n // the rest are handled after record creation\n }\n const drec = this.deliveryRecords.ensureRecord(msgIdStr);\n // defensive check that this is the first rejection -- delivery status should be unknown\n if (drec.status !== _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.unknown) {\n log('unexpected rejection: message from %s was first seen %s ago and has delivery status %d', from, Date.now() - drec.firstSeen, _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus[drec.status]);\n return;\n }\n if (reason === _types_js__WEBPACK_IMPORTED_MODULE_4__.RejectReason.Ignore) {\n // we were explicitly instructed by the validator to ignore the message but not penalize the peer\n drec.status = _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.ignored;\n drec.peers.clear();\n return;\n }\n // mark the message as invalid and penalize peers that have already forwarded it.\n drec.status = _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.invalid;\n this.markInvalidMessageDelivery(from, topic);\n drec.peers.forEach((p) => {\n this.markInvalidMessageDelivery(p, topic);\n });\n // release the delivery time tracking map to free some memory early\n drec.peers.clear();\n }\n duplicateMessage(from, msgIdStr, topic) {\n const drec = this.deliveryRecords.ensureRecord(msgIdStr);\n if (drec.peers.has(from)) {\n // we have already seen this duplicate\n return;\n }\n switch (drec.status) {\n case _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.unknown:\n // the message is being validated; track the peer delivery and wait for\n // the Deliver/Reject/Ignore notification.\n drec.peers.add(from);\n break;\n case _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.valid:\n // mark the peer delivery time to only count a duplicate delivery once.\n drec.peers.add(from);\n this.markDuplicateMessageDelivery(from, topic, drec.validated);\n break;\n case _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.invalid:\n // we no longer track delivery time\n this.markInvalidMessageDelivery(from, topic);\n break;\n case _message_deliveries_js__WEBPACK_IMPORTED_MODULE_2__.DeliveryRecordStatus.ignored:\n // the message was ignored; do nothing (we don't know if it was valid)\n break;\n }\n }\n /**\n * Increments the \"invalid message deliveries\" counter for all scored topics the message is published in.\n */\n markInvalidMessageDelivery(from, topic) {\n const pstats = this.peerStats.get(from);\n if (pstats) {\n const tstats = this.getPtopicStats(pstats, topic);\n if (tstats) {\n tstats.invalidMessageDeliveries += 1;\n }\n }\n }\n /**\n * Increments the \"first message deliveries\" counter for all scored topics the message is published in,\n * as well as the \"mesh message deliveries\" counter, if the peer is in the mesh for the topic.\n * Messages already known (with the seenCache) are counted with markDuplicateMessageDelivery()\n */\n markFirstMessageDelivery(from, topic) {\n const pstats = this.peerStats.get(from);\n if (pstats) {\n const tstats = this.getPtopicStats(pstats, topic);\n if (tstats) {\n let cap = this.params.topics[topic].firstMessageDeliveriesCap;\n tstats.firstMessageDeliveries = Math.min(cap, tstats.firstMessageDeliveries + 1);\n if (tstats.inMesh) {\n cap = this.params.topics[topic].meshMessageDeliveriesCap;\n tstats.meshMessageDeliveries = Math.min(cap, tstats.meshMessageDeliveries + 1);\n }\n }\n }\n }\n /**\n * Increments the \"mesh message deliveries\" counter for messages we've seen before,\n * as long the message was received within the P3 window.\n */\n markDuplicateMessageDelivery(from, topic, validatedTime) {\n const pstats = this.peerStats.get(from);\n if (pstats) {\n const now = validatedTime !== undefined ? Date.now() : 0;\n const tstats = this.getPtopicStats(pstats, topic);\n if (tstats && tstats.inMesh) {\n const tparams = this.params.topics[topic];\n // check against the mesh delivery window -- if the validated time is passed as 0, then\n // the message was received before we finished validation and thus falls within the mesh\n // delivery window.\n if (validatedTime !== undefined) {\n const deliveryDelayMs = now - validatedTime;\n const isLateDelivery = deliveryDelayMs > tparams.meshMessageDeliveriesWindow;\n this.metrics?.onDuplicateMsgDelivery(topic, deliveryDelayMs, isLateDelivery);\n if (isLateDelivery) {\n return;\n }\n }\n const cap = tparams.meshMessageDeliveriesCap;\n tstats.meshMessageDeliveries = Math.min(cap, tstats.meshMessageDeliveries + 1);\n }\n }\n }\n /**\n * Removes an IP list from the tracking list for a peer.\n */\n removeIPsForPeer(id, ipsToRemove) {\n for (const ipToRemove of ipsToRemove) {\n const peerSet = this.peerIPs.get(ipToRemove);\n if (peerSet) {\n peerSet.delete(id);\n if (peerSet.size === 0) {\n this.peerIPs.delete(ipToRemove);\n }\n }\n }\n }\n /**\n * Returns topic stats if they exist, otherwise if the supplied parameters score the\n * topic, inserts the default stats and returns a reference to those. If neither apply, returns None.\n */\n getPtopicStats(pstats, topic) {\n let topicStats = pstats.topics[topic];\n if (topicStats !== undefined) {\n return topicStats;\n }\n if (this.params.topics[topic] !== undefined) {\n topicStats = {\n inMesh: false,\n graftTime: 0,\n meshTime: 0,\n firstMessageDeliveries: 0,\n meshMessageDeliveries: 0,\n meshMessageDeliveriesActive: false,\n meshFailurePenalty: 0,\n invalidMessageDeliveries: 0\n };\n pstats.topics[topic] = topicStats;\n return topicStats;\n }\n return null;\n }\n}\n//# sourceMappingURL=peer-score.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/scoreMetrics.js":
+/*!*********************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/scoreMetrics.js ***!
+ \*********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"computeAllPeersScoreWeights\": () => (/* binding */ computeAllPeersScoreWeights),\n/* harmony export */ \"computeScoreWeights\": () => (/* binding */ computeScoreWeights)\n/* harmony export */ });\nfunction computeScoreWeights(peer, pstats, params, peerIPs, topicStrToLabel) {\n let score = 0;\n const byTopic = new Map();\n // topic stores\n Object.entries(pstats.topics).forEach(([topic, tstats]) => {\n // the topic parameters\n // Aggregate by known topicLabel or throw to 'unknown'. This prevent too high cardinality\n const topicLabel = topicStrToLabel.get(topic) ?? 'unknown';\n const topicParams = params.topics[topic];\n if (topicParams === undefined) {\n // we are not scoring this topic\n return;\n }\n let topicScores = byTopic.get(topicLabel);\n if (!topicScores) {\n topicScores = {\n p1w: 0,\n p2w: 0,\n p3w: 0,\n p3bw: 0,\n p4w: 0\n };\n byTopic.set(topicLabel, topicScores);\n }\n let p1w = 0;\n let p2w = 0;\n let p3w = 0;\n let p3bw = 0;\n let p4w = 0;\n // P1: time in Mesh\n if (tstats.inMesh) {\n const p1 = Math.max(tstats.meshTime / topicParams.timeInMeshQuantum, topicParams.timeInMeshCap);\n p1w += p1 * topicParams.timeInMeshWeight;\n }\n // P2: first message deliveries\n let p2 = tstats.firstMessageDeliveries;\n if (p2 > topicParams.firstMessageDeliveriesCap) {\n p2 = topicParams.firstMessageDeliveriesCap;\n }\n p2w += p2 * topicParams.firstMessageDeliveriesWeight;\n // P3: mesh message deliveries\n if (tstats.meshMessageDeliveriesActive &&\n tstats.meshMessageDeliveries < topicParams.meshMessageDeliveriesThreshold) {\n const deficit = topicParams.meshMessageDeliveriesThreshold - tstats.meshMessageDeliveries;\n const p3 = deficit * deficit;\n p3w += p3 * topicParams.meshMessageDeliveriesWeight;\n }\n // P3b:\n // NOTE: the weight of P3b is negative (validated in validateTopicScoreParams) so this detracts\n const p3b = tstats.meshFailurePenalty;\n p3bw += p3b * topicParams.meshFailurePenaltyWeight;\n // P4: invalid messages\n // NOTE: the weight of P4 is negative (validated in validateTopicScoreParams) so this detracts\n const p4 = tstats.invalidMessageDeliveries * tstats.invalidMessageDeliveries;\n p4w += p4 * topicParams.invalidMessageDeliveriesWeight;\n // update score, mixing with topic weight\n score += (p1w + p2w + p3w + p3bw + p4w) * topicParams.topicWeight;\n topicScores.p1w += p1w;\n topicScores.p2w += p2w;\n topicScores.p3w += p3w;\n topicScores.p3bw += p3bw;\n topicScores.p4w += p4w;\n });\n // apply the topic score cap, if any\n if (params.topicScoreCap > 0 && score > params.topicScoreCap) {\n score = params.topicScoreCap;\n // Proportionally apply cap to all individual contributions\n const capF = params.topicScoreCap / score;\n for (const ws of byTopic.values()) {\n ws.p1w *= capF;\n ws.p2w *= capF;\n ws.p3w *= capF;\n ws.p3bw *= capF;\n ws.p4w *= capF;\n }\n }\n let p5w = 0;\n let p6w = 0;\n let p7w = 0;\n // P5: application-specific score\n const p5 = params.appSpecificScore(peer);\n p5w += p5 * params.appSpecificWeight;\n // P6: IP colocation factor\n pstats.knownIPs.forEach((ip) => {\n if (params.IPColocationFactorWhitelist.has(ip)) {\n return;\n }\n // P6 has a cliff (IPColocationFactorThreshold)\n // It's only applied if at least that many peers are connected to us from that source IP addr.\n // It is quadratic, and the weight is negative (validated in validatePeerScoreParams)\n const peersInIP = peerIPs.get(ip);\n const numPeersInIP = peersInIP ? peersInIP.size : 0;\n if (numPeersInIP > params.IPColocationFactorThreshold) {\n const surplus = numPeersInIP - params.IPColocationFactorThreshold;\n const p6 = surplus * surplus;\n p6w += p6 * params.IPColocationFactorWeight;\n }\n });\n // P7: behavioural pattern penalty\n const p7 = pstats.behaviourPenalty * pstats.behaviourPenalty;\n p7w += p7 * params.behaviourPenaltyWeight;\n score += p5w + p6w + p7w;\n return {\n byTopic,\n p5w,\n p6w,\n p7w,\n score\n };\n}\nfunction computeAllPeersScoreWeights(peerIdStrs, peerStats, params, peerIPs, topicStrToLabel) {\n const sw = {\n byTopic: new Map(),\n p5w: [],\n p6w: [],\n p7w: [],\n score: []\n };\n for (const peerIdStr of peerIdStrs) {\n const pstats = peerStats.get(peerIdStr);\n if (pstats) {\n const swPeer = computeScoreWeights(peerIdStr, pstats, params, peerIPs, topicStrToLabel);\n for (const [topic, swPeerTopic] of swPeer.byTopic) {\n let swTopic = sw.byTopic.get(topic);\n if (!swTopic) {\n swTopic = {\n p1w: [],\n p2w: [],\n p3w: [],\n p3bw: [],\n p4w: []\n };\n sw.byTopic.set(topic, swTopic);\n }\n swTopic.p1w.push(swPeerTopic.p1w);\n swTopic.p2w.push(swPeerTopic.p2w);\n swTopic.p3w.push(swPeerTopic.p3w);\n swTopic.p3bw.push(swPeerTopic.p3bw);\n swTopic.p4w.push(swPeerTopic.p4w);\n }\n sw.p5w.push(swPeer.p5w);\n sw.p6w.push(swPeer.p6w);\n sw.p7w.push(swPeer.p7w);\n sw.score.push(swPeer.score);\n }\n else {\n sw.p5w.push(0);\n sw.p6w.push(0);\n sw.p7w.push(0);\n sw.score.push(0);\n }\n }\n return sw;\n}\n//# sourceMappingURL=scoreMetrics.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/scoreMetrics.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.js ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"InboundStream\": () => (/* binding */ InboundStream),\n/* harmony export */ \"OutboundStream\": () => (/* binding */ OutboundStream)\n/* harmony export */ });\n/* harmony import */ var abortable_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! abortable-iterator */ \"./node_modules/abortable-iterator/dist/src/index.js\");\n/* harmony import */ var it_pipe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! it-pipe */ \"./node_modules/it-pipe/dist/src/index.js\");\n/* harmony import */ var it_pushable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! it-pushable */ \"./node_modules/it-pushable/dist/src/index.js\");\n/* harmony import */ var it_length_prefixed__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! it-length-prefixed */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/index.js\");\n\n\n\n\nclass OutboundStream {\n constructor(rawStream, errCallback, opts) {\n this.rawStream = rawStream;\n this.pushable = (0,it_pushable__WEBPACK_IMPORTED_MODULE_2__.pushable)({ objectMode: false });\n this.closeController = new AbortController();\n this.maxBufferSize = opts.maxBufferSize ?? Infinity;\n (0,it_pipe__WEBPACK_IMPORTED_MODULE_1__.pipe)((0,abortable_iterator__WEBPACK_IMPORTED_MODULE_0__.abortableSource)(this.pushable, this.closeController.signal, { returnOnAbort: true }), (0,it_length_prefixed__WEBPACK_IMPORTED_MODULE_3__.encode)(), this.rawStream).catch(errCallback);\n }\n get protocol() {\n // TODO remove this non-nullish assertion after https://github.com/libp2p/js-libp2p-interfaces/pull/265 is incorporated\n return this.rawStream.stat.protocol;\n }\n push(data) {\n if (this.pushable.readableLength > this.maxBufferSize) {\n throw Error(`OutboundStream buffer full, size > ${this.maxBufferSize}`);\n }\n this.pushable.push(data);\n }\n close() {\n this.closeController.abort();\n // similar to pushable.end() but clear the internal buffer\n this.pushable.return();\n this.rawStream.close();\n }\n}\nclass InboundStream {\n constructor(rawStream, opts = {}) {\n this.rawStream = rawStream;\n this.closeController = new AbortController();\n this.source = (0,abortable_iterator__WEBPACK_IMPORTED_MODULE_0__.abortableSource)((0,it_pipe__WEBPACK_IMPORTED_MODULE_1__.pipe)(this.rawStream, (0,it_length_prefixed__WEBPACK_IMPORTED_MODULE_3__.decode)(opts)), this.closeController.signal, {\n returnOnAbort: true\n });\n }\n close() {\n this.closeController.abort();\n this.rawStream.close();\n }\n}\n//# sourceMappingURL=stream.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.js ***!
+ \*********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"IWantTracer\": () => (/* binding */ IWantTracer)\n/* harmony export */ });\n/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js\");\n\n/**\n * IWantTracer is an internal tracer that tracks IWANT requests in order to penalize\n * peers who don't follow up on IWANT requests after an IHAVE advertisement.\n * The tracking of promises is probabilistic to avoid using too much memory.\n *\n * Note: Do not confuse these 'promises' with JS Promise objects.\n * These 'promises' are merely expectations of a peer's behavior.\n */\nclass IWantTracer {\n constructor(gossipsubIWantFollowupMs, msgIdToStrFn, metrics) {\n this.gossipsubIWantFollowupMs = gossipsubIWantFollowupMs;\n this.msgIdToStrFn = msgIdToStrFn;\n this.metrics = metrics;\n /**\n * Promises to deliver a message\n * Map per message id, per peer, promise expiration time\n */\n this.promises = new Map();\n /**\n * First request time by msgId. Used for metrics to track expire times.\n * Necessary to know if peers are actually breaking promises or simply sending them a bit later\n */\n this.requestMsByMsg = new Map();\n this.requestMsByMsgExpire = 10 * gossipsubIWantFollowupMs;\n }\n get size() {\n return this.promises.size;\n }\n get requestMsByMsgSize() {\n return this.requestMsByMsg.size;\n }\n /**\n * Track a promise to deliver a message from a list of msgIds we are requesting\n */\n addPromise(from, msgIds) {\n // pick msgId randomly from the list\n const ix = Math.floor(Math.random() * msgIds.length);\n const msgId = msgIds[ix];\n const msgIdStr = this.msgIdToStrFn(msgId);\n let expireByPeer = this.promises.get(msgIdStr);\n if (!expireByPeer) {\n expireByPeer = new Map();\n this.promises.set(msgIdStr, expireByPeer);\n }\n const now = Date.now();\n // If a promise for this message id and peer already exists we don't update the expiry\n if (!expireByPeer.has(from)) {\n expireByPeer.set(from, now + this.gossipsubIWantFollowupMs);\n if (this.metrics) {\n this.metrics.iwantPromiseStarted.inc(1);\n if (!this.requestMsByMsg.has(msgIdStr)) {\n this.requestMsByMsg.set(msgIdStr, now);\n }\n }\n }\n }\n /**\n * Returns the number of broken promises for each peer who didn't follow up on an IWANT request.\n *\n * This should be called not too often relative to the expire times, since it iterates over the whole data.\n */\n getBrokenPromises() {\n const now = Date.now();\n const result = new Map();\n let brokenPromises = 0;\n this.promises.forEach((expireByPeer, msgId) => {\n expireByPeer.forEach((expire, p) => {\n // the promise has been broken\n if (expire < now) {\n // add 1 to result\n result.set(p, (result.get(p) ?? 0) + 1);\n // delete from tracked promises\n expireByPeer.delete(p);\n // for metrics\n brokenPromises++;\n }\n });\n // clean up empty promises for a msgId\n if (!expireByPeer.size) {\n this.promises.delete(msgId);\n }\n });\n this.metrics?.iwantPromiseBroken.inc(brokenPromises);\n return result;\n }\n /**\n * Someone delivered a message, stop tracking promises for it\n */\n deliverMessage(msgIdStr, isDuplicate = false) {\n this.trackMessage(msgIdStr);\n const expireByPeer = this.promises.get(msgIdStr);\n // Expired promise, check requestMsByMsg\n if (expireByPeer) {\n this.promises.delete(msgIdStr);\n if (this.metrics) {\n this.metrics.iwantPromiseResolved.inc(1);\n if (isDuplicate)\n this.metrics.iwantPromiseResolvedFromDuplicate.inc(1);\n this.metrics.iwantPromiseResolvedPeers.inc(expireByPeer.size);\n }\n }\n }\n /**\n * A message got rejected, so we can stop tracking promises and let the score penalty apply from invalid message delivery,\n * unless its an obviously invalid message.\n */\n rejectMessage(msgIdStr, reason) {\n this.trackMessage(msgIdStr);\n // A message got rejected, so we can stop tracking promises and let the score penalty apply.\n // With the expection of obvious invalid messages\n switch (reason) {\n case _types_js__WEBPACK_IMPORTED_MODULE_0__.RejectReason.Error:\n return;\n }\n this.promises.delete(msgIdStr);\n }\n clear() {\n this.promises.clear();\n }\n prune() {\n const maxMs = Date.now() - this.requestMsByMsgExpire;\n let count = 0;\n for (const [k, v] of this.requestMsByMsg.entries()) {\n if (v < maxMs) {\n // messages that stay too long in the requestMsByMsg map, delete\n this.requestMsByMsg.delete(k);\n count++;\n }\n else {\n // recent messages, keep them\n // sort by insertion order\n break;\n }\n }\n this.metrics?.iwantMessagePruned.inc(count);\n }\n trackMessage(msgIdStr) {\n if (this.metrics) {\n const requestMs = this.requestMsByMsg.get(msgIdStr);\n if (requestMs !== undefined) {\n this.metrics.iwantPromiseDeliveryTime.observe((Date.now() - requestMs) / 1000);\n this.requestMsByMsg.delete(msgIdStr);\n }\n }\n }\n}\n//# sourceMappingURL=tracer.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js":
+/*!********************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js ***!
+ \********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MessageStatus\": () => (/* binding */ MessageStatus),\n/* harmony export */ \"PublishConfigType\": () => (/* binding */ PublishConfigType),\n/* harmony export */ \"RejectReason\": () => (/* binding */ RejectReason),\n/* harmony export */ \"SignaturePolicy\": () => (/* binding */ SignaturePolicy),\n/* harmony export */ \"ValidateError\": () => (/* binding */ ValidateError),\n/* harmony export */ \"rejectReasonFromAcceptance\": () => (/* binding */ rejectReasonFromAcceptance)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interface-pubsub */ \"./node_modules/@libp2p/interface-pubsub/dist/src/index.js\");\n\nvar SignaturePolicy;\n(function (SignaturePolicy) {\n /**\n * On the producing side:\n * - Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields.\n *\n * On the consuming side:\n * - Enforce the fields to be present, reject otherwise.\n * - Propagate only if the fields are valid and signature can be verified, reject otherwise.\n */\n SignaturePolicy[\"StrictSign\"] = \"StrictSign\";\n /**\n * On the producing side:\n * - Build messages without the signature, key, from and seqno fields.\n * - The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty.\n *\n * On the consuming side:\n * - Enforce the fields to be absent, reject otherwise.\n * - Propagate only if the fields are absent, reject otherwise.\n * - A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash.\n */\n SignaturePolicy[\"StrictNoSign\"] = \"StrictNoSign\";\n})(SignaturePolicy || (SignaturePolicy = {}));\nvar PublishConfigType;\n(function (PublishConfigType) {\n PublishConfigType[PublishConfigType[\"Signing\"] = 0] = \"Signing\";\n PublishConfigType[PublishConfigType[\"Anonymous\"] = 1] = \"Anonymous\";\n})(PublishConfigType || (PublishConfigType = {}));\nvar RejectReason;\n(function (RejectReason) {\n /**\n * The message failed the configured validation during decoding.\n * SelfOrigin is considered a ValidationError\n */\n RejectReason[\"Error\"] = \"error\";\n /**\n * Custom validator fn reported status IGNORE.\n */\n RejectReason[\"Ignore\"] = \"ignore\";\n /**\n * Custom validator fn reported status REJECT.\n */\n RejectReason[\"Reject\"] = \"reject\";\n /**\n * The peer that sent the message OR the source from field is blacklisted.\n * Causes messages to be ignored, not penalized, neither do score record creation.\n */\n RejectReason[\"Blacklisted\"] = \"blacklisted\";\n})(RejectReason || (RejectReason = {}));\nvar ValidateError;\n(function (ValidateError) {\n /// The message has an invalid signature,\n ValidateError[\"InvalidSignature\"] = \"invalid_signature\";\n /// The sequence number was the incorrect size\n ValidateError[\"InvalidSeqno\"] = \"invalid_seqno\";\n /// The PeerId was invalid\n ValidateError[\"InvalidPeerId\"] = \"invalid_peerid\";\n /// Signature existed when validation has been sent to\n /// [`crate::behaviour::MessageAuthenticity::Anonymous`].\n ValidateError[\"SignaturePresent\"] = \"signature_present\";\n /// Sequence number existed when validation has been sent to\n /// [`crate::behaviour::MessageAuthenticity::Anonymous`].\n ValidateError[\"SeqnoPresent\"] = \"seqno_present\";\n /// Message source existed when validation has been sent to\n /// [`crate::behaviour::MessageAuthenticity::Anonymous`].\n ValidateError[\"FromPresent\"] = \"from_present\";\n /// The data transformation failed.\n ValidateError[\"TransformFailed\"] = \"transform_failed\";\n})(ValidateError || (ValidateError = {}));\nvar MessageStatus;\n(function (MessageStatus) {\n MessageStatus[\"duplicate\"] = \"duplicate\";\n MessageStatus[\"invalid\"] = \"invalid\";\n MessageStatus[\"valid\"] = \"valid\";\n})(MessageStatus || (MessageStatus = {}));\n/**\n * Typesafe conversion of MessageAcceptance -> RejectReason. TS ensures all values covered\n */\nfunction rejectReasonFromAcceptance(acceptance) {\n switch (acceptance) {\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_0__.TopicValidatorResult.Ignore:\n return RejectReason.Ignore;\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_0__.TopicValidatorResult.Reject:\n return RejectReason.Reject;\n }\n}\n//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js":
+/*!************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js ***!
+ \************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SignPrefix\": () => (/* binding */ SignPrefix),\n/* harmony export */ \"buildRawMessage\": () => (/* binding */ buildRawMessage),\n/* harmony export */ \"validateToRawMessage\": () => (/* binding */ validateToRawMessage)\n/* harmony export */ });\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var _libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @libp2p/crypto/keys */ \"./node_modules/@libp2p/crypto/dist/src/keys/index.js\");\n/* harmony import */ var _libp2p_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @libp2p/crypto */ \"./node_modules/@libp2p/crypto/dist/src/index.js\");\n/* harmony import */ var _libp2p_peer_id__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @libp2p/peer-id */ \"./node_modules/@libp2p/peer-id/dist/src/index.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var _message_rpc_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../message/rpc.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.js\");\n/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../types.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js\");\n/* harmony import */ var _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @libp2p/interface-pubsub */ \"./node_modules/@libp2p/interface-pubsub/dist/src/index.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n\n\n\n\n\n\n\n\n\n\nconst SignPrefix = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__.fromString)('libp2p-pubsub:');\nasync function buildRawMessage(publishConfig, topic, originalData, transformedData) {\n switch (publishConfig.type) {\n case _types_js__WEBPACK_IMPORTED_MODULE_7__.PublishConfigType.Signing: {\n const rpcMsg = {\n from: publishConfig.author.toBytes(),\n data: transformedData,\n seqno: (0,_libp2p_crypto__WEBPACK_IMPORTED_MODULE_3__.randomBytes)(8),\n topic,\n signature: undefined,\n key: undefined // Exclude key field for signing\n };\n // Get the message in bytes, and prepend with the pubsub prefix\n // the signature is over the bytes \"libp2p-pubsub:\"\n const bytes = (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([SignPrefix, _message_rpc_js__WEBPACK_IMPORTED_MODULE_6__.RPC.Message.encode(rpcMsg).finish()]);\n rpcMsg.signature = await publishConfig.privateKey.sign(bytes);\n rpcMsg.key = publishConfig.key;\n const msg = {\n type: 'signed',\n from: publishConfig.author,\n data: originalData,\n sequenceNumber: BigInt(`0x${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_9__.toString)(rpcMsg.seqno, 'base16')}`),\n topic,\n signature: rpcMsg.signature,\n key: rpcMsg.key\n };\n return {\n raw: rpcMsg,\n msg: msg\n };\n }\n case _types_js__WEBPACK_IMPORTED_MODULE_7__.PublishConfigType.Anonymous: {\n return {\n raw: {\n from: undefined,\n data: transformedData,\n seqno: undefined,\n topic,\n signature: undefined,\n key: undefined\n },\n msg: {\n type: 'unsigned',\n data: originalData,\n topic\n }\n };\n }\n }\n}\nasync function validateToRawMessage(signaturePolicy, msg) {\n // If strict-sign, verify all\n // If anonymous (no-sign), ensure no preven\n switch (signaturePolicy) {\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_8__.StrictNoSign:\n if (msg.signature != null)\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.SignaturePresent };\n if (msg.seqno != null)\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.SeqnoPresent };\n if (msg.key != null)\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.FromPresent };\n return { valid: true, message: { type: 'unsigned', topic: msg.topic, data: msg.data ?? new Uint8Array(0) } };\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_8__.StrictSign: {\n // Verify seqno\n if (msg.seqno == null)\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidSeqno };\n if (msg.seqno.length !== 8) {\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidSeqno };\n }\n if (msg.signature == null)\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidSignature };\n if (msg.from == null)\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidPeerId };\n let fromPeerId;\n try {\n // TODO: Fix PeerId types\n fromPeerId = (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_4__.peerIdFromBytes)(msg.from);\n }\n catch (e) {\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidPeerId };\n }\n // - check from defined\n // - transform source to PeerId\n // - parse signature\n // - get .key, else from source\n // - check key == source if present\n // - verify sig\n let publicKey;\n if (msg.key) {\n publicKey = (0,_libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_2__.unmarshalPublicKey)(msg.key);\n // TODO: Should `fromPeerId.pubKey` be optional?\n if (fromPeerId.publicKey !== undefined && !(0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_5__.equals)(publicKey.bytes, fromPeerId.publicKey)) {\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidPeerId };\n }\n }\n else {\n if (fromPeerId.publicKey == null) {\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidPeerId };\n }\n publicKey = (0,_libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_2__.unmarshalPublicKey)(fromPeerId.publicKey);\n }\n const rpcMsgPreSign = {\n from: msg.from,\n data: msg.data,\n seqno: msg.seqno,\n topic: msg.topic,\n signature: undefined,\n key: undefined // Exclude key field for signing\n };\n // Get the message in bytes, and prepend with the pubsub prefix\n // the signature is over the bytes \"libp2p-pubsub:\"\n const bytes = (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([SignPrefix, _message_rpc_js__WEBPACK_IMPORTED_MODULE_6__.RPC.Message.encode(rpcMsgPreSign).finish()]);\n if (!(await publicKey.verify(bytes, msg.signature))) {\n return { valid: false, error: _types_js__WEBPACK_IMPORTED_MODULE_7__.ValidateError.InvalidSignature };\n }\n return {\n valid: true,\n message: {\n type: 'signed',\n from: fromPeerId,\n data: msg.data ?? new Uint8Array(0),\n sequenceNumber: BigInt(`0x${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_9__.toString)(msg.seqno, 'base16')}`),\n topic: msg.topic,\n signature: msg.signature,\n key: msg.key ?? (0,_libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_2__.marshalPublicKey)(publicKey)\n }\n };\n }\n }\n}\n//# sourceMappingURL=buildRawMessage.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/buildRawMessage.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/index.js":
+/*!**************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/index.js ***!
+ \**************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getPublishConfigFromPeerId\": () => (/* reexport safe */ _publishConfig_js__WEBPACK_IMPORTED_MODULE_2__.getPublishConfigFromPeerId),\n/* harmony export */ \"messageIdToString\": () => (/* reexport safe */ _messageIdToString_js__WEBPACK_IMPORTED_MODULE_1__.messageIdToString),\n/* harmony export */ \"shuffle\": () => (/* reexport safe */ _shuffle_js__WEBPACK_IMPORTED_MODULE_0__.shuffle)\n/* harmony export */ });\n/* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shuffle.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/shuffle.js\");\n/* harmony import */ var _messageIdToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./messageIdToString.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/messageIdToString.js\");\n/* harmony import */ var _publishConfig_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./publishConfig.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js\");\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/messageIdToString.js":
+/*!**************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/messageIdToString.js ***!
+ \**************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"messageIdToString\": () => (/* binding */ messageIdToString)\n/* harmony export */ });\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n\n/**\n * Browser friendly function to convert Uint8Array message id to base64 string.\n */\nfunction messageIdToString(msgId) {\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_0__.toString)(msgId, 'base64');\n}\n//# sourceMappingURL=messageIdToString.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/messageIdToString.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"msgIdFnStrictNoSign\": () => (/* binding */ msgIdFnStrictNoSign),\n/* harmony export */ \"msgIdFnStrictSign\": () => (/* binding */ msgIdFnStrictSign)\n/* harmony export */ });\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/multiformats/src/hashes/sha2-browser.js\");\n/* harmony import */ var _libp2p_pubsub_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/pubsub/utils */ \"./node_modules/@libp2p/pubsub/dist/src/utils.js\");\n\n\n/**\n * Generate a message id, based on the `key` and `seqno`\n */\nfunction msgIdFnStrictSign(msg) {\n if (msg.type !== 'signed') {\n throw new Error('expected signed message type');\n }\n // Should never happen\n if (msg.sequenceNumber == null)\n throw Error('missing seqno field');\n // TODO: Should use .from here or key?\n return (0,_libp2p_pubsub_utils__WEBPACK_IMPORTED_MODULE_1__.msgId)(msg.from.toBytes(), msg.sequenceNumber);\n}\n/**\n * Generate a message id, based on message `data`\n */\nasync function msgIdFnStrictNoSign(msg) {\n return await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__.sha256.encode(msg.data);\n}\n//# sourceMappingURL=msgIdFn.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/msgIdFn.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/multiaddr.js":
+/*!******************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/multiaddr.js ***!
+ \******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"multiaddrToIPStr\": () => (/* binding */ multiaddrToIPStr)\n/* harmony export */ });\n/* harmony import */ var _multiformats_multiaddr_convert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @multiformats/multiaddr/convert */ \"./node_modules/@multiformats/multiaddr/dist/src/convert.js\");\n\n// Protocols https://github.com/multiformats/multiaddr/blob/master/protocols.csv\n// code size name\n// 4 32 ip4\n// 41 128 ip6\nvar Protocol;\n(function (Protocol) {\n Protocol[Protocol[\"ip4\"] = 4] = \"ip4\";\n Protocol[Protocol[\"ip6\"] = 41] = \"ip6\";\n})(Protocol || (Protocol = {}));\nfunction multiaddrToIPStr(multiaddr) {\n for (const tuple of multiaddr.tuples()) {\n switch (tuple[0]) {\n case Protocol.ip4:\n case Protocol.ip6:\n return (0,_multiformats_multiaddr_convert__WEBPACK_IMPORTED_MODULE_0__.convertToString)(tuple[0], tuple[1]);\n }\n }\n return null;\n}\n//# sourceMappingURL=multiaddr.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/multiaddr.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js":
+/*!**********************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js ***!
+ \**********************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getPublishConfigFromPeerId\": () => (/* binding */ getPublishConfigFromPeerId)\n/* harmony export */ });\n/* harmony import */ var _libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/crypto/keys */ \"./node_modules/@libp2p/crypto/dist/src/keys/index.js\");\n/* harmony import */ var _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/interface-pubsub */ \"./node_modules/@libp2p/interface-pubsub/dist/src/index.js\");\n/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../types.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.js\");\n\n\n\n/**\n * Prepare a PublishConfig object from a PeerId.\n */\nasync function getPublishConfigFromPeerId(signaturePolicy, peerId) {\n switch (signaturePolicy) {\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_1__.StrictSign: {\n if (!peerId) {\n throw Error('Must provide PeerId');\n }\n if (peerId.privateKey == null) {\n throw Error('Cannot sign message, no private key present');\n }\n if (peerId.publicKey == null) {\n throw Error('Cannot sign message, no public key present');\n }\n // Transform privateKey once at initialization time instead of once per message\n const privateKey = await (0,_libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_0__.unmarshalPrivateKey)(peerId.privateKey);\n return {\n type: _types_js__WEBPACK_IMPORTED_MODULE_2__.PublishConfigType.Signing,\n author: peerId,\n key: peerId.publicKey,\n privateKey\n };\n }\n case _libp2p_interface_pubsub__WEBPACK_IMPORTED_MODULE_1__.StrictNoSign:\n return {\n type: _types_js__WEBPACK_IMPORTED_MODULE_2__.PublishConfigType.Anonymous\n };\n default:\n throw new Error(`Unknown signature policy \"${signaturePolicy}\"`);\n }\n}\n//# sourceMappingURL=publishConfig.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/publishConfig.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MapDef\": () => (/* binding */ MapDef),\n/* harmony export */ \"removeFirstNItemsFromSet\": () => (/* binding */ removeFirstNItemsFromSet),\n/* harmony export */ \"removeItemsFromSet\": () => (/* binding */ removeItemsFromSet)\n/* harmony export */ });\n/**\n * Exclude up to `ineed` items from a set if item meets condition `cond`\n */\nfunction removeItemsFromSet(superSet, ineed, cond = () => true) {\n const subset = new Set();\n if (ineed <= 0)\n return subset;\n for (const id of superSet) {\n if (subset.size >= ineed)\n break;\n if (cond(id)) {\n subset.add(id);\n superSet.delete(id);\n }\n }\n return subset;\n}\n/**\n * Exclude up to `ineed` items from a set\n */\nfunction removeFirstNItemsFromSet(superSet, ineed) {\n return removeItemsFromSet(superSet, ineed, () => true);\n}\nclass MapDef extends Map {\n constructor(getDefault) {\n super();\n this.getDefault = getDefault;\n }\n getOrDefault(key) {\n let value = super.get(key);\n if (value === undefined) {\n value = this.getDefault();\n this.set(key, value);\n }\n return value;\n }\n}\n//# sourceMappingURL=set.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/set.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/shuffle.js":
+/*!****************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/shuffle.js ***!
+ \****************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"shuffle\": () => (/* binding */ shuffle)\n/* harmony export */ });\n/**\n * Pseudo-randomly shuffles an array\n *\n * Mutates the input array\n */\nfunction shuffle(arr) {\n if (arr.length <= 1) {\n return arr;\n }\n const randInt = () => {\n return Math.floor(Math.random() * Math.floor(arr.length));\n };\n for (let i = 0; i < arr.length; i++) {\n const j = randInt();\n const tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }\n return arr;\n}\n//# sourceMappingURL=shuffle.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/shuffle.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/time-cache.js":
+/*!*******************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/time-cache.js ***!
+ \*******************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SimpleTimeCache\": () => (/* binding */ SimpleTimeCache)\n/* harmony export */ });\n/**\n * This is similar to https://github.com/daviddias/time-cache/blob/master/src/index.js\n * for our own need, we don't use lodash throttle to improve performance.\n * This gives 4x - 5x performance gain compared to npm TimeCache\n */\nclass SimpleTimeCache {\n constructor(opts) {\n this.entries = new Map();\n this.validityMs = opts.validityMs;\n // allow negative validityMs so that this does not cache anything, spec test compliance.spec.js\n // sends duplicate messages and expect peer to receive all. Application likely uses positive validityMs\n }\n get size() {\n return this.entries.size;\n }\n /** Returns true if there was a key collision and the entry is dropped */\n put(key, value) {\n if (this.entries.has(key)) {\n // Key collisions break insertion order in the entries cache, which break prune logic.\n // prune relies on each iterated entry to have strictly ascending validUntilMs, else it\n // won't prune expired entries and SimpleTimeCache will grow unexpectedly.\n // As of Oct 2022 NodeJS v16, inserting the same key twice with different value does not\n // change the key position in the iterator stream. A unit test asserts this behaviour.\n return true;\n }\n this.entries.set(key, { value, validUntilMs: Date.now() + this.validityMs });\n return false;\n }\n prune() {\n const now = Date.now();\n for (const [k, v] of this.entries.entries()) {\n if (v.validUntilMs < now) {\n this.entries.delete(k);\n }\n else {\n // Entries are inserted with strictly ascending validUntilMs.\n // Stop early to save iterations\n break;\n }\n }\n }\n has(key) {\n return this.entries.has(key);\n }\n get(key) {\n const value = this.entries.get(key);\n return value && value.validUntilMs >= Date.now() ? value.value : undefined;\n }\n clear() {\n this.entries.clear();\n }\n}\n//# sourceMappingURL=time-cache.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/dist/src/utils/time-cache.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/alloc.js":
+/*!****************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/alloc.js ***!
+ \****************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"alloc\": () => (/* binding */ alloc),\n/* harmony export */ \"allocUnsafe\": () => (/* binding */ allocUnsafe)\n/* harmony export */ });\nfunction alloc(len) {\n return new Uint8Array(len);\n}\nfunction allocUnsafe(len) {\n if (globalThis?.Buffer?.allocUnsafe != null) {\n return globalThis.Buffer.allocUnsafe(len);\n }\n return new Uint8Array(len);\n}\n//# sourceMappingURL=alloc.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/alloc.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/decode.js":
+/*!*****************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/decode.js ***!
+ \*****************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MAX_DATA_LENGTH\": () => (/* binding */ MAX_DATA_LENGTH),\n/* harmony export */ \"MAX_LENGTH_LENGTH\": () => (/* binding */ MAX_LENGTH_LENGTH),\n/* harmony export */ \"decode\": () => (/* binding */ decode)\n/* harmony export */ });\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n/* harmony import */ var uint8_varint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8-varint */ \"./node_modules/uint8-varint/dist/src/index.js\");\n/* harmony import */ var err_code__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! err-code */ \"./node_modules/err-code/index.js\");\n/* eslint max-depth: [\"error\", 6] */\n\n\n\n// Maximum length of the length section of the message\nconst MAX_LENGTH_LENGTH = 8; // Varint.encode(Number.MAX_SAFE_INTEGER).length\n// Maximum length of the data section of the message\nconst MAX_DATA_LENGTH = 1024 * 1024 * 4;\nvar ReadMode;\n(function (ReadMode) {\n ReadMode[ReadMode[\"LENGTH\"] = 0] = \"LENGTH\";\n ReadMode[ReadMode[\"DATA\"] = 1] = \"DATA\";\n})(ReadMode || (ReadMode = {}));\nconst defaultDecoder = (buf) => {\n const length = uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.decode(buf);\n defaultDecoder.bytes = uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.encodingLength(length);\n return length;\n};\ndefaultDecoder.bytes = 0;\nfunction decode(options) {\n const decoder = async function* (source) {\n const buffer = new uint8arraylist__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayList();\n let mode = ReadMode.LENGTH;\n let dataLength = -1;\n const lengthDecoder = options?.lengthDecoder ?? defaultDecoder;\n const maxLengthLength = options?.maxLengthLength ?? MAX_LENGTH_LENGTH;\n const maxDataLength = options?.maxDataLength ?? MAX_DATA_LENGTH;\n for await (const buf of source) {\n buffer.append(buf);\n while (buffer.byteLength > 0) {\n if (mode === ReadMode.LENGTH) {\n // read length, ignore errors for short reads\n try {\n dataLength = lengthDecoder(buffer);\n if (dataLength < 0) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('invalid message length'), 'ERR_INVALID_MSG_LENGTH');\n }\n if (dataLength > maxDataLength) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('message length too long'), 'ERR_MSG_DATA_TOO_LONG');\n }\n const dataLengthLength = lengthDecoder.bytes;\n buffer.consume(dataLengthLength);\n if (options?.onLength != null) {\n options.onLength(dataLength);\n }\n mode = ReadMode.DATA;\n }\n catch (err) {\n if (err instanceof RangeError) {\n if (buffer.byteLength > maxLengthLength) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('message length length too long'), 'ERR_MSG_LENGTH_TOO_LONG');\n }\n break;\n }\n throw err;\n }\n }\n if (mode === ReadMode.DATA) {\n if (buffer.byteLength < dataLength) {\n // not enough data, wait for more\n break;\n }\n const data = buffer.sublist(0, dataLength);\n buffer.consume(dataLength);\n if (options?.onData != null) {\n options.onData(data);\n }\n yield data;\n mode = ReadMode.LENGTH;\n }\n }\n }\n if (buffer.byteLength > 0) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('unexpected end of input'), 'ERR_UNEXPECTED_EOF');\n }\n };\n return decoder;\n}\n/**\n * @param {*} reader\n * @param {import('./types').DecoderOptions} [options]\n * @returns\n */\ndecode.fromReader = (reader, options) => {\n let byteLength = 1; // Read single byte chunks until the length is known\n const varByteSource = (async function* () {\n while (true) {\n try {\n const { done, value } = await reader.next(byteLength);\n if (done === true) {\n return;\n }\n if (value != null) {\n yield value;\n }\n }\n catch (err) {\n if (err.code === 'ERR_UNDER_READ') {\n return { done: true, value: null };\n }\n throw err;\n }\n finally {\n // Reset the byteLength so we continue to check for varints\n byteLength = 1;\n }\n }\n }());\n /**\n * Once the length has been parsed, read chunk for that length\n */\n const onLength = (l) => { byteLength = l; };\n return decode({\n ...(options ?? {}),\n onLength\n })(varByteSource);\n};\n//# sourceMappingURL=decode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/decode.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/encode.js":
+/*!*****************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/encode.js ***!
+ \*****************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"encode\": () => (/* binding */ encode)\n/* harmony export */ });\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n/* harmony import */ var uint8_varint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8-varint */ \"./node_modules/uint8-varint/dist/src/index.js\");\n/* harmony import */ var _alloc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alloc.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/alloc.js\");\n\n\n\nconst defaultEncoder = (length) => {\n const lengthLength = uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.encodingLength(length);\n const lengthBuf = (0,_alloc_js__WEBPACK_IMPORTED_MODULE_2__.allocUnsafe)(lengthLength);\n uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.encode(length, lengthBuf);\n defaultEncoder.bytes = lengthLength;\n return lengthBuf;\n};\ndefaultEncoder.bytes = 0;\nfunction encode(options) {\n options = options ?? {};\n const encodeLength = options.lengthEncoder ?? defaultEncoder;\n const encoder = async function* (source) {\n for await (const chunk of source) {\n // length + data\n const length = encodeLength(chunk.byteLength);\n // yield only Uint8Arrays\n if (length instanceof Uint8Array) {\n yield length;\n }\n else {\n yield* length;\n }\n // yield only Uint8Arrays\n if (chunk instanceof Uint8Array) {\n yield chunk;\n }\n else {\n yield* chunk;\n }\n }\n };\n return encoder;\n}\nencode.single = (chunk, options) => {\n options = options ?? {};\n const encodeLength = options.lengthEncoder ?? defaultEncoder;\n return new uint8arraylist__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayList(encodeLength(chunk.byteLength), chunk);\n};\n//# sourceMappingURL=encode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/encode.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/index.js":
+/*!****************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/index.js ***!
+ \****************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decode\": () => (/* reexport safe */ _decode_js__WEBPACK_IMPORTED_MODULE_1__.decode),\n/* harmony export */ \"encode\": () => (/* reexport safe */ _encode_js__WEBPACK_IMPORTED_MODULE_0__.encode)\n/* harmony export */ });\n/* harmony import */ var _encode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./encode.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/encode.js\");\n/* harmony import */ var _decode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decode.js */ \"./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/decode.js\");\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-gossipsub/node_modules/it-length-prefixed/dist/src/index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/constants.js":
+/*!********************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/constants.js ***!
+ \********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DUMP_SESSION_KEYS\": () => (/* binding */ DUMP_SESSION_KEYS),\n/* harmony export */ \"NOISE_MSG_MAX_LENGTH_BYTES\": () => (/* binding */ NOISE_MSG_MAX_LENGTH_BYTES),\n/* harmony export */ \"NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG\": () => (/* binding */ NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG)\n/* harmony export */ });\nconst NOISE_MSG_MAX_LENGTH_BYTES = 65535;\nconst NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG = NOISE_MSG_MAX_LENGTH_BYTES - 16;\nconst DUMP_SESSION_KEYS = Boolean(globalThis.process?.env?.DUMP_SESSION_KEYS);\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/constants.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/crypto.js":
+/*!*****************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/crypto.js ***!
+ \*****************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n\n//# sourceMappingURL=crypto.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/crypto.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/stablelib.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/stablelib.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"stablelib\": () => (/* binding */ stablelib)\n/* harmony export */ });\n/* harmony import */ var _stablelib_hkdf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @stablelib/hkdf */ \"./node_modules/@stablelib/hkdf/lib/hkdf.js\");\n/* harmony import */ var _stablelib_x25519__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @stablelib/x25519 */ \"./node_modules/@stablelib/x25519/lib/x25519.js\");\n/* harmony import */ var _stablelib_sha256__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @stablelib/sha256 */ \"./node_modules/@stablelib/sha256/lib/sha256.js\");\n/* harmony import */ var _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @stablelib/chacha20poly1305 */ \"./node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js\");\n\n\n\n\nconst stablelib = {\n hashSHA256(data) {\n return (0,_stablelib_sha256__WEBPACK_IMPORTED_MODULE_2__.hash)(data);\n },\n getHKDF(ck, ikm) {\n const hkdf = new _stablelib_hkdf__WEBPACK_IMPORTED_MODULE_0__.HKDF(_stablelib_sha256__WEBPACK_IMPORTED_MODULE_2__.SHA256, ikm, ck);\n const okmU8Array = hkdf.expand(96);\n const okm = okmU8Array;\n const k1 = okm.subarray(0, 32);\n const k2 = okm.subarray(32, 64);\n const k3 = okm.subarray(64, 96);\n return [k1, k2, k3];\n },\n generateX25519KeyPair() {\n const keypair = _stablelib_x25519__WEBPACK_IMPORTED_MODULE_1__.generateKeyPair();\n return {\n publicKey: keypair.publicKey,\n privateKey: keypair.secretKey\n };\n },\n generateX25519KeyPairFromSeed(seed) {\n const keypair = _stablelib_x25519__WEBPACK_IMPORTED_MODULE_1__.generateKeyPairFromSeed(seed);\n return {\n publicKey: keypair.publicKey,\n privateKey: keypair.secretKey\n };\n },\n generateX25519SharedKey(privateKey, publicKey) {\n return _stablelib_x25519__WEBPACK_IMPORTED_MODULE_1__.sharedKey(privateKey, publicKey);\n },\n chaCha20Poly1305Encrypt(plaintext, nonce, ad, k) {\n const ctx = new _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_3__.ChaCha20Poly1305(k);\n return ctx.seal(nonce, plaintext, ad);\n },\n chaCha20Poly1305Decrypt(ciphertext, nonce, ad, k, dst) {\n const ctx = new _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_3__.ChaCha20Poly1305(k);\n return ctx.open(nonce, ciphertext, ad, dst);\n }\n};\n//# sourceMappingURL=stablelib.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/stablelib.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/streaming.js":
+/*!***************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/streaming.js ***!
+ \***************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decryptStream\": () => (/* binding */ decryptStream),\n/* harmony export */ \"encryptStream\": () => (/* binding */ encryptStream)\n/* harmony export */ });\n/* harmony import */ var _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @stablelib/chacha20poly1305 */ \"./node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/constants.js\");\n/* harmony import */ var _encoder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../encoder.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/encoder.js\");\n\n\n\n// Returns generator that encrypts payload from the user\nfunction encryptStream(handshake, metrics) {\n return async function* (source) {\n for await (const chunk of source) {\n for (let i = 0; i < chunk.length; i += _constants_js__WEBPACK_IMPORTED_MODULE_1__.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG) {\n let end = i + _constants_js__WEBPACK_IMPORTED_MODULE_1__.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG;\n if (end > chunk.length) {\n end = chunk.length;\n }\n const data = handshake.encrypt(chunk.subarray(i, end), handshake.session);\n metrics?.encryptedPackets.increment();\n yield (0,_encoder_js__WEBPACK_IMPORTED_MODULE_2__.uint16BEEncode)(data.byteLength);\n yield data;\n }\n }\n };\n}\n// Decrypt received payload to the user\nfunction decryptStream(handshake, metrics) {\n return async function* (source) {\n for await (const chunk of source) {\n for (let i = 0; i < chunk.length; i += _constants_js__WEBPACK_IMPORTED_MODULE_1__.NOISE_MSG_MAX_LENGTH_BYTES) {\n let end = i + _constants_js__WEBPACK_IMPORTED_MODULE_1__.NOISE_MSG_MAX_LENGTH_BYTES;\n if (end > chunk.length) {\n end = chunk.length;\n }\n if (end - _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_0__.TAG_LENGTH < i) {\n throw new Error('Invalid chunk');\n }\n const encrypted = chunk.subarray(i, end);\n // memory allocation is not cheap so reuse the encrypted Uint8Array\n // see https://github.com/ChainSafe/js-libp2p-noise/pull/242#issue-1422126164\n // this is ok because chacha20 reads bytes one by one and don't reread after that\n // it's also tested in https://github.com/ChainSafe/as-chacha20poly1305/pull/1/files#diff-25252846b58979dcaf4e41d47b3eadd7e4f335e7fb98da6c049b1f9cd011f381R48\n const dst = chunk.subarray(i, end - _stablelib_chacha20poly1305__WEBPACK_IMPORTED_MODULE_0__.TAG_LENGTH);\n const { plaintext: decrypted, valid } = handshake.decrypt(encrypted, handshake.session, dst);\n if (!valid) {\n metrics?.decryptErrors.increment();\n throw new Error('Failed to validate decrypted chunk');\n }\n metrics?.decryptedPackets.increment();\n yield decrypted;\n }\n }\n };\n}\n//# sourceMappingURL=streaming.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/streaming.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/encoder.js":
+/*!******************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/encoder.js ***!
+ \******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decode0\": () => (/* binding */ decode0),\n/* harmony export */ \"decode1\": () => (/* binding */ decode1),\n/* harmony export */ \"decode2\": () => (/* binding */ decode2),\n/* harmony export */ \"encode0\": () => (/* binding */ encode0),\n/* harmony export */ \"encode1\": () => (/* binding */ encode1),\n/* harmony export */ \"encode2\": () => (/* binding */ encode2),\n/* harmony export */ \"uint16BEDecode\": () => (/* binding */ uint16BEDecode),\n/* harmony export */ \"uint16BEEncode\": () => (/* binding */ uint16BEEncode)\n/* harmony export */ });\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n\nconst allocUnsafe = (len) => {\n if (globalThis.Buffer) {\n return globalThis.Buffer.allocUnsafe(len);\n }\n return new Uint8Array(len);\n};\nconst uint16BEEncode = (value) => {\n const target = allocUnsafe(2);\n new DataView(target.buffer, target.byteOffset, target.byteLength).setUint16(0, value, false);\n return target;\n};\nuint16BEEncode.bytes = 2;\nconst uint16BEDecode = (data) => {\n if (data.length < 2)\n throw RangeError('Could not decode int16BE');\n if (data instanceof Uint8Array) {\n return new DataView(data.buffer, data.byteOffset, data.byteLength).getUint16(0, false);\n }\n return data.getUint16(0);\n};\nuint16BEDecode.bytes = 2;\n// Note: IK and XX encoder usage is opposite (XX uses in stages encode0 where IK uses encode1)\nfunction encode0(message) {\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([message.ne, message.ciphertext], message.ne.length + message.ciphertext.length);\n}\nfunction encode1(message) {\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([message.ne, message.ns, message.ciphertext], message.ne.length + message.ns.length + message.ciphertext.length);\n}\nfunction encode2(message) {\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([message.ns, message.ciphertext], message.ns.length + message.ciphertext.length);\n}\nfunction decode0(input) {\n if (input.length < 32) {\n throw new Error('Cannot decode stage 0 MessageBuffer: length less than 32 bytes.');\n }\n return {\n ne: input.subarray(0, 32),\n ciphertext: input.subarray(32, input.length),\n ns: new Uint8Array(0)\n };\n}\nfunction decode1(input) {\n if (input.length < 80) {\n throw new Error('Cannot decode stage 1 MessageBuffer: length less than 80 bytes.');\n }\n return {\n ne: input.subarray(0, 32),\n ns: input.subarray(32, 80),\n ciphertext: input.subarray(80, input.length)\n };\n}\nfunction decode2(input) {\n if (input.length < 48) {\n throw new Error('Cannot decode stage 2 MessageBuffer: length less than 48 bytes.');\n }\n return {\n ne: new Uint8Array(0),\n ns: input.subarray(0, 48),\n ciphertext: input.subarray(48, input.length)\n };\n}\n//# sourceMappingURL=encoder.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/encoder.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/handshake-xx.js":
+/*!***********************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/handshake-xx.js ***!
+ \***********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"XXHandshake\": () => (/* binding */ XXHandshake)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interface_connection_encrypter_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interface-connection-encrypter/errors */ \"./node_modules/@libp2p/interface-connection-encrypter/dist/src/errors.js\");\n/* harmony import */ var _encoder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./encoder.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/encoder.js\");\n/* harmony import */ var _handshakes_xx_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./handshakes/xx.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/xx.js\");\n/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/logger.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/utils.js\");\n\n\n\n\n\nclass XXHandshake {\n constructor(isInitiator, payload, prologue, crypto, staticKeypair, connection, remotePeer, handshake) {\n this.remoteExtensions = { webtransportCerthashes: [] };\n this.isInitiator = isInitiator;\n this.payload = payload;\n this.prologue = prologue;\n this.staticKeypair = staticKeypair;\n this.connection = connection;\n if (remotePeer) {\n this.remotePeer = remotePeer;\n }\n this.xx = handshake ?? new _handshakes_xx_js__WEBPACK_IMPORTED_MODULE_2__.XX(crypto);\n this.session = this.xx.initSession(this.isInitiator, this.prologue, this.staticKeypair);\n }\n // stage 0\n async propose() {\n (0,_logger_js__WEBPACK_IMPORTED_MODULE_3__.logLocalStaticKeys)(this.session.hs.s);\n if (this.isInitiator) {\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 0 - Initiator starting to send first message.');\n const messageBuffer = this.xx.sendMessage(this.session, new Uint8Array(0));\n this.connection.writeLP((0,_encoder_js__WEBPACK_IMPORTED_MODULE_1__.encode0)(messageBuffer));\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 0 - Initiator finished sending first message.');\n (0,_logger_js__WEBPACK_IMPORTED_MODULE_3__.logLocalEphemeralKeys)(this.session.hs.e);\n }\n else {\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 0 - Responder waiting to receive first message...');\n const receivedMessageBuffer = (0,_encoder_js__WEBPACK_IMPORTED_MODULE_1__.decode0)((await this.connection.readLP()).subarray());\n const { valid } = this.xx.recvMessage(this.session, receivedMessageBuffer);\n if (!valid) {\n throw new _libp2p_interface_connection_encrypter_errors__WEBPACK_IMPORTED_MODULE_0__.InvalidCryptoExchangeError('xx handshake stage 0 validation fail');\n }\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 0 - Responder received first message.');\n (0,_logger_js__WEBPACK_IMPORTED_MODULE_3__.logRemoteEphemeralKey)(this.session.hs.re);\n }\n }\n // stage 1\n async exchange() {\n if (this.isInitiator) {\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 1 - Initiator waiting to receive first message from responder...');\n const receivedMessageBuffer = (0,_encoder_js__WEBPACK_IMPORTED_MODULE_1__.decode1)((await this.connection.readLP()).subarray());\n const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer);\n if (!valid) {\n throw new _libp2p_interface_connection_encrypter_errors__WEBPACK_IMPORTED_MODULE_0__.InvalidCryptoExchangeError('xx handshake stage 1 validation fail');\n }\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 1 - Initiator received the message.');\n (0,_logger_js__WEBPACK_IMPORTED_MODULE_3__.logRemoteEphemeralKey)(this.session.hs.re);\n (0,_logger_js__WEBPACK_IMPORTED_MODULE_3__.logRemoteStaticKey)(this.session.hs.rs);\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace(\"Initiator going to check remote's signature...\");\n try {\n const decodedPayload = (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.decodePayload)(plaintext);\n this.remotePeer = this.remotePeer || await (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getPeerIdFromPayload)(decodedPayload);\n await (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.verifySignedPayload)(this.session.hs.rs, decodedPayload, this.remotePeer);\n this.setRemoteNoiseExtension(decodedPayload.extensions);\n }\n catch (e) {\n const err = e;\n throw new _libp2p_interface_connection_encrypter_errors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`);\n }\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('All good with the signature!');\n }\n else {\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 1 - Responder sending out first message with signed payload and static key.');\n const messageBuffer = this.xx.sendMessage(this.session, this.payload);\n this.connection.writeLP((0,_encoder_js__WEBPACK_IMPORTED_MODULE_1__.encode1)(messageBuffer));\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 1 - Responder sent the second handshake message with signed payload.');\n (0,_logger_js__WEBPACK_IMPORTED_MODULE_3__.logLocalEphemeralKeys)(this.session.hs.e);\n }\n }\n // stage 2\n async finish() {\n if (this.isInitiator) {\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 2 - Initiator sending third handshake message.');\n const messageBuffer = this.xx.sendMessage(this.session, this.payload);\n this.connection.writeLP((0,_encoder_js__WEBPACK_IMPORTED_MODULE_1__.encode2)(messageBuffer));\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 2 - Initiator sent message with signed payload.');\n }\n else {\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 2 - Responder waiting for third handshake message...');\n const receivedMessageBuffer = (0,_encoder_js__WEBPACK_IMPORTED_MODULE_1__.decode2)((await this.connection.readLP()).subarray());\n const { plaintext, valid } = this.xx.recvMessage(this.session, receivedMessageBuffer);\n if (!valid) {\n throw new _libp2p_interface_connection_encrypter_errors__WEBPACK_IMPORTED_MODULE_0__.InvalidCryptoExchangeError('xx handshake stage 2 validation fail');\n }\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.trace('Stage 2 - Responder received the message, finished handshake.');\n try {\n const decodedPayload = (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.decodePayload)(plaintext);\n this.remotePeer = this.remotePeer || await (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.getPeerIdFromPayload)(decodedPayload);\n await (0,_utils_js__WEBPACK_IMPORTED_MODULE_4__.verifySignedPayload)(this.session.hs.rs, decodedPayload, this.remotePeer);\n this.setRemoteNoiseExtension(decodedPayload.extensions);\n }\n catch (e) {\n const err = e;\n throw new _libp2p_interface_connection_encrypter_errors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedPeerError(`Error occurred while verifying signed payload: ${err.message}`);\n }\n }\n (0,_logger_js__WEBPACK_IMPORTED_MODULE_3__.logCipherState)(this.session);\n }\n encrypt(plaintext, session) {\n const cs = this.getCS(session);\n return this.xx.encryptWithAd(cs, new Uint8Array(0), plaintext);\n }\n decrypt(ciphertext, session, dst) {\n const cs = this.getCS(session, false);\n return this.xx.decryptWithAd(cs, new Uint8Array(0), ciphertext, dst);\n }\n getRemoteStaticKey() {\n return this.session.hs.rs;\n }\n getCS(session, encryption = true) {\n if (!session.cs1 || !session.cs2) {\n throw new _libp2p_interface_connection_encrypter_errors__WEBPACK_IMPORTED_MODULE_0__.InvalidCryptoExchangeError('Handshake not completed properly, cipher state does not exist.');\n }\n if (this.isInitiator) {\n return encryption ? session.cs1 : session.cs2;\n }\n else {\n return encryption ? session.cs2 : session.cs1;\n }\n }\n setRemoteNoiseExtension(e) {\n if (e) {\n this.remoteExtensions = e;\n }\n }\n}\n//# sourceMappingURL=handshake-xx.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/handshake-xx.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/abstract-handshake.js":
+/*!****************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/abstract-handshake.js ***!
+ \****************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AbstractHandshake\": () => (/* binding */ AbstractHandshake)\n/* harmony export */ });\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays */ \"./node_modules/uint8arrays/dist/src/index.js\");\n/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../logger.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/logger.js\");\n/* harmony import */ var _nonce_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../nonce.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/nonce.js\");\n\n\n\n\n\nclass AbstractHandshake {\n constructor(crypto) {\n this.crypto = crypto;\n }\n encryptWithAd(cs, ad, plaintext) {\n const e = this.encrypt(cs.k, cs.n, ad, plaintext);\n cs.n.increment();\n return e;\n }\n decryptWithAd(cs, ad, ciphertext, dst) {\n const { plaintext, valid } = this.decrypt(cs.k, cs.n, ad, ciphertext, dst);\n if (valid)\n cs.n.increment();\n return { plaintext, valid };\n }\n // Cipher state related\n hasKey(cs) {\n return !this.isEmptyKey(cs.k);\n }\n createEmptyKey() {\n return new Uint8Array(32);\n }\n isEmptyKey(k) {\n const emptyKey = this.createEmptyKey();\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_0__.equals)(emptyKey, k);\n }\n encrypt(k, n, ad, plaintext) {\n n.assertValue();\n return this.crypto.chaCha20Poly1305Encrypt(plaintext, n.getBytes(), ad, k);\n }\n encryptAndHash(ss, plaintext) {\n let ciphertext;\n if (this.hasKey(ss.cs)) {\n ciphertext = this.encryptWithAd(ss.cs, ss.h, plaintext);\n }\n else {\n ciphertext = plaintext;\n }\n this.mixHash(ss, ciphertext);\n return ciphertext;\n }\n decrypt(k, n, ad, ciphertext, dst) {\n n.assertValue();\n const encryptedMessage = this.crypto.chaCha20Poly1305Decrypt(ciphertext, n.getBytes(), ad, k, dst);\n if (encryptedMessage) {\n return {\n plaintext: encryptedMessage,\n valid: true\n };\n }\n else {\n return {\n plaintext: new Uint8Array(0),\n valid: false\n };\n }\n }\n decryptAndHash(ss, ciphertext) {\n let plaintext;\n let valid = true;\n if (this.hasKey(ss.cs)) {\n ({ plaintext, valid } = this.decryptWithAd(ss.cs, ss.h, ciphertext));\n }\n else {\n plaintext = ciphertext;\n }\n this.mixHash(ss, ciphertext);\n return { plaintext, valid };\n }\n dh(privateKey, publicKey) {\n try {\n const derivedU8 = this.crypto.generateX25519SharedKey(privateKey, publicKey);\n if (derivedU8.length === 32) {\n return derivedU8;\n }\n return derivedU8.subarray(0, 32);\n }\n catch (e) {\n const err = e;\n _logger_js__WEBPACK_IMPORTED_MODULE_3__.logger.error(err);\n return new Uint8Array(32);\n }\n }\n mixHash(ss, data) {\n ss.h = this.getHash(ss.h, data);\n }\n getHash(a, b) {\n const u = this.crypto.hashSHA256((0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_1__.concat)([a, b], a.length + b.length));\n return u;\n }\n mixKey(ss, ikm) {\n const [ck, tempK] = this.crypto.getHKDF(ss.ck, ikm);\n ss.cs = this.initializeKey(tempK);\n ss.ck = ck;\n }\n initializeKey(k) {\n return { k, n: new _nonce_js__WEBPACK_IMPORTED_MODULE_4__.Nonce() };\n }\n // Symmetric state related\n initializeSymmetric(protocolName) {\n const protocolNameBytes = (0,uint8arrays__WEBPACK_IMPORTED_MODULE_2__.fromString)(protocolName, 'utf-8');\n const h = this.hashProtocolName(protocolNameBytes);\n const ck = h;\n const key = this.createEmptyKey();\n const cs = this.initializeKey(key);\n return { cs, ck, h };\n }\n hashProtocolName(protocolName) {\n if (protocolName.length <= 32) {\n const h = new Uint8Array(32);\n h.set(protocolName);\n return h;\n }\n else {\n return this.getHash(protocolName, new Uint8Array(0));\n }\n }\n split(ss) {\n const [tempk1, tempk2] = this.crypto.getHKDF(ss.ck, new Uint8Array(0));\n const cs1 = this.initializeKey(tempk1);\n const cs2 = this.initializeKey(tempk2);\n return { cs1, cs2 };\n }\n writeMessageRegular(cs, payload) {\n const ciphertext = this.encryptWithAd(cs, new Uint8Array(0), payload);\n const ne = this.createEmptyKey();\n const ns = new Uint8Array(0);\n return { ne, ns, ciphertext };\n }\n readMessageRegular(cs, message) {\n return this.decryptWithAd(cs, new Uint8Array(0), message.ciphertext);\n }\n}\n//# sourceMappingURL=abstract-handshake.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/abstract-handshake.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/xx.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/xx.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"XX\": () => (/* binding */ XX)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/utils.js\");\n/* harmony import */ var _abstract_handshake_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./abstract-handshake.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/abstract-handshake.js\");\n\n\nclass XX extends _abstract_handshake_js__WEBPACK_IMPORTED_MODULE_1__.AbstractHandshake {\n initializeInitiator(prologue, s, rs, psk) {\n const name = 'Noise_XX_25519_ChaChaPoly_SHA256';\n const ss = this.initializeSymmetric(name);\n this.mixHash(ss, prologue);\n const re = new Uint8Array(32);\n return { ss, s, rs, psk, re };\n }\n initializeResponder(prologue, s, rs, psk) {\n const name = 'Noise_XX_25519_ChaChaPoly_SHA256';\n const ss = this.initializeSymmetric(name);\n this.mixHash(ss, prologue);\n const re = new Uint8Array(32);\n return { ss, s, rs, psk, re };\n }\n writeMessageA(hs, payload, e) {\n const ns = new Uint8Array(0);\n if (e !== undefined) {\n hs.e = e;\n }\n else {\n hs.e = this.crypto.generateX25519KeyPair();\n }\n const ne = hs.e.publicKey;\n this.mixHash(hs.ss, ne);\n const ciphertext = this.encryptAndHash(hs.ss, payload);\n return { ne, ns, ciphertext };\n }\n writeMessageB(hs, payload) {\n hs.e = this.crypto.generateX25519KeyPair();\n const ne = hs.e.publicKey;\n this.mixHash(hs.ss, ne);\n this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re));\n const spk = hs.s.publicKey;\n const ns = this.encryptAndHash(hs.ss, spk);\n this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re));\n const ciphertext = this.encryptAndHash(hs.ss, payload);\n return { ne, ns, ciphertext };\n }\n writeMessageC(hs, payload) {\n const spk = hs.s.publicKey;\n const ns = this.encryptAndHash(hs.ss, spk);\n this.mixKey(hs.ss, this.dh(hs.s.privateKey, hs.re));\n const ciphertext = this.encryptAndHash(hs.ss, payload);\n const ne = this.createEmptyKey();\n const messageBuffer = { ne, ns, ciphertext };\n const { cs1, cs2 } = this.split(hs.ss);\n return { h: hs.ss.h, messageBuffer, cs1, cs2 };\n }\n readMessageA(hs, message) {\n if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isValidPublicKey)(message.ne)) {\n hs.re = message.ne;\n }\n this.mixHash(hs.ss, hs.re);\n return this.decryptAndHash(hs.ss, message.ciphertext);\n }\n readMessageB(hs, message) {\n if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isValidPublicKey)(message.ne)) {\n hs.re = message.ne;\n }\n this.mixHash(hs.ss, hs.re);\n if (!hs.e) {\n throw new Error('Handshake state `e` param is missing.');\n }\n this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.re));\n const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns);\n if (valid1 && (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isValidPublicKey)(ns)) {\n hs.rs = ns;\n }\n this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs));\n const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext);\n return { plaintext, valid: (valid1 && valid2) };\n }\n readMessageC(hs, message) {\n const { plaintext: ns, valid: valid1 } = this.decryptAndHash(hs.ss, message.ns);\n if (valid1 && (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isValidPublicKey)(ns)) {\n hs.rs = ns;\n }\n if (!hs.e) {\n throw new Error('Handshake state `e` param is missing.');\n }\n this.mixKey(hs.ss, this.dh(hs.e.privateKey, hs.rs));\n const { plaintext, valid: valid2 } = this.decryptAndHash(hs.ss, message.ciphertext);\n const { cs1, cs2 } = this.split(hs.ss);\n return { h: hs.ss.h, plaintext, valid: (valid1 && valid2), cs1, cs2 };\n }\n initSession(initiator, prologue, s) {\n const psk = this.createEmptyKey();\n const rs = new Uint8Array(32); // no static key yet\n let hs;\n if (initiator) {\n hs = this.initializeInitiator(prologue, s, rs, psk);\n }\n else {\n hs = this.initializeResponder(prologue, s, rs, psk);\n }\n return {\n hs,\n i: initiator,\n mc: 0\n };\n }\n sendMessage(session, message, ephemeral) {\n let messageBuffer;\n if (session.mc === 0) {\n messageBuffer = this.writeMessageA(session.hs, message, ephemeral);\n }\n else if (session.mc === 1) {\n messageBuffer = this.writeMessageB(session.hs, message);\n }\n else if (session.mc === 2) {\n const { h, messageBuffer: resultingBuffer, cs1, cs2 } = this.writeMessageC(session.hs, message);\n messageBuffer = resultingBuffer;\n session.h = h;\n session.cs1 = cs1;\n session.cs2 = cs2;\n }\n else if (session.mc > 2) {\n if (session.i) {\n if (!session.cs1) {\n throw new Error('CS1 (cipher state) is not defined');\n }\n messageBuffer = this.writeMessageRegular(session.cs1, message);\n }\n else {\n if (!session.cs2) {\n throw new Error('CS2 (cipher state) is not defined');\n }\n messageBuffer = this.writeMessageRegular(session.cs2, message);\n }\n }\n else {\n throw new Error('Session invalid.');\n }\n session.mc++;\n return messageBuffer;\n }\n recvMessage(session, message) {\n let plaintext = new Uint8Array(0);\n let valid = false;\n if (session.mc === 0) {\n ({ plaintext, valid } = this.readMessageA(session.hs, message));\n }\n else if (session.mc === 1) {\n ({ plaintext, valid } = this.readMessageB(session.hs, message));\n }\n else if (session.mc === 2) {\n const { h, plaintext: resultingPlaintext, valid: resultingValid, cs1, cs2 } = this.readMessageC(session.hs, message);\n plaintext = resultingPlaintext;\n valid = resultingValid;\n session.h = h;\n session.cs1 = cs1;\n session.cs2 = cs2;\n }\n session.mc++;\n return { plaintext, valid };\n }\n}\n//# sourceMappingURL=xx.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/handshakes/xx.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/index.js":
+/*!****************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/index.js ***!
+ \****************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"noise\": () => (/* binding */ noise),\n/* harmony export */ \"stablelib\": () => (/* reexport safe */ _crypto_stablelib_js__WEBPACK_IMPORTED_MODULE_2__.stablelib)\n/* harmony export */ });\n/* harmony import */ var _noise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./noise.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/noise.js\");\n/* harmony import */ var _crypto_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./crypto.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/crypto.js\");\n/* harmony import */ var _crypto_stablelib_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./crypto/stablelib.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/stablelib.js\");\n\n\n\nfunction noise(init = {}) {\n return () => new _noise_js__WEBPACK_IMPORTED_MODULE_0__.Noise(init);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/logger.js":
+/*!*****************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/logger.js ***!
+ \*****************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"logCipherState\": () => (/* binding */ logCipherState),\n/* harmony export */ \"logLocalEphemeralKeys\": () => (/* binding */ logLocalEphemeralKeys),\n/* harmony export */ \"logLocalStaticKeys\": () => (/* binding */ logLocalStaticKeys),\n/* harmony export */ \"logRemoteEphemeralKey\": () => (/* binding */ logRemoteEphemeralKey),\n/* harmony export */ \"logRemoteStaticKey\": () => (/* binding */ logRemoteStaticKey),\n/* harmony export */ \"logger\": () => (/* binding */ log)\n/* harmony export */ });\n/* harmony import */ var _libp2p_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/logger */ \"./node_modules/@libp2p/logger/dist/src/index.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/constants.js\");\n\n\n\nconst log = (0,_libp2p_logger__WEBPACK_IMPORTED_MODULE_0__.logger)('libp2p:noise');\n\nlet keyLogger;\nif (_constants_js__WEBPACK_IMPORTED_MODULE_2__.DUMP_SESSION_KEYS) {\n keyLogger = log;\n}\nelse {\n keyLogger = Object.assign(() => { }, {\n enabled: false,\n trace: () => { },\n error: () => { }\n });\n}\nfunction logLocalStaticKeys(s) {\n keyLogger(`LOCAL_STATIC_PUBLIC_KEY ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(s.publicKey, 'hex')}`);\n keyLogger(`LOCAL_STATIC_PRIVATE_KEY ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(s.privateKey, 'hex')}`);\n}\nfunction logLocalEphemeralKeys(e) {\n if (e) {\n keyLogger(`LOCAL_PUBLIC_EPHEMERAL_KEY ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(e.publicKey, 'hex')}`);\n keyLogger(`LOCAL_PRIVATE_EPHEMERAL_KEY ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(e.privateKey, 'hex')}`);\n }\n else {\n keyLogger('Missing local ephemeral keys.');\n }\n}\nfunction logRemoteStaticKey(rs) {\n keyLogger(`REMOTE_STATIC_PUBLIC_KEY ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(rs, 'hex')}`);\n}\nfunction logRemoteEphemeralKey(re) {\n keyLogger(`REMOTE_EPHEMERAL_PUBLIC_KEY ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(re, 'hex')}`);\n}\nfunction logCipherState(session) {\n if (session.cs1 && session.cs2) {\n keyLogger(`CIPHER_STATE_1 ${session.cs1.n.getUint64()} ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(session.cs1.k, 'hex')}`);\n keyLogger(`CIPHER_STATE_2 ${session.cs2.n.getUint64()} ${(0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_1__.toString)(session.cs2.k, 'hex')}`);\n }\n else {\n keyLogger('Missing cipher state.');\n }\n}\n//# sourceMappingURL=logger.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/logger.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/metrics.js":
+/*!******************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/metrics.js ***!
+ \******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerMetrics\": () => (/* binding */ registerMetrics)\n/* harmony export */ });\nfunction registerMetrics(metrics) {\n return {\n xxHandshakeSuccesses: metrics.registerCounter('libp2p_noise_xxhandshake_successes_total', {\n help: 'Total count of noise xxHandshakes successes_'\n }),\n xxHandshakeErrors: metrics.registerCounter('libp2p_noise_xxhandshake_error_total', {\n help: 'Total count of noise xxHandshakes errors'\n }),\n encryptedPackets: metrics.registerCounter('libp2p_noise_encrypted_packets_total', {\n help: 'Total count of noise encrypted packets successfully'\n }),\n decryptedPackets: metrics.registerCounter('libp2p_noise_decrypted_packets_total', {\n help: 'Total count of noise decrypted packets'\n }),\n decryptErrors: metrics.registerCounter('libp2p_noise_decrypt_errors_total', {\n help: 'Total count of noise decrypt errors'\n })\n };\n}\n//# sourceMappingURL=metrics.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/metrics.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/noise.js":
+/*!****************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/noise.js ***!
+ \****************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Noise\": () => (/* binding */ Noise)\n/* harmony export */ });\n/* harmony import */ var it_pb_stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! it-pb-stream */ \"./node_modules/it-pb-stream/dist/src/index.js\");\n/* harmony import */ var it_pair_duplex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! it-pair/duplex */ \"./node_modules/it-pair/dist/src/duplex.js\");\n/* harmony import */ var it_pipe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! it-pipe */ \"./node_modules/it-pipe/dist/src/index.js\");\n/* harmony import */ var it_length_prefixed__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! it-length-prefixed */ \"./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/index.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/constants.js\");\n/* harmony import */ var _crypto_stablelib_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./crypto/stablelib.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/stablelib.js\");\n/* harmony import */ var _crypto_streaming_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./crypto/streaming.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/crypto/streaming.js\");\n/* harmony import */ var _encoder_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./encoder.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/encoder.js\");\n/* harmony import */ var _handshake_xx_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./handshake-xx.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/handshake-xx.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/utils.js\");\n/* harmony import */ var _metrics_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./metrics.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/metrics.js\");\n\n\n\n\n\n\n\n\n\n\n\nclass Noise {\n constructor(init = {}) {\n this.protocol = '/noise';\n const { staticNoiseKey, extensions, crypto, prologueBytes, metrics } = init;\n this.crypto = crypto ?? _crypto_stablelib_js__WEBPACK_IMPORTED_MODULE_5__.stablelib;\n this.extensions = extensions;\n this.metrics = metrics ? (0,_metrics_js__WEBPACK_IMPORTED_MODULE_10__.registerMetrics)(metrics) : undefined;\n if (staticNoiseKey) {\n // accepts x25519 private key of length 32\n this.staticKeys = this.crypto.generateX25519KeyPairFromSeed(staticNoiseKey);\n }\n else {\n this.staticKeys = this.crypto.generateX25519KeyPair();\n }\n this.prologue = prologueBytes ?? new Uint8Array(0);\n }\n /**\n * Encrypt outgoing data to the remote party (handshake as initiator)\n *\n * @param {PeerId} localPeer - PeerId of the receiving peer\n * @param {Duplex} connection - streaming iterable duplex that will be encrypted\n * @param {PeerId} remotePeer - PeerId of the remote peer. Used to validate the integrity of the remote peer.\n * @returns {Promise}\n */\n async secureOutbound(localPeer, connection, remotePeer) {\n const wrappedConnection = (0,it_pb_stream__WEBPACK_IMPORTED_MODULE_0__.pbStream)(connection, {\n lengthEncoder: _encoder_js__WEBPACK_IMPORTED_MODULE_7__.uint16BEEncode,\n lengthDecoder: _encoder_js__WEBPACK_IMPORTED_MODULE_7__.uint16BEDecode,\n maxDataLength: _constants_js__WEBPACK_IMPORTED_MODULE_4__.NOISE_MSG_MAX_LENGTH_BYTES\n });\n const handshake = await this.performHandshake({\n connection: wrappedConnection,\n isInitiator: true,\n localPeer,\n remotePeer\n });\n const conn = await this.createSecureConnection(wrappedConnection, handshake);\n return {\n conn,\n remoteExtensions: handshake.remoteExtensions,\n remotePeer: handshake.remotePeer\n };\n }\n /**\n * Decrypt incoming data (handshake as responder).\n *\n * @param {PeerId} localPeer - PeerId of the receiving peer.\n * @param {Duplex} connection - streaming iterable duplex that will be encryption.\n * @param {PeerId} remotePeer - optional PeerId of the initiating peer, if known. This may only exist during transport upgrades.\n * @returns {Promise}\n */\n async secureInbound(localPeer, connection, remotePeer) {\n const wrappedConnection = (0,it_pb_stream__WEBPACK_IMPORTED_MODULE_0__.pbStream)(connection, {\n lengthEncoder: _encoder_js__WEBPACK_IMPORTED_MODULE_7__.uint16BEEncode,\n lengthDecoder: _encoder_js__WEBPACK_IMPORTED_MODULE_7__.uint16BEDecode,\n maxDataLength: _constants_js__WEBPACK_IMPORTED_MODULE_4__.NOISE_MSG_MAX_LENGTH_BYTES\n });\n const handshake = await this.performHandshake({\n connection: wrappedConnection,\n isInitiator: false,\n localPeer,\n remotePeer\n });\n const conn = await this.createSecureConnection(wrappedConnection, handshake);\n return {\n conn,\n remotePeer: handshake.remotePeer,\n remoteExtensions: handshake.remoteExtensions\n };\n }\n /**\n * If Noise pipes supported, tries IK handshake first with XX as fallback if it fails.\n * If noise pipes disabled or remote peer static key is unknown, use XX.\n *\n * @param {HandshakeParams} params\n */\n async performHandshake(params) {\n const payload = await (0,_utils_js__WEBPACK_IMPORTED_MODULE_9__.getPayload)(params.localPeer, this.staticKeys.publicKey, this.extensions);\n // run XX handshake\n return await this.performXXHandshake(params, payload);\n }\n async performXXHandshake(params, payload) {\n const { isInitiator, remotePeer, connection } = params;\n const handshake = new _handshake_xx_js__WEBPACK_IMPORTED_MODULE_8__.XXHandshake(isInitiator, payload, this.prologue, this.crypto, this.staticKeys, connection, remotePeer);\n try {\n await handshake.propose();\n await handshake.exchange();\n await handshake.finish();\n this.metrics?.xxHandshakeSuccesses.increment();\n }\n catch (e) {\n this.metrics?.xxHandshakeErrors.increment();\n if (e instanceof Error) {\n e.message = `Error occurred during XX handshake: ${e.message}`;\n throw e;\n }\n }\n return handshake;\n }\n async createSecureConnection(connection, handshake) {\n // Create encryption box/unbox wrapper\n const [secure, user] = (0,it_pair_duplex__WEBPACK_IMPORTED_MODULE_1__.duplexPair)();\n const network = connection.unwrap();\n await (0,it_pipe__WEBPACK_IMPORTED_MODULE_2__.pipe)(secure, // write to wrapper\n (0,_crypto_streaming_js__WEBPACK_IMPORTED_MODULE_6__.encryptStream)(handshake, this.metrics), // encrypt data + prefix with message length\n network, // send to the remote peer\n (0,it_length_prefixed__WEBPACK_IMPORTED_MODULE_3__.decode)({ lengthDecoder: _encoder_js__WEBPACK_IMPORTED_MODULE_7__.uint16BEDecode }), // read message length prefix\n (0,_crypto_streaming_js__WEBPACK_IMPORTED_MODULE_6__.decryptStream)(handshake, this.metrics), // decrypt the incoming data\n secure // pipe to the wrapper\n );\n return user;\n }\n}\n//# sourceMappingURL=noise.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/noise.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/nonce.js":
+/*!****************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/nonce.js ***!
+ \****************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MAX_NONCE\": () => (/* binding */ MAX_NONCE),\n/* harmony export */ \"MIN_NONCE\": () => (/* binding */ MIN_NONCE),\n/* harmony export */ \"Nonce\": () => (/* binding */ Nonce)\n/* harmony export */ });\nconst MIN_NONCE = 0;\n// For performance reasons, the nonce is represented as a JS `number`\n// Although JS `number` can safely represent integers up to 2 ** 53 - 1, we choose to only use\n// 4 bytes to store the data for performance reason.\n// This is a slight deviation from the noise spec, which describes the max nonce as 2 ** 64 - 2\n// The effect is that this implementation will need a new handshake to be performed after fewer messages are exchanged than other implementations with full uint64 nonces.\n// this MAX_NONCE is still a large number of messages, so the practical effect of this is negligible.\nconst MAX_NONCE = 0xffffffff;\nconst ERR_MAX_NONCE = 'Cipherstate has reached maximum n, a new handshake must be performed';\n/**\n * The nonce is an uint that's increased over time.\n * Maintaining different representations help improve performance.\n */\nclass Nonce {\n constructor(n = MIN_NONCE) {\n this.n = n;\n this.bytes = new Uint8Array(12);\n this.view = new DataView(this.bytes.buffer, this.bytes.byteOffset, this.bytes.byteLength);\n this.view.setUint32(4, n, true);\n }\n increment() {\n this.n++;\n // Even though we're treating the nonce as 8 bytes, RFC7539 specifies 12 bytes for a nonce.\n this.view.setUint32(4, this.n, true);\n }\n getBytes() {\n return this.bytes;\n }\n getUint64() {\n return this.n;\n }\n assertValue() {\n if (this.n > MAX_NONCE) {\n throw new Error(ERR_MAX_NONCE);\n }\n }\n}\n//# sourceMappingURL=nonce.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/nonce.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.js":
+/*!************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.js ***!
+ \************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"NoiseExtensions\": () => (/* binding */ NoiseExtensions),\n/* harmony export */ \"NoiseHandshakePayload\": () => (/* binding */ NoiseHandshakePayload)\n/* harmony export */ });\n/* harmony import */ var protons_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! protons-runtime */ \"./node_modules/protons-runtime/dist/src/index.js\");\n/* eslint-disable import/export */\n/* eslint-disable complexity */\n/* eslint-disable @typescript-eslint/no-namespace */\n/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */\n/* eslint-disable @typescript-eslint/no-empty-interface */\n\nvar NoiseExtensions;\n(function (NoiseExtensions) {\n let _codec;\n NoiseExtensions.codec = () => {\n if (_codec == null) {\n _codec = (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.message)((obj, w, opts = {}) => {\n if (opts.lengthDelimited !== false) {\n w.fork();\n }\n if (obj.webtransportCerthashes != null) {\n for (const value of obj.webtransportCerthashes) {\n w.uint32(10);\n w.bytes(value);\n }\n }\n if (opts.lengthDelimited !== false) {\n w.ldelim();\n }\n }, (reader, length) => {\n const obj = {\n webtransportCerthashes: []\n };\n const end = length == null ? reader.len : reader.pos + length;\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n obj.webtransportCerthashes.push(reader.bytes());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return obj;\n });\n }\n return _codec;\n };\n NoiseExtensions.encode = (obj) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.encodeMessage)(obj, NoiseExtensions.codec());\n };\n NoiseExtensions.decode = (buf) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.decodeMessage)(buf, NoiseExtensions.codec());\n };\n})(NoiseExtensions || (NoiseExtensions = {}));\nvar NoiseHandshakePayload;\n(function (NoiseHandshakePayload) {\n let _codec;\n NoiseHandshakePayload.codec = () => {\n if (_codec == null) {\n _codec = (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.message)((obj, w, opts = {}) => {\n if (opts.lengthDelimited !== false) {\n w.fork();\n }\n if (opts.writeDefaults === true || (obj.identityKey != null && obj.identityKey.byteLength > 0)) {\n w.uint32(10);\n w.bytes(obj.identityKey ?? new Uint8Array(0));\n }\n if (opts.writeDefaults === true || (obj.identitySig != null && obj.identitySig.byteLength > 0)) {\n w.uint32(18);\n w.bytes(obj.identitySig ?? new Uint8Array(0));\n }\n if (obj.extensions != null) {\n w.uint32(34);\n NoiseExtensions.codec().encode(obj.extensions, w, {\n writeDefaults: false\n });\n }\n if (opts.lengthDelimited !== false) {\n w.ldelim();\n }\n }, (reader, length) => {\n const obj = {\n identityKey: new Uint8Array(0),\n identitySig: new Uint8Array(0)\n };\n const end = length == null ? reader.len : reader.pos + length;\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n obj.identityKey = reader.bytes();\n break;\n case 2:\n obj.identitySig = reader.bytes();\n break;\n case 4:\n obj.extensions = NoiseExtensions.codec().decode(reader, reader.uint32());\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return obj;\n });\n }\n return _codec;\n };\n NoiseHandshakePayload.encode = (obj) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.encodeMessage)(obj, NoiseHandshakePayload.codec());\n };\n NoiseHandshakePayload.decode = (buf) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.decodeMessage)(buf, NoiseHandshakePayload.codec());\n };\n})(NoiseHandshakePayload || (NoiseHandshakePayload = {}));\n//# sourceMappingURL=payload.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/dist/src/utils.js":
+/*!****************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/dist/src/utils.js ***!
+ \****************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createHandshakePayload\": () => (/* binding */ createHandshakePayload),\n/* harmony export */ \"decodePayload\": () => (/* binding */ decodePayload),\n/* harmony export */ \"getHandshakePayload\": () => (/* binding */ getHandshakePayload),\n/* harmony export */ \"getPayload\": () => (/* binding */ getPayload),\n/* harmony export */ \"getPeerIdFromPayload\": () => (/* binding */ getPeerIdFromPayload),\n/* harmony export */ \"isValidPublicKey\": () => (/* binding */ isValidPublicKey),\n/* harmony export */ \"signPayload\": () => (/* binding */ signPayload),\n/* harmony export */ \"verifySignedPayload\": () => (/* binding */ verifySignedPayload)\n/* harmony export */ });\n/* harmony import */ var _libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/crypto/keys */ \"./node_modules/@libp2p/crypto/dist/src/keys/index.js\");\n/* harmony import */ var _libp2p_peer_id__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/peer-id */ \"./node_modules/@libp2p/peer-id/dist/src/index.js\");\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var _proto_payload_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./proto/payload.js */ \"./node_modules/@chainsafe/libp2p-noise/dist/src/proto/payload.js\");\n\n\n\n\n\nasync function getPayload(localPeer, staticPublicKey, extensions) {\n const signedPayload = await signPayload(localPeer, getHandshakePayload(staticPublicKey));\n if (localPeer.publicKey == null) {\n throw new Error('PublicKey was missing from local PeerId');\n }\n return createHandshakePayload(localPeer.publicKey, signedPayload, extensions);\n}\nfunction createHandshakePayload(libp2pPublicKey, signedPayload, extensions) {\n return _proto_payload_js__WEBPACK_IMPORTED_MODULE_4__.NoiseHandshakePayload.encode({\n identityKey: libp2pPublicKey,\n identitySig: signedPayload,\n extensions: extensions ?? { webtransportCerthashes: [] }\n }).subarray();\n}\nasync function signPayload(peerId, payload) {\n if (peerId.privateKey == null) {\n throw new Error('PrivateKey was missing from PeerId');\n }\n const privateKey = await (0,_libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_0__.unmarshalPrivateKey)(peerId.privateKey);\n return await privateKey.sign(payload);\n}\nasync function getPeerIdFromPayload(payload) {\n return await (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_1__.peerIdFromKeys)(payload.identityKey);\n}\nfunction decodePayload(payload) {\n return _proto_payload_js__WEBPACK_IMPORTED_MODULE_4__.NoiseHandshakePayload.decode(payload);\n}\nfunction getHandshakePayload(publicKey) {\n const prefix = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__.fromString)('noise-libp2p-static-key:');\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_2__.concat)([prefix, publicKey], prefix.length + publicKey.length);\n}\n/**\n * Verifies signed payload, throws on any irregularities.\n *\n * @param {bytes} noiseStaticKey - owner's noise static key\n * @param {bytes} payload - decoded payload\n * @param {PeerId} remotePeer - owner's libp2p peer ID\n * @returns {Promise} - peer ID of payload owner\n */\nasync function verifySignedPayload(noiseStaticKey, payload, remotePeer) {\n // Unmarshaling from PublicKey protobuf\n const payloadPeerId = await (0,_libp2p_peer_id__WEBPACK_IMPORTED_MODULE_1__.peerIdFromKeys)(payload.identityKey);\n if (!payloadPeerId.equals(remotePeer)) {\n throw new Error(`Payload identity key ${payloadPeerId.toString()} does not match expected remote peer ${remotePeer.toString()}`);\n }\n const generatedPayload = getHandshakePayload(noiseStaticKey);\n if (payloadPeerId.publicKey == null) {\n throw new Error('PublicKey was missing from PeerId');\n }\n if (payload.identitySig == null) {\n throw new Error('Signature was missing from message');\n }\n const publicKey = (0,_libp2p_crypto_keys__WEBPACK_IMPORTED_MODULE_0__.unmarshalPublicKey)(payloadPeerId.publicKey);\n const valid = await publicKey.verify(generatedPayload, payload.identitySig);\n if (!valid) {\n throw new Error(\"Static key doesn't match to peer that signed payload!\");\n }\n return payloadPeerId;\n}\nfunction isValidPublicKey(pk) {\n if (!(pk instanceof Uint8Array)) {\n return false;\n }\n if (pk.length !== 32) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=utils.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/dist/src/utils.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/alloc.js":
+/*!************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/alloc.js ***!
+ \************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"alloc\": () => (/* binding */ alloc),\n/* harmony export */ \"allocUnsafe\": () => (/* binding */ allocUnsafe)\n/* harmony export */ });\nfunction alloc(len) {\n return new Uint8Array(len);\n}\nfunction allocUnsafe(len) {\n if (globalThis?.Buffer?.allocUnsafe != null) {\n return globalThis.Buffer.allocUnsafe(len);\n }\n return new Uint8Array(len);\n}\n//# sourceMappingURL=alloc.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/alloc.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/decode.js":
+/*!*************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/decode.js ***!
+ \*************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MAX_DATA_LENGTH\": () => (/* binding */ MAX_DATA_LENGTH),\n/* harmony export */ \"MAX_LENGTH_LENGTH\": () => (/* binding */ MAX_LENGTH_LENGTH),\n/* harmony export */ \"decode\": () => (/* binding */ decode)\n/* harmony export */ });\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n/* harmony import */ var uint8_varint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8-varint */ \"./node_modules/uint8-varint/dist/src/index.js\");\n/* harmony import */ var err_code__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! err-code */ \"./node_modules/err-code/index.js\");\n/* eslint max-depth: [\"error\", 6] */\n\n\n\n// Maximum length of the length section of the message\nconst MAX_LENGTH_LENGTH = 8; // Varint.encode(Number.MAX_SAFE_INTEGER).length\n// Maximum length of the data section of the message\nconst MAX_DATA_LENGTH = 1024 * 1024 * 4;\nvar ReadMode;\n(function (ReadMode) {\n ReadMode[ReadMode[\"LENGTH\"] = 0] = \"LENGTH\";\n ReadMode[ReadMode[\"DATA\"] = 1] = \"DATA\";\n})(ReadMode || (ReadMode = {}));\nconst defaultDecoder = (buf) => {\n const length = uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.decode(buf);\n defaultDecoder.bytes = uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.encodingLength(length);\n return length;\n};\ndefaultDecoder.bytes = 0;\nfunction decode(options) {\n const decoder = async function* (source) {\n const buffer = new uint8arraylist__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayList();\n let mode = ReadMode.LENGTH;\n let dataLength = -1;\n const lengthDecoder = options?.lengthDecoder ?? defaultDecoder;\n const maxLengthLength = options?.maxLengthLength ?? MAX_LENGTH_LENGTH;\n const maxDataLength = options?.maxDataLength ?? MAX_DATA_LENGTH;\n for await (const buf of source) {\n buffer.append(buf);\n while (buffer.byteLength > 0) {\n if (mode === ReadMode.LENGTH) {\n // read length, ignore errors for short reads\n try {\n dataLength = lengthDecoder(buffer);\n if (dataLength < 0) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('invalid message length'), 'ERR_INVALID_MSG_LENGTH');\n }\n if (dataLength > maxDataLength) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('message length too long'), 'ERR_MSG_DATA_TOO_LONG');\n }\n const dataLengthLength = lengthDecoder.bytes;\n buffer.consume(dataLengthLength);\n if (options?.onLength != null) {\n options.onLength(dataLength);\n }\n mode = ReadMode.DATA;\n }\n catch (err) {\n if (err instanceof RangeError) {\n if (buffer.byteLength > maxLengthLength) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('message length length too long'), 'ERR_MSG_LENGTH_TOO_LONG');\n }\n break;\n }\n throw err;\n }\n }\n if (mode === ReadMode.DATA) {\n if (buffer.byteLength < dataLength) {\n // not enough data, wait for more\n break;\n }\n const data = buffer.sublist(0, dataLength);\n buffer.consume(dataLength);\n if (options?.onData != null) {\n options.onData(data);\n }\n yield data;\n mode = ReadMode.LENGTH;\n }\n }\n }\n if (buffer.byteLength > 0) {\n throw err_code__WEBPACK_IMPORTED_MODULE_2__(new Error('unexpected end of input'), 'ERR_UNEXPECTED_EOF');\n }\n };\n return decoder;\n}\n/**\n * @param {*} reader\n * @param {import('./types').DecoderOptions} [options]\n * @returns\n */\ndecode.fromReader = (reader, options) => {\n let byteLength = 1; // Read single byte chunks until the length is known\n const varByteSource = (async function* () {\n while (true) {\n try {\n const { done, value } = await reader.next(byteLength);\n if (done === true) {\n return;\n }\n if (value != null) {\n yield value;\n }\n }\n catch (err) {\n if (err.code === 'ERR_UNDER_READ') {\n return { done: true, value: null };\n }\n throw err;\n }\n finally {\n // Reset the byteLength so we continue to check for varints\n byteLength = 1;\n }\n }\n }());\n /**\n * Once the length has been parsed, read chunk for that length\n */\n const onLength = (l) => { byteLength = l; };\n return decode({\n ...(options ?? {}),\n onLength\n })(varByteSource);\n};\n//# sourceMappingURL=decode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/decode.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/encode.js":
+/*!*************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/encode.js ***!
+ \*************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"encode\": () => (/* binding */ encode)\n/* harmony export */ });\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n/* harmony import */ var uint8_varint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8-varint */ \"./node_modules/uint8-varint/dist/src/index.js\");\n/* harmony import */ var _alloc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alloc.js */ \"./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/alloc.js\");\n\n\n\nconst defaultEncoder = (length) => {\n const lengthLength = uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.encodingLength(length);\n const lengthBuf = (0,_alloc_js__WEBPACK_IMPORTED_MODULE_2__.allocUnsafe)(lengthLength);\n uint8_varint__WEBPACK_IMPORTED_MODULE_1__.unsigned.encode(length, lengthBuf);\n defaultEncoder.bytes = lengthLength;\n return lengthBuf;\n};\ndefaultEncoder.bytes = 0;\nfunction encode(options) {\n options = options ?? {};\n const encodeLength = options.lengthEncoder ?? defaultEncoder;\n const encoder = async function* (source) {\n for await (const chunk of source) {\n // length + data\n const length = encodeLength(chunk.byteLength);\n // yield only Uint8Arrays\n if (length instanceof Uint8Array) {\n yield length;\n }\n else {\n yield* length;\n }\n // yield only Uint8Arrays\n if (chunk instanceof Uint8Array) {\n yield chunk;\n }\n else {\n yield* chunk;\n }\n }\n };\n return encoder;\n}\nencode.single = (chunk, options) => {\n options = options ?? {};\n const encodeLength = options.lengthEncoder ?? defaultEncoder;\n return new uint8arraylist__WEBPACK_IMPORTED_MODULE_0__.Uint8ArrayList(encodeLength(chunk.byteLength), chunk);\n};\n//# sourceMappingURL=encode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/encode.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/index.js":
+/*!************************************************************************************************!*\
+ !*** ./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/index.js ***!
+ \************************************************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decode\": () => (/* reexport safe */ _decode_js__WEBPACK_IMPORTED_MODULE_1__.decode),\n/* harmony export */ \"encode\": () => (/* reexport safe */ _encode_js__WEBPACK_IMPORTED_MODULE_0__.encode)\n/* harmony export */ });\n/* harmony import */ var _encode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./encode.js */ \"./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/encode.js\");\n/* harmony import */ var _decode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decode.js */ \"./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/decode.js\");\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@chainsafe/libp2p-noise/node_modules/it-length-prefixed/dist/src/index.js?");
+
+/***/ }),
+
/***/ "./node_modules/@chainsafe/netmask/dist/src/cidr.js":
/*!**********************************************************!*\
!*** ./node_modules/@chainsafe/netmask/dist/src/cidr.js ***!
@@ -2520,7 +2993,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createCipheriv\": () => (/* binding */ createCipheriv),\n/* harmony export */ \"createDecipheriv\": () => (/* binding */ createDecipheriv)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_aes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/aes.js */ \"./node_modules/node-forge/lib/aes.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n\n// @ts-expect-error types are missing\n\n\n\nfunction createCipheriv(mode, key, iv) {\n const cipher2 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.cipher.createCipher('AES-CTR', (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(key, 'ascii'));\n cipher2.start({ iv: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(iv, 'ascii') });\n return {\n update: (data) => {\n cipher2.update(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.util.createBuffer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(data, 'ascii')));\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__.fromString)(cipher2.output.getBytes(), 'ascii');\n }\n };\n}\nfunction createDecipheriv(mode, key, iv) {\n const cipher2 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.cipher.createDecipher('AES-CTR', (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(key, 'ascii'));\n cipher2.start({ iv: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(iv, 'ascii') });\n return {\n update: (data) => {\n cipher2.update(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.util.createBuffer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(data, 'ascii')));\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__.fromString)(cipher2.output.getBytes(), 'ascii');\n }\n };\n}\n//# sourceMappingURL=ciphers-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/aes/ciphers-browser.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createCipheriv\": () => (/* binding */ createCipheriv),\n/* harmony export */ \"createDecipheriv\": () => (/* binding */ createDecipheriv)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_aes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/aes.js */ \"./node_modules/node-forge/lib/aes.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n\n// @ts-expect-error types are missing\n\n\n\nfunction createCipheriv(mode, key, iv) {\n const cipher2 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.cipher.createCipher('AES-CTR', (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key, 'ascii'));\n cipher2.start({ iv: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(iv, 'ascii') });\n return {\n update: (data) => {\n cipher2.update(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.util.createBuffer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(data, 'ascii')));\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)(cipher2.output.getBytes(), 'ascii');\n }\n };\n}\nfunction createDecipheriv(mode, key, iv) {\n const cipher2 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.cipher.createDecipher('AES-CTR', (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key, 'ascii'));\n cipher2.start({ iv: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(iv, 'ascii') });\n return {\n update: (data) => {\n cipher2.update(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_1__.util.createBuffer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(data, 'ascii')));\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_2__.fromString)(cipher2.output.getBytes(), 'ascii');\n }\n };\n}\n//# sourceMappingURL=ciphers-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/aes/ciphers-browser.js?");
/***/ }),
@@ -2531,7 +3004,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var _ciphers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ciphers.js */ \"./node_modules/@libp2p/crypto/dist/src/aes/ciphers-browser.js\");\n/* harmony import */ var _cipher_mode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cipher-mode.js */ \"./node_modules/@libp2p/crypto/dist/src/aes/cipher-mode.js\");\n\n\nasync function create(key, iv) {\n const mode = (0,_cipher_mode_js__WEBPACK_IMPORTED_MODULE_1__.cipherMode)(key);\n const cipher = _ciphers_js__WEBPACK_IMPORTED_MODULE_0__.createCipheriv(mode, key, iv);\n const decipher = _ciphers_js__WEBPACK_IMPORTED_MODULE_0__.createDecipheriv(mode, key, iv);\n const res = {\n async encrypt(data) {\n return cipher.update(data);\n },\n async decrypt(data) {\n return decipher.update(data);\n }\n };\n return res;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/aes/index.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var _cipher_mode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cipher-mode.js */ \"./node_modules/@libp2p/crypto/dist/src/aes/cipher-mode.js\");\n/* harmony import */ var _ciphers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ciphers.js */ \"./node_modules/@libp2p/crypto/dist/src/aes/ciphers-browser.js\");\n\n\nasync function create(key, iv) {\n const mode = (0,_cipher_mode_js__WEBPACK_IMPORTED_MODULE_0__.cipherMode)(key);\n const cipher = _ciphers_js__WEBPACK_IMPORTED_MODULE_1__.createCipheriv(mode, key, iv);\n const decipher = _ciphers_js__WEBPACK_IMPORTED_MODULE_1__.createDecipheriv(mode, key, iv);\n const res = {\n async encrypt(data) {\n return cipher.update(data);\n },\n async decrypt(data) {\n return decipher.update(data);\n }\n };\n return res;\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/aes/index.js?");
/***/ }),
@@ -2542,7 +3015,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n\n\n\n// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples\nfunction create(opts) {\n const algorithm = opts?.algorithm ?? 'AES-GCM';\n let keyLength = opts?.keyLength ?? 16;\n const nonceLength = opts?.nonceLength ?? 12;\n const digest = opts?.digest ?? 'SHA-256';\n const saltLength = opts?.saltLength ?? 16;\n const iterations = opts?.iterations ?? 32767;\n const crypto = _webcrypto_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].get();\n keyLength *= 8; // Browser crypto uses bits instead of bytes\n /**\n * Uses the provided password to derive a pbkdf2 key. The key\n * will then be used to encrypt the data.\n */\n async function encrypt(data, password) {\n const salt = crypto.getRandomValues(new Uint8Array(saltLength));\n const nonce = crypto.getRandomValues(new Uint8Array(nonceLength));\n const aesGcm = { name: algorithm, iv: nonce };\n if (typeof password === 'string') {\n password = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__.fromString)(password);\n }\n // Derive a key using PBKDF2.\n const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } };\n const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey', 'deriveBits']);\n const cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['encrypt']);\n // Encrypt the string.\n const ciphertext = await crypto.subtle.encrypt(aesGcm, cryptoKey, data);\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([salt, aesGcm.iv, new Uint8Array(ciphertext)]);\n }\n /**\n * Uses the provided password to derive a pbkdf2 key. The key\n * will then be used to decrypt the data. The options used to create\n * this decryption cipher must be the same as those used to create\n * the encryption cipher.\n */\n async function decrypt(data, password) {\n const salt = data.subarray(0, saltLength);\n const nonce = data.subarray(saltLength, saltLength + nonceLength);\n const ciphertext = data.subarray(saltLength + nonceLength);\n const aesGcm = { name: algorithm, iv: nonce };\n if (typeof password === 'string') {\n password = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__.fromString)(password);\n }\n // Derive the key using PBKDF2.\n const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } };\n const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey', 'deriveBits']);\n const cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['decrypt']);\n // Decrypt the string.\n const plaintext = await crypto.subtle.decrypt(aesGcm, cryptoKey, ciphertext);\n return new Uint8Array(plaintext);\n }\n const cipher = {\n encrypt,\n decrypt\n };\n return cipher;\n}\n//# sourceMappingURL=aes-gcm.browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/ciphers/aes-gcm.browser.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"create\": () => (/* binding */ create),\n/* harmony export */ \"derivedEmptyPasswordKey\": () => (/* binding */ derivedEmptyPasswordKey)\n/* harmony export */ });\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n\n\n\n// WebKit on Linux does not support deriving a key from an empty PBKDF2 key.\n// So, as a workaround, we provide the generated key as a constant. We test that\n// this generated key is accurate in test/workaround.spec.ts\n// Generated via:\n// await crypto.subtle.exportKey('jwk',\n// await crypto.subtle.deriveKey(\n// { name: 'PBKDF2', salt: new Uint8Array(16), iterations: 32767, hash: { name: 'SHA-256' } },\n// await crypto.subtle.importKey('raw', new Uint8Array(0), { name: 'PBKDF2' }, false, ['deriveKey']),\n// { name: 'AES-GCM', length: 128 }, true, ['encrypt', 'decrypt'])\n// )\nconst derivedEmptyPasswordKey = { alg: 'A128GCM', ext: true, k: 'scm9jmO_4BJAgdwWGVulLg', key_ops: ['encrypt', 'decrypt'], kty: 'oct' };\n// Based off of code from https://github.com/luke-park/SecureCompatibleEncryptionExamples\nfunction create(opts) {\n const algorithm = opts?.algorithm ?? 'AES-GCM';\n let keyLength = opts?.keyLength ?? 16;\n const nonceLength = opts?.nonceLength ?? 12;\n const digest = opts?.digest ?? 'SHA-256';\n const saltLength = opts?.saltLength ?? 16;\n const iterations = opts?.iterations ?? 32767;\n const crypto = _webcrypto_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].get();\n keyLength *= 8; // Browser crypto uses bits instead of bytes\n /**\n * Uses the provided password to derive a pbkdf2 key. The key\n * will then be used to encrypt the data.\n */\n async function encrypt(data, password) {\n const salt = crypto.getRandomValues(new Uint8Array(saltLength));\n const nonce = crypto.getRandomValues(new Uint8Array(nonceLength));\n const aesGcm = { name: algorithm, iv: nonce };\n if (typeof password === 'string') {\n password = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__.fromString)(password);\n }\n let cryptoKey;\n if (password.length === 0) {\n cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['encrypt']);\n try {\n const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } };\n const runtimeDerivedEmptyPassword = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']);\n cryptoKey = await crypto.subtle.deriveKey(deriveParams, runtimeDerivedEmptyPassword, { name: algorithm, length: keyLength }, true, ['encrypt']);\n }\n catch {\n cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['encrypt']);\n }\n }\n else {\n // Derive a key using PBKDF2.\n const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } };\n const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']);\n cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['encrypt']);\n }\n // Encrypt the string.\n const ciphertext = await crypto.subtle.encrypt(aesGcm, cryptoKey, data);\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_0__.concat)([salt, aesGcm.iv, new Uint8Array(ciphertext)]);\n }\n /**\n * Uses the provided password to derive a pbkdf2 key. The key\n * will then be used to decrypt the data. The options used to create\n * this decryption cipher must be the same as those used to create\n * the encryption cipher.\n */\n async function decrypt(data, password) {\n const salt = data.subarray(0, saltLength);\n const nonce = data.subarray(saltLength, saltLength + nonceLength);\n const ciphertext = data.subarray(saltLength + nonceLength);\n const aesGcm = { name: algorithm, iv: nonce };\n if (typeof password === 'string') {\n password = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__.fromString)(password);\n }\n let cryptoKey;\n if (password.length === 0) {\n try {\n const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } };\n const runtimeDerivedEmptyPassword = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']);\n cryptoKey = await crypto.subtle.deriveKey(deriveParams, runtimeDerivedEmptyPassword, { name: algorithm, length: keyLength }, true, ['decrypt']);\n }\n catch {\n cryptoKey = await crypto.subtle.importKey('jwk', derivedEmptyPasswordKey, { name: 'AES-GCM' }, true, ['decrypt']);\n }\n }\n else {\n // Derive the key using PBKDF2.\n const deriveParams = { name: 'PBKDF2', salt, iterations, hash: { name: digest } };\n const rawKey = await crypto.subtle.importKey('raw', password, { name: 'PBKDF2' }, false, ['deriveKey']);\n cryptoKey = await crypto.subtle.deriveKey(deriveParams, rawKey, { name: algorithm, length: keyLength }, true, ['decrypt']);\n }\n // Decrypt the string.\n const plaintext = await crypto.subtle.decrypt(aesGcm, cryptoKey, ciphertext);\n return new Uint8Array(plaintext);\n }\n const cipher = {\n encrypt,\n decrypt\n };\n return cipher;\n}\n//# sourceMappingURL=aes-gcm.browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/ciphers/aes-gcm.browser.js?");
/***/ }),
@@ -2553,7 +3026,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n/* harmony import */ var _lengths_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lengths.js */ \"./node_modules/@libp2p/crypto/dist/src/hmac/lengths.js\");\n\n\nconst hashTypes = {\n SHA1: 'SHA-1',\n SHA256: 'SHA-256',\n SHA512: 'SHA-512'\n};\nconst sign = async (key, data) => {\n const buf = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.sign({ name: 'HMAC' }, key, data);\n return new Uint8Array(buf, 0, buf.byteLength);\n};\nasync function create(hashType, secret) {\n const hash = hashTypes[hashType];\n const key = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.importKey('raw', secret, {\n name: 'HMAC',\n hash: { name: hash }\n }, false, ['sign']);\n return {\n async digest(data) {\n return await sign(key, data);\n },\n length: _lengths_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"][hashType]\n };\n}\n//# sourceMappingURL=index-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/hmac/index-browser.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"create\": () => (/* binding */ create)\n/* harmony export */ });\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n/* harmony import */ var _lengths_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lengths.js */ \"./node_modules/@libp2p/crypto/dist/src/hmac/lengths.js\");\n\n\nconst hashTypes = {\n SHA1: 'SHA-1',\n SHA256: 'SHA-256',\n SHA512: 'SHA-512'\n};\nconst sign = async (key, data) => {\n const buf = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.sign({ name: 'HMAC' }, key, data);\n return new Uint8Array(buf, 0, buf.byteLength);\n};\nasync function create(hashType, secret) {\n const hash = hashTypes[hashType];\n const key = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.importKey('raw', secret, {\n name: 'HMAC',\n hash: { name: hash }\n }, false, ['sign']);\n return {\n async digest(data) {\n return sign(key, data);\n },\n length: _lengths_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"][hashType]\n };\n}\n//# sourceMappingURL=index-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/hmac/index-browser.js?");
/***/ }),
@@ -2575,7 +3048,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"aes\": () => (/* reexport module object */ _aes_index_js__WEBPACK_IMPORTED_MODULE_1__),\n/* harmony export */ \"hmac\": () => (/* reexport module object */ _hmac_index_js__WEBPACK_IMPORTED_MODULE_0__),\n/* harmony export */ \"keys\": () => (/* reexport module object */ _keys_index_js__WEBPACK_IMPORTED_MODULE_2__),\n/* harmony export */ \"pbkdf2\": () => (/* reexport safe */ _pbkdf2_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ \"randomBytes\": () => (/* reexport safe */ _random_bytes_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _hmac_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hmac/index.js */ \"./node_modules/@libp2p/crypto/dist/src/hmac/index-browser.js\");\n/* harmony import */ var _aes_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./aes/index.js */ \"./node_modules/@libp2p/crypto/dist/src/aes/index.js\");\n/* harmony import */ var _keys_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys/index.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/index.js\");\n/* harmony import */ var _random_bytes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./random-bytes.js */ \"./node_modules/@libp2p/crypto/dist/src/random-bytes.js\");\n/* harmony import */ var _pbkdf2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pbkdf2.js */ \"./node_modules/@libp2p/crypto/dist/src/pbkdf2.js\");\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/index.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"aes\": () => (/* reexport module object */ _aes_index_js__WEBPACK_IMPORTED_MODULE_0__),\n/* harmony export */ \"hmac\": () => (/* reexport module object */ _hmac_index_js__WEBPACK_IMPORTED_MODULE_1__),\n/* harmony export */ \"keys\": () => (/* reexport module object */ _keys_index_js__WEBPACK_IMPORTED_MODULE_2__),\n/* harmony export */ \"pbkdf2\": () => (/* reexport safe */ _pbkdf2_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ \"randomBytes\": () => (/* reexport safe */ _random_bytes_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _aes_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./aes/index.js */ \"./node_modules/@libp2p/crypto/dist/src/aes/index.js\");\n/* harmony import */ var _hmac_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hmac/index.js */ \"./node_modules/@libp2p/crypto/dist/src/hmac/index-browser.js\");\n/* harmony import */ var _keys_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys/index.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/index.js\");\n/* harmony import */ var _pbkdf2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pbkdf2.js */ \"./node_modules/@libp2p/crypto/dist/src/pbkdf2.js\");\n/* harmony import */ var _random_bytes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./random-bytes.js */ \"./node_modules/@libp2p/crypto/dist/src/random-bytes.js\");\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/index.js?");
/***/ }),
@@ -2586,7 +3059,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateEphmeralKeyPair\": () => (/* binding */ generateEphmeralKeyPair)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util.js */ \"./node_modules/@libp2p/crypto/dist/src/util.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n\n\n\n\n\n\nconst bits = {\n 'P-256': 256,\n 'P-384': 384,\n 'P-521': 521\n};\nconst curveTypes = Object.keys(bits);\nconst names = curveTypes.join(' / ');\nasync function generateEphmeralKeyPair(curve) {\n if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE');\n }\n const pair = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get().subtle.generateKey({\n name: 'ECDH',\n namedCurve: curve\n }, true, ['deriveBits']);\n // forcePrivate is used for testing only\n const genSharedKey = async (theirPub, forcePrivate) => {\n let privateKey;\n if (forcePrivate != null) {\n privateKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get().subtle.importKey('jwk', unmarshalPrivateKey(curve, forcePrivate), {\n name: 'ECDH',\n namedCurve: curve\n }, false, ['deriveBits']);\n }\n else {\n privateKey = pair.privateKey;\n }\n const key = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get().subtle.importKey('jwk', unmarshalPublicKey(curve, theirPub), {\n name: 'ECDH',\n namedCurve: curve\n }, false, []);\n const buffer = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get().subtle.deriveBits({\n name: 'ECDH',\n // @ts-expect-error namedCurve is missing from the types\n namedCurve: curve,\n public: key\n }, privateKey, bits[curve]);\n return new Uint8Array(buffer, 0, buffer.byteLength);\n };\n const publicKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get().subtle.exportKey('jwk', pair.publicKey);\n const ecdhKey = {\n key: marshalPublicKey(publicKey),\n genSharedKey\n };\n return ecdhKey;\n}\nconst curveLengths = {\n 'P-256': 32,\n 'P-384': 48,\n 'P-521': 66\n};\n// Marshal converts a jwk encoded ECDH public key into the\n// form specified in section 4.3.6 of ANSI X9.62. (This is the format\n// go-ipfs uses)\nfunction marshalPublicKey(jwk) {\n if (jwk.crv == null || jwk.x == null || jwk.y == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS');\n }\n if (jwk.crv !== 'P-256' && jwk.crv !== 'P-384' && jwk.crv !== 'P-521') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Unknown curve: ${jwk.crv}. Must be ${names}`, 'ERR_INVALID_CURVE');\n }\n const byteLen = curveLengths[jwk.crv];\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_4__.concat)([\n Uint8Array.from([4]),\n (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.base64urlToBuffer)(jwk.x, byteLen),\n (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.base64urlToBuffer)(jwk.y, byteLen)\n ], 1 + byteLen * 2);\n}\n// Unmarshal converts a point, serialized by Marshal, into an jwk encoded key\nfunction unmarshalPublicKey(curve, key) {\n if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE');\n }\n const byteLen = curveLengths[curve];\n if (!(0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_5__.equals)(key.subarray(0, 1), Uint8Array.from([4]))) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError('Cannot unmarshal public key - invalid key format', 'ERR_INVALID_KEY_FORMAT');\n }\n return {\n kty: 'EC',\n crv: curve,\n x: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key.subarray(1, byteLen + 1), 'base64url'),\n y: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key.subarray(1 + byteLen), 'base64url'),\n ext: true\n };\n}\nconst unmarshalPrivateKey = (curve, key) => ({\n ...unmarshalPublicKey(curve, key.public),\n d: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key.private, 'base64url')\n});\n//# sourceMappingURL=ecdh-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/ecdh-browser.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateEphmeralKeyPair\": () => (/* binding */ generateEphmeralKeyPair)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util.js */ \"./node_modules/@libp2p/crypto/dist/src/util.js\");\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n\n\n\n\n\n\nconst bits = {\n 'P-256': 256,\n 'P-384': 384,\n 'P-521': 521\n};\nconst curveTypes = Object.keys(bits);\nconst names = curveTypes.join(' / ');\nasync function generateEphmeralKeyPair(curve) {\n if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE');\n }\n const pair = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get().subtle.generateKey({\n name: 'ECDH',\n namedCurve: curve\n }, true, ['deriveBits']);\n // forcePrivate is used for testing only\n const genSharedKey = async (theirPub, forcePrivate) => {\n let privateKey;\n if (forcePrivate != null) {\n privateKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get().subtle.importKey('jwk', unmarshalPrivateKey(curve, forcePrivate), {\n name: 'ECDH',\n namedCurve: curve\n }, false, ['deriveBits']);\n }\n else {\n privateKey = pair.privateKey;\n }\n const key = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get().subtle.importKey('jwk', unmarshalPublicKey(curve, theirPub), {\n name: 'ECDH',\n namedCurve: curve\n }, false, []);\n const buffer = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get().subtle.deriveBits({\n name: 'ECDH',\n // @ts-expect-error namedCurve is missing from the types\n namedCurve: curve,\n public: key\n }, privateKey, bits[curve]);\n return new Uint8Array(buffer, 0, buffer.byteLength);\n };\n const publicKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get().subtle.exportKey('jwk', pair.publicKey);\n const ecdhKey = {\n key: marshalPublicKey(publicKey),\n genSharedKey\n };\n return ecdhKey;\n}\nconst curveLengths = {\n 'P-256': 32,\n 'P-384': 48,\n 'P-521': 66\n};\n// Marshal converts a jwk encoded ECDH public key into the\n// form specified in section 4.3.6 of ANSI X9.62. (This is the format\n// go-ipfs uses)\nfunction marshalPublicKey(jwk) {\n if (jwk.crv == null || jwk.x == null || jwk.y == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS');\n }\n if (jwk.crv !== 'P-256' && jwk.crv !== 'P-384' && jwk.crv !== 'P-521') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Unknown curve: ${jwk.crv}. Must be ${names}`, 'ERR_INVALID_CURVE');\n }\n const byteLen = curveLengths[jwk.crv];\n return (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_1__.concat)([\n Uint8Array.from([4]),\n (0,_util_js__WEBPACK_IMPORTED_MODULE_4__.base64urlToBuffer)(jwk.x, byteLen),\n (0,_util_js__WEBPACK_IMPORTED_MODULE_4__.base64urlToBuffer)(jwk.y, byteLen)\n ], 1 + byteLen * 2);\n}\n// Unmarshal converts a point, serialized by Marshal, into an jwk encoded key\nfunction unmarshalPublicKey(curve, key) {\n if (curve !== 'P-256' && curve !== 'P-384' && curve !== 'P-521') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Unknown curve: ${curve}. Must be ${names}`, 'ERR_INVALID_CURVE');\n }\n const byteLen = curveLengths[curve];\n if (!(0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__.equals)(key.subarray(0, 1), Uint8Array.from([4]))) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError('Cannot unmarshal public key - invalid key format', 'ERR_INVALID_KEY_FORMAT');\n }\n return {\n kty: 'EC',\n crv: curve,\n x: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key.subarray(1, byteLen + 1), 'base64url'),\n y: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key.subarray(1 + byteLen), 'base64url'),\n ext: true\n };\n}\nconst unmarshalPrivateKey = (curve, key) => ({\n ...unmarshalPublicKey(curve, key.public),\n d: (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(key.private, 'base64url')\n});\n//# sourceMappingURL=ecdh-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/ecdh-browser.js?");
/***/ }),
@@ -2597,7 +3070,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateKey\": () => (/* binding */ generateKey),\n/* harmony export */ \"generateKeyFromSeed\": () => (/* binding */ generateKeyFromSeed),\n/* harmony export */ \"hashAndSign\": () => (/* binding */ hashAndSign),\n/* harmony export */ \"hashAndVerify\": () => (/* binding */ hashAndVerify),\n/* harmony export */ \"privateKeyLength\": () => (/* binding */ PRIVATE_KEY_BYTE_LENGTH),\n/* harmony export */ \"publicKeyLength\": () => (/* binding */ PUBLIC_KEY_BYTE_LENGTH)\n/* harmony export */ });\n/* harmony import */ var _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @noble/ed25519 */ \"./node_modules/@noble/ed25519/lib/esm/index.js\");\n\nconst PUBLIC_KEY_BYTE_LENGTH = 32;\nconst PRIVATE_KEY_BYTE_LENGTH = 64; // private key is actually 32 bytes but for historical reasons we concat private and public keys\nconst KEYS_BYTE_LENGTH = 32;\n\n\nasync function generateKey() {\n // the actual private key (32 bytes)\n const privateKeyRaw = _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.utils.randomPrivateKey();\n const publicKey = await _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.getPublicKey(privateKeyRaw);\n // concatenated the public key to the private key\n const privateKey = concatKeys(privateKeyRaw, publicKey);\n return {\n privateKey,\n publicKey\n };\n}\n/**\n * Generate keypair from a 32 byte uint8array\n */\nasync function generateKeyFromSeed(seed) {\n if (seed.length !== KEYS_BYTE_LENGTH) {\n throw new TypeError('\"seed\" must be 32 bytes in length.');\n }\n else if (!(seed instanceof Uint8Array)) {\n throw new TypeError('\"seed\" must be a node.js Buffer, or Uint8Array.');\n }\n // based on node forges algorithm, the seed is used directly as private key\n const privateKeyRaw = seed;\n const publicKey = await _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.getPublicKey(privateKeyRaw);\n const privateKey = concatKeys(privateKeyRaw, publicKey);\n return {\n privateKey,\n publicKey\n };\n}\nasync function hashAndSign(privateKey, msg) {\n const privateKeyRaw = privateKey.subarray(0, KEYS_BYTE_LENGTH);\n return await _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.sign(msg, privateKeyRaw);\n}\nasync function hashAndVerify(publicKey, sig, msg) {\n return await _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.verify(sig, msg, publicKey);\n}\nfunction concatKeys(privateKeyRaw, publicKey) {\n const privateKey = new Uint8Array(PRIVATE_KEY_BYTE_LENGTH);\n for (let i = 0; i < KEYS_BYTE_LENGTH; i++) {\n privateKey[i] = privateKeyRaw[i];\n privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i];\n }\n return privateKey;\n}\n//# sourceMappingURL=ed25519-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/ed25519-browser.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateKey\": () => (/* binding */ generateKey),\n/* harmony export */ \"generateKeyFromSeed\": () => (/* binding */ generateKeyFromSeed),\n/* harmony export */ \"hashAndSign\": () => (/* binding */ hashAndSign),\n/* harmony export */ \"hashAndVerify\": () => (/* binding */ hashAndVerify),\n/* harmony export */ \"privateKeyLength\": () => (/* binding */ PRIVATE_KEY_BYTE_LENGTH),\n/* harmony export */ \"publicKeyLength\": () => (/* binding */ PUBLIC_KEY_BYTE_LENGTH)\n/* harmony export */ });\n/* harmony import */ var _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @noble/ed25519 */ \"./node_modules/@noble/ed25519/lib/esm/index.js\");\n\nconst PUBLIC_KEY_BYTE_LENGTH = 32;\nconst PRIVATE_KEY_BYTE_LENGTH = 64; // private key is actually 32 bytes but for historical reasons we concat private and public keys\nconst KEYS_BYTE_LENGTH = 32;\n\n\nasync function generateKey() {\n // the actual private key (32 bytes)\n const privateKeyRaw = _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.utils.randomPrivateKey();\n const publicKey = await _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.getPublicKey(privateKeyRaw);\n // concatenated the public key to the private key\n const privateKey = concatKeys(privateKeyRaw, publicKey);\n return {\n privateKey,\n publicKey\n };\n}\n/**\n * Generate keypair from a 32 byte uint8array\n */\nasync function generateKeyFromSeed(seed) {\n if (seed.length !== KEYS_BYTE_LENGTH) {\n throw new TypeError('\"seed\" must be 32 bytes in length.');\n }\n else if (!(seed instanceof Uint8Array)) {\n throw new TypeError('\"seed\" must be a node.js Buffer, or Uint8Array.');\n }\n // based on node forges algorithm, the seed is used directly as private key\n const privateKeyRaw = seed;\n const publicKey = await _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.getPublicKey(privateKeyRaw);\n const privateKey = concatKeys(privateKeyRaw, publicKey);\n return {\n privateKey,\n publicKey\n };\n}\nasync function hashAndSign(privateKey, msg) {\n const privateKeyRaw = privateKey.subarray(0, KEYS_BYTE_LENGTH);\n return _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.sign(msg, privateKeyRaw);\n}\nasync function hashAndVerify(publicKey, sig, msg) {\n return _noble_ed25519__WEBPACK_IMPORTED_MODULE_0__.verify(sig, msg, publicKey);\n}\nfunction concatKeys(privateKeyRaw, publicKey) {\n const privateKey = new Uint8Array(PRIVATE_KEY_BYTE_LENGTH);\n for (let i = 0; i < KEYS_BYTE_LENGTH; i++) {\n privateKey[i] = privateKeyRaw[i];\n privateKey[KEYS_BYTE_LENGTH + i] = publicKey[i];\n }\n return privateKey;\n}\n//# sourceMappingURL=ed25519-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/ed25519-browser.js?");
/***/ }),
@@ -2608,7 +3081,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Ed25519PrivateKey\": () => (/* binding */ Ed25519PrivateKey),\n/* harmony export */ \"Ed25519PublicKey\": () => (/* binding */ Ed25519PublicKey),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"generateKeyPairFromSeed\": () => (/* binding */ generateKeyPairFromSeed),\n/* harmony export */ \"unmarshalEd25519PrivateKey\": () => (/* binding */ unmarshalEd25519PrivateKey),\n/* harmony export */ \"unmarshalEd25519PublicKey\": () => (/* binding */ unmarshalEd25519PublicKey)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/sha2-browser.js\");\n/* harmony import */ var multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! multiformats/bases/base58 */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base58.js\");\n/* harmony import */ var multiformats_hashes_identity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! multiformats/hashes/identity */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/identity.js\");\n/* harmony import */ var _ed25519_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ed25519.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/ed25519-browser.js\");\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n/* harmony import */ var _exporter_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./exporter.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/exporter.js\");\n\n\n\n\n\n\n\n\nclass Ed25519PublicKey {\n constructor(key) {\n this._key = ensureKey(key, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n }\n async verify(data, sig) {\n return await _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.hashAndVerify(this._key, sig, data);\n }\n marshal() {\n return this._key;\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_6__.PublicKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_6__.KeyType.Ed25519,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_1__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__.sha256.digest(this.bytes);\n return bytes;\n }\n}\nclass Ed25519PrivateKey {\n // key - 64 byte Uint8Array containing private key\n // publicKey - 32 byte Uint8Array containing public key\n constructor(key, publicKey) {\n this._key = ensureKey(key, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n this._publicKey = ensureKey(publicKey, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n }\n async sign(message) {\n return await _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.hashAndSign(this._key, message);\n }\n get public() {\n return new Ed25519PublicKey(this._publicKey);\n }\n marshal() {\n return this._key;\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_6__.PrivateKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_6__.KeyType.Ed25519,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_1__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__.sha256.digest(this.bytes);\n return bytes;\n }\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the identity multihash containing its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n *\n * @returns {Promise}\n */\n async id() {\n const encoding = multiformats_hashes_identity__WEBPACK_IMPORTED_MODULE_4__.identity.digest(this.public.bytes);\n return multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_3__.base58btc.encode(encoding.bytes).substring(1);\n }\n /**\n * Exports the key into a password protected `format`\n */\n async export(password, format = 'libp2p-key') {\n if (format === 'libp2p-key') {\n return await (0,_exporter_js__WEBPACK_IMPORTED_MODULE_7__.exporter)(this.bytes, password);\n }\n else {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT');\n }\n }\n}\nfunction unmarshalEd25519PrivateKey(bytes) {\n // Try the old, redundant public key version\n if (bytes.length > _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength) {\n bytes = ensureKey(bytes, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength + _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n const privateKeyBytes = bytes.subarray(0, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n const publicKeyBytes = bytes.subarray(_ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength, bytes.length);\n return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes);\n }\n bytes = ensureKey(bytes, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n const privateKeyBytes = bytes.subarray(0, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n const publicKeyBytes = bytes.subarray(_ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes);\n}\nfunction unmarshalEd25519PublicKey(bytes) {\n bytes = ensureKey(bytes, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n return new Ed25519PublicKey(bytes);\n}\nasync function generateKeyPair() {\n const { privateKey, publicKey } = await _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.generateKey();\n return new Ed25519PrivateKey(privateKey, publicKey);\n}\nasync function generateKeyPairFromSeed(seed) {\n const { privateKey, publicKey } = await _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.generateKeyFromSeed(seed);\n return new Ed25519PrivateKey(privateKey, publicKey);\n}\nfunction ensureKey(key, length) {\n key = Uint8Array.from(key ?? []);\n if (key.length !== length) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Key must be a Uint8Array of length ${length}, got ${key.length}`, 'ERR_INVALID_KEY_TYPE');\n }\n return key;\n}\n//# sourceMappingURL=ed25519-class.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Ed25519PrivateKey\": () => (/* binding */ Ed25519PrivateKey),\n/* harmony export */ \"Ed25519PublicKey\": () => (/* binding */ Ed25519PublicKey),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"generateKeyPairFromSeed\": () => (/* binding */ generateKeyPairFromSeed),\n/* harmony export */ \"unmarshalEd25519PrivateKey\": () => (/* binding */ unmarshalEd25519PrivateKey),\n/* harmony export */ \"unmarshalEd25519PublicKey\": () => (/* binding */ unmarshalEd25519PublicKey)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! multiformats/bases/base58 */ \"./node_modules/multiformats/src/bases/base58.js\");\n/* harmony import */ var multiformats_hashes_identity__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! multiformats/hashes/identity */ \"./node_modules/multiformats/src/hashes/identity.js\");\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/multiformats/src/hashes/sha2-browser.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var _ed25519_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ed25519.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/ed25519-browser.js\");\n/* harmony import */ var _exporter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./exporter.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/exporter.js\");\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n\n\n\n\n\n\n\n\nclass Ed25519PublicKey {\n _key;\n constructor(key) {\n this._key = ensureKey(key, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n }\n async verify(data, sig) {\n return _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.hashAndVerify(this._key, sig, data);\n }\n marshal() {\n return this._key;\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_7__.PublicKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_7__.KeyType.Ed25519,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_4__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_3__.sha256.digest(this.bytes);\n return bytes;\n }\n}\nclass Ed25519PrivateKey {\n _key;\n _publicKey;\n // key - 64 byte Uint8Array containing private key\n // publicKey - 32 byte Uint8Array containing public key\n constructor(key, publicKey) {\n this._key = ensureKey(key, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n this._publicKey = ensureKey(publicKey, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n }\n async sign(message) {\n return _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.hashAndSign(this._key, message);\n }\n get public() {\n return new Ed25519PublicKey(this._publicKey);\n }\n marshal() {\n return this._key;\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_7__.PrivateKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_7__.KeyType.Ed25519,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_4__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_3__.sha256.digest(this.bytes);\n return bytes;\n }\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the identity multihash containing its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n *\n * @returns {Promise}\n */\n async id() {\n const encoding = multiformats_hashes_identity__WEBPACK_IMPORTED_MODULE_2__.identity.digest(this.public.bytes);\n return multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_1__.base58btc.encode(encoding.bytes).substring(1);\n }\n /**\n * Exports the key into a password protected `format`\n */\n async export(password, format = 'libp2p-key') {\n if (format === 'libp2p-key') {\n return (0,_exporter_js__WEBPACK_IMPORTED_MODULE_6__.exporter)(this.bytes, password);\n }\n else {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT');\n }\n }\n}\nfunction unmarshalEd25519PrivateKey(bytes) {\n // Try the old, redundant public key version\n if (bytes.length > _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength) {\n bytes = ensureKey(bytes, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength + _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n const privateKeyBytes = bytes.subarray(0, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n const publicKeyBytes = bytes.subarray(_ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength, bytes.length);\n return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes);\n }\n bytes = ensureKey(bytes, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n const privateKeyBytes = bytes.subarray(0, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.privateKeyLength);\n const publicKeyBytes = bytes.subarray(_ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n return new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes);\n}\nfunction unmarshalEd25519PublicKey(bytes) {\n bytes = ensureKey(bytes, _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.publicKeyLength);\n return new Ed25519PublicKey(bytes);\n}\nasync function generateKeyPair() {\n const { privateKey, publicKey } = await _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.generateKey();\n return new Ed25519PrivateKey(privateKey, publicKey);\n}\nasync function generateKeyPairFromSeed(seed) {\n const { privateKey, publicKey } = await _ed25519_js__WEBPACK_IMPORTED_MODULE_5__.generateKeyFromSeed(seed);\n return new Ed25519PrivateKey(privateKey, publicKey);\n}\nfunction ensureKey(key, length) {\n key = Uint8Array.from(key ?? []);\n if (key.length !== length) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Key must be a Uint8Array of length ${length}, got ${key.length}`, 'ERR_INVALID_KEY_TYPE');\n }\n return key;\n}\n//# sourceMappingURL=ed25519-class.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.js?");
/***/ }),
@@ -2630,7 +3103,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"exporter\": () => (/* binding */ exporter)\n/* harmony export */ });\n/* harmony import */ var multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/bases/base64 */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base64.js\");\n/* harmony import */ var _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ciphers/aes-gcm.js */ \"./node_modules/@libp2p/crypto/dist/src/ciphers/aes-gcm.browser.js\");\n\n\n/**\n * Exports the given PrivateKey as a base64 encoded string.\n * The PrivateKey is encrypted via a password derived PBKDF2 key\n * leveraging the aes-gcm cipher algorithm.\n */\nasync function exporter(privateKey, password) {\n const cipher = _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__.create();\n const encryptedKey = await cipher.encrypt(privateKey, password);\n return multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__.base64.encode(encryptedKey);\n}\n//# sourceMappingURL=exporter.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/exporter.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"exporter\": () => (/* binding */ exporter)\n/* harmony export */ });\n/* harmony import */ var multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/bases/base64 */ \"./node_modules/multiformats/src/bases/base64.js\");\n/* harmony import */ var _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ciphers/aes-gcm.js */ \"./node_modules/@libp2p/crypto/dist/src/ciphers/aes-gcm.browser.js\");\n\n\n/**\n * Exports the given PrivateKey as a base64 encoded string.\n * The PrivateKey is encrypted via a password derived PBKDF2 key\n * leveraging the aes-gcm cipher algorithm.\n */\nasync function exporter(privateKey, password) {\n const cipher = _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__.create();\n const encryptedKey = await cipher.encrypt(privateKey, password);\n return multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__.base64.encode(encryptedKey);\n}\n//# sourceMappingURL=exporter.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/exporter.js?");
/***/ }),
@@ -2641,7 +3114,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"importer\": () => (/* binding */ importer)\n/* harmony export */ });\n/* harmony import */ var multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/bases/base64 */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base64.js\");\n/* harmony import */ var _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ciphers/aes-gcm.js */ \"./node_modules/@libp2p/crypto/dist/src/ciphers/aes-gcm.browser.js\");\n\n\n/**\n * Attempts to decrypt a base64 encoded PrivateKey string\n * with the given password. The privateKey must have been exported\n * using the same password and underlying cipher (aes-gcm)\n */\nasync function importer(privateKey, password) {\n const encryptedKey = multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__.base64.decode(privateKey);\n const cipher = _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__.create();\n return await cipher.decrypt(encryptedKey, password);\n}\n//# sourceMappingURL=importer.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/importer.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"importer\": () => (/* binding */ importer)\n/* harmony export */ });\n/* harmony import */ var multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/bases/base64 */ \"./node_modules/multiformats/src/bases/base64.js\");\n/* harmony import */ var _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ciphers/aes-gcm.js */ \"./node_modules/@libp2p/crypto/dist/src/ciphers/aes-gcm.browser.js\");\n\n\n/**\n * Attempts to decrypt a base64 encoded PrivateKey string\n * with the given password. The privateKey must have been exported\n * using the same password and underlying cipher (aes-gcm)\n */\nasync function importer(privateKey, password) {\n const encryptedKey = multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_0__.base64.decode(privateKey);\n const cipher = _ciphers_aes_gcm_js__WEBPACK_IMPORTED_MODULE_1__.create();\n return cipher.decrypt(encryptedKey, password);\n}\n//# sourceMappingURL=importer.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/importer.js?");
/***/ }),
@@ -2652,7 +3125,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateEphemeralKeyPair\": () => (/* reexport safe */ _ephemeral_keys_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"generateKeyPairFromSeed\": () => (/* binding */ generateKeyPairFromSeed),\n/* harmony export */ \"importKey\": () => (/* binding */ importKey),\n/* harmony export */ \"keyStretcher\": () => (/* reexport safe */ _key_stretcher_js__WEBPACK_IMPORTED_MODULE_6__.keyStretcher),\n/* harmony export */ \"keysPBM\": () => (/* reexport module object */ _keys_js__WEBPACK_IMPORTED_MODULE_0__),\n/* harmony export */ \"marshalPrivateKey\": () => (/* binding */ marshalPrivateKey),\n/* harmony export */ \"marshalPublicKey\": () => (/* binding */ marshalPublicKey),\n/* harmony export */ \"supportedKeys\": () => (/* binding */ supportedKeys),\n/* harmony export */ \"unmarshalPrivateKey\": () => (/* binding */ unmarshalPrivateKey),\n/* harmony export */ \"unmarshalPublicKey\": () => (/* binding */ unmarshalPublicKey)\n/* harmony export */ });\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n/* harmony import */ var node_forge_lib_asn1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/asn1.js */ \"./node_modules/node-forge/lib/asn1.js\");\n/* harmony import */ var node_forge_lib_pbe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node-forge/lib/pbe.js */ \"./node_modules/node-forge/lib/pbe.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var _key_stretcher_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./key-stretcher.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.js\");\n/* harmony import */ var _ephemeral_keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ephemeral-keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.js\");\n/* harmony import */ var _importer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./importer.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/importer.js\");\n/* harmony import */ var _rsa_class_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./rsa-class.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/rsa-class.js\");\n/* harmony import */ var _ed25519_class_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ed25519-class.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.js\");\n/* harmony import */ var _secp256k1_class_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./secp256k1-class.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.js\");\n\n\n\n// @ts-expect-error types are missing\n\n\n\n\n\n\n\n\n\n\n\n\nconst supportedKeys = {\n rsa: _rsa_class_js__WEBPACK_IMPORTED_MODULE_9__,\n ed25519: _ed25519_class_js__WEBPACK_IMPORTED_MODULE_10__,\n secp256k1: _secp256k1_class_js__WEBPACK_IMPORTED_MODULE_11__\n};\nfunction unsupportedKey(type) {\n const supported = Object.keys(supportedKeys).join(' / ');\n return new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_4__.CodeError(`invalid or unsupported key type ${type}. Must be ${supported}`, 'ERR_UNSUPPORTED_KEY_TYPE');\n}\nfunction typeToKey(type) {\n type = type.toLowerCase();\n if (type === 'rsa' || type === 'ed25519' || type === 'secp256k1') {\n return supportedKeys[type];\n }\n throw unsupportedKey(type);\n}\n// Generates a keypair of the given type and bitsize\nasync function generateKeyPair(type, bits) {\n return await typeToKey(type).generateKeyPair(bits ?? 2048);\n}\n// Generates a keypair of the given type and bitsize\n// seed is a 32 byte uint8array\nasync function generateKeyPairFromSeed(type, seed, bits) {\n if (type.toLowerCase() !== 'ed25519') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_4__.CodeError('Seed key derivation is unimplemented for RSA or secp256k1', 'ERR_UNSUPPORTED_KEY_DERIVATION_TYPE');\n }\n return await _ed25519_class_js__WEBPACK_IMPORTED_MODULE_10__.generateKeyPairFromSeed(seed);\n}\n// Converts a protobuf serialized public key into its\n// representative object\nfunction unmarshalPublicKey(buf) {\n const decoded = _keys_js__WEBPACK_IMPORTED_MODULE_0__.PublicKey.decode(buf);\n const data = decoded.Data ?? new Uint8Array();\n switch (decoded.Type) {\n case _keys_js__WEBPACK_IMPORTED_MODULE_0__.KeyType.RSA:\n return supportedKeys.rsa.unmarshalRsaPublicKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_0__.KeyType.Ed25519:\n return supportedKeys.ed25519.unmarshalEd25519PublicKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_0__.KeyType.Secp256k1:\n return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data);\n default:\n throw unsupportedKey(decoded.Type ?? 'RSA');\n }\n}\n// Converts a public key object into a protobuf serialized public key\nfunction marshalPublicKey(key, type) {\n type = (type ?? 'rsa').toLowerCase();\n typeToKey(type); // check type\n return key.bytes;\n}\n// Converts a protobuf serialized private key into its\n// representative object\nasync function unmarshalPrivateKey(buf) {\n const decoded = _keys_js__WEBPACK_IMPORTED_MODULE_0__.PrivateKey.decode(buf);\n const data = decoded.Data ?? new Uint8Array();\n switch (decoded.Type) {\n case _keys_js__WEBPACK_IMPORTED_MODULE_0__.KeyType.RSA:\n return await supportedKeys.rsa.unmarshalRsaPrivateKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_0__.KeyType.Ed25519:\n return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_0__.KeyType.Secp256k1:\n return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data);\n default:\n throw unsupportedKey(decoded.Type ?? 'RSA');\n }\n}\n// Converts a private key object into a protobuf serialized private key\nfunction marshalPrivateKey(key, type) {\n type = (type ?? 'rsa').toLowerCase();\n typeToKey(type); // check type\n return key.bytes;\n}\n/**\n *\n * @param {string} encryptedKey\n * @param {string} password\n */\nasync function importKey(encryptedKey, password) {\n try {\n const key = await (0,_importer_js__WEBPACK_IMPORTED_MODULE_8__.importer)(encryptedKey, password);\n return await unmarshalPrivateKey(key);\n }\n catch (_) {\n // Ignore and try the old pem decrypt\n }\n // Only rsa supports pem right now\n const key = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.decryptRsaPrivateKey(encryptedKey, password);\n if (key === null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_4__.CodeError('Cannot read the key, most likely the password is wrong or not a RSA key', 'ERR_CANNOT_DECRYPT_PEM');\n }\n let der = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.asn1.toDer(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.privateKeyToAsn1(key));\n der = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_5__.fromString)(der.getBytes(), 'ascii');\n return await supportedKeys.rsa.unmarshalRsaPrivateKey(der);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/index.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateEphemeralKeyPair\": () => (/* reexport safe */ _ephemeral_keys_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"generateKeyPairFromSeed\": () => (/* binding */ generateKeyPairFromSeed),\n/* harmony export */ \"importKey\": () => (/* binding */ importKey),\n/* harmony export */ \"keyStretcher\": () => (/* reexport safe */ _key_stretcher_js__WEBPACK_IMPORTED_MODULE_8__.keyStretcher),\n/* harmony export */ \"keysPBM\": () => (/* reexport module object */ _keys_js__WEBPACK_IMPORTED_MODULE_9__),\n/* harmony export */ \"marshalPrivateKey\": () => (/* binding */ marshalPrivateKey),\n/* harmony export */ \"marshalPublicKey\": () => (/* binding */ marshalPublicKey),\n/* harmony export */ \"supportedKeys\": () => (/* binding */ supportedKeys),\n/* harmony export */ \"unmarshalPrivateKey\": () => (/* binding */ unmarshalPrivateKey),\n/* harmony export */ \"unmarshalPublicKey\": () => (/* binding */ unmarshalPublicKey)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_asn1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/asn1.js */ \"./node_modules/node-forge/lib/asn1.js\");\n/* harmony import */ var node_forge_lib_pbe_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/pbe.js */ \"./node_modules/node-forge/lib/pbe.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var _ed25519_class_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ed25519-class.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/ed25519-class.js\");\n/* harmony import */ var _ephemeral_keys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ephemeral-keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/ephemeral-keys.js\");\n/* harmony import */ var _importer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./importer.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/importer.js\");\n/* harmony import */ var _key_stretcher_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./key-stretcher.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/key-stretcher.js\");\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n/* harmony import */ var _rsa_class_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./rsa-class.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/rsa-class.js\");\n/* harmony import */ var _secp256k1_class_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./secp256k1-class.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.js\");\n\n\n\n// @ts-expect-error types are missing\n\n\n\n\n\n\n\n\n\n\n\n\nconst supportedKeys = {\n rsa: _rsa_class_js__WEBPACK_IMPORTED_MODULE_10__,\n ed25519: _ed25519_class_js__WEBPACK_IMPORTED_MODULE_5__,\n secp256k1: _secp256k1_class_js__WEBPACK_IMPORTED_MODULE_11__\n};\nfunction unsupportedKey(type) {\n const supported = Object.keys(supportedKeys).join(' / ');\n return new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError(`invalid or unsupported key type ${type}. Must be ${supported}`, 'ERR_UNSUPPORTED_KEY_TYPE');\n}\nfunction typeToKey(type) {\n type = type.toLowerCase();\n if (type === 'rsa' || type === 'ed25519' || type === 'secp256k1') {\n return supportedKeys[type];\n }\n throw unsupportedKey(type);\n}\n// Generates a keypair of the given type and bitsize\nasync function generateKeyPair(type, bits) {\n return typeToKey(type).generateKeyPair(bits ?? 2048);\n}\n// Generates a keypair of the given type and bitsize\n// seed is a 32 byte uint8array\nasync function generateKeyPairFromSeed(type, seed, bits) {\n if (type.toLowerCase() !== 'ed25519') {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError('Seed key derivation is unimplemented for RSA or secp256k1', 'ERR_UNSUPPORTED_KEY_DERIVATION_TYPE');\n }\n return _ed25519_class_js__WEBPACK_IMPORTED_MODULE_5__.generateKeyPairFromSeed(seed);\n}\n// Converts a protobuf serialized public key into its\n// representative object\nfunction unmarshalPublicKey(buf) {\n const decoded = _keys_js__WEBPACK_IMPORTED_MODULE_9__.PublicKey.decode(buf);\n const data = decoded.Data ?? new Uint8Array();\n switch (decoded.Type) {\n case _keys_js__WEBPACK_IMPORTED_MODULE_9__.KeyType.RSA:\n return supportedKeys.rsa.unmarshalRsaPublicKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_9__.KeyType.Ed25519:\n return supportedKeys.ed25519.unmarshalEd25519PublicKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_9__.KeyType.Secp256k1:\n return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data);\n default:\n throw unsupportedKey(decoded.Type ?? 'RSA');\n }\n}\n// Converts a public key object into a protobuf serialized public key\nfunction marshalPublicKey(key, type) {\n type = (type ?? 'rsa').toLowerCase();\n typeToKey(type); // check type\n return key.bytes;\n}\n// Converts a protobuf serialized private key into its\n// representative object\nasync function unmarshalPrivateKey(buf) {\n const decoded = _keys_js__WEBPACK_IMPORTED_MODULE_9__.PrivateKey.decode(buf);\n const data = decoded.Data ?? new Uint8Array();\n switch (decoded.Type) {\n case _keys_js__WEBPACK_IMPORTED_MODULE_9__.KeyType.RSA:\n return supportedKeys.rsa.unmarshalRsaPrivateKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_9__.KeyType.Ed25519:\n return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data);\n case _keys_js__WEBPACK_IMPORTED_MODULE_9__.KeyType.Secp256k1:\n return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data);\n default:\n throw unsupportedKey(decoded.Type ?? 'RSA');\n }\n}\n// Converts a private key object into a protobuf serialized private key\nfunction marshalPrivateKey(key, type) {\n type = (type ?? 'rsa').toLowerCase();\n typeToKey(type); // check type\n return key.bytes;\n}\n/**\n *\n * @param {string} encryptedKey\n * @param {string} password\n */\nasync function importKey(encryptedKey, password) {\n try {\n const key = await (0,_importer_js__WEBPACK_IMPORTED_MODULE_7__.importer)(encryptedKey, password);\n return await unmarshalPrivateKey(key);\n }\n catch (_) {\n // Ignore and try the old pem decrypt\n }\n // Only rsa supports pem right now\n const key = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.decryptRsaPrivateKey(encryptedKey, password);\n if (key === null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError('Cannot read the key, most likely the password is wrong or not a RSA key', 'ERR_CANNOT_DECRYPT_PEM');\n }\n let der = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.asn1.toDer(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.privateKeyToAsn1(key));\n der = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(der.getBytes(), 'ascii');\n return supportedKeys.rsa.unmarshalRsaPrivateKey(der);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/index.js?");
/***/ }),
@@ -2685,7 +3158,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"KeyType\": () => (/* binding */ KeyType),\n/* harmony export */ \"PrivateKey\": () => (/* binding */ PrivateKey),\n/* harmony export */ \"PublicKey\": () => (/* binding */ PublicKey)\n/* harmony export */ });\n/* harmony import */ var protons_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! protons-runtime */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/index.js\");\n/* eslint-disable import/export */\n/* eslint-disable complexity */\n/* eslint-disable @typescript-eslint/no-namespace */\n/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */\n/* eslint-disable @typescript-eslint/no-empty-interface */\n\nvar KeyType;\n(function (KeyType) {\n KeyType[\"RSA\"] = \"RSA\";\n KeyType[\"Ed25519\"] = \"Ed25519\";\n KeyType[\"Secp256k1\"] = \"Secp256k1\";\n})(KeyType || (KeyType = {}));\nvar __KeyTypeValues;\n(function (__KeyTypeValues) {\n __KeyTypeValues[__KeyTypeValues[\"RSA\"] = 0] = \"RSA\";\n __KeyTypeValues[__KeyTypeValues[\"Ed25519\"] = 1] = \"Ed25519\";\n __KeyTypeValues[__KeyTypeValues[\"Secp256k1\"] = 2] = \"Secp256k1\";\n})(__KeyTypeValues || (__KeyTypeValues = {}));\n(function (KeyType) {\n KeyType.codec = () => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.enumeration)(__KeyTypeValues);\n };\n})(KeyType || (KeyType = {}));\nvar PublicKey;\n(function (PublicKey) {\n let _codec;\n PublicKey.codec = () => {\n if (_codec == null) {\n _codec = (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.message)((obj, w, opts = {}) => {\n if (opts.lengthDelimited !== false) {\n w.fork();\n }\n if (obj.Type != null) {\n w.uint32(8);\n KeyType.codec().encode(obj.Type, w);\n }\n if (obj.Data != null) {\n w.uint32(18);\n w.bytes(obj.Data);\n }\n if (opts.lengthDelimited !== false) {\n w.ldelim();\n }\n }, (reader, length) => {\n const obj = {};\n const end = length == null ? reader.len : reader.pos + length;\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n obj.Type = KeyType.codec().decode(reader);\n break;\n case 2:\n obj.Data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return obj;\n });\n }\n return _codec;\n };\n PublicKey.encode = (obj) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.encodeMessage)(obj, PublicKey.codec());\n };\n PublicKey.decode = (buf) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.decodeMessage)(buf, PublicKey.codec());\n };\n})(PublicKey || (PublicKey = {}));\nvar PrivateKey;\n(function (PrivateKey) {\n let _codec;\n PrivateKey.codec = () => {\n if (_codec == null) {\n _codec = (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.message)((obj, w, opts = {}) => {\n if (opts.lengthDelimited !== false) {\n w.fork();\n }\n if (obj.Type != null) {\n w.uint32(8);\n KeyType.codec().encode(obj.Type, w);\n }\n if (obj.Data != null) {\n w.uint32(18);\n w.bytes(obj.Data);\n }\n if (opts.lengthDelimited !== false) {\n w.ldelim();\n }\n }, (reader, length) => {\n const obj = {};\n const end = length == null ? reader.len : reader.pos + length;\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n obj.Type = KeyType.codec().decode(reader);\n break;\n case 2:\n obj.Data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return obj;\n });\n }\n return _codec;\n };\n PrivateKey.encode = (obj) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.encodeMessage)(obj, PrivateKey.codec());\n };\n PrivateKey.decode = (buf) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.decodeMessage)(buf, PrivateKey.codec());\n };\n})(PrivateKey || (PrivateKey = {}));\n//# sourceMappingURL=keys.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/keys.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"KeyType\": () => (/* binding */ KeyType),\n/* harmony export */ \"PrivateKey\": () => (/* binding */ PrivateKey),\n/* harmony export */ \"PublicKey\": () => (/* binding */ PublicKey)\n/* harmony export */ });\n/* harmony import */ var protons_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! protons-runtime */ \"./node_modules/protons-runtime/dist/src/index.js\");\n/* eslint-disable import/export */\n/* eslint-disable complexity */\n/* eslint-disable @typescript-eslint/no-namespace */\n/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */\n/* eslint-disable @typescript-eslint/no-empty-interface */\n\nvar KeyType;\n(function (KeyType) {\n KeyType[\"RSA\"] = \"RSA\";\n KeyType[\"Ed25519\"] = \"Ed25519\";\n KeyType[\"Secp256k1\"] = \"Secp256k1\";\n})(KeyType || (KeyType = {}));\nvar __KeyTypeValues;\n(function (__KeyTypeValues) {\n __KeyTypeValues[__KeyTypeValues[\"RSA\"] = 0] = \"RSA\";\n __KeyTypeValues[__KeyTypeValues[\"Ed25519\"] = 1] = \"Ed25519\";\n __KeyTypeValues[__KeyTypeValues[\"Secp256k1\"] = 2] = \"Secp256k1\";\n})(__KeyTypeValues || (__KeyTypeValues = {}));\n(function (KeyType) {\n KeyType.codec = () => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.enumeration)(__KeyTypeValues);\n };\n})(KeyType || (KeyType = {}));\nvar PublicKey;\n(function (PublicKey) {\n let _codec;\n PublicKey.codec = () => {\n if (_codec == null) {\n _codec = (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.message)((obj, w, opts = {}) => {\n if (opts.lengthDelimited !== false) {\n w.fork();\n }\n if (obj.Type != null) {\n w.uint32(8);\n KeyType.codec().encode(obj.Type, w);\n }\n if (obj.Data != null) {\n w.uint32(18);\n w.bytes(obj.Data);\n }\n if (opts.lengthDelimited !== false) {\n w.ldelim();\n }\n }, (reader, length) => {\n const obj = {};\n const end = length == null ? reader.len : reader.pos + length;\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n obj.Type = KeyType.codec().decode(reader);\n break;\n case 2:\n obj.Data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return obj;\n });\n }\n return _codec;\n };\n PublicKey.encode = (obj) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.encodeMessage)(obj, PublicKey.codec());\n };\n PublicKey.decode = (buf) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.decodeMessage)(buf, PublicKey.codec());\n };\n})(PublicKey || (PublicKey = {}));\nvar PrivateKey;\n(function (PrivateKey) {\n let _codec;\n PrivateKey.codec = () => {\n if (_codec == null) {\n _codec = (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.message)((obj, w, opts = {}) => {\n if (opts.lengthDelimited !== false) {\n w.fork();\n }\n if (obj.Type != null) {\n w.uint32(8);\n KeyType.codec().encode(obj.Type, w);\n }\n if (obj.Data != null) {\n w.uint32(18);\n w.bytes(obj.Data);\n }\n if (opts.lengthDelimited !== false) {\n w.ldelim();\n }\n }, (reader, length) => {\n const obj = {};\n const end = length == null ? reader.len : reader.pos + length;\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n obj.Type = KeyType.codec().decode(reader);\n break;\n case 2:\n obj.Data = reader.bytes();\n break;\n default:\n reader.skipType(tag & 7);\n break;\n }\n }\n return obj;\n });\n }\n return _codec;\n };\n PrivateKey.encode = (obj) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.encodeMessage)(obj, PrivateKey.codec());\n };\n PrivateKey.decode = (buf) => {\n return (0,protons_runtime__WEBPACK_IMPORTED_MODULE_0__.decodeMessage)(buf, PrivateKey.codec());\n };\n})(PrivateKey || (PrivateKey = {}));\n//# sourceMappingURL=keys.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/keys.js?");
/***/ }),
@@ -2696,7 +3169,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decrypt\": () => (/* binding */ decrypt),\n/* harmony export */ \"encrypt\": () => (/* binding */ encrypt),\n/* harmony export */ \"generateKey\": () => (/* binding */ generateKey),\n/* harmony export */ \"getRandomValues\": () => (/* reexport safe */ _random_bytes_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ \"hashAndSign\": () => (/* binding */ hashAndSign),\n/* harmony export */ \"hashAndVerify\": () => (/* binding */ hashAndVerify),\n/* harmony export */ \"unmarshalPrivateKey\": () => (/* binding */ unmarshalPrivateKey),\n/* harmony export */ \"utils\": () => (/* reexport module object */ _rsa_utils_js__WEBPACK_IMPORTED_MODULE_4__)\n/* harmony export */ });\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n/* harmony import */ var _random_bytes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../random-bytes.js */ \"./node_modules/@libp2p/crypto/dist/src/random-bytes.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var _rsa_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rsa-utils.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/rsa-utils.js\");\n/* harmony import */ var _jwk2pem_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./jwk2pem.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/jwk2pem.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n\n\n\n\n\n\n\n\nasync function generateKey(bits) {\n const pair = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.generateKey({\n name: 'RSASSA-PKCS1-v1_5',\n modulusLength: bits,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: 'SHA-256' }\n }, true, ['sign', 'verify']);\n const keys = await exportKey(pair);\n return {\n privateKey: keys[0],\n publicKey: keys[1]\n };\n}\n// Takes a jwk key\nasync function unmarshalPrivateKey(key) {\n const privateKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.importKey('jwk', key, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, true, ['sign']);\n const pair = [\n privateKey,\n await derivePublicFromPrivate(key)\n ];\n const keys = await exportKey({\n privateKey: pair[0],\n publicKey: pair[1]\n });\n return {\n privateKey: keys[0],\n publicKey: keys[1]\n };\n}\n\nasync function hashAndSign(key, msg) {\n const privateKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.importKey('jwk', key, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, false, ['sign']);\n const sig = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.sign({ name: 'RSASSA-PKCS1-v1_5' }, privateKey, Uint8Array.from(msg));\n return new Uint8Array(sig, 0, sig.byteLength);\n}\nasync function hashAndVerify(key, sig, msg) {\n const publicKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.importKey('jwk', key, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, false, ['verify']);\n return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.verify({ name: 'RSASSA-PKCS1-v1_5' }, publicKey, sig, msg);\n}\nasync function exportKey(pair) {\n if (pair.privateKey == null || pair.publicKey == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_6__.CodeError('Private and public key are required', 'ERR_INVALID_PARAMETERS');\n }\n return await Promise.all([\n _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.exportKey('jwk', pair.privateKey),\n _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.exportKey('jwk', pair.publicKey)\n ]);\n}\nasync function derivePublicFromPrivate(jwKey) {\n return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get().subtle.importKey('jwk', {\n kty: jwKey.kty,\n n: jwKey.n,\n e: jwKey.e\n }, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, true, ['verify']);\n}\n/*\n\nRSA encryption/decryption for the browser with webcrypto workaround\n\"bloody dark magic. webcrypto's why.\"\n\nExplanation:\n - Convert JWK to nodeForge\n - Convert msg Uint8Array to nodeForge buffer: ByteBuffer is a \"binary-string backed buffer\", so let's make our Uint8Array a binary string\n - Convert resulting nodeForge buffer to Uint8Array: it returns a binary string, turn that into a Uint8Array\n\n*/\nfunction convertKey(key, pub, msg, handle) {\n const fkey = pub ? (0,_jwk2pem_js__WEBPACK_IMPORTED_MODULE_5__.jwk2pub)(key) : (0,_jwk2pem_js__WEBPACK_IMPORTED_MODULE_5__.jwk2priv)(key);\n const fmsg = (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(Uint8Array.from(msg), 'ascii');\n const fomsg = handle(fmsg, fkey);\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__.fromString)(fomsg, 'ascii');\n}\nfunction encrypt(key, msg) {\n return convertKey(key, true, msg, (msg, key) => key.encrypt(msg));\n}\nfunction decrypt(key, msg) {\n return convertKey(key, false, msg, (msg, key) => key.decrypt(msg));\n}\n//# sourceMappingURL=rsa-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/rsa-browser.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decrypt\": () => (/* binding */ decrypt),\n/* harmony export */ \"encrypt\": () => (/* binding */ encrypt),\n/* harmony export */ \"generateKey\": () => (/* binding */ generateKey),\n/* harmony export */ \"getRandomValues\": () => (/* reexport safe */ _random_bytes_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ \"hashAndSign\": () => (/* binding */ hashAndSign),\n/* harmony export */ \"hashAndVerify\": () => (/* binding */ hashAndVerify),\n/* harmony export */ \"unmarshalPrivateKey\": () => (/* binding */ unmarshalPrivateKey),\n/* harmony export */ \"utils\": () => (/* reexport module object */ _rsa_utils_js__WEBPACK_IMPORTED_MODULE_6__)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _random_bytes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../random-bytes.js */ \"./node_modules/@libp2p/crypto/dist/src/random-bytes.js\");\n/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../webcrypto.js */ \"./node_modules/@libp2p/crypto/dist/src/webcrypto.js\");\n/* harmony import */ var _jwk2pem_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./jwk2pem.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/jwk2pem.js\");\n/* harmony import */ var _rsa_utils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./rsa-utils.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/rsa-utils.js\");\n\n\n\n\n\n\n\n\nasync function generateKey(bits) {\n const pair = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.generateKey({\n name: 'RSASSA-PKCS1-v1_5',\n modulusLength: bits,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: 'SHA-256' }\n }, true, ['sign', 'verify']);\n const keys = await exportKey(pair);\n return {\n privateKey: keys[0],\n publicKey: keys[1]\n };\n}\n// Takes a jwk key\nasync function unmarshalPrivateKey(key) {\n const privateKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.importKey('jwk', key, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, true, ['sign']);\n const pair = [\n privateKey,\n await derivePublicFromPrivate(key)\n ];\n const keys = await exportKey({\n privateKey: pair[0],\n publicKey: pair[1]\n });\n return {\n privateKey: keys[0],\n publicKey: keys[1]\n };\n}\n\nasync function hashAndSign(key, msg) {\n const privateKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.importKey('jwk', key, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, false, ['sign']);\n const sig = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.sign({ name: 'RSASSA-PKCS1-v1_5' }, privateKey, Uint8Array.from(msg));\n return new Uint8Array(sig, 0, sig.byteLength);\n}\nasync function hashAndVerify(key, sig, msg) {\n const publicKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.importKey('jwk', key, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, false, ['verify']);\n return _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.verify({ name: 'RSASSA-PKCS1-v1_5' }, publicKey, sig, msg);\n}\nasync function exportKey(pair) {\n if (pair.privateKey == null || pair.publicKey == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError('Private and public key are required', 'ERR_INVALID_PARAMETERS');\n }\n return Promise.all([\n _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.exportKey('jwk', pair.privateKey),\n _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.exportKey('jwk', pair.publicKey)\n ]);\n}\nasync function derivePublicFromPrivate(jwKey) {\n return _webcrypto_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get().subtle.importKey('jwk', {\n kty: jwKey.kty,\n n: jwKey.n,\n e: jwKey.e\n }, {\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' }\n }, true, ['verify']);\n}\n/*\n\nRSA encryption/decryption for the browser with webcrypto workaround\n\"bloody dark magic. webcrypto's why.\"\n\nExplanation:\n - Convert JWK to nodeForge\n - Convert msg Uint8Array to nodeForge buffer: ByteBuffer is a \"binary-string backed buffer\", so let's make our Uint8Array a binary string\n - Convert resulting nodeForge buffer to Uint8Array: it returns a binary string, turn that into a Uint8Array\n\n*/\nfunction convertKey(key, pub, msg, handle) {\n const fkey = pub ? (0,_jwk2pem_js__WEBPACK_IMPORTED_MODULE_5__.jwk2pub)(key) : (0,_jwk2pem_js__WEBPACK_IMPORTED_MODULE_5__.jwk2priv)(key);\n const fmsg = (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_2__.toString)(Uint8Array.from(msg), 'ascii');\n const fomsg = handle(fmsg, fkey);\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_1__.fromString)(fomsg, 'ascii');\n}\nfunction encrypt(key, msg) {\n return convertKey(key, true, msg, (msg, key) => key.encrypt(msg));\n}\nfunction decrypt(key, msg) {\n return convertKey(key, false, msg, (msg, key) => key.decrypt(msg));\n}\n//# sourceMappingURL=rsa-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/rsa-browser.js?");
/***/ }),
@@ -2707,7 +3180,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RsaPrivateKey\": () => (/* binding */ RsaPrivateKey),\n/* harmony export */ \"RsaPublicKey\": () => (/* binding */ RsaPublicKey),\n/* harmony export */ \"fromJwk\": () => (/* binding */ fromJwk),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"unmarshalRsaPrivateKey\": () => (/* binding */ unmarshalRsaPrivateKey),\n/* harmony export */ \"unmarshalRsaPublicKey\": () => (/* binding */ unmarshalRsaPublicKey)\n/* harmony export */ });\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/sha2-browser.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var node_forge_lib_sha512_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! node-forge/lib/sha512.js */ \"./node_modules/node-forge/lib/sha512.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var _rsa_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./rsa.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/rsa-browser.js\");\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n/* harmony import */ var _exporter_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./exporter.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/exporter.js\");\n\n\n\n\n\n// @ts-expect-error types are missing\n\n\n\n\nclass RsaPublicKey {\n constructor(key) {\n this._key = key;\n }\n async verify(data, sig) {\n return await _rsa_js__WEBPACK_IMPORTED_MODULE_6__.hashAndVerify(this._key, sig, data);\n }\n marshal() {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_6__.utils.jwkToPkix(this._key);\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_7__.PublicKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_7__.KeyType.RSA,\n Data: this.marshal()\n }).subarray();\n }\n encrypt(bytes) {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_6__.encrypt(this._key, bytes);\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__.sha256.digest(this.bytes);\n return bytes;\n }\n}\nclass RsaPrivateKey {\n constructor(key, publicKey) {\n this._key = key;\n this._publicKey = publicKey;\n }\n genSecret() {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_6__.getRandomValues(16);\n }\n async sign(message) {\n return await _rsa_js__WEBPACK_IMPORTED_MODULE_6__.hashAndSign(this._key, message);\n }\n get public() {\n if (this._publicKey == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('public key not provided', 'ERR_PUBKEY_NOT_PROVIDED');\n }\n return new RsaPublicKey(this._publicKey);\n }\n decrypt(bytes) {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_6__.decrypt(this._key, bytes);\n }\n marshal() {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_6__.utils.jwkToPkcs1(this._key);\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_7__.PrivateKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_7__.KeyType.RSA,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__.sha256.digest(this.bytes);\n return bytes;\n }\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n */\n async id() {\n const hash = await this.public.hash();\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(hash, 'base58btc');\n }\n /**\n * Exports the key into a password protected PEM format\n */\n async export(password, format = 'pkcs-8') {\n if (format === 'pkcs-8') {\n const buffer = new node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_5__.util.ByteBuffer(this.marshal());\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_5__.asn1.fromDer(buffer);\n const privateKey = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_5__.pki.privateKeyFromAsn1(asn1);\n const options = {\n algorithm: 'aes256',\n count: 10000,\n saltSize: 128 / 8,\n prfAlgorithm: 'sha512'\n };\n return node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_5__.pki.encryptRsaPrivateKey(privateKey, password, options);\n }\n else if (format === 'libp2p-key') {\n return await (0,_exporter_js__WEBPACK_IMPORTED_MODULE_8__.exporter)(this.bytes, password);\n }\n else {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT');\n }\n }\n}\nasync function unmarshalRsaPrivateKey(bytes) {\n const jwk = _rsa_js__WEBPACK_IMPORTED_MODULE_6__.utils.pkcs1ToJwk(bytes);\n const keys = await _rsa_js__WEBPACK_IMPORTED_MODULE_6__.unmarshalPrivateKey(jwk);\n return new RsaPrivateKey(keys.privateKey, keys.publicKey);\n}\nfunction unmarshalRsaPublicKey(bytes) {\n const jwk = _rsa_js__WEBPACK_IMPORTED_MODULE_6__.utils.pkixToJwk(bytes);\n return new RsaPublicKey(jwk);\n}\nasync function fromJwk(jwk) {\n const keys = await _rsa_js__WEBPACK_IMPORTED_MODULE_6__.unmarshalPrivateKey(jwk);\n return new RsaPrivateKey(keys.privateKey, keys.publicKey);\n}\nasync function generateKeyPair(bits) {\n const keys = await _rsa_js__WEBPACK_IMPORTED_MODULE_6__.generateKey(bits);\n return new RsaPrivateKey(keys.privateKey, keys.publicKey);\n}\n//# sourceMappingURL=rsa-class.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/rsa-class.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RsaPrivateKey\": () => (/* binding */ RsaPrivateKey),\n/* harmony export */ \"RsaPublicKey\": () => (/* binding */ RsaPublicKey),\n/* harmony export */ \"fromJwk\": () => (/* binding */ fromJwk),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"unmarshalRsaPrivateKey\": () => (/* binding */ unmarshalRsaPrivateKey),\n/* harmony export */ \"unmarshalRsaPublicKey\": () => (/* binding */ unmarshalRsaPublicKey)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/multiformats/src/hashes/sha2-browser.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var node_forge_lib_sha512_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! node-forge/lib/sha512.js */ \"./node_modules/node-forge/lib/sha512.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _exporter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./exporter.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/exporter.js\");\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n/* harmony import */ var _rsa_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rsa.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/rsa-browser.js\");\n\n\n// @ts-expect-error types are missing\n\n\n\n\n\n\n\nclass RsaPublicKey {\n _key;\n constructor(key) {\n this._key = key;\n }\n async verify(data, sig) {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_8__.hashAndVerify(this._key, sig, data);\n }\n marshal() {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_8__.utils.jwkToPkix(this._key);\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_7__.PublicKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_7__.KeyType.RSA,\n Data: this.marshal()\n }).subarray();\n }\n encrypt(bytes) {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_8__.encrypt(this._key, bytes);\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_3__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_1__.sha256.digest(this.bytes);\n return bytes;\n }\n}\nclass RsaPrivateKey {\n _key;\n _publicKey;\n constructor(key, publicKey) {\n this._key = key;\n this._publicKey = publicKey;\n }\n genSecret() {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_8__.getRandomValues(16);\n }\n async sign(message) {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_8__.hashAndSign(this._key, message);\n }\n get public() {\n if (this._publicKey == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError('public key not provided', 'ERR_PUBKEY_NOT_PROVIDED');\n }\n return new RsaPublicKey(this._publicKey);\n }\n decrypt(bytes) {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_8__.decrypt(this._key, bytes);\n }\n marshal() {\n return _rsa_js__WEBPACK_IMPORTED_MODULE_8__.utils.jwkToPkcs1(this._key);\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_7__.PrivateKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_7__.KeyType.RSA,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_3__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_1__.sha256.digest(this.bytes);\n return bytes;\n }\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n */\n async id() {\n const hash = await this.public.hash();\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__.toString)(hash, 'base58btc');\n }\n /**\n * Exports the key into a password protected PEM format\n */\n async export(password, format = 'pkcs-8') {\n if (format === 'pkcs-8') {\n const buffer = new node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.util.ByteBuffer(this.marshal());\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.asn1.fromDer(buffer);\n const privateKey = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.pki.privateKeyFromAsn1(asn1);\n const options = {\n algorithm: 'aes256',\n count: 10000,\n saltSize: 128 / 8,\n prfAlgorithm: 'sha512'\n };\n return node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.pki.encryptRsaPrivateKey(privateKey, password, options);\n }\n else if (format === 'libp2p-key') {\n return (0,_exporter_js__WEBPACK_IMPORTED_MODULE_6__.exporter)(this.bytes, password);\n }\n else {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT');\n }\n }\n}\nasync function unmarshalRsaPrivateKey(bytes) {\n const jwk = _rsa_js__WEBPACK_IMPORTED_MODULE_8__.utils.pkcs1ToJwk(bytes);\n const keys = await _rsa_js__WEBPACK_IMPORTED_MODULE_8__.unmarshalPrivateKey(jwk);\n return new RsaPrivateKey(keys.privateKey, keys.publicKey);\n}\nfunction unmarshalRsaPublicKey(bytes) {\n const jwk = _rsa_js__WEBPACK_IMPORTED_MODULE_8__.utils.pkixToJwk(bytes);\n return new RsaPublicKey(jwk);\n}\nasync function fromJwk(jwk) {\n const keys = await _rsa_js__WEBPACK_IMPORTED_MODULE_8__.unmarshalPrivateKey(jwk);\n return new RsaPrivateKey(keys.privateKey, keys.publicKey);\n}\nasync function generateKeyPair(bits) {\n const keys = await _rsa_js__WEBPACK_IMPORTED_MODULE_8__.generateKey(bits);\n return new RsaPrivateKey(keys.privateKey, keys.publicKey);\n}\n//# sourceMappingURL=rsa-class.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/rsa-class.js?");
/***/ }),
@@ -2718,7 +3191,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"jwkToPkcs1\": () => (/* binding */ jwkToPkcs1),\n/* harmony export */ \"jwkToPkix\": () => (/* binding */ jwkToPkix),\n/* harmony export */ \"pkcs1ToJwk\": () => (/* binding */ pkcs1ToJwk),\n/* harmony export */ \"pkixToJwk\": () => (/* binding */ pkixToJwk)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_asn1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/asn1.js */ \"./node_modules/node-forge/lib/asn1.js\");\n/* harmony import */ var node_forge_lib_rsa_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/rsa.js */ \"./node_modules/node-forge/lib/rsa.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../util.js */ \"./node_modules/@libp2p/crypto/dist/src/util.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n\n\n// @ts-expect-error types are missing\n\n\n\n\n\n// Convert a PKCS#1 in ASN1 DER format to a JWK key\nfunction pkcs1ToJwk(bytes) {\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.asn1.fromDer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__.toString)(bytes, 'ascii'));\n const privateKey = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.pki.privateKeyFromAsn1(asn1);\n // https://tools.ietf.org/html/rfc7518#section-6.3.1\n return {\n kty: 'RSA',\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.e),\n d: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.d),\n p: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.p),\n q: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.q),\n dp: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.dP),\n dq: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.dQ),\n qi: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(privateKey.qInv),\n alg: 'RS256'\n };\n}\n// Convert a JWK key into PKCS#1 in ASN1 DER format\nfunction jwkToPkcs1(jwk) {\n if (jwk.n == null || jwk.e == null || jwk.d == null || jwk.p == null || jwk.q == null || jwk.dp == null || jwk.dq == null || jwk.qi == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_6__.CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS');\n }\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.pki.privateKeyToAsn1({\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.e),\n d: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.d),\n p: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.p),\n q: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.q),\n dP: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.dp),\n dQ: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.dq),\n qInv: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.qi)\n });\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.asn1.toDer(asn1).getBytes(), 'ascii');\n}\n// Convert a PKCIX in ASN1 DER format to a JWK key\nfunction pkixToJwk(bytes) {\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.asn1.fromDer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__.toString)(bytes, 'ascii'));\n const publicKey = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.pki.publicKeyFromAsn1(asn1);\n return {\n kty: 'RSA',\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(publicKey.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.bigIntegerToUintBase64url)(publicKey.e)\n };\n}\n// Convert a JWK key to PKCIX in ASN1 DER format\nfunction jwkToPkix(jwk) {\n if (jwk.n == null || jwk.e == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_6__.CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS');\n }\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.pki.publicKeyToAsn1({\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__.base64urlToBigInteger)(jwk.e)\n });\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.asn1.toDer(asn1).getBytes(), 'ascii');\n}\n//# sourceMappingURL=rsa-utils.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/rsa-utils.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"jwkToPkcs1\": () => (/* binding */ jwkToPkcs1),\n/* harmony export */ \"jwkToPkix\": () => (/* binding */ jwkToPkix),\n/* harmony export */ \"pkcs1ToJwk\": () => (/* binding */ pkcs1ToJwk),\n/* harmony export */ \"pkixToJwk\": () => (/* binding */ pkixToJwk)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_asn1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/asn1.js */ \"./node_modules/node-forge/lib/asn1.js\");\n/* harmony import */ var node_forge_lib_rsa_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/rsa.js */ \"./node_modules/node-forge/lib/rsa.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../util.js */ \"./node_modules/@libp2p/crypto/dist/src/util.js\");\n\n\n\n// @ts-expect-error types are missing\n\n\n\n\n// Convert a PKCS#1 in ASN1 DER format to a JWK key\nfunction pkcs1ToJwk(bytes) {\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.asn1.fromDer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__.toString)(bytes, 'ascii'));\n const privateKey = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.privateKeyFromAsn1(asn1);\n // https://tools.ietf.org/html/rfc7518#section-6.3.1\n return {\n kty: 'RSA',\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.e),\n d: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.d),\n p: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.p),\n q: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.q),\n dp: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.dP),\n dq: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.dQ),\n qi: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(privateKey.qInv),\n alg: 'RS256'\n };\n}\n// Convert a JWK key into PKCS#1 in ASN1 DER format\nfunction jwkToPkcs1(jwk) {\n if (jwk.n == null || jwk.e == null || jwk.d == null || jwk.p == null || jwk.q == null || jwk.dp == null || jwk.dq == null || jwk.qi == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS');\n }\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.privateKeyToAsn1({\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.e),\n d: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.d),\n p: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.p),\n q: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.q),\n dP: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.dp),\n dQ: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.dq),\n qInv: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.qi)\n });\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.asn1.toDer(asn1).getBytes(), 'ascii');\n}\n// Convert a PKCIX in ASN1 DER format to a JWK key\nfunction pkixToJwk(bytes) {\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.asn1.fromDer((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__.toString)(bytes, 'ascii'));\n const publicKey = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.publicKeyFromAsn1(asn1);\n return {\n kty: 'RSA',\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(publicKey.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.bigIntegerToUintBase64url)(publicKey.e)\n };\n}\n// Convert a JWK key to PKCIX in ASN1 DER format\nfunction jwkToPkix(jwk) {\n if (jwk.n == null || jwk.e == null) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError('JWK was missing components', 'ERR_INVALID_PARAMETERS');\n }\n const asn1 = node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.pki.publicKeyToAsn1({\n n: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.n),\n e: (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.base64urlToBigInteger)(jwk.e)\n });\n return (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_3__.asn1.toDer(asn1).getBytes(), 'ascii');\n}\n//# sourceMappingURL=rsa-utils.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/rsa-utils.js?");
/***/ }),
@@ -2729,7 +3202,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Secp256k1PrivateKey\": () => (/* binding */ Secp256k1PrivateKey),\n/* harmony export */ \"Secp256k1PublicKey\": () => (/* binding */ Secp256k1PublicKey),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"unmarshalSecp256k1PrivateKey\": () => (/* binding */ unmarshalSecp256k1PrivateKey),\n/* harmony export */ \"unmarshalSecp256k1PublicKey\": () => (/* binding */ unmarshalSecp256k1PublicKey)\n/* harmony export */ });\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/sha2-browser.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./secp256k1.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/secp256k1.js\");\n/* harmony import */ var _exporter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exporter.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/exporter.js\");\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n\n\n\n\n\n\n\nclass Secp256k1PublicKey {\n constructor(key) {\n _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.validatePublicKey(key);\n this._key = key;\n }\n async verify(data, sig) {\n return await _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.hashAndVerify(this._key, sig, data);\n }\n marshal() {\n return _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.compressPublicKey(this._key);\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_6__.PublicKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_6__.KeyType.Secp256k1,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__.sha256.digest(this.bytes);\n return bytes;\n }\n}\nclass Secp256k1PrivateKey {\n constructor(key, publicKey) {\n this._key = key;\n this._publicKey = publicKey ?? _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.computePublicKey(key);\n _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.validatePrivateKey(this._key);\n _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.validatePublicKey(this._publicKey);\n }\n async sign(message) {\n return await _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.hashAndSign(this._key, message);\n }\n get public() {\n return new Secp256k1PublicKey(this._publicKey);\n }\n marshal() {\n return this._key;\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_6__.PrivateKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_6__.KeyType.Secp256k1,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_0__.sha256.digest(this.bytes);\n return bytes;\n }\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n */\n async id() {\n const hash = await this.public.hash();\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(hash, 'base58btc');\n }\n /**\n * Exports the key into a password protected `format`\n */\n async export(password, format = 'libp2p-key') {\n if (format === 'libp2p-key') {\n return await (0,_exporter_js__WEBPACK_IMPORTED_MODULE_5__.exporter)(this.bytes, password);\n }\n else {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT');\n }\n }\n}\nfunction unmarshalSecp256k1PrivateKey(bytes) {\n return new Secp256k1PrivateKey(bytes);\n}\nfunction unmarshalSecp256k1PublicKey(bytes) {\n return new Secp256k1PublicKey(bytes);\n}\nasync function generateKeyPair() {\n const privateKeyBytes = _secp256k1_js__WEBPACK_IMPORTED_MODULE_4__.generateKey();\n return new Secp256k1PrivateKey(privateKeyBytes);\n}\n//# sourceMappingURL=secp256k1-class.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Secp256k1PrivateKey\": () => (/* binding */ Secp256k1PrivateKey),\n/* harmony export */ \"Secp256k1PublicKey\": () => (/* binding */ Secp256k1PublicKey),\n/* harmony export */ \"generateKeyPair\": () => (/* binding */ generateKeyPair),\n/* harmony export */ \"unmarshalSecp256k1PrivateKey\": () => (/* binding */ unmarshalSecp256k1PrivateKey),\n/* harmony export */ \"unmarshalSecp256k1PublicKey\": () => (/* binding */ unmarshalSecp256k1PublicKey)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/multiformats/src/hashes/sha2-browser.js\");\n/* harmony import */ var uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uint8arrays/equals */ \"./node_modules/uint8arrays/dist/src/equals.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var _exporter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./exporter.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/exporter.js\");\n/* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keys.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/keys.js\");\n/* harmony import */ var _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./secp256k1.js */ \"./node_modules/@libp2p/crypto/dist/src/keys/secp256k1.js\");\n\n\n\n\n\n\n\nclass Secp256k1PublicKey {\n _key;\n constructor(key) {\n _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.validatePublicKey(key);\n this._key = key;\n }\n async verify(data, sig) {\n return _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.hashAndVerify(this._key, sig, data);\n }\n marshal() {\n return _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.compressPublicKey(this._key);\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_5__.PublicKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_5__.KeyType.Secp256k1,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_1__.sha256.digest(this.bytes);\n return bytes;\n }\n}\nclass Secp256k1PrivateKey {\n _key;\n _publicKey;\n constructor(key, publicKey) {\n this._key = key;\n this._publicKey = publicKey ?? _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.computePublicKey(key);\n _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.validatePrivateKey(this._key);\n _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.validatePublicKey(this._publicKey);\n }\n async sign(message) {\n return _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.hashAndSign(this._key, message);\n }\n get public() {\n return new Secp256k1PublicKey(this._publicKey);\n }\n marshal() {\n return this._key;\n }\n get bytes() {\n return _keys_js__WEBPACK_IMPORTED_MODULE_5__.PrivateKey.encode({\n Type: _keys_js__WEBPACK_IMPORTED_MODULE_5__.KeyType.Secp256k1,\n Data: this.marshal()\n }).subarray();\n }\n equals(key) {\n return (0,uint8arrays_equals__WEBPACK_IMPORTED_MODULE_2__.equals)(this.bytes, key.bytes);\n }\n async hash() {\n const { bytes } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_1__.sha256.digest(this.bytes);\n return bytes;\n }\n /**\n * Gets the ID of the key.\n *\n * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n * The public key is a protobuf encoding containing a type and the DER encoding\n * of the PKCS SubjectPublicKeyInfo.\n */\n async id() {\n const hash = await this.public.hash();\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_3__.toString)(hash, 'base58btc');\n }\n /**\n * Exports the key into a password protected `format`\n */\n async export(password, format = 'libp2p-key') {\n if (format === 'libp2p-key') {\n return (0,_exporter_js__WEBPACK_IMPORTED_MODULE_4__.exporter)(this.bytes, password);\n }\n else {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`export format '${format}' is not supported`, 'ERR_INVALID_EXPORT_FORMAT');\n }\n }\n}\nfunction unmarshalSecp256k1PrivateKey(bytes) {\n return new Secp256k1PrivateKey(bytes);\n}\nfunction unmarshalSecp256k1PublicKey(bytes) {\n return new Secp256k1PublicKey(bytes);\n}\nasync function generateKeyPair() {\n const privateKeyBytes = _secp256k1_js__WEBPACK_IMPORTED_MODULE_6__.generateKey();\n return new Secp256k1PrivateKey(privateKeyBytes);\n}\n//# sourceMappingURL=secp256k1-class.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/secp256k1-class.js?");
/***/ }),
@@ -2740,7 +3213,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"compressPublicKey\": () => (/* binding */ compressPublicKey),\n/* harmony export */ \"computePublicKey\": () => (/* binding */ computePublicKey),\n/* harmony export */ \"decompressPublicKey\": () => (/* binding */ decompressPublicKey),\n/* harmony export */ \"generateKey\": () => (/* binding */ generateKey),\n/* harmony export */ \"hashAndSign\": () => (/* binding */ hashAndSign),\n/* harmony export */ \"hashAndVerify\": () => (/* binding */ hashAndVerify),\n/* harmony export */ \"privateKeyLength\": () => (/* binding */ PRIVATE_KEY_BYTE_LENGTH),\n/* harmony export */ \"validatePrivateKey\": () => (/* binding */ validatePrivateKey),\n/* harmony export */ \"validatePublicKey\": () => (/* binding */ validatePublicKey)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @noble/secp256k1 */ \"./node_modules/@noble/secp256k1/lib/esm/index.js\");\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/sha2-browser.js\");\n\n\n\nconst PRIVATE_KEY_BYTE_LENGTH = 32;\n\nfunction generateKey() {\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.utils.randomPrivateKey();\n}\n/**\n * Hash and sign message with private key\n */\nasync function hashAndSign(key, msg) {\n const { digest } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__.sha256.digest(msg);\n try {\n return await _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.sign(digest, key);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_INPUT');\n }\n}\n/**\n * Hash message and verify signature with public key\n */\nasync function hashAndVerify(key, sig, msg) {\n try {\n const { digest } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__.sha256.digest(msg);\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.verify(sig, digest, key);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_INPUT');\n }\n}\nfunction compressPublicKey(key) {\n const point = _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.Point.fromHex(key).toRawBytes(true);\n return point;\n}\nfunction decompressPublicKey(key) {\n const point = _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.Point.fromHex(key).toRawBytes(false);\n return point;\n}\nfunction validatePrivateKey(key) {\n try {\n _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.getPublicKey(key, true);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY');\n }\n}\nfunction validatePublicKey(key) {\n try {\n _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.Point.fromHex(key);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_PUBLIC_KEY');\n }\n}\nfunction computePublicKey(privateKey) {\n try {\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.getPublicKey(privateKey, true);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY');\n }\n}\n//# sourceMappingURL=secp256k1.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/secp256k1.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"compressPublicKey\": () => (/* binding */ compressPublicKey),\n/* harmony export */ \"computePublicKey\": () => (/* binding */ computePublicKey),\n/* harmony export */ \"decompressPublicKey\": () => (/* binding */ decompressPublicKey),\n/* harmony export */ \"generateKey\": () => (/* binding */ generateKey),\n/* harmony export */ \"hashAndSign\": () => (/* binding */ hashAndSign),\n/* harmony export */ \"hashAndVerify\": () => (/* binding */ hashAndVerify),\n/* harmony export */ \"privateKeyLength\": () => (/* binding */ PRIVATE_KEY_BYTE_LENGTH),\n/* harmony export */ \"validatePrivateKey\": () => (/* binding */ validatePrivateKey),\n/* harmony export */ \"validatePublicKey\": () => (/* binding */ validatePublicKey)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @noble/secp256k1 */ \"./node_modules/@noble/secp256k1/lib/esm/index.js\");\n/* harmony import */ var multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! multiformats/hashes/sha2 */ \"./node_modules/multiformats/src/hashes/sha2-browser.js\");\n\n\n\nconst PRIVATE_KEY_BYTE_LENGTH = 32;\n\nfunction generateKey() {\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.utils.randomPrivateKey();\n}\n/**\n * Hash and sign message with private key\n */\nasync function hashAndSign(key, msg) {\n const { digest } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__.sha256.digest(msg);\n try {\n return await _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.sign(digest, key);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_INPUT');\n }\n}\n/**\n * Hash message and verify signature with public key\n */\nasync function hashAndVerify(key, sig, msg) {\n try {\n const { digest } = await multiformats_hashes_sha2__WEBPACK_IMPORTED_MODULE_2__.sha256.digest(msg);\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.verify(sig, digest, key);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_INPUT');\n }\n}\nfunction compressPublicKey(key) {\n const point = _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.Point.fromHex(key).toRawBytes(true);\n return point;\n}\nfunction decompressPublicKey(key) {\n const point = _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.Point.fromHex(key).toRawBytes(false);\n return point;\n}\nfunction validatePrivateKey(key) {\n try {\n _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.getPublicKey(key, true);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY');\n }\n}\nfunction validatePublicKey(key) {\n try {\n _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.Point.fromHex(key);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_PUBLIC_KEY');\n }\n}\nfunction computePublicKey(privateKey) {\n try {\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.getPublicKey(privateKey, true);\n }\n catch (err) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(String(err), 'ERR_INVALID_PRIVATE_KEY');\n }\n}\n//# sourceMappingURL=secp256k1.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/keys/secp256k1.js?");
/***/ }),
@@ -2751,7 +3224,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ pbkdf2)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_pbkdf2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/pbkdf2.js */ \"./node_modules/node-forge/lib/pbkdf2.js\");\n/* harmony import */ var node_forge_lib_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/util.js */ \"./node_modules/node-forge/lib/util.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n// @ts-expect-error types are missing\n\n// @ts-expect-error types are missing\n\n\n/**\n * Maps an IPFS hash name to its node-forge equivalent.\n *\n * See https://github.com/multiformats/multihash/blob/master/hashtable.csv\n *\n * @private\n */\nconst hashName = {\n sha1: 'sha1',\n 'sha2-256': 'sha256',\n 'sha2-512': 'sha512'\n};\n/**\n * Computes the Password-Based Key Derivation Function 2.\n */\nfunction pbkdf2(password, salt, iterations, keySize, hash) {\n if (hash !== 'sha1' && hash !== 'sha2-256' && hash !== 'sha2-512') {\n const types = Object.keys(hashName).join(' / ');\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError(`Hash '${hash}' is unknown or not supported. Must be ${types}`, 'ERR_UNSUPPORTED_HASH_TYPE');\n }\n const hasher = hashName[hash];\n const dek = node_forge_lib_pbkdf2_js__WEBPACK_IMPORTED_MODULE_0__(password, salt, iterations, keySize, hasher);\n return node_forge_lib_util_js__WEBPACK_IMPORTED_MODULE_1__.encode64(dek, null);\n}\n//# sourceMappingURL=pbkdf2.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/pbkdf2.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ pbkdf2)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var node_forge_lib_pbkdf2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/pbkdf2.js */ \"./node_modules/node-forge/lib/pbkdf2.js\");\n/* harmony import */ var node_forge_lib_util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node-forge/lib/util.js */ \"./node_modules/node-forge/lib/util.js\");\n\n// @ts-expect-error types are missing\n\n// @ts-expect-error types are missing\n\n/**\n * Maps an IPFS hash name to its node-forge equivalent.\n *\n * See https://github.com/multiformats/multihash/blob/master/hashtable.csv\n *\n * @private\n */\nconst hashName = {\n sha1: 'sha1',\n 'sha2-256': 'sha256',\n 'sha2-512': 'sha512'\n};\n/**\n * Computes the Password-Based Key Derivation Function 2.\n */\nfunction pbkdf2(password, salt, iterations, keySize, hash) {\n if (hash !== 'sha1' && hash !== 'sha2-256' && hash !== 'sha2-512') {\n const types = Object.keys(hashName).join(' / ');\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError(`Hash '${hash}' is unknown or not supported. Must be ${types}`, 'ERR_UNSUPPORTED_HASH_TYPE');\n }\n const hasher = hashName[hash];\n const dek = node_forge_lib_pbkdf2_js__WEBPACK_IMPORTED_MODULE_1__(password, salt, iterations, keySize, hasher);\n return node_forge_lib_util_js__WEBPACK_IMPORTED_MODULE_2__.encode64(dek, null);\n}\n//# sourceMappingURL=pbkdf2.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/pbkdf2.js?");
/***/ }),
@@ -2762,7 +3235,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ randomBytes)\n/* harmony export */ });\n/* harmony import */ var _noble_secp256k1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @noble/secp256k1 */ \"./node_modules/@noble/secp256k1/lib/esm/index.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n\n\nfunction randomBytes(length) {\n if (isNaN(length) || length <= 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_1__.CodeError('random bytes length must be a Number bigger than 0', 'ERR_INVALID_LENGTH');\n }\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_0__.utils.randomBytes(length);\n}\n//# sourceMappingURL=random-bytes.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/random-bytes.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ randomBytes)\n/* harmony export */ });\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @noble/secp256k1 */ \"./node_modules/@noble/secp256k1/lib/esm/index.js\");\n\n\nfunction randomBytes(length) {\n if (isNaN(length) || length <= 0) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_0__.CodeError('random bytes length must be a Number bigger than 0', 'ERR_INVALID_LENGTH');\n }\n return _noble_secp256k1__WEBPACK_IMPORTED_MODULE_1__.utils.randomBytes(length);\n}\n//# sourceMappingURL=random-bytes.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/random-bytes.js?");
/***/ }),
@@ -2773,7 +3246,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base64urlToBigInteger\": () => (/* binding */ base64urlToBigInteger),\n/* harmony export */ \"base64urlToBuffer\": () => (/* binding */ base64urlToBuffer),\n/* harmony export */ \"bigIntegerToUintBase64url\": () => (/* binding */ bigIntegerToUintBase64url)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/util.js */ \"./node_modules/node-forge/lib/util.js\");\n/* harmony import */ var node_forge_lib_jsbn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/jsbn.js */ \"./node_modules/node-forge/lib/jsbn.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n\n\n// @ts-expect-error types are missing\n\n\n\n\nfunction bigIntegerToUintBase64url(num, len) {\n // Call `.abs()` to convert to unsigned\n let buf = Uint8Array.from(num.abs().toByteArray()); // toByteArray converts to big endian\n // toByteArray() gives us back a signed array, which will include a leading 0\n // byte if the most significant bit of the number is 1:\n // https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-integer\n // Our number will always be positive so we should remove the leading padding.\n buf = buf[0] === 0 ? buf.subarray(1) : buf;\n if (len != null) {\n if (buf.length > len)\n throw new Error('byte array longer than desired length');\n buf = (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_5__.concat)([new Uint8Array(len - buf.length), buf]);\n }\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_4__.toString)(buf, 'base64url');\n}\n// Convert a base64url encoded string to a BigInteger\nfunction base64urlToBigInteger(str) {\n const buf = base64urlToBuffer(str);\n return new node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.jsbn.BigInteger((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_4__.toString)(buf, 'base16'), 16);\n}\nfunction base64urlToBuffer(str, len) {\n let buf = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_3__.fromString)(str, 'base64urlpad');\n if (len != null) {\n if (buf.length > len)\n throw new Error('byte array longer than desired length');\n buf = (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_5__.concat)([new Uint8Array(len - buf.length), buf]);\n }\n return buf;\n}\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/util.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base64urlToBigInteger\": () => (/* binding */ base64urlToBigInteger),\n/* harmony export */ \"base64urlToBuffer\": () => (/* binding */ base64urlToBuffer),\n/* harmony export */ \"bigIntegerToUintBase64url\": () => (/* binding */ bigIntegerToUintBase64url)\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/util.js */ \"./node_modules/node-forge/lib/util.js\");\n/* harmony import */ var node_forge_lib_jsbn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/jsbn.js */ \"./node_modules/node-forge/lib/jsbn.js\");\n/* harmony import */ var node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node-forge/lib/forge.js */ \"./node_modules/node-forge/lib/forge.js\");\n/* harmony import */ var uint8arrays_concat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uint8arrays/concat */ \"./node_modules/uint8arrays/dist/src/concat.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arrays/to-string */ \"./node_modules/uint8arrays/dist/src/to-string.js\");\n\n\n// @ts-expect-error types are missing\n\n\n\n\nfunction bigIntegerToUintBase64url(num, len) {\n // Call `.abs()` to convert to unsigned\n let buf = Uint8Array.from(num.abs().toByteArray()); // toByteArray converts to big endian\n // toByteArray() gives us back a signed array, which will include a leading 0\n // byte if the most significant bit of the number is 1:\n // https://docs.microsoft.com/en-us/windows/win32/seccertenroll/about-integer\n // Our number will always be positive so we should remove the leading padding.\n buf = buf[0] === 0 ? buf.subarray(1) : buf;\n if (len != null) {\n if (buf.length > len)\n throw new Error('byte array longer than desired length');\n buf = (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_3__.concat)([new Uint8Array(len - buf.length), buf]);\n }\n return (0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__.toString)(buf, 'base64url');\n}\n// Convert a base64url encoded string to a BigInteger\nfunction base64urlToBigInteger(str) {\n const buf = base64urlToBuffer(str);\n return new node_forge_lib_forge_js__WEBPACK_IMPORTED_MODULE_2__.jsbn.BigInteger((0,uint8arrays_to_string__WEBPACK_IMPORTED_MODULE_5__.toString)(buf, 'base16'), 16);\n}\nfunction base64urlToBuffer(str, len) {\n let buf = (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(str, 'base64urlpad');\n if (len != null) {\n if (buf.length > len)\n throw new Error('byte array longer than desired length');\n buf = (0,uint8arrays_concat__WEBPACK_IMPORTED_MODULE_3__.concat)([new Uint8Array(len - buf.length), buf]);\n }\n return buf;\n}\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/dist/src/util.js?");
/***/ }),
@@ -2788,212 +3261,14 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ }),
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Codec\": () => (/* binding */ Codec),\n/* harmony export */ \"baseX\": () => (/* binding */ baseX),\n/* harmony export */ \"from\": () => (/* binding */ from),\n/* harmony export */ \"or\": () => (/* binding */ or),\n/* harmony export */ \"rfc4648\": () => (/* binding */ rfc4648)\n/* harmony export */ });\n/* harmony import */ var _vendor_base_x_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vendor/base-x.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/base-x.js\");\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bytes.js\");\n/* harmony import */ var _interface_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interface.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/interface.js\");\n\n\n// Linter can't see that API is used in types.\n// eslint-disable-next-line\n\n\n/**\n * Class represents both BaseEncoder and MultibaseEncoder meaning it\n * can be used to encode to multibase or base encode without multibase\n * prefix.\n *\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseEncoder}\n * @implements {API.BaseEncoder}\n */\nclass Encoder {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(bytes:Uint8Array) => string} baseEncode\n */\n constructor (name, prefix, baseEncode) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {API.Multibase}\n */\n encode (bytes) {\n if (bytes instanceof Uint8Array) {\n return `${this.prefix}${this.baseEncode(bytes)}`\n } else {\n throw Error('Unknown type, must be binary type')\n }\n }\n}\n\n/**\n * @template {string} Prefix\n */\n/**\n * Class represents both BaseDecoder and MultibaseDecoder so it could be used\n * to decode multibases (with matching prefix) or just base decode strings\n * with corresponding base encoding.\n *\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseDecoder}\n * @implements {API.UnibaseDecoder}\n * @implements {API.BaseDecoder}\n */\nclass Decoder {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(text:string) => Uint8Array} baseDecode\n */\n constructor (name, prefix, baseDecode) {\n this.name = name\n this.prefix = prefix\n /* c8 ignore next 3 */\n if (prefix.codePointAt(0) === undefined) {\n throw new Error('Invalid prefix character')\n }\n /** @private */\n this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0))\n this.baseDecode = baseDecode\n }\n\n /**\n * @param {string} text\n */\n decode (text) {\n if (typeof text === 'string') {\n if (text.codePointAt(0) !== this.prefixCodePoint) {\n throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)\n }\n return this.baseDecode(text.slice(this.prefix.length))\n } else {\n throw Error('Can only multibase decode strings')\n }\n }\n\n /**\n * @template {string} OtherPrefix\n * @param {API.UnibaseDecoder|ComposedDecoder} decoder\n * @returns {ComposedDecoder}\n */\n or (decoder) {\n return or(this, decoder)\n }\n}\n\n/**\n * @template {string} Prefix\n * @typedef {Record>} Decoders\n */\n\n/**\n * @template {string} Prefix\n * @implements {API.MultibaseDecoder}\n * @implements {API.CombobaseDecoder}\n */\nclass ComposedDecoder {\n /**\n * @param {Decoders} decoders\n */\n constructor (decoders) {\n this.decoders = decoders\n }\n\n /**\n * @template {string} OtherPrefix\n * @param {API.UnibaseDecoder|ComposedDecoder} decoder\n * @returns {ComposedDecoder}\n */\n or (decoder) {\n return or(this, decoder)\n }\n\n /**\n * @param {string} input\n * @returns {Uint8Array}\n */\n decode (input) {\n const prefix = /** @type {Prefix} */ (input[0])\n const decoder = this.decoders[prefix]\n if (decoder) {\n return decoder.decode(input)\n } else {\n throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)\n }\n }\n}\n\n/**\n * @template {string} L\n * @template {string} R\n * @param {API.UnibaseDecoder|API.CombobaseDecoder} left\n * @param {API.UnibaseDecoder|API.CombobaseDecoder} right\n * @returns {ComposedDecoder}\n */\nconst or = (left, right) => new ComposedDecoder(/** @type {Decoders} */({\n ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }),\n ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right })\n}))\n\n/**\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseCodec}\n * @implements {API.MultibaseEncoder}\n * @implements {API.MultibaseDecoder}\n * @implements {API.BaseCodec}\n * @implements {API.BaseEncoder}\n * @implements {API.BaseDecoder}\n */\nclass Codec {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(bytes:Uint8Array) => string} baseEncode\n * @param {(text:string) => Uint8Array} baseDecode\n */\n constructor (name, prefix, baseEncode, baseDecode) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n this.baseDecode = baseDecode\n this.encoder = new Encoder(name, prefix, baseEncode)\n this.decoder = new Decoder(name, prefix, baseDecode)\n }\n\n /**\n * @param {Uint8Array} input\n */\n encode (input) {\n return this.encoder.encode(input)\n }\n\n /**\n * @param {string} input\n */\n decode (input) {\n return this.decoder.decode(input)\n }\n}\n\n/**\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {(bytes:Uint8Array) => string} options.encode\n * @param {(input:string) => Uint8Array} options.decode\n * @returns {Codec}\n */\nconst from = ({ name, prefix, encode, decode }) =>\n new Codec(name, prefix, encode, decode)\n\n/**\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {string} options.alphabet\n * @returns {Codec}\n */\nconst baseX = ({ prefix, name, alphabet }) => {\n const { encode, decode } = (0,_vendor_base_x_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(alphabet, name)\n return from({\n prefix,\n name,\n encode,\n /**\n * @param {string} text\n */\n decode: text => (0,_bytes_js__WEBPACK_IMPORTED_MODULE_1__.coerce)(decode(text))\n })\n}\n\n/**\n * @param {string} string\n * @param {string} alphabet\n * @param {number} bitsPerChar\n * @param {string} name\n * @returns {Uint8Array}\n */\nconst decode = (string, alphabet, bitsPerChar, name) => {\n // Build the character lookup table:\n /** @type {Record} */\n const codes = {}\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i\n }\n\n // Count the padding bytes:\n let end = string.length\n while (string[end - 1] === '=') {\n --end\n }\n\n // Allocate the output:\n const out = new Uint8Array((end * bitsPerChar / 8) | 0)\n\n // Parse the data:\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n let written = 0 // Next byte to write\n for (let i = 0; i < end; ++i) {\n // Read one character from the string:\n const value = codes[string[i]]\n if (value === undefined) {\n throw new SyntaxError(`Non-${name} character`)\n }\n\n // Append the bits to the buffer:\n buffer = (buffer << bitsPerChar) | value\n bits += bitsPerChar\n\n // Write out some bits if the buffer has a byte's worth:\n if (bits >= 8) {\n bits -= 8\n out[written++] = 0xff & (buffer >> bits)\n }\n }\n\n // Verify that we have received just enough bits:\n if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) {\n throw new SyntaxError('Unexpected end of data')\n }\n\n return out\n}\n\n/**\n * @param {Uint8Array} data\n * @param {string} alphabet\n * @param {number} bitsPerChar\n * @returns {string}\n */\nconst encode = (data, alphabet, bitsPerChar) => {\n const pad = alphabet[alphabet.length - 1] === '='\n const mask = (1 << bitsPerChar) - 1\n let out = ''\n\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n for (let i = 0; i < data.length; ++i) {\n // Slurp data into the buffer:\n buffer = (buffer << 8) | data[i]\n bits += 8\n\n // Write out as much as we can:\n while (bits > bitsPerChar) {\n bits -= bitsPerChar\n out += alphabet[mask & (buffer >> bits)]\n }\n }\n\n // Partial character:\n if (bits) {\n out += alphabet[mask & (buffer << (bitsPerChar - bits))]\n }\n\n // Add padding characters until we hit a byte boundary:\n if (pad) {\n while ((out.length * bitsPerChar) & 7) {\n out += '='\n }\n }\n\n return out\n}\n\n/**\n * RFC4648 Factory\n *\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {string} options.alphabet\n * @param {number} options.bitsPerChar\n */\nconst rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => {\n return from({\n prefix,\n name,\n encode (input) {\n return encode(input, alphabet, bitsPerChar)\n },\n decode (input) {\n return decode(input, alphabet, bitsPerChar, name)\n }\n })\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base58.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base58.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base58btc\": () => (/* binding */ base58btc),\n/* harmony export */ \"base58flickr\": () => (/* binding */ base58flickr)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base.js\");\n\n\nconst base58btc = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n})\n\nconst base58flickr = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n})\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base58.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base64.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base64.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base64\": () => (/* binding */ base64),\n/* harmony export */ \"base64pad\": () => (/* binding */ base64pad),\n/* harmony export */ \"base64url\": () => (/* binding */ base64url),\n/* harmony export */ \"base64urlpad\": () => (/* binding */ base64urlpad)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base.js\");\n// @ts-check\n\n\n\nconst base64 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'm',\n name: 'base64',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n bitsPerChar: 6\n})\n\nconst base64pad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'M',\n name: 'base64pad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n bitsPerChar: 6\n})\n\nconst base64url = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'u',\n name: 'base64url',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n bitsPerChar: 6\n})\n\nconst base64urlpad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'U',\n name: 'base64urlpad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',\n bitsPerChar: 6\n})\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/base64.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/interface.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/interface.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n// this is dummy module overlayed by interface.ts\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/bases/interface.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/bytes.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/bytes.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"coerce\": () => (/* binding */ coerce),\n/* harmony export */ \"empty\": () => (/* binding */ empty),\n/* harmony export */ \"equals\": () => (/* binding */ equals),\n/* harmony export */ \"fromHex\": () => (/* binding */ fromHex),\n/* harmony export */ \"fromString\": () => (/* binding */ fromString),\n/* harmony export */ \"isBinary\": () => (/* binding */ isBinary),\n/* harmony export */ \"toHex\": () => (/* binding */ toHex),\n/* harmony export */ \"toString\": () => (/* binding */ toString)\n/* harmony export */ });\nconst empty = new Uint8Array(0)\n\n/**\n * @param {Uint8Array} d\n */\nconst toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')\n\n/**\n * @param {string} hex\n */\nconst fromHex = hex => {\n const hexes = hex.match(/../g)\n return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty\n}\n\n/**\n * @param {Uint8Array} aa\n * @param {Uint8Array} bb\n */\nconst equals = (aa, bb) => {\n if (aa === bb) return true\n if (aa.byteLength !== bb.byteLength) {\n return false\n }\n\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o\n * @returns {Uint8Array}\n */\nconst coerce = o => {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o\n if (o instanceof ArrayBuffer) return new Uint8Array(o)\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)\n }\n throw new Error('Unknown type, must be binary type')\n}\n\n/**\n * @param {any} o\n * @returns {o is ArrayBuffer|ArrayBufferView}\n */\nconst isBinary = o =>\n o instanceof ArrayBuffer || ArrayBuffer.isView(o)\n\n/**\n * @param {string} str\n * @returns {Uint8Array}\n */\nconst fromString = str => (new TextEncoder()).encode(str)\n\n/**\n * @param {Uint8Array} b\n * @returns {string}\n */\nconst toString = b => (new TextDecoder()).decode(b)\n\n\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/bytes.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/digest.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/digest.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Digest\": () => (/* binding */ Digest),\n/* harmony export */ \"create\": () => (/* binding */ create),\n/* harmony export */ \"decode\": () => (/* binding */ decode),\n/* harmony export */ \"equals\": () => (/* binding */ equals)\n/* harmony export */ });\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bytes.js\");\n/* harmony import */ var _varint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../varint.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/varint.js\");\n\n\n\n/**\n * Creates a multihash digest.\n *\n * @template {number} Code\n * @param {Code} code\n * @param {Uint8Array} digest\n */\nconst create = (code, digest) => {\n const size = digest.byteLength\n const sizeOffset = _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodingLength(code)\n const digestOffset = sizeOffset + _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodingLength(size)\n\n const bytes = new Uint8Array(digestOffset + size)\n _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodeTo(code, bytes, 0)\n _varint_js__WEBPACK_IMPORTED_MODULE_1__.encodeTo(size, bytes, sizeOffset)\n bytes.set(digest, digestOffset)\n\n return new Digest(code, size, digest, bytes)\n}\n\n/**\n * Turns bytes representation of multihash digest into an instance.\n *\n * @param {Uint8Array} multihash\n * @returns {MultihashDigest}\n */\nconst decode = (multihash) => {\n const bytes = (0,_bytes_js__WEBPACK_IMPORTED_MODULE_0__.coerce)(multihash)\n const [code, sizeOffset] = _varint_js__WEBPACK_IMPORTED_MODULE_1__.decode(bytes)\n const [size, digestOffset] = _varint_js__WEBPACK_IMPORTED_MODULE_1__.decode(bytes.subarray(sizeOffset))\n const digest = bytes.subarray(sizeOffset + digestOffset)\n\n if (digest.byteLength !== size) {\n throw new Error('Incorrect length')\n }\n\n return new Digest(code, size, digest, bytes)\n}\n\n/**\n * @param {MultihashDigest} a\n * @param {unknown} b\n * @returns {b is MultihashDigest}\n */\nconst equals = (a, b) => {\n if (a === b) {\n return true\n } else {\n const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b)\n\n return (\n a.code === data.code &&\n a.size === data.size &&\n data.bytes instanceof Uint8Array &&\n (0,_bytes_js__WEBPACK_IMPORTED_MODULE_0__.equals)(a.bytes, data.bytes)\n )\n }\n}\n\n/**\n * @typedef {import('./interface.js').MultihashDigest} MultihashDigest\n */\n\n/**\n * Represents a multihash digest which carries information about the\n * hashing algorithm and an actual hash digest.\n *\n * @template {number} Code\n * @template {number} Size\n * @class\n * @implements {MultihashDigest}\n */\nclass Digest {\n /**\n * Creates a multihash digest.\n *\n * @param {Code} code\n * @param {Size} size\n * @param {Uint8Array} digest\n * @param {Uint8Array} bytes\n */\n constructor (code, size, digest, bytes) {\n this.code = code\n this.size = size\n this.digest = digest\n this.bytes = bytes\n }\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/digest.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/hasher.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/hasher.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Hasher\": () => (/* binding */ Hasher),\n/* harmony export */ \"from\": () => (/* binding */ from)\n/* harmony export */ });\n/* harmony import */ var _digest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./digest.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/digest.js\");\n\n\n/**\n * @template {string} Name\n * @template {number} Code\n * @param {object} options\n * @param {Name} options.name\n * @param {Code} options.code\n * @param {(input: Uint8Array) => Await} options.encode\n */\nconst from = ({ name, code, encode }) => new Hasher(name, code, encode)\n\n/**\n * Hasher represents a hashing algorithm implementation that produces as\n * `MultihashDigest`.\n *\n * @template {string} Name\n * @template {number} Code\n * @class\n * @implements {MultihashHasher}\n */\nclass Hasher {\n /**\n *\n * @param {Name} name\n * @param {Code} code\n * @param {(input: Uint8Array) => Await} encode\n */\n constructor (name, code, encode) {\n this.name = name\n this.code = code\n this.encode = encode\n }\n\n /**\n * @param {Uint8Array} input\n * @returns {Await>}\n */\n digest (input) {\n if (input instanceof Uint8Array) {\n const result = this.encode(input)\n return result instanceof Uint8Array\n ? _digest_js__WEBPACK_IMPORTED_MODULE_0__.create(this.code, result)\n /* c8 ignore next 1 */\n : result.then(digest => _digest_js__WEBPACK_IMPORTED_MODULE_0__.create(this.code, digest))\n } else {\n throw Error('Unknown type, must be binary type')\n /* c8 ignore next 1 */\n }\n }\n}\n\n/**\n * @template {number} Alg\n * @typedef {import('./interface.js').MultihashHasher} MultihashHasher\n */\n\n/**\n * @template T\n * @typedef {Promise|T} Await\n */\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/hasher.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/identity.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/identity.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"identity\": () => (/* binding */ identity)\n/* harmony export */ });\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/bytes.js\");\n/* harmony import */ var _digest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./digest.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/digest.js\");\n\n\n\nconst code = 0x0\nconst name = 'identity'\n\n/** @type {(input:Uint8Array) => Uint8Array} */\nconst encode = _bytes_js__WEBPACK_IMPORTED_MODULE_0__.coerce\n\n/**\n * @param {Uint8Array} input\n * @returns {Digest.Digest}\n */\nconst digest = (input) => _digest_js__WEBPACK_IMPORTED_MODULE_1__.create(code, encode(input))\n\nconst identity = { code, name, encode, digest }\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/identity.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/sha2-browser.js":
-/*!******************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/sha2-browser.js ***!
- \******************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"sha256\": () => (/* binding */ sha256),\n/* harmony export */ \"sha512\": () => (/* binding */ sha512)\n/* harmony export */ });\n/* harmony import */ var _hasher_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hasher.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/hasher.js\");\n/* global crypto */\n\n\n\n/**\n * @param {AlgorithmIdentifier} name\n */\nconst sha = name =>\n /**\n * @param {Uint8Array} data\n */\n async data => new Uint8Array(await crypto.subtle.digest(name, data))\n\nconst sha256 = (0,_hasher_js__WEBPACK_IMPORTED_MODULE_0__.from)({\n name: 'sha2-256',\n code: 0x12,\n encode: sha('SHA-256')\n})\n\nconst sha512 = (0,_hasher_js__WEBPACK_IMPORTED_MODULE_0__.from)({\n name: 'sha2-512',\n code: 0x13,\n encode: sha('SHA-512')\n})\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/hashes/sha2-browser.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/src/varint.js":
-/*!*****************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/src/varint.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decode\": () => (/* binding */ decode),\n/* harmony export */ \"encodeTo\": () => (/* binding */ encodeTo),\n/* harmony export */ \"encodingLength\": () => (/* binding */ encodingLength)\n/* harmony export */ });\n/* harmony import */ var _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vendor/varint.js */ \"./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/varint.js\");\n\n\n/**\n * @param {Uint8Array} data\n * @param {number} [offset=0]\n * @returns {[number, number]}\n */\nconst decode = (data, offset = 0) => {\n const code = _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].decode(data, offset)\n return [code, _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].decode.bytes]\n}\n\n/**\n * @param {number} int\n * @param {Uint8Array} target\n * @param {number} [offset=0]\n */\nconst encodeTo = (int, target, offset = 0) => {\n _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].encode(int, target, offset)\n return target\n}\n\n/**\n * @param {number} int\n * @returns {number}\n */\nconst encodingLength = (int) => {\n return _vendor_varint_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].encodingLength(int)\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/src/varint.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/base-x.js":
+/***/ "./node_modules/@libp2p/interface-connection-encrypter/dist/src/errors.js":
/*!********************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/base-x.js ***!
+ !*** ./node_modules/@libp2p/interface-connection-encrypter/dist/src/errors.js ***!
\********************************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET, name) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up\n function encode (source) {\n if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;\n var b58 = new Uint8Array(size);\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin];\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0;\n b58[it1] = (carry % BASE) >>> 0;\n carry = (carry / BASE) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n pbegin++;\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0;\n // Skip leading spaces.\n if (source[psz] === ' ') { return }\n // Skip and count leading '1's.\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size);\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)];\n // Invalid character\n if (carry === 255) { return }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0;\n b256[it3] = (carry % 256) >>> 0;\n carry = (carry / 256) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n psz++;\n }\n // Skip trailing spaces.\n if (source[psz] === ' ') { return }\n // Skip leading zeroes in b256.\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string);\n if (buffer) { return buffer }\n throw new Error(`Non-${name} character`)\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nvar src = base;\n\nvar _brrp__multiformats_scope_baseX = src;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_brrp__multiformats_scope_baseX);\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/base-x.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/varint.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/varint.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nvar encode_1 = encode;\n\nvar MSB = 0x80\n , REST = 0x7F\n , MSBALL = ~REST\n , INT = Math.pow(2, 31);\n\nfunction encode(num, out, offset) {\n out = out || [];\n offset = offset || 0;\n var oldOffset = offset;\n\n while(num >= INT) {\n out[offset++] = (num & 0xFF) | MSB;\n num /= 128;\n }\n while(num & MSBALL) {\n out[offset++] = (num & 0xFF) | MSB;\n num >>>= 7;\n }\n out[offset] = num | 0;\n \n encode.bytes = offset - oldOffset + 1;\n \n return out\n}\n\nvar decode = read;\n\nvar MSB$1 = 0x80\n , REST$1 = 0x7F;\n\nfunction read(buf, offset) {\n var res = 0\n , offset = offset || 0\n , shift = 0\n , counter = offset\n , b\n , l = buf.length;\n\n do {\n if (counter >= l) {\n read.bytes = 0;\n throw new RangeError('Could not decode varint')\n }\n b = buf[counter++];\n res += shift < 28\n ? (b & REST$1) << shift\n : (b & REST$1) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB$1)\n\n read.bytes = counter - offset;\n\n return res\n}\n\nvar N1 = Math.pow(2, 7);\nvar N2 = Math.pow(2, 14);\nvar N3 = Math.pow(2, 21);\nvar N4 = Math.pow(2, 28);\nvar N5 = Math.pow(2, 35);\nvar N6 = Math.pow(2, 42);\nvar N7 = Math.pow(2, 49);\nvar N8 = Math.pow(2, 56);\nvar N9 = Math.pow(2, 63);\n\nvar length = function (value) {\n return (\n value < N1 ? 1\n : value < N2 ? 2\n : value < N3 ? 3\n : value < N4 ? 4\n : value < N5 ? 5\n : value < N6 ? 6\n : value < N7 ? 7\n : value < N8 ? 8\n : value < N9 ? 9\n : 10\n )\n};\n\nvar varint = {\n encode: encode_1\n , decode: decode\n , encodingLength: length\n};\n\nvar _brrp_varint = varint;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_brrp_varint);\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/multiformats/vendor/varint.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codec.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codec.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CODEC_TYPES\": () => (/* binding */ CODEC_TYPES),\n/* harmony export */ \"createCodec\": () => (/* binding */ createCodec)\n/* harmony export */ });\n// https://developers.google.com/protocol-buffers/docs/encoding#structure\nvar CODEC_TYPES;\n(function (CODEC_TYPES) {\n CODEC_TYPES[CODEC_TYPES[\"VARINT\"] = 0] = \"VARINT\";\n CODEC_TYPES[CODEC_TYPES[\"BIT64\"] = 1] = \"BIT64\";\n CODEC_TYPES[CODEC_TYPES[\"LENGTH_DELIMITED\"] = 2] = \"LENGTH_DELIMITED\";\n CODEC_TYPES[CODEC_TYPES[\"START_GROUP\"] = 3] = \"START_GROUP\";\n CODEC_TYPES[CODEC_TYPES[\"END_GROUP\"] = 4] = \"END_GROUP\";\n CODEC_TYPES[CODEC_TYPES[\"BIT32\"] = 5] = \"BIT32\";\n})(CODEC_TYPES || (CODEC_TYPES = {}));\nfunction createCodec(name, type, encode, decode) {\n return {\n name,\n type,\n encode,\n decode\n };\n}\n//# sourceMappingURL=codec.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codec.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/enum.js":
-/*!******************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/enum.js ***!
- \******************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"enumeration\": () => (/* binding */ enumeration)\n/* harmony export */ });\n/* harmony import */ var _codec_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../codec.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codec.js\");\n\nfunction enumeration(v) {\n function findValue(val) {\n // Use the reverse mapping to look up the enum key for the stored value\n // https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings\n if (v[val.toString()] == null) {\n throw new Error('Invalid enum value');\n }\n return v[val];\n }\n const encode = function enumEncode(val, writer) {\n const enumValue = findValue(val);\n writer.int32(enumValue);\n };\n const decode = function enumDecode(reader) {\n const val = reader.int32();\n return findValue(val);\n };\n // @ts-expect-error yeah yeah\n return (0,_codec_js__WEBPACK_IMPORTED_MODULE_0__.createCodec)('enum', _codec_js__WEBPACK_IMPORTED_MODULE_0__.CODEC_TYPES.VARINT, encode, decode);\n}\n//# sourceMappingURL=enum.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/enum.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/message.js":
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/message.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"message\": () => (/* binding */ message)\n/* harmony export */ });\n/* harmony import */ var _codec_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../codec.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codec.js\");\n\nfunction message(encode, decode) {\n return (0,_codec_js__WEBPACK_IMPORTED_MODULE_0__.createCodec)('message', _codec_js__WEBPACK_IMPORTED_MODULE_0__.CODEC_TYPES.LENGTH_DELIMITED, encode, decode);\n}\n//# sourceMappingURL=message.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/message.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/decode.js":
-/*!*************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/decode.js ***!
- \*************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decodeMessage\": () => (/* binding */ decodeMessage)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/utils.js\");\n\nfunction decodeMessage(buf, codec) {\n const r = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.reader)(buf instanceof Uint8Array ? buf : buf.subarray());\n return codec.decode(r);\n}\n//# sourceMappingURL=decode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/decode.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/encode.js":
-/*!*************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/encode.js ***!
- \*************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"encodeMessage\": () => (/* binding */ encodeMessage)\n/* harmony export */ });\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/utils.js\");\n\nfunction encodeMessage(message, codec) {\n const w = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.writer)();\n codec.encode(message, w, {\n lengthDelimited: false\n });\n return w.finish();\n}\n//# sourceMappingURL=encode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/encode.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/index.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/index.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"decodeMessage\": () => (/* reexport safe */ _decode_js__WEBPACK_IMPORTED_MODULE_0__.decodeMessage),\n/* harmony export */ \"encodeMessage\": () => (/* reexport safe */ _encode_js__WEBPACK_IMPORTED_MODULE_1__.encodeMessage),\n/* harmony export */ \"enumeration\": () => (/* reexport safe */ _codecs_enum_js__WEBPACK_IMPORTED_MODULE_2__.enumeration),\n/* harmony export */ \"message\": () => (/* reexport safe */ _codecs_message_js__WEBPACK_IMPORTED_MODULE_3__.message),\n/* harmony export */ \"reader\": () => (/* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_4__.reader),\n/* harmony export */ \"writer\": () => (/* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_4__.writer)\n/* harmony export */ });\n/* harmony import */ var _decode_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decode.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/decode.js\");\n/* harmony import */ var _encode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./encode.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/encode.js\");\n/* harmony import */ var _codecs_enum_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./codecs/enum.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/enum.js\");\n/* harmony import */ var _codecs_message_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./codecs/message.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/codecs/message.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils.js */ \"./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/utils.js\");\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/index.js?");
-
-/***/ }),
-
-/***/ "./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/utils.js":
-/*!************************************************************************************!*\
- !*** ./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/utils.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"reader\": () => (/* binding */ reader),\n/* harmony export */ \"writer\": () => (/* binding */ writer)\n/* harmony export */ });\n/* harmony import */ var protobufjs_src_reader_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! protobufjs/src/reader.js */ \"./node_modules/protobufjs/src/reader.js\");\n/* harmony import */ var protobufjs_src_reader_buffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! protobufjs/src/reader_buffer.js */ \"./node_modules/protobufjs/src/reader_buffer.js\");\n/* harmony import */ var protobufjs_src_util_minimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! protobufjs/src/util/minimal.js */ \"./node_modules/protobufjs/src/util/minimal.js\");\n/* harmony import */ var protobufjs_src_writer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! protobufjs/src/writer.js */ \"./node_modules/protobufjs/src/writer.js\");\n/* harmony import */ var protobufjs_src_writer_buffer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! protobufjs/src/writer_buffer.js */ \"./node_modules/protobufjs/src/writer_buffer.js\");\n// @ts-expect-error no types\n\n// @ts-expect-error no types\n\n// @ts-expect-error no types\n\n// @ts-expect-error no types\n\n// @ts-expect-error no types\n\nfunction configure() {\n protobufjs_src_util_minimal_js__WEBPACK_IMPORTED_MODULE_2__._configure();\n protobufjs_src_reader_js__WEBPACK_IMPORTED_MODULE_0__._configure(protobufjs_src_reader_buffer_js__WEBPACK_IMPORTED_MODULE_1__);\n protobufjs_src_writer_js__WEBPACK_IMPORTED_MODULE_3__._configure(protobufjs_src_writer_buffer_js__WEBPACK_IMPORTED_MODULE_4__);\n}\n// Set up buffer utility according to the environment\nconfigure();\n// monkey patch the reader to add native bigint support\nconst methods = [\n 'uint64', 'int64', 'sint64', 'fixed64', 'sfixed64'\n];\nfunction patchReader(obj) {\n for (const method of methods) {\n if (obj[method] == null) {\n continue;\n }\n const original = obj[method];\n obj[method] = function () {\n return BigInt(original.call(this).toString());\n };\n }\n return obj;\n}\nfunction reader(buf) {\n return patchReader(new protobufjs_src_reader_js__WEBPACK_IMPORTED_MODULE_0__(buf));\n}\nfunction patchWriter(obj) {\n for (const method of methods) {\n if (obj[method] == null) {\n continue;\n }\n const original = obj[method];\n obj[method] = function (val) {\n return original.call(this, val.toString());\n };\n }\n return obj;\n}\nfunction writer() {\n return patchWriter(protobufjs_src_writer_js__WEBPACK_IMPORTED_MODULE_3__.create());\n}\n//# sourceMappingURL=utils.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/crypto/node_modules/protons-runtime/dist/src/utils.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"InvalidCryptoExchangeError\": () => (/* binding */ InvalidCryptoExchangeError),\n/* harmony export */ \"InvalidCryptoTransmissionError\": () => (/* binding */ InvalidCryptoTransmissionError),\n/* harmony export */ \"UnexpectedPeerError\": () => (/* binding */ UnexpectedPeerError)\n/* harmony export */ });\nclass UnexpectedPeerError extends Error {\n constructor(message = 'Unexpected Peer') {\n super(message);\n this.code = UnexpectedPeerError.code;\n }\n static get code() {\n return 'ERR_UNEXPECTED_PEER';\n }\n}\nclass InvalidCryptoExchangeError extends Error {\n constructor(message = 'Invalid crypto exchange') {\n super(message);\n this.code = InvalidCryptoExchangeError.code;\n }\n static get code() {\n return 'ERR_INVALID_CRYPTO_EXCHANGE';\n }\n}\nclass InvalidCryptoTransmissionError extends Error {\n constructor(message = 'Invalid crypto transmission') {\n super(message);\n this.code = InvalidCryptoTransmissionError.code;\n }\n static get code() {\n return 'ERR_INVALID_CRYPTO_TRANSMISSION';\n }\n}\n//# sourceMappingURL=errors.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interface-connection-encrypter/dist/src/errors.js?");
/***/ }),
@@ -3004,7 +3279,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"isPeerDiscovery\": () => (/* binding */ isPeerDiscovery),\n/* harmony export */ \"symbol\": () => (/* binding */ symbol)\n/* harmony export */ });\nconst symbol = Symbol.for('@libp2p/peer-discovery');\nfunction isPeerDiscovery(other) {\n return other != null && Boolean(other[symbol]);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interface-peer-discovery/dist/src/index.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"isPeerDiscovery\": () => (/* binding */ isPeerDiscovery),\n/* harmony export */ \"peerDiscovery\": () => (/* binding */ peerDiscovery),\n/* harmony export */ \"symbol\": () => (/* binding */ symbol)\n/* harmony export */ });\n/**\n * Any object that implements this Symbol as a property should return a\n * PeerDiscovery instance as the property value, similar to how\n * `Symbol.Iterable` can be used to return an `Iterable` from an `Iterator`.\n *\n * @example\n *\n * ```js\n * import { peerDiscovery, PeerDiscovery } from '@libp2p/peer-discovery'\n *\n * class MyPeerDiscoverer implements PeerDiscovery {\n * get [peerDiscovery] () {\n * return this\n * }\n *\n * // ...other methods\n * }\n * ```\n */\nconst peerDiscovery = Symbol.for('@libp2p/peer-discovery');\nconst symbol = Symbol.for('@libp2p/peer-discovery');\nfunction isPeerDiscovery(other) {\n return other != null && Boolean(other[symbol]);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interface-peer-discovery/dist/src/index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/@libp2p/interface-peer-id/dist/src/index.js":
+/*!******************************************************************!*\
+ !*** ./node_modules/@libp2p/interface-peer-id/dist/src/index.js ***!
+ \******************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"isPeerId\": () => (/* binding */ isPeerId),\n/* harmony export */ \"symbol\": () => (/* binding */ symbol)\n/* harmony export */ });\nconst symbol = Symbol.for('@libp2p/peer-id');\nfunction isPeerId(other) {\n return other != null && Boolean(other[symbol]);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interface-peer-id/dist/src/index.js?");
/***/ }),
@@ -3019,6 +3305,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ }),
+/***/ "./node_modules/@libp2p/interface-pubsub/dist/src/index.js":
+/*!*****************************************************************!*\
+ !*** ./node_modules/@libp2p/interface-pubsub/dist/src/index.js ***!
+ \*****************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StrictNoSign\": () => (/* binding */ StrictNoSign),\n/* harmony export */ \"StrictSign\": () => (/* binding */ StrictSign),\n/* harmony export */ \"TopicValidatorResult\": () => (/* binding */ TopicValidatorResult)\n/* harmony export */ });\n/**\n * On the producing side:\n * * Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields.\n *\n * On the consuming side:\n * * Enforce the fields to be present, reject otherwise.\n * * Propagate only if the fields are valid and signature can be verified, reject otherwise.\n */\nconst StrictSign = 'StrictSign';\n/**\n * On the producing side:\n * * Build messages without the signature, key, from and seqno fields.\n * * The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty.\n *\n * On the consuming side:\n * * Enforce the fields to be absent, reject otherwise.\n * * Propagate only if the fields are absent, reject otherwise.\n * * A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash.\n */\nconst StrictNoSign = 'StrictNoSign';\nvar TopicValidatorResult;\n(function (TopicValidatorResult) {\n /**\n * The message is considered valid, and it should be delivered and forwarded to the network\n */\n TopicValidatorResult[\"Accept\"] = \"accept\";\n /**\n * The message is neither delivered nor forwarded to the network\n */\n TopicValidatorResult[\"Ignore\"] = \"ignore\";\n /**\n * The message is considered invalid, and it should be rejected\n */\n TopicValidatorResult[\"Reject\"] = \"reject\";\n})(TopicValidatorResult || (TopicValidatorResult = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interface-pubsub/dist/src/index.js?");
+
+/***/ }),
+
/***/ "./node_modules/@libp2p/interface-registrar/dist/src/index.js":
/*!********************************************************************!*\
!*** ./node_modules/@libp2p/interface-registrar/dist/src/index.js ***!
@@ -3030,6 +3327,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ }),
+/***/ "./node_modules/@libp2p/interface-transport/dist/src/index.js":
+/*!********************************************************************!*\
+ !*** ./node_modules/@libp2p/interface-transport/dist/src/index.js ***!
+ \********************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"FaultTolerance\": () => (/* binding */ FaultTolerance),\n/* harmony export */ \"isTransport\": () => (/* binding */ isTransport),\n/* harmony export */ \"symbol\": () => (/* binding */ symbol)\n/* harmony export */ });\nconst symbol = Symbol.for('@libp2p/transport');\nfunction isTransport(other) {\n return other != null && Boolean(other[symbol]);\n}\n/**\n * Enum Transport Manager Fault Tolerance values\n */\nvar FaultTolerance;\n(function (FaultTolerance) {\n /**\n * should be used for failing in any listen circumstance\n */\n FaultTolerance[FaultTolerance[\"FATAL_ALL\"] = 0] = \"FATAL_ALL\";\n /**\n * should be used for not failing when not listening\n */\n FaultTolerance[FaultTolerance[\"NO_FATAL\"] = 1] = \"NO_FATAL\";\n})(FaultTolerance || (FaultTolerance = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interface-transport/dist/src/index.js?");
+
+/***/ }),
+
/***/ "./node_modules/@libp2p/interfaces/dist/src/errors.js":
/*!************************************************************!*\
!*** ./node_modules/@libp2p/interfaces/dist/src/errors.js ***!
@@ -3037,7 +3345,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AbortError\": () => (/* binding */ AbortError),\n/* harmony export */ \"CodeError\": () => (/* binding */ CodeError)\n/* harmony export */ });\n/**\n * When this error is thrown it means an operation was aborted,\n * usually in response to the `abort` event being emitted by an\n * AbortSignal.\n */\nclass AbortError extends Error {\n constructor(message = 'The operation was aborted') {\n super(message);\n this.code = AbortError.code;\n this.type = AbortError.type;\n }\n static get code() {\n return 'ABORT_ERR';\n }\n static get type() {\n return 'aborted';\n }\n}\nclass CodeError extends Error {\n constructor(message, code, props) {\n super(message);\n this.code = code;\n this.name = props?.name ?? 'CodeError';\n this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions\n }\n}\n//# sourceMappingURL=errors.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interfaces/dist/src/errors.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AbortError\": () => (/* binding */ AbortError),\n/* harmony export */ \"CodeError\": () => (/* binding */ CodeError)\n/* harmony export */ });\n/**\n * When this error is thrown it means an operation was aborted,\n * usually in response to the `abort` event being emitted by an\n * AbortSignal.\n */\nclass AbortError extends Error {\n code;\n type;\n constructor(message = 'The operation was aborted') {\n super(message);\n this.code = AbortError.code;\n this.type = AbortError.type;\n }\n static code = 'ABORT_ERR';\n static type = 'aborted';\n}\nclass CodeError extends Error {\n code;\n props;\n constructor(message, code, props) {\n super(message);\n this.code = code;\n this.name = props?.name ?? 'CodeError';\n this.props = props ?? {}; // eslint-disable-line @typescript-eslint/consistent-type-assertions\n }\n}\n//# sourceMappingURL=errors.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interfaces/dist/src/errors.js?");
/***/ }),
@@ -3048,7 +3356,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CustomEvent\": () => (/* binding */ CustomEvent),\n/* harmony export */ \"EventEmitter\": () => (/* binding */ EventEmitter)\n/* harmony export */ });\nvar __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _EventEmitter_listeners;\n/**\n * Adds types to the EventTarget class. Hopefully this won't be necessary forever.\n *\n * https://github.com/microsoft/TypeScript/issues/28357\n * https://github.com/microsoft/TypeScript/issues/43477\n * https://github.com/microsoft/TypeScript/issues/299\n * etc\n */\nclass EventEmitter extends EventTarget {\n constructor() {\n super(...arguments);\n _EventEmitter_listeners.set(this, new Map());\n }\n listenerCount(type) {\n const listeners = __classPrivateFieldGet(this, _EventEmitter_listeners, \"f\").get(type);\n if (listeners == null) {\n return 0;\n }\n return listeners.length;\n }\n addEventListener(type, listener, options) {\n super.addEventListener(type, listener, options);\n let list = __classPrivateFieldGet(this, _EventEmitter_listeners, \"f\").get(type);\n if (list == null) {\n list = [];\n __classPrivateFieldGet(this, _EventEmitter_listeners, \"f\").set(type, list);\n }\n list.push({\n callback: listener,\n once: (options !== true && options !== false && options?.once) ?? false\n });\n }\n removeEventListener(type, listener, options) {\n super.removeEventListener(type.toString(), listener ?? null, options);\n let list = __classPrivateFieldGet(this, _EventEmitter_listeners, \"f\").get(type);\n if (list == null) {\n return;\n }\n list = list.filter(({ callback }) => callback !== listener);\n __classPrivateFieldGet(this, _EventEmitter_listeners, \"f\").set(type, list);\n }\n dispatchEvent(event) {\n const result = super.dispatchEvent(event);\n let list = __classPrivateFieldGet(this, _EventEmitter_listeners, \"f\").get(event.type);\n if (list == null) {\n return result;\n }\n list = list.filter(({ once }) => !once);\n __classPrivateFieldGet(this, _EventEmitter_listeners, \"f\").set(event.type, list);\n return result;\n }\n safeDispatchEvent(type, detail) {\n return this.dispatchEvent(new CustomEvent(type, detail));\n }\n}\n_EventEmitter_listeners = new WeakMap();\n/**\n * CustomEvent is a standard event but it's not supported by node.\n *\n * Remove this when https://github.com/nodejs/node/issues/40678 is closed.\n *\n * Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent\n */\nclass CustomEventPolyfill extends Event {\n constructor(message, data) {\n super(message, data);\n // @ts-expect-error could be undefined\n this.detail = data?.detail;\n }\n}\nconst CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill;\n//# sourceMappingURL=events.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interfaces/dist/src/events.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CustomEvent\": () => (/* binding */ CustomEvent),\n/* harmony export */ \"EventEmitter\": () => (/* binding */ EventEmitter)\n/* harmony export */ });\n/**\n * Adds types to the EventTarget class. Hopefully this won't be necessary forever.\n *\n * https://github.com/microsoft/TypeScript/issues/28357\n * https://github.com/microsoft/TypeScript/issues/43477\n * https://github.com/microsoft/TypeScript/issues/299\n * etc\n */\nclass EventEmitter extends EventTarget {\n #listeners = new Map();\n listenerCount(type) {\n const listeners = this.#listeners.get(type);\n if (listeners == null) {\n return 0;\n }\n return listeners.length;\n }\n addEventListener(type, listener, options) {\n super.addEventListener(type, listener, options);\n let list = this.#listeners.get(type);\n if (list == null) {\n list = [];\n this.#listeners.set(type, list);\n }\n list.push({\n callback: listener,\n once: (options !== true && options !== false && options?.once) ?? false\n });\n }\n removeEventListener(type, listener, options) {\n super.removeEventListener(type.toString(), listener ?? null, options);\n let list = this.#listeners.get(type);\n if (list == null) {\n return;\n }\n list = list.filter(({ callback }) => callback !== listener);\n this.#listeners.set(type, list);\n }\n dispatchEvent(event) {\n const result = super.dispatchEvent(event);\n let list = this.#listeners.get(event.type);\n if (list == null) {\n return result;\n }\n list = list.filter(({ once }) => !once);\n this.#listeners.set(event.type, list);\n return result;\n }\n safeDispatchEvent(type, detail) {\n return this.dispatchEvent(new CustomEvent(type, detail));\n }\n}\n/**\n * CustomEvent is a standard event but it's not supported by node.\n *\n * Remove this when https://github.com/nodejs/node/issues/40678 is closed.\n *\n * Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent\n */\nclass CustomEventPolyfill extends Event {\n /** Returns any custom data event was created with. Typically used for synthetic events. */\n detail;\n constructor(message, data) {\n super(message, data);\n // @ts-expect-error could be undefined\n this.detail = data?.detail;\n }\n}\nconst CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill;\n//# sourceMappingURL=events.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/interfaces/dist/src/events.js?");
/***/ }),
@@ -3070,84 +3378,84 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"disable\": () => (/* binding */ disable),\n/* harmony export */ \"enable\": () => (/* binding */ enable),\n/* harmony export */ \"enabled\": () => (/* binding */ enabled),\n/* harmony export */ \"logger\": () => (/* binding */ logger)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! multiformats/bases/base58 */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base58.js\");\n/* harmony import */ var multiformats_bases_base32__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! multiformats/bases/base32 */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base32.js\");\n/* harmony import */ var multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! multiformats/bases/base64 */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base64.js\");\n\n\n\n\n// Add a formatter for converting to a base58 string\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.b = (v) => {\n return v == null ? 'undefined' : multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_1__.base58btc.baseEncode(v);\n};\n// Add a formatter for converting to a base32 string\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.t = (v) => {\n return v == null ? 'undefined' : multiformats_bases_base32__WEBPACK_IMPORTED_MODULE_2__.base32.baseEncode(v);\n};\n// Add a formatter for converting to a base64 string\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.m = (v) => {\n return v == null ? 'undefined' : multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_3__.base64.baseEncode(v);\n};\n// Add a formatter for stringifying peer ids\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.p = (v) => {\n return v == null ? 'undefined' : v.toString();\n};\n// Add a formatter for stringifying CIDs\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.c = (v) => {\n return v == null ? 'undefined' : v.toString();\n};\n// Add a formatter for stringifying Datastore keys\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.k = (v) => {\n return v == null ? 'undefined' : v.toString();\n};\nfunction createDisabledLogger(namespace) {\n const logger = () => { };\n logger.enabled = false;\n logger.color = '';\n logger.diff = 0;\n logger.log = () => { };\n logger.namespace = namespace;\n logger.destroy = () => true;\n logger.extend = () => logger;\n return logger;\n}\nfunction logger(name) {\n // trace logging is a no-op by default\n let trace = createDisabledLogger(`${name}:trace`);\n // look at all the debug names and see if trace logging has explicitly been enabled\n if (debug__WEBPACK_IMPORTED_MODULE_0__.enabled(`${name}:trace`) && debug__WEBPACK_IMPORTED_MODULE_0__.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) {\n trace = debug__WEBPACK_IMPORTED_MODULE_0__(`${name}:trace`);\n }\n return Object.assign(debug__WEBPACK_IMPORTED_MODULE_0__(name), {\n error: debug__WEBPACK_IMPORTED_MODULE_0__(`${name}:error`),\n trace\n });\n}\nfunction disable() {\n debug__WEBPACK_IMPORTED_MODULE_0__.disable();\n}\nfunction enable(namespaces) {\n debug__WEBPACK_IMPORTED_MODULE_0__.enable(namespaces);\n}\nfunction enabled(namespaces) {\n return debug__WEBPACK_IMPORTED_MODULE_0__.enabled(namespaces);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/dist/src/index.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"disable\": () => (/* binding */ disable),\n/* harmony export */ \"enable\": () => (/* binding */ enable),\n/* harmony export */ \"enabled\": () => (/* binding */ enabled),\n/* harmony export */ \"logger\": () => (/* binding */ logger)\n/* harmony export */ });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! multiformats/bases/base58 */ \"./node_modules/multiformats/src/bases/base58.js\");\n/* harmony import */ var multiformats_bases_base32__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! multiformats/bases/base32 */ \"./node_modules/multiformats/src/bases/base32.js\");\n/* harmony import */ var multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! multiformats/bases/base64 */ \"./node_modules/multiformats/src/bases/base64.js\");\n\n\n\n\n// Add a formatter for converting to a base58 string\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.b = (v) => {\n return v == null ? 'undefined' : multiformats_bases_base58__WEBPACK_IMPORTED_MODULE_1__.base58btc.baseEncode(v);\n};\n// Add a formatter for converting to a base32 string\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.t = (v) => {\n return v == null ? 'undefined' : multiformats_bases_base32__WEBPACK_IMPORTED_MODULE_2__.base32.baseEncode(v);\n};\n// Add a formatter for converting to a base64 string\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.m = (v) => {\n return v == null ? 'undefined' : multiformats_bases_base64__WEBPACK_IMPORTED_MODULE_3__.base64.baseEncode(v);\n};\n// Add a formatter for stringifying peer ids\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.p = (v) => {\n return v == null ? 'undefined' : v.toString();\n};\n// Add a formatter for stringifying CIDs\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.c = (v) => {\n return v == null ? 'undefined' : v.toString();\n};\n// Add a formatter for stringifying Datastore keys\ndebug__WEBPACK_IMPORTED_MODULE_0__.formatters.k = (v) => {\n return v == null ? 'undefined' : v.toString();\n};\nfunction createDisabledLogger(namespace) {\n const logger = () => { };\n logger.enabled = false;\n logger.color = '';\n logger.diff = 0;\n logger.log = () => { };\n logger.namespace = namespace;\n logger.destroy = () => true;\n logger.extend = () => logger;\n return logger;\n}\nfunction logger(name) {\n // trace logging is a no-op by default\n let trace = createDisabledLogger(`${name}:trace`);\n // look at all the debug names and see if trace logging has explicitly been enabled\n if (debug__WEBPACK_IMPORTED_MODULE_0__.enabled(`${name}:trace`) && debug__WEBPACK_IMPORTED_MODULE_0__.names.map(r => r.toString()).find(n => n.includes(':trace')) != null) {\n trace = debug__WEBPACK_IMPORTED_MODULE_0__(`${name}:trace`);\n }\n return Object.assign(debug__WEBPACK_IMPORTED_MODULE_0__(name), {\n error: debug__WEBPACK_IMPORTED_MODULE_0__(`${name}:error`),\n trace\n });\n}\nfunction disable() {\n debug__WEBPACK_IMPORTED_MODULE_0__.disable();\n}\nfunction enable(namespaces) {\n debug__WEBPACK_IMPORTED_MODULE_0__.enable(namespaces);\n}\nfunction enabled(namespaces) {\n return debug__WEBPACK_IMPORTED_MODULE_0__.enabled(namespaces);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/dist/src/index.js?");
/***/ }),
-/***/ "./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js":
-/*!*********************************************************************************!*\
- !*** ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js ***!
- \*********************************************************************************/
+/***/ "./node_modules/@libp2p/mplex/dist/src/alloc-unsafe-browser.js":
+/*!*********************************************************************!*\
+ !*** ./node_modules/@libp2p/mplex/dist/src/alloc-unsafe-browser.js ***!
+ \*********************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Codec\": () => (/* binding */ Codec),\n/* harmony export */ \"baseX\": () => (/* binding */ baseX),\n/* harmony export */ \"from\": () => (/* binding */ from),\n/* harmony export */ \"or\": () => (/* binding */ or),\n/* harmony export */ \"rfc4648\": () => (/* binding */ rfc4648)\n/* harmony export */ });\n/* harmony import */ var _vendor_base_x_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vendor/base-x.js */ \"./node_modules/@libp2p/logger/node_modules/multiformats/vendor/base-x.js\");\n/* harmony import */ var _bytes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../bytes.js */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bytes.js\");\n/* harmony import */ var _interface_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interface.js */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/interface.js\");\n\n\n// Linter can't see that API is used in types.\n// eslint-disable-next-line\n\n\n/**\n * Class represents both BaseEncoder and MultibaseEncoder meaning it\n * can be used to encode to multibase or base encode without multibase\n * prefix.\n *\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseEncoder}\n * @implements {API.BaseEncoder}\n */\nclass Encoder {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(bytes:Uint8Array) => string} baseEncode\n */\n constructor (name, prefix, baseEncode) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {API.Multibase}\n */\n encode (bytes) {\n if (bytes instanceof Uint8Array) {\n return `${this.prefix}${this.baseEncode(bytes)}`\n } else {\n throw Error('Unknown type, must be binary type')\n }\n }\n}\n\n/**\n * @template {string} Prefix\n */\n/**\n * Class represents both BaseDecoder and MultibaseDecoder so it could be used\n * to decode multibases (with matching prefix) or just base decode strings\n * with corresponding base encoding.\n *\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseDecoder}\n * @implements {API.UnibaseDecoder}\n * @implements {API.BaseDecoder}\n */\nclass Decoder {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(text:string) => Uint8Array} baseDecode\n */\n constructor (name, prefix, baseDecode) {\n this.name = name\n this.prefix = prefix\n /* c8 ignore next 3 */\n if (prefix.codePointAt(0) === undefined) {\n throw new Error('Invalid prefix character')\n }\n /** @private */\n this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0))\n this.baseDecode = baseDecode\n }\n\n /**\n * @param {string} text\n */\n decode (text) {\n if (typeof text === 'string') {\n if (text.codePointAt(0) !== this.prefixCodePoint) {\n throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)\n }\n return this.baseDecode(text.slice(this.prefix.length))\n } else {\n throw Error('Can only multibase decode strings')\n }\n }\n\n /**\n * @template {string} OtherPrefix\n * @param {API.UnibaseDecoder|ComposedDecoder} decoder\n * @returns {ComposedDecoder}\n */\n or (decoder) {\n return or(this, decoder)\n }\n}\n\n/**\n * @template {string} Prefix\n * @typedef {Record>} Decoders\n */\n\n/**\n * @template {string} Prefix\n * @implements {API.MultibaseDecoder}\n * @implements {API.CombobaseDecoder}\n */\nclass ComposedDecoder {\n /**\n * @param {Decoders} decoders\n */\n constructor (decoders) {\n this.decoders = decoders\n }\n\n /**\n * @template {string} OtherPrefix\n * @param {API.UnibaseDecoder|ComposedDecoder} decoder\n * @returns {ComposedDecoder}\n */\n or (decoder) {\n return or(this, decoder)\n }\n\n /**\n * @param {string} input\n * @returns {Uint8Array}\n */\n decode (input) {\n const prefix = /** @type {Prefix} */ (input[0])\n const decoder = this.decoders[prefix]\n if (decoder) {\n return decoder.decode(input)\n } else {\n throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)\n }\n }\n}\n\n/**\n * @template {string} L\n * @template {string} R\n * @param {API.UnibaseDecoder|API.CombobaseDecoder} left\n * @param {API.UnibaseDecoder|API.CombobaseDecoder} right\n * @returns {ComposedDecoder}\n */\nconst or = (left, right) => new ComposedDecoder(/** @type {Decoders} */({\n ...(left.decoders || { [/** @type API.UnibaseDecoder */(left).prefix]: left }),\n ...(right.decoders || { [/** @type API.UnibaseDecoder */(right).prefix]: right })\n}))\n\n/**\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseCodec}\n * @implements {API.MultibaseEncoder}\n * @implements {API.MultibaseDecoder}\n * @implements {API.BaseCodec}\n * @implements {API.BaseEncoder}\n * @implements {API.BaseDecoder}\n */\nclass Codec {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(bytes:Uint8Array) => string} baseEncode\n * @param {(text:string) => Uint8Array} baseDecode\n */\n constructor (name, prefix, baseEncode, baseDecode) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n this.baseDecode = baseDecode\n this.encoder = new Encoder(name, prefix, baseEncode)\n this.decoder = new Decoder(name, prefix, baseDecode)\n }\n\n /**\n * @param {Uint8Array} input\n */\n encode (input) {\n return this.encoder.encode(input)\n }\n\n /**\n * @param {string} input\n */\n decode (input) {\n return this.decoder.decode(input)\n }\n}\n\n/**\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {(bytes:Uint8Array) => string} options.encode\n * @param {(input:string) => Uint8Array} options.decode\n * @returns {Codec}\n */\nconst from = ({ name, prefix, encode, decode }) =>\n new Codec(name, prefix, encode, decode)\n\n/**\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {string} options.alphabet\n * @returns {Codec}\n */\nconst baseX = ({ prefix, name, alphabet }) => {\n const { encode, decode } = (0,_vendor_base_x_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(alphabet, name)\n return from({\n prefix,\n name,\n encode,\n /**\n * @param {string} text\n */\n decode: text => (0,_bytes_js__WEBPACK_IMPORTED_MODULE_1__.coerce)(decode(text))\n })\n}\n\n/**\n * @param {string} string\n * @param {string} alphabet\n * @param {number} bitsPerChar\n * @param {string} name\n * @returns {Uint8Array}\n */\nconst decode = (string, alphabet, bitsPerChar, name) => {\n // Build the character lookup table:\n /** @type {Record} */\n const codes = {}\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i\n }\n\n // Count the padding bytes:\n let end = string.length\n while (string[end - 1] === '=') {\n --end\n }\n\n // Allocate the output:\n const out = new Uint8Array((end * bitsPerChar / 8) | 0)\n\n // Parse the data:\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n let written = 0 // Next byte to write\n for (let i = 0; i < end; ++i) {\n // Read one character from the string:\n const value = codes[string[i]]\n if (value === undefined) {\n throw new SyntaxError(`Non-${name} character`)\n }\n\n // Append the bits to the buffer:\n buffer = (buffer << bitsPerChar) | value\n bits += bitsPerChar\n\n // Write out some bits if the buffer has a byte's worth:\n if (bits >= 8) {\n bits -= 8\n out[written++] = 0xff & (buffer >> bits)\n }\n }\n\n // Verify that we have received just enough bits:\n if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) {\n throw new SyntaxError('Unexpected end of data')\n }\n\n return out\n}\n\n/**\n * @param {Uint8Array} data\n * @param {string} alphabet\n * @param {number} bitsPerChar\n * @returns {string}\n */\nconst encode = (data, alphabet, bitsPerChar) => {\n const pad = alphabet[alphabet.length - 1] === '='\n const mask = (1 << bitsPerChar) - 1\n let out = ''\n\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n for (let i = 0; i < data.length; ++i) {\n // Slurp data into the buffer:\n buffer = (buffer << 8) | data[i]\n bits += 8\n\n // Write out as much as we can:\n while (bits > bitsPerChar) {\n bits -= bitsPerChar\n out += alphabet[mask & (buffer >> bits)]\n }\n }\n\n // Partial character:\n if (bits) {\n out += alphabet[mask & (buffer << (bitsPerChar - bits))]\n }\n\n // Add padding characters until we hit a byte boundary:\n if (pad) {\n while ((out.length * bitsPerChar) & 7) {\n out += '='\n }\n }\n\n return out\n}\n\n/**\n * RFC4648 Factory\n *\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {string} options.alphabet\n * @param {number} options.bitsPerChar\n */\nconst rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => {\n return from({\n prefix,\n name,\n encode (input) {\n return encode(input, alphabet, bitsPerChar)\n },\n decode (input) {\n return decode(input, alphabet, bitsPerChar, name)\n }\n })\n}\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"allocUnsafe\": () => (/* binding */ allocUnsafe)\n/* harmony export */ });\nfunction allocUnsafe(size) {\n return new Uint8Array(size);\n}\n//# sourceMappingURL=alloc-unsafe-browser.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/mplex/dist/src/alloc-unsafe-browser.js?");
/***/ }),
-/***/ "./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base32.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base32.js ***!
- \***********************************************************************************/
+/***/ "./node_modules/@libp2p/mplex/dist/src/decode.js":
+/*!*******************************************************!*\
+ !*** ./node_modules/@libp2p/mplex/dist/src/decode.js ***!
+ \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base32\": () => (/* binding */ base32),\n/* harmony export */ \"base32hex\": () => (/* binding */ base32hex),\n/* harmony export */ \"base32hexpad\": () => (/* binding */ base32hexpad),\n/* harmony export */ \"base32hexpadupper\": () => (/* binding */ base32hexpadupper),\n/* harmony export */ \"base32hexupper\": () => (/* binding */ base32hexupper),\n/* harmony export */ \"base32pad\": () => (/* binding */ base32pad),\n/* harmony export */ \"base32padupper\": () => (/* binding */ base32padupper),\n/* harmony export */ \"base32upper\": () => (/* binding */ base32upper),\n/* harmony export */ \"base32z\": () => (/* binding */ base32z)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js\");\n\n\nconst base32 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'b',\n name: 'base32',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567',\n bitsPerChar: 5\n})\n\nconst base32upper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'B',\n name: 'base32upper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bitsPerChar: 5\n})\n\nconst base32pad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'c',\n name: 'base32pad',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',\n bitsPerChar: 5\n})\n\nconst base32padupper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'C',\n name: 'base32padupper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',\n bitsPerChar: 5\n})\n\nconst base32hex = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'v',\n name: 'base32hex',\n alphabet: '0123456789abcdefghijklmnopqrstuv',\n bitsPerChar: 5\n})\n\nconst base32hexupper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'V',\n name: 'base32hexupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bitsPerChar: 5\n})\n\nconst base32hexpad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 't',\n name: 'base32hexpad',\n alphabet: '0123456789abcdefghijklmnopqrstuv=',\n bitsPerChar: 5\n})\n\nconst base32hexpadupper = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'T',\n name: 'base32hexpadupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',\n bitsPerChar: 5\n})\n\nconst base32z = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'h',\n name: 'base32z',\n alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',\n bitsPerChar: 5\n})\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base32.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Decoder\": () => (/* binding */ Decoder),\n/* harmony export */ \"MAX_MSG_QUEUE_SIZE\": () => (/* binding */ MAX_MSG_QUEUE_SIZE),\n/* harmony export */ \"MAX_MSG_SIZE\": () => (/* binding */ MAX_MSG_SIZE)\n/* harmony export */ });\n/* harmony import */ var _message_types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./message-types.js */ \"./node_modules/@libp2p/mplex/dist/src/message-types.js\");\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n\n\nconst MAX_MSG_SIZE = 1 << 20; // 1MB\nconst MAX_MSG_QUEUE_SIZE = 4 << 20; // 4MB\nclass Decoder {\n constructor(maxMessageSize = MAX_MSG_SIZE, maxUnprocessedMessageQueueSize = MAX_MSG_QUEUE_SIZE) {\n this._buffer = new uint8arraylist__WEBPACK_IMPORTED_MODULE_1__.Uint8ArrayList();\n this._headerInfo = null;\n this._maxMessageSize = maxMessageSize;\n this._maxUnprocessedMessageQueueSize = maxUnprocessedMessageQueueSize;\n }\n write(chunk) {\n if (chunk == null || chunk.length === 0) {\n return [];\n }\n this._buffer.append(chunk);\n if (this._buffer.byteLength > this._maxUnprocessedMessageQueueSize) {\n throw Object.assign(new Error('unprocessed message queue size too large!'), { code: 'ERR_MSG_QUEUE_TOO_BIG' });\n }\n const msgs = [];\n while (this._buffer.length !== 0) {\n if (this._headerInfo == null) {\n try {\n this._headerInfo = this._decodeHeader(this._buffer);\n }\n catch (err) {\n if (err.code === 'ERR_MSG_TOO_BIG') {\n throw err;\n }\n break; // We haven't received enough data yet\n }\n }\n const { id, type, length, offset } = this._headerInfo;\n const bufferedDataLength = this._buffer.length - offset;\n if (bufferedDataLength < length) {\n break; // not enough data yet\n }\n const msg = {\n id,\n type\n };\n if (type === _message_types_js__WEBPACK_IMPORTED_MODULE_0__.MessageTypes.NEW_STREAM || type === _message_types_js__WEBPACK_IMPORTED_MODULE_0__.MessageTypes.MESSAGE_INITIATOR || type === _message_types_js__WEBPACK_IMPORTED_MODULE_0__.MessageTypes.MESSAGE_RECEIVER) {\n msg.data = this._buffer.sublist(offset, offset + length);\n }\n msgs.push(msg);\n this._buffer.consume(offset + length);\n this._headerInfo = null;\n }\n return msgs;\n }\n /**\n * Attempts to decode the message header from the buffer\n */\n _decodeHeader(data) {\n const { value: h, offset } = readVarInt(data);\n const { value: length, offset: end } = readVarInt(data, offset);\n const type = h & 7;\n // @ts-expect-error h is a number not a CODE\n if (_message_types_js__WEBPACK_IMPORTED_MODULE_0__.MessageTypeNames[type] == null) {\n throw new Error(`Invalid type received: ${type}`);\n }\n // test message type varint + data length\n if (length > this._maxMessageSize) {\n throw Object.assign(new Error('message size too large!'), { code: 'ERR_MSG_TOO_BIG' });\n }\n // @ts-expect-error h is a number not a CODE\n return { id: h >> 3, type, offset: offset + end, length };\n }\n}\nconst MSB = 0x80;\nconst REST = 0x7F;\nfunction readVarInt(buf, offset = 0) {\n let res = 0;\n let shift = 0;\n let counter = offset;\n let b;\n const l = buf.length;\n do {\n if (counter >= l || shift > 49) {\n offset = 0;\n throw new RangeError('Could not decode varint');\n }\n b = buf.get(counter++);\n res += shift < 28\n ? (b & REST) << shift\n : (b & REST) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB);\n offset = counter - offset;\n return {\n value: res,\n offset\n };\n}\n//# sourceMappingURL=decode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/mplex/dist/src/decode.js?");
/***/ }),
-/***/ "./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base58.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base58.js ***!
- \***********************************************************************************/
+/***/ "./node_modules/@libp2p/mplex/dist/src/encode.js":
+/*!*******************************************************!*\
+ !*** ./node_modules/@libp2p/mplex/dist/src/encode.js ***!
+ \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base58btc\": () => (/* binding */ base58btc),\n/* harmony export */ \"base58flickr\": () => (/* binding */ base58flickr)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js\");\n\n\nconst base58btc = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n})\n\nconst base58flickr = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.baseX)({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n})\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base58.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"encode\": () => (/* binding */ encode)\n/* harmony export */ });\n/* harmony import */ var varint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! varint */ \"./node_modules/varint/index.js\");\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n/* harmony import */ var _alloc_unsafe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alloc-unsafe.js */ \"./node_modules/@libp2p/mplex/dist/src/alloc-unsafe-browser.js\");\n/* harmony import */ var _message_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./message-types.js */ \"./node_modules/@libp2p/mplex/dist/src/message-types.js\");\n/* harmony import */ var it_batched_bytes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! it-batched-bytes */ \"./node_modules/it-batched-bytes/dist/src/index.js\");\n\n\n\n\n\nconst POOL_SIZE = 10 * 1024;\nclass Encoder {\n constructor() {\n this._pool = (0,_alloc_unsafe_js__WEBPACK_IMPORTED_MODULE_2__.allocUnsafe)(POOL_SIZE);\n this._poolOffset = 0;\n }\n /**\n * Encodes the given message and adds it to the passed list\n */\n write(msg, list) {\n const pool = this._pool;\n let offset = this._poolOffset;\n varint__WEBPACK_IMPORTED_MODULE_0__.encode(msg.id << 3 | msg.type, pool, offset);\n offset += varint__WEBPACK_IMPORTED_MODULE_0__.encode.bytes ?? 0;\n if ((msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_3__.MessageTypes.NEW_STREAM || msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_3__.MessageTypes.MESSAGE_INITIATOR || msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_3__.MessageTypes.MESSAGE_RECEIVER) && msg.data != null) {\n varint__WEBPACK_IMPORTED_MODULE_0__.encode(msg.data.length, pool, offset);\n }\n else {\n varint__WEBPACK_IMPORTED_MODULE_0__.encode(0, pool, offset);\n }\n offset += varint__WEBPACK_IMPORTED_MODULE_0__.encode.bytes ?? 0;\n const header = pool.subarray(this._poolOffset, offset);\n if (POOL_SIZE - offset < 100) {\n this._pool = (0,_alloc_unsafe_js__WEBPACK_IMPORTED_MODULE_2__.allocUnsafe)(POOL_SIZE);\n this._poolOffset = 0;\n }\n else {\n this._poolOffset = offset;\n }\n list.append(header);\n if ((msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_3__.MessageTypes.NEW_STREAM || msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_3__.MessageTypes.MESSAGE_INITIATOR || msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_3__.MessageTypes.MESSAGE_RECEIVER) && msg.data != null) {\n list.append(msg.data);\n }\n }\n}\nconst encoder = new Encoder();\n/**\n * Encode and yield one or more messages\n */\nasync function* encode(source, minSendBytes = 0) {\n if (minSendBytes == null || minSendBytes === 0) {\n // just send the messages\n for await (const messages of source) {\n const list = new uint8arraylist__WEBPACK_IMPORTED_MODULE_1__.Uint8ArrayList();\n for (const msg of messages) {\n encoder.write(msg, list);\n }\n yield list.subarray();\n }\n return;\n }\n // batch messages up for sending\n yield* (0,it_batched_bytes__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(source, {\n size: minSendBytes,\n serialize: (obj, list) => {\n for (const m of obj) {\n encoder.write(m, list);\n }\n }\n });\n}\n//# sourceMappingURL=encode.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/mplex/dist/src/encode.js?");
/***/ }),
-/***/ "./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base64.js":
-/*!***********************************************************************************!*\
- !*** ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base64.js ***!
- \***********************************************************************************/
+/***/ "./node_modules/@libp2p/mplex/dist/src/index.js":
+/*!******************************************************!*\
+ !*** ./node_modules/@libp2p/mplex/dist/src/index.js ***!
+ \******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"base64\": () => (/* binding */ base64),\n/* harmony export */ \"base64pad\": () => (/* binding */ base64pad),\n/* harmony export */ \"base64url\": () => (/* binding */ base64url),\n/* harmony export */ \"base64urlpad\": () => (/* binding */ base64urlpad)\n/* harmony export */ });\n/* harmony import */ var _base_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base.js */ \"./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base.js\");\n// @ts-check\n\n\n\nconst base64 = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'm',\n name: 'base64',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n bitsPerChar: 6\n})\n\nconst base64pad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'M',\n name: 'base64pad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n bitsPerChar: 6\n})\n\nconst base64url = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'u',\n name: 'base64url',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n bitsPerChar: 6\n})\n\nconst base64urlpad = (0,_base_js__WEBPACK_IMPORTED_MODULE_0__.rfc4648)({\n prefix: 'U',\n name: 'base64urlpad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',\n bitsPerChar: 6\n})\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/base64.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"mplex\": () => (/* binding */ mplex)\n/* harmony export */ });\n/* harmony import */ var _mplex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mplex.js */ \"./node_modules/@libp2p/mplex/dist/src/mplex.js\");\n\nclass Mplex {\n constructor(init = {}) {\n this.protocol = '/mplex/6.7.0';\n this._init = init;\n }\n createStreamMuxer(init = {}) {\n return new _mplex_js__WEBPACK_IMPORTED_MODULE_0__.MplexStreamMuxer({\n ...init,\n ...this._init\n });\n }\n}\nfunction mplex(init = {}) {\n return () => new Mplex(init);\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/mplex/dist/src/index.js?");
/***/ }),
-/***/ "./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/interface.js":
-/*!**************************************************************************************!*\
- !*** ./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/interface.js ***!
- \**************************************************************************************/
+/***/ "./node_modules/@libp2p/mplex/dist/src/message-types.js":
+/*!**************************************************************!*\
+ !*** ./node_modules/@libp2p/mplex/dist/src/message-types.js ***!
+ \**************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n// this is dummy module overlayed by interface.ts\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/node_modules/multiformats/src/bases/interface.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"InitiatorMessageTypes\": () => (/* binding */ InitiatorMessageTypes),\n/* harmony export */ \"MessageTypeNames\": () => (/* binding */ MessageTypeNames),\n/* harmony export */ \"MessageTypes\": () => (/* binding */ MessageTypes),\n/* harmony export */ \"ReceiverMessageTypes\": () => (/* binding */ ReceiverMessageTypes)\n/* harmony export */ });\nvar MessageTypes;\n(function (MessageTypes) {\n MessageTypes[MessageTypes[\"NEW_STREAM\"] = 0] = \"NEW_STREAM\";\n MessageTypes[MessageTypes[\"MESSAGE_RECEIVER\"] = 1] = \"MESSAGE_RECEIVER\";\n MessageTypes[MessageTypes[\"MESSAGE_INITIATOR\"] = 2] = \"MESSAGE_INITIATOR\";\n MessageTypes[MessageTypes[\"CLOSE_RECEIVER\"] = 3] = \"CLOSE_RECEIVER\";\n MessageTypes[MessageTypes[\"CLOSE_INITIATOR\"] = 4] = \"CLOSE_INITIATOR\";\n MessageTypes[MessageTypes[\"RESET_RECEIVER\"] = 5] = \"RESET_RECEIVER\";\n MessageTypes[MessageTypes[\"RESET_INITIATOR\"] = 6] = \"RESET_INITIATOR\";\n})(MessageTypes || (MessageTypes = {}));\nconst MessageTypeNames = Object.freeze({\n 0: 'NEW_STREAM',\n 1: 'MESSAGE_RECEIVER',\n 2: 'MESSAGE_INITIATOR',\n 3: 'CLOSE_RECEIVER',\n 4: 'CLOSE_INITIATOR',\n 5: 'RESET_RECEIVER',\n 6: 'RESET_INITIATOR'\n});\nconst InitiatorMessageTypes = Object.freeze({\n NEW_STREAM: MessageTypes.NEW_STREAM,\n MESSAGE: MessageTypes.MESSAGE_INITIATOR,\n CLOSE: MessageTypes.CLOSE_INITIATOR,\n RESET: MessageTypes.RESET_INITIATOR\n});\nconst ReceiverMessageTypes = Object.freeze({\n MESSAGE: MessageTypes.MESSAGE_RECEIVER,\n CLOSE: MessageTypes.CLOSE_RECEIVER,\n RESET: MessageTypes.RESET_RECEIVER\n});\n//# sourceMappingURL=message-types.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/mplex/dist/src/message-types.js?");
/***/ }),
-/***/ "./node_modules/@libp2p/logger/node_modules/multiformats/src/bytes.js":
-/*!****************************************************************************!*\
- !*** ./node_modules/@libp2p/logger/node_modules/multiformats/src/bytes.js ***!
- \****************************************************************************/
+/***/ "./node_modules/@libp2p/mplex/dist/src/mplex.js":
+/*!******************************************************!*\
+ !*** ./node_modules/@libp2p/mplex/dist/src/mplex.js ***!
+ \******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"coerce\": () => (/* binding */ coerce),\n/* harmony export */ \"empty\": () => (/* binding */ empty),\n/* harmony export */ \"equals\": () => (/* binding */ equals),\n/* harmony export */ \"fromHex\": () => (/* binding */ fromHex),\n/* harmony export */ \"fromString\": () => (/* binding */ fromString),\n/* harmony export */ \"isBinary\": () => (/* binding */ isBinary),\n/* harmony export */ \"toHex\": () => (/* binding */ toHex),\n/* harmony export */ \"toString\": () => (/* binding */ toString)\n/* harmony export */ });\nconst empty = new Uint8Array(0)\n\n/**\n * @param {Uint8Array} d\n */\nconst toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')\n\n/**\n * @param {string} hex\n */\nconst fromHex = hex => {\n const hexes = hex.match(/../g)\n return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty\n}\n\n/**\n * @param {Uint8Array} aa\n * @param {Uint8Array} bb\n */\nconst equals = (aa, bb) => {\n if (aa === bb) return true\n if (aa.byteLength !== bb.byteLength) {\n return false\n }\n\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o\n * @returns {Uint8Array}\n */\nconst coerce = o => {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o\n if (o instanceof ArrayBuffer) return new Uint8Array(o)\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)\n }\n throw new Error('Unknown type, must be binary type')\n}\n\n/**\n * @param {any} o\n * @returns {o is ArrayBuffer|ArrayBufferView}\n */\nconst isBinary = o =>\n o instanceof ArrayBuffer || ArrayBuffer.isView(o)\n\n/**\n * @param {string} str\n * @returns {Uint8Array}\n */\nconst fromString = str => (new TextEncoder()).encode(str)\n\n/**\n * @param {Uint8Array} b\n * @returns {string}\n */\nconst toString = b => (new TextDecoder()).decode(b)\n\n\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/node_modules/multiformats/src/bytes.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MplexStreamMuxer\": () => (/* binding */ MplexStreamMuxer)\n/* harmony export */ });\n/* harmony import */ var it_pushable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! it-pushable */ \"./node_modules/it-pushable/dist/src/index.js\");\n/* harmony import */ var abortable_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! abortable-iterator */ \"./node_modules/abortable-iterator/dist/src/index.js\");\n/* harmony import */ var _encode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./encode.js */ \"./node_modules/@libp2p/mplex/dist/src/encode.js\");\n/* harmony import */ var _decode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./decode.js */ \"./node_modules/@libp2p/mplex/dist/src/decode.js\");\n/* harmony import */ var _message_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./message-types.js */ \"./node_modules/@libp2p/mplex/dist/src/message-types.js\");\n/* harmony import */ var _stream_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./stream.js */ \"./node_modules/@libp2p/mplex/dist/src/stream.js\");\n/* harmony import */ var uint8arrays__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! uint8arrays */ \"./node_modules/uint8arrays/dist/src/index.js\");\n/* harmony import */ var _libp2p_logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @libp2p/logger */ \"./node_modules/@libp2p/logger/dist/src/index.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var rate_limiter_flexible__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rate-limiter-flexible */ \"./node_modules/rate-limiter-flexible/index.js\");\n/* harmony import */ var any_signal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! any-signal */ \"./node_modules/any-signal/dist/src/index.js\");\n\n\n\n\n\n\n\n\n\n\n\nconst log = (0,_libp2p_logger__WEBPACK_IMPORTED_MODULE_7__.logger)('libp2p:mplex');\nconst MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION = 1024;\nconst MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION = 1024;\nconst MAX_STREAM_BUFFER_SIZE = 1024 * 1024 * 4; // 4MB\nconst DISCONNECT_THRESHOLD = 5;\nfunction printMessage(msg) {\n const output = {\n ...msg,\n type: `${_message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypeNames[msg.type]} (${msg.type})`\n };\n if (msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.NEW_STREAM) {\n output.data = (0,uint8arrays__WEBPACK_IMPORTED_MODULE_6__.toString)(msg.data instanceof Uint8Array ? msg.data : msg.data.subarray());\n }\n if (msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.MESSAGE_INITIATOR || msg.type === _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.MESSAGE_RECEIVER) {\n output.data = (0,uint8arrays__WEBPACK_IMPORTED_MODULE_6__.toString)(msg.data instanceof Uint8Array ? msg.data : msg.data.subarray(), 'base16');\n }\n return output;\n}\nclass MplexStreamMuxer {\n constructor(init) {\n this.protocol = '/mplex/6.7.0';\n init = init ?? {};\n this._streamId = 0;\n this._streams = {\n /**\n * Stream to ids map\n */\n initiators: new Map(),\n /**\n * Stream to ids map\n */\n receivers: new Map()\n };\n this._init = init;\n /**\n * An iterable sink\n */\n this.sink = this._createSink();\n /**\n * An iterable source\n */\n const source = this._createSource();\n this._source = source;\n this.source = source;\n /**\n * Close controller\n */\n this.closeController = new AbortController();\n this.rateLimiter = new rate_limiter_flexible__WEBPACK_IMPORTED_MODULE_9__.RateLimiterMemory({\n points: init.disconnectThreshold ?? DISCONNECT_THRESHOLD,\n duration: 1\n });\n }\n /**\n * Returns a Map of streams and their ids\n */\n get streams() {\n // Inbound and Outbound streams may have the same ids, so we need to make those unique\n const streams = [];\n for (const stream of this._streams.initiators.values()) {\n streams.push(stream);\n }\n for (const stream of this._streams.receivers.values()) {\n streams.push(stream);\n }\n return streams;\n }\n /**\n * Initiate a new stream with the given name. If no name is\n * provided, the id of the stream will be used.\n */\n newStream(name) {\n if (this.closeController.signal.aborted) {\n throw new Error('Muxer already closed');\n }\n const id = this._streamId++;\n name = name == null ? id.toString() : name.toString();\n const registry = this._streams.initiators;\n return this._newStream({ id, name, type: 'initiator', registry });\n }\n /**\n * Close or abort all tracked streams and stop the muxer\n */\n close(err) {\n if (this.closeController.signal.aborted)\n return;\n if (err != null) {\n this.streams.forEach(s => { s.abort(err); });\n }\n else {\n this.streams.forEach(s => { s.close(); });\n }\n this.closeController.abort();\n }\n /**\n * Called whenever an inbound stream is created\n */\n _newReceiverStream(options) {\n const { id, name } = options;\n const registry = this._streams.receivers;\n return this._newStream({ id, name, type: 'receiver', registry });\n }\n _newStream(options) {\n const { id, name, type, registry } = options;\n log('new %s stream %s', type, id);\n if (type === 'initiator' && this._streams.initiators.size === (this._init.maxOutboundStreams ?? MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION)) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_8__.CodeError('Too many outbound streams open', 'ERR_TOO_MANY_OUTBOUND_STREAMS');\n }\n if (registry.has(id)) {\n throw new Error(`${type} stream ${id} already exists!`);\n }\n const send = (msg) => {\n if (log.enabled) {\n log.trace('%s stream %s send', type, id, printMessage(msg));\n }\n this._source.push(msg);\n };\n const onEnd = () => {\n log('%s stream with id %s and protocol %s ended', type, id, stream.stat.protocol);\n registry.delete(id);\n if (this._init.onStreamEnd != null) {\n this._init.onStreamEnd(stream);\n }\n };\n const stream = (0,_stream_js__WEBPACK_IMPORTED_MODULE_5__.createStream)({ id, name, send, type, onEnd, maxMsgSize: this._init.maxMsgSize });\n registry.set(id, stream);\n return stream;\n }\n /**\n * Creates a sink with an abortable source. Incoming messages will\n * also have their size restricted. All messages will be varint decoded.\n */\n _createSink() {\n const sink = async (source) => {\n const signal = (0,any_signal__WEBPACK_IMPORTED_MODULE_10__.anySignal)([this.closeController.signal, this._init.signal]);\n try {\n source = (0,abortable_iterator__WEBPACK_IMPORTED_MODULE_1__.abortableSource)(source, signal);\n const decoder = new _decode_js__WEBPACK_IMPORTED_MODULE_3__.Decoder(this._init.maxMsgSize, this._init.maxUnprocessedMessageQueueSize);\n for await (const chunk of source) {\n for (const msg of decoder.write(chunk)) {\n await this._handleIncoming(msg);\n }\n }\n this._source.end();\n }\n catch (err) {\n log('error in sink', err);\n this._source.end(err); // End the source with an error\n }\n finally {\n signal.clear();\n }\n };\n return sink;\n }\n /**\n * Creates a source that restricts outgoing message sizes\n * and varint encodes them\n */\n _createSource() {\n const onEnd = (err) => {\n this.close(err);\n };\n const source = (0,it_pushable__WEBPACK_IMPORTED_MODULE_0__.pushableV)({\n objectMode: true,\n onEnd\n });\n return Object.assign((0,_encode_js__WEBPACK_IMPORTED_MODULE_2__.encode)(source, this._init.minSendBytes), {\n push: source.push,\n end: source.end,\n return: source.return\n });\n }\n async _handleIncoming(message) {\n const { id, type } = message;\n if (log.enabled) {\n log.trace('incoming message', printMessage(message));\n }\n // Create a new stream?\n if (message.type === _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.NEW_STREAM) {\n if (this._streams.receivers.size === (this._init.maxInboundStreams ?? MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION)) {\n log('too many inbound streams open');\n // not going to allow this stream, send the reset message manually\n // instead of setting it up just to tear it down\n this._source.push({\n id,\n type: _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.RESET_RECEIVER\n });\n // if we've hit our stream limit, and the remote keeps trying to open\n // more new streams, if they are doing this very quickly maybe they\n // are attacking us and we should close the connection\n try {\n await this.rateLimiter.consume('new-stream', 1);\n }\n catch {\n log('rate limit hit when opening too many new streams over the inbound stream limit - closing remote connection');\n // since there's no backpressure in mplex, the only thing we can really do to protect ourselves is close the connection\n this._source.end(new Error('Too many open streams'));\n return;\n }\n return;\n }\n const stream = this._newReceiverStream({ id, name: (0,uint8arrays__WEBPACK_IMPORTED_MODULE_6__.toString)(message.data instanceof Uint8Array ? message.data : message.data.subarray()) });\n if (this._init.onIncomingStream != null) {\n this._init.onIncomingStream(stream);\n }\n return;\n }\n const list = (type & 1) === 1 ? this._streams.initiators : this._streams.receivers;\n const stream = list.get(id);\n if (stream == null) {\n log('missing stream %s for message type %s', id, _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypeNames[type]);\n return;\n }\n const maxBufferSize = this._init.maxStreamBufferSize ?? MAX_STREAM_BUFFER_SIZE;\n switch (type) {\n case _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.MESSAGE_INITIATOR:\n case _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.MESSAGE_RECEIVER:\n if (stream.sourceReadableLength() > maxBufferSize) {\n // Stream buffer has got too large, reset the stream\n this._source.push({\n id: message.id,\n type: type === _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.MESSAGE_INITIATOR ? _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.RESET_RECEIVER : _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.RESET_INITIATOR\n });\n // Inform the stream consumer they are not fast enough\n const error = new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_8__.CodeError('Input buffer full - increase Mplex maxBufferSize to accommodate slow consumers', 'ERR_STREAM_INPUT_BUFFER_FULL');\n stream.abort(error);\n return;\n }\n // We got data from the remote, push it into our local stream\n stream.sourcePush(message.data);\n break;\n case _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.CLOSE_INITIATOR:\n case _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.CLOSE_RECEIVER:\n // We should expect no more data from the remote, stop reading\n stream.closeRead();\n break;\n case _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.RESET_INITIATOR:\n case _message_types_js__WEBPACK_IMPORTED_MODULE_4__.MessageTypes.RESET_RECEIVER:\n // Stop reading and writing to the stream immediately\n stream.reset();\n break;\n default:\n log('unknown message type %s', type);\n }\n }\n}\n//# sourceMappingURL=mplex.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/mplex/dist/src/mplex.js?");
/***/ }),
-/***/ "./node_modules/@libp2p/logger/node_modules/multiformats/vendor/base-x.js":
-/*!********************************************************************************!*\
- !*** ./node_modules/@libp2p/logger/node_modules/multiformats/vendor/base-x.js ***!
- \********************************************************************************/
+/***/ "./node_modules/@libp2p/mplex/dist/src/stream.js":
+/*!*******************************************************!*\
+ !*** ./node_modules/@libp2p/mplex/dist/src/stream.js ***!
+ \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET, name) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up\n function encode (source) {\n if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;\n var b58 = new Uint8Array(size);\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin];\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0;\n b58[it1] = (carry % BASE) >>> 0;\n carry = (carry / BASE) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n pbegin++;\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0;\n // Skip leading spaces.\n if (source[psz] === ' ') { return }\n // Skip and count leading '1's.\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size);\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)];\n // Invalid character\n if (carry === 255) { return }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0;\n b256[it3] = (carry % 256) >>> 0;\n carry = (carry / 256) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n psz++;\n }\n // Skip trailing spaces.\n if (source[psz] === ' ') { return }\n // Skip leading zeroes in b256.\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string);\n if (buffer) { return buffer }\n throw new Error(`Non-${name} character`)\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nvar src = base;\n\nvar _brrp__multiformats_scope_baseX = src;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_brrp__multiformats_scope_baseX);\n\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/logger/node_modules/multiformats/vendor/base-x.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"createStream\": () => (/* binding */ createStream)\n/* harmony export */ });\n/* harmony import */ var abortable_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! abortable-iterator */ \"./node_modules/abortable-iterator/dist/src/index.js\");\n/* harmony import */ var it_pushable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! it-pushable */ \"./node_modules/it-pushable/dist/src/index.js\");\n/* harmony import */ var _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @libp2p/interfaces/errors */ \"./node_modules/@libp2p/interfaces/dist/src/errors.js\");\n/* harmony import */ var _decode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./decode.js */ \"./node_modules/@libp2p/mplex/dist/src/decode.js\");\n/* harmony import */ var any_signal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! any-signal */ \"./node_modules/any-signal/dist/src/index.js\");\n/* harmony import */ var _message_types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./message-types.js */ \"./node_modules/@libp2p/mplex/dist/src/message-types.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n/* harmony import */ var _libp2p_logger__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @libp2p/logger */ \"./node_modules/@libp2p/logger/dist/src/index.js\");\n\n\n\n\n\n\n\n\n\nconst log = (0,_libp2p_logger__WEBPACK_IMPORTED_MODULE_8__.logger)('libp2p:mplex:stream');\nconst ERR_STREAM_RESET = 'ERR_STREAM_RESET';\nconst ERR_STREAM_ABORT = 'ERR_STREAM_ABORT';\nconst ERR_SINK_ENDED = 'ERR_SINK_ENDED';\nconst ERR_DOUBLE_SINK = 'ERR_DOUBLE_SINK';\nfunction createStream(options) {\n const { id, name, send, onEnd, type = 'initiator', maxMsgSize = _decode_js__WEBPACK_IMPORTED_MODULE_3__.MAX_MSG_SIZE } = options;\n const abortController = new AbortController();\n const resetController = new AbortController();\n const closeController = new AbortController();\n const Types = type === 'initiator' ? _message_types_js__WEBPACK_IMPORTED_MODULE_5__.InitiatorMessageTypes : _message_types_js__WEBPACK_IMPORTED_MODULE_5__.ReceiverMessageTypes;\n const externalId = type === 'initiator' ? (`i${id}`) : `r${id}`;\n const streamName = `${name == null ? id : name}`;\n let sourceEnded = false;\n let sinkEnded = false;\n let sinkSunk = false;\n let endErr;\n const timeline = {\n open: Date.now()\n };\n const onSourceEnd = (err) => {\n if (sourceEnded) {\n return;\n }\n sourceEnded = true;\n log.trace('%s stream %s source end - err: %o', type, streamName, err);\n if (err != null && endErr == null) {\n endErr = err;\n }\n if (sinkEnded) {\n stream.stat.timeline.close = Date.now();\n if (onEnd != null) {\n onEnd(endErr);\n }\n }\n };\n const onSinkEnd = (err) => {\n if (sinkEnded) {\n return;\n }\n sinkEnded = true;\n log.trace('%s stream %s sink end - err: %o', type, streamName, err);\n if (err != null && endErr == null) {\n endErr = err;\n }\n if (sourceEnded) {\n timeline.close = Date.now();\n if (onEnd != null) {\n onEnd(endErr);\n }\n }\n };\n const streamSource = (0,it_pushable__WEBPACK_IMPORTED_MODULE_1__.pushable)({\n onEnd: onSourceEnd\n });\n const stream = {\n // Close for both Reading and Writing\n close: () => {\n log.trace('%s stream %s close', type, streamName);\n stream.closeRead();\n stream.closeWrite();\n },\n // Close for reading\n closeRead: () => {\n log.trace('%s stream %s closeRead', type, streamName);\n if (sourceEnded) {\n return;\n }\n streamSource.end();\n },\n // Close for writing\n closeWrite: () => {\n log.trace('%s stream %s closeWrite', type, streamName);\n if (sinkEnded) {\n return;\n }\n closeController.abort();\n try {\n send({ id, type: Types.CLOSE });\n }\n catch (err) {\n log.trace('%s stream %s error sending close', type, name, err);\n }\n onSinkEnd();\n },\n // Close for reading and writing (local error)\n abort: (err) => {\n log.trace('%s stream %s abort', type, streamName, err);\n // End the source with the passed error\n streamSource.end(err);\n abortController.abort();\n onSinkEnd(err);\n },\n // Close immediately for reading and writing (remote error)\n reset: () => {\n const err = new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError('stream reset', ERR_STREAM_RESET);\n resetController.abort();\n streamSource.end(err);\n onSinkEnd(err);\n },\n sink: async (source) => {\n if (sinkSunk) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError('sink already called on stream', ERR_DOUBLE_SINK);\n }\n sinkSunk = true;\n if (sinkEnded) {\n throw new _libp2p_interfaces_errors__WEBPACK_IMPORTED_MODULE_2__.CodeError('stream closed for writing', ERR_SINK_ENDED);\n }\n const signal = (0,any_signal__WEBPACK_IMPORTED_MODULE_4__.anySignal)([\n abortController.signal,\n resetController.signal,\n closeController.signal\n ]);\n try {\n source = (0,abortable_iterator__WEBPACK_IMPORTED_MODULE_0__.abortableSource)(source, signal);\n if (type === 'initiator') { // If initiator, open a new stream\n send({ id, type: _message_types_js__WEBPACK_IMPORTED_MODULE_5__.InitiatorMessageTypes.NEW_STREAM, data: new uint8arraylist__WEBPACK_IMPORTED_MODULE_7__.Uint8ArrayList((0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_6__.fromString)(streamName)) });\n }\n for await (let data of source) {\n while (data.length > 0) {\n if (data.length <= maxMsgSize) {\n send({ id, type: Types.MESSAGE, data: data instanceof Uint8Array ? new uint8arraylist__WEBPACK_IMPORTED_MODULE_7__.Uint8ArrayList(data) : data });\n break;\n }\n data = data instanceof Uint8Array ? new uint8arraylist__WEBPACK_IMPORTED_MODULE_7__.Uint8ArrayList(data) : data;\n send({ id, type: Types.MESSAGE, data: data.sublist(0, maxMsgSize) });\n data.consume(maxMsgSize);\n }\n }\n }\n catch (err) {\n if (err.type === 'aborted' && err.message === 'The operation was aborted') {\n if (closeController.signal.aborted) {\n return;\n }\n if (resetController.signal.aborted) {\n err.message = 'stream reset';\n err.code = ERR_STREAM_RESET;\n }\n if (abortController.signal.aborted) {\n err.message = 'stream aborted';\n err.code = ERR_STREAM_ABORT;\n }\n }\n // Send no more data if this stream was remotely reset\n if (err.code === ERR_STREAM_RESET) {\n log.trace('%s stream %s reset', type, name);\n }\n else {\n log.trace('%s stream %s error', type, name, err);\n try {\n send({ id, type: Types.RESET });\n }\n catch (err) {\n log.trace('%s stream %s error sending reset', type, name, err);\n }\n }\n streamSource.end(err);\n onSinkEnd(err);\n return;\n }\n finally {\n signal.clear();\n }\n try {\n send({ id, type: Types.CLOSE });\n }\n catch (err) {\n log.trace('%s stream %s error sending close', type, name, err);\n }\n onSinkEnd();\n },\n source: streamSource,\n sourcePush: (data) => {\n streamSource.push(data);\n },\n sourceReadableLength() {\n return streamSource.readableLength;\n },\n stat: {\n direction: type === 'initiator' ? 'outbound' : 'inbound',\n timeline\n },\n metadata: {},\n id: externalId\n };\n return stream;\n}\n//# sourceMappingURL=stream.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/mplex/dist/src/stream.js?");
/***/ }),
@@ -3169,7 +3477,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"handle\": () => (/* binding */ handle)\n/* harmony export */ });\n/* harmony import */ var _libp2p_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/logger */ \"./node_modules/@libp2p/logger/dist/src/index.js\");\n/* harmony import */ var _multistream_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multistream.js */ \"./node_modules/@libp2p/multistream-select/dist/src/multistream.js\");\n/* harmony import */ var it_handshake__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! it-handshake */ \"./node_modules/it-handshake/dist/src/index.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/@libp2p/multistream-select/dist/src/constants.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n\n\n\n\n\n\nconst log = (0,_libp2p_logger__WEBPACK_IMPORTED_MODULE_0__.logger)('libp2p:mss:handle');\nasync function handle(stream, protocols, options) {\n protocols = Array.isArray(protocols) ? protocols : [protocols];\n const { writer, reader, rest, stream: shakeStream } = (0,it_handshake__WEBPACK_IMPORTED_MODULE_2__.handshake)(stream);\n while (true) {\n const protocol = await _multistream_js__WEBPACK_IMPORTED_MODULE_1__.readString(reader, options);\n log('read \"%s\"', protocol);\n if (protocol === _constants_js__WEBPACK_IMPORTED_MODULE_3__.PROTOCOL_ID) {\n log('respond with \"%s\" for \"%s\"', _constants_js__WEBPACK_IMPORTED_MODULE_3__.PROTOCOL_ID, protocol);\n _multistream_js__WEBPACK_IMPORTED_MODULE_1__.write(writer, (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(_constants_js__WEBPACK_IMPORTED_MODULE_3__.PROTOCOL_ID), options);\n continue;\n }\n if (protocols.includes(protocol)) {\n _multistream_js__WEBPACK_IMPORTED_MODULE_1__.write(writer, (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(protocol), options);\n log('respond with \"%s\" for \"%s\"', protocol, protocol);\n rest();\n return { stream: shakeStream, protocol };\n }\n if (protocol === 'ls') {\n // \\n\\n\\n\n _multistream_js__WEBPACK_IMPORTED_MODULE_1__.write(writer, new uint8arraylist__WEBPACK_IMPORTED_MODULE_5__.Uint8ArrayList(...protocols.map(p => _multistream_js__WEBPACK_IMPORTED_MODULE_1__.encode((0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(p)))), options);\n // multistream.writeAll(writer, protocols.map(p => uint8ArrayFromString(p)))\n log('respond with \"%s\" for %s', protocols, protocol);\n continue;\n }\n _multistream_js__WEBPACK_IMPORTED_MODULE_1__.write(writer, (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)('na'), options);\n log('respond with \"na\" for \"%s\"', protocol);\n }\n}\n//# sourceMappingURL=handle.js.map\n\n//# sourceURL=webpack://@waku/noise-example/./node_modules/@libp2p/multistream-select/dist/src/handle.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"handle\": () => (/* binding */ handle)\n/* harmony export */ });\n/* harmony import */ var _libp2p_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @libp2p/logger */ \"./node_modules/@libp2p/logger/dist/src/index.js\");\n/* harmony import */ var _multistream_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./multistream.js */ \"./node_modules/@libp2p/multistream-select/dist/src/multistream.js\");\n/* harmony import */ var it_handshake__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! it-handshake */ \"./node_modules/it-handshake/dist/src/index.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/@libp2p/multistream-select/dist/src/constants.js\");\n/* harmony import */ var uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uint8arrays/from-string */ \"./node_modules/uint8arrays/dist/src/from-string.js\");\n/* harmony import */ var uint8arraylist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uint8arraylist */ \"./node_modules/uint8arraylist/dist/src/index.js\");\n\n\n\n\n\n\nconst log = (0,_libp2p_logger__WEBPACK_IMPORTED_MODULE_0__.logger)('libp2p:mss:handle');\nasync function handle(stream, protocols, options) {\n protocols = Array.isArray(protocols) ? protocols : [protocols];\n const { writer, reader, rest, stream: shakeStream } = (0,it_handshake__WEBPACK_IMPORTED_MODULE_2__.handshake)(stream);\n while (true) {\n const protocol = await _multistream_js__WEBPACK_IMPORTED_MODULE_1__.readString(reader, options);\n log.trace('read \"%s\"', protocol);\n if (protocol === _constants_js__WEBPACK_IMPORTED_MODULE_3__.PROTOCOL_ID) {\n log.trace('respond with \"%s\" for \"%s\"', _constants_js__WEBPACK_IMPORTED_MODULE_3__.PROTOCOL_ID, protocol);\n _multistream_js__WEBPACK_IMPORTED_MODULE_1__.write(writer, (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(_constants_js__WEBPACK_IMPORTED_MODULE_3__.PROTOCOL_ID), options);\n continue;\n }\n if (protocols.includes(protocol)) {\n _multistream_js__WEBPACK_IMPORTED_MODULE_1__.write(writer, (0,uint8arrays_from_string__WEBPACK_IMPORTED_MODULE_4__.fromString)(protocol), options);\n log.trace('respond with \"%s\" for \"%s\"', protocol, protocol);\n rest();\n return { stream: shakeStream, protocol };\n }\n if (protocol === 'ls') {\n // \\n