2019-11-20 13:12:09 +03:00
! function ( e , t ) { for ( var n in t ) e [ n ] = t [ n ] } ( window , function ( n ) { var r = { } ; function i ( e ) { if ( r [ e ] ) return r [ e ] . exports ; var t = r [ e ] = { i : e , l : ! 1 , exports : { } } ; return n [ e ] . call ( t . exports , t , t . exports , i ) , t . l = ! 0 , t . exports } return i . m = n , i . c = r , i . d = function ( e , t , n ) { i . o ( e , t ) || Object . defineProperty ( e , t , { enumerable : ! 0 , get : n } ) } , i . r = function ( e ) { "undefined" != typeof Symbol && Symbol . toStringTag && Object . defineProperty ( e , Symbol . toStringTag , { value : "Module" } ) , Object . defineProperty ( e , "__esModule" , { value : ! 0 } ) } , i . t = function ( t , e ) { if ( 1 & e && ( t = i ( t ) ) , 8 & e ) return t ; if ( 4 & e && "object" == typeof t && t && t . _ _esModule ) return t ; var n = Object . create ( null ) ; if ( i . r ( n ) , Object . defineProperty ( n , "default" , { enumerable : ! 0 , value : t } ) , 2 & e && "string" != typeof t ) for ( var r in t ) i . d ( n , r , function ( e ) { return t [ e ] } . bind ( null , r ) ) ; return n } , i . n = function ( e ) { var t = e && e . _ _esModule ? function ( ) { return e . default } : function ( ) { return e } ; return i . d ( t , "a" , t ) , t } , i . o = function ( e , t ) { return Object . prototype . hasOwnProperty . call ( e , t ) } , i . p = "" , i ( i . s = 13 ) } ( [ function ( e , t , n ) { "use strict" ; var r = { Listener : function ( ) { function e ( e , t , n ) { var r = this ; this . els _ = Array . prototype . slice . call ( "string" == typeof e ? document . querySelectorAll ( e ) : [ ] . concat ( e ) ) , this . handler _ = "function" == typeof n ? { update : n } : n , this . events _ = [ ] . concat ( t ) , this . update _ = function ( e ) { return r . handler _ . update ( e ) } } var t = e . prototype ; return t . listen = function ( ) { var n = this ; this . els _ . forEach ( function ( t ) { n . events _ . forEach ( function ( e ) { t . addEventListener ( e , n . update _ , ! 1 ) } ) } ) , "function" == typeof this . handler _ . setup && this . handler _ . setup ( ) } , t . unlisten = function ( ) { var n = this ; this . els _ . forEach ( function ( t ) { n . events _ . forEach ( function ( e ) { t . removeEventListener ( e , n . update _ ) } ) } ) , "function" == typeof this . handler _ . reset && this . handler _ . reset ( ) } , e } ( ) , MatchMedia : function ( e , t ) { this . handler _ = function ( e ) { e . matches ? t . listen ( ) : t . unlisten ( ) } ; var n = window . matchMedia ( e ) ; n . addListener ( this . handler _ ) , this . handler _ ( n ) } } , i = { Shadow : function ( ) { function e ( e , t ) { var n = "string" == typeof e ? document . querySelector ( e ) : e ; if ( ! ( n instanceof HTMLElement && n . parentNode instanceof HTMLElement ) ) throw new ReferenceError ; if ( this . el _ = n . parentNode , ! ( ( n = "string" == typeof t ? document . querySelector ( t ) : t ) instanceof HTMLElement ) ) throw new ReferenceError ; this . header _ = n , this . height _ = 0 , this . active _ = ! 1 } var t = e . prototype ; return t . setup = function ( ) { for ( var e = this . el _ ; e = e . previousElementSibling ; ) { if ( ! ( e instanceof HTMLElement ) ) throw new ReferenceError ; this . height _ += e . offsetHeight } this . update ( ) } , t . update = function ( e ) { if ( ! e || "resize" !== e . type && "orientationchange" !== e . type ) { var t = window . pageYOffset >= this . height _ ; t !== this . active _ && ( this . header _ . dataset . mdState = ( this . active _ = t ) ? "shadow" : "" ) } else this . height _ = 0 , this . setup ( ) } , t . reset = function ( ) { this . header _ . dataset . mdState = "" , this . height _ = 0 , this . active _ = ! 1 } , e } ( ) , Title : function ( ) { function e ( e , t ) { var n = "string" == typeof e ? document . querySelector ( e ) : e ; if ( ! ( n instanceof HTMLElement ) ) throw new ReferenceError ; if ( this . el _ = n , ! ( ( n = "string" == typeof t ? document . querySelector ( t ) : t ) instanceof HTMLHeadingElement ) ) throw new ReferenceError ; this . header _ = n , this . active _ = ! 1 } var t = e . prototype ; return t . setup = function ( ) { var t = this ; Array . prototype . forEach . call ( this . el _ . children , function ( e ) { e . style . width = t . el _ . offsetWidth - 20 + "px" } ) } , t . update = function ( e ) { var t = this , n = window . pageYOffset >= this . header _ . offsetTop ; n !== this . active _ && ( this . el _ . dataset . mdState = ( this . active _ = n ) ? "active" : "" ) , "resize" !== e . type && "orientationchange" !== e . type || Array . prototype . forEach . call ( this . el _ . children , function ( e ) { e . style . width = t . el _ . offsetWidth - 20 + "px" } ) } , t . reset = function ( ) { this . el _ . dataset . mdState = "" , this . el _ . style . width = "" , this . active _ = ! 1 } , e } ( ) } , o = { Blur : function ( ) { function e ( e ) { this . els _ = "string" == typeof e ? document . querySelectorAll ( e ) : e , this . index _ = 0 , this . offset _ = window . pageYOffset , this . dir _ = ! 1 , this . anchors _ = [ ] . reduce . call ( this . els _ , function ( e , t ) { var n = decodeURIComponent ( t . hash ) ; return e . concat ( document . getElementById ( n . substring ( 1 ) ) || [ ] ) } , [ ] ) } var t = e . prototype ; return t . setup = function ( ) { this . update ( ) } , t . update = function ( ) { var e = window . pageYOffset , t = this . offset _ - e < 0 ; if ( this . dir _ !== t && ( this . index _ = this . index _ = t ? 0 : this . els _ . length - 1 ) , 0 !== this . anchors _ . length ) { if ( thi
/ * !
* clipboard . js v2 . 0.4
* https : //zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
* /
var r ; r = function ( ) { return function ( n ) { var r = { } ; function i ( e ) { if ( r [ e ] ) return r [ e ] . exports ; var t = r [ e ] = { i : e , l : ! 1 , exports : { } } ; return n [ e ] . call ( t . exports , t , t . exports , i ) , t . l = ! 0 , t . exports } return i . m = n , i . c = r , i . d = function ( e , t , n ) { i . o ( e , t ) || Object . defineProperty ( e , t , { enumerable : ! 0 , get : n } ) } , i . r = function ( e ) { "undefined" != typeof Symbol && Symbol . toStringTag && Object . defineProperty ( e , Symbol . toStringTag , { value : "Module" } ) , Object . defineProperty ( e , "__esModule" , { value : ! 0 } ) } , i . t = function ( t , e ) { if ( 1 & e && ( t = i ( t ) ) , 8 & e ) return t ; if ( 4 & e && "object" == typeof t && t && t . _ _esModule ) return t ; var n = Object . create ( null ) ; if ( i . r ( n ) , Object . defineProperty ( n , "default" , { enumerable : ! 0 , value : t } ) , 2 & e && "string" != typeof t ) for ( var r in t ) i . d ( n , r , function ( e ) { return t [ e ] } . bind ( null , r ) ) ; return n } , i . n = function ( e ) { var t = e && e . _ _esModule ? function ( ) { return e . default } : function ( ) { return e } ; return i . d ( t , "a" , t ) , t } , i . o = function ( e , t ) { return Object . prototype . hasOwnProperty . call ( e , t ) } , i . p = "" , i ( i . s = 0 ) } ( [ function ( e , t , n ) { "use strict" ; var i = "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 } , o = function ( ) { function r ( e , t ) { for ( var n = 0 ; n < t . length ; n ++ ) { var r = t [ n ] ; r . enumerable = r . enumerable || ! 1 , r . configurable = ! 0 , "value" in r && ( r . writable = ! 0 ) , Object . defineProperty ( e , r . key , r ) } } return function ( e , t , n ) { return t && r ( e . prototype , t ) , n && r ( e , n ) , e } } ( ) , a = r ( n ( 1 ) ) , s = r ( n ( 3 ) ) , c = r ( n ( 4 ) ) ; function r ( e ) { return e && e . _ _esModule ? e : { default : e } } var l = function ( e ) { function r ( e , t ) { ! function ( e , t ) { if ( ! ( e instanceof t ) ) throw new TypeError ( "Cannot call a class as a function" ) } ( this , r ) ; var n = function ( e , t ) { if ( ! e ) throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; return ! t || "object" != typeof t && "function" != typeof t ? e : t } ( this , ( r . _ _proto _ _ || Object . getPrototypeOf ( r ) ) . call ( this ) ) ; return n . resolveOptions ( t ) , n . listenClick ( e ) , n } return function ( e , t ) { if ( "function" != typeof t && null !== t ) throw new TypeError ( "Super expression must either be null or a function, not " + typeof t ) ; e . prototype = Object . create ( t && t . prototype , { constructor : { value : e , enumerable : ! 1 , writable : ! 0 , configurable : ! 0 } } ) , t && ( Object . setPrototypeOf ? Object . setPrototypeOf ( e , t ) : e . _ _proto _ _ = t ) } ( r , s . default ) , o ( r , [ { key : "resolveOptions" , value : function ( ) { var e = 0 < arguments . length && void 0 !== arguments [ 0 ] ? arguments [ 0 ] : { } ; this . action = "function" == typeof e . action ? e . action : this . defaultAction , this . target = "function" == typeof e . target ? e . target : this . defaultTarget , this . text = "function" == typeof e . text ? e . text : this . defaultText , this . container = "object" === i ( e . container ) ? e . container : document . body } } , { key : "listenClick" , value : function ( e ) { var t = this ; this . listener = ( 0 , c . default ) ( e , "click" , function ( e ) { return t . onClick ( e ) } ) } } , { key : "onClick" , value : function ( e ) { var t = e . delegateTarget || e . currentTarget ; this . clipboardAction && ( this . clipboardAction = null ) , this . clipboardAction = new a . default ( { action : this . action ( t ) , target : this . target ( t ) , text : this . text ( t ) , container : this . container , trigger : t , emitter : this } ) } } , { key : "defaultAction" , value : function ( e ) { return u ( "action" , e ) } } , { key : "defaultTarget" , value : function ( e ) { var t = u ( "target" , e ) ; if ( t ) return document . querySelector ( t ) } } , { key : "defaultText" , value : function ( e ) { return u ( "text" , e ) } } , { key : "destroy" , value : function ( ) { this . listener . destroy ( ) , this . clipboardAction && ( this . clipboardAction . destroy ( ) , this . clipboardAction = null ) } } ] , [ { key : "isSupported" , value : function ( ) { var e = 0 < arguments . length && void 0 !== arguments [ 0 ] ? arguments [ 0 ] : [ "copy" , "cut" ] , t = "string" == typeof e ? [ e ] : e , n = ! ! document . queryCommandSupported ; return t . forEach ( function ( e ) { n = n && ! ! document . queryCommandSupported ( e ) } ) , n } } ] ) , r } ( ) ; function u ( e , t ) { var n = "data-clipboard-" + e ; if ( t . hasAttribute ( n ) ) return t . getAttribute ( n ) } e . exports = l } , function ( e , t , n ) { "use strict" ; var r , i = "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 } , o = function ( ) { function r ( e , t ) { for ( var n = 0 ; n < t . length ; n ++ ) { var r = t [ n ] ; r . enumerable = r . enumerable || ! 1 , r . configurable = ! 0 , " value
/ * !
* JavaScript Cookie v2 . 2.0
* https : //github.com/js-cookie/js-cookie
*
* Copyright 2006 , 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
2019-12-22 18:23:54 +03:00
* /!function(e){if(void 0===(s="function"==typeof(a=e)?a.call(i,o,i,r):a)||(r.exports=s),!0,r.exports=e(),!!0){var t=window.Cookies,n=window.Cookies=e();n.noConflict=function(){return window.Cookies=t,n}}}(function(){function m(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}return function e(h){function p(e,t,n){var r;if("undefined"!=typeof document){if(1<arguments.length){if("number"==typeof(n=m({path:"/ "},p.defaults,n)).expires){var i=new Date;i.setMilliseconds(i.getMilliseconds()+864e5*n.expires),n.expires=i}n.expires=n.expires?n.expires.toUTCString():" ";try{r=JSON.stringify(t),/^[\{\[]/.test(r)&&(t=r)}catch(e){}t=h.write?h.write(t,e):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var o=" ";for(var a in n)n[a]&&(o+=" ; "+a,!0!==n[a]&&(o+=" = "+n[a]));return document.cookie=e+" = "+t+o}e||(r={});for(var s=document.cookie?document.cookie.split(" ; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l<s.length;l++){var u=s[l].split(" = "),f=u.slice(1).join(" = ");this.json||'" ' !== f . charAt ( 0 ) || ( f = f . slice ( 1 , - 1 ) ) ; try { var d = u [ 0 ] . replace ( c , decodeURIComponent ) ; if ( f = h . read ? h . read ( f , d ) : h ( f , d ) || f . replace ( c , decodeURIComponent ) , this . json ) try { f = JSON . parse ( f ) } catch ( e ) { } if ( e === d ) { r = f ; break } e || ( r [ d ] = f ) } catch ( e ) { } } return r } } return ( p . set = p ) . get = function ( e ) { return p . call ( p , e ) } , p . getJSON = function ( ) { return p . apply ( { json : ! 0 } , [ ] . slice . call ( arguments ) ) } , p . defaults = { } , p . remove = function ( e , t ) { p ( e , "" , m ( t , { expires : - 1 } ) ) } , p . withConverter = e , p } ( function ( ) { } ) } ) } , function ( e , t , n ) { "use strict" ; n . r ( t ) ; var r = "function" == typeof fetch ? fetch . bind ( ) : function ( i , o ) { return o = o || { } , new Promise ( function ( e , t ) { var n = new XMLHttpRequest ; for ( var r in n . open ( o . method || "get" , i , ! 0 ) , o . headers ) n . setRequestHeader ( r , o . headers [ r ] ) ; function s ( ) { var r , i = [ ] , o = [ ] , a = { } ; return n . getAllResponseHeaders ( ) . replace ( /^(.*?):[^\S\n]*([\s\S]*?)$/gm , function ( e , t , n ) { i . push ( t = t . toLowerCase ( ) ) , o . push ( [ t , n ] ) , r = a [ t ] , a [ t ] = r ? r + "," + n : n } ) , { ok : 2 == ( n . status / 100 | 0 ) , status : n . status , statusText : n . statusText , url : n . responseURL , clone : s , text : function ( ) { return Promise . resolve ( n . responseText ) } , json : function ( ) { return Promise . resolve ( n . responseText ) . then ( JSON . parse ) } , blob : function ( ) { return Promise . resolve ( new Blob ( [ n . response ] ) ) } , headers : { keys : function ( ) { return i } , entries : function ( ) { return o } , get : function ( e ) { return a [ e . toLowerCase ( ) ] } , has : function ( e ) { return e . toLowerCase ( ) in a } } } } n . withCredentials = "include" == o . credentials , n . onload = function ( ) { e ( s ( ) ) } , n . onerror = t , n . send ( o . body || null ) } ) } ; t . default = r } , function ( e , t , n ) { "use strict" ; t . a = function ( t ) { var n = this . constructor ; return this . then ( function ( e ) { return n . resolve ( t ( ) ) . then ( function ( ) { return e } ) } , function ( e ) { return n . resolve ( t ( ) ) . then ( function ( ) { return n . reject ( e ) } ) } ) } } , function ( e , n , r ) { "use strict" ; ( function ( f ) { r . d ( n , "a" , function ( ) { return t } ) ; var e = r ( 1 ) , d = r . n ( e ) , h = function ( e ) { var t = document . getElementsByName ( "lang:" + e ) [ 0 ] ; if ( ! ( t instanceof HTMLMetaElement ) ) throw new ReferenceError ; return t . content } , t = function ( ) { function e ( e , t ) { var n = "string" == typeof e ? document . querySelector ( e ) : e ; if ( ! ( n instanceof HTMLElement ) ) throw new ReferenceError ; this . el _ = n ; var r = Array . prototype . slice . call ( this . el _ . children ) , i = r [ 0 ] , o = r [ 1 ] ; this . data _ = t , this . meta _ = i , this . list _ = o , this . message _ = { placeholder : this . meta _ . textContent , none : h ( "search.result.none" ) , one : h ( "search.result.one" ) , other : h ( "search.result.other" ) } ; var a = h ( "search.tokenizer" ) ; a . length && ( d . a . tokenizer . separator = a ) , this . lang _ = h ( "search.language" ) . split ( "," ) . filter ( Boolean ) . map ( function ( e ) { return e . trim ( ) } ) } return e . prototype . update = function ( e ) { var t , a = this ; if ( "focus" !== e . type || this . index _ ) { if ( "focus" === e . type || "keyup" === e . type ) { var n = e . target ; if ( ! ( n instanceof HTMLInputElement ) ) throw new ReferenceError ; if ( ! this . index _ || n . value === this . value _ ) return ; for ( ; this . list _ . firstChild ; ) this . list _ . removeChild ( this . list _ . firstChild ) ; if ( this . value _ = n . value , 0 === this . value _ . length ) return void ( this . meta _ . textContent = this . message _ . placeholder ) ; var r =
2019-11-20 13:12:09 +03:00
/ * !
* lunr . utils
* Copyright ( C ) 2019 Oliver Nightingale
* /,D.utils={},D.utils.warn=(t=this,function(e){t.console&&console.warn&&console.warn(e)}),D.utils.asString=function(e){return null==e?"":e.toString()},D.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];if(Array.isArray(o))t[i]=o.slice();else{if("string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o)throw new TypeError("clone is not deep and does not support nested objects");t[i]=o}}return t},D.FieldRef=function(e,t,n){this.docRef=e,this.fieldName=t,this._stringValue=n},D.FieldRef.joiner="/ ",D.FieldRef.fromString=function(e){var t=e.indexOf(D.FieldRef.joiner);if(-1===t)throw" malformed field ref string " ; var n = e . slice ( 0 , t ) , r = e . slice ( t + 1 ) ; return new D . FieldRef ( r , n , e ) } , D . FieldRef . prototype . toString = function ( ) { return null == this . _stringValue && ( this . _stringValue = this . fieldName + D . FieldRef . joiner + this . docRef ) , this . _stringValue }
/ * !
* lunr . Set
* Copyright ( C ) 2019 Oliver Nightingale
* /,D.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},D.Set.complete={intersect:function(e){return e},union:function(e){return e},contains:function(){return!0}},D.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},D.Set.prototype.contains=function(e){return!!this.elements[e]},D.Set.prototype.intersect=function(e){var t,n,r,i=[];if(e===D.Set.complete)return this;if(e===D.Set.empty)return e;n=this.length<e.length?(t=this,e):(t=e,this),r=Object.keys(t.elements);for(var o=0;o<r.length;o++){var a=r[o];a in n.elements&&i.push(a)}return new D.Set(i)},D.Set.prototype.union=function(e){return e===D.Set.complete?D.Set.complete:e===D.Set.empty?this:new D.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},D.idf=function(e,t){var n=0;for(var r in e)"_index"!=r&&(n+=Object.keys(e[r]).length);var i=(t-n+.5)/ ( n + . 5 ) ; return Math . log ( 1 + Math . abs ( i ) ) } , D . Token = function ( e , t ) { this . str = e || "" , this . metadata = t || { } } , D . Token . prototype . toString = function ( ) { return this . str } , D . Token . prototype . update = function ( e ) { return this . str = e ( this . str , this . metadata ) , this } , D . Token . prototype . clone = function ( e ) { return e = e || function ( e ) { return e } , new D . Token ( e ( this . str , this . metadata ) , this . metadata ) }
/ * !
* lunr . tokenizer
* Copyright ( C ) 2019 Oliver Nightingale
* /,D.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return new D.Token(D.utils.asString(e).toLowerCase(),D.utils.clone(t))});for(var n=e.toString().trim().toLowerCase(),r=n.length,i=[],o=0,a=0;o<=r;o++){var s=o-a;if(n.charAt(o).match(D.tokenizer.separator)||o==r){if(0<s){var c=D.utils.clone(t)||{};c.position=[a,s],c.index=i.length,i.push(new D.Token(n.slice(a,o),c))}a=o+1}}return i},D.tokenizer.separator=/ [ \ s \ - ] + /
/ * !
* lunr . Pipeline
* Copyright ( C ) 2019 Oliver Nightingale
* / , D . 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 = [ ] } , D . 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 ) , D . 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 & & D . 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 , D . 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 } , D . 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 | | D . 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 ) } , D . P i p e l i n e . l o a d = f u n c t i o n ( e ) { v a r n = n e w D . 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 t = D . 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 ( ! t ) 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 ) ; n . a d d ( t ) } ) , n } , D . 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 ( ) { 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 ) . f o r E a c h ( f u n c t i o n ( e ) { D . 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 ) } , D . 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 ) { D . 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 n = t h i s . _ s t a c k . i n d e x O f ( e ) ; i f ( - 1 = = n ) 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 " ) ; n + = 1 , t h i s . _ s t a c k . s p l i c e ( n , 0 , t ) } , D . 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 ) { D . 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 n = t h i s . _ s t a c k . i n d e x O f ( e ) ; i f ( - 1 = = n ) 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 ( n , 0 , t ) } , D . 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 ) } , D . 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 , n = 0 ; n < t ; n + + ) { f o r ( v a r r = t h i s . _ s t a c k [ n ] , i = [ ] , o = 0 ; o < e . l e n g t h ; o + + ) { v a r a = r ( e [ o ] , o , e ) ; i f ( v o i d 0 ! = = a & & " " ! = = a ) i f ( A r r a y . i s A r r a y ( a ) ) f o r ( v a r s = 0 ; s < a . l e n g t h ; s + + ) i . p u s h ( a [ s ] ) ; e l s e i . p u s h ( a ) } e = i } r e t u r n e } , D . 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 n = n e w D . T o k e n ( e , t ) ; r e t u r n t h i s . r u n ( [ n ] ) . 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 ( ) } ) } , D . 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 = [ ] } , D . 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 D . 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 } ) }
/ * !
* lunr . Vector
* Copyright ( C ) 2019 Oliver Nightingale
* / , D . 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 | | [ ] } , D . 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 , n = t h i s . e l e m e n t s . l e n g t h / 2 , r = n - t , i = M a t h . f l o o r ( r / 2 ) , o = t h i s . e l e m e n t s [ 2 * i ] ; 1 < r & & ( o < e & & ( t = i ) , e < o & & ( n = i ) , o ! = e ) ; ) r = n - t , i = t + M a t h . f l o o r ( r / 2 ) , o = t h i s . e l e m e n t s [ 2 * i ] ; r e t u r n o = = e ? 2 * i : e < o ? 2 * i : o < e ? 2 * ( i + 1 ) : v o i d 0 } , D . 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 " } ) } , D . 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 , n ) { t h i s . _ m a g n i t u d e = 0 ; v a r r = 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 [ r ] = = e ? t h i s . e l e m e n t s [ r + 1 ] = n ( t h i s . e l e m e n t s [ r + 1 ] , t ) : t h i s . e l e m e n t s . s p l i c e ( r , 0 , e , t ) } , D . 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 , n = 1 ; n < t ; n + = 2 ) { v a r r = t h i s . e l e m e n t s [ n ] ; e + = r * r } 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 ) } , D . 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 , n = t h i s . e l e m e n t s , r = e . e l e m e n t s , i = n . l e n g t h , o = r . l e n g t h , a = 0 , s = 0 , c = 0 , l = 0 ; c < i & & l < o ; ) ( a = n [ c ] ) < ( s = r [ l ] ) ? c + = 2 : s < a ? l + = 2 : a = = s & & ( t + = n [ c + 1 ] * r [ l + 1 ] , c + = 2 , l + = 2 ) ; r e t u r n t } , D . 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 } , D . 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 , n = 0 ; t < t h i s . e l e m e n t s . l e n g t h ; t + = 2 , n + + ) e [ n ] = t h i s . e l e m e n t s [ t ] ; r e t u r n e } , D . 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 }
/ * !
* lunr . stemmer
* Copyright ( C ) 2019 Oliver Nightingale
* Includes code from - http : //tartarus.org/~martin/PorterStemmer/js.txt
* /,D.stemmer=(l={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"},u={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",n="[^aeiou][^aeiouy]*",f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),m=/ ^ ( . + ? ) ( ss | i ) es$ / , y = /^(.+?)([^s])s$/ , v = /^(.+?)eed$/ , g = /^(.+?)(ed|ing)$/ , w = /.$/ , _ = /(at|bl|iz)$/ , E = new RegExp ( "([^aeiouylsz])\\1$" ) , x = new RegExp ( "^" + n + e + "[^aeiouwxy]$" ) , b = /^(.+?[^aeiou])y$/ , k = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/ , S = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/ , T = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/ , L = /^(.+?)(s|t)(ion)$/ , R = /^(.+?)e$/ , O = /ll$/ , C = new RegExp ( "^" + n + e + "[^aeiouwxy]$" ) , r = function ( e ) { var t , n , r , i , o , a , s ; if ( e . length < 3 ) return e ; if ( "y" == ( r = e . substr ( 0 , 1 ) ) && ( e = r . toUpperCase ( ) + e . substr ( 1 ) ) , o = y , ( i = m ) . test ( e ) ? e = e . replace ( i , "$1$2" ) : o . test ( e ) && ( e = e . replace ( o , "$1$2" ) ) , o = g , ( i = v ) . test ( e ) ) { var c = i . exec ( e ) ; ( i = f ) . test ( c [ 1 ] ) && ( i = w , e = e . replace ( i , "" ) ) } else if ( o . test ( e ) ) { t = ( c = o . exec ( e ) ) [ 1 ] , ( o = p ) . test ( t ) && ( a = E , s = x , ( o = _ ) . test ( e = t ) ? e += "e" : a . test ( e ) ? ( i = w , e = e . replace ( i , "" ) ) : s . test ( e ) && ( e += "e" ) ) } ( i = b ) . test ( e ) && ( e = ( t = ( c = i . exec ( e ) ) [ 1 ] ) + "i" ) ; ( i = k ) . test ( e ) && ( t = ( c = i . exec ( e ) ) [ 1 ] , n = c [ 2 ] , ( i = f ) . test ( t ) && ( e = t + l [ n ] ) ) ; ( i = S ) . test ( e ) && ( t = ( c = i . exec ( e ) ) [ 1 ] , n = c [ 2 ] , ( i = f ) . test ( t ) && ( e = t + u [ n ] ) ) ; if ( o = L , ( i = T ) . test ( e ) ) t = ( c = i . exec ( e ) ) [ 1 ] , ( i = d ) . test ( t ) && ( e = t ) ; else if ( o . test ( e ) ) { t = ( c = o . exec ( e ) ) [ 1 ] + c [ 2 ] , ( o = d ) . test ( t ) && ( e = t ) } ( i = R ) . test ( e ) && ( t = ( c = i . exec ( e ) ) [ 1 ] , o = h , a = C , ( ( i = d ) . test ( t ) || o . test ( t ) && ! a . test ( t ) ) && ( e = t ) ) ; return o = d , ( i = O ) . test ( e ) && o . test ( e ) && ( i = w , e = e . replace ( i , "" ) ) , "y" == r && ( e = r . toLowerCase ( ) + e . substr ( 1 ) ) , e } , function ( e ) { return e . update ( r ) } ) , D . Pipeline . registerFunction ( D . stemmer , "stemmer" )
/ * !
* lunr . stopWordFilter
* Copyright ( C ) 2019 Oliver Nightingale
* / , D . 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 } } , D . s t o p W o r d F i l t e r = D . 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 " ] ) , D . P i p e l i n e . r e g i s t e r F u n c t i o n ( D . 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
* /,D.trimmer=function(e){return e.update(function(e){return e.replace(/ ^ \ W + /,"").replace(/ \ W + $ / , "" ) } ) } , D . Pipeline . registerFunction ( D . trimmer , "trimmer" )
/ * !
* lunr . TokenSet
* Copyright ( C ) 2019 Oliver Nightingale
* / , D . 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 = D . T o k e n S e t . _ n e x t I d , D . T o k e n S e t . _ n e x t I d + = 1 } , D . T o k e n S e t . _ n e x t I d = 1 , D . 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 D . T o k e n S e t . B u i l d e r , n = 0 , r = e . l e n g t h ; n < r ; n + + ) t . i n s e r t ( e [ n ] ) ; r e t u r n t . f i n i s h ( ) , t . r o o t } , D . 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 ? D . 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 ) : D . T o k e n S e t . f r o m S t r i n g ( e . t e r m ) } , D . 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 n = n e w D . T o k e n S e t , r = [ { n o d e : n , e d i t s R e m a i n i n g : t , s t r : e } ] ; r . l e n g t h ; ) { v a r i = r . p o p ( ) ; i f ( 0 < i . s t r . l e n g t h ) { v a r o , a = i . s t r . c h a r A t ( 0 ) ; a i n i . n o d e . e d g e s ? o = i . n o d e . e d g e s [ a ] : ( o = n e w D . T o k e n S e t , i . n o d e . e d g e s [ a ] = o ) , 1 = = i . s t r . l e n g t h & & ( o . f i n a l = ! 0 ) , r . p u s h ( { n o d e : o , 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 s = i . n o d e . e d g e s [ " * " ] ; e l s e { s = n e w D . T o k e n S e t ; i . n o d e . e d g e s [ " * " ] = s } i f ( 0 = = i . s t r . l e n g t h & & ( s . f i n a l = ! 0 ) , r . 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 - 1 , s t r : i . s t r } ) , 1 < i . s t r . l e n g t h & & r . 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 ) , 1 < = i . s t r . l e n g t h ) { i f ( " * " i n i . n o d e . e d g e s ) v a r c = i . n o d e . e d g e s [ " * " ] ; e l s e { c = n e w D . T o k e n S e t ; i . n o d e . e d g e s [ " * " ] = c } 1 = = i . s t r . l e n g t h & & ( c . f i n a l = ! 0 ) , r . p u s h ( { n o d e : c , 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 ( 1 < i . s t r . l e n g t h ) { v a r l , u = i . s t r . c h a r A t ( 0 ) , f = i . s t r . c h a r A t ( 1 ) ; f i n i . n o d e . e d g e s ? l = i . n o d e . e d g e s [ f ] : ( l = n e w D . T o k e n S e t , i . n o d e . e d g e s [ f ] = l ) , 1 = = i . s t r . l e n g t h & & ( l . f i n a l = ! 0 ) , r . 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 : u + i . s t r . s l i c e ( 2 ) } ) } } } r e t u r n n } , D . 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 D . T o k e n S e t , n = t , r = 0 , i = e . l e n g t h ; r < i ; r + + ) { v a r o = e [ r ] , a = r = = i - 1 ; i f ( " * " = = o ) ( t . e d g e s [ o ] = t ) . f i n a l = a ; e l s e { v a r s = n e w D . T o k e n S e t ; s . f i n a l = a , t . e d g e s [ o ] = s , t = s } } r e t u r n n } , D . 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 n = t . p o p ( ) , r = O b j e c t . k e y s ( n . n o d e . e d g e s ) , i = r . l e n g t h ; n . n o d e . f i n a l & & ( n . p r e f i x . c h a r A t ( 0 ) , e . p u s h ( n . p r e f i x ) ) ; f o r ( v a r o = 0 ; o < i ; o + + ) { v a r a = r [ o ] ; t . p u s h ( { p r e f i x : n . p r e f i x . c o n c a t ( a ) , n o d e : n . n o d e . e d g e s [ a ] } ) } } r e t u r n e } , D . 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 ( ) , n = t . l e n g t h , r = 0 ; r < n ; r + + ) { v a r i = t [ r ] ; e = e + i + t h i s . e d g e s [ i ] . i d } r e t u r n e } , D . 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 D . T o k e n S e t , n = v o i d 0 , r = [ { q N o d e : e , o u t p u t : t , n o d e : t h i s } ] ; r . l e n g t h ; ) { n = r . p o p ( ) ; f o r ( v a r i = O b j e c t . k e y s ( n . q N o d e . e d g e s ) , o = i . l e n g t h , a = O b j e c t . k e y s ( n . n o d e . e d g e s ) , s = a . l e n g t h , c = 0 ; c < o ; c + + ) f o r ( v a r l = i [ c ] , u = 0 ; u < s ; u + + ) { v a r f = a [ u ] ; i f ( f = = l | | " * " = = l ) { v a r d = n . n o d e . e d g e s [ f ] , h = n . q N o d e . e d g e s [ l ] , p = d . f i n a l & & h . f i n a l , m = v o i d 0 ; f i n n . o u t p u t . e d g e s ? ( m = n . o u t p u t . e d g e s [ f ] ) . f i n a l = m . f i n a l | | p : ( ( m = n e w D . T o k e n S e t ) . f i n a l = p , n . o u t p u t . e d g e s [ f ] = m ) , r . p u s h ( { q N o d e : h , o u t p u t : m , n o d e : d } ) } } } r e t u r n t } , D . 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 D . 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 = { } } , D . 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 , n = 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 r = 0 ; r < e . l e n g t h & & r < t h i s . p r e v i o u s W o r d . l e n g t h & & e [ r ] = = t h i s . p r e v i o u s W o r d [ r ] ; r + + ) n + + ; t h i s . m i n i m i z e ( n ) , 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 ( r = n ; r < e . l e n g t h ; r + + ) { v a r i = n e w D . T o k e n S e t , o = e [ r ] ; t . e d g e s [ o ] = 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 : o , 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 } , D . 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 ) } , D . 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 ; e < = t ; t - - ) { v a r n = t h i s . u n c h e c k e d N o d e s [ t ] , r = n . c h i l d . t o S t r i n g ( ) ; r i n t h i s . m i n i m i z e d N o d e s ? n . p a r e n t . e d g e s [ n . c h a r ] = t h i s . m i n i m i z e d N o d e s [ r ] : ( n . c h i l d . _ s t r = r , t h i s . m i n i m i z e d N o d e s [ r ] = n . 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 ( ) } }
/ * !
* lunr . Index
* Copyright ( C ) 2019 Oliver Nightingale
* /,D.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},D.Index.prototype.search=function(t){return this.query(function(e){new D.QueryParser(t,e).parse()})},D.Index.prototype.query=function(e){for(var t=new D.Query(this.fields),n=Object.create(null),r=Object.create(null),i=Object.create(null),o=Object.create(null),a=Object.create(null),s=0;s<this.fields.length;s++)r[this.fields[s]]=new D.Vector;e.call(t,t);for(s=0;s<t.clauses.length;s++){var c=t.clauses[s],l=null,u=D.Set.complete;l=c.usePipeline?this.pipeline.runString(c.term,{fields:c.fields}):[c.term];for(var f=0;f<l.length;f++){var d=l[f];c.term=d;var h=D.TokenSet.fromClause(c),p=this.tokenSet.intersect(h).toArray();if(0===p.length&&c.presence===D.Query.presence.REQUIRED){for(var m=0;m<c.fields.length;m++){o[Q=c.fields[m]]=D.Set.empty}break}for(var y=0;y<p.length;y++){var v=p[y],g=this.invertedIndex[v],w=g._index;for(m=0;m<c.fields.length;m++){var _=g[Q=c.fields[m]],E=Object.keys(_),x=v+"/ "+Q,b=new D.Set(E);if(c.presence==D.Query.presence.REQUIRED&&(u=u.union(b),void 0===o[Q]&&(o[Q]=D.Set.complete)),c.presence!=D.Query.presence.PROHIBITED){if(r[Q].upsert(w,c.boost,function(e,t){return e+t}),!i[x]){for(var k=0;k<E.length;k++){var S,T=E[k],L=new D.FieldRef(T,Q),R=_[T];void 0===(S=n[L])?n[L]=new D.MatchData(v,Q,R):S.add(v,Q,R)}i[x]=!0}}else void 0===a[Q]&&(a[Q]=D.Set.empty),a[Q]=a[Q].union(b)}}}if(c.presence===D.Query.presence.REQUIRED)for(m=0;m<c.fields.length;m++){o[Q=c.fields[m]]=o[Q].intersect(u)}}var O=D.Set.complete,C=D.Set.empty;for(s=0;s<this.fields.length;s++){var Q;o[Q=this.fields[s]]&&(O=O.intersect(o[Q])),a[Q]&&(C=C.union(a[Q]))}var P=Object.keys(n),A=[],I=Object.create(null);if(t.isNegated()){P=Object.keys(this.fieldVectors);for(s=0;s<P.length;s++){L=P[s];var M=D.FieldRef.fromString(L);n[L]=new D.MatchData}}for(s=0;s<P.length;s++){var N=(M=D.FieldRef.fromString(P[s])).docRef;if(O.contains(N)&&!C.contains(N)){var j,F=this.fieldVectors[M],H=r[M.fieldName].similarity(F);if(void 0!==(j=I[N]))j.score+=H,j.matchData.combine(n[M]);else{var q={ref:N,score:H,matchData:n[M]};I[N]=q,A.push(q)}}}return A.sort(function(e,t){return t.score-e.score})},D.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:D.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},D.Index.load=function(e){var t={},n={},r=e.fieldVectors,i=Object.create(null),o=e.invertedIndex,a=new D.TokenSet.Builder,s=D.Pipeline.load(e.pipeline);e.version!=D.version&&D.utils.warn(" Version mismatch when loading serialised index . Current version of lunr '"+D.version+"' does not match serialized index '"+e.version+"' " ) ; for ( var c = 0 ; c < r . length ; c ++ ) { var l = ( f = r [ c ] ) [ 0 ] , u = f [ 1 ] ; n [ l ] = new D . Vector ( u ) } for ( c = 0 ; c < o . length ; c ++ ) { var f , d = ( f = o [ c ] ) [ 0 ] , h = f [ 1 ] ; a . insert ( d ) , i [ d ] = h } return a . finish ( ) , t . fields = e . fields , t . fieldVectors = n , t . invertedIndex = i , t . tokenSet = a . root , t . pipeline = s , new D . Index ( t ) }
/ * !
* lunr . Builder
* Copyright ( C ) 2019 Oliver Nightingale
* /,D.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=D.tokenizer,this.pipeline=new D.Pipeline,this.searchPipeline=new D.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},D.Builder.prototype.ref=function(e){this._ref=e},D.Builder.prototype.field=function(e,t){if(/ \ //.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},D.Builder.prototype.b=function(e){this._b=e<0?0:1<e?1:e},D.Builder.prototype.k1=function(e){this._k1=e},D.Builder.prototype.add=function(e,t){var n=e[this._ref],r=Object.keys(this._fields);this._documents[n]=t||{},this.documentCount+=1;for(var i=0;i<r.length;i++){var o=r[i],a=this._fields[o].extractor,s=a?a(e):e[o],c=this.tokenizer(s,{fields:[o]}),l=this.pipeline.run(c),u=new D.FieldRef(n,o),f=Object.create(null);this.fieldTermFrequencies[u]=f,this.fieldLengths[u]=0,this.fieldLengths[u]+=l.length;for(var d=0;d<l.length;d++){var h=l[d];if(null==f[h]&&(f[h]=0),f[h]+=1,null==this.invertedIndex[h]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var m=0;m<r.length;m++)p[r[m]]=Object.create(null);this.invertedIndex[h]=p}null==this.invertedIndex[h][o][n]&&(this.invertedIndex[h][o][n]=Object.create(null));for(var y=0;y<this.metadataWhitelist.length;y++){var v=this.metadataWhitelist[y],g=h.metadata[v];null==this.invertedIndex[h][o][n][v]&&(this.invertedIndex[h][o][n][v]=[]),this.invertedIndex[h][o][n][v].push(g)}}}},D.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,n={},r={},i=0;i<t;i++){var o=D.FieldRef.fromString(e[i]),a=o.fieldName;r[a]||(r[a]=0),r[a]+=1,n[a]||(n[a]=0),n[a]+=this.fieldLengths[o]}var s=Object.keys(this._fields);for(i=0;i<s.length;i++){var c=s[i];n[c]=n[c]/r[c]}this.averageFieldLength=n},D.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),n=t.length,r=Object.create(null),i=0;i<n;i++){for(var o=D.FieldRef.fromString(t[i]),a=o.fieldName,s=this.fieldLengths[o],c=new D.Vector,l=this.fieldTermFrequencies[o],u=Object.keys(l),f=u.length,d=this._fields[a].boost||1,h=this._documents[o.docRef].boost||1,p=0;p<f;p++){var m,y,v,g=u[p],w=l[g],_=this.invertedIndex[g]._index;void 0===r[g]?(m=D.idf(this.invertedIndex[g],this.documentCount),r[g]=m):m=r[g],y=m*((this._k1+1)*w)/(this._k1*(1-this._b+this._b*(s/this.averageFieldLength[a]))+w),y*=d,y*=h,v=Math.round(1e3*y)/1e3,c.insert(_,v)}e[o]=c}this.fieldVectors=e},D.Builder.prototype.createTokenSet=function(){this.tokenSet=D.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},D.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new D.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},D.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},D.MatchData=function(e,t,n){for(var r=Object.create(null),i=Object.keys(n||{}),o=0;o<i.length;o++){var a=i[o];r[a]=n[a].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=r)},D.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),n=0;n<t.length;n++){var r=t[n],i=Object.keys(e.metadata[r]);null==this.metadata[r]&&(this.metadata[r]=Object.create(null));for(var o=0;o<i.length;o++){var a=i[o],s=Object.keys(e.metadata[r][a]);null==this.metadata[r][a]&&(this.metadata[r][a]=Object.create(null));for(var c=0;c<s.length;c++){var l=s[c];null==this.metadata[r][a][l]?this.metadata[r][a][l]=e.metadata[r][a][l]:this.metadata[r][a][l]=this.metadata[r][a][l].concat(e.metadata[r][a][l])}}}},D.MatchData.prototype.add=function(e,t,n){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=n);if(t in t