/*! * Simple-Jekyll-Search * Copyright 2015-2020, Christian Fei * Licensed under the MIT License. */ !function() { "use strict"; var f = { compile: function(r) { return i.template.replace(i.pattern, function(t, e) { var n = i.middleware(e, r[e], i.template); return void 0 !== n ? n : r[e] || t }) }, setOptions: function(t) { i.pattern = t.pattern || i.pattern, i.template = t.template || i.template, "function" == typeof t.middleware && (i.middleware = t.middleware) } }; const i = { pattern: /\{(.*?)\}/g, template: "", middleware: function() {} }; var n = function(t, e) { var n = e.length, r = t.length; if (n < r) return !1; if (r === n) return t === e; t: for (var i = 0, o = 0; i < r; i++) { for (var u = t.charCodeAt(i); o < n;) if (e.charCodeAt(o++) === u) continue t; return !1 } return !0 }, e = new function() { this.matches = function(t, e) { return n(e.toLowerCase(), t.toLowerCase()) } }, r = new function() { this.matches = function(e, t) { return !!e && (e = e.trim().toLowerCase(), (t = t.trim().toLowerCase()).split(" ").filter(function(t) { return 0 <= e.indexOf(t) }).length === t.split(" ").length) } }, d = { put: function(t) { if (l(t)) return a(t); if (function(t) { return Boolean(t) && "[object Array]" === Object.prototype.toString.call(t) }(t)) return function(n) { const r = []; s(); for (let t = 0, e = n.length; t < e; t++) l(n[t]) && r.push(a(n[t])); return r }(t); return undefined }, clear: s, search: function(t) { return t ? function(e, n, r, i) { const o = []; for (let t = 0; t < e.length && o.length < i.limit; t++) { var u = function(t, e, n, r) { for (const i in t) if (! function(n, r) { for (let t = 0, e = r.length; t < e; t++) { var i = r[t]; if (new RegExp(i).test(n)) return !0 } return !1 }(t[i], r.exclude) && n.matches(t[i], e)) return t }(e[t], n, r, i); u && o.push(u) } return o }(u, t, c.searchStrategy, c).sort(c.sort) : [] }, setOptions: function(t) { c = t || {}, c.fuzzy = t.fuzzy || !1, c.limit = t.limit || 10, c.searchStrategy = t.fuzzy ? e : r, c.sort = t.sort || o, c.exclude = t.exclude || [] } }; function o() { return 0 } const u = []; let c = {}; function s() { return u.length = 0, u } function l(t) { return Boolean(t) && "[object Object]" === Object.prototype.toString.call(t) } function a(t) { return u.push(t), u } c.fuzzy = !1, c.limit = 10, c.searchStrategy = c.fuzzy ? e : r, c.sort = o, c.exclude = []; var p = { load: function(t, e) { const n = window.XMLHttpRequest ? new window.XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"); n.open("GET", t, !0), n.onreadystatechange = h(n, e), n.send() } }; function h(e, n) { return function() { if (4 === e.readyState && 200 === e.status) try { n(null, JSON.parse(e.responseText)) } catch (t) { n(t, null) } } } var m = function y(t) { if (!(e = t) || !("undefined" != typeof e.required && e.required instanceof Array)) throw new Error("-- OptionsValidator: required options missing"); var e; if (!(this instanceof y)) return new y(t); const r = t.required; this.getRequiredOptions = function() { return r }, this.validate = function(e) { const n = []; return r.forEach(function(t) { "undefined" == typeof e[t] && n.push(t) }), n } }, w = { merge: function(t, e) { const n = {}; for (const r in t) n[r] = t[r], "undefined" != typeof e[r] && (n[r] = e[r]); return n }, isJSON: function(t) { try { return t instanceof Object && JSON.parse(JSON.stringify(t)) ? !0 : !1 } catch (e) { return !1 } } }; ! function(t) { let i = { searchInput: null, resultsContainer: null, json: [], success: Function.prototype, searchResultTemplate: '