*/t.utils={},t.utils.warn=(function(e){returnfunction(r){e.console&&console.warn&&console.warn(r)}})(this),t.utils.asString=function(e){returne==null?"":e.toString()},t.utils.clone=function(e){if(e==null)returne;for(varr=Object.create(null),n=Object.keys(e),i=0;i<n.length;i++){vars=n[i],o=e[s];if(Array.isArray(o)){r[s]=o.slice();continue}if(typeofo=="string"||typeofo=="number"||typeofo=="boolean"){r[s]=o;continue}thrownewTypeError("clone is not deep and does not support nested objects")}returnr},t.FieldRef=function(e,r,n){this.docRef=e,this.fieldName=r,this._stringValue=n},t.FieldRef.joiner="/",t.FieldRef.fromString=function(e){varr=e.indexOf(t.FieldRef.joiner);if(r===-1)throw"malformed field ref string";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};/*!
*/t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){rinthis.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){varr=e.label&&e.labelinthis.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index.
*/t.TokenSet=function(){this.final=!1,this.edges={},this.id=t.TokenSet._nextId,t.TokenSet._nextId+=1},t.TokenSet._nextId=1,t.TokenSet.fromArray=function(e){for(varr=newt.TokenSet.Builder,n=0,i=e.length;n<i;n++)r.insert(e[n]);returnr.finish(),r.root},t.TokenSet.fromClause=function(e){return"editDistance"ine?t.TokenSet.fromFuzzyString(e.term,e.editDistance):t.TokenSet.fromString(e.term)},t.TokenSet.fromFuzzyString=function(e,r){for(varn=newt.TokenSet,i=[{node:n,editsRemaining:r,str:e}];i.length;){vars=i.pop();if(s.str.length>0){varo=s.str.charAt(0),a;oins.node.edges?a=s.node.edges[o]:(a=newt.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"ins.node.edges)varu=s.node.edges["*"];else{varu=newt.TokenSet;s.node.edges["*"]=u}if(s.str.length==0&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"ins.node.edges)varc=s.node.edges["*"];else{varc=newt.TokenSet;s.node.edges["*"]=c}s.str.length==1&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){varf=s.str.charAt(0),g=s.str.charAt(1),l;gins.node.edges?l=s.node.edges[g]:(l=newt.TokenSet,s.node.edges[g]=l),s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:f+s.str.slice(2)})}}}returnn},t.TokenSet.fromString=function(e){for(varr=newt.TokenSet,n=r,i=0,s=e.length;i<s;i++){varo=e[i],a=i==s-1;if(o=="*")r.edges[o]=r,r.final=a;else{varu=newt.TokenSet;u.final=a,r.edges[o]=u,r=u}}returnn},t.TokenSet.prototype.toArray=function(){for(vare=[],r=[{prefix:"",node:this}];r.length;){varn=r.pop(),i=Object.keys(n.node.edges),s=i.length;n.node.final&&(n.prefix.charAt(0),e.push(n.prefix));for(varo=0;o<s;o++){vara=i[o];r.push({prefix:n.prefix.concat(a),node:n.node.edges[a]})}}returne},t.TokenSet.prototype.toString=function(){if(this._str)returnthis._str;for(vare=this.final?"1":"0",r=Object.keys(this.edges).sort(),n=r.length,i=0;i<n;i++){vars=r[i],o=this.edges[s];e=e+s+o.id}returne},t.TokenSet.prototype.intersect=function(e){for(varr=newt.TokenSet,n=void0,i=[{qNode:e,output:r,node:this}];i.length;){n=i.pop();for(vars=Object.keys(n.qNode.edges),o=s.length,a=Object.keys(n.node.edges),u=a.length,c=0;c<o;c++)for(varf=s[c],g=0;g<u;g++){varl=a[g];if(l==f||f=="*"){varm=n.node.edges[l],x=n.qNode.edges[f],v=m.final&&x.final,d=void0;linn.output.edges?(d=n.output.edges[l],d.final=d.final||v):(d=newt.TokenSet,d.final=v,n.output.edges[l]=d),i.push({qNode:x,output:d,node:m})}}}returnr},t.TokenSet.Builder=function(){this.previousWord="",this.root=newt.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},t.TokenSet.Builder.prototype.insert=function(e){varr,n=0;if(e<this.previousWord)thrownewError("Out of order word insertion");for(vari=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)n++;this.minimize(n),this.uncheckedNodes.length==0?r=this.root:r=this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(vari=n;i<e.length;i++){vars=newt.TokenSet,o=e[i];r.edges[o]=s,this.uncheckedNodes.push({parent:r,char:o,child:s}),r=s}r.final=!0,this.previousWord=e},t.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},t.TokenSet.Builder.prototype.minimize=function(e){for(varr=this.uncheckedNodes.length-1;r>=e;r--){varn=this.uncheckedNodes[r],i=n.child.toString();iinthis.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};/*!
*/t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){returnthis.query(function(r){varn=newt.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(varr=newt.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u<this.fields.length;u++)i[this.fields[u]]=newt.Vector;e.call(r,r);for(varu=0;u<r.clauses.length;u++){varc=r.clauses[u],f=null,g=t.Set.empty;c.usePipeline?f=this.pipeline.runString(c.term,{fields:c.fields}):f=[c.term];for(varl=0;l<f.length;l++){varm=f[l];c.term=m;varx=t.TokenSet.fromClause(c),v=this.tokenSet.intersect(x).toArray();if(v.length===0&&c.presence===t.Query.presence.REQUIRED){for(vard=0;d<c.fields.length;d++){vary=c.fields[d];o[y]=t.Set.empty}break}for(varb=0;b<v.length;b++)for(varE=v[b],w=this.invertedIndex[E],R=w._index,d=0;d<c.fields.length;d++){vary=c.fields[d],j=w[y],C=Object.keys(j),D=E+"/"+y,N=newt.Set(C);if(c.presence==t.Query.presence.REQUIRED&&(g=g.union(N),o[y]===void0&&(o[y]=t.Set.complete)),c.presence==t.Query.presence.PROHIBITED){a[y]===void0&&(a[y]=t.Set.empty),a[y]=a[y].union(N);continue}if(i[y].upsert(R,c.boost,function(ye,me){returnye+me}),!s[D]){for(varM=0;M<C.length;M++){varV=C[M],P=newt.FieldRef(V,y),z=j[V],$;($=n[P])===void0?n[P]=newt.MatchData(E,y,z):$.add(E,y,z)}s[D]=!0}}}if(c.presence===t.Query.presence.REQUIRED)for(vard=0;d<c.fields.length;d++){vary=c.fields[d];o[y]=o[y].intersect(g)}}for(varA=t.Set.complete,I=t.Set.empty,u=0;u<this.fields.length;u++){vary=this.fields[u];o[y]&&(A=A.intersect(o[y])),a[y]&&(I=I.union(a[y]))}varh=Object.keys(n),S=[],k=Object.create(null);if(r.isNegated()){h=Object.keys(this.fieldVectors);for(varu=0;u<h.length;u++){varP=h[u],L=t.FieldRef.fromString(P);n[P]=newt.MatchData}}for(varu=0;u<h.length;u++){varL=t.FieldRef.fromString(h[u]),p=L.docRef;if(A.contains(p)&&!I.contains(p)){varT=this.fieldVectors[L],O=i[L.fieldName].similarity(T),F;if((F=k[p])!==void0)F.score+=O,F.matchData.combine(n[L]);else{varQ={ref:p,score:O,matchData:n[L]};k[p]=Q,S.push(Q)}}}returnS.sort(function(pe,ge){returnge.score-pe.score})},t.Index.prototype.toJSON=function(){vare=Object.keys(this.invertedIndex).sort().map(function(n){return[n,this.invertedIndex[n]]},this),r=Object.keys(this.fieldVectors).map(function(n){return[n,this.fieldVectors[n].toJSON()]},this);return{version:t.version,fields:this.fields,fieldVectors:r,invertedIndex:e,pipeline:this.pipeline.toJSON()}},t.Index.load=function(e){varr={},n={},i=e.fieldVectors,s=Object.create(null),o=e.invertedIndex,a=newt.TokenSet.Builder,u=t.Pipeline.load(e.pipeline);e.version!=t.version&&t.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+t.version+"' does not match serialized index '"+e.version+"'");for(varc=0;c<i.length;c++){varf=i[c],g=f[0],l=f[1];n[g]=newt.Vector(l)}for(varc=0;c<o.length;c++){varf=o[c],m=f[0],x=f[1];a.insert(m),s[m]=x}returna.finish(),r.fields=e.fields,r.fieldVectors=n,r.invertedIndex=s,r.tokenSet=a.root,r.pipeline=u,newt.Index(r)};/*!