-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.js
11850 lines (10418 loc) · 367 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function () {
"use strict";
function defineArgumentsExtended(extended, is) {
var pSlice = Array.prototype.slice,
isArguments = is.isArguments;
function argsToArray(args, slice) {
var i = -1, j = 0, l = args.length, ret = [];
slice = slice || 0;
i += slice;
while (++i < l) {
ret[j++] = args[i];
}
return ret;
}
return extended
.define(isArguments, {
toArray: argsToArray
})
.expose({
argsToArray: argsToArray
});
}
if ("undefined" !== typeof exports) {
if ("undefined" !== typeof module && module.exports) {
module.exports = defineArgumentsExtended(require("extended"), require("is-extended"));
}
} else if ("function" === typeof define && define.amd) {
define(["extended", "is-extended"], function (extended, is) {
return defineArgumentsExtended(extended, is);
});
} else {
this.argumentsExtended = defineArgumentsExtended(this.extended, this.isExtended);
}
}).call(this);
},{"extended":12,"is-extended":27}],2:[function(require,module,exports){
(function () {
"use strict";
/*global define*/
function defineArray(extended, is, args) {
var isString = is.isString,
isArray = Array.isArray || is.isArray,
isDate = is.isDate,
floor = Math.floor,
abs = Math.abs,
mathMax = Math.max,
mathMin = Math.min,
arrayProto = Array.prototype,
arrayIndexOf = arrayProto.indexOf,
arrayForEach = arrayProto.forEach,
arrayMap = arrayProto.map,
arrayReduce = arrayProto.reduce,
arrayReduceRight = arrayProto.reduceRight,
arrayFilter = arrayProto.filter,
arrayEvery = arrayProto.every,
arraySome = arrayProto.some,
argsToArray = args.argsToArray;
function cross(num, cros) {
return reduceRight(cros, function (a, b) {
if (!isArray(b)) {
b = [b];
}
b.unshift(num);
a.unshift(b);
return a;
}, []);
}
function permute(num, cross, length) {
var ret = [];
for (var i = 0; i < cross.length; i++) {
ret.push([num].concat(rotate(cross, i)).slice(0, length));
}
return ret;
}
function intersection(a, b) {
var ret = [], aOne, i = -1, l;
l = a.length;
while (++i < l) {
aOne = a[i];
if (indexOf(b, aOne) !== -1) {
ret.push(aOne);
}
}
return ret;
}
var _sort = (function () {
var isAll = function (arr, test) {
return every(arr, test);
};
var defaultCmp = function (a, b) {
return a - b;
};
var dateSort = function (a, b) {
return a.getTime() - b.getTime();
};
return function _sort(arr, property) {
var ret = [];
if (isArray(arr)) {
ret = arr.slice();
if (property) {
if (typeof property === "function") {
ret.sort(property);
} else {
ret.sort(function (a, b) {
var aProp = a[property], bProp = b[property];
if (isString(aProp) && isString(bProp)) {
return aProp > bProp ? 1 : aProp < bProp ? -1 : 0;
} else if (isDate(aProp) && isDate(bProp)) {
return aProp.getTime() - bProp.getTime();
} else {
return aProp - bProp;
}
});
}
} else {
if (isAll(ret, isString)) {
ret.sort();
} else if (isAll(ret, isDate)) {
ret.sort(dateSort);
} else {
ret.sort(defaultCmp);
}
}
}
return ret;
};
})();
function indexOf(arr, searchElement, from) {
var index = (from || 0) - 1,
length = arr.length;
while (++index < length) {
if (arr[index] === searchElement) {
return index;
}
}
return -1;
}
function lastIndexOf(arr, searchElement, from) {
if (!isArray(arr)) {
throw new TypeError();
}
var t = Object(arr);
var len = t.length >>> 0;
if (len === 0) {
return -1;
}
var n = len;
if (arguments.length > 2) {
n = Number(arguments[2]);
if (n !== n) {
n = 0;
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
n = (n > 0 || -1) * floor(abs(n));
}
}
var k = n >= 0 ? mathMin(n, len - 1) : len - abs(n);
for (; k >= 0; k--) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
}
function filter(arr, iterator, scope) {
if (arr && arrayFilter && arrayFilter === arr.filter) {
return arr.filter(iterator, scope);
}
if (!isArray(arr) || typeof iterator !== "function") {
throw new TypeError();
}
var t = Object(arr);
var len = t.length >>> 0;
var res = [];
for (var i = 0; i < len; i++) {
if (i in t) {
var val = t[i]; // in case fun mutates this
if (iterator.call(scope, val, i, t)) {
res.push(val);
}
}
}
return res;
}
function forEach(arr, iterator, scope) {
if (!isArray(arr) || typeof iterator !== "function") {
throw new TypeError();
}
if (arr && arrayForEach && arrayForEach === arr.forEach) {
arr.forEach(iterator, scope);
return arr;
}
for (var i = 0, len = arr.length; i < len; ++i) {
iterator.call(scope || arr, arr[i], i, arr);
}
return arr;
}
function every(arr, iterator, scope) {
if (arr && arrayEvery && arrayEvery === arr.every) {
return arr.every(iterator, scope);
}
if (!isArray(arr) || typeof iterator !== "function") {
throw new TypeError();
}
var t = Object(arr);
var len = t.length >>> 0;
for (var i = 0; i < len; i++) {
if (i in t && !iterator.call(scope, t[i], i, t)) {
return false;
}
}
return true;
}
function some(arr, iterator, scope) {
if (arr && arraySome && arraySome === arr.some) {
return arr.some(iterator, scope);
}
if (!isArray(arr) || typeof iterator !== "function") {
throw new TypeError();
}
var t = Object(arr);
var len = t.length >>> 0;
for (var i = 0; i < len; i++) {
if (i in t && iterator.call(scope, t[i], i, t)) {
return true;
}
}
return false;
}
function map(arr, iterator, scope) {
if (arr && arrayMap && arrayMap === arr.map) {
return arr.map(iterator, scope);
}
if (!isArray(arr) || typeof iterator !== "function") {
throw new TypeError();
}
var t = Object(arr);
var len = t.length >>> 0;
var res = [];
for (var i = 0; i < len; i++) {
if (i in t) {
res.push(iterator.call(scope, t[i], i, t));
}
}
return res;
}
function reduce(arr, accumulator, curr) {
var initial = arguments.length > 2;
if (arr && arrayReduce && arrayReduce === arr.reduce) {
return initial ? arr.reduce(accumulator, curr) : arr.reduce(accumulator);
}
if (!isArray(arr) || typeof accumulator !== "function") {
throw new TypeError();
}
var i = 0, l = arr.length >> 0;
if (arguments.length < 3) {
if (l === 0) {
throw new TypeError("Array length is 0 and no second argument");
}
curr = arr[0];
i = 1; // start accumulating at the second element
} else {
curr = arguments[2];
}
while (i < l) {
if (i in arr) {
curr = accumulator.call(undefined, curr, arr[i], i, arr);
}
++i;
}
return curr;
}
function reduceRight(arr, accumulator, curr) {
var initial = arguments.length > 2;
if (arr && arrayReduceRight && arrayReduceRight === arr.reduceRight) {
return initial ? arr.reduceRight(accumulator, curr) : arr.reduceRight(accumulator);
}
if (!isArray(arr) || typeof accumulator !== "function") {
throw new TypeError();
}
var t = Object(arr);
var len = t.length >>> 0;
// no value to return if no initial value, empty array
if (len === 0 && arguments.length === 2) {
throw new TypeError();
}
var k = len - 1;
if (arguments.length >= 3) {
curr = arguments[2];
} else {
do {
if (k in arr) {
curr = arr[k--];
break;
}
}
while (true);
}
while (k >= 0) {
if (k in t) {
curr = accumulator.call(undefined, curr, t[k], k, t);
}
k--;
}
return curr;
}
function toArray(o) {
var ret = [];
if (o !== null) {
var args = argsToArray(arguments);
if (args.length === 1) {
if (isArray(o)) {
ret = o;
} else if (is.isHash(o)) {
for (var i in o) {
if (o.hasOwnProperty(i)) {
ret.push([i, o[i]]);
}
}
} else {
ret.push(o);
}
} else {
forEach(args, function (a) {
ret = ret.concat(toArray(a));
});
}
}
return ret;
}
function sum(array) {
array = array || [];
if (array.length) {
return reduce(array, function (a, b) {
return a + b;
});
} else {
return 0;
}
}
function avg(arr) {
arr = arr || [];
if (arr.length) {
var total = sum(arr);
if (is.isNumber(total)) {
return total / arr.length;
} else {
throw new Error("Cannot average an array of non numbers.");
}
} else {
return 0;
}
}
function sort(arr, cmp) {
return _sort(arr, cmp);
}
function min(arr, cmp) {
return _sort(arr, cmp)[0];
}
function max(arr, cmp) {
return _sort(arr, cmp)[arr.length - 1];
}
function difference(arr1) {
var ret = arr1, args = flatten(argsToArray(arguments, 1));
if (isArray(arr1)) {
ret = filter(arr1, function (a) {
return indexOf(args, a) === -1;
});
}
return ret;
}
function removeDuplicates(arr) {
var ret = [], i = -1, l, retLength = 0;
if (arr) {
l = arr.length;
while (++i < l) {
var item = arr[i];
if (indexOf(ret, item) === -1) {
ret[retLength++] = item;
}
}
}
return ret;
}
function unique(arr) {
return removeDuplicates(arr);
}
function rotate(arr, numberOfTimes) {
var ret = arr.slice();
if (typeof numberOfTimes !== "number") {
numberOfTimes = 1;
}
if (numberOfTimes && isArray(arr)) {
if (numberOfTimes > 0) {
ret.push(ret.shift());
numberOfTimes--;
} else {
ret.unshift(ret.pop());
numberOfTimes++;
}
return rotate(ret, numberOfTimes);
} else {
return ret;
}
}
function permutations(arr, length) {
var ret = [];
if (isArray(arr)) {
var copy = arr.slice(0);
if (typeof length !== "number") {
length = arr.length;
}
if (!length) {
ret = [
[]
];
} else if (length <= arr.length) {
ret = reduce(arr, function (a, b, i) {
var ret;
if (length > 1) {
ret = permute(b, rotate(copy, i).slice(1), length);
} else {
ret = [
[b]
];
}
return a.concat(ret);
}, []);
}
}
return ret;
}
function zip() {
var ret = [];
var arrs = argsToArray(arguments);
if (arrs.length > 1) {
var arr1 = arrs.shift();
if (isArray(arr1)) {
ret = reduce(arr1, function (a, b, i) {
var curr = [b];
for (var j = 0; j < arrs.length; j++) {
var currArr = arrs[j];
if (isArray(currArr) && !is.isUndefined(currArr[i])) {
curr.push(currArr[i]);
} else {
curr.push(null);
}
}
a.push(curr);
return a;
}, []);
}
}
return ret;
}
function transpose(arr) {
var ret = [];
if (isArray(arr) && arr.length) {
var last;
forEach(arr, function (a) {
if (isArray(a) && (!last || a.length === last.length)) {
forEach(a, function (b, i) {
if (!ret[i]) {
ret[i] = [];
}
ret[i].push(b);
});
last = a;
}
});
}
return ret;
}
function valuesAt(arr, indexes) {
var ret = [];
indexes = argsToArray(arguments);
arr = indexes.shift();
if (isArray(arr) && indexes.length) {
for (var i = 0, l = indexes.length; i < l; i++) {
ret.push(arr[indexes[i]] || null);
}
}
return ret;
}
function union() {
var ret = [];
var arrs = argsToArray(arguments);
if (arrs.length > 1) {
for (var i = 0, l = arrs.length; i < l; i++) {
ret = ret.concat(arrs[i]);
}
ret = removeDuplicates(ret);
}
return ret;
}
function intersect() {
var collect = [], sets, i = -1 , l;
if (arguments.length > 1) {
//assume we are intersections all the lists in the array
sets = argsToArray(arguments);
} else {
sets = arguments[0];
}
if (isArray(sets)) {
collect = sets[0];
i = 0;
l = sets.length;
while (++i < l) {
collect = intersection(collect, sets[i]);
}
}
return removeDuplicates(collect);
}
function powerSet(arr) {
var ret = [];
if (isArray(arr) && arr.length) {
ret = reduce(arr, function (a, b) {
var ret = map(a, function (c) {
return c.concat(b);
});
return a.concat(ret);
}, [
[]
]);
}
return ret;
}
function cartesian(a, b) {
var ret = [];
if (isArray(a) && isArray(b) && a.length && b.length) {
ret = cross(a[0], b).concat(cartesian(a.slice(1), b));
}
return ret;
}
function compact(arr) {
var ret = [];
if (isArray(arr) && arr.length) {
ret = filter(arr, function (item) {
return !is.isUndefinedOrNull(item);
});
}
return ret;
}
function multiply(arr, times) {
times = is.isNumber(times) ? times : 1;
if (!times) {
//make sure times is greater than zero if it is zero then dont multiply it
times = 1;
}
arr = toArray(arr || []);
var ret = [], i = 0;
while (++i <= times) {
ret = ret.concat(arr);
}
return ret;
}
function flatten(arr) {
var set;
var args = argsToArray(arguments);
if (args.length > 1) {
//assume we are intersections all the lists in the array
set = args;
} else {
set = toArray(arr);
}
return reduce(set, function (a, b) {
return a.concat(b);
}, []);
}
function pluck(arr, prop) {
prop = prop.split(".");
var result = arr.slice(0);
forEach(prop, function (prop) {
var exec = prop.match(/(\w+)\(\)$/);
result = map(result, function (item) {
return exec ? item[exec[1]]() : item[prop];
});
});
return result;
}
function invoke(arr, func, args) {
args = argsToArray(arguments, 2);
return map(arr, function (item) {
var exec = isString(func) ? item[func] : func;
return exec.apply(item, args);
});
}
var array = {
toArray: toArray,
sum: sum,
avg: avg,
sort: sort,
min: min,
max: max,
difference: difference,
removeDuplicates: removeDuplicates,
unique: unique,
rotate: rotate,
permutations: permutations,
zip: zip,
transpose: transpose,
valuesAt: valuesAt,
union: union,
intersect: intersect,
powerSet: powerSet,
cartesian: cartesian,
compact: compact,
multiply: multiply,
flatten: flatten,
pluck: pluck,
invoke: invoke,
forEach: forEach,
map: map,
filter: filter,
reduce: reduce,
reduceRight: reduceRight,
some: some,
every: every,
indexOf: indexOf,
lastIndexOf: lastIndexOf
};
return extended.define(isArray, array).expose(array);
}
if ("undefined" !== typeof exports) {
if ("undefined" !== typeof module && module.exports) {
module.exports = defineArray(require("extended"), require("is-extended"), require("arguments-extended"));
}
} else if ("function" === typeof define && define.amd) {
define(["extended", "is-extended", "arguments-extended"], function (extended, is, args) {
return defineArray(extended, is, args);
});
} else {
this.arrayExtended = defineArray(this.extended, this.isExtended, this.argumentsExtended);
}
}).call(this);
},{"arguments-extended":1,"extended":12,"is-extended":27}],3:[function(require,module,exports){
'use strict'
exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray
var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i]
revLookup[code.charCodeAt(i)] = i
}
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63
function placeHoldersCount (b64) {
var len = b64.length
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
}
function byteLength (b64) {
// base64 is 4/3 + up to two characters of the original data
return (b64.length * 3 / 4) - placeHoldersCount(b64)
}
function toByteArray (b64) {
var i, l, tmp, placeHolders, arr
var len = b64.length
placeHolders = placeHoldersCount(b64)
arr = new Arr((len * 3 / 4) - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? len - 4 : len
var L = 0
for (i = 0; i < l; i += 4) {
tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
arr[L++] = (tmp >> 16) & 0xFF
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
if (placeHolders === 2) {
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
arr[L++] = tmp & 0xFF
} else if (placeHolders === 1) {
tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
arr[L++] = (tmp >> 8) & 0xFF
arr[L++] = tmp & 0xFF
}
return arr
}
function tripletToBase64 (num) {
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
}
function encodeChunk (uint8, start, end) {
var tmp
var output = []
for (var i = start; i < end; i += 3) {
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
output.push(tripletToBase64(tmp))
}
return output.join('')
}
function fromByteArray (uint8) {
var tmp
var len = uint8.length
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
var output = ''
var parts = []
var maxChunkLength = 16383 // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1]
output += lookup[tmp >> 2]
output += lookup[(tmp << 4) & 0x3F]
output += '=='
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
output += lookup[tmp >> 10]
output += lookup[(tmp >> 4) & 0x3F]
output += lookup[(tmp << 2) & 0x3F]
output += '='
}
parts.push(output)
return parts.join('')
}
},{}],4:[function(require,module,exports){
},{}],5:[function(require,module,exports){
arguments[4][4][0].apply(exports,arguments)
},{"dup":4}],6:[function(require,module,exports){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
'use strict'
var base64 = require('base64-js')
var ieee754 = require('ieee754')
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
var K_MAX_LENGTH = 0x7fffffff
exports.kMaxLength = K_MAX_LENGTH
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Print warning and recommend using `buffer` v4.x which has an Object
* implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* We report that the browser does not support typed arrays if the are not subclassable
* using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
* for __proto__ and has a buggy typed array implementation.
*/
Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
typeof console.error === 'function') {
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.'
)
}
function typedArraySupport () {
// Can typed array instances can be augmented?
try {
var arr = new Uint8Array(1)
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
return arr.foo() === 42
} catch (e) {
return false
}
}
function createBuffer (length) {
if (length > K_MAX_LENGTH) {
throw new RangeError('Invalid typed array length')
}
// Return an augmented `Uint8Array` instance
var buf = new Uint8Array(length)
buf.__proto__ = Buffer.prototype
return buf
}
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
function Buffer (arg, encodingOrOffset, length) {
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new Error(
'If encoding is specified then the first argument must be a string'
)
}
return allocUnsafe(arg)
}
return from(arg, encodingOrOffset, length)
}
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
if (typeof Symbol !== 'undefined' && Symbol.species &&
Buffer[Symbol.species] === Buffer) {
Object.defineProperty(Buffer, Symbol.species, {
value: null,
configurable: true,
enumerable: false,
writable: false
})
}
Buffer.poolSize = 8192 // not used by this implementation
function from (value, encodingOrOffset, length) {
if (typeof value === 'number') {
throw new TypeError('"value" argument must not be a number')
}
if (isArrayBuffer(value)) {
return fromArrayBuffer(value, encodingOrOffset, length)
}
if (typeof value === 'string') {
return fromString(value, encodingOrOffset)
}
return fromObject(value)
}
/**
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
* if value is a number.
* Buffer.from(str[, encoding])
* Buffer.from(array)
* Buffer.from(buffer)
* Buffer.from(arrayBuffer[, byteOffset[, length]])
**/
Buffer.from = function (value, encodingOrOffset, length) {
return from(value, encodingOrOffset, length)
}
// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
// https://github.com/feross/buffer/pull/148
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
function assertSize (size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number')
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative')
}
}
function alloc (size, fill, encoding) {
assertSize(size)
if (size <= 0) {
return createBuffer(size)
}
if (fill !== undefined) {
// Only pay attention to encoding if it's a string. This
// prevents accidentally sending in a number that would
// be interpretted as a start offset.
return typeof encoding === 'string'
? createBuffer(size).fill(fill, encoding)
: createBuffer(size).fill(fill)
}
return createBuffer(size)
}
/**
* Creates a new filled Buffer instance.
* alloc(size[, fill[, encoding]])
**/
Buffer.alloc = function (size, fill, encoding) {
return alloc(size, fill, encoding)