/*! * Simple-Jekyll-Search v1.7.8 (https://github.com/christian-fei/Simple-Jekyll-Search) * Copyright 2015-2020, Christian Fei * Licensed under the MIT License. */ !function(){"use strict";var t={compile:function(t){return e.template.replace(e.pattern,function(n,r){var i=e.middleware(r,t[r],e.template);return void 0!==i?i:t[r]||n})},setOptions:function(t){e.pattern=t.pattern||e.pattern,e.template=t.template||e.template,"function"==typeof t.middleware&&(e.middleware=t.middleware)}},e={};e.pattern=/\{(.*?)\}/g,e.template="",e.middleware=function(){};var n=function(t,e){var n=e.length,r=t.length;if(r>n)return!1;if(r===n)return t===e;t:for(var i=0,o=0;i=0}).length===e.split(" ").length)}};var o={put:function(t){if(l(t))return f(t);if(e=t,Boolean(e)&&"[object Array]"===Object.prototype.toString.call(e))return function(t){var e=[];s();for(var n=0,r=t.length;n{title}',templateMiddleware:Function.prototype,sortMiddleware:function(){return 0},noResultsText:"No results found",limit:10,fuzzy:!1,exclude:[]},r=["searchInput","resultsContainer","json"],i=function t(e){if(!function(t){return!!t&&(void 0!==t.required&&t.required instanceof Array)}(e))throw new Error("-- OptionsValidator: required options missing");if(!(this instanceof t))return new t(e);var n=e.required;this.getRequiredOptions=function(){return n},this.validate=function(t){var e=[];return n.forEach(function(n){void 0===t[n]&&e.push(n)}),e}}({required:r}),u=function(e){var u;return i.validate(e).length>0&&f("You must specify the following required options: "+r),n=v.merge(n,e),t.setOptions({template:n.searchResultTemplate,middleware:n.templateMiddleware}),o.setOptions({fuzzy:n.fuzzy,limit:n.limit,sort:n.sortMiddleware}),v.isJSON(n.json)?a(n.json):(u=n.json,h.load(u,function(t,e){t&&f("failed to get JSON ("+u+")"),a(e)})),{search:l}};function a(t){o.put(t),n.searchInput.addEventListener("keyup",function(t){var e;e=t.which,-1===[13,16,20,37,38,39,40,91].indexOf(e)&&(c(),l(t.target.value))})}function c(){n.resultsContainer.innerHTML=""}function s(t){n.resultsContainer.innerHTML+=t}function l(e){(function(t){return t&&t.length>0})(e)&&(c(),function(e,r){var i=e.length;if(0===i)return s(n.noResultsText);for(var o=0;o