-
-
Notifications
You must be signed in to change notification settings - Fork 587
/
application.js
8848 lines (7380 loc) · 756 KB
/
application.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, a) { for(var i in a) e[i] = a[i]; }(window, /******/ (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;
/******/
/******/ // 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 = 6);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
/*
* Copyright (c) 2016-2018 Martin Donath <martin.donath@squidfunk.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/* ----------------------------------------------------------------------------
* Module
* ------------------------------------------------------------------------- */
/* eslint-disable no-underscore-dangle */
exports.default = /* JSX */{
/**
* Create a native DOM node from JSX's intermediate representation
*
* @param {string} tag - Tag name
* @param {?Object} properties - Properties
* @param {Array<string | number | { __html: string } | Array<HTMLElement>>}
* children - Child nodes
* @return {HTMLElement} Native DOM node
*/
createElement: function createElement(tag, properties) {
var el = document.createElement(tag);
/* Set all properties */
if (properties) Array.prototype.forEach.call(Object.keys(properties), function (attr) {
el.setAttribute(attr, properties[attr]);
});
/* Iterate child nodes */
var iterateChildNodes = function iterateChildNodes(nodes) {
Array.prototype.forEach.call(nodes, function (node) {
/* Directly append text content */
if (typeof node === "string" || typeof node === "number") {
el.textContent += node;
/* Recurse, if we got an array */
} else if (Array.isArray(node)) {
iterateChildNodes(node);
/* Append raw HTML */
} else if (typeof node.__html !== "undefined") {
el.innerHTML += node.__html;
/* Append regular nodes */
} else if (node instanceof Node) {
el.appendChild(node);
}
});
};
/* Iterate child nodes and return element */
for (var _len = arguments.length, children = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
children[_key - 2] = arguments[_key];
}
iterateChildNodes(children);
return el;
}
};
module.exports = exports["default"];
/***/ }),
/* 1 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
var index = typeof fetch=='function' ? fetch.bind() : function(url, options) {
options = options || {};
return new Promise( function (resolve, reject) {
var request = new XMLHttpRequest();
request.open(options.method || 'get', url);
for (var i in options.headers) {
request.setRequestHeader(i, options.headers[i]);
}
request.withCredentials = options.credentials=='include';
request.onload = function () {
resolve(response());
};
request.onerror = reject;
request.send(options.body);
function response() {
var keys = [],
all = [],
headers = {},
header;
request.getAllResponseHeaders().replace(/^(.*?):\s*([\s\S]*?)$/gm, function (m, key, value) {
keys.push(key = key.toLowerCase());
all.push([key, value]);
header = headers[key];
headers[key] = header ? (header + "," + value) : value;
});
return {
ok: (request.status/200|0) == 1, // 200-299
status: request.status,
statusText: request.statusText,
url: request.responseURL,
clone: response,
text: function () { return Promise.resolve(request.responseText); },
json: function () { return Promise.resolve(request.responseText).then(JSON.parse); },
blob: function () { return Promise.resolve(new Blob([request.response])); },
headers: {
keys: function () { return keys; },
entries: function () { return all; },
get: function (n) { return headers[n.toLowerCase()]; },
has: function (n) { return n.toLowerCase() in headers; }
}
};
}
});
};
/* harmony default export */ __webpack_exports__["default"] = (index);
//# sourceMappingURL=unfetch.es.js.map
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/*
* Copyright (c) 2016-2018 Martin Donath <martin.donath@squidfunk.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/* ----------------------------------------------------------------------------
* Class
* ------------------------------------------------------------------------- */
var Listener = function () {
/**
* Generic event listener
*
* @constructor
*
* @property {(Array<EventTarget>)} els_ - Event targets
* @property {Object} handler_- Event handlers
* @property {Array<string>} events_ - Event names
* @property {Function} update_ - Update handler
*
* @param {?(string|EventTarget|NodeList<EventTarget>)} els -
* Selector or Event targets
* @param {(string|Array<string>)} events - Event names
* @param {(Object|Function)} handler - Handler to be invoked
*/
function Listener(els, events, handler) {
var _this = this;
_classCallCheck(this, Listener);
this.els_ = Array.prototype.slice.call(typeof els === "string" ? document.querySelectorAll(els) : [].concat(els));
/* Set handler as function or directly as object */
this.handler_ = typeof handler === "function" ? { update: handler } : handler;
/* Initialize event names and update handler */
this.events_ = [].concat(events);
this.update_ = function (ev) {
return _this.handler_.update(ev);
};
}
/**
* Register listener for all relevant events
*/
Listener.prototype.listen = function listen() {
var _this2 = this;
this.els_.forEach(function (el) {
_this2.events_.forEach(function (event) {
el.addEventListener(event, _this2.update_, false);
});
});
/* Execute setup handler, if implemented */
if (typeof this.handler_.setup === "function") this.handler_.setup();
};
/**
* Unregister listener for all relevant events
*/
Listener.prototype.unlisten = function unlisten() {
var _this3 = this;
this.els_.forEach(function (el) {
_this3.events_.forEach(function (event) {
el.removeEventListener(event, _this3.update_);
});
});
/* Execute reset handler, if implemented */
if (typeof this.handler_.reset === "function") this.handler_.reset();
};
return Listener;
}();
exports.default = Listener;
/***/ }),
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(JSX) {
exports.__esModule = true;
exports.app = undefined;
__webpack_require__(7);
__webpack_require__(8);
__webpack_require__(9);
__webpack_require__(10);
__webpack_require__(11);
__webpack_require__(12);
__webpack_require__(13);
var _promisePolyfill = __webpack_require__(14);
var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill);
var _clipboard = __webpack_require__(18);
var _clipboard2 = _interopRequireDefault(_clipboard);
var _fastclick = __webpack_require__(26);
var _fastclick2 = _interopRequireDefault(_fastclick);
var _Material = __webpack_require__(27);
var _Material2 = _interopRequireDefault(_Material);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*
* Copyright (c) 2016-2018 Martin Donath <martin.donath@squidfunk.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
window.Promise = window.Promise || _promisePolyfill2.default;
/* ----------------------------------------------------------------------------
* Dependencies
* ------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------
* Polyfills
* ------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------
* Functions
* ------------------------------------------------------------------------- */
/**
* Return the meta tag value for the given key
*
* @param {string} key - Meta name
*
* @return {string} Meta content value
*/
var translate = function translate(key) {
var meta = document.getElementsByName("lang:" + key)[0];
if (!(meta instanceof HTMLMetaElement)) throw new ReferenceError();
return meta.content;
};
/* ----------------------------------------------------------------------------
* Application
* ------------------------------------------------------------------------- */
/**
* Initialize Material for MkDocs
*
* @param {Object} config - Configuration
*/
function initialize(config) {
// eslint-disable-line func-style
/* Initialize Modernizr and FastClick */
new _Material2.default.Event.Listener(document, "DOMContentLoaded", function () {
if (!(document.body instanceof HTMLElement)) throw new ReferenceError();
/* Attach FastClick to mitigate 300ms delay on touch devices */
_fastclick2.default.attach(document.body);
/* Test for iOS */
Modernizr.addTest("ios", function () {
return !!navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
});
/* Wrap all data tables for better overflow scrolling */
var tables = document.querySelectorAll("table:not([class])"); // TODO: this is JSX, we should rename the file
Array.prototype.forEach.call(tables, function (table) {
var wrap = JSX.createElement(
"div",
{ "class": "md-typeset__scrollwrap" },
JSX.createElement("div", { "class": "md-typeset__table" })
);
if (table.nextSibling) {
table.parentNode.insertBefore(wrap, table.nextSibling);
} else {
table.parentNode.appendChild(wrap);
}
wrap.children[0].appendChild(table);
});
/* Clipboard integration */
if (_clipboard2.default.isSupported()) {
var blocks = document.querySelectorAll(".codehilite > pre, pre > code");
Array.prototype.forEach.call(blocks, function (block, index) {
var id = "__code_" + index;
/* Create button with message container */
var button = JSX.createElement(
"button",
{ "class": "md-clipboard", title: translate("clipboard.copy"),
"data-clipboard-target": "#" + id + " pre, #" + id + " code" },
JSX.createElement("span", { "class": "md-clipboard__message" })
);
/* Link to block and insert button */
var parent = block.parentNode;
parent.id = id;
parent.insertBefore(button, block);
});
/* Initialize Clipboard listener */
var copy = new _clipboard2.default(".md-clipboard");
/* Success handler */
copy.on("success", function (action) {
var message = action.trigger.querySelector(".md-clipboard__message");
if (!(message instanceof HTMLElement)) throw new ReferenceError();
/* Clear selection and reset debounce logic */
action.clearSelection();
if (message.dataset.mdTimer) clearTimeout(parseInt(message.dataset.mdTimer, 10));
/* Set message indicating success and show it */
message.classList.add("md-clipboard__message--active");
message.innerHTML = translate("clipboard.copied");
/* Hide message after two seconds */
message.dataset.mdTimer = setTimeout(function () {
message.classList.remove("md-clipboard__message--active");
message.dataset.mdTimer = "";
}, 2000).toString();
});
}
/* Polyfill details/summary functionality */
if (!Modernizr.details) {
var _blocks = document.querySelectorAll("details > summary");
Array.prototype.forEach.call(_blocks, function (summary) {
summary.addEventListener("click", function (ev) {
var details = ev.target.parentNode;
if (details.hasAttribute("open")) {
details.removeAttribute("open");
} else {
details.setAttribute("open", "");
}
});
});
}
/* Open details after anchor jump */
var details = function details() {
if (document.location.hash) {
var el = document.getElementById(document.location.hash.substring(1));
if (!el) return;
/* Walk up as long as we're not in a details tag */
var parent = el.parentNode;
while (parent && !(parent instanceof HTMLDetailsElement)) {
parent = parent.parentNode;
} /* If there's a details tag, open it */
if (parent && !parent.open) {
parent.open = true;
/* Force reload, so the viewport repositions */
var loc = location.hash;
location.hash = " ";
location.hash = loc;
}
}
};
window.addEventListener("hashchange", details);
details();
/* Force 1px scroll offset to trigger overflow scrolling */
if (Modernizr.ios) {
var scrollable = document.querySelectorAll("[data-md-scrollfix]");
Array.prototype.forEach.call(scrollable, function (item) {
item.addEventListener("touchstart", function () {
var top = item.scrollTop;
/* We're at the top of the container */
if (top === 0) {
item.scrollTop = 1;
/* We're at the bottom of the container */
} else if (top + item.offsetHeight === item.scrollHeight) {
item.scrollTop = top - 1;
}
});
});
}
}).listen();
/* Component: header shadow toggle */
new _Material2.default.Event.Listener(window, ["scroll", "resize", "orientationchange"], new _Material2.default.Header.Shadow("[data-md-component=container]", "[data-md-component=header]")).listen();
/* Component: header title toggle */
new _Material2.default.Event.Listener(window, ["scroll", "resize", "orientationchange"], new _Material2.default.Header.Title("[data-md-component=title]", ".md-typeset h1")).listen();
/* Component: hero visibility toggle */
if (document.querySelector("[data-md-component=hero]")) new _Material2.default.Event.Listener(window, ["scroll", "resize", "orientationchange"], new _Material2.default.Tabs.Toggle("[data-md-component=hero]")).listen();
/* Component: tabs visibility toggle */
if (document.querySelector("[data-md-component=tabs]")) new _Material2.default.Event.Listener(window, ["scroll", "resize", "orientationchange"], new _Material2.default.Tabs.Toggle("[data-md-component=tabs]")).listen();
/* Component: sidebar with navigation */
new _Material2.default.Event.MatchMedia("(min-width: 1220px)", new _Material2.default.Event.Listener(window, ["scroll", "resize", "orientationchange"], new _Material2.default.Sidebar.Position("[data-md-component=navigation]", "[data-md-component=header]")));
/* Component: sidebar with table of contents (missing on 404 page) */
if (document.querySelector("[data-md-component=toc]")) new _Material2.default.Event.MatchMedia("(min-width: 960px)", new _Material2.default.Event.Listener(window, ["scroll", "resize", "orientationchange"], new _Material2.default.Sidebar.Position("[data-md-component=toc]", "[data-md-component=header]")));
/* Component: link blurring for table of contents */
new _Material2.default.Event.MatchMedia("(min-width: 960px)", new _Material2.default.Event.Listener(window, "scroll", new _Material2.default.Nav.Blur("[data-md-component=toc] [href]")));
/* Component: collapsible elements for navigation */
var collapsibles = document.querySelectorAll("[data-md-component=collapsible]");
Array.prototype.forEach.call(collapsibles, function (collapse) {
new _Material2.default.Event.MatchMedia("(min-width: 1220px)", new _Material2.default.Event.Listener(collapse.previousElementSibling, "click", new _Material2.default.Nav.Collapse(collapse)));
});
/* Component: active pane monitor for iOS scrolling fixes */
new _Material2.default.Event.MatchMedia("(max-width: 1219px)", new _Material2.default.Event.Listener("[data-md-component=navigation] [data-md-toggle]", "change", new _Material2.default.Nav.Scrolling("[data-md-component=navigation] nav")));
/* Initialize search, if available */
if (document.querySelector("[data-md-component=search]")) {
/* Component: search body lock for mobile */
new _Material2.default.Event.MatchMedia("(max-width: 959px)", new _Material2.default.Event.Listener("[data-md-toggle=search]", "change", new _Material2.default.Search.Lock("[data-md-toggle=search]")));
/* Component: search results */
new _Material2.default.Event.Listener("[data-md-component=query]", ["focus", "keyup", "change"], new _Material2.default.Search.Result("[data-md-component=result]", function () {
return fetch(config.url.base + "/" + (config.version < "0.17" ? "mkdocs" : "search") + "/search_index.json", {
credentials: "same-origin"
}).then(function (response) {
return response.json();
}).then(function (data) {
return data.docs.map(function (doc) {
doc.location = config.url.base + doc.location;
return doc;
});
});
})).listen();
/* Listener: focus input after form reset */
new _Material2.default.Event.Listener("[data-md-component=reset]", "click", function () {
setTimeout(function () {
var query = document.querySelector("[data-md-component=query]");
if (!(query instanceof HTMLInputElement)) throw new ReferenceError();
query.focus();
}, 10);
}).listen();
/* Listener: focus input after opening search */
new _Material2.default.Event.Listener("[data-md-toggle=search]", "change", function (ev) {
setTimeout(function (toggle) {
if (!(toggle instanceof HTMLInputElement)) throw new ReferenceError();
if (toggle.checked) {
var query = document.querySelector("[data-md-component=query]");
if (!(query instanceof HTMLInputElement)) throw new ReferenceError();
query.focus();
}
}, 400, ev.target);
}).listen();
/* Listener: open search on focus */
new _Material2.default.Event.MatchMedia("(min-width: 960px)", new _Material2.default.Event.Listener("[data-md-component=query]", "focus", function () {
var toggle = document.querySelector("[data-md-toggle=search]");
if (!(toggle instanceof HTMLInputElement)) throw new ReferenceError();
if (!toggle.checked) {
toggle.checked = true;
toggle.dispatchEvent(new CustomEvent("change"));
}
}));
/* Listener: keyboard handlers */ // eslint-disable-next-line complexity
new _Material2.default.Event.Listener(window, "keydown", function (ev) {
// TODO: split up into component to reduce complexity
var toggle = document.querySelector("[data-md-toggle=search]");
if (!(toggle instanceof HTMLInputElement)) throw new ReferenceError();
var query = document.querySelector("[data-md-component=query]");
if (!(query instanceof HTMLInputElement)) throw new ReferenceError();
/* Abort if meta key (macOS) or ctrl key (Windows) is pressed */
if (ev.metaKey || ev.ctrlKey) return;
/* Search is open */
if (toggle.checked) {
/* Enter: prevent form submission */
if (ev.keyCode === 13) {
if (query === document.activeElement) {
ev.preventDefault();
/* Go to current active/focused link */
var focus = document.querySelector("[data-md-component=search] [href][data-md-state=active]");
if (focus instanceof HTMLLinkElement) {
window.location = focus.getAttribute("href");
/* Close search */
toggle.checked = false;
toggle.dispatchEvent(new CustomEvent("change"));
query.blur();
}
}
/* Escape or Tab: close search */
} else if (ev.keyCode === 9 || ev.keyCode === 27) {
toggle.checked = false;
toggle.dispatchEvent(new CustomEvent("change"));
query.blur();
/* Horizontal arrows and backspace: focus input */
} else if ([8, 37, 39].indexOf(ev.keyCode) !== -1) {
if (query !== document.activeElement) query.focus();
/* Vertical arrows: select previous or next search result */
} else if ([38, 40].indexOf(ev.keyCode) !== -1) {
var key = ev.keyCode;
/* Retrieve all results */
var links = Array.prototype.slice.call(document.querySelectorAll("[data-md-component=query], [data-md-component=search] [href]"));
/* Retrieve current active/focused result */
var _focus = links.find(function (link) {
if (!(link instanceof HTMLElement)) throw new ReferenceError();
return link.dataset.mdState === "active";
});
if (_focus) _focus.dataset.mdState = "";
/* Calculate index depending on direction, add length to form ring */
var index = Math.max(0, (links.indexOf(_focus) + links.length + (key === 38 ? -1 : +1)) % links.length);
/* Set active state and focus */
if (links[index]) {
links[index].dataset.mdState = "active";
links[index].focus();
}
/* Prevent scrolling of page */
ev.preventDefault();
ev.stopPropagation();
/* Return false prevents the cursor position from changing */
return false;
}
/* Search is closed and we're not inside a form */
} else if (document.activeElement && !document.activeElement.form) {
/* F/S: Open search if not in input field */
if (ev.keyCode === 70 || ev.keyCode === 83) {
query.focus();
ev.preventDefault();
}
}
}).listen();
/* Listener: focus query if in search is open and character is typed */
new _Material2.default.Event.Listener(window, "keypress", function () {
var toggle = document.querySelector("[data-md-toggle=search]");
if (!(toggle instanceof HTMLInputElement)) throw new ReferenceError();
if (toggle.checked) {
var query = document.querySelector("[data-md-component=query]");
if (!(query instanceof HTMLInputElement)) throw new ReferenceError();
if (query !== document.activeElement) query.focus();
}
}).listen();
}
/* Listener: handle tabbing context for better accessibility */
new _Material2.default.Event.Listener(document.body, "keydown", function (ev) {
if (ev.keyCode === 9) {
var labels = document.querySelectorAll("[data-md-component=navigation] .md-nav__link[for]:not([tabindex])");
Array.prototype.forEach.call(labels, function (label) {
if (label.offsetHeight) label.tabIndex = 0;
});
}
}).listen();
/* Listener: reset tabbing behavior */
new _Material2.default.Event.Listener(document.body, "mousedown", function () {
var labels = document.querySelectorAll("[data-md-component=navigation] .md-nav__link[tabindex]");
Array.prototype.forEach.call(labels, function (label) {
label.removeAttribute("tabIndex");
});
}).listen();
document.body.addEventListener("click", function () {
if (document.body.dataset.mdState === "tabbing") document.body.dataset.mdState = "";
});
/* Listener: close drawer when anchor links are clicked */
new _Material2.default.Event.MatchMedia("(max-width: 959px)", new _Material2.default.Event.Listener("[data-md-component=navigation] [href^='#']", "click", function () {
var toggle = document.querySelector("[data-md-toggle=drawer]");
if (!(toggle instanceof HTMLInputElement)) throw new ReferenceError();
if (toggle.checked) {
toggle.checked = false;
toggle.dispatchEvent(new CustomEvent("change"));
}
}))
/* Retrieve facts for the given repository type */
;(function () {
var el = document.querySelector("[data-md-source]");
if (!el) return _promisePolyfill2.default.resolve([]);else if (!(el instanceof HTMLAnchorElement)) throw new ReferenceError();
switch (el.dataset.mdSource) {
case "github":
return new _Material2.default.Source.Adapter.GitHub(el).fetch();
default:
return _promisePolyfill2.default.resolve([]);
}
/* Render repository information */
})().then(function (facts) {
var sources = document.querySelectorAll("[data-md-source]");
Array.prototype.forEach.call(sources, function (source) {
new _Material2.default.Source.Repository(source).initialize(facts);
});
});
}
/* ----------------------------------------------------------------------------
* Exports
* ------------------------------------------------------------------------- */
/* Provide this for downward compatibility for now */
var app = {
initialize: initialize
};
exports.app = app;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "assets/images/icons/bitbucket.svg";
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "assets/images/icons/github.svg";
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "assets/images/icons/gitlab.svg";
/***/ }),
/* 10 */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 11 */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/* 12 */
/***/ (function(module, exports) {
// Polyfill for creating CustomEvents on IE9/10/11
// code pulled from:
// https://github.com/d4tocchini/customevent-polyfill
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill
try {
var ce = new window.CustomEvent('test');
ce.preventDefault();
if (ce.defaultPrevented !== true) {
// IE has problems with .preventDefault() on custom events
// http://stackoverflow.com/questions/23349191
throw new Error('Could not prevent default');
}
} catch(e) {
var CustomEvent = function(event, params) {
var evt, origPrevent;
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
origPrevent = evt.preventDefault;
evt.preventDefault = function () {
origPrevent.call(this);
try {
Object.defineProperty(this, 'defaultPrevented', {
get: function () {
return true;
}
});
} catch(e) {
this.defaultPrevented = true;
}
};
return evt;
};
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent; // expose definition to window
}
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
if (!window.fetch) window.fetch = __webpack_require__(2).default || __webpack_require__(2);
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(setImmediate) {
// Store setTimeout reference so promise-polyfill will be unaffected by
// other code modifying setTimeout (like sinon.useFakeTimers())
var setTimeoutFunc = setTimeout;
function noop() {}
// Polyfill for Function.prototype.bind
function bind(fn, thisArg) {
return function() {
fn.apply(thisArg, arguments);
};
}
function Promise(fn) {
if (!(this instanceof Promise))
throw new TypeError('Promises must be constructed via new');
if (typeof fn !== 'function') throw new TypeError('not a function');
this._state = 0;
this._handled = false;
this._value = undefined;
this._deferreds = [];
doResolve(fn, this);
}
function handle(self, deferred) {
while (self._state === 3) {
self = self._value;
}
if (self._state === 0) {
self._deferreds.push(deferred);
return;
}
self._handled = true;
Promise._immediateFn(function() {
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
if (cb === null) {
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
return;
}
var ret;
try {
ret = cb(self._value);
} catch (e) {
reject(deferred.promise, e);
return;
}
resolve(deferred.promise, ret);
});
}
function resolve(self, newValue) {
try {
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
if (newValue === self)
throw new TypeError('A promise cannot be resolved with itself.');
if (
newValue &&
(typeof newValue === 'object' || typeof newValue === 'function')
) {
var then = newValue.then;
if (newValue instanceof Promise) {
self._state = 3;
self._value = newValue;
finale(self);
return;
} else if (typeof then === 'function') {
doResolve(bind(then, newValue), self);
return;
}
}
self._state = 1;
self._value = newValue;