edge-core-js 0.19.18 → 0.19.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see edge-core.js.LICENSE.txt */
2
- !function(){var e={7228:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},2858:function(e){e.exports=function(e){if(Array.isArray(e))return e}},3646:function(e,t,r){var n=r(7228);e.exports=function(e){if(Array.isArray(e))return n(e)}},1506:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},8926:function(e){function t(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function u(e){t(a,o,i,u,s,"next",e)}function s(e){t(a,o,i,u,s,"throw",e)}u(void 0)}))}}},4575:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},3913:function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}},9713:function(e){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},9754:function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(r)}e.exports=t},2205:function(e,t,r){var n=r(9489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},6860:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},3884:function(e){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(s){o=!0,i=s}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}},521:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},8206:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},6479:function(e,t,r){var n=r(7316);e.exports=function(e,t){if(null==e)return{};var r,o,i=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}},7316:function(e){e.exports=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}},8585:function(e,t,r){var n=r(8),o=r(1506);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},9489:function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(r,n)}e.exports=t},3038:function(e,t,r){var n=r(2858),o=r(3884),i=r(379),a=r(521);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||a()}},319:function(e,t,r){var n=r(3646),o=r(6860),i=r(379),a=r(8206);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},8:function(e){function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}e.exports=t},379:function(e,t,r){var n=r(7228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},7757:function(e,t,r){e.exports=r(5666)},8826:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function o(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function a(e,t,r,n,o){null==n&&null==o||(e=e.slice?e.slice(n,o):Array.prototype.slice.call(e,n,o)),t.set(e,r)}var u,s={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return o(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},c=(u="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(u[(240&n)>>4]+u[15&n])}return t.join("")}}),f={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],b=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],v=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],m=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],E=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],C=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function A(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var I=function(e){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(e,!0)}),this._prepare()};I.prototype._prepare=function(){var e=f[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),o=this.key.length/4,i=A(this.key);for(t=0;t<o;t++)r=t>>2,this._Ke[r][t%4]=i[t],this._Kd[e-r][t%4]=i[t];for(var a,u=0,s=o;s<n;){if(a=i[o-1],i[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^l[u]<<24,u+=1,8!=o)for(t=1;t<o;t++)i[t]^=i[t-1];else{for(t=1;t<o/2;t++)i[t]^=i[t-1];a=i[o/2-1],i[o/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24;for(t=o/2+1;t<o;t++)i[t]^=i[t-1]}for(t=0;t<o&&s<n;)c=s>>2,h=s%4,this._Ke[c][h]=i[t],this._Kd[e-c][h]=i[t++],s++}for(var c=1;c<e;c++)for(var h=0;h<4;h++)a=this._Kd[c][h],this._Kd[c][h]=_[a>>24&255]^C[a>>16&255]^x[a>>8&255]^S[255&a]},I.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=A(e),o=0;o<4;o++)n[o]^=this._Ke[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=p[n[o]>>24&255]^y[n[(o+1)%4]>>16&255]^b[n[(o+2)%4]>>8&255]^v[255&n[(o+3)%4]]^this._Ke[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Ke[t][o],s[4*o]=255&(d[n[o]>>24&255]^u>>24),s[4*o+1]=255&(d[n[(o+1)%4]>>16&255]^u>>16),s[4*o+2]=255&(d[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(d[255&n[(o+3)%4]]^u);return s},I.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=A(e),o=0;o<4;o++)n[o]^=this._Kd[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=g[n[o]>>24&255]^m[n[(o+3)%4]>>16&255]^w[n[(o+2)%4]>>8&255]^E[255&n[(o+1)%4]]^this._Kd[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Kd[t][o],s[4*o]=255&(h[n[o]>>24&255]^u>>24),s[4*o+1]=255&(h[n[(o+3)%4]>>16&255]^u>>16),s[4*o+2]=255&(h[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(h[255&n[(o+1)%4]]^u);return s};var O=function(e){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new I(e)};O.prototype.encrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.encrypt(r),t,n);return t},O.prototype.decrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.decrypt(r),t,n);return t};var T=function(e,t){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastCipherblock=o(t,!0),this._aes=new I(e)};T.prototype.encrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16);for(var u=0;u<16;u++)r[u]^=this._lastCipherblock[u];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,t,n)}return t},T.prototype.decrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var u=0;u<16;u++)t[n+u]=r[u]^this._lastCipherblock[u];a(e,this._lastCipherblock,0,n,n+16)}return t};var k=function(e,t,r){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=i(16);r||(r=1),this.segmentSize=r,this._shiftRegister=o(t,!0),this._aes=new I(e)};k.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=o(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=t[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},k.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=o(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=t[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var P=function(e,t){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastPrecipher=o(t,!0),this._lastPrecipherIndex=16,this._aes=new I(e)};P.prototype.encrypt=function(e){for(var t=o(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},P.prototype.decrypt=P.prototype.encrypt;var B=function(e){if(!(this instanceof B))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=i(16),this.setValue(e)):this.setBytes(e)};B.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},B.prototype.setBytes=function(e){if(16!=(e=o(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},B.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function(e,t){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof B||(t=new B(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new I(e)};R.prototype.encrypt=function(e){for(var t=o(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},R.prototype.decrypt=R.prototype.encrypt;var j={AES:I,Counter:B,ModeOfOperation:{ecb:O,cbc:T,cfb:k,ofb:P,ctr:R},utils:{hex:c,utf8:s},padding:{pkcs7:{pad:function(e){var t=16-(e=o(e,!0)).length%16,r=i(e.length+t);a(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=o(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var u=i(r);return a(e,u,0,0,r),u}}},_arrayTest:{coerceArray:o,createArray:i,copyArray:a}};e.exports=j}()},2190:function(e){e.exports=function(e,r,n){if(e.filter)return e.filter(r,n);if(null==e)throw new TypeError;if("function"!=typeof r)throw new TypeError;for(var o=[],i=0;i<e.length;i++)if(t.call(e,i)){var a=e[i];r.call(n,a,i,e)&&o.push(a)}return o};var t=Object.prototype.hasOwnProperty},9282:function(e,t,r){"use strict";var n=r(4155);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var i,a,u=r(2136).codes,s=u.ERR_AMBIGUOUS_ARGUMENT,c=u.ERR_INVALID_ARG_TYPE,f=u.ERR_INVALID_ARG_VALUE,l=u.ERR_INVALID_RETURN_VALUE,d=u.ERR_MISSING_ARGS,h=r(5961),p=r(9539).inspect,y=r(9539).types,b=y.isPromise,v=y.isRegExp,g=Object.assign?Object.assign:r(8091).assign,m=Object.is?Object.is:r(609);new Map;function w(){var e=r(9158);i=e.isDeepEqual,a=e.isDeepStrictEqual}var E=!1,_=e.exports=A,C={};function x(e){if(e.message instanceof Error)throw e.message;throw new h(e)}function S(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new h({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw i.generatedMessage=o,i}}function A(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[A,t.length].concat(t))}_.fail=function e(t,r,o,i,a){var u,s=arguments.length;if(0===s)u="Failed";else if(1===s)o=t,t=void 0;else{if(!1===E){E=!0;var c=n.emitWarning?n.emitWarning:console.warn.bind(console);c("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===s&&(i="!=")}if(o instanceof Error)throw o;var f={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:a||e};void 0!==o&&(f.message=o);var l=new h(f);throw u&&(l.message=u,l.generatedMessage=!0),l},_.AssertionError=h,_.ok=A,_.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&x({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},_.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&x({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},_.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),i(t,r)||x({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},_.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),i(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},_.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),a(t,r)||x({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},_.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w();a(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},_.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");m(t,r)||x({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},_.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");m(t,r)&&x({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var I=function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&t[e].test(n[e])?o[e]=n[e]:o[e]=t[e])}))};function O(e,t,r,n,o,i){if(!(r in e)||!a(e[r],t[r])){if(!n){var u=new I(e,o),s=new I(t,o,e),c=new h({actual:u,expected:s,operator:"deepStrictEqual",stackStartFn:i});throw c.actual=e,c.expected=t,c.operator=i.name,c}x({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}function T(e,t,r,n){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new c("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var a=new h({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw a.operator=n.name,a}var u=Object.keys(t);if(t instanceof Error)u.push("name","message");else if(0===u.length)throw new f("error",t,"may not be an empty object");return void 0===i&&w(),u.forEach((function(o){"string"==typeof e[o]&&v(t[o])&&t[o].test(e[o])||O(e,t,o,r,u,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e){if("function"!=typeof e)throw new c("fn","Function",e);try{e()}catch(t){return t}return C}function P(e){return b(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function B(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!P(t=e()))throw new l("instance of Promise","promiseFn",t)}else{if(!P(e))throw new c("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return C})).catch((function(e){return e}))}))}function R(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new c("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new s("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new s("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new c("error",["Object","Error","Function","RegExp"],r);if(t===C){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";x({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:e})}if(r&&!T(t,r,n,e))throw t}function j(e,t,r,n){if(t!==C){if("string"==typeof r&&(n=r,r=void 0),!r||T(t,r)){var o=n?": ".concat(n):".",i="doesNotReject"===e.name?"rejection":"exception";x({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function M(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[M,t.length].concat(t))}_.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];R.apply(void 0,[e,k(t)].concat(n))},_.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return B(t).then((function(t){return R.apply(void 0,[e,t].concat(n))}))},_.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];j.apply(void 0,[e,k(t)].concat(n))},_.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return B(t).then((function(t){return j.apply(void 0,[e,t].concat(n))}))},_.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=p(t);var n=new h({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var u=n.stack.split("\n"),s=0;s<a.length;s++){var c=u.indexOf(a[s]);if(-1!==c){u=u.slice(0,c);break}}n.stack="".concat(u.join("\n"),"\n").concat(a.join("\n"))}throw n}},_.strict=g(M,_,{equal:_.strictEqual,deepEqual:_.deepStrictEqual,notEqual:_.notStrictEqual,notDeepEqual:_.notDeepStrictEqual}),_.strict.strict=_.strict},5961:function(e,t,r){"use strict";var n=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?u(e):t}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,e)},s(e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function f(e,t,r){return f=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&l(o,r.prototype),o},f.apply(null,arguments)}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}var p=r(9539).inspect,y=r(2136).codes.ERR_INVALID_ARG_TYPE;function b(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var v="",g="",m="",w="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function C(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function x(e,t,r){var o="",i="",a=0,u="",s=!1,c=C(e),f=c.split("\n"),l=C(t).split("\n"),d=0,p="";if("strictEqual"===r&&"object"===h(e)&&"object"===h(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===f.length&&1===l.length&&f[0]!==l[0]){var y=f[0].length+l[0].length;if(y<=10){if(!("object"===h(e)&&null!==e||"object"===h(t)&&null!==t||0===e&&0===t))return"".concat(E[r],"\n\n")+"".concat(f[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;f[0][d]===l[0][d];)d++;d>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}}for(var _=f[f.length-1],x=l[l.length-1];_===x&&(d++<2?u="\n ".concat(_).concat(u):o=_,f.pop(),l.pop(),0!==f.length&&0!==l.length);)_=f[f.length-1],x=l[l.length-1];var S=Math.max(f.length,l.length);if(0===S){var A=c.split("\n");if(A.length>30)for(A[26]="".concat(v,"...").concat(w);A.length>27;)A.pop();return"".concat(E.notIdentical,"\n\n").concat(A.join("\n"),"\n")}d>3&&(u="\n".concat(v,"...").concat(w).concat(u),s=!0),""!==o&&(u="\n ".concat(o).concat(u),o="");var I=0,O=E[r]+"\n".concat(g,"+ actual").concat(w," ").concat(m,"- expected").concat(w),T=" ".concat(v,"...").concat(w," Lines skipped");for(d=0;d<S;d++){var k=d-a;if(f.length<d+1)k>1&&d>2&&(k>4?(i+="\n".concat(v,"...").concat(w),s=!0):k>3&&(i+="\n ".concat(l[d-2]),I++),i+="\n ".concat(l[d-1]),I++),a=d,o+="\n".concat(m,"-").concat(w," ").concat(l[d]),I++;else if(l.length<d+1)k>1&&d>2&&(k>4?(i+="\n".concat(v,"...").concat(w),s=!0):k>3&&(i+="\n ".concat(f[d-2]),I++),i+="\n ".concat(f[d-1]),I++),a=d,i+="\n".concat(g,"+").concat(w," ").concat(f[d]),I++;else{var P=l[d],B=f[d],R=B!==P&&(!b(B,",")||B.slice(0,-1)!==P);R&&b(P,",")&&P.slice(0,-1)===B&&(R=!1,B+=","),R?(k>1&&d>2&&(k>4?(i+="\n".concat(v,"...").concat(w),s=!0):k>3&&(i+="\n ".concat(f[d-2]),I++),i+="\n ".concat(f[d-1]),I++),a=d,i+="\n".concat(g,"+").concat(w," ").concat(B),o+="\n".concat(m,"-").concat(w," ").concat(P),I+=2):(i+=o,o="",1!==k&&0!==d||(i+="\n ".concat(B),I++))}if(I>20&&d<S-2)return"".concat(O).concat(T,"\n").concat(i,"\n").concat(v,"...").concat(w).concat(o,"\n")+"".concat(v,"...").concat(w)}return"".concat(O).concat(s?T:"","\n").concat(i).concat(o).concat(u).concat(p)}var S=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==h(e)||null===e)throw new y("options","Object",e);var o=e.message,i=e.operator,s=e.stackStartFn,c=e.actual,f=e.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=o)r=a(this,d(t).call(this,String(o)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="",g="",w="",m=""):(v="",g="",w="",m="")),"object"===h(c)&&null!==c&&"object"===h(f)&&null!==f&&"stack"in c&&c instanceof Error&&"stack"in f&&f instanceof Error&&(c=_(c),f=_(f)),"deepStrictEqual"===i||"strictEqual"===i)r=a(this,d(t).call(this,x(c,f,i)));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var p=E[i],b=C(c).split("\n");if("notStrictEqual"===i&&"object"===h(c)&&null!==c&&(p=E.notStrictEqualObject),b.length>30)for(b[26]="".concat(v,"...").concat(w);b.length>27;)b.pop();r=1===b.length?a(this,d(t).call(this,"".concat(p," ").concat(b[0]))):a(this,d(t).call(this,"".concat(p,"\n\n").concat(b.join("\n"),"\n")))}else{var S=C(c),A="",I=E[i];"notDeepEqual"===i||"notEqual"===i?(S="".concat(E[i],"\n\n").concat(S)).length>1024&&(S="".concat(S.slice(0,1021),"...")):(A="".concat(C(f)),S.length>512&&(S="".concat(S.slice(0,509),"...")),A.length>512&&(A="".concat(A.slice(0,509),"...")),"deepEqual"===i||"equal"===i?S="".concat(I,"\n\n").concat(S,"\n\nshould equal\n\n"):A=" ".concat(i," ").concat(A)),r=a(this,d(t).call(this,"".concat(S).concat(A)))}return Error.stackTraceLimit=l,r.generatedMessage=!o,Object.defineProperty(u(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=f,r.operator=i,Error.captureStackTrace&&Error.captureStackTrace(u(r),s),r.stack,r.name="AssertionError",a(r)}var r,s,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e),r=t,s=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],s&&i(r.prototype,s),c&&i(r,c),t}(s(Error));e.exports=S},2136:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var u,s,c={};function f(e,t,r){r||(r=Error);var n=function(r){function n(r,a,u){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s=o(this,i(n).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,a,u))),s.code=e,s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,r),n}(r);c[e]=n}function l(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(e,t,o){var i,a,s,c;if(void 0===u&&(u=r(9282)),u("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(!s||s<0?0:+s,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))c="The ".concat(e," ").concat(i," ").concat(l(t,"type"));else{var f=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";c='The "'.concat(e,'" ').concat(f," ").concat(i," ").concat(l(t,"type"))}return c+=". Received type ".concat(n(o))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(9539));var o=s.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===u&&(u=r(9282)),u(t.length>0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),e.exports.codes=c},9158:function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(s){o=!0,i=s}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var i=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},u=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},s=Object.is?Object.is:r(609),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(360);function l(e){return e.call.bind(e)}var d=l(Object.prototype.hasOwnProperty),h=l(Object.prototype.propertyIsEnumerable),p=l(Object.prototype.toString),y=r(9539).types,b=y.isAnyArrayBuffer,v=y.isArrayBufferView,g=y.isDate,m=y.isMap,w=y.isRegExp,E=y.isSet,_=y.isNativeError,C=y.isBoxedPrimitive,x=y.isNumberObject,S=y.isStringObject,A=y.isBooleanObject,I=y.isBigIntObject,O=y.isSymbolObject,T=y.isFloat32Array,k=y.isFloat64Array;function P(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function B(e){return Object.keys(e).filter(P).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function j(e,t,r,n){if(e===t)return 0!==e||(!r||s(e,t));if(r){if("object"!==o(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var a,u,c,l,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var h=B(e),y=B(t);return h.length===y.length&&N(e,t,r,n,1,h)}if("[object Object]"===d&&(!m(e)&&m(t)||!E(e)&&E(t)))return!1;if(g(e)){if(!g(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,l=t,!(i?c.source===l.source&&c.flags===l.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(l))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!T(e)&&!k(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===R(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var P=B(e),j=B(t);return P.length===j.length&&N(e,t,r,n,0,P)}if(E(e))return!(!E(t)||e.size!==t.size)&&N(e,t,r,n,2);if(m(e))return!(!m(t)||e.size!==t.size)&&N(e,t,r,n,3);if(b(e)){if(u=t,(a=e).byteLength!==u.byteLength||0!==R(new Uint8Array(a),new Uint8Array(u)))return!1}else if(C(e)&&!function(e,t){return x(e)?x(t)&&s(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):S(e)?S(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):I(e)?I(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):O(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return N(e,t,r,n,0)}function M(e,t){return t.filter((function(t){return h(e,t)}))}function N(e,t,r,n,o,i){if(5===arguments.length){i=Object.keys(e);var a=Object.keys(t);if(i.length!==a.length)return!1}for(var u=0;u<i.length;u++)if(!d(t,i[u]))return!1;if(r&&5===arguments.length){var s=c(e);if(0!==s.length){var f=0;for(u=0;u<s.length;u++){var l=s[u];if(h(e,l)){if(!h(t,l))return!1;i.push(l),f++}else if(h(t,l))return!1}var p=c(t);if(s.length!==p.length&&M(t,p).length!==f)return!1}else{var y=c(t);if(0!==y.length&&0!==M(t,y).length)return!1}}if(0===i.length&&(0===o||1===o&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var b=n.val1.get(e);if(void 0!==b){var v=n.val2.get(t);if(void 0!==v)return b===v}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var g=F(e,t,r,i,n,o);return n.val1.delete(e),n.val2.delete(t),g}function D(e,t,r,n){for(var o=a(e),i=0;i<o.length;i++){var u=o[i];if(j(t,u,r,n))return e.delete(u),!0}return!1}function L(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(f(e))return!1}return!0}function U(e,t,r){var n=L(r);return null!=n?n:t.has(n)&&!e.has(n)}function H(e,t,r,n,o){var i=L(r);if(null!=i)return i;var a=t.get(i);return!(void 0===a&&!t.has(i)||!j(n,a,!1,o))&&(!e.has(i)&&j(n,a,!1,o))}function K(e,t,r,n,o,i){for(var u=a(e),s=0;s<u.length;s++){var c=u[s];if(j(r,c,o,i)&&j(n,t.get(c),o,i))return e.delete(c),!0}return!1}function F(e,t,r,i,s,c){var f=0;if(2===c){if(!function(e,t,r,n){for(var i=null,u=a(e),s=0;s<u.length;s++){var c=u[s];if("object"===o(c)&&null!==c)null===i&&(i=new Set),i.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===i&&(i=new Set),i.add(c)}}if(null!==i){for(var f=a(t),l=0;l<f.length;l++){var d=f[l];if("object"===o(d)&&null!==d){if(!D(i,d,r,n))return!1}else if(!r&&!e.has(d)&&!D(i,d,r,n))return!1}return 0===i.size}return!0}(e,t,r,s))return!1}else if(3===c){if(!function(e,t,r,i){for(var a=null,s=u(e),c=0;c<s.length;c++){var f=n(s[c],2),l=f[0],d=f[1];if("object"===o(l)&&null!==l)null===a&&(a=new Set),a.add(l);else{var h=t.get(l);if(void 0===h&&!t.has(l)||!j(d,h,r,i)){if(r)return!1;if(!H(e,t,l,d,i))return!1;null===a&&(a=new Set),a.add(l)}}}if(null!==a){for(var p=u(t),y=0;y<p.length;y++){var b=n(p[y],2),v=(l=b[0],b[1]);if("object"===o(l)&&null!==l){if(!K(a,e,l,v,r,i))return!1}else if(!(r||e.has(l)&&j(e.get(l),v,!1,i)||K(a,e,l,v,!1,i)))return!1}return 0===a.size}return!0}(e,t,r,s))return!1}else if(1===c)for(;f<e.length;f++){if(!d(e,f)){if(d(t,f))return!1;for(var l=Object.keys(e);f<l.length;f++){var h=l[f];if(!d(t,h)||!j(e[h],t[h],r,s))return!1}return l.length===Object.keys(t).length}if(!d(t,f)||!j(e[f],t[f],r,s))return!1}for(f=0;f<i.length;f++){var p=i[f];if(!j(e[p],t[p],r,s))return!1}return!0}e.exports={isDeepEqual:function(e,t){return j(e,t,false)},isDeepStrictEqual:function(e,t){return j(e,t,true)}}},2383:function(){function e(e,t,r){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r})}e(Object,"assign",(function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;++t){var r=arguments[t];if(null!=r)for(var n=0,o=Object.keys(r);n<o.length;n++){var i=o[n];e[i]=r[i]}}return e})),e(Array.prototype,"fill",(function(e,t,r){var n=this.length;function o(e){return e<0?Math.max(n+e,0):Math.min(e,n)}for(var i=null!=t?o(t):0,a=null!=r?o(r):n,u=i;u<a;++u)this[u]=e;return this})),e(Array.prototype,"find",(function(e,t){for(var r=0;r<this.length;++r){var n=this[r];if(e.call(t,n,r,this))return n}})),e(Array.prototype,"includes",(function(e){return Array.prototype.indexOf.call(this,e)>=0})),e(Uint8Array.prototype,"fill",Array.prototype.fill)},8823:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=c(e);if(t){var o=c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}function u(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var l=r(9742),d=r(645),h="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=b,t.SlowBuffer=function(e){+e!=e&&(e=0);return b.alloc(+e)},t.INSPECT_MAX_BYTES=50;var p=2147483647;function y(e){if(e>p)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,b.prototype),t}function b(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return m(e)}return v(e,t,r)}function v(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!b.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|C(e,t),n=y(r),o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(ne(e,Uint8Array)){var t=new Uint8Array(e);return E(t.buffer,t.byteOffset,t.byteLength)}return w(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+f(e));if(ne(e,ArrayBuffer)||e&&ne(e.buffer,ArrayBuffer))return E(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(ne(e,SharedArrayBuffer)||e&&ne(e.buffer,SharedArrayBuffer)))return E(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return b.from(n,t,r);var o=function(e){if(b.isBuffer(e)){var t=0|_(e.length),r=y(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||oe(e.length)?y(0):w(e);if("Buffer"===e.type&&Array.isArray(e.data))return w(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return b.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+f(e))}function g(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function m(e){return g(e),y(e<0?0:0|_(e))}function w(e){for(var t=e.length<0?0:0|_(e.length),r=y(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function E(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,b.prototype),n}function _(e){if(e>=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|e}function C(e,t){if(b.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ne(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+f(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ee(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return te(e).length;default:if(o)return n?-1:ee(e).length;t=(""+t).toLowerCase(),o=!0}}function x(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return j(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),oe(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=b.from(t,n)),b.isBuffer(t))return 0===t.length?-1:I(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):I(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function I(e,t,r,n,o){var i,a=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var f=-1;for(i=r;i<u;i++)if(c(e,i)===c(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*a}else-1!==f&&(i-=i-f),f=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var l=!0,d=0;d<s;d++)if(c(e,i+d)!==c(t,d)){l=!1;break}if(l)return i}return-1}function O(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i,a=t.length;for(n>a/2&&(n=a/2),i=0;i<n;++i){var u=parseInt(t.substr(2*i,2),16);if(oe(u))return i;e[r+i]=u}return i}function T(e,t,r,n){return re(ee(t,e.length-r),e,r,n)}function k(e,t,r,n){return re(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function P(e,t,r,n){return re(te(t),e,r,n)}function B(e,t,r,n){return re(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?l.fromByteArray(e):l.fromByteArray(e.slice(t,r))}function j(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i=e[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var s=void 0,c=void 0,f=void 0,l=void 0;switch(u){case 1:i<128&&(a=i);break;case 2:128==(192&(s=e[o+1]))&&(l=(31&i)<<6|63&s)>127&&(a=l);break;case 3:s=e[o+1],c=e[o+2],128==(192&s)&&128==(192&c)&&(l=(15&i)<<12|(63&s)<<6|63&c)>2047&&(l<55296||l>57343)&&(a=l);break;case 4:s=e[o+1],c=e[o+2],f=e[o+3],128==(192&s)&&128==(192&c)&&128==(192&f)&&(l=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(a=l)}}null===a?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=u}return function(e){var t=e.length;if(t<=M)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=M));return r}(n)}t.kMaxLength=p,b.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(r){return!1}}(),b.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}}),b.poolSize=8192,b.from=function(e,t,r){return v(e,t,r)},Object.setPrototypeOf(b.prototype,Uint8Array.prototype),Object.setPrototypeOf(b,Uint8Array),b.alloc=function(e,t,r){return function(e,t,r){return g(e),e<=0?y(e):void 0!==t?"string"==typeof r?y(e).fill(t,r):y(e).fill(t):y(e)}(e,t,r)},b.allocUnsafe=function(e){return m(e)},b.allocUnsafeSlow=function(e){return m(e)},b.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==b.prototype},b.compare=function(e,t){if(ne(e,Uint8Array)&&(e=b.from(e,e.offset,e.byteLength)),ne(t,Uint8Array)&&(t=b.from(t,t.offset,t.byteLength)),!b.isBuffer(e)||!b.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},b.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},b.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return b.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=b.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(ne(i,Uint8Array))o+i.length>n.length?(b.isBuffer(i)||(i=b.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else{if(!b.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},b.byteLength=C,b.prototype._isBuffer=!0,b.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)S(this,t,t+1);return this},b.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)S(this,t,t+3),S(this,t+1,t+2);return this},b.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)S(this,t,t+7),S(this,t+1,t+6),S(this,t+2,t+5),S(this,t+3,t+4);return this},b.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?j(this,0,e):x.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(e){if(!b.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===b.compare(this,e)},b.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},h&&(b.prototype[h]=b.prototype.inspect),b.prototype.compare=function(e,t,r,n,o){if(ne(e,Uint8Array)&&(e=b.from(e,e.offset,e.byteLength)),!b.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+f(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),u=Math.min(i,a),s=this.slice(n,o),c=e.slice(t,r),l=0;l<u;++l)if(s[l]!==c[l]){i=s[l],a=c[l];break}return i<a?-1:a<i?1:0},b.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},b.prototype.indexOf=function(e,t,r){return A(this,e,t,r,!0)},b.prototype.lastIndexOf=function(e,t,r){return A(this,e,t,r,!1)},b.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,e,t,r);case"utf8":case"utf-8":return T(this,e,t,r);case"ascii":case"latin1":case"binary":return k(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function N(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function L(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=ie[e[i]];return o}function U(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function H(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function K(e,t,r,n,o,i){if(!b.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function F(e,t,r,n,o){Z(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function G(e,t,r,n,o){Z(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function q(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(e,t,r,n,o){return t=+t,r>>>=0,o||q(e,0,r,4),d.write(e,t,r,n,23,4),r+4}function W(e,t,r,n,o){return t=+t,r>>>=0,o||q(e,0,r,8),d.write(e,t,r,n,52,8),r+8}b.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,b.prototype),n},b.prototype.readUintLE=b.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},b.prototype.readUintBE=b.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},b.prototype.readUint8=b.prototype.readUInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),this[e]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]|this[e+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]<<8|this[e+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},b.prototype.readBigUInt64LE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),o=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(o)<<BigInt(32))})),b.prototype.readBigUInt64BE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],o=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),b.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},b.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},b.prototype.readInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},b.prototype.readInt16LE=function(e,t){e>>>=0,t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt16BE=function(e,t){e>>>=0,t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},b.prototype.readInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},b.prototype.readBigInt64LE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))})),b.prototype.readBigInt64BE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r)})),b.prototype.readFloatLE=function(e,t){return e>>>=0,t||H(e,4,this.length),d.read(this,e,!0,23,4)},b.prototype.readFloatBE=function(e,t){return e>>>=0,t||H(e,4,this.length),d.read(this,e,!1,23,4)},b.prototype.readDoubleLE=function(e,t){return e>>>=0,t||H(e,8,this.length),d.read(this,e,!0,52,8)},b.prototype.readDoubleBE=function(e,t){return e>>>=0,t||H(e,8,this.length),d.read(this,e,!1,52,8)},b.prototype.writeUintLE=b.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},b.prototype.writeUint8=b.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,1,255,0),this[t]=255&e,t+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},b.prototype.writeBigUInt64LE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),b.prototype.writeBigUInt64BE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return G(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),b.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);K(this,e,t,r,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+r},b.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);K(this,e,t,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+r},b.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},b.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},b.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},b.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},b.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},b.prototype.writeBigInt64LE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),b.prototype.writeBigInt64BE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return G(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),b.prototype.writeFloatLE=function(e,t,r){return z(this,e,t,!0,r)},b.prototype.writeFloatBE=function(e,t,r){return z(this,e,t,!1,r)},b.prototype.writeDoubleLE=function(e,t,r){return W(this,e,t,!0,r)},b.prototype.writeDoubleBE=function(e,t,r){return W(this,e,t,!1,r)},b.prototype.copy=function(e,t,r,n){if(!b.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},b.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!b.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=b.isBuffer(e)?e:b.from(e,n),u=a.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%u]}return this};var V={};function Y(e,t,r){V[e]=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(d,r);var u,c,f,l=a(d);function d(){var r;return n(this,d),r=l.call(this),Object.defineProperty(s(r),"message",{value:t.apply(s(r),arguments),writable:!0,configurable:!0}),r.name="".concat(r.name," [").concat(e,"]"),r.stack,delete r.name,r}return u=d,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}},{key:"code",get:function(){return e},set:function(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}}])&&o(u.prototype,c),f&&o(u,f),d}(r)}function J(e){for(var t="",r=e.length,n="-"===e[0]?1:0;r>=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function Z(e,t,r,n,o,i){if(e>r||e<t){var a,u="bigint"==typeof t?"n":"";throw a=i>3?0===t||t===BigInt(0)?">= 0".concat(u," and < 2").concat(u," ** ").concat(8*(i+1)).concat(u):">= -(2".concat(u," ** ").concat(8*(i+1)-1).concat(u,") and < 2 ** ")+"".concat(8*(i+1)-1).concat(u):">= ".concat(t).concat(u," and <= ").concat(r).concat(u),new V.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,r){X(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,o,i)}function X(e,t){if("number"!=typeof e)throw new V.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw X(e,r),new V.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new V.ERR_BUFFER_OUT_OF_BOUNDS;throw new V.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}Y("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),Y("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(f(t))}),TypeError),Y("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?o=J(String(r)):"bigint"==typeof r&&(o=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(o=J(o)),o+="n"),n+=" It must be ".concat(t,". Received ").concat(o)}),RangeError);var Q=/[^+/0-9A-Za-z-_]/g;function ee(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function te(e){return l.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function re(e,t,r,n){var o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function ne(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function oe(e){return e!=e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}();function ae(e){return"undefined"==typeof BigInt?ue:e}function ue(){throw new Error("BigInt not supported")}},9176:function(e){e.exports=function(e){for(var t={},r=e.length,n=e.charAt(0),o=0;o<e.length;o++)t[e.charAt(o)]=o;function i(e){if(0===e.length)return[];for(var o=[0],i=0;i<e.length;i++){var a=t[e[i]];if(void 0===a)return;for(var u=0,s=a;u<o.length;++u)s+=o[u]*r,o[u]=255&s,s>>=8;for(;s>0;)o.push(255&s),s>>=8}for(var c=0;e[c]===n&&c<e.length-1;++c)o.push(0);return o.reverse()}return{encode:function(t){if(0===t.length)return"";for(var n=[0],o=0;o<t.length;++o){for(var i=0,a=t[o];i<n.length;++i)a+=n[i]<<8,n[i]=a%r,a=a/r|0;for(;a>0;)n.push(a%r),a=a/r|0}for(var u="",s=0;0===t[s]&&s<t.length-1;++s)u+=e[0];for(var c=n.length-1;c>=0;--c)u+=e[n[c]];return u},decodeUnsafe:i,decode:function(e){var t=i(e);if(t)return t;throw new Error("Non-base"+r+" character")}}}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),f=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,u=0,s=n-o;u<s;u+=a)i.push(c(e,u,u+a>s?s:u+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=i.length;a<u;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,a=[],u=t;u<n;u+=3)o=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3027:function(e,t,r){var n=r(9509).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,o=t.length;if(0===r)throw new Error("R length is zero");if(0===o)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(o>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(o>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=n.allocUnsafe(6+r+o);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i}}},3550:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(S){}function u(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=u(e,r);return r-1>=t&&(n|=u(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a<i;a++){var u=e.charCodeAt(a)-48;o*=n,o+=u>=49?u-49+10:u>=17?u-17+10:u}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,u=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,u=Math.min(i,i-a)+r,s=0,f=r;f<u;f+=n)s=c(e,f,f+n,t),this.imuln(o),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==a){var l=1;for(s=c(e,f,e.length,t),f=0;f<a;f++)l*=t;this.imuln(l),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,u=67108863&a,s=a/67108864|0;r.words[0]=u;for(var c=1;c<n;c++){for(var f=s>>>26,l=67108863&s,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;f+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,s=0|f}return 0!==s?r.words[c]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var u=this.words[a],s=(16777215&(u<<o|i)).toString(16);r=0!==(i=u>>>24-o&16777215)||a!==this.length-1?f[6-s.length]+s+r:s+r,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,u,s="le"===t,c=new e(i),f=this.clone();if(s){for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[u]=a;for(;u<i;u++)c[u]=0}else{for(u=0;u<i-o;u++)c[u]=0;for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[i-u-1]=a}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)i=(t=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<r.length;a++)i=(t=(0|r.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,o,i,a=e.words,u=t.words,s=r.words,c=0,f=0|a[0],l=8191&f,d=f>>>13,h=0|a[1],p=8191&h,y=h>>>13,b=0|a[2],v=8191&b,g=b>>>13,m=0|a[3],w=8191&m,E=m>>>13,_=0|a[4],C=8191&_,x=_>>>13,S=0|a[5],A=8191&S,I=S>>>13,O=0|a[6],T=8191&O,k=O>>>13,P=0|a[7],B=8191&P,R=P>>>13,j=0|a[8],M=8191&j,N=j>>>13,D=0|a[9],L=8191&D,U=D>>>13,H=0|u[0],K=8191&H,F=H>>>13,G=0|u[1],q=8191&G,z=G>>>13,W=0|u[2],V=8191&W,Y=W>>>13,J=0|u[3],Z=8191&J,X=J>>>13,$=0|u[4],Q=8191&$,ee=$>>>13,te=0|u[5],re=8191&te,ne=te>>>13,oe=0|u[6],ie=8191&oe,ae=oe>>>13,ue=0|u[7],se=8191&ue,ce=ue>>>13,fe=0|u[8],le=8191&fe,de=fe>>>13,he=0|u[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(c+(n=Math.imul(l,K))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(d,K)|0))<<13)|0;c=((i=Math.imul(d,F))+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(p,K),o=(o=Math.imul(p,F))+Math.imul(y,K)|0,i=Math.imul(y,F);var ve=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,z)|0)+Math.imul(d,q)|0))<<13)|0;c=((i=i+Math.imul(d,z)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,K),o=(o=Math.imul(v,F))+Math.imul(g,K)|0,i=Math.imul(g,F),n=n+Math.imul(p,q)|0,o=(o=o+Math.imul(p,z)|0)+Math.imul(y,q)|0,i=i+Math.imul(y,z)|0;var ge=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,V)|0))<<13)|0;c=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),o=(o=Math.imul(w,F))+Math.imul(E,K)|0,i=Math.imul(E,F),n=n+Math.imul(v,q)|0,o=(o=o+Math.imul(v,z)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,z)|0,n=n+Math.imul(p,V)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Y)|0;var me=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(o=(o=o+Math.imul(l,X)|0)+Math.imul(d,Z)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(C,K),o=(o=Math.imul(C,F))+Math.imul(x,K)|0,i=Math.imul(x,F),n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,z)|0)+Math.imul(E,q)|0,i=i+Math.imul(E,z)|0,n=n+Math.imul(v,V)|0,o=(o=o+Math.imul(v,Y)|0)+Math.imul(g,V)|0,i=i+Math.imul(g,Y)|0,n=n+Math.imul(p,Z)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,Z)|0,i=i+Math.imul(y,X)|0;var we=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,K),o=(o=Math.imul(A,F))+Math.imul(I,K)|0,i=Math.imul(I,F),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,z)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,z)|0,n=n+Math.imul(w,V)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(v,Z)|0,o=(o=o+Math.imul(v,X)|0)+Math.imul(g,Z)|0,i=i+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0;var Ee=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(o=(o=o+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,K),o=(o=Math.imul(T,F))+Math.imul(k,K)|0,i=Math.imul(k,F),n=n+Math.imul(A,q)|0,o=(o=o+Math.imul(A,z)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,z)|0,n=n+Math.imul(C,V)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(x,V)|0,i=i+Math.imul(x,Y)|0,n=n+Math.imul(w,Z)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(E,Z)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var _e=(c+(n=n+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,K),o=(o=Math.imul(B,F))+Math.imul(R,K)|0,i=Math.imul(R,F),n=n+Math.imul(T,q)|0,o=(o=o+Math.imul(T,z)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,z)|0,n=n+Math.imul(A,V)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(I,V)|0,i=i+Math.imul(I,Y)|0,n=n+Math.imul(C,Z)|0,o=(o=o+Math.imul(C,X)|0)+Math.imul(x,Z)|0,i=i+Math.imul(x,X)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(v,re)|0,o=(o=o+Math.imul(v,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var Ce=(c+(n=n+Math.imul(l,se)|0)|0)+((8191&(o=(o=o+Math.imul(l,ce)|0)+Math.imul(d,se)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(M,K),o=(o=Math.imul(M,F))+Math.imul(N,K)|0,i=Math.imul(N,F),n=n+Math.imul(B,q)|0,o=(o=o+Math.imul(B,z)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,z)|0,n=n+Math.imul(T,V)|0,o=(o=o+Math.imul(T,Y)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(A,Z)|0,o=(o=o+Math.imul(A,X)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,n=n+Math.imul(p,se)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,se)|0,i=i+Math.imul(y,ce)|0;var xe=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,K),o=(o=Math.imul(L,F))+Math.imul(U,K)|0,i=Math.imul(U,F),n=n+Math.imul(M,q)|0,o=(o=o+Math.imul(M,z)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,z)|0,n=n+Math.imul(B,V)|0,o=(o=o+Math.imul(B,Y)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Z)|0,o=(o=o+Math.imul(T,X)|0)+Math.imul(k,Z)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(A,Q)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,ae)|0,n=n+Math.imul(v,se)|0,o=(o=o+Math.imul(v,ce)|0)+Math.imul(g,se)|0,i=i+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,le)|0,i=i+Math.imul(y,de)|0;var Se=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,q),o=(o=Math.imul(L,z))+Math.imul(U,q)|0,i=Math.imul(U,z),n=n+Math.imul(M,V)|0,o=(o=o+Math.imul(M,Y)|0)+Math.imul(N,V)|0,i=i+Math.imul(N,Y)|0,n=n+Math.imul(B,Z)|0,o=(o=o+Math.imul(B,X)|0)+Math.imul(R,Z)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(T,Q)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(w,se)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(E,se)|0,i=i+Math.imul(E,ce)|0,n=n+Math.imul(v,le)|0,o=(o=o+Math.imul(v,de)|0)+Math.imul(g,le)|0,i=i+Math.imul(g,de)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,V),o=(o=Math.imul(L,Y))+Math.imul(U,V)|0,i=Math.imul(U,Y),n=n+Math.imul(M,Z)|0,o=(o=o+Math.imul(M,X)|0)+Math.imul(N,Z)|0,i=i+Math.imul(N,X)|0,n=n+Math.imul(B,Q)|0,o=(o=o+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,o=(o=o+Math.imul(T,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,n=n+Math.imul(C,se)|0,o=(o=o+Math.imul(C,ce)|0)+Math.imul(x,se)|0,i=i+Math.imul(x,ce)|0,n=n+Math.imul(w,le)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(E,le)|0,i=i+Math.imul(E,de)|0;var Ie=(c+(n=n+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,ye)|0)+Math.imul(g,pe)|0))<<13)|0;c=((i=i+Math.imul(g,ye)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,Z),o=(o=Math.imul(L,X))+Math.imul(U,Z)|0,i=Math.imul(U,X),n=n+Math.imul(M,Q)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(B,re)|0,o=(o=o+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(A,se)|0,o=(o=o+Math.imul(A,ce)|0)+Math.imul(I,se)|0,i=i+Math.imul(I,ce)|0,n=n+Math.imul(C,le)|0,o=(o=o+Math.imul(C,de)|0)+Math.imul(x,le)|0,i=i+Math.imul(x,de)|0;var Oe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(E,pe)|0))<<13)|0;c=((i=i+Math.imul(E,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,Q),o=(o=Math.imul(L,ee))+Math.imul(U,Q)|0,i=Math.imul(U,ee),n=n+Math.imul(M,re)|0,o=(o=o+Math.imul(M,ne)|0)+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(B,ie)|0,o=(o=o+Math.imul(B,ae)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,ae)|0,n=n+Math.imul(T,se)|0,o=(o=o+Math.imul(T,ce)|0)+Math.imul(k,se)|0,i=i+Math.imul(k,ce)|0,n=n+Math.imul(A,le)|0,o=(o=o+Math.imul(A,de)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,de)|0;var Te=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((i=i+Math.imul(x,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,re),o=(o=Math.imul(L,ne))+Math.imul(U,re)|0,i=Math.imul(U,ne),n=n+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,n=n+Math.imul(B,se)|0,o=(o=o+Math.imul(B,ce)|0)+Math.imul(R,se)|0,i=i+Math.imul(R,ce)|0,n=n+Math.imul(T,le)|0,o=(o=o+Math.imul(T,de)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,de)|0;var ke=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,ye)|0)+Math.imul(I,pe)|0))<<13)|0;c=((i=i+Math.imul(I,ye)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,ie),o=(o=Math.imul(L,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),n=n+Math.imul(M,se)|0,o=(o=o+Math.imul(M,ce)|0)+Math.imul(N,se)|0,i=i+Math.imul(N,ce)|0,n=n+Math.imul(B,le)|0,o=(o=o+Math.imul(B,de)|0)+Math.imul(R,le)|0,i=i+Math.imul(R,de)|0;var Pe=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((i=i+Math.imul(k,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,se),o=(o=Math.imul(L,ce))+Math.imul(U,se)|0,i=Math.imul(U,ce),n=n+Math.imul(M,le)|0,o=(o=o+Math.imul(M,de)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,de)|0;var Be=(c+(n=n+Math.imul(B,pe)|0)|0)+((8191&(o=(o=o+Math.imul(B,ye)|0)+Math.imul(R,pe)|0))<<13)|0;c=((i=i+Math.imul(R,ye)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,le),o=(o=Math.imul(L,de))+Math.imul(U,le)|0,i=Math.imul(U,de);var Re=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((i=i+Math.imul(N,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863;var je=(c+(n=Math.imul(L,pe))|0)+((8191&(o=(o=Math.imul(L,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((i=Math.imul(U,ye))+(o>>>13)|0)+(je>>>26)|0,je&=67108863,s[0]=be,s[1]=ve,s[2]=ge,s[3]=me,s[4]=we,s[5]=Ee,s[6]=_e,s[7]=Ce,s[8]=xe,s[9]=Se,s[10]=Ae,s[11]=Ie,s[12]=Oe,s[13]=Te,s[14]=ke,s[15]=Pe,s[16]=Be,s[17]=Re,s[18]=je,0!==c&&(s[19]=c,r.length++),r};function y(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(p=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var u=67108863&n,s=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=s;c++){var f=i-c,l=(0|e.words[f])*(0|t.words[c]),d=67108863&l;u=67108863&(d=d+u|0),o+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[i]=u,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,o=0;o<t;o++)n|=(1&e)<<t-o-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a<i;a++)n[a]=t[e[a]],o[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,o,i){this.permute(i,e,t,r,n,o);for(var a=1;a<o;a<<=1)for(var u=a<<1,s=Math.cos(2*Math.PI/u),c=Math.sin(2*Math.PI/u),f=0;f<o;f+=u)for(var l=s,d=c,h=0;h<a;h++){var p=r[f+h],y=n[f+h],b=r[f+h+a],v=n[f+h+a],g=l*b-d*v;v=l*v+d*b,b=g,r[f+h]=p+b,n[f+h]=y+v,r[f+h+a]=p-b,n[f+h+a]=y-v,h!==u&&(g=s*l-c*d,d=s*d+c*l,l=g)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=e[n];e[n]=e[r-n-1],e[r-n-1]=o,o=t[n],t[n]=-t[r-n-1],t[r-n-1]=-o}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var o=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&o,r=o<67108864?0:o/67108864|0}return e},b.prototype.convert13b=function(e,t,r,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)r[a]=0;n(0===i),n(0==(-8192&i))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),u=new Array(n),s=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,i,u,s,n,o),this.transform(c,i,f,l,n,o);for(var h=0;h<n;h++){var p=u[h]*f[h]-s[h]*l[h];s[h]=u[h]*l[h]+s[h]*f[h],u[h]=p}return this.conjugate(u,s,n),this.transform(u,s,d,i,n,o),this.conjugate(d,i,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var o=(0|this.words[r])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=(e.words[n]&1<<o)>>>o}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var u=this.words[t]&i,s=(0|this.words[t])-u<<r;this.words[t]=s|a,a=u>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),u=67108863^67108863>>>i<<i,s=r;if(o-=a,o=Math.max(0,o),s){for(var c=0;c<a;c++)s.words[c]=this.words[c];s.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=o);c--){var l=0|this.words[c];this.words[c]=f<<26-i|l>>>i,f=l&u}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r)&&!!(this.words[r]&o)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var u=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+u;var s=(0|e.words[o])*t;u=((i-=67108863&s)>>26)-(s/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)u=(i=(0|this.words[o+r])+u)>>26,this.words[o+r]=67108863&i;if(0===u)return this.strip();for(n(-1===u),u=0,o=0;o<this.length;o++)u=(i=-(0|this.words[o])+u)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var u,s=n.length-o.length;if("mod"!==t){(u=new i(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c<u.length;c++)u.words[c]=0}var f=n.clone()._ishlnsubmul(o,1,s);0===f.negative&&(n=f,u&&(u.words[s]=1));for(var l=s-1;l>=0;l--){var d=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(u=this.neg().divmod(e,t),"mod"!==t&&(o=u.div.neg()),"div"!==t&&(a=u.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(u=this.divmod(e.neg(),t),"mod"!==t&&(o=u.div.neg()),{div:o,mod:u.mod}):0!=(this.negative&e.negative)?(u=this.neg().divmod(e.neg(),t),"div"!==t&&(a=u.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:u.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,u},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),u=new i(0),s=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(f),s.isub(l)),u.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(u),a.isub(s)):(r.isub(t),u.isub(o),s.isub(a))}return{a:u,b:s,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),u=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(u)):(r.isub(t),u.isub(a))}return(o=0===t.cmpn(1)?a:u).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var u=0|this.words[a];i=(u+=i)>>>26,u&=67108863,this.words[a]=u}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(m,g),m.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&r)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(w,g),o(E,g),o(_,g),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new w;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return v[e]=t,t},C.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},C.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var u=new i(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(s);)f.redIAdd(s);for(var l=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(u);){for(var y=h,b=0;0!==y.cmp(u);b++)y=y.redSqr();n(b<p);var v=this.pow(l,new i(1).iushln(p-b-1));d=d.redMul(v),l=v.redSqr(),h=h.redMul(l),p=b}return d},C.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},C.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,u=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=s-1;f>=0;f--){var l=c>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++u||0===n&&0===f)&&(o=this.mul(o,r[a]),u=0,a=0)):u=0}s=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,C),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9931:function(e,t,r){var n;function o(e){this.rand=e}if(e.exports=function(e){return n||(n=new o(null)),n.generate(e)},e.exports.Rand=o,o.prototype.generate=function(e){return this._rand(e)},o.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(o.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var i=r(9214);if("function"!=typeof i.randomBytes)throw new Error("Not supported");o.prototype._rand=function(e){return i.randomBytes(e)}}catch(a){}},1924:function(e,t,r){"use strict";var n=r(210),o=r(5559),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},5559:function(e,t,r){"use strict";var n=r(8612),o=r(210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||n.call(a,i),s=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(d){c=null}e.exports=function(e){var t=u(n,a,arguments);if(s&&c){var r=s(t,"length");r.configurable&&c(t,"length",{value:1+f(0,e.length-(arguments.length-1))})}return t};var l=function(){return u(n,i,arguments)};c?c(e.exports,"apply",{value:l}):e.exports.apply=l},1027:function(e,t,r){var n=r(9509).Buffer,o=r(2830).Transform,i=r(2553).s;function a(e){o.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(5717)(a,o),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var o=this._update(e);return this.hashMode?this:(r&&(o=this._toString(o,r)),o)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(o){n=o}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},7630:function(e,t){"use strict";function r(e,t){return function(r){return null!=r?e(r):t}}function n(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){for(var r=0;r<t.length;++r)if(e===t[r])return e;var n="Expected ";1!==t.length&&(n+="one of: ");for(var o=0;o<t.length;++o)o>0&&(n+=" | "),n+=JSON.stringify(t[o]);throw new TypeError(n)}}function o(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e}Object.defineProperty(t,"__esModule",{value:!0});var i=n(null),a=n(void 0);var u=r(i);function s(e,t,r){return e instanceof Error&&(null==e.insertStepAt&&(e.message+=" at ",e.insertStepAt=e.message.length),e.message=e.message.slice(0,e.insertStepAt)+t+e.message.slice(e.insertStepAt),e.insertStepAt+=r),e}function c(e){if("function"==typeof e)return function(t){if("object"!=typeof t||null==t)throw new TypeError("Expected an object");for(var r={},n=Object.keys(t),o=0;o<n.length;++o){var i=n[o];if("__proto__"!==i)try{r[i]=e(t[i])}catch(a){throw s(a,"["+JSON.stringify(i)+"]",0)}}return r};var t=Object.keys(e);function r(r){return function(n){if("object"!=typeof n||null==n)throw new TypeError("Expected an object");var o,i={};if(r){var a=Object.keys(n);for(o=0;o<a.length;++o){var u=a[o];"__proto__"!==u&&(i[u]=n[u])}}for(o=0;o<t.length;++o){var c=t[o];try{i[c]=e[c](n[c])}catch(f){throw s(f,"."+c,0)}}return i}}var n=r(!1);return n.shape=e,n.withRest=r(!0),n}var f=c;var l=0;function d(e,t){return function(r){return l>0?t(r):e(r)}}var h=d((function(e){if("string"!=typeof e&&!(e instanceof Date))throw new TypeError("Expected a date string");var t=new Date(e);if(null==t.toJSON())throw new TypeError("Invalid date format");return t}),(function(e){return e.toISOString()}));t.asArray=function(e){return function(t){if(!Array.isArray(t))throw new TypeError("Expected an array");for(var r=[],n=0;n<t.length;++n)try{r[n]=e(t[n])}catch(o){throw s(o,"["+n+"]",0)}return r}},t.asBoolean=function(e){if("boolean"!=typeof e)throw new TypeError("Expected a boolean");return e},t.asCodec=d,t.asDate=h,t.asEither=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){for(var r=0;r<t.length;r++)try{return t[r](e)}catch(n){if(r+1>=t.length)throw n}}},t.asJSON=function(e){return d((function(t){var r=JSON.parse(o(t));try{return e(r)}catch(n){throw s(n,"JSON.parse()",11)}}),(function(t){return JSON.stringify(e(t))}))},t.asMap=f,t.asMaybe=function(e,t){return function(r){try{return e(r)}catch(n){return t}}},t.asNone=u,t.asNull=i,t.asNumber=function(e){if("number"!=typeof e)throw new TypeError("Expected a number");return e},t.asObject=c,t.asOptional=r,t.asString=o,t.asUndefined=a,t.asUnknown=function(e){return e},t.asValue=n,t.uncleaner=function(e){return function(t){try{return++l,e(t)}finally{--l}}}},3482:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(5717),i=r(8028),a=r(9785),u=r(9072),s=r(1027);function c(e){s.call(this,"digest"),this._hash=e,this.buffers=[]}function f(e){s.call(this,"digest"),this._hash=e}o(c,s),c.prototype._update=function(e){this.buffers.push(e)},c.prototype._final=function(){var e=n.concat(this.buffers),t=this._hash(e);return this.buffers=null,t},o(f,s),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new c(i):new f("rmd160"===e||"ripemd160"===e?new a:u(e))}},800:function(e,t,r){"use strict";var n=r(8823).Buffer,o=new n(4);o.fill(0);e.exports=function(e,t){var r=t(function(e){if(e.length%4!=0){var t=e.length+(4-e.length%4);e=n.concat([e,o],t)}for(var r=new Array(e.length>>>2),i=0,a=0;i<e.length;i+=4,a++)r[a]=e.readInt32LE(i);return r}(e),8*e.length);e=new n(16);for(var i=0;i<r.length;i++)e.writeInt32LE(r[i],i<<2,!0);return e}},8028:function(e,t,r){"use strict";var n=r(800);function o(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,l=0;l<e.length;l+=16){var d=r,h=n,p=o,y=i;r=a(r,n,o,i,e[l+0],7,-680876936),i=a(i,r,n,o,e[l+1],12,-389564586),o=a(o,i,r,n,e[l+2],17,606105819),n=a(n,o,i,r,e[l+3],22,-1044525330),r=a(r,n,o,i,e[l+4],7,-176418897),i=a(i,r,n,o,e[l+5],12,1200080426),o=a(o,i,r,n,e[l+6],17,-1473231341),n=a(n,o,i,r,e[l+7],22,-45705983),r=a(r,n,o,i,e[l+8],7,1770035416),i=a(i,r,n,o,e[l+9],12,-1958414417),o=a(o,i,r,n,e[l+10],17,-42063),n=a(n,o,i,r,e[l+11],22,-1990404162),r=a(r,n,o,i,e[l+12],7,1804603682),i=a(i,r,n,o,e[l+13],12,-40341101),o=a(o,i,r,n,e[l+14],17,-1502002290),r=u(r,n=a(n,o,i,r,e[l+15],22,1236535329),o,i,e[l+1],5,-165796510),i=u(i,r,n,o,e[l+6],9,-1069501632),o=u(o,i,r,n,e[l+11],14,643717713),n=u(n,o,i,r,e[l+0],20,-373897302),r=u(r,n,o,i,e[l+5],5,-701558691),i=u(i,r,n,o,e[l+10],9,38016083),o=u(o,i,r,n,e[l+15],14,-660478335),n=u(n,o,i,r,e[l+4],20,-405537848),r=u(r,n,o,i,e[l+9],5,568446438),i=u(i,r,n,o,e[l+14],9,-1019803690),o=u(o,i,r,n,e[l+3],14,-187363961),n=u(n,o,i,r,e[l+8],20,1163531501),r=u(r,n,o,i,e[l+13],5,-1444681467),i=u(i,r,n,o,e[l+2],9,-51403784),o=u(o,i,r,n,e[l+7],14,1735328473),r=s(r,n=u(n,o,i,r,e[l+12],20,-1926607734),o,i,e[l+5],4,-378558),i=s(i,r,n,o,e[l+8],11,-2022574463),o=s(o,i,r,n,e[l+11],16,1839030562),n=s(n,o,i,r,e[l+14],23,-35309556),r=s(r,n,o,i,e[l+1],4,-1530992060),i=s(i,r,n,o,e[l+4],11,1272893353),o=s(o,i,r,n,e[l+7],16,-155497632),n=s(n,o,i,r,e[l+10],23,-1094730640),r=s(r,n,o,i,e[l+13],4,681279174),i=s(i,r,n,o,e[l+0],11,-358537222),o=s(o,i,r,n,e[l+3],16,-722521979),n=s(n,o,i,r,e[l+6],23,76029189),r=s(r,n,o,i,e[l+9],4,-640364487),i=s(i,r,n,o,e[l+12],11,-421815835),o=s(o,i,r,n,e[l+15],16,530742520),r=c(r,n=s(n,o,i,r,e[l+2],23,-995338651),o,i,e[l+0],6,-198630844),i=c(i,r,n,o,e[l+7],10,1126891415),o=c(o,i,r,n,e[l+14],15,-1416354905),n=c(n,o,i,r,e[l+5],21,-57434055),r=c(r,n,o,i,e[l+12],6,1700485571),i=c(i,r,n,o,e[l+3],10,-1894986606),o=c(o,i,r,n,e[l+10],15,-1051523),n=c(n,o,i,r,e[l+1],21,-2054922799),r=c(r,n,o,i,e[l+8],6,1873313359),i=c(i,r,n,o,e[l+15],10,-30611744),o=c(o,i,r,n,e[l+6],15,-1560198380),n=c(n,o,i,r,e[l+13],21,1309151649),r=c(r,n,o,i,e[l+4],6,-145523070),i=c(i,r,n,o,e[l+11],10,-1120210379),o=c(o,i,r,n,e[l+2],15,718787259),n=c(n,o,i,r,e[l+9],21,-343485551),r=f(r,d),n=f(n,h),o=f(o,p),i=f(i,y)}return[r,n,o,i]}function i(e,t,r,n,o,i){return f((a=f(f(t,e),f(n,i)))<<(u=o)|a>>>32-u,r);var a,u}function a(e,t,r,n,o,a,u){return i(t&r|~t&n,e,t,o,a,u)}function u(e,t,r,n,o,a,u){return i(t&n|r&~n,e,t,o,a,u)}function s(e,t,r,n,o,a,u){return i(t^r^n,e,t,o,a,u)}function c(e,t,r,n,o,a,u){return i(r^(t|~n),e,t,o,a,u)}function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}e.exports=function(e){return n(e,o)}},4098:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=h(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=p(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=f(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=f(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),l(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),l(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){var r,n,o=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),g.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},v.call(m.prototype),v.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];E.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(x){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(e,r){return new Promise((function(n,i){var a=new m(e,r);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var e,t,r={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var o="response"in u?u.response:u.responseText;n(new E(o,r))},u.onerror=function(){i(new TypeError("Network request failed"))},u.ontimeout=function(){i(new TypeError("Network request failed"))},u.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&o&&(u.responseType="blob"),a.headers.forEach((function(e,t){u.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}C.polyfill=!0,e.fetch||(e.fetch=C,e.Headers=d,e.Request=m,e.Response=E),t.Headers=d,t.Request=m,t.Response=E,t.fetch=C,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},4550:function(e){e.exports=[{code:"AED",number:"784",digits:2,currency:"United Arab Emirates dirham",countries:["united arab emirates"]},{code:"AFN",number:"971",digits:2,currency:"Afghan afghani",countries:["afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Albanian lek",countries:["albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian dram",countries:["armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean guilder",countries:["curaçao","sint maarten"]},{code:"AOA",number:"973",digits:2,currency:"Angolan kwanza",countries:["angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine peso",countries:["argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian dollar",countries:["australia","australian antarctic territory","christmas island","cocos (keeling) islands","heard and mcdonald islands","kiribati","nauru","norfolk island","tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban florin",countries:["aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijani manat",countries:["azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Bosnia and Herzegovina convertible mark",countries:["bosnia and herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados dollar",countries:["barbados"]},{code:"BDT",number:"050",digits:2,currency:"Bangladeshi taka",countries:["bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian lev",countries:["bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini dinar",countries:["bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundian franc",countries:["burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian dollar",countries:["bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei dollar",countries:["brunei","singapore"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["bolivia"]},{code:"BOV",number:"984",digits:2,currency:"Bolivian Mvdol (funds code)",countries:["bolivia"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian real",countries:["brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian dollar",countries:["bahamas"]},{code:"BTN",number:"064",digits:2,currency:"Bhutanese ngultrum",countries:["bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Botswana pula",countries:["botswana"]},{code:"BYR",number:"974",digits:0,currency:"Belarusian ruble",countries:["belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize dollar",countries:["belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian dollar",countries:["canada","saint pierre and miquelon"]},{code:"CDF",number:"976",digits:2,currency:"Congolese franc",countries:["democratic republic of congo"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro (complementary currency)",countries:["switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss franc",countries:["switzerland","liechtenstein"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc (complementary currency)",countries:["switzerland"]},{code:"CLF",number:"990",digits:0,currency:"Unidad de Fomento (funds code)",countries:["chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean peso",countries:["chile"]},{code:"CNY",number:"156",digits:2,currency:"Chinese yuan",countries:["china"]},{code:"COP",number:"170",digits:2,currency:"Colombian peso",countries:["colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican colon",countries:["costa rica"]},{code:"CUC",number:"931",digits:2,currency:"Cuban convertible peso",countries:["cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban peso",countries:["cuba"]},{code:"CVE",number:"132",digits:0,currency:"Cape Verde escudo",countries:["cape verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech koruna",countries:["czech republic"]},{code:"DJF",number:"262",digits:0,currency:"Djiboutian franc",countries:["djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish krone",countries:["denmark","faroe islands","greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican peso",countries:["dominican republic"]},{code:"DZD",number:"012",digits:2,currency:"Algerian dinar",countries:["algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian pound",countries:["egypt","palestinian territories"]},{code:"ERN",number:"232",digits:2,currency:"Eritrean nakfa",countries:["eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian birr",countries:["ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["andorra","austria","belgium","cyprus","estonia","finland","france","germany","greece","ireland","italy","kosovo","luxembourg","malta","monaco","montenegro","netherlands","portugal","san marino","slovakia","slovenia","spain","vatican city"]},{code:"FJD",number:"242",digits:2,currency:"Fiji dollar",countries:["fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands pound",countries:["falkland islands"]},{code:"GBP",number:"826",digits:2,currency:"Pound sterling",countries:["united kingdom","british crown dependencies (the isle of man and the channel islands)","south georgia and the south sandwich islands","british antarctic territory","british indian ocean territory"]},{code:"GEL",number:"981",digits:2,currency:"Georgian lari",countries:["georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghanaian cedi",countries:["ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar pound",countries:["gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Gambian dalasi",countries:["gambia"]},{code:"GNF",number:"324",digits:0,currency:"Guinean franc",countries:["guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Guatemalan quetzal",countries:["guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyanese dollar",countries:["guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong dollar",countries:["hong kong","macao"]},{code:"HNL",number:"340",digits:2,currency:"Honduran lempira",countries:["honduras"]},{code:"HRK",number:"191",digits:2,currency:"Croatian kuna",countries:["croatia"]},{code:"HTG",number:"332",digits:2,currency:"Haitian gourde",countries:["haiti"]},{code:"HUF",number:"348",digits:2,currency:"Hungarian forint",countries:["hungary"]},{code:"IDR",number:"360",digits:0,currency:"Indonesian rupiah",countries:["indonesia"]},{code:"ILS",number:"376",digits:2,currency:"Israeli new shekel",countries:["israel","palestinian territories"]},{code:"INR",number:"356",digits:2,currency:"Indian rupee",countries:["india"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi dinar",countries:["iraq"]},{code:"IRR",number:"364",digits:0,currency:"Iranian rial",countries:["iran"]},{code:"ISK",number:"352",digits:0,currency:"Icelandic króna",countries:["iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican dollar",countries:["jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian dinar",countries:["jordan"]},{code:"JPY",number:"392",digits:0,currency:"Japanese yen",countries:["japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan shilling",countries:["kenya"]},{code:"KGS",number:"417",digits:2,currency:"Kyrgyzstani som",countries:["kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Cambodian riel",countries:["cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comoro franc",countries:["comoros"]},{code:"KPW",number:"408",digits:0,currency:"North Korean won",countries:["north korea"]},{code:"KRW",number:"410",digits:0,currency:"South Korean won",countries:["south korea"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti dinar",countries:["kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands dollar",countries:["cayman islands"]},{code:"KZT",number:"398",digits:2,currency:"Kazakhstani tenge",countries:["kazakhstan"]},{code:"LAK",number:"418",digits:0,currency:"Lao kip",countries:["laos"]},{code:"LBP",number:"422",digits:0,currency:"Lebanese pound",countries:["lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lankan rupee",countries:["sri lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian dollar",countries:["liberia"]},{code:"LSL",number:"426",digits:2,currency:"Lesotho loti",countries:["lesotho"]},{code:"LTL",number:"440",digits:2,currency:"Lithuanian litas",countries:["lithuania"]},{code:"LVL",number:"428",digits:2,currency:"Latvian lats",countries:["latvia"]},{code:"LYD",number:"434",digits:3,currency:"Libyan dinar",countries:["libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan dirham",countries:["morocco"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan leu",countries:["moldova (except transnistria)"]},{code:"MGA",number:"969",digits:0,currency:"*[8]\tMalagasy ariary",countries:["madagascar"]},{code:"MKD",number:"807",digits:0,currency:"Macedonian denar",countries:["macedonia"]},{code:"MMK",number:"104",digits:0,currency:"Myanma kyat",countries:["myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Mongolian tugrik",countries:["mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Macanese pataca",countries:["macao"]},{code:"MRO",number:"478",digits:0,currency:"*[8]\tMauritanian ouguiya",countries:["mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritian rupee",countries:["mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Maldivian rufiyaa",countries:["maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawian kwacha",countries:["malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican peso",countries:["mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI) (funds code)",countries:["mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian ringgit",countries:["malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambican metical",countries:["mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibian dollar",countries:["namibia"]},{code:"NGN",number:"566",digits:2,currency:"Nigerian naira",countries:["nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Nicaraguan córdoba",countries:["nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian krone",countries:["norway","svalbard","jan mayen","bouvet island","queen maud land","peter i island"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese rupee",countries:["nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand dollar",countries:["cook islands","new zealand","niue","pitcairn","tokelau","ross dependency"]},{code:"OMR",number:"512",digits:3,currency:"Omani rial",countries:["oman"]},{code:"PAB",number:"590",digits:2,currency:"Panamanian balboa",countries:["panama"]},{code:"PEN",number:"604",digits:2,currency:"Peruvian nuevo sol",countries:["peru"]},{code:"PGK",number:"598",digits:2,currency:"Papua New Guinean kina",countries:["papua new guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine peso",countries:["philippines"]},{code:"PKR",number:"586",digits:2,currency:"Pakistani rupee",countries:["pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Polish złoty",countries:["poland"]},{code:"PYG",number:"600",digits:0,currency:"Paraguayan guaraní",countries:["paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari riyal",countries:["qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian new leu",countries:["romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian dinar",countries:["serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian rouble",countries:["russia","abkhazia","south ossetia"]},{code:"RWF",number:"646",digits:0,currency:"Rwandan franc",countries:["rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi riyal",countries:["saudi arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands dollar",countries:["solomon islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles rupee",countries:["seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese pound",countries:["sudan"]},{code:"SEK",number:"752",digits:2,currency:"Swedish krona/kronor",countries:["sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore dollar",countries:["singapore","brunei"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena pound",countries:["saint helena"]},{code:"SLL",number:"694",digits:0,currency:"Sierra Leonean leone",countries:["sierra leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali shilling",countries:["somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinamese dollar",countries:["suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese pound",countries:["south sudan"]},{code:"STD",number:"678",digits:0,currency:"São Tomé and Príncipe dobra",countries:["são tomé and príncipe"]},{code:"SYP",number:"760",digits:2,currency:"Syrian pound",countries:["syria"]},{code:"SZL",number:"748",digits:2,currency:"Swazi lilangeni",countries:["swaziland"]},{code:"THB",number:"764",digits:2,currency:"Thai baht",countries:["thailand"]},{code:"TJS",number:"972",digits:2,currency:"Tajikistani somoni",countries:["tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistani manat",countries:["turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian dinar",countries:["tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Tongan paʻanga",countries:["tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish lira",countries:["turkey","northern cyprus"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago dollar",countries:["trinidad and tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan dollar",countries:["republic of china (taiwan)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian shilling",countries:["tanzania"]},{code:"UAH",number:"980",digits:2,currency:"Ukrainian hryvnia",countries:["ukraine"]},{code:"UGX",number:"800",digits:2,currency:"Ugandan shilling",countries:["uganda"]},{code:"USD",number:"840",digits:2,currency:"United States dollar",countries:["american samoa","barbados","bermuda","british indian ocean territory","british virgin islands, caribbean netherlands","ecuador","el salvador","guam","haiti","marshall islands","federated states of micronesia","northern mariana islands","palau","panama","puerto rico","timor-leste","turks and caicos islands","united states","u.s. virgin islands","zimbabwe"]},{code:"USN",number:"997",digits:2,currency:"United States dollar (next day) (funds code)",countries:["united states"]},{code:"USS",number:"998",digits:2,currency:"United States dollar",countries:["united states"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas",countries:["uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Uruguayan peso",countries:["uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan som",countries:["uzbekistan"]},{code:"VEF",number:"937",digits:2,currency:"Venezuelan bolívar",countries:["venezuela"]},{code:"VND",number:"704",digits:0,currency:"Vietnamese dong",countries:["vietnam"]},{code:"VUV",number:"548",digits:0,currency:"Vanuatu vatu",countries:["vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Samoan tala",countries:["samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA franc BEAC",countries:["cameroon","central african republic","republic of the congo","chad","equatorial guinea","gabon"]},{code:"XAG",number:"961",currency:"Silver (one troy ounce)"},{code:"XAU",number:"959",currency:"Gold (one troy ounce)"},{code:"XBA",number:"955",currency:"European Composite Unit (EURCO) (bond market unit)\t"},{code:"XBB",number:"956",currency:"European Monetary Unit (E.M.U.-6) (bond market unit)\t"},{code:"XBC",number:"957",currency:"European Unit of Account 9 (E.U.A.-9) (bond market unit)\t"},{code:"XBD",number:"958",currency:"European Unit of Account 17 (E.U.A.-17) (bond market unit)\t"},{code:"XBT",currency:"Bitcoin"},{code:"XCD",number:"951",digits:2,currency:"East Caribbean dollar",countries:["anguilla","antigua and barbuda","dominica","grenada","montserrat","saint kitts and nevis","saint lucia","saint vincent and the grenadines"]},{code:"XDR",number:"960",currency:"Special drawing rights",countries:["international monetary fund"]},{code:"XFU",currency:"UIC franc (special settlement currency)",countries:["international union of railways"]},{code:"XOF",number:"952",digits:0,currency:"CFA franc BCEAO",countries:["benin","burkina faso","côte d'ivoire","guinea-bissau","mali","niger","senegal","togo"]},{code:"XPD",number:"964",currency:"Palladium (one troy ounce)"},{code:"XPF",number:"953",digits:0,currency:"CFP franc (Franc du Pacifique)",countries:["french polynesia","new caledonia","wallis and futuna"]},{code:"XPT",number:"962",currency:"Platinum (one troy ounce)"},{code:"XTS",number:"963",currency:"Code reserved for testing purposes"},{code:"XXX",number:"999",currency:"No currency"},{code:"YER",number:"886",digits:2,currency:"Yemeni rial",countries:["yemen"]},{code:"ZAR",number:"710",digits:2,currency:"South African rand",countries:["south africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian kwacha",countries:["zambia"]}]},3546:function(e,t,r){var n=r(7680),o=r(2719),i=r(4550);t.Rx=function(e){return n(i,(function(t){return t.number===String(e)}))}},4289:function(e,t,r){"use strict";var n=r(2215),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=Object.defineProperty,s=u&&function(){var e={};try{for(var t in u(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(r){return!1}}(),c=function(e,t,r,n){var o;(!(t in e)||"function"==typeof(o=n)&&"[object Function]"===i.call(o)&&n())&&(s?u(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},f=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var u=0;u<i.length;u+=1)c(e,i[u],t[i[u]],r[i[u]])};f.supportsDescriptors=!!s,e.exports=f},4638:function(e,t,r){"use strict";var n=r(9911);function o(e){throw new Error("makeNodeDisklet is not available on this platform")}function i(){throw new Error("makeReactNativeDisklet is not available on this platform")}function a(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,s,"next",e)}function s(e){a(i,n,o,u,s,"throw",e)}u(void 0)}))}}function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function c(e){if(/^\//.test(e))throw new Error("Absolute paths are not supported");for(var t=e.split("/"),r=0,n=0;r<t.length;){var o=t[r++];if(".."===o?n--:"."!==o&&""!==o&&(t[n++]=o),n<0)throw new Error("Path would escape folder")}return t.slice(0,n).join("/")}function f(e){return""===e?e:e+"/"}function l(e){for(var t=[],r=0;r<e.length;++r){var n=e.key(r);null!=n&&t.push(n)}return t}function d(e,t){void 0===e&&(e=window.localStorage),void 0===t&&(t={});var r=null!=t.prefix?f(t.prefix):"/";return{delete:function(t){var n=c(t);null!=e.getItem(r+n)&&e.removeItem(r+n);for(var o=f(n),i=0,a=l(e);i<a.length;i++){var u=a[i];0===u.indexOf(r+o)&&e.removeItem(u)}return Promise.resolve()},getData:function(e){return this.getText(e).then((function(e){return n.base64.parse(e)}))},getText:function(t){var n=c(t),o=e.getItem(r+n);return null==o?Promise.reject(new Error('Cannot load "'+n+'"')):Promise.resolve(o)},list:function(t){return u((function*(){void 0===t&&(t="");var n=c(t),o={};null!=e.getItem(r+n)&&(o[n]="file");for(var i=f(n),a=0,u=l(e);a<u.length;a++){var s=u[a];if(0===s.indexOf(r+i)){var d=s.indexOf("/",r.length+i.length);d<0?o[s.slice(r.length)]="file":o[s.slice(r.length,d)]="folder"}}return o}))()},setData:function(e,t){return this.setText(e,n.base64.stringify(t))},setText:function(t,n){return"string"!=typeof n?Promise.reject(new TypeError("setText expects a string")):(e.setItem(r+c(t),n),Promise.resolve())}}}function h(e){return void 0===e&&(e={}),{delete:function(t){var r=c(t);null!=e["/"+r]&&delete e["/"+r];for(var n=f(r),o=0,i=Object.keys(e);o<i.length;o++){var a=i[o];0===a.indexOf("/"+n)&&delete e[a]}return Promise.resolve()},getData:function(t){var r=c(t),n=e["/"+r];return null==n?Promise.reject(new Error('Cannot load "'+r+'"')):"string"==typeof n?Promise.reject(new Error('"'+r+'" is a text file.')):Promise.resolve(n)},getText:function(t){var r=c(t),n=e["/"+r];return null==n?Promise.reject(new Error('Cannot load "'+r+'"')):"string"!=typeof n?Promise.reject(new Error('"'+r+'" is a binary file.')):Promise.resolve(n)},list:function(t){return u((function*(){void 0===t&&(t="");var r=c(t),n={};null!=e["/"+r]&&(n[r]="file");for(var o=f(r),i=0,a=Object.keys(e);i<a.length;i++){var u=a[i];if(0===u.indexOf("/"+o)){var s=u.indexOf("/",1+o.length);s<0?n[u.slice(1)]="file":n[u.slice(1,s)]="folder"}}return n}))()},setData:function(t,r){var n=r,o=Uint8Array.from(n);return e["/"+c(t)]=o,Promise.resolve()},setText:function(t,r){return"string"!=typeof r?Promise.reject(new TypeError("setText expects a string")):(e["/"+c(t)]=r,Promise.resolve())}}}var p=function(){function e(e,t){this._disklet=e,this._path=t}var t=e.prototype;return t.delete=function(){return this._disklet.delete(this._path)},t.getData=function(){return this._disklet.getData(this._path)},t.getText=function(){return this._disklet.getText(this._path)},t.setData=function(e){return this._disklet.setData(this._path,e)},t.setText=function(e){return this._disklet.setText(this._path,e)},e}(),y=function(){function e(e,t){this._disklet=e,this._path=t}var t=e.prototype;return t.delete=function(){return this._disklet.delete(this._path)},t.file=function(e){return new p(this._disklet,this._path+"/"+e)},t.folder=function(t){return new e(this._disklet,this._path+"/"+t)},t.listFiles=function(){return this._disklet.list(this._path).then((function(e){return Object.keys(e).filter((function(t){return"file"===e[t]})).map((function(e){return e.replace(/^.*\//,"")}))}))},t.listFolders=function(){return this._disklet.list(this._path).then((function(e){return Object.keys(e).filter((function(t){return"folder"===e[t]})).map((function(e){return e.replace(/^.*\//,"")}))}))},e}();function b(e){return new y(e,".")}function v(e,t){for(var r=0,n=0;r<t.length;){var o=t[r++];if(".."===o?n--:"."!==o&&""!==o&&(t[n++]=o),n<0)throw new Error("Path would escape folder")}for(r=0;r<n;++r)e=e.folder(t[r]);return e}function g(e,t){return e.listFiles().then((function(r){return Promise.all(r.map((function(r){return t(e.file(r),r,e)})))}))}function m(e,t){return e.listFolders().then((function(r){return Promise.all(r.map((function(r){return t(e.folder(r),r,e)})))}))}function w(e,t){console.log(t+' "'+e+'"')}function E(e,t,r){var n=r.callback,o=void 0===n?w:n,i=r.verbose;(void 0!==i&&i||/set|delete/.test(t))&&o(e,t)}var _=function(){function e(e,t,r){this._file=e,this._path=t,this._opts=r}var t=e.prototype;return t.delete=function(){return E(this._path,"delete file",this._opts),this._file.delete()},t.getData=function(){return E(this._path,"get data",this._opts),this._file.getData()},t.getText=function(){return E(this._path,"get text",this._opts),this._file.getText()},t.setData=function(e){return E(this._path,"set data",this._opts),this._file.setData(e)},t.setText=function(e){return E(this._path,"set text",this._opts),this._file.setText(e)},t.getPath=function(){return this._path},e}(),C=function(){function e(e,t,r){this._folder=e,this._path=t,this._opts=r}var t=e.prototype;return t.delete=function(){return E(this._path,"delete folder",this._opts),this._folder.delete()},t.file=function(e){return new _(this._folder.file(e),this._path+e,this._opts)},t.folder=function(t){return new e(this._folder.folder(t),this._path+t+"/",this._opts)},t.listFiles=function(){return E(this._path,"list files",this._opts),this._folder.listFiles()},t.listFolders=function(){return E(this._path,"list folders",this._opts),this._folder.listFolders()},e}();function x(e,t){var r={},n=[];return e.forEach((function(e){/\._x_$/.test(e)?r[e]=!0:(r[e+"._x_"]=!0,n.push(e))})),t.forEach((function(e){r[e+"._x_"]||n.push(e)})),n}var S=function(){function e(e,t,r){this._master=e,this._fallback=t,this._whiteout=r}var t=e.prototype;return t.delete=function(){return Promise.all([this._whiteout.setData([]),this._master.delete().catch((function(e){return null}))])},t.getData=function(){var e=this;return this._master.getData().catch((function(t){return e._whiteout.getData().then((function(e){throw new Error("File has been deleted")}),(function(t){return e._fallback.getData()}))}))},t.getText=function(){var e=this;return this._master.getText().catch((function(t){return e._whiteout.getData().then((function(e){throw new Error("File has been deleted")}),(function(t){return e._fallback.getText()}))}))},t.setData=function(e){return this._master.setData(e)},t.setText=function(e){return this._master.setText(e)},t.getPath=function(){throw new Error("Cannot call getPath on a Union Folder")},e}(),A=function(){function e(e,t){this._master=e,this._fallback=t}var t=e.prototype;return t.delete=function(){return Promise.all([g(this,(function(e){return e.delete()})),m(this,(function(e){return e.delete()}))]).then((function(){}))},t.file=function(e){return new S(this._master.file(e),this._fallback.file(e),this._master.file(e+"._x_"))},t.folder=function(t){return new e(this._master.folder(t),this._fallback.folder(t))},t.listFiles=function(){return Promise.all([this._master.listFiles(),this._fallback.listFiles()]).then((function(e){return x(e[0],e[1])}))},t.listFolders=function(){return Promise.all([this._master.listFolders(),this._fallback.listFolders()]).then((function(e){return x(e[0],e[1])}))},e}();function I(e,t){var r=f(c(t));return{delete:function(t){return e.delete(r+t)},getData:function(t){return e.getData(r+t)},getText:function(t){return e.getText(r+t)},list:function(t){return void 0===t&&(t="."),e.list(r+t).then((function(e){var t={};for(var n in e)t[n.replace(r,"")]=e[n];return t}))},setData:function(t,n){return e.setData(r+t,n)},setText:function(t,n){return e.setText(r+t,n)}}}t.gQ=function(e){return Object.keys(e).filter((function(t){return"file"===e[t]}))},t.ji=function(e){return Object.keys(e).filter((function(t){return"folder"===e[t]}))},t.Wh=h,t.Cl=function(e,t){return{delete:function(r){return Promise.all([e.delete(r),t.delete(r)])},getData:function(r){return e.getData(r).catch((function(e){return t.getData(r)}))},getText:function(r){return e.getText(r).catch((function(e){return t.getText(r)}))},list:function(r){return Promise.all([e.list(r),t.list(r)]).then((function(e){var t=e[0];return s(e[1],t)}))},setData:function(t,r){return e.setData(t,r)},setText:function(t,r){return e.setText(t,r)}}},t.HN=I},1649:function(e,t,r){"use strict";var n=r(7630),o=r(4098),i=r(9176),a=r(3715),u=r(9911);function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(o),f=s(i),l=s(a);const d=/^[a-z0-9-_.]+(\/+[a-z0-9-_.]+)*$/i,h=/^[a-f0-9]{40}$/,p=e=>{const t=n.asString(e);if(""===t)throw new TypeError("Expected non empty string");return t},y=e=>{const t=n.asString(e);if(!h.test(t))throw new TypeError(`Invalid sync key '${t}'`);return t},b=n.asObject({iv_hex:n.asString,encryptionType:n.asNumber,data_base64:n.asString}),v=n.asObject({success:n.asValue(!1),message:n.asString,stack:n.asOptional(n.asString)}),g=n.asEither(b,n.asNull),m=n.asObject(g),w=n.asObject({syncKey:y,hash:n.asOptional(p)}),E=n.asObject({hash:n.asOptional(n.asString),changes:m}),_=n.asObject({syncKey:y,hash:n.asOptional(p)}),C=n.asObject({changes:m}),x=n.asObject({hash:n.asString,changes:m}),S=n.asObject({syncKey:y}),A=n.asUndefined,I=()=>{};async function O(e,t,r={}){const{log:o=I,fetch:i=c.default}=r,{method:a,url:u,body:s,numbUrl:f=u,headers:l={}}=e,d=Date.now(),h=await i(u,{method:a,headers:{"Content-Type":"application/json",...l},body:JSON.stringify(s)}),p=Date.now()-d;o(`${a} ${f} returned ${h.status} in ${p}ms`);const y=await h.text();if(!h.ok)throw new Error(`Failed request ${a} ${f} failed ${h.status}: ${y}`);const b=n.asMaybe(v)(y);if(null!=b)throw new Error(`Failed request ${a} ${f} failed ${h.status}: ${b.message}`);return t(""!==y.trim()?JSON.parse(y):void 0)}const T=f.default("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),k=e=>{const t=P(P(u.base16.parse(e)));return T.encode(t)};function P(e){const t=l.default.sha256();return Uint8Array.from(t.update(e).digest())}class B extends Error{constructor(e="Cannot reach the network"){super(e),this.name="NetworkError"}}const R=n.asObject({infoServers:n.asArray(n.asString),syncServers:n.asArray(n.asString)}),j={infoServers:["https://info1.edge.app"],syncServers:["https://sync-us1.edge.app","https://sync-us2.edge.app","https://sync-us3.edge.app","https://sync-us4.edge.app","https://sync-us5.edge.app","https://sync-us6.edge.app","https://sync-eu1.edge.app","https://sync-eu2.edge.app","https://sync-eu3.edge.app","https://sync-eu4.edge.app","https://sync-eu5.edge.app","https://sync-eu6.edge.app"]};function M(e={}){const{serverInfoCacheTTL:t=6e5}=e;let r=j.infoServers;const n=function(e,t){let r=Date.now()+t,n=e(void 0);return{get:()=>{if(Date.now()>r||null==n){r=Date.now()+t;const o=e(n);n=o}return n}}}((async(t=Promise.resolve(j))=>await async function(e,t={}){const{log:r=I,fetch:n=c.default}=t;let o=new Error("No info servers");for(const a of e){const[e,t]=["GET","/v1/edgeServers"],u=Date.now(),s=`${a}${t}`;try{const t=await n(s,{method:e,headers:{"Content-Type":"application/json"}}).catch((t=>{const n=Date.now()-u,o=`${e} ${s} failed in ${n}ms, ${String(t)}`;throw r(o),new B(o)})),{ok:o,status:i}=t,a=Date.now()-u,c=`${e} ${s} returned ${i} in ${a}ms`;if(!o)throw r(c),new B(c);r(c);const f=await t.text(),l=JSON.parse(f);return R(l)}catch(i){o=i;continue}}throw o}(r,e).catch((async e=>await t))),t);return{async getEdgeServers(){const e=await n.get();return e.infoServers.length>0&&(r=e.infoServers),e}}}function N(e,t){return null!=e?e:t()}t.bS=m,t.Ei=b,t.wJ=g,t.PG=w,t.SR=E,t.Th=p,t.Qw=e=>{const t=n.asString(e);try{if(d.test(t))return function(e){if(/^\//.test(e))throw new Error("Absolute paths are not supported");const t=e.split("/");let r=0,n=0;for(;r<t.length;){const e=t[r++];if(".."===e?n--:"."!==e&&""!==e&&(t[n++]=e),n<0)throw new Error("Path would escape folder");if(0===n&&r===t.length)throw new Error("Path would evaluate to empty file name")}return t.slice(0,n).join("/")}(t)}catch(r){}throw new Error(`Invalid path '${t}'`)},t.YK=C,t.KI=_,t.Wn=x,t.tp=S,t.RQ=A,t.tE=v,t.Jj=y,t.LZ=function(e={}){const t=M(e);async function r(){const{syncServers:e}=await t.getEdgeServers();return function(e){for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e}(e)}return{async createRepo(t,n){const o=await r();let i=new Error(`Failed to create repo ${t}: empty sync server list`);for(const r of o){const o=`${r}/api/v2/store/${t}`,u=o.replace(t,`<${k(t)}>`);try{return await O({method:"PUT",url:o,numbUrl:u,headers:null!=n?{"X-API-Key":n}:{}},A,e)}catch(a){i=a}}throw i},async readRepo(t,n){const o=await r();let i=new Error(`Failed to read repo ${t}: empty sync server list`);for(const r of o){const o=`${r}/api/v2/store/${t}/${N(n,(()=>""))}`,u=o.replace(t,`<${k(t)}>`);try{return await O({method:"GET",url:o,numbUrl:u},E,e)}catch(a){i=a}}throw i},async updateRepo(t,n,o){const i=await r();let a=new Error(`Failed to update repo ${t}: empty sync server list`);for(const r of i){const i=`${r}/api/v2/store/${t}/${N(n,(()=>""))}`,s=i.replace(t,`<${k(t)}>`);try{return await O({method:"POST",url:i,numbUrl:s,body:o},x,e)}catch(u){a=u}}throw a}}},t.m8=k},6266:function(e,t,r){"use strict";var n=t;n.version=r(8597).i8,n.utils=r(953),n.rand=r(9931),n.curve=r(8254),n.curves=r(5427),n.ec=r(7954),n.eddsa=r(5980)},4918:function(e,t,r){"use strict";var n=r(3550),o=r(953),i=o.getNAF,a=o.getJSF,u=o.assert;function s(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(e,t){u(e.precomputed);var r=e._getDoubles(),n=i(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var a,s,c=[];for(a=0;a<n.length;a+=r.step){s=0;for(var f=a+r.step-1;f>=a;f--)s=(s<<1)+n[f];c.push(s)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=o;h>0;h--){for(a=0;a<c.length;a++)(s=c[a])===h?d=d.mixedAdd(r.points[a]):s===-h&&(d=d.mixedAdd(r.points[a].neg()));l=l.add(d)}return l.toP()},s.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,a=i(t,r,this._bitLength),s=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,s=s.dblp(f),c<0)break;var l=a[c];u(0!==l),s="affine"===e.type?l>0?s.mixedAdd(o[l-1>>1]):s.mixedAdd(o[-l-1>>1].neg()):l>0?s.add(o[l-1>>1]):s.add(o[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},s.prototype._wnafMulAdd=function(e,t,r,n,o){var u,s,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(u=0;u<n;u++){var p=(c=t[u])._getNAFPoints(e);f[u]=p.wnd,l[u]=p.points}for(u=n-1;u>=1;u-=2){var y=u-1,b=u;if(1===f[y]&&1===f[b]){var v=[t[y],null,null,t[b]];0===t[y].y.cmp(t[b].y)?(v[1]=t[y].add(t[b]),v[2]=t[y].toJ().mixedAdd(t[b].neg())):0===t[y].y.cmp(t[b].y.redNeg())?(v[1]=t[y].toJ().mixedAdd(t[b]),v[2]=t[y].add(t[b].neg())):(v[1]=t[y].toJ().mixedAdd(t[b]),v[2]=t[y].toJ().mixedAdd(t[b].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[y],r[b]);for(h=Math.max(m[0].length,h),d[y]=new Array(h),d[b]=new Array(h),s=0;s<h;s++){var w=0|m[0][s],E=0|m[1][s];d[y][s]=g[3*(w+1)+(E+1)],d[b][s]=0,l[y]=v}}else d[y]=i(r[y],f[y],this._bitLength),d[b]=i(r[b],f[b],this._bitLength),h=Math.max(d[y].length,h),h=Math.max(d[b].length,h)}var _=this.jpoint(null,null,null),C=this._wnafT4;for(u=h;u>=0;u--){for(var x=0;u>=0;){var S=!0;for(s=0;s<n;s++)C[s]=0|d[s][u],0!==C[s]&&(S=!1);if(!S)break;x++,u--}if(u>=0&&x++,_=_.dblp(x),u<0)break;for(s=0;s<n;s++){var A=C[s];0!==A&&(A>0?c=l[s][A-1>>1]:A<0&&(c=l[s][-A-1>>1].neg()),_="affine"===c.type?_.mixedAdd(c):_.add(c))}}for(u=0;u<n;u++)l[u]=null;return o?_:_.toP()},s.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},s.prototype.decodePoint=function(e,t){e=o.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?u(e[e.length-1]%2==0):7===e[0]&&u(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return o.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1138:function(e,t,r){"use strict";var n=r(953),o=r(3550),i=r(5717),a=r(4918),u=n.assert;function s(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,i){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(s,a),e.exports=s,s.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},s.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},s.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},s.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),u=a.redSqrt();if(0!==u.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=u.fromRed().isOdd();return(t&&!s||!t&&s)&&(u=u.redNeg()),this.point(e,u)},s.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=a.redSqrt();if(0!==u.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)},s.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(o)},i(c,a.BasePoint),s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},s.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),a=i.redSub(r),u=n.redSub(t),s=o.redMul(a),c=i.redMul(u),f=o.redMul(u),l=a.redMul(i);return this.curve.point(s,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n,o,i,a=this.x.redAdd(this.y).redSqr(),u=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(u)).redAdd(s);this.zOne?(e=a.redSub(u).redSub(s).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(s)),r=c.redSqr().redSub(c).redSub(c)):(o=this.z.redSqr(),i=c.redSub(o).redISub(o),e=a.redSub(u).redISub(s).redMul(i),t=c.redMul(n.redSub(s)),r=c.redMul(i))}else n=u.redAdd(s),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(u.redISub(s)),r=n.redMul(i);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),a=o.redSub(n),u=o.redAdd(n),s=r.redAdd(t),c=i.redMul(a),f=u.redMul(s),l=i.redMul(s),d=a.redMul(u);return this.curve.point(c,f,d,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),o=n.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),u=this.curve.d.redMul(i).redMul(a),s=o.redSub(u),c=o.redAdd(u),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),l=n.redMul(s).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(i))),r=s.redMul(c)):(t=n.redMul(c).redMul(a.redSub(i)),r=this.curve._mulC(s).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},8254:function(e,t,r){"use strict";var n=t;n.base=r(4918),n.short=r(6673),n.mont=r(2881),n.edwards=r(1138)},2881:function(e,t,r){"use strict";var n=r(3550),o=r(5717),i=r(4918),a=r(953);function u(e){i.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function s(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,i),e.exports=u,u.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(s,i.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},u.prototype.point=function(e,t){return new s(this,e,t)},u.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},s.prototype.precompute=function(){},s.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},s.fromJSON=function(e,t){return new s(e,t[0],t[1]||e.one)},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},s.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),o=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,o)},s.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),a=o.redMul(n),u=t.z.redMul(i.redAdd(a).redSqr()),s=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(u,s)},s.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},s.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},s.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:function(e,t,r){"use strict";var n=r(953),o=r(3550),i=r(5717),a=r(4918),u=n.assert;function s(e){a.call(this,"short",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(t,16),this.y=new o(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(t,16),this.y=new o(r,16),this.z=new o(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(s,a),e.exports=s,s.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new o(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new o(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],u(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new o(e.a,16),b:new o(e.b,16)}})):this._getEndoBasis(r)}}},s.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o.mont(e),r=new o(2).toRed(t).redInvm(),n=r.redNeg(),i=new o(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},s.prototype._getEndoBasis=function(e){for(var t,r,n,i,a,u,s,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new o(1),y=new o(0),b=new o(0),v=new o(1),g=0;0!==d.cmpn(0);){var m=h.div(d);c=h.sub(m.mul(d)),f=b.sub(m.mul(p));var w=v.sub(m.mul(y));if(!n&&c.cmp(l)<0)t=s.neg(),r=p,n=c.neg(),i=f;else if(n&&2==++g)break;s=c,h=d,d=c,b=p,p=f,v=y,y=w}a=c.neg(),u=f;var E=n.sqr().add(i.sqr());return a.sqr().add(u.sqr()).cmp(E)>=0&&(a=t,u=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),u=u.neg()),[{a:n,b:i},{a:a,b:u}]},s.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),u=i.mul(n.a),s=o.mul(r.b),c=i.mul(n.b);return{k1:e.sub(a).sub(u),k2:s.add(c).neg()}},s.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},s.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},s.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var a=this._endoSplit(t[i]),u=e[i],s=u._getBeta();a.k1.negative&&(a.k1.ineg(),u=u.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*i]=u,n[2*i+1]=s,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var c=this._wnafMulAdd(1,n,o,2*i,r),f=0;f<2*i;f++)n[f]=null,o[f]=null;return c},i(c,a.BasePoint),s.prototype.point=function(e,t,r){return new c(this,e,t,r)},s.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new o(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(f,a.BasePoint),s.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),u=n.redSub(o),s=i.redSub(a);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=u.redSqr(),f=c.redMul(u),l=n.redMul(c),d=s.redSqr().redIAdd(f).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(f)),p=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(d,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),u=o.redSub(i);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),c=s.redMul(a),f=r.redMul(s),l=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(l)).redISub(o.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,u=this.z,s=u.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var f=i.redSqr(),l=c.redSqr(),d=l.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(s)),p=i.redMul(l),y=h.redSqr().redISub(p.redAdd(p)),b=p.redISub(y),v=h.redMul(b);v=v.redIAdd(v).redISub(d);var g=c.redMul(u);t+1<e&&(s=s.redMul(d)),i=y,u=g,c=v}return this.curve.jpoint(i,c.redMul(o),u)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n),s=u.redSqr().redISub(a).redISub(a),c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),e=s,t=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(f).redISub(d);h=h.redIAdd(h);var p=f.redAdd(f).redIAdd(f),y=p.redSqr(),b=d.redIAdd(d);b=(b=b.redIAdd(b)).redIAdd(b),e=y.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=u.redSqr().redISub(a).redISub(a);e=s;var c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),t=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(f).redMul(this.x.redAdd(f));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var b=l.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),t=h.redMul(p.redISub(e)).redISub(b)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),a=r.redSqr(),u=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),s=t.redAdd(t),c=(s=s.redIAdd(s)).redMul(a),f=u.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=u.redMul(l).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,h,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),u=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var c=o.redIAdd(a).redSqr().redISub(i).redISub(u).redISub(s),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(u).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(c.redMul(s.redISub(c)).redISub(a.redMul(u)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(u);return this.curve.jpoint(l,d,h)},f.prototype.mul=function(e,t){return e=new o(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:function(e,t,r){"use strict";var n,o=t,i=r(3715),a=r(8254),u=r(953).assert;function s(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,u(this.g.validate(),"Invalid curve"),u(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var r=new s(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:r}),r}})}o.PresetCurve=s,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(1037)}catch(f){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7954:function(e,t,r){"use strict";var n=r(3550),o=r(2156),i=r(953),a=r(5427),u=r(9931),s=i.assert,c=r(1251),f=r(611);function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(s(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new c(this,e)},l.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||u(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),u=t.getPrivate().toArray("be",a),s=e.toArray("be",a),c=new o({hash:this.hash,entropy:u,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new n(1)),d=0;;d++){var h=i.k?i.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var y=p.getX(),b=y.umod(this.n);if(0!==b.cmpn(0)){var v=h.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==y.cmp(b)?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new f({r:b,s:v,recoveryParam:g})}}}}}},l.prototype.verify=function(e,t,r,o){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,o);var i=(t=new f(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var u,s=a.invm(this.n),c=s.mul(e).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&u.eqXToP(i):!(u=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===u.getX().umod(this.n).cmp(i)},l.prototype.recoverPubKey=function(e,t,r,o){s((3&r)===r,"The recovery param is more than two bits"),t=new f(t,o);var i=this.n,a=new n(e),u=t.r,c=t.s,l=1&r,d=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");u=d?this.curve.pointFromX(u.add(this.curve.n),l):this.curve.pointFromX(u,l);var h=t.r.invm(i),p=i.sub(a).mul(h).umod(i),y=c.mul(h).umod(i);return this.g.mulAdd(p,u,y)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")}},1251:function(e,t,r){"use strict";var n=r(3550),o=r(953).assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=i,i.fromPublic=function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.validate()||o(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},611:function(e,t,r){"use strict";var n=r(3550),o=r(953),i=o.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function s(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=t.place;i<n;i++,a++)o<<=8,o|=e[a],o>>>=0;return!(o<=127)&&(t.place=a,o)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=o.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;var i=s(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=s(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var f=s(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;var l=e.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var i=n.concat(r),a=[48];return f(a,i.length),a=a.concat(i),o.encode(a,e)}},5980:function(e,t,r){"use strict";var n=r(3715),o=r(5427),i=r(953),a=i.assert,u=i.parseBytes,s=r(9087),c=r(3622);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=o[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),i=this.encodePoint(o),a=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:s,Rencoded:i})},f.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(i)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return i.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return s.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return s.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=i.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),o=i.intFromLE(r);return this.curve.pointFromY(o,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return i.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},9087:function(e,t,r){"use strict";var n=r(953),o=n.assert,i=n.parseBytes,a=n.cachedProperty;function u(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(t.pub)}u.fromPublic=function(e,t){return t instanceof u?t:new u(e,{pub:t})},u.fromSecret=function(e,t){return t instanceof u?t:new u(e,{secret:t})},u.prototype.secret=function(){return this._secret},a(u,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(u,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(u,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(u,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(u,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(u,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),u.prototype.sign=function(e){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},u.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},u.prototype.getSecret=function(e){return o(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},u.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=u},3622:function(e,t,r){"use strict";var n=r(3550),o=r(953),i=o.assert,a=o.cachedProperty,u=o.parseBytes;function s(e,t){this.eddsa=e,"object"!=typeof t&&(t=u(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(s,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(s,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(s,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(s,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),s.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},s.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=s},1037:function(e){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},953:function(e,t,r){"use strict";var n=t,o=r(3550),i=r(9746),a=r(4504);n.assert=i,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),a=0;a<n.length;a++){var u,s=i.andln(o-1);i.isOdd()?(u=s>(o>>1)-1?(o>>1)-s:s,i.isubn(u)):u=0,n[a]=u,i.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,u,s=e.andln(3)+o&3,c=t.andln(3)+i&3;3===s&&(s=-1),3===c&&(c=-1),a=0==(1&s)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?s:-s,r[0].push(a),u=0==(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==s?c:-c,r[1].push(u),2*o===a+1&&(o=1-o),2*i===u+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new o(e,"hex","le")}},8091:function(e){"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),a=0,u=i.length;a<u;a++){var s=i[a],c=Object.getOwnPropertyDescriptor(o,s);void 0!==c&&c.enumerable&&(r[s]=o[s])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},9847:function(e,t,r){"use strict";var n=r(8823).Buffer;var o=r(1964),i=r(6523),a=o.BN,u=new a("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=t||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new n([])},{name:"gasPrice",length:32,allowLess:!0,default:new n([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new n([])},{name:"to",allowZero:!0,length:20,default:new n([])},{name:"value",length:32,allowLess:!0,default:new n([])},{name:"data",alias:"input",allowZero:!0,default:new n([])},{name:"v",allowZero:!0,default:new n([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new n([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new n([])}];o.defineProperties(this,r,t),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var i=o.bufferToInt(this.v),a=Math.floor((i-35)/2);a<0&&(a=0),this._chainId=a||t.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return o.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=o.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new a(this.s).cmp(u))return!1;try{var t=o.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=o.ecrecover(e,t,this.r,this.s)}catch(r){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=o.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new a(0),r=0;r<e.length;r++)0===e[r]?t.iaddn(i.txDataZeroGas.v):t.iaddn(i.txDataNonZeroGas.v);return t},e.prototype.getBaseFee=function(){var e=this.getDataFee().iaddn(i.txGas.v);return this._homestead&&this.toCreationAddress()&&e.iaddn(i.txCreation.v),e},e.prototype.getUpfrontCost=function(){return new a(this.gasLimit).imul(new a(this.gasPrice)).iadd(new a(this.value))},e.prototype.validate=function(e){var t=[];return this.verifySignature()||t.push("Invalid Signature"),this.getBaseFee().cmp(new a(this.gasLimit))>0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}();e.exports=s},1964:function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(5811),i=r(7221),a=r(9282),u=r(3110),s=r(3550),c=r(3482),f=r(9509).Buffer;Object.assign(t,r(884)),t.MAX_INTEGER=new s("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new s("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=f.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=f.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=f.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=s,t.rlp=u,t.secp256k1=i,t.zeros=function(e){return f.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=t.zeros(20);return t.bufferToHex(e)},t.setLengthLeft=t.setLength=function(e,r,n){var o=t.zeros(r);return e=t.toBuffer(e),n?e.length<r?(e.copy(o),o):e.slice(0,r):e.length<r?(e.copy(o,r-e.length),o):e.slice(-r)},t.setLengthRight=function(e,r){return t.setLength(e,r,!0)},t.unpad=t.stripZeros=function(e){for(var r=(e=t.stripHexPrefix(e))[0];e.length>0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!f.isBuffer(e))if(Array.isArray(e))e=f.from(e);else if("string"==typeof e)e=t.isHexString(e)?f.from(t.padToEven(t.stripHexPrefix(e)),"hex"):f.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=f.allocUnsafe(0);else if(s.isBN(e))e=e.toArrayLike(f);else{if(!e.toArray)throw new Error("invalid type");e=f.from(e.toArray())}return e},t.bufferToInt=function(e){return new s(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new s(e).fromTwos(256)},t.toUnsigned=function(e){return f.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return e=t.toBuffer(e),r||(r=256),o("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),c("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=c("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(u.encode(e))},t.isValidPrivate=function(e){return i.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?i.publicKeyVerify(f.concat([f.from([4]),e])):!!t&&i.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=i.publicKeyConvert(e,!1).slice(1)),a(64===e.length),t.keccak(e).slice(-20)};var l=t.privateToPublic=function(e){return e=t.toBuffer(e),i.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=i.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=i.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(f.concat([r,e]))},t.ecrecover=function(e,r,n,o){var a=f.concat([t.setLength(n,32),t.setLength(o,32)],64),u=r-27;if(0!==u&&1!==u)throw new Error("Invalid signature v value");var s=i.recover(e,a,u);return i.publicKeyConvert(s,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(f.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(l(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",o=0;o<e.length;o++)parseInt(r[o],16)>=8?n+=e[o].toUpperCase():n+=e[o];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new s(r)).isZero()?null:f.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var o=new s("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new s("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new s(t),r=new s(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new s(r).cmp(o))))},t.baToJSON=function(e){if(f.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n<e.length;n++)r.push(t.baToJSON(e[n]));return r}},t.defineProperties=function(e,r,o){if(e.raw=[],e._fields=[],e.toJSON=function(r){if(r){var n={};return e._fields.forEach((function(t){n[t]="0x"+e[t].toString("hex")})),n}return t.baToJSON(this.raw)},e.serialize=function(){return u.encode(e.raw)},r.forEach((function(r,n){function o(){return e.raw[n]}function i(o){"00"!==(o=t.toBuffer(o)).toString("hex")||r.allowZero||(o=f.allocUnsafe(0)),r.allowLess&&r.length?(o=t.stripZeros(o),a(r.length>=o.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===o.length||!r.length||a(r.length===o.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=o}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:o,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:o})})),o)if("string"==typeof o&&(o=f.from(t.stripHexPrefix(o),"hex")),f.isBuffer(o)&&(o=u.decode(o)),Array.isArray(o)){if(o.length>e._fields.length)throw new Error("wrong number of fields in data");o.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===o?"undefined":n(o)))throw new Error("invalid data");var i=Object.keys(o);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=o[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=o[t.alias])}))}}},884:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(3944),i=r(9604);function a(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function u(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var t=u(e);return new n(a(t.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return n.byteLength(e,"utf8")},isHexPrefixed:o,stripHexPrefix:i,padToEven:a,intToHex:u,fromAscii:function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t},fromUtf8:function(e){return"0x"+a(new n(e,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var o=parseInt(e.substr(r,2),16);t+=String.fromCharCode(o)}return t},toUtf8:function(e){return new n(a(i(e).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(e,t,r){if(!Array.isArray(e))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof e+"'");if("string"!=typeof t)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof t+"'.");for(var n=[],o=0;o<e.length;o++){var i=e[o][t];if(r&&!i)i="";else if("string"!=typeof i)throw new Error("invalid abi");n.push(i)}return n},isHexString:function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}}},7187:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(u(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=f.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)n(s,this,t);else{var c=s.length,f=p(s,c);for(r=0;r<c;++r)n(f[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7680:function(e){function t(e){return e}e.exports=function(e,r,n){r=r||t,n=n||e;for(var o=0,i=e.length;o<i;o+=1)if(r.call(n,e[o],o))return e[o]}},9804:function(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,o){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var a=0;a<i;a++)n.call(o,e[a],a,e);else for(var u in e)t.call(e,u)&&n.call(o,e[u],u,e)}},7648:function(e){"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(t+i);for(var a,u=r.call(arguments,1),s=function(){if(this instanceof a){var t=i.apply(this,u.concat(r.call(arguments)));return Object(t)===t?t:this}return i.apply(e,u.concat(r.call(arguments)))},c=Math.max(0,i.length-u.length),f=[],l=0;l<c;l++)f.push("$"+l);if(a=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(s),i.prototype){var d=function(){};d.prototype=i.prototype,a.prototype=new d,d.prototype=null}return a}},8612:function(e,t,r){"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:function(e,t,r){"use strict";var n,o=SyntaxError,i=Function,a=TypeError,u=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(t){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(O){s=null}var c=function(){throw new a},f=s?function(){try{return c}catch(e){try{return s(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},h={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?d(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},b=function e(t){var r;if("%AsyncFunction%"===t)r=u("async function () {}");else if("%GeneratorFunction%"===t)r=u("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=u("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=d(o.prototype))}return y[t]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=r(8612),m=r(7642),w=g.call(Function.call,Array.prototype.concat),E=g.call(Function.apply,Array.prototype.splice),_=g.call(Function.call,String.prototype.replace),C=g.call(Function.call,String.prototype.slice),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,A=function(e){var t=C(e,0,1),r=C(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,x,(function(e,t,r,o){n[n.length]=r?_(o,S,"$1"):t||e})),n},I=function(e,t){var r,n=e;if(m(v,n)&&(n="%"+(r=v[n])[0]+"%"),m(y,n)){var i=y[n];if(i===h&&(i=b(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var r=A(e),n=r.length>0?r[0]:"",i=I("%"+n+"%",t),u=i.name,c=i.value,f=!1,l=i.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],b=C(p,0,1),v=C(p,-1);if(('"'===b||"'"===b||"`"===b||'"'===v||"'"===v||"`"===v)&&b!==v)throw new o("property names with quotes must have matching quotes");if("constructor"!==p&&h||(f=!0),m(y,u="%"+(n+="."+p)+"%"))c=y[u];else if(null!=c){if(!(p in c)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(s&&d+1>=r.length){var g=s(c,p);c=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:c[p]}else h=m(c,p),c=c[p];h&&!f&&(y[u]=c)}}return c}},1405:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(5419);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},5419:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},7642:function(e,t,r){"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},3349:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(2830).Transform;function i(e){o.call(this),this._block=new n(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5717)(i,o),i.prototype._transform=function(e,t,r){var o=null;try{"buffer"!==t&&(e=new n(e,t)),this.update(e)}catch(i){o=i}r(o)},i.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(r){t=r}e(t)},i.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=new n(e,t||"binary"));for(var r=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[o++];this._update(),this._blockOffset=0}for(;o<e.length;)r[this._blockOffset++]=e[o++];for(var a=0,u=8*e.length;u>0;++a)this._length[a]+=u,(u=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*u);return this},i.prototype._update=function(e){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},3715:function(e,t,r){var n=t;n.utils=r(6436),n.common=r(5772),n.sha=r(9041),n.ripemd=r(2949),n.hmac=r(2344),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5772:function(e,t,r){"use strict";var n=r(6436),o=r(9746);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),o(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n}},2344:function(e,t,r){"use strict";var n=r(6436),o=r(9746);function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),o(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},i.prototype.update=function(e,t){return this.inner.update(e,t),this},i.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},2949:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=n.rotl32,a=n.sum32,u=n.sum32_3,s=n.sum32_4,c=o.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],f=this.h[4],g=r,m=n,w=o,E=c,_=f,C=0;C<80;C++){var x=a(i(s(r,l(C,n,o,c),e[p[C]+t],d(C)),b[C]),f);r=f,f=c,c=i(o,10),o=n,n=x,x=a(i(s(g,l(79-C,m,w,E),e[y[C]+t],h(C)),v[C]),_),g=_,_=E,E=i(w,10),w=m,m=x}x=u(this.h[1],o,E),this.h[1]=u(this.h[2],c,_),this.h[2]=u(this.h[3],f,g),this.h[3]=u(this.h[4],r,m),this.h[4]=u(this.h[0],n,w),this.h[0]=x},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},9041:function(e,t,r){"use strict";t.sha1=r(4761),t.sha224=r(799),t.sha256=r(9344),t.sha384=r(772),t.sha512=r(5900)},4761:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=r(7038),a=n.rotl32,u=n.sum32,s=n.sum32_5,c=i.ft_1,f=o.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],f=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=s(a(o,5),c(p,i,f,d),h,r[n],l[p]);h=d,d=f,f=a(i,30),i=o,o=y}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],f),this.h[3]=u(this.h[3],d),this.h[4]=u(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},799:function(e,t,r){"use strict";var n=r(6436),o=r(9344);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},9344:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=r(7038),a=r(9746),u=n.sum32,s=n.sum32_4,c=n.sum32_5,f=i.ch32,l=i.maj32,d=i.s0_256,h=i.s1_256,p=i.g0_256,y=i.g1_256,b=o.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(g,b),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],b=this.h[2],v=this.h[3],g=this.h[4],m=this.h[5],w=this.h[6],E=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var _=c(E,h(g),f(g,m,w),this.k[n],r[n]),C=u(d(o),l(o,i,b));E=w,w=m,m=g,g=u(v,_),v=b,b=i,i=o,o=u(_,C)}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],b),this.h[3]=u(this.h[3],v),this.h[4]=u(this.h[4],g),this.h[5]=u(this.h[5],m),this.h[6]=u(this.h[6],w),this.h[7]=u(this.h[7],E)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},772:function(e,t,r){"use strict";var n=r(6436),o=r(5900);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},5900:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=r(9746),a=n.rotr64_hi,u=n.rotr64_lo,s=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,b=n.sum64_5_lo,v=o.BlockHash,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function E(e,t,r,n,o,i){var a=t&n^~t&i;return a<0&&(a+=4294967296),a}function _(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function C(e,t,r,n,o,i){var a=t&n^t&i^n&i;return a<0&&(a+=4294967296),a}function x(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=u(e,t,28)^u(t,e,2)^u(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function I(e,t){var r=u(e,t,14)^u(e,t,18)^u(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=a(e,t,1)^a(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=u(e,t,1)^u(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,19)^a(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}function P(e,t){var r=u(e,t,19)^u(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(m,v),e.exports=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=k(r[n-4],r[n-3]),i=P(r[n-4],r[n-3]),a=r[n-14],u=r[n-13],s=O(r[n-30],r[n-29]),c=T(r[n-30],r[n-29]),f=r[n-32],l=r[n-31];r[n]=h(o,i,a,u,s,c,f,l),r[n+1]=p(o,i,a,u,s,c,f,l)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],a=this.h[2],u=this.h[3],s=this.h[4],c=this.h[5],h=this.h[6],p=this.h[7],v=this.h[8],g=this.h[9],m=this.h[10],O=this.h[11],T=this.h[12],k=this.h[13],P=this.h[14],B=this.h[15];i(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var j=P,M=B,N=A(v,g),D=I(v,g),L=w(v,g,m,O,T),U=E(v,g,m,O,T,k),H=this.k[R],K=this.k[R+1],F=r[R],G=r[R+1],q=y(j,M,N,D,L,U,H,K,F,G),z=b(j,M,N,D,L,U,H,K,F,G);j=x(n,o),M=S(n,o),N=_(n,o,a,u,s),D=C(n,o,a,u,s,c);var W=l(j,M,N,D),V=d(j,M,N,D);P=T,B=k,T=m,k=O,m=v,O=g,v=l(h,p,q,z),g=d(p,p,q,z),h=s,p=c,s=a,c=u,a=n,u=o,n=l(q,z,W,V),o=d(q,z,W,V)}f(this.h,0,n,o),f(this.h,2,a,u),f(this.h,4,s,c),f(this.h,6,h,p),f(this.h,8,v,g),f(this.h,10,m,O),f(this.h,12,T,k),f(this.h,14,P,B)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7038:function(e,t,r){"use strict";var n=r(6436).rotr32;function o(e,t,r){return e&t^~e&r}function i(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?o(t,r,n):1===e||3===e?a(t,r,n):2===e?i(t,r,n):void 0},t.ch32=o,t.maj32=i,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},6436:function(e,t,r){"use strict";var n=r(9746),o=r(5717);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function u(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=u(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=a(o)),r+=s(o.toString(16))}return r},t.zero2=u,t.zero8=s,t.join32=function(e,t,r,o){var i=r-t;n(i%4==0);for(var a=new Array(i/4),u=0,s=t;u<a.length;u++,s+=4){var c;c="big"===o?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],a[u]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},t.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,a=(i<n?1:0)+r+o;e[t]=a>>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,o,i,a,u){var s=0,c=t;return s+=(c=c+n>>>0)<t?1:0,s+=(c=c+i>>>0)<i?1:0,e+r+o+a+(s+=(c=c+u>>>0)<u?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,o,i,a,u){return t+n+i+u>>>0},t.sum64_5_hi=function(e,t,r,n,o,i,a,u,s,c){var f=0,l=t;return f+=(l=l+n>>>0)<t?1:0,f+=(l=l+i>>>0)<i?1:0,f+=(l=l+u>>>0)<u?1:0,e+r+o+a+s+(f+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,o,i,a,u,s,c){return t+n+i+u+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2156:function(e,t,r){"use strict";var n=r(3715),o=r(4504),i=r(9746);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),n=o.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=o.toArray(e,t),r=o.toArray(r,n),i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=o.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(r),this._reseed++,o.encode(a,t)}},645:function(e,t){t.read=function(e,t,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,f=-7,l=r?o-1:0,d=r?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=u;f>0;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,u,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+l>=1?d/s:d*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(t*s-1)*Math.pow(2,o),a+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&u,h+=p,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2584:function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(e){return!(t&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===r.call(e)},o=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r.call(e)&&"[object Function]"===r.call(e.callee)},i=function(){return n(arguments)}();n.isLegacyArguments=o,e.exports=i?n:o},8662:function(e){"use strict";var t=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,o="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,i=Object.getPrototypeOf,a=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}(),u=!(!i||!a)&&i(a);e.exports=function(e){return"function"==typeof e&&(!!n.test(r.call(e))||(o?i&&i(e)===u:"[object GeneratorFunction]"===t.call(e)))}},3944:function(e){e.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},8611:function(e){"use strict";e.exports=function(e){return e!=e}},360:function(e,t,r){"use strict";var n=r(5559),o=r(4289),i=r(8611),a=r(9415),u=r(3194),s=n(a(),Number);o(s,{getPolyfill:a,implementation:i,shim:u}),e.exports=s},9415:function(e,t,r){"use strict";var n=r(8611);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:function(e,t,r){"use strict";var n=r(4289),o=r(9415);e.exports=function(){var e=o();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5692:function(e,t,r){"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),u=r(1405)()&&"symbol"==typeof Symbol.toStringTag,s=o(),c=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},f=i("String.prototype.slice"),l={},d=r(882),h=Object.getPrototypeOf;u&&d&&h&&n(s,(function(e){var t=new r.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=h(t),o=d(n,Symbol.toStringTag);if(!o){var i=h(n);o=d(i,Symbol.toStringTag)}l[e]=o.get}));e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=f(a(e),8,-1);return c(s,t)>-1}return!!d&&function(e){var t=!1;return n(l,(function(r,n){if(!t)try{t=r.call(e)===n}catch(o){}})),t}(e)}},5811:function(e,t,r){"use strict";e.exports=r(6066)(r(9653))},6066:function(e,t,r){"use strict";var n=r(7016),o=r(5675);e.exports=function(e){var t=n(e),r=o(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},7016:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(2830).Transform,i=r(5717);e.exports=function(e){function t(t,r,n,i,a){o.call(this,a),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=a,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return i(t,o),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(o){n=o}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},5675:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(2830).Transform,i=r(5717);e.exports=function(e){function t(t,r,n,i){o.call(this,i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return i(t,o),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(o){n=o}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},4040:function(e,t){"use strict";var r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(var t=0;t<24;++t){var n=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49],h=l^(i<<1|a>>>31),p=d^(a<<1|i>>>31),y=e[0]^h,b=e[1]^p,v=e[10]^h,g=e[11]^p,m=e[20]^h,w=e[21]^p,E=e[30]^h,_=e[31]^p,C=e[40]^h,x=e[41]^p;h=n^(u<<1|s>>>31),p=o^(s<<1|u>>>31);var S=e[2]^h,A=e[3]^p,I=e[12]^h,O=e[13]^p,T=e[22]^h,k=e[23]^p,P=e[32]^h,B=e[33]^p,R=e[42]^h,j=e[43]^p;h=i^(c<<1|f>>>31),p=a^(f<<1|c>>>31);var M=e[4]^h,N=e[5]^p,D=e[14]^h,L=e[15]^p,U=e[24]^h,H=e[25]^p,K=e[34]^h,F=e[35]^p,G=e[44]^h,q=e[45]^p;h=u^(l<<1|d>>>31),p=s^(d<<1|l>>>31);var z=e[6]^h,W=e[7]^p,V=e[16]^h,Y=e[17]^p,J=e[26]^h,Z=e[27]^p,X=e[36]^h,$=e[37]^p,Q=e[46]^h,ee=e[47]^p;h=c^(n<<1|o>>>31),p=f^(o<<1|n>>>31);var te=e[8]^h,re=e[9]^p,ne=e[18]^h,oe=e[19]^p,ie=e[28]^h,ae=e[29]^p,ue=e[38]^h,se=e[39]^p,ce=e[48]^h,fe=e[49]^p,le=y,de=b,he=g<<4|v>>>28,pe=v<<4|g>>>28,ye=m<<3|w>>>29,be=w<<3|m>>>29,ve=_<<9|E>>>23,ge=E<<9|_>>>23,me=C<<18|x>>>14,we=x<<18|C>>>14,Ee=S<<1|A>>>31,_e=A<<1|S>>>31,Ce=O<<12|I>>>20,xe=I<<12|O>>>20,Se=T<<10|k>>>22,Ae=k<<10|T>>>22,Ie=B<<13|P>>>19,Oe=P<<13|B>>>19,Te=R<<2|j>>>30,ke=j<<2|R>>>30,Pe=N<<30|M>>>2,Be=M<<30|N>>>2,Re=D<<6|L>>>26,je=L<<6|D>>>26,Me=H<<11|U>>>21,Ne=U<<11|H>>>21,De=K<<15|F>>>17,Le=F<<15|K>>>17,Ue=q<<29|G>>>3,He=G<<29|q>>>3,Ke=z<<28|W>>>4,Fe=W<<28|z>>>4,Ge=Y<<23|V>>>9,qe=V<<23|Y>>>9,ze=J<<25|Z>>>7,We=Z<<25|J>>>7,Ve=X<<21|$>>>11,Ye=$<<21|X>>>11,Je=ee<<24|Q>>>8,Ze=Q<<24|ee>>>8,Xe=te<<27|re>>>5,$e=re<<27|te>>>5,Qe=ne<<20|oe>>>12,et=oe<<20|ne>>>12,tt=ae<<7|ie>>>25,rt=ie<<7|ae>>>25,nt=ue<<8|se>>>24,ot=se<<8|ue>>>24,it=ce<<14|fe>>>18,at=fe<<14|ce>>>18;e[0]=le^~Ce&Me,e[1]=de^~xe&Ne,e[10]=Ke^~Qe&ye,e[11]=Fe^~et&be,e[20]=Ee^~Re&ze,e[21]=_e^~je&We,e[30]=Xe^~he&Se,e[31]=$e^~pe&Ae,e[40]=Pe^~Ge&tt,e[41]=Be^~qe&rt,e[2]=Ce^~Me&Ve,e[3]=xe^~Ne&Ye,e[12]=Qe^~ye&Ie,e[13]=et^~be&Oe,e[22]=Re^~ze&nt,e[23]=je^~We&ot,e[32]=he^~Se&De,e[33]=pe^~Ae&Le,e[42]=Ge^~tt&ve,e[43]=qe^~rt&ge,e[4]=Me^~Ve&it,e[5]=Ne^~Ye&at,e[14]=ye^~Ie&Ue,e[15]=be^~Oe&He,e[24]=ze^~nt&me,e[25]=We^~ot&we,e[34]=Se^~De&Je,e[35]=Ae^~Le&Ze,e[44]=tt^~ve&Te,e[45]=rt^~ge&ke,e[6]=Ve^~it&le,e[7]=Ye^~at&de,e[16]=Ie^~Ue&Ke,e[17]=Oe^~He&Fe,e[26]=nt^~me&Ee,e[27]=ot^~we&_e,e[36]=De^~Je&Xe,e[37]=Le^~Ze&$e,e[46]=ve^~Te&Pe,e[47]=ge^~ke&Be,e[8]=it^~le&Ce,e[9]=at^~de&xe,e[18]=Ue^~Ke&Qe,e[19]=He^~Fe&et,e[28]=me^~Ee&Re,e[29]=we^~_e&je,e[38]=Je^~Xe&he,e[39]=Ze^~$e&pe,e[48]=Te^~Pe&Ge,e[49]=ke^~Be&qe,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},9653:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(4040);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(var t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(o.p1600(this.state),this.count=0)},i.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,0!=(128&e)&&this.count===this.blockSize-1&&o.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,o.p1600(this.state),this.count=0,this.squeezing=!0},i.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);for(var t=n.alloc(e),r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(o.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},9746:function(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4504:function(e,t){"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},2719:function(e){var t=e.exports=function(e,r){if("function"==typeof e||r)return t.by(e,r);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},o=[],i=0;i<e.length;i++){var a=e[i],u="__proto__"===a?n.objects:n[typeof a]||n.objects;Array.isArray(u)?u.indexOf(a)<0&&(u.push(a),o.push(a)):Object.hasOwnProperty.call(u,a)||(u[a]=!0,o.push(a))}return o};t.by=function(e,t){if("function"==typeof e){var r=t;t=e,e=r}for(var n=[],o=0;o<e.length;o++){for(var i=e[o],a=!1,u=0;u<n.length;u++){var s=n[u];if(t.call(n,i,s)){a=!0;break}}a||n.push(i)}return n}},4244:function(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},609:function(e,t,r){"use strict";var n=r(4289),o=r(5559),i=r(4244),a=r(5624),u=r(2281),s=o(a(),Object);n(s,{getPolyfill:a,implementation:i,shim:u}),e.exports=s},5624:function(e,t,r){"use strict";var n=r(4244);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:function(e,t,r){"use strict";var n=r(5624),o=r(4289);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8987:function(e,t,r){"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(1414),u=Object.prototype.propertyIsEnumerable,s=!u.call({toString:null},"toString"),c=u.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{l(window[e])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),u=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(u&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)d.push(String(y));if(n&&e.length>0)for(var b=0;b<e.length;++b)d.push(String(b));else for(var v in e)p&&"prototype"===v||!o.call(e,v)||d.push(String(v));if(s)for(var g=function(e){if("undefined"==typeof window||!h)return l(e);try{return l(e)}catch(t){return!1}}(e),m=0;m<f.length;++m)g&&"constructor"===f[m]||!o.call(e,f[m])||d.push(f[m]);return d}}e.exports=n},2215:function(e,t,r){"use strict";var n=Array.prototype.slice,o=r(1414),i=Object.keys,a=i?function(e){return i(e)}:r(8987),u=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?u(n.call(e)):u(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1414:function(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},4155:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],c=!1,f=-1;function l(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!c){var e=a(l);c=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new h(e,t)),1!==s.length||c||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},4281:function(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var o,i,a,u;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(s," ").concat(o," ").concat(n(t,"type"))}return u+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:function(e,t,r){"use strict";var n=r(4155),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r(9481),a=r(4229);r(5717)(f,i);for(var u=o(a.prototype),s=0;s<u.length;s++){var c=u[s];f.prototype[c]||(f.prototype[c]=a.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:function(e,t,r){"use strict";e.exports=o;var n=r(4605);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(5717)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},9481:function(e,t,r){"use strict";var n,o=r(4155);e.exports=S,S.ReadableState=x;r(7187).EventEmitter;var i=function(e,t){return e.listeners(t).length},a=r(2503),u=r(8823).Buffer,s=r.g.Uint8Array||function(){};var c,f=r(4616);c=f&&f.debuglog?f.debuglog("stream"):function(){};var l,d,h,p=r(7327),y=r(1195),b=r(2457).getHighWaterMark,v=r(4281).q,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,E=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(S,a);var _=y.errorOrDestroy,C=["error","close","destroy","pause","resume"];function x(e,t,o){n=n||r(6753),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",o),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(2553).s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(6753),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new x(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,n,o){c("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?k(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}(e,a);else if(o||(i=function(e,t){var r;n=t,u.isBuffer(n)||n instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),i)_(e,i);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?_(e,new E):I(e,a,t,!0);else if(a.ended)_(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?I(e,a,t,!1):B(e,a)):I(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function I(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),B(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=y.destroy,S.prototype._undestroy=y.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},S.prototype.unshift=function(e){return A(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){l||(l=r(2553).s);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var O=1073741824;function T(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(P,e))}function P(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function j(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){c("readable nexttick read 0"),e.read(0)}function N(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(H,t,e))}function H(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function K(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}S.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):k(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,o=t.needReadable;return c("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",o=!0),t.ended||t.reading?c("reading or ended",o=!1):o&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=T(r,t))),null===(n=e>0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||!1!==t.end)&&e!==o.stdout&&e!==o.stderr?s:b;function u(t,o){c("onunpipe"),t===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",u),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",d),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function s(){c("onend"),e.end()}n.endEmitted?o.nextTick(a):r.once("end",a),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",f);var l=!1;function d(t){c("ondata");var o=e.write(t);c("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==K(n.pipes,e))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){c("onerror",t),b(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",y),b()}function y(){c("onfinish"),e.removeListener("close",p),b()}function b(){c("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",y),e.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=K(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},S.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?k(this):n.reading||o.nextTick(M,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(j,this),r},S.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(j,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(c("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<C.length;i++)e.on(C[i],this.emit.bind(this,C[i]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(5850)),d(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=L,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===h&&(h=r(5167)),h(S,e,t)})},4605:function(e,t,r){"use strict";e.exports=f;var n=r(4281).q,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=n.ERR_TRANSFORM_WITH_LENGTH_0,s=r(6753);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);s.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new u;if(e._transformState.transforming)throw new a;return e.push(null)}r(5717)(f,s),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new o("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:function(e,t,r){"use strict";var n,o=r(4155);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=S,S.WritableState=x;var a={deprecate:r(4927)},u=r(2503),s=r(8823).Buffer,c=r.g.Uint8Array||function(){};var f,l=r(1195),d=r(2457).getHighWaterMark,h=r(4281).q,p=h.ERR_INVALID_ARG_TYPE,y=h.ERR_METHOD_NOT_IMPLEMENTED,b=h.ERR_MULTIPLE_CALLBACK,v=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,E=h.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function C(){}function x(e,t,a){n=n||r(6753),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(P,e,t),e._writableState.errorEmitted=!0,_(e,n)):(i(n),e._writableState.errorEmitted=!0,_(e,n),P(e,t))}(e,r,n,t,i);else{var a=T(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||O(e,r),n?o.nextTick(I,e,r,a,i):I(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function S(e){var t=this instanceof(n=n||r(6753));if(!t&&!f.call(S,this))return new S(e);this._writableState=new x(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function A(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function I(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var u=0,s=!0;r;)o[u]=r,r.isBuf||(s=!1),r=r.next,u+=1;o.allBuffers=s,A(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function T(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&_(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)}))}function P(e,t){var r=T(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(S,u),x.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(x.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===S&&(e&&e._writableState instanceof x)}})):f=function(e){return e instanceof this},S.prototype.pipe=function(){_(this,new v)},S.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,u=!i.objectMode&&(n=e,s.isBuffer(n)||n instanceof c);return u&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof t&&(r=t,t=null),u?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=C),i.ending?function(e,t){var r=new w;_(e,r),o.nextTick(t,r)}(this,r):(u||function(e,t,r,n){var i;return null===r?i=new m:"string"==typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(_(e,i),o.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,o,i){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=s.from(t,r));return t}(t,n,o);n!==a&&(r=!0,o="buffer",n=a)}var u=t.objectMode?1:n.length;t.length+=u;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,u,n,o,i);return c}(this,i,u,e,t,r)),a},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new y("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},5850:function(e,t,r){"use strict";var n,o=r(4155);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(8610),u=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[u];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[u]=null,e[s]=null,t(p(r,!1)))}}function b(e){o.nextTick(y,e)}var v=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){o.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[f]?r(p(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[d])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),v);e.exports=function(e){var t,r=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[u]=null,r[s]=null,e(p(n,!1))):(r[u]=e,r[s]=t)},writable:!0}),t));return r[l]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[u]=null,r[s]=null,t(e)),void(r[c]=e)}var n=r[u];null!==n&&(r[l]=null,r[u]=null,r[s]=null,n(p(void 0,!0))),r[f]=!0})),e.on("readable",b.bind(null,r)),r}},7327:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=r(8823).Buffer,u=r(2361).inspect,s=u&&u.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,c;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,o=a.allocUnsafe(e>>>0),i=this.head,u=0;i;)t=i.data,r=o,n=u,a.prototype.copy.call(t,r,n),u+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return u(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&i(t.prototype,r),c&&i(t,c),e}()},1195:function(e,t,r){"use strict";var n=r(4155);function o(e,t){a(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,e)):n.nextTick(o,r,e):t?(n.nextTick(i,r),t(e)):n.nextTick(i,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:function(e,t,r){"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||o);var a=r.readable||!1!==r.readable&&t.readable,u=r.writable||!1!==r.writable&&t.writable,s=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){u=!1,c=!0,a||i.call(t)},l=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,l=!0,u||i.call(t)},h=function(e){i.call(t,e)},p=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):u&&!c?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},y=function(){t.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?u&&!t._writableState&&(t.on("end",s),t.on("close",s)):(t.on("complete",f),t.on("abort",p),t.req?y():t.on("request",y)),t.on("end",d),t.on("finish",f),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",f),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",f),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},5167:function(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:function(e,t,r){"use strict";var n;var o=r(4281).q,i=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function u(e){if(e)throw e}function s(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var u=!1;e.on("close",(function(){u=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:o},(function(e){if(e)return i(e);u=!0,i()}));var s=!1;return function(t){if(!u&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new a("pipe"))}}function c(e){e()}function f(e,t){return e.pipe(t)}function l(e){return e.length?"function"!=typeof e[e.length-1]?u:e.pop():u}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,o=l(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var a=t.map((function(e,r){var i=r<t.length-1;return s(e,i,r>0,(function(e){n||(n=e),e&&a.forEach(c),i||(a.forEach(c),o(n))}))}));return t.reduce(f)}},2457:function(e,t,r){"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},2503:function(e,t,r){e.exports=r(7187).EventEmitter},5666:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(P){s=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(e,t,r){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=f(e,t,r);if("normal"===s.type){if(n=r.done?p:d,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(P){return{type:"throw",arg:P}}}e.wrap=c;var l="suspendedStart",d="suspendedYield",h="executing",p="completed",y={};function b(){}function v(){}function g(){}var m={};m[i]=function(){return this};var w=Object.getPrototypeOf,E=w&&w(w(T([])));E&&E!==r&&n.call(E,i)&&(m=E);var _=g.prototype=b.prototype=Object.create(m);function C(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(o,i,a,u){var s=f(e[o],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function S(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=f(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function T(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:t,done:!0}}return v.prototype=_.constructor=g,g.constructor=v,v.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,u,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},C(x.prototype),x.prototype[a]=function(){return this},e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(_),s(_,u,"Generator"),_[i]=function(){return this},_.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=T,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){Function("r","regeneratorRuntime = r")(t)}},9911:function(e,t){"use strict";function r(e,t,r){var n;if(void 0===r&&(r={}),!t.codes){t.codes={};for(var o=0;o<t.chars.length;++o)t.codes[t.chars[o]]=o}if(!r.loose&&e.length*t.bits&7)throw new SyntaxError("Invalid padding");for(var i=e.length;"="===e[i-1];)if(--i,!(r.loose||(e.length-i)*t.bits&7))throw new SyntaxError("Invalid padding");for(var a=new(null!=(n=r.out)?n:Uint8Array)(i*t.bits/8|0),u=0,s=0,c=0,f=0;f<i;++f){var l=t.codes[e[f]];if(void 0===l)throw new SyntaxError("Invalid character "+e[f]);s=s<<t.bits|l,(u+=t.bits)>=8&&(u-=8,a[c++]=255&s>>u)}if(u>=t.bits||255&s<<8-u)throw new SyntaxError("Unexpected end of data");return a}function n(e,t,r){void 0===r&&(r={});for(var n=r.pad,o=void 0===n||n,i=(1<<t.bits)-1,a="",u=0,s=0,c=0;c<e.length;++c)for(s=s<<8|255&e[c],u+=8;u>t.bits;)u-=t.bits,a+=t.chars[i&s>>u];if(u&&(a+=t.chars[i&s<<t.bits-u]),o)for(;a.length*t.bits&7;)a+="=";return a}Object.defineProperty(t,"__esModule",{value:!0});var o={chars:"0123456789ABCDEF",bits:4},i={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bits:5},a={chars:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bits:5},u={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bits:6},s={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bits:6},c={parse:function(e,t){return r(e.toUpperCase(),o,t)},stringify:function(e,t){return n(e,o,t)}},f={parse:function(e,t){return void 0===t&&(t={}),r(t.loose?e.toUpperCase().replace(/0/g,"O").replace(/1/g,"L").replace(/8/g,"B"):e,i,t)},stringify:function(e,t){return n(e,i,t)}},l={parse:function(e,t){return r(e,a,t)},stringify:function(e,t){return n(e,a,t)}},d={parse:function(e,t){return r(e,u,t)},stringify:function(e,t){return n(e,u,t)}},h={parse:function(e,t){return r(e,s,t)},stringify:function(e,t){return n(e,s,t)}},p={parse:r,stringify:n};t.base16=c,t.base32=f,t.base32hex=l,t.base64=d,t.base64url=h,t.codec=p},9785:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(5717),i=r(3349);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function u(e,t){return e<<t|e>>>32-t}function s(e,t,r,n,o,i,a,s){return u(e+(t^r^n)+i+a|0,s)+o|0}function c(e,t,r,n,o,i,a,s){return u(e+(t&r|~t&n)+i+a|0,s)+o|0}function f(e,t,r,n,o,i,a,s){return u(e+((t|~r)^n)+i+a|0,s)+o|0}function l(e,t,r,n,o,i,a,s){return u(e+(t&n|r&~n)+i+a|0,s)+o|0}function d(e,t,r,n,o,i,a,s){return u(e+(t^(r|~n))+i+a|0,s)+o|0}o(a,i),a.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,o=this._c,i=this._d,a=this._e;r=s(r,n,o,i,a,e[0],0,11),a=s(a,r,n,o=u(o,10),i,e[1],0,14),i=s(i,a,r,n=u(n,10),o,e[2],0,15),o=s(o,i,a,r=u(r,10),n,e[3],0,12),n=s(n,o,i,a=u(a,10),r,e[4],0,5),r=s(r,n,o,i=u(i,10),a,e[5],0,8),a=s(a,r,n,o=u(o,10),i,e[6],0,7),i=s(i,a,r,n=u(n,10),o,e[7],0,9),o=s(o,i,a,r=u(r,10),n,e[8],0,11),n=s(n,o,i,a=u(a,10),r,e[9],0,13),r=s(r,n,o,i=u(i,10),a,e[10],0,14),a=s(a,r,n,o=u(o,10),i,e[11],0,15),i=s(i,a,r,n=u(n,10),o,e[12],0,6),o=s(o,i,a,r=u(r,10),n,e[13],0,7),n=s(n,o,i,a=u(a,10),r,e[14],0,9),a=c(a,r=s(r,n,o,i=u(i,10),a,e[15],0,8),n,o=u(o,10),i,e[7],1518500249,7),i=c(i,a,r,n=u(n,10),o,e[4],1518500249,6),o=c(o,i,a,r=u(r,10),n,e[13],1518500249,8),n=c(n,o,i,a=u(a,10),r,e[1],1518500249,13),r=c(r,n,o,i=u(i,10),a,e[10],1518500249,11),a=c(a,r,n,o=u(o,10),i,e[6],1518500249,9),i=c(i,a,r,n=u(n,10),o,e[15],1518500249,7),o=c(o,i,a,r=u(r,10),n,e[3],1518500249,15),n=c(n,o,i,a=u(a,10),r,e[12],1518500249,7),r=c(r,n,o,i=u(i,10),a,e[0],1518500249,12),a=c(a,r,n,o=u(o,10),i,e[9],1518500249,15),i=c(i,a,r,n=u(n,10),o,e[5],1518500249,9),o=c(o,i,a,r=u(r,10),n,e[2],1518500249,11),n=c(n,o,i,a=u(a,10),r,e[14],1518500249,7),r=c(r,n,o,i=u(i,10),a,e[11],1518500249,13),i=f(i,a=c(a,r,n,o=u(o,10),i,e[8],1518500249,12),r,n=u(n,10),o,e[3],1859775393,11),o=f(o,i,a,r=u(r,10),n,e[10],1859775393,13),n=f(n,o,i,a=u(a,10),r,e[14],1859775393,6),r=f(r,n,o,i=u(i,10),a,e[4],1859775393,7),a=f(a,r,n,o=u(o,10),i,e[9],1859775393,14),i=f(i,a,r,n=u(n,10),o,e[15],1859775393,9),o=f(o,i,a,r=u(r,10),n,e[8],1859775393,13),n=f(n,o,i,a=u(a,10),r,e[1],1859775393,15),r=f(r,n,o,i=u(i,10),a,e[2],1859775393,14),a=f(a,r,n,o=u(o,10),i,e[7],1859775393,8),i=f(i,a,r,n=u(n,10),o,e[0],1859775393,13),o=f(o,i,a,r=u(r,10),n,e[6],1859775393,6),n=f(n,o,i,a=u(a,10),r,e[13],1859775393,5),r=f(r,n,o,i=u(i,10),a,e[11],1859775393,12),a=f(a,r,n,o=u(o,10),i,e[5],1859775393,7),o=l(o,i=f(i,a,r,n=u(n,10),o,e[12],1859775393,5),a,r=u(r,10),n,e[1],2400959708,11),n=l(n,o,i,a=u(a,10),r,e[9],2400959708,12),r=l(r,n,o,i=u(i,10),a,e[11],2400959708,14),a=l(a,r,n,o=u(o,10),i,e[10],2400959708,15),i=l(i,a,r,n=u(n,10),o,e[0],2400959708,14),o=l(o,i,a,r=u(r,10),n,e[8],2400959708,15),n=l(n,o,i,a=u(a,10),r,e[12],2400959708,9),r=l(r,n,o,i=u(i,10),a,e[4],2400959708,8),a=l(a,r,n,o=u(o,10),i,e[13],2400959708,9),i=l(i,a,r,n=u(n,10),o,e[3],2400959708,14),o=l(o,i,a,r=u(r,10),n,e[7],2400959708,5),n=l(n,o,i,a=u(a,10),r,e[15],2400959708,6),r=l(r,n,o,i=u(i,10),a,e[14],2400959708,8),a=l(a,r,n,o=u(o,10),i,e[5],2400959708,6),i=l(i,a,r,n=u(n,10),o,e[6],2400959708,5),n=d(n,o=l(o,i,a,r=u(r,10),n,e[2],2400959708,12),i,a=u(a,10),r,e[4],2840853838,9),r=d(r,n,o,i=u(i,10),a,e[0],2840853838,15),a=d(a,r,n,o=u(o,10),i,e[5],2840853838,5),i=d(i,a,r,n=u(n,10),o,e[9],2840853838,11),o=d(o,i,a,r=u(r,10),n,e[7],2840853838,6),n=d(n,o,i,a=u(a,10),r,e[12],2840853838,8),r=d(r,n,o,i=u(i,10),a,e[2],2840853838,13),a=d(a,r,n,o=u(o,10),i,e[10],2840853838,12),i=d(i,a,r,n=u(n,10),o,e[14],2840853838,5),o=d(o,i,a,r=u(r,10),n,e[1],2840853838,12),n=d(n,o,i,a=u(a,10),r,e[3],2840853838,13),r=d(r,n,o,i=u(i,10),a,e[8],2840853838,14),a=d(a,r,n,o=u(o,10),i,e[11],2840853838,11),i=d(i,a,r,n=u(n,10),o,e[6],2840853838,8),o=d(o,i,a,r=u(r,10),n,e[15],2840853838,5),n=d(n,o,i,a=u(a,10),r,e[13],2840853838,6),i=u(i,10);var h=this._a,p=this._b,y=this._c,b=this._d,v=this._e;h=d(h,p,y,b,v,e[5],1352829926,8),v=d(v,h,p,y=u(y,10),b,e[14],1352829926,9),b=d(b,v,h,p=u(p,10),y,e[7],1352829926,9),y=d(y,b,v,h=u(h,10),p,e[0],1352829926,11),p=d(p,y,b,v=u(v,10),h,e[9],1352829926,13),h=d(h,p,y,b=u(b,10),v,e[2],1352829926,15),v=d(v,h,p,y=u(y,10),b,e[11],1352829926,15),b=d(b,v,h,p=u(p,10),y,e[4],1352829926,5),y=d(y,b,v,h=u(h,10),p,e[13],1352829926,7),p=d(p,y,b,v=u(v,10),h,e[6],1352829926,7),h=d(h,p,y,b=u(b,10),v,e[15],1352829926,8),v=d(v,h,p,y=u(y,10),b,e[8],1352829926,11),b=d(b,v,h,p=u(p,10),y,e[1],1352829926,14),y=d(y,b,v,h=u(h,10),p,e[10],1352829926,14),p=d(p,y,b,v=u(v,10),h,e[3],1352829926,12),v=l(v,h=d(h,p,y,b=u(b,10),v,e[12],1352829926,6),p,y=u(y,10),b,e[6],1548603684,9),b=l(b,v,h,p=u(p,10),y,e[11],1548603684,13),y=l(y,b,v,h=u(h,10),p,e[3],1548603684,15),p=l(p,y,b,v=u(v,10),h,e[7],1548603684,7),h=l(h,p,y,b=u(b,10),v,e[0],1548603684,12),v=l(v,h,p,y=u(y,10),b,e[13],1548603684,8),b=l(b,v,h,p=u(p,10),y,e[5],1548603684,9),y=l(y,b,v,h=u(h,10),p,e[10],1548603684,11),p=l(p,y,b,v=u(v,10),h,e[14],1548603684,7),h=l(h,p,y,b=u(b,10),v,e[15],1548603684,7),v=l(v,h,p,y=u(y,10),b,e[8],1548603684,12),b=l(b,v,h,p=u(p,10),y,e[12],1548603684,7),y=l(y,b,v,h=u(h,10),p,e[4],1548603684,6),p=l(p,y,b,v=u(v,10),h,e[9],1548603684,15),h=l(h,p,y,b=u(b,10),v,e[1],1548603684,13),b=f(b,v=l(v,h,p,y=u(y,10),b,e[2],1548603684,11),h,p=u(p,10),y,e[15],1836072691,9),y=f(y,b,v,h=u(h,10),p,e[5],1836072691,7),p=f(p,y,b,v=u(v,10),h,e[1],1836072691,15),h=f(h,p,y,b=u(b,10),v,e[3],1836072691,11),v=f(v,h,p,y=u(y,10),b,e[7],1836072691,8),b=f(b,v,h,p=u(p,10),y,e[14],1836072691,6),y=f(y,b,v,h=u(h,10),p,e[6],1836072691,6),p=f(p,y,b,v=u(v,10),h,e[9],1836072691,14),h=f(h,p,y,b=u(b,10),v,e[11],1836072691,12),v=f(v,h,p,y=u(y,10),b,e[8],1836072691,13),b=f(b,v,h,p=u(p,10),y,e[12],1836072691,5),y=f(y,b,v,h=u(h,10),p,e[2],1836072691,14),p=f(p,y,b,v=u(v,10),h,e[10],1836072691,13),h=f(h,p,y,b=u(b,10),v,e[0],1836072691,13),v=f(v,h,p,y=u(y,10),b,e[4],1836072691,7),y=c(y,b=f(b,v,h,p=u(p,10),y,e[13],1836072691,5),v,h=u(h,10),p,e[8],2053994217,15),p=c(p,y,b,v=u(v,10),h,e[6],2053994217,5),h=c(h,p,y,b=u(b,10),v,e[4],2053994217,8),v=c(v,h,p,y=u(y,10),b,e[1],2053994217,11),b=c(b,v,h,p=u(p,10),y,e[3],2053994217,14),y=c(y,b,v,h=u(h,10),p,e[11],2053994217,14),p=c(p,y,b,v=u(v,10),h,e[15],2053994217,6),h=c(h,p,y,b=u(b,10),v,e[0],2053994217,14),v=c(v,h,p,y=u(y,10),b,e[5],2053994217,6),b=c(b,v,h,p=u(p,10),y,e[12],2053994217,9),y=c(y,b,v,h=u(h,10),p,e[2],2053994217,12),p=c(p,y,b,v=u(v,10),h,e[13],2053994217,9),h=c(h,p,y,b=u(b,10),v,e[9],2053994217,12),v=c(v,h,p,y=u(y,10),b,e[7],2053994217,5),b=c(b,v,h,p=u(p,10),y,e[10],2053994217,15),p=s(p,y=c(y,b,v,h=u(h,10),p,e[14],2053994217,8),b,v=u(v,10),h,e[12],0,8),h=s(h,p,y,b=u(b,10),v,e[15],0,5),v=s(v,h,p,y=u(y,10),b,e[10],0,12),b=s(b,v,h,p=u(p,10),y,e[4],0,9),y=s(y,b,v,h=u(h,10),p,e[1],0,12),p=s(p,y,b,v=u(v,10),h,e[5],0,5),h=s(h,p,y,b=u(b,10),v,e[8],0,14),v=s(v,h,p,y=u(y,10),b,e[7],0,6),b=s(b,v,h,p=u(p,10),y,e[6],0,8),y=s(y,b,v,h=u(h,10),p,e[2],0,13),p=s(p,y,b,v=u(v,10),h,e[13],0,6),h=s(h,p,y,b=u(b,10),v,e[14],0,5),v=s(v,h,p,y=u(y,10),b,e[0],0,15),b=s(b,v,h,p=u(p,10),y,e[3],0,13),y=s(y,b,v,h=u(h,10),p,e[9],0,11),p=s(p,y,b,v=u(v,10),h,e[11],0,11),b=u(b,10);var g=this._b+o+b|0;this._b=this._c+i+v|0,this._c=this._d+a+h|0,this._d=this._e+r+p|0,this._e=this._a+n+y|0,this._a=g},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=a},3110:function(e,t,r){const n=r(9282),o=r(9509).Buffer;function i(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function a(e,t){if(e<56)return o.from([e+t]);var r=c(e),n=c(t+55+r.length/2);return o.from(n+r,"hex")}function u(e){var t,r,n,a,s,c=[],f=e[0];if(f<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(f<=183){if(t=f-127,n=128===f?o.from([]):e.slice(1,t),2===t&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}if(f<=191){if(r=f-182,t=i(e.slice(1,r).toString("hex"),16),(n=e.slice(r,t+r)).length<t)throw new Error("invalid RLP");return{data:n,remainder:e.slice(t+r)}}if(f<=247){for(t=f-191,a=e.slice(1,t);a.length;)s=u(a),c.push(s.data),a=s.remainder;return{data:c,remainder:e.slice(t)}}var l=(r=f-246)+(t=i(e.slice(1,r).toString("hex"),16));if(l>e.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(a=e.slice(r,l)).length)throw new Error("invalid rlp, List has a invalid length");for(;a.length;)s=u(a),c.push(s.data),a=s.remainder;return{data:c,remainder:e.slice(l)}}function s(e){return"0x"===e.slice(0,2)}function c(e){var t=e.toString(16);return t.length%2&&(t="0"+t),t}function f(e){if(!o.isBuffer(e))if("string"==typeof e)e=s(e)?o.from(((r="string"!=typeof(n=e)?n:s(n)?n.slice(2):n).length%2&&(r="0"+r),r),"hex"):o.from(e);else if("number"==typeof e)e?(t=c(e),e=o.from(t,"hex")):e=o.from([]);else if(null==e)e=o.from([]);else{if(!e.toArray)throw new Error("invalid type");e=o.from(e.toArray())}var t,r,n;return e}t.encode=function(e){if(e instanceof Array){for(var r=[],n=0;n<e.length;n++)r.push(t.encode(e[n]));var i=o.concat(r);return o.concat([a(i.length,192),i])}return 1===(e=f(e)).length&&e[0]<128?e:o.concat([a(e.length,128),e])},t.decode=function(e,t){if(!e||0===e.length)return o.from([]);var r=u(e=f(e));return t?r:(n.equal(r.remainder.length,0,"invalid remainder"),r.data)},t.getLength=function(e){if(!e||0===e.length)return o.from([]);var t=(e=f(e))[0];if(t<=127)return e.length;if(t<=183)return t-127;if(t<=191)return t-182;if(t<=247)return t-191;var r=t-246;return r+i(e.slice(1,r).toString("hex"),16)}},9509:function(e,t,r){var n=r(8823),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7635:function(e){"use strict";!function(t){var r=2147483647;function n(e){var t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=1779033703,n=3144134277,o=1013904242,i=2773480762,a=1359893119,u=2600822924,s=528734635,c=1541459225,f=new Array(64);function l(e){for(var l=0,d=e.length;d>=64;){var h,p,y,b,v,g=r,m=n,w=o,E=i,_=a,C=u,x=s,S=c;for(p=0;p<16;p++)y=l+4*p,f[p]=(255&e[y])<<24|(255&e[y+1])<<16|(255&e[y+2])<<8|255&e[y+3];for(p=16;p<64;p++)b=((h=f[p-2])>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,v=((h=f[p-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(b+f[p-7]|0)+(v+f[p-16]|0)|0;for(p=0;p<64;p++)b=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&C^~_&x)|0)+(S+(t[p]+f[p]|0)|0)|0,v=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&m^g&w^m&w)|0,S=x,x=C,C=_,_=E+b|0,E=w,w=m,m=g,g=b+v|0;r=r+g|0,n=n+m|0,o=o+w|0,i=i+E|0,a=a+_|0,u=u+C|0,s=s+x|0,c=c+S|0,l+=64,d-=64}}l(e);var d,h=e.length%64,p=e.length/536870912|0,y=e.length<<3,b=h<56?56:120,v=e.slice(e.length-h,e.length);for(v.push(128),d=h+1;d<b;d++)v.push(0);return v.push(p>>>24&255),v.push(p>>>16&255),v.push(p>>>8&255),v.push(p>>>0&255),v.push(y>>>24&255),v.push(y>>>16&255),v.push(y>>>8&255),v.push(y>>>0&255),l(v),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function o(e,t,r){var o;e=e.length<=64?e:n(e);var i=64+t.length+4,a=new Array(i),u=new Array(64),s=[];for(o=0;o<64;o++)a[o]=54;for(o=0;o<e.length;o++)a[o]^=e[o];for(o=0;o<t.length;o++)a[64+o]=t[o];for(o=i-4;o<i;o++)a[o]=0;for(o=0;o<64;o++)u[o]=92;for(o=0;o<e.length;o++)u[o]^=e[o];function c(){for(var e=i-1;e>=i-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;r>=32;)c(),s=s.concat(n(u.concat(n(a)))),r-=32;return r>0&&(c(),s=s.concat(n(u.concat(n(a))).slice(0,r))),s}function i(e,t,r,n,o){var i;for(c(e,16*(2*r-1),o,0,16),i=0;i<2*r;i++)s(e,16*i,o,16),u(o,n),c(o,0,e,t+16*i,16);for(i=0;i<r;i++)c(e,t+2*i*16,e,16*i,16);for(i=0;i<r;i++)c(e,t+16*(2*i+1),e,16*(i+r),16)}function a(e,t){return e<<t|e>>>32-t}function u(e,t){c(e,0,t,0,16);for(var r=8;r>0;r-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(r=0;r<16;++r)e[r]+=t[r]}function s(e,t,r,n){for(var o=0;o<n;o++)r[o]^=e[t+o]}function c(e,t,r,n,o){for(;o--;)r[n++]=e[t++]}function f(e){if(!e||"number"!=typeof e.length)return!1;for(var t=0;t<e.length;t++){if("number"!=typeof e[t])return!1;var r=parseInt(e[t]);if(r!=e[t]||r<0||r>=256)return!1}return!0}function l(e,t){var r=parseInt(e);if(e!=r)throw new Error("invalid "+t);return r}e.exports=function(e,t,n,a,u,d,h){if(!h)throw new Error("missing callback");if(n=l(n,"N"),a=l(a,"r"),u=l(u,"p"),d=l(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/u)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(!f(t))throw new Error("salt must be an array or buffer");for(var p=o(e,t,128*u*a),y=new Uint32Array(32*u*a),b=0;b<y.length;b++){var v=4*b;y[b]=(255&p[v+3])<<24|(255&p[v+2])<<16|(255&p[v+1])<<8|(255&p[v+0])<<0}var g,m,w=new Uint32Array(64*a),E=new Uint32Array(32*a*n),_=32*a,C=new Uint32Array(16),x=new Uint32Array(16),S=u*n*2,A=0,I=null,O=!1,T=0,k=0,P=parseInt(1e3/a),B="undefined"!=typeof setImmediate?setImmediate:setTimeout,R=function(){if(O)return h(new Error("cancelled"),A/S);switch(T){case 0:c(y,m=32*k*a,w,0,_),T=1,g=0;case 1:(r=n-g)>P&&(r=P);for(var t=0;t<r;t++)c(w,0,E,(g+t)*_,_),i(w,_,a,C,x);if(g+=r,A+=r,(f=parseInt(1e3*A/S))!==I){if(O=h(null,A/S))break;I=f}if(g<n)break;g=0,T=2;case 2:var r,f;for((r=n-g)>P&&(r=P),t=0;t<r;t++){var l=w[16*(2*a-1)]&n-1;s(E,l*_,w,_),i(w,_,a,C,x)}if(g+=r,A+=r,(f=parseInt(1e3*A/S))!==I){if(O=h(null,A/S))break;I=f}if(g<n)break;if(c(w,0,y,m,_),++k<u){T=0;break}for(p=[],t=0;t<y.length;t++)p.push(y[t]>>0&255),p.push(y[t]>>8&255),p.push(y[t]>>16&255),p.push(y[t]>>24&255);var b=o(e,p,d);return h(null,1,b)}B(R)};R()}}()},7221:function(e,t,r){"use strict";e.exports=r(9119)(r(3441))},4435:function(e,t,r){"use strict";var n=r(8823).Buffer,o=Object.prototype.toString;t.isArray=function(e,t){if(!Array.isArray(e))throw TypeError(t)},t.isBoolean=function(e,t){if("[object Boolean]"!==o.call(e))throw TypeError(t)},t.isBuffer=function(e,t){if(!n.isBuffer(e))throw TypeError(t)},t.isFunction=function(e,t){if("[object Function]"!==o.call(e))throw TypeError(t)},t.isNumber=function(e,t){if("[object Number]"!==o.call(e))throw TypeError(t)},t.isObject=function(e,t){if("[object Object]"!==o.call(e))throw TypeError(t)},t.isBufferLength=function(e,t,r){if(e.length!==t)throw RangeError(r)},t.isBufferLength2=function(e,t,r,n){if(e.length!==t&&e.length!==r)throw RangeError(n)},t.isLengthGTZero=function(e,t){if(0===e.length)throw RangeError(t)},t.isNumberInInterval=function(e,t,r,n){if(e<=t||e>=r)throw RangeError(n)}},8424:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(3027),i=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(e,t,r){var o=n.from(r?i:a);return e.copy(o,r?8:9),t.copy(o,r?181:214),o},t.privateKeyImport=function(e){var t=e.length,r=0;if(!(t<r+1||48!==e[r])&&!(t<(r+=1)+1)&&128&e[r]){var n=127&e[r];if(r+=1,!(n<1||n>2||t<r+n)){var o=e[r+n-1]|(n>1?e[r+n-2]<<8:0);if(!(t<(r+=n)+o||t<r+3||2!==e[r]||1!==e[r+1]||1!==e[r+2]||t<(r+=3)+2||4!==e[r]||e[r+1]>32||t<r+2+e[r+1]))return e.slice(r+2,r+2+e[r+1])}}},t.signatureExport=function(e){for(var t=n.concat([n.from([0]),e.r]),r=33,i=0;r>1&&0===t[i]&&!(128&t[i+1]);--r,++i);for(var a=n.concat([n.from([0]),e.s]),u=33,s=0;u>1&&0===a[s]&&!(128&a[s+1]);--u,++s);return o.encode(t.slice(i),a.slice(s))},t.signatureImport=function(e){var t=n.alloc(32,0),r=n.alloc(32,0);try{var i=o.decode(e);if(33===i.r.length&&0===i.r[0]&&(i.r=i.r.slice(1)),i.r.length>32)throw new Error("R length is too long");if(33===i.s.length&&0===i.s[0]&&(i.s=i.s.slice(1)),i.s.length>32)throw new Error("S length is too long")}catch(a){return}return i.r.copy(t,32-i.r.length),i.s.copy(r,32-i.s.length),{r:t,s:r}},t.signatureImportLax=function(e){var t=n.alloc(32,0),r=n.alloc(32,0),o=e.length,i=0;if(48===e[i++]){var a=e[i++];if(!(128&a&&(i+=a-128)>o)&&2===e[i++]){var u=e[i++];if(128&u){if(i+(a=u-128)>o)return;for(;a>0&&0===e[i];i+=1,a-=1);for(u=0;a>0;i+=1,a-=1)u=(u<<8)+e[i]}if(!(u>o-i)){var s=i;if(i+=u,2===e[i++]){var c=e[i++];if(128&c){if(i+(a=c-128)>o)return;for(;a>0&&0===e[i];i+=1,a-=1);for(c=0;a>0;i+=1,a-=1)c=(c<<8)+e[i]}if(!(c>o-i)){var f=i;for(i+=c;u>0&&0===e[s];u-=1,s+=1);if(!(u>32)){var l=e.slice(s,s+u);for(l.copy(t,32-l.length);c>0&&0===e[f];c-=1,f+=1);if(!(c>32)){var d=e.slice(f,f+c);return d.copy(r,32-d.length),{r:t,s:r}}}}}}}}}},3441:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(3482),i=r(3550),a=r(6266).ec,u=r(9610),s=new a("secp256k1"),c=s.curve;function f(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new i(t);if(r.cmp(c.p)>=0)return null;var n=(r=r.toRed(c.red)).redSqr().redIMul(r).redIAdd(c.b).redSqrt();return 3===e!==n.isOdd()&&(n=n.redNeg()),s.keyPair({pub:{x:r,y:n}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var n=new i(t),o=new i(r);if(n.cmp(c.p)>=0||o.cmp(c.p)>=0)return null;if(n=n.toRed(c.red),o=o.toRed(c.red),(6===e||7===e)&&o.isOdd()!==(7===e))return null;var a=n.redSqr().redIMul(n);return o.redSqr().redISub(a.redIAdd(c.b)).isZero()?s.keyPair({pub:{x:n,y:o}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new i(e);return t.cmp(c.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var r=new i(e);if(r.cmp(c.n)>=0||r.isZero())throw new Error(u.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(s.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new i(e);return t.isZero()?n.alloc(32):c.n.sub(t).umod(c.n).toArrayLike(n,"be",32)},t.privateKeyModInverse=function(e){var t=new i(e);if(t.cmp(c.n)>=0||t.isZero())throw new Error(u.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(c.n).toArrayLike(n,"be",32)},t.privateKeyTweakAdd=function(e,t){var r=new i(t);if(r.cmp(c.n)>=0)throw new Error(u.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new i(e)),r.cmp(c.n)>=0&&r.isub(c.n),r.isZero())throw new Error(u.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},t.privateKeyTweakMul=function(e,t){var r=new i(t);if(r.cmp(c.n)>=0||r.isZero())throw new Error(u.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new i(e)),r.cmp(c.n)&&(r=r.umod(c.n)),r.toArrayLike(n,"be",32)},t.publicKeyCreate=function(e,t){var r=new i(e);if(r.cmp(c.n)>=0||r.isZero())throw new Error(u.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(s.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var r=f(e);if(null===r)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==f(e)},t.publicKeyTweakAdd=function(e,t,r){var o=f(e);if(null===o)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new i(t)).cmp(c.n)>=0)throw new Error(u.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(c.g.mul(t).add(o.pub).encode(!0,r))},t.publicKeyTweakMul=function(e,t,r){var o=f(e);if(null===o)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new i(t)).cmp(c.n)>=0||t.isZero())throw new Error(u.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(o.pub.mul(t).encode(!0,r))},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),o=0;o<e.length;++o)if(r[o]=f(e[o]),null===r[o])throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);for(var i=r[0].pub,a=1;a<r.length;++a)i=i.add(r[a].pub);if(i.isInfinity())throw new Error(u.EC_PUBLIC_KEY_COMBINE_FAIL);return n.from(i.encode(!0,t))},t.signatureNormalize=function(e){var t=new i(e.slice(0,32)),r=new i(e.slice(32,64));if(t.cmp(c.n)>=0||r.cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);var o=n.from(e);return 1===r.cmp(s.nh)&&c.n.sub(r).toArrayLike(n,"be",32).copy(o,32),o},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new i(t).cmp(c.n)>=0||new i(r).cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new i(e.r);t.cmp(c.n)>=0&&(t=new i(0));var r=new i(e.s);return r.cmp(c.n)>=0&&(r=new i(0)),n.concat([t.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},t.sign=function(e,t,r,o){if("function"==typeof r){var a=r;r=function(r){var s=a(e,t,null,o,r);if(!n.isBuffer(s)||32!==s.length)throw new Error(u.ECDSA_SIGN_FAIL);return new i(s)}}var f=new i(t);if(f.cmp(c.n)>=0||f.isZero())throw new Error(u.ECDSA_SIGN_FAIL);var l=s.sign(e,t,{canonical:!0,k:r,pers:o});return{signature:n.concat([l.r.toArrayLike(n,"be",32),l.s.toArrayLike(n,"be",32)]),recovery:l.recoveryParam}},t.verify=function(e,t,r){var n={r:t.slice(0,32),s:t.slice(32,64)},o=new i(n.r),a=new i(n.s);if(o.cmp(c.n)>=0||a.cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(s.nh)||o.isZero()||a.isZero())return!1;var l=f(r);if(null===l)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);return s.verify(e,n,{x:l.pub.x,y:l.pub.y})},t.recover=function(e,t,r,o){var a={r:t.slice(0,32),s:t.slice(32,64)},f=new i(a.r),l=new i(a.s);if(f.cmp(c.n)>=0||l.cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);try{if(f.isZero()||l.isZero())throw new Error;var d=s.recoverPubKey(e,a,r);return n.from(d.encode(!0,o))}catch(h){throw new Error(u.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return o("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var o=f(e);if(null===o)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);var a=new i(t);if(a.cmp(c.n)>=0||a.isZero())throw new Error(u.ECDH_FAIL);return n.from(o.pub.mul(a).encode(!0,r))}},9119:function(e,t,r){"use strict";var n=r(4435),o=r(8424),i=r(9610);function a(e,t){return void 0===e?t:(n.isBoolean(e,i.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var u=e.privateKeyExport(t,r);return o.privateKeyExport(t,u,r)},privateKeyImport:function(t){if(n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),(t=o.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(i.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,o){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),o=a(o,!0),e.publicKeyTweakAdd(t,r,o)},publicKeyTweakMul:function(t,r,o){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),o=a(o,!0),e.publicKeyTweakMul(t,r,o)},publicKeyCombine:function(t,r){n.isArray(t,i.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,i.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var o=0;o<t.length;++o)n.isBuffer(t[o],i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t[o],33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID);return r=a(r,!0),e.publicKeyCombine(t,r)},signatureNormalize:function(t){return n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(t,64,i.ECDSA_SIGNATURE_LENGTH_INVALID),e.signatureNormalize(t)},signatureExport:function(t){n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(t,64,i.ECDSA_SIGNATURE_LENGTH_INVALID);var r=e.signatureExport(t);return o.signatureExport(r)},signatureImport:function(t){n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(t,i.ECDSA_SIGNATURE_LENGTH_INVALID);var r=o.signatureImport(t);if(r)return e.signatureImport(r);throw new Error(i.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(t){n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(t,i.ECDSA_SIGNATURE_LENGTH_INVALID);var r=o.signatureImportLax(t);if(r)return e.signatureImport(r);throw new Error(i.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(t,r,o){n.isBuffer(t,i.MSG32_TYPE_INVALID),n.isBufferLength(t,32,i.MSG32_LENGTH_INVALID),n.isBuffer(r,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,i.EC_PRIVATE_KEY_LENGTH_INVALID);var a=null,u=null;return void 0!==o&&(n.isObject(o,i.OPTIONS_TYPE_INVALID),void 0!==o.data&&(n.isBuffer(o.data,i.OPTIONS_DATA_TYPE_INVALID),n.isBufferLength(o.data,32,i.OPTIONS_DATA_LENGTH_INVALID),a=o.data),void 0!==o.noncefn&&(n.isFunction(o.noncefn,i.OPTIONS_NONCEFN_TYPE_INVALID),u=o.noncefn)),e.sign(t,r,u,a)},verify:function(t,r,o){return n.isBuffer(t,i.MSG32_TYPE_INVALID),n.isBufferLength(t,32,i.MSG32_LENGTH_INVALID),n.isBuffer(r,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,i.ECDSA_SIGNATURE_LENGTH_INVALID),n.isBuffer(o,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(o,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),e.verify(t,r,o)},recover:function(t,r,o,u){return n.isBuffer(t,i.MSG32_TYPE_INVALID),n.isBufferLength(t,32,i.MSG32_LENGTH_INVALID),n.isBuffer(r,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,i.ECDSA_SIGNATURE_LENGTH_INVALID),n.isNumber(o,i.RECOVERY_ID_TYPE_INVALID),n.isNumberInInterval(o,-1,4,i.RECOVERY_ID_VALUE_INVALID),u=a(u,!0),e.recover(t,r,o,u)},ecdh:function(t,r){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.ecdh(t,r)},ecdhUnsafe:function(t,r,o){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),o=a(o,!0),e.ecdhUnsafe(t,r,o)}}}},7716:function(e,t){"use strict";function r(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,o)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function u(e){r(a,o,i,u,s,"next",e)}function s(e){r(a,o,i,u,s,"throw",e)}u(void 0)}))}}function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=function(e){for(var t=encodeURI(e),r=new Uint8Array(t.length),n=0,o=0;o<t.length;++o){var i=t.charCodeAt(o);37===i?(r[n++]=parseInt(t.slice(o+1,o+3),16),o+=2):r[n++]=i}return r.subarray(0,n)},s=function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];t+="%"+(n>>4).toString(16)+(15&n).toString(16)}return decodeURIComponent(t)};function c(e){var t=e.body,r=void 0===t?"":t,o=e.headers,i=void 0===o?{}:o,a=e.status,c=void 0===a?200:a,l=Promise.resolve(r),d={headers:f(i),ok:c>=200&&c<300,status:c,arrayBuffer:function(){return n((function*(){return yield l.then((function(e){return"string"==typeof e?u(e).buffer:e}))}))()},json:function(){return n((function*(){return yield d.text().then((function(e){return JSON.parse(e)}))}))()},text:function(){return n((function*(){return yield l.then((function(e){return"string"==typeof e?e:s(new Uint8Array(e))}))}))()}};return d}function f(e){var t={forEach:function(t,r){for(var n=0,o=Object.keys(e);n<o.length;n++){var i=o[n];t.call(r,e[i],i)}},get:function(r){return t.has(r)?e[r]:null},has:function(t){return Object.prototype.hasOwnProperty.call(e,t)}};return t}t.hd=function(e){return function(){var t=n((function*(t,r){void 0===r&&(r={});var n=r,o=n.body,i=void 0===o?"":o,a=n.method,s=void 0===a?"GET":a,f=n.headers,l=void 0===f?{}:f,d={method:s,path:t.replace(/https?:\/\/[^/]*/,""),version:"HTTP/1.1",headers:l,body:"string"==typeof i?u(i):new Uint8Array(i)};return c(yield e(d))}));return function(e,r){return t.apply(this,arguments)}}()},t.O7=c,t.h6=function(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];t[o.toUpperCase()]=e[o]}null==t.OPTIONS&&(t.OPTIONS=function(){return{status:204,headers:i}});var i={"content-length":"0",allow:Object.keys(t).join(", ")};return function(e){var r=t[e.method];return null!=r?r(e):{status:405,headers:i}}},t.Fl=function(e,t){void 0===t&&(t=function(){return{status:404}});for(var r=[],n=0,o=Object.keys(e);n<o.length;n++){var i=o[n];r.push({regexp:new RegExp("^"+i+"$"),server:e[i]})}return function(e){for(var n,o=a(r);!(n=o()).done;){var i=n.value,u=i.regexp,s=i.server;if(u.test(e.path))return s(e)}return t(e)}},t.o3=function(e){return function(){var t=n((function*(t){var r=yield e(t),n=r.headers;return o({},r,{headers:o({},void 0===n?{}:n,{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"Accept, Authorization, Content-Type","Access-Control-Allow-Methods":"DELETE, GET, OPTIONS, POST, PUT"})})}));return function(e){return t.apply(this,arguments)}}()}},4189:function(e,t,r){var n=r(9509).Buffer;function o(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,o=this._blockSize,i=e.length,a=this._len,u=0;u<i;){for(var s=a%o,c=Math.min(i-u,o-s),f=0;f<c;f++)r[s+f]=e[u+f];u+=c,(a+=c)%o==0&&this._update(r)}return this._len+=i,this},o.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,o=(r-n)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},9072:function(e,t,r){var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},4448:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function s(){this.init(),this._w=u,o.call(this,64,56)}function c(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(s,o),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,u=0|this._d,s=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+f(h,o,i,u)+s+r[d]+a[h];s=u,u=i,i=c(o),o=n,n=p}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0},s.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=s},8336:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function s(){this.init(),this._w=u,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(s,o),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,u=0|this._d,s=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),y=c(n)+l(p,o,i,u)+s+r[h]+a[p]|0;s=u,u=i,i=f(o),o=n,n=y}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0},s.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=s},8432:function(e,t,r){var n=r(5717),o=r(7499),i=r(4189),a=r(9509).Buffer,u=new Array(64);function s(){this.init(),this._w=u,i.call(this,64,56)}n(s,o),s.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},s.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=s},7499:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u=new Array(64);function s(){this.init(),this._w=u,o.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(s,o),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,u=0|this._d,s=0|this._e,p=0|this._f,y=0|this._g,b=0|this._h,v=0;v<16;++v)r[v]=e.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((t=r[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[v-7]+h(r[v-15])+r[v-16];for(var g=0;g<64;++g){var m=b+d(s)+c(s,p,y)+a[g]+r[g]|0,w=l(n)+f(n,o,i)|0;b=y,y=p,p=s,s=u+m|0,u=i,i=o,o=n,n=m+w|0}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},s.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=s},1686:function(e,t,r){var n=r(5717),o=r(7816),i=r(4189),a=r(9509).Buffer,u=new Array(160);function s(){this.init(),this._w=u,i.call(this,128,112)}n(s,o),s.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},s.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=s},7816:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=new Array(160);function s(){this.init(),this._w=u,o.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0<t>>>0?1:0}n(s,o),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,o=0|this._ch,i=0|this._dh,u=0|this._eh,s=0|this._fh,g=0|this._gh,m=0|this._hh,w=0|this._al,E=0|this._bl,_=0|this._cl,C=0|this._dl,x=0|this._el,S=0|this._fl,A=0|this._gl,I=0|this._hl,O=0;O<32;O+=2)t[O]=e.readInt32BE(4*O),t[O+1]=e.readInt32BE(4*O+4);for(;O<160;O+=2){var T=t[O-30],k=t[O-30+1],P=h(T,k),B=p(k,T),R=y(T=t[O-4],k=t[O-4+1]),j=b(k,T),M=t[O-14],N=t[O-14+1],D=t[O-32],L=t[O-32+1],U=B+N|0,H=P+M+v(U,B)|0;H=(H=H+R+v(U=U+j|0,j)|0)+D+v(U=U+L|0,L)|0,t[O]=H,t[O+1]=U}for(var K=0;K<160;K+=2){H=t[K],U=t[K+1];var F=f(r,n,o),G=f(w,E,_),q=l(r,w),z=l(w,r),W=d(u,x),V=d(x,u),Y=a[K],J=a[K+1],Z=c(u,s,g),X=c(x,S,A),$=I+V|0,Q=m+W+v($,I)|0;Q=(Q=(Q=Q+Z+v($=$+X|0,X)|0)+Y+v($=$+J|0,J)|0)+H+v($=$+U|0,U)|0;var ee=z+G|0,te=q+F+v(ee,z)|0;m=g,I=A,g=s,A=S,s=u,S=x,u=i+Q+v(x=C+$|0,C)|0,i=o,C=_,o=n,_=E,n=r,E=w,r=Q+te+v(w=$+ee|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+E|0,this._cl=this._cl+_|0,this._dl=this._dl+C|0,this._el=this._el+x|0,this._fl=this._fl+S|0,this._gl=this._gl+A|0,this._hl=this._hl+I|0,this._ah=this._ah+r+v(this._al,w)|0,this._bh=this._bh+n+v(this._bl,E)|0,this._ch=this._ch+o+v(this._cl,_)|0,this._dh=this._dh+i+v(this._dl,C)|0,this._eh=this._eh+u+v(this._el,x)|0,this._fh=this._fh+s+v(this._fl,S)|0,this._gh=this._gh+g+v(this._gl,A)|0,this._hh=this._hh+m+v(this._hl,I)|0},s.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=s},2830:function(e,t,r){e.exports=o;var n=r(7187).EventEmitter;function o(){n.call(this)}r(5717)(o,n),o.Readable=r(9481),o.Writable=r(4229),o.Duplex=r(6753),o.Transform=r(4605),o.PassThrough=r(2725),o.finished=r(8610),o.pipeline=r(9946),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",u),r.on("close",s));var a=!1;function u(){a||(a=!0,e.end())}function s(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",o),e.removeListener("drain",i),r.removeListener("end",u),r.removeListener("close",s),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},2553:function(e,t,r){"use strict";var n=r(9509).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=c,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=a(t[n]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if((o=a(t[n]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if((o=a(t[n]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},9604:function(e,t,r){var n=r(3944);e.exports=function(e){return"string"!=typeof e?e:n(e)?e.slice(2):e}},7121:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}}),e=r.hmd(e);var n=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},4927:function(e,t,r){function n(e){try{if(!r.g.localStorage)return!1}catch(n){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},384:function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},5955:function(e,t,r){"use strict";var n=r(2584),o=r(8662),i=r(6430),a=r(5692);function u(e){return e.call.bind(e)}var s="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=u(Object.prototype.toString),l=u(Number.prototype.valueOf),d=u(String.prototype.valueOf),h=u(Boolean.prototype.valueOf);if(s)var p=u(BigInt.prototype.valueOf);if(c)var y=u(Symbol.prototype.valueOf);function b(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(r){return!1}}function v(e){return"[object Map]"===f(e)}function g(e){return"[object Set]"===f(e)}function m(e){return"[object WeakMap]"===f(e)}function w(e){return"[object WeakSet]"===f(e)}function E(e){return"[object ArrayBuffer]"===f(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(E.working?E(e):e instanceof ArrayBuffer)}function C(e){return"[object DataView]"===f(e)}function x(e){return"undefined"!=typeof DataView&&(C.working?C(e):e instanceof DataView)}function S(e){return"[object SharedArrayBuffer]"===f(e)}function A(e){return"undefined"!=typeof SharedArrayBuffer&&(S.working?S(e):e instanceof SharedArrayBuffer)}function I(e){return b(e,l)}function O(e){return b(e,d)}function T(e){return b(e,h)}function k(e){return s&&b(e,p)}function P(e){return c&&b(e,y)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||x(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},v.working="undefined"!=typeof Map&&v(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(v.working?v(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(m.working?m(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),t.isArrayBuffer=_,C.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&C(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=x,S.working="undefined"!=typeof SharedArrayBuffer&&S(new SharedArrayBuffer),t.isSharedArrayBuffer=A,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===f(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===f(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===f(e)},t.isGeneratorObject=function(e){return"[object Generator]"===f(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===f(e)},t.isNumberObject=I,t.isStringObject=O,t.isBooleanObject=T,t.isBigIntObject=k,t.isSymbolObject=P,t.isBoxedPrimitive=function(e){return I(e)||O(e)||T(e)||k(e)||P(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||A(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9539:function(e,t,r){var n=r(4155),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])v(u)||!_(u)?a+=" "+u:a+=" "+c(u);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var a={},u=/^$/;if(n.env.NODE_DEBUG){var s=n.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+s+"$","i")}function c(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),d(n,e,n.depth)}function f(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function l(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return m(o)||(o=d(e,o,n)),o}var i=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(b(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,r);if(i)return i;var a=Object.keys(r),u=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(S(r)){var s=r.name?": "+r.name:"";return e.stylize("[Function"+s+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(C(r))return e.stylize(Date.prototype.toString.call(r),"date");if(x(r))return h(r)}var c,f="",l=!1,_=["{","}"];(y(r)&&(l=!0,_=["[","]"]),S(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return E(r)&&(f=" "+RegExp.prototype.toString.call(r)),C(r)&&(f=" "+Date.prototype.toUTCString.call(r)),x(r)&&(f=" "+h(r)),0!==a.length||l&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?function(e,t,r,n,o){for(var i=[],a=0,u=t.length;a<u;++a)k(t,String(a))?i.push(p(e,t,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))})),i}(e,r,n,u,a):a.map((function(t){return p(e,r,n,u,t,l)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var a,u,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(u=e.stylize("[Setter]","special")),k(n,o)||(a="["+o+"]"),u||(e.seen.indexOf(s.value)<0?(u=v(r)?d(e,s.value,null):d(e,s.value,r-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+u.split("\n").map((function(e){return" "+e})).join("\n")):u=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function y(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function v(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function w(e){return void 0===e}function E(e){return _(e)&&"[object RegExp]"===A(e)}function _(e){return"object"==typeof e&&null!==e}function C(e){return _(e)&&"[object Date]"===A(e)}function x(e){return _(e)&&("[object Error]"===A(e)||e instanceof Error)}function S(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(u.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(5955),t.isArray=y,t.isBoolean=b,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=E,t.types.isRegExp=E,t.isObject=_,t.isDate=C,t.types.isDate=C,t.isError=x,t.types.isNativeError=x,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),O[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(5717),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,o)}catch(a){r(a)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=P,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(B.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},6430:function(e,t,r){"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),u=r(1405)()&&"symbol"==typeof Symbol.toStringTag,s=o(),c=i("String.prototype.slice"),f={},l=r(882),d=Object.getPrototypeOf;u&&l&&d&&n(s,(function(e){if("function"==typeof r.g[e]){var t=new r.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=d(t),o=l(n,Symbol.toStringTag);if(!o){var i=d(n);o=l(i,Symbol.toStringTag)}f[e]=o.get}}));var h=r(5692);e.exports=function(e){return!!h(e)&&(u?function(e){var t=!1;return n(f,(function(r,n){if(!t)try{var o=r.call(e);o===n&&(t=o)}catch(i){}})),t}(e):c(a(e),8,-1))}},2956:function(e,t){"use strict";function r(){var e=[],t=!1;function r(){t&&(t=!1,e=e.slice())}return[function(t){r(),e.push(t);var n=!0;return function(){n&&(n=!1,r(),e.splice(e.indexOf(t),1))}},function(r){t=!0;for(var n=e,o=0;o<n.length;++o)n[o](r);t=!1}]}t.BU=r,t.j6=function(){var e={};return[function(t,n){var o=e[t];return null==o&&(o=e[t]=r()),o[0](n)},function(t,r){var n=e[t];null!=n&&n[1](r)}]}},6601:function(){},9214:function(){},2361:function(){},4616:function(){},3083:function(e,t,r){"use strict";var n=r(2190);e.exports=function(){return n(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],(function(e){return"function"==typeof r.g[e]}))}},882:function(e,t,r){"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(o){n=null}e.exports=n},8597:function(e){"use strict";e.exports={i8:"6.5.4"}},6523:function(e){"use strict";e.exports=JSON.parse('{"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation\'s data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation\'s data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"ommerReward":{"v":"625000000000000000","d":"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},"niblingReward":{"v":"156250000000000000","d":"the amount a miner gets for inculding a uncle"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}')},9610:function(e){"use strict";e.exports=JSON.parse('{"COMPRESSED_TYPE_INVALID":"compressed should be a boolean","EC_PRIVATE_KEY_TYPE_INVALID":"private key should be a Buffer","EC_PRIVATE_KEY_LENGTH_INVALID":"private key length is invalid","EC_PRIVATE_KEY_RANGE_INVALID":"private key range is invalid","EC_PRIVATE_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting private key is invalid","EC_PRIVATE_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PRIVATE_KEY_EXPORT_DER_FAIL":"couldn\'t export to DER format","EC_PRIVATE_KEY_IMPORT_DER_FAIL":"couldn\'t import from DER format","EC_PUBLIC_KEYS_TYPE_INVALID":"public keys should be an Array","EC_PUBLIC_KEYS_LENGTH_INVALID":"public keys Array should have at least 1 element","EC_PUBLIC_KEY_TYPE_INVALID":"public key should be a Buffer","EC_PUBLIC_KEY_LENGTH_INVALID":"public key length is invalid","EC_PUBLIC_KEY_PARSE_FAIL":"the public key could not be parsed or is invalid","EC_PUBLIC_KEY_CREATE_FAIL":"private was invalid, try again","EC_PUBLIC_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting public key is invalid","EC_PUBLIC_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PUBLIC_KEY_COMBINE_FAIL":"the sum of the public keys is not valid","ECDH_FAIL":"scalar was invalid (zero or overflow)","ECDSA_SIGNATURE_TYPE_INVALID":"signature should be a Buffer","ECDSA_SIGNATURE_LENGTH_INVALID":"signature length is invalid","ECDSA_SIGNATURE_PARSE_FAIL":"couldn\'t parse signature","ECDSA_SIGNATURE_PARSE_DER_FAIL":"couldn\'t parse DER signature","ECDSA_SIGNATURE_SERIALIZE_DER_FAIL":"couldn\'t serialize signature to DER format","ECDSA_SIGN_FAIL":"nonce generation function failed or private key is invalid","ECDSA_RECOVER_FAIL":"couldn\'t recover public key from signature","MSG32_TYPE_INVALID":"message should be a Buffer","MSG32_LENGTH_INVALID":"message length is invalid","OPTIONS_TYPE_INVALID":"options should be an Object","OPTIONS_DATA_TYPE_INVALID":"options.data should be a Buffer","OPTIONS_DATA_LENGTH_INVALID":"options.data length is invalid","OPTIONS_NONCEFN_TYPE_INVALID":"options.noncefn should be a Function","RECOVERY_ID_TYPE_INVALID":"recovery should be a Number","RECOVERY_ID_VALUE_INVALID":"recovery should have value between -1 and 4","TWEAK_TYPE_INVALID":"tweak should be a Buffer","TWEAK_LENGTH_INVALID":"tweak length is invalid"}')}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var e=r(7757),t=r.n(e),n=r(8926),o=r.n(n),i=r(3038),a=r.n(i),u=(r(2383),r(3715)),s=r.n(u),c=r(2156),f=r.n(c),l=r(9911);const d=l.base16,h=l.base32,p=(l.base32hex,l.base64);l.base64url,l.codec;var y=r(7716);const b=y.hd,v=y.O7,g=y.h6,m=y.Fl;y.o3;function w(){return w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(this,arguments)}var E="_yaob",_=1,C={};function x(e,t){Object.prototype.hasOwnProperty.call(e,E)?w(e._yaob,t):Object.defineProperty(e,E,{value:t})}function S(e){var t=e.prototype;if(!Object.prototype.hasOwnProperty.call(t,E)){x(t,{})}return e}function A(e){Object.prototype.hasOwnProperty.call(e,E)&&null!=e._yaob.localId||x(e,{localId:_++,bridges:[],listeners:{},watchers:{}});return e}function I(e){if(null==e._yaob)throw new TypeError("Not a bridgeable object");return A(e),e._yaob}function O(e,t){null==t?t="":t+=".";for(var r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++){var o=n[r],i=t+o;if(null!=C[i])throw new Error("A shared value named "+i+" already exists");C[i]=e[o],x(e[o],{shareId:i})}}function T(e,t){try{var r=B(e,t),n=R(e,r,t);return""!==r?{map:r,raw:n}:{raw:n}}catch(t){return k(e,t)}}function k(e,t){var r=B(e,t);return{map:r,raw:R(e,r,t),throw:!0}}function P(e,t,r){var n=t.map,o=t.raw,i=null!=n?j(e,n,o,r):o;if(t.throw)throw i;return i}function B(e,t){switch(typeof t){case"boolean":case"number":case"string":return"";case"object":if(null===t)return"";if(t instanceof Date)return"d";if(t instanceof Error)return"e";if(t instanceof ArrayBuffer)return"ab";if(t instanceof Uint8Array)return"u8";if(null!=t._yaob)return null!=t._yaob.shareId?"s":"o";if(Array.isArray(t)){for(var r="",n=0;n<t.length;++n){var o=B(e,t[n]);if(""!==o&&""===r){r=[];for(var i=0;i<n;++i)r[i]=""}""!==r&&(r[n]=o)}return r}var a="";for(var u in t){var s=B(e,t[u]);""!==s&&(""===a&&(a={}),a[u]=s)}return a;case"undefined":return"u";case"function":return null!=t._yaob&&null!=t._yaob.shareId?"s":"?";default:return"?"}}function R(e,t,r){switch(t){case"":return r;case"?":return typeof r;case"d":return r.toISOString();case"e":return function(e,t){var r=w({message:t.message,stack:t.stack},t),n=null;return t instanceof EvalError?n="EvalError":t instanceof RangeError?n="RangeError":t instanceof ReferenceError?n="ReferenceError":t instanceof SyntaxError?n="SyntaxError":t instanceof TypeError?n="TypeError":t instanceof URIError&&(n="URIError"),w({base:n},T(e,r))}(e,r);case"o":return e.getPackedId(r);case"s":return r._yaob.shareId;case"u":return null;case"ab":return p.stringify(new Uint8Array(r));case"u8":return p.stringify(r);default:if(Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)n[o]=R(e,t[o],r[o]);return n}var i={};for(var a in r)i[a]=a in t?R(e,t[a],r[a]):r[a];return i}}function j(e,t,r,n){switch(t){case"":return r;case"?":throw new TypeError("Unsupported value of type "+("string"==typeof r?r:"?")+" at "+n);case"d":return new Date(r);case"e":if("object"!=typeof r||null===r)throw new TypeError("Expecting an error description at "+n);return function(e,t,r){var n={EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError},o=new(null!=t.base&&n[t.base]||Error),i=P(e,t,r);for(var a in i)o[a]=i[a];return o}(e,r,n);case"o":if(null===r)throw new TypeError("Closed bridge object at "+n);if("number"!=typeof r)throw new TypeError("Expecting a packedId at "+n);var o=e.getObject(-r);if(null==o)throw new RangeError("Invalid packedId "+r+" at "+n);return o;case"s":if("string"!=typeof r)throw new TypeError("Expecting a shareId at "+n);var i=C[r];if(null==i)throw new RangeError("Invalid shareId '"+r+"' at "+n);return i;case"u":return;case"ab":if("string"!=typeof r)throw new TypeError("Expecting a base64 string at "+n);return p.parse(r).buffer;case"u8":if("string"!=typeof r)throw new TypeError("Expecting a base64 string at "+n);return p.parse(r);default:if("object"!=typeof t||null===t)throw new TypeError("Invalid type information "+t+" at "+n);if("object"!=typeof r||null===r)throw new TypeError("Expecting an array or object at "+n);if(Array.isArray(t)){if(!Array.isArray(r))throw new TypeError("Expecting an array at "+n);for(var a=[],u=0;u<t.length;++u)a[u]=j(e,t[u],r[u],n+"["+u+"]");return a}var s={};for(var c in r)s[c]=c in t?j(e,t[c],r[c],n+"."+c):r[c];return s}}var M={};function N(e,t,r){var n=I(e),o=n.closed,i=n.listeners;return o?function(){}:(null==i[t]?i[t]=[r]:i[t].push(r),function(){i[t]=i[t].filter((function(e){return e!==r}))})}function D(e){var t=I(e),r=t.listeners.close;if(null!=r)for(var n=0;n<r.length;n++){H(e,r[n],void 0,!0)}t.closed=!0;for(var o=0,i=t.bridges;o<i.length;o++){i[o].emitClose(t.localId)}t.bridges=[],t.listeners={},t.watchers={}}function L(e,t,r){var n=I(e);if(n.closed)throw new Error("Cannot emit event on closed object");for(var o=0,i=n.bridges;o<i.length;o++){i[o].emitEvent(n.localId,t,r)}var a=n.listeners[t];if(null!=a)for(var u=0;u<a.length;u++){H(e,a[u],r,"error"!==t)}}function U(e,t){var r=I(e);if(r.closed)throw new Error("Cannot update closed object");for(var n=0,o=r.bridges;n<o.length;n++){o[n].markDirty(r.localId,t)}for(var i in null!=t&&null!=r.watchers[t]&&(r.watchers[t].data=M),r.watchers){var a=r.watchers[i];try{var u=e[i];if(u!==a.data){a.data=u;for(var s=0,c=a.fs;s<c.length;s++){H(e,c[s],a.data,!0)}}}catch(f){}}}function H(e,t,r,n){try{var o=t(r);n&&null!=o&&"function"==typeof o.then&&o.then(void 0,(function(t){return L(e,"error",t)}))}catch(i){n&&L(e,"error",i)}}var K={};function F(e,t,r){var n=!1,o={};for(var i in r)try{var a=t[i];a!==r[i]&&(n=!0,o[i]=T(e,a),r[i]=a)}catch(u){o[i]=k(e,u),r[i]=K}return{dirty:n,props:o}}function G(e,t){var r,n={},o=(r=t.localId,{localId:_++,bridges:[],listeners:{},watchers:{},remoteId:r,errors:{},props:{}});for(var i in n._yaob={value:o},t.props)n[i]={enumerable:!0,get:z(o,i)};for(var a=0,u=t.methods;a<u.length;a++){var s=u[a];n[s]={value:W(e,o,s)}}return Object.create(Object.prototype,n)}function q(e,t,r){var n=t._yaob;for(var o in r)try{n.props[o]=P(e,r[o],o),n.errors[o]=!1}catch(i){n.props[o]=i,n.errors[o]=!0}}function z(e,t){return function(){if(e.errors[t])throw e.props[t];return e.props[t]}}function W(e,t,r){return function(){if(t.closed)return Promise.reject(new TypeError("Cannot call method '"+r+"' of closed proxy"));for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return e.emitCall(t.remoteId,r,o)}}var V=function(){function e(e){var t=e.sendMessage,r=e.throttleMs,n=void 0===r?0:r;this.proxies={},this.objects={},this.caches={},this.nextCallId=0,this.pendingCalls={},this.dirty={},this.message={},this.throttleMs=n,this.lastUpdate=0,this.sendPending=!1,this.sendMessage=t}var t=e.prototype;return t.close=function(e){for(var t in this.pendingCalls){this.pendingCalls[Number(t)].reject(e)}for(var r in this.proxies)D(this.proxies[Number(r)]);this.closed=!0},t.getObject=function(e){return e<0?this.proxies[-e]:this.objects[e]},t.getPackedId=function(e){var t=I(e);if(t.closed)return null;if(null!=t.remoteId&&null!=this.proxies[t.remoteId])return-t.remoteId;if(null==this.objects[t.localId]){this.objects[t.localId]=e;var r=function(e,t){for(var r={},n=Object.prototype,o=t;o!==n&&null!=o;o=Object.getPrototypeOf(o))for(var i=0,a=Object.getOwnPropertyNames(o);i<a.length;i++){var u=a[i];u===E||/^_/.test(u)||"constructor"===u||(r[u]=!0)}var s={},c=[],f={};for(var l in r)try{var d=t[l];"function"!=typeof d||null!=d._yaob&&null!=d._yaob.shareId?(s[l]=d,f[l]=T(e,d)):c.push(l)}catch(h){s[l]=K,f[l]=k(e,h)}return{cache:s,create:{localId:I(t).localId,methods:c,props:f}}}(this,e),n=r.cache,o=r.create;this.caches[t.localId]=n,t.bridges.push(this),this.emitCreate(o,e)}return t.localId},t.markDirty=function(e,t){var r=this.caches[e];null!=t&&t in r&&(r[t]=K),this.dirty[e]={cache:r,object:this.objects[e]},this.wakeup()},t.emitClose=function(e){delete this.objects[e],delete this.caches[e],null==this.message.closed&&(this.message.closed=[]),this.message.closed.push(e),this.wakeup()},t.emitCreate=function(e,t){null==this.message.created&&(this.message.created=[]),this.message.created.push(e)},t.emitCall=function(e,t,r){var n=this,o=this.nextCallId++,i=w({callId:o,remoteId:e,name:t},T(this,r));return null==this.message.calls&&(this.message.calls=[]),this.message.calls.push(i),this.wakeup(),new Promise((function(e,r){n.pendingCalls[o]={name:t,resolve:e,reject:r}}))},t.emitEvent=function(e,t,r){var n=w({localId:e,name:t},T(this,r));null==this.message.events&&(this.message.events=[]),this.message.events.push(n),this.wakeup()},t.emitReturn=function(e,t,r){var n=w({callId:e},t?k(this,r):T(this,r));null==this.message.returns&&(this.message.returns=[]),this.message.returns.push(n),this.wakeup()},t.handleMessage=function(e){var t=this;if(e.created){for(var r=0,n=e.created;r<n.length;r++){var o=n[r];this.proxies[o.localId]=G(this,o)}for(var i=0,a=e.created;i<a.length;i++){var u=a[i];q(this,this.proxies[u.localId],u.props)}}if(e.changed){for(var s=0,c=e.changed;s<c.length;s++){var f=c[s],l=f.localId,d=f.props,h=this.proxies[l];if(null==h)throw new RangeError("Invalid localId "+l);q(this,h,d)}for(var p=0,y=e.changed;p<y.length;p++){var b=y[p];U(this.proxies[b.localId])}}if(e.events)for(var v=0,g=e.events;v<g.length;v++){var m=g[v],w=m.localId,E=m.name,_=0===w?this:this.proxies[w];if(null!=_)try{L(_,E,P(this,m,E))}catch(N){L(_,"error",N)}}if(e.calls)for(var C=function(e,r){var n=r[e],o=n.callId,i=n.remoteId,a=n.name;try{var u=t.objects[i];if(null==u)throw new TypeError("Cannot call method '"+a+"' of closed proxy (remote)");if("function"!=typeof u[a])throw new TypeError("'"+a+"' is not a function");var s=P(t,n,a+".arguments");Promise.resolve(u[a].apply(u,s)).then((function(e){return t.emitReturn(o,!1,e)}),(function(e){return t.emitReturn(o,!0,e)}))}catch(N){t.emitReturn(o,!0,N)}},x=0,S=e.calls;x<S.length;x++)C(x,S);if(e.returns)for(var A=0,I=e.returns;A<I.length;A++){var O=I[A],T=O.callId,k=this.pendingCalls[T];if(null==k)throw new RangeError("Invalid callId "+T);try{k.resolve(P(this,O,k.name+".return"))}catch(N){k.reject(N)}finally{delete this.pendingCalls[T]}}if(e.closed)for(var B=0,R=e.closed;B<R.length;B++){var j=R[B],M=this.proxies[j];if(null==M)return;delete this.proxies[j],D(M)}},t.sendNow=function(){if(!this.closed){for(var e in this.dirty){var t=Number(e),r=this.dirty[t],n=F(this,r.object,r.cache),o=n.dirty,i=n.props;if(o){var a={localId:t,props:i};null==this.message.changed&&(this.message.changed=[]),this.message.changed.push(a)}}var u=this.message;this.dirty={},this.message={},this.sendMessage(u)}},t.wakeup=function(){var e=this;if(!this.sendPending){this.sendPending=!0;var t=this.lastUpdate+this.throttleMs-Date.now();setTimeout((function(){e.sendPending=!1,e.lastUpdate=Date.now(),e.sendNow()}),t<0?0:t)}},e}();S(V);var Y=function(){function e(e){var t=this;this._state=new V(e),this._rootPromise=new Promise((function(e){return N(t._state,"root",e)}))}var t=e.prototype;return t.handleMessage=function(e){this._state.handleMessage(e)},t.getRoot=function(){return this._rootPromise},t.sendRoot=function(e){this._state.emitEvent(0,"root",e)},t.close=function(e){this._state.close(e)},e}();var J=function(e,t){return N(this,e,t)},Z=function(e,t){return function(e,t,r){var n=I(e),o=n.closed,i=n.watchers,a=e[t];return o?function(){}:(null==i[t]?i[t]={data:a,fs:[r]}:i[t].fs.push(r),function(){i[t].fs=i[t].fs.filter((function(e){return e!==r}))})}(this,e,t)};O({onMethod:J,watchMethod:Z});var X=function(){function e(){}var t=e.prototype;return t._close=function(){D(this)},t._emit=function(e,t){return L(this,e,t)},t._update=function(e){U(this,e)},e}(),$=X.prototype;$.on=J,$.watch=Z,S(X);var Q=r(4638);r(7635);var ee=r(9713),te=r.n(ee),re=r(7630);const ne=re.asArray,oe=re.asBoolean,ie=re.asCodec,ae=re.asDate,ue=re.asEither,se=(re.asJSON,re.asMap),ce=re.asMaybe,fe=(re.asNone,re.asNull),le=re.asNumber,de=re.asObject,he=re.asOptional,pe=re.asString,ye=(re.asUndefined,re.asUnknown),be=re.asValue,ve=re.uncleaner;var ge=r(4575),me=r.n(ge),we=r(3913),Ee=r.n(we),_e=function(){function e(){me()(this,e)}return Ee()(e,[{key:"getFirstWalletInfo",value:function(e){return this.allKeys.find((function(t){return t.type===e}))}},{key:"getWalletInfo",value:function(e){return this.allKeys.find((function(t){return t.id===e}))}},{key:"listWalletIds",value:function(){return this.allKeys.map((function(e){return e.id}))}}]),e}();function Ce(e){var t=e.length<10,r=!/[0-9]/.test(e),n=!/[a-z]/.test(e),o=!/[A-Z]/.test(e),i=(/[0-9]/.test(e)?10:0)+(/[A-Z]/.test(e)?26:0)+(/[a-z]/.test(e)?26:0)+(/[^0-9A-Za-z]/.test(e)?30:0);return{secondsToCrack:Math.pow(i,e.length)/1e6,tooShort:t,noNumber:r,noLowerCase:n,noUpperCase:o,passed:e.length>=16||!(t||r||o||n)}}function xe(e){for(var t=e.toLowerCase().replace(/[ \f\r\n\t\v]+/g," ").replace(/ $/,"").replace(/^ /,""),r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<32||n>126)throw new Error("Bad characters in username")}return t}O(_e.prototype,"AccountSync"),O({checkPasswordRules:Ce}),O({fixUsername:xe});var Se=ie((function(e){return d.parse(pe(e))}),(function(e){return d.stringify(e).toLowerCase()})),Ae=ie((function(e){return h.parse(pe(e),{loose:!0})}),(function(e){return h.stringify(e,{pad:!1})})),Ie=ie((function(e){return p.parse(pe(e))}),(function(e){return p.stringify(e)})),Oe=de({voucherId:pe,activates:ae,created:ae,ip:pe,ipDescription:pe,deviceDescription:he(pe)}),Te=de({min_length:le,category:be("address","must","numeric","recovery2","string"),question:pe}),ke=de({encryptionType:le,data_base64:pe,iv_hex:pe}),Pe=de({salt_hex:Se,n:le,r:le,p:le}),Be=de({loginRequest:he(de({appId:pe}).withRest),publicKey:Ie,timeout:he(le)}).withRest,Re=de({publicKey:Ie,box:ke}),je=ne(Ie),Me=de({data:ye,deviceDescription:he(pe),otp:he(pe),voucherId:he(pe),voucherAuth:he(Ie),loginId:he(Ie),loginAuth:he(Ie),userId:he(Ie),passwordAuth:he(Ie),pin2Id:he(Ie),pin2Auth:he(Ie),recovery2Id:he(Ie),recovery2Auth:he(je),loginIds:he(ne(Ie)),otpResetAuth:he(pe),did:he(pe),l1:he(Ie),lp1:he(Ie),lpin1:he(Ie),lra1:he(Ie),recoveryAuth:he(Ie)}),Ne=de({results:he(ye),status_code:le,message:pe}),De=de({otpTimeout:he(le,604800),otpKey:Ae}),Le=de({passwordAuth:Ie,passwordAuthBox:ke,passwordAuthSnrp:Pe,passwordBox:ke,passwordKeySnrp:Pe}),Ue=de({pin2Id:he(Ie),pin2Auth:he(Ie),pin2Box:he(ke),pin2KeyBox:he(ke),pin2TextBox:ke}),He=de({recovery2Id:Ie,recovery2Auth:je,recovery2Box:ke,recovery2KeyBox:ke,question2Box:ke}),Ke=de({loginAuthBox:ke,loginAuth:Ie}),Fe=de({approvedVouchers:he(ne(pe)),rejectedVouchers:he(ne(pe))}),Ge=de({keyBoxes:ne(ke),newSyncKeys:he(ne(pe),[])}),qe=de({appId:pe,loginId:Ie,parentBox:he(ke)}).withRest,ze=de({request:Be,replies:ne(Re)}),We=de({appId:pe,created:ae,loginId:Ie,userId:he(Ie),children:he(ne((function(e){return We(e)}))),parentBox:he(ke),otpKey:he(Ae),otpResetDate:he(ae),otpTimeout:he(le),passwordAuthBox:he(ke),passwordAuthSnrp:he(Pe),passwordBox:he(ke),passwordKeySnrp:he(Pe),pin2Box:he(ke),pin2KeyBox:he(ke),pin2TextBox:he(ke),question2Box:he(ke),recovery2Box:he(ke),recovery2KeyBox:he(ke),loginAuthBox:he(ke),pendingVouchers:he(ne(Oe),[]),keyBoxes:he(ne(ke)),mnemonicBox:he(ke),rootKeyBox:he(ke),syncKeyBox:he(ke)}),Ve=ne(de({loginId:Ie,otpResetPending:he(oe,!1),pendingVouchers:he(ne(Oe),[]),recovery2Corrupt:he(oe,!1)})),Ye=de({login_id:he(Ie),otp_reset_auth:he(pe),otp_timeout_date:he(ae),reason:he(pe),voucher_activates:he(ae),voucher_auth:he(Ie),voucher_id:he(pe)}),Je=de({otpResetDate:ae}),Ze=de({wait_seconds:he(le)}),Xe=ne(Te),$e=de({question2Box:ke}),Qe=de({passwordAuthSnrp:he(Pe),questionBox:he(ke),questionKeySnrp:he(Pe),recoveryAuthSnrp:he(Pe)}),et=de({loginId:Ie,voucherAuth:Ie,voucherId:pe,created:ae,activates:ae,status:be("pending","approved","rejected"),ip:pe,ipDescription:pe,deviceDescription:he(pe)}),tt=de({appId:pe,created:function(e){return null==e?new Date:ae(e)},loginId:Ie,children:he(ne((function(e){return tt(e)})),[]),parentBox:he(ke),parentId:function(){},otpKey:he(Ae),otpResetAuth:he(pe),otpResetDate:he(ae),otpTimeout:he(le),passwordAuth:he(Ie),passwordAuthBox:he(ke),passwordAuthSnrp:he(Pe),passwordBox:he(ke),passwordKeySnrp:he(Pe),pin2Id:he(Ie),pin2Auth:he(Ie),pin2Box:he(ke),pin2KeyBox:he(ke),pin2TextBox:he(ke),recovery2Id:he(Ie),recovery2Auth:he(je),question2Box:he(ke),recovery2Box:he(ke),recovery2KeyBox:he(ke),loginAuth:he(Ie),loginAuthBox:he(ke),keyBoxes:he(ne(ke),[]),mnemonicBox:he(ke),rootKeyBox:he(ke),syncKeyBox:he(ke),vouchers:he(ne(et),[]),pinBox:he(ke),pinId:he(pe),pinKeyBox:he(ke)}),rt=de({lastLogin:he((function(e){if(e instanceof Date)return e;throw new TypeError("Expecting a Date")})),loginId:Ie,loginKey:Ie,repos:de(de(ke)),server:tt,username:pe}),nt=ne(rt);var ot=r(9176),it=r.n(ot)()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),at=function(e){return it.decode(e)},ut=function(e){return it.encode(e)},st=function(e){for(var t=encodeURI(e),r=new Uint8Array(t.length),n=0,o=0;o<t.length;++o){var i=t.charCodeAt(o);37===i?(r[n++]=parseInt(t.slice(o+1,o+3),16),o+=2):r[n++]=i}return r.subarray(0,n)},ct=function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];t+="%"+(n>>4).toString(16)+(15&n).toString(16)}return decodeURIComponent(t)},ft=r(319),lt=r.n(ft);function dt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Cannot reach the network";if(!(this instanceof dt))throw new TypeError("Class constructor NetworkError cannot be invoked without 'new'");function r(t){return e=new Error(t),Object.defineProperty(e,"constructor",{value:dt,configurable:!0,writable:!0}),e}return r(t),e.name="NetworkError",e}function ht(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"The application is too old. Please upgrade.";if(!(this instanceof ht))throw new TypeError("Class constructor ObsoleteApiError cannot be invoked without 'new'");function r(t){return e=new Error(t),Object.defineProperty(e,"constructor",{value:ht,configurable:!0,writable:!0}),e}return r(t),e.name="ObsoleteApiError",e}function pt(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Invalid OTP token";if(!(this instanceof pt))throw new TypeError("Class constructor OtpError cannot be invoked without 'new'");function n(e){return t=new Error(e),Object.defineProperty(t,"constructor",{value:pt,configurable:!0,writable:!0}),t}n(r),t.name="OtpError",t.reason="otp";try{var o=Ye(e);null!=o.login_id&&(t.loginId=p.stringify(o.login_id)),null!=o.otp_reset_auth&&(t.resetToken=o.otp_reset_auth),"ip"===o.reason&&(t.reason="ip"),null!=o.otp_timeout_date&&(t.resetDate=new Date(o.otp_timeout_date)),null!=o.voucher_activates&&(t.voucherActivates=o.voucher_activates),null!=o.voucher_auth&&(t.voucherAuth=p.stringify(o.voucher_auth)),null!=o.voucher_id&&(t.voucherId=o.voucher_id)}catch(i){}return t}function yt(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Invalid password";if(!(this instanceof yt))throw new TypeError("Class constructor PasswordError cannot be invoked without 'new'");function n(e){return t=new Error(e),Object.defineProperty(t,"constructor",{value:yt,configurable:!0,writable:!0}),t}n(r),t.name="PasswordError";try{var o=Ze(e);t.wait=o.wait_seconds}catch(i){}return t}function bt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Invalid username";if(!(this instanceof bt))throw new TypeError("Class constructor UsernameError cannot be invoked without 'new'");function r(t){return e=new Error(t),Object.defineProperty(e,"constructor",{value:bt,configurable:!0,writable:!0}),e}return r(t),e.name="UsernameError",e}function vt(e){return function(t){if(t instanceof Error&&t.name===e)return t}}vt("DustSpendError");var gt=vt("InsufficientFundsError"),mt=(vt("NetworkError"),vt("NoAmountSpecifiedError"),vt("ObsoleteApiError"),vt("OtpError")),wt=(vt("PasswordError"),vt("PendingFundsError")),Et=(vt("SameCurrencyError"),vt("SpendToSelfError"),vt("SwapAboveLimitError")),_t=vt("SwapBelowLimitError"),Ct=vt("SwapCurrencyError"),xt=vt("SwapPermissionError"),St=vt("UsernameError"),At=r(8826);function It(e,t){var r=s().hmac(s().sha256,t);return Uint8Array.from(r.update(e).digest())}function Ot(e){var t=s().sha256();return Uint8Array.from(t.update(e).digest())}function Tt(e,t){var r=e.length;if(r!==t.length)return!1;for(var n=0,o=0;o<r;++o)n|=e[o]^t[o];return 0===n}var kt=r.n(At)().ModeOfOperation.cbc;function Pt(e,t){var r=Bt(e,t);return 0===r[r.length-1]?ct(r.subarray(0,-1)):ct(r)}function Bt(e,t){if(0!==e.encryptionType)throw new Error("Unknown encryption type");var r=d.parse(e.iv_hex),n=p.parse(e.data_base64),o=new kt(t,r).decrypt(n),i=1+o[0]+4,a=o[i-4]<<24|o[i-3]<<16|o[i-2]<<8|o[i-1],u=i+a+1,s=u+o[u-1],c=s+32;if(!Tt(Ot(o.subarray(0,s)),o.subarray(s,c)))throw new Error("Invalid checksum");if(!Tt(jt(c),o.subarray(c)))throw new Error("Invalid PKCS7 padding");return o.subarray(i,i+a)}function Rt(e,t,r){var n=31&e.random(1)[0],o=1+n+4,i=t.length,a=o+i+1,u=31&e.random(1)[0],s=a+u,c=s+32,f=jt(c),l=new Uint8Array(c+f.length);l.set(f,c),l[0]=n,l.set(e.random(n),1),l[o-4]=i>>24&255,l[o-3]=i>>16&255,l[o-2]=i>>8&255,l[o-1]=255&i,l.set(t,o),l[a-1]=u,l.set(e.random(u),a),l.set(Ot(l.subarray(0,s)),s);var h=e.random(16),y=new kt(r,h).encrypt(l);return{encryptionType:0,iv_hex:d.stringify(h),data_base64:p.stringify(y)}}function jt(e){for(var t=new Uint8Array(16-(15&e)),r=0;r<t.length;++r)t[r]=t.length;return t}var Mt=r(8),Nt=r.n(Mt);function Dt(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r.filter((function(e){return null!=e}));return(e=[]).concat.apply(e,lt()(o))}function Lt(){for(var e={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var o=0;o<r.length;o++){var i=r[o];if(null!=i)for(var a=0,u=Object.keys(i);a<u.length;a++){var s=u[a];null!=i[s]&&(e[s]=null!=e[s]&&"object"===Nt()(i[s])?Lt(e[s],i[s]):i[s])}}return e}function Ut(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];Object.defineProperty(e,o,{writable:!0,configurable:!0,value:t[o]})}return e}function Ht(e){var r=ve(e);return{load:function(r,n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=e,t.t1=JSON,t.next=5,r.getText(n);case 5:return t.t2=t.sent,t.t3=t.t1.parse.call(t.t1,t.t2),t.abrupt("return",(0,t.t0)(t.t3));case 10:t.prev=10,t.t4=t.catch(0);case 12:case"end":return t.stop()}}),o,null,[[0,10]])})))()},save:function(e,n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.setText(n,JSON.stringify(r(i)));case 2:case"end":return t.stop()}}),o)})))()}}}var Kt=function(e){if(null==e||"object"!==Nt()(e))throw new TypeError("Expected a JSON object");return e};function Ft(e,t,r){var n={delete:function(e){return r.delete(e)},getData:function(e){return r.getText(e).then((function(e){return ke(JSON.parse(e))})).then((function(e){return Bt(e,t)}))},getText:function(e){return r.getText(e).then((function(e){return ke(JSON.parse(e))})).then((function(e){return Pt(e,t)}))},list:function(e){return r.list(e)},setData:function(n,o){var i=o;return r.setText(n,JSON.stringify(Rt(e,Uint8Array.from(i),t)))},setText:function(e,t){return this.setData(e,st(t))}};return A(n),n}function Gt(e,t){return e.storageWallets[t].paths.disklet}function qt(e,t){return e.storageWallets[t].localDisklet}function zt(e,t,r){return Ft(r,e.storageWallets[t].paths.dataKey,e.storageWallets[t].localDisklet)}function Wt(e,t,r){var n=e.storageWallets[t].paths.dataKey;return ut(It(st(r),n))}var Vt=de({multiplier:pe,name:pe,symbol:he(pe)}),Yt=de({currencyCode:pe,denominations:ne(Vt),displayName:pe,networkLocation:he(Kt)}),Jt=de({enabled:he(oe,!0)}).withRest,Zt=de({SortIndex:he(le,0),Archived:he(oe,!1),BitcoinSeed:Se,MK:Se,SyncKey:Se}).withRest,Xt=de({id:pe,archived:he(oe),deleted:he(oe),hidden:he(oe),sortIndex:he(le)}),$t=de({userSettings:he(se(Kt),{}),swapSettings:he(se(Jt),{})}).withRest,Qt=de({customTokens:ne(de({contractAddress:pe,currencyCode:pe,currencyName:pe,denomination:pe,denominations:ne(Vt),isVisible:he(oe,!0),multiplier:pe,walletType:he(pe,"wallet:ethereum")}))}),er=de({customTokens:de(de(Yt))});function tr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var nr=Ht(Zt),or=Ht(Xt),ir=Ht($t),ar="PluginSettings.json";function ur(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];if(e[o]!==t[o])return!0}return!1}function sr(e){return cr.apply(this,arguments)}function cr(){return cr=o()(t().mark((function e(r){var n,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],i={},e.t0=Q.gQ,e.next=5,r.list("Wallets");case 5:return e.t1=e.sent,a=(0,e.t0)(e.t1),e.next=9,Promise.all(a.map(function(){var e=o()(t().mark((function e(o){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nr.load(r,o);case 2:if(null!=(a=e.sent)){e.next=5;break}return e.abrupt("return");case 5:u={bitcoinKey:p.stringify(a.BitcoinSeed),dataKey:p.stringify(a.MK),format:"bip32",syncKey:p.stringify(a.SyncKey)},s=Rr("wallet:bitcoin",u,a.MK),n.push(s),i[s.id]={sortIndex:a.SortIndex,archived:a.Archived,deleted:!1,hidden:!1};case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:return e.abrupt("return",{walletInfos:n,walletStates:i});case 10:case"end":return e.stop()}}),e)}))),cr.apply(this,arguments)}function fr(e){return lr.apply(this,arguments)}function lr(){return lr=o()(t().mark((function e(r){var n,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},e.t0=Q.gQ,e.next=4,r.list("Keys");case 4:return e.t1=e.sent,i=(0,e.t0)(e.t1),e.next=8,Promise.all(i.map(function(){var e=o()(t().mark((function e(o){var i,a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,or.load(r,o);case 2:if(null!=(i=e.sent)){e.next=5;break}return e.abrupt("return");case 5:a=i.id,u=i.archived,s=i.deleted,c=i.hidden,f=i.sortIndex,n[a]={archived:u,deleted:s,hidden:c,sortIndex:f};case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),lr.apply(this,arguments)}function dr(e,t){return hr.apply(this,arguments)}function hr(){return(hr=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.state.accounts[n],a=i.accountWalletInfo,u=i.accountWalletInfos,e.next=4,Promise.all(u.map((function(e){return sr(Gt(r.props.state,e.id))})));case 4:return s=e.sent,e.next=7,fr(Gt(r.props.state,a.id));case 7:c=e.sent,f=(o=[]).concat.apply(o,lt()(s.map((function(e){return e.walletInfos})))),l=s.map((function(e){return e.walletStates})),d=Object.assign.apply(Object,[{}].concat(lt()(l),[c])),r.props.dispatch({type:"ACCOUNT_KEYS_LOADED",payload:{accountId:n,legacyWalletInfos:f,walletStates:d}});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pr(e,t,r){return yr.apply(this,arguments)}function yr(){return yr=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=r.props.state.accounts[n],u=a.accountWalletInfo,s=a.walletStates,c=Gt(r.props.state,u.id),f={},l=0,d=Object.keys(i);l<d.length;l++)h=d[l],null==s[h]?f[h]=i[h]:ur(s[h],i[h])&&(f[h]=rr(rr({},s[h]),i[h]));if((p=Object.keys(f)).length){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,Promise.all(p.map(function(){var e=o()(t().mark((function e(n){var o,i,a,s,l,d;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=f[n],i=o.archived,a=o.deleted,s=o.hidden,l=o.sortIndex,d=Wt(r.props.state,u.id,n),e.next=4,or.save(c,"Keys/".concat(d,".json"),{archived:i,deleted:a,hidden:s,id:n,sortIndex:l});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:r.props.dispatch({type:"ACCOUNT_CHANGED_WALLET_STATES",payload:{accountId:n,walletStates:rr(rr({},s),f)}});case 10:case"end":return e.stop()}}),e)}))),yr.apply(this,arguments)}function br(e,t,r,n){return vr.apply(this,arguments)}function vr(){return(vr=o()(t().mark((function e(r,n,o,i){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n].accountWalletInfo,u=Gt(r.props.state,a.id),e.next=4,ir.load(u,ar);case 4:return s=e.sent,e.next=7,ir.save(u,ar,rr(rr({},s),{},{userSettings:rr(rr({},r.props.state.accounts[n].userSettings),{},te()({},o,i))}));case 7:r.props.dispatch({type:"ACCOUNT_PLUGIN_SETTINGS_CHANGED",payload:{accountId:n,pluginId:o,userSettings:rr({},i)}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gr(e,t,r,n){return mr.apply(this,arguments)}function mr(){return(mr=o()(t().mark((function e(r,n,o,i){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n].accountWalletInfo,u=Gt(r.props.state,a.id),e.next=4,ir.load(u,ar);case 4:return s=e.sent,e.next=7,ir.save(u,ar,rr(rr({},s),{},{swapSettings:rr(rr({},r.props.state.accounts[n].swapSettings),{},te()({},o,i))}));case 7:r.props.dispatch({type:"ACCOUNT_SWAP_SETTINGS_CHANGED",payload:{accountId:n,pluginId:o,swapSettings:i}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wr(e,t){return Er.apply(this,arguments)}function Er(){return(Er=o()(t().mark((function e(r,n){var o,i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].accountWalletInfo,i=Gt(r.props.state,o.id),e.next=4,ir.load(i,ar);case 4:a=e.sent,s=(u=null!=a?a:{userSettings:{},swapSettings:{}}).userSettings,c=u.swapSettings,r.props.dispatch({type:"ACCOUNT_PLUGIN_SETTINGS_LOADED",payload:{accountId:n,userSettings:s,swapSettings:c}});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _r(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=Object.keys(e),o=0;o<n.length;o++)for(var i=n[o],a=e[i].currencyInfo,u=0,s=a.denominations;u<s.length;u++){var c=s[u];if(c.name===r)return c.multiplier}for(var f=0;f<n.length;f++)for(var l=n[f],d=e[l].currencyInfo,h=0,p=d.metaTokens;h<p.length;h++)for(var y=p[h],b=0,v=y.denominations;b<v.length;b++){var g=v[b];if(g.name===r)return g.multiplier}for(var m=0,w=Object.keys(t);m<w.length;m++)for(var E=w[m],_=t[E],C=0,x=_.denominations;C<x.length;C++){var S=x[C];if(S.name===r)return S.multiplier}return"1"}function Cr(e,t){return e.waitFor((function(e){if(null==e.state.currency.wallets[t])throw new Error("Wallet id ".concat(t," does not exist in this account"));var r=e.state.currency.wallets[t].engineFailure;if(null!=r)throw r;if(null!=e.output.currency.wallets[t])return e.output.currency.wallets[t].walletApi}))}function xr(e,t){var r=Sr(e,t);if(null==r)throw new Error("Cannot find a currency plugin for wallet type ".concat(t));return r}function Sr(e,t){return Object.keys(e).find((function(r){return e[r].currencyInfo.walletType===t}))}function Ar(e,t){var r=e.props,n=r.dispatch,o=r.state,i=o.plugins.currencyTools[t];if(null!=i)return i;var a=o.plugins.currency[t].makeCurrencyTools();return n({type:"CURRENCY_TOOLS_LOADED",payload:{pluginId:t,tools:a}}),a}function Ir(e){return Or.apply(this,arguments)}function Or(){return Or=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.waitFor((function(e){var t=e.state.plugins,r=t.init;if(t.locked){var n=e.state.plugins,o=n.currency,i=n.rate,a=n.swap,u=[];for(var s in r)r[s]&&null==o[s]&&null==i[s]&&null==a[s]&&u.push(s);if(u.length>0)throw new Error("The following plugins are missing or failed to load: "+u.join(", "));return!0}}));case 2:case"end":return e.stop()}}),e)}))),Or.apply(this,arguments)}function Tr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tr(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pr(e,t){return e.find((function(e){return e.type===t}))}function Br(e){return""===e?"account-repo:co.airbitz.wallet":"account-repo:".concat(e)}function Rr(e,t,r){return{id:p.stringify(It(st(e),r)),type:e,keys:t}}function jr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.props.io;if(null==r.dataKey&&(r.dataKey=p.stringify(n.random(32))),null==r.syncKey&&(r.syncKey=p.stringify(n.random(20))),"string"!=typeof r.dataKey)throw new TypeError("Invalid dataKey type");return Rr(t,r,p.parse(r.dataKey))}function Mr(e,t){for(var r=e.props.io,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];for(var a=o.map((function(e){return Rt(r,st(JSON.stringify(e)),t.loginKey)})),u=[],s=0;s<o.length;s++){var c=o[s];if(null!=c.keys.syncKey){var f=p.parse(c.keys.syncKey);u.push(d.stringify(f).toLowerCase())}}return{serverPath:"/v2/login/keys",server:{keyBoxes:a,newSyncKeys:u},stash:{keyBoxes:a},login:{keyInfos:o},loginId:t.loginId}}function Nr(e){for(var t=[],r={},n=0;n<e.length;n++){var o=e[n],i=o.id,a=o.type,u=o.keys;if(null==i||32!==p.parse(i).length)throw new Error("Key integrity violation: invalid id ".concat(i));if(null!=r[i]){var s=t[r[i]];if(s.type!==a)throw new Error("Key integrity violation for ".concat(i,": type ").concat(a," does not match ").concat(s.type));for(var c=0,f=Object.keys(u);c<f.length;c++){var l=f[c];if(null!=s.keys[l]&&s.keys[l]!==u[l])throw new Error("Key integrity violation for ".concat(i,": ").concat(l," keys do not match"))}t[r[i]]={id:i,type:a,keys:kr(kr({},s.keys),u)}}else r[i]=t.length,t.push(o)}return t}function Dr(e){var t=e.id,r=e.keys,n=e.type,o={"wallet:bitcoin-bip44":{format:"bip44",coinType:0},"wallet:bitcoin-bip49":{format:"bip49",coinType:0},"wallet:bitcoincash-bip32":{format:"bip32"},"wallet:bitcoincash-bip44":{format:"bip44",coinType:145},"wallet:bitcoincash-bip44-testnet":{format:"bip44",coinType:1},"wallet:bitcoin-bip44-testnet":{format:"bip44",coinType:1},"wallet:bitcoin-bip49-testnet":{format:"bip49",coinType:1},"wallet:dash-bip44":{format:"bip44",coinType:5},"wallet:dogecoin-bip44":{format:"bip44",coinType:3},"wallet:litecoin-bip44":{format:"bip44",coinType:2},"wallet:litecoin-bip49":{format:"bip49",coinType:2},"wallet:feathercoin-bip49":{format:"bip49",coinType:8},"wallet:feathercoin-bip44":{format:"bip44",coinType:8},"wallet:qtum-bip44":{format:"bip44",coinType:2301},"wallet:ufo-bip49":{format:"bip49",coinType:202},"wallet:ufo-bip84":{format:"bip84",coinType:202},"wallet:zcoin-bip44":{format:"bip44",coinType:136},"wallet:bitcoin-testnet":{format:"bip32"},"wallet:bitcoin":{format:"bip32"},"wallet:bitcoincash-testnet":{format:"bip32"},"wallet:litecoin":{format:"bip32",coinType:2},"wallet:zcoin":{format:"bip32",coinType:136}};return null!=o[n]?{id:t,keys:kr(kr({},o[n]),r),type:n.replace(/-bip[0-9]+/,"")}:e}function Lr(e,t){if(e.length!==t.length)throw new Error("Array lengths do not match: ".concat(e.length,", ").concat(t.length));for(var r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e[n]^t[n];return r}function Ur(e,t){var r=e.id,n=e.type,o=e.keys;if(null==o.dataKey||null==o.syncKey)throw new Error("Wallet ".concat(r," is not a splittable type"));for(var i=p.parse(o.dataKey),a=p.parse(o.syncKey),u=Lr(It(st(n),i),It(st(t),i)),s=Lr(p.parse(r),u),c=Lr(a,u.subarray(0,a.length)),f=n.replace(/wallet:/,"").replace("-",""),l=t.replace(/wallet:/,"").replace("-",""),d={},h=0,y=Object.keys(o);h<y.length;h++){var b=y[h];b===f+"Key"?d[l+"Key"]=o[b]:d[b]=o[b]}return{id:p.stringify(s),keys:kr(kr({},d),{},{syncKey:p.stringify(c)}),type:t}}function Hr(e,t,r,n){return Kr.apply(this,arguments)}function Kr(){return Kr=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n],u=a.login,s=a.loginTree,c=xr(r.props.state.plugins.currency,o),e.next=4,Ar(r,c);case 4:if(f=e.sent,null==i.keys){e.next=9;break}l=i.keys,e.next=34;break;case 9:if(null==i.importText){e.next=24;break}if(null!=f.importPrivateKey){e.next=12;break}throw new Error("This wallet does not support importing keys");case 12:return e.t0=kr,e.t1=kr,e.t2={},e.next=17,f.importPrivateKey(i.importText,i.keyOptions);case 17:e.t3=e.sent,e.t4=(0,e.t1)(e.t2,e.t3),e.t5={},e.t6={imported:!0},l=(0,e.t0)(e.t4,e.t5,e.t6),e.next=34;break;case 24:return e.t7=kr,e.t8=kr,e.t9={},e.next=29,f.createPrivateKey(o,i.keyOptions);case 29:e.t10=e.sent,e.t11=(0,e.t8)(e.t9,e.t10),e.t12={},e.t13={imported:!1},l=(0,e.t7)(e.t11,e.t12,e.t13);case 34:return d=jr(r,o,l),h=Mr(r,u,Dr(d)),e.next=38,Kn(r,s,h);case 38:return e.next=40,Cr(r,d.id);case 40:if(p=e.sent,null==i.name){e.next=44;break}return e.next=44,p.renameWallet(i.name);case 44:if(null==i.fiatCurrencyCode){e.next=47;break}return e.next=47,p.setFiatCurrencyCode(i.fiatCurrencyCode);case 47:return e.abrupt("return",p);case 48:case"end":return e.stop()}}),e)}))),Kr.apply(this,arguments)}function Fr(e){return Gr.apply(this,arguments)}function Gr(){return(Gr=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={currencyCode:"BCH",spendTargets:[{nativeAmount:"1000",otherParams:{script:{type:"replayProtection"}},publicAddress:""}],metadata:{},networkFeeOption:"high"},e.next=3,r.makeSpend(n);case 3:return o=e.sent,e.next=6,r.signTx(o);case 6:return i=e.sent,e.next=9,r.broadcastTx(i);case 9:return a=e.sent,e.next=12,r.saveTx(a);case 12:return e.next=14,r.getReceiveAddress();case 14:return u=e.sent,s=u.publicAddress,c={currencyCode:"BCH",spendTargets:[{publicAddress:s,nativeAmount:"0"}],metadata:{},networkFeeOption:"high"},e.next=19,r.getMaxSpendable(c);case 19:return f=e.sent,c.spendTargets[0].nativeAmount=f,e.next=23,r.makeSpend(c);case 23:return l=e.sent,e.next=26,r.signTx(l);case 26:return d=e.sent,e.next=29,r.broadcastTx(d);case 29:return h=e.sent,e.next=32,r.saveTx(h);case 32:return p={name:"Replay Protection Tx",notes:"This transaction is to protect your BCH wallet from unintentionally spending BSV funds. Please wait for the transaction to confirm before making additional transactions using this BCH wallet."},e.next=35,r.saveTxMetadata(h.txid,"BCH",p);case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qr(e,t,r,n){return zr.apply(this,arguments)}function zr(){return zr=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p,y,b,v,g;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.props.state.accounts[n],u=a.allWalletInfosFull,s=a.login,c=a.loginTree,null!=(f=u.find((function(e){return e.id===o})))){e.next=5;break}throw new Error("Invalid wallet id ".concat(o));case 5:if("wallet:bitcoincash"!==i||"wallet:bitcoin"!==f.type||"bip49"!==f.keys.format){e.next=7;break}throw new Error("Cannot split segwit-format Bitcoin wallets to Bitcoin Cash");case 7:if(!(l="wallet:bitcoinsv"===i&&"wallet:bitcoincash"===f.type)){e.next=14;break}if(null!=(d=r.props.output.currency.wallets[o].walletApi)){e.next=12;break}throw new Error("Missing Wallet");case 12:return e.next=14,Fr(d);case 14:if(h=Ur(f,i),p=u.find((function(e){return e.id===h.id})),null==p){e.next=26;break}if(!p.archived&&!p.deleted){e.next=23;break}return(y={})[h.id]={archived:!1,deleted:!1},e.next=22,pr(r,n,y);case 22:return e.abrupt("return",f.id);case 23:if(!l){e.next=25;break}return e.abrupt("return",h.id);case 25:throw new Error("This wallet has already been split");case 26:return b=Mr(r,s,h),e.next=29,Kn(r,c,b);case 29:return e.prev=29,e.next=32,Cr(r,h.id);case 32:if(v=e.sent,null==(g=r.props.output.currency.wallets[o].walletApi)){e.next=41;break}if(null==g.name){e.next=38;break}return e.next=38,v.renameWallet(g.name);case 38:if(null==g.fiatCurrencyCode){e.next=41;break}return e.next=41,v.setFiatCurrencyCode(g.fiatCurrencyCode);case 41:e.next=46;break;case 43:e.prev=43,e.t0=e.catch(29),r.props.onError(e.t0);case 46:return e.abrupt("return",h.id);case 47:case"end":return e.stop()}}),e,null,[[29,43]])}))),zr.apply(this,arguments)}function Wr(e,t,r){return Vr.apply(this,arguments)}function Vr(){return(Vr=o()(t().mark((function e(r,n,o){var i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.props.state.accounts[n].allWalletInfosFull,null!=(a=i.find((function(e){return e.id===o})))){e.next=4;break}throw new Error("Invalid wallet id ".concat(o));case 4:if(null!=(u=Sr(r.props.state.plugins.currency,a.type))){e.next=7;break}return e.abrupt("return",[]);case 7:return e.next=9,Ar(r,u);case 9:if(null!=(s=e.sent).getSplittableTypes){e.next=12;break}return e.abrupt("return",[]);case 12:return e.next=14,s.getSplittableTypes(a);case 14:return c=e.sent,e.abrupt("return",c.filter((function(e){var t=Ur(a,e),r=i.find((function(e){return e.id===t.id}));return null==r||r.archived||r.deleted})));case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yr(e,t){return new Promise((function(r,n){var o=!1,i=[],a=[],u=setTimeout((function(){u=void 0,i.length>0&&(o=!0,r(i))}),t);function s(){var t=i.length+a.length===e.length;t&&null!=u&&clearTimeout(u),(t||null==u)&&(o=!0,i.length>0?r(i):n(a))}s();for(var c=0;c<e.length;c++){e[c].then((function(e){o||(i.push(e),s())}),(function(e){o||(a.push(e),s())}))}}))}var Jr=ve(Me);function Zr(e){var t=Ne(e);switch(t.status_code){case 0:return t.results;case 2:throw new bt("Account already exists on server");case 3:throw new bt("Account does not exist on server");case 4:case 5:throw new yt(t.results);case 6:throw new Error("Invalid API key");case 8:throw new pt(t.results);case 1e3:throw new ht;default:throw new Error("Server error: ".concat(t.message))}}function Xr(e,t,r,n){var o=e.props,i=o.state,a=o.io,u=o.log,s=i.login,c=s.apiKey,f=s.serverUri,l={method:t,headers:{"content-type":"application/json",accept:"application/json",authorization:"Token ".concat(""===c?"4248c1bf41e53b840a5fdb2c872dd3ade525e66d":c)}};"GET"!==t&&null!=n&&(l.body=JSON.stringify(Jr(n)));var d=Date.now(),h="".concat(f).concat(r);return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Error("Timeout of ".concat(t,"ms exceeded"));return new Promise((function(n,o){var i=setTimeout((function(){return o(r)}),t);e.then((function(e){n(e),clearTimeout(i)}),(function(e){o(e),clearTimeout(i)}))}))}(a.fetch(h,l),3e4).then((function(e){var r=Date.now()-d;return u("".concat(t," ").concat(h," returned ").concat(e.status," in ").concat(r,"ms")),e.json().then(Zr,(function(){throw new Error("Invalid reply JSON, HTTP status ".concat(e.status))}))}),(function(e){var n=Date.now()-d;throw u.error("".concat(t," ").concat(h," failed in ").concat(n,"ms, ").concat(String(e))),new dt("Could not reach the auth server: ".concat(r))}))}function $r(e,t,r){return"string"==typeof t&&(t=st(t)),e.props.output.scrypt.timeScrypt(t,r).then((function(e){return e.hash}))}var Qr={salt_hex:Uint8Array.from([181,134,95,251,159,167,179,191,228,178,56,77,71,206,131,30,226,42,74,157,92,52,199,239,125,33,70,124,199,88,248,27]),n:16384,r:1,p:1};function en(e,t){var r=xe(t),n=e.props.state.login.stashes;return null!=n[r]?n[r]:{username:r,appId:"",loginId:new Uint8Array(0),pendingVouchers:[]}}function tn(e,t){for(var r=e.props.state.login.stashes,n=0,o=Object.keys(r);n<o.length;n++){var i=r[o[n]],a=Bn(i,(function(e){return Tt(e.loginId,t)}));if(null!=a)return{stashTree:i,stash:a}}throw new Error("Cannot find stash ".concat(p.stringify(t)))}var rn={};function nn(e,t){var r=xe(t);return null==rn[r]&&(rn[r]=$r(e,r,Qr)),rn[r]}function on(e,t){return an.apply(this,arguments)}function an(){return(an=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=[],e.next=3,r.list("logins").then(Q.gQ);case 3:i=e.sent,a=0;case 5:if(!(a<i.length)){e.next=25;break}return u=i[a],e.prev=7,e.t0=o,e.t1=ln,e.t2=JSON,e.next=13,r.getText(u);case 13:e.t3=e.sent,e.t4=e.t2.parse.call(e.t2,e.t3),e.t5=(0,e.t1)(e.t4),e.t0.push.call(e.t0,e.t5),e.next=22;break;case 19:e.prev=19,e.t6=e.catch(7),n.error("Could not load ".concat(u,": ").concat(String(e.t6)));case 22:a++,e.next=5;break;case 25:return e.abrupt("return",o);case 26:case"end":return e.stop()}}),e,null,[[7,19]])})))).apply(this,arguments)}function un(e,t){return sn.apply(this,arguments)}function sn(){return(sn=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.io,u=xe(n),e.next=4,a.disklet.list("logins").then(Q.gQ);case 4:s=e.sent,c=0;case 6:if(!(c<s.length)){e.next=26;break}return f=s[c],e.prev=8,e.t0=ln,e.t1=JSON,e.next=13,a.disklet.getText(f);case 13:if(e.t2=e.sent,e.t3=e.t1.parse.call(e.t1,e.t2),(0,e.t0)(e.t3).username!==u){e.next=19;break}return e.next=19,a.disklet.delete(f);case 19:e.next=23;break;case 21:e.prev=21,e.t4=e.catch(8);case 23:c++,e.next=6;break;case 26:i({type:"LOGIN_STASH_DELETED",payload:xe(n)});case 27:case"end":return e.stop()}}),e,null,[[8,21]])})))).apply(this,arguments)}function cn(e,t){return fn.apply(this,arguments)}function fn(){return(fn=o()(t().mark((function e(r,n){var o,i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.props,i=o.dispatch,a=o.io,u=n.appId,s=n.loginId,c=n.username,""===u){e.next=4;break}throw new Error("Cannot save a login without an appId.");case 4:if(null!=c){e.next=6;break}throw new Error("Cannot save a login without a username.");case 6:if(null!=s&&32===s.length){e.next=8;break}throw new Error("Invalid loginId");case 8:return e.next=10,a.disklet.setText("logins/".concat(ut(s),".json"),JSON.stringify(dn(n)));case 10:i({type:"LOGIN_STASH_SAVED",payload:n});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ln=de({appId:pe,created:he(ae),lastLogin:he(ae),loginId:Ie,userId:he(Ie),username:he(pe),otpKey:he(Ae),otpResetDate:he(ae),otpTimeout:he(le),pendingVouchers:he(ne(Oe),[]),voucherId:he(pe),voucherAuth:he(Ie),loginAuthBox:he(ke),parentBox:he(ke),passwordAuthBox:he(ke),passwordAuthSnrp:he(Pe),passwordBox:he(ke),passwordKeySnrp:he(Pe),pin2Key:he(ie((function(e){var t=pe(e);return"="!==e.slice(-1)?at(t):p.parse(t)}),(function(e){return p.stringify(e)}))),pin2TextBox:he(ke),recovery2Key:he(Ie),children:he(ne((function(e){return ln(e)}))),keyBoxes:he(ne(ke)),mnemonicBox:he(ke),rootKeyBox:he(ke),syncKeyBox:he(ke)}),dn=ve(ln);function hn(e,t,r){var n,o,i=function(e,t){var r=s().hmac(s().sha1,t);return Uint8Array.from(r.update(e).digest())}((n=t,o=Math.floor(n/4294967296),new Uint8Array([o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n])),e),a=15&i[19],u=((127&i[a])<<24|i[a+1]<<16|i[a+2]<<8|i[a+3]).toString();return(Array(r).join("0")+u).slice(-r)}function pn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now()/1e3;return hn(e,t/30,6)}function yn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.now,o=void 0===n?Date.now()/1e3:n,i=r.spread,a=void 0===i?1:i,u=o/30;if(t===hn(e,u,6))return!0;for(var s=1;s<=a;++s){if(t===hn(e,u-s,6))return!0;if(t===hn(e,u+s,6))return!0}return!1}var bn=ve(De);function vn(e){if(null!=e.otpKey)return pn(e.otpKey)}function gn(e,t){var r=t.otp,n=t.otpKey;return null!=r?/[0-9]+/.test(r)&&r.length<16?r:pn(h.parse(r,{loose:!0})):null!=n?pn(h.parse(n,{loose:!0})):null!=e.otpKey?pn(e.otpKey):void 0}function mn(e,t,r){return wn.apply(this,arguments)}function wn(){return(wn=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.state.accounts[n].loginTree,a=i.otpKey,u=void 0===a?r.props.io.random(10):a,s={serverPath:"/v2/login/otp",server:bn({otpKey:u,otpTimeout:o}),stash:{otpKey:u,otpResetDate:void 0,otpTimeout:o},login:{otpKey:u,otpResetDate:void 0,otpTimeout:o},loginId:i.loginId},e.next=5,Kn(r,i,s);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function En(e,t){return _n.apply(this,arguments)}function _n(){return(_n=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i={serverMethod:"DELETE",serverPath:"/v2/login/otp",stash:{otpKey:void 0,otpResetDate:void 0,otpTimeout:void 0},login:{otpKey:void 0,otpResetDate:void 0,otpTimeout:void 0},loginId:o.loginId},e.next=4,Kn(r,o,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cn(e,t){return xn.apply(this,arguments)}function xn(){return(xn=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.props.state.accounts[n].loginTree,i=o.otpTimeout,a=o.otpKey,null!=i&&null!=a){e.next=4;break}throw new Error("Cannot cancel 2FA reset: 2FA is not enabled.");case 4:return u={serverPath:"/v2/login/otp",server:bn({otpTimeout:i,otpKey:a}),stash:{otpResetDate:void 0},login:{otpResetDate:void 0},loginId:o.loginId},e.next=7,Kn(r,o,u);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sn(e,t,r){return An.apply(this,arguments)}function An(){return(An=o()(t().mark((function e(r,n,o){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nn(r,n);case 2:return e.t0=e.sent,e.t1=o,i={userId:e.t0,otpResetAuth:e.t1},e.abrupt("return",Xr(r,"DELETE","/v2/login/otp",i).then((function(e){return Je(e).otpResetDate})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function In(e,t,r){return On.apply(this,arguments)}function On(){return On=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.props.state.accounts[n]){e.next=2;break}return e.abrupt("return");case 2:if(a=r.props.state.accounts[n].login,u=a.userId,s=a.passwordAuth,c=tn(r,a.loginId),f=c.stashTree,l=c.stash,null!=s&&null!=u){e.next=7;break}throw new Error("Cannot repair OTP: There is no password on this account");case 7:return d={userId:u,passwordAuth:s,otp:pn(i)},h={now:f.lastLogin},e.next=11,Un(r,f,l,h,d,o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.loginKey);case 1:case"end":return e.stop()}}),e)}))));case 11:case"end":return e.stop()}}),e)}))),On.apply(this,arguments)}function Tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tn(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pn=ve(Ke);function Bn(e,t){if(t(e))return e;var r=e;if(null!=r.children)for(var n=0,o=r.children;n<o.length;n++){var i=Bn(o[n],t);if(null!=i)return i}}function Rn(e,t,r,n){if(t(e))return r(e);var o=null!=e.children?e.children.map((function(e){return Rn(e,t,r,n)})):[];return n(e,o)}function jn(e,t,r){var n=e.children,o=void 0===n?[]:n,i=r.appId,a=r.created,u=r.loginId,s=r.loginAuthBox,c=r.userId,f=r.otpKey,l=r.otpResetDate,d=r.otpTimeout,h=r.pendingVouchers,p=r.parentBox,y=r.passwordAuthBox,b=r.passwordAuthSnrp,v=r.passwordBox,g=r.passwordKeySnrp,m=r.pin2TextBox,w=r.children,E=void 0===w?[]:w,_=r.keyBoxes,C={appId:i,created:a,loginId:u,loginAuthBox:s,userId:c,otpKey:f,otpResetDate:l,otpTimeout:d,pendingVouchers:h,parentBox:p,passwordAuthBox:y,passwordAuthSnrp:b,passwordBox:v,passwordKeySnrp:g,pin2TextBox:m,keyBoxes:void 0===_?[]:_,mnemonicBox:r.mnemonicBox,rootKeyBox:r.rootKeyBox,syncKeyBox:r.syncKeyBox};null!=e.lastLogin&&(C.lastLogin=e.lastLogin),null!=e.username&&(C.username=e.username),null!=e.userId&&(C.userId=e.userId),null!=r.pin2KeyBox&&(C.pin2Key=Bt(r.pin2KeyBox,t)),null!=r.recovery2KeyBox&&(C.recovery2Key=Bt(r.recovery2KeyBox,t)),E.sort((function(e,t){return e.created.valueOf()-t.created.valueOf()})),C.children=E.map((function(e){var r=e.appId,n=e.loginId,i=e.parentBox;if(null==i)throw new Error("Key integrity violation: No parentBox on child login.");var a=Bt(i,t),u=o.find((function(e){return Tt(e.loginId,n)}));return jn(null!=u?u:{appId:r,loginId:n,pendingVouchers:[]},a,e)}));for(var x=function(e){var t=o[e].loginId;if(null==E.find((function(e){return Tt(e.loginId,t)})))throw new Error("The server has lost children!")},S=0;S<o.length;S++)x(S);return C}function Mn(e,t,r){return Rn(e,(function(e){return e.appId===r.appId}),(function(e){return jn(e,t,r)}),(function(e,t){return kn(kn({},e),{},{children:t})}))}function Nn(e,t){var r=e.appId,n=e.created,o=e.lastLogin,i=void 0===o?new Date:o,a=e.loginId,u=e.otpKey,s=e.otpResetDate,c=e.otpTimeout,f=e.pendingVouchers,l=e.userId,d=e.username,h=e.children,y=void 0===h?[]:h,b=e.keyBoxes,v=void 0===b?[]:b,g={appId:r,created:n,lastLogin:i,loginId:a,otpKey:u,otpResetDate:s,otpTimeout:c,pendingVouchers:f,userId:l,username:d,loginKey:t,children:[],keyInfos:[]};if(null!=e.loginAuthBox&&(g.loginAuth=Bt(e.loginAuthBox,t)),null!=e.passwordAuthBox&&(null==g.userId&&(g.userId=a),g.passwordAuth=Bt(e.passwordAuthBox,t)),null==g.loginAuth&&null==g.passwordAuth)throw new Error("No server authentication methods on login");g.pin2Key=e.pin2Key,null!=e.pin2TextBox&&(g.pin=Pt(e.pin2TextBox,t)),g.recovery2Key=e.recovery2Key;var m=[],w=e.mnemonicBox,E=e.rootKeyBox;if(null!=w&&null!=E){var _=Bt(E,t),C={mnemonic:Pt(w,It(_,st("infoKey"))),rootKey:p.stringify(_)};m.push(Rr("wallet:bitid",C,_))}if(null!=e.syncKeyBox){var x=Bt(e.syncKeyBox,t),S=Br(g.appId),A={syncKey:p.stringify(x),dataKey:p.stringify(t)};m.push(Rr(S,A,t))}var I=v.map((function(e){return JSON.parse(Pt(e,t))}));return g.keyInfos=Nr([].concat(m,lt()(I))).map((function(e){return Dr(e)})),g.children=y.map((function(e){if(null==e.parentBox)throw new Error("Key integrity violation: No parentBox on child login.");return Nn(e,Bt(e.parentBox,t))})),g}function Dn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Rn(e,(function(e){return e.appId===r}),(function(e){return Nn(e,t)}),(function(e,t){var r=e.appId,n=e.lastLogin;return{appId:r,children:t,keyInfos:[],lastLogin:void 0===n?new Date:n,loginId:e.loginId,loginKey:undefined,pendingVouchers:e.pendingVouchers,username:e.username}}))}function Ln(e,t){return Rn(e,(function(e){return e.appId===t}),(function(e){return e}),(function(e,t){return{appId:e.appId,children:t,loginId:e.loginId,pendingVouchers:[],username:e.username}}))}function Un(e,t,r,n,o,i){return Hn.apply(this,arguments)}function Hn(){return Hn=o()(t().mark((function e(r,n,o,i,a,u){var s,c,f,l,d,h,y,b,v,g,m,w,E;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=i.now,c=void 0===s?new Date:s,f=r.props.state.login.deviceDescription,l=kn({otp:gn(o,i),voucherId:o.voucherId,voucherAuth:o.voucherAuth},a),null!=f&&(l.deviceDescription=f),e.t0=We,e.next=7,Xr(r,"POST","/v2/login",l).catch((function(e){var t=mt(e);throw null!=t&&(0===o.loginId.length&&null!=t.loginId||null!=t.voucherId&&null!=t.voucherAuth)&&(null!=t.loginId&&(o.loginId=p.parse(t.loginId)),null!=t.voucherAuth&&(o.voucherId=t.voucherId,o.voucherAuth=p.parse(t.voucherAuth)),n.lastLogin=c,cn(r,n).catch((function(){}))),e}));case 7:return e.t1=e.sent,d=(0,e.t0)(e.t1),e.next=11,u(d);case 11:return h=e.sent,(n=Mn(n,h,d)).lastLogin=c,e.next=16,cn(r,n);case 16:if(null!=d.loginAuthBox){e.next=29;break}return y=tn(r,d.loginId),b=y.stash,v=y.stashTree,g=r.props.io,m=g.random(32),w=Rt(g,m,h),E=kn(kn({},a),{},{otp:gn(b,i),data:Pn({loginAuth:m,loginAuthBox:w})}),e.t2=We,e.next=25,Xr(r,"POST","/v2/login/secret",E);case 25:return e.t3=e.sent,d=(0,e.t2)(e.t3),e.next=29,cn(r,Mn(v,h,d));case 29:return e.abrupt("return",Dn(n,h,o.appId));case 30:case"end":return e.stop()}}),e)}))),Hn.apply(this,arguments)}function Kn(e,t,r){return Fn.apply(this,arguments)}function Fn(){return Fn=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.loginId,a=o.serverMethod,u=void 0===a?"POST":a,s=o.serverPath,null!=(c=Bn(n,(function(e){return Tt(e.loginId,i)})))){e.next=4;break}throw new Error("Cannot apply kit: missing login");case 4:return f=tn(r,i),l=f.stashTree,(d=Jn(l,c)).data=o.server,e.next=9,Xr(r,u,s,d);case 9:return h=Rn(n,(function(e){return Tt(e.loginId,i)}),(function(e){return kn(kn(kn({},e),o.login),{},{children:Dt(e.children,o.login.children),keyInfos:Nr(Dt(e.keyInfos,o.login.keyInfos))})}),(function(e,t){return kn(kn({},e),{},{children:t})})),p=Rn(l,(function(e){return Tt(e.loginId,i)}),(function(e){return kn(kn(kn({},e),o.stash),{},{children:Dt(e.children,o.stash.children),keyBoxes:Dt(e.keyBoxes,o.stash.keyBoxes)})}),(function(e,t){return kn(kn({},e),{},{children:t})})),e.next=13,cn(r,p);case 13:return e.abrupt("return",h);case 14:case"end":return e.stop()}}),e)}))),Fn.apply(this,arguments)}function Gn(e,t,r){return qn.apply(this,arguments)}function qn(){return(qn=o()(t().mark((function e(r,n,o){var i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i<o.length)){e.next=8;break}return a=o[i],e.next=5,Kn(r,n,a);case 5:i++,e.next=1;break;case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zn(e,t){return Wn.apply(this,arguments)}function Wn(){return Wn=o()(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.props.state.accounts[n]){e.next=2;break}return e.abrupt("return");case 2:return o=r.props.state.accounts[n],i=o.login,a=o.loginTree,e.next=5,Vn(r,a,i);case 5:case"end":return e.stop()}}),e)}))),Wn.apply(this,arguments)}function Vn(e,t,r){return Yn.apply(this,arguments)}function Yn(){return Yn=o()(t().mark((function e(r,n,i){var a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=tn(r,i.loginId),u=a.stashTree,s=a.stash,c=Jn(u,i),f={now:u.lastLogin},e.next=5,Un(r,u,s,f,c,o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i.loginKey);case 1:case"end":return e.stop()}}),e)}))));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),Yn.apply(this,arguments)}function Jn(e,t){var r=Bn(e,(function(e){return e.appId===t.appId})),n=null!=r?r:{voucherAuth:void 0,voucherId:void 0},o=n.voucherAuth,i=n.voucherId,a=t.loginId,u=t.userId,s=t.loginAuth,c=t.passwordAuth;if(null!=s)return{loginId:a,loginAuth:s,otp:vn(t),voucherAuth:o,voucherId:i};if(null!=c&&null!=u)return{userId:u,passwordAuth:c,otp:vn(t),voucherAuth:o,voucherId:i};throw new Error("No server authentication methods available")}var Zn=r(1649);Zn.bS,Zn.Ei,Zn.wJ,Zn.PG,Zn.SR,Zn.Th,Zn.Qw,Zn.YK,Zn.KI,Zn.Wn,Zn.tp,Zn.RQ,Zn.tE,Zn.Jj;const Xn=Zn.LZ;Zn.m8;var $n="object"==typeof global&&global&&global.Object===Object&&global,Qn="object"==typeof self&&self&&self.Object===Object&&self,eo=($n||Qn||Function("return this")()).Symbol,to=Object.prototype,ro=to.hasOwnProperty,no=to.toString,oo=eo?eo.toStringTag:void 0;var io=function(e){var t=ro.call(e,oo),r=e[oo];try{e[oo]=void 0;var n=!0}catch(i){}var o=no.call(e);return n&&(t?e[oo]=r:delete e[oo]),o},ao=Object.prototype.toString;var uo=function(e){return ao.call(e)},so=eo?eo.toStringTag:void 0;var co=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":so&&so in Object(e)?io(e):uo(e)};var fo=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);var lo=function(e){return null!=e&&"object"==typeof e},ho=Function.prototype,po=Object.prototype,yo=ho.toString,bo=po.hasOwnProperty,vo=yo.call(Object);var go=function(e){if(!lo(e)||"[object Object]"!=co(e))return!1;var t=fo(e);if(null===t)return!0;var r=bo.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&yo.call(r)==vo},mo=r(7121),wo="@@redux/INIT";function Eo(e,t,r){var n;if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(Eo)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,i=t,a=[],u=a,s=!1;function c(){u===a&&(u=a.slice())}function f(){return i}function l(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),u.push(e),function(){if(t){t=!1,c();var r=u.indexOf(e);u.splice(r,1)}}}function d(e){if(!go(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,i=o(i,e)}finally{s=!1}for(var t=a=u,r=0;r<t.length;r++){(0,t[r])()}return e}return d({type:wo}),(n={dispatch:d,subscribe:l,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,d({type:wo})}})[mo.Z]=function(){var e,t=l;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function r(){e.next&&e.next(f())}return r(),{unsubscribe:t(r)}}})[mo.Z]=function(){return this},e},n}function _o(e,t){var r=t&&t.type;return"Given action "+(r&&'"'+r.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function Co(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];0,"function"==typeof e[o]&&(r[o]=e[o])}var i=Object.keys(r);var a=void 0;try{!function(e){Object.keys(e).forEach((function(t){var r=e[t];if(void 0===r(void 0,{type:wo}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+wo+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(r)}catch(u){a=u}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var n=!1,o={},u=0;u<i.length;u++){var s=i[u],c=r[s],f=e[s],l=c(f,t);if(void 0===l){var d=_o(s,t);throw new Error(d)}o[s]=l,n=n||l!==f}return n?o:e}}Object.assign;function xo(e){function t(t){var r=void 0,n=void 0,o=!0,i=!1,a=!1,u=void 0,s=void 0,c=void 0;function f(){if(r){try{if(s){var e=s;u=void 0,s=void 0,c=void 0,e(((n=new Error("Pixie has been destroyed")).name="PixieShutdownError",n))}var t=r;r=void 0,t.destroy()}catch(n){l(n)}a=!0}var n}function l(e){a||t.onError(e),f()}function d(){i=!1,h()}function h(){for(;r&&o&&!i;){o=!1,i=!0;try{var e=r.update(n);e&&"function"==typeof e.then?e.then(d,l):i=!1}catch(t){l(t)}}}function p(){return u||(u=new Promise((function(e,t){c=e,s=t}))),u}var y={onError:l,onOutput:function(e){a||t.onOutput(e)},get props(){return n},nextProps:p,waitFor:function(e){return new Promise((function(t,r){return function o(){try{var i=e(n);null!=i?t(i):p().then(o,r)}catch(a){r(a)}}()}))}};try{r=function(e){return"function"==typeof e?{update:e,destroy:function(){}}:e}(e(y))}catch(b){l(b)}return{update:function(e){if(n=e,o=!0,c){var t=c;u=void 0,s=void 0,c=void 0,t(e)}h()},destroy:f}}return t.tame=!0,t.defaultOutput=e.defaultOutput,t}function So(e){return e.tame?e:xo(e)}function Ao(e,t,r){r(e)}function Io(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ao,r=So(e);function n(e){var n=e.onOutput,o=void 0,i=void 0,a=function(){var e=o;o=void 0,e&&e.destroy()};var u={onError:function(r){a();try{t(r,i,e.onError)}catch(r){e.onError(r)}},onOutput:n};return{update:function(e){i=e,o||(o=r(u)),o.update(e)},destroy:a}}return n.tame=!0,n.defaultOutput=e.defaultOutput,n}var Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},To=(function(){function e(e){this.value=e}function t(t){var r,n;function o(r,n){try{var a=t[r](n),u=a.value;u instanceof e?Promise.resolve(u.value).then((function(e){o("next",e)}),(function(e){o("throw",e)})):i(a.done?"return":"normal",a.value)}catch(s){i("throw",s)}}function i(e,t){switch(e){case"return":r.resolve({value:t,done:!0});break;case"throw":r.reject(t);break;default:r.resolve({value:t,done:!1})}(r=r.next)?o(r.key,r.arg):n=null}this._invoke=function(e,t){return new Promise((function(i,a){var u={key:e,arg:t,resolve:i,reject:a,next:null};n?n=n.next=u:(r=n=u,o(e,t))}))},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()),ko=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function Po(e){var t=So(e);function r(r){var n=r.onError,o=void 0,i=e.defaultOutput,a=void 0,u=!0,s=!1,c=function(){for(;o&&u&&!s;)u=!1,s=!0,o.update(ko({},a,{output:i})),s=!1},f={onError:n,onOutput:function(e){e!==i&&(i=e,u=!0,r.onOutput(e),c())}};return{update:function(e){a=e,u=!0,o||(o=t(f)),c()},destroy:function(){var e=o;o=void 0,e&&e.destroy()}}}return r.tame=!0,r.defaultOutput=e.defaultOutput,r}function Bo(e){}function Ro(e){}function jo(e,t,r,n){var o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bo,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ro;return Io(Po(e))({onError:t,onOutput:r})}(t,r,n);o.update({dispatch:e.dispatch,output:void 0,state:e.getState()});var i=e.subscribe((function(){o.update({dispatch:e.dispatch,output:void 0,state:e.getState()})}));return function(){i(),o.destroy()}}function Mo(e){var t={},r=Object.keys(e),n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(o>=r.length)break;i=r[o++]}else{if((o=r.next()).done)break;i=o.value}var a=i;t[a]=e[a].defaultOutput}function u(r){var n=r.onError,o={},i={},a=ko({},t),u=!1,s=function(){if(f){if(l>=c.length)return"break";d=c[l++]}else{if((l=c.next()).done)return"break";d=l.value}var t=d;if(o[t]={onError:n,onOutput:function(e){e!==a[t]&&((a=ko({},a))[t]=e,r.onOutput(a))}},i[t]=So(e[t])(o[t]),u)return"break"},c=Object.keys(e),f=Array.isArray(c),l=0;for(c=f?c:c[Symbol.iterator]();;){var d;if("break"===s())break}return{update:function(e){var t=Object.keys(i),r=Array.isArray(t),n=0;for(t=r?t:t[Symbol.iterator]();;){var o;if(r){if(n>=t.length)break;o=t[n++]}else{if((n=t.next()).done)break;o=n.value}if(i[o].update(e),u)return}},destroy:function(){u=!0;var e=Object.keys(i),t=Array.isArray(e),r=0;for(e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if((r=e.next()).done)break;n=r.value}i[n].destroy()}}}}return u.tame=!0,u.defaultOutput=t,u}function No(e,t){return function(){try{return e.apply(void 0,arguments)}catch(r){t(r)}}}function Do(e,t){if(e===t)return!0;if("object"!==(void 0===e?"undefined":Oo(e)))return!1;if("object"!==(void 0===t?"undefined":Oo(t)))return!1;if(!e||!t)return!1;var r=Object.getOwnPropertyNames(e);if(r.length!==Object.getOwnPropertyNames(t).length)return!1;var n=r,o=Array.isArray(n),i=0;for(n=o?n:n[Symbol.iterator]();;){var a;if(o){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var u=a;if(!t.hasOwnProperty(u)||e[u]!==t[u])return!1}return!0}function Lo(e,t){var r=So(e);function n(e){var n=e.onError,o=e.onOutput,i=void 0,a=void 0,u=!1,s=No(t,n),c={onError:n,onOutput:o};return{update:function(e){var t=s(e);if(!u){var n=!Do(t,a);if(a=t,t){if(i||(i=r(c)),u)return;n&&i.update(t)}else i&&i.destroy(),i=void 0}},destroy:function(){u=!0,i&&i.destroy(),i=void 0}}}return n.tame=!0,n.defaultOutput=e.defaultOutput,n}function Uo(e,t,r){var n=So(e);function o(e){var o=e.onError,i={},a={},u=!1,s={},c=!1,f=!1,l=No(t,o),d=No(r,o),h=function(){if(u&&!c){u=!1;var t={},r=Object.keys(i),n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var s;if(n){if(o>=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}var f=s;t[f]=a[f]}a=t,e.onOutput(a)}};return{update:function(e){var t=l(e);if(!f&&t){c=!0;var r={},p=function(){if(b){if(v>=y.length)return"break";g=y[v++]}else{if((v=y.next()).done)return"break";g=v.value}var t=g,c=d(e,t);if(f)return{v:void 0};var l=!Do(c,s[t]);if(s[t]=c,c){if(!i[t]){if(i[t]=n({onError:o,onOutput:function(e){e!==a[t]&&(a[t]=e,u=!0,h())}}),f)return{v:void 0}}if(l&&i[t].update(c),f)return{v:void 0};r[t]=i[t]}};var y=t,b=Array.isArray(y),v=0;e:for(y=b?y:y[Symbol.iterator]();;){var g,m=p();if("break"===m)break e;if("object"===(void 0===m?"undefined":Oo(m)))return m.v}var w=i;i=r;var E=Object.keys(w),_=Array.isArray(E),C=0;for(E=_?E:E[Symbol.iterator]();;){var x;if(_){if(C>=E.length)break;x=E[C++]}else{if((C=E.next()).done)break;x=C.value}var S=x;r[S]||(u=!0,w[S].destroy())}f||(c=!1,h())}},destroy:function(){f=!0;var e=Object.keys(i),t=Array.isArray(e),r=0;for(e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if((r=e.next()).done)break;n=r.value}var o=n;i[o]&&i[o].destroy()}}}}return o.tame=!0,o.defaultOutput={},o}!function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props=t}To(e,[{key:"update",value:function(e,t){}},{key:"destroy",value:function(e,t){}}])}();var Ho={then:function(){}};function Ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ko(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Go(e,t,r){return function(){for(var n="",o=0;o<arguments.length;++o){var i=arguments[o];o>0&&(n+=" "),n+="string"==typeof i?i:JSON.stringify(i,null,2)}e({message:n,source:r,time:new Date,type:t})}}function qo(e,t){return Fo(Fo({},e),{},{onLog:function(r){var n=t(),o=n.sources,i=n.defaultLogLevel,a=null!=o[r.source]?o[r.source]:i;switch(r.type){case"info":"info"===a&&e.onLog(r);break;case"warn":"info"!==a&&"warn"!==a||e.onLog(r);break;case"error":"silent"!==a&&e.onLog(r)}}})}function zo(e,t){var r=e.onLog,n=e.crashReporter;return Ut(Go(r,"info",t),{breadcrumb:function(e,o){var i=new Date;null!=n?n.logBreadcrumb({message:e,metadata:o,source:t,time:i}):(e="".concat(e," ").concat(JSON.stringify(o,null,2)),r({message:e,source:t,time:i,type:"warn"}))},crash:function(e,o){var i=new Date;if(null!=n)n.logCrash({error:e,metadata:o,source:t,time:i});else{var a="".concat(String(e)," ").concat(JSON.stringify(o,null,2));r({message:a,source:t,time:i,type:"error"})}},warn:Go(r,"warn",t),error:Go(r,"error",t)})}var Wo={},Vo=!1,Yo=[],Jo=[];function Zo(){Vo=!0;for(var e=0;e<Jo.length;e++){(0,Jo[e])()}}function Xo(e,t,r,n){var o=e.io,i=e.nativeIo;function a(e){var a={};for(var u in e){var s=e[u],c=zo(t,u),f=r[u];if(f)try{if("function"==typeof s){var l={initOptions:"object"===Nt()(f)?f:{},io:o,log:c,nativeIo:i,pluginDisklet:(0,Q.HN)(o.disklet,"plugins/"+u)};a[u]=s(l)}else{if("object"!==Nt()(s)||null==s)throw new TypeError("Plugins must be functions or objects, got ".concat(Nt()(s)));a[u]=s}}catch(d){c.error(d)}}n({type:"CORE_PLUGINS_ADDED",payload:a})}function u(){n({type:"CORE_PLUGINS_LOCKED",payload:r})}return a(Wo),Vo&&u(),Yo.push(a),Jo.push(u),function(){Yo.filter((function(e){return e!==a})),Jo.filter((function(e){return e!==u}))}}function $o(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.onError,i=void 0===o?function(e){}:o,a=!1;function u(){r=void 0,c.started&&(a=!0,new Promise((function(t){return t(e())})).catch(i).then(s,s))}function s(){a=!1,c.started&&(r=setTimeout(u,t))}var c={started:!1,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.wait,n=void 0!==t&&t;c.started=!0,a||null!=r||(n?s():u())},stop:function(){c.started=!1,null!=r&&(clearTimeout(r),r=void 0)}};return c}function Qo(e){return new Promise((function(t){return setTimeout((function(){return t(e)}),e)}))}function ei(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var ti=100;function ri(e,t,r){var n=(0,Q.HN)(e.disklet,"repos/"+ut(Ot(Ot(t)))),o=(0,Q.HN)(n,"changes"),i=(0,Q.HN)(n,"data");return{dataKey:r,syncKey:t,baseDisklet:n,changesDisklet:o,dataDisklet:i,disklet:Ft(e,r,(0,Q.Cl)(o,i))}}function ni(e){var t={lastSync:0,lastHash:void 0};return e.baseDisklet.getText("status.json").then((function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ei(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({lastSync:0},JSON.parse(e))})).catch((function(e){return t}))}function oi(e,t){return ii.apply(this,arguments)}function ii(){return(ii=o()(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.keys(n).map((function(e){var t=n[e];return null!=t?r.setText(e,JSON.stringify(t)):r.delete(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ai(e,t,r){return ui.apply(this,arguments)}function ui(){return ui=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,h,p,y;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.changesDisklet,u=n.dataDisklet,s=n.syncKey,e.next=3,si(a).then((function(e){return Promise.all(e.map(function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=r,e.t1=JSON,e.next=4,a.getText(r);case 4:return e.t2=e.sent,e.t3=e.t1.parse.call(e.t1,e.t2),e.abrupt("return",{path:e.t0,json:e.t3});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()))}));case 3:return c=e.sent,f=d.stringify(s).toLowerCase(),e.next=7,function(){if(0===c.length)return r.readRepo(f,i.lastHash);for(var e={},t=0;t<c.length;t++){var n=c[t];e[n.path]=n.json}return r.updateRepo(f,i.lastHash,{changes:e})}();case 7:return l=e.sent,h=l.changes,p=void 0===h?{}:h,y=l.hash,e.next=11,oi(u,p);case 11:return e.next=13,Promise.all(c.map((function(e){return a.delete(e.path)})));case 13:return i.lastSync=Date.now()/1e3,null!=y&&(i.lastHash=y),e.next=17,n.baseDisklet.setText("status.json",JSON.stringify(i)).then((function(){return{status:i,changes:p}}));case 17:return e.abrupt("return",e.sent);case 18:case"end":return e.stop()}}),e)}))),ui.apply(this,arguments)}function si(e){return ci.apply(this,arguments)}function ci(){return ci=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>1&&void 0!==d[1]?d[1]:"",o=d.length>2&&void 0!==d[2]?d[2]:ti,e.next=4,r.list(n);case 4:i=e.sent,a=Object.keys(i).filter((function(e){return"file"===i[e]})),u=Object.keys(i).filter((function(e){return"folder"===i[e]})),s=0;case 8:if(!(s<u.length)){e.next=20;break}if(c=u[s],!(a.length>=o)){e.next=12;break}return e.abrupt("break",20);case 12:return f=o-a.length,e.next=15,si(r,c,f);case 15:l=e.sent,a.push.apply(a,lt()(l.slice(0,f)));case 17:s++,e.next=8;break;case 20:return e.abrupt("return",a);case 21:case"end":return e.stop()}}),e)}))),ci.apply(this,arguments)}function fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function li(e,t){return di.apply(this,arguments)}function di(){return(di=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.io,u=o.onError,s=p.parse(n.keys.dataKey),c=p.parse(n.keys.syncKey),f=ri(a,c,s),A(l=(0,Q.HN)(a.disklet,"local/"+ut(p.parse(n.id)))),e.next=8,ni(f);case 8:if(d=e.sent,i({type:"STORAGE_WALLET_ADDED",payload:{id:n.id,initialState:{localDisklet:l,paths:f,status:d,lastChanges:[]}}}),h=hi(r,n.id),!(d.lastSync>0)){e.next=15;break}h.catch((function(e){var t=n.keys.syncKey,o=d.lastHash;r.props.log.error("Could not sync ".concat(t," with last hash ").concat(String(o),": ").concat(String(e))),u(e)})),e.next=17;break;case 15:return e.next=17,h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hi(e,t){var r=e.props,n=r.dispatch,o=r.syncClient,i=r.state.storageWallets[t];return ai(o,i.paths,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},i.status)).then((function(e){var r=e.changes,o=e.status;return n({type:"STORAGE_WALLET_SYNCED",payload:{id:t,changes:Object.keys(r),status:o}}),Object.keys(r)}))}var pi=r(9847),yi=r.n(pi),bi=r(1964),vi=r(8823).Buffer;function gi(e){return vi.from(e.replace(/^0x/,""),"hex")}function mi(e){try{var t=(0,bi.privateToAddress)(gi(e));return(0,bi.toChecksumAddress)(t.toString("hex"))}catch(r){return"invalid_private_key"}}function wi(e,t){var r=new(yi())(t);return r.sign(gi(e)),r.serialize().toString("hex")}var Ei=[];function _i(e,t){Si(e,t,Ei)&&Ei.push({fromCurrency:e,toCurrency:t})}var Ci=Lo((function(e){function r(){return n.apply(this,arguments)}function n(){return(n=o()(t().mark((function r(){var n,o,i,a,u,s,c,f,l,d,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=e.props.state,o=n.rateHintCache,i=n.currency.wallets,a=0,u=Object.keys(i);a<u.length;a++)for(s=u[a],c=i[s].fiat,f=0,l=Object.keys(i[s].balances);f<l.length;f++)Si(d=l[f],c,Ei)&&Ei.push({fromCurrency:d,toCurrency:c});if(0!==Ei.length||0!==o.length){t.next=4;break}return t.abrupt("return",Ai);case 4:if(!(0===Ei.length&&o.length>0)){t.next=6;break}return t.abrupt("return",o);case 6:if(t.prev=6,!((h=Ei.filter((function(e){return Si(e.fromCurrency,e.toCurrency,o)}))).length>0)){t.next=13;break}return t.next=11,e.props.io.disklet.setText("rateHintCache.json",JSON.stringify(o.concat(h)));case 11:e.props.dispatch({type:"UPDATE_RATE_HINT_CACHE",payload:{rateHintCache:o.concat(h)}}),e.props.log("Update rateHintCache.json success");case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(6),e.props.log.error("Update rateHintCache.json error",t.t0),e.props.onError(new Error("Failed to write rateHintCache"));case 19:return t.abrupt("return",Ei);case 20:case"end":return t.stop()}}),r,null,[[6,15]])})))).apply(this,arguments)}function i(t,r){e.props.log.warn("Exchange rates updated (".concat(r,")")),t.length>0&&e.props.dispatch({type:"EXCHANGE_PAIRS_FETCHED",payload:t})}function a(){return a=o()(t().mark((function n(){var o,a,u,s,c,f,l,d,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u=!1,i(s,e?"complete":"some pending")},0!==(o=Object.keys(e.props.state.plugins.rate)).length){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,r();case 6:return a=t.sent,u=!0,s=[],f=setTimeout(c,5e3),l=0,d=Date.now()/1e3,h=o.map((function(t){return xi(e.props.state.plugins.rate[t],a,t,d).then((function(e){u?s=[].concat(lt()(s),lt()(e)):i(e,t)})).catch((function(r){e.props.log.error("Rate provider ".concat(t," failed: ").concat(String(r)))})).then((function(){u&&++l>=o.length&&(clearTimeout(f),c(!0))}))})),t.next=15,Promise.all(h);case 15:case"end":return t.stop()}}),n)}))),a.apply(this,arguments)}var u=$o((function(){return a.apply(this,arguments)}),3e4);return{update:function(e){e.state.plugins.locked&&u.start({wait:!1})},destroy:function(){u.stop()}}}),(function(e){return e.state.paused?void 0:e}));function xi(e,t,r,n){try{return e.fetchRates(t).then((function(e){return e.map((function(e){var t=e.fromCurrency,o=e.toCurrency,i=e.rate;if("string"!=typeof t||"string"!=typeof o||"number"!=typeof i)throw new TypeError("Invalid data format");return{fromCurrency:t,toCurrency:o,rate:i,source:r,timestamp:n}}))}))}catch(o){return Promise.reject(o)}}function Si(e,t,r){for(var n=0;n<r.length;n++){var o=r[n];if(o.fromCurrency===e&&o.toCurrency===t)return!1}return!0}var Ai=[{fromCurrency:"BTC",toCurrency:"iso:AED"},{fromCurrency:"BTC",toCurrency:"iso:AFN"},{fromCurrency:"BTC",toCurrency:"iso:ALL"},{fromCurrency:"BTC",toCurrency:"iso:AMD"},{fromCurrency:"BTC",toCurrency:"iso:ANG"},{fromCurrency:"BTC",toCurrency:"iso:AOA"},{fromCurrency:"BTC",toCurrency:"iso:ARS"},{fromCurrency:"BTC",toCurrency:"iso:AUD"},{fromCurrency:"BTC",toCurrency:"iso:AWG"},{fromCurrency:"BTC",toCurrency:"iso:AZN"},{fromCurrency:"BTC",toCurrency:"iso:BAM"},{fromCurrency:"BTC",toCurrency:"iso:BBD"},{fromCurrency:"BTC",toCurrency:"iso:BDT"},{fromCurrency:"BTC",toCurrency:"iso:BGN"},{fromCurrency:"BTC",toCurrency:"iso:BIF"},{fromCurrency:"BTC",toCurrency:"iso:BMD"},{fromCurrency:"BTC",toCurrency:"iso:BND"},{fromCurrency:"BTC",toCurrency:"iso:BOB"},{fromCurrency:"BTC",toCurrency:"iso:BRL"},{fromCurrency:"BTC",toCurrency:"iso:BSD"},{fromCurrency:"BTC",toCurrency:"iso:BTN"},{fromCurrency:"BTC",toCurrency:"iso:BWP"},{fromCurrency:"BTC",toCurrency:"iso:BYN"},{fromCurrency:"BTC",toCurrency:"iso:BZD"},{fromCurrency:"BTC",toCurrency:"iso:CAD"},{fromCurrency:"BTC",toCurrency:"iso:CDF"},{fromCurrency:"BTC",toCurrency:"iso:CHF"},{fromCurrency:"BTC",toCurrency:"iso:CLP"},{fromCurrency:"BTC",toCurrency:"iso:CNY"},{fromCurrency:"BTC",toCurrency:"iso:COP"},{fromCurrency:"BTC",toCurrency:"iso:CRC"},{fromCurrency:"BTC",toCurrency:"iso:CUC"},{fromCurrency:"BTC",toCurrency:"iso:CUP"},{fromCurrency:"BTC",toCurrency:"iso:CVE"},{fromCurrency:"BTC",toCurrency:"iso:CZK"},{fromCurrency:"BTC",toCurrency:"iso:DJF"},{fromCurrency:"BTC",toCurrency:"iso:DKK"},{fromCurrency:"BTC",toCurrency:"iso:DOP"},{fromCurrency:"BTC",toCurrency:"iso:DZD"},{fromCurrency:"BTC",toCurrency:"iso:EGP"},{fromCurrency:"BTC",toCurrency:"iso:ERN"},{fromCurrency:"BTC",toCurrency:"iso:ETB"},{fromCurrency:"BTC",toCurrency:"iso:EUR"},{fromCurrency:"BTC",toCurrency:"iso:FJD"},{fromCurrency:"BTC",toCurrency:"iso:FKP"},{fromCurrency:"BTC",toCurrency:"iso:GBP"},{fromCurrency:"BTC",toCurrency:"iso:GEL"},{fromCurrency:"BTC",toCurrency:"iso:GGP"},{fromCurrency:"BTC",toCurrency:"iso:GHS"},{fromCurrency:"BTC",toCurrency:"iso:GIP"},{fromCurrency:"BTC",toCurrency:"iso:GMD"},{fromCurrency:"BTC",toCurrency:"iso:GNF"},{fromCurrency:"BTC",toCurrency:"iso:GTQ"},{fromCurrency:"BTC",toCurrency:"iso:GYD"},{fromCurrency:"BTC",toCurrency:"iso:HKD"},{fromCurrency:"BTC",toCurrency:"iso:HNL"},{fromCurrency:"BTC",toCurrency:"iso:HRK"},{fromCurrency:"BTC",toCurrency:"iso:HTG"},{fromCurrency:"BTC",toCurrency:"iso:HUF"},{fromCurrency:"BTC",toCurrency:"iso:IDR"},{fromCurrency:"BTC",toCurrency:"iso:ILS"},{fromCurrency:"BTC",toCurrency:"iso:IMP"},{fromCurrency:"BTC",toCurrency:"iso:INR"},{fromCurrency:"BTC",toCurrency:"iso:IQD"},{fromCurrency:"BTC",toCurrency:"iso:IRR"},{fromCurrency:"BTC",toCurrency:"iso:ISK"},{fromCurrency:"BTC",toCurrency:"iso:JEP"},{fromCurrency:"BTC",toCurrency:"iso:JMD"},{fromCurrency:"BTC",toCurrency:"iso:JOD"},{fromCurrency:"BTC",toCurrency:"iso:JPY"},{fromCurrency:"BTC",toCurrency:"iso:KES"},{fromCurrency:"BTC",toCurrency:"iso:KGS"},{fromCurrency:"BTC",toCurrency:"iso:KHR"},{fromCurrency:"BTC",toCurrency:"iso:KMF"},{fromCurrency:"BTC",toCurrency:"iso:KPW"},{fromCurrency:"BTC",toCurrency:"iso:KRW"},{fromCurrency:"BTC",toCurrency:"iso:KWD"},{fromCurrency:"BTC",toCurrency:"iso:KYD"},{fromCurrency:"BTC",toCurrency:"iso:KZT"},{fromCurrency:"BTC",toCurrency:"iso:LAK"},{fromCurrency:"BTC",toCurrency:"iso:LBP"},{fromCurrency:"BTC",toCurrency:"iso:LKR"},{fromCurrency:"BTC",toCurrency:"iso:LRD"},{fromCurrency:"BTC",toCurrency:"iso:LSL"},{fromCurrency:"BTC",toCurrency:"iso:LYD"},{fromCurrency:"BTC",toCurrency:"iso:MAD"},{fromCurrency:"BTC",toCurrency:"iso:MDL"},{fromCurrency:"BTC",toCurrency:"iso:MGA"},{fromCurrency:"BTC",toCurrency:"iso:MKD"},{fromCurrency:"BTC",toCurrency:"iso:MMK"},{fromCurrency:"BTC",toCurrency:"iso:MNT"},{fromCurrency:"BTC",toCurrency:"iso:MOP"},{fromCurrency:"BTC",toCurrency:"iso:MRO"},{fromCurrency:"BTC",toCurrency:"iso:MRU"},{fromCurrency:"BTC",toCurrency:"iso:MUR"},{fromCurrency:"BTC",toCurrency:"iso:MWK"},{fromCurrency:"BTC",toCurrency:"iso:MXN"},{fromCurrency:"BTC",toCurrency:"iso:MYR"},{fromCurrency:"BTC",toCurrency:"iso:MZN"},{fromCurrency:"BTC",toCurrency:"iso:NAD"},{fromCurrency:"BTC",toCurrency:"iso:NGN"},{fromCurrency:"BTC",toCurrency:"iso:NIO"},{fromCurrency:"BTC",toCurrency:"iso:NOK"},{fromCurrency:"BTC",toCurrency:"iso:NPR"},{fromCurrency:"BTC",toCurrency:"iso:NZD"},{fromCurrency:"BTC",toCurrency:"iso:OMR"},{fromCurrency:"BTC",toCurrency:"iso:PAB"},{fromCurrency:"BTC",toCurrency:"iso:PEN"},{fromCurrency:"BTC",toCurrency:"iso:PGK"},{fromCurrency:"BTC",toCurrency:"iso:PHP"},{fromCurrency:"BTC",toCurrency:"iso:PKR"},{fromCurrency:"BTC",toCurrency:"iso:PLN"},{fromCurrency:"BTC",toCurrency:"iso:PRB"},{fromCurrency:"BTC",toCurrency:"iso:PYG"},{fromCurrency:"BTC",toCurrency:"iso:QAR"},{fromCurrency:"BTC",toCurrency:"iso:RON"},{fromCurrency:"BTC",toCurrency:"iso:RSD"},{fromCurrency:"BTC",toCurrency:"iso:RUB"},{fromCurrency:"BTC",toCurrency:"iso:RWF"},{fromCurrency:"BTC",toCurrency:"iso:SAR"},{fromCurrency:"BTC",toCurrency:"iso:SBD"},{fromCurrency:"BTC",toCurrency:"iso:SCR"},{fromCurrency:"BTC",toCurrency:"iso:SDG"},{fromCurrency:"BTC",toCurrency:"iso:SEK"},{fromCurrency:"BTC",toCurrency:"iso:SGD"},{fromCurrency:"BTC",toCurrency:"iso:SHP"},{fromCurrency:"BTC",toCurrency:"iso:SLL"},{fromCurrency:"BTC",toCurrency:"iso:SOS"},{fromCurrency:"BTC",toCurrency:"iso:SRD"},{fromCurrency:"BTC",toCurrency:"iso:SSP"},{fromCurrency:"BTC",toCurrency:"iso:STD"},{fromCurrency:"BTC",toCurrency:"iso:SYP"},{fromCurrency:"BTC",toCurrency:"iso:SZL"},{fromCurrency:"BTC",toCurrency:"iso:THB"},{fromCurrency:"BTC",toCurrency:"iso:TJS"},{fromCurrency:"BTC",toCurrency:"iso:TMT"},{fromCurrency:"BTC",toCurrency:"iso:TND"},{fromCurrency:"BTC",toCurrency:"iso:TOP"},{fromCurrency:"BTC",toCurrency:"iso:TRY"},{fromCurrency:"BTC",toCurrency:"iso:TTD"},{fromCurrency:"BTC",toCurrency:"iso:TVD"},{fromCurrency:"BTC",toCurrency:"iso:TWD"},{fromCurrency:"BTC",toCurrency:"iso:TZS"},{fromCurrency:"BTC",toCurrency:"iso:UAH"},{fromCurrency:"BTC",toCurrency:"iso:UGX"},{fromCurrency:"BTC",toCurrency:"iso:USD"},{fromCurrency:"BTC",toCurrency:"iso:UYU"},{fromCurrency:"BTC",toCurrency:"iso:UZS"},{fromCurrency:"BTC",toCurrency:"iso:VEF"},{fromCurrency:"BTC",toCurrency:"iso:VND"},{fromCurrency:"BTC",toCurrency:"iso:VUV"},{fromCurrency:"BTC",toCurrency:"iso:WST"},{fromCurrency:"BTC",toCurrency:"iso:XAF"},{fromCurrency:"BTC",toCurrency:"iso:XCD"},{fromCurrency:"BTC",toCurrency:"iso:XOF"},{fromCurrency:"BTC",toCurrency:"iso:XPF"},{fromCurrency:"BTC",toCurrency:"iso:YER"},{fromCurrency:"BTC",toCurrency:"iso:ZAR"},{fromCurrency:"BTC",toCurrency:"iso:ZMW"},{fromCurrency:"BCH",toCurrency:"iso:AED"},{fromCurrency:"BCH",toCurrency:"iso:AFN"},{fromCurrency:"BCH",toCurrency:"iso:ALL"},{fromCurrency:"BCH",toCurrency:"iso:AMD"},{fromCurrency:"BCH",toCurrency:"iso:ANG"},{fromCurrency:"BCH",toCurrency:"iso:AOA"},{fromCurrency:"BCH",toCurrency:"iso:ARS"},{fromCurrency:"BCH",toCurrency:"iso:AUD"},{fromCurrency:"BCH",toCurrency:"iso:AWG"},{fromCurrency:"BCH",toCurrency:"iso:AZN"},{fromCurrency:"BCH",toCurrency:"iso:BAM"},{fromCurrency:"BCH",toCurrency:"iso:BBD"},{fromCurrency:"BCH",toCurrency:"iso:BDT"},{fromCurrency:"BCH",toCurrency:"iso:BGN"},{fromCurrency:"BCH",toCurrency:"iso:BIF"},{fromCurrency:"BCH",toCurrency:"iso:BMD"},{fromCurrency:"BCH",toCurrency:"iso:BND"},{fromCurrency:"BCH",toCurrency:"iso:BOB"},{fromCurrency:"BCH",toCurrency:"iso:BRL"},{fromCurrency:"BCH",toCurrency:"iso:BSD"},{fromCurrency:"BCH",toCurrency:"iso:BTN"},{fromCurrency:"BCH",toCurrency:"iso:BWP"},{fromCurrency:"BCH",toCurrency:"iso:BYN"},{fromCurrency:"BCH",toCurrency:"iso:BZD"},{fromCurrency:"BCH",toCurrency:"iso:CAD"},{fromCurrency:"BCH",toCurrency:"iso:CDF"},{fromCurrency:"BCH",toCurrency:"iso:CHF"},{fromCurrency:"BCH",toCurrency:"iso:CLP"},{fromCurrency:"BCH",toCurrency:"iso:CNY"},{fromCurrency:"BCH",toCurrency:"iso:COP"},{fromCurrency:"BCH",toCurrency:"iso:CRC"},{fromCurrency:"BCH",toCurrency:"iso:CUC"},{fromCurrency:"BCH",toCurrency:"iso:CUP"},{fromCurrency:"BCH",toCurrency:"iso:CVE"},{fromCurrency:"BCH",toCurrency:"iso:CZK"},{fromCurrency:"BCH",toCurrency:"iso:DJF"},{fromCurrency:"BCH",toCurrency:"iso:DKK"},{fromCurrency:"BCH",toCurrency:"iso:DOP"},{fromCurrency:"BCH",toCurrency:"iso:DZD"},{fromCurrency:"BCH",toCurrency:"iso:EGP"},{fromCurrency:"BCH",toCurrency:"iso:ERN"},{fromCurrency:"BCH",toCurrency:"iso:ETB"},{fromCurrency:"BCH",toCurrency:"iso:EUR"},{fromCurrency:"BCH",toCurrency:"iso:FJD"},{fromCurrency:"BCH",toCurrency:"iso:FKP"},{fromCurrency:"BCH",toCurrency:"iso:GBP"},{fromCurrency:"BCH",toCurrency:"iso:GEL"},{fromCurrency:"BCH",toCurrency:"iso:GGP"},{fromCurrency:"BCH",toCurrency:"iso:GHS"},{fromCurrency:"BCH",toCurrency:"iso:GIP"},{fromCurrency:"BCH",toCurrency:"iso:GMD"},{fromCurrency:"BCH",toCurrency:"iso:GNF"},{fromCurrency:"BCH",toCurrency:"iso:GTQ"},{fromCurrency:"BCH",toCurrency:"iso:GYD"},{fromCurrency:"BCH",toCurrency:"iso:HKD"},{fromCurrency:"BCH",toCurrency:"iso:HNL"},{fromCurrency:"BCH",toCurrency:"iso:HRK"},{fromCurrency:"BCH",toCurrency:"iso:HTG"},{fromCurrency:"BCH",toCurrency:"iso:HUF"},{fromCurrency:"BCH",toCurrency:"iso:IDR"},{fromCurrency:"BCH",toCurrency:"iso:ILS"},{fromCurrency:"BCH",toCurrency:"iso:IMP"},{fromCurrency:"BCH",toCurrency:"iso:INR"},{fromCurrency:"BCH",toCurrency:"iso:IQD"},{fromCurrency:"BCH",toCurrency:"iso:IRR"},{fromCurrency:"BCH",toCurrency:"iso:ISK"},{fromCurrency:"BCH",toCurrency:"iso:JEP"},{fromCurrency:"BCH",toCurrency:"iso:JMD"},{fromCurrency:"BCH",toCurrency:"iso:JOD"},{fromCurrency:"BCH",toCurrency:"iso:JPY"},{fromCurrency:"BCH",toCurrency:"iso:KES"},{fromCurrency:"BCH",toCurrency:"iso:KGS"},{fromCurrency:"BCH",toCurrency:"iso:KHR"},{fromCurrency:"BCH",toCurrency:"iso:KMF"},{fromCurrency:"BCH",toCurrency:"iso:KPW"},{fromCurrency:"BCH",toCurrency:"iso:KRW"},{fromCurrency:"BCH",toCurrency:"iso:KWD"},{fromCurrency:"BCH",toCurrency:"iso:KYD"},{fromCurrency:"BCH",toCurrency:"iso:KZT"},{fromCurrency:"BCH",toCurrency:"iso:LAK"},{fromCurrency:"BCH",toCurrency:"iso:LBP"},{fromCurrency:"BCH",toCurrency:"iso:LKR"},{fromCurrency:"BCH",toCurrency:"iso:LRD"},{fromCurrency:"BCH",toCurrency:"iso:LSL"},{fromCurrency:"BCH",toCurrency:"iso:LYD"},{fromCurrency:"BCH",toCurrency:"iso:MAD"},{fromCurrency:"BCH",toCurrency:"iso:MDL"},{fromCurrency:"BCH",toCurrency:"iso:MGA"},{fromCurrency:"BCH",toCurrency:"iso:MKD"},{fromCurrency:"BCH",toCurrency:"iso:MMK"},{fromCurrency:"BCH",toCurrency:"iso:MNT"},{fromCurrency:"BCH",toCurrency:"iso:MOP"},{fromCurrency:"BCH",toCurrency:"iso:MRO"},{fromCurrency:"BCH",toCurrency:"iso:MRU"},{fromCurrency:"BCH",toCurrency:"iso:MUR"},{fromCurrency:"BCH",toCurrency:"iso:MWK"},{fromCurrency:"BCH",toCurrency:"iso:MXN"},{fromCurrency:"BCH",toCurrency:"iso:MYR"},{fromCurrency:"BCH",toCurrency:"iso:MZN"},{fromCurrency:"BCH",toCurrency:"iso:NAD"},{fromCurrency:"BCH",toCurrency:"iso:NGN"},{fromCurrency:"BCH",toCurrency:"iso:NIO"},{fromCurrency:"BCH",toCurrency:"iso:NOK"},{fromCurrency:"BCH",toCurrency:"iso:NPR"},{fromCurrency:"BCH",toCurrency:"iso:NZD"},{fromCurrency:"BCH",toCurrency:"iso:OMR"},{fromCurrency:"BCH",toCurrency:"iso:PAB"},{fromCurrency:"BCH",toCurrency:"iso:PEN"},{fromCurrency:"BCH",toCurrency:"iso:PGK"},{fromCurrency:"BCH",toCurrency:"iso:PHP"},{fromCurrency:"BCH",toCurrency:"iso:PKR"},{fromCurrency:"BCH",toCurrency:"iso:PLN"},{fromCurrency:"BCH",toCurrency:"iso:PRB"},{fromCurrency:"BCH",toCurrency:"iso:PYG"},{fromCurrency:"BCH",toCurrency:"iso:QAR"},{fromCurrency:"BCH",toCurrency:"iso:RON"},{fromCurrency:"BCH",toCurrency:"iso:RSD"},{fromCurrency:"BCH",toCurrency:"iso:RUB"},{fromCurrency:"BCH",toCurrency:"iso:RWF"},{fromCurrency:"BCH",toCurrency:"iso:SAR"},{fromCurrency:"BCH",toCurrency:"iso:SBD"},{fromCurrency:"BCH",toCurrency:"iso:SCR"},{fromCurrency:"BCH",toCurrency:"iso:SDG"},{fromCurrency:"BCH",toCurrency:"iso:SEK"},{fromCurrency:"BCH",toCurrency:"iso:SGD"},{fromCurrency:"BCH",toCurrency:"iso:SHP"},{fromCurrency:"BCH",toCurrency:"iso:SLL"},{fromCurrency:"BCH",toCurrency:"iso:SOS"},{fromCurrency:"BCH",toCurrency:"iso:SRD"},{fromCurrency:"BCH",toCurrency:"iso:SSP"},{fromCurrency:"BCH",toCurrency:"iso:STD"},{fromCurrency:"BCH",toCurrency:"iso:SYP"},{fromCurrency:"BCH",toCurrency:"iso:SZL"},{fromCurrency:"BCH",toCurrency:"iso:THB"},{fromCurrency:"BCH",toCurrency:"iso:TJS"},{fromCurrency:"BCH",toCurrency:"iso:TMT"},{fromCurrency:"BCH",toCurrency:"iso:TND"},{fromCurrency:"BCH",toCurrency:"iso:TOP"},{fromCurrency:"BCH",toCurrency:"iso:TRY"},{fromCurrency:"BCH",toCurrency:"iso:TTD"},{fromCurrency:"BCH",toCurrency:"iso:TVD"},{fromCurrency:"BCH",toCurrency:"iso:TWD"},{fromCurrency:"BCH",toCurrency:"iso:TZS"},{fromCurrency:"BCH",toCurrency:"iso:UAH"},{fromCurrency:"BCH",toCurrency:"iso:UGX"},{fromCurrency:"BCH",toCurrency:"iso:USD"},{fromCurrency:"BCH",toCurrency:"iso:UYU"},{fromCurrency:"BCH",toCurrency:"iso:UZS"},{fromCurrency:"BCH",toCurrency:"iso:VEF"},{fromCurrency:"BCH",toCurrency:"iso:VND"},{fromCurrency:"BCH",toCurrency:"iso:VUV"},{fromCurrency:"BCH",toCurrency:"iso:WST"},{fromCurrency:"BCH",toCurrency:"iso:XAF"},{fromCurrency:"BCH",toCurrency:"iso:XCD"},{fromCurrency:"BCH",toCurrency:"iso:XOF"},{fromCurrency:"BCH",toCurrency:"iso:XPF"},{fromCurrency:"BCH",toCurrency:"iso:YER"},{fromCurrency:"BCH",toCurrency:"iso:ZAR"},{fromCurrency:"BCH",toCurrency:"iso:ZMW"},{fromCurrency:"ETH",toCurrency:"iso:AED"},{fromCurrency:"ETH",toCurrency:"iso:AFN"},{fromCurrency:"ETH",toCurrency:"iso:ALL"},{fromCurrency:"ETH",toCurrency:"iso:AMD"},{fromCurrency:"ETH",toCurrency:"iso:ANG"},{fromCurrency:"ETH",toCurrency:"iso:AOA"},{fromCurrency:"ETH",toCurrency:"iso:ARS"},{fromCurrency:"ETH",toCurrency:"iso:AUD"},{fromCurrency:"ETH",toCurrency:"iso:AWG"},{fromCurrency:"ETH",toCurrency:"iso:AZN"},{fromCurrency:"ETH",toCurrency:"iso:BAM"},{fromCurrency:"ETH",toCurrency:"iso:BBD"},{fromCurrency:"ETH",toCurrency:"iso:BDT"},{fromCurrency:"ETH",toCurrency:"iso:BGN"},{fromCurrency:"ETH",toCurrency:"iso:BIF"},{fromCurrency:"ETH",toCurrency:"iso:BMD"},{fromCurrency:"ETH",toCurrency:"iso:BND"},{fromCurrency:"ETH",toCurrency:"iso:BOB"},{fromCurrency:"ETH",toCurrency:"iso:BRL"},{fromCurrency:"ETH",toCurrency:"iso:BSD"},{fromCurrency:"ETH",toCurrency:"iso:BTN"},{fromCurrency:"ETH",toCurrency:"iso:BWP"},{fromCurrency:"ETH",toCurrency:"iso:BYN"},{fromCurrency:"ETH",toCurrency:"iso:BZD"},{fromCurrency:"ETH",toCurrency:"iso:CAD"},{fromCurrency:"ETH",toCurrency:"iso:CDF"},{fromCurrency:"ETH",toCurrency:"iso:CHF"},{fromCurrency:"ETH",toCurrency:"iso:CLP"},{fromCurrency:"ETH",toCurrency:"iso:CNY"},{fromCurrency:"ETH",toCurrency:"iso:COP"},{fromCurrency:"ETH",toCurrency:"iso:CRC"},{fromCurrency:"ETH",toCurrency:"iso:CUC"},{fromCurrency:"ETH",toCurrency:"iso:CUP"},{fromCurrency:"ETH",toCurrency:"iso:CVE"},{fromCurrency:"ETH",toCurrency:"iso:CZK"},{fromCurrency:"ETH",toCurrency:"iso:DJF"},{fromCurrency:"ETH",toCurrency:"iso:DKK"},{fromCurrency:"ETH",toCurrency:"iso:DOP"},{fromCurrency:"ETH",toCurrency:"iso:DZD"},{fromCurrency:"ETH",toCurrency:"iso:EGP"},{fromCurrency:"ETH",toCurrency:"iso:ERN"},{fromCurrency:"ETH",toCurrency:"iso:ETB"},{fromCurrency:"ETH",toCurrency:"iso:EUR"},{fromCurrency:"ETH",toCurrency:"iso:FJD"},{fromCurrency:"ETH",toCurrency:"iso:FKP"},{fromCurrency:"ETH",toCurrency:"iso:GBP"},{fromCurrency:"ETH",toCurrency:"iso:GEL"},{fromCurrency:"ETH",toCurrency:"iso:GGP"},{fromCurrency:"ETH",toCurrency:"iso:GHS"},{fromCurrency:"ETH",toCurrency:"iso:GIP"},{fromCurrency:"ETH",toCurrency:"iso:GMD"},{fromCurrency:"ETH",toCurrency:"iso:GNF"},{fromCurrency:"ETH",toCurrency:"iso:GTQ"},{fromCurrency:"ETH",toCurrency:"iso:GYD"},{fromCurrency:"ETH",toCurrency:"iso:HKD"},{fromCurrency:"ETH",toCurrency:"iso:HNL"},{fromCurrency:"ETH",toCurrency:"iso:HRK"},{fromCurrency:"ETH",toCurrency:"iso:HTG"},{fromCurrency:"ETH",toCurrency:"iso:HUF"},{fromCurrency:"ETH",toCurrency:"iso:IDR"},{fromCurrency:"ETH",toCurrency:"iso:ILS"},{fromCurrency:"ETH",toCurrency:"iso:IMP"},{fromCurrency:"ETH",toCurrency:"iso:INR"},{fromCurrency:"ETH",toCurrency:"iso:IQD"},{fromCurrency:"ETH",toCurrency:"iso:IRR"},{fromCurrency:"ETH",toCurrency:"iso:ISK"},{fromCurrency:"ETH",toCurrency:"iso:JEP"},{fromCurrency:"ETH",toCurrency:"iso:JMD"},{fromCurrency:"ETH",toCurrency:"iso:JOD"},{fromCurrency:"ETH",toCurrency:"iso:JPY"},{fromCurrency:"ETH",toCurrency:"iso:KES"},{fromCurrency:"ETH",toCurrency:"iso:KGS"},{fromCurrency:"ETH",toCurrency:"iso:KHR"},{fromCurrency:"ETH",toCurrency:"iso:KMF"},{fromCurrency:"ETH",toCurrency:"iso:KPW"},{fromCurrency:"ETH",toCurrency:"iso:KRW"},{fromCurrency:"ETH",toCurrency:"iso:KWD"},{fromCurrency:"ETH",toCurrency:"iso:KYD"},{fromCurrency:"ETH",toCurrency:"iso:KZT"},{fromCurrency:"ETH",toCurrency:"iso:LAK"},{fromCurrency:"ETH",toCurrency:"iso:LBP"},{fromCurrency:"ETH",toCurrency:"iso:LKR"},{fromCurrency:"ETH",toCurrency:"iso:LRD"},{fromCurrency:"ETH",toCurrency:"iso:LSL"},{fromCurrency:"ETH",toCurrency:"iso:LYD"},{fromCurrency:"ETH",toCurrency:"iso:MAD"},{fromCurrency:"ETH",toCurrency:"iso:MDL"},{fromCurrency:"ETH",toCurrency:"iso:MGA"},{fromCurrency:"ETH",toCurrency:"iso:MKD"},{fromCurrency:"ETH",toCurrency:"iso:MMK"},{fromCurrency:"ETH",toCurrency:"iso:MNT"},{fromCurrency:"ETH",toCurrency:"iso:MOP"},{fromCurrency:"ETH",toCurrency:"iso:MRO"},{fromCurrency:"ETH",toCurrency:"iso:MRU"},{fromCurrency:"ETH",toCurrency:"iso:MUR"},{fromCurrency:"ETH",toCurrency:"iso:MWK"},{fromCurrency:"ETH",toCurrency:"iso:MXN"},{fromCurrency:"ETH",toCurrency:"iso:MYR"},{fromCurrency:"ETH",toCurrency:"iso:MZN"},{fromCurrency:"ETH",toCurrency:"iso:NAD"},{fromCurrency:"ETH",toCurrency:"iso:NGN"},{fromCurrency:"ETH",toCurrency:"iso:NIO"},{fromCurrency:"ETH",toCurrency:"iso:NOK"},{fromCurrency:"ETH",toCurrency:"iso:NPR"},{fromCurrency:"ETH",toCurrency:"iso:NZD"},{fromCurrency:"ETH",toCurrency:"iso:OMR"},{fromCurrency:"ETH",toCurrency:"iso:PAB"},{fromCurrency:"ETH",toCurrency:"iso:PEN"},{fromCurrency:"ETH",toCurrency:"iso:PGK"},{fromCurrency:"ETH",toCurrency:"iso:PHP"},{fromCurrency:"ETH",toCurrency:"iso:PKR"},{fromCurrency:"ETH",toCurrency:"iso:PLN"},{fromCurrency:"ETH",toCurrency:"iso:PRB"},{fromCurrency:"ETH",toCurrency:"iso:PYG"},{fromCurrency:"ETH",toCurrency:"iso:QAR"},{fromCurrency:"ETH",toCurrency:"iso:RON"},{fromCurrency:"ETH",toCurrency:"iso:RSD"},{fromCurrency:"ETH",toCurrency:"iso:RUB"},{fromCurrency:"ETH",toCurrency:"iso:RWF"},{fromCurrency:"ETH",toCurrency:"iso:SAR"},{fromCurrency:"ETH",toCurrency:"iso:SBD"},{fromCurrency:"ETH",toCurrency:"iso:SCR"},{fromCurrency:"ETH",toCurrency:"iso:SDG"},{fromCurrency:"ETH",toCurrency:"iso:SEK"},{fromCurrency:"ETH",toCurrency:"iso:SGD"},{fromCurrency:"ETH",toCurrency:"iso:SHP"},{fromCurrency:"ETH",toCurrency:"iso:SLL"},{fromCurrency:"ETH",toCurrency:"iso:SOS"},{fromCurrency:"ETH",toCurrency:"iso:SRD"},{fromCurrency:"ETH",toCurrency:"iso:SSP"},{fromCurrency:"ETH",toCurrency:"iso:STD"},{fromCurrency:"ETH",toCurrency:"iso:SYP"},{fromCurrency:"ETH",toCurrency:"iso:SZL"},{fromCurrency:"ETH",toCurrency:"iso:THB"},{fromCurrency:"ETH",toCurrency:"iso:TJS"},{fromCurrency:"ETH",toCurrency:"iso:TMT"},{fromCurrency:"ETH",toCurrency:"iso:TND"},{fromCurrency:"ETH",toCurrency:"iso:TOP"},{fromCurrency:"ETH",toCurrency:"iso:TRY"},{fromCurrency:"ETH",toCurrency:"iso:TTD"},{fromCurrency:"ETH",toCurrency:"iso:TVD"},{fromCurrency:"ETH",toCurrency:"iso:TWD"},{fromCurrency:"ETH",toCurrency:"iso:TZS"},{fromCurrency:"ETH",toCurrency:"iso:UAH"},{fromCurrency:"ETH",toCurrency:"iso:UGX"},{fromCurrency:"ETH",toCurrency:"iso:USD"},{fromCurrency:"ETH",toCurrency:"iso:UYU"},{fromCurrency:"ETH",toCurrency:"iso:UZS"},{fromCurrency:"ETH",toCurrency:"iso:VEF"},{fromCurrency:"ETH",toCurrency:"iso:VND"},{fromCurrency:"ETH",toCurrency:"iso:VUV"},{fromCurrency:"ETH",toCurrency:"iso:WST"},{fromCurrency:"ETH",toCurrency:"iso:XAF"},{fromCurrency:"ETH",toCurrency:"iso:XCD"},{fromCurrency:"ETH",toCurrency:"iso:XOF"},{fromCurrency:"ETH",toCurrency:"iso:XPF"},{fromCurrency:"ETH",toCurrency:"iso:YER"},{fromCurrency:"ETH",toCurrency:"iso:ZAR"},{fromCurrency:"ETH",toCurrency:"iso:ZMW"}];function Ii(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oi(e,t,r,n){t===e.toCurrency&&(e.bestRate=r),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ii(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n),n[t]=!0;for(var o=0,i=Object.keys(e.routes[t]);o<i.length;o++){var a=i[o];if(!n[a]){for(var u={rate:0,cost:1/0},s=e.routes[t][a],c=0;c<s.length;c++){var f=s[c],l=e.pairs[f],d=l.fromCurrency!==t,h=r.cost+e.getPairCost(l.source,e.now-l.timestamp,d);if(h<u.cost)u={rate:d?r.rate/l.rate:r.rate*l.rate,cost:h}}u.cost<e.bestRate.cost&&Oi(e,a,u,n)}}}function Ti(e){return/^iso:/.test(e)}function ki(e,t,r,n){var o=e.exchangeCache.rates,i=o.routes,a=o.pairs,u={now:Date.now()/1e3,routes:i,pairs:a,toCurrency:r,getPairCost:n,bestRate:{rate:0,cost:1/0}};return u.routes[t]&&u.routes[r]?(Oi(u,t,{rate:1,cost:0},{}),Ti(t)||function(e,t){for(var r=[],n=0,o=Object.keys(e.routes[t]);n<o.length;n++)for(var i=o[n],a=0,u=Object.keys(e.routes[i]);a<u.length;a++){if(Ti(u[a]))return;r.push({fromCurrency:i,toCurrency:"iso:USD"})}r.forEach((function(e){return _i(e.fromCurrency,e.toCurrency)}))}(u,t)):_i(t,r),u.bestRate.rate}var Pi={edgeRates:.15,nomics:.1,coincap:-.05,coinbase:-.1,coinmonitor:-.2,wazirx:-.15,constantRate:-.25};var Bi=ve(Le),Ri=Qr;function ji(e,t){return xe(e)+t}function Mi(e,t,r,n){return Ni.apply(this,arguments)}function Ni(){return(Ni=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p,y;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.now,u=void 0===a?new Date:a,s=en(r,n),c=s.passwordBox,f=s.passwordKeySnrp,null!=c&&null!=f){e.next=5;break}throw new Error("Missing data for offline password login");case 5:return l=ji(n,o),e.next=8,$r(r,l,f);case 8:return d=e.sent,h=Bt(c,d),p=Dn(s,h),s.lastLogin=u,cn(r,s).catch((function(){})),y=r.props.log,Vn(r,p,p).catch((function(e){return y.error(e)})),e.abrupt("return",p);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Di(e,t,r,n){return Li.apply(this,arguments)}function Li(){return Li=o()(t().mark((function e(r,n,i,u){var s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=en(r,n),c=ji(n,i),e.next=4,Promise.all([nn(r,n),$r(r,c,Ri)]);case 4:return f=e.sent,l=a()(f,2),d=l[0],h=l[1],p={userId:d,passwordAuth:h},e.abrupt("return",Un(r,s,s,u,p,function(){var e=o()(t().mark((function e(n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.passwordBox,i=n.passwordKeySnrp,null!=o&&null!=i){e.next=3;break}throw new Error("Missing data for online password login");case 3:return e.next=5,$r(r,c,i);case 5:return a=e.sent,e.abrupt("return",Bt(o,a));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 10:case"end":return e.stop()}}),e)}))),Li.apply(this,arguments)}function Ui(e,t,r,n){return Hi.apply(this,arguments)}function Hi(){return(Hi=o()(t().mark((function e(r,n,o,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Mi(r,n,o,i).catch((function(){return Di(r,n,o,i)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ki(e,t,r){return Fi.apply(this,arguments)}function Fi(){return(Fi=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.state.accounts[n],a=i.loginTree,u=i.username,e.next=3,Vi(r,a,u,o);case 3:return s=e.sent,e.next=6,Kn(r,a,s);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gi(e,t,r){return qi.apply(this,arguments)}function qi(){return qi=o()(t().mark((function e(r,n,o){var i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.username,a=n.passwordAuth,null!=i&&null!=a){e.next=3;break}return e.abrupt("return",!1);case 3:return u=ji(i,o),e.next=6,$r(r,u,Ri);case 6:s=e.sent,c=0;case 8:if(!(c<a.length)){e.next=14;break}if(s[c]===a[c]){e.next=11;break}return e.abrupt("return",!1);case 11:++c,e.next=8;break;case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e)}))),qi.apply(this,arguments)}function zi(e,t){return Wi.apply(this,arguments)}function Wi(){return(Wi=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i={serverMethod:"DELETE",serverPath:"/v2/login/password",stash:{passwordAuthSnrp:void 0,passwordBox:void 0,passwordKeySnrp:void 0},login:{passwordAuth:void 0},loginId:o.loginId},null!=o.loginAuth&&(i.stash.passwordAuthBox=void 0,i.login.passwordAuth=void 0),e.next=5,Kn(r,o,i);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vi(e,t,r,n){var o=ji(r,n),i=e.props.io,u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;return e.props.output.scrypt.makeSnrp(t)}(e).then((function(r){return $r(e,o,r).then((function(e){var n=Rt(i,t.loginKey,e);return{passwordKeySnrp:r,passwordBox:n}}))})),s=$r(e,o,Ri).then((function(e){return{passwordAuth:e,passwordAuthBox:Rt(i,e,t.loginKey)}}));return Promise.all([u,s]).then((function(e){var r=a()(e,2),n=r[0],o=n.passwordKeySnrp,i=n.passwordBox,u=r[1],s=u.passwordAuth,c=u.passwordAuthBox;return{serverPath:"/v2/login/password",server:Bi({passwordAuth:s,passwordAuthSnrp:Ri,passwordKeySnrp:o,passwordBox:i,passwordAuthBox:c}),stash:{passwordKeySnrp:o,passwordBox:i,passwordAuthBox:c},login:{passwordAuth:s},loginId:t.loginId}}))}var Yi=ve(Ue);function Ji(e,t){return It(st(xe(t)),e)}function Zi(e,t){return It(st(t),e)}function Xi(e,t){if(null!=e.pin2Key)return e;var r=Bn(e,(function(e){return e.appId===t}));return null!=r&&null!=r.pin2Key?r:void 0}function $i(e,t,r,n,o){return Qi.apply(this,arguments)}function Qi(){return Qi=o()(t().mark((function e(r,n,i,a,u){var s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=en(r,i),null!=(c=Xi(s,n))&&null!=c.pin2Key){e.next=4;break}throw new Error("PIN login is not enabled for this account on this device");case 4:return f=c.pin2Key,l={pin2Id:Ji(f,i),pin2Auth:Zi(f,a)},e.abrupt("return",Un(r,s,c,u,l,function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.pin2Box){e.next=2;break}throw new Error("Missing data for PIN v2 login");case 2:return e.abrupt("return",Bt(r.pin2Box,f));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 7:case"end":return e.stop()}}),e)}))),Qi.apply(this,arguments)}function ea(e,t,r,n){return ta.apply(this,arguments)}function ta(){return(ta=o()(t().mark((function e(r,n,o,i){var a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.props.state.accounts[n],u=a.loginTree,s=a.username,null==i&&(i=null!=u.pin2Key||null!=o&&null==u.pin),null==o&&(o=u.pin),null!=o){e.next=9;break}if(!i){e.next=6;break}throw new Error("Please change your PIN in the settings area above before enabling.");case 6:return e.next=8,Gn(r,u,sa(u));case 8:return e.abrupt("return");case 9:return c=aa(r,u,s,o,i),e.next=12,Gn(r,u,c);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ra(e,t,r){return na.apply(this,arguments)}function na(){return na=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.appId,null!=(a=n.username)){e.next=3;break}return e.abrupt("return",!1);case 3:if(u=en(r,a),null!=(s=Xi(u,i))&&null!=s.pin2Key){e.next=7;break}throw new Error("No PIN set locally for this account");case 7:return c=s.pin2Key,f={pin2Id:Ji(c,a),pin2Auth:Zi(c,o),otp:vn(n)},e.abrupt("return",Xr(r,"POST","/v2/login",f).then((function(e){return!0}),(function(e){return!1})));case 10:case"end":return e.stop()}}),e)}))),na.apply(this,arguments)}function oa(e,t){return ia.apply(this,arguments)}function ia(){return(ia=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i=sa(o),e.next=4,Gn(r,o,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function aa(e,t,r,n,o){for(var i=[ua(e,t,r,n,o)],a=0,u=t.children;a<u.length;a++){var s=u[a];i.push.apply(i,lt()(aa(e,s,r,n,o)))}return i}function ua(e,t,r,n,o){var i=e.props.io,a=Rt(i,st(n),t.loginKey);if(o){var u=t.loginId,s=t.loginKey,c=t.pin2Key,f=void 0===c?i.random(32):c,l=Rt(i,s,f),d=Rt(i,f,s);return{serverPath:"/v2/login/pin2",server:Yi({pin2Id:Ji(f,r),pin2Auth:Zi(f,n),pin2Box:l,pin2KeyBox:d,pin2TextBox:a}),stash:{pin2Key:f,pin2TextBox:a},login:{pin2Key:f,pin:n},loginId:u}}return{serverPath:"/v2/login/pin2",server:Yi({pin2Id:void 0,pin2Auth:void 0,pin2Box:void 0,pin2KeyBox:void 0,pin2TextBox:a}),stash:{pin2Key:void 0,pin2TextBox:a},login:{pin2Key:void 0,pin:n},loginId:t.loginId}}function sa(e){for(var t=[ca(e)],r=0,n=e.children;r<n.length;r++){var o=n[r];t.push.apply(t,lt()(sa(o)))}return t}function ca(e){return{serverMethod:"DELETE",serverPath:"/v2/login/pin2",server:void 0,stash:{pin2Key:void 0},login:{pin2Key:void 0},loginId:e.loginId}}var fa=ve(He);function la(e,t){return It(st(xe(t)),e)}function da(e,t){return t.map((function(t){return It(st(t),e)}))}function ha(e,t,r,n,o){return pa.apply(this,arguments)}function pa(){return pa=o()(t().mark((function e(r,n,i,a,u){var s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=en(r,i),c={recovery2Id:la(n,i),recovery2Auth:da(n,a)},e.abrupt("return",Un(r,s,s,u,c,function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.recovery2Box){e.next=2;break}throw new Error("Missing data for recovery v2 login");case 2:return e.abrupt("return",Bt(r.recovery2Box,n));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)}))),pa.apply(this,arguments)}function ya(e,t,r){return Xr(e,"POST","/v2/login",{recovery2Id:la(t,r)}).then((function(e){var r=$e(e).question2Box;if(null==r)throw new Error("Login has no recovery questions");return JSON.parse(Pt(r,t))}))}function ba(e,t,r,n){return va.apply(this,arguments)}function va(){return(va=o()(t().mark((function e(r,n,o,i){var a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n],u=a.loginTree,s=a.username,c=wa(r,u,s,o,i),e.next=4,Kn(r,u,c);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ga(e,t){return ma.apply(this,arguments)}function ma(){return(ma=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i={serverMethod:"DELETE",serverPath:"/v2/login/recovery2",stash:{recovery2Key:void 0},login:{recovery2Key:void 0},loginId:o.loginId},e.next=4,Kn(r,o,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wa(e,t,r,n,o){var i=e.props.io;if(!Array.isArray(n))throw new TypeError("Questions must be an array of strings");if(!Array.isArray(o))throw new TypeError("Answers must be an array of strings");var a=t.loginId,u=t.loginKey,s=t.recovery2Key,c=void 0===s?i.random(32):s,f=Rt(i,st(JSON.stringify(n)),c),l=Rt(i,u,c),d=Rt(i,c,u);return{serverPath:"/v2/login/recovery2",server:fa({recovery2Id:la(c,r),recovery2Auth:da(c,o),recovery2Box:l,recovery2KeyBox:d,question2Box:f}),stash:{recovery2Key:c},login:{recovery2Key:c},loginId:a}}function Ea(e){return _a.apply(this,arguments)}function _a(){return(_a=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Xe,e.next=3,Xr(r,"POST","/v1/questions",{});case 3:return e.t1=e.sent,e.abrupt("return",(0,e.t0)(e.t1));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ca(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ca(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Sa=ve(Fe);function Aa(e,t,r){return Ia.apply(this,arguments)}function Ia(){return Ia=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=tn(r,n.loginId),a=i.stashTree,e.next=3,Xr(r,"POST","/v2/login/vouchers",xa(xa({},Jn(a,n)),{},{data:Sa(o)}));case 3:return u=e.sent,s=Mn(a,n.loginKey,We(u)),e.abrupt("return",cn(r,s));case 6:case"end":return e.stop()}}),e)}))),Ia.apply(this,arguments)}function Oa(e,r){var n=r.id,i=r.type,a=r.keys;return{id:n,type:i,keys:a,get disklet(){return Gt(e.props.state,n)},get localDisklet(){return qt(e.props.state,n)},sync:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,hi(e,n);case 2:case"end":return t.stop()}}),r)})))()}}}var Ta=r(3550);function ka(e){return!!(e.startsWith("0x")||e.startsWith("-0x")||e.toLowerCase().includes("a")||e.toLowerCase().includes("b")||e.toLowerCase().includes("c")||e.toLowerCase().includes("d")||e.toLowerCase().includes("e")||e.toLowerCase().includes("f"))}function Pa(e){return e.replace("0x","")}function Ba(e,t){for(var r=e,n=0;n<t;n++)r+="0";return r}function Ra(e){var t=e.replace(/^0+/,"");return(t=t.replace(/^\.+/,"0.")).includes(".")&&""===(t=(t=t.replace(/0+$/,"")).replace(/\.+$/,""))&&(t="0"),""===t&&(t="0"),t}function ja(e,t){if(0===t)return e;var r=!1;"-"===e.slice(0,1)&&(r=!0,e=e.slice(1));var n=void 0;return n=Ra(n=t>e.length?"0."+Ba("",t-e.length)+e:e.substr(0,e.length-t)+"."+e.substr(e.length-t,e.length)),r&&(n="-"+n),n}function Ma(e,t,r){var n=e,o=t;Na(n,o);var i=n.indexOf("."),a=o.indexOf("."),u=ka(n),s=ka(o);if(-1!==i&&(i=(n=Ra(n)).indexOf(".")),-1!==a&&(a=(o=Ra(o)).indexOf(".")),-1!==i||-1!==a||"number"==typeof r){if(u||s)throw new Error("Cannot operate on base16 float values");var c=0,f=0;-1!==i&&(c=n.length-i-1),-1!==a&&(f=o.length-a-1);var l=c>f?c:f,d=0;return"number"==typeof r&&(d=r),{x:n=Ba(n.replace(".",""),l+d-c),y:o=Ba(o.replace(".",""),l-f),shift:l}}return{x:n,y:o,shift:0}}function Na(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var s=a.value;if(s.split(".").length-1>1)throw new Error("Invalid number: more than one decimal point");if(s.split("-").length-1>1)throw new Error("Invalid number: more than one negative sign")}}catch(c){o=!0,i=c}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}}function Da(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(10!==r&&16!==r)throw new Error("Unsupported base");var n=Ma(e,t),o=n.x,i=n.y,a=n.shift,u=ka(o)?16:10,s=ka(i)?16:10;o=Pa(o),i=Pa(i);var c=new Ta(o,u),f=new Ta(i,s),l=c.add(f).toString(r);return l=ja(l,a),10===r?l:"0x"+l}function La(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(10!==r&&16!==r)throw new Error("Unsupported base");var n=Ma(e,t),o=n.x,i=n.y,a=n.shift,u=ka(o)?16:10,s=ka(i)?16:10;o=Pa(o),i=Pa(i);var c=new Ta(o,u),f=new Ta(i,s),l=c.mul(f).toString(r);return l=ja(l,2*a),10===r?l:"0x"+l}function Ua(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(10!==r&&16!==r)throw new Error("Unsupported base");var n=Ma(e,t),o=n.x,i=n.y,a=n.shift,u=ka(o)?16:10,s=ka(i)?16:10;o=Pa(o),i=Pa(i);var c=new Ta(o,u),f=new Ta(i,s),l=c.sub(f).toString(r);return l=ja(l,a),10===r?l:"0x"+l}function Ha(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(10!==n&&r>0)throw new Error("Cannot operate on floating point hex values");if(10!==n&&16!==n)throw new Error("Unsupported base");var o=Ma(e,t,r),i=o.x,a=o.y,u=ka(i)?16:10,s=ka(a)?16:10;i=Pa(i),a=Pa(a);var c=new Ta(i,u),f=new Ta(a,s),l=c.div(f).toString(n);return l=ja(l,r),10===n?l:"0x"+l}function Ka(e,t){var r=Ma(e,t),n=r.x,o=r.y,i=ka(n)?16:10,a=ka(o)?16:10;n=Pa(n),o=Pa(o);var u=new Ta(n,i),s=new Ta(o,a);return u.lt(s)}function Fa(e,t){var r=Ma(e,t),n=r.x,o=r.y,i=ka(n)?16:10,a=ka(o)?16:10;n=Pa(n),o=Pa(o);var u=new Ta(n,i),s=new Ta(o,a);return u.lte(s)}function Ga(e,t){var r=Ma(e,t),n=r.x,o=r.y,i=ka(n)?16:10,a=ka(o)?16:10;n=Pa(n),o=Pa(o);var u=new Ta(n,i),s=new Ta(o,a);return u.gt(s)}function qa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function za(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qa(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wa(e,t,r){return Va.apply(this,arguments)}function Va(){return Va=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=w.length>3&&void 0!==w[3]?w[3]:{},a=i.preferPluginId,u=i.disabled,s=void 0===u?{}:u,c=i.promoCodes,f=void 0===c?{}:c,l=r.props.log,d=r.props.state.accounts[n],h=d.swapSettings,p=d.userSettings,y=r.props.state.plugins.swap,l.warn("Requesting swap quotes for: ",za(za({},o),{},{fromWallet:o.fromWallet.id,toWallet:o.toWallet.id}),{preferPluginId:a,promoCodes:f}),b=[],v=function(e,t){var r=t[e],n=(null!=h[r]?h[r]:{}).enabled;if(!(void 0===n||n)||s[r])return"continue";b.push(y[r].fetchSwapQuote(o,p[r],{promoCode:f[r]}).then((function(e){return l.warn("".concat(r," gave swap quote:"),e),e}),(function(e){throw l.warn("".concat(r," gave swap error: ").concat(String(e))),e})))},g=0,m=Object.keys(y);case 10:if(!(g<m.length)){e.next=17;break}if("continue"!==v(g,m)){e.next=14;break}return e.abrupt("continue",14);case 14:g++,e.next=10;break;case 17:if(!(b.length<1)){e.next=19;break}throw new Error("No swap providers enabled");case 19:return e.abrupt("return",Yr(b,2e4).then((function(e){var t=Ya(e,a,f);l.warn("".concat(b.length," swap quotes requested, ").concat(e.length," resolved, picked ").concat(t.pluginId,"."));for(var r=0;r<e.length;r++){var n=e[r];n!==t&&n.close().catch((function(){}))}return A(t)}),(function(e){throw l.warn("All ".concat(b.length," swap quotes rejected.")),Ja(e)})));case 20:case"end":return e.stop()}}),e)}))),Va.apply(this,arguments)}function Ya(e,t,r){return e.reduce((function(e,n){if(e.pluginId===t)return e;if(n.pluginId===t)return n;var o=null!=r[e.pluginId],i=null!=r[n.pluginId];if(o&&!i)return e;if(!o&&i)return n;var a=e.isEstimate,u=void 0===a||a,s=n.isEstimate,c=void 0===s||s;if(u&&!c)return n;if(!u&&c)return e;var f=Number(e.toNativeAmount)/Number(e.fromNativeAmount);return Number(n.toNativeAmount)/Number(n.fromNativeAmount)>f?n:e}))}function Ja(e){return e.reduce((function(e,t){var r=Za(e)-Za(t);if(r>0)return e;if(r<0)return t;var n=_t(e),o=_t(t);if(null!=n&&null!=o)return Ka(n.nativeMin,o.nativeMin)?n:o;var i=Et(e),a=Et(t);return null!=i&&null!=a?Ga(i.nativeMax,a.nativeMax)?i:a:e}))}function Za(e){return null==e?0:null!=gt(e)||null!=wt(e)?6:null!=_t(e)?5:null!=Et(e)?4:null!=xt(e)?3:null!=Ct(e)?2:1}var Xa=Ht(de({name:pe})),$a=Ht(de({key:pe,data:pe}));function Qa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function eu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qa(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tu=ve(Ke),ru=ve(qe);function nu(e,t){return nn(e,t).then((function(t){return Xr(e,"POST","/v2/login",{userId:t}).then((function(e){return!1})).catch((function(e){if(null!=St(e))return!0;throw e}))}))}function ou(e,t,r,n,o){var i=e.props.io,u=null!=t?i.random(32):nn(e,n),s=i.random(32),c={appId:r,lastLogin:new Date,loginId:new Uint8Array(0),loginKey:s,pendingVouchers:[],children:[],keyInfos:[]},f=null!=t?Rt(i,s,t.loginKey):void 0,l=null!=o.password?Vi(e,c,n,o.password):{},d=null!=o.pin?ua(e,c,n,o.pin,!0):{},h=null!=o.keyInfo?Mr(e,c,o.keyInfo):{},p=i.random(32),y=Rt(i,p,s),b=tu({loginAuth:p,loginAuthBox:y});return Promise.all([u,l]).then((function(e){var t=a()(e,2),n=t[0],o=t[1];return{loginId:n,serverPath:"/v2/login/create",server:eu(eu(eu(eu(eu({},ru({appId:r,loginId:n,parentBox:f})),h.server),o.server),d.server),b),stash:eu(eu(eu({appId:r,loginAuthBox:y,loginId:n,parentBox:f},o.stash),d.stash),h.stash),login:eu(eu(eu({appId:r,loginAuth:p,loginId:n,loginKey:s,keyInfos:[]},o.login),d.login),h.login)}}))}function iu(e,t,r,n){return au.apply(this,arguments)}function au(){return(au=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=xe(n),u=o.now,s=void 0===u?new Date:u,e.next=4,ou(r,void 0,"",a,i);case 4:return(c=e.sent).login.username=a,c.stash.username=a,c.login.userId=c.login.loginId,f={data:c.server},e.next=11,Xr(r,"POST",c.serverPath,f);case 11:return c.stash.lastLogin=s,e.next=14,cn(r,c.stash);case 14:return e.abrupt("return",c.login);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uu(e){if(null==e||null==e.loginKey)throw new Error("Incomplete login")}function su(e,t){var r=Bn(e,(function(e){return e.appId===t}));if(!r)throw new Error("Internal error: cannot find login for ".concat(t));return r}function cu(e,t,r,n){return fu.apply(this,arguments)}function fu(){return fu=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!(l.length>4&&void 0!==l[4])||l[4],u=n.username,uu(o),null!=u){e.next=5;break}throw new Error("Cannot create child: missing username");case 5:return s={pin:n.pin},a&&(s.keyInfo=jr(r,Br(i))),e.next=9,ou(r,o,i,u,s);case 9:return c=e.sent,f={serverPath:c.serverPath,server:c.server,login:{children:[c.login]},stash:{children:[c.stash]},loginId:o.loginId},e.abrupt("return",Kn(r,n,f));case 12:case"end":return e.stop()}}),e)}))),fu.apply(this,arguments)}function lu(e,t,r){return du.apply(this,arguments)}function du(){return du=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Br(o),null!=(a=Bn(n,(function(e){return e.appId===o})))){e.next=4;break}return e.abrupt("return",cu(r,n,n,o,!0));case 4:if(null!=Pr(a.keyInfos,i)){e.next=9;break}return uu(a),u=jr(r,i),s=Mr(r,a,u),e.abrupt("return",Kn(r,n,s));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)}))),du.apply(this,arguments)}function hu(e,t,r,n,o){return pu.apply(this,arguments)}function pu(){return(pu=o()(t().mark((function e(r,n,o,i,a){var u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=a.pauseWallets,s=void 0!==u&&u,(c=r.props.log).warn("Login: decrypted keys for user ".concat(p.stringify(o.loginId))),e.next=5,lu(r,o,n);case 5:if(o=e.sent,c.warn("Login: account exists for appId"),null!=(f=o.username)){e.next=10;break}throw new Error("Cannot log in: missing username");case 10:return l=null!=o.loginKey,r.props.dispatch({type:"LOGIN",payload:{appId:n,username:f,loginKey:l?o.loginKey:su(o,n).loginKey,pauseWallets:s,rootLogin:l,loginType:i}}),e.abrupt("return",yu(r,r.props.state.lastAccountId));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yu(e,t){return e.waitFor((function(e){var r=e.state.accounts[t];if(null!=r.loadFailure)throw r.loadFailure;var n=e.output.accounts[t];if(null!=n&&null!=n.accountApi)return n.accountApi}))}var bu=r(6266),vu=r.n(bu),gu=r(2956);gu.BU;const mu=gu.j6;function wu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Eu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wu(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _u=new(0,vu().ec)("secp256k1"),Cu=ve(Re),xu=ve(Be);function Su(e,t){var r=e.derive(_u.keyFromPublic(t).getPublic()).toArray("be");return It(Uint8Array.from([0,0,0,1].concat(lt()(r))),st("dataKey"))}function Au(e,t){var r=Su(e,t.publicKey);return JSON.parse(Pt(t.box,r))}function Iu(e,t,r){var n=_u.genKeyPair({entropy:e.random(32)}),o=Su(n,t);return{publicKey:Uint8Array.from(n.getPublic().encodeCompressed()),box:Rt(e,st(JSON.stringify(r)),o)}}function Ou(e,t){return Tu.apply(this,arguments)}function Tu(){return Tu=o()(t().mark((function e(r,n){var i,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.length>2&&void 0!==E[2]?E[2]:1e3,u=r.props.io,s=n.timeout,c=void 0===s?600:s,f=_u.genKeyPair({entropy:u.random(32)}),l=Uint8Array.from(f.getPublic().encodeCompressed()),d=ut(Ot(Ot(l)).slice(0,10)),h={data:xu(Eu(Eu({},n),{},{publicKey:l,timeout:c}))},e.next=9,Xr(r,"PUT","/v2/lobby/".concat(d),h);case 9:return p=mu(),y=a()(p,2),b=y[0],v=y[1],g=[],m=function(){var e=o()(t().mark((function e(){var n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ze,e.next=3,Xr(r,"GET","/v2/lobby/"+d);case 3:for(e.t1=e.sent,n=(0,e.t0)(e.t1);g.length<n.replies.length;)o=n.replies[g.length],i=Au(f,o),v("reply",i),g.push(i);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),(w=$o(m,i,{onError:function(e){v("error",e)}})).start({wait:!1}),e.abrupt("return",{close:w.stop,lobbyId:d,on:b,replies:g});case 15:case"end":return e.stop()}}),e)}))),Tu.apply(this,arguments)}function ku(e,t){return Pu.apply(this,arguments)}function Pu(){return(Pu=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ze,e.next=3,Xr(r,"GET","/v2/lobby/"+n);case 3:if(e.t1=e.sent,o=(0,e.t0)(e.t1),i=o.request.publicKey,a=Ot(Ot(i)),Tt(u=at(n),a.subarray(0,u.length))){e.next=10;break}throw new Error("Lobby ECDH integrity error");case 10:return e.abrupt("return",o.request);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bu(e,t,r,n){return Ru.apply(this,arguments)}function Ru(){return(Ru=o()(t().mark((function e(r,n,o,i){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.io,u=o.publicKey,s={data:Cu(Iu(a,u,i))},e.next=5,Xr(r,"POST","/v2/lobby/"+n,s);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ju=de({appId:pe,loginKey:Ie,loginStash:ln});function Mu(e,t,r,n){return Nu.apply(this,arguments)}function Nu(){return Nu=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.now,u=void 0===a?new Date:a,s=n.loginKey,c=n.loginStash,null!=(f=Bn(c,(function(e){return e.appId===o})))){e.next=5;break}throw new Error('Cannot find requested appId: "'.concat(o,'"'));case 5:try{l=tn(r,f.loginId),f.voucherId=l.stash.voucherId,f.voucherAuth=l.stash.voucherAuth}catch(t){}return c.lastLogin=u,e.next=9,cn(r,c);case 9:if(d=Dn(c,s,o),null!=(h=Bn(d,(function(e){return e.appId===o})))){e.next=13;break}throw new Error('Cannot find requested appId: "'.concat(o,'"'));case 13:return e.next=15,Vn(r,d,h);case 15:return p=e.sent,e.next=18,hu(r,o,p,"edgeLogin",i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)}))),Nu.apply(this,arguments)}function Du(e,t){return Lu.apply(this,arguments)}function Lu(){return Lu=o()(t().mark((function e(r,n){var i,a,u,s,c,f,l,d,h,p=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=function(){return(f=o()(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=0;r<d.length;r++)(0,d[r])();h.state="closed",U(h),D(h);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},c=function(){return f.apply(this,arguments)},s=function(){return(s=o()(t().mark((function e(o){var a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=0;a<d.length;a++)(0,d[a])();if(u=ju(o),null!=(s=u.loginStash.username)){e.next=5;break}throw new Error("No username in reply");case 5:return h.state="started",h.username=s,U(h),e.next=10,Mu(r,u,n,i);case 10:c=e.sent,h.state="done",h.account=c,U(h),D(h);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)},u=function(e){return s.apply(this,arguments)},a=function(e){for(var t=0;t<d.length;t++){(0,d[t])()}h.state="error",h.error=e,U(h),D(h)},i=p.length>2&&void 0!==p[2]?p[2]:{},e.next=8,Ou(r,{loginRequest:{appId:n}});case 8:return l=e.sent,d=[l.close,l.on("error",a),l.on("reply",(function(e){u(e).catch(a)}))],h={id:l.lobbyId,cancelRequest:c,watch:Z,state:"pending",account:void 0,error:void 0,username:void 0},e.abrupt("return",A(h));case 12:case"end":return e.stop()}}),e)}))),Lu.apply(this,arguments)}var Uu=ve(ju),Hu="https://info1.edge.app";function Ku(e,t){return Fu.apply(this,arguments)}function Fu(){return(Fu=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o="".concat(Hu,"/v1/appIdInfo/").concat(n),e.next=4,r.props.io.fetch(o);case 4:if((i=e.sent).ok){e.next=7;break}throw new Error("Fetching ".concat(o," returned ").concat(i.status));case 7:return e.next=9,i.json();case 9:if(a=e.sent,u=a.appName,s=a.imageUrl,u){e.next=14;break}throw new Error("No appName in appId lookup response.");case 14:return e.abrupt("return",{displayImageUrl:s,displayName:u});case 17:return e.prev=17,e.t0=e.catch(0),r.props.onError(e.t0),e.abrupt("return",{displayName:n});case 21:case"end":return e.stop()}}),e,null,[[0,17]])})))).apply(this,arguments)}function Gu(e,t,r,n,o){return qu.apply(this,arguments)}function qu(){return qu=o()(t().mark((function e(r,n,o,i,a){var u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=r.props.state.accounts[n].loginTree,e.next=3,zn(r,n);case 3:return e.next=5,lu(r,u,o);case 5:if(s=e.sent,c=su(s,o)){e.next=9;break}throw new Error("Failed to create the requested login object");case 9:return f=tn(r,u.loginId),l=f.stashTree,d=Ln(l,o),h=Uu({appId:o,loginKey:c.loginKey,loginStash:d}),e.next=14,Bu(r,i,a,h).then((function(){var e,t=r.props.output.accounts[n].accountApi;null!=t&&t.on("close",(function(){null!=e&&clearTimeout(e)})),e=setTimeout((function(){e=void 0,zn(r,n).then((function(){e=setTimeout((function(){e=void 0,zn(r,n).catch((function(e){return r.props.onError(e)}))}),2e4)})).catch((function(e){return r.props.onError(e)}))}),1e4)}));case 14:case"end":return e.stop()}}),e)}))),qu.apply(this,arguments)}function zu(e,t,r){return Wu.apply(this,arguments)}function Wu(){return(Wu=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ku(r,o);case 2:if(null==(i=e.sent).loginRequest){e.next=14;break}if("string"==typeof(u=i.loginRequest.appId)){e.next=7;break}throw new TypeError("Invalid login request");case 7:return e.next=9,Ku(r,u);case 9:s=e.sent,c=s.displayName,f=s.displayImageUrl,A(a={appId:u,displayName:c,displayImageUrl:f,approve:function(){return Gu(r,n,u,o,i)}});case 14:return A(l={loginRequest:a}),e.abrupt("return",l);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Vu=r(2205),Yu=r.n(Vu),Ju=r(8585),Zu=r.n(Ju),Xu=r(9754),$u=r.n(Xu);function Qu(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];t[e[o].currencyCode]=o}return t}function es(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>3?arguments[3]:void 0,n=[],o=0;o<r.length;o++){var i,a=r[o],u=null!==(i=t[a])&&void 0!==i?i:e[a];null!=u&&n.push(u.currencyCode)}return n}function ts(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r={},n=0;n<t.length;n++){var o=t[n];r[o]=!0}for(var i=[],a=0;a<e.length;a++){var u=e[a];r[u]||(r[u]=!0,i.push(u))}return i}function rs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ns(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rs(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var os=Ht(er),is=Ht(Qt),as="CustomTokens.json",us="Settings.json",ss=ce(de({contractAddress:pe}));function cs(e,t,r){return fs.apply(this,arguments)}function fs(){return(fs=o()(t().mark((function e(r,n,o){var i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ar(r,n);case 2:if(null==(i=e.sent).getTokenId){e.next=7;break}return e.next=6,i.getTokenId(o);case 6:return e.abrupt("return",e.sent);case 7:if(null!=(a=gs(r,n))){e.next=10;break}throw new Error("A wallet must exist before adding tokens to a legacy currency plugin");case 10:if(null!=(u=ys(o))){e.next=13;break}throw new Error("A token must have a contract address to be added to a legacy currency plugin");case 13:return e.next=15,a.addCustomToken(ns(ns({},u),o));case 15:return e.abrupt("return",ls(u.contractAddress));case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ls(e){return e.toLowerCase().replace(/^0x/,"")}function ds(e){for(var t={},r=0;r<e.length;r++){var n=e[r],o=n.contractAddress;null!=o&&(t[ls(o)]={currencyCode:n.currencyCode,denominations:n.denominations,displayName:n.currencyName,networkLocation:{contractAddress:n.contractAddress}})}return t}function hs(e){var t=e.currencyCode,r=e.displayName,n=e.denominations,o=e.networkLocation,i=ss(o);return{currencyCode:t,currencyName:r,denominations:n,contractAddress:null==i?void 0:i.contractAddress}}function ps(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];t.push(hs(e[o]))}return t}function ys(e){var t=e.currencyCode,r=e.displayName,n=e.denominations,o=e.networkLocation,i=ss(o);if(null!=i)return{currencyCode:t,currencyName:r,multiplier:n[0].multiplier,contractAddress:i.contractAddress}}function bs(e,t){return vs.apply(this,arguments)}function vs(){return vs=o()(t().mark((function e(r,n){var i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props,a=i.dispatch,u=i.state,e.next=3,Promise.all(Object.keys(u.plugins.currency).map(function(){var e=o()(t().mark((function e(r){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(o=u.plugins.currency[r]).getBuiltinTokens){e.next=5;break}e.t0=ds(o.currencyInfo.metaTokens),e.next=8;break;case 5:return e.next=7,o.getBuiltinTokens();case 7:e.t0=e.sent;case 8:i=e.t0,a({type:"ACCOUNT_BUILTIN_TOKENS_LOADED",payload:{accountId:n,pluginId:r,tokens:i}});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)}))),vs.apply(this,arguments)}function gs(e,t){for(var r=0,n=Object.keys(e.props.state.currency.wallets);r<n.length;r++){var o=n[r],i=e.props.output.currency.wallets[o];if(null!=i&&null!=i.engine&&e.props.state.currency.wallets[o].pluginId===t)return i.engine}}function ms(e,t){return ws.apply(this,arguments)}function ws(){return(ws=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state,i=o.accounts[n].accountWalletInfo,a=Gt(o,i.id),e.next=5,is.load(a,us);case 5:if(null!=(u=e.sent)){e.next=8;break}return e.abrupt("return",{});case 8:s={},c=0,f=u.customTokens;case 10:if(!(c<f.length)){e.next=23;break}if((l=f[c]).isVisible){e.next=14;break}return e.abrupt("continue",20);case 14:if(null!=(d=Sr(o.plugins.currency,l.walletType))){e.next=17;break}return e.abrupt("continue",20);case 17:null==s[d]&&(s[d]={}),h=ls(l.contractAddress),s[d][h]={currencyCode:l.currencyCode,denominations:l.denominations,displayName:l.currencyName,networkLocation:{contractAddress:l.contractAddress}};case 20:c++,e.next=10;break;case 23:return e.abrupt("return",s);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Es(e,t){return _s.apply(this,arguments)}function _s(){return(_s=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.state,u=a.accounts[n].accountWalletInfo,s=Gt(a,u.id),e.next=5,os.load(s,as);case 5:if(null==(c=e.sent)){e.next=11;break}f=c.customTokens,i({type:"ACCOUNT_CUSTOM_TOKENS_LOADED",payload:{accountId:n,customTokens:f}}),e.next=15;break;case 11:return e.next=13,ms(r,n);case 13:l=e.sent,i({type:"ACCOUNT_CUSTOM_TOKENS_LOADED",payload:{accountId:n,customTokens:l}});case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cs(e,t){return xs.apply(this,arguments)}function xs(){return(xs=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state,i=o.accounts[n].accountWalletInfo,a=Gt(o,i.id),u=r.props.state.accounts[n].customTokens,e.next=6,os.load(a,as);case 6:s=e.sent,os.save(a,as,ns(ns({},s),{},{customTokens:u}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ss(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function As(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ss(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ss(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Is(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$u()(e);if(t){var o=$u()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Zu()(this,r)}}var Os={},Ts=function(e){Yu()(c,e);var r,n,i,a,u,s=Is(c);function c(e,t,r){var n;me()(this,c),(n=s.call(this))._ai=e,n._accountId=t,n._pluginId=r;var o=e.props.state.plugins.currency[r].otherMethods;return null!=o?(A(o),n.otherMethods=o):n.otherMethods={},n}return Ee()(c,[{key:"addCustomToken",value:(u=o()(t().mark((function e(r){var n,o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._accountId,o=this._ai,i=this._pluginId,e.next=3,cs(o,i,r);case 3:return a=e.sent,o.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_ADDED",payload:{accountId:n,pluginId:i,tokenId:a,token:r}}),e.abrupt("return",a);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"changeCustomToken",value:(a=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this._accountId,i=this._ai,a=this._pluginId,null!=(u=i.props.state.accounts[o].customTokens[a][r])){e.next=4;break}throw new Error('There is no token with id "'.concat(r,'"'));case 4:return e.next=6,cs(i,a,n);case 6:if(s=e.sent,i.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_ADDED",payload:{accountId:o,pluginId:a,tokenId:s,token:n}}),u.currencyCode===n.currencyCode){e.next=20;break}c=i.props.state.currency.wallets,f=0,l=Object.keys(c);case 11:if(!(f<l.length)){e.next=20;break}if(d=l[f],!((h=c[d]).accountId!==o||h.pluginId!==a||h.enabledTokens.indexOf(u.currencyCode)<0)){e.next=16;break}return e.abrupt("continue",17);case 16:i.props.dispatch({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:d,currencyCodes:ts([].concat(lt()(h.enabledTokens),[n.currencyCode]),[u.currencyCode])}});case 17:f++,e.next=11;break;case 20:s!==r&&i.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_REMOVED",payload:{accountId:o,pluginId:a,tokenId:r}});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"removeCustomToken",value:(i=o()(t().mark((function e(r){var n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._accountId,o=this._ai,i=this._pluginId,o.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_REMOVED",payload:{accountId:n,pluginId:i,tokenId:r}});case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"changeUserSettings",value:(n=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,br(this._ai,this._accountId,this._pluginId,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"importKey",value:(r=o()(t().mark((function e(r){var n,o,i,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,Ar(this._ai,this._pluginId);case 3:if(null!=(o=e.sent).importPrivateKey){e.next=6;break}throw new Error("This wallet does not support importing keys");case 6:return e.next=8,o.importPrivateKey(r,n.keyOptions);case 8:return i=e.sent,e.abrupt("return",As(As({},i),{},{imported:!0}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"currencyInfo",get:function(){return this._ai.props.state.plugins.currency[this._pluginId].currencyInfo}},{key:"allTokens",get:function(){var e=this._ai.props.state,t=this._accountId,r=this._pluginId;return e.accounts[t].allTokens[r]}},{key:"builtinTokens",get:function(){var e=this._ai.props.state,t=this._accountId,r=this._pluginId;return e.accounts[t].builtinTokens[r]}},{key:"customTokens",get:function(){var e,t=this._ai.props.state,r=this._accountId,n=this._pluginId;return null!==(e=t.accounts[r].customTokens[n])&&void 0!==e?e:Os}},{key:"userSettings",get:function(){return this._ai.props.state.accounts[this._accountId].userSettings[this._pluginId]}}]),c}(X),ks=function(e){Yu()(a,e);var r,n,i=Is(a);function a(e,t,r){var n;return me()(this,a),(n=i.call(this))._ai=e,n._accountId=t,n._pluginId=r,n}return Ee()(a,[{key:"changeEnabled",value:(n=o()(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._ai.props.state.accounts[this._accountId],e.abrupt("return",gr(this._ai,this._accountId,this._pluginId,As(As({},n.swapSettings[this._pluginId]),{},{enabled:r})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"changeUserSettings",value:(r=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,br(this._ai,this._accountId,this._pluginId,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"enabled",get:function(){var e=this._ai.props.state.accounts[this._accountId].swapSettings,t=(null!=e[this._pluginId]?e[this._pluginId]:{}).enabled;return void 0===t||t}},{key:"needsActivation",get:function(){var e=this._ai.props.state.plugins.swap[this._pluginId];if(null==e.checkSettings)return!1;var t=this._ai.props.state.accounts[this._accountId].userSettings[this._pluginId]||{};return!!e.checkSettings(t).needsActivation}},{key:"swapInfo",get:function(){return this._ai.props.state.plugins.swap[this._pluginId].swapInfo}},{key:"userSettings",get:function(){return this._ai.props.state.accounts[this._accountId].userSettings[this._pluginId]}}]),a}(X);function Ps(e,r){for(var n=function(){return e.props.state.accounts[r]},i=n(),a=i.accountWalletInfo,u=i.loginType,s=i.loginTree,c=s.username,f={},l=0,d=Object.keys(e.props.state.plugins.currency);l<d.length;l++){var p=d[l],y=new Ts(e,r,p);f[p]=y}for(var b={},v=0,g=Object.keys(e.props.state.plugins.swap);v<g.length;v++){var m=g[v],w=new ks(e,r,m);b[m]=w}var E=function(e){var r={on:J,convertCurrency:function(r,n){var i=arguments;return o()(t().mark((function o(){var a,u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f=function(e,t,r){return t/(30+t)+(null!=c[e]?c[e]:0)+(r?1.1:1)},a=i.length>2&&void 0!==i[2]?i[2]:1,u=i.length>3&&void 0!==i[3]?i[3]:{},s=u.biases,c=void 0===s?Pi:s,l=ki(e.props.state,r,n,f),t.abrupt("return",a*l);case 6:case"end":return t.stop()}}),o)})))()}};return A(r),r}(e),_=function(e,r){var n=e.props.state.accounts[r].accountWalletInfo,i=Gt(e.props.state,n.id),a=function(t){return Wt(e.props.state,n.id,t)},u=function(e){return"Plugins/".concat(a(e))},s=function(e,t){return"".concat(u(e),"/").concat(a(t),".json")},c={deleteItem:function(e,r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.delete(s(e,r));case 2:case"end":return t.stop()}}),n)})))()},deleteStore:function(e){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.delete(u(e));case 2:case"end":return t.stop()}}),r)})))()},listItemIds:function(e){return o()(t().mark((function r(){var n,a;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=[],r.t0=Q.gQ,r.next=4,i.list(u(e));case 4:return r.t1=r.sent,a=(0,r.t0)(r.t1),r.next=8,Promise.all(a.map(function(){var e=o()(t().mark((function e(r){var o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$a.load(i,r);case 2:null!=(o=e.sent)&&n.push(o.key);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:return r.abrupt("return",n);case 9:case"end":return r.stop()}}),r)})))()},listStoreIds:function(){return o()(t().mark((function e(){var r,n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[],e.t0=Q.ji,e.next=4,i.list("Plugins");case 4:return e.t1=e.sent,n=(0,e.t0)(e.t1),e.next=8,Promise.all(n.map(function(){var e=o()(t().mark((function e(n){var o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xa.load(i,"".concat(n,"/Name.json"));case 2:null!=(o=e.sent)&&r.push(o.name);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})))()},getItem:function(e,r){return o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$a.load(i,s(e,r));case 2:if(null!=(o=t.sent)){t.next=5;break}throw new Error('No item named "'.concat(r,'"'));case 5:return t.abrupt("return",o.data);case 6:case"end":return t.stop()}}),n)})))()},setItem:function(e,r,n){return o()(t().mark((function o(){var a,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="".concat(u(e),"/Name.json"),t.next=3,Xa.load(i,a);case 3:if(null!=(c=t.sent)){t.next=9;break}return t.next=7,Xa.save(i,a,{name:e});case 7:t.next=11;break;case 9:if(c.name===e){t.next=11;break}throw new Error("Warning: folder name doesn't match for ".concat(e));case 11:return t.next=13,$a.save(i,s(e,r),{key:r,data:n});case 13:case"end":return t.stop()}}),o)})))()}};return A(c),c}(e,r),C=Oa(e,a);function x(){if(e.props.state.hideKeys)throw new Error("Not available when `hideKeys` is enabled")}var S={on:J,watch:Z,get id(){return C.id},get type(){return C.type},get keys(){return x(),C.keys},get disklet(){return x(),C.disklet},get localDisklet(){return x(),C.localDisklet},sync:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C.sync();case 2:case"end":return e.stop()}}),e)})))()},get appId(){return n().login.appId},get created(){return n().login.created},get lastLogin(){return n().login.lastLogin},get loggedIn(){return null!=n()},get loginKey(){return x(),ut(n().login.loginKey)},get recoveryKey(){x();var e=n().login;return null!=e.recovery2Key?ut(e.recovery2Key):void 0},get rootLoginId(){return x(),ut(s.loginId)},get username(){if(null==c)throw new Error("Missing username");return c},get currencyConfig(){return f},get swapConfig(){return b},get rateCache(){return E},get dataStore(){return _},get edgeLogin(){return null==n().loginTree.loginKey},keyLogin:"keyLogin"===u,newAccount:"newAccount"===u,passwordLogin:"passwordLogin"===u,pinLogin:"pinLogin"===u,recoveryLogin:"recoveryLogin"===u,changePassword:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,Ki(e,r,n);case 3:case"end":return t.stop()}}),o)})))()},changePin:function(i){return o()(t().mark((function o(){var a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),a=i.pin,u=i.enableLogin,t.abrupt("return",ea(e,r,a,u).then((function(){var e=n().login;return e.pin2Key?ut(e.pin2Key):""})));case 3:case"end":return t.stop()}}),o)})))()},changeRecovery:function(i,a){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.abrupt("return",ba(e,r,i,a).then((function(){var e=n().loginTree;if(!e.recovery2Key)throw new Error("Missing recoveryKey");return ut(e.recovery2Key)})));case 2:case"end":return t.stop()}}),o)})))()},checkPassword:function(r){return o()(t().mark((function o(){var i,a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),i=n(),a=i.loginTree,t.abrupt("return",Gi(e,a,r));case 3:case"end":return t.stop()}}),o)})))()},checkPin:function(r){return o()(t().mark((function o(){var i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),i=n(),a=i.login,u=i.loginTree,t.abrupt("return",null!=a.pin?r===a.pin:ra(e,u,r));case 3:case"end":return t.stop()}}),o)})))()},deletePassword:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,zi(e,r);case 3:case"end":return t.stop()}}),n)})))()},deletePin:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,oa(e,r);case 3:case"end":return t.stop()}}),n)})))()},deleteRecovery:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,ga(e,r);case 3:case"end":return t.stop()}}),n)})))()},get otpKey(){x();var e=n().loginTree;return null!=e.otpKey?h.stringify(e.otpKey,{pad:!1}):void 0},get otpResetDate(){return x(),n().loginTree.otpResetDate},cancelOtpReset:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,Cn(e,r);case 3:case"end":return t.stop()}}),n)})))()},enableOtp:function(){var n=arguments;return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n.length>0&&void 0!==n[0]?n[0]:604800,x(),t.next=4,mn(e,r,i);case 4:case"end":return t.stop()}}),o)})))()},disableOtp:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,En(e,r);case 3:case"end":return t.stop()}}),n)})))()},repairOtp:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,In(e,r,h.parse(n,{loose:!0}));case 3:case"end":return t.stop()}}),o)})))()},get pendingVouchers(){return n().login.pendingVouchers},approveVoucher:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Aa(e,s,{approvedVouchers:[r]}));case 1:case"end":return t.stop()}}),n)})))()},rejectVoucher:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Aa(e,s,{rejectedVouchers:[r]}));case 1:case"end":return t.stop()}}),n)})))()},fetchLobby:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.abrupt("return",zu(e,r,n));case 2:case"end":return t.stop()}}),o)})))()},logout:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.props.dispatch({type:"LOGOUT",payload:{accountId:r}});case 1:case"end":return t.stop()}}),n)})))()},get allKeys(){return e.props.state.hideKeys?e.props.state.accounts[r].allWalletInfosClean:e.props.state.accounts[r].allWalletInfosFull},changeWalletStates:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,pr(e,r,n);case 2:case"end":return t.stop()}}),o)})))()},createWallet:function(r,i){return o()(t().mark((function o(){var a,u,s,c,f,l,d;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n(),u=a.login,s=a.loginTree,null!=i){t.next=9;break}return c=xr(e.props.state.plugins.currency,r),t.next=5,Ar(e,c);case 5:return f=t.sent,t.next=8,f.createPrivateKey(r);case 8:i=t.sent;case 9:return l=jr(e,r,i),d=Mr(e,u,l),t.next=13,Kn(e,s,d);case 13:return t.abrupt("return",l.id);case 14:case"end":return t.stop()}}),o)})))()},getFirstWalletInfo:_e.prototype.getFirstWalletInfo,getWalletInfo:_e.prototype.getWalletInfo,listWalletIds:_e.prototype.listWalletIds,splitWalletInfo:function(n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",qr(e,r,n,i));case 1:case"end":return t.stop()}}),o)})))()},listSplittableWalletTypes:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Wr(e,r,n));case 1:case"end":return t.stop()}}),o)})))()},get activeWalletIds(){return e.props.state.accounts[r].activeWalletIds},get archivedWalletIds(){return e.props.state.accounts[r].archivedWalletIds},get hiddenWalletIds(){return e.props.state.accounts[r].hiddenWalletIds},get currencyWallets(){return e.props.output.accounts[r].currencyWallets},createCurrencyWallet:function(n){var i=arguments;return o()(t().mark((function o(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=i.length>1&&void 0!==i[1]?i[1]:{},t.abrupt("return",Hr(e,r,n,a));case 2:case"end":return t.stop()}}),o)})))()},waitForCurrencyWallet:function(e){var r=this;return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=function(){var n=r.currencyWallets[e];null!=n&&(t(n),o())},o=r.watch("currencyWallets",n);n()})));case 1:case"end":return t.stop()}}),n)})))()},signEthereumTransaction:function(r,i){return o()(t().mark((function o(){var a,u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.props.log.warn("Edge is signing: ",i),a=n(),u=a.allWalletInfosFull,null!=(s=u.find((function(e){return e.id===r})))&&null!=s.keys&&"string"==typeof s.keys.ethereumKey){t.next=5;break}throw new Error("Cannot find the requested private key in the account");case 5:return t.abrupt("return",wi(s.keys.ethereumKey,i));case 6:case"end":return t.stop()}}),o)})))()},fetchSwapQuote:function(n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Wa(e,r,n,i));case 1:case"end":return t.stop()}}),o)})))()}};return A(S),S}var Bs=r(6479),Rs=r.n(Bs),js="redux-keto wrapper";function Ms(e,t,r){for(var n=Object.create(null),o=function(){var e=a[i],o=t(e);Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var t=this,n=t[js];if(n.running[e]){var i=new ReferenceError("Reducer '"+e+"' depends on its own result");throw i.name="ReduxKetoCircularReferenceError",i}n.running[e]=!0;try{var a=o(n.state[e],n.action,r(n.next,t,e),r(n.prev,n.state,e));if(void 0===a)throw new TypeError("Reducer '"+e+"' returned undefined");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!1,value:a}),a}finally{n.running[e]=!1}}})},i=0,a=e;i<a.length;i+=1)o();return n}function Ns(e,t,r,n,o){var i=Object.create(e);return Object.defineProperty(i,js,{configurable:!0,enumerable:!1,writable:!1,value:{state:t,action:r,next:n,prev:o,running:{}}}),i}function Ds(e,t){if(void 0===e&&(e={}),null===t||null==t[js])return t;for(var r=Object.keys(Object.getPrototypeOf(t)),n=Object.keys(e).length===r.length,o=0,i=r;o<i.length;o+=1){var a=i[o];Object.defineProperty(t,a,{configurable:!1,enumerable:!0,writable:!1,value:Ds(e[a],t[a])}),t[a]!==e[a]&&(n=!1)}return n?e:(delete t[js],t)}function Ls(e,t,r){return void 0!==e?e:t}function Us(e,t){if(void 0===t&&(t=Ls),"object"!=typeof e||null===e)throw new TypeError("The reducer map must be an object.");for(var r=Object.keys(e),n=0,o=r;n<o.length;n+=1){var i=o[n];if("function"!=typeof e[i])throw new TypeError("Reducers must be functions.")}for(var a=Ms(r,(function(t){return e[t]}),t),u={},s=0,c=r;s<c.length;s+=1){var f=c[s];u[f]=e[f].defaultState}function l(e,t,r,n){void 0===e&&(e=u);var o=Ns(a,e,t,r,n);return void 0===r?Ds(e,o):o}return l.defaultState=u,l}function Hs(e,t){return e}function Ks(e){return e}function Fs(e,t,r){void 0===t&&(t=Hs),void 0===r&&(r=Ks);var n=e.defaultState;function o(o,i,a,u){void 0===o&&(o=n);var s=t(i,a),c=r(a),f=r(u);if(!s)return o;var l=e(o,s,c,f);return void 0===a?Ds(o,l):l}return o.defaultState=n,o}function Gs(e,t,r){return{id:r,root:void 0!==e?e:t,get self(){return t[r]}}}var qs={};function zs(e,t,r){function n(n,o,i,a){void 0===n&&(n=qs);var u=t(i),s=Ns(n===qs||u!==t(a)?Ms(u,(function(t){return e}),r):Object.getPrototypeOf(n),n,o,i,a);return void 0===i?Ds(n,s):s}return void 0===r&&(r=Gs),n.defaultState=qs,n}function Ws(){for(var e=arguments,t=arguments.length-1,r=arguments[t],n=[];t-- >0;)n[t]=e[t];if("function"!=typeof r)throw new TypeError("The reducer must be a function");for(var o=0,i=n;o<i.length;o+=1){var a=i[o];if("function"!=typeof a)throw new TypeError("Each argument filter must be a function")}return function(e,t,o,i){void 0===e&&(e=r.defaultState);for(var a=void 0!==e,u=[],s=0;s<n.length;++s)u[s]=n[s](o),a&&u[s]!==n[s](i)&&(a=!1);return a?e:r.apply(void 0,u)}}var Vs={"[object Float32Array]":!0,"[object Float64Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Int8Array]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0};function Ys(e,t){if(e===t)return!0;if("object"!==Nt()(e))return!1;if("object"!==Nt()(t))return!1;var r=Object.prototype.toString.call(e);return r===Object.prototype.toString.call(t)&&function(e,t,r){if("[object Object]"===r){if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var n=Object.getOwnPropertyNames(e);if(n.length!==Object.getOwnPropertyNames(t).length)return!1;for(var o=0;o<n.length;o++){var i=n[o];if(!Object.prototype.hasOwnProperty.call(t,i)||!Ys(e[i],t[i]))return!1}return!0}if("[object Array]"===r){if(e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!Ys(e[a],t[a]))return!1;return!0}if("[object Date]"===r)return e.getTime()===t.getTime();if(Vs[r]){if(e.length!==t.length)return!1;for(var u=0;u<e.length;++u)if(e[u]!==t[u])return!1;return!0}return!1}(e,t,r)}function Js(e){var t=function(e,t){if("object"!==Nt()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Nt()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Nt()(t)?t:String(t)}function Zs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zs(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zs(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $s={},Qs=Us({accountWalletInfo:Ws((function(e){return e.self.appId}),(function(e){return e.self.login}),(function(e,t){var r=Br(e),n=Pr(t.keyInfos,r);if(null==n)throw new Error('Cannot find a "'.concat(r,'" repo'));return n})),accountWalletInfos:Ws((function(e){return e.self.appId}),(function(e){return e.self.login}),(function(e,t){var r=[Br(e)];return""===e&&r.push("account:repo:co.airbitz.wallet",""),t.keyInfos.filter((function(e){return r.indexOf(e.type)>=0}))})),allWalletInfosFull:Ws((function(e){return e.self.login}),(function(e){return e.self.legacyWalletInfos}),(function(e){return e.self.walletStates}),(function(e,t,r){var n=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r={},n=[],o=0;o<t.length;o++){var i=t[o];n.push(i),null==r[i.id]?r[i.id]=[e.appId]:r[i.id].push(e.appId)}function a(e){for(var t=0,o=e.keyInfos;t<o.length;t++){var i=o[t];n.push(i),null==r[i.id]?r[i.id]=[e.appId]:r[i.id].push(e.appId)}for(var u=0,s=e.children;u<s.length;u++)a(s[u])}return a(e),{appIdMap:r,walletInfos:Nr(n)}}(e,t),o=n.walletInfos,i=n.appIdMap;return o.map((function(e){return Xs(Xs({appId:(t=i[e.id],t[t.length-1]),appIds:i[e.id],archived:!1,deleted:!1,hidden:!1,sortIndex:o.length},r[e.id]),e);var t}))})),allWalletInfosClean:Ws((function(e){return e.self.allWalletInfosFull}),(function(e){return e.map((function(e){var t="wallet:ethereum"===e.type&&"string"==typeof e.keys.ethereumKey?{ethereumAddress:mi(e.keys.ethereumKey)}:{};return Xs(Xs({},e),{},{keys:t})}))})),currencyWalletIds:Ws((function(e){return e.self.walletInfos}),(function(e){return e.root.plugins.currency}),(function(e,t){return Object.keys(e).filter((function(r){var n=e[r],o=Sr(t,n.type);return!n.deleted&&null!=o})).sort((function(t,r){var n=e[t],o=e[r];return n.sortIndex-o.sortIndex}))})),activeWalletIds:Ws((function(e){return e.self.walletInfos}),(function(e){return e.self.currencyWalletIds}),(function(e){return e.self.keysLoaded}),(function(e,t,r){return r?t.filter((function(t){return!e[t].archived})):[]})),archivedWalletIds:Ws((function(e){return e.self.walletInfos}),(function(e){return e.self.currencyWalletIds}),(function(e){return e.self.keysLoaded}),(function(e,t,r){return r?t.filter((function(t){return e[t].archived})):[]})),hiddenWalletIds:Ws((function(e){return e.self.walletInfos}),(function(e){return e.self.currencyWalletIds}),(function(e){return e.self.keysLoaded}),(function(e,t,r){return r?t.filter((function(t){return e[t].hidden})):[]})),keysLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_KEYS_LOADED"===t.type||e},legacyWalletInfos:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_KEYS_LOADED"===t.type?t.payload.legacyWalletInfos:e},walletInfos:Ws((function(e){return e.self.allWalletInfosFull}),(function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];t[n.id]=n}return t})),walletStates:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_CHANGED_WALLET_STATES"===t.type||"ACCOUNT_KEYS_LOADED"===t.type?t.payload.walletStates:e},pauseWallets:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.pauseWallets:e},appId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.appId:e},loadFailure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_LOAD_FAILED"===t.type?t.payload.error:e},login:Ws((function(e){return e.self.appId}),(function(e){return e.self.loginTree}),(function(e,t){return su(t,e)})),loginKey:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array(0),t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.loginKey:e},loginTree:Ws((function(e){return e.self.appId}),(function(e){return e.self.loginKey}),(function(e){return e.self.rootLogin}),(function(e){return e.root.login.stashes[e.self.username]}),(function(e,t,r,n){return Dn(n,t,r?"":e)})),loginType:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"newAccount",t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.loginType:e},rootLogin:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.rootLogin:e},username:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.username:e},allTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,n=t.self,o=n.builtinTokens,i=n.customTokens;if(null==r.self||o!==r.self.builtinTokens||i!==r.self.customTokens){for(var a=Xs({},e),u=0,s=Object.keys(t.root.plugins.currency);u<s.length;u++){var c=s[u];null!=r.self&&o[c]===r.self.builtinTokens[c]&&i[c]===r.self.customTokens[c]||(a[c]=Xs(Xs({},i[c]),o[c]))}return a}return e},builtinTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("ACCOUNT_BUILTIN_TOKENS_LOADED"===t.type){var r=t.payload,n=r.pluginId,o=r.tokens;return Xs(Xs({},e),{},te()({},n,o))}return e},customTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ACCOUNT_CUSTOM_TOKENS_LOADED":var r=t.payload.customTokens;return r;case"ACCOUNT_CUSTOM_TOKEN_ADDED":var n,o=t.payload,i=o.pluginId,a=o.tokenId,u=o.token,s=null!==(n=e[i])&&void 0!==n?n:{};if(Ys(s[a],u))return e;var c=Xs(Xs({},s),{},te()({},a,u));return Xs(Xs({},e),{},te()({},i,c));case"ACCOUNT_CUSTOM_TOKEN_REMOVED":var f,l=t.payload,d=l.pluginId,h=l.tokenId,p=null!==(f=e[d])&&void 0!==f?f:{};if(null==p[h])return e;p[h];var y=Rs()(p,[h].map(Js));return Xs(Xs({},e),{},te()({},d,y))}return e},swapSettings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ACCOUNT_PLUGIN_SETTINGS_LOADED":return t.payload.swapSettings;case"ACCOUNT_SWAP_SETTINGS_CHANGED":var r=t.payload,n=r.pluginId,o=r.swapSettings,i=Xs({},e);return i[n]=o,i}return e},userSettings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ACCOUNT_PLUGIN_SETTINGS_CHANGED":var r=t.payload,n=r.pluginId,o=r.userSettings,i=Xs({},e);return i[n]=o,i;case"ACCOUNT_PLUGIN_SETTINGS_LOADED":return t.payload.userSettings}return e}}),ec=Fs(Qs,(function(e,t){return/^ACCOUNT_/.test(e.type)&&null!=e.payload&&e.payload.accountId===t.id||"LOGIN"===e.type&&t.root.lastAccountId===t.id?e:{type:"UPDATE_NEXT"}}));function tc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tc(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var nc=Mo({accountApi:function(e){return{destroy:function(){e.props.state={accounts:{}};var t=e.props.accountOutput;if(null!=t){var r=t.accountApi;if(null!=r){U(r),D(r),D(r.dataStore),D(r.rateCache);for(var n=r.currencyConfig,o=r.swapConfig,i=0,a=Object.keys(n);i<a.length;i++){D(n[a[i]])}for(var u=0,s=Object.keys(o);u<s.length;u++){D(o[s[u]])}}}},update:function(){return o()(t().mark((function r(){var n,i,a,u,s,c,f,l;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l=function(){return(l=o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([dr(n,a),Es(n,a),wr(n,a)]);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},f=function(){return l.apply(this,arguments)},n=$f(e),i=e.props,a=i.accountId,u=i.accountState,s=i.log,c=u.accountWalletInfos,r.prev=5,r.next=8,Ir(n);case 8:return r.next=10,bs(n,a);case 10:return s.warn("Login: currency plugins exist"),r.next=13,Promise.all(c.map((function(e){return li(n,e)})));case 13:return s.warn("Login: synced account repos"),r.next=16,f();case 16:s.warn("Login: loaded files"),e.onOutput(Ps(n,a)),s.warn("Login: complete"),r.next=24;break;case 21:r.prev=21,r.t0=r.catch(5),e.props.dispatch({type:"ACCOUNT_LOAD_FAILED",payload:{accountId:a,error:r.t0}});case 24:return r.abrupt("return",Ho);case 25:case"end":return r.stop()}}),r,null,[[5,21]])})))()}}},syncTimer:Lo((function(e){function r(){return r=o()(t().mark((function r(){var n,o,i,a,u,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=$f(e),i=e.props,a=i.accountId,u=i.accountState,s=u.accountWalletInfos,null!=e.props.state.accounts[a]){t.next=5;break}return t.abrupt("return");case 5:return t.next=7,Promise.all(s.map((function(e){return hi(o,e.id)})));case 7:if(c=t.sent,!(n=[]).concat.apply(n,lt()(c)).length){t.next=12;break}return t.next=12,Promise.all([wr(o,a),dr(o,a)]);case 12:case"end":return t.stop()}}),r)}))),r.apply(this,arguments)}function n(){return(n=o()(t().mark((function r(){var n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.accountId,t.next=3,zn($f(e),n);case 3:case"end":return t.stop()}}),r)})))).apply(this,arguments)}var i=$o((function(){return r.apply(this,arguments)}),3e4),a=$o((function(){return n.apply(this,arguments)}),3e4,{onError:function(t){var r=mt(t);null!=r&&e.props.onError(r)}});return{update:function(){var t=e.props.accountOutput;null!=t&&(null!=t.accountApi&&(i.start({wait:!0}),a.start({wait:!0})))},destroy:function(){i.stop(),a.stop()}}}),(function(e){return e.state.paused?void 0:e})),tokenSaver:function(e){var r=$s;return function(){var n=o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.props,i=o.accountId,a=o.accountState,(u=a.customTokens)===r||r===$s){t.next=7;break}return t.next=5,Cs($f(e),i).catch((function(t){return e.props.onError(t)}));case 5:return t.next=7,Qo(100);case 7:r=u;case 8:case"end":return t.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()},watcher:function(e){var t,r;return function(){var n=e.props,o=n.accountState,i=n.accountOutput;if(null!=o&&null!=i){var a=i.accountApi;if(null!=a&&U(a),t!==o&&(t=o,null!=a)){for(var u=a.currencyConfig,s=a.swapConfig,c=0,f=Object.keys(u);c<f.length;c++){U(u[f[c]])}for(var l=0,d=Object.keys(s);l<d.length;l++){U(s[d[l]])}}r!==e.props.state.exchangeCache&&(r=e.props.state.exchangeCache,null!=a&&L(a.rateCache,"update",void 0))}}},currencyWallets:function(e){var t;return function(){var r=e.props,n=r.accountOutput,o=r.accountState.activeWalletIds,i=t!==o;t=o;var a={};null!=n&&null!=n.currencyWallets&&(a=n.currencyWallets);for(var u={},s=e.props.output.currency.wallets,c=0;c<o.length;c++){var f,l=o[c],d=null===(f=s[l])||void 0===f?void 0:f.walletApi;d!==a[l]&&(i=!0),null!=d&&(u[l]=d)}i&&e.onOutput(u)}}}),oc=Uo(nc,(function(e){return e.state.accountIds}),(function(e,t){return rc(rc({},e),{},{accountId:t,accountState:e.state.accounts[t],accountOutput:e.output.accounts[t]})}));function ic(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ac(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ic(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ic(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uc(e){for(var t=e.props.state.login.stashes,r={},n=[],o=0,i=Object.keys(t);o<i.length;o++){var a=i[o],u=t[a].loginId;null!=u&&(r[p.stringify(u)]=a,n.push(u))}return Xr(e,"POST","/v2/messages",{loginIds:n}).then((function(e){for(var t={},n=0,o=Ve(e);n<o.length;n++){var i=o[n],a=i.loginId,u=Rs()(i,["loginId"]),s=p.stringify(a),c=r[s];null!=c&&(t[c]=ac(ac({},u),{},{loginId:s}))}return t}))}var sc=r(1506),cc=r.n(sc);function fc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$u()(e);if(t){var o=$u()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Zu()(this,r)}}var lc=function(e){Yu()(r,e);var t=fc(r);function r(e){var n;return me()(this,r),(n=t.call(this))._lobby=e,n._cleanups=[e.close,e.on("reply",(function(e){return U(cc()(n),"replies")})),e.on("error",(function(e){return L(cc()(n),"error",e)}))],n}return Ee()(r,[{key:"close",value:function(){this._cleanups.forEach((function(e){return e()})),D(this)}},{key:"lobbyId",get:function(){return this._lobby.lobbyId}},{key:"replies",get:function(){return this._lobby.replies}}]),r}(X),dc=function(e){Yu()(s,e);var r,n,i,a,u=fc(s);function s(e){var t;return me()(this,s),(t=u.call(this))._ai=e,t}return Ee()(s,[{key:"authRequest",value:function(e,t,r){return Xr(this._ai,e,t,r)}},{key:"hashUsername",value:function(e){return nn(this._ai,e)}},{key:"makeLobby",value:(a=o()(t().mark((function e(r){var n,o,i=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:1e3,e.next=3,Ou(this._ai,r,n);case 3:return o=e.sent,e.abrupt("return",new lc(o));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"fetchLobbyRequest",value:function(e){return ku(this._ai,e)}},{key:"sendLobbyReply",value:(i=o()(t().mark((function e(r,n,o){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bu(this._ai,r,n,o);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return i.apply(this,arguments)})},{key:"syncRepo",value:(n=o()(t().mark((function e(r){var n,o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._ai.props,o=n.io,i=n.syncClient,a=ri(o,r,new Uint8Array(0)),e.abrupt("return",ai(i,a,{lastSync:0,lastHash:void 0}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"getRepoDisklet",value:(r=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this._ai.props.io,A((i=ri(o,r,n)).disklet),e.abrupt("return",i.disklet);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),s}(X);function hc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var yc=Mo({api:function(e){return{destroy:function(){D(e.props.output.context.api)},update:function(){return e.onOutput(function(e){var r,n=e.props.state.login.appId,i=new dc(e),a={on:J,watch:Z,appId:n,close:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.props.close();case 1:case"end":return t.stop()}}),r)})))()},$internalStuff:i,fixUsername:xe,get localUsers(){return e.props.state.login.localUsers},listUsernames:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object.keys(e.props.state.login.stashes));case 1:case"end":return t.stop()}}),r)})))()},deleteLocalAccount:function(r){return o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=xe(r),i=0,a=e.props.state.accountIds;case 2:if(!(i<a.length)){t.next=9;break}if(u=a[i],e.props.state.accounts[u].username!==o){t.next=6;break}throw new Error("Cannot remove logged-in user");case 6:i++,t.next=2;break;case 9:return t.abrupt("return",un(e,r));case 10:case"end":return t.stop()}}),n)})))()},usernameAvailable:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",nu(e,r));case 1:case"end":return t.stop()}}),n)})))()},createAccount:function(r,i,a){var u=arguments;return o()(t().mark((function o(){var s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=u.length>3&&void 0!==u[3]?u[3]:{},t.next=3,iu(e,r,s,{password:i,pin:a});case 3:return c=t.sent,t.abrupt("return",hu(e,n,c,"newAccount",s));case 5:case"end":return t.stop()}}),o)})))()},loginWithKey:function(r,i){var a=arguments;return o()(t().mark((function o(){var u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>2&&void 0!==a[2]?a[2]:{},s=u.now,c=void 0===s?new Date:s,f=en(e,r),l=Dn(f,at(i),n),f.lastLogin=c,cn(e,f).catch((function(){})),Vn(e,l,su(l,n)).catch((function(t){return e.props.onError(t)})),t.abrupt("return",hu(e,n,l,"keyLogin",u));case 8:case"end":return t.stop()}}),o)})))()},loginWithPassword:function(r,i){var a=arguments;return o()(t().mark((function o(){var u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>2&&void 0!==a[2]?a[2]:{},t.next=3,Ui(e,r,i,u);case 3:return s=t.sent,t.abrupt("return",hu(e,n,s,"passwordLogin",u));case 5:case"end":return t.stop()}}),o)})))()},checkPasswordRules:Ce,pinLoginEnabled:function(r){return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=en(e,r),t.abrupt("return",null!=Xi(i,n));case 2:case"end":return t.stop()}}),o)})))()},loginWithPIN:function(r,i){var a=arguments;return o()(t().mark((function o(){var u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>2&&void 0!==a[2]?a[2]:{},t.next=3,$i(e,n,r,i,u);case 3:return s=t.sent,t.abrupt("return",hu(e,n,s,"pinLogin",u));case 5:case"end":return t.stop()}}),o)})))()},loginWithRecovery2:function(r,i,a){var u=arguments;return o()(t().mark((function o(){var s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=u.length>3&&void 0!==u[3]?u[3]:{},t.next=3,ha(e,at(r),i,a,s);case 3:return c=t.sent,t.abrupt("return",hu(e,n,c,"recoveryLogin",s));case 5:case"end":return t.stop()}}),o)})))()},fetchRecovery2Questions:function(r,n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",ya(e,at(r),n));case 1:case"end":return t.stop()}}),o)})))()},listRecoveryQuestionChoices:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ea(e));case 1:case"end":return t.stop()}}),r)})))()},requestEdgeLogin:function(r){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Du(e,n,r));case 1:case"end":return t.stop()}}),o)})))()},requestOtpReset:function(r,n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Sn(e,r,n));case 1:case"end":return t.stop()}}),o)})))()},fetchLoginMessages:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",uc(e));case 1:case"end":return t.stop()}}),r)})))()},get paused(){return e.props.state.paused},changePaused:function(n){var i=arguments;return o()(t().mark((function o(){var a,u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=i.length>1&&void 0!==i[1]?i[1]:{},u=a.secondsDelay,s=void 0===u?0:u,null!=r&&(clearTimeout(r),r=void 0),e.props.state.paused!==n){t.next=5;break}return t.abrupt("return");case 5:0===s?e.props.dispatch({type:"PAUSE",payload:n}):r=setTimeout((function(){r=void 0,e.props.dispatch({type:"PAUSE",payload:n})}),1e3*s);case 6:case"end":return t.stop()}}),o)})))()},get logSettings(){return e.props.state.logSettings},changeLogSettings:function(r){return o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=pc(pc({},e.props.state.logSettings),r),e.props.dispatch({type:"CHANGE_LOG_SETTINGS",payload:o});case 2:case"end":return t.stop()}}),n)})))()}};return A(a),a}(e)),Ho}}},watcher:function(e){var t,r,n;return function(){t===e.props.state.login.localUsers&&r===e.props.state.paused&&n===e.props.state.logSettings||(t=e.props.state.login.localUsers,r=e.props.state.paused,n=e.props.state.logSettings,null!=e.props.output.context.api&&U(e.props.output.context.api))}}}),bc=500,vc=3,gc=[];function mc(e){gc.length<=0&&wc();for(var t=!1,r=0;r<gc.length;r++){var n=gc[r];if(n.id===e.id&&n.action===e.action){n.updateFunc=e.updateFunc,t=!0;break}}t||gc.push(e)}function wc(){setTimeout((function(){for(var e=Math.min(vc,gc.length),t=0;t<e;t++){var r=gc.shift();null!=r&&r.updateFunc()}gc.length>0&&wc()}),bc)}var Ec=r(3546);function _c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xc(e,t){var r=Ic(e);return"number"==typeof e.amountFiat&&(r.exchangeAmount[t]=e.amountFiat),r}var Sc=be("high","standard","low"),Ac=de({orderId:he(pe),orderUri:he(pe),isEstimate:oe,plugin:de({pluginId:pe,displayName:pe,supportEmail:he(pe)}),payoutAddress:pe,payoutCurrencyCode:pe,payoutNativeAmount:pe,payoutWalletId:pe,refundAddress:he(pe)}),Ic=de({bizId:he(le),category:he(pe),exchangeAmount:he(se(le),{}),name:he(pe),notes:he(pe)}),Oc=ne(pe),Tc=de({txid:pe,internal:oe,creationDate:le,currencies:se(de({metadata:Ic,nativeAmount:he(pe),providerFeeSent:he(pe)})),deviceDescription:he(pe),feeRateRequested:he(ue(Sc,Kt)),feeRateUsed:he(Kt),payees:he(ne(de({address:pe,amount:pe,currency:pe,tag:he(pe)}))),secret:he(pe),swap:he(Ac)}),kc=de({airbitzFeeWanted:le,meta:de({amountFeeAirBitzSatoshi:le,balance:le,fee:le,amountCurrency:le,bizId:le,category:pe,name:pe,notes:pe,attributes:le,amountSatoshi:le,amountFeeMinersSatoshi:le,airbitzFee:le}),ntxid:pe,state:de({creationDate:le,internal:oe,malleableTxId:pe})}),Pc=de({seq:le,address:pe,state:de({recycleable:he(oe,!0),creationDate:he(le,0)}),meta:de({amountSatoshi:he(le,0)}).withRest}),Bc=se(de({timestamp:le,txidHash:pe})),Rc=de({walletInfo:de({id:pe,keys:Kt,type:pe})}),jc=de({fiat:he(pe),num:he(le)}),Mc=de({walletName:ue(pe,fe)}),Nc="Currency.json",Dc="EnabledTokens.json",Lc="fixedLegacyFileNames.json",Uc="WalletName.json",Hc=Ht(Oc),Kc=Ht(Pc),Fc=Ht(Bc),Gc=Ht(kc),qc=Ht(Tc),zc=Ht(jc),Wc=Ht(Mc);function Vc(e,t){return Yc.apply(this,arguments)}function Yc(){return(Yc=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.state,a=o.walletId,u=Gt(i,a),e.next=4,Hc.save(u,Dc,n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jc(e,t,r){var n={creationDate:e.state.creationDate,currencies:{},internal:e.state.internal,txid:e.state.malleableTxId},o={};return o[r]=e.meta.amountCurrency,n.currencies[t]={metadata:{bizId:e.meta.bizId,category:e.meta.category,exchangeAmount:o,name:e.meta.name,notes:e.meta.notes},providerFeeSent:e.meta.amountFeeAirBitzSatoshi.toFixed()},n}function Zc(e,t,r,n){var o=Wt(e,t,n);return{fileName:"".concat(r.toFixed(0),"-").concat(o,".json"),txidHash:o}}function Xc(e,t){return $c.apply(this,arguments)}function $c(){return($c=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.state,u=o.walletId,s=Gt(a,u),e.next=4,Wc.save(s,Uc,{walletName:n});case 4:i({type:"CURRENCY_WALLET_NAME_CHANGED",payload:{name:n,walletId:u}});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qc(e,t){return ef.apply(this,arguments)}function ef(){return(ef=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.props,i=o.dispatch,a=o.state,u=o.walletId,s=Gt(a,u),/^iso:/.test(n)){e.next=4;break}throw new TypeError("Fiat currency codes must start with `iso:`");case 4:return e.next=6,zc.save(s,Nc,{fiat:n,num:void 0});case 6:i({type:"CURRENCY_WALLET_FIAT_CHANGED",payload:{fiatCurrencyCode:n,walletId:u}});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tf(e){return rf.apply(this,arguments)}function rf(){return(rf=o()(t().mark((function e(r){var n,o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,a=n.walletId,u=Gt(i,a),e.next=4,Hc.load(u,Dc);case 4:if(null!=(s=e.sent)){e.next=7;break}return e.abrupt("return");case 7:o({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:r.props.walletId,currencyCodes:s}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nf(e){return of.apply(this,arguments)}function of(){return(of=o()(t().mark((function e(r){var n,o,i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,a=n.walletId,u=Gt(i,a),e.next=4,zc.load(u,Nc);case 4:s=e.sent,c="iso:USD",null!=s&&(null!=s.fiat?c=s.fiat:null!=s.num&&(c="iso:".concat((0,Ec.Rx)("000".concat(s.num).slice(-3)).code))),o({type:"CURRENCY_WALLET_FIAT_CHANGED",payload:{fiatCurrencyCode:c,walletId:a}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function af(e){return uf.apply(this,arguments)}function uf(){return(uf=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,a=n.walletId,u=Gt(i,a),e.next=4,Wc.load(u,Uc);case 4:if(s=e.sent,c=null,null!=s&&null!=s.walletName){e.next=17;break}if(f=r.props.walletState.walletInfo.appIds,null==(l=(void 0===f?[]:f).find((function(e){return""!==e})))){e.next=15;break}return e.next=12,Ku($f(r),l);case 12:d=e.sent,h=d.displayName,c=h;case 15:e.next=18;break;case 17:c=s.walletName;case 18:o({type:"CURRENCY_WALLET_NAME_CHANGED",payload:{name:"string"==typeof c?c:null,walletId:a}});case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sf(e,t){return cf.apply(this,arguments)}function cf(){return cf=o()(t().mark((function e(r,n){var i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.walletId,a=Gt(r.props.state,i),u=r.props.dispatch,s=r.props.walletState.currencyInfo.currencyCode,c=r.props.walletState.fileNames,f=r.props.walletState.fiat,l={},e.next=9,Promise.all(n.map(function(){var e=o()(t().mark((function e(r){var n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=c[r]){e.next=2;break}return e.abrupt("return");case 2:return n="Transactions/".concat(c[r].fileName),e.next=5,Gc.load(a,n);case 5:if(null!=(o=e.sent)){e.next=8;break}return e.abrupt("return");case 8:l[r]=Jc(o,s,f);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:return e.next=11,Promise.all(n.map(function(){var e=o()(t().mark((function e(r){var n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=c[r]){e.next=2;break}return e.abrupt("return");case 2:return n="transaction/".concat(c[r].fileName),e.next=5,qc.load(a,n);case 5:if(null!=(o=e.sent)){e.next=8;break}return e.abrupt("return");case 8:l[r]=o;case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:return u({type:"CURRENCY_WALLET_FILES_LOADED",payload:{files:l,walletId:i}}),e.abrupt("return",l);case 13:case"end":return e.stop()}}),e)}))),cf.apply(this,arguments)}function ff(e,t,r){return lf.apply(this,arguments)}function lf(){return lf=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,d,h,p,y,b,v;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=qt(r,n),e.next=3,Fc.load(u,Lc);case 3:if(e.t1=a=e.sent,e.t0=null!==e.t1,!e.t0){e.next=7;break}e.t0=void 0!==a;case 7:if(!e.t0){e.next=11;break}e.t2=a,e.next=12;break;case 11:e.t2={};case 12:return s=e.t2,e.t3=Q.gQ,e.next=16,i.list();case 16:for(e.t4=e.sent,c=(0,e.t3)(e.t4),f={},l=[],d=0;d<c.length;d++)h=c[d],(p=s[h])?(y=p.timestamp,b=p.txidHash,f[b]={creationDate:y,fileName:h}):l.push(h);if(v=l.map(function(){var e=o()(t().mark((function e(o){var a,u,c,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Gc.load(i,o);case 2:if(null!=(a=e.sent)){e.next=5;break}return e.abrupt("return");case 5:u=a.state,c=u.creationDate,l=u.malleableTxId,d=o,h=Wt(r,n,l),f[h]={creationDate:c,fileName:d},s[d]={timestamp:c,txidHash:h};case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!v.length){e.next=27;break}return e.next=25,Promise.all(v);case 25:return e.next=27,Fc.save(u,Lc,s).catch((function(){}));case 27:return e.abrupt("return",f);case 28:case"end":return e.stop()}}),e)}))),lf.apply(this,arguments)}function df(e){return hf.apply(this,arguments)}function hf(){return(hf=o()(t().mark((function e(r){var n,o,i,u,s,c,f,l,d,h,p,y,b,v,g,m;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,u=n.walletId,s=Gt(i,u),e.next=4,ff(i,u,(0,Q.HN)(s,"Transactions"));case 4:return c=e.sent,e.next=7,(0,Q.HN)(s,"transaction").list();case 7:for(f=e.sent,l=0,d=(0,Q.gQ)(f);l<d.length;l++)h=d[l],p=h.split(".json")[0],y=p.split("-"),b=a()(y,2),v=b[0],g=b[1],m=parseInt(v),(null==c[g]||m<c[g].creationDate)&&(c[g]={creationDate:m,fileName:h});o({type:"CURRENCY_WALLET_FILE_NAMES_LOADED",payload:{txFileNames:c,walletId:u}});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pf(e){return yf.apply(this,arguments)}function yf(){return yf=o()(t().mark((function e(r){var n,i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props,a=i.state,u=i.walletId,s=Gt(a,u),c=[],e.t0=Q.gQ,e.next=6,s.list("Addresses");case 6:return e.t1=e.sent,f=(0,e.t0)(e.t1),e.next=10,Promise.all(f.map(function(){var e=o()(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kc.load(s,r);case 2:if(null!=(n=e.sent)){e.next=5;break}return e.abrupt("return");case 5:if(""!==n.address&&!n.state.recycleable){e.next=7;break}return e.abrupt("return");case 7:c.push(n.address);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 10:if(null==(l=null===(n=r.props.walletOutput)||void 0===n?void 0:n.engine)){e.next=14;break}return e.next=14,l.addGapLimitAddresses(c);case 14:case"end":return e.stop()}}),e)}))),yf.apply(this,arguments)}function bf(e){return vf.apply(this,arguments)}function vf(){return(vf=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,tf(r);case 2:return e.next=4,nf(r);case 4:return e.next=6,af(r);case 6:return e.next=8,df(r);case 8:return e.next=10,pf(r);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gf(e,t,r,n,o){return mf.apply(this,arguments)}function mf(){return(mf=o()(t().mark((function e(r,n,o,i,a){var u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=r.props,s=u.dispatch,c=u.state,f=u.walletId,l=Gt(c,f),d=r.props.walletState.txs[n]){e.next=5;break}throw new Error("Setting metatdata for missing tx ".concat(n));case 5:h=r.props.walletState.files,p="",y=0,b=Object.keys(h);case 8:if(!(y<b.length)){e.next=16;break}if(v=b[y],h[v].txid!==n){e.next=13;break}return p=v,e.abrupt("break",16);case 13:y++,e.next=8;break;case 16:return g=r.props.walletState.files[p],m=null==g?Date.now()/1e3:g.creationDate,w=Zc(c,f,m,n),E=w.fileName,_=w.txidHash,(C={txid:n,internal:!1,creationDate:m,currencies:{}}).currencies[o]={metadata:i},x=Lt(g,C),s({type:"CURRENCY_WALLET_FILE_CHANGED",payload:{creationDate:m,fileName:E,json:x,txid:n,txidHash:_,walletId:f}}),e.next=25,qc.save(l,"transaction/"+E,x);case 25:S=Hf(r,d,x,o),a.onTransactionsChanged([S]);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wf(e,t){return Ef.apply(this,arguments)}function Ef(){return(Ef=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S,A;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.walletState,u=o.state,s=o.walletId,c=a.accountId,f=a.fiat,l=void 0===f?"iso:USD":f,d=a.pluginId,h=n.currencyCode,p=n.spendTargets,y=n.swapData,b=n.txid,v=Gt(u,s),g=Date.now()/1e3,m=ki(u,h,l,(function(){return 1}))/parseFloat(_r(te()({},d,r.props.state.plugins.currency[d]),r.props.state.accounts[c].customTokens[d],h)),w=n.nativeAmount,E=m*Number(w),(_=null!=n.metadata?xc(n.metadata,l):{exchangeAmount:{}}).exchangeAmount[l]=E,(C={txid:b,internal:!0,creationDate:g,currencies:{},swap:y}).currencies[h]={metadata:_,nativeAmount:w},null!=n.networkFeeOption&&(C.feeRateRequested="custom"===n.networkFeeOption?n.requestedCustomFee:n.networkFeeOption),C.feeRateUsed=n.feeRateUsed,null!=p&&(C.payees=p.map((function(e){return{currency:e.currencyCode,address:e.publicAddress,amount:e.nativeAmount,tag:e.memo}})),null!=n.deviceDescription&&(C.deviceDescription=n.deviceDescription)),"string"==typeof n.txSecret&&(C.secret=n.txSecret),x=Zc(u,s,g,b),S=x.fileName,A=x.txidHash,i({type:"CURRENCY_WALLET_FILE_CHANGED",payload:{creationDate:g,fileName:S,json:C,txid:b,txidHash:A,walletId:s}}),e.next=20,qc.save(v,"transaction/"+S,C);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_f(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xf=[],Sf=Us({accountId:function(e,t,r){if(null!=e)return e;for(var n=0,o=Object.keys(r.root.accounts);n<o.length;n++)for(var i=o[n],a=r.root.accounts[i],u=0,s=Object.keys(a.walletInfos);u<s.length;u++){if(s[u]===r.id)return i}throw new Error("Cannot find account for walletId ".concat(r.id))},pluginId:Ws((function(e){return e.root.login.walletInfos[e.id].type}),(function(e){return e.root.plugins.currency}),(function(e,t){return xr(t,e)})),paused:function(e,t,r){return null==e?r.root.accounts[r.self.accountId].pauseWallets:"CURRENCY_WALLET_CHANGED_PAUSED"===t.type?t.payload.paused:e},currencyInfo:function(e,t,r){if(e)return e;var n=r.self.pluginId;return r.root.plugins.currency[n].currencyInfo},displayPrivateSeed:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_SEEDS"===t.type?t.payload.displayPrivateSeed:e},displayPublicSeed:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_SEEDS"===t.type?t.payload.displayPublicSeed:e},enabledTokenIds:Ws((function(e){return e.root.accounts[e.self.accountId].builtinTokens[e.self.pluginId]}),(function(e){return e.root.accounts[e.self.accountId].customTokens[e.self.pluginId]}),(function(e){return e.self.currencyInfo}),(function(e){return e.self.enabledTokens}),(function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>3?arguments[3]:void 0,n=Qu(e),o=Qu(t),i=[],a=0;a<r.length;a++){var u,s=r[a],c=null!==(u=o[s])&&void 0!==u?u:n[s];null!=c&&i.push(c)}return i})),enabledTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xf,t=arguments.length>1?arguments[1]:void 0;if("CURRENCY_WALLET_ENABLED_TOKENS_CHANGED"===t.type){var r=t.payload.currencyCodes;if(r.sort((function(e,t){return e===t?0:e>t?1:-1})),!Ys(r,e))return r}return e},engineFailure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_FAILED"===t.type?t.payload.error:e},engineStarted:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_STARTED"===t.type||"CURRENCY_ENGINE_STOPPED"!==t.type&&e},fiat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_FIAT_CHANGED"===t.type?t.payload.fiatCurrencyCode:e},fiatLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_FIAT_CHANGED"===t.type||e},files:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CURRENCY_WALLET_FILE_CHANGED":var r=t.payload,n=r.json,o=r.txidHash,i=Cf({},e);return i[o]=n,i;case"CURRENCY_WALLET_FILES_LOADED":var a=t.payload.files;return Cf(Cf({},e),a)}return e},sortedTransactions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{txidHashes:{},sortedList:[]},t=arguments.length>1?arguments[1]:void 0,r=e.txidHashes;switch(t.type){case"CURRENCY_ENGINE_CHANGED_TXS":return Af(r,t.payload.txidHashes);case"CURRENCY_WALLET_FILE_NAMES_LOADED":for(var n=t.payload.txFileNames,o={},i=0,a=Object.keys(n);i<a.length;i++){var u=a[i];o[u]=n[u].creationDate}return Af(r,o)}return e},fileNames:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CURRENCY_WALLET_FILE_NAMES_LOADED":var r=t.payload.txFileNames;return Cf(Cf({},e),r);case"CURRENCY_WALLET_FILE_CHANGED":var n=t.payload,o=n.fileName,i=n.creationDate,a=n.txidHash;return(!e[a]||i<e[a].creationDate)&&(e[a]={creationDate:i,fileName:o}),e}return e},fileNamesLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_FILE_NAMES_LOADED"===t.type||e},syncRatio:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CURRENCY_ENGINE_CHANGED_SYNC_RATIO":return t.payload.ratio;case"CURRENCY_ENGINE_CLEARED":return 0}return e},balances:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("CURRENCY_ENGINE_CHANGED_BALANCE"===t.type){var r=Cf({},e);return r[t.payload.currencyCode]=t.payload.balance,r}return e},height:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_HEIGHT"===t.type?t.payload.height:e},name:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_NAME_CHANGED"===t.type?t.payload.name:e},nameLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_NAME_CHANGED"===t.type||e},stakingStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{stakedAmounts:[]},t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_STAKING"===t.type?t.payload.stakingStatus:e},txids:Ws((function(e){return e.self.txs}),(function(e){return Object.keys(e)})),txs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;switch(t.type){case"CURRENCY_ENGINE_CHANGED_TXS":for(var n=t.payload.txs,o=r.self.currencyInfo.currencyCode,i=Cf({},e),a=0;a<n.length;a++){var u=n[a];i[u.txid]=Tf(u,o,i[u.txid])}return i;case"CURRENCY_ENGINE_CLEARED":return{}}return e},gotTxs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_GOT_TXS"===t.type&&(e[t.payload.currencyCode]=!0),e},walletInfo:function(e,t,r){return r.root.login.walletInfos[r.id]},publicWalletInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_PUBLIC_INFO"===t.type?t.payload.walletInfo:e}});function Af(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r],i=t[o];(!e[o]||i<e[o])&&(e[o]=i)}return{sortedList:Object.keys(e).sort((function(t,r){return e[t]>e[r]?-1:e[t]<e[r]?1:0})),txidHashes:e}}var If=Fs(Sf,(function(e,t){return/^CURRENCY_/.test(e.type)&&null!=e.payload&&e.payload.walletId===t.id?e:{type:"UPDATE_NEXT"}})),Of={blockHeight:0,date:0,ourReceiveAddresses:[],signedTx:"",txid:"",nativeAmount:{},networkFee:{},providerFee:{}};function Tf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Of,n={blockHeight:e.blockHeight,date:e.date,ourReceiveAddresses:e.ourReceiveAddresses,signedTx:e.signedTx,txid:e.txid,otherParams:e.otherParams,nativeAmount:Cf({},r.nativeAmount),networkFee:Cf({},r.networkFee)},o=null!=e.currencyCode?e.currencyCode:t;return n.nativeAmount[o]=e.nativeAmount,n.networkFee[o]=null!=e.networkFee?e.networkFee.toString():"0",null!=e.parentNetworkFee&&(n.networkFee[t]=String(e.parentNetworkFee)),n}var kf=5e3;function Pf(e,t){var r=e.props,n=r.log,o=r.walletId,i=!1,a=0,u=[];return function(e){if(i){var r;n("throttledTxCallback delay, walletId: ".concat(o)),(r=u).push.apply(r,lt()(e))}else{var s=Date.now();s-a>kf?(a=s,t(e)):(n("throttledTxCallback delay, walletId: ".concat(o)),i=!0,u=e,setTimeout((function(){a=Date.now(),t(u),i=!1,u=[]}),kf))}}}function Bf(e){var t=e.props.walletId;"narfavJN4rp9ZzYigcRj1i0vrU2OAGGp4+KksAksj54="===t&&(kf=25,vc=99,bc=1);var r=Pf(e,(function(t){null!=e.props.walletOutput&&null!=e.props.walletOutput.walletApi&&L(e.props.walletOutput.walletApi,"transactionsChanged",t)})),n=Pf(e,(function(t){null!=e.props.walletOutput&&null!=e.props.walletOutput.walletApi&&L(e.props.walletOutput.walletApi,"newTransactions",t)}));return{onAddressesChecked:function(r){mc({id:t,action:"onAddressesChecked",updateFunc:function(){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_SYNC_RATIO",payload:{ratio:r,walletId:t}})}})},onBalanceChanged:function(r,n){mc({id:"".concat(t,"==").concat(r),action:"onBalanceChanged",updateFunc:function(){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_BALANCE",payload:{balance:n,currencyCode:r,walletId:t}})}})},onBlockHeightChanged:function(r){mc({id:t,action:"onBlockHeightChanged",updateFunc:function(){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_HEIGHT",payload:{height:r,walletId:t}})}})},onStakingStatusChanged:function(r){mc({id:t,action:"onStakingStatusChanged",updateFunc:function(){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_STAKING",payload:{stakingStatus:r,walletId:t}})}})},onTransactionsChanged:function(o){if(o){for(var i=0;i<o.length;i++){var a=o[i];if("string"!=typeof a.txid||"number"!=typeof a.date||"string"!=typeof a.networkFee||"number"!=typeof a.blockHeight||"string"!=typeof a.nativeAmount||"object"!==Nt()(a.ourReceiveAddresses))return void e.props.onError(new Error("Plugin sent bogus tx: ".concat(JSON.stringify(a,null,2))))}for(var u=e.props.state,s=e.props.walletState,c=s.fileNames,f=s.fileNamesLoaded,l=s.txs,d=e.props.walletState.currencyInfo.currencyCode,h={},p=[],y=[],b=0;b<o.length;b++){var v=o[b],g=v.txid,m=Tf(v,d,l[g]);if(!Ys(m,l[g])){var w=Wt(u,t,g),E=null!=v.spendTargets||f&&null==c[w];E&&wf(e,v).catch((function(t){return e.props.onError(t)}));var _=e.props.walletState.files,C=Hf(e,m,_[w],v.currencyCode);E?y.push(C):null!=_[w]&&p.push(C),h[w]=C.date}}e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_TXS",payload:{txs:o,walletId:t,txidHashes:h}}),p.length&&r(p),y.length&&n(y)}},onAddressChanged:function(){L(e.props.walletOutput.walletApi,"addressChanged",void 0)},onWcNewContractCall:function(t){L(e.props.walletOutput.walletApi,"wcNewContractCall",t)},onTxidsChanged:function(){}}}function Rf(e){var t,r=e.props.walletId;!function n(o){var i=function(e,t){return e.storageWallets[t].lastChanges}(o.state,r);i!==t&&(t=i,bf(e).catch((function(t){return e.props.onError(t)}))),e.nextProps().then(n).catch((function(t){(function(e){return e instanceof Error&&"PixieShutdownError"===e.name})(t)||e.props.onError(t)}))}(e.props)}function jf(e,t){var r=t.startDate,n=void 0===r?-1/0:r,o=t.endDate,i=void 0===o?Date.now():o;return 1e3*e.date>=n&&1e3*e.date<i}function Mf(e,t){var r=t.searchString;if(null!=r&&""!==r){for(var n=function(e){return null!=e&&("string"==typeof e||"number"==typeof e)&&!(e.toString().toLowerCase().replace(".","").replace(",","").indexOf(o)<0)},o=r.toLowerCase().replace(".","").replace(",",""),i=0;i<o.length;i++)if("0"!==o[i]){o=o.substring(i);break}if(n(e.nativeAmount))return!0;if(null!=e.metadata){var a=e.metadata,u=a.category,s=void 0===u?"":u,c=a.name,f=void 0===c?"":c,l=a.notes,d=void 0===l?"":l,h=a.exchangeAmount,p=void 0===h?{}:h;if(n(s)||n(f)||n(d)||null!=e.wallet&&n(p[e.wallet.fiatCurrencyCode]))return!0}if(null!=e.swapData&&null!=e.swapData.plugin){var y=e.swapData.plugin,b=y.displayName,v=void 0===b?"":b,g=y.pluginId,m=void 0===g?"":g;if(n(v)||n(m))return!0}if(null!=e.spendTargets)for(var w=0,E=e.spendTargets;w<E.length;w++){var _=E[w],C=_.publicAddress,x=void 0===C?"":C,S=_.memo,A=void 0===S?"":S;if(n(x)||n(A))return!0}if(e.ourReceiveAddresses.length>0)for(var I=0,O=e.ourReceiveAddresses;I<O.length;I++){if(n(O[I]))return!0}return!!n(e.txid)}return!0}function Nf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Df(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nf(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Lf={bizId:0,category:"",exchangeAmount:{},name:"",notes:""};function Uf(e,r,n,i){var a=$f(e),u=e.props.walletState,s=u.accountId,c=u.pluginId,f=u.walletInfo,l=e.props.state.plugins.currency[c],d=Oa(a,f),h=Bf(e),p={};function y(){if(a.props.state.hideKeys)throw new Error("Not available when `hideKeys` is enabled")}null!=r.otherMethods&&A(p=r.otherMethods);var b={on:J,watch:Z,get id(){return d.id},get type(){return d.type},get keys(){return y(),d.keys},publicWalletInfo:i,get disklet(){return d.disklet},get localDisklet(){return d.localDisklet},sync:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.sync();case 2:case"end":return e.stop()}}),e)})))()},get displayPrivateSeed(){return y(),e.props.walletState.displayPrivateSeed},get displayPublicSeed(){return e.props.walletState.displayPublicSeed},get name(){return e.props.walletState.name},renameWallet:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Xc(e,r);case 2:case"end":return t.stop()}}),n)})))()},get currencyConfig(){return e.props.output.accounts[s].accountApi.currencyConfig[c]},get currencyInfo(){return l.currencyInfo},validateMemo:function(e){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=n.validateMemo){t.next=2;break}return t.abrupt("return",{passed:!0});case 2:return t.next=4,n.validateMemo(e);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),r)})))()},nativeToDenomination:function(r,n){return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=_r(te()({},c,e.props.state.plugins.currency[c]),e.props.state.accounts[s].customTokens[c],n),t.abrupt("return",Ha(r,i,i.length));case 2:case"end":return t.stop()}}),o)})))()},denominationToNative:function(r,n){return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=_r(te()({},c,e.props.state.plugins.currency[c]),e.props.state.accounts[s].customTokens[c],n),t.abrupt("return",La(r,i));case 2:case"end":return t.stop()}}),o)})))()},get fiatCurrencyCode(){return e.props.walletState.fiat},setFiatCurrencyCode:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qc(e,r);case 2:case"end":return t.stop()}}),n)})))()},get balances(){return e.props.walletState.balances},get blockHeight(){return e.props.walletState.height},get syncRatio(){return e.props.walletState.syncRatio},get paused(){return e.props.walletState.paused},changePaused:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.props.dispatch({type:"CURRENCY_WALLET_CHANGED_PAUSED",payload:{walletId:e.props.walletId,paused:r}});case 1:case"end":return t.stop()}}),n)})))()},get enabledTokenIds(){return e.props.walletState.enabledTokenIds},changeEnabledTokenIds:function(r){return o()(t().mark((function n(){var o,i,a,u,f,l,d,h,p;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.state,u=o.walletId,f=o.walletState,l=a.accounts[s],d=l.builtinTokens,h=l.customTokens,p=f.currencyInfo,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:u,currencyCodes:ts(es(d[c],h[c],p,r))}});case 4:case"end":return t.stop()}}),n)})))()},changeEnabledTokens:function(r){return o()(t().mark((function n(){var o,i,a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.walletId,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:a,currencyCodes:ts(r)}});case 2:case"end":return t.stop()}}),n)})))()},enableTokens:function(r){return o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.walletId,u=o.walletState,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:a,currencyCodes:ts([].concat(lt()(u.enabledTokens),lt()(r)))}});case 2:case"end":return t.stop()}}),n)})))()},disableTokens:function(r){return o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.walletId,u=o.walletState,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:a,currencyCodes:ts(u.enabledTokens,r)}});case 2:case"end":return t.stop()}}),n)})))()},getEnabledTokens:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.props.walletState.enabledTokens);case 1:case"end":return t.stop()}}),r)})))()},addCustomToken:function(e){return o()(t().mark((function o(){var i,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(f=void 0,l=void 0,d=void 0,f=(o=e).currencyCode,l=o.currencyName,d=o.contractAddress,i={currencyCode:f,denominations:[{multiplier:o.multiplier,name:f}],displayName:l,networkLocation:{contractAddress:d}},u=ls(e.contractAddress),null==n.getTokenId){t.next=7;break}return t.next=5,n.getTokenId(i);case 5:t.next=9;break;case 7:return t.next=9,r.addCustomToken(Df(Df({},i),e));case 9:a.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_ADDED",payload:{accountId:s,pluginId:c,tokenId:u,token:i}});case 10:case"end":return t.stop()}var o,f,l,d}),o)})))()},getNumTransactions:function(){var e=arguments;return o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:{},t.abrupt("return",r.getNumTransactions(o));case 2:case"end":return t.stop()}}),n)})))()},getTransactions:function(){var n=arguments;return o()(t().mark((function o(){var i,a,u,s,c,f,d,p,y,b,v,g,m,w,E,_,C,x,S,A,I,O,T,k,P,B;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n.length>0&&void 0!==n[0]?n[0]:{},a=i.currencyCode,u=void 0===a?l.currencyInfo.currencyCode:a,(s=e.props.walletState).gotTxs[u]){t.next=10;break}return t.next=6,r.getTransactions({currencyCode:i.currencyCode});case 6:c=t.sent,h.onTransactionsChanged(c),e.props.dispatch({type:"CURRENCY_ENGINE_GOT_TXS",payload:{walletId:e.props.walletId,currencyCode:u}}),s=e.props.walletState;case 10:f=s.txids,d=s.txs,p=i.startIndex,y=void 0===p?0:p,b=i.startEntries,v=void 0===b?f.length:b,g=s.files,m=s.sortedTransactions.sortedList,w={},m.forEach((function(e,t){w[e]=t})),E=0,_=0,C=[];case 20:if(!(E<v)){t.next=48;break}if(0!==(x=m.slice(y+v*_,y+v*(_+1))).length){t.next=24;break}return t.abrupt("break",48);case 24:return S=x.filter((function(e){return!g[e]})),t.next=27,sf(e,S);case 27:A=t.sent,Object.assign(g,A),I=0;case 30:if(!(I<x.length)){t.next=45;break}if(O=x[I],null!=(T=g[O])){t.next=35;break}return t.abrupt("continue",42);case 35:if((k=d[T.txid])&&(k.nativeAmount[u]||k.networkFee[u])){t.next=38;break}return t.abrupt("continue",42);case 38:P=Df(Df({},k),{},{unfilteredIndex:w[O]}),Mf(B=Hf(e,P,T,u),i)&&jf(B,i)&&C.push(B),E++;case 42:I++,t.next=30;break;case 45:_++,t.next=20;break;case 48:return t.abrupt("return",C);case 49:case"end":return t.stop()}}),o)})))()},getReceiveAddress:function(){var e=arguments;return o()(t().mark((function n(){var o,i,a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:{},t.next=3,r.getFreshAddress(o);case 3:return i=t.sent,a={metadata:Lf,nativeAmount:"0",publicAddress:i.publicAddress,legacyAddress:i.legacyAddress,segwitAddress:i.segwitAddress},t.abrupt("return",a);case 6:case"end":return t.stop()}}),n)})))()},saveReceiveAddress:function(e){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},lockReceiveAddress:function(e){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},makeSpend:function(n){return o()(t().mark((function o(){var i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S,A,I,O,T,k,P;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.props.walletState.currencyInfo,a=n.currencyCode,u=void 0===a?i.currencyCode:a,s=n.privateKeys,c=n.spendTargets,f=void 0===c?[]:c,l=n.noUnconfirmed,d=void 0!==l&&l,h=n.networkFeeOption,p=void 0===h?"standard":h,y=n.customNetworkFee,b=n.rbfTxid,v=n.metadata,g=n.swapData,m=n.otherParams,w=[],E=[],_=0;case 5:if(!(_<f.length)){t.next=18;break}if(C=f[_],x=C.publicAddress,S=C.nativeAmount,A=void 0===S?"0":S,I=C.otherParams,O=void 0===I?{}:I,null!=x){t.next=10;break}return t.abrupt("continue",15);case 10:T=C.memo,null==(k=void 0===T?C.uniqueIdentifier:T)&&"string"==typeof O.uniqueIdentifier&&(k=O.uniqueIdentifier),null!=k&&(O.uniqueIdentifier=k),w.push({memo:k,nativeAmount:A,otherParams:O,publicAddress:x,uniqueIdentifier:k}),E.push({currencyCode:u,memo:k,nativeAmount:A,publicAddress:x,uniqueIdentifier:k});case 15:_++,t.next=5;break;case 18:if(0!==w.length){t.next=20;break}throw new TypeError("The spend has no destination");case 20:if(null==s){t.next=22;break}throw new TypeError("Only sweepPrivateKeys takes private keys");case 22:return t.next=24,r.makeSpend({currencyCode:u,spendTargets:w,noUnconfirmed:d,networkFeeOption:p,customNetworkFee:y,rbfTxid:b,metadata:v,otherParams:m});case 24:return(P=t.sent).networkFeeOption=p,P.requestedCustomFee=y,P.spendTargets=E,null!=v&&(P.metadata=v),null!=g&&(P.swapData=Ac(g)),null!=e.props.state.login.deviceDescription&&(P.deviceDescription=e.props.state.login.deviceDescription),t.abrupt("return",P);case 32:case"end":return t.stop()}}),o)})))()},sweepPrivateKeys:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.sweepPrivateKeys){t.next=2;break}return t.abrupt("return",Promise.reject(new Error("Sweeping this currency is not supported.")));case 2:return t.abrupt("return",r.sweepPrivateKeys(e));case 3:case"end":return t.stop()}}),n)})))()},signTx:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.signTx(e));case 1:case"end":return t.stop()}}),n)})))()},broadcastTx:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.broadcastTx(e));case 1:case"end":return t.stop()}}),n)})))()},saveTx:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,wf(e,n);case 2:return t.next=4,r.saveTx(n);case 4:h.onTransactionsChanged([n]);case 5:case"end":return t.stop()}}),o)})))()},get stakingStatus(){return e.props.walletState.stakingStatus},resyncBlockchain:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.props.dispatch({type:"CURRENCY_ENGINE_CLEARED",payload:{walletId:e.props.walletId}}),t.next=3,r.resyncBlockchain();case 3:case"end":return t.stop()}}),n)})))()},dumpData:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.dumpData();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))()},getPaymentProtocolInfo:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.getPaymentProtocolInfo){t.next=2;break}throw new Error("'getPaymentProtocolInfo' is not implemented on wallets of this type");case 2:return t.abrupt("return",r.getPaymentProtocolInfo(e));case 3:case"end":return t.stop()}}),n)})))()},saveTxMetadata:function(r,n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,gf(e,r,n,xc(i,e.props.walletState.fiat),h);case 2:case"end":return t.stop()}}),o)})))()},getMaxSpendable:function(e){return o()(t().mark((function n(){var o,i,a,u,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=function(e,t){var n=Ua(t,e);if(Fa(n,"1"))return Promise.resolve(e);var u=Da(e,Ha(n,"2"));return s[0].nativeAmount=u,r.makeSpend({currencyCode:o,spendTargets:s,networkFeeOption:i,customNetworkFee:a}).then((function(e){return c(u,t)})).catch((function(t){return c(e,u)}))},"function"!=typeof r.getMaxSpendable){t.next=5;break}return t.next=4,r.getMaxSpendable(e);case 4:return t.abrupt("return",t.sent);case 5:return o=e.currencyCode,i=e.networkFeeOption,a=e.customNetworkFee,u=r.getBalance({currencyCode:o}),s=e.spendTargets.map((function(e){return Df(Df({},e),{},{nativeAmount:"0"})})),t.abrupt("return",c("0",Da(u,"1")));case 9:case"end":return t.stop()}}),n)})))()},parseUri:function(r,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.parseUri(r,i,ps(e.props.state.accounts[s].customTokens[c])));case 1:case"end":return t.stop()}}),o)})))()},encodeUri:function(r){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.encodeUri(r,ps(e.props.state.accounts[s].customTokens[c])));case 1:case"end":return t.stop()}}),o)})))()},otherMethods:p};return A(b),b}function Hf(e,t,r,n){var o,i,a,u=e.props.walletOutput.walletApi,s=e.props.walletState.currencyInfo.currencyCode,c=e.props.walletState.fiat,f=t.unfilteredIndex,l={blockHeight:t.blockHeight,date:t.date,ourReceiveAddresses:t.ourReceiveAddresses,signedTx:t.signedTx,txid:t.txid,otherParams:Df(Df({},t.otherParams),{},{unfilteredIndex:f}),amountSatoshi:Number(null!==(o=t.nativeAmount[n])&&void 0!==o?o:"0"),nativeAmount:null!==(i=t.nativeAmount[n])&&void 0!==i?i:"0",networkFee:null!==(a=t.networkFee[n])&&void 0!==a?a:"0",parentNetworkFee:t.networkFee[s],currencyCode:n,wallet:u,metadata:{}};if(null!=r){r.creationDate<l.date&&(l.date=r.creationDate);var d=Lt(r.currencies[s],r.currencies[n]);null!=d.metadata&&(l.metadata=Df(Df({},l.metadata),function(e,t){for(var r=Ic(e),n=r.exchangeAmount,o=0,i=Object.keys(n);o<i.length;o++){var a=i[o];/e/.test(String(n[a]))&&delete n[a]}return Cc(Cc({},r),{},{amountFiat:n[t]})}(d.metadata,c))),null!=r.feeRateRequested&&("string"==typeof r.feeRateRequested?l.networkFeeOption=r.feeRateRequested:(l.networkFeeOption="custom",l.requestedCustomFee=r.feeRateRequested)),l.feeRateUsed=r.feeRateUsed,null!=r.payees&&(l.spendTargets=r.payees.map((function(e){return{currencyCode:e.currency,memo:e.tag,nativeAmount:e.amount,publicAddress:e.address,uniqueIdentifier:e.tag}}))),null!=r.swap&&(l.swapData=Ac(r.swap)),"string"==typeof r.secret&&(l.txSecret=r.secret),null!=r.deviceDescription&&(l.deviceDescription=r.deviceDescription)}return l}function Kf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ff(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kf(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Gf="publicKey.json",qf=Ht(Rc),zf=Mo({engine:function(e){return o()(t().mark((function r(){var n,o,i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props,o=n.state,i=n.walletId,a=n.walletState,u=a.accountId,s=a.pluginId,c=a.walletInfo,f=o.plugins.currency[s],t.prev=3,h=$f(e),t.next=7,li(h,c);case 7:return p=e.props.state,y=qt(p,c.id),b=zt(p,c.id,e.props.io),t.next=12,Ar(h,s);case 12:return v=t.sent,t.next=15,Wf(c,y,v);case 15:return g=t.sent,m={id:c.id,type:c.type,keys:Ff(Ff({},c.keys),g.keys)},e.props.dispatch({type:"CURRENCY_WALLET_PUBLIC_INFO",payload:{walletInfo:g,walletId:i}}),w=p.accounts[u],t.next=21,f.makeCurrencyEngine(m,{callbacks:Bf(e),log:zo(e.props.logBackend,"".concat(f.currencyInfo.currencyCode,"-").concat(c.id.slice(0,2))),walletLocalDisklet:y,walletLocalEncryptedDisklet:b,customTokens:null!==(l=w.customTokens[s])&&void 0!==l?l:{},enabledTokenIds:e.props.walletState.enabledTokenIds,userSettings:null!==(d=w.userSettings[s])&&void 0!==d?d:{}});case 21:E=t.sent,e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_SEEDS",payload:{displayPrivateSeed:E.getDisplayPrivateSeed(),displayPublicSeed:E.getDisplayPublicSeed(),walletId:i}}),e.onOutput(E),_=f.currencyInfo.currencyCode,C=E.getBalance({currencyCode:_}),x=E.getBlockHeight(),e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_BALANCE",payload:{balance:C,currencyCode:_,walletId:i}}),e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_HEIGHT",payload:{height:x,walletId:i}}),null!=E.getStakingStatus&&E.getStakingStatus().then((function(t){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_STAKING",payload:{stakingStatus:t,walletId:i}})})),t.next=36;break;case 32:t.prev=32,t.t0=t.catch(3),e.props.onError(t.t0),e.props.dispatch({type:"CURRENCY_ENGINE_FAILED",payload:{error:t.t0,walletId:i}});case 36:return bf(e).catch((function(t){return e.props.onError(t)})),Rf(e),t.abrupt("return",Ho);case 39:case"end":return t.stop()}}),r,null,[[3,32]])})))},walletApi:function(e){return o()(t().mark((function r(){var n,o,i,a,u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.props,o=n.walletOutput,i=n.walletState,null!=o){t.next=3;break}return t.abrupt("return");case 3:if(a=o.engine,u=i.nameLoaded,s=i.pluginId,c=i.publicWalletInfo,null!=a&&null!=c&&u){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,Ar($f(e),s);case 9:return f=t.sent,l=Uf(e,a,f,c),e.onOutput(l),t.abrupt("return",Ho);case 13:case"end":return t.stop()}}),r)})))},engineStarted:Lo((function(e){var t;return{update:function(){var r=e.props,n=r.log,o=r.walletId,i=r.walletOutput,a=r.walletState;if(null!=i){var u=i.engine;null!=i.walletApi&&a.fiatLoaded&&a.fileNamesLoaded&&!a.engineStarted&&null!=u&&null==t&&(n("".concat(o," startEngine")),e.props.dispatch({type:"CURRENCY_ENGINE_STARTED",payload:{walletId:o}}),t=Promise.resolve().then((function(){return u.startEngine()})).catch((function(t){return e.props.onError(t)})))}},destroy:function(){var r=e.props,n=r.log,o=r.walletId,i=r.walletOutput;if(null!=i){var a=i.engine;null!=a&&null!=t&&(n("".concat(o," killEngine")),t.then((function(){return a.killEngine()})).catch((function(t){return e.props.onError(t)})).then((function(){return e.props.dispatch({type:"CURRENCY_ENGINE_STOPPED",payload:{walletId:o}})})).catch((function(){})))}}}}),(function(e){return e.state.paused||e.walletState.paused?void 0:e})),syncTimer:Lo((function(e){function r(){return(r=o()(t().mark((function r(){var n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.walletId,t.next=3,hi($f(e),n);case 3:case"end":return t.stop()}}),r)})))).apply(this,arguments)}var n=$o((function(){return r.apply(this,arguments)}),3e4);return{update:function(){var t=e.props,r=t.state,o=t.walletId;null!=t.walletOutput&&null!=r.storageWallets[o]&&r.storageWallets[o].status.lastSync>0&&n.start({wait:!0})},destroy:function(){n.stop()}}}),(function(e){return e.state.paused||e.walletState.paused?void 0:e})),tokenSaver:function(e){var r=xf;return function(){var n=o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=e.props.walletState.enabledTokens)===r||null==o){t.next=6;break}return t.next=4,Vc(e,o).catch((function(t){return e.props.onError(t)}));case 4:return t.next=6,Qo(100);case 6:r=o;case 7:case"end":return t.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()},watcher:function(e){var r,n={},i={},a=xf;return o()(t().mark((function o(){var u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=e.props,f=c.state,l=c.walletState,d=c.walletOutput,null!=l&&null!=d){t.next=3;break}return t.abrupt("return");case 3:if(h=d.engine,p=d.walletApi,y=l.accountId,b=l.pluginId,v=f.accounts[y],r!==l&&null!=p&&U(p),r=l,g=null!==(u=v.userSettings[b])&&void 0!==u?u:n,n!==g&&null!=h&&h.changeUserSettings(g),n=g,m=null!==(s=v.customTokens[b])&&void 0!==s?s:i,i===m||null==h){t.next=31;break}if(null==h.changeCustomTokens){t.next=17;break}h.changeCustomTokens(m),t.next=31;break;case 17:w=0,E=Object.keys(m);case 18:if(!(w<E.length)){t.next=31;break}if(_=E[w],(C=m[_])!==i[_]){t.next=23;break}return t.abrupt("continue",28);case 23:if(null!=(x=ys(C))){t.next=26;break}return t.abrupt("continue",28);case 26:return t.next=28,h.addCustomToken(Ff(Ff({},x),C)).catch((function(t){return e.props.onError(t)}));case 28:w++,t.next=18;break;case 31:if(i=m,S=l.enabledTokens,a===S||null==h){t.next=43;break}if(null==h.changeEnabledTokenIds){t.next=39;break}return t.next=37,h.changeEnabledTokenIds(l.enabledTokenIds).catch((function(t){return e.props.onError(t)}));case 37:t.next=43;break;case 39:return t.next=41,h.disableTokens(ts(a,S)).catch((function(t){return e.props.onError(t)}));case 41:return t.next=43,h.enableTokens(ts(S,a)).catch((function(t){return e.props.onError(t)}));case 43:a=S;case 44:case"end":return t.stop()}}),o)})))}});function Wf(e,t,r){return Vf.apply(this,arguments)}function Vf(){return(Vf=o()(t().mark((function e(r,n,o){var i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qf.load(n,Gf);case 2:if(null==(i=e.sent)){e.next=5;break}return e.abrupt("return",i.walletInfo);case 5:return a={},e.prev=6,e.next=9,o.derivePublicKey(r);case 9:a=e.sent,e.next=14;break;case 12:e.prev=12,e.t0=e.catch(6);case 14:if(u={id:r.id,type:r.type,keys:a},!(Object.keys(a).length>0)){e.next=18;break}return e.next=18,qf.save(n,Gf,{walletInfo:u});case 18:return e.abrupt("return",u);case 19:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function Yf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yf(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Zf=Mo({wallets:Uo(zf,(function(e){return e.state.currency.currencyWalletIds}),(function(e,t){return Jf(Jf({},e),{},{walletId:t,walletState:e.state.currency.wallets[t],walletOutput:e.output.currency.wallets[t]})}))});var Xf=Mo({makeSnrp:function(e){return function(){var t,r=e.props,n=r.io,o=r.log;return e.onOutput((function(r){return null==t&&(t=e.props.output.scrypt.timeScrypt(st("1reallyJunkiePasswordToCheck"),{salt_hex:d.parse("b5865ffb9fa7b3bfe4b2384d47ce831ee22a4a9d5c34c7ef7d21467cc758f81b"),n:16384,r:8,p:1}).then((function(e){return e.time}))),t.then((function(e){var t=function(e,t,r){var n={salt_hex:e,n:16384,r:8,p:1};if(0===t)return n.n=131072,n.r=8,n.p=64,n;var o=t,i=t/8,a=(r-o)/i;(a=a>0?a:0)>0&&(a=0),a=Math.floor(a),n.r=8+a;var u=14,s=(r-(o+=a*i))/o;(s=s>0?s:0)>3&&(s=3),u+=(s=Math.floor(s))>=0?s:0,o+=s*o,n.n=Math.pow(2,u);var c=(r-o)/o;return(c=c>0?c:0)>64&&(c=64),c=Math.floor(c),n.p=c>=1?c:1,o+=c*o,n}(n.random(32),e,r);return o("snrp for ".concat(r,"ms target: ").concat(t.n," ").concat(t.r," ").concat(t.p," based on ").concat(e,"ms benchmark")),t}))})),Ho}},timeScrypt:function(e){return function(){var t,r,n=e.props,o=n.io,i=n.log,a="undefined"!=typeof window&&window.performance&&"function"==typeof window.performance.now?function(){return window.performance.now()}:function(){return Date.now()};return e.onOutput((t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,n=t.salt_hex,u=a();return i("starting scrypt n=".concat(t.n," r=").concat(t.r," p=").concat(t.p)),o.scrypt(e,n,t.n,t.r,t.p,r).then((function(e){var r=a()-u;return i("finished scrypt n=".concat(t.n," r=").concat(t.r," p=").concat(t.p," in ").concat(r,"ms")),{hash:e,time:r}}))},r=Promise.resolve(),function(){for(var e=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=function(){return t.apply(e,o)},u=r.then(a,a);return r=u,u})),Ho}}}),$f=function(e){return e},Qf=Mo({accounts:oc,context:yc,currency:Zf,exchange:Ci,scrypt:Xf}),el=Us({currencyWalletIds:function(e,t,r){var n;if(1===r.accountIds.length){var o=r.accountIds[0];return r.accounts[o].activeWalletIds}var i=r.accountIds.map((function(e){return r.accounts[e].activeWalletIds}));return(n=[]).concat.apply(n,lt()(i))},wallets:zs(If,(function(e){return e.currency.currencyWalletIds}))});function tl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nl(e,t,r,n){e[t]||(e[t]={}),e[t][r]||(e[t][r]=[]),e[t][r].push(n)}var ol=Co({rates:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ids:{},pairs:[],routes:{}},t=arguments.length>1?arguments[1]:void 0;if("EXCHANGE_PAIRS_FETCHED"===t.type){for(var r=e.ids,n=lt()(e.pairs),o=0,i=t.payload;o<i.length;o++){var a=i[o],u="".concat(a.source,",").concat(a.fromCurrency,",").concat(a.toCurrency),s=r[u];null==s?(r===e.ids&&(r=rl({},e.ids)),r[u]=n.length,n.push(a)):n[s]=a}var c=e.routes;if(n.length!==e.pairs.length){c={};for(var f=0;f<n.length;++f)nl(c,n[f].fromCurrency,n[f].toCurrency,f),nl(c,n[f].toCurrency,n[f].fromCurrency,f)}return{ids:r,pairs:n,routes:c}}return e}});function il(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function al(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?il(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):il(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ul=Us({apiKey:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.apiKey:e},appId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.appId:e},deviceDescription:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.deviceDescription:e},localUsers:Ws((function(e){return e.login.appId}),(function(e){return e.login.stashes}),(function(e,t){for(var r=[],n=0,o=Object.keys(t);n<o.length;n++){var i=o[n],a=t[i],u=Bn(a,(function(t){return t.appId===e})),s=null!=u&&(null!=u.passwordAuthBox||null!=u.loginAuthBox),c=Xi(a,e),f=a.recovery2Key;r.push({keyLoginEnabled:s,lastLogin:a.lastLogin,pinLoginEnabled:null!=c,recovery2Key:null!=f?ut(f):void 0,username:i,voucherId:null!=u?u.voucherId:void 0})}return r})),serverUri:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.authServer:e},stashes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INIT":for(var r={},n=0,o=t.payload.stashes;n<o.length;n++){var i=o[n];if(null!=i.username){var a=i.username;r[a]=i}}return r;case"LOGIN_STASH_DELETED":var u=al({},e);return delete u[t.payload],u;case"LOGIN_STASH_SAVED":var s=t.payload.username;if(null==s)throw new Error("Missing username");var c=al({},e);return c[s]=t.payload,c}return e},walletInfos:function(e,t,r){if(1===r.accountIds.length){var n=r.accountIds[0];return r.accounts[n].walletInfos}for(var o={},i=0,a=r.accountIds;i<a.length;i++)for(var u=a[i],s=r.accounts[u],c=0,f=Object.keys(s.walletInfos);c<f.length;c++){var l=f[c],d=s.walletInfos[l];o[l]=d}return o}});function sl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function cl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fl={init:{},locked:!1,currency:{},rate:{},swap:{},currencyTools:{}};function ll(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ll(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ll(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var hl=Co({lastChanges:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if("STORAGE_WALLET_SYNCED"===t.type){var r=t.payload.changes;return r.length>0?r:e}return e},localDisklet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e},paths:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e},status:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lastSync:0,lastHash:void 0},t=arguments.length>1?arguments[1]:void 0;return"STORAGE_WALLET_SYNCED"===t.type?t.payload.status:e}}),pl={sources:{},defaultLogLevel:"warn"},yl=Us({accountCount:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?e+1:e},accountIds:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;switch(t.type){case"LOGIN":return[].concat(lt()(e),[r.lastAccountId]);case"LOGOUT":var n=t.payload.accountId,o=e.filter((function(e){return e!==n}));if(o.length===e.length)throw new Error("Login ".concat(n," does not exist"));return o;case"CLOSE":return[]}return e},accounts:zs(ec,(function(e){return e.accountIds})),hideKeys:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.hideKeys:e},lastAccountId:function(e,t,r){return"login".concat(r.accountCount)},logSettings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INIT":return t.payload.logSettings;case"CHANGE_LOG_SETTINGS":return t.payload}return e},paused:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"PAUSE"===t.type?t.payload:e},rateHintCache:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ai,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INIT":case"UPDATE_RATE_HINT_CACHE":return t.payload.rateHintCache}return e},ready:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type||e},currency:el,exchangeCache:ol,login:ul,plugins:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CORE_PLUGINS_ADDED":for(var r=cl(cl({},e),{},{currency:cl({},e.currency),rate:cl({},e.rate),swap:cl({},e.swap)}),n=0,o=Object.keys(t.payload);n<o.length;n++){var i=o[n],a=t.payload[i];null!=a.currencyInfo&&(r.currency[i]=a),null!=a.rateInfo&&(r.rate[i]=a),null!=a.swapInfo&&(r.swap[i]=a)}return r;case"CORE_PLUGINS_LOCKED":return cl(cl({},e),{},{locked:!0});case"CURRENCY_TOOLS_LOADED":var u=cl({},e.currencyTools);return u[t.payload.pluginId]=t.payload.tools,cl(cl({},e),{},{currencyTools:u});case"INIT":return cl(cl({},e),{},{init:t.payload.pluginsInit})}return e},storageWallets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"STORAGE_WALLET_ADDED":var r=t.payload,n=r.id,o=r.initialState,i=dl({},e);return i[n]=hl(o,{type:"UPDATE_NEXT"}),i;case"STORAGE_WALLET_SYNCED":var a=t.payload.id;if(null!=e[a]){var u=dl({},e);return u[a]=hl(e[a],t),u}return e}return e}});function bl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var gl=[],ml="object"===("undefined"==typeof window?"undefined":Nt()(window))&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"core"}):function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))};function wl(e,t,r){return El.apply(this,arguments)}function El(){return(El=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S,A,I;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.io,a=o.apiKey,u=o.appId,s=void 0===u?"":u,c=o.authServer,f=void 0===c?"https://auth.airbitz.co/api":c,l=o.deviceDescription,d=void 0===l?null:l,h=o.hideKeys,p=void 0!==h&&h,y=o.plugins,b=void 0===y?{}:y,v=vl(vl({},pl),o.logSettings),null!=a){e.next=5;break}throw new Error("No API key provided");case 5:return g=ml(),m=Eo(yl,g),n=qo(n,(function(){var e=m.getState();return e.ready?e.logSettings:v})),w=zo(n,"edge-core"),e.next=11,i.disklet.getText("rateHintCache.json").then((function(e){return JSON.parse(e)})).catch((function(){return[]}));case 11:return E=e.sent,e.next=14,on(i.disklet,w);case 14:return _=e.sent,m.dispatch({type:"INIT",payload:{apiKey:a,appId:s,authServer:f,deviceDescription:d,hideKeys:p,logSettings:v,pluginsInit:b,rateHintCache:E,stashes:_}}),C=Xo(r,n,b,m.dispatch),e.next=19,Xn({log:w,fetch:i.fetch});case 19:return x=e.sent,S={output:{}},A=jo(m,Lo(Qf,(function(e){return vl(vl({},e),{},{close:function(){A(),C(),m.dispatch({type:"CLOSE"})},io:i,log:w,logBackend:n,onError:function(e){null!=S.output.context&&null!=S.output.context.api&&L(S.output.context.api,"error",e)},syncClient:x})})),(function(e){return w.error(e)}),(function(e){return S.output=e})),I=S.output.context.api,gl.push(I),e.abrupt("return",I);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_l(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xl=function(){function e(){me()(this,e),this.lobbies={},this.logins=[],this.repos={}}return Ee()(e,[{key:"getLoginById",value:function(e){return this.logins.find((function(t){return Tt(t.loginId,e)}))}},{key:"getLoginByPin2Id",value:function(e){return this.logins.find((function(t){return null!=t.pin2Id&&Tt(t.pin2Id,e)}))}},{key:"getLoginByRecovery2Id",value:function(e){return this.logins.find((function(t){return null!=t.recovery2Id&&Tt(t.recovery2Id,e)}))}},{key:"getLoginsByParent",value:function(e){return this.logins.filter((function(t){return t.parentId===e.loginId}))}},{key:"insertLogin",value:function(e){this.logins.push(e)}},{key:"setupFakeUser",value:function(e){var t=this;!function e(r){var n=r.children,o=Rs()(r,["children"]);t.insertLogin(o);for(var i=0;i<n.length;i++){var a=n[i];a.parentId=r.loginId,e(a)}}(e.server);for(var r=0,n=Object.keys(e.repos);r<n.length;r++){var o=n[r];this.repos[o]=Cl({},e.repos[o])}}},{key:"dumpLogin",value:function(e){var t=this;return function e(r){return Cl(Cl({},r),{},{children:t.getLoginsByParent(r).map((function(t){return e(t)}))})}(e)}}]),e}();function Sl(e,t){var r=e.getLoginsByParent(t).map((function(t){return Sl(e,t)}));return{appId:t.appId,created:t.created,loginId:t.loginId,children:r,parentBox:t.parentBox,passwordAuthBox:t.passwordAuthBox,passwordAuthSnrp:t.passwordAuthSnrp,passwordBox:t.passwordBox,passwordKeySnrp:t.passwordKeySnrp,pin2Box:t.pin2Box,pin2KeyBox:t.pin2KeyBox,pin2TextBox:t.pin2TextBox,question2Box:t.question2Box,recovery2Box:t.recovery2Box,recovery2KeyBox:t.recovery2KeyBox,otpKey:t.otpKey,otpResetDate:t.otpResetDate,otpTimeout:t.otpTimeout,pendingVouchers:Al(t),loginAuthBox:t.loginAuthBox,keyBoxes:t.keyBoxes,mnemonicBox:t.mnemonicBox,rootKeyBox:t.rootKeyBox,syncKeyBox:t.syncKeyBox}}function Al(e){return e.vouchers.filter((function(e){return"pending"===e.status})).map((function(e){return{activates:e.activates,created:e.created,deviceDescription:e.deviceDescription,ip:e.ip,ipDescription:e.ipDescription,voucherId:e.voucherId}}))}function Il(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ol(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Il(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Il(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Tl=ve(Ye),kl=ve(Ze),Pl={success:{code:0,httpStatus:200,message:"Success"},error:{code:1,httpStatus:503,message:"Error"},accountExists:{code:2,httpStatus:401,message:"Account already exists"},noAccount:{code:3,httpStatus:401,message:"No account"},invalidPassword:{code:4,httpStatus:401,message:"Invalid Password"},invalidAnswers:{code:5,httpStatus:401,message:"Invalid Answers"},invalidApiKey:{code:6,httpStatus:401,message:"Invalid API Key"},invalidOtp:{code:8,httpStatus:401,message:"Invalid OTP"},conflict:{code:10,httpStatus:409,message:"Conflicting change"},obsolete:{code:1e3,httpStatus:410,message:"Obsolete API"},created:{code:0,httpStatus:201,message:"Account created"},invalidRequest:{code:1,httpStatus:401,message:"Invalid request"},notFound:{code:1,httpStatus:404,message:"Not found"},noLobby:{code:3,httpStatus:404,message:"Not found"},invalidAppId:{code:10,httpStatus:401,message:"A login with the same appId already exists"}};function Bl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.status,n=void 0===r?200:r,o=t.headers,i=void 0===o?{}:o;return Promise.resolve({status:n,headers:Ol({"content-type":"application/json"},i),body:JSON.stringify(e)})}function Rl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pl.success,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.message,r=e.code,n=e.httpStatus,o={status_code:r,message:t};return Bl(o,{status:n})}function jl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pl.success,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.message,n=t.code,o=t.httpStatus,i={status_code:n,message:r,results:e};return Bl(i,{status:o})}function Ml(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.reason,n=void 0===r?"otp":r,o=t.voucher;return jl(Tl({login_id:e.loginId,otp_reset_auth:e.otpResetAuth,otp_timeout_date:e.otpResetDate,reason:n,voucher_auth:null==o?void 0:o.voucherAuth,voucher_activates:null==o?void 0:o.activates,voucher_id:null==o?void 0:o.voucherId}),Pl.invalidOtp)}function Nl(e){return jl(kl({wait_seconds:e}),Pl.invalidPassword)}function Dl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ll(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ul=ve(ze),Hl=ve(We),Kl=ve(Ve),Fl=ve(Je),Gl=ve($e),ql=ve(Qe),zl=function(e){return function(){var r=o()(t().mark((function r(n){var o,i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.json,null!=(i=ce(Me)(o))){t.next=4;break}return t.abrupt("return",Rl(Pl.invalidRequest));case 4:return t.next=6,e(Ll(Ll({},n),{},{body:i,payload:i.data}));case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},Wl=function(e){return function(){var r=o()(t().mark((function r(n){var o,i,a,u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.body,i=n.login,a=o.otp,u=o.voucherAuth,s=o.voucherId,null!=(c=i.otpKey)){t.next=7;break}return t.next=6,e(n);case 6:case 10:case 16:return t.abrupt("return",t.sent);case 7:if(null==a||!yn(c,a,{spread:2})){t.next=11;break}return t.next=10,e(n);case 11:if(null==u||null==s){t.next=17;break}if(f=i.vouchers.find((function(e){return e.voucherId===s})),null==f||"approved"!==f.status||!Tt(u,f.voucherAuth)){t.next=17;break}return t.next=16,e(n);case 17:return i.otpResetAuth="Super secret reset token",l={activates:new Date("2020-01-01T00:00:00Z"),created:new Date("2020-01-08T00:00:00Z"),deviceDescription:"A phone",ip:"localhost",ipDescription:"here",loginId:i.loginId,status:"pending",voucherAuth:Uint8Array.from([170,187]),voucherId:"voucher-".concat(i.vouchers.length)},i.vouchers.push(l),t.abrupt("return",Ml(i,{voucher:l}));case 21:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},Vl=function(e){return Rl(Pl.invalidRequest)},Yl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vl;return function(r){var n=r.db,o=r.body,i=o.loginAuth,a=o.loginId,u=o.passwordAuth,s=o.pin2Auth,c=o.pin2Id,f=o.recovery2Auth,l=o.recovery2Id,d=o.userId;if(null!=a&&null!=i){var h=n.getLoginById(a);return null==h?Rl(Pl.noAccount):null!=h.loginAuth&&Tt(i,h.loginAuth)?Wl(e)(Ll(Ll({},r),{},{login:h})):Nl(0)}if(null!=d&&null!=u){var p=n.getLoginById(d);return null==p?Rl(Pl.noAccount):null!=p.passwordAuth&&Tt(u,p.passwordAuth)?Wl(e)(Ll(Ll({},r),{},{login:p})):Nl(0)}if(null!=c&&null!=s){var y=n.getLoginByPin2Id(c);return null==y?Rl(Pl.noAccount):null!=y.pin2Auth&&Tt(s,y.pin2Auth)?Wl(e)(Ll(Ll({},r),{},{login:y})):Nl(0)}if(null!=l&&null!=f){var b=n.getLoginByRecovery2Id(l);if(null==b)return Rl(Pl.noAccount);var v=b.recovery2Auth,g=f;if(null==v||g.length!==v.length)return Nl(0);for(var m=0;m<g.length;++m)if(!Tt(g[m],v[m]))return Nl(0);return Wl(e)(Ll(Ll({},r),{},{login:b}))}return t(r)}},Jl=Yl((function(e){var t=e.db,r=e.login;return jl(Hl(Sl(t,r)))}),(function(e){var t=e.db,r=e.json,n=Me(r),o=n.userId,i=n.passwordAuth,a=n.recovery2Id,u=n.recovery2Auth;if(null!=o&&null==i){var s=t.getLoginById(o);if(null==s)return Rl(Pl.noAccount);var c=s.passwordAuthSnrp;return jl(ql({passwordAuthSnrp:void 0===c?Qr:c}))}if(null!=a&&null==u){var f=t.getLoginByRecovery2Id(a);if(null==f)return Rl(Pl.noAccount);var l=f.question2Box;return null==l?Rl(Pl.noAccount):jl(Gl({question2Box:l}))}return Rl(Pl.invalidRequest)}));function Zl(e,t){var r=e.db,n=e.json,o=new Date,i=ce(Me)(n);if(null==i)return Rl(Pl.invalidRequest);var a=ce(qe)(i.data),u=ce(Ke)(a);if(null==a||null==u)return Rl(Pl.invalidRequest);if(null!=r.getLoginById(a.loginId))return Rl(Pl.accountExists);for(var s=ce(Ge,{newSyncKeys:[],keyBoxes:[]})(a),c=0,f=s.newSyncKeys;c<f.length;c++){var l=f[c];r.repos[l]={}}var d=Ll(Ll(Ll(Ll(Ll(Ll({},a),u),{},{created:o,keyBoxes:s.keyBoxes,vouchers:[]},ce(De)(a)),ce(Le)(a)),ce(Ue)(a)),ce(He)(a));if(null!=t){if(null!=r.getLoginsByParent(t).find((function(e){return e.appId===a.appId})))return Rl(Pl.invalidAppId);d.parentId=t.loginId}return r.insertLogin(d),Rl(Pl.created,"Account created")}var Xl=Yl((function(e){return Zl(e,e.login)}),(function(e){return Zl(e)})),$l=Yl((function(e){var t=e.db,r=e.login,n=e.payload,o=ce(Ge)(n);if(null==o)return Rl(Pl.invalidRequest);for(var i=0,a=o.newSyncKeys;i<a.length;i++){var u=a[i];t.repos[u]={}}return r.keyBoxes=Dt(r.keyBoxes,o.keyBoxes),Rl()})),Ql=Yl((function(e){var t=e.login,r=e.payload,n=ce(De)(r);return null==n?Rl(Pl.invalidRequest):(t.otpKey=n.otpKey,t.otpTimeout=n.otpTimeout,t.otpResetDate=void 0,Rl())})),ed=Yl((function(e){var t=e.login;return t.otpKey=void 0,t.otpResetAuth=void 0,t.otpResetDate=void 0,t.otpTimeout=void 0,Rl()}),(function(e){var t=e.db,r=e.json,n=Me(r);if(null==n.userId||null==n.otpResetAuth)return Rl(Pl.invalidRequest);var o=t.getLoginById(n.userId);if(null==o)return Rl(Pl.noAccount);if(n.otpResetAuth!==o.otpResetAuth)return Nl(0);var i=o.otpKey,a=o.otpTimeout;return null==i||null==a?Rl(Pl.invalidRequest,"OTP not setup for this account."):(null==o.otpResetDate&&(o.otpResetDate=new Date(Date.now()+1e3*a)),jl(Fl({otpResetDate:o.otpResetDate})))})),td=Yl((function(e){var t=e.login;return t.passwordAuth=void 0,t.passwordAuthBox=void 0,t.passwordAuthSnrp=void 0,t.passwordBox=void 0,t.passwordKeySnrp=void 0,Rl()})),rd=Yl((function(e){var t=e.login,r=e.payload,n=ce(Le)(r);return null==n?Rl(Pl.invalidRequest):(t.passwordAuth=n.passwordAuth,t.passwordAuthBox=n.passwordAuthBox,t.passwordAuthSnrp=n.passwordAuthSnrp,t.passwordBox=n.passwordBox,t.passwordKeySnrp=n.passwordKeySnrp,Rl())})),nd=Yl((function(e){var t=e.login;return t.pin2Auth=void 0,t.pin2Box=void 0,t.pin2Id=void 0,t.pin2KeyBox=void 0,t.pin2TextBox=void 0,Rl()})),od=Yl((function(e){var t=e.login,r=e.payload,n=ce(Ue)(r);return null==n?Rl(Pl.invalidRequest):(t.pin2Auth=n.pin2Auth,t.pin2Box=n.pin2Box,t.pin2Id=n.pin2Id,t.pin2KeyBox=n.pin2KeyBox,t.pin2TextBox=n.pin2TextBox,Rl())})),id=Yl((function(e){var t=e.login;return t.question2Box=void 0,t.recovery2Auth=void 0,t.recovery2Box=void 0,t.recovery2Id=void 0,t.recovery2KeyBox=void 0,Rl()})),ad=Yl((function(e){var t=e.login,r=e.payload,n=ce(He)(r);return null==n?Rl(Pl.invalidRequest):(t.question2Box=n.question2Box,t.recovery2Auth=n.recovery2Auth,t.recovery2Box=n.recovery2Box,t.recovery2Id=n.recovery2Id,t.recovery2KeyBox=n.recovery2KeyBox,Rl())})),ud=Yl((function(e){var t=e.db,r=e.login,n=e.payload,o=ce(Ke)(n);return null==o?Rl(Pl.invalidRequest):null!=r.loginAuth?Rl(Pl.conflict,"The secret-key login is already configured"):(r.loginAuth=o.loginAuth,r.loginAuthBox=o.loginAuthBox,jl(Hl(Sl(t,r))))})),sd=Yl(function(){var e=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d,h,p,y,b,v,g;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.db,o=r.login,i=r.payload,null!=(a=ce(Fe)(i))){e.next=4;break}return e.abrupt("return",Rl(Pl.invalidRequest));case 4:for(u=a.approvedVouchers,s=void 0===u?[]:u,c=a.rejectedVouchers,f=void 0===c?[]:c,l={},d=0;d<s.length;d++)h=s[d],l[h]="approved";for(p=0;p<f.length;p++)y=f[p],l[y]="rejected";b=0,v=o.vouchers;case 9:if(!(b<v.length)){e.next=17;break}if(g=v[b],null!=l[g.voucherId]){e.next=13;break}return e.abrupt("continue",14);case 13:g.status=l[g.voucherId];case 14:b++,e.next=9;break;case 17:return e.t0=jl,e.t1=Hl,e.next=21,Sl(n,o);case 21:return e.t2=e.sent,e.t3=(0,e.t1)(e.t2),e.abrupt("return",(0,e.t0)(e.t3));case 24:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),cd=function(e){return Rl(Pl.noLobby,"Cannot find lobby ".concat(e.lobbyId))},fd=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cd;return function(r){var n=r.db,o=r.path.split("/")[4],i=n.lobbies[o];return null!=i?e(Ll(Ll({},r),{},{lobby:i,lobbyId:o})):t(Ll(Ll({},r),{},{lobbyId:o}))}},ld=fd((function(e){return Rl(Pl.accountExists,"Lobby ".concat(e.lobbyId," already exists."))}),(function(e){var t=e.db,r=e.json,n=e.lobbyId,o=ce(Me)(r);if(null==o)return Rl(Pl.invalidRequest);var i=ce(Be)(o.data);if(null==i)return Rl(Pl.invalidRequest);var a=i.timeout,u=void 0===a?600:a,s=new Date(Date.now()+1e3*u).toISOString();return t.lobbies[n]={request:i,replies:[],expires:s},Rl()})),dd=fd((function(e){var t=e.json,r=e.lobby,n=ce(Me)(t);if(null==n)return Rl(Pl.invalidRequest);var o=ce(Re)(n.data);return null==o?Rl(Pl.invalidRequest):(r.replies.push(o),Rl())})),hd=fd((function(e){var t=e.lobby;return jl(Ul(t))})),pd=fd((function(e){var t=e.db,r=e.lobbyId;return delete t.lobbies[r],Rl()})),yd=function(e){return function(t){var r=t.db,n=t.path.split("/")[4],o=r.repos[n];return null==o?Bl({msg:"Hash not found"},{status:404}):e(Ll(Ll({},t),{},{repo:o}))}},bd=yd((function(e){return Bl({changes:e.repo})})),vd=yd((function(e){for(var t=e.json,r=e.repo,n=gd(t).changes,o=0,i=Object.keys(n);o<i.length;o++){var a=i[o];r[a]=n[a]}return Bl({changes:r,hash:"1111111111111111111111111111111111111111"})})),gd=de({changes:se(ke)}),md=m({"/api/v2/login/?":g({GET:zl(Jl),POST:zl(Jl)}),"/api/v2/login/create/?":g({POST:zl(Xl),PUT:zl(Xl)}),"/api/v2/login/keys/?":g({POST:zl($l)}),"/api/v2/login/otp/?":g({DELETE:zl(ed),POST:zl(Ql),PUT:zl(Ql)}),"/api/v2/login/password/?":g({DELETE:zl(td),POST:zl(rd),PUT:zl(rd)}),"/api/v2/login/pin2/?":g({DELETE:zl(nd),POST:zl(od),PUT:zl(od)}),"/api/v2/login/recovery2/?":g({DELETE:zl(id),POST:zl(ad),PUT:zl(ad)}),"/api/v2/login/secret/?":g({POST:zl(ud)}),"/api/v2/login/vouchers/?":g({POST:zl(sd)}),"/api/v2/messages/?":g({POST:zl((function(e){var t=e.db,r=e.json,n=ce(Me)(r);if(null==n||null==n.loginIds)return Rl(Pl.invalidRequest);for(var o=n.loginIds,i=[],a=0;a<o.length;a++){var u=o[a],s=t.getLoginById(u);null!=s&&i.push({loginId:u,otpResetPending:null!=s.otpResetDate,pendingVouchers:Al(s),recovery2Corrupt:!1})}return jl(Kl(i))}))}),"/api/v2/lobby/[^/]+/?":g({DELETE:zl(pd),GET:zl(hd),POST:zl(dd),PUT:zl(ld)}),"/api/v2/store/[^/]+/?":g({GET:bd,POST:vd}),"/v1/edgeServers":g({GET:function(e){return Bl({infoServers:["https://info-fake1.edge.app"],syncServers:["https://sync-fake1.edge.app","https://sync-fake2.edge.app","https://sync-fake3.edge.app"]})}})},(function(e){return Rl(Pl.notFound,"Unknown API endpoint ".concat(e.path))}));function wd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ed(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wd(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _d=ve(ln),Cd=ve(tt),xd=ve(rt);function Sd(e,t){return Ad.apply(this,arguments)}function Ad(){return Ad=o()(t().mark((function e(r,n){var i,a,u,s,c,f,l,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.lastLogin,a=n.loginId,u=n.loginKey,s=n.repos,c=n.server,f=xe(n.username),l=Mn({appId:"",lastLogin:i,loginId:a,pendingVouchers:[],username:f},u,We(Cd(c))),h="logins/".concat(ut(a),".json"),e.next=6,r.disklet.setText(h,JSON.stringify(_d(l))).catch((function(){}));case 6:return e.next=8,Promise.all(Object.keys(s).map(function(){var e=o()(t().mark((function e(o){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=ri(r,d.parse(o),new Uint8Array(0)),e.next=3,oi(i.dataDisklet,n.repos[o]);case 3:return e.next=5,i.baseDisklet.setText("status.json",JSON.stringify({lastSync:1,lastHash:null}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:case"end":return e.stop()}}),e)}))),Ad.apply(this,arguments)}function Id(e,r,n){for(var i=e.io,a=e.nativeIo,u=new xl,s=function(e){var t=Ut((function(r){if(t.offline)throw new Error("Fake network error");var n=r.body.byteLength>0?JSON.parse(ct(new Uint8Array(r.body))):{};return md(Ll(Ll({},r),{},{db:e,json:n}))}),{offline:!1});return t}(u),c=nt(n),f=0;f<c.length;f++){var l=c[f];u.setupFakeUser(l)}var h=[],y={close:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(h.map((function(e){return e.close()})));case 2:D(y);case 3:case"end":return e.stop()}}),e)})))()},makeEdgeContext:function(e){return o()(t().mark((function n(){var u,f,l,d;return t().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(u=e.cleanDevice,f=void 0!==u&&u,l=Ed(Ed({},i),{},{disklet:(0,Q.Wh)(),fetch:b(s)}),f){n.next=5;break}return n.next=5,Promise.all(c.map(function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Sd(l,r));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:return n.next=7,wl({io:l,nativeIo:a},r,Ed({},e));case 7:return d=n.sent,h.push(d),n.abrupt("return",d);case 10:case"end":return n.stop()}}),n)})))()},goOffline:function(){var e=arguments;return o()(t().mark((function r(){var n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=!(e.length>0&&void 0!==e[0])||e[0],s.offline=n;case 2:case"end":return t.stop()}}),r)})))()},dumpFakeUser:function(e){return o()(t().mark((function r(){var n,o,i,a,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""===e.appId){t.next=2;break}throw new Error("Only root logins are dumpable.");case 2:if(n=at(e.rootLoginId),null!=(o=u.getLoginById(n))){t.next=6;break}throw new Error("Cannot find user ".concat(e.username));case 6:for(i=e.allKeys.filter((function(e){return null!=e.keys&&null!=e.keys.syncKey})).map((function(e){return d.stringify(p.parse(e.keys.syncKey)).toLowerCase()})),a={},s=0;s<i.length;s++)c=i[s],a[c]=u.repos[c];return t.abrupt("return",xd({lastLogin:e.lastLogin,loginId:n,loginKey:at(e.loginKey),repos:a,server:u.dumpLogin(o),username:e.username}));case 10:case"end":return t.stop()}}),r)})))()}};return A(y),y}function Od(e){var t=function(){var e={resolve:function(){},reject:function(){}},t=0;if("undefined"!=typeof Map){var r=new Map;return{add:function(e){var n=++t;return r.set(n,e),n},grab:function(t){var n=r.get(t);return null==n?e:(r.delete(t),n)}}}var n={};return{add:function(e){var r=++t;return n[String(r)]=e,r},grab:function(t){var r=n[String(t)];return null==r?e:(delete n[String(t)],r)}}}();return{call:function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return new Promise((function(n,i){e(t.add({resolve:n,reject:i}),r,o)}))},resolve:function(e,r){t.grab(e).resolve(r)},reject:function(e,r){t.grab(e).reject(new Error(r))}}}var Td=null!=window.edgeCore?[Od((function(e,t,r){window.edgeCore.call(e,t,JSON.stringify(r))})),new Y({sendMessage:function(e){window.edgeCore.postMessage(JSON.stringify(e))}})]:[Od((function(e,t,r){window.webkit.messageHandlers.edgeCore.postMessage([e,t,r])})),new Y({sendMessage:function(e){window.webkit.messageHandlers.edgeCore.postMessage([0,"postMessage",[JSON.stringify(e)]])}})],kd=a()(Td,2),Pd=kd[0],Bd=kd[1];function Rd(e){var t=window.document.head;if(null!=t&&0!==e.length)for(var r=0,n=function(){++r>=e.length&&Zo()},o=0;o<e.length;o++){var i=e[o],a=document.createElement("script");a.addEventListener("error",n),a.addEventListener("load",n),a.charset="utf-8",a.defer=!0,a.src=i,t.appendChild(a)}else Zo()}function jd(e){return Md.apply(this,arguments)}function Md(){return Md=o()(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=f(),e.t1=s().sha256,e.t2=p,e.next=5,Pd.call("randomBytes",32);case 5:return e.t3=e.sent,e.t4=e.t2.parse.call(e.t2,e.t3),e.t5={hash:e.t1,entropy:e.t4},n=new e.t0(e.t5),e.abrupt("return",{console:console,disklet:{delete:function(e){return Pd.call("diskletDelete",Nd(e))},getData:function(e){return Pd.call("diskletGetData",Nd(e)).then((function(e){return p.parse(e)}))},getText:function(e){return Pd.call("diskletGetText",Nd(e))},list:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Pd.call("diskletList",Nd(e))},setData:function(e,t){return Pd.call("diskletSetData",Nd(e),p.stringify(t))},setText:function(e,t){return Pd.call("diskletSetText",Nd(e),t)}},random:function(e){return n.generate(e)},scrypt:function(e,t,r,n,o,i){return Pd.call("scrypt",p.stringify(e),p.stringify(t),r,n,o,i).then((function(e){return p.parse(e)}))},fetch:function(e,t){return window.fetch(e,t)},fetchCors:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.fetchCors(e,t).then(v)}});case 10:case"end":return e.stop()}}),e)}))),Md.apply(this,arguments)}function Nd(e){if(/^\//.test(e))throw new Error("Absolute paths are not supported");for(var t=e.split("/"),r=0,n=0;r<t.length;){var o=t[r++];if(".."===o?n--:"."!==o&&""!==o&&(t[n++]=o),n<0)throw new Error("Path would escape folder")}return t.slice(0,n).join("/")}window.addEdgeCorePlugins=function(e){if(Vo)throw new Error("The Edge core plugin list has already been locked");for(var t in e)Wo[t]=e[t];for(var r=0;r<Yo.length;r++){(0,Yo[r])(e)}},window.nativeBridge=Pd,window.reactBridge=Bd;var Dd=A({makeEdgeContext:function(e,r,n,i,a){return o()(t().mark((function o(){var u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Rd(i),t.next=3,jd(e);case 3:return u=t.sent,t.abrupt("return",wl({io:u,nativeIo:r},n,a));case 5:case"end":return t.stop()}}),o)})))()},makeFakeEdgeWorld:function(e,r,n,i){var a=arguments;return o()(t().mark((function o(){var u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>4&&void 0!==a[4]?a[4]:[],Rd(i),t.next=4,jd(e);case 4:return s=t.sent,t.abrupt("return",Id({io:s,nativeIo:r},n,u));case 6:case"end":return t.stop()}}),o)})))()}});Bd.sendRoot(Dd)}()}();
2
+ !function(){var e={7228:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},2858:function(e){e.exports=function(e){if(Array.isArray(e))return e}},3646:function(e,t,r){var n=r(7228);e.exports=function(e){if(Array.isArray(e))return n(e)}},1506:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},8926:function(e){function t(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function u(e){t(a,o,i,u,s,"next",e)}function s(e){t(a,o,i,u,s,"throw",e)}u(void 0)}))}}},4575:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},3913:function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}},9713:function(e){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},9754:function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(r)}e.exports=t},2205:function(e,t,r){var n=r(9489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},6860:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},3884:function(e){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(s){o=!0,i=s}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}},521:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},8206:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},6479:function(e,t,r){var n=r(7316);e.exports=function(e,t){if(null==e)return{};var r,o,i=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}},7316:function(e){e.exports=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}},8585:function(e,t,r){var n=r(8),o=r(1506);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},9489:function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(r,n)}e.exports=t},3038:function(e,t,r){var n=r(2858),o=r(3884),i=r(379),a=r(521);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||a()}},319:function(e,t,r){var n=r(3646),o=r(6860),i=r(379),a=r(8206);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},8:function(e){function t(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}e.exports=t},379:function(e,t,r){var n=r(7228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},7757:function(e,t,r){e.exports=r(5666)},8826:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function o(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function a(e,t,r,n,o){null==n&&null==o||(e=e.slice?e.slice(n,o):Array.prototype.slice.call(e,n,o)),t.set(e,r)}var u,s={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return o(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},c=(u="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(u[(240&n)>>4]+u[15&n])}return t.join("")}}),f={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],y=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],b=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],v=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],m=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],E=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],C=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],x=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function A(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var I=function(e){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(e,!0)}),this._prepare()};I.prototype._prepare=function(){var e=f[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),o=this.key.length/4,i=A(this.key);for(t=0;t<o;t++)r=t>>2,this._Ke[r][t%4]=i[t],this._Kd[e-r][t%4]=i[t];for(var a,u=0,s=o;s<n;){if(a=i[o-1],i[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^l[u]<<24,u+=1,8!=o)for(t=1;t<o;t++)i[t]^=i[t-1];else{for(t=1;t<o/2;t++)i[t]^=i[t-1];a=i[o/2-1],i[o/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24;for(t=o/2+1;t<o;t++)i[t]^=i[t-1]}for(t=0;t<o&&s<n;)c=s>>2,h=s%4,this._Ke[c][h]=i[t],this._Kd[e-c][h]=i[t++],s++}for(var c=1;c<e;c++)for(var h=0;h<4;h++)a=this._Kd[c][h],this._Kd[c][h]=_[a>>24&255]^C[a>>16&255]^x[a>>8&255]^S[255&a]},I.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=A(e),o=0;o<4;o++)n[o]^=this._Ke[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=p[n[o]>>24&255]^y[n[(o+1)%4]>>16&255]^b[n[(o+2)%4]>>8&255]^v[255&n[(o+3)%4]]^this._Ke[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Ke[t][o],s[4*o]=255&(d[n[o]>>24&255]^u>>24),s[4*o+1]=255&(d[n[(o+1)%4]>>16&255]^u>>16),s[4*o+2]=255&(d[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(d[255&n[(o+3)%4]]^u);return s},I.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=A(e),o=0;o<4;o++)n[o]^=this._Kd[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=g[n[o]>>24&255]^m[n[(o+3)%4]>>16&255]^w[n[(o+2)%4]>>8&255]^E[255&n[(o+1)%4]]^this._Kd[a][o];n=r.slice()}var u,s=i(16);for(o=0;o<4;o++)u=this._Kd[t][o],s[4*o]=255&(h[n[o]>>24&255]^u>>24),s[4*o+1]=255&(h[n[(o+3)%4]>>16&255]^u>>16),s[4*o+2]=255&(h[n[(o+2)%4]>>8&255]^u>>8),s[4*o+3]=255&(h[255&n[(o+1)%4]]^u);return s};var O=function(e){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new I(e)};O.prototype.encrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.encrypt(r),t,n);return t},O.prototype.decrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.decrypt(r),t,n);return t};var T=function(e,t){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastCipherblock=o(t,!0),this._aes=new I(e)};T.prototype.encrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16);for(var u=0;u<16;u++)r[u]^=this._lastCipherblock[u];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,t,n)}return t},T.prototype.decrypt=function(e){if((e=o(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var u=0;u<16;u++)t[n+u]=r[u]^this._lastCipherblock[u];a(e,this._lastCipherblock,0,n,n+16)}return t};var k=function(e,t,r){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=i(16);r||(r=1),this.segmentSize=r,this._shiftRegister=o(t,!0),this._aes=new I(e)};k.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=o(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=t[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},k.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=o(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=t[i];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var P=function(e,t){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastPrecipher=o(t,!0),this._lastPrecipherIndex=16,this._aes=new I(e)};P.prototype.encrypt=function(e){for(var t=o(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},P.prototype.decrypt=P.prototype.encrypt;var B=function(e){if(!(this instanceof B))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=i(16),this.setValue(e)):this.setBytes(e)};B.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},B.prototype.setBytes=function(e){if(16!=(e=o(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},B.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function(e,t){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof B||(t=new B(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new I(e)};R.prototype.encrypt=function(e){for(var t=o(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},R.prototype.decrypt=R.prototype.encrypt;var j={AES:I,Counter:B,ModeOfOperation:{ecb:O,cbc:T,cfb:k,ofb:P,ctr:R},utils:{hex:c,utf8:s},padding:{pkcs7:{pad:function(e){var t=16-(e=o(e,!0)).length%16,r=i(e.length+t);a(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=o(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var u=i(r);return a(e,u,0,0,r),u}}},_arrayTest:{coerceArray:o,createArray:i,copyArray:a}};e.exports=j}()},2190:function(e){e.exports=function(e,r,n){if(e.filter)return e.filter(r,n);if(null==e)throw new TypeError;if("function"!=typeof r)throw new TypeError;for(var o=[],i=0;i<e.length;i++)if(t.call(e,i)){var a=e[i];r.call(n,a,i,e)&&o.push(a)}return o};var t=Object.prototype.hasOwnProperty},9282:function(e,t,r){"use strict";var n=r(4155);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var i,a,u=r(2136).codes,s=u.ERR_AMBIGUOUS_ARGUMENT,c=u.ERR_INVALID_ARG_TYPE,f=u.ERR_INVALID_ARG_VALUE,l=u.ERR_INVALID_RETURN_VALUE,d=u.ERR_MISSING_ARGS,h=r(5961),p=r(9539).inspect,y=r(9539).types,b=y.isPromise,v=y.isRegExp,g=Object.assign?Object.assign:r(8091).assign,m=Object.is?Object.is:r(609);new Map;function w(){var e=r(9158);i=e.isDeepEqual,a=e.isDeepStrictEqual}var E=!1,_=e.exports=A,C={};function x(e){if(e.message instanceof Error)throw e.message;throw new h(e)}function S(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new h({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw i.generatedMessage=o,i}}function A(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[A,t.length].concat(t))}_.fail=function e(t,r,o,i,a){var u,s=arguments.length;if(0===s)u="Failed";else if(1===s)o=t,t=void 0;else{if(!1===E){E=!0;var c=n.emitWarning?n.emitWarning:console.warn.bind(console);c("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===s&&(i="!=")}if(o instanceof Error)throw o;var f={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:a||e};void 0!==o&&(f.message=o);var l=new h(f);throw u&&(l.message=u,l.generatedMessage=!0),l},_.AssertionError=h,_.ok=A,_.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&x({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},_.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&x({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},_.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),i(t,r)||x({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},_.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),i(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},_.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w(),a(t,r)||x({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},_.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===i&&w();a(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},_.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");m(t,r)||x({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},_.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");m(t,r)&&x({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var I=function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&t[e].test(n[e])?o[e]=n[e]:o[e]=t[e])}))};function O(e,t,r,n,o,i){if(!(r in e)||!a(e[r],t[r])){if(!n){var u=new I(e,o),s=new I(t,o,e),c=new h({actual:u,expected:s,operator:"deepStrictEqual",stackStartFn:i});throw c.actual=e,c.expected=t,c.operator=i.name,c}x({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}function T(e,t,r,n){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new c("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var a=new h({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw a.operator=n.name,a}var u=Object.keys(t);if(t instanceof Error)u.push("name","message");else if(0===u.length)throw new f("error",t,"may not be an empty object");return void 0===i&&w(),u.forEach((function(o){"string"==typeof e[o]&&v(t[o])&&t[o].test(e[o])||O(e,t,o,r,u,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e){if("function"!=typeof e)throw new c("fn","Function",e);try{e()}catch(t){return t}return C}function P(e){return b(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function B(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!P(t=e()))throw new l("instance of Promise","promiseFn",t)}else{if(!P(e))throw new c("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return C})).catch((function(e){return e}))}))}function R(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new c("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new s("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new s("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new c("error",["Object","Error","Function","RegExp"],r);if(t===C){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";x({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:e})}if(r&&!T(t,r,n,e))throw t}function j(e,t,r,n){if(t!==C){if("string"==typeof r&&(n=r,r=void 0),!r||T(t,r)){var o=n?": ".concat(n):".",i="doesNotReject"===e.name?"rejection":"exception";x({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function M(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[M,t.length].concat(t))}_.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];R.apply(void 0,[e,k(t)].concat(n))},_.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return B(t).then((function(t){return R.apply(void 0,[e,t].concat(n))}))},_.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];j.apply(void 0,[e,k(t)].concat(n))},_.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return B(t).then((function(t){return j.apply(void 0,[e,t].concat(n))}))},_.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=p(t);var n=new h({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var u=n.stack.split("\n"),s=0;s<a.length;s++){var c=u.indexOf(a[s]);if(-1!==c){u=u.slice(0,c);break}}n.stack="".concat(u.join("\n"),"\n").concat(a.join("\n"))}throw n}},_.strict=g(M,_,{equal:_.strictEqual,deepEqual:_.deepStrictEqual,notEqual:_.notStrictEqual,notDeepEqual:_.notDeepStrictEqual}),_.strict.strict=_.strict},5961:function(e,t,r){"use strict";var n=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?u(e):t}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,e)},s(e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function f(e,t,r){return f=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&l(o,r.prototype),o},f.apply(null,arguments)}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}var p=r(9539).inspect,y=r(2136).codes.ERR_INVALID_ARG_TYPE;function b(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var v="",g="",m="",w="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function C(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function x(e,t,r){var o="",i="",a=0,u="",s=!1,c=C(e),f=c.split("\n"),l=C(t).split("\n"),d=0,p="";if("strictEqual"===r&&"object"===h(e)&&"object"===h(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===f.length&&1===l.length&&f[0]!==l[0]){var y=f[0].length+l[0].length;if(y<=10){if(!("object"===h(e)&&null!==e||"object"===h(t)&&null!==t||0===e&&0===t))return"".concat(E[r],"\n\n")+"".concat(f[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;f[0][d]===l[0][d];)d++;d>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}}for(var _=f[f.length-1],x=l[l.length-1];_===x&&(d++<2?u="\n ".concat(_).concat(u):o=_,f.pop(),l.pop(),0!==f.length&&0!==l.length);)_=f[f.length-1],x=l[l.length-1];var S=Math.max(f.length,l.length);if(0===S){var A=c.split("\n");if(A.length>30)for(A[26]="".concat(v,"...").concat(w);A.length>27;)A.pop();return"".concat(E.notIdentical,"\n\n").concat(A.join("\n"),"\n")}d>3&&(u="\n".concat(v,"...").concat(w).concat(u),s=!0),""!==o&&(u="\n ".concat(o).concat(u),o="");var I=0,O=E[r]+"\n".concat(g,"+ actual").concat(w," ").concat(m,"- expected").concat(w),T=" ".concat(v,"...").concat(w," Lines skipped");for(d=0;d<S;d++){var k=d-a;if(f.length<d+1)k>1&&d>2&&(k>4?(i+="\n".concat(v,"...").concat(w),s=!0):k>3&&(i+="\n ".concat(l[d-2]),I++),i+="\n ".concat(l[d-1]),I++),a=d,o+="\n".concat(m,"-").concat(w," ").concat(l[d]),I++;else if(l.length<d+1)k>1&&d>2&&(k>4?(i+="\n".concat(v,"...").concat(w),s=!0):k>3&&(i+="\n ".concat(f[d-2]),I++),i+="\n ".concat(f[d-1]),I++),a=d,i+="\n".concat(g,"+").concat(w," ").concat(f[d]),I++;else{var P=l[d],B=f[d],R=B!==P&&(!b(B,",")||B.slice(0,-1)!==P);R&&b(P,",")&&P.slice(0,-1)===B&&(R=!1,B+=","),R?(k>1&&d>2&&(k>4?(i+="\n".concat(v,"...").concat(w),s=!0):k>3&&(i+="\n ".concat(f[d-2]),I++),i+="\n ".concat(f[d-1]),I++),a=d,i+="\n".concat(g,"+").concat(w," ").concat(B),o+="\n".concat(m,"-").concat(w," ").concat(P),I+=2):(i+=o,o="",1!==k&&0!==d||(i+="\n ".concat(B),I++))}if(I>20&&d<S-2)return"".concat(O).concat(T,"\n").concat(i,"\n").concat(v,"...").concat(w).concat(o,"\n")+"".concat(v,"...").concat(w)}return"".concat(O).concat(s?T:"","\n").concat(i).concat(o).concat(u).concat(p)}var S=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==h(e)||null===e)throw new y("options","Object",e);var o=e.message,i=e.operator,s=e.stackStartFn,c=e.actual,f=e.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=o)r=a(this,d(t).call(this,String(o)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="",g="",w="",m=""):(v="",g="",w="",m="")),"object"===h(c)&&null!==c&&"object"===h(f)&&null!==f&&"stack"in c&&c instanceof Error&&"stack"in f&&f instanceof Error&&(c=_(c),f=_(f)),"deepStrictEqual"===i||"strictEqual"===i)r=a(this,d(t).call(this,x(c,f,i)));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var p=E[i],b=C(c).split("\n");if("notStrictEqual"===i&&"object"===h(c)&&null!==c&&(p=E.notStrictEqualObject),b.length>30)for(b[26]="".concat(v,"...").concat(w);b.length>27;)b.pop();r=1===b.length?a(this,d(t).call(this,"".concat(p," ").concat(b[0]))):a(this,d(t).call(this,"".concat(p,"\n\n").concat(b.join("\n"),"\n")))}else{var S=C(c),A="",I=E[i];"notDeepEqual"===i||"notEqual"===i?(S="".concat(E[i],"\n\n").concat(S)).length>1024&&(S="".concat(S.slice(0,1021),"...")):(A="".concat(C(f)),S.length>512&&(S="".concat(S.slice(0,509),"...")),A.length>512&&(A="".concat(A.slice(0,509),"...")),"deepEqual"===i||"equal"===i?S="".concat(I,"\n\n").concat(S,"\n\nshould equal\n\n"):A=" ".concat(i," ").concat(A)),r=a(this,d(t).call(this,"".concat(S).concat(A)))}return Error.stackTraceLimit=l,r.generatedMessage=!o,Object.defineProperty(u(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=f,r.operator=i,Error.captureStackTrace&&Error.captureStackTrace(u(r),s),r.stack,r.name="AssertionError",a(r)}var r,s,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e),r=t,s=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],s&&i(r.prototype,s),c&&i(r,c),t}(s(Error));e.exports=S},2136:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var u,s,c={};function f(e,t,r){r||(r=Error);var n=function(r){function n(r,a,u){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s=o(this,i(n).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,a,u))),s.code=e,s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,r),n}(r);c[e]=n}function l(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(e,t,o){var i,a,s,c;if(void 0===u&&(u=r(9282)),u("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(!s||s<0?0:+s,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))c="The ".concat(e," ").concat(i," ").concat(l(t,"type"));else{var f=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";c='The "'.concat(e,'" ').concat(f," ").concat(i," ").concat(l(t,"type"))}return c+=". Received type ".concat(n(o))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(9539));var o=s.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===u&&(u=r(9282)),u(t.length>0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),e.exports.codes=c},9158:function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(s){o=!0,i=s}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var i=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},u=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},s=Object.is?Object.is:r(609),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(360);function l(e){return e.call.bind(e)}var d=l(Object.prototype.hasOwnProperty),h=l(Object.prototype.propertyIsEnumerable),p=l(Object.prototype.toString),y=r(9539).types,b=y.isAnyArrayBuffer,v=y.isArrayBufferView,g=y.isDate,m=y.isMap,w=y.isRegExp,E=y.isSet,_=y.isNativeError,C=y.isBoxedPrimitive,x=y.isNumberObject,S=y.isStringObject,A=y.isBooleanObject,I=y.isBigIntObject,O=y.isSymbolObject,T=y.isFloat32Array,k=y.isFloat64Array;function P(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function B(e){return Object.keys(e).filter(P).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function R(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function j(e,t,r,n){if(e===t)return 0!==e||(!r||s(e,t));if(r){if("object"!==o(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var a,u,c,l,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var h=B(e),y=B(t);return h.length===y.length&&N(e,t,r,n,1,h)}if("[object Object]"===d&&(!m(e)&&m(t)||!E(e)&&E(t)))return!1;if(g(e)){if(!g(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,l=t,!(i?c.source===l.source&&c.flags===l.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(l))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!T(e)&&!k(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===R(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var P=B(e),j=B(t);return P.length===j.length&&N(e,t,r,n,0,P)}if(E(e))return!(!E(t)||e.size!==t.size)&&N(e,t,r,n,2);if(m(e))return!(!m(t)||e.size!==t.size)&&N(e,t,r,n,3);if(b(e)){if(u=t,(a=e).byteLength!==u.byteLength||0!==R(new Uint8Array(a),new Uint8Array(u)))return!1}else if(C(e)&&!function(e,t){return x(e)?x(t)&&s(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):S(e)?S(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):I(e)?I(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):O(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return N(e,t,r,n,0)}function M(e,t){return t.filter((function(t){return h(e,t)}))}function N(e,t,r,n,o,i){if(5===arguments.length){i=Object.keys(e);var a=Object.keys(t);if(i.length!==a.length)return!1}for(var u=0;u<i.length;u++)if(!d(t,i[u]))return!1;if(r&&5===arguments.length){var s=c(e);if(0!==s.length){var f=0;for(u=0;u<s.length;u++){var l=s[u];if(h(e,l)){if(!h(t,l))return!1;i.push(l),f++}else if(h(t,l))return!1}var p=c(t);if(s.length!==p.length&&M(t,p).length!==f)return!1}else{var y=c(t);if(0!==y.length&&0!==M(t,y).length)return!1}}if(0===i.length&&(0===o||1===o&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var b=n.val1.get(e);if(void 0!==b){var v=n.val2.get(t);if(void 0!==v)return b===v}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var g=F(e,t,r,i,n,o);return n.val1.delete(e),n.val2.delete(t),g}function D(e,t,r,n){for(var o=a(e),i=0;i<o.length;i++){var u=o[i];if(j(t,u,r,n))return e.delete(u),!0}return!1}function L(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(f(e))return!1}return!0}function U(e,t,r){var n=L(r);return null!=n?n:t.has(n)&&!e.has(n)}function H(e,t,r,n,o){var i=L(r);if(null!=i)return i;var a=t.get(i);return!(void 0===a&&!t.has(i)||!j(n,a,!1,o))&&(!e.has(i)&&j(n,a,!1,o))}function K(e,t,r,n,o,i){for(var u=a(e),s=0;s<u.length;s++){var c=u[s];if(j(r,c,o,i)&&j(n,t.get(c),o,i))return e.delete(c),!0}return!1}function F(e,t,r,i,s,c){var f=0;if(2===c){if(!function(e,t,r,n){for(var i=null,u=a(e),s=0;s<u.length;s++){var c=u[s];if("object"===o(c)&&null!==c)null===i&&(i=new Set),i.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===i&&(i=new Set),i.add(c)}}if(null!==i){for(var f=a(t),l=0;l<f.length;l++){var d=f[l];if("object"===o(d)&&null!==d){if(!D(i,d,r,n))return!1}else if(!r&&!e.has(d)&&!D(i,d,r,n))return!1}return 0===i.size}return!0}(e,t,r,s))return!1}else if(3===c){if(!function(e,t,r,i){for(var a=null,s=u(e),c=0;c<s.length;c++){var f=n(s[c],2),l=f[0],d=f[1];if("object"===o(l)&&null!==l)null===a&&(a=new Set),a.add(l);else{var h=t.get(l);if(void 0===h&&!t.has(l)||!j(d,h,r,i)){if(r)return!1;if(!H(e,t,l,d,i))return!1;null===a&&(a=new Set),a.add(l)}}}if(null!==a){for(var p=u(t),y=0;y<p.length;y++){var b=n(p[y],2),v=(l=b[0],b[1]);if("object"===o(l)&&null!==l){if(!K(a,e,l,v,r,i))return!1}else if(!(r||e.has(l)&&j(e.get(l),v,!1,i)||K(a,e,l,v,!1,i)))return!1}return 0===a.size}return!0}(e,t,r,s))return!1}else if(1===c)for(;f<e.length;f++){if(!d(e,f)){if(d(t,f))return!1;for(var l=Object.keys(e);f<l.length;f++){var h=l[f];if(!d(t,h)||!j(e[h],t[h],r,s))return!1}return l.length===Object.keys(t).length}if(!d(t,f)||!j(e[f],t[f],r,s))return!1}for(f=0;f<i.length;f++){var p=i[f];if(!j(e[p],t[p],r,s))return!1}return!0}e.exports={isDeepEqual:function(e,t){return j(e,t,false)},isDeepStrictEqual:function(e,t){return j(e,t,true)}}},2383:function(){function e(e,t,r){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r})}e(Object,"assign",(function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;++t){var r=arguments[t];if(null!=r)for(var n=0,o=Object.keys(r);n<o.length;n++){var i=o[n];e[i]=r[i]}}return e})),e(Array.prototype,"fill",(function(e,t,r){var n=this.length;function o(e){return e<0?Math.max(n+e,0):Math.min(e,n)}for(var i=null!=t?o(t):0,a=null!=r?o(r):n,u=i;u<a;++u)this[u]=e;return this})),e(Array.prototype,"find",(function(e,t){for(var r=0;r<this.length;++r){var n=this[r];if(e.call(t,n,r,this))return n}})),e(Array.prototype,"includes",(function(e){return Array.prototype.indexOf.call(this,e)>=0})),e(Uint8Array.prototype,"fill",Array.prototype.fill)},8823:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=c(e);if(t){var o=c(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return u(this,r)}}function u(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var l=r(9742),d=r(645),h="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=b,t.SlowBuffer=function(e){+e!=e&&(e=0);return b.alloc(+e)},t.INSPECT_MAX_BYTES=50;var p=2147483647;function y(e){if(e>p)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,b.prototype),t}function b(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return m(e)}return v(e,t,r)}function v(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!b.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|C(e,t),n=y(r),o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(ne(e,Uint8Array)){var t=new Uint8Array(e);return E(t.buffer,t.byteOffset,t.byteLength)}return w(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+f(e));if(ne(e,ArrayBuffer)||e&&ne(e.buffer,ArrayBuffer))return E(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(ne(e,SharedArrayBuffer)||e&&ne(e.buffer,SharedArrayBuffer)))return E(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return b.from(n,t,r);var o=function(e){if(b.isBuffer(e)){var t=0|_(e.length),r=y(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||oe(e.length)?y(0):w(e);if("Buffer"===e.type&&Array.isArray(e.data))return w(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return b.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+f(e))}function g(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function m(e){return g(e),y(e<0?0:0|_(e))}function w(e){for(var t=e.length<0?0:0|_(e.length),r=y(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function E(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,b.prototype),n}function _(e){if(e>=p)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p.toString(16)+" bytes");return 0|e}function C(e,t){if(b.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ne(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+f(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ee(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return te(e).length;default:if(o)return n?-1:ee(e).length;t=(""+t).toLowerCase(),o=!0}}function x(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return j(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),oe(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=b.from(t,n)),b.isBuffer(t))return 0===t.length?-1:I(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):I(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function I(e,t,r,n,o){var i,a=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var f=-1;for(i=r;i<u;i++)if(c(e,i)===c(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*a}else-1!==f&&(i-=i-f),f=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var l=!0,d=0;d<s;d++)if(c(e,i+d)!==c(t,d)){l=!1;break}if(l)return i}return-1}function O(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i,a=t.length;for(n>a/2&&(n=a/2),i=0;i<n;++i){var u=parseInt(t.substr(2*i,2),16);if(oe(u))return i;e[r+i]=u}return i}function T(e,t,r,n){return re(ee(t,e.length-r),e,r,n)}function k(e,t,r,n){return re(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function P(e,t,r,n){return re(te(t),e,r,n)}function B(e,t,r,n){return re(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?l.fromByteArray(e):l.fromByteArray(e.slice(t,r))}function j(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i=e[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var s=void 0,c=void 0,f=void 0,l=void 0;switch(u){case 1:i<128&&(a=i);break;case 2:128==(192&(s=e[o+1]))&&(l=(31&i)<<6|63&s)>127&&(a=l);break;case 3:s=e[o+1],c=e[o+2],128==(192&s)&&128==(192&c)&&(l=(15&i)<<12|(63&s)<<6|63&c)>2047&&(l<55296||l>57343)&&(a=l);break;case 4:s=e[o+1],c=e[o+2],f=e[o+3],128==(192&s)&&128==(192&c)&&128==(192&f)&&(l=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(a=l)}}null===a?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=u}return function(e){var t=e.length;if(t<=M)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=M));return r}(n)}t.kMaxLength=p,b.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(r){return!1}}(),b.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}}),b.poolSize=8192,b.from=function(e,t,r){return v(e,t,r)},Object.setPrototypeOf(b.prototype,Uint8Array.prototype),Object.setPrototypeOf(b,Uint8Array),b.alloc=function(e,t,r){return function(e,t,r){return g(e),e<=0?y(e):void 0!==t?"string"==typeof r?y(e).fill(t,r):y(e).fill(t):y(e)}(e,t,r)},b.allocUnsafe=function(e){return m(e)},b.allocUnsafeSlow=function(e){return m(e)},b.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==b.prototype},b.compare=function(e,t){if(ne(e,Uint8Array)&&(e=b.from(e,e.offset,e.byteLength)),ne(t,Uint8Array)&&(t=b.from(t,t.offset,t.byteLength)),!b.isBuffer(e)||!b.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},b.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},b.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return b.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=b.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(ne(i,Uint8Array))o+i.length>n.length?(b.isBuffer(i)||(i=b.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else{if(!b.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},b.byteLength=C,b.prototype._isBuffer=!0,b.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)S(this,t,t+1);return this},b.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)S(this,t,t+3),S(this,t+1,t+2);return this},b.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)S(this,t,t+7),S(this,t+1,t+6),S(this,t+2,t+5),S(this,t+3,t+4);return this},b.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?j(this,0,e):x.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(e){if(!b.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===b.compare(this,e)},b.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},h&&(b.prototype[h]=b.prototype.inspect),b.prototype.compare=function(e,t,r,n,o){if(ne(e,Uint8Array)&&(e=b.from(e,e.offset,e.byteLength)),!b.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+f(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),u=Math.min(i,a),s=this.slice(n,o),c=e.slice(t,r),l=0;l<u;++l)if(s[l]!==c[l]){i=s[l],a=c[l];break}return i<a?-1:a<i?1:0},b.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},b.prototype.indexOf=function(e,t,r){return A(this,e,t,r,!0)},b.prototype.lastIndexOf=function(e,t,r){return A(this,e,t,r,!1)},b.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,e,t,r);case"utf8":case"utf-8":return T(this,e,t,r);case"ascii":case"latin1":case"binary":return k(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function N(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function L(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=ie[e[i]];return o}function U(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function H(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function K(e,t,r,n,o,i){if(!b.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function F(e,t,r,n,o){Z(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function G(e,t,r,n,o){Z(t,n,o,e,r,7);var i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function q(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(e,t,r,n,o){return t=+t,r>>>=0,o||q(e,0,r,4),d.write(e,t,r,n,23,4),r+4}function W(e,t,r,n,o){return t=+t,r>>>=0,o||q(e,0,r,8),d.write(e,t,r,n,52,8),r+8}b.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,b.prototype),n},b.prototype.readUintLE=b.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},b.prototype.readUintBE=b.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},b.prototype.readUint8=b.prototype.readUInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),this[e]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]|this[e+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(e,t){return e>>>=0,t||H(e,2,this.length),this[e]<<8|this[e+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},b.prototype.readBigUInt64LE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),o=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(o)<<BigInt(32))})),b.prototype.readBigUInt64BE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],o=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),b.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},b.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||H(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},b.prototype.readInt8=function(e,t){return e>>>=0,t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},b.prototype.readInt16LE=function(e,t){e>>>=0,t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt16BE=function(e,t){e>>>=0,t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},b.prototype.readInt32LE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},b.prototype.readInt32BE=function(e,t){return e>>>=0,t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},b.prototype.readBigInt64LE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))})),b.prototype.readBigInt64BE=ae((function(e){X(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r)})),b.prototype.readFloatLE=function(e,t){return e>>>=0,t||H(e,4,this.length),d.read(this,e,!0,23,4)},b.prototype.readFloatBE=function(e,t){return e>>>=0,t||H(e,4,this.length),d.read(this,e,!1,23,4)},b.prototype.readDoubleLE=function(e,t){return e>>>=0,t||H(e,8,this.length),d.read(this,e,!0,52,8)},b.prototype.readDoubleBE=function(e,t){return e>>>=0,t||H(e,8,this.length),d.read(this,e,!1,52,8)},b.prototype.writeUintLE=b.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},b.prototype.writeUint8=b.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,1,255,0),this[t]=255&e,t+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},b.prototype.writeBigUInt64LE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),b.prototype.writeBigUInt64BE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return G(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),b.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);K(this,e,t,r,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+r},b.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);K(this,e,t,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+r},b.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},b.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},b.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},b.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},b.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||K(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},b.prototype.writeBigInt64LE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),b.prototype.writeBigInt64BE=ae((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return G(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),b.prototype.writeFloatLE=function(e,t,r){return z(this,e,t,!0,r)},b.prototype.writeFloatBE=function(e,t,r){return z(this,e,t,!1,r)},b.prototype.writeDoubleLE=function(e,t,r){return W(this,e,t,!0,r)},b.prototype.writeDoubleBE=function(e,t,r){return W(this,e,t,!1,r)},b.prototype.copy=function(e,t,r,n){if(!b.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},b.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!b.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=b.isBuffer(e)?e:b.from(e,n),u=a.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%u]}return this};var V={};function Y(e,t,r){V[e]=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(d,r);var u,c,f,l=a(d);function d(){var r;return n(this,d),r=l.call(this),Object.defineProperty(s(r),"message",{value:t.apply(s(r),arguments),writable:!0,configurable:!0}),r.name="".concat(r.name," [").concat(e,"]"),r.stack,delete r.name,r}return u=d,(c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}},{key:"code",get:function(){return e},set:function(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}}])&&o(u.prototype,c),f&&o(u,f),d}(r)}function J(e){for(var t="",r=e.length,n="-"===e[0]?1:0;r>=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function Z(e,t,r,n,o,i){if(e>r||e<t){var a,u="bigint"==typeof t?"n":"";throw a=i>3?0===t||t===BigInt(0)?">= 0".concat(u," and < 2").concat(u," ** ").concat(8*(i+1)).concat(u):">= -(2".concat(u," ** ").concat(8*(i+1)-1).concat(u,") and < 2 ** ")+"".concat(8*(i+1)-1).concat(u):">= ".concat(t).concat(u," and <= ").concat(r).concat(u),new V.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,r){X(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,o,i)}function X(e,t){if("number"!=typeof e)throw new V.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw X(e,r),new V.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new V.ERR_BUFFER_OUT_OF_BOUNDS;throw new V.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}Y("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),Y("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(f(t))}),TypeError),Y("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?o=J(String(r)):"bigint"==typeof r&&(o=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(o=J(o)),o+="n"),n+=" It must be ".concat(t,". Received ").concat(o)}),RangeError);var Q=/[^+/0-9A-Za-z-_]/g;function ee(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function te(e){return l.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function re(e,t,r,n){var o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function ne(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function oe(e){return e!=e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}();function ae(e){return"undefined"==typeof BigInt?ue:e}function ue(){throw new Error("BigInt not supported")}},9176:function(e){e.exports=function(e){for(var t={},r=e.length,n=e.charAt(0),o=0;o<e.length;o++)t[e.charAt(o)]=o;function i(e){if(0===e.length)return[];for(var o=[0],i=0;i<e.length;i++){var a=t[e[i]];if(void 0===a)return;for(var u=0,s=a;u<o.length;++u)s+=o[u]*r,o[u]=255&s,s>>=8;for(;s>0;)o.push(255&s),s>>=8}for(var c=0;e[c]===n&&c<e.length-1;++c)o.push(0);return o.reverse()}return{encode:function(t){if(0===t.length)return"";for(var n=[0],o=0;o<t.length;++o){for(var i=0,a=t[o];i<n.length;++i)a+=n[i]<<8,n[i]=a%r,a=a/r|0;for(;a>0;)n.push(a%r),a=a/r|0}for(var u="",s=0;0===t[s]&&s<t.length-1;++s)u+=e[0];for(var c=n.length-1;c>=0;--c)u+=e[n[c]];return u},decodeUnsafe:i,decode:function(e){var t=i(e);if(t)return t;throw new Error("Non-base"+r+" character")}}}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),f=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,u=0,s=n-o;u<s;u+=a)i.push(c(e,u,u+a>s?s:u+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=i.length;a<u;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,a=[],u=t;u<n;u+=3)o=(e[u]<<16&16711680)+(e[u+1]<<8&65280)+(255&e[u+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3027:function(e,t,r){var n=r(9509).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,o=t.length;if(0===r)throw new Error("R length is zero");if(0===o)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(o>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(o>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=n.allocUnsafe(6+r+o);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i}}},3550:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(S){}function u(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=u(e,r);return r-1>=t&&(n|=u(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a<i;a++){var u=e.charCodeAt(a)-48;o*=n,o+=u>=49?u-49+10:u>=17?u-17+10:u}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,u=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<u&67108863,this.words[i+1]=a>>>26-u&67108863,(u+=24)>=26&&(u-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,u=Math.min(i,i-a)+r,s=0,f=r;f<u;f+=n)s=c(e,f,f+n,t),this.imuln(o),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==a){var l=1;for(s=c(e,f,e.length,t),f=0;f<a;f++)l*=t;this.imuln(l),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,u=67108863&a,s=a/67108864|0;r.words[0]=u;for(var c=1;c<n;c++){for(var f=s>>>26,l=67108863&s,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;f+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,s=0|f}return 0!==s?r.words[c]=0|s:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var u=this.words[a],s=(16777215&(u<<o|i)).toString(16);r=0!==(i=u>>>24-o&16777215)||a!==this.length-1?f[6-s.length]+s+r:s+r,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,u,s="le"===t,c=new e(i),f=this.clone();if(s){for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[u]=a;for(;u<i;u++)c[u]=0}else{for(u=0;u<i-o;u++)c[u]=0;for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[i-u-1]=a}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)i=(t=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<r.length;a++)i=(t=(0|r.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,o,i,a=e.words,u=t.words,s=r.words,c=0,f=0|a[0],l=8191&f,d=f>>>13,h=0|a[1],p=8191&h,y=h>>>13,b=0|a[2],v=8191&b,g=b>>>13,m=0|a[3],w=8191&m,E=m>>>13,_=0|a[4],C=8191&_,x=_>>>13,S=0|a[5],A=8191&S,I=S>>>13,O=0|a[6],T=8191&O,k=O>>>13,P=0|a[7],B=8191&P,R=P>>>13,j=0|a[8],M=8191&j,N=j>>>13,D=0|a[9],L=8191&D,U=D>>>13,H=0|u[0],K=8191&H,F=H>>>13,G=0|u[1],q=8191&G,z=G>>>13,W=0|u[2],V=8191&W,Y=W>>>13,J=0|u[3],Z=8191&J,X=J>>>13,$=0|u[4],Q=8191&$,ee=$>>>13,te=0|u[5],re=8191&te,ne=te>>>13,oe=0|u[6],ie=8191&oe,ae=oe>>>13,ue=0|u[7],se=8191&ue,ce=ue>>>13,fe=0|u[8],le=8191&fe,de=fe>>>13,he=0|u[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(c+(n=Math.imul(l,K))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(d,K)|0))<<13)|0;c=((i=Math.imul(d,F))+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(p,K),o=(o=Math.imul(p,F))+Math.imul(y,K)|0,i=Math.imul(y,F);var ve=(c+(n=n+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,z)|0)+Math.imul(d,q)|0))<<13)|0;c=((i=i+Math.imul(d,z)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,K),o=(o=Math.imul(v,F))+Math.imul(g,K)|0,i=Math.imul(g,F),n=n+Math.imul(p,q)|0,o=(o=o+Math.imul(p,z)|0)+Math.imul(y,q)|0,i=i+Math.imul(y,z)|0;var ge=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(d,V)|0))<<13)|0;c=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),o=(o=Math.imul(w,F))+Math.imul(E,K)|0,i=Math.imul(E,F),n=n+Math.imul(v,q)|0,o=(o=o+Math.imul(v,z)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,z)|0,n=n+Math.imul(p,V)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Y)|0;var me=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(o=(o=o+Math.imul(l,X)|0)+Math.imul(d,Z)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(C,K),o=(o=Math.imul(C,F))+Math.imul(x,K)|0,i=Math.imul(x,F),n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,z)|0)+Math.imul(E,q)|0,i=i+Math.imul(E,z)|0,n=n+Math.imul(v,V)|0,o=(o=o+Math.imul(v,Y)|0)+Math.imul(g,V)|0,i=i+Math.imul(g,Y)|0,n=n+Math.imul(p,Z)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,Z)|0,i=i+Math.imul(y,X)|0;var we=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(d,Q)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,K),o=(o=Math.imul(A,F))+Math.imul(I,K)|0,i=Math.imul(I,F),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,z)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,z)|0,n=n+Math.imul(w,V)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(v,Z)|0,o=(o=o+Math.imul(v,X)|0)+Math.imul(g,Z)|0,i=i+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0;var Ee=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(o=(o=o+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,K),o=(o=Math.imul(T,F))+Math.imul(k,K)|0,i=Math.imul(k,F),n=n+Math.imul(A,q)|0,o=(o=o+Math.imul(A,z)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,z)|0,n=n+Math.imul(C,V)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(x,V)|0,i=i+Math.imul(x,Y)|0,n=n+Math.imul(w,Z)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(E,Z)|0,i=i+Math.imul(E,X)|0,n=n+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var _e=(c+(n=n+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,K),o=(o=Math.imul(B,F))+Math.imul(R,K)|0,i=Math.imul(R,F),n=n+Math.imul(T,q)|0,o=(o=o+Math.imul(T,z)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,z)|0,n=n+Math.imul(A,V)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(I,V)|0,i=i+Math.imul(I,Y)|0,n=n+Math.imul(C,Z)|0,o=(o=o+Math.imul(C,X)|0)+Math.imul(x,Z)|0,i=i+Math.imul(x,X)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(v,re)|0,o=(o=o+Math.imul(v,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var Ce=(c+(n=n+Math.imul(l,se)|0)|0)+((8191&(o=(o=o+Math.imul(l,ce)|0)+Math.imul(d,se)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(M,K),o=(o=Math.imul(M,F))+Math.imul(N,K)|0,i=Math.imul(N,F),n=n+Math.imul(B,q)|0,o=(o=o+Math.imul(B,z)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,z)|0,n=n+Math.imul(T,V)|0,o=(o=o+Math.imul(T,Y)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(A,Z)|0,o=(o=o+Math.imul(A,X)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,X)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,n=n+Math.imul(p,se)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,se)|0,i=i+Math.imul(y,ce)|0;var xe=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,K),o=(o=Math.imul(L,F))+Math.imul(U,K)|0,i=Math.imul(U,F),n=n+Math.imul(M,q)|0,o=(o=o+Math.imul(M,z)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,z)|0,n=n+Math.imul(B,V)|0,o=(o=o+Math.imul(B,Y)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Z)|0,o=(o=o+Math.imul(T,X)|0)+Math.imul(k,Z)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(A,Q)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,ae)|0,n=n+Math.imul(v,se)|0,o=(o=o+Math.imul(v,ce)|0)+Math.imul(g,se)|0,i=i+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,le)|0,i=i+Math.imul(y,de)|0;var Se=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,q),o=(o=Math.imul(L,z))+Math.imul(U,q)|0,i=Math.imul(U,z),n=n+Math.imul(M,V)|0,o=(o=o+Math.imul(M,Y)|0)+Math.imul(N,V)|0,i=i+Math.imul(N,Y)|0,n=n+Math.imul(B,Z)|0,o=(o=o+Math.imul(B,X)|0)+Math.imul(R,Z)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(T,Q)|0,o=(o=o+Math.imul(T,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(I,re)|0,i=i+Math.imul(I,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(w,se)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(E,se)|0,i=i+Math.imul(E,ce)|0,n=n+Math.imul(v,le)|0,o=(o=o+Math.imul(v,de)|0)+Math.imul(g,le)|0,i=i+Math.imul(g,de)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,V),o=(o=Math.imul(L,Y))+Math.imul(U,V)|0,i=Math.imul(U,Y),n=n+Math.imul(M,Z)|0,o=(o=o+Math.imul(M,X)|0)+Math.imul(N,Z)|0,i=i+Math.imul(N,X)|0,n=n+Math.imul(B,Q)|0,o=(o=o+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,o=(o=o+Math.imul(T,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,n=n+Math.imul(C,se)|0,o=(o=o+Math.imul(C,ce)|0)+Math.imul(x,se)|0,i=i+Math.imul(x,ce)|0,n=n+Math.imul(w,le)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(E,le)|0,i=i+Math.imul(E,de)|0;var Ie=(c+(n=n+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,ye)|0)+Math.imul(g,pe)|0))<<13)|0;c=((i=i+Math.imul(g,ye)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,Z),o=(o=Math.imul(L,X))+Math.imul(U,Z)|0,i=Math.imul(U,X),n=n+Math.imul(M,Q)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(N,Q)|0,i=i+Math.imul(N,ee)|0,n=n+Math.imul(B,re)|0,o=(o=o+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,o=(o=o+Math.imul(T,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(A,se)|0,o=(o=o+Math.imul(A,ce)|0)+Math.imul(I,se)|0,i=i+Math.imul(I,ce)|0,n=n+Math.imul(C,le)|0,o=(o=o+Math.imul(C,de)|0)+Math.imul(x,le)|0,i=i+Math.imul(x,de)|0;var Oe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(E,pe)|0))<<13)|0;c=((i=i+Math.imul(E,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,Q),o=(o=Math.imul(L,ee))+Math.imul(U,Q)|0,i=Math.imul(U,ee),n=n+Math.imul(M,re)|0,o=(o=o+Math.imul(M,ne)|0)+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,n=n+Math.imul(B,ie)|0,o=(o=o+Math.imul(B,ae)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,ae)|0,n=n+Math.imul(T,se)|0,o=(o=o+Math.imul(T,ce)|0)+Math.imul(k,se)|0,i=i+Math.imul(k,ce)|0,n=n+Math.imul(A,le)|0,o=(o=o+Math.imul(A,de)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,de)|0;var Te=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((i=i+Math.imul(x,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,re),o=(o=Math.imul(L,ne))+Math.imul(U,re)|0,i=Math.imul(U,ne),n=n+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,n=n+Math.imul(B,se)|0,o=(o=o+Math.imul(B,ce)|0)+Math.imul(R,se)|0,i=i+Math.imul(R,ce)|0,n=n+Math.imul(T,le)|0,o=(o=o+Math.imul(T,de)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,de)|0;var ke=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,ye)|0)+Math.imul(I,pe)|0))<<13)|0;c=((i=i+Math.imul(I,ye)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,ie),o=(o=Math.imul(L,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),n=n+Math.imul(M,se)|0,o=(o=o+Math.imul(M,ce)|0)+Math.imul(N,se)|0,i=i+Math.imul(N,ce)|0,n=n+Math.imul(B,le)|0,o=(o=o+Math.imul(B,de)|0)+Math.imul(R,le)|0,i=i+Math.imul(R,de)|0;var Pe=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(o=(o=o+Math.imul(T,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((i=i+Math.imul(k,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,se),o=(o=Math.imul(L,ce))+Math.imul(U,se)|0,i=Math.imul(U,ce),n=n+Math.imul(M,le)|0,o=(o=o+Math.imul(M,de)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,de)|0;var Be=(c+(n=n+Math.imul(B,pe)|0)|0)+((8191&(o=(o=o+Math.imul(B,ye)|0)+Math.imul(R,pe)|0))<<13)|0;c=((i=i+Math.imul(R,ye)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,le),o=(o=Math.imul(L,de))+Math.imul(U,le)|0,i=Math.imul(U,de);var Re=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((i=i+Math.imul(N,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863;var je=(c+(n=Math.imul(L,pe))|0)+((8191&(o=(o=Math.imul(L,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((i=Math.imul(U,ye))+(o>>>13)|0)+(je>>>26)|0,je&=67108863,s[0]=be,s[1]=ve,s[2]=ge,s[3]=me,s[4]=we,s[5]=Ee,s[6]=_e,s[7]=Ce,s[8]=xe,s[9]=Se,s[10]=Ae,s[11]=Ie,s[12]=Oe,s[13]=Te,s[14]=ke,s[15]=Pe,s[16]=Be,s[17]=Re,s[18]=je,0!==c&&(s[19]=c,r.length++),r};function y(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(p=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var u=67108863&n,s=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=s;c++){var f=i-c,l=(0|e.words[f])*(0|t.words[c]),d=67108863&l;u=67108863&(d=d+u|0),o+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[i]=u,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,o=0;o<t;o++)n|=(1&e)<<t-o-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a<i;a++)n[a]=t[e[a]],o[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,o,i){this.permute(i,e,t,r,n,o);for(var a=1;a<o;a<<=1)for(var u=a<<1,s=Math.cos(2*Math.PI/u),c=Math.sin(2*Math.PI/u),f=0;f<o;f+=u)for(var l=s,d=c,h=0;h<a;h++){var p=r[f+h],y=n[f+h],b=r[f+h+a],v=n[f+h+a],g=l*b-d*v;v=l*v+d*b,b=g,r[f+h]=p+b,n[f+h]=y+v,r[f+h+a]=p-b,n[f+h+a]=y-v,h!==u&&(g=s*l-c*d,d=s*d+c*l,l=g)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=e[n];e[n]=e[r-n-1],e[r-n-1]=o,o=t[n],t[n]=-t[r-n-1],t[r-n-1]=-o}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var o=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&o,r=o<67108864?0:o/67108864|0}return e},b.prototype.convert13b=function(e,t,r,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)r[a]=0;n(0===i),n(0==(-8192&i))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),u=new Array(n),s=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,i,u,s,n,o),this.transform(c,i,f,l,n,o);for(var h=0;h<n;h++){var p=u[h]*f[h]-s[h]*l[h];s[h]=u[h]*l[h]+s[h]*f[h],u[h]=p}return this.conjugate(u,s,n),this.transform(u,s,d,i,n,o),this.conjugate(d,i,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var o=(0|this.words[r])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=(e.words[n]&1<<o)>>>o}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var u=this.words[t]&i,s=(0|this.words[t])-u<<r;this.words[t]=s|a,a=u>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),u=67108863^67108863>>>i<<i,s=r;if(o-=a,o=Math.max(0,o),s){for(var c=0;c<a;c++)s.words[c]=this.words[c];s.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=o);c--){var l=0|this.words[c];this.words[c]=f<<26-i|l>>>i,f=l&u}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r)&&!!(this.words[r]&o)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var u=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+u;var s=(0|e.words[o])*t;u=((i-=67108863&s)>>26)-(s/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)u=(i=(0|this.words[o+r])+u)>>26,this.words[o+r]=67108863&i;if(0===u)return this.strip();for(n(-1===u),u=0,o=0;o<this.length;o++)u=(i=-(0|this.words[o])+u)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var u,s=n.length-o.length;if("mod"!==t){(u=new i(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c<u.length;c++)u.words[c]=0}var f=n.clone()._ishlnsubmul(o,1,s);0===f.negative&&(n=f,u&&(u.words[s]=1));for(var l=s-1;l>=0;l--){var d=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(u=this.neg().divmod(e,t),"mod"!==t&&(o=u.div.neg()),"div"!==t&&(a=u.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(u=this.divmod(e.neg(),t),"mod"!==t&&(o=u.div.neg()),{div:o,mod:u.mod}):0!=(this.negative&e.negative)?(u=this.neg().divmod(e.neg(),t),"div"!==t&&(a=u.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:u.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,u},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),u=new i(0),s=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(f),s.isub(l)),u.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(u),a.isub(s)):(r.isub(t),u.isub(o),s.isub(a))}return{a:u,b:s,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),u=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(u)):(r.isub(t),u.isub(a))}return(o=0===t.cmpn(1)?a:u).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var u=0|this.words[a];i=(u+=i)>>>26,u&=67108863,this.words[a]=u}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(m,g),m.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&r)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(w,g),o(E,g),o(_,g),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new w;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return v[e]=t,t},C.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},C.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var u=new i(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(s);)f.redIAdd(s);for(var l=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(u);){for(var y=h,b=0;0!==y.cmp(u);b++)y=y.redSqr();n(b<p);var v=this.pow(l,new i(1).iushln(p-b-1));d=d.redMul(v),l=v.redSqr(),h=h.redMul(l),p=b}return d},C.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},C.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,u=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=s-1;f>=0;f--){var l=c>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++u||0===n&&0===f)&&(o=this.mul(o,r[a]),u=0,a=0)):u=0}s=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,C),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9931:function(e,t,r){var n;function o(e){this.rand=e}if(e.exports=function(e){return n||(n=new o(null)),n.generate(e)},e.exports.Rand=o,o.prototype.generate=function(e){return this._rand(e)},o.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(o.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var i=r(9214);if("function"!=typeof i.randomBytes)throw new Error("Not supported");o.prototype._rand=function(e){return i.randomBytes(e)}}catch(a){}},1924:function(e,t,r){"use strict";var n=r(210),o=r(5559),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},5559:function(e,t,r){"use strict";var n=r(8612),o=r(210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||n.call(a,i),s=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(d){c=null}e.exports=function(e){var t=u(n,a,arguments);if(s&&c){var r=s(t,"length");r.configurable&&c(t,"length",{value:1+f(0,e.length-(arguments.length-1))})}return t};var l=function(){return u(n,i,arguments)};c?c(e.exports,"apply",{value:l}):e.exports.apply=l},1027:function(e,t,r){var n=r(9509).Buffer,o=r(2830).Transform,i=r(2553).s;function a(e){o.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(5717)(a,o),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var o=this._update(e);return this.hashMode?this:(r&&(o=this._toString(o,r)),o)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(o){n=o}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},7630:function(e,t){"use strict";function r(e,t){return function(r){return null!=r?e(r):t}}function n(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){for(var r=0;r<t.length;++r)if(e===t[r])return e;var n="Expected ";1!==t.length&&(n+="one of: ");for(var o=0;o<t.length;++o)o>0&&(n+=" | "),n+=JSON.stringify(t[o]);throw new TypeError(n)}}function o(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e}Object.defineProperty(t,"__esModule",{value:!0});var i=n(null),a=n(void 0);var u=r(i);function s(e,t,r){return e instanceof Error&&(null==e.insertStepAt&&(e.message+=" at ",e.insertStepAt=e.message.length),e.message=e.message.slice(0,e.insertStepAt)+t+e.message.slice(e.insertStepAt),e.insertStepAt+=r),e}function c(e){if("function"==typeof e)return function(t){if("object"!=typeof t||null==t)throw new TypeError("Expected an object");for(var r={},n=Object.keys(t),o=0;o<n.length;++o){var i=n[o];if("__proto__"!==i)try{r[i]=e(t[i])}catch(a){throw s(a,"["+JSON.stringify(i)+"]",0)}}return r};var t=Object.keys(e);function r(r){return function(n){if("object"!=typeof n||null==n)throw new TypeError("Expected an object");var o,i={};if(r){var a=Object.keys(n);for(o=0;o<a.length;++o){var u=a[o];"__proto__"!==u&&(i[u]=n[u])}}for(o=0;o<t.length;++o){var c=t[o];try{i[c]=e[c](n[c])}catch(f){throw s(f,"."+c,0)}}return i}}var n=r(!1);return n.shape=e,n.withRest=r(!0),n}var f=c;var l=0;function d(e,t){return function(r){return l>0?t(r):e(r)}}var h=d((function(e){if("string"!=typeof e&&!(e instanceof Date))throw new TypeError("Expected a date string");var t=new Date(e);if(null==t.toJSON())throw new TypeError("Invalid date format");return t}),(function(e){return e.toISOString()}));t.asArray=function(e){return function(t){if(!Array.isArray(t))throw new TypeError("Expected an array");for(var r=[],n=0;n<t.length;++n)try{r[n]=e(t[n])}catch(o){throw s(o,"["+n+"]",0)}return r}},t.asBoolean=function(e){if("boolean"!=typeof e)throw new TypeError("Expected a boolean");return e},t.asCodec=d,t.asDate=h,t.asEither=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){for(var r=0;r<t.length;r++)try{return t[r](e)}catch(n){if(r+1>=t.length)throw n}}},t.asJSON=function(e){return d((function(t){var r=JSON.parse(o(t));try{return e(r)}catch(n){throw s(n,"JSON.parse()",11)}}),(function(t){return JSON.stringify(e(t))}))},t.asMap=f,t.asMaybe=function(e,t){return function(r){try{return e(r)}catch(n){return t}}},t.asNone=u,t.asNull=i,t.asNumber=function(e){if("number"!=typeof e)throw new TypeError("Expected a number");return e},t.asObject=c,t.asOptional=r,t.asString=o,t.asUndefined=a,t.asUnknown=function(e){return e},t.asValue=n,t.uncleaner=function(e){return function(t){try{return++l,e(t)}finally{--l}}}},3482:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(5717),i=r(8028),a=r(9785),u=r(9072),s=r(1027);function c(e){s.call(this,"digest"),this._hash=e,this.buffers=[]}function f(e){s.call(this,"digest"),this._hash=e}o(c,s),c.prototype._update=function(e){this.buffers.push(e)},c.prototype._final=function(){var e=n.concat(this.buffers),t=this._hash(e);return this.buffers=null,t},o(f,s),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new c(i):new f("rmd160"===e||"ripemd160"===e?new a:u(e))}},800:function(e,t,r){"use strict";var n=r(8823).Buffer,o=new n(4);o.fill(0);e.exports=function(e,t){var r=t(function(e){if(e.length%4!=0){var t=e.length+(4-e.length%4);e=n.concat([e,o],t)}for(var r=new Array(e.length>>>2),i=0,a=0;i<e.length;i+=4,a++)r[a]=e.readInt32LE(i);return r}(e),8*e.length);e=new n(16);for(var i=0;i<r.length;i++)e.writeInt32LE(r[i],i<<2,!0);return e}},8028:function(e,t,r){"use strict";var n=r(800);function o(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,n=-271733879,o=-1732584194,i=271733878,l=0;l<e.length;l+=16){var d=r,h=n,p=o,y=i;r=a(r,n,o,i,e[l+0],7,-680876936),i=a(i,r,n,o,e[l+1],12,-389564586),o=a(o,i,r,n,e[l+2],17,606105819),n=a(n,o,i,r,e[l+3],22,-1044525330),r=a(r,n,o,i,e[l+4],7,-176418897),i=a(i,r,n,o,e[l+5],12,1200080426),o=a(o,i,r,n,e[l+6],17,-1473231341),n=a(n,o,i,r,e[l+7],22,-45705983),r=a(r,n,o,i,e[l+8],7,1770035416),i=a(i,r,n,o,e[l+9],12,-1958414417),o=a(o,i,r,n,e[l+10],17,-42063),n=a(n,o,i,r,e[l+11],22,-1990404162),r=a(r,n,o,i,e[l+12],7,1804603682),i=a(i,r,n,o,e[l+13],12,-40341101),o=a(o,i,r,n,e[l+14],17,-1502002290),r=u(r,n=a(n,o,i,r,e[l+15],22,1236535329),o,i,e[l+1],5,-165796510),i=u(i,r,n,o,e[l+6],9,-1069501632),o=u(o,i,r,n,e[l+11],14,643717713),n=u(n,o,i,r,e[l+0],20,-373897302),r=u(r,n,o,i,e[l+5],5,-701558691),i=u(i,r,n,o,e[l+10],9,38016083),o=u(o,i,r,n,e[l+15],14,-660478335),n=u(n,o,i,r,e[l+4],20,-405537848),r=u(r,n,o,i,e[l+9],5,568446438),i=u(i,r,n,o,e[l+14],9,-1019803690),o=u(o,i,r,n,e[l+3],14,-187363961),n=u(n,o,i,r,e[l+8],20,1163531501),r=u(r,n,o,i,e[l+13],5,-1444681467),i=u(i,r,n,o,e[l+2],9,-51403784),o=u(o,i,r,n,e[l+7],14,1735328473),r=s(r,n=u(n,o,i,r,e[l+12],20,-1926607734),o,i,e[l+5],4,-378558),i=s(i,r,n,o,e[l+8],11,-2022574463),o=s(o,i,r,n,e[l+11],16,1839030562),n=s(n,o,i,r,e[l+14],23,-35309556),r=s(r,n,o,i,e[l+1],4,-1530992060),i=s(i,r,n,o,e[l+4],11,1272893353),o=s(o,i,r,n,e[l+7],16,-155497632),n=s(n,o,i,r,e[l+10],23,-1094730640),r=s(r,n,o,i,e[l+13],4,681279174),i=s(i,r,n,o,e[l+0],11,-358537222),o=s(o,i,r,n,e[l+3],16,-722521979),n=s(n,o,i,r,e[l+6],23,76029189),r=s(r,n,o,i,e[l+9],4,-640364487),i=s(i,r,n,o,e[l+12],11,-421815835),o=s(o,i,r,n,e[l+15],16,530742520),r=c(r,n=s(n,o,i,r,e[l+2],23,-995338651),o,i,e[l+0],6,-198630844),i=c(i,r,n,o,e[l+7],10,1126891415),o=c(o,i,r,n,e[l+14],15,-1416354905),n=c(n,o,i,r,e[l+5],21,-57434055),r=c(r,n,o,i,e[l+12],6,1700485571),i=c(i,r,n,o,e[l+3],10,-1894986606),o=c(o,i,r,n,e[l+10],15,-1051523),n=c(n,o,i,r,e[l+1],21,-2054922799),r=c(r,n,o,i,e[l+8],6,1873313359),i=c(i,r,n,o,e[l+15],10,-30611744),o=c(o,i,r,n,e[l+6],15,-1560198380),n=c(n,o,i,r,e[l+13],21,1309151649),r=c(r,n,o,i,e[l+4],6,-145523070),i=c(i,r,n,o,e[l+11],10,-1120210379),o=c(o,i,r,n,e[l+2],15,718787259),n=c(n,o,i,r,e[l+9],21,-343485551),r=f(r,d),n=f(n,h),o=f(o,p),i=f(i,y)}return[r,n,o,i]}function i(e,t,r,n,o,i){return f((a=f(f(t,e),f(n,i)))<<(u=o)|a>>>32-u,r);var a,u}function a(e,t,r,n,o,a,u){return i(t&r|~t&n,e,t,o,a,u)}function u(e,t,r,n,o,a,u){return i(t&n|r&~n,e,t,o,a,u)}function s(e,t,r,n,o,a,u){return i(t^r^n,e,t,o,a,u)}function c(e,t,r,n,o,a,u){return i(r^(t|~n),e,t,o,a,u)}function f(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}e.exports=function(e){return n(e,o)}},4098:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=h(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=p(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=f(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=f(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),l(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),l(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){var r,n,o=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),g.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},v.call(m.prototype),v.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];E.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(x){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function C(e,r){return new Promise((function(n,i){var a=new m(e,r);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var e,t,r={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var o="response"in u?u.response:u.responseText;n(new E(o,r))},u.onerror=function(){i(new TypeError("Network request failed"))},u.ontimeout=function(){i(new TypeError("Network request failed"))},u.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&o&&(u.responseType="blob"),a.headers.forEach((function(e,t){u.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}C.polyfill=!0,e.fetch||(e.fetch=C,e.Headers=d,e.Request=m,e.Response=E),t.Headers=d,t.Request=m,t.Response=E,t.fetch=C,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},4550:function(e){e.exports=[{code:"AED",number:"784",digits:2,currency:"United Arab Emirates dirham",countries:["united arab emirates"]},{code:"AFN",number:"971",digits:2,currency:"Afghan afghani",countries:["afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Albanian lek",countries:["albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian dram",countries:["armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean guilder",countries:["curaçao","sint maarten"]},{code:"AOA",number:"973",digits:2,currency:"Angolan kwanza",countries:["angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine peso",countries:["argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian dollar",countries:["australia","australian antarctic territory","christmas island","cocos (keeling) islands","heard and mcdonald islands","kiribati","nauru","norfolk island","tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban florin",countries:["aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijani manat",countries:["azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Bosnia and Herzegovina convertible mark",countries:["bosnia and herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados dollar",countries:["barbados"]},{code:"BDT",number:"050",digits:2,currency:"Bangladeshi taka",countries:["bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian lev",countries:["bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini dinar",countries:["bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundian franc",countries:["burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian dollar",countries:["bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei dollar",countries:["brunei","singapore"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["bolivia"]},{code:"BOV",number:"984",digits:2,currency:"Bolivian Mvdol (funds code)",countries:["bolivia"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian real",countries:["brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian dollar",countries:["bahamas"]},{code:"BTN",number:"064",digits:2,currency:"Bhutanese ngultrum",countries:["bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Botswana pula",countries:["botswana"]},{code:"BYR",number:"974",digits:0,currency:"Belarusian ruble",countries:["belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize dollar",countries:["belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian dollar",countries:["canada","saint pierre and miquelon"]},{code:"CDF",number:"976",digits:2,currency:"Congolese franc",countries:["democratic republic of congo"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro (complementary currency)",countries:["switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss franc",countries:["switzerland","liechtenstein"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc (complementary currency)",countries:["switzerland"]},{code:"CLF",number:"990",digits:0,currency:"Unidad de Fomento (funds code)",countries:["chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean peso",countries:["chile"]},{code:"CNY",number:"156",digits:2,currency:"Chinese yuan",countries:["china"]},{code:"COP",number:"170",digits:2,currency:"Colombian peso",countries:["colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican colon",countries:["costa rica"]},{code:"CUC",number:"931",digits:2,currency:"Cuban convertible peso",countries:["cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban peso",countries:["cuba"]},{code:"CVE",number:"132",digits:0,currency:"Cape Verde escudo",countries:["cape verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech koruna",countries:["czech republic"]},{code:"DJF",number:"262",digits:0,currency:"Djiboutian franc",countries:["djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish krone",countries:["denmark","faroe islands","greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican peso",countries:["dominican republic"]},{code:"DZD",number:"012",digits:2,currency:"Algerian dinar",countries:["algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian pound",countries:["egypt","palestinian territories"]},{code:"ERN",number:"232",digits:2,currency:"Eritrean nakfa",countries:["eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian birr",countries:["ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["andorra","austria","belgium","cyprus","estonia","finland","france","germany","greece","ireland","italy","kosovo","luxembourg","malta","monaco","montenegro","netherlands","portugal","san marino","slovakia","slovenia","spain","vatican city"]},{code:"FJD",number:"242",digits:2,currency:"Fiji dollar",countries:["fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands pound",countries:["falkland islands"]},{code:"GBP",number:"826",digits:2,currency:"Pound sterling",countries:["united kingdom","british crown dependencies (the isle of man and the channel islands)","south georgia and the south sandwich islands","british antarctic territory","british indian ocean territory"]},{code:"GEL",number:"981",digits:2,currency:"Georgian lari",countries:["georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghanaian cedi",countries:["ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar pound",countries:["gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Gambian dalasi",countries:["gambia"]},{code:"GNF",number:"324",digits:0,currency:"Guinean franc",countries:["guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Guatemalan quetzal",countries:["guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyanese dollar",countries:["guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong dollar",countries:["hong kong","macao"]},{code:"HNL",number:"340",digits:2,currency:"Honduran lempira",countries:["honduras"]},{code:"HRK",number:"191",digits:2,currency:"Croatian kuna",countries:["croatia"]},{code:"HTG",number:"332",digits:2,currency:"Haitian gourde",countries:["haiti"]},{code:"HUF",number:"348",digits:2,currency:"Hungarian forint",countries:["hungary"]},{code:"IDR",number:"360",digits:0,currency:"Indonesian rupiah",countries:["indonesia"]},{code:"ILS",number:"376",digits:2,currency:"Israeli new shekel",countries:["israel","palestinian territories"]},{code:"INR",number:"356",digits:2,currency:"Indian rupee",countries:["india"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi dinar",countries:["iraq"]},{code:"IRR",number:"364",digits:0,currency:"Iranian rial",countries:["iran"]},{code:"ISK",number:"352",digits:0,currency:"Icelandic króna",countries:["iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican dollar",countries:["jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian dinar",countries:["jordan"]},{code:"JPY",number:"392",digits:0,currency:"Japanese yen",countries:["japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan shilling",countries:["kenya"]},{code:"KGS",number:"417",digits:2,currency:"Kyrgyzstani som",countries:["kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Cambodian riel",countries:["cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comoro franc",countries:["comoros"]},{code:"KPW",number:"408",digits:0,currency:"North Korean won",countries:["north korea"]},{code:"KRW",number:"410",digits:0,currency:"South Korean won",countries:["south korea"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti dinar",countries:["kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands dollar",countries:["cayman islands"]},{code:"KZT",number:"398",digits:2,currency:"Kazakhstani tenge",countries:["kazakhstan"]},{code:"LAK",number:"418",digits:0,currency:"Lao kip",countries:["laos"]},{code:"LBP",number:"422",digits:0,currency:"Lebanese pound",countries:["lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lankan rupee",countries:["sri lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian dollar",countries:["liberia"]},{code:"LSL",number:"426",digits:2,currency:"Lesotho loti",countries:["lesotho"]},{code:"LTL",number:"440",digits:2,currency:"Lithuanian litas",countries:["lithuania"]},{code:"LVL",number:"428",digits:2,currency:"Latvian lats",countries:["latvia"]},{code:"LYD",number:"434",digits:3,currency:"Libyan dinar",countries:["libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan dirham",countries:["morocco"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan leu",countries:["moldova (except transnistria)"]},{code:"MGA",number:"969",digits:0,currency:"*[8]\tMalagasy ariary",countries:["madagascar"]},{code:"MKD",number:"807",digits:0,currency:"Macedonian denar",countries:["macedonia"]},{code:"MMK",number:"104",digits:0,currency:"Myanma kyat",countries:["myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Mongolian tugrik",countries:["mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Macanese pataca",countries:["macao"]},{code:"MRO",number:"478",digits:0,currency:"*[8]\tMauritanian ouguiya",countries:["mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritian rupee",countries:["mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Maldivian rufiyaa",countries:["maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawian kwacha",countries:["malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican peso",countries:["mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI) (funds code)",countries:["mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian ringgit",countries:["malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambican metical",countries:["mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibian dollar",countries:["namibia"]},{code:"NGN",number:"566",digits:2,currency:"Nigerian naira",countries:["nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Nicaraguan córdoba",countries:["nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian krone",countries:["norway","svalbard","jan mayen","bouvet island","queen maud land","peter i island"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese rupee",countries:["nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand dollar",countries:["cook islands","new zealand","niue","pitcairn","tokelau","ross dependency"]},{code:"OMR",number:"512",digits:3,currency:"Omani rial",countries:["oman"]},{code:"PAB",number:"590",digits:2,currency:"Panamanian balboa",countries:["panama"]},{code:"PEN",number:"604",digits:2,currency:"Peruvian nuevo sol",countries:["peru"]},{code:"PGK",number:"598",digits:2,currency:"Papua New Guinean kina",countries:["papua new guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine peso",countries:["philippines"]},{code:"PKR",number:"586",digits:2,currency:"Pakistani rupee",countries:["pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Polish złoty",countries:["poland"]},{code:"PYG",number:"600",digits:0,currency:"Paraguayan guaraní",countries:["paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari riyal",countries:["qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian new leu",countries:["romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian dinar",countries:["serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian rouble",countries:["russia","abkhazia","south ossetia"]},{code:"RWF",number:"646",digits:0,currency:"Rwandan franc",countries:["rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi riyal",countries:["saudi arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands dollar",countries:["solomon islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles rupee",countries:["seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese pound",countries:["sudan"]},{code:"SEK",number:"752",digits:2,currency:"Swedish krona/kronor",countries:["sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore dollar",countries:["singapore","brunei"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena pound",countries:["saint helena"]},{code:"SLL",number:"694",digits:0,currency:"Sierra Leonean leone",countries:["sierra leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali shilling",countries:["somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinamese dollar",countries:["suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese pound",countries:["south sudan"]},{code:"STD",number:"678",digits:0,currency:"São Tomé and Príncipe dobra",countries:["são tomé and príncipe"]},{code:"SYP",number:"760",digits:2,currency:"Syrian pound",countries:["syria"]},{code:"SZL",number:"748",digits:2,currency:"Swazi lilangeni",countries:["swaziland"]},{code:"THB",number:"764",digits:2,currency:"Thai baht",countries:["thailand"]},{code:"TJS",number:"972",digits:2,currency:"Tajikistani somoni",countries:["tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistani manat",countries:["turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian dinar",countries:["tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Tongan paʻanga",countries:["tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish lira",countries:["turkey","northern cyprus"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago dollar",countries:["trinidad and tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan dollar",countries:["republic of china (taiwan)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian shilling",countries:["tanzania"]},{code:"UAH",number:"980",digits:2,currency:"Ukrainian hryvnia",countries:["ukraine"]},{code:"UGX",number:"800",digits:2,currency:"Ugandan shilling",countries:["uganda"]},{code:"USD",number:"840",digits:2,currency:"United States dollar",countries:["american samoa","barbados","bermuda","british indian ocean territory","british virgin islands, caribbean netherlands","ecuador","el salvador","guam","haiti","marshall islands","federated states of micronesia","northern mariana islands","palau","panama","puerto rico","timor-leste","turks and caicos islands","united states","u.s. virgin islands","zimbabwe"]},{code:"USN",number:"997",digits:2,currency:"United States dollar (next day) (funds code)",countries:["united states"]},{code:"USS",number:"998",digits:2,currency:"United States dollar",countries:["united states"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas",countries:["uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Uruguayan peso",countries:["uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan som",countries:["uzbekistan"]},{code:"VEF",number:"937",digits:2,currency:"Venezuelan bolívar",countries:["venezuela"]},{code:"VND",number:"704",digits:0,currency:"Vietnamese dong",countries:["vietnam"]},{code:"VUV",number:"548",digits:0,currency:"Vanuatu vatu",countries:["vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Samoan tala",countries:["samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA franc BEAC",countries:["cameroon","central african republic","republic of the congo","chad","equatorial guinea","gabon"]},{code:"XAG",number:"961",currency:"Silver (one troy ounce)"},{code:"XAU",number:"959",currency:"Gold (one troy ounce)"},{code:"XBA",number:"955",currency:"European Composite Unit (EURCO) (bond market unit)\t"},{code:"XBB",number:"956",currency:"European Monetary Unit (E.M.U.-6) (bond market unit)\t"},{code:"XBC",number:"957",currency:"European Unit of Account 9 (E.U.A.-9) (bond market unit)\t"},{code:"XBD",number:"958",currency:"European Unit of Account 17 (E.U.A.-17) (bond market unit)\t"},{code:"XBT",currency:"Bitcoin"},{code:"XCD",number:"951",digits:2,currency:"East Caribbean dollar",countries:["anguilla","antigua and barbuda","dominica","grenada","montserrat","saint kitts and nevis","saint lucia","saint vincent and the grenadines"]},{code:"XDR",number:"960",currency:"Special drawing rights",countries:["international monetary fund"]},{code:"XFU",currency:"UIC franc (special settlement currency)",countries:["international union of railways"]},{code:"XOF",number:"952",digits:0,currency:"CFA franc BCEAO",countries:["benin","burkina faso","côte d'ivoire","guinea-bissau","mali","niger","senegal","togo"]},{code:"XPD",number:"964",currency:"Palladium (one troy ounce)"},{code:"XPF",number:"953",digits:0,currency:"CFP franc (Franc du Pacifique)",countries:["french polynesia","new caledonia","wallis and futuna"]},{code:"XPT",number:"962",currency:"Platinum (one troy ounce)"},{code:"XTS",number:"963",currency:"Code reserved for testing purposes"},{code:"XXX",number:"999",currency:"No currency"},{code:"YER",number:"886",digits:2,currency:"Yemeni rial",countries:["yemen"]},{code:"ZAR",number:"710",digits:2,currency:"South African rand",countries:["south africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian kwacha",countries:["zambia"]}]},3546:function(e,t,r){var n=r(7680),o=r(2719),i=r(4550);t.Rx=function(e){return n(i,(function(t){return t.number===String(e)}))}},4289:function(e,t,r){"use strict";var n=r(2215),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,u=Object.defineProperty,s=u&&function(){var e={};try{for(var t in u(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(r){return!1}}(),c=function(e,t,r,n){var o;(!(t in e)||"function"==typeof(o=n)&&"[object Function]"===i.call(o)&&n())&&(s?u(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},f=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var u=0;u<i.length;u+=1)c(e,i[u],t[i[u]],r[i[u]])};f.supportsDescriptors=!!s,e.exports=f},4638:function(e,t,r){"use strict";var n=r(9911);function o(e){throw new Error("makeNodeDisklet is not available on this platform")}function i(){throw new Error("makeReactNativeDisklet is not available on this platform")}function a(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){a(i,n,o,u,s,"next",e)}function s(e){a(i,n,o,u,s,"throw",e)}u(void 0)}))}}function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function c(e){if(/^\//.test(e))throw new Error("Absolute paths are not supported");for(var t=e.split("/"),r=0,n=0;r<t.length;){var o=t[r++];if(".."===o?n--:"."!==o&&""!==o&&(t[n++]=o),n<0)throw new Error("Path would escape folder")}return t.slice(0,n).join("/")}function f(e){return""===e?e:e+"/"}function l(e){for(var t=[],r=0;r<e.length;++r){var n=e.key(r);null!=n&&t.push(n)}return t}function d(e,t){void 0===e&&(e=window.localStorage),void 0===t&&(t={});var r=null!=t.prefix?f(t.prefix):"/";return{delete:function(t){var n=c(t);null!=e.getItem(r+n)&&e.removeItem(r+n);for(var o=f(n),i=0,a=l(e);i<a.length;i++){var u=a[i];0===u.indexOf(r+o)&&e.removeItem(u)}return Promise.resolve()},getData:function(e){return this.getText(e).then((function(e){return n.base64.parse(e)}))},getText:function(t){var n=c(t),o=e.getItem(r+n);return null==o?Promise.reject(new Error('Cannot load "'+n+'"')):Promise.resolve(o)},list:function(t){return u((function*(){void 0===t&&(t="");var n=c(t),o={};null!=e.getItem(r+n)&&(o[n]="file");for(var i=f(n),a=0,u=l(e);a<u.length;a++){var s=u[a];if(0===s.indexOf(r+i)){var d=s.indexOf("/",r.length+i.length);d<0?o[s.slice(r.length)]="file":o[s.slice(r.length,d)]="folder"}}return o}))()},setData:function(e,t){return this.setText(e,n.base64.stringify(t))},setText:function(t,n){return"string"!=typeof n?Promise.reject(new TypeError("setText expects a string")):(e.setItem(r+c(t),n),Promise.resolve())}}}function h(e){return void 0===e&&(e={}),{delete:function(t){var r=c(t);null!=e["/"+r]&&delete e["/"+r];for(var n=f(r),o=0,i=Object.keys(e);o<i.length;o++){var a=i[o];0===a.indexOf("/"+n)&&delete e[a]}return Promise.resolve()},getData:function(t){var r=c(t),n=e["/"+r];return null==n?Promise.reject(new Error('Cannot load "'+r+'"')):"string"==typeof n?Promise.reject(new Error('"'+r+'" is a text file.')):Promise.resolve(n)},getText:function(t){var r=c(t),n=e["/"+r];return null==n?Promise.reject(new Error('Cannot load "'+r+'"')):"string"!=typeof n?Promise.reject(new Error('"'+r+'" is a binary file.')):Promise.resolve(n)},list:function(t){return u((function*(){void 0===t&&(t="");var r=c(t),n={};null!=e["/"+r]&&(n[r]="file");for(var o=f(r),i=0,a=Object.keys(e);i<a.length;i++){var u=a[i];if(0===u.indexOf("/"+o)){var s=u.indexOf("/",1+o.length);s<0?n[u.slice(1)]="file":n[u.slice(1,s)]="folder"}}return n}))()},setData:function(t,r){var n=r,o=Uint8Array.from(n);return e["/"+c(t)]=o,Promise.resolve()},setText:function(t,r){return"string"!=typeof r?Promise.reject(new TypeError("setText expects a string")):(e["/"+c(t)]=r,Promise.resolve())}}}var p=function(){function e(e,t){this._disklet=e,this._path=t}var t=e.prototype;return t.delete=function(){return this._disklet.delete(this._path)},t.getData=function(){return this._disklet.getData(this._path)},t.getText=function(){return this._disklet.getText(this._path)},t.setData=function(e){return this._disklet.setData(this._path,e)},t.setText=function(e){return this._disklet.setText(this._path,e)},e}(),y=function(){function e(e,t){this._disklet=e,this._path=t}var t=e.prototype;return t.delete=function(){return this._disklet.delete(this._path)},t.file=function(e){return new p(this._disklet,this._path+"/"+e)},t.folder=function(t){return new e(this._disklet,this._path+"/"+t)},t.listFiles=function(){return this._disklet.list(this._path).then((function(e){return Object.keys(e).filter((function(t){return"file"===e[t]})).map((function(e){return e.replace(/^.*\//,"")}))}))},t.listFolders=function(){return this._disklet.list(this._path).then((function(e){return Object.keys(e).filter((function(t){return"folder"===e[t]})).map((function(e){return e.replace(/^.*\//,"")}))}))},e}();function b(e){return new y(e,".")}function v(e,t){for(var r=0,n=0;r<t.length;){var o=t[r++];if(".."===o?n--:"."!==o&&""!==o&&(t[n++]=o),n<0)throw new Error("Path would escape folder")}for(r=0;r<n;++r)e=e.folder(t[r]);return e}function g(e,t){return e.listFiles().then((function(r){return Promise.all(r.map((function(r){return t(e.file(r),r,e)})))}))}function m(e,t){return e.listFolders().then((function(r){return Promise.all(r.map((function(r){return t(e.folder(r),r,e)})))}))}function w(e,t){console.log(t+' "'+e+'"')}function E(e,t,r){var n=r.callback,o=void 0===n?w:n,i=r.verbose;(void 0!==i&&i||/set|delete/.test(t))&&o(e,t)}var _=function(){function e(e,t,r){this._file=e,this._path=t,this._opts=r}var t=e.prototype;return t.delete=function(){return E(this._path,"delete file",this._opts),this._file.delete()},t.getData=function(){return E(this._path,"get data",this._opts),this._file.getData()},t.getText=function(){return E(this._path,"get text",this._opts),this._file.getText()},t.setData=function(e){return E(this._path,"set data",this._opts),this._file.setData(e)},t.setText=function(e){return E(this._path,"set text",this._opts),this._file.setText(e)},t.getPath=function(){return this._path},e}(),C=function(){function e(e,t,r){this._folder=e,this._path=t,this._opts=r}var t=e.prototype;return t.delete=function(){return E(this._path,"delete folder",this._opts),this._folder.delete()},t.file=function(e){return new _(this._folder.file(e),this._path+e,this._opts)},t.folder=function(t){return new e(this._folder.folder(t),this._path+t+"/",this._opts)},t.listFiles=function(){return E(this._path,"list files",this._opts),this._folder.listFiles()},t.listFolders=function(){return E(this._path,"list folders",this._opts),this._folder.listFolders()},e}();function x(e,t){var r={},n=[];return e.forEach((function(e){/\._x_$/.test(e)?r[e]=!0:(r[e+"._x_"]=!0,n.push(e))})),t.forEach((function(e){r[e+"._x_"]||n.push(e)})),n}var S=function(){function e(e,t,r){this._master=e,this._fallback=t,this._whiteout=r}var t=e.prototype;return t.delete=function(){return Promise.all([this._whiteout.setData([]),this._master.delete().catch((function(e){return null}))])},t.getData=function(){var e=this;return this._master.getData().catch((function(t){return e._whiteout.getData().then((function(e){throw new Error("File has been deleted")}),(function(t){return e._fallback.getData()}))}))},t.getText=function(){var e=this;return this._master.getText().catch((function(t){return e._whiteout.getData().then((function(e){throw new Error("File has been deleted")}),(function(t){return e._fallback.getText()}))}))},t.setData=function(e){return this._master.setData(e)},t.setText=function(e){return this._master.setText(e)},t.getPath=function(){throw new Error("Cannot call getPath on a Union Folder")},e}(),A=function(){function e(e,t){this._master=e,this._fallback=t}var t=e.prototype;return t.delete=function(){return Promise.all([g(this,(function(e){return e.delete()})),m(this,(function(e){return e.delete()}))]).then((function(){}))},t.file=function(e){return new S(this._master.file(e),this._fallback.file(e),this._master.file(e+"._x_"))},t.folder=function(t){return new e(this._master.folder(t),this._fallback.folder(t))},t.listFiles=function(){return Promise.all([this._master.listFiles(),this._fallback.listFiles()]).then((function(e){return x(e[0],e[1])}))},t.listFolders=function(){return Promise.all([this._master.listFolders(),this._fallback.listFolders()]).then((function(e){return x(e[0],e[1])}))},e}();function I(e,t){var r=f(c(t));return{delete:function(t){return e.delete(r+t)},getData:function(t){return e.getData(r+t)},getText:function(t){return e.getText(r+t)},list:function(t){return void 0===t&&(t="."),e.list(r+t).then((function(e){var t={};for(var n in e)t[n.replace(r,"")]=e[n];return t}))},setData:function(t,n){return e.setData(r+t,n)},setText:function(t,n){return e.setText(r+t,n)}}}t.gQ=function(e){return Object.keys(e).filter((function(t){return"file"===e[t]}))},t.ji=function(e){return Object.keys(e).filter((function(t){return"folder"===e[t]}))},t.Wh=h,t.Cl=function(e,t){return{delete:function(r){return Promise.all([e.delete(r),t.delete(r)])},getData:function(r){return e.getData(r).catch((function(e){return t.getData(r)}))},getText:function(r){return e.getText(r).catch((function(e){return t.getText(r)}))},list:function(r){return Promise.all([e.list(r),t.list(r)]).then((function(e){var t=e[0];return s(e[1],t)}))},setData:function(t,r){return e.setData(t,r)},setText:function(t,r){return e.setText(t,r)}}},t.HN=I},1649:function(e,t,r){"use strict";var n=r(7630),o=r(4098),i=r(9176),a=r(3715),u=r(9911);function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(o),f=s(i),l=s(a);const d=/^[a-z0-9-_.]+(\/+[a-z0-9-_.]+)*$/i,h=/^[a-f0-9]{40}$/,p=e=>{const t=n.asString(e);if(""===t)throw new TypeError("Expected non empty string");return t},y=e=>{const t=n.asString(e);if(!h.test(t))throw new TypeError(`Invalid sync key '${t}'`);return t},b=n.asObject({iv_hex:n.asString,encryptionType:n.asNumber,data_base64:n.asString}),v=n.asObject({success:n.asValue(!1),message:n.asString,stack:n.asOptional(n.asString)}),g=n.asEither(b,n.asNull),m=n.asObject(g),w=n.asObject({syncKey:y,hash:n.asOptional(p)}),E=n.asObject({hash:n.asOptional(n.asString),changes:m}),_=n.asObject({syncKey:y,hash:n.asOptional(p)}),C=n.asObject({changes:m}),x=n.asObject({hash:n.asString,changes:m}),S=n.asObject({syncKey:y}),A=n.asUndefined,I=()=>{};async function O(e,t,r={}){const{log:o=I,fetch:i=c.default}=r,{method:a,url:u,body:s,numbUrl:f=u,headers:l={}}=e,d=Date.now(),h=await i(u,{method:a,headers:{"Content-Type":"application/json",...l},body:JSON.stringify(s)}),p=Date.now()-d;o(`${a} ${f} returned ${h.status} in ${p}ms`);const y=await h.text();if(!h.ok)throw new Error(`Failed request ${a} ${f} failed ${h.status}: ${y}`);const b=n.asMaybe(v)(y);if(null!=b)throw new Error(`Failed request ${a} ${f} failed ${h.status}: ${b.message}`);return t(""!==y.trim()?JSON.parse(y):void 0)}const T=f.default("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),k=e=>{const t=P(P(u.base16.parse(e)));return T.encode(t)};function P(e){const t=l.default.sha256();return Uint8Array.from(t.update(e).digest())}class B extends Error{constructor(e="Cannot reach the network"){super(e),this.name="NetworkError"}}const R=n.asObject({infoServers:n.asArray(n.asString),syncServers:n.asArray(n.asString)}),j={infoServers:["https://info1.edge.app"],syncServers:["https://sync-us1.edge.app","https://sync-us2.edge.app","https://sync-us3.edge.app","https://sync-us4.edge.app","https://sync-us5.edge.app","https://sync-us6.edge.app","https://sync-eu1.edge.app","https://sync-eu2.edge.app","https://sync-eu3.edge.app","https://sync-eu4.edge.app","https://sync-eu5.edge.app","https://sync-eu6.edge.app"]};function M(e={}){const{serverInfoCacheTTL:t=6e5}=e;let r=j.infoServers;const n=function(e,t){let r=Date.now()+t,n=e(void 0);return{get:()=>{if(Date.now()>r||null==n){r=Date.now()+t;const o=e(n);n=o}return n}}}((async(t=Promise.resolve(j))=>await async function(e,t={}){const{log:r=I,fetch:n=c.default}=t;let o=new Error("No info servers");for(const a of e){const[e,t]=["GET","/v1/edgeServers"],u=Date.now(),s=`${a}${t}`;try{const t=await n(s,{method:e,headers:{"Content-Type":"application/json"}}).catch((t=>{const n=Date.now()-u,o=`${e} ${s} failed in ${n}ms, ${String(t)}`;throw r(o),new B(o)})),{ok:o,status:i}=t,a=Date.now()-u,c=`${e} ${s} returned ${i} in ${a}ms`;if(!o)throw r(c),new B(c);r(c);const f=await t.text(),l=JSON.parse(f);return R(l)}catch(i){o=i;continue}}throw o}(r,e).catch((async e=>await t))),t);return{async getEdgeServers(){const e=await n.get();return e.infoServers.length>0&&(r=e.infoServers),e}}}function N(e,t){return null!=e?e:t()}t.bS=m,t.Ei=b,t.wJ=g,t.PG=w,t.SR=E,t.Th=p,t.Qw=e=>{const t=n.asString(e);try{if(d.test(t))return function(e){if(/^\//.test(e))throw new Error("Absolute paths are not supported");const t=e.split("/");let r=0,n=0;for(;r<t.length;){const e=t[r++];if(".."===e?n--:"."!==e&&""!==e&&(t[n++]=e),n<0)throw new Error("Path would escape folder");if(0===n&&r===t.length)throw new Error("Path would evaluate to empty file name")}return t.slice(0,n).join("/")}(t)}catch(r){}throw new Error(`Invalid path '${t}'`)},t.YK=C,t.KI=_,t.Wn=x,t.tp=S,t.RQ=A,t.tE=v,t.Jj=y,t.LZ=function(e={}){const t=M(e);async function r(){const{syncServers:e}=await t.getEdgeServers();return function(e){for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e}(e)}return{async createRepo(t,n){const o=await r();let i=new Error(`Failed to create repo ${t}: empty sync server list`);for(const r of o){const o=`${r}/api/v2/store/${t}`,u=o.replace(t,`<${k(t)}>`);try{return await O({method:"PUT",url:o,numbUrl:u,headers:null!=n?{"X-API-Key":n}:{}},A,e)}catch(a){i=a}}throw i},async readRepo(t,n){const o=await r();let i=new Error(`Failed to read repo ${t}: empty sync server list`);for(const r of o){const o=`${r}/api/v2/store/${t}/${N(n,(()=>""))}`,u=o.replace(t,`<${k(t)}>`);try{return await O({method:"GET",url:o,numbUrl:u},E,e)}catch(a){i=a}}throw i},async updateRepo(t,n,o){const i=await r();let a=new Error(`Failed to update repo ${t}: empty sync server list`);for(const r of i){const i=`${r}/api/v2/store/${t}/${N(n,(()=>""))}`,s=i.replace(t,`<${k(t)}>`);try{return await O({method:"POST",url:i,numbUrl:s,body:o},x,e)}catch(u){a=u}}throw a}}},t.m8=k},6266:function(e,t,r){"use strict";var n=t;n.version=r(8597).i8,n.utils=r(953),n.rand=r(9931),n.curve=r(8254),n.curves=r(5427),n.ec=r(7954),n.eddsa=r(5980)},4918:function(e,t,r){"use strict";var n=r(3550),o=r(953),i=o.getNAF,a=o.getJSF,u=o.assert;function s(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(e,t){u(e.precomputed);var r=e._getDoubles(),n=i(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var a,s,c=[];for(a=0;a<n.length;a+=r.step){s=0;for(var f=a+r.step-1;f>=a;f--)s=(s<<1)+n[f];c.push(s)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=o;h>0;h--){for(a=0;a<c.length;a++)(s=c[a])===h?d=d.mixedAdd(r.points[a]):s===-h&&(d=d.mixedAdd(r.points[a].neg()));l=l.add(d)}return l.toP()},s.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,a=i(t,r,this._bitLength),s=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,s=s.dblp(f),c<0)break;var l=a[c];u(0!==l),s="affine"===e.type?l>0?s.mixedAdd(o[l-1>>1]):s.mixedAdd(o[-l-1>>1].neg()):l>0?s.add(o[l-1>>1]):s.add(o[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},s.prototype._wnafMulAdd=function(e,t,r,n,o){var u,s,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(u=0;u<n;u++){var p=(c=t[u])._getNAFPoints(e);f[u]=p.wnd,l[u]=p.points}for(u=n-1;u>=1;u-=2){var y=u-1,b=u;if(1===f[y]&&1===f[b]){var v=[t[y],null,null,t[b]];0===t[y].y.cmp(t[b].y)?(v[1]=t[y].add(t[b]),v[2]=t[y].toJ().mixedAdd(t[b].neg())):0===t[y].y.cmp(t[b].y.redNeg())?(v[1]=t[y].toJ().mixedAdd(t[b]),v[2]=t[y].add(t[b].neg())):(v[1]=t[y].toJ().mixedAdd(t[b]),v[2]=t[y].toJ().mixedAdd(t[b].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[y],r[b]);for(h=Math.max(m[0].length,h),d[y]=new Array(h),d[b]=new Array(h),s=0;s<h;s++){var w=0|m[0][s],E=0|m[1][s];d[y][s]=g[3*(w+1)+(E+1)],d[b][s]=0,l[y]=v}}else d[y]=i(r[y],f[y],this._bitLength),d[b]=i(r[b],f[b],this._bitLength),h=Math.max(d[y].length,h),h=Math.max(d[b].length,h)}var _=this.jpoint(null,null,null),C=this._wnafT4;for(u=h;u>=0;u--){for(var x=0;u>=0;){var S=!0;for(s=0;s<n;s++)C[s]=0|d[s][u],0!==C[s]&&(S=!1);if(!S)break;x++,u--}if(u>=0&&x++,_=_.dblp(x),u<0)break;for(s=0;s<n;s++){var A=C[s];0!==A&&(A>0?c=l[s][A-1>>1]:A<0&&(c=l[s][-A-1>>1].neg()),_="affine"===c.type?_.mixedAdd(c):_.add(c))}}for(u=0;u<n;u++)l[u]=null;return o?_:_.toP()},s.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},s.prototype.decodePoint=function(e,t){e=o.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?u(e[e.length-1]%2==0):7===e[0]&&u(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return o.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1138:function(e,t,r){"use strict";var n=r(953),o=r(3550),i=r(5717),a=r(4918),u=n.assert;function s(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,i){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(s,a),e.exports=s,s.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},s.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},s.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},s.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),u=a.redSqrt();if(0!==u.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=u.fromRed().isOdd();return(t&&!s||!t&&s)&&(u=u.redNeg()),this.point(e,u)},s.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=a.redSqrt();if(0!==u.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)},s.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(o)},i(c,a.BasePoint),s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},s.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),a=i.redSub(r),u=n.redSub(t),s=o.redMul(a),c=i.redMul(u),f=o.redMul(u),l=a.redMul(i);return this.curve.point(s,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n,o,i,a=this.x.redAdd(this.y).redSqr(),u=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(u)).redAdd(s);this.zOne?(e=a.redSub(u).redSub(s).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(s)),r=c.redSqr().redSub(c).redSub(c)):(o=this.z.redSqr(),i=c.redSub(o).redISub(o),e=a.redSub(u).redISub(s).redMul(i),t=c.redMul(n.redSub(s)),r=c.redMul(i))}else n=u.redAdd(s),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(u.redISub(s)),r=n.redMul(i);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),a=o.redSub(n),u=o.redAdd(n),s=r.redAdd(t),c=i.redMul(a),f=u.redMul(s),l=i.redMul(s),d=a.redMul(u);return this.curve.point(c,f,d,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),o=n.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),u=this.curve.d.redMul(i).redMul(a),s=o.redSub(u),c=o.redAdd(u),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),l=n.redMul(s).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(i))),r=s.redMul(c)):(t=n.redMul(c).redMul(a.redSub(i)),r=this.curve._mulC(s).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},8254:function(e,t,r){"use strict";var n=t;n.base=r(4918),n.short=r(6673),n.mont=r(2881),n.edwards=r(1138)},2881:function(e,t,r){"use strict";var n=r(3550),o=r(5717),i=r(4918),a=r(953);function u(e){i.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function s(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,i),e.exports=u,u.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(s,i.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},u.prototype.point=function(e,t){return new s(this,e,t)},u.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},s.prototype.precompute=function(){},s.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},s.fromJSON=function(e,t){return new s(e,t[0],t[1]||e.one)},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},s.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),o=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,o)},s.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),a=o.redMul(n),u=t.z.redMul(i.redAdd(a).redSqr()),s=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(u,s)},s.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},s.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},s.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:function(e,t,r){"use strict";var n=r(953),o=r(3550),i=r(5717),a=r(4918),u=n.assert;function s(e){a.call(this,"short",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(t,16),this.y=new o(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(t,16),this.y=new o(r,16),this.z=new o(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(s,a),e.exports=s,s.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new o(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new o(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],u(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new o(e.a,16),b:new o(e.b,16)}})):this._getEndoBasis(r)}}},s.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o.mont(e),r=new o(2).toRed(t).redInvm(),n=r.redNeg(),i=new o(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},s.prototype._getEndoBasis=function(e){for(var t,r,n,i,a,u,s,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new o(1),y=new o(0),b=new o(0),v=new o(1),g=0;0!==d.cmpn(0);){var m=h.div(d);c=h.sub(m.mul(d)),f=b.sub(m.mul(p));var w=v.sub(m.mul(y));if(!n&&c.cmp(l)<0)t=s.neg(),r=p,n=c.neg(),i=f;else if(n&&2==++g)break;s=c,h=d,d=c,b=p,p=f,v=y,y=w}a=c.neg(),u=f;var E=n.sqr().add(i.sqr());return a.sqr().add(u.sqr()).cmp(E)>=0&&(a=t,u=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),u=u.neg()),[{a:n,b:i},{a:a,b:u}]},s.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),u=i.mul(n.a),s=o.mul(r.b),c=i.mul(n.b);return{k1:e.sub(a).sub(u),k2:s.add(c).neg()}},s.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},s.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},s.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var a=this._endoSplit(t[i]),u=e[i],s=u._getBeta();a.k1.negative&&(a.k1.ineg(),u=u.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*i]=u,n[2*i+1]=s,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var c=this._wnafMulAdd(1,n,o,2*i,r),f=0;f<2*i;f++)n[f]=null,o[f]=null;return c},i(c,a.BasePoint),s.prototype.point=function(e,t,r){return new c(this,e,t,r)},s.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new o(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(f,a.BasePoint),s.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),u=n.redSub(o),s=i.redSub(a);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=u.redSqr(),f=c.redMul(u),l=n.redMul(c),d=s.redSqr().redIAdd(f).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(f)),p=this.z.redMul(e.z).redMul(u);return this.curve.jpoint(d,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),u=o.redSub(i);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),c=s.redMul(a),f=r.redMul(s),l=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(l)).redISub(o.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,u=this.z,s=u.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var f=i.redSqr(),l=c.redSqr(),d=l.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(s)),p=i.redMul(l),y=h.redSqr().redISub(p.redAdd(p)),b=p.redISub(y),v=h.redMul(b);v=v.redIAdd(v).redISub(d);var g=c.redMul(u);t+1<e&&(s=s.redMul(d)),i=y,u=g,c=v}return this.curve.jpoint(i,c.redMul(o),u)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n),s=u.redSqr().redISub(a).redISub(a),c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),e=s,t=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(f).redISub(d);h=h.redIAdd(h);var p=f.redAdd(f).redIAdd(f),y=p.redSqr(),b=d.redIAdd(d);b=(b=b.redIAdd(b)).redIAdd(b),e=y.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var u=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=u.redSqr().redISub(a).redISub(a);e=s;var c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),t=u.redMul(a.redISub(s)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(f).redMul(this.x.redAdd(f));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var b=l.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),t=h.redMul(p.redISub(e)).redISub(b)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),a=r.redSqr(),u=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),s=t.redAdd(t),c=(s=s.redIAdd(s)).redMul(a),f=u.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=u.redMul(l).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,h,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),u=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var c=o.redIAdd(a).redSqr().redISub(i).redISub(u).redISub(s),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(u).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(c.redMul(s.redISub(c)).redISub(a.redMul(u)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(u);return this.curve.jpoint(l,d,h)},f.prototype.mul=function(e,t){return e=new o(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:function(e,t,r){"use strict";var n,o=t,i=r(3715),a=r(8254),u=r(953).assert;function s(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,u(this.g.validate(),"Invalid curve"),u(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var r=new s(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:r}),r}})}o.PresetCurve=s,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(1037)}catch(f){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7954:function(e,t,r){"use strict";var n=r(3550),o=r(2156),i=r(953),a=r(5427),u=r(9931),s=i.assert,c=r(1251),f=r(611);function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(s(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new c(this,e)},l.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||u(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),u=t.getPrivate().toArray("be",a),s=e.toArray("be",a),c=new o({hash:this.hash,entropy:u,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new n(1)),d=0;;d++){var h=i.k?i.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var y=p.getX(),b=y.umod(this.n);if(0!==b.cmpn(0)){var v=h.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==y.cmp(b)?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new f({r:b,s:v,recoveryParam:g})}}}}}},l.prototype.verify=function(e,t,r,o){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,o);var i=(t=new f(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var u,s=a.invm(this.n),c=s.mul(e).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&u.eqXToP(i):!(u=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===u.getX().umod(this.n).cmp(i)},l.prototype.recoverPubKey=function(e,t,r,o){s((3&r)===r,"The recovery param is more than two bits"),t=new f(t,o);var i=this.n,a=new n(e),u=t.r,c=t.s,l=1&r,d=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");u=d?this.curve.pointFromX(u.add(this.curve.n),l):this.curve.pointFromX(u,l);var h=t.r.invm(i),p=i.sub(a).mul(h).umod(i),y=c.mul(h).umod(i);return this.g.mulAdd(p,u,y)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")}},1251:function(e,t,r){"use strict";var n=r(3550),o=r(953).assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=i,i.fromPublic=function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.validate()||o(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},611:function(e,t,r){"use strict";var n=r(3550),o=r(953),i=o.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function u(){this.place=0}function s(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=t.place;i<n;i++,a++)o<<=8,o|=e[a],o>>>=0;return!(o<=127)&&(t.place=a,o)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=o.toArray(e,t);var r=new u;if(48!==e[r.place++])return!1;var i=s(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=s(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var f=s(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;var l=e.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var i=n.concat(r),a=[48];return f(a,i.length),a=a.concat(i),o.encode(a,e)}},5980:function(e,t,r){"use strict";var n=r(3715),o=r(5427),i=r(953),a=i.assert,u=i.parseBytes,s=r(9087),c=r(3622);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=o[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),i=this.encodePoint(o),a=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:s,Rencoded:i})},f.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(i)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return i.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return s.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return s.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=i.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),o=i.intFromLE(r);return this.curve.pointFromY(o,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return i.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},9087:function(e,t,r){"use strict";var n=r(953),o=n.assert,i=n.parseBytes,a=n.cachedProperty;function u(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(t.pub)}u.fromPublic=function(e,t){return t instanceof u?t:new u(e,{pub:t})},u.fromSecret=function(e,t){return t instanceof u?t:new u(e,{secret:t})},u.prototype.secret=function(){return this._secret},a(u,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(u,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(u,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(u,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(u,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(u,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),u.prototype.sign=function(e){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},u.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},u.prototype.getSecret=function(e){return o(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},u.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=u},3622:function(e,t,r){"use strict";var n=r(3550),o=r(953),i=o.assert,a=o.cachedProperty,u=o.parseBytes;function s(e,t){this.eddsa=e,"object"!=typeof t&&(t=u(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(s,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(s,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(s,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(s,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),s.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},s.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=s},1037:function(e){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},953:function(e,t,r){"use strict";var n=t,o=r(3550),i=r(9746),a=r(4504);n.assert=i,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),a=0;a<n.length;a++){var u,s=i.andln(o-1);i.isOdd()?(u=s>(o>>1)-1?(o>>1)-s:s,i.isubn(u)):u=0,n[a]=u,i.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,u,s=e.andln(3)+o&3,c=t.andln(3)+i&3;3===s&&(s=-1),3===c&&(c=-1),a=0==(1&s)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?s:-s,r[0].push(a),u=0==(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==s?c:-c,r[1].push(u),2*o===a+1&&(o=1-o),2*i===u+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new o(e,"hex","le")}},8091:function(e){"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),a=0,u=i.length;a<u;a++){var s=i[a],c=Object.getOwnPropertyDescriptor(o,s);void 0!==c&&c.enumerable&&(r[s]=o[s])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},9847:function(e,t,r){"use strict";var n=r(8823).Buffer;var o=r(1964),i=r(6523),a=o.BN,u=new a("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=t||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new n([])},{name:"gasPrice",length:32,allowLess:!0,default:new n([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new n([])},{name:"to",allowZero:!0,length:20,default:new n([])},{name:"value",length:32,allowLess:!0,default:new n([])},{name:"data",alias:"input",allowZero:!0,default:new n([])},{name:"v",allowZero:!0,default:new n([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new n([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new n([])}];o.defineProperties(this,r,t),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var i=o.bufferToInt(this.v),a=Math.floor((i-35)/2);a<0&&(a=0),this._chainId=a||t.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}else t=this.raw.slice(0,6);return o.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=o.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new a(this.s).cmp(u))return!1;try{var t=o.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=o.ecrecover(e,t,this.r,this.s)}catch(r){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=o.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new a(0),r=0;r<e.length;r++)0===e[r]?t.iaddn(i.txDataZeroGas.v):t.iaddn(i.txDataNonZeroGas.v);return t},e.prototype.getBaseFee=function(){var e=this.getDataFee().iaddn(i.txGas.v);return this._homestead&&this.toCreationAddress()&&e.iaddn(i.txCreation.v),e},e.prototype.getUpfrontCost=function(){return new a(this.gasLimit).imul(new a(this.gasPrice)).iadd(new a(this.value))},e.prototype.validate=function(e){var t=[];return this.verifySignature()||t.push("Invalid Signature"),this.getBaseFee().cmp(new a(this.gasLimit))>0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}();e.exports=s},1964:function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(5811),i=r(7221),a=r(9282),u=r(3110),s=r(3550),c=r(3482),f=r(9509).Buffer;Object.assign(t,r(884)),t.MAX_INTEGER=new s("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new s("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=f.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=f.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=f.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=s,t.rlp=u,t.secp256k1=i,t.zeros=function(e){return f.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=t.zeros(20);return t.bufferToHex(e)},t.setLengthLeft=t.setLength=function(e,r,n){var o=t.zeros(r);return e=t.toBuffer(e),n?e.length<r?(e.copy(o),o):e.slice(0,r):e.length<r?(e.copy(o,r-e.length),o):e.slice(-r)},t.setLengthRight=function(e,r){return t.setLength(e,r,!0)},t.unpad=t.stripZeros=function(e){for(var r=(e=t.stripHexPrefix(e))[0];e.length>0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!f.isBuffer(e))if(Array.isArray(e))e=f.from(e);else if("string"==typeof e)e=t.isHexString(e)?f.from(t.padToEven(t.stripHexPrefix(e)),"hex"):f.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=f.allocUnsafe(0);else if(s.isBN(e))e=e.toArrayLike(f);else{if(!e.toArray)throw new Error("invalid type");e=f.from(e.toArray())}return e},t.bufferToInt=function(e){return new s(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new s(e).fromTwos(256)},t.toUnsigned=function(e){return f.from(e.toTwos(256).toArray())},t.keccak=function(e,r){return e=t.toBuffer(e),r||(r=256),o("keccak"+r).update(e).digest()},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),c("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=c("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(u.encode(e))},t.isValidPrivate=function(e){return i.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?i.publicKeyVerify(f.concat([f.from([4]),e])):!!t&&i.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=i.publicKeyConvert(e,!1).slice(1)),a(64===e.length),t.keccak(e).slice(-20)};var l=t.privateToPublic=function(e){return e=t.toBuffer(e),i.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=i.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=i.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(f.concat([r,e]))},t.ecrecover=function(e,r,n,o){var a=f.concat([t.setLength(n,32),t.setLength(o,32)],64),u=r-27;if(0!==u&&1!==u)throw new Error("Invalid signature v value");var s=i.recover(e,a,u);return i.publicKeyConvert(s,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(f.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(l(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",o=0;o<e.length;o++)parseInt(r[o],16)>=8?n+=e[o].toUpperCase():n+=e[o];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new s(r)).isZero()?null:f.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var o=new s("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new s("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new s(t),r=new s(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new s(r).cmp(o))))},t.baToJSON=function(e){if(f.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n<e.length;n++)r.push(t.baToJSON(e[n]));return r}},t.defineProperties=function(e,r,o){if(e.raw=[],e._fields=[],e.toJSON=function(r){if(r){var n={};return e._fields.forEach((function(t){n[t]="0x"+e[t].toString("hex")})),n}return t.baToJSON(this.raw)},e.serialize=function(){return u.encode(e.raw)},r.forEach((function(r,n){function o(){return e.raw[n]}function i(o){"00"!==(o=t.toBuffer(o)).toString("hex")||r.allowZero||(o=f.allocUnsafe(0)),r.allowLess&&r.length?(o=t.stripZeros(o),a(r.length>=o.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===o.length||!r.length||a(r.length===o.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=o}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:o,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:o})})),o)if("string"==typeof o&&(o=f.from(t.stripHexPrefix(o),"hex")),f.isBuffer(o)&&(o=u.decode(o)),Array.isArray(o)){if(o.length>e._fields.length)throw new Error("wrong number of fields in data");o.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===o?"undefined":n(o)))throw new Error("invalid data");var i=Object.keys(o);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=o[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=o[t.alias])}))}}},884:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(3944),i=r(9604);function a(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function u(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var t=u(e);return new n(a(t.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return n.byteLength(e,"utf8")},isHexPrefixed:o,stripHexPrefix:i,padToEven:a,intToHex:u,fromAscii:function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t},fromUtf8:function(e){return"0x"+a(new n(e,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var o=parseInt(e.substr(r,2),16);t+=String.fromCharCode(o)}return t},toUtf8:function(e){return new n(a(i(e).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(e,t,r){if(!Array.isArray(e))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof e+"'");if("string"!=typeof t)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof t+"'.");for(var n=[],o=0;o<e.length;o++){var i=e[o][t];if(r&&!i)i="";else if("string"!=typeof i)throw new Error("invalid abi");n.push(i)}return n},isHexString:function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}}},7187:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(u(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=f.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)n(s,this,t);else{var c=s.length,f=p(s,c);for(r=0;r<c;++r)n(f[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7680:function(e){function t(e){return e}e.exports=function(e,r,n){r=r||t,n=n||e;for(var o=0,i=e.length;o<i;o+=1)if(r.call(n,e[o],o))return e[o]}},9804:function(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,o){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var i=e.length;if(i===+i)for(var a=0;a<i;a++)n.call(o,e[a],a,e);else for(var u in e)t.call(e,u)&&n.call(o,e[u],u,e)}},7648:function(e){"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(t+i);for(var a,u=r.call(arguments,1),s=function(){if(this instanceof a){var t=i.apply(this,u.concat(r.call(arguments)));return Object(t)===t?t:this}return i.apply(e,u.concat(r.call(arguments)))},c=Math.max(0,i.length-u.length),f=[],l=0;l<c;l++)f.push("$"+l);if(a=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(s),i.prototype){var d=function(){};d.prototype=i.prototype,a.prototype=new d,d.prototype=null}return a}},8612:function(e,t,r){"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:function(e,t,r){"use strict";var n,o=SyntaxError,i=Function,a=TypeError,u=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(t){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(O){s=null}var c=function(){throw new a},f=s?function(){try{return c}catch(e){try{return s(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},h={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?d(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},b=function e(t){var r;if("%AsyncFunction%"===t)r=u("async function () {}");else if("%GeneratorFunction%"===t)r=u("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=u("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=d(o.prototype))}return y[t]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=r(8612),m=r(7642),w=g.call(Function.call,Array.prototype.concat),E=g.call(Function.apply,Array.prototype.splice),_=g.call(Function.call,String.prototype.replace),C=g.call(Function.call,String.prototype.slice),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,A=function(e){var t=C(e,0,1),r=C(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,x,(function(e,t,r,o){n[n.length]=r?_(o,S,"$1"):t||e})),n},I=function(e,t){var r,n=e;if(m(v,n)&&(n="%"+(r=v[n])[0]+"%"),m(y,n)){var i=y[n];if(i===h&&(i=b(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var r=A(e),n=r.length>0?r[0]:"",i=I("%"+n+"%",t),u=i.name,c=i.value,f=!1,l=i.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],b=C(p,0,1),v=C(p,-1);if(('"'===b||"'"===b||"`"===b||'"'===v||"'"===v||"`"===v)&&b!==v)throw new o("property names with quotes must have matching quotes");if("constructor"!==p&&h||(f=!0),m(y,u="%"+(n+="."+p)+"%"))c=y[u];else if(null!=c){if(!(p in c)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(s&&d+1>=r.length){var g=s(c,p);c=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:c[p]}else h=m(c,p),c=c[p];h&&!f&&(y[u]=c)}}return c}},1405:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(5419);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},5419:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},7642:function(e,t,r){"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},3349:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(2830).Transform;function i(e){o.call(this),this._block=new n(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5717)(i,o),i.prototype._transform=function(e,t,r){var o=null;try{"buffer"!==t&&(e=new n(e,t)),this.update(e)}catch(i){o=i}r(o)},i.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(r){t=r}e(t)},i.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=new n(e,t||"binary"));for(var r=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[o++];this._update(),this._blockOffset=0}for(;o<e.length;)r[this._blockOffset++]=e[o++];for(var a=0,u=8*e.length;u>0;++a)this._length[a]+=u,(u=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*u);return this},i.prototype._update=function(e){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},3715:function(e,t,r){var n=t;n.utils=r(6436),n.common=r(5772),n.sha=r(9041),n.ripemd=r(2949),n.hmac=r(2344),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5772:function(e,t,r){"use strict";var n=r(6436),o=r(9746);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),o(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n}},2344:function(e,t,r){"use strict";var n=r(6436),o=r(9746);function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),o(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},i.prototype.update=function(e,t){return this.inner.update(e,t),this},i.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},2949:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=n.rotl32,a=n.sum32,u=n.sum32_3,s=n.sum32_4,c=o.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],f=this.h[4],g=r,m=n,w=o,E=c,_=f,C=0;C<80;C++){var x=a(i(s(r,l(C,n,o,c),e[p[C]+t],d(C)),b[C]),f);r=f,f=c,c=i(o,10),o=n,n=x,x=a(i(s(g,l(79-C,m,w,E),e[y[C]+t],h(C)),v[C]),_),g=_,_=E,E=i(w,10),w=m,m=x}x=u(this.h[1],o,E),this.h[1]=u(this.h[2],c,_),this.h[2]=u(this.h[3],f,g),this.h[3]=u(this.h[4],r,m),this.h[4]=u(this.h[0],n,w),this.h[0]=x},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},9041:function(e,t,r){"use strict";t.sha1=r(4761),t.sha224=r(799),t.sha256=r(9344),t.sha384=r(772),t.sha512=r(5900)},4761:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=r(7038),a=n.rotl32,u=n.sum32,s=n.sum32_5,c=i.ft_1,f=o.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],f=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=s(a(o,5),c(p,i,f,d),h,r[n],l[p]);h=d,d=f,f=a(i,30),i=o,o=y}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],f),this.h[3]=u(this.h[3],d),this.h[4]=u(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},799:function(e,t,r){"use strict";var n=r(6436),o=r(9344);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},9344:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=r(7038),a=r(9746),u=n.sum32,s=n.sum32_4,c=n.sum32_5,f=i.ch32,l=i.maj32,d=i.s0_256,h=i.s1_256,p=i.g0_256,y=i.g1_256,b=o.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(g,b),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],b=this.h[2],v=this.h[3],g=this.h[4],m=this.h[5],w=this.h[6],E=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var _=c(E,h(g),f(g,m,w),this.k[n],r[n]),C=u(d(o),l(o,i,b));E=w,w=m,m=g,g=u(v,_),v=b,b=i,i=o,o=u(_,C)}this.h[0]=u(this.h[0],o),this.h[1]=u(this.h[1],i),this.h[2]=u(this.h[2],b),this.h[3]=u(this.h[3],v),this.h[4]=u(this.h[4],g),this.h[5]=u(this.h[5],m),this.h[6]=u(this.h[6],w),this.h[7]=u(this.h[7],E)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},772:function(e,t,r){"use strict";var n=r(6436),o=r(5900);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},5900:function(e,t,r){"use strict";var n=r(6436),o=r(5772),i=r(9746),a=n.rotr64_hi,u=n.rotr64_lo,s=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,b=n.sum64_5_lo,v=o.BlockHash,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function m(){if(!(this instanceof m))return new m;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function E(e,t,r,n,o,i){var a=t&n^~t&i;return a<0&&(a+=4294967296),a}function _(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function C(e,t,r,n,o,i){var a=t&n^t&i^n&i;return a<0&&(a+=4294967296),a}function x(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=u(e,t,28)^u(t,e,2)^u(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function I(e,t){var r=u(e,t,14)^u(e,t,18)^u(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=a(e,t,1)^a(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=u(e,t,1)^u(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,19)^a(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}function P(e,t){var r=u(e,t,19)^u(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(m,v),e.exports=m,m.blockSize=1024,m.outSize=512,m.hmacStrength=192,m.padLength=128,m.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=k(r[n-4],r[n-3]),i=P(r[n-4],r[n-3]),a=r[n-14],u=r[n-13],s=O(r[n-30],r[n-29]),c=T(r[n-30],r[n-29]),f=r[n-32],l=r[n-31];r[n]=h(o,i,a,u,s,c,f,l),r[n+1]=p(o,i,a,u,s,c,f,l)}},m.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],a=this.h[2],u=this.h[3],s=this.h[4],c=this.h[5],h=this.h[6],p=this.h[7],v=this.h[8],g=this.h[9],m=this.h[10],O=this.h[11],T=this.h[12],k=this.h[13],P=this.h[14],B=this.h[15];i(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var j=P,M=B,N=A(v,g),D=I(v,g),L=w(v,g,m,O,T),U=E(v,g,m,O,T,k),H=this.k[R],K=this.k[R+1],F=r[R],G=r[R+1],q=y(j,M,N,D,L,U,H,K,F,G),z=b(j,M,N,D,L,U,H,K,F,G);j=x(n,o),M=S(n,o),N=_(n,o,a,u,s),D=C(n,o,a,u,s,c);var W=l(j,M,N,D),V=d(j,M,N,D);P=T,B=k,T=m,k=O,m=v,O=g,v=l(h,p,q,z),g=d(p,p,q,z),h=s,p=c,s=a,c=u,a=n,u=o,n=l(q,z,W,V),o=d(q,z,W,V)}f(this.h,0,n,o),f(this.h,2,a,u),f(this.h,4,s,c),f(this.h,6,h,p),f(this.h,8,v,g),f(this.h,10,m,O),f(this.h,12,T,k),f(this.h,14,P,B)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7038:function(e,t,r){"use strict";var n=r(6436).rotr32;function o(e,t,r){return e&t^~e&r}function i(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?o(t,r,n):1===e||3===e?a(t,r,n):2===e?i(t,r,n):void 0},t.ch32=o,t.maj32=i,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},6436:function(e,t,r){"use strict";var n=r(9746),o=r(5717);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function u(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=u(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=a(o)),r+=s(o.toString(16))}return r},t.zero2=u,t.zero8=s,t.join32=function(e,t,r,o){var i=r-t;n(i%4==0);for(var a=new Array(i/4),u=0,s=t;u<a.length;u++,s+=4){var c;c="big"===o?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],a[u]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},t.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,a=(i<n?1:0)+r+o;e[t]=a>>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,o,i,a,u){var s=0,c=t;return s+=(c=c+n>>>0)<t?1:0,s+=(c=c+i>>>0)<i?1:0,e+r+o+a+(s+=(c=c+u>>>0)<u?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,o,i,a,u){return t+n+i+u>>>0},t.sum64_5_hi=function(e,t,r,n,o,i,a,u,s,c){var f=0,l=t;return f+=(l=l+n>>>0)<t?1:0,f+=(l=l+i>>>0)<i?1:0,f+=(l=l+u>>>0)<u?1:0,e+r+o+a+s+(f+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,o,i,a,u,s,c){return t+n+i+u+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2156:function(e,t,r){"use strict";var n=r(3715),o=r(4504),i=r(9746);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),n=o.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=o.toArray(e,t),r=o.toArray(r,n),i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=o.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(r),this._reseed++,o.encode(a,t)}},645:function(e,t){t.read=function(e,t,r,n,o){var i,a,u=8*o-n-1,s=(1<<u)-1,c=s>>1,f=-7,l=r?o-1:0,d=r?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=u;f>0;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,u,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+l>=1?d/s:d*Math.pow(2,1-l))*s>=2&&(a++,s/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(t*s-1)*Math.pow(2,o),a+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&u,h+=p,u/=256,o-=8);for(a=a<<o|u,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2584:function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(e){return!(t&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===r.call(e)},o=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r.call(e)&&"[object Function]"===r.call(e.callee)},i=function(){return n(arguments)}();n.isLegacyArguments=o,e.exports=i?n:o},8662:function(e){"use strict";var t=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,o="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,i=Object.getPrototypeOf,a=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}(),u=!(!i||!a)&&i(a);e.exports=function(e){return"function"==typeof e&&(!!n.test(r.call(e))||(o?i&&i(e)===u:"[object GeneratorFunction]"===t.call(e)))}},3944:function(e){e.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},8611:function(e){"use strict";e.exports=function(e){return e!=e}},360:function(e,t,r){"use strict";var n=r(5559),o=r(4289),i=r(8611),a=r(9415),u=r(3194),s=n(a(),Number);o(s,{getPolyfill:a,implementation:i,shim:u}),e.exports=s},9415:function(e,t,r){"use strict";var n=r(8611);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:function(e,t,r){"use strict";var n=r(4289),o=r(9415);e.exports=function(){var e=o();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5692:function(e,t,r){"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),u=r(1405)()&&"symbol"==typeof Symbol.toStringTag,s=o(),c=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},f=i("String.prototype.slice"),l={},d=r(882),h=Object.getPrototypeOf;u&&d&&h&&n(s,(function(e){var t=new r.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=h(t),o=d(n,Symbol.toStringTag);if(!o){var i=h(n);o=d(i,Symbol.toStringTag)}l[e]=o.get}));e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=f(a(e),8,-1);return c(s,t)>-1}return!!d&&function(e){var t=!1;return n(l,(function(r,n){if(!t)try{t=r.call(e)===n}catch(o){}})),t}(e)}},5811:function(e,t,r){"use strict";e.exports=r(6066)(r(9653))},6066:function(e,t,r){"use strict";var n=r(7016),o=r(5675);e.exports=function(e){var t=n(e),r=o(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},7016:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(2830).Transform,i=r(5717);e.exports=function(e){function t(t,r,n,i,a){o.call(this,a),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=a,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return i(t,o),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(o){n=o}r(n)},t.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);var t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},5675:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(2830).Transform,i=r(5717);e.exports=function(e){function t(t,r,n,i){o.call(this,i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}return i(t,o),t.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(o){n=o}r(n)},t.prototype._flush=function(){},t.prototype._read=function(e){this.push(this.squeeze(e))},t.prototype.update=function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this},t.prototype.squeeze=function(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));var r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r},t.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},t.prototype._clone=function(){var e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e},t}},4040:function(e,t){"use strict";var r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(var t=0;t<24;++t){var n=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49],h=l^(i<<1|a>>>31),p=d^(a<<1|i>>>31),y=e[0]^h,b=e[1]^p,v=e[10]^h,g=e[11]^p,m=e[20]^h,w=e[21]^p,E=e[30]^h,_=e[31]^p,C=e[40]^h,x=e[41]^p;h=n^(u<<1|s>>>31),p=o^(s<<1|u>>>31);var S=e[2]^h,A=e[3]^p,I=e[12]^h,O=e[13]^p,T=e[22]^h,k=e[23]^p,P=e[32]^h,B=e[33]^p,R=e[42]^h,j=e[43]^p;h=i^(c<<1|f>>>31),p=a^(f<<1|c>>>31);var M=e[4]^h,N=e[5]^p,D=e[14]^h,L=e[15]^p,U=e[24]^h,H=e[25]^p,K=e[34]^h,F=e[35]^p,G=e[44]^h,q=e[45]^p;h=u^(l<<1|d>>>31),p=s^(d<<1|l>>>31);var z=e[6]^h,W=e[7]^p,V=e[16]^h,Y=e[17]^p,J=e[26]^h,Z=e[27]^p,X=e[36]^h,$=e[37]^p,Q=e[46]^h,ee=e[47]^p;h=c^(n<<1|o>>>31),p=f^(o<<1|n>>>31);var te=e[8]^h,re=e[9]^p,ne=e[18]^h,oe=e[19]^p,ie=e[28]^h,ae=e[29]^p,ue=e[38]^h,se=e[39]^p,ce=e[48]^h,fe=e[49]^p,le=y,de=b,he=g<<4|v>>>28,pe=v<<4|g>>>28,ye=m<<3|w>>>29,be=w<<3|m>>>29,ve=_<<9|E>>>23,ge=E<<9|_>>>23,me=C<<18|x>>>14,we=x<<18|C>>>14,Ee=S<<1|A>>>31,_e=A<<1|S>>>31,Ce=O<<12|I>>>20,xe=I<<12|O>>>20,Se=T<<10|k>>>22,Ae=k<<10|T>>>22,Ie=B<<13|P>>>19,Oe=P<<13|B>>>19,Te=R<<2|j>>>30,ke=j<<2|R>>>30,Pe=N<<30|M>>>2,Be=M<<30|N>>>2,Re=D<<6|L>>>26,je=L<<6|D>>>26,Me=H<<11|U>>>21,Ne=U<<11|H>>>21,De=K<<15|F>>>17,Le=F<<15|K>>>17,Ue=q<<29|G>>>3,He=G<<29|q>>>3,Ke=z<<28|W>>>4,Fe=W<<28|z>>>4,Ge=Y<<23|V>>>9,qe=V<<23|Y>>>9,ze=J<<25|Z>>>7,We=Z<<25|J>>>7,Ve=X<<21|$>>>11,Ye=$<<21|X>>>11,Je=ee<<24|Q>>>8,Ze=Q<<24|ee>>>8,Xe=te<<27|re>>>5,$e=re<<27|te>>>5,Qe=ne<<20|oe>>>12,et=oe<<20|ne>>>12,tt=ae<<7|ie>>>25,rt=ie<<7|ae>>>25,nt=ue<<8|se>>>24,ot=se<<8|ue>>>24,it=ce<<14|fe>>>18,at=fe<<14|ce>>>18;e[0]=le^~Ce&Me,e[1]=de^~xe&Ne,e[10]=Ke^~Qe&ye,e[11]=Fe^~et&be,e[20]=Ee^~Re&ze,e[21]=_e^~je&We,e[30]=Xe^~he&Se,e[31]=$e^~pe&Ae,e[40]=Pe^~Ge&tt,e[41]=Be^~qe&rt,e[2]=Ce^~Me&Ve,e[3]=xe^~Ne&Ye,e[12]=Qe^~ye&Ie,e[13]=et^~be&Oe,e[22]=Re^~ze&nt,e[23]=je^~We&ot,e[32]=he^~Se&De,e[33]=pe^~Ae&Le,e[42]=Ge^~tt&ve,e[43]=qe^~rt&ge,e[4]=Me^~Ve&it,e[5]=Ne^~Ye&at,e[14]=ye^~Ie&Ue,e[15]=be^~Oe&He,e[24]=ze^~nt&me,e[25]=We^~ot&we,e[34]=Se^~De&Je,e[35]=Ae^~Le&Ze,e[44]=tt^~ve&Te,e[45]=rt^~ge&ke,e[6]=Ve^~it&le,e[7]=Ye^~at&de,e[16]=Ie^~Ue&Ke,e[17]=Oe^~He&Fe,e[26]=nt^~me&Ee,e[27]=ot^~we&_e,e[36]=De^~Je&Xe,e[37]=Le^~Ze&$e,e[46]=ve^~Te&Pe,e[47]=ge^~ke&Be,e[8]=it^~le&Ce,e[9]=at^~de&xe,e[18]=Ue^~Ke&Qe,e[19]=He^~Fe&et,e[28]=me^~Ee&Re,e[29]=we^~_e&je,e[38]=Je^~Xe&he,e[39]=Ze^~$e&pe,e[48]=Te^~Pe&Ge,e[49]=ke^~Be&qe,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},9653:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(4040);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(var r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(var t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(o.p1600(this.state),this.count=0)},i.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,0!=(128&e)&&this.count===this.blockSize-1&&o.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,o.p1600(this.state),this.count=0,this.squeezing=!0},i.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);for(var t=n.alloc(e),r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(o.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},9746:function(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4504:function(e,t){"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},2719:function(e){var t=e.exports=function(e,r){if("function"==typeof e||r)return t.by(e,r);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},o=[],i=0;i<e.length;i++){var a=e[i],u="__proto__"===a?n.objects:n[typeof a]||n.objects;Array.isArray(u)?u.indexOf(a)<0&&(u.push(a),o.push(a)):Object.hasOwnProperty.call(u,a)||(u[a]=!0,o.push(a))}return o};t.by=function(e,t){if("function"==typeof e){var r=t;t=e,e=r}for(var n=[],o=0;o<e.length;o++){for(var i=e[o],a=!1,u=0;u<n.length;u++){var s=n[u];if(t.call(n,i,s)){a=!0;break}}a||n.push(i)}return n}},4244:function(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},609:function(e,t,r){"use strict";var n=r(4289),o=r(5559),i=r(4244),a=r(5624),u=r(2281),s=o(a(),Object);n(s,{getPolyfill:a,implementation:i,shim:u}),e.exports=s},5624:function(e,t,r){"use strict";var n=r(4244);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:function(e,t,r){"use strict";var n=r(5624),o=r(4289);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8987:function(e,t,r){"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(1414),u=Object.prototype.propertyIsEnumerable,s=!u.call({toString:null},"toString"),c=u.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{l(window[e])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),u=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(u&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)d.push(String(y));if(n&&e.length>0)for(var b=0;b<e.length;++b)d.push(String(b));else for(var v in e)p&&"prototype"===v||!o.call(e,v)||d.push(String(v));if(s)for(var g=function(e){if("undefined"==typeof window||!h)return l(e);try{return l(e)}catch(t){return!1}}(e),m=0;m<f.length;++m)g&&"constructor"===f[m]||!o.call(e,f[m])||d.push(f[m]);return d}}e.exports=n},2215:function(e,t,r){"use strict";var n=Array.prototype.slice,o=r(1414),i=Object.keys,a=i?function(e){return i(e)}:r(8987),u=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?u(n.call(e)):u(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1414:function(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},4155:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],c=!1,f=-1;function l(){c&&u&&(c=!1,u.length?s=u.concat(s):f=-1,s.length&&d())}function d(){if(!c){var e=a(l);c=!0;for(var t=s.length;t;){for(u=s,s=[];++f<t;)u&&u[f].run();f=-1,t=s.length}u=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new h(e,t)),1!==s.length||c||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},4281:function(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var o,i,a,u;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(s," ").concat(o," ").concat(n(t,"type"))}return u+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:function(e,t,r){"use strict";var n=r(4155),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r(9481),a=r(4229);r(5717)(f,i);for(var u=o(a.prototype),s=0;s<u.length;s++){var c=u[s];f.prototype[c]||(f.prototype[c]=a.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:function(e,t,r){"use strict";e.exports=o;var n=r(4605);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(5717)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},9481:function(e,t,r){"use strict";var n,o=r(4155);e.exports=S,S.ReadableState=x;r(7187).EventEmitter;var i=function(e,t){return e.listeners(t).length},a=r(2503),u=r(8823).Buffer,s=r.g.Uint8Array||function(){};var c,f=r(4616);c=f&&f.debuglog?f.debuglog("stream"):function(){};var l,d,h,p=r(7327),y=r(1195),b=r(2457).getHighWaterMark,v=r(4281).q,g=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,E=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(S,a);var _=y.errorOrDestroy,C=["error","close","destroy","pause","resume"];function x(e,t,o){n=n||r(6753),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",o),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(2553).s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(6753),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new x(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,n,o){c("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?k(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}(e,a);else if(o||(i=function(e,t){var r;n=t,u.isBuffer(n)||n instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),i)_(e,i);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?_(e,new E):I(e,a,t,!0);else if(a.ended)_(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?I(e,a,t,!1):B(e,a)):I(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function I(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),B(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=y.destroy,S.prototype._undestroy=y.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},S.prototype.unshift=function(e){return A(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){l||(l=r(2553).s);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var O=1073741824;function T(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(P,e))}function P(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function j(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){c("readable nexttick read 0"),e.read(0)}function N(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(H,t,e))}function H(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function K(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}S.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):k(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,o=t.needReadable;return c("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",o=!0),t.ended||t.reading?c("reading or ended",o=!1):o&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=T(r,t))),null===(n=e>0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||!1!==t.end)&&e!==o.stdout&&e!==o.stderr?s:b;function u(t,o){c("onunpipe"),t===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",u),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",d),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function s(){c("onend"),e.end()}n.endEmitted?o.nextTick(a):r.once("end",a),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",f);var l=!1;function d(t){c("ondata");var o=e.write(t);c("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==K(n.pipes,e))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){c("onerror",t),b(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",y),b()}function y(){c("onfinish"),e.removeListener("close",p),b()}function b(){c("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",y),e.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=K(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},S.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?k(this):n.reading||o.nextTick(M,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(j,this),r},S.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(j,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(c("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<C.length;i++)e.on(C[i],this.emit.bind(this,C[i]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(5850)),d(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=L,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===h&&(h=r(5167)),h(S,e,t)})},4605:function(e,t,r){"use strict";e.exports=f;var n=r(4281).q,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=n.ERR_TRANSFORM_WITH_LENGTH_0,s=r(6753);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);s.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new u;if(e._transformState.transforming)throw new a;return e.push(null)}r(5717)(f,s),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new o("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:function(e,t,r){"use strict";var n,o=r(4155);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=S,S.WritableState=x;var a={deprecate:r(4927)},u=r(2503),s=r(8823).Buffer,c=r.g.Uint8Array||function(){};var f,l=r(1195),d=r(2457).getHighWaterMark,h=r(4281).q,p=h.ERR_INVALID_ARG_TYPE,y=h.ERR_METHOD_NOT_IMPLEMENTED,b=h.ERR_MULTIPLE_CALLBACK,v=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,E=h.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function C(){}function x(e,t,a){n=n||r(6753),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(P,e,t),e._writableState.errorEmitted=!0,_(e,n)):(i(n),e._writableState.errorEmitted=!0,_(e,n),P(e,t))}(e,r,n,t,i);else{var a=T(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||O(e,r),n?o.nextTick(I,e,r,a,i):I(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function S(e){var t=this instanceof(n=n||r(6753));if(!t&&!f.call(S,this))return new S(e);this._writableState=new x(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function A(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function I(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var u=0,s=!0;r;)o[u]=r,r.isBuf||(s=!1),r=r.next,u+=1;o.allBuffers=s,A(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(A(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function T(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&_(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)}))}function P(e,t){var r=T(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(S,u),x.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(x.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===S&&(e&&e._writableState instanceof x)}})):f=function(e){return e instanceof this},S.prototype.pipe=function(){_(this,new v)},S.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,u=!i.objectMode&&(n=e,s.isBuffer(n)||n instanceof c);return u&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof t&&(r=t,t=null),u?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=C),i.ending?function(e,t){var r=new w;_(e,r),o.nextTick(t,r)}(this,r):(u||function(e,t,r,n){var i;return null===r?i=new m:"string"==typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(_(e,i),o.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,o,i){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=s.from(t,r));return t}(t,n,o);n!==a&&(r=!0,o="buffer",n=a)}var u=t.objectMode?1:n.length;t.length+=u;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,u,n,o,i);return c}(this,i,u,e,t,r)),a},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new y("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},5850:function(e,t,r){"use strict";var n,o=r(4155);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(8610),u=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[u];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[u]=null,e[s]=null,t(p(r,!1)))}}function b(e){o.nextTick(y,e)}var v=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){o.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[f]?r(p(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[d])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),v);e.exports=function(e){var t,r=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[u]=null,r[s]=null,e(p(n,!1))):(r[u]=e,r[s]=t)},writable:!0}),t));return r[l]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[u]=null,r[s]=null,t(e)),void(r[c]=e)}var n=r[u];null!==n&&(r[l]=null,r[u]=null,r[s]=null,n(p(void 0,!0))),r[f]=!0})),e.on("readable",b.bind(null,r)),r}},7327:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=r(8823).Buffer,u=r(2361).inspect,s=u&&u.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,c;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,o=a.allocUnsafe(e>>>0),i=this.head,u=0;i;)t=i.data,r=o,n=u,a.prototype.copy.call(t,r,n),u+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return u(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&i(t.prototype,r),c&&i(t,c),e}()},1195:function(e,t,r){"use strict";var n=r(4155);function o(e,t){a(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,e)):n.nextTick(o,r,e):t?(n.nextTick(i,r),t(e)):n.nextTick(i,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:function(e,t,r){"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||o);var a=r.readable||!1!==r.readable&&t.readable,u=r.writable||!1!==r.writable&&t.writable,s=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){u=!1,c=!0,a||i.call(t)},l=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,l=!0,u||i.call(t)},h=function(e){i.call(t,e)},p=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):u&&!c?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},y=function(){t.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?u&&!t._writableState&&(t.on("end",s),t.on("close",s)):(t.on("complete",f),t.on("abort",p),t.req?y():t.on("request",y)),t.on("end",d),t.on("finish",f),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",f),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",f),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},5167:function(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:function(e,t,r){"use strict";var n;var o=r(4281).q,i=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function u(e){if(e)throw e}function s(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var u=!1;e.on("close",(function(){u=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:o},(function(e){if(e)return i(e);u=!0,i()}));var s=!1;return function(t){if(!u&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new a("pipe"))}}function c(e){e()}function f(e,t){return e.pipe(t)}function l(e){return e.length?"function"!=typeof e[e.length-1]?u:e.pop():u}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,o=l(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var a=t.map((function(e,r){var i=r<t.length-1;return s(e,i,r>0,(function(e){n||(n=e),e&&a.forEach(c),i||(a.forEach(c),o(n))}))}));return t.reduce(f)}},2457:function(e,t,r){"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},2503:function(e,t,r){e.exports=r(7187).EventEmitter},5666:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(P){s=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(e,t,r){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=f(e,t,r);if("normal"===s.type){if(n=r.done?p:d,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(P){return{type:"throw",arg:P}}}e.wrap=c;var l="suspendedStart",d="suspendedYield",h="executing",p="completed",y={};function b(){}function v(){}function g(){}var m={};m[i]=function(){return this};var w=Object.getPrototypeOf,E=w&&w(w(T([])));E&&E!==r&&n.call(E,i)&&(m=E);var _=g.prototype=b.prototype=Object.create(m);function C(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function r(o,i,a,u){var s=f(e[o],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function S(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=f(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function T(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:t,done:!0}}return v.prototype=_.constructor=g,g.constructor=v,v.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,u,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},C(x.prototype),x.prototype[a]=function(){return this},e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(_),s(_,u,"Generator"),_[i]=function(){return this},_.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=T,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(r){Function("r","regeneratorRuntime = r")(t)}},9911:function(e,t){"use strict";function r(e,t,r){var n;if(void 0===r&&(r={}),!t.codes){t.codes={};for(var o=0;o<t.chars.length;++o)t.codes[t.chars[o]]=o}if(!r.loose&&e.length*t.bits&7)throw new SyntaxError("Invalid padding");for(var i=e.length;"="===e[i-1];)if(--i,!(r.loose||(e.length-i)*t.bits&7))throw new SyntaxError("Invalid padding");for(var a=new(null!=(n=r.out)?n:Uint8Array)(i*t.bits/8|0),u=0,s=0,c=0,f=0;f<i;++f){var l=t.codes[e[f]];if(void 0===l)throw new SyntaxError("Invalid character "+e[f]);s=s<<t.bits|l,(u+=t.bits)>=8&&(u-=8,a[c++]=255&s>>u)}if(u>=t.bits||255&s<<8-u)throw new SyntaxError("Unexpected end of data");return a}function n(e,t,r){void 0===r&&(r={});for(var n=r.pad,o=void 0===n||n,i=(1<<t.bits)-1,a="",u=0,s=0,c=0;c<e.length;++c)for(s=s<<8|255&e[c],u+=8;u>t.bits;)u-=t.bits,a+=t.chars[i&s>>u];if(u&&(a+=t.chars[i&s<<t.bits-u]),o)for(;a.length*t.bits&7;)a+="=";return a}Object.defineProperty(t,"__esModule",{value:!0});var o={chars:"0123456789ABCDEF",bits:4},i={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bits:5},a={chars:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bits:5},u={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bits:6},s={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bits:6},c={parse:function(e,t){return r(e.toUpperCase(),o,t)},stringify:function(e,t){return n(e,o,t)}},f={parse:function(e,t){return void 0===t&&(t={}),r(t.loose?e.toUpperCase().replace(/0/g,"O").replace(/1/g,"L").replace(/8/g,"B"):e,i,t)},stringify:function(e,t){return n(e,i,t)}},l={parse:function(e,t){return r(e,a,t)},stringify:function(e,t){return n(e,a,t)}},d={parse:function(e,t){return r(e,u,t)},stringify:function(e,t){return n(e,u,t)}},h={parse:function(e,t){return r(e,s,t)},stringify:function(e,t){return n(e,s,t)}},p={parse:r,stringify:n};t.base16=c,t.base32=f,t.base32hex=l,t.base64=d,t.base64url=h,t.codec=p},9785:function(e,t,r){"use strict";var n=r(8823).Buffer,o=r(5717),i=r(3349);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function u(e,t){return e<<t|e>>>32-t}function s(e,t,r,n,o,i,a,s){return u(e+(t^r^n)+i+a|0,s)+o|0}function c(e,t,r,n,o,i,a,s){return u(e+(t&r|~t&n)+i+a|0,s)+o|0}function f(e,t,r,n,o,i,a,s){return u(e+((t|~r)^n)+i+a|0,s)+o|0}function l(e,t,r,n,o,i,a,s){return u(e+(t&n|r&~n)+i+a|0,s)+o|0}function d(e,t,r,n,o,i,a,s){return u(e+(t^(r|~n))+i+a|0,s)+o|0}o(a,i),a.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,o=this._c,i=this._d,a=this._e;r=s(r,n,o,i,a,e[0],0,11),a=s(a,r,n,o=u(o,10),i,e[1],0,14),i=s(i,a,r,n=u(n,10),o,e[2],0,15),o=s(o,i,a,r=u(r,10),n,e[3],0,12),n=s(n,o,i,a=u(a,10),r,e[4],0,5),r=s(r,n,o,i=u(i,10),a,e[5],0,8),a=s(a,r,n,o=u(o,10),i,e[6],0,7),i=s(i,a,r,n=u(n,10),o,e[7],0,9),o=s(o,i,a,r=u(r,10),n,e[8],0,11),n=s(n,o,i,a=u(a,10),r,e[9],0,13),r=s(r,n,o,i=u(i,10),a,e[10],0,14),a=s(a,r,n,o=u(o,10),i,e[11],0,15),i=s(i,a,r,n=u(n,10),o,e[12],0,6),o=s(o,i,a,r=u(r,10),n,e[13],0,7),n=s(n,o,i,a=u(a,10),r,e[14],0,9),a=c(a,r=s(r,n,o,i=u(i,10),a,e[15],0,8),n,o=u(o,10),i,e[7],1518500249,7),i=c(i,a,r,n=u(n,10),o,e[4],1518500249,6),o=c(o,i,a,r=u(r,10),n,e[13],1518500249,8),n=c(n,o,i,a=u(a,10),r,e[1],1518500249,13),r=c(r,n,o,i=u(i,10),a,e[10],1518500249,11),a=c(a,r,n,o=u(o,10),i,e[6],1518500249,9),i=c(i,a,r,n=u(n,10),o,e[15],1518500249,7),o=c(o,i,a,r=u(r,10),n,e[3],1518500249,15),n=c(n,o,i,a=u(a,10),r,e[12],1518500249,7),r=c(r,n,o,i=u(i,10),a,e[0],1518500249,12),a=c(a,r,n,o=u(o,10),i,e[9],1518500249,15),i=c(i,a,r,n=u(n,10),o,e[5],1518500249,9),o=c(o,i,a,r=u(r,10),n,e[2],1518500249,11),n=c(n,o,i,a=u(a,10),r,e[14],1518500249,7),r=c(r,n,o,i=u(i,10),a,e[11],1518500249,13),i=f(i,a=c(a,r,n,o=u(o,10),i,e[8],1518500249,12),r,n=u(n,10),o,e[3],1859775393,11),o=f(o,i,a,r=u(r,10),n,e[10],1859775393,13),n=f(n,o,i,a=u(a,10),r,e[14],1859775393,6),r=f(r,n,o,i=u(i,10),a,e[4],1859775393,7),a=f(a,r,n,o=u(o,10),i,e[9],1859775393,14),i=f(i,a,r,n=u(n,10),o,e[15],1859775393,9),o=f(o,i,a,r=u(r,10),n,e[8],1859775393,13),n=f(n,o,i,a=u(a,10),r,e[1],1859775393,15),r=f(r,n,o,i=u(i,10),a,e[2],1859775393,14),a=f(a,r,n,o=u(o,10),i,e[7],1859775393,8),i=f(i,a,r,n=u(n,10),o,e[0],1859775393,13),o=f(o,i,a,r=u(r,10),n,e[6],1859775393,6),n=f(n,o,i,a=u(a,10),r,e[13],1859775393,5),r=f(r,n,o,i=u(i,10),a,e[11],1859775393,12),a=f(a,r,n,o=u(o,10),i,e[5],1859775393,7),o=l(o,i=f(i,a,r,n=u(n,10),o,e[12],1859775393,5),a,r=u(r,10),n,e[1],2400959708,11),n=l(n,o,i,a=u(a,10),r,e[9],2400959708,12),r=l(r,n,o,i=u(i,10),a,e[11],2400959708,14),a=l(a,r,n,o=u(o,10),i,e[10],2400959708,15),i=l(i,a,r,n=u(n,10),o,e[0],2400959708,14),o=l(o,i,a,r=u(r,10),n,e[8],2400959708,15),n=l(n,o,i,a=u(a,10),r,e[12],2400959708,9),r=l(r,n,o,i=u(i,10),a,e[4],2400959708,8),a=l(a,r,n,o=u(o,10),i,e[13],2400959708,9),i=l(i,a,r,n=u(n,10),o,e[3],2400959708,14),o=l(o,i,a,r=u(r,10),n,e[7],2400959708,5),n=l(n,o,i,a=u(a,10),r,e[15],2400959708,6),r=l(r,n,o,i=u(i,10),a,e[14],2400959708,8),a=l(a,r,n,o=u(o,10),i,e[5],2400959708,6),i=l(i,a,r,n=u(n,10),o,e[6],2400959708,5),n=d(n,o=l(o,i,a,r=u(r,10),n,e[2],2400959708,12),i,a=u(a,10),r,e[4],2840853838,9),r=d(r,n,o,i=u(i,10),a,e[0],2840853838,15),a=d(a,r,n,o=u(o,10),i,e[5],2840853838,5),i=d(i,a,r,n=u(n,10),o,e[9],2840853838,11),o=d(o,i,a,r=u(r,10),n,e[7],2840853838,6),n=d(n,o,i,a=u(a,10),r,e[12],2840853838,8),r=d(r,n,o,i=u(i,10),a,e[2],2840853838,13),a=d(a,r,n,o=u(o,10),i,e[10],2840853838,12),i=d(i,a,r,n=u(n,10),o,e[14],2840853838,5),o=d(o,i,a,r=u(r,10),n,e[1],2840853838,12),n=d(n,o,i,a=u(a,10),r,e[3],2840853838,13),r=d(r,n,o,i=u(i,10),a,e[8],2840853838,14),a=d(a,r,n,o=u(o,10),i,e[11],2840853838,11),i=d(i,a,r,n=u(n,10),o,e[6],2840853838,8),o=d(o,i,a,r=u(r,10),n,e[15],2840853838,5),n=d(n,o,i,a=u(a,10),r,e[13],2840853838,6),i=u(i,10);var h=this._a,p=this._b,y=this._c,b=this._d,v=this._e;h=d(h,p,y,b,v,e[5],1352829926,8),v=d(v,h,p,y=u(y,10),b,e[14],1352829926,9),b=d(b,v,h,p=u(p,10),y,e[7],1352829926,9),y=d(y,b,v,h=u(h,10),p,e[0],1352829926,11),p=d(p,y,b,v=u(v,10),h,e[9],1352829926,13),h=d(h,p,y,b=u(b,10),v,e[2],1352829926,15),v=d(v,h,p,y=u(y,10),b,e[11],1352829926,15),b=d(b,v,h,p=u(p,10),y,e[4],1352829926,5),y=d(y,b,v,h=u(h,10),p,e[13],1352829926,7),p=d(p,y,b,v=u(v,10),h,e[6],1352829926,7),h=d(h,p,y,b=u(b,10),v,e[15],1352829926,8),v=d(v,h,p,y=u(y,10),b,e[8],1352829926,11),b=d(b,v,h,p=u(p,10),y,e[1],1352829926,14),y=d(y,b,v,h=u(h,10),p,e[10],1352829926,14),p=d(p,y,b,v=u(v,10),h,e[3],1352829926,12),v=l(v,h=d(h,p,y,b=u(b,10),v,e[12],1352829926,6),p,y=u(y,10),b,e[6],1548603684,9),b=l(b,v,h,p=u(p,10),y,e[11],1548603684,13),y=l(y,b,v,h=u(h,10),p,e[3],1548603684,15),p=l(p,y,b,v=u(v,10),h,e[7],1548603684,7),h=l(h,p,y,b=u(b,10),v,e[0],1548603684,12),v=l(v,h,p,y=u(y,10),b,e[13],1548603684,8),b=l(b,v,h,p=u(p,10),y,e[5],1548603684,9),y=l(y,b,v,h=u(h,10),p,e[10],1548603684,11),p=l(p,y,b,v=u(v,10),h,e[14],1548603684,7),h=l(h,p,y,b=u(b,10),v,e[15],1548603684,7),v=l(v,h,p,y=u(y,10),b,e[8],1548603684,12),b=l(b,v,h,p=u(p,10),y,e[12],1548603684,7),y=l(y,b,v,h=u(h,10),p,e[4],1548603684,6),p=l(p,y,b,v=u(v,10),h,e[9],1548603684,15),h=l(h,p,y,b=u(b,10),v,e[1],1548603684,13),b=f(b,v=l(v,h,p,y=u(y,10),b,e[2],1548603684,11),h,p=u(p,10),y,e[15],1836072691,9),y=f(y,b,v,h=u(h,10),p,e[5],1836072691,7),p=f(p,y,b,v=u(v,10),h,e[1],1836072691,15),h=f(h,p,y,b=u(b,10),v,e[3],1836072691,11),v=f(v,h,p,y=u(y,10),b,e[7],1836072691,8),b=f(b,v,h,p=u(p,10),y,e[14],1836072691,6),y=f(y,b,v,h=u(h,10),p,e[6],1836072691,6),p=f(p,y,b,v=u(v,10),h,e[9],1836072691,14),h=f(h,p,y,b=u(b,10),v,e[11],1836072691,12),v=f(v,h,p,y=u(y,10),b,e[8],1836072691,13),b=f(b,v,h,p=u(p,10),y,e[12],1836072691,5),y=f(y,b,v,h=u(h,10),p,e[2],1836072691,14),p=f(p,y,b,v=u(v,10),h,e[10],1836072691,13),h=f(h,p,y,b=u(b,10),v,e[0],1836072691,13),v=f(v,h,p,y=u(y,10),b,e[4],1836072691,7),y=c(y,b=f(b,v,h,p=u(p,10),y,e[13],1836072691,5),v,h=u(h,10),p,e[8],2053994217,15),p=c(p,y,b,v=u(v,10),h,e[6],2053994217,5),h=c(h,p,y,b=u(b,10),v,e[4],2053994217,8),v=c(v,h,p,y=u(y,10),b,e[1],2053994217,11),b=c(b,v,h,p=u(p,10),y,e[3],2053994217,14),y=c(y,b,v,h=u(h,10),p,e[11],2053994217,14),p=c(p,y,b,v=u(v,10),h,e[15],2053994217,6),h=c(h,p,y,b=u(b,10),v,e[0],2053994217,14),v=c(v,h,p,y=u(y,10),b,e[5],2053994217,6),b=c(b,v,h,p=u(p,10),y,e[12],2053994217,9),y=c(y,b,v,h=u(h,10),p,e[2],2053994217,12),p=c(p,y,b,v=u(v,10),h,e[13],2053994217,9),h=c(h,p,y,b=u(b,10),v,e[9],2053994217,12),v=c(v,h,p,y=u(y,10),b,e[7],2053994217,5),b=c(b,v,h,p=u(p,10),y,e[10],2053994217,15),p=s(p,y=c(y,b,v,h=u(h,10),p,e[14],2053994217,8),b,v=u(v,10),h,e[12],0,8),h=s(h,p,y,b=u(b,10),v,e[15],0,5),v=s(v,h,p,y=u(y,10),b,e[10],0,12),b=s(b,v,h,p=u(p,10),y,e[4],0,9),y=s(y,b,v,h=u(h,10),p,e[1],0,12),p=s(p,y,b,v=u(v,10),h,e[5],0,5),h=s(h,p,y,b=u(b,10),v,e[8],0,14),v=s(v,h,p,y=u(y,10),b,e[7],0,6),b=s(b,v,h,p=u(p,10),y,e[6],0,8),y=s(y,b,v,h=u(h,10),p,e[2],0,13),p=s(p,y,b,v=u(v,10),h,e[13],0,6),h=s(h,p,y,b=u(b,10),v,e[14],0,5),v=s(v,h,p,y=u(y,10),b,e[0],0,15),b=s(b,v,h,p=u(p,10),y,e[3],0,13),y=s(y,b,v,h=u(h,10),p,e[9],0,11),p=s(p,y,b,v=u(v,10),h,e[11],0,11),b=u(b,10);var g=this._b+o+b|0;this._b=this._c+i+v|0,this._c=this._d+a+h|0,this._d=this._e+r+p|0,this._e=this._a+n+y|0,this._a=g},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=a},3110:function(e,t,r){const n=r(9282),o=r(9509).Buffer;function i(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function a(e,t){if(e<56)return o.from([e+t]);var r=c(e),n=c(t+55+r.length/2);return o.from(n+r,"hex")}function u(e){var t,r,n,a,s,c=[],f=e[0];if(f<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(f<=183){if(t=f-127,n=128===f?o.from([]):e.slice(1,t),2===t&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}if(f<=191){if(r=f-182,t=i(e.slice(1,r).toString("hex"),16),(n=e.slice(r,t+r)).length<t)throw new Error("invalid RLP");return{data:n,remainder:e.slice(t+r)}}if(f<=247){for(t=f-191,a=e.slice(1,t);a.length;)s=u(a),c.push(s.data),a=s.remainder;return{data:c,remainder:e.slice(t)}}var l=(r=f-246)+(t=i(e.slice(1,r).toString("hex"),16));if(l>e.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(a=e.slice(r,l)).length)throw new Error("invalid rlp, List has a invalid length");for(;a.length;)s=u(a),c.push(s.data),a=s.remainder;return{data:c,remainder:e.slice(l)}}function s(e){return"0x"===e.slice(0,2)}function c(e){var t=e.toString(16);return t.length%2&&(t="0"+t),t}function f(e){if(!o.isBuffer(e))if("string"==typeof e)e=s(e)?o.from(((r="string"!=typeof(n=e)?n:s(n)?n.slice(2):n).length%2&&(r="0"+r),r),"hex"):o.from(e);else if("number"==typeof e)e?(t=c(e),e=o.from(t,"hex")):e=o.from([]);else if(null==e)e=o.from([]);else{if(!e.toArray)throw new Error("invalid type");e=o.from(e.toArray())}var t,r,n;return e}t.encode=function(e){if(e instanceof Array){for(var r=[],n=0;n<e.length;n++)r.push(t.encode(e[n]));var i=o.concat(r);return o.concat([a(i.length,192),i])}return 1===(e=f(e)).length&&e[0]<128?e:o.concat([a(e.length,128),e])},t.decode=function(e,t){if(!e||0===e.length)return o.from([]);var r=u(e=f(e));return t?r:(n.equal(r.remainder.length,0,"invalid remainder"),r.data)},t.getLength=function(e){if(!e||0===e.length)return o.from([]);var t=(e=f(e))[0];if(t<=127)return e.length;if(t<=183)return t-127;if(t<=191)return t-182;if(t<=247)return t-191;var r=t-246;return r+i(e.slice(1,r).toString("hex"),16)}},9509:function(e,t,r){var n=r(8823),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7635:function(e){"use strict";!function(t){var r=2147483647;function n(e){var t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r=1779033703,n=3144134277,o=1013904242,i=2773480762,a=1359893119,u=2600822924,s=528734635,c=1541459225,f=new Array(64);function l(e){for(var l=0,d=e.length;d>=64;){var h,p,y,b,v,g=r,m=n,w=o,E=i,_=a,C=u,x=s,S=c;for(p=0;p<16;p++)y=l+4*p,f[p]=(255&e[y])<<24|(255&e[y+1])<<16|(255&e[y+2])<<8|255&e[y+3];for(p=16;p<64;p++)b=((h=f[p-2])>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,v=((h=f[p-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(b+f[p-7]|0)+(v+f[p-16]|0)|0;for(p=0;p<64;p++)b=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&C^~_&x)|0)+(S+(t[p]+f[p]|0)|0)|0,v=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&m^g&w^m&w)|0,S=x,x=C,C=_,_=E+b|0,E=w,w=m,m=g,g=b+v|0;r=r+g|0,n=n+m|0,o=o+w|0,i=i+E|0,a=a+_|0,u=u+C|0,s=s+x|0,c=c+S|0,l+=64,d-=64}}l(e);var d,h=e.length%64,p=e.length/536870912|0,y=e.length<<3,b=h<56?56:120,v=e.slice(e.length-h,e.length);for(v.push(128),d=h+1;d<b;d++)v.push(0);return v.push(p>>>24&255),v.push(p>>>16&255),v.push(p>>>8&255),v.push(p>>>0&255),v.push(y>>>24&255),v.push(y>>>16&255),v.push(y>>>8&255),v.push(y>>>0&255),l(v),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function o(e,t,r){var o;e=e.length<=64?e:n(e);var i=64+t.length+4,a=new Array(i),u=new Array(64),s=[];for(o=0;o<64;o++)a[o]=54;for(o=0;o<e.length;o++)a[o]^=e[o];for(o=0;o<t.length;o++)a[64+o]=t[o];for(o=i-4;o<i;o++)a[o]=0;for(o=0;o<64;o++)u[o]=92;for(o=0;o<e.length;o++)u[o]^=e[o];function c(){for(var e=i-1;e>=i-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;r>=32;)c(),s=s.concat(n(u.concat(n(a)))),r-=32;return r>0&&(c(),s=s.concat(n(u.concat(n(a))).slice(0,r))),s}function i(e,t,r,n,o){var i;for(c(e,16*(2*r-1),o,0,16),i=0;i<2*r;i++)s(e,16*i,o,16),u(o,n),c(o,0,e,t+16*i,16);for(i=0;i<r;i++)c(e,t+2*i*16,e,16*i,16);for(i=0;i<r;i++)c(e,t+16*(2*i+1),e,16*(i+r),16)}function a(e,t){return e<<t|e>>>32-t}function u(e,t){c(e,0,t,0,16);for(var r=8;r>0;r-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(r=0;r<16;++r)e[r]+=t[r]}function s(e,t,r,n){for(var o=0;o<n;o++)r[o]^=e[t+o]}function c(e,t,r,n,o){for(;o--;)r[n++]=e[t++]}function f(e){if(!e||"number"!=typeof e.length)return!1;for(var t=0;t<e.length;t++){if("number"!=typeof e[t])return!1;var r=parseInt(e[t]);if(r!=e[t]||r<0||r>=256)return!1}return!0}function l(e,t){var r=parseInt(e);if(e!=r)throw new Error("invalid "+t);return r}e.exports=function(e,t,n,a,u,d,h){if(!h)throw new Error("missing callback");if(n=l(n,"N"),a=l(a,"r"),u=l(u,"p"),d=l(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/u)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(!f(t))throw new Error("salt must be an array or buffer");for(var p=o(e,t,128*u*a),y=new Uint32Array(32*u*a),b=0;b<y.length;b++){var v=4*b;y[b]=(255&p[v+3])<<24|(255&p[v+2])<<16|(255&p[v+1])<<8|(255&p[v+0])<<0}var g,m,w=new Uint32Array(64*a),E=new Uint32Array(32*a*n),_=32*a,C=new Uint32Array(16),x=new Uint32Array(16),S=u*n*2,A=0,I=null,O=!1,T=0,k=0,P=parseInt(1e3/a),B="undefined"!=typeof setImmediate?setImmediate:setTimeout,R=function(){if(O)return h(new Error("cancelled"),A/S);switch(T){case 0:c(y,m=32*k*a,w,0,_),T=1,g=0;case 1:(r=n-g)>P&&(r=P);for(var t=0;t<r;t++)c(w,0,E,(g+t)*_,_),i(w,_,a,C,x);if(g+=r,A+=r,(f=parseInt(1e3*A/S))!==I){if(O=h(null,A/S))break;I=f}if(g<n)break;g=0,T=2;case 2:var r,f;for((r=n-g)>P&&(r=P),t=0;t<r;t++){var l=w[16*(2*a-1)]&n-1;s(E,l*_,w,_),i(w,_,a,C,x)}if(g+=r,A+=r,(f=parseInt(1e3*A/S))!==I){if(O=h(null,A/S))break;I=f}if(g<n)break;if(c(w,0,y,m,_),++k<u){T=0;break}for(p=[],t=0;t<y.length;t++)p.push(y[t]>>0&255),p.push(y[t]>>8&255),p.push(y[t]>>16&255),p.push(y[t]>>24&255);var b=o(e,p,d);return h(null,1,b)}B(R)};R()}}()},7221:function(e,t,r){"use strict";e.exports=r(9119)(r(3441))},4435:function(e,t,r){"use strict";var n=r(8823).Buffer,o=Object.prototype.toString;t.isArray=function(e,t){if(!Array.isArray(e))throw TypeError(t)},t.isBoolean=function(e,t){if("[object Boolean]"!==o.call(e))throw TypeError(t)},t.isBuffer=function(e,t){if(!n.isBuffer(e))throw TypeError(t)},t.isFunction=function(e,t){if("[object Function]"!==o.call(e))throw TypeError(t)},t.isNumber=function(e,t){if("[object Number]"!==o.call(e))throw TypeError(t)},t.isObject=function(e,t){if("[object Object]"!==o.call(e))throw TypeError(t)},t.isBufferLength=function(e,t,r){if(e.length!==t)throw RangeError(r)},t.isBufferLength2=function(e,t,r,n){if(e.length!==t&&e.length!==r)throw RangeError(n)},t.isLengthGTZero=function(e,t){if(0===e.length)throw RangeError(t)},t.isNumberInInterval=function(e,t,r,n){if(e<=t||e>=r)throw RangeError(n)}},8424:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(3027),i=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(e,t,r){var o=n.from(r?i:a);return e.copy(o,r?8:9),t.copy(o,r?181:214),o},t.privateKeyImport=function(e){var t=e.length,r=0;if(!(t<r+1||48!==e[r])&&!(t<(r+=1)+1)&&128&e[r]){var n=127&e[r];if(r+=1,!(n<1||n>2||t<r+n)){var o=e[r+n-1]|(n>1?e[r+n-2]<<8:0);if(!(t<(r+=n)+o||t<r+3||2!==e[r]||1!==e[r+1]||1!==e[r+2]||t<(r+=3)+2||4!==e[r]||e[r+1]>32||t<r+2+e[r+1]))return e.slice(r+2,r+2+e[r+1])}}},t.signatureExport=function(e){for(var t=n.concat([n.from([0]),e.r]),r=33,i=0;r>1&&0===t[i]&&!(128&t[i+1]);--r,++i);for(var a=n.concat([n.from([0]),e.s]),u=33,s=0;u>1&&0===a[s]&&!(128&a[s+1]);--u,++s);return o.encode(t.slice(i),a.slice(s))},t.signatureImport=function(e){var t=n.alloc(32,0),r=n.alloc(32,0);try{var i=o.decode(e);if(33===i.r.length&&0===i.r[0]&&(i.r=i.r.slice(1)),i.r.length>32)throw new Error("R length is too long");if(33===i.s.length&&0===i.s[0]&&(i.s=i.s.slice(1)),i.s.length>32)throw new Error("S length is too long")}catch(a){return}return i.r.copy(t,32-i.r.length),i.s.copy(r,32-i.s.length),{r:t,s:r}},t.signatureImportLax=function(e){var t=n.alloc(32,0),r=n.alloc(32,0),o=e.length,i=0;if(48===e[i++]){var a=e[i++];if(!(128&a&&(i+=a-128)>o)&&2===e[i++]){var u=e[i++];if(128&u){if(i+(a=u-128)>o)return;for(;a>0&&0===e[i];i+=1,a-=1);for(u=0;a>0;i+=1,a-=1)u=(u<<8)+e[i]}if(!(u>o-i)){var s=i;if(i+=u,2===e[i++]){var c=e[i++];if(128&c){if(i+(a=c-128)>o)return;for(;a>0&&0===e[i];i+=1,a-=1);for(c=0;a>0;i+=1,a-=1)c=(c<<8)+e[i]}if(!(c>o-i)){var f=i;for(i+=c;u>0&&0===e[s];u-=1,s+=1);if(!(u>32)){var l=e.slice(s,s+u);for(l.copy(t,32-l.length);c>0&&0===e[f];c-=1,f+=1);if(!(c>32)){var d=e.slice(f,f+c);return d.copy(r,32-d.length),{r:t,s:r}}}}}}}}}},3441:function(e,t,r){"use strict";var n=r(9509).Buffer,o=r(3482),i=r(3550),a=r(6266).ec,u=r(9610),s=new a("secp256k1"),c=s.curve;function f(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new i(t);if(r.cmp(c.p)>=0)return null;var n=(r=r.toRed(c.red)).redSqr().redIMul(r).redIAdd(c.b).redSqrt();return 3===e!==n.isOdd()&&(n=n.redNeg()),s.keyPair({pub:{x:r,y:n}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var n=new i(t),o=new i(r);if(n.cmp(c.p)>=0||o.cmp(c.p)>=0)return null;if(n=n.toRed(c.red),o=o.toRed(c.red),(6===e||7===e)&&o.isOdd()!==(7===e))return null;var a=n.redSqr().redIMul(n);return o.redSqr().redISub(a.redIAdd(c.b)).isZero()?s.keyPair({pub:{x:n,y:o}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new i(e);return t.cmp(c.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var r=new i(e);if(r.cmp(c.n)>=0||r.isZero())throw new Error(u.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(s.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new i(e);return t.isZero()?n.alloc(32):c.n.sub(t).umod(c.n).toArrayLike(n,"be",32)},t.privateKeyModInverse=function(e){var t=new i(e);if(t.cmp(c.n)>=0||t.isZero())throw new Error(u.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(c.n).toArrayLike(n,"be",32)},t.privateKeyTweakAdd=function(e,t){var r=new i(t);if(r.cmp(c.n)>=0)throw new Error(u.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new i(e)),r.cmp(c.n)>=0&&r.isub(c.n),r.isZero())throw new Error(u.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},t.privateKeyTweakMul=function(e,t){var r=new i(t);if(r.cmp(c.n)>=0||r.isZero())throw new Error(u.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new i(e)),r.cmp(c.n)&&(r=r.umod(c.n)),r.toArrayLike(n,"be",32)},t.publicKeyCreate=function(e,t){var r=new i(e);if(r.cmp(c.n)>=0||r.isZero())throw new Error(u.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(s.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var r=f(e);if(null===r)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==f(e)},t.publicKeyTweakAdd=function(e,t,r){var o=f(e);if(null===o)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new i(t)).cmp(c.n)>=0)throw new Error(u.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(c.g.mul(t).add(o.pub).encode(!0,r))},t.publicKeyTweakMul=function(e,t,r){var o=f(e);if(null===o)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new i(t)).cmp(c.n)>=0||t.isZero())throw new Error(u.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(o.pub.mul(t).encode(!0,r))},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),o=0;o<e.length;++o)if(r[o]=f(e[o]),null===r[o])throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);for(var i=r[0].pub,a=1;a<r.length;++a)i=i.add(r[a].pub);if(i.isInfinity())throw new Error(u.EC_PUBLIC_KEY_COMBINE_FAIL);return n.from(i.encode(!0,t))},t.signatureNormalize=function(e){var t=new i(e.slice(0,32)),r=new i(e.slice(32,64));if(t.cmp(c.n)>=0||r.cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);var o=n.from(e);return 1===r.cmp(s.nh)&&c.n.sub(r).toArrayLike(n,"be",32).copy(o,32),o},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new i(t).cmp(c.n)>=0||new i(r).cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new i(e.r);t.cmp(c.n)>=0&&(t=new i(0));var r=new i(e.s);return r.cmp(c.n)>=0&&(r=new i(0)),n.concat([t.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},t.sign=function(e,t,r,o){if("function"==typeof r){var a=r;r=function(r){var s=a(e,t,null,o,r);if(!n.isBuffer(s)||32!==s.length)throw new Error(u.ECDSA_SIGN_FAIL);return new i(s)}}var f=new i(t);if(f.cmp(c.n)>=0||f.isZero())throw new Error(u.ECDSA_SIGN_FAIL);var l=s.sign(e,t,{canonical:!0,k:r,pers:o});return{signature:n.concat([l.r.toArrayLike(n,"be",32),l.s.toArrayLike(n,"be",32)]),recovery:l.recoveryParam}},t.verify=function(e,t,r){var n={r:t.slice(0,32),s:t.slice(32,64)},o=new i(n.r),a=new i(n.s);if(o.cmp(c.n)>=0||a.cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(s.nh)||o.isZero()||a.isZero())return!1;var l=f(r);if(null===l)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);return s.verify(e,n,{x:l.pub.x,y:l.pub.y})},t.recover=function(e,t,r,o){var a={r:t.slice(0,32),s:t.slice(32,64)},f=new i(a.r),l=new i(a.s);if(f.cmp(c.n)>=0||l.cmp(c.n)>=0)throw new Error(u.ECDSA_SIGNATURE_PARSE_FAIL);try{if(f.isZero()||l.isZero())throw new Error;var d=s.recoverPubKey(e,a,r);return n.from(d.encode(!0,o))}catch(h){throw new Error(u.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return o("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var o=f(e);if(null===o)throw new Error(u.EC_PUBLIC_KEY_PARSE_FAIL);var a=new i(t);if(a.cmp(c.n)>=0||a.isZero())throw new Error(u.ECDH_FAIL);return n.from(o.pub.mul(a).encode(!0,r))}},9119:function(e,t,r){"use strict";var n=r(4435),o=r(8424),i=r(9610);function a(e,t){return void 0===e?t:(n.isBoolean(e,i.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var u=e.privateKeyExport(t,r);return o.privateKeyExport(t,u,r)},privateKeyImport:function(t){if(n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),(t=o.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(i.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,o){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),o=a(o,!0),e.publicKeyTweakAdd(t,r,o)},publicKeyTweakMul:function(t,r,o){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,i.TWEAK_LENGTH_INVALID),o=a(o,!0),e.publicKeyTweakMul(t,r,o)},publicKeyCombine:function(t,r){n.isArray(t,i.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,i.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var o=0;o<t.length;++o)n.isBuffer(t[o],i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t[o],33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID);return r=a(r,!0),e.publicKeyCombine(t,r)},signatureNormalize:function(t){return n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(t,64,i.ECDSA_SIGNATURE_LENGTH_INVALID),e.signatureNormalize(t)},signatureExport:function(t){n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(t,64,i.ECDSA_SIGNATURE_LENGTH_INVALID);var r=e.signatureExport(t);return o.signatureExport(r)},signatureImport:function(t){n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(t,i.ECDSA_SIGNATURE_LENGTH_INVALID);var r=o.signatureImport(t);if(r)return e.signatureImport(r);throw new Error(i.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(t){n.isBuffer(t,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(t,i.ECDSA_SIGNATURE_LENGTH_INVALID);var r=o.signatureImportLax(t);if(r)return e.signatureImport(r);throw new Error(i.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(t,r,o){n.isBuffer(t,i.MSG32_TYPE_INVALID),n.isBufferLength(t,32,i.MSG32_LENGTH_INVALID),n.isBuffer(r,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,i.EC_PRIVATE_KEY_LENGTH_INVALID);var a=null,u=null;return void 0!==o&&(n.isObject(o,i.OPTIONS_TYPE_INVALID),void 0!==o.data&&(n.isBuffer(o.data,i.OPTIONS_DATA_TYPE_INVALID),n.isBufferLength(o.data,32,i.OPTIONS_DATA_LENGTH_INVALID),a=o.data),void 0!==o.noncefn&&(n.isFunction(o.noncefn,i.OPTIONS_NONCEFN_TYPE_INVALID),u=o.noncefn)),e.sign(t,r,u,a)},verify:function(t,r,o){return n.isBuffer(t,i.MSG32_TYPE_INVALID),n.isBufferLength(t,32,i.MSG32_LENGTH_INVALID),n.isBuffer(r,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,i.ECDSA_SIGNATURE_LENGTH_INVALID),n.isBuffer(o,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(o,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),e.verify(t,r,o)},recover:function(t,r,o,u){return n.isBuffer(t,i.MSG32_TYPE_INVALID),n.isBufferLength(t,32,i.MSG32_LENGTH_INVALID),n.isBuffer(r,i.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,i.ECDSA_SIGNATURE_LENGTH_INVALID),n.isNumber(o,i.RECOVERY_ID_TYPE_INVALID),n.isNumberInInterval(o,-1,4,i.RECOVERY_ID_VALUE_INVALID),u=a(u,!0),e.recover(t,r,o,u)},ecdh:function(t,r){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),e.ecdh(t,r)},ecdhUnsafe:function(t,r,o){return n.isBuffer(t,i.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,i.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,i.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,i.EC_PRIVATE_KEY_LENGTH_INVALID),o=a(o,!0),e.ecdhUnsafe(t,r,o)}}}},7716:function(e,t){"use strict";function r(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,o)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function u(e){r(a,o,i,u,s,"next",e)}function s(e){r(a,o,i,u,s,"throw",e)}u(void 0)}))}}function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=function(e){for(var t=encodeURI(e),r=new Uint8Array(t.length),n=0,o=0;o<t.length;++o){var i=t.charCodeAt(o);37===i?(r[n++]=parseInt(t.slice(o+1,o+3),16),o+=2):r[n++]=i}return r.subarray(0,n)},s=function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];t+="%"+(n>>4).toString(16)+(15&n).toString(16)}return decodeURIComponent(t)};function c(e){var t=e.body,r=void 0===t?"":t,o=e.headers,i=void 0===o?{}:o,a=e.status,c=void 0===a?200:a,l=Promise.resolve(r),d={headers:f(i),ok:c>=200&&c<300,status:c,arrayBuffer:function(){return n((function*(){return yield l.then((function(e){return"string"==typeof e?u(e).buffer:e}))}))()},json:function(){return n((function*(){return yield d.text().then((function(e){return JSON.parse(e)}))}))()},text:function(){return n((function*(){return yield l.then((function(e){return"string"==typeof e?e:s(new Uint8Array(e))}))}))()}};return d}function f(e){var t={forEach:function(t,r){for(var n=0,o=Object.keys(e);n<o.length;n++){var i=o[n];t.call(r,e[i],i)}},get:function(r){return t.has(r)?e[r]:null},has:function(t){return Object.prototype.hasOwnProperty.call(e,t)}};return t}t.hd=function(e){return function(){var t=n((function*(t,r){void 0===r&&(r={});var n=r,o=n.body,i=void 0===o?"":o,a=n.method,s=void 0===a?"GET":a,f=n.headers,l=void 0===f?{}:f,d={method:s,path:t.replace(/https?:\/\/[^/]*/,""),version:"HTTP/1.1",headers:l,body:"string"==typeof i?u(i):new Uint8Array(i)};return c(yield e(d))}));return function(e,r){return t.apply(this,arguments)}}()},t.O7=c,t.h6=function(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];t[o.toUpperCase()]=e[o]}null==t.OPTIONS&&(t.OPTIONS=function(){return{status:204,headers:i}});var i={"content-length":"0",allow:Object.keys(t).join(", ")};return function(e){var r=t[e.method];return null!=r?r(e):{status:405,headers:i}}},t.Fl=function(e,t){void 0===t&&(t=function(){return{status:404}});for(var r=[],n=0,o=Object.keys(e);n<o.length;n++){var i=o[n];r.push({regexp:new RegExp("^"+i+"$"),server:e[i]})}return function(e){for(var n,o=a(r);!(n=o()).done;){var i=n.value,u=i.regexp,s=i.server;if(u.test(e.path))return s(e)}return t(e)}},t.o3=function(e){return function(){var t=n((function*(t){var r=yield e(t),n=r.headers;return o({},r,{headers:o({},void 0===n?{}:n,{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"Accept, Authorization, Content-Type","Access-Control-Allow-Methods":"DELETE, GET, OPTIONS, POST, PUT"})})}));return function(e){return t.apply(this,arguments)}}()}},4189:function(e,t,r){var n=r(9509).Buffer;function o(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,o=this._blockSize,i=e.length,a=this._len,u=0;u<i;){for(var s=a%o,c=Math.min(i-u,o-s),f=0;f<c;f++)r[s+f]=e[u+f];u+=c,(a+=c)%o==0&&this._update(r)}return this._len+=i,this},o.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,o=(r-n)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},9072:function(e,t,r){var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},4448:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function s(){this.init(),this._w=u,o.call(this,64,56)}function c(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(s,o),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,u=0|this._d,s=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+f(h,o,i,u)+s+r[d]+a[h];s=u,u=i,i=c(o),o=n,n=p}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0},s.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=s},8336:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function s(){this.init(),this._w=u,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(s,o),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,u=0|this._d,s=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),y=c(n)+l(p,o,i,u)+s+r[h]+a[p]|0;s=u,u=i,i=f(o),o=n,n=y}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0},s.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=s},8432:function(e,t,r){var n=r(5717),o=r(7499),i=r(4189),a=r(9509).Buffer,u=new Array(64);function s(){this.init(),this._w=u,i.call(this,64,56)}n(s,o),s.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},s.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=s},7499:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u=new Array(64);function s(){this.init(),this._w=u,o.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(s,o),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,u=0|this._d,s=0|this._e,p=0|this._f,y=0|this._g,b=0|this._h,v=0;v<16;++v)r[v]=e.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((t=r[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[v-7]+h(r[v-15])+r[v-16];for(var g=0;g<64;++g){var m=b+d(s)+c(s,p,y)+a[g]+r[g]|0,w=l(n)+f(n,o,i)|0;b=y,y=p,p=s,s=u+m|0,u=i,i=o,o=n,n=m+w|0}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=u+this._d|0,this._e=s+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},s.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=s},1686:function(e,t,r){var n=r(5717),o=r(7816),i=r(4189),a=r(9509).Buffer,u=new Array(160);function s(){this.init(),this._w=u,i.call(this,128,112)}n(s,o),s.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},s.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=s},7816:function(e,t,r){var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],u=new Array(160);function s(){this.init(),this._w=u,o.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0<t>>>0?1:0}n(s,o),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,o=0|this._ch,i=0|this._dh,u=0|this._eh,s=0|this._fh,g=0|this._gh,m=0|this._hh,w=0|this._al,E=0|this._bl,_=0|this._cl,C=0|this._dl,x=0|this._el,S=0|this._fl,A=0|this._gl,I=0|this._hl,O=0;O<32;O+=2)t[O]=e.readInt32BE(4*O),t[O+1]=e.readInt32BE(4*O+4);for(;O<160;O+=2){var T=t[O-30],k=t[O-30+1],P=h(T,k),B=p(k,T),R=y(T=t[O-4],k=t[O-4+1]),j=b(k,T),M=t[O-14],N=t[O-14+1],D=t[O-32],L=t[O-32+1],U=B+N|0,H=P+M+v(U,B)|0;H=(H=H+R+v(U=U+j|0,j)|0)+D+v(U=U+L|0,L)|0,t[O]=H,t[O+1]=U}for(var K=0;K<160;K+=2){H=t[K],U=t[K+1];var F=f(r,n,o),G=f(w,E,_),q=l(r,w),z=l(w,r),W=d(u,x),V=d(x,u),Y=a[K],J=a[K+1],Z=c(u,s,g),X=c(x,S,A),$=I+V|0,Q=m+W+v($,I)|0;Q=(Q=(Q=Q+Z+v($=$+X|0,X)|0)+Y+v($=$+J|0,J)|0)+H+v($=$+U|0,U)|0;var ee=z+G|0,te=q+F+v(ee,z)|0;m=g,I=A,g=s,A=S,s=u,S=x,u=i+Q+v(x=C+$|0,C)|0,i=o,C=_,o=n,_=E,n=r,E=w,r=Q+te+v(w=$+ee|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+E|0,this._cl=this._cl+_|0,this._dl=this._dl+C|0,this._el=this._el+x|0,this._fl=this._fl+S|0,this._gl=this._gl+A|0,this._hl=this._hl+I|0,this._ah=this._ah+r+v(this._al,w)|0,this._bh=this._bh+n+v(this._bl,E)|0,this._ch=this._ch+o+v(this._cl,_)|0,this._dh=this._dh+i+v(this._dl,C)|0,this._eh=this._eh+u+v(this._el,x)|0,this._fh=this._fh+s+v(this._fl,S)|0,this._gh=this._gh+g+v(this._gl,A)|0,this._hh=this._hh+m+v(this._hl,I)|0},s.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=s},2830:function(e,t,r){e.exports=o;var n=r(7187).EventEmitter;function o(){n.call(this)}r(5717)(o,n),o.Readable=r(9481),o.Writable=r(4229),o.Duplex=r(6753),o.Transform=r(4605),o.PassThrough=r(2725),o.finished=r(8610),o.pipeline=r(9946),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",u),r.on("close",s));var a=!1;function u(){a||(a=!0,e.end())}function s(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",o),e.removeListener("drain",i),r.removeListener("end",u),r.removeListener("close",s),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},2553:function(e,t,r){"use strict";var n=r(9509).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=c,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=a(t[n]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if((o=a(t[n]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if((o=a(t[n]))>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},9604:function(e,t,r){var n=r(3944);e.exports=function(e){return"string"!=typeof e?e:n(e)?e.slice(2):e}},7121:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}}),e=r.hmd(e);var n=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},4927:function(e,t,r){function n(e){try{if(!r.g.localStorage)return!1}catch(n){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},384:function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},5955:function(e,t,r){"use strict";var n=r(2584),o=r(8662),i=r(6430),a=r(5692);function u(e){return e.call.bind(e)}var s="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=u(Object.prototype.toString),l=u(Number.prototype.valueOf),d=u(String.prototype.valueOf),h=u(Boolean.prototype.valueOf);if(s)var p=u(BigInt.prototype.valueOf);if(c)var y=u(Symbol.prototype.valueOf);function b(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(r){return!1}}function v(e){return"[object Map]"===f(e)}function g(e){return"[object Set]"===f(e)}function m(e){return"[object WeakMap]"===f(e)}function w(e){return"[object WeakSet]"===f(e)}function E(e){return"[object ArrayBuffer]"===f(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(E.working?E(e):e instanceof ArrayBuffer)}function C(e){return"[object DataView]"===f(e)}function x(e){return"undefined"!=typeof DataView&&(C.working?C(e):e instanceof DataView)}function S(e){return"[object SharedArrayBuffer]"===f(e)}function A(e){return"undefined"!=typeof SharedArrayBuffer&&(S.working?S(e):e instanceof SharedArrayBuffer)}function I(e){return b(e,l)}function O(e){return b(e,d)}function T(e){return b(e,h)}function k(e){return s&&b(e,p)}function P(e){return c&&b(e,y)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||x(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},v.working="undefined"!=typeof Map&&v(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(v.working?v(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(m.working?m(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),t.isArrayBuffer=_,C.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&C(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=x,S.working="undefined"!=typeof SharedArrayBuffer&&S(new SharedArrayBuffer),t.isSharedArrayBuffer=A,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===f(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===f(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===f(e)},t.isGeneratorObject=function(e){return"[object Generator]"===f(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===f(e)},t.isNumberObject=I,t.isStringObject=O,t.isBooleanObject=T,t.isBigIntObject=k,t.isSymbolObject=P,t.isBoxedPrimitive=function(e){return I(e)||O(e)||T(e)||k(e)||P(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||A(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9539:function(e,t,r){var n=r(4155),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])v(u)||!_(u)?a+=" "+u:a+=" "+c(u);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var a={},u=/^$/;if(n.env.NODE_DEBUG){var s=n.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+s+"$","i")}function c(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),d(n,e,n.depth)}function f(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function l(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return m(o)||(o=d(e,o,n)),o}var i=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(b(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,r);if(i)return i;var a=Object.keys(r),u=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(S(r)){var s=r.name?": "+r.name:"";return e.stylize("[Function"+s+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(C(r))return e.stylize(Date.prototype.toString.call(r),"date");if(x(r))return h(r)}var c,f="",l=!1,_=["{","}"];(y(r)&&(l=!0,_=["[","]"]),S(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return E(r)&&(f=" "+RegExp.prototype.toString.call(r)),C(r)&&(f=" "+Date.prototype.toUTCString.call(r)),x(r)&&(f=" "+h(r)),0!==a.length||l&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?function(e,t,r,n,o){for(var i=[],a=0,u=t.length;a<u;++a)k(t,String(a))?i.push(p(e,t,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))})),i}(e,r,n,u,a):a.map((function(t){return p(e,r,n,u,t,l)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var a,u,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(u=e.stylize("[Setter]","special")),k(n,o)||(a="["+o+"]"),u||(e.seen.indexOf(s.value)<0?(u=v(r)?d(e,s.value,null):d(e,s.value,r-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+u.split("\n").map((function(e){return" "+e})).join("\n")):u=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function y(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function v(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function w(e){return void 0===e}function E(e){return _(e)&&"[object RegExp]"===A(e)}function _(e){return"object"==typeof e&&null!==e}function C(e){return _(e)&&"[object Date]"===A(e)}function x(e){return _(e)&&("[object Error]"===A(e)||e instanceof Error)}function S(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(u.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(5955),t.isArray=y,t.isBoolean=b,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=E,t.types.isRegExp=E,t.isObject=_,t.isDate=C,t.types.isDate=C,t.isError=x,t.types.isNativeError=x,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),O[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(5717),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,o)}catch(a){r(a)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=P,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(B.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},6430:function(e,t,r){"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),u=r(1405)()&&"symbol"==typeof Symbol.toStringTag,s=o(),c=i("String.prototype.slice"),f={},l=r(882),d=Object.getPrototypeOf;u&&l&&d&&n(s,(function(e){if("function"==typeof r.g[e]){var t=new r.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=d(t),o=l(n,Symbol.toStringTag);if(!o){var i=d(n);o=l(i,Symbol.toStringTag)}f[e]=o.get}}));var h=r(5692);e.exports=function(e){return!!h(e)&&(u?function(e){var t=!1;return n(f,(function(r,n){if(!t)try{var o=r.call(e);o===n&&(t=o)}catch(i){}})),t}(e):c(a(e),8,-1))}},2956:function(e,t){"use strict";function r(){var e=[],t=!1;function r(){t&&(t=!1,e=e.slice())}return[function(t){r(),e.push(t);var n=!0;return function(){n&&(n=!1,r(),e.splice(e.indexOf(t),1))}},function(r){t=!0;for(var n=e,o=0;o<n.length;++o)n[o](r);t=!1}]}t.BU=r,t.j6=function(){var e={};return[function(t,n){var o=e[t];return null==o&&(o=e[t]=r()),o[0](n)},function(t,r){var n=e[t];null!=n&&n[1](r)}]}},6601:function(){},9214:function(){},2361:function(){},4616:function(){},3083:function(e,t,r){"use strict";var n=r(2190);e.exports=function(){return n(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],(function(e){return"function"==typeof r.g[e]}))}},882:function(e,t,r){"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(o){n=null}e.exports=n},8597:function(e){"use strict";e.exports={i8:"6.5.4"}},6523:function(e){"use strict";e.exports=JSON.parse('{"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation\'s data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation\'s data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"ommerReward":{"v":"625000000000000000","d":"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},"niblingReward":{"v":"156250000000000000","d":"the amount a miner gets for inculding a uncle"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}')},9610:function(e){"use strict";e.exports=JSON.parse('{"COMPRESSED_TYPE_INVALID":"compressed should be a boolean","EC_PRIVATE_KEY_TYPE_INVALID":"private key should be a Buffer","EC_PRIVATE_KEY_LENGTH_INVALID":"private key length is invalid","EC_PRIVATE_KEY_RANGE_INVALID":"private key range is invalid","EC_PRIVATE_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting private key is invalid","EC_PRIVATE_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PRIVATE_KEY_EXPORT_DER_FAIL":"couldn\'t export to DER format","EC_PRIVATE_KEY_IMPORT_DER_FAIL":"couldn\'t import from DER format","EC_PUBLIC_KEYS_TYPE_INVALID":"public keys should be an Array","EC_PUBLIC_KEYS_LENGTH_INVALID":"public keys Array should have at least 1 element","EC_PUBLIC_KEY_TYPE_INVALID":"public key should be a Buffer","EC_PUBLIC_KEY_LENGTH_INVALID":"public key length is invalid","EC_PUBLIC_KEY_PARSE_FAIL":"the public key could not be parsed or is invalid","EC_PUBLIC_KEY_CREATE_FAIL":"private was invalid, try again","EC_PUBLIC_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting public key is invalid","EC_PUBLIC_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PUBLIC_KEY_COMBINE_FAIL":"the sum of the public keys is not valid","ECDH_FAIL":"scalar was invalid (zero or overflow)","ECDSA_SIGNATURE_TYPE_INVALID":"signature should be a Buffer","ECDSA_SIGNATURE_LENGTH_INVALID":"signature length is invalid","ECDSA_SIGNATURE_PARSE_FAIL":"couldn\'t parse signature","ECDSA_SIGNATURE_PARSE_DER_FAIL":"couldn\'t parse DER signature","ECDSA_SIGNATURE_SERIALIZE_DER_FAIL":"couldn\'t serialize signature to DER format","ECDSA_SIGN_FAIL":"nonce generation function failed or private key is invalid","ECDSA_RECOVER_FAIL":"couldn\'t recover public key from signature","MSG32_TYPE_INVALID":"message should be a Buffer","MSG32_LENGTH_INVALID":"message length is invalid","OPTIONS_TYPE_INVALID":"options should be an Object","OPTIONS_DATA_TYPE_INVALID":"options.data should be a Buffer","OPTIONS_DATA_LENGTH_INVALID":"options.data length is invalid","OPTIONS_NONCEFN_TYPE_INVALID":"options.noncefn should be a Function","RECOVERY_ID_TYPE_INVALID":"recovery should be a Number","RECOVERY_ID_VALUE_INVALID":"recovery should have value between -1 and 4","TWEAK_TYPE_INVALID":"tweak should be a Buffer","TWEAK_LENGTH_INVALID":"tweak length is invalid"}')}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";var e=r(7757),t=r.n(e),n=r(8926),o=r.n(n),i=r(3038),a=r.n(i),u=(r(2383),r(3715)),s=r.n(u),c=r(2156),f=r.n(c),l=r(9911);const d=l.base16,h=l.base32,p=(l.base32hex,l.base64);l.base64url,l.codec;var y=r(7716);const b=y.hd,v=y.O7,g=y.h6,m=y.Fl;y.o3;function w(){return w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(this,arguments)}var E="_yaob",_=1,C={};function x(e,t){Object.prototype.hasOwnProperty.call(e,E)?w(e._yaob,t):Object.defineProperty(e,E,{value:t})}function S(e){var t=e.prototype;if(!Object.prototype.hasOwnProperty.call(t,E)){x(t,{})}return e}function A(e){Object.prototype.hasOwnProperty.call(e,E)&&null!=e._yaob.localId||x(e,{localId:_++,bridges:[],listeners:{},watchers:{}});return e}function I(e){if(null==e._yaob)throw new TypeError("Not a bridgeable object");return A(e),e._yaob}function O(e,t){null==t?t="":t+=".";for(var r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++){var o=n[r],i=t+o;if(null!=C[i])throw new Error("A shared value named "+i+" already exists");C[i]=e[o],x(e[o],{shareId:i})}}function T(e,t){try{var r=B(e,t),n=R(e,r,t);return""!==r?{map:r,raw:n}:{raw:n}}catch(t){return k(e,t)}}function k(e,t){var r=B(e,t);return{map:r,raw:R(e,r,t),throw:!0}}function P(e,t,r){var n=t.map,o=t.raw,i=null!=n?j(e,n,o,r):o;if(t.throw)throw i;return i}function B(e,t){switch(typeof t){case"boolean":case"number":case"string":return"";case"object":if(null===t)return"";if(t instanceof Date)return"d";if(t instanceof Error)return"e";if(t instanceof ArrayBuffer)return"ab";if(t instanceof Uint8Array)return"u8";if(null!=t._yaob)return null!=t._yaob.shareId?"s":"o";if(Array.isArray(t)){for(var r="",n=0;n<t.length;++n){var o=B(e,t[n]);if(""!==o&&""===r){r=[];for(var i=0;i<n;++i)r[i]=""}""!==r&&(r[n]=o)}return r}var a="";for(var u in t){var s=B(e,t[u]);""!==s&&(""===a&&(a={}),a[u]=s)}return a;case"undefined":return"u";case"function":return null!=t._yaob&&null!=t._yaob.shareId?"s":"?";default:return"?"}}function R(e,t,r){switch(t){case"":return r;case"?":return typeof r;case"d":return r.toISOString();case"e":return function(e,t){var r=w({message:t.message,stack:t.stack},t),n=null;return t instanceof EvalError?n="EvalError":t instanceof RangeError?n="RangeError":t instanceof ReferenceError?n="ReferenceError":t instanceof SyntaxError?n="SyntaxError":t instanceof TypeError?n="TypeError":t instanceof URIError&&(n="URIError"),w({base:n},T(e,r))}(e,r);case"o":return e.getPackedId(r);case"s":return r._yaob.shareId;case"u":return null;case"ab":return p.stringify(new Uint8Array(r));case"u8":return p.stringify(r);default:if(Array.isArray(t)){for(var n=[],o=0;o<t.length;++o)n[o]=R(e,t[o],r[o]);return n}var i={};for(var a in r)i[a]=a in t?R(e,t[a],r[a]):r[a];return i}}function j(e,t,r,n){switch(t){case"":return r;case"?":throw new TypeError("Unsupported value of type "+("string"==typeof r?r:"?")+" at "+n);case"d":return new Date(r);case"e":if("object"!=typeof r||null===r)throw new TypeError("Expecting an error description at "+n);return function(e,t,r){var n={EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError},o=new(null!=t.base&&n[t.base]||Error),i=P(e,t,r);for(var a in i)o[a]=i[a];return o}(e,r,n);case"o":if(null===r)throw new TypeError("Closed bridge object at "+n);if("number"!=typeof r)throw new TypeError("Expecting a packedId at "+n);var o=e.getObject(-r);if(null==o)throw new RangeError("Invalid packedId "+r+" at "+n);return o;case"s":if("string"!=typeof r)throw new TypeError("Expecting a shareId at "+n);var i=C[r];if(null==i)throw new RangeError("Invalid shareId '"+r+"' at "+n);return i;case"u":return;case"ab":if("string"!=typeof r)throw new TypeError("Expecting a base64 string at "+n);return p.parse(r).buffer;case"u8":if("string"!=typeof r)throw new TypeError("Expecting a base64 string at "+n);return p.parse(r);default:if("object"!=typeof t||null===t)throw new TypeError("Invalid type information "+t+" at "+n);if("object"!=typeof r||null===r)throw new TypeError("Expecting an array or object at "+n);if(Array.isArray(t)){if(!Array.isArray(r))throw new TypeError("Expecting an array at "+n);for(var a=[],u=0;u<t.length;++u)a[u]=j(e,t[u],r[u],n+"["+u+"]");return a}var s={};for(var c in r)s[c]=c in t?j(e,t[c],r[c],n+"."+c):r[c];return s}}var M={};function N(e,t,r){var n=I(e),o=n.closed,i=n.listeners;return o?function(){}:(null==i[t]?i[t]=[r]:i[t].push(r),function(){i[t]=i[t].filter((function(e){return e!==r}))})}function D(e){var t=I(e),r=t.listeners.close;if(null!=r)for(var n=0;n<r.length;n++){H(e,r[n],void 0,!0)}t.closed=!0;for(var o=0,i=t.bridges;o<i.length;o++){i[o].emitClose(t.localId)}t.bridges=[],t.listeners={},t.watchers={}}function L(e,t,r){var n=I(e);if(n.closed)throw new Error("Cannot emit event on closed object");for(var o=0,i=n.bridges;o<i.length;o++){i[o].emitEvent(n.localId,t,r)}var a=n.listeners[t];if(null!=a)for(var u=0;u<a.length;u++){H(e,a[u],r,"error"!==t)}}function U(e,t){var r=I(e);if(r.closed)throw new Error("Cannot update closed object");for(var n=0,o=r.bridges;n<o.length;n++){o[n].markDirty(r.localId,t)}for(var i in null!=t&&null!=r.watchers[t]&&(r.watchers[t].data=M),r.watchers){var a=r.watchers[i];try{var u=e[i];if(u!==a.data){a.data=u;for(var s=0,c=a.fs;s<c.length;s++){H(e,c[s],a.data,!0)}}}catch(f){}}}function H(e,t,r,n){try{var o=t(r);n&&null!=o&&"function"==typeof o.then&&o.then(void 0,(function(t){return L(e,"error",t)}))}catch(i){n&&L(e,"error",i)}}var K={};function F(e,t,r){var n=!1,o={};for(var i in r)try{var a=t[i];a!==r[i]&&(n=!0,o[i]=T(e,a),r[i]=a)}catch(u){o[i]=k(e,u),r[i]=K}return{dirty:n,props:o}}function G(e,t){var r,n={},o=(r=t.localId,{localId:_++,bridges:[],listeners:{},watchers:{},remoteId:r,errors:{},props:{}});for(var i in n._yaob={value:o},t.props)n[i]={enumerable:!0,get:z(o,i)};for(var a=0,u=t.methods;a<u.length;a++){var s=u[a];n[s]={value:W(e,o,s)}}return Object.create(Object.prototype,n)}function q(e,t,r){var n=t._yaob;for(var o in r)try{n.props[o]=P(e,r[o],o),n.errors[o]=!1}catch(i){n.props[o]=i,n.errors[o]=!0}}function z(e,t){return function(){if(e.errors[t])throw e.props[t];return e.props[t]}}function W(e,t,r){return function(){if(t.closed)return Promise.reject(new TypeError("Cannot call method '"+r+"' of closed proxy"));for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return e.emitCall(t.remoteId,r,o)}}var V=function(){function e(e){var t=e.sendMessage,r=e.throttleMs,n=void 0===r?0:r;this.proxies={},this.objects={},this.caches={},this.nextCallId=0,this.pendingCalls={},this.dirty={},this.message={},this.throttleMs=n,this.lastUpdate=0,this.sendPending=!1,this.sendMessage=t}var t=e.prototype;return t.close=function(e){for(var t in this.pendingCalls){this.pendingCalls[Number(t)].reject(e)}for(var r in this.proxies)D(this.proxies[Number(r)]);this.closed=!0},t.getObject=function(e){return e<0?this.proxies[-e]:this.objects[e]},t.getPackedId=function(e){var t=I(e);if(t.closed)return null;if(null!=t.remoteId&&null!=this.proxies[t.remoteId])return-t.remoteId;if(null==this.objects[t.localId]){this.objects[t.localId]=e;var r=function(e,t){for(var r={},n=Object.prototype,o=t;o!==n&&null!=o;o=Object.getPrototypeOf(o))for(var i=0,a=Object.getOwnPropertyNames(o);i<a.length;i++){var u=a[i];u===E||/^_/.test(u)||"constructor"===u||(r[u]=!0)}var s={},c=[],f={};for(var l in r)try{var d=t[l];"function"!=typeof d||null!=d._yaob&&null!=d._yaob.shareId?(s[l]=d,f[l]=T(e,d)):c.push(l)}catch(h){s[l]=K,f[l]=k(e,h)}return{cache:s,create:{localId:I(t).localId,methods:c,props:f}}}(this,e),n=r.cache,o=r.create;this.caches[t.localId]=n,t.bridges.push(this),this.emitCreate(o,e)}return t.localId},t.markDirty=function(e,t){var r=this.caches[e];null!=t&&t in r&&(r[t]=K),this.dirty[e]={cache:r,object:this.objects[e]},this.wakeup()},t.emitClose=function(e){delete this.objects[e],delete this.caches[e],null==this.message.closed&&(this.message.closed=[]),this.message.closed.push(e),this.wakeup()},t.emitCreate=function(e,t){null==this.message.created&&(this.message.created=[]),this.message.created.push(e)},t.emitCall=function(e,t,r){var n=this,o=this.nextCallId++,i=w({callId:o,remoteId:e,name:t},T(this,r));return null==this.message.calls&&(this.message.calls=[]),this.message.calls.push(i),this.wakeup(),new Promise((function(e,r){n.pendingCalls[o]={name:t,resolve:e,reject:r}}))},t.emitEvent=function(e,t,r){var n=w({localId:e,name:t},T(this,r));null==this.message.events&&(this.message.events=[]),this.message.events.push(n),this.wakeup()},t.emitReturn=function(e,t,r){var n=w({callId:e},t?k(this,r):T(this,r));null==this.message.returns&&(this.message.returns=[]),this.message.returns.push(n),this.wakeup()},t.handleMessage=function(e){var t=this;if(e.created){for(var r=0,n=e.created;r<n.length;r++){var o=n[r];this.proxies[o.localId]=G(this,o)}for(var i=0,a=e.created;i<a.length;i++){var u=a[i];q(this,this.proxies[u.localId],u.props)}}if(e.changed){for(var s=0,c=e.changed;s<c.length;s++){var f=c[s],l=f.localId,d=f.props,h=this.proxies[l];if(null==h)throw new RangeError("Invalid localId "+l);q(this,h,d)}for(var p=0,y=e.changed;p<y.length;p++){var b=y[p];U(this.proxies[b.localId])}}if(e.events)for(var v=0,g=e.events;v<g.length;v++){var m=g[v],w=m.localId,E=m.name,_=0===w?this:this.proxies[w];if(null!=_)try{L(_,E,P(this,m,E))}catch(N){L(_,"error",N)}}if(e.calls)for(var C=function(e,r){var n=r[e],o=n.callId,i=n.remoteId,a=n.name;try{var u=t.objects[i];if(null==u)throw new TypeError("Cannot call method '"+a+"' of closed proxy (remote)");if("function"!=typeof u[a])throw new TypeError("'"+a+"' is not a function");var s=P(t,n,a+".arguments");Promise.resolve(u[a].apply(u,s)).then((function(e){return t.emitReturn(o,!1,e)}),(function(e){return t.emitReturn(o,!0,e)}))}catch(N){t.emitReturn(o,!0,N)}},x=0,S=e.calls;x<S.length;x++)C(x,S);if(e.returns)for(var A=0,I=e.returns;A<I.length;A++){var O=I[A],T=O.callId,k=this.pendingCalls[T];if(null==k)throw new RangeError("Invalid callId "+T);try{k.resolve(P(this,O,k.name+".return"))}catch(N){k.reject(N)}finally{delete this.pendingCalls[T]}}if(e.closed)for(var B=0,R=e.closed;B<R.length;B++){var j=R[B],M=this.proxies[j];if(null==M)return;delete this.proxies[j],D(M)}},t.sendNow=function(){if(!this.closed){for(var e in this.dirty){var t=Number(e),r=this.dirty[t],n=F(this,r.object,r.cache),o=n.dirty,i=n.props;if(o){var a={localId:t,props:i};null==this.message.changed&&(this.message.changed=[]),this.message.changed.push(a)}}var u=this.message;this.dirty={},this.message={},this.sendMessage(u)}},t.wakeup=function(){var e=this;if(!this.sendPending){this.sendPending=!0;var t=this.lastUpdate+this.throttleMs-Date.now();setTimeout((function(){e.sendPending=!1,e.lastUpdate=Date.now(),e.sendNow()}),t<0?0:t)}},e}();S(V);var Y=function(){function e(e){var t=this;this._state=new V(e),this._rootPromise=new Promise((function(e){return N(t._state,"root",e)}))}var t=e.prototype;return t.handleMessage=function(e){this._state.handleMessage(e)},t.getRoot=function(){return this._rootPromise},t.sendRoot=function(e){this._state.emitEvent(0,"root",e)},t.close=function(e){this._state.close(e)},e}();var J=function(e,t){return N(this,e,t)},Z=function(e,t){return function(e,t,r){var n=I(e),o=n.closed,i=n.watchers,a=e[t];return o?function(){}:(null==i[t]?i[t]={data:a,fs:[r]}:i[t].fs.push(r),function(){i[t].fs=i[t].fs.filter((function(e){return e!==r}))})}(this,e,t)};O({onMethod:J,watchMethod:Z});var X=function(){function e(){}var t=e.prototype;return t._close=function(){D(this)},t._emit=function(e,t){return L(this,e,t)},t._update=function(e){U(this,e)},e}(),$=X.prototype;$.on=J,$.watch=Z,S(X);var Q=r(4638);r(7635);var ee=r(9713),te=r.n(ee),re=r(7630);const ne=re.asArray,oe=re.asBoolean,ie=re.asCodec,ae=re.asDate,ue=re.asEither,se=(re.asJSON,re.asMap),ce=re.asMaybe,fe=(re.asNone,re.asNull),le=re.asNumber,de=re.asObject,he=re.asOptional,pe=re.asString,ye=(re.asUndefined,re.asUnknown),be=re.asValue,ve=re.uncleaner;var ge=r(4575),me=r.n(ge),we=r(3913),Ee=r.n(we),_e=function(){function e(){me()(this,e)}return Ee()(e,[{key:"getFirstWalletInfo",value:function(e){return this.allKeys.find((function(t){return t.type===e}))}},{key:"getWalletInfo",value:function(e){return this.allKeys.find((function(t){return t.id===e}))}},{key:"listWalletIds",value:function(){return this.allKeys.map((function(e){return e.id}))}}]),e}();function Ce(e){var t=e.length<10,r=!/[0-9]/.test(e),n=!/[a-z]/.test(e),o=!/[A-Z]/.test(e),i=(/[0-9]/.test(e)?10:0)+(/[A-Z]/.test(e)?26:0)+(/[a-z]/.test(e)?26:0)+(/[^0-9A-Za-z]/.test(e)?30:0);return{secondsToCrack:Math.pow(i,e.length)/1e6,tooShort:t,noNumber:r,noLowerCase:n,noUpperCase:o,passed:e.length>=16||!(t||r||o||n)}}function xe(e){for(var t=e.toLowerCase().replace(/[ \f\r\n\t\v]+/g," ").replace(/ $/,"").replace(/^ /,""),r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<32||n>126)throw new Error("Bad characters in username")}return t}O(_e.prototype,"AccountSync"),O({checkPasswordRules:Ce}),O({fixUsername:xe});var Se=ie((function(e){return d.parse(pe(e))}),(function(e){return d.stringify(e).toLowerCase()})),Ae=ie((function(e){return h.parse(pe(e),{loose:!0})}),(function(e){return h.stringify(e,{pad:!1})})),Ie=ie((function(e){return p.parse(pe(e))}),(function(e){return p.stringify(e)})),Oe=de({voucherId:pe,activates:ae,created:ae,ip:pe,ipDescription:pe,deviceDescription:he(pe)}),Te=de({min_length:le,category:be("address","must","numeric","recovery2","string"),question:pe}),ke=de({encryptionType:le,data_base64:pe,iv_hex:pe}),Pe=de({salt_hex:Se,n:le,r:le,p:le}),Be=de({loginRequest:he(de({appId:pe}).withRest),publicKey:Ie,timeout:he(le)}).withRest,Re=de({publicKey:Ie,box:ke}),je=ne(Ie),Me=de({data:ye,deviceDescription:he(pe),otp:he(pe),voucherId:he(pe),voucherAuth:he(Ie),loginId:he(Ie),loginAuth:he(Ie),userId:he(Ie),passwordAuth:he(Ie),pin2Id:he(Ie),pin2Auth:he(Ie),recovery2Id:he(Ie),recovery2Auth:he(je),loginIds:he(ne(Ie)),otpResetAuth:he(pe),did:he(pe),l1:he(Ie),lp1:he(Ie),lpin1:he(Ie),lra1:he(Ie),recoveryAuth:he(Ie)}),Ne=de({results:he(ye),status_code:le,message:pe}),De=de({otpTimeout:he(le,604800),otpKey:Ae}),Le=de({passwordAuth:Ie,passwordAuthBox:ke,passwordAuthSnrp:Pe,passwordBox:ke,passwordKeySnrp:Pe}),Ue=de({pin2Id:he(Ie),pin2Auth:he(Ie),pin2Box:he(ke),pin2KeyBox:he(ke),pin2TextBox:ke}),He=de({recovery2Id:Ie,recovery2Auth:je,recovery2Box:ke,recovery2KeyBox:ke,question2Box:ke}),Ke=de({loginAuthBox:ke,loginAuth:Ie}),Fe=de({approvedVouchers:he(ne(pe)),rejectedVouchers:he(ne(pe))}),Ge=de({keyBoxes:ne(ke),newSyncKeys:he(ne(pe),[])}),qe=de({appId:pe,loginId:Ie,parentBox:he(ke)}).withRest,ze=de({request:Be,replies:ne(Re)}),We=de({appId:pe,created:ae,loginId:Ie,userId:he(Ie),children:he(ne((function(e){return We(e)}))),parentBox:he(ke),otpKey:he(Ae),otpResetDate:he(ae),otpTimeout:he(le),passwordAuthBox:he(ke),passwordAuthSnrp:he(Pe),passwordBox:he(ke),passwordKeySnrp:he(Pe),pin2Box:he(ke),pin2KeyBox:he(ke),pin2TextBox:he(ke),question2Box:he(ke),recovery2Box:he(ke),recovery2KeyBox:he(ke),loginAuthBox:he(ke),pendingVouchers:he(ne(Oe),[]),keyBoxes:he(ne(ke)),mnemonicBox:he(ke),rootKeyBox:he(ke),syncKeyBox:he(ke)}),Ve=ne(de({loginId:Ie,otpResetPending:he(oe,!1),pendingVouchers:he(ne(Oe),[]),recovery2Corrupt:he(oe,!1)})),Ye=de({login_id:he(Ie),otp_reset_auth:he(pe),otp_timeout_date:he(ae),reason:he(pe),voucher_activates:he(ae),voucher_auth:he(Ie),voucher_id:he(pe)}),Je=de({otpResetDate:ae}),Ze=de({wait_seconds:he(le)}),Xe=ne(Te),$e=de({question2Box:ke}),Qe=de({passwordAuthSnrp:he(Pe),questionBox:he(ke),questionKeySnrp:he(Pe),recoveryAuthSnrp:he(Pe)}),et=de({loginId:Ie,voucherAuth:Ie,voucherId:pe,created:ae,activates:ae,status:be("pending","approved","rejected"),ip:pe,ipDescription:pe,deviceDescription:he(pe)}),tt=de({appId:pe,created:function(e){return null==e?new Date:ae(e)},loginId:Ie,children:he(ne((function(e){return tt(e)})),[]),parentBox:he(ke),parentId:function(){},otpKey:he(Ae),otpResetAuth:he(pe),otpResetDate:he(ae),otpTimeout:he(le),passwordAuth:he(Ie),passwordAuthBox:he(ke),passwordAuthSnrp:he(Pe),passwordBox:he(ke),passwordKeySnrp:he(Pe),pin2Id:he(Ie),pin2Auth:he(Ie),pin2Box:he(ke),pin2KeyBox:he(ke),pin2TextBox:he(ke),recovery2Id:he(Ie),recovery2Auth:he(je),question2Box:he(ke),recovery2Box:he(ke),recovery2KeyBox:he(ke),loginAuth:he(Ie),loginAuthBox:he(ke),keyBoxes:he(ne(ke),[]),mnemonicBox:he(ke),rootKeyBox:he(ke),syncKeyBox:he(ke),vouchers:he(ne(et),[]),pinBox:he(ke),pinId:he(pe),pinKeyBox:he(ke)}),rt=de({lastLogin:he((function(e){if(e instanceof Date)return e;throw new TypeError("Expecting a Date")})),loginId:Ie,loginKey:Ie,repos:de(de(ke)),server:tt,username:pe}),nt=ne(rt);var ot=r(9176),it=r.n(ot)()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),at=function(e){return it.decode(e)},ut=function(e){return it.encode(e)},st=function(e){for(var t=encodeURI(e),r=new Uint8Array(t.length),n=0,o=0;o<t.length;++o){var i=t.charCodeAt(o);37===i?(r[n++]=parseInt(t.slice(o+1,o+3),16),o+=2):r[n++]=i}return r.subarray(0,n)},ct=function(e){for(var t="",r=0;r<e.length;++r){var n=e[r];t+="%"+(n>>4).toString(16)+(15&n).toString(16)}return decodeURIComponent(t)},ft=r(319),lt=r.n(ft);function dt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Cannot reach the network";if(!(this instanceof dt))throw new TypeError("Class constructor NetworkError cannot be invoked without 'new'");function r(t){return e=new Error(t),Object.defineProperty(e,"constructor",{value:dt,configurable:!0,writable:!0}),e}return r(t),e.name="NetworkError",e}function ht(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"The application is too old. Please upgrade.";if(!(this instanceof ht))throw new TypeError("Class constructor ObsoleteApiError cannot be invoked without 'new'");function r(t){return e=new Error(t),Object.defineProperty(e,"constructor",{value:ht,configurable:!0,writable:!0}),e}return r(t),e.name="ObsoleteApiError",e}function pt(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Invalid OTP token";if(!(this instanceof pt))throw new TypeError("Class constructor OtpError cannot be invoked without 'new'");function n(e){return t=new Error(e),Object.defineProperty(t,"constructor",{value:pt,configurable:!0,writable:!0}),t}n(r),t.name="OtpError",t.reason="otp";try{var o=Ye(e);null!=o.login_id&&(t.loginId=p.stringify(o.login_id)),null!=o.otp_reset_auth&&(t.resetToken=o.otp_reset_auth),"ip"===o.reason&&(t.reason="ip"),null!=o.otp_timeout_date&&(t.resetDate=new Date(o.otp_timeout_date)),null!=o.voucher_activates&&(t.voucherActivates=o.voucher_activates),null!=o.voucher_auth&&(t.voucherAuth=p.stringify(o.voucher_auth)),null!=o.voucher_id&&(t.voucherId=o.voucher_id)}catch(i){}return t}function yt(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Invalid password";if(!(this instanceof yt))throw new TypeError("Class constructor PasswordError cannot be invoked without 'new'");function n(e){return t=new Error(e),Object.defineProperty(t,"constructor",{value:yt,configurable:!0,writable:!0}),t}n(r),t.name="PasswordError";try{var o=Ze(e);t.wait=o.wait_seconds}catch(i){}return t}function bt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Invalid username";if(!(this instanceof bt))throw new TypeError("Class constructor UsernameError cannot be invoked without 'new'");function r(t){return e=new Error(t),Object.defineProperty(e,"constructor",{value:bt,configurable:!0,writable:!0}),e}return r(t),e.name="UsernameError",e}function vt(e){return function(t){if(t instanceof Error&&t.name===e)return t}}vt("DustSpendError");var gt=vt("InsufficientFundsError"),mt=(vt("NetworkError"),vt("NoAmountSpecifiedError"),vt("ObsoleteApiError"),vt("OtpError")),wt=(vt("PasswordError"),vt("PendingFundsError")),Et=(vt("SameCurrencyError"),vt("SpendToSelfError"),vt("SwapAboveLimitError")),_t=vt("SwapBelowLimitError"),Ct=vt("SwapCurrencyError"),xt=vt("SwapPermissionError"),St=vt("UsernameError"),At=r(8826);function It(e,t){var r=s().hmac(s().sha256,t);return Uint8Array.from(r.update(e).digest())}function Ot(e){var t=s().sha256();return Uint8Array.from(t.update(e).digest())}function Tt(e,t){var r=e.length;if(r!==t.length)return!1;for(var n=0,o=0;o<r;++o)n|=e[o]^t[o];return 0===n}var kt=r.n(At)().ModeOfOperation.cbc;function Pt(e,t){var r=Bt(e,t);return 0===r[r.length-1]?ct(r.subarray(0,-1)):ct(r)}function Bt(e,t){if(0!==e.encryptionType)throw new Error("Unknown encryption type");var r=d.parse(e.iv_hex),n=p.parse(e.data_base64),o=new kt(t,r).decrypt(n),i=1+o[0]+4,a=o[i-4]<<24|o[i-3]<<16|o[i-2]<<8|o[i-1],u=i+a+1,s=u+o[u-1],c=s+32;if(!Tt(Ot(o.subarray(0,s)),o.subarray(s,c)))throw new Error("Invalid checksum");if(!Tt(jt(c),o.subarray(c)))throw new Error("Invalid PKCS7 padding");return o.subarray(i,i+a)}function Rt(e,t,r){var n=31&e.random(1)[0],o=1+n+4,i=t.length,a=o+i+1,u=31&e.random(1)[0],s=a+u,c=s+32,f=jt(c),l=new Uint8Array(c+f.length);l.set(f,c),l[0]=n,l.set(e.random(n),1),l[o-4]=i>>24&255,l[o-3]=i>>16&255,l[o-2]=i>>8&255,l[o-1]=255&i,l.set(t,o),l[a-1]=u,l.set(e.random(u),a),l.set(Ot(l.subarray(0,s)),s);var h=e.random(16),y=new kt(r,h).encrypt(l);return{encryptionType:0,iv_hex:d.stringify(h),data_base64:p.stringify(y)}}function jt(e){for(var t=new Uint8Array(16-(15&e)),r=0;r<t.length;++r)t[r]=t.length;return t}var Mt=r(8),Nt=r.n(Mt);function Dt(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r.filter((function(e){return null!=e}));return(e=[]).concat.apply(e,lt()(o))}function Lt(){for(var e={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var o=0;o<r.length;o++){var i=r[o];if(null!=i)for(var a=0,u=Object.keys(i);a<u.length;a++){var s=u[a];null!=i[s]&&(e[s]=null!=e[s]&&"object"===Nt()(i[s])?Lt(e[s],i[s]):i[s])}}return e}function Ut(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];Object.defineProperty(e,o,{writable:!0,configurable:!0,value:t[o]})}return e}function Ht(e){var r=ve(e);return{load:function(r,n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=e,t.t1=JSON,t.next=5,r.getText(n);case 5:return t.t2=t.sent,t.t3=t.t1.parse.call(t.t1,t.t2),t.abrupt("return",(0,t.t0)(t.t3));case 10:t.prev=10,t.t4=t.catch(0);case 12:case"end":return t.stop()}}),o,null,[[0,10]])})))()},save:function(e,n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.setText(n,JSON.stringify(r(i)));case 2:case"end":return t.stop()}}),o)})))()}}}var Kt=function(e){if(null==e||"object"!==Nt()(e))throw new TypeError("Expected a JSON object");return e};function Ft(e,t,r){var n={delete:function(e){return r.delete(e)},getData:function(e){return r.getText(e).then((function(e){return ke(JSON.parse(e))})).then((function(e){return Bt(e,t)}))},getText:function(e){return r.getText(e).then((function(e){return ke(JSON.parse(e))})).then((function(e){return Pt(e,t)}))},list:function(e){return r.list(e)},setData:function(n,o){var i=o;return r.setText(n,JSON.stringify(Rt(e,Uint8Array.from(i),t)))},setText:function(e,t){return this.setData(e,st(t))}};return A(n),n}function Gt(e,t){return e.storageWallets[t].paths.disklet}function qt(e,t){return e.storageWallets[t].localDisklet}function zt(e,t,r){return Ft(r,e.storageWallets[t].paths.dataKey,e.storageWallets[t].localDisklet)}function Wt(e,t,r){var n=e.storageWallets[t].paths.dataKey;return ut(It(st(r),n))}var Vt=de({multiplier:pe,name:pe,symbol:he(pe)}),Yt=de({currencyCode:pe,denominations:ne(Vt),displayName:pe,networkLocation:he(Kt)}),Jt=de({enabled:he(oe,!0)}).withRest,Zt=de({SortIndex:he(le,0),Archived:he(oe,!1),BitcoinSeed:Se,MK:Se,SyncKey:Se}).withRest,Xt=de({id:pe,archived:he(oe),deleted:he(oe),hidden:he(oe),sortIndex:he(le)}),$t=de({userSettings:he(se(Kt),{}),swapSettings:he(se(Jt),{})}).withRest,Qt=de({customTokens:ne(de({contractAddress:pe,currencyCode:pe,currencyName:pe,denomination:pe,denominations:ne(Vt),isVisible:he(oe,!0),multiplier:pe,walletType:he(pe,"wallet:ethereum")}))}),er=de({customTokens:de(de(Yt))});function tr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var nr=Ht(Zt),or=Ht(Xt),ir=Ht($t),ar="PluginSettings.json";function ur(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];if(e[o]!==t[o])return!0}return!1}function sr(e){return cr.apply(this,arguments)}function cr(){return cr=o()(t().mark((function e(r){var n,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],i={},e.t0=Q.gQ,e.next=5,r.list("Wallets");case 5:return e.t1=e.sent,a=(0,e.t0)(e.t1),e.next=9,Promise.all(a.map(function(){var e=o()(t().mark((function e(o){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nr.load(r,o);case 2:if(null!=(a=e.sent)){e.next=5;break}return e.abrupt("return");case 5:u={bitcoinKey:p.stringify(a.BitcoinSeed),dataKey:p.stringify(a.MK),format:"bip32",syncKey:p.stringify(a.SyncKey)},s=Rr("wallet:bitcoin",u,a.MK),n.push(s),i[s.id]={sortIndex:a.SortIndex,archived:a.Archived,deleted:!1,hidden:!1};case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:return e.abrupt("return",{walletInfos:n,walletStates:i});case 10:case"end":return e.stop()}}),e)}))),cr.apply(this,arguments)}function fr(e){return lr.apply(this,arguments)}function lr(){return lr=o()(t().mark((function e(r){var n,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},e.t0=Q.gQ,e.next=4,r.list("Keys");case 4:return e.t1=e.sent,i=(0,e.t0)(e.t1),e.next=8,Promise.all(i.map(function(){var e=o()(t().mark((function e(o){var i,a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,or.load(r,o);case 2:if(null!=(i=e.sent)){e.next=5;break}return e.abrupt("return");case 5:a=i.id,u=i.archived,s=i.deleted,c=i.hidden,f=i.sortIndex,n[a]={archived:u,deleted:s,hidden:c,sortIndex:f};case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),lr.apply(this,arguments)}function dr(e,t){return hr.apply(this,arguments)}function hr(){return(hr=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.state.accounts[n],a=i.accountWalletInfo,u=i.accountWalletInfos,e.next=4,Promise.all(u.map((function(e){return sr(Gt(r.props.state,e.id))})));case 4:return s=e.sent,e.next=7,fr(Gt(r.props.state,a.id));case 7:c=e.sent,f=(o=[]).concat.apply(o,lt()(s.map((function(e){return e.walletInfos})))),l=s.map((function(e){return e.walletStates})),d=Object.assign.apply(Object,[{}].concat(lt()(l),[c])),r.props.dispatch({type:"ACCOUNT_KEYS_LOADED",payload:{accountId:n,legacyWalletInfos:f,walletStates:d}});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pr(e,t,r){return yr.apply(this,arguments)}function yr(){return yr=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=r.props.state.accounts[n],u=a.accountWalletInfo,s=a.walletStates,c=Gt(r.props.state,u.id),f={},l=0,d=Object.keys(i);l<d.length;l++)h=d[l],null==s[h]?f[h]=i[h]:ur(s[h],i[h])&&(f[h]=rr(rr({},s[h]),i[h]));if((p=Object.keys(f)).length){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,Promise.all(p.map(function(){var e=o()(t().mark((function e(n){var o,i,a,s,l,d;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=f[n],i=o.archived,a=o.deleted,s=o.hidden,l=o.sortIndex,d=Wt(r.props.state,u.id,n),e.next=4,or.save(c,"Keys/".concat(d,".json"),{archived:i,deleted:a,hidden:s,id:n,sortIndex:l});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:r.props.dispatch({type:"ACCOUNT_CHANGED_WALLET_STATES",payload:{accountId:n,walletStates:rr(rr({},s),f)}});case 10:case"end":return e.stop()}}),e)}))),yr.apply(this,arguments)}function br(e,t,r,n){return vr.apply(this,arguments)}function vr(){return(vr=o()(t().mark((function e(r,n,o,i){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n].accountWalletInfo,u=Gt(r.props.state,a.id),e.next=4,ir.load(u,ar);case 4:return s=e.sent,e.next=7,ir.save(u,ar,rr(rr({},s),{},{userSettings:rr(rr({},r.props.state.accounts[n].userSettings),{},te()({},o,i))}));case 7:r.props.dispatch({type:"ACCOUNT_PLUGIN_SETTINGS_CHANGED",payload:{accountId:n,pluginId:o,userSettings:rr({},i)}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gr(e,t,r,n){return mr.apply(this,arguments)}function mr(){return(mr=o()(t().mark((function e(r,n,o,i){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n].accountWalletInfo,u=Gt(r.props.state,a.id),e.next=4,ir.load(u,ar);case 4:return s=e.sent,e.next=7,ir.save(u,ar,rr(rr({},s),{},{swapSettings:rr(rr({},r.props.state.accounts[n].swapSettings),{},te()({},o,i))}));case 7:r.props.dispatch({type:"ACCOUNT_SWAP_SETTINGS_CHANGED",payload:{accountId:n,pluginId:o,swapSettings:i}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wr(e,t){return Er.apply(this,arguments)}function Er(){return(Er=o()(t().mark((function e(r,n){var o,i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].accountWalletInfo,i=Gt(r.props.state,o.id),e.next=4,ir.load(i,ar);case 4:a=e.sent,s=(u=null!=a?a:{userSettings:{},swapSettings:{}}).userSettings,c=u.swapSettings,r.props.dispatch({type:"ACCOUNT_PLUGIN_SETTINGS_LOADED",payload:{accountId:n,userSettings:s,swapSettings:c}});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _r(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=Object.keys(e),o=0;o<n.length;o++)for(var i=n[o],a=e[i].currencyInfo,u=0,s=a.denominations;u<s.length;u++){var c=s[u];if(c.name===r)return c.multiplier}for(var f=0;f<n.length;f++)for(var l=n[f],d=e[l].currencyInfo,h=0,p=d.metaTokens;h<p.length;h++)for(var y=p[h],b=0,v=y.denominations;b<v.length;b++){var g=v[b];if(g.name===r)return g.multiplier}for(var m=0,w=Object.keys(t);m<w.length;m++)for(var E=w[m],_=t[E],C=0,x=_.denominations;C<x.length;C++){var S=x[C];if(S.name===r)return S.multiplier}return"1"}function Cr(e,t){return e.waitFor((function(e){if(null==e.state.currency.wallets[t])throw new Error("Wallet id ".concat(t," does not exist in this account"));var r=e.state.currency.wallets[t].engineFailure;if(null!=r)throw r;if(null!=e.output.currency.wallets[t])return e.output.currency.wallets[t].walletApi}))}function xr(e,t){var r=Sr(e,t);if(null==r)throw new Error("Cannot find a currency plugin for wallet type ".concat(t));return r}function Sr(e,t){return Object.keys(e).find((function(r){return e[r].currencyInfo.walletType===t}))}function Ar(e,t){var r=e.props,n=r.dispatch,o=r.state,i=o.plugins.currencyTools[t];if(null!=i)return i;var a=o.plugins.currency[t].makeCurrencyTools();return n({type:"CURRENCY_TOOLS_LOADED",payload:{pluginId:t,tools:a}}),a}function Ir(e){return Or.apply(this,arguments)}function Or(){return Or=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.waitFor((function(e){var t=e.state.plugins,r=t.init;if(t.locked){var n=e.state.plugins,o=n.currency,i=n.rate,a=n.swap,u=[];for(var s in r)r[s]&&null==o[s]&&null==i[s]&&null==a[s]&&u.push(s);if(u.length>0)throw new Error("The following plugins are missing or failed to load: "+u.join(", "));return!0}}));case 2:case"end":return e.stop()}}),e)}))),Or.apply(this,arguments)}function Tr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tr(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pr(e,t){return e.find((function(e){return e.type===t}))}function Br(e){return""===e?"account-repo:co.airbitz.wallet":"account-repo:".concat(e)}function Rr(e,t,r){return{id:p.stringify(It(st(e),r)),type:e,keys:t}}function jr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.props.io;if(null==r.dataKey&&(r.dataKey=p.stringify(n.random(32))),null==r.syncKey&&(r.syncKey=p.stringify(n.random(20))),"string"!=typeof r.dataKey)throw new TypeError("Invalid dataKey type");return Rr(t,r,p.parse(r.dataKey))}function Mr(e,t){for(var r=e.props.io,n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];for(var a=o.map((function(e){return Rt(r,st(JSON.stringify(e)),t.loginKey)})),u=[],s=0;s<o.length;s++){var c=o[s];if(null!=c.keys.syncKey){var f=p.parse(c.keys.syncKey);u.push(d.stringify(f).toLowerCase())}}return{serverPath:"/v2/login/keys",server:{keyBoxes:a,newSyncKeys:u},stash:{keyBoxes:a},login:{keyInfos:o},loginId:t.loginId}}function Nr(e){for(var t=[],r={},n=0;n<e.length;n++){var o=e[n],i=o.id,a=o.type,u=o.keys;if(null==i||32!==p.parse(i).length)throw new Error("Key integrity violation: invalid id ".concat(i));if(null!=r[i]){var s=t[r[i]];if(s.type!==a)throw new Error("Key integrity violation for ".concat(i,": type ").concat(a," does not match ").concat(s.type));for(var c=0,f=Object.keys(u);c<f.length;c++){var l=f[c];if(null!=s.keys[l]&&s.keys[l]!==u[l])throw new Error("Key integrity violation for ".concat(i,": ").concat(l," keys do not match"))}t[r[i]]={id:i,type:a,keys:kr(kr({},s.keys),u)}}else r[i]=t.length,t.push(o)}return t}function Dr(e){var t=e.id,r=e.keys,n=e.type,o={"wallet:bitcoin-bip44":{format:"bip44",coinType:0},"wallet:bitcoin-bip49":{format:"bip49",coinType:0},"wallet:bitcoincash-bip32":{format:"bip32"},"wallet:bitcoincash-bip44":{format:"bip44",coinType:145},"wallet:bitcoincash-bip44-testnet":{format:"bip44",coinType:1},"wallet:bitcoin-bip44-testnet":{format:"bip44",coinType:1},"wallet:bitcoin-bip49-testnet":{format:"bip49",coinType:1},"wallet:dash-bip44":{format:"bip44",coinType:5},"wallet:dogecoin-bip44":{format:"bip44",coinType:3},"wallet:litecoin-bip44":{format:"bip44",coinType:2},"wallet:litecoin-bip49":{format:"bip49",coinType:2},"wallet:feathercoin-bip49":{format:"bip49",coinType:8},"wallet:feathercoin-bip44":{format:"bip44",coinType:8},"wallet:qtum-bip44":{format:"bip44",coinType:2301},"wallet:ufo-bip49":{format:"bip49",coinType:202},"wallet:ufo-bip84":{format:"bip84",coinType:202},"wallet:zcoin-bip44":{format:"bip44",coinType:136},"wallet:bitcoin-testnet":{format:"bip32"},"wallet:bitcoin":{format:"bip32"},"wallet:bitcoincash-testnet":{format:"bip32"},"wallet:litecoin":{format:"bip32",coinType:2},"wallet:zcoin":{format:"bip32",coinType:136}};return null!=o[n]?{id:t,keys:kr(kr({},o[n]),r),type:n.replace(/-bip[0-9]+/,"")}:e}function Lr(e,t){if(e.length!==t.length)throw new Error("Array lengths do not match: ".concat(e.length,", ").concat(t.length));for(var r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e[n]^t[n];return r}function Ur(e,t){var r=e.id,n=e.type,o=e.keys;if(null==o.dataKey||null==o.syncKey)throw new Error("Wallet ".concat(r," is not a splittable type"));for(var i=p.parse(o.dataKey),a=p.parse(o.syncKey),u=Lr(It(st(n),i),It(st(t),i)),s=Lr(p.parse(r),u),c=Lr(a,u.subarray(0,a.length)),f=n.replace(/wallet:/,"").replace("-",""),l=t.replace(/wallet:/,"").replace("-",""),d={},h=0,y=Object.keys(o);h<y.length;h++){var b=y[h];b===f+"Key"?d[l+"Key"]=o[b]:d[b]=o[b]}return{id:p.stringify(s),keys:kr(kr({},d),{},{syncKey:p.stringify(c)}),type:t}}function Hr(e,t,r,n){return Kr.apply(this,arguments)}function Kr(){return Kr=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n],u=a.login,s=a.loginTree,c=xr(r.props.state.plugins.currency,o),e.next=4,Ar(r,c);case 4:if(f=e.sent,null==i.keys){e.next=9;break}l=i.keys,e.next=34;break;case 9:if(null==i.importText){e.next=24;break}if(null!=f.importPrivateKey){e.next=12;break}throw new Error("This wallet does not support importing keys");case 12:return e.t0=kr,e.t1=kr,e.t2={},e.next=17,f.importPrivateKey(i.importText,i.keyOptions);case 17:e.t3=e.sent,e.t4=(0,e.t1)(e.t2,e.t3),e.t5={},e.t6={imported:!0},l=(0,e.t0)(e.t4,e.t5,e.t6),e.next=34;break;case 24:return e.t7=kr,e.t8=kr,e.t9={},e.next=29,f.createPrivateKey(o,i.keyOptions);case 29:e.t10=e.sent,e.t11=(0,e.t8)(e.t9,e.t10),e.t12={},e.t13={imported:!1},l=(0,e.t7)(e.t11,e.t12,e.t13);case 34:return d=jr(r,o,l),h=Mr(r,u,Dr(d)),e.next=38,Kn(r,s,h);case 38:return e.next=40,Cr(r,d.id);case 40:if(p=e.sent,null==i.name){e.next=44;break}return e.next=44,p.renameWallet(i.name);case 44:if(null==i.fiatCurrencyCode){e.next=47;break}return e.next=47,p.setFiatCurrencyCode(i.fiatCurrencyCode);case 47:return e.abrupt("return",p);case 48:case"end":return e.stop()}}),e)}))),Kr.apply(this,arguments)}function Fr(e){return Gr.apply(this,arguments)}function Gr(){return(Gr=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={currencyCode:"BCH",spendTargets:[{nativeAmount:"1000",otherParams:{script:{type:"replayProtection"}},publicAddress:""}],metadata:{},networkFeeOption:"high"},e.next=3,r.makeSpend(n);case 3:return o=e.sent,e.next=6,r.signTx(o);case 6:return i=e.sent,e.next=9,r.broadcastTx(i);case 9:return a=e.sent,e.next=12,r.saveTx(a);case 12:return e.next=14,r.getReceiveAddress();case 14:return u=e.sent,s=u.publicAddress,c={currencyCode:"BCH",spendTargets:[{publicAddress:s,nativeAmount:"0"}],metadata:{},networkFeeOption:"high"},e.next=19,r.getMaxSpendable(c);case 19:return f=e.sent,c.spendTargets[0].nativeAmount=f,e.next=23,r.makeSpend(c);case 23:return l=e.sent,e.next=26,r.signTx(l);case 26:return d=e.sent,e.next=29,r.broadcastTx(d);case 29:return h=e.sent,e.next=32,r.saveTx(h);case 32:return p={name:"Replay Protection Tx",notes:"This transaction is to protect your BCH wallet from unintentionally spending BSV funds. Please wait for the transaction to confirm before making additional transactions using this BCH wallet."},e.next=35,r.saveTxMetadata(h.txid,"BCH",p);case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qr(e,t,r,n){return zr.apply(this,arguments)}function zr(){return zr=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p,y,b,v,g;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.props.state.accounts[n],u=a.allWalletInfosFull,s=a.login,c=a.loginTree,null!=(f=u.find((function(e){return e.id===o})))){e.next=5;break}throw new Error("Invalid wallet id ".concat(o));case 5:if("wallet:bitcoincash"!==i||"wallet:bitcoin"!==f.type||"bip49"!==f.keys.format){e.next=7;break}throw new Error("Cannot split segwit-format Bitcoin wallets to Bitcoin Cash");case 7:if(!(l="wallet:bitcoinsv"===i&&"wallet:bitcoincash"===f.type)){e.next=14;break}if(null!=(d=r.props.output.currency.wallets[o].walletApi)){e.next=12;break}throw new Error("Missing Wallet");case 12:return e.next=14,Fr(d);case 14:if(h=Ur(f,i),p=u.find((function(e){return e.id===h.id})),null==p){e.next=26;break}if(!p.archived&&!p.deleted){e.next=23;break}return(y={})[h.id]={archived:!1,deleted:!1},e.next=22,pr(r,n,y);case 22:return e.abrupt("return",f.id);case 23:if(!l){e.next=25;break}return e.abrupt("return",h.id);case 25:throw new Error("This wallet has already been split");case 26:return b=Mr(r,s,h),e.next=29,Kn(r,c,b);case 29:return e.prev=29,e.next=32,Cr(r,h.id);case 32:if(v=e.sent,null==(g=r.props.output.currency.wallets[o].walletApi)){e.next=41;break}if(null==g.name){e.next=38;break}return e.next=38,v.renameWallet(g.name);case 38:if(null==g.fiatCurrencyCode){e.next=41;break}return e.next=41,v.setFiatCurrencyCode(g.fiatCurrencyCode);case 41:e.next=46;break;case 43:e.prev=43,e.t0=e.catch(29),r.props.onError(e.t0);case 46:return e.abrupt("return",h.id);case 47:case"end":return e.stop()}}),e,null,[[29,43]])}))),zr.apply(this,arguments)}function Wr(e,t,r){return Vr.apply(this,arguments)}function Vr(){return(Vr=o()(t().mark((function e(r,n,o){var i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.props.state.accounts[n].allWalletInfosFull,null!=(a=i.find((function(e){return e.id===o})))){e.next=4;break}throw new Error("Invalid wallet id ".concat(o));case 4:if(null!=(u=Sr(r.props.state.plugins.currency,a.type))){e.next=7;break}return e.abrupt("return",[]);case 7:return e.next=9,Ar(r,u);case 9:if(null!=(s=e.sent).getSplittableTypes){e.next=12;break}return e.abrupt("return",[]);case 12:return e.next=14,s.getSplittableTypes(a);case 14:return c=e.sent,e.abrupt("return",c.filter((function(e){var t=Ur(a,e),r=i.find((function(e){return e.id===t.id}));return null==r||r.archived||r.deleted})));case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yr(e,t){return new Promise((function(r,n){var o=!1,i=[],a=[],u=setTimeout((function(){u=void 0,i.length>0&&(o=!0,r(i))}),t);function s(){var t=i.length+a.length===e.length;t&&null!=u&&clearTimeout(u),(t||null==u)&&(o=!0,i.length>0?r(i):n(a))}s();for(var c=0;c<e.length;c++){e[c].then((function(e){o||(i.push(e),s())}),(function(e){o||(a.push(e),s())}))}}))}var Jr=ve(Me);function Zr(e){var t=Ne(e);switch(t.status_code){case 0:return t.results;case 2:throw new bt("Account already exists on server");case 3:throw new bt("Account does not exist on server");case 4:case 5:throw new yt(t.results);case 6:throw new Error("Invalid API key");case 8:throw new pt(t.results);case 1e3:throw new ht;default:throw new Error("Server error: ".concat(t.message))}}function Xr(e,t,r,n){var o=e.props,i=o.state,a=o.io,u=o.log,s=i.login,c=s.apiKey,f=s.serverUri,l={method:t,headers:{"content-type":"application/json",accept:"application/json",authorization:"Token ".concat(""===c?"4248c1bf41e53b840a5fdb2c872dd3ade525e66d":c)}};"GET"!==t&&null!=n&&(l.body=JSON.stringify(Jr(n)));var d=Date.now(),h="".concat(f).concat(r);return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Error("Timeout of ".concat(t,"ms exceeded"));return new Promise((function(n,o){var i=setTimeout((function(){return o(r)}),t);e.then((function(e){n(e),clearTimeout(i)}),(function(e){o(e),clearTimeout(i)}))}))}(a.fetch(h,l),3e4).then((function(e){var r=Date.now()-d;return u("".concat(t," ").concat(h," returned ").concat(e.status," in ").concat(r,"ms")),e.json().then(Zr,(function(){throw new Error("Invalid reply JSON, HTTP status ".concat(e.status))}))}),(function(e){var n=Date.now()-d;throw u.error("".concat(t," ").concat(h," failed in ").concat(n,"ms, ").concat(String(e))),new dt("Could not reach the auth server: ".concat(r))}))}function $r(e,t,r){return"string"==typeof t&&(t=st(t)),e.props.output.scrypt.timeScrypt(t,r).then((function(e){return e.hash}))}var Qr={salt_hex:Uint8Array.from([181,134,95,251,159,167,179,191,228,178,56,77,71,206,131,30,226,42,74,157,92,52,199,239,125,33,70,124,199,88,248,27]),n:16384,r:1,p:1};function en(e,t){var r=xe(t),n=e.props.state.login.stashes;return null!=n[r]?n[r]:{username:r,appId:"",loginId:new Uint8Array(0),pendingVouchers:[]}}function tn(e,t){for(var r=e.props.state.login.stashes,n=0,o=Object.keys(r);n<o.length;n++){var i=r[o[n]],a=Bn(i,(function(e){return Tt(e.loginId,t)}));if(null!=a)return{stashTree:i,stash:a}}throw new Error("Cannot find stash ".concat(p.stringify(t)))}var rn={};function nn(e,t){var r=xe(t);return null==rn[r]&&(rn[r]=$r(e,r,Qr)),rn[r]}function on(e,t){return an.apply(this,arguments)}function an(){return(an=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=[],e.next=3,r.list("logins").then(Q.gQ);case 3:i=e.sent,a=0;case 5:if(!(a<i.length)){e.next=25;break}return u=i[a],e.prev=7,e.t0=o,e.t1=ln,e.t2=JSON,e.next=13,r.getText(u);case 13:e.t3=e.sent,e.t4=e.t2.parse.call(e.t2,e.t3),e.t5=(0,e.t1)(e.t4),e.t0.push.call(e.t0,e.t5),e.next=22;break;case 19:e.prev=19,e.t6=e.catch(7),n.error("Could not load ".concat(u,": ").concat(String(e.t6)));case 22:a++,e.next=5;break;case 25:return e.abrupt("return",o);case 26:case"end":return e.stop()}}),e,null,[[7,19]])})))).apply(this,arguments)}function un(e,t){return sn.apply(this,arguments)}function sn(){return(sn=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.io,u=xe(n),e.next=4,a.disklet.list("logins").then(Q.gQ);case 4:s=e.sent,c=0;case 6:if(!(c<s.length)){e.next=26;break}return f=s[c],e.prev=8,e.t0=ln,e.t1=JSON,e.next=13,a.disklet.getText(f);case 13:if(e.t2=e.sent,e.t3=e.t1.parse.call(e.t1,e.t2),(0,e.t0)(e.t3).username!==u){e.next=19;break}return e.next=19,a.disklet.delete(f);case 19:e.next=23;break;case 21:e.prev=21,e.t4=e.catch(8);case 23:c++,e.next=6;break;case 26:i({type:"LOGIN_STASH_DELETED",payload:xe(n)});case 27:case"end":return e.stop()}}),e,null,[[8,21]])})))).apply(this,arguments)}function cn(e,t){return fn.apply(this,arguments)}function fn(){return(fn=o()(t().mark((function e(r,n){var o,i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.props,i=o.dispatch,a=o.io,u=n.appId,s=n.loginId,c=n.username,""===u){e.next=4;break}throw new Error("Cannot save a login without an appId.");case 4:if(null!=c){e.next=6;break}throw new Error("Cannot save a login without a username.");case 6:if(null!=s&&32===s.length){e.next=8;break}throw new Error("Invalid loginId");case 8:return e.next=10,a.disklet.setText("logins/".concat(ut(s),".json"),JSON.stringify(dn(n)));case 10:i({type:"LOGIN_STASH_SAVED",payload:n});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ln=de({appId:pe,created:he(ae),lastLogin:he(ae),loginId:Ie,userId:he(Ie),username:he(pe),otpKey:he(Ae),otpResetDate:he(ae),otpTimeout:he(le),pendingVouchers:he(ne(Oe),[]),voucherId:he(pe),voucherAuth:he(Ie),loginAuthBox:he(ke),parentBox:he(ke),passwordAuthBox:he(ke),passwordAuthSnrp:he(Pe),passwordBox:he(ke),passwordKeySnrp:he(Pe),pin2Key:he(ie((function(e){var t=pe(e);return"="!==e.slice(-1)?at(t):p.parse(t)}),(function(e){return p.stringify(e)}))),pin2TextBox:he(ke),recovery2Key:he(Ie),children:he(ne((function(e){return ln(e)}))),keyBoxes:he(ne(ke)),mnemonicBox:he(ke),rootKeyBox:he(ke),syncKeyBox:he(ke)}),dn=ve(ln);function hn(e,t,r){var n,o,i=function(e,t){var r=s().hmac(s().sha1,t);return Uint8Array.from(r.update(e).digest())}((n=t,o=Math.floor(n/4294967296),new Uint8Array([o>>24&255,o>>16&255,o>>8&255,255&o,n>>24&255,n>>16&255,n>>8&255,255&n])),e),a=15&i[19],u=((127&i[a])<<24|i[a+1]<<16|i[a+2]<<8|i[a+3]).toString();return(Array(r).join("0")+u).slice(-r)}function pn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now()/1e3;return hn(e,t/30,6)}function yn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.now,o=void 0===n?Date.now()/1e3:n,i=r.spread,a=void 0===i?1:i,u=o/30;if(t===hn(e,u,6))return!0;for(var s=1;s<=a;++s){if(t===hn(e,u-s,6))return!0;if(t===hn(e,u+s,6))return!0}return!1}var bn=ve(De);function vn(e){if(null!=e.otpKey)return pn(e.otpKey)}function gn(e,t){var r=t.otp,n=t.otpKey;return null!=r?/[0-9]+/.test(r)&&r.length<16?r:pn(h.parse(r,{loose:!0})):null!=n?pn(h.parse(n,{loose:!0})):null!=e.otpKey?pn(e.otpKey):void 0}function mn(e,t,r){return wn.apply(this,arguments)}function wn(){return(wn=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.state.accounts[n].loginTree,a=i.otpKey,u=void 0===a?r.props.io.random(10):a,s={serverPath:"/v2/login/otp",server:bn({otpKey:u,otpTimeout:o}),stash:{otpKey:u,otpResetDate:void 0,otpTimeout:o},login:{otpKey:u,otpResetDate:void 0,otpTimeout:o},loginId:i.loginId},e.next=5,Kn(r,i,s);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function En(e,t){return _n.apply(this,arguments)}function _n(){return(_n=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i={serverMethod:"DELETE",serverPath:"/v2/login/otp",stash:{otpKey:void 0,otpResetDate:void 0,otpTimeout:void 0},login:{otpKey:void 0,otpResetDate:void 0,otpTimeout:void 0},loginId:o.loginId},e.next=4,Kn(r,o,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cn(e,t){return xn.apply(this,arguments)}function xn(){return(xn=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.props.state.accounts[n].loginTree,i=o.otpTimeout,a=o.otpKey,null!=i&&null!=a){e.next=4;break}throw new Error("Cannot cancel 2FA reset: 2FA is not enabled.");case 4:return u={serverPath:"/v2/login/otp",server:bn({otpTimeout:i,otpKey:a}),stash:{otpResetDate:void 0},login:{otpResetDate:void 0},loginId:o.loginId},e.next=7,Kn(r,o,u);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sn(e,t,r){return An.apply(this,arguments)}function An(){return(An=o()(t().mark((function e(r,n,o){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nn(r,n);case 2:return e.t0=e.sent,e.t1=o,i={userId:e.t0,otpResetAuth:e.t1},e.abrupt("return",Xr(r,"DELETE","/v2/login/otp",i).then((function(e){return Je(e).otpResetDate})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function In(e,t,r){return On.apply(this,arguments)}function On(){return On=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.props.state.accounts[n]){e.next=2;break}return e.abrupt("return");case 2:if(a=r.props.state.accounts[n].login,u=a.userId,s=a.passwordAuth,c=tn(r,a.loginId),f=c.stashTree,l=c.stash,null!=s&&null!=u){e.next=7;break}throw new Error("Cannot repair OTP: There is no password on this account");case 7:return d={userId:u,passwordAuth:s,otp:pn(i)},h={now:f.lastLogin},e.next=11,Un(r,f,l,h,d,o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.loginKey);case 1:case"end":return e.stop()}}),e)}))));case 11:case"end":return e.stop()}}),e)}))),On.apply(this,arguments)}function Tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tn(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pn=ve(Ke);function Bn(e,t){if(t(e))return e;var r=e;if(null!=r.children)for(var n=0,o=r.children;n<o.length;n++){var i=Bn(o[n],t);if(null!=i)return i}}function Rn(e,t,r,n){if(t(e))return r(e);var o=null!=e.children?e.children.map((function(e){return Rn(e,t,r,n)})):[];return n(e,o)}function jn(e,t,r){var n=e.children,o=void 0===n?[]:n,i=r.appId,a=r.created,u=r.loginId,s=r.loginAuthBox,c=r.userId,f=r.otpKey,l=r.otpResetDate,d=r.otpTimeout,h=r.pendingVouchers,p=r.parentBox,y=r.passwordAuthBox,b=r.passwordAuthSnrp,v=r.passwordBox,g=r.passwordKeySnrp,m=r.pin2TextBox,w=r.children,E=void 0===w?[]:w,_=r.keyBoxes,C={appId:i,created:a,loginId:u,loginAuthBox:s,userId:c,otpKey:f,otpResetDate:l,otpTimeout:d,pendingVouchers:h,parentBox:p,passwordAuthBox:y,passwordAuthSnrp:b,passwordBox:v,passwordKeySnrp:g,pin2TextBox:m,keyBoxes:void 0===_?[]:_,mnemonicBox:r.mnemonicBox,rootKeyBox:r.rootKeyBox,syncKeyBox:r.syncKeyBox};null!=e.lastLogin&&(C.lastLogin=e.lastLogin),null!=e.username&&(C.username=e.username),null!=e.userId&&(C.userId=e.userId),null!=r.pin2KeyBox&&(C.pin2Key=Bt(r.pin2KeyBox,t)),null!=r.recovery2KeyBox&&(C.recovery2Key=Bt(r.recovery2KeyBox,t)),E.sort((function(e,t){return e.created.valueOf()-t.created.valueOf()})),C.children=E.map((function(e){var r=e.appId,n=e.loginId,i=e.parentBox;if(null==i)throw new Error("Key integrity violation: No parentBox on child login.");var a=Bt(i,t),u=o.find((function(e){return Tt(e.loginId,n)}));return jn(null!=u?u:{appId:r,loginId:n,pendingVouchers:[]},a,e)}));for(var x=function(e){var t=o[e].loginId;if(null==E.find((function(e){return Tt(e.loginId,t)})))throw new Error("The server has lost children!")},S=0;S<o.length;S++)x(S);return C}function Mn(e,t,r){return Rn(e,(function(e){return e.appId===r.appId}),(function(e){return jn(e,t,r)}),(function(e,t){return kn(kn({},e),{},{children:t})}))}function Nn(e,t){var r=e.appId,n=e.created,o=e.lastLogin,i=void 0===o?new Date:o,a=e.loginId,u=e.otpKey,s=e.otpResetDate,c=e.otpTimeout,f=e.pendingVouchers,l=e.userId,d=e.username,h=e.children,y=void 0===h?[]:h,b=e.keyBoxes,v=void 0===b?[]:b,g={appId:r,created:n,lastLogin:i,loginId:a,otpKey:u,otpResetDate:s,otpTimeout:c,pendingVouchers:f,userId:l,username:d,loginKey:t,children:[],keyInfos:[]};if(null!=e.loginAuthBox&&(g.loginAuth=Bt(e.loginAuthBox,t)),null!=e.passwordAuthBox&&(null==g.userId&&(g.userId=a),g.passwordAuth=Bt(e.passwordAuthBox,t)),null==g.loginAuth&&null==g.passwordAuth)throw new Error("No server authentication methods on login");g.pin2Key=e.pin2Key,null!=e.pin2TextBox&&(g.pin=Pt(e.pin2TextBox,t)),g.recovery2Key=e.recovery2Key;var m=[],w=e.mnemonicBox,E=e.rootKeyBox;if(null!=w&&null!=E){var _=Bt(E,t),C={mnemonic:Pt(w,It(_,st("infoKey"))),rootKey:p.stringify(_)};m.push(Rr("wallet:bitid",C,_))}if(null!=e.syncKeyBox){var x=Bt(e.syncKeyBox,t),S=Br(g.appId),A={syncKey:p.stringify(x),dataKey:p.stringify(t)};m.push(Rr(S,A,t))}var I=v.map((function(e){return JSON.parse(Pt(e,t))}));return g.keyInfos=Nr([].concat(m,lt()(I))).map((function(e){return Dr(e)})),g.children=y.map((function(e){if(null==e.parentBox)throw new Error("Key integrity violation: No parentBox on child login.");return Nn(e,Bt(e.parentBox,t))})),g}function Dn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Rn(e,(function(e){return e.appId===r}),(function(e){return Nn(e,t)}),(function(e,t){var r=e.appId,n=e.lastLogin;return{appId:r,children:t,keyInfos:[],lastLogin:void 0===n?new Date:n,loginId:e.loginId,loginKey:undefined,pendingVouchers:e.pendingVouchers,username:e.username}}))}function Ln(e,t){return Rn(e,(function(e){return e.appId===t}),(function(e){return e}),(function(e,t){return{appId:e.appId,children:t,loginId:e.loginId,pendingVouchers:[],username:e.username}}))}function Un(e,t,r,n,o,i){return Hn.apply(this,arguments)}function Hn(){return Hn=o()(t().mark((function e(r,n,o,i,a,u){var s,c,f,l,d,h,y,b,v,g,m,w,E;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=i.now,c=void 0===s?new Date:s,f=r.props.state.login.deviceDescription,l=kn({otp:gn(o,i),voucherId:o.voucherId,voucherAuth:o.voucherAuth},a),null!=f&&(l.deviceDescription=f),e.t0=We,e.next=7,Xr(r,"POST","/v2/login",l).catch((function(e){var t=mt(e);throw null!=t&&(0===o.loginId.length&&null!=t.loginId||null!=t.voucherId&&null!=t.voucherAuth)&&(null!=t.loginId&&(o.loginId=p.parse(t.loginId)),null!=t.voucherAuth&&(o.voucherId=t.voucherId,o.voucherAuth=p.parse(t.voucherAuth)),n.lastLogin=c,cn(r,n).catch((function(){}))),e}));case 7:return e.t1=e.sent,d=(0,e.t0)(e.t1),e.next=11,u(d);case 11:return h=e.sent,(n=Mn(n,h,d)).lastLogin=c,e.next=16,cn(r,n);case 16:if(null!=d.loginAuthBox){e.next=29;break}return y=tn(r,d.loginId),b=y.stash,v=y.stashTree,g=r.props.io,m=g.random(32),w=Rt(g,m,h),E=kn(kn({},a),{},{otp:gn(b,i),data:Pn({loginAuth:m,loginAuthBox:w})}),e.t2=We,e.next=25,Xr(r,"POST","/v2/login/secret",E);case 25:return e.t3=e.sent,d=(0,e.t2)(e.t3),e.next=29,cn(r,Mn(v,h,d));case 29:return e.abrupt("return",Dn(n,h,o.appId));case 30:case"end":return e.stop()}}),e)}))),Hn.apply(this,arguments)}function Kn(e,t,r){return Fn.apply(this,arguments)}function Fn(){return Fn=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=o.loginId,a=o.serverMethod,u=void 0===a?"POST":a,s=o.serverPath,null!=(c=Bn(n,(function(e){return Tt(e.loginId,i)})))){e.next=4;break}throw new Error("Cannot apply kit: missing login");case 4:return f=tn(r,i),l=f.stashTree,(d=Jn(l,c)).data=o.server,e.next=9,Xr(r,u,s,d);case 9:return h=Rn(n,(function(e){return Tt(e.loginId,i)}),(function(e){return kn(kn(kn({},e),o.login),{},{children:Dt(e.children,o.login.children),keyInfos:Nr(Dt(e.keyInfos,o.login.keyInfos))})}),(function(e,t){return kn(kn({},e),{},{children:t})})),p=Rn(l,(function(e){return Tt(e.loginId,i)}),(function(e){return kn(kn(kn({},e),o.stash),{},{children:Dt(e.children,o.stash.children),keyBoxes:Dt(e.keyBoxes,o.stash.keyBoxes)})}),(function(e,t){return kn(kn({},e),{},{children:t})})),e.next=13,cn(r,p);case 13:return e.abrupt("return",h);case 14:case"end":return e.stop()}}),e)}))),Fn.apply(this,arguments)}function Gn(e,t,r){return qn.apply(this,arguments)}function qn(){return(qn=o()(t().mark((function e(r,n,o){var i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=0;case 1:if(!(i<o.length)){e.next=8;break}return a=o[i],e.next=5,Kn(r,n,a);case 5:i++,e.next=1;break;case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zn(e,t){return Wn.apply(this,arguments)}function Wn(){return Wn=o()(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.props.state.accounts[n]){e.next=2;break}return e.abrupt("return");case 2:return o=r.props.state.accounts[n],i=o.login,a=o.loginTree,e.next=5,Vn(r,a,i);case 5:case"end":return e.stop()}}),e)}))),Wn.apply(this,arguments)}function Vn(e,t,r){return Yn.apply(this,arguments)}function Yn(){return Yn=o()(t().mark((function e(r,n,i){var a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=tn(r,i.loginId),u=a.stashTree,s=a.stash,c=Jn(u,i),f={now:u.lastLogin},e.next=5,Un(r,u,s,f,c,o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i.loginKey);case 1:case"end":return e.stop()}}),e)}))));case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),Yn.apply(this,arguments)}function Jn(e,t){var r=Bn(e,(function(e){return e.appId===t.appId})),n=null!=r?r:{voucherAuth:void 0,voucherId:void 0},o=n.voucherAuth,i=n.voucherId,a=t.loginId,u=t.userId,s=t.loginAuth,c=t.passwordAuth;if(null!=s)return{loginId:a,loginAuth:s,otp:vn(t),voucherAuth:o,voucherId:i};if(null!=c&&null!=u)return{userId:u,passwordAuth:c,otp:vn(t),voucherAuth:o,voucherId:i};throw new Error("No server authentication methods available")}var Zn=r(1649);Zn.bS,Zn.Ei,Zn.wJ,Zn.PG,Zn.SR,Zn.Th,Zn.Qw,Zn.YK,Zn.KI,Zn.Wn,Zn.tp,Zn.RQ,Zn.tE,Zn.Jj;const Xn=Zn.LZ;Zn.m8;var $n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,Qn="object"==typeof self&&self&&self.Object===Object&&self,eo=($n||Qn||Function("return this")()).Symbol,to=Object.prototype,ro=to.hasOwnProperty,no=to.toString,oo=eo?eo.toStringTag:void 0;var io=function(e){var t=ro.call(e,oo),r=e[oo];try{e[oo]=void 0;var n=!0}catch(i){}var o=no.call(e);return n&&(t?e[oo]=r:delete e[oo]),o},ao=Object.prototype.toString;var uo=function(e){return ao.call(e)},so=eo?eo.toStringTag:void 0;var co=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":so&&so in Object(e)?io(e):uo(e)};var fo=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);var lo=function(e){return null!=e&&"object"==typeof e},ho=Function.prototype,po=Object.prototype,yo=ho.toString,bo=po.hasOwnProperty,vo=yo.call(Object);var go=function(e){if(!lo(e)||"[object Object]"!=co(e))return!1;var t=fo(e);if(null===t)return!0;var r=bo.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&yo.call(r)==vo},mo=r(7121),wo="@@redux/INIT";function Eo(e,t,r){var n;if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(Eo)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,i=t,a=[],u=a,s=!1;function c(){u===a&&(u=a.slice())}function f(){return i}function l(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),u.push(e),function(){if(t){t=!1,c();var r=u.indexOf(e);u.splice(r,1)}}}function d(e){if(!go(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,i=o(i,e)}finally{s=!1}for(var t=a=u,r=0;r<t.length;r++){(0,t[r])()}return e}return d({type:wo}),(n={dispatch:d,subscribe:l,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,d({type:wo})}})[mo.Z]=function(){var e,t=l;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function r(){e.next&&e.next(f())}return r(),{unsubscribe:t(r)}}})[mo.Z]=function(){return this},e},n}function _o(e,t){var r=t&&t.type;return"Given action "+(r&&'"'+r.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function Co(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];0,"function"==typeof e[o]&&(r[o]=e[o])}var i=Object.keys(r);var a=void 0;try{!function(e){Object.keys(e).forEach((function(t){var r=e[t];if(void 0===r(void 0,{type:wo}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+wo+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(r)}catch(u){a=u}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(a)throw a;for(var n=!1,o={},u=0;u<i.length;u++){var s=i[u],c=r[s],f=e[s],l=c(f,t);if(void 0===l){var d=_o(s,t);throw new Error(d)}o[s]=l,n=n||l!==f}return n?o:e}}Object.assign;function xo(e){function t(t){var r=void 0,n=void 0,o=!0,i=!1,a=!1,u=void 0,s=void 0,c=void 0;function f(){if(r){try{if(s){var e=s;u=void 0,s=void 0,c=void 0,e(((n=new Error("Pixie has been destroyed")).name="PixieShutdownError",n))}var t=r;r=void 0,t.destroy()}catch(n){l(n)}a=!0}var n}function l(e){a||t.onError(e),f()}function d(){i=!1,h()}function h(){for(;r&&o&&!i;){o=!1,i=!0;try{var e=r.update(n);e&&"function"==typeof e.then?e.then(d,l):i=!1}catch(t){l(t)}}}function p(){return u||(u=new Promise((function(e,t){c=e,s=t}))),u}var y={onError:l,onOutput:function(e){a||t.onOutput(e)},get props(){return n},nextProps:p,waitFor:function(e){return new Promise((function(t,r){return function o(){try{var i=e(n);null!=i?t(i):p().then(o,r)}catch(a){r(a)}}()}))}};try{r=function(e){return"function"==typeof e?{update:e,destroy:function(){}}:e}(e(y))}catch(b){l(b)}return{update:function(e){if(n=e,o=!0,c){var t=c;u=void 0,s=void 0,c=void 0,t(e)}h()},destroy:f}}return t.tame=!0,t.defaultOutput=e.defaultOutput,t}function So(e){return e.tame?e:xo(e)}function Ao(e,t,r){r(e)}function Io(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ao,r=So(e);function n(e){var n=e.onOutput,o=void 0,i=void 0,a=function(){var e=o;o=void 0,e&&e.destroy()};var u={onError:function(r){a();try{t(r,i,e.onError)}catch(r){e.onError(r)}},onOutput:n};return{update:function(e){i=e,o||(o=r(u)),o.update(e)},destroy:a}}return n.tame=!0,n.defaultOutput=e.defaultOutput,n}var Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},To=(function(){function e(e){this.value=e}function t(t){var r,n;function o(r,n){try{var a=t[r](n),u=a.value;u instanceof e?Promise.resolve(u.value).then((function(e){o("next",e)}),(function(e){o("throw",e)})):i(a.done?"return":"normal",a.value)}catch(s){i("throw",s)}}function i(e,t){switch(e){case"return":r.resolve({value:t,done:!0});break;case"throw":r.reject(t);break;default:r.resolve({value:t,done:!1})}(r=r.next)?o(r.key,r.arg):n=null}this._invoke=function(e,t){return new Promise((function(i,a){var u={key:e,arg:t,resolve:i,reject:a,next:null};n?n=n.next=u:(r=n=u,o(e,t))}))},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()),ko=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function Po(e){var t=So(e);function r(r){var n=r.onError,o=void 0,i=e.defaultOutput,a=void 0,u=!0,s=!1,c=function(){for(;o&&u&&!s;)u=!1,s=!0,o.update(ko({},a,{output:i})),s=!1},f={onError:n,onOutput:function(e){e!==i&&(i=e,u=!0,r.onOutput(e),c())}};return{update:function(e){a=e,u=!0,o||(o=t(f)),c()},destroy:function(){var e=o;o=void 0,e&&e.destroy()}}}return r.tame=!0,r.defaultOutput=e.defaultOutput,r}function Bo(e){}function Ro(e){}function jo(e,t,r,n){var o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bo,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ro;return Io(Po(e))({onError:t,onOutput:r})}(t,r,n);o.update({dispatch:e.dispatch,output:void 0,state:e.getState()});var i=e.subscribe((function(){o.update({dispatch:e.dispatch,output:void 0,state:e.getState()})}));return function(){i(),o.destroy()}}function Mo(e){var t={},r=Object.keys(e),n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(o>=r.length)break;i=r[o++]}else{if((o=r.next()).done)break;i=o.value}var a=i;t[a]=e[a].defaultOutput}function u(r){var n=r.onError,o={},i={},a=ko({},t),u=!1,s=function(){if(f){if(l>=c.length)return"break";d=c[l++]}else{if((l=c.next()).done)return"break";d=l.value}var t=d;if(o[t]={onError:n,onOutput:function(e){e!==a[t]&&((a=ko({},a))[t]=e,r.onOutput(a))}},i[t]=So(e[t])(o[t]),u)return"break"},c=Object.keys(e),f=Array.isArray(c),l=0;for(c=f?c:c[Symbol.iterator]();;){var d;if("break"===s())break}return{update:function(e){var t=Object.keys(i),r=Array.isArray(t),n=0;for(t=r?t:t[Symbol.iterator]();;){var o;if(r){if(n>=t.length)break;o=t[n++]}else{if((n=t.next()).done)break;o=n.value}if(i[o].update(e),u)return}},destroy:function(){u=!0;var e=Object.keys(i),t=Array.isArray(e),r=0;for(e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if((r=e.next()).done)break;n=r.value}i[n].destroy()}}}}return u.tame=!0,u.defaultOutput=t,u}function No(e,t){return function(){try{return e.apply(void 0,arguments)}catch(r){t(r)}}}function Do(e,t){if(e===t)return!0;if("object"!==(void 0===e?"undefined":Oo(e)))return!1;if("object"!==(void 0===t?"undefined":Oo(t)))return!1;if(!e||!t)return!1;var r=Object.getOwnPropertyNames(e);if(r.length!==Object.getOwnPropertyNames(t).length)return!1;var n=r,o=Array.isArray(n),i=0;for(n=o?n:n[Symbol.iterator]();;){var a;if(o){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var u=a;if(!t.hasOwnProperty(u)||e[u]!==t[u])return!1}return!0}function Lo(e,t){var r=So(e);function n(e){var n=e.onError,o=e.onOutput,i=void 0,a=void 0,u=!1,s=No(t,n),c={onError:n,onOutput:o};return{update:function(e){var t=s(e);if(!u){var n=!Do(t,a);if(a=t,t){if(i||(i=r(c)),u)return;n&&i.update(t)}else i&&i.destroy(),i=void 0}},destroy:function(){u=!0,i&&i.destroy(),i=void 0}}}return n.tame=!0,n.defaultOutput=e.defaultOutput,n}function Uo(e,t,r){var n=So(e);function o(e){var o=e.onError,i={},a={},u=!1,s={},c=!1,f=!1,l=No(t,o),d=No(r,o),h=function(){if(u&&!c){u=!1;var t={},r=Object.keys(i),n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var s;if(n){if(o>=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}var f=s;t[f]=a[f]}a=t,e.onOutput(a)}};return{update:function(e){var t=l(e);if(!f&&t){c=!0;var r={},p=function(){if(b){if(v>=y.length)return"break";g=y[v++]}else{if((v=y.next()).done)return"break";g=v.value}var t=g,c=d(e,t);if(f)return{v:void 0};var l=!Do(c,s[t]);if(s[t]=c,c){if(!i[t]){if(i[t]=n({onError:o,onOutput:function(e){e!==a[t]&&(a[t]=e,u=!0,h())}}),f)return{v:void 0}}if(l&&i[t].update(c),f)return{v:void 0};r[t]=i[t]}};var y=t,b=Array.isArray(y),v=0;e:for(y=b?y:y[Symbol.iterator]();;){var g,m=p();if("break"===m)break e;if("object"===(void 0===m?"undefined":Oo(m)))return m.v}var w=i;i=r;var E=Object.keys(w),_=Array.isArray(E),C=0;for(E=_?E:E[Symbol.iterator]();;){var x;if(_){if(C>=E.length)break;x=E[C++]}else{if((C=E.next()).done)break;x=C.value}var S=x;r[S]||(u=!0,w[S].destroy())}f||(c=!1,h())}},destroy:function(){f=!0;var e=Object.keys(i),t=Array.isArray(e),r=0;for(e=t?e:e[Symbol.iterator]();;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if((r=e.next()).done)break;n=r.value}var o=n;i[o]&&i[o].destroy()}}}}return o.tame=!0,o.defaultOutput={},o}!function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.props=t}To(e,[{key:"update",value:function(e,t){}},{key:"destroy",value:function(e,t){}}])}();var Ho={then:function(){}};function Ko(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ko(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ko(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Go(e,t,r){return function(){for(var n="",o=0;o<arguments.length;++o){var i=arguments[o];o>0&&(n+=" "),n+="string"==typeof i?i:JSON.stringify(i,null,2)}e({message:n,source:r,time:new Date,type:t})}}function qo(e,t){return Fo(Fo({},e),{},{onLog:function(r){var n=t(),o=n.sources,i=n.defaultLogLevel,a=null!=o[r.source]?o[r.source]:i;switch(r.type){case"info":"info"===a&&e.onLog(r);break;case"warn":"info"!==a&&"warn"!==a||e.onLog(r);break;case"error":"silent"!==a&&e.onLog(r)}}})}function zo(e,t){var r=e.onLog,n=e.crashReporter;return Ut(Go(r,"info",t),{breadcrumb:function(e,o){var i=new Date;null!=n?n.logBreadcrumb({message:e,metadata:o,source:t,time:i}):(e="".concat(e," ").concat(JSON.stringify(o,null,2)),r({message:e,source:t,time:i,type:"warn"}))},crash:function(e,o){var i=new Date;if(null!=n)n.logCrash({error:e,metadata:o,source:t,time:i});else{var a="".concat(String(e)," ").concat(JSON.stringify(o,null,2));r({message:a,source:t,time:i,type:"error"})}},warn:Go(r,"warn",t),error:Go(r,"error",t)})}var Wo={},Vo=!1,Yo=[],Jo=[];function Zo(){Vo=!0;for(var e=0;e<Jo.length;e++){(0,Jo[e])()}}function Xo(e,t,r,n){var o=e.io,i=e.nativeIo;function a(e){var a={};for(var u in e){var s=e[u],c=zo(t,u),f=r[u];if(f)try{if("function"==typeof s){var l={initOptions:"object"===Nt()(f)?f:{},io:o,log:c,nativeIo:i,pluginDisklet:(0,Q.HN)(o.disklet,"plugins/"+u)};a[u]=s(l)}else{if("object"!==Nt()(s)||null==s)throw new TypeError("Plugins must be functions or objects, got ".concat(Nt()(s)));a[u]=s}}catch(d){c.error(d)}}n({type:"CORE_PLUGINS_ADDED",payload:a})}function u(){n({type:"CORE_PLUGINS_LOCKED",payload:r})}return a(Wo),Vo&&u(),Yo.push(a),Jo.push(u),function(){Yo.filter((function(e){return e!==a})),Jo.filter((function(e){return e!==u}))}}function $o(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.onError,i=void 0===o?function(e){}:o,a=!1;function u(){r=void 0,c.started&&(a=!0,new Promise((function(t){return t(e())})).catch(i).then(s,s))}function s(){a=!1,c.started&&(r=setTimeout(u,t))}var c={started:!1,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.wait,n=void 0!==t&&t;c.started=!0,a||null!=r||(n?s():u())},stop:function(){c.started=!1,null!=r&&(clearTimeout(r),r=void 0)}};return c}function Qo(e){return new Promise((function(t){return setTimeout((function(){return t(e)}),e)}))}function ei(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var ti=100;function ri(e,t,r){var n=(0,Q.HN)(e.disklet,"repos/"+ut(Ot(Ot(t)))),o=(0,Q.HN)(n,"changes"),i=(0,Q.HN)(n,"data");return{dataKey:r,syncKey:t,baseDisklet:n,changesDisklet:o,dataDisklet:i,disklet:Ft(e,r,(0,Q.Cl)(o,i))}}function ni(e){var t={lastSync:0,lastHash:void 0};return e.baseDisklet.getText("status.json").then((function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ei(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({lastSync:0},JSON.parse(e))})).catch((function(e){return t}))}function oi(e,t){return ii.apply(this,arguments)}function ii(){return(ii=o()(t().mark((function e(r,n){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.keys(n).map((function(e){var t=n[e];return null!=t?r.setText(e,JSON.stringify(t)):r.delete(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ai(e,t,r){return ui.apply(this,arguments)}function ui(){return ui=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,h,p,y;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.changesDisklet,u=n.dataDisklet,s=n.syncKey,e.next=3,si(a).then((function(e){return Promise.all(e.map(function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=r,e.t1=JSON,e.next=4,a.getText(r);case 4:return e.t2=e.sent,e.t3=e.t1.parse.call(e.t1,e.t2),e.abrupt("return",{path:e.t0,json:e.t3});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()))}));case 3:return c=e.sent,f=d.stringify(s).toLowerCase(),e.next=7,function(){if(0===c.length)return r.readRepo(f,i.lastHash);for(var e={},t=0;t<c.length;t++){var n=c[t];e[n.path]=n.json}return r.updateRepo(f,i.lastHash,{changes:e})}();case 7:return l=e.sent,h=l.changes,p=void 0===h?{}:h,y=l.hash,e.next=11,oi(u,p);case 11:return e.next=13,Promise.all(c.map((function(e){return a.delete(e.path)})));case 13:return i.lastSync=Date.now()/1e3,null!=y&&(i.lastHash=y),e.next=17,n.baseDisklet.setText("status.json",JSON.stringify(i)).then((function(){return{status:i,changes:p}}));case 17:return e.abrupt("return",e.sent);case 18:case"end":return e.stop()}}),e)}))),ui.apply(this,arguments)}function si(e){return ci.apply(this,arguments)}function ci(){return ci=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>1&&void 0!==d[1]?d[1]:"",o=d.length>2&&void 0!==d[2]?d[2]:ti,e.next=4,r.list(n);case 4:i=e.sent,a=Object.keys(i).filter((function(e){return"file"===i[e]})),u=Object.keys(i).filter((function(e){return"folder"===i[e]})),s=0;case 8:if(!(s<u.length)){e.next=20;break}if(c=u[s],!(a.length>=o)){e.next=12;break}return e.abrupt("break",20);case 12:return f=o-a.length,e.next=15,si(r,c,f);case 15:l=e.sent,a.push.apply(a,lt()(l.slice(0,f)));case 17:s++,e.next=8;break;case 20:return e.abrupt("return",a);case 21:case"end":return e.stop()}}),e)}))),ci.apply(this,arguments)}function fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function li(e,t){return di.apply(this,arguments)}function di(){return(di=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.io,u=o.onError,s=p.parse(n.keys.dataKey),c=p.parse(n.keys.syncKey),f=ri(a,c,s),A(l=(0,Q.HN)(a.disklet,"local/"+ut(p.parse(n.id)))),e.next=8,ni(f);case 8:if(d=e.sent,i({type:"STORAGE_WALLET_ADDED",payload:{id:n.id,initialState:{localDisklet:l,paths:f,status:d,lastChanges:[]}}}),h=hi(r,n.id),!(d.lastSync>0)){e.next=15;break}h.catch((function(e){var t=n.keys.syncKey,o=d.lastHash;r.props.log.error("Could not sync ".concat(t," with last hash ").concat(String(o),": ").concat(String(e))),u(e)})),e.next=17;break;case 15:return e.next=17,h;case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hi(e,t){var r=e.props,n=r.dispatch,o=r.syncClient,i=r.state.storageWallets[t];return ai(o,i.paths,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},i.status)).then((function(e){var r=e.changes,o=e.status;return n({type:"STORAGE_WALLET_SYNCED",payload:{id:t,changes:Object.keys(r),status:o}}),Object.keys(r)}))}var pi=r(9847),yi=r.n(pi),bi=r(1964),vi=r(8823).Buffer;function gi(e){return vi.from(e.replace(/^0x/,""),"hex")}function mi(e){try{var t=(0,bi.privateToAddress)(gi(e));return(0,bi.toChecksumAddress)(t.toString("hex"))}catch(r){return"invalid_private_key"}}function wi(e,t){var r=new(yi())(t);return r.sign(gi(e)),r.serialize().toString("hex")}var Ei=[];function _i(e,t){Si(e,t,Ei)&&Ei.push({fromCurrency:e,toCurrency:t})}var Ci=Lo((function(e){function r(){return n.apply(this,arguments)}function n(){return(n=o()(t().mark((function r(){var n,o,i,a,u,s,c,f,l,d,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=e.props.state,o=n.rateHintCache,i=n.currency.wallets,a=0,u=Object.keys(i);a<u.length;a++)for(s=u[a],c=i[s].fiat,f=0,l=Object.keys(i[s].balances);f<l.length;f++)Si(d=l[f],c,Ei)&&Ei.push({fromCurrency:d,toCurrency:c});if(0!==Ei.length||0!==o.length){t.next=4;break}return t.abrupt("return",Ai);case 4:if(!(0===Ei.length&&o.length>0)){t.next=6;break}return t.abrupt("return",o);case 6:if(t.prev=6,!((h=Ei.filter((function(e){return Si(e.fromCurrency,e.toCurrency,o)}))).length>0)){t.next=13;break}return t.next=11,e.props.io.disklet.setText("rateHintCache.json",JSON.stringify(o.concat(h)));case 11:e.props.dispatch({type:"UPDATE_RATE_HINT_CACHE",payload:{rateHintCache:o.concat(h)}}),e.props.log("Update rateHintCache.json success");case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(6),e.props.log.error("Update rateHintCache.json error",t.t0),e.props.onError(new Error("Failed to write rateHintCache"));case 19:return t.abrupt("return",Ei);case 20:case"end":return t.stop()}}),r,null,[[6,15]])})))).apply(this,arguments)}function i(t,r){e.props.log.warn("Exchange rates updated (".concat(r,")")),t.length>0&&e.props.dispatch({type:"EXCHANGE_PAIRS_FETCHED",payload:t})}function a(){return a=o()(t().mark((function n(){var o,a,u,s,c,f,l,d,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u=!1,i(s,e?"complete":"some pending")},0!==(o=Object.keys(e.props.state.plugins.rate)).length){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,r();case 6:return a=t.sent,u=!0,s=[],f=setTimeout(c,5e3),l=0,d=Date.now()/1e3,h=o.map((function(t){return xi(e.props.state.plugins.rate[t],a,t,d).then((function(e){u?s=[].concat(lt()(s),lt()(e)):i(e,t)})).catch((function(r){e.props.log.error("Rate provider ".concat(t," failed: ").concat(String(r)))})).then((function(){u&&++l>=o.length&&(clearTimeout(f),c(!0))}))})),t.next=15,Promise.all(h);case 15:case"end":return t.stop()}}),n)}))),a.apply(this,arguments)}var u=$o((function(){return a.apply(this,arguments)}),3e4);return{update:function(e){e.state.plugins.locked&&u.start({wait:!1})},destroy:function(){u.stop()}}}),(function(e){return e.state.paused?void 0:e}));function xi(e,t,r,n){try{return e.fetchRates(t).then((function(e){return e.map((function(e){var t=e.fromCurrency,o=e.toCurrency,i=e.rate;if("string"!=typeof t||"string"!=typeof o||"number"!=typeof i)throw new TypeError("Invalid data format");return{fromCurrency:t,toCurrency:o,rate:i,source:r,timestamp:n}}))}))}catch(o){return Promise.reject(o)}}function Si(e,t,r){for(var n=0;n<r.length;n++){var o=r[n];if(o.fromCurrency===e&&o.toCurrency===t)return!1}return!0}var Ai=[{fromCurrency:"BTC",toCurrency:"iso:AED"},{fromCurrency:"BTC",toCurrency:"iso:AFN"},{fromCurrency:"BTC",toCurrency:"iso:ALL"},{fromCurrency:"BTC",toCurrency:"iso:AMD"},{fromCurrency:"BTC",toCurrency:"iso:ANG"},{fromCurrency:"BTC",toCurrency:"iso:AOA"},{fromCurrency:"BTC",toCurrency:"iso:ARS"},{fromCurrency:"BTC",toCurrency:"iso:AUD"},{fromCurrency:"BTC",toCurrency:"iso:AWG"},{fromCurrency:"BTC",toCurrency:"iso:AZN"},{fromCurrency:"BTC",toCurrency:"iso:BAM"},{fromCurrency:"BTC",toCurrency:"iso:BBD"},{fromCurrency:"BTC",toCurrency:"iso:BDT"},{fromCurrency:"BTC",toCurrency:"iso:BGN"},{fromCurrency:"BTC",toCurrency:"iso:BIF"},{fromCurrency:"BTC",toCurrency:"iso:BMD"},{fromCurrency:"BTC",toCurrency:"iso:BND"},{fromCurrency:"BTC",toCurrency:"iso:BOB"},{fromCurrency:"BTC",toCurrency:"iso:BRL"},{fromCurrency:"BTC",toCurrency:"iso:BSD"},{fromCurrency:"BTC",toCurrency:"iso:BTN"},{fromCurrency:"BTC",toCurrency:"iso:BWP"},{fromCurrency:"BTC",toCurrency:"iso:BYN"},{fromCurrency:"BTC",toCurrency:"iso:BZD"},{fromCurrency:"BTC",toCurrency:"iso:CAD"},{fromCurrency:"BTC",toCurrency:"iso:CDF"},{fromCurrency:"BTC",toCurrency:"iso:CHF"},{fromCurrency:"BTC",toCurrency:"iso:CLP"},{fromCurrency:"BTC",toCurrency:"iso:CNY"},{fromCurrency:"BTC",toCurrency:"iso:COP"},{fromCurrency:"BTC",toCurrency:"iso:CRC"},{fromCurrency:"BTC",toCurrency:"iso:CUC"},{fromCurrency:"BTC",toCurrency:"iso:CUP"},{fromCurrency:"BTC",toCurrency:"iso:CVE"},{fromCurrency:"BTC",toCurrency:"iso:CZK"},{fromCurrency:"BTC",toCurrency:"iso:DJF"},{fromCurrency:"BTC",toCurrency:"iso:DKK"},{fromCurrency:"BTC",toCurrency:"iso:DOP"},{fromCurrency:"BTC",toCurrency:"iso:DZD"},{fromCurrency:"BTC",toCurrency:"iso:EGP"},{fromCurrency:"BTC",toCurrency:"iso:ERN"},{fromCurrency:"BTC",toCurrency:"iso:ETB"},{fromCurrency:"BTC",toCurrency:"iso:EUR"},{fromCurrency:"BTC",toCurrency:"iso:FJD"},{fromCurrency:"BTC",toCurrency:"iso:FKP"},{fromCurrency:"BTC",toCurrency:"iso:GBP"},{fromCurrency:"BTC",toCurrency:"iso:GEL"},{fromCurrency:"BTC",toCurrency:"iso:GGP"},{fromCurrency:"BTC",toCurrency:"iso:GHS"},{fromCurrency:"BTC",toCurrency:"iso:GIP"},{fromCurrency:"BTC",toCurrency:"iso:GMD"},{fromCurrency:"BTC",toCurrency:"iso:GNF"},{fromCurrency:"BTC",toCurrency:"iso:GTQ"},{fromCurrency:"BTC",toCurrency:"iso:GYD"},{fromCurrency:"BTC",toCurrency:"iso:HKD"},{fromCurrency:"BTC",toCurrency:"iso:HNL"},{fromCurrency:"BTC",toCurrency:"iso:HRK"},{fromCurrency:"BTC",toCurrency:"iso:HTG"},{fromCurrency:"BTC",toCurrency:"iso:HUF"},{fromCurrency:"BTC",toCurrency:"iso:IDR"},{fromCurrency:"BTC",toCurrency:"iso:ILS"},{fromCurrency:"BTC",toCurrency:"iso:IMP"},{fromCurrency:"BTC",toCurrency:"iso:INR"},{fromCurrency:"BTC",toCurrency:"iso:IQD"},{fromCurrency:"BTC",toCurrency:"iso:IRR"},{fromCurrency:"BTC",toCurrency:"iso:ISK"},{fromCurrency:"BTC",toCurrency:"iso:JEP"},{fromCurrency:"BTC",toCurrency:"iso:JMD"},{fromCurrency:"BTC",toCurrency:"iso:JOD"},{fromCurrency:"BTC",toCurrency:"iso:JPY"},{fromCurrency:"BTC",toCurrency:"iso:KES"},{fromCurrency:"BTC",toCurrency:"iso:KGS"},{fromCurrency:"BTC",toCurrency:"iso:KHR"},{fromCurrency:"BTC",toCurrency:"iso:KMF"},{fromCurrency:"BTC",toCurrency:"iso:KPW"},{fromCurrency:"BTC",toCurrency:"iso:KRW"},{fromCurrency:"BTC",toCurrency:"iso:KWD"},{fromCurrency:"BTC",toCurrency:"iso:KYD"},{fromCurrency:"BTC",toCurrency:"iso:KZT"},{fromCurrency:"BTC",toCurrency:"iso:LAK"},{fromCurrency:"BTC",toCurrency:"iso:LBP"},{fromCurrency:"BTC",toCurrency:"iso:LKR"},{fromCurrency:"BTC",toCurrency:"iso:LRD"},{fromCurrency:"BTC",toCurrency:"iso:LSL"},{fromCurrency:"BTC",toCurrency:"iso:LYD"},{fromCurrency:"BTC",toCurrency:"iso:MAD"},{fromCurrency:"BTC",toCurrency:"iso:MDL"},{fromCurrency:"BTC",toCurrency:"iso:MGA"},{fromCurrency:"BTC",toCurrency:"iso:MKD"},{fromCurrency:"BTC",toCurrency:"iso:MMK"},{fromCurrency:"BTC",toCurrency:"iso:MNT"},{fromCurrency:"BTC",toCurrency:"iso:MOP"},{fromCurrency:"BTC",toCurrency:"iso:MRO"},{fromCurrency:"BTC",toCurrency:"iso:MRU"},{fromCurrency:"BTC",toCurrency:"iso:MUR"},{fromCurrency:"BTC",toCurrency:"iso:MWK"},{fromCurrency:"BTC",toCurrency:"iso:MXN"},{fromCurrency:"BTC",toCurrency:"iso:MYR"},{fromCurrency:"BTC",toCurrency:"iso:MZN"},{fromCurrency:"BTC",toCurrency:"iso:NAD"},{fromCurrency:"BTC",toCurrency:"iso:NGN"},{fromCurrency:"BTC",toCurrency:"iso:NIO"},{fromCurrency:"BTC",toCurrency:"iso:NOK"},{fromCurrency:"BTC",toCurrency:"iso:NPR"},{fromCurrency:"BTC",toCurrency:"iso:NZD"},{fromCurrency:"BTC",toCurrency:"iso:OMR"},{fromCurrency:"BTC",toCurrency:"iso:PAB"},{fromCurrency:"BTC",toCurrency:"iso:PEN"},{fromCurrency:"BTC",toCurrency:"iso:PGK"},{fromCurrency:"BTC",toCurrency:"iso:PHP"},{fromCurrency:"BTC",toCurrency:"iso:PKR"},{fromCurrency:"BTC",toCurrency:"iso:PLN"},{fromCurrency:"BTC",toCurrency:"iso:PRB"},{fromCurrency:"BTC",toCurrency:"iso:PYG"},{fromCurrency:"BTC",toCurrency:"iso:QAR"},{fromCurrency:"BTC",toCurrency:"iso:RON"},{fromCurrency:"BTC",toCurrency:"iso:RSD"},{fromCurrency:"BTC",toCurrency:"iso:RUB"},{fromCurrency:"BTC",toCurrency:"iso:RWF"},{fromCurrency:"BTC",toCurrency:"iso:SAR"},{fromCurrency:"BTC",toCurrency:"iso:SBD"},{fromCurrency:"BTC",toCurrency:"iso:SCR"},{fromCurrency:"BTC",toCurrency:"iso:SDG"},{fromCurrency:"BTC",toCurrency:"iso:SEK"},{fromCurrency:"BTC",toCurrency:"iso:SGD"},{fromCurrency:"BTC",toCurrency:"iso:SHP"},{fromCurrency:"BTC",toCurrency:"iso:SLL"},{fromCurrency:"BTC",toCurrency:"iso:SOS"},{fromCurrency:"BTC",toCurrency:"iso:SRD"},{fromCurrency:"BTC",toCurrency:"iso:SSP"},{fromCurrency:"BTC",toCurrency:"iso:STD"},{fromCurrency:"BTC",toCurrency:"iso:SYP"},{fromCurrency:"BTC",toCurrency:"iso:SZL"},{fromCurrency:"BTC",toCurrency:"iso:THB"},{fromCurrency:"BTC",toCurrency:"iso:TJS"},{fromCurrency:"BTC",toCurrency:"iso:TMT"},{fromCurrency:"BTC",toCurrency:"iso:TND"},{fromCurrency:"BTC",toCurrency:"iso:TOP"},{fromCurrency:"BTC",toCurrency:"iso:TRY"},{fromCurrency:"BTC",toCurrency:"iso:TTD"},{fromCurrency:"BTC",toCurrency:"iso:TVD"},{fromCurrency:"BTC",toCurrency:"iso:TWD"},{fromCurrency:"BTC",toCurrency:"iso:TZS"},{fromCurrency:"BTC",toCurrency:"iso:UAH"},{fromCurrency:"BTC",toCurrency:"iso:UGX"},{fromCurrency:"BTC",toCurrency:"iso:USD"},{fromCurrency:"BTC",toCurrency:"iso:UYU"},{fromCurrency:"BTC",toCurrency:"iso:UZS"},{fromCurrency:"BTC",toCurrency:"iso:VEF"},{fromCurrency:"BTC",toCurrency:"iso:VND"},{fromCurrency:"BTC",toCurrency:"iso:VUV"},{fromCurrency:"BTC",toCurrency:"iso:WST"},{fromCurrency:"BTC",toCurrency:"iso:XAF"},{fromCurrency:"BTC",toCurrency:"iso:XCD"},{fromCurrency:"BTC",toCurrency:"iso:XOF"},{fromCurrency:"BTC",toCurrency:"iso:XPF"},{fromCurrency:"BTC",toCurrency:"iso:YER"},{fromCurrency:"BTC",toCurrency:"iso:ZAR"},{fromCurrency:"BTC",toCurrency:"iso:ZMW"},{fromCurrency:"BCH",toCurrency:"iso:AED"},{fromCurrency:"BCH",toCurrency:"iso:AFN"},{fromCurrency:"BCH",toCurrency:"iso:ALL"},{fromCurrency:"BCH",toCurrency:"iso:AMD"},{fromCurrency:"BCH",toCurrency:"iso:ANG"},{fromCurrency:"BCH",toCurrency:"iso:AOA"},{fromCurrency:"BCH",toCurrency:"iso:ARS"},{fromCurrency:"BCH",toCurrency:"iso:AUD"},{fromCurrency:"BCH",toCurrency:"iso:AWG"},{fromCurrency:"BCH",toCurrency:"iso:AZN"},{fromCurrency:"BCH",toCurrency:"iso:BAM"},{fromCurrency:"BCH",toCurrency:"iso:BBD"},{fromCurrency:"BCH",toCurrency:"iso:BDT"},{fromCurrency:"BCH",toCurrency:"iso:BGN"},{fromCurrency:"BCH",toCurrency:"iso:BIF"},{fromCurrency:"BCH",toCurrency:"iso:BMD"},{fromCurrency:"BCH",toCurrency:"iso:BND"},{fromCurrency:"BCH",toCurrency:"iso:BOB"},{fromCurrency:"BCH",toCurrency:"iso:BRL"},{fromCurrency:"BCH",toCurrency:"iso:BSD"},{fromCurrency:"BCH",toCurrency:"iso:BTN"},{fromCurrency:"BCH",toCurrency:"iso:BWP"},{fromCurrency:"BCH",toCurrency:"iso:BYN"},{fromCurrency:"BCH",toCurrency:"iso:BZD"},{fromCurrency:"BCH",toCurrency:"iso:CAD"},{fromCurrency:"BCH",toCurrency:"iso:CDF"},{fromCurrency:"BCH",toCurrency:"iso:CHF"},{fromCurrency:"BCH",toCurrency:"iso:CLP"},{fromCurrency:"BCH",toCurrency:"iso:CNY"},{fromCurrency:"BCH",toCurrency:"iso:COP"},{fromCurrency:"BCH",toCurrency:"iso:CRC"},{fromCurrency:"BCH",toCurrency:"iso:CUC"},{fromCurrency:"BCH",toCurrency:"iso:CUP"},{fromCurrency:"BCH",toCurrency:"iso:CVE"},{fromCurrency:"BCH",toCurrency:"iso:CZK"},{fromCurrency:"BCH",toCurrency:"iso:DJF"},{fromCurrency:"BCH",toCurrency:"iso:DKK"},{fromCurrency:"BCH",toCurrency:"iso:DOP"},{fromCurrency:"BCH",toCurrency:"iso:DZD"},{fromCurrency:"BCH",toCurrency:"iso:EGP"},{fromCurrency:"BCH",toCurrency:"iso:ERN"},{fromCurrency:"BCH",toCurrency:"iso:ETB"},{fromCurrency:"BCH",toCurrency:"iso:EUR"},{fromCurrency:"BCH",toCurrency:"iso:FJD"},{fromCurrency:"BCH",toCurrency:"iso:FKP"},{fromCurrency:"BCH",toCurrency:"iso:GBP"},{fromCurrency:"BCH",toCurrency:"iso:GEL"},{fromCurrency:"BCH",toCurrency:"iso:GGP"},{fromCurrency:"BCH",toCurrency:"iso:GHS"},{fromCurrency:"BCH",toCurrency:"iso:GIP"},{fromCurrency:"BCH",toCurrency:"iso:GMD"},{fromCurrency:"BCH",toCurrency:"iso:GNF"},{fromCurrency:"BCH",toCurrency:"iso:GTQ"},{fromCurrency:"BCH",toCurrency:"iso:GYD"},{fromCurrency:"BCH",toCurrency:"iso:HKD"},{fromCurrency:"BCH",toCurrency:"iso:HNL"},{fromCurrency:"BCH",toCurrency:"iso:HRK"},{fromCurrency:"BCH",toCurrency:"iso:HTG"},{fromCurrency:"BCH",toCurrency:"iso:HUF"},{fromCurrency:"BCH",toCurrency:"iso:IDR"},{fromCurrency:"BCH",toCurrency:"iso:ILS"},{fromCurrency:"BCH",toCurrency:"iso:IMP"},{fromCurrency:"BCH",toCurrency:"iso:INR"},{fromCurrency:"BCH",toCurrency:"iso:IQD"},{fromCurrency:"BCH",toCurrency:"iso:IRR"},{fromCurrency:"BCH",toCurrency:"iso:ISK"},{fromCurrency:"BCH",toCurrency:"iso:JEP"},{fromCurrency:"BCH",toCurrency:"iso:JMD"},{fromCurrency:"BCH",toCurrency:"iso:JOD"},{fromCurrency:"BCH",toCurrency:"iso:JPY"},{fromCurrency:"BCH",toCurrency:"iso:KES"},{fromCurrency:"BCH",toCurrency:"iso:KGS"},{fromCurrency:"BCH",toCurrency:"iso:KHR"},{fromCurrency:"BCH",toCurrency:"iso:KMF"},{fromCurrency:"BCH",toCurrency:"iso:KPW"},{fromCurrency:"BCH",toCurrency:"iso:KRW"},{fromCurrency:"BCH",toCurrency:"iso:KWD"},{fromCurrency:"BCH",toCurrency:"iso:KYD"},{fromCurrency:"BCH",toCurrency:"iso:KZT"},{fromCurrency:"BCH",toCurrency:"iso:LAK"},{fromCurrency:"BCH",toCurrency:"iso:LBP"},{fromCurrency:"BCH",toCurrency:"iso:LKR"},{fromCurrency:"BCH",toCurrency:"iso:LRD"},{fromCurrency:"BCH",toCurrency:"iso:LSL"},{fromCurrency:"BCH",toCurrency:"iso:LYD"},{fromCurrency:"BCH",toCurrency:"iso:MAD"},{fromCurrency:"BCH",toCurrency:"iso:MDL"},{fromCurrency:"BCH",toCurrency:"iso:MGA"},{fromCurrency:"BCH",toCurrency:"iso:MKD"},{fromCurrency:"BCH",toCurrency:"iso:MMK"},{fromCurrency:"BCH",toCurrency:"iso:MNT"},{fromCurrency:"BCH",toCurrency:"iso:MOP"},{fromCurrency:"BCH",toCurrency:"iso:MRO"},{fromCurrency:"BCH",toCurrency:"iso:MRU"},{fromCurrency:"BCH",toCurrency:"iso:MUR"},{fromCurrency:"BCH",toCurrency:"iso:MWK"},{fromCurrency:"BCH",toCurrency:"iso:MXN"},{fromCurrency:"BCH",toCurrency:"iso:MYR"},{fromCurrency:"BCH",toCurrency:"iso:MZN"},{fromCurrency:"BCH",toCurrency:"iso:NAD"},{fromCurrency:"BCH",toCurrency:"iso:NGN"},{fromCurrency:"BCH",toCurrency:"iso:NIO"},{fromCurrency:"BCH",toCurrency:"iso:NOK"},{fromCurrency:"BCH",toCurrency:"iso:NPR"},{fromCurrency:"BCH",toCurrency:"iso:NZD"},{fromCurrency:"BCH",toCurrency:"iso:OMR"},{fromCurrency:"BCH",toCurrency:"iso:PAB"},{fromCurrency:"BCH",toCurrency:"iso:PEN"},{fromCurrency:"BCH",toCurrency:"iso:PGK"},{fromCurrency:"BCH",toCurrency:"iso:PHP"},{fromCurrency:"BCH",toCurrency:"iso:PKR"},{fromCurrency:"BCH",toCurrency:"iso:PLN"},{fromCurrency:"BCH",toCurrency:"iso:PRB"},{fromCurrency:"BCH",toCurrency:"iso:PYG"},{fromCurrency:"BCH",toCurrency:"iso:QAR"},{fromCurrency:"BCH",toCurrency:"iso:RON"},{fromCurrency:"BCH",toCurrency:"iso:RSD"},{fromCurrency:"BCH",toCurrency:"iso:RUB"},{fromCurrency:"BCH",toCurrency:"iso:RWF"},{fromCurrency:"BCH",toCurrency:"iso:SAR"},{fromCurrency:"BCH",toCurrency:"iso:SBD"},{fromCurrency:"BCH",toCurrency:"iso:SCR"},{fromCurrency:"BCH",toCurrency:"iso:SDG"},{fromCurrency:"BCH",toCurrency:"iso:SEK"},{fromCurrency:"BCH",toCurrency:"iso:SGD"},{fromCurrency:"BCH",toCurrency:"iso:SHP"},{fromCurrency:"BCH",toCurrency:"iso:SLL"},{fromCurrency:"BCH",toCurrency:"iso:SOS"},{fromCurrency:"BCH",toCurrency:"iso:SRD"},{fromCurrency:"BCH",toCurrency:"iso:SSP"},{fromCurrency:"BCH",toCurrency:"iso:STD"},{fromCurrency:"BCH",toCurrency:"iso:SYP"},{fromCurrency:"BCH",toCurrency:"iso:SZL"},{fromCurrency:"BCH",toCurrency:"iso:THB"},{fromCurrency:"BCH",toCurrency:"iso:TJS"},{fromCurrency:"BCH",toCurrency:"iso:TMT"},{fromCurrency:"BCH",toCurrency:"iso:TND"},{fromCurrency:"BCH",toCurrency:"iso:TOP"},{fromCurrency:"BCH",toCurrency:"iso:TRY"},{fromCurrency:"BCH",toCurrency:"iso:TTD"},{fromCurrency:"BCH",toCurrency:"iso:TVD"},{fromCurrency:"BCH",toCurrency:"iso:TWD"},{fromCurrency:"BCH",toCurrency:"iso:TZS"},{fromCurrency:"BCH",toCurrency:"iso:UAH"},{fromCurrency:"BCH",toCurrency:"iso:UGX"},{fromCurrency:"BCH",toCurrency:"iso:USD"},{fromCurrency:"BCH",toCurrency:"iso:UYU"},{fromCurrency:"BCH",toCurrency:"iso:UZS"},{fromCurrency:"BCH",toCurrency:"iso:VEF"},{fromCurrency:"BCH",toCurrency:"iso:VND"},{fromCurrency:"BCH",toCurrency:"iso:VUV"},{fromCurrency:"BCH",toCurrency:"iso:WST"},{fromCurrency:"BCH",toCurrency:"iso:XAF"},{fromCurrency:"BCH",toCurrency:"iso:XCD"},{fromCurrency:"BCH",toCurrency:"iso:XOF"},{fromCurrency:"BCH",toCurrency:"iso:XPF"},{fromCurrency:"BCH",toCurrency:"iso:YER"},{fromCurrency:"BCH",toCurrency:"iso:ZAR"},{fromCurrency:"BCH",toCurrency:"iso:ZMW"},{fromCurrency:"ETH",toCurrency:"iso:AED"},{fromCurrency:"ETH",toCurrency:"iso:AFN"},{fromCurrency:"ETH",toCurrency:"iso:ALL"},{fromCurrency:"ETH",toCurrency:"iso:AMD"},{fromCurrency:"ETH",toCurrency:"iso:ANG"},{fromCurrency:"ETH",toCurrency:"iso:AOA"},{fromCurrency:"ETH",toCurrency:"iso:ARS"},{fromCurrency:"ETH",toCurrency:"iso:AUD"},{fromCurrency:"ETH",toCurrency:"iso:AWG"},{fromCurrency:"ETH",toCurrency:"iso:AZN"},{fromCurrency:"ETH",toCurrency:"iso:BAM"},{fromCurrency:"ETH",toCurrency:"iso:BBD"},{fromCurrency:"ETH",toCurrency:"iso:BDT"},{fromCurrency:"ETH",toCurrency:"iso:BGN"},{fromCurrency:"ETH",toCurrency:"iso:BIF"},{fromCurrency:"ETH",toCurrency:"iso:BMD"},{fromCurrency:"ETH",toCurrency:"iso:BND"},{fromCurrency:"ETH",toCurrency:"iso:BOB"},{fromCurrency:"ETH",toCurrency:"iso:BRL"},{fromCurrency:"ETH",toCurrency:"iso:BSD"},{fromCurrency:"ETH",toCurrency:"iso:BTN"},{fromCurrency:"ETH",toCurrency:"iso:BWP"},{fromCurrency:"ETH",toCurrency:"iso:BYN"},{fromCurrency:"ETH",toCurrency:"iso:BZD"},{fromCurrency:"ETH",toCurrency:"iso:CAD"},{fromCurrency:"ETH",toCurrency:"iso:CDF"},{fromCurrency:"ETH",toCurrency:"iso:CHF"},{fromCurrency:"ETH",toCurrency:"iso:CLP"},{fromCurrency:"ETH",toCurrency:"iso:CNY"},{fromCurrency:"ETH",toCurrency:"iso:COP"},{fromCurrency:"ETH",toCurrency:"iso:CRC"},{fromCurrency:"ETH",toCurrency:"iso:CUC"},{fromCurrency:"ETH",toCurrency:"iso:CUP"},{fromCurrency:"ETH",toCurrency:"iso:CVE"},{fromCurrency:"ETH",toCurrency:"iso:CZK"},{fromCurrency:"ETH",toCurrency:"iso:DJF"},{fromCurrency:"ETH",toCurrency:"iso:DKK"},{fromCurrency:"ETH",toCurrency:"iso:DOP"},{fromCurrency:"ETH",toCurrency:"iso:DZD"},{fromCurrency:"ETH",toCurrency:"iso:EGP"},{fromCurrency:"ETH",toCurrency:"iso:ERN"},{fromCurrency:"ETH",toCurrency:"iso:ETB"},{fromCurrency:"ETH",toCurrency:"iso:EUR"},{fromCurrency:"ETH",toCurrency:"iso:FJD"},{fromCurrency:"ETH",toCurrency:"iso:FKP"},{fromCurrency:"ETH",toCurrency:"iso:GBP"},{fromCurrency:"ETH",toCurrency:"iso:GEL"},{fromCurrency:"ETH",toCurrency:"iso:GGP"},{fromCurrency:"ETH",toCurrency:"iso:GHS"},{fromCurrency:"ETH",toCurrency:"iso:GIP"},{fromCurrency:"ETH",toCurrency:"iso:GMD"},{fromCurrency:"ETH",toCurrency:"iso:GNF"},{fromCurrency:"ETH",toCurrency:"iso:GTQ"},{fromCurrency:"ETH",toCurrency:"iso:GYD"},{fromCurrency:"ETH",toCurrency:"iso:HKD"},{fromCurrency:"ETH",toCurrency:"iso:HNL"},{fromCurrency:"ETH",toCurrency:"iso:HRK"},{fromCurrency:"ETH",toCurrency:"iso:HTG"},{fromCurrency:"ETH",toCurrency:"iso:HUF"},{fromCurrency:"ETH",toCurrency:"iso:IDR"},{fromCurrency:"ETH",toCurrency:"iso:ILS"},{fromCurrency:"ETH",toCurrency:"iso:IMP"},{fromCurrency:"ETH",toCurrency:"iso:INR"},{fromCurrency:"ETH",toCurrency:"iso:IQD"},{fromCurrency:"ETH",toCurrency:"iso:IRR"},{fromCurrency:"ETH",toCurrency:"iso:ISK"},{fromCurrency:"ETH",toCurrency:"iso:JEP"},{fromCurrency:"ETH",toCurrency:"iso:JMD"},{fromCurrency:"ETH",toCurrency:"iso:JOD"},{fromCurrency:"ETH",toCurrency:"iso:JPY"},{fromCurrency:"ETH",toCurrency:"iso:KES"},{fromCurrency:"ETH",toCurrency:"iso:KGS"},{fromCurrency:"ETH",toCurrency:"iso:KHR"},{fromCurrency:"ETH",toCurrency:"iso:KMF"},{fromCurrency:"ETH",toCurrency:"iso:KPW"},{fromCurrency:"ETH",toCurrency:"iso:KRW"},{fromCurrency:"ETH",toCurrency:"iso:KWD"},{fromCurrency:"ETH",toCurrency:"iso:KYD"},{fromCurrency:"ETH",toCurrency:"iso:KZT"},{fromCurrency:"ETH",toCurrency:"iso:LAK"},{fromCurrency:"ETH",toCurrency:"iso:LBP"},{fromCurrency:"ETH",toCurrency:"iso:LKR"},{fromCurrency:"ETH",toCurrency:"iso:LRD"},{fromCurrency:"ETH",toCurrency:"iso:LSL"},{fromCurrency:"ETH",toCurrency:"iso:LYD"},{fromCurrency:"ETH",toCurrency:"iso:MAD"},{fromCurrency:"ETH",toCurrency:"iso:MDL"},{fromCurrency:"ETH",toCurrency:"iso:MGA"},{fromCurrency:"ETH",toCurrency:"iso:MKD"},{fromCurrency:"ETH",toCurrency:"iso:MMK"},{fromCurrency:"ETH",toCurrency:"iso:MNT"},{fromCurrency:"ETH",toCurrency:"iso:MOP"},{fromCurrency:"ETH",toCurrency:"iso:MRO"},{fromCurrency:"ETH",toCurrency:"iso:MRU"},{fromCurrency:"ETH",toCurrency:"iso:MUR"},{fromCurrency:"ETH",toCurrency:"iso:MWK"},{fromCurrency:"ETH",toCurrency:"iso:MXN"},{fromCurrency:"ETH",toCurrency:"iso:MYR"},{fromCurrency:"ETH",toCurrency:"iso:MZN"},{fromCurrency:"ETH",toCurrency:"iso:NAD"},{fromCurrency:"ETH",toCurrency:"iso:NGN"},{fromCurrency:"ETH",toCurrency:"iso:NIO"},{fromCurrency:"ETH",toCurrency:"iso:NOK"},{fromCurrency:"ETH",toCurrency:"iso:NPR"},{fromCurrency:"ETH",toCurrency:"iso:NZD"},{fromCurrency:"ETH",toCurrency:"iso:OMR"},{fromCurrency:"ETH",toCurrency:"iso:PAB"},{fromCurrency:"ETH",toCurrency:"iso:PEN"},{fromCurrency:"ETH",toCurrency:"iso:PGK"},{fromCurrency:"ETH",toCurrency:"iso:PHP"},{fromCurrency:"ETH",toCurrency:"iso:PKR"},{fromCurrency:"ETH",toCurrency:"iso:PLN"},{fromCurrency:"ETH",toCurrency:"iso:PRB"},{fromCurrency:"ETH",toCurrency:"iso:PYG"},{fromCurrency:"ETH",toCurrency:"iso:QAR"},{fromCurrency:"ETH",toCurrency:"iso:RON"},{fromCurrency:"ETH",toCurrency:"iso:RSD"},{fromCurrency:"ETH",toCurrency:"iso:RUB"},{fromCurrency:"ETH",toCurrency:"iso:RWF"},{fromCurrency:"ETH",toCurrency:"iso:SAR"},{fromCurrency:"ETH",toCurrency:"iso:SBD"},{fromCurrency:"ETH",toCurrency:"iso:SCR"},{fromCurrency:"ETH",toCurrency:"iso:SDG"},{fromCurrency:"ETH",toCurrency:"iso:SEK"},{fromCurrency:"ETH",toCurrency:"iso:SGD"},{fromCurrency:"ETH",toCurrency:"iso:SHP"},{fromCurrency:"ETH",toCurrency:"iso:SLL"},{fromCurrency:"ETH",toCurrency:"iso:SOS"},{fromCurrency:"ETH",toCurrency:"iso:SRD"},{fromCurrency:"ETH",toCurrency:"iso:SSP"},{fromCurrency:"ETH",toCurrency:"iso:STD"},{fromCurrency:"ETH",toCurrency:"iso:SYP"},{fromCurrency:"ETH",toCurrency:"iso:SZL"},{fromCurrency:"ETH",toCurrency:"iso:THB"},{fromCurrency:"ETH",toCurrency:"iso:TJS"},{fromCurrency:"ETH",toCurrency:"iso:TMT"},{fromCurrency:"ETH",toCurrency:"iso:TND"},{fromCurrency:"ETH",toCurrency:"iso:TOP"},{fromCurrency:"ETH",toCurrency:"iso:TRY"},{fromCurrency:"ETH",toCurrency:"iso:TTD"},{fromCurrency:"ETH",toCurrency:"iso:TVD"},{fromCurrency:"ETH",toCurrency:"iso:TWD"},{fromCurrency:"ETH",toCurrency:"iso:TZS"},{fromCurrency:"ETH",toCurrency:"iso:UAH"},{fromCurrency:"ETH",toCurrency:"iso:UGX"},{fromCurrency:"ETH",toCurrency:"iso:USD"},{fromCurrency:"ETH",toCurrency:"iso:UYU"},{fromCurrency:"ETH",toCurrency:"iso:UZS"},{fromCurrency:"ETH",toCurrency:"iso:VEF"},{fromCurrency:"ETH",toCurrency:"iso:VND"},{fromCurrency:"ETH",toCurrency:"iso:VUV"},{fromCurrency:"ETH",toCurrency:"iso:WST"},{fromCurrency:"ETH",toCurrency:"iso:XAF"},{fromCurrency:"ETH",toCurrency:"iso:XCD"},{fromCurrency:"ETH",toCurrency:"iso:XOF"},{fromCurrency:"ETH",toCurrency:"iso:XPF"},{fromCurrency:"ETH",toCurrency:"iso:YER"},{fromCurrency:"ETH",toCurrency:"iso:ZAR"},{fromCurrency:"ETH",toCurrency:"iso:ZMW"}];function Ii(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oi(e,t,r,n){t===e.toCurrency&&(e.bestRate=r),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ii(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n),n[t]=!0;for(var o=0,i=Object.keys(e.routes[t]);o<i.length;o++){var a=i[o];if(!n[a]){for(var u={rate:0,cost:1/0},s=e.routes[t][a],c=0;c<s.length;c++){var f=s[c],l=e.pairs[f],d=l.fromCurrency!==t,h=r.cost+e.getPairCost(l.source,e.now-l.timestamp,d);if(h<u.cost)u={rate:d?r.rate/l.rate:r.rate*l.rate,cost:h}}u.cost<e.bestRate.cost&&Oi(e,a,u,n)}}}function Ti(e){return/^iso:/.test(e)}function ki(e,t,r,n){var o=e.exchangeCache.rates,i=o.routes,a=o.pairs,u={now:Date.now()/1e3,routes:i,pairs:a,toCurrency:r,getPairCost:n,bestRate:{rate:0,cost:1/0}};return u.routes[t]&&u.routes[r]?(Oi(u,t,{rate:1,cost:0},{}),Ti(t)||function(e,t){for(var r=[],n=0,o=Object.keys(e.routes[t]);n<o.length;n++)for(var i=o[n],a=0,u=Object.keys(e.routes[i]);a<u.length;a++){if(Ti(u[a]))return;r.push({fromCurrency:i,toCurrency:"iso:USD"})}r.forEach((function(e){return _i(e.fromCurrency,e.toCurrency)}))}(u,t)):_i(t,r),u.bestRate.rate}var Pi={edgeRates:.15,nomics:.1,coincap:-.05,coinbase:-.1,coinmonitor:-.2,wazirx:-.15,constantRate:-.25};function Bi(e,t){return Ri.apply(this,arguments)}function Ri(){return Ri=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=tn(r,n.loginId),i=o.stashTree,e.next=3,Xr(r,"POST","/v2/login/delete",Jn(i,n));case 3:case"end":return e.stop()}}),e)}))),Ri.apply(this,arguments)}var ji=ve(Le),Mi=Qr;function Ni(e,t){return xe(e)+t}function Di(e,t,r,n){return Li.apply(this,arguments)}function Li(){return(Li=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p,y;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.now,u=void 0===a?new Date:a,s=en(r,n),c=s.passwordBox,f=s.passwordKeySnrp,null!=c&&null!=f){e.next=5;break}throw new Error("Missing data for offline password login");case 5:return l=Ni(n,o),e.next=8,$r(r,l,f);case 8:return d=e.sent,h=Bt(c,d),p=Dn(s,h),s.lastLogin=u,cn(r,s).catch((function(){})),y=r.props.log,Vn(r,p,p).catch((function(e){return y.error(e)})),e.abrupt("return",p);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ui(e,t,r,n){return Hi.apply(this,arguments)}function Hi(){return Hi=o()(t().mark((function e(r,n,i,u){var s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=en(r,n),c=Ni(n,i),e.next=4,Promise.all([nn(r,n),$r(r,c,Mi)]);case 4:return f=e.sent,l=a()(f,2),d=l[0],h=l[1],p={userId:d,passwordAuth:h},e.abrupt("return",Un(r,s,s,u,p,function(){var e=o()(t().mark((function e(n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.passwordBox,i=n.passwordKeySnrp,null!=o&&null!=i){e.next=3;break}throw new Error("Missing data for online password login");case 3:return e.next=5,$r(r,c,i);case 5:return a=e.sent,e.abrupt("return",Bt(o,a));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 10:case"end":return e.stop()}}),e)}))),Hi.apply(this,arguments)}function Ki(e,t,r,n){return Fi.apply(this,arguments)}function Fi(){return(Fi=o()(t().mark((function e(r,n,o,i){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Di(r,n,o,i).catch((function(){return Ui(r,n,o,i)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gi(e,t,r){return qi.apply(this,arguments)}function qi(){return(qi=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.state.accounts[n],a=i.loginTree,u=i.username,e.next=3,Ji(r,a,u,o);case 3:return s=e.sent,e.next=6,Kn(r,a,s);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zi(e,t,r){return Wi.apply(this,arguments)}function Wi(){return Wi=o()(t().mark((function e(r,n,o){var i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.username,a=n.passwordAuth,null!=i&&null!=a){e.next=3;break}return e.abrupt("return",!1);case 3:return u=Ni(i,o),e.next=6,$r(r,u,Mi);case 6:s=e.sent,c=0;case 8:if(!(c<a.length)){e.next=14;break}if(s[c]===a[c]){e.next=11;break}return e.abrupt("return",!1);case 11:++c,e.next=8;break;case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e)}))),Wi.apply(this,arguments)}function Vi(e,t){return Yi.apply(this,arguments)}function Yi(){return(Yi=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i={serverMethod:"DELETE",serverPath:"/v2/login/password",stash:{passwordAuthSnrp:void 0,passwordBox:void 0,passwordKeySnrp:void 0},login:{passwordAuth:void 0},loginId:o.loginId},null!=o.loginAuth&&(i.stash.passwordAuthBox=void 0,i.login.passwordAuth=void 0),e.next=5,Kn(r,o,i);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ji(e,t,r,n){var o=Ni(r,n),i=e.props.io,u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;return e.props.output.scrypt.makeSnrp(t)}(e).then((function(r){return $r(e,o,r).then((function(e){var n=Rt(i,t.loginKey,e);return{passwordKeySnrp:r,passwordBox:n}}))})),s=$r(e,o,Mi).then((function(e){return{passwordAuth:e,passwordAuthBox:Rt(i,e,t.loginKey)}}));return Promise.all([u,s]).then((function(e){var r=a()(e,2),n=r[0],o=n.passwordKeySnrp,i=n.passwordBox,u=r[1],s=u.passwordAuth,c=u.passwordAuthBox;return{serverPath:"/v2/login/password",server:ji({passwordAuth:s,passwordAuthSnrp:Mi,passwordKeySnrp:o,passwordBox:i,passwordAuthBox:c}),stash:{passwordKeySnrp:o,passwordBox:i,passwordAuthBox:c},login:{passwordAuth:s},loginId:t.loginId}}))}var Zi=ve(Ue);function Xi(e,t){return It(st(xe(t)),e)}function $i(e,t){return It(st(t),e)}function Qi(e,t){if(null!=e.pin2Key)return e;var r=Bn(e,(function(e){return e.appId===t}));return null!=r&&null!=r.pin2Key?r:void 0}function ea(e,t,r,n,o){return ta.apply(this,arguments)}function ta(){return ta=o()(t().mark((function e(r,n,i,a,u){var s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=en(r,i),null!=(c=Qi(s,n))&&null!=c.pin2Key){e.next=4;break}throw new Error("PIN login is not enabled for this account on this device");case 4:return f=c.pin2Key,l={pin2Id:Xi(f,i),pin2Auth:$i(f,a)},e.abrupt("return",Un(r,s,c,u,l,function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.pin2Box){e.next=2;break}throw new Error("Missing data for PIN v2 login");case 2:return e.abrupt("return",Bt(r.pin2Box,f));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 7:case"end":return e.stop()}}),e)}))),ta.apply(this,arguments)}function ra(e,t,r,n){return na.apply(this,arguments)}function na(){return(na=o()(t().mark((function e(r,n,o,i){var a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.props.state.accounts[n],u=a.loginTree,s=a.username,null==i&&(i=null!=u.pin2Key||null!=o&&null==u.pin),null==o&&(o=u.pin),null!=o){e.next=9;break}if(!i){e.next=6;break}throw new Error("Please change your PIN in the settings area above before enabling.");case 6:return e.next=8,Gn(r,u,fa(u));case 8:return e.abrupt("return");case 9:return c=sa(r,u,s,o,i),e.next=12,Gn(r,u,c);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oa(e,t,r){return ia.apply(this,arguments)}function ia(){return ia=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.appId,null!=(a=n.username)){e.next=3;break}return e.abrupt("return",!1);case 3:if(u=en(r,a),null!=(s=Qi(u,i))&&null!=s.pin2Key){e.next=7;break}throw new Error("No PIN set locally for this account");case 7:return c=s.pin2Key,f={pin2Id:Xi(c,a),pin2Auth:$i(c,o),otp:vn(n)},e.abrupt("return",Xr(r,"POST","/v2/login",f).then((function(e){return!0}),(function(e){return!1})));case 10:case"end":return e.stop()}}),e)}))),ia.apply(this,arguments)}function aa(e,t){return ua.apply(this,arguments)}function ua(){return(ua=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i=fa(o),e.next=4,Gn(r,o,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sa(e,t,r,n,o){for(var i=[ca(e,t,r,n,o)],a=0,u=t.children;a<u.length;a++){var s=u[a];i.push.apply(i,lt()(sa(e,s,r,n,o)))}return i}function ca(e,t,r,n,o){var i=e.props.io,a=Rt(i,st(n),t.loginKey);if(o){var u=t.loginId,s=t.loginKey,c=t.pin2Key,f=void 0===c?i.random(32):c,l=Rt(i,s,f),d=Rt(i,f,s);return{serverPath:"/v2/login/pin2",server:Zi({pin2Id:Xi(f,r),pin2Auth:$i(f,n),pin2Box:l,pin2KeyBox:d,pin2TextBox:a}),stash:{pin2Key:f,pin2TextBox:a},login:{pin2Key:f,pin:n},loginId:u}}return{serverPath:"/v2/login/pin2",server:Zi({pin2Id:void 0,pin2Auth:void 0,pin2Box:void 0,pin2KeyBox:void 0,pin2TextBox:a}),stash:{pin2Key:void 0,pin2TextBox:a},login:{pin2Key:void 0,pin:n},loginId:t.loginId}}function fa(e){for(var t=[la(e)],r=0,n=e.children;r<n.length;r++){var o=n[r];t.push.apply(t,lt()(fa(o)))}return t}function la(e){return{serverMethod:"DELETE",serverPath:"/v2/login/pin2",server:void 0,stash:{pin2Key:void 0},login:{pin2Key:void 0},loginId:e.loginId}}var da=ve(He);function ha(e,t){return It(st(xe(t)),e)}function pa(e,t){return t.map((function(t){return It(st(t),e)}))}function ya(e,t,r,n,o){return ba.apply(this,arguments)}function ba(){return ba=o()(t().mark((function e(r,n,i,a,u){var s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=en(r,i),c={recovery2Id:ha(n,i),recovery2Auth:pa(n,a)},e.abrupt("return",Un(r,s,s,u,c,function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.recovery2Box){e.next=2;break}throw new Error("Missing data for recovery v2 login");case 2:return e.abrupt("return",Bt(r.recovery2Box,n));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)}))),ba.apply(this,arguments)}function va(e,t,r){return Xr(e,"POST","/v2/login",{recovery2Id:ha(t,r)}).then((function(e){var r=$e(e).question2Box;if(null==r)throw new Error("Login has no recovery questions");return JSON.parse(Pt(r,t))}))}function ga(e,t,r,n){return ma.apply(this,arguments)}function ma(){return(ma=o()(t().mark((function e(r,n,o,i){var a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.state.accounts[n],u=a.loginTree,s=a.username,c=_a(r,u,s,o,i),e.next=4,Kn(r,u,c);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wa(e,t){return Ea.apply(this,arguments)}function Ea(){return(Ea=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state.accounts[n].loginTree,i={serverMethod:"DELETE",serverPath:"/v2/login/recovery2",stash:{recovery2Key:void 0},login:{recovery2Key:void 0},loginId:o.loginId},e.next=4,Kn(r,o,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _a(e,t,r,n,o){var i=e.props.io;if(!Array.isArray(n))throw new TypeError("Questions must be an array of strings");if(!Array.isArray(o))throw new TypeError("Answers must be an array of strings");var a=t.loginId,u=t.loginKey,s=t.recovery2Key,c=void 0===s?i.random(32):s,f=Rt(i,st(JSON.stringify(n)),c),l=Rt(i,u,c),d=Rt(i,c,u);return{serverPath:"/v2/login/recovery2",server:da({recovery2Id:ha(c,r),recovery2Auth:pa(c,o),recovery2Box:l,recovery2KeyBox:d,question2Box:f}),stash:{recovery2Key:c},login:{recovery2Key:c},loginId:a}}function Ca(e){return xa.apply(this,arguments)}function xa(){return(xa=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Xe,e.next=3,Xr(r,"POST","/v1/questions",{});case 3:return e.t1=e.sent,e.abrupt("return",(0,e.t0)(e.t1));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Aa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sa(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ia=ve(Fe);function Oa(e,t,r){return Ta.apply(this,arguments)}function Ta(){return Ta=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=tn(r,n.loginId),a=i.stashTree,e.next=3,Xr(r,"POST","/v2/login/vouchers",Aa(Aa({},Jn(a,n)),{},{data:Ia(o)}));case 3:return u=e.sent,s=Mn(a,n.loginKey,We(u)),e.abrupt("return",cn(r,s));case 6:case"end":return e.stop()}}),e)}))),Ta.apply(this,arguments)}function ka(e,r){var n=r.id,i=r.type,a=r.keys;return{id:n,type:i,keys:a,get disklet(){return Gt(e.props.state,n)},get localDisklet(){return qt(e.props.state,n)},sync:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,hi(e,n);case 2:case"end":return t.stop()}}),r)})))()}}}var Pa=r(3550);function Ba(e){return!!(e.startsWith("0x")||e.startsWith("-0x")||e.toLowerCase().includes("a")||e.toLowerCase().includes("b")||e.toLowerCase().includes("c")||e.toLowerCase().includes("d")||e.toLowerCase().includes("e")||e.toLowerCase().includes("f"))}function Ra(e){return e.replace("0x","")}function ja(e,t){for(var r=e,n=0;n<t;n++)r+="0";return r}function Ma(e){var t=e.replace(/^0+/,"");return(t=t.replace(/^\.+/,"0.")).includes(".")&&""===(t=(t=t.replace(/0+$/,"")).replace(/\.+$/,""))&&(t="0"),""===t&&(t="0"),t}function Na(e,t){if(0===t)return e;var r=!1;"-"===e.slice(0,1)&&(r=!0,e=e.slice(1));var n=void 0;return n=Ma(n=t>e.length?"0."+ja("",t-e.length)+e:e.substr(0,e.length-t)+"."+e.substr(e.length-t,e.length)),r&&(n="-"+n),n}function Da(e,t,r){var n=e,o=t;La(n,o);var i=n.indexOf("."),a=o.indexOf("."),u=Ba(n),s=Ba(o);if(-1!==i&&(i=(n=Ma(n)).indexOf(".")),-1!==a&&(a=(o=Ma(o)).indexOf(".")),-1!==i||-1!==a||"number"==typeof r){if(u||s)throw new Error("Cannot operate on base16 float values");var c=0,f=0;-1!==i&&(c=n.length-i-1),-1!==a&&(f=o.length-a-1);var l=c>f?c:f,d=0;return"number"==typeof r&&(d=r),{x:n=ja(n.replace(".",""),l+d-c),y:o=ja(o.replace(".",""),l-f),shift:l}}return{x:n,y:o,shift:0}}function La(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var s=a.value;if(s.split(".").length-1>1)throw new Error("Invalid number: more than one decimal point");if(s.split("-").length-1>1)throw new Error("Invalid number: more than one negative sign")}}catch(c){o=!0,i=c}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}}function Ua(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(10!==r&&16!==r)throw new Error("Unsupported base");var n=Da(e,t),o=n.x,i=n.y,a=n.shift,u=Ba(o)?16:10,s=Ba(i)?16:10;o=Ra(o),i=Ra(i);var c=new Pa(o,u),f=new Pa(i,s),l=c.add(f).toString(r);return l=Na(l,a),10===r?l:"0x"+l}function Ha(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(10!==r&&16!==r)throw new Error("Unsupported base");var n=Da(e,t),o=n.x,i=n.y,a=n.shift,u=Ba(o)?16:10,s=Ba(i)?16:10;o=Ra(o),i=Ra(i);var c=new Pa(o,u),f=new Pa(i,s),l=c.mul(f).toString(r);return l=Na(l,2*a),10===r?l:"0x"+l}function Ka(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(10!==r&&16!==r)throw new Error("Unsupported base");var n=Da(e,t),o=n.x,i=n.y,a=n.shift,u=Ba(o)?16:10,s=Ba(i)?16:10;o=Ra(o),i=Ra(i);var c=new Pa(o,u),f=new Pa(i,s),l=c.sub(f).toString(r);return l=Na(l,a),10===r?l:"0x"+l}function Fa(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;if(10!==n&&r>0)throw new Error("Cannot operate on floating point hex values");if(10!==n&&16!==n)throw new Error("Unsupported base");var o=Da(e,t,r),i=o.x,a=o.y,u=Ba(i)?16:10,s=Ba(a)?16:10;i=Ra(i),a=Ra(a);var c=new Pa(i,u),f=new Pa(a,s),l=c.div(f).toString(n);return l=Na(l,r),10===n?l:"0x"+l}function Ga(e,t){var r=Da(e,t),n=r.x,o=r.y,i=Ba(n)?16:10,a=Ba(o)?16:10;n=Ra(n),o=Ra(o);var u=new Pa(n,i),s=new Pa(o,a);return u.lt(s)}function qa(e,t){var r=Da(e,t),n=r.x,o=r.y,i=Ba(n)?16:10,a=Ba(o)?16:10;n=Ra(n),o=Ra(o);var u=new Pa(n,i),s=new Pa(o,a);return u.lte(s)}function za(e,t){var r=Da(e,t),n=r.x,o=r.y,i=Ba(n)?16:10,a=Ba(o)?16:10;n=Ra(n),o=Ra(o);var u=new Pa(n,i),s=new Pa(o,a);return u.gt(s)}function Wa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wa(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ya(e,t,r){return Ja.apply(this,arguments)}function Ja(){return Ja=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=w.length>3&&void 0!==w[3]?w[3]:{},a=i.preferPluginId,u=i.disabled,s=void 0===u?{}:u,c=i.promoCodes,f=void 0===c?{}:c,l=r.props.log,d=r.props.state.accounts[n],h=d.swapSettings,p=d.userSettings,y=r.props.state.plugins.swap,l.warn("Requesting swap quotes for: ",Va(Va({},o),{},{fromWallet:o.fromWallet.id,toWallet:o.toWallet.id}),{preferPluginId:a,promoCodes:f}),b=[],v=function(e,t){var r=t[e],n=(null!=h[r]?h[r]:{}).enabled;if(!(void 0===n||n)||s[r])return"continue";b.push(y[r].fetchSwapQuote(o,p[r],{promoCode:f[r]}).then((function(e){return l.warn("".concat(r," gave swap quote:"),e),e}),(function(e){throw l.warn("".concat(r," gave swap error: ").concat(String(e))),e})))},g=0,m=Object.keys(y);case 10:if(!(g<m.length)){e.next=17;break}if("continue"!==v(g,m)){e.next=14;break}return e.abrupt("continue",14);case 14:g++,e.next=10;break;case 17:if(!(b.length<1)){e.next=19;break}throw new Error("No swap providers enabled");case 19:return e.abrupt("return",Yr(b,2e4).then((function(e){var t=Za(e,a,f);l.warn("".concat(b.length," swap quotes requested, ").concat(e.length," resolved, picked ").concat(t.pluginId,"."));for(var r=0;r<e.length;r++){var n=e[r];n!==t&&n.close().catch((function(){}))}return A(t)}),(function(e){throw l.warn("All ".concat(b.length," swap quotes rejected.")),Xa(e)})));case 20:case"end":return e.stop()}}),e)}))),Ja.apply(this,arguments)}function Za(e,t,r){return e.reduce((function(e,n){if(e.pluginId===t)return e;if(n.pluginId===t)return n;var o=null!=r[e.pluginId],i=null!=r[n.pluginId];if(o&&!i)return e;if(!o&&i)return n;var a=e.isEstimate,u=void 0===a||a,s=n.isEstimate,c=void 0===s||s;if(u&&!c)return n;if(!u&&c)return e;var f=Number(e.toNativeAmount)/Number(e.fromNativeAmount);return Number(n.toNativeAmount)/Number(n.fromNativeAmount)>f?n:e}))}function Xa(e){return e.reduce((function(e,t){var r=$a(e)-$a(t);if(r>0)return e;if(r<0)return t;var n=_t(e),o=_t(t);if(null!=n&&null!=o)return Ga(n.nativeMin,o.nativeMin)?n:o;var i=Et(e),a=Et(t);return null!=i&&null!=a?za(i.nativeMax,a.nativeMax)?i:a:e}))}function $a(e){return null==e?0:null!=gt(e)||null!=wt(e)?6:null!=_t(e)?5:null!=Et(e)?4:null!=xt(e)?3:null!=Ct(e)?2:1}var Qa=Ht(de({name:pe})),eu=Ht(de({key:pe,data:pe}));function tu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ru(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tu(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var nu=ve(Ke),ou=ve(qe);function iu(e,t){return nn(e,t).then((function(t){return Xr(e,"POST","/v2/login",{userId:t}).then((function(e){return!1})).catch((function(e){if(null!=St(e))return!0;throw e}))}))}function au(e,t,r,n,o){var i=e.props.io,u=null!=t?i.random(32):nn(e,n),s=i.random(32),c={appId:r,lastLogin:new Date,loginId:new Uint8Array(0),loginKey:s,pendingVouchers:[],children:[],keyInfos:[]},f=null!=t?Rt(i,s,t.loginKey):void 0,l=null!=o.password?Ji(e,c,n,o.password):{},d=null!=o.pin?ca(e,c,n,o.pin,!0):{},h=null!=o.keyInfo?Mr(e,c,o.keyInfo):{},p=i.random(32),y=Rt(i,p,s),b=nu({loginAuth:p,loginAuthBox:y});return Promise.all([u,l]).then((function(e){var t=a()(e,2),n=t[0],o=t[1];return{loginId:n,serverPath:"/v2/login/create",server:ru(ru(ru(ru(ru({},ou({appId:r,loginId:n,parentBox:f})),h.server),o.server),d.server),b),stash:ru(ru(ru({appId:r,loginAuthBox:y,loginId:n,parentBox:f},o.stash),d.stash),h.stash),login:ru(ru(ru({appId:r,loginAuth:p,loginId:n,loginKey:s,keyInfos:[]},o.login),d.login),h.login)}}))}function uu(e,t,r,n){return su.apply(this,arguments)}function su(){return(su=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=xe(n),u=o.now,s=void 0===u?new Date:u,e.next=4,au(r,void 0,"",a,i);case 4:return(c=e.sent).login.username=a,c.stash.username=a,c.login.userId=c.login.loginId,f={data:c.server},e.next=11,Xr(r,"POST",c.serverPath,f);case 11:return c.stash.lastLogin=s,e.next=14,cn(r,c.stash);case 14:return e.abrupt("return",c.login);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cu(e){if(null==e||null==e.loginKey)throw new Error("Incomplete login")}function fu(e,t){var r=Bn(e,(function(e){return e.appId===t}));if(!r)throw new Error("Internal error: cannot find login for ".concat(t));return r}function lu(e,t,r,n){return du.apply(this,arguments)}function du(){return du=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!(l.length>4&&void 0!==l[4])||l[4],u=n.username,cu(o),null!=u){e.next=5;break}throw new Error("Cannot create child: missing username");case 5:return s={pin:n.pin},a&&(s.keyInfo=jr(r,Br(i))),e.next=9,au(r,o,i,u,s);case 9:return c=e.sent,f={serverPath:c.serverPath,server:c.server,login:{children:[c.login]},stash:{children:[c.stash]},loginId:o.loginId},e.abrupt("return",Kn(r,n,f));case 12:case"end":return e.stop()}}),e)}))),du.apply(this,arguments)}function hu(e,t,r){return pu.apply(this,arguments)}function pu(){return pu=o()(t().mark((function e(r,n,o){var i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Br(o),null!=(a=Bn(n,(function(e){return e.appId===o})))){e.next=4;break}return e.abrupt("return",lu(r,n,n,o,!0));case 4:if(null!=Pr(a.keyInfos,i)){e.next=9;break}return cu(a),u=jr(r,i),s=Mr(r,a,u),e.abrupt("return",Kn(r,n,s));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)}))),pu.apply(this,arguments)}function yu(e,t,r,n,o){return bu.apply(this,arguments)}function bu(){return(bu=o()(t().mark((function e(r,n,o,i,a){var u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=a.pauseWallets,s=void 0!==u&&u,(c=r.props.log).warn("Login: decrypted keys for user ".concat(p.stringify(o.loginId))),e.next=5,hu(r,o,n);case 5:if(o=e.sent,c.warn("Login: account exists for appId"),null!=(f=o.username)){e.next=10;break}throw new Error("Cannot log in: missing username");case 10:return l=null!=o.loginKey,r.props.dispatch({type:"LOGIN",payload:{appId:n,username:f,loginKey:l?o.loginKey:fu(o,n).loginKey,pauseWallets:s,rootLogin:l,loginType:i}}),e.abrupt("return",vu(r,r.props.state.lastAccountId));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vu(e,t){return e.waitFor((function(e){var r=e.state.accounts[t];if(null!=r.loadFailure)throw r.loadFailure;var n=e.output.accounts[t];if(null!=n&&null!=n.accountApi)return n.accountApi}))}var gu=r(6266),mu=r.n(gu),wu=r(2956);wu.BU;const Eu=wu.j6;function _u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_u(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var xu=new(0,mu().ec)("secp256k1"),Su=ve(Re),Au=ve(Be);function Iu(e,t){var r=e.derive(xu.keyFromPublic(t).getPublic()).toArray("be");return It(Uint8Array.from([0,0,0,1].concat(lt()(r))),st("dataKey"))}function Ou(e,t){var r=Iu(e,t.publicKey);return JSON.parse(Pt(t.box,r))}function Tu(e,t,r){var n=xu.genKeyPair({entropy:e.random(32)}),o=Iu(n,t);return{publicKey:Uint8Array.from(n.getPublic().encodeCompressed()),box:Rt(e,st(JSON.stringify(r)),o)}}function ku(e,t){return Pu.apply(this,arguments)}function Pu(){return Pu=o()(t().mark((function e(r,n){var i,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=E.length>2&&void 0!==E[2]?E[2]:1e3,u=r.props.io,s=n.timeout,c=void 0===s?600:s,f=xu.genKeyPair({entropy:u.random(32)}),l=Uint8Array.from(f.getPublic().encodeCompressed()),d=ut(Ot(Ot(l)).slice(0,10)),h={data:Au(Cu(Cu({},n),{},{publicKey:l,timeout:c}))},e.next=9,Xr(r,"PUT","/v2/lobby/".concat(d),h);case 9:return p=Eu(),y=a()(p,2),b=y[0],v=y[1],g=[],m=function(){var e=o()(t().mark((function e(){var n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ze,e.next=3,Xr(r,"GET","/v2/lobby/"+d);case 3:for(e.t1=e.sent,n=(0,e.t0)(e.t1);g.length<n.replies.length;)o=n.replies[g.length],i=Ou(f,o),v("reply",i),g.push(i);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),(w=$o(m,i,{onError:function(e){v("error",e)}})).start({wait:!1}),e.abrupt("return",{close:w.stop,lobbyId:d,on:b,replies:g});case 15:case"end":return e.stop()}}),e)}))),Pu.apply(this,arguments)}function Bu(e,t){return Ru.apply(this,arguments)}function Ru(){return(Ru=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ze,e.next=3,Xr(r,"GET","/v2/lobby/"+n);case 3:if(e.t1=e.sent,o=(0,e.t0)(e.t1),i=o.request.publicKey,a=Ot(Ot(i)),Tt(u=at(n),a.subarray(0,u.length))){e.next=10;break}throw new Error("Lobby ECDH integrity error");case 10:return e.abrupt("return",o.request);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ju(e,t,r,n){return Mu.apply(this,arguments)}function Mu(){return(Mu=o()(t().mark((function e(r,n,o,i){var a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.props.io,u=o.publicKey,s={data:Su(Tu(a,u,i))},e.next=5,Xr(r,"POST","/v2/lobby/"+n,s);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nu=de({appId:pe,loginKey:Ie,loginStash:ln});function Du(e,t,r,n){return Lu.apply(this,arguments)}function Lu(){return Lu=o()(t().mark((function e(r,n,o,i){var a,u,s,c,f,l,d,h,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.now,u=void 0===a?new Date:a,s=n.loginKey,c=n.loginStash,null!=(f=Bn(c,(function(e){return e.appId===o})))){e.next=5;break}throw new Error('Cannot find requested appId: "'.concat(o,'"'));case 5:try{l=tn(r,f.loginId),f.voucherId=l.stash.voucherId,f.voucherAuth=l.stash.voucherAuth}catch(t){}return c.lastLogin=u,e.next=9,cn(r,c);case 9:if(d=Dn(c,s,o),null!=(h=Bn(d,(function(e){return e.appId===o})))){e.next=13;break}throw new Error('Cannot find requested appId: "'.concat(o,'"'));case 13:return e.next=15,Vn(r,d,h);case 15:return p=e.sent,e.next=18,yu(r,o,p,"edgeLogin",i);case 18:return e.abrupt("return",e.sent);case 19:case"end":return e.stop()}}),e)}))),Lu.apply(this,arguments)}function Uu(e,t){return Hu.apply(this,arguments)}function Hu(){return Hu=o()(t().mark((function e(r,n){var i,a,u,s,c,f,l,d,h,p=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=function(){return(f=o()(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=0;r<d.length;r++)(0,d[r])();h.state="closed",U(h),D(h);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},c=function(){return f.apply(this,arguments)},s=function(){return(s=o()(t().mark((function e(o){var a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=0;a<d.length;a++)(0,d[a])();if(u=Nu(o),null!=(s=u.loginStash.username)){e.next=5;break}throw new Error("No username in reply");case 5:return h.state="started",h.username=s,U(h),e.next=10,Du(r,u,n,i);case 10:c=e.sent,h.state="done",h.account=c,U(h),D(h);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)},u=function(e){return s.apply(this,arguments)},a=function(e){for(var t=0;t<d.length;t++){(0,d[t])()}h.state="error",h.error=e,U(h),D(h)},i=p.length>2&&void 0!==p[2]?p[2]:{},e.next=8,ku(r,{loginRequest:{appId:n}});case 8:return l=e.sent,d=[l.close,l.on("error",a),l.on("reply",(function(e){u(e).catch(a)}))],h={id:l.lobbyId,cancelRequest:c,watch:Z,state:"pending",account:void 0,error:void 0,username:void 0},e.abrupt("return",A(h));case 12:case"end":return e.stop()}}),e)}))),Hu.apply(this,arguments)}var Ku=ve(Nu),Fu="https://info1.edge.app";function Gu(e,t){return qu.apply(this,arguments)}function qu(){return(qu=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o="".concat(Fu,"/v1/appIdInfo/").concat(n),e.next=4,r.props.io.fetch(o);case 4:if((i=e.sent).ok){e.next=7;break}throw new Error("Fetching ".concat(o," returned ").concat(i.status));case 7:return e.next=9,i.json();case 9:if(a=e.sent,u=a.appName,s=a.imageUrl,u){e.next=14;break}throw new Error("No appName in appId lookup response.");case 14:return e.abrupt("return",{displayImageUrl:s,displayName:u});case 17:return e.prev=17,e.t0=e.catch(0),r.props.onError(e.t0),e.abrupt("return",{displayName:n});case 21:case"end":return e.stop()}}),e,null,[[0,17]])})))).apply(this,arguments)}function zu(e,t,r,n,o){return Wu.apply(this,arguments)}function Wu(){return Wu=o()(t().mark((function e(r,n,o,i,a){var u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=r.props.state.accounts[n].loginTree,e.next=3,zn(r,n);case 3:return e.next=5,hu(r,u,o);case 5:if(s=e.sent,c=fu(s,o)){e.next=9;break}throw new Error("Failed to create the requested login object");case 9:return f=tn(r,u.loginId),l=f.stashTree,d=Ln(l,o),h=Ku({appId:o,loginKey:c.loginKey,loginStash:d}),e.next=14,ju(r,i,a,h).then((function(){var e,t=r.props.output.accounts[n].accountApi;null!=t&&t.on("close",(function(){null!=e&&clearTimeout(e)})),e=setTimeout((function(){e=void 0,zn(r,n).then((function(){e=setTimeout((function(){e=void 0,zn(r,n).catch((function(e){return r.props.onError(e)}))}),2e4)})).catch((function(e){return r.props.onError(e)}))}),1e4)}));case 14:case"end":return e.stop()}}),e)}))),Wu.apply(this,arguments)}function Vu(e,t,r){return Yu.apply(this,arguments)}function Yu(){return(Yu=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bu(r,o);case 2:if(null==(i=e.sent).loginRequest){e.next=14;break}if("string"==typeof(u=i.loginRequest.appId)){e.next=7;break}throw new TypeError("Invalid login request");case 7:return e.next=9,Gu(r,u);case 9:s=e.sent,c=s.displayName,f=s.displayImageUrl,A(a={appId:u,displayName:c,displayImageUrl:f,approve:function(){return zu(r,n,u,o,i)}});case 14:return A(l={loginRequest:a}),e.abrupt("return",l);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ju=r(2205),Zu=r.n(Ju),Xu=r(8585),$u=r.n(Xu),Qu=r(9754),es=r.n(Qu);function ts(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];t[e[o].currencyCode]=o}return t}function rs(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>3?arguments[3]:void 0,n=[],o=0;o<r.length;o++){var i,a=r[o],u=null!==(i=t[a])&&void 0!==i?i:e[a];null!=u&&n.push(u.currencyCode)}return n}function ns(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r={},n=0;n<t.length;n++){var o=t[n];r[o]=!0}for(var i=[],a=0;a<e.length;a++){var u=e[a];r[u]||(r[u]=!0,i.push(u))}return i}function os(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function is(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?os(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):os(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var as=Ht(er),us=Ht(Qt),ss="CustomTokens.json",cs="Settings.json",fs=ce(de({contractAddress:pe}));function ls(e,t,r){return ds.apply(this,arguments)}function ds(){return(ds=o()(t().mark((function e(r,n,o){var i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ar(r,n);case 2:if(null==(i=e.sent).getTokenId){e.next=7;break}return e.next=6,i.getTokenId(o);case 6:return e.abrupt("return",e.sent);case 7:if(null!=(a=ws(r,n))){e.next=10;break}throw new Error("A wallet must exist before adding tokens to a legacy currency plugin");case 10:if(null!=(u=vs(o))){e.next=13;break}throw new Error("A token must have a contract address to be added to a legacy currency plugin");case 13:return e.next=15,a.addCustomToken(is(is({},u),o));case 15:return e.abrupt("return",hs(u.contractAddress));case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hs(e){return e.toLowerCase().replace(/^0x/,"")}function ps(e){for(var t={},r=0;r<e.length;r++){var n=e[r],o=n.contractAddress;null!=o&&(t[hs(o)]={currencyCode:n.currencyCode,denominations:n.denominations,displayName:n.currencyName,networkLocation:{contractAddress:n.contractAddress}})}return t}function ys(e){var t=e.currencyCode,r=e.displayName,n=e.denominations,o=e.networkLocation,i=fs(o);return{currencyCode:t,currencyName:r,denominations:n,contractAddress:null==i?void 0:i.contractAddress}}function bs(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];t.push(ys(e[o]))}return t}function vs(e){var t=e.currencyCode,r=e.displayName,n=e.denominations,o=e.networkLocation,i=fs(o);if(null!=i)return{currencyCode:t,currencyName:r,multiplier:n[0].multiplier,contractAddress:i.contractAddress}}function gs(e,t){return ms.apply(this,arguments)}function ms(){return ms=o()(t().mark((function e(r,n){var i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props,a=i.dispatch,u=i.state,e.next=3,Promise.all(Object.keys(u.plugins.currency).map(function(){var e=o()(t().mark((function e(r){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(o=u.plugins.currency[r]).getBuiltinTokens){e.next=5;break}e.t0=ps(o.currencyInfo.metaTokens),e.next=8;break;case 5:return e.next=7,o.getBuiltinTokens();case 7:e.t0=e.sent;case 8:i=e.t0,a({type:"ACCOUNT_BUILTIN_TOKENS_LOADED",payload:{accountId:n,pluginId:r,tokens:i}});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)}))),ms.apply(this,arguments)}function ws(e,t){for(var r=0,n=Object.keys(e.props.state.currency.wallets);r<n.length;r++){var o=n[r],i=e.props.output.currency.wallets[o];if(null!=i&&null!=i.engine&&e.props.state.currency.wallets[o].pluginId===t)return i.engine}}function Es(e,t){return _s.apply(this,arguments)}function _s(){return(_s=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state,i=o.accounts[n].accountWalletInfo,a=Gt(o,i.id),e.next=5,us.load(a,cs);case 5:if(null!=(u=e.sent)){e.next=8;break}return e.abrupt("return",{});case 8:s={},c=0,f=u.customTokens;case 10:if(!(c<f.length)){e.next=23;break}if((l=f[c]).isVisible){e.next=14;break}return e.abrupt("continue",20);case 14:if(null!=(d=Sr(o.plugins.currency,l.walletType))){e.next=17;break}return e.abrupt("continue",20);case 17:null==s[d]&&(s[d]={}),h=hs(l.contractAddress),s[d][h]={currencyCode:l.currencyCode,denominations:l.denominations,displayName:l.currencyName,networkLocation:{contractAddress:l.contractAddress}};case 20:c++,e.next=10;break;case 23:return e.abrupt("return",s);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cs(e,t){return xs.apply(this,arguments)}function xs(){return(xs=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.state,u=a.accounts[n].accountWalletInfo,s=Gt(a,u.id),e.next=5,as.load(s,ss);case 5:if(null==(c=e.sent)){e.next=11;break}f=c.customTokens,i({type:"ACCOUNT_CUSTOM_TOKENS_LOADED",payload:{accountId:n,customTokens:f}}),e.next=15;break;case 11:return e.next=13,Es(r,n);case 13:l=e.sent,i({type:"ACCOUNT_CUSTOM_TOKENS_LOADED",payload:{accountId:n,customTokens:l}});case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ss(e,t){return As.apply(this,arguments)}function As(){return(As=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props.state,i=o.accounts[n].accountWalletInfo,a=Gt(o,i.id),u=r.props.state.accounts[n].customTokens,e.next=6,as.load(a,ss);case 6:s=e.sent,as.save(a,ss,is(is({},s),{},{customTokens:u}));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Os(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Is(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Is(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ts(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=es()(e);if(t){var o=es()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $u()(this,r)}}var ks={},Ps=function(e){Zu()(c,e);var r,n,i,a,u,s=Ts(c);function c(e,t,r){var n;me()(this,c),(n=s.call(this))._ai=e,n._accountId=t,n._pluginId=r;var o=e.props.state.plugins.currency[r].otherMethods;return null!=o?(A(o),n.otherMethods=o):n.otherMethods={},n}return Ee()(c,[{key:"addCustomToken",value:(u=o()(t().mark((function e(r){var n,o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._accountId,o=this._ai,i=this._pluginId,e.next=3,ls(o,i,r);case 3:return a=e.sent,o.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_ADDED",payload:{accountId:n,pluginId:i,tokenId:a,token:r}}),e.abrupt("return",a);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"changeCustomToken",value:(a=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this._accountId,i=this._ai,a=this._pluginId,null!=(u=i.props.state.accounts[o].customTokens[a][r])){e.next=4;break}throw new Error('There is no token with id "'.concat(r,'"'));case 4:return e.next=6,ls(i,a,n);case 6:if(s=e.sent,i.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_ADDED",payload:{accountId:o,pluginId:a,tokenId:s,token:n}}),u.currencyCode===n.currencyCode){e.next=20;break}c=i.props.state.currency.wallets,f=0,l=Object.keys(c);case 11:if(!(f<l.length)){e.next=20;break}if(d=l[f],!((h=c[d]).accountId!==o||h.pluginId!==a||h.enabledTokens.indexOf(u.currencyCode)<0)){e.next=16;break}return e.abrupt("continue",17);case 16:i.props.dispatch({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:d,currencyCodes:ns([].concat(lt()(h.enabledTokens),[n.currencyCode]),[u.currencyCode])}});case 17:f++,e.next=11;break;case 20:s!==r&&i.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_REMOVED",payload:{accountId:o,pluginId:a,tokenId:r}});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"removeCustomToken",value:(i=o()(t().mark((function e(r){var n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._accountId,o=this._ai,i=this._pluginId,o.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_REMOVED",payload:{accountId:n,pluginId:i,tokenId:r}});case 2:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"changeUserSettings",value:(n=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,br(this._ai,this._accountId,this._pluginId,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"importKey",value:(r=o()(t().mark((function e(r){var n,o,i,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,Ar(this._ai,this._pluginId);case 3:if(null!=(o=e.sent).importPrivateKey){e.next=6;break}throw new Error("This wallet does not support importing keys");case 6:return e.next=8,o.importPrivateKey(r,n.keyOptions);case 8:return i=e.sent,e.abrupt("return",Os(Os({},i),{},{imported:!0}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"currencyInfo",get:function(){return this._ai.props.state.plugins.currency[this._pluginId].currencyInfo}},{key:"allTokens",get:function(){var e=this._ai.props.state,t=this._accountId,r=this._pluginId;return e.accounts[t].allTokens[r]}},{key:"builtinTokens",get:function(){var e=this._ai.props.state,t=this._accountId,r=this._pluginId;return e.accounts[t].builtinTokens[r]}},{key:"customTokens",get:function(){var e,t=this._ai.props.state,r=this._accountId,n=this._pluginId;return null!==(e=t.accounts[r].customTokens[n])&&void 0!==e?e:ks}},{key:"userSettings",get:function(){return this._ai.props.state.accounts[this._accountId].userSettings[this._pluginId]}}]),c}(X),Bs=function(e){Zu()(a,e);var r,n,i=Ts(a);function a(e,t,r){var n;return me()(this,a),(n=i.call(this))._ai=e,n._accountId=t,n._pluginId=r,n}return Ee()(a,[{key:"changeEnabled",value:(n=o()(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._ai.props.state.accounts[this._accountId],e.abrupt("return",gr(this._ai,this._accountId,this._pluginId,Os(Os({},n.swapSettings[this._pluginId]),{},{enabled:r})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"changeUserSettings",value:(r=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,br(this._ai,this._accountId,this._pluginId,r);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"enabled",get:function(){var e=this._ai.props.state.accounts[this._accountId].swapSettings,t=(null!=e[this._pluginId]?e[this._pluginId]:{}).enabled;return void 0===t||t}},{key:"needsActivation",get:function(){var e=this._ai.props.state.plugins.swap[this._pluginId];if(null==e.checkSettings)return!1;var t=this._ai.props.state.accounts[this._accountId].userSettings[this._pluginId]||{};return!!e.checkSettings(t).needsActivation}},{key:"swapInfo",get:function(){return this._ai.props.state.plugins.swap[this._pluginId].swapInfo}},{key:"userSettings",get:function(){return this._ai.props.state.accounts[this._accountId].userSettings[this._pluginId]}}]),a}(X);function Rs(e,r){for(var n=function(){return e.props.state.accounts[r]},i=n(),a=i.accountWalletInfo,u=i.loginType,s=i.loginTree,c=s.username,f={},l=0,d=Object.keys(e.props.state.plugins.currency);l<d.length;l++){var p=d[l],y=new Ps(e,r,p);f[p]=y}for(var b={},v=0,g=Object.keys(e.props.state.plugins.swap);v<g.length;v++){var m=g[v],w=new Bs(e,r,m);b[m]=w}var E=function(e){var r={on:J,convertCurrency:function(r,n){var i=arguments;return o()(t().mark((function o(){var a,u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f=function(e,t,r){return t/(30+t)+(null!=c[e]?c[e]:0)+(r?1.1:1)},a=i.length>2&&void 0!==i[2]?i[2]:1,u=i.length>3&&void 0!==i[3]?i[3]:{},s=u.biases,c=void 0===s?Pi:s,l=ki(e.props.state,r,n,f),t.abrupt("return",a*l);case 6:case"end":return t.stop()}}),o)})))()}};return A(r),r}(e),_=function(e,r){var n=e.props.state.accounts[r].accountWalletInfo,i=Gt(e.props.state,n.id),a=function(t){return Wt(e.props.state,n.id,t)},u=function(e){return"Plugins/".concat(a(e))},s=function(e,t){return"".concat(u(e),"/").concat(a(t),".json")},c={deleteItem:function(e,r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.delete(s(e,r));case 2:case"end":return t.stop()}}),n)})))()},deleteStore:function(e){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.delete(u(e));case 2:case"end":return t.stop()}}),r)})))()},listItemIds:function(e){return o()(t().mark((function r(){var n,a;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=[],r.t0=Q.gQ,r.next=4,i.list(u(e));case 4:return r.t1=r.sent,a=(0,r.t0)(r.t1),r.next=8,Promise.all(a.map(function(){var e=o()(t().mark((function e(r){var o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,eu.load(i,r);case 2:null!=(o=e.sent)&&n.push(o.key);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:return r.abrupt("return",n);case 9:case"end":return r.stop()}}),r)})))()},listStoreIds:function(){return o()(t().mark((function e(){var r,n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=[],e.t0=Q.ji,e.next=4,i.list("Plugins");case 4:return e.t1=e.sent,n=(0,e.t0)(e.t1),e.next=8,Promise.all(n.map(function(){var e=o()(t().mark((function e(n){var o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qa.load(i,"".concat(n,"/Name.json"));case 2:null!=(o=e.sent)&&r.push(o.name);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})))()},getItem:function(e,r){return o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,eu.load(i,s(e,r));case 2:if(null!=(o=t.sent)){t.next=5;break}throw new Error('No item named "'.concat(r,'"'));case 5:return t.abrupt("return",o.data);case 6:case"end":return t.stop()}}),n)})))()},setItem:function(e,r,n){return o()(t().mark((function o(){var a,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="".concat(u(e),"/Name.json"),t.next=3,Qa.load(i,a);case 3:if(null!=(c=t.sent)){t.next=9;break}return t.next=7,Qa.save(i,a,{name:e});case 7:t.next=11;break;case 9:if(c.name===e){t.next=11;break}throw new Error("Warning: folder name doesn't match for ".concat(e));case 11:return t.next=13,eu.save(i,s(e,r),{key:r,data:n});case 13:case"end":return t.stop()}}),o)})))()}};return A(c),c}(e,r),C=ka(e,a);function x(){if(e.props.state.hideKeys)throw new Error("Not available when `hideKeys` is enabled")}var S={on:J,watch:Z,get id(){return C.id},get type(){return C.type},get keys(){return x(),C.keys},get disklet(){return x(),C.disklet},get localDisklet(){return x(),C.localDisklet},sync:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C.sync();case 2:case"end":return e.stop()}}),e)})))()},get appId(){return n().login.appId},get created(){return n().login.created},get lastLogin(){return n().login.lastLogin},get loggedIn(){return null!=n()},get loginKey(){return x(),ut(n().login.loginKey)},get recoveryKey(){x();var e=n().login;return null!=e.recovery2Key?ut(e.recovery2Key):void 0},get rootLoginId(){return x(),ut(s.loginId)},get username(){if(null==c)throw new Error("Missing username");return c},get currencyConfig(){return f},get swapConfig(){return b},get rateCache(){return E},get dataStore(){return _},get edgeLogin(){return null==n().loginTree.loginKey},keyLogin:"keyLogin"===u,newAccount:"newAccount"===u,passwordLogin:"passwordLogin"===u,pinLogin:"pinLogin"===u,recoveryLogin:"recoveryLogin"===u,changePassword:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,Gi(e,r,n);case 3:case"end":return t.stop()}}),o)})))()},changePin:function(i){return o()(t().mark((function o(){var a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),a=i.pin,u=i.enableLogin,t.abrupt("return",ra(e,r,a,u).then((function(){var e=n().login;return e.pin2Key?ut(e.pin2Key):""})));case 3:case"end":return t.stop()}}),o)})))()},changeRecovery:function(i,a){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.abrupt("return",ga(e,r,i,a).then((function(){var e=n().loginTree;if(!e.recovery2Key)throw new Error("Missing recoveryKey");return ut(e.recovery2Key)})));case 2:case"end":return t.stop()}}),o)})))()},checkPassword:function(r){return o()(t().mark((function o(){var i,a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),i=n(),a=i.loginTree,t.abrupt("return",zi(e,a,r));case 3:case"end":return t.stop()}}),o)})))()},checkPin:function(r){return o()(t().mark((function o(){var i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),i=n(),a=i.login,u=i.loginTree,t.abrupt("return",null!=a.pin?r===a.pin:oa(e,u,r));case 3:case"end":return t.stop()}}),o)})))()},deletePassword:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,Vi(e,r);case 3:case"end":return t.stop()}}),n)})))()},deletePin:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,aa(e,r);case 3:case"end":return t.stop()}}),n)})))()},deleteRecovery:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,wa(e,r);case 3:case"end":return t.stop()}}),n)})))()},get otpKey(){x();var e=n().loginTree;return null!=e.otpKey?h.stringify(e.otpKey,{pad:!1}):void 0},get otpResetDate(){return x(),n().loginTree.otpResetDate},cancelOtpReset:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,Cn(e,r);case 3:case"end":return t.stop()}}),n)})))()},enableOtp:function(){var n=arguments;return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n.length>0&&void 0!==n[0]?n[0]:604800,x(),t.next=4,mn(e,r,i);case 4:case"end":return t.stop()}}),o)})))()},disableOtp:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,En(e,r);case 3:case"end":return t.stop()}}),n)})))()},repairOtp:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.next=3,In(e,r,h.parse(n,{loose:!0}));case 3:case"end":return t.stop()}}),o)})))()},get pendingVouchers(){return n().login.pendingVouchers},approveVoucher:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Oa(e,s,{approvedVouchers:[r]}));case 1:case"end":return t.stop()}}),n)})))()},rejectVoucher:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Oa(e,s,{rejectedVouchers:[r]}));case 1:case"end":return t.stop()}}),n)})))()},fetchLobby:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x(),t.abrupt("return",Vu(e,r,n));case 2:case"end":return t.stop()}}),o)})))()},deleteRemoteAccount:function(){return o()(t().mark((function r(){var o,i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n(),i=o.loginTree,t.next=3,Bi(e,i);case 3:case"end":return t.stop()}}),r)})))()},logout:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.props.dispatch({type:"LOGOUT",payload:{accountId:r}});case 1:case"end":return t.stop()}}),n)})))()},get allKeys(){return e.props.state.hideKeys?e.props.state.accounts[r].allWalletInfosClean:e.props.state.accounts[r].allWalletInfosFull},changeWalletStates:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,pr(e,r,n);case 2:case"end":return t.stop()}}),o)})))()},createWallet:function(r,i){return o()(t().mark((function o(){var a,u,s,c,f,l,d;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n(),u=a.login,s=a.loginTree,null!=i){t.next=9;break}return c=xr(e.props.state.plugins.currency,r),t.next=5,Ar(e,c);case 5:return f=t.sent,t.next=8,f.createPrivateKey(r);case 8:i=t.sent;case 9:return l=jr(e,r,i),d=Mr(e,u,l),t.next=13,Kn(e,s,d);case 13:return t.abrupt("return",l.id);case 14:case"end":return t.stop()}}),o)})))()},getFirstWalletInfo:_e.prototype.getFirstWalletInfo,getWalletInfo:_e.prototype.getWalletInfo,listWalletIds:_e.prototype.listWalletIds,splitWalletInfo:function(n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",qr(e,r,n,i));case 1:case"end":return t.stop()}}),o)})))()},listSplittableWalletTypes:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Wr(e,r,n));case 1:case"end":return t.stop()}}),o)})))()},get activeWalletIds(){return e.props.state.accounts[r].activeWalletIds},get archivedWalletIds(){return e.props.state.accounts[r].archivedWalletIds},get hiddenWalletIds(){return e.props.state.accounts[r].hiddenWalletIds},get currencyWallets(){return e.props.output.accounts[r].currencyWallets},createCurrencyWallet:function(n){var i=arguments;return o()(t().mark((function o(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=i.length>1&&void 0!==i[1]?i[1]:{},t.abrupt("return",Hr(e,r,n,a));case 2:case"end":return t.stop()}}),o)})))()},waitForCurrencyWallet:function(e){var r=this;return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var n=function(){var n=r.currencyWallets[e];null!=n&&(t(n),o())},o=r.watch("currencyWallets",n);n()})));case 1:case"end":return t.stop()}}),n)})))()},signEthereumTransaction:function(r,i){return o()(t().mark((function o(){var a,u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.props.log.warn("Edge is signing: ",i),a=n(),u=a.allWalletInfosFull,null!=(s=u.find((function(e){return e.id===r})))&&null!=s.keys&&"string"==typeof s.keys.ethereumKey){t.next=5;break}throw new Error("Cannot find the requested private key in the account");case 5:return t.abrupt("return",wi(s.keys.ethereumKey,i));case 6:case"end":return t.stop()}}),o)})))()},fetchSwapQuote:function(n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ya(e,r,n,i));case 1:case"end":return t.stop()}}),o)})))()}};return A(S),S}var js=r(6479),Ms=r.n(js),Ns="redux-keto wrapper";function Ds(e,t,r){for(var n=Object.create(null),o=function(){var e=a[i],o=t(e);Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var t=this,n=t[Ns];if(n.running[e]){var i=new ReferenceError("Reducer '"+e+"' depends on its own result");throw i.name="ReduxKetoCircularReferenceError",i}n.running[e]=!0;try{var a=o(n.state[e],n.action,r(n.next,t,e),r(n.prev,n.state,e));if(void 0===a)throw new TypeError("Reducer '"+e+"' returned undefined");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!1,value:a}),a}finally{n.running[e]=!1}}})},i=0,a=e;i<a.length;i+=1)o();return n}function Ls(e,t,r,n,o){var i=Object.create(e);return Object.defineProperty(i,Ns,{configurable:!0,enumerable:!1,writable:!1,value:{state:t,action:r,next:n,prev:o,running:{}}}),i}function Us(e,t){if(void 0===e&&(e={}),null===t||null==t[Ns])return t;for(var r=Object.keys(Object.getPrototypeOf(t)),n=Object.keys(e).length===r.length,o=0,i=r;o<i.length;o+=1){var a=i[o];Object.defineProperty(t,a,{configurable:!1,enumerable:!0,writable:!1,value:Us(e[a],t[a])}),t[a]!==e[a]&&(n=!1)}return n?e:(delete t[Ns],t)}function Hs(e,t,r){return void 0!==e?e:t}function Ks(e,t){if(void 0===t&&(t=Hs),"object"!=typeof e||null===e)throw new TypeError("The reducer map must be an object.");for(var r=Object.keys(e),n=0,o=r;n<o.length;n+=1){var i=o[n];if("function"!=typeof e[i])throw new TypeError("Reducers must be functions.")}for(var a=Ds(r,(function(t){return e[t]}),t),u={},s=0,c=r;s<c.length;s+=1){var f=c[s];u[f]=e[f].defaultState}function l(e,t,r,n){void 0===e&&(e=u);var o=Ls(a,e,t,r,n);return void 0===r?Us(e,o):o}return l.defaultState=u,l}function Fs(e,t){return e}function Gs(e){return e}function qs(e,t,r){void 0===t&&(t=Fs),void 0===r&&(r=Gs);var n=e.defaultState;function o(o,i,a,u){void 0===o&&(o=n);var s=t(i,a),c=r(a),f=r(u);if(!s)return o;var l=e(o,s,c,f);return void 0===a?Us(o,l):l}return o.defaultState=n,o}function zs(e,t,r){return{id:r,root:void 0!==e?e:t,get self(){return t[r]}}}var Ws={};function Vs(e,t,r){function n(n,o,i,a){void 0===n&&(n=Ws);var u=t(i),s=Ls(n===Ws||u!==t(a)?Ds(u,(function(t){return e}),r):Object.getPrototypeOf(n),n,o,i,a);return void 0===i?Us(n,s):s}return void 0===r&&(r=zs),n.defaultState=Ws,n}function Ys(){for(var e=arguments,t=arguments.length-1,r=arguments[t],n=[];t-- >0;)n[t]=e[t];if("function"!=typeof r)throw new TypeError("The reducer must be a function");for(var o=0,i=n;o<i.length;o+=1){var a=i[o];if("function"!=typeof a)throw new TypeError("Each argument filter must be a function")}return function(e,t,o,i){void 0===e&&(e=r.defaultState);for(var a=void 0!==e,u=[],s=0;s<n.length;++s)u[s]=n[s](o),a&&u[s]!==n[s](i)&&(a=!1);return a?e:r.apply(void 0,u)}}var Js={"[object Float32Array]":!0,"[object Float64Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Int8Array]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0};function Zs(e,t){if(e===t)return!0;if("object"!==Nt()(e))return!1;if("object"!==Nt()(t))return!1;var r=Object.prototype.toString.call(e);return r===Object.prototype.toString.call(t)&&function(e,t,r){if("[object Object]"===r){if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var n=Object.getOwnPropertyNames(e);if(n.length!==Object.getOwnPropertyNames(t).length)return!1;for(var o=0;o<n.length;o++){var i=n[o];if(!Object.prototype.hasOwnProperty.call(t,i)||!Zs(e[i],t[i]))return!1}return!0}if("[object Array]"===r){if(e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!Zs(e[a],t[a]))return!1;return!0}if("[object Date]"===r)return e.getTime()===t.getTime();if(Js[r]){if(e.length!==t.length)return!1;for(var u=0;u<e.length;++u)if(e[u]!==t[u])return!1;return!0}return!1}(e,t,r)}function Xs(e){var t=function(e,t){if("object"!==Nt()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Nt()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Nt()(t)?t:String(t)}function $s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$s(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ec={},tc=Ks({accountWalletInfo:Ys((function(e){return e.self.appId}),(function(e){return e.self.login}),(function(e,t){var r=Br(e),n=Pr(t.keyInfos,r);if(null==n)throw new Error('Cannot find a "'.concat(r,'" repo'));return n})),accountWalletInfos:Ys((function(e){return e.self.appId}),(function(e){return e.self.login}),(function(e,t){var r=[Br(e)];return""===e&&r.push("account:repo:co.airbitz.wallet",""),t.keyInfos.filter((function(e){return r.indexOf(e.type)>=0}))})),allWalletInfosFull:Ys((function(e){return e.self.login}),(function(e){return e.self.legacyWalletInfos}),(function(e){return e.self.walletStates}),(function(e,t,r){var n=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r={},n=[],o=0;o<t.length;o++){var i=t[o];n.push(i),null==r[i.id]?r[i.id]=[e.appId]:r[i.id].push(e.appId)}function a(e){for(var t=0,o=e.keyInfos;t<o.length;t++){var i=o[t];n.push(i),null==r[i.id]?r[i.id]=[e.appId]:r[i.id].push(e.appId)}for(var u=0,s=e.children;u<s.length;u++)a(s[u])}return a(e),{appIdMap:r,walletInfos:Nr(n)}}(e,t),o=n.walletInfos,i=n.appIdMap;return o.map((function(e){return Qs(Qs({appId:(t=i[e.id],t[t.length-1]),appIds:i[e.id],archived:!1,deleted:!1,hidden:!1,sortIndex:o.length},r[e.id]),e);var t}))})),allWalletInfosClean:Ys((function(e){return e.self.allWalletInfosFull}),(function(e){return e.map((function(e){var t="wallet:ethereum"===e.type&&"string"==typeof e.keys.ethereumKey?{ethereumAddress:mi(e.keys.ethereumKey)}:{};return Qs(Qs({},e),{},{keys:t})}))})),currencyWalletIds:Ys((function(e){return e.self.walletInfos}),(function(e){return e.root.plugins.currency}),(function(e,t){return Object.keys(e).filter((function(r){var n=e[r],o=Sr(t,n.type);return!n.deleted&&null!=o})).sort((function(t,r){var n=e[t],o=e[r];return n.sortIndex-o.sortIndex}))})),activeWalletIds:Ys((function(e){return e.self.walletInfos}),(function(e){return e.self.currencyWalletIds}),(function(e){return e.self.keysLoaded}),(function(e,t,r){return r?t.filter((function(t){return!e[t].archived})):[]})),archivedWalletIds:Ys((function(e){return e.self.walletInfos}),(function(e){return e.self.currencyWalletIds}),(function(e){return e.self.keysLoaded}),(function(e,t,r){return r?t.filter((function(t){return e[t].archived})):[]})),hiddenWalletIds:Ys((function(e){return e.self.walletInfos}),(function(e){return e.self.currencyWalletIds}),(function(e){return e.self.keysLoaded}),(function(e,t,r){return r?t.filter((function(t){return e[t].hidden})):[]})),keysLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_KEYS_LOADED"===t.type||e},legacyWalletInfos:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_KEYS_LOADED"===t.type?t.payload.legacyWalletInfos:e},walletInfos:Ys((function(e){return e.self.allWalletInfosFull}),(function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];t[n.id]=n}return t})),walletStates:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_CHANGED_WALLET_STATES"===t.type||"ACCOUNT_KEYS_LOADED"===t.type?t.payload.walletStates:e},pauseWallets:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.pauseWallets:e},appId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.appId:e},loadFailure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"ACCOUNT_LOAD_FAILED"===t.type?t.payload.error:e},login:Ys((function(e){return e.self.appId}),(function(e){return e.self.loginTree}),(function(e,t){return fu(t,e)})),loginKey:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array(0),t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.loginKey:e},loginTree:Ys((function(e){return e.self.appId}),(function(e){return e.self.loginKey}),(function(e){return e.self.rootLogin}),(function(e){return e.root.login.stashes[e.self.username]}),(function(e,t,r,n){return Dn(n,t,r?"":e)})),loginType:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"newAccount",t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.loginType:e},rootLogin:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.rootLogin:e},username:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?t.payload.username:e},allTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,n=t.self,o=n.builtinTokens,i=n.customTokens;if(null==r.self||o!==r.self.builtinTokens||i!==r.self.customTokens){for(var a=Qs({},e),u=0,s=Object.keys(t.root.plugins.currency);u<s.length;u++){var c=s[u];null!=r.self&&o[c]===r.self.builtinTokens[c]&&i[c]===r.self.customTokens[c]||(a[c]=Qs(Qs({},i[c]),o[c]))}return a}return e},builtinTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("ACCOUNT_BUILTIN_TOKENS_LOADED"===t.type){var r=t.payload,n=r.pluginId,o=r.tokens;return Qs(Qs({},e),{},te()({},n,o))}return e},customTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ec,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ACCOUNT_CUSTOM_TOKENS_LOADED":var r=t.payload.customTokens;return r;case"ACCOUNT_CUSTOM_TOKEN_ADDED":var n,o=t.payload,i=o.pluginId,a=o.tokenId,u=o.token,s=null!==(n=e[i])&&void 0!==n?n:{};if(Zs(s[a],u))return e;var c=Qs(Qs({},s),{},te()({},a,u));return Qs(Qs({},e),{},te()({},i,c));case"ACCOUNT_CUSTOM_TOKEN_REMOVED":var f,l=t.payload,d=l.pluginId,h=l.tokenId,p=null!==(f=e[d])&&void 0!==f?f:{};if(null==p[h])return e;p[h];var y=Ms()(p,[h].map(Xs));return Qs(Qs({},e),{},te()({},d,y))}return e},swapSettings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ACCOUNT_PLUGIN_SETTINGS_LOADED":return t.payload.swapSettings;case"ACCOUNT_SWAP_SETTINGS_CHANGED":var r=t.payload,n=r.pluginId,o=r.swapSettings,i=Qs({},e);return i[n]=o,i}return e},userSettings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ACCOUNT_PLUGIN_SETTINGS_CHANGED":var r=t.payload,n=r.pluginId,o=r.userSettings,i=Qs({},e);return i[n]=o,i;case"ACCOUNT_PLUGIN_SETTINGS_LOADED":return t.payload.userSettings}return e}}),rc=qs(tc,(function(e,t){return/^ACCOUNT_/.test(e.type)&&null!=e.payload&&e.payload.accountId===t.id||"LOGIN"===e.type&&t.root.lastAccountId===t.id?e:{type:"UPDATE_NEXT"}}));function nc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function oc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nc(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ic=Mo({accountApi:function(e){return{destroy:function(){e.props.state={accounts:{}};var t=e.props.accountOutput;if(null!=t){var r=t.accountApi;if(null!=r){U(r),D(r),D(r.dataStore),D(r.rateCache);for(var n=r.currencyConfig,o=r.swapConfig,i=0,a=Object.keys(n);i<a.length;i++){D(n[a[i]])}for(var u=0,s=Object.keys(o);u<s.length;u++){D(o[s[u]])}}}},update:function(){return o()(t().mark((function r(){var n,i,a,u,s,c,f,l;return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l=function(){return(l=o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([dr(n,a),Cs(n,a),wr(n,a)]);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)},f=function(){return l.apply(this,arguments)},n=tl(e),i=e.props,a=i.accountId,u=i.accountState,s=i.log,c=u.accountWalletInfos,r.prev=5,r.next=8,Ir(n);case 8:return r.next=10,gs(n,a);case 10:return s.warn("Login: currency plugins exist"),r.next=13,Promise.all(c.map((function(e){return li(n,e)})));case 13:return s.warn("Login: synced account repos"),r.next=16,f();case 16:s.warn("Login: loaded files"),e.onOutput(Rs(n,a)),s.warn("Login: complete"),r.next=24;break;case 21:r.prev=21,r.t0=r.catch(5),e.props.dispatch({type:"ACCOUNT_LOAD_FAILED",payload:{accountId:a,error:r.t0}});case 24:return r.abrupt("return",Ho);case 25:case"end":return r.stop()}}),r,null,[[5,21]])})))()}}},syncTimer:Lo((function(e){function r(){return r=o()(t().mark((function r(){var n,o,i,a,u,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=tl(e),i=e.props,a=i.accountId,u=i.accountState,s=u.accountWalletInfos,null!=e.props.state.accounts[a]){t.next=5;break}return t.abrupt("return");case 5:return t.next=7,Promise.all(s.map((function(e){return hi(o,e.id)})));case 7:if(c=t.sent,!(n=[]).concat.apply(n,lt()(c)).length){t.next=12;break}return t.next=12,Promise.all([wr(o,a),dr(o,a)]);case 12:case"end":return t.stop()}}),r)}))),r.apply(this,arguments)}function n(){return(n=o()(t().mark((function r(){var n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.accountId,t.next=3,zn(tl(e),n);case 3:case"end":return t.stop()}}),r)})))).apply(this,arguments)}var i=$o((function(){return r.apply(this,arguments)}),3e4),a=$o((function(){return n.apply(this,arguments)}),3e4,{onError:function(t){var r=mt(t);null!=r&&e.props.onError(r)}});return{update:function(){var t=e.props.accountOutput;null!=t&&(null!=t.accountApi&&(i.start({wait:!0}),a.start({wait:!0})))},destroy:function(){i.stop(),a.stop()}}}),(function(e){return e.state.paused?void 0:e})),tokenSaver:function(e){var r=ec;return function(){var n=o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.props,i=o.accountId,a=o.accountState,(u=a.customTokens)===r||r===ec){t.next=7;break}return t.next=5,Ss(tl(e),i).catch((function(t){return e.props.onError(t)}));case 5:return t.next=7,Qo(100);case 7:r=u;case 8:case"end":return t.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()},watcher:function(e){var t,r;return function(){var n=e.props,o=n.accountState,i=n.accountOutput;if(null!=o&&null!=i){var a=i.accountApi;if(null!=a&&U(a),t!==o&&(t=o,null!=a)){for(var u=a.currencyConfig,s=a.swapConfig,c=0,f=Object.keys(u);c<f.length;c++){U(u[f[c]])}for(var l=0,d=Object.keys(s);l<d.length;l++){U(s[d[l]])}}r!==e.props.state.exchangeCache&&(r=e.props.state.exchangeCache,null!=a&&L(a.rateCache,"update",void 0))}}},currencyWallets:function(e){var t;return function(){var r=e.props,n=r.accountOutput,o=r.accountState.activeWalletIds,i=t!==o;t=o;var a={};null!=n&&null!=n.currencyWallets&&(a=n.currencyWallets);for(var u={},s=e.props.output.currency.wallets,c=0;c<o.length;c++){var f,l=o[c],d=null===(f=s[l])||void 0===f?void 0:f.walletApi;d!==a[l]&&(i=!0),null!=d&&(u[l]=d)}i&&e.onOutput(u)}}}),ac=Uo(ic,(function(e){return e.state.accountIds}),(function(e,t){return oc(oc({},e),{},{accountId:t,accountState:e.state.accounts[t],accountOutput:e.output.accounts[t]})}));function uc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cc(e){for(var t=e.props.state.login.stashes,r={},n=[],o=0,i=Object.keys(t);o<i.length;o++){var a=i[o],u=t[a].loginId;null!=u&&(r[p.stringify(u)]=a,n.push(u))}return Xr(e,"POST","/v2/messages",{loginIds:n}).then((function(e){for(var t={},n=0,o=Ve(e);n<o.length;n++){var i=o[n],a=i.loginId,u=Ms()(i,["loginId"]),s=p.stringify(a),c=r[s];null!=c&&(t[c]=sc(sc({},u),{},{loginId:s}))}return t}))}var fc=r(1506),lc=r.n(fc);function dc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=es()(e);if(t){var o=es()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $u()(this,r)}}var hc=function(e){Zu()(r,e);var t=dc(r);function r(e){var n;return me()(this,r),(n=t.call(this))._lobby=e,n._cleanups=[e.close,e.on("reply",(function(e){return U(lc()(n),"replies")})),e.on("error",(function(e){return L(lc()(n),"error",e)}))],n}return Ee()(r,[{key:"close",value:function(){this._cleanups.forEach((function(e){return e()})),D(this)}},{key:"lobbyId",get:function(){return this._lobby.lobbyId}},{key:"replies",get:function(){return this._lobby.replies}}]),r}(X),pc=function(e){Zu()(s,e);var r,n,i,a,u=dc(s);function s(e){var t;return me()(this,s),(t=u.call(this))._ai=e,t}return Ee()(s,[{key:"authRequest",value:function(e,t,r){return Xr(this._ai,e,t,r)}},{key:"hashUsername",value:function(e){return nn(this._ai,e)}},{key:"makeLobby",value:(a=o()(t().mark((function e(r){var n,o,i=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:1e3,e.next=3,ku(this._ai,r,n);case 3:return o=e.sent,e.abrupt("return",new hc(o));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"fetchLobbyRequest",value:function(e){return Bu(this._ai,e)}},{key:"sendLobbyReply",value:(i=o()(t().mark((function e(r,n,o){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ju(this._ai,r,n,o);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return i.apply(this,arguments)})},{key:"syncRepo",value:(n=o()(t().mark((function e(r){var n,o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._ai.props,o=n.io,i=n.syncClient,a=ri(o,r,new Uint8Array(0)),e.abrupt("return",ai(i,a,{lastSync:0,lastHash:void 0}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"getRepoDisklet",value:(r=o()(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this._ai.props.io,A((i=ri(o,r,n)).disklet),e.abrupt("return",i.disklet);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),s}(X);function yc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yc(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var vc=Mo({api:function(e){return{destroy:function(){D(e.props.output.context.api)},update:function(){return e.onOutput(function(e){var r,n=e.props.state.login.appId,i=new pc(e),a={on:J,watch:Z,appId:n,close:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.props.close();case 1:case"end":return t.stop()}}),r)})))()},$internalStuff:i,fixUsername:xe,get localUsers(){return e.props.state.login.localUsers},listUsernames:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object.keys(e.props.state.login.stashes));case 1:case"end":return t.stop()}}),r)})))()},deleteLocalAccount:function(r){return o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=xe(r),i=0,a=e.props.state.accountIds;case 2:if(!(i<a.length)){t.next=9;break}if(u=a[i],e.props.state.accounts[u].username!==o){t.next=6;break}throw new Error("Cannot remove logged-in user");case 6:i++,t.next=2;break;case 9:return t.abrupt("return",un(e,r));case 10:case"end":return t.stop()}}),n)})))()},usernameAvailable:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",iu(e,r));case 1:case"end":return t.stop()}}),n)})))()},createAccount:function(r,i,a){var u=arguments;return o()(t().mark((function o(){var s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=u.length>3&&void 0!==u[3]?u[3]:{},t.next=3,uu(e,r,s,{password:i,pin:a});case 3:return c=t.sent,t.abrupt("return",yu(e,n,c,"newAccount",s));case 5:case"end":return t.stop()}}),o)})))()},loginWithKey:function(r,i){var a=arguments;return o()(t().mark((function o(){var u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>2&&void 0!==a[2]?a[2]:{},s=u.now,c=void 0===s?new Date:s,f=en(e,r),l=Dn(f,at(i),n),f.lastLogin=c,cn(e,f).catch((function(){})),Vn(e,l,fu(l,n)).catch((function(t){return e.props.onError(t)})),t.abrupt("return",yu(e,n,l,"keyLogin",u));case 8:case"end":return t.stop()}}),o)})))()},loginWithPassword:function(r,i){var a=arguments;return o()(t().mark((function o(){var u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>2&&void 0!==a[2]?a[2]:{},t.next=3,Ki(e,r,i,u);case 3:return s=t.sent,t.abrupt("return",yu(e,n,s,"passwordLogin",u));case 5:case"end":return t.stop()}}),o)})))()},checkPasswordRules:Ce,pinLoginEnabled:function(r){return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=en(e,r),t.abrupt("return",null!=Qi(i,n));case 2:case"end":return t.stop()}}),o)})))()},loginWithPIN:function(r,i){var a=arguments;return o()(t().mark((function o(){var u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>2&&void 0!==a[2]?a[2]:{},t.next=3,ea(e,n,r,i,u);case 3:return s=t.sent,t.abrupt("return",yu(e,n,s,"pinLogin",u));case 5:case"end":return t.stop()}}),o)})))()},loginWithRecovery2:function(r,i,a){var u=arguments;return o()(t().mark((function o(){var s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=u.length>3&&void 0!==u[3]?u[3]:{},t.next=3,ya(e,at(r),i,a,s);case 3:return c=t.sent,t.abrupt("return",yu(e,n,c,"recoveryLogin",s));case 5:case"end":return t.stop()}}),o)})))()},fetchRecovery2Questions:function(r,n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",va(e,at(r),n));case 1:case"end":return t.stop()}}),o)})))()},listRecoveryQuestionChoices:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ca(e));case 1:case"end":return t.stop()}}),r)})))()},requestEdgeLogin:function(r){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Uu(e,n,r));case 1:case"end":return t.stop()}}),o)})))()},requestOtpReset:function(r,n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Sn(e,r,n));case 1:case"end":return t.stop()}}),o)})))()},fetchLoginMessages:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",cc(e));case 1:case"end":return t.stop()}}),r)})))()},get paused(){return e.props.state.paused},changePaused:function(n){var i=arguments;return o()(t().mark((function o(){var a,u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=i.length>1&&void 0!==i[1]?i[1]:{},u=a.secondsDelay,s=void 0===u?0:u,null!=r&&(clearTimeout(r),r=void 0),e.props.state.paused!==n){t.next=5;break}return t.abrupt("return");case 5:0===s?e.props.dispatch({type:"PAUSE",payload:n}):r=setTimeout((function(){r=void 0,e.props.dispatch({type:"PAUSE",payload:n})}),1e3*s);case 6:case"end":return t.stop()}}),o)})))()},get logSettings(){return e.props.state.logSettings},changeLogSettings:function(r){return o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=bc(bc({},e.props.state.logSettings),r),e.props.dispatch({type:"CHANGE_LOG_SETTINGS",payload:o});case 2:case"end":return t.stop()}}),n)})))()}};return A(a),a}(e)),Ho}}},watcher:function(e){var t,r,n;return function(){t===e.props.state.login.localUsers&&r===e.props.state.paused&&n===e.props.state.logSettings||(t=e.props.state.login.localUsers,r=e.props.state.paused,n=e.props.state.logSettings,null!=e.props.output.context.api&&U(e.props.output.context.api))}}}),gc=500,mc=3,wc=[];function Ec(e){wc.length<=0&&_c();for(var t=!1,r=0;r<wc.length;r++){var n=wc[r];if(n.id===e.id&&n.action===e.action){n.updateFunc=e.updateFunc,t=!0;break}}t||wc.push(e)}function _c(){setTimeout((function(){for(var e=Math.min(mc,wc.length),t=0;t<e;t++){var r=wc.shift();null!=r&&r.updateFunc()}wc.length>0&&_c()}),gc)}var Cc=r(3546);function xc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xc(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xc(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ac(e,t){var r=Tc(e);return"number"==typeof e.amountFiat&&(r.exchangeAmount[t]=e.amountFiat),r}var Ic=be("high","standard","low"),Oc=de({orderId:he(pe),orderUri:he(pe),isEstimate:oe,plugin:de({pluginId:pe,displayName:pe,supportEmail:he(pe)}),payoutAddress:pe,payoutCurrencyCode:pe,payoutNativeAmount:pe,payoutWalletId:pe,refundAddress:he(pe)}),Tc=de({bizId:he(le),category:he(pe),exchangeAmount:he(se(le),{}),name:he(pe),notes:he(pe)}),kc=ne(pe),Pc=de({txid:pe,internal:oe,creationDate:le,currencies:se(de({metadata:Tc,nativeAmount:he(pe),providerFeeSent:he(pe)})),deviceDescription:he(pe),feeRateRequested:he(ue(Ic,Kt)),feeRateUsed:he(Kt),payees:he(ne(de({address:pe,amount:pe,currency:pe,tag:he(pe)}))),secret:he(pe),swap:he(Oc)}),Bc=de({airbitzFeeWanted:le,meta:de({amountFeeAirBitzSatoshi:le,balance:le,fee:le,amountCurrency:le,bizId:le,category:pe,name:pe,notes:pe,attributes:le,amountSatoshi:le,amountFeeMinersSatoshi:le,airbitzFee:le}),ntxid:pe,state:de({creationDate:le,internal:oe,malleableTxId:pe})}),Rc=de({seq:le,address:pe,state:de({recycleable:he(oe,!0),creationDate:he(le,0)}),meta:de({amountSatoshi:he(le,0)}).withRest}),jc=se(de({timestamp:le,txidHash:pe})),Mc=de({walletInfo:de({id:pe,keys:Kt,type:pe})}),Nc=de({fiat:he(pe),num:he(le)}),Dc=de({walletName:ue(pe,fe)}),Lc="Currency.json",Uc="EnabledTokens.json",Hc="fixedLegacyFileNames.json",Kc="WalletName.json",Fc=Ht(kc),Gc=Ht(Rc),qc=Ht(jc),zc=Ht(Bc),Wc=Ht(Pc),Vc=Ht(Nc),Yc=Ht(Dc);function Jc(e,t){return Zc.apply(this,arguments)}function Zc(){return(Zc=o()(t().mark((function e(r,n){var o,i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.state,a=o.walletId,u=Gt(i,a),e.next=4,Fc.save(u,Uc,n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xc(e,t,r){var n={creationDate:e.state.creationDate,currencies:{},internal:e.state.internal,txid:e.state.malleableTxId},o={};return o[r]=e.meta.amountCurrency,n.currencies[t]={metadata:{bizId:e.meta.bizId,category:e.meta.category,exchangeAmount:o,name:e.meta.name,notes:e.meta.notes},providerFeeSent:e.meta.amountFeeAirBitzSatoshi.toFixed()},n}function $c(e,t,r,n){var o=Wt(e,t,n);return{fileName:"".concat(r.toFixed(0),"-").concat(o,".json"),txidHash:o}}function Qc(e,t){return ef.apply(this,arguments)}function ef(){return(ef=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.state,u=o.walletId,s=Gt(a,u),e.next=4,Yc.save(s,Kc,{walletName:n});case 4:i({type:"CURRENCY_WALLET_NAME_CHANGED",payload:{name:n,walletId:u}});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tf(e,t){return rf.apply(this,arguments)}function rf(){return(rf=o()(t().mark((function e(r,n){var o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.props,i=o.dispatch,a=o.state,u=o.walletId,s=Gt(a,u),/^iso:/.test(n)){e.next=4;break}throw new TypeError("Fiat currency codes must start with `iso:`");case 4:return e.next=6,Vc.save(s,Lc,{fiat:n,num:void 0});case 6:i({type:"CURRENCY_WALLET_FIAT_CHANGED",payload:{fiatCurrencyCode:n,walletId:u}});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nf(e){return of.apply(this,arguments)}function of(){return(of=o()(t().mark((function e(r){var n,o,i,a,u,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,a=n.walletId,u=Gt(i,a),e.next=4,Fc.load(u,Uc);case 4:if(null!=(s=e.sent)){e.next=7;break}return e.abrupt("return");case 7:o({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:r.props.walletId,currencyCodes:s}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function af(e){return uf.apply(this,arguments)}function uf(){return(uf=o()(t().mark((function e(r){var n,o,i,a,u,s,c;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,a=n.walletId,u=Gt(i,a),e.next=4,Vc.load(u,Lc);case 4:s=e.sent,c="iso:USD",null!=s&&(null!=s.fiat?c=s.fiat:null!=s.num&&(c="iso:".concat((0,Cc.Rx)("000".concat(s.num).slice(-3)).code))),o({type:"CURRENCY_WALLET_FIAT_CHANGED",payload:{fiatCurrencyCode:c,walletId:a}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sf(e){return cf.apply(this,arguments)}function cf(){return(cf=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,a=n.walletId,u=Gt(i,a),e.next=4,Yc.load(u,Kc);case 4:if(s=e.sent,c=null,null!=s&&null!=s.walletName){e.next=17;break}if(f=r.props.walletState.walletInfo.appIds,null==(l=(void 0===f?[]:f).find((function(e){return""!==e})))){e.next=15;break}return e.next=12,Gu(tl(r),l);case 12:d=e.sent,h=d.displayName,c=h;case 15:e.next=18;break;case 17:c=s.walletName;case 18:o({type:"CURRENCY_WALLET_NAME_CHANGED",payload:{name:"string"==typeof c?c:null,walletId:a}});case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ff(e,t){return lf.apply(this,arguments)}function lf(){return lf=o()(t().mark((function e(r,n){var i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props.walletId,a=Gt(r.props.state,i),u=r.props.dispatch,s=r.props.walletState.currencyInfo.currencyCode,c=r.props.walletState.fileNames,f=r.props.walletState.fiat,l={},e.next=9,Promise.all(n.map(function(){var e=o()(t().mark((function e(r){var n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=c[r]){e.next=2;break}return e.abrupt("return");case 2:return n="Transactions/".concat(c[r].fileName),e.next=5,zc.load(a,n);case 5:if(null!=(o=e.sent)){e.next=8;break}return e.abrupt("return");case 8:l[r]=Xc(o,s,f);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:return e.next=11,Promise.all(n.map(function(){var e=o()(t().mark((function e(r){var n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=c[r]){e.next=2;break}return e.abrupt("return");case 2:return n="transaction/".concat(c[r].fileName),e.next=5,Wc.load(a,n);case 5:if(null!=(o=e.sent)){e.next=8;break}return e.abrupt("return");case 8:l[r]=o;case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:return u({type:"CURRENCY_WALLET_FILES_LOADED",payload:{files:l,walletId:i}}),e.abrupt("return",l);case 13:case"end":return e.stop()}}),e)}))),lf.apply(this,arguments)}function df(e,t,r){return hf.apply(this,arguments)}function hf(){return hf=o()(t().mark((function e(r,n,i){var a,u,s,c,f,l,d,h,p,y,b,v;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=qt(r,n),e.next=3,qc.load(u,Hc);case 3:if(e.t1=a=e.sent,e.t0=null!==e.t1,!e.t0){e.next=7;break}e.t0=void 0!==a;case 7:if(!e.t0){e.next=11;break}e.t2=a,e.next=12;break;case 11:e.t2={};case 12:return s=e.t2,e.t3=Q.gQ,e.next=16,i.list();case 16:for(e.t4=e.sent,c=(0,e.t3)(e.t4),f={},l=[],d=0;d<c.length;d++)h=c[d],(p=s[h])?(y=p.timestamp,b=p.txidHash,f[b]={creationDate:y,fileName:h}):l.push(h);if(v=l.map(function(){var e=o()(t().mark((function e(o){var a,u,c,l,d,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zc.load(i,o);case 2:if(null!=(a=e.sent)){e.next=5;break}return e.abrupt("return");case 5:u=a.state,c=u.creationDate,l=u.malleableTxId,d=o,h=Wt(r,n,l),f[h]={creationDate:c,fileName:d},s[d]={timestamp:c,txidHash:h};case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!v.length){e.next=27;break}return e.next=25,Promise.all(v);case 25:return e.next=27,qc.save(u,Hc,s).catch((function(){}));case 27:return e.abrupt("return",f);case 28:case"end":return e.stop()}}),e)}))),hf.apply(this,arguments)}function pf(e){return yf.apply(this,arguments)}function yf(){return(yf=o()(t().mark((function e(r){var n,o,i,u,s,c,f,l,d,h,p,y,b,v,g,m;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.props,o=n.dispatch,i=n.state,u=n.walletId,s=Gt(i,u),e.next=4,df(i,u,(0,Q.HN)(s,"Transactions"));case 4:return c=e.sent,e.next=7,(0,Q.HN)(s,"transaction").list();case 7:for(f=e.sent,l=0,d=(0,Q.gQ)(f);l<d.length;l++)h=d[l],p=h.split(".json")[0],y=p.split("-"),b=a()(y,2),v=b[0],g=b[1],m=parseInt(v),(null==c[g]||m<c[g].creationDate)&&(c[g]={creationDate:m,fileName:h});o({type:"CURRENCY_WALLET_FILE_NAMES_LOADED",payload:{txFileNames:c,walletId:u}});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bf(e){return vf.apply(this,arguments)}function vf(){return vf=o()(t().mark((function e(r){var n,i,a,u,s,c,f,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.props,a=i.state,u=i.walletId,s=Gt(a,u),c=[],e.t0=Q.gQ,e.next=6,s.list("Addresses");case 6:return e.t1=e.sent,f=(0,e.t0)(e.t1),e.next=10,Promise.all(f.map(function(){var e=o()(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Gc.load(s,r);case 2:if(null!=(n=e.sent)){e.next=5;break}return e.abrupt("return");case 5:if(""!==n.address&&!n.state.recycleable){e.next=7;break}return e.abrupt("return");case 7:c.push(n.address);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 10:if(null==(l=null===(n=r.props.walletOutput)||void 0===n?void 0:n.engine)){e.next=14;break}return e.next=14,l.addGapLimitAddresses(c);case 14:case"end":return e.stop()}}),e)}))),vf.apply(this,arguments)}function gf(e){return mf.apply(this,arguments)}function mf(){return(mf=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nf(r);case 2:return e.next=4,af(r);case 4:return e.next=6,sf(r);case 6:return e.next=8,pf(r);case 8:return e.next=10,bf(r);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wf(e,t,r,n,o){return Ef.apply(this,arguments)}function Ef(){return(Ef=o()(t().mark((function e(r,n,o,i,a){var u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=r.props,s=u.dispatch,c=u.state,f=u.walletId,l=Gt(c,f),d=r.props.walletState.txs[n]){e.next=5;break}throw new Error("Setting metatdata for missing tx ".concat(n));case 5:h=r.props.walletState.files,p="",y=0,b=Object.keys(h);case 8:if(!(y<b.length)){e.next=16;break}if(v=b[y],h[v].txid!==n){e.next=13;break}return p=v,e.abrupt("break",16);case 13:y++,e.next=8;break;case 16:return g=r.props.walletState.files[p],m=null==g?Date.now()/1e3:g.creationDate,w=$c(c,f,m,n),E=w.fileName,_=w.txidHash,(C={txid:n,internal:!1,creationDate:m,currencies:{}}).currencies[o]={metadata:i},x=Lt(g,C),s({type:"CURRENCY_WALLET_FILE_CHANGED",payload:{creationDate:m,fileName:E,json:x,txid:n,txidHash:_,walletId:f}}),e.next=25,Wc.save(l,"transaction/"+E,x);case 25:S=Gf(r,d,x,o),a.onTransactionsChanged([S]);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _f(e,t){return Cf.apply(this,arguments)}function Cf(){return(Cf=o()(t().mark((function e(r,n){var o,i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S,A;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.props,i=o.dispatch,a=o.walletState,u=o.state,s=o.walletId,c=a.accountId,f=a.fiat,l=void 0===f?"iso:USD":f,d=a.pluginId,h=n.currencyCode,p=n.spendTargets,y=n.swapData,b=n.txid,v=Gt(u,s),g=Date.now()/1e3,m=ki(u,h,l,(function(){return 1}))/parseFloat(_r(te()({},d,r.props.state.plugins.currency[d]),r.props.state.accounts[c].customTokens[d],h)),w=n.nativeAmount,E=m*Number(w),(_=null!=n.metadata?Ac(n.metadata,l):{exchangeAmount:{}}).exchangeAmount[l]=E,(C={txid:b,internal:!0,creationDate:g,currencies:{},swap:y}).currencies[h]={metadata:_,nativeAmount:w},null!=n.networkFeeOption&&(C.feeRateRequested="custom"===n.networkFeeOption?n.requestedCustomFee:n.networkFeeOption),C.feeRateUsed=n.feeRateUsed,null!=p&&(C.payees=p.map((function(e){return{currency:e.currencyCode,address:e.publicAddress,amount:e.nativeAmount,tag:e.memo}})),null!=n.deviceDescription&&(C.deviceDescription=n.deviceDescription)),"string"==typeof n.txSecret&&(C.secret=n.txSecret),x=$c(u,s,g,b),S=x.fileName,A=x.txidHash,i({type:"CURRENCY_WALLET_FILE_CHANGED",payload:{creationDate:g,fileName:S,json:C,txid:b,txidHash:A,walletId:s}}),e.next=20,Wc.save(v,"transaction/"+S,C);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Sf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xf(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Af=[],If=Ks({accountId:function(e,t,r){if(null!=e)return e;for(var n=0,o=Object.keys(r.root.accounts);n<o.length;n++)for(var i=o[n],a=r.root.accounts[i],u=0,s=Object.keys(a.walletInfos);u<s.length;u++){if(s[u]===r.id)return i}throw new Error("Cannot find account for walletId ".concat(r.id))},pluginId:Ys((function(e){return e.root.login.walletInfos[e.id].type}),(function(e){return e.root.plugins.currency}),(function(e,t){return xr(t,e)})),paused:function(e,t,r){return null==e?r.root.accounts[r.self.accountId].pauseWallets:"CURRENCY_WALLET_CHANGED_PAUSED"===t.type?t.payload.paused:e},currencyInfo:function(e,t,r){if(e)return e;var n=r.self.pluginId;return r.root.plugins.currency[n].currencyInfo},displayPrivateSeed:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_SEEDS"===t.type?t.payload.displayPrivateSeed:e},displayPublicSeed:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_SEEDS"===t.type?t.payload.displayPublicSeed:e},enabledTokenIds:Ys((function(e){return e.root.accounts[e.self.accountId].builtinTokens[e.self.pluginId]}),(function(e){return e.root.accounts[e.self.accountId].customTokens[e.self.pluginId]}),(function(e){return e.self.currencyInfo}),(function(e){return e.self.enabledTokens}),(function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>3?arguments[3]:void 0,n=ts(e),o=ts(t),i=[],a=0;a<r.length;a++){var u,s=r[a],c=null!==(u=o[s])&&void 0!==u?u:n[s];null!=c&&i.push(c)}return i})),enabledTokens:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Af,t=arguments.length>1?arguments[1]:void 0;if("CURRENCY_WALLET_ENABLED_TOKENS_CHANGED"===t.type){var r=t.payload.currencyCodes;if(r.sort((function(e,t){return e===t?0:e>t?1:-1})),!Zs(r,e))return r}return e},engineFailure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_FAILED"===t.type?t.payload.error:e},engineStarted:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_STARTED"===t.type||"CURRENCY_ENGINE_STOPPED"!==t.type&&e},fiat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_FIAT_CHANGED"===t.type?t.payload.fiatCurrencyCode:e},fiatLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_FIAT_CHANGED"===t.type||e},files:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CURRENCY_WALLET_FILE_CHANGED":var r=t.payload,n=r.json,o=r.txidHash,i=Sf({},e);return i[o]=n,i;case"CURRENCY_WALLET_FILES_LOADED":var a=t.payload.files;return Sf(Sf({},e),a)}return e},sortedTransactions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{txidHashes:{},sortedList:[]},t=arguments.length>1?arguments[1]:void 0,r=e.txidHashes;switch(t.type){case"CURRENCY_ENGINE_CHANGED_TXS":return Of(r,t.payload.txidHashes);case"CURRENCY_WALLET_FILE_NAMES_LOADED":for(var n=t.payload.txFileNames,o={},i=0,a=Object.keys(n);i<a.length;i++){var u=a[i];o[u]=n[u].creationDate}return Of(r,o)}return e},fileNames:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CURRENCY_WALLET_FILE_NAMES_LOADED":var r=t.payload.txFileNames;return Sf(Sf({},e),r);case"CURRENCY_WALLET_FILE_CHANGED":var n=t.payload,o=n.fileName,i=n.creationDate,a=n.txidHash;return(!e[a]||i<e[a].creationDate)&&(e[a]={creationDate:i,fileName:o}),e}return e},fileNamesLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_FILE_NAMES_LOADED"===t.type||e},syncRatio:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CURRENCY_ENGINE_CHANGED_SYNC_RATIO":return t.payload.ratio;case"CURRENCY_ENGINE_CLEARED":return 0}return e},balances:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("CURRENCY_ENGINE_CHANGED_BALANCE"===t.type){var r=Sf({},e);return r[t.payload.currencyCode]=t.payload.balance,r}return e},height:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_HEIGHT"===t.type?t.payload.height:e},name:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_NAME_CHANGED"===t.type?t.payload.name:e},nameLoaded:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_NAME_CHANGED"===t.type||e},stakingStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{stakedAmounts:[]},t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_CHANGED_STAKING"===t.type?t.payload.stakingStatus:e},txids:Ys((function(e){return e.self.txs}),(function(e){return Object.keys(e)})),txs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;switch(t.type){case"CHANGE_MERGE_TX":var n=t.payload.tx,o=Sf({},e);return o[n.txid]=n,o;case"CURRENCY_ENGINE_CHANGED_TXS":for(var i=t.payload.txs,a=r.self.currencyInfo.currencyCode,u=Sf({},e),s=0;s<i.length;s++){var c=i[s];u[c.txid]=Pf(c,a,u[c.txid])}return u;case"CURRENCY_ENGINE_CLEARED":return{}}return e},gotTxs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_ENGINE_GOT_TXS"===t.type&&(e[t.payload.currencyCode]=!0),e},walletInfo:function(e,t,r){return r.root.login.walletInfos[r.id]},publicWalletInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"CURRENCY_WALLET_PUBLIC_INFO"===t.type?t.payload.walletInfo:e}});function Of(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r],i=t[o];(!e[o]||i<e[o])&&(e[o]=i)}return{sortedList:Object.keys(e).sort((function(t,r){return e[t]>e[r]?-1:e[t]<e[r]?1:0})),txidHashes:e}}var Tf=qs(If,(function(e,t){return/^CURRENCY_/.test(e.type)&&null!=e.payload&&e.payload.walletId===t.id?e:{type:"UPDATE_NEXT"}})),kf={confirmations:"unconfirmed",currencyCode:"",blockHeight:0,date:0,ourReceiveAddresses:[],signedTx:"",txid:"",nativeAmount:{},networkFee:{},providerFee:{}};function Pf(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:kf,o=null!=e.currencyCode?e.currencyCode:t,i={confirmations:null!==(r=e.confirmations)&&void 0!==r?r:"unconfirmed",currencyCode:o,blockHeight:e.blockHeight,date:e.date,ourReceiveAddresses:e.ourReceiveAddresses,signedTx:e.signedTx,txid:e.txid,otherParams:e.otherParams,nativeAmount:Sf({},n.nativeAmount),networkFee:Sf({},n.networkFee)};return i.nativeAmount[o]=e.nativeAmount,i.networkFee[o]=null!=e.networkFee?e.networkFee.toString():"0",null!=e.parentNetworkFee&&(i.networkFee[t]=String(e.parentNetworkFee)),i}var Bf=5e3;function Rf(e,t){var r=e.props,n=r.log,o=r.walletId,i=!1,a=0,u=[];return function(e){if(i){var r;n("throttledTxCallback delay, walletId: ".concat(o)),(r=u).push.apply(r,lt()(e))}else{var s=Date.now();s-a>Bf?(a=s,t(e)):(n("throttledTxCallback delay, walletId: ".concat(o)),i=!0,u=e,setTimeout((function(){a=Date.now(),t(u),i=!1,u=[]}),Bf))}}}function jf(e){var t=e.props.walletId;"narfavJN4rp9ZzYigcRj1i0vrU2OAGGp4+KksAksj54="===t&&(Bf=25,mc=99,gc=1);var r=Rf(e,(function(t){null!=e.props.walletOutput&&null!=e.props.walletOutput.walletApi&&L(e.props.walletOutput.walletApi,"transactionsChanged",t)})),n=Rf(e,(function(t){null!=e.props.walletOutput&&null!=e.props.walletOutput.walletApi&&L(e.props.walletOutput.walletApi,"newTransactions",t)}));return{onAddressesChecked:function(r){Ec({id:t,action:"onAddressesChecked",updateFunc:function(){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_SYNC_RATIO",payload:{ratio:r,walletId:t}})}})},onBalanceChanged:function(r,n){Ec({id:"".concat(t,"==").concat(r),action:"onBalanceChanged",updateFunc:function(){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_BALANCE",payload:{balance:n,currencyCode:r,walletId:t}})}})},onBlockHeightChanged:function(n){Ec({id:t,action:"onBlockHeightChanged",updateFunc:function(){for(var o=e.props.walletState.txs,i=Object.values(o),a=0;a<i.length;a++){var u=i[a];if("confirmed"!==u.confirmations&&"dropped"!==u.confirmations){var s=e.props.walletState.currencyInfo.requiredConfirmations,c=e.props.walletState.height;u.confirmations=Nf(u,c,s);var f=Wt(e.props.state,t,u.txid),l=e.props.walletState.files,d=Gf(e,u,l[f],u.currencyCode);e.props.dispatch({type:"CHANGE_MERGE_TX",payload:{tx:u}}),r([d])}}e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_HEIGHT",payload:{height:n,walletId:t}})}})},onStakingStatusChanged:function(r){Ec({id:t,action:"onStakingStatusChanged",updateFunc:function(){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_STAKING",payload:{stakingStatus:r,walletId:t}})}})},onTransactionsChanged:function(o){if(o){for(var i=0;i<o.length;i++){var a=o[i];if("string"!=typeof a.txid||"number"!=typeof a.date||"string"!=typeof a.networkFee||"number"!=typeof a.blockHeight||"string"!=typeof a.nativeAmount||"object"!==Nt()(a.ourReceiveAddresses))return void e.props.onError(new Error("Plugin sent bogus tx: ".concat(JSON.stringify(a,null,2))))}for(var u=e.props.state,s=e.props.walletState,c=s.fileNames,f=s.fileNamesLoaded,l=s.txs,d=e.props.walletState.currencyInfo.currencyCode,h={},p=[],y=[],b=0;b<o.length;b++){var v=o[b],g=v.txid;if("confirmed"!==v.confirmations&&"dropped"!==v.confirmations){var m=e.props.walletState.currencyInfo.requiredConfirmations,w=e.props.walletState.height;v.confirmations=Nf(v,w,m)}var E=Pf(v,d,l[g]);if(!Zs(E,l[g])){var _=Wt(u,t,g),C=null!=v.spendTargets||f&&null==c[_];C&&_f(e,v).catch((function(t){return e.props.onError(t)}));var x=e.props.walletState.files,S=Gf(e,E,x[_],v.currencyCode);C?y.push(S):null!=x[_]&&p.push(S),h[_]=S.date}}e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_TXS",payload:{txs:o,walletId:t,txidHashes:h}}),p.length&&r(p),y.length&&n(y)}},onAddressChanged:function(){L(e.props.walletOutput.walletApi,"addressChanged",void 0)},onWcNewContractCall:function(t){L(e.props.walletOutput.walletApi,"wcNewContractCall",t)},onTxidsChanged:function(){}}}function Mf(e){var t,r=e.props.walletId;!function n(o){var i=function(e,t){return e.storageWallets[t].lastChanges}(o.state,r);i!==t&&(t=i,gf(e).catch((function(t){return e.props.onError(t)}))),e.nextProps().then(n).catch((function(t){(function(e){return e instanceof Error&&"PixieShutdownError"===e.name})(t)||e.props.onError(t)}))}(e.props)}var Nf=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=0===e.blockHeight?0:1+t-e.blockHeight,o=n>=r?"confirmed":n<=0?"unconfirmed":n;return o};function Df(e,t){var r=t.startDate,n=void 0===r?-1/0:r,o=t.endDate,i=void 0===o?Date.now():o;return 1e3*e.date>=n&&1e3*e.date<i}function Lf(e,t){var r=t.searchString;if(null!=r&&""!==r){for(var n=function(e){return null!=e&&("string"==typeof e||"number"==typeof e)&&!(e.toString().toLowerCase().replace(".","").replace(",","").indexOf(o)<0)},o=r.toLowerCase().replace(".","").replace(",",""),i=0;i<o.length;i++)if("0"!==o[i]){o=o.substring(i);break}if(n(e.nativeAmount))return!0;if(null!=e.metadata){var a=e.metadata,u=a.category,s=void 0===u?"":u,c=a.name,f=void 0===c?"":c,l=a.notes,d=void 0===l?"":l,h=a.exchangeAmount,p=void 0===h?{}:h;if(n(s)||n(f)||n(d)||null!=e.wallet&&n(p[e.wallet.fiatCurrencyCode]))return!0}if(null!=e.swapData&&null!=e.swapData.plugin){var y=e.swapData.plugin,b=y.displayName,v=void 0===b?"":b,g=y.pluginId,m=void 0===g?"":g;if(n(v)||n(m))return!0}if(null!=e.spendTargets)for(var w=0,E=e.spendTargets;w<E.length;w++){var _=E[w],C=_.publicAddress,x=void 0===C?"":C,S=_.memo,A=void 0===S?"":S;if(n(x)||n(A))return!0}if(e.ourReceiveAddresses.length>0)for(var I=0,O=e.ourReceiveAddresses;I<O.length;I++){if(n(O[I]))return!0}return!!n(e.txid)}return!0}function Uf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Uf(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kf={bizId:0,category:"",exchangeAmount:{},name:"",notes:""};function Ff(e,r,n,i){var a=tl(e),u=e.props.walletState,s=u.accountId,c=u.pluginId,f=u.walletInfo,l=e.props.state.plugins.currency[c],d=ka(a,f),h=jf(e),p={};function y(){if(a.props.state.hideKeys)throw new Error("Not available when `hideKeys` is enabled")}null!=r.otherMethods&&A(p=r.otherMethods);var b={on:J,watch:Z,get id(){return d.id},get type(){return d.type},get keys(){return y(),d.keys},publicWalletInfo:i,get disklet(){return d.disklet},get localDisklet(){return d.localDisklet},sync:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.sync();case 2:case"end":return e.stop()}}),e)})))()},get displayPrivateSeed(){return y(),e.props.walletState.displayPrivateSeed},get displayPublicSeed(){return e.props.walletState.displayPublicSeed},get name(){return e.props.walletState.name},renameWallet:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qc(e,r);case 2:case"end":return t.stop()}}),n)})))()},get currencyConfig(){return e.props.output.accounts[s].accountApi.currencyConfig[c]},get currencyInfo(){return l.currencyInfo},validateMemo:function(e){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=n.validateMemo){t.next=2;break}return t.abrupt("return",{passed:!0});case 2:return t.next=4,n.validateMemo(e);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),r)})))()},nativeToDenomination:function(r,n){return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=_r(te()({},c,e.props.state.plugins.currency[c]),e.props.state.accounts[s].customTokens[c],n),t.abrupt("return",Fa(r,i,i.length));case 2:case"end":return t.stop()}}),o)})))()},denominationToNative:function(r,n){return o()(t().mark((function o(){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=_r(te()({},c,e.props.state.plugins.currency[c]),e.props.state.accounts[s].customTokens[c],n),t.abrupt("return",Ha(r,i));case 2:case"end":return t.stop()}}),o)})))()},get fiatCurrencyCode(){return e.props.walletState.fiat},setFiatCurrencyCode:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,tf(e,r);case 2:case"end":return t.stop()}}),n)})))()},get balances(){return e.props.walletState.balances},get blockHeight(){return e.props.walletState.height},get syncRatio(){return e.props.walletState.syncRatio},get paused(){return e.props.walletState.paused},changePaused:function(r){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.props.dispatch({type:"CURRENCY_WALLET_CHANGED_PAUSED",payload:{walletId:e.props.walletId,paused:r}});case 1:case"end":return t.stop()}}),n)})))()},get enabledTokenIds(){return e.props.walletState.enabledTokenIds},changeEnabledTokenIds:function(r){return o()(t().mark((function n(){var o,i,a,u,f,l,d,h,p;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.state,u=o.walletId,f=o.walletState,l=a.accounts[s],d=l.builtinTokens,h=l.customTokens,p=f.currencyInfo,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:u,currencyCodes:ns(rs(d[c],h[c],p,r))}});case 4:case"end":return t.stop()}}),n)})))()},changeEnabledTokens:function(r){return o()(t().mark((function n(){var o,i,a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.walletId,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:a,currencyCodes:ns(r)}});case 2:case"end":return t.stop()}}),n)})))()},enableTokens:function(r){return o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.walletId,u=o.walletState,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:a,currencyCodes:ns([].concat(lt()(u.enabledTokens),lt()(r)))}});case 2:case"end":return t.stop()}}),n)})))()},disableTokens:function(r){return o()(t().mark((function n(){var o,i,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=e.props,i=o.dispatch,a=o.walletId,u=o.walletState,i({type:"CURRENCY_WALLET_ENABLED_TOKENS_CHANGED",payload:{walletId:a,currencyCodes:ns(u.enabledTokens,r)}});case 2:case"end":return t.stop()}}),n)})))()},getEnabledTokens:function(){return o()(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.props.walletState.enabledTokens);case 1:case"end":return t.stop()}}),r)})))()},addCustomToken:function(e){return o()(t().mark((function o(){var i,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(f=void 0,l=void 0,d=void 0,f=(o=e).currencyCode,l=o.currencyName,d=o.contractAddress,i={currencyCode:f,denominations:[{multiplier:o.multiplier,name:f}],displayName:l,networkLocation:{contractAddress:d}},u=hs(e.contractAddress),null==n.getTokenId){t.next=7;break}return t.next=5,n.getTokenId(i);case 5:t.next=9;break;case 7:return t.next=9,r.addCustomToken(Hf(Hf({},i),e));case 9:a.props.dispatch({type:"ACCOUNT_CUSTOM_TOKEN_ADDED",payload:{accountId:s,pluginId:c,tokenId:u,token:i}});case 10:case"end":return t.stop()}var o,f,l,d}),o)})))()},getNumTransactions:function(){var e=arguments;return o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:{},t.abrupt("return",r.getNumTransactions(o));case 2:case"end":return t.stop()}}),n)})))()},getTransactions:function(){var n=arguments;return o()(t().mark((function o(){var i,a,u,s,c,f,d,p,y,b,v,g,m,w,E,_,C,x,S,A,I,O,T,k,P,B;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n.length>0&&void 0!==n[0]?n[0]:{},a=i.currencyCode,u=void 0===a?l.currencyInfo.currencyCode:a,(s=e.props.walletState).gotTxs[u]){t.next=10;break}return t.next=6,r.getTransactions({currencyCode:i.currencyCode});case 6:c=t.sent,h.onTransactionsChanged(c),e.props.dispatch({type:"CURRENCY_ENGINE_GOT_TXS",payload:{walletId:e.props.walletId,currencyCode:u}}),s=e.props.walletState;case 10:f=s.txids,d=s.txs,p=i.startIndex,y=void 0===p?0:p,b=i.startEntries,v=void 0===b?f.length:b,g=s.files,m=s.sortedTransactions.sortedList,w={},m.forEach((function(e,t){w[e]=t})),E=0,_=0,C=[];case 20:if(!(E<v)){t.next=48;break}if(0!==(x=m.slice(y+v*_,y+v*(_+1))).length){t.next=24;break}return t.abrupt("break",48);case 24:return S=x.filter((function(e){return!g[e]})),t.next=27,ff(e,S);case 27:A=t.sent,Object.assign(g,A),I=0;case 30:if(!(I<x.length)){t.next=45;break}if(O=x[I],null!=(T=g[O])){t.next=35;break}return t.abrupt("continue",42);case 35:if((k=d[T.txid])&&(k.nativeAmount[u]||k.networkFee[u])){t.next=38;break}return t.abrupt("continue",42);case 38:P=Hf(Hf({},k),{},{unfilteredIndex:w[O]}),Lf(B=Gf(e,P,T,u),i)&&Df(B,i)&&C.push(B),E++;case 42:I++,t.next=30;break;case 45:_++,t.next=20;break;case 48:return t.abrupt("return",C);case 49:case"end":return t.stop()}}),o)})))()},getReceiveAddress:function(){var e=arguments;return o()(t().mark((function n(){var o,i,a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=e.length>0&&void 0!==e[0]?e[0]:{},t.next=3,r.getFreshAddress(o);case 3:return i=t.sent,a={metadata:Kf,nativeAmount:"0",publicAddress:i.publicAddress,legacyAddress:i.legacyAddress,segwitAddress:i.segwitAddress},t.abrupt("return",a);case 6:case"end":return t.stop()}}),n)})))()},saveReceiveAddress:function(e){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},lockReceiveAddress:function(e){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},makeSpend:function(n){return o()(t().mark((function o(){var i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S,A,I,O,T,k,P;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.props.walletState.currencyInfo,a=n.currencyCode,u=void 0===a?i.currencyCode:a,s=n.privateKeys,c=n.spendTargets,f=void 0===c?[]:c,l=n.noUnconfirmed,d=void 0!==l&&l,h=n.networkFeeOption,p=void 0===h?"standard":h,y=n.customNetworkFee,b=n.rbfTxid,v=n.metadata,g=n.swapData,m=n.otherParams,w=[],E=[],_=0;case 5:if(!(_<f.length)){t.next=18;break}if(C=f[_],x=C.publicAddress,S=C.nativeAmount,A=void 0===S?"0":S,I=C.otherParams,O=void 0===I?{}:I,null!=x){t.next=10;break}return t.abrupt("continue",15);case 10:T=C.memo,null==(k=void 0===T?C.uniqueIdentifier:T)&&"string"==typeof O.uniqueIdentifier&&(k=O.uniqueIdentifier),null!=k&&(O.uniqueIdentifier=k),w.push({memo:k,nativeAmount:A,otherParams:O,publicAddress:x,uniqueIdentifier:k}),E.push({currencyCode:u,memo:k,nativeAmount:A,publicAddress:x,uniqueIdentifier:k});case 15:_++,t.next=5;break;case 18:if(0!==w.length){t.next=20;break}throw new TypeError("The spend has no destination");case 20:if(null==s){t.next=22;break}throw new TypeError("Only sweepPrivateKeys takes private keys");case 22:return t.next=24,r.makeSpend({currencyCode:u,spendTargets:w,noUnconfirmed:d,networkFeeOption:p,customNetworkFee:y,rbfTxid:b,metadata:v,otherParams:m});case 24:return(P=t.sent).networkFeeOption=p,P.requestedCustomFee=y,P.spendTargets=E,null!=v&&(P.metadata=v),null!=g&&(P.swapData=Oc(g)),null!=e.props.state.login.deviceDescription&&(P.deviceDescription=e.props.state.login.deviceDescription),t.abrupt("return",P);case 32:case"end":return t.stop()}}),o)})))()},sweepPrivateKeys:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.sweepPrivateKeys){t.next=2;break}return t.abrupt("return",Promise.reject(new Error("Sweeping this currency is not supported.")));case 2:return t.abrupt("return",r.sweepPrivateKeys(e));case 3:case"end":return t.stop()}}),n)})))()},signTx:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.signTx(e));case 1:case"end":return t.stop()}}),n)})))()},broadcastTx:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.broadcastTx(e));case 1:case"end":return t.stop()}}),n)})))()},saveTx:function(n){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,_f(e,n);case 2:return t.next=4,r.saveTx(n);case 4:h.onTransactionsChanged([n]);case 5:case"end":return t.stop()}}),o)})))()},get stakingStatus(){return e.props.walletState.stakingStatus},resyncBlockchain:function(){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.props.dispatch({type:"CURRENCY_ENGINE_CLEARED",payload:{walletId:e.props.walletId}}),t.next=3,r.resyncBlockchain();case 3:case"end":return t.stop()}}),n)})))()},dumpData:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.dumpData();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))()},getPaymentProtocolInfo:function(e){return o()(t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.getPaymentProtocolInfo){t.next=2;break}throw new Error("'getPaymentProtocolInfo' is not implemented on wallets of this type");case 2:return t.abrupt("return",r.getPaymentProtocolInfo(e));case 3:case"end":return t.stop()}}),n)})))()},saveTxMetadata:function(r,n,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,wf(e,r,n,Ac(i,e.props.walletState.fiat),h);case 2:case"end":return t.stop()}}),o)})))()},getMaxSpendable:function(e){return o()(t().mark((function n(){var o,i,a,u,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=function(e,t){var n=Ka(t,e);if(qa(n,"1"))return Promise.resolve(e);var u=Ua(e,Fa(n,"2"));return s[0].nativeAmount=u,r.makeSpend({currencyCode:o,spendTargets:s,networkFeeOption:i,customNetworkFee:a}).then((function(e){return c(u,t)})).catch((function(t){return c(e,u)}))},"function"!=typeof r.getMaxSpendable){t.next=5;break}return t.next=4,r.getMaxSpendable(e);case 4:return t.abrupt("return",t.sent);case 5:return o=e.currencyCode,i=e.networkFeeOption,a=e.customNetworkFee,u=r.getBalance({currencyCode:o}),s=e.spendTargets.map((function(e){return Hf(Hf({},e),{},{nativeAmount:"0"})})),t.abrupt("return",c("0",Ua(u,"1")));case 9:case"end":return t.stop()}}),n)})))()},parseUri:function(r,i){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.parseUri(r,i,bs(e.props.state.accounts[s].customTokens[c])));case 1:case"end":return t.stop()}}),o)})))()},encodeUri:function(r){return o()(t().mark((function o(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.encodeUri(r,bs(e.props.state.accounts[s].customTokens[c])));case 1:case"end":return t.stop()}}),o)})))()},otherMethods:p};return A(b),b}function Gf(e,t,r,n){var o,i,a,u=e.props.walletOutput.walletApi,s=e.props.walletState.currencyInfo.currencyCode,c=e.props.walletState.fiat,f=t.unfilteredIndex,l={confirmations:t.confirmations,blockHeight:t.blockHeight,date:t.date,ourReceiveAddresses:t.ourReceiveAddresses,signedTx:t.signedTx,txid:t.txid,otherParams:Hf(Hf({},t.otherParams),{},{unfilteredIndex:f}),amountSatoshi:Number(null!==(o=t.nativeAmount[n])&&void 0!==o?o:"0"),nativeAmount:null!==(i=t.nativeAmount[n])&&void 0!==i?i:"0",networkFee:null!==(a=t.networkFee[n])&&void 0!==a?a:"0",parentNetworkFee:t.networkFee[s],currencyCode:n,wallet:u,metadata:{}};if(null!=r){r.creationDate<l.date&&(l.date=r.creationDate);var d=Lt(r.currencies[s],r.currencies[n]);null!=d.metadata&&(l.metadata=Hf(Hf({},l.metadata),function(e,t){for(var r=Tc(e),n=r.exchangeAmount,o=0,i=Object.keys(n);o<i.length;o++){var a=i[o];/e/.test(String(n[a]))&&delete n[a]}return Sc(Sc({},r),{},{amountFiat:n[t]})}(d.metadata,c))),null!=r.feeRateRequested&&("string"==typeof r.feeRateRequested?l.networkFeeOption=r.feeRateRequested:(l.networkFeeOption="custom",l.requestedCustomFee=r.feeRateRequested)),l.feeRateUsed=r.feeRateUsed,null!=r.payees&&(l.spendTargets=r.payees.map((function(e){return{currencyCode:e.currency,memo:e.tag,nativeAmount:e.amount,publicAddress:e.address,uniqueIdentifier:e.tag}}))),null!=r.swap&&(l.swapData=Oc(r.swap)),"string"==typeof r.secret&&(l.txSecret=r.secret),null!=r.deviceDescription&&(l.deviceDescription=r.deviceDescription)}return l}function qf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qf(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Wf="publicKey.json",Vf=Ht(Mc),Yf=Mo({engine:function(e){return o()(t().mark((function r(){var n,o,i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props,o=n.state,i=n.walletId,a=n.walletState,u=a.accountId,s=a.pluginId,c=a.walletInfo,f=o.plugins.currency[s],t.prev=3,h=tl(e),t.next=7,li(h,c);case 7:return p=e.props.state,y=qt(p,c.id),b=zt(p,c.id,e.props.io),t.next=12,Ar(h,s);case 12:return v=t.sent,t.next=15,Jf(c,y,v);case 15:return g=t.sent,m={id:c.id,type:c.type,keys:zf(zf({},c.keys),g.keys)},e.props.dispatch({type:"CURRENCY_WALLET_PUBLIC_INFO",payload:{walletInfo:g,walletId:i}}),w=p.accounts[u],t.next=21,f.makeCurrencyEngine(m,{callbacks:jf(e),log:zo(e.props.logBackend,"".concat(f.currencyInfo.currencyCode,"-").concat(c.id.slice(0,2))),walletLocalDisklet:y,walletLocalEncryptedDisklet:b,customTokens:null!==(l=w.customTokens[s])&&void 0!==l?l:{},enabledTokenIds:e.props.walletState.enabledTokenIds,userSettings:null!==(d=w.userSettings[s])&&void 0!==d?d:{}});case 21:E=t.sent,e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_SEEDS",payload:{displayPrivateSeed:E.getDisplayPrivateSeed(),displayPublicSeed:E.getDisplayPublicSeed(),walletId:i}}),e.onOutput(E),_=f.currencyInfo.currencyCode,C=E.getBalance({currencyCode:_}),x=E.getBlockHeight(),e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_BALANCE",payload:{balance:C,currencyCode:_,walletId:i}}),e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_HEIGHT",payload:{height:x,walletId:i}}),null!=E.getStakingStatus&&E.getStakingStatus().then((function(t){e.props.dispatch({type:"CURRENCY_ENGINE_CHANGED_STAKING",payload:{stakingStatus:t,walletId:i}})})),t.next=36;break;case 32:t.prev=32,t.t0=t.catch(3),e.props.onError(t.t0),e.props.dispatch({type:"CURRENCY_ENGINE_FAILED",payload:{error:t.t0,walletId:i}});case 36:return gf(e).catch((function(t){return e.props.onError(t)})),Mf(e),t.abrupt("return",Ho);case 39:case"end":return t.stop()}}),r,null,[[3,32]])})))},walletApi:function(e){return o()(t().mark((function r(){var n,o,i,a,u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.props,o=n.walletOutput,i=n.walletState,null!=o){t.next=3;break}return t.abrupt("return");case 3:if(a=o.engine,u=i.nameLoaded,s=i.pluginId,c=i.publicWalletInfo,null!=a&&null!=c&&u){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,Ar(tl(e),s);case 9:return f=t.sent,l=Ff(e,a,f,c),e.onOutput(l),t.abrupt("return",Ho);case 13:case"end":return t.stop()}}),r)})))},engineStarted:Lo((function(e){var t;return{update:function(){var r=e.props,n=r.log,o=r.walletId,i=r.walletOutput,a=r.walletState;if(null!=i){var u=i.engine;null!=i.walletApi&&a.fiatLoaded&&a.fileNamesLoaded&&!a.engineStarted&&null!=u&&null==t&&(n("".concat(o," startEngine")),e.props.dispatch({type:"CURRENCY_ENGINE_STARTED",payload:{walletId:o}}),t=Promise.resolve().then((function(){return u.startEngine()})).catch((function(t){return e.props.onError(t)})))}},destroy:function(){var r=e.props,n=r.log,o=r.walletId,i=r.walletOutput;if(null!=i){var a=i.engine;null!=a&&null!=t&&(n("".concat(o," killEngine")),t.then((function(){return a.killEngine()})).catch((function(t){return e.props.onError(t)})).then((function(){return e.props.dispatch({type:"CURRENCY_ENGINE_STOPPED",payload:{walletId:o}})})).catch((function(){})))}}}}),(function(e){return e.state.paused||e.walletState.paused?void 0:e})),syncTimer:Lo((function(e){function r(){return(r=o()(t().mark((function r(){var n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.walletId,t.next=3,hi(tl(e),n);case 3:case"end":return t.stop()}}),r)})))).apply(this,arguments)}var n=$o((function(){return r.apply(this,arguments)}),3e4);return{update:function(){var t=e.props,r=t.state,o=t.walletId;null!=t.walletOutput&&null!=r.storageWallets[o]&&r.storageWallets[o].status.lastSync>0&&n.start({wait:!0})},destroy:function(){n.stop()}}}),(function(e){return e.state.paused||e.walletState.paused?void 0:e})),tokenSaver:function(e){var r=Af;return function(){var n=o()(t().mark((function n(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=e.props.walletState.enabledTokens)===r||null==o){t.next=6;break}return t.next=4,Jc(e,o).catch((function(t){return e.props.onError(t)}));case 4:return t.next=6,Qo(100);case 6:r=o;case 7:case"end":return t.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()},watcher:function(e){var r,n={},i={},a=Af;return o()(t().mark((function o(){var u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=e.props,f=c.state,l=c.walletState,d=c.walletOutput,null!=l&&null!=d){t.next=3;break}return t.abrupt("return");case 3:if(h=d.engine,p=d.walletApi,y=l.accountId,b=l.pluginId,v=f.accounts[y],r!==l&&null!=p&&U(p),r=l,g=null!==(u=v.userSettings[b])&&void 0!==u?u:n,n!==g&&null!=h&&h.changeUserSettings(g),n=g,m=null!==(s=v.customTokens[b])&&void 0!==s?s:i,i===m||null==h){t.next=31;break}if(null==h.changeCustomTokens){t.next=17;break}h.changeCustomTokens(m),t.next=31;break;case 17:w=0,E=Object.keys(m);case 18:if(!(w<E.length)){t.next=31;break}if(_=E[w],(C=m[_])!==i[_]){t.next=23;break}return t.abrupt("continue",28);case 23:if(null!=(x=vs(C))){t.next=26;break}return t.abrupt("continue",28);case 26:return t.next=28,h.addCustomToken(zf(zf({},x),C)).catch((function(t){return e.props.onError(t)}));case 28:w++,t.next=18;break;case 31:if(i=m,S=l.enabledTokens,a===S||null==h){t.next=43;break}if(null==h.changeEnabledTokenIds){t.next=39;break}return t.next=37,h.changeEnabledTokenIds(l.enabledTokenIds).catch((function(t){return e.props.onError(t)}));case 37:t.next=43;break;case 39:return t.next=41,h.disableTokens(ns(a,S)).catch((function(t){return e.props.onError(t)}));case 41:return t.next=43,h.enableTokens(ns(S,a)).catch((function(t){return e.props.onError(t)}));case 43:a=S;case 44:case"end":return t.stop()}}),o)})))}});function Jf(e,t,r){return Zf.apply(this,arguments)}function Zf(){return(Zf=o()(t().mark((function e(r,n,o){var i,a,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Vf.load(n,Wf);case 2:if(null==(i=e.sent)){e.next=5;break}return e.abrupt("return",i.walletInfo);case 5:return a={},e.prev=6,e.next=9,o.derivePublicKey(r);case 9:a=e.sent,e.next=14;break;case 12:e.prev=12,e.t0=e.catch(6);case 14:if(u={id:r.id,type:r.type,keys:a},!(Object.keys(a).length>0)){e.next=18;break}return e.next=18,Vf.save(n,Wf,{walletInfo:u});case 18:return e.abrupt("return",u);case 19:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function Xf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xf(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xf(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qf=Mo({wallets:Uo(Yf,(function(e){return e.state.currency.currencyWalletIds}),(function(e,t){return $f($f({},e),{},{walletId:t,walletState:e.state.currency.wallets[t],walletOutput:e.output.currency.wallets[t]})}))});var el=Mo({makeSnrp:function(e){return function(){var t,r=e.props,n=r.io,o=r.log;return e.onOutput((function(r){return null==t&&(t=e.props.output.scrypt.timeScrypt(st("1reallyJunkiePasswordToCheck"),{salt_hex:d.parse("b5865ffb9fa7b3bfe4b2384d47ce831ee22a4a9d5c34c7ef7d21467cc758f81b"),n:16384,r:8,p:1}).then((function(e){return e.time}))),t.then((function(e){var t=function(e,t,r){var n={salt_hex:e,n:16384,r:8,p:1};if(0===t)return n.n=131072,n.r=8,n.p=64,n;var o=t,i=t/8,a=(r-o)/i;(a=a>0?a:0)>0&&(a=0),a=Math.floor(a),n.r=8+a;var u=14,s=(r-(o+=a*i))/o;(s=s>0?s:0)>3&&(s=3),u+=(s=Math.floor(s))>=0?s:0,o+=s*o,n.n=Math.pow(2,u);var c=(r-o)/o;return(c=c>0?c:0)>64&&(c=64),c=Math.floor(c),n.p=c>=1?c:1,o+=c*o,n}(n.random(32),e,r);return o("snrp for ".concat(r,"ms target: ").concat(t.n," ").concat(t.r," ").concat(t.p," based on ").concat(e,"ms benchmark")),t}))})),Ho}},timeScrypt:function(e){return function(){var t,r,n=e.props,o=n.io,i=n.log,a="undefined"!=typeof window&&window.performance&&"function"==typeof window.performance.now?function(){return window.performance.now()}:function(){return Date.now()};return e.onOutput((t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,n=t.salt_hex,u=a();return i("starting scrypt n=".concat(t.n," r=").concat(t.r," p=").concat(t.p)),o.scrypt(e,n,t.n,t.r,t.p,r).then((function(e){var r=a()-u;return i("finished scrypt n=".concat(t.n," r=").concat(t.r," p=").concat(t.p," in ").concat(r,"ms")),{hash:e,time:r}}))},r=Promise.resolve(),function(){for(var e=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=function(){return t.apply(e,o)},u=r.then(a,a);return r=u,u})),Ho}}}),tl=function(e){return e},rl=Mo({accounts:ac,context:vc,currency:Qf,exchange:Ci,scrypt:el}),nl=Ks({currencyWalletIds:function(e,t,r){var n;if(1===r.accountIds.length){var o=r.accountIds[0];return r.accounts[o].activeWalletIds}var i=r.accountIds.map((function(e){return r.accounts[e].activeWalletIds}));return(n=[]).concat.apply(n,lt()(i))},wallets:Vs(Tf,(function(e){return e.currency.currencyWalletIds}))});function ol(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ol(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ol(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function al(e,t,r,n){e[t]||(e[t]={}),e[t][r]||(e[t][r]=[]),e[t][r].push(n)}var ul=Co({rates:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ids:{},pairs:[],routes:{}},t=arguments.length>1?arguments[1]:void 0;if("EXCHANGE_PAIRS_FETCHED"===t.type){for(var r=e.ids,n=lt()(e.pairs),o=0,i=t.payload;o<i.length;o++){var a=i[o],u="".concat(a.source,",").concat(a.fromCurrency,",").concat(a.toCurrency),s=r[u];null==s?(r===e.ids&&(r=il({},e.ids)),r[u]=n.length,n.push(a)):n[s]=a}var c=e.routes;if(n.length!==e.pairs.length){c={};for(var f=0;f<n.length;++f)al(c,n[f].fromCurrency,n[f].toCurrency,f),al(c,n[f].toCurrency,n[f].fromCurrency,f)}return{ids:r,pairs:n,routes:c}}return e}});function sl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function cl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fl=Ks({apiKey:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.apiKey:e},appId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.appId:e},deviceDescription:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.deviceDescription:e},localUsers:Ys((function(e){return e.login.appId}),(function(e){return e.login.stashes}),(function(e,t){for(var r=[],n=0,o=Object.keys(t);n<o.length;n++){var i=o[n],a=t[i],u=Bn(a,(function(t){return t.appId===e})),s=null!=u&&(null!=u.passwordAuthBox||null!=u.loginAuthBox),c=Qi(a,e),f=a.recovery2Key;r.push({keyLoginEnabled:s,lastLogin:a.lastLogin,pinLoginEnabled:null!=c,recovery2Key:null!=f?ut(f):void 0,username:i,voucherId:null!=u?u.voucherId:void 0})}return r})),serverUri:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.authServer:e},stashes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INIT":for(var r={},n=0,o=t.payload.stashes;n<o.length;n++){var i=o[n];if(null!=i.username){var a=i.username;r[a]=i}}return r;case"LOGIN_STASH_DELETED":var u=cl({},e);return delete u[t.payload],u;case"LOGIN_STASH_SAVED":var s=t.payload.username;if(null==s)throw new Error("Missing username");var c=cl({},e);return c[s]=t.payload,c}return e},walletInfos:function(e,t,r){if(1===r.accountIds.length){var n=r.accountIds[0];return r.accounts[n].walletInfos}for(var o={},i=0,a=r.accountIds;i<a.length;i++)for(var u=a[i],s=r.accounts[u],c=0,f=Object.keys(s.walletInfos);c<f.length;c++){var l=f[c],d=s.walletInfos[l];o[l]=d}return o}});function ll(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ll(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ll(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var hl={init:{},locked:!1,currency:{},rate:{},swap:{},currencyTools:{}};function pl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bl=Co({lastChanges:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if("STORAGE_WALLET_SYNCED"===t.type){var r=t.payload.changes;return r.length>0?r:e}return e},localDisklet:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e},paths:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e},status:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{lastSync:0,lastHash:void 0},t=arguments.length>1?arguments[1]:void 0;return"STORAGE_WALLET_SYNCED"===t.type?t.payload.status:e}}),vl={sources:{},defaultLogLevel:"warn"},gl=Ks({accountCount:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"LOGIN"===t.type?e+1:e},accountIds:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;switch(t.type){case"LOGIN":return[].concat(lt()(e),[r.lastAccountId]);case"LOGOUT":var n=t.payload.accountId,o=e.filter((function(e){return e!==n}));if(o.length===e.length)throw new Error("Login ".concat(n," does not exist"));return o;case"CLOSE":return[]}return e},accounts:Vs(rc,(function(e){return e.accountIds})),hideKeys:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type?t.payload.hideKeys:e},lastAccountId:function(e,t,r){return"login".concat(r.accountCount)},logSettings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INIT":return t.payload.logSettings;case"CHANGE_LOG_SETTINGS":return t.payload}return e},paused:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"PAUSE"===t.type?t.payload:e},rateHintCache:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ai,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INIT":case"UPDATE_RATE_HINT_CACHE":return t.payload.rateHintCache}return e},ready:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INIT"===t.type||e},currency:nl,exchangeCache:ul,login:fl,plugins:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CORE_PLUGINS_ADDED":for(var r=dl(dl({},e),{},{currency:dl({},e.currency),rate:dl({},e.rate),swap:dl({},e.swap)}),n=0,o=Object.keys(t.payload);n<o.length;n++){var i=o[n],a=t.payload[i];null!=a.currencyInfo&&(r.currency[i]=a),null!=a.rateInfo&&(r.rate[i]=a),null!=a.swapInfo&&(r.swap[i]=a)}return r;case"CORE_PLUGINS_LOCKED":return dl(dl({},e),{},{locked:!0});case"CURRENCY_TOOLS_LOADED":var u=dl({},e.currencyTools);return u[t.payload.pluginId]=t.payload.tools,dl(dl({},e),{},{currencyTools:u});case"INIT":return dl(dl({},e),{},{init:t.payload.pluginsInit})}return e},storageWallets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"STORAGE_WALLET_ADDED":var r=t.payload,n=r.id,o=r.initialState,i=yl({},e);return i[n]=bl(o,{type:"UPDATE_NEXT"}),i;case"STORAGE_WALLET_SYNCED":var a=t.payload.id;if(null!=e[a]){var u=yl({},e);return u[a]=bl(e[a],t),u}return e}return e}});function ml(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ml(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ml(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var El=[],_l="object"===("undefined"==typeof window?"undefined":Nt()(window))&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"core"}):function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))};function Cl(e,t,r){return xl.apply(this,arguments)}function xl(){return(xl=o()(t().mark((function e(r,n,o){var i,a,u,s,c,f,l,d,h,p,y,b,v,g,m,w,E,_,C,x,S,A,I;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.io,a=o.apiKey,u=o.appId,s=void 0===u?"":u,c=o.authServer,f=void 0===c?"https://auth.airbitz.co/api":c,l=o.deviceDescription,d=void 0===l?null:l,h=o.hideKeys,p=void 0!==h&&h,y=o.plugins,b=void 0===y?{}:y,v=wl(wl({},vl),o.logSettings),null!=a){e.next=5;break}throw new Error("No API key provided");case 5:return g=_l(),m=Eo(gl,g),n=qo(n,(function(){var e=m.getState();return e.ready?e.logSettings:v})),w=zo(n,"edge-core"),e.next=11,i.disklet.getText("rateHintCache.json").then((function(e){return JSON.parse(e)})).catch((function(){return[]}));case 11:return E=e.sent,e.next=14,on(i.disklet,w);case 14:return _=e.sent,m.dispatch({type:"INIT",payload:{apiKey:a,appId:s,authServer:f,deviceDescription:d,hideKeys:p,logSettings:v,pluginsInit:b,rateHintCache:E,stashes:_}}),C=Xo(r,n,b,m.dispatch),e.next=19,Xn({log:w,fetch:i.fetch});case 19:return x=e.sent,S={output:{}},A=jo(m,Lo(rl,(function(e){return wl(wl({},e),{},{close:function(){A(),C(),m.dispatch({type:"CLOSE"})},io:i,log:w,logBackend:n,onError:function(e){null!=S.output.context&&null!=S.output.context.api&&L(S.output.context.api,"error",e)},syncClient:x})})),(function(e){return w.error(e)}),(function(e){return S.output=e})),I=S.output.context.api,El.push(I),e.abrupt("return",I);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Al(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Sl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Il=function(){function e(){me()(this,e),this.lobbies={},this.logins=[],this.repos={}}return Ee()(e,[{key:"getLoginById",value:function(e){return this.logins.find((function(t){return Tt(t.loginId,e)}))}},{key:"getLoginByPin2Id",value:function(e){return this.logins.find((function(t){return null!=t.pin2Id&&Tt(t.pin2Id,e)}))}},{key:"getLoginByRecovery2Id",value:function(e){return this.logins.find((function(t){return null!=t.recovery2Id&&Tt(t.recovery2Id,e)}))}},{key:"getLoginsByParent",value:function(e){return this.logins.filter((function(t){return t.parentId===e.loginId}))}},{key:"insertLogin",value:function(e){this.logins.push(e)}},{key:"setupFakeUser",value:function(e){var t=this;!function e(r){var n=r.children,o=Ms()(r,["children"]);t.insertLogin(o);for(var i=0;i<n.length;i++){var a=n[i];a.parentId=r.loginId,e(a)}}(e.server);for(var r=0,n=Object.keys(e.repos);r<n.length;r++){var o=n[r];this.repos[o]=Al({},e.repos[o])}}},{key:"dumpLogin",value:function(e){var t=this;return function e(r){return Al(Al({},r),{},{children:t.getLoginsByParent(r).map((function(t){return e(t)}))})}(e)}}]),e}();function Ol(e,t){var r=e.getLoginsByParent(t).map((function(t){return Ol(e,t)}));return{appId:t.appId,created:t.created,loginId:t.loginId,children:r,parentBox:t.parentBox,passwordAuthBox:t.passwordAuthBox,passwordAuthSnrp:t.passwordAuthSnrp,passwordBox:t.passwordBox,passwordKeySnrp:t.passwordKeySnrp,pin2Box:t.pin2Box,pin2KeyBox:t.pin2KeyBox,pin2TextBox:t.pin2TextBox,question2Box:t.question2Box,recovery2Box:t.recovery2Box,recovery2KeyBox:t.recovery2KeyBox,otpKey:t.otpKey,otpResetDate:t.otpResetDate,otpTimeout:t.otpTimeout,pendingVouchers:Tl(t),loginAuthBox:t.loginAuthBox,keyBoxes:t.keyBoxes,mnemonicBox:t.mnemonicBox,rootKeyBox:t.rootKeyBox,syncKeyBox:t.syncKeyBox}}function Tl(e){return e.vouchers.filter((function(e){return"pending"===e.status})).map((function(e){return{activates:e.activates,created:e.created,deviceDescription:e.deviceDescription,ip:e.ip,ipDescription:e.ipDescription,voucherId:e.voucherId}}))}function kl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Bl=ve(Ye),Rl=ve(Ze),jl={success:{code:0,httpStatus:200,message:"Success"},error:{code:1,httpStatus:503,message:"Error"},accountExists:{code:2,httpStatus:401,message:"Account already exists"},noAccount:{code:3,httpStatus:401,message:"No account"},invalidPassword:{code:4,httpStatus:401,message:"Invalid Password"},invalidAnswers:{code:5,httpStatus:401,message:"Invalid Answers"},invalidApiKey:{code:6,httpStatus:401,message:"Invalid API Key"},invalidOtp:{code:8,httpStatus:401,message:"Invalid OTP"},conflict:{code:10,httpStatus:409,message:"Conflicting change"},obsolete:{code:1e3,httpStatus:410,message:"Obsolete API"},created:{code:0,httpStatus:201,message:"Account created"},invalidRequest:{code:1,httpStatus:401,message:"Invalid request"},notFound:{code:1,httpStatus:404,message:"Not found"},noLobby:{code:3,httpStatus:404,message:"Not found"},invalidAppId:{code:10,httpStatus:401,message:"A login with the same appId already exists"}};function Ml(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.status,n=void 0===r?200:r,o=t.headers,i=void 0===o?{}:o;return Promise.resolve({status:n,headers:Pl({"content-type":"application/json"},i),body:JSON.stringify(e)})}function Nl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jl.success,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.message,r=e.code,n=e.httpStatus,o={status_code:r,message:t};return Ml(o,{status:n})}function Dl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jl.success,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.message,n=t.code,o=t.httpStatus,i={status_code:n,message:r,results:e};return Ml(i,{status:o})}function Ll(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.reason,n=void 0===r?"otp":r,o=t.voucher;return Dl(Bl({login_id:e.loginId,otp_reset_auth:e.otpResetAuth,otp_timeout_date:e.otpResetDate,reason:n,voucher_auth:null==o?void 0:o.voucherAuth,voucher_activates:null==o?void 0:o.activates,voucher_id:null==o?void 0:o.voucherId}),jl.invalidOtp)}function Ul(e){return Dl(Rl({wait_seconds:e}),jl.invalidPassword)}function Hl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hl(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fl=ve(ze),Gl=ve(We),ql=ve(Ve),zl=ve(Je),Wl=ve($e),Vl=ve(Qe),Yl=function(e){return function(){var r=o()(t().mark((function r(n){var o,i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.json,null!=(i=ce(Me)(o))){t.next=4;break}return t.abrupt("return",Nl(jl.invalidRequest));case 4:return t.next=6,e(Kl(Kl({},n),{},{body:i,payload:i.data}));case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},Jl=function(e){return function(){var r=o()(t().mark((function r(n){var o,i,a,u,s,c,f,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.body,i=n.login,a=o.otp,u=o.voucherAuth,s=o.voucherId,null!=(c=i.otpKey)){t.next=7;break}return t.next=6,e(n);case 6:case 10:case 16:return t.abrupt("return",t.sent);case 7:if(null==a||!yn(c,a,{spread:2})){t.next=11;break}return t.next=10,e(n);case 11:if(null==u||null==s){t.next=17;break}if(f=i.vouchers.find((function(e){return e.voucherId===s})),null==f||"approved"!==f.status||!Tt(u,f.voucherAuth)){t.next=17;break}return t.next=16,e(n);case 17:return i.otpResetAuth="Super secret reset token",l={activates:new Date("2020-01-01T00:00:00Z"),created:new Date("2020-01-08T00:00:00Z"),deviceDescription:"A phone",ip:"localhost",ipDescription:"here",loginId:i.loginId,status:"pending",voucherAuth:Uint8Array.from([170,187]),voucherId:"voucher-".concat(i.vouchers.length)},i.vouchers.push(l),t.abrupt("return",Ll(i,{voucher:l}));case 21:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},Zl=function(e){return Nl(jl.invalidRequest)},Xl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zl;return function(r){var n=r.db,o=r.body,i=o.loginAuth,a=o.loginId,u=o.passwordAuth,s=o.pin2Auth,c=o.pin2Id,f=o.recovery2Auth,l=o.recovery2Id,d=o.userId;if(null!=a&&null!=i){var h=n.getLoginById(a);return null==h?Nl(jl.noAccount):null!=h.loginAuth&&Tt(i,h.loginAuth)?Jl(e)(Kl(Kl({},r),{},{login:h})):Ul(0)}if(null!=d&&null!=u){var p=n.getLoginById(d);return null==p?Nl(jl.noAccount):null!=p.passwordAuth&&Tt(u,p.passwordAuth)?Jl(e)(Kl(Kl({},r),{},{login:p})):Ul(0)}if(null!=c&&null!=s){var y=n.getLoginByPin2Id(c);return null==y?Nl(jl.noAccount):null!=y.pin2Auth&&Tt(s,y.pin2Auth)?Jl(e)(Kl(Kl({},r),{},{login:y})):Ul(0)}if(null!=l&&null!=f){var b=n.getLoginByRecovery2Id(l);if(null==b)return Nl(jl.noAccount);var v=b.recovery2Auth,g=f;if(null==v||g.length!==v.length)return Ul(0);for(var m=0;m<g.length;++m)if(!Tt(g[m],v[m]))return Ul(0);return Jl(e)(Kl(Kl({},r),{},{login:b}))}return t(r)}},$l=Xl((function(e){var t=e.db,r=e.login;return Dl(Gl(Ol(t,r)))}),(function(e){var t=e.db,r=e.json,n=Me(r),o=n.userId,i=n.passwordAuth,a=n.recovery2Id,u=n.recovery2Auth;if(null!=o&&null==i){var s=t.getLoginById(o);if(null==s)return Nl(jl.noAccount);var c=s.passwordAuthSnrp;return Dl(Vl({passwordAuthSnrp:void 0===c?Qr:c}))}if(null!=a&&null==u){var f=t.getLoginByRecovery2Id(a);if(null==f)return Nl(jl.noAccount);var l=f.question2Box;return null==l?Nl(jl.noAccount):Dl(Wl({question2Box:l}))}return Nl(jl.invalidRequest)}));function Ql(e,t){var r=e.db,n=e.json,o=new Date,i=ce(Me)(n);if(null==i)return Nl(jl.invalidRequest);var a=ce(qe)(i.data),u=ce(Ke)(a);if(null==a||null==u)return Nl(jl.invalidRequest);if(null!=r.getLoginById(a.loginId))return Nl(jl.accountExists);for(var s=ce(Ge,{newSyncKeys:[],keyBoxes:[]})(a),c=0,f=s.newSyncKeys;c<f.length;c++){var l=f[c];r.repos[l]={}}var d=Kl(Kl(Kl(Kl(Kl(Kl({},a),u),{},{created:o,keyBoxes:s.keyBoxes,vouchers:[]},ce(De)(a)),ce(Le)(a)),ce(Ue)(a)),ce(He)(a));if(null!=t){if(null!=r.getLoginsByParent(t).find((function(e){return e.appId===a.appId})))return Nl(jl.invalidAppId);d.parentId=t.loginId}return r.insertLogin(d),Nl(jl.created,"Account created")}var ed=Xl((function(e){return Ql(e,e.login)}),(function(e){return Ql(e)})),td=Xl((function(e){var t=e.db,r=e.login,n=e.payload,o=ce(Ge)(n);if(null==o)return Nl(jl.invalidRequest);for(var i=0,a=o.newSyncKeys;i<a.length;i++){var u=a[i];t.repos[u]={}}return r.keyBoxes=Dt(r.keyBoxes,o.keyBoxes),Nl()})),rd=Xl((function(e){var t=e.login,r=e.payload,n=ce(De)(r);return null==n?Nl(jl.invalidRequest):(t.otpKey=n.otpKey,t.otpTimeout=n.otpTimeout,t.otpResetDate=void 0,Nl())})),nd=Xl((function(e){var t=e.login;return t.otpKey=void 0,t.otpResetAuth=void 0,t.otpResetDate=void 0,t.otpTimeout=void 0,Nl()}),(function(e){var t=e.db,r=e.json,n=Me(r);if(null==n.userId||null==n.otpResetAuth)return Nl(jl.invalidRequest);var o=t.getLoginById(n.userId);if(null==o)return Nl(jl.noAccount);if(n.otpResetAuth!==o.otpResetAuth)return Ul(0);var i=o.otpKey,a=o.otpTimeout;return null==i||null==a?Nl(jl.invalidRequest,"OTP not setup for this account."):(null==o.otpResetDate&&(o.otpResetDate=new Date(Date.now()+1e3*a)),Dl(zl({otpResetDate:o.otpResetDate})))})),od=Xl((function(e){var t=e.login;return t.passwordAuth=void 0,t.passwordAuthBox=void 0,t.passwordAuthSnrp=void 0,t.passwordBox=void 0,t.passwordKeySnrp=void 0,Nl()})),id=Xl((function(e){var t=e.login,r=e.payload,n=ce(Le)(r);return null==n?Nl(jl.invalidRequest):(t.passwordAuth=n.passwordAuth,t.passwordAuthBox=n.passwordAuthBox,t.passwordAuthSnrp=n.passwordAuthSnrp,t.passwordBox=n.passwordBox,t.passwordKeySnrp=n.passwordKeySnrp,Nl())})),ad=Xl((function(e){var t=e.login;return t.pin2Auth=void 0,t.pin2Box=void 0,t.pin2Id=void 0,t.pin2KeyBox=void 0,t.pin2TextBox=void 0,Nl()})),ud=Xl((function(e){var t=e.login,r=e.payload,n=ce(Ue)(r);return null==n?Nl(jl.invalidRequest):(t.pin2Auth=n.pin2Auth,t.pin2Box=n.pin2Box,t.pin2Id=n.pin2Id,t.pin2KeyBox=n.pin2KeyBox,t.pin2TextBox=n.pin2TextBox,Nl())})),sd=Xl((function(e){var t=e.login;return t.question2Box=void 0,t.recovery2Auth=void 0,t.recovery2Box=void 0,t.recovery2Id=void 0,t.recovery2KeyBox=void 0,Nl()})),cd=Xl((function(e){var t=e.login,r=e.payload,n=ce(He)(r);return null==n?Nl(jl.invalidRequest):(t.question2Box=n.question2Box,t.recovery2Auth=n.recovery2Auth,t.recovery2Box=n.recovery2Box,t.recovery2Id=n.recovery2Id,t.recovery2KeyBox=n.recovery2KeyBox,Nl())})),fd=Xl((function(e){var t=e.db,r=e.login,n=e.payload,o=ce(Ke)(n);return null==o?Nl(jl.invalidRequest):null!=r.loginAuth?Nl(jl.conflict,"The secret-key login is already configured"):(r.loginAuth=o.loginAuth,r.loginAuthBox=o.loginAuthBox,Dl(Gl(Ol(t,r))))})),ld=Xl(function(){var e=o()(t().mark((function e(r){var n,o,i,a,u,s,c,f,l,d,h,p,y,b,v,g;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.db,o=r.login,i=r.payload,null!=(a=ce(Fe)(i))){e.next=4;break}return e.abrupt("return",Nl(jl.invalidRequest));case 4:for(u=a.approvedVouchers,s=void 0===u?[]:u,c=a.rejectedVouchers,f=void 0===c?[]:c,l={},d=0;d<s.length;d++)h=s[d],l[h]="approved";for(p=0;p<f.length;p++)y=f[p],l[y]="rejected";b=0,v=o.vouchers;case 9:if(!(b<v.length)){e.next=17;break}if(g=v[b],null!=l[g.voucherId]){e.next=13;break}return e.abrupt("continue",14);case 13:g.status=l[g.voucherId];case 14:b++,e.next=9;break;case 17:return e.t0=Dl,e.t1=Gl,e.next=21,Ol(n,o);case 21:return e.t2=e.sent,e.t3=(0,e.t1)(e.t2),e.abrupt("return",(0,e.t0)(e.t3));case 24:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),dd=function(e){return Nl(jl.noLobby,"Cannot find lobby ".concat(e.lobbyId))},hd=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dd;return function(r){var n=r.db,o=r.path.split("/")[4],i=n.lobbies[o];return null!=i?e(Kl(Kl({},r),{},{lobby:i,lobbyId:o})):t(Kl(Kl({},r),{},{lobbyId:o}))}},pd=hd((function(e){return Nl(jl.accountExists,"Lobby ".concat(e.lobbyId," already exists."))}),(function(e){var t=e.db,r=e.json,n=e.lobbyId,o=ce(Me)(r);if(null==o)return Nl(jl.invalidRequest);var i=ce(Be)(o.data);if(null==i)return Nl(jl.invalidRequest);var a=i.timeout,u=void 0===a?600:a,s=new Date(Date.now()+1e3*u).toISOString();return t.lobbies[n]={request:i,replies:[],expires:s},Nl()})),yd=hd((function(e){var t=e.json,r=e.lobby,n=ce(Me)(t);if(null==n)return Nl(jl.invalidRequest);var o=ce(Re)(n.data);return null==o?Nl(jl.invalidRequest):(r.replies.push(o),Nl())})),bd=hd((function(e){var t=e.lobby;return Dl(Fl(t))})),vd=hd((function(e){var t=e.db,r=e.lobbyId;return delete t.lobbies[r],Nl()})),gd=function(e){return function(t){var r=t.db,n=t.path.split("/")[4],o=r.repos[n];return null==o?Ml({msg:"Hash not found"},{status:404}):e(Kl(Kl({},t),{},{repo:o}))}},md=gd((function(e){return Ml({changes:e.repo})})),wd=gd((function(e){for(var t=e.json,r=e.repo,n=Ed(t).changes,o=0,i=Object.keys(n);o<i.length;o++){var a=i[o];r[a]=n[a]}return Ml({changes:r,hash:"1111111111111111111111111111111111111111"})})),Ed=de({changes:se(ke)}),_d=m({"/api/v2/login/?":g({GET:Yl($l),POST:Yl($l)}),"/api/v2/login/create/?":g({POST:Yl(ed),PUT:Yl(ed)}),"/api/v2/login/keys/?":g({POST:Yl(td)}),"/api/v2/login/otp/?":g({DELETE:Yl(nd),POST:Yl(rd),PUT:Yl(rd)}),"/api/v2/login/password/?":g({DELETE:Yl(od),POST:Yl(id),PUT:Yl(id)}),"/api/v2/login/pin2/?":g({DELETE:Yl(ad),POST:Yl(ud),PUT:Yl(ud)}),"/api/v2/login/recovery2/?":g({DELETE:Yl(sd),POST:Yl(cd),PUT:Yl(cd)}),"/api/v2/login/secret/?":g({POST:Yl(fd)}),"/api/v2/login/vouchers/?":g({POST:Yl(ld)}),"/api/v2/messages/?":g({POST:Yl((function(e){var t=e.db,r=e.json,n=ce(Me)(r);if(null==n||null==n.loginIds)return Nl(jl.invalidRequest);for(var o=n.loginIds,i=[],a=0;a<o.length;a++){var u=o[a],s=t.getLoginById(u);null!=s&&i.push({loginId:u,otpResetPending:null!=s.otpResetDate,pendingVouchers:Tl(s),recovery2Corrupt:!1})}return Dl(ql(i))}))}),"/api/v2/lobby/[^/]+/?":g({DELETE:Yl(vd),GET:Yl(bd),POST:Yl(yd),PUT:Yl(pd)}),"/api/v2/store/[^/]+/?":g({GET:md,POST:wd}),"/v1/edgeServers":g({GET:function(e){return Ml({infoServers:["https://info-fake1.edge.app"],syncServers:["https://sync-fake1.edge.app","https://sync-fake2.edge.app","https://sync-fake3.edge.app"]})}})},(function(e){return Nl(jl.notFound,"Unknown API endpoint ".concat(e.path))}));function Cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(r),!0).forEach((function(t){te()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Sd=ve(ln),Ad=ve(tt),Id=ve(rt);function Od(e,t){return Td.apply(this,arguments)}function Td(){return Td=o()(t().mark((function e(r,n){var i,a,u,s,c,f,l,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.lastLogin,a=n.loginId,u=n.loginKey,s=n.repos,c=n.server,f=xe(n.username),l=Mn({appId:"",lastLogin:i,loginId:a,pendingVouchers:[],username:f},u,We(Ad(c))),h="logins/".concat(ut(a),".json"),e.next=6,r.disklet.setText(h,JSON.stringify(Sd(l))).catch((function(){}));case 6:return e.next=8,Promise.all(Object.keys(s).map(function(){var e=o()(t().mark((function e(o){var i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=ri(r,d.parse(o),new Uint8Array(0)),e.next=3,oi(i.dataDisklet,n.repos[o]);case 3:return e.next=5,i.baseDisklet.setText("status.json",JSON.stringify({lastSync:1,lastHash:null}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:case"end":return e.stop()}}),e)}))),Td.apply(this,arguments)}function kd(e,r,n){for(var i=e.io,a=e.nativeIo,u=new Il,s=function(e){var t=Ut((function(r){if(t.offline)throw new Error("Fake network error");var n=r.body.byteLength>0?JSON.parse(ct(new Uint8Array(r.body))):{};return _d(Kl(Kl({},r),{},{db:e,json:n}))}),{offline:!1});return t}(u),c=nt(n),f=0;f<c.length;f++){var l=c[f];u.setupFakeUser(l)}var h=[],y={close:function(){return o()(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(h.map((function(e){return e.close()})));case 2:D(y);case 3:case"end":return e.stop()}}),e)})))()},makeEdgeContext:function(e){return o()(t().mark((function n(){var u,f,l,d;return t().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(u=e.cleanDevice,f=void 0!==u&&u,l=xd(xd({},i),{},{disklet:(0,Q.Wh)(),fetch:b(s)}),f){n.next=5;break}return n.next=5,Promise.all(c.map(function(){var e=o()(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Od(l,r));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:return n.next=7,Cl({io:l,nativeIo:a},r,xd({},e));case 7:return d=n.sent,h.push(d),n.abrupt("return",d);case 10:case"end":return n.stop()}}),n)})))()},goOffline:function(){var e=arguments;return o()(t().mark((function r(){var n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=!(e.length>0&&void 0!==e[0])||e[0],s.offline=n;case 2:case"end":return t.stop()}}),r)})))()},dumpFakeUser:function(e){return o()(t().mark((function r(){var n,o,i,a,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""===e.appId){t.next=2;break}throw new Error("Only root logins are dumpable.");case 2:if(n=at(e.rootLoginId),null!=(o=u.getLoginById(n))){t.next=6;break}throw new Error("Cannot find user ".concat(e.username));case 6:for(i=e.allKeys.filter((function(e){return null!=e.keys&&null!=e.keys.syncKey})).map((function(e){return d.stringify(p.parse(e.keys.syncKey)).toLowerCase()})),a={},s=0;s<i.length;s++)c=i[s],a[c]=u.repos[c];return t.abrupt("return",Id({lastLogin:e.lastLogin,loginId:n,loginKey:at(e.loginKey),repos:a,server:u.dumpLogin(o),username:e.username}));case 10:case"end":return t.stop()}}),r)})))()}};return A(y),y}function Pd(e){var t=function(){var e={resolve:function(){},reject:function(){}},t=0;if("undefined"!=typeof Map){var r=new Map;return{add:function(e){var n=++t;return r.set(n,e),n},grab:function(t){var n=r.get(t);return null==n?e:(r.delete(t),n)}}}var n={};return{add:function(e){var r=++t;return n[String(r)]=e,r},grab:function(t){var r=n[String(t)];return null==r?e:(delete n[String(t)],r)}}}();return{call:function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return new Promise((function(n,i){e(t.add({resolve:n,reject:i}),r,o)}))},resolve:function(e,r){t.grab(e).resolve(r)},reject:function(e,r){t.grab(e).reject(new Error(r))}}}var Bd=null!=window.edgeCore?[Pd((function(e,t,r){window.edgeCore.call(e,t,JSON.stringify(r))})),new Y({sendMessage:function(e){window.edgeCore.postMessage(JSON.stringify(e))}})]:[Pd((function(e,t,r){window.webkit.messageHandlers.edgeCore.postMessage([e,t,r])})),new Y({sendMessage:function(e){window.webkit.messageHandlers.edgeCore.postMessage([0,"postMessage",[JSON.stringify(e)]])}})],Rd=a()(Bd,2),jd=Rd[0],Md=Rd[1];function Nd(e){var t=window.document.head;if(null!=t&&0!==e.length)for(var r=0,n=function(){++r>=e.length&&Zo()},o=0;o<e.length;o++){var i=e[o],a=document.createElement("script");a.addEventListener("error",n),a.addEventListener("load",n),a.charset="utf-8",a.defer=!0,a.src=i,t.appendChild(a)}else Zo()}function Dd(e){return Ld.apply(this,arguments)}function Ld(){return Ld=o()(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=f(),e.t1=s().sha256,e.t2=p,e.next=5,jd.call("randomBytes",32);case 5:return e.t3=e.sent,e.t4=e.t2.parse.call(e.t2,e.t3),e.t5={hash:e.t1,entropy:e.t4},n=new e.t0(e.t5),e.abrupt("return",{console:console,disklet:{delete:function(e){return jd.call("diskletDelete",Ud(e))},getData:function(e){return jd.call("diskletGetData",Ud(e)).then((function(e){return p.parse(e)}))},getText:function(e){return jd.call("diskletGetText",Ud(e))},list:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return jd.call("diskletList",Ud(e))},setData:function(e,t){return jd.call("diskletSetData",Ud(e),p.stringify(t))},setText:function(e,t){return jd.call("diskletSetText",Ud(e),t)}},random:function(e){return n.generate(e)},scrypt:function(e,t,r,n,o,i){return jd.call("scrypt",p.stringify(e),p.stringify(t),r,n,o,i).then((function(e){return p.parse(e)}))},fetch:function(e,t){return window.fetch(e,t)},fetchCors:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.fetchCors(e,t).then(v)}});case 10:case"end":return e.stop()}}),e)}))),Ld.apply(this,arguments)}function Ud(e){if(/^\//.test(e))throw new Error("Absolute paths are not supported");for(var t=e.split("/"),r=0,n=0;r<t.length;){var o=t[r++];if(".."===o?n--:"."!==o&&""!==o&&(t[n++]=o),n<0)throw new Error("Path would escape folder")}return t.slice(0,n).join("/")}window.addEdgeCorePlugins=function(e){if(Vo)throw new Error("The Edge core plugin list has already been locked");for(var t in e)Wo[t]=e[t];for(var r=0;r<Yo.length;r++){(0,Yo[r])(e)}},window.nativeBridge=jd,window.reactBridge=Md;var Hd=A({makeEdgeContext:function(e,r,n,i,a){return o()(t().mark((function o(){var u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Nd(i),t.next=3,Dd(e);case 3:return u=t.sent,t.abrupt("return",Cl({io:u,nativeIo:r},n,a));case 5:case"end":return t.stop()}}),o)})))()},makeFakeEdgeWorld:function(e,r,n,i){var a=arguments;return o()(t().mark((function o(){var u,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=a.length>4&&void 0!==a[4]?a[4]:[],Nd(i),t.next=4,Dd(e);case 4:return s=t.sent,t.abrupt("return",kd({io:s,nativeIo:r},n,u));case 6:case"end":return t.stop()}}),o)})))()}});Md.sendRoot(Hd)}()}();