e=this,t=function(){"use strict";function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var n,s=0;se.length)&&(t=e.length);for(var n=0,s=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:3,e=new Map,t=Math.pow(10,n);return{get:function(n){if(s=n.match(M).length,e.has(s))return e.get(s);var s,i=1/Math.sqrt(s),o=parseFloat(Math.round(i*t)/t);return e.set(s,o),o},clear:function(){e.clear()}}}u=function(){function o(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=s.getFn,i=void 0===n?e.getFn:n;t(this,o),this.norm=le(3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return n(o,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=e,this._keysMap={},e.forEach(function(e,n){t._keysMap[e.id]=n})}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,a(this.docs[0])?this.docs.forEach(function(t,n){e._addString(t,n)}):this.docs.forEach(function(t,n){e._addObject(t,n)}),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();a(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},o=i.getFn,a=void 0===o?e.getFn:o,s=new u({getFn:a});return s.setKeys(t.map(E)),s.setSources(n),s.create(),s}function h(t){var s,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=n.errors,f=void 0===d?0:d,l=n.currentLocation,u=void 0===l?0:l,a=n.expectedLocation,h=void 0===a?0:a,r=n.distance,c=void 0===r?e.distance:r,i=n.ignoreLocation,m=void 0===i?e.ignoreLocation:i,o=f/t.length;return m?o:(s=Math.abs(h-u),c?o+s/c:s?1:o)}function Y(){for(var i,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.minMatchCharLength,o=[],t=-1,r=-1,n=0,c=s.length;n=a&&o.push([t,r]),t=-1);return s[n-1]&&n-t>=a&&o.push([t,n-1]),o}function W(e){for(var s,n={},t=0,o=e.length;t1&&void 0!==arguments[1]?arguments[1]:{},u=o.location,x=void 0===u?e.location:u,p=o.threshold,w=void 0===p?e.threshold:p,l=o.distance,k=void 0===l?e.distance:l,h=o.includeMatches,C=void 0===h?e.includeMatches:h,f=o.findAllMatches,O=void 0===f?e.findAllMatches:f,g=o.minMatchCharLength,y=void 0===g?e.minMatchCharLength:g,d=o.isCaseSensitive,b=void 0===d?e.isCaseSensitive:d,v=o.ignoreLocation,_=void 0===v?e.ignoreLocation:v;if(t(this,s),this.options={location:x,threshold:w,distance:k,includeMatches:C,findAllMatches:O,minMatchCharLength:y,isCaseSensitive:b,ignoreLocation:_},this.pattern=b?n:n.toLowerCase(),this.chunks=[],this.pattern.length)if(a=function(e,t){j.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},i=this.pattern.length,i>32){for(var r=0,m=i%32,E=i-m;r3&&void 0!==arguments[3]?arguments[3]:{},B=r.location,$=void 0===B?e.location:B,M=r.distance,j=void 0===M?e.distance:M,D=r.threshold,U=void 0===D?e.threshold:D,I=r.findAllMatches,W=void 0===I?e.findAllMatches:I,T=r.minMatchCharLength,F=void 0===T?e.minMatchCharLength:T,L=r.includeMatches,V=void 0===L?e.includeMatches:L,N=r.ignoreLocation,y=void 0===N?e.ignoreLocation:N;if(n.length>32)throw new Error(fe(32));for(var _,l=n.length,g=t.length,i=Math.max(0,Math.min($,g)),m=U,u=i,v=F>1||V,k=v?Array(g):[];(_=t.indexOf(n,u))>-1;)if(z=h(n,{currentLocation:_,expectedLocation:i,distance:j,ignoreLocation:y}),m=Math.min(z,m),u=_+l,v)for(x=0;x=P;o-=1)if(p=o-1,S=s[t.charAt(p)],v&&(k[p]=+!!S),d[o]=(d[o+1]<<1|1)&S,c&&(d[o]|=(O[o+1]|O[o])<<1|1|O[o+1]),d[o]&K&&(E=h(n,{errors:c,currentLocation:p,expectedLocation:i,distance:j,ignoreLocation:y}))<=m){if(m=E,(u=p)<=i)break;P=Math.max(1,2*i-u)}if(H=h(n,{errors:c+1,currentLocation:i,expectedLocation:i,distance:j,ignoreLocation:y}),H>m)break;O=d}return b={isMatch:u>=0,score:Math.max(.001,E)},v&&(A=Y(k,F),A.length?V&&(b.indices=A):b.isMatch=!1),b}(t,b,j,{location:v+y,distance:u,threshold:g,findAllMatches:p,minMatchCharLength:m,includeMatches:a,ignoreLocation:f}),r=i.isMatch,_=i.score,c=i.indices;r&&(s=!0),d+=_,r&&c&&(o=[].concat(l(o),l(c)))}),i={isMatch:s,score:s?d/this.chunks.length:1},s&&a&&(i.indices=o),i}}]),s}(),o=function(){function e(n){t(this,e),this.pattern=n}return n(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return H(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return H(e,this.singleRegex)}}]),e}();function H(e,t){var n=e.match(t);return n?n[1]:null}var G=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),s}(o),U=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),s}(o),q=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),s}(o),ne=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),s}(o),K=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),s}(o),se=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),s}(o),$=function(s){r(o,s);var i=c(o);function o(n){var f,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=s.location,g=void 0===h?e.location:h,l=s.threshold,p=void 0===l?e.threshold:l,u=s.distance,y=void 0===u?e.distance:u,a=s.includeMatches,w=void 0===a?e.includeMatches:a,d=s.findAllMatches,v=void 0===d?e.findAllMatches:d,m=s.minMatchCharLength,j=void 0===m?e.minMatchCharLength:m,r=s.isCaseSensitive,_=void 0===r?e.isCaseSensitive:r,c=s.ignoreLocation,O=void 0===c?e.ignoreLocation:c;return t(this,o),(f=i.call(this,n))._bitapSearch=new b(n,{location:g,threshold:p,distance:y,includeMatches:w,findAllMatches:v,minMatchCharLength:j,isCaseSensitive:_,ignoreLocation:O}),f}return n(o,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),o}(o),V=function(e){r(s,e);var o=c(s);function s(e){return t(this,s),o.call(this,e)}return n(s,[{key:"search",value:function(e){for(var t,o,n=0,s=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,s.push([t,n-1]);return o=!!s.length,{isMatch:o,score:o?0:1,indices:s}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),s}(o),g=[G,V,q,ne,se,K,U,$],I=g.length,X=/ +(?=([^"]*"[^"]*")*[^"]*$)/;function oe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map(function(e){for(var a,r,c,l,d=e.trim().split(X).filter(function(e){return e&&!!e.trim()}),s=[],o=0,h=d.length;o1&&void 0!==arguments[1]?arguments[1]:{},a=o.isCaseSensitive,r=void 0===a?e.isCaseSensitive:a,c=o.includeMatches,j=void 0===c?e.includeMatches:c,d=o.minMatchCharLength,v=void 0===d?e.minMatchCharLength:d,h=o.ignoreLocation,f=void 0===h?e.ignoreLocation:h,m=o.findAllMatches,p=void 0===m?e.findAllMatches:m,i=o.location,g=void 0===i?e.location:i,u=o.threshold,b=void 0===u?e.threshold:u,l=o.distance,y=void 0===l?e.distance:l;t(this,s),this.query=null,this.options={isCaseSensitive:r,includeMatches:j,minMatchCharLength:v,findAllMatches:p,ignoreLocation:f,location:g,threshold:b,distance:y},this.pattern=r?n:n.toLowerCase(),this.query=oe(this.pattern,this.options)}return n(s,[{key:"searchIn",value:function(e){if(o=this.query,!o)return{isMatch:!1,score:1};var s,o,i,c,h,g,m=this.options,f=m.includeMatches;e=m.isCaseSensitive?e:e.toLowerCase();for(var n=0,t=[],a=0,r=0,j=o.length;r-1&&(n.refIndex=e.idx),t.matches.push(n)}})}function he(e,t){t.score=e.score}function me(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.includeMatches,r=void 0===i?e.includeMatches:i,a=o.includeScore,c=void 0===a?e.includeScore:a,s=[];return r&&s.push(ue),c&&s.push(he),t.map(function(e){var t=e.idx,o={item:n[t],refIndex:t};return s.length&&s.forEach(function(t){t(e,o)}),o})}return d=function(){function o(n){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;t(this,o),this.options=L({},e,{},s),this.options.useExtendedSearch,this._keyStore=new Q(this.options.keys),this.setCollection(n,i)}return n(o,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof u))throw new Error("Incorrect 'index' type");this._myIndex=t||x(this.options.keys,this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){s(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},n=[],e=0,s=this._docs.length;e1&&void 0!==arguments[1]?arguments[1]:{},o=i.limit,s=void 0===o?-1:o,t=this.options,r=t.includeMatches,c=t.includeScore,l=t.shouldSort,d=t.sortFn,u=t.ignoreFieldNorm,n=a(e)?a(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return de(n,{ignoreFieldNorm:u}),l&&n.sort(d),B(s)&&s>-1&&(n=n.slice(0,s)),me(n,this._docs,{includeMatches:r,includeScore:c})}},{key:"_searchStringList",value:function(e){var n=v(e,this.options),o=this._myIndex.records,t=[];return o.forEach(function(e){var o=e.v,a=e.i,r=e.n;if(s(o)){var i=n.searchIn(o),c=i.isMatch,l=i.score,d=i.indices;c&&t.push({item:o,idx:a,matches:[{score:l,value:o,norm:r,indices:d}]})}}),t}},{key:"_searchLogical",value:function(e){var n=this,r=function(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=s.auto,o=void 0===n||n,r=function e(n){var r,c,d,u,s=Object.keys(n),l=re(n);if(!l&&s.length>1&&!w(n))return e(F(n));if(ce(n)){if(r=l?n[C]:s[0],c=l?n[ie]:n[r],!a(c))throw new Error(ae(r));return d={keyId:_(r),pattern:c},o&&(d.searcher=v(c,t)),d}return u={children:[],operator:s[0]},s.forEach(function(t){var s=n[t];i(s)&&s.forEach(function(t){u.children.push(e(t))})}),u};return w(e)||(e=F(e)),r(e)}(e,this.options),c=this._myIndex.records,t={},o=[];return c.forEach(function(e){var c,a=e.$,i=e.i;s(a)&&(c=function e(t,s,o){if(!t.children){var c,h,m=t.keyId,p=t.searcher,i=n._findMatches({key:n._keyStore.get(m),value:n._myIndex.getValueForItemAtKeyId(s,m),searcher:p});return i&&i.length?[{idx:o,item:s,matches:i}]:[]}switch(t.operator){case f:for(var a=[],r=0,g=t.children.length;r1&&void 0!==arguments[1]?arguments[1]:{},s=o.getFn,i=void 0===s?e.getFn:s,a=t.keys,r=t.records,n=new u({getFn:i});return n.setKeys(a),n.setIndexRecords(r),n},d.config=e,function(){m.push.apply(m,arguments)}(J),d},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Fuse=t();var e,t,fuse,searchVisible=!1,firstRun=!0,list=document.querySelector(".search-list"),first=list.firstChild,last=list.lastChild,maininput=document.querySelector(".search-ui input"),searchResultsHeading=document.querySelector(".search-results"),noResults=document.querySelector(".no-results"),resultsAvailable=!1;document.querySelector(".open-search").addEventListener("click",openSearch),document.querySelector(".close-search").addEventListener("click",closeSearch);function closeSearch(){document.querySelector(".search-ui").classList.add("hidden"),document.activeElement.blur(),searchVisible=!1,searchResultsHeading.classList.add("hidden")}function openSearch(){firstRun&&(loadSearch(),firstRun=!1),mobileMenu.classList.toggle("hidden"),searchVisible||(document.querySelector(".search-ui").classList.remove("hidden"),document.querySelector(".search-ui input").focus(),searchVisible=!0)}document.addEventListener("keydown",function(e){e.metaKey&&e.which===191&&openSearch(),e.keyCode==27&&searchVisible&&(document.querySelector(".search-ui").classList.add("hidden"),document.activeElement.blur(),searchVisible=!1,searchResultsHeading.classList.add("hidden")),e.keyCode==40&&searchVisible&&resultsAvailable&&(console.log("down"),e.preventDefault(),document.activeElement==maininput?first.focus():document.activeElement==last?last.focus():document.activeElement.parentElement.nextSibling.firstElementChild.focus()),e.keyCode==38&&searchVisible&&resultsAvailable&&(e.preventDefault(),document.activeElement==maininput?maininput.focus():document.activeElement==first?maininput.focus():document.activeElement.parentElement.previousSibling.firstElementChild.focus())}),document.querySelector(".search-ui input").onkeyup=function(){executeSearch(this.value)};function fetchJSONFile(e,t){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===4&&n.status===200){var e=JSON.parse(n.responseText);t&&t(e)}},n.open("GET",e),n.send()}function loadSearch(){const e=document.querySelector('head > meta[name="lang"]')?.getAttribute?.("content");fetchJSONFile(`${e?"/"+e:""}/index.json`,function(e){var t={shouldSort:!0,location:0,distance:100,threshold:.4,minMatchCharLength:2,keys:["title","permalink","contents"]};fuse=new Fuse(e,t)})}function executeSearch(e){let t=fuse.search(e),n="";if(t.length===0)resultsAvailable=!1,n="",e!==""?noResults.classList.remove("hidden"):noResults.classList.add("hidden");else{noResults.classList.add("hidden"),e!==""&&searchResultsHeading.classList.remove("hidden");for(let e in t.slice(0,5)){const s='
'+t[e].item.title+"
",o=t[e].item.date?'
'+new Date(t[e].item.date).toUTCString().substring(0,16)+"
":"",i='
'+t[e].item.contents+"
";n=n+'
  • '+s+""+o+i+"
  • "}resultsAvailable=!0}list.innerHTML=n,t.length>0&&(first=list.firstChild.firstElementChild,last=list.lastChild.firstElementChild)}