PageSourceSearch

https://www.evolveagility.com/wp-content/plugins/divi-table-of-con…/server/script/jquery.mark.min.js?ver=2.0.4

js evolveagility.com collected 2026-09-26 15:29:04 UTC 22,138 bytes, 349 lines download raw bytes

1/*!***************************************************
2 * mark.js v8.6.0
3 * https://github.com/julmot/mark.js
4 * Copyright (c) 2014–2017, Julian Motz
5 * Released under the MIT license https://git.io/vwTVl
6 *****************************************************/
7"use strict";
8
9function _classCallCheck(a, b) { if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function") }
10var _extends = Object.assign || function(a) { for (var b = 1; b < arguments.length; b++) { var c = arguments[b]; for (var d in c) Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]) } return a },
11    _createClass = function() {
12        function a(a, b) {
13            for (var c = 0; c < b.length; c++) {
14                var d = b[c];
15                d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(a, d.key, d)
16            }
17        }
18        return function(b, c, d) { return c && a(b.prototype, c), d && a(b, d), b }
19    }(),
20    _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(a) { return typeof a } : function(a) { return a && "function" == typeof Symbol && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a };
21! function(a, b, c) { "function" == typeof define && define.amd ? define(["jquery"], function(d) { return a(b, c, d) }) : "object" === ("undefined" == typeof module ? "undefined" : _typeof(module)) && module.exports ? module.exports = a(b, c, require("jquery")) : a(b, c, jQuery) }(function(a, b, c) {
22    var d = function() {
23            function c(b) {
24                _classCallCheck(this, c), this.ctx = b, this.ie = !1;
25                var d = a.navigator.userAgent;
26                (d.indexOf("MSIE") > -1 || d.indexOf("Trident") > -1) && (this.ie = !0)
27            }
28            return _createClass(c, [{
29                key: "log",
30                value: function a(b) {
31                    var c = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "debug",
32                        a = this.opt.log;
33                    this.opt.debug && "object" === ("undefined" == typeof a ? "undefined" : _typeof(a)) && "function" == typeof a[c] && a[c]("mark.js: " + b)
34                }
35            }, { key: "escapeStr", value: function(a) { return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") } }, { key: "createRegExp", value: function(a) { return a = this.escapeStr(a), Object.keys(this.opt.synonyms).length && (a = this.createSynonymsRegExp(a)), this.opt.ignoreJoiners && (a = this.setupIgnoreJoinersRegExp(a)), this.opt.diacritics && (a = this.createDiacriticsRegExp(a)), a = this.createMergedBlanksRegExp(a), this.opt.ignoreJoiners && (a = this.createIgnoreJoinersRegExp(a)), a = this.createAccuracyRegExp(a) } }, {
36                key: "createSynonymsRegExp",
37                value: function(a) {
38                    var b = this.opt.synonyms,
39                        c = this.opt.caseSensitive ? "" : "i";
40                    for (var d in b)
41                        if (b.hasOwnProperty(d)) {
42                            var e = b[d],
43                                f = this.escapeStr(d),
44                                g = this.escapeStr(e);
45                            a = a.replace(new RegExp("(" + f + "|" + g + ")", "gm" + c), "(" + f + "|" + g + ")")
46                        }
47                    return a
48                }
49            }, { key: "setupIgnoreJoinersRegExp", value: function(a) { return a.replace(/[^(|)\\]/g, function(a, b, c) { var d = c.charAt(b + 1); return /[(|)\\]/.test(d) || "" === d ? a : a + "\0" }) } }, { key: "createIgnoreJoinersRegExp", value: function(a) { return a.split("\0").join("[\\u00ad|\\u200b|\\u200c|\\u200d]?") } }, {
50                key: "createDiacriticsRegExp",
51                value: function(a) {
52                    var b = this.opt.caseSensitive ? "" : "i",
53                        c = this.opt.caseSensitive ? ["aàáâãäåāąă", "AÀÁÂÃÄÅĀĄĂ", "cçćč", "CÇĆČ", "dđď", "DĐĎ", "eèéêëěēę", "EÈÉÊËĚĒĘ", "iìíîïī", "IÌÍÎÏĪ", "lł", "LŁ", "nñňń", "NÑŇŃ", "oòóôõöøō", "OÒÓÔÕÖØŌ", "rř", "RŘ", "sšśș", "SŠŚȘ", "tťț", "TŤȚ", "uùúûüůū", "UÙÚÛÜŮŪ", "yÿý", "YŸÝ", "zžżź", "ZŽŻŹ"] : ["aÀÁÂÃÄÅàáâãäåĀāąĄăĂ", "cÇçćĆčČ", "dđĐďĎ", "eÈÉÊËèéêëěĚĒēęĘ", "iÌÍÎÏìíîïĪī", "lłŁ", "nÑñňŇńŃ", "oÒÓÔÕÖØòóôõöøŌō", "rřŘ", "sŠšśŚșȘ", "tťŤțȚ", "uÙÚÛÜùúûüůŮŪū", "yŸÿýÝ", "zŽžżŻźŹ"],
54                        d = [];
55                    return a.split("").forEach(function(e) {
56                        c.every(function(c) {
57                            if (c.indexOf(e) !== -1) {
58                                if (d.indexOf(c) > -1) return !1;
59                                a = a.replace(new RegExp("[" + c + "]", "gm" + b), "[" + c + "]"), d.push(c)
60                            }
61                            return !0
62                        })
63                    }), a
64                }
65            }, { key: "createMergedBlanksRegExp", value: function(a) { return a.replace(/[\s]+/gim, "[\\s]+") } }, {
66                key: "createAccuracyRegExp",
67                value: function(a) {
68                    var b = this,
69                        c = this.opt.accuracy,
70                        d = "string" == typeof c ? c : c.value,
71                        e = "string" == typeof c ? [] : c.limiters,
72                        f = "";
73                    switch (e.forEach(function(a) { f += "|" + b.escapeStr(a) }), d) {
74                        case "partially":
75                        default:
76                            return "()(" + a + ")";
77                        case "complementary":
78                            return "()([^\\s" + f + "]*" + a + "[^\\s" + f + "]*)";
79                        case "exactly":
80                            return "(^|\\s" + f + ")(" + a + ")(?=$|\\s" + f + ")"
81                    }
82                }
83            }, {
84                key: "getSeparatedKeywords",
85                value: function(a) {
86                    var b = this,
87                        c = [];
88                    return a.forEach(function(a) { b.opt.separateWordSearch ? a.split(" ").forEach(function(a) { a.trim() && c.indexOf(a) === -1 && c.push(a) }) : a.trim() && c.indexOf(a) === -1 && c.push(a) }), { keywords: c.sort(function(a, b) { return b.length - a.length }), length: c.length }
89                }
90            }, {
91                key: "getTextNodes",
92                value: function(a) {
93                    var b = this,
94                        c = "",
95                        d = [];
96                    this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function(a) { d.push({ start: c.length, end: (c += a.textContent).length, node: a }) }, function(a) { return b.matchesExclude(a.parentNode, !0) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT }, function() { a({ value: c, nodes: d }) })
97                }
98            }, { key: "matchesExclude", value: function(a, b) { var c = this.opt.exclude.concat(["script", "style", "title", "head", "html"]); return b && (c = c.concat(["*[data-markjs='true']"])), e.matches(a, c) } }, {
99                key: "wrapRangeInTextNode",
100                value: function(a, c, d) {
101                    var e = this.opt.element ? this.opt.element : "mark",
102                        f = a.splitText(c),
103                        g = f.splitText(d - c),
104                        h = b.createElement(e);
105                    return h.setAttribute("data-markjs", "true"), this.opt.className && h.setAttribute("class", this.opt.className), h.textContent = f.textContent, f.parentNode.replaceChild(h, f), g
106                }
107            }, {
108                key: "wrapRangeInMappedTextNode",
109                value: function(a, b, c, d, e) {
110                    var f = this;
111                    a.nodes.every(function(g, h) {
112                        var i = a.nodes[h + 1];
113                        if ("undefined" == typeof i || i.start > b) {
114                            var j = function() {
115                                var i = b - g.start,
116                                    j = (c > g.end ? g.end : c) - g.start;
117                                if (d(g.node)) {
118                                    g.node = f.wrapRangeInTextNode(g.no
vendor: 4,113 bytes, lines 118-196
118de, i, j);
119                                    var k = a.value.substr(0, g.start),
120                                        l = a.value.substr(j + g.start);
121                                    if (a.value = k + l, a.nodes.forEach(function(b, c) { c >= h && (a.nodes[c].start > 0 && c !== h && (a.nodes[c].start -= j), a.nodes[c].end -= j) }), c -= j, e(g.node.previousSibling, g.start), !(c > g.end)) return { v: !1 };
122                                    b = g.end
123                                }
124                            }();
125                            if ("object" === ("undefined" == typeof j ? "undefined" : _typeof(j))) return j.v
126                        }
127                        return !0
128                    })
129                }
130            }, {
131                key: "wrapMatches",
132                value: function(a, b, c, d, e) {
133                    var f = this,
134                        g = 0 === b ? 0 : b + 1;
135                    this.getTextNodes(function(b) {
136                        b.nodes.forEach(function(b) {
137                            b = b.node;
138                            for (var e = void 0; null !== (e = a.exec(b.textContent)) && "" !== e[g];)
139                                if (c(e[g], b)) {
140                                    var h = e.index;
141                                    if (0 !== g)
142                                        for (var i = 1; i < g; i++) h += e[i].length;
143                                    b = f.wrapRangeInTextNode(b, h, h + e[g].length), d(b.previousSibling), a.lastIndex = 0
144                                }
145                        }), e()
146                    })
147                }
148            }, {
149                key: "wrapMatchesAcrossElements",
150                value: function(a, b, c, d, e) {
151                    var f = this,
152                        g = 0 === b ? 0 : b + 1;
153                    this.getTextNodes(function(b) {
154                        for (var h = void 0; null !== (h = a.exec(b.value)) && "" !== h[g];) {
155                            var i = h.index;
156                            if (0 !== g)
157                                for (var j = 1; j < g; j++) i += h[j].length;
158                            var k = i + h[g].length;
159                            f.wrapRangeInMappedTextNode(b, i, k, function(a) { return c(h[g], a) }, function(b, c) { a.lastIndex = c, d(b) })
160                        }
161                        e()
162                    })
163                }
164            }, {
165                key: "unwrapMatches",
166                value: function(a) {
167                    for (var c = a.parentNode, d = b.createDocumentFragment(); a.firstChild;) d.appendChild(a.removeChild(a.firstChild));
168                    c.replaceChild(d, a), this.ie ? this.normalizeTextNode(c) : c.normalize()
169                }
170            }, {
171                key: "normalizeTextNode",
172                value: function(a) {
173                    if (a) {
174                        if (3 === a.nodeType)
175                            for (; a.nextSibling && 3 === a.nextSibling.nodeType;) a.nodeValue += a.nextSibling.nodeValue, a.parentNode.removeChild(a.nextSibling);
176                        else this.normalizeTextNode(a.firstChild);
177                        this.normalizeTextNode(a.nextSibling)
178                    }
179                }
180            }, {
181                key: "markRegExp",
182                value: function(a, b) {
183                    var c = this;
184                    this.opt = b, this.log('Searching with expression "' + a + '"');
185                    var d = 0,
186                        e = "wrapMatches",
187                        f = function(a) { d++, c.opt.each(a) };
188                    this.opt.acrossElements && (e = "wrapMatchesAcrossElements"), this[e](a, this.opt.ignoreGroups, function(a, b) { return c.opt.filter(b, a, d) }, f, function() { 0 === d && c.opt.noMatch(a), c.opt.done(d) })
189                }
190            }, {
191                key: "mark",
192                value: function(a, b) {
193                    var c = this;
194                    this.opt = b;
195                    var d = 0,
196                        e = "wrapMatches",
197                        f = this.getSeparatedKeywords("string" == typeof a ? [a] : a),
198                        g = f.keywords,
199                        h = f.length,
200                        i = this.opt.caseSensitive ? "" : "i",
201                        j = function a(b) {
202                            var f = new RegExp(c.createRegExp(b), "gm" + i),
203                                j = 0;
204                            c.log('Searching with expression "' + f + '"'), c[e](f, 1, function(a, e) { return c.opt.filter(e, b, d, j) }, function(a) { j++, d++, c.opt.each(a) }, function() { 0 === j && c.opt.noMatch(b), g[h - 1] === b ? c.opt.done(d) : a(g[g.indexOf(b) + 1]) })
205                        };
206                    this.opt.acrossElements && (e = "wrapMatchesAcrossElements"), 0 === h ? this.opt.done(d) : j(g[0])
207                }
208            }, {
209                key: "unmark",
210                value: function(a) {
211                    var b = this;
212                    this.opt = a;
213                    var c = this.opt.element ? this.opt.element : "*";
214                    c += "[data-markjs]", this.opt.className && (c += "." + this.opt.className), this.log('Removal selector "' + c + '"'), this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, function(a) { b.unwrapMatches(a) }, function(a) {
215                        var d = e.matches(a, c),
216                            f = b.matchesExclude(a, !1);
217                        return !d || f ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
218                    }, this.opt.done)
219                }
220            }, { key: "opt", set: function(b) { this._opt = _extends({}, { element: "", className: "", exclude: [], iframes: !1, separateWordSearch: !0, diacritics: !0, synonyms: {}, accuracy: "partially", acrossElements: !1, caseSensitive: !1, ignoreJoiners: !1, ignoreGroups: 0, each: function() {}, noMatch: function() {}, filter: function() { return !0 }, done: function() {}, debug: !1, log: a.console }, b) }, get: function() { return this._opt } }, { key: "iterator", get: function() { return this._iterator || (this._iterator = new e(this.ctx, this.opt.iframes, this.opt.exclude)), this._iterator } }]), c
221        }(),
222        e = function() {
223            function a(b) {
224                var c = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
225                    d = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];
226                _classCallCheck(this, a), this.ctx = b, this.iframes = c, this.exclude = d
227            }
228            return _createClass(a, [{
229                key: "getContexts",
230                value: function() {
231                    var a = void 0,
232                        c = [];
233                    return a = "undefined" != typeof this.ctx && this.ctx ? NodeList.prototype.isPrototypeOf(this.ctx) ? Array.prototype.slice.call(this.ctx) : Array.isArray(this.ctx) ? this.ctx : "string" == typeof this.ctx ? Array.prototype.slice.call(b.querySelectorAll(this.ctx)) : [this.ctx] : [], a.forEach(function(a) {
234                        var b = c.filter(function(b) { return b.contains(a) }).length > 0;
235                        c.indexOf(a) !== -1 || b || c.push(a)
236                    }), c
237                }
238            }, {
239                key: "getIframeContents",
240                value: function(a, b) {
241                    var c = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function() {},
242                        d = void 0;
243                    try { var e = a.contentWindow; if (d = e.document, !e || !d) throw new Error("iframe inaccessible") } catch (a) { c() }
244                    d && b(d)
245                }
246            }, {
247                key: "onIframeReady",
248                value: function(a, b, c) {
249                    var d = this;
250                    try {
251                        ! function() {
252                            var e = a.contentWindow,
253                                f = "about:blank",
254                                g = "complete",
255                                h = function() {
256                                    var b = a.getAttribute("src").trim(),
257                                        c = e.location.href;
258                                    return c === f && b !== f && b
259                                },
260                                i = function() {
261                                    var e = function e() { try { h() || (a.removeEventListener("load", e), d.getIframeContents(a, b, c)) } catch (a) { c() } };
262                                    a.addEventListener("load", e)
263                                };
264                            e.document.readyState === g ? h() ? i() : d.getIframeContents(a, b, c) : i()
265                        }()
266                    } catch (a) { c() }
267                }
268            }, {
269                key: "waitForIframes",
270                value: function(a, b) {
271                    var c = this,
272                        d = 0;
273                    this.forEachIframe(a, function() { return !0 }, function(a) { d++, c.waitForIframes(a.querySelector("html"), function() {--d || b() }) }, function(a) { a || b() })
274                }
275            }, {
276                key: "forEachIframe",
277                value: function(b, c, d) {
278                    var e = this,
279                        f = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function() {},
280                        g = b.querySelectorAll("iframe"),
281                        h = g.length,
282                        i = 0;
283                    g = Array.prototype.slice.call(g);
284                    var j = function() {--h <= 0 && f(i) };
285                    h || j(), g.forEach(function(b) { a.matches(b, e.exclude) ? j() : e.onIframeReady(b, function(a) { c(b) && (i++, d(a)), j() }, j) })
286                }
287            }, { key: "createIterator", value: function(a, c, d) { return b.createNodeIterator(a, c, d, !1) } }, { key: "createInstanceOnIframe", value: function(b) { return new a(b.querySelector("html"), this.iframes) } }, {
288                key: "compareNodeIframe",
289                value: function(a, b, c) {
290                    var d = a.compareDocumentPosition(c),
291                        e = Node.DOCUMENT_POSITION_PRECEDING;
292                    if (d & e) {
293                        if (null === b) return !0;
294                        var f = b.compareDocumentPosition(c),
295                            g = Node.DOCUMENT_POSITION_FOLLOWING;
296                        if (f & g) return !0
297                    }
298                    return !1
299                }
300            }, {
301                key: "getIteratorNode",
302                value: function(a) {
303                    var b = a.previousNode(),
304                        c = void 0;
305                    return c = null === b ? a.nextNode() : a.nextNode() && a.nextNode(), { prevNode: b, node: c }
306                }
307            }, {
308                key: "checkIframeFilter",
309                value: function(a, b, c, d) {
310                    var e = !1,
311                        f = !1;
312                    return d.forEach(function(a, b) { a.val === c && (e = b, f = a.handled) }), this.compareNodeIframe(a, b, c) ? (e !== !1 || f ? e === !1 || f || (d[e].handled = !0) : d.push({ val: c, handled: !0 }), !0) : (e === !1 && d.push({ val: c, handled: !1 }), !1)
313                }
314            }, {
315                key: "handleOpenIframes",
316                value: function(a, b, c, d) {
317                    var e = this;
318                    a.forEach(function(a) { a.handled || e.getIframeContents(a.val, function(a) { e.createInstanceOnIframe(a).forEac
vendor: 2,016 bytes, lines 318-349
318hNode(b, c, d) }) })
319                }
320            }, {
321                key: "iterateThroughNodes",
322                value: function(a, b, c, d, e) {
323                    for (var f = this, g = this.createIterator(b, a, d), h = [], i = [], j = void 0, k = void 0, l = function() { var a = f.getIteratorNode(g); return k = a.prevNode, j = a.node }; l();) this.iframes && this.forEachIframe(b, function(a) { return f.checkIframeFilter(j, k, a, h) }, function(b) { f.createInstanceOnIframe(b).forEachNode(a, c, d) }), i.push(j);
324                    i.forEach(function(a) { c(a) }), this.iframes && this.handleOpenIframes(h, a, c, d), e()
325                }
326            }, {
327                key: "forEachNode",
328                value: function(a, b, c) {
329                    var d = this,
330                        e = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function() {},
331                        f = this.getContexts(),
332                        g = f.length;
333                    g || e(), f.forEach(function(f) {
334                        var h = function() { d.iterateThroughNodes(a, f, b, c, function() {--g <= 0 && e() }) };
335                        d.iframes ? d.waitForIframes(f, h) : h()
336                    })
337                }
338            }], [{
339                key: "matches",
340                value: function(a, b) {
341                    var c = "string" == typeof b ? [b] : b,
342                        d = a.matches || a.matchesSelector || a.msMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.webkitMatchesSelector;
343                    if (d) { var e = !1; return c.every(function(b) { return !d.call(a, b) || (e = !0, !1) }), e }
344                    return !1
345                }
346            }]), a
347        }();
348    return c.fn.mark = function(a, b) { return new d(this.get()).mark(a, b), this }, c.fn.markRegExp = function(a, b) { return new d(this.get()).markRegExp(a, b), this }, c.fn.unmark = function(a) { return new d(this.get()).unmark(a), this }, c
349}, window, document);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.