Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: compose.js
}
[2500] Fix | Delete
};
[2501] Fix | Delete
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
[2502] Fix | Delete
}
[2503] Fix | Delete
[2504] Fix | Delete
function __read(o, n) {
[2505] Fix | Delete
var m = typeof Symbol === "function" && o[Symbol.iterator];
[2506] Fix | Delete
if (!m) return o;
[2507] Fix | Delete
var i = m.call(o), r, ar = [], e;
[2508] Fix | Delete
try {
[2509] Fix | Delete
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
[2510] Fix | Delete
}
[2511] Fix | Delete
catch (error) { e = { error: error }; }
[2512] Fix | Delete
finally {
[2513] Fix | Delete
try {
[2514] Fix | Delete
if (r && !r.done && (m = i["return"])) m.call(i);
[2515] Fix | Delete
}
[2516] Fix | Delete
finally { if (e) throw e.error; }
[2517] Fix | Delete
}
[2518] Fix | Delete
return ar;
[2519] Fix | Delete
}
[2520] Fix | Delete
[2521] Fix | Delete
/** @deprecated */
[2522] Fix | Delete
function __spread() {
[2523] Fix | Delete
for (var ar = [], i = 0; i < arguments.length; i++)
[2524] Fix | Delete
ar = ar.concat(__read(arguments[i]));
[2525] Fix | Delete
return ar;
[2526] Fix | Delete
}
[2527] Fix | Delete
[2528] Fix | Delete
/** @deprecated */
[2529] Fix | Delete
function __spreadArrays() {
[2530] Fix | Delete
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
[2531] Fix | Delete
for (var r = Array(s), k = 0, i = 0; i < il; i++)
[2532] Fix | Delete
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
[2533] Fix | Delete
r[k] = a[j];
[2534] Fix | Delete
return r;
[2535] Fix | Delete
}
[2536] Fix | Delete
[2537] Fix | Delete
function __spreadArray(to, from, pack) {
[2538] Fix | Delete
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
[2539] Fix | Delete
if (ar || !(i in from)) {
[2540] Fix | Delete
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
[2541] Fix | Delete
ar[i] = from[i];
[2542] Fix | Delete
}
[2543] Fix | Delete
}
[2544] Fix | Delete
return to.concat(ar || Array.prototype.slice.call(from));
[2545] Fix | Delete
}
[2546] Fix | Delete
[2547] Fix | Delete
function __await(v) {
[2548] Fix | Delete
return this instanceof __await ? (this.v = v, this) : new __await(v);
[2549] Fix | Delete
}
[2550] Fix | Delete
[2551] Fix | Delete
function __asyncGenerator(thisArg, _arguments, generator) {
[2552] Fix | Delete
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
[2553] Fix | Delete
var g = generator.apply(thisArg, _arguments || []), i, q = [];
[2554] Fix | Delete
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
[2555] Fix | Delete
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
[2556] Fix | Delete
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
[2557] Fix | Delete
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
[2558] Fix | Delete
function fulfill(value) { resume("next", value); }
[2559] Fix | Delete
function reject(value) { resume("throw", value); }
[2560] Fix | Delete
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
[2561] Fix | Delete
}
[2562] Fix | Delete
[2563] Fix | Delete
function __asyncDelegator(o) {
[2564] Fix | Delete
var i, p;
[2565] Fix | Delete
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
[2566] Fix | Delete
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
[2567] Fix | Delete
}
[2568] Fix | Delete
[2569] Fix | Delete
function __asyncValues(o) {
[2570] Fix | Delete
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
[2571] Fix | Delete
var m = o[Symbol.asyncIterator], i;
[2572] Fix | Delete
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
[2573] Fix | Delete
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
[2574] Fix | Delete
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
[2575] Fix | Delete
}
[2576] Fix | Delete
[2577] Fix | Delete
function __makeTemplateObject(cooked, raw) {
[2578] Fix | Delete
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
[2579] Fix | Delete
return cooked;
[2580] Fix | Delete
};
[2581] Fix | Delete
[2582] Fix | Delete
var __setModuleDefault = Object.create ? (function(o, v) {
[2583] Fix | Delete
Object.defineProperty(o, "default", { enumerable: true, value: v });
[2584] Fix | Delete
}) : function(o, v) {
[2585] Fix | Delete
o["default"] = v;
[2586] Fix | Delete
};
[2587] Fix | Delete
[2588] Fix | Delete
function __importStar(mod) {
[2589] Fix | Delete
if (mod && mod.__esModule) return mod;
[2590] Fix | Delete
var result = {};
[2591] Fix | Delete
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
[2592] Fix | Delete
__setModuleDefault(result, mod);
[2593] Fix | Delete
return result;
[2594] Fix | Delete
}
[2595] Fix | Delete
[2596] Fix | Delete
function __importDefault(mod) {
[2597] Fix | Delete
return (mod && mod.__esModule) ? mod : { default: mod };
[2598] Fix | Delete
}
[2599] Fix | Delete
[2600] Fix | Delete
function __classPrivateFieldGet(receiver, state, kind, f) {
[2601] Fix | Delete
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
[2602] Fix | Delete
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
[2603] Fix | Delete
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
[2604] Fix | Delete
}
[2605] Fix | Delete
[2606] Fix | Delete
function __classPrivateFieldSet(receiver, state, value, kind, f) {
[2607] Fix | Delete
if (kind === "m") throw new TypeError("Private method is not writable");
[2608] Fix | Delete
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
[2609] Fix | Delete
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
[2610] Fix | Delete
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
[2611] Fix | Delete
}
[2612] Fix | Delete
[2613] Fix | Delete
function __classPrivateFieldIn(state, receiver) {
[2614] Fix | Delete
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
[2615] Fix | Delete
return typeof state === "function" ? receiver === state : state.has(receiver);
[2616] Fix | Delete
}
[2617] Fix | Delete
[2618] Fix | Delete
function __addDisposableResource(env, value, async) {
[2619] Fix | Delete
if (value !== null && value !== void 0) {
[2620] Fix | Delete
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
[2621] Fix | Delete
var dispose;
[2622] Fix | Delete
if (async) {
[2623] Fix | Delete
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
[2624] Fix | Delete
dispose = value[Symbol.asyncDispose];
[2625] Fix | Delete
}
[2626] Fix | Delete
if (dispose === void 0) {
[2627] Fix | Delete
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
[2628] Fix | Delete
dispose = value[Symbol.dispose];
[2629] Fix | Delete
}
[2630] Fix | Delete
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
[2631] Fix | Delete
env.stack.push({ value: value, dispose: dispose, async: async });
[2632] Fix | Delete
}
[2633] Fix | Delete
else if (async) {
[2634] Fix | Delete
env.stack.push({ async: true });
[2635] Fix | Delete
}
[2636] Fix | Delete
return value;
[2637] Fix | Delete
}
[2638] Fix | Delete
[2639] Fix | Delete
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
[2640] Fix | Delete
var e = new Error(message);
[2641] Fix | Delete
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
[2642] Fix | Delete
};
[2643] Fix | Delete
[2644] Fix | Delete
function __disposeResources(env) {
[2645] Fix | Delete
function fail(e) {
[2646] Fix | Delete
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
[2647] Fix | Delete
env.hasError = true;
[2648] Fix | Delete
}
[2649] Fix | Delete
function next() {
[2650] Fix | Delete
while (env.stack.length) {
[2651] Fix | Delete
var rec = env.stack.pop();
[2652] Fix | Delete
try {
[2653] Fix | Delete
var result = rec.dispose && rec.dispose.call(rec.value);
[2654] Fix | Delete
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
[2655] Fix | Delete
}
[2656] Fix | Delete
catch (e) {
[2657] Fix | Delete
fail(e);
[2658] Fix | Delete
}
[2659] Fix | Delete
}
[2660] Fix | Delete
if (env.hasError) throw env.error;
[2661] Fix | Delete
}
[2662] Fix | Delete
return next();
[2663] Fix | Delete
}
[2664] Fix | Delete
[2665] Fix | Delete
/* harmony default export */ const tslib_es6 = ({
[2666] Fix | Delete
__extends,
[2667] Fix | Delete
__assign,
[2668] Fix | Delete
__rest,
[2669] Fix | Delete
__decorate,
[2670] Fix | Delete
__param,
[2671] Fix | Delete
__metadata,
[2672] Fix | Delete
__awaiter,
[2673] Fix | Delete
__generator,
[2674] Fix | Delete
__createBinding,
[2675] Fix | Delete
__exportStar,
[2676] Fix | Delete
__values,
[2677] Fix | Delete
__read,
[2678] Fix | Delete
__spread,
[2679] Fix | Delete
__spreadArrays,
[2680] Fix | Delete
__spreadArray,
[2681] Fix | Delete
__await,
[2682] Fix | Delete
__asyncGenerator,
[2683] Fix | Delete
__asyncDelegator,
[2684] Fix | Delete
__asyncValues,
[2685] Fix | Delete
__makeTemplateObject,
[2686] Fix | Delete
__importStar,
[2687] Fix | Delete
__importDefault,
[2688] Fix | Delete
__classPrivateFieldGet,
[2689] Fix | Delete
__classPrivateFieldSet,
[2690] Fix | Delete
__classPrivateFieldIn,
[2691] Fix | Delete
__addDisposableResource,
[2692] Fix | Delete
__disposeResources,
[2693] Fix | Delete
});
[2694] Fix | Delete
[2695] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
[2696] Fix | Delete
/**
[2697] Fix | Delete
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
[2698] Fix | Delete
*/
[2699] Fix | Delete
var SUPPORTED_LOCALE = {
[2700] Fix | Delete
tr: {
[2701] Fix | Delete
regexp: /\u0130|\u0049|\u0049\u0307/g,
[2702] Fix | Delete
map: {
[2703] Fix | Delete
İ: "\u0069",
[2704] Fix | Delete
I: "\u0131",
[2705] Fix | Delete
İ: "\u0069",
[2706] Fix | Delete
},
[2707] Fix | Delete
},
[2708] Fix | Delete
az: {
[2709] Fix | Delete
regexp: /\u0130/g,
[2710] Fix | Delete
map: {
[2711] Fix | Delete
İ: "\u0069",
[2712] Fix | Delete
I: "\u0131",
[2713] Fix | Delete
İ: "\u0069",
[2714] Fix | Delete
},
[2715] Fix | Delete
},
[2716] Fix | Delete
lt: {
[2717] Fix | Delete
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
[2718] Fix | Delete
map: {
[2719] Fix | Delete
I: "\u0069\u0307",
[2720] Fix | Delete
J: "\u006A\u0307",
[2721] Fix | Delete
Į: "\u012F\u0307",
[2722] Fix | Delete
Ì: "\u0069\u0307\u0300",
[2723] Fix | Delete
Í: "\u0069\u0307\u0301",
[2724] Fix | Delete
Ĩ: "\u0069\u0307\u0303",
[2725] Fix | Delete
},
[2726] Fix | Delete
},
[2727] Fix | Delete
};
[2728] Fix | Delete
/**
[2729] Fix | Delete
* Localized lower case.
[2730] Fix | Delete
*/
[2731] Fix | Delete
function localeLowerCase(str, locale) {
[2732] Fix | Delete
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
[2733] Fix | Delete
if (lang)
[2734] Fix | Delete
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
[2735] Fix | Delete
return lowerCase(str);
[2736] Fix | Delete
}
[2737] Fix | Delete
/**
[2738] Fix | Delete
* Lower case as a function.
[2739] Fix | Delete
*/
[2740] Fix | Delete
function lowerCase(str) {
[2741] Fix | Delete
return str.toLowerCase();
[2742] Fix | Delete
}
[2743] Fix | Delete
[2744] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
[2745] Fix | Delete
[2746] Fix | Delete
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
[2747] Fix | Delete
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
[2748] Fix | Delete
// Remove all non-word characters.
[2749] Fix | Delete
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
[2750] Fix | Delete
/**
[2751] Fix | Delete
* Normalize the string into something other libraries can manipulate easier.
[2752] Fix | Delete
*/
[2753] Fix | Delete
function noCase(input, options) {
[2754] Fix | Delete
if (options === void 0) { options = {}; }
[2755] Fix | Delete
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
[2756] Fix | Delete
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
[2757] Fix | Delete
var start = 0;
[2758] Fix | Delete
var end = result.length;
[2759] Fix | Delete
// Trim the delimiter from around the output string.
[2760] Fix | Delete
while (result.charAt(start) === "\0")
[2761] Fix | Delete
start++;
[2762] Fix | Delete
while (result.charAt(end - 1) === "\0")
[2763] Fix | Delete
end--;
[2764] Fix | Delete
// Transform each token independently.
[2765] Fix | Delete
return result.slice(start, end).split("\0").map(transform).join(delimiter);
[2766] Fix | Delete
}
[2767] Fix | Delete
/**
[2768] Fix | Delete
* Replace `re` in the input string with the replacement value.
[2769] Fix | Delete
*/
[2770] Fix | Delete
function replace(input, re, value) {
[2771] Fix | Delete
if (re instanceof RegExp)
[2772] Fix | Delete
return input.replace(re, value);
[2773] Fix | Delete
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
[2774] Fix | Delete
}
[2775] Fix | Delete
[2776] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/pascal-case/dist.es2015/index.js
[2777] Fix | Delete
[2778] Fix | Delete
[2779] Fix | Delete
function pascalCaseTransform(input, index) {
[2780] Fix | Delete
var firstChar = input.charAt(0);
[2781] Fix | Delete
var lowerChars = input.substr(1).toLowerCase();
[2782] Fix | Delete
if (index > 0 && firstChar >= "0" && firstChar <= "9") {
[2783] Fix | Delete
return "_" + firstChar + lowerChars;
[2784] Fix | Delete
}
[2785] Fix | Delete
return "" + firstChar.toUpperCase() + lowerChars;
[2786] Fix | Delete
}
[2787] Fix | Delete
function pascalCaseTransformMerge(input) {
[2788] Fix | Delete
return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
[2789] Fix | Delete
}
[2790] Fix | Delete
function pascalCase(input, options) {
[2791] Fix | Delete
if (options === void 0) { options = {}; }
[2792] Fix | Delete
return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
[2793] Fix | Delete
}
[2794] Fix | Delete
[2795] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js
[2796] Fix | Delete
/**
[2797] Fix | Delete
* External dependencies
[2798] Fix | Delete
*/
[2799] Fix | Delete
[2800] Fix | Delete
/**
[2801] Fix | Delete
* Given a function mapping a component to an enhanced component and modifier
[2802] Fix | Delete
* name, returns the enhanced component augmented with a generated displayName.
[2803] Fix | Delete
*
[2804] Fix | Delete
* @param mapComponent Function mapping component to enhanced component.
[2805] Fix | Delete
* @param modifierName Seed name from which to generated display name.
[2806] Fix | Delete
*
[2807] Fix | Delete
* @return Component class with generated display name assigned.
[2808] Fix | Delete
*/
[2809] Fix | Delete
function createHigherOrderComponent(mapComponent, modifierName) {
[2810] Fix | Delete
return Inner => {
[2811] Fix | Delete
const Outer = mapComponent(Inner);
[2812] Fix | Delete
Outer.displayName = hocName(modifierName, Inner);
[2813] Fix | Delete
return Outer;
[2814] Fix | Delete
};
[2815] Fix | Delete
}
[2816] Fix | Delete
[2817] Fix | Delete
/**
[2818] Fix | Delete
* Returns a displayName for a higher-order component, given a wrapper name.
[2819] Fix | Delete
*
[2820] Fix | Delete
* @example
[2821] Fix | Delete
* hocName( 'MyMemo', Widget ) === 'MyMemo(Widget)';
[2822] Fix | Delete
* hocName( 'MyMemo', <div /> ) === 'MyMemo(Component)';
[2823] Fix | Delete
*
[2824] Fix | Delete
* @param name Name assigned to higher-order component's wrapper component.
[2825] Fix | Delete
* @param Inner Wrapped component inside higher-order component.
[2826] Fix | Delete
* @return Wrapped name of higher-order component.
[2827] Fix | Delete
*/
[2828] Fix | Delete
const hocName = (name, Inner) => {
[2829] Fix | Delete
const inner = Inner.displayName || Inner.name || 'Component';
[2830] Fix | Delete
const outer = pascalCase(name !== null && name !== void 0 ? name : '');
[2831] Fix | Delete
return `${outer}(${inner})`;
[2832] Fix | Delete
};
[2833] Fix | Delete
[2834] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/debounce/index.js
[2835] Fix | Delete
/**
[2836] Fix | Delete
* Parts of this source were derived and modified from lodash,
[2837] Fix | Delete
* released under the MIT license.
[2838] Fix | Delete
*
[2839] Fix | Delete
* https://github.com/lodash/lodash
[2840] Fix | Delete
*
[2841] Fix | Delete
* Copyright JS Foundation and other contributors <https://js.foundation/>
[2842] Fix | Delete
*
[2843] Fix | Delete
* Based on Underscore.js, copyright Jeremy Ashkenas,
[2844] Fix | Delete
* DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
[2845] Fix | Delete
*
[2846] Fix | Delete
* This software consists of voluntary contributions made by many
[2847] Fix | Delete
* individuals. For exact contribution history, see the revision history
[2848] Fix | Delete
* available at https://github.com/lodash/lodash
[2849] Fix | Delete
*
[2850] Fix | Delete
* The following license applies to all parts of this software except as
[2851] Fix | Delete
* documented below:
[2852] Fix | Delete
*
[2853] Fix | Delete
* ====
[2854] Fix | Delete
*
[2855] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining
[2856] Fix | Delete
* a copy of this software and associated documentation files (the
[2857] Fix | Delete
* "Software"), to deal in the Software without restriction, including
[2858] Fix | Delete
* without limitation the rights to use, copy, modify, merge, publish,
[2859] Fix | Delete
* distribute, sublicense, and/or sell copies of the Software, and to
[2860] Fix | Delete
* permit persons to whom the Software is furnished to do so, subject to
[2861] Fix | Delete
* the following conditions:
[2862] Fix | Delete
*
[2863] Fix | Delete
* The above copyright notice and this permission notice shall be
[2864] Fix | Delete
* included in all copies or substantial portions of the Software.
[2865] Fix | Delete
*
[2866] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
[2867] Fix | Delete
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
[2868] Fix | Delete
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
[2869] Fix | Delete
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
[2870] Fix | Delete
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
[2871] Fix | Delete
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
[2872] Fix | Delete
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[2873] Fix | Delete
*/
[2874] Fix | Delete
[2875] Fix | Delete
/**
[2876] Fix | Delete
* A simplified and properly typed version of lodash's `debounce`, that
[2877] Fix | Delete
* always uses timers instead of sometimes using rAF.
[2878] Fix | Delete
*
[2879] Fix | Delete
* Creates a debounced function that delays invoking `func` until after `wait`
[2880] Fix | Delete
* milliseconds have elapsed since the last time the debounced function was
[2881] Fix | Delete
* invoked. The debounced function comes with a `cancel` method to cancel delayed
[2882] Fix | Delete
* `func` invocations and a `flush` method to immediately invoke them. Provide
[2883] Fix | Delete
* `options` to indicate whether `func` should be invoked on the leading and/or
[2884] Fix | Delete
* trailing edge of the `wait` timeout. The `func` is invoked with the last
[2885] Fix | Delete
* arguments provided to the debounced function. Subsequent calls to the debounced
[2886] Fix | Delete
* function return the result of the last `func` invocation.
[2887] Fix | Delete
*
[2888] Fix | Delete
* **Note:** If `leading` and `trailing` options are `true`, `func` is
[2889] Fix | Delete
* invoked on the trailing edge of the timeout only if the debounced function
[2890] Fix | Delete
* is invoked more than once during the `wait` timeout.
[2891] Fix | Delete
*
[2892] Fix | Delete
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
[2893] Fix | Delete
* until the next tick, similar to `setTimeout` with a timeout of `0`.
[2894] Fix | Delete
*
[2895] Fix | Delete
* @param {Function} func The function to debounce.
[2896] Fix | Delete
* @param {number} wait The number of milliseconds to delay.
[2897] Fix | Delete
* @param {Partial< DebounceOptions >} options The options object.
[2898] Fix | Delete
* @param {boolean} options.leading Specify invoking on the leading edge of the timeout.
[2899] Fix | Delete
* @param {number} options.maxWait The maximum time `func` is allowed to be delayed before it's invoked.
[2900] Fix | Delete
* @param {boolean} options.trailing Specify invoking on the trailing edge of the timeout.
[2901] Fix | Delete
*
[2902] Fix | Delete
* @return Returns the new debounced function.
[2903] Fix | Delete
*/
[2904] Fix | Delete
const debounce = (func, wait, options) => {
[2905] Fix | Delete
let lastArgs;
[2906] Fix | Delete
let lastThis;
[2907] Fix | Delete
let maxWait = 0;
[2908] Fix | Delete
let result;
[2909] Fix | Delete
let timerId;
[2910] Fix | Delete
let lastCallTime;
[2911] Fix | Delete
let lastInvokeTime = 0;
[2912] Fix | Delete
let leading = false;
[2913] Fix | Delete
let maxing = false;
[2914] Fix | Delete
let trailing = true;
[2915] Fix | Delete
if (options) {
[2916] Fix | Delete
leading = !!options.leading;
[2917] Fix | Delete
maxing = 'maxWait' in options;
[2918] Fix | Delete
if (options.maxWait !== undefined) {
[2919] Fix | Delete
maxWait = Math.max(options.maxWait, wait);
[2920] Fix | Delete
}
[2921] Fix | Delete
trailing = 'trailing' in options ? !!options.trailing : trailing;
[2922] Fix | Delete
}
[2923] Fix | Delete
function invokeFunc(time) {
[2924] Fix | Delete
const args = lastArgs;
[2925] Fix | Delete
const thisArg = lastThis;
[2926] Fix | Delete
lastArgs = undefined;
[2927] Fix | Delete
lastThis = undefined;
[2928] Fix | Delete
lastInvokeTime = time;
[2929] Fix | Delete
result = func.apply(thisArg, args);
[2930] Fix | Delete
return result;
[2931] Fix | Delete
}
[2932] Fix | Delete
function startTimer(pendingFunc, waitTime) {
[2933] Fix | Delete
timerId = setTimeout(pendingFunc, waitTime);
[2934] Fix | Delete
}
[2935] Fix | Delete
function cancelTimer() {
[2936] Fix | Delete
if (timerId !== undefined) {
[2937] Fix | Delete
clearTimeout(timerId);
[2938] Fix | Delete
}
[2939] Fix | Delete
}
[2940] Fix | Delete
function leadingEdge(time) {
[2941] Fix | Delete
// Reset any `maxWait` timer.
[2942] Fix | Delete
lastInvokeTime = time;
[2943] Fix | Delete
// Start the timer for the trailing edge.
[2944] Fix | Delete
startTimer(timerExpired, wait);
[2945] Fix | Delete
// Invoke the leading edge.
[2946] Fix | Delete
return leading ? invokeFunc(time) : result;
[2947] Fix | Delete
}
[2948] Fix | Delete
function getTimeSinceLastCall(time) {
[2949] Fix | Delete
return time - (lastCallTime || 0);
[2950] Fix | Delete
}
[2951] Fix | Delete
function remainingWait(time) {
[2952] Fix | Delete
const timeSinceLastCall = getTimeSinceLastCall(time);
[2953] Fix | Delete
const timeSinceLastInvoke = time - lastInvokeTime;
[2954] Fix | Delete
const timeWaiting = wait - timeSinceLastCall;
[2955] Fix | Delete
return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
[2956] Fix | Delete
}
[2957] Fix | Delete
function shouldInvoke(time) {
[2958] Fix | Delete
const timeSinceLastCall = getTimeSinceLastCall(time);
[2959] Fix | Delete
const timeSinceLastInvoke = time - lastInvokeTime;
[2960] Fix | Delete
[2961] Fix | Delete
// Either this is the first call, activity has stopped and we're at the
[2962] Fix | Delete
// trailing edge, the system time has gone backwards and we're treating
[2963] Fix | Delete
// it as the trailing edge, or we've hit the `maxWait` limit.
[2964] Fix | Delete
return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
[2965] Fix | Delete
}
[2966] Fix | Delete
function timerExpired() {
[2967] Fix | Delete
const time = Date.now();
[2968] Fix | Delete
if (shouldInvoke(time)) {
[2969] Fix | Delete
return trailingEdge(time);
[2970] Fix | Delete
}
[2971] Fix | Delete
// Restart the timer.
[2972] Fix | Delete
startTimer(timerExpired, remainingWait(time));
[2973] Fix | Delete
return undefined;
[2974] Fix | Delete
}
[2975] Fix | Delete
function clearTimer() {
[2976] Fix | Delete
timerId = undefined;
[2977] Fix | Delete
}
[2978] Fix | Delete
function trailingEdge(time) {
[2979] Fix | Delete
clearTimer();
[2980] Fix | Delete
[2981] Fix | Delete
// Only invoke if we have `lastArgs` which means `func` has been
[2982] Fix | Delete
// debounced at least once.
[2983] Fix | Delete
if (trailing && lastArgs) {
[2984] Fix | Delete
return invokeFunc(time);
[2985] Fix | Delete
}
[2986] Fix | Delete
lastArgs = lastThis = undefined;
[2987] Fix | Delete
return result;
[2988] Fix | Delete
}
[2989] Fix | Delete
function cancel() {
[2990] Fix | Delete
cancelTimer();
[2991] Fix | Delete
lastInvokeTime = 0;
[2992] Fix | Delete
clearTimer();
[2993] Fix | Delete
lastArgs = lastCallTime = lastThis = undefined;
[2994] Fix | Delete
}
[2995] Fix | Delete
function flush() {
[2996] Fix | Delete
return pending() ? trailingEdge(Date.now()) : result;
[2997] Fix | Delete
}
[2998] Fix | Delete
function pending() {
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function