flexsearch
Advanced tools
Comparing version 0.6.30 to 0.6.32
@@ -24,3 +24,3 @@ /* | ||
this.a.index,f=this.a.keys,k=this.a.tag;e=this.a.store;var g;var l=this.a.id;d=b;for(var p=0;p<l.length;p++)d=d[l[p]];if("remove"===a&&(delete this.j[d],l=f.length,l--)){for(b=0;b<l;b++)h[f[b]].remove(d);return h[f[l]].remove(d,c)}if(k){for(g=0;g<k.length;g++){var n=k[g];var m=b;l=n.split(":");for(p=0;p<l.length;p++)m=m[l[p]];m="@"+m}g=this.s[n];g=g[m]||(g[m]=[])}l=this.a.field;for(let u=0,q=l.length;u<q;u++){n=l[u];k=b;for(m=0;m<n.length;m++)k=k[n[m]];n=h[f[u]];m="add"===a?n.add:n.update;u===q-1? | ||
m.call(n,d,k,c):m.call(n,d,k)}if(e){c=Object.keys(e);a=B();for(h=0;h<c.length;h++)if(f=c[h],e[f]){f=f.split(":");let u,q;for(l=0;l<f.length;l++)k=f[l],q=(q||b)[k],u=(u||a)[k]=q}b=a}g&&(g[g.length]=b);this.j[d]=b}return this};x.prototype.update=function(a,b,c){if(this.a&&J(a))return this.i("update",a,b);this.f["@"+a]&&G(b)&&(this.remove(a),this.add(a,b,c,!0));return this};x.prototype.remove=function(a,b,c){if(this.a&&J(a))return this.i("remove",a,b);var d="@"+a;if(this.f[d]){if(!c){if(this.async&& | ||
m.call(n,d,k,c):m.call(n,d,k)}if(e){c=Object.keys(e);a=B();for(h=0;h<c.length;h++)if(f=c[h],e[f]){f=f.split(":");let u,q;for(l=0;l<f.length;l++)k=f[l],u=(u||b)[k],q=(q||a)[k]=u}b=a}g&&(g[g.length]=b);this.j[d]=b}return this};x.prototype.update=function(a,b,c){if(this.a&&J(a))return this.i("update",a,b);this.f["@"+a]&&G(b)&&(this.remove(a),this.add(a,b,c,!0));return this};x.prototype.remove=function(a,b,c){if(this.a&&J(a))return this.i("remove",a,b);var d="@"+a;if(this.f[d]){if(!c){if(this.async&& | ||
"function"!==typeof importScripts){let e=this;d=new Promise(function(h){setTimeout(function(){e.remove(a,null,!0);e=null;h()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a,null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)W(this.l[b],a);this.depth&&W(this.g,a);delete this.f[d]}return this};let K;x.prototype.search=function(a,b,c,d){if(J(b)){if(E(b))for(var e=0;e<b.length;e++)b[e].query=a;else b.query=a;a=b;b=1E3}else b&&P(b)?(c=b,b=1E3):b||0===b||(b=1E3);let h=[], | ||
@@ -27,0 +27,0 @@ f=a;let k,g,l;if(J(a)&&!E(a)){c||(c=a.callback)&&(f.callback=null);g=a.sort;k=!1;b=a.limit;var p=a.threshold;l=!1;a=a.query}if(this.a){p=this.a.index;var n=f.bool||"or",m=f.field;let w=n;let t,v;if(m)E(m)||(m=[m]);else if(E(f)){var u=f;m=[];w=[];for(var q=0;q<f.length;q++)d=f[q],e=d.bool||n,m[q]=d.field,w[q]=e,"not"===e?t=!0:"and"===e&&(v=!0)}else m=this.a.keys;n=m.length;for(q=0;q<n;q++)u&&(f=u[q]),k&&!G(f)&&(f.page=null,f.limit=0),h[q]=p[m[q]].search(f,0);if(c)return c(I.call(this,a,w,h,g,b,l,!1, |
@@ -12,15 +12,15 @@ /* | ||
function Aa(q,u){if(u){var r=Z;q=q.split(".");for(var E=0;E<q.length-1;E++){var K=q[E];K in r||(r[K]={});r=r[K]}q=q[q.length-1];E=r[q];u=u(E);u!=E&&null!=u&&na(r,q,{configurable:!0,writable:!0,value:u})}}Aa("Array.prototype.keys",function(q){return q?q:function(){return za(this,function(u){return u})}});function Ba(q){var u="undefined"!=typeof Symbol&&Symbol.iterator&&q[Symbol.iterator];return u?u.call(q):{next:ma(q)}} | ||
Aa("Promise",function(q){function u(n){this.h=0;this.m=void 0;this.b=[];var x=this.j();try{n(x.resolve,x.reject)}catch(l){x.reject(l)}}function r(){this.b=null}function E(n){return n instanceof u?n:new u(function(x){x(n)})}if(q)return q;r.prototype.h=function(n){if(null==this.b){this.b=[];var x=this;this.j(function(){x.m()})}this.b.push(n)};var K=Z.setTimeout;r.prototype.j=function(n){K(n,0)};r.prototype.m=function(){for(;this.b&&this.b.length;){var n=this.b;this.b=[];for(var x=0;x<n.length;++x){var l= | ||
n[x];n[x]=null;try{l()}catch(F){this.l(F)}}}this.b=null};r.prototype.l=function(n){this.j(function(){throw n;})};u.prototype.j=function(){function n(F){return function(I){l||(l=!0,F.call(x,I))}}var x=this,l=!1;return{resolve:n(this.L),reject:n(this.l)}};u.prototype.L=function(n){if(n===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(n instanceof u)this.M(n);else{a:switch(typeof n){case "object":var x=null!=n;break a;case "function":x=!0;break a;default:x=!1}x?this.K(n):this.w(n)}}; | ||
u.prototype.K=function(n){var x=void 0;try{x=n.then}catch(l){this.l(l);return}"function"==typeof x?this.N(x,n):this.w(n)};u.prototype.l=function(n){this.B(2,n)};u.prototype.w=function(n){this.B(1,n)};u.prototype.B=function(n,x){if(0!=this.h)throw Error("Cannot settle("+n+", "+x+"): Promise already settled in state"+this.h);this.h=n;this.m=x;this.I()};u.prototype.I=function(){if(null!=this.b){for(var n=0;n<this.b.length;++n)ba.h(this.b[n]);this.b=null}};var ba=new r;u.prototype.M=function(n){var x= | ||
this.j();n.F(x.resolve,x.reject)};u.prototype.N=function(n,x){var l=this.j();try{n.call(x,l.resolve,l.reject)}catch(F){l.reject(F)}};u.prototype.then=function(n,x){function l(L,W){return"function"==typeof L?function(ja){try{F(L(ja))}catch(ka){I(ka)}}:W}var F,I,ca=new u(function(L,W){F=L;I=W});this.F(l(n,F),l(x,I));return ca};u.prototype.catch=function(n){return this.then(void 0,n)};u.prototype.F=function(n,x){function l(){switch(F.h){case 1:n(F.m);break;case 2:x(F.m);break;default:throw Error("Unexpected state: "+ | ||
F.h);}}var F=this;null==this.b?ba.h(l):this.b.push(l)};u.resolve=E;u.reject=function(n){return new u(function(x,l){l(n)})};u.race=function(n){return new u(function(x,l){for(var F=Ba(n),I=F.next();!I.done;I=F.next())E(I.value).F(x,l)})};u.all=function(n){var x=Ba(n),l=x.next();return l.done?E([]):new u(function(F,I){function ca(ja){return function(ka){L[ja]=ka;W--;0==W&&F(L)}}var L=[],W=0;do L.push(void 0),W++,E(l.value).F(ca(L.length-1),I),l=x.next();while(!l.done)})};return u}); | ||
Aa("Promise",function(q){function u(m){this.h=0;this.m=void 0;this.b=[];var x=this.j();try{m(x.resolve,x.reject)}catch(l){x.reject(l)}}function r(){this.b=null}function E(m){return m instanceof u?m:new u(function(x){x(m)})}if(q)return q;r.prototype.h=function(m){if(null==this.b){this.b=[];var x=this;this.j(function(){x.m()})}this.b.push(m)};var K=Z.setTimeout;r.prototype.j=function(m){K(m,0)};r.prototype.m=function(){for(;this.b&&this.b.length;){var m=this.b;this.b=[];for(var x=0;x<m.length;++x){var l= | ||
m[x];m[x]=null;try{l()}catch(F){this.l(F)}}}this.b=null};r.prototype.l=function(m){this.j(function(){throw m;})};u.prototype.j=function(){function m(F){return function(I){l||(l=!0,F.call(x,I))}}var x=this,l=!1;return{resolve:m(this.L),reject:m(this.l)}};u.prototype.L=function(m){if(m===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(m instanceof u)this.M(m);else{a:switch(typeof m){case "object":var x=null!=m;break a;case "function":x=!0;break a;default:x=!1}x?this.K(m):this.w(m)}}; | ||
u.prototype.K=function(m){var x=void 0;try{x=m.then}catch(l){this.l(l);return}"function"==typeof x?this.N(x,m):this.w(m)};u.prototype.l=function(m){this.B(2,m)};u.prototype.w=function(m){this.B(1,m)};u.prototype.B=function(m,x){if(0!=this.h)throw Error("Cannot settle("+m+", "+x+"): Promise already settled in state"+this.h);this.h=m;this.m=x;this.I()};u.prototype.I=function(){if(null!=this.b){for(var m=0;m<this.b.length;++m)ba.h(this.b[m]);this.b=null}};var ba=new r;u.prototype.M=function(m){var x= | ||
this.j();m.F(x.resolve,x.reject)};u.prototype.N=function(m,x){var l=this.j();try{m.call(x,l.resolve,l.reject)}catch(F){l.reject(F)}};u.prototype.then=function(m,x){function l(L,W){return"function"==typeof L?function(ja){try{F(L(ja))}catch(ka){I(ka)}}:W}var F,I,ca=new u(function(L,W){F=L;I=W});this.F(l(m,F),l(x,I));return ca};u.prototype.catch=function(m){return this.then(void 0,m)};u.prototype.F=function(m,x){function l(){switch(F.h){case 1:m(F.m);break;case 2:x(F.m);break;default:throw Error("Unexpected state: "+ | ||
F.h);}}var F=this;null==this.b?ba.h(l):this.b.push(l)};u.resolve=E;u.reject=function(m){return new u(function(x,l){l(m)})};u.race=function(m){return new u(function(x,l){for(var F=Ba(m),I=F.next();!I.done;I=F.next())E(I.value).F(x,l)})};u.all=function(m){var x=Ba(m),l=x.next();return l.done?E([]):new u(function(F,I){function ca(ja){return function(ka){L[ja]=ka;W--;0==W&&F(L)}}var L=[],W=0;do L.push(void 0),W++,E(l.value).F(ca(L.length-1),I),l=x.next();while(!l.done)})};return u}); | ||
(function(q,u,r){var E;(E=r.define)&&E.amd?E([],function(){return u}):(E=r.modules)?E[q.toLowerCase()]=u:"object"===typeof exports?module.exports=u:r[q]=u})("FlexSearch",function Ca(q){function r(a,c){var b=c?c.id:a&&a.id;this.id=b||0===b?b:Da++;this.init(a,c);x(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].f):Object.keys(this.f)});x(this,"length",function(){return this.index.length})}function E(a,c,b,d){this.D!==this.i&&(this.A=this.A.concat(b),this.D++,d&&this.A.length>= | ||
d&&(this.D=this.i),this.D===this.i&&(this.cache&&this.u.set(c,this.A),this.H&&this.H(this.A)));return this}function K(a){var c=G(),b;for(b in a)if(a.hasOwnProperty(b)){var d=a[b];M(d)?c[b]=d.slice(0):P(d)?c[b]=K(d):c[b]=d}return c}function ba(a,c){for(var b=a.length,d=da(c),e=[],f=0,g=0;f<b;f++){var h=a[f];if(d&&c(h)||!d&&!c[h])e[g++]=h}return e}function n(a,c,b,d,e,f,g,h,k,m){b=ua(b,g?0:e,h,f,c,k,m);if(h){h=b.page;var w=b.next;b=b.result}if(g)c=this.where(g,null,e,b);else{c=b;b=this.v;e=c.length; | ||
f=Array(e);for(g=0;g<e;g++)f[g]=b[c[g]];c=f}b=c;d&&(da(d)||(X=d.split(":"),1<X.length?d=ka:(X=X[0],d=ja)),b.sort(d));b=fa(h,w,b);this.cache&&this.u.set(a,b);return b}function x(a,c,b){Object.defineProperty(a,c,{get:b})}function l(a){return new RegExp(a,"g")}function F(a,c){for(var b=0;b<c.length;b+=2)a=a.replace(c[b],c[b+1]);return a}function I(a,c,b,d,e,f,g,h){if(c[b])return c[b];e=e?(h-(g||h/1.5))*f+(g||h/1.5)*e:f;c[b]=e;e>=g&&(a=a[h-(e+.5>>0)],a=a[b]||(a[b]=[]),a[a.length]=d);return e}function ca(a, | ||
c){if(a)for(var b=Object.keys(a),d=0,e=b.length;d<e;d++){var f=b[d],g=a[f];if(g)for(var h=0,k=g.length;h<k;h++)if(g[h]===c){1===k?delete a[f]:g.splice(h,1);break}else P(g[h])&&ca(g[h],c)}}function L(a){for(var c="",b="",d="",e=0;e<a.length;e++){var f=a[e];if(f!==b)if(e&&"h"===f){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===b||"e"===b||"i"===b||"o"===b||"u"===b||"y"===b)&&d||" "===b)c+=f}else c+=f;d=e===a.length-1?"":a[e+1];b=f}return c}function W(a,c){a=a.length-c.length;return 0> | ||
a?1:a?-1:0}function ja(a,c){a=a[X];c=c[X];return a<c?-1:a>c?1:0}function ka(a,c){for(var b=X.length,d=0;d<b;d++)a=a[X[d]],c=c[X[d]];return a<c?-1:a>c?1:0}function fa(a,c,b){return a?{page:a,next:c?""+c:null,result:b}:b}function ua(a,c,b,d,e,f,g){var h=[];if(!0===b){b="0";var k=""}else k=b&&b.split(":");var m=a.length;if(1<m){var w=G(),z=[],v,p=0,t,D=!0,B=0,C;if(k)if(2===k.length){var A=k;k=!1}else k=C=parseInt(k[0],10);if(g){for(v=G();p<m;p++)if("not"===e[p]){var y=a[p];var J=y.length;for(t=0;t<J;t++)v["@"+ | ||
y[t]]=1}else var R=p+1;if(H(R))return fa(b,S,h);p=0}else var Y=T(e)&&e;for(var ha;p<m;p++){var N=p===(R||m)-1;if(!Y||!p)if((t=Y||e&&e[p])&&"and"!==t)if("or"===t)ha=!1;else continue;else ha=f=!0;y=a[p];if(J=y.length){if(D)if(U){var O=U.length;for(t=0;t<O;t++){D=U[t];var aa="@"+D;g&&v[aa]||(w[aa]=1,f||(h[B++]=D))}var U=null;D=!1}else{U=y;continue}aa=!1;for(t=0;t<J;t++){O=y[t];var V="@"+O,ea=f?w[V]||0:p;if(!(!ea&&!d||g&&v[V]||!f&&w[V]))if(ea===p){if(N){if(!C||--C<B)if(h[B++]=O,c&&B===c)return fa(b,B+ | ||
(k||0),h)}else w[V]=p+1;aa=!0}else d&&(V=z[ea]||(z[ea]=[]),V[V.length]=O)}if(ha&&!aa&&!d)break}else if(ha&&!d)return fa(b,S,y)}if(U)if(p=U.length,g)for(t=k?parseInt(k,10):0;t<p;t++)a=U[t],v["@"+a]||(h[B++]=a);else h=U;if(d)for(B=h.length,A?(p=parseInt(A[0],10)+1,t=parseInt(A[1],10)+1):(p=z.length,t=0);p--;)if(O=z[p]){for(J=O.length;t<J;t++)if(d=O[t],!g||!v["@"+d])if(h[B++]=d,c&&B===c)return fa(b,p+":"+t,h);t=0}}else!m||e&&"not"===e[0]||(h=a[0],k&&(k=parseInt(k[0],10)));if(c){g=h.length;k&&k>g&&(k= | ||
0);k=k||0;var S=k+c;S<g?h=h.slice(k,S):(S=0,k&&(h=h.slice(k)))}return fa(b,S,h)}function T(a){return"string"===typeof a}function M(a){return a.constructor===Array}function da(a){return"function"===typeof a}function P(a){return"object"===typeof a}function H(a){return"undefined"===typeof a}function va(a){for(var c=Array(a),b=0;b<a;b++)c[b]=G();return c}function G(){return Object.create(null)}function Ea(){var a,c;self.onmessage=function(b){if(b=b.data)if(b.search){var d=c.search(b.content,b.threshold? | ||
d&&(this.D=this.i),this.D===this.i&&(this.cache&&this.u.set(c,this.A),this.H&&this.H(this.A)));return this}function K(a){var c=G(),b;for(b in a)if(a.hasOwnProperty(b)){var d=a[b];M(d)?c[b]=d.slice(0):P(d)?c[b]=K(d):c[b]=d}return c}function ba(a,c){for(var b=a.length,d=da(c),e=[],f=0,h=0;f<b;f++){var g=a[f];if(d&&c(g)||!d&&!c[g])e[h++]=g}return e}function m(a,c,b,d,e,f,h,g,k,n){b=ua(b,h?0:e,g,f,c,k,n);if(g){g=b.page;var w=b.next;b=b.result}if(h)c=this.where(h,null,e,b);else{c=b;b=this.v;e=c.length; | ||
f=Array(e);for(h=0;h<e;h++)f[h]=b[c[h]];c=f}b=c;d&&(da(d)||(X=d.split(":"),1<X.length?d=ka:(X=X[0],d=ja)),b.sort(d));b=fa(g,w,b);this.cache&&this.u.set(a,b);return b}function x(a,c,b){Object.defineProperty(a,c,{get:b})}function l(a){return new RegExp(a,"g")}function F(a,c){for(var b=0;b<c.length;b+=2)a=a.replace(c[b],c[b+1]);return a}function I(a,c,b,d,e,f,h,g){if(c[b])return c[b];e=e?(g-(h||g/1.5))*f+(h||g/1.5)*e:f;c[b]=e;e>=h&&(a=a[g-(e+.5>>0)],a=a[b]||(a[b]=[]),a[a.length]=d);return e}function ca(a, | ||
c){if(a)for(var b=Object.keys(a),d=0,e=b.length;d<e;d++){var f=b[d],h=a[f];if(h)for(var g=0,k=h.length;g<k;g++)if(h[g]===c){1===k?delete a[f]:h.splice(g,1);break}else P(h[g])&&ca(h[g],c)}}function L(a){for(var c="",b="",d="",e=0;e<a.length;e++){var f=a[e];if(f!==b)if(e&&"h"===f){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===b||"e"===b||"i"===b||"o"===b||"u"===b||"y"===b)&&d||" "===b)c+=f}else c+=f;d=e===a.length-1?"":a[e+1];b=f}return c}function W(a,c){a=a.length-c.length;return 0> | ||
a?1:a?-1:0}function ja(a,c){a=a[X];c=c[X];return a<c?-1:a>c?1:0}function ka(a,c){for(var b=X.length,d=0;d<b;d++)a=a[X[d]],c=c[X[d]];return a<c?-1:a>c?1:0}function fa(a,c,b){return a?{page:a,next:c?""+c:null,result:b}:b}function ua(a,c,b,d,e,f,h){var g=[];if(!0===b){b="0";var k=""}else k=b&&b.split(":");var n=a.length;if(1<n){var w=G(),z=[],v,p=0,t,D=!0,B=0,C;if(k)if(2===k.length){var A=k;k=!1}else k=C=parseInt(k[0],10);if(h){for(v=G();p<n;p++)if("not"===e[p]){var y=a[p];var J=y.length;for(t=0;t<J;t++)v["@"+ | ||
y[t]]=1}else var R=p+1;if(H(R))return fa(b,S,g);p=0}else var Y=T(e)&&e;for(var ha;p<n;p++){var N=p===(R||n)-1;if(!Y||!p)if((t=Y||e&&e[p])&&"and"!==t)if("or"===t)ha=!1;else continue;else ha=f=!0;y=a[p];if(J=y.length){if(D)if(U){var O=U.length;for(t=0;t<O;t++){D=U[t];var aa="@"+D;h&&v[aa]||(w[aa]=1,f||(g[B++]=D))}var U=null;D=!1}else{U=y;continue}aa=!1;for(t=0;t<J;t++){O=y[t];var V="@"+O,ea=f?w[V]||0:p;if(!(!ea&&!d||h&&v[V]||!f&&w[V]))if(ea===p){if(N){if(!C||--C<B)if(g[B++]=O,c&&B===c)return fa(b,B+ | ||
(k||0),g)}else w[V]=p+1;aa=!0}else d&&(V=z[ea]||(z[ea]=[]),V[V.length]=O)}if(ha&&!aa&&!d)break}else if(ha&&!d)return fa(b,S,y)}if(U)if(p=U.length,h)for(t=k?parseInt(k,10):0;t<p;t++)a=U[t],v["@"+a]||(g[B++]=a);else g=U;if(d)for(B=g.length,A?(p=parseInt(A[0],10)+1,t=parseInt(A[1],10)+1):(p=z.length,t=0);p--;)if(O=z[p]){for(J=O.length;t<J;t++)if(d=O[t],!h||!v["@"+d])if(g[B++]=d,c&&B===c)return fa(b,p+":"+t,g);t=0}}else!n||e&&"not"===e[0]||(g=a[0],k&&(k=parseInt(k[0],10)));if(c){h=g.length;k&&k>h&&(k= | ||
0);k=k||0;var S=k+c;S<h?g=g.slice(k,S):(S=0,k&&(g=g.slice(k)))}return fa(b,S,g)}function T(a){return"string"===typeof a}function M(a){return a.constructor===Array}function da(a){return"function"===typeof a}function P(a){return"object"===typeof a}function H(a){return"undefined"===typeof a}function va(a){for(var c=Array(a),b=0;b<a;b++)c[b]=G();return c}function G(){return Object.create(null)}function Ea(){var a,c;self.onmessage=function(b){if(b=b.data)if(b.search){var d=c.search(b.content,b.threshold? | ||
{limit:b.limit,threshold:b.threshold,where:b.where}:b.limit);self.postMessage({id:a,content:b.content,limit:b.limit,result:d})}else b.add?c.add(b.id,b.content):b.update?c.update(b.id,b.content):b.remove?c.remove(b.id):b.clear?c.clear():b.info?(b=c.info(),b.worker=a,console.log(b)):b.register&&(a=b.id,b.options.cache=!1,b.options.async=!1,b.options.worker=!1,c=(new Function(b.register.substring(b.register.indexOf("{")+1,b.register.lastIndexOf("}"))))(),c=new c(b.options))}}function Fa(a,c,b,d){a=q("flexsearch", | ||
@@ -31,23 +31,23 @@ "id"+a,Ea,function(f){(f=f.data)&&f.result&&d(f.id,f.content,f.result,f.limit,f.where,f.cursor,f.suggest)},c);var e=Ca.toString();b.id=c;a.postMessage({register:e,options:b,id:c});return a}var Q={encode:"icase",g:"forward",split:/\W+/,cache:!1,async:!1,i:!1,G:!1,a:!1,c:9,threshold:0,depth:0},wa={memory:{encode:"extra",g:"strict",threshold:0,c:1},speed:{encode:"icase",g:"strict",threshold:1,c:3,depth:2},match:{encode:"extra",g:"full",threshold:1,c:3},score:{encode:"extra",g:"strict",threshold:1,c:9, | ||
this.async="undefined"===typeof Promise||H(b=a.async)?this.async||Q.async:b;this.i=H(b=a.worker)?this.i||Q.i:b;this.threshold=H(b=a.threshold)?c.threshold||this.threshold||Q.threshold:b;this.c=H(b=a.resolution)?b=c.c||this.c||Q.c:b;b<=this.threshold&&(this.c=this.threshold+1);this.depth="strict"!==this.g||H(b=a.depth)?c.depth||this.depth||Q.depth:b;this.j=(b=H(b=a.encode)?c.encode||Q.encode:b)&&ia[b]&&ia[b].bind(ia)||(da(b)?b:this.j||!1);(b=a.matcher)&&this.addMatcher(b);if(b=(c=a.lang)||a.filter){T(b)&& | ||
(b=xa[b]);if(M(b)){d=this.j;e=G();for(var f=0;f<b.length;f++){var g=d?d(b[f]):b[f];e[g]=1}b=e}this.filter=b}if(b=c||a.stemmer){c=T(b)?ya[b]:b;d=this.j;e=[];for(var h in c)c.hasOwnProperty(h)&&(f=d?d(h):h,e.push(l(f+"($|\\W)"),d?d(c[h]):c[h]));this.stemmer=e}this.a=e=(b=a.doc)?K(b):this.a||Q.a;this.s=va(this.c-(this.threshold||0));this.o=G();this.f=G();if(e){this.v=G();a.doc=null;h=e.index={};c=e.keys=[];d=e.field;f=e.tag;g=e.store;M(e.id)||(e.id=e.id.split(":"));if(g){var k=G();if(T(g))k[g]=1;else if(M(g))for(var m= | ||
0;m<g.length;m++)k[g[m]]=1;else P(g)&&(k=g);e.store=k}if(f){this.B=G();g=G();if(d)if(T(d))g[d]=a;else if(M(d))for(k=0;k<d.length;k++)g[d[k]]=a;else P(d)&&(g=d);M(f)||(e.tag=f=[f]);for(d=0;d<f.length;d++)this.B[f[d]]=G();this.I=f;d=g}if(d){if(!M(d))if(P(d)){var w=d;e.field=d=Object.keys(d)}else e.field=d=[d];for(e=0;e<d.length;e++)f=d[e],M(f)||(w&&(a=w[f]),c[e]=f,d[e]=f.split(":")),h[f]=new r(a)}a.doc=b}this.m=!0;this.u=(this.cache=b=H(b=a.cache)?this.cache||Q.cache:b)?new Ga(b):!1;return this};r.prototype.encode= | ||
(b=xa[b]);if(M(b)){d=this.j;e=G();for(var f=0;f<b.length;f++){var h=d?d(b[f]):b[f];e[h]=1}b=e}this.filter=b}if(b=c||a.stemmer){c=T(b)?ya[b]:b;d=this.j;e=[];for(var g in c)c.hasOwnProperty(g)&&(f=d?d(g):g,e.push(l(f+"($|\\W)"),d?d(c[g]):c[g]));this.stemmer=e}this.a=e=(b=a.doc)?K(b):this.a||Q.a;this.s=va(this.c-(this.threshold||0));this.o=G();this.f=G();if(e){this.v=G();a.doc=null;g=e.index={};c=e.keys=[];d=e.field;f=e.tag;h=e.store;M(e.id)||(e.id=e.id.split(":"));if(h){var k=G();if(T(h))k[h]=1;else if(M(h))for(var n= | ||
0;n<h.length;n++)k[h[n]]=1;else P(h)&&(k=h);e.store=k}if(f){this.B=G();h=G();if(d)if(T(d))h[d]=a;else if(M(d))for(k=0;k<d.length;k++)h[d[k]]=a;else P(d)&&(h=d);M(f)||(e.tag=f=[f]);for(d=0;d<f.length;d++)this.B[f[d]]=G();this.I=f;d=h}if(d){if(!M(d))if(P(d)){var w=d;e.field=d=Object.keys(d)}else e.field=d=[d];for(e=0;e<d.length;e++)f=d[e],M(f)||(w&&(a=w[f]),c[e]=f,d[e]=f.split(":")),g[f]=new r(a)}a.doc=b}this.m=!0;this.u=(this.cache=b=H(b=a.cache)?this.cache||Q.cache:b)?new Ga(b):!1;return this};r.prototype.encode= | ||
function(a){a&&(la.length&&(a=F(a,la)),this.h.length&&(a=F(a,this.h)),this.j&&(a=this.j(a)),this.stemmer&&(a=F(a,this.stemmer)));return a};r.prototype.addMatcher=function(a){var c=this.h,b;for(b in a)a.hasOwnProperty(b)&&c.push(l(b),a[b]);return this};r.prototype.add=function(a,c,b,d,e){if(this.a&&P(a))return this.l("add",a,c);if(c&&T(c)&&(a||0===a)){var f="@"+a;if(this.f[f]&&!d)return this.update(a,c);if(this.i)return++this.w>=this.b.length&&(this.w=0),this.b[this.w].postMessage({add:!0,id:a,content:c}), | ||
this.f[f]=""+this.w,b&&b(),this;if(!e){if(this.async&&"function"!==typeof importScripts){var g=this;f=new Promise(function(Y){setTimeout(function(){g.add(a,c,null,d,!0);g=null;Y()})});if(b)f.then(b);else return f;return this}if(b)return this.add(a,c,null,d,!0),b(),this}c=this.encode(c);if(!c.length)return this;b=this.g;e=da(b)?b(c):c.split(this.split);this.filter&&(e=ba(e,this.filter));var h=G();h._ctx=G();for(var k=e.length,m=this.threshold,w=this.depth,z=this.c,v=this.s,p=this.G,t=0;t<k;t++){var D= | ||
e[t];if(D){var B=D.length,C=(p?t+1:k-t)/k,A="";switch(b){case "reverse":case "both":for(var y=B;--y;)A=D[y]+A,I(v,h,A,a,p?1:(B-y)/B,C,m,z-1);A="";case "forward":for(y=0;y<B;y++)A+=D[y],I(v,h,A,a,p?(y+1)/B:1,C,m,z-1);break;case "full":for(y=0;y<B;y++)for(var J=(p?y+1:B-y)/B,R=B;R>y;R--)A=D.substring(y,R),I(v,h,A,a,J,C,m,z-1);break;default:if(B=I(v,h,D,a,1,C,m,z-1),w&&1<k&&B>=m)for(B=h._ctx[D]||(h._ctx[D]=G()),D=this.o[D]||(this.o[D]=va(z-(m||0))),C=t-w,A=t+w+1,0>C&&(C=0),A>k&&(A=k);C<A;C++)C!==t&& | ||
I(D,B,e[C],a,0,z-(C<t?t-C:C-t),m,z-1)}}}this.f[f]=1;this.m=!1}return this};r.prototype.l=function(a,c,b){if(M(c)){var d=c.length;if(d--){for(var e=0;e<d;e++)this.l(a,c[e]);return this.l(a,c[d],b)}}else{var f=this.a.index,g=this.a.keys,h=this.a.tag;e=this.a.store;var k;var m=this.a.id;d=c;for(var w=0;w<m.length;w++)d=d[m[w]];if("remove"===a&&(delete this.v[d],m=g.length,m--)){for(c=0;c<m;c++)f[g[c]].remove(d);return f[g[m]].remove(d,b)}if(h){for(k=0;k<h.length;k++){var z=h[k];var v=c;m=z.split(":"); | ||
for(w=0;w<m.length;w++)v=v[m[w]];v="@"+v}k=this.B[z];k=k[v]||(k[v]=[])}m=this.a.field;h=0;for(z=m.length;h<z;h++){w=m[h];v=c;for(var p=0;p<w.length;p++)v=v[w[p]];w=f[g[h]];p="add"===a?w.add:w.update;h===z-1?p.call(w,d,v,b):p.call(w,d,v)}if(e){b=Object.keys(e);a=G();for(f=0;f<b.length;f++)if(g=b[f],e[g])for(g=g.split(":"),h=m=void 0,z=0;z<g.length;z++)v=g[z],h=(h||c)[v],m=(m||a)[v]=h;c=a}k&&(k[k.length]=c);this.v[d]=c}return this};r.prototype.update=function(a,c,b){if(this.a&&P(a))return this.l("update", | ||
this.f[f]=""+this.w,b&&b(),this;if(!e){if(this.async&&"function"!==typeof importScripts){var h=this;f=new Promise(function(Y){setTimeout(function(){h.add(a,c,null,d,!0);h=null;Y()})});if(b)f.then(b);else return f;return this}if(b)return this.add(a,c,null,d,!0),b(),this}c=this.encode(c);if(!c.length)return this;b=this.g;e=da(b)?b(c):c.split(this.split);this.filter&&(e=ba(e,this.filter));var g=G();g._ctx=G();for(var k=e.length,n=this.threshold,w=this.depth,z=this.c,v=this.s,p=this.G,t=0;t<k;t++){var D= | ||
e[t];if(D){var B=D.length,C=(p?t+1:k-t)/k,A="";switch(b){case "reverse":case "both":for(var y=B;--y;)A=D[y]+A,I(v,g,A,a,p?1:(B-y)/B,C,n,z-1);A="";case "forward":for(y=0;y<B;y++)A+=D[y],I(v,g,A,a,p?(y+1)/B:1,C,n,z-1);break;case "full":for(y=0;y<B;y++)for(var J=(p?y+1:B-y)/B,R=B;R>y;R--)A=D.substring(y,R),I(v,g,A,a,J,C,n,z-1);break;default:if(B=I(v,g,D,a,1,C,n,z-1),w&&1<k&&B>=n)for(B=g._ctx[D]||(g._ctx[D]=G()),D=this.o[D]||(this.o[D]=va(z-(n||0))),C=t-w,A=t+w+1,0>C&&(C=0),A>k&&(A=k);C<A;C++)C!==t&& | ||
I(D,B,e[C],a,0,z-(C<t?t-C:C-t),n,z-1)}}}this.f[f]=1;this.m=!1}return this};r.prototype.l=function(a,c,b){if(M(c)){var d=c.length;if(d--){for(var e=0;e<d;e++)this.l(a,c[e]);return this.l(a,c[d],b)}}else{var f=this.a.index,h=this.a.keys,g=this.a.tag;e=this.a.store;var k;var n=this.a.id;d=c;for(var w=0;w<n.length;w++)d=d[n[w]];if("remove"===a&&(delete this.v[d],n=h.length,n--)){for(c=0;c<n;c++)f[h[c]].remove(d);return f[h[n]].remove(d,b)}if(g){for(k=0;k<g.length;k++){var z=g[k];var v=c;n=z.split(":"); | ||
for(w=0;w<n.length;w++)v=v[n[w]];v="@"+v}k=this.B[z];k=k[v]||(k[v]=[])}n=this.a.field;g=0;for(z=n.length;g<z;g++){w=n[g];v=c;for(var p=0;p<w.length;p++)v=v[w[p]];w=f[h[g]];p="add"===a?w.add:w.update;g===z-1?p.call(w,d,v,b):p.call(w,d,v)}if(e){b=Object.keys(e);a=G();for(f=0;f<b.length;f++)if(h=b[f],e[h])for(h=h.split(":"),g=n=void 0,z=0;z<h.length;z++)v=h[z],n=(n||c)[v],g=(g||a)[v]=n;c=a}k&&(k[k.length]=c);this.v[d]=c}return this};r.prototype.update=function(a,c,b){if(this.a&&P(a))return this.l("update", | ||
a,c);this.f["@"+a]&&T(c)&&(this.remove(a),this.add(a,c,b,!0));return this};r.prototype.remove=function(a,c,b){if(this.a&&P(a))return this.l("remove",a,c);var d="@"+a;if(this.f[d]){if(this.i)return this.b[this.f[d]].postMessage({remove:!0,id:a}),delete this.f[d],c&&c(),this;if(!b){if(this.async&&"function"!==typeof importScripts){var e=this;d=new Promise(function(f){setTimeout(function(){e.remove(a,null,!0);e=null;f()})});if(c)d.then(c);else return d;return this}if(c)return this.remove(a,null,!0), | ||
c(),this}for(c=0;c<this.c-(this.threshold||0);c++)ca(this.s[c],a);this.depth&&ca(this.o,a);delete this.f[d];this.m=!1}return this};var X;r.prototype.search=function(a,c,b,d){if(P(c)){if(M(c))for(var e=0;e<c.length;e++)c[e].query=a;else c.query=a;a=c;c=1E3}else c&&da(c)?(b=c,c=1E3):c||0===c||(c=1E3);var f=[],g=a;if(P(a)&&!M(a)){b||(b=a.callback)&&(g.callback=null);var h=a.sort;var k=a.page;c=a.limit;var m=a.threshold;var w=a.suggest;a=a.query}if(this.a){m=this.a.index;var z=g.where,v=g.bool||"or", | ||
p=g.field,t=v,D,B;if(p)M(p)||(p=[p]);else if(M(g)){var C=g;p=[];t=[];for(var A=0;A<g.length;A++)d=g[A],e=d.bool||v,p[A]=d.field,t[A]=e,"not"===e?D=!0:"and"===e&&(B=!0)}else p=this.a.keys;v=p.length;for(A=0;A<v;A++)C&&(g=C[A]),k&&!T(g)&&(g.page=null,g.limit=0),f[A]=m[p[A]].search(g,0);if(b)return b(n.call(this,a,t,f,h,c,w,z,k,B,D));if(this.async){var y=this;return new Promise(function(oa){Promise.all(f).then(function(Ha){oa(n.call(y,a,t,Ha,h,c,w,z,k,B,D))})})}return n.call(this,a,t,f,h,c,w,z,k,B,D)}m|| | ||
(m=this.threshold||0);if(this.i)for(this.H=b,this.D=0,this.A=[],m=0;m<this.i;m++)this.b[m].postMessage({search:!0,limit:c,content:g});else{if(!d){if(this.async&&"function"!==typeof importScripts){var J=this;m=new Promise(function(oa){setTimeout(function(){oa(J.search(g,c,null,!0));J=null})});if(b)m.then(b);else return m;return this}if(b)return b(this.search(g,c,null,!0)),this}if(!a||!T(a))return f;g=a;if(this.cache)if(this.m){if(b=this.u.get(a))return b}else this.u.clear(),this.m=!0;g=this.encode(g); | ||
if(!g.length)return f;b=this.g;b=da(b)?b(g):g.split(this.split);this.filter&&(b=ba(b,this.filter));C=b.length;d=!0;e=[];var R=G(),Y=0;1<C&&(this.depth&&"strict"===this.g?v=!0:b.sort(W));if(!v||(A=this.o))for(var ha=this.c;Y<C;Y++){var N=b[Y];if(N){if(v){if(!p)if(A[N])p=N,R[N]=1;else if(!w)return f;if(w&&Y===C-1&&!e.length)v=!1,N=p||N,R[N]=0;else if(!p)continue}if(!R[N]){var O=[],aa=!1,U=0,V=v?A[p]:this.s;if(V)for(var ea=void 0,S=0;S<ha-m;S++)if(ea=V[S]&&V[S][N])O[U++]=ea,aa=!0;if(aa)p=N,e[e.length]= | ||
1<U?O.concat.apply([],O):O[0];else if(!w){d=!1;break}R[N]=1}}}else d=!1;d&&(f=ua(e,c,k,w));this.cache&&this.u.set(a,f);return f}};r.prototype.find=function(a,c){return this.where(a,c,1)[0]||null};r.prototype.where=function(a,c,b,d){var e=this.v,f=[],g=0,h;if(P(a)){b||(b=c);var k=Object.keys(a);var m=k.length;var w=!1;if(1===m&&"id"===k[0])return[e[a.id]];if((h=this.I)&&!d)for(var z=0;z<h.length;z++){var v=h[z],p=a[v];if(!H(p)){var t=this.B[v]["@"+p];if(0===--m)return t;k.splice(k.indexOf(v),1);delete a[v]; | ||
break}}h=Array(m);for(z=0;z<m;z++)h[z]=k[z].split(":")}else{if(da(a)){c=d||Object.keys(e);b=c.length;for(k=0;k<b;k++)m=e[c[k]],a(m)&&(f[g++]=m);return f}if(H(c))return[e[a]];if("id"===a)return[e[c]];k=[a];m=1;h=[a.split(":")];w=!0}d=t||d||Object.keys(e);z=d.length;for(v=0;v<z;v++){p=t?d[v]:e[d[v]];for(var D=!0,B=0;B<m;B++){w||(c=a[k[B]]);var C=h[B],A=C.length,y=p;if(1<A)for(var J=0;J<A;J++)y=y[C[J]];else y=y[C[0]];if(y!==c){D=!1;break}}if(D&&(f[g++]=p,b&&g===b))break}return f};r.prototype.info=function(){if(this.i)for(var a= | ||
0;a<this.i;a++)this.b[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.C?this.cache.C.length:!1,matcher:la.length+(this.h?this.h.length:0),worker:this.i,threshold:this.threshold,depth:this.depth,resolution:this.c,contextual:this.depth&&"strict"===this.g}};r.prototype.clear=function(){return this.destroy().init()};r.prototype.destroy=function(){this.cache&&(this.u.clear(),this.u=null);this.s=this.o=this.f=null;if(this.a){for(var a=this.a.keys, | ||
c=0;c<a.length;c++)this.a.index[a[c]].destroy();this.a=this.v=null}return this};r.prototype.export=function(a){var c=!a||H(a.serialize)||a.serialize;if(this.a){var b=!a||H(a.doc)||a.doc,d=!a||H(a.index)||a.index;a=[];var e=0;if(d)for(d=this.a.keys;e<d.length;e++){var f=this.a.index[d[e]];a[e]=[f.s,f.o,Object.keys(f.f)]}b&&(a[e]=this.v)}else a=[this.s,this.o,Object.keys(this.f)];c&&(a=JSON.stringify(a));return a};r.prototype.import=function(a,c){if(!c||H(c.serialize)||c.serialize)a=JSON.parse(a);var b= | ||
G();if(this.a){var d=!c||H(c.doc)||c.doc,e=0;if(!c||H(c.index)||c.index){c=this.a.keys;for(var f=c.length,g=a[0][2];e<g.length;e++)b[g[e]]=1;for(e=0;e<f;e++){g=this.a.index[c[e]];var h=a[e];h&&(g.s=h[0],g.o=h[1],g.f=b)}}d&&(this.v=P(d)?d:a[e])}else{d=a[2];for(e=0;e<d.length;e++)b[d[e]]=1;this.s=a[0];this.o=a[1];this.f=b}};var Ia=function(){var a=l("\\s+"),c=l("[^a-z0-9 ]"),b=[l("[-/]")," ",c,"",a," "];return function(d){return L(F(d.toLowerCase(),b))}}(),ia={icase:function(a){return a.toLowerCase()}, | ||
simple:function(){var a=l("\\s+"),c=l("[^a-z0-9 ]"),b=l("[-/]"),d=l("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),e=l("[\u00e8\u00e9\u00ea\u00eb]"),f=l("[\u00ec\u00ed\u00ee\u00ef]"),g=l("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),h=l("[\u00f9\u00fa\u00fb\u00fc\u0171]"),k=l("[\u00fd\u0177\u00ff]"),m=l("\u00f1"),w=l("[\u00e7c]"),z=l("\u00df"),v=l(" & "),p=[d,"a",e,"e",f,"i",g,"o",h,"u",k,"y",m,"n",w,"k",z,"s",v," and ",b," ",c,"",a," "];return function(t){t=F(t.toLowerCase(),p);return" "===t?"":t}}(),advanced:function(){var a= | ||
l("ae"),c=l("ai"),b=l("ay"),d=l("ey"),e=l("oe"),f=l("ue"),g=l("ie"),h=l("sz"),k=l("zs"),m=l("ck"),w=l("cc"),z=l("sh"),v=l("th"),p=l("dt"),t=l("ph"),D=l("pf"),B=l("ou"),C=l("uo"),A=[a,"a",c,"ei",b,"ei",d,"ei",e,"o",f,"u",g,"i",h,"s",k,"s",z,"s",m,"k",w,"k",v,"t",p,"t",t,"f",D,"f",B,"o",C,"u"];return function(y,J){if(!y)return y;y=this.simple(y);2<y.length&&(y=F(y,A));J||1<y.length&&(y=L(y));return y}}(),extra:function(){var a=l("p"),c=l("z"),b=l("[cgq]"),d=l("n"),e=l("d"),f=l("[vw]"),g=l("[aeiouy]"), | ||
h=[a,"b",c,"s",b,"k",d,"m",e,"t",f,"f",g,""];return function(k){if(!k)return k;k=this.advanced(k,!0);if(1<k.length){k=k.split(" ");for(var m=0;m<k.length;m++){var w=k[m];1<w.length&&(k[m]=w[0]+F(w.substring(1),h))}k=k.join(" ");k=L(k)}return k}}(),balance:Ia},Ga=function(){function a(c){this.clear();this.J=!0!==c&&c}a.prototype.clear=function(){this.cache=G();this.count=G();this.index=G();this.C=[]};a.prototype.set=function(c,b){if(this.J&&H(this.cache[c])){var d=this.C.length;if(d===this.J){d--; | ||
var e=this.C[d];delete this.cache[e];delete this.count[e];delete this.index[e]}this.index[c]=d;this.C[d]=c;this.count[c]=-1;this.cache[c]=b;this.get(c)}else this.cache[c]=b};a.prototype.get=function(c){var b=this.cache[c];if(this.J&&b){var d=++this.count[c],e=this.index,f=e[c];if(0<f){for(var g=this.C,h=f;this.count[g[--f]]<=d&&-1!==f;);f++;if(f!==h){for(d=h;d>f;d--)h=g[d-1],g[d]=h,e[h]=d;g[f]=c;e[c]=f}}}return b};return a}();return r}(function(){var q={},u="undefined"!==typeof Blob&&"undefined"!== | ||
typeof URL&&URL.createObjectURL;return function(r,E,K,ba,n){K=u?URL.createObjectURL(new Blob(["("+K.toString()+")()"],{type:"text/javascript"})):r+".es5.js";r+="-"+E;q[r]||(q[r]=[]);q[r][n]=new Worker(K);q[r][n].onmessage=ba;console.log("Register Worker: "+r+"@"+n);return q[r][n]}}()),this); | ||
c(),this}for(c=0;c<this.c-(this.threshold||0);c++)ca(this.s[c],a);this.depth&&ca(this.o,a);delete this.f[d];this.m=!1}return this};var X;r.prototype.search=function(a,c,b,d){if(P(c)){if(M(c))for(var e=0;e<c.length;e++)c[e].query=a;else c.query=a;a=c;c=1E3}else c&&da(c)?(b=c,c=1E3):c||0===c||(c=1E3);if(this.i){this.H=b;this.D=0;this.A=[];for(var f=0;f<this.i;f++)this.b[f].postMessage({search:!0,limit:c,content:a})}else{var h=[],g=a;if(P(a)&&!M(a)){b||(b=a.callback)&&(g.callback=null);var k=a.sort; | ||
var n=a.page;c=a.limit;f=a.threshold;var w=a.suggest;a=a.query}if(this.a){f=this.a.index;var z=g.where,v=g.bool||"or",p=g.field,t=v,D,B;if(p)M(p)||(p=[p]);else if(M(g)){var C=g;p=[];t=[];for(var A=0;A<g.length;A++)d=g[A],e=d.bool||v,p[A]=d.field,t[A]=e,"not"===e?D=!0:"and"===e&&(B=!0)}else p=this.a.keys;v=p.length;for(A=0;A<v;A++)C&&(g=C[A]),n&&!T(g)&&(g.page=null,g.limit=0),h[A]=f[p[A]].search(g,0);if(b)return b(m.call(this,a,t,h,k,c,w,z,n,B,D));if(this.async){var y=this;return new Promise(function(oa){Promise.all(h).then(function(Ha){oa(m.call(y, | ||
a,t,Ha,k,c,w,z,n,B,D))})})}return m.call(this,a,t,h,k,c,w,z,n,B,D)}f||(f=this.threshold||0);if(!d){if(this.async&&"function"!==typeof importScripts){var J=this;f=new Promise(function(oa){setTimeout(function(){oa(J.search(g,c,null,!0));J=null})});if(b)f.then(b);else return f;return this}if(b)return b(this.search(g,c,null,!0)),this}if(!a||!T(a))return h;g=a;if(this.cache)if(this.m){if(b=this.u.get(a))return b}else this.u.clear(),this.m=!0;g=this.encode(g);if(!g.length)return h;b=this.g;b=da(b)?b(g): | ||
g.split(this.split);this.filter&&(b=ba(b,this.filter));C=b.length;d=!0;e=[];var R=G(),Y=0;1<C&&(this.depth&&"strict"===this.g?v=!0:b.sort(W));if(!v||(A=this.o))for(var ha=this.c;Y<C;Y++){var N=b[Y];if(N){if(v){if(!p)if(A[N])p=N,R[N]=1;else if(!w)return h;if(w&&Y===C-1&&!e.length)v=!1,N=p||N,R[N]=0;else if(!p)continue}if(!R[N]){var O=[],aa=!1,U=0,V=v?A[p]:this.s;if(V)for(var ea=void 0,S=0;S<ha-f;S++)if(ea=V[S]&&V[S][N])O[U++]=ea,aa=!0;if(aa)p=N,e[e.length]=1<U?O.concat.apply([],O):O[0];else if(!w){d= | ||
!1;break}R[N]=1}}}else d=!1;d&&(h=ua(e,c,n,w));this.cache&&this.u.set(a,h);return h}};r.prototype.find=function(a,c){return this.where(a,c,1)[0]||null};r.prototype.where=function(a,c,b,d){var e=this.v,f=[],h=0,g;if(P(a)){b||(b=c);var k=Object.keys(a);var n=k.length;var w=!1;if(1===n&&"id"===k[0])return[e[a.id]];if((g=this.I)&&!d)for(var z=0;z<g.length;z++){var v=g[z],p=a[v];if(!H(p)){var t=this.B[v]["@"+p];if(0===--n)return t;k.splice(k.indexOf(v),1);delete a[v];break}}g=Array(n);for(z=0;z<n;z++)g[z]= | ||
k[z].split(":")}else{if(da(a)){c=d||Object.keys(e);b=c.length;for(k=0;k<b;k++)n=e[c[k]],a(n)&&(f[h++]=n);return f}if(H(c))return[e[a]];if("id"===a)return[e[c]];k=[a];n=1;g=[a.split(":")];w=!0}d=t||d||Object.keys(e);z=d.length;for(v=0;v<z;v++){p=t?d[v]:e[d[v]];for(var D=!0,B=0;B<n;B++){w||(c=a[k[B]]);var C=g[B],A=C.length,y=p;if(1<A)for(var J=0;J<A;J++)y=y[C[J]];else y=y[C[0]];if(y!==c){D=!1;break}}if(D&&(f[h++]=p,b&&h===b))break}return f};r.prototype.info=function(){if(this.i)for(var a=0;a<this.i;a++)this.b[a].postMessage({info:!0, | ||
id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.C?this.cache.C.length:!1,matcher:la.length+(this.h?this.h.length:0),worker:this.i,threshold:this.threshold,depth:this.depth,resolution:this.c,contextual:this.depth&&"strict"===this.g}};r.prototype.clear=function(){return this.destroy().init()};r.prototype.destroy=function(){this.cache&&(this.u.clear(),this.u=null);this.s=this.o=this.f=null;if(this.a){for(var a=this.a.keys,c=0;c<a.length;c++)this.a.index[a[c]].destroy(); | ||
this.a=this.v=null}return this};r.prototype.export=function(a){var c=!a||H(a.serialize)||a.serialize;if(this.a){var b=!a||H(a.doc)||a.doc,d=!a||H(a.index)||a.index;a=[];var e=0;if(d)for(d=this.a.keys;e<d.length;e++){var f=this.a.index[d[e]];a[e]=[f.s,f.o,Object.keys(f.f)]}b&&(a[e]=this.v)}else a=[this.s,this.o,Object.keys(this.f)];c&&(a=JSON.stringify(a));return a};r.prototype.import=function(a,c){if(!c||H(c.serialize)||c.serialize)a=JSON.parse(a);var b=G();if(this.a){var d=!c||H(c.doc)||c.doc,e= | ||
0;if(!c||H(c.index)||c.index){c=this.a.keys;for(var f=c.length,h=a[0][2];e<h.length;e++)b[h[e]]=1;for(e=0;e<f;e++){h=this.a.index[c[e]];var g=a[e];g&&(h.s=g[0],h.o=g[1],h.f=b)}}d&&(this.v=P(d)?d:a[e])}else{d=a[2];for(e=0;e<d.length;e++)b[d[e]]=1;this.s=a[0];this.o=a[1];this.f=b}};var Ia=function(){var a=l("\\s+"),c=l("[^a-z0-9 ]"),b=[l("[-/]")," ",c,"",a," "];return function(d){return L(F(d.toLowerCase(),b))}}(),ia={icase:function(a){return a.toLowerCase()},simple:function(){var a=l("\\s+"),c=l("[^a-z0-9 ]"), | ||
b=l("[-/]"),d=l("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),e=l("[\u00e8\u00e9\u00ea\u00eb]"),f=l("[\u00ec\u00ed\u00ee\u00ef]"),h=l("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),g=l("[\u00f9\u00fa\u00fb\u00fc\u0171]"),k=l("[\u00fd\u0177\u00ff]"),n=l("\u00f1"),w=l("[\u00e7c]"),z=l("\u00df"),v=l(" & "),p=[d,"a",e,"e",f,"i",h,"o",g,"u",k,"y",n,"n",w,"k",z,"s",v," and ",b," ",c,"",a," "];return function(t){t=F(t.toLowerCase(),p);return" "===t?"":t}}(),advanced:function(){var a=l("ae"),c=l("ai"),b=l("ay"),d= | ||
l("ey"),e=l("oe"),f=l("ue"),h=l("ie"),g=l("sz"),k=l("zs"),n=l("ck"),w=l("cc"),z=l("sh"),v=l("th"),p=l("dt"),t=l("ph"),D=l("pf"),B=l("ou"),C=l("uo"),A=[a,"a",c,"ei",b,"ei",d,"ei",e,"o",f,"u",h,"i",g,"s",k,"s",z,"s",n,"k",w,"k",v,"t",p,"t",t,"f",D,"f",B,"o",C,"u"];return function(y,J){if(!y)return y;y=this.simple(y);2<y.length&&(y=F(y,A));J||1<y.length&&(y=L(y));return y}}(),extra:function(){var a=l("p"),c=l("z"),b=l("[cgq]"),d=l("n"),e=l("d"),f=l("[vw]"),h=l("[aeiouy]"),g=[a,"b",c,"s",b,"k",d,"m", | ||
e,"t",f,"f",h,""];return function(k){if(!k)return k;k=this.advanced(k,!0);if(1<k.length){k=k.split(" ");for(var n=0;n<k.length;n++){var w=k[n];1<w.length&&(k[n]=w[0]+F(w.substring(1),g))}k=k.join(" ");k=L(k)}return k}}(),balance:Ia},Ga=function(){function a(c){this.clear();this.J=!0!==c&&c}a.prototype.clear=function(){this.cache=G();this.count=G();this.index=G();this.C=[]};a.prototype.set=function(c,b){if(this.J&&H(this.cache[c])){var d=this.C.length;if(d===this.J){d--;var e=this.C[d];delete this.cache[e]; | ||
delete this.count[e];delete this.index[e]}this.index[c]=d;this.C[d]=c;this.count[c]=-1;this.cache[c]=b;this.get(c)}else this.cache[c]=b};a.prototype.get=function(c){var b=this.cache[c];if(this.J&&b){var d=++this.count[c],e=this.index,f=e[c];if(0<f){for(var h=this.C,g=f;this.count[h[--f]]<=d&&-1!==f;);f++;if(f!==g){for(d=g;d>f;d--)g=h[d-1],h[d]=g,e[g]=d;h[f]=c;e[c]=f}}}return b};return a}();return r}(function(){var q={},u="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(r, | ||
E,K,ba,m){K=u?URL.createObjectURL(new Blob(["("+K.toString()+")()"],{type:"text/javascript"})):r+".es5.js";r+="-"+E;q[r]||(q[r]=[]);q[r][m]=new Worker(K);q[r][m].onmessage=ba;console.log("Register Worker: "+r+"@"+m);return q[r][m]}}()),this); |
@@ -0,0 +0,0 @@ /* |
@@ -9,35 +9,35 @@ /* | ||
'use strict';(function(K,R,w){let L;(L=w.define)&&L.amd?L([],function(){return R}):(L=w.modules)?L[K.toLowerCase()]=R:"object"===typeof exports?module.exports=R:w[K]=R})("FlexSearch",function ma(K){function w(a,c){const b=c?c.id:a&&a.id;this.id=b||0===b?b:na++;this.init(a,c);fa(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)});fa(this,"length",function(){return this.index.length})}function L(a,c,b,d){this.u!==this.g&&(this.o=this.o.concat(b),this.u++, | ||
d&&this.o.length>=d&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(c,this.o),this.F&&this.F(this.o)));return this}function S(a){const c=B();for(const b in a)if(a.hasOwnProperty(b)){const d=a[b];F(d)?c[b]=d.slice(0):G(d)?c[b]=S(d):c[b]=d}return c}function W(a,c){const b=a.length,d=O(c),e=[];for(let g=0,f=0;g<b;g++){const h=a[g];if(d&&c(h)||!d&&!c[h])e[f++]=h}return e}function P(a,c,b,d,e,g,f,h,k,l){b=ha(b,f?0:e,h,g,c,k,l);let n;h&&(h=b.page,n=b.next,b=b.result);if(f)c=this.where(f,null, | ||
e,b);else{c=b;b=this.l;e=c.length;g=Array(e);for(f=0;f<e;f++)g[f]=b[c[f]];c=g}b=c;d&&(O(d)||(M=d.split(":"),1<M.length?d=oa:(M=M[0],d=pa)),b.sort(d));b=T(h,n,b);this.cache&&this.j.set(a,b);return b}function fa(a,c,b){Object.defineProperty(a,c,{get:b})}function r(a){return new RegExp(a,"g")}function Q(a,c){for(let b=0;b<c.length;b+=2)a=a.replace(c[b],c[b+1]);return a}function V(a,c,b,d,e,g,f,h){if(c[b])return c[b];e=e?(h-(f||h/1.5))*g+(f||h/1.5)*e:g;c[b]=e;e>=f&&(a=a[h-(e+.5>>0)],a=a[b]||(a[b]=[]), | ||
a[a.length]=d);return e}function ba(a,c){if(a){const b=Object.keys(a);for(let d=0,e=b.length;d<e;d++){const g=b[d],f=a[g];if(f)for(let h=0,k=f.length;h<k;h++)if(f[h]===c){1===k?delete a[g]:f.splice(h,1);break}else G(f[h])&&ba(f[h],c)}}}function ca(a){let c="",b="";var d="";for(let e=0;e<a.length;e++){const g=a[e];if(g!==b)if(e&&"h"===g){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===b||"e"===b||"i"===b||"o"===b||"u"===b||"y"===b)&&d||" "===b)c+=g}else c+=g;d=e===a.length-1?"":a[e+ | ||
1];b=g}return c}function qa(a,c){a=a.length-c.length;return 0>a?1:a?-1:0}function pa(a,c){a=a[M];c=c[M];return a<c?-1:a>c?1:0}function oa(a,c){const b=M.length;for(let d=0;d<b;d++)a=a[M[d]],c=c[M[d]];return a<c?-1:a>c?1:0}function T(a,c,b){return a?{page:a,next:c?""+c:null,result:b}:b}function ha(a,c,b,d,e,g,f){let h,k=[];if(!0===b){b="0";var l=""}else l=b&&b.split(":");const n=a.length;if(1<n){const y=B(),t=[];let v,x;var p=0,m;let I;var u=!0;let D,E=0,N,da,X,ea;l&&(2===l.length?(X=l,l=!1):l=ea= | ||
parseInt(l[0],10));if(f){for(v=B();p<n;p++)if("not"===e[p])for(x=a[p],I=x.length,m=0;m<I;m++)v["@"+x[m]]=1;else da=p+1;if(C(da))return T(b,h,k);p=0}else N=J(e)&&e;let Y;for(;p<n;p++){const ra=p===(da||n)-1;if(!N||!p)if((m=N||e&&e[p])&&"and"!==m)if("or"===m)Y=!1;else continue;else Y=g=!0;x=a[p];if(I=x.length){if(u)if(D){var q=D.length;for(m=0;m<q;m++){u=D[m];var A="@"+u;f&&v[A]||(y[A]=1,g||(k[E++]=u))}D=null;u=!1}else{D=x;continue}A=!1;for(m=0;m<I;m++){q=x[m];var z="@"+q;const Z=g?y[z]||0:p;if(!(!Z&& | ||
!d||f&&v[z]||!g&&y[z]))if(Z===p){if(ra){if(!ea||--ea<E)if(k[E++]=q,c&&E===c)return T(b,E+(l||0),k)}else y[z]=p+1;A=!0}else d&&(z=t[Z]||(t[Z]=[]),z[z.length]=q)}if(Y&&!A&&!d)break}else if(Y&&!d)return T(b,h,x)}if(D)if(p=D.length,f)for(m=l?parseInt(l,10):0;m<p;m++)a=D[m],v["@"+a]||(k[E++]=a);else k=D;if(d)for(E=k.length,X?(p=parseInt(X[0],10)+1,m=parseInt(X[1],10)+1):(p=t.length,m=0);p--;)if(q=t[p]){for(I=q.length;m<I;m++)if(d=q[m],!f||!v["@"+d])if(k[E++]=d,c&&E===c)return T(b,p+":"+m,k);m=0}}else!n|| | ||
e&&"not"===e[0]||(k=a[0],l&&(l=parseInt(l[0],10)));c&&(f=k.length,l&&l>f&&(l=0),l=l||0,h=l+c,h<f?k=k.slice(l,h):(h=0,l&&(k=k.slice(l))));return T(b,h,k)}function J(a){return"string"===typeof a}function F(a){return a.constructor===Array}function O(a){return"function"===typeof a}function G(a){return"object"===typeof a}function C(a){return"undefined"===typeof a}function ia(a){const c=Array(a);for(let b=0;b<a;b++)c[b]=B();return c}function B(){return Object.create(null)}function sa(){let a,c;self.onmessage= | ||
d&&this.o.length>=d&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(c,this.o),this.F&&this.F(this.o)));return this}function S(a){const c=B();for(const b in a)if(a.hasOwnProperty(b)){const d=a[b];F(d)?c[b]=d.slice(0):G(d)?c[b]=S(d):c[b]=d}return c}function W(a,c){const b=a.length,d=O(c),e=[];for(let f=0,h=0;f<b;f++){const g=a[f];if(d&&c(g)||!d&&!c[g])e[h++]=g}return e}function P(a,c,b,d,e,f,h,g,k,l){b=ha(b,h?0:e,g,f,c,k,l);let p;g&&(g=b.page,p=b.next,b=b.result);if(h)c=this.where(h,null, | ||
e,b);else{c=b;b=this.l;e=c.length;f=Array(e);for(h=0;h<e;h++)f[h]=b[c[h]];c=f}b=c;d&&(O(d)||(M=d.split(":"),1<M.length?d=oa:(M=M[0],d=pa)),b.sort(d));b=T(g,p,b);this.cache&&this.j.set(a,b);return b}function fa(a,c,b){Object.defineProperty(a,c,{get:b})}function r(a){return new RegExp(a,"g")}function Q(a,c){for(let b=0;b<c.length;b+=2)a=a.replace(c[b],c[b+1]);return a}function V(a,c,b,d,e,f,h,g){if(c[b])return c[b];e=e?(g-(h||g/1.5))*f+(h||g/1.5)*e:f;c[b]=e;e>=h&&(a=a[g-(e+.5>>0)],a=a[b]||(a[b]=[]), | ||
a[a.length]=d);return e}function ba(a,c){if(a){const b=Object.keys(a);for(let d=0,e=b.length;d<e;d++){const f=b[d],h=a[f];if(h)for(let g=0,k=h.length;g<k;g++)if(h[g]===c){1===k?delete a[f]:h.splice(g,1);break}else G(h[g])&&ba(h[g],c)}}}function ca(a){let c="",b="";var d="";for(let e=0;e<a.length;e++){const f=a[e];if(f!==b)if(e&&"h"===f){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===b||"e"===b||"i"===b||"o"===b||"u"===b||"y"===b)&&d||" "===b)c+=f}else c+=f;d=e===a.length-1?"":a[e+ | ||
1];b=f}return c}function qa(a,c){a=a.length-c.length;return 0>a?1:a?-1:0}function pa(a,c){a=a[M];c=c[M];return a<c?-1:a>c?1:0}function oa(a,c){const b=M.length;for(let d=0;d<b;d++)a=a[M[d]],c=c[M[d]];return a<c?-1:a>c?1:0}function T(a,c,b){return a?{page:a,next:c?""+c:null,result:b}:b}function ha(a,c,b,d,e,f,h){let g,k=[];if(!0===b){b="0";var l=""}else l=b&&b.split(":");const p=a.length;if(1<p){const y=B(),t=[];let v,x;var n=0,m;let I;var u=!0;let D,E=0,N,da,X,ea;l&&(2===l.length?(X=l,l=!1):l=ea= | ||
parseInt(l[0],10));if(h){for(v=B();n<p;n++)if("not"===e[n])for(x=a[n],I=x.length,m=0;m<I;m++)v["@"+x[m]]=1;else da=n+1;if(C(da))return T(b,g,k);n=0}else N=J(e)&&e;let Y;for(;n<p;n++){const ra=n===(da||p)-1;if(!N||!n)if((m=N||e&&e[n])&&"and"!==m)if("or"===m)Y=!1;else continue;else Y=f=!0;x=a[n];if(I=x.length){if(u)if(D){var q=D.length;for(m=0;m<q;m++){u=D[m];var A="@"+u;h&&v[A]||(y[A]=1,f||(k[E++]=u))}D=null;u=!1}else{D=x;continue}A=!1;for(m=0;m<I;m++){q=x[m];var z="@"+q;const Z=f?y[z]||0:n;if(!(!Z&& | ||
!d||h&&v[z]||!f&&y[z]))if(Z===n){if(ra){if(!ea||--ea<E)if(k[E++]=q,c&&E===c)return T(b,E+(l||0),k)}else y[z]=n+1;A=!0}else d&&(z=t[Z]||(t[Z]=[]),z[z.length]=q)}if(Y&&!A&&!d)break}else if(Y&&!d)return T(b,g,x)}if(D)if(n=D.length,h)for(m=l?parseInt(l,10):0;m<n;m++)a=D[m],v["@"+a]||(k[E++]=a);else k=D;if(d)for(E=k.length,X?(n=parseInt(X[0],10)+1,m=parseInt(X[1],10)+1):(n=t.length,m=0);n--;)if(q=t[n]){for(I=q.length;m<I;m++)if(d=q[m],!h||!v["@"+d])if(k[E++]=d,c&&E===c)return T(b,n+":"+m,k);m=0}}else!p|| | ||
e&&"not"===e[0]||(k=a[0],l&&(l=parseInt(l[0],10)));c&&(h=k.length,l&&l>h&&(l=0),l=l||0,g=l+c,g<h?k=k.slice(l,g):(g=0,l&&(k=k.slice(l))));return T(b,g,k)}function J(a){return"string"===typeof a}function F(a){return a.constructor===Array}function O(a){return"function"===typeof a}function G(a){return"object"===typeof a}function C(a){return"undefined"===typeof a}function ia(a){const c=Array(a);for(let b=0;b<a;b++)c[b]=B();return c}function B(){return Object.create(null)}function sa(){let a,c;self.onmessage= | ||
function(b){if(b=b.data)if(b.search){const d=c.search(b.content,b.threshold?{limit:b.limit,threshold:b.threshold,where:b.where}:b.limit);self.postMessage({id:a,content:b.content,limit:b.limit,result:d})}else b.add?c.add(b.id,b.content):b.update?c.update(b.id,b.content):b.remove?c.remove(b.id):b.clear?c.clear():b.info?(b=c.info(),b.worker=a,console.log(b)):b.register&&(a=b.id,b.options.cache=!1,b.options.async=!1,b.options.worker=!1,c=(new Function(b.register.substring(b.register.indexOf("{")+1,b.register.lastIndexOf("}"))))(), | ||
c=new c(b.options))}}function ta(a,c,b,d){a=K("flexsearch","id"+a,sa,function(g){(g=g.data)&&g.result&&d(g.id,g.content,g.result,g.limit,g.where,g.cursor,g.suggest)},c);const e=ma.toString();b.id=c;a.postMessage({register:e,options:b,id:c});return a}const H={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},ja={memory:{encode:"extra",f:"strict",threshold:0,b:1},speed:{encode:"icase",f:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",f:"full",threshold:1, | ||
c=new c(b.options))}}function ta(a,c,b,d){a=K("flexsearch","id"+a,sa,function(f){(f=f.data)&&f.result&&d(f.id,f.content,f.result,f.limit,f.where,f.cursor,f.suggest)},c);const e=ma.toString();b.id=c;a.postMessage({register:e,options:b,id:c});return a}const H={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},ja={memory:{encode:"extra",f:"strict",threshold:0,b:1},speed:{encode:"icase",f:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",f:"full",threshold:1, | ||
b:3},score:{encode:"extra",f:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",f:"strict",threshold:8,b:9,depth:1}},aa=[];let na=0;const ka={},la={};w.create=function(a,c){return new w(a,c)};w.registerMatcher=function(a){for(const c in a)a.hasOwnProperty(c)&&aa.push(r(c),a[c]);return this};w.registerEncoder=function(a,c){U[a]=c.bind(U);return this};w.registerLanguage=function(a,c){ka[a]=c.filter;la[a]=c.stemmer;return this};w.encode= | ||
function(a,c){return U[a](c)};w.prototype.init=function(a,c){this.v=[];if(c){var b=c.preset;a=c}else a||(a=H),b=a.preset;c={};J(a)?(c=ja[a],a={}):b&&(c=ja[b]);if(b=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.m=null;else{var d=parseInt(b,10)||4;this.C=-1;this.u=0;this.o=[];this.F=null;this.m=Array(d);for(var e=0;e<d;e++)this.m[e]=ta(this.id,e,a,L.bind(this))}this.f=a.tokenize||c.f||this.f||H.f;this.split=C(b=a.split)?this.split||H.split:J(b)?r(b):b;this.D=a.rtl||this.D||H.D;this.async= | ||
"undefined"===typeof Promise||C(b=a.async)?this.async||H.async:b;this.g=C(b=a.worker)?this.g||H.g:b;this.threshold=C(b=a.threshold)?c.threshold||this.threshold||H.threshold:b;this.b=C(b=a.resolution)?b=c.b||this.b||H.b:b;b<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.f||C(b=a.depth)?c.depth||this.depth||H.depth:b;this.w=(b=C(b=a.encode)?c.encode||H.encode:b)&&U[b]&&U[b].bind(U)||(O(b)?b:this.w||!1);(b=a.matcher)&&this.addMatcher(b);if(b=(c=a.lang)||a.filter){J(b)&&(b=ka[b]); | ||
if(F(b)){d=this.w;e=B();for(var g=0;g<b.length;g++){var f=d?d(b[g]):b[g];e[f]=1}b=e}this.filter=b}if(b=c||a.stemmer){var h;c=J(b)?la[b]:b;d=this.w;e=[];for(h in c)c.hasOwnProperty(h)&&(g=d?d(h):h,e.push(r(g+"($|\\W)"),d?d(c[h]):c[h]));this.stemmer=h=e}this.a=e=(b=a.doc)?S(b):this.a||H.a;this.i=ia(this.b-(this.threshold||0));this.h=B();this.c=B();if(e){this.l=B();a.doc=null;h=e.index={};c=e.keys=[];d=e.field;g=e.tag;f=e.store;F(e.id)||(e.id=e.id.split(":"));if(f){var k=B();if(J(f))k[f]=1;else if(F(f))for(let l= | ||
0;l<f.length;l++)k[f[l]]=1;else G(f)&&(k=f);e.store=k}if(g){this.G=B();f=B();if(d)if(J(d))f[d]=a;else if(F(d))for(k=0;k<d.length;k++)f[d[k]]=a;else G(d)&&(f=d);F(g)||(e.tag=g=[g]);for(d=0;d<g.length;d++)this.G[g[d]]=B();this.I=g;d=f}if(d){let l;F(d)||(G(d)?(l=d,e.field=d=Object.keys(d)):e.field=d=[d]);for(e=0;e<d.length;e++)g=d[e],F(g)||(l&&(a=l[g]),c[e]=g,d[e]=g.split(":")),h[g]=new w(a)}a.doc=b}this.B=!0;this.j=(this.cache=b=C(b=a.cache)?this.cache||H.cache:b)?new ua(b):!1;return this};w.prototype.encode= | ||
function(a){a&&(aa.length&&(a=Q(a,aa)),this.v.length&&(a=Q(a,this.v)),this.w&&(a=this.w(a)),this.stemmer&&(a=Q(a,this.stemmer)));return a};w.prototype.addMatcher=function(a){const c=this.v;for(const b in a)a.hasOwnProperty(b)&&c.push(r(b),a[b]);return this};w.prototype.add=function(a,c,b,d,e){if(this.a&&G(a))return this.A("add",a,c);if(c&&J(c)&&(a||0===a)){var g="@"+a;if(this.c[g]&&!d)return this.update(a,c);if(this.g)return++this.C>=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:a, | ||
content:c}),this.c[g]=""+this.C,b&&b(),this;if(!e){if(this.async&&"function"!==typeof importScripts){let t=this;g=new Promise(function(v){setTimeout(function(){t.add(a,c,null,d,!0);t=null;v()})});if(b)g.then(b);else return g;return this}if(b)return this.add(a,c,null,d,!0),b(),this}c=this.encode(c);if(!c.length)return this;b=this.f;e=O(b)?b(c):c.split(this.split);this.filter&&(e=W(e,this.filter));const p=B();p._ctx=B();const m=e.length,u=this.threshold,q=this.depth,A=this.b,z=this.i,y=this.D;for(let t= | ||
0;t<m;t++){var f=e[t];if(f){var h=f.length,k=(y?t+1:m-t)/m,l="";switch(b){case "reverse":case "both":for(var n=h;--n;)l=f[n]+l,V(z,p,l,a,y?1:(h-n)/h,k,u,A-1);l="";case "forward":for(n=0;n<h;n++)l+=f[n],V(z,p,l,a,y?(n+1)/h:1,k,u,A-1);break;case "full":for(n=0;n<h;n++){const v=(y?n+1:h-n)/h;for(let x=h;x>n;x--)l=f.substring(n,x),V(z,p,l,a,v,k,u,A-1)}break;default:if(h=V(z,p,f,a,1,k,u,A-1),q&&1<m&&h>=u)for(h=p._ctx[f]||(p._ctx[f]=B()),f=this.h[f]||(this.h[f]=ia(A-(u||0))),k=t-q,l=t+q+1,0>k&&(k=0),l> | ||
m&&(l=m);k<l;k++)k!==t&&V(f,h,e[k],a,0,A-(k<t?t-k:k-t),u,A-1)}}}this.c[g]=1;this.B=!1}return this};w.prototype.A=function(a,c,b){if(F(c)){var d=c.length;if(d--){for(var e=0;e<d;e++)this.A(a,c[e]);return this.A(a,c[d],b)}}else{var g=this.a.index,f=this.a.keys,h=this.a.tag;e=this.a.store;var k;var l=this.a.id;d=c;for(var n=0;n<l.length;n++)d=d[l[n]];if("remove"===a&&(delete this.l[d],l=f.length,l--)){for(c=0;c<l;c++)g[f[c]].remove(d);return g[f[l]].remove(d,b)}if(h){for(k=0;k<h.length;k++){var p=h[k]; | ||
var m=c;l=p.split(":");for(n=0;n<l.length;n++)m=m[l[n]];m="@"+m}k=this.G[p];k=k[m]||(k[m]=[])}l=this.a.field;for(let u=0,q=l.length;u<q;u++){p=l[u];h=c;for(m=0;m<p.length;m++)h=h[p[m]];p=g[f[u]];m="add"===a?p.add:p.update;u===q-1?m.call(p,d,h,b):m.call(p,d,h)}if(e){b=Object.keys(e);a=B();for(g=0;g<b.length;g++)if(f=b[g],e[f]){f=f.split(":");let u,q;for(l=0;l<f.length;l++)h=f[l],q=(q||c)[h],u=(u||a)[h]=q}c=a}k&&(k[k.length]=c);this.l[d]=c}return this};w.prototype.update=function(a,c,b){if(this.a&& | ||
G(a))return this.A("update",a,c);this.c["@"+a]&&J(c)&&(this.remove(a),this.add(a,c,b,!0));return this};w.prototype.remove=function(a,c,b){if(this.a&&G(a))return this.A("remove",a,c);var d="@"+a;if(this.c[d]){if(this.g)return this.m[this.c[d]].postMessage({remove:!0,id:a}),delete this.c[d],c&&c(),this;if(!b){if(this.async&&"function"!==typeof importScripts){let e=this;d=new Promise(function(g){setTimeout(function(){e.remove(a,null,!0);e=null;g()})});if(c)d.then(c);else return d;return this}if(c)return this.remove(a, | ||
null,!0),c(),this}for(c=0;c<this.b-(this.threshold||0);c++)ba(this.i[c],a);this.depth&&ba(this.h,a);delete this.c[d];this.B=!1}return this};let M;w.prototype.search=function(a,c,b,d){if(G(c)){if(F(c))for(var e=0;e<c.length;e++)c[e].query=a;else c.query=a;a=c;c=1E3}else c&&O(c)?(b=c,c=1E3):c||0===c||(c=1E3);let g=[],f=a;let h,k,l;if(G(a)&&!F(a)){b||(b=a.callback)&&(f.callback=null);k=a.sort;h=a.page;c=a.limit;var n=a.threshold;l=a.suggest;a=a.query}if(this.a){n=this.a.index;const y=f.where;var p=f.bool|| | ||
"or",m=f.field;let t=p;let v,x;if(m)F(m)||(m=[m]);else if(F(f)){var u=f;m=[];t=[];for(var q=0;q<f.length;q++)d=f[q],e=d.bool||p,m[q]=d.field,t[q]=e,"not"===e?v=!0:"and"===e&&(x=!0)}else m=this.a.keys;p=m.length;for(q=0;q<p;q++)u&&(f=u[q]),h&&!J(f)&&(f.page=null,f.limit=0),g[q]=n[m[q]].search(f,0);if(b)return b(P.call(this,a,t,g,k,c,l,y,h,x,v));if(this.async){const I=this;return new Promise(function(D){Promise.all(g).then(function(E){D(P.call(I,a,t,E,k,c,l,y,h,x,v))})})}return P.call(this,a,t,g,k, | ||
c,l,y,h,x,v)}n||(n=this.threshold||0);if(this.g)for(this.F=b,this.u=0,this.o=[],n=0;n<this.g;n++)this.m[n].postMessage({search:!0,limit:c,content:f});else{if(!d){if(this.async&&"function"!==typeof importScripts){let y=this;n=new Promise(function(t){setTimeout(function(){t(y.search(f,c,null,!0));y=null})});if(b)n.then(b);else return n;return this}if(b)return b(this.search(f,c,null,!0)),this}if(!a||!J(a))return g;f=a;if(this.cache)if(this.B){if(b=this.j.get(a))return b}else this.j.clear(),this.B=!0; | ||
f=this.encode(f);if(!f.length)return g;b=this.f;b=O(b)?b(f):f.split(this.split);this.filter&&(b=W(b,this.filter));u=b.length;d=!0;e=[];var A=B(),z=0;1<u&&(this.depth&&"strict"===this.f?p=!0:b.sort(qa));if(!p||(q=this.h)){const y=this.b;for(;z<u;z++){let t=b[z];if(t){if(p){if(!m)if(q[t])m=t,A[t]=1;else if(!l)return g;if(l&&z===u-1&&!e.length)p=!1,t=m||t,A[t]=0;else if(!m)continue}if(!A[t]){const v=[];let x=!1,I=0;const D=p?q[m]:this.i;if(D){let E;for(let N=0;N<y-n;N++)if(E=D[N]&&D[N][t])v[I++]=E,x= | ||
!0}if(x)m=t,e[e.length]=1<I?v.concat.apply([],v):v[0];else if(!l){d=!1;break}A[t]=1}}}}else d=!1;d&&(g=ha(e,c,h,l));this.cache&&this.j.set(a,g);return g}};w.prototype.find=function(a,c){return this.where(a,c,1)[0]||null};w.prototype.where=function(a,c,b,d){const e=this.l,g=[];let f=0;let h;var k;let l;if(G(a)){b||(b=c);var n=Object.keys(a);var p=n.length;h=!1;if(1===p&&"id"===n[0])return[e[a.id]];if((k=this.I)&&!d)for(var m=0;m<k.length;m++){var u=k[m],q=a[u];if(!C(q)){l=this.G[u]["@"+q];if(0===--p)return l; | ||
n.splice(n.indexOf(u),1);delete a[u];break}}k=Array(p);for(m=0;m<p;m++)k[m]=n[m].split(":")}else{if(O(a)){c=d||Object.keys(e);b=c.length;for(n=0;n<b;n++)p=e[c[n]],a(p)&&(g[f++]=p);return g}if(C(c))return[e[a]];if("id"===a)return[e[c]];n=[a];p=1;k=[a.split(":")];h=!0}d=l||d||Object.keys(e);m=d.length;for(u=0;u<m;u++){q=l?d[u]:e[d[u]];let A=!0;for(let z=0;z<p;z++){h||(c=a[n[z]]);const y=k[z],t=y.length;let v=q;if(1<t)for(let x=0;x<t;x++)v=v[y[x]];else v=v[y[0]];if(v!==c){A=!1;break}}if(A&&(g[f++]=q, | ||
b&&f===b))break}return g};w.prototype.info=function(){if(this.g)for(let a=0;a<this.g;a++)this.m[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.s?this.cache.s.length:!1,matcher:aa.length+(this.v?this.v.length:0),worker:this.g,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.f}};w.prototype.clear=function(){return this.destroy().init()};w.prototype.destroy=function(){this.cache&&(this.j.clear(), | ||
this.j=null);this.i=this.h=this.c=null;if(this.a){const a=this.a.keys;for(let c=0;c<a.length;c++)this.a.index[a[c]].destroy();this.a=this.l=null}return this};w.prototype.export=function(a){const c=!a||C(a.serialize)||a.serialize;if(this.a){const d=!a||C(a.doc)||a.doc;var b=!a||C(a.index)||a.index;a=[];let e=0;if(b)for(b=this.a.keys;e<b.length;e++){const g=this.a.index[b[e]];a[e]=[g.i,g.h,Object.keys(g.c)]}d&&(a[e]=this.l)}else a=[this.i,this.h,Object.keys(this.c)];c&&(a=JSON.stringify(a));return a}; | ||
w.prototype.import=function(a,c){if(!c||C(c.serialize)||c.serialize)a=JSON.parse(a);const b=B();if(this.a){var d=!c||C(c.doc)||c.doc,e=0;if(!c||C(c.index)||c.index){c=this.a.keys;const f=c.length;for(var g=a[0][2];e<g.length;e++)b[g[e]]=1;for(e=0;e<f;e++){g=this.a.index[c[e]];const h=a[e];h&&(g.i=h[0],g.h=h[1],g.c=b)}}d&&(this.l=G(d)?d:a[e])}else{d=a[2];for(e=0;e<d.length;e++)b[d[e]]=1;this.i=a[0];this.h=a[1];this.c=b}};const va=function(){const a=r("\\s+"),c=r("[^a-z0-9 ]"),b=[r("[-/]")," ",c,"", | ||
a," "];return function(d){return ca(Q(d.toLowerCase(),b))}}(),U={icase:function(a){return a.toLowerCase()},simple:function(){const a=r("\\s+"),c=r("[^a-z0-9 ]"),b=r("[-/]"),d=r("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),e=r("[\u00e8\u00e9\u00ea\u00eb]"),g=r("[\u00ec\u00ed\u00ee\u00ef]"),f=r("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),h=r("[\u00f9\u00fa\u00fb\u00fc\u0171]"),k=r("[\u00fd\u0177\u00ff]"),l=r("\u00f1"),n=r("[\u00e7c]"),p=r("\u00df"),m=r(" & "),u=[d,"a",e,"e",g,"i",f,"o",h,"u",k,"y",l,"n", | ||
n,"k",p,"s",m," and ",b," ",c,"",a," "];return function(q){q=Q(q.toLowerCase(),u);return" "===q?"":q}}(),advanced:function(){const a=r("ae"),c=r("ai"),b=r("ay"),d=r("ey"),e=r("oe"),g=r("ue"),f=r("ie"),h=r("sz"),k=r("zs"),l=r("ck"),n=r("cc"),p=r("sh"),m=r("th"),u=r("dt"),q=r("ph"),A=r("pf"),z=r("ou"),y=r("uo"),t=[a,"a",c,"ei",b,"ei",d,"ei",e,"o",g,"u",f,"i",h,"s",k,"s",p,"s",l,"k",n,"k",m,"t",u,"t",q,"f",A,"f",z,"o",y,"u"];return function(v,x){if(!v)return v;v=this.simple(v);2<v.length&&(v=Q(v,t)); | ||
x||1<v.length&&(v=ca(v));return v}}(),extra:function(){const a=r("p"),c=r("z"),b=r("[cgq]"),d=r("n"),e=r("d"),g=r("[vw]"),f=r("[aeiouy]"),h=[a,"b",c,"s",b,"k",d,"m",e,"t",g,"f",f,""];return function(k){if(!k)return k;k=this.advanced(k,!0);if(1<k.length){k=k.split(" ");for(let l=0;l<k.length;l++){const n=k[l];1<n.length&&(k[l]=n[0]+Q(n.substring(1),h))}k=k.join(" ");k=ca(k)}return k}}(),balance:va},ua=function(){function a(c){this.clear();this.H=!0!==c&&c}a.prototype.clear=function(){this.cache=B(); | ||
this.count=B();this.index=B();this.s=[]};a.prototype.set=function(c,b){if(this.H&&C(this.cache[c])){let d=this.s.length;if(d===this.H){d--;const e=this.s[d];delete this.cache[e];delete this.count[e];delete this.index[e]}this.index[c]=d;this.s[d]=c;this.count[c]=-1;this.cache[c]=b;this.get(c)}else this.cache[c]=b};a.prototype.get=function(c){const b=this.cache[c];if(this.H&&b){var d=++this.count[c];const g=this.index;let f=g[c];if(0<f){const h=this.s;for(var e=f;this.count[h[--f]]<=d&&-1!==f;);f++; | ||
if(f!==e){for(d=e;d>f;d--)e=h[d-1],h[d]=e,g[e]=d;h[f]=c;g[c]=f}}}return b};return a}();return w}(function(){const K={},R="undefined"!==typeof Blob&&"undefined"!==typeof URL&&URL.createObjectURL;return function(w,L,S,W,P){S=R?URL.createObjectURL(new Blob(["("+S.toString()+")()"],{type:"text/javascript"})):w+".min.js";w+="-"+L;K[w]||(K[w]=[]);K[w][P]=new Worker(S);K[w][P].onmessage=W;return K[w][P]}}()),this); | ||
if(F(b)){d=this.w;e=B();for(var f=0;f<b.length;f++){var h=d?d(b[f]):b[f];e[h]=1}b=e}this.filter=b}if(b=c||a.stemmer){var g;c=J(b)?la[b]:b;d=this.w;e=[];for(g in c)c.hasOwnProperty(g)&&(f=d?d(g):g,e.push(r(f+"($|\\W)"),d?d(c[g]):c[g]));this.stemmer=g=e}this.a=e=(b=a.doc)?S(b):this.a||H.a;this.i=ia(this.b-(this.threshold||0));this.h=B();this.c=B();if(e){this.l=B();a.doc=null;g=e.index={};c=e.keys=[];d=e.field;f=e.tag;h=e.store;F(e.id)||(e.id=e.id.split(":"));if(h){var k=B();if(J(h))k[h]=1;else if(F(h))for(let l= | ||
0;l<h.length;l++)k[h[l]]=1;else G(h)&&(k=h);e.store=k}if(f){this.G=B();h=B();if(d)if(J(d))h[d]=a;else if(F(d))for(k=0;k<d.length;k++)h[d[k]]=a;else G(d)&&(h=d);F(f)||(e.tag=f=[f]);for(d=0;d<f.length;d++)this.G[f[d]]=B();this.I=f;d=h}if(d){let l;F(d)||(G(d)?(l=d,e.field=d=Object.keys(d)):e.field=d=[d]);for(e=0;e<d.length;e++)f=d[e],F(f)||(l&&(a=l[f]),c[e]=f,d[e]=f.split(":")),g[f]=new w(a)}a.doc=b}this.B=!0;this.j=(this.cache=b=C(b=a.cache)?this.cache||H.cache:b)?new ua(b):!1;return this};w.prototype.encode= | ||
function(a){a&&(aa.length&&(a=Q(a,aa)),this.v.length&&(a=Q(a,this.v)),this.w&&(a=this.w(a)),this.stemmer&&(a=Q(a,this.stemmer)));return a};w.prototype.addMatcher=function(a){const c=this.v;for(const b in a)a.hasOwnProperty(b)&&c.push(r(b),a[b]);return this};w.prototype.add=function(a,c,b,d,e){if(this.a&&G(a))return this.A("add",a,c);if(c&&J(c)&&(a||0===a)){var f="@"+a;if(this.c[f]&&!d)return this.update(a,c);if(this.g)return++this.C>=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:a, | ||
content:c}),this.c[f]=""+this.C,b&&b(),this;if(!e){if(this.async&&"function"!==typeof importScripts){let t=this;f=new Promise(function(v){setTimeout(function(){t.add(a,c,null,d,!0);t=null;v()})});if(b)f.then(b);else return f;return this}if(b)return this.add(a,c,null,d,!0),b(),this}c=this.encode(c);if(!c.length)return this;b=this.f;e=O(b)?b(c):c.split(this.split);this.filter&&(e=W(e,this.filter));const n=B();n._ctx=B();const m=e.length,u=this.threshold,q=this.depth,A=this.b,z=this.i,y=this.D;for(let t= | ||
0;t<m;t++){var h=e[t];if(h){var g=h.length,k=(y?t+1:m-t)/m,l="";switch(b){case "reverse":case "both":for(var p=g;--p;)l=h[p]+l,V(z,n,l,a,y?1:(g-p)/g,k,u,A-1);l="";case "forward":for(p=0;p<g;p++)l+=h[p],V(z,n,l,a,y?(p+1)/g:1,k,u,A-1);break;case "full":for(p=0;p<g;p++){const v=(y?p+1:g-p)/g;for(let x=g;x>p;x--)l=h.substring(p,x),V(z,n,l,a,v,k,u,A-1)}break;default:if(g=V(z,n,h,a,1,k,u,A-1),q&&1<m&&g>=u)for(g=n._ctx[h]||(n._ctx[h]=B()),h=this.h[h]||(this.h[h]=ia(A-(u||0))),k=t-q,l=t+q+1,0>k&&(k=0),l> | ||
m&&(l=m);k<l;k++)k!==t&&V(h,g,e[k],a,0,A-(k<t?t-k:k-t),u,A-1)}}}this.c[f]=1;this.B=!1}return this};w.prototype.A=function(a,c,b){if(F(c)){var d=c.length;if(d--){for(var e=0;e<d;e++)this.A(a,c[e]);return this.A(a,c[d],b)}}else{var f=this.a.index,h=this.a.keys,g=this.a.tag;e=this.a.store;var k;var l=this.a.id;d=c;for(var p=0;p<l.length;p++)d=d[l[p]];if("remove"===a&&(delete this.l[d],l=h.length,l--)){for(c=0;c<l;c++)f[h[c]].remove(d);return f[h[l]].remove(d,b)}if(g){for(k=0;k<g.length;k++){var n=g[k]; | ||
var m=c;l=n.split(":");for(p=0;p<l.length;p++)m=m[l[p]];m="@"+m}k=this.G[n];k=k[m]||(k[m]=[])}l=this.a.field;for(let u=0,q=l.length;u<q;u++){n=l[u];g=c;for(m=0;m<n.length;m++)g=g[n[m]];n=f[h[u]];m="add"===a?n.add:n.update;u===q-1?m.call(n,d,g,b):m.call(n,d,g)}if(e){b=Object.keys(e);a=B();for(f=0;f<b.length;f++)if(h=b[f],e[h]){h=h.split(":");let u,q;for(l=0;l<h.length;l++)g=h[l],u=(u||c)[g],q=(q||a)[g]=u}c=a}k&&(k[k.length]=c);this.l[d]=c}return this};w.prototype.update=function(a,c,b){if(this.a&& | ||
G(a))return this.A("update",a,c);this.c["@"+a]&&J(c)&&(this.remove(a),this.add(a,c,b,!0));return this};w.prototype.remove=function(a,c,b){if(this.a&&G(a))return this.A("remove",a,c);var d="@"+a;if(this.c[d]){if(this.g)return this.m[this.c[d]].postMessage({remove:!0,id:a}),delete this.c[d],c&&c(),this;if(!b){if(this.async&&"function"!==typeof importScripts){let e=this;d=new Promise(function(f){setTimeout(function(){e.remove(a,null,!0);e=null;f()})});if(c)d.then(c);else return d;return this}if(c)return this.remove(a, | ||
null,!0),c(),this}for(c=0;c<this.b-(this.threshold||0);c++)ba(this.i[c],a);this.depth&&ba(this.h,a);delete this.c[d];this.B=!1}return this};let M;w.prototype.search=function(a,c,b,d){if(G(c)){if(F(c))for(var e=0;e<c.length;e++)c[e].query=a;else c.query=a;a=c;c=1E3}else c&&O(c)?(b=c,c=1E3):c||0===c||(c=1E3);if(this.g){this.F=b;this.u=0;this.o=[];for(var f=0;f<this.g;f++)this.m[f].postMessage({search:!0,limit:c,content:a})}else{var h=[],g=a;if(G(a)&&!F(a)){b||(b=a.callback)&&(g.callback=null);var k= | ||
a.sort;var l=a.page;c=a.limit;f=a.threshold;var p=a.suggest;a=a.query}if(this.a){f=this.a.index;const y=g.where;var n=g.bool||"or",m=g.field;let t=n;let v,x;if(m)F(m)||(m=[m]);else if(F(g)){var u=g;m=[];t=[];for(var q=0;q<g.length;q++)d=g[q],e=d.bool||n,m[q]=d.field,t[q]=e,"not"===e?v=!0:"and"===e&&(x=!0)}else m=this.a.keys;n=m.length;for(q=0;q<n;q++)u&&(g=u[q]),l&&!J(g)&&(g.page=null,g.limit=0),h[q]=f[m[q]].search(g,0);if(b)return b(P.call(this,a,t,h,k,c,p,y,l,x,v));if(this.async){const I=this;return new Promise(function(D){Promise.all(h).then(function(E){D(P.call(I, | ||
a,t,E,k,c,p,y,l,x,v))})})}return P.call(this,a,t,h,k,c,p,y,l,x,v)}f||(f=this.threshold||0);if(!d){if(this.async&&"function"!==typeof importScripts){let y=this;f=new Promise(function(t){setTimeout(function(){t(y.search(g,c,null,!0));y=null})});if(b)f.then(b);else return f;return this}if(b)return b(this.search(g,c,null,!0)),this}if(!a||!J(a))return h;g=a;if(this.cache)if(this.B){if(b=this.j.get(a))return b}else this.j.clear(),this.B=!0;g=this.encode(g);if(!g.length)return h;b=this.f;b=O(b)?b(g):g.split(this.split); | ||
this.filter&&(b=W(b,this.filter));u=b.length;d=!0;e=[];var A=B(),z=0;1<u&&(this.depth&&"strict"===this.f?n=!0:b.sort(qa));if(!n||(q=this.h)){const y=this.b;for(;z<u;z++){let t=b[z];if(t){if(n){if(!m)if(q[t])m=t,A[t]=1;else if(!p)return h;if(p&&z===u-1&&!e.length)n=!1,t=m||t,A[t]=0;else if(!m)continue}if(!A[t]){const v=[];let x=!1,I=0;const D=n?q[m]:this.i;if(D){let E;for(let N=0;N<y-f;N++)if(E=D[N]&&D[N][t])v[I++]=E,x=!0}if(x)m=t,e[e.length]=1<I?v.concat.apply([],v):v[0];else if(!p){d=!1;break}A[t]= | ||
1}}}}else d=!1;d&&(h=ha(e,c,l,p));this.cache&&this.j.set(a,h);return h}};w.prototype.find=function(a,c){return this.where(a,c,1)[0]||null};w.prototype.where=function(a,c,b,d){const e=this.l,f=[];let h=0;let g;var k;let l;if(G(a)){b||(b=c);var p=Object.keys(a);var n=p.length;g=!1;if(1===n&&"id"===p[0])return[e[a.id]];if((k=this.I)&&!d)for(var m=0;m<k.length;m++){var u=k[m],q=a[u];if(!C(q)){l=this.G[u]["@"+q];if(0===--n)return l;p.splice(p.indexOf(u),1);delete a[u];break}}k=Array(n);for(m=0;m<n;m++)k[m]= | ||
p[m].split(":")}else{if(O(a)){c=d||Object.keys(e);b=c.length;for(p=0;p<b;p++)n=e[c[p]],a(n)&&(f[h++]=n);return f}if(C(c))return[e[a]];if("id"===a)return[e[c]];p=[a];n=1;k=[a.split(":")];g=!0}d=l||d||Object.keys(e);m=d.length;for(u=0;u<m;u++){q=l?d[u]:e[d[u]];let A=!0;for(let z=0;z<n;z++){g||(c=a[p[z]]);const y=k[z],t=y.length;let v=q;if(1<t)for(let x=0;x<t;x++)v=v[y[x]];else v=v[y[0]];if(v!==c){A=!1;break}}if(A&&(f[h++]=q,b&&h===b))break}return f};w.prototype.info=function(){if(this.g)for(let a=0;a< | ||
this.g;a++)this.m[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.s?this.cache.s.length:!1,matcher:aa.length+(this.v?this.v.length:0),worker:this.g,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.f}};w.prototype.clear=function(){return this.destroy().init()};w.prototype.destroy=function(){this.cache&&(this.j.clear(),this.j=null);this.i=this.h=this.c=null;if(this.a){const a=this.a.keys;for(let c= | ||
0;c<a.length;c++)this.a.index[a[c]].destroy();this.a=this.l=null}return this};w.prototype.export=function(a){const c=!a||C(a.serialize)||a.serialize;if(this.a){const d=!a||C(a.doc)||a.doc;var b=!a||C(a.index)||a.index;a=[];let e=0;if(b)for(b=this.a.keys;e<b.length;e++){const f=this.a.index[b[e]];a[e]=[f.i,f.h,Object.keys(f.c)]}d&&(a[e]=this.l)}else a=[this.i,this.h,Object.keys(this.c)];c&&(a=JSON.stringify(a));return a};w.prototype.import=function(a,c){if(!c||C(c.serialize)||c.serialize)a=JSON.parse(a); | ||
const b=B();if(this.a){var d=!c||C(c.doc)||c.doc,e=0;if(!c||C(c.index)||c.index){c=this.a.keys;const h=c.length;for(var f=a[0][2];e<f.length;e++)b[f[e]]=1;for(e=0;e<h;e++){f=this.a.index[c[e]];const g=a[e];g&&(f.i=g[0],f.h=g[1],f.c=b)}}d&&(this.l=G(d)?d:a[e])}else{d=a[2];for(e=0;e<d.length;e++)b[d[e]]=1;this.i=a[0];this.h=a[1];this.c=b}};const va=function(){const a=r("\\s+"),c=r("[^a-z0-9 ]"),b=[r("[-/]")," ",c,"",a," "];return function(d){return ca(Q(d.toLowerCase(),b))}}(),U={icase:function(a){return a.toLowerCase()}, | ||
simple:function(){const a=r("\\s+"),c=r("[^a-z0-9 ]"),b=r("[-/]"),d=r("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),e=r("[\u00e8\u00e9\u00ea\u00eb]"),f=r("[\u00ec\u00ed\u00ee\u00ef]"),h=r("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),g=r("[\u00f9\u00fa\u00fb\u00fc\u0171]"),k=r("[\u00fd\u0177\u00ff]"),l=r("\u00f1"),p=r("[\u00e7c]"),n=r("\u00df"),m=r(" & "),u=[d,"a",e,"e",f,"i",h,"o",g,"u",k,"y",l,"n",p,"k",n,"s",m," and ",b," ",c,"",a," "];return function(q){q=Q(q.toLowerCase(),u);return" "===q?"":q}}(),advanced:function(){const a= | ||
r("ae"),c=r("ai"),b=r("ay"),d=r("ey"),e=r("oe"),f=r("ue"),h=r("ie"),g=r("sz"),k=r("zs"),l=r("ck"),p=r("cc"),n=r("sh"),m=r("th"),u=r("dt"),q=r("ph"),A=r("pf"),z=r("ou"),y=r("uo"),t=[a,"a",c,"ei",b,"ei",d,"ei",e,"o",f,"u",h,"i",g,"s",k,"s",n,"s",l,"k",p,"k",m,"t",u,"t",q,"f",A,"f",z,"o",y,"u"];return function(v,x){if(!v)return v;v=this.simple(v);2<v.length&&(v=Q(v,t));x||1<v.length&&(v=ca(v));return v}}(),extra:function(){const a=r("p"),c=r("z"),b=r("[cgq]"),d=r("n"),e=r("d"),f=r("[vw]"),h=r("[aeiouy]"), | ||
g=[a,"b",c,"s",b,"k",d,"m",e,"t",f,"f",h,""];return function(k){if(!k)return k;k=this.advanced(k,!0);if(1<k.length){k=k.split(" ");for(let l=0;l<k.length;l++){const p=k[l];1<p.length&&(k[l]=p[0]+Q(p.substring(1),g))}k=k.join(" ");k=ca(k)}return k}}(),balance:va},ua=function(){function a(c){this.clear();this.H=!0!==c&&c}a.prototype.clear=function(){this.cache=B();this.count=B();this.index=B();this.s=[]};a.prototype.set=function(c,b){if(this.H&&C(this.cache[c])){let d=this.s.length;if(d===this.H){d--; | ||
const e=this.s[d];delete this.cache[e];delete this.count[e];delete this.index[e]}this.index[c]=d;this.s[d]=c;this.count[c]=-1;this.cache[c]=b;this.get(c)}else this.cache[c]=b};a.prototype.get=function(c){const b=this.cache[c];if(this.H&&b){var d=++this.count[c];const f=this.index;let h=f[c];if(0<h){const g=this.s;for(var e=h;this.count[g[--h]]<=d&&-1!==h;);h++;if(h!==e){for(d=e;d>h;d--)e=g[d-1],g[d]=e,f[e]=d;g[h]=c;f[c]=h}}}return b};return a}();return w}(function(){const K={},R="undefined"!==typeof Blob&& | ||
"undefined"!==typeof URL&&URL.createObjectURL;return function(w,L,S,W,P){S=R?URL.createObjectURL(new Blob(["("+S.toString()+")()"],{type:"text/javascript"})):w+".min.js";w+="-"+L;K[w]||(K[w]=[]);K[w][P]=new Worker(S);K[w][P].onmessage=W;return K[w][P]}}()),this); |
@@ -24,3 +24,3 @@ /* | ||
n._ctx[f]||(n._ctx[f]=B()),f=this.g[f]||(this.g[f]=ea(A-(u||0))),k=t-q,l=t+q+1,0>k&&(k=0),l>m&&(l=m);k<l;k++)k!==t&&T(f,h,e[k],a,0,A-(k<t?t-k:k-t),u,A-1)}}}this.f[g]=1;this.u=!1}return this};w.prototype.s=function(a,b,c){if(F(b)){var d=b.length;if(d--){for(var e=0;e<d;e++)this.s(a,b[e]);return this.s(a,b[d],c)}}else{var g=this.a.index,f=this.a.keys,h=this.a.tag;e=this.a.store;var k;var l=this.a.id;d=b;for(var p=0;p<l.length;p++)d=d[l[p]];if("remove"===a&&(delete this.i[d],l=f.length,l--)){for(b=0;b< | ||
l;b++)g[f[b]].remove(d);return g[f[l]].remove(d,c)}if(h){for(k=0;k<h.length;k++){var n=h[k];var m=b;l=n.split(":");for(p=0;p<l.length;p++)m=m[l[p]];m="@"+m}k=this.w[n];k=k[m]||(k[m]=[])}l=this.a.field;for(let u=0,q=l.length;u<q;u++){n=l[u];h=b;for(m=0;m<n.length;m++)h=h[n[m]];n=g[f[u]];m="add"===a?n.add:n.update;u===q-1?m.call(n,d,h,c):m.call(n,d,h)}if(e){c=Object.keys(e);a=B();for(g=0;g<c.length;g++)if(f=c[g],e[f]){f=f.split(":");let u,q;for(l=0;l<f.length;l++)h=f[l],q=(q||b)[h],u=(u||a)[h]=q}b= | ||
l;b++)g[f[b]].remove(d);return g[f[l]].remove(d,c)}if(h){for(k=0;k<h.length;k++){var n=h[k];var m=b;l=n.split(":");for(p=0;p<l.length;p++)m=m[l[p]];m="@"+m}k=this.w[n];k=k[m]||(k[m]=[])}l=this.a.field;for(let u=0,q=l.length;u<q;u++){n=l[u];h=b;for(m=0;m<n.length;m++)h=h[n[m]];n=g[f[u]];m="add"===a?n.add:n.update;u===q-1?m.call(n,d,h,c):m.call(n,d,h)}if(e){c=Object.keys(e);a=B();for(g=0;g<c.length;g++)if(f=c[g],e[f]){f=f.split(":");let u,q;for(l=0;l<f.length;l++)h=f[l],u=(u||b)[h],q=(q||a)[h]=u}b= | ||
a}k&&(k[k.length]=b);this.i[d]=b}return this};w.prototype.update=function(a,b,c){if(this.a&&G(a))return this.s("update",a,b);this.f["@"+a]&&I(b)&&(this.remove(a),this.add(a,b,c,!0));return this};w.prototype.remove=function(a,b,c){if(this.a&&G(a))return this.s("remove",a,b);var d="@"+a;if(this.f[d]){if(!c){if(this.async&&"function"!==typeof importScripts){let e=this;d=new Promise(function(g){setTimeout(function(){e.remove(a,null,!0);e=null;g()})});if(b)d.then(b);else return d;return this}if(b)return this.remove(a, | ||
@@ -27,0 +27,0 @@ null,!0),b(),this}for(b=0;b<this.b-(this.threshold||0);b++)Y(this.h[b],a);this.depth&&Y(this.g,a);delete this.f[d];this.u=!1}return this};let L;w.prototype.search=function(a,b,c,d){if(G(b)){if(F(b))for(var e=0;e<b.length;e++)b[e].query=a;else b.query=a;a=b;b=1E3}else b&&O(b)?(c=b,b=1E3):b||0===b||(b=1E3);let g=[],f=a;let h,k,l;if(G(a)&&!F(a)){c||(c=a.callback)&&(f.callback=null);k=a.sort;h=a.page;b=a.limit;var p=a.threshold;l=a.suggest;a=a.query}if(this.a){p=this.a.index;const y=f.where;var n=f.bool|| |
@@ -570,3 +570,3 @@ /* | ||
for (l = 0; l < f.length; l++) { | ||
h = f[l], q = (q || b)[h], u = (u || a)[h] = q; | ||
h = f[l], u = (u || b)[h], q = (q || a)[h] = u; | ||
} | ||
@@ -573,0 +573,0 @@ } |
@@ -10,7 +10,19 @@ declare module "flexsearch" { | ||
init(options: CreateOptions); | ||
add(id: number, o: T); | ||
search(query: string, options: number | SearchOptions, callback: (results: SearchResults<T>) => void): void; | ||
search(query: string, options?: number | SearchOptions): Promise<SearchResults<T>>; | ||
search(options: SearchOptions & {query: string}, callback: (results: SearchResults<T>) => void): void; | ||
search(options: SearchOptions & {query: string}): Promise<SearchResults<T>>; | ||
info(); | ||
add(o: T); | ||
add(id: number, o: string); | ||
// Result without pagination -> T[] | ||
search(query: string, options: number | SearchOptions, callback: (results: T[]) => void): void; | ||
search(query: string, options?: number | SearchOptions): Promise<T[]>; | ||
search(options: SearchOptions & {query: string}, callback: (results: T[]) => void): void; | ||
search(options: SearchOptions & {query: string}): Promise<T[]>; | ||
// Result with pagination -> SearchResults<T> | ||
search(query: string, options: number | SearchOptions & { page?: boolean | Cursor}, callback: (results: SearchResults<T>) => void): void; | ||
search(query: string, options?: number | SearchOptions & { page?: boolean | Cursor}): Promise<SearchResults<T>>; | ||
search(options: SearchOptions & {query: string, page?: boolean | Cursor}, callback: (results: SearchResults<T>) => void): void; | ||
search(options: SearchOptions & {query: string, page?: boolean | Cursor}): Promise<SearchResults<T>>; | ||
update(id: number, o: T); | ||
@@ -21,3 +33,4 @@ remove(id: number); | ||
addMatcher(matcher: Matcher); | ||
where(whereFn: (o: T) => boolean): SearchResult<T>[]; | ||
where(whereFn: (o: T) => boolean): T[]; | ||
where(whereObj: {[key: string]: string}); | ||
@@ -30,19 +43,22 @@ encode(str: string): string; | ||
interface SearchOptions { | ||
limit?: number, | ||
suggest?: boolean, | ||
where?: {[key: string]: string}, | ||
field?: string | string[], | ||
bool?: "and" | "or" | "not" | ||
page?: boolean | Cursor; | ||
//TODO: Sorting | ||
limit?: number, | ||
suggest?: boolean, | ||
where?: {[key: string]: string}, | ||
field?: string | string[], | ||
bool?: "and" | "or" | "not" | ||
//TODO: Sorting | ||
} | ||
interface SearchResults<T> { | ||
page?: Cursor, | ||
next?: Cursor, | ||
result: SearchResult[] | ||
page?: Cursor, | ||
next?: Cursor, | ||
result: T[] | ||
} | ||
type SearchResult = number; | ||
interface Document { | ||
id: string; | ||
field: any; | ||
} | ||
export type CreateOptions = { | ||
@@ -62,2 +78,3 @@ profile?: IndexProfile; | ||
rtl?: boolean; | ||
doc?: Document; | ||
}; | ||
@@ -83,3 +100,3 @@ | ||
export default class FlexSearch { | ||
static create(options?: CreateOptions): Index; | ||
static create<T>(options?: CreateOptions): Index<T>; | ||
static registerMatcher(matcher: Matcher); | ||
@@ -86,0 +103,0 @@ static registerEncoder(name: string, encoder: EncoderFn); |
{ | ||
"name": "flexsearch", | ||
"version": "0.6.30", | ||
"version": "0.6.32", | ||
"description": "Next-Generation full text search library with zero dependencies.", | ||
@@ -71,3 +71,3 @@ "homepage": "https://github.com/nextapps-de/flexsearch/", | ||
"coveralls": "^3.0.5", | ||
"google-closure-compiler": "^20190723.0.0-nightly", | ||
"google-closure-compiler": "^20190819.0.0", | ||
"mocha": "^6.2.0", | ||
@@ -74,0 +74,0 @@ "mocha-lcov-reporter": "^1.3.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
509976
7192
2879