-
Notifications
You must be signed in to change notification settings - Fork 2
/
bundle.js
3269 lines (2815 loc) · 108 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(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 17);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
var isDate = __webpack_require__(9)
var MILLISECONDS_IN_HOUR = 3600000
var MILLISECONDS_IN_MINUTE = 60000
var DEFAULT_ADDITIONAL_DIGITS = 2
var parseTokenDateTimeDelimeter = /[T ]/
var parseTokenPlainTime = /:/
// year tokens
var parseTokenYY = /^(\d{2})$/
var parseTokensYYY = [
/^([+-]\d{2})$/, // 0 additional digits
/^([+-]\d{3})$/, // 1 additional digit
/^([+-]\d{4})$/ // 2 additional digits
]
var parseTokenYYYY = /^(\d{4})/
var parseTokensYYYYY = [
/^([+-]\d{4})/, // 0 additional digits
/^([+-]\d{5})/, // 1 additional digit
/^([+-]\d{6})/ // 2 additional digits
]
// date tokens
var parseTokenMM = /^-(\d{2})$/
var parseTokenDDD = /^-?(\d{3})$/
var parseTokenMMDD = /^-?(\d{2})-?(\d{2})$/
var parseTokenWww = /^-?W(\d{2})$/
var parseTokenWwwD = /^-?W(\d{2})-?(\d{1})$/
// time tokens
var parseTokenHH = /^(\d{2}([.,]\d*)?)$/
var parseTokenHHMM = /^(\d{2}):?(\d{2}([.,]\d*)?)$/
var parseTokenHHMMSS = /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/
// timezone tokens
var parseTokenTimezone = /([Z+-].*)$/
var parseTokenTimezoneZ = /^(Z)$/
var parseTokenTimezoneHH = /^([+-])(\d{2})$/
var parseTokenTimezoneHHMM = /^([+-])(\d{2}):?(\d{2})$/
/**
* @category Common Helpers
* @summary Parse the ISO-8601-formatted date.
*
* @description
* Parse the date string representation.
* It accepts complete ISO 8601 formats as well as partial implementations.
*
* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
*
* @param {String} dateString - the ISO 8601 formatted string to parse
* @param {Object} [options] - the object with options
* @param {Number} [options.additionalDigits=2] - the additional number of digits in the extended year format. Options: 0, 1 or 2
* @returns {Date} the parsed date in the local time zone
*
* @example
* // Parse string '2014-02-11T11:30:30':
* var result = parse('2014-02-11T11:30:30')
* //=> Tue Feb 11 2014 11:30:30
*
* @example
* // Parse string '+02014101',
* // if the additional number of digits in the extended year format is 1:
* var result = parse('+02014101', {additionalDigits: 1})
* //=> Fri Apr 11 2014 00:00:00
*/
function parse (dateString, options) {
if (isDate(dateString)) {
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
return new Date(dateString.getTime())
} else if (typeof dateString !== 'string') {
return new Date(dateString)
}
options = options || {}
var additionalDigits = options.additionalDigits
if (additionalDigits == null) {
additionalDigits = DEFAULT_ADDITIONAL_DIGITS
}
var dateStrings = splitDateString(dateString)
var parseYearResult = parseYear(dateStrings.date, additionalDigits)
var year = parseYearResult.year
var restDateString = parseYearResult.restDateString
var date = parseDate(restDateString, year)
if (date) {
var timestamp = date.getTime()
var time = 0
var offset
if (dateStrings.time) {
time = parseTime(dateStrings.time)
}
if (dateStrings.timezone) {
offset = parseTimezone(dateStrings.timezone)
} else {
// get offset accurate to hour in timezones that change offset
offset = new Date(timestamp + time).getTimezoneOffset()
offset = new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE).getTimezoneOffset()
}
return new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE)
} else {
return new Date(dateString)
}
}
function splitDateString (dateString) {
var dateStrings = {}
var array = dateString.split(parseTokenDateTimeDelimeter)
var timeString
if (parseTokenPlainTime.test(array[0])) {
dateStrings.date = null
timeString = array[0]
} else {
dateStrings.date = array[0]
timeString = array[1]
}
if (timeString) {
var token = parseTokenTimezone.exec(timeString)
if (token) {
dateStrings.time = timeString.replace(token[1], '')
dateStrings.timezone = token[1]
} else {
dateStrings.time = timeString
}
}
return dateStrings
}
function parseYear (dateString, additionalDigits) {
var parseTokenYYY = parseTokensYYY[additionalDigits]
var parseTokenYYYYY = parseTokensYYYYY[additionalDigits]
var token
// YYYY or ±YYYYY
token = parseTokenYYYY.exec(dateString) || parseTokenYYYYY.exec(dateString)
if (token) {
var yearString = token[1]
return {
year: parseInt(yearString, 10),
restDateString: dateString.slice(yearString.length)
}
}
// YY or ±YYY
token = parseTokenYY.exec(dateString) || parseTokenYYY.exec(dateString)
if (token) {
var centuryString = token[1]
return {
year: parseInt(centuryString, 10) * 100,
restDateString: dateString.slice(centuryString.length)
}
}
// Invalid ISO-formatted year
return {
year: null
}
}
function parseDate (dateString, year) {
// Invalid ISO-formatted year
if (year === null) {
return null
}
var token
var date
var month
var week
// YYYY
if (dateString.length === 0) {
date = new Date(0)
date.setUTCFullYear(year)
return date
}
// YYYY-MM
token = parseTokenMM.exec(dateString)
if (token) {
date = new Date(0)
month = parseInt(token[1], 10) - 1
date.setUTCFullYear(year, month)
return date
}
// YYYY-DDD or YYYYDDD
token = parseTokenDDD.exec(dateString)
if (token) {
date = new Date(0)
var dayOfYear = parseInt(token[1], 10)
date.setUTCFullYear(year, 0, dayOfYear)
return date
}
// YYYY-MM-DD or YYYYMMDD
token = parseTokenMMDD.exec(dateString)
if (token) {
date = new Date(0)
month = parseInt(token[1], 10) - 1
var day = parseInt(token[2], 10)
date.setUTCFullYear(year, month, day)
return date
}
// YYYY-Www or YYYYWww
token = parseTokenWww.exec(dateString)
if (token) {
week = parseInt(token[1], 10) - 1
return dayOfISOYear(year, week)
}
// YYYY-Www-D or YYYYWwwD
token = parseTokenWwwD.exec(dateString)
if (token) {
week = parseInt(token[1], 10) - 1
var dayOfWeek = parseInt(token[2], 10) - 1
return dayOfISOYear(year, week, dayOfWeek)
}
// Invalid ISO-formatted date
return null
}
function parseTime (timeString) {
var token
var hours
var minutes
// hh
token = parseTokenHH.exec(timeString)
if (token) {
hours = parseFloat(token[1].replace(',', '.'))
return (hours % 24) * MILLISECONDS_IN_HOUR
}
// hh:mm or hhmm
token = parseTokenHHMM.exec(timeString)
if (token) {
hours = parseInt(token[1], 10)
minutes = parseFloat(token[2].replace(',', '.'))
return (hours % 24) * MILLISECONDS_IN_HOUR +
minutes * MILLISECONDS_IN_MINUTE
}
// hh:mm:ss or hhmmss
token = parseTokenHHMMSS.exec(timeString)
if (token) {
hours = parseInt(token[1], 10)
minutes = parseInt(token[2], 10)
var seconds = parseFloat(token[3].replace(',', '.'))
return (hours % 24) * MILLISECONDS_IN_HOUR +
minutes * MILLISECONDS_IN_MINUTE +
seconds * 1000
}
// Invalid ISO-formatted time
return null
}
function parseTimezone (timezoneString) {
var token
var absoluteOffset
// Z
token = parseTokenTimezoneZ.exec(timezoneString)
if (token) {
return 0
}
// ±hh
token = parseTokenTimezoneHH.exec(timezoneString)
if (token) {
absoluteOffset = parseInt(token[2], 10) * 60
return (token[1] === '+') ? -absoluteOffset : absoluteOffset
}
// ±hh:mm or ±hhmm
token = parseTokenTimezoneHHMM.exec(timezoneString)
if (token) {
absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10)
return (token[1] === '+') ? -absoluteOffset : absoluteOffset
}
return 0
}
function dayOfISOYear (isoYear, week, day) {
week = week || 0
day = day || 0
var date = new Date(0)
date.setUTCFullYear(isoYear, 0, 4)
var fourthOfJanuaryDay = date.getUTCDay() || 7
var diff = week * 7 + day + 1 - fourthOfJanuaryDay
date.setUTCDate(date.getUTCDate() + diff)
return date
}
module.exports = parse
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
const global = document.defaultView;
/* harmony export (immutable) */ __webpack_exports__["c"] = global;
// Node.CONSTANTS
// 'cause some engine has no global Node defined
// (i.e. Node, NativeScript, basicHTML ... )
const ELEMENT_NODE = 1;
/* harmony export (immutable) */ __webpack_exports__["b"] = ELEMENT_NODE;
const ATTRIBUTE_NODE = 2;
/* unused harmony export ATTRIBUTE_NODE */
const TEXT_NODE = 3;
/* harmony export (immutable) */ __webpack_exports__["i"] = TEXT_NODE;
const COMMENT_NODE = 8;
/* harmony export (immutable) */ __webpack_exports__["g"] = COMMENT_NODE;
const DOCUMENT_FRAGMENT_NODE = 11;
/* harmony export (immutable) */ __webpack_exports__["j"] = DOCUMENT_FRAGMENT_NODE;
// SVG related constants
const OWNER_SVG_ELEMENT = 'ownerSVGElement';
/* harmony export (immutable) */ __webpack_exports__["f"] = OWNER_SVG_ELEMENT;
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
/* harmony export (immutable) */ __webpack_exports__["a"] = SVG_NAMESPACE;
// Custom Elements / MutationObserver constants
const CONNECTED = 'connected';
/* harmony export (immutable) */ __webpack_exports__["k"] = CONNECTED;
const DISCONNECTED = 'dis' + CONNECTED;
/* harmony export (immutable) */ __webpack_exports__["l"] = DISCONNECTED;
// hyperHTML related constants
const EXPANDO = '_hyper: ';
/* unused harmony export EXPANDO */
const SHOULD_USE_TEXT_CONTENT = /^style|textarea$/i;
/* harmony export (immutable) */ __webpack_exports__["h"] = SHOULD_USE_TEXT_CONTENT;
const UID = EXPANDO + ((Math.random() * new Date) | 0) + ';';
/* harmony export (immutable) */ __webpack_exports__["d"] = UID;
const UIDC = '<!--' + UID + '-->';
/* harmony export (immutable) */ __webpack_exports__["e"] = UIDC;
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// these are tiny helpers to simplify most common operations needed here
const create = (node, type) => doc(node).createElement(type);
/* harmony export (immutable) */ __webpack_exports__["b"] = create;
const doc = node => node.ownerDocument || node;
/* harmony export (immutable) */ __webpack_exports__["c"] = doc;
const fragment = node => doc(node).createDocumentFragment();
/* harmony export (immutable) */ __webpack_exports__["a"] = fragment;
const text = (node, text) => doc(node).createTextNode(text);
/* harmony export (immutable) */ __webpack_exports__["d"] = text;
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants_js__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__features_detection_js__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__easy_dom_js__ = __webpack_require__(2);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return push; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return slice; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return splice; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return unshift; });
// appends an array of nodes
// to a generic node/fragment
// When available, uses append passing all arguments at once
// hoping that's somehow faster, even if append has more checks on type
const append = __WEBPACK_IMPORTED_MODULE_1__features_detection_js__["a" /* hasAppend */] ?
(node, childNodes) => {
node.append.apply(node, childNodes);
} :
(node, childNodes) => {
const length = childNodes.length;
for (let i = 0; i < length; i++) {
node.appendChild(childNodes[i]);
}
};
/* harmony export (immutable) */ __webpack_exports__["b"] = append;
// remove comments parts from attributes to avoid issues
// with either old browsers or SVG elements
// export const cleanAttributes = html => html.replace(no, comments);
const attrName = '[^\\S]+[^ \\f\\n\\r\\t\\/>"\'=]+';
const no = new RegExp(
'(<[a-z]+[a-z0-9:_-]*)((?:' +
attrName +
'(?:=(?:\'.*?\'|".*?"|<.+?>|\\S+))?)+)([^\\S]*/?>)',
'gi'
);
const findAttributes = new RegExp('(' + attrName + '=)([\'"]?)' + __WEBPACK_IMPORTED_MODULE_0__constants_js__["e" /* UIDC */] + '\\2', 'gi');
const comments = ($0, $1, $2, $3) =>
$1 + $2.replace(findAttributes, replaceAttributes) + $3;
const replaceAttributes = ($0, $1, $2) => $1 + ($2 || '"') + __WEBPACK_IMPORTED_MODULE_0__constants_js__["d" /* UID */] + ($2 || '"');
// given a node and a generic HTML content,
// create either an SVG or an HTML fragment
// where such content will be injected
const createFragment = (node, html) =>
(__WEBPACK_IMPORTED_MODULE_0__constants_js__["f" /* OWNER_SVG_ELEMENT */] in node ?
SVGFragment :
HTMLFragment
)(node, html.replace(no, comments));
/* harmony export (immutable) */ __webpack_exports__["h"] = createFragment;
// IE/Edge shenanigans proof cloneNode
// it goes through all nodes manually
// instead of relying the engine to suddenly
// merge nodes together
const cloneNode = __WEBPACK_IMPORTED_MODULE_1__features_detection_js__["b" /* hasDoomedCloneNode */] ?
node => {
const clone = node.cloneNode();
const childNodes = node.childNodes ||
// this is an excess of caution
// but some node, in IE, might not
// have childNodes property.
// The following fallback ensure working code
// in older IE without compromising performance
// or any other browser/engine involved.
/* istanbul ignore next */
[];
const length = childNodes.length;
for (let i = 0; i < length; i++) {
clone.appendChild(cloneNode(childNodes[i]));
}
return clone;
} :
// the following ignore is due code-coverage
// combination of not having document.importNode
// but having a working node.cloneNode.
// This shenario is common on older Android/WebKit browsers
// but basicHTML here tests just two major cases:
// with document.importNode or with broken cloneNode.
/* istanbul ignore next */
node => node.cloneNode(true);
// used to import html into fragments
const importNode = __WEBPACK_IMPORTED_MODULE_1__features_detection_js__["c" /* hasImportNode */] ?
(doc, node) => doc.importNode(node, true) :
(doc, node) => cloneNode(node)
/* harmony export (immutable) */ __webpack_exports__["g"] = importNode;
// just recycling a one-off array to use slice/splice
// in every needed place
const {push, slice, splice, unshift} = [];
// lazy evaluated, returns the unique identity
// of a template literal, as tempalte literal itself.
// By default, ES2015 template literals are unique
// tag`a${1}z` === tag`a${2}z`
// even if interpolated values are different
// the template chunks are in a frozen Array
// that is identical each time you use the same
// literal to represent same static content
// around its own interpolations.
const unique = template => TL(template);
/* harmony export (immutable) */ __webpack_exports__["a"] = unique;
// TL returns a unique version of the template
// it needs lazy feature detection
// (cannot trust literals with transpiled code)
let TL = template => {
if (
// TypeScript template literals are not standard
template.propertyIsEnumerable('raw') ||
(
// Firefox < 55 has not standard implementation neither
/Firefox\/(\d+)/.test((__WEBPACK_IMPORTED_MODULE_0__constants_js__["c" /* global */].navigator || {}).userAgent) &&
parseFloat(RegExp.$1) < 55
)
) {
// in these cases, address templates once
const templateObjects = {};
// but always return the same template
TL = template => {
const key = '_' + template.join(__WEBPACK_IMPORTED_MODULE_0__constants_js__["d" /* UID */]);
return templateObjects[key] || (
templateObjects[key] = template
);
};
}
else {
// make TL an identity like function
TL = template => template;
}
return TL(template);
};
// create document fragments via native template
// with a fallback for browsers that won't be able
// to deal with some injected element such <td> or others
const HTMLFragment = __WEBPACK_IMPORTED_MODULE_1__features_detection_js__["d" /* hasContent */] ?
(node, html) => {
const container = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__easy_dom_js__["b" /* create */])(node, 'template');
container.innerHTML = html;
return container.content;
} :
(node, html) => {
const container = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__easy_dom_js__["b" /* create */])(node, 'template');
const content = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__easy_dom_js__["a" /* fragment */])(node);
if (/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(html)) {
const selector = RegExp.$1;
container.innerHTML = '<table>' + html + '</table>';
append(content, slice.call(container.querySelectorAll(selector)));
} else {
container.innerHTML = html;
append(content, slice.call(container.childNodes));
}
return content;
};
// creates SVG fragment with a fallback for IE that needs SVG
// within the HTML content
const SVGFragment = __WEBPACK_IMPORTED_MODULE_1__features_detection_js__["d" /* hasContent */] ?
(node, html) => {
const content = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__easy_dom_js__["a" /* fragment */])(node);
const container = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__easy_dom_js__["c" /* doc */])(node).createElementNS(__WEBPACK_IMPORTED_MODULE_0__constants_js__["a" /* SVG_NAMESPACE */], 'svg');
container.innerHTML = html;
append(content, slice.call(container.childNodes));
return content;
} :
(node, html) => {
const content = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__easy_dom_js__["a" /* fragment */])(node);
const container = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__easy_dom_js__["b" /* create */])(node, 'div');
container.innerHTML = '<svg xmlns="' + __WEBPACK_IMPORTED_MODULE_0__constants_js__["a" /* SVG_NAMESPACE */] + '">' + html + '</svg>';
append(content, slice.call(container.firstChild.childNodes));
return content;
};
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
var startOfWeek = __webpack_require__(28)
/**
* @category ISO Week Helpers
* @summary Return the start of an ISO week for the given date.
*
* @description
* Return the start of an ISO week for the given date.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param {Date|String|Number} date - the original date
* @returns {Date} the start of an ISO week
*
* @example
* // The start of an ISO week for 2 September 2014 11:55:00:
* var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
*/
function startOfISOWeek (dirtyDate) {
return startOfWeek(dirtyDate, {weekStartsOn: 1})
}
module.exports = startOfISOWeek
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = Component;
/* harmony export (immutable) */ __webpack_exports__["b"] = setup;
// hyperHTML.Component is a very basic class
// able to create Custom Elements like components
// including the ability to listen to connect/disconnect
// events via onconnect/ondisconnect attributes
function Component() {}
// components will lazily define html or svg properties
// as soon as these are invoked within the .render() method
// Such render() method is not provided by the base class
// but it must be available through the Component extend.
function setup(content) {
Object.defineProperties(
Component.prototype,
{
handleEvent: {value(e) {
const ct = e.currentTarget;
this[
('getAttribute' in ct && ct.getAttribute('data-call')) ||
('on' + e.type)
](e);
}},
html: lazyGetter('html', content),
svg: lazyGetter('svg', content),
state: lazyGetter('state', function () { return this.defaultState; }),
defaultState: {get() { return {}; }},
setState: {value(state) {
const target = this.state;
const source = typeof state === 'function' ? state.call(this, target) : state;
for (const key in source) target[key] = source[key];
this.render();
}}
}
);
}
// instead of a secret key I could've used a WeakMap
// However, attaching a property directly will result
// into better performance with thousands of components
// hanging around, and less memory pressure caused by the WeakMap
const lazyGetter = (type, fn) => {
const secret = '_' + type + '$';
return {
get() {
return this[secret] || (this[type] = fn.call(this, type));
},
set(value) {
Object.defineProperty(this, secret, {configurable: true, value});
}
};
};
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants_js__ = __webpack_require__(1);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return Event; });
// you know that kind of basics you need to cover
// your use case only but you don't want to bloat the library?
// There's even a package in here:
// https://www.npmjs.com/package/poorlyfills
// used to dispatch simple events
let Event = __WEBPACK_IMPORTED_MODULE_0__constants_js__["c" /* global */].Event;
try {
new Event('Event');
} catch(o_O) {
Event = function (type) {
const e = document.createEvent('Event');
e.initEvent(type, false, false);
return e;
};
}
// used to store template literals
const Map = __WEBPACK_IMPORTED_MODULE_0__constants_js__["c" /* global */].Map || function Map() {
const keys = [], values = [];
return {
get(obj) {
return values[keys.indexOf(obj)];
},
set(obj, value) {
values[keys.push(obj) - 1] = value;
}
};
};
/* harmony export (immutable) */ __webpack_exports__["c"] = Map;
// used to store wired content
const WeakMap = __WEBPACK_IMPORTED_MODULE_0__constants_js__["c" /* global */].WeakMap || function WeakMap() {
return {
get(obj) { return obj[__WEBPACK_IMPORTED_MODULE_0__constants_js__["d" /* UID */]]; },
set(obj, value) {
Object.defineProperty(obj, __WEBPACK_IMPORTED_MODULE_0__constants_js__["d" /* UID */], {
configurable: true,
value
});
}
};
};
/* harmony export (immutable) */ __webpack_exports__["a"] = WeakMap;
// used to store hyper.Components
const WeakSet = __WEBPACK_IMPORTED_MODULE_0__constants_js__["c" /* global */].WeakSet || function WeakSet() {
const wm = new WeakMap;
return {
add(obj) { wm.set(obj, true); },
has(obj) { return wm.get(obj) === true; }
};
};
/* harmony export (immutable) */ __webpack_exports__["d"] = WeakSet;
// used to be sure IE9 or older Androids work as expected
const isArray = Array.isArray || (toString =>
arr => toString.call(arr) === '[object Array]'
)({}.toString);
/* harmony export (immutable) */ __webpack_exports__["e"] = isArray;
const trim = __WEBPACK_IMPORTED_MODULE_0__constants_js__["d" /* UID */].trim || function () {
return this.replace(/^\s+|\s+$/g, '');
};
/* harmony export (immutable) */ __webpack_exports__["b"] = trim;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
var parse = __webpack_require__(0)
/**
* @category Second Helpers
* @summary Add the specified number of seconds to the given date.
*
* @description
* Add the specified number of seconds to the given date.
*
* @param {Date|String|Number} date - the date to be changed
* @param {Number} amount - the amount of seconds to be added
* @returns {Date} the new date with the seconds added
*
* @example
* // Add 30 seconds to 10 July 2014 12:45:00:
* var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
* //=> Thu Jul 10 2014 12:45:30
*/
function addSeconds (dirtyDate, amount) {
var date = parse(dirtyDate)
date.setSeconds(date.getSeconds() + amount)
return date
}
module.exports = addSeconds
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
var parse = __webpack_require__(0)
var startOfISOWeek = __webpack_require__(4)
/**
* @category ISO Week-Numbering Year Helpers
* @summary Get the ISO week-numbering year of the given date.
*
* @description
* Get the ISO week-numbering year of the given date,
* which always starts 3 days before the year's first Thursday.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @param {Date|String|Number} date - the given date
* @returns {Number} the ISO week-numbering year
*
* @example
* // Which ISO-week numbering year is 2 January 2005?
* var result = getISOYear(new Date(2005, 0, 2))
* //=> 2004
*/
function getISOYear (dirtyDate) {
var date = parse(dirtyDate)
var year = date.getFullYear()
var fourthOfJanuaryOfNextYear = new Date(0)
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4)
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0)
var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear)
var fourthOfJanuaryOfThisYear = new Date(0)
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4)
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0)
var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear)
if (date.getTime() >= startOfNextYear.getTime()) {
return year + 1
} else if (date.getTime() >= startOfThisYear.getTime()) {
return year
} else {
return year - 1
}
}
module.exports = getISOYear
/***/ }),
/* 9 */
/***/ (function(module, exports) {
/**
* @category Common Helpers
* @summary Is the given argument an instance of Date?
*
* @description
* Is the given argument an instance of Date?
*
* @param {*} argument - the argument to check
* @returns {Boolean} the given argument is an instance of Date
*
* @example
* // Is 'mayonnaise' a Date?
* var result = isDate('mayonnaise')
* //=> false
*/
function isDate (argument) {
return argument instanceof Date
}
module.exports = isDate
/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shared_utils_js__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__shared_easy_dom_js__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Component_js__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__objects_Engine_js__ = __webpack_require__(31);
// this is an overly defensive approach to avoid any possible
// side-effect when the live collection of nodes is passed around
/* 0 0 0
000 00 00 000
0000 0000 0000 0000
00000 0000 0000 0000
000000 000000 000000 000000
0000000 0000000 0000000 0000000
0000000000000000 0000000000000000000 0000000000000000
0000000000000000 000000000000000000 0000000000000000
0000000000000000 00000000000000000 000000000000000
0000000 000000 0000000 0000000
0000000000000000 0000000 0000000 000000000000000
0000000000000000 00000000000000 0000000000000000
000000 000000000000 000000
0000000000000 00000000 0000000000000
0 0000000000000000 0000000000000000 0
00 00000000000000000 0000000000000000 00
000 00000 000000 0000000 00000 000
0000 00000 000000 000000 00000
000000 000000 0000000 000000 000000
0000000 000000 00000000 00000 0000000
00000000 00000 000000000 00000 000000000
0000000000 00000000000000000 0000000000
00000000000 00000000000000 00000000000
0000000000000 000000000 0000000000000
000000000 00000 0000000000
0000 000 0000
0 0 0
slyer0.deviantart.com */
// Megatron is a transformer in charge of mutating
// a list of live DOM nodes into a new list.
function Megatron(node, childNodes) {
this.node = node;
this.childNodes = childNodes;
}
// it carries the default merge/diff engine
// that can be swapped via hyperHTML.engine = {...}
// See hyperhtml-majinbuu to know more
Megatron.engine = __WEBPACK_IMPORTED_MODULE_3__objects_Engine_js__["a" /* default */];
// quickly erase the related content
// optionally add a single node/component as value
Megatron.prototype.empty = function empty(value) {
const node = this.node;
const childNodes = this.childNodes;
let length = childNodes.length;
if (length) {
const pn = node.parentNode;
const remove = __WEBPACK_IMPORTED_MODULE_0__shared_utils_js__["d" /* splice */].call(childNodes, 0, length);