{"dependencies":[{"name":"@polkadot/util","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":88,"index":88}}],"key":"ISHU1ovvPMrCldqRjtd1JhW9dyo=","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 Object.defineProperty(exports, \"CodecDate\", {\n enumerable: true,\n get: function () {\n return CodecDate;\n }\n });\n var _polkadotUtil = require(_dependencyMap[0], \"@polkadot/util\");\n const BITLENGTH = 64;\n const U8A_OPTS = {\n bitLength: BITLENGTH,\n isLe: true\n };\n function decodeDate(value) {\n if ((0, _polkadotUtil.isU8a)(value)) {\n value = (0, _polkadotUtil.u8aToBn)(value.subarray(0, BITLENGTH / 8));\n } else if (value instanceof Date) {\n return value;\n } else if ((0, _polkadotUtil.isString)(value)) {\n value = new _polkadotUtil.BN(value.toString(), 10, 'le');\n }\n return new Date((0, _polkadotUtil.bnToBn)(value).toNumber() * 1000);\n }\n /**\n * @name Date\n * @description\n * A wrapper around seconds/timestamps. Internally the representation only has\n * second precicion (aligning with Rust), so any numbers passed an/out are always\n * per-second. For any encoding/decoding the 1000 multiplier would be applied to\n * get it in line with JavaScript formats. It extends the base JS `Date` object\n * and has all the methods available that are applicable to any `Date`\n * @noInheritDoc\n */\n class CodecDate extends Date {\n initialU8aLength = BITLENGTH / 8;\n constructor(registry, value = 0) {\n super(decodeDate(value));\n this.registry = registry;\n }\n /**\n * @description The length of the value when encoded as a Uint8Array\n */\n get encodedLength() {\n return BITLENGTH / 8;\n }\n /**\n * @description returns a hash of the contents\n */\n get hash() {\n return this.registry.hash(this.toU8a());\n }\n /**\n * @description Checks if the value is an empty value\n */\n get isEmpty() {\n return this.getTime() === 0;\n }\n /**\n * @description Returns the number of bits in the value\n */\n bitLength() {\n return BITLENGTH;\n }\n /**\n * @description Compares the value of the input to see if there is a match\n */\n eq(other) {\n return decodeDate(other).getTime() === this.getTime();\n }\n /**\n * @description Returns a breakdown of the hex encoding for this Codec\n */\n inspect() {\n return {\n outer: [this.toU8a()]\n };\n }\n /**\n * @description Returns a BigInt representation of the number\n */\n toBigInt() {\n return BigInt(this.toNumber());\n }\n /**\n * @description Returns the BN representation of the timestamp\n */\n toBn() {\n return new _polkadotUtil.BN(this.toNumber());\n }\n /**\n * @description Returns a hex string representation of the value\n */\n toHex(isLe = false) {\n return (0, _polkadotUtil.bnToHex)(this.toBn(), {\n bitLength: BITLENGTH,\n isLe,\n isNegative: false\n });\n }\n /**\n * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information\n */\n toHuman() {\n return this.toISOString();\n }\n /**\n * @description Converts the Object to JSON, typically used for RPC transfers\n */\n toJSON() {\n // FIXME Return type should be number, but conflicts with Date.toJSON()\n // which returns string\n return this.toNumber();\n }\n /**\n * @description Returns the number representation for the timestamp\n */\n toNumber() {\n return Math.ceil(this.getTime() / 1000);\n }\n /**\n * @description Converts the value in a best-fit primitive form\n */\n toPrimitive() {\n return this.toNumber();\n }\n /**\n * @description Returns the base runtime type name for this instance\n */\n toRawType() {\n return 'Moment';\n }\n /**\n * @description Returns the string representation of the value\n */\n toString() {\n // only included here since we do not inherit docs\n return super.toString();\n }\n /**\n * @description Encodes the value as a Uint8Array as per the SCALE specifications\n */\n toU8a(_isBare) {\n return (0, _polkadotUtil.bnToU8a)(this.toNumber(), U8A_OPTS);\n }\n }\n});","lineCount":151,"map":[[7,2,26,0,"Object"],[7,8,26,0],[7,9,26,0,"defineProperty"],[7,23,26,0],[7,24,26,0,"exports"],[7,31,26,0],[8,4,26,0,"enumerable"],[8,14,26,0],[9,4,26,0,"get"],[9,7,26,0],[9,18,26,0,"get"],[9,19,26,0],[10,6,26,0],[10,13,26,0,"CodecDate"],[10,22,26,0],[11,4,26,0],[12,2,26,0],[13,2,1,0],[13,6,1,0,"_polkadotUtil"],[13,19,1,0],[13,22,1,0,"require"],[13,29,1,0],[13,30,1,0,"_dependencyMap"],[13,44,1,0],[14,2,2,0],[14,8,2,6,"BITLENGTH"],[14,17,2,15],[14,20,2,18],[14,22,2,20],[15,2,3,0],[15,8,3,6,"U8A_OPTS"],[15,16,3,14],[15,19,3,17],[16,4,3,19,"bitLength"],[16,13,3,28],[16,15,3,30,"BITLENGTH"],[16,24,3,39],[17,4,3,41,"isLe"],[17,8,3,45],[17,10,3,47],[18,2,3,52],[18,3,3,53],[19,2,4,0],[19,11,4,9,"decodeDate"],[19,21,4,19,"decodeDate"],[19,22,4,20,"value"],[19,27,4,25],[19,29,4,27],[20,4,5,4],[20,8,5,8],[20,12,5,8,"isU8a"],[20,25,5,13],[20,26,5,13,"isU8a"],[20,31,5,13],[20,33,5,14,"value"],[20,38,5,19],[20,39,5,20],[20,41,5,22],[21,6,6,8,"value"],[21,11,6,13],[21,14,6,16],[21,18,6,16,"u8aToBn"],[21,31,6,23],[21,32,6,23,"u8aToBn"],[21,39,6,23],[21,41,6,24,"value"],[21,46,6,29],[21,47,6,30,"subarray"],[21,55,6,38],[21,56,6,39],[21,57,6,40],[21,59,6,42,"BITLENGTH"],[21,68,6,51],[21,71,6,54],[21,72,6,55],[21,73,6,56],[21,74,6,57],[22,4,7,4],[22,5,7,5],[22,11,8,9],[22,15,8,13,"value"],[22,20,8,18],[22,32,8,30,"Date"],[22,36,8,34],[22,38,8,36],[23,6,9,8],[23,13,9,15,"value"],[23,18,9,20],[24,4,10,4],[24,5,10,5],[24,11,11,9],[24,15,11,13],[24,19,11,13,"isString"],[24,32,11,21],[24,33,11,21,"isString"],[24,41,11,21],[24,43,11,22,"value"],[24,48,11,27],[24,49,11,28],[24,51,11,30],[25,6,12,8,"value"],[25,11,12,13],[25,14,12,16],[25,18,12,20,"BN"],[25,31,12,22],[25,32,12,22,"BN"],[25,34,12,22],[25,35,12,23,"value"],[25,40,12,28],[25,41,12,29,"toString"],[25,49,12,37],[25,50,12,38],[25,51,12,39],[25,53,12,41],[25,55,12,43],[25,57,12,45],[25,61,12,49],[25,62,12,50],[26,4,13,4],[27,4,14,4],[27,11,14,11],[27,15,14,15,"Date"],[27,19,14,19],[27,20,14,20],[27,24,14,20,"bnToBn"],[27,37,14,26],[27,38,14,26,"bnToBn"],[27,44,14,26],[27,46,14,27,"value"],[27,51,14,32],[27,52,14,33],[27,53,14,34,"toNumber"],[27,61,14,42],[27,62,14,43],[27,63,14,44],[27,66,14,47],[27,70,14,51],[27,71,14,52],[28,2,15,0],[29,2,16,0],[30,0,17,0],[31,0,18,0],[32,0,19,0],[33,0,20,0],[34,0,21,0],[35,0,22,0],[36,0,23,0],[37,0,24,0],[38,0,25,0],[39,2,26,7],[39,8,26,13,"CodecDate"],[39,17,26,22],[39,26,26,31,"Date"],[39,30,26,35],[39,31,26,36],[40,4,29,4,"initialU8aLength"],[40,20,29,20],[40,23,29,23,"BITLENGTH"],[40,32,29,32],[40,35,29,35],[40,36,29,36],[41,4,31,4,"constructor"],[41,15,31,15,"constructor"],[41,16,31,16,"registry"],[41,24,31,24],[41,26,31,26,"value"],[41,31,31,31],[41,34,31,34],[41,35,31,35],[41,37,31,37],[42,6,32,8],[42,11,32,13],[42,12,32,14,"decodeDate"],[42,22,32,24],[42,23,32,25,"value"],[42,28,32,30],[42,29,32,31],[42,30,32,32],[43,6,33,8],[43,10,33,12],[43,11,33,13,"registry"],[43,19,33,21],[43,22,33,24,"registry"],[43,30,33,32],[44,4,34,4],[45,4,35,4],[46,0,36,0],[47,0,37,0],[48,4,38,4],[48,8,38,8,"encodedLength"],[48,21,38,21,"encodedLength"],[48,22,38,21],[48,24,38,24],[49,6,39,8],[49,13,39,15,"BITLENGTH"],[49,22,39,24],[49,25,39,27],[49,26,39,28],[50,4,40,4],[51,4,41,4],[52,0,42,0],[53,0,43,0],[54,4,44,4],[54,8,44,8,"hash"],[54,12,44,12,"hash"],[54,13,44,12],[54,15,44,15],[55,6,45,8],[55,13,45,15],[55,17,45,19],[55,18,45,20,"registry"],[55,26,45,28],[55,27,45,29,"hash"],[55,31,45,33],[55,32,45,34],[55,36,45,38],[55,37,45,39,"toU8a"],[55,42,45,44],[55,43,45,45],[55,44,45,46],[55,45,45,47],[56,4,46,4],[57,4,47,4],[58,0,48,0],[59,0,49,0],[60,4,50,4],[60,8,50,8,"isEmpty"],[60,15,50,15,"isEmpty"],[60,16,50,15],[60,18,50,18],[61,6,51,8],[61,13,51,15],[61,17,51,19],[61,18,51,20,"getTime"],[61,25,51,27],[61,26,51,28],[61,27,51,29],[61,32,51,34],[61,33,51,35],[62,4,52,4],[63,4,53,4],[64,0,54,0],[65,0,55,0],[66,4,56,4,"bitLength"],[66,13,56,13,"bitLength"],[66,14,56,13],[66,16,56,16],[67,6,57,8],[67,13,57,15,"BITLENGTH"],[67,22,57,24],[68,4,58,4],[69,4,59,4],[70,0,60,0],[71,0,61,0],[72,4,62,4,"eq"],[72,6,62,6,"eq"],[72,7,62,7,"other"],[72,12,62,12],[72,14,62,14],[73,6,63,8],[73,13,63,15,"decodeDate"],[73,23,63,25],[73,24,63,26,"other"],[73,29,63,31],[73,30,63,32],[73,31,63,33,"getTime"],[73,38,63,40],[73,39,63,41],[73,40,63,42],[73,45,63,47],[73,49,63,51],[73,50,63,52,"getTime"],[73,57,63,59],[73,58,63,60],[73,59,63,61],[74,4,64,4],[75,4,65,4],[76,0,66,0],[77,0,67,0],[78,4,68,4,"inspect"],[78,11,68,11,"inspect"],[78,12,68,11],[78,14,68,14],[79,6,69,8],[79,13,69,15],[80,8,70,12,"outer"],[80,13,70,17],[80,15,70,19],[80,16,70,20],[80,20,70,24],[80,21,70,25,"toU8a"],[80,26,70,30],[80,27,70,31],[80,28,70,32],[81,6,71,8],[81,7,71,9],[82,4,72,4],[83,4,73,4],[84,0,74,0],[85,0,75,0],[86,4,76,4,"toBigInt"],[86,12,76,12,"toBigInt"],[86,13,76,12],[86,15,76,15],[87,6,77,8],[87,13,77,15,"BigInt"],[87,19,77,21],[87,20,77,22],[87,24,77,26],[87,25,77,27,"toNumber"],[87,33,77,35],[87,34,77,36],[87,35,77,37],[87,36,77,38],[88,4,78,4],[89,4,79,4],[90,0,80,0],[91,0,81,0],[92,4,82,4,"toBn"],[92,8,82,8,"toBn"],[92,9,82,8],[92,11,82,11],[93,6,83,8],[93,13,83,15],[93,17,83,19,"BN"],[93,30,83,21],[93,31,83,21,"BN"],[93,33,83,21],[93,34,83,22],[93,38,83,26],[93,39,83,27,"toNumber"],[93,47,83,35],[93,48,83,36],[93,49,83,37],[93,50,83,38],[94,4,84,4],[95,4,85,4],[96,0,86,0],[97,0,87,0],[98,4,88,4,"toHex"],[98,9,88,9,"toHex"],[98,10,88,10,"isLe"],[98,14,88,14],[98,17,88,17],[98,22,88,22],[98,24,88,24],[99,6,89,8],[99,13,89,15],[99,17,89,15,"bnToHex"],[99,30,89,22],[99,31,89,22,"bnToHex"],[99,38,89,22],[99,40,89,23],[99,44,89,27],[99,45,89,28,"toBn"],[99,49,89,32],[99,50,89,33],[99,51,89,34],[99,53,89,36],[100,8,90,12,"bitLength"],[100,17,90,21],[100,19,90,23,"BITLENGTH"],[100,28,90,32],[101,8,91,12,"isLe"],[101,12,91,16],[102,8,92,12,"isNegative"],[102,18,92,22],[102,20,92,24],[103,6,93,8],[103,7,93,9],[103,8,93,10],[104,4,94,4],[105,4,95,4],[106,0,96,0],[107,0,97,0],[108,4,98,4,"toHuman"],[108,11,98,11,"toHuman"],[108,12,98,11],[108,14,98,14],[109,6,99,8],[109,13,99,15],[109,17,99,19],[109,18,99,20,"toISOString"],[109,29,99,31],[109,30,99,32],[109,31,99,33],[110,4,100,4],[111,4,101,4],[112,0,102,0],[113,0,103,0],[114,4,104,4,"toJSON"],[114,10,104,10,"toJSON"],[114,11,104,10],[114,13,104,13],[115,6,105,8],[116,6,106,8],[117,6,107,8],[117,13,107,15],[117,17,107,19],[117,18,107,20,"toNumber"],[117,26,107,28],[117,27,107,29],[117,28,107,30],[118,4,108,4],[119,4,109,4],[120,0,110,0],[121,0,111,0],[122,4,112,4,"toNumber"],[122,12,112,12,"toNumber"],[122,13,112,12],[122,15,112,15],[123,6,113,8],[123,13,113,15,"Math"],[123,17,113,19],[123,18,113,20,"ceil"],[123,22,113,24],[123,23,113,25],[123,27,113,29],[123,28,113,30,"getTime"],[123,35,113,37],[123,36,113,38],[123,37,113,39],[123,40,113,42],[123,44,113,46],[123,45,113,47],[124,4,114,4],[125,4,115,4],[126,0,116,0],[127,0,117,0],[128,4,118,4,"toPrimitive"],[128,15,118,15,"toPrimitive"],[128,16,118,15],[128,18,118,18],[129,6,119,8],[129,13,119,15],[129,17,119,19],[129,18,119,20,"toNumber"],[129,26,119,28],[129,27,119,29],[129,28,119,30],[130,4,120,4],[131,4,121,4],[132,0,122,0],[133,0,123,0],[134,4,124,4,"toRawType"],[134,13,124,13,"toRawType"],[134,14,124,13],[134,16,124,16],[135,6,125,8],[135,13,125,15],[135,21,125,23],[136,4,126,4],[137,4,127,4],[138,0,128,0],[139,0,129,0],[140,4,130,4,"toString"],[140,12,130,12,"toString"],[140,13,130,12],[140,15,130,15],[141,6,131,8],[142,6,132,8],[142,13,132,15],[142,18,132,20],[142,19,132,21,"toString"],[142,27,132,29],[142,28,132,30],[142,29,132,31],[143,4,133,4],[144,4,134,4],[145,0,135,0],[146,0,136,0],[147,4,137,4,"toU8a"],[147,9,137,9,"toU8a"],[147,10,137,10,"_isBare"],[147,17,137,17],[147,19,137,19],[148,6,138,8],[148,13,138,15],[148,17,138,15,"bnToU8a"],[148,30,138,22],[148,31,138,22,"bnToU8a"],[148,38,138,22],[148,40,138,23],[148,44,138,27],[148,45,138,28,"toNumber"],[148,53,138,36],[148,54,138,37],[148,55,138,38],[148,57,138,40,"U8A_OPTS"],[148,65,138,48],[148,66,138,49],[149,4,139,4],[150,2,140,0],[151,0,140,1],[151,3]],"functionMap":{"names":["","decodeDate","CodecDate","CodecDate#constructor","CodecDate#get__encodedLength","CodecDate#get__hash","CodecDate#get__isEmpty","CodecDate#bitLength","CodecDate#eq","CodecDate#inspect","CodecDate#toBigInt","CodecDate#toBn","CodecDate#toHex","CodecDate#toHuman","CodecDate#toJSON","CodecDate#toNumber","CodecDate#toPrimitive","CodecDate#toRawType","CodecDate#toString","CodecDate#toU8a"],"mappings":"AAA;ACG;CDW;OEW;ICK;KDG;IEI;KFE;IGI;KHE;III;KJE;IKI;KLE;IMI;KNE;IOI;KPI;IQI;KRE;ISI;KTE;IUI;KVM;IWI;KXE;IYI;KZI;IaI;KbE;IcI;KdE;IeI;KfE;IgBI;KhBG;IiBI;KjBE;CFC"},"hasCjsExports":false},"type":"js/module"}]}