*/t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i<n.length;i++){var s=n[i],o=e[s];if(Array.isArray(o)){r[s]=o.slice();continue}if(typeof o=="string"||typeof o=="number"||typeof o=="boolean"){r[s]=o;continue}throw new TypeError("clone is not deep and does not support nested objects")}return r},t.FieldRef=function(e,r,n){this.docRef=e,this.fieldName=r,this._stringValue=n},t.FieldRef.joiner="/",t.FieldRef.fromString=function(e){var r=e.indexOf(t.FieldRef.joiner);if(r===-1)throw"malformedfieldrefstring";varn=e.slice(0,r),i=e.slice(r+1);returnnewt.FieldRef(i,n,e)},t.FieldRef.prototype.toString=function(){returnthis._stringValue==null&&(this._stringValue=this.fieldName+t.FieldRef.joiner+this.docRef),this._stringValue};/*!
*lunr.Set
*Copyright(C)2020OliverNightingale
*/t.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var r=0;r<this.length;r++)this.elements[e[r]]=!0}else this.length=0},t.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},t.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},t.Set.prototype.contains=function(e){return!!this.elements[e]},t.Set.prototype.intersect=function(e){var r,n,i,s=[];if(e===t.Set.complete)return this;if(e===t.Set.empty)return e;this.length<e.length?(r=this,n=e):(r=e,n=this),i=Object.keys(r.elements);for(var o=0;o<i.length;o++){var a=i[o];a in n.elements&&s.push(a)}return new t.Set(s)},t.Set.prototype.union=function(e){return e===t.Set.complete?t.Set.complete:e===t.Set.empty?this:new t.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},t.idf=function(e,r){var n=0;for(var i in e)i!="_index"&&(n+=Object.keys(e[i]).length);var s=(r-n+.5)/(n+.5);returnMath.log(1+Math.abs(s))},t.Token=function(e,r){this.str=e||"",this.metadata=r||{}},t.Token.prototype.toString=function(){returnthis.str},t.Token.prototype.update=function(e){returnthis.str=e(this.str,this.metadata),this},t.Token.prototype.clone=function(e){returne=e||function(r){returnr},newt.Token(e(this.str,this.metadata),this.metadata)};/*!
*/t.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=t.tokenizer,this.pipeline=new t.Pipeline,this.searchPipeline=new t.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},t.Builder.prototype.ref=function(e){this._ref=e},t.Builder.prototype.field=function(e,r){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=r||{}},t.Builder.prototype.b=function(e){e<0?this._b=0:e>1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){varn=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(vars=0;s<i.length;s++){varo=i[s],a=this._fields[o].extractor,u=a?a(e):e[o],c=this.tokenizer(u,{fields:[o]}),l=this.pipeline.run(c),g=newt.FieldRef(n,o),f=Object.create(null);this.fieldTermFrequencies[g]=f,this.fieldLengths[g]=0,this.fieldLengths[g]+=l.length;for(varv=0;v<l.length;v++){varm=l[v];if(f[m]==null&&(f[m]=0),f[m]+=1,this.invertedIndex[m]==null){varx=Object.create(null);x._index=this.termIndex,this.termIndex+=1;for(vard=0;d<i.length;d++)x[i[d]]=Object.create(null);this.invertedIndex[m]=x}this.invertedIndex[m][o][n]==null&&(this.invertedIndex[m][o][n]=Object.create(null));for(vary=0;y<this.metadataWhitelist.length;y++){varb=this.metadataWhitelist[y],E=m.metadata[b];this.invertedIndex[m][o][n][b]==null&&(this.invertedIndex[m][o][n][b]=[]),this.invertedIndex[m][o][n][b].push(E)}}}},t.Builder.prototype.calculateAverageFieldLengths=function(){for(vare=Object.keys(this.fieldLengths),r=e.length,n={},i={},s=0;s<r;s++){varo=t.FieldRef.fromString(e[s]),a=o.fieldName;i[a]||(i[a]=0),i[a]+=1,n[a]||(n[a]=0),n[a]+=this.fieldLengths[o]}for(varu=Object.keys(this._fields),s=0;s<u.length;s++){varc=u[s];n[c]=n[c]/i[c]}this.averageFieldLength=n},t.Builder.prototype.createFieldVectors=function(){for(vare={},r=Object.keys(this.fieldTermFrequencies),n=r.length,i=Object.create(null),s=0;s<n;s++){for(varo=t.FieldRef.fromString(r[s]),a=o.fieldName,u=this.fieldLengths[o],c=newt.Vector,l=this.fieldTermFrequencies[o],g=Object.keys(l),f=g.length,v=this._fields[a].boost||1,m=this._documents[o.docRef].boost||1,x=0;x<f;x++){vard=g[x],y=l[d],b=this.invertedIndex[d]._index,E,w,R;i[d]===void0?(E=t.idf(this.invertedIndex[d],this.documentCount),i[d]=E):E=i[d],w=E*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(u/this.averageFieldLength[a]))+y),w*=v,w*=m,R=Math.round(w*1e3)/1e3,c.insert(b,R)}e[o]=c}this.fieldVectors=e},t.Builder.prototype.createTokenSet=function(){this.tokenSet=t.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},t.Builder.prototype.build=function(){returnthis.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),newt.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},t.Builder.prototype.use=function(e){varr=Array.prototype.slice.call(arguments,1);r.unshift(this),e.apply(this,r)},t.MatchData=function(e,r,n){for(vari=Object.create(null),s=Object.keys(n||{}),o=0;o<s.length;o++){vara=s[o];i[a]=n[a].slice()}this.metadata=Object.create(null),e!==void0&&(this.metadata[e]=Object.create(null),this.metadata[e][r]=i)},t.MatchData.prototype.combine=function(e){for(varr=Object.keys(e.metadata),n=0;n<r.length;n++){vari=r[n],s=Object.keys(e.metadata[i]);this.metadata[i]==null&&(this.metadata[i]=Object.create(null));for(varo=0;o<s.length;o++){vara=s[o],u=Object.keys(e.metadata[i][a]);this.metadata[i][a]==null&&(this.metadata[i][a]=Object.create(null));for(varc=0;c<u.length;c++){varl=u[c];this.metadata[i][a][l]==null?this.metadata[i][a][l]=e.metadata[i][a][l]:this.metadata[i][a][l]=this.metadata[i][a][l].concat(e.metadata[i][a][l])}}}},t.MatchData.prototype.add=function(e,r,n){if(!(einthis.metadata)){this.metadata[e]=Object.create(null),this.metadata[e][r]=n;return