{"dependencies":[{"name":"@polkadot/x-bigint","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":4,"column":19,"index":121},"end":{"line":4,"column":48,"index":150}}],"key":"vYT44QPz4/mwSlaWVHyJIDa5mP4=","exportNames":["*"],"imports":1}},{"name":"./consts.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":5,"column":20,"index":172},"end":{"line":5,"column":42,"index":194}}],"key":"VesxYcVBBj0aFn0MBycvi0lQp6U=","exportNames":["*"],"imports":1}},{"name":"./toBigInt.js","data":{"asyncType":null,"isESMImport":false,"locs":[{"start":{"line":6,"column":22,"index":218},"end":{"line":6,"column":46,"index":242}}],"key":"dTHcSVsvfdaQVo2r9WMgAXLmXhU=","exportNames":["*"],"imports":1}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.nToU8a = nToU8a;\n const x_bigint_1 = require(_dependencyMap[0], \"@polkadot/x-bigint\");\n const consts_js_1 = require(_dependencyMap[1], \"./consts.js\");\n const toBigInt_js_1 = require(_dependencyMap[2], \"./toBigInt.js\");\n const DIV = (0, x_bigint_1.BigInt)(256);\n const NEG_MASK = (0, x_bigint_1.BigInt)(0xff);\n function toU8a(value, isLe, isNegative) {\n const arr = [];\n const withSigned = isNegative && value < consts_js_1._0n;\n if (withSigned) {\n value = (value + consts_js_1._1n) * -consts_js_1._1n;\n }\n while (value !== consts_js_1._0n) {\n const mod = value % DIV;\n const val = Number(withSigned ? mod ^ NEG_MASK : mod);\n if (isLe) {\n arr.push(val);\n } else {\n arr.unshift(val);\n }\n value = (value - mod) / DIV;\n }\n return Uint8Array.from(arr);\n }\n /**\n * @name nToU8a\n * @summary Creates a Uint8Array object from a bigint.\n */\n function nToU8a(value, {\n bitLength = -1,\n isLe = true,\n isNegative = false\n } = {}) {\n const valueBi = (0, toBigInt_js_1.nToBigInt)(value);\n if (valueBi === consts_js_1._0n) {\n return bitLength === -1 ? new Uint8Array(1) : new Uint8Array(Math.ceil((bitLength || 0) / 8));\n }\n const u8a = toU8a(valueBi, isLe, isNegative);\n if (bitLength === -1) {\n return u8a;\n }\n const byteLength = Math.ceil((bitLength || 0) / 8);\n const output = new Uint8Array(byteLength);\n if (isNegative) {\n output.fill(0xff);\n }\n output.set(u8a, isLe ? 0 : byteLength - u8a.length);\n return output;\n }\n});","lineCount":56,"map":[[2,2,1,0],[2,14,1,12],[4,2,2,0,"Object"],[4,8,2,6],[4,9,2,7,"defineProperty"],[4,23,2,21],[4,24,2,22,"exports"],[4,31,2,29],[4,33,2,31],[4,45,2,43],[4,47,2,45],[5,4,2,47,"value"],[5,9,2,52],[5,11,2,54],[6,2,2,59],[6,3,2,60],[6,4,2,61],[7,2,3,0,"exports"],[7,9,3,7],[7,10,3,8,"nToU8a"],[7,16,3,14],[7,19,3,17,"nToU8a"],[7,25,3,23],[8,2,4,0],[8,8,4,6,"x_bigint_1"],[8,18,4,16],[8,21,4,19,"require"],[8,28,4,26],[8,29,4,26,"_dependencyMap"],[8,43,4,26],[8,68,4,47],[8,69,4,48],[9,2,5,0],[9,8,5,6,"consts_js_1"],[9,19,5,17],[9,22,5,20,"require"],[9,29,5,27],[9,30,5,27,"_dependencyMap"],[9,44,5,27],[9,62,5,41],[9,63,5,42],[10,2,6,0],[10,8,6,6,"toBigInt_js_1"],[10,21,6,19],[10,24,6,22,"require"],[10,31,6,29],[10,32,6,29,"_dependencyMap"],[10,46,6,29],[10,66,6,45],[10,67,6,46],[11,2,7,0],[11,8,7,6,"DIV"],[11,11,7,9],[11,14,7,12],[11,15,7,13],[11,16,7,14],[11,18,7,16,"x_bigint_1"],[11,28,7,26],[11,29,7,27,"BigInt"],[11,35,7,33],[11,37,7,35],[11,40,7,38],[11,41,7,39],[12,2,8,0],[12,8,8,6,"NEG_MASK"],[12,16,8,14],[12,19,8,17],[12,20,8,18],[12,21,8,19],[12,23,8,21,"x_bigint_1"],[12,33,8,31],[12,34,8,32,"BigInt"],[12,40,8,38],[12,42,8,40],[12,46,8,44],[12,47,8,45],[13,2,9,0],[13,11,9,9,"toU8a"],[13,16,9,14,"toU8a"],[13,17,9,15,"value"],[13,22,9,20],[13,24,9,22,"isLe"],[13,28,9,26],[13,30,9,28,"isNegative"],[13,40,9,38],[13,42,9,40],[14,4,10,4],[14,10,10,10,"arr"],[14,13,10,13],[14,16,10,16],[14,18,10,18],[15,4,11,4],[15,10,11,10,"withSigned"],[15,20,11,20],[15,23,11,23,"isNegative"],[15,33,11,33],[15,37,11,38,"value"],[15,42,11,43],[15,45,11,46,"consts_js_1"],[15,56,11,57],[15,57,11,58,"_0n"],[15,60,11,62],[16,4,12,4],[16,8,12,8,"withSigned"],[16,18,12,18],[16,20,12,20],[17,6,13,8,"value"],[17,11,13,13],[17,14,13,16],[17,15,13,17,"value"],[17,20,13,22],[17,23,13,25,"consts_js_1"],[17,34,13,36],[17,35,13,37,"_1n"],[17,38,13,40],[17,42,13,44],[17,43,13,45,"consts_js_1"],[17,54,13,56],[17,55,13,57,"_1n"],[17,58,13,60],[18,4,14,4],[19,4,15,4],[19,11,15,11,"value"],[19,16,15,16],[19,21,15,21,"consts_js_1"],[19,32,15,32],[19,33,15,33,"_0n"],[19,36,15,36],[19,38,15,38],[20,6,16,8],[20,12,16,14,"mod"],[20,15,16,17],[20,18,16,20,"value"],[20,23,16,25],[20,26,16,28,"DIV"],[20,29,16,31],[21,6,17,8],[21,12,17,14,"val"],[21,15,17,17],[21,18,17,20,"Number"],[21,24,17,26],[21,25,17,27,"withSigned"],[21,35,17,37],[21,38,18,14,"mod"],[21,41,18,17],[21,44,18,20,"NEG_MASK"],[21,52,18,28],[21,55,19,14,"mod"],[21,58,19,17],[21,59,19,18],[22,6,20,8],[22,10,20,12,"isLe"],[22,14,20,16],[22,16,20,18],[23,8,21,12,"arr"],[23,11,21,15],[23,12,21,16,"push"],[23,16,21,20],[23,17,21,21,"val"],[23,20,21,24],[23,21,21,25],[24,6,22,8],[24,7,22,9],[24,13,23,13],[25,8,24,12,"arr"],[25,11,24,15],[25,12,24,16,"unshift"],[25,19,24,23],[25,20,24,24,"val"],[25,23,24,27],[25,24,24,28],[26,6,25,8],[27,6,26,8,"value"],[27,11,26,13],[27,14,26,16],[27,15,26,17,"value"],[27,20,26,22],[27,23,26,25,"mod"],[27,26,26,28],[27,30,26,32,"DIV"],[27,33,26,35],[28,4,27,4],[29,4,28,4],[29,11,28,11,"Uint8Array"],[29,21,28,21],[29,22,28,22,"from"],[29,26,28,26],[29,27,28,27,"arr"],[29,30,28,30],[29,31,28,31],[30,2,29,0],[31,2,30,0],[32,0,31,0],[33,0,32,0],[34,0,33,0],[35,2,34,0],[35,11,34,9,"nToU8a"],[35,17,34,15,"nToU8a"],[35,18,34,16,"value"],[35,23,34,21],[35,25,34,23],[36,4,34,25,"bitLength"],[36,13,34,34],[36,16,34,37],[36,17,34,38],[36,18,34,39],[37,4,34,41,"isLe"],[37,8,34,45],[37,11,34,48],[37,15,34,52],[38,4,34,54,"isNegative"],[38,14,34,64],[38,17,34,67],[39,2,34,73],[39,3,34,74],[39,6,34,77],[39,7,34,78],[39,8,34,79],[39,10,34,81],[40,4,35,4],[40,10,35,10,"valueBi"],[40,17,35,17],[40,20,35,20],[40,21,35,21],[40,22,35,22],[40,24,35,24,"toBigInt_js_1"],[40,37,35,37],[40,38,35,38,"nToBigInt"],[40,47,35,47],[40,49,35,49,"value"],[40,54,35,54],[40,55,35,55],[41,4,36,4],[41,8,36,8,"valueBi"],[41,15,36,15],[41,20,36,20,"consts_js_1"],[41,31,36,31],[41,32,36,32,"_0n"],[41,35,36,35],[41,37,36,37],[42,6,37,8],[42,13,37,15,"bitLength"],[42,22,37,24],[42,27,37,29],[42,28,37,30],[42,29,37,31],[42,32,38,14],[42,36,38,18,"Uint8Array"],[42,46,38,28],[42,47,38,29],[42,48,38,30],[42,49,38,31],[42,52,39,14],[42,56,39,18,"Uint8Array"],[42,66,39,28],[42,67,39,29,"Math"],[42,71,39,33],[42,72,39,34,"ceil"],[42,76,39,38],[42,77,39,39],[42,78,39,40,"bitLength"],[42,87,39,49],[42,91,39,53],[42,92,39,54],[42,96,39,58],[42,97,39,59],[42,98,39,60],[42,99,39,61],[43,4,40,4],[44,4,41,4],[44,10,41,10,"u8a"],[44,13,41,13],[44,16,41,16,"toU8a"],[44,21,41,21],[44,22,41,22,"valueBi"],[44,29,41,29],[44,31,41,31,"isLe"],[44,35,41,35],[44,37,41,37,"isNegative"],[44,47,41,47],[44,48,41,48],[45,4,42,4],[45,8,42,8,"bitLength"],[45,17,42,17],[45,22,42,22],[45,23,42,23],[45,24,42,24],[45,26,42,26],[46,6,43,8],[46,13,43,15,"u8a"],[46,16,43,18],[47,4,44,4],[48,4,45,4],[48,10,45,10,"byteLength"],[48,20,45,20],[48,23,45,23,"Math"],[48,27,45,27],[48,28,45,28,"ceil"],[48,32,45,32],[48,33,45,33],[48,34,45,34,"bitLength"],[48,43,45,43],[48,47,45,47],[48,48,45,48],[48,52,45,52],[48,53,45,53],[48,54,45,54],[49,4,46,4],[49,10,46,10,"output"],[49,16,46,16],[49,19,46,19],[49,23,46,23,"Uint8Array"],[49,33,46,33],[49,34,46,34,"byteLength"],[49,44,46,44],[49,45,46,45],[50,4,47,4],[50,8,47,8,"isNegative"],[50,18,47,18],[50,20,47,20],[51,6,48,8,"output"],[51,12,48,14],[51,13,48,15,"fill"],[51,17,48,19],[51,18,48,20],[51,22,48,24],[51,23,48,25],[52,4,49,4],[53,4,50,4,"output"],[53,10,50,10],[53,11,50,11,"set"],[53,14,50,14],[53,15,50,15,"u8a"],[53,18,50,18],[53,20,50,20,"isLe"],[53,24,50,24],[53,27,50,27],[53,28,50,28],[53,31,50,31,"byteLength"],[53,41,50,41],[53,44,50,44,"u8a"],[53,47,50,47],[53,48,50,48,"length"],[53,54,50,54],[53,55,50,55],[54,4,51,4],[54,11,51,11,"output"],[54,17,51,17],[55,2,52,0],[56,0,52,1],[56,3]],"functionMap":{"names":["","toU8a","nToU8a"],"mappings":"AAA;ACQ;CDoB;AEK;CFkB"},"hasCjsExports":true},"type":"js/module"}]}