/**
 * elasticlunr - http://weixsong.github.io
 * Lightweight full-text search engine in Javascript for browser search and offline search. - 1.0.1
 *
 * Copyright (C) 2022 Oliver Nightingale
 * Copyright (C) 2022 Wei Song
 * MIT Licensed
 * @license
 */
!function(){function h(e){var t=new h.Index;return t.pipeline.add(h.trimmer,h.stopWordFilter,h.stemmer),e&&e.call(t,t),t}var a,c,d,f,p,g,y,v,m,S,x,w,I,b,E,F,D,_,P,k,z,N,e,t;h.version="1.0.1",((globalThis.lunr=h).utils={}).warn=function(e){globalThis.console&&console.warn&&console.warn(e)},h.utils.toString=function(e){return null==e?"":e.toString()},(h.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},h.EventEmitter.prototype.removeListener=function(e,t){!this.hasHandler(e)||-1!==(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length&&delete this.events[e])},h.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=Array.prototype.slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},h.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(h.tokenizer=function(e){return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return h.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(h.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(h.tokenizer.seperator):[];var t,n}).defaultSeperator=/[\s\-]+/,h.tokenizer.seperator=h.tokenizer.defaultSeperator,h.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(h.tokenizer.seperator=e)},h.tokenizer.resetSeperator=function(){h.tokenizer.seperator=h.tokenizer.defaultSeperator},h.tokenizer.getSeperator=function(){return h.tokenizer.seperator},(h.Pipeline=function(){this._queue=[]}).registeredFunctions={},h.Pipeline.registerFunction=function(e,t){t in h.Pipeline.registeredFunctions&&h.utils.warn("Overwriting existing registered function: "+t),e.label=t,h.Pipeline.registeredFunctions[t]=e},h.Pipeline.getRegisteredFunction=function(e){return e in h.Pipeline.registeredFunctions!=!0?null:h.Pipeline.registeredFunctions[e]},h.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||h.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},h.Pipeline.load=function(e){var n=new h.Pipeline;return e.forEach(function(e){var t=h.Pipeline.getRegisteredFunction(e);if(!t)throw new Error("Cannot load un-registered function: "+e);n.add(t)}),n},h.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){h.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},h.Pipeline.prototype.after=function(e,t){h.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e+1,0,t)},h.Pipeline.prototype.before=function(e,t){h.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1===e)throw new Error("Cannot find existingFn");this._queue.splice(e,0,t)},h.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!==e&&this._queue.splice(e,1)},h.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i<n;i++){for(var r=e[i],s=0;s<o&&null!=(r=this._queue[s](r,i,e));s++);null!=r&&t.push(r)}return t},h.Pipeline.prototype.reset=function(){this._queue=[]},h.Pipeline.prototype.get=function(){return this._queue},h.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return h.Pipeline.warnIfFunctionNotRegistered(e),e.label})},(h.Index=function(){this._fields=[],this._ref="id",this.pipeline=new h.Pipeline,this.documentStore=new h.DocumentStore,this.index={},this.eventEmitter=new h.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))}).prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},h.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},h.Index.load=function(e){e.version!==h.version&&h.utils.warn("version mismatch: current "+h.version+" importing "+e.version);var t,n=new this;for(t in n._fields=e.fields,n._ref=e.ref,n.documentStore=h.DocumentStore.load(e.documentStore),n.pipeline=h.Pipeline.load(e.pipeline),n.index={},e.index)n.index[t]=h.InvertedIndex.load(e.index[t]);return n},h.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new h.InvertedIndex,this},h.Index.prototype.setRef=function(e){return this._ref=e,this},h.Index.prototype.saveDocument=function(e){return this.documentStore=new h.DocumentStore(e),this},h.Index.prototype.addDoc=function(r,e){var s;r&&(e=void 0===e||e,s=r[this._ref],this.documentStore.addDoc(s,r),this._fields.forEach(function(e){var t,n=this.pipeline.run(h.tokenizer(r[e])),o=(this.documentStore.addFieldLength(s,e,n.length),{});for(t in n.forEach(function(e){e in o?o[e]+=1:o[e]=1},this),o){var i=o[t],i=Math.sqrt(i);this.index[e].addToken(t,{ref:s,tf:i})}},this),e&&this.eventEmitter.emit("add",r,this))},h.Index.prototype.removeDocByRef=function(e,t){e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)&&(e=this.documentStore.getDoc(e),this.removeDoc(e,!1))},h.Index.prototype.removeDoc=function(e,t){var n;e&&(t=void 0===t||t,n=e[this._ref],this.documentStore.hasDoc(n)&&(this.documentStore.removeDoc(n),this._fields.forEach(function(t){this.pipeline.run(h.tokenizer(e[t])).forEach(function(e){this.index[t].removeToken(e,n)},this)},this),t&&this.eventEmitter.emit("remove",e,this)))},h.Index.prototype.updateDoc=function(e,t){t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},h.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];t=this.index[t].getDocFreq(e),e=1+Math.log(this.documentStore.length/(t+1));return this._idfCache[n]=e},h.Index.prototype.getFields=function(){return this._fields.slice()},h.Index.prototype.search=function(e,t){if(!e)return[];var n,o=null,i=(null!=t&&(o=JSON.stringify(t)),new h.Configuration(o,this.getFields()).get()),r=this.pipeline.run(h.tokenizer(e)),s={};for(n in i){var u=this.fieldSearch(r,n,i),l=i[n].boost;for(a in u)u[a]=u[a]*l;for(a in u)a in s?s[a]+=u[a]:s[a]=u[a]}var a,c=[];for(a in s)c.push({ref:a,score:s[a]});return c.sort(function(e,t){return t.score-e.score}),c},h.Index.prototype.fieldSearch=function(e,h,t){var d=t[h].bool,n=t[h].expand,t=t[h].boost,f=null,p={};if(0!==t)return e.forEach(function(a){var e=[a],c=(1==n&&(e=this.index[h].expandToken(a)),{});e.forEach(function(e){var t=this.index[h].getDocs(e),n=this.idf(e,h);if(f&&"AND"==d){var o,i={};for(o in f)o in t&&(i[o]=t[o]);t=i}for(o in e==a&&this.fieldSearchStats(p,e,t),t){var r=this.index[h].getTermFrequency(e,o),s=this.documentStore.getFieldLength(o,h),u=1,l=1,r=r*n*(u=0!=s?1/Math.sqrt(s):u)*(l=e!=a?.15*(1-(e.length-a.length)/e.length):l);o in c?c[o]+=r:c[o]=r}},this),f=this.mergeScores(f,c,d)},this),f=this.coordNorm(f,p,e.length)},h.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var o={};for(i in t)i in e&&(o[i]=e[i]+t[i]);return o}for(var i in t)i in e?e[i]+=t[i]:e[i]=t[i];return e},h.Index.prototype.fieldSearchStats=function(e,t,n){for(var o in n)o in e?e[o].push(t):e[o]=[t]},h.Index.prototype.coordNorm=function(e,t,n){for(var o in e){var i;o in t&&(i=t[o].length,e[o]=e[o]*i/n)}return e},h.Index.prototype.toJSON=function(){var t={};return this._fields.forEach(function(e){t[e]=this.index[e].toJSON()},this),{version:h.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:t,pipeline:this.pipeline.toJSON()}},h.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},(h.DocumentStore=function(e){this._save=null==e||e,this.docs={},this.docInfo={},this.length=0}).load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},h.DocumentStore.prototype.isDocStored=function(){return this._save},h.DocumentStore.prototype.addDoc=function(e,t){this.hasDoc(e)||this.length++,!0===this._save?this.docs[e]=function(e){if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t):this.docs[e]=null},h.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},h.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},h.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},h.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},h.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},h.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},h.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},t="[aeiouy]",e="[^aeiou][^aeiouy]*",d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),g=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),y=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,w=/(at|bl|iz)$/,I=new RegExp("([^aeiouylsz])\\1$"),b=new RegExp("^"+e+t+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,F=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,_=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,P=/^(.+?)(s|t)(ion)$/,k=/^(.+?)e$/,z=/ll$/,N=new RegExp("^"+e+t+"[^aeiouwxy]$"),h.Pipeline.registerFunction(h.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3||("y"==(l=e.substr(0,1))&&(e=l.toUpperCase()+e.substr(1)),s=v,(i=y).test(e)?e=e.replace(i,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=S,(i=m).test(e)?(u=i.exec(e),(i=d).test(u[1])&&(e=e.replace(i=x,""))):s.test(e)&&(r=(u=s.exec(e))[1],(s=g).test(r)&&(e=r,n=I,o=b,(s=w).test(e)?e+="e":n.test(e)?e=e.replace(i=x,""):o.test(e)&&(e+="e"))),(i=E).test(e)&&(e=(r=(u=i.exec(e))[1])+"i"),(i=F).test(e)&&(r=(u=i.exec(e))[1],t=u[2],(i=d).test(r)&&(e=r+a[t])),(i=D).test(e)&&(r=(u=i.exec(e))[1],t=u[2],(i=d).test(r)&&(e=r+c[t])),s=P,(i=_).test(e)?(r=(u=i.exec(e))[1],(i=f).test(r)&&(e=r)):s.test(e)&&(r=(u=s.exec(e))[1]+u[2],(s=f).test(r)&&(e=r)),(i=k).test(e)&&(r=(u=i.exec(e))[1],s=p,n=N,((i=f).test(r)||s.test(r)&&!n.test(r))&&(e=r)),s=f,(i=z).test(e)&&s.test(e)&&(e=e.replace(i=x,"")),"y"==l&&(e=l.toLowerCase()+e.substr(1))),e},"stemmer"),h.generateStopWordFilter=function(e){var t=e.reduce(function(e,t){return e[t]=t,e},{});return function(e){return e&&t[e.toString()]!==e.toString()?e:null}},h.stopWordFilter=function(e){if(e&&!0!==h.stopWordFilter.stopWords[e])return e},h.clearStopWords=function(){h.stopWordFilter.stopWords={}},h.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){h.stopWordFilter.stopWords[e]=!0},this)},h.resetStopWords=function(){h.stopWordFilter.stopWords=h.defaultStopWords},h.stopWordFilter.stopWords=h.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},h.Pipeline.registerFunction(h.stopWordFilter,"stopWordFilter"),h.Pipeline.registerFunction(h.trimmer=function(e){if(null==e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(h.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},h.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},h.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},h.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},h.InvertedIndex.prototype.getDocs=function(e){e=this.getNode(e);return null==e?{}:e.docs},h.InvertedIndex.prototype.getTermFrequency=function(e,t){e=this.getNode(e);return null!=e&&t in e.docs?e.docs[t].tf:0},h.InvertedIndex.prototype.getDocFreq=function(e){e=this.getNode(e);return null==e?0:e.df},h.InvertedIndex.prototype.removeToken=function(e,t){!e||null!=(e=this.getNode(e))&&t in e.docs&&(delete e.docs[t],--e.df)},h.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];t=t||[];if(null!=n||null!=(n=this.getNode(e)))for(var o in 0<n.df&&t.push(e),n)"docs"!==o&&"df"!==o&&this.expandToken(e+o,t,n[o]);return t},h.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},(h.Configuration=function(e,t){var n,e=e||"";if(null==t)throw new Error("fields should not be null");this.config={};try{n=JSON.parse(e),this.buildUserConfig(n,t)}catch(e){h.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(t)}}).prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},h.Configuration.prototype.buildUserConfig=function(e,t){var n,o,i="OR",r=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(r=e.expand||r),"fields"in e)for(var s in e.fields)-1<t.indexOf(s)?(o=r,null!=(n=e.fields[s]).expand&&(o=n.expand),this.config[s]={boost:n.boost||0===n.boost?n.boost:1,bool:n.bool||i,expand:o}):h.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,r,t)},h.Configuration.prototype.addAllFields2UserConfig=function(t,n,e){e.forEach(function(e){this.config[e]={boost:1,bool:t,expand:n}},this)},h.Configuration.prototype.get=function(){return this.config},h.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){for(var e,t=0;t<arguments.length;t++)~this.indexOf(e=arguments[t])||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;){if(r===e)return i;o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i]}return r===e?i:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,o=n-t,i=t+Math.floor(o/2),r=this.elements[i];1<o;)o=(n=e<r?i:n)-(t=r<e?i:t),i=t+Math.floor(o/2),r=this.elements[i];return e<r?i:r<e?i+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,o=0,i=this.length,r=e.length,s=this.elements,u=e.elements;!(i-1<n||r-1<o);)s[n]===u[o]?(t.add(s[n]),n++,o++):s[n]<u[o]?n++:s[n]>u[o]&&o++;return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length>=e.length?(t=this,e):(t=e,this),n=t.clone(),o=0,i=e.toArray();o<i.length;o++)n.add(i[o]);return n},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},e=this,t=function(){return h},"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=h:e.elasticlunr=h}();
