1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
4 /***/ "./node_modules/keyboardjs/dist/keyboard.js":
5 /*!**************************************************!*\
6 !*** ./node_modules/keyboardjs/dist/keyboard.js ***!
7 \**************************************************/
8 /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
10 (function (global, factory) {
11 true ? module.exports = factory() :
13 }(this, (function () { 'use strict';
15 function _typeof(obj) {
16 "@babel/helpers - typeof";
18 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
19 _typeof = function (obj) {
23 _typeof = function (obj) {
24 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
31 function _classCallCheck(instance, Constructor) {
32 if (!(instance instanceof Constructor)) {
33 throw new TypeError("Cannot call a class as a function");
37 function _defineProperties(target, props) {
38 for (var i = 0; i < props.length; i++) {
39 var descriptor = props[i];
40 descriptor.enumerable = descriptor.enumerable || false;
41 descriptor.configurable = true;
42 if ("value" in descriptor) descriptor.writable = true;
43 Object.defineProperty(target, descriptor.key, descriptor);
47 function _createClass(Constructor, protoProps, staticProps) {
48 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
49 if (staticProps) _defineProperties(Constructor, staticProps);
53 function _toConsumableArray(arr) {
54 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
57 function _arrayWithoutHoles(arr) {
58 if (Array.isArray(arr)) return _arrayLikeToArray(arr);
61 function _iterableToArray(iter) {
62 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
65 function _unsupportedIterableToArray(o, minLen) {
67 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
68 var n = Object.prototype.toString.call(o).slice(8, -1);
69 if (n === "Object" && o.constructor) n = o.constructor.name;
70 if (n === "Map" || n === "Set") return Array.from(o);
71 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
74 function _arrayLikeToArray(arr, len) {
75 if (len == null || len > arr.length) len = arr.length;
77 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
82 function _nonIterableSpread() {
83 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
86 var KeyCombo = /*#__PURE__*/function () {
87 function KeyCombo(keyComboStr) {
88 _classCallCheck(this, KeyCombo);
90 this.sourceStr = keyComboStr;
91 this.subCombos = KeyCombo.parseComboStr(keyComboStr);
92 this.keyNames = this.subCombos.reduce(function (memo, nextSubCombo) {
93 return memo.concat(nextSubCombo);
97 _createClass(KeyCombo, [{
99 value: function check(pressedKeyNames) {
100 var startingKeyNameIndex = 0;
102 for (var i = 0; i < this.subCombos.length; i += 1) {
103 startingKeyNameIndex = this._checkSubCombo(this.subCombos[i], startingKeyNameIndex, pressedKeyNames);
105 if (startingKeyNameIndex === -1) {
114 value: function isEqual(otherKeyCombo) {
115 if (!otherKeyCombo || typeof otherKeyCombo !== 'string' && _typeof(otherKeyCombo) !== 'object') {
119 if (typeof otherKeyCombo === 'string') {
120 otherKeyCombo = new KeyCombo(otherKeyCombo);
123 if (this.subCombos.length !== otherKeyCombo.subCombos.length) {
127 for (var i = 0; i < this.subCombos.length; i += 1) {
128 if (this.subCombos[i].length !== otherKeyCombo.subCombos[i].length) {
133 for (var _i = 0; _i < this.subCombos.length; _i += 1) {
134 var subCombo = this.subCombos[_i];
136 var otherSubCombo = otherKeyCombo.subCombos[_i].slice(0);
138 for (var j = 0; j < subCombo.length; j += 1) {
139 var keyName = subCombo[j];
140 var index = otherSubCombo.indexOf(keyName);
143 otherSubCombo.splice(index, 1);
147 if (otherSubCombo.length !== 0) {
155 key: "_checkSubCombo",
156 value: function _checkSubCombo(subCombo, startingKeyNameIndex, pressedKeyNames) {
157 subCombo = subCombo.slice(0);
158 pressedKeyNames = pressedKeyNames.slice(startingKeyNameIndex);
159 var endIndex = startingKeyNameIndex;
161 for (var i = 0; i < subCombo.length; i += 1) {
162 var keyName = subCombo[i];
164 if (keyName[0] === '\\') {
165 var escapedKeyName = keyName.slice(1);
167 if (escapedKeyName === KeyCombo.comboDeliminator || escapedKeyName === KeyCombo.keyDeliminator) {
168 keyName = escapedKeyName;
172 var index = pressedKeyNames.indexOf(keyName);
175 subCombo.splice(i, 1);
178 if (index > endIndex) {
182 if (subCombo.length === 0) {
194 KeyCombo.comboDeliminator = '>';
195 KeyCombo.keyDeliminator = '+';
197 KeyCombo.parseComboStr = function (keyComboStr) {
198 var subComboStrs = KeyCombo._splitStr(keyComboStr, KeyCombo.comboDeliminator);
202 for (var i = 0; i < subComboStrs.length; i += 1) {
203 combo.push(KeyCombo._splitStr(subComboStrs[i], KeyCombo.keyDeliminator));
209 KeyCombo._splitStr = function (str, deliminator) {
215 for (var ci = 0; ci < s.length; ci += 1) {
216 if (ci > 0 && s[ci] === d && s[ci - 1] !== '\\') {
232 var Locale = /*#__PURE__*/function () {
233 function Locale(name) {
234 _classCallCheck(this, Locale);
236 this.localeName = name;
237 this.activeTargetKeys = [];
238 this.pressedKeys = [];
239 this._appliedMacros = [];
241 this._killKeyCodes = [];
245 _createClass(Locale, [{
247 value: function bindKeyCode(keyCode, keyNames) {
248 if (typeof keyNames === 'string') {
249 keyNames = [keyNames];
252 this._keyMap[keyCode] = keyNames;
256 value: function bindMacro(keyComboStr, keyNames) {
257 if (typeof keyNames === 'string') {
258 keyNames = [keyNames];
263 if (typeof keyNames === 'function') {
269 keyCombo: new KeyCombo(keyComboStr),
274 this._macros.push(macro);
278 value: function getKeyCodes(keyName) {
281 for (var keyCode in this._keyMap) {
282 var index = this._keyMap[keyCode].indexOf(keyName);
285 keyCodes.push(keyCode | 0);
293 value: function getKeyNames(keyCode) {
294 return this._keyMap[keyCode] || [];
298 value: function setKillKey(keyCode) {
299 if (typeof keyCode === 'string') {
300 var keyCodes = this.getKeyCodes(keyCode);
302 for (var i = 0; i < keyCodes.length; i += 1) {
303 this.setKillKey(keyCodes[i]);
309 this._killKeyCodes.push(keyCode);
313 value: function pressKey(keyCode) {
314 if (typeof keyCode === 'string') {
315 var keyCodes = this.getKeyCodes(keyCode);
317 for (var i = 0; i < keyCodes.length; i += 1) {
318 this.pressKey(keyCodes[i]);
324 this.activeTargetKeys.length = 0;
325 var keyNames = this.getKeyNames(keyCode);
327 for (var _i = 0; _i < keyNames.length; _i += 1) {
328 this.activeTargetKeys.push(keyNames[_i]);
330 if (this.pressedKeys.indexOf(keyNames[_i]) === -1) {
331 this.pressedKeys.push(keyNames[_i]);
339 value: function releaseKey(keyCode) {
340 if (typeof keyCode === 'string') {
341 var keyCodes = this.getKeyCodes(keyCode);
343 for (var i = 0; i < keyCodes.length; i += 1) {
344 this.releaseKey(keyCodes[i]);
347 var keyNames = this.getKeyNames(keyCode);
349 var killKeyCodeIndex = this._killKeyCodes.indexOf(keyCode);
351 if (killKeyCodeIndex !== -1) {
352 this.pressedKeys.length = 0;
354 for (var _i2 = 0; _i2 < keyNames.length; _i2 += 1) {
355 var index = this.pressedKeys.indexOf(keyNames[_i2]);
358 this.pressedKeys.splice(index, 1);
363 this.activeTargetKeys.length = 0;
370 value: function _applyMacros() {
371 var macros = this._macros.slice(0);
373 for (var i = 0; i < macros.length; i += 1) {
374 var macro = macros[i];
376 if (macro.keyCombo.check(this.pressedKeys)) {
378 macro.keyNames = macro.handler(this.pressedKeys);
381 for (var j = 0; j < macro.keyNames.length; j += 1) {
382 if (this.pressedKeys.indexOf(macro.keyNames[j]) === -1) {
383 this.pressedKeys.push(macro.keyNames[j]);
387 this._appliedMacros.push(macro);
393 value: function _clearMacros() {
394 for (var i = 0; i < this._appliedMacros.length; i += 1) {
395 var macro = this._appliedMacros[i];
397 if (!macro.keyCombo.check(this.pressedKeys)) {
398 for (var j = 0; j < macro.keyNames.length; j += 1) {
399 var index = this.pressedKeys.indexOf(macro.keyNames[j]);
402 this.pressedKeys.splice(index, 1);
407 macro.keyNames = null;
410 this._appliedMacros.splice(i, 1);
421 var Keyboard = /*#__PURE__*/function () {
422 function Keyboard(targetWindow, targetElement, targetPlatform, targetUserAgent) {
423 _classCallCheck(this, Keyboard);
426 this._currentContext = '';
428 this._listeners = [];
429 this._appliedListeners = [];
431 this._targetElement = null;
432 this._targetWindow = null;
433 this._targetPlatform = '';
434 this._targetUserAgent = '';
435 this._isModernBrowser = false;
436 this._targetKeyDownBinding = null;
437 this._targetKeyUpBinding = null;
438 this._targetResetBinding = null;
439 this._paused = false;
440 this._contexts.global = {
441 listeners: this._listeners,
442 targetWindow: targetWindow,
443 targetElement: targetElement,
444 targetPlatform: targetPlatform,
445 targetUserAgent: targetUserAgent
447 this.setContext('global');
450 _createClass(Keyboard, [{
452 value: function setLocale(localeName, localeBuilder) {
455 if (typeof localeName === 'string') {
457 locale = new Locale(localeName);
458 localeBuilder(locale, this._targetPlatform, this._targetUserAgent);
460 locale = this._locales[localeName] || null;
464 localeName = locale._localeName;
467 this._locale = locale;
468 this._locales[localeName] = locale;
471 this._locale.pressedKeys = locale.pressedKeys;
478 value: function getLocale(localName) {
479 localName || (localName = this._locale.localeName);
480 return this._locales[localName] || null;
484 value: function bind(keyComboStr, pressHandler, releaseHandler, preventRepeatByDefault) {
485 if (keyComboStr === null || typeof keyComboStr === 'function') {
486 preventRepeatByDefault = releaseHandler;
487 releaseHandler = pressHandler;
488 pressHandler = keyComboStr;
492 if (keyComboStr && _typeof(keyComboStr) === 'object' && typeof keyComboStr.length === 'number') {
493 for (var i = 0; i < keyComboStr.length; i += 1) {
494 this.bind(keyComboStr[i], pressHandler, releaseHandler);
500 this._listeners.push({
501 keyCombo: keyComboStr ? new KeyCombo(keyComboStr) : null,
502 pressHandler: pressHandler || null,
503 releaseHandler: releaseHandler || null,
504 preventRepeat: false,
505 preventRepeatByDefault: preventRepeatByDefault || false,
506 executingHandler: false
513 value: function addListener(keyComboStr, pressHandler, releaseHandler, preventRepeatByDefault) {
514 return this.bind(keyComboStr, pressHandler, releaseHandler, preventRepeatByDefault);
518 value: function on(keyComboStr, pressHandler, releaseHandler, preventRepeatByDefault) {
519 return this.bind(keyComboStr, pressHandler, releaseHandler, preventRepeatByDefault);
523 value: function bindPress(keyComboStr, pressHandler, preventRepeatByDefault) {
524 return this.bind(keyComboStr, pressHandler, null, preventRepeatByDefault);
528 value: function bindRelease(keyComboStr, releaseHandler) {
529 return this.bind(keyComboStr, null, releaseHandler, preventRepeatByDefault);
533 value: function unbind(keyComboStr, pressHandler, releaseHandler) {
534 if (keyComboStr === null || typeof keyComboStr === 'function') {
535 releaseHandler = pressHandler;
536 pressHandler = keyComboStr;
540 if (keyComboStr && _typeof(keyComboStr) === 'object' && typeof keyComboStr.length === 'number') {
541 for (var i = 0; i < keyComboStr.length; i += 1) {
542 this.unbind(keyComboStr[i], pressHandler, releaseHandler);
548 for (var _i = 0; _i < this._listeners.length; _i += 1) {
549 var listener = this._listeners[_i];
550 var comboMatches = !keyComboStr && !listener.keyCombo || listener.keyCombo && listener.keyCombo.isEqual(keyComboStr);
551 var pressHandlerMatches = !pressHandler && !releaseHandler || !pressHandler && !listener.pressHandler || pressHandler === listener.pressHandler;
552 var releaseHandlerMatches = !pressHandler && !releaseHandler || !releaseHandler && !listener.releaseHandler || releaseHandler === listener.releaseHandler;
554 if (comboMatches && pressHandlerMatches && releaseHandlerMatches) {
555 this._listeners.splice(_i, 1);
564 key: "removeListener",
565 value: function removeListener(keyComboStr, pressHandler, releaseHandler) {
566 return this.unbind(keyComboStr, pressHandler, releaseHandler);
570 value: function off(keyComboStr, pressHandler, releaseHandler) {
571 return this.unbind(keyComboStr, pressHandler, releaseHandler);
575 value: function setContext(contextName) {
577 this.releaseAllKeys();
580 if (!this._contexts[contextName]) {
581 var globalContext = this._contexts.global;
582 this._contexts[contextName] = {
584 targetWindow: globalContext.targetWindow,
585 targetElement: globalContext.targetElement,
586 targetPlatform: globalContext.targetPlatform,
587 targetUserAgent: globalContext.targetUserAgent
591 var context = this._contexts[contextName];
592 this._currentContext = contextName;
593 this._listeners = context.listeners;
595 this.watch(context.targetWindow, context.targetElement, context.targetPlatform, context.targetUserAgent);
600 value: function getContext() {
601 return this._currentContext;
605 value: function withContext(contextName, callback) {
606 var previousContextName = this.getContext();
607 this.setContext(contextName);
609 this.setContext(previousContextName);
614 value: function watch(targetWindow, targetElement, targetPlatform, targetUserAgent) {
618 var win = typeof globalThis !== 'undefined' ? globalThis : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof window !== 'undefined' ? window : {};
621 if (!win.addEventListener && !win.attachEvent) {
622 // This was added so when using things like JSDOM watch can be used to configure watch
623 // for the global namespace manually.
624 if (this._currentContext === 'global') {
628 throw new Error('Cannot find window functions addEventListener or attachEvent.');
632 } // Handle element bindings where a target window is not passed
635 if (typeof targetWindow.nodeType === 'number') {
636 targetUserAgent = targetPlatform;
637 targetPlatform = targetElement;
638 targetElement = targetWindow;
642 if (!targetWindow.addEventListener && !targetWindow.attachEvent) {
643 throw new Error('Cannot find addEventListener or attachEvent methods on targetWindow.');
646 this._isModernBrowser = !!targetWindow.addEventListener;
647 var userAgent = targetWindow.navigator && targetWindow.navigator.userAgent || '';
648 var platform = targetWindow.navigator && targetWindow.navigator.platform || '';
649 targetElement && targetElement !== null || (targetElement = targetWindow.document);
650 targetPlatform && targetPlatform !== null || (targetPlatform = platform);
651 targetUserAgent && targetUserAgent !== null || (targetUserAgent = userAgent);
653 this._targetKeyDownBinding = function (event) {
654 _this.pressKey(event.keyCode, event);
656 _this._handleCommandBug(event, platform);
659 this._targetKeyUpBinding = function (event) {
660 _this.releaseKey(event.keyCode, event);
663 this._targetResetBinding = function (event) {
664 _this.releaseAllKeys(event);
667 this._bindEvent(targetElement, 'keydown', this._targetKeyDownBinding);
669 this._bindEvent(targetElement, 'keyup', this._targetKeyUpBinding);
671 this._bindEvent(targetWindow, 'focus', this._targetResetBinding);
673 this._bindEvent(targetWindow, 'blur', this._targetResetBinding);
675 this._targetElement = targetElement;
676 this._targetWindow = targetWindow;
677 this._targetPlatform = targetPlatform;
678 this._targetUserAgent = targetUserAgent;
679 var currentContext = this._contexts[this._currentContext];
680 currentContext.targetWindow = this._targetWindow;
681 currentContext.targetElement = this._targetElement;
682 currentContext.targetPlatform = this._targetPlatform;
683 currentContext.targetUserAgent = this._targetUserAgent;
688 value: function stop() {
689 if (!this._targetElement || !this._targetWindow) {
693 this._unbindEvent(this._targetElement, 'keydown', this._targetKeyDownBinding);
695 this._unbindEvent(this._targetElement, 'keyup', this._targetKeyUpBinding);
697 this._unbindEvent(this._targetWindow, 'focus', this._targetResetBinding);
699 this._unbindEvent(this._targetWindow, 'blur', this._targetResetBinding);
701 this._targetWindow = null;
702 this._targetElement = null;
707 value: function pressKey(keyCode, event) {
713 throw new Error('Locale not set');
716 this._locale.pressKey(keyCode);
718 this._applyBindings(event);
724 value: function releaseKey(keyCode, event) {
730 throw new Error('Locale not set');
733 this._locale.releaseKey(keyCode);
735 this._clearBindings(event);
740 key: "releaseAllKeys",
741 value: function releaseAllKeys(event) {
747 throw new Error('Locale not set');
750 this._locale.pressedKeys.length = 0;
752 this._clearBindings(event);
758 value: function pause() {
764 this.releaseAllKeys();
772 value: function resume() {
773 this._paused = false;
778 value: function reset() {
779 this.releaseAllKeys();
780 this._listeners.length = 0;
785 value: function _bindEvent(targetElement, eventName, handler) {
786 return this._isModernBrowser ? targetElement.addEventListener(eventName, handler, false) : targetElement.attachEvent('on' + eventName, handler);
790 value: function _unbindEvent(targetElement, eventName, handler) {
791 return this._isModernBrowser ? targetElement.removeEventListener(eventName, handler, false) : targetElement.detachEvent('on' + eventName, handler);
794 key: "_getGroupedListeners",
795 value: function _getGroupedListeners() {
796 var listenerGroups = [];
797 var listenerGroupMap = [];
798 var listeners = this._listeners;
800 if (this._currentContext !== 'global') {
801 listeners = [].concat(_toConsumableArray(listeners), _toConsumableArray(this._contexts.global.listeners));
804 listeners.sort(function (a, b) {
805 return (b.keyCombo ? b.keyCombo.keyNames.length : 0) - (a.keyCombo ? a.keyCombo.keyNames.length : 0);
806 }).forEach(function (l) {
809 for (var i = 0; i < listenerGroupMap.length; i += 1) {
810 if (listenerGroupMap[i] === null && l.keyCombo === null || listenerGroupMap[i] !== null && listenerGroupMap[i].isEqual(l.keyCombo)) {
815 if (mapIndex === -1) {
816 mapIndex = listenerGroupMap.length;
817 listenerGroupMap.push(l.keyCombo);
820 if (!listenerGroups[mapIndex]) {
821 listenerGroups[mapIndex] = [];
824 listenerGroups[mapIndex].push(l);
826 return listenerGroups;
829 key: "_applyBindings",
830 value: function _applyBindings(event) {
833 var preventRepeat = false;
834 event || (event = {});
836 event.preventRepeat = function () {
837 preventRepeat = true;
840 event.pressedKeys = this._locale.pressedKeys.slice(0);
841 var activeTargetKeys = this._locale.activeTargetKeys;
843 var pressedKeys = this._locale.pressedKeys.slice(0);
845 var listenerGroups = this._getGroupedListeners();
847 var _loop = function _loop(i) {
848 var listeners = listenerGroups[i];
849 var keyCombo = listeners[0].keyCombo;
851 if (keyCombo === null || keyCombo.check(pressedKeys) && activeTargetKeys.some(function (k) {
852 return keyCombo.keyNames.includes(k);
854 for (var j = 0; j < listeners.length; j += 1) {
855 var listener = listeners[j];
857 if (!listener.executingHandler && listener.pressHandler && !listener.preventRepeat) {
858 listener.executingHandler = true;
859 listener.pressHandler.call(_this2, event);
860 listener.executingHandler = false;
862 if (preventRepeat || listener.preventRepeatByDefault) {
863 listener.preventRepeat = true;
864 preventRepeat = false;
868 if (_this2._appliedListeners.indexOf(listener) === -1) {
869 _this2._appliedListeners.push(listener);
874 for (var _j = 0; _j < keyCombo.keyNames.length; _j += 1) {
875 var index = pressedKeys.indexOf(keyCombo.keyNames[_j]);
878 pressedKeys.splice(index, 1);
886 for (var i = 0; i < listenerGroups.length; i += 1) {
891 key: "_clearBindings",
892 value: function _clearBindings(event) {
893 event || (event = {});
894 event.pressedKeys = this._locale.pressedKeys.slice(0);
896 for (var i = 0; i < this._appliedListeners.length; i += 1) {
897 var listener = this._appliedListeners[i];
898 var keyCombo = listener.keyCombo;
900 if (keyCombo === null || !keyCombo.check(this._locale.pressedKeys)) {
901 listener.preventRepeat = false;
903 if (keyCombo !== null || event.pressedKeys.length === 0) {
904 this._appliedListeners.splice(i, 1);
909 if (!listener.executingHandler && listener.releaseHandler) {
910 listener.executingHandler = true;
911 listener.releaseHandler.call(this, event);
912 listener.executingHandler = false;
918 key: "_handleCommandBug",
919 value: function _handleCommandBug(event, platform) {
920 // On Mac when the command key is kept pressed, keyup is not triggered for any other key.
921 // In this case force a keyup for non-modifier keys directly after the keypress.
922 var modifierKeys = ["shift", "ctrl", "alt", "capslock", "tab", "command"];
924 if (platform.match("Mac") && this._locale.pressedKeys.includes("command") && !modifierKeys.includes(this._locale.getKeyNames(event.keyCode)[0])) {
925 this._targetKeyUpBinding(event);
933 function us(locale, platform, userAgent) {
935 locale.bindKeyCode(3, ['cancel']);
936 locale.bindKeyCode(8, ['backspace']);
937 locale.bindKeyCode(9, ['tab']);
938 locale.bindKeyCode(12, ['clear']);
939 locale.bindKeyCode(13, ['enter']);
940 locale.bindKeyCode(16, ['shift']);
941 locale.bindKeyCode(17, ['ctrl']);
942 locale.bindKeyCode(18, ['alt', 'menu']);
943 locale.bindKeyCode(19, ['pause', 'break']);
944 locale.bindKeyCode(20, ['capslock']);
945 locale.bindKeyCode(27, ['escape', 'esc']);
946 locale.bindKeyCode(32, ['space', 'spacebar']);
947 locale.bindKeyCode(33, ['pageup']);
948 locale.bindKeyCode(34, ['pagedown']);
949 locale.bindKeyCode(35, ['end']);
950 locale.bindKeyCode(36, ['home']);
951 locale.bindKeyCode(37, ['left']);
952 locale.bindKeyCode(38, ['up']);
953 locale.bindKeyCode(39, ['right']);
954 locale.bindKeyCode(40, ['down']);
955 locale.bindKeyCode(41, ['select']);
956 locale.bindKeyCode(42, ['printscreen']);
957 locale.bindKeyCode(43, ['execute']);
958 locale.bindKeyCode(44, ['snapshot']);
959 locale.bindKeyCode(45, ['insert', 'ins']);
960 locale.bindKeyCode(46, ['delete', 'del']);
961 locale.bindKeyCode(47, ['help']);
962 locale.bindKeyCode(145, ['scrolllock', 'scroll']);
963 locale.bindKeyCode(188, ['comma', ',']);
964 locale.bindKeyCode(190, ['period', '.']);
965 locale.bindKeyCode(191, ['slash', 'forwardslash', '/']);
966 locale.bindKeyCode(192, ['graveaccent', '`']);
967 locale.bindKeyCode(219, ['openbracket', '[']);
968 locale.bindKeyCode(220, ['backslash', '\\']);
969 locale.bindKeyCode(221, ['closebracket', ']']);
970 locale.bindKeyCode(222, ['apostrophe', '\'']); // 0-9
972 locale.bindKeyCode(48, ['zero', '0']);
973 locale.bindKeyCode(49, ['one', '1']);
974 locale.bindKeyCode(50, ['two', '2']);
975 locale.bindKeyCode(51, ['three', '3']);
976 locale.bindKeyCode(52, ['four', '4']);
977 locale.bindKeyCode(53, ['five', '5']);
978 locale.bindKeyCode(54, ['six', '6']);
979 locale.bindKeyCode(55, ['seven', '7']);
980 locale.bindKeyCode(56, ['eight', '8']);
981 locale.bindKeyCode(57, ['nine', '9']); // numpad
983 locale.bindKeyCode(96, ['numzero', 'num0']);
984 locale.bindKeyCode(97, ['numone', 'num1']);
985 locale.bindKeyCode(98, ['numtwo', 'num2']);
986 locale.bindKeyCode(99, ['numthree', 'num3']);
987 locale.bindKeyCode(100, ['numfour', 'num4']);
988 locale.bindKeyCode(101, ['numfive', 'num5']);
989 locale.bindKeyCode(102, ['numsix', 'num6']);
990 locale.bindKeyCode(103, ['numseven', 'num7']);
991 locale.bindKeyCode(104, ['numeight', 'num8']);
992 locale.bindKeyCode(105, ['numnine', 'num9']);
993 locale.bindKeyCode(106, ['nummultiply', 'num*']);
994 locale.bindKeyCode(107, ['numadd', 'num+']);
995 locale.bindKeyCode(108, ['numenter']);
996 locale.bindKeyCode(109, ['numsubtract', 'num-']);
997 locale.bindKeyCode(110, ['numdecimal', 'num.']);
998 locale.bindKeyCode(111, ['numdivide', 'num/']);
999 locale.bindKeyCode(144, ['numlock', 'num']); // function keys
1001 locale.bindKeyCode(112, ['f1']);
1002 locale.bindKeyCode(113, ['f2']);
1003 locale.bindKeyCode(114, ['f3']);
1004 locale.bindKeyCode(115, ['f4']);
1005 locale.bindKeyCode(116, ['f5']);
1006 locale.bindKeyCode(117, ['f6']);
1007 locale.bindKeyCode(118, ['f7']);
1008 locale.bindKeyCode(119, ['f8']);
1009 locale.bindKeyCode(120, ['f9']);
1010 locale.bindKeyCode(121, ['f10']);
1011 locale.bindKeyCode(122, ['f11']);
1012 locale.bindKeyCode(123, ['f12']);
1013 locale.bindKeyCode(124, ['f13']);
1014 locale.bindKeyCode(125, ['f14']);
1015 locale.bindKeyCode(126, ['f15']);
1016 locale.bindKeyCode(127, ['f16']);
1017 locale.bindKeyCode(128, ['f17']);
1018 locale.bindKeyCode(129, ['f18']);
1019 locale.bindKeyCode(130, ['f19']);
1020 locale.bindKeyCode(131, ['f20']);
1021 locale.bindKeyCode(132, ['f21']);
1022 locale.bindKeyCode(133, ['f22']);
1023 locale.bindKeyCode(134, ['f23']);
1024 locale.bindKeyCode(135, ['f24']); // secondary key symbols
1026 locale.bindMacro('shift + `', ['tilde', '~']);
1027 locale.bindMacro('shift + 1', ['exclamation', 'exclamationpoint', '!']);
1028 locale.bindMacro('shift + 2', ['at', '@']);
1029 locale.bindMacro('shift + 3', ['number', '#']);
1030 locale.bindMacro('shift + 4', ['dollar', 'dollars', 'dollarsign', '$']);
1031 locale.bindMacro('shift + 5', ['percent', '%']);
1032 locale.bindMacro('shift + 6', ['caret', '^']);
1033 locale.bindMacro('shift + 7', ['ampersand', 'and', '&']);
1034 locale.bindMacro('shift + 8', ['asterisk', '*']);
1035 locale.bindMacro('shift + 9', ['openparen', '(']);
1036 locale.bindMacro('shift + 0', ['closeparen', ')']);
1037 locale.bindMacro('shift + -', ['underscore', '_']);
1038 locale.bindMacro('shift + =', ['plus', '+']);
1039 locale.bindMacro('shift + [', ['opencurlybrace', 'opencurlybracket', '{']);
1040 locale.bindMacro('shift + ]', ['closecurlybrace', 'closecurlybracket', '}']);
1041 locale.bindMacro('shift + \\', ['verticalbar', '|']);
1042 locale.bindMacro('shift + ;', ['colon', ':']);
1043 locale.bindMacro('shift + \'', ['quotationmark', '\'']);
1044 locale.bindMacro('shift + !,', ['openanglebracket', '<']);
1045 locale.bindMacro('shift + .', ['closeanglebracket', '>']);
1046 locale.bindMacro('shift + /', ['questionmark', '?']);
1048 if (platform.match('Mac')) {
1049 locale.bindMacro('command', ['mod', 'modifier']);
1051 locale.bindMacro('ctrl', ['mod', 'modifier']);
1055 for (var keyCode = 65; keyCode <= 90; keyCode += 1) {
1056 var keyName = String.fromCharCode(keyCode + 32);
1057 var capitalKeyName = String.fromCharCode(keyCode);
1058 locale.bindKeyCode(keyCode, keyName);
1059 locale.bindMacro('shift + ' + keyName, capitalKeyName);
1060 locale.bindMacro('capslock + ' + keyName, capitalKeyName);
1061 } // browser caveats
1064 var semicolonKeyCode = userAgent.match('Firefox') ? 59 : 186;
1065 var dashKeyCode = userAgent.match('Firefox') ? 173 : 189;
1066 var equalKeyCode = userAgent.match('Firefox') ? 61 : 187;
1067 var leftCommandKeyCode;
1068 var rightCommandKeyCode;
1070 if (platform.match('Mac') && (userAgent.match('Safari') || userAgent.match('Chrome'))) {
1071 leftCommandKeyCode = 91;
1072 rightCommandKeyCode = 93;
1073 } else if (platform.match('Mac') && userAgent.match('Opera')) {
1074 leftCommandKeyCode = 17;
1075 rightCommandKeyCode = 17;
1076 } else if (platform.match('Mac') && userAgent.match('Firefox')) {
1077 leftCommandKeyCode = 224;
1078 rightCommandKeyCode = 224;
1081 locale.bindKeyCode(semicolonKeyCode, ['semicolon', ';']);
1082 locale.bindKeyCode(dashKeyCode, ['dash', '-']);
1083 locale.bindKeyCode(equalKeyCode, ['equal', 'equalsign', '=']);
1084 locale.bindKeyCode(leftCommandKeyCode, ['command', 'windows', 'win', 'super', 'leftcommand', 'leftwindows', 'leftwin', 'leftsuper']);
1085 locale.bindKeyCode(rightCommandKeyCode, ['command', 'windows', 'win', 'super', 'rightcommand', 'rightwindows', 'rightwin', 'rightsuper']); // kill keys
1087 locale.setKillKey('command');
1090 var keyboard = new Keyboard();
1091 keyboard.setLocale('us', us);
1092 keyboard.Keyboard = Keyboard;
1093 keyboard.Locale = Locale;
1094 keyboard.KeyCombo = KeyCombo;
1099 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5Ym9hcmQuanMiLCJzb3VyY2VzIjpbIi4uL2xpYi9rZXktY29tYm8uanMiLCIuLi9saWIvbG9jYWxlLmpzIiwiLi4vbGliL2tleWJvYXJkLmpzIiwiLi4vbG9jYWxlcy91cy5qcyIsIi4uL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlxuZXhwb3J0IGNsYXNzIEtleUNvbWJvIHtcbiAgY29uc3RydWN0b3Ioa2V5Q29tYm9TdHIpIHtcbiAgICB0aGlzLnNvdXJjZVN0ciA9IGtleUNvbWJvU3RyO1xuICAgIHRoaXMuc3ViQ29tYm9zID0gS2V5Q29tYm8ucGFyc2VDb21ib1N0cihrZXlDb21ib1N0cik7XG4gICAgdGhpcy5rZXlOYW1lcyAgPSB0aGlzLnN1YkNvbWJvcy5yZWR1Y2UoKG1lbW8sIG5leHRTdWJDb21ibykgPT5cbiAgICAgIG1lbW8uY29uY2F0KG5leHRTdWJDb21ibyksIFtdKTtcbiAgfVxuXG4gIGNoZWNrKHByZXNzZWRLZXlOYW1lcykge1xuICAgIGxldCBzdGFydGluZ0tleU5hbWVJbmRleCA9IDA7XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLnN1YkNvbWJvcy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgc3RhcnRpbmdLZXlOYW1lSW5kZXggPSB0aGlzLl9jaGVja1N1YkNvbWJvKFxuICAgICAgICB0aGlzLnN1YkNvbWJvc1tpXSxcbiAgICAgICAgc3RhcnRpbmdLZXlOYW1lSW5kZXgsXG4gICAgICAgIHByZXNzZWRLZ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udFJlcGVhdCkge1xuICAgICAgICAgICAgbGlzdGVuZXIuZXhlY3V0aW5nSGFuZGxlciA9IHRydWU7XG4gICAgICAgICAgICBsaXN0ZW5lci5wcmVzc0hhbmRsZXIuY2FsbCh0aGlzLCBldmVudCk7XG4gICAgICAgICAgICBsaXN0ZW5lci5leGVjdXRpbmdIYW5kbGVyID0gZmFsc2U7XG5cbiAgICAgICAgICAgIGlmIChwcmV2ZW50UmVwZWF0IHx8IGxpc3RlbmVyLnByZXZlbnRSZXBlYXRCeURlZmF1bHQpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucHJldmVudFJlcGVhdCA9IHRydWU7XG4gICAgICAgICAgICAgIHByZXZlbnRSZXBlYXQgICAgICAgICAgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodGhpcy5fYXBwbGllZExpc3RlbmVycy5pbmRleE9mKGxpc3RlbmVyKSA9PT0gLTEpIHtcbiAgICAgICAgICAgIHRoaXMuX2FwcGxpZWRMaXN0ZW5lcnMucHVzaChsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGtleUNvbWJvKSB7XG4gICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBrZXlDb21iby5rZXlOYW1lcy5sZW5ndGg7IGogKz0gMSkge1xuICAgICAgICAgICAgY29uc3QgaW5kZXggPSBwcmVzc2VkS2V5cy5pbmRleE9mKGtleUNvbWJvLmtleU5hbWVzW2pdKTtcbiAgICAgICAgICAgIGlmIChpbmRleCAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgcHJlc3NlZEtleXMuc3BsaWNlKGluZGV4LCAxKTtcbiAgICAgICAgICAgICAgaiAtPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIF9jbGVhckJpbmRpbmdzKGV2ZW50KSB7XG4gICA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ENBQXhDO0VBQ0FyRSxFQUFBQSxNQUFNLENBQUM2RCxXQUFQLENBQW1CUyxtQkFBbkIsRUFBd0MsQ0FBQyxTQUFELEVBQVksU0FBWixFQUF1QixLQUF2QixFQUE4QixPQUE5QixFQUF1QyxjQUF2QyxFQUF1RCxjQUF2RCxFQUF1RSxVQUF2RSxFQUFtRixZQUFuRixDQUF4QyxFQTNKOEM7O0VBOEo5Q3RFLEVBQUFBLE1BQU0sQ0FBQ2pDLFVBQVAsQ0FBa0IsU0FBbEI7RUFDRDs7TUMzSkt3RyxRQUFRLEdBQUcsSUFBSS9GLFFBQUo7RUFFakIrRixRQUFRLENBQUNDLFNBQVQsQ0FBbUIsSUFBbkIsRUFBeUJaLEVBQXpCO0VBRUFXLFFBQVEsQ0FBQy9GLFFBQVQsR0FBb0JBLFFBQXBCO0VBQ0ErRixRQUFRLENBQUN2SCxNQUFULEdBQWtCQSxNQUFsQjtFQUNBdUgsUUFBUSxDQUFDL0osUUFBVCxHQUFvQkEsUUFBcEI7Ozs7Ozs7OyJ9
1104 /***/ "./node_modules/lodash/lodash.js":
1105 /*!***************************************!*\
1106 !*** ./node_modules/lodash/lodash.js ***!
1107 \***************************************/
1108 /***/ (function(module, exports, __webpack_require__) {
1110 /* module decorator */ module = __webpack_require__.nmd(module);
1111 var __WEBPACK_AMD_DEFINE_RESULT__;/**
1113 * Lodash <https://lodash.com/>
1114 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1115 * Released under MIT license <https://lodash.com/license>
1116 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1117 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1121 /** Used as a safe reference for `undefined` in pre-ES5 environments. */
1124 /** Used as the semantic version number. */
1125 var VERSION = '4.17.21';
1127 /** Used as the size to enable large array optimizations. */
1128 var LARGE_ARRAY_SIZE = 200;
1130 /** Error message constants. */
1131 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
1132 FUNC_ERROR_TEXT = 'Expected a function',
1133 INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
1135 /** Used to stand-in for `undefined` hash values. */
1136 var HASH_UNDEFINED = '__lodash_hash_undefined__';
1138 /** Used as the maximum memoize cache size. */
1139 var MAX_MEMOIZE_SIZE = 500;
1141 /** Used as the internal argument placeholder. */
1142 var PLACEHOLDER = '__lodash_placeholder__';
1144 /** Used to compose bitmasks for cloning. */
1145 var CLONE_DEEP_FLAG = 1,
1146 CLONE_FLAT_FLAG = 2,
1147 CLONE_SYMBOLS_FLAG = 4;
1149 /** Used to compose bitmasks for value comparisons. */
1150 var COMPARE_PARTIAL_FLAG = 1,
1151 COMPARE_UNORDERED_FLAG = 2;
1153 /** Used to compose bitmasks for function metadata. */
1154 var WRAP_BIND_FLAG = 1,
1155 WRAP_BIND_KEY_FLAG = 2,
1156 WRAP_CURRY_BOUND_FLAG = 4,
1157 WRAP_CURRY_FLAG = 8,
1158 WRAP_CURRY_RIGHT_FLAG = 16,
1159 WRAP_PARTIAL_FLAG = 32,
1160 WRAP_PARTIAL_RIGHT_FLAG = 64,
1161 WRAP_ARY_FLAG = 128,
1162 WRAP_REARG_FLAG = 256,
1163 WRAP_FLIP_FLAG = 512;
1165 /** Used as default options for `_.truncate`. */
1166 var DEFAULT_TRUNC_LENGTH = 30,
1167 DEFAULT_TRUNC_OMISSION = '...';
1169 /** Used to detect hot functions by number of calls within a span of milliseconds. */
1170 var HOT_COUNT = 800,
1173 /** Used to indicate the type of lazy iteratees. */
1174 var LAZY_FILTER_FLAG = 1,
1176 LAZY_WHILE_FLAG = 3;
1178 /** Used as references for various `Number` constants. */
1179 var INFINITY = 1 / 0,
1180 MAX_SAFE_INTEGER = 9007199254740991,
1181 MAX_INTEGER = 1.7976931348623157e+308,
1184 /** Used as references for the maximum length and index of an array. */
1185 var MAX_ARRAY_LENGTH = 4294967295,
1186 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
1187 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
1189 /** Used to associate wrap methods with their bit flags. */
1191 ['ary', WRAP_ARY_FLAG],
1192 ['bind', WRAP_BIND_FLAG],
1193 ['bindKey', WRAP_BIND_KEY_FLAG],
1194 ['curry', WRAP_CURRY_FLAG],
1195 ['curryRight', WRAP_CURRY_RIGHT_FLAG],
1196 ['flip', WRAP_FLIP_FLAG],
1197 ['partial', WRAP_PARTIAL_FLAG],
1198 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
1199 ['rearg', WRAP_REARG_FLAG]
1202 /** `Object#toString` result references. */
1203 var argsTag = '[object Arguments]',
1204 arrayTag = '[object Array]',
1205 asyncTag = '[object AsyncFunction]',
1206 boolTag = '[object Boolean]',
1207 dateTag = '[object Date]',
1208 domExcTag = '[object DOMException]',
1209 errorTag = '[object Error]',
1210 funcTag = '[object Function]',
1211 genTag = '[object GeneratorFunction]',
1212 mapTag = '[object Map]',
1213 numberTag = '[object Number]',
1214 nullTag = '[object Null]',
1215 objectTag = '[object Object]',
1216 promiseTag = '[object Promise]',
1217 proxyTag = '[object Proxy]',
1218 regexpTag = '[object RegExp]',
1219 setTag = '[object Set]',
1220 stringTag = '[object String]',
1221 symbolTag = '[object Symbol]',
1222 undefinedTag = '[object Undefined]',
1223 weakMapTag = '[object WeakMap]',
1224 weakSetTag = '[object WeakSet]';
1226 var arrayBufferTag = '[object ArrayBuffer]',
1227 dataViewTag = '[object DataView]',
1228 float32Tag = '[object Float32Array]',
1229 float64Tag = '[object Float64Array]',
1230 int8Tag = '[object Int8Array]',
1231 int16Tag = '[object Int16Array]',
1232 int32Tag = '[object Int32Array]',
1233 uint8Tag = '[object Uint8Array]',
1234 uint8ClampedTag = '[object Uint8ClampedArray]',
1235 uint16Tag = '[object Uint16Array]',
1236 uint32Tag = '[object Uint32Array]';
1238 /** Used to match empty string literals in compiled template source. */
1239 var reEmptyStringLeading = /\b__p \+= '';/g,
1240 reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
1241 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
1243 /** Used to match HTML entities and HTML characters. */
1244 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
1245 reUnescapedHtml = /[&<>"']/g,
1246 reHasEscapedHtml = RegExp(reEscapedHtml.source),
1247 reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
1249 /** Used to match template delimiters. */
1250 var reEscape = /<%-([\s\S]+?)%>/g,
1251 reEvaluate = /<%([\s\S]+?)%>/g,
1252 reInterpolate = /<%=([\s\S]+?)%>/g;
1254 /** Used to match property names within property paths. */
1255 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
1256 reIsPlainProp = /^\w*$/,
1257 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1260 * Used to match `RegExp`
1261 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1263 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
1264 reHasRegExpChar = RegExp(reRegExpChar.source);
1266 /** Used to match leading whitespace. */
1267 var reTrimStart = /^\s+/;
1269 /** Used to match a single whitespace character. */
1270 var reWhitespace = /\s/;
1272 /** Used to match wrap detail comments. */
1273 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
1274 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
1275 reSplitDetails = /,? & /;
1277 /** Used to match words composed of alphanumeric characters. */
1278 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
1281 * Used to validate the `validate` option in `_.template` variable.
1283 * Forbids characters which could potentially change the meaning of the function argument definition:
1284 * - "()," (modification of function parameters)
1285 * - "=" (default value)
1286 * - "[]{}" (destructuring of function parameters)
1287 * - "/" (beginning of a comment)
1290 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
1292 /** Used to match backslashes in property paths. */
1293 var reEscapeChar = /\\(\\)?/g;
1297 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
1299 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
1301 /** Used to match `RegExp` flags from their coerced string values. */
1302 var reFlags = /\w*$/;
1304 /** Used to detect bad signed hexadecimal string values. */
1305 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
1307 /** Used to detect binary string values. */
1308 var reIsBinary = /^0b[01]+$/i;
1310 /** Used to detect host constructors (Safari). */
1311 var reIsHostCtor = /^\[object .+?Constructor\]$/;
1313 /** Used to detect octal string values. */
1314 var reIsOctal = /^0o[0-7]+$/i;
1316 /** Used to detect unsigned integer values. */
1317 var reIsUint = /^(?:0|[1-9]\d*)$/;
1319 /** Used to match Latin Unicode letters (excluding mathematical operators). */
1320 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
1322 /** Used to ensure capturing order of template delimiters. */
1323 var reNoMatch = /($^)/;
1325 /** Used to match unescaped characters in compiled string literals. */
1326 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
1328 /** Used to compose unicode character classes. */
1329 var rsAstralRange = '\\ud800-\\udfff',
1330 rsComboMarksRange = '\\u0300-\\u036f',
1331 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
1332 rsComboSymbolsRange = '\\u20d0-\\u20ff',
1333 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
1334 rsDingbatRange = '\\u2700-\\u27bf',
1335 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
1336 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
1337 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
1338 rsPunctuationRange = '\\u2000-\\u206f',
1339 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
1340 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
1341 rsVarRange = '\\ufe0e\\ufe0f',
1342 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
1344 /** Used to compose unicode capture groups. */
1345 var rsApos = "['\u2019]",
1346 rsAstral = '[' + rsAstralRange + ']',
1347 rsBreak = '[' + rsBreakRange + ']',
1348 rsCombo = '[' + rsComboRange + ']',
1350 rsDingbat = '[' + rsDingbatRange + ']',
1351 rsLower = '[' + rsLowerRange + ']',
1352 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
1353 rsFitz = '\\ud83c[\\udffb-\\udfff]',
1354 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
1355 rsNonAstral = '[^' + rsAstralRange + ']',
1356 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
1357 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
1358 rsUpper = '[' + rsUpperRange + ']',
1361 /** Used to compose unicode regexes. */
1362 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
1363 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
1364 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
1365 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
1366 reOptMod = rsModifier + '?',
1367 rsOptVar = '[' + rsVarRange + ']?',
1368 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
1369 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
1370 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
1371 rsSeq = rsOptVar + reOptMod + rsOptJoin,
1372 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
1373 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
1375 /** Used to match apostrophes. */
1376 var reApos = RegExp(rsApos, 'g');
1379 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
1380 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
1382 var reComboMark = RegExp(rsCombo, 'g');
1384 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
1385 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
1387 /** Used to match complex or compound words. */
1388 var reUnicodeWord = RegExp([
1389 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
1390 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
1391 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
1392 rsUpper + '+' + rsOptContrUpper,
1399 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
1400 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
1402 /** Used to detect strings that need a more robust regexp to match words. */
1403 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
1405 /** Used to assign default `context` object properties. */
1406 var contextProps = [
1407 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
1408 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
1409 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
1410 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
1411 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
1414 /** Used to make template sourceURLs easier to identify. */
1415 var templateCounter = -1;
1417 /** Used to identify `toStringTag` values of typed arrays. */
1418 var typedArrayTags = {};
1419 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
1420 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
1421 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
1422 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
1423 typedArrayTags[uint32Tag] = true;
1424 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
1425 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
1426 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
1427 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
1428 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
1429 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
1430 typedArrayTags[setTag] = typedArrayTags[stringTag] =
1431 typedArrayTags[weakMapTag] = false;
1433 /** Used to identify `toStringTag` values supported by `_.clone`. */
1434 var cloneableTags = {};
1435 cloneableTags[argsTag] = cloneableTags[arrayTag] =
1436 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
1437 cloneableTags[boolTag] = cloneableTags[dateTag] =
1438 cloneableTags[float32Tag] = cloneableTags[float64Tag] =
1439 cloneableTags[int8Tag] = cloneableTags[int16Tag] =
1440 cloneableTags[int32Tag] = cloneableTags[mapTag] =
1441 cloneableTags[numberTag] = cloneableTags[objectTag] =
1442 cloneableTags[regexpTag] = cloneableTags[setTag] =
1443 cloneableTags[stringTag] = cloneableTags[symbolTag] =
1444 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
1445 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1446 cloneableTags[errorTag] = cloneableTags[funcTag] =
1447 cloneableTags[weakMapTag] = false;
1449 /** Used to map Latin Unicode letters to basic Latin letters. */
1450 var deburredLetters = {
1451 // Latin-1 Supplement block.
1452 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
1453 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
1454 '\xc7': 'C', '\xe7': 'c',
1455 '\xd0': 'D', '\xf0': 'd',
1456 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
1457 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
1458 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
1459 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
1460 '\xd1': 'N', '\xf1': 'n',
1461 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
1462 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
1463 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
1464 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
1465 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
1466 '\xc6': 'Ae', '\xe6': 'ae',
1467 '\xde': 'Th', '\xfe': 'th',
1469 // Latin Extended-A block.
1470 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
1471 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
1472 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
1473 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
1474 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
1475 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
1476 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
1477 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
1478 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
1479 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
1480 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
1481 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
1482 '\u0134': 'J', '\u0135': 'j',
1483 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
1484 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
1485 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
1486 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
1487 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
1488 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
1489 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
1490 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
1491 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
1492 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
1493 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
1494 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
1495 '\u0163': 't', '\u0165': 't', '\u0167': 't',
1496 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
1497 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
1498 '\u0174': 'W', '\u0175': 'w',
1499 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
1500 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
1501 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
1502 '\u0132': 'IJ', '\u0133': 'ij',
1503 '\u0152': 'Oe', '\u0153': 'oe',
1504 '\u0149': "'n", '\u017f': 's'
1507 /** Used to map characters to HTML entities. */
1516 /** Used to map HTML entities to characters. */
1517 var htmlUnescapes = {
1525 /** Used to escape characters for inclusion in compiled string literals. */
1526 var stringEscapes = {
1535 /** Built-in method references without a dependency on `root`. */
1536 var freeParseFloat = parseFloat,
1537 freeParseInt = parseInt;
1539 /** Detect free variable `global` from Node.js. */
1540 var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
1542 /** Detect free variable `self`. */
1543 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
1545 /** Used as a reference to the global object. */
1546 var root = freeGlobal || freeSelf || Function('return this')();
1548 /** Detect free variable `exports`. */
1549 var freeExports = true && exports && !exports.nodeType && exports;
1551 /** Detect free variable `module`. */
1552 var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
1554 /** Detect the popular CommonJS extension `module.exports`. */
1555 var moduleExports = freeModule && freeModule.exports === freeExports;
1557 /** Detect free variable `process` from Node.js. */
1558 var freeProcess = moduleExports && freeGlobal.process;
1560 /** Used to access faster Node.js helpers. */
1561 var nodeUtil = (function() {
1563 // Use `util.types` for Node.js 10+.
1564 var types = freeModule && freeModule.require && freeModule.require('util').types;
1570 // Legacy `process.binding('util')` for Node.js < 10.
1571 return freeProcess && freeProcess.binding && freeProcess.binding('util');
1575 /* Node.js helper references. */
1576 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
1577 nodeIsDate = nodeUtil && nodeUtil.isDate,
1578 nodeIsMap = nodeUtil && nodeUtil.isMap,
1579 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
1580 nodeIsSet = nodeUtil && nodeUtil.isSet,
1581 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1583 /*--------------------------------------------------------------------------*/
1586 * A faster alternative to `Function#apply`, this function invokes `func`
1587 * with the `this` binding of `thisArg` and the arguments of `args`.
1590 * @param {Function} func The function to invoke.
1591 * @param {*} thisArg The `this` binding of `func`.
1592 * @param {Array} args The arguments to invoke `func` with.
1593 * @returns {*} Returns the result of `func`.
1595 function apply(func, thisArg, args) {
1596 switch (args.length) {
1597 case 0: return func.call(thisArg);
1598 case 1: return func.call(thisArg, args[0]);
1599 case 2: return func.call(thisArg, args[0], args[1]);
1600 case 3: return func.call(thisArg, args[0], args[1], args[2]);
1602 return func.apply(thisArg, args);
1606 * A specialized version of `baseAggregator` for arrays.
1609 * @param {Array} [array] The array to iterate over.
1610 * @param {Function} setter The function to set `accumulator` values.
1611 * @param {Function} iteratee The iteratee to transform keys.
1612 * @param {Object} accumulator The initial aggregated object.
1613 * @returns {Function} Returns `accumulator`.
1615 function arrayAggregator(array, setter, iteratee, accumulator) {
1617 length = array == null ? 0 : array.length;
1619 while (++index < length) {
1620 var value = array[index];
1621 setter(accumulator, value, iteratee(value), array);
1627 * A specialized version of `_.forEach` for arrays without support for
1628 * iteratee shorthands.
1631 * @param {Array} [array] The array to iterate over.
1632 * @param {Function} iteratee The function invoked per iteration.
1633 * @returns {Array} Returns `array`.
1635 function arrayEach(array, iteratee) {
1637 length = array == null ? 0 : array.length;
1639 while (++index < length) {
1640 if (iteratee(array[index], index, array) === false) {
1648 * A specialized version of `_.forEachRight` for arrays without support for
1649 * iteratee shorthands.
1652 * @param {Array} [array] The array to iterate over.
1653 * @param {Function} iteratee The function invoked per iteration.
1654 * @returns {Array} Returns `array`.
1656 function arrayEachRight(array, iteratee) {
1657 var length = array == null ? 0 : array.length;
1660 if (iteratee(array[length], length, array) === false) {
1668 * A specialized version of `_.every` for arrays without support for
1669 * iteratee shorthands.
1672 * @param {Array} [array] The array to iterate over.
1673 * @param {Function} predicate The function invoked per iteration.
1674 * @returns {boolean} Returns `true` if all elements pass the predicate check,
1677 function arrayEvery(array, predicate) {
1679 length = array == null ? 0 : array.length;
1681 while (++index < length) {
1682 if (!predicate(array[index], index, array)) {
1690 * A specialized version of `_.filter` for arrays without support for
1691 * iteratee shorthands.
1694 * @param {Array} [array] The array to iterate over.
1695 * @param {Function} predicate The function invoked per iteration.
1696 * @returns {Array} Returns the new filtered array.
1698 function arrayFilter(array, predicate) {
1700 length = array == null ? 0 : array.length,
1704 while (++index < length) {
1705 var value = array[index];
1706 if (predicate(value, index, array)) {
1707 result[resIndex++] = value;
1714 * A specialized version of `_.includes` for arrays without support for
1715 * specifying an index to search from.
1718 * @param {Array} [array] The array to inspect.
1719 * @param {*} target The value to search for.
1720 * @returns {boolean} Returns `true` if `target` is found, else `false`.
1722 function arrayIncludes(array, value) {
1723 var length = array == null ? 0 : array.length;
1724 return !!length && baseIndexOf(array, value, 0) > -1;
1728 * This function is like `arrayIncludes` except that it accepts a comparator.
1731 * @param {Array} [array] The array to inspect.
1732 * @param {*} target The value to search for.
1733 * @param {Function} comparator The comparator invoked per element.
1734 * @returns {boolean} Returns `true` if `target` is found, else `false`.
1736 function arrayIncludesWith(array, value, comparator) {
1738 length = array == null ? 0 : array.length;
1740 while (++index < length) {
1741 if (comparator(value, array[index])) {
1749 * A specialized version of `_.map` for arrays without support for iteratee
1753 * @param {Array} [array] The array to iterate over.
1754 * @param {Function} iteratee The function invoked per iteration.
1755 * @returns {Array} Returns the new mapped array.
1757 function arrayMap(array, iteratee) {
1759 length = array == null ? 0 : array.length,
1760 result = Array(length);
1762 while (++index < length) {
1763 result[index] = iteratee(array[index], index, array);
1769 * Appends the elements of `values` to `array`.
1772 * @param {Array} array The array to modify.
1773 * @param {Array} values The values to append.
1774 * @returns {Array} Returns `array`.
1776 function arrayPush(array, values) {
1778 length = values.length,
1779 offset = array.length;
1781 while (++index < length) {
1782 array[offset + index] = values[index];
1788 * A specialized version of `_.reduce` for arrays without support for
1789 * iteratee shorthands.
1792 * @param {Array} [array] The array to iterate over.
1793 * @param {Function} iteratee The function invoked per iteration.
1794 * @param {*} [accumulator] The initial value.
1795 * @param {boolean} [initAccum] Specify using the first element of `array` as
1796 * the initial value.
1797 * @returns {*} Returns the accumulated value.
1799 function arrayReduce(array, iteratee, accumulator, initAccum) {
1801 length = array == null ? 0 : array.length;
1803 if (initAccum && length) {
1804 accumulator = array[++index];
1806 while (++index < length) {
1807 accumulator = iteratee(accumulator, array[index], index, array);
1813 * A specialized version of `_.reduceRight` for arrays without support for
1814 * iteratee shorthands.
1817 * @param {Array} [array] The array to iterate over.
1818 * @param {Function} iteratee The function invoked per iteration.
1819 * @param {*} [accumulator] The initial value.
1820 * @param {boolean} [initAccum] Specify using the last element of `array` as
1821 * the initial value.
1822 * @returns {*} Returns the accumulated value.
1824 function arrayReduceRight(array, iteratee, accumulator, initAccum) {
1825 var length = array == null ? 0 : array.length;
1826 if (initAccum && length) {
1827 accumulator = array[--length];
1830 accumulator = iteratee(accumulator, array[length], length, array);
1836 * A specialized version of `_.some` for arrays without support for iteratee
1840 * @param {Array} [array] The array to iterate over.
1841 * @param {Function} predicate The function invoked per iteration.
1842 * @returns {boolean} Returns `true` if any element passes the predicate check,
1845 function arraySome(array, predicate) {
1847 length = array == null ? 0 : array.length;
1849 while (++index < length) {
1850 if (predicate(array[index], index, array)) {
1858 * Gets the size of an ASCII `string`.
1861 * @param {string} string The string inspect.
1862 * @returns {number} Returns the string size.
1864 var asciiSize = baseProperty('length');
1867 * Converts an ASCII `string` to an array.
1870 * @param {string} string The string to convert.
1871 * @returns {Array} Returns the converted array.
1873 function asciiToArray(string) {
1874 return string.split('');
1878 * Splits an ASCII `string` into an array of its words.
1881 * @param {string} The string to inspect.
1882 * @returns {Array} Returns the words of `string`.
1884 function asciiWords(string) {
1885 return string.match(reAsciiWord) || [];
1889 * The base implementation of methods like `_.findKey` and `_.findLastKey`,
1890 * without support for iteratee shorthands, which iterates over `collection`
1894 * @param {Array|Object} collection The collection to inspect.
1895 * @param {Function} predicate The function invoked per iteration.
1896 * @param {Function} eachFunc The function to iterate over `collection`.
1897 * @returns {*} Returns the found element or its key, else `undefined`.
1899 function baseFindKey(collection, predicate, eachFunc) {
1901 eachFunc(collection, function(value, key, collection) {
1902 if (predicate(value, key, collection)) {
1911 * The base implementation of `_.findIndex` and `_.findLastIndex` without
1912 * support for iteratee shorthands.
1915 * @param {Array} array The array to inspect.
1916 * @param {Function} predicate The function invoked per iteration.
1917 * @param {number} fromIndex The index to search from.
1918 * @param {boolean} [fromRight] Specify iterating from right to left.
1919 * @returns {number} Returns the index of the matched value, else `-1`.
1921 function baseFindIndex(array, predicate, fromIndex, fromRight) {
1922 var length = array.length,
1923 index = fromIndex + (fromRight ? 1 : -1);
1925 while ((fromRight ? index-- : ++index < length)) {
1926 if (predicate(array[index], index, array)) {
1934 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
1937 * @param {Array} array The array to inspect.
1938 * @param {*} value The value to search for.
1939 * @param {number} fromIndex The index to search from.
1940 * @returns {number} Returns the index of the matched value, else `-1`.
1942 function baseIndexOf(array, value, fromIndex) {
1943 return value === value
1944 ? strictIndexOf(array, value, fromIndex)
1945 : baseFindIndex(array, baseIsNaN, fromIndex);
1949 * This function is like `baseIndexOf` except that it accepts a comparator.
1952 * @param {Array} array The array to inspect.
1953 * @param {*} value The value to search for.
1954 * @param {number} fromIndex The index to search from.
1955 * @param {Function} comparator The comparator invoked per element.
1956 * @returns {number} Returns the index of the matched value, else `-1`.
1958 function baseIndexOfWith(array, value, fromIndex, comparator) {
1959 var index = fromIndex - 1,
1960 length = array.length;
1962 while (++index < length) {
1963 if (comparator(array[index], value)) {
1971 * The base implementation of `_.isNaN` without support for number objects.
1974 * @param {*} value The value to check.
1975 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1977 function baseIsNaN(value) {
1978 return value !== value;
1982 * The base implementation of `_.mean` and `_.meanBy` without support for
1983 * iteratee shorthands.
1986 * @param {Array} array The array to iterate over.
1987 * @param {Function} iteratee The function invoked per iteration.
1988 * @returns {number} Returns the mean.
1990 function baseMean(array, iteratee) {
1991 var length = array == null ? 0 : array.length;
1992 return length ? (baseSum(array, iteratee) / length) : NAN;
1996 * The base implementation of `_.property` without support for deep paths.
1999 * @param {string} key The key of the property to get.
2000 * @returns {Function} Returns the new accessor function.
2002 function baseProperty(key) {
2003 return function(object) {
2004 return object == null ? undefined : object[key];
2009 * The base implementation of `_.propertyOf` without support for deep paths.
2012 * @param {Object} object The object to query.
2013 * @returns {Function} Returns the new accessor function.
2015 function basePropertyOf(object) {
2016 return function(key) {
2017 return object == null ? undefined : object[key];
2022 * The base implementation of `_.reduce` and `_.reduceRight`, without support
2023 * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
2026 * @param {Array|Object} collection The collection to iterate over.
2027 * @param {Function} iteratee The function invoked per iteration.
2028 * @param {*} accumulator The initial value.
2029 * @param {boolean} initAccum Specify using the first or last element of
2030 * `collection` as the initial value.
2031 * @param {Function} eachFunc The function to iterate over `collection`.
2032 * @returns {*} Returns the accumulated value.
2034 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
2035 eachFunc(collection, function(value, index, collection) {
2036 accumulator = initAccum
2037 ? (initAccum = false, value)
2038 : iteratee(accumulator, value, index, collection);
2044 * The base implementation of `_.sortBy` which uses `comparer` to define the
2045 * sort order of `array` and replaces criteria objects with their corresponding
2049 * @param {Array} array The array to sort.
2050 * @param {Function} comparer The function to define sort order.
2051 * @returns {Array} Returns `array`.
2053 function baseSortBy(array, comparer) {
2054 var length = array.length;
2056 array.sort(comparer);
2058 array[length] = array[length].value;
2064 * The base implementation of `_.sum` and `_.sumBy` without support for
2065 * iteratee shorthands.
2068 * @param {Array} array The array to iterate over.
2069 * @param {Function} iteratee The function invoked per iteration.
2070 * @returns {number} Returns the sum.
2072 function baseSum(array, iteratee) {
2075 length = array.length;
2077 while (++index < length) {
2078 var current = iteratee(array[index]);
2079 if (current !== undefined) {
2080 result = result === undefined ? current : (result + current);
2087 * The base implementation of `_.times` without support for iteratee shorthands
2088 * or max array length checks.
2091 * @param {number} n The number of times to invoke `iteratee`.
2092 * @param {Function} iteratee The function invoked per iteration.
2093 * @returns {Array} Returns the array of results.
2095 function baseTimes(n, iteratee) {
2099 while (++index < n) {
2100 result[index] = iteratee(index);
2106 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
2107 * of key-value pairs for `object` corresponding to the property names of `props`.
2110 * @param {Object} object The object to query.
2111 * @param {Array} props The property names to get values for.
2112 * @returns {Object} Returns the key-value pairs.
2114 function baseToPairs(object, props) {
2115 return arrayMap(props, function(key) {
2116 return [key, object[key]];
2121 * The base implementation of `_.trim`.
2124 * @param {string} string The string to trim.
2125 * @returns {string} Returns the trimmed string.
2127 function baseTrim(string) {
2129 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
2134 * The base implementation of `_.unary` without support for storing metadata.
2137 * @param {Function} func The function to cap arguments for.
2138 * @returns {Function} Returns the new capped function.
2140 function baseUnary(func) {
2141 return function(value) {
2147 * The base implementation of `_.values` and `_.valuesIn` which creates an
2148 * array of `object` property values corresponding to the property names
2152 * @param {Object} object The object to query.
2153 * @param {Array} props The property names to get values for.
2154 * @returns {Object} Returns the array of property values.
2156 function baseValues(object, props) {
2157 return arrayMap(props, function(key) {
2163 * Checks if a `cache` value for `key` exists.
2166 * @param {Object} cache The cache to query.
2167 * @param {string} key The key of the entry to check.
2168 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
2170 function cacheHas(cache, key) {
2171 return cache.has(key);
2175 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
2176 * that is not found in the character symbols.
2179 * @param {Array} strSymbols The string symbols to inspect.
2180 * @param {Array} chrSymbols The character symbols to find.
2181 * @returns {number} Returns the index of the first unmatched string symbol.
2183 function charsStartIndex(strSymbols, chrSymbols) {
2185 length = strSymbols.length;
2187 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
2192 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
2193 * that is not found in the character symbols.
2196 * @param {Array} strSymbols The string symbols to inspect.
2197 * @param {Array} chrSymbols The character symbols to find.
2198 * @returns {number} Returns the index of the last unmatched string symbol.
2200 function charsEndIndex(strSymbols, chrSymbols) {
2201 var index = strSymbols.length;
2203 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
2208 * Gets the number of `placeholder` occurrences in `array`.
2211 * @param {Array} array The array to inspect.
2212 * @param {*} placeholder The placeholder to search for.
2213 * @returns {number} Returns the placeholder count.
2215 function countHolders(array, placeholder) {
2216 var length = array.length,
2220 if (array[length] === placeholder) {
2228 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
2229 * letters to basic Latin letters.
2232 * @param {string} letter The matched letter to deburr.
2233 * @returns {string} Returns the deburred letter.
2235 var deburrLetter = basePropertyOf(deburredLetters);
2238 * Used by `_.escape` to convert characters to HTML entities.
2241 * @param {string} chr The matched character to escape.
2242 * @returns {string} Returns the escaped character.
2244 var escapeHtmlChar = basePropertyOf(htmlEscapes);
2247 * Used by `_.template` to escape characters for inclusion in compiled string literals.
2250 * @param {string} chr The matched character to escape.
2251 * @returns {string} Returns the escaped character.
2253 function escapeStringChar(chr) {
2254 return '\\' + stringEscapes[chr];
2258 * Gets the value at `key` of `object`.
2261 * @param {Object} [object] The object to query.
2262 * @param {string} key The key of the property to get.
2263 * @returns {*} Returns the property value.
2265 function getValue(object, key) {
2266 return object == null ? undefined : object[key];
2270 * Checks if `string` contains Unicode symbols.
2273 * @param {string} string The string to inspect.
2274 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
2276 function hasUnicode(string) {
2277 return reHasUnicode.test(string);
2281 * Checks if `string` contains a word composed of Unicode symbols.
2284 * @param {string} string The string to inspect.
2285 * @returns {boolean} Returns `true` if a word is found, else `false`.
2287 function hasUnicodeWord(string) {
2288 return reHasUnicodeWord.test(string);
2292 * Converts `iterator` to an array.
2295 * @param {Object} iterator The iterator to convert.
2296 * @returns {Array} Returns the converted array.
2298 function iteratorToArray(iterator) {
2302 while (!(data = iterator.next()).done) {
2303 result.push(data.value);
2309 * Converts `map` to its key-value pairs.
2312 * @param {Object} map The map to convert.
2313 * @returns {Array} Returns the key-value pairs.
2315 function mapToArray(map) {
2317 result = Array(map.size);
2319 map.forEach(function(value, key) {
2320 result[++index] = [key, value];
2326 * Creates a unary function that invokes `func` with its argument transformed.
2329 * @param {Function} func The function to wrap.
2330 * @param {Function} transform The argument transform.
2331 * @returns {Function} Returns the new function.
2333 function overArg(func, transform) {
2334 return function(arg) {
2335 return func(transform(arg));
2340 * Replaces all `placeholder` elements in `array` with an internal placeholder
2341 * and returns an array of their indexes.
2344 * @param {Array} array The array to modify.
2345 * @param {*} placeholder The placeholder to replace.
2346 * @returns {Array} Returns the new array of placeholder indexes.
2348 function replaceHolders(array, placeholder) {
2350 length = array.length,
2354 while (++index < length) {
2355 var value = array[index];
2356 if (value === placeholder || value === PLACEHOLDER) {
2357 array[index] = PLACEHOLDER;
2358 result[resIndex++] = index;
2365 * Converts `set` to an array of its values.
2368 * @param {Object} set The set to convert.
2369 * @returns {Array} Returns the values.
2371 function setToArray(set) {
2373 result = Array(set.size);
2375 set.forEach(function(value) {
2376 result[++index] = value;
2382 * Converts `set` to its value-value pairs.
2385 * @param {Object} set The set to convert.
2386 * @returns {Array} Returns the value-value pairs.
2388 function setToPairs(set) {
2390 result = Array(set.size);
2392 set.forEach(function(value) {
2393 result[++index] = [value, value];
2399 * A specialized version of `_.indexOf` which performs strict equality
2400 * comparisons of values, i.e. `===`.
2403 * @param {Array} array The array to inspect.
2404 * @param {*} value The value to search for.
2405 * @param {number} fromIndex The index to search from.
2406 * @returns {number} Returns the index of the matched value, else `-1`.
2408 function strictIndexOf(array, value, fromIndex) {
2409 var index = fromIndex - 1,
2410 length = array.length;
2412 while (++index < length) {
2413 if (array[index] === value) {
2421 * A specialized version of `_.lastIndexOf` which performs strict equality
2422 * comparisons of values, i.e. `===`.
2425 * @param {Array} array The array to inspect.
2426 * @param {*} value The value to search for.
2427 * @param {number} fromIndex The index to search from.
2428 * @returns {number} Returns the index of the matched value, else `-1`.
2430 function strictLastIndexOf(array, value, fromIndex) {
2431 var index = fromIndex + 1;
2433 if (array[index] === value) {
2441 * Gets the number of symbols in `string`.
2444 * @param {string} string The string to inspect.
2445 * @returns {number} Returns the string size.
2447 function stringSize(string) {
2448 return hasUnicode(string)
2449 ? unicodeSize(string)
2450 : asciiSize(string);
2454 * Converts `string` to an array.
2457 * @param {string} string The string to convert.
2458 * @returns {Array} Returns the converted array.
2460 function stringToArray(string) {
2461 return hasUnicode(string)
2462 ? unicodeToArray(string)
2463 : asciiToArray(string);
2467 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
2468 * character of `string`.
2471 * @param {string} string The string to inspect.
2472 * @returns {number} Returns the index of the last non-whitespace character.
2474 function trimmedEndIndex(string) {
2475 var index = string.length;
2477 while (index-- && reWhitespace.test(string.charAt(index))) {}
2482 * Used by `_.unescape` to convert HTML entities to characters.
2485 * @param {string} chr The matched character to unescape.
2486 * @returns {string} Returns the unescaped character.
2488 var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
2491 * Gets the size of a Unicode `string`.
2494 * @param {string} string The string inspect.
2495 * @returns {number} Returns the string size.
2497 function unicodeSize(string) {
2498 var result = reUnicode.lastIndex = 0;
2499 while (reUnicode.test(string)) {
2506 * Converts a Unicode `string` to an array.
2509 * @param {string} string The string to convert.
2510 * @returns {Array} Returns the converted array.
2512 function unicodeToArray(string) {
2513 return string.match(reUnicode) || [];
2517 * Splits a Unicode `string` into an array of its words.
2520 * @param {string} The string to inspect.
2521 * @returns {Array} Returns the words of `string`.
2523 function unicodeWords(string) {
2524 return string.match(reUnicodeWord) || [];
2527 /*--------------------------------------------------------------------------*/
2530 * Create a new pristine `lodash` function using the `context` object.
2536 * @param {Object} [context=root] The context object.
2537 * @returns {Function} Returns a new `lodash` function.
2540 * _.mixin({ 'foo': _.constant('foo') });
2542 * var lodash = _.runInContext();
2543 * lodash.mixin({ 'bar': lodash.constant('bar') });
2545 * _.isFunction(_.foo);
2547 * _.isFunction(_.bar);
2550 * lodash.isFunction(lodash.foo);
2552 * lodash.isFunction(lodash.bar);
2555 * // Create a suped-up `defer` in Node.js.
2556 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
2558 var runInContext = (function runInContext(context) {
2559 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
2561 /** Built-in constructor references. */
2562 var Array = context.Array,
2563 Date = context.Date,
2564 Error = context.Error,
2565 Function = context.Function,
2566 Math = context.Math,
2567 Object = context.Object,
2568 RegExp = context.RegExp,
2569 String = context.String,
2570 TypeError = context.TypeError;
2572 /** Used for built-in method references. */
2573 var arrayProto = Array.prototype,
2574 funcProto = Function.prototype,
2575 objectProto = Object.prototype;
2577 /** Used to detect overreaching core-js shims. */
2578 var coreJsData = context['__core-js_shared__'];
2580 /** Used to resolve the decompiled source of functions. */
2581 var funcToString = funcProto.toString;
2583 /** Used to check objects for own properties. */
2584 var hasOwnProperty = objectProto.hasOwnProperty;
2586 /** Used to generate unique IDs. */
2589 /** Used to detect methods masquerading as native. */
2590 var maskSrcKey = (function() {
2591 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
2592 return uid ? ('Symbol(src)_1.' + uid) : '';
2596 * Used to resolve the
2597 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2600 var nativeObjectToString = objectProto.toString;
2602 /** Used to infer the `Object` constructor. */
2603 var objectCtorString = funcToString.call(Object);
2605 /** Used to restore the original `_` reference in `_.noConflict`. */
2606 var oldDash = root._;
2608 /** Used to detect if a method is native. */
2609 var reIsNative = RegExp('^' +
2610 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
2611 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
2614 /** Built-in value references. */
2615 var Buffer = moduleExports ? context.Buffer : undefined,
2616 Symbol = context.Symbol,
2617 Uint8Array = context.Uint8Array,
2618 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
2619 getPrototype = overArg(Object.getPrototypeOf, Object),
2620 objectCreate = Object.create,
2621 propertyIsEnumerable = objectProto.propertyIsEnumerable,
2622 splice = arrayProto.splice,
2623 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
2624 symIterator = Symbol ? Symbol.iterator : undefined,
2625 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
2627 var defineProperty = (function() {
2629 var func = getNative(Object, 'defineProperty');
2635 /** Mocked built-ins. */
2636 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
2637 ctxNow = Date && Date.now !== root.Date.now && Date.now,
2638 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
2640 /* Built-in method references for those with the same name as other `lodash` methods. */
2641 var nativeCeil = Math.ceil,
2642 nativeFloor = Math.floor,
2643 nativeGetSymbols = Object.getOwnPropertySymbols,
2644 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
2645 nativeIsFinite = context.isFinite,
2646 nativeJoin = arrayProto.join,
2647 nativeKeys = overArg(Object.keys, Object),
2648 nativeMax = Math.max,
2649 nativeMin = Math.min,
2650 nativeNow = Date.now,
2651 nativeParseInt = context.parseInt,
2652 nativeRandom = Math.random,
2653 nativeReverse = arrayProto.reverse;
2655 /* Built-in method references that are verified to be native. */
2656 var DataView = getNative(context, 'DataView'),
2657 Map = getNative(context, 'Map'),
2658 Promise = getNative(context, 'Promise'),
2659 Set = getNative(context, 'Set'),
2660 WeakMap = getNative(context, 'WeakMap'),
2661 nativeCreate = getNative(Object, 'create');
2663 /** Used to store function metadata. */
2664 var metaMap = WeakMap && new WeakMap;
2666 /** Used to lookup unminified function names. */
2669 /** Used to detect maps, sets, and weakmaps. */
2670 var dataViewCtorString = toSource(DataView),
2671 mapCtorString = toSource(Map),
2672 promiseCtorString = toSource(Promise),
2673 setCtorString = toSource(Set),
2674 weakMapCtorString = toSource(WeakMap);
2676 /** Used to convert symbols to primitives and strings. */
2677 var symbolProto = Symbol ? Symbol.prototype : undefined,
2678 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
2679 symbolToString = symbolProto ? symbolProto.toString : undefined;
2681 /*------------------------------------------------------------------------*/
2684 * Creates a `lodash` object which wraps `value` to enable implicit method
2685 * chain sequences. Methods that operate on and return arrays, collections,
2686 * and functions can be chained together. Methods that retrieve a single value
2687 * or may return a primitive value will automatically end the chain sequence
2688 * and return the unwrapped value. Otherwise, the value must be unwrapped
2691 * Explicit chain sequences, which must be unwrapped with `_#value`, may be
2692 * enabled using `_.chain`.
2694 * The execution of chained methods is lazy, that is, it's deferred until
2695 * `_#value` is implicitly or explicitly called.
2697 * Lazy evaluation allows several methods to support shortcut fusion.
2698 * Shortcut fusion is an optimization to merge iteratee calls; this avoids
2699 * the creation of intermediate arrays and can greatly reduce the number of
2700 * iteratee executions. Sections of a chain sequence qualify for shortcut
2701 * fusion if the section is applied to an array and iteratees accept only
2702 * one argument. The heuristic for whether a section qualifies for shortcut
2703 * fusion is subject to change.
2705 * Chaining is supported in custom builds as long as the `_#value` method is
2706 * directly or indirectly included in the build.
2708 * In addition to lodash methods, wrappers have `Array` and `String` methods.
2710 * The wrapper `Array` methods are:
2711 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
2713 * The wrapper `String` methods are:
2714 * `replace` and `split`
2716 * The wrapper methods that support shortcut fusion are:
2717 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
2718 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
2719 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
2721 * The chainable wrapper methods are:
2722 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
2723 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
2724 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
2725 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
2726 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
2727 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
2728 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
2729 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
2730 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
2731 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
2732 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
2733 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
2734 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
2735 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
2736 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
2737 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
2738 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
2739 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
2740 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
2741 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
2742 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
2743 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
2744 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
2745 * `zipObject`, `zipObjectDeep`, and `zipWith`
2747 * The wrapper methods that are **not** chainable by default are:
2748 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
2749 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
2750 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
2751 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
2752 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
2753 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
2754 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
2755 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
2756 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
2757 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
2758 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
2759 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
2760 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
2761 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
2762 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
2763 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
2764 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
2765 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
2766 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
2767 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
2768 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
2769 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
2770 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
2771 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
2772 * `upperFirst`, `value`, and `words`
2777 * @param {*} value The value to wrap in a `lodash` instance.
2778 * @returns {Object} Returns the new `lodash` wrapper instance.
2781 * function square(n) {
2785 * var wrapped = _([1, 2, 3]);
2787 * // Returns an unwrapped value.
2788 * wrapped.reduce(_.add);
2791 * // Returns a wrapped value.
2792 * var squares = wrapped.map(square);
2794 * _.isArray(squares);
2797 * _.isArray(squares.value());
2800 function lodash(value) {
2801 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
2802 if (value instanceof LodashWrapper) {
2805 if (hasOwnProperty.call(value, '__wrapped__')) {
2806 return wrapperClone(value);
2809 return new LodashWrapper(value);
2813 * The base implementation of `_.create` without support for assigning
2814 * properties to the created object.
2817 * @param {Object} proto The object to inherit from.
2818 * @returns {Object} Returns the new object.
2820 var baseCreate = (function() {
2821 function object() {}
2822 return function(proto) {
2823 if (!isObject(proto)) {
2827 return objectCreate(proto);
2829 object.prototype = proto;
2830 var result = new object;
2831 object.prototype = undefined;
2837 * The function whose prototype chain sequence wrappers inherit from.
2841 function baseLodash() {
2842 // No operation performed.
2846 * The base constructor for creating `lodash` wrapper objects.
2849 * @param {*} value The value to wrap.
2850 * @param {boolean} [chainAll] Enable explicit method chain sequences.
2852 function LodashWrapper(value, chainAll) {
2853 this.__wrapped__ = value;
2854 this.__actions__ = [];
2855 this.__chain__ = !!chainAll;
2857 this.__values__ = undefined;
2861 * By default, the template delimiters used by lodash are like those in
2862 * embedded Ruby (ERB) as well as ES2015 template strings. Change the
2863 * following template settings to use alternative delimiters.
2869 lodash.templateSettings = {
2872 * Used to detect `data` property values to be HTML-escaped.
2874 * @memberOf _.templateSettings
2880 * Used to detect code to be evaluated.
2882 * @memberOf _.templateSettings
2885 'evaluate': reEvaluate,
2888 * Used to detect `data` property values to inject.
2890 * @memberOf _.templateSettings
2893 'interpolate': reInterpolate,
2896 * Used to reference the data object in the template text.
2898 * @memberOf _.templateSettings
2904 * Used to import variables into the compiled template.
2906 * @memberOf _.templateSettings
2912 * A reference to the `lodash` function.
2914 * @memberOf _.templateSettings.imports
2921 // Ensure wrappers are instances of `baseLodash`.
2922 lodash.prototype = baseLodash.prototype;
2923 lodash.prototype.constructor = lodash;
2925 LodashWrapper.prototype = baseCreate(baseLodash.prototype);
2926 LodashWrapper.prototype.constructor = LodashWrapper;
2928 /*------------------------------------------------------------------------*/
2931 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
2935 * @param {*} value The value to wrap.
2937 function LazyWrapper(value) {
2938 this.__wrapped__ = value;
2939 this.__actions__ = [];
2941 this.__filtered__ = false;
2942 this.__iteratees__ = [];
2943 this.__takeCount__ = MAX_ARRAY_LENGTH;
2944 this.__views__ = [];
2948 * Creates a clone of the lazy wrapper object.
2952 * @memberOf LazyWrapper
2953 * @returns {Object} Returns the cloned `LazyWrapper` object.
2955 function lazyClone() {
2956 var result = new LazyWrapper(this.__wrapped__);
2957 result.__actions__ = copyArray(this.__actions__);
2958 result.__dir__ = this.__dir__;
2959 result.__filtered__ = this.__filtered__;
2960 result.__iteratees__ = copyArray(this.__iteratees__);
2961 result.__takeCount__ = this.__takeCount__;
2962 result.__views__ = copyArray(this.__views__);
2967 * Reverses the direction of lazy iteration.
2971 * @memberOf LazyWrapper
2972 * @returns {Object} Returns the new reversed `LazyWrapper` object.
2974 function lazyReverse() {
2975 if (this.__filtered__) {
2976 var result = new LazyWrapper(this);
2977 result.__dir__ = -1;
2978 result.__filtered__ = true;
2980 result = this.clone();
2981 result.__dir__ *= -1;
2987 * Extracts the unwrapped value from its lazy wrapper.
2991 * @memberOf LazyWrapper
2992 * @returns {*} Returns the unwrapped value.
2994 function lazyValue() {
2995 var array = this.__wrapped__.value(),
2997 isArr = isArray(array),
2999 arrLength = isArr ? array.length : 0,
3000 view = getView(0, arrLength, this.__views__),
3003 length = end - start,
3004 index = isRight ? end : (start - 1),
3005 iteratees = this.__iteratees__,
3006 iterLength = iteratees.length,
3008 takeCount = nativeMin(length, this.__takeCount__);
3010 if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
3011 return baseWrapperValue(array, this.__actions__);
3016 while (length-- && resIndex < takeCount) {
3020 value = array[index];
3022 while (++iterIndex < iterLength) {
3023 var data = iteratees[iterIndex],
3024 iteratee = data.iteratee,
3026 computed = iteratee(value);
3028 if (type == LAZY_MAP_FLAG) {
3030 } else if (!computed) {
3031 if (type == LAZY_FILTER_FLAG) {
3038 result[resIndex++] = value;
3043 // Ensure `LazyWrapper` is an instance of `baseLodash`.
3044 LazyWrapper.prototype = baseCreate(baseLodash.prototype);
3045 LazyWrapper.prototype.constructor = LazyWrapper;
3047 /*------------------------------------------------------------------------*/
3050 * Creates a hash object.
3054 * @param {Array} [entries] The key-value pairs to cache.
3056 function Hash(entries) {
3058 length = entries == null ? 0 : entries.length;
3061 while (++index < length) {
3062 var entry = entries[index];
3063 this.set(entry[0], entry[1]);
3068 * Removes all key-value entries from the hash.
3074 function hashClear() {
3075 this.__data__ = nativeCreate ? nativeCreate(null) : {};
3080 * Removes `key` and its value from the hash.
3085 * @param {Object} hash The hash to modify.
3086 * @param {string} key The key of the value to remove.
3087 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3089 function hashDelete(key) {
3090 var result = this.has(key) && delete this.__data__[key];
3091 this.size -= result ? 1 : 0;
3096 * Gets the hash value for `key`.
3101 * @param {string} key The key of the value to get.
3102 * @returns {*} Returns the entry value.
3104 function hashGet(key) {
3105 var data = this.__data__;
3107 var result = data[key];
3108 return result === HASH_UNDEFINED ? undefined : result;
3110 return hasOwnProperty.call(data, key) ? data[key] : undefined;
3114 * Checks if a hash value for `key` exists.
3119 * @param {string} key The key of the entry to check.
3120 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3122 function hashHas(key) {
3123 var data = this.__data__;
3124 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
3128 * Sets the hash `key` to `value`.
3133 * @param {string} key The key of the value to set.
3134 * @param {*} value The value to set.
3135 * @returns {Object} Returns the hash instance.
3137 function hashSet(key, value) {
3138 var data = this.__data__;
3139 this.size += this.has(key) ? 0 : 1;
3140 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
3144 // Add methods to `Hash`.
3145 Hash.prototype.clear = hashClear;
3146 Hash.prototype['delete'] = hashDelete;
3147 Hash.prototype.get = hashGet;
3148 Hash.prototype.has = hashHas;
3149 Hash.prototype.set = hashSet;
3151 /*------------------------------------------------------------------------*/
3154 * Creates an list cache object.
3158 * @param {Array} [entries] The key-value pairs to cache.
3160 function ListCache(entries) {
3162 length = entries == null ? 0 : entries.length;
3165 while (++index < length) {
3166 var entry = entries[index];
3167 this.set(entry[0], entry[1]);
3172 * Removes all key-value entries from the list cache.
3176 * @memberOf ListCache
3178 function listCacheClear() {
3184 * Removes `key` and its value from the list cache.
3188 * @memberOf ListCache
3189 * @param {string} key The key of the value to remove.
3190 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3192 function listCacheDelete(key) {
3193 var data = this.__data__,
3194 index = assocIndexOf(data, key);
3199 var lastIndex = data.length - 1;
3200 if (index == lastIndex) {
3203 splice.call(data, index, 1);
3210 * Gets the list cache value for `key`.
3214 * @memberOf ListCache
3215 * @param {string} key The key of the value to get.
3216 * @returns {*} Returns the entry value.
3218 function listCacheGet(key) {
3219 var data = this.__data__,
3220 index = assocIndexOf(data, key);
3222 return index < 0 ? undefined : data[index][1];
3226 * Checks if a list cache value for `key` exists.
3230 * @memberOf ListCache
3231 * @param {string} key The key of the entry to check.
3232 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3234 function listCacheHas(key) {
3235 return assocIndexOf(this.__data__, key) > -1;
3239 * Sets the list cache `key` to `value`.
3243 * @memberOf ListCache
3244 * @param {string} key The key of the value to set.
3245 * @param {*} value The value to set.
3246 * @returns {Object} Returns the list cache instance.
3248 function listCacheSet(key, value) {
3249 var data = this.__data__,
3250 index = assocIndexOf(data, key);
3254 data.push([key, value]);
3256 data[index][1] = value;
3261 // Add methods to `ListCache`.
3262 ListCache.prototype.clear = listCacheClear;
3263 ListCache.prototype['delete'] = listCacheDelete;
3264 ListCache.prototype.get = listCacheGet;
3265 ListCache.prototype.has = listCacheHas;
3266 ListCache.prototype.set = listCacheSet;
3268 /*------------------------------------------------------------------------*/
3271 * Creates a map cache object to store key-value pairs.
3275 * @param {Array} [entries] The key-value pairs to cache.
3277 function MapCache(entries) {
3279 length = entries == null ? 0 : entries.length;
3282 while (++index < length) {
3283 var entry = entries[index];
3284 this.set(entry[0], entry[1]);
3289 * Removes all key-value entries from the map.
3293 * @memberOf MapCache
3295 function mapCacheClear() {
3299 'map': new (Map || ListCache),
3305 * Removes `key` and its value from the map.
3309 * @memberOf MapCache
3310 * @param {string} key The key of the value to remove.
3311 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3313 function mapCacheDelete(key) {
3314 var result = getMapData(this, key)['delete'](key);
3315 this.size -= result ? 1 : 0;
3320 * Gets the map value for `key`.
3324 * @memberOf MapCache
3325 * @param {string} key The key of the value to get.
3326 * @returns {*} Returns the entry value.
3328 function mapCacheGet(key) {
3329 return getMapData(this, key).get(key);
3333 * Checks if a map value for `key` exists.
3337 * @memberOf MapCache
3338 * @param {string} key The key of the entry to check.
3339 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3341 function mapCacheHas(key) {
3342 return getMapData(this, key).has(key);
3346 * Sets the map `key` to `value`.
3350 * @memberOf MapCache
3351 * @param {string} key The key of the value to set.
3352 * @param {*} value The value to set.
3353 * @returns {Object} Returns the map cache instance.
3355 function mapCacheSet(key, value) {
3356 var data = getMapData(this, key),
3359 data.set(key, value);
3360 this.size += data.size == size ? 0 : 1;
3364 // Add methods to `MapCache`.
3365 MapCache.prototype.clear = mapCacheClear;
3366 MapCache.prototype['delete'] = mapCacheDelete;
3367 MapCache.prototype.get = mapCacheGet;
3368 MapCache.prototype.has = mapCacheHas;
3369 MapCache.prototype.set = mapCacheSet;
3371 /*------------------------------------------------------------------------*/
3375 * Creates an array cache object to store unique values.
3379 * @param {Array} [values] The values to cache.
3381 function SetCache(values) {
3383 length = values == null ? 0 : values.length;
3385 this.__data__ = new MapCache;
3386 while (++index < length) {
3387 this.add(values[index]);
3392 * Adds `value` to the array cache.
3396 * @memberOf SetCache
3398 * @param {*} value The value to cache.
3399 * @returns {Object} Returns the cache instance.
3401 function setCacheAdd(value) {
3402 this.__data__.set(value, HASH_UNDEFINED);
3407 * Checks if `value` is in the array cache.
3411 * @memberOf SetCache
3412 * @param {*} value The value to search for.
3413 * @returns {number} Returns `true` if `value` is found, else `false`.
3415 function setCacheHas(value) {
3416 return this.__data__.has(value);
3419 // Add methods to `SetCache`.
3420 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
3421 SetCache.prototype.has = setCacheHas;
3423 /*------------------------------------------------------------------------*/
3426 * Creates a stack cache object to store key-value pairs.
3430 * @param {Array} [entries] The key-value pairs to cache.
3432 function Stack(entries) {
3433 var data = this.__data__ = new ListCache(entries);
3434 this.size = data.size;
3438 * Removes all key-value entries from the stack.
3444 function stackClear() {
3445 this.__data__ = new ListCache;
3450 * Removes `key` and its value from the stack.
3455 * @param {string} key The key of the value to remove.
3456 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
3458 function stackDelete(key) {
3459 var data = this.__data__,
3460 result = data['delete'](key);
3462 this.size = data.size;
3467 * Gets the stack value for `key`.
3472 * @param {string} key The key of the value to get.
3473 * @returns {*} Returns the entry value.
3475 function stackGet(key) {
3476 return this.__data__.get(key);
3480 * Checks if a stack value for `key` exists.
3485 * @param {string} key The key of the entry to check.
3486 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
3488 function stackHas(key) {
3489 return this.__data__.has(key);
3493 * Sets the stack `key` to `value`.
3498 * @param {string} key The key of the value to set.
3499 * @param {*} value The value to set.
3500 * @returns {Object} Returns the stack cache instance.
3502 function stackSet(key, value) {
3503 var data = this.__data__;
3504 if (data instanceof ListCache) {
3505 var pairs = data.__data__;
3506 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
3507 pairs.push([key, value]);
3508 this.size = ++data.size;
3511 data = this.__data__ = new MapCache(pairs);
3513 data.set(key, value);
3514 this.size = data.size;
3518 // Add methods to `Stack`.
3519 Stack.prototype.clear = stackClear;
3520 Stack.prototype['delete'] = stackDelete;
3521 Stack.prototype.get = stackGet;
3522 Stack.prototype.has = stackHas;
3523 Stack.prototype.set = stackSet;
3525 /*------------------------------------------------------------------------*/
3528 * Creates an array of the enumerable property names of the array-like `value`.
3531 * @param {*} value The value to query.
3532 * @param {boolean} inherited Specify returning inherited property names.
3533 * @returns {Array} Returns the array of property names.
3535 function arrayLikeKeys(value, inherited) {
3536 var isArr = isArray(value),
3537 isArg = !isArr && isArguments(value),
3538 isBuff = !isArr && !isArg && isBuffer(value),
3539 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
3540 skipIndexes = isArr || isArg || isBuff || isType,
3541 result = skipIndexes ? baseTimes(value.length, String) : [],
3542 length = result.length;
3544 for (var key in value) {
3545 if ((inherited || hasOwnProperty.call(value, key)) &&
3547 // Safari 9 has enumerable `arguments.length` in strict mode.
3549 // Node.js 0.10 has enumerable non-index properties on buffers.
3550 (isBuff && (key == 'offset' || key == 'parent')) ||
3551 // PhantomJS 2 has enumerable non-index properties on typed arrays.
3552 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
3553 // Skip index properties.
3554 isIndex(key, length)
3563 * A specialized version of `_.sample` for arrays.
3566 * @param {Array} array The array to sample.
3567 * @returns {*} Returns the random element.
3569 function arraySample(array) {
3570 var length = array.length;
3571 return length ? array[baseRandom(0, length - 1)] : undefined;
3575 * A specialized version of `_.sampleSize` for arrays.
3578 * @param {Array} array The array to sample.
3579 * @param {number} n The number of elements to sample.
3580 * @returns {Array} Returns the random elements.
3582 function arraySampleSize(array, n) {
3583 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
3587 * A specialized version of `_.shuffle` for arrays.
3590 * @param {Array} array The array to shuffle.
3591 * @returns {Array} Returns the new shuffled array.
3593 function arrayShuffle(array) {
3594 return shuffleSelf(copyArray(array));
3598 * This function is like `assignValue` except that it doesn't assign
3599 * `undefined` values.
3602 * @param {Object} object The object to modify.
3603 * @param {string} key The key of the property to assign.
3604 * @param {*} value The value to assign.
3606 function assignMergeValue(object, key, value) {
3607 if ((value !== undefined && !eq(object[key], value)) ||
3608 (value === undefined && !(key in object))) {
3609 baseAssignValue(object, key, value);
3614 * Assigns `value` to `key` of `object` if the existing value is not equivalent
3615 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
3616 * for equality comparisons.
3619 * @param {Object} object The object to modify.
3620 * @param {string} key The key of the property to assign.
3621 * @param {*} value The value to assign.
3623 function assignValue(object, key, value) {
3624 var objValue = object[key];
3625 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
3626 (value === undefined && !(key in object))) {
3627 baseAssignValue(object, key, value);
3632 * Gets the index at which the `key` is found in `array` of key-value pairs.
3635 * @param {Array} array The array to inspect.
3636 * @param {*} key The key to search for.
3637 * @returns {number} Returns the index of the matched value, else `-1`.
3639 function assocIndexOf(array, key) {
3640 var length = array.length;
3642 if (eq(array[length][0], key)) {
3650 * Aggregates elements of `collection` on `accumulator` with keys transformed
3651 * by `iteratee` and values set by `setter`.
3654 * @param {Array|Object} collection The collection to iterate over.
3655 * @param {Function} setter The function to set `accumulator` values.
3656 * @param {Function} iteratee The iteratee to transform keys.
3657 * @param {Object} accumulator The initial aggregated object.
3658 * @returns {Function} Returns `accumulator`.
3660 function baseAggregator(collection, setter, iteratee, accumulator) {
3661 baseEach(collection, function(value, key, collection) {
3662 setter(accumulator, value, iteratee(value), collection);
3668 * The base implementation of `_.assign` without support for multiple sources
3669 * or `customizer` functions.
3672 * @param {Object} object The destination object.
3673 * @param {Object} source The source object.
3674 * @returns {Object} Returns `object`.
3676 function baseAssign(object, source) {
3677 return object && copyObject(source, keys(source), object);
3681 * The base implementation of `_.assignIn` without support for multiple sources
3682 * or `customizer` functions.
3685 * @param {Object} object The destination object.
3686 * @param {Object} source The source object.
3687 * @returns {Object} Returns `object`.
3689 function baseAssignIn(object, source) {
3690 return object && copyObject(source, keysIn(source), object);
3694 * The base implementation of `assignValue` and `assignMergeValue` without
3698 * @param {Object} object The object to modify.
3699 * @param {string} key The key of the property to assign.
3700 * @param {*} value The value to assign.
3702 function baseAssignValue(object, key, value) {
3703 if (key == '__proto__' && defineProperty) {
3704 defineProperty(object, key, {
3705 'configurable': true,
3711 object[key] = value;
3716 * The base implementation of `_.at` without support for individual paths.
3719 * @param {Object} object The object to iterate over.
3720 * @param {string[]} paths The property paths to pick.
3721 * @returns {Array} Returns the picked elements.
3723 function baseAt(object, paths) {
3725 length = paths.length,
3726 result = Array(length),
3727 skip = object == null;
3729 while (++index < length) {
3730 result[index] = skip ? undefined : get(object, paths[index]);
3736 * The base implementation of `_.clamp` which doesn't coerce arguments.
3739 * @param {number} number The number to clamp.
3740 * @param {number} [lower] The lower bound.
3741 * @param {number} upper The upper bound.
3742 * @returns {number} Returns the clamped number.
3744 function baseClamp(number, lower, upper) {
3745 if (number === number) {
3746 if (upper !== undefined) {
3747 number = number <= upper ? number : upper;
3749 if (lower !== undefined) {
3750 number = number >= lower ? number : lower;
3757 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
3758 * traversed objects.
3761 * @param {*} value The value to clone.
3762 * @param {boolean} bitmask The bitmask flags.
3764 * 2 - Flatten inherited properties
3766 * @param {Function} [customizer] The function to customize cloning.
3767 * @param {string} [key] The key of `value`.
3768 * @param {Object} [object] The parent object of `value`.
3769 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
3770 * @returns {*} Returns the cloned value.
3772 function baseClone(value, bitmask, customizer, key, object, stack) {
3774 isDeep = bitmask & CLONE_DEEP_FLAG,
3775 isFlat = bitmask & CLONE_FLAT_FLAG,
3776 isFull = bitmask & CLONE_SYMBOLS_FLAG;
3779 result = object ? customizer(value, key, object, stack) : customizer(value);
3781 if (result !== undefined) {
3784 if (!isObject(value)) {
3787 var isArr = isArray(value);
3789 result = initCloneArray(value);
3791 return copyArray(value, result);
3794 var tag = getTag(value),
3795 isFunc = tag == funcTag || tag == genTag;
3797 if (isBuffer(value)) {
3798 return cloneBuffer(value, isDeep);
3800 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
3801 result = (isFlat || isFunc) ? {} : initCloneObject(value);
3804 ? copySymbolsIn(value, baseAssignIn(result, value))
3805 : copySymbols(value, baseAssign(result, value));
3808 if (!cloneableTags[tag]) {
3809 return object ? value : {};
3811 result = initCloneByTag(value, tag, isDeep);
3814 // Check for circular references and return its corresponding clone.
3815 stack || (stack = new Stack);
3816 var stacked = stack.get(value);
3820 stack.set(value, result);
3823 value.forEach(function(subValue) {
3824 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
3826 } else if (isMap(value)) {
3827 value.forEach(function(subValue, key) {
3828 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
3832 var keysFunc = isFull
3833 ? (isFlat ? getAllKeysIn : getAllKeys)
3834 : (isFlat ? keysIn : keys);
3836 var props = isArr ? undefined : keysFunc(value);
3837 arrayEach(props || value, function(subValue, key) {
3840 subValue = value[key];
3842 // Recursively populate clone (susceptible to call stack limits).
3843 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
3849 * The base implementation of `_.conforms` which doesn't clone `source`.
3852 * @param {Object} source The object of property predicates to conform to.
3853 * @returns {Function} Returns the new spec function.
3855 function baseConforms(source) {
3856 var props = keys(source);
3857 return function(object) {
3858 return baseConformsTo(object, source, props);
3863 * The base implementation of `_.conformsTo` which accepts `props` to check.
3866 * @param {Object} object The object to inspect.
3867 * @param {Object} source The object of property predicates to conform to.
3868 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
3870 function baseConformsTo(object, source, props) {
3871 var length = props.length;
3872 if (object == null) {
3875 object = Object(object);
3877 var key = props[length],
3878 predicate = source[key],
3879 value = object[key];
3881 if ((value === undefined && !(key in object)) || !predicate(value)) {
3889 * The base implementation of `_.delay` and `_.defer` which accepts `args`
3890 * to provide to `func`.
3893 * @param {Function} func The function to delay.
3894 * @param {number} wait The number of milliseconds to delay invocation.
3895 * @param {Array} args The arguments to provide to `func`.
3896 * @returns {number|Object} Returns the timer id or timeout object.
3898 function baseDelay(func, wait, args) {
3899 if (typeof func != 'function') {
3900 throw new TypeError(FUNC_ERROR_TEXT);
3902 return setTimeout(function() { func.apply(undefined, args); }, wait);
3906 * The base implementation of methods like `_.difference` without support
3907 * for excluding multiple arrays or iteratee shorthands.
3910 * @param {Array} array The array to inspect.
3911 * @param {Array} values The values to exclude.
3912 * @param {Function} [iteratee] The iteratee invoked per element.
3913 * @param {Function} [comparator] The comparator invoked per element.
3914 * @returns {Array} Returns the new array of filtered values.
3916 function baseDifference(array, values, iteratee, comparator) {
3918 includes = arrayIncludes,
3920 length = array.length,
3922 valuesLength = values.length;
3928 values = arrayMap(values, baseUnary(iteratee));
3931 includes = arrayIncludesWith;
3934 else if (values.length >= LARGE_ARRAY_SIZE) {
3935 includes = cacheHas;
3937 values = new SetCache(values);
3940 while (++index < length) {
3941 var value = array[index],
3942 computed = iteratee == null ? value : iteratee(value);
3944 value = (comparator || value !== 0) ? value : 0;
3945 if (isCommon && computed === computed) {
3946 var valuesIndex = valuesLength;
3947 while (valuesIndex--) {
3948 if (values[valuesIndex] === computed) {
3954 else if (!includes(values, computed, comparator)) {
3962 * The base implementation of `_.forEach` without support for iteratee shorthands.
3965 * @param {Array|Object} collection The collection to iterate over.
3966 * @param {Function} iteratee The function invoked per iteration.
3967 * @returns {Array|Object} Returns `collection`.
3969 var baseEach = createBaseEach(baseForOwn);
3972 * The base implementation of `_.forEachRight` without support for iteratee shorthands.
3975 * @param {Array|Object} collection The collection to iterate over.
3976 * @param {Function} iteratee The function invoked per iteration.
3977 * @returns {Array|Object} Returns `collection`.
3979 var baseEachRight = createBaseEach(baseForOwnRight, true);
3982 * The base implementation of `_.every` without support for iteratee shorthands.
3985 * @param {Array|Object} collection The collection to iterate over.
3986 * @param {Function} predicate The function invoked per iteration.
3987 * @returns {boolean} Returns `true` if all elements pass the predicate check,
3990 function baseEvery(collection, predicate) {
3992 baseEach(collection, function(value, index, collection) {
3993 result = !!predicate(value, index, collection);
4000 * The base implementation of methods like `_.max` and `_.min` which accepts a
4001 * `comparator` to determine the extremum value.
4004 * @param {Array} array The array to iterate over.
4005 * @param {Function} iteratee The iteratee invoked per iteration.
4006 * @param {Function} comparator The comparator used to compare values.
4007 * @returns {*} Returns the extremum value.
4009 function baseExtremum(array, iteratee, comparator) {
4011 length = array.length;
4013 while (++index < length) {
4014 var value = array[index],
4015 current = iteratee(value);
4017 if (current != null && (computed === undefined
4018 ? (current === current && !isSymbol(current))
4019 : comparator(current, computed)
4021 var computed = current,
4029 * The base implementation of `_.fill` without an iteratee call guard.
4032 * @param {Array} array The array to fill.
4033 * @param {*} value The value to fill `array` with.
4034 * @param {number} [start=0] The start position.
4035 * @param {number} [end=array.length] The end position.
4036 * @returns {Array} Returns `array`.
4038 function baseFill(array, value, start, end) {
4039 var length = array.length;
4041 start = toInteger(start);
4043 start = -start > length ? 0 : (length + start);
4045 end = (end === undefined || end > length) ? length : toInteger(end);
4049 end = start > end ? 0 : toLength(end);
4050 while (start < end) {
4051 array[start++] = value;
4057 * The base implementation of `_.filter` without support for iteratee shorthands.
4060 * @param {Array|Object} collection The collection to iterate over.
4061 * @param {Function} predicate The function invoked per iteration.
4062 * @returns {Array} Returns the new filtered array.
4064 function baseFilter(collection, predicate) {
4066 baseEach(collection, function(value, index, collection) {
4067 if (predicate(value, index, collection)) {
4075 * The base implementation of `_.flatten` with support for restricting flattening.
4078 * @param {Array} array The array to flatten.
4079 * @param {number} depth The maximum recursion depth.
4080 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
4081 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
4082 * @param {Array} [result=[]] The initial result value.
4083 * @returns {Array} Returns the new flattened array.
4085 function baseFlatten(array, depth, predicate, isStrict, result) {
4087 length = array.length;
4089 predicate || (predicate = isFlattenable);
4090 result || (result = []);
4092 while (++index < length) {
4093 var value = array[index];
4094 if (depth > 0 && predicate(value)) {
4096 // Recursively flatten arrays (susceptible to call stack limits).
4097 baseFlatten(value, depth - 1, predicate, isStrict, result);
4099 arrayPush(result, value);
4101 } else if (!isStrict) {
4102 result[result.length] = value;
4109 * The base implementation of `baseForOwn` which iterates over `object`
4110 * properties returned by `keysFunc` and invokes `iteratee` for each property.
4111 * Iteratee functions may exit iteration early by explicitly returning `false`.
4114 * @param {Object} object The object to iterate over.
4115 * @param {Function} iteratee The function invoked per iteration.
4116 * @param {Function} keysFunc The function to get the keys of `object`.
4117 * @returns {Object} Returns `object`.
4119 var baseFor = createBaseFor();
4122 * This function is like `baseFor` except that it iterates over properties
4123 * in the opposite order.
4126 * @param {Object} object The object to iterate over.
4127 * @param {Function} iteratee The function invoked per iteration.
4128 * @param {Function} keysFunc The function to get the keys of `object`.
4129 * @returns {Object} Returns `object`.
4131 var baseForRight = createBaseFor(true);
4134 * The base implementation of `_.forOwn` without support for iteratee shorthands.
4137 * @param {Object} object The object to iterate over.
4138 * @param {Function} iteratee The function invoked per iteration.
4139 * @returns {Object} Returns `object`.
4141 function baseForOwn(object, iteratee) {
4142 return object && baseFor(object, iteratee, keys);
4146 * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
4149 * @param {Object} object The object to iterate over.
4150 * @param {Function} iteratee The function invoked per iteration.
4151 * @returns {Object} Returns `object`.
4153 function baseForOwnRight(object, iteratee) {
4154 return object && baseForRight(object, iteratee, keys);
4158 * The base implementation of `_.functions` which creates an array of
4159 * `object` function property names filtered from `props`.
4162 * @param {Object} object The object to inspect.
4163 * @param {Array} props The property names to filter.
4164 * @returns {Array} Returns the function names.
4166 function baseFunctions(object, props) {
4167 return arrayFilter(props, function(key) {
4168 return isFunction(object[key]);
4173 * The base implementation of `_.get` without support for default values.
4176 * @param {Object} object The object to query.
4177 * @param {Array|string} path The path of the property to get.
4178 * @returns {*} Returns the resolved value.
4180 function baseGet(object, path) {
4181 path = castPath(path, object);
4184 length = path.length;
4186 while (object != null && index < length) {
4187 object = object[toKey(path[index++])];
4189 return (index && index == length) ? object : undefined;
4193 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
4194 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
4195 * symbols of `object`.
4198 * @param {Object} object The object to query.
4199 * @param {Function} keysFunc The function to get the keys of `object`.
4200 * @param {Function} symbolsFunc The function to get the symbols of `object`.
4201 * @returns {Array} Returns the array of property names and symbols.
4203 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
4204 var result = keysFunc(object);
4205 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
4209 * The base implementation of `getTag` without fallbacks for buggy environments.
4212 * @param {*} value The value to query.
4213 * @returns {string} Returns the `toStringTag`.
4215 function baseGetTag(value) {
4216 if (value == null) {
4217 return value === undefined ? undefinedTag : nullTag;
4219 return (symToStringTag && symToStringTag in Object(value))
4221 : objectToString(value);
4225 * The base implementation of `_.gt` which doesn't coerce arguments.
4228 * @param {*} value The value to compare.
4229 * @param {*} other The other value to compare.
4230 * @returns {boolean} Returns `true` if `value` is greater than `other`,
4233 function baseGt(value, other) {
4234 return value > other;
4238 * The base implementation of `_.has` without support for deep paths.
4241 * @param {Object} [object] The object to query.
4242 * @param {Array|string} key The key to check.
4243 * @returns {boolean} Returns `true` if `key` exists, else `false`.
4245 function baseHas(object, key) {
4246 return object != null && hasOwnProperty.call(object, key);
4250 * The base implementation of `_.hasIn` without support for deep paths.
4253 * @param {Object} [object] The object to query.
4254 * @param {Array|string} key The key to check.
4255 * @returns {boolean} Returns `true` if `key` exists, else `false`.
4257 function baseHasIn(object, key) {
4258 return object != null && key in Object(object);
4262 * The base implementation of `_.inRange` which doesn't coerce arguments.
4265 * @param {number} number The number to check.
4266 * @param {number} start The start of the range.
4267 * @param {number} end The end of the range.
4268 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
4270 function baseInRange(number, start, end) {
4271 return number >= nativeMin(start, end) && number < nativeMax(start, end);
4275 * The base implementation of methods like `_.intersection`, without support
4276 * for iteratee shorthands, that accepts an array of arrays to inspect.
4279 * @param {Array} arrays The arrays to inspect.
4280 * @param {Function} [iteratee] The iteratee invoked per element.
4281 * @param {Function} [comparator] The comparator invoked per element.
4282 * @returns {Array} Returns the new array of shared values.
4284 function baseIntersection(arrays, iteratee, comparator) {
4285 var includes = comparator ? arrayIncludesWith : arrayIncludes,
4286 length = arrays[0].length,
4287 othLength = arrays.length,
4288 othIndex = othLength,
4289 caches = Array(othLength),
4290 maxLength = Infinity,
4293 while (othIndex--) {
4294 var array = arrays[othIndex];
4295 if (othIndex && iteratee) {
4296 array = arrayMap(array, baseUnary(iteratee));
4298 maxLength = nativeMin(array.length, maxLength);
4299 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
4300 ? new SetCache(othIndex && array)
4309 while (++index < length && result.length < maxLength) {
4310 var value = array[index],
4311 computed = iteratee ? iteratee(value) : value;
4313 value = (comparator || value !== 0) ? value : 0;
4315 ? cacheHas(seen, computed)
4316 : includes(result, computed, comparator)
4318 othIndex = othLength;
4319 while (--othIndex) {
4320 var cache = caches[othIndex];
4322 ? cacheHas(cache, computed)
4323 : includes(arrays[othIndex], computed, comparator))
4329 seen.push(computed);
4338 * The base implementation of `_.invert` and `_.invertBy` which inverts
4339 * `object` with values transformed by `iteratee` and set by `setter`.
4342 * @param {Object} object The object to iterate over.
4343 * @param {Function} setter The function to set `accumulator` values.
4344 * @param {Function} iteratee The iteratee to transform values.
4345 * @param {Object} accumulator The initial inverted object.
4346 * @returns {Function} Returns `accumulator`.
4348 function baseInverter(object, setter, iteratee, accumulator) {
4349 baseForOwn(object, function(value, key, object) {
4350 setter(accumulator, iteratee(value), key, object);
4356 * The base implementation of `_.invoke` without support for individual
4360 * @param {Object} object The object to query.
4361 * @param {Array|string} path The path of the method to invoke.
4362 * @param {Array} args The arguments to invoke the method with.
4363 * @returns {*} Returns the result of the invoked method.
4365 function baseInvoke(object, path, args) {
4366 path = castPath(path, object);
4367 object = parent(object, path);
4368 var func = object == null ? object : object[toKey(last(path))];
4369 return func == null ? undefined : apply(func, object, args);
4373 * The base implementation of `_.isArguments`.
4376 * @param {*} value The value to check.
4377 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
4379 function baseIsArguments(value) {
4380 return isObjectLike(value) && baseGetTag(value) == argsTag;
4384 * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
4387 * @param {*} value The value to check.
4388 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
4390 function baseIsArrayBuffer(value) {
4391 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
4395 * The base implementation of `_.isDate` without Node.js optimizations.
4398 * @param {*} value The value to check.
4399 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
4401 function baseIsDate(value) {
4402 return isObjectLike(value) && baseGetTag(value) == dateTag;
4406 * The base implementation of `_.isEqual` which supports partial comparisons
4407 * and tracks traversed objects.
4410 * @param {*} value The value to compare.
4411 * @param {*} other The other value to compare.
4412 * @param {boolean} bitmask The bitmask flags.
4413 * 1 - Unordered comparison
4414 * 2 - Partial comparison
4415 * @param {Function} [customizer] The function to customize comparisons.
4416 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
4417 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
4419 function baseIsEqual(value, other, bitmask, customizer, stack) {
4420 if (value === other) {
4423 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
4424 return value !== value && other !== other;
4426 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
4430 * A specialized version of `baseIsEqual` for arrays and objects which performs
4431 * deep comparisons and tracks traversed objects enabling objects with circular
4432 * references to be compared.
4435 * @param {Object} object The object to compare.
4436 * @param {Object} other The other object to compare.
4437 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
4438 * @param {Function} customizer The function to customize comparisons.
4439 * @param {Function} equalFunc The function to determine equivalents of values.
4440 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
4441 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
4443 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
4444 var objIsArr = isArray(object),
4445 othIsArr = isArray(other),
4446 objTag = objIsArr ? arrayTag : getTag(object),
4447 othTag = othIsArr ? arrayTag : getTag(other);
4449 objTag = objTag == argsTag ? objectTag : objTag;
4450 othTag = othTag == argsTag ? objectTag : othTag;
4452 var objIsObj = objTag == objectTag,
4453 othIsObj = othTag == objectTag,
4454 isSameTag = objTag == othTag;
4456 if (isSameTag && isBuffer(object)) {
4457 if (!isBuffer(other)) {
4463 if (isSameTag && !objIsObj) {
4464 stack || (stack = new Stack);
4465 return (objIsArr || isTypedArray(object))
4466 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
4467 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
4469 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
4470 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
4471 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
4473 if (objIsWrapped || othIsWrapped) {
4474 var objUnwrapped = objIsWrapped ? object.value() : object,
4475 othUnwrapped = othIsWrapped ? other.value() : other;
4477 stack || (stack = new Stack);
4478 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
4484 stack || (stack = new Stack);
4485 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
4489 * The base implementation of `_.isMap` without Node.js optimizations.
4492 * @param {*} value The value to check.
4493 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
4495 function baseIsMap(value) {
4496 return isObjectLike(value) && getTag(value) == mapTag;
4500 * The base implementation of `_.isMatch` without support for iteratee shorthands.
4503 * @param {Object} object The object to inspect.
4504 * @param {Object} source The object of property values to match.
4505 * @param {Array} matchData The property names, values, and compare flags to match.
4506 * @param {Function} [customizer] The function to customize comparisons.
4507 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
4509 function baseIsMatch(object, source, matchData, customizer) {
4510 var index = matchData.length,
4512 noCustomizer = !customizer;
4514 if (object == null) {
4517 object = Object(object);
4519 var data = matchData[index];
4520 if ((noCustomizer && data[2])
4521 ? data[1] !== object[data[0]]
4522 : !(data[0] in object)
4527 while (++index < length) {
4528 data = matchData[index];
4530 objValue = object[key],
4533 if (noCustomizer && data[2]) {
4534 if (objValue === undefined && !(key in object)) {
4538 var stack = new Stack;
4540 var result = customizer(objValue, srcValue, key, object, source, stack);
4542 if (!(result === undefined
4543 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
4554 * The base implementation of `_.isNative` without bad shim checks.
4557 * @param {*} value The value to check.
4558 * @returns {boolean} Returns `true` if `value` is a native function,
4561 function baseIsNative(value) {
4562 if (!isObject(value) || isMasked(value)) {
4565 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
4566 return pattern.test(toSource(value));
4570 * The base implementation of `_.isRegExp` without Node.js optimizations.
4573 * @param {*} value The value to check.
4574 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
4576 function baseIsRegExp(value) {
4577 return isObjectLike(value) && baseGetTag(value) == regexpTag;
4581 * The base implementation of `_.isSet` without Node.js optimizations.
4584 * @param {*} value The value to check.
4585 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
4587 function baseIsSet(value) {
4588 return isObjectLike(value) && getTag(value) == setTag;
4592 * The base implementation of `_.isTypedArray` without Node.js optimizations.
4595 * @param {*} value The value to check.
4596 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
4598 function baseIsTypedArray(value) {
4599 return isObjectLike(value) &&
4600 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
4604 * The base implementation of `_.iteratee`.
4607 * @param {*} [value=_.identity] The value to convert to an iteratee.
4608 * @returns {Function} Returns the iteratee.
4610 function baseIteratee(value) {
4611 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
4612 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
4613 if (typeof value == 'function') {
4616 if (value == null) {
4619 if (typeof value == 'object') {
4620 return isArray(value)
4621 ? baseMatchesProperty(value[0], value[1])
4622 : baseMatches(value);
4624 return property(value);
4628 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
4631 * @param {Object} object The object to query.
4632 * @returns {Array} Returns the array of property names.
4634 function baseKeys(object) {
4635 if (!isPrototype(object)) {
4636 return nativeKeys(object);
4639 for (var key in Object(object)) {
4640 if (hasOwnProperty.call(object, key) && key != 'constructor') {
4648 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
4651 * @param {Object} object The object to query.
4652 * @returns {Array} Returns the array of property names.
4654 function baseKeysIn(object) {
4655 if (!isObject(object)) {
4656 return nativeKeysIn(object);
4658 var isProto = isPrototype(object),
4661 for (var key in object) {
4662 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
4670 * The base implementation of `_.lt` which doesn't coerce arguments.
4673 * @param {*} value The value to compare.
4674 * @param {*} other The other value to compare.
4675 * @returns {boolean} Returns `true` if `value` is less than `other`,
4678 function baseLt(value, other) {
4679 return value < other;
4683 * The base implementation of `_.map` without support for iteratee shorthands.
4686 * @param {Array|Object} collection The collection to iterate over.
4687 * @param {Function} iteratee The function invoked per iteration.
4688 * @returns {Array} Returns the new mapped array.
4690 function baseMap(collection, iteratee) {
4692 result = isArrayLike(collection) ? Array(collection.length) : [];
4694 baseEach(collection, function(value, key, collection) {
4695 result[++index] = iteratee(value, key, collection);
4701 * The base implementation of `_.matches` which doesn't clone `source`.
4704 * @param {Object} source The object of property values to match.
4705 * @returns {Function} Returns the new spec function.
4707 function baseMatches(source) {
4708 var matchData = getMatchData(source);
4709 if (matchData.length == 1 && matchData[0][2]) {
4710 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
4712 return function(object) {
4713 return object === source || baseIsMatch(object, source, matchData);
4718 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
4721 * @param {string} path The path of the property to get.
4722 * @param {*} srcValue The value to match.
4723 * @returns {Function} Returns the new spec function.
4725 function baseMatchesProperty(path, srcValue) {
4726 if (isKey(path) && isStrictComparable(srcValue)) {
4727 return matchesStrictComparable(toKey(path), srcValue);
4729 return function(object) {
4730 var objValue = get(object, path);
4731 return (objValue === undefined && objValue === srcValue)
4732 ? hasIn(object, path)
4733 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
4738 * The base implementation of `_.merge` without support for multiple sources.
4741 * @param {Object} object The destination object.
4742 * @param {Object} source The source object.
4743 * @param {number} srcIndex The index of `source`.
4744 * @param {Function} [customizer] The function to customize merged values.
4745 * @param {Object} [stack] Tracks traversed source values and their merged
4748 function baseMerge(object, source, srcIndex, customizer, stack) {
4749 if (object === source) {
4752 baseFor(source, function(srcValue, key) {
4753 stack || (stack = new Stack);
4754 if (isObject(srcValue)) {
4755 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
4758 var newValue = customizer
4759 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
4762 if (newValue === undefined) {
4763 newValue = srcValue;
4765 assignMergeValue(object, key, newValue);
4771 * A specialized version of `baseMerge` for arrays and objects which performs
4772 * deep merges and tracks traversed objects enabling objects with circular
4773 * references to be merged.
4776 * @param {Object} object The destination object.
4777 * @param {Object} source The source object.
4778 * @param {string} key The key of the value to merge.
4779 * @param {number} srcIndex The index of `source`.
4780 * @param {Function} mergeFunc The function to merge values.
4781 * @param {Function} [customizer] The function to customize assigned values.
4782 * @param {Object} [stack] Tracks traversed source values and their merged
4785 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
4786 var objValue = safeGet(object, key),
4787 srcValue = safeGet(source, key),
4788 stacked = stack.get(srcValue);
4791 assignMergeValue(object, key, stacked);
4794 var newValue = customizer
4795 ? customizer(objValue, srcValue, (key + ''), object, source, stack)
4798 var isCommon = newValue === undefined;
4801 var isArr = isArray(srcValue),
4802 isBuff = !isArr && isBuffer(srcValue),
4803 isTyped = !isArr && !isBuff && isTypedArray(srcValue);
4805 newValue = srcValue;
4806 if (isArr || isBuff || isTyped) {
4807 if (isArray(objValue)) {
4808 newValue = objValue;
4810 else if (isArrayLikeObject(objValue)) {
4811 newValue = copyArray(objValue);
4815 newValue = cloneBuffer(srcValue, true);
4819 newValue = cloneTypedArray(srcValue, true);
4825 else if (isPlainObject(srcValue) || isArguments(srcValue)) {
4826 newValue = objValue;
4827 if (isArguments(objValue)) {
4828 newValue = toPlainObject(objValue);
4830 else if (!isObject(objValue) || isFunction(objValue)) {
4831 newValue = initCloneObject(srcValue);
4839 // Recursively merge objects and arrays (susceptible to call stack limits).
4840 stack.set(srcValue, newValue);
4841 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
4842 stack['delete'](srcValue);
4844 assignMergeValue(object, key, newValue);
4848 * The base implementation of `_.nth` which doesn't coerce arguments.
4851 * @param {Array} array The array to query.
4852 * @param {number} n The index of the element to return.
4853 * @returns {*} Returns the nth element of `array`.
4855 function baseNth(array, n) {
4856 var length = array.length;
4860 n += n < 0 ? length : 0;
4861 return isIndex(n, length) ? array[n] : undefined;
4865 * The base implementation of `_.orderBy` without param guards.
4868 * @param {Array|Object} collection The collection to iterate over.
4869 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
4870 * @param {string[]} orders The sort orders of `iteratees`.
4871 * @returns {Array} Returns the new sorted array.
4873 function baseOrderBy(collection, iteratees, orders) {
4874 if (iteratees.length) {
4875 iteratees = arrayMap(iteratees, function(iteratee) {
4876 if (isArray(iteratee)) {
4877 return function(value) {
4878 return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
4884 iteratees = [identity];
4888 iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
4890 var result = baseMap(collection, function(value, key, collection) {
4891 var criteria = arrayMap(iteratees, function(iteratee) {
4892 return iteratee(value);
4894 return { 'criteria': criteria, 'index': ++index, 'value': value };
4897 return baseSortBy(result, function(object, other) {
4898 return compareMultiple(object, other, orders);
4903 * The base implementation of `_.pick` without support for individual
4904 * property identifiers.
4907 * @param {Object} object The source object.
4908 * @param {string[]} paths The property paths to pick.
4909 * @returns {Object} Returns the new object.
4911 function basePick(object, paths) {
4912 return basePickBy(object, paths, function(value, path) {
4913 return hasIn(object, path);
4918 * The base implementation of `_.pickBy` without support for iteratee shorthands.
4921 * @param {Object} object The source object.
4922 * @param {string[]} paths The property paths to pick.
4923 * @param {Function} predicate The function invoked per property.
4924 * @returns {Object} Returns the new object.
4926 function basePickBy(object, paths, predicate) {
4928 length = paths.length,
4931 while (++index < length) {
4932 var path = paths[index],
4933 value = baseGet(object, path);
4935 if (predicate(value, path)) {
4936 baseSet(result, castPath(path, object), value);
4943 * A specialized version of `baseProperty` which supports deep paths.
4946 * @param {Array|string} path The path of the property to get.
4947 * @returns {Function} Returns the new accessor function.
4949 function basePropertyDeep(path) {
4950 return function(object) {
4951 return baseGet(object, path);
4956 * The base implementation of `_.pullAllBy` without support for iteratee
4960 * @param {Array} array The array to modify.
4961 * @param {Array} values The values to remove.
4962 * @param {Function} [iteratee] The iteratee invoked per element.
4963 * @param {Function} [comparator] The comparator invoked per element.
4964 * @returns {Array} Returns `array`.
4966 function basePullAll(array, values, iteratee, comparator) {
4967 var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
4969 length = values.length,
4972 if (array === values) {
4973 values = copyArray(values);
4976 seen = arrayMap(array, baseUnary(iteratee));
4978 while (++index < length) {
4980 value = values[index],
4981 computed = iteratee ? iteratee(value) : value;
4983 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
4984 if (seen !== array) {
4985 splice.call(seen, fromIndex, 1);
4987 splice.call(array, fromIndex, 1);
4994 * The base implementation of `_.pullAt` without support for individual
4995 * indexes or capturing the removed elements.
4998 * @param {Array} array The array to modify.
4999 * @param {number[]} indexes The indexes of elements to remove.
5000 * @returns {Array} Returns `array`.
5002 function basePullAt(array, indexes) {
5003 var length = array ? indexes.length : 0,
5004 lastIndex = length - 1;
5007 var index = indexes[length];
5008 if (length == lastIndex || index !== previous) {
5009 var previous = index;
5010 if (isIndex(index)) {
5011 splice.call(array, index, 1);
5013 baseUnset(array, index);
5021 * The base implementation of `_.random` without support for returning
5022 * floating-point numbers.
5025 * @param {number} lower The lower bound.
5026 * @param {number} upper The upper bound.
5027 * @returns {number} Returns the random number.
5029 function baseRandom(lower, upper) {
5030 return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
5034 * The base implementation of `_.range` and `_.rangeRight` which doesn't
5038 * @param {number} start The start of the range.
5039 * @param {number} end The end of the range.
5040 * @param {number} step The value to increment or decrement by.
5041 * @param {boolean} [fromRight] Specify iterating from right to left.
5042 * @returns {Array} Returns the range of numbers.
5044 function baseRange(start, end, step, fromRight) {
5046 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
5047 result = Array(length);
5050 result[fromRight ? length : ++index] = start;
5057 * The base implementation of `_.repeat` which doesn't coerce arguments.
5060 * @param {string} string The string to repeat.
5061 * @param {number} n The number of times to repeat the string.
5062 * @returns {string} Returns the repeated string.
5064 function baseRepeat(string, n) {
5066 if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
5069 // Leverage the exponentiation by squaring algorithm for a faster repeat.
5070 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
5075 n = nativeFloor(n / 2);
5085 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
5088 * @param {Function} func The function to apply a rest parameter to.
5089 * @param {number} [start=func.length-1] The start position of the rest parameter.
5090 * @returns {Function} Returns the new function.
5092 function baseRest(func, start) {
5093 return setToString(overRest(func, start, identity), func + '');
5097 * The base implementation of `_.sample`.
5100 * @param {Array|Object} collection The collection to sample.
5101 * @returns {*} Returns the random element.
5103 function baseSample(collection) {
5104 return arraySample(values(collection));
5108 * The base implementation of `_.sampleSize` without param guards.
5111 * @param {Array|Object} collection The collection to sample.
5112 * @param {number} n The number of elements to sample.
5113 * @returns {Array} Returns the random elements.
5115 function baseSampleSize(collection, n) {
5116 var array = values(collection);
5117 return shuffleSelf(array, baseClamp(n, 0, array.length));
5121 * The base implementation of `_.set`.
5124 * @param {Object} object The object to modify.
5125 * @param {Array|string} path The path of the property to set.
5126 * @param {*} value The value to set.
5127 * @param {Function} [customizer] The function to customize path creation.
5128 * @returns {Object} Returns `object`.
5130 function baseSet(object, path, value, customizer) {
5131 if (!isObject(object)) {
5134 path = castPath(path, object);
5137 length = path.length,
5138 lastIndex = length - 1,
5141 while (nested != null && ++index < length) {
5142 var key = toKey(path[index]),
5145 if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
5149 if (index != lastIndex) {
5150 var objValue = nested[key];
5151 newValue = customizer ? customizer(objValue, key, nested) : undefined;
5152 if (newValue === undefined) {
5153 newValue = isObject(objValue)
5155 : (isIndex(path[index + 1]) ? [] : {});
5158 assignValue(nested, key, newValue);
5159 nested = nested[key];
5165 * The base implementation of `setData` without support for hot loop shorting.
5168 * @param {Function} func The function to associate metadata with.
5169 * @param {*} data The metadata.
5170 * @returns {Function} Returns `func`.
5172 var baseSetData = !metaMap ? identity : function(func, data) {
5173 metaMap.set(func, data);
5178 * The base implementation of `setToString` without support for hot loop shorting.
5181 * @param {Function} func The function to modify.
5182 * @param {Function} string The `toString` result.
5183 * @returns {Function} Returns `func`.
5185 var baseSetToString = !defineProperty ? identity : function(func, string) {
5186 return defineProperty(func, 'toString', {
5187 'configurable': true,
5188 'enumerable': false,
5189 'value': constant(string),
5195 * The base implementation of `_.shuffle`.
5198 * @param {Array|Object} collection The collection to shuffle.
5199 * @returns {Array} Returns the new shuffled array.
5201 function baseShuffle(collection) {
5202 return shuffleSelf(values(collection));
5206 * The base implementation of `_.slice` without an iteratee call guard.
5209 * @param {Array} array The array to slice.
5210 * @param {number} [start=0] The start position.
5211 * @param {number} [end=array.length] The end position.
5212 * @returns {Array} Returns the slice of `array`.
5214 function baseSlice(array, start, end) {
5216 length = array.length;
5219 start = -start > length ? 0 : (length + start);
5221 end = end > length ? length : end;
5225 length = start > end ? 0 : ((end - start) >>> 0);
5228 var result = Array(length);
5229 while (++index < length) {
5230 result[index] = array[index + start];
5236 * The base implementation of `_.some` without support for iteratee shorthands.
5239 * @param {Array|Object} collection The collection to iterate over.
5240 * @param {Function} predicate The function invoked per iteration.
5241 * @returns {boolean} Returns `true` if any element passes the predicate check,
5244 function baseSome(collection, predicate) {
5247 baseEach(collection, function(value, index, collection) {
5248 result = predicate(value, index, collection);
5255 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
5256 * performs a binary search of `array` to determine the index at which `value`
5257 * should be inserted into `array` in order to maintain its sort order.
5260 * @param {Array} array The sorted array to inspect.
5261 * @param {*} value The value to evaluate.
5262 * @param {boolean} [retHighest] Specify returning the highest qualified index.
5263 * @returns {number} Returns the index at which `value` should be inserted
5266 function baseSortedIndex(array, value, retHighest) {
5268 high = array == null ? low : array.length;
5270 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
5271 while (low < high) {
5272 var mid = (low + high) >>> 1,
5273 computed = array[mid];
5275 if (computed !== null && !isSymbol(computed) &&
5276 (retHighest ? (computed <= value) : (computed < value))) {
5284 return baseSortedIndexBy(array, value, identity, retHighest);
5288 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
5289 * which invokes `iteratee` for `value` and each element of `array` to compute
5290 * their sort ranking. The iteratee is invoked with one argument; (value).
5293 * @param {Array} array The sorted array to inspect.
5294 * @param {*} value The value to evaluate.
5295 * @param {Function} iteratee The iteratee invoked per element.
5296 * @param {boolean} [retHighest] Specify returning the highest qualified index.
5297 * @returns {number} Returns the index at which `value` should be inserted
5300 function baseSortedIndexBy(array, value, iteratee, retHighest) {
5302 high = array == null ? 0 : array.length;
5307 value = iteratee(value);
5308 var valIsNaN = value !== value,
5309 valIsNull = value === null,
5310 valIsSymbol = isSymbol(value),
5311 valIsUndefined = value === undefined;
5313 while (low < high) {
5314 var mid = nativeFloor((low + high) / 2),
5315 computed = iteratee(array[mid]),
5316 othIsDefined = computed !== undefined,
5317 othIsNull = computed === null,
5318 othIsReflexive = computed === computed,
5319 othIsSymbol = isSymbol(computed);
5322 var setLow = retHighest || othIsReflexive;
5323 } else if (valIsUndefined) {
5324 setLow = othIsReflexive && (retHighest || othIsDefined);
5325 } else if (valIsNull) {
5326 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
5327 } else if (valIsSymbol) {
5328 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
5329 } else if (othIsNull || othIsSymbol) {
5332 setLow = retHighest ? (computed <= value) : (computed < value);
5340 return nativeMin(high, MAX_ARRAY_INDEX);
5344 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
5345 * support for iteratee shorthands.
5348 * @param {Array} array The array to inspect.
5349 * @param {Function} [iteratee] The iteratee invoked per element.
5350 * @returns {Array} Returns the new duplicate free array.
5352 function baseSortedUniq(array, iteratee) {
5354 length = array.length,
5358 while (++index < length) {
5359 var value = array[index],
5360 computed = iteratee ? iteratee(value) : value;
5362 if (!index || !eq(computed, seen)) {
5363 var seen = computed;
5364 result[resIndex++] = value === 0 ? 0 : value;
5371 * The base implementation of `_.toNumber` which doesn't ensure correct
5372 * conversions of binary, hexadecimal, or octal string values.
5375 * @param {*} value The value to process.
5376 * @returns {number} Returns the number.
5378 function baseToNumber(value) {
5379 if (typeof value == 'number') {
5382 if (isSymbol(value)) {
5389 * The base implementation of `_.toString` which doesn't convert nullish
5390 * values to empty strings.
5393 * @param {*} value The value to process.
5394 * @returns {string} Returns the string.
5396 function baseToString(value) {
5397 // Exit early for strings to avoid a performance hit in some environments.
5398 if (typeof value == 'string') {
5401 if (isArray(value)) {
5402 // Recursively convert values (susceptible to call stack limits).
5403 return arrayMap(value, baseToString) + '';
5405 if (isSymbol(value)) {
5406 return symbolToString ? symbolToString.call(value) : '';
5408 var result = (value + '');
5409 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
5413 * The base implementation of `_.uniqBy` without support for iteratee shorthands.
5416 * @param {Array} array The array to inspect.
5417 * @param {Function} [iteratee] The iteratee invoked per element.
5418 * @param {Function} [comparator] The comparator invoked per element.
5419 * @returns {Array} Returns the new duplicate free array.
5421 function baseUniq(array, iteratee, comparator) {
5423 includes = arrayIncludes,
5424 length = array.length,
5431 includes = arrayIncludesWith;
5433 else if (length >= LARGE_ARRAY_SIZE) {
5434 var set = iteratee ? null : createSet(array);
5436 return setToArray(set);
5439 includes = cacheHas;
5440 seen = new SetCache;
5443 seen = iteratee ? [] : result;
5446 while (++index < length) {
5447 var value = array[index],
5448 computed = iteratee ? iteratee(value) : value;
5450 value = (comparator || value !== 0) ? value : 0;
5451 if (isCommon && computed === computed) {
5452 var seenIndex = seen.length;
5453 while (seenIndex--) {
5454 if (seen[seenIndex] === computed) {
5459 seen.push(computed);
5463 else if (!includes(seen, computed, comparator)) {
5464 if (seen !== result) {
5465 seen.push(computed);
5474 * The base implementation of `_.unset`.
5477 * @param {Object} object The object to modify.
5478 * @param {Array|string} path The property path to unset.
5479 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
5481 function baseUnset(object, path) {
5482 path = castPath(path, object);
5483 object = parent(object, path);
5484 return object == null || delete object[toKey(last(path))];
5488 * The base implementation of `_.update`.
5491 * @param {Object} object The object to modify.
5492 * @param {Array|string} path The path of the property to update.
5493 * @param {Function} updater The function to produce the updated value.
5494 * @param {Function} [customizer] The function to customize path creation.
5495 * @returns {Object} Returns `object`.
5497 function baseUpdate(object, path, updater, customizer) {
5498 return baseSet(object, path, updater(baseGet(object, path)), customizer);
5502 * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
5503 * without support for iteratee shorthands.
5506 * @param {Array} array The array to query.
5507 * @param {Function} predicate The function invoked per iteration.
5508 * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
5509 * @param {boolean} [fromRight] Specify iterating from right to left.
5510 * @returns {Array} Returns the slice of `array`.
5512 function baseWhile(array, predicate, isDrop, fromRight) {
5513 var length = array.length,
5514 index = fromRight ? length : -1;
5516 while ((fromRight ? index-- : ++index < length) &&
5517 predicate(array[index], index, array)) {}
5520 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
5521 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
5525 * The base implementation of `wrapperValue` which returns the result of
5526 * performing a sequence of actions on the unwrapped `value`, where each
5527 * successive action is supplied the return value of the previous.
5530 * @param {*} value The unwrapped value.
5531 * @param {Array} actions Actions to perform to resolve the unwrapped value.
5532 * @returns {*} Returns the resolved value.
5534 function baseWrapperValue(value, actions) {
5536 if (result instanceof LazyWrapper) {
5537 result = result.value();
5539 return arrayReduce(actions, function(result, action) {
5540 return action.func.apply(action.thisArg, arrayPush([result], action.args));
5545 * The base implementation of methods like `_.xor`, without support for
5546 * iteratee shorthands, that accepts an array of arrays to inspect.
5549 * @param {Array} arrays The arrays to inspect.
5550 * @param {Function} [iteratee] The iteratee invoked per element.
5551 * @param {Function} [comparator] The comparator invoked per element.
5552 * @returns {Array} Returns the new array of values.
5554 function baseXor(arrays, iteratee, comparator) {
5555 var length = arrays.length;
5557 return length ? baseUniq(arrays[0]) : [];
5560 result = Array(length);
5562 while (++index < length) {
5563 var array = arrays[index],
5566 while (++othIndex < length) {
5567 if (othIndex != index) {
5568 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
5572 return baseUniq(baseFlatten(result, 1), iteratee, comparator);
5576 * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
5579 * @param {Array} props The property identifiers.
5580 * @param {Array} values The property values.
5581 * @param {Function} assignFunc The function to assign values.
5582 * @returns {Object} Returns the new object.
5584 function baseZipObject(props, values, assignFunc) {
5586 length = props.length,
5587 valsLength = values.length,
5590 while (++index < length) {
5591 var value = index < valsLength ? values[index] : undefined;
5592 assignFunc(result, props[index], value);
5598 * Casts `value` to an empty array if it's not an array like object.
5601 * @param {*} value The value to inspect.
5602 * @returns {Array|Object} Returns the cast array-like object.
5604 function castArrayLikeObject(value) {
5605 return isArrayLikeObject(value) ? value : [];
5609 * Casts `value` to `identity` if it's not a function.
5612 * @param {*} value The value to inspect.
5613 * @returns {Function} Returns cast function.
5615 function castFunction(value) {
5616 return typeof value == 'function' ? value : identity;
5620 * Casts `value` to a path array if it's not one.
5623 * @param {*} value The value to inspect.
5624 * @param {Object} [object] The object to query keys on.
5625 * @returns {Array} Returns the cast property path array.
5627 function castPath(value, object) {
5628 if (isArray(value)) {
5631 return isKey(value, object) ? [value] : stringToPath(toString(value));
5635 * A `baseRest` alias which can be replaced with `identity` by module
5636 * replacement plugins.
5640 * @param {Function} func The function to apply a rest parameter to.
5641 * @returns {Function} Returns the new function.
5643 var castRest = baseRest;
5646 * Casts `array` to a slice if it's needed.
5649 * @param {Array} array The array to inspect.
5650 * @param {number} start The start position.
5651 * @param {number} [end=array.length] The end position.
5652 * @returns {Array} Returns the cast slice.
5654 function castSlice(array, start, end) {
5655 var length = array.length;
5656 end = end === undefined ? length : end;
5657 return (!start && end >= length) ? array : baseSlice(array, start, end);
5661 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
5664 * @param {number|Object} id The timer id or timeout object of the timer to clear.
5666 var clearTimeout = ctxClearTimeout || function(id) {
5667 return root.clearTimeout(id);
5671 * Creates a clone of `buffer`.
5674 * @param {Buffer} buffer The buffer to clone.
5675 * @param {boolean} [isDeep] Specify a deep clone.
5676 * @returns {Buffer} Returns the cloned buffer.
5678 function cloneBuffer(buffer, isDeep) {
5680 return buffer.slice();
5682 var length = buffer.length,
5683 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
5685 buffer.copy(result);
5690 * Creates a clone of `arrayBuffer`.
5693 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
5694 * @returns {ArrayBuffer} Returns the cloned array buffer.
5696 function cloneArrayBuffer(arrayBuffer) {
5697 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
5698 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
5703 * Creates a clone of `dataView`.
5706 * @param {Object} dataView The data view to clone.
5707 * @param {boolean} [isDeep] Specify a deep clone.
5708 * @returns {Object} Returns the cloned data view.
5710 function cloneDataView(dataView, isDeep) {
5711 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
5712 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
5716 * Creates a clone of `regexp`.
5719 * @param {Object} regexp The regexp to clone.
5720 * @returns {Object} Returns the cloned regexp.
5722 function cloneRegExp(regexp) {
5723 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
5724 result.lastIndex = regexp.lastIndex;
5729 * Creates a clone of the `symbol` object.
5732 * @param {Object} symbol The symbol object to clone.
5733 * @returns {Object} Returns the cloned symbol object.
5735 function cloneSymbol(symbol) {
5736 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
5740 * Creates a clone of `typedArray`.
5743 * @param {Object} typedArray The typed array to clone.
5744 * @param {boolean} [isDeep] Specify a deep clone.
5745 * @returns {Object} Returns the cloned typed array.
5747 function cloneTypedArray(typedArray, isDeep) {
5748 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
5749 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
5753 * Compares values to sort them in ascending order.
5756 * @param {*} value The value to compare.
5757 * @param {*} other The other value to compare.
5758 * @returns {number} Returns the sort order indicator for `value`.
5760 function compareAscending(value, other) {
5761 if (value !== other) {
5762 var valIsDefined = value !== undefined,
5763 valIsNull = value === null,
5764 valIsReflexive = value === value,
5765 valIsSymbol = isSymbol(value);
5767 var othIsDefined = other !== undefined,
5768 othIsNull = other === null,
5769 othIsReflexive = other === other,
5770 othIsSymbol = isSymbol(other);
5772 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
5773 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
5774 (valIsNull && othIsDefined && othIsReflexive) ||
5775 (!valIsDefined && othIsReflexive) ||
5779 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
5780 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
5781 (othIsNull && valIsDefined && valIsReflexive) ||
5782 (!othIsDefined && valIsReflexive) ||
5791 * Used by `_.orderBy` to compare multiple properties of a value to another
5792 * and stable sort them.
5794 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
5795 * specify an order of "desc" for descending or "asc" for ascending sort order
5796 * of corresponding values.
5799 * @param {Object} object The object to compare.
5800 * @param {Object} other The other object to compare.
5801 * @param {boolean[]|string[]} orders The order to sort by for each property.
5802 * @returns {number} Returns the sort order indicator for `object`.
5804 function compareMultiple(object, other, orders) {
5806 objCriteria = object.criteria,
5807 othCriteria = other.criteria,
5808 length = objCriteria.length,
5809 ordersLength = orders.length;
5811 while (++index < length) {
5812 var result = compareAscending(objCriteria[index], othCriteria[index]);
5814 if (index >= ordersLength) {
5817 var order = orders[index];
5818 return result * (order == 'desc' ? -1 : 1);
5821 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
5822 // that causes it, under certain circumstances, to provide the same value for
5823 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
5824 // for more details.
5826 // This also ensures a stable sort in V8 and other engines.
5827 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
5828 return object.index - other.index;
5832 * Creates an array that is the composition of partially applied arguments,
5833 * placeholders, and provided arguments into a single array of arguments.
5836 * @param {Array} args The provided arguments.
5837 * @param {Array} partials The arguments to prepend to those provided.
5838 * @param {Array} holders The `partials` placeholder indexes.
5839 * @params {boolean} [isCurried] Specify composing for a curried function.
5840 * @returns {Array} Returns the new array of composed arguments.
5842 function composeArgs(args, partials, holders, isCurried) {
5844 argsLength = args.length,
5845 holdersLength = holders.length,
5847 leftLength = partials.length,
5848 rangeLength = nativeMax(argsLength - holdersLength, 0),
5849 result = Array(leftLength + rangeLength),
5850 isUncurried = !isCurried;
5852 while (++leftIndex < leftLength) {
5853 result[leftIndex] = partials[leftIndex];
5855 while (++argsIndex < holdersLength) {
5856 if (isUncurried || argsIndex < argsLength) {
5857 result[holders[argsIndex]] = args[argsIndex];
5860 while (rangeLength--) {
5861 result[leftIndex++] = args[argsIndex++];
5867 * This function is like `composeArgs` except that the arguments composition
5868 * is tailored for `_.partialRight`.
5871 * @param {Array} args The provided arguments.
5872 * @param {Array} partials The arguments to append to those provided.
5873 * @param {Array} holders The `partials` placeholder indexes.
5874 * @params {boolean} [isCurried] Specify composing for a curried function.
5875 * @returns {Array} Returns the new array of composed arguments.
5877 function composeArgsRight(args, partials, holders, isCurried) {
5879 argsLength = args.length,
5881 holdersLength = holders.length,
5883 rightLength = partials.length,
5884 rangeLength = nativeMax(argsLength - holdersLength, 0),
5885 result = Array(rangeLength + rightLength),
5886 isUncurried = !isCurried;
5888 while (++argsIndex < rangeLength) {
5889 result[argsIndex] = args[argsIndex];
5891 var offset = argsIndex;
5892 while (++rightIndex < rightLength) {
5893 result[offset + rightIndex] = partials[rightIndex];
5895 while (++holdersIndex < holdersLength) {
5896 if (isUncurried || argsIndex < argsLength) {
5897 result[offset + holders[holdersIndex]] = args[argsIndex++];
5904 * Copies the values of `source` to `array`.
5907 * @param {Array} source The array to copy values from.
5908 * @param {Array} [array=[]] The array to copy values to.
5909 * @returns {Array} Returns `array`.
5911 function copyArray(source, array) {
5913 length = source.length;
5915 array || (array = Array(length));
5916 while (++index < length) {
5917 array[index] = source[index];
5923 * Copies properties of `source` to `object`.
5926 * @param {Object} source The object to copy properties from.
5927 * @param {Array} props The property identifiers to copy.
5928 * @param {Object} [object={}] The object to copy properties to.
5929 * @param {Function} [customizer] The function to customize copied values.
5930 * @returns {Object} Returns `object`.
5932 function copyObject(source, props, object, customizer) {
5933 var isNew = !object;
5934 object || (object = {});
5937 length = props.length;
5939 while (++index < length) {
5940 var key = props[index];
5942 var newValue = customizer
5943 ? customizer(object[key], source[key], key, object, source)
5946 if (newValue === undefined) {
5947 newValue = source[key];
5950 baseAssignValue(object, key, newValue);
5952 assignValue(object, key, newValue);
5959 * Copies own symbols of `source` to `object`.
5962 * @param {Object} source The object to copy symbols from.
5963 * @param {Object} [object={}] The object to copy symbols to.
5964 * @returns {Object} Returns `object`.
5966 function copySymbols(source, object) {
5967 return copyObject(source, getSymbols(source), object);
5971 * Copies own and inherited symbols of `source` to `object`.
5974 * @param {Object} source The object to copy symbols from.
5975 * @param {Object} [object={}] The object to copy symbols to.
5976 * @returns {Object} Returns `object`.
5978 function copySymbolsIn(source, object) {
5979 return copyObject(source, getSymbolsIn(source), object);
5983 * Creates a function like `_.groupBy`.
5986 * @param {Function} setter The function to set accumulator values.
5987 * @param {Function} [initializer] The accumulator object initializer.
5988 * @returns {Function} Returns the new aggregator function.
5990 function createAggregator(setter, initializer) {
5991 return function(collection, iteratee) {
5992 var func = isArray(collection) ? arrayAggregator : baseAggregator,
5993 accumulator = initializer ? initializer() : {};
5995 return func(collection, setter, getIteratee(iteratee, 2), accumulator);
6000 * Creates a function like `_.assign`.
6003 * @param {Function} assigner The function to assign values.
6004 * @returns {Function} Returns the new assigner function.
6006 function createAssigner(assigner) {
6007 return baseRest(function(object, sources) {
6009 length = sources.length,
6010 customizer = length > 1 ? sources[length - 1] : undefined,
6011 guard = length > 2 ? sources[2] : undefined;
6013 customizer = (assigner.length > 3 && typeof customizer == 'function')
6014 ? (length--, customizer)
6017 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
6018 customizer = length < 3 ? undefined : customizer;
6021 object = Object(object);
6022 while (++index < length) {
6023 var source = sources[index];
6025 assigner(object, source, index, customizer);
6033 * Creates a `baseEach` or `baseEachRight` function.
6036 * @param {Function} eachFunc The function to iterate over a collection.
6037 * @param {boolean} [fromRight] Specify iterating from right to left.
6038 * @returns {Function} Returns the new base function.
6040 function createBaseEach(eachFunc, fromRight) {
6041 return function(collection, iteratee) {
6042 if (collection == null) {
6045 if (!isArrayLike(collection)) {
6046 return eachFunc(collection, iteratee);
6048 var length = collection.length,
6049 index = fromRight ? length : -1,
6050 iterable = Object(collection);
6052 while ((fromRight ? index-- : ++index < length)) {
6053 if (iteratee(iterable[index], index, iterable) === false) {
6062 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
6065 * @param {boolean} [fromRight] Specify iterating from right to left.
6066 * @returns {Function} Returns the new base function.
6068 function createBaseFor(fromRight) {
6069 return function(object, iteratee, keysFunc) {
6071 iterable = Object(object),
6072 props = keysFunc(object),
6073 length = props.length;
6076 var key = props[fromRight ? length : ++index];
6077 if (iteratee(iterable[key], key, iterable) === false) {
6086 * Creates a function that wraps `func` to invoke it with the optional `this`
6087 * binding of `thisArg`.
6090 * @param {Function} func The function to wrap.
6091 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
6092 * @param {*} [thisArg] The `this` binding of `func`.
6093 * @returns {Function} Returns the new wrapped function.
6095 function createBind(func, bitmask, thisArg) {
6096 var isBind = bitmask & WRAP_BIND_FLAG,
6097 Ctor = createCtor(func);
6099 function wrapper() {
6100 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
6101 return fn.apply(isBind ? thisArg : this, arguments);
6107 * Creates a function like `_.lowerFirst`.
6110 * @param {string} methodName The name of the `String` case method to use.
6111 * @returns {Function} Returns the new case function.
6113 function createCaseFirst(methodName) {
6114 return function(string) {
6115 string = toString(string);
6117 var strSymbols = hasUnicode(string)
6118 ? stringToArray(string)
6121 var chr = strSymbols
6125 var trailing = strSymbols
6126 ? castSlice(strSymbols, 1).join('')
6129 return chr[methodName]() + trailing;
6134 * Creates a function like `_.camelCase`.
6137 * @param {Function} callback The function to combine each word.
6138 * @returns {Function} Returns the new compounder function.
6140 function createCompounder(callback) {
6141 return function(string) {
6142 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
6147 * Creates a function that produces an instance of `Ctor` regardless of
6148 * whether it was invoked as part of a `new` expression or by `call` or `apply`.
6151 * @param {Function} Ctor The constructor to wrap.
6152 * @returns {Function} Returns the new wrapped function.
6154 function createCtor(Ctor) {
6156 // Use a `switch` statement to work with class constructors. See
6157 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
6158 // for more details.
6159 var args = arguments;
6160 switch (args.length) {
6161 case 0: return new Ctor;
6162 case 1: return new Ctor(args[0]);
6163 case 2: return new Ctor(args[0], args[1]);
6164 case 3: return new Ctor(args[0], args[1], args[2]);
6165 case 4: return new Ctor(args[0], args[1], args[2], args[3]);
6166 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
6167 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
6168 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
6170 var thisBinding = baseCreate(Ctor.prototype),
6171 result = Ctor.apply(thisBinding, args);
6173 // Mimic the constructor's `return` behavior.
6174 // See https://es5.github.io/#x13.2.2 for more details.
6175 return isObject(result) ? result : thisBinding;
6180 * Creates a function that wraps `func` to enable currying.
6183 * @param {Function} func The function to wrap.
6184 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
6185 * @param {number} arity The arity of `func`.
6186 * @returns {Function} Returns the new wrapped function.
6188 function createCurry(func, bitmask, arity) {
6189 var Ctor = createCtor(func);
6191 function wrapper() {
6192 var length = arguments.length,
6193 args = Array(length),
6195 placeholder = getHolder(wrapper);
6198 args[index] = arguments[index];
6200 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
6202 : replaceHolders(args, placeholder);
6204 length -= holders.length;
6205 if (length < arity) {
6206 return createRecurry(
6207 func, bitmask, createHybrid, wrapper.placeholder, undefined,
6208 args, holders, undefined, undefined, arity - length);
6210 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
6211 return apply(fn, this, args);
6217 * Creates a `_.find` or `_.findLast` function.
6220 * @param {Function} findIndexFunc The function to find the collection index.
6221 * @returns {Function} Returns the new find function.
6223 function createFind(findIndexFunc) {
6224 return function(collection, predicate, fromIndex) {
6225 var iterable = Object(collection);
6226 if (!isArrayLike(collection)) {
6227 var iteratee = getIteratee(predicate, 3);
6228 collection = keys(collection);
6229 predicate = function(key) { return iteratee(iterable[key], key, iterable); };
6231 var index = findIndexFunc(collection, predicate, fromIndex);
6232 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
6237 * Creates a `_.flow` or `_.flowRight` function.
6240 * @param {boolean} [fromRight] Specify iterating from right to left.
6241 * @returns {Function} Returns the new flow function.
6243 function createFlow(fromRight) {
6244 return flatRest(function(funcs) {
6245 var length = funcs.length,
6247 prereq = LodashWrapper.prototype.thru;
6253 var func = funcs[index];
6254 if (typeof func != 'function') {
6255 throw new TypeError(FUNC_ERROR_TEXT);
6257 if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
6258 var wrapper = new LodashWrapper([], true);
6261 index = wrapper ? index : length;
6262 while (++index < length) {
6263 func = funcs[index];
6265 var funcName = getFuncName(func),
6266 data = funcName == 'wrapper' ? getData(func) : undefined;
6268 if (data && isLaziable(data[0]) &&
6269 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
6270 !data[4].length && data[9] == 1
6272 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
6274 wrapper = (func.length == 1 && isLaziable(func))
6275 ? wrapper[funcName]()
6276 : wrapper.thru(func);
6280 var args = arguments,
6283 if (wrapper && args.length == 1 && isArray(value)) {
6284 return wrapper.plant(value).value();
6287 result = length ? funcs[index].apply(this, args) : value;
6289 while (++index < length) {
6290 result = funcs[index].call(this, result);
6298 * Creates a function that wraps `func` to invoke it with optional `this`
6299 * binding of `thisArg`, partial application, and currying.
6302 * @param {Function|string} func The function or method name to wrap.
6303 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
6304 * @param {*} [thisArg] The `this` binding of `func`.
6305 * @param {Array} [partials] The arguments to prepend to those provided to
6307 * @param {Array} [holders] The `partials` placeholder indexes.
6308 * @param {Array} [partialsRight] The arguments to append to those provided
6309 * to the new function.
6310 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
6311 * @param {Array} [argPos] The argument positions of the new function.
6312 * @param {number} [ary] The arity cap of `func`.
6313 * @param {number} [arity] The arity of `func`.
6314 * @returns {Function} Returns the new wrapped function.
6316 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
6317 var isAry = bitmask & WRAP_ARY_FLAG,
6318 isBind = bitmask & WRAP_BIND_FLAG,
6319 isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
6320 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
6321 isFlip = bitmask & WRAP_FLIP_FLAG,
6322 Ctor = isBindKey ? undefined : createCtor(func);
6324 function wrapper() {
6325 var length = arguments.length,
6326 args = Array(length),
6330 args[index] = arguments[index];
6333 var placeholder = getHolder(wrapper),
6334 holdersCount = countHolders(args, placeholder);
6337 args = composeArgs(args, partials, holders, isCurried);
6339 if (partialsRight) {
6340 args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
6342 length -= holdersCount;
6343 if (isCurried && length < arity) {
6344 var newHolders = replaceHolders(args, placeholder);
6345 return createRecurry(
6346 func, bitmask, createHybrid, wrapper.placeholder, thisArg,
6347 args, newHolders, argPos, ary, arity - length
6350 var thisBinding = isBind ? thisArg : this,
6351 fn = isBindKey ? thisBinding[func] : func;
6353 length = args.length;
6355 args = reorder(args, argPos);
6356 } else if (isFlip && length > 1) {
6359 if (isAry && ary < length) {
6362 if (this && this !== root && this instanceof wrapper) {
6363 fn = Ctor || createCtor(fn);
6365 return fn.apply(thisBinding, args);
6371 * Creates a function like `_.invertBy`.
6374 * @param {Function} setter The function to set accumulator values.
6375 * @param {Function} toIteratee The function to resolve iteratees.
6376 * @returns {Function} Returns the new inverter function.
6378 function createInverter(setter, toIteratee) {
6379 return function(object, iteratee) {
6380 return baseInverter(object, setter, toIteratee(iteratee), {});
6385 * Creates a function that performs a mathematical operation on two values.
6388 * @param {Function} operator The function to perform the operation.
6389 * @param {number} [defaultValue] The value used for `undefined` arguments.
6390 * @returns {Function} Returns the new mathematical operation function.
6392 function createMathOperation(operator, defaultValue) {
6393 return function(value, other) {
6395 if (value === undefined && other === undefined) {
6396 return defaultValue;
6398 if (value !== undefined) {
6401 if (other !== undefined) {
6402 if (result === undefined) {
6405 if (typeof value == 'string' || typeof other == 'string') {
6406 value = baseToString(value);
6407 other = baseToString(other);
6409 value = baseToNumber(value);
6410 other = baseToNumber(other);
6412 result = operator(value, other);
6419 * Creates a function like `_.over`.
6422 * @param {Function} arrayFunc The function to iterate over iteratees.
6423 * @returns {Function} Returns the new over function.
6425 function createOver(arrayFunc) {
6426 return flatRest(function(iteratees) {
6427 iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
6428 return baseRest(function(args) {
6430 return arrayFunc(iteratees, function(iteratee) {
6431 return apply(iteratee, thisArg, args);
6438 * Creates the padding for `string` based on `length`. The `chars` string
6439 * is truncated if the number of characters exceeds `length`.
6442 * @param {number} length The padding length.
6443 * @param {string} [chars=' '] The string used as padding.
6444 * @returns {string} Returns the padding for `string`.
6446 function createPadding(length, chars) {
6447 chars = chars === undefined ? ' ' : baseToString(chars);
6449 var charsLength = chars.length;
6450 if (charsLength < 2) {
6451 return charsLength ? baseRepeat(chars, length) : chars;
6453 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
6454 return hasUnicode(chars)
6455 ? castSlice(stringToArray(result), 0, length).join('')
6456 : result.slice(0, length);
6460 * Creates a function that wraps `func` to invoke it with the `this` binding
6461 * of `thisArg` and `partials` prepended to the arguments it receives.
6464 * @param {Function} func The function to wrap.
6465 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
6466 * @param {*} thisArg The `this` binding of `func`.
6467 * @param {Array} partials The arguments to prepend to those provided to
6469 * @returns {Function} Returns the new wrapped function.
6471 function createPartial(func, bitmask, thisArg, partials) {
6472 var isBind = bitmask & WRAP_BIND_FLAG,
6473 Ctor = createCtor(func);
6475 function wrapper() {
6477 argsLength = arguments.length,
6479 leftLength = partials.length,
6480 args = Array(leftLength + argsLength),
6481 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
6483 while (++leftIndex < leftLength) {
6484 args[leftIndex] = partials[leftIndex];
6486 while (argsLength--) {
6487 args[leftIndex++] = arguments[++argsIndex];
6489 return apply(fn, isBind ? thisArg : this, args);
6495 * Creates a `_.range` or `_.rangeRight` function.
6498 * @param {boolean} [fromRight] Specify iterating from right to left.
6499 * @returns {Function} Returns the new range function.
6501 function createRange(fromRight) {
6502 return function(start, end, step) {
6503 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
6504 end = step = undefined;
6506 // Ensure the sign of `-0` is preserved.
6507 start = toFinite(start);
6508 if (end === undefined) {
6512 end = toFinite(end);
6514 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
6515 return baseRange(start, end, step, fromRight);
6520 * Creates a function that performs a relational operation on two values.
6523 * @param {Function} operator The function to perform the operation.
6524 * @returns {Function} Returns the new relational operation function.
6526 function createRelationalOperation(operator) {
6527 return function(value, other) {
6528 if (!(typeof value == 'string' && typeof other == 'string')) {
6529 value = toNumber(value);
6530 other = toNumber(other);
6532 return operator(value, other);
6537 * Creates a function that wraps `func` to continue currying.
6540 * @param {Function} func The function to wrap.
6541 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
6542 * @param {Function} wrapFunc The function to create the `func` wrapper.
6543 * @param {*} placeholder The placeholder value.
6544 * @param {*} [thisArg] The `this` binding of `func`.
6545 * @param {Array} [partials] The arguments to prepend to those provided to
6547 * @param {Array} [holders] The `partials` placeholder indexes.
6548 * @param {Array} [argPos] The argument positions of the new function.
6549 * @param {number} [ary] The arity cap of `func`.
6550 * @param {number} [arity] The arity of `func`.
6551 * @returns {Function} Returns the new wrapped function.
6553 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
6554 var isCurry = bitmask & WRAP_CURRY_FLAG,
6555 newHolders = isCurry ? holders : undefined,
6556 newHoldersRight = isCurry ? undefined : holders,
6557 newPartials = isCurry ? partials : undefined,
6558 newPartialsRight = isCurry ? undefined : partials;
6560 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
6561 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
6563 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
6564 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
6567 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
6568 newHoldersRight, argPos, ary, arity
6571 var result = wrapFunc.apply(undefined, newData);
6572 if (isLaziable(func)) {
6573 setData(result, newData);
6575 result.placeholder = placeholder;
6576 return setWrapToString(result, func, bitmask);
6580 * Creates a function like `_.round`.
6583 * @param {string} methodName The name of the `Math` method to use when rounding.
6584 * @returns {Function} Returns the new round function.
6586 function createRound(methodName) {
6587 var func = Math[methodName];
6588 return function(number, precision) {
6589 number = toNumber(number);
6590 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
6591 if (precision && nativeIsFinite(number)) {
6592 // Shift with exponential notation to avoid floating-point issues.
6593 // See [MDN](https://mdn.io/round#Examples) for more details.
6594 var pair = (toString(number) + 'e').split('e'),
6595 value = func(pair[0] + 'e' + (+pair[1] + precision));
6597 pair = (toString(value) + 'e').split('e');
6598 return +(pair[0] + 'e' + (+pair[1] - precision));
6600 return func(number);
6605 * Creates a set object of `values`.
6608 * @param {Array} values The values to add to the set.
6609 * @returns {Object} Returns the new set.
6611 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
6612 return new Set(values);
6616 * Creates a `_.toPairs` or `_.toPairsIn` function.
6619 * @param {Function} keysFunc The function to get the keys of a given object.
6620 * @returns {Function} Returns the new pairs function.
6622 function createToPairs(keysFunc) {
6623 return function(object) {
6624 var tag = getTag(object);
6625 if (tag == mapTag) {
6626 return mapToArray(object);
6628 if (tag == setTag) {
6629 return setToPairs(object);
6631 return baseToPairs(object, keysFunc(object));
6636 * Creates a function that either curries or invokes `func` with optional
6637 * `this` binding and partially applied arguments.
6640 * @param {Function|string} func The function or method name to wrap.
6641 * @param {number} bitmask The bitmask flags.
6644 * 4 - `_.curry` or `_.curryRight` of a bound function
6646 * 16 - `_.curryRight`
6648 * 64 - `_.partialRight`
6652 * @param {*} [thisArg] The `this` binding of `func`.
6653 * @param {Array} [partials] The arguments to be partially applied.
6654 * @param {Array} [holders] The `partials` placeholder indexes.
6655 * @param {Array} [argPos] The argument positions of the new function.
6656 * @param {number} [ary] The arity cap of `func`.
6657 * @param {number} [arity] The arity of `func`.
6658 * @returns {Function} Returns the new wrapped function.
6660 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
6661 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
6662 if (!isBindKey && typeof func != 'function') {
6663 throw new TypeError(FUNC_ERROR_TEXT);
6665 var length = partials ? partials.length : 0;
6667 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
6668 partials = holders = undefined;
6670 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
6671 arity = arity === undefined ? arity : toInteger(arity);
6672 length -= holders ? holders.length : 0;
6674 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
6675 var partialsRight = partials,
6676 holdersRight = holders;
6678 partials = holders = undefined;
6680 var data = isBindKey ? undefined : getData(func);
6683 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
6688 mergeData(newData, data);
6691 bitmask = newData[1];
6692 thisArg = newData[2];
6693 partials = newData[3];
6694 holders = newData[4];
6695 arity = newData[9] = newData[9] === undefined
6696 ? (isBindKey ? 0 : func.length)
6697 : nativeMax(newData[9] - length, 0);
6699 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
6700 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
6702 if (!bitmask || bitmask == WRAP_BIND_FLAG) {
6703 var result = createBind(func, bitmask, thisArg);
6704 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
6705 result = createCurry(func, bitmask, arity);
6706 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
6707 result = createPartial(func, bitmask, thisArg, partials);
6709 result = createHybrid.apply(undefined, newData);
6711 var setter = data ? baseSetData : setData;
6712 return setWrapToString(setter(result, newData), func, bitmask);
6716 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
6717 * of source objects to the destination object for all destination properties
6718 * that resolve to `undefined`.
6721 * @param {*} objValue The destination value.
6722 * @param {*} srcValue The source value.
6723 * @param {string} key The key of the property to assign.
6724 * @param {Object} object The parent object of `objValue`.
6725 * @returns {*} Returns the value to assign.
6727 function customDefaultsAssignIn(objValue, srcValue, key, object) {
6728 if (objValue === undefined ||
6729 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
6736 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
6737 * objects into destination objects that are passed thru.
6740 * @param {*} objValue The destination value.
6741 * @param {*} srcValue The source value.
6742 * @param {string} key The key of the property to merge.
6743 * @param {Object} object The parent object of `objValue`.
6744 * @param {Object} source The parent object of `srcValue`.
6745 * @param {Object} [stack] Tracks traversed source values and their merged
6747 * @returns {*} Returns the value to assign.
6749 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
6750 if (isObject(objValue) && isObject(srcValue)) {
6751 // Recursively merge objects and arrays (susceptible to call stack limits).
6752 stack.set(srcValue, objValue);
6753 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
6754 stack['delete'](srcValue);
6760 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
6764 * @param {*} value The value to inspect.
6765 * @param {string} key The key of the property to inspect.
6766 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
6768 function customOmitClone(value) {
6769 return isPlainObject(value) ? undefined : value;
6773 * A specialized version of `baseIsEqualDeep` for arrays with support for
6774 * partial deep comparisons.
6777 * @param {Array} array The array to compare.
6778 * @param {Array} other The other array to compare.
6779 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
6780 * @param {Function} customizer The function to customize comparisons.
6781 * @param {Function} equalFunc The function to determine equivalents of values.
6782 * @param {Object} stack Tracks traversed `array` and `other` objects.
6783 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
6785 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
6786 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
6787 arrLength = array.length,
6788 othLength = other.length;
6790 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
6793 // Check that cyclic values are equal.
6794 var arrStacked = stack.get(array);
6795 var othStacked = stack.get(other);
6796 if (arrStacked && othStacked) {
6797 return arrStacked == other && othStacked == array;
6801 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
6803 stack.set(array, other);
6804 stack.set(other, array);
6806 // Ignore non-index properties.
6807 while (++index < arrLength) {
6808 var arrValue = array[index],
6809 othValue = other[index];
6812 var compared = isPartial
6813 ? customizer(othValue, arrValue, index, other, array, stack)
6814 : customizer(arrValue, othValue, index, array, other, stack);
6816 if (compared !== undefined) {
6823 // Recursively compare arrays (susceptible to call stack limits).
6825 if (!arraySome(other, function(othValue, othIndex) {
6826 if (!cacheHas(seen, othIndex) &&
6827 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
6828 return seen.push(othIndex);
6835 arrValue === othValue ||
6836 equalFunc(arrValue, othValue, bitmask, customizer, stack)
6842 stack['delete'](array);
6843 stack['delete'](other);
6848 * A specialized version of `baseIsEqualDeep` for comparing objects of
6849 * the same `toStringTag`.
6851 * **Note:** This function only supports comparing values with tags of
6852 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
6855 * @param {Object} object The object to compare.
6856 * @param {Object} other The other object to compare.
6857 * @param {string} tag The `toStringTag` of the objects to compare.
6858 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
6859 * @param {Function} customizer The function to customize comparisons.
6860 * @param {Function} equalFunc The function to determine equivalents of values.
6861 * @param {Object} stack Tracks traversed `object` and `other` objects.
6862 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
6864 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
6867 if ((object.byteLength != other.byteLength) ||
6868 (object.byteOffset != other.byteOffset)) {
6871 object = object.buffer;
6872 other = other.buffer;
6874 case arrayBufferTag:
6875 if ((object.byteLength != other.byteLength) ||
6876 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
6884 // Coerce booleans to `1` or `0` and dates to milliseconds.
6885 // Invalid dates are coerced to `NaN`.
6886 return eq(+object, +other);
6889 return object.name == other.name && object.message == other.message;
6893 // Coerce regexes to strings and treat strings, primitives and objects,
6894 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
6895 // for more details.
6896 return object == (other + '');
6899 var convert = mapToArray;
6902 var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
6903 convert || (convert = setToArray);
6905 if (object.size != other.size && !isPartial) {
6908 // Assume cyclic values are equal.
6909 var stacked = stack.get(object);
6911 return stacked == other;
6913 bitmask |= COMPARE_UNORDERED_FLAG;
6915 // Recursively compare objects (susceptible to call stack limits).
6916 stack.set(object, other);
6917 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
6918 stack['delete'](object);
6922 if (symbolValueOf) {
6923 return symbolValueOf.call(object) == symbolValueOf.call(other);
6930 * A specialized version of `baseIsEqualDeep` for objects with support for
6931 * partial deep comparisons.
6934 * @param {Object} object The object to compare.
6935 * @param {Object} other The other object to compare.
6936 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
6937 * @param {Function} customizer The function to customize comparisons.
6938 * @param {Function} equalFunc The function to determine equivalents of values.
6939 * @param {Object} stack Tracks traversed `object` and `other` objects.
6940 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
6942 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6943 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
6944 objProps = getAllKeys(object),
6945 objLength = objProps.length,
6946 othProps = getAllKeys(other),
6947 othLength = othProps.length;
6949 if (objLength != othLength && !isPartial) {
6952 var index = objLength;
6954 var key = objProps[index];
6955 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
6959 // Check that cyclic values are equal.
6960 var objStacked = stack.get(object);
6961 var othStacked = stack.get(other);
6962 if (objStacked && othStacked) {
6963 return objStacked == other && othStacked == object;
6966 stack.set(object, other);
6967 stack.set(other, object);
6969 var skipCtor = isPartial;
6970 while (++index < objLength) {
6971 key = objProps[index];
6972 var objValue = object[key],
6973 othValue = other[key];
6976 var compared = isPartial
6977 ? customizer(othValue, objValue, key, other, object, stack)
6978 : customizer(objValue, othValue, key, object, other, stack);
6980 // Recursively compare objects (susceptible to call stack limits).
6981 if (!(compared === undefined
6982 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
6988 skipCtor || (skipCtor = key == 'constructor');
6990 if (result && !skipCtor) {
6991 var objCtor = object.constructor,
6992 othCtor = other.constructor;
6994 // Non `Object` object instances with different constructors are not equal.
6995 if (objCtor != othCtor &&
6996 ('constructor' in object && 'constructor' in other) &&
6997 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
6998 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
7002 stack['delete'](object);
7003 stack['delete'](other);
7008 * A specialized version of `baseRest` which flattens the rest array.
7011 * @param {Function} func The function to apply a rest parameter to.
7012 * @returns {Function} Returns the new function.
7014 function flatRest(func) {
7015 return setToString(overRest(func, undefined, flatten), func + '');
7019 * Creates an array of own enumerable property names and symbols of `object`.
7022 * @param {Object} object The object to query.
7023 * @returns {Array} Returns the array of property names and symbols.
7025 function getAllKeys(object) {
7026 return baseGetAllKeys(object, keys, getSymbols);
7030 * Creates an array of own and inherited enumerable property names and
7031 * symbols of `object`.
7034 * @param {Object} object The object to query.
7035 * @returns {Array} Returns the array of property names and symbols.
7037 function getAllKeysIn(object) {
7038 return baseGetAllKeys(object, keysIn, getSymbolsIn);
7042 * Gets metadata for `func`.
7045 * @param {Function} func The function to query.
7046 * @returns {*} Returns the metadata for `func`.
7048 var getData = !metaMap ? noop : function(func) {
7049 return metaMap.get(func);
7053 * Gets the name of `func`.
7056 * @param {Function} func The function to query.
7057 * @returns {string} Returns the function name.
7059 function getFuncName(func) {
7060 var result = (func.name + ''),
7061 array = realNames[result],
7062 length = hasOwnProperty.call(realNames, result) ? array.length : 0;
7065 var data = array[length],
7066 otherFunc = data.func;
7067 if (otherFunc == null || otherFunc == func) {
7075 * Gets the argument placeholder value for `func`.
7078 * @param {Function} func The function to inspect.
7079 * @returns {*} Returns the placeholder value.
7081 function getHolder(func) {
7082 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
7083 return object.placeholder;
7087 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
7088 * this function returns the custom method, otherwise it returns `baseIteratee`.
7089 * If arguments are provided, the chosen function is invoked with them and
7090 * its result is returned.
7093 * @param {*} [value] The value to convert to an iteratee.
7094 * @param {number} [arity] The arity of the created iteratee.
7095 * @returns {Function} Returns the chosen function or its result.
7097 function getIteratee() {
7098 var result = lodash.iteratee || iteratee;
7099 result = result === iteratee ? baseIteratee : result;
7100 return arguments.length ? result(arguments[0], arguments[1]) : result;
7104 * Gets the data for `map`.
7107 * @param {Object} map The map to query.
7108 * @param {string} key The reference key.
7109 * @returns {*} Returns the map data.
7111 function getMapData(map, key) {
7112 var data = map.__data__;
7113 return isKeyable(key)
7114 ? data[typeof key == 'string' ? 'string' : 'hash']
7119 * Gets the property names, values, and compare flags of `object`.
7122 * @param {Object} object The object to query.
7123 * @returns {Array} Returns the match data of `object`.
7125 function getMatchData(object) {
7126 var result = keys(object),
7127 length = result.length;
7130 var key = result[length],
7131 value = object[key];
7133 result[length] = [key, value, isStrictComparable(value)];
7139 * Gets the native function at `key` of `object`.
7142 * @param {Object} object The object to query.
7143 * @param {string} key The key of the method to get.
7144 * @returns {*} Returns the function if it's native, else `undefined`.
7146 function getNative(object, key) {
7147 var value = getValue(object, key);
7148 return baseIsNative(value) ? value : undefined;
7152 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
7155 * @param {*} value The value to query.
7156 * @returns {string} Returns the raw `toStringTag`.
7158 function getRawTag(value) {
7159 var isOwn = hasOwnProperty.call(value, symToStringTag),
7160 tag = value[symToStringTag];
7163 value[symToStringTag] = undefined;
7164 var unmasked = true;
7167 var result = nativeObjectToString.call(value);
7170 value[symToStringTag] = tag;
7172 delete value[symToStringTag];
7179 * Creates an array of the own enumerable symbols of `object`.
7182 * @param {Object} object The object to query.
7183 * @returns {Array} Returns the array of symbols.
7185 var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
7186 if (object == null) {
7189 object = Object(object);
7190 return arrayFilter(nativeGetSymbols(object), function(symbol) {
7191 return propertyIsEnumerable.call(object, symbol);
7196 * Creates an array of the own and inherited enumerable symbols of `object`.
7199 * @param {Object} object The object to query.
7200 * @returns {Array} Returns the array of symbols.
7202 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
7205 arrayPush(result, getSymbols(object));
7206 object = getPrototype(object);
7212 * Gets the `toStringTag` of `value`.
7215 * @param {*} value The value to query.
7216 * @returns {string} Returns the `toStringTag`.
7218 var getTag = baseGetTag;
7220 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
7221 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
7222 (Map && getTag(new Map) != mapTag) ||
7223 (Promise && getTag(Promise.resolve()) != promiseTag) ||
7224 (Set && getTag(new Set) != setTag) ||
7225 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
7226 getTag = function(value) {
7227 var result = baseGetTag(value),
7228 Ctor = result == objectTag ? value.constructor : undefined,
7229 ctorString = Ctor ? toSource(Ctor) : '';
7232 switch (ctorString) {
7233 case dataViewCtorString: return dataViewTag;
7234 case mapCtorString: return mapTag;
7235 case promiseCtorString: return promiseTag;
7236 case setCtorString: return setTag;
7237 case weakMapCtorString: return weakMapTag;
7245 * Gets the view, applying any `transforms` to the `start` and `end` positions.
7248 * @param {number} start The start of the view.
7249 * @param {number} end The end of the view.
7250 * @param {Array} transforms The transformations to apply to the view.
7251 * @returns {Object} Returns an object containing the `start` and `end`
7252 * positions of the view.
7254 function getView(start, end, transforms) {
7256 length = transforms.length;
7258 while (++index < length) {
7259 var data = transforms[index],
7262 switch (data.type) {
7263 case 'drop': start += size; break;
7264 case 'dropRight': end -= size; break;
7265 case 'take': end = nativeMin(end, start + size); break;
7266 case 'takeRight': start = nativeMax(start, end - size); break;
7269 return { 'start': start, 'end': end };
7273 * Extracts wrapper details from the `source` body comment.
7276 * @param {string} source The source to inspect.
7277 * @returns {Array} Returns the wrapper details.
7279 function getWrapDetails(source) {
7280 var match = source.match(reWrapDetails);
7281 return match ? match[1].split(reSplitDetails) : [];
7285 * Checks if `path` exists on `object`.
7288 * @param {Object} object The object to query.
7289 * @param {Array|string} path The path to check.
7290 * @param {Function} hasFunc The function to check properties.
7291 * @returns {boolean} Returns `true` if `path` exists, else `false`.
7293 function hasPath(object, path, hasFunc) {
7294 path = castPath(path, object);
7297 length = path.length,
7300 while (++index < length) {
7301 var key = toKey(path[index]);
7302 if (!(result = object != null && hasFunc(object, key))) {
7305 object = object[key];
7307 if (result || ++index != length) {
7310 length = object == null ? 0 : object.length;
7311 return !!length && isLength(length) && isIndex(key, length) &&
7312 (isArray(object) || isArguments(object));
7316 * Initializes an array clone.
7319 * @param {Array} array The array to clone.
7320 * @returns {Array} Returns the initialized clone.
7322 function initCloneArray(array) {
7323 var length = array.length,
7324 result = new array.constructor(length);
7326 // Add properties assigned by `RegExp#exec`.
7327 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
7328 result.index = array.index;
7329 result.input = array.input;
7335 * Initializes an object clone.
7338 * @param {Object} object The object to clone.
7339 * @returns {Object} Returns the initialized clone.
7341 function initCloneObject(object) {
7342 return (typeof object.constructor == 'function' && !isPrototype(object))
7343 ? baseCreate(getPrototype(object))
7348 * Initializes an object clone based on its `toStringTag`.
7350 * **Note:** This function only supports cloning values with tags of
7351 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
7354 * @param {Object} object The object to clone.
7355 * @param {string} tag The `toStringTag` of the object to clone.
7356 * @param {boolean} [isDeep] Specify a deep clone.
7357 * @returns {Object} Returns the initialized clone.
7359 function initCloneByTag(object, tag, isDeep) {
7360 var Ctor = object.constructor;
7362 case arrayBufferTag:
7363 return cloneArrayBuffer(object);
7367 return new Ctor(+object);
7370 return cloneDataView(object, isDeep);
7372 case float32Tag: case float64Tag:
7373 case int8Tag: case int16Tag: case int32Tag:
7374 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
7375 return cloneTypedArray(object, isDeep);
7382 return new Ctor(object);
7385 return cloneRegExp(object);
7391 return cloneSymbol(object);
7396 * Inserts wrapper `details` in a comment at the top of the `source` body.
7399 * @param {string} source The source to modify.
7400 * @returns {Array} details The details to insert.
7401 * @returns {string} Returns the modified source.
7403 function insertWrapDetails(source, details) {
7404 var length = details.length;
7408 var lastIndex = length - 1;
7409 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
7410 details = details.join(length > 2 ? ', ' : ' ');
7411 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
7415 * Checks if `value` is a flattenable `arguments` object or array.
7418 * @param {*} value The value to check.
7419 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
7421 function isFlattenable(value) {
7422 return isArray(value) || isArguments(value) ||
7423 !!(spreadableSymbol && value && value[spreadableSymbol]);
7427 * Checks if `value` is a valid array-like index.
7430 * @param {*} value The value to check.
7431 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
7432 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
7434 function isIndex(value, length) {
7435 var type = typeof value;
7436 length = length == null ? MAX_SAFE_INTEGER : length;
7439 (type == 'number' ||
7440 (type != 'symbol' && reIsUint.test(value))) &&
7441 (value > -1 && value % 1 == 0 && value < length);
7445 * Checks if the given arguments are from an iteratee call.
7448 * @param {*} value The potential iteratee value argument.
7449 * @param {*} index The potential iteratee index or key argument.
7450 * @param {*} object The potential iteratee object argument.
7451 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
7454 function isIterateeCall(value, index, object) {
7455 if (!isObject(object)) {
7458 var type = typeof index;
7459 if (type == 'number'
7460 ? (isArrayLike(object) && isIndex(index, object.length))
7461 : (type == 'string' && index in object)
7463 return eq(object[index], value);
7469 * Checks if `value` is a property name and not a property path.
7472 * @param {*} value The value to check.
7473 * @param {Object} [object] The object to query keys on.
7474 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
7476 function isKey(value, object) {
7477 if (isArray(value)) {
7480 var type = typeof value;
7481 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
7482 value == null || isSymbol(value)) {
7485 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
7486 (object != null && value in Object(object));
7490 * Checks if `value` is suitable for use as unique object key.
7493 * @param {*} value The value to check.
7494 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
7496 function isKeyable(value) {
7497 var type = typeof value;
7498 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
7499 ? (value !== '__proto__')
7504 * Checks if `func` has a lazy counterpart.
7507 * @param {Function} func The function to check.
7508 * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
7511 function isLaziable(func) {
7512 var funcName = getFuncName(func),
7513 other = lodash[funcName];
7515 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
7518 if (func === other) {
7521 var data = getData(other);
7522 return !!data && func === data[0];
7526 * Checks if `func` has its source masked.
7529 * @param {Function} func The function to check.
7530 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
7532 function isMasked(func) {
7533 return !!maskSrcKey && (maskSrcKey in func);
7537 * Checks if `func` is capable of being masked.
7540 * @param {*} value The value to check.
7541 * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
7543 var isMaskable = coreJsData ? isFunction : stubFalse;
7546 * Checks if `value` is likely a prototype object.
7549 * @param {*} value The value to check.
7550 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
7552 function isPrototype(value) {
7553 var Ctor = value && value.constructor,
7554 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
7556 return value === proto;
7560 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
7563 * @param {*} value The value to check.
7564 * @returns {boolean} Returns `true` if `value` if suitable for strict
7565 * equality comparisons, else `false`.
7567 function isStrictComparable(value) {
7568 return value === value && !isObject(value);
7572 * A specialized version of `matchesProperty` for source values suitable
7573 * for strict equality comparisons, i.e. `===`.
7576 * @param {string} key The key of the property to get.
7577 * @param {*} srcValue The value to match.
7578 * @returns {Function} Returns the new spec function.
7580 function matchesStrictComparable(key, srcValue) {
7581 return function(object) {
7582 if (object == null) {
7585 return object[key] === srcValue &&
7586 (srcValue !== undefined || (key in Object(object)));
7591 * A specialized version of `_.memoize` which clears the memoized function's
7592 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
7595 * @param {Function} func The function to have its output memoized.
7596 * @returns {Function} Returns the new memoized function.
7598 function memoizeCapped(func) {
7599 var result = memoize(func, function(key) {
7600 if (cache.size === MAX_MEMOIZE_SIZE) {
7606 var cache = result.cache;
7611 * Merges the function metadata of `source` into `data`.
7613 * Merging metadata reduces the number of wrappers used to invoke a function.
7614 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
7615 * may be applied regardless of execution order. Methods like `_.ary` and
7616 * `_.rearg` modify function arguments, making the order in which they are
7617 * executed important, preventing the merging of metadata. However, we make
7618 * an exception for a safe combined case where curried functions have `_.ary`
7619 * and or `_.rearg` applied.
7622 * @param {Array} data The destination metadata.
7623 * @param {Array} source The source metadata.
7624 * @returns {Array} Returns `data`.
7626 function mergeData(data, source) {
7627 var bitmask = data[1],
7628 srcBitmask = source[1],
7629 newBitmask = bitmask | srcBitmask,
7630 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
7633 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
7634 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
7635 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
7637 // Exit early if metadata can't be merged.
7638 if (!(isCommon || isCombo)) {
7641 // Use source `thisArg` if available.
7642 if (srcBitmask & WRAP_BIND_FLAG) {
7643 data[2] = source[2];
7644 // Set when currying a bound function.
7645 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
7647 // Compose partial arguments.
7648 var value = source[3];
7650 var partials = data[3];
7651 data[3] = partials ? composeArgs(partials, value, source[4]) : value;
7652 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
7654 // Compose partial right arguments.
7658 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
7659 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
7661 // Use source `argPos` if available.
7666 // Use source `ary` if it's smaller.
7667 if (srcBitmask & WRAP_ARY_FLAG) {
7668 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
7670 // Use source `arity` if one is not provided.
7671 if (data[9] == null) {
7672 data[9] = source[9];
7674 // Use source `func` and merge bitmasks.
7675 data[0] = source[0];
7676 data[1] = newBitmask;
7682 * This function is like
7683 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
7684 * except that it includes inherited enumerable properties.
7687 * @param {Object} object The object to query.
7688 * @returns {Array} Returns the array of property names.
7690 function nativeKeysIn(object) {
7692 if (object != null) {
7693 for (var key in Object(object)) {
7701 * Converts `value` to a string using `Object.prototype.toString`.
7704 * @param {*} value The value to convert.
7705 * @returns {string} Returns the converted string.
7707 function objectToString(value) {
7708 return nativeObjectToString.call(value);
7712 * A specialized version of `baseRest` which transforms the rest array.
7715 * @param {Function} func The function to apply a rest parameter to.
7716 * @param {number} [start=func.length-1] The start position of the rest parameter.
7717 * @param {Function} transform The rest array transform.
7718 * @returns {Function} Returns the new function.
7720 function overRest(func, start, transform) {
7721 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
7723 var args = arguments,
7725 length = nativeMax(args.length - start, 0),
7726 array = Array(length);
7728 while (++index < length) {
7729 array[index] = args[start + index];
7732 var otherArgs = Array(start + 1);
7733 while (++index < start) {
7734 otherArgs[index] = args[index];
7736 otherArgs[start] = transform(array);
7737 return apply(func, this, otherArgs);
7742 * Gets the parent value at `path` of `object`.
7745 * @param {Object} object The object to query.
7746 * @param {Array} path The path to get the parent value of.
7747 * @returns {*} Returns the parent value.
7749 function parent(object, path) {
7750 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
7754 * Reorder `array` according to the specified indexes where the element at
7755 * the first index is assigned as the first element, the element at
7756 * the second index is assigned as the second element, and so on.
7759 * @param {Array} array The array to reorder.
7760 * @param {Array} indexes The arranged array indexes.
7761 * @returns {Array} Returns `array`.
7763 function reorder(array, indexes) {
7764 var arrLength = array.length,
7765 length = nativeMin(indexes.length, arrLength),
7766 oldArray = copyArray(array);
7769 var index = indexes[length];
7770 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
7776 * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
7779 * @param {Object} object The object to query.
7780 * @param {string} key The key of the property to get.
7781 * @returns {*} Returns the property value.
7783 function safeGet(object, key) {
7784 if (key === 'constructor' && typeof object[key] === 'function') {
7788 if (key == '__proto__') {
7796 * Sets metadata for `func`.
7798 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
7799 * period of time, it will trip its breaker and transition to an identity
7800 * function to avoid garbage collection pauses in V8. See
7801 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
7805 * @param {Function} func The function to associate metadata with.
7806 * @param {*} data The metadata.
7807 * @returns {Function} Returns `func`.
7809 var setData = shortOut(baseSetData);
7812 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
7815 * @param {Function} func The function to delay.
7816 * @param {number} wait The number of milliseconds to delay invocation.
7817 * @returns {number|Object} Returns the timer id or timeout object.
7819 var setTimeout = ctxSetTimeout || function(func, wait) {
7820 return root.setTimeout(func, wait);
7824 * Sets the `toString` method of `func` to return `string`.
7827 * @param {Function} func The function to modify.
7828 * @param {Function} string The `toString` result.
7829 * @returns {Function} Returns `func`.
7831 var setToString = shortOut(baseSetToString);
7834 * Sets the `toString` method of `wrapper` to mimic the source of `reference`
7835 * with wrapper details in a comment at the top of the source body.
7838 * @param {Function} wrapper The function to modify.
7839 * @param {Function} reference The reference function.
7840 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
7841 * @returns {Function} Returns `wrapper`.
7843 function setWrapToString(wrapper, reference, bitmask) {
7844 var source = (reference + '');
7845 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
7849 * Creates a function that'll short out and invoke `identity` instead
7850 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
7854 * @param {Function} func The function to restrict.
7855 * @returns {Function} Returns the new shortable function.
7857 function shortOut(func) {
7862 var stamp = nativeNow(),
7863 remaining = HOT_SPAN - (stamp - lastCalled);
7866 if (remaining > 0) {
7867 if (++count >= HOT_COUNT) {
7868 return arguments[0];
7873 return func.apply(undefined, arguments);
7878 * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
7881 * @param {Array} array The array to shuffle.
7882 * @param {number} [size=array.length] The size of `array`.
7883 * @returns {Array} Returns `array`.
7885 function shuffleSelf(array, size) {
7887 length = array.length,
7888 lastIndex = length - 1;
7890 size = size === undefined ? length : size;
7891 while (++index < size) {
7892 var rand = baseRandom(index, lastIndex),
7893 value = array[rand];
7895 array[rand] = array[index];
7896 array[index] = value;
7898 array.length = size;
7903 * Converts `string` to a property path array.
7906 * @param {string} string The string to convert.
7907 * @returns {Array} Returns the property path array.
7909 var stringToPath = memoizeCapped(function(string) {
7911 if (string.charCodeAt(0) === 46 /* . */) {
7914 string.replace(rePropName, function(match, number, quote, subString) {
7915 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
7921 * Converts `value` to a string key if it's not a string or symbol.
7924 * @param {*} value The value to inspect.
7925 * @returns {string|symbol} Returns the key.
7927 function toKey(value) {
7928 if (typeof value == 'string' || isSymbol(value)) {
7931 var result = (value + '');
7932 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
7936 * Converts `func` to its source code.
7939 * @param {Function} func The function to convert.
7940 * @returns {string} Returns the source code.
7942 function toSource(func) {
7945 return funcToString.call(func);
7955 * Updates wrapper `details` based on `bitmask` flags.
7958 * @returns {Array} details The details to modify.
7959 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
7960 * @returns {Array} Returns `details`.
7962 function updateWrapDetails(details, bitmask) {
7963 arrayEach(wrapFlags, function(pair) {
7964 var value = '_.' + pair[0];
7965 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
7966 details.push(value);
7969 return details.sort();
7973 * Creates a clone of `wrapper`.
7976 * @param {Object} wrapper The wrapper to clone.
7977 * @returns {Object} Returns the cloned wrapper.
7979 function wrapperClone(wrapper) {
7980 if (wrapper instanceof LazyWrapper) {
7981 return wrapper.clone();
7983 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
7984 result.__actions__ = copyArray(wrapper.__actions__);
7985 result.__index__ = wrapper.__index__;
7986 result.__values__ = wrapper.__values__;
7990 /*------------------------------------------------------------------------*/
7993 * Creates an array of elements split into groups the length of `size`.
7994 * If `array` can't be split evenly, the final chunk will be the remaining
8001 * @param {Array} array The array to process.
8002 * @param {number} [size=1] The length of each chunk
8003 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
8004 * @returns {Array} Returns the new array of chunks.
8007 * _.chunk(['a', 'b', 'c', 'd'], 2);
8008 * // => [['a', 'b'], ['c', 'd']]
8010 * _.chunk(['a', 'b', 'c', 'd'], 3);
8011 * // => [['a', 'b', 'c'], ['d']]
8013 function chunk(array, size, guard) {
8014 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
8017 size = nativeMax(toInteger(size), 0);
8019 var length = array == null ? 0 : array.length;
8020 if (!length || size < 1) {
8025 result = Array(nativeCeil(length / size));
8027 while (index < length) {
8028 result[resIndex++] = baseSlice(array, index, (index += size));
8034 * Creates an array with all falsey values removed. The values `false`, `null`,
8035 * `0`, `""`, `undefined`, and `NaN` are falsey.
8041 * @param {Array} array The array to compact.
8042 * @returns {Array} Returns the new array of filtered values.
8045 * _.compact([0, 1, false, 2, '', 3]);
8048 function compact(array) {
8050 length = array == null ? 0 : array.length,
8054 while (++index < length) {
8055 var value = array[index];
8057 result[resIndex++] = value;
8064 * Creates a new array concatenating `array` with any additional arrays
8071 * @param {Array} array The array to concatenate.
8072 * @param {...*} [values] The values to concatenate.
8073 * @returns {Array} Returns the new concatenated array.
8077 * var other = _.concat(array, 2, [3], [[4]]);
8079 * console.log(other);
8080 * // => [1, 2, 3, [4]]
8082 * console.log(array);
8086 var length = arguments.length;
8090 var args = Array(length - 1),
8091 array = arguments[0],
8095 args[index - 1] = arguments[index];
8097 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
8101 * Creates an array of `array` values not included in the other given arrays
8102 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
8103 * for equality comparisons. The order and references of result values are
8104 * determined by the first array.
8106 * **Note:** Unlike `_.pullAll`, this method returns a new array.
8112 * @param {Array} array The array to inspect.
8113 * @param {...Array} [values] The values to exclude.
8114 * @returns {Array} Returns the new array of filtered values.
8115 * @see _.without, _.xor
8118 * _.difference([2, 1], [2, 3]);
8121 var difference = baseRest(function(array, values) {
8122 return isArrayLikeObject(array)
8123 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
8128 * This method is like `_.difference` except that it accepts `iteratee` which
8129 * is invoked for each element of `array` and `values` to generate the criterion
8130 * by which they're compared. The order and references of result values are
8131 * determined by the first array. The iteratee is invoked with one argument:
8134 * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
8140 * @param {Array} array The array to inspect.
8141 * @param {...Array} [values] The values to exclude.
8142 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8143 * @returns {Array} Returns the new array of filtered values.
8146 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
8149 * // The `_.property` iteratee shorthand.
8150 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
8151 * // => [{ 'x': 2 }]
8153 var differenceBy = baseRest(function(array, values) {
8154 var iteratee = last(values);
8155 if (isArrayLikeObject(iteratee)) {
8156 iteratee = undefined;
8158 return isArrayLikeObject(array)
8159 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
8164 * This method is like `_.difference` except that it accepts `comparator`
8165 * which is invoked to compare elements of `array` to `values`. The order and
8166 * references of result values are determined by the first array. The comparator
8167 * is invoked with two arguments: (arrVal, othVal).
8169 * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
8175 * @param {Array} array The array to inspect.
8176 * @param {...Array} [values] The values to exclude.
8177 * @param {Function} [comparator] The comparator invoked per element.
8178 * @returns {Array} Returns the new array of filtered values.
8181 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
8183 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
8184 * // => [{ 'x': 2, 'y': 1 }]
8186 var differenceWith = baseRest(function(array, values) {
8187 var comparator = last(values);
8188 if (isArrayLikeObject(comparator)) {
8189 comparator = undefined;
8191 return isArrayLikeObject(array)
8192 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
8197 * Creates a slice of `array` with `n` elements dropped from the beginning.
8203 * @param {Array} array The array to query.
8204 * @param {number} [n=1] The number of elements to drop.
8205 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
8206 * @returns {Array} Returns the slice of `array`.
8209 * _.drop([1, 2, 3]);
8212 * _.drop([1, 2, 3], 2);
8215 * _.drop([1, 2, 3], 5);
8218 * _.drop([1, 2, 3], 0);
8221 function drop(array, n, guard) {
8222 var length = array == null ? 0 : array.length;
8226 n = (guard || n === undefined) ? 1 : toInteger(n);
8227 return baseSlice(array, n < 0 ? 0 : n, length);
8231 * Creates a slice of `array` with `n` elements dropped from the end.
8237 * @param {Array} array The array to query.
8238 * @param {number} [n=1] The number of elements to drop.
8239 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
8240 * @returns {Array} Returns the slice of `array`.
8243 * _.dropRight([1, 2, 3]);
8246 * _.dropRight([1, 2, 3], 2);
8249 * _.dropRight([1, 2, 3], 5);
8252 * _.dropRight([1, 2, 3], 0);
8255 function dropRight(array, n, guard) {
8256 var length = array == null ? 0 : array.length;
8260 n = (guard || n === undefined) ? 1 : toInteger(n);
8262 return baseSlice(array, 0, n < 0 ? 0 : n);
8266 * Creates a slice of `array` excluding elements dropped from the end.
8267 * Elements are dropped until `predicate` returns falsey. The predicate is
8268 * invoked with three arguments: (value, index, array).
8274 * @param {Array} array The array to query.
8275 * @param {Function} [predicate=_.identity] The function invoked per iteration.
8276 * @returns {Array} Returns the slice of `array`.
8280 * { 'user': 'barney', 'active': true },
8281 * { 'user': 'fred', 'active': false },
8282 * { 'user': 'pebbles', 'active': false }
8285 * _.dropRightWhile(users, function(o) { return !o.active; });
8286 * // => objects for ['barney']
8288 * // The `_.matches` iteratee shorthand.
8289 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
8290 * // => objects for ['barney', 'fred']
8292 * // The `_.matchesProperty` iteratee shorthand.
8293 * _.dropRightWhile(users, ['active', false]);
8294 * // => objects for ['barney']
8296 * // The `_.property` iteratee shorthand.
8297 * _.dropRightWhile(users, 'active');
8298 * // => objects for ['barney', 'fred', 'pebbles']
8300 function dropRightWhile(array, predicate) {
8301 return (array && array.length)
8302 ? baseWhile(array, getIteratee(predicate, 3), true, true)
8307 * Creates a slice of `array` excluding elements dropped from the beginning.
8308 * Elements are dropped until `predicate` returns falsey. The predicate is
8309 * invoked with three arguments: (value, index, array).
8315 * @param {Array} array The array to query.
8316 * @param {Function} [predicate=_.identity] The function invoked per iteration.
8317 * @returns {Array} Returns the slice of `array`.
8321 * { 'user': 'barney', 'active': false },
8322 * { 'user': 'fred', 'active': false },
8323 * { 'user': 'pebbles', 'active': true }
8326 * _.dropWhile(users, function(o) { return !o.active; });
8327 * // => objects for ['pebbles']
8329 * // The `_.matches` iteratee shorthand.
8330 * _.dropWhile(users, { 'user': 'barney', 'active': false });
8331 * // => objects for ['fred', 'pebbles']
8333 * // The `_.matchesProperty` iteratee shorthand.
8334 * _.dropWhile(users, ['active', false]);
8335 * // => objects for ['pebbles']
8337 * // The `_.property` iteratee shorthand.
8338 * _.dropWhile(users, 'active');
8339 * // => objects for ['barney', 'fred', 'pebbles']
8341 function dropWhile(array, predicate) {
8342 return (array && array.length)
8343 ? baseWhile(array, getIteratee(predicate, 3), true)
8348 * Fills elements of `array` with `value` from `start` up to, but not
8351 * **Note:** This method mutates `array`.
8357 * @param {Array} array The array to fill.
8358 * @param {*} value The value to fill `array` with.
8359 * @param {number} [start=0] The start position.
8360 * @param {number} [end=array.length] The end position.
8361 * @returns {Array} Returns `array`.
8364 * var array = [1, 2, 3];
8366 * _.fill(array, 'a');
8367 * console.log(array);
8368 * // => ['a', 'a', 'a']
8370 * _.fill(Array(3), 2);
8373 * _.fill([4, 6, 8, 10], '*', 1, 3);
8374 * // => [4, '*', '*', 10]
8376 function fill(array, value, start, end) {
8377 var length = array == null ? 0 : array.length;
8381 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
8385 return baseFill(array, value, start, end);
8389 * This method is like `_.find` except that it returns the index of the first
8390 * element `predicate` returns truthy for instead of the element itself.
8396 * @param {Array} array The array to inspect.
8397 * @param {Function} [predicate=_.identity] The function invoked per iteration.
8398 * @param {number} [fromIndex=0] The index to search from.
8399 * @returns {number} Returns the index of the found element, else `-1`.
8403 * { 'user': 'barney', 'active': false },
8404 * { 'user': 'fred', 'active': false },
8405 * { 'user': 'pebbles', 'active': true }
8408 * _.findIndex(users, function(o) { return o.user == 'barney'; });
8411 * // The `_.matches` iteratee shorthand.
8412 * _.findIndex(users, { 'user': 'fred', 'active': false });
8415 * // The `_.matchesProperty` iteratee shorthand.
8416 * _.findIndex(users, ['active', false]);
8419 * // The `_.property` iteratee shorthand.
8420 * _.findIndex(users, 'active');
8423 function findIndex(array, predicate, fromIndex) {
8424 var length = array == null ? 0 : array.length;
8428 var index = fromIndex == null ? 0 : toInteger(fromIndex);
8430 index = nativeMax(length + index, 0);
8432 return baseFindIndex(array, getIteratee(predicate, 3), index);
8436 * This method is like `_.findIndex` except that it iterates over elements
8437 * of `collection` from right to left.
8443 * @param {Array} array The array to inspect.
8444 * @param {Function} [predicate=_.identity] The function invoked per iteration.
8445 * @param {number} [fromIndex=array.length-1] The index to search from.
8446 * @returns {number} Returns the index of the found element, else `-1`.
8450 * { 'user': 'barney', 'active': true },
8451 * { 'user': 'fred', 'active': false },
8452 * { 'user': 'pebbles', 'active': false }
8455 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
8458 * // The `_.matches` iteratee shorthand.
8459 * _.findLastIndex(users, { 'user': 'barney', 'active': true });
8462 * // The `_.matchesProperty` iteratee shorthand.
8463 * _.findLastIndex(users, ['active', false]);
8466 * // The `_.property` iteratee shorthand.
8467 * _.findLastIndex(users, 'active');
8470 function findLastIndex(array, predicate, fromIndex) {
8471 var length = array == null ? 0 : array.length;
8475 var index = length - 1;
8476 if (fromIndex !== undefined) {
8477 index = toInteger(fromIndex);
8478 index = fromIndex < 0
8479 ? nativeMax(length + index, 0)
8480 : nativeMin(index, length - 1);
8482 return baseFindIndex(array, getIteratee(predicate, 3), index, true);
8486 * Flattens `array` a single level deep.
8492 * @param {Array} array The array to flatten.
8493 * @returns {Array} Returns the new flattened array.
8496 * _.flatten([1, [2, [3, [4]], 5]]);
8497 * // => [1, 2, [3, [4]], 5]
8499 function flatten(array) {
8500 var length = array == null ? 0 : array.length;
8501 return length ? baseFlatten(array, 1) : [];
8505 * Recursively flattens `array`.
8511 * @param {Array} array The array to flatten.
8512 * @returns {Array} Returns the new flattened array.
8515 * _.flattenDeep([1, [2, [3, [4]], 5]]);
8516 * // => [1, 2, 3, 4, 5]
8518 function flattenDeep(array) {
8519 var length = array == null ? 0 : array.length;
8520 return length ? baseFlatten(array, INFINITY) : [];
8524 * Recursively flatten `array` up to `depth` times.
8530 * @param {Array} array The array to flatten.
8531 * @param {number} [depth=1] The maximum recursion depth.
8532 * @returns {Array} Returns the new flattened array.
8535 * var array = [1, [2, [3, [4]], 5]];
8537 * _.flattenDepth(array, 1);
8538 * // => [1, 2, [3, [4]], 5]
8540 * _.flattenDepth(array, 2);
8541 * // => [1, 2, 3, [4], 5]
8543 function flattenDepth(array, depth) {
8544 var length = array == null ? 0 : array.length;
8548 depth = depth === undefined ? 1 : toInteger(depth);
8549 return baseFlatten(array, depth);
8553 * The inverse of `_.toPairs`; this method returns an object composed
8554 * from key-value `pairs`.
8560 * @param {Array} pairs The key-value pairs.
8561 * @returns {Object} Returns the new object.
8564 * _.fromPairs([['a', 1], ['b', 2]]);
8565 * // => { 'a': 1, 'b': 2 }
8567 function fromPairs(pairs) {
8569 length = pairs == null ? 0 : pairs.length,
8572 while (++index < length) {
8573 var pair = pairs[index];
8574 result[pair[0]] = pair[1];
8580 * Gets the first element of `array`.
8587 * @param {Array} array The array to query.
8588 * @returns {*} Returns the first element of `array`.
8591 * _.head([1, 2, 3]);
8597 function head(array) {
8598 return (array && array.length) ? array[0] : undefined;
8602 * Gets the index at which the first occurrence of `value` is found in `array`
8603 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
8604 * for equality comparisons. If `fromIndex` is negative, it's used as the
8605 * offset from the end of `array`.
8611 * @param {Array} array The array to inspect.
8612 * @param {*} value The value to search for.
8613 * @param {number} [fromIndex=0] The index to search from.
8614 * @returns {number} Returns the index of the matched value, else `-1`.
8617 * _.indexOf([1, 2, 1, 2], 2);
8620 * // Search from the `fromIndex`.
8621 * _.indexOf([1, 2, 1, 2], 2, 2);
8624 function indexOf(array, value, fromIndex) {
8625 var length = array == null ? 0 : array.length;
8629 var index = fromIndex == null ? 0 : toInteger(fromIndex);
8631 index = nativeMax(length + index, 0);
8633 return baseIndexOf(array, value, index);
8637 * Gets all but the last element of `array`.
8643 * @param {Array} array The array to query.
8644 * @returns {Array} Returns the slice of `array`.
8647 * _.initial([1, 2, 3]);
8650 function initial(array) {
8651 var length = array == null ? 0 : array.length;
8652 return length ? baseSlice(array, 0, -1) : [];
8656 * Creates an array of unique values that are included in all given arrays
8657 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
8658 * for equality comparisons. The order and references of result values are
8659 * determined by the first array.
8665 * @param {...Array} [arrays] The arrays to inspect.
8666 * @returns {Array} Returns the new array of intersecting values.
8669 * _.intersection([2, 1], [2, 3]);
8672 var intersection = baseRest(function(arrays) {
8673 var mapped = arrayMap(arrays, castArrayLikeObject);
8674 return (mapped.length && mapped[0] === arrays[0])
8675 ? baseIntersection(mapped)
8680 * This method is like `_.intersection` except that it accepts `iteratee`
8681 * which is invoked for each element of each `arrays` to generate the criterion
8682 * by which they're compared. The order and references of result values are
8683 * determined by the first array. The iteratee is invoked with one argument:
8690 * @param {...Array} [arrays] The arrays to inspect.
8691 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8692 * @returns {Array} Returns the new array of intersecting values.
8695 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
8698 * // The `_.property` iteratee shorthand.
8699 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
8700 * // => [{ 'x': 1 }]
8702 var intersectionBy = baseRest(function(arrays) {
8703 var iteratee = last(arrays),
8704 mapped = arrayMap(arrays, castArrayLikeObject);
8706 if (iteratee === last(mapped)) {
8707 iteratee = undefined;
8711 return (mapped.length && mapped[0] === arrays[0])
8712 ? baseIntersection(mapped, getIteratee(iteratee, 2))
8717 * This method is like `_.intersection` except that it accepts `comparator`
8718 * which is invoked to compare elements of `arrays`. The order and references
8719 * of result values are determined by the first array. The comparator is
8720 * invoked with two arguments: (arrVal, othVal).
8726 * @param {...Array} [arrays] The arrays to inspect.
8727 * @param {Function} [comparator] The comparator invoked per element.
8728 * @returns {Array} Returns the new array of intersecting values.
8731 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
8732 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
8734 * _.intersectionWith(objects, others, _.isEqual);
8735 * // => [{ 'x': 1, 'y': 2 }]
8737 var intersectionWith = baseRest(function(arrays) {
8738 var comparator = last(arrays),
8739 mapped = arrayMap(arrays, castArrayLikeObject);
8741 comparator = typeof comparator == 'function' ? comparator : undefined;
8745 return (mapped.length && mapped[0] === arrays[0])
8746 ? baseIntersection(mapped, undefined, comparator)
8751 * Converts all elements in `array` into a string separated by `separator`.
8757 * @param {Array} array The array to convert.
8758 * @param {string} [separator=','] The element separator.
8759 * @returns {string} Returns the joined string.
8762 * _.join(['a', 'b', 'c'], '~');
8765 function join(array, separator) {
8766 return array == null ? '' : nativeJoin.call(array, separator);
8770 * Gets the last element of `array`.
8776 * @param {Array} array The array to query.
8777 * @returns {*} Returns the last element of `array`.
8780 * _.last([1, 2, 3]);
8783 function last(array) {
8784 var length = array == null ? 0 : array.length;
8785 return length ? array[length - 1] : undefined;
8789 * This method is like `_.indexOf` except that it iterates over elements of
8790 * `array` from right to left.
8796 * @param {Array} array The array to inspect.
8797 * @param {*} value The value to search for.
8798 * @param {number} [fromIndex=array.length-1] The index to search from.
8799 * @returns {number} Returns the index of the matched value, else `-1`.
8802 * _.lastIndexOf([1, 2, 1, 2], 2);
8805 * // Search from the `fromIndex`.
8806 * _.lastIndexOf([1, 2, 1, 2], 2, 2);
8809 function lastIndexOf(array, value, fromIndex) {
8810 var length = array == null ? 0 : array.length;
8815 if (fromIndex !== undefined) {
8816 index = toInteger(fromIndex);
8817 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
8819 return value === value
8820 ? strictLastIndexOf(array, value, index)
8821 : baseFindIndex(array, baseIsNaN, index, true);
8825 * Gets the element at index `n` of `array`. If `n` is negative, the nth
8826 * element from the end is returned.
8832 * @param {Array} array The array to query.
8833 * @param {number} [n=0] The index of the element to return.
8834 * @returns {*} Returns the nth element of `array`.
8837 * var array = ['a', 'b', 'c', 'd'];
8845 function nth(array, n) {
8846 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
8850 * Removes all given values from `array` using
8851 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
8852 * for equality comparisons.
8854 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
8855 * to remove elements from an array by predicate.
8861 * @param {Array} array The array to modify.
8862 * @param {...*} [values] The values to remove.
8863 * @returns {Array} Returns `array`.
8866 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
8868 * _.pull(array, 'a', 'c');
8869 * console.log(array);
8872 var pull = baseRest(pullAll);
8875 * This method is like `_.pull` except that it accepts an array of values to remove.
8877 * **Note:** Unlike `_.difference`, this method mutates `array`.
8883 * @param {Array} array The array to modify.
8884 * @param {Array} values The values to remove.
8885 * @returns {Array} Returns `array`.
8888 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
8890 * _.pullAll(array, ['a', 'c']);
8891 * console.log(array);
8894 function pullAll(array, values) {
8895 return (array && array.length && values && values.length)
8896 ? basePullAll(array, values)
8901 * This method is like `_.pullAll` except that it accepts `iteratee` which is
8902 * invoked for each element of `array` and `values` to generate the criterion
8903 * by which they're compared. The iteratee is invoked with one argument: (value).
8905 * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
8911 * @param {Array} array The array to modify.
8912 * @param {Array} values The values to remove.
8913 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
8914 * @returns {Array} Returns `array`.
8917 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
8919 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
8920 * console.log(array);
8921 * // => [{ 'x': 2 }]
8923 function pullAllBy(array, values, iteratee) {
8924 return (array && array.length && values && values.length)
8925 ? basePullAll(array, values, getIteratee(iteratee, 2))
8930 * This method is like `_.pullAll` except that it accepts `comparator` which
8931 * is invoked to compare elements of `array` to `values`. The comparator is
8932 * invoked with two arguments: (arrVal, othVal).
8934 * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
8940 * @param {Array} array The array to modify.
8941 * @param {Array} values The values to remove.
8942 * @param {Function} [comparator] The comparator invoked per element.
8943 * @returns {Array} Returns `array`.
8946 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
8948 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
8949 * console.log(array);
8950 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
8952 function pullAllWith(array, values, comparator) {
8953 return (array && array.length && values && values.length)
8954 ? basePullAll(array, values, undefined, comparator)
8959 * Removes elements from `array` corresponding to `indexes` and returns an
8960 * array of removed elements.
8962 * **Note:** Unlike `_.at`, this method mutates `array`.
8968 * @param {Array} array The array to modify.
8969 * @param {...(number|number[])} [indexes] The indexes of elements to remove.
8970 * @returns {Array} Returns the new array of removed elements.
8973 * var array = ['a', 'b', 'c', 'd'];
8974 * var pulled = _.pullAt(array, [1, 3]);
8976 * console.log(array);
8979 * console.log(pulled);
8982 var pullAt = flatRest(function(array, indexes) {
8983 var length = array == null ? 0 : array.length,
8984 result = baseAt(array, indexes);
8986 basePullAt(array, arrayMap(indexes, function(index) {
8987 return isIndex(index, length) ? +index : index;
8988 }).sort(compareAscending));
8994 * Removes all elements from `array` that `predicate` returns truthy for
8995 * and returns an array of the removed elements. The predicate is invoked
8996 * with three arguments: (value, index, array).
8998 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
8999 * to pull elements from an array by value.
9005 * @param {Array} array The array to modify.
9006 * @param {Function} [predicate=_.identity] The function invoked per iteration.
9007 * @returns {Array} Returns the new array of removed elements.
9010 * var array = [1, 2, 3, 4];
9011 * var evens = _.remove(array, function(n) {
9012 * return n % 2 == 0;
9015 * console.log(array);
9018 * console.log(evens);
9021 function remove(array, predicate) {
9023 if (!(array && array.length)) {
9028 length = array.length;
9030 predicate = getIteratee(predicate, 3);
9031 while (++index < length) {
9032 var value = array[index];
9033 if (predicate(value, index, array)) {
9035 indexes.push(index);
9038 basePullAt(array, indexes);
9043 * Reverses `array` so that the first element becomes the last, the second
9044 * element becomes the second to last, and so on.
9046 * **Note:** This method mutates `array` and is based on
9047 * [`Array#reverse`](https://mdn.io/Array/reverse).
9053 * @param {Array} array The array to modify.
9054 * @returns {Array} Returns `array`.
9057 * var array = [1, 2, 3];
9062 * console.log(array);
9065 function reverse(array) {
9066 return array == null ? array : nativeReverse.call(array);
9070 * Creates a slice of `array` from `start` up to, but not including, `end`.
9072 * **Note:** This method is used instead of
9073 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
9080 * @param {Array} array The array to slice.
9081 * @param {number} [start=0] The start position.
9082 * @param {number} [end=array.length] The end position.
9083 * @returns {Array} Returns the slice of `array`.
9085 function slice(array, start, end) {
9086 var length = array == null ? 0 : array.length;
9090 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
9095 start = start == null ? 0 : toInteger(start);
9096 end = end === undefined ? length : toInteger(end);
9098 return baseSlice(array, start, end);
9102 * Uses a binary search to determine the lowest index at which `value`
9103 * should be inserted into `array` in order to maintain its sort order.
9109 * @param {Array} array The sorted array to inspect.
9110 * @param {*} value The value to evaluate.
9111 * @returns {number} Returns the index at which `value` should be inserted
9115 * _.sortedIndex([30, 50], 40);
9118 function sortedIndex(array, value) {
9119 return baseSortedIndex(array, value);
9123 * This method is like `_.sortedIndex` except that it accepts `iteratee`
9124 * which is invoked for `value` and each element of `array` to compute their
9125 * sort ranking. The iteratee is invoked with one argument: (value).
9131 * @param {Array} array The sorted array to inspect.
9132 * @param {*} value The value to evaluate.
9133 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
9134 * @returns {number} Returns the index at which `value` should be inserted
9138 * var objects = [{ 'x': 4 }, { 'x': 5 }];
9140 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
9143 * // The `_.property` iteratee shorthand.
9144 * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
9147 function sortedIndexBy(array, value, iteratee) {
9148 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
9152 * This method is like `_.indexOf` except that it performs a binary
9153 * search on a sorted `array`.
9159 * @param {Array} array The array to inspect.
9160 * @param {*} value The value to search for.
9161 * @returns {number} Returns the index of the matched value, else `-1`.
9164 * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
9167 function sortedIndexOf(array, value) {
9168 var length = array == null ? 0 : array.length;
9170 var index = baseSortedIndex(array, value);
9171 if (index < length && eq(array[index], value)) {
9179 * This method is like `_.sortedIndex` except that it returns the highest
9180 * index at which `value` should be inserted into `array` in order to
9181 * maintain its sort order.
9187 * @param {Array} array The sorted array to inspect.
9188 * @param {*} value The value to evaluate.
9189 * @returns {number} Returns the index at which `value` should be inserted
9193 * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
9196 function sortedLastIndex(array, value) {
9197 return baseSortedIndex(array, value, true);
9201 * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
9202 * which is invoked for `value` and each element of `array` to compute their
9203 * sort ranking. The iteratee is invoked with one argument: (value).
9209 * @param {Array} array The sorted array to inspect.
9210 * @param {*} value The value to evaluate.
9211 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
9212 * @returns {number} Returns the index at which `value` should be inserted
9216 * var objects = [{ 'x': 4 }, { 'x': 5 }];
9218 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
9221 * // The `_.property` iteratee shorthand.
9222 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
9225 function sortedLastIndexBy(array, value, iteratee) {
9226 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
9230 * This method is like `_.lastIndexOf` except that it performs a binary
9231 * search on a sorted `array`.
9237 * @param {Array} array The array to inspect.
9238 * @param {*} value The value to search for.
9239 * @returns {number} Returns the index of the matched value, else `-1`.
9242 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
9245 function sortedLastIndexOf(array, value) {
9246 var length = array == null ? 0 : array.length;
9248 var index = baseSortedIndex(array, value, true) - 1;
9249 if (eq(array[index], value)) {
9257 * This method is like `_.uniq` except that it's designed and optimized
9258 * for sorted arrays.
9264 * @param {Array} array The array to inspect.
9265 * @returns {Array} Returns the new duplicate free array.
9268 * _.sortedUniq([1, 1, 2]);
9271 function sortedUniq(array) {
9272 return (array && array.length)
9273 ? baseSortedUniq(array)
9278 * This method is like `_.uniqBy` except that it's designed and optimized
9279 * for sorted arrays.
9285 * @param {Array} array The array to inspect.
9286 * @param {Function} [iteratee] The iteratee invoked per element.
9287 * @returns {Array} Returns the new duplicate free array.
9290 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
9293 function sortedUniqBy(array, iteratee) {
9294 return (array && array.length)
9295 ? baseSortedUniq(array, getIteratee(iteratee, 2))
9300 * Gets all but the first element of `array`.
9306 * @param {Array} array The array to query.
9307 * @returns {Array} Returns the slice of `array`.
9310 * _.tail([1, 2, 3]);
9313 function tail(array) {
9314 var length = array == null ? 0 : array.length;
9315 return length ? baseSlice(array, 1, length) : [];
9319 * Creates a slice of `array` with `n` elements taken from the beginning.
9325 * @param {Array} array The array to query.
9326 * @param {number} [n=1] The number of elements to take.
9327 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
9328 * @returns {Array} Returns the slice of `array`.
9331 * _.take([1, 2, 3]);
9334 * _.take([1, 2, 3], 2);
9337 * _.take([1, 2, 3], 5);
9340 * _.take([1, 2, 3], 0);
9343 function take(array, n, guard) {
9344 if (!(array && array.length)) {
9347 n = (guard || n === undefined) ? 1 : toInteger(n);
9348 return baseSlice(array, 0, n < 0 ? 0 : n);
9352 * Creates a slice of `array` with `n` elements taken from the end.
9358 * @param {Array} array The array to query.
9359 * @param {number} [n=1] The number of elements to take.
9360 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
9361 * @returns {Array} Returns the slice of `array`.
9364 * _.takeRight([1, 2, 3]);
9367 * _.takeRight([1, 2, 3], 2);
9370 * _.takeRight([1, 2, 3], 5);
9373 * _.takeRight([1, 2, 3], 0);
9376 function takeRight(array, n, guard) {
9377 var length = array == null ? 0 : array.length;
9381 n = (guard || n === undefined) ? 1 : toInteger(n);
9383 return baseSlice(array, n < 0 ? 0 : n, length);
9387 * Creates a slice of `array` with elements taken from the end. Elements are
9388 * taken until `predicate` returns falsey. The predicate is invoked with
9389 * three arguments: (value, index, array).
9395 * @param {Array} array The array to query.
9396 * @param {Function} [predicate=_.identity] The function invoked per iteration.
9397 * @returns {Array} Returns the slice of `array`.
9401 * { 'user': 'barney', 'active': true },
9402 * { 'user': 'fred', 'active': false },
9403 * { 'user': 'pebbles', 'active': false }
9406 * _.takeRightWhile(users, function(o) { return !o.active; });
9407 * // => objects for ['fred', 'pebbles']
9409 * // The `_.matches` iteratee shorthand.
9410 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
9411 * // => objects for ['pebbles']
9413 * // The `_.matchesProperty` iteratee shorthand.
9414 * _.takeRightWhile(users, ['active', false]);
9415 * // => objects for ['fred', 'pebbles']
9417 * // The `_.property` iteratee shorthand.
9418 * _.takeRightWhile(users, 'active');
9421 function takeRightWhile(array, predicate) {
9422 return (array && array.length)
9423 ? baseWhile(array, getIteratee(predicate, 3), false, true)
9428 * Creates a slice of `array` with elements taken from the beginning. Elements
9429 * are taken until `predicate` returns falsey. The predicate is invoked with
9430 * three arguments: (value, index, array).
9436 * @param {Array} array The array to query.
9437 * @param {Function} [predicate=_.identity] The function invoked per iteration.
9438 * @returns {Array} Returns the slice of `array`.
9442 * { 'user': 'barney', 'active': false },
9443 * { 'user': 'fred', 'active': false },
9444 * { 'user': 'pebbles', 'active': true }
9447 * _.takeWhile(users, function(o) { return !o.active; });
9448 * // => objects for ['barney', 'fred']
9450 * // The `_.matches` iteratee shorthand.
9451 * _.takeWhile(users, { 'user': 'barney', 'active': false });
9452 * // => objects for ['barney']
9454 * // The `_.matchesProperty` iteratee shorthand.
9455 * _.takeWhile(users, ['active', false]);
9456 * // => objects for ['barney', 'fred']
9458 * // The `_.property` iteratee shorthand.
9459 * _.takeWhile(users, 'active');
9462 function takeWhile(array, predicate) {
9463 return (array && array.length)
9464 ? baseWhile(array, getIteratee(predicate, 3))
9469 * Creates an array of unique values, in order, from all given arrays using
9470 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
9471 * for equality comparisons.
9477 * @param {...Array} [arrays] The arrays to inspect.
9478 * @returns {Array} Returns the new array of combined values.
9481 * _.union([2], [1, 2]);
9484 var union = baseRest(function(arrays) {
9485 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
9489 * This method is like `_.union` except that it accepts `iteratee` which is
9490 * invoked for each element of each `arrays` to generate the criterion by
9491 * which uniqueness is computed. Result values are chosen from the first
9492 * array in which the value occurs. The iteratee is invoked with one argument:
9499 * @param {...Array} [arrays] The arrays to inspect.
9500 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
9501 * @returns {Array} Returns the new array of combined values.
9504 * _.unionBy([2.1], [1.2, 2.3], Math.floor);
9507 * // The `_.property` iteratee shorthand.
9508 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
9509 * // => [{ 'x': 1 }, { 'x': 2 }]
9511 var unionBy = baseRest(function(arrays) {
9512 var iteratee = last(arrays);
9513 if (isArrayLikeObject(iteratee)) {
9514 iteratee = undefined;
9516 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
9520 * This method is like `_.union` except that it accepts `comparator` which
9521 * is invoked to compare elements of `arrays`. Result values are chosen from
9522 * the first array in which the value occurs. The comparator is invoked
9523 * with two arguments: (arrVal, othVal).
9529 * @param {...Array} [arrays] The arrays to inspect.
9530 * @param {Function} [comparator] The comparator invoked per element.
9531 * @returns {Array} Returns the new array of combined values.
9534 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
9535 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
9537 * _.unionWith(objects, others, _.isEqual);
9538 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
9540 var unionWith = baseRest(function(arrays) {
9541 var comparator = last(arrays);
9542 comparator = typeof comparator == 'function' ? comparator : undefined;
9543 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
9547 * Creates a duplicate-free version of an array, using
9548 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
9549 * for equality comparisons, in which only the first occurrence of each element
9550 * is kept. The order of result values is determined by the order they occur
9557 * @param {Array} array The array to inspect.
9558 * @returns {Array} Returns the new duplicate free array.
9561 * _.uniq([2, 1, 2]);
9564 function uniq(array) {
9565 return (array && array.length) ? baseUniq(array) : [];
9569 * This method is like `_.uniq` except that it accepts `iteratee` which is
9570 * invoked for each element in `array` to generate the criterion by which
9571 * uniqueness is computed. The order of result values is determined by the
9572 * order they occur in the array. The iteratee is invoked with one argument:
9579 * @param {Array} array The array to inspect.
9580 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
9581 * @returns {Array} Returns the new duplicate free array.
9584 * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
9587 * // The `_.property` iteratee shorthand.
9588 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
9589 * // => [{ 'x': 1 }, { 'x': 2 }]
9591 function uniqBy(array, iteratee) {
9592 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
9596 * This method is like `_.uniq` except that it accepts `comparator` which
9597 * is invoked to compare elements of `array`. The order of result values is
9598 * determined by the order they occur in the array.The comparator is invoked
9599 * with two arguments: (arrVal, othVal).
9605 * @param {Array} array The array to inspect.
9606 * @param {Function} [comparator] The comparator invoked per element.
9607 * @returns {Array} Returns the new duplicate free array.
9610 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
9612 * _.uniqWith(objects, _.isEqual);
9613 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
9615 function uniqWith(array, comparator) {
9616 comparator = typeof comparator == 'function' ? comparator : undefined;
9617 return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
9621 * This method is like `_.zip` except that it accepts an array of grouped
9622 * elements and creates an array regrouping the elements to their pre-zip
9629 * @param {Array} array The array of grouped elements to process.
9630 * @returns {Array} Returns the new array of regrouped elements.
9633 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
9634 * // => [['a', 1, true], ['b', 2, false]]
9637 * // => [['a', 'b'], [1, 2], [true, false]]
9639 function unzip(array) {
9640 if (!(array && array.length)) {
9644 array = arrayFilter(array, function(group) {
9645 if (isArrayLikeObject(group)) {
9646 length = nativeMax(group.length, length);
9650 return baseTimes(length, function(index) {
9651 return arrayMap(array, baseProperty(index));
9656 * This method is like `_.unzip` except that it accepts `iteratee` to specify
9657 * how regrouped values should be combined. The iteratee is invoked with the
9658 * elements of each group: (...group).
9664 * @param {Array} array The array of grouped elements to process.
9665 * @param {Function} [iteratee=_.identity] The function to combine
9667 * @returns {Array} Returns the new array of regrouped elements.
9670 * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
9671 * // => [[1, 10, 100], [2, 20, 200]]
9673 * _.unzipWith(zipped, _.add);
9674 * // => [3, 30, 300]
9676 function unzipWith(array, iteratee) {
9677 if (!(array && array.length)) {
9680 var result = unzip(array);
9681 if (iteratee == null) {
9684 return arrayMap(result, function(group) {
9685 return apply(iteratee, undefined, group);
9690 * Creates an array excluding all given values using
9691 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
9692 * for equality comparisons.
9694 * **Note:** Unlike `_.pull`, this method returns a new array.
9700 * @param {Array} array The array to inspect.
9701 * @param {...*} [values] The values to exclude.
9702 * @returns {Array} Returns the new array of filtered values.
9703 * @see _.difference, _.xor
9706 * _.without([2, 1, 2, 3], 1, 2);
9709 var without = baseRest(function(array, values) {
9710 return isArrayLikeObject(array)
9711 ? baseDifference(array, values)
9716 * Creates an array of unique values that is the
9717 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
9718 * of the given arrays. The order of result values is determined by the order
9719 * they occur in the arrays.
9725 * @param {...Array} [arrays] The arrays to inspect.
9726 * @returns {Array} Returns the new array of filtered values.
9727 * @see _.difference, _.without
9730 * _.xor([2, 1], [2, 3]);
9733 var xor = baseRest(function(arrays) {
9734 return baseXor(arrayFilter(arrays, isArrayLikeObject));
9738 * This method is like `_.xor` except that it accepts `iteratee` which is
9739 * invoked for each element of each `arrays` to generate the criterion by
9740 * which by which they're compared. The order of result values is determined
9741 * by the order they occur in the arrays. The iteratee is invoked with one
9742 * argument: (value).
9748 * @param {...Array} [arrays] The arrays to inspect.
9749 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
9750 * @returns {Array} Returns the new array of filtered values.
9753 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
9756 * // The `_.property` iteratee shorthand.
9757 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
9758 * // => [{ 'x': 2 }]
9760 var xorBy = baseRest(function(arrays) {
9761 var iteratee = last(arrays);
9762 if (isArrayLikeObject(iteratee)) {
9763 iteratee = undefined;
9765 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
9769 * This method is like `_.xor` except that it accepts `comparator` which is
9770 * invoked to compare elements of `arrays`. The order of result values is
9771 * determined by the order they occur in the arrays. The comparator is invoked
9772 * with two arguments: (arrVal, othVal).
9778 * @param {...Array} [arrays] The arrays to inspect.
9779 * @param {Function} [comparator] The comparator invoked per element.
9780 * @returns {Array} Returns the new array of filtered values.
9783 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
9784 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
9786 * _.xorWith(objects, others, _.isEqual);
9787 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
9789 var xorWith = baseRest(function(arrays) {
9790 var comparator = last(arrays);
9791 comparator = typeof comparator == 'function' ? comparator : undefined;
9792 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
9796 * Creates an array of grouped elements, the first of which contains the
9797 * first elements of the given arrays, the second of which contains the
9798 * second elements of the given arrays, and so on.
9804 * @param {...Array} [arrays] The arrays to process.
9805 * @returns {Array} Returns the new array of grouped elements.
9808 * _.zip(['a', 'b'], [1, 2], [true, false]);
9809 * // => [['a', 1, true], ['b', 2, false]]
9811 var zip = baseRest(unzip);
9814 * This method is like `_.fromPairs` except that it accepts two arrays,
9815 * one of property identifiers and one of corresponding values.
9821 * @param {Array} [props=[]] The property identifiers.
9822 * @param {Array} [values=[]] The property values.
9823 * @returns {Object} Returns the new object.
9826 * _.zipObject(['a', 'b'], [1, 2]);
9827 * // => { 'a': 1, 'b': 2 }
9829 function zipObject(props, values) {
9830 return baseZipObject(props || [], values || [], assignValue);
9834 * This method is like `_.zipObject` except that it supports property paths.
9840 * @param {Array} [props=[]] The property identifiers.
9841 * @param {Array} [values=[]] The property values.
9842 * @returns {Object} Returns the new object.
9845 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
9846 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
9848 function zipObjectDeep(props, values) {
9849 return baseZipObject(props || [], values || [], baseSet);
9853 * This method is like `_.zip` except that it accepts `iteratee` to specify
9854 * how grouped values should be combined. The iteratee is invoked with the
9855 * elements of each group: (...group).
9861 * @param {...Array} [arrays] The arrays to process.
9862 * @param {Function} [iteratee=_.identity] The function to combine
9864 * @returns {Array} Returns the new array of grouped elements.
9867 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
9872 var zipWith = baseRest(function(arrays) {
9873 var length = arrays.length,
9874 iteratee = length > 1 ? arrays[length - 1] : undefined;
9876 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
9877 return unzipWith(arrays, iteratee);
9880 /*------------------------------------------------------------------------*/
9883 * Creates a `lodash` wrapper instance that wraps `value` with explicit method
9884 * chain sequences enabled. The result of such sequences must be unwrapped
9891 * @param {*} value The value to wrap.
9892 * @returns {Object} Returns the new `lodash` wrapper instance.
9896 * { 'user': 'barney', 'age': 36 },
9897 * { 'user': 'fred', 'age': 40 },
9898 * { 'user': 'pebbles', 'age': 1 }
9904 * .map(function(o) {
9905 * return o.user + ' is ' + o.age;
9909 * // => 'pebbles is 1'
9911 function chain(value) {
9912 var result = lodash(value);
9913 result.__chain__ = true;
9918 * This method invokes `interceptor` and returns `value`. The interceptor
9919 * is invoked with one argument; (value). The purpose of this method is to
9920 * "tap into" a method chain sequence in order to modify intermediate results.
9926 * @param {*} value The value to provide to `interceptor`.
9927 * @param {Function} interceptor The function to invoke.
9928 * @returns {*} Returns `value`.
9932 * .tap(function(array) {
9933 * // Mutate input array.
9940 function tap(value, interceptor) {
9946 * This method is like `_.tap` except that it returns the result of `interceptor`.
9947 * The purpose of this method is to "pass thru" values replacing intermediate
9948 * results in a method chain sequence.
9954 * @param {*} value The value to provide to `interceptor`.
9955 * @param {Function} interceptor The function to invoke.
9956 * @returns {*} Returns the result of `interceptor`.
9962 * .thru(function(value) {
9968 function thru(value, interceptor) {
9969 return interceptor(value);
9973 * This method is the wrapper version of `_.at`.
9979 * @param {...(string|string[])} [paths] The property paths to pick.
9980 * @returns {Object} Returns the new `lodash` wrapper instance.
9983 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
9985 * _(object).at(['a[0].b.c', 'a[1]']).value();
9988 var wrapperAt = flatRest(function(paths) {
9989 var length = paths.length,
9990 start = length ? paths[0] : 0,
9991 value = this.__wrapped__,
9992 interceptor = function(object) { return baseAt(object, paths); };
9994 if (length > 1 || this.__actions__.length ||
9995 !(value instanceof LazyWrapper) || !isIndex(start)) {
9996 return this.thru(interceptor);
9998 value = value.slice(start, +start + (length ? 1 : 0));
9999 value.__actions__.push({
10001 'args': [interceptor],
10002 'thisArg': undefined
10004 return new LodashWrapper(value, this.__chain__).thru(function(array) {
10005 if (length && !array.length) {
10006 array.push(undefined);
10013 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
10019 * @returns {Object} Returns the new `lodash` wrapper instance.
10023 * { 'user': 'barney', 'age': 36 },
10024 * { 'user': 'fred', 'age': 40 }
10027 * // A sequence without explicit chaining.
10029 * // => { 'user': 'barney', 'age': 36 }
10031 * // A sequence with explicit chaining.
10037 * // => { 'user': 'barney' }
10039 function wrapperChain() {
10040 return chain(this);
10044 * Executes the chain sequence and returns the wrapped result.
10050 * @returns {Object} Returns the new `lodash` wrapper instance.
10053 * var array = [1, 2];
10054 * var wrapped = _(array).push(3);
10056 * console.log(array);
10059 * wrapped = wrapped.commit();
10060 * console.log(array);
10066 * console.log(array);
10069 function wrapperCommit() {
10070 return new LodashWrapper(this.value(), this.__chain__);
10074 * Gets the next value on a wrapped object following the
10075 * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
10081 * @returns {Object} Returns the next iterator value.
10084 * var wrapped = _([1, 2]);
10087 * // => { 'done': false, 'value': 1 }
10090 * // => { 'done': false, 'value': 2 }
10093 * // => { 'done': true, 'value': undefined }
10095 function wrapperNext() {
10096 if (this.__values__ === undefined) {
10097 this.__values__ = toArray(this.value());
10099 var done = this.__index__ >= this.__values__.length,
10100 value = done ? undefined : this.__values__[this.__index__++];
10102 return { 'done': done, 'value': value };
10106 * Enables the wrapper to be iterable.
10108 * @name Symbol.iterator
10112 * @returns {Object} Returns the wrapper object.
10115 * var wrapped = _([1, 2]);
10117 * wrapped[Symbol.iterator]() === wrapped;
10120 * Array.from(wrapped);
10123 function wrapperToIterator() {
10128 * Creates a clone of the chain sequence planting `value` as the wrapped value.
10134 * @param {*} value The value to plant.
10135 * @returns {Object} Returns the new `lodash` wrapper instance.
10138 * function square(n) {
10142 * var wrapped = _([1, 2]).map(square);
10143 * var other = wrapped.plant([3, 4]);
10151 function wrapperPlant(value) {
10155 while (parent instanceof baseLodash) {
10156 var clone = wrapperClone(parent);
10157 clone.__index__ = 0;
10158 clone.__values__ = undefined;
10160 previous.__wrapped__ = clone;
10164 var previous = clone;
10165 parent = parent.__wrapped__;
10167 previous.__wrapped__ = value;
10172 * This method is the wrapper version of `_.reverse`.
10174 * **Note:** This method mutates the wrapped array.
10180 * @returns {Object} Returns the new `lodash` wrapper instance.
10183 * var array = [1, 2, 3];
10185 * _(array).reverse().value()
10188 * console.log(array);
10191 function wrapperReverse() {
10192 var value = this.__wrapped__;
10193 if (value instanceof LazyWrapper) {
10194 var wrapped = value;
10195 if (this.__actions__.length) {
10196 wrapped = new LazyWrapper(this);
10198 wrapped = wrapped.reverse();
10199 wrapped.__actions__.push({
10202 'thisArg': undefined
10204 return new LodashWrapper(wrapped, this.__chain__);
10206 return this.thru(reverse);
10210 * Executes the chain sequence to resolve the unwrapped value.
10215 * @alias toJSON, valueOf
10217 * @returns {*} Returns the resolved unwrapped value.
10220 * _([1, 2, 3]).value();
10223 function wrapperValue() {
10224 return baseWrapperValue(this.__wrapped__, this.__actions__);
10227 /*------------------------------------------------------------------------*/
10230 * Creates an object composed of keys generated from the results of running
10231 * each element of `collection` thru `iteratee`. The corresponding value of
10232 * each key is the number of times the key was returned by `iteratee`. The
10233 * iteratee is invoked with one argument: (value).
10238 * @category Collection
10239 * @param {Array|Object} collection The collection to iterate over.
10240 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
10241 * @returns {Object} Returns the composed aggregate object.
10244 * _.countBy([6.1, 4.2, 6.3], Math.floor);
10245 * // => { '4': 1, '6': 2 }
10247 * // The `_.property` iteratee shorthand.
10248 * _.countBy(['one', 'two', 'three'], 'length');
10249 * // => { '3': 2, '5': 1 }
10251 var countBy = createAggregator(function(result, value, key) {
10252 if (hasOwnProperty.call(result, key)) {
10255 baseAssignValue(result, key, 1);
10260 * Checks if `predicate` returns truthy for **all** elements of `collection`.
10261 * Iteration is stopped once `predicate` returns falsey. The predicate is
10262 * invoked with three arguments: (value, index|key, collection).
10264 * **Note:** This method returns `true` for
10265 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
10266 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
10267 * elements of empty collections.
10272 * @category Collection
10273 * @param {Array|Object} collection The collection to iterate over.
10274 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10275 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
10276 * @returns {boolean} Returns `true` if all elements pass the predicate check,
10280 * _.every([true, 1, null, 'yes'], Boolean);
10284 * { 'user': 'barney', 'age': 36, 'active': false },
10285 * { 'user': 'fred', 'age': 40, 'active': false }
10288 * // The `_.matches` iteratee shorthand.
10289 * _.every(users, { 'user': 'barney', 'active': false });
10292 * // The `_.matchesProperty` iteratee shorthand.
10293 * _.every(users, ['active', false]);
10296 * // The `_.property` iteratee shorthand.
10297 * _.every(users, 'active');
10300 function every(collection, predicate, guard) {
10301 var func = isArray(collection) ? arrayEvery : baseEvery;
10302 if (guard && isIterateeCall(collection, predicate, guard)) {
10303 predicate = undefined;
10305 return func(collection, getIteratee(predicate, 3));
10309 * Iterates over elements of `collection`, returning an array of all elements
10310 * `predicate` returns truthy for. The predicate is invoked with three
10311 * arguments: (value, index|key, collection).
10313 * **Note:** Unlike `_.remove`, this method returns a new array.
10318 * @category Collection
10319 * @param {Array|Object} collection The collection to iterate over.
10320 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10321 * @returns {Array} Returns the new filtered array.
10326 * { 'user': 'barney', 'age': 36, 'active': true },
10327 * { 'user': 'fred', 'age': 40, 'active': false }
10330 * _.filter(users, function(o) { return !o.active; });
10331 * // => objects for ['fred']
10333 * // The `_.matches` iteratee shorthand.
10334 * _.filter(users, { 'age': 36, 'active': true });
10335 * // => objects for ['barney']
10337 * // The `_.matchesProperty` iteratee shorthand.
10338 * _.filter(users, ['active', false]);
10339 * // => objects for ['fred']
10341 * // The `_.property` iteratee shorthand.
10342 * _.filter(users, 'active');
10343 * // => objects for ['barney']
10345 * // Combining several predicates using `_.overEvery` or `_.overSome`.
10346 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
10347 * // => objects for ['fred', 'barney']
10349 function filter(collection, predicate) {
10350 var func = isArray(collection) ? arrayFilter : baseFilter;
10351 return func(collection, getIteratee(predicate, 3));
10355 * Iterates over elements of `collection`, returning the first element
10356 * `predicate` returns truthy for. The predicate is invoked with three
10357 * arguments: (value, index|key, collection).
10362 * @category Collection
10363 * @param {Array|Object} collection The collection to inspect.
10364 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10365 * @param {number} [fromIndex=0] The index to search from.
10366 * @returns {*} Returns the matched element, else `undefined`.
10370 * { 'user': 'barney', 'age': 36, 'active': true },
10371 * { 'user': 'fred', 'age': 40, 'active': false },
10372 * { 'user': 'pebbles', 'age': 1, 'active': true }
10375 * _.find(users, function(o) { return o.age < 40; });
10376 * // => object for 'barney'
10378 * // The `_.matches` iteratee shorthand.
10379 * _.find(users, { 'age': 1, 'active': true });
10380 * // => object for 'pebbles'
10382 * // The `_.matchesProperty` iteratee shorthand.
10383 * _.find(users, ['active', false]);
10384 * // => object for 'fred'
10386 * // The `_.property` iteratee shorthand.
10387 * _.find(users, 'active');
10388 * // => object for 'barney'
10390 var find = createFind(findIndex);
10393 * This method is like `_.find` except that it iterates over elements of
10394 * `collection` from right to left.
10399 * @category Collection
10400 * @param {Array|Object} collection The collection to inspect.
10401 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10402 * @param {number} [fromIndex=collection.length-1] The index to search from.
10403 * @returns {*} Returns the matched element, else `undefined`.
10406 * _.findLast([1, 2, 3, 4], function(n) {
10407 * return n % 2 == 1;
10411 var findLast = createFind(findLastIndex);
10414 * Creates a flattened array of values by running each element in `collection`
10415 * thru `iteratee` and flattening the mapped results. The iteratee is invoked
10416 * with three arguments: (value, index|key, collection).
10421 * @category Collection
10422 * @param {Array|Object} collection The collection to iterate over.
10423 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10424 * @returns {Array} Returns the new flattened array.
10427 * function duplicate(n) {
10431 * _.flatMap([1, 2], duplicate);
10432 * // => [1, 1, 2, 2]
10434 function flatMap(collection, iteratee) {
10435 return baseFlatten(map(collection, iteratee), 1);
10439 * This method is like `_.flatMap` except that it recursively flattens the
10445 * @category Collection
10446 * @param {Array|Object} collection The collection to iterate over.
10447 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10448 * @returns {Array} Returns the new flattened array.
10451 * function duplicate(n) {
10452 * return [[[n, n]]];
10455 * _.flatMapDeep([1, 2], duplicate);
10456 * // => [1, 1, 2, 2]
10458 function flatMapDeep(collection, iteratee) {
10459 return baseFlatten(map(collection, iteratee), INFINITY);
10463 * This method is like `_.flatMap` except that it recursively flattens the
10464 * mapped results up to `depth` times.
10469 * @category Collection
10470 * @param {Array|Object} collection The collection to iterate over.
10471 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10472 * @param {number} [depth=1] The maximum recursion depth.
10473 * @returns {Array} Returns the new flattened array.
10476 * function duplicate(n) {
10477 * return [[[n, n]]];
10480 * _.flatMapDepth([1, 2], duplicate, 2);
10481 * // => [[1, 1], [2, 2]]
10483 function flatMapDepth(collection, iteratee, depth) {
10484 depth = depth === undefined ? 1 : toInteger(depth);
10485 return baseFlatten(map(collection, iteratee), depth);
10489 * Iterates over elements of `collection` and invokes `iteratee` for each element.
10490 * The iteratee is invoked with three arguments: (value, index|key, collection).
10491 * Iteratee functions may exit iteration early by explicitly returning `false`.
10493 * **Note:** As with other "Collections" methods, objects with a "length"
10494 * property are iterated like arrays. To avoid this behavior use `_.forIn`
10495 * or `_.forOwn` for object iteration.
10501 * @category Collection
10502 * @param {Array|Object} collection The collection to iterate over.
10503 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10504 * @returns {Array|Object} Returns `collection`.
10505 * @see _.forEachRight
10508 * _.forEach([1, 2], function(value) {
10509 * console.log(value);
10511 * // => Logs `1` then `2`.
10513 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
10514 * console.log(key);
10516 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
10518 function forEach(collection, iteratee) {
10519 var func = isArray(collection) ? arrayEach : baseEach;
10520 return func(collection, getIteratee(iteratee, 3));
10524 * This method is like `_.forEach` except that it iterates over elements of
10525 * `collection` from right to left.
10531 * @category Collection
10532 * @param {Array|Object} collection The collection to iterate over.
10533 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10534 * @returns {Array|Object} Returns `collection`.
10538 * _.forEachRight([1, 2], function(value) {
10539 * console.log(value);
10541 * // => Logs `2` then `1`.
10543 function forEachRight(collection, iteratee) {
10544 var func = isArray(collection) ? arrayEachRight : baseEachRight;
10545 return func(collection, getIteratee(iteratee, 3));
10549 * Creates an object composed of keys generated from the results of running
10550 * each element of `collection` thru `iteratee`. The order of grouped values
10551 * is determined by the order they occur in `collection`. The corresponding
10552 * value of each key is an array of elements responsible for generating the
10553 * key. The iteratee is invoked with one argument: (value).
10558 * @category Collection
10559 * @param {Array|Object} collection The collection to iterate over.
10560 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
10561 * @returns {Object} Returns the composed aggregate object.
10564 * _.groupBy([6.1, 4.2, 6.3], Math.floor);
10565 * // => { '4': [4.2], '6': [6.1, 6.3] }
10567 * // The `_.property` iteratee shorthand.
10568 * _.groupBy(['one', 'two', 'three'], 'length');
10569 * // => { '3': ['one', 'two'], '5': ['three'] }
10571 var groupBy = createAggregator(function(result, value, key) {
10572 if (hasOwnProperty.call(result, key)) {
10573 result[key].push(value);
10575 baseAssignValue(result, key, [value]);
10580 * Checks if `value` is in `collection`. If `collection` is a string, it's
10581 * checked for a substring of `value`, otherwise
10582 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
10583 * is used for equality comparisons. If `fromIndex` is negative, it's used as
10584 * the offset from the end of `collection`.
10589 * @category Collection
10590 * @param {Array|Object|string} collection The collection to inspect.
10591 * @param {*} value The value to search for.
10592 * @param {number} [fromIndex=0] The index to search from.
10593 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
10594 * @returns {boolean} Returns `true` if `value` is found, else `false`.
10597 * _.includes([1, 2, 3], 1);
10600 * _.includes([1, 2, 3], 1, 2);
10603 * _.includes({ 'a': 1, 'b': 2 }, 1);
10606 * _.includes('abcd', 'bc');
10609 function includes(collection, value, fromIndex, guard) {
10610 collection = isArrayLike(collection) ? collection : values(collection);
10611 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
10613 var length = collection.length;
10614 if (fromIndex < 0) {
10615 fromIndex = nativeMax(length + fromIndex, 0);
10617 return isString(collection)
10618 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
10619 : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
10623 * Invokes the method at `path` of each element in `collection`, returning
10624 * an array of the results of each invoked method. Any additional arguments
10625 * are provided to each invoked method. If `path` is a function, it's invoked
10626 * for, and `this` bound to, each element in `collection`.
10631 * @category Collection
10632 * @param {Array|Object} collection The collection to iterate over.
10633 * @param {Array|Function|string} path The path of the method to invoke or
10634 * the function invoked per iteration.
10635 * @param {...*} [args] The arguments to invoke each method with.
10636 * @returns {Array} Returns the array of results.
10639 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
10640 * // => [[1, 5, 7], [1, 2, 3]]
10642 * _.invokeMap([123, 456], String.prototype.split, '');
10643 * // => [['1', '2', '3'], ['4', '5', '6']]
10645 var invokeMap = baseRest(function(collection, path, args) {
10647 isFunc = typeof path == 'function',
10648 result = isArrayLike(collection) ? Array(collection.length) : [];
10650 baseEach(collection, function(value) {
10651 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
10657 * Creates an object composed of keys generated from the results of running
10658 * each element of `collection` thru `iteratee`. The corresponding value of
10659 * each key is the last element responsible for generating the key. The
10660 * iteratee is invoked with one argument: (value).
10665 * @category Collection
10666 * @param {Array|Object} collection The collection to iterate over.
10667 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
10668 * @returns {Object} Returns the composed aggregate object.
10672 * { 'dir': 'left', 'code': 97 },
10673 * { 'dir': 'right', 'code': 100 }
10676 * _.keyBy(array, function(o) {
10677 * return String.fromCharCode(o.code);
10679 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
10681 * _.keyBy(array, 'dir');
10682 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
10684 var keyBy = createAggregator(function(result, value, key) {
10685 baseAssignValue(result, key, value);
10689 * Creates an array of values by running each element in `collection` thru
10690 * `iteratee`. The iteratee is invoked with three arguments:
10691 * (value, index|key, collection).
10693 * Many lodash methods are guarded to work as iteratees for methods like
10694 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
10696 * The guarded methods are:
10697 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
10698 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
10699 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
10700 * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
10705 * @category Collection
10706 * @param {Array|Object} collection The collection to iterate over.
10707 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10708 * @returns {Array} Returns the new mapped array.
10711 * function square(n) {
10715 * _.map([4, 8], square);
10718 * _.map({ 'a': 4, 'b': 8 }, square);
10719 * // => [16, 64] (iteration order is not guaranteed)
10722 * { 'user': 'barney' },
10723 * { 'user': 'fred' }
10726 * // The `_.property` iteratee shorthand.
10727 * _.map(users, 'user');
10728 * // => ['barney', 'fred']
10730 function map(collection, iteratee) {
10731 var func = isArray(collection) ? arrayMap : baseMap;
10732 return func(collection, getIteratee(iteratee, 3));
10736 * This method is like `_.sortBy` except that it allows specifying the sort
10737 * orders of the iteratees to sort by. If `orders` is unspecified, all values
10738 * are sorted in ascending order. Otherwise, specify an order of "desc" for
10739 * descending or "asc" for ascending sort order of corresponding values.
10744 * @category Collection
10745 * @param {Array|Object} collection The collection to iterate over.
10746 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
10747 * The iteratees to sort by.
10748 * @param {string[]} [orders] The sort orders of `iteratees`.
10749 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
10750 * @returns {Array} Returns the new sorted array.
10754 * { 'user': 'fred', 'age': 48 },
10755 * { 'user': 'barney', 'age': 34 },
10756 * { 'user': 'fred', 'age': 40 },
10757 * { 'user': 'barney', 'age': 36 }
10760 * // Sort by `user` in ascending order and by `age` in descending order.
10761 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
10762 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
10764 function orderBy(collection, iteratees, orders, guard) {
10765 if (collection == null) {
10768 if (!isArray(iteratees)) {
10769 iteratees = iteratees == null ? [] : [iteratees];
10771 orders = guard ? undefined : orders;
10772 if (!isArray(orders)) {
10773 orders = orders == null ? [] : [orders];
10775 return baseOrderBy(collection, iteratees, orders);
10779 * Creates an array of elements split into two groups, the first of which
10780 * contains elements `predicate` returns truthy for, the second of which
10781 * contains elements `predicate` returns falsey for. The predicate is
10782 * invoked with one argument: (value).
10787 * @category Collection
10788 * @param {Array|Object} collection The collection to iterate over.
10789 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10790 * @returns {Array} Returns the array of grouped elements.
10794 * { 'user': 'barney', 'age': 36, 'active': false },
10795 * { 'user': 'fred', 'age': 40, 'active': true },
10796 * { 'user': 'pebbles', 'age': 1, 'active': false }
10799 * _.partition(users, function(o) { return o.active; });
10800 * // => objects for [['fred'], ['barney', 'pebbles']]
10802 * // The `_.matches` iteratee shorthand.
10803 * _.partition(users, { 'age': 1, 'active': false });
10804 * // => objects for [['pebbles'], ['barney', 'fred']]
10806 * // The `_.matchesProperty` iteratee shorthand.
10807 * _.partition(users, ['active', false]);
10808 * // => objects for [['barney', 'pebbles'], ['fred']]
10810 * // The `_.property` iteratee shorthand.
10811 * _.partition(users, 'active');
10812 * // => objects for [['fred'], ['barney', 'pebbles']]
10814 var partition = createAggregator(function(result, value, key) {
10815 result[key ? 0 : 1].push(value);
10816 }, function() { return [[], []]; });
10819 * Reduces `collection` to a value which is the accumulated result of running
10820 * each element in `collection` thru `iteratee`, where each successive
10821 * invocation is supplied the return value of the previous. If `accumulator`
10822 * is not given, the first element of `collection` is used as the initial
10823 * value. The iteratee is invoked with four arguments:
10824 * (accumulator, value, index|key, collection).
10826 * Many lodash methods are guarded to work as iteratees for methods like
10827 * `_.reduce`, `_.reduceRight`, and `_.transform`.
10829 * The guarded methods are:
10830 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
10836 * @category Collection
10837 * @param {Array|Object} collection The collection to iterate over.
10838 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10839 * @param {*} [accumulator] The initial value.
10840 * @returns {*} Returns the accumulated value.
10841 * @see _.reduceRight
10844 * _.reduce([1, 2], function(sum, n) {
10849 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
10850 * (result[value] || (result[value] = [])).push(key);
10853 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
10855 function reduce(collection, iteratee, accumulator) {
10856 var func = isArray(collection) ? arrayReduce : baseReduce,
10857 initAccum = arguments.length < 3;
10859 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
10863 * This method is like `_.reduce` except that it iterates over elements of
10864 * `collection` from right to left.
10869 * @category Collection
10870 * @param {Array|Object} collection The collection to iterate over.
10871 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
10872 * @param {*} [accumulator] The initial value.
10873 * @returns {*} Returns the accumulated value.
10877 * var array = [[0, 1], [2, 3], [4, 5]];
10879 * _.reduceRight(array, function(flattened, other) {
10880 * return flattened.concat(other);
10882 * // => [4, 5, 2, 3, 0, 1]
10884 function reduceRight(collection, iteratee, accumulator) {
10885 var func = isArray(collection) ? arrayReduceRight : baseReduce,
10886 initAccum = arguments.length < 3;
10888 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
10892 * The opposite of `_.filter`; this method returns the elements of `collection`
10893 * that `predicate` does **not** return truthy for.
10898 * @category Collection
10899 * @param {Array|Object} collection The collection to iterate over.
10900 * @param {Function} [predicate=_.identity] The function invoked per iteration.
10901 * @returns {Array} Returns the new filtered array.
10906 * { 'user': 'barney', 'age': 36, 'active': false },
10907 * { 'user': 'fred', 'age': 40, 'active': true }
10910 * _.reject(users, function(o) { return !o.active; });
10911 * // => objects for ['fred']
10913 * // The `_.matches` iteratee shorthand.
10914 * _.reject(users, { 'age': 40, 'active': true });
10915 * // => objects for ['barney']
10917 * // The `_.matchesProperty` iteratee shorthand.
10918 * _.reject(users, ['active', false]);
10919 * // => objects for ['fred']
10921 * // The `_.property` iteratee shorthand.
10922 * _.reject(users, 'active');
10923 * // => objects for ['barney']
10925 function reject(collection, predicate) {
10926 var func = isArray(collection) ? arrayFilter : baseFilter;
10927 return func(collection, negate(getIteratee(predicate, 3)));
10931 * Gets a random element from `collection`.
10936 * @category Collection
10937 * @param {Array|Object} collection The collection to sample.
10938 * @returns {*} Returns the random element.
10941 * _.sample([1, 2, 3, 4]);
10944 function sample(collection) {
10945 var func = isArray(collection) ? arraySample : baseSample;
10946 return func(collection);
10950 * Gets `n` random elements at unique keys from `collection` up to the
10951 * size of `collection`.
10956 * @category Collection
10957 * @param {Array|Object} collection The collection to sample.
10958 * @param {number} [n=1] The number of elements to sample.
10959 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
10960 * @returns {Array} Returns the random elements.
10963 * _.sampleSize([1, 2, 3], 2);
10966 * _.sampleSize([1, 2, 3], 4);
10969 function sampleSize(collection, n, guard) {
10970 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
10975 var func = isArray(collection) ? arraySampleSize : baseSampleSize;
10976 return func(collection, n);
10980 * Creates an array of shuffled values, using a version of the
10981 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
10986 * @category Collection
10987 * @param {Array|Object} collection The collection to shuffle.
10988 * @returns {Array} Returns the new shuffled array.
10991 * _.shuffle([1, 2, 3, 4]);
10992 * // => [4, 1, 3, 2]
10994 function shuffle(collection) {
10995 var func = isArray(collection) ? arrayShuffle : baseShuffle;
10996 return func(collection);
11000 * Gets the size of `collection` by returning its length for array-like
11001 * values or the number of own enumerable string keyed properties for objects.
11006 * @category Collection
11007 * @param {Array|Object|string} collection The collection to inspect.
11008 * @returns {number} Returns the collection size.
11011 * _.size([1, 2, 3]);
11014 * _.size({ 'a': 1, 'b': 2 });
11017 * _.size('pebbles');
11020 function size(collection) {
11021 if (collection == null) {
11024 if (isArrayLike(collection)) {
11025 return isString(collection) ? stringSize(collection) : collection.length;
11027 var tag = getTag(collection);
11028 if (tag == mapTag || tag == setTag) {
11029 return collection.size;
11031 return baseKeys(collection).length;
11035 * Checks if `predicate` returns truthy for **any** element of `collection`.
11036 * Iteration is stopped once `predicate` returns truthy. The predicate is
11037 * invoked with three arguments: (value, index|key, collection).
11042 * @category Collection
11043 * @param {Array|Object} collection The collection to iterate over.
11044 * @param {Function} [predicate=_.identity] The function invoked per iteration.
11045 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
11046 * @returns {boolean} Returns `true` if any element passes the predicate check,
11050 * _.some([null, 0, 'yes', false], Boolean);
11054 * { 'user': 'barney', 'active': true },
11055 * { 'user': 'fred', 'active': false }
11058 * // The `_.matches` iteratee shorthand.
11059 * _.some(users, { 'user': 'barney', 'active': false });
11062 * // The `_.matchesProperty` iteratee shorthand.
11063 * _.some(users, ['active', false]);
11066 * // The `_.property` iteratee shorthand.
11067 * _.some(users, 'active');
11070 function some(collection, predicate, guard) {
11071 var func = isArray(collection) ? arraySome : baseSome;
11072 if (guard && isIterateeCall(collection, predicate, guard)) {
11073 predicate = undefined;
11075 return func(collection, getIteratee(predicate, 3));
11079 * Creates an array of elements, sorted in ascending order by the results of
11080 * running each element in a collection thru each iteratee. This method
11081 * performs a stable sort, that is, it preserves the original sort order of
11082 * equal elements. The iteratees are invoked with one argument: (value).
11087 * @category Collection
11088 * @param {Array|Object} collection The collection to iterate over.
11089 * @param {...(Function|Function[])} [iteratees=[_.identity]]
11090 * The iteratees to sort by.
11091 * @returns {Array} Returns the new sorted array.
11095 * { 'user': 'fred', 'age': 48 },
11096 * { 'user': 'barney', 'age': 36 },
11097 * { 'user': 'fred', 'age': 30 },
11098 * { 'user': 'barney', 'age': 34 }
11101 * _.sortBy(users, [function(o) { return o.user; }]);
11102 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
11104 * _.sortBy(users, ['user', 'age']);
11105 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
11107 var sortBy = baseRest(function(collection, iteratees) {
11108 if (collection == null) {
11111 var length = iteratees.length;
11112 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
11114 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
11115 iteratees = [iteratees[0]];
11117 return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
11120 /*------------------------------------------------------------------------*/
11123 * Gets the timestamp of the number of milliseconds that have elapsed since
11124 * the Unix epoch (1 January 1970 00:00:00 UTC).
11130 * @returns {number} Returns the timestamp.
11133 * _.defer(function(stamp) {
11134 * console.log(_.now() - stamp);
11136 * // => Logs the number of milliseconds it took for the deferred invocation.
11138 var now = ctxNow || function() {
11139 return root.Date.now();
11142 /*------------------------------------------------------------------------*/
11145 * The opposite of `_.before`; this method creates a function that invokes
11146 * `func` once it's called `n` or more times.
11151 * @category Function
11152 * @param {number} n The number of calls before `func` is invoked.
11153 * @param {Function} func The function to restrict.
11154 * @returns {Function} Returns the new restricted function.
11157 * var saves = ['profile', 'settings'];
11159 * var done = _.after(saves.length, function() {
11160 * console.log('done saving!');
11163 * _.forEach(saves, function(type) {
11164 * asyncSave({ 'type': type, 'complete': done });
11166 * // => Logs 'done saving!' after the two async saves have completed.
11168 function after(n, func) {
11169 if (typeof func != 'function') {
11170 throw new TypeError(FUNC_ERROR_TEXT);
11173 return function() {
11175 return func.apply(this, arguments);
11181 * Creates a function that invokes `func`, with up to `n` arguments,
11182 * ignoring any additional arguments.
11187 * @category Function
11188 * @param {Function} func The function to cap arguments for.
11189 * @param {number} [n=func.length] The arity cap.
11190 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
11191 * @returns {Function} Returns the new capped function.
11194 * _.map(['6', '8', '10'], _.ary(parseInt, 1));
11197 function ary(func, n, guard) {
11198 n = guard ? undefined : n;
11199 n = (func && n == null) ? func.length : n;
11200 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
11204 * Creates a function that invokes `func`, with the `this` binding and arguments
11205 * of the created function, while it's called less than `n` times. Subsequent
11206 * calls to the created function return the result of the last `func` invocation.
11211 * @category Function
11212 * @param {number} n The number of calls at which `func` is no longer invoked.
11213 * @param {Function} func The function to restrict.
11214 * @returns {Function} Returns the new restricted function.
11217 * jQuery(element).on('click', _.before(5, addContactToList));
11218 * // => Allows adding up to 4 contacts to the list.
11220 function before(n, func) {
11222 if (typeof func != 'function') {
11223 throw new TypeError(FUNC_ERROR_TEXT);
11226 return function() {
11228 result = func.apply(this, arguments);
11238 * Creates a function that invokes `func` with the `this` binding of `thisArg`
11239 * and `partials` prepended to the arguments it receives.
11241 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
11242 * may be used as a placeholder for partially applied arguments.
11244 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
11245 * property of bound functions.
11250 * @category Function
11251 * @param {Function} func The function to bind.
11252 * @param {*} thisArg The `this` binding of `func`.
11253 * @param {...*} [partials] The arguments to be partially applied.
11254 * @returns {Function} Returns the new bound function.
11257 * function greet(greeting, punctuation) {
11258 * return greeting + ' ' + this.user + punctuation;
11261 * var object = { 'user': 'fred' };
11263 * var bound = _.bind(greet, object, 'hi');
11267 * // Bound with placeholders.
11268 * var bound = _.bind(greet, object, _, '!');
11272 var bind = baseRest(function(func, thisArg, partials) {
11273 var bitmask = WRAP_BIND_FLAG;
11274 if (partials.length) {
11275 var holders = replaceHolders(partials, getHolder(bind));
11276 bitmask |= WRAP_PARTIAL_FLAG;
11278 return createWrap(func, bitmask, thisArg, partials, holders);
11282 * Creates a function that invokes the method at `object[key]` with `partials`
11283 * prepended to the arguments it receives.
11285 * This method differs from `_.bind` by allowing bound functions to reference
11286 * methods that may be redefined or don't yet exist. See
11287 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
11288 * for more details.
11290 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
11291 * builds, may be used as a placeholder for partially applied arguments.
11296 * @category Function
11297 * @param {Object} object The object to invoke the method on.
11298 * @param {string} key The key of the method.
11299 * @param {...*} [partials] The arguments to be partially applied.
11300 * @returns {Function} Returns the new bound function.
11305 * 'greet': function(greeting, punctuation) {
11306 * return greeting + ' ' + this.user + punctuation;
11310 * var bound = _.bindKey(object, 'greet', 'hi');
11314 * object.greet = function(greeting, punctuation) {
11315 * return greeting + 'ya ' + this.user + punctuation;
11319 * // => 'hiya fred!'
11321 * // Bound with placeholders.
11322 * var bound = _.bindKey(object, 'greet', _, '!');
11324 * // => 'hiya fred!'
11326 var bindKey = baseRest(function(object, key, partials) {
11327 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
11328 if (partials.length) {
11329 var holders = replaceHolders(partials, getHolder(bindKey));
11330 bitmask |= WRAP_PARTIAL_FLAG;
11332 return createWrap(key, bitmask, object, partials, holders);
11336 * Creates a function that accepts arguments of `func` and either invokes
11337 * `func` returning its result, if at least `arity` number of arguments have
11338 * been provided, or returns a function that accepts the remaining `func`
11339 * arguments, and so on. The arity of `func` may be specified if `func.length`
11340 * is not sufficient.
11342 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
11343 * may be used as a placeholder for provided arguments.
11345 * **Note:** This method doesn't set the "length" property of curried functions.
11350 * @category Function
11351 * @param {Function} func The function to curry.
11352 * @param {number} [arity=func.length] The arity of `func`.
11353 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
11354 * @returns {Function} Returns the new curried function.
11357 * var abc = function(a, b, c) {
11358 * return [a, b, c];
11361 * var curried = _.curry(abc);
11363 * curried(1)(2)(3);
11366 * curried(1, 2)(3);
11369 * curried(1, 2, 3);
11372 * // Curried with placeholders.
11373 * curried(1)(_, 3)(2);
11376 function curry(func, arity, guard) {
11377 arity = guard ? undefined : arity;
11378 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
11379 result.placeholder = curry.placeholder;
11384 * This method is like `_.curry` except that arguments are applied to `func`
11385 * in the manner of `_.partialRight` instead of `_.partial`.
11387 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
11388 * builds, may be used as a placeholder for provided arguments.
11390 * **Note:** This method doesn't set the "length" property of curried functions.
11395 * @category Function
11396 * @param {Function} func The function to curry.
11397 * @param {number} [arity=func.length] The arity of `func`.
11398 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
11399 * @returns {Function} Returns the new curried function.
11402 * var abc = function(a, b, c) {
11403 * return [a, b, c];
11406 * var curried = _.curryRight(abc);
11408 * curried(3)(2)(1);
11411 * curried(2, 3)(1);
11414 * curried(1, 2, 3);
11417 * // Curried with placeholders.
11418 * curried(3)(1, _)(2);
11421 function curryRight(func, arity, guard) {
11422 arity = guard ? undefined : arity;
11423 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
11424 result.placeholder = curryRight.placeholder;
11429 * Creates a debounced function that delays invoking `func` until after `wait`
11430 * milliseconds have elapsed since the last time the debounced function was
11431 * invoked. The debounced function comes with a `cancel` method to cancel
11432 * delayed `func` invocations and a `flush` method to immediately invoke them.
11433 * Provide `options` to indicate whether `func` should be invoked on the
11434 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
11435 * with the last arguments provided to the debounced function. Subsequent
11436 * calls to the debounced function return the result of the last `func`
11439 * **Note:** If `leading` and `trailing` options are `true`, `func` is
11440 * invoked on the trailing edge of the timeout only if the debounced function
11441 * is invoked more than once during the `wait` timeout.
11443 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
11444 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
11446 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
11447 * for details over the differences between `_.debounce` and `_.throttle`.
11452 * @category Function
11453 * @param {Function} func The function to debounce.
11454 * @param {number} [wait=0] The number of milliseconds to delay.
11455 * @param {Object} [options={}] The options object.
11456 * @param {boolean} [options.leading=false]
11457 * Specify invoking on the leading edge of the timeout.
11458 * @param {number} [options.maxWait]
11459 * The maximum time `func` is allowed to be delayed before it's invoked.
11460 * @param {boolean} [options.trailing=true]
11461 * Specify invoking on the trailing edge of the timeout.
11462 * @returns {Function} Returns the new debounced function.
11465 * // Avoid costly calculations while the window size is in flux.
11466 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
11468 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
11469 * jQuery(element).on('click', _.debounce(sendMail, 300, {
11471 * 'trailing': false
11474 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
11475 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
11476 * var source = new EventSource('/stream');
11477 * jQuery(source).on('message', debounced);
11479 * // Cancel the trailing debounced invocation.
11480 * jQuery(window).on('popstate', debounced.cancel);
11482 function debounce(func, wait, options) {
11489 lastInvokeTime = 0,
11494 if (typeof func != 'function') {
11495 throw new TypeError(FUNC_ERROR_TEXT);
11497 wait = toNumber(wait) || 0;
11498 if (isObject(options)) {
11499 leading = !!options.leading;
11500 maxing = 'maxWait' in options;
11501 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
11502 trailing = 'trailing' in options ? !!options.trailing : trailing;
11505 function invokeFunc(time) {
11506 var args = lastArgs,
11507 thisArg = lastThis;
11509 lastArgs = lastThis = undefined;
11510 lastInvokeTime = time;
11511 result = func.apply(thisArg, args);
11515 function leadingEdge(time) {
11516 // Reset any `maxWait` timer.
11517 lastInvokeTime = time;
11518 // Start the timer for the trailing edge.
11519 timerId = setTimeout(timerExpired, wait);
11520 // Invoke the leading edge.
11521 return leading ? invokeFunc(time) : result;
11524 function remainingWait(time) {
11525 var timeSinceLastCall = time - lastCallTime,
11526 timeSinceLastInvoke = time - lastInvokeTime,
11527 timeWaiting = wait - timeSinceLastCall;
11530 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
11534 function shouldInvoke(time) {
11535 var timeSinceLastCall = time - lastCallTime,
11536 timeSinceLastInvoke = time - lastInvokeTime;
11538 // Either this is the first call, activity has stopped and we're at the
11539 // trailing edge, the system time has gone backwards and we're treating
11540 // it as the trailing edge, or we've hit the `maxWait` limit.
11541 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
11542 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
11545 function timerExpired() {
11547 if (shouldInvoke(time)) {
11548 return trailingEdge(time);
11550 // Restart the timer.
11551 timerId = setTimeout(timerExpired, remainingWait(time));
11554 function trailingEdge(time) {
11555 timerId = undefined;
11557 // Only invoke if we have `lastArgs` which means `func` has been
11558 // debounced at least once.
11559 if (trailing && lastArgs) {
11560 return invokeFunc(time);
11562 lastArgs = lastThis = undefined;
11566 function cancel() {
11567 if (timerId !== undefined) {
11568 clearTimeout(timerId);
11570 lastInvokeTime = 0;
11571 lastArgs = lastCallTime = lastThis = timerId = undefined;
11575 return timerId === undefined ? result : trailingEdge(now());
11578 function debounced() {
11580 isInvoking = shouldInvoke(time);
11582 lastArgs = arguments;
11584 lastCallTime = time;
11587 if (timerId === undefined) {
11588 return leadingEdge(lastCallTime);
11591 // Handle invocations in a tight loop.
11592 clearTimeout(timerId);
11593 timerId = setTimeout(timerExpired, wait);
11594 return invokeFunc(lastCallTime);
11597 if (timerId === undefined) {
11598 timerId = setTimeout(timerExpired, wait);
11602 debounced.cancel = cancel;
11603 debounced.flush = flush;
11608 * Defers invoking the `func` until the current call stack has cleared. Any
11609 * additional arguments are provided to `func` when it's invoked.
11614 * @category Function
11615 * @param {Function} func The function to defer.
11616 * @param {...*} [args] The arguments to invoke `func` with.
11617 * @returns {number} Returns the timer id.
11620 * _.defer(function(text) {
11621 * console.log(text);
11623 * // => Logs 'deferred' after one millisecond.
11625 var defer = baseRest(function(func, args) {
11626 return baseDelay(func, 1, args);
11630 * Invokes `func` after `wait` milliseconds. Any additional arguments are
11631 * provided to `func` when it's invoked.
11636 * @category Function
11637 * @param {Function} func The function to delay.
11638 * @param {number} wait The number of milliseconds to delay invocation.
11639 * @param {...*} [args] The arguments to invoke `func` with.
11640 * @returns {number} Returns the timer id.
11643 * _.delay(function(text) {
11644 * console.log(text);
11645 * }, 1000, 'later');
11646 * // => Logs 'later' after one second.
11648 var delay = baseRest(function(func, wait, args) {
11649 return baseDelay(func, toNumber(wait) || 0, args);
11653 * Creates a function that invokes `func` with arguments reversed.
11658 * @category Function
11659 * @param {Function} func The function to flip arguments for.
11660 * @returns {Function} Returns the new flipped function.
11663 * var flipped = _.flip(function() {
11664 * return _.toArray(arguments);
11667 * flipped('a', 'b', 'c', 'd');
11668 * // => ['d', 'c', 'b', 'a']
11670 function flip(func) {
11671 return createWrap(func, WRAP_FLIP_FLAG);
11675 * Creates a function that memoizes the result of `func`. If `resolver` is
11676 * provided, it determines the cache key for storing the result based on the
11677 * arguments provided to the memoized function. By default, the first argument
11678 * provided to the memoized function is used as the map cache key. The `func`
11679 * is invoked with the `this` binding of the memoized function.
11681 * **Note:** The cache is exposed as the `cache` property on the memoized
11682 * function. Its creation may be customized by replacing the `_.memoize.Cache`
11683 * constructor with one whose instances implement the
11684 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
11685 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
11690 * @category Function
11691 * @param {Function} func The function to have its output memoized.
11692 * @param {Function} [resolver] The function to resolve the cache key.
11693 * @returns {Function} Returns the new memoized function.
11696 * var object = { 'a': 1, 'b': 2 };
11697 * var other = { 'c': 3, 'd': 4 };
11699 * var values = _.memoize(_.values);
11710 * // Modify the result cache.
11711 * values.cache.set(object, ['a', 'b']);
11715 * // Replace `_.memoize.Cache`.
11716 * _.memoize.Cache = WeakMap;
11718 function memoize(func, resolver) {
11719 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
11720 throw new TypeError(FUNC_ERROR_TEXT);
11722 var memoized = function() {
11723 var args = arguments,
11724 key = resolver ? resolver.apply(this, args) : args[0],
11725 cache = memoized.cache;
11727 if (cache.has(key)) {
11728 return cache.get(key);
11730 var result = func.apply(this, args);
11731 memoized.cache = cache.set(key, result) || cache;
11734 memoized.cache = new (memoize.Cache || MapCache);
11738 // Expose `MapCache`.
11739 memoize.Cache = MapCache;
11742 * Creates a function that negates the result of the predicate `func`. The
11743 * `func` predicate is invoked with the `this` binding and arguments of the
11744 * created function.
11749 * @category Function
11750 * @param {Function} predicate The predicate to negate.
11751 * @returns {Function} Returns the new negated function.
11754 * function isEven(n) {
11755 * return n % 2 == 0;
11758 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
11761 function negate(predicate) {
11762 if (typeof predicate != 'function') {
11763 throw new TypeError(FUNC_ERROR_TEXT);
11765 return function() {
11766 var args = arguments;
11767 switch (args.length) {
11768 case 0: return !predicate.call(this);
11769 case 1: return !predicate.call(this, args[0]);
11770 case 2: return !predicate.call(this, args[0], args[1]);
11771 case 3: return !predicate.call(this, args[0], args[1], args[2]);
11773 return !predicate.apply(this, args);
11778 * Creates a function that is restricted to invoking `func` once. Repeat calls
11779 * to the function return the value of the first invocation. The `func` is
11780 * invoked with the `this` binding and arguments of the created function.
11785 * @category Function
11786 * @param {Function} func The function to restrict.
11787 * @returns {Function} Returns the new restricted function.
11790 * var initialize = _.once(createApplication);
11793 * // => `createApplication` is invoked once
11795 function once(func) {
11796 return before(2, func);
11800 * Creates a function that invokes `func` with its arguments transformed.
11805 * @category Function
11806 * @param {Function} func The function to wrap.
11807 * @param {...(Function|Function[])} [transforms=[_.identity]]
11808 * The argument transforms.
11809 * @returns {Function} Returns the new function.
11812 * function doubled(n) {
11816 * function square(n) {
11820 * var func = _.overArgs(function(x, y) {
11822 * }, [square, doubled]);
11830 var overArgs = castRest(function(func, transforms) {
11831 transforms = (transforms.length == 1 && isArray(transforms[0]))
11832 ? arrayMap(transforms[0], baseUnary(getIteratee()))
11833 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
11835 var funcsLength = transforms.length;
11836 return baseRest(function(args) {
11838 length = nativeMin(args.length, funcsLength);
11840 while (++index < length) {
11841 args[index] = transforms[index].call(this, args[index]);
11843 return apply(func, this, args);
11848 * Creates a function that invokes `func` with `partials` prepended to the
11849 * arguments it receives. This method is like `_.bind` except it does **not**
11850 * alter the `this` binding.
11852 * The `_.partial.placeholder` value, which defaults to `_` in monolithic
11853 * builds, may be used as a placeholder for partially applied arguments.
11855 * **Note:** This method doesn't set the "length" property of partially
11856 * applied functions.
11861 * @category Function
11862 * @param {Function} func The function to partially apply arguments to.
11863 * @param {...*} [partials] The arguments to be partially applied.
11864 * @returns {Function} Returns the new partially applied function.
11867 * function greet(greeting, name) {
11868 * return greeting + ' ' + name;
11871 * var sayHelloTo = _.partial(greet, 'hello');
11872 * sayHelloTo('fred');
11873 * // => 'hello fred'
11875 * // Partially applied with placeholders.
11876 * var greetFred = _.partial(greet, _, 'fred');
11880 var partial = baseRest(function(func, partials) {
11881 var holders = replaceHolders(partials, getHolder(partial));
11882 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
11886 * This method is like `_.partial` except that partially applied arguments
11887 * are appended to the arguments it receives.
11889 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
11890 * builds, may be used as a placeholder for partially applied arguments.
11892 * **Note:** This method doesn't set the "length" property of partially
11893 * applied functions.
11898 * @category Function
11899 * @param {Function} func The function to partially apply arguments to.
11900 * @param {...*} [partials] The arguments to be partially applied.
11901 * @returns {Function} Returns the new partially applied function.
11904 * function greet(greeting, name) {
11905 * return greeting + ' ' + name;
11908 * var greetFred = _.partialRight(greet, 'fred');
11912 * // Partially applied with placeholders.
11913 * var sayHelloTo = _.partialRight(greet, 'hello', _);
11914 * sayHelloTo('fred');
11915 * // => 'hello fred'
11917 var partialRight = baseRest(function(func, partials) {
11918 var holders = replaceHolders(partials, getHolder(partialRight));
11919 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
11923 * Creates a function that invokes `func` with arguments arranged according
11924 * to the specified `indexes` where the argument value at the first index is
11925 * provided as the first argument, the argument value at the second index is
11926 * provided as the second argument, and so on.
11931 * @category Function
11932 * @param {Function} func The function to rearrange arguments for.
11933 * @param {...(number|number[])} indexes The arranged argument indexes.
11934 * @returns {Function} Returns the new function.
11937 * var rearged = _.rearg(function(a, b, c) {
11938 * return [a, b, c];
11941 * rearged('b', 'c', 'a')
11942 * // => ['a', 'b', 'c']
11944 var rearg = flatRest(function(func, indexes) {
11945 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
11949 * Creates a function that invokes `func` with the `this` binding of the
11950 * created function and arguments from `start` and beyond provided as
11953 * **Note:** This method is based on the
11954 * [rest parameter](https://mdn.io/rest_parameters).
11959 * @category Function
11960 * @param {Function} func The function to apply a rest parameter to.
11961 * @param {number} [start=func.length-1] The start position of the rest parameter.
11962 * @returns {Function} Returns the new function.
11965 * var say = _.rest(function(what, names) {
11966 * return what + ' ' + _.initial(names).join(', ') +
11967 * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
11970 * say('hello', 'fred', 'barney', 'pebbles');
11971 * // => 'hello fred, barney, & pebbles'
11973 function rest(func, start) {
11974 if (typeof func != 'function') {
11975 throw new TypeError(FUNC_ERROR_TEXT);
11977 start = start === undefined ? start : toInteger(start);
11978 return baseRest(func, start);
11982 * Creates a function that invokes `func` with the `this` binding of the
11983 * create function and an array of arguments much like
11984 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
11986 * **Note:** This method is based on the
11987 * [spread operator](https://mdn.io/spread_operator).
11992 * @category Function
11993 * @param {Function} func The function to spread arguments over.
11994 * @param {number} [start=0] The start position of the spread.
11995 * @returns {Function} Returns the new function.
11998 * var say = _.spread(function(who, what) {
11999 * return who + ' says ' + what;
12002 * say(['fred', 'hello']);
12003 * // => 'fred says hello'
12005 * var numbers = Promise.all([
12006 * Promise.resolve(40),
12007 * Promise.resolve(36)
12010 * numbers.then(_.spread(function(x, y) {
12013 * // => a Promise of 76
12015 function spread(func, start) {
12016 if (typeof func != 'function') {
12017 throw new TypeError(FUNC_ERROR_TEXT);
12019 start = start == null ? 0 : nativeMax(toInteger(start), 0);
12020 return baseRest(function(args) {
12021 var array = args[start],
12022 otherArgs = castSlice(args, 0, start);
12025 arrayPush(otherArgs, array);
12027 return apply(func, this, otherArgs);
12032 * Creates a throttled function that only invokes `func` at most once per
12033 * every `wait` milliseconds. The throttled function comes with a `cancel`
12034 * method to cancel delayed `func` invocations and a `flush` method to
12035 * immediately invoke them. Provide `options` to indicate whether `func`
12036 * should be invoked on the leading and/or trailing edge of the `wait`
12037 * timeout. The `func` is invoked with the last arguments provided to the
12038 * throttled function. Subsequent calls to the throttled function return the
12039 * result of the last `func` invocation.
12041 * **Note:** If `leading` and `trailing` options are `true`, `func` is
12042 * invoked on the trailing edge of the timeout only if the throttled function
12043 * is invoked more than once during the `wait` timeout.
12045 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
12046 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
12048 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
12049 * for details over the differences between `_.throttle` and `_.debounce`.
12054 * @category Function
12055 * @param {Function} func The function to throttle.
12056 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
12057 * @param {Object} [options={}] The options object.
12058 * @param {boolean} [options.leading=true]
12059 * Specify invoking on the leading edge of the timeout.
12060 * @param {boolean} [options.trailing=true]
12061 * Specify invoking on the trailing edge of the timeout.
12062 * @returns {Function} Returns the new throttled function.
12065 * // Avoid excessively updating the position while scrolling.
12066 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
12068 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
12069 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
12070 * jQuery(element).on('click', throttled);
12072 * // Cancel the trailing throttled invocation.
12073 * jQuery(window).on('popstate', throttled.cancel);
12075 function throttle(func, wait, options) {
12076 var leading = true,
12079 if (typeof func != 'function') {
12080 throw new TypeError(FUNC_ERROR_TEXT);
12082 if (isObject(options)) {
12083 leading = 'leading' in options ? !!options.leading : leading;
12084 trailing = 'trailing' in options ? !!options.trailing : trailing;
12086 return debounce(func, wait, {
12087 'leading': leading,
12089 'trailing': trailing
12094 * Creates a function that accepts up to one argument, ignoring any
12095 * additional arguments.
12100 * @category Function
12101 * @param {Function} func The function to cap arguments for.
12102 * @returns {Function} Returns the new capped function.
12105 * _.map(['6', '8', '10'], _.unary(parseInt));
12108 function unary(func) {
12109 return ary(func, 1);
12113 * Creates a function that provides `value` to `wrapper` as its first
12114 * argument. Any additional arguments provided to the function are appended
12115 * to those provided to the `wrapper`. The wrapper is invoked with the `this`
12116 * binding of the created function.
12121 * @category Function
12122 * @param {*} value The value to wrap.
12123 * @param {Function} [wrapper=identity] The wrapper function.
12124 * @returns {Function} Returns the new function.
12127 * var p = _.wrap(_.escape, function(func, text) {
12128 * return '<p>' + func(text) + '</p>';
12131 * p('fred, barney, & pebbles');
12132 * // => '<p>fred, barney, & pebbles</p>'
12134 function wrap(value, wrapper) {
12135 return partial(castFunction(wrapper), value);
12138 /*------------------------------------------------------------------------*/
12141 * Casts `value` as an array if it's not one.
12147 * @param {*} value The value to inspect.
12148 * @returns {Array} Returns the cast array.
12154 * _.castArray({ 'a': 1 });
12155 * // => [{ 'a': 1 }]
12157 * _.castArray('abc');
12160 * _.castArray(null);
12163 * _.castArray(undefined);
12164 * // => [undefined]
12169 * var array = [1, 2, 3];
12170 * console.log(_.castArray(array) === array);
12173 function castArray() {
12174 if (!arguments.length) {
12177 var value = arguments[0];
12178 return isArray(value) ? value : [value];
12182 * Creates a shallow clone of `value`.
12184 * **Note:** This method is loosely based on the
12185 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
12186 * and supports cloning arrays, array buffers, booleans, date objects, maps,
12187 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
12188 * arrays. The own enumerable properties of `arguments` objects are cloned
12189 * as plain objects. An empty object is returned for uncloneable values such
12190 * as error objects, functions, DOM nodes, and WeakMaps.
12196 * @param {*} value The value to clone.
12197 * @returns {*} Returns the cloned value.
12201 * var objects = [{ 'a': 1 }, { 'b': 2 }];
12203 * var shallow = _.clone(objects);
12204 * console.log(shallow[0] === objects[0]);
12207 function clone(value) {
12208 return baseClone(value, CLONE_SYMBOLS_FLAG);
12212 * This method is like `_.clone` except that it accepts `customizer` which
12213 * is invoked to produce the cloned value. If `customizer` returns `undefined`,
12214 * cloning is handled by the method instead. The `customizer` is invoked with
12215 * up to four arguments; (value [, index|key, object, stack]).
12221 * @param {*} value The value to clone.
12222 * @param {Function} [customizer] The function to customize cloning.
12223 * @returns {*} Returns the cloned value.
12224 * @see _.cloneDeepWith
12227 * function customizer(value) {
12228 * if (_.isElement(value)) {
12229 * return value.cloneNode(false);
12233 * var el = _.cloneWith(document.body, customizer);
12235 * console.log(el === document.body);
12237 * console.log(el.nodeName);
12239 * console.log(el.childNodes.length);
12242 function cloneWith(value, customizer) {
12243 customizer = typeof customizer == 'function' ? customizer : undefined;
12244 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
12248 * This method is like `_.clone` except that it recursively clones `value`.
12254 * @param {*} value The value to recursively clone.
12255 * @returns {*} Returns the deep cloned value.
12259 * var objects = [{ 'a': 1 }, { 'b': 2 }];
12261 * var deep = _.cloneDeep(objects);
12262 * console.log(deep[0] === objects[0]);
12265 function cloneDeep(value) {
12266 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
12270 * This method is like `_.cloneWith` except that it recursively clones `value`.
12276 * @param {*} value The value to recursively clone.
12277 * @param {Function} [customizer] The function to customize cloning.
12278 * @returns {*} Returns the deep cloned value.
12282 * function customizer(value) {
12283 * if (_.isElement(value)) {
12284 * return value.cloneNode(true);
12288 * var el = _.cloneDeepWith(document.body, customizer);
12290 * console.log(el === document.body);
12292 * console.log(el.nodeName);
12294 * console.log(el.childNodes.length);
12297 function cloneDeepWith(value, customizer) {
12298 customizer = typeof customizer == 'function' ? customizer : undefined;
12299 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
12303 * Checks if `object` conforms to `source` by invoking the predicate
12304 * properties of `source` with the corresponding property values of `object`.
12306 * **Note:** This method is equivalent to `_.conforms` when `source` is
12307 * partially applied.
12313 * @param {Object} object The object to inspect.
12314 * @param {Object} source The object of property predicates to conform to.
12315 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
12318 * var object = { 'a': 1, 'b': 2 };
12320 * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
12323 * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
12326 function conformsTo(object, source) {
12327 return source == null || baseConformsTo(object, source, keys(source));
12332 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
12333 * comparison between two values to determine if they are equivalent.
12339 * @param {*} value The value to compare.
12340 * @param {*} other The other value to compare.
12341 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
12344 * var object = { 'a': 1 };
12345 * var other = { 'a': 1 };
12347 * _.eq(object, object);
12350 * _.eq(object, other);
12356 * _.eq('a', Object('a'));
12362 function eq(value, other) {
12363 return value === other || (value !== value && other !== other);
12367 * Checks if `value` is greater than `other`.
12373 * @param {*} value The value to compare.
12374 * @param {*} other The other value to compare.
12375 * @returns {boolean} Returns `true` if `value` is greater than `other`,
12389 var gt = createRelationalOperation(baseGt);
12392 * Checks if `value` is greater than or equal to `other`.
12398 * @param {*} value The value to compare.
12399 * @param {*} other The other value to compare.
12400 * @returns {boolean} Returns `true` if `value` is greater than or equal to
12401 * `other`, else `false`.
12414 var gte = createRelationalOperation(function(value, other) {
12415 return value >= other;
12419 * Checks if `value` is likely an `arguments` object.
12425 * @param {*} value The value to check.
12426 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
12430 * _.isArguments(function() { return arguments; }());
12433 * _.isArguments([1, 2, 3]);
12436 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
12437 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
12438 !propertyIsEnumerable.call(value, 'callee');
12442 * Checks if `value` is classified as an `Array` object.
12448 * @param {*} value The value to check.
12449 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
12452 * _.isArray([1, 2, 3]);
12455 * _.isArray(document.body.children);
12458 * _.isArray('abc');
12461 * _.isArray(_.noop);
12464 var isArray = Array.isArray;
12467 * Checks if `value` is classified as an `ArrayBuffer` object.
12473 * @param {*} value The value to check.
12474 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
12477 * _.isArrayBuffer(new ArrayBuffer(2));
12480 * _.isArrayBuffer(new Array(2));
12483 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
12486 * Checks if `value` is array-like. A value is considered array-like if it's
12487 * not a function and has a `value.length` that's an integer greater than or
12488 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
12494 * @param {*} value The value to check.
12495 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
12498 * _.isArrayLike([1, 2, 3]);
12501 * _.isArrayLike(document.body.children);
12504 * _.isArrayLike('abc');
12507 * _.isArrayLike(_.noop);
12510 function isArrayLike(value) {
12511 return value != null && isLength(value.length) && !isFunction(value);
12515 * This method is like `_.isArrayLike` except that it also checks if `value`
12522 * @param {*} value The value to check.
12523 * @returns {boolean} Returns `true` if `value` is an array-like object,
12527 * _.isArrayLikeObject([1, 2, 3]);
12530 * _.isArrayLikeObject(document.body.children);
12533 * _.isArrayLikeObject('abc');
12536 * _.isArrayLikeObject(_.noop);
12539 function isArrayLikeObject(value) {
12540 return isObjectLike(value) && isArrayLike(value);
12544 * Checks if `value` is classified as a boolean primitive or object.
12550 * @param {*} value The value to check.
12551 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
12554 * _.isBoolean(false);
12557 * _.isBoolean(null);
12560 function isBoolean(value) {
12561 return value === true || value === false ||
12562 (isObjectLike(value) && baseGetTag(value) == boolTag);
12566 * Checks if `value` is a buffer.
12572 * @param {*} value The value to check.
12573 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
12576 * _.isBuffer(new Buffer(2));
12579 * _.isBuffer(new Uint8Array(2));
12582 var isBuffer = nativeIsBuffer || stubFalse;
12585 * Checks if `value` is classified as a `Date` object.
12591 * @param {*} value The value to check.
12592 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
12595 * _.isDate(new Date);
12598 * _.isDate('Mon April 23 2012');
12601 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
12604 * Checks if `value` is likely a DOM element.
12610 * @param {*} value The value to check.
12611 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
12614 * _.isElement(document.body);
12617 * _.isElement('<body>');
12620 function isElement(value) {
12621 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
12625 * Checks if `value` is an empty object, collection, map, or set.
12627 * Objects are considered empty if they have no own enumerable string keyed
12630 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
12631 * jQuery-like collections are considered empty if they have a `length` of `0`.
12632 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
12638 * @param {*} value The value to check.
12639 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
12651 * _.isEmpty([1, 2, 3]);
12654 * _.isEmpty({ 'a': 1 });
12657 function isEmpty(value) {
12658 if (value == null) {
12661 if (isArrayLike(value) &&
12662 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
12663 isBuffer(value) || isTypedArray(value) || isArguments(value))) {
12664 return !value.length;
12666 var tag = getTag(value);
12667 if (tag == mapTag || tag == setTag) {
12668 return !value.size;
12670 if (isPrototype(value)) {
12671 return !baseKeys(value).length;
12673 for (var key in value) {
12674 if (hasOwnProperty.call(value, key)) {
12682 * Performs a deep comparison between two values to determine if they are
12685 * **Note:** This method supports comparing arrays, array buffers, booleans,
12686 * date objects, error objects, maps, numbers, `Object` objects, regexes,
12687 * sets, strings, symbols, and typed arrays. `Object` objects are compared
12688 * by their own, not inherited, enumerable properties. Functions and DOM
12689 * nodes are compared by strict equality, i.e. `===`.
12695 * @param {*} value The value to compare.
12696 * @param {*} other The other value to compare.
12697 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
12700 * var object = { 'a': 1 };
12701 * var other = { 'a': 1 };
12703 * _.isEqual(object, other);
12706 * object === other;
12709 function isEqual(value, other) {
12710 return baseIsEqual(value, other);
12714 * This method is like `_.isEqual` except that it accepts `customizer` which
12715 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
12716 * are handled by the method instead. The `customizer` is invoked with up to
12717 * six arguments: (objValue, othValue [, index|key, object, other, stack]).
12723 * @param {*} value The value to compare.
12724 * @param {*} other The other value to compare.
12725 * @param {Function} [customizer] The function to customize comparisons.
12726 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
12729 * function isGreeting(value) {
12730 * return /^h(?:i|ello)$/.test(value);
12733 * function customizer(objValue, othValue) {
12734 * if (isGreeting(objValue) && isGreeting(othValue)) {
12739 * var array = ['hello', 'goodbye'];
12740 * var other = ['hi', 'goodbye'];
12742 * _.isEqualWith(array, other, customizer);
12745 function isEqualWith(value, other, customizer) {
12746 customizer = typeof customizer == 'function' ? customizer : undefined;
12747 var result = customizer ? customizer(value, other) : undefined;
12748 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
12752 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
12753 * `SyntaxError`, `TypeError`, or `URIError` object.
12759 * @param {*} value The value to check.
12760 * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
12763 * _.isError(new Error);
12766 * _.isError(Error);
12769 function isError(value) {
12770 if (!isObjectLike(value)) {
12773 var tag = baseGetTag(value);
12774 return tag == errorTag || tag == domExcTag ||
12775 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
12779 * Checks if `value` is a finite primitive number.
12781 * **Note:** This method is based on
12782 * [`Number.isFinite`](https://mdn.io/Number/isFinite).
12788 * @param {*} value The value to check.
12789 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
12795 * _.isFinite(Number.MIN_VALUE);
12798 * _.isFinite(Infinity);
12804 function isFinite(value) {
12805 return typeof value == 'number' && nativeIsFinite(value);
12809 * Checks if `value` is classified as a `Function` object.
12815 * @param {*} value The value to check.
12816 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
12822 * _.isFunction(/abc/);
12825 function isFunction(value) {
12826 if (!isObject(value)) {
12829 // The use of `Object#toString` avoids issues with the `typeof` operator
12830 // in Safari 9 which returns 'object' for typed arrays and other constructors.
12831 var tag = baseGetTag(value);
12832 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
12836 * Checks if `value` is an integer.
12838 * **Note:** This method is based on
12839 * [`Number.isInteger`](https://mdn.io/Number/isInteger).
12845 * @param {*} value The value to check.
12846 * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
12852 * _.isInteger(Number.MIN_VALUE);
12855 * _.isInteger(Infinity);
12858 * _.isInteger('3');
12861 function isInteger(value) {
12862 return typeof value == 'number' && value == toInteger(value);
12866 * Checks if `value` is a valid array-like length.
12868 * **Note:** This method is loosely based on
12869 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
12875 * @param {*} value The value to check.
12876 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
12882 * _.isLength(Number.MIN_VALUE);
12885 * _.isLength(Infinity);
12891 function isLength(value) {
12892 return typeof value == 'number' &&
12893 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
12897 * Checks if `value` is the
12898 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
12899 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
12905 * @param {*} value The value to check.
12906 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
12912 * _.isObject([1, 2, 3]);
12915 * _.isObject(_.noop);
12918 * _.isObject(null);
12921 function isObject(value) {
12922 var type = typeof value;
12923 return value != null && (type == 'object' || type == 'function');
12927 * Checks if `value` is object-like. A value is object-like if it's not `null`
12928 * and has a `typeof` result of "object".
12934 * @param {*} value The value to check.
12935 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
12938 * _.isObjectLike({});
12941 * _.isObjectLike([1, 2, 3]);
12944 * _.isObjectLike(_.noop);
12947 * _.isObjectLike(null);
12950 function isObjectLike(value) {
12951 return value != null && typeof value == 'object';
12955 * Checks if `value` is classified as a `Map` object.
12961 * @param {*} value The value to check.
12962 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
12965 * _.isMap(new Map);
12968 * _.isMap(new WeakMap);
12971 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
12974 * Performs a partial deep comparison between `object` and `source` to
12975 * determine if `object` contains equivalent property values.
12977 * **Note:** This method is equivalent to `_.matches` when `source` is
12978 * partially applied.
12980 * Partial comparisons will match empty array and empty object `source`
12981 * values against any array or object value, respectively. See `_.isEqual`
12982 * for a list of supported value comparisons.
12988 * @param {Object} object The object to inspect.
12989 * @param {Object} source The object of property values to match.
12990 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
12993 * var object = { 'a': 1, 'b': 2 };
12995 * _.isMatch(object, { 'b': 2 });
12998 * _.isMatch(object, { 'b': 1 });
13001 function isMatch(object, source) {
13002 return object === source || baseIsMatch(object, source, getMatchData(source));
13006 * This method is like `_.isMatch` except that it accepts `customizer` which
13007 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
13008 * are handled by the method instead. The `customizer` is invoked with five
13009 * arguments: (objValue, srcValue, index|key, object, source).
13015 * @param {Object} object The object to inspect.
13016 * @param {Object} source The object of property values to match.
13017 * @param {Function} [customizer] The function to customize comparisons.
13018 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
13021 * function isGreeting(value) {
13022 * return /^h(?:i|ello)$/.test(value);
13025 * function customizer(objValue, srcValue) {
13026 * if (isGreeting(objValue) && isGreeting(srcValue)) {
13031 * var object = { 'greeting': 'hello' };
13032 * var source = { 'greeting': 'hi' };
13034 * _.isMatchWith(object, source, customizer);
13037 function isMatchWith(object, source, customizer) {
13038 customizer = typeof customizer == 'function' ? customizer : undefined;
13039 return baseIsMatch(object, source, getMatchData(source), customizer);
13043 * Checks if `value` is `NaN`.
13045 * **Note:** This method is based on
13046 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
13047 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
13048 * `undefined` and other non-number values.
13054 * @param {*} value The value to check.
13055 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
13061 * _.isNaN(new Number(NaN));
13064 * isNaN(undefined);
13067 * _.isNaN(undefined);
13070 function isNaN(value) {
13071 // An `NaN` primitive is the only value that is not equal to itself.
13072 // Perform the `toStringTag` check first to avoid errors with some
13073 // ActiveX objects in IE.
13074 return isNumber(value) && value != +value;
13078 * Checks if `value` is a pristine native function.
13080 * **Note:** This method can't reliably detect native functions in the presence
13081 * of the core-js package because core-js circumvents this kind of detection.
13082 * Despite multiple requests, the core-js maintainer has made it clear: any
13083 * attempt to fix the detection will be obstructed. As a result, we're left
13084 * with little choice but to throw an error. Unfortunately, this also affects
13085 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
13086 * which rely on core-js.
13092 * @param {*} value The value to check.
13093 * @returns {boolean} Returns `true` if `value` is a native function,
13097 * _.isNative(Array.prototype.push);
13103 function isNative(value) {
13104 if (isMaskable(value)) {
13105 throw new Error(CORE_ERROR_TEXT);
13107 return baseIsNative(value);
13111 * Checks if `value` is `null`.
13117 * @param {*} value The value to check.
13118 * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
13124 * _.isNull(void 0);
13127 function isNull(value) {
13128 return value === null;
13132 * Checks if `value` is `null` or `undefined`.
13138 * @param {*} value The value to check.
13139 * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
13151 function isNil(value) {
13152 return value == null;
13156 * Checks if `value` is classified as a `Number` primitive or object.
13158 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
13159 * classified as numbers, use the `_.isFinite` method.
13165 * @param {*} value The value to check.
13166 * @returns {boolean} Returns `true` if `value` is a number, else `false`.
13172 * _.isNumber(Number.MIN_VALUE);
13175 * _.isNumber(Infinity);
13181 function isNumber(value) {
13182 return typeof value == 'number' ||
13183 (isObjectLike(value) && baseGetTag(value) == numberTag);
13187 * Checks if `value` is a plain object, that is, an object created by the
13188 * `Object` constructor or one with a `[[Prototype]]` of `null`.
13194 * @param {*} value The value to check.
13195 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
13202 * _.isPlainObject(new Foo);
13205 * _.isPlainObject([1, 2, 3]);
13208 * _.isPlainObject({ 'x': 0, 'y': 0 });
13211 * _.isPlainObject(Object.create(null));
13214 function isPlainObject(value) {
13215 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
13218 var proto = getPrototype(value);
13219 if (proto === null) {
13222 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
13223 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
13224 funcToString.call(Ctor) == objectCtorString;
13228 * Checks if `value` is classified as a `RegExp` object.
13234 * @param {*} value The value to check.
13235 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
13238 * _.isRegExp(/abc/);
13241 * _.isRegExp('/abc/');
13244 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
13247 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
13248 * double precision number which isn't the result of a rounded unsafe integer.
13250 * **Note:** This method is based on
13251 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
13257 * @param {*} value The value to check.
13258 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
13261 * _.isSafeInteger(3);
13264 * _.isSafeInteger(Number.MIN_VALUE);
13267 * _.isSafeInteger(Infinity);
13270 * _.isSafeInteger('3');
13273 function isSafeInteger(value) {
13274 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
13278 * Checks if `value` is classified as a `Set` object.
13284 * @param {*} value The value to check.
13285 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
13288 * _.isSet(new Set);
13291 * _.isSet(new WeakSet);
13294 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
13297 * Checks if `value` is classified as a `String` primitive or object.
13303 * @param {*} value The value to check.
13304 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
13307 * _.isString('abc');
13313 function isString(value) {
13314 return typeof value == 'string' ||
13315 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
13319 * Checks if `value` is classified as a `Symbol` primitive or object.
13325 * @param {*} value The value to check.
13326 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
13329 * _.isSymbol(Symbol.iterator);
13332 * _.isSymbol('abc');
13335 function isSymbol(value) {
13336 return typeof value == 'symbol' ||
13337 (isObjectLike(value) && baseGetTag(value) == symbolTag);
13341 * Checks if `value` is classified as a typed array.
13347 * @param {*} value The value to check.
13348 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
13351 * _.isTypedArray(new Uint8Array);
13354 * _.isTypedArray([]);
13357 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
13360 * Checks if `value` is `undefined`.
13366 * @param {*} value The value to check.
13367 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
13370 * _.isUndefined(void 0);
13373 * _.isUndefined(null);
13376 function isUndefined(value) {
13377 return value === undefined;
13381 * Checks if `value` is classified as a `WeakMap` object.
13387 * @param {*} value The value to check.
13388 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
13391 * _.isWeakMap(new WeakMap);
13394 * _.isWeakMap(new Map);
13397 function isWeakMap(value) {
13398 return isObjectLike(value) && getTag(value) == weakMapTag;
13402 * Checks if `value` is classified as a `WeakSet` object.
13408 * @param {*} value The value to check.
13409 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
13412 * _.isWeakSet(new WeakSet);
13415 * _.isWeakSet(new Set);
13418 function isWeakSet(value) {
13419 return isObjectLike(value) && baseGetTag(value) == weakSetTag;
13423 * Checks if `value` is less than `other`.
13429 * @param {*} value The value to compare.
13430 * @param {*} other The other value to compare.
13431 * @returns {boolean} Returns `true` if `value` is less than `other`,
13445 var lt = createRelationalOperation(baseLt);
13448 * Checks if `value` is less than or equal to `other`.
13454 * @param {*} value The value to compare.
13455 * @param {*} other The other value to compare.
13456 * @returns {boolean} Returns `true` if `value` is less than or equal to
13457 * `other`, else `false`.
13470 var lte = createRelationalOperation(function(value, other) {
13471 return value <= other;
13475 * Converts `value` to an array.
13481 * @param {*} value The value to convert.
13482 * @returns {Array} Returns the converted array.
13485 * _.toArray({ 'a': 1, 'b': 2 });
13488 * _.toArray('abc');
13489 * // => ['a', 'b', 'c']
13497 function toArray(value) {
13501 if (isArrayLike(value)) {
13502 return isString(value) ? stringToArray(value) : copyArray(value);
13504 if (symIterator && value[symIterator]) {
13505 return iteratorToArray(value[symIterator]());
13507 var tag = getTag(value),
13508 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
13510 return func(value);
13514 * Converts `value` to a finite number.
13520 * @param {*} value The value to convert.
13521 * @returns {number} Returns the converted number.
13527 * _.toFinite(Number.MIN_VALUE);
13530 * _.toFinite(Infinity);
13531 * // => 1.7976931348623157e+308
13533 * _.toFinite('3.2');
13536 function toFinite(value) {
13538 return value === 0 ? value : 0;
13540 value = toNumber(value);
13541 if (value === INFINITY || value === -INFINITY) {
13542 var sign = (value < 0 ? -1 : 1);
13543 return sign * MAX_INTEGER;
13545 return value === value ? value : 0;
13549 * Converts `value` to an integer.
13551 * **Note:** This method is loosely based on
13552 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
13558 * @param {*} value The value to convert.
13559 * @returns {number} Returns the converted integer.
13562 * _.toInteger(3.2);
13565 * _.toInteger(Number.MIN_VALUE);
13568 * _.toInteger(Infinity);
13569 * // => 1.7976931348623157e+308
13571 * _.toInteger('3.2');
13574 function toInteger(value) {
13575 var result = toFinite(value),
13576 remainder = result % 1;
13578 return result === result ? (remainder ? result - remainder : result) : 0;
13582 * Converts `value` to an integer suitable for use as the length of an
13583 * array-like object.
13585 * **Note:** This method is based on
13586 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
13592 * @param {*} value The value to convert.
13593 * @returns {number} Returns the converted integer.
13599 * _.toLength(Number.MIN_VALUE);
13602 * _.toLength(Infinity);
13605 * _.toLength('3.2');
13608 function toLength(value) {
13609 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
13613 * Converts `value` to a number.
13619 * @param {*} value The value to process.
13620 * @returns {number} Returns the number.
13626 * _.toNumber(Number.MIN_VALUE);
13629 * _.toNumber(Infinity);
13632 * _.toNumber('3.2');
13635 function toNumber(value) {
13636 if (typeof value == 'number') {
13639 if (isSymbol(value)) {
13642 if (isObject(value)) {
13643 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
13644 value = isObject(other) ? (other + '') : other;
13646 if (typeof value != 'string') {
13647 return value === 0 ? value : +value;
13649 value = baseTrim(value);
13650 var isBinary = reIsBinary.test(value);
13651 return (isBinary || reIsOctal.test(value))
13652 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
13653 : (reIsBadHex.test(value) ? NAN : +value);
13657 * Converts `value` to a plain object flattening inherited enumerable string
13658 * keyed properties of `value` to own properties of the plain object.
13664 * @param {*} value The value to convert.
13665 * @returns {Object} Returns the converted plain object.
13672 * Foo.prototype.c = 3;
13674 * _.assign({ 'a': 1 }, new Foo);
13675 * // => { 'a': 1, 'b': 2 }
13677 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
13678 * // => { 'a': 1, 'b': 2, 'c': 3 }
13680 function toPlainObject(value) {
13681 return copyObject(value, keysIn(value));
13685 * Converts `value` to a safe integer. A safe integer can be compared and
13686 * represented correctly.
13692 * @param {*} value The value to convert.
13693 * @returns {number} Returns the converted integer.
13696 * _.toSafeInteger(3.2);
13699 * _.toSafeInteger(Number.MIN_VALUE);
13702 * _.toSafeInteger(Infinity);
13703 * // => 9007199254740991
13705 * _.toSafeInteger('3.2');
13708 function toSafeInteger(value) {
13710 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
13711 : (value === 0 ? value : 0);
13715 * Converts `value` to a string. An empty string is returned for `null`
13716 * and `undefined` values. The sign of `-0` is preserved.
13722 * @param {*} value The value to convert.
13723 * @returns {string} Returns the converted string.
13726 * _.toString(null);
13732 * _.toString([1, 2, 3]);
13735 function toString(value) {
13736 return value == null ? '' : baseToString(value);
13739 /*------------------------------------------------------------------------*/
13742 * Assigns own enumerable string keyed properties of source objects to the
13743 * destination object. Source objects are applied from left to right.
13744 * Subsequent sources overwrite property assignments of previous sources.
13746 * **Note:** This method mutates `object` and is loosely based on
13747 * [`Object.assign`](https://mdn.io/Object/assign).
13753 * @param {Object} object The destination object.
13754 * @param {...Object} [sources] The source objects.
13755 * @returns {Object} Returns `object`.
13767 * Foo.prototype.b = 2;
13768 * Bar.prototype.d = 4;
13770 * _.assign({ 'a': 0 }, new Foo, new Bar);
13771 * // => { 'a': 1, 'c': 3 }
13773 var assign = createAssigner(function(object, source) {
13774 if (isPrototype(source) || isArrayLike(source)) {
13775 copyObject(source, keys(source), object);
13778 for (var key in source) {
13779 if (hasOwnProperty.call(source, key)) {
13780 assignValue(object, key, source[key]);
13786 * This method is like `_.assign` except that it iterates over own and
13787 * inherited source properties.
13789 * **Note:** This method mutates `object`.
13796 * @param {Object} object The destination object.
13797 * @param {...Object} [sources] The source objects.
13798 * @returns {Object} Returns `object`.
13810 * Foo.prototype.b = 2;
13811 * Bar.prototype.d = 4;
13813 * _.assignIn({ 'a': 0 }, new Foo, new Bar);
13814 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
13816 var assignIn = createAssigner(function(object, source) {
13817 copyObject(source, keysIn(source), object);
13821 * This method is like `_.assignIn` except that it accepts `customizer`
13822 * which is invoked to produce the assigned values. If `customizer` returns
13823 * `undefined`, assignment is handled by the method instead. The `customizer`
13824 * is invoked with five arguments: (objValue, srcValue, key, object, source).
13826 * **Note:** This method mutates `object`.
13831 * @alias extendWith
13833 * @param {Object} object The destination object.
13834 * @param {...Object} sources The source objects.
13835 * @param {Function} [customizer] The function to customize assigned values.
13836 * @returns {Object} Returns `object`.
13837 * @see _.assignWith
13840 * function customizer(objValue, srcValue) {
13841 * return _.isUndefined(objValue) ? srcValue : objValue;
13844 * var defaults = _.partialRight(_.assignInWith, customizer);
13846 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
13847 * // => { 'a': 1, 'b': 2 }
13849 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
13850 copyObject(source, keysIn(source), object, customizer);
13854 * This method is like `_.assign` except that it accepts `customizer`
13855 * which is invoked to produce the assigned values. If `customizer` returns
13856 * `undefined`, assignment is handled by the method instead. The `customizer`
13857 * is invoked with five arguments: (objValue, srcValue, key, object, source).
13859 * **Note:** This method mutates `object`.
13865 * @param {Object} object The destination object.
13866 * @param {...Object} sources The source objects.
13867 * @param {Function} [customizer] The function to customize assigned values.
13868 * @returns {Object} Returns `object`.
13869 * @see _.assignInWith
13872 * function customizer(objValue, srcValue) {
13873 * return _.isUndefined(objValue) ? srcValue : objValue;
13876 * var defaults = _.partialRight(_.assignWith, customizer);
13878 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
13879 * // => { 'a': 1, 'b': 2 }
13881 var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
13882 copyObject(source, keys(source), object, customizer);
13886 * Creates an array of values corresponding to `paths` of `object`.
13892 * @param {Object} object The object to iterate over.
13893 * @param {...(string|string[])} [paths] The property paths to pick.
13894 * @returns {Array} Returns the picked values.
13897 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
13899 * _.at(object, ['a[0].b.c', 'a[1]']);
13902 var at = flatRest(baseAt);
13905 * Creates an object that inherits from the `prototype` object. If a
13906 * `properties` object is given, its own enumerable string keyed properties
13907 * are assigned to the created object.
13913 * @param {Object} prototype The object to inherit from.
13914 * @param {Object} [properties] The properties to assign to the object.
13915 * @returns {Object} Returns the new object.
13918 * function Shape() {
13923 * function Circle() {
13924 * Shape.call(this);
13927 * Circle.prototype = _.create(Shape.prototype, {
13928 * 'constructor': Circle
13931 * var circle = new Circle;
13932 * circle instanceof Circle;
13935 * circle instanceof Shape;
13938 function create(prototype, properties) {
13939 var result = baseCreate(prototype);
13940 return properties == null ? result : baseAssign(result, properties);
13944 * Assigns own and inherited enumerable string keyed properties of source
13945 * objects to the destination object for all destination properties that
13946 * resolve to `undefined`. Source objects are applied from left to right.
13947 * Once a property is set, additional values of the same property are ignored.
13949 * **Note:** This method mutates `object`.
13955 * @param {Object} object The destination object.
13956 * @param {...Object} [sources] The source objects.
13957 * @returns {Object} Returns `object`.
13958 * @see _.defaultsDeep
13961 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
13962 * // => { 'a': 1, 'b': 2 }
13964 var defaults = baseRest(function(object, sources) {
13965 object = Object(object);
13968 var length = sources.length;
13969 var guard = length > 2 ? sources[2] : undefined;
13971 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
13975 while (++index < length) {
13976 var source = sources[index];
13977 var props = keysIn(source);
13978 var propsIndex = -1;
13979 var propsLength = props.length;
13981 while (++propsIndex < propsLength) {
13982 var key = props[propsIndex];
13983 var value = object[key];
13985 if (value === undefined ||
13986 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
13987 object[key] = source[key];
13996 * This method is like `_.defaults` except that it recursively assigns
13997 * default properties.
13999 * **Note:** This method mutates `object`.
14005 * @param {Object} object The destination object.
14006 * @param {...Object} [sources] The source objects.
14007 * @returns {Object} Returns `object`.
14011 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
14012 * // => { 'a': { 'b': 2, 'c': 3 } }
14014 var defaultsDeep = baseRest(function(args) {
14015 args.push(undefined, customDefaultsMerge);
14016 return apply(mergeWith, undefined, args);
14020 * This method is like `_.find` except that it returns the key of the first
14021 * element `predicate` returns truthy for instead of the element itself.
14027 * @param {Object} object The object to inspect.
14028 * @param {Function} [predicate=_.identity] The function invoked per iteration.
14029 * @returns {string|undefined} Returns the key of the matched element,
14030 * else `undefined`.
14034 * 'barney': { 'age': 36, 'active': true },
14035 * 'fred': { 'age': 40, 'active': false },
14036 * 'pebbles': { 'age': 1, 'active': true }
14039 * _.findKey(users, function(o) { return o.age < 40; });
14040 * // => 'barney' (iteration order is not guaranteed)
14042 * // The `_.matches` iteratee shorthand.
14043 * _.findKey(users, { 'age': 1, 'active': true });
14046 * // The `_.matchesProperty` iteratee shorthand.
14047 * _.findKey(users, ['active', false]);
14050 * // The `_.property` iteratee shorthand.
14051 * _.findKey(users, 'active');
14054 function findKey(object, predicate) {
14055 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
14059 * This method is like `_.findKey` except that it iterates over elements of
14060 * a collection in the opposite order.
14066 * @param {Object} object The object to inspect.
14067 * @param {Function} [predicate=_.identity] The function invoked per iteration.
14068 * @returns {string|undefined} Returns the key of the matched element,
14069 * else `undefined`.
14073 * 'barney': { 'age': 36, 'active': true },
14074 * 'fred': { 'age': 40, 'active': false },
14075 * 'pebbles': { 'age': 1, 'active': true }
14078 * _.findLastKey(users, function(o) { return o.age < 40; });
14079 * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
14081 * // The `_.matches` iteratee shorthand.
14082 * _.findLastKey(users, { 'age': 36, 'active': true });
14085 * // The `_.matchesProperty` iteratee shorthand.
14086 * _.findLastKey(users, ['active', false]);
14089 * // The `_.property` iteratee shorthand.
14090 * _.findLastKey(users, 'active');
14093 function findLastKey(object, predicate) {
14094 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
14098 * Iterates over own and inherited enumerable string keyed properties of an
14099 * object and invokes `iteratee` for each property. The iteratee is invoked
14100 * with three arguments: (value, key, object). Iteratee functions may exit
14101 * iteration early by explicitly returning `false`.
14107 * @param {Object} object The object to iterate over.
14108 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14109 * @returns {Object} Returns `object`.
14110 * @see _.forInRight
14118 * Foo.prototype.c = 3;
14120 * _.forIn(new Foo, function(value, key) {
14121 * console.log(key);
14123 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
14125 function forIn(object, iteratee) {
14126 return object == null
14128 : baseFor(object, getIteratee(iteratee, 3), keysIn);
14132 * This method is like `_.forIn` except that it iterates over properties of
14133 * `object` in the opposite order.
14139 * @param {Object} object The object to iterate over.
14140 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14141 * @returns {Object} Returns `object`.
14150 * Foo.prototype.c = 3;
14152 * _.forInRight(new Foo, function(value, key) {
14153 * console.log(key);
14155 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
14157 function forInRight(object, iteratee) {
14158 return object == null
14160 : baseForRight(object, getIteratee(iteratee, 3), keysIn);
14164 * Iterates over own enumerable string keyed properties of an object and
14165 * invokes `iteratee` for each property. The iteratee is invoked with three
14166 * arguments: (value, key, object). Iteratee functions may exit iteration
14167 * early by explicitly returning `false`.
14173 * @param {Object} object The object to iterate over.
14174 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14175 * @returns {Object} Returns `object`.
14176 * @see _.forOwnRight
14184 * Foo.prototype.c = 3;
14186 * _.forOwn(new Foo, function(value, key) {
14187 * console.log(key);
14189 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
14191 function forOwn(object, iteratee) {
14192 return object && baseForOwn(object, getIteratee(iteratee, 3));
14196 * This method is like `_.forOwn` except that it iterates over properties of
14197 * `object` in the opposite order.
14203 * @param {Object} object The object to iterate over.
14204 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14205 * @returns {Object} Returns `object`.
14214 * Foo.prototype.c = 3;
14216 * _.forOwnRight(new Foo, function(value, key) {
14217 * console.log(key);
14219 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
14221 function forOwnRight(object, iteratee) {
14222 return object && baseForOwnRight(object, getIteratee(iteratee, 3));
14226 * Creates an array of function property names from own enumerable properties
14233 * @param {Object} object The object to inspect.
14234 * @returns {Array} Returns the function names.
14235 * @see _.functionsIn
14239 * this.a = _.constant('a');
14240 * this.b = _.constant('b');
14243 * Foo.prototype.c = _.constant('c');
14245 * _.functions(new Foo);
14248 function functions(object) {
14249 return object == null ? [] : baseFunctions(object, keys(object));
14253 * Creates an array of function property names from own and inherited
14254 * enumerable properties of `object`.
14260 * @param {Object} object The object to inspect.
14261 * @returns {Array} Returns the function names.
14266 * this.a = _.constant('a');
14267 * this.b = _.constant('b');
14270 * Foo.prototype.c = _.constant('c');
14272 * _.functionsIn(new Foo);
14273 * // => ['a', 'b', 'c']
14275 function functionsIn(object) {
14276 return object == null ? [] : baseFunctions(object, keysIn(object));
14280 * Gets the value at `path` of `object`. If the resolved value is
14281 * `undefined`, the `defaultValue` is returned in its place.
14287 * @param {Object} object The object to query.
14288 * @param {Array|string} path The path of the property to get.
14289 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
14290 * @returns {*} Returns the resolved value.
14293 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
14295 * _.get(object, 'a[0].b.c');
14298 * _.get(object, ['a', '0', 'b', 'c']);
14301 * _.get(object, 'a.b.c', 'default');
14304 function get(object, path, defaultValue) {
14305 var result = object == null ? undefined : baseGet(object, path);
14306 return result === undefined ? defaultValue : result;
14310 * Checks if `path` is a direct property of `object`.
14316 * @param {Object} object The object to query.
14317 * @param {Array|string} path The path to check.
14318 * @returns {boolean} Returns `true` if `path` exists, else `false`.
14321 * var object = { 'a': { 'b': 2 } };
14322 * var other = _.create({ 'a': _.create({ 'b': 2 }) });
14324 * _.has(object, 'a');
14327 * _.has(object, 'a.b');
14330 * _.has(object, ['a', 'b']);
14333 * _.has(other, 'a');
14336 function has(object, path) {
14337 return object != null && hasPath(object, path, baseHas);
14341 * Checks if `path` is a direct or inherited property of `object`.
14347 * @param {Object} object The object to query.
14348 * @param {Array|string} path The path to check.
14349 * @returns {boolean} Returns `true` if `path` exists, else `false`.
14352 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
14354 * _.hasIn(object, 'a');
14357 * _.hasIn(object, 'a.b');
14360 * _.hasIn(object, ['a', 'b']);
14363 * _.hasIn(object, 'b');
14366 function hasIn(object, path) {
14367 return object != null && hasPath(object, path, baseHasIn);
14371 * Creates an object composed of the inverted keys and values of `object`.
14372 * If `object` contains duplicate values, subsequent values overwrite
14373 * property assignments of previous values.
14379 * @param {Object} object The object to invert.
14380 * @returns {Object} Returns the new inverted object.
14383 * var object = { 'a': 1, 'b': 2, 'c': 1 };
14385 * _.invert(object);
14386 * // => { '1': 'c', '2': 'b' }
14388 var invert = createInverter(function(result, value, key) {
14389 if (value != null &&
14390 typeof value.toString != 'function') {
14391 value = nativeObjectToString.call(value);
14394 result[value] = key;
14395 }, constant(identity));
14398 * This method is like `_.invert` except that the inverted object is generated
14399 * from the results of running each element of `object` thru `iteratee`. The
14400 * corresponding inverted value of each inverted key is an array of keys
14401 * responsible for generating the inverted value. The iteratee is invoked
14402 * with one argument: (value).
14408 * @param {Object} object The object to invert.
14409 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
14410 * @returns {Object} Returns the new inverted object.
14413 * var object = { 'a': 1, 'b': 2, 'c': 1 };
14415 * _.invertBy(object);
14416 * // => { '1': ['a', 'c'], '2': ['b'] }
14418 * _.invertBy(object, function(value) {
14419 * return 'group' + value;
14421 * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
14423 var invertBy = createInverter(function(result, value, key) {
14424 if (value != null &&
14425 typeof value.toString != 'function') {
14426 value = nativeObjectToString.call(value);
14429 if (hasOwnProperty.call(result, value)) {
14430 result[value].push(key);
14432 result[value] = [key];
14437 * Invokes the method at `path` of `object`.
14443 * @param {Object} object The object to query.
14444 * @param {Array|string} path The path of the method to invoke.
14445 * @param {...*} [args] The arguments to invoke the method with.
14446 * @returns {*} Returns the result of the invoked method.
14449 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
14451 * _.invoke(object, 'a[0].b.c.slice', 1, 3);
14454 var invoke = baseRest(baseInvoke);
14457 * Creates an array of the own enumerable property names of `object`.
14459 * **Note:** Non-object values are coerced to objects. See the
14460 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
14461 * for more details.
14467 * @param {Object} object The object to query.
14468 * @returns {Array} Returns the array of property names.
14476 * Foo.prototype.c = 3;
14479 * // => ['a', 'b'] (iteration order is not guaranteed)
14484 function keys(object) {
14485 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
14489 * Creates an array of the own and inherited enumerable property names of `object`.
14491 * **Note:** Non-object values are coerced to objects.
14497 * @param {Object} object The object to query.
14498 * @returns {Array} Returns the array of property names.
14506 * Foo.prototype.c = 3;
14508 * _.keysIn(new Foo);
14509 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
14511 function keysIn(object) {
14512 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
14516 * The opposite of `_.mapValues`; this method creates an object with the
14517 * same values as `object` and keys generated by running each own enumerable
14518 * string keyed property of `object` thru `iteratee`. The iteratee is invoked
14519 * with three arguments: (value, key, object).
14525 * @param {Object} object The object to iterate over.
14526 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14527 * @returns {Object} Returns the new mapped object.
14531 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
14532 * return key + value;
14534 * // => { 'a1': 1, 'b2': 2 }
14536 function mapKeys(object, iteratee) {
14538 iteratee = getIteratee(iteratee, 3);
14540 baseForOwn(object, function(value, key, object) {
14541 baseAssignValue(result, iteratee(value, key, object), value);
14547 * Creates an object with the same keys as `object` and values generated
14548 * by running each own enumerable string keyed property of `object` thru
14549 * `iteratee`. The iteratee is invoked with three arguments:
14550 * (value, key, object).
14556 * @param {Object} object The object to iterate over.
14557 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14558 * @returns {Object} Returns the new mapped object.
14563 * 'fred': { 'user': 'fred', 'age': 40 },
14564 * 'pebbles': { 'user': 'pebbles', 'age': 1 }
14567 * _.mapValues(users, function(o) { return o.age; });
14568 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
14570 * // The `_.property` iteratee shorthand.
14571 * _.mapValues(users, 'age');
14572 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
14574 function mapValues(object, iteratee) {
14576 iteratee = getIteratee(iteratee, 3);
14578 baseForOwn(object, function(value, key, object) {
14579 baseAssignValue(result, key, iteratee(value, key, object));
14585 * This method is like `_.assign` except that it recursively merges own and
14586 * inherited enumerable string keyed properties of source objects into the
14587 * destination object. Source properties that resolve to `undefined` are
14588 * skipped if a destination value exists. Array and plain object properties
14589 * are merged recursively. Other objects and value types are overridden by
14590 * assignment. Source objects are applied from left to right. Subsequent
14591 * sources overwrite property assignments of previous sources.
14593 * **Note:** This method mutates `object`.
14599 * @param {Object} object The destination object.
14600 * @param {...Object} [sources] The source objects.
14601 * @returns {Object} Returns `object`.
14605 * 'a': [{ 'b': 2 }, { 'd': 4 }]
14609 * 'a': [{ 'c': 3 }, { 'e': 5 }]
14612 * _.merge(object, other);
14613 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
14615 var merge = createAssigner(function(object, source, srcIndex) {
14616 baseMerge(object, source, srcIndex);
14620 * This method is like `_.merge` except that it accepts `customizer` which
14621 * is invoked to produce the merged values of the destination and source
14622 * properties. If `customizer` returns `undefined`, merging is handled by the
14623 * method instead. The `customizer` is invoked with six arguments:
14624 * (objValue, srcValue, key, object, source, stack).
14626 * **Note:** This method mutates `object`.
14632 * @param {Object} object The destination object.
14633 * @param {...Object} sources The source objects.
14634 * @param {Function} customizer The function to customize assigned values.
14635 * @returns {Object} Returns `object`.
14638 * function customizer(objValue, srcValue) {
14639 * if (_.isArray(objValue)) {
14640 * return objValue.concat(srcValue);
14644 * var object = { 'a': [1], 'b': [2] };
14645 * var other = { 'a': [3], 'b': [4] };
14647 * _.mergeWith(object, other, customizer);
14648 * // => { 'a': [1, 3], 'b': [2, 4] }
14650 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
14651 baseMerge(object, source, srcIndex, customizer);
14655 * The opposite of `_.pick`; this method creates an object composed of the
14656 * own and inherited enumerable property paths of `object` that are not omitted.
14658 * **Note:** This method is considerably slower than `_.pick`.
14664 * @param {Object} object The source object.
14665 * @param {...(string|string[])} [paths] The property paths to omit.
14666 * @returns {Object} Returns the new object.
14669 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14671 * _.omit(object, ['a', 'c']);
14672 * // => { 'b': '2' }
14674 var omit = flatRest(function(object, paths) {
14676 if (object == null) {
14679 var isDeep = false;
14680 paths = arrayMap(paths, function(path) {
14681 path = castPath(path, object);
14682 isDeep || (isDeep = path.length > 1);
14685 copyObject(object, getAllKeysIn(object), result);
14687 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
14689 var length = paths.length;
14691 baseUnset(result, paths[length]);
14697 * The opposite of `_.pickBy`; this method creates an object composed of
14698 * the own and inherited enumerable string keyed properties of `object` that
14699 * `predicate` doesn't return truthy for. The predicate is invoked with two
14700 * arguments: (value, key).
14706 * @param {Object} object The source object.
14707 * @param {Function} [predicate=_.identity] The function invoked per property.
14708 * @returns {Object} Returns the new object.
14711 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14713 * _.omitBy(object, _.isNumber);
14714 * // => { 'b': '2' }
14716 function omitBy(object, predicate) {
14717 return pickBy(object, negate(getIteratee(predicate)));
14721 * Creates an object composed of the picked `object` properties.
14727 * @param {Object} object The source object.
14728 * @param {...(string|string[])} [paths] The property paths to pick.
14729 * @returns {Object} Returns the new object.
14732 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14734 * _.pick(object, ['a', 'c']);
14735 * // => { 'a': 1, 'c': 3 }
14737 var pick = flatRest(function(object, paths) {
14738 return object == null ? {} : basePick(object, paths);
14742 * Creates an object composed of the `object` properties `predicate` returns
14743 * truthy for. The predicate is invoked with two arguments: (value, key).
14749 * @param {Object} object The source object.
14750 * @param {Function} [predicate=_.identity] The function invoked per property.
14751 * @returns {Object} Returns the new object.
14754 * var object = { 'a': 1, 'b': '2', 'c': 3 };
14756 * _.pickBy(object, _.isNumber);
14757 * // => { 'a': 1, 'c': 3 }
14759 function pickBy(object, predicate) {
14760 if (object == null) {
14763 var props = arrayMap(getAllKeysIn(object), function(prop) {
14766 predicate = getIteratee(predicate);
14767 return basePickBy(object, props, function(value, path) {
14768 return predicate(value, path[0]);
14773 * This method is like `_.get` except that if the resolved value is a
14774 * function it's invoked with the `this` binding of its parent object and
14775 * its result is returned.
14781 * @param {Object} object The object to query.
14782 * @param {Array|string} path The path of the property to resolve.
14783 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
14784 * @returns {*} Returns the resolved value.
14787 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
14789 * _.result(object, 'a[0].b.c1');
14792 * _.result(object, 'a[0].b.c2');
14795 * _.result(object, 'a[0].b.c3', 'default');
14798 * _.result(object, 'a[0].b.c3', _.constant('default'));
14801 function result(object, path, defaultValue) {
14802 path = castPath(path, object);
14805 length = path.length;
14807 // Ensure the loop is entered when path is empty.
14810 object = undefined;
14812 while (++index < length) {
14813 var value = object == null ? undefined : object[toKey(path[index])];
14814 if (value === undefined) {
14816 value = defaultValue;
14818 object = isFunction(value) ? value.call(object) : value;
14824 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
14825 * it's created. Arrays are created for missing index properties while objects
14826 * are created for all other missing properties. Use `_.setWith` to customize
14829 * **Note:** This method mutates `object`.
14835 * @param {Object} object The object to modify.
14836 * @param {Array|string} path The path of the property to set.
14837 * @param {*} value The value to set.
14838 * @returns {Object} Returns `object`.
14841 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
14843 * _.set(object, 'a[0].b.c', 4);
14844 * console.log(object.a[0].b.c);
14847 * _.set(object, ['x', '0', 'y', 'z'], 5);
14848 * console.log(object.x[0].y.z);
14851 function set(object, path, value) {
14852 return object == null ? object : baseSet(object, path, value);
14856 * This method is like `_.set` except that it accepts `customizer` which is
14857 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
14858 * path creation is handled by the method instead. The `customizer` is invoked
14859 * with three arguments: (nsValue, key, nsObject).
14861 * **Note:** This method mutates `object`.
14867 * @param {Object} object The object to modify.
14868 * @param {Array|string} path The path of the property to set.
14869 * @param {*} value The value to set.
14870 * @param {Function} [customizer] The function to customize assigned values.
14871 * @returns {Object} Returns `object`.
14876 * _.setWith(object, '[0][1]', 'a', Object);
14877 * // => { '0': { '1': 'a' } }
14879 function setWith(object, path, value, customizer) {
14880 customizer = typeof customizer == 'function' ? customizer : undefined;
14881 return object == null ? object : baseSet(object, path, value, customizer);
14885 * Creates an array of own enumerable string keyed-value pairs for `object`
14886 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
14887 * entries are returned.
14894 * @param {Object} object The object to query.
14895 * @returns {Array} Returns the key-value pairs.
14903 * Foo.prototype.c = 3;
14905 * _.toPairs(new Foo);
14906 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
14908 var toPairs = createToPairs(keys);
14911 * Creates an array of own and inherited enumerable string keyed-value pairs
14912 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
14913 * or set, its entries are returned.
14920 * @param {Object} object The object to query.
14921 * @returns {Array} Returns the key-value pairs.
14929 * Foo.prototype.c = 3;
14931 * _.toPairsIn(new Foo);
14932 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
14934 var toPairsIn = createToPairs(keysIn);
14937 * An alternative to `_.reduce`; this method transforms `object` to a new
14938 * `accumulator` object which is the result of running each of its own
14939 * enumerable string keyed properties thru `iteratee`, with each invocation
14940 * potentially mutating the `accumulator` object. If `accumulator` is not
14941 * provided, a new object with the same `[[Prototype]]` will be used. The
14942 * iteratee is invoked with four arguments: (accumulator, value, key, object).
14943 * Iteratee functions may exit iteration early by explicitly returning `false`.
14949 * @param {Object} object The object to iterate over.
14950 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
14951 * @param {*} [accumulator] The custom accumulator value.
14952 * @returns {*} Returns the accumulated value.
14955 * _.transform([2, 3, 4], function(result, n) {
14956 * result.push(n *= n);
14957 * return n % 2 == 0;
14961 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
14962 * (result[value] || (result[value] = [])).push(key);
14964 * // => { '1': ['a', 'c'], '2': ['b'] }
14966 function transform(object, iteratee, accumulator) {
14967 var isArr = isArray(object),
14968 isArrLike = isArr || isBuffer(object) || isTypedArray(object);
14970 iteratee = getIteratee(iteratee, 4);
14971 if (accumulator == null) {
14972 var Ctor = object && object.constructor;
14974 accumulator = isArr ? new Ctor : [];
14976 else if (isObject(object)) {
14977 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
14983 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
14984 return iteratee(accumulator, value, index, object);
14986 return accumulator;
14990 * Removes the property at `path` of `object`.
14992 * **Note:** This method mutates `object`.
14998 * @param {Object} object The object to modify.
14999 * @param {Array|string} path The path of the property to unset.
15000 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
15003 * var object = { 'a': [{ 'b': { 'c': 7 } }] };
15004 * _.unset(object, 'a[0].b.c');
15007 * console.log(object);
15008 * // => { 'a': [{ 'b': {} }] };
15010 * _.unset(object, ['a', '0', 'b', 'c']);
15013 * console.log(object);
15014 * // => { 'a': [{ 'b': {} }] };
15016 function unset(object, path) {
15017 return object == null ? true : baseUnset(object, path);
15021 * This method is like `_.set` except that accepts `updater` to produce the
15022 * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
15023 * is invoked with one argument: (value).
15025 * **Note:** This method mutates `object`.
15031 * @param {Object} object The object to modify.
15032 * @param {Array|string} path The path of the property to set.
15033 * @param {Function} updater The function to produce the updated value.
15034 * @returns {Object} Returns `object`.
15037 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
15039 * _.update(object, 'a[0].b.c', function(n) { return n * n; });
15040 * console.log(object.a[0].b.c);
15043 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
15044 * console.log(object.x[0].y.z);
15047 function update(object, path, updater) {
15048 return object == null ? object : baseUpdate(object, path, castFunction(updater));
15052 * This method is like `_.update` except that it accepts `customizer` which is
15053 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
15054 * path creation is handled by the method instead. The `customizer` is invoked
15055 * with three arguments: (nsValue, key, nsObject).
15057 * **Note:** This method mutates `object`.
15063 * @param {Object} object The object to modify.
15064 * @param {Array|string} path The path of the property to set.
15065 * @param {Function} updater The function to produce the updated value.
15066 * @param {Function} [customizer] The function to customize assigned values.
15067 * @returns {Object} Returns `object`.
15072 * _.updateWith(object, '[0][1]', _.constant('a'), Object);
15073 * // => { '0': { '1': 'a' } }
15075 function updateWith(object, path, updater, customizer) {
15076 customizer = typeof customizer == 'function' ? customizer : undefined;
15077 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
15081 * Creates an array of the own enumerable string keyed property values of `object`.
15083 * **Note:** Non-object values are coerced to objects.
15089 * @param {Object} object The object to query.
15090 * @returns {Array} Returns the array of property values.
15098 * Foo.prototype.c = 3;
15100 * _.values(new Foo);
15101 * // => [1, 2] (iteration order is not guaranteed)
15106 function values(object) {
15107 return object == null ? [] : baseValues(object, keys(object));
15111 * Creates an array of the own and inherited enumerable string keyed property
15112 * values of `object`.
15114 * **Note:** Non-object values are coerced to objects.
15120 * @param {Object} object The object to query.
15121 * @returns {Array} Returns the array of property values.
15129 * Foo.prototype.c = 3;
15131 * _.valuesIn(new Foo);
15132 * // => [1, 2, 3] (iteration order is not guaranteed)
15134 function valuesIn(object) {
15135 return object == null ? [] : baseValues(object, keysIn(object));
15138 /*------------------------------------------------------------------------*/
15141 * Clamps `number` within the inclusive `lower` and `upper` bounds.
15147 * @param {number} number The number to clamp.
15148 * @param {number} [lower] The lower bound.
15149 * @param {number} upper The upper bound.
15150 * @returns {number} Returns the clamped number.
15153 * _.clamp(-10, -5, 5);
15156 * _.clamp(10, -5, 5);
15159 function clamp(number, lower, upper) {
15160 if (upper === undefined) {
15164 if (upper !== undefined) {
15165 upper = toNumber(upper);
15166 upper = upper === upper ? upper : 0;
15168 if (lower !== undefined) {
15169 lower = toNumber(lower);
15170 lower = lower === lower ? lower : 0;
15172 return baseClamp(toNumber(number), lower, upper);
15176 * Checks if `n` is between `start` and up to, but not including, `end`. If
15177 * `end` is not specified, it's set to `start` with `start` then set to `0`.
15178 * If `start` is greater than `end` the params are swapped to support
15185 * @param {number} number The number to check.
15186 * @param {number} [start=0] The start of the range.
15187 * @param {number} end The end of the range.
15188 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
15189 * @see _.range, _.rangeRight
15192 * _.inRange(3, 2, 4);
15204 * _.inRange(1.2, 2);
15207 * _.inRange(5.2, 4);
15210 * _.inRange(-3, -2, -6);
15213 function inRange(number, start, end) {
15214 start = toFinite(start);
15215 if (end === undefined) {
15219 end = toFinite(end);
15221 number = toNumber(number);
15222 return baseInRange(number, start, end);
15226 * Produces a random number between the inclusive `lower` and `upper` bounds.
15227 * If only one argument is provided a number between `0` and the given number
15228 * is returned. If `floating` is `true`, or either `lower` or `upper` are
15229 * floats, a floating-point number is returned instead of an integer.
15231 * **Note:** JavaScript follows the IEEE-754 standard for resolving
15232 * floating-point values which can produce unexpected results.
15238 * @param {number} [lower=0] The lower bound.
15239 * @param {number} [upper=1] The upper bound.
15240 * @param {boolean} [floating] Specify returning a floating-point number.
15241 * @returns {number} Returns the random number.
15245 * // => an integer between 0 and 5
15248 * // => also an integer between 0 and 5
15250 * _.random(5, true);
15251 * // => a floating-point number between 0 and 5
15253 * _.random(1.2, 5.2);
15254 * // => a floating-point number between 1.2 and 5.2
15256 function random(lower, upper, floating) {
15257 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
15258 upper = floating = undefined;
15260 if (floating === undefined) {
15261 if (typeof upper == 'boolean') {
15265 else if (typeof lower == 'boolean') {
15270 if (lower === undefined && upper === undefined) {
15275 lower = toFinite(lower);
15276 if (upper === undefined) {
15280 upper = toFinite(upper);
15283 if (lower > upper) {
15288 if (floating || lower % 1 || upper % 1) {
15289 var rand = nativeRandom();
15290 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
15292 return baseRandom(lower, upper);
15295 /*------------------------------------------------------------------------*/
15298 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
15304 * @param {string} [string=''] The string to convert.
15305 * @returns {string} Returns the camel cased string.
15308 * _.camelCase('Foo Bar');
15311 * _.camelCase('--foo-bar--');
15314 * _.camelCase('__FOO_BAR__');
15317 var camelCase = createCompounder(function(result, word, index) {
15318 word = word.toLowerCase();
15319 return result + (index ? capitalize(word) : word);
15323 * Converts the first character of `string` to upper case and the remaining
15330 * @param {string} [string=''] The string to capitalize.
15331 * @returns {string} Returns the capitalized string.
15334 * _.capitalize('FRED');
15337 function capitalize(string) {
15338 return upperFirst(toString(string).toLowerCase());
15342 * Deburrs `string` by converting
15343 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
15344 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
15345 * letters to basic Latin letters and removing
15346 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
15352 * @param {string} [string=''] The string to deburr.
15353 * @returns {string} Returns the deburred string.
15356 * _.deburr('déjà vu');
15359 function deburr(string) {
15360 string = toString(string);
15361 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
15365 * Checks if `string` ends with the given target string.
15371 * @param {string} [string=''] The string to inspect.
15372 * @param {string} [target] The string to search for.
15373 * @param {number} [position=string.length] The position to search up to.
15374 * @returns {boolean} Returns `true` if `string` ends with `target`,
15378 * _.endsWith('abc', 'c');
15381 * _.endsWith('abc', 'b');
15384 * _.endsWith('abc', 'b', 2);
15387 function endsWith(string, target, position) {
15388 string = toString(string);
15389 target = baseToString(target);
15391 var length = string.length;
15392 position = position === undefined
15394 : baseClamp(toInteger(position), 0, length);
15396 var end = position;
15397 position -= target.length;
15398 return position >= 0 && string.slice(position, end) == target;
15402 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
15403 * corresponding HTML entities.
15405 * **Note:** No other characters are escaped. To escape additional
15406 * characters use a third-party library like [_he_](https://mths.be/he).
15408 * Though the ">" character is escaped for symmetry, characters like
15409 * ">" and "/" don't need escaping in HTML and have no special meaning
15410 * unless they're part of a tag or unquoted attribute value. See
15411 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
15412 * (under "semi-related fun fact") for more details.
15414 * When working with HTML you should always
15415 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
15422 * @param {string} [string=''] The string to escape.
15423 * @returns {string} Returns the escaped string.
15426 * _.escape('fred, barney, & pebbles');
15427 * // => 'fred, barney, & pebbles'
15429 function escape(string) {
15430 string = toString(string);
15431 return (string && reHasUnescapedHtml.test(string))
15432 ? string.replace(reUnescapedHtml, escapeHtmlChar)
15437 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
15438 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
15444 * @param {string} [string=''] The string to escape.
15445 * @returns {string} Returns the escaped string.
15448 * _.escapeRegExp('[lodash](https://lodash.com/)');
15449 * // => '\[lodash\]\(https://lodash\.com/\)'
15451 function escapeRegExp(string) {
15452 string = toString(string);
15453 return (string && reHasRegExpChar.test(string))
15454 ? string.replace(reRegExpChar, '\\$&')
15459 * Converts `string` to
15460 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
15466 * @param {string} [string=''] The string to convert.
15467 * @returns {string} Returns the kebab cased string.
15470 * _.kebabCase('Foo Bar');
15473 * _.kebabCase('fooBar');
15476 * _.kebabCase('__FOO_BAR__');
15479 var kebabCase = createCompounder(function(result, word, index) {
15480 return result + (index ? '-' : '') + word.toLowerCase();
15484 * Converts `string`, as space separated words, to lower case.
15490 * @param {string} [string=''] The string to convert.
15491 * @returns {string} Returns the lower cased string.
15494 * _.lowerCase('--Foo-Bar--');
15497 * _.lowerCase('fooBar');
15500 * _.lowerCase('__FOO_BAR__');
15503 var lowerCase = createCompounder(function(result, word, index) {
15504 return result + (index ? ' ' : '') + word.toLowerCase();
15508 * Converts the first character of `string` to lower case.
15514 * @param {string} [string=''] The string to convert.
15515 * @returns {string} Returns the converted string.
15518 * _.lowerFirst('Fred');
15521 * _.lowerFirst('FRED');
15524 var lowerFirst = createCaseFirst('toLowerCase');
15527 * Pads `string` on the left and right sides if it's shorter than `length`.
15528 * Padding characters are truncated if they can't be evenly divided by `length`.
15534 * @param {string} [string=''] The string to pad.
15535 * @param {number} [length=0] The padding length.
15536 * @param {string} [chars=' '] The string used as padding.
15537 * @returns {string} Returns the padded string.
15543 * _.pad('abc', 8, '_-');
15549 function pad(string, length, chars) {
15550 string = toString(string);
15551 length = toInteger(length);
15553 var strLength = length ? stringSize(string) : 0;
15554 if (!length || strLength >= length) {
15557 var mid = (length - strLength) / 2;
15559 createPadding(nativeFloor(mid), chars) +
15561 createPadding(nativeCeil(mid), chars)
15566 * Pads `string` on the right side if it's shorter than `length`. Padding
15567 * characters are truncated if they exceed `length`.
15573 * @param {string} [string=''] The string to pad.
15574 * @param {number} [length=0] The padding length.
15575 * @param {string} [chars=' '] The string used as padding.
15576 * @returns {string} Returns the padded string.
15579 * _.padEnd('abc', 6);
15582 * _.padEnd('abc', 6, '_-');
15585 * _.padEnd('abc', 3);
15588 function padEnd(string, length, chars) {
15589 string = toString(string);
15590 length = toInteger(length);
15592 var strLength = length ? stringSize(string) : 0;
15593 return (length && strLength < length)
15594 ? (string + createPadding(length - strLength, chars))
15599 * Pads `string` on the left side if it's shorter than `length`. Padding
15600 * characters are truncated if they exceed `length`.
15606 * @param {string} [string=''] The string to pad.
15607 * @param {number} [length=0] The padding length.
15608 * @param {string} [chars=' '] The string used as padding.
15609 * @returns {string} Returns the padded string.
15612 * _.padStart('abc', 6);
15615 * _.padStart('abc', 6, '_-');
15618 * _.padStart('abc', 3);
15621 function padStart(string, length, chars) {
15622 string = toString(string);
15623 length = toInteger(length);
15625 var strLength = length ? stringSize(string) : 0;
15626 return (length && strLength < length)
15627 ? (createPadding(length - strLength, chars) + string)
15632 * Converts `string` to an integer of the specified radix. If `radix` is
15633 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
15634 * hexadecimal, in which case a `radix` of `16` is used.
15636 * **Note:** This method aligns with the
15637 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
15643 * @param {string} string The string to convert.
15644 * @param {number} [radix=10] The radix to interpret `value` by.
15645 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15646 * @returns {number} Returns the converted integer.
15649 * _.parseInt('08');
15652 * _.map(['6', '08', '10'], _.parseInt);
15655 function parseInt(string, radix, guard) {
15656 if (guard || radix == null) {
15658 } else if (radix) {
15661 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
15665 * Repeats the given string `n` times.
15671 * @param {string} [string=''] The string to repeat.
15672 * @param {number} [n=1] The number of times to repeat the string.
15673 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15674 * @returns {string} Returns the repeated string.
15677 * _.repeat('*', 3);
15680 * _.repeat('abc', 2);
15683 * _.repeat('abc', 0);
15686 function repeat(string, n, guard) {
15687 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
15692 return baseRepeat(toString(string), n);
15696 * Replaces matches for `pattern` in `string` with `replacement`.
15698 * **Note:** This method is based on
15699 * [`String#replace`](https://mdn.io/String/replace).
15705 * @param {string} [string=''] The string to modify.
15706 * @param {RegExp|string} pattern The pattern to replace.
15707 * @param {Function|string} replacement The match replacement.
15708 * @returns {string} Returns the modified string.
15711 * _.replace('Hi Fred', 'Fred', 'Barney');
15712 * // => 'Hi Barney'
15714 function replace() {
15715 var args = arguments,
15716 string = toString(args[0]);
15718 return args.length < 3 ? string : string.replace(args[1], args[2]);
15722 * Converts `string` to
15723 * [snake case](https://en.wikipedia.org/wiki/Snake_case).
15729 * @param {string} [string=''] The string to convert.
15730 * @returns {string} Returns the snake cased string.
15733 * _.snakeCase('Foo Bar');
15736 * _.snakeCase('fooBar');
15739 * _.snakeCase('--FOO-BAR--');
15742 var snakeCase = createCompounder(function(result, word, index) {
15743 return result + (index ? '_' : '') + word.toLowerCase();
15747 * Splits `string` by `separator`.
15749 * **Note:** This method is based on
15750 * [`String#split`](https://mdn.io/String/split).
15756 * @param {string} [string=''] The string to split.
15757 * @param {RegExp|string} separator The separator pattern to split by.
15758 * @param {number} [limit] The length to truncate results to.
15759 * @returns {Array} Returns the string segments.
15762 * _.split('a-b-c', '-', 2);
15765 function split(string, separator, limit) {
15766 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
15767 separator = limit = undefined;
15769 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
15773 string = toString(string);
15775 typeof separator == 'string' ||
15776 (separator != null && !isRegExp(separator))
15778 separator = baseToString(separator);
15779 if (!separator && hasUnicode(string)) {
15780 return castSlice(stringToArray(string), 0, limit);
15783 return string.split(separator, limit);
15787 * Converts `string` to
15788 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
15794 * @param {string} [string=''] The string to convert.
15795 * @returns {string} Returns the start cased string.
15798 * _.startCase('--foo-bar--');
15801 * _.startCase('fooBar');
15804 * _.startCase('__FOO_BAR__');
15807 var startCase = createCompounder(function(result, word, index) {
15808 return result + (index ? ' ' : '') + upperFirst(word);
15812 * Checks if `string` starts with the given target string.
15818 * @param {string} [string=''] The string to inspect.
15819 * @param {string} [target] The string to search for.
15820 * @param {number} [position=0] The position to search from.
15821 * @returns {boolean} Returns `true` if `string` starts with `target`,
15825 * _.startsWith('abc', 'a');
15828 * _.startsWith('abc', 'b');
15831 * _.startsWith('abc', 'b', 1);
15834 function startsWith(string, target, position) {
15835 string = toString(string);
15836 position = position == null
15838 : baseClamp(toInteger(position), 0, string.length);
15840 target = baseToString(target);
15841 return string.slice(position, position + target.length) == target;
15845 * Creates a compiled template function that can interpolate data properties
15846 * in "interpolate" delimiters, HTML-escape interpolated data properties in
15847 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
15848 * properties may be accessed as free variables in the template. If a setting
15849 * object is given, it takes precedence over `_.templateSettings` values.
15851 * **Note:** In the development build `_.template` utilizes
15852 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
15853 * for easier debugging.
15855 * For more information on precompiling templates see
15856 * [lodash's custom builds documentation](https://lodash.com/custom-builds).
15858 * For more information on Chrome extension sandboxes see
15859 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
15865 * @param {string} [string=''] The template string.
15866 * @param {Object} [options={}] The options object.
15867 * @param {RegExp} [options.escape=_.templateSettings.escape]
15868 * The HTML "escape" delimiter.
15869 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
15870 * The "evaluate" delimiter.
15871 * @param {Object} [options.imports=_.templateSettings.imports]
15872 * An object to import into the template as free variables.
15873 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
15874 * The "interpolate" delimiter.
15875 * @param {string} [options.sourceURL='lodash.templateSources[n]']
15876 * The sourceURL of the compiled template.
15877 * @param {string} [options.variable='obj']
15878 * The data object variable name.
15879 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15880 * @returns {Function} Returns the compiled template function.
15883 * // Use the "interpolate" delimiter to create a compiled template.
15884 * var compiled = _.template('hello <%= user %>!');
15885 * compiled({ 'user': 'fred' });
15886 * // => 'hello fred!'
15888 * // Use the HTML "escape" delimiter to escape data property values.
15889 * var compiled = _.template('<b><%- value %></b>');
15890 * compiled({ 'value': '<script>' });
15891 * // => '<b><script></b>'
15893 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
15894 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
15895 * compiled({ 'users': ['fred', 'barney'] });
15896 * // => '<li>fred</li><li>barney</li>'
15898 * // Use the internal `print` function in "evaluate" delimiters.
15899 * var compiled = _.template('<% print("hello " + user); %>!');
15900 * compiled({ 'user': 'barney' });
15901 * // => 'hello barney!'
15903 * // Use the ES template literal delimiter as an "interpolate" delimiter.
15904 * // Disable support by replacing the "interpolate" delimiter.
15905 * var compiled = _.template('hello ${ user }!');
15906 * compiled({ 'user': 'pebbles' });
15907 * // => 'hello pebbles!'
15909 * // Use backslashes to treat delimiters as plain text.
15910 * var compiled = _.template('<%= "\\<%- value %\\>" %>');
15911 * compiled({ 'value': 'ignored' });
15912 * // => '<%- value %>'
15914 * // Use the `imports` option to import `jQuery` as `jq`.
15915 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
15916 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
15917 * compiled({ 'users': ['fred', 'barney'] });
15918 * // => '<li>fred</li><li>barney</li>'
15920 * // Use the `sourceURL` option to specify a custom sourceURL for the template.
15921 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
15923 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
15925 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
15926 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
15928 * // => function(data) {
15929 * // var __t, __p = '';
15930 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
15934 * // Use custom template delimiters.
15935 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
15936 * var compiled = _.template('hello {{ user }}!');
15937 * compiled({ 'user': 'mustache' });
15938 * // => 'hello mustache!'
15940 * // Use the `source` property to inline compiled templates for meaningful
15941 * // line numbers in error messages and stack traces.
15942 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
15944 * "main": ' + _.template(mainText).source + '\
15948 function template(string, options, guard) {
15949 // Based on John Resig's `tmpl` implementation
15950 // (http://ejohn.org/blog/javascript-micro-templating/)
15951 // and Laura Doktorova's doT.js (https://github.com/olado/doT).
15952 var settings = lodash.templateSettings;
15954 if (guard && isIterateeCall(string, options, guard)) {
15955 options = undefined;
15957 string = toString(string);
15958 options = assignInWith({}, options, settings, customDefaultsAssignIn);
15960 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
15961 importsKeys = keys(imports),
15962 importsValues = baseValues(imports, importsKeys);
15967 interpolate = options.interpolate || reNoMatch,
15968 source = "__p += '";
15970 // Compile the regexp to match each delimiter.
15971 var reDelimiters = RegExp(
15972 (options.escape || reNoMatch).source + '|' +
15973 interpolate.source + '|' +
15974 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
15975 (options.evaluate || reNoMatch).source + '|$'
15978 // Use a sourceURL for easier debugging.
15979 // The sourceURL gets injected into the source that's eval-ed, so be careful
15980 // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
15981 // and escape the comment, thus injecting code that gets evaled.
15982 var sourceURL = '//# sourceURL=' +
15983 (hasOwnProperty.call(options, 'sourceURL')
15984 ? (options.sourceURL + '').replace(/\s/g, ' ')
15985 : ('lodash.templateSources[' + (++templateCounter) + ']')
15988 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
15989 interpolateValue || (interpolateValue = esTemplateValue);
15991 // Escape characters that can't be included in string literals.
15992 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
15994 // Replace delimiters with snippets.
15997 source += "' +\n__e(" + escapeValue + ") +\n'";
15999 if (evaluateValue) {
16000 isEvaluating = true;
16001 source += "';\n" + evaluateValue + ";\n__p += '";
16003 if (interpolateValue) {
16004 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
16006 index = offset + match.length;
16008 // The JS engine embedded in Adobe products needs `match` returned in
16009 // order to produce the correct `offset` value.
16015 // If `variable` is not specified wrap a with-statement around the generated
16016 // code to add the data object to the top of the scope chain.
16017 var variable = hasOwnProperty.call(options, 'variable') && options.variable;
16019 source = 'with (obj) {\n' + source + '\n}\n';
16021 // Throw an error if a forbidden character was found in `variable`, to prevent
16022 // potential command injection attacks.
16023 else if (reForbiddenIdentifierChars.test(variable)) {
16024 throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
16027 // Cleanup code by stripping empty strings.
16028 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
16029 .replace(reEmptyStringMiddle, '$1')
16030 .replace(reEmptyStringTrailing, '$1;');
16032 // Frame code as the function body.
16033 source = 'function(' + (variable || 'obj') + ') {\n' +
16036 : 'obj || (obj = {});\n'
16038 "var __t, __p = ''" +
16040 ? ', __e = _.escape'
16044 ? ', __j = Array.prototype.join;\n' +
16045 "function print() { __p += __j.call(arguments, '') }\n"
16051 var result = attempt(function() {
16052 return Function(importsKeys, sourceURL + 'return ' + source)
16053 .apply(undefined, importsValues);
16056 // Provide the compiled function's source by its `toString` method or
16057 // the `source` property as a convenience for inlining compiled templates.
16058 result.source = source;
16059 if (isError(result)) {
16066 * Converts `string`, as a whole, to lower case just like
16067 * [String#toLowerCase](https://mdn.io/toLowerCase).
16073 * @param {string} [string=''] The string to convert.
16074 * @returns {string} Returns the lower cased string.
16077 * _.toLower('--Foo-Bar--');
16078 * // => '--foo-bar--'
16080 * _.toLower('fooBar');
16083 * _.toLower('__FOO_BAR__');
16084 * // => '__foo_bar__'
16086 function toLower(value) {
16087 return toString(value).toLowerCase();
16091 * Converts `string`, as a whole, to upper case just like
16092 * [String#toUpperCase](https://mdn.io/toUpperCase).
16098 * @param {string} [string=''] The string to convert.
16099 * @returns {string} Returns the upper cased string.
16102 * _.toUpper('--foo-bar--');
16103 * // => '--FOO-BAR--'
16105 * _.toUpper('fooBar');
16108 * _.toUpper('__foo_bar__');
16109 * // => '__FOO_BAR__'
16111 function toUpper(value) {
16112 return toString(value).toUpperCase();
16116 * Removes leading and trailing whitespace or specified characters from `string`.
16122 * @param {string} [string=''] The string to trim.
16123 * @param {string} [chars=whitespace] The characters to trim.
16124 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16125 * @returns {string} Returns the trimmed string.
16131 * _.trim('-_-abc-_-', '_-');
16134 * _.map([' foo ', ' bar '], _.trim);
16135 * // => ['foo', 'bar']
16137 function trim(string, chars, guard) {
16138 string = toString(string);
16139 if (string && (guard || chars === undefined)) {
16140 return baseTrim(string);
16142 if (!string || !(chars = baseToString(chars))) {
16145 var strSymbols = stringToArray(string),
16146 chrSymbols = stringToArray(chars),
16147 start = charsStartIndex(strSymbols, chrSymbols),
16148 end = charsEndIndex(strSymbols, chrSymbols) + 1;
16150 return castSlice(strSymbols, start, end).join('');
16154 * Removes trailing whitespace or specified characters from `string`.
16160 * @param {string} [string=''] The string to trim.
16161 * @param {string} [chars=whitespace] The characters to trim.
16162 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16163 * @returns {string} Returns the trimmed string.
16166 * _.trimEnd(' abc ');
16169 * _.trimEnd('-_-abc-_-', '_-');
16172 function trimEnd(string, chars, guard) {
16173 string = toString(string);
16174 if (string && (guard || chars === undefined)) {
16175 return string.slice(0, trimmedEndIndex(string) + 1);
16177 if (!string || !(chars = baseToString(chars))) {
16180 var strSymbols = stringToArray(string),
16181 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
16183 return castSlice(strSymbols, 0, end).join('');
16187 * Removes leading whitespace or specified characters from `string`.
16193 * @param {string} [string=''] The string to trim.
16194 * @param {string} [chars=whitespace] The characters to trim.
16195 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16196 * @returns {string} Returns the trimmed string.
16199 * _.trimStart(' abc ');
16202 * _.trimStart('-_-abc-_-', '_-');
16205 function trimStart(string, chars, guard) {
16206 string = toString(string);
16207 if (string && (guard || chars === undefined)) {
16208 return string.replace(reTrimStart, '');
16210 if (!string || !(chars = baseToString(chars))) {
16213 var strSymbols = stringToArray(string),
16214 start = charsStartIndex(strSymbols, stringToArray(chars));
16216 return castSlice(strSymbols, start).join('');
16220 * Truncates `string` if it's longer than the given maximum string length.
16221 * The last characters of the truncated string are replaced with the omission
16222 * string which defaults to "...".
16228 * @param {string} [string=''] The string to truncate.
16229 * @param {Object} [options={}] The options object.
16230 * @param {number} [options.length=30] The maximum string length.
16231 * @param {string} [options.omission='...'] The string to indicate text is omitted.
16232 * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
16233 * @returns {string} Returns the truncated string.
16236 * _.truncate('hi-diddly-ho there, neighborino');
16237 * // => 'hi-diddly-ho there, neighbo...'
16239 * _.truncate('hi-diddly-ho there, neighborino', {
16243 * // => 'hi-diddly-ho there,...'
16245 * _.truncate('hi-diddly-ho there, neighborino', {
16247 * 'separator': /,? +/
16249 * // => 'hi-diddly-ho there...'
16251 * _.truncate('hi-diddly-ho there, neighborino', {
16252 * 'omission': ' [...]'
16254 * // => 'hi-diddly-ho there, neig [...]'
16256 function truncate(string, options) {
16257 var length = DEFAULT_TRUNC_LENGTH,
16258 omission = DEFAULT_TRUNC_OMISSION;
16260 if (isObject(options)) {
16261 var separator = 'separator' in options ? options.separator : separator;
16262 length = 'length' in options ? toInteger(options.length) : length;
16263 omission = 'omission' in options ? baseToString(options.omission) : omission;
16265 string = toString(string);
16267 var strLength = string.length;
16268 if (hasUnicode(string)) {
16269 var strSymbols = stringToArray(string);
16270 strLength = strSymbols.length;
16272 if (length >= strLength) {
16275 var end = length - stringSize(omission);
16279 var result = strSymbols
16280 ? castSlice(strSymbols, 0, end).join('')
16281 : string.slice(0, end);
16283 if (separator === undefined) {
16284 return result + omission;
16287 end += (result.length - end);
16289 if (isRegExp(separator)) {
16290 if (string.slice(end).search(separator)) {
16292 substring = result;
16294 if (!separator.global) {
16295 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
16297 separator.lastIndex = 0;
16298 while ((match = separator.exec(substring))) {
16299 var newEnd = match.index;
16301 result = result.slice(0, newEnd === undefined ? end : newEnd);
16303 } else if (string.indexOf(baseToString(separator), end) != end) {
16304 var index = result.lastIndexOf(separator);
16306 result = result.slice(0, index);
16309 return result + omission;
16313 * The inverse of `_.escape`; this method converts the HTML entities
16314 * `&`, `<`, `>`, `"`, and `'` in `string` to
16315 * their corresponding characters.
16317 * **Note:** No other HTML entities are unescaped. To unescape additional
16318 * HTML entities use a third-party library like [_he_](https://mths.be/he).
16324 * @param {string} [string=''] The string to unescape.
16325 * @returns {string} Returns the unescaped string.
16328 * _.unescape('fred, barney, & pebbles');
16329 * // => 'fred, barney, & pebbles'
16331 function unescape(string) {
16332 string = toString(string);
16333 return (string && reHasEscapedHtml.test(string))
16334 ? string.replace(reEscapedHtml, unescapeHtmlChar)
16339 * Converts `string`, as space separated words, to upper case.
16345 * @param {string} [string=''] The string to convert.
16346 * @returns {string} Returns the upper cased string.
16349 * _.upperCase('--foo-bar');
16352 * _.upperCase('fooBar');
16355 * _.upperCase('__foo_bar__');
16358 var upperCase = createCompounder(function(result, word, index) {
16359 return result + (index ? ' ' : '') + word.toUpperCase();
16363 * Converts the first character of `string` to upper case.
16369 * @param {string} [string=''] The string to convert.
16370 * @returns {string} Returns the converted string.
16373 * _.upperFirst('fred');
16376 * _.upperFirst('FRED');
16379 var upperFirst = createCaseFirst('toUpperCase');
16382 * Splits `string` into an array of its words.
16388 * @param {string} [string=''] The string to inspect.
16389 * @param {RegExp|string} [pattern] The pattern to match words.
16390 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16391 * @returns {Array} Returns the words of `string`.
16394 * _.words('fred, barney, & pebbles');
16395 * // => ['fred', 'barney', 'pebbles']
16397 * _.words('fred, barney, & pebbles', /[^, ]+/g);
16398 * // => ['fred', 'barney', '&', 'pebbles']
16400 function words(string, pattern, guard) {
16401 string = toString(string);
16402 pattern = guard ? undefined : pattern;
16404 if (pattern === undefined) {
16405 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
16407 return string.match(pattern) || [];
16410 /*------------------------------------------------------------------------*/
16413 * Attempts to invoke `func`, returning either the result or the caught error
16414 * object. Any additional arguments are provided to `func` when it's invoked.
16420 * @param {Function} func The function to attempt.
16421 * @param {...*} [args] The arguments to invoke `func` with.
16422 * @returns {*} Returns the `func` result or error object.
16425 * // Avoid throwing errors for invalid selectors.
16426 * var elements = _.attempt(function(selector) {
16427 * return document.querySelectorAll(selector);
16430 * if (_.isError(elements)) {
16434 var attempt = baseRest(function(func, args) {
16436 return apply(func, undefined, args);
16438 return isError(e) ? e : new Error(e);
16443 * Binds methods of an object to the object itself, overwriting the existing
16446 * **Note:** This method doesn't set the "length" property of bound functions.
16452 * @param {Object} object The object to bind and assign the bound methods to.
16453 * @param {...(string|string[])} methodNames The object method names to bind.
16454 * @returns {Object} Returns `object`.
16459 * 'click': function() {
16460 * console.log('clicked ' + this.label);
16464 * _.bindAll(view, ['click']);
16465 * jQuery(element).on('click', view.click);
16466 * // => Logs 'clicked docs' when clicked.
16468 var bindAll = flatRest(function(object, methodNames) {
16469 arrayEach(methodNames, function(key) {
16471 baseAssignValue(object, key, bind(object[key], object));
16477 * Creates a function that iterates over `pairs` and invokes the corresponding
16478 * function of the first predicate to return truthy. The predicate-function
16479 * pairs are invoked with the `this` binding and arguments of the created
16486 * @param {Array} pairs The predicate-function pairs.
16487 * @returns {Function} Returns the new composite function.
16490 * var func = _.cond([
16491 * [_.matches({ 'a': 1 }), _.constant('matches A')],
16492 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
16493 * [_.stubTrue, _.constant('no match')]
16496 * func({ 'a': 1, 'b': 2 });
16497 * // => 'matches A'
16499 * func({ 'a': 0, 'b': 1 });
16500 * // => 'matches B'
16502 * func({ 'a': '1', 'b': '2' });
16505 function cond(pairs) {
16506 var length = pairs == null ? 0 : pairs.length,
16507 toIteratee = getIteratee();
16509 pairs = !length ? [] : arrayMap(pairs, function(pair) {
16510 if (typeof pair[1] != 'function') {
16511 throw new TypeError(FUNC_ERROR_TEXT);
16513 return [toIteratee(pair[0]), pair[1]];
16516 return baseRest(function(args) {
16518 while (++index < length) {
16519 var pair = pairs[index];
16520 if (apply(pair[0], this, args)) {
16521 return apply(pair[1], this, args);
16528 * Creates a function that invokes the predicate properties of `source` with
16529 * the corresponding property values of a given object, returning `true` if
16530 * all predicates return truthy, else `false`.
16532 * **Note:** The created function is equivalent to `_.conformsTo` with
16533 * `source` partially applied.
16539 * @param {Object} source The object of property predicates to conform to.
16540 * @returns {Function} Returns the new spec function.
16544 * { 'a': 2, 'b': 1 },
16545 * { 'a': 1, 'b': 2 }
16548 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
16549 * // => [{ 'a': 1, 'b': 2 }]
16551 function conforms(source) {
16552 return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
16556 * Creates a function that returns `value`.
16562 * @param {*} value The value to return from the new function.
16563 * @returns {Function} Returns the new constant function.
16566 * var objects = _.times(2, _.constant({ 'a': 1 }));
16568 * console.log(objects);
16569 * // => [{ 'a': 1 }, { 'a': 1 }]
16571 * console.log(objects[0] === objects[1]);
16574 function constant(value) {
16575 return function() {
16581 * Checks `value` to determine whether a default value should be returned in
16582 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
16589 * @param {*} value The value to check.
16590 * @param {*} defaultValue The default value.
16591 * @returns {*} Returns the resolved value.
16594 * _.defaultTo(1, 10);
16597 * _.defaultTo(undefined, 10);
16600 function defaultTo(value, defaultValue) {
16601 return (value == null || value !== value) ? defaultValue : value;
16605 * Creates a function that returns the result of invoking the given functions
16606 * with the `this` binding of the created function, where each successive
16607 * invocation is supplied the return value of the previous.
16613 * @param {...(Function|Function[])} [funcs] The functions to invoke.
16614 * @returns {Function} Returns the new composite function.
16618 * function square(n) {
16622 * var addSquare = _.flow([_.add, square]);
16626 var flow = createFlow();
16629 * This method is like `_.flow` except that it creates a function that
16630 * invokes the given functions from right to left.
16636 * @param {...(Function|Function[])} [funcs] The functions to invoke.
16637 * @returns {Function} Returns the new composite function.
16641 * function square(n) {
16645 * var addSquare = _.flowRight([square, _.add]);
16649 var flowRight = createFlow(true);
16652 * This method returns the first argument it receives.
16658 * @param {*} value Any value.
16659 * @returns {*} Returns `value`.
16662 * var object = { 'a': 1 };
16664 * console.log(_.identity(object) === object);
16667 function identity(value) {
16672 * Creates a function that invokes `func` with the arguments of the created
16673 * function. If `func` is a property name, the created function returns the
16674 * property value for a given element. If `func` is an array or object, the
16675 * created function returns `true` for elements that contain the equivalent
16676 * source properties, otherwise it returns `false`.
16682 * @param {*} [func=_.identity] The value to convert to a callback.
16683 * @returns {Function} Returns the callback.
16687 * { 'user': 'barney', 'age': 36, 'active': true },
16688 * { 'user': 'fred', 'age': 40, 'active': false }
16691 * // The `_.matches` iteratee shorthand.
16692 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
16693 * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
16695 * // The `_.matchesProperty` iteratee shorthand.
16696 * _.filter(users, _.iteratee(['user', 'fred']));
16697 * // => [{ 'user': 'fred', 'age': 40 }]
16699 * // The `_.property` iteratee shorthand.
16700 * _.map(users, _.iteratee('user'));
16701 * // => ['barney', 'fred']
16703 * // Create custom iteratee shorthands.
16704 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
16705 * return !_.isRegExp(func) ? iteratee(func) : function(string) {
16706 * return func.test(string);
16710 * _.filter(['abc', 'def'], /ef/);
16713 function iteratee(func) {
16714 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
16718 * Creates a function that performs a partial deep comparison between a given
16719 * object and `source`, returning `true` if the given object has equivalent
16720 * property values, else `false`.
16722 * **Note:** The created function is equivalent to `_.isMatch` with `source`
16723 * partially applied.
16725 * Partial comparisons will match empty array and empty object `source`
16726 * values against any array or object value, respectively. See `_.isEqual`
16727 * for a list of supported value comparisons.
16729 * **Note:** Multiple values can be checked by combining several matchers
16730 * using `_.overSome`
16736 * @param {Object} source The object of property values to match.
16737 * @returns {Function} Returns the new spec function.
16741 * { 'a': 1, 'b': 2, 'c': 3 },
16742 * { 'a': 4, 'b': 5, 'c': 6 }
16745 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
16746 * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
16748 * // Checking for several possible values
16749 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
16750 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
16752 function matches(source) {
16753 return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
16757 * Creates a function that performs a partial deep comparison between the
16758 * value at `path` of a given object to `srcValue`, returning `true` if the
16759 * object value is equivalent, else `false`.
16761 * **Note:** Partial comparisons will match empty array and empty object
16762 * `srcValue` values against any array or object value, respectively. See
16763 * `_.isEqual` for a list of supported value comparisons.
16765 * **Note:** Multiple values can be checked by combining several matchers
16766 * using `_.overSome`
16772 * @param {Array|string} path The path of the property to get.
16773 * @param {*} srcValue The value to match.
16774 * @returns {Function} Returns the new spec function.
16778 * { 'a': 1, 'b': 2, 'c': 3 },
16779 * { 'a': 4, 'b': 5, 'c': 6 }
16782 * _.find(objects, _.matchesProperty('a', 4));
16783 * // => { 'a': 4, 'b': 5, 'c': 6 }
16785 * // Checking for several possible values
16786 * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
16787 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
16789 function matchesProperty(path, srcValue) {
16790 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
16794 * Creates a function that invokes the method at `path` of a given object.
16795 * Any additional arguments are provided to the invoked method.
16801 * @param {Array|string} path The path of the method to invoke.
16802 * @param {...*} [args] The arguments to invoke the method with.
16803 * @returns {Function} Returns the new invoker function.
16807 * { 'a': { 'b': _.constant(2) } },
16808 * { 'a': { 'b': _.constant(1) } }
16811 * _.map(objects, _.method('a.b'));
16814 * _.map(objects, _.method(['a', 'b']));
16817 var method = baseRest(function(path, args) {
16818 return function(object) {
16819 return baseInvoke(object, path, args);
16824 * The opposite of `_.method`; this method creates a function that invokes
16825 * the method at a given path of `object`. Any additional arguments are
16826 * provided to the invoked method.
16832 * @param {Object} object The object to query.
16833 * @param {...*} [args] The arguments to invoke the method with.
16834 * @returns {Function} Returns the new invoker function.
16837 * var array = _.times(3, _.constant),
16838 * object = { 'a': array, 'b': array, 'c': array };
16840 * _.map(['a[2]', 'c[0]'], _.methodOf(object));
16843 * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
16846 var methodOf = baseRest(function(object, args) {
16847 return function(path) {
16848 return baseInvoke(object, path, args);
16853 * Adds all own enumerable string keyed function properties of a source
16854 * object to the destination object. If `object` is a function, then methods
16855 * are added to its prototype as well.
16857 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
16858 * avoid conflicts caused by modifying the original.
16864 * @param {Function|Object} [object=lodash] The destination object.
16865 * @param {Object} source The object of functions to add.
16866 * @param {Object} [options={}] The options object.
16867 * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
16868 * @returns {Function|Object} Returns `object`.
16871 * function vowels(string) {
16872 * return _.filter(string, function(v) {
16873 * return /[aeiou]/i.test(v);
16877 * _.mixin({ 'vowels': vowels });
16878 * _.vowels('fred');
16881 * _('fred').vowels().value();
16884 * _.mixin({ 'vowels': vowels }, { 'chain': false });
16885 * _('fred').vowels();
16888 function mixin(object, source, options) {
16889 var props = keys(source),
16890 methodNames = baseFunctions(source, props);
16892 if (options == null &&
16893 !(isObject(source) && (methodNames.length || !props.length))) {
16897 methodNames = baseFunctions(source, keys(source));
16899 var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
16900 isFunc = isFunction(object);
16902 arrayEach(methodNames, function(methodName) {
16903 var func = source[methodName];
16904 object[methodName] = func;
16906 object.prototype[methodName] = function() {
16907 var chainAll = this.__chain__;
16908 if (chain || chainAll) {
16909 var result = object(this.__wrapped__),
16910 actions = result.__actions__ = copyArray(this.__actions__);
16912 actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
16913 result.__chain__ = chainAll;
16916 return func.apply(object, arrayPush([this.value()], arguments));
16925 * Reverts the `_` variable to its previous value and returns a reference to
16926 * the `lodash` function.
16932 * @returns {Function} Returns the `lodash` function.
16935 * var lodash = _.noConflict();
16937 function noConflict() {
16938 if (root._ === this) {
16945 * This method returns `undefined`.
16953 * _.times(2, _.noop);
16954 * // => [undefined, undefined]
16957 // No operation performed.
16961 * Creates a function that gets the argument at index `n`. If `n` is negative,
16962 * the nth argument from the end is returned.
16968 * @param {number} [n=0] The index of the argument to return.
16969 * @returns {Function} Returns the new pass-thru function.
16972 * var func = _.nthArg(1);
16973 * func('a', 'b', 'c', 'd');
16976 * var func = _.nthArg(-2);
16977 * func('a', 'b', 'c', 'd');
16980 function nthArg(n) {
16982 return baseRest(function(args) {
16983 return baseNth(args, n);
16988 * Creates a function that invokes `iteratees` with the arguments it receives
16989 * and returns their results.
16995 * @param {...(Function|Function[])} [iteratees=[_.identity]]
16996 * The iteratees to invoke.
16997 * @returns {Function} Returns the new function.
17000 * var func = _.over([Math.max, Math.min]);
17002 * func(1, 2, 3, 4);
17005 var over = createOver(arrayMap);
17008 * Creates a function that checks if **all** of the `predicates` return
17009 * truthy when invoked with the arguments it receives.
17011 * Following shorthands are possible for providing predicates.
17012 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
17013 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
17019 * @param {...(Function|Function[])} [predicates=[_.identity]]
17020 * The predicates to check.
17021 * @returns {Function} Returns the new function.
17024 * var func = _.overEvery([Boolean, isFinite]);
17035 var overEvery = createOver(arrayEvery);
17038 * Creates a function that checks if **any** of the `predicates` return
17039 * truthy when invoked with the arguments it receives.
17041 * Following shorthands are possible for providing predicates.
17042 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
17043 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
17049 * @param {...(Function|Function[])} [predicates=[_.identity]]
17050 * The predicates to check.
17051 * @returns {Function} Returns the new function.
17054 * var func = _.overSome([Boolean, isFinite]);
17065 * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
17066 * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
17068 var overSome = createOver(arraySome);
17071 * Creates a function that returns the value at `path` of a given object.
17077 * @param {Array|string} path The path of the property to get.
17078 * @returns {Function} Returns the new accessor function.
17082 * { 'a': { 'b': 2 } },
17083 * { 'a': { 'b': 1 } }
17086 * _.map(objects, _.property('a.b'));
17089 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
17092 function property(path) {
17093 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
17097 * The opposite of `_.property`; this method creates a function that returns
17098 * the value at a given path of `object`.
17104 * @param {Object} object The object to query.
17105 * @returns {Function} Returns the new accessor function.
17108 * var array = [0, 1, 2],
17109 * object = { 'a': array, 'b': array, 'c': array };
17111 * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
17114 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
17117 function propertyOf(object) {
17118 return function(path) {
17119 return object == null ? undefined : baseGet(object, path);
17124 * Creates an array of numbers (positive and/or negative) progressing from
17125 * `start` up to, but not including, `end`. A step of `-1` is used if a negative
17126 * `start` is specified without an `end` or `step`. If `end` is not specified,
17127 * it's set to `start` with `start` then set to `0`.
17129 * **Note:** JavaScript follows the IEEE-754 standard for resolving
17130 * floating-point values which can produce unexpected results.
17136 * @param {number} [start=0] The start of the range.
17137 * @param {number} end The end of the range.
17138 * @param {number} [step=1] The value to increment or decrement by.
17139 * @returns {Array} Returns the range of numbers.
17140 * @see _.inRange, _.rangeRight
17144 * // => [0, 1, 2, 3]
17147 * // => [0, -1, -2, -3]
17150 * // => [1, 2, 3, 4]
17152 * _.range(0, 20, 5);
17153 * // => [0, 5, 10, 15]
17155 * _.range(0, -4, -1);
17156 * // => [0, -1, -2, -3]
17158 * _.range(1, 4, 0);
17164 var range = createRange();
17167 * This method is like `_.range` except that it populates values in
17168 * descending order.
17174 * @param {number} [start=0] The start of the range.
17175 * @param {number} end The end of the range.
17176 * @param {number} [step=1] The value to increment or decrement by.
17177 * @returns {Array} Returns the range of numbers.
17178 * @see _.inRange, _.range
17182 * // => [3, 2, 1, 0]
17184 * _.rangeRight(-4);
17185 * // => [-3, -2, -1, 0]
17187 * _.rangeRight(1, 5);
17188 * // => [4, 3, 2, 1]
17190 * _.rangeRight(0, 20, 5);
17191 * // => [15, 10, 5, 0]
17193 * _.rangeRight(0, -4, -1);
17194 * // => [-3, -2, -1, 0]
17196 * _.rangeRight(1, 4, 0);
17202 var rangeRight = createRange(true);
17205 * This method returns a new empty array.
17211 * @returns {Array} Returns the new empty array.
17214 * var arrays = _.times(2, _.stubArray);
17216 * console.log(arrays);
17219 * console.log(arrays[0] === arrays[1]);
17222 function stubArray() {
17227 * This method returns `false`.
17233 * @returns {boolean} Returns `false`.
17236 * _.times(2, _.stubFalse);
17237 * // => [false, false]
17239 function stubFalse() {
17244 * This method returns a new empty object.
17250 * @returns {Object} Returns the new empty object.
17253 * var objects = _.times(2, _.stubObject);
17255 * console.log(objects);
17258 * console.log(objects[0] === objects[1]);
17261 function stubObject() {
17266 * This method returns an empty string.
17272 * @returns {string} Returns the empty string.
17275 * _.times(2, _.stubString);
17278 function stubString() {
17283 * This method returns `true`.
17289 * @returns {boolean} Returns `true`.
17292 * _.times(2, _.stubTrue);
17293 * // => [true, true]
17295 function stubTrue() {
17300 * Invokes the iteratee `n` times, returning an array of the results of
17301 * each invocation. The iteratee is invoked with one argument; (index).
17307 * @param {number} n The number of times to invoke `iteratee`.
17308 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17309 * @returns {Array} Returns the array of results.
17312 * _.times(3, String);
17313 * // => ['0', '1', '2']
17315 * _.times(4, _.constant(0));
17316 * // => [0, 0, 0, 0]
17318 function times(n, iteratee) {
17320 if (n < 1 || n > MAX_SAFE_INTEGER) {
17323 var index = MAX_ARRAY_LENGTH,
17324 length = nativeMin(n, MAX_ARRAY_LENGTH);
17326 iteratee = getIteratee(iteratee);
17327 n -= MAX_ARRAY_LENGTH;
17329 var result = baseTimes(length, iteratee);
17330 while (++index < n) {
17337 * Converts `value` to a property path array.
17343 * @param {*} value The value to convert.
17344 * @returns {Array} Returns the new property path array.
17347 * _.toPath('a.b.c');
17348 * // => ['a', 'b', 'c']
17350 * _.toPath('a[0].b.c');
17351 * // => ['a', '0', 'b', 'c']
17353 function toPath(value) {
17354 if (isArray(value)) {
17355 return arrayMap(value, toKey);
17357 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
17361 * Generates a unique ID. If `prefix` is given, the ID is appended to it.
17367 * @param {string} [prefix=''] The value to prefix the ID with.
17368 * @returns {string} Returns the unique ID.
17371 * _.uniqueId('contact_');
17372 * // => 'contact_104'
17377 function uniqueId(prefix) {
17378 var id = ++idCounter;
17379 return toString(prefix) + id;
17382 /*------------------------------------------------------------------------*/
17385 * Adds two numbers.
17391 * @param {number} augend The first number in an addition.
17392 * @param {number} addend The second number in an addition.
17393 * @returns {number} Returns the total.
17399 var add = createMathOperation(function(augend, addend) {
17400 return augend + addend;
17404 * Computes `number` rounded up to `precision`.
17410 * @param {number} number The number to round up.
17411 * @param {number} [precision=0] The precision to round up to.
17412 * @returns {number} Returns the rounded up number.
17418 * _.ceil(6.004, 2);
17421 * _.ceil(6040, -2);
17424 var ceil = createRound('ceil');
17427 * Divide two numbers.
17433 * @param {number} dividend The first number in a division.
17434 * @param {number} divisor The second number in a division.
17435 * @returns {number} Returns the quotient.
17441 var divide = createMathOperation(function(dividend, divisor) {
17442 return dividend / divisor;
17446 * Computes `number` rounded down to `precision`.
17452 * @param {number} number The number to round down.
17453 * @param {number} [precision=0] The precision to round down to.
17454 * @returns {number} Returns the rounded down number.
17460 * _.floor(0.046, 2);
17463 * _.floor(4060, -2);
17466 var floor = createRound('floor');
17469 * Computes the maximum value of `array`. If `array` is empty or falsey,
17470 * `undefined` is returned.
17476 * @param {Array} array The array to iterate over.
17477 * @returns {*} Returns the maximum value.
17480 * _.max([4, 2, 8, 6]);
17486 function max(array) {
17487 return (array && array.length)
17488 ? baseExtremum(array, identity, baseGt)
17493 * This method is like `_.max` except that it accepts `iteratee` which is
17494 * invoked for each element in `array` to generate the criterion by which
17495 * the value is ranked. The iteratee is invoked with one argument: (value).
17501 * @param {Array} array The array to iterate over.
17502 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
17503 * @returns {*} Returns the maximum value.
17506 * var objects = [{ 'n': 1 }, { 'n': 2 }];
17508 * _.maxBy(objects, function(o) { return o.n; });
17511 * // The `_.property` iteratee shorthand.
17512 * _.maxBy(objects, 'n');
17515 function maxBy(array, iteratee) {
17516 return (array && array.length)
17517 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
17522 * Computes the mean of the values in `array`.
17528 * @param {Array} array The array to iterate over.
17529 * @returns {number} Returns the mean.
17532 * _.mean([4, 2, 8, 6]);
17535 function mean(array) {
17536 return baseMean(array, identity);
17540 * This method is like `_.mean` except that it accepts `iteratee` which is
17541 * invoked for each element in `array` to generate the value to be averaged.
17542 * The iteratee is invoked with one argument: (value).
17548 * @param {Array} array The array to iterate over.
17549 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
17550 * @returns {number} Returns the mean.
17553 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
17555 * _.meanBy(objects, function(o) { return o.n; });
17558 * // The `_.property` iteratee shorthand.
17559 * _.meanBy(objects, 'n');
17562 function meanBy(array, iteratee) {
17563 return baseMean(array, getIteratee(iteratee, 2));
17567 * Computes the minimum value of `array`. If `array` is empty or falsey,
17568 * `undefined` is returned.
17574 * @param {Array} array The array to iterate over.
17575 * @returns {*} Returns the minimum value.
17578 * _.min([4, 2, 8, 6]);
17584 function min(array) {
17585 return (array && array.length)
17586 ? baseExtremum(array, identity, baseLt)
17591 * This method is like `_.min` except that it accepts `iteratee` which is
17592 * invoked for each element in `array` to generate the criterion by which
17593 * the value is ranked. The iteratee is invoked with one argument: (value).
17599 * @param {Array} array The array to iterate over.
17600 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
17601 * @returns {*} Returns the minimum value.
17604 * var objects = [{ 'n': 1 }, { 'n': 2 }];
17606 * _.minBy(objects, function(o) { return o.n; });
17609 * // The `_.property` iteratee shorthand.
17610 * _.minBy(objects, 'n');
17613 function minBy(array, iteratee) {
17614 return (array && array.length)
17615 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
17620 * Multiply two numbers.
17626 * @param {number} multiplier The first number in a multiplication.
17627 * @param {number} multiplicand The second number in a multiplication.
17628 * @returns {number} Returns the product.
17631 * _.multiply(6, 4);
17634 var multiply = createMathOperation(function(multiplier, multiplicand) {
17635 return multiplier * multiplicand;
17639 * Computes `number` rounded to `precision`.
17645 * @param {number} number The number to round.
17646 * @param {number} [precision=0] The precision to round to.
17647 * @returns {number} Returns the rounded number.
17653 * _.round(4.006, 2);
17656 * _.round(4060, -2);
17659 var round = createRound('round');
17662 * Subtract two numbers.
17668 * @param {number} minuend The first number in a subtraction.
17669 * @param {number} subtrahend The second number in a subtraction.
17670 * @returns {number} Returns the difference.
17673 * _.subtract(6, 4);
17676 var subtract = createMathOperation(function(minuend, subtrahend) {
17677 return minuend - subtrahend;
17681 * Computes the sum of the values in `array`.
17687 * @param {Array} array The array to iterate over.
17688 * @returns {number} Returns the sum.
17691 * _.sum([4, 2, 8, 6]);
17694 function sum(array) {
17695 return (array && array.length)
17696 ? baseSum(array, identity)
17701 * This method is like `_.sum` except that it accepts `iteratee` which is
17702 * invoked for each element in `array` to generate the value to be summed.
17703 * The iteratee is invoked with one argument: (value).
17709 * @param {Array} array The array to iterate over.
17710 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
17711 * @returns {number} Returns the sum.
17714 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
17716 * _.sumBy(objects, function(o) { return o.n; });
17719 * // The `_.property` iteratee shorthand.
17720 * _.sumBy(objects, 'n');
17723 function sumBy(array, iteratee) {
17724 return (array && array.length)
17725 ? baseSum(array, getIteratee(iteratee, 2))
17729 /*------------------------------------------------------------------------*/
17731 // Add methods that return wrapped values in chain sequences.
17732 lodash.after = after;
17734 lodash.assign = assign;
17735 lodash.assignIn = assignIn;
17736 lodash.assignInWith = assignInWith;
17737 lodash.assignWith = assignWith;
17739 lodash.before = before;
17740 lodash.bind = bind;
17741 lodash.bindAll = bindAll;
17742 lodash.bindKey = bindKey;
17743 lodash.castArray = castArray;
17744 lodash.chain = chain;
17745 lodash.chunk = chunk;
17746 lodash.compact = compact;
17747 lodash.concat = concat;
17748 lodash.cond = cond;
17749 lodash.conforms = conforms;
17750 lodash.constant = constant;
17751 lodash.countBy = countBy;
17752 lodash.create = create;
17753 lodash.curry = curry;
17754 lodash.curryRight = curryRight;
17755 lodash.debounce = debounce;
17756 lodash.defaults = defaults;
17757 lodash.defaultsDeep = defaultsDeep;
17758 lodash.defer = defer;
17759 lodash.delay = delay;
17760 lodash.difference = difference;
17761 lodash.differenceBy = differenceBy;
17762 lodash.differenceWith = differenceWith;
17763 lodash.drop = drop;
17764 lodash.dropRight = dropRight;
17765 lodash.dropRightWhile = dropRightWhile;
17766 lodash.dropWhile = dropWhile;
17767 lodash.fill = fill;
17768 lodash.filter = filter;
17769 lodash.flatMap = flatMap;
17770 lodash.flatMapDeep = flatMapDeep;
17771 lodash.flatMapDepth = flatMapDepth;
17772 lodash.flatten = flatten;
17773 lodash.flattenDeep = flattenDeep;
17774 lodash.flattenDepth = flattenDepth;
17775 lodash.flip = flip;
17776 lodash.flow = flow;
17777 lodash.flowRight = flowRight;
17778 lodash.fromPairs = fromPairs;
17779 lodash.functions = functions;
17780 lodash.functionsIn = functionsIn;
17781 lodash.groupBy = groupBy;
17782 lodash.initial = initial;
17783 lodash.intersection = intersection;
17784 lodash.intersectionBy = intersectionBy;
17785 lodash.intersectionWith = intersectionWith;
17786 lodash.invert = invert;
17787 lodash.invertBy = invertBy;
17788 lodash.invokeMap = invokeMap;
17789 lodash.iteratee = iteratee;
17790 lodash.keyBy = keyBy;
17791 lodash.keys = keys;
17792 lodash.keysIn = keysIn;
17794 lodash.mapKeys = mapKeys;
17795 lodash.mapValues = mapValues;
17796 lodash.matches = matches;
17797 lodash.matchesProperty = matchesProperty;
17798 lodash.memoize = memoize;
17799 lodash.merge = merge;
17800 lodash.mergeWith = mergeWith;
17801 lodash.method = method;
17802 lodash.methodOf = methodOf;
17803 lodash.mixin = mixin;
17804 lodash.negate = negate;
17805 lodash.nthArg = nthArg;
17806 lodash.omit = omit;
17807 lodash.omitBy = omitBy;
17808 lodash.once = once;
17809 lodash.orderBy = orderBy;
17810 lodash.over = over;
17811 lodash.overArgs = overArgs;
17812 lodash.overEvery = overEvery;
17813 lodash.overSome = overSome;
17814 lodash.partial = partial;
17815 lodash.partialRight = partialRight;
17816 lodash.partition = partition;
17817 lodash.pick = pick;
17818 lodash.pickBy = pickBy;
17819 lodash.property = property;
17820 lodash.propertyOf = propertyOf;
17821 lodash.pull = pull;
17822 lodash.pullAll = pullAll;
17823 lodash.pullAllBy = pullAllBy;
17824 lodash.pullAllWith = pullAllWith;
17825 lodash.pullAt = pullAt;
17826 lodash.range = range;
17827 lodash.rangeRight = rangeRight;
17828 lodash.rearg = rearg;
17829 lodash.reject = reject;
17830 lodash.remove = remove;
17831 lodash.rest = rest;
17832 lodash.reverse = reverse;
17833 lodash.sampleSize = sampleSize;
17835 lodash.setWith = setWith;
17836 lodash.shuffle = shuffle;
17837 lodash.slice = slice;
17838 lodash.sortBy = sortBy;
17839 lodash.sortedUniq = sortedUniq;
17840 lodash.sortedUniqBy = sortedUniqBy;
17841 lodash.split = split;
17842 lodash.spread = spread;
17843 lodash.tail = tail;
17844 lodash.take = take;
17845 lodash.takeRight = takeRight;
17846 lodash.takeRightWhile = takeRightWhile;
17847 lodash.takeWhile = takeWhile;
17849 lodash.throttle = throttle;
17850 lodash.thru = thru;
17851 lodash.toArray = toArray;
17852 lodash.toPairs = toPairs;
17853 lodash.toPairsIn = toPairsIn;
17854 lodash.toPath = toPath;
17855 lodash.toPlainObject = toPlainObject;
17856 lodash.transform = transform;
17857 lodash.unary = unary;
17858 lodash.union = union;
17859 lodash.unionBy = unionBy;
17860 lodash.unionWith = unionWith;
17861 lodash.uniq = uniq;
17862 lodash.uniqBy = uniqBy;
17863 lodash.uniqWith = uniqWith;
17864 lodash.unset = unset;
17865 lodash.unzip = unzip;
17866 lodash.unzipWith = unzipWith;
17867 lodash.update = update;
17868 lodash.updateWith = updateWith;
17869 lodash.values = values;
17870 lodash.valuesIn = valuesIn;
17871 lodash.without = without;
17872 lodash.words = words;
17873 lodash.wrap = wrap;
17875 lodash.xorBy = xorBy;
17876 lodash.xorWith = xorWith;
17878 lodash.zipObject = zipObject;
17879 lodash.zipObjectDeep = zipObjectDeep;
17880 lodash.zipWith = zipWith;
17883 lodash.entries = toPairs;
17884 lodash.entriesIn = toPairsIn;
17885 lodash.extend = assignIn;
17886 lodash.extendWith = assignInWith;
17888 // Add methods to `lodash.prototype`.
17889 mixin(lodash, lodash);
17891 /*------------------------------------------------------------------------*/
17893 // Add methods that return unwrapped values in chain sequences.
17895 lodash.attempt = attempt;
17896 lodash.camelCase = camelCase;
17897 lodash.capitalize = capitalize;
17898 lodash.ceil = ceil;
17899 lodash.clamp = clamp;
17900 lodash.clone = clone;
17901 lodash.cloneDeep = cloneDeep;
17902 lodash.cloneDeepWith = cloneDeepWith;
17903 lodash.cloneWith = cloneWith;
17904 lodash.conformsTo = conformsTo;
17905 lodash.deburr = deburr;
17906 lodash.defaultTo = defaultTo;
17907 lodash.divide = divide;
17908 lodash.endsWith = endsWith;
17910 lodash.escape = escape;
17911 lodash.escapeRegExp = escapeRegExp;
17912 lodash.every = every;
17913 lodash.find = find;
17914 lodash.findIndex = findIndex;
17915 lodash.findKey = findKey;
17916 lodash.findLast = findLast;
17917 lodash.findLastIndex = findLastIndex;
17918 lodash.findLastKey = findLastKey;
17919 lodash.floor = floor;
17920 lodash.forEach = forEach;
17921 lodash.forEachRight = forEachRight;
17922 lodash.forIn = forIn;
17923 lodash.forInRight = forInRight;
17924 lodash.forOwn = forOwn;
17925 lodash.forOwnRight = forOwnRight;
17930 lodash.hasIn = hasIn;
17931 lodash.head = head;
17932 lodash.identity = identity;
17933 lodash.includes = includes;
17934 lodash.indexOf = indexOf;
17935 lodash.inRange = inRange;
17936 lodash.invoke = invoke;
17937 lodash.isArguments = isArguments;
17938 lodash.isArray = isArray;
17939 lodash.isArrayBuffer = isArrayBuffer;
17940 lodash.isArrayLike = isArrayLike;
17941 lodash.isArrayLikeObject = isArrayLikeObject;
17942 lodash.isBoolean = isBoolean;
17943 lodash.isBuffer = isBuffer;
17944 lodash.isDate = isDate;
17945 lodash.isElement = isElement;
17946 lodash.isEmpty = isEmpty;
17947 lodash.isEqual = isEqual;
17948 lodash.isEqualWith = isEqualWith;
17949 lodash.isError = isError;
17950 lodash.isFinite = isFinite;
17951 lodash.isFunction = isFunction;
17952 lodash.isInteger = isInteger;
17953 lodash.isLength = isLength;
17954 lodash.isMap = isMap;
17955 lodash.isMatch = isMatch;
17956 lodash.isMatchWith = isMatchWith;
17957 lodash.isNaN = isNaN;
17958 lodash.isNative = isNative;
17959 lodash.isNil = isNil;
17960 lodash.isNull = isNull;
17961 lodash.isNumber = isNumber;
17962 lodash.isObject = isObject;
17963 lodash.isObjectLike = isObjectLike;
17964 lodash.isPlainObject = isPlainObject;
17965 lodash.isRegExp = isRegExp;
17966 lodash.isSafeInteger = isSafeInteger;
17967 lodash.isSet = isSet;
17968 lodash.isString = isString;
17969 lodash.isSymbol = isSymbol;
17970 lodash.isTypedArray = isTypedArray;
17971 lodash.isUndefined = isUndefined;
17972 lodash.isWeakMap = isWeakMap;
17973 lodash.isWeakSet = isWeakSet;
17974 lodash.join = join;
17975 lodash.kebabCase = kebabCase;
17976 lodash.last = last;
17977 lodash.lastIndexOf = lastIndexOf;
17978 lodash.lowerCase = lowerCase;
17979 lodash.lowerFirst = lowerFirst;
17983 lodash.maxBy = maxBy;
17984 lodash.mean = mean;
17985 lodash.meanBy = meanBy;
17987 lodash.minBy = minBy;
17988 lodash.stubArray = stubArray;
17989 lodash.stubFalse = stubFalse;
17990 lodash.stubObject = stubObject;
17991 lodash.stubString = stubString;
17992 lodash.stubTrue = stubTrue;
17993 lodash.multiply = multiply;
17995 lodash.noConflict = noConflict;
17996 lodash.noop = noop;
17999 lodash.padEnd = padEnd;
18000 lodash.padStart = padStart;
18001 lodash.parseInt = parseInt;
18002 lodash.random = random;
18003 lodash.reduce = reduce;
18004 lodash.reduceRight = reduceRight;
18005 lodash.repeat = repeat;
18006 lodash.replace = replace;
18007 lodash.result = result;
18008 lodash.round = round;
18009 lodash.runInContext = runInContext;
18010 lodash.sample = sample;
18011 lodash.size = size;
18012 lodash.snakeCase = snakeCase;
18013 lodash.some = some;
18014 lodash.sortedIndex = sortedIndex;
18015 lodash.sortedIndexBy = sortedIndexBy;
18016 lodash.sortedIndexOf = sortedIndexOf;
18017 lodash.sortedLastIndex = sortedLastIndex;
18018 lodash.sortedLastIndexBy = sortedLastIndexBy;
18019 lodash.sortedLastIndexOf = sortedLastIndexOf;
18020 lodash.startCase = startCase;
18021 lodash.startsWith = startsWith;
18022 lodash.subtract = subtract;
18024 lodash.sumBy = sumBy;
18025 lodash.template = template;
18026 lodash.times = times;
18027 lodash.toFinite = toFinite;
18028 lodash.toInteger = toInteger;
18029 lodash.toLength = toLength;
18030 lodash.toLower = toLower;
18031 lodash.toNumber = toNumber;
18032 lodash.toSafeInteger = toSafeInteger;
18033 lodash.toString = toString;
18034 lodash.toUpper = toUpper;
18035 lodash.trim = trim;
18036 lodash.trimEnd = trimEnd;
18037 lodash.trimStart = trimStart;
18038 lodash.truncate = truncate;
18039 lodash.unescape = unescape;
18040 lodash.uniqueId = uniqueId;
18041 lodash.upperCase = upperCase;
18042 lodash.upperFirst = upperFirst;
18045 lodash.each = forEach;
18046 lodash.eachRight = forEachRight;
18047 lodash.first = head;
18049 mixin(lodash, (function() {
18051 baseForOwn(lodash, function(func, methodName) {
18052 if (!hasOwnProperty.call(lodash.prototype, methodName)) {
18053 source[methodName] = func;
18057 }()), { 'chain': false });
18059 /*------------------------------------------------------------------------*/
18062 * The semantic version number.
18068 lodash.VERSION = VERSION;
18070 // Assign default placeholders.
18071 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
18072 lodash[methodName].placeholder = lodash;
18075 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
18076 arrayEach(['drop', 'take'], function(methodName, index) {
18077 LazyWrapper.prototype[methodName] = function(n) {
18078 n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
18080 var result = (this.__filtered__ && !index)
18081 ? new LazyWrapper(this)
18084 if (result.__filtered__) {
18085 result.__takeCount__ = nativeMin(n, result.__takeCount__);
18087 result.__views__.push({
18088 'size': nativeMin(n, MAX_ARRAY_LENGTH),
18089 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
18095 LazyWrapper.prototype[methodName + 'Right'] = function(n) {
18096 return this.reverse()[methodName](n).reverse();
18100 // Add `LazyWrapper` methods that accept an `iteratee` value.
18101 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
18102 var type = index + 1,
18103 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
18105 LazyWrapper.prototype[methodName] = function(iteratee) {
18106 var result = this.clone();
18107 result.__iteratees__.push({
18108 'iteratee': getIteratee(iteratee, 3),
18111 result.__filtered__ = result.__filtered__ || isFilter;
18116 // Add `LazyWrapper` methods for `_.head` and `_.last`.
18117 arrayEach(['head', 'last'], function(methodName, index) {
18118 var takeName = 'take' + (index ? 'Right' : '');
18120 LazyWrapper.prototype[methodName] = function() {
18121 return this[takeName](1).value()[0];
18125 // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
18126 arrayEach(['initial', 'tail'], function(methodName, index) {
18127 var dropName = 'drop' + (index ? '' : 'Right');
18129 LazyWrapper.prototype[methodName] = function() {
18130 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
18134 LazyWrapper.prototype.compact = function() {
18135 return this.filter(identity);
18138 LazyWrapper.prototype.find = function(predicate) {
18139 return this.filter(predicate).head();
18142 LazyWrapper.prototype.findLast = function(predicate) {
18143 return this.reverse().find(predicate);
18146 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
18147 if (typeof path == 'function') {
18148 return new LazyWrapper(this);
18150 return this.map(function(value) {
18151 return baseInvoke(value, path, args);
18155 LazyWrapper.prototype.reject = function(predicate) {
18156 return this.filter(negate(getIteratee(predicate)));
18159 LazyWrapper.prototype.slice = function(start, end) {
18160 start = toInteger(start);
18163 if (result.__filtered__ && (start > 0 || end < 0)) {
18164 return new LazyWrapper(result);
18167 result = result.takeRight(-start);
18168 } else if (start) {
18169 result = result.drop(start);
18171 if (end !== undefined) {
18172 end = toInteger(end);
18173 result = end < 0 ? result.dropRight(-end) : result.take(end - start);
18178 LazyWrapper.prototype.takeRightWhile = function(predicate) {
18179 return this.reverse().takeWhile(predicate).reverse();
18182 LazyWrapper.prototype.toArray = function() {
18183 return this.take(MAX_ARRAY_LENGTH);
18186 // Add `LazyWrapper` methods to `lodash.prototype`.
18187 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
18188 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
18189 isTaker = /^(?:head|last)$/.test(methodName),
18190 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
18191 retUnwrapped = isTaker || /^find/.test(methodName);
18196 lodash.prototype[methodName] = function() {
18197 var value = this.__wrapped__,
18198 args = isTaker ? [1] : arguments,
18199 isLazy = value instanceof LazyWrapper,
18200 iteratee = args[0],
18201 useLazy = isLazy || isArray(value);
18203 var interceptor = function(value) {
18204 var result = lodashFunc.apply(lodash, arrayPush([value], args));
18205 return (isTaker && chainAll) ? result[0] : result;
18208 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
18209 // Avoid lazy use if the iteratee has a "length" value other than `1`.
18210 isLazy = useLazy = false;
18212 var chainAll = this.__chain__,
18213 isHybrid = !!this.__actions__.length,
18214 isUnwrapped = retUnwrapped && !chainAll,
18215 onlyLazy = isLazy && !isHybrid;
18217 if (!retUnwrapped && useLazy) {
18218 value = onlyLazy ? value : new LazyWrapper(this);
18219 var result = func.apply(value, args);
18220 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
18221 return new LodashWrapper(result, chainAll);
18223 if (isUnwrapped && onlyLazy) {
18224 return func.apply(this, args);
18226 result = this.thru(interceptor);
18227 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
18231 // Add `Array` methods to `lodash.prototype`.
18232 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
18233 var func = arrayProto[methodName],
18234 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
18235 retUnwrapped = /^(?:pop|shift)$/.test(methodName);
18237 lodash.prototype[methodName] = function() {
18238 var args = arguments;
18239 if (retUnwrapped && !this.__chain__) {
18240 var value = this.value();
18241 return func.apply(isArray(value) ? value : [], args);
18243 return this[chainName](function(value) {
18244 return func.apply(isArray(value) ? value : [], args);
18249 // Map minified method names to their real names.
18250 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
18251 var lodashFunc = lodash[methodName];
18253 var key = lodashFunc.name + '';
18254 if (!hasOwnProperty.call(realNames, key)) {
18255 realNames[key] = [];
18257 realNames[key].push({ 'name': methodName, 'func': lodashFunc });
18261 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
18266 // Add methods to `LazyWrapper`.
18267 LazyWrapper.prototype.clone = lazyClone;
18268 LazyWrapper.prototype.reverse = lazyReverse;
18269 LazyWrapper.prototype.value = lazyValue;
18271 // Add chain sequence methods to the `lodash` wrapper.
18272 lodash.prototype.at = wrapperAt;
18273 lodash.prototype.chain = wrapperChain;
18274 lodash.prototype.commit = wrapperCommit;
18275 lodash.prototype.next = wrapperNext;
18276 lodash.prototype.plant = wrapperPlant;
18277 lodash.prototype.reverse = wrapperReverse;
18278 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
18280 // Add lazy aliases.
18281 lodash.prototype.first = lodash.prototype.head;
18284 lodash.prototype[symIterator] = wrapperToIterator;
18289 /*--------------------------------------------------------------------------*/
18292 var _ = runInContext();
18294 // Some AMD build optimizers, like r.js, check for condition patterns like:
18296 // Expose Lodash on the global object to prevent errors when Lodash is
18297 // loaded by a script tag in the presence of an AMD loader.
18298 // See http://requirejs.org/docs/errors.html#mismatch for more details.
18299 // Use `_.noConflict` to remove Lodash from the global object.
18302 // Define as an anonymous module so, through path mapping, it can be
18303 // referenced as the "underscore" module.
18304 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
18306 }).call(exports, __webpack_require__, exports, module),
18307 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
18309 // Check for `exports` after `define` in case a build optimizer adds it.
18316 /***/ "./src/client.ts":
18317 /*!***********************!*\
18318 !*** ./src/client.ts ***!
18319 \***********************/
18320 /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
18324 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18325 if (k2 === undefined) k2 = k;
18326 var desc = Object.getOwnPropertyDescriptor(m, k);
18327 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18328 desc = { enumerable: true, get: function() { return m[k]; } };
18330 Object.defineProperty(o, k2, desc);
18331 }) : (function(o, m, k, k2) {
18332 if (k2 === undefined) k2 = k;
18335 var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18336 Object.defineProperty(o, "default", { enumerable: true, value: v });
18337 }) : function(o, v) {
18340 var __importStar = (this && this.__importStar) || function (mod) {
18341 if (mod && mod.__esModule) return mod;
18343 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18344 __setModuleDefault(result, mod);
18347 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18348 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18349 return new (P || (P = Promise))(function (resolve, reject) {
18350 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18351 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18352 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18353 step((generator = generator.apply(thisArg, _arguments || [])).next());
18356 var __importDefault = (this && this.__importDefault) || function (mod) {
18357 return (mod && mod.__esModule) ? mod : { "default": mod };
18359 Object.defineProperty(exports, "__esModule", ({ value: true }));
18360 const outline_1 = __webpack_require__(/*! ./outline */ "./src/outline.ts");
18361 const cursor_1 = __webpack_require__(/*! ./cursor */ "./src/cursor.ts");
18362 const keyboardjs_1 = __importDefault(__webpack_require__(/*! keyboardjs */ "./node_modules/keyboardjs/dist/keyboard.js"));
18363 const rawOutline = __importStar(__webpack_require__(/*! ./test-data.json */ "./src/test-data.json"));
18364 const help_1 = __webpack_require__(/*! help */ "./src/help.ts");
18365 const search_1 = __webpack_require__(/*! ./search */ "./src/search.ts");
18366 let outlineData = rawOutline;
18367 if (localStorage.getItem('activeOutline')) {
18368 const outlineId = localStorage.getItem('activeOutline');
18369 outlineData = JSON.parse(localStorage.getItem(outlineId));
18371 const state = new Map();
18372 const outline = new outline_1.Outline(outlineData);
18373 outliner().innerHTML = outline.render();
18374 const cursor = new cursor_1.Cursor();
18375 cursor.set('.node');
18376 const search = new search_1.Search();
18377 function outliner() {
18378 return document.querySelector('#outliner');
18380 document.getElementById('display-help').addEventListener('click', e => {
18381 e.preventDefault();
18382 e.stopPropagation();
18383 (0, help_1.showHelp)();
18385 keyboardjs_1.default.withContext('navigation', () => {
18386 keyboardjs_1.default.bind('j', e => {
18387 const sibling = cursor.get().nextElementSibling;
18390 const res = outline.swapNodeWithNextSibling(cursor.getIdOfNode());
18391 const html = outline.renderNode(res.parentNode);
18392 if (res.parentNode.id === '000000') {
18393 cursor.get().parentElement.innerHTML = html;
18396 cursor.get().parentElement.outerHTML = html;
18398 cursor.set(`#id-${res.targetNode.id}`);
18402 cursor.set(`#id-${sibling.getAttribute('data-id')}`);
18406 keyboardjs_1.default.bind('shift + /', e => {
18407 (0, help_1.showHelp)();
18409 keyboardjs_1.default.bind('k', e => {
18410 const sibling = cursor.get().previousElementSibling;
18411 if (sibling && !sibling.classList.contains('nodeContent')) {
18413 const res = outline.swapNodeWithPreviousSibling(cursor.getIdOfNode());
18414 const html = outline.renderNode(res.parentNode);
18415 if (res.parentNode.id === '000000') {
18416 cursor.get().parentElement.innerHTML = html;
18419 cursor.get().parentElement.outerHTML = html;
18421 cursor.set(`#id-${res.targetNode.id}`);
18425 cursor.set(`#id-${sibling.getAttribute('data-id')}`);
18429 keyboardjs_1.default.bind('l', e => {
18430 if (cursor.isNodeCollapsed()) {
18434 const res = outline.lowerNodeToChild(cursor.getIdOfNode());
18435 const html = outline.renderNode(res.oldParentNode);
18436 if (res.oldParentNode.id === '000000') {
18437 cursor.get().parentElement.innerHTML = html;
18440 cursor.get().parentElement.outerHTML = html;
18442 cursor.set(`#id-${res.targetNode.id}`);
18445 const children = cursor.get().querySelector('.node');
18447 cursor.set(`#id-${children.getAttribute('data-id')}`);
18451 keyboardjs_1.default.bind('h', e => {
18452 const parent = cursor.get().parentElement;
18453 if (parent && parent.classList.contains('node')) {
18455 if (outline.data.tree.children.map(n => n.id).includes(cursor.getIdOfNode())) {
18458 const res = outline.liftNodeToParent(cursor.getIdOfNode());
18459 const html = outline.renderNode(res.parentNode);
18460 if (res.parentNode.id === '000000') {
18461 cursor.get().parentElement.parentElement.innerHTML = html;
18464 cursor.get().parentElement.parentElement.outerHTML = html;
18466 cursor.set(`#id-${res.targetNode.id}`);
18470 cursor.set(`#id-${parent.getAttribute('data-id')}`);
18474 keyboardjs_1.default.bind('z', e => {
18475 if (cursor.isNodeExpanded()) {
18477 outline.fold(cursor.getIdOfNode());
18479 else if (cursor.isNodeCollapsed()) {
18481 outline.unfold(cursor.getIdOfNode());
18485 keyboardjs_1.default.bind('shift + 4', e => {
18486 e.preventDefault();
18487 cursor.get().classList.add('hidden-cursor');
18488 const contentNode = cursor.get().querySelector('.nodeContent');
18489 contentNode.innerHTML = outline.data.contentNodes[cursor.getIdOfNode()].content;
18490 contentNode.contentEditable = "true";
18491 const range = document.createRange();
18492 range.selectNodeContents(contentNode);
18493 range.collapse(false);
18494 const selection = window.getSelection();
18495 selection.removeAllRanges();
18496 selection.addRange(range);
18497 contentNode.focus();
18498 keyboardjs_1.default.setContext('editing');
18500 keyboardjs_1.default.bind('i', e => {
18501 e.preventDefault();
18502 cursor.get().classList.add('hidden-cursor');
18503 const contentNode = cursor.get().querySelector('.nodeContent');
18504 contentNode.innerHTML = outline.data.contentNodes[cursor.getIdOfNode()].content;
18505 contentNode.contentEditable = "true";
18506 contentNode.focus();
18507 keyboardjs_1.default.setContext('editing');
18509 keyboardjs_1.default.bind('shift + x', e => {
18510 e.preventDefault();
18511 cursor.get().classList.toggle('strikethrough');
18512 outline.data.contentNodes[cursor.getIdOfNode()].strikethrough = cursor.get().classList.contains('strikethrough');
18515 keyboardjs_1.default.bind('tab', e => {
18516 e.preventDefault();
18517 const res = outline.createChildNode(cursor.getIdOfNode());
18518 const html = outline.renderNode(res.parentNode);
18519 cursor.get().outerHTML = html;
18520 cursor.set(`#id-${res.node.id}`);
18523 keyboardjs_1.default.bind('enter', e => {
18527 e.preventDefault();
18529 const res = outline.createSiblingNode(cursor.getIdOfNode());
18530 const html = outline.renderNode(res.parentNode);
18531 if (res.parentNode.id === '000000') {
18532 cursor.get().parentElement.innerHTML = html;
18535 cursor.get().parentElement.outerHTML = html;
18537 cursor.set(`#id-${res.node.id}`);
18540 keyboardjs_1.default.bind('d', e => {
18544 const res = outline.removeNode(cursor.getIdOfNode());
18545 const html = outline.renderNode(res.parentNode);
18546 const prevSibling = cursor.get().previousElementSibling;
18547 const nextSibling = cursor.get().nextElementSibling;
18548 if (res.parentNode.id === '000000') {
18549 cursor.get().parentElement.innerHTML = html;
18552 cursor.get().parentElement.outerHTML = html;
18554 if (prevSibling.getAttribute('data-id')) {
18555 cursor.set(`#id-${prevSibling.getAttribute('data-id')}`);
18557 else if (nextSibling.getAttribute('data-id')) {
18558 cursor.set(`#id-${nextSibling.getAttribute('data-id')}`);
18561 console.log(res.parentNode.id);
18562 cursor.set(`#id-${res.parentNode.id}`);
18567 keyboardjs_1.default.withContext('editing', () => {
18568 keyboardjs_1.default.bind(['esc', 'enter'], e => {
18569 cursor.get().classList.remove('hidden-cursor');
18570 const contentNode = cursor.get().querySelector('.nodeContent');
18571 contentNode.contentEditable = "false";
18572 contentNode.blur();
18573 keyboardjs_1.default.setContext('navigation');
18574 outline.updateContent(cursor.getIdOfNode(), contentNode.innerHTML.trim());
18575 contentNode.innerHTML = outline.renderContent(cursor.getIdOfNode());
18579 keyboardjs_1.default.setContext('navigation');
18580 search.createIndex({
18585 strikethrough: "boolean"
18586 }).then(() => __awaiter(void 0, void 0, void 0, function* () {
18587 yield search.indexBatch(outline.data.contentNodes);
18588 search.bindEvents();
18590 function recursivelyExpand(start) {
18591 if (start.classList.contains('node')) {
18592 if (start.classList.contains('collapsed')) {
18593 start.classList.remove('collapsed');
18594 start.classList.add('expanded');
18595 outline.unfold(start.getAttribute('data-id'));
18597 if (start.parentElement) {
18598 recursivelyExpand(start.parentElement);
18602 search.onTermSelection = (docId) => {
18603 recursivelyExpand(document.getElementById(`id-${docId}`).parentElement);
18604 cursor.set(`#id-${docId}`);
18607 function saveImmediate() {
18608 localStorage.setItem(outline.data.id, JSON.stringify(outline.data));
18609 localStorage.setItem('activeOutline', outline.data.id);
18610 console.log('saved...', outline.data);
18611 state.delete('saveTimeout');
18614 if (!state.has('saveTimeout')) {
18615 state.set('saveTimeout', setTimeout(saveImmediate, 2000));
18623 /***/ "./src/cursor.ts":
18624 /*!***********************!*\
18625 !*** ./src/cursor.ts ***!
18626 \***********************/
18627 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
18631 Object.defineProperty(exports, "__esModule", ({ value: true }));
18632 exports.Cursor = void 0;
18633 const dom_1 = __webpack_require__(/*! dom */ "./src/dom.ts");
18638 return document.querySelector('.cursor');
18641 return this.get().getAttribute('data-id');
18644 const el = this.get();
18646 el.classList.remove('cursor');
18651 const el = document.querySelector(elementId);
18653 el.classList.add('cursor');
18654 if (!(0, dom_1.isVisible)(el)) {
18655 el.scrollIntoView(true);
18660 this.get().classList.remove('expanded');
18661 this.get().classList.add('collapsed');
18664 this.get().classList.remove('collapsed');
18665 this.get().classList.add('expanded');
18667 isNodeCollapsed() {
18668 return this.get().classList.contains('collapsed');
18671 return this.get().classList.contains('expanded');
18674 exports.Cursor = Cursor;
18679 /***/ "./src/dom.ts":
18680 /*!********************!*\
18681 !*** ./src/dom.ts ***!
18682 \********************/
18683 /***/ ((__unused_webpack_module, exports) => {
18687 Object.defineProperty(exports, "__esModule", ({ value: true }));
18688 exports.isVisible = void 0;
18689 function isVisible(element) {
18690 const rect = element.getBoundingClientRect();
18691 return (rect.top >= 0 &&
18693 rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&
18694 rect.right <= (window.innerWidth || document.documentElement.clientWidth));
18696 exports.isVisible = isVisible;
18701 /***/ "./src/help.ts":
18702 /*!*********************!*\
18703 !*** ./src/help.ts ***!
18704 \*********************/
18705 /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
18709 var __importDefault = (this && this.__importDefault) || function (mod) {
18710 return (mod && mod.__esModule) ? mod : { "default": mod };
18712 Object.defineProperty(exports, "__esModule", ({ value: true }));
18713 exports.showHelp = void 0;
18714 const keyboardjs_1 = __importDefault(__webpack_require__(/*! keyboardjs */ "./node_modules/keyboardjs/dist/keyboard.js"));
18715 const lodash_1 = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
18716 const keyboardCommands = {
18717 'h': 'Move the cursor to the Parent Element of the current node',
18718 'l': 'Move the cursor to the first Child Element of the current node',
18719 'j': 'Move the cursor to the next sibling of the current node',
18720 'k': 'Move the cursor to the previous sibling of the current node',
18721 'enter': 'Add a new node as a sibling to the current node',
18722 'tab': 'Add a new node as the child of the current node',
18723 'shift + j': 'Swap the current node with next sibling node',
18724 'shift + k': 'Swap the current node with the previous sibling node',
18725 'shift + h': 'Lift the current node to be a sibling of the parent node',
18726 'shift + l': 'Lower the current node to be a child of the previous sibling node',
18727 'shift + d': 'Delete the current node',
18728 'shift + f': 'Open the search modal',
18729 'i': 'Enter "edit" mode, and place the cursor at the start of the editable content',
18730 '$': 'Enter "edit" mode, and place the cursor at the end of the editable content',
18731 'escape': 'Exit the current mode and return to "navigation" mode',
18732 '?': 'Display this help dialogue'
18734 const modalHTML = `
18735 <div class="modal">
18736 <div class="modal-content">
18746 ${(0, lodash_1.map)(keyboardCommands, (text, key) => {
18763 function showHelp() {
18764 document.querySelector('body').innerHTML += modalHTML;
18765 keyboardjs_1.default.setContext('help');
18767 exports.showHelp = showHelp;
18768 keyboardjs_1.default.withContext('help', () => {
18769 keyboardjs_1.default.bind('escape', e => {
18770 document.querySelector('.modal').remove();
18771 keyboardjs_1.default.setContext('navigation');
18778 /***/ "./src/outline.ts":
18779 /*!************************!*\
18780 !*** ./src/outline.ts ***!
18781 \************************/
18782 /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
18786 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18787 if (k2 === undefined) k2 = k;
18788 var desc = Object.getOwnPropertyDescriptor(m, k);
18789 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18790 desc = { enumerable: true, get: function() { return m[k]; } };
18792 Object.defineProperty(o, k2, desc);
18793 }) : (function(o, m, k, k2) {
18794 if (k2 === undefined) k2 = k;
18797 var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18798 Object.defineProperty(o, "default", { enumerable: true, value: v });
18799 }) : function(o, v) {
18802 var __importStar = (this && this.__importStar) || function (mod) {
18803 if (mod && mod.__esModule) return mod;
18805 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18806 __setModuleDefault(result, mod);
18809 Object.defineProperty(exports, "__esModule", ({ value: true }));
18810 exports.Outline = void 0;
18811 const _ = __importStar(__webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"));
18812 const uuid_1 = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/commonjs-browser/index.js");
18813 const marked_1 = __webpack_require__(/*! marked */ "./node_modules/marked/lib/marked.cjs");
18816 constructor(outlineData) {
18817 this.data = outlineData;
18819 findNodeInTree(root, id, action, runState = false) {
18820 let run = runState;
18824 _.each(root.children, (childNode, idx) => {
18825 if (childNode.id === id) {
18826 action(childNode, root);
18830 else if (childNode.children) {
18831 this.findNodeInTree(childNode, id, action, run);
18836 this.findNodeInTree(this.data.tree, nodeId, item => {
18837 item.collapsed = true;
18841 this.findNodeInTree(this.data.tree, nodeId, item => {
18842 item.collapsed = false;
18845 flattenOutlineTreeChildren(tree) {
18846 return tree.children.map(node => node.id);
18848 liftNodeToParent(nodeId) {
18850 let targetNode, parentNode;
18851 this.findNodeInTree(this.data.tree, nodeId, (tNode, pNode) => {
18852 targetNode = tNode;
18853 this.findNodeInTree(this.data.tree, pNode.id, (originalParentNode, newParentNode) => {
18858 parentNode = newParentNode;
18860 const flatId = newParentNode.children.map(n => n.id);
18861 const originalNodePosition = originalParentNode.children.map(n => n.id).indexOf(targetNode.id);
18862 const newNodePosition = flatId.indexOf(originalParentNode.id);
18863 originalParentNode.children.splice(originalNodePosition, 1);
18864 newParentNode.children.splice(newNodePosition + 1, 0, targetNode);
18872 lowerNodeToChild(nodeId) {
18874 let targetNode, newParentNode, oldParentNode;
18875 this.findNodeInTree(this.data.tree, nodeId, (tNode, pNode) => {
18880 targetNode = tNode;
18881 let idList = pNode.children.map(n => n.id);
18882 if (idList.length === 1) {
18885 const position = idList.indexOf(targetNode.id);
18886 const prevSiblingPosition = position - 1;
18887 pNode.children[prevSiblingPosition].children.splice(0, 0, targetNode);
18888 pNode.children.splice(position, 1);
18889 newParentNode = pNode.children[prevSiblingPosition];
18890 oldParentNode = pNode;
18898 swapNodeWithNextSibling(nodeId) {
18899 let targetNode, parentNode;
18900 this.findNodeInTree(this.data.tree, nodeId, (tNode, pNode) => {
18901 targetNode = tNode;
18902 parentNode = pNode;
18903 const flatId = parentNode.children.map(n => n.id);
18904 const nodePosition = flatId.indexOf(targetNode.id);
18905 if (nodePosition === (flatId.length - 1)) {
18908 parentNode.children.splice(nodePosition, 1);
18909 parentNode.children.splice(nodePosition + 1, 0, targetNode);
18916 swapNodeWithPreviousSibling(nodeId) {
18917 let targetNode, parentNode;
18918 this.findNodeInTree(this.data.tree, nodeId, (tNode, pNode) => {
18919 targetNode = tNode;
18920 parentNode = pNode;
18921 const flatId = parentNode.children.map(n => n.id);
18922 const nodePosition = flatId.indexOf(targetNode.id);
18923 if (nodePosition === 0) {
18926 parentNode.children.splice(nodePosition, 1);
18927 parentNode.children.splice(nodePosition - 1, 0, targetNode);
18934 createSiblingNode(targetNode, nodeData) {
18935 const outlineNode = nodeData || {
18936 id: (0, uuid_1.v4)(),
18937 created: Date.now(),
18940 strikethrough: false
18942 this.data.contentNodes[outlineNode.id] = outlineNode;
18944 this.findNodeInTree(this.data.tree, targetNode, (node, parent) => {
18945 const position = parent.children.map(n => n.id).indexOf(targetNode);
18946 parent.children.splice(position + 1, 0, {
18947 id: outlineNode.id,
18951 parentNode = parent;
18958 createChildNode(currentNode, nodeId) {
18959 const node = nodeId ? this.data.contentNodes[nodeId] :
18961 id: (0, uuid_1.v4)(),
18962 created: Date.now(),
18965 strikethrough: false
18968 this.data.contentNodes[node.id] = node;
18971 this.findNodeInTree(this.data.tree, currentNode, (foundNode, parent) => {
18972 foundNode.children.unshift({
18977 parentNode = foundNode;
18984 removeNode(nodeId) {
18986 let removedNode, parentNode;
18987 this.findNodeInTree(this.data.tree, nodeId, (tNode, pNode) => {
18992 removedNode = tNode;
18993 parentNode = pNode;
18994 let position = parentNode.children.map(n => n.id).indexOf(tNode.id);
18995 parentNode.children.splice(position, 1);
19002 updateContent(id, content) {
19003 if (!this.data.contentNodes[id]) {
19004 throw new Error('Invalid node');
19006 this.data.contentNodes[id].content = content;
19008 renderContent(nodeId) {
19009 let node = this.data.contentNodes[nodeId];
19011 switch (node.type) {
19013 content = marked_1.marked.parse(node.content);
19016 content = node.content;
19022 if (node.id === '000000') {
19023 return this.render();
19025 const collapse = node.collapsed ? 'collapsed' : 'expanded';
19026 const content = this.data.contentNodes[node.id] || {
19028 created: Date.now(),
19031 strikethrough: false
19033 const strikethrough = content.strikethrough ? 'strikethrough' : '';
19034 let html = `<div class="node ${collapse} ${strikethrough}" data-id="${node.id}" id="id-${node.id}">
19035 <div class="nodeContent" data-type="${content.type}">
19036 ${this.renderContent(node.id)}
19038 ${node.children.length ? _.map(node.children, this.renderNode.bind(this)).join("\n") : ''}
19043 return _.map(this.data.tree.children, this.renderNode.bind(this)).join("\n");
19046 exports.Outline = Outline;
19051 /***/ "./src/search.ts":
19052 /*!***********************!*\
19053 !*** ./src/search.ts ***!
19054 \***********************/
19055 /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
19059 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
19060 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19061 return new (P || (P = Promise))(function (resolve, reject) {
19062 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19063 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19064 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19065 step((generator = generator.apply(thisArg, _arguments || [])).next());
19068 var __importDefault = (this && this.__importDefault) || function (mod) {
19069 return (mod && mod.__esModule) ? mod : { "default": mod };
19071 Object.defineProperty(exports, "__esModule", ({ value: true }));
19072 exports.Search = void 0;
19073 const lyra_1 = __webpack_require__(/*! @lyrasearch/lyra */ "./node_modules/@lyrasearch/lyra/dist/cjs/index.cjs");
19074 const lodash_1 = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
19075 const keyboardjs_1 = __importDefault(__webpack_require__(/*! keyboardjs */ "./node_modules/keyboardjs/dist/keyboard.js"));
19076 const dom_1 = __webpack_require__(/*! dom */ "./src/dom.ts");
19077 const searchModal = `
19078 <div class="modal">
19079 <div class="modal-content" id="search">
19080 <input type="text" id="search-query" placeholder="enter fuzzy search terms">
19081 <ul id="search-results">
19088 this.state = 'notready';
19090 createIndex(schema) {
19091 return __awaiter(this, void 0, void 0, function* () {
19092 this.db = yield (0, lyra_1.create)({
19095 this.state = 'ready';
19099 keyboardjs_1.default.withContext('search', () => {
19100 keyboardjs_1.default.bind('escape', e => {
19101 document.querySelector('.modal').remove();
19102 keyboardjs_1.default.setContext('navigation');
19104 keyboardjs_1.default.bind('down', e => {
19105 e.preventDefault();
19106 document.getElementById('search-query').blur();
19107 const el = document.querySelector('.search-result.selected');
19108 if (el.nextElementSibling) {
19109 el.classList.remove('selected');
19110 el.nextElementSibling.classList.add('selected');
19111 if (!(0, dom_1.isVisible)(el.nextElementSibling)) {
19112 el.nextElementSibling.scrollIntoView();
19116 keyboardjs_1.default.bind('up', e => {
19117 e.preventDefault();
19118 const el = document.querySelector('.search-result.selected');
19119 if (el.previousElementSibling) {
19120 el.classList.remove('selected');
19121 el.previousElementSibling.classList.add('selected');
19122 if (!(0, dom_1.isVisible)(el.previousElementSibling)) {
19123 el.previousElementSibling.scrollIntoView();
19127 keyboardjs_1.default.bind('enter', e => {
19128 const el = document.querySelector('.search-result.selected');
19129 const docId = el.getAttribute('data-id');
19130 document.querySelector('.modal').remove();
19131 keyboardjs_1.default.setContext('navigation');
19132 if (this.onTermSelection) {
19133 this.onTermSelection(docId);
19137 keyboardjs_1.default.withContext('navigation', () => {
19138 keyboardjs_1.default.bind('shift + f', e => {
19139 e.preventDefault();
19140 e.stopPropagation();
19141 document.querySelector('body').innerHTML += searchModal;
19142 const el = document.getElementById('search-query');
19144 el.addEventListener('keyup', this.debounceSearch.bind(this));
19145 keyboardjs_1.default.setContext('search');
19149 debounceSearch(e) {
19150 if (this.debounce) {
19151 clearInterval(this.debounce);
19153 const el = e.target;
19154 const query = el.value.toString().trim();
19155 if (query.length) {
19156 this.debounce = setTimeout(() => {
19157 this.displaySearch(query, e);
19161 displaySearch(terms, e) {
19162 return __awaiter(this, void 0, void 0, function* () {
19166 const res = yield this.search(terms);
19167 const resultContainer = document.getElementById('search-results');
19168 if (res.hits.length === 0) {
19169 resultContainer.innerHTML = '<li><em>No Results</em></li>';
19172 const html = res.hits.map((doc, idx) => {
19173 const content = doc.document.content.toString();
19174 const display = content.substring(0, 100);
19176 <li class="search-result ${idx === 0 ? 'selected' : ''}" data-id="${doc.id}">${display}${content.length > display.length ? '...' : ''}</li>
19179 resultContainer.innerHTML = html.join("\n");
19183 return (0, lyra_1.insert)(this.db, doc);
19186 return (0, lyra_1.insertBatch)(this.db, (0, lodash_1.map)(docs, doc => doc));
19189 return (0, lyra_1.search)(this.db, {
19191 properties: ["content"]
19195 exports.Search = Search;
19200 /***/ "./node_modules/uuid/dist/commonjs-browser/index.js":
19201 /*!**********************************************************!*\
19202 !*** ./node_modules/uuid/dist/commonjs-browser/index.js ***!
19203 \**********************************************************/
19204 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19209 Object.defineProperty(exports, "__esModule", ({
19212 Object.defineProperty(exports, "NIL", ({
19214 get: function get() {
19215 return _nil.default;
19218 Object.defineProperty(exports, "parse", ({
19220 get: function get() {
19221 return _parse.default;
19224 Object.defineProperty(exports, "stringify", ({
19226 get: function get() {
19227 return _stringify.default;
19230 Object.defineProperty(exports, "v1", ({
19232 get: function get() {
19236 Object.defineProperty(exports, "v3", ({
19238 get: function get() {
19239 return _v2.default;
19242 Object.defineProperty(exports, "v4", ({
19244 get: function get() {
19245 return _v3.default;
19248 Object.defineProperty(exports, "v5", ({
19250 get: function get() {
19251 return _v4.default;
19254 Object.defineProperty(exports, "validate", ({
19256 get: function get() {
19257 return _validate.default;
19260 Object.defineProperty(exports, "version", ({
19262 get: function get() {
19263 return _version.default;
19267 var _v = _interopRequireDefault(__webpack_require__(/*! ./v1.js */ "./node_modules/uuid/dist/commonjs-browser/v1.js"));
19269 var _v2 = _interopRequireDefault(__webpack_require__(/*! ./v3.js */ "./node_modules/uuid/dist/commonjs-browser/v3.js"));
19271 var _v3 = _interopRequireDefault(__webpack_require__(/*! ./v4.js */ "./node_modules/uuid/dist/commonjs-browser/v4.js"));
19273 var _v4 = _interopRequireDefault(__webpack_require__(/*! ./v5.js */ "./node_modules/uuid/dist/commonjs-browser/v5.js"));
19275 var _nil = _interopRequireDefault(__webpack_require__(/*! ./nil.js */ "./node_modules/uuid/dist/commonjs-browser/nil.js"));
19277 var _version = _interopRequireDefault(__webpack_require__(/*! ./version.js */ "./node_modules/uuid/dist/commonjs-browser/version.js"));
19279 var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/uuid/dist/commonjs-browser/validate.js"));
19281 var _stringify = _interopRequireDefault(__webpack_require__(/*! ./stringify.js */ "./node_modules/uuid/dist/commonjs-browser/stringify.js"));
19283 var _parse = _interopRequireDefault(__webpack_require__(/*! ./parse.js */ "./node_modules/uuid/dist/commonjs-browser/parse.js"));
19285 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19289 /***/ "./node_modules/uuid/dist/commonjs-browser/md5.js":
19290 /*!********************************************************!*\
19291 !*** ./node_modules/uuid/dist/commonjs-browser/md5.js ***!
19292 \********************************************************/
19293 /***/ ((__unused_webpack_module, exports) => {
19298 Object.defineProperty(exports, "__esModule", ({
19301 exports["default"] = void 0;
19304 * Browser-compatible JavaScript MD5
19306 * Modification of JavaScript MD5
19307 * https://github.com/blueimp/JavaScript-MD5
19309 * Copyright 2011, Sebastian Tschan
19310 * https://blueimp.net
19312 * Licensed under the MIT license:
19313 * https://opensource.org/licenses/MIT
19316 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
19317 * Digest Algorithm, as defined in RFC 1321.
19318 * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
19319 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
19320 * Distributed under the BSD License
19321 * See http://pajhome.org.uk/crypt/md5 for more info.
19323 function md5(bytes) {
19324 if (typeof bytes === 'string') {
19325 const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
19327 bytes = new Uint8Array(msg.length);
19329 for (let i = 0; i < msg.length; ++i) {
19330 bytes[i] = msg.charCodeAt(i);
19334 return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
19337 * Convert an array of little-endian words to an array of bytes
19341 function md5ToHexEncodedArray(input) {
19343 const length32 = input.length * 32;
19344 const hexTab = '0123456789abcdef';
19346 for (let i = 0; i < length32; i += 8) {
19347 const x = input[i >> 5] >>> i % 32 & 0xff;
19348 const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
19355 * Calculate output length with padding and bit length
19359 function getOutputLength(inputLength8) {
19360 return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
19363 * Calculate the MD5 of an array of little-endian words, and a bit length.
19367 function wordsToMd5(x, len) {
19368 /* append padding */
19369 x[len >> 5] |= 0x80 << len % 32;
19370 x[getOutputLength(len) - 1] = len;
19371 let a = 1732584193;
19372 let b = -271733879;
19373 let c = -1732584194;
19376 for (let i = 0; i < x.length; i += 16) {
19381 a = md5ff(a, b, c, d, x[i], 7, -680876936);
19382 d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
19383 c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
19384 b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
19385 a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
19386 d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
19387 c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
19388 b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
19389 a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
19390 d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
19391 c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
19392 b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
19393 a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
19394 d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
19395 c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
19396 b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
19397 a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
19398 d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
19399 c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
19400 b = md5gg(b, c, d, a, x[i], 20, -373897302);
19401 a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
19402 d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
19403 c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
19404 b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
19405 a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
19406 d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
19407 c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
19408 b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
19409 a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
19410 d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
19411 c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
19412 b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
19413 a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
19414 d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
19415 c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
19416 b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
19417 a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
19418 d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
19419 c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
19420 b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
19421 a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
19422 d = md5hh(d, a, b, c, x[i], 11, -358537222);
19423 c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
19424 b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
19425 a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
19426 d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
19427 c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
19428 b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
19429 a = md5ii(a, b, c, d, x[i], 6, -198630844);
19430 d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
19431 c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
19432 b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
19433 a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
19434 d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
19435 c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
19436 b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
19437 a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
19438 d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
19439 c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
19440 b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
19441 a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
19442 d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
19443 c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
19444 b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
19445 a = safeAdd(a, olda);
19446 b = safeAdd(b, oldb);
19447 c = safeAdd(c, oldc);
19448 d = safeAdd(d, oldd);
19451 return [a, b, c, d];
19454 * Convert an array bytes to an array of little-endian words
19455 * Characters >255 have their high-byte silently ignored.
19459 function bytesToWords(input) {
19460 if (input.length === 0) {
19464 const length8 = input.length * 8;
19465 const output = new Uint32Array(getOutputLength(length8));
19467 for (let i = 0; i < length8; i += 8) {
19468 output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
19474 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
19475 * to work around bugs in some JS interpreters.
19479 function safeAdd(x, y) {
19480 const lsw = (x & 0xffff) + (y & 0xffff);
19481 const msw = (x >> 16) + (y >> 16) + (lsw >> 16);
19482 return msw << 16 | lsw & 0xffff;
19485 * Bitwise rotate a 32-bit number to the left.
19489 function bitRotateLeft(num, cnt) {
19490 return num << cnt | num >>> 32 - cnt;
19493 * These functions implement the four basic operations the algorithm uses.
19497 function md5cmn(q, a, b, x, s, t) {
19498 return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
19501 function md5ff(a, b, c, d, x, s, t) {
19502 return md5cmn(b & c | ~b & d, a, b, x, s, t);
19505 function md5gg(a, b, c, d, x, s, t) {
19506 return md5cmn(b & d | c & ~d, a, b, x, s, t);
19509 function md5hh(a, b, c, d, x, s, t) {
19510 return md5cmn(b ^ c ^ d, a, b, x, s, t);
19513 function md5ii(a, b, c, d, x, s, t) {
19514 return md5cmn(c ^ (b | ~d), a, b, x, s, t);
19517 var _default = md5;
19518 exports["default"] = _default;
19522 /***/ "./node_modules/uuid/dist/commonjs-browser/native.js":
19523 /*!***********************************************************!*\
19524 !*** ./node_modules/uuid/dist/commonjs-browser/native.js ***!
19525 \***********************************************************/
19526 /***/ ((__unused_webpack_module, exports) => {
19531 Object.defineProperty(exports, "__esModule", ({
19534 exports["default"] = void 0;
19535 const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
19539 exports["default"] = _default;
19543 /***/ "./node_modules/uuid/dist/commonjs-browser/nil.js":
19544 /*!********************************************************!*\
19545 !*** ./node_modules/uuid/dist/commonjs-browser/nil.js ***!
19546 \********************************************************/
19547 /***/ ((__unused_webpack_module, exports) => {
19552 Object.defineProperty(exports, "__esModule", ({
19555 exports["default"] = void 0;
19556 var _default = '00000000-0000-0000-0000-000000000000';
19557 exports["default"] = _default;
19561 /***/ "./node_modules/uuid/dist/commonjs-browser/parse.js":
19562 /*!**********************************************************!*\
19563 !*** ./node_modules/uuid/dist/commonjs-browser/parse.js ***!
19564 \**********************************************************/
19565 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19570 Object.defineProperty(exports, "__esModule", ({
19573 exports["default"] = void 0;
19575 var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/uuid/dist/commonjs-browser/validate.js"));
19577 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19579 function parse(uuid) {
19580 if (!(0, _validate.default)(uuid)) {
19581 throw TypeError('Invalid UUID');
19585 const arr = new Uint8Array(16); // Parse ########-....-....-....-............
19587 arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
19588 arr[1] = v >>> 16 & 0xff;
19589 arr[2] = v >>> 8 & 0xff;
19590 arr[3] = v & 0xff; // Parse ........-####-....-....-............
19592 arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
19593 arr[5] = v & 0xff; // Parse ........-....-####-....-............
19595 arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
19596 arr[7] = v & 0xff; // Parse ........-....-....-####-............
19598 arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
19599 arr[9] = v & 0xff; // Parse ........-....-....-....-############
19600 // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
19602 arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
19603 arr[11] = v / 0x100000000 & 0xff;
19604 arr[12] = v >>> 24 & 0xff;
19605 arr[13] = v >>> 16 & 0xff;
19606 arr[14] = v >>> 8 & 0xff;
19607 arr[15] = v & 0xff;
19611 var _default = parse;
19612 exports["default"] = _default;
19616 /***/ "./node_modules/uuid/dist/commonjs-browser/regex.js":
19617 /*!**********************************************************!*\
19618 !*** ./node_modules/uuid/dist/commonjs-browser/regex.js ***!
19619 \**********************************************************/
19620 /***/ ((__unused_webpack_module, exports) => {
19625 Object.defineProperty(exports, "__esModule", ({
19628 exports["default"] = void 0;
19629 var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
19630 exports["default"] = _default;
19634 /***/ "./node_modules/uuid/dist/commonjs-browser/rng.js":
19635 /*!********************************************************!*\
19636 !*** ./node_modules/uuid/dist/commonjs-browser/rng.js ***!
19637 \********************************************************/
19638 /***/ ((__unused_webpack_module, exports) => {
19643 Object.defineProperty(exports, "__esModule", ({
19646 exports["default"] = rng;
19647 // Unique ID creation requires a high quality random # generator. In the browser we therefore
19648 // require the crypto API and do not support built-in fallback to lower quality random number
19649 // generators (like Math.random()).
19650 let getRandomValues;
19651 const rnds8 = new Uint8Array(16);
19654 // lazy load so that environments that need to polyfill have a chance to do so
19655 if (!getRandomValues) {
19656 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
19657 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
19659 if (!getRandomValues) {
19660 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
19664 return getRandomValues(rnds8);
19669 /***/ "./node_modules/uuid/dist/commonjs-browser/sha1.js":
19670 /*!*********************************************************!*\
19671 !*** ./node_modules/uuid/dist/commonjs-browser/sha1.js ***!
19672 \*********************************************************/
19673 /***/ ((__unused_webpack_module, exports) => {
19678 Object.defineProperty(exports, "__esModule", ({
19681 exports["default"] = void 0;
19683 // Adapted from Chris Veness' SHA1 code at
19684 // http://www.movable-type.co.uk/scripts/sha1.html
19685 function f(s, x, y, z) {
19688 return x & y ^ ~x & z;
19694 return x & y ^ x & z ^ y & z;
19701 function ROTL(x, n) {
19702 return x << n | x >>> 32 - n;
19705 function sha1(bytes) {
19706 const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
19707 const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
19709 if (typeof bytes === 'string') {
19710 const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
19714 for (let i = 0; i < msg.length; ++i) {
19715 bytes.push(msg.charCodeAt(i));
19717 } else if (!Array.isArray(bytes)) {
19718 // Convert Array-like to Array
19719 bytes = Array.prototype.slice.call(bytes);
19723 const l = bytes.length / 4 + 2;
19724 const N = Math.ceil(l / 16);
19725 const M = new Array(N);
19727 for (let i = 0; i < N; ++i) {
19728 const arr = new Uint32Array(16);
19730 for (let j = 0; j < 16; ++j) {
19731 arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
19737 M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
19738 M[N - 1][14] = Math.floor(M[N - 1][14]);
19739 M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
19741 for (let i = 0; i < N; ++i) {
19742 const W = new Uint32Array(80);
19744 for (let t = 0; t < 16; ++t) {
19748 for (let t = 16; t < 80; ++t) {
19749 W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
19758 for (let t = 0; t < 80; ++t) {
19759 const s = Math.floor(t / 20);
19760 const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
19763 c = ROTL(b, 30) >>> 0;
19768 H[0] = H[0] + a >>> 0;
19769 H[1] = H[1] + b >>> 0;
19770 H[2] = H[2] + c >>> 0;
19771 H[3] = H[3] + d >>> 0;
19772 H[4] = H[4] + e >>> 0;
19775 return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
19778 var _default = sha1;
19779 exports["default"] = _default;
19783 /***/ "./node_modules/uuid/dist/commonjs-browser/stringify.js":
19784 /*!**************************************************************!*\
19785 !*** ./node_modules/uuid/dist/commonjs-browser/stringify.js ***!
19786 \**************************************************************/
19787 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19792 Object.defineProperty(exports, "__esModule", ({
19795 exports["default"] = void 0;
19796 exports.unsafeStringify = unsafeStringify;
19798 var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/uuid/dist/commonjs-browser/validate.js"));
19800 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19803 * Convert array of 16 byte values to UUID string format of the form:
19804 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
19806 const byteToHex = [];
19808 for (let i = 0; i < 256; ++i) {
19809 byteToHex.push((i + 0x100).toString(16).slice(1));
19812 function unsafeStringify(arr, offset = 0) {
19813 // Note: Be careful editing this code! It's been tuned for performance
19814 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
19815 return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
19818 function stringify(arr, offset = 0) {
19819 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
19820 // of the following:
19821 // - One or more input array values don't map to a hex octet (leading to
19822 // "undefined" in the uuid)
19823 // - Invalid input values for the RFC `version` or `variant` fields
19825 if (!(0, _validate.default)(uuid)) {
19826 throw TypeError('Stringified UUID is invalid');
19832 var _default = stringify;
19833 exports["default"] = _default;
19837 /***/ "./node_modules/uuid/dist/commonjs-browser/v1.js":
19838 /*!*******************************************************!*\
19839 !*** ./node_modules/uuid/dist/commonjs-browser/v1.js ***!
19840 \*******************************************************/
19841 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19846 Object.defineProperty(exports, "__esModule", ({
19849 exports["default"] = void 0;
19851 var _rng = _interopRequireDefault(__webpack_require__(/*! ./rng.js */ "./node_modules/uuid/dist/commonjs-browser/rng.js"));
19853 var _stringify = __webpack_require__(/*! ./stringify.js */ "./node_modules/uuid/dist/commonjs-browser/stringify.js");
19855 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19857 // **`v1()` - Generate time-based UUID**
19859 // Inspired by https://github.com/LiosK/UUID.js
19860 // and http://docs.python.org/library/uuid.html
19863 let _clockseq; // Previous uuid creation time
19866 let _lastMSecs = 0;
19867 let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
19869 function v1(options, buf, offset) {
19870 let i = buf && offset || 0;
19871 const b = buf || new Array(16);
19872 options = options || {};
19873 let node = options.node || _nodeId;
19874 let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
19875 // specified. We do this lazily to minimize issues related to insufficient
19876 // system entropy. See #189
19878 if (node == null || clockseq == null) {
19879 const seedBytes = options.random || (options.rng || _rng.default)();
19881 if (node == null) {
19882 // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
19883 node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
19886 if (clockseq == null) {
19887 // Per 4.2.2, randomize (14 bit) clockseq
19888 clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
19890 } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
19891 // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
19892 // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
19893 // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
19896 let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
19897 // cycle to simulate higher resolution clock
19899 let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
19901 const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
19903 if (dt < 0 && options.clockseq === undefined) {
19904 clockseq = clockseq + 1 & 0x3fff;
19905 } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
19909 if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
19911 } // Per 4.2.1.2 Throw error if too many uuids are requested
19914 if (nsecs >= 10000) {
19915 throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
19918 _lastMSecs = msecs;
19919 _lastNSecs = nsecs;
19920 _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
19922 msecs += 12219292800000; // `time_low`
19924 const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
19925 b[i++] = tl >>> 24 & 0xff;
19926 b[i++] = tl >>> 16 & 0xff;
19927 b[i++] = tl >>> 8 & 0xff;
19928 b[i++] = tl & 0xff; // `time_mid`
19930 const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
19931 b[i++] = tmh >>> 8 & 0xff;
19932 b[i++] = tmh & 0xff; // `time_high_and_version`
19934 b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
19936 b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
19938 b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
19940 b[i++] = clockseq & 0xff; // `node`
19942 for (let n = 0; n < 6; ++n) {
19943 b[i + n] = node[n];
19946 return buf || (0, _stringify.unsafeStringify)(b);
19950 exports["default"] = _default;
19954 /***/ "./node_modules/uuid/dist/commonjs-browser/v3.js":
19955 /*!*******************************************************!*\
19956 !*** ./node_modules/uuid/dist/commonjs-browser/v3.js ***!
19957 \*******************************************************/
19958 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19963 Object.defineProperty(exports, "__esModule", ({
19966 exports["default"] = void 0;
19968 var _v = _interopRequireDefault(__webpack_require__(/*! ./v35.js */ "./node_modules/uuid/dist/commonjs-browser/v35.js"));
19970 var _md = _interopRequireDefault(__webpack_require__(/*! ./md5.js */ "./node_modules/uuid/dist/commonjs-browser/md5.js"));
19972 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19974 const v3 = (0, _v.default)('v3', 0x30, _md.default);
19976 exports["default"] = _default;
19980 /***/ "./node_modules/uuid/dist/commonjs-browser/v35.js":
19981 /*!********************************************************!*\
19982 !*** ./node_modules/uuid/dist/commonjs-browser/v35.js ***!
19983 \********************************************************/
19984 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
19989 Object.defineProperty(exports, "__esModule", ({
19992 exports.URL = exports.DNS = void 0;
19993 exports["default"] = v35;
19995 var _stringify = __webpack_require__(/*! ./stringify.js */ "./node_modules/uuid/dist/commonjs-browser/stringify.js");
19997 var _parse = _interopRequireDefault(__webpack_require__(/*! ./parse.js */ "./node_modules/uuid/dist/commonjs-browser/parse.js"));
19999 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20001 function stringToBytes(str) {
20002 str = unescape(encodeURIComponent(str)); // UTF8 escape
20006 for (let i = 0; i < str.length; ++i) {
20007 bytes.push(str.charCodeAt(i));
20013 const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
20015 const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
20018 function v35(name, version, hashfunc) {
20019 function generateUUID(value, namespace, buf, offset) {
20022 if (typeof value === 'string') {
20023 value = stringToBytes(value);
20026 if (typeof namespace === 'string') {
20027 namespace = (0, _parse.default)(namespace);
20030 if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
20031 throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
20032 } // Compute hash of namespace and value, Per 4.3
20033 // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
20034 // hashfunc([...namespace, ... value])`
20037 let bytes = new Uint8Array(16 + value.length);
20038 bytes.set(namespace);
20039 bytes.set(value, namespace.length);
20040 bytes = hashfunc(bytes);
20041 bytes[6] = bytes[6] & 0x0f | version;
20042 bytes[8] = bytes[8] & 0x3f | 0x80;
20045 offset = offset || 0;
20047 for (let i = 0; i < 16; ++i) {
20048 buf[offset + i] = bytes[i];
20054 return (0, _stringify.unsafeStringify)(bytes);
20055 } // Function#name is not settable on some platforms (#270)
20059 generateUUID.name = name; // eslint-disable-next-line no-empty
20060 } catch (err) {} // For CommonJS default export support
20063 generateUUID.DNS = DNS;
20064 generateUUID.URL = URL;
20065 return generateUUID;
20070 /***/ "./node_modules/uuid/dist/commonjs-browser/v4.js":
20071 /*!*******************************************************!*\
20072 !*** ./node_modules/uuid/dist/commonjs-browser/v4.js ***!
20073 \*******************************************************/
20074 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20079 Object.defineProperty(exports, "__esModule", ({
20082 exports["default"] = void 0;
20084 var _native = _interopRequireDefault(__webpack_require__(/*! ./native.js */ "./node_modules/uuid/dist/commonjs-browser/native.js"));
20086 var _rng = _interopRequireDefault(__webpack_require__(/*! ./rng.js */ "./node_modules/uuid/dist/commonjs-browser/rng.js"));
20088 var _stringify = __webpack_require__(/*! ./stringify.js */ "./node_modules/uuid/dist/commonjs-browser/stringify.js");
20090 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20092 function v4(options, buf, offset) {
20093 if (_native.default.randomUUID && !buf && !options) {
20094 return _native.default.randomUUID();
20097 options = options || {};
20099 const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
20102 rnds[6] = rnds[6] & 0x0f | 0x40;
20103 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
20106 offset = offset || 0;
20108 for (let i = 0; i < 16; ++i) {
20109 buf[offset + i] = rnds[i];
20115 return (0, _stringify.unsafeStringify)(rnds);
20119 exports["default"] = _default;
20123 /***/ "./node_modules/uuid/dist/commonjs-browser/v5.js":
20124 /*!*******************************************************!*\
20125 !*** ./node_modules/uuid/dist/commonjs-browser/v5.js ***!
20126 \*******************************************************/
20127 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20132 Object.defineProperty(exports, "__esModule", ({
20135 exports["default"] = void 0;
20137 var _v = _interopRequireDefault(__webpack_require__(/*! ./v35.js */ "./node_modules/uuid/dist/commonjs-browser/v35.js"));
20139 var _sha = _interopRequireDefault(__webpack_require__(/*! ./sha1.js */ "./node_modules/uuid/dist/commonjs-browser/sha1.js"));
20141 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20143 const v5 = (0, _v.default)('v5', 0x50, _sha.default);
20145 exports["default"] = _default;
20149 /***/ "./node_modules/uuid/dist/commonjs-browser/validate.js":
20150 /*!*************************************************************!*\
20151 !*** ./node_modules/uuid/dist/commonjs-browser/validate.js ***!
20152 \*************************************************************/
20153 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20158 Object.defineProperty(exports, "__esModule", ({
20161 exports["default"] = void 0;
20163 var _regex = _interopRequireDefault(__webpack_require__(/*! ./regex.js */ "./node_modules/uuid/dist/commonjs-browser/regex.js"));
20165 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20167 function validate(uuid) {
20168 return typeof uuid === 'string' && _regex.default.test(uuid);
20171 var _default = validate;
20172 exports["default"] = _default;
20176 /***/ "./node_modules/uuid/dist/commonjs-browser/version.js":
20177 /*!************************************************************!*\
20178 !*** ./node_modules/uuid/dist/commonjs-browser/version.js ***!
20179 \************************************************************/
20180 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20185 Object.defineProperty(exports, "__esModule", ({
20188 exports["default"] = void 0;
20190 var _validate = _interopRequireDefault(__webpack_require__(/*! ./validate.js */ "./node_modules/uuid/dist/commonjs-browser/validate.js"));
20192 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20194 function version(uuid) {
20195 if (!(0, _validate.default)(uuid)) {
20196 throw TypeError('Invalid UUID');
20199 return parseInt(uuid.slice(14, 15), 16);
20202 var _default = version;
20203 exports["default"] = _default;
20207 /***/ "./node_modules/@lyrasearch/lyra/dist/cjs/index.cjs":
20208 /*!**********************************************************!*\
20209 !*** ./node_modules/@lyrasearch/lyra/dist/cjs/index.cjs ***!
20210 \**********************************************************/
20211 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
20215 Object.defineProperty(exports, "__esModule", ({
20218 function _export(target, all) {
20219 for(var name in all)Object.defineProperty(target, name, {
20225 create: ()=>create,
20226 insert: ()=>insert,
20227 insertWithHooks: ()=>insertWithHooks,
20228 insertBatch: ()=>insertBatch,
20229 remove: ()=>remove,
20230 search: ()=>search,
20233 requireLyra: ()=>requireLyra
20237 let _esmInsertWithHooks;
20238 let _esmInsertBatch;
20243 async function create(...args) {
20245 const imported = await Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_node_js-node_modules_lyrasearch_lyra_dis-426440"), __webpack_require__.e("node_modules_lyrasearch_lyra_dist_methods_create_js")]).then(__webpack_require__.bind(__webpack_require__, /*! ../methods/create.js */ "./node_modules/@lyrasearch/lyra/dist/methods/create.js"));
20246 _esmCreate = imported.create;
20248 return _esmCreate(...args);
20250 async function insert(...args) {
20252 const imported = await Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_radix_js"), __webpack_require__.e("node_modules_lyrasearch_lyra_dist_methods_insert_js-node_modules_lyrasearch_lyra_dist_radix-t-7cfd98")]).then(__webpack_require__.bind(__webpack_require__, /*! ../methods/insert.js */ "./node_modules/@lyrasearch/lyra/dist/methods/insert.js"));
20253 _esmInsert = imported.insert;
20255 return _esmInsert(...args);
20257 async function insertWithHooks(...args) {
20258 if (!_esmInsertWithHooks) {
20259 const imported = await Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_radix_js"), __webpack_require__.e("node_modules_lyrasearch_lyra_dist_methods_insert_js-node_modules_lyrasearch_lyra_dist_radix-t-7cfd98")]).then(__webpack_require__.bind(__webpack_require__, /*! ../methods/insert.js */ "./node_modules/@lyrasearch/lyra/dist/methods/insert.js"));
20260 _esmInsertWithHooks = imported.insertWithHooks;
20262 return _esmInsertWithHooks(...args);
20264 async function insertBatch(...args) {
20265 if (!_esmInsertBatch) {
20266 const imported = await Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_radix_js"), __webpack_require__.e("node_modules_lyrasearch_lyra_dist_methods_insert_js-node_modules_lyrasearch_lyra_dist_radix-t-7cfd98")]).then(__webpack_require__.bind(__webpack_require__, /*! ../methods/insert.js */ "./node_modules/@lyrasearch/lyra/dist/methods/insert.js"));
20267 _esmInsertBatch = imported.insertBatch;
20269 return _esmInsertBatch(...args);
20271 async function remove(...args) {
20273 const imported = await Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_node_js-node_modules_lyrasearch_lyra_dis-426440"), __webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_radix_js"), __webpack_require__.e("node_modules_lyrasearch_lyra_dist_methods_remove_js")]).then(__webpack_require__.bind(__webpack_require__, /*! ../methods/remove.js */ "./node_modules/@lyrasearch/lyra/dist/methods/remove.js"));
20274 _esmRemove = imported.remove;
20276 return _esmRemove(...args);
20278 async function search(...args) {
20280 const imported = await Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_node_js-node_modules_lyrasearch_lyra_dis-426440"), __webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_radix_js"), __webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_methods_search_js")]).then(__webpack_require__.bind(__webpack_require__, /*! ../methods/search.js */ "./node_modules/@lyrasearch/lyra/dist/methods/search.js"));
20281 _esmSearch = imported.search;
20283 return _esmSearch(...args);
20285 async function save(...args) {
20287 const imported = await __webpack_require__.e(/*! import() */ "node_modules_lyrasearch_lyra_dist_methods_save_js").then(__webpack_require__.bind(__webpack_require__, /*! ../methods/save.js */ "./node_modules/@lyrasearch/lyra/dist/methods/save.js"));
20288 _esmSave = imported.save;
20290 return _esmSave(...args);
20292 async function load(...args) {
20294 const imported = await __webpack_require__.e(/*! import() */ "node_modules_lyrasearch_lyra_dist_methods_load_js").then(__webpack_require__.bind(__webpack_require__, /*! ../methods/load.js */ "./node_modules/@lyrasearch/lyra/dist/methods/load.js"));
20295 _esmLoad = imported.load;
20297 return _esmLoad(...args);
20299 function requireLyra(callback) {
20300 Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_node_js-node_modules_lyrasearch_lyra_dis-426440"), __webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_radix-tree_radix_js"), __webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_methods_search_js"), __webpack_require__.e("vendors-node_modules_lyrasearch_lyra_dist_index_js")]).then(__webpack_require__.bind(__webpack_require__, /*! ../index.js */ "./node_modules/@lyrasearch/lyra/dist/index.js")).then((loaded)=>setTimeout(()=>callback(undefined, loaded), 1)).catch((error)=>setTimeout(()=>callback(error), 1));
20303 //# sourceMappingURL=index.js.map
20307 /***/ "./node_modules/marked/lib/marked.cjs":
20308 /*!********************************************!*\
20309 !*** ./node_modules/marked/lib/marked.cjs ***!
20310 \********************************************/
20311 /***/ ((__unused_webpack_module, exports) => {
20315 * marked v4.2.12 - a markdown parser
20316 * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
20317 * https://github.com/markedjs/marked
20321 * DO NOT EDIT THIS FILE
20322 * The code in this file is generated from files in ./src/
20327 function _defineProperties(target, props) {
20328 for (var i = 0; i < props.length; i++) {
20329 var descriptor = props[i];
20330 descriptor.enumerable = descriptor.enumerable || false;
20331 descriptor.configurable = true;
20332 if ("value" in descriptor) descriptor.writable = true;
20333 Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
20336 function _createClass(Constructor, protoProps, staticProps) {
20337 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
20338 if (staticProps) _defineProperties(Constructor, staticProps);
20339 Object.defineProperty(Constructor, "prototype", {
20342 return Constructor;
20344 function _unsupportedIterableToArray(o, minLen) {
20346 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
20347 var n = Object.prototype.toString.call(o).slice(8, -1);
20348 if (n === "Object" && o.constructor) n = o.constructor.name;
20349 if (n === "Map" || n === "Set") return Array.from(o);
20350 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
20352 function _arrayLikeToArray(arr, len) {
20353 if (len == null || len > arr.length) len = arr.length;
20354 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
20357 function _createForOfIteratorHelperLoose(o, allowArrayLike) {
20358 var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
20359 if (it) return (it = it.call(o)).next.bind(it);
20360 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
20363 return function () {
20364 if (i >= o.length) return {
20373 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
20375 function _toPrimitive(input, hint) {
20376 if (typeof input !== "object" || input === null) return input;
20377 var prim = input[Symbol.toPrimitive];
20378 if (prim !== undefined) {
20379 var res = prim.call(input, hint || "default");
20380 if (typeof res !== "object") return res;
20381 throw new TypeError("@@toPrimitive must return a primitive value.");
20383 return (hint === "string" ? String : Number)(input);
20385 function _toPropertyKey(arg) {
20386 var key = _toPrimitive(arg, "string");
20387 return typeof key === "symbol" ? key : String(key);
20390 function getDefaults() {
20400 langPrefix: 'language-',
20407 smartypants: false,
20413 exports.defaults = getDefaults();
20414 function changeDefaults(newDefaults) {
20415 exports.defaults = newDefaults;
20421 var escapeTest = /[&<>"']/;
20422 var escapeReplace = new RegExp(escapeTest.source, 'g');
20423 var escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;
20424 var escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, 'g');
20425 var escapeReplacements = {
20432 var getEscapeReplacement = function getEscapeReplacement(ch) {
20433 return escapeReplacements[ch];
20435 function escape(html, encode) {
20437 if (escapeTest.test(html)) {
20438 return html.replace(escapeReplace, getEscapeReplacement);
20441 if (escapeTestNoEncode.test(html)) {
20442 return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
20447 var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
20450 * @param {string} html
20452 function unescape(html) {
20453 // explicitly match decimal, hex, and named HTML entities
20454 return html.replace(unescapeTest, function (_, n) {
20455 n = n.toLowerCase();
20456 if (n === 'colon') return ':';
20457 if (n.charAt(0) === '#') {
20458 return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1));
20463 var caret = /(^|[^\[])\^/g;
20466 * @param {string | RegExp} regex
20467 * @param {string} opt
20469 function edit(regex, opt) {
20470 regex = typeof regex === 'string' ? regex : regex.source;
20473 replace: function replace(name, val) {
20474 val = val.source || val;
20475 val = val.replace(caret, '$1');
20476 regex = regex.replace(name, val);
20479 getRegex: function getRegex() {
20480 return new RegExp(regex, opt);
20485 var nonWordAndColonTest = /[^\w:]/g;
20486 var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
20489 * @param {boolean} sanitize
20490 * @param {string} base
20491 * @param {string} href
20493 function cleanUrl(sanitize, base, href) {
20497 prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase();
20501 if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
20505 if (base && !originIndependentUrl.test(href)) {
20506 href = resolveUrl(base, href);
20509 href = encodeURI(href).replace(/%25/g, '%');
20516 var justDomain = /^[^:]+:\/*[^/]*$/;
20517 var protocol = /^([^:]+:)[\s\S]*$/;
20518 var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
20521 * @param {string} base
20522 * @param {string} href
20524 function resolveUrl(base, href) {
20525 if (!baseUrls[' ' + base]) {
20526 // we can ignore everything in base after the last slash of its path component,
20527 // but we might need to add _that_
20528 // https://tools.ietf.org/html/rfc3986#section-3
20529 if (justDomain.test(base)) {
20530 baseUrls[' ' + base] = base + '/';
20532 baseUrls[' ' + base] = rtrim(base, '/', true);
20535 base = baseUrls[' ' + base];
20536 var relativeBase = base.indexOf(':') === -1;
20537 if (href.substring(0, 2) === '//') {
20538 if (relativeBase) {
20541 return base.replace(protocol, '$1') + href;
20542 } else if (href.charAt(0) === '/') {
20543 if (relativeBase) {
20546 return base.replace(domain, '$1') + href;
20548 return base + href;
20552 exec: function noopTest() {}
20554 function merge(obj) {
20558 for (; i < arguments.length; i++) {
20559 target = arguments[i];
20560 for (key in target) {
20561 if (Object.prototype.hasOwnProperty.call(target, key)) {
20562 obj[key] = target[key];
20568 function splitCells(tableRow, count) {
20569 // ensure that every cell-delimiting pipe has a space
20570 // before it to distinguish it from an escaped pipe
20571 var row = tableRow.replace(/\|/g, function (match, offset, str) {
20572 var escaped = false,
20574 while (--curr >= 0 && str[curr] === '\\') {
20575 escaped = !escaped;
20578 // odd number of slashes means | is escaped
20579 // so we leave it alone
20582 // add space before unescaped |
20586 cells = row.split(/ \|/);
20589 // First/last cell in a row cannot be empty if it has no leading/trailing pipe
20590 if (!cells[0].trim()) {
20593 if (cells.length > 0 && !cells[cells.length - 1].trim()) {
20596 if (cells.length > count) {
20597 cells.splice(count);
20599 while (cells.length < count) {
20603 for (; i < cells.length; i++) {
20604 // leading or trailing whitespace is ignored per the gfm spec
20605 cells[i] = cells[i].trim().replace(/\\\|/g, '|');
20611 * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
20612 * /c*$/ is vulnerable to REDOS.
20614 * @param {string} str
20615 * @param {string} c
20616 * @param {boolean} invert Remove suffix of non-c chars instead. Default falsey.
20618 function rtrim(str, c, invert) {
20619 var l = str.length;
20624 // Length of suffix matching the invert condition.
20627 // Step left until we fail to match the invert condition.
20628 while (suffLen < l) {
20629 var currChar = str.charAt(l - suffLen - 1);
20630 if (currChar === c && !invert) {
20632 } else if (currChar !== c && invert) {
20638 return str.slice(0, l - suffLen);
20640 function findClosingBracket(str, b) {
20641 if (str.indexOf(b[1]) === -1) {
20644 var l = str.length;
20647 for (; i < l; i++) {
20648 if (str[i] === '\\') {
20650 } else if (str[i] === b[0]) {
20652 } else if (str[i] === b[1]) {
20661 function checkSanitizeDeprecation(opt) {
20662 if (opt && opt.sanitize && !opt.silent) {
20663 console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
20667 // copied from https://stackoverflow.com/a/5450113/806777
20669 * @param {string} pattern
20670 * @param {number} count
20672 function repeatString(pattern, count) {
20677 while (count > 1) {
20682 pattern += pattern;
20684 return result + pattern;
20687 function outputLink(cap, link, raw, lexer) {
20688 var href = link.href;
20689 var title = link.title ? escape(link.title) : null;
20690 var text = cap[1].replace(/\\([\[\]])/g, '$1');
20691 if (cap[0].charAt(0) !== '!') {
20692 lexer.state.inLink = true;
20699 tokens: lexer.inlineTokens(text)
20701 lexer.state.inLink = false;
20712 function indentCodeCompensation(raw, text) {
20713 var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
20714 if (matchIndentToCode === null) {
20717 var indentToCode = matchIndentToCode[1];
20718 return text.split('\n').map(function (node) {
20719 var matchIndentInNode = node.match(/^\s+/);
20720 if (matchIndentInNode === null) {
20723 var indentInNode = matchIndentInNode[0];
20724 if (indentInNode.length >= indentToCode.length) {
20725 return node.slice(indentToCode.length);
20734 var Tokenizer = /*#__PURE__*/function () {
20735 function Tokenizer(options) {
20736 this.options = options || exports.defaults;
20738 var _proto = Tokenizer.prototype;
20739 _proto.space = function space(src) {
20740 var cap = this.rules.block.newline.exec(src);
20741 if (cap && cap[0].length > 0) {
20748 _proto.code = function code(src) {
20749 var cap = this.rules.block.code.exec(src);
20751 var text = cap[0].replace(/^ {1,4}/gm, '');
20755 codeBlockStyle: 'indented',
20756 text: !this.options.pedantic ? rtrim(text, '\n') : text
20760 _proto.fences = function fences(src) {
20761 var cap = this.rules.block.fences.exec(src);
20764 var text = indentCodeCompensation(raw, cap[3] || '');
20768 lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, '$1') : cap[2],
20773 _proto.heading = function heading(src) {
20774 var cap = this.rules.block.heading.exec(src);
20776 var text = cap[2].trim();
20778 // remove trailing #s
20779 if (/#$/.test(text)) {
20780 var trimmed = rtrim(text, '#');
20781 if (this.options.pedantic) {
20782 text = trimmed.trim();
20783 } else if (!trimmed || / $/.test(trimmed)) {
20784 // CommonMark requires space before trailing #s
20785 text = trimmed.trim();
20791 depth: cap[1].length,
20793 tokens: this.lexer.inline(text)
20797 _proto.hr = function hr(src) {
20798 var cap = this.rules.block.hr.exec(src);
20806 _proto.blockquote = function blockquote(src) {
20807 var cap = this.rules.block.blockquote.exec(src);
20809 var text = cap[0].replace(/^ *>[ \t]?/gm, '');
20810 var top = this.lexer.state.top;
20811 this.lexer.state.top = true;
20812 var tokens = this.lexer.blockTokens(text);
20813 this.lexer.state.top = top;
20815 type: 'blockquote',
20822 _proto.list = function list(src) {
20823 var cap = this.rules.block.list.exec(src);
20825 var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly;
20826 var bull = cap[1].trim();
20827 var isordered = bull.length > 1;
20831 ordered: isordered,
20832 start: isordered ? +bull.slice(0, -1) : '',
20836 bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull;
20837 if (this.options.pedantic) {
20838 bull = isordered ? bull : '[*+-]';
20841 // Get next list item
20842 var itemRegex = new RegExp("^( {0,3}" + bull + ")((?:[\t ][^\\n]*)?(?:\\n|$))");
20844 // Check if current bullet point can start a new List Item
20847 if (!(cap = itemRegex.exec(src))) {
20850 if (this.rules.block.hr.test(src)) {
20851 // End list if bullet was actually HR (possibly move into itemRegex?)
20855 src = src.substring(raw.length);
20856 line = cap[2].split('\n', 1)[0].replace(/^\t+/, function (t) {
20857 return ' '.repeat(3 * t.length);
20859 nextLine = src.split('\n', 1)[0];
20860 if (this.options.pedantic) {
20862 itemContents = line.trimLeft();
20864 indent = cap[2].search(/[^ ]/); // Find first non-space char
20865 indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent
20866 itemContents = line.slice(indent);
20867 indent += cap[1].length;
20870 if (!line && /^ *$/.test(nextLine)) {
20871 // Items begin with at most one blank line
20872 raw += nextLine + '\n';
20873 src = src.substring(nextLine.length + 1);
20877 var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))");
20878 var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)");
20879 var fencesBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:```|~~~)");
20880 var headingBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}#");
20882 // Check if following lines should be included in List Item
20884 rawLine = src.split('\n', 1)[0];
20885 nextLine = rawLine;
20887 // Re-align to follow commonmark nesting rules
20888 if (this.options.pedantic) {
20889 nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' ');
20892 // End list item if found code fences
20893 if (fencesBeginRegex.test(nextLine)) {
20897 // End list item if found start of new heading
20898 if (headingBeginRegex.test(nextLine)) {
20902 // End list item if found start of new bullet
20903 if (nextBulletRegex.test(nextLine)) {
20907 // Horizontal rule found
20908 if (hrRegex.test(src)) {
20911 if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) {
20912 // Dedent if possible
20913 itemContents += '\n' + nextLine.slice(indent);
20915 // not enough indentation
20920 // paragraph continuation unless last line was a different block level element
20921 if (line.search(/[^ ]/) >= 4) {
20922 // indented code block
20925 if (fencesBeginRegex.test(line)) {
20928 if (headingBeginRegex.test(line)) {
20931 if (hrRegex.test(line)) {
20934 itemContents += '\n' + nextLine;
20936 if (!blankLine && !nextLine.trim()) {
20937 // Check if current line is blank
20940 raw += rawLine + '\n';
20941 src = src.substring(rawLine.length + 1);
20942 line = nextLine.slice(indent);
20946 // If the previous item ended with a blank line, the list is loose
20947 if (endsWithBlankLine) {
20949 } else if (/\n *\n *$/.test(raw)) {
20950 endsWithBlankLine = true;
20954 // Check for task list items
20955 if (this.options.gfm) {
20956 istask = /^\[[ xX]\] /.exec(itemContents);
20958 ischecked = istask[0] !== '[ ] ';
20959 itemContents = itemContents.replace(/^\[[ xX]\] +/, '');
20966 checked: ischecked,
20973 // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
20974 list.items[list.items.length - 1].raw = raw.trimRight();
20975 list.items[list.items.length - 1].text = itemContents.trimRight();
20976 list.raw = list.raw.trimRight();
20977 var l = list.items.length;
20979 // Item child tokens handled here at end because we needed to have the final item to trim it first
20980 for (i = 0; i < l; i++) {
20981 this.lexer.state.top = false;
20982 list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);
20984 // Check if list should be loose
20985 var spacers = list.items[i].tokens.filter(function (t) {
20986 return t.type === 'space';
20988 var hasMultipleLineBreaks = spacers.length > 0 && spacers.some(function (t) {
20989 return /\n.*\n/.test(t.raw);
20991 list.loose = hasMultipleLineBreaks;
20995 // Set all items to loose if list is loose
20997 for (i = 0; i < l; i++) {
20998 list.items[i].loose = true;
21004 _proto.html = function html(src) {
21005 var cap = this.rules.block.html.exec(src);
21010 pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
21013 if (this.options.sanitize) {
21014 var text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);
21015 token.type = 'paragraph';
21017 token.tokens = this.lexer.inline(text);
21022 _proto.def = function def(src) {
21023 var cap = this.rules.block.def.exec(src);
21025 var tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
21026 var href = cap[2] ? cap[2].replace(/^<(.*)>$/, '$1').replace(this.rules.inline._escapes, '$1') : '';
21027 var title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, '$1') : cap[3];
21037 _proto.table = function table(src) {
21038 var cap = this.rules.block.table.exec(src);
21042 header: splitCells(cap[1]).map(function (c) {
21047 align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
21048 rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
21050 if (item.header.length === item.align.length) {
21052 var l = item.align.length;
21054 for (i = 0; i < l; i++) {
21055 if (/^ *-+: *$/.test(item.align[i])) {
21056 item.align[i] = 'right';
21057 } else if (/^ *:-+: *$/.test(item.align[i])) {
21058 item.align[i] = 'center';
21059 } else if (/^ *:-+ *$/.test(item.align[i])) {
21060 item.align[i] = 'left';
21062 item.align[i] = null;
21065 l = item.rows.length;
21066 for (i = 0; i < l; i++) {
21067 item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) {
21074 // parse child tokens inside headers and cells
21076 // header child tokens
21077 l = item.header.length;
21078 for (j = 0; j < l; j++) {
21079 item.header[j].tokens = this.lexer.inline(item.header[j].text);
21082 // cell child tokens
21083 l = item.rows.length;
21084 for (j = 0; j < l; j++) {
21085 row = item.rows[j];
21086 for (k = 0; k < row.length; k++) {
21087 row[k].tokens = this.lexer.inline(row[k].text);
21094 _proto.lheading = function lheading(src) {
21095 var cap = this.rules.block.lheading.exec(src);
21100 depth: cap[2].charAt(0) === '=' ? 1 : 2,
21102 tokens: this.lexer.inline(cap[1])
21106 _proto.paragraph = function paragraph(src) {
21107 var cap = this.rules.block.paragraph.exec(src);
21109 var text = cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1];
21114 tokens: this.lexer.inline(text)
21118 _proto.text = function text(src) {
21119 var cap = this.rules.block.text.exec(src);
21125 tokens: this.lexer.inline(cap[0])
21129 _proto.escape = function escape$1(src) {
21130 var cap = this.rules.inline.escape.exec(src);
21135 text: escape(cap[1])
21139 _proto.tag = function tag(src) {
21140 var cap = this.rules.inline.tag.exec(src);
21142 if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
21143 this.lexer.state.inLink = true;
21144 } else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
21145 this.lexer.state.inLink = false;
21147 if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
21148 this.lexer.state.inRawBlock = true;
21149 } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
21150 this.lexer.state.inRawBlock = false;
21153 type: this.options.sanitize ? 'text' : 'html',
21155 inLink: this.lexer.state.inLink,
21156 inRawBlock: this.lexer.state.inRawBlock,
21157 text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]
21161 _proto.link = function link(src) {
21162 var cap = this.rules.inline.link.exec(src);
21164 var trimmedUrl = cap[2].trim();
21165 if (!this.options.pedantic && /^</.test(trimmedUrl)) {
21166 // commonmark requires matching angle brackets
21167 if (!/>$/.test(trimmedUrl)) {
21171 // ending angle bracket cannot be escaped
21172 var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\');
21173 if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
21177 // find closing parenthesis
21178 var lastParenIndex = findClosingBracket(cap[2], '()');
21179 if (lastParenIndex > -1) {
21180 var start = cap[0].indexOf('!') === 0 ? 5 : 4;
21181 var linkLen = start + cap[1].length + lastParenIndex;
21182 cap[2] = cap[2].substring(0, lastParenIndex);
21183 cap[0] = cap[0].substring(0, linkLen).trim();
21189 if (this.options.pedantic) {
21190 // split pedantic href and title
21191 var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
21197 title = cap[3] ? cap[3].slice(1, -1) : '';
21199 href = href.trim();
21200 if (/^</.test(href)) {
21201 if (this.options.pedantic && !/>$/.test(trimmedUrl)) {
21202 // pedantic allows starting angle bracket without ending angle bracket
21203 href = href.slice(1);
21205 href = href.slice(1, -1);
21208 return outputLink(cap, {
21209 href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
21210 title: title ? title.replace(this.rules.inline._escapes, '$1') : title
21211 }, cap[0], this.lexer);
21214 _proto.reflink = function reflink(src, links) {
21216 if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
21217 var link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
21218 link = links[link.toLowerCase()];
21220 var text = cap[0].charAt(0);
21227 return outputLink(cap, link, cap[0], this.lexer);
21230 _proto.emStrong = function emStrong(src, maskedSrc, prevChar) {
21231 if (prevChar === void 0) {
21234 var match = this.rules.inline.emStrong.lDelim.exec(src);
21235 if (!match) return;
21237 // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
21238 if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4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ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\u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EC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\u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\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return;
21239 var nextChar = match[1] || match[2] || '';
21240 if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) {
21241 var lLength = match[0].length - 1;
21244 delimTotal = lLength,
21246 var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
21247 endReg.lastIndex = 0;
21249 // Clip maskedSrc to same section of string as src (move to lexer?)
21250 maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
21251 while ((match = endReg.exec(maskedSrc)) != null) {
21252 rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
21253 if (!rDelim) continue; // skip single * in __abc*abc__
21255 rLength = rDelim.length;
21256 if (match[3] || match[4]) {
21257 // found another Left Delim
21258 delimTotal += rLength;
21260 } else if (match[5] || match[6]) {
21261 // either Left or Right Delim
21262 if (lLength % 3 && !((lLength + rLength) % 3)) {
21263 midDelimTotal += rLength;
21264 continue; // CommonMark Emphasis Rules 9-10
21268 delimTotal -= rLength;
21269 if (delimTotal > 0) continue; // Haven't found enough closing delimiters
21271 // Remove extra characters. *a*** -> *a*
21272 rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
21273 var raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);
21275 // Create `em` if smallest delimiter has odd char count. *a***
21276 if (Math.min(lLength, rLength) % 2) {
21277 var _text = raw.slice(1, -1);
21282 tokens: this.lexer.inlineTokens(_text)
21286 // Create 'strong' if smallest delimiter has even char count. **a***
21287 var text = raw.slice(2, -2);
21292 tokens: this.lexer.inlineTokens(text)
21297 _proto.codespan = function codespan(src) {
21298 var cap = this.rules.inline.code.exec(src);
21300 var text = cap[2].replace(/\n/g, ' ');
21301 var hasNonSpaceChars = /[^ ]/.test(text);
21302 var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);
21303 if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
21304 text = text.substring(1, text.length - 1);
21306 text = escape(text, true);
21314 _proto.br = function br(src) {
21315 var cap = this.rules.inline.br.exec(src);
21323 _proto.del = function del(src) {
21324 var cap = this.rules.inline.del.exec(src);
21330 tokens: this.lexer.inlineTokens(cap[2])
21334 _proto.autolink = function autolink(src, mangle) {
21335 var cap = this.rules.inline.autolink.exec(src);
21338 if (cap[2] === '@') {
21339 text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);
21340 href = 'mailto:' + text;
21342 text = escape(cap[1]);
21358 _proto.url = function url(src, mangle) {
21360 if (cap = this.rules.inline.url.exec(src)) {
21362 if (cap[2] === '@') {
21363 text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);
21364 href = 'mailto:' + text;
21366 // do extended autolink path validation
21369 prevCapZero = cap[0];
21370 cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
21371 } while (prevCapZero !== cap[0]);
21372 text = escape(cap[0]);
21373 if (cap[1] === 'www.') {
21374 href = 'http://' + cap[0];
21392 _proto.inlineText = function inlineText(src, smartypants) {
21393 var cap = this.rules.inline.text.exec(src);
21396 if (this.lexer.state.inRawBlock) {
21397 text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0];
21399 text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
21412 * Block-Level Grammar
21415 newline: /^(?: *(?:\n|$))+/,
21416 code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
21417 fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
21418 hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
21419 heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
21420 blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
21421 list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
21422 html: '^ {0,3}(?:' // optional indentation
21423 + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
21424 + '|comment[^\\n]*(\\n+|$)' // (2)
21425 + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
21426 + '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
21427 + '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
21428 + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6)
21429 + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag
21430 + '|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag
21432 def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
21434 lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
21435 // regex template, placeholders will be replaced according to different paragraph
21436 // interruption rules of commonmark and the original markdown spec:
21437 _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
21440 block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
21441 block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
21442 block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex();
21443 block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
21444 block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex();
21445 block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex();
21446 block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';
21447 block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
21448 block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
21449 block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
21450 .replace('|table', '').replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
21451 .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
21453 block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex();
21456 * Normal Block Grammar
21459 block.normal = merge({}, block);
21462 * GFM Block Grammar
21465 block.gfm = merge({}, block.normal, {
21466 table: '^ *([^\\n ].*\\|.*)\\n' // Header
21467 + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
21468 + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
21471 block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
21472 .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
21474 block.gfm.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
21475 .replace('table', block.gfm.table) // interrupt paragraphs with table
21476 .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
21477 .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
21480 * Pedantic grammar (original John Gruber's loose markdown specification)
21483 block.pedantic = merge({}, block.normal, {
21484 html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
21485 + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block._comment).replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b').getRegex(),
21486 def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
21487 heading: /^(#{1,6})(.*)(?:\n+|$)/,
21489 // fences not supported
21490 lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
21491 paragraph: edit(block.normal._paragraph).replace('hr', block.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex()
21495 * Inline-Level Grammar
21498 escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
21499 autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
21501 tag: '^comment' + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
21502 + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
21503 + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
21504 + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
21505 + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>',
21507 link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
21508 reflink: /^!?\[(label)\]\[(ref)\]/,
21509 nolink: /^!?\[(ref)\](?:\[\])?/,
21510 reflinkSearch: 'reflink|nolink(?!\\()',
21512 lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
21513 // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
21514 // () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
21515 rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,
21516 rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ // ^- Not allowed for _
21519 code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
21520 br: /^( {2,}|\\)\n(?!\s*$)/,
21522 text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
21523 punctuation: /^([\spunctuation])/
21526 // list of punctuation marks from CommonMark spec
21527 // without * and _ to handle the different emphasis markers * and _
21528 inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
21529 inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();
21531 // sequences em should skip over [title](link), `code`, <html>
21532 inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
21533 // lookbehind is not available on Safari as of version 16
21534 // inline.escapedEmSt = /(?<=(?:^|[^\\)(?:\\[^])*)\\[*_]/g;
21535 inline.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
21536 inline._comment = edit(block._comment).replace('(?:-->|$)', '-->').getRegex();
21537 inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex();
21538 inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, 'g').replace(/punct/g, inline._punctuation).getRegex();
21539 inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, 'g').replace(/punct/g, inline._punctuation).getRegex();
21540 inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
21541 inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
21542 inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
21543 inline.autolink = edit(inline.autolink).replace('scheme', inline._scheme).replace('email', inline._email).getRegex();
21544 inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
21545 inline.tag = edit(inline.tag).replace('comment', inline._comment).replace('attribute', inline._attribute).getRegex();
21546 inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
21547 inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
21548 inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
21549 inline.link = edit(inline.link).replace('label', inline._label).replace('href', inline._href).replace('title', inline._title).getRegex();
21550 inline.reflink = edit(inline.reflink).replace('label', inline._label).replace('ref', block._label).getRegex();
21551 inline.nolink = edit(inline.nolink).replace('ref', block._label).getRegex();
21552 inline.reflinkSearch = edit(inline.reflinkSearch, 'g').replace('reflink', inline.reflink).replace('nolink', inline.nolink).getRegex();
21555 * Normal Inline Grammar
21558 inline.normal = merge({}, inline);
21561 * Pedantic Inline Grammar
21564 inline.pedantic = merge({}, inline.normal, {
21567 middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
21568 endAst: /\*\*(?!\*)/g,
21573 middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
21574 endAst: /\*(?!\*)/g,
21577 link: edit(/^!?\[(label)\]\((.*?)\)/).replace('label', inline._label).getRegex(),
21578 reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace('label', inline._label).getRegex()
21582 * GFM Inline Grammar
21585 inline.gfm = merge({}, inline.normal, {
21586 escape: edit(inline.escape).replace('])', '~|])').getRegex(),
21587 _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
21588 url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
21589 _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
21590 del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
21591 text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
21593 inline.gfm.url = edit(inline.gfm.url, 'i').replace('email', inline.gfm._extended_email).getRegex();
21595 * GFM + Line Breaks Inline Grammar
21598 inline.breaks = merge({}, inline.gfm, {
21599 br: edit(inline.br).replace('{2,}', '*').getRegex(),
21600 text: edit(inline.gfm.text).replace('\\b_', '\\b_| {2,}\\n').replace(/\{2,\}/g, '*').getRegex()
21604 * smartypants text replacement
21605 * @param {string} text
21607 function smartypants(text) {
21610 .replace(/---/g, "\u2014")
21612 .replace(/--/g, "\u2013")
21614 .replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018")
21615 // closing singles & apostrophes
21616 .replace(/'/g, "\u2019")
21618 .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201C")
21620 .replace(/"/g, "\u201D")
21622 .replace(/\.{3}/g, "\u2026");
21626 * mangle email addresses
21627 * @param {string} text
21629 function mangle(text) {
21633 var l = text.length;
21634 for (i = 0; i < l; i++) {
21635 ch = text.charCodeAt(i);
21636 if (Math.random() > 0.5) {
21637 ch = 'x' + ch.toString(16);
21639 out += '&#' + ch + ';';
21647 var Lexer = /*#__PURE__*/function () {
21648 function Lexer(options) {
21650 this.tokens.links = Object.create(null);
21651 this.options = options || exports.defaults;
21652 this.options.tokenizer = this.options.tokenizer || new Tokenizer();
21653 this.tokenizer = this.options.tokenizer;
21654 this.tokenizer.options = this.options;
21655 this.tokenizer.lexer = this;
21656 this.inlineQueue = [];
21663 block: block.normal,
21664 inline: inline.normal
21666 if (this.options.pedantic) {
21667 rules.block = block.pedantic;
21668 rules.inline = inline.pedantic;
21669 } else if (this.options.gfm) {
21670 rules.block = block.gfm;
21671 if (this.options.breaks) {
21672 rules.inline = inline.breaks;
21674 rules.inline = inline.gfm;
21677 this.tokenizer.rules = rules;
21684 * Static Lex Method
21686 Lexer.lex = function lex(src, options) {
21687 var lexer = new Lexer(options);
21688 return lexer.lex(src);
21692 * Static Lex Inline Method
21694 Lexer.lexInline = function lexInline(src, options) {
21695 var lexer = new Lexer(options);
21696 return lexer.inlineTokens(src);
21702 var _proto = Lexer.prototype;
21703 _proto.lex = function lex(src) {
21704 src = src.replace(/\r\n|\r/g, '\n');
21705 this.blockTokens(src, this.tokens);
21707 while (next = this.inlineQueue.shift()) {
21708 this.inlineTokens(next.src, next.tokens);
21710 return this.tokens;
21716 _proto.blockTokens = function blockTokens(src, tokens) {
21718 if (tokens === void 0) {
21721 if (this.options.pedantic) {
21722 src = src.replace(/\t/g, ' ').replace(/^ +$/gm, '');
21724 src = src.replace(/^( *)(\t+)/gm, function (_, leading, tabs) {
21725 return leading + ' '.repeat(tabs.length);
21728 var token, lastToken, cutSrc, lastParagraphClipped;
21730 if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some(function (extTokenizer) {
21731 if (token = extTokenizer.call({
21734 src = src.substring(token.raw.length);
21735 tokens.push(token);
21744 if (token = this.tokenizer.space(src)) {
21745 src = src.substring(token.raw.length);
21746 if (token.raw.length === 1 && tokens.length > 0) {
21747 // if there's a single \n as a spacer, it's terminating the last line,
21748 // so move it there so that we don't get unecessary paragraph tags
21749 tokens[tokens.length - 1].raw += '\n';
21751 tokens.push(token);
21757 if (token = this.tokenizer.code(src)) {
21758 src = src.substring(token.raw.length);
21759 lastToken = tokens[tokens.length - 1];
21760 // An indented code block cannot interrupt a paragraph.
21761 if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
21762 lastToken.raw += '\n' + token.raw;
21763 lastToken.text += '\n' + token.text;
21764 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
21766 tokens.push(token);
21772 if (token = this.tokenizer.fences(src)) {
21773 src = src.substring(token.raw.length);
21774 tokens.push(token);
21779 if (token = this.tokenizer.heading(src)) {
21780 src = src.substring(token.raw.length);
21781 tokens.push(token);
21786 if (token = this.tokenizer.hr(src)) {
21787 src = src.substring(token.raw.length);
21788 tokens.push(token);
21793 if (token = this.tokenizer.blockquote(src)) {
21794 src = src.substring(token.raw.length);
21795 tokens.push(token);
21800 if (token = this.tokenizer.list(src)) {
21801 src = src.substring(token.raw.length);
21802 tokens.push(token);
21807 if (token = this.tokenizer.html(src)) {
21808 src = src.substring(token.raw.length);
21809 tokens.push(token);
21814 if (token = this.tokenizer.def(src)) {
21815 src = src.substring(token.raw.length);
21816 lastToken = tokens[tokens.length - 1];
21817 if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) {
21818 lastToken.raw += '\n' + token.raw;
21819 lastToken.text += '\n' + token.raw;
21820 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
21821 } else if (!this.tokens.links[token.tag]) {
21822 this.tokens.links[token.tag] = {
21831 if (token = this.tokenizer.table(src)) {
21832 src = src.substring(token.raw.length);
21833 tokens.push(token);
21838 if (token = this.tokenizer.lheading(src)) {
21839 src = src.substring(token.raw.length);
21840 tokens.push(token);
21844 // top-level paragraph
21845 // prevent paragraph consuming extensions by clipping 'src' to extension start
21847 if (this.options.extensions && this.options.extensions.startBlock) {
21849 var startIndex = Infinity;
21850 var tempSrc = src.slice(1);
21851 var tempStart = void 0;
21852 _this.options.extensions.startBlock.forEach(function (getStartIndex) {
21853 tempStart = getStartIndex.call({
21856 if (typeof tempStart === 'number' && tempStart >= 0) {
21857 startIndex = Math.min(startIndex, tempStart);
21860 if (startIndex < Infinity && startIndex >= 0) {
21861 cutSrc = src.substring(0, startIndex + 1);
21865 if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
21866 lastToken = tokens[tokens.length - 1];
21867 if (lastParagraphClipped && lastToken.type === 'paragraph') {
21868 lastToken.raw += '\n' + token.raw;
21869 lastToken.text += '\n' + token.text;
21870 this.inlineQueue.pop();
21871 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
21873 tokens.push(token);
21875 lastParagraphClipped = cutSrc.length !== src.length;
21876 src = src.substring(token.raw.length);
21881 if (token = this.tokenizer.text(src)) {
21882 src = src.substring(token.raw.length);
21883 lastToken = tokens[tokens.length - 1];
21884 if (lastToken && lastToken.type === 'text') {
21885 lastToken.raw += '\n' + token.raw;
21886 lastToken.text += '\n' + token.text;
21887 this.inlineQueue.pop();
21888 this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
21890 tokens.push(token);
21895 var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
21896 if (this.options.silent) {
21897 console.error(errMsg);
21900 throw new Error(errMsg);
21904 this.state.top = true;
21907 _proto.inline = function inline(src, tokens) {
21908 if (tokens === void 0) {
21911 this.inlineQueue.push({
21921 _proto.inlineTokens = function inlineTokens(src, tokens) {
21923 if (tokens === void 0) {
21926 var token, lastToken, cutSrc;
21928 // String with links masked to avoid interference with em and strong
21929 var maskedSrc = src;
21931 var keepPrevChar, prevChar;
21933 // Mask out reflinks
21934 if (this.tokens.links) {
21935 var links = Object.keys(this.tokens.links);
21936 if (links.length > 0) {
21937 while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
21938 if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
21939 maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
21944 // Mask out other blocks
21945 while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
21946 maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
21949 // Mask out escaped em & strong delimiters
21950 while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {
21951 maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);
21952 this.tokenizer.rules.inline.escapedEmSt.lastIndex--;
21955 if (!keepPrevChar) {
21958 keepPrevChar = false;
21961 if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some(function (extTokenizer) {
21962 if (token = extTokenizer.call({
21965 src = src.substring(token.raw.length);
21966 tokens.push(token);
21975 if (token = this.tokenizer.escape(src)) {
21976 src = src.substring(token.raw.length);
21977 tokens.push(token);
21982 if (token = this.tokenizer.tag(src)) {
21983 src = src.substring(token.raw.length);
21984 lastToken = tokens[tokens.length - 1];
21985 if (lastToken && token.type === 'text' && lastToken.type === 'text') {
21986 lastToken.raw += token.raw;
21987 lastToken.text += token.text;
21989 tokens.push(token);
21995 if (token = this.tokenizer.link(src)) {
21996 src = src.substring(token.raw.length);
21997 tokens.push(token);
22002 if (token = this.tokenizer.reflink(src, this.tokens.links)) {
22003 src = src.substring(token.raw.length);
22004 lastToken = tokens[tokens.length - 1];
22005 if (lastToken && token.type === 'text' && lastToken.type === 'text') {
22006 lastToken.raw += token.raw;
22007 lastToken.text += token.text;
22009 tokens.push(token);
22015 if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
22016 src = src.substring(token.raw.length);
22017 tokens.push(token);
22022 if (token = this.tokenizer.codespan(src)) {
22023 src = src.substring(token.raw.length);
22024 tokens.push(token);
22029 if (token = this.tokenizer.br(src)) {
22030 src = src.substring(token.raw.length);
22031 tokens.push(token);
22036 if (token = this.tokenizer.del(src)) {
22037 src = src.substring(token.raw.length);
22038 tokens.push(token);
22043 if (token = this.tokenizer.autolink(src, mangle)) {
22044 src = src.substring(token.raw.length);
22045 tokens.push(token);
22050 if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
22051 src = src.substring(token.raw.length);
22052 tokens.push(token);
22057 // prevent inlineText consuming extensions by clipping 'src' to extension start
22059 if (this.options.extensions && this.options.extensions.startInline) {
22061 var startIndex = Infinity;
22062 var tempSrc = src.slice(1);
22063 var tempStart = void 0;
22064 _this2.options.extensions.startInline.forEach(function (getStartIndex) {
22065 tempStart = getStartIndex.call({
22068 if (typeof tempStart === 'number' && tempStart >= 0) {
22069 startIndex = Math.min(startIndex, tempStart);
22072 if (startIndex < Infinity && startIndex >= 0) {
22073 cutSrc = src.substring(0, startIndex + 1);
22077 if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
22078 src = src.substring(token.raw.length);
22079 if (token.raw.slice(-1) !== '_') {
22080 // Track prevChar before string of ____ started
22081 prevChar = token.raw.slice(-1);
22083 keepPrevChar = true;
22084 lastToken = tokens[tokens.length - 1];
22085 if (lastToken && lastToken.type === 'text') {
22086 lastToken.raw += token.raw;
22087 lastToken.text += token.text;
22089 tokens.push(token);
22094 var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
22095 if (this.options.silent) {
22096 console.error(errMsg);
22099 throw new Error(errMsg);
22105 _createClass(Lexer, null, [{
22107 get: function get() {
22120 var Renderer = /*#__PURE__*/function () {
22121 function Renderer(options) {
22122 this.options = options || exports.defaults;
22124 var _proto = Renderer.prototype;
22125 _proto.code = function code(_code, infostring, escaped) {
22126 var lang = (infostring || '').match(/\S*/)[0];
22127 if (this.options.highlight) {
22128 var out = this.options.highlight(_code, lang);
22129 if (out != null && out !== _code) {
22134 _code = _code.replace(/\n$/, '') + '\n';
22136 return '<pre><code>' + (escaped ? _code : escape(_code, true)) + '</code></pre>\n';
22138 return '<pre><code class="' + this.options.langPrefix + escape(lang) + '">' + (escaped ? _code : escape(_code, true)) + '</code></pre>\n';
22142 * @param {string} quote
22144 _proto.blockquote = function blockquote(quote) {
22145 return "<blockquote>\n" + quote + "</blockquote>\n";
22147 _proto.html = function html(_html) {
22152 * @param {string} text
22153 * @param {string} level
22154 * @param {string} raw
22155 * @param {any} slugger
22157 _proto.heading = function heading(text, level, raw, slugger) {
22158 if (this.options.headerIds) {
22159 var id = this.options.headerPrefix + slugger.slug(raw);
22160 return "<h" + level + " id=\"" + id + "\">" + text + "</h" + level + ">\n";
22164 return "<h" + level + ">" + text + "</h" + level + ">\n";
22166 _proto.hr = function hr() {
22167 return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
22169 _proto.list = function list(body, ordered, start) {
22170 var type = ordered ? 'ol' : 'ul',
22171 startatt = ordered && start !== 1 ? ' start="' + start + '"' : '';
22172 return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
22176 * @param {string} text
22178 _proto.listitem = function listitem(text) {
22179 return "<li>" + text + "</li>\n";
22181 _proto.checkbox = function checkbox(checked) {
22182 return '<input ' + (checked ? 'checked="" ' : '') + 'disabled="" type="checkbox"' + (this.options.xhtml ? ' /' : '') + '> ';
22186 * @param {string} text
22188 _proto.paragraph = function paragraph(text) {
22189 return "<p>" + text + "</p>\n";
22193 * @param {string} header
22194 * @param {string} body
22196 _proto.table = function table(header, body) {
22197 if (body) body = "<tbody>" + body + "</tbody>";
22198 return '<table>\n' + '<thead>\n' + header + '</thead>\n' + body + '</table>\n';
22202 * @param {string} content
22204 _proto.tablerow = function tablerow(content) {
22205 return "<tr>\n" + content + "</tr>\n";
22207 _proto.tablecell = function tablecell(content, flags) {
22208 var type = flags.header ? 'th' : 'td';
22209 var tag = flags.align ? "<" + type + " align=\"" + flags.align + "\">" : "<" + type + ">";
22210 return tag + content + ("</" + type + ">\n");
22214 * span level renderer
22215 * @param {string} text
22217 _proto.strong = function strong(text) {
22218 return "<strong>" + text + "</strong>";
22222 * @param {string} text
22224 _proto.em = function em(text) {
22225 return "<em>" + text + "</em>";
22229 * @param {string} text
22231 _proto.codespan = function codespan(text) {
22232 return "<code>" + text + "</code>";
22234 _proto.br = function br() {
22235 return this.options.xhtml ? '<br/>' : '<br>';
22239 * @param {string} text
22241 _proto.del = function del(text) {
22242 return "<del>" + text + "</del>";
22246 * @param {string} href
22247 * @param {string} title
22248 * @param {string} text
22250 _proto.link = function link(href, title, text) {
22251 href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
22252 if (href === null) {
22255 var out = '<a href="' + href + '"';
22257 out += ' title="' + title + '"';
22259 out += '>' + text + '</a>';
22264 * @param {string} href
22265 * @param {string} title
22266 * @param {string} text
22268 _proto.image = function image(href, title, text) {
22269 href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
22270 if (href === null) {
22273 var out = "<img src=\"" + href + "\" alt=\"" + text + "\"";
22275 out += " title=\"" + title + "\"";
22277 out += this.options.xhtml ? '/>' : '>';
22280 _proto.text = function text(_text) {
22288 * returns only the textual part of the token
22290 var TextRenderer = /*#__PURE__*/function () {
22291 function TextRenderer() {}
22292 var _proto = TextRenderer.prototype;
22293 // no need for block level renderers
22294 _proto.strong = function strong(text) {
22297 _proto.em = function em(text) {
22300 _proto.codespan = function codespan(text) {
22303 _proto.del = function del(text) {
22306 _proto.html = function html(text) {
22309 _proto.text = function text(_text) {
22312 _proto.link = function link(href, title, text) {
22315 _proto.image = function image(href, title, text) {
22318 _proto.br = function br() {
22321 return TextRenderer;
22325 * Slugger generates header id
22327 var Slugger = /*#__PURE__*/function () {
22328 function Slugger() {
22333 * @param {string} value
22335 var _proto = Slugger.prototype;
22336 _proto.serialize = function serialize(value) {
22337 return value.toLowerCase().trim()
22338 // remove html tags
22339 .replace(/<[!\/a-z].*?>/ig, '')
22340 // remove unwanted chars
22341 .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-');
22345 * Finds the next safe (unique) slug to use
22346 * @param {string} originalSlug
22347 * @param {boolean} isDryRun
22349 _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) {
22350 var slug = originalSlug;
22351 var occurenceAccumulator = 0;
22352 if (this.seen.hasOwnProperty(slug)) {
22353 occurenceAccumulator = this.seen[originalSlug];
22355 occurenceAccumulator++;
22356 slug = originalSlug + '-' + occurenceAccumulator;
22357 } while (this.seen.hasOwnProperty(slug));
22360 this.seen[originalSlug] = occurenceAccumulator;
22361 this.seen[slug] = 0;
22367 * Convert string to unique id
22368 * @param {object} [options]
22369 * @param {boolean} [options.dryrun] Generates the next unique slug without
22370 * updating the internal accumulator.
22372 _proto.slug = function slug(value, options) {
22373 if (options === void 0) {
22376 var slug = this.serialize(value);
22377 return this.getNextSafeSlug(slug, options.dryrun);
22383 * Parsing & Compiling
22385 var Parser = /*#__PURE__*/function () {
22386 function Parser(options) {
22387 this.options = options || exports.defaults;
22388 this.options.renderer = this.options.renderer || new Renderer();
22389 this.renderer = this.options.renderer;
22390 this.renderer.options = this.options;
22391 this.textRenderer = new TextRenderer();
22392 this.slugger = new Slugger();
22396 * Static Parse Method
22398 Parser.parse = function parse(tokens, options) {
22399 var parser = new Parser(options);
22400 return parser.parse(tokens);
22404 * Static Parse Inline Method
22406 Parser.parseInline = function parseInline(tokens, options) {
22407 var parser = new Parser(options);
22408 return parser.parseInline(tokens);
22414 var _proto = Parser.prototype;
22415 _proto.parse = function parse(tokens, top) {
22416 if (top === void 0) {
22439 var l = tokens.length;
22440 for (i = 0; i < l; i++) {
22443 // Run any renderer extensions
22444 if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
22445 ret = this.options.extensions.renderers[token.type].call({
22448 if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) {
22453 switch (token.type) {
22460 out += this.renderer.hr();
22465 out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape(this.parseInline(token.tokens, this.textRenderer)), this.slugger);
22470 out += this.renderer.code(token.text, token.lang, token.escaped);
22479 l2 = token.header.length;
22480 for (j = 0; j < l2; j++) {
22481 cell += this.renderer.tablecell(this.parseInline(token.header[j].tokens), {
22483 align: token.align[j]
22486 header += this.renderer.tablerow(cell);
22488 l2 = token.rows.length;
22489 for (j = 0; j < l2; j++) {
22490 row = token.rows[j];
22493 for (k = 0; k < l3; k++) {
22494 cell += this.renderer.tablecell(this.parseInline(row[k].tokens), {
22496 align: token.align[k]
22499 body += this.renderer.tablerow(cell);
22501 out += this.renderer.table(header, body);
22506 body = this.parse(token.tokens);
22507 out += this.renderer.blockquote(body);
22512 ordered = token.ordered;
22513 start = token.start;
22514 loose = token.loose;
22515 l2 = token.items.length;
22517 for (j = 0; j < l2; j++) {
22518 item = token.items[j];
22519 checked = item.checked;
22523 checkbox = this.renderer.checkbox(checked);
22525 if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
22526 item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
22527 if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
22528 item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
22531 item.tokens.unshift({
22537 itemBody += checkbox;
22540 itemBody += this.parse(item.tokens, loose);
22541 body += this.renderer.listitem(itemBody, task, checked);
22543 out += this.renderer.list(body, ordered, start);
22548 // TODO parse inline content if parameter markdown=1
22549 out += this.renderer.html(token.text);
22554 out += this.renderer.paragraph(this.parseInline(token.tokens));
22559 body = token.tokens ? this.parseInline(token.tokens) : token.text;
22560 while (i + 1 < l && tokens[i + 1].type === 'text') {
22561 token = tokens[++i];
22562 body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);
22564 out += top ? this.renderer.paragraph(body) : body;
22569 var errMsg = 'Token with "' + token.type + '" type was not found.';
22570 if (this.options.silent) {
22571 console.error(errMsg);
22574 throw new Error(errMsg);
22583 * Parse Inline Tokens
22585 _proto.parseInline = function parseInline(tokens, renderer) {
22586 renderer = renderer || this.renderer;
22591 var l = tokens.length;
22592 for (i = 0; i < l; i++) {
22595 // Run any renderer extensions
22596 if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
22597 ret = this.options.extensions.renderers[token.type].call({
22600 if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {
22605 switch (token.type) {
22608 out += renderer.text(token.text);
22613 out += renderer.html(token.text);
22618 out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
22623 out += renderer.image(token.href, token.title, token.text);
22628 out += renderer.strong(this.parseInline(token.tokens, renderer));
22633 out += renderer.em(this.parseInline(token.tokens, renderer));
22638 out += renderer.codespan(token.text);
22643 out += renderer.br();
22648 out += renderer.del(this.parseInline(token.tokens, renderer));
22653 out += renderer.text(token.text);
22658 var errMsg = 'Token with "' + token.type + '" type was not found.';
22659 if (this.options.silent) {
22660 console.error(errMsg);
22663 throw new Error(errMsg);
22676 function marked(src, opt, callback) {
22677 // throw error in case of non string input
22678 if (typeof src === 'undefined' || src === null) {
22679 throw new Error('marked(): input parameter is undefined or null');
22681 if (typeof src !== 'string') {
22682 throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');
22684 if (typeof opt === 'function') {
22688 opt = merge({}, marked.defaults, opt || {});
22689 checkSanitizeDeprecation(opt);
22691 var highlight = opt.highlight;
22694 tokens = Lexer.lex(src, opt);
22696 return callback(e);
22698 var done = function done(err) {
22702 if (opt.walkTokens) {
22703 marked.walkTokens(tokens, opt.walkTokens);
22705 out = Parser.parse(tokens, opt);
22710 opt.highlight = highlight;
22711 return err ? callback(err) : callback(null, out);
22713 if (!highlight || highlight.length < 3) {
22716 delete opt.highlight;
22717 if (!tokens.length) return done();
22719 marked.walkTokens(tokens, function (token) {
22720 if (token.type === 'code') {
22722 setTimeout(function () {
22723 highlight(token.text, token.lang, function (err, code) {
22727 if (code != null && code !== token.text) {
22729 token.escaped = true;
22732 if (pending === 0) {
22739 if (pending === 0) {
22744 function onError(e) {
22745 e.message += '\nPlease report this to https://github.com/markedjs/marked.';
22747 return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';
22752 var _tokens = Lexer.lex(src, opt);
22753 if (opt.walkTokens) {
22755 return Promise.all(marked.walkTokens(_tokens, opt.walkTokens)).then(function () {
22756 return Parser.parse(_tokens, opt);
22757 })["catch"](onError);
22759 marked.walkTokens(_tokens, opt.walkTokens);
22761 return Parser.parse(_tokens, opt);
22771 marked.options = marked.setOptions = function (opt) {
22772 merge(marked.defaults, opt);
22773 changeDefaults(marked.defaults);
22776 marked.getDefaults = getDefaults;
22777 marked.defaults = exports.defaults;
22783 marked.use = function () {
22784 var extensions = marked.defaults.extensions || {
22788 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22789 args[_key] = arguments[_key];
22791 args.forEach(function (pack) {
22792 // copy options to new object
22793 var opts = merge({}, pack);
22795 // set async to true if it was set to true before
22796 opts.async = marked.defaults.async || opts.async;
22798 // ==-- Parse "addon" extensions --== //
22799 if (pack.extensions) {
22800 pack.extensions.forEach(function (ext) {
22802 throw new Error('extension name required');
22804 if (ext.renderer) {
22805 // Renderer extensions
22806 var prevRenderer = extensions.renderers[ext.name];
22807 if (prevRenderer) {
22808 // Replace extension with func to run new extension but fall back if false
22809 extensions.renderers[ext.name] = function () {
22810 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
22811 args[_key2] = arguments[_key2];
22813 var ret = ext.renderer.apply(this, args);
22814 if (ret === false) {
22815 ret = prevRenderer.apply(this, args);
22820 extensions.renderers[ext.name] = ext.renderer;
22823 if (ext.tokenizer) {
22824 // Tokenizer Extensions
22825 if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') {
22826 throw new Error("extension level must be 'block' or 'inline'");
22828 if (extensions[ext.level]) {
22829 extensions[ext.level].unshift(ext.tokenizer);
22831 extensions[ext.level] = [ext.tokenizer];
22834 // Function to check for start of token
22835 if (ext.level === 'block') {
22836 if (extensions.startBlock) {
22837 extensions.startBlock.push(ext.start);
22839 extensions.startBlock = [ext.start];
22841 } else if (ext.level === 'inline') {
22842 if (extensions.startInline) {
22843 extensions.startInline.push(ext.start);
22845 extensions.startInline = [ext.start];
22850 if (ext.childTokens) {
22851 // Child tokens to be visited by walkTokens
22852 extensions.childTokens[ext.name] = ext.childTokens;
22855 opts.extensions = extensions;
22858 // ==-- Parse "overwrite" extensions --== //
22859 if (pack.renderer) {
22861 var renderer = marked.defaults.renderer || new Renderer();
22862 var _loop = function _loop(prop) {
22863 var prevRenderer = renderer[prop];
22864 // Replace renderer with func to run extension, but fall back if false
22865 renderer[prop] = function () {
22866 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
22867 args[_key3] = arguments[_key3];
22869 var ret = pack.renderer[prop].apply(renderer, args);
22870 if (ret === false) {
22871 ret = prevRenderer.apply(renderer, args);
22876 for (var prop in pack.renderer) {
22879 opts.renderer = renderer;
22882 if (pack.tokenizer) {
22884 var tokenizer = marked.defaults.tokenizer || new Tokenizer();
22885 var _loop2 = function _loop2(prop) {
22886 var prevTokenizer = tokenizer[prop];
22887 // Replace tokenizer with func to run extension, but fall back if false
22888 tokenizer[prop] = function () {
22889 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
22890 args[_key4] = arguments[_key4];
22892 var ret = pack.tokenizer[prop].apply(tokenizer, args);
22893 if (ret === false) {
22894 ret = prevTokenizer.apply(tokenizer, args);
22899 for (var prop in pack.tokenizer) {
22902 opts.tokenizer = tokenizer;
22906 // ==-- Parse WalkTokens extensions --== //
22907 if (pack.walkTokens) {
22908 var _walkTokens = marked.defaults.walkTokens;
22909 opts.walkTokens = function (token) {
22911 values.push(pack.walkTokens.call(this, token));
22913 values = values.concat(_walkTokens.call(this, token));
22918 marked.setOptions(opts);
22923 * Run callback for every token
22926 marked.walkTokens = function (tokens, callback) {
22928 var _loop3 = function _loop3() {
22929 var token = _step.value;
22930 values = values.concat(callback.call(marked, token));
22931 switch (token.type) {
22934 for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) {
22935 var cell = _step2.value;
22936 values = values.concat(marked.walkTokens(cell.tokens, callback));
22938 for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) {
22939 var row = _step3.value;
22940 for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) {
22941 var _cell = _step4.value;
22942 values = values.concat(marked.walkTokens(_cell.tokens, callback));
22949 values = values.concat(marked.walkTokens(token.items, callback));
22954 if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) {
22955 // Walk any extensions
22956 marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) {
22957 values = values.concat(marked.walkTokens(token[childTokens], callback));
22959 } else if (token.tokens) {
22960 values = values.concat(marked.walkTokens(token.tokens, callback));
22965 for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) {
22973 * @param {string} src
22975 marked.parseInline = function (src, opt) {
22976 // throw error in case of non string input
22977 if (typeof src === 'undefined' || src === null) {
22978 throw new Error('marked.parseInline(): input parameter is undefined or null');
22980 if (typeof src !== 'string') {
22981 throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected');
22983 opt = merge({}, marked.defaults, opt || {});
22984 checkSanitizeDeprecation(opt);
22986 var tokens = Lexer.lexInline(src, opt);
22987 if (opt.walkTokens) {
22988 marked.walkTokens(tokens, opt.walkTokens);
22990 return Parser.parseInline(tokens, opt);
22992 e.message += '\nPlease report this to https://github.com/markedjs/marked.';
22994 return '<p>An error occurred:</p><pre>' + escape(e.message + '', true) + '</pre>';
23003 marked.Parser = Parser;
23004 marked.parser = Parser.parse;
23005 marked.Renderer = Renderer;
23006 marked.TextRenderer = TextRenderer;
23007 marked.Lexer = Lexer;
23008 marked.lexer = Lexer.lex;
23009 marked.Tokenizer = Tokenizer;
23010 marked.Slugger = Slugger;
23011 marked.parse = marked;
23012 var options = marked.options;
23013 var setOptions = marked.setOptions;
23014 var use = marked.use;
23015 var walkTokens = marked.walkTokens;
23016 var parseInline = marked.parseInline;
23017 var parse = marked;
23018 var parser = Parser.parse;
23019 var lexer = Lexer.lex;
23021 exports.Lexer = Lexer;
23022 exports.Parser = Parser;
23023 exports.Renderer = Renderer;
23024 exports.Slugger = Slugger;
23025 exports.TextRenderer = TextRenderer;
23026 exports.Tokenizer = Tokenizer;
23027 exports.getDefaults = getDefaults;
23028 exports.lexer = lexer;
23029 exports.marked = marked;
23030 exports.options = options;
23031 exports.parse = parse;
23032 exports.parseInline = parseInline;
23033 exports.parser = parser;
23034 exports.setOptions = setOptions;
23036 exports.walkTokens = walkTokens;
23041 /***/ "./src/test-data.json":
23042 /*!****************************!*\
23043 !*** ./src/test-data.json ***!
23044 \****************************/
23045 /***/ ((module) => {
23048 module.exports = JSON.parse('{"id":"000000","name":"Sample","created":"1674409747467","tree":{"id":"000000","collapsed":false,"children":[{"id":"000001","collapsed":false,"children":[]},{"id":"1dc4c363-7440-4661-bbc5-7e995dc6ba71","collapsed":false,"children":[]},{"id":"e067419d-85c3-422d-b8c4-41690be4450d","collapsed":false,"children":[{"id":"6addd61d-d12f-4a27-a471-513becfff006","children":[],"collapsed":false}]},{"id":"2ab706de-fea9-42a0-a900-e88b2950ceb3","collapsed":false,"children":[{"id":"27c14755-ff26-4931-a676-b48cd958b781","children":[{"id":"116f8e0f-ab62-450f-914e-5ca0956a457f","children":[],"collapsed":false}],"collapsed":true},{"id":"d69efd32-fbf5-4b80-8a36-af1cb2af7b80","children":[{"id":"b5a55548-f65d-496a-8bea-6b6ba8296e21","children":[],"collapsed":false}],"collapsed":true},{"id":"2f67d730-c71b-4823-a986-fa510d9408e1","children":[{"id":"40194ea5-9c28-4adb-bffe-4f59e7eca666","children":[],"collapsed":false}],"collapsed":true}]},{"id":"21df5e96-d770-43f0-8bd1-1b01ab4626f9","collapsed":false,"children":[]},{"id":"89c3267b-0114-4138-98a8-443b28d2e679","collapsed":false,"children":[{"id":"6b457d6b-0228-41b7-bbba-6c0ba3b54f4d","collapsed":false,"children":[{"id":"bad021fc-24d1-4560-8321-042c28d438a8","collapsed":false,"children":[]}]},{"id":"9690699a-cb7d-4123-8fa5-f7a58a191a08","children":[{"id":"2831a7aa-7291-4ebc-997f-5572e767f5c0","children":[],"collapsed":false}],"collapsed":false},{"id":"88d336be-4910-4d74-b79a-441894af956d","collapsed":false,"children":[{"id":"eb7fd6d7-b3fe-46e5-814c-655a6eec2ba4","children":[],"collapsed":false}]},{"id":"51b2f235-b979-4d74-ad83-3e8b6152bb4a","collapsed":false,"children":[{"id":"9c576012-7e8f-4d2b-b58b-1886eba43341","children":[],"collapsed":false}]}]},{"id":"ef04ea02-aed6-4295-9117-2dcc45506f3a","collapsed":false,"children":[{"id":"255bfdfc-9260-4cb1-9dcd-15f2c9eca2b2","children":[{"id":"40b53a6f-0f43-40c2-b6d3-486982fc9d48","children":[{"id":"724d0e33-fe2c-459e-9e75-e3311809ba36","children":[],"collapsed":false},{"id":"588a65fd-69dd-4bb4-a819-f8c7f05a1d69","collapsed":false,"children":[]},{"id":"13ea01fb-339d-4e65-9fad-123d72830efb","collapsed":false,"children":[]},{"id":"a941538b-6834-4a65-b297-50036b89a41f","collapsed":false,"children":[]}],"collapsed":false},{"id":"80b86062-a197-4adf-baa4-56a5953e0a77","collapsed":false,"children":[{"id":"c09a5876-f825-4cb0-9a56-2916e28f9d02","children":[],"collapsed":false}]}],"collapsed":false}]}]},"contentNodes":{"000001":{"id":"000001","created":1674409747467,"type":"text","content":"**Welcome to my Outliner**<br>"},"e067419d-85c3-422d-b8c4-41690be4450d":{"id":"e067419d-85c3-422d-b8c4-41690be4450d","created":1674412571215,"type":"text","content":"This is my attempt to build a \\"home base\\" piece of software for myself. The goal is to be able to use this tool to serve as a way to write long-form content, manage my website, and keep notes + references. <br>"},"21df5e96-d770-43f0-8bd1-1b01ab4626f9":{"id":"21df5e96-d770-43f0-8bd1-1b01ab4626f9","created":1674412689419,"type":"text","content":"---"},"89c3267b-0114-4138-98a8-443b28d2e679":{"id":"89c3267b-0114-4138-98a8-443b28d2e679","created":1674412690374,"type":"text","content":"**FAQ**"},"9690699a-cb7d-4123-8fa5-f7a58a191a08":{"id":"9690699a-cb7d-4123-8fa5-f7a58a191a08","created":1674412696214,"type":"text","content":"**Why should I use this?**<br>"},"2831a7aa-7291-4ebc-997f-5572e767f5c0":{"id":"2831a7aa-7291-4ebc-997f-5572e767f5c0","created":1674412702948,"type":"text","content":"You shouldn\'t. This isn\'t a piece of software for you - it\'s for me. You may find some use for it, but you also may not. Along the way features will be introduced that likely break things for you.<br>"},"51b2f235-b979-4d74-ad83-3e8b6152bb4a":{"id":"51b2f235-b979-4d74-ad83-3e8b6152bb4a","created":1674412786944,"type":"text","content":"**Ok I used it, but my data is trapped?**<br>"},"9c576012-7e8f-4d2b-b58b-1886eba43341":{"id":"9c576012-7e8f-4d2b-b58b-1886eba43341","created":1674412794788,"type":"text","content":"I\'ll be adding the ability to export the entire thing as OPML, so that there\'s some interop between this and all of [Dave Winer\'s](https://scripting.com) tooling. Hopefully that\'s enough. At some point I\'m going to also introduce support for [RemoteStorage](https://remotestorage.io) which is a project that I\'ve previous contributed to in the past, but have mostly been neglecting lately. I\'m hoping between those two options that\'ll be enough for \\"backups\\" of data.<br>"},"88d336be-4910-4d74-b79a-441894af956d":{"id":"88d336be-4910-4d74-b79a-441894af956d","created":1674412890012,"type":"text","content":"**If I use this, does this mean you have access to all my data?**<br>"},"eb7fd6d7-b3fe-46e5-814c-655a6eec2ba4":{"id":"eb7fd6d7-b3fe-46e5-814c-655a6eec2ba4","created":1674412907752,"type":"text","content":"No. I\'m trying to keep this entirely \\"static\\" and \\"offline first\\". You should be able to use this without concern that I\'ll be watching what you type. Like I said - this is primarily a tool for me, and I already have access to all of my content.<br>"},"bad021fc-24d1-4560-8321-042c28d438a8":{"id":"bad021fc-24d1-4560-8321-042c28d438a8","created":1674491030563,"type":"text","content":"An outliner is simply a tool that allows for \\"infinite\\" hierarchy. You can create nested nodes, move them around, and generally treat it like a big old bulleted list. It seem silly, but being able to sort your list whenever you feel like is a huge deal. <br>"},"1dc4c363-7440-4661-bbc5-7e995dc6ba71":{"id":"1dc4c363-7440-4661-bbc5-7e995dc6ba71","created":1674491120429,"type":"text","content":"I\'ve long been a user of [Dave Winer\'s](https://scripting.com) outliner tools for the last decade since I first discovered Outliners. They\'ve been a massive benefit to me as I attempt to organize my thoughts across a variety of subjects. I\'ve also always struggled to adopt existing tooling as I found that they were ALMOST what I wanted.<br>"},"6addd61d-d12f-4a27-a471-513becfff006":{"id":"6addd61d-d12f-4a27-a471-513becfff006","created":1674491272253,"type":"text","content":"![Thumbs Up](http://www.tmsauto.com/wp-content/uploads/3-thumbs-up.jpg)<br>"},"ef04ea02-aed6-4295-9117-2dcc45506f3a":{"id":"ef04ea02-aed6-4295-9117-2dcc45506f3a","created":1674494561538,"type":"text","content":"**Changelog**"},"255bfdfc-9260-4cb1-9dcd-15f2c9eca2b2":{"id":"255bfdfc-9260-4cb1-9dcd-15f2c9eca2b2","created":1674494572205,"type":"text","content":"**2023-01-23 - Initial Release**<br>"},"40b53a6f-0f43-40c2-b6d3-486982fc9d48":{"id":"40b53a6f-0f43-40c2-b6d3-486982fc9d48","created":1674494588998,"type":"text","content":"The outliner supports all standard outliner functionality<br>"},"850bac59-c64f-4884-a24c-a10cad6b38c2":{"id":"850bac59-c64f-4884-a24c-a10cad6b38c2","created":1674494607269,"type":"text","content":"---"},"cccd8044-92b6-4e89-887c-2f979f4e0cab":{"id":"cccd8044-92b6-4e89-887c-2f979f4e0cab","created":1674494607378,"type":"text","content":"---"},"724d0e33-fe2c-459e-9e75-e3311809ba36":{"id":"724d0e33-fe2c-459e-9e75-e3311809ba36","created":1674496047585,"type":"text","content":"Ability to create/remove nodes at the same level or as children of the selected node<br>"},"588a65fd-69dd-4bb4-a819-f8c7f05a1d69":{"id":"588a65fd-69dd-4bb4-a819-f8c7f05a1d69","created":1674496066859,"type":"text","content":"Ability to move nodes up and down within the same level<br>"},"13ea01fb-339d-4e65-9fad-123d72830efb":{"id":"13ea01fb-339d-4e65-9fad-123d72830efb","created":1674496078557,"type":"text","content":"Ability to lift/lower nodes in the hierarchy<br>"},"80b86062-a197-4adf-baa4-56a5953e0a77":{"id":"80b86062-a197-4adf-baa4-56a5953e0a77","created":1674496103163,"type":"text","content":"**Known Issues**<br>"},"c09a5876-f825-4cb0-9a56-2916e28f9d02":{"id":"c09a5876-f825-4cb0-9a56-2916e28f9d02","created":1674496115316,"type":"text","content":"The `findNodeInTree` method seems to jump through the list multiple times and needs to be properly terminated. There\'s a hack in place right now that stops it from triggering the handler multiple times, but it would be good to get that fixed<br>"},"a941538b-6834-4a65-b297-50036b89a41f":{"id":"a941538b-6834-4a65-b297-50036b89a41f","created":1674496226731,"type":"text","content":"Ability to fold/unfold nodes to hide/display nested content<br>"},"6b457d6b-0228-41b7-bbba-6c0ba3b54f4d":{"id":"6b457d6b-0228-41b7-bbba-6c0ba3b54f4d","created":1674499489509,"type":"text","content":"**What is an outliner?**<br>"},"2ab706de-fea9-42a0-a900-e88b2950ceb3":{"id":"2ab706de-fea9-42a0-a900-e88b2950ceb3","created":1674504320041,"type":"text","content":"**Features**<br>"},"27c14755-ff26-4931-a676-b48cd958b781":{"id":"27c14755-ff26-4931-a676-b48cd958b781","created":1674504328945,"type":"text","content":"- [x] A simple keyboard-navigated outliner where each node supports Markdown<br>"},"116f8e0f-ab62-450f-914e-5ca0956a457f":{"id":"116f8e0f-ab62-450f-914e-5ca0956a457f","created":1674504343967,"type":"text","content":"This is probably the single biggest difference from other outliners - and it really is a simple change. The text nodes are all markdown - so by default it supports anything that would render via [marked.js](https://marked.js.org/). <br>"},"974ebeda-2d49-4a31-9bcc-666c6b910702":{"id":"974ebeda-2d49-4a31-9bcc-666c6b910702","created":1674504414730,"type":"text","content":"Roadmap<br>"},"b00509a3-694a-4159-b9f0-fdc11e1e04e3":{"id":"b00509a3-694a-4159-b9f0-fdc11e1e04e3","created":1674504415116,"type":"text","content":"---"},"3c51e000-8bf7-469d-94e5-4480b980993c":{"id":"3c51e000-8bf7-469d-94e5-4480b980993c","created":1674504438403,"type":"text","content":"---"},"0da3090a-9a6f-4b3f-9607-0e97bd4318f5":{"id":"0da3090a-9a6f-4b3f-9607-0e97bd4318f5","created":1674504442196,"type":"text","content":"Current"},"d69efd32-fbf5-4b80-8a36-af1cb2af7b80":{"id":"d69efd32-fbf5-4b80-8a36-af1cb2af7b80","created":1674504453605,"type":"text","content":"- [ ] Search!"},"b5a55548-f65d-496a-8bea-6b6ba8296e21":{"id":"b5a55548-f65d-496a-8bea-6b6ba8296e21","created":1674504458424,"type":"text","content":"This is the most important one. The ability to fuzzy search across the entirety of the document and jump to any node possible. When I was working with Fargo + Little Outliner, I tried building extensions that would allow me to do this - but they never quite worked as I envisioned. I\'m hoping to provide a full fuzzy-text search system<br>"},"315c3870-a6c2-49b6-89b1-8c9e0a950b4c":{"id":"315c3870-a6c2-49b6-89b1-8c9e0a950b4c","created":1674504522443,"type":"text","content":"---"},"4f84fa9b-bc13-43fa-9e31-cf4a0c976d27":{"id":"4f84fa9b-bc13-43fa-9e31-cf4a0c976d27","created":1674504522958,"type":"text","content":"---"},"2f67d730-c71b-4823-a986-fa510d9408e1":{"id":"2f67d730-c71b-4823-a986-fa510d9408e1","created":1674504531115,"type":"text","content":"- [ ] Export Data<br>"},"bb64c043-b69f-49f8-bde4-9018822d929b":{"id":"bb64c043-b69f-49f8-bde4-9018822d929b","created":1674504546666,"type":"text","content":"Being able to \\"publish\\" a node and <br>"},"40194ea5-9c28-4adb-bffe-4f59e7eca666":{"id":"40194ea5-9c28-4adb-bffe-4f59e7eca666","created":1674504558701,"type":"text","content":"Being able to export the data to OPML at any point will go a long way to ensuring that the tool never locks me in if I decide to leave<br>"},"82956c9c-33d1-44e1-aca7-298cdfc4c72c":{"id":"82956c9c-33d1-44e1-aca7-298cdfc4c72c","created":1674504834120,"type":"text","content":"---"},"a1f74891-c98b-4fc2-a7ce-c18b2ad2b8d0":{"id":"a1f74891-c98b-4fc2-a7ce-c18b2ad2b8d0","created":1674504838755,"type":"text","content":"---"},"e1e60a99-74da-436c-b140-ce8c10832889":{"id":"e1e60a99-74da-436c-b140-ce8c10832889","created":1674504891810,"type":"text","content":"---"},"de5fd362-402e-4769-8429-9fecab882da0":{"id":"de5fd362-402e-4769-8429-9fecab882da0","created":1674504894934,"type":"text","content":"---"},"de9ca950-e7c0-4f10-b65e-a5cf9000a618":{"id":"de9ca950-e7c0-4f10-b65e-a5cf9000a618","created":1674504899904,"type":"text","content":"---"},"8f1a787f-01b5-4b72-8308-8a3fe0a96383":{"id":"8f1a787f-01b5-4b72-8308-8a3fe0a96383","created":1674504923176,"type":"text","content":"eys"}}}');
23053 /************************************************************************/
23054 /******/ // The module cache
23055 /******/ var __webpack_module_cache__ = {};
23057 /******/ // The require function
23058 /******/ function __webpack_require__(moduleId) {
23059 /******/ // Check if module is in cache
23060 /******/ var cachedModule = __webpack_module_cache__[moduleId];
23061 /******/ if (cachedModule !== undefined) {
23062 /******/ return cachedModule.exports;
23064 /******/ // Create a new module (and put it into the cache)
23065 /******/ var module = __webpack_module_cache__[moduleId] = {
23066 /******/ id: moduleId,
23067 /******/ loaded: false,
23068 /******/ exports: {}
23071 /******/ // Execute the module function
23072 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
23074 /******/ // Flag the module as loaded
23075 /******/ module.loaded = true;
23077 /******/ // Return the exports of the module
23078 /******/ return module.exports;
23081 /******/ // expose the modules object (__webpack_modules__)
23082 /******/ __webpack_require__.m = __webpack_modules__;
23084 /************************************************************************/
23085 /******/ /* webpack/runtime/define property getters */
23087 /******/ // define getter functions for harmony exports
23088 /******/ __webpack_require__.d = (exports, definition) => {
23089 /******/ for(var key in definition) {
23090 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
23091 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
23097 /******/ /* webpack/runtime/ensure chunk */
23099 /******/ __webpack_require__.f = {};
23100 /******/ // This file contains only the entry chunk.
23101 /******/ // The chunk loading function for additional chunks
23102 /******/ __webpack_require__.e = (chunkId) => {
23103 /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
23104 /******/ __webpack_require__.f[key](chunkId, promises);
23105 /******/ return promises;
23110 /******/ /* webpack/runtime/get javascript chunk filename */
23112 /******/ // This function allow to reference async chunks
23113 /******/ __webpack_require__.u = (chunkId) => {
23114 /******/ // return url for filenames based on template
23115 /******/ return "" + chunkId + ".bundle.js";
23119 /******/ /* webpack/runtime/global */
23121 /******/ __webpack_require__.g = (function() {
23122 /******/ if (typeof globalThis === 'object') return globalThis;
23124 /******/ return this || new Function('return this')();
23125 /******/ } catch (e) {
23126 /******/ if (typeof window === 'object') return window;
23131 /******/ /* webpack/runtime/hasOwnProperty shorthand */
23133 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
23136 /******/ /* webpack/runtime/load script */
23138 /******/ var inProgress = {};
23139 /******/ var dataWebpackPrefix = "outline-browser:";
23140 /******/ // loadScript function to load a script via script tag
23141 /******/ __webpack_require__.l = (url, done, key, chunkId) => {
23142 /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
23143 /******/ var script, needAttach;
23144 /******/ if(key !== undefined) {
23145 /******/ var scripts = document.getElementsByTagName("script");
23146 /******/ for(var i = 0; i < scripts.length; i++) {
23147 /******/ var s = scripts[i];
23148 /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
23151 /******/ if(!script) {
23152 /******/ needAttach = true;
23153 /******/ script = document.createElement('script');
23155 /******/ script.charset = 'utf-8';
23156 /******/ script.timeout = 120;
23157 /******/ if (__webpack_require__.nc) {
23158 /******/ script.setAttribute("nonce", __webpack_require__.nc);
23160 /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
23161 /******/ script.src = url;
23163 /******/ inProgress[url] = [done];
23164 /******/ var onScriptComplete = (prev, event) => {
23165 /******/ // avoid mem leaks in IE.
23166 /******/ script.onerror = script.onload = null;
23167 /******/ clearTimeout(timeout);
23168 /******/ var doneFns = inProgress[url];
23169 /******/ delete inProgress[url];
23170 /******/ script.parentNode && script.parentNode.removeChild(script);
23171 /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
23172 /******/ if(prev) return prev(event);
23174 /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
23175 /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
23176 /******/ script.onload = onScriptComplete.bind(null, script.onload);
23177 /******/ needAttach && document.head.appendChild(script);
23181 /******/ /* webpack/runtime/make namespace object */
23183 /******/ // define __esModule on exports
23184 /******/ __webpack_require__.r = (exports) => {
23185 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
23186 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
23188 /******/ Object.defineProperty(exports, '__esModule', { value: true });
23192 /******/ /* webpack/runtime/node module decorator */
23194 /******/ __webpack_require__.nmd = (module) => {
23195 /******/ module.paths = [];
23196 /******/ if (!module.children) module.children = [];
23197 /******/ return module;
23201 /******/ /* webpack/runtime/publicPath */
23203 /******/ var scriptUrl;
23204 /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
23205 /******/ var document = __webpack_require__.g.document;
23206 /******/ if (!scriptUrl && document) {
23207 /******/ if (document.currentScript)
23208 /******/ scriptUrl = document.currentScript.src
23209 /******/ if (!scriptUrl) {
23210 /******/ var scripts = document.getElementsByTagName("script");
23211 /******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src
23214 /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
23215 /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
23216 /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
23217 /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
23218 /******/ __webpack_require__.p = scriptUrl;
23221 /******/ /* webpack/runtime/jsonp chunk loading */
23223 /******/ // no baseURI
23225 /******/ // object to store loaded and loading chunks
23226 /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
23227 /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
23228 /******/ var installedChunks = {
23232 /******/ __webpack_require__.f.j = (chunkId, promises) => {
23233 /******/ // JSONP chunk loading for javascript
23234 /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
23235 /******/ if(installedChunkData !== 0) { // 0 means "already installed".
23237 /******/ // a Promise means "currently loading".
23238 /******/ if(installedChunkData) {
23239 /******/ promises.push(installedChunkData[2]);
23241 /******/ if(true) { // all chunks have JS
23242 /******/ // setup Promise in chunk cache
23243 /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
23244 /******/ promises.push(installedChunkData[2] = promise);
23246 /******/ // start chunk loading
23247 /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
23248 /******/ // create error before stack unwound to get useful stacktrace later
23249 /******/ var error = new Error();
23250 /******/ var loadingEnded = (event) => {
23251 /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
23252 /******/ installedChunkData = installedChunks[chunkId];
23253 /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
23254 /******/ if(installedChunkData) {
23255 /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
23256 /******/ var realSrc = event && event.target && event.target.src;
23257 /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
23258 /******/ error.name = 'ChunkLoadError';
23259 /******/ error.type = errorType;
23260 /******/ error.request = realSrc;
23261 /******/ installedChunkData[1](error);
23265 /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
23266 /******/ } else installedChunks[chunkId] = 0;
23271 /******/ // no prefetching
23273 /******/ // no preloaded
23277 /******/ // no HMR manifest
23279 /******/ // no on chunks loaded
23281 /******/ // install a JSONP callback for chunk loading
23282 /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
23283 /******/ var [chunkIds, moreModules, runtime] = data;
23284 /******/ // add "moreModules" to the modules object,
23285 /******/ // then flag all "chunkIds" as loaded and fire callback
23286 /******/ var moduleId, chunkId, i = 0;
23287 /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
23288 /******/ for(moduleId in moreModules) {
23289 /******/ if(__webpack_require__.o(moreModules, moduleId)) {
23290 /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
23293 /******/ if(runtime) var result = runtime(__webpack_require__);
23295 /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
23296 /******/ for(;i < chunkIds.length; i++) {
23297 /******/ chunkId = chunkIds[i];
23298 /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
23299 /******/ installedChunks[chunkId][0]();
23301 /******/ installedChunks[chunkId] = 0;
23306 /******/ var chunkLoadingGlobal = self["webpackChunkoutline_browser"] = self["webpackChunkoutline_browser"] || [];
23307 /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
23308 /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
23311 /************************************************************************/
23313 /******/ // startup
23314 /******/ // Load entry module and return exports
23315 /******/ // This entry module is referenced by other modules so it can't be inlined
23316 /******/ var __webpack_exports__ = __webpack_require__("./src/client.ts");
23320 //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBO0FBQ0EsRUFBRSxLQUE0RDtBQUM5RCxFQUFFLENBQ3dEO0FBQzFELENBQUMsc0JBQXNCOztBQUV2QjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLG9CQUFvQixrQkFBa0I7QUFDdEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUEsMkNBQTJDLFNBQVM7O0FBRXBEO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0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ICAgICAgICB2YXIgb3RoZXJTdWJDb21ibyA9IG90aGVyS2V5Q29tYm8uc3ViQ29tYm9zW19pXS5zbGljZSgwKTtcblxuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgc3ViQ29tYm8ubGVuZ3RoOyBqICs9IDEpIHtcbiAgICAgICAgICAgIHZhciBrZXlOYW1lID0gc3ViQ29tYm9bal07XG4gICAgICAgICAgICB2YXIgaW5kZXggPSBvdGhlclN1YkNvbWJvLmluZGV4T2Yoa2V5TmFtZSk7XG5cbiAgICAgICAgICAgIGlmIChpbmRleCA+IC0xKSB7XG4gICAgICAgICAgICAgIG90aGVyU3ViQ29tYm8uc3BsaWNlKGluZGV4LCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAob3RoZXJTdWJDb21iby5sZW5ndGggIT09IDApIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICB9LCB7XG4gICAgICBrZXk6IFwiX2NoZWNrU3ViQ29tYm9cIixcbiAgICAgIHZhbHVlOiBmdW5jdGlvbiBfY2hlY2tTdWJDb21ibyhzdWJDb21ibywgc3RhcnRpbmdLZXlOYW1lSW5kZXgsIHByZXNzZWRLZXlOYW1lcykge1xuICAgICAgICBzdWJDb21ibyA9IHN1YkNvbWJvLnNsaWNlKDApO1xuICAgICAgICBwcmVzc2VkS2V5TmFtZXMgPSBwcmVzc2VkS2V5TmFtZXMuc2xpY2Uoc3RhcnRpbmdLZXlOYW1lSW5kZXgpO1xuICAgICAgICB2YXIgZW5kSW5kZXggPSBzdGFydGluZ0tleU5hbWVJbmRleDtcblxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN1YkNvbWJvLmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICAgICAgdmFyIGtleU5hbWUgPSBzdWJDb21ib1tpXTtcblxuICAgICAgICAgIGlmIChrZXlOYW1lWzBdID09PSAnXFxcXCcpIHtcbiAgICAgICAgICAgIHZhciBlc2NhcGVkS2V5TmFtZSA9IGtleU5hbWUuc2xpY2UoMSk7XG5cbiAgICAgICAgICAgIGlmIChlc2NhcGVkS2V5TmFtZSA9PT0gS2V5Q29tYm8uY29tYm9EZWxpbWluYXRvciB8fCBlc2NhcGVkS2V5TmFtZSA9PT0gS2V5Q29tYm8ua2V5RGVsaW1pbmF0b3IpIHtcbiAgICAgICAgICAgICAga2V5TmFtZSA9IGVzY2FwZWRLZXlOYW1lO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBpbmRleCA9IHByZXNzZWRLZXlOYW1lcy5pbmRleE9mKGtleU5hbWUpO1xuXG4gICAgICAgICAgaWYgKGluZGV4ID4gLTEpIHtcbiAgICAgICAgICAgIHN1YkNvbWJvLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgIGkgLT0gMTtcblxuICAgICAgICAgICAgaWYgKGluZGV4ID4gZW5kSW5kZXgpIHtcbiAgICAgICAgICAgICAgZW5kSW5kZXggPSBpbmRleDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHN1YkNvbWJvLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICByZXR1cm4gZW5kSW5kZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgfVxuICAgIH1dKTtcblxuICAgIHJldHVybiBLZXlDb21ibztcbiAgfSgpO1xuICBLZXlDb21iby5jb21ib0RlbGltaW5hdG9yID0gJz4nO1xuICBLZXlDb21iby5rZXlEZWxpbWluYXRvciA9ICcrJztcblxuICBLZXlDb21iby5wYXJzZUNvbWJvU3RyID0gZnVuY3Rpb24gKGtleUNvbWJvU3RyKSB7XG4gICAgdmFyIHN1YkNvbWJvU3RycyA9IEtleUNvbWJvLl9zc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tleXMgPSBbXTtcbiAgICAgIHRoaXMucHJlc3NlZEtleXMgPSBbXTtcbiAgICAgIHRoaXMuX2FwcGxpZWRNYWNyb3MgPSBbXTtcbiAgICAgIHRoaXMuX2tleU1hcCA9IHt9O1xuICAgICAgdGhpcy5fa2lsbEtleUNvZGVzID0gW107XG4gICAgICB0aGlzLl9tYWNyb3MgPSBbXTtcbiAgICB9XG5cbiAgICBfY3JlYXRlQ2xhc3MoTG9jYWxlLCBbe1xuICAgICAga2V5OiBcImJpbmRLZXlDb2RlXCIsXG4gICAgICB2YWx1ZTogZnVuY3Rpb24gYmluZEtleUNvZGUoa2V5Q29kZSwga2V5TmFtZXMpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBrZXlOYW1lcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICBrZXlOYW1lcyA9IFtrZXlOYW1lc107XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLl9rZXlNYXBba2V5Q29kZV0gPSBrZXlOYW1lcztcbiAgICAgIH1cbiAgICB9LCB7XG4gICAgICBrZXk6IFwiYmluZE1hY3JvXCIsXG4gICAgICB2YWx1ZTogZnVuY3Rpb24gYmluZE1hY3JvKGtleUNvbWJvU3RyLCBrZXlOYW1lcykge1xuICAgICAgICBpZiAodHlwZW9mIGtleU5hbWVzID09PSAnc3RyaW5nJykge1xuICAgICAgICAgIGtleU5hbWVzID0gW2tleU5hbWVzXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBoYW5kbGVyID0gbnVsbDtcblxuICAgICAgICBpZiAodHlwZW9mIGtleU5hbWVzID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgaGFuZGxlciA9IGtleU5hbWVzO1xuICAgICAgICAgIGtleU5hbWVzID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBtYWNybyA9IHtcbiAgICAgICAgICBrZXlDb21ibzogbmV3IEtleUNvbWJvKGtleUNvbWJvU3RyKSxcbiAgICAgICAgICBrZXlOY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iAgICAgICAgICAgIHRoaXMuc2V0S2lsbEtleShrZXlDb2Rlc1tpXSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fa2lsbEtleUNvZGVzLnB1c2goa2V5Q29kZSk7XG4gICAgICB9XG4gICAgfSwge1xuICAgICAga2V5OiBcInByZXNzS2V5XCIsXG4gICAgICB2YWx1ZTogZnVuY3Rpb24gcHJlc3NLZXkoa2V5Q29kZSkge1xuICAgICAgICBpZiAodHlwZW9mIGtleUNvZGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgdmFyIGtleUNvZGVzID0gdGhpcy5nZXRLZXlDb2RlcyhrZXlDb2RlKTtcblxuICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwga2V5Q29kZXMubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgIHRoaXMucHJlc3NLZXkoa2V5Q29kZXNbaV0pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuYWN0aXZlVGFyZ2V0S2V5cy5sZW5ndGggPSAwO1xuICAgICAgICB2YXIga2V5TmFtZXMgPSB0aGlzLmdldEtleU5hbWVzKGtleUNvZGUpO1xuXG4gICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCBrZXlOYW1lcy5sZW5ndGg7IF9pICs9IDEpIHtcbiAgICAgICAgICB0aGlzLmFjdGl2ZVRhcmdldEtleXMucHVzaChrZXlOYW1lc1tfaV0pO1xuXG4gICAgICAgICAgaWYgKHRoaXMucHJlc3NlZEtleXMuaW5kZXhPZihrZXlOYW1lc1tfaV0pID09PSAtMSkge1xuICAgICAgICAgICAgdGhpcy5wcmVzc2VkS2V5cy5wdXNoKGtleU5hbWVzW19pXSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fYXBwbHlNYWNyb3MoKTtcbiAg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JnZXRLZXlzLmxlbmd0aCA9IDA7XG5cbiAgICAgICAgICB0aGlzLl9jbGVhck1hY3JvcygpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSwge1xuICAgICAga2V5OiBcIl9hcHBseU1hY3Jvc1wiLFxuICAgICAgdmFsdWU6IGZ1bmN0aW9uIF9hcHBseU1hY3JvcygpIHtcbiAgICAgICAgdmFyIG1hY3JvcyA9IHRoaXMuX21hY3Jvcy5zbGljZSgwKTtcblxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG1hY3Jvcy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgICAgIHZhciBtYWNybyA9IG1hY3Jvc1tpXTtcblxuICAgICAgICAgIGlmIChtYWNyby5rZXlDb21iby5jaGVjayh0aGlzLnByZXNzZWRLZXlzKSkge1xuICAgICAgICAgICAgaWYgKG1hY3JvLmhhbmRsZXIpIHtcbiAgICAgICAgICAgICAgbWFjcm8ua2V5TmFtZXMgPSBtYWNyby5oYW5kbGVyKHRoaXMucHJlc3NlZEtleXMpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IG1hY3JvLmtleU5hbWVzLmxlbmd0aDsgaiArPSAxKSB7XG4gICAgICAgICAgICAgIGlmICh0aGlzLnByZXNzZWRLZXlzLmluZGV4T2YobWFjcm8ua2V5TmFtZXNbal0pID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHRoaXMucHJlc3NlZEtleXMucHVzaChtYWNyby5rZXlOYW1lc1tqXSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5fYXBwbGllZE1hY3Jvcy5wdXNoKG1hY3JvKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LCB7XG4gICAgICBrZXk6IFwiX2NsZWFyTWFjcm9zXCIsXG4gICAgICB2YWx1ZTogZnVuY3Rpb24gX2NsZWFyTWFjcm9zKCkge1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXMuX2FwcGxpZWRNYWNyb3MubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICB2YXIgbWFjcm8gPSB0aGlzLl9hcHBsaWVkTWFjcm9zW2ldO1xuXG4gICAgICAgICAgaWYgKCFtYWNyby5rZXlDb21iby5jaGVjayh0aGlzLnByZXNzZWRLZXlzKSkge1xuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYWNyby5rZXlOYW1lcy5sZW5ndGg7IGogKz0gMSkge1xuICAgICAgICAgICAgICB2YXIgaW5kZXggPSB0aGlzLnByZXNzZWRLZXlzLmluZGV4T2YobWFjcm8ua2V5TmFtZXNbal0pO1xuXG4gICAgICAgICAgICAgIGlmIChpbmRleCA+IC0xKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5wcmVzc2VkS2V5cy5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChtYWNyby5oYW5kbGVyKSB7XG4gICAgICAgICAgICAgIG1hY3JvLmtleU5hbWVzID0gbnVsbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5fYXBwbGllZE1hY3Jvcy5zcGxpY2UoaSwgMSk7XG5cbiAgICAgICAgICAgIGkgLT0gMTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XSk7XG5cbiAgICByZXR1cm4gTG9jYWxlO1xuICB9KCk7XG5cbiAgdmFyIEtleWJvYXJkID0gLyojX19QVVJFX18qL2Z1bmN0aW9uICgpIHtcbiAgICBmdW5jdGlvbiBLZXlib2FyZCh0YXJnZXRXaW5kb3csIHRhcmdldEVsZW1lbnQsIHRhcmdldFBsYXRmb3JtLCB0YXJnZXRVc2VyQWdlbnQpIHtcbiAgICAgIF9jbGFzc0NhbGxDaGVjayh0aGlzLCBLZXlib2FyZCk7XG5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JnZXRXaW5kb3c6IGdsb2JhbENvbnRleHQudGFyZ2V0V2luZG93LFxuICAgICAgICAgICAgdGFyZ2V0RWxlbWVudDogZ2xvYmFsQ29udGV4dC50YXJnZXRFbGVtZW50LFxuICAgICAgICAgICAgdGFyZ2V0UGxhdGZvcm06IGdsb2JhbENvbnRleHQudGFyZ2V0UGxhdGZvcm0sXG4gICAgICAgICAgICB0YXJnZXRVc2VyQWdlbnQ6IGdsb2JhbENvbnRleHQudGFyZ2V0VXNlckFnZW50XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBjb250ZXh0ID0gdGhpcy5fY29udGV4dHNbY29udGV4dE5hbWVdO1xuICAgICAgICB0aGlzLl9jdXJyZW50Q29udGV4dCA9IGNvbnRleHROYW1lO1xuICAgICAgICB0aGlzLl9saXN0ZW5lcnMgPSBjb250ZXh0Lmxpc3RlbmVycztcbiAgICAgICAgdGhpcy5zdG9wKCk7XG4gICAgICAgIHRoaXMud2F0Y2goY29udGV4dC50YXJnZXRXaW5kb3csIGNvbnRleHQudGFyZ2V0RWxlbWVudCwgY29udGV4dC50YXJnZXRQbGF0Zm9ybSwgY29udGV4dC50YXJnZXRVc2VyQWdlbnQpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgIH1cbiAgICB9LCB7XG4gICAgICBrZXk6IFwiZ2V0Q29udGV4dFwiLFxuICAgICAgdmFsdWU6IGZ1bmN0aW9uIGdldENvbnRleHQoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50Q29udGV4dDtcbiAgICAgIH1cbiAgICB9LCB7XG4gICAgICBrZXk6IFwid2l0aENvbnRleHRcIixcbiAgICAgIHZhbHVlOiBmdW5jdGlvbiB3aXRoQ29udGV4dChjb250ZXh0TmFtZSwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIHByZXZpb3VzQ29udGV4dE5hbWUgPSB0aGlzLmdldENvbnRleHQoKTtcbiAgICAgICAgdGhpcy5zZXRD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HtcbiAgICAgICAgICAgIGlmIChsaXN0ZW5lckdyb3VwTWFwW2ldID09PSBudWxsICYmIGwua2V5Q29tYm8gPT09IG51bGwgfHwgbGlzdGVuZXJHcm91cE1hcFtpXSAhPT0gbnVsbCAmJiBsaXN0ZW5lckdyb3VwTWFwW2ldLmlzRXF1YWwobC5rZXlDb21ibykpIHtcbiAgICAgICAgICAgICAgbWFwSW5kZXggPSBpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChtYXBJbmRleCA9PT0gLTEpIHtcbiAgICAgICAgICAgIG1hcEluZGV4ID0gbGlzdGVuZXJHcm91cE1hcC5sZW5ndGg7XG4gICAgICAgICAgICBsaXN0ZW5lckdyb3VwTWFwLnB1c2gobC5rZXlDb21ibyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFsaXN0ZW5lckdyb3Vwc1ttYXBJbmRleF0pIHtcbiAgICAgICAgICAgIGxpc3RlbmVyR3JvdXBzW21hcEluZGV4XSA9IFtdO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGxpc3RlbmVyR3JvdXBzW21hcEluZGV4XS5wdXNoKGwpO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIGxpc3RlbmVyR3JvdXBzO1xuICAgICAgfVxuICAgIH0sIHtcbiAgICAgIGtleTogXCJfYXBwbHlCaW5kaW5nc1wiLFxuICAgICAgdmFsdWU6IGZ1bmN0aW9uIF9hcHBseUJpbmRpbmdzKGV2ZW50KSB7XG4gICAgICAgIHZhciBfdGhpczIgPSB0aGlzO1xuXG4gICAgICAgIHZhciBwcmV2ZW50UmVwZWF0ID0gZmFsc2U7XG4gICAgICAgIGV2ZW50IHx8IChldmVudCA9IHt9KTtcblxuICAgICAgICBldmVudC5wcmV2ZW50UmVwZWF0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHByZXZlbnRSZXBlYXQgPSB0cnVlO1xuICAgICAgICB9O1xuXG4gICAgICAgIG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RlbmVyLnByZXNzSGFuZGxlci5jYWxsKF90aGlzMiwgZXZlbnQpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmV4ZWN1dGluZ0hhbmRsZXIgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgIGlmIChwcmV2ZW50UmVwZWF0IHx8IGxpc3RlbmVyLnByZXZlbnRSZXBlYXRCeURlZmF1bHQpIHtcbiAgICAgICAgICAgICAgICAgIGxpc3RlbmVyLnByZXZlbnRSZXBlYXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgcHJldmVudFJlcGVhdCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmIChfdGhpczIuX2FwcGxpZWRMaXN0ZW5lcnMuaW5kZXhPZihsaXN0ZW5lcikgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgX3RoaXMyLl9hcHBsaWVkTGlzdGVuZXJzLnB1c2gobGlzdGVuZXIpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChrZXlDb21ibykge1xuICAgICAgICAgICAgICBmb3IgKHZhciBfaiA9IDA7IF9qIDwga2V5Q29tYm8ua2V5TmFtZXMubGVuZ3RoOyBfaiArPSAxKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gcHJlc3NlZEtleXMuaW5kZXhPZihrZXlDb21iby5rZXlOYW1lc1tfal0pO1xuXG4gICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgcHJlc3NlZEtleXMuc3BsaWNlKGluZGV4LCAxKTtcbiAgICAgICAgICAgICAgICAgIF9qIC09IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdGVuZX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gICAgICAgIHJldHVybiBiYXNlV3JhcHBlclZhbHVlKGFycmF5LCB0aGlzLl9fYWN0aW9uc19fKTtcbiAgICAgIH1cbiAgICAgIHZhciByZXN1bHQgPSBbXTtcblxuICAgICAgb3V0ZXI6XG4gICAgICB3aGlsZSAobGVuZ3RoLS0gJiYgcmVzSW5kZXggPCB0YWtlQ291bnQpIHtcbiAgICAgICAgaW5kZXggKz0gZGlyO1xuXG4gICAgICAgIHZhciBpdGVySW5kZXggPSAtMSxcbiAgICAgICAgICAgIHZhbHVlID0gYXJyYXlbaW5kZXhdO1xuXG4gICAgICAgIHdoaWxlICgrK2l0ZXJJbmRleCA8IGl0ZXJMZW5ndGgpIHtcbiAgICAgICAgICB2YXIgZGF0YSA9IGl0ZXJhdGVlc1tpdGVySW5kZXhdLFxuICAgICAgICAgICAgICBpdGVyYXRlZSA9IGRhdGEuaXRlcmF0ZWUsXG4gICAgICAgICAgICAgIHR5cGUgPSBkYXRhLnR5cGUsXG4gICAgICAgICAgICAgIGNvbXB1dGVkID0gaXRlcmF0ZWUodmFsdWUpO1xuXG4gICAgICAgICAgaWYgKHR5cGUgPT0gTEFaWV9NQVBfRkxBRykge1xuICAgICAgICAgICAgdmFsdWUgPSBjb21wdXRlZDtcbiAgICAgICAgICB9IGVsc2UgaWYgKCFjb21wdXRlZCkge1xuICAgICAgICAgICAgaWYgKHR5cGUgPT0gTEFaWV9GSUxURVJfRkxBRykge1xuICAgICAgICAgICAgICBjb250aW51ZSBvdXRlcjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGJyZWFrIG91dGVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXN1bHRbcmVzSW5kZXgrK10gPSB2YWx1ZTtcbiAgICAgIH1cbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLy8gRW5zdXJlIGBMYXp5V3JhcHBlcmAgaXMgYW4gaW5zdGFuY2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IDkgaGFzIGVudW1lcmFibGUgYGFyZ3VtZW50cy5sZW5ndGhgIGluIHN0cmljdCBtb2RlLlxuICAgICAgICAgICAgICAga2V5ID09ICdsZW5ndGgnIHx8XG4gICAgICAgICAgICAgICAvLyBOb2RlLmpzIDAuMTAgaGFzIGVudW1lcmFibGUgbm9uLWluZGV4IHByb3BlcnRpZXMgb24gYnVmZmVycy5cbiAgICAgICAgICAgICAgIChpc0J1ZmYgJiYgKGtleSA9PSAnb2Zmc2V0JyB8fCBrZXkgPT0gJ3BhcmVudCcpKSB8fFxuICAgICAgICAgICAgICAgLy8gUGhhbnRvbUpTIDIgaGFzIGVudW1lcmFibGUgbm9uLWluZGV4IHByb3BlcnRpZXMgb24gdHlwZWQgYXJyYXlzLlxuICAgICAgICAgICAgICAgKGlzVHlwZSAmJiAoa2V5ID09ICdidWZmZXInIHx8IGtleSA9PSAnYnl0ZUxlbmd0aCcgfHwga2V5ID09ICdieXRlT2Zmc2V0JykpIHx8XG4gICAgICAgICAgICAgICAvLyBTa2lwIGluZGV4IHByb3BlcnRpZXMuXG4gICAgICAgICAgICAgICBpc0luZGV4KGtleSwgbGVuZ3RoKVxuICAgICAgICAgICAgKSkpIHtcbiAgICAgICAgICByZXN1bHQucHVzaChrZXkpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEEgc3BlY2lhbGl6ZWQgdmVyc2lvbiBvZiBgXy5zYW1wbGVgIGZvciBhcnJheXMuXG4gICAgICpcbiAgICAgKiBAcHJpdmF0ZVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBzYW1wbGUuXG4gICAgICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIHJhbmRvbSBlbGVtZW50LlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIGFycmF5U2FtcGxlKGFycmF5KSB7XG4gICAgICB2YXIgbGVuZ3RoID0gY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lcyhyZXN1bHQsIGNvbXB1dGVkLCBjb21wYXJhdG9yKVxuICAgICAgICAgICAgKSkge1xuICAgICAgICAgIG90aEluZGV4ID0gb3RoTGVuZ3RoO1xuICAgICAgICAgIHdoaWxlICgtLW90aEluZGV4KSB7XG4gICAgICAgICAgICB2YXIgY2FjaGUgPSBjYWNoZXNbb3RoSW5kZXhdO1xuICAgICAgICAgICAgaWYgKCEoY2FjaGVcbiAgICAgICAgICAgICAgICAgID8gY2FjaGVIYXMoY2FjaGUsIGNvbXB1dGVkKVxuICAgICAgICAgICAgICAgICAgOiBpbmNsdWRlcyhhcnJheXNbb3RoSW5kZXhdLCBjb21wdXRlZCwgY29tcGFyYXRvcikpXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlIG91dGVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2Vlbikge1xuICAgICAgICAgICAgc2Vlbi5wdXNoKGNvbXB1dGVkKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmVzdWx0LnB1c2godmFsdWUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmludmVydGAgYW5kIGBfLmludmVydEJ5YCB3aGljaCBpbnZlcnRzXG4gICAgICogYG9iamVjdGAgd2l0aCB2YWx1ZXMgdHJhbnNmb3JtZWQgYnkgYGl0ZXJhdGVlYCBhbmQgc2V0IGJ5IGBzZXR0ZXJgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gaXRlcmF0ZSBvdmVyLlxuICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IHNldHRlciBUaGUgZnVuY3Rpb24gdG8gc2V0IGBhY2N1bXVsYXRvcmAgdm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GNoKG9iamVjdCwgc291cmNlLCBtYXRjaERhdGEsIGN1c3RvbWl6ZXIpIHtcbiAgICAgIHZhciBpbmRleCA9IG1hdGNoRGF0YS5sZW5ndGgsXG4gICAgICAgICAgbGVuZ3RoID0gaW5kZXgsXG4gICAgICAgICAgbm9DdXN0b21pemVyID0gIWN1c3RvbWl6ZXI7XG5cbiAgICAgIGlmIChvYmplY3QgPT0gbnVsbCkge1xuICAgICAgICByZXR1cm4gIWxlbmd0aDtcbiAgICAgIH1cbiAgICAgIG9iamVjdCA9IE9iamVjdChvYmplY3QpO1xuICAgICAgd2hpbGUgKGluZGV4LS0pIHtcbiAgICAgICAgdmFyIGRhdGEgPSBtYXRjaERhdGFbaW5kZXhdO1xuICAgICAgICBpZiAoKG5vQ3VzdG9taXplciAmJiBkYXRhWzJdKVxuICAgICAgICAgICAgICA/IGRhdGFbMV0gIT09IG9iamVjdFtkYXRhWzBdXVxuICAgICAgICAgICAgICA6ICEoZGF0YVswXSBpbiBvYmplY3QpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgIGRhdGEgPSBtYXRjaERhdGFbaW5kZXhdO1xuICAgICAgICB2YXIga2V5ID0gZGF0YVswXSxcbiAgICAgICAgICAgIG9ialZhbHVlID0gb2JqZWN0W2tleV0sXG4gICAgICAgICAgICBzcmNWYWx1ZSA9IGRhdGFbMV07XG5cbiAgICAgICAgaWYgKG5vQ3VzdG9taXplciAmJiBkYXRhWzJdKSB7XG4gICAgICAgICAgaWYgKG9ialZhbHVlID09PSB1bmRlZmluZWQgJiYgIShrZXkgaW4gb2JqZWN0KSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YXIgc3RhY2sgPSBuZXcgU3RhY2s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/IFtdIDogcmVzdWx0O1xuICAgICAgfVxuICAgICAgb3V0ZXI6XG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgdmFsdWUgPSBhcnJheVtpbmRleF0sXG4gICAgICAgICAgICBjb21wdXRlZCA9IGl0ZXJhdGVlID8gaXRlcmF0ZWUodmFsdWUpIDogdmFsdWU7XG5cbiAgICAgICAgdmFsdWUgPSAoY29tcGFyYXRvciB8fCB2YWx1ZSAhPT0gMCkgPyB2YWx1ZSA6IDA7XG4gICAgICAgIGlmIChpc0NvbW1vbiAmJiBjb21wdXRlZCA9PT0gY29tcHV0ZWQpIHtcbiAgICAgICAgICB2YXIgc2VlbkluZGV4ID0gc2Vlbi5sZW5ndGg7XG4gICAgICAgICAgd2hpbGUgKHNlZW5JbmRleC0tKSB7XG4gICAgICAgICAgICBpZiAoc2VlbltzZWVuSW5kZXhdID09PSBjb21wdXRlZCkge1xuICAgICAgICAgICAgICBjb250aW51ZSBvdXRlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGl0ZXJhdGVlKSB7XG4gICAgICAgICAgICBzZWVuLnB1c2goY29tcHV0ZWQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoIWluY2x1ZGVzKHNlZW4sIGNvbXB1dGVkLCBjb21wYXJhdG9yKSkge1xuICAgICAgICAgIGlmIChzZWVuICE9PSByZXN1bHQpIHtcbiAgICAgICAgICAgIHNlZW4ucHVzaChjb21wdXRlZCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdC5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgXy51bn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90aGVyKSB7XG4gICAgICAgIHZhciB2YWxJc0RlZmluZWQgPSB2YWx1ZSAhPT0gdW5kZWZpbmVkLFxuICAgICAgICAgICAgdmFsSXNOdWxsID0gdmFsdWUgPT09IG51bGwsXG4gICAgICAgICAgICB2YWxJc1JlZmxleGl2ZSA9IHZhbHVlID09PSB2YWx1ZSxcbiAgICAgICAgICAgIHZhbElzU3ltYm9sID0gaXNTeW1ib2wodmFsdWUpO1xuXG4gICAgICAgIHZhciBvdGhJc0RlZmluZWQgPSBvdGhlciAhPT0gdW5kZWZpbmVkLFxuICAgICAgICAgICAgb3RoSXNOdWxsID0gb3RoZXIgPT09IG51bGwsXG4gICAgICAgICAgICBvdGhJc1JlZmxleGl2ZSA9IG90aGVyID09PSBvdGhlcixcbiAgICAgICAgICAgIG90aElzU3ltYm9sID0gaXNTeW1ib2wob3RoZXIpO1xuXG4gICAgICAgIGlmICgoIW90aElzTnVsbCAmJiAhb3RoSXNTeW1ib2wgJiYgIXZhbElzU3ltYm9sICYmIHZhbHVlID4gb3RoZXIpIHx8XG4gICAgICAgICAgICAodmFsSXNTeW1ib2wgJiYgb3RoSXNEZWZpbmVkICYmIG90aElzUmVmbGV4aXZlICYmICFvdGhJc051bGwgJiYgIW90aElzU3ltYm9sKSB8fFxuICAgICAgICAgICAgKHZhbElzTnVsbCAmJiBvdGhJc0RlZmluZWQgJiYgb3RoSXNSZWZsZXhpdmUpIHx8XG4gICAgICAgICAgICAoIXZhbElzRGVmaW5lZCAmJiBvdGhJc1JlZmxleGl2ZSkgfHxcbiAgICAgICAgICAgICF2YWxJc1JlZmxleGl2ZSkge1xuICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICgoIXZhbElzTnVsbCAmJiAhdmFsSXNTeW1ib2wgJiYgIW90aElzU3ltYm9sICYmIHZhbHVlIDwgb3RoZXIpIHx8XG4gICAgICAgICAgICAob3RoSXNTeW1ib2wgJiYgdmFsSXNEZWZpbmVkICYmIHZhbEl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ICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICBsZW5ndGggPSBwcm9wcy5sZW5ndGg7XG5cbiAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgIHZhciBrZXkgPSBwcm9wc1tpbmRleF07XG5cbiAgICAgICAgdmFyIG5ld1ZhbHVlID0gY3VzdG9taXplclxuICAgICAgICAgID8gY3VzdG9taXplcihvYmplY3Rba2V5XSwgc291cmNlW2tleV0sIGtleSwgb2JqZWN0LCBzb3VyY2UpXG4gICAgICAgICAgOiB1bmRlZmluZWQ7XG5cbiAgICAgICAgaWYgKG5ld1ZhbHVlID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBuZXdWYWx1ZSA9IHNvdXJjZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc05ldykge1xuICAgICAgICAgIGJhc2VBc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGFzc2lnblZhbHVlKG9iamVjdCwga2V5LCBuZXdWYWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29waWVzIG93biBzeW1ib2xzIG9mIGBzb3VyY2VgIHRvIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gc291cmNlIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIGZyb20uXG4gICAgICogQHBhcmFtIHtPYmplY3R9IFtvYmplY3Q9e31dIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIHRvLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gY29weVN5bWJvbHMoc291cmNlLCBvYmplY3QpIHtcbiAgICAgIHJldHVybiB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iBhcnJMZW5ndGgpKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgIH1cbiAgICAgIC8vIENoZWNrIHRoYXQgY3ljbGljIHZhbHVlcyBhcmUgZXF1YWwuXG4gICAgICB2YXIgYXJyU3RhY2tlZCA9IHN0YWNrLmdldChhcnJheSk7XG4gICAgICB2YXIgb3RoU3RhY2tlZCA9IHN0YWNrLmdldChvdGhlcik7XG4gICAgICBpZiAoYXJyU3RhY2tlZCAmJiBvdGhTdGFja2VkKSB7XG4gICAgICAgIHJldHVybiBhcnJTdGFja2VkID09IG90aGVyICYmIG90aFN0YWNrZWQgPT0gYXJyYXk7XG4gICAgICB9XG4gICAgICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICByZXN1bHQgPSB0cnVlLFxuICAgICAgICAgIHNlZW4gPSAoYml0bWFzayAmIENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcpID8gbmV3IFNldENhY2hlIDogdW5kZWZpbmVkO1xuXG4gICAgICBzdGFjay5zZXQoYXJyYXksIG90aGVyKTtcbiAgICAgIHN0YWNrLnNldChvdGhlciwgYXJyYXkpO1xuXG4gICAgICAvLyBJZ25vcmUgbm9uLWluZGV4IHByb3BlcnRpZXMuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGFyckxlbmd0aCkge1xuICAgICAgICB2YXIgYXJyVmFsdWUgPSBhcnJheVtpbmRleF0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2luZGV4XTtcblxuICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgIHZhciBjb21wYXJlZCA9IGlzUGFydGlhbFxuICAgICAgICAgICAgPyBjdXN0b21pemVyKG90aFZhbHVlLCBhcnJWYWx1ZSwgaW5kZXgsIG90aGVyLCBhcnJheSwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIoYXJyVmFsdWUsIG90aFZhbHVlLCBpbmRleCwgYXJyYXksIG90aGVyLCBzdGFjayk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbXBhcmVkICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBpZiAoY29tcGFyZWQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIGFycmF5cyAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgICAgICBpZiAoc2Vlbikge1xuICAgICAgICAgIGlmICghYXJyYXlTb21lKG90aGVyLCBmdW5jdGlvbihvdGhWYWx1ZSwgb3RoSW5kZXgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWNhY2hlSGFzKHNlZW4sIG90aEluZGV4KSAmJlxuICAgICAgICAgICAgICAgICAgICAoYXJyVmFsdWUgPT09IG90aFZhbHVlIHx8IGVxdWFsRnVuYyhhcnJWYWx1ZSwgb3RoVmFsdWUsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIHN0YWNrKSkpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBzZWVuLnB1c2gob3RoSW5kZXgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSkpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKCEoXG4gICAgICAgICAgICAgIGFyclZhbHVlID09PSBvdGhWYWx1ZSB8fFxuICAgICAgICAgICAgICAgIGVxdWFsRnVuYyhhcnJWYWx1ZSwgb3RoVmFsdWUsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIHN0YWNrKVxuICAgICAgICAgICAgKSkge1xuICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAg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Y29uY2F0ZW5hdGVkIGFycmF5LlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiB2YXIgYXJyYXkgPSBbMV07XG4gICAgICogdmFyIG90aGVyID0gXy5jb25jYXQoYXJyYXksIDIsIFszXSwgW1s0XV0pO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob3RoZXIpO1xuICAgICAqIC8vID0+IFsxLCAyLCAzLCBbNF1dXG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhhcnJheSk7XG4gICAgICogLy8gPT4gWzFdXG4gICAgICovXG4gICAgZnVuY3Rpb24gY29uY2F0KCkge1xuICAgICAgdmFyIGxlbmd0aCA9IGFyZ3VtZW50cy5sZW5ndGg7XG4gICAgICBpZiAoIWxlbmd0aCkge1xuICAgICAgICByZXR1cm4gW107XG4gICAgICB9XG4gICAgICB2YXIgYXJncyA9IEFycmF5KGxlbmd0aCAtIDEpLFxuICAgICAgICAgIGFycmF5ID0gYXJndW1lbnRzWzBdLFxuICAgICAgICAgIGluZGV4ID0gbGVuZ3RoO1xuXG4gICAgICB3aGlsZSAoaW5kZXgtLSkge1xuICAgICAgICBhcmdzW2luZGV4IC0gMV0gPSBhcmd1bWVudHNbaW5kZXhdO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGFycmF5UHVzaChpc0FycmF5KGFycmF5KSA/IGNvcHlBcnJheShhcnJheSkgOiBbYXJyYXldLCBiYXNlRmxhdHRlbihhcmdzLCAxKSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhbiBhcnJheSBvZiBgYXJyYXlgIHZhbHVlcyBub3QgaW5jbHVkZWQgaW4gdGhlIG90aGVyIGdpdmVuIGFycmF5c1xuICAgICAqIHVzaW5nIFtgU2FtZVZhbHVlWmVyb2BdKGh0dHA6Ly9lY21hLWludGVybmF0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLXNhbWV2YWx1ZXplcm8pXG4gICAgICogZm9yIGVxdWFs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ZCBlbGVtZW50cy5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIGFycmF5ID0gWydhJywgJ2InLCAnYycsICdkJ107XG4gICAgICogdmFyIHB1bGxlZCA9IF8ucHVsbEF0KGFycmF5LCBbMSwgM10pO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXkpO1xuICAgICAqIC8vID0+IFsnYScsICdjJ11cbiAgICAgKlxuICAgICAqIGNvbnNvbGUubG9nKHB1bGxlZCk7XG4gICAgICogLy8gPT4gWydiJywgJ2QnXVxuICAgICAqL1xuICAgIHZhciBwdWxsQXQgPSBmbGF0UmVzdChmdW5jdGlvbihhcnJheSwgaW5kZXhlcykge1xuICAgICAgdmFyIGxlbmd0aCA9IGFycmF5ID09IG51bGwgPyAwIDogYXJyYXkubGVuZ3RoLFxuICAgICAgICAgIHJlc3VsdCA9IGJhc2VBdChhcnJheSwgaW5kZXhlcyk7XG5cbiAgICAgIGJhc2VQdWxsQXQoYXJyYXksIGFycmF5TWFwKGluZGV4ZXMsIGZ1bmN0aW9uKGluZGV4KSB7XG4gICAgICAgIHJldHVybiBpc0luZGV4KGluZGV4LCBsZW5ndGgpID8gK2luZGV4IDogaW5kZXg7XG4gICAgICB9KS5zb3J0KGNvbXBhcmVBc2NlbmRpbmcpKTtcblxuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9KTtcblxuICAgIC8qKlxuICAgICAqIFJlbW92ZXMgYWxsIGVsZW1lbnRzIGZyb20gYGFycmF5YCB0aGF0IGBwcmVkaWNhdGVgIHJldHVybnMgdHJ1dGh5IGZvclxuICAgICAqIGFuZCByZXR1cm5zIGFuIGFycmF5IG9mIHRoZSByZW1vdmVkIGVsZW1lbnRzLiBUaGUgcHJlZGljYXRlIGlzIGludm9rZWRcbiAgICAgKiB3aXRoIHRocmVlIGFyZ3VtZW50czogKHZhbHVlLCBpbmRleCwgYXJyYXkpLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFVubG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ICAgICAgICAgIGluZGV4ZXMgPSBbXSxcbiAgICAgICAgICBsZW5ndGggPSBhcnJheS5sZW5ndGg7XG5cbiAgICAgIHByZWRpY2F0ZSA9IGdldEl0ZXJhdGVlKHByZWRpY2F0ZSwgMyk7XG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgdmFsdWUgPSBhcnJheVtpbmRleF07XG4gICAgICAgIGlmIChwcmVkaWNhdGUodmFsdWUsIGluZGV4LCBhcnJheSkpIHtcbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgaW5kZXhlcy5wdXNoKGluZGV4KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgYmFzZVB1bGxBdChhcnJheSwgaW5kZXhlcyk7XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldmVyc2VzIGBhcnJheWAgc28gdGhhdCB0aGUgZmlyc3QgZWxlbWVudCBiZWNvbWVzIHRoZSBsYXN0LCB0aGUgc2Vjb25kXG4gICAgICogZWxlbWVudCBiZWNvbWVzIHRoZSBzZWNvbmQgdG8gbGFzdCwgYW5kIHNvIG9uLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFRoaXMgbWV0aG9kIG11dGF0ZXMgYGFycmF5YCBhbmQgaXMgYmFzZWQgb25cbiAgICAgKiBbYEFycmF5I3JldmVyc2VgXShodHRwczovL21kbi5pby9BcnJheS9yZXZlcnNlKS5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjAuMFxuICAgICAqIEBjYXRlZ29yeSBBcnJheVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBtb2RpZnkuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICogQGV4YW1wbGVcbiAgICA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pdCc6IDEwMDAgfSk7XG4gICAgICogdmFyIHNvdXJjZSA9IG5ldyBFdmVudFNvdXJjZSgnL3N0cmVhbScpO1xuICAgICAqIGpRdWVyeShzb3VyY2UpLm9uKCdtZXNzYWdlJywgZGVib3VuY2VkKTtcbiAgICAgKlxuICAgICAqIC8vIENhbmNlbCB0aGUgdHJhaWxpbmcgZGVib3VuY2VkIGludm9jYXRpb24uXG4gICAgICogalF1ZXJ5KHdpbmRvdykub24oJ3BvcHN0YXRlJywgZGVib3VuY2VkLmNhbmNlbCk7XG4gICAgICovXG4gICAgZnVuY3Rpb24gZGVib3VuY2UoZnVuYywgd2FpdCwgb3B0aW9ucykge1xuICAgICAgdmFyIGxhc3RBcmdzLFxuICAgICAgICAgIGxhc3RUaGlzLFxuICAgICAgICAgIG1heFdhaXQsXG4gICAgICAgICAgcmVzdWx0LFxuICAgICAgICAgIHRpbWVySWQsXG4gICAgICAgICAgbGFzdENhbGxUaW1lLFxuICAgICAgICAgIGxhc3RJbnZva2VUaW1lID0gMCxcbiAgICAgICAgICBsZWFkaW5nID0gZmFsc2UsXG4gICAgICAgICAgbWF4aW5nID0gZmFsc2UsXG4gICAgICAgICAgdHJhaWxpbmcgPSB0cnVlO1xuXG4gICAgICBpZiAodHlwZW9mIGZ1bmMgIT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKEZVTkNfRVJST1JfVEVYVCk7XG4gICAgICB9XG4gICAgICB3YWl0ID0gdG9OdW1iZXIod2FpdCkgfHwgMDtcbiAgICAgIGlmIChpc09iamVjdChvcHRpb25zKSkge1xuICAgICAgICBsZWFkaW5nID0gISFvcHRpb25zLmxlYWRpbmc7XG4gICAgICAgIG1heGluZyA9ICdtYXhXYWl0JyBpbiBvcHRpb25zO1xuICAgICAgICBtYXhXYWl0ID0gbWF4aW5nID8gbmF0aXZlTWF4KHRvTnVtYmVyKG9wdGlvbnMubWF4V2FpdCkgfHwgMCwgd2FpdCkgOi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FyIHRpbWUgPSBub3coKSxcbiAgICAgICAgICAgIGlzSW52b2tpbmcgPSBzaG91bGRJbnZva2UodGltZSk7XG5cbiAgICAgICAgbGFzdEFyZ3MgPSBhcmd1bWVudHM7XG4gICAgICAgIGxhc3RUaGlzID0gdGhpcztcbiAgICAgICAgbGFzdENhbGxUaW1lID0gdGltZTtcblxuICAgICAgICBpZiAoaXNJbnZva2luZykge1xuICAgICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBsZWFkaW5nRWRnZShsYXN0Q2FsbFRpbWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAobWF4aW5nKSB7XG4gICAgICAgICAgICAvLyBIYW5kbGUgaW52b2NhdGlvbnMgaW4gYSB0aWdodCBsb29wLlxuICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRpbWVySWQpO1xuICAgICAgICAgICAgdGltZXJJZCA9IHNldFRpbWVvdXQodGltZXJFeHBpcmVkLCB3YWl0KTtcbiAgICAgICAgICAgIHJldHVybiBpbnZva2VGdW5jKGxhc3RDYWxsVGltZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aW1lcklkID0gc2V0VGltZW91dCh0aW1lckV4cGlyZWQsIHdhaXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG4gICAgICBkZWJvdW5jZWQuY2FuY2VsID0gY2FuY2VsO1xuICAgICAgZGVib3VuY2VkLmZsdXNoID0gZmx1c2g7XG4gICAgICByZXR1cm4gZGVib3VuY2VkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIERlZmVycyBpbnZva2luZyB0aGUgYGZ1bmNgIHVudGlsIHRoZSBjdXJyZW50IGNhbGwgc3RhY2sgaGFzIGNsZWFyZWQuIEFueVxuICAgICAqIGFkZGl0aW9uYWwgYXJnd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IGNvbnZlcnQuXG4gICAgICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgY29udmVydGVkIGludGVnZXIuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udG9MZW5ndGgoMy4yKTtcbiAgICAgKiAvLyA9PiAzXG4gICAgICpcbiAgICAgKiBfLnRvTGVuZ3RoKE51bWJlci5NSU5fVkFMVUUpO1xuICAgICAqIC8vID0+IDBcbiAgICAgKlxuICAgICAqIF8udG9MZW5ndGgoSW5maW5pdHkpO1xuICAgICAqIC8vID0+IDQyOTQ5NjcyOTVcbiAgICAgKlxuICAgICAqIF8udG9MZW5ndGgoJzMuMicpO1xuICAgICAqIC8vID0+IDNcbiAgICAgKi9cbiAgICBmdW5jdGlvbiB0b0xlbmd0aCh2YWx1ZSkge1xuICAgICAgcmV0dXJuIHZhbHVlID8gYmFzZUNsYW1wKHRvSW50ZWdlcih2YWx1ZSksIDAsIE1BWF9BUlJBWV9MRU5HVEgpIDogMDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDb252ZXJ0cyBgdmFsdWVgIHRvIGEgbnVtYmVyLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGNhdGVnb3J5IExhbmdcbiAgICAgKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBwcm9jZXNzLlxuICAgICAqIEByZXR1cm5zIHtudW1iZXJ9IFJldHVybnMgdGhlIG51bWJlci5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogXy50b051bWJlcigzLjIpO1xuICAgICAqIC8vID0+IDMuMlxuICAgICAqXG4gICAgICogXy50b051bWJlcihOdW1iZXIuTUlOX1ZBTFVFKTtcbiAgICAgKiAvLyA9PiA1ZS0zMjRcbiAgICAgKlxuICAgICAqIF8udG9OdW1iZXIoSW5maW5pdHkpO1xuICAgICAqIC8vID0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HVybjtcbiAgICAgIH1cbiAgICAgIGZvciAodmFyIGtleSBpbiBzb3VyY2UpIHtcbiAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwoc291cmNlLCBrZXkpKSB7XG4gICAgICAgICAgYXNzaWduVmFsdWUob2JqZWN0LCBrZXksIHNvdXJjZVtrZXldKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgaXMgbGlrZSBgXy5hc3NpZ25gIGV4Y2VwdCB0aGF0IGl0IGl0ZXJhdGVzIG92ZXIgb3duIGFuZFxuICAgICAqIGluaGVyaXRlZCBzb3VyY2UgcHJvcGVydGllcy5cbiAgICAgKlxuICAgICAqICoqTm90ZToqKiBUaGlzIG1ldGhvZCBtdXRhdGVzIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGFsaWFzIGV4dGVuZFxuICAgICAqIEBjYXRlZ29yeSBPYmplY3RcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBkZXN0aW5hdGlvbiBvYmplY3QuXG4gICAgICogQHBhcmFtIHsuLi5PYmplY3R9IFtzb3VyY2VzXSBUaGUgc291cmNlIG9iamVjdHMuXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyBgb2JqZWN0YC5cbiAgICAgKiBAc2VlIF8uYXNzaWduXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIGZ1bmN0aW9uIEZvbygpIHtcbiAgICAgKiAgIHRoaXMuYSA9IDE7XG4gICAgICogfVxuICAgICAqXG4gICAgICogZnVuY3Rpb24gQmFyKCkge1xuICAgICAqICAgdGhpcy5jID0gMztcbiAgICAgKiB9XG4gICAgICpcbiAgICAgKiBGb28ucHJvdG90eXBlLmIgPSAyO1xuICAgICAqIEJhci5wcm90b3R5cGU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bGFjZShyZUVtcHR5U3RyaW5nTWlkZGxlLCAnJDEnKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nVHJhaWxpbmcsICckMTsnKTtcblxuICAgICAgLy8gRnJhbWUgY29kZSBhcyB0aGUgZnVuY3Rpb24gYm9keS5cbiAgICAgIHNvdXJjZSA9ICdmdW5jdGlvbignICsgKHZhcmlhYmxlIHx8ICdvYmonKSArICcpIHtcXG4nICtcbiAgICAgICAgKHZhcmlhYmxlXG4gICAgICAgICAgPyAnJ1xuICAgICAgICAgIDogJ29iaiB8fCAob2JqID0ge30pO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIFwidmFyIF9fdCwgX19wID0gJydcIiArXG4gICAgICAgIChpc0VzY2FwaW5nXG4gICAgICAgICAgID8gJywgX19lID0gXy5lc2NhcGUnXG4gICAgICAgICAgIDogJydcbiAgICAgICAgKSArXG4gICAgICAgIChpc0V2YWx1YXRpbmdcbiAgICAgICAgICA/ICcsIF9faiA9IEFycmF5LnByb3RvdHlwZS5qb2luO1xcbicgK1xuICAgICAgICAgICAgXCJmdW5jdGlvbiBwcmludCgpIHsgX19wICs9IF9fai5jYWxsKGFyZ3VtZW50cywgJycpIH1cXG5cIlxuICAgICAgICAgIDogJztcXG4nXG4gICAgICAgICkgK1xuICAgICAgICBzb3VyY2UgK1xuICAgICAgICAncmV0dXJuIF9fcFxcbn0nO1xuXG4gICAgICB2YXIgcmVzdWx0ID0gYXR0ZW1wdChmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIEZ1bmN0aW9uKGltcG9ydHNLZXlzLCBzb3VyY2VVUkwgKyAncmV0dXJuICcgKyBzb3VyY2UpXG4gICAgICAgICAgLmFwcGx5KHVuZGVmaW5lZCwgaW1wb3J0c1ZhbHVlcyk7XG4gICAgICB9KTtcblxuICAgICAgLy8gUHJvdmlkZSB0aGUgY29tcGlsZWQgZnVuY3Rpb24ncyBzb3VyY2UgYnkgaXRzIGB0b1N0cmluZ2Agb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qIC8vID0+IFsxLCAxLCAxXVxuICAgICAqXG4gICAgICogXy5yYW5nZVJpZ2h0KDApO1xuICAgICAqIC8vID0+IFtdXG4gICAgICovXG4gICAgdmFyIHJhbmdlUmlnaHQgPSBjcmVhdGVSYW5nZSh0cnVlKTtcblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgYXJyYXkuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4xMy4wXG4gICAgICogQGNhdGVnb3J5IFV0aWxcbiAgICAgKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBlbXB0eSBhcnJheS5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIGFycmF5cyA9IF8udGltZXMoMiwgXy5zdHViQXJyYXkpO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzKTtcbiAgICAgKiAvLyA9PiBbW10sIFtdXVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzWzBdID09PSBhcnJheXNbMV0pO1xuICAgICAqIC8vID0+IGZhbHNlXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkFycmF5KCkge1xuICAgICAgcmV0dXJuIFtdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYGZhbHNlYC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjEzLjBcbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGBmYWxzZWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udGltZXMoMiwgXy5zdHViRmFsc2UpO1xuICAgICAqIC8vID0+IFtmYWxzZSwgZmFsc2VdXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkZhbHNlKCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgb2JqZWN0LlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IGVtcHR5IG9iamVjdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIG9iamVjdHMgPSBfLnRpbWVzKDIsIF8uc3R1Yk9iamVjdCk7XG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhvYmplY3RzKTtcbiAgICAgKiAvLyA9PiBbe30sIHt9XVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob2JqZWN0c1swXSA9PT0gb2JqZWN0c1sxXSk7XG4gICAgICogLy8gPT4gZmFsc2VcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViT2JqZWN0KCkge1xuICAgICAgcmV0dXJuIHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYW4gZW1wdHkgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgZW1wdHkgc3RyaW5nLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRpbWVzKDIsIF8uc3R1YlN0cmluZyk7XG4gICAgICogLy8gPT4gWycnLCAnJ11cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzd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XG4gICAgICAgICAgICAvLyBSZS1hbGlnbiB0byBmb2xsb3cgY29tbW9ubWFyayBuZXN0aW5nIHJ1bGVzXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLnBlZGFudGljKSB7XG4gICAgICAgICAgICAgIG5leHRMaW5lID0gbmV4dExpbmUucmVwbGFjZSgvXiB7MSw0fSg/PSggezR9KSpbXiBdKS9nLCAnICAnKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRW5kIGxpc3QgaXRlbSBpZiBmb3VuZCBjb2RlIGZlbmNlc1xuICAgICAgICAgICAgaWYgKGZlbmNlc0JlZ2luUmVnZXgudGVzdChuZXh0TGluZSkpIHtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEVuZCBsaXN0IGl0ZW0gaWYgZm91bmQgc3RhcnQgb2YgbmV3IGhlYWRpbmdcbiAgICAgICAgICAgIGlmIChoZWFkaW5nQmVnaW5SZWdleC50ZXN0KG5leHRMaW5lKSkge1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRW5kIGxpc3QgaXRlbSBpZiBmb3VuZCBzdGFydCBvZiBuZXcgYnVsbGV0XG4gICAgICAgICAgICBpZiAobmV4dEJ1bGxldFJlZ2V4LnRlc3QobmV4dExpbmUpKSB7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBIb3Jpem9udGFsIHJ1bGUgZm91bmRcbiAgICAgICAgICAgIGlmIChoclJlZ2V4LnRlc3Qoc3JjKSkge1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChuZXh0TGluZS5zZWFyY2goL1teIF0vKSA+PSBpbmRlbnQgfHwgIW5leHRMaW5lLnRyaW0oKSkge1xuICAgICAgICAgICAgICAvLyBEZWRlbnQgaWYgcG9zc2libGVcbiAgICAgICAgICAgICAgaXRlbUNvbnRlbnRzICs9ICdcXG4nICsgbmV4dExpbmUuc2xpY2UoaW5kZW50KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIC8vIG5vdCBlbm91Z2ggaW5kZW50YXRpb25cbiAgICAgICAgICAgICAgaWYgKGJsYW5rTGluZSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gcGFyYWdyYXBoIGNvbnRpbnVhdGlvbiB1bmxlc3MgbGFzdCBsaW5lIHdhcyBhIGRpZmZlcmVudCBibG9jayBsZXZlbCBlbGVtZW50XG4gICAgICAgICAgICAgIGlmIChsaW5lLnNlYXJjaCgvW14gXS8pID49IDQpIHtcbiAgICAgICAgICAgICAgICAvLyBpbmRlbnRlZCBjb2RlIGJsb2NrXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGZlbmNlc0JlZ2luUmVnZXgudGVzdChsaW5lKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChoZWFkaW5nQmVnaW5SZWdleC50ZXN0KGxpbmUpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGhyUmVnZXgudGVzdChsaW5lKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGl0ZW1Db250ZW50cyArPSAnXFxuJyArIG5leHRMaW5lO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFibGFua0xpbmUgJiYgIW5leHRMaW5lLnRyaW0oKSkge1xuICAgICAgICAgICAgICAvLyBDaGVjayBpZiBjdXJyZW50IGxpbmUgaXMgYmxhbmtcbiAgICAgICAgICAgICAgYmxhbmtMaW5lID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJhdyArPSByYXdMaW5lICsgJ1xcbic7XG4gICAgICAgICAgICBzcmMgPSBzcmMuc3Vic3RyaW5nKHJhd0xpbmUubGVuZ3RoICsgMSk7XG4gICAgICAgICAgICBsaW5lID0gbmV4dExpbmUuc2xpY2UoaW5kZW50KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFsaXN0Lmxvb3NlKSB7XG4gICAgICAgICAgLy8gSWYgdGhlIHByZXZpb3VzIGl0ZW0gZW5kZWQgd2l0aCBhIGJsYW5rIGxpbmUsIHRoZSBsaXN0IGlzIGxvb3NlXG4gICAgICAgICAgaWYgKGVuZHNXaXRoQmxhbmtMaW5lKSB7XG4gICAgICAgICAgICBsaXN0Lmxvb3NlID0gdHJ1ZTtcbiAgICAgICAgICB9IGVsc2UgaWYgKC9cXG4gKlxcbiAqJC8udGVzdChyYXcpKSB7XG4gICAgICAgICAgICBlbmRzV2l0aEJsYW5rTGluZSA9IHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ2hlY2sgZm9yIHRhc2sgbGlzdCBpdGVtc1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmdmbSkge1xuICAgICAgICAgIGlzdGFzayA9IC9eXFxbWyB4WF1cXF0gLy5leGVjKGl0ZW1Db250ZW50cyk7XG4gICAgICAgICAgaWYgKGlzdGFzaykge1xuICAgICAgICAgICAgaXNjaGVja2VkID0gaXN0YXNrWzBdICE9PSAnWyBdICc7XG4gICAgICAgICAgICBpdGVtQ29udGVudHMgPSBpdGVtQ29udGVudHMucmVwbGFjZSgvXlxcW1sgeFhdXFxdICsvLCAnJyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxpc3QuaXRlbXMucHVzaCh7XG4gICAgICAgICAgdHlwZTogJ2xpc3RfaXRlbScsXG4gICAgICAgICAgcmF3OiByYX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ZW0uYWxpZ25baV0gPSAnY2VudGVyJztcbiAgICAgICAgICB9IGVsc2UgaWYgKC9eICo6LSsgKiQvLnRlc3QoaXRlbS5hbGlnbltpXSkpIHtcbiAgICAgICAgICAgIGl0ZW0uYWxpZ25baV0gPSAnbGVmdCc7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGl0ZW0uYWxpZ25baV0gPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsID0gaXRlbS5yb3dzLmxlbmd0aDtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGw7IGkrKykge1xuICAgICAgICAgIGl0ZW0ucm93c1tpXSA9IHNwbGl0Q2VsbHMoaXRlbS5yb3dzW2ldLCBpdGVtLmhlYWRlci5sZW5ndGgpLm1hcChmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgdGV4dDogY1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHBhcnNlIGNoaWxkIHRva2VucyBpbnNpZGUgaGVhZGVycyBhbmQgY2VsbHNcblxuICAgICAgICAvLyBoZWFkZXIgY2hpbGQgdG9rZW5zXG4gICAgICAgIGwgPSBpdGVtLmhlYWRlci5sZW5ndGg7XG4gICAgICAgIGZvciAoaiA9IDA7IGogPCBsOyBqKyspIHtcbiAgICAgICAgICBpdGVtLmhlYWRlcltqXS50b2tlbnMgPSB0aGlzLmxleGVyLmlubGluZShpdGVtLmhlYWRlcltqXS50ZXh0KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGNlbGwgY2hpbGQgdG9rZW5zXG4gICAgICAgIGwgPSBpdGVtLnJvd3MubGVuZ3RoO1xuICAgICAgICBmb3IgKGogPSAwOyBqIDwgbDsgaisrKSB7XG4gICAgICAgICAgcm93ID0gaXRlbS5yb3dzW2pdO1xuICAgICAgICAgIGZvciAoayA9IDA7IGsgPCByb3cubG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ZSBicmFja2V0c1xuICAgICAgICBpZiAoIS8+JC8udGVzdCh0cmltbWVkVXJsKSkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGVuZGluZyBhbmdsZSBicmFja2V0IGNhbm5vdCBiZSBlc2NhcGVkXG4gICAgICAgIHZhciBydHJpbVNsYXNoID0gcnRyaW0odHJpbW1lZFVybC5zbGljZSgwLCAtMSksICdcXFxcJyk7XG4gICAgICAgIGlmICgodHJpbW1lZFVybC5sZW5ndGggLSBydHJpbVNsYXNoLmxlbmd0aCkgJSAyID09PSAwKSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBmaW5kIGNsb3NpbmcgcGFyZW50aGVzaXNcbiAgICAgICAgdmFyIGxhc3RQYXJlbkluZGV4ID0gZmluZENsb3NpbmdCcmFja2V0KGNhcFsyXSwgJygpJyk7XG4gICAgICAgIGlmIChsYXN0UGFyZW5JbmRleCA+IC0xKSB7XG4gICAgICAgICAgdmFyIHN0YXJ0ID0gY2FwWzBdLmluZGV4T2YoJyEnKSA9PT0gMCA/IDUgOiA0O1xuICAgICAgICAgIHZhciBsaW5rTGVuID0gc3RhcnQgKyBjYXBbMV0ubGVuZ3RoICsgbGFzdFBhcmVuSW5kZXg7XG4gICAgICAgICAgY2FwWzJdID0gY2FwWzJdLnN1YnN0cmluZygwLCBsYXN0UGFyZW5JbmRleCk7XG4gICAgICAgICAgY2FwWzBdID0gY2FwWzBdLnN1YnN0cmluZygwLCBsaW5rTGVuKS50cmltKCk7XG4gICAgICAgICAgY2FwWzNdID0gJyc7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBocmVmID0gY2FwWzJdO1xuICAgICAgdmFyIHRpdGxlID0gJyc7XG4gICAgICBpZiAodGhpcy5vcHRpb25zLnBlZGFudGljKSB7XG4gICAgICAgIC8vIHNwbGl0IHBlZGFudGljIGhyZWYgYW5kI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cXHVEQzM4XFx1REMzQ1xcdURDM0YtXFx1REM1NVxcdURDNTgtXFx1REM3NlxcdURDNzktXFx1REM5RVxcdURDQTctXFx1RENBRlxcdURDRTAtXFx1RENGMlxcdURDRjRcXHVEQ0Y1XFx1RENGQi1cXHVERDFCXFx1REQyMC1cXHVERDM5XFx1REQ4MC1cXHVEREI3XFx1RERCQy1cXHVERENGXFx1REREMi1cXHVERTAwXFx1REUxMC1cXHVERTEzXFx1REUxNS1cXHVERTE3XFx1REUxOS1cXHVERTM1XFx1REU0MC1cXHVERTQ4XFx1REU2MC1cXHVERTdFXFx1REU4MC1cXHVERTlGXFx1REVDMC1cXHVERUM3XFx1REVDOS1cXHVERUU0XFx1REVFQi1cXHVERUVGXFx1REYwMC1cXHVERjM1XFx1REY0MC1cXHVERjU1XFx1REY1OC1cXHVERjcyXFx1REY3OC1cXHVERjkxXFx1REZBOS1cXHVERkFGXXxcXHVEODAzW1xcdURDMDAtXFx1REM0OFxcdURDODAtXFx1RENCMlxcdURDQzAtXFx1RENGMlxcdURDRkEtXFx1REQyM1xcdUREMzAtXFx1REQzOVxcdURFNjAtXFx1REU3RVxcdURFODAtXFx1REVBOVxcdURFQjBcXHVERUIxXFx1REYwMC1cXHVERjI3XFx1REYzMC1cXHVERjQ1XFx1REY1MS1cXHVERjU0XFx1REY3MC1cXHVERjgxXFx1REZCMC1cXHVERkNCXFx1REZFMC1cXHVERkY2XXxcXHVEODA0W1xcdURDMDMtXFx1REMzN1xcdURDNTItXFx1REM2RlxcdURDNzFcXHVEQzcyXFx1REM3NVxcdURDODMtXFx1RENBRlxcdURDRDAtXFx1RENFOFxcdURDRjAtXFx1RENGOVxcdUREMDMtXFx1REQyNlxcdUREMzYtXFx1REQzRlxcdURENDRcXHVERDQ3XFx1REQ1MC1cXHVERDcyXFx1REQ3NlxcdUREODMtXFx1RERCMlxcdUREQzEtXFx1RERDNFxcdURERDAtXFx1REREQVxcdURERENcXHVEREUxLVxcdURERjRcXHVERTAwLVxcdURFMTFcXHVERTEzLVxcdURFMkJcXHVERTgwLVxcdURFODZcXHVERTg4XFx1REU4QS1cXHVERThEXFx1REU4Ri1cXHVERTlEXFx1REU5Ri1cXHVERUE4XFx1REVCMC1cXHVERURFXFx1REVGMC1cXHVERUY5XFx1REYwNS1cXHVERjBDXFx1REYwRlxcdURGMTBcXHVERjEzLVxcdURGMjhcXHVERjJBLVxcdURGMzBcXHVERjMyXFx1REYzM1xcdURGMzUtXFx1REYzOVxcdURGM0RcXHVERjUwXFx1REY1RC1cXHVERjYxXXxcXHVEODA1W1xcdURDMDAtXFx1REMzNFxcdURDNDctXFx1REM0QVxcdURDNTAtXFx1REM1OVxcdURDNUYtXFx1REM2MVxcdURDODAtXFx1RENBRlxcdURDQzRcXHVEQ0M1XFx1RENDN1xcdURDRDAtXFx1RENEOVxcdUREODAtXFx1RERBRVxcdURERDgtXFx1REREQlxcdURFMDAtXFx1REUyRlxcdURFNDRcXHVERTUwLVxcdURFNTlcXHVERTgwLVxcdURFQUFcXHVERUI4XFx1REVDMC1cXHVERUM5XFx1REYwMC1cXHVERjFBXFx1REYzMC1cXHVERjNCXFx1REY0MC1cXHVERjQ2XXxcXHVEODA2W1xcdURDMDAtXFx1REMyQlxcdURDQTAtXFx1RENGMlxcdURDRkYtXFx1REQwNlxcdUREMDlcXHVERDBDLVxcdUREMTNcXHVERDE1XFx1REQxNlxcdUREMTgtXFx1REQyRlxcdUREM0ZcXHVERDQxXFx1REQ1MC1cXHVERDU5XFx1RERBMC1cXHVEREE3XFx1RERBQS1cXHVEREQwXFx1RERFMVxcdURERTNcXHVERTAwXFx1REUwQi1cXHVERTMyXFx1REUzQVxcdURFNTBcXHVERTVDLVxcdURFODlcXHVERTlEXFx1REVCMC1cXHVERUY4XXxcXHVEODA3W1xcdURDMDAtXFx1REMwOFxcdURDMEEtXFx1REMyRVxcdURDNDBcXHVEQzUwLVxcdURDNkNcXHVEQzcyLVxcdURDOEZcXHVERDAwLVxcdUREMDZcXHVERDA4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iAgKDUpIGFuZCAoNikgY2FuIGJlIGVpdGhlciBMZWZ0IG9yIFJpZ2h0LlxuICAgIC8vICAgICAgICAgICgpIFNraXAgb3JwaGFuIGluc2lkZSBzdHJvbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgpIENvbnN1bWUgdG8gZGVsaW0gICAgICgxKSAjKioqICAgICAgICAgICAgICAgICgyKSBhKioqIywgYSoqKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDMpICMqKiphLCAqKiphICAgICAgICAgICAgICAgICAoNCkgKioqIyAgICAgICAgICAgICAgKDUpICMqKiojICAgICAgICAgICAgICAgICAoNikgYSoqKmFcbiAgICByRGVsaW1Bc3Q6IC9eKD86W15fKlxcXFxdfFxcXFwuKSo/XFxfXFxfKD86W15fKlxcXFxdfFxcXFwuKSo/XFwqKD86W15fKlxcXFxdfFxcXFwuKSo/KD89XFxfXFxfKXwoPzpbXipcXFxcXXxcXFxcLikrKD89W14qXSl8W3B1bmN0X10oXFwqKykoPz1bXFxzXXwkKXwoPzpbXnB1bmN0Kl9cXHNcXFxcXXxcXFxcLikoXFwqKykoPz1bcHVuY3RfXFxzXXwkKXxbcHVuY3RfXFxzXShcXCorKSg/PVtecHVuY3QqX1xcc10pfFtcXHNdKFxcKispKD89W3B1bmN0X10pfFtwdW5jdF9dKFxcKispKD89W3B1bmN0X10pfCg/OltecHVuY3QqX1xcc1xcXFxdfFxcXFwuKShcXCorKSg/PVtecHVuY3QqX1xcc10pLyxcbiAgICByRGVsaW1VbmQ6IC9eKD86W15fKlxcXFxdfFxcXFwuKSo/XFwqXFwqKD86W15fKlxcXFxdfFxcXFwuKSo/XFxfKD86W15fKlxcXFxdfFxcXFwuKSo/KD89XFwqXFwqKXwoPzpbXl9cXFxcXXxcXFxcLikrKD89W15fXSl8W3B1bmN0Kl0oXFxfKykoPz1bXFxzXXwkKXwoPzpbXnB1bmN0Kl9cXHNcXFxcXXxcXFxcLikoXFxfKykoPz1bcHVuY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W9ucy50b2tlbml6ZXIgfHwgbmV3IFRva2VuaXplcigpO1xuICAgIHRoaXMudG9rZW5pemVyID0gdGhpcy5vcHRpb25zLnRva2VuaXplcjtcbiAgICB0aGlzLnRva2VuaXplci5vcHRpb25zID0gdGhpcy5vcHRpb25zO1xuICAgIHRoaXMudG9rZW5pemVyLmxleGVyID0gdGhpcztcbiAgICB0aGlzLmlubGluZVF1ZXVlID0gW107XG4gICAgdGhpcy5zdGF0ZSA9IHtcbiAgICAgIGluTGluazogZmFsc2UsXG4gICAgICBpblJhd0Jsb2NrOiBmYWxzZSxcbiAgICAgIHRvcDogdHJ1ZVxuICAgIH07XG4gICAgdmFyIHJ1bGVzID0ge1xuICAgICAgYmxvY2s6IGJsb2NrLm5vcm1hbCxcbiAgICAgIGlubGluZTogaW5saW5lLm5vcm1hbFxuICAgIH07XG4gICAgaWYgKHRoaXMub3B0aW9ucy5wZWRhbnRpYykge1xuICAgICAgcnVsZXMuYmxvY2sgPSBibG9jay5wZWRhbnRpYztcbiAgICAgIHJ1bGVzLmlubGluZSA9IGlubGluZS5wZWRhbnRpYztcbiAgICB9IGVsc2UgaWYgKHRoaXMub3B0aW9ucy5nZm0pIHtcbiAgICAgIHJ1bGVzLmJsb2NrID0gYmxvY2suZ2ZtO1xuICAgICAgaWYgKHRoaXMub3B0aW9ucy5icmVha3MpIHtcbiAgICAgICAgcnVsZXMuaW5saW5lID0gaW5saW5lLmJyZWFrcztcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJ1bGVzLmlubGluZSA9IGlubGluZS5nZm07XG4gICAgICB9XG4gICAgfVxuICAgIHRoaXMudG9rZW5pemVyLnJ1bGVzID0gcnVsZXM7XG4gIH1cblxuICAvKipcbiAgICogRXhwb3NlIFJ1bGVzXG4gICAqL1xuICAvKipcbiAgICogU3RhdGljIExleCBNZXRob2RcbiAgICovXG4gIExleGVyLmxleCA9IGZ1bmN0aW9uIGxleChzcmMsIG9wdGlvbnMpIHtcbiAgICB2YXIgb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2Vucy5wdXNoKHRva2VuKTtcbiAgICAgICAgfVxuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgLy8gZmVuY2VzXG4gICAgICBpZiAodG9rZW4gPSB0aGlzLnRva2VuaXplci5mZW5jZXMoc3JjKSkge1xuICAgICAgICBzcmMgPSBzcmMuc3Vic3RyaW5nKHRva2VuLnJhdy5sZW5ndGgpO1xuICAgICAgICB0b2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuXG4gICAgICAvLyBoZWFkaW5nXG4gICAgICBpZiAodG9rZW4gPSB0aGlzLnRva2VuaXplci5oZWFkaW5nKHNyYykpIHtcbiAgICAgICAgc3JjID0gc3JjLnN1YnN0cmluZyh0b2tlbi5yYXcubGVuZ3RoKTtcbiAgICAgICAgdG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgLy8gaHJcbiAgICAgIGlmICh0b2tlbiA9IHRoaXMudG9rZW5pemVyLmhyKHNyYykpIHtcbiAgICAgICAgc3JjID0gc3JjLnN1YnN0cmluZyh0b2tlbi5yYXcubGVuZ3RoKTtcbiAgICAgICAgdG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgLy8gYmxvY2txdW90ZVxuICAgICAgaWYgKHRva2VuID0gdGhpcy50b2tlbml6ZXIuYmxvY2txdW90ZShzcmMpKSB7XG4gICAgICAgIHNyYyA9IHNyYy5zdWJzdHJpbmcodG9rZW4ucmF3Lmxlbmd0aCk7XG4gICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIC8vIGxpc3RcbiAgICAgIGlmICh0b2tlbiA9IHRoaXMudG9rZW5pemVyLmxpc3Qoc3JjKSkge1xuICAgICAgICBzcmMgPSBzcmMuc3Vic3RyaW5nKHRva2VuLnJhdy5sZW5ndGgpO1xuICAgICAgICB0b2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuXG4gICAgICAvLyBodG1sXG4gICAgICBpZiAodG9rZW4gPSB0aGlzLnRva2VuaXplci5odG1sKHNyYykpIHtcbiAgICAgICAgc3JjID0gc3JjLnN1YnN0cmluZyh0b2tlbi5yYXcubGVuZ3RoKTtcbiAgICAgICAgdG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgLy8gZGVmXG4gICAgICBpZiAodG9rZW4gPSB0aGlzLnRva2VuaXplci5kZWYoc3JjKSkge1xuICAgICAgICBzcmMgPSBzcmMuc3Vic3RyaW5nKHRva2VuLnJhdy5sZW5ndGgpO1xuICAgICAgICBsYXN0VG9rZW4gPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICBpZiAobGFzdFRva2VuICYmIChsYXN0VG9rZW4udHlwZSA9PT0gJ3BhcmFncmFwaCcgfHwgbGFzdFRva2VuLnR5cGUgPT09ICd0ZXh0JykpIHtcbiAgICAgICAgICBsYXN0VG9rZW4ucmF3ICs9ICdcXG4nICsgdG9rZW4ucmF3O1xuICAgICAgICAgIGxhc3RUb2tlbi50ZXh0ICs9ICdcXG4nICsgdG9rZW4ucmF3O1xuICAgICAgICAgIHRoaXMuaW5saW5lUXVldWVbdGhpcy5pbmxpbmVRdWV1ZS5sZW5ndGggLSAxXS5zcmMgPSBsYXN0VG9rZW4udGV4dDtcbiAgICAgICAgfSBlbHNlIGlmICghdGhpcy50b2tlbnMubGlua3NbdG9rZW4udGFnXSkge1xuICAgICAgICAgIHRoaXMudG9rZW5zLmxpbmtzW3Rva2VuLnRhZ10gPSB7XG4gICAgICAgICAgICBocmVmOiB0b2tlbi5ocmVmLFxuICAgICAgICAgICAgdGl0bGU6IHRva2VuLnRpdGxlXG4gICAgICAgICAgfTtcbiAgICAgICAgfVx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gc3JjID0gc3JjLnN1YnN0cmluZyh0b2tlbi5yYXcubGVuZ3RoKTtcbiAgICAgICAgdG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICBjb250aW51ZTtcbiAgICAgIH1cblxuICAgICAgLy8gdGFnXG4gICAgICBpZiAodG9rZW4gPSB0aGlzLnRva2VuaXplci50YWcoc3JjKSkge1xuICAgICAgICBzcmMgPSBzcmMuc3Vic3RyaW5nKHRva2VuLnJhdy5sZW5ndGgpO1xuICAgICAgICBsYXN0VG9rZW4gPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdO1xuICAgICAgICBpZiAobGFzdFRva2VuICYmIHRva2VuLnR5cGUgPT09ICd0ZXh0JyAmJiBsYXN0VG9rZW4udHlwZSA9PT0gJ3RleHQnKSB7XG4gICAgICAgICAgbGFzdFRva2VuLnJhdyArPSB0b2tlbi5yYXc7XG4gICAgICAgICAgbGFzdFRva2VuLnRleHQgKz0gdG9rZW4udGV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0b2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgIH1cbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIC8vIGxpbmtcbiAgICAgIGlmICh0b2tlbiA9IHRoaXMudG9rZW5pemVyLmxpbmsoc3JjKSkge1xuICAgICAgICBzcmMgPSBzcmMuc3Vic3RyaW5nKHRva2VuLnJhdy5sZW5ndGgpO1xuICAgICAgICB0b2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuXG4gICAgICAvLyByZWZsaW5rLCBub2xpbmtcbiAgICAgIGlmICh0b2tlbiA9IHRoaXMudG9rZW5pemVyLnJlZmxpbmsoc3JjLCB0aGlzLnRva2Vucy5saW5rcykpIHtcbiAgICAgICAgc3JjID0gc3JjLnN1YnN0cmluZyh0b2tlbi5yYXcubGVuZ3RoKTtcbiAgICAgICAgbGFzdFRva2VuID0gdG9rZW5zW3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9rZW4sXG4gICAgICBvcmRlcmVkLFxuICAgICAgc3RhcnQsXG4gICAgICBsb29zZSxcbiAgICAgIGl0ZW1Cb2R5LFxuICAgICAgaXRlbSxcbiAgICAgIGNoZWNrZWQsXG4gICAgICB0YXNrLFxuICAgICAgY2hlY2tib3gsXG4gICAgICByZXQ7XG4gICAgdmFyIGwgPSB0b2tlbnMubGVuZ3RoO1xuICAgIGZvciAoaSA9IDA7IGkgPCBsOyBpKyspIHtcbiAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuXG4gICAgICAvLyBSdW4gYW55IHJlbmRlcmVyIGV4dGVuc2lvbnNcbiAgICAgIGlmICh0aGlzLm9wdGlvbnMuZXh0ZW5zaW9ucyAmJiB0aGlzLm9wdGlvbnMuZXh0ZW5zaW9ucy5yZW5kZXJlcnMgJiYgdGhpcy5vcHRpb25zLmV4dGVuc2lvbnMucmVuZGVyZXJzW3Rva2VuLnR5cGVdKSB7XG4gICAgICAgIHJldCA9IHRoaXMub3B0aW9ucy5leHRlbnNpb25zLnJlbmRlcmVyc1t0b2tlbi50eXBlXS5jYWxsKHtcbiAgICAgICAgICBwYXJzZXI6IHRoaXNcbiAgICAgICAgfSwgdG9rZW4pO1xuICAgICAgICBpZiAocmV0ICE9PSBmYWxzZSB8fCAhWydzcGFjZScsICdocicsICdoZWFkaW5nJywgJ2NvZGUnLCAndGFibGUnLCAnYmxvY2txdW90ZScsICdsaXN0JywgJ2h0bWwnLCAncGFyYWdyYXBoJywgJ3RleHQnXS5pbmNsdWRlcyh0b2tlbi50eXBlKSkge1xuICAgICAgICAgIG91dCArPSByZXQgfHwgJyc7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHN3aXRjaCAodG9rZW4udHlwZSkge1xuICAgICAgICBjYXNlICdzcGFjZSc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdocic6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHRoaXMucmVuZGVyZXIuaHIoKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAnaGVhZGluZyc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHRoaXMucmVuZGVyZXIuaGVhZGluZyh0aGlzLnBhcnNlSW5saW5lKHRva2VuLnRva2VucyksIHRva2VuLmRlcHRoLCB1bmVzY2FwZSh0aGlzLnBhcnNlSW5saW5lKHRva2VuLnRva2VucywgdGhpcy50ZXh0UmVuZGVyZXIpKSwgdGhpcy5zbHVnZ2VyKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAnY29kZSc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHRoaXMucmVuZGVyZXIuY29kZSh0b2tlbi50ZXh0LCB0b2tlbi5sYW5nLCB0b2tlbi5lc2NhcGVkKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAndGFibGUnOlxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGhlYWRlciA9ICcnO1xuXG4gICAgICAgICAgICAvLyBoZWFkZXJcbiAgICAgICAgICAgIGNlbGwgPSAnJztcbiAgICAgICAgICAgIGwyID0gdG9rZW4uaGVhZGVyLmxlbmd0aDtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsMjsgaisrKSB7XG4gICAgICAgICAgICAgIGNlbGwgKz0gdGhpcy5yZW5kZXJlci50YWJsZWNlbGwodGhpcy5wYXJzZUlubGluZSh0b2tlbi5oZWFkZXJbal0udG9rZW5zKSwge1xuICAgICAgICAgICAgICAgIGhlYWRlcjogdHJ1ZSxcbiAgICAgICAgICAgICAgICBhbGlnbjogdG9rZW4uYWxpZ25bal1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXIgKz0gdGhpcy5yZW5kZXJlci50YWJsZXJvdyhjZWxsKTtcbiAgICAgICAgICAgIGJvZHkgPSAnJztcbiAgICAgICAgICAgIGwyID0gdG9rZW4ucm93cy5sZW5ndGg7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbDI7IGorKykge1xuICAgICAgICAgICAgICByb3cgPSB0b2tlbi5yb3dzW2pdO1xuICAgICAgICAgICAgICBjZWxsID0gJyc7XG4gICAgICAgICAgICAgIGwzID0gcm93Lmxlbmd0aDtcbiAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IGwzOyBrKyspIHtcbiAgICAgICAgICAgICAgICBjZWxsICs9IHRoaXMucmVuZGVyZXIudGFibGVjZWxsKHRoaXMucGFyc2VJbmxpbmUocm93W2tdLnRva2VucyksIHtcbiAgICAgICAgICAgICAgICAgIGhlYWRlcjogZmFsc2UsXG4gICAgICAgICAgICAgICAgICBhbGlnbjogdG9rZW4uYWxpZ25ba11cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBib2R5ICs9IHRoaXMucmVuZGVyZXIudGFibGVyb3coY2VsbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBvdXQgKz0gdGhpcy5yZW5kZXJlci50YWJsZShoZWFkZXIsIGJvZHkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdibG9ja3F1b3RlJzpcbiAgICAgICAgICB7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5wYXJzZSh0b2tlbi50b2tlbnMpO1xuICAgICAgICAgICAgb3V0ICs9IHRoaXMucmVuZGVyZXIuYmxvY2txdW90ZShib2R5KTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAnbGlzdCc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3JkZXJlZCA9IHRva2VuLm9yZGVyZWQ7XG4gICAgICAgICAgICBzdGFydCA9IHRva2VuLnN0YXJ0O1xuICAgICAgICAgICAgbG9vc2UgPSB0b2tlbi5sb29zZTtcbiAgICAgICAgICAgIGwyID0gdG9rZW4uaXRlbXMubGVuZ3RoO1xuICAgICAgICAgICAgYm9keSA9ICcnO1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGwyOyBqKyspIHtcbiAgICAgICAgICAgICAgaXRlbSA9IHRva2VuLml0ZW1zW2pdO1xuICAgICAgICAgICAgICBjaGVja2VkID0gaXRlbS5jaGVja2VkO1xuICAgICAgICAgICAgICB0YXNrID0gaXRlbS50YXNrO1xuICAgICAgICAgICAgICBpdGVtQm9keSA9ICcnO1xuICAgICAgICAgICAgICBpZiAoaXRlbS50YXNrKSB7XG4gICAgICAgICAgICAgICAgY2hlY2tib3ggPSB0aGlzLnJlbmRlcmVyLmNoZWNrYm94KGNoZWNrZWQpO1xuICAgICAgICAgICAgICAgIGlmIChsb29zZSkge1xuICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0udG9rZW5zLmxlbmd0aCA+IDAgJiYgaXRlbS50b2tlbnNbMF0udHlwZSA9PT0gJ3BhcmFncmFwaCcpIHtcbiAgICAgICAgICAgICAgICAgICAgaXRlbS50b2tlbnNbMF0udGV4dCA9IGNoZWNrYm94ICsgJyAnICsgaXRlbS50b2tlbnNbMF0udGV4dDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0udG9rZW5zWzBdLnRva2VucyAmJiBpdGVtLnRva2Vuc1swXS50b2tlbnMubGVuZ3RoID4gMCAmJiBpdGVtLnRva2Vuc1swXS50b2tlbnNbMF0udHlwZSA9PT0gJ3RleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgaXRlbS50b2tlbnNbMF0udG9rZW5zWzBdLnRleHQgPSBjaGVja2JveCArICcgJyArIGl0ZW0udG9rZW5zWzBdLnRva2Vuc1swXS50ZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpdGVtLnRva2Vucy51bnNoaWZ0KHtcbiAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAndGV4dCcsXG4gICAgICAgICAgICAgICAgICAgICAgdGV4dDogY2hlY2tib3hcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGl0ZW1Cb2R5ICs9IGNoZWNrYm94O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpdGVtQm9keSArPSB0aGlzLnBhcnNlKGl0ZW0udG9rZW5zLCBsb29zZSk7XG4gICAgICAgICAgICAgIGJvZHkgKz0gdGhpcy5yZW5kZXJlci5saXN0aXRlbShpdGVtQm9keSwgdGFzaywgY2hlY2tlZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBvdXQgKz0gdGhpcy5yZW5kZXJlci5saXN0KGJvZHksIG9yZGVyZWQsIHN0YXJ0KTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAnaHRtbCc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgLy8gVE9ETyBwYXJzZSBpbmxpbmUgY29udGVudCBpZiBwYXJhbWV0ZXIgbWFya2Rvd249MVxuICAgICAgICAgICAgb3V0ICs9IHRoaXMucmVuZGVyZXIuaHRtbCh0b2tlbi50ZXh0KTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAncGFyYWdyYXBoJzpcbiAgICAgICAgICB7XG4gICAgICAgICAgICBvdXQgKz0gdGhpcy5yZW5kZXJlci5wYXJhZ3JhcGgodGhpcy5wYXJzZUlubGluZSh0b2tlbi50b2tlbnMpKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAndGV4dCc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgYm9keSA9IHRva2VuLnRva2VucyA/IHRoaXMucGFyc2VJbmxpbmUodG9rZW4udG9rZW5zKSA6IHRva2VuLnRleHQ7XG4gICAgICAgICAgICB3aGlsZSAoaSArIDEgPCBsICYmIHRva2Vuc1tpICsgMV0udHlwZSA9PT0gJ3RleHQnKSB7XG4gICAgICAgICAgICAgIHRva2VuID0gdG9rZW5zWysraV07XG4gICAgICAgICAgICAgIGJvZHkgKz0gJ1xcbicgKyAodG9rZW4udG9rZW5zID8gdGhpcy5wYXJzZUlubGluZSh0b2tlbi50b2tlbnMpIDogdG9rZW4udGV4dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBvdXQgKz0gdG9wID8gdGhpcy5yZW5kZXJlci5wYXJhZ3JhcGgoYm9keSkgOiBib2R5O1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgIHtcbiAgICAgICAgICAgIHZhciBlcnJNc2cgPSAnVG9rZW4gd2l0aCBcIicgKyB0b2tlbi50eXBlICsgJ1wiIHR5cGUgd2FzIG5vdCBmb3VuZC4nO1xuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5zaWxlbnQpIHtcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlcnJNc2cpO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoZXJyTXNnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBvdXQ7XG4gIH1cblxuICAvKipcbiAgICogUGFyc2UgSW5saW5lIFRva2Vuc1xuICAgKi87XG4gIF9wcm90by5wYXJzZUlubGluZSA9IGZ1bmN0aW9uIHBhcnNlSW5saW5lKHRva2VucywgcmVuZGVyZXIpIHtcbiAgICByZW5kZXJlciA9IHJlbmRlcmVyIHx8IHRoaXMucmVuZGVyZXI7XG4gICAgdmFyIG91dCA9ICcnLFxuICAgICAgaSxcbiAgICAgIHRva2VuLFxuICAgICAgcmV0O1xuICAgIHZhciBsID0gdG9rZW5zLmxlbmd0aDtcbiAgICBmb3IgKGkgPSAwOyBpIDwgbDsgaSsrKSB7XG4gICAgICB0b2tlbiA9IHRva2Vuc1tpXTtcblxuICAgICAgLy8gUnVuIGFueSByZW5kZXJlciBleHRlbnNpb25zXG4gICAgICBpZiAodGhpcy5vcHRpb25zLmV4dGVuc2lvbnMgJiYgdGhpcy5vcHRpb25zLmV4dGVuc2lvbnMucmVuZGVyZXJzICYmIHRoaXMub3B0aW9ucy5leHRlbnNpb25zLnJlbmRlcmVyc1t0b2tlbi50eXBlXSkge1xuICAgICAgICByZXQgPSB0aGlzLm9wdGlvbnMuZXh0ZW5zaW9ucy5yZW5kZXJlcnNbdG9rZW4udHlwZV0uY2FsbCh7XG4gICAgICAgICAgcGFyc2VyOiB0aGlzXG4gICAgICAgIH0sIHRva2VuKTtcbiAgICAgICAgaWYgKHJldCAhPT0gZmFsc2UgfHwgIVsnZXNjYXBlJywgJ2h0bWwnLCAnbGluaycsICdpbWFnZScsICdzdHJvbmcnLCAnZW0nLCAnY29kZXNwYW4nLCAnYnInLCAnZGVsJywgJ3RleHQnXS5pbmNsdWRlcyh0b2tlbi50eXBlKSkge1xuICAgICAgICAgIG91dCArPSByZXQgfHwgJyc7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHN3aXRjaCAodG9rZW4udHlwZSkge1xuICAgICAgICBjYXNlICdlc2NhcGUnOlxuICAgICAgICAgIHtcbiAgICAgICAgICAgIG91dCArPSByZW5kZXJlci50ZXh0KHRva2VuLnRleHQpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdodG1sJzpcbiAgICAgICAgICB7XG4gICAgICAgICAgICBvdXQgKz0gcmVuZGVyZXIuaHRtbCh0b2tlbi50ZXh0KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAnbGluayc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHJlbmRlcmVyLmxpbmsodG9rZW4uaHJlZiwgdG9rZW4udGl0bGUsIHRoaXMucGFyc2VJbmxpbmUodG9rZW4udG9rZW5zLCByZW5kZXJlcikpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdpbWFnZSc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHJlbmRlcmVyLmltYWdlKHRva2VuLmhyZWYsIHRva2VuLnRpdGxlLCB0b2tlbi50ZXh0KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAnc3Ryb25nJzpcbiAgICAgICAgICB7XG4gICAgICAgICAgICBvdXQgKz0gcmVuZGVyZXIuc3Ryb25nKHRoaXMucGFyc2VJbmxpbmUodG9rZW4udG9rZW5zLCByZW5kZXJlcikpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdlbSc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHJlbmRlcmVyLmVtKHRoaXMucGFyc2VJbmxpbmUodG9rZW4udG9rZW5zLCByZW5kZXJlcikpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdjb2Rlc3Bhbic6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHJlbmRlcmVyLmNvZGVzcGFuKHRva2VuLnRleHQpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICBjYXNlICdicic6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHJlbmRlcmVyLmJyKCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIGNhc2UgJ2RlbCc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHJlbmRlcmVyLmRlbCh0aGlzLnBhcnNlSW5saW5lKHRva2VuLnRva2VucywgcmVuZGVyZXIpKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgY2FzZSAndGV4dCc6XG4gICAgICAgICAge1xuICAgICAgICAgICAgb3V0ICs9IHJlbmRlcmVyLnRleHQodG9rZW4udGV4dCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAge1xuICAgICAgICAgICAgdmFyIGVyck1zZyA9ICdUb2tlbiB3aXRoIFwiJyArIHRva2VuLnR5cGUgKyAnXCIgdHlwZSB3YXMgbm90IGZvdW5kLic7XG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLnNpbGVudCkge1xuICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVyck1zZyk7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihlcnJNc2cpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG91dDtcbiAgfTtcbiAgcmV0dXJuIFBhcnNlcjtcbn0oKTtcblxuLyoqXG4gKiBNYXJrZWRcbiAqL1xuZnVuY3Rpb24gbWFya2VkKHNyYywgb3B0LCBjYWxsYmFjaykge1xuICAvLyB0aHJvdyBlcnJvciBpbiBjYXNlIG9mIG5vbiBzdHJpbmcgaW5wdXRcbiAgaWYgKHR5cGVvZiBzcmMgPT09ICd1bmRlZmluZWQnIHx8IHNyYyA9PT0gbnVsbCkge1xuICAgIHRocm93IG5ldyBFcnJvcignbWFya2VkKCk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AgICBvcHQuaGlnaGxpZ2h0ID0gaGlnaGxpZ2h0O1xuICAgICAgcmV0dXJuIGVyciA/IGNhbGxiYWNrKGVycikgOiBjYWxsYmFjayhudWxsLCBvdXQpO1xuICAgIH07XG4gICAgaWYgKCFoaWdobGlnaHQgfHwgaGlnaGxpZ2h0Lmxlbmd0aCA8IDMpIHtcbiAgICAgIHJldHVybiBkb25lKCk7XG4gICAgfVxuICAgIGRlbGV0ZSBvcHQuaGlnaGxpZ2h0O1xuICAgIGlmICghdG9rZW5zLmxlbmd0aCkgcmV0dXJuIGRvbmUoKTtcbiAgICB2YXIgcGVuZGluZyA9IDA7XG4gICAgbWFya2VkLndhbGtUb2tlbnModG9rZW5zLCBmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgIGlmICh0b2tlbi50eXBlID09PSAnY29kZScpIHtcbiAgICAgICAgcGVuZGluZysrO1xuICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICBoaWdobGlnaHQodG9rZW4udGV4dCwgdG9rZW4ubGFuZywgZnVuY3Rpb24gKGVyciwgY29kZSkge1xuICAgICAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgICAgICByZXR1cm4gZG9uZShlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGNvZGUgIT0gbnVsbCAmJiBjb2RlICE9PSB0b2tlbi50ZXh0KSB7XG4gICAgICAgICAgICAgIHRva2VuLnRleHQgPSBjb2RlO1xuICAgICAgICAgICAgICB0b2tlbi5lc2NhcGVkID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBlbmRpbmctLTtcbiAgICAgICAgICAgIGlmIChwZW5kaW5nID09PSAwKSB7XG4gICAgICAgICAgICAgIGRvbmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgMCk7XG4gICAgICB9XG4gICAgfSk7XG4gICAgaWYgKHBlbmRpbmcgPT09IDApI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ignZXh0ZW5zaW9uIG5hbWUgcmVxdWlyZWQnKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZXh0LnJlbmRlcmVyKSB7XG4gICAgICAgICAgLy8gUmVuZGVyZXIgZXh0ZW5zaW9uc1xuICAgICAgICAgIHZhciBwcmV2UmVuZGVyZXIgPSBleHRlbnNpb25zLnJlbmRlcmVyc1tleHQubmFtZV07XG4gICAgICAgICAgaWYgKHByZXZSZW5kZXJlcikge1xuICAgICAgICAgICAgLy8gUmVwbGFjZSBleHRlbnNpb24gd2l0aCBmdW5jIHRvIHJ1biBuZXcgZXh0ZW5zaW9uIGJ1dCBmYWxsIGJhY2sgaWYgZmFsc2VcbiAgICAgICAgICAgIGV4dGVuc2lvbnMucmVuZGVyZXJzW2V4dC5uYW1lXSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgZm9yICh2YXIgX2xlbjIgPSBhcmd1bWVudHMubGVuZ3RoLCBhcmdzID0gbmV3IEFycmF5KF9sZW4yKSwgX2tleTIgPSAwOyBfa2V5MiA8IF9sZW4yOyBfa2V5MisrKSB7XG4gICAgICAgICAgICAgICAgYXJnc1tfa2V5Ml0gPSBhcmd1bWVudHNbX2tleTJdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHZhciByZXQgPSBleHQucmVuZGVyZXIuYXBwbHkodGhpcywgYXJncyk7XG4gICAgICAgICAgICAgIGlmIChyZXQgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICAgICAgcmV0ID0gcHJldlJlbmRlcmVyLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBleHRlbnNpb25zLnJlbmRlcmVyc1tleHQubmFtZV0gPSBleHQucmVuZGVyZXI7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChleHQudG9rZW5pemVyKSB7XG4gICAgICAgICAgLy8gVG9rZW5pemVyIEV4dGVuc2lvbnNcbiAgICAgICAgICBpZiAoIWV4dC5sZXZlbCB8fCBleHQubGV2ZWwgIT09ICdibG9jaycgJiYgZXh0LmxldmVsICE9PSAnaW5saW5lJykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiZXh0ZW5zaW9uIGxldmVsIG11c3QgYmUgJ2Jsb2NrJyBvciAnaW5saW5lJ1wiKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGV4dGVuc2lvbnNbZXh0LmxldmVsXSkge1xuICAgICAgICAgICAgZXh0ZW5zaW9uc1tleHQubGV2ZWxdLnVuc2hpZnQoZXh0LnRva2VuaXplcik7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGV4dGVuc2lvbnNbZXh0LmxldmVsXSA9IFtleHQudG9rZW5pemVyXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGV4dC5zdGFydCkge1xuICAgICAgICAgICAgLy8gRnVuY3Rpb24gdG8gY2hlY2sgZm9yIHN0YXJ0IG9mIHRva2VuXG4gICAgICAgICAgICBpZiAoZXh0LmxldmVsID09PSAnYmxvY2snKSB7XG4gICAgICAgICAgICAgIGlmIChleHRlbnNpb25zLnN0YXJ0QmxvY2spIHtcbiAgICAgICAgICAgICAgICBleHRlbnNpb25zLnN0YXJ0QmxvY2sucHVzaChleHQuc3RhcnQpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGV4dGVuc2lvbnMuc3RhcnRCbG9jayA9IFtleHQuc3RhcnRdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGV4dC5sZXZlbCA9PT0gJ2lubGluZScpIHtcbiAgICAgICAgICAgICAgaWYgKGV4dGVuc2lvbnMuc3RhcnRJbmxpbmUpIHtcbiAgICAgICAgICAgICAgICBleHRlbnNpb25zLnN0YXJ0SW5saW5lLnB1c2goZXh0LnN0YXJ0KTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBleHRlbnNpb25zLnN0YXJ0SW5saW5lID0gW2V4dC5zdGFydF07XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dC5jaGlsZFRva2Vucykge1xuICAgICAgICAgIC8vIENoaWxkIHRva2VucyB0byBiZSB2aXNpdGVkIGJ5IHdhbGtUb2tlbnNcbiAgICAgICAgICBleHRlbnNpb25zLmNoaWxkVG9rZW5zW2V4dC5uYW1lXSA9IGV4dC5jaGlsZFRva2VucztcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICBvcHRzLmV4dGVuc2lvbnMgPSBleHRlbnNpb25zO1xuICAgIH1cblxuICAgIC8vID09LS0gUGFyc2UgXCJvdmVyd3JpdGVcIiBleHRlbnNpb25zIC0tPT0gLy9cbiAgICBpZiAocGFjay5yZW5kZXJlcikge1xuICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHJlbmRlcmVyID0gbWFya2VkLmRlZmF1bHRzLnJlbmRlcmVyIHx8IG5ldyBSZW5kZXJlcigpO1xuICAgICAgICB2YXIgX2xvb3AgPSBmdW5jdGlvbiBfbG9vcChwcm9wKSB7XG4gICAgICAgICAgdmFyIHByZXZSZW5kZXJlciA9IHJlbmRlcmVyW3Byb3BdO1xuICAgICAgICAgIC8vIFJlcGxhY2UgcmVuZGVyZXIgd2l0aCBmdW5jIHRvIHJ1biBleHRlbnNpb24sIGJ1dCBmYWxsIGJhY2sgaWYgZmFsc2VcbiAgICAgICAgICByZW5kZXJlcltwcm9wXSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGZvciAodmFyIF9sZW4zID0gYXJndW1lbnRzLmxlbmd0aCwgYXJncyA9IG5ldyBBcnJheShfbGVuMyksIF9rZXkzID0gMDsgX2tleTMgPCBfbGVuMzsgX2tleTMrKykge1xuICAgICAgICAgICAgICBhcmdzW19rZXkzXSA9IGFyZ3VtZW50c1tfa2V5M107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgcmV0ID0gcGFjay5yZW5kZXJlcltwcm9wXS5hcHBseShyZW5kZXJlciwgYXJncyk7XG4gICAgICAgICAgICBpZiAocmV0ID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICByZXQgPSBwcmV2UmVuZGVyZXIuYXBwbHkocmVuZGVyZXIsIGFyZ3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICB9O1xuICAgICAgICB9O1xuICAgICAgICBmb3IgKHZhciBwcm9wIGluIHBhY2sucmVuZGVyZXIpIHtcbiAgICAgICAgICBfbG9vcChwcm9wKTtcbiAgICAgICAgfVxuICAgICAgICBvcHRzLnJlbmRlcmVyID0gcmVuZGVyZXI7XG4gICAgICB9KSgpO1xuICAgIH1cbiAgICBpZiAocGFjay50b2tlbml6ZXIpIHtcbiAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB0b2tlbml6ZXIgPSBtYXJrZWQuZGVmYXVsdHMudG9rZW5pemVyIHx8IG5ldyBUb2tlbml6ZXIoKTtcbiAgICAgICAgdmFyIF9sb29wMiA9IGZ1bmN0aW9uIF9sb29wMihwcm9wKSB7XG4gICAgICAgICAgdmFyIHByZXZUb2tlbml6ZXIgPSB0b2tlbml6ZXJbcHJvcF07XG4gICAgICAgICAgLy8gUmVwbGFjZSB0b2tlbml6ZXIgd2l0aCBmdW5jIHRvIHJ1biBleHRlbnNpb24sIGJ1dCBmYWxsIGJhY2sgaWYgZmFsc2VcbiAgICAgICAgICB0b2tlbml6ZXJbcHJvcF0gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBfbGVuNCA9IGFyZ3VtZW50cy5sZW5ndGgsIGFyZ3MgPSBuZXcgQXJyYXkoX2xlbjQpLCBfa2V5NCA9IDA7IF9rZXk0IDwgX2xlbjQ7IF9rZXk0KyspIHtcbiAgICAgICAgICAgICAgYXJnc1tfa2V5NF0gPSBhcmd1bWVudHNbX2tleTRdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHJldCA9IHBhY2sudG9rZW5pemVyW3Byb3BdLmFwcGx5KHRva2VuaXplciwgYXJncyk7XG4gICAgICAgICAgICBpZiAocmV0ID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICByZXQgPSBwcmV2VG9rZW5pemVyLmFwcGx5KHRva2VuaXplciwgYXJncyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICAgIH07XG4gICAgICAgIH07XG4gICAgICAgIGZvciAodmFyIHByb3AgaW4gcGFjay50b2tlbml6ZXIpIHtcbiAgICAgICAgICBfbG9vcDIocHJvcCk7XG4gICAgICAgIH1cbiAgICAgICAgb3B0cy50b2tlbml6ZXIgPSB0b2tlbml6ZXI7XG4gICAgICB9KSgpO1xuICAgIH1cblxuICAgIC8vID09LS0gUGFyc2UgV2Fsa1Rva2VucyBleHRlbnNpb25zIC0tPT0gLy9cbiAgICBpZiAocGFjay53YWxrVG9rZW5zKSB7XG4gICAgICB2YXIgX3dhbGtUb2tlbnMgPSBtYXJrZWQuZGVmYXVsdHMud2Fsa1Rva2VucztcbiAgICAgIG9wdHMud2Fsa1Rva2VucyA9IGZ1bmN0aW9uICh0b2tlbikge1xuICAgICAgICB2YXIgdmFsdWVzID0gW107XG4gICAgICAgIHZhbHVlcy5wdXNoKHBhY2sud2Fsa1Rva2Vucy5jYWxsKHRoaXMsIHRva2VuKSk7XG4gICAgICAgIGlmIChfd2Fsa1Rva2Vucykge1xuICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoX3dhbGtUb2tlbnMuY2FsbCh0aGlzLCB0b2tlbikpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2YWx1ZXM7X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