2020-01-26 15:42:22 +01:00
! function ( e ) { var t = { } ; function r ( n ) { if ( t [ n ] ) return t [ n ] . exports ; var i = t [ n ] = { i : n , l : ! 1 , exports : { } } ; return e [ n ] . call ( i . exports , i , i . exports , r ) , i . l = ! 0 , i . exports } r . m = e , r . c = t , r . d = function ( e , t , n ) { r . o ( e , t ) || Object . defineProperty ( e , t , { enumerable : ! 0 , get : n } ) } , r . r = function ( e ) { "undefined" != typeof Symbol && Symbol . toStringTag && Object . defineProperty ( e , Symbol . toStringTag , { value : "Module" } ) , Object . defineProperty ( e , "__esModule" , { value : ! 0 } ) } , r . t = function ( e , t ) { if ( 1 & t && ( e = r ( e ) ) , 8 & t ) return e ; if ( 4 & t && "object" == typeof e && e && e . _ _esModule ) return e ; var n = Object . create ( null ) ; if ( r . r ( n ) , Object . defineProperty ( n , "default" , { enumerable : ! 0 , value : e } ) , 2 & t && "string" != typeof e ) for ( var i in e ) r . d ( n , i , function ( t ) { return e [ t ] } . bind ( null , i ) ) ; return n } , r . n = function ( e ) { var t = e && e . _ _esModule ? function ( ) { return e . default } : function ( ) { return e } ; return r . d ( t , "a" , t ) , t } , r . o = function ( e , t ) { return Object . prototype . hasOwnProperty . call ( e , t ) } , r . p = "" , r ( r . s = 5 ) } ( [ function ( e , t , r ) { ( function ( t ) { e . exports = t . lunr = r ( 4 ) } ) . call ( this , r ( 3 ) ) } , function ( e , t , r ) { "use strict" ;
/ * !
* escape - html
* Copyright ( c ) 2012 - 2013 TJ Holowaychuk
* Copyright ( c ) 2015 Andreas Lubbe
* Copyright ( c ) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
* /var n=/ [ "'&<>]/;e.exports=function(e){var t,r=" "+e,i=n.exec(r);if(!i)return r;var s=" ",o=0,a=0;for(o=i.index;o<r.length;o++){switch(r.charCodeAt(o)){case 34:t=" & quot ; ";break;case 38:t=" & amp ; ";break;case 39:t=" & # 39 ; ";break;case 60:t=" & lt ; ";break;case 62:t=" & gt ; ";break;default:continue}a!==o&&(s+=r.substring(a,o)),a=o+1,s+=t}return a!==o?s+r.substring(a,o):s}},function(e,t,r){" use strict ";const n=/[|\\{}()[\]^$+*?.-]/g;e.exports=e=>{if(" string "!=typeof e)throw new TypeError(" Expected a string ");return e.replace(n," \ \ $ & ")}},function(e,t){var r;r=function(){return this}();try{r=r||new Function(" return this ")()}catch(e){" object " == typeof window && ( r = window ) } e . exports = r } , function ( e , t , r ) { var n , i ;
2019-12-17 15:59:13 +01:00
/ * *
2020-01-08 18:17:19 +01:00
* lunr - http : //lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.8
2019-12-17 15:59:13 +01:00
* Copyright ( C ) 2019 Oliver Nightingale
* @ license MIT
2020-01-26 16:03:49 +01:00
* / ! f u n c t i o n ( ) { v a r s , o , a , u , l , c , h , d , f , p , y , m , g , v , x , w , b , S , Q , E , k , L , P , T , O , I , R = f u n c t i o n ( e ) { v a r t = n e w R . B u i l d e r ; r e t u r n t . p i p e l i n e . a d d ( R . t r i m m e r , R . s t o p W o r d F i l t e r , R . s t e m m e r ) , t . s e a r c h P i p e l i n e . a d d ( R . s t e m m e r ) , e . c a l l ( t , t ) , t . b u i l d ( ) } ; R . v e r s i o n = " 2 . 3 . 8 "
2019-12-17 15:59:13 +01:00
/ * !
* lunr . utils
* Copyright ( C ) 2019 Oliver Nightingale
2019-12-18 17:14:20 +01:00
* /,R.utils={},R.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),R.utils.asString=function(e){return null==e?"":e.toString()},R.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),n=0;n<r.length;n++){var i=r[n],s=e[i];if(Array.isArray(s))t[i]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[i]=s}}return t},R.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},R.FieldRef.joiner="/ ",R.FieldRef.fromString=function(e){var t=e.indexOf(R.FieldRef.joiner);if(-1===t)throw" malformed field ref string " ; var r = e . slice ( 0 , t ) , n = e . slice ( t + 1 ) ; return new R . FieldRef ( n , r , e ) } , R . FieldRef . prototype . toString = function ( ) { return null == this . _stringValue && ( this . _stringValue = this . fieldName + R . FieldRef . joiner + this . docRef ) , this . _stringValue }
2019-12-17 15:59:13 +01:00
/ * !
* lunr . Set
* Copyright ( C ) 2019 Oliver Nightingale
2019-12-18 17:14:20 +01:00
* /,R.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},R.Set.complete={intersect:function(e){return e},union:function(e){return e},contains:function(){return!0}},R.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},R.Set.prototype.contains=function(e){return!!this.elements[e]},R.Set.prototype.intersect=function(e){var t,r,n,i=[];if(e===R.Set.complete)return this;if(e===R.Set.empty)return e;this.length<e.length?(t=this,r=e):(t=e,r=this),n=Object.keys(t.elements);for(var s=0;s<n.length;s++){var o=n[s];o in r.elements&&i.push(o)}return new R.Set(i)},R.Set.prototype.union=function(e){return e===R.Set.complete?R.Set.complete:e===R.Set.empty?this:new R.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},R.idf=function(e,t){var r=0;for(var n in e)"_index"!=n&&(r+=Object.keys(e[n]).length);var i=(t-r+.5)/ ( r + . 5 ) ; return Math . log ( 1 + Math . abs ( i ) ) } , R . Token = function ( e , t ) { this . str = e || "" , this . metadata = t || { } } , R . Token . prototype . toString = function ( ) { return this . str } , R . Token . prototype . update = function ( e ) { return this . str = e ( this . str , this . metadata ) , this } , R . Token . prototype . clone = function ( e ) { return e = e || function ( e ) { return e } , new R . Token ( e ( this . str , this . metadata ) , this . metadata ) }
2019-12-17 15:59:13 +01:00
/ * !
* lunr . tokenizer
* Copyright ( C ) 2019 Oliver Nightingale
2020-01-08 18:17:19 +01:00
* /,R.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new R.Token(R.utils.asString(e).toLowerCase(),R.utils.clone(t))}));for(var r=e.toString().toLowerCase(),n=r.length,i=[],s=0,o=0;s<=n;s++){var a=s-o;if(r.charAt(s).match(R.tokenizer.separator)||s==n){if(a>0){var u=R.utils.clone(t)||{};u.position=[o,a],u.index=i.length,i.push(new R.Token(r.slice(o,s),u))}o=s+1}}return i},R.tokenizer.separator=/ [ \ s \ - ] + /
2019-12-17 15:59:13 +01:00
/ * !
* lunr . Pipeline
* Copyright ( C ) 2019 Oliver Nightingale
2020-01-08 18:17:19 +01:00
* / , R . P i p e l i n e = f u n c t i o n ( ) { t h i s . _ s t a c k = [ ] } , R . P i p e l i n e . r e g i s t e r e d F u n c t i o n s = O b j e c t . c r e a t e ( n u l l ) , R . P i p e l i n e . r e g i s t e r F u n c t i o n = f u n c t i o n ( e , t ) { t i n t h i s . r e g i s t e r e d F u n c t i o n s & & R . u t i l s . w a r n ( " O v e r w r i t i n g e x i s t i n g r e g i s t e r e d f u n c t i o n : " + t ) , e . l a b e l = t , R . P i p e l i n e . r e g i s t e r e d F u n c t i o n s [ e . l a b e l ] = e } , R . P i p e l i n e . w a r n I f F u n c t i o n N o t R e g i s t e r e d = f u n c t i o n ( e ) { e . l a b e l & & e . l a b e l i n t h i s . r e g i s t e r e d F u n c t i o n s | | R . u t i l s . w a r n ( " F u n c t i o n i s n o t r e g i s t e r e d w i t h p i p e l i n e . T h i s m a y c a u s e p r o b l e m s w h e n s e r i a l i s i n g t h e i n d e x . \ n " , e ) } , R . P i p e l i n e . l o a d = f u n c t i o n ( e ) { v a r t = n e w R . P i p e l i n e ; r e t u r n e . f o r E a c h ( ( f u n c t i o n ( e ) { v a r r = R . P i p e l i n e . r e g i s t e r e d F u n c t i o n s [ e ] ; i f ( ! r ) t h r o w n e w E r r o r ( " C a n n o t l o a d u n r e g i s t e r e d f u n c t i o n : " + e ) ; t . a d d ( r ) } ) ) , t } , R . P i p e l i n e . p r o t o t y p e . a d d = f u n c t i o n ( ) { v a r e = A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g u m e n t s ) ; e . f o r E a c h ( ( f u n c t i o n ( e ) { R . P i p e l i n e . w a r n I f F u n c t i o n N o t R e g i s t e r e d ( e ) , t h i s . _ s t a c k . p u s h ( e ) } ) , t h i s ) } , R . P i p e l i n e . p r o t o t y p e . a f t e r = f u n c t i o n ( e , t ) { R . P i p e l i n e . w a r n I f F u n c t i o n N o t R e g i s t e r e d ( t ) ; v a r r = t h i s . _ s t a c k . i n d e x O f ( e ) ; i f ( - 1 = = r ) t h r o w n e w E r r o r ( " C a n n o t f i n d e x i s t i n g F n " ) ; r + = 1 , t h i s . _ s t a c k . s p l i c e ( r , 0 , t ) } , R . P i p e l i n e . p r o t o t y p e . b e f o r e = f u n c t i o n ( e , t ) { R . P i p e l i n e . w a r n I f F u n c t i o n N o t R e g i s t e r e d ( t ) ; v a r r = t h i s . _ s t a c k . i n d e x O f ( e ) ; i f ( - 1 = = r ) t h r o w n e w E r r o r ( " C a n n o t f i n d e x i s t i n g F n " ) ; t h i s . _ s t a c k . s p l i c e ( r , 0 , t ) } , R . P i p e l i n e . p r o t o t y p e . r e m o v e = f u n c t i o n ( e ) { v a r t = t h i s . _ s t a c k . i n d e x O f ( e ) ; - 1 ! = t & & t h i s . _ s t a c k . s p l i c e ( t , 1 ) } , R . P i p e l i n e . p r o t o t y p e . r u n = f u n c t i o n ( e ) { f o r ( v a r t = t h i s . _ s t a c k . l e n g t h , r = 0 ; r < t ; r + + ) { f o r ( v a r n = t h i s . _ s t a c k [ r ] , i = [ ] , s = 0 ; s < e . l e n g t h ; s + + ) { v a r o = n ( e [ s ] , s , e ) ; i f ( n u l l ! = o & & " " ! = = o ) i f ( A r r a y . i s A r r a y ( o ) ) f o r ( v a r a = 0 ; a < o . l e n g t h ; a + + ) i . p u s h ( o [ a ] ) ; e l s e i . p u s h ( o ) } e = i } r e t u r n e } , R . P i p e l i n e . p r o t o t y p e . r u n S t r i n g = f u n c t i o n ( e , t ) { v a r r = n e w R . T o k e n ( e , t ) ; r e t u r n t h i s . r u n ( [ r ] ) . m a p ( ( f u n c t i o n ( e ) { r e t u r n e . t o S t r i n g ( ) } ) ) } , R . P i p e l i n e . p r o t o t y p e . r e s e t = f u n c t i o n ( ) { t h i s . _ s t a c k = [ ] } , R . P i p e l i n e . p r o t o t y p e . t o J S O N = f u n c t i o n ( ) { r e t u r n t h i s . _ s t a c k . m a p ( ( f u n c t i o n ( e ) { r e t u r n R . P i p e l i n e . w a r n I f F u n c t i o n N o t R e g i s t e r e d ( e ) , e . l a b e l } ) ) }
2019-12-17 15:59:13 +01:00
/ * !
* lunr . Vector
* Copyright ( C ) 2019 Oliver Nightingale
2019-12-18 17:14:20 +01:00
* / , R . V e c t o r = f u n c t i o n ( e ) { t h i s . _ m a g n i t u d e = 0 , t h i s . e l e m e n t s = e | | [ ] } , R . V e c t o r . p r o t o t y p e . p o s i t i o n F o r I n d e x = f u n c t i o n ( e ) { i f ( 0 = = t h i s . e l e m e n t s . l e n g t h ) r e t u r n 0 ; f o r ( v a r t = 0 , r = t h i s . e l e m e n t s . l e n g t h / 2 , n = r - t , i = M a t h . f l o o r ( n / 2 ) , s = t h i s . e l e m e n t s [ 2 * i ] ; n > 1 & & ( s < e & & ( t = i ) , s > e & & ( r = i ) , s ! = e ) ; ) n = r - t , i = t + M a t h . f l o o r ( n / 2 ) , s = t h i s . e l e m e n t s [ 2 * i ] ; r e t u r n s = = e ? 2 * i : s > e ? 2 * i : s < e ? 2 * ( i + 1 ) : v o i d 0 } , R . V e c t o r . p r o t o t y p e . i n s e r t = f u n c t i o n ( e , t ) { t h i s . u p s e r t ( e , t , ( f u n c t i o n ( ) { t h r o w " d u p l i c a t e i n d e x " } ) ) } , R . V e c t o r . p r o t o t y p e . u p s e r t = f u n c t i o n ( e , t , r ) { t h i s . _ m a g n i t u d e = 0 ; v a r n = t h i s . p o s i t i o n F o r I n d e x ( e ) ; t h i s . e l e m e n t s [ n ] = = e ? t h i s . e l e m e n t s [ n + 1 ] = r ( t h i s . e l e m e n t s [ n + 1 ] , t ) : t h i s . e l e m e n t s . s p l i c e ( n , 0 , e , t ) } , R . V e c t o r . p r o t o t y p e . m a g n i t u d e = f u n c t i o n ( ) { i f ( t h i s . _ m a g n i t u d e ) r e t u r n t h i s . _ m a g n i t u d e ; f o r ( v a r e = 0 , t = t h i s . e l e m e n t s . l e n g t h , r = 1 ; r < t ; r + = 2 ) { v a r n = t h i s . e l e m e n t s [ r ] ; e + = n * n } r e t u r n t h i s . _ m a g n i t u d e = M a t h . s q r t ( e ) } , R . V e c t o r . p r o t o t y p e . d o t = f u n c t i o n ( e ) { f o r ( v a r t = 0 , r = t h i s . e l e m e n t s , n = e . e l e m e n t s , i = r . l e n g t h , s = n . l e n g t h , o = 0 , a = 0 , u = 0 , l = 0 ; u < i & & l < s ; ) ( o = r [ u ] ) < ( a = n [ l ] ) ? u + = 2 : o > a ? l + = 2 : o = = a & & ( t + = r [ u + 1 ] * n [ l + 1 ] , u + = 2 , l + = 2 ) ; r e t u r n t } , R . V e c t o r . p r o t o t y p e . s i m i l a r i t y = f u n c t i o n ( e ) { r e t u r n t h i s . d o t ( e ) / t h i s . m a g n i t u d e ( ) | | 0 } , R . V e c t o r . p r o t o t y p e . t o A r r a y = f u n c t i o n ( ) { f o r ( v a r e = n e w A r r a y ( t h i s . e l e m e n t s . l e n g t h / 2 ) , t = 1 , r = 0 ; t < t h i s . e l e m e n t s . l e n g t h ; t + = 2 , r + + ) e [ r ] = t h i s . e l e m e n t s [ t ] ; r e t u r n e } , R . V e c t o r . p r o t o t y p e . t o J S O N = f u n c t i o n ( ) { r e t u r n t h i s . e l e m e n t s }
2019-12-17 15:59:13 +01:00
/ * !
* lunr . stemmer
* Copyright ( C ) 2019 Oliver Nightingale
* Includes code from - http : //tartarus.org/~martin/PorterStemmer/js.txt
2020-01-26 16:03:49 +01:00
* /,R.stemmer=(o={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"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},u="[aeiouy]",l="[^aeiou][^aeiouy]*",c=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),p=/ ^ ( . + ? ) ( ss | i ) es$ / , y = /^(.+?)([^s])s$/ , m = /^(.+?)eed$/ , g = /^(.+?)(ed|ing)$/ , v = /.$/ , x = /(at|bl|iz)$/ , w = new RegExp ( "([^aeiouylsz])\\1$" ) , b = new RegExp ( "^" + l + u + "[^aeiouwxy]$" ) , S = /^(.+?[^aeiou])y$/ , Q = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/ , E = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/ , k = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/ , L = /^(.+?)(s|t)(ion)$/ , P = /^(.+?)e$/ , T = /ll$/ , O = new RegExp ( "^" + l + u + "[^aeiouwxy]$" ) , I = function ( e ) { var t , r , n , i , s , u , l ; if ( e . length < 3 ) return e ; if ( "y" == ( n = e . substr ( 0 , 1 ) ) && ( e = n . toUpperCase ( ) + e . substr ( 1 ) ) , s = y , ( i = p ) . test ( e ) ? e = e . replace ( i , "$1$2" ) : s . test ( e ) && ( e = e . replace ( s , "$1$2" ) ) , s = g , ( i = m ) . test ( e ) ) { var I = i . exec ( e ) ; ( i = c ) . test ( I [ 1 ] ) && ( i = v , e = e . replace ( i , "" ) ) } else s . test ( e ) && ( t = ( I = s . exec ( e ) ) [ 1 ] , ( s = f ) . test ( t ) && ( u = w , l = b , ( s = x ) . test ( e = t ) ? e += "e" : u . test ( e ) ? ( i = v , e = e . replace ( i , "" ) ) : l . test ( e ) && ( e += "e" ) ) ) ; return ( i = S ) . test ( e ) && ( e = ( t = ( I = i . exec ( e ) ) [ 1 ] ) + "i" ) , ( i = Q ) . test ( e ) && ( t = ( I = i . exec ( e ) ) [ 1 ] , r = I [ 2 ] , ( i = c ) . test ( t ) && ( e = t + o [ r ] ) ) , ( i = E ) . test ( e ) && ( t = ( I = i . exec ( e ) ) [ 1 ] , r = I [ 2 ] , ( i = c ) . test ( t ) && ( e = t + a [ r ] ) ) , s = L , ( i = k ) . test ( e ) ? ( t = ( I = i . exec ( e ) ) [ 1 ] , ( i = h ) . test ( t ) && ( e = t ) ) : s . test ( e ) && ( t = ( I = s . exec ( e ) ) [ 1 ] + I [ 2 ] , ( s = h ) . test ( t ) && ( e = t ) ) , ( i = P ) . test ( e ) && ( t = ( I = i . exec ( e ) ) [ 1 ] , s = d , u = O , ( ( i = h ) . test ( t ) || s . test ( t ) && ! u . test ( t ) ) && ( e = t ) ) , s = h , ( i = T ) . test ( e ) && s . test ( e ) && ( i = v , e = e . replace ( i , "" ) ) , "y" == n && ( e = n . toLowerCase ( ) + e . substr ( 1 ) ) , e } , function ( e ) { return e . update ( I ) } ) , R . Pipeline . registerFunction ( R . stemmer , "stemmer" )
2019-12-17 15:59:13 +01:00
/ * !
* lunr . stopWordFilter
* Copyright ( C ) 2019 Oliver Nightingale
* / , R . g e n e r a t e S t o p W o r d F i l t e r = f u n c t i o n ( e ) { v a r t = e . r e d u c e ( ( f u n c t i o n ( e , t ) { r e t u r n e [ t ] = t , e } ) , { } ) ; r e t u r n f u n c t i o n ( e ) { i f ( e & & t [ e . t o S t r i n g ( ) ] ! = = e . t o S t r i n g ( ) ) r e t u r n e } } , R . s t o p W o r d F i l t e r = R . g e n e r a t e S t o p W o r d F i l t e r ( [ " a " , " a b l e " , " a b o u t " , " a c r o s s " , " a f t e r " , " a l l " , " a l m o s t " , " a l s o " , " a m " , " a m o n g " , " a n " , " a n d " , " a n y " , " a r e " , " a s " , " a t " , " b e " , " b e c a u s e " , " b e e n " , " b u t " , " b y " , " c a n " , " c a n n o t " , " c o u l d " , " d e a r " , " d i d " , " d o " , " d o e s " , " e i t h e r " , " e l s e " , " e v e r " , " e v e r y " , " f o r " , " f r o m " , " g e t " , " g o t " , " h a d " , " h a s " , " h a v e " , " h e " , " h e r " , " h e r s " , " h i m " , " h i s " , " h o w " , " h o w e v e r " , " i " , " i f " , " i n " , " i n t o " , " i s " , " i t " , " i t s " , " j u s t " , " l e a s t " , " l e t " , " l i k e " , " l i k e l y " , " m a y " , " m e " , " m i g h t " , " m o s t " , " m u s t " , " m y " , " n e i t h e r " , " n o " , " n o r " , " n o t " , " o f " , " o f f " , " o f t e n " , " o n " , " o n l y " , " o r " , " o t h e r " , " o u r " , " o w n " , " r a t h e r " , " s a i d " , " s a y " , " s a y s " , " s h e " , " s h o u l d " , " s i n c e " , " s o " , " s o m e " , " t h a n " , " t h a t " , " t h e " , " t h e i r " , " t h e m " , " t h e n " , " t h e r e " , " t h e s e " , " t h e y " , " t h i s " , " t i s " , " t o " , " t o o " , " t w a s " , " u s " , " w a n t s " , " w a s " , " w e " , " w e r e " , " w h a t " , " w h e n " , " w h e r e " , " w h i c h " , " w h i l e " , " w h o " , " w h o m " , " w h y " , " w i l l " , " w i t h " , " w o u l d " , " y e t " , " y o u " , " y o u r " ] ) , R . P i p e l i n e . r e g i s t e r F u n c t i o n ( R . s t o p W o r d F i l t e r , " s t o p W o r d F i l t e r " )
/ * !
* lunr . trimmer
* Copyright ( C ) 2019 Oliver Nightingale
* /,R.trimmer=function(e){return e.update((function(e){return e.replace(/ ^ \ W + /,"").replace(/ \ W + $ / , "" ) } ) ) } , R . Pipeline . registerFunction ( R . trimmer , "trimmer" )
/ * !
* lunr . TokenSet
* Copyright ( C ) 2019 Oliver Nightingale
2019-12-19 18:25:13 +01:00
* / , R . T o k e n S e t = f u n c t i o n ( ) { t h i s . f i n a l = ! 1 , t h i s . e d g e s = { } , t h i s . i d = R . T o k e n S e t . _ n e x t I d , R . T o k e n S e t . _ n e x t I d + = 1 } , R . T o k e n S e t . _ n e x t I d = 1 , R . T o k e n S e t . f r o m A r r a y = f u n c t i o n ( e ) { f o r ( v a r t = n e w R . T o k e n S e t . B u i l d e r , r = 0 , n = e . l e n g t h ; r < n ; r + + ) t . i n s e r t ( e [ r ] ) ; r e t u r n t . f i n i s h ( ) , t . r o o t } , R . T o k e n S e t . f r o m C l a u s e = f u n c t i o n ( e ) { r e t u r n " e d i t D i s t a n c e " i n e ? R . T o k e n S e t . f r o m F u z z y S t r i n g ( e . t e r m , e . e d i t D i s t a n c e ) : R . T o k e n S e t . f r o m S t r i n g ( e . t e r m ) } , R . T o k e n S e t . f r o m F u z z y S t r i n g = f u n c t i o n ( e , t ) { f o r ( v a r r = n e w R . T o k e n S e t , n = [ { n o d e : r , e d i t s R e m a i n i n g : t , s t r : e } ] ; n . l e n g t h ; ) { v a r i = n . p o p ( ) ; i f ( i . s t r . l e n g t h > 0 ) { v a r s , o = i . s t r . c h a r A t ( 0 ) ; o i n i . n o d e . e d g e s ? s = i . n o d e . e d g e s [ o ] : ( s = n e w R . T o k e n S e t , i . n o d e . e d g e s [ o ] = s ) , 1 = = i . s t r . l e n g t h & & ( s . f i n a l = ! 0 ) , n . p u s h ( { n o d e : s , e d i t s R e m a i n i n g : i . e d i t s R e m a i n i n g , s t r : i . s t r . s l i c e ( 1 ) } ) } i f ( 0 ! = i . e d i t s R e m a i n i n g ) { i f ( " * " i n i . n o d e . e d g e s ) v a r a = i . n o d e . e d g e s [ " * " ] ; e l s e { a = n e w R . T o k e n S e t ; i . n o d e . e d g e s [ " * " ] = a } i f ( 0 = = i . s t r . l e n g t h & & ( a . f i n a l = ! 0 ) , n . p u s h ( { n o d e : a , e d i t s R e m a i n i n g : i . e d i t s R e m a i n i n g - 1 , s t r : i . s t r } ) , i . s t r . l e n g t h > 1 & & n . p u s h ( { n o d e : i . n o d e , e d i t s R e m a i n i n g : i . e d i t s R e m a i n i n g - 1 , s t r : i . s t r . s l i c e ( 1 ) } ) , 1 = = i . s t r . l e n g t h & & ( i . n o d e . f i n a l = ! 0 ) , i . s t r . l e n g t h > = 1 ) { i f ( " * " i n i . n o d e . e d g e s ) v a r u = i . n o d e . e d g e s [ " * " ] ; e l s e { u = n e w R . T o k e n S e t ; i . n o d e . e d g e s [ " * " ] = u } 1 = = i . s t r . l e n g t h & & ( u . f i n a l = ! 0 ) , n . p u s h ( { n o d e : u , e d i t s R e m a i n i n g : i . e d i t s R e m a i n i n g - 1 , s t r : i . s t r . s l i c e ( 1 ) } ) } i f ( i . s t r . l e n g t h > 1 ) { v a r l , c = i . s t r . c h a r A t ( 0 ) , h = i . s t r . c h a r A t ( 1 ) ; h i n i . n o d e . e d g e s ? l = i . n o d e . e d g e s [ h ] : ( l = n e w R . T o k e n S e t , i . n o d e . e d g e s [ h ] = l ) , 1 = = i . s t r . l e n g t h & & ( l . f i n a l = ! 0 ) , n . p u s h ( { n o d e : l , e d i t s R e m a i n i n g : i . e d i t s R e m a i n i n g - 1 , s t r : c + i . s t r . s l i c e ( 2 ) } ) } } } r e t u r n r } , R . T o k e n S e t . f r o m S t r i n g = f u n c t i o n ( e ) { f o r ( v a r t = n e w R . T o k e n S e t , r = t , n = 0 , i = e . l e n g t h ; n < i ; n + + ) { v a r s = e [ n ] , o = n = = i - 1 ; i f ( " * " = = s ) t . e d g e s [ s ] = t , t . f i n a l = o ; e l s e { v a r a = n e w R . T o k e n S e t ; a . f i n a l = o , t . e d g e s [ s ] = a , t = a } } r e t u r n r } , R . T o k e n S e t . p r o t o t y p e . t o A r r a y = f u n c t i o n ( ) { f o r ( v a r e = [ ] , t = [ { p r e f i x : " " , n o d e : t h i s } ] ; t . l e n g t h ; ) { v a r r = t . p o p ( ) , n = O b j e c t . k e y s ( r . n o d e . e d g e s ) , i = n . l e n g t h ; r . n o d e . f i n a l & & ( r . p r e f i x . c h a r A t ( 0 ) , e . p u s h ( r . p r e f i x ) ) ; f o r ( v a r s = 0 ; s < i ; s + + ) { v a r o = n [ s ] ; t . p u s h ( { p r e f i x : r . p r e f i x . c o n c a t ( o ) , n o d e : r . n o d e . e d g e s [ o ] } ) } } r e t u r n e } , R . T o k e n S e t . p r o t o t y p e . t o S t r i n g = f u n c t i o n ( ) { i f ( t h i s . _ s t r ) r e t u r n t h i s . _ s t r ; f o r ( v a r e = t h i s . f i n a l ? " 1 " : " 0 " , t = O b j e c t . k e y s ( t h i s . e d g e s ) . s o r t ( ) , r = t . l e n g t h , n = 0 ; n < r ; n + + ) { v a r i = t [ n ] ; e = e + i + t h i s . e d g e s [ i ] . i d } r e t u r n e } , R . T o k e n S e t . p r o t o t y p e . i n t e r s e c t = f u n c t i o n ( e ) { f o r ( v a r t = n e w R . T o k e n S e t , r = v o i d 0 , n = [ { q N o d e : e , o u t p u t : t , n o d e : t h i s } ] ; n . l e n g t h ; ) { r = n . p o p ( ) ; f o r ( v a r i = O b j e c t . k e y s ( r . q N o d e . e d g e s ) , s = i . l e n g t h , o = O b j e c t . k e y s ( r . n o d e . e d g e s ) , a = o . l e n g t h , u = 0 ; u < s ; u + + ) f o r ( v a r l = i [ u ] , c = 0 ; c < a ; c + + ) { v a r h = o [ c ] ; i f ( h = = l | | " * " = = l ) { v a r d = r . n o d e . e d g e s [ h ] , f = r . q N o d e . e d g e s [ l ] , p = d . f i n a l & & f . f i n a l , y = v o i d 0 ; h i n r . o u t p u t . e d g e s ? ( y = r . o u t p u t . e d g e s [ h ] ) . f i n a l = y . f i n a l | | p : ( ( y = n e w R . T o k e n S e t ) . f i n a l = p , r . o u t p u t . e d g e s [ h ] = y ) , n . p u s h ( { q N o d e : f , o u t p u t : y , n o d e : d } ) } } } r e t u r n t } , R . T o k e n S e t . B u i l d e r = f u n c t i o n ( ) { t h i s . p r e v i o u s W o r d = " " , t h i s . r o o t = n e w R . T o k e n S e t , t h i s . u n c h e c k e d N o d e s = [ ] , t h i s . m i n i m i z e d N o d e s = { } } , R . T o k e n S e t . B u i l d e r . p r o t o t y p e . i n s e r t = f u n c t i o n ( e ) { v a r t , r = 0 ; i f ( e < t h i s . p r e v i o u s W o r d ) t h r o w n e w E r r o r ( " O u t o f o r d e r w o r d i n s e r t i o n " ) ; f o r ( v a r n = 0 ; n < e . l e n g t h & & n < t h i s . p r e v i o u s W o r d . l e n g t h & & e [ n ] = = t h i s . p r e v i o u s W o r d [ n ] ; n + + ) r + + ; t h i s . m i n i m i z e ( r ) , t = 0 = = t h i s . u n c h e c k e d N o d e s . l e n g t h ? t h i s . r o o t : t h i s . u n c h e c k e d N o d e s [ t h i s . u n c h e c k e d N o d e s . l e n g t h - 1 ] . c h i l d ; f o r ( n = r ; n < e . l e n g t h ; n + + ) { v a r i = n e w R . T o k e n S e t , s = e [ n ] ; t . e d g e s [ s ] = i , t h i s . u n c h e c k e d N o d e s . p u s h ( { p a r e n t : t , c h a r : s , c h i l d : i } ) , t = i } t . f i n a l = ! 0 , t h i s . p r e v i o u s W o r d = e } , R . T o k e n S e t . B u i l d e r . p r o t o t y p e . f i n i s h = f u n c t i o n ( ) { t h i s . m i n i m i z e ( 0 ) } , R . T o k e n S e t . B u i l d e r . p r o t o t y p e . m i n i m i z e = f u n c t i o n ( e ) { f o r ( v a r t = t h i s . u n c h e c k e d N o d e s . l e n g t h - 1 ; t > = e ; t - - ) { v a r r = t h i s . u n c h e c k e d N o d e s [ t ] , n = r . c h i l d . t o S t r i n g ( ) ; n i n t h i s . m i n i m i z e d N o d e s ? r . p a r e n t . e d g e s [ r . c h a r ] = t h i s . m i n i m i z e d N o d e s [ n ] : ( r . c h i l d . _ s t r = n , t h i s . m i n i m i z e d N o d e s [ n ] = r . c h i l d ) , t h i s . u n c h e c k e d N o d e s . p o p ( ) } }
2019-12-17 15:59:13 +01:00
/ * !
* lunr . Index
* Copyright ( C ) 2019 Oliver Nightingale
2020-01-26 16:03:49 +01:00
* /,R.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},R.Index.prototype.search=function(e){return this.query((function(t){new R.QueryParser(e,t).parse()}))},R.Index.prototype.query=function(e){for(var t=new R.Query(this.fields),r=Object.create(null),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)n[this.fields[a]]=new R.Vector;e.call(t,t);for(a=0;a<t.clauses.length;a++){var u=t.clauses[a],l=null,c=R.Set.complete;l=u.usePipeline?this.pipeline.runString(u.term,{fields:u.fields}):[u.term];for(var h=0;h<l.length;h++){var d=l[h];u.term=d;var f=R.TokenSet.fromClause(u),p=this.tokenSet.intersect(f).toArray();if(0===p.length&&u.presence===R.Query.presence.REQUIRED){for(var y=0;y<u.fields.length;y++){s[j=u.fields[y]]=R.Set.empty}break}for(var m=0;m<p.length;m++){var g=p[m],v=this.invertedIndex[g],x=v._index;for(y=0;y<u.fields.length;y++){var w=v[j=u.fields[y]],b=Object.keys(w),S=g+"/ "+j,Q=new R.Set(b);if(u.presence==R.Query.presence.REQUIRED&&(c=c.union(Q),void 0===s[j]&&(s[j]=R.Set.complete)),u.presence!=R.Query.presence.PROHIBITED){if(n[j].upsert(x,u.boost,(function(e,t){return e+t})),!i[S]){for(var E=0;E<b.length;E++){var k,L=b[E],P=new R.FieldRef(L,j),T=w[L];void 0===(k=r[P])?r[P]=new R.MatchData(g,j,T):k.add(g,j,T)}i[S]=!0}}else void 0===o[j]&&(o[j]=R.Set.empty),o[j]=o[j].union(Q)}}}if(u.presence===R.Query.presence.REQUIRED)for(y=0;y<u.fields.length;y++){s[j=u.fields[y]]=s[j].intersect(c)}}var O=R.Set.complete,I=R.Set.empty;for(a=0;a<this.fields.length;a++){var j;s[j=this.fields[a]]&&(O=O.intersect(s[j])),o[j]&&(I=I.union(o[j]))}var F=Object.keys(r),C=[],_=Object.create(null);if(t.isNegated()){F=Object.keys(this.fieldVectors);for(a=0;a<F.length;a++){P=F[a];var N=R.FieldRef.fromString(P);r[P]=new R.MatchData}}for(a=0;a<F.length;a++){var D=(N=R.FieldRef.fromString(F[a])).docRef;if(O.contains(D)&&!I.contains(D)){var A,B=this.fieldVectors[N],M=n[N.fieldName].similarity(B);if(void 0!==(A=_[D]))A.score+=M,A.matchData.combine(r[N]);else{var V={ref:D,score:M,matchData:r[N]};_[D]=V,C.push(V)}}}return C.sort((function(e,t){return t.score-e.score}))},R.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:R.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},R.Index.load=function(e){var t={},r={},n=e.fieldVectors,i=Object.create(null),s=e.invertedIndex,o=new R.TokenSet.Builder,a=R.Pipeline.load(e.pipeline);e.version!=R.version&&R.utils.warn(" Version mismatch when loading serialised index . Current version of lunr '"+R.version+"' does not match serialized index '"+e.version+"' " ) ; for ( var u = 0 ; u < n . length ; u ++ ) { var l = ( h = n [ u ] ) [ 0 ] , c = h [ 1 ] ; r [ l ] = new R . Vector ( c ) } for ( u = 0 ; u < s . length ; u ++ ) { var h , d = ( h = s [ u ] ) [ 0 ] , f = h [ 1 ] ; o . insert ( d ) , i [ d ] = f } return o . finish ( ) , t . fields = e . fields , t . fieldVectors = r , t . invertedIndex = i , t . tokenSet = o . root , t . pipeline = a , new R . Index ( t ) }
2019-12-17 15:59:13 +01:00
/ * !
* lunr . Builder
* Copyright ( C ) 2019 Oliver Nightingale
2020-02-11 12:49:30 +01:00
* /,R.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=R.tokenizer,this.pipeline=new R.Pipeline,this.searchPipeline=new R.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},R.Builder.prototype.ref=function(e){this._ref=e},R.Builder.prototype.field=function(e,t){if(/ \ //.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},R.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},R.Builder.prototype.k1=function(e){this._k1=e},R.Builder.prototype.add=function(e,t){var r=e[this._ref],n=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var i=0;i<n.length;i++){var s=n[i],o=this._fields[s].extractor,a=o?o(e):e[s],u=this.tokenizer(a,{fields:[s]}),l=this.pipeline.run(u),c=new R.FieldRef(r,s),h=Object.create(null);this.fieldTermFrequencies[c]=h,this.fieldLengths[c]=0,this.fieldLengths[c]+=l.length;for(var d=0;d<l.length;d++){var f=l[d];if(null==h[f]&&(h[f]=0),h[f]+=1,null==this.invertedIndex[f]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var y=0;y<n.length;y++)p[n[y]]=Object.create(null);this.invertedIndex[f]=p}null==this.invertedIndex[f][s][r]&&(this.invertedIndex[f][s][r]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var g=this.metadataWhitelist[m],v=f.metadata[g];null==this.invertedIndex[f][s][r][g]&&(this.invertedIndex[f][s][r][g]=[]),this.invertedIndex[f][s][r][g].push(v)}}}},R.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,r={},n={},i=0;i<t;i++){var s=R.FieldRef.fromString(e[i]),o=s.fieldName;n[o]||(n[o]=0),n[o]+=1,r[o]||(r[o]=0),r[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(i=0;i<a.length;i++){var u=a[i];r[u]=r[u]/n[u]}this.averageFieldLength=r},R.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),r=t.length,n=Object.create(null),i=0;i<r;i++){for(var s=R.FieldRef.fromString(t[i]),o=s.fieldName,a=this.fieldLengths[s],u=new R.Vector,l=this.fieldTermFrequencies[s],c=Object.keys(l),h=c.length,d=this._fields[o].boost||1,f=this._documents[s.docRef].boost||1,p=0;p<h;p++){var y,m,g,v=c[p],x=l[v],w=this.invertedIndex[v]._index;void 0===n[v]?(y=R.idf(this.invertedIndex[v],this.documentCount),n[v]=y):y=n[v],m=y*((this._k1+1)*x)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+x),m*=d,m*=f,g=Math.round(1e3*m)/1e3,u.insert(w,g)}e[s]=u}this.fieldVectors=e},R.Builder.prototype.createTokenSet=function(){this.tokenSet=R.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},R.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new R.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},R.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},R.MatchData=function(e,t,r){for(var n=Object.create(null),i=Object.keys(r||{}),s=0;s<i.length;s++){var o=i[s];n[o]=r[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=n)},R.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var n=t[r],i=Object.keys(e.metadata[n]);null==this.metadata[n]&&(this.metadata[n]=Object.create(null));for(var s=0;s<i.length;s++){var o=i[s],a=Object.keys(e.metadata[n][o]);null==this.metadata[n][o]&&(this.metadata[n][o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];null==this.metadata[n][o][l]?this.metadata[n][o][l]=e.metadata[n][o][l]:this.metadata[n][o][l]=this.metadata[n][o][l].concat(e.metadata[n][o][l])}}}},R.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=r);if(t in t
2020-02-12 19:13:03 +01:00
//# sourceMappingURL=search.ce66ce8d.min.js.map