diff --git a/dist/flexsearch.bundle.debug.js b/dist/flexsearch.bundle.debug.js new file mode 100644 index 0000000..e196a0e --- /dev/null +++ b/dist/flexsearch.bundle.debug.js @@ -0,0 +1,979 @@ +/**! + * FlexSearch.js v0.7.39 (Bundle) + * Author and Copyright: Thomas Wilkerling + * Licence: Apache-2.0 + * Hosted by Nextapps GmbH + * https://github.com/nextapps-de/flexsearch + */ +(function _factory(self){'use strict'; +var t; +function u(a) { + return "undefined" !== typeof a ? a : !0; +} +function aa(a) { + const b = Array(a); + for (let c = 0; c < a; c++) { + b[c] = v(); + } + return b; +} +function v() { + return Object.create(null); +} +function ba(a, b) { + return b.length - a.length; +} +function x(a) { + return "string" === typeof a; +} +function C(a) { + return "object" === typeof a; +} +function D(a) { + return "function" === typeof a; +} +;function ca(a, b) { + var c = da; + if (a && (b && (a = E(a, b)), this.H && (a = E(a, this.H)), this.J && 1 < a.length && (a = E(a, this.J)), c || "" === c)) { + b = a.split(c); + if (this.filter) { + a = this.filter; + c = b.length; + const d = []; + for (let e = 0, f = 0; e < c; e++) { + const h = b[e]; + h && !a[h] && (d[f++] = h); + } + a = d; + } else { + a = b; + } + return a; + } + return a; +} +const da = /[\p{Z}\p{S}\p{P}\p{C}]+/u, ea = /[\u0300-\u036f]/g; +function fa(a, b) { + const c = Object.keys(a), d = c.length, e = []; + let f = "", h = 0; + for (let g = 0, k, m; g < d; g++) { + k = c[g], (m = a[k]) ? (e[h++] = F(b ? "(?!\\b)" + k + "(\\b|_)" : k), e[h++] = m) : f += (f ? "|" : "") + k; + } + f && (e[h++] = F(b ? "(?!\\b)(" + f + ")(\\b|_)" : "(" + f + ")"), e[h] = ""); + return e; +} +function E(a, b) { + for (let c = 0, d = b.length; c < d && (a = a.replace(b[c], b[c + 1]), a); c += 2) { + } + return a; +} +function F(a) { + return new RegExp(a, "g"); +} +function ha(a) { + let b = "", c = ""; + for (let d = 0, e = a.length, f; d < e; d++) { + (f = a[d]) !== c && (b += c = f); + } + return b; +} +;var ja = {encode:ia, F:!1, G:""}; +function ia(a) { + return ca.call(this, ("" + a).toLowerCase(), !1); +} +;const ka = {}, G = {}; +function la(a) { + I(a, "add"); + I(a, "append"); + I(a, "search"); + I(a, "update"); + I(a, "remove"); +} +function I(a, b) { + a[b + "Async"] = function() { + const c = this, d = arguments; + var e = d[d.length - 1]; + let f; + D(e) && (f = e, delete d[d.length - 1]); + e = new Promise(function(h) { + setTimeout(function() { + c.async = !0; + const g = c[b].apply(c, d); + c.async = !1; + h(g); + }); + }); + return f ? (e.then(f), this) : e; + }; +} +;function ma(a, b, c, d) { + const e = a.length; + let f = [], h, g, k = 0; + d && (d = []); + for (let m = e - 1; 0 <= m; m--) { + const n = a[m], w = n.length, q = v(); + let r = !h; + for (let l = 0; l < w; l++) { + const p = n[l], A = p.length; + if (A) { + for (let B = 0, z, y; B < A; B++) { + if (y = p[B], h) { + if (h[y]) { + if (!m) { + if (c) { + c--; + } else { + if (f[k++] = y, k === b) { + return f; + } + } + } + if (m || d) { + q[y] = 1; + } + r = !0; + } + if (d && (z = (g[y] || 0) + 1, g[y] = z, z < e)) { + const H = d[z - 2] || (d[z - 2] = []); + H[H.length] = y; + } + } else { + q[y] = 1; + } + } + } + } + if (d) { + h || (g = q); + } else if (!r) { + return []; + } + h = q; + } + if (d) { + for (let m = d.length - 1, n, w; 0 <= m; m--) { + n = d[m]; + w = n.length; + for (let q = 0, r; q < w; q++) { + if (r = n[q], !h[r]) { + if (c) { + c--; + } else { + if (f[k++] = r, k === b) { + return f; + } + } + h[r] = 1; + } + } + } + } + return f; +} +function na(a, b) { + const c = v(), d = v(), e = []; + for (let f = 0; f < a.length; f++) { + c[a[f]] = 1; + } + for (let f = 0, h; f < b.length; f++) { + h = b[f]; + for (let g = 0, k; g < h.length; g++) { + k = h[g], c[k] && !d[k] && (d[k] = 1, e[e.length] = k); + } + } + return e; +} +;function J(a) { + this.l = !0 !== a && a; + this.cache = v(); + this.h = []; +} +function oa(a, b, c) { + C(a) && (a = a.query); + let d = this.cache.get(a); + d || (d = this.search(a, b, c), this.cache.set(a, d)); + return d; +} +J.prototype.set = function(a, b) { + if (!this.cache[a]) { + var c = this.h.length; + c === this.l ? delete this.cache[this.h[c - 1]] : c++; + for (--c; 0 < c; c--) { + this.h[c] = this.h[c - 1]; + } + this.h[0] = a; + } + this.cache[a] = b; +}; +J.prototype.get = function(a) { + const b = this.cache[a]; + if (this.l && b && (a = this.h.indexOf(a))) { + const c = this.h[a - 1]; + this.h[a - 1] = this.h[a]; + this.h[a] = c; + } + return b; +}; +const pa = {memory:{charset:"latin:extra", D:3, B:4, m:!1}, performance:{D:3, B:3, s:!1, context:{depth:2, D:1}}, match:{charset:"latin:extra", G:"reverse"}, score:{charset:"latin:advanced", D:20, B:3, context:{depth:3, D:9}}, "default":{}}; +function ra(a, b, c, d, e, f, h, g) { + setTimeout(function() { + const k = a(c ? c + "." + d : d, JSON.stringify(h)); + k && k.then ? k.then(function() { + b.export(a, b, c, e, f + 1, g); + }) : b.export(a, b, c, e, f + 1, g); + }); +} +;function K(a, b) { + if (!(this instanceof K)) { + return new K(a); + } + var c; + if (a) { + if (x(a)) { + pa[a] || console.warn("Preset not found: " + a), a = pa[a]; + } else { + if (c = a.preset) { + c[c] || console.warn("Preset not found: " + c), a = Object.assign({}, c[c], a); + } + } + c = a.charset; + var d = a.lang; + x(c) && (-1 === c.indexOf(":") && (c += ":default"), c = G[c]); + x(d) && (d = ka[d]); + } else { + a = {}; + } + let e, f, h = a.context || {}; + this.encode = a.encode || c && c.encode || ia; + this.register = b || v(); + this.D = e = a.resolution || 9; + this.G = b = c && c.G || a.tokenize || "strict"; + this.depth = "strict" === b && h.depth; + this.l = u(h.bidirectional); + this.s = f = u(a.optimize); + this.m = u(a.fastupdate); + this.B = a.minlength || 1; + this.C = a.boost; + this.map = f ? aa(e) : v(); + this.A = e = h.resolution || 1; + this.h = f ? aa(e) : v(); + this.F = c && c.F || a.rtl; + this.H = (b = a.matcher || d && d.H) && fa(b, !1); + this.J = (b = a.stemmer || d && d.J) && fa(b, !0); + if (c = b = a.filter || d && d.filter) { + c = b; + d = v(); + for (let g = 0, k = c.length; g < k; g++) { + d[c[g]] = 1; + } + c = d; + } + this.filter = c; + this.cache = (b = a.cache) && new J(b); +} +t = K.prototype; +t.append = function(a, b) { + return this.add(a, b, !0); +}; +t.add = function(a, b, c, d) { + if (b && (a || 0 === a)) { + if (!d && !c && this.register[a]) { + return this.update(a, b); + } + b = this.encode(b); + if (d = b.length) { + const m = v(), n = v(), w = this.depth, q = this.D; + for (let r = 0; r < d; r++) { + let l = b[this.F ? d - 1 - r : r]; + var e = l.length; + if (l && e >= this.B && (w || !n[l])) { + var f = L(q, d, r), h = ""; + switch(this.G) { + case "full": + if (2 < e) { + for (f = 0; f < e; f++) { + for (var g = e; g > f; g--) { + if (g - f >= this.B) { + var k = L(q, d, r, e, f); + h = l.substring(f, g); + M(this, n, h, k, a, c); + } + } + } + break; + } + case "reverse": + if (1 < e) { + for (g = e - 1; 0 < g; g--) { + h = l[g] + h, h.length >= this.B && M(this, n, h, L(q, d, r, e, g), a, c); + } + h = ""; + } + case "forward": + if (1 < e) { + for (g = 0; g < e; g++) { + h += l[g], h.length >= this.B && M(this, n, h, f, a, c); + } + break; + } + default: + if (this.C && (f = Math.min(f / this.C(b, l, r) | 0, q - 1)), M(this, n, l, f, a, c), w && 1 < d && r < d - 1) { + for (e = v(), h = this.A, f = l, g = Math.min(w + 1, d - r), e[f] = 1, k = 1; k < g; k++) { + if ((l = b[this.F ? d - 1 - r - k : r + k]) && l.length >= this.B && !e[l]) { + e[l] = 1; + const p = this.l && l > f; + M(this, m, p ? f : l, L(h + (d / 2 > h ? 0 : 1), d, r, g - 1, k - 1), a, c, p ? l : f); + } + } + } + } + } + } + this.m || (this.register[a] = 1); + } + } + return this; +}; +function L(a, b, c, d, e) { + return c && 1 < a ? b + (d || 0) <= a ? c + (e || 0) : (a - 1) / (b + (d || 0)) * (c + (e || 0)) + 1 | 0 : 0; +} +function M(a, b, c, d, e, f, h) { + let g = h ? a.h : a.map; + if (!b[c] || h && !b[c][h]) { + a.s && (g = g[d]), h ? (b = b[c] || (b[c] = v()), b[h] = 1, g = g[h] || (g[h] = v())) : b[c] = 1, g = g[c] || (g[c] = []), a.s || (g = g[d] || (g[d] = [])), f && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g)); + } +} +t.search = function(a, b, c) { + c || (!b && C(a) ? (c = a, a = c.query) : C(b) && (c = b)); + let d = [], e; + let f, h = 0; + if (c) { + a = c.query || a; + b = c.limit; + h = c.offset || 0; + var g = c.context; + f = c.suggest; + } + if (a && (a = this.encode("" + a), e = a.length, 1 < e)) { + c = v(); + var k = []; + for (let n = 0, w = 0, q; n < e; n++) { + if ((q = a[n]) && q.length >= this.B && !c[q]) { + if (this.s || f || this.map[q]) { + k[w++] = q, c[q] = 1; + } else { + return d; + } + } + } + a = k; + e = a.length; + } + if (!e) { + return d; + } + b || (b = 100); + g = this.depth && 1 < e && !1 !== g; + c = 0; + let m; + g ? (m = a[0], c = 1) : 1 < e && a.sort(ba); + for (let n, w; c < e; c++) { + w = a[c]; + g ? (n = sa(this, d, f, b, h, 2 === e, w, m), f && !1 === n && d.length || (m = w)) : n = sa(this, d, f, b, h, 1 === e, w); + if (n) { + return n; + } + if (f && c === e - 1) { + k = d.length; + if (!k) { + if (g) { + g = 0; + c = -1; + continue; + } + return d; + } + if (1 === k) { + return ta(d[0], b, h); + } + } + } + return ma(d, b, h, f); +}; +function sa(a, b, c, d, e, f, h, g) { + let k = [], m = g ? a.h : a.map; + a.s || (m = ua(m, h, g, a.l)); + if (m) { + let n = 0; + const w = Math.min(m.length, g ? a.A : a.D); + for (let q = 0, r = 0, l, p; q < w; q++) { + if (l = m[q]) { + if (a.s && (l = ua(l, h, g, a.l)), e && l && f && (p = l.length, p <= e ? (e -= p, l = null) : (l = l.slice(e), e = 0)), l && (k[n++] = l, f && (r += l.length, r >= d))) { + break; + } + } + } + if (n) { + if (f) { + return ta(k, d, 0); + } + b[b.length] = k; + return; + } + } + return !c && k; +} +function ta(a, b, c) { + a = 1 === a.length ? a[0] : [].concat.apply([], a); + return c || a.length > b ? a.slice(c, c + b) : a; +} +function ua(a, b, c, d) { + c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b]; + return a; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a, b) { + const c = this.register[a]; + if (c) { + if (this.m) { + for (let d = 0, e; d < c.length; d++) { + e = c[d], e.splice(e.indexOf(a), 1); + } + } else { + N(this.map, a, this.D, this.s), this.depth && N(this.h, a, this.A, this.s); + } + b || delete this.register[a]; + if (this.cache) { + b = this.cache; + for (let d = 0, e, f; d < b.h.length; d++) { + f = b.h[d], e = b.cache[f], e.includes(a) && (b.h.splice(d--, 1), delete b.cache[f]); + } + } + } + return this; +}; +function N(a, b, c, d, e) { + let f = 0; + if (a.constructor === Array) { + if (e) { + b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), f++) : f++; + } else { + e = Math.min(a.length, c); + for (let h = 0, g; h < e; h++) { + if (g = a[h]) { + f = N(g, b, c, d, e), d || f || delete a[h]; + } + } + } + } else { + for (let h in a) { + (f = N(a[h], b, c, d, e)) || delete a[h]; + } + } + return f; +} +t.searchCache = oa; +t.export = function(a, b, c, d, e, f) { + let h = !0; + "undefined" === typeof f && (h = new Promise(m => { + f = m; + })); + let g, k; + switch(e || (e = 0)) { + case 0: + g = "reg"; + if (this.m) { + k = v(); + for (let m in this.register) { + k[m] = 1; + } + } else { + k = this.register; + } + break; + case 1: + g = "cfg"; + k = {doc:0, opt:this.s ? 1 : 0}; + break; + case 2: + g = "map"; + k = this.map; + break; + case 3: + g = "ctx"; + k = this.h; + break; + default: + "undefined" === typeof c && f && f(); + return; + } + ra(a, b || this, c, g, d, e, k, f); + return h; +}; +t.import = function(a, b) { + if (b) { + switch(x(b) && (b = JSON.parse(b)), a) { + case "cfg": + this.s = !!b.opt; + break; + case "reg": + this.m = !1; + this.register = b; + break; + case "map": + this.map = b; + break; + case "ctx": + this.h = b; + } + } +}; +la(K.prototype); +function va(a) { + a = a.data; + var b = self._index; + const c = a.args; + var d = a.task; + switch(d) { + case "init": + d = a.options || {}; + a = a.factory; + b = d.encode; + d.cache = !1; + b && 0 === b.indexOf("function") && (d.encode = Function("return " + b)()); + a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new K(d); + break; + default: + a = a.id, b = b[d].apply(b, c), postMessage("search" === d ? {id:a, msg:b} : {id:a}); + } +} +;let wa = 0; +function O(a) { + if (!(this instanceof O)) { + return new O(a); + } + var b; + a ? D(b = a.encode) && (a.encode = b.toString()) : a = {}; + (b = (self || window)._factory) && (b = b.toString()); + const c = "undefined" === typeof window && self.exports, d = this; + this.o = xa(b, c, a.worker); + this.h = v(); + if (this.o) { + if (c) { + this.o.on("message", function(e) { + d.h[e.id](e.msg); + delete d.h[e.id]; + }); + } else { + this.o.onmessage = function(e) { + e = e.data; + d.h[e.id](e.msg); + delete d.h[e.id]; + }; + } + this.o.postMessage({task:"init", factory:b, options:a}); + } +} +P("add"); +P("append"); +P("search"); +P("update"); +P("remove"); +function P(a) { + O.prototype[a] = O.prototype[a + "Async"] = function() { + const b = this, c = [].slice.call(arguments); + var d = c[c.length - 1]; + let e; + D(d) && (e = d, c.splice(c.length - 1, 1)); + d = new Promise(function(f) { + setTimeout(function() { + b.h[++wa] = f; + b.o.postMessage({task:a, id:wa, args:c}); + }); + }); + return e ? (d.then(e), this) : d; + }; +} +function xa(a, b, c) { + let d; + try { + d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + va.toString()], {type:"text/javascript"}))) : new Worker(x(c) ? c : "worker/worker.js", {type:"module"}); + } catch (e) { + } + return d; +} +;function Q(a) { + if (!(this instanceof Q)) { + return new Q(a); + } + var b = a.document || a.doc || a, c; + this.K = []; + this.h = []; + this.A = []; + this.register = v(); + this.key = (c = b.key || b.id) && S(c, this.A) || "id"; + this.m = u(a.fastupdate); + this.C = (c = b.store) && !0 !== c && []; + this.store = c && v(); + this.I = (c = b.tag) && S(c, this.A); + this.l = c && v(); + this.cache = (c = a.cache) && new J(c); + a.cache = !1; + this.o = a.worker; + this.async = !1; + c = v(); + let d = b.index || b.field || b; + x(d) && (d = [d]); + for (let e = 0, f, h; e < d.length; e++) { + f = d[e], x(f) || (h = f, f = f.field), h = C(h) ? Object.assign({}, a, h) : a, this.o && (c[f] = new O(h), c[f].o || (this.o = !1)), this.o || (c[f] = new K(h, this.register)), this.K[e] = S(f, this.A), this.h[e] = f; + } + if (this.C) { + for (a = b.store, x(a) && (a = [a]), b = 0; b < a.length; b++) { + this.C[b] = S(a[b], this.A); + } + } + this.index = c; +} +function S(a, b) { + const c = a.split(":"); + let d = 0; + for (let e = 0; e < c.length; e++) { + a = c[e], 0 <= a.indexOf("[]") && (a = a.substring(0, a.length - 2)) && (b[d] = !0), a && (c[d++] = a); + } + d < c.length && (c.length = d); + return 1 < d ? c : c[0]; +} +function T(a, b) { + if (x(b)) { + a = a[b]; + } else { + for (let c = 0; a && c < b.length; c++) { + a = a[b[c]]; + } + } + return a; +} +function U(a, b, c, d, e) { + a = a[e]; + if (d === c.length - 1) { + b[e] = a; + } else if (a) { + if (a.constructor === Array) { + for (b = b[e] = Array(a.length), e = 0; e < a.length; e++) { + U(a, b, c, d, e); + } + } else { + b = b[e] || (b[e] = v()), e = c[++d], U(a, b, c, d, e); + } + } +} +function V(a, b, c, d, e, f, h, g) { + if (a = a[h]) { + if (d === b.length - 1) { + if (a.constructor === Array) { + if (c[d]) { + for (b = 0; b < a.length; b++) { + e.add(f, a[b], !0, !0); + } + return; + } + a = a.join(" "); + } + e.add(f, a, g, !0); + } else { + if (a.constructor === Array) { + for (h = 0; h < a.length; h++) { + V(a, b, c, d, e, f, h, g); + } + } else { + h = b[++d], V(a, b, c, d, e, f, h, g); + } + } + } +} +t = Q.prototype; +t.add = function(a, b, c) { + C(a) && (b = a, a = T(b, this.key)); + if (b && (a || 0 === a)) { + if (!c && this.register[a]) { + return this.update(a, b); + } + for (let d = 0, e, f; d < this.h.length; d++) { + f = this.h[d], e = this.K[d], x(e) && (e = [e]), V(b, e, this.A, 0, this.index[f], a, e[0], c); + } + if (this.I) { + let d = T(b, this.I), e = v(); + x(d) && (d = [d]); + for (let f = 0, h, g; f < d.length; f++) { + if (h = d[f], !e[h] && (e[h] = 1, g = this.l[h] || (this.l[h] = []), !c || !g.includes(a))) { + if (g[g.length] = a, this.m) { + const k = this.register[a] || (this.register[a] = []); + k[k.length] = g; + } + } + } + } + if (this.store && (!c || !this.store[a])) { + let d; + if (this.C) { + d = v(); + for (let e = 0, f; e < this.C.length; e++) { + f = this.C[e], x(f) ? d[f] = b[f] : U(b, d, f, 0, f[0]); + } + } + this.store[a] = d || b; + } + } + return this; +}; +t.append = function(a, b) { + return this.add(a, b, !0); +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a) { + C(a) && (a = T(a, this.key)); + if (this.register[a]) { + for (var b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.o), !this.m); b++) { + } + if (this.I && !this.m) { + for (let c in this.l) { + b = this.l[c]; + const d = b.indexOf(a); + -1 !== d && (1 < b.length ? b.splice(d, 1) : delete this.l[c]); + } + } + this.store && delete this.store[a]; + delete this.register[a]; + } + return this; +}; +t.search = function(a, b, c, d) { + c || (!b && C(a) ? (c = a, a = "") : C(b) && (c = b, b = 0)); + let e = [], f = [], h, g, k, m, n, w, q = 0; + if (c) { + if (c.constructor === Array) { + k = c, c = null; + } else { + a = c.query || a; + k = (h = c.pluck) || c.index || c.field; + m = c.tag; + g = this.store && c.enrich; + n = "and" === c.bool; + b = c.limit || b || 100; + w = c.offset || 0; + if (m && (x(m) && (m = [m]), !a)) { + for (let l = 0, p; l < m.length; l++) { + if (p = ya.call(this, m[l], b, w, g)) { + e[e.length] = p, q++; + } + } + return q ? e : []; + } + x(k) && (k = [k]); + } + } + k || (k = this.h); + n = n && (1 < k.length || m && 1 < m.length); + const r = !d && (this.o || this.async) && []; + for (let l = 0, p, A, B; l < k.length; l++) { + let z; + A = k[l]; + x(A) || (z = A, A = z.field, a = z.query || a, b = z.limit || b, g = z.enrich || g); + if (r) { + r[l] = this.index[A].searchAsync(a, b, z || c); + } else { + d ? p = d[l] : p = this.index[A].search(a, b, z || c); + B = p && p.length; + if (m && B) { + const y = []; + let H = 0; + n && (y[0] = [p]); + for (let X = 0, qa, R; X < m.length; X++) { + if (qa = m[X], B = (R = this.l[qa]) && R.length) { + H++, y[y.length] = n ? [R] : R; + } + } + H && (p = n ? ma(y, b || 100, w || 0) : na(p, y), B = p.length); + } + if (B) { + f[q] = A, e[q++] = p; + } else if (n) { + return []; + } + } + } + if (r) { + const l = this; + return new Promise(function(p) { + Promise.all(r).then(function(A) { + p(l.search(a, b, c, A)); + }); + }); + } + if (!q) { + return []; + } + if (h && (!g || !this.store)) { + return e[0]; + } + for (let l = 0, p; l < f.length; l++) { + p = e[l]; + p.length && g && (p = za.call(this, p)); + if (h) { + return p; + } + e[l] = {field:f[l], result:p}; + } + return e; +}; +function ya(a, b, c, d) { + let e = this.l[a], f = e && e.length - c; + if (f && 0 < f) { + if (f > b || c) { + e = e.slice(c, c + b); + } + d && (e = za.call(this, e)); + return {tag:a, result:e}; + } +} +function za(a) { + const b = Array(a.length); + for (let c = 0, d; c < a.length; c++) { + d = a[c], b[c] = {id:d, doc:this.store[d]}; + } + return b; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.get = function(a) { + return this.store[a]; +}; +t.set = function(a, b) { + this.store[a] = b; + return this; +}; +t.searchCache = oa; +t.export = function(a, b, c, d, e, f) { + let h; + "undefined" === typeof f && (h = new Promise(g => { + f = g; + })); + e || (e = 0); + d || (d = 0); + if (d < this.h.length) { + const g = this.h[d], k = this.index[g]; + b = this; + setTimeout(function() { + k.export(a, b, e ? g : "", d, e++, f) || (d++, e = 1, b.export(a, b, g, d, e, f)); + }); + } else { + let g, k; + switch(e) { + case 1: + g = "tag"; + k = this.l; + c = null; + break; + case 2: + g = "store"; + k = this.store; + c = null; + break; + default: + f(); + return; + } + ra(a, this, c, g, d, e, k, f); + } + return h; +}; +t.import = function(a, b) { + if (b) { + switch(x(b) && (b = JSON.parse(b)), a) { + case "tag": + this.l = b; + break; + case "reg": + this.m = !1; + this.register = b; + for (let d = 0, e; d < this.h.length; d++) { + e = this.index[this.h[d]], e.register = b, e.m = !1; + } + break; + case "store": + this.store = b; + break; + default: + a = a.split("."); + const c = a[0]; + a = a[1]; + c && a && this.index[c].import(a, b); + } + } +}; +la(Q.prototype); +var Ba = {encode:Aa, F:!1, G:""}; +const Ca = [F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", F("[\u00e8\u00e9\u00ea\u00eb]"), "e", F("[\u00ec\u00ed\u00ee\u00ef]"), "i", F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", F("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", F("[\u00fd\u0177\u00ff]"), "y", F("\u00f1"), "n", F("[\u00e7c]"), "k", F("\u00df"), "s", F(" & "), " and "]; +function Aa(a) { + var b = a = "" + a; + b.normalize && (b = b.normalize("NFD").replace(ea, "")); + return ca.call(this, b.toLowerCase(), !a.normalize && Ca); +} +;var Ea = {encode:Da, F:!1, G:"strict"}; +const Fa = /[^a-z0-9]+/, Ga = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"}; +function Da(a) { + a = Aa.call(this, a).join(" "); + const b = []; + if (a) { + const c = a.split(Fa), d = c.length; + for (let e = 0, f, h = 0; e < d; e++) { + if ((a = c[e]) && (!this.filter || !this.filter[a])) { + f = a[0]; + let g = Ga[f] || f, k = g; + for (let m = 1; m < a.length; m++) { + f = a[m]; + const n = Ga[f] || f; + n && n !== k && (g += n, k = n); + } + b[h++] = g; + } + } + } + return b; +} +;var Ia = {encode:Ha, F:!1, G:""}; +const Ja = [F("ae"), "a", F("oe"), "o", F("sh"), "s", F("th"), "t", F("ph"), "f", F("pf"), "f", F("(?![aeo])h(?![aeo])"), "", F("(?!^[aeo])h(?!^[aeo])"), ""]; +function Ha(a, b) { + a && (a = Da.call(this, a).join(" "), 2 < a.length && (a = E(a, Ja)), b || (1 < a.length && (a = ha(a)), a && (a = a.split(" ")))); + return a || []; +} +;var La = {encode:Ka, F:!1, G:""}; +const Ma = F("(?!\\b)[aeo]"); +function Ka(a) { + a && (a = Ha.call(this, a, !0), 1 < a.length && (a = a.replace(Ma, "")), 1 < a.length && (a = ha(a)), a && (a = a.split(" "))); + return a || []; +} +;G["latin:default"] = ja; +G["latin:simple"] = Ba; +G["latin:balance"] = Ea; +G["latin:advanced"] = Ia; +G["latin:extra"] = La; +const W = self; +let Y; +const Z = {Index:K, Document:Q, Worker:O, registerCharset:function(a, b) { + G[a] = b; +}, registerLanguage:function(a, b) { + ka[a] = b; +}}; +(Y = W.define) && Y.amd ? Y([], function() { + return Z; +}) : W.exports ? W.exports = Z : W.FlexSearch = Z; +}(this)); diff --git a/dist/flexsearch.bundle.js b/dist/flexsearch.bundle.js deleted file mode 100644 index 0648f94..0000000 --- a/dist/flexsearch.bundle.js +++ /dev/null @@ -1,33 +0,0 @@ -/**! - * FlexSearch.js v0.7.31 (Bundle) - * Author and Copyright: Thomas Wilkerling - * Licence: Apache-2.0 - * Hosted by Nextapps GmbH - * https://github.com/nextapps-de/flexsearch - */ -(function _f(self){'use strict';try{if(module)self=module}catch(e){}self._factory=_f;var t;function u(a){return"undefined"!==typeof a?a:!0}function aa(a){const b=Array(a);for(let c=0;c=this.B&&(w||!n[l])){var f=L(q,d,r),g="";switch(this.G){case "full":if(2f;h--)if(h-f>=this.B){var k=L(q,d,r,e,f);g=l.substring(f,h);M(this,n,g,k,a,c)}break}case "reverse":if(1=this.B&&M(this,n, -g,L(q,d,r,e,h),a,c);g=""}case "forward":if(1=this.B&&M(this,n,g,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),M(this,n,l,f,a,c),w&&1=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;M(this,m,p?f:l,L(g+(d/2>g?0:1),d,r,h-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this}; -function L(a,b,c,d,e){return c&&1=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);h=this.depth&&1=d)))break;if(n){if(f)return ta(k,d,0);b[b.length]=k;return}}return!c&&k}function ta(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} -function ua(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)}; -t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;db||c)e=e.slice(c,c+b);d&&(e=za.call(this,e));return{tag:a,result:e}}}function za(a){const b=Array(a.length);for(let c=0,d;c=this.B&&(w||!n[l])){var f=L(q,d,r),h="";switch(this.G){case "full":if(2f;g--)if(g-f>=this.B){var k=L(q,d,r,e,f);h=l.substring(f,g);M(this,n,h,k,a,c)}break}case "reverse":if(1=this.B&&M(this,n, +h,L(q,d,r,e,g),a,c);h=""}case "forward":if(1=this.B&&M(this,n,h,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),M(this,n,l,f,a,c),w&&1=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;M(this,m,p?f:l,L(h+(d/2>h?0:1),d,r,g-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this}; +function L(a,b,c,d,e){return c&&1=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);g=this.depth&&1=d)))break;if(n){if(f)return ta(k,d,0);b[b.length]=k;return}}return!c&&k}function ta(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} +function ua(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)}; +t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=v();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}ra(a,b||this,c,g,d,e,k,f);return h}; +t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};la(K.prototype);function va(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new K(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let wa=0;function O(a){if(!(this instanceof O))return new O(a);var b;a?D(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=xa(b,c,a.worker);this.h=v();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}P("add");P("append");P("search"); +P("update");P("remove");function P(a){O.prototype[a]=O.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;D(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++wa]=f;b.o.postMessage({task:a,id:wa,args:c})})});return e?(d.then(e),this):d}} +function xa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+va.toString()],{type:"text/javascript"}))):new Worker(x(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function Q(a){if(!(this instanceof Q))return new Q(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=v();this.key=(c=b.key||b.id)&&S(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&v();this.I=(c=b.tag)&&S(c,this.A);this.l=c&&v();this.cache=(c=a.cache)&&new J(c);a.cache=!1;this.o=a.worker;this.async=!1;c=v();let d=b.index||b.field||b;x(d)&&(d=[d]);for(let e=0,f,h;eb||c)e=e.slice(c,c+b);d&&(e=za.call(this,e));return{tag:a,result:e}}}function za(a){const b=Array(a.length);for(let c=0,d;c{f=g}));e||(e=0);d||(d=0);if(d= this.B && (w || !n[l])) { + var f = L(q, d, r), h = ""; + switch(this.G) { + case "full": + if (2 < e) { + for (f = 0; f < e; f++) { + for (var g = e; g > f; g--) { + if (g - f >= this.B) { + var k = L(q, d, r, e, f); + h = l.substring(f, g); + M(this, n, h, k, a, c); + } + } + } + break; + } + case "reverse": + if (1 < e) { + for (g = e - 1; 0 < g; g--) { + h = l[g] + h, h.length >= this.B && M(this, n, h, L(q, d, r, e, g), a, c); + } + h = ""; + } + case "forward": + if (1 < e) { + for (g = 0; g < e; g++) { + h += l[g], h.length >= this.B && M(this, n, h, f, a, c); + } + break; + } + default: + if (this.C && (f = Math.min(f / this.C(b, l, r) | 0, q - 1)), M(this, n, l, f, a, c), w && 1 < d && r < d - 1) { + for (e = v(), h = this.A, f = l, g = Math.min(w + 1, d - r), e[f] = 1, k = 1; k < g; k++) { + if ((l = b[this.F ? d - 1 - r - k : r + k]) && l.length >= this.B && !e[l]) { + e[l] = 1; + const p = this.l && l > f; + M(this, m, p ? f : l, L(h + (d / 2 > h ? 0 : 1), d, r, g - 1, k - 1), a, c, p ? l : f); + } + } + } + } + } + } + this.m || (this.register[a] = 1); + } + } + return this; +}; +function L(a, b, c, d, e) { + return c && 1 < a ? b + (d || 0) <= a ? c + (e || 0) : (a - 1) / (b + (d || 0)) * (c + (e || 0)) + 1 | 0 : 0; +} +function M(a, b, c, d, e, f, h) { + let g = h ? a.h : a.map; + if (!b[c] || h && !b[c][h]) { + a.s && (g = g[d]), h ? (b = b[c] || (b[c] = v()), b[h] = 1, g = g[h] || (g[h] = v())) : b[c] = 1, g = g[c] || (g[c] = []), a.s || (g = g[d] || (g[d] = [])), f && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g)); + } +} +t.search = function(a, b, c) { + c || (!b && C(a) ? (c = a, a = c.query) : C(b) && (c = b)); + let d = [], e; + let f, h = 0; + if (c) { + a = c.query || a; + b = c.limit; + h = c.offset || 0; + var g = c.context; + f = c.suggest; + } + if (a && (a = this.encode("" + a), e = a.length, 1 < e)) { + c = v(); + var k = []; + for (let n = 0, w = 0, q; n < e; n++) { + if ((q = a[n]) && q.length >= this.B && !c[q]) { + if (this.s || f || this.map[q]) { + k[w++] = q, c[q] = 1; + } else { + return d; + } + } + } + a = k; + e = a.length; + } + if (!e) { + return d; + } + b || (b = 100); + g = this.depth && 1 < e && !1 !== g; + c = 0; + let m; + g ? (m = a[0], c = 1) : 1 < e && a.sort(ba); + for (let n, w; c < e; c++) { + w = a[c]; + g ? (n = sa(this, d, f, b, h, 2 === e, w, m), f && !1 === n && d.length || (m = w)) : n = sa(this, d, f, b, h, 1 === e, w); + if (n) { + return n; + } + if (f && c === e - 1) { + k = d.length; + if (!k) { + if (g) { + g = 0; + c = -1; + continue; + } + return d; + } + if (1 === k) { + return ta(d[0], b, h); + } + } + } + return ma(d, b, h, f); +}; +function sa(a, b, c, d, e, f, h, g) { + let k = [], m = g ? a.h : a.map; + a.s || (m = ua(m, h, g, a.l)); + if (m) { + let n = 0; + const w = Math.min(m.length, g ? a.A : a.D); + for (let q = 0, r = 0, l, p; q < w; q++) { + if (l = m[q]) { + if (a.s && (l = ua(l, h, g, a.l)), e && l && f && (p = l.length, p <= e ? (e -= p, l = null) : (l = l.slice(e), e = 0)), l && (k[n++] = l, f && (r += l.length, r >= d))) { + break; + } + } + } + if (n) { + if (f) { + return ta(k, d, 0); + } + b[b.length] = k; + return; + } + } + return !c && k; +} +function ta(a, b, c) { + a = 1 === a.length ? a[0] : [].concat.apply([], a); + return c || a.length > b ? a.slice(c, c + b) : a; +} +function ua(a, b, c, d) { + c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b]; + return a; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a, b) { + const c = this.register[a]; + if (c) { + if (this.m) { + for (let d = 0, e; d < c.length; d++) { + e = c[d], e.splice(e.indexOf(a), 1); + } + } else { + N(this.map, a, this.D, this.s), this.depth && N(this.h, a, this.A, this.s); + } + b || delete this.register[a]; + if (this.cache) { + b = this.cache; + for (let d = 0, e, f; d < b.h.length; d++) { + f = b.h[d], e = b.cache[f], e.includes(a) && (b.h.splice(d--, 1), delete b.cache[f]); + } + } + } + return this; +}; +function N(a, b, c, d, e) { + let f = 0; + if (a.constructor === Array) { + if (e) { + b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), f++) : f++; + } else { + e = Math.min(a.length, c); + for (let h = 0, g; h < e; h++) { + if (g = a[h]) { + f = N(g, b, c, d, e), d || f || delete a[h]; + } + } + } + } else { + for (let h in a) { + (f = N(a[h], b, c, d, e)) || delete a[h]; + } + } + return f; +} +t.searchCache = oa; +t.export = function(a, b, c, d, e, f) { + let h = !0; + "undefined" === typeof f && (h = new Promise(m => { + f = m; + })); + let g, k; + switch(e || (e = 0)) { + case 0: + g = "reg"; + if (this.m) { + k = v(); + for (let m in this.register) { + k[m] = 1; + } + } else { + k = this.register; + } + break; + case 1: + g = "cfg"; + k = {doc:0, opt:this.s ? 1 : 0}; + break; + case 2: + g = "map"; + k = this.map; + break; + case 3: + g = "ctx"; + k = this.h; + break; + default: + "undefined" === typeof c && f && f(); + return; + } + ra(a, b || this, c, g, d, e, k, f); + return h; +}; +t.import = function(a, b) { + if (b) { + switch(x(b) && (b = JSON.parse(b)), a) { + case "cfg": + this.s = !!b.opt; + break; + case "reg": + this.m = !1; + this.register = b; + break; + case "map": + this.map = b; + break; + case "ctx": + this.h = b; + } + } +}; +la(K.prototype); +function va(a) { + a = a.data; + var b = self._index; + const c = a.args; + var d = a.task; + switch(d) { + case "init": + d = a.options || {}; + a = a.factory; + b = d.encode; + d.cache = !1; + b && 0 === b.indexOf("function") && (d.encode = Function("return " + b)()); + a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new K(d); + break; + default: + a = a.id, b = b[d].apply(b, c), postMessage("search" === d ? {id:a, msg:b} : {id:a}); + } +} +;let wa = 0; +function O(a) { + if (!(this instanceof O)) { + return new O(a); + } + var b; + a ? D(b = a.encode) && (a.encode = b.toString()) : a = {}; + (b = (self || window)._factory) && (b = b.toString()); + const c = "undefined" === typeof window && self.exports, d = this; + this.o = xa(b, c, a.worker); + this.h = v(); + if (this.o) { + if (c) { + this.o.on("message", function(e) { + d.h[e.id](e.msg); + delete d.h[e.id]; + }); + } else { + this.o.onmessage = function(e) { + e = e.data; + d.h[e.id](e.msg); + delete d.h[e.id]; + }; + } + this.o.postMessage({task:"init", factory:b, options:a}); + } +} +P("add"); +P("append"); +P("search"); +P("update"); +P("remove"); +function P(a) { + O.prototype[a] = O.prototype[a + "Async"] = function() { + const b = this, c = [].slice.call(arguments); + var d = c[c.length - 1]; + let e; + D(d) && (e = d, c.splice(c.length - 1, 1)); + d = new Promise(function(f) { + setTimeout(function() { + b.h[++wa] = f; + b.o.postMessage({task:a, id:wa, args:c}); + }); + }); + return e ? (d.then(e), this) : d; + }; +} +function xa(a, b, c) { + let d; + try { + d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + va.toString()], {type:"text/javascript"}))) : new Worker(x(c) ? c : "worker/worker.js", {type:"module"}); + } catch (e) { + } + return d; +} +;function Q(a) { + if (!(this instanceof Q)) { + return new Q(a); + } + var b = a.document || a.doc || a, c; + this.K = []; + this.h = []; + this.A = []; + this.register = v(); + this.key = (c = b.key || b.id) && S(c, this.A) || "id"; + this.m = u(a.fastupdate); + this.C = (c = b.store) && !0 !== c && []; + this.store = c && v(); + this.I = (c = b.tag) && S(c, this.A); + this.l = c && v(); + this.cache = (c = a.cache) && new J(c); + a.cache = !1; + this.o = a.worker; + this.async = !1; + c = v(); + let d = b.index || b.field || b; + x(d) && (d = [d]); + for (let e = 0, f, h; e < d.length; e++) { + f = d[e], x(f) || (h = f, f = f.field), h = C(h) ? Object.assign({}, a, h) : a, this.o && (c[f] = new O(h), c[f].o || (this.o = !1)), this.o || (c[f] = new K(h, this.register)), this.K[e] = S(f, this.A), this.h[e] = f; + } + if (this.C) { + for (a = b.store, x(a) && (a = [a]), b = 0; b < a.length; b++) { + this.C[b] = S(a[b], this.A); + } + } + this.index = c; +} +function S(a, b) { + const c = a.split(":"); + let d = 0; + for (let e = 0; e < c.length; e++) { + a = c[e], 0 <= a.indexOf("[]") && (a = a.substring(0, a.length - 2)) && (b[d] = !0), a && (c[d++] = a); + } + d < c.length && (c.length = d); + return 1 < d ? c : c[0]; +} +function T(a, b) { + if (x(b)) { + a = a[b]; + } else { + for (let c = 0; a && c < b.length; c++) { + a = a[b[c]]; + } + } + return a; +} +function U(a, b, c, d, e) { + a = a[e]; + if (d === c.length - 1) { + b[e] = a; + } else if (a) { + if (a.constructor === Array) { + for (b = b[e] = Array(a.length), e = 0; e < a.length; e++) { + U(a, b, c, d, e); + } + } else { + b = b[e] || (b[e] = v()), e = c[++d], U(a, b, c, d, e); + } + } +} +function V(a, b, c, d, e, f, h, g) { + if (a = a[h]) { + if (d === b.length - 1) { + if (a.constructor === Array) { + if (c[d]) { + for (b = 0; b < a.length; b++) { + e.add(f, a[b], !0, !0); + } + return; + } + a = a.join(" "); + } + e.add(f, a, g, !0); + } else { + if (a.constructor === Array) { + for (h = 0; h < a.length; h++) { + V(a, b, c, d, e, f, h, g); + } + } else { + h = b[++d], V(a, b, c, d, e, f, h, g); + } + } + } +} +t = Q.prototype; +t.add = function(a, b, c) { + C(a) && (b = a, a = T(b, this.key)); + if (b && (a || 0 === a)) { + if (!c && this.register[a]) { + return this.update(a, b); + } + for (let d = 0, e, f; d < this.h.length; d++) { + f = this.h[d], e = this.K[d], x(e) && (e = [e]), V(b, e, this.A, 0, this.index[f], a, e[0], c); + } + if (this.I) { + let d = T(b, this.I), e = v(); + x(d) && (d = [d]); + for (let f = 0, h, g; f < d.length; f++) { + if (h = d[f], !e[h] && (e[h] = 1, g = this.l[h] || (this.l[h] = []), !c || !g.includes(a))) { + if (g[g.length] = a, this.m) { + const k = this.register[a] || (this.register[a] = []); + k[k.length] = g; + } + } + } + } + if (this.store && (!c || !this.store[a])) { + let d; + if (this.C) { + d = v(); + for (let e = 0, f; e < this.C.length; e++) { + f = this.C[e], x(f) ? d[f] = b[f] : U(b, d, f, 0, f[0]); + } + } + this.store[a] = d || b; + } + } + return this; +}; +t.append = function(a, b) { + return this.add(a, b, !0); +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a) { + C(a) && (a = T(a, this.key)); + if (this.register[a]) { + for (var b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.o), !this.m); b++) { + } + if (this.I && !this.m) { + for (let c in this.l) { + b = this.l[c]; + const d = b.indexOf(a); + -1 !== d && (1 < b.length ? b.splice(d, 1) : delete this.l[c]); + } + } + this.store && delete this.store[a]; + delete this.register[a]; + } + return this; +}; +t.search = function(a, b, c, d) { + c || (!b && C(a) ? (c = a, a = "") : C(b) && (c = b, b = 0)); + let e = [], f = [], h, g, k, m, n, w, q = 0; + if (c) { + if (c.constructor === Array) { + k = c, c = null; + } else { + a = c.query || a; + k = (h = c.pluck) || c.index || c.field; + m = c.tag; + g = this.store && c.enrich; + n = "and" === c.bool; + b = c.limit || b || 100; + w = c.offset || 0; + if (m && (x(m) && (m = [m]), !a)) { + for (let l = 0, p; l < m.length; l++) { + if (p = ya.call(this, m[l], b, w, g)) { + e[e.length] = p, q++; + } + } + return q ? e : []; + } + x(k) && (k = [k]); + } + } + k || (k = this.h); + n = n && (1 < k.length || m && 1 < m.length); + const r = !d && (this.o || this.async) && []; + for (let l = 0, p, A, B; l < k.length; l++) { + let z; + A = k[l]; + x(A) || (z = A, A = z.field, a = z.query || a, b = z.limit || b, g = z.enrich || g); + if (r) { + r[l] = this.index[A].searchAsync(a, b, z || c); + } else { + d ? p = d[l] : p = this.index[A].search(a, b, z || c); + B = p && p.length; + if (m && B) { + const y = []; + let H = 0; + n && (y[0] = [p]); + for (let X = 0, qa, R; X < m.length; X++) { + if (qa = m[X], B = (R = this.l[qa]) && R.length) { + H++, y[y.length] = n ? [R] : R; + } + } + H && (p = n ? ma(y, b || 100, w || 0) : na(p, y), B = p.length); + } + if (B) { + f[q] = A, e[q++] = p; + } else if (n) { + return []; + } + } + } + if (r) { + const l = this; + return new Promise(function(p) { + Promise.all(r).then(function(A) { + p(l.search(a, b, c, A)); + }); + }); + } + if (!q) { + return []; + } + if (h && (!g || !this.store)) { + return e[0]; + } + for (let l = 0, p; l < f.length; l++) { + p = e[l]; + p.length && g && (p = za.call(this, p)); + if (h) { + return p; + } + e[l] = {field:f[l], result:p}; + } + return e; +}; +function ya(a, b, c, d) { + let e = this.l[a], f = e && e.length - c; + if (f && 0 < f) { + if (f > b || c) { + e = e.slice(c, c + b); + } + d && (e = za.call(this, e)); + return {tag:a, result:e}; + } +} +function za(a) { + const b = Array(a.length); + for (let c = 0, d; c < a.length; c++) { + d = a[c], b[c] = {id:d, doc:this.store[d]}; + } + return b; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.get = function(a) { + return this.store[a]; +}; +t.set = function(a, b) { + this.store[a] = b; + return this; +}; +t.searchCache = oa; +t.export = function(a, b, c, d, e, f) { + let h; + "undefined" === typeof f && (h = new Promise(g => { + f = g; + })); + e || (e = 0); + d || (d = 0); + if (d < this.h.length) { + const g = this.h[d], k = this.index[g]; + b = this; + setTimeout(function() { + k.export(a, b, e ? g : "", d, e++, f) || (d++, e = 1, b.export(a, b, g, d, e, f)); + }); + } else { + let g, k; + switch(e) { + case 1: + g = "tag"; + k = this.l; + c = null; + break; + case 2: + g = "store"; + k = this.store; + c = null; + break; + default: + f(); + return; + } + ra(a, this, c, g, d, e, k, f); + } + return h; +}; +t.import = function(a, b) { + if (b) { + switch(x(b) && (b = JSON.parse(b)), a) { + case "tag": + this.l = b; + break; + case "reg": + this.m = !1; + this.register = b; + for (let d = 0, e; d < this.h.length; d++) { + e = this.index[this.h[d]], e.register = b, e.m = !1; + } + break; + case "store": + this.store = b; + break; + default: + a = a.split("."); + const c = a[0]; + a = a[1]; + c && a && this.index[c].import(a, b); + } + } +}; +la(Q.prototype); +var Ba = {encode:Aa, F:!1, G:""}; +const Ca = [F("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", F("[\u00e8\u00e9\u00ea\u00eb]"), "e", F("[\u00ec\u00ed\u00ee\u00ef]"), "i", F("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", F("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", F("[\u00fd\u0177\u00ff]"), "y", F("\u00f1"), "n", F("[\u00e7c]"), "k", F("\u00df"), "s", F(" & "), " and "]; +function Aa(a) { + var b = a = "" + a; + b.normalize && (b = b.normalize("NFD").replace(ea, "")); + return ca.call(this, b.toLowerCase(), !a.normalize && Ca); +} +;var Ea = {encode:Da, F:!1, G:"strict"}; +const Fa = /[^a-z0-9]+/, Ga = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"}; +function Da(a) { + a = Aa.call(this, a).join(" "); + const b = []; + if (a) { + const c = a.split(Fa), d = c.length; + for (let e = 0, f, h = 0; e < d; e++) { + if ((a = c[e]) && (!this.filter || !this.filter[a])) { + f = a[0]; + let g = Ga[f] || f, k = g; + for (let m = 1; m < a.length; m++) { + f = a[m]; + const n = Ga[f] || f; + n && n !== k && (g += n, k = n); + } + b[h++] = g; + } + } + } + return b; +} +;var Ia = {encode:Ha, F:!1, G:""}; +const Ja = [F("ae"), "a", F("oe"), "o", F("sh"), "s", F("th"), "t", F("ph"), "f", F("pf"), "f", F("(?![aeo])h(?![aeo])"), "", F("(?!^[aeo])h(?!^[aeo])"), ""]; +function Ha(a, b) { + a && (a = Da.call(this, a).join(" "), 2 < a.length && (a = E(a, Ja)), b || (1 < a.length && (a = ha(a)), a && (a = a.split(" ")))); + return a || []; +} +;var La = {encode:Ka, F:!1, G:""}; +const Ma = F("(?!\\b)[aeo]"); +function Ka(a) { + a && (a = Ha.call(this, a, !0), 1 < a.length && (a = a.replace(Ma, "")), 1 < a.length && (a = ha(a)), a && (a = a.split(" "))); + return a || []; +} +;G["latin:default"] = ja; +G["latin:simple"] = Ba; +G["latin:balance"] = Ea; +G["latin:advanced"] = Ia; +G["latin:extra"] = La; +const W = self; +let Y; +const Z = {Index:K, Document:Q, Worker:O, registerCharset:function(a, b) { + G[a] = b; +}, registerLanguage:function(a, b) { + ka[a] = b; +}}; +(Y = W.define) && Y.amd ? Y([], function() { + return Z; +}) : W.exports ? W.exports = Z : W.FlexSearch = Z; + diff --git a/dist/flexsearch.bundle.module.min.js b/dist/flexsearch.bundle.module.min.js new file mode 100644 index 0000000..5a3ca19 --- /dev/null +++ b/dist/flexsearch.bundle.module.min.js @@ -0,0 +1,34 @@ +/**! + * FlexSearch.js v0.7.39 (Bundle.module) + * Author and Copyright: Thomas Wilkerling + * Licence: Apache-2.0 + * Hosted by Nextapps GmbH + * https://github.com/nextapps-de/flexsearch + */ +var t;function u(a){return"undefined"!==typeof a?a:!0}function aa(a){const b=Array(a);for(let c=0;c=this.B&&(w||!n[l])){var f=L(q,d,r),h="";switch(this.G){case "full":if(2f;g--)if(g-f>=this.B){var k=L(q,d,r,e,f);h=l.substring(f,g);M(this,n,h,k,a,c)}break}case "reverse":if(1=this.B&&M(this,n, +h,L(q,d,r,e,g),a,c);h=""}case "forward":if(1=this.B&&M(this,n,h,f,a,c);break}default:if(this.C&&(f=Math.min(f/this.C(b,l,r)|0,q-1)),M(this,n,l,f,a,c),w&&1=this.B&&!e[l]){e[l]=1;const p=this.l&&l>f;M(this,m,p?f:l,L(h+(d/2>h?0:1),d,r,g-1,k-1),a,c,p?l:f)}}}}this.m||(this.register[a]=1)}}return this}; +function L(a,b,c,d,e){return c&&1=this.B&&!c[q])if(this.s||f||this.map[q])k[w++]=q,c[q]=1;else return d;a=k;e=a.length}if(!e)return d;b||(b=100);g=this.depth&&1=d)))break;if(n){if(f)return ta(k,d,0);b[b.length]=k;return}}return!c&&k}function ta(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} +function ua(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)}; +t.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d{f=m}));let g,k;switch(e||(e=0)){case 0:g="reg";if(this.m){k=v();for(let m in this.register)k[m]=1}else k=this.register;break;case 1:g="cfg";k={doc:0,opt:this.s?1:0};break;case 2:g="map";k=this.map;break;case 3:g="ctx";k=this.h;break;default:"undefined"===typeof c&&f&&f();return}ra(a,b||this,c,g,d,e,k,f);return h}; +t.import=function(a,b){if(b)switch(x(b)&&(b=JSON.parse(b)),a){case "cfg":this.s=!!b.opt;break;case "reg":this.m=!1;this.register=b;break;case "map":this.map=b;break;case "ctx":this.h=b}};la(K.prototype);function va(a){a=a.data;var b=self._index;const c=a.args;var d=a.task;switch(d){case "init":d=a.options||{};a=a.factory;b=d.encode;d.cache=!1;b&&0===b.indexOf("function")&&(d.encode=Function("return "+b)());a?(Function("return "+a)()(self),self._index=new self.FlexSearch.Index(d),delete self.FlexSearch):self._index=new K(d);break;default:a=a.id,b=b[d].apply(b,c),postMessage("search"===d?{id:a,msg:b}:{id:a})}};let wa=0;function O(a){if(!(this instanceof O))return new O(a);var b;a?D(b=a.encode)&&(a.encode=b.toString()):a={};(b=(self||window)._factory)&&(b=b.toString());const c="undefined"===typeof window&&self.exports,d=this;this.o=xa(b,c,a.worker);this.h=v();if(this.o){if(c)this.o.on("message",function(e){d.h[e.id](e.msg);delete d.h[e.id]});else this.o.onmessage=function(e){e=e.data;d.h[e.id](e.msg);delete d.h[e.id]};this.o.postMessage({task:"init",factory:b,options:a})}}P("add");P("append");P("search"); +P("update");P("remove");function P(a){O.prototype[a]=O.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments);var d=c[c.length-1];let e;D(d)&&(e=d,c.splice(c.length-1,1));d=new Promise(function(f){setTimeout(function(){b.h[++wa]=f;b.o.postMessage({task:a,id:wa,args:c})})});return e?(d.then(e),this):d}} +function xa(a,b,c){let d;try{d=b?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):a?new Worker(URL.createObjectURL(new Blob(["onmessage="+va.toString()],{type:"text/javascript"}))):new Worker(x(c)?c:"worker/worker.js",{type:"module"})}catch(e){}return d};function Q(a){if(!(this instanceof Q))return new Q(a);var b=a.document||a.doc||a,c;this.K=[];this.h=[];this.A=[];this.register=v();this.key=(c=b.key||b.id)&&S(c,this.A)||"id";this.m=u(a.fastupdate);this.C=(c=b.store)&&!0!==c&&[];this.store=c&&v();this.I=(c=b.tag)&&S(c,this.A);this.l=c&&v();this.cache=(c=a.cache)&&new J(c);a.cache=!1;this.o=a.worker;this.async=!1;c=v();let d=b.index||b.field||b;x(d)&&(d=[d]);for(let e=0,f,h;eb||c)e=e.slice(c,c+b);d&&(e=za.call(this,e));return{tag:a,result:e}}}function za(a){const b=Array(a.length);for(let c=0,d;c{f=g}));e||(e=0);d||(d=0);if(d= this.m && (u || !n[l])) { + var f = P(q, e, r), g = ""; + switch(this.C) { + case "full": + if (2 < d) { + for (f = 0; f < d; f++) { + for (var h = d; h > f; h--) { + if (h - f >= this.m) { + var k = P(q, e, r, d, f); + g = l.substring(f, h); + Q(this, n, g, k, a, c); + } + } + } + break; + } + case "reverse": + if (1 < d) { + for (h = d - 1; 0 < h; h--) { + g = l[h] + g, g.length >= this.m && Q(this, n, g, P(q, e, r, d, h), a, c); + } + g = ""; + } + case "forward": + if (1 < d) { + for (h = 0; h < d; h++) { + g += l[h], g.length >= this.m && Q(this, n, g, f, a, c); + } + break; + } + default: + if (this.F && (f = Math.min(f / this.F(b, l, r) | 0, q - 1)), Q(this, n, l, f, a, c), u && 1 < e && r < e - 1) { + for (d = z(), g = this.o, f = l, h = Math.min(u + 1, e - r), d[f] = 1, k = 1; k < h; k++) { + if ((l = b[this.B ? e - 1 - r - k : r + k]) && l.length >= this.m && !d[l]) { + d[l] = 1; + const p = this.h && l > f; + Q(this, m, p ? f : l, P(g + (e / 2 > g ? 0 : 1), e, r, h - 1, k - 1), a, c, p ? l : f); + } + } + } + } + } + } + this.D || (this.register[a] = 1); + } + } + return this; +}; +function P(a, b, c, e, d) { + return c && 1 < a ? b + (e || 0) <= a ? c + (d || 0) : (a - 1) / (b + (e || 0)) * (c + (d || 0)) + 1 | 0 : 0; +} +function Q(a, b, c, e, d, f, g) { + let h = g ? a.l : a.map; + if (!b[c] || g && !b[c][g]) { + a.s && (h = h[e]), g ? (b = b[c] || (b[c] = z()), b[g] = 1, h = h[g] || (h[g] = z())) : b[c] = 1, h = h[c] || (h[c] = []), a.s || (h = h[e] || (h[e] = [])), f && h.includes(d) || (h[h.length] = d, a.D && (a = a.register[d] || (a.register[d] = []), a[a.length] = h)); + } +} +t.search = function(a, b, c) { + c || (!b && D(a) ? (c = a, a = c.query) : D(b) && (c = b)); + let e = [], d; + let f, g = 0; + if (c) { + a = c.query || a; + b = c.limit; + g = c.offset || 0; + var h = c.context; + f = c.suggest; + } + if (a && (a = this.encode("" + a), d = a.length, 1 < d)) { + c = z(); + var k = []; + for (let n = 0, u = 0, q; n < d; n++) { + if ((q = a[n]) && q.length >= this.m && !c[q]) { + if (this.s || f || this.map[q]) { + k[u++] = q, c[q] = 1; + } else { + return e; + } + } + } + a = k; + d = a.length; + } + if (!d) { + return e; + } + b || (b = 100); + h = this.depth && 1 < d && !1 !== h; + c = 0; + let m; + h ? (m = a[0], c = 1) : 1 < d && a.sort(aa); + for (let n, u; c < d; c++) { + u = a[c]; + h ? (n = la(this, e, f, b, g, 2 === d, u, m), f && !1 === n && e.length || (m = u)) : n = la(this, e, f, b, g, 1 === d, u); + if (n) { + return n; + } + if (f && c === d - 1) { + k = e.length; + if (!k) { + if (h) { + h = 0; + c = -1; + continue; + } + return e; + } + if (1 === k) { + return ma(e[0], b, g); + } + } + } + return ha(e, b, g, f); +}; +function la(a, b, c, e, d, f, g, h) { + let k = [], m = h ? a.l : a.map; + a.s || (m = na(m, g, h, a.h)); + if (m) { + let n = 0; + const u = Math.min(m.length, h ? a.o : a.A); + for (let q = 0, r = 0, l, p; q < u; q++) { + if (l = m[q]) { + if (a.s && (l = na(l, g, h, a.h)), d && l && f && (p = l.length, p <= d ? (d -= p, l = null) : (l = l.slice(d), d = 0)), l && (k[n++] = l, f && (r += l.length, r >= e))) { + break; + } + } + } + if (n) { + if (f) { + return ma(k, e, 0); + } + b[b.length] = k; + return; + } + } + return !c && k; +} +function ma(a, b, c) { + a = 1 === a.length ? a[0] : [].concat.apply([], a); + return c || a.length > b ? a.slice(c, c + b) : a; +} +function na(a, b, c, e) { + c ? (e = e && b > c, a = (a = a[e ? b : c]) && a[e ? c : b]) : a = a[b]; + return a; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a, b) { + const c = this.register[a]; + if (c) { + if (this.D) { + for (let e = 0, d; e < c.length; e++) { + d = c[e], d.splice(d.indexOf(a), 1); + } + } else { + R(this.map, a, this.A, this.s), this.depth && R(this.l, a, this.o, this.s); + } + b || delete this.register[a]; + } + return this; +}; +function R(a, b, c, e, d) { + let f = 0; + if (a.constructor === Array) { + if (d) { + b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), f++) : f++; + } else { + d = Math.min(a.length, c); + for (let g = 0, h; g < d; g++) { + if (h = a[g]) { + f = R(h, b, c, e, d), e || f || delete a[g]; + } + } + } + } else { + for (let g in a) { + (f = R(a[g], b, c, e, d)) || delete a[g]; + } + } + return f; +} +fa(O.prototype); +function T(a) { + if (!(this instanceof T)) { + return new T(a); + } + var b = a.document || a.doc || a, c; + this.F = []; + this.h = []; + this.o = []; + this.register = z(); + this.key = (c = b.key || b.id) && U(c, this.o) || "id"; + this.D = v(a.fastupdate); + this.l = (c = b.store) && !0 !== c && []; + this.store = c && z(); + this.async = !1; + c = z(); + let e = b.index || b.field || b; + C(e) && (e = [e]); + for (let d = 0, f, g; d < e.length; d++) { + f = e[d], C(f) || (g = f, f = f.field), g = D(g) ? Object.assign({}, a, g) : a, this.I || (c[f] = new O(g, this.register)), this.F[d] = U(f, this.o), this.h[d] = f; + } + if (this.l) { + for (a = b.store, C(a) && (a = [a]), b = 0; b < a.length; b++) { + this.l[b] = U(a[b], this.o); + } + } + this.index = c; +} +function U(a, b) { + const c = a.split(":"); + let e = 0; + for (let d = 0; d < c.length; d++) { + a = c[d], 0 <= a.indexOf("[]") && (a = a.substring(0, a.length - 2)) && (b[e] = !0), a && (c[e++] = a); + } + e < c.length && (c.length = e); + return 1 < e ? c : c[0]; +} +function oa(a, b) { + if (C(b)) { + a = a[b]; + } else { + for (let c = 0; a && c < b.length; c++) { + a = a[b[c]]; + } + } + return a; +} +function V(a, b, c, e, d) { + a = a[d]; + if (e === c.length - 1) { + b[d] = a; + } else if (a) { + if (a.constructor === Array) { + for (b = b[d] = Array(a.length), d = 0; d < a.length; d++) { + V(a, b, c, e, d); + } + } else { + b = b[d] || (b[d] = z()), d = c[++e], V(a, b, c, e, d); + } + } +} +function W(a, b, c, e, d, f, g, h) { + if (a = a[g]) { + if (e === b.length - 1) { + if (a.constructor === Array) { + if (c[e]) { + for (b = 0; b < a.length; b++) { + d.add(f, a[b], !0, !0); + } + return; + } + a = a.join(" "); + } + d.add(f, a, h, !0); + } else { + if (a.constructor === Array) { + for (g = 0; g < a.length; g++) { + W(a, b, c, e, d, f, g, h); + } + } else { + g = b[++e], W(a, b, c, e, d, f, g, h); + } + } + } +} +t = T.prototype; +t.add = function(a, b, c) { + D(a) && (b = a, a = oa(b, this.key)); + if (b && (a || 0 === a)) { + if (!c && this.register[a]) { + return this.update(a, b); + } + for (let e = 0, d, f; e < this.h.length; e++) { + f = this.h[e], d = this.F[e], C(d) && (d = [d]), W(b, d, this.o, 0, this.index[f], a, d[0], c); + } + if (this.store && (!c || !this.store[a])) { + let e; + if (this.l) { + e = z(); + for (let d = 0, f; d < this.l.length; d++) { + f = this.l[d], C(f) ? e[f] = b[f] : V(b, e, f, 0, f[0]); + } + } + this.store[a] = e || b; + } + } + return this; +}; +t.append = function(a, b) { + return this.add(a, b, !0); +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a) { + D(a) && (a = oa(a, this.key)); + if (this.register[a]) { + for (let b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.I), !this.D); b++) { + } + this.store && delete this.store[a]; + delete this.register[a]; + } + return this; +}; +t.search = function(a, b, c, e) { + c || (!b && D(a) ? (c = a, a = "") : D(b) && (c = b, b = 0)); + let d = [], f = [], g, h, k, m, n, u, q = 0; + if (c) { + if (c.constructor === Array) { + k = c, c = null; + } else { + a = c.query || a; + k = (g = c.pluck) || c.index || c.field; + m = !1; + h = this.store && c.enrich; + n = "and" === c.bool; + b = c.limit || b || 100; + u = c.offset || 0; + if (m && (C(m) && (m = [m]), !a)) { + for (let l = 0, p; l < m.length; l++) { + if (p = pa.call(this, m[l], b, u, h)) { + d[d.length] = p, q++; + } + } + return q ? d : []; + } + C(k) && (k = [k]); + } + } + k || (k = this.h); + n = n && (1 < k.length || m && 1 < m.length); + const r = !e && (this.I || this.async) && []; + for (let l = 0, p, A, B; l < k.length; l++) { + let y; + A = k[l]; + C(A) || (y = A, A = y.field, a = y.query || a, b = y.limit || b, h = y.enrich || h); + if (r) { + r[l] = this.index[A].searchAsync(a, b, y || c); + } else { + e ? p = e[l] : p = this.index[A].search(a, b, y || c); + B = p && p.length; + if (m && B) { + const x = []; + let G = 0; + n && (x[0] = [p]); + for (let S = 0, ja, N; S < m.length; S++) { + if (ja = m[S], B = (N = this.J[ja]) && N.length) { + G++, x[x.length] = n ? [N] : N; + } + } + G && (p = n ? ha(x, b || 100, u || 0) : ia(p, x), B = p.length); + } + if (B) { + f[q] = A, d[q++] = p; + } else if (n) { + return []; + } + } + } + if (r) { + const l = this; + return new Promise(function(p) { + Promise.all(r).then(function(A) { + p(l.search(a, b, c, A)); + }); + }); + } + if (!q) { + return []; + } + if (g && (!h || !this.store)) { + return d[0]; + } + for (let l = 0, p; l < f.length; l++) { + p = d[l]; + p.length && h && (p = qa.call(this, p)); + if (g) { + return p; + } + d[l] = {field:f[l], result:p}; + } + return d; +}; +function pa(a, b, c, e) { + let d = this.J[a], f = d && d.length - c; + if (f && 0 < f) { + if (f > b || c) { + d = d.slice(c, c + b); + } + e && (d = qa.call(this, d)); + return {tag:a, result:d}; + } +} +function qa(a) { + const b = Array(a.length); + for (let c = 0, e; c < a.length; c++) { + e = a[c], b[c] = {id:e, doc:this.store[e]}; + } + return b; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.get = function(a) { + return this.store[a]; +}; +t.set = function(a, b) { + this.store[a] = b; + return this; +}; +fa(T.prototype); +var sa = {encode:ra, B:!1, C:""}; +const ta = [I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", I("[\u00e8\u00e9\u00ea\u00eb]"), "e", I("[\u00ec\u00ed\u00ee\u00ef]"), "i", I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", I("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", I("[\u00fd\u0177\u00ff]"), "y", I("\u00f1"), "n", I("[\u00e7c]"), "k", I("\u00df"), "s", I(" & "), " and "]; +function ra(a) { + var b = a = "" + a; + b.normalize && (b = b.normalize("NFD").replace(ca, "")); + return E.call(this, b.toLowerCase(), !a.normalize && ta); +} +;var va = {encode:ua, B:!1, C:"strict"}; +const wa = /[^a-z0-9]+/, xa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"}; +function ua(a) { + a = ra.call(this, a).join(" "); + const b = []; + if (a) { + const c = a.split(wa), e = c.length; + for (let d = 0, f, g = 0; d < e; d++) { + if ((a = c[d]) && (!this.filter || !this.filter[a])) { + f = a[0]; + let h = xa[f] || f, k = h; + for (let m = 1; m < a.length; m++) { + f = a[m]; + const n = xa[f] || f; + n && n !== k && (h += n, k = n); + } + b[g++] = h; + } + } + } + return b; +} +;var za = {encode:ya, B:!1, C:""}; +const Aa = [I("ae"), "a", I("oe"), "o", I("sh"), "s", I("th"), "t", I("ph"), "f", I("pf"), "f", I("(?![aeo])h(?![aeo])"), "", I("(?!^[aeo])h(?!^[aeo])"), ""]; +function ya(a, b) { + a && (a = ua.call(this, a).join(" "), 2 < a.length && (a = F(a, Aa)), b || (1 < a.length && (a = J(a)), a && (a = a.split(" ")))); + return a || []; +} +;var Ca = {encode:Ba, B:!1, C:""}; +const Da = I("(?!\\b)[aeo]"); +function Ba(a) { + a && (a = ya.call(this, a, !0), 1 < a.length && (a = a.replace(Da, "")), 1 < a.length && (a = J(a)), a && (a = a.split(" "))); + return a || []; +} +;L["latin:default"] = da; +L["latin:simple"] = sa; +L["latin:balance"] = va; +L["latin:advanced"] = za; +L["latin:extra"] = Ca; +const X = self; +let Y; +const Z = {Index:O, Document:T, Worker:null, registerCharset:function(a, b) { + L[a] = b; +}, registerLanguage:function(a, b) { + ea[a] = b; +}}; +(Y = X.define) && Y.amd ? Y([], function() { + return Z; +}) : X.exports ? X.exports = Z : X.FlexSearch = Z; +}(this)); diff --git a/dist/flexsearch.compact.js b/dist/flexsearch.compact.min.js similarity index 79% rename from dist/flexsearch.compact.js rename to dist/flexsearch.compact.min.js index 1729510..3cf914d 100644 --- a/dist/flexsearch.compact.js +++ b/dist/flexsearch.compact.min.js @@ -1,27 +1,27 @@ /**! - * FlexSearch.js v0.7.31 (Compact) + * FlexSearch.js v0.7.39 (Compact) * Author and Copyright: Thomas Wilkerling * Licence: Apache-2.0 * Hosted by Nextapps GmbH * https://github.com/nextapps-de/flexsearch */ -(function(self){'use strict';var t;function v(a){return"undefined"!==typeof a?a:!0}function w(a){const b=Array(a);for(let c=0;c=this.m&&(u||!n[l])){var f=P(q,e,r),g="";switch(this.C){case "full":if(2f;h--)if(h-f>=this.m){var k=P(q,e,r,d,f);g=l.substring(f,h);Q(this,n,g,k,a,c)}break}case "reverse":if(1=this.m&&Q(this,n, -g,P(q,e,r,d,h),a,c);g=""}case "forward":if(1=this.m&&Q(this,n,g,f,a,c);break}default:if(this.F&&(f=Math.min(f/this.F(b,l,r)|0,q-1)),Q(this,n,l,f,a,c),u&&1=this.m&&!d[l]){d[l]=1;const p=this.h&&l>f;Q(this,m,p?f:l,P(g+(e/2>g?0:1),e,r,h-1,k-1),a,c,p?l:f)}}}}this.D||(this.register[a]=1)}}return this}; -function P(a,b,c,e,d){return c&&1=this.m&&!c[q])if(this.s||f||this.map[q])k[u++]=q,c[q]=1;else return e;a=k;d=a.length}if(!d)return e;b||(b=100);h=this.depth&&1=this.m&&(u||!n[l])){var f=P(q,e,r),g="";switch(this.C){case "full":if(2f;h--)if(h-f>=this.m){var k=P(q,e,r,d,f);g=l.substring(f,h);Q(this,n,g,k,a,c)}break}case "reverse":if(1=this.m&&Q(this,n, +g,P(q,e,r,d,h),a,c);g=""}case "forward":if(1=this.m&&Q(this,n,g,f,a,c);break}default:if(this.F&&(f=Math.min(f/this.F(b,l,r)|0,q-1)),Q(this,n,l,f,a,c),u&&1=this.m&&!d[l]){d[l]=1;const p=this.h&&l>f;Q(this,m,p?f:l,P(g+(e/2>g?0:1),e,r,h-1,k-1),a,c,p?l:f)}}}}this.D||(this.register[a]=1)}}return this}; +function P(a,b,c,e,d){return c&&1=this.m&&!c[q])if(this.s||f||this.map[q])k[u++]=q,c[q]=1;else return e;a=k;d=a.length}if(!d)return e;b||(b=100);h=this.depth&&1=e)))break;if(n){if(f)return ma(k,e,0);b[b.length]=k;return}}return!c&&k}function ma(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} function na(a,b,c,e){c?(e=e&&b>c,a=(a=a[e?b:c])&&a[e?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};t.remove=function(a,b){const c=this.register[a];if(c){if(this.D)for(let e=0,d;eb||c)d=d.slice(c,c+b);e&&(d=qa.call(this,d));return{tag:a,result:d}}}function qa(a){const b=Array(a.length);for(let c=0,e;cb||c)d=d.slice(c,c+b);e&&(d=qa.call(this,d));return{tag:a,result:d}}}function qa(a){const b=Array(a.length);for(let c=0,e;c= this.m && (u || !n[l])) { + var f = P(q, e, r), g = ""; + switch(this.C) { + case "full": + if (2 < d) { + for (f = 0; f < d; f++) { + for (var h = d; h > f; h--) { + if (h - f >= this.m) { + var k = P(q, e, r, d, f); + g = l.substring(f, h); + Q(this, n, g, k, a, c); + } + } + } + break; + } + case "reverse": + if (1 < d) { + for (h = d - 1; 0 < h; h--) { + g = l[h] + g, g.length >= this.m && Q(this, n, g, P(q, e, r, d, h), a, c); + } + g = ""; + } + case "forward": + if (1 < d) { + for (h = 0; h < d; h++) { + g += l[h], g.length >= this.m && Q(this, n, g, f, a, c); + } + break; + } + default: + if (this.F && (f = Math.min(f / this.F(b, l, r) | 0, q - 1)), Q(this, n, l, f, a, c), u && 1 < e && r < e - 1) { + for (d = z(), g = this.o, f = l, h = Math.min(u + 1, e - r), d[f] = 1, k = 1; k < h; k++) { + if ((l = b[this.B ? e - 1 - r - k : r + k]) && l.length >= this.m && !d[l]) { + d[l] = 1; + const p = this.h && l > f; + Q(this, m, p ? f : l, P(g + (e / 2 > g ? 0 : 1), e, r, h - 1, k - 1), a, c, p ? l : f); + } + } + } + } + } + } + this.D || (this.register[a] = 1); + } + } + return this; +}; +function P(a, b, c, e, d) { + return c && 1 < a ? b + (e || 0) <= a ? c + (d || 0) : (a - 1) / (b + (e || 0)) * (c + (d || 0)) + 1 | 0 : 0; +} +function Q(a, b, c, e, d, f, g) { + let h = g ? a.l : a.map; + if (!b[c] || g && !b[c][g]) { + a.s && (h = h[e]), g ? (b = b[c] || (b[c] = z()), b[g] = 1, h = h[g] || (h[g] = z())) : b[c] = 1, h = h[c] || (h[c] = []), a.s || (h = h[e] || (h[e] = [])), f && h.includes(d) || (h[h.length] = d, a.D && (a = a.register[d] || (a.register[d] = []), a[a.length] = h)); + } +} +t.search = function(a, b, c) { + c || (!b && D(a) ? (c = a, a = c.query) : D(b) && (c = b)); + let e = [], d; + let f, g = 0; + if (c) { + a = c.query || a; + b = c.limit; + g = c.offset || 0; + var h = c.context; + f = c.suggest; + } + if (a && (a = this.encode("" + a), d = a.length, 1 < d)) { + c = z(); + var k = []; + for (let n = 0, u = 0, q; n < d; n++) { + if ((q = a[n]) && q.length >= this.m && !c[q]) { + if (this.s || f || this.map[q]) { + k[u++] = q, c[q] = 1; + } else { + return e; + } + } + } + a = k; + d = a.length; + } + if (!d) { + return e; + } + b || (b = 100); + h = this.depth && 1 < d && !1 !== h; + c = 0; + let m; + h ? (m = a[0], c = 1) : 1 < d && a.sort(aa); + for (let n, u; c < d; c++) { + u = a[c]; + h ? (n = la(this, e, f, b, g, 2 === d, u, m), f && !1 === n && e.length || (m = u)) : n = la(this, e, f, b, g, 1 === d, u); + if (n) { + return n; + } + if (f && c === d - 1) { + k = e.length; + if (!k) { + if (h) { + h = 0; + c = -1; + continue; + } + return e; + } + if (1 === k) { + return ma(e[0], b, g); + } + } + } + return ha(e, b, g, f); +}; +function la(a, b, c, e, d, f, g, h) { + let k = [], m = h ? a.l : a.map; + a.s || (m = na(m, g, h, a.h)); + if (m) { + let n = 0; + const u = Math.min(m.length, h ? a.o : a.A); + for (let q = 0, r = 0, l, p; q < u; q++) { + if (l = m[q]) { + if (a.s && (l = na(l, g, h, a.h)), d && l && f && (p = l.length, p <= d ? (d -= p, l = null) : (l = l.slice(d), d = 0)), l && (k[n++] = l, f && (r += l.length, r >= e))) { + break; + } + } + } + if (n) { + if (f) { + return ma(k, e, 0); + } + b[b.length] = k; + return; + } + } + return !c && k; +} +function ma(a, b, c) { + a = 1 === a.length ? a[0] : [].concat.apply([], a); + return c || a.length > b ? a.slice(c, c + b) : a; +} +function na(a, b, c, e) { + c ? (e = e && b > c, a = (a = a[e ? b : c]) && a[e ? c : b]) : a = a[b]; + return a; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a, b) { + const c = this.register[a]; + if (c) { + if (this.D) { + for (let e = 0, d; e < c.length; e++) { + d = c[e], d.splice(d.indexOf(a), 1); + } + } else { + R(this.map, a, this.A, this.s), this.depth && R(this.l, a, this.o, this.s); + } + b || delete this.register[a]; + } + return this; +}; +function R(a, b, c, e, d) { + let f = 0; + if (a.constructor === Array) { + if (d) { + b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), f++) : f++; + } else { + d = Math.min(a.length, c); + for (let g = 0, h; g < d; g++) { + if (h = a[g]) { + f = R(h, b, c, e, d), e || f || delete a[g]; + } + } + } + } else { + for (let g in a) { + (f = R(a[g], b, c, e, d)) || delete a[g]; + } + } + return f; +} +fa(O.prototype); +function T(a) { + if (!(this instanceof T)) { + return new T(a); + } + var b = a.document || a.doc || a, c; + this.F = []; + this.h = []; + this.o = []; + this.register = z(); + this.key = (c = b.key || b.id) && U(c, this.o) || "id"; + this.D = v(a.fastupdate); + this.l = (c = b.store) && !0 !== c && []; + this.store = c && z(); + this.async = !1; + c = z(); + let e = b.index || b.field || b; + C(e) && (e = [e]); + for (let d = 0, f, g; d < e.length; d++) { + f = e[d], C(f) || (g = f, f = f.field), g = D(g) ? Object.assign({}, a, g) : a, this.I || (c[f] = new O(g, this.register)), this.F[d] = U(f, this.o), this.h[d] = f; + } + if (this.l) { + for (a = b.store, C(a) && (a = [a]), b = 0; b < a.length; b++) { + this.l[b] = U(a[b], this.o); + } + } + this.index = c; +} +function U(a, b) { + const c = a.split(":"); + let e = 0; + for (let d = 0; d < c.length; d++) { + a = c[d], 0 <= a.indexOf("[]") && (a = a.substring(0, a.length - 2)) && (b[e] = !0), a && (c[e++] = a); + } + e < c.length && (c.length = e); + return 1 < e ? c : c[0]; +} +function oa(a, b) { + if (C(b)) { + a = a[b]; + } else { + for (let c = 0; a && c < b.length; c++) { + a = a[b[c]]; + } + } + return a; +} +function V(a, b, c, e, d) { + a = a[d]; + if (e === c.length - 1) { + b[d] = a; + } else if (a) { + if (a.constructor === Array) { + for (b = b[d] = Array(a.length), d = 0; d < a.length; d++) { + V(a, b, c, e, d); + } + } else { + b = b[d] || (b[d] = z()), d = c[++e], V(a, b, c, e, d); + } + } +} +function W(a, b, c, e, d, f, g, h) { + if (a = a[g]) { + if (e === b.length - 1) { + if (a.constructor === Array) { + if (c[e]) { + for (b = 0; b < a.length; b++) { + d.add(f, a[b], !0, !0); + } + return; + } + a = a.join(" "); + } + d.add(f, a, h, !0); + } else { + if (a.constructor === Array) { + for (g = 0; g < a.length; g++) { + W(a, b, c, e, d, f, g, h); + } + } else { + g = b[++e], W(a, b, c, e, d, f, g, h); + } + } + } +} +t = T.prototype; +t.add = function(a, b, c) { + D(a) && (b = a, a = oa(b, this.key)); + if (b && (a || 0 === a)) { + if (!c && this.register[a]) { + return this.update(a, b); + } + for (let e = 0, d, f; e < this.h.length; e++) { + f = this.h[e], d = this.F[e], C(d) && (d = [d]), W(b, d, this.o, 0, this.index[f], a, d[0], c); + } + if (this.store && (!c || !this.store[a])) { + let e; + if (this.l) { + e = z(); + for (let d = 0, f; d < this.l.length; d++) { + f = this.l[d], C(f) ? e[f] = b[f] : V(b, e, f, 0, f[0]); + } + } + this.store[a] = e || b; + } + } + return this; +}; +t.append = function(a, b) { + return this.add(a, b, !0); +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a) { + D(a) && (a = oa(a, this.key)); + if (this.register[a]) { + for (let b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.I), !this.D); b++) { + } + this.store && delete this.store[a]; + delete this.register[a]; + } + return this; +}; +t.search = function(a, b, c, e) { + c || (!b && D(a) ? (c = a, a = "") : D(b) && (c = b, b = 0)); + let d = [], f = [], g, h, k, m, n, u, q = 0; + if (c) { + if (c.constructor === Array) { + k = c, c = null; + } else { + a = c.query || a; + k = (g = c.pluck) || c.index || c.field; + m = !1; + h = this.store && c.enrich; + n = "and" === c.bool; + b = c.limit || b || 100; + u = c.offset || 0; + if (m && (C(m) && (m = [m]), !a)) { + for (let l = 0, p; l < m.length; l++) { + if (p = pa.call(this, m[l], b, u, h)) { + d[d.length] = p, q++; + } + } + return q ? d : []; + } + C(k) && (k = [k]); + } + } + k || (k = this.h); + n = n && (1 < k.length || m && 1 < m.length); + const r = !e && (this.I || this.async) && []; + for (let l = 0, p, A, B; l < k.length; l++) { + let y; + A = k[l]; + C(A) || (y = A, A = y.field, a = y.query || a, b = y.limit || b, h = y.enrich || h); + if (r) { + r[l] = this.index[A].searchAsync(a, b, y || c); + } else { + e ? p = e[l] : p = this.index[A].search(a, b, y || c); + B = p && p.length; + if (m && B) { + const x = []; + let G = 0; + n && (x[0] = [p]); + for (let S = 0, ja, N; S < m.length; S++) { + if (ja = m[S], B = (N = this.J[ja]) && N.length) { + G++, x[x.length] = n ? [N] : N; + } + } + G && (p = n ? ha(x, b || 100, u || 0) : ia(p, x), B = p.length); + } + if (B) { + f[q] = A, d[q++] = p; + } else if (n) { + return []; + } + } + } + if (r) { + const l = this; + return new Promise(function(p) { + Promise.all(r).then(function(A) { + p(l.search(a, b, c, A)); + }); + }); + } + if (!q) { + return []; + } + if (g && (!h || !this.store)) { + return d[0]; + } + for (let l = 0, p; l < f.length; l++) { + p = d[l]; + p.length && h && (p = qa.call(this, p)); + if (g) { + return p; + } + d[l] = {field:f[l], result:p}; + } + return d; +}; +function pa(a, b, c, e) { + let d = this.J[a], f = d && d.length - c; + if (f && 0 < f) { + if (f > b || c) { + d = d.slice(c, c + b); + } + e && (d = qa.call(this, d)); + return {tag:a, result:d}; + } +} +function qa(a) { + const b = Array(a.length); + for (let c = 0, e; c < a.length; c++) { + e = a[c], b[c] = {id:e, doc:this.store[e]}; + } + return b; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.get = function(a) { + return this.store[a]; +}; +t.set = function(a, b) { + this.store[a] = b; + return this; +}; +fa(T.prototype); +var sa = {encode:ra, B:!1, C:""}; +const ta = [I("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", I("[\u00e8\u00e9\u00ea\u00eb]"), "e", I("[\u00ec\u00ed\u00ee\u00ef]"), "i", I("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", I("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", I("[\u00fd\u0177\u00ff]"), "y", I("\u00f1"), "n", I("[\u00e7c]"), "k", I("\u00df"), "s", I(" & "), " and "]; +function ra(a) { + var b = a = "" + a; + b.normalize && (b = b.normalize("NFD").replace(ca, "")); + return E.call(this, b.toLowerCase(), !a.normalize && ta); +} +;var va = {encode:ua, B:!1, C:"strict"}; +const wa = /[^a-z0-9]+/, xa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"}; +function ua(a) { + a = ra.call(this, a).join(" "); + const b = []; + if (a) { + const c = a.split(wa), e = c.length; + for (let d = 0, f, g = 0; d < e; d++) { + if ((a = c[d]) && (!this.filter || !this.filter[a])) { + f = a[0]; + let h = xa[f] || f, k = h; + for (let m = 1; m < a.length; m++) { + f = a[m]; + const n = xa[f] || f; + n && n !== k && (h += n, k = n); + } + b[g++] = h; + } + } + } + return b; +} +;var za = {encode:ya, B:!1, C:""}; +const Aa = [I("ae"), "a", I("oe"), "o", I("sh"), "s", I("th"), "t", I("ph"), "f", I("pf"), "f", I("(?![aeo])h(?![aeo])"), "", I("(?!^[aeo])h(?!^[aeo])"), ""]; +function ya(a, b) { + a && (a = ua.call(this, a).join(" "), 2 < a.length && (a = F(a, Aa)), b || (1 < a.length && (a = J(a)), a && (a = a.split(" ")))); + return a || []; +} +;var Ca = {encode:Ba, B:!1, C:""}; +const Da = I("(?!\\b)[aeo]"); +function Ba(a) { + a && (a = ya.call(this, a, !0), 1 < a.length && (a = a.replace(Da, "")), 1 < a.length && (a = J(a)), a && (a = a.split(" "))); + return a || []; +} +;L["latin:default"] = da; +L["latin:simple"] = sa; +L["latin:balance"] = va; +L["latin:advanced"] = za; +L["latin:extra"] = Ca; +const X = self; +let Y; +const Z = {Index:O, Document:T, Worker:null, registerCharset:function(a, b) { + L[a] = b; +}, registerLanguage:function(a, b) { + ea[a] = b; +}}; +(Y = X.define) && Y.amd ? Y([], function() { + return Z; +}) : X.exports ? X.exports = Z : X.FlexSearch = Z; +}(this)); diff --git a/dist/flexsearch.compact.module.min.js b/dist/flexsearch.compact.module.min.js new file mode 100644 index 0000000..b57af90 --- /dev/null +++ b/dist/flexsearch.compact.module.min.js @@ -0,0 +1,27 @@ +/**! + * FlexSearch.js v0.7.39 (Compact.module) + * Author and Copyright: Thomas Wilkerling + * Licence: Apache-2.0 + * Hosted by Nextapps GmbH + * https://github.com/nextapps-de/flexsearch + */ +(function(self){'use strict';var t;function v(a){return"undefined"!==typeof a?a:!0}function w(a){const b=Array(a);for(let c=0;c=this.m&&(u||!n[l])){var f=P(q,e,r),g="";switch(this.C){case "full":if(2f;h--)if(h-f>=this.m){var k=P(q,e,r,d,f);g=l.substring(f,h);Q(this,n,g,k,a,c)}break}case "reverse":if(1=this.m&&Q(this,n, +g,P(q,e,r,d,h),a,c);g=""}case "forward":if(1=this.m&&Q(this,n,g,f,a,c);break}default:if(this.F&&(f=Math.min(f/this.F(b,l,r)|0,q-1)),Q(this,n,l,f,a,c),u&&1=this.m&&!d[l]){d[l]=1;const p=this.h&&l>f;Q(this,m,p?f:l,P(g+(e/2>g?0:1),e,r,h-1,k-1),a,c,p?l:f)}}}}this.D||(this.register[a]=1)}}return this}; +function P(a,b,c,e,d){return c&&1=this.m&&!c[q])if(this.s||f||this.map[q])k[u++]=q,c[q]=1;else return e;a=k;d=a.length}if(!d)return e;b||(b=100);h=this.depth&&1=e)))break;if(n){if(f)return ma(k,e,0);b[b.length]=k;return}}return!c&&k}function ma(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} +function na(a,b,c,e){c?(e=e&&b>c,a=(a=a[e?b:c])&&a[e?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)};t.remove=function(a,b){const c=this.register[a];if(c){if(this.D)for(let e=0,d;eb||c)d=d.slice(c,c+b);e&&(d=qa.call(this,d));return{tag:a,result:d}}}function qa(a){const b=Array(a.length);for(let c=0,e;c= this.minlength && (u || !p[l])) { - var f = M(q, d, n), g = ""; - switch(this.tokenize) { - case "full": - if (2 < e) { - for (f = 0; f < e; f++) { - for (var h = e; h > f; h--) { - if (h - f >= this.minlength) { - var k = M(q, d, n, e, f); - g = l.substring(f, h); - this.push_index(p, g, k, a, c); - } - } - } - break; - } - case "reverse": - if (1 < e) { - for (h = e - 1; 0 < h; h--) { - g = l[h] + g, g.length >= this.minlength && (k = M(q, d, n, e, h), this.push_index(p, g, k, a, c)); - } - g = ""; - } - case "forward": - if (1 < e) { - for (h = 0; h < e; h++) { - g += l[h], g.length >= this.minlength && this.push_index(p, g, f, a, c); - } - break; - } - default: - if (this.boost && (f = Math.min(f / this.boost(b, l, n) | 0, q - 1)), this.push_index(p, l, f, a, c), u && 1 < d && n < d - 1) { - for (e = w(), g = this.resolution_ctx, f = l, h = Math.min(u + 1, d - n), e[f] = 1, k = 1; k < h; k++) { - if ((l = b[this.rtl ? d - 1 - n - k : n + k]) && l.length >= this.minlength && !e[l]) { - e[l] = 1; - const t = M(g + (d / 2 > g ? 0 : 1), d, n, h - 1, k - 1), y = this.bidirectional && l > f; - this.push_index(m, y ? f : l, t, a, c, y ? l : f); - } - } - } - } - } - } - this.fastupdate || (this.register[a] = 1); - } - } - return this; -}; -function M(a, b, c, d, e) { - return c && 1 < a ? b + (d || 0) <= a ? c + (e || 0) : (a - 1) / (b + (d || 0)) * (c + (e || 0)) + 1 | 0 : 0; -} -L.prototype.push_index = function(a, b, c, d, e, f) { - let g = f ? this.ctx : this.map; - if (!a[b] || f && !a[b][f]) { - this.optimize && (g = g[c]), f ? (a = a[b] || (a[b] = w()), a[f] = 1, g = g[f] || (g[f] = w())) : a[b] = 1, g = g[b] || (g[b] = []), this.optimize || (g = g[c] || (g[c] = [])), e && g.includes(d) || (g[g.length] = d, this.fastupdate && (a = this.register[d] || (this.register[d] = []), a[a.length] = g)); - } -}; -L.prototype.search = function(a, b, c) { - c || (!b && z(a) ? (c = a, a = c.query) : z(b) && (c = b)); - let d = [], e; - let f, g = 0; - if (c) { - a = c.query || a; - b = c.limit; - g = c.offset || 0; - var h = c.context; - f = c.suggest; - } - if (a && (a = this.encode("" + a), e = a.length, 1 < e)) { - c = w(); - var k = []; - for (let p = 0, u = 0, q; p < e; p++) { - if ((q = a[p]) && q.length >= this.minlength && !c[q]) { - if (this.optimize || f || this.map[q]) { - k[u++] = q, c[q] = 1; - } else { - return d; - } - } - } - a = k; - e = a.length; - } - if (!e) { - return d; - } - b || (b = 100); - h = this.depth && 1 < e && !1 !== h; - c = 0; - let m; - h ? (m = a[0], c = 1) : 1 < e && a.sort(aa); - for (let p, u; c < e; c++) { - u = a[c]; - h ? (p = this.add_result(d, f, b, g, 2 === e, u, m), f && !1 === p && d.length || (m = u)) : p = this.add_result(d, f, b, g, 1 === e, u); - if (p) { - return p; - } - if (f && c === e - 1) { - k = d.length; - if (!k) { - if (h) { - h = 0; - c = -1; - continue; - } - return d; - } - if (1 === k) { - return qa(d[0], b, g); - } - } - } - return ka(d, b, g, f); -}; -L.prototype.add_result = function(a, b, c, d, e, f, g) { - let h = [], k = g ? this.ctx : this.map; - this.optimize || (k = ra(k, f, g, this.bidirectional)); - if (k) { - let m = 0; - const p = Math.min(k.length, g ? this.resolution_ctx : this.resolution); - for (let u = 0, q = 0, n, l; u < p; u++) { - if (n = k[u]) { - if (this.optimize && (n = ra(n, f, g, this.bidirectional)), d && n && e && (l = n.length, l <= d ? (d -= l, n = null) : (n = n.slice(d), d = 0)), n && (h[m++] = n, e && (q += n.length, q >= c))) { - break; - } - } - } - if (m) { - if (e) { - return qa(h, c, 0); - } - a[a.length] = h; - return; - } - } - return !b && h; -}; -function qa(a, b, c) { - a = 1 === a.length ? a[0] : [].concat.apply([], a); - return c || a.length > b ? a.slice(c, c + b) : a; -} -function ra(a, b, c, d) { - c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b]; - return a; -} -L.prototype.contain = function(a) { - return !!this.register[a]; -}; -L.prototype.update = function(a, b) { - return this.remove(a).add(a, b); -}; -L.prototype.remove = function(a, b) { - const c = this.register[a]; - if (c) { - if (this.fastupdate) { - for (let d = 0, e; d < c.length; d++) { - e = c[d], e.splice(e.indexOf(a), 1); - } - } else { - N(this.map, a, this.resolution, this.optimize), this.depth && N(this.ctx, a, this.resolution_ctx, this.optimize); - } - b || delete this.register[a]; - this.cache && this.cache.del(a); - } - return this; -}; -function N(a, b, c, d, e) { - let f = 0; - if (a.constructor === Array) { - if (e) { - b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), f++) : f++; - } else { - e = Math.min(a.length, c); - for (let g = 0, h; g < e; g++) { - if (h = a[g]) { - f = N(h, b, c, d, e), d || f || delete a[g]; - } - } - } - } else { - for (let g in a) { - (f = N(a[g], b, c, d, e)) || delete a[g]; - } - } - return f; -} -L.prototype.searchCache = ma; -L.prototype.export = function(a, b, c, d, e) { - let f, g; - switch(e || (e = 0)) { - case 0: - f = "reg"; - if (this.fastupdate) { - g = w(); - for (let h in this.register) { - g[h] = 1; - } - } else { - g = this.register; - } - break; - case 1: - f = "cfg"; - g = {doc:0, opt:this.optimize ? 1 : 0}; - break; - case 2: - f = "map"; - g = this.map; - break; - case 3: - f = "ctx"; - g = this.ctx; - break; - default: - return; - } - pa(a, b || this, c, f, d, e, g); - return !0; -}; -L.prototype.import = function(a, b) { - if (b) { - switch(x(b) && (b = JSON.parse(b)), a) { - case "cfg": - this.optimize = !!b.opt; - break; - case "reg": - this.fastupdate = !1; - this.register = b; - break; - case "map": - this.map = b; - break; - case "ctx": - this.ctx = b; - } - } -}; -ja(L.prototype); -function sa(a) { - a = a.data; - var b = self._index; - const c = a.args; - var d = a.task; - switch(d) { - case "init": - d = a.options || {}; - a = a.factory; - b = d.encode; - d.cache = !1; - b && 0 === b.indexOf("function") && (d.encode = Function("return " + b)()); - a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new L(d); - break; - default: - a = a.id, b = b[d].apply(b, c), postMessage("search" === d ? {id:a, msg:b} : {id:a}); - } -} -;let ta = 0; -function O(a) { - if (!(this instanceof O)) { - return new O(a); - } - var b; - a ? D(b = a.encode) && (a.encode = b.toString()) : a = {}; - (b = (self || window)._factory) && (b = b.toString()); - const c = "undefined" === typeof window && self.exports, d = this; - this.worker = ua(b, c, a.worker); - this.resolver = w(); - if (this.worker) { - if (c) { - this.worker.on("message", function(e) { - d.resolver[e.id](e.msg); - delete d.resolver[e.id]; - }); - } else { - this.worker.onmessage = function(e) { - e = e.data; - d.resolver[e.id](e.msg); - delete d.resolver[e.id]; - }; - } - this.worker.postMessage({task:"init", factory:b, options:a}); - } -} -Q("add"); -Q("append"); -Q("search"); -Q("update"); -Q("remove"); -function Q(a) { - O.prototype[a] = O.prototype[a + "Async"] = function() { - const b = this, c = [].slice.call(arguments); - var d = c[c.length - 1]; - let e; - D(d) && (e = d, c.splice(c.length - 1, 1)); - d = new Promise(function(f) { - setTimeout(function() { - b.resolver[++ta] = f; - b.worker.postMessage({task:a, id:ta, args:c}); - }); - }); - return e ? (d.then(e), this) : d; - }; -} -function ua(a, b, c) { - let d; - try { - d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + sa.toString()], {type:"text/javascript"}))) : new Worker(x(c) ? c : "worker/worker.js", {type:"module"}); - } catch (e) { - } - return d; -} -;function R(a) { - if (!(this instanceof R)) { - return new R(a); - } - var b = a.document || a.doc || a, c; - this.tree = []; - this.field = []; - this.marker = []; - this.register = w(); - this.key = (c = b.key || b.id) && S(c, this.marker) || "id"; - this.fastupdate = r(a.fastupdate, !0); - this.storetree = (c = b.store) && !0 !== c && []; - this.store = c && w(); - this.tag = (c = b.tag) && S(c, this.marker); - this.tagindex = c && w(); - this.cache = (c = a.cache) && new K(c); - a.cache = !1; - this.worker = a.worker; - this.async = !1; - c = w(); - let d = b.index || b.field || b; - x(d) && (d = [d]); - for (let e = 0, f, g; e < d.length; e++) { - f = d[e], x(f) || (g = f, f = f.field), g = z(g) ? Object.assign({}, a, g) : a, this.worker && (c[f] = new O(g), c[f].worker || (this.worker = !1)), this.worker || (c[f] = new L(g, this.register)), this.tree[e] = S(f, this.marker), this.field[e] = f; - } - if (this.storetree) { - for (a = b.store, x(a) && (a = [a]), b = 0; b < a.length; b++) { - this.storetree[b] = S(a[b], this.marker); - } - } - this.index = c; -} -function S(a, b) { - const c = a.split(":"); - let d = 0; - for (let e = 0; e < c.length; e++) { - a = c[e], 0 <= a.indexOf("[]") && (a = a.substring(0, a.length - 2)) && (b[d] = !0), a && (c[d++] = a); - } - d < c.length && (c.length = d); - return 1 < d ? c : c[0]; -} -function T(a, b) { - if (x(b)) { - a = a[b]; - } else { - for (let c = 0; a && c < b.length; c++) { - a = a[b[c]]; - } - } - return a; -} -function U(a, b, c, d, e) { - a = a[e]; - if (d === c.length - 1) { - b[e] = a; - } else if (a) { - if (a.constructor === Array) { - for (b = b[e] = Array(a.length), e = 0; e < a.length; e++) { - U(a, b, c, d, e); - } - } else { - b = b[e] || (b[e] = w()), e = c[++d], U(a, b, c, d, e); - } - } -} -function V(a, b, c, d, e, f, g, h) { - if (a = a[g]) { - if (d === b.length - 1) { - if (a.constructor === Array) { - if (c[d]) { - for (b = 0; b < a.length; b++) { - e.add(f, a[b], !0, !0); - } - return; - } - a = a.join(" "); - } - e.add(f, a, h, !0); - } else { - if (a.constructor === Array) { - for (g = 0; g < a.length; g++) { - V(a, b, c, d, e, f, g, h); - } - } else { - g = b[++d], V(a, b, c, d, e, f, g, h); - } - } - } -} -R.prototype.add = function(a, b, c) { - z(a) && (b = a, a = T(b, this.key)); - if (b && (a || 0 === a)) { - if (!c && this.register[a]) { - return this.update(a, b); - } - for (let d = 0, e, f; d < this.field.length; d++) { - f = this.field[d], e = this.tree[d], x(e) && (e = [e]), V(b, e, this.marker, 0, this.index[f], a, e[0], c); - } - if (this.tag) { - let d = T(b, this.tag), e = w(); - x(d) && (d = [d]); - for (let f = 0, g, h; f < d.length; f++) { - if (g = d[f], !e[g] && (e[g] = 1, h = this.tagindex[g] || (this.tagindex[g] = []), !c || !h.includes(a))) { - if (h[h.length] = a, this.fastupdate) { - const k = this.register[a] || (this.register[a] = []); - k[k.length] = h; - } - } - } - } - if (this.store && (!c || !this.store[a])) { - let d; - if (this.storetree) { - d = w(); - for (let e = 0, f; e < this.storetree.length; e++) { - f = this.storetree[e], x(f) ? d[f] = b[f] : U(b, d, f, 0, f[0]); - } - } - this.store[a] = d || b; - } - } - return this; -}; -R.prototype.append = function(a, b) { - return this.add(a, b, !0); -}; -R.prototype.update = function(a, b) { - return this.remove(a).add(a, b); -}; -R.prototype.remove = function(a) { - z(a) && (a = T(a, this.key)); - if (this.register[a]) { - for (var b = 0; b < this.field.length && (this.index[this.field[b]].remove(a, !this.worker), !this.fastupdate); b++) { - } - if (this.tag && !this.fastupdate) { - for (let c in this.tagindex) { - b = this.tagindex[c]; - const d = b.indexOf(a); - -1 !== d && (1 < b.length ? b.splice(d, 1) : delete this.tagindex[c]); - } - } - this.store && delete this.store[a]; - delete this.register[a]; - } - return this; -}; -R.prototype.search = function(a, b, c, d) { - c || (!b && z(a) ? (c = a, a = "") : z(b) && (c = b, b = 0)); - let e = [], f = [], g, h, k, m, p, u, q = 0; - if (c) { - if (c.constructor === Array) { - k = c, c = null; - } else { - a = c.query || a; - k = (g = c.pluck) || c.index || c.field; - m = c.tag; - h = this.store && c.enrich; - p = "and" === c.bool; - b = c.limit || b || 100; - u = c.offset || 0; - if (m && (x(m) && (m = [m]), !a)) { - for (let l = 0, t; l < m.length; l++) { - if (t = va.call(this, m[l], b, u, h)) { - e[e.length] = t, q++; - } - } - return q ? e : []; - } - x(k) && (k = [k]); - } - } - k || (k = this.field); - p = p && (1 < k.length || m && 1 < m.length); - const n = !d && (this.worker || this.async) && []; - for (let l = 0, t, y, C; l < k.length; l++) { - let B; - y = k[l]; - x(y) || (B = y, y = B.field, a = B.query || a, b = B.limit || b); - if (n) { - n[l] = this.index[y].searchAsync(a, b, B || c); - } else { - C = (t = d ? d[l] : this.index[y].search(a, b, B || c)) && t.length; - if (m && C) { - const A = []; - let H = 0; - p && (A[0] = [t]); - for (let W = 0, oa, P; W < m.length; W++) { - if (oa = m[W], C = (P = this.tagindex[oa]) && P.length) { - H++, A[A.length] = p ? [P] : P; - } - } - H && (t = p ? ka(A, b || 100, u || 0) : la(t, A), C = t.length); - } - if (C) { - f[q] = y, e[q++] = t; - } else if (p) { - return []; - } - } - } - if (n) { - const l = this; - return new Promise(function(t) { - Promise.all(n).then(function(y) { - t(l.search(a, b, c, y)); - }); - }); - } - if (!q) { - return []; - } - if (g && (!h || !this.store)) { - return e[0]; - } - for (let l = 0, t; l < f.length; l++) { - t = e[l]; - t.length && h && (t = wa.call(this, t)); - if (g) { - return t; - } - e[l] = {field:f[l], result:t}; - } - return e; -}; -function va(a, b, c, d) { - let e = this.tagindex[a], f = e && e.length - c; - if (f && 0 < f) { - if (f > b || c) { - e = e.slice(c, c + b); - } - d && (e = wa.call(this, e)); - return {tag:a, result:e}; - } -} -function wa(a) { - const b = Array(a.length); - for (let c = 0, d; c < a.length; c++) { - d = a[c], b[c] = {id:d, doc:this.store[d]}; - } - return b; -} -R.prototype.contain = function(a) { - return !!this.register[a]; -}; -R.prototype.get = function(a) { - return this.store[a]; -}; -R.prototype.set = function(a, b) { - this.store[a] = b; - return this; -}; -R.prototype.searchCache = ma; -R.prototype.export = function(a, b, c, d, e) { - e || (e = 0); - d || (d = 0); - if (d < this.field.length) { - const f = this.field[d], g = this.index[f]; - b = this; - setTimeout(function() { - g.export(a, b, e ? f : "", d, e++) || (d++, e = 1, b.export(a, b, f, d, e)); - }); - } else { - let f, g; - switch(e) { - case 1: - f = "tag"; - g = this.tagindex; - break; - case 2: - f = "store"; - g = this.store; - break; - default: - return; - } - pa(a, this, c, f, d, e, g); - } -}; -R.prototype.import = function(a, b) { - if (b) { - switch(x(b) && (b = JSON.parse(b)), a) { - case "tag": - this.tagindex = b; - break; - case "reg": - this.fastupdate = !1; - this.register = b; - for (let d = 0, e; d < this.field.length; d++) { - e = this.index[this.field[d]], e.register = b, e.fastupdate = !1; - } - break; - case "store": - this.store = b; - break; - default: - a = a.split("."); - const c = a[0]; - a = a[1]; - c && a && this.index[c].import(a, b); - } - } -}; -ja(R.prototype); -var ya = {encode:xa, rtl:!1, tokenize:""}; -const za = G("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), Aa = G("[\u00e8\u00e9\u00ea\u00eb]"), Ba = G("[\u00ec\u00ed\u00ee\u00ef]"), Ca = G("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), Da = G("[\u00f9\u00fa\u00fb\u00fc\u0171]"), Ea = G("[\u00fd\u0177\u00ff]"), Fa = G("\u00f1"), Ga = G("[\u00e7c]"), Ha = G("\u00df"), Ia = G(" & "), Ja = [za, "a", Aa, "e", Ba, "i", Ca, "o", Da, "u", Ea, "y", Fa, "n", Ga, "k", Ha, "s", Ia, " and "]; -function xa(a) { - var b = a = "" + a; - b.normalize && (b = b.normalize("NFD").replace(da, "")); - return ba.call(this, b.toLowerCase(), !a.normalize && Ja, ca, !1); -} -;var La = {encode:Ka, rtl:!1, tokenize:"strict"}; -const Ma = /[^a-z0-9]+/, Na = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"}; -function Ka(a) { - a = xa.call(this, a).join(" "); - const b = []; - if (a) { - const c = a.split(Ma), d = c.length; - for (let e = 0, f, g = 0; e < d; e++) { - if ((a = c[e]) && (!this.filter || !this.filter[a])) { - f = a[0]; - let h = Na[f] || f, k = h; - for (let m = 1; m < a.length; m++) { - f = a[m]; - const p = Na[f] || f; - p && p !== k && (h += p, k = p); - } - b[g++] = h; - } - } - } - return b; -} -;var Pa = {encode:Oa, rtl:!1, tokenize:""}; -const Qa = G("ae"), Ra = G("oe"), Sa = G("sh"), Ta = G("th"), Ua = G("ph"), Va = G("pf"), Wa = [Qa, "a", Ra, "o", Sa, "s", Ta, "t", Ua, "f", Va, "f", G("(?![aeo])h(?![aeo])"), "", G("(?!^[aeo])h(?!^[aeo])"), ""]; -function Oa(a, b) { - a && (a = Ka.call(this, a).join(" "), 2 < a.length && (a = E(a, Wa)), b || (1 < a.length && (a = F(a)), a && (a = a.split(" ")))); - return a || []; -} -;var Ya = {encode:Xa, rtl:!1, tokenize:""}; -const Za = G("(?!\\b)[aeo]"); -function Xa(a) { - a && (a = Oa.call(this, a, !0), 1 < a.length && (a = a.replace(Za, "")), 1 < a.length && (a = F(a)), a && (a = a.split(" "))); - return a || []; -} -;I["latin:default"] = ha; -I["latin:simple"] = ya; -I["latin:balance"] = La; -I["latin:advanced"] = Pa; -I["latin:extra"] = Ya; -const X = self; -let Y; -const Z = {Index:L, Document:R, Worker:O, registerCharset:function(a, b) { - I[a] = b; -}, registerLanguage:function(a, b) { - ia[a] = b; -}}; -(Y = X.define) && Y.amd ? Y([], function() { - return Z; -}) : X.exports ? X.exports = Z : X.FlexSearch = Z; -}(this)); diff --git a/dist/flexsearch.es5.debug.js b/dist/flexsearch.es5.debug.js new file mode 100644 index 0000000..dc27be7 --- /dev/null +++ b/dist/flexsearch.es5.debug.js @@ -0,0 +1,1334 @@ +/**! + * FlexSearch.js v0.7.39 (Es5) + * Author and Copyright: Thomas Wilkerling + * Licence: Apache-2.0 + * Hosted by Nextapps GmbH + * https://github.com/nextapps-de/flexsearch + */ +(function(self){'use strict'; +var t; +function aa(a) { + var b = 0; + return function() { + return b < a.length ? {done:!1, value:a[b++]} : {done:!0}; + }; +} +var v = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) { + if (a == Array.prototype || a == Object.prototype) { + return a; + } + a[b] = c.value; + return a; +}; +function ba(a) { + a = ["object" == typeof globalThis && globalThis, a, "object" == typeof window && window, "object" == typeof self && self, "object" == typeof global && global]; + for (var b = 0; b < a.length; ++b) { + var c = a[b]; + if (c && c.Math == Math) { + return c; + } + } + throw Error("Cannot find global object"); +} +var x = ba(this); +function y(a, b) { + if (b) { + a: { + var c = x; + a = a.split("."); + for (var d = 0; d < a.length - 1; d++) { + var e = a[d]; + if (!(e in c)) { + break a; + } + c = c[e]; + } + a = a[a.length - 1]; + d = c[a]; + b = b(d); + b != d && null != b && v(c, a, {configurable:!0, writable:!0, value:b}); + } + } +} +y("Symbol", function(a) { + function b(g) { + if (this instanceof b) { + throw new TypeError("Symbol is not a constructor"); + } + return new c(d + (g || "") + "_" + e++, g); + } + function c(g, f) { + this.h = g; + v(this, "description", {configurable:!0, writable:!0, value:f}); + } + if (a) { + return a; + } + c.prototype.toString = function() { + return this.h; + }; + var d = "jscomp_symbol_" + (1E9 * Math.random() >>> 0) + "_", e = 0; + return b; +}); +y("Symbol.iterator", function(a) { + if (a) { + return a; + } + a = Symbol("Symbol.iterator"); + for (var b = "Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "), c = 0; c < b.length; c++) { + var d = x[b[c]]; + "function" === typeof d && "function" != typeof d.prototype[a] && v(d.prototype, a, {configurable:!0, writable:!0, value:function() { + return ca(aa(this)); + }}); + } + return a; +}); +function ca(a) { + a = {next:a}; + a[Symbol.iterator] = function() { + return this; + }; + return a; +} +function da(a, b) { + a instanceof String && (a += ""); + var c = 0, d = !1, e = {next:function() { + if (!d && c < a.length) { + var g = c++; + return {value:b(g, a[g]), done:!1}; + } + d = !0; + return {done:!0, value:void 0}; + }}; + e[Symbol.iterator] = function() { + return e; + }; + return e; +} +y("Array.prototype.keys", function(a) { + return a ? a : function() { + return da(this, function(b) { + return b; + }); + }; +}); +function ea(a) { + var b = "undefined" != typeof Symbol && Symbol.iterator && a[Symbol.iterator]; + if (b) { + return b.call(a); + } + if ("number" == typeof a.length) { + return {next:aa(a)}; + } + throw Error(String(a) + " is not an iterable or ArrayLike"); +} +y("Promise", function(a) { + function b(f) { + this.l = 0; + this.m = void 0; + this.h = []; + this.M = !1; + var h = this.o(); + try { + f(h.resolve, h.reject); + } catch (k) { + h.reject(k); + } + } + function c() { + this.h = null; + } + function d(f) { + return f instanceof b ? f : new b(function(h) { + h(f); + }); + } + if (a) { + return a; + } + c.prototype.l = function(f) { + if (null == this.h) { + this.h = []; + var h = this; + this.m(function() { + h.D(); + }); + } + this.h.push(f); + }; + var e = x.setTimeout; + c.prototype.m = function(f) { + e(f, 0); + }; + c.prototype.D = function() { + for (; this.h && this.h.length;) { + var f = this.h; + this.h = []; + for (var h = 0; h < f.length; ++h) { + var k = f[h]; + f[h] = null; + try { + k(); + } catch (l) { + this.o(l); + } + } + } + this.h = null; + }; + c.prototype.o = function(f) { + this.m(function() { + throw f; + }); + }; + b.prototype.o = function() { + function f(l) { + return function(m) { + k || (k = !0, l.call(h, m)); + }; + } + var h = this, k = !1; + return {resolve:f(this.S), reject:f(this.D)}; + }; + b.prototype.S = function(f) { + if (f === this) { + this.D(new TypeError("A Promise cannot resolve to itself")); + } else { + if (f instanceof b) { + this.U(f); + } else { + a: { + switch(typeof f) { + case "object": + var h = null != f; + break a; + case "function": + h = !0; + break a; + default: + h = !1; + } + } + h ? this.R(f) : this.I(f); + } + } + }; + b.prototype.R = function(f) { + var h = void 0; + try { + h = f.then; + } catch (k) { + this.D(k); + return; + } + "function" == typeof h ? this.V(h, f) : this.I(f); + }; + b.prototype.D = function(f) { + this.N(2, f); + }; + b.prototype.I = function(f) { + this.N(1, f); + }; + b.prototype.N = function(f, h) { + if (0 != this.l) { + throw Error("Cannot settle(" + f + ", " + h + "): Promise already settled in state" + this.l); + } + this.l = f; + this.m = h; + 2 === this.l && this.T(); + this.O(); + }; + b.prototype.T = function() { + var f = this; + e(function() { + if (f.P()) { + var h = x.console; + "undefined" !== typeof h && h.error(f.m); + } + }, 1); + }; + b.prototype.P = function() { + if (this.M) { + return !1; + } + var f = x.CustomEvent, h = x.Event, k = x.dispatchEvent; + if ("undefined" === typeof k) { + return !0; + } + "function" === typeof f ? f = new f("unhandledrejection", {cancelable:!0}) : "function" === typeof h ? f = new h("unhandledrejection", {cancelable:!0}) : (f = x.document.createEvent("CustomEvent"), f.initCustomEvent("unhandledrejection", !1, !0, f)); + f.promise = this; + f.reason = this.m; + return k(f); + }; + b.prototype.O = function() { + if (null != this.h) { + for (var f = 0; f < this.h.length; ++f) { + g.l(this.h[f]); + } + this.h = null; + } + }; + var g = new c(); + b.prototype.U = function(f) { + var h = this.o(); + f.J(h.resolve, h.reject); + }; + b.prototype.V = function(f, h) { + var k = this.o(); + try { + f.call(h, k.resolve, k.reject); + } catch (l) { + k.reject(l); + } + }; + b.prototype.then = function(f, h) { + function k(n, q) { + return "function" == typeof n ? function(r) { + try { + l(n(r)); + } catch (u) { + m(u); + } + } : q; + } + var l, m, p = new b(function(n, q) { + l = n; + m = q; + }); + this.J(k(f, l), k(h, m)); + return p; + }; + b.prototype.catch = function(f) { + return this.then(void 0, f); + }; + b.prototype.J = function(f, h) { + function k() { + switch(l.l) { + case 1: + f(l.m); + break; + case 2: + h(l.m); + break; + default: + throw Error("Unexpected state: " + l.l); + } + } + var l = this; + null == this.h ? g.l(k) : this.h.push(k); + this.M = !0; + }; + b.resolve = d; + b.reject = function(f) { + return new b(function(h, k) { + k(f); + }); + }; + b.race = function(f) { + return new b(function(h, k) { + for (var l = ea(f), m = l.next(); !m.done; m = l.next()) { + d(m.value).J(h, k); + } + }); + }; + b.all = function(f) { + var h = ea(f), k = h.next(); + return k.done ? d([]) : new b(function(l, m) { + function p(r) { + return function(u) { + n[r] = u; + q--; + 0 == q && l(n); + }; + } + var n = [], q = 0; + do { + n.push(void 0), q++, d(k.value).J(p(n.length - 1), m), k = h.next(); + } while (!k.done); + }); + }; + return b; +}); +y("Object.is", function(a) { + return a ? a : function(b, c) { + return b === c ? 0 !== b || 1 / b === 1 / c : b !== b && c !== c; + }; +}); +y("Array.prototype.includes", function(a) { + return a ? a : function(b, c) { + var d = this; + d instanceof String && (d = String(d)); + var e = d.length; + c = c || 0; + for (0 > c && (c = Math.max(c + e, 0)); c < e; c++) { + var g = d[c]; + if (g === b || Object.is(g, b)) { + return !0; + } + } + return !1; + }; +}); +y("String.prototype.includes", function(a) { + return a ? a : function(b, c) { + if (null == this) { + throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined"); + } + if (b instanceof RegExp) { + throw new TypeError("First argument to String.prototype.includes must not be a regular expression"); + } + return -1 !== this.indexOf(b, c || 0); + }; +}); +var fa = "function" == typeof Object.assign ? Object.assign : function(a, b) { + for (var c = 1; c < arguments.length; c++) { + var d = arguments[c]; + if (d) { + for (var e in d) { + Object.prototype.hasOwnProperty.call(d, e) && (a[e] = d[e]); + } + } + } + return a; +}; +y("Object.assign", function(a) { + return a || fa; +}); +function C(a) { + return "undefined" !== typeof a ? a : !0; +} +function ha(a) { + for (var b = Array(a), c = 0; c < a; c++) { + b[c] = D(); + } + return b; +} +function D() { + return Object.create(null); +} +function ia(a, b) { + return b.length - a.length; +} +function E(a) { + return "string" === typeof a; +} +function F(a) { + return "object" === typeof a; +} +function G(a) { + return "function" === typeof a; +} +;function ja(a, b) { + var c = ka; + if (a && (b && (a = I(a, b)), this.K && (a = I(a, this.K)), this.L && 1 < a.length && (a = I(a, this.L)), c || "" === c)) { + a = a.split(c); + if (this.filter) { + b = this.filter; + c = a.length; + for (var d = [], e = 0, g = 0; e < c; e++) { + var f = a[e]; + f && !b[f] && (d[g++] = f); + } + a = d; + } + return a; + } + return a; +} +var ka = /[\p{Z}\p{S}\p{P}\p{C}]+/u, la = /[\u0300-\u036f]/g; +function ma(a, b) { + for (var c = Object.keys(a), d = c.length, e = [], g = "", f = 0, h = 0, k, l; h < d; h++) { + k = c[h], (l = a[k]) ? (e[f++] = J(b ? "(?!\\b)" + k + "(\\b|_)" : k), e[f++] = l) : g += (g ? "|" : "") + k; + } + g && (e[f++] = J(b ? "(?!\\b)(" + g + ")(\\b|_)" : "(" + g + ")"), e[f] = ""); + return e; +} +function I(a, b) { + for (var c = 0, d = b.length; c < d && (a = a.replace(b[c], b[c + 1]), a); c += 2) { + } + return a; +} +function J(a) { + return new RegExp(a, "g"); +} +function na(a) { + for (var b = "", c = "", d = 0, e = a.length, g = void 0; d < e; d++) { + (g = a[d]) !== c && (b += c = g); + } + return b; +} +;var pa = {encode:oa, G:!1, H:""}; +function oa(a) { + return ja.call(this, ("" + a).toLowerCase(), !1); +} +;var qa = {}, K = {}; +function ra(a) { + L(a, "add"); + L(a, "append"); + L(a, "search"); + L(a, "update"); + L(a, "remove"); +} +function L(a, b) { + a[b + "Async"] = function() { + var c = this, d = arguments, e = d[d.length - 1]; + if (G(e)) { + var g = e; + delete d[d.length - 1]; + } + e = new Promise(function(f) { + setTimeout(function() { + c.async = !0; + var h = c[b].apply(c, d); + c.async = !1; + f(h); + }); + }); + return g ? (e.then(g), this) : e; + }; +} +;function sa(a, b, c, d) { + var e = a.length, g = [], f, h = 0; + d && (d = []); + for (var k = e - 1; 0 <= k; k--) { + for (var l = a[k], m = l.length, p = D(), n = !B, q = 0; q < m; q++) { + var r = l[q], u = r.length; + if (u) { + for (var A = 0, w, z; A < u; A++) { + if (z = r[A], B) { + if (B[z]) { + if (!k) { + if (c) { + c--; + } else { + if (g[h++] = z, h === b) { + return g; + } + } + } + if (k || d) { + p[z] = 1; + } + n = !0; + } + d && (w = (f[z] || 0) + 1, f[z] = w, w < e && (w = d[w - 2] || (d[w - 2] = []), w[w.length] = z)); + } else { + p[z] = 1; + } + } + } + } + if (d) { + B || (f = p); + } else if (!n) { + return []; + } + var B = p; + } + if (d) { + for (a = d.length - 1; 0 <= a; a--) { + for (e = d[a], f = e.length, k = 0; k < f; k++) { + if (l = e[k], !B[l]) { + if (c) { + c--; + } else { + if (g[h++] = l, h === b) { + return g; + } + } + B[l] = 1; + } + } + } + } + return g; +} +function ta(a, b) { + for (var c = D(), d = D(), e = [], g = 0; g < a.length; g++) { + c[a[g]] = 1; + } + for (a = 0; a < b.length; a++) { + g = b[a]; + for (var f = 0, h; f < g.length; f++) { + h = g[f], c[h] && !d[h] && (d[h] = 1, e[e.length] = h); + } + } + return e; +} +;function M(a) { + this.l = !0 !== a && a; + this.cache = D(); + this.h = []; +} +function ua(a, b, c) { + F(a) && (a = a.query); + var d = this.cache.get(a); + d || (d = this.search(a, b, c), this.cache.set(a, d)); + return d; +} +M.prototype.set = function(a, b) { + if (!this.cache[a]) { + var c = this.h.length; + c === this.l ? delete this.cache[this.h[c - 1]] : c++; + for (--c; 0 < c; c--) { + this.h[c] = this.h[c - 1]; + } + this.h[0] = a; + } + this.cache[a] = b; +}; +M.prototype.get = function(a) { + var b = this.cache[a]; + if (this.l && b && (a = this.h.indexOf(a))) { + var c = this.h[a - 1]; + this.h[a - 1] = this.h[a]; + this.h[a] = c; + } + return b; +}; +var va = {memory:{charset:"latin:extra", F:3, C:4, s:!1}, performance:{F:3, C:3, B:!1, context:{depth:2, F:1}}, match:{charset:"latin:extra", H:"reverse"}, score:{charset:"latin:advanced", F:20, C:3, context:{depth:3, F:9}}, "default":{}}; +function wa(a, b, c, d, e, g, f, h) { + setTimeout(function() { + var k = a(c ? c + "." + d : d, JSON.stringify(f)); + k && k.then ? k.then(function() { + b.export(a, b, c, e, g + 1, h); + }) : b.export(a, b, c, e, g + 1, h); + }); +} +;function N(a, b) { + if (!(this instanceof N)) { + return new N(a); + } + var c; + if (a) { + if (E(a)) { + va[a] || console.warn("Preset not found: " + a), a = va[a]; + } else { + if (c = a.preset) { + c[c] || console.warn("Preset not found: " + c), a = Object.assign({}, c[c], a); + } + } + c = a.charset; + var d = a.lang; + E(c) && (-1 === c.indexOf(":") && (c += ":default"), c = K[c]); + E(d) && (d = qa[d]); + } else { + a = {}; + } + var e, g, f = a.context || {}; + this.encode = a.encode || c && c.encode || oa; + this.register = b || D(); + this.F = e = a.resolution || 9; + this.H = b = c && c.H || a.tokenize || "strict"; + this.depth = "strict" === b && f.depth; + this.l = C(f.bidirectional); + this.B = g = C(a.optimize); + this.s = C(a.fastupdate); + this.C = a.minlength || 1; + this.o = a.boost; + this.map = g ? ha(e) : D(); + this.m = e = f.resolution || 1; + this.h = g ? ha(e) : D(); + this.G = c && c.G || a.rtl; + this.K = (b = a.matcher || d && d.K) && ma(b, !1); + this.L = (b = a.stemmer || d && d.L) && ma(b, !0); + if (c = b = a.filter || d && d.filter) { + c = b; + d = D(); + f = 0; + for (e = c.length; f < e; f++) { + d[c[f]] = 1; + } + c = d; + } + this.filter = c; + this.cache = (b = a.cache) && new M(b); +} +t = N.prototype; +t.append = function(a, b) { + return this.add(a, b, !0); +}; +t.add = function(a, b, c, d) { + if (b && (a || 0 === a)) { + if (!d && !c && this.register[a]) { + return this.update(a, b); + } + b = this.encode(b); + if (d = b.length) { + for (var e = D(), g = D(), f = this.depth, h = this.F, k = 0; k < d; k++) { + var l = b[this.G ? d - 1 - k : k], m = l.length; + if (l && m >= this.C && (f || !g[l])) { + var p = O(h, d, k), n = ""; + switch(this.H) { + case "full": + if (2 < m) { + for (p = 0; p < m; p++) { + for (var q = m; q > p; q--) { + if (q - p >= this.C) { + var r = O(h, d, k, m, p); + n = l.substring(p, q); + P(this, g, n, r, a, c); + } + } + } + break; + } + case "reverse": + if (1 < m) { + for (q = m - 1; 0 < q; q--) { + n = l[q] + n, n.length >= this.C && P(this, g, n, O(h, d, k, m, q), a, c); + } + n = ""; + } + case "forward": + if (1 < m) { + for (q = 0; q < m; q++) { + n += l[q], n.length >= this.C && P(this, g, n, p, a, c); + } + break; + } + default: + if (this.o && (p = Math.min(p / this.o(b, l, k) | 0, h - 1)), P(this, g, l, p, a, c), f && 1 < d && k < d - 1) { + for (m = D(), n = this.m, p = l, q = Math.min(f + 1, d - k), r = m[p] = 1; r < q; r++) { + if ((l = b[this.G ? d - 1 - k - r : k + r]) && l.length >= this.C && !m[l]) { + m[l] = 1; + var u = this.l && l > p; + P(this, e, u ? p : l, O(n + (d / 2 > n ? 0 : 1), d, k, q - 1, r - 1), a, c, u ? l : p); + } + } + } + } + } + } + this.s || (this.register[a] = 1); + } + } + return this; +}; +function O(a, b, c, d, e) { + return c && 1 < a ? b + (d || 0) <= a ? c + (e || 0) : (a - 1) / (b + (d || 0)) * (c + (e || 0)) + 1 | 0 : 0; +} +function P(a, b, c, d, e, g, f) { + var h = f ? a.h : a.map; + if (!b[c] || f && !b[c][f]) { + a.B && (h = h[d]), f ? (b = b[c] || (b[c] = D()), b[f] = 1, h = h[f] || (h[f] = D())) : b[c] = 1, h = h[c] || (h[c] = []), a.B || (h = h[d] || (h[d] = [])), g && h.includes(e) || (h[h.length] = e, a.s && (a = a.register[e] || (a.register[e] = []), a[a.length] = h)); + } +} +t.search = function(a, b, c) { + c || (!b && F(a) ? (c = a, a = c.query) : F(b) && (c = b)); + var d = [], e = 0; + if (c) { + a = c.query || a; + b = c.limit; + e = c.offset || 0; + var g = c.context; + var f = c.suggest; + } + if (a) { + a = this.encode("" + a); + var h = a.length; + if (1 < h) { + c = D(); + for (var k = [], l = 0, m = 0, p; l < h; l++) { + if ((p = a[l]) && p.length >= this.C && !c[p]) { + if (this.B || f || this.map[p]) { + k[m++] = p, c[p] = 1; + } else { + return d; + } + } + } + a = k; + h = a.length; + } + } + if (!h) { + return d; + } + b || (b = 100); + g = this.depth && 1 < h && !1 !== g; + c = 0; + if (g) { + var n = a[0]; + c = 1; + } else { + 1 < h && a.sort(ia); + } + for (; c < h; c++) { + l = a[c]; + g ? (k = xa(this, d, f, b, e, 2 === h, l, n), f && !1 === k && d.length || (n = l)) : k = xa(this, d, f, b, e, 1 === h, l); + if (k) { + return k; + } + if (f && c === h - 1) { + k = d.length; + if (!k) { + if (g) { + g = 0; + c = -1; + continue; + } + return d; + } + if (1 === k) { + return ya(d[0], b, e); + } + } + } + return sa(d, b, e, f); +}; +function xa(a, b, c, d, e, g, f, h) { + var k = [], l = h ? a.h : a.map; + a.B || (l = za(l, f, h, a.l)); + if (l) { + for (var m = 0, p = Math.min(l.length, h ? a.m : a.F), n = 0, q = 0, r, u; n < p; n++) { + if (r = l[n]) { + if (a.B && (r = za(r, f, h, a.l)), e && r && g && (u = r.length, u <= e ? (e -= u, r = null) : (r = r.slice(e), e = 0)), r && (k[m++] = r, g && (q += r.length, q >= d))) { + break; + } + } + } + if (m) { + if (g) { + return ya(k, d, 0); + } + b[b.length] = k; + return; + } + } + return !c && k; +} +function ya(a, b, c) { + a = 1 === a.length ? a[0] : [].concat.apply([], a); + return c || a.length > b ? a.slice(c, c + b) : a; +} +function za(a, b, c, d) { + c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b]; + return a; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a, b) { + var c = this.register[a]; + if (c) { + if (this.s) { + for (var d = 0, e; d < c.length; d++) { + e = c[d], e.splice(e.indexOf(a), 1); + } + } else { + Q(this.map, a, this.F, this.B), this.depth && Q(this.h, a, this.m, this.B); + } + b || delete this.register[a]; + if (this.cache) { + for (b = this.cache, c = 0; c < b.h.length; c++) { + e = b.h[c], d = b.cache[e], d.includes(a) && (b.h.splice(c--, 1), delete b.cache[e]); + } + } + } + return this; +}; +function Q(a, b, c, d, e) { + var g = 0; + if (a.constructor === Array) { + if (e) { + b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), g++) : g++; + } else { + e = Math.min(a.length, c); + for (var f = 0, h; f < e; f++) { + if (h = a[f]) { + g = Q(h, b, c, d, e), d || g || delete a[f]; + } + } + } + } else { + for (f in a) { + (g = Q(a[f], b, c, d, e)) || delete a[f]; + } + } + return g; +} +t.searchCache = ua; +t.export = function(a, b, c, d, e, g) { + var f = !0; + "undefined" === typeof g && (f = new Promise(function(m) { + g = m; + })); + switch(e || (e = 0)) { + case 0: + var h = "reg"; + if (this.s) { + var k = D(); + for (var l in this.register) { + k[l] = 1; + } + } else { + k = this.register; + } + break; + case 1: + h = "cfg"; + k = {doc:0, opt:this.B ? 1 : 0}; + break; + case 2: + h = "map"; + k = this.map; + break; + case 3: + h = "ctx"; + k = this.h; + break; + default: + "undefined" === typeof c && g && g(); + return; + } + wa(a, b || this, c, h, d, e, k, g); + return f; +}; +t.import = function(a, b) { + if (b) { + switch(E(b) && (b = JSON.parse(b)), a) { + case "cfg": + this.B = !!b.opt; + break; + case "reg": + this.s = !1; + this.register = b; + break; + case "map": + this.map = b; + break; + case "ctx": + this.h = b; + } + } +}; +ra(N.prototype); +function Aa(a) { + a = a.data; + var b = self._index, c = a.args, d = a.task; + switch(d) { + case "init": + d = a.options || {}; + a = a.factory; + b = d.encode; + d.cache = !1; + b && 0 === b.indexOf("function") && (d.encode = Function("return " + b)()); + a ? (Function("return " + a)()(self), self._index = new self.FlexSearch.Index(d), delete self.FlexSearch) : self._index = new N(d); + break; + default: + a = a.id, b = b[d].apply(b, c), postMessage("search" === d ? {id:a, msg:b} : {id:a}); + } +} +;var Ba = 0; +function R(a) { + if (!(this instanceof R)) { + return new R(a); + } + var b; + a ? G(b = a.encode) && (a.encode = b.toString()) : a = {}; + (b = (self || window)._factory) && (b = b.toString()); + var c = "undefined" === typeof window && self.exports, d = this; + this.A = Ca(b, c, a.worker); + this.h = D(); + if (this.A) { + if (c) { + this.A.on("message", function(e) { + d.h[e.id](e.msg); + delete d.h[e.id]; + }); + } else { + this.A.onmessage = function(e) { + e = e.data; + d.h[e.id](e.msg); + delete d.h[e.id]; + }; + } + this.A.postMessage({task:"init", factory:b, options:a}); + } +} +S("add"); +S("append"); +S("search"); +S("update"); +S("remove"); +function S(a) { + R.prototype[a] = R.prototype[a + "Async"] = function() { + var b = this, c = [].slice.call(arguments), d = c[c.length - 1]; + if (G(d)) { + var e = d; + c.splice(c.length - 1, 1); + } + d = new Promise(function(g) { + setTimeout(function() { + b.h[++Ba] = g; + b.A.postMessage({task:a, id:Ba, args:c}); + }); + }); + return e ? (d.then(e), this) : d; + }; +} +function Ca(a, b, c) { + try { + var d = b ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : a ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + Aa.toString()], {type:"text/javascript"}))) : new Worker(E(c) ? c : "worker/worker.js", {type:"module"}); + } catch (e) { + } + return d; +} +;function T(a) { + if (!(this instanceof T)) { + return new T(a); + } + var b = a.document || a.doc || a, c; + this.I = []; + this.h = []; + this.m = []; + this.register = D(); + this.key = (c = b.key || b.id) && U(c, this.m) || "id"; + this.s = C(a.fastupdate); + this.o = (c = b.store) && !0 !== c && []; + this.store = c && D(); + this.D = (c = b.tag) && U(c, this.m); + this.l = c && D(); + this.cache = (c = a.cache) && new M(c); + a.cache = !1; + this.A = a.worker; + this.async = !1; + c = D(); + var d = b.index || b.field || b; + E(d) && (d = [d]); + for (var e = 0, g, f = void 0; e < d.length; e++) { + g = d[e], E(g) || (f = g, g = g.field), f = F(f) ? Object.assign({}, a, f) : a, this.A && (c[g] = new R(f), c[g].A || (this.A = !1)), this.A || (c[g] = new N(f, this.register)), this.I[e] = U(g, this.m), this.h[e] = g; + } + if (this.o) { + for (a = b.store, E(a) && (a = [a]), b = 0; b < a.length; b++) { + this.o[b] = U(a[b], this.m); + } + } + this.index = c; +} +function U(a, b) { + for (var c = a.split(":"), d = 0, e = 0; e < c.length; e++) { + a = c[e], 0 <= a.indexOf("[]") && (a = a.substring(0, a.length - 2)) && (b[d] = !0), a && (c[d++] = a); + } + d < c.length && (c.length = d); + return 1 < d ? c : c[0]; +} +function V(a, b) { + if (E(b)) { + a = a[b]; + } else { + for (var c = 0; a && c < b.length; c++) { + a = a[b[c]]; + } + } + return a; +} +function W(a, b, c, d, e) { + a = a[e]; + if (d === c.length - 1) { + b[e] = a; + } else if (a) { + if (a.constructor === Array) { + for (b = b[e] = Array(a.length), e = 0; e < a.length; e++) { + W(a, b, c, d, e); + } + } else { + b = b[e] || (b[e] = D()), e = c[++d], W(a, b, c, d, e); + } + } +} +function X(a, b, c, d, e, g, f, h) { + if (a = a[f]) { + if (d === b.length - 1) { + if (a.constructor === Array) { + if (c[d]) { + for (b = 0; b < a.length; b++) { + e.add(g, a[b], !0, !0); + } + return; + } + a = a.join(" "); + } + e.add(g, a, h, !0); + } else { + if (a.constructor === Array) { + for (f = 0; f < a.length; f++) { + X(a, b, c, d, e, g, f, h); + } + } else { + f = b[++d], X(a, b, c, d, e, g, f, h); + } + } + } +} +t = T.prototype; +t.add = function(a, b, c) { + F(a) && (b = a, a = V(b, this.key)); + if (b && (a || 0 === a)) { + if (!c && this.register[a]) { + return this.update(a, b); + } + for (var d = 0, e, g; d < this.h.length; d++) { + g = this.h[d], e = this.I[d], E(e) && (e = [e]), X(b, e, this.m, 0, this.index[g], a, e[0], c); + } + if (this.D) { + d = V(b, this.D); + e = D(); + E(d) && (d = [d]); + g = 0; + for (var f; g < d.length; g++) { + if (f = d[g], !e[f] && (e[f] = 1, f = this.l[f] || (this.l[f] = []), !c || !f.includes(a))) { + if (f[f.length] = a, this.s) { + var h = this.register[a] || (this.register[a] = []); + h[h.length] = f; + } + } + } + } + if (this.store && (!c || !this.store[a])) { + if (this.o) { + var k = D(); + for (c = 0; c < this.o.length; c++) { + d = this.o[c], E(d) ? k[d] = b[d] : W(b, k, d, 0, d[0]); + } + } + this.store[a] = k || b; + } + } + return this; +}; +t.append = function(a, b) { + return this.add(a, b, !0); +}; +t.update = function(a, b) { + return this.remove(a).add(a, b); +}; +t.remove = function(a) { + F(a) && (a = V(a, this.key)); + if (this.register[a]) { + for (var b = 0; b < this.h.length && (this.index[this.h[b]].remove(a, !this.A), !this.s); b++) { + } + if (this.D && !this.s) { + for (var c in this.l) { + b = this.l[c]; + var d = b.indexOf(a); + -1 !== d && (1 < b.length ? b.splice(d, 1) : delete this.l[c]); + } + } + this.store && delete this.store[a]; + delete this.register[a]; + } + return this; +}; +t.search = function(a, b, c, d) { + c || (!b && F(a) ? (c = a, a = "") : F(b) && (c = b, b = 0)); + var e = [], g = [], f, h = 0; + if (c) { + if (c.constructor === Array) { + var k = c; + c = null; + } else { + a = c.query || a; + k = (f = c.pluck) || c.index || c.field; + var l = c.tag; + var m = this.store && c.enrich; + var p = "and" === c.bool; + b = c.limit || b || 100; + var n = c.offset || 0; + if (l && (E(l) && (l = [l]), !a)) { + g = 0; + for (f = void 0; g < l.length; g++) { + if (f = Da.call(this, l[g], b, n, m)) { + e[e.length] = f, h++; + } + } + return h ? e : []; + } + E(k) && (k = [k]); + } + } + k || (k = this.h); + p = p && (1 < k.length || l && 1 < l.length); + for (var q = !d && (this.A || this.async) && [], r = 0, u = void 0, A = void 0, w = void 0; r < k.length; r++) { + if (w = void 0, A = k[r], E(A) || (w = A, A = w.field, a = w.query || a, b = w.limit || b, m = w.enrich || m), q) { + q[r] = this.index[A].searchAsync(a, b, w || c); + } else { + d ? u = d[r] : u = this.index[A].search(a, b, w || c); + w = u && u.length; + if (l && w) { + var z = [], B = 0; + p && (z[0] = [u]); + var Z = 0, H = void 0; + for (H = void 0; Z < l.length; Z++) { + if (H = l[Z], w = (H = this.l[H]) && H.length) { + B++, z[z.length] = p ? [H] : H; + } + } + B && (u = p ? sa(z, b || 100, n || 0) : ta(u, z), w = u.length); + } + if (w) { + g[h] = A, e[h++] = u; + } else if (p) { + return []; + } + } + } + if (q) { + var La = this; + return new Promise(function(Ma) { + Promise.all(q).then(function(Na) { + Ma(La.search(a, b, c, Na)); + }); + }); + } + if (!h) { + return []; + } + if (f && (!m || !this.store)) { + return e[0]; + } + l = 0; + for (n = void 0; l < g.length; l++) { + n = e[l]; + n.length && m && (n = Ea.call(this, n)); + if (f) { + return n; + } + e[l] = {field:g[l], result:n}; + } + return e; +}; +function Da(a, b, c, d) { + var e = this.l[a], g = e && e.length - c; + if (g && 0 < g) { + if (g > b || c) { + e = e.slice(c, c + b); + } + d && (e = Ea.call(this, e)); + return {tag:a, result:e}; + } +} +function Ea(a) { + for (var b = Array(a.length), c = 0, d; c < a.length; c++) { + d = a[c], b[c] = {id:d, doc:this.store[d]}; + } + return b; +} +t.contain = function(a) { + return !!this.register[a]; +}; +t.get = function(a) { + return this.store[a]; +}; +t.set = function(a, b) { + this.store[a] = b; + return this; +}; +t.searchCache = ua; +t.export = function(a, b, c, d, e, g) { + var f; + "undefined" === typeof g && (f = new Promise(function(p) { + g = p; + })); + e || (e = 0); + d || (d = 0); + if (d < this.h.length) { + var h = this.h[d], k = this.index[h]; + b = this; + setTimeout(function() { + k.export(a, b, e ? h : "", d, e++, g) || (d++, e = 1, b.export(a, b, h, d, e, g)); + }); + } else { + switch(e) { + case 1: + var l = "tag"; + var m = this.l; + c = null; + break; + case 2: + l = "store"; + m = this.store; + c = null; + break; + default: + g(); + return; + } + wa(a, this, c, l, d, e, m, g); + } + return f; +}; +t.import = function(a, b) { + if (b) { + switch(E(b) && (b = JSON.parse(b)), a) { + case "tag": + this.l = b; + break; + case "reg": + this.s = !1; + this.register = b; + a = 0; + for (var c; a < this.h.length; a++) { + c = this.index[this.h[a]], c.register = b, c.s = !1; + } + break; + case "store": + this.store = b; + break; + default: + a = a.split("."), c = a[0], a = a[1], c && a && this.index[c].import(a, b); + } + } +}; +ra(T.prototype); +var Ga = {encode:Fa, G:!1, H:""}, Ha = [J("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"), "a", J("[\u00e8\u00e9\u00ea\u00eb]"), "e", J("[\u00ec\u00ed\u00ee\u00ef]"), "i", J("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"), "o", J("[\u00f9\u00fa\u00fb\u00fc\u0171]"), "u", J("[\u00fd\u0177\u00ff]"), "y", J("\u00f1"), "n", J("[\u00e7c]"), "k", J("\u00df"), "s", J(" & "), " and "]; +function Fa(a) { + var b = a = "" + a; + b.normalize && (b = b.normalize("NFD").replace(la, "")); + return ja.call(this, b.toLowerCase(), !a.normalize && Ha); +} +;var Ja = {encode:Ia, G:!1, H:"strict"}, Ka = /[^a-z0-9]+/, Oa = {b:"p", v:"f", w:"f", z:"s", x:"s", "\u00df":"s", d:"t", n:"m", c:"k", g:"k", j:"k", q:"k", i:"e", y:"e", u:"o"}; +function Ia(a) { + a = Fa.call(this, a).join(" "); + var b = []; + if (a) { + for (var c = a.split(Ka), d = c.length, e = 0, g, f = 0; e < d; e++) { + if ((a = c[e]) && (!this.filter || !this.filter[a])) { + g = a[0]; + for (var h = Oa[g] || g, k = h, l = 1; l < a.length; l++) { + g = a[l], (g = Oa[g] || g) && g !== k && (h += g, k = g); + } + b[f++] = h; + } + } + } + return b; +} +;var Qa = {encode:Pa, G:!1, H:""}, Ra = [J("ae"), "a", J("oe"), "o", J("sh"), "s", J("th"), "t", J("ph"), "f", J("pf"), "f", J("(?![aeo])h(?![aeo])"), "", J("(?!^[aeo])h(?!^[aeo])"), ""]; +function Pa(a, b) { + a && (a = Ia.call(this, a).join(" "), 2 < a.length && (a = I(a, Ra)), b || (1 < a.length && (a = na(a)), a && (a = a.split(" ")))); + return a || []; +} +;var Ta = {encode:Sa, G:!1, H:""}, Ua = J("(?!\\b)[aeo]"); +function Sa(a) { + a && (a = Pa.call(this, a, !0), 1 < a.length && (a = a.replace(Ua, "")), 1 < a.length && (a = na(a)), a && (a = a.split(" "))); + return a || []; +} +;K["latin:default"] = pa; +K["latin:simple"] = Ga; +K["latin:balance"] = Ja; +K["latin:advanced"] = Qa; +K["latin:extra"] = Ta; +var Y = self, Va, Wa = {Index:N, Document:T, Worker:R, registerCharset:function(a, b) { + K[a] = b; +}, registerLanguage:function(a, b) { + qa[a] = b; +}}; +(Va = Y.define) && Va.amd ? Va([], function() { + return Wa; +}) : Y.exports ? Y.exports = Wa : Y.FlexSearch = Wa; +}(this)); diff --git a/dist/flexsearch.es5.js b/dist/flexsearch.es5.js deleted file mode 100644 index f3317d4..0000000 --- a/dist/flexsearch.es5.js +++ /dev/null @@ -1,46 +0,0 @@ -/**! - * FlexSearch.js v0.7.31 (ES5) - * Author and Copyright: Thomas Wilkerling - * Licence: Apache-2.0 - * Hosted by Nextapps GmbH - * https://github.com/nextapps-de/flexsearch - */ -(function(self){'use strict';var t;function aa(a){var b=0;return function(){return b>>0)+"_",f=0;return b}); -y("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;cc&&(c=Math.max(c+f,0));c=this.C&&(e||!g[l])){var n=O(h,d,k),m="";switch(this.H){case "full":if(2n;q--)if(q-n>=this.C){var r=O(h,d,k,p,n);m=l.substring(n,q);P(this,g,m,r,a,c)}break}case "reverse":if(1=this.C&&P(this,g,m,O(h,d,k, -p,q),a,c);m=""}case "forward":if(1=this.C&&P(this,g,m,n,a,c);break}default:if(this.o&&(n=Math.min(n/this.o(b,l,k)|0,h-1)),P(this,g,l,n,a,c),e&&1=this.C&&!p[l]){p[l]=1;var u=this.l&&l>n;P(this,f,u?n:l,O(m+(d/2>m?0:1),d,k,q-1,r-1),a,c,u?l:n)}}}}this.s||(this.register[a]=1)}}return this}; -function O(a,b,c,d,f){return c&&1=this.C&&!c[n])if(this.B||e||this.map[n])k[p++]=n,c[n]=1;else return d;a=k;h=a.length}}if(!h)return d;b||(b=100);g=this.depth&&1=d)))break;if(p){if(g)return ya(k,d,0);b[b.length]=k;return}}return!c&&k}function ya(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} -function za(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)}; -t.remove=function(a,b){var c=this.register[a];if(c){if(this.s)for(var d=0,f;db||c)f=f.slice(c,c+b);d&&(f=Ea.call(this,f));return{tag:a,result:f}}}function Ea(a){for(var b=Array(a.length),c=0,d;c>>0)+"_",e=0;return b}); +y("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;cc&&(c=Math.max(c+e,0));c=this.C&&(f||!g[l])){var p=O(h,d,k),n="";switch(this.H){case "full":if(2p;q--)if(q-p>=this.C){var r=O(h,d,k,m,p);n=l.substring(p,q);P(this,g,n,r,a,c)}break}case "reverse":if(1=this.C&&P(this,g,n,O(h,d,k, +m,q),a,c);n=""}case "forward":if(1=this.C&&P(this,g,n,p,a,c);break}default:if(this.o&&(p=Math.min(p/this.o(b,l,k)|0,h-1)),P(this,g,l,p,a,c),f&&1=this.C&&!m[l]){m[l]=1;var u=this.l&&l>p;P(this,e,u?p:l,O(n+(d/2>n?0:1),d,k,q-1,r-1),a,c,u?l:p)}}}}this.s||(this.register[a]=1)}}return this}; +function O(a,b,c,d,e){return c&&1=this.C&&!c[p])if(this.B||f||this.map[p])k[m++]=p,c[p]=1;else return d;a=k;h=a.length}}if(!h)return d;b||(b=100);g=this.depth&&1=d)))break;if(m){if(g)return ya(k,d,0);b[b.length]=k;return}}return!c&&k}function ya(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} +function za(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}t.contain=function(a){return!!this.register[a]};t.update=function(a,b){return this.remove(a).add(a,b)}; +t.remove=function(a,b){var c=this.register[a];if(c){if(this.s)for(var d=0,e;db||c)e=e.slice(c,c+b);d&&(e=Ea.call(this,e));return{tag:a,result:e}}}function Ea(a){for(var b=Array(a.length),c=0,d;c= this.h && (r || !m[k])) { + var h = J(p, d, q), f = ""; + switch(this.B) { + case "full": + if (2 < e) { + for (h = 0; h < e; h++) { + for (var g = e; g > h; g--) { + if (g - h >= this.h) { + var l = J(p, d, q, e, h); + f = k.substring(h, g); + K(this, m, f, l, a, c); + } + } + } + break; + } + case "reverse": + if (1 < e) { + for (g = e - 1; 0 < g; g--) { + f = k[g] + f, f.length >= this.h && K(this, m, f, J(p, d, q, e, g), a, c); + } + f = ""; + } + case "forward": + if (1 < e) { + for (g = 0; g < e; g++) { + f += k[g], f.length >= this.h && K(this, m, f, h, a, c); + } + break; + } + default: + if (this.C && (h = Math.min(h / this.C(b, k, q) | 0, p - 1)), K(this, m, k, h, a, c), r && 1 < d && q < d - 1) { + for (e = y(), f = this.v, h = k, g = Math.min(r + 1, d - q), e[h] = 1, l = 1; l < g; l++) { + if ((k = b[this.u ? d - 1 - q - l : q + l]) && k.length >= this.h && !e[k]) { + e[k] = 1; + const u = this.j && k > h; + K(this, n, u ? h : k, J(f + (d / 2 > f ? 0 : 1), d, q, g - 1, l - 1), a, c, u ? k : h); + } + } + } + } + } + } + this.m || (this.register[a] = 1); + } + } + return this; +}; +function J(a, b, c, d, e) { + return c && 1 < a ? b + (d || 0) <= a ? c + (e || 0) : (a - 1) / (b + (d || 0)) * (c + (e || 0)) + 1 | 0 : 0; +} +function K(a, b, c, d, e, h, f) { + let g = f ? a.l : a.map; + if (!b[c] || f && !b[c][f]) { + a.g && (g = g[d]), f ? (b = b[c] || (b[c] = y()), b[f] = 1, g = g[f] || (g[f] = y())) : b[c] = 1, g = g[c] || (g[c] = []), a.g || (g = g[d] || (g[d] = [])), h && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g)); + } +} +I.prototype.search = function(a, b, c) { + c || (b || "object" !== typeof a ? "object" === typeof b && (c = b) : (c = a, a = c.query)); + let d = [], e; + let h, f = 0; + if (c) { + a = c.query || a; + b = c.limit; + f = c.offset || 0; + var g = c.context; + h = !1; + } + if (a && (a = this.encode("" + a), e = a.length, 1 < e)) { + c = y(); + var l = []; + for (let m = 0, r = 0, p; m < e; m++) { + if ((p = a[m]) && p.length >= this.h && !c[p]) { + if (this.g || h || this.map[p]) { + l[r++] = p, c[p] = 1; + } else { + return d; + } + } + } + a = l; + e = a.length; + } + if (!e) { + return d; + } + b || (b = 100); + g = this.i && 1 < e && !1 !== g; + c = 0; + let n; + g ? (n = a[0], c = 1) : 1 < e && a.sort(z); + for (let m, r; c < e; c++) { + r = a[c]; + g ? (m = L(this, d, h, b, f, 2 === e, r, n), h && !1 === m && d.length || (n = r)) : m = L(this, d, h, b, f, 1 === e, r); + if (m) { + return m; + } + if (h && c === e - 1) { + l = d.length; + if (!l) { + if (g) { + g = 0; + c = -1; + continue; + } + return d; + } + if (1 === l) { + return O(d[0], b, f); + } + } + } + return H(d, b, f, h); +}; +function L(a, b, c, d, e, h, f, g) { + let l = [], n = g ? a.l : a.map; + a.g || (n = P(n, f, g, a.j)); + if (n) { + let m = 0; + const r = Math.min(n.length, g ? a.v : a.s); + for (let p = 0, q = 0, k, u; p < r; p++) { + if (k = n[p]) { + if (a.g && (k = P(k, f, g, a.j)), e && k && h && (u = k.length, u <= e ? (e -= u, k = null) : (k = k.slice(e), e = 0)), k && (l[m++] = k, h && (q += k.length, q >= d))) { + break; + } + } + } + if (m) { + if (h) { + return O(l, d, 0); + } + b[b.length] = l; + return; + } + } + return !c && l; +} +function O(a, b, c) { + a = 1 === a.length ? a[0] : [].concat.apply([], a); + return c || a.length > b ? a.slice(c, c + b) : a; +} +function P(a, b, c, d) { + c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b]; + return a; +} +I.prototype.contain = function(a) { + return !!this.register[a]; +}; +I.prototype.update = function(a, b) { + return this.remove(a).add(a, b); +}; +I.prototype.remove = function(a, b) { + const c = this.register[a]; + if (c) { + if (this.m) { + for (let d = 0, e; d < c.length; d++) { + e = c[d], e.splice(e.indexOf(a), 1); + } + } else { + Q(this.map, a, this.s, this.g), this.i && Q(this.l, a, this.v, this.g); + } + b || delete this.register[a]; + } + return this; +}; +function Q(a, b, c, d, e) { + let h = 0; + if (a.constructor === Array) { + if (e) { + b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), h++) : h++; + } else { + e = Math.min(a.length, c); + for (let f = 0, g; f < e; f++) { + if (g = a[f]) { + h = Q(g, b, c, d, e), d || h || delete a[f]; + } + } + } + } else { + for (let f in a) { + (h = Q(a[f], b, c, d, e)) || delete a[f]; + } + } + return h; +} +;const R = self; +let S; +const T = {Index:I, Document:null, Worker:null, registerCharset:function(a, b) { + G[a] = b; +}, registerLanguage:function(a, b) { + F[a] = b; +}}; +(S = R.define) && S.amd ? S([], function() { + return T; +}) : R.exports ? R.exports = T : R.FlexSearch = T; +}(this)); diff --git a/dist/flexsearch.light.js b/dist/flexsearch.light.js deleted file mode 100644 index 3fce3dd..0000000 --- a/dist/flexsearch.light.js +++ /dev/null @@ -1,18 +0,0 @@ -/**! - * FlexSearch.js v0.7.31 (Light) - * Author and Copyright: Thomas Wilkerling - * Licence: Apache-2.0 - * Hosted by Nextapps GmbH - * https://github.com/nextapps-de/flexsearch - */ -(function(self){'use strict';function t(a){return"undefined"!==typeof a?a:!0}function v(a){const c=Array(a);for(let b=0;b=this.h&&(r||!m[k])){var h=J(p,d,q),f="";switch(this.B){case "full":if(2h;g--)if(g-h>=this.h){var l=J(p,d,q,e,h);f=k.substring(h,g);K(this,m,f,l,a,b)}break}case "reverse":if(1=this.h&&K(this, -m,f,J(p,d,q,e,g),a,b);f=""}case "forward":if(1=this.h&&K(this,m,f,h,a,b);break}default:if(this.C&&(h=Math.min(h/this.C(c,k,q)|0,p-1)),K(this,m,k,h,a,b),r&&1=this.h&&!e[k]){e[k]=1;const u=this.j&&k>h;K(this,n,u?h:k,J(f+(d/2>f?0:1),d,q,g-1,l-1),a,b,u?k:h)}}}}this.m||(this.register[a]=1)}}return this}; -function J(a,c,b,d,e){return b&&1=this.h&&!b[p])if(this.g||h||this.map[p])l[r++]=p,b[p]=1;else return d;a=l;e=a.length}if(!e)return d;c||(c=100);g=this.i&&1=d)))break;if(m){if(h)return O(l,d,0);c[c.length]=l;return}}return!b&&l}function O(a,c,b){a=1===a.length?a[0]:[].concat.apply([],a);return b||a.length>c?a.slice(b,b+c):a} -function P(a,c,b,d){b?(d=d&&c>b,a=(a=a[d?c:b])&&a[d?b:c]):a=a[c];return a}I.prototype.contain=function(a){return!!this.register[a]};I.prototype.update=function(a,c){return this.remove(a).add(a,c)};I.prototype.remove=function(a,c){const b=this.register[a];if(b){if(this.m)for(let d=0,e;d=this.h&&(r||!m[k])){var h=J(p,d,q),f="";switch(this.B){case "full":if(2h;g--)if(g-h>=this.h){var l=J(p,d,q,e,h);f=k.substring(h,g);K(this,m,f,l,a,c)}break}case "reverse":if(1=this.h&&K(this, +m,f,J(p,d,q,e,g),a,c);f=""}case "forward":if(1=this.h&&K(this,m,f,h,a,c);break}default:if(this.C&&(h=Math.min(h/this.C(b,k,q)|0,p-1)),K(this,m,k,h,a,c),r&&1=this.h&&!e[k]){e[k]=1;const u=this.j&&k>h;K(this,n,u?h:k,J(f+(d/2>f?0:1),d,q,g-1,l-1),a,c,u?k:h)}}}}this.m||(this.register[a]=1)}}return this}; +function J(a,b,c,d,e){return c&&1=this.h&&!c[p])if(this.g||h||this.map[p])l[r++]=p,c[p]=1;else return d;a=l;e=a.length}if(!e)return d;b||(b=100);g=this.i&&1=d)))break;if(m){if(h)return O(l,d,0);b[b.length]=l;return}}return!c&&l}function O(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} +function P(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}I.prototype.contain=function(a){return!!this.register[a]};I.prototype.update=function(a,b){return this.remove(a).add(a,b)};I.prototype.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d= this.h && (r || !m[k])) { + var h = J(p, d, q), f = ""; + switch(this.B) { + case "full": + if (2 < e) { + for (h = 0; h < e; h++) { + for (var g = e; g > h; g--) { + if (g - h >= this.h) { + var l = J(p, d, q, e, h); + f = k.substring(h, g); + K(this, m, f, l, a, c); + } + } + } + break; + } + case "reverse": + if (1 < e) { + for (g = e - 1; 0 < g; g--) { + f = k[g] + f, f.length >= this.h && K(this, m, f, J(p, d, q, e, g), a, c); + } + f = ""; + } + case "forward": + if (1 < e) { + for (g = 0; g < e; g++) { + f += k[g], f.length >= this.h && K(this, m, f, h, a, c); + } + break; + } + default: + if (this.C && (h = Math.min(h / this.C(b, k, q) | 0, p - 1)), K(this, m, k, h, a, c), r && 1 < d && q < d - 1) { + for (e = y(), f = this.v, h = k, g = Math.min(r + 1, d - q), e[h] = 1, l = 1; l < g; l++) { + if ((k = b[this.u ? d - 1 - q - l : q + l]) && k.length >= this.h && !e[k]) { + e[k] = 1; + const u = this.j && k > h; + K(this, n, u ? h : k, J(f + (d / 2 > f ? 0 : 1), d, q, g - 1, l - 1), a, c, u ? k : h); + } + } + } + } + } + } + this.m || (this.register[a] = 1); + } + } + return this; +}; +function J(a, b, c, d, e) { + return c && 1 < a ? b + (d || 0) <= a ? c + (e || 0) : (a - 1) / (b + (d || 0)) * (c + (e || 0)) + 1 | 0 : 0; +} +function K(a, b, c, d, e, h, f) { + let g = f ? a.l : a.map; + if (!b[c] || f && !b[c][f]) { + a.g && (g = g[d]), f ? (b = b[c] || (b[c] = y()), b[f] = 1, g = g[f] || (g[f] = y())) : b[c] = 1, g = g[c] || (g[c] = []), a.g || (g = g[d] || (g[d] = [])), h && g.includes(e) || (g[g.length] = e, a.m && (a = a.register[e] || (a.register[e] = []), a[a.length] = g)); + } +} +I.prototype.search = function(a, b, c) { + c || (b || "object" !== typeof a ? "object" === typeof b && (c = b) : (c = a, a = c.query)); + let d = [], e; + let h, f = 0; + if (c) { + a = c.query || a; + b = c.limit; + f = c.offset || 0; + var g = c.context; + h = !1; + } + if (a && (a = this.encode("" + a), e = a.length, 1 < e)) { + c = y(); + var l = []; + for (let m = 0, r = 0, p; m < e; m++) { + if ((p = a[m]) && p.length >= this.h && !c[p]) { + if (this.g || h || this.map[p]) { + l[r++] = p, c[p] = 1; + } else { + return d; + } + } + } + a = l; + e = a.length; + } + if (!e) { + return d; + } + b || (b = 100); + g = this.i && 1 < e && !1 !== g; + c = 0; + let n; + g ? (n = a[0], c = 1) : 1 < e && a.sort(z); + for (let m, r; c < e; c++) { + r = a[c]; + g ? (m = L(this, d, h, b, f, 2 === e, r, n), h && !1 === m && d.length || (n = r)) : m = L(this, d, h, b, f, 1 === e, r); + if (m) { + return m; + } + if (h && c === e - 1) { + l = d.length; + if (!l) { + if (g) { + g = 0; + c = -1; + continue; + } + return d; + } + if (1 === l) { + return O(d[0], b, f); + } + } + } + return H(d, b, f, h); +}; +function L(a, b, c, d, e, h, f, g) { + let l = [], n = g ? a.l : a.map; + a.g || (n = P(n, f, g, a.j)); + if (n) { + let m = 0; + const r = Math.min(n.length, g ? a.v : a.s); + for (let p = 0, q = 0, k, u; p < r; p++) { + if (k = n[p]) { + if (a.g && (k = P(k, f, g, a.j)), e && k && h && (u = k.length, u <= e ? (e -= u, k = null) : (k = k.slice(e), e = 0)), k && (l[m++] = k, h && (q += k.length, q >= d))) { + break; + } + } + } + if (m) { + if (h) { + return O(l, d, 0); + } + b[b.length] = l; + return; + } + } + return !c && l; +} +function O(a, b, c) { + a = 1 === a.length ? a[0] : [].concat.apply([], a); + return c || a.length > b ? a.slice(c, c + b) : a; +} +function P(a, b, c, d) { + c ? (d = d && b > c, a = (a = a[d ? b : c]) && a[d ? c : b]) : a = a[b]; + return a; +} +I.prototype.contain = function(a) { + return !!this.register[a]; +}; +I.prototype.update = function(a, b) { + return this.remove(a).add(a, b); +}; +I.prototype.remove = function(a, b) { + const c = this.register[a]; + if (c) { + if (this.m) { + for (let d = 0, e; d < c.length; d++) { + e = c[d], e.splice(e.indexOf(a), 1); + } + } else { + Q(this.map, a, this.s, this.g), this.i && Q(this.l, a, this.v, this.g); + } + b || delete this.register[a]; + } + return this; +}; +function Q(a, b, c, d, e) { + let h = 0; + if (a.constructor === Array) { + if (e) { + b = a.indexOf(b), -1 !== b ? 1 < a.length && (a.splice(b, 1), h++) : h++; + } else { + e = Math.min(a.length, c); + for (let f = 0, g; f < e; f++) { + if (g = a[f]) { + h = Q(g, b, c, d, e), d || h || delete a[f]; + } + } + } + } else { + for (let f in a) { + (h = Q(a[f], b, c, d, e)) || delete a[f]; + } + } + return h; +} +;const R = self; +let S; +const T = {Index:I, Document:null, Worker:null, registerCharset:function(a, b) { + G[a] = b; +}, registerLanguage:function(a, b) { + F[a] = b; +}}; +(S = R.define) && S.amd ? S([], function() { + return T; +}) : R.exports ? R.exports = T : R.FlexSearch = T; + diff --git a/dist/flexsearch.light.module.min.js b/dist/flexsearch.light.module.min.js new file mode 100644 index 0000000..ee4561a --- /dev/null +++ b/dist/flexsearch.light.module.min.js @@ -0,0 +1,18 @@ +/**! + * FlexSearch.js v0.7.39 (Light.module) + * Author and Copyright: Thomas Wilkerling + * Licence: Apache-2.0 + * Hosted by Nextapps GmbH + * https://github.com/nextapps-de/flexsearch + */ +function t(a){return"undefined"!==typeof a?a:!0}function v(a){const b=Array(a);for(let c=0;c=this.h&&(r||!m[k])){var h=J(p,d,q),f="";switch(this.B){case "full":if(2h;g--)if(g-h>=this.h){var l=J(p,d,q,e,h);f=k.substring(h,g);K(this,m,f,l,a,c)}break}case "reverse":if(1=this.h&&K(this, +m,f,J(p,d,q,e,g),a,c);f=""}case "forward":if(1=this.h&&K(this,m,f,h,a,c);break}default:if(this.C&&(h=Math.min(h/this.C(b,k,q)|0,p-1)),K(this,m,k,h,a,c),r&&1=this.h&&!e[k]){e[k]=1;const u=this.j&&k>h;K(this,n,u?h:k,J(f+(d/2>f?0:1),d,q,g-1,l-1),a,c,u?k:h)}}}}this.m||(this.register[a]=1)}}return this}; +function J(a,b,c,d,e){return c&&1=this.h&&!c[p])if(this.g||h||this.map[p])l[r++]=p,c[p]=1;else return d;a=l;e=a.length}if(!e)return d;b||(b=100);g=this.i&&1=d)))break;if(m){if(h)return O(l,d,0);b[b.length]=l;return}}return!c&&l}function O(a,b,c){a=1===a.length?a[0]:[].concat.apply([],a);return c||a.length>b?a.slice(c,c+b):a} +function P(a,b,c,d){c?(d=d&&b>c,a=(a=a[d?b:c])&&a[d?c:b]):a=a[b];return a}I.prototype.contain=function(a){return!!this.register[a]};I.prototype.update=function(a,b){return this.remove(a).add(a,b)};I.prototype.remove=function(a,b){const c=this.register[a];if(c){if(this.m)for(let d=0,e;d} + */ + +export function searchCache(query, limit, options) { + + if (is_object(query)) { + + query = query.query; + } + + let cache = this.cache.get(query); + + if (!cache) { + + cache = this.search(query, limit, options); + this.cache.set(query, cache); + } + + return cache; +} + +// CacheClass.prototype.clear = function(){ +// +// /** @private */ +// this.cache = create_object(); +// +// /** @private */ +// this.queue = []; +// }; + +CacheClass.prototype.set = function (key, value) { + + if (!this.cache[key]) { + + // it is just a shame that native function array.shift() performs so bad + + // const length = this.queue.length; + // + // this.queue[length] = key; + // + // if(length === this.limit){ + // + // delete this.cache[this.queue.shift()]; + // } + + // the same bad performance + + // this.queue.unshift(key); + // + // if(this.queue.length === this.limit){ + // + // this.queue.pop(); + // } + + // fast implementation variant + + // let length = this.queue.length; + // + // if(length === this.limit){ + // + // length--; + // + // delete this.cache[this.queue[0]]; + // + // for(let x = 0; x < length; x++){ + // + // this.queue[x] = this.queue[x + 1]; + // } + // } + // + // this.queue[length] = key; + + // current fastest implementation variant + // theoretically that should not perform better compared to the example above + + let length = this.queue.length; + + if (length === this.limit) { + + delete this.cache[this.queue[length - 1]]; + } else { + + length++; + } + + for (let x = length - 1; 0 < x; x--) { + + this.queue[x] = this.queue[x - 1]; + } + + this.queue[0] = key; + } + + this.cache[key] = value; +}; + +CacheClass.prototype.get = function (key) { + + const cache = this.cache[key]; + + if (this.limit && cache) { + + // probably the indexOf() method performs faster when matched content is on front (left-to-right) + // using lastIndexOf() does not help, it performs almost slower + + const pos = this.queue.indexOf(key); + + // if(pos < this.queue.length - 1){ + // + // const tmp = this.queue[pos]; + // this.queue[pos] = this.queue[pos + 1]; + // this.queue[pos + 1] = tmp; + // } + + if (pos) { + + const tmp = this.queue[pos - 1]; + this.queue[pos - 1] = this.queue[pos]; + this.queue[pos] = tmp; + } + } + + return cache; +}; + +CacheClass.prototype.del = function (id) { + + for (let i = 0, item, key; i < this.queue.length; i++) { + + key = this.queue[i]; + item = this.cache[key]; + + if (item.includes(id)) { + + this.queue.splice(i--, 1); + delete this.cache[key]; + } + } +}; \ No newline at end of file diff --git a/dist/module-debug/common.js b/dist/module-debug/common.js new file mode 100644 index 0000000..95e4ace --- /dev/null +++ b/dist/module-debug/common.js @@ -0,0 +1,78 @@ +export function parse_option(value, default_value) { + + return "undefined" != typeof value ? value : default_value; +} + +/** + * @param {!number} count + * @returns {Array} + */ + +export function create_object_array(count) { + + const array = Array(count); + + for (let i = 0; i < count; i++) { + + array[i] = create_object(); + } + + return array; +} + +export function create_arrays(count) { + + const array = Array(count); + + for (let i = 0; i < count; i++) { + + array[i] = []; + } + + return array; +} + +/** + * @param {!Object} obj + * @returns {Array} + */ + +export function get_keys(obj) { + + return Object.keys(obj); +} + +export function create_object() { + + return Object.create(null); +} + +export function concat(arrays) { + + return [].concat.apply([], arrays); +} + +export function sort_by_length_down(a, b) { + + return b.length - a.length; +} + +export function is_array(val) { + + return val.constructor === Array; +} + +export function is_string(val) { + + return "string" == typeof val; +} + +export function is_object(val) { + + return "object" == typeof val; +} + +export function is_function(val) { + + return "function" == typeof val; +} \ No newline at end of file diff --git a/dist/module-debug/document.js b/dist/module-debug/document.js new file mode 100644 index 0000000..e0f7196 --- /dev/null +++ b/dist/module-debug/document.js @@ -0,0 +1,731 @@ +/**! + * FlexSearch.js + * Author and Copyright: Thomas Wilkerling + * Licence: Apache-2.0 + * Hosted by Nextapps GmbH + * https://github.com/nextapps-de/flexsearch + */ + +import Index from "./index.js"; +import { DocumentInterface } from "./type.js"; +import Cache, { searchCache } from "./cache.js"; +import { create_object, is_array, is_string, is_object, parse_option, get_keys } from "./common.js"; +import apply_async from "./async.js"; +import { intersect, intersect_union } from "./intersect.js"; +import { exportDocument, importDocument } from "./serialize.js"; +import WorkerIndex from "./worker/index.js"; + +/** + * @constructor + * @implements {DocumentInterface} + * @param {Object=} options + * @return {Document} + */ + +function Document(options) { + + if (!(this instanceof Document)) { + + return new Document(options); + } + + const document = options.document || options.doc || options; + let opt; + + this.tree = []; + this.field = []; + this.marker = []; + this.register = create_object(); + this.key = (opt = document.key || document.id) && parse_tree(opt, this.marker) || "id"; + this.fastupdate = parse_option(options.fastupdate, /* append: */ /* skip update: */ /* skip_update: */!0); + + this.storetree = (opt = document.store) && !0 !== opt && []; + this.store = opt && create_object(); + + + // TODO case-insensitive tags + + this.tag = (opt = document.tag) && parse_tree(opt, this.marker); + this.tagindex = opt && create_object(); + + + this.cache = (opt = options.cache) && new Cache(opt); + + // do not apply cache again for the indexes + + options.cache = !1; + + + this.worker = options.worker; + + + // this switch is used by recall of promise callbacks + + this.async = !1; + + /** @export */ + this.index = parse_descriptor.call(this, options, document); +} + +export default Document; + +/** + * @this Document + */ + +function parse_descriptor(options, document) { + + const index = create_object(); + let field = document.index || document.field || document; + + if (is_string(field)) { + + field = [field]; + } + + for (let i = 0, key, opt; i < field.length; i++) { + + key = field[i]; + + if (!is_string(key)) { + + opt = key; + key = key.field; + } + + opt = is_object(opt) ? Object.assign({}, options, opt) : options; + + if (this.worker) { + + index[key] = new WorkerIndex(opt); + + if (!index[key].worker) { + + this.worker = !1; + } + } + + if (!this.worker) { + + index[key] = new Index(opt, this.register); + } + + this.tree[i] = parse_tree(key, this.marker); + this.field[i] = key; + } + + if (this.storetree) { + + let store = document.store; + + if (is_string(store)) { + + store = [store]; + } + + for (let i = 0; i < store.length; i++) { + + this.storetree[i] = parse_tree(store[i], this.marker); + } + } + + return index; +} + +function parse_tree(key, marker) { + + const tree = key.split(":"); + let count = 0; + + for (let i = 0; i < tree.length; i++) { + + key = tree[i]; + + if (0 <= key.indexOf("[]")) { + + key = key.substring(0, key.length - 2); + + if (key) { + + marker[count] = !0; + } + } + + if (key) { + + tree[count++] = key; + } + } + + if (count < tree.length) { + + tree.length = count; + } + + return 1 < count ? tree : tree[0]; +} + +// TODO support generic function created from string when tree depth > 1 + +function parse_simple(obj, tree) { + + if (is_string(tree)) { + + obj = obj[tree]; + } else { + + for (let i = 0; obj && i < tree.length; i++) { + + obj = obj[tree[i]]; + } + } + + return obj; +} + +// TODO support generic function created from string when tree depth > 1 + +function store_value(obj, store, tree, pos, key) { + + obj = obj[key]; + + // reached target field + + if (pos === tree.length - 1) { + + // store target value + + store[key] = obj; + } else if (obj) { + + if (is_array(obj)) { + + store = store[key] = Array(obj.length); + + for (let i = 0; i < obj.length; i++) { + + // do not increase pos (an array is not a field) + store_value(obj, store, tree, pos, i); + } + } else { + + store = store[key] || (store[key] = create_object()); + key = tree[++pos]; + + store_value(obj, store, tree, pos, key); + } + } +} + +function add_index(obj, tree, marker, pos, index, id, key, _append) { + + obj = obj[key]; + + if (obj) { + + // reached target field + + if (pos === tree.length - 1) { + + // handle target value + + if (is_array(obj)) { + + // append array contents so each entry gets a new scoring context + + if (marker[pos]) { + + for (let i = 0; i < obj.length; i++) { + + index.add(id, obj[i], !0, !0); + } + + return; + } + + // or join array contents and use one scoring context + + obj = obj.join(" "); + } + + index.add(id, obj, _append, !0); + } else { + + if (is_array(obj)) { + + for (let i = 0; i < obj.length; i++) { + + // do not increase index, an array is not a field + + add_index(obj, tree, marker, pos, index, id, i, _append); + } + } else { + + key = tree[++pos]; + + add_index(obj, tree, marker, pos, index, id, key, _append); + } + } + } +} + +/** + * + * @param id + * @param content + * @param {boolean=} _append + * @returns {Document|Promise} + */ + +Document.prototype.add = function (id, content, _append) { + + if (is_object(id)) { + + content = id; + id = parse_simple(content, this.key); + } + + if (content && (id || 0 === id)) { + + if (!_append && this.register[id]) { + + return this.update(id, content); + } + + for (let i = 0, tree, field; i < this.field.length; i++) { + + field = this.field[i]; + tree = this.tree[i]; + + if (is_string(tree)) { + + tree = [tree]; + } + + add_index(content, tree, this.marker, 0, this.index[field], id, tree[0], _append); + } + + if (this.tag) { + let tag = parse_simple(content, this.tag), + dupes = create_object(); + + + if (is_string(tag)) { + + tag = [tag]; + } + + for (let i = 0, key, arr; i < tag.length; i++) { + + key = tag[i]; + + if (!dupes[key]) { + + dupes[key] = 1; + arr = this.tagindex[key] || (this.tagindex[key] = []); + + if (!_append || !arr.includes(id)) { + + arr[arr.length] = id; + + // add a reference to the register for fast updates + + if (this.fastupdate) { + + const tmp = this.register[id] || (this.register[id] = []); + tmp[tmp.length] = arr; + } + } + } + } + } + + // TODO: how to handle store when appending contents? + + if (this.store && (!_append || !this.store[id])) { + + let store; + + if (this.storetree) { + + store = create_object(); + + for (let i = 0, tree; i < this.storetree.length; i++) { + + tree = this.storetree[i]; + + if (is_string(tree)) { + + store[tree] = content[tree]; + } else { + + store_value(content, store, tree, 0, tree[0]); + } + } + } + + this.store[id] = store || content; + } + } + + return this; +}; + +Document.prototype.append = function (id, content) { + + return this.add(id, content, !0); +}; + +Document.prototype.update = function (id, content) { + + return this.remove(id).add(id, content); +}; + +Document.prototype.remove = function (id) { + + if (is_object(id)) { + + id = parse_simple(id, this.key); + } + + if (this.register[id]) { + + for (let i = 0; i < this.field.length; i++) { + + // workers does not share the register + + this.index[this.field[i]].remove(id, !this.worker); + + if (this.fastupdate) { + + // when fastupdate was enabled all ids are removed + + break; + } + } + + if (this.tag) { + + // when fastupdate was enabled all ids are already removed + + if (!this.fastupdate) { + + for (let key in this.tagindex) { + const tag = this.tagindex[key], + pos = tag.indexOf(id); + + + if (-1 !== pos) { + + if (1 < tag.length) { + + tag.splice(pos, 1); + } else { + + delete this.tagindex[key]; + } + } + } + } + } + + if (this.store) { + + delete this.store[id]; + } + + delete this.register[id]; + } + + return this; +}; + +/** + * @param {!string|Object} query + * @param {number|Object=} limit + * @param {Object=} options + * @param {Array=} _resolve For internal use only. + * @returns {Promise|Array} + */ + +Document.prototype.search = function (query, limit, options, _resolve) { + + if (!options) { + + if (!limit && is_object(query)) { + + options = /** @type {Object} */query; + query = ""; + } else if (is_object(limit)) { + + options = /** @type {Object} */limit; + limit = 0; + } + } + + let result = [], + result_field = [], + pluck, + enrich, + field, + tag, + bool, + offset, + count = 0; + + + if (options) { + + if (is_array(options)) { + + field = options; + options = null; + } else { + + query = options.query || query; + pluck = options.pluck; + field = pluck || options.index || options.field /*|| (is_string(options) && [options])*/; + tag = options.tag; + enrich = this.store && options.enrich; + bool = "and" === options.bool; + limit = options.limit || limit || 100; + offset = options.offset || 0; + + if (tag) { + + if (is_string(tag)) { + + tag = [tag]; + } + + // when tags is used and no query was set, + // then just return the tag indexes + + if (!query) { + + for (let i = 0, res; i < tag.length; i++) { + + res = get_tag.call(this, tag[i], limit, offset, enrich); + + if (res) { + + result[result.length] = res; + count++; + } + } + + return count ? result : []; + } + } + + if (is_string(field)) { + + field = [field]; + } + } + } + + field || (field = this.field); + bool = bool && (1 < field.length || tag && 1 < tag.length); + + const promises = !_resolve && (this.worker || this.async) && []; + + // TODO solve this in one loop below + + for (let i = 0, res, key, len; i < field.length; i++) { + + let field_options; + + key = field[i]; + + if (!is_string(key)) { + + field_options = key; + key = field_options.field; + query = field_options.query || query; + limit = field_options.limit || limit; + enrich = field_options.enrich || enrich; + } + + if (promises) { + + promises[i] = this.index[key].searchAsync(query, limit, field_options || options); + + // just collect and continue + + continue; + } else if (_resolve) { + + res = _resolve[i]; + } else { + + // inherit options also when search? it is just for laziness, Object.assign() has a cost + + res = this.index[key].search(query, limit, field_options || options); + } + + len = res && res.length; + + if (tag && len) { + + const arr = []; + let count = 0; + + if (bool) { + + // prepare for intersection + + arr[0] = [res]; + } + + for (let y = 0, key, res; y < tag.length; y++) { + + key = tag[y]; + res = this.tagindex[key]; + len = res && res.length; + + if (len) { + + count++; + arr[arr.length] = bool ? [res] : res; + } + } + + if (count) { + + if (bool) { + + res = intersect(arr, limit || 100, offset || 0); + } else { + + res = intersect_union(res, arr); + } + + len = res.length; + } + } + + if (len) { + + result_field[count] = key; + result[count++] = res; + } else if (bool) { + + return []; + } + } + + if (promises) { + + const self = this; + + // anyone knows a better workaround of optionally having async promises? + // the promise.all() needs to be wrapped into additional promise, + // otherwise the recursive callback wouldn't run before return + + return new Promise(function (resolve) { + + Promise.all(promises).then(function (result) { + + resolve(self.search(query, limit, options, result)); + }); + }); + } + + if (!count) { + + // fast path "not found" + + return []; + } + + if (pluck && (!enrich || !this.store)) { + + // fast path optimization + + return result[0]; + } + + for (let i = 0, res; i < result_field.length; i++) { + + res = result[i]; + + if (res.length) { + + if (enrich) { + + res = apply_enrich.call(this, res); + } + } + + if (pluck) { + + return res; + } + + result[i] = { + + field: result_field[i], + result: res + }; + } + + return result; +}; + +/** + * @this Document + */ + +function get_tag(key, limit, offset) { + let res = this.tagindex[key], + len = res && res.length - offset; +} + +/** + * @this Document + */ + +function apply_enrich(res) { + + const arr = Array(res.length); + + for (let x = 0, id; x < res.length; x++) { + + id = res[x]; + + arr[x] = { + + id: id, + doc: this.store[id] + }; + } + + return arr; +} + +Document.prototype.contain = function (id) { + + return !!this.register[id]; +}; + +Document.prototype.get = function (id) { + + return this.store[id]; +}; + +Document.prototype.set = function (id, data) { + + this.store[id] = data; + return this; +}; + + +Document.prototype.searchCache = searchCache; + + +Document.prototype.export = exportDocument; +Document.prototype.import = importDocument; + + +apply_async(Document.prototype); \ No newline at end of file diff --git a/dist/module-debug/engine.js b/dist/module-debug/engine.js new file mode 100644 index 0000000..d460eda --- /dev/null +++ b/dist/module-debug/engine.js @@ -0,0 +1,35 @@ + +import { searchCache } from "./cache"; + +/** + * @constructor + * @abstract + */ + +function Engine(index) { + + //if(this.constructor === Engine){ + if (this instanceof Engine) { + + throw new Error("Can't instantiate abstract class!"); + } + + + index.prototype.searchCache = searchCache; + + + index.prototype.addAsync = addAsync; + index.prototype.appendAsync = appendAsync; + index.prototype.searchAsync = searchAsync; + index.prototype.updateAsync = updateAsync; + index.prototype.removeAsync = removeAsync; +} + +Engine.prototype.searchCache = searchCache; + + +Engine.prototype.addAsync = addAsync; +Engine.prototype.appendAsync = appendAsync; +Engine.prototype.searchAsync = searchAsync; +Engine.prototype.updateAsync = updateAsync; +Engine.prototype.removeAsync = removeAsync; \ No newline at end of file diff --git a/dist/module-debug/global.js b/dist/module-debug/global.js new file mode 100644 index 0000000..bd7da48 --- /dev/null +++ b/dist/module-debug/global.js @@ -0,0 +1,22 @@ +export const global_lang = {}; +export const global_charset = {}; + +/** + * @param {!string} name + * @param {Object} charset + */ + +export function registerCharset(name, charset) { + + global_charset[name] = charset; +} + +/** + * @param {!string} name + * @param {Object} lang + */ + +export function registerLanguage(name, lang) { + + global_lang[name] = lang; +} \ No newline at end of file diff --git a/dist/module-debug/index.js b/dist/module-debug/index.js new file mode 100644 index 0000000..d6f8703 --- /dev/null +++ b/dist/module-debug/index.js @@ -0,0 +1,784 @@ +/**! + * FlexSearch.js + * Author and Copyright: Thomas Wilkerling + * Licence: Apache-2.0 + * Hosted by Nextapps GmbH + * https://github.com/nextapps-de/flexsearch + */ + +import { IndexInterface } from "./type.js"; +import { encode as default_encoder } from "./lang/latin/default.js"; +import { create_object, create_object_array, concat, sort_by_length_down, is_array, is_string, is_object, parse_option } from "./common.js"; +import { pipeline, init_stemmer_or_matcher, init_filter } from "./lang.js"; +import { global_lang, global_charset } from "./global.js"; +import apply_async from "./async.js"; +import { intersect } from "./intersect.js"; +import Cache, { searchCache } from "./cache.js"; +import apply_preset from "./preset.js"; +import { exportIndex, importIndex } from "./serialize.js"; + +/** + * @constructor + * @implements IndexInterface + * @param {Object=} options + * @param {Object=} _register + * @return {Index} + */ + +function Index(options, _register) { + + if (!(this instanceof Index)) { + + return new Index(options); + } + + let charset, lang, tmp; + + if (options) { + + options = apply_preset(options); + + + charset = options.charset; + lang = options.lang; + + if (is_string(charset)) { + + if (-1 === charset.indexOf(":")) { + + charset += ":default"; + } + + charset = global_charset[charset]; + } + + if (is_string(lang)) { + + lang = global_lang[lang]; + } + } else { + + options = {}; + } + + let resolution, + optimize, + context = options.context || {}; + + this.encode = options.encode || charset && charset.encode || default_encoder; + this.register = _register || create_object(); + this.resolution = resolution = options.resolution || 9; + this.tokenize = tmp = charset && charset.tokenize || options.tokenize || "strict"; + this.depth = "strict" === tmp && context.depth; + this.bidirectional = parse_option(context.bidirectional, /* append: */ /* skip update: */ /* skip_update: */!0); + this.optimize = optimize = parse_option(options.optimize, !0); + this.fastupdate = parse_option(options.fastupdate, !0); + this.minlength = options.minlength || 1; + this.boost = options.boost; + + // when not using the memory strategy the score array should not pre-allocated to its full length + + this.map = optimize ? create_object_array(resolution) : create_object(); + this.resolution_ctx = resolution = context.resolution || 1; + this.ctx = optimize ? create_object_array(resolution) : create_object(); + this.rtl = charset && charset.rtl || options.rtl; + this.matcher = (tmp = options.matcher || lang && lang.matcher) && init_stemmer_or_matcher(tmp, !1); + this.stemmer = (tmp = options.stemmer || lang && lang.stemmer) && init_stemmer_or_matcher(tmp, !0); + this.filter = (tmp = options.filter || lang && lang.filter) && init_filter(tmp); + + this.cache = (tmp = options.cache) && new Cache(tmp); +} + +export default Index; + +//Index.prototype.pipeline = pipeline; + +/** + * @param {!number|string} id + * @param {!string} content + */ + +Index.prototype.append = function (id, content) { + + return this.add(id, content, !0); +}; + +// TODO: +// string + number as text +// boolean, null, undefined as ? + +/** + * @param {!number|string} id + * @param {!string} content + * @param {boolean=} _append + * @param {boolean=} _skip_update + */ + +Index.prototype.add = function (id, content, _append, _skip_update) { + + if (content && (id || 0 === id)) { + + if (!_skip_update && !_append && this.register[id]) { + + return this.update(id, content); + } + + content = this.encode("" + content); + const length = content.length; + + if (length) { + + // check context dupes to skip all contextual redundancy along a document + + const dupes_ctx = create_object(), + dupes = create_object(), + depth = this.depth, + resolution = this.resolution; + + + for (let i = 0; i < length; i++) { + let term = content[this.rtl ? length - 1 - i : i], + term_length = term.length; + + + // skip dupes will break the context chain + + if (term && term_length >= this.minlength && (depth || !dupes[term])) { + let score = get_score(resolution, length, i), + token = ""; + + + switch (this.tokenize) { + + case "full": + + if (2 < term_length) { + + for (let x = 0; x < term_length; x++) { + + for (let y = term_length; y > x; y--) { + + if (y - x >= this.minlength) { + + const partial_score = get_score(resolution, length, i, term_length, x); + token = term.substring(x, y); + this.push_index(dupes, token, partial_score, id, _append); + } + } + } + + break; + } + + // fallthrough to next case when term length < 3 + + case "reverse": + + // skip last round (this token exist already in "forward") + + if (1 < term_length) { + + for (let x = term_length - 1; 0 < x; x--) { + + token = term[x] + token; + + if (token.length >= this.minlength) { + + const partial_score = get_score(resolution, length, i, term_length, x); + this.push_index(dupes, token, partial_score, id, _append); + } + } + + token = ""; + } + + // fallthrough to next case to apply forward also + + case "forward": + + if (1 < term_length) { + + for (let x = 0; x < term_length; x++) { + + token += term[x]; + + if (token.length >= this.minlength) { + + this.push_index(dupes, token, score, id, _append); + } + } + + break; + } + + // fallthrough to next case when token has a length of 1 + + default: + // case "strict": + + if (this.boost) { + + score = Math.min(0 | score / this.boost(content, term, i), resolution - 1); + } + + this.push_index(dupes, term, score, id, _append); + + // context is just supported by tokenizer "strict" + + if (depth) { + + if (1 < length && i < length - 1) { + + // check inner dupes to skip repeating words in the current context + + const dupes_inner = create_object(), + resolution = this.resolution_ctx, + keyword = term, + size = Math.min(depth + 1, length - i); + + + dupes_inner[keyword] = 1; + + for (let x = 1; x < size; x++) { + + term = content[this.rtl ? length - 1 - i - x : i + x]; + + if (term && term.length >= this.minlength && !dupes_inner[term]) { + + dupes_inner[term] = 1; + + const context_score = get_score(resolution + (length / 2 > resolution ? 0 : 1), length, i, size - 1, x - 1), + swap = this.bidirectional && term > keyword; + + this.push_index(dupes_ctx, swap ? keyword : term, context_score, id, _append, swap ? term : keyword); + } + } + } + } + } + } + } + + this.fastupdate || (this.register[id] = 1); + } + } + + return this; +}; + +/** + * @param {number} resolution + * @param {number} length + * @param {number} i + * @param {number=} term_length + * @param {number=} x + * @returns {number} + */ + +function get_score(resolution, length, i, term_length, x) { + + // console.log("resolution", resolution); + // console.log("length", length); + // console.log("term_length", term_length); + // console.log("i", i); + // console.log("x", x); + // console.log((resolution - 1) / (length + (term_length || 0)) * (i + (x || 0)) + 1); + + // the first resolution slot is reserved for the best match, + // when a query matches the first word(s). + + // also to stretch score to the whole range of resolution, the + // calculation is shift by one and cut the floating point. + // this needs the resolution "1" to be handled additionally. + + // do not stretch the resolution more than the term length will + // improve performance and memory, also it improves scoring in + // most cases between a short document and a long document + + return i && 1 < resolution ? length + (term_length || 0) <= resolution ? i + (x || 0) : 0 | (resolution - 1) / (length + (term_length || 0)) * (i + (x || 0)) + 1 : 0; +} + +/** + * @private + * @param dupes + * @param value + * @param score + * @param id + * @param {boolean=} append + * @param {string=} keyword + */ + +Index.prototype.push_index = function (dupes, value, score, id, append, keyword) { + + let arr = keyword ? this.ctx : this.map; + + if (!dupes[value] || keyword && !dupes[value][keyword]) { + + if (this.optimize) { + + arr = arr[score]; + } + + if (keyword) { + + dupes = dupes[value] || (dupes[value] = create_object()); + dupes[keyword] = 1; + + arr = arr[keyword] || (arr[keyword] = create_object()); + } else { + + dupes[value] = 1; + } + + arr = arr[value] || (arr[value] = []); + + if (!this.optimize) { + + arr = arr[score] || (arr[score] = []); + } + + if (!append || !arr.includes(id)) { + + arr[arr.length] = id; + + // add a reference to the register for fast updates + + if (this.fastupdate) { + + const tmp = this.register[id] || (this.register[id] = []); + tmp[tmp.length] = arr; + } + } + } +}; + +/** + * @param {string|Object} query + * @param {number|Object=} limit + * @param {Object=} options + * @returns {Array} + */ + +Index.prototype.search = function (query, limit, options) { + + if (!options) { + + if (!limit && is_object(query)) { + + options = /** @type {Object} */query; + query = options.query; + } else if (is_object(limit)) { + + options = /** @type {Object} */limit; + } + } + + let result = [], + length, + context, + suggest, + offset = 0; + + + if (options) { + + query = options.query || query; + limit = options.limit; + offset = options.offset || 0; + context = options.context; + suggest = options.suggest; + } + + if (query) { + + query = /** @type {Array} */this.encode("" + query); + length = query.length; + + // TODO: solve this in one single loop below + + if (1 < length) { + const dupes = create_object(), + query_new = []; + + + for (let i = 0, count = 0, term; i < length; i++) { + + term = query[i]; + + if (term && term.length >= this.minlength && !dupes[term]) { + + // this fast path can just apply when not in memory-optimized mode + + if (!this.optimize && !suggest && !this.map[term]) { + + // fast path "not found" + + return result; + } else { + + query_new[count++] = term; + dupes[term] = 1; + } + } + } + + query = query_new; + length = query.length; + } + } + + if (!length) { + + return result; + } + + limit || (limit = 100); + + let depth = this.depth && 1 < length && !1 !== context, + index = 0, + keyword; + + + if (depth) { + + keyword = query[0]; + index = 1; + } else { + + if (1 < length) { + + query.sort(sort_by_length_down); + } + } + + for (let arr, term; index < length; index++) { + + term = query[index]; + + // console.log(keyword); + // console.log(term); + // console.log(""); + + if (depth) { + + arr = this.add_result(result, suggest, limit, offset, 2 === length, term, keyword); + + // console.log(arr); + // console.log(result); + + // when suggestion enabled just forward keyword if term was found + // as long as the result is empty forward the pointer also + + if (!suggest || !1 !== arr || !result.length) { + + keyword = term; + } + } else { + + arr = this.add_result(result, suggest, limit, offset, 1 === length, term); + } + + if (arr) { + + return (/** @type {Array} */arr + ); + } + + // apply suggestions on last loop or fallback + + if (suggest && index == length - 1) { + + let length = result.length; + + if (!length) { + + if (depth) { + + // fallback to non-contextual search when no result was found + + depth = 0; + index = -1; + + continue; + } + + return result; + } else if (1 === length) { + + // fast path optimization + + return single_result(result[0], limit, offset); + } + } + } + + return intersect(result, limit, offset, suggest); +}; + +/** + * Returns an array when the result is done (to stop the process immediately), + * returns false when suggestions is enabled and no result was found, + * or returns nothing when a set was pushed successfully to the results + * + * @private + * @param {Array} result + * @param {Array} suggest + * @param {number} limit + * @param {number} offset + * @param {boolean} single_term + * @param {string} term + * @param {string=} keyword + * @return {Array>|boolean|undefined} + */ + +Index.prototype.add_result = function (result, suggest, limit, offset, single_term, term, keyword) { + let word_arr = [], + arr = keyword ? this.ctx : this.map; + + + if (!this.optimize) { + + arr = get_array(arr, term, keyword, this.bidirectional); + } + + if (arr) { + + let count = 0; + const arr_len = Math.min(arr.length, keyword ? this.resolution_ctx : this.resolution); + + // relevance: + for (let x = 0, size = 0, tmp, len; x < arr_len; x++) { + + tmp = arr[x]; + + if (tmp) { + + if (this.optimize) { + + tmp = get_array(tmp, term, keyword, this.bidirectional); + } + + if (offset) { + + if (tmp && single_term) { + + len = tmp.length; + + if (len <= offset) { + + offset -= len; + tmp = null; + } else { + + tmp = tmp.slice(offset); + offset = 0; + } + } + } + + if (tmp) { + + // keep score (sparse array): + //word_arr[x] = tmp; + + // simplified score order: + word_arr[count++] = tmp; + + if (single_term) { + + size += tmp.length; + + if (size >= limit) { + + // fast path optimization + + break; + } + } + } + } + } + + if (count) { + + if (single_term) { + + // fast path optimization + // offset was already applied at this point + + return single_result(word_arr, limit, 0); + } + + result[result.length] = word_arr; + return; + } + } + + // return an empty array will stop the loop, + // to prevent stop when using suggestions return a false value + + return !suggest && word_arr; +}; + +function single_result(result, limit, offset) { + + if (1 === result.length) { + + result = result[0]; + } else { + + result = concat(result); + } + + return offset || result.length > limit ? result.slice(offset, offset + limit) : result; +} + +function get_array(arr, term, keyword, bidirectional) { + + if (keyword) { + + // the frequency of the starting letter is slightly less + // on the last half of the alphabet (m-z) in almost every latin language, + // so we sort downwards (https://en.wikipedia.org/wiki/Letter_frequency) + + const swap = bidirectional && term > keyword; + + arr = arr[swap ? term : keyword]; + arr = arr && arr[swap ? keyword : term]; + } else { + + arr = arr[term]; + } + + return arr; +} + +Index.prototype.contain = function (id) { + + return !!this.register[id]; +}; + +Index.prototype.update = function (id, content) { + + return this.remove(id).add(id, content); +}; + +/** + * @param {boolean=} _skip_deletion + */ + +Index.prototype.remove = function (id, _skip_deletion) { + + const refs = this.register[id]; + + if (refs) { + + if (this.fastupdate) { + + // fast updates performs really fast but did not fully cleanup the key entries + + for (let i = 0, tmp; i < refs.length; i++) { + + tmp = refs[i]; + tmp.splice(tmp.indexOf(id), 1); + } + } else { + + remove_index(this.map, id, this.resolution, this.optimize); + + if (this.depth) { + + remove_index(this.ctx, id, this.resolution_ctx, this.optimize); + } + } + + _skip_deletion || delete this.register[id]; + + if (this.cache) { + + this.cache.del(id); + } + } + + return this; +}; + +/** + * @param map + * @param id + * @param res + * @param optimize + * @param {number=} resolution + * @return {number} + */ + +function remove_index(map, id, res, optimize, resolution) { + + let count = 0; + + if (is_array(map)) { + + // the first array is the score array in both strategies + + if (!resolution) { + + resolution = Math.min(map.length, res); + + for (let x = 0, arr; x < resolution; x++) { + + arr = map[x]; + + if (arr) { + + count = remove_index(arr, id, res, optimize, resolution); + + if (!optimize && !count) { + + // when not memory optimized the score index should removed + + delete map[x]; + } + } + } + } else { + + const pos = map.indexOf(id); + + if (-1 !== pos) { + + // fast path, when length is 1 or lower then the whole field gets deleted + + if (1 < map.length) { + + map.splice(pos, 1); + count++; + } + } else { + + count++; + } + } + } else { + + for (let key in map) { + + count = remove_index(map[key], id, res, optimize, resolution); + + if (!count) { + + delete map[key]; + } + } + } + + return count; +} + +Index.prototype.searchCache = searchCache; + + +Index.prototype.export = exportIndex; +Index.prototype.import = importIndex; + + +apply_async(Index.prototype); \ No newline at end of file diff --git a/dist/module-debug/intersect.js b/dist/module-debug/intersect.js new file mode 100644 index 0000000..2935747 --- /dev/null +++ b/dist/module-debug/intersect.js @@ -0,0 +1,394 @@ +import { create_object, concat } from "./common.js"; + +/** + * Implementation based on Array.includes() provides better performance, + * but it needs at least one word in the query which is less frequent. + * Also on large indexes it does not scale well performance-wise. + * This strategy also lacks of suggestion capabilities (matching & sorting). + * + * @param arrays + * @param limit + * @param offset + * @param {boolean|Array=} suggest + * @returns {Array} + */ + +// export function intersect(arrays, limit, offset, suggest) { +// +// const length = arrays.length; +// let result = []; +// let check; +// +// // determine shortest array and collect results +// // from the sparse relevance arrays +// +// let smallest_size; +// let smallest_arr; +// let smallest_index; +// +// for(let x = 0; x < length; x++){ +// +// const arr = arrays[x]; +// const len = arr.length; +// +// let size = 0; +// +// for(let y = 0, tmp; y < len; y++){ +// +// tmp = arr[y]; +// +// if(tmp){ +// +// size += tmp.length; +// } +// } +// +// if(!smallest_size || (size < smallest_size)){ +// +// smallest_size = size; +// smallest_arr = arr; +// smallest_index = x; +// } +// } +// +// smallest_arr = smallest_arr.length === 1 ? +// +// smallest_arr[0] +// : +// concat(smallest_arr); +// +// if(suggest){ +// +// suggest = [smallest_arr]; +// check = create_object(); +// } +// +// let size = 0; +// let steps = 0; +// +// // process terms in reversed order often results in better performance. +// // the outer loop must be the words array, using the +// // smallest array here disables the "fast fail" optimization. +// +// for(let x = length - 1; x >= 0; x--){ +// +// if(x !== smallest_index){ +// +// steps++; +// +// const word_arr = arrays[x]; +// const word_arr_len = word_arr.length; +// const new_arr = []; +// +// let count = 0; +// +// for(let z = 0, id; z < smallest_arr.length; z++){ +// +// id = smallest_arr[z]; +// +// let found; +// +// // process relevance in forward order (direction is +// // important for adding IDs during the last round) +// +// for(let y = 0; y < word_arr_len; y++){ +// +// const arr = word_arr[y]; +// +// if(arr.length){ +// +// found = arr.includes(id); +// +// if(found){ +// +// // check if in last round +// +// if(steps === length - 1){ +// +// if(offset){ +// +// offset--; +// } +// else{ +// +// result[size++] = id; +// +// if(size === limit){ +// +// // fast path "end reached" +// +// return result; +// } +// } +// +// if(suggest){ +// +// check[id] = 1; +// } +// } +// +// break; +// } +// } +// } +// +// if(found){ +// +// new_arr[count++] = id; +// } +// } +// +// if(suggest){ +// +// suggest[steps] = new_arr; +// } +// else if(!count){ +// +// return []; +// } +// +// smallest_arr = new_arr; +// } +// } +// +// if(suggest){ +// +// // needs to iterate in reverse direction +// +// for(let x = suggest.length - 1, arr, len; x >= 0; x--){ +// +// arr = suggest[x]; +// len = arr && arr.length; +// +// if(len){ +// +// for(let y = 0, id; y < len; y++){ +// +// id = arr[y]; +// +// if(!check[id]){ +// +// check[id] = 1; +// +// if(offset){ +// +// offset--; +// } +// else{ +// +// result[size++] = id; +// +// if(size === limit){ +// +// // fast path "end reached" +// +// return result; +// } +// } +// } +// } +// } +// } +// } +// +// return result; +// } + +/** + * Implementation based on Object[key] provides better suggestions + * capabilities and has less performance scaling issues on large indexes. + * + * @param arrays + * @param limit + * @param offset + * @param {boolean|Array=} suggest + * @returns {Array} + */ + +export function intersect(arrays, limit, offset, suggest) { + + const length = arrays.length; + let result = [], + check, + check_suggest, + size = 0; + + + if (suggest) { + + suggest = []; + } + + // process terms in reversed order often has advantage for the fast path "end reached". + // also a reversed order prioritize the order of words from a query. + + for (let x = length - 1; 0 <= x; x--) { + const word_arr = arrays[x], + word_arr_len = word_arr.length, + check_new = create_object(); + + + let found = !check; + + // process relevance in forward order (direction is + // important for adding IDs during the last round) + + for (let y = 0; y < word_arr_len; y++) { + const arr = word_arr[y], + arr_len = arr.length; + + + if (arr_len) { + + // loop through IDs + + for (let z = 0, check_idx, id; z < arr_len; z++) { + + id = arr[z]; + + if (check) { + + if (check[id]) { + + // check if in last round + + if (!x) { + + if (offset) { + + offset--; + } else { + + result[size++] = id; + + if (size === limit) { + + // fast path "end reached" + + return result; + } + } + } + + if (x || suggest) { + + check_new[id] = 1; + } + + found = /* append: */ /* skip update: */ /* skip_update: */!0; + } + + if (suggest) { + + check_idx = (check_suggest[id] || 0) + 1; + check_suggest[id] = check_idx; + + // do not adding IDs which are already included in the result (saves one loop) + // the first intersection match has the check index 2, so shift by -2 + + if (check_idx < length) { + + const tmp = suggest[check_idx - 2] || (suggest[check_idx - 2] = []); + tmp[tmp.length] = id; + } + } + } else { + + // pre-fill in first round + + check_new[id] = 1; + } + } + } + } + + if (suggest) { + + // re-use the first pre-filled check for suggestions + + check || (check_suggest = check_new); + } else if (!found) { + + return []; + } + + check = check_new; + } + + if (suggest) { + + // needs to iterate in reverse direction + + for (let x = suggest.length - 1, arr, len; 0 <= x; x--) { + + arr = suggest[x]; + len = arr.length; + + for (let y = 0, id; y < len; y++) { + + id = arr[y]; + + if (!check[id]) { + + if (offset) { + + offset--; + } else { + + result[size++] = id; + + if (size === limit) { + + // fast path "end reached" + + return result; + } + } + + check[id] = 1; + } + } + } + } + + return result; +} + +/** + * @param mandatory + * @param arrays + * @returns {Array} + */ + +export function intersect_union(mandatory, arrays) { + const check = create_object(), + union = create_object(), + result = []; + + + for (let x = 0; x < mandatory.length; x++) { + + check[mandatory[x]] = 1; + } + + for (let x = 0, arr; x < arrays.length; x++) { + + arr = arrays[x]; + + for (let y = 0, id; y < arr.length; y++) { + + id = arr[y]; + + if (check[id]) { + + if (!union[id]) { + + union[id] = 1; + result[result.length] = id; + } + } + } + } + + return result; +} \ No newline at end of file diff --git a/dist/module-debug/lang.js b/dist/module-debug/lang.js new file mode 100644 index 0000000..954ae86 --- /dev/null +++ b/dist/module-debug/lang.js @@ -0,0 +1,321 @@ +import { IndexInterface } from "./type.js"; +import { create_object, get_keys } from "./common.js"; + +/** + * @param {!string} str + * @param {boolean|Array=} normalize + * @param {boolean|string|RegExp=} split + * @param {boolean=} _collapse + * @returns {string|Array} + * @this IndexInterface + */ + +export function pipeline(str, normalize, split, _collapse) { + + if (str) { + + if (normalize) { + + str = replace(str, /** @type {Array} */normalize); + } + + if (this.matcher) { + + str = replace(str, this.matcher); + } + + if (this.stemmer && 1 < str.length) { + + str = replace(str, this.stemmer); + } + + if (_collapse && 1 < str.length) { + + str = collapse(str); + } + + if (split || "" === split) { + + const words = str.split( /** @type {string|RegExp} */split); + + return this.filter ? filter(words, this.filter) : words; + } + } + + return str; +} + +// TODO improve normalize + remove non-delimited chars like in "I'm" + split on whitespace+ + +export const regex_whitespace = /[\p{Z}\p{S}\p{P}\p{C}]+/u; +// https://github.com/nextapps-de/flexsearch/pull/414 +//export const regex_whitespace = /[\s\xA0\u2000-\u200B\u2028\u2029\u3000\ufeff!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/ +const regex_normalize = /[\u0300-\u036f]/g; + +export function normalize(str) { + + if (str.normalize) { + + str = str.normalize("NFD").replace(regex_normalize, ""); + } + + return str; +} + +/** + * @param {!string} str + * @param {boolean|Array=} normalize + * @param {boolean|string|RegExp=} split + * @param {boolean=} _collapse + * @returns {string|Array} + */ + +// FlexSearch.prototype.pipeline = function(str, normalize, split, _collapse){ +// +// if(str){ +// +// if(normalize && str){ +// +// str = replace(str, /** @type {Array} */ (normalize)); +// } +// +// if(str && this.matcher){ +// +// str = replace(str, this.matcher); +// } +// +// if(this.stemmer && str.length > 1){ +// +// str = replace(str, this.stemmer); +// } +// +// if(_collapse && str.length > 1){ +// +// str = collapse(str); +// } +// +// if(str){ +// +// if(split || (split === "")){ +// +// const words = str.split(/** @type {string|RegExp} */ (split)); +// +// return this.filter ? filter(words, this.filter) : words; +// } +// } +// } +// +// return str; +// }; + +// export function pipeline(str, normalize, matcher, stemmer, split, _filter, _collapse){ +// +// if(str){ +// +// if(normalize && str){ +// +// str = replace(str, normalize); +// } +// +// if(matcher && str){ +// +// str = replace(str, matcher); +// } +// +// if(stemmer && str.length > 1){ +// +// str = replace(str, stemmer); +// } +// +// if(_collapse && str.length > 1){ +// +// str = collapse(str); +// } +// +// if(str){ +// +// if(split !== false){ +// +// str = str.split(split); +// +// if(_filter){ +// +// str = filter(str, _filter); +// } +// } +// } +// } +// +// return str; +// } + + +/** + * @param {Array} words + * @returns {Object} + */ + +export function init_filter(words) { + + const filter = create_object(); + + for (let i = 0, length = words.length; i < length; i++) { + + filter[words[i]] = 1; + } + + return filter; +} + +/** + * @param {!Object} obj + * @param {boolean} is_stemmer + * @returns {Array} + */ + +export function init_stemmer_or_matcher(obj, is_stemmer) { + const keys = get_keys(obj), + length = keys.length, + final = []; + + + let removal = "", + count = 0; + + for (let i = 0, key, tmp; i < length; i++) { + + key = keys[i]; + tmp = obj[key]; + + if (tmp) { + + final[count++] = regex(is_stemmer ? "(?!\\b)" + key + "(\\b|_)" : key); + final[count++] = tmp; + } else { + + removal += (removal ? "|" : "") + key; + } + } + + if (removal) { + + final[count++] = regex(is_stemmer ? "(?!\\b)(" + removal + ")(\\b|_)" : "(" + removal + ")"); + final[count] = ""; + } + + return final; +} + +/** + * @param {!string} str + * @param {Array} regexp + * @returns {string} + */ + +export function replace(str, regexp) { + + for (let i = 0, len = regexp.length; i < len; i += 2) { + + str = str.replace(regexp[i], regexp[i + 1]); + + if (!str) { + + break; + } + } + + return str; +} + +/** + * @param {!string} str + * @returns {RegExp} + */ + +export function regex(str) { + + return new RegExp(str, "g"); +} + +/** + * Regex: replace(/(?:(\w)(?:\1)*)/g, "$1") + * @param {!string} string + * @returns {string} + */ + +export function collapse(string) { + + let final = "", + prev = ""; + + for (let i = 0, len = string.length, char; i < len; i++) { + + if ((char = string[i]) !== prev) { + + final += prev = char; + } + } + + return final; +} + +// TODO using fast-swap +export function filter(words, map) { + const length = words.length, + filtered = []; + + + for (let i = 0, count = 0; i < length; i++) { + + const word = words[i]; + + if (word && !map[word]) { + + filtered[count++] = word; + } + } + + return filtered; +} + +// const chars = {a:1, e:1, i:1, o:1, u:1, y:1}; +// +// function collapse_repeating_chars(string){ +// +// let collapsed_string = "", +// char_prev = "", +// char_next = ""; +// +// for(let i = 0; i < string.length; i++){ +// +// const char = string[i]; +// +// if(char !== char_prev){ +// +// if(i && (char === "h")){ +// +// if((chars[char_prev] && chars[char_next]) || (char_prev === " ")){ +// +// collapsed_string += char; +// } +// } +// else{ +// +// collapsed_string += char; +// } +// } +// +// char_next = ( +// +// (i === (string.length - 1)) ? +// +// "" +// : +// string[i + 1] +// ); +// +// char_prev = char; +// } +// +// return collapsed_string; +// } \ No newline at end of file diff --git a/dist/module-debug/lang/arabic/default.js b/dist/module-debug/lang/arabic/default.js new file mode 100644 index 0000000..89f65a6 --- /dev/null +++ b/dist/module-debug/lang/arabic/default.js @@ -0,0 +1,27 @@ +import { IndexInterface } from "../../type.js"; +import { pipeline } from "../../lang.js"; + +export const rtl = /* append: */ /* skip update: */ /* skip_update: */!0; +export const tokenize = ""; +export default { + encode: encode, + rtl: !0 +}; + +const regex = /[\x00-\x7F]+/g, + split = /\s+/; + + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).replace(regex, " "), + /* normalize: */ + /* collapse: */!1, + /* split: */split, !1); +} \ No newline at end of file diff --git a/dist/module-debug/lang/at.js b/dist/module-debug/lang/at.js new file mode 100644 index 0000000..af404df --- /dev/null +++ b/dist/module-debug/lang/at.js @@ -0,0 +1,41 @@ +/** + * http://www.ranks.nl/stopwords + * @type {Array} + */ + +export const filter = ["aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", "bis", "bist", "da", "dadurch", "daher", "darum", "das", "daß", "dass", "dein", "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", "es", "euer", "eure", "für", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", "ich", "ihr", "ihre", "im", "in", "ist", "ja", "jede", "jedem", "jeden", "jeder", "jedes", "jener", "jenes", "jetzt", "kann", "kannst", "können", "könnt", "machen", "mein", "meine", "mit", "muß", "mußt", "musst", "müssen", "müßt", "nach", "nachdem", "nein", "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", "wer", "werde", "werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "über"]; + +/** + * @type {Object} + */ + +export const stemmer = { + + niss: "", + isch: "", + lich: "", + heit: "", + keit: "", + end: "", + ung: "", + est: "", + ern: "", + em: "", + er: "", + en: "", + es: "", + st: "", + ig: "", + ik: "", + e: "", + s: "" +}; + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module-debug/lang/cjk/default.js b/dist/module-debug/lang/cjk/default.js new file mode 100644 index 0000000..a0e94f2 --- /dev/null +++ b/dist/module-debug/lang/cjk/default.js @@ -0,0 +1,26 @@ +import { IndexInterface } from "../../type.js"; +import { pipeline } from "../../lang.js"; + +export const rtl = /* normalize: */ /* collapse: */ +/* normalize: */ +/* collapse: */!1; +export const tokenize = "strict"; +export default { + encode: encode, + rtl: !1, + tokenize: "strict" +}; + +const regex = /[\x00-\x7F]+/g; + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).replace(regex, ""), !1, + /* split: */"", !1); +} \ No newline at end of file diff --git a/dist/module-debug/lang/cyrillic/default.js b/dist/module-debug/lang/cyrillic/default.js new file mode 100644 index 0000000..de45263 --- /dev/null +++ b/dist/module-debug/lang/cyrillic/default.js @@ -0,0 +1,27 @@ +import { IndexInterface } from "../../type.js"; +import { pipeline } from "../../lang.js"; + +export const rtl = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ +/* normalize: */ +/* collapse: */!1; +export const tokenize = ""; +export default { + encode: encode, + rtl: !1 +}; + +const regex = /[\x00-\x7F]+/g, + split = /\s+/; + + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).replace(regex, " "), !1, + /* split: */split, !1); +} \ No newline at end of file diff --git a/dist/module-debug/lang/de.js b/dist/module-debug/lang/de.js new file mode 100644 index 0000000..8196777 --- /dev/null +++ b/dist/module-debug/lang/de.js @@ -0,0 +1,54 @@ +/** + * Filter are also known as "stopwords", they completely filter out words from being indexed. + * Source: http://www.ranks.nl/stopwords + * Object Definition: Just provide an array of words. + * @type {Array} + */ + +export const filter = ["aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", "bis", "bist", "da", "dadurch", "daher", "darum", "das", "daß", "dass", "dein", "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", "es", "euer", "eure", "für", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", "ich", "ihr", "ihre", "im", "in", "ist", "ja", "jede", "jedem", "jeden", "jeder", "jedes", "jener", "jenes", "jetzt", "kann", "kannst", "können", "könnt", "machen", "mein", "meine", "mit", "muß", "mußt", "musst", "müssen", "müßt", "nach", "nachdem", "nein", "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", "wer", "werde", "werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "über"]; + +/** + * Stemmer removes word endings and is a kind of "partial normalization". A word ending just matched when the word length is bigger than the matched partial. + * Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending. + * Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal). + * @type {Object} + */ + +export const stemmer = { + + niss: "", + isch: "", + lich: "", + heit: "", + keit: "", + ell: "", + bar: "", + end: "", + ung: "", + est: "", + ern: "", + em: "", + er: "", + en: "", + es: "", + st: "", + ig: "", + ik: "", + e: "", + s: "" +}; + +/** + * Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization". + * Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms). + * @type {Object|string>} + */ + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module-debug/lang/en.js b/dist/module-debug/lang/en.js new file mode 100644 index 0000000..7b1ba3a --- /dev/null +++ b/dist/module-debug/lang/en.js @@ -0,0 +1,100 @@ +/** + * http://www.ranks.nl/stopwords + * @type {Array} + */ + +export const filter = ["a", "about", "above", "after", "again", "against", "all", "also", "am", "an", "and", "any", "are", "aren't", "as", "at", +//"back", +"be", "because", "been", "before", "being", "below", +//"between", +"both", "but", "by", "can", "cannot", "can't", "come", "could", "couldn't", +//"day", +"did", "didn't", "do", "does", "doesn't", "doing", "dont", "down", "during", "each", "even", "few", "first", "for", "from", "further", "get", +//"give", +"go", +//"good", +"had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "hed", +//"hell", +"her", "here", "here's", "hers", "herself", "hes", "him", "himself", "his", "how", "how's", "i", "id", "if", "ill", "im", "in", "into", "is", "isn't", "it", "it's", "itself", "i've", "just", "know", "let's", "like", +//"look", +"make", "me", "more", "most", "mustn't", "my", "myself", "new", "no", "nor", "not", "now", "of", "off", "on", "once", +//"one", +"only", "or", "other", "ought", "our", "our's", "ourselves", "out", "over", "own", +//"people", +"same", "say", "see", "shan't", "she", "she'd", "shell", "shes", "should", "shouldn't", "so", "some", "such", +//"take", +"than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", +//"think", +"this", "those", "through", "time", "to", "too", +//"two", +//"under", +"until", "up", "us", +//"use", +"very", "want", "was", "wasn't", "way", "we", "wed", "well", "were", "weren't", "we've", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "whom", "who's", "why", "why's", "will", "with", "won't", +//"work", +"would", "wouldn't", +//"year", +"you", "you'd", "you'll", "your", "you're", "your's", "yourself", "yourselves", "you've"]; + +/** + * @type {Object} + */ + +export const stemmer = { + + ational: "ate", + iveness: "ive", + fulness: "ful", + ousness: "ous", + ization: "ize", + tional: "tion", + biliti: "ble", + icate: "ic", + ative: "", + alize: "al", + iciti: "ic", + entli: "ent", + ousli: "ous", + alism: "al", + ation: "ate", + aliti: "al", + iviti: "ive", + ement: "", + enci: "ence", + anci: "ance", + izer: "ize", + alli: "al", + ator: "ate", + logi: "log", + ical: "ic", + ance: "", + ence: "", + ness: "", + able: "", + ible: "", + ment: "", + eli: "e", + bli: "ble", + ful: "", + ant: "", + ent: "", + ism: "", + ate: "", + iti: "", + ous: "", + ive: "", + ize: "", + al: "", + ou: "", + er: "", + ic: "" +}; + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module-debug/lang/latin/advanced.js b/dist/module-debug/lang/latin/advanced.js new file mode 100644 index 0000000..94f5cb1 --- /dev/null +++ b/dist/module-debug/lang/latin/advanced.js @@ -0,0 +1,89 @@ +import { IndexInterface } from "../../type.js"; +import { regex, replace, collapse } from "../../lang.js"; +import { encode as encode_balance } from "./balance.js"; + +export const rtl = /* normalize: */ +/* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */!1; +export const tokenize = ""; +export default { + encode: encode, + rtl: !1, + tokenize: "" + + // Phonetic Normalization + +};const regex_ae = regex("ae"), + +//regex_ai = regex("ai"), +//regex_ay = regex("ay"), +//regex_ey = regex("ey"), +regex_oe = regex("oe"), + //regex_ue = regex("ue"), +//regex_ie = regex("ie"), +//regex_sz = regex("sz"), +//regex_zs = regex("zs"), +//regex_ck = regex("ck"), +//regex_cc = regex("cc"), +regex_sh = regex("sh"), + regex_th = regex("th"), + +//regex_dt = regex("dt"), +regex_ph = regex("ph"), + regex_pf = regex("pf"), + pairs = [regex_ae, "a", +// regex_ai, "ei", +// regex_ay, "ei", +// regex_ey, "ei", +regex_oe, "o", +// regex_ue, "u", +// regex_ie, "i", +// regex_sz, "s", +// regex_zs, "s", +regex_sh, "s", +// regex_ck, "k", +// regex_cc, "k", +regex_th, "t", +// regex_dt, "t", +regex_ph, "f", regex_pf, "f", +// regex_ou, "o", +// regex_uo, "u" + +// regex("(?![aeiouy])h(?![aeiouy])"), "", +// regex("(?!^[aeiouy])h(?!^[aeiouy])"), "" +regex("(?![aeo])h(?![aeo])"), "", regex("(?!^[aeo])h(?!^[aeo])"), ""]; +//regex_ou = regex("ou"), +//regex_uo = regex("uo"); + +/** + * @param {string|number} str + * @param {boolean=} _skip_postprocessing + * @this IndexInterface + */ + +export function encode(str, _skip_postprocessing) { + + if (str) { + + str = encode_balance.call(this, str).join(" "); + + if (2 < str.length) { + + str = replace(str, pairs); + } + + if (!_skip_postprocessing) { + + if (1 < str.length) { + + str = collapse(str); + } + + if (str) { + + str = str.split(" "); + } + } + } + + return str || []; +} \ No newline at end of file diff --git a/dist/module-debug/lang/latin/balance.js b/dist/module-debug/lang/latin/balance.js new file mode 100644 index 0000000..10de393 --- /dev/null +++ b/dist/module-debug/lang/latin/balance.js @@ -0,0 +1,119 @@ +import { IndexInterface } from "../../type.js"; +import { encode as encode_simple } from "./simple.js"; + +// custom soundex implementation + +export const rtl = /* normalize: */ /* collapse: */ +/* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */!1; +export const tokenize = "strict"; +export default { + encode: encode, + rtl: !1, + tokenize: "strict" + + //const regex_whitespace = /[\W_]+/g; +};const regex_strip = /[^a-z0-9]+/, + soundex = { + + b: "p", + //"p": "p", + + //"f": "f", + v: "f", w: "f", + + //"s": "s", + z: "s", + x: "s", + ß: "s", + + d: "t", + //"t": "t", + + //"l": "l", + + //"m": "m", + n: "m", + + c: "k", + g: "k", + j: "k", + //"k": "k", + q: "k", + + //"r": "r", + //"h": "h", + //"a": "a", + + //"e": "e", + i: "e", + y: "e", + + //"o": "o", + u: "o" +}; + +// const pairs = [ +// regex_whitespace, " ", +// regex_strip, "" +// ]; + +// modified + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + str = encode_simple.call(this, str).join(" "); + + // str = this.pipeline( + // + // /* string: */ normalize("" + str).toLowerCase(), + // /* normalize: */ false, + // /* split: */ false, + // /* collapse: */ false + // ); + + const result = []; + + if (str) { + const words = str.split(regex_strip), + length = words.length; + + + for (let x = 0, tmp, count = 0; x < length; x++) { + + if ((str = words[x]) && ( /*&& (str.length > 2)*/!this.filter || !this.filter[str])) { + + tmp = str[0]; + let code = soundex[tmp] || tmp, + previous = code; //str[0]; + + //soundex[code] || code; + + for (let i = 1; i < str.length; i++) { + + tmp = str[i]; + const current = soundex[tmp] || tmp; + + if (current && current !== previous) { + + code += current; + previous = current; + + // if(code.length === 7){ + // + // break; + // } + } + } + + result[count++] = code; //(code + "0000").substring(0, 4); + } + } + } + + return result; +} \ No newline at end of file diff --git a/dist/module-debug/lang/latin/default.js b/dist/module-debug/lang/latin/default.js new file mode 100644 index 0000000..dac5a9c --- /dev/null +++ b/dist/module-debug/lang/latin/default.js @@ -0,0 +1,23 @@ +import { IndexInterface } from "../../type.js"; +import { pipeline, normalize, regex_whitespace } from "../../lang.js"; + +export const rtl = /* normalize: */ +/* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ +/* normalize: */ +/* collapse: */!1; +export const tokenize = ""; +export default { + encode: encode, + rtl: !1, + tokenize: "" + + /** + * @param {string|number} str + * @this IndexInterface + */ + +};export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).toLowerCase(), !1, /* split: */regex_whitespace, !1); +} \ No newline at end of file diff --git a/dist/module-debug/lang/latin/extra.js b/dist/module-debug/lang/latin/extra.js new file mode 100644 index 0000000..c55ea6a --- /dev/null +++ b/dist/module-debug/lang/latin/extra.js @@ -0,0 +1,65 @@ +import { IndexInterface } from "../../type.js"; +import { regex, replace, collapse } from "../../lang.js"; +import { encode as encode_advanced } from "./advanced.js"; + +export const rtl = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */!1; +export const tokenize = ""; +export default { + encode: encode, + rtl: !1, + tokenize: "" + + // Soundex Normalization + +};const prefix = "(?!\\b)", + //soundex_b = regex(prefix + "p"), +// soundex_s = regex(prefix + "z"), +// soundex_k = regex(prefix + "[cgq]"), +// soundex_m = regex(prefix + "n"), +// soundex_t = regex(prefix + "d"), +// soundex_f = regex(prefix + "[vw]"), +//regex_vowel = regex(prefix + "[aeiouy]"); +regex_vowel = regex("(?!\\b)[aeo]"), + pairs = [ + +// soundex_b, "b", +// soundex_s, "s", +// soundex_k, "k", +// soundex_m, "m", +// soundex_t, "t", +// soundex_f, "f", +// regex("(?![aeiouy])h(?![aeiouy])"), "", +// regex("(?!^[aeiouy])h(?!^[aeiouy])"), "", +regex_vowel, ""]; + + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + if (str) { + + str = encode_advanced.call(this, str, /* append: */ /* skip update: */ /* skip_update: */ /* skip post-processing: */!0); + + if (1 < str.length) { + + //str = replace(str, pairs); + str = str.replace(regex_vowel, ""); + } + + if (1 < str.length) { + + str = collapse(str); + } + + if (str) { + + str = str.split(" "); + } + } + + return str || []; +} \ No newline at end of file diff --git a/dist/module-debug/lang/latin/simple.js b/dist/module-debug/lang/latin/simple.js new file mode 100644 index 0000000..1b9ca40 --- /dev/null +++ b/dist/module-debug/lang/latin/simple.js @@ -0,0 +1,45 @@ +import { IndexInterface } from "../../type.js"; +import { pipeline, normalize, regex_whitespace, regex } from "../../lang.js"; + +export const rtl = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ +/* collapse: */!1; +export const tokenize = ""; +export default { + encode: encode, + rtl: !1, + tokenize: "" + + // Charset Normalization + +};const //regex_whitespace = /\W+/, +//regex_strip = regex("[^a-z0-9 ]"), +regex_a = regex("[àáâãäå]"), + regex_e = regex("[èéêë]"), + regex_i = regex("[ìíîï]"), + regex_o = regex("[òóôõöő]"), + regex_u = regex("[ùúûüű]"), + regex_y = regex("[ýŷÿ]"), + regex_n = regex("ñ"), + regex_c = regex("[çc]"), + regex_s = regex("ß"), + regex_and = regex(" & "), + pairs = [regex_a, "a", regex_e, "e", regex_i, "i", regex_o, "o", regex_u, "u", regex_y, "y", regex_n, "n", regex_c, "k", regex_s, "s", regex_and, " and " +//regex_whitespace, " " +//regex_strip, "" +]; + + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + str = "" + str; + + return pipeline.call(this, + /* string: */normalize(str).toLowerCase(), + /* normalize: */!str.normalize && pairs, + /* split: */regex_whitespace, !1); +} \ No newline at end of file diff --git a/dist/module-debug/lang/us.js b/dist/module-debug/lang/us.js new file mode 100644 index 0000000..7b1ba3a --- /dev/null +++ b/dist/module-debug/lang/us.js @@ -0,0 +1,100 @@ +/** + * http://www.ranks.nl/stopwords + * @type {Array} + */ + +export const filter = ["a", "about", "above", "after", "again", "against", "all", "also", "am", "an", "and", "any", "are", "aren't", "as", "at", +//"back", +"be", "because", "been", "before", "being", "below", +//"between", +"both", "but", "by", "can", "cannot", "can't", "come", "could", "couldn't", +//"day", +"did", "didn't", "do", "does", "doesn't", "doing", "dont", "down", "during", "each", "even", "few", "first", "for", "from", "further", "get", +//"give", +"go", +//"good", +"had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "hed", +//"hell", +"her", "here", "here's", "hers", "herself", "hes", "him", "himself", "his", "how", "how's", "i", "id", "if", "ill", "im", "in", "into", "is", "isn't", "it", "it's", "itself", "i've", "just", "know", "let's", "like", +//"look", +"make", "me", "more", "most", "mustn't", "my", "myself", "new", "no", "nor", "not", "now", "of", "off", "on", "once", +//"one", +"only", "or", "other", "ought", "our", "our's", "ourselves", "out", "over", "own", +//"people", +"same", "say", "see", "shan't", "she", "she'd", "shell", "shes", "should", "shouldn't", "so", "some", "such", +//"take", +"than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", +//"think", +"this", "those", "through", "time", "to", "too", +//"two", +//"under", +"until", "up", "us", +//"use", +"very", "want", "was", "wasn't", "way", "we", "wed", "well", "were", "weren't", "we've", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "whom", "who's", "why", "why's", "will", "with", "won't", +//"work", +"would", "wouldn't", +//"year", +"you", "you'd", "you'll", "your", "you're", "your's", "yourself", "yourselves", "you've"]; + +/** + * @type {Object} + */ + +export const stemmer = { + + ational: "ate", + iveness: "ive", + fulness: "ful", + ousness: "ous", + ization: "ize", + tional: "tion", + biliti: "ble", + icate: "ic", + ative: "", + alize: "al", + iciti: "ic", + entli: "ent", + ousli: "ous", + alism: "al", + ation: "ate", + aliti: "al", + iviti: "ive", + ement: "", + enci: "ence", + anci: "ance", + izer: "ize", + alli: "al", + ator: "ate", + logi: "log", + ical: "ic", + ance: "", + ence: "", + ness: "", + able: "", + ible: "", + ment: "", + eli: "e", + bli: "ble", + ful: "", + ant: "", + ent: "", + ism: "", + ate: "", + iti: "", + ous: "", + ive: "", + ize: "", + al: "", + ou: "", + er: "", + ic: "" +}; + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module-debug/polyfill.js b/dist/module-debug/polyfill.js new file mode 100644 index 0000000..e8c7408 --- /dev/null +++ b/dist/module-debug/polyfill.js @@ -0,0 +1,74 @@ + +export let promise = Promise; + +Object.assign || (Object.assign = function () { + const args = arguments, + size = args.length, + obj = args[0]; + + + for (let x = 1, current, keys, length; x < size; x++) { + + current = args[x]; + keys = Object.keys(current); + length = keys.length; + + for (let i = 0, key; i < length; i++) { + + key = keys[i]; + obj[key] = current[key]; + } + } + + return obj; +}); + +// Object.values || (Object.values = function(obj){ +// +// const keys = Object.keys(obj); +// const length = keys.length; +// const values = new Array(length); +// +// for(let x = 0; x < length; x++){ +// +// values[x] = obj[keys[x]]; +// } +// +// return values; +// }); + +if (!promise) { + + /** + * @param {Function} fn + * @constructor + */ + + function SimplePromise(fn) { + + this.callback = null; + + const self = this; + + fn(function (val) { + + if (self.callback) { + + self.callback(val); + // self.callback = null; + // self = null; + } + }); + } + + /** + * @param {Function} callback + */ + + SimplePromise.prototype.then = function (callback) { + + this.callback = callback; + }; + + promise = SimplePromise; +} \ No newline at end of file diff --git a/dist/module-debug/preset.js b/dist/module-debug/preset.js new file mode 100644 index 0000000..0ea59f9 --- /dev/null +++ b/dist/module-debug/preset.js @@ -0,0 +1,97 @@ + +import { is_string } from "./common.js"; + +/** + * @enum {Object} + * @const + */ + +const preset = { + + memory: { + charset: "latin:extra", + //tokenize: "strict", + resolution: 3, + //threshold: 0, + minlength: 4, + fastupdate: /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ + /* collapse: */ + /* collapse: */!1 + }, + + performance: { + //charset: "latin", + //tokenize: "strict", + resolution: 3, + minlength: 3, + //fastupdate: true, + optimize: !1, //fastupdate: true, + context: { + depth: 2, resolution: 1 + //bidirectional: false + } + }, + + match: { + charset: "latin:extra", + tokenize: "reverse" + //resolution: 9, + //threshold: 0 + }, + + score: { + charset: "latin:advanced", + //tokenize: "strict", + resolution: 20, + minlength: 3, + context: { + depth: 3, + resolution: 9 + //bidirectional: true + } + }, + + default: { + // charset: "latin:default", + // tokenize: "strict", + // resolution: 3, + // threshold: 0, + // depth: 3 + } + + // "fast": { + // //charset: "latin", + // //tokenize: "strict", + // threshold: 8, + // resolution: 9, + // depth: 1 + // } +}; + +export default function apply_preset(options) { + + if (is_string(options)) { + + if (!preset[options]) { + + console.warn("Preset not found: " + options); + } + + options = preset[options]; + } else { + + const preset = options.preset; + + if (preset) { + + if (!preset[preset]) { + + console.warn("Preset not found: " + preset); + } + + options = Object.assign({}, preset[preset], /** @type {Object} */options); + } + } + + return options; +} \ No newline at end of file diff --git a/dist/module-debug/serialize.js b/dist/module-debug/serialize.js new file mode 100644 index 0000000..0baab85 --- /dev/null +++ b/dist/module-debug/serialize.js @@ -0,0 +1,271 @@ +// TODO return promises instead of inner await + +import { IndexInterface, DocumentInterface } from "./type.js"; +import { create_object, is_string } from "./common.js"; + +function async(callback, self, field, key, index_doc, index, data, on_done) { + + setTimeout(function () { + + const res = callback(field ? field + "." + key : key, JSON.stringify(data)); + + // await isn't supported by ES5 + + if (res && res.then) { + + res.then(function () { + + self.export(callback, self, field, index_doc, index + 1, on_done); + }); + } else { + + self.export(callback, self, field, index_doc, index + 1, on_done); + } + }); +} + +/** + * @this IndexInterface + */ + +export function exportIndex(callback, self, field, index_doc, index, on_done) { + + let return_value = /* append: */ /* skip update: */ /* skip_update: */ /* skip post-processing: */!0; + if ('undefined' == typeof on_done) { + return_value = new Promise(resolve => { + on_done = resolve; + }); + } + + let key, data; + + switch (index || (index = 0)) { + + case 0: + + key = "reg"; + + // fastupdate isn't supported by export + + if (this.fastupdate) { + + data = create_object(); + + for (let key in this.register) { + + data[key] = 1; + } + } else { + + data = this.register; + } + + break; + + case 1: + + key = "cfg"; + data = { + doc: 0, + opt: this.optimize ? 1 : 0 + }; + + break; + + case 2: + + key = "map"; + data = this.map; + break; + + case 3: + + key = "ctx"; + data = this.ctx; + break; + + default: + + if ('undefined' == typeof field && on_done) { + + on_done(); + } + + return; + } + + async(callback, self || this, field, key, index_doc, index, data, on_done); + + return return_value; +} + +/** + * @this IndexInterface + */ + +export function importIndex(key, data) { + + if (!data) { + + return; + } + + if (is_string(data)) { + + data = JSON.parse(data); + } + + switch (key) { + + case "cfg": + + this.optimize = !!data.opt; + break; + + case "reg": + + // fastupdate isn't supported by import + + this.fastupdate = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* collapse: */!1; + this.register = data; + break; + + case "map": + + this.map = data; + break; + + case "ctx": + + this.ctx = data; + break; + } +} + +/** + * @this DocumentInterface + */ + +export function exportDocument(callback, self, field, index_doc, index, on_done) { + + let return_value; + if ('undefined' == typeof on_done) { + return_value = new Promise(resolve => { + on_done = resolve; + }); + } + + index || (index = 0); + index_doc || (index_doc = 0); + + if (index_doc < this.field.length) { + const field = this.field[index_doc], + idx = this.index[field]; + + + self = this; + + setTimeout(function () { + + if (!idx.export(callback, self, index ? field /*.replace(":", "-")*/ : "", index_doc, index++, on_done)) { + + index_doc++; + index = 1; + + self.export(callback, self, field, index_doc, index, on_done); + } + }); + } else { + + let key, data; + + switch (index) { + + case 1: + + key = "tag"; + data = this.tagindex; + field = null; + break; + + case 2: + + key = "store"; + data = this.store; + field = null; + break; + + // case 3: + // + // key = "reg"; + // data = this.register; + // break; + + default: + + on_done(); + return; + } + + async(callback, this, field, key, index_doc, index, data, on_done); + } + + return return_value; +} + +/** + * @this DocumentInterface + */ + +export function importDocument(key, data) { + + if (!data) { + + return; + } + + if (is_string(data)) { + + data = JSON.parse(data); + } + + switch (key) { + + case "tag": + + this.tagindex = data; + break; + + case "reg": + + // fastupdate isn't supported by import + + this.fastupdate = !1; + this.register = data; + + for (let i = 0, index; i < this.field.length; i++) { + + index = this.index[this.field[i]]; + index.register = data; + index.fastupdate = !1; + } + + break; + + case "store": + + this.store = data; + break; + + default: + + key = key.split("."); + const field = key[0]; + key = key[1]; + + if (field && key) { + + this.index[field].import(key, data); + } + } +} \ No newline at end of file diff --git a/dist/module-debug/type.js b/dist/module-debug/type.js new file mode 100644 index 0000000..1a784b3 --- /dev/null +++ b/dist/module-debug/type.js @@ -0,0 +1,69 @@ +/** + * @interface + */ + +export function IndexInterface() { + + this.cache = null; + this.matcher = null; + this.stemmer = null; + this.filter = null; +} + +/** + * @param {!string} str + * @param {boolean|Array=} normalize + * @param {boolean|string|RegExp=} split + * @param {boolean=} collapse + * @returns {string|Array} + */ + +//IndexInterface.prototype.pipeline; + +/** + * @param {!number|string} id + * @param {!string} content + */ + +IndexInterface.prototype.add; + +/** + * @param {!number|string} id + * @param {!string} content + */ + +IndexInterface.prototype.append; + +/** + * @param {!string|Object} query + * @param {number|Object=} limit + * @param {Object=} options + * @returns {Array} + */ + +IndexInterface.prototype.search; + +/** + * @param {!number|string} id + * @param {!string} content + */ + +IndexInterface.prototype.update; + +/** + * @param {!number|string} id + */ + +IndexInterface.prototype.remove; + +/** + * @interface + */ + +export function DocumentInterface() { + + this.field = null; + + /** @type IndexInterface */ + this.index = null; +} \ No newline at end of file diff --git a/dist/module-debug/worker/handler.js b/dist/module-debug/worker/handler.js new file mode 100644 index 0000000..914439c --- /dev/null +++ b/dist/module-debug/worker/handler.js @@ -0,0 +1,52 @@ +import Index from "../index.js"; + +export default function (data) { + + data = data.data; + + /** @type Index */ + const index = self._index, + args = data.args, + task = data.task; + + + switch (task) { + + case "init": + const options = data.options || {}, + factory = data.factory, + encode = options.encode; + + + options.cache = /* normalize: */ /* collapse: */ /* normalize: */ + + /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* collapse: */!1; + + if (encode && 0 === encode.indexOf("function")) { + options.encode = Function("return " + encode)(); + } + + if (factory) { + + // export the FlexSearch global payload to "self" + Function("return " + factory)()(self); + + /** @type Index */ + self._index = new self.FlexSearch.Index(options); + + // destroy the exported payload + delete self.FlexSearch; + } else { + + self._index = new Index(options); + } + + break; + + default: + const id = data.id, + message = index[task].apply(index, args); + + postMessage("search" === task ? { id: id, msg: message } : { id: id }); + } +} \ No newline at end of file diff --git a/dist/module-debug/worker/index.js b/dist/module-debug/worker/index.js new file mode 100644 index 0000000..7987bfb --- /dev/null +++ b/dist/module-debug/worker/index.js @@ -0,0 +1,136 @@ +//import { promise as Promise } from "../polyfill.js"; +import { create_object, is_function, is_object, is_string } from "../common.js"; +import handler from "./handler.js"; + +let pid = 0; + +/** + * @param {Object=} options + * @constructor + */ + +function WorkerIndex(options) { + + if (!(this instanceof WorkerIndex)) { + + return new WorkerIndex(options); + } + + let opt; + + if (options) { + + if (is_function(opt = options.encode)) { + + options.encode = opt.toString(); + } + } else { + + options = {}; + } + + // the factory is the outer wrapper from the build + // we use "self" as a trap for node.js + + let factory = (self || window)._factory; + + if (factory) { + + factory = factory.toString(); + } + + const is_node_js = "undefined" == typeof window && self.exports, + _self = this; + + this.worker = create(factory, is_node_js, options.worker); + this.resolver = create_object(); + + if (!this.worker) { + + return; + } + + if (is_node_js) { + + this.worker.on("message", function (msg) { + + _self.resolver[msg.id](msg.msg); + delete _self.resolver[msg.id]; + }); + } else { + + this.worker.onmessage = function (msg) { + + msg = msg.data; + _self.resolver[msg.id](msg.msg); + delete _self.resolver[msg.id]; + }; + } + + this.worker.postMessage({ + + task: "init", + factory: factory, + options: options + }); +} + +export default WorkerIndex; + +register("add"); +register("append"); +register("search"); +register("update"); +register("remove"); + +function register(key) { + + WorkerIndex.prototype[key] = WorkerIndex.prototype[key + "Async"] = function () { + const self = this, + args = [].slice.call(arguments), + arg = args[args.length - 1]; + + let callback; + + if (is_function(arg)) { + + callback = arg; + args.splice(args.length - 1, 1); + } + + const promise = new Promise(function (resolve) { + + setTimeout(function () { + + self.resolver[++pid] = resolve; + self.worker.postMessage({ + + task: key, + id: pid, + args: args + }); + }); + }); + + if (callback) { + + promise.then(callback); + return this; + } else { + + return promise; + } + }; +} + +function create(factory, is_node_js, worker_path) { + + let worker; + + try { + + worker = is_node_js ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : factory ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + handler.toString()], { type: "text/javascript" }))) : new Worker(is_string(worker_path) ? worker_path : "worker/worker.js", { type: "module" }); + } catch (e) {} + + return worker; +} \ No newline at end of file diff --git a/dist/module-debug/worker/node.js b/dist/module-debug/worker/node.js new file mode 100644 index 0000000..5326018 --- /dev/null +++ b/dist/module-debug/worker/node.js @@ -0,0 +1,36 @@ +const { parentPort } = require("worker_threads"), + { Index } = require("../flexsearch.bundle.min.js"); + +let index; + +parentPort.on("message", function (data) { + + /** @type Index */ + const args = data.args, + task = data.task, + id = data.id; + + + switch (task) { + + case "init": + const options = data.options || {}, + encode = options.encode; + + + options.cache = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* collapse: */!1; + + if (encode && 0 === encode.indexOf("function")) { + + options.encode = new Function("return " + encode)(); + } + + index = new Index(options); + break; + + default: + + const message = index[task].apply(index, args); + parentPort.postMessage("search" === task ? { id: id, msg: message } : { id: id }); + } +}); \ No newline at end of file diff --git a/dist/module-debug/worker/worker.js b/dist/module-debug/worker/worker.js new file mode 100644 index 0000000..7d295f2 --- /dev/null +++ b/dist/module-debug/worker/worker.js @@ -0,0 +1,2 @@ +import handler from "./handler.js"; +onmessage = handler; \ No newline at end of file diff --git a/dist/module-min/async.js b/dist/module-min/async.js new file mode 100644 index 0000000..9813300 --- /dev/null +++ b/dist/module-min/async.js @@ -0,0 +1 @@ +import{IndexInterface,DocumentInterface}from"./type.js";import{is_function,is_object,is_string}from"./common.js";export default function(a){register(a,"add"),register(a,"append"),register(a,"search"),register(a,"update"),register(a,"remove")}function register(a,b){a[b+"Async"]=function(){const a=this,c=arguments,d=c[c.length-1];let e;is_function(d)&&(e=d,delete c[c.length-1]);const f=new Promise(function(d){setTimeout(function(){a.async=!0;const e=a[b].apply(a,c);a.async=!1,d(e)})});return e?(f.then(e),this):f}} \ No newline at end of file diff --git a/dist/module-min/cache.js b/dist/module-min/cache.js new file mode 100644 index 0000000..07f4553 --- /dev/null +++ b/dist/module-min/cache.js @@ -0,0 +1 @@ +import{IndexInterface,DocumentInterface}from"./type.js";import{create_object,is_object}from"./common.js";function CacheClass(a){this.limit=!0!==a&&a,this.cache=create_object(),this.queue=[]}export default CacheClass;export function searchCache(a,b,c){is_object(a)&&(a=a.query);let d=this.cache.get(a);return d||(d=this.search(a,b,c),this.cache.set(a,d)),d}CacheClass.prototype.set=function(a,b){if(!this.cache[a]){let b=this.queue.length;b===this.limit?delete this.cache[this.queue[b-1]]:b++;for(let a=b-1;0=this.minlength&&(g||!f[i])){let l=get_score(h,e,j),m="";switch(this.tokenize){case"full":if(2b;d--)if(d-b>=this.minlength){const g=get_score(h,e,j,k,b);m=i.substring(b,d),this.push_index(f,m,g,a,c)}break}case"reverse":if(1=this.minlength){const d=get_score(h,e,j,k,b);this.push_index(f,m,d,a,c)}m=""}case"forward":if(1=this.minlength&&this.push_index(f,m,l,a,c);break}default:if(this.boost&&(l=Math.min(0|l/this.boost(b,i,j),h-1)),this.push_index(f,i,l,a,c),g&&1=this.minlength&&!f[i]){f[i]=1;const b=get_score(h+(e/2>h?0:1),e,j,l-1,g-1),m=this.bidirectional&&i>k;this.push_index(d,m?k:i,b,a,c,m?i:k)}}}}}this.fastupdate||(this.register[a]=1)}}return this};function get_score(a,b,c,d,e){return c&&1=this.minlength&&!b[e]){if(!this.optimize&&!f&&!this.map[e])return g;c[i++]=e,b[e]=1}a=c,d=a.length}if(!d)return g;b||(b=100);let i,j=this.depth&&1=c)))));l++);if(b)return e?single_result(h,c,0):void(a[a.length]=h)}return!b&&h};function single_result(a,b,c){return a=1===a.length?a[0]:concat(a),c||a.length>b?a.slice(c,c+b):a}function get_array(a,b,c,d){if(c){const e=d&&b>c;a=a[e?b:c],a=a&&a[e?c:b]}else a=a[b];return a}Index.prototype.contain=function(a){return!!this.register[a]},Index.prototype.update=function(a,b){return this.remove(a).add(a,b)},Index.prototype.remove=function(a,b){const c=this.register[a];if(c){if(this.fastupdate)for(let b,d=0;d{f=a}));let h,i;switch(e||(e=0)){case 0:if(h="reg",this.fastupdate)for(let a in i=create_object(),this.register)i[a]=1;else i=this.register;break;case 1:h="cfg",i={doc:0,opt:this.optimize?1:0};break;case 2:h="map",i=this.map;break;case 3:h="ctx",i=this.ctx;break;default:return void("undefined"==typeof c&&f&&f());}return async(a,b||this,c,h,d,e,i,f),g}export function importIndex(a,b){b&&(is_string(b)&&(b=JSON.parse(b)),"cfg"===a?this.optimize=!!b.opt:"reg"===a?(this.fastupdate=!1,this.register=b):"map"===a?this.map=b:"ctx"===a?this.ctx=b:void 0)}export function exportDocument(a,b,c,d,e,f){let g;if("undefined"==typeof f&&(g=new Promise(a=>{f=a})),e||(e=0),d||(d=0),d} + */ + +export function searchCache(query, limit, options) { + + if (is_object(query)) { + + query = query.query; + } + + let cache = this.cache.get(query); + + if (!cache) { + + cache = this.search(query, limit, options); + this.cache.set(query, cache); + } + + return cache; +} + +// CacheClass.prototype.clear = function(){ +// +// /** @private */ +// this.cache = create_object(); +// +// /** @private */ +// this.queue = []; +// }; + +CacheClass.prototype.set = function (key, value) { + + if (!this.cache[key]) { + + // it is just a shame that native function array.shift() performs so bad + + // const length = this.queue.length; + // + // this.queue[length] = key; + // + // if(length === this.limit){ + // + // delete this.cache[this.queue.shift()]; + // } + + // the same bad performance + + // this.queue.unshift(key); + // + // if(this.queue.length === this.limit){ + // + // this.queue.pop(); + // } + + // fast implementation variant + + // let length = this.queue.length; + // + // if(length === this.limit){ + // + // length--; + // + // delete this.cache[this.queue[0]]; + // + // for(let x = 0; x < length; x++){ + // + // this.queue[x] = this.queue[x + 1]; + // } + // } + // + // this.queue[length] = key; + + // current fastest implementation variant + // theoretically that should not perform better compared to the example above + + let length = this.queue.length; + + if (length === this.limit) { + + delete this.cache[this.queue[length - 1]]; + } else { + + length++; + } + + for (let x = length - 1; 0 < x; x--) { + + this.queue[x] = this.queue[x - 1]; + } + + this.queue[0] = key; + } + + this.cache[key] = value; +}; + +CacheClass.prototype.get = function (key) { + + const cache = this.cache[key]; + + if (this.limit && cache) { + + // probably the indexOf() method performs faster when matched content is on front (left-to-right) + // using lastIndexOf() does not help, it performs almost slower + + const pos = this.queue.indexOf(key); + + // if(pos < this.queue.length - 1){ + // + // const tmp = this.queue[pos]; + // this.queue[pos] = this.queue[pos + 1]; + // this.queue[pos + 1] = tmp; + // } + + if (pos) { + + const tmp = this.queue[pos - 1]; + this.queue[pos - 1] = this.queue[pos]; + this.queue[pos] = tmp; + } + } + + return cache; +}; + +CacheClass.prototype.del = function (id) { + + for (let i = 0, item, key; i < this.queue.length; i++) { + + key = this.queue[i]; + item = this.cache[key]; + + if (item.includes(id)) { + + this.queue.splice(i--, 1); + delete this.cache[key]; + } + } +}; \ No newline at end of file diff --git a/dist/module/common.js b/dist/module/common.js index 8663457..95e4ace 100644 --- a/dist/module/common.js +++ b/dist/module/common.js @@ -1 +1,78 @@ -export function parse_option(a,b){return"undefined"==typeof a?b:a}export function create_object_array(a){const b=Array(a);for(let c=0;c} + */ + +export function create_object_array(count) { + + const array = Array(count); + + for (let i = 0; i < count; i++) { + + array[i] = create_object(); + } + + return array; +} + +export function create_arrays(count) { + + const array = Array(count); + + for (let i = 0; i < count; i++) { + + array[i] = []; + } + + return array; +} + +/** + * @param {!Object} obj + * @returns {Array} + */ + +export function get_keys(obj) { + + return Object.keys(obj); +} + +export function create_object() { + + return Object.create(null); +} + +export function concat(arrays) { + + return [].concat.apply([], arrays); +} + +export function sort_by_length_down(a, b) { + + return b.length - a.length; +} + +export function is_array(val) { + + return val.constructor === Array; +} + +export function is_string(val) { + + return "string" == typeof val; +} + +export function is_object(val) { + + return "object" == typeof val; +} + +export function is_function(val) { + + return "function" == typeof val; +} \ No newline at end of file diff --git a/dist/module/config.js b/dist/module/config.js deleted file mode 100644 index fdc3dfe..0000000 --- a/dist/module/config.js +++ /dev/null @@ -1 +0,0 @@ -export const DEBUG=!1;export const POLYFILL=!0;export const SUPPORT_WORKER=!0;export const SUPPORT_ENCODER=!0;export const SUPPORT_CACHE=!0;export const SUPPORT_ASYNC=!0;export const SUPPORT_STORE=!0;export const SUPPORT_TAGS=!0;export const SUPPORT_SUGGESTION=!0;export const SUPPORT_SERIALIZE=!0;export const SUPPORT_DOCUMENT=!0; \ No newline at end of file diff --git a/dist/module/document.js b/dist/module/document.js index 3207041..e0f7196 100644 --- a/dist/module/document.js +++ b/dist/module/document.js @@ -1 +1,731 @@ -import{SUPPORT_ASYNC,SUPPORT_CACHE,SUPPORT_SERIALIZE,SUPPORT_STORE,SUPPORT_TAGS,SUPPORT_WORKER}from"./config.js";import Index from"./index.js";import{DocumentInterface}from"./type.js";import Cache,{searchCache}from"./cache.js";import{create_object,is_array,is_string,is_object,parse_option,get_keys}from"./common.js";import apply_async from"./async.js";import{intersect,intersect_union}from"./intersect.js";import{exportDocument,importDocument}from"./serialize.js";import WorkerIndex from"./worker/index.js";function Document(a){if(!(this instanceof Document))return new Document(a);const b=a.document||a.doc||a;let c;this.tree=[],this.field=[],this.marker=[],this.register=create_object(),this.key=(c=b.key||b.id)&&parse_tree(c,this.marker)||"id",this.fastupdate=parse_option(a.fastupdate,!0),SUPPORT_STORE&&(this.storetree=(c=b.store)&&!0!==c&&[],this.store=c&&create_object()),SUPPORT_TAGS&&(this.tag=(c=b.tag)&&parse_tree(c,this.marker),this.tagindex=c&&create_object()),SUPPORT_CACHE&&(this.cache=(c=a.cache)&&new Cache(c),a.cache=!1),SUPPORT_WORKER&&(this.worker=a.worker),SUPPORT_ASYNC&&(this.async=!1),this.index=parse_descriptor.call(this,a,b)}export default Document;function parse_descriptor(a,b){const c=create_object();let d=b.index||b.field||b;is_string(d)&&(d=[d]);for(let e,f,g=0;gb||c)&&(e=e.slice(c,c+b)),d&&(e=apply_enrich.call(this,e)),{tag:a,result:e}}function apply_enrich(a){const b=Array(a.length);for(let c,d=0;d 1 + +function parse_simple(obj, tree) { + + if (is_string(tree)) { + + obj = obj[tree]; + } else { + + for (let i = 0; obj && i < tree.length; i++) { + + obj = obj[tree[i]]; + } + } + + return obj; +} + +// TODO support generic function created from string when tree depth > 1 + +function store_value(obj, store, tree, pos, key) { + + obj = obj[key]; + + // reached target field + + if (pos === tree.length - 1) { + + // store target value + + store[key] = obj; + } else if (obj) { + + if (is_array(obj)) { + + store = store[key] = Array(obj.length); + + for (let i = 0; i < obj.length; i++) { + + // do not increase pos (an array is not a field) + store_value(obj, store, tree, pos, i); + } + } else { + + store = store[key] || (store[key] = create_object()); + key = tree[++pos]; + + store_value(obj, store, tree, pos, key); + } + } +} + +function add_index(obj, tree, marker, pos, index, id, key, _append) { + + obj = obj[key]; + + if (obj) { + + // reached target field + + if (pos === tree.length - 1) { + + // handle target value + + if (is_array(obj)) { + + // append array contents so each entry gets a new scoring context + + if (marker[pos]) { + + for (let i = 0; i < obj.length; i++) { + + index.add(id, obj[i], !0, !0); + } + + return; + } + + // or join array contents and use one scoring context + + obj = obj.join(" "); + } + + index.add(id, obj, _append, !0); + } else { + + if (is_array(obj)) { + + for (let i = 0; i < obj.length; i++) { + + // do not increase index, an array is not a field + + add_index(obj, tree, marker, pos, index, id, i, _append); + } + } else { + + key = tree[++pos]; + + add_index(obj, tree, marker, pos, index, id, key, _append); + } + } + } +} + +/** + * + * @param id + * @param content + * @param {boolean=} _append + * @returns {Document|Promise} + */ + +Document.prototype.add = function (id, content, _append) { + + if (is_object(id)) { + + content = id; + id = parse_simple(content, this.key); + } + + if (content && (id || 0 === id)) { + + if (!_append && this.register[id]) { + + return this.update(id, content); + } + + for (let i = 0, tree, field; i < this.field.length; i++) { + + field = this.field[i]; + tree = this.tree[i]; + + if (is_string(tree)) { + + tree = [tree]; + } + + add_index(content, tree, this.marker, 0, this.index[field], id, tree[0], _append); + } + + if (this.tag) { + let tag = parse_simple(content, this.tag), + dupes = create_object(); + + + if (is_string(tag)) { + + tag = [tag]; + } + + for (let i = 0, key, arr; i < tag.length; i++) { + + key = tag[i]; + + if (!dupes[key]) { + + dupes[key] = 1; + arr = this.tagindex[key] || (this.tagindex[key] = []); + + if (!_append || !arr.includes(id)) { + + arr[arr.length] = id; + + // add a reference to the register for fast updates + + if (this.fastupdate) { + + const tmp = this.register[id] || (this.register[id] = []); + tmp[tmp.length] = arr; + } + } + } + } + } + + // TODO: how to handle store when appending contents? + + if (this.store && (!_append || !this.store[id])) { + + let store; + + if (this.storetree) { + + store = create_object(); + + for (let i = 0, tree; i < this.storetree.length; i++) { + + tree = this.storetree[i]; + + if (is_string(tree)) { + + store[tree] = content[tree]; + } else { + + store_value(content, store, tree, 0, tree[0]); + } + } + } + + this.store[id] = store || content; + } + } + + return this; +}; + +Document.prototype.append = function (id, content) { + + return this.add(id, content, !0); +}; + +Document.prototype.update = function (id, content) { + + return this.remove(id).add(id, content); +}; + +Document.prototype.remove = function (id) { + + if (is_object(id)) { + + id = parse_simple(id, this.key); + } + + if (this.register[id]) { + + for (let i = 0; i < this.field.length; i++) { + + // workers does not share the register + + this.index[this.field[i]].remove(id, !this.worker); + + if (this.fastupdate) { + + // when fastupdate was enabled all ids are removed + + break; + } + } + + if (this.tag) { + + // when fastupdate was enabled all ids are already removed + + if (!this.fastupdate) { + + for (let key in this.tagindex) { + const tag = this.tagindex[key], + pos = tag.indexOf(id); + + + if (-1 !== pos) { + + if (1 < tag.length) { + + tag.splice(pos, 1); + } else { + + delete this.tagindex[key]; + } + } + } + } + } + + if (this.store) { + + delete this.store[id]; + } + + delete this.register[id]; + } + + return this; +}; + +/** + * @param {!string|Object} query + * @param {number|Object=} limit + * @param {Object=} options + * @param {Array=} _resolve For internal use only. + * @returns {Promise|Array} + */ + +Document.prototype.search = function (query, limit, options, _resolve) { + + if (!options) { + + if (!limit && is_object(query)) { + + options = /** @type {Object} */query; + query = ""; + } else if (is_object(limit)) { + + options = /** @type {Object} */limit; + limit = 0; + } + } + + let result = [], + result_field = [], + pluck, + enrich, + field, + tag, + bool, + offset, + count = 0; + + + if (options) { + + if (is_array(options)) { + + field = options; + options = null; + } else { + + query = options.query || query; + pluck = options.pluck; + field = pluck || options.index || options.field /*|| (is_string(options) && [options])*/; + tag = options.tag; + enrich = this.store && options.enrich; + bool = "and" === options.bool; + limit = options.limit || limit || 100; + offset = options.offset || 0; + + if (tag) { + + if (is_string(tag)) { + + tag = [tag]; + } + + // when tags is used and no query was set, + // then just return the tag indexes + + if (!query) { + + for (let i = 0, res; i < tag.length; i++) { + + res = get_tag.call(this, tag[i], limit, offset, enrich); + + if (res) { + + result[result.length] = res; + count++; + } + } + + return count ? result : []; + } + } + + if (is_string(field)) { + + field = [field]; + } + } + } + + field || (field = this.field); + bool = bool && (1 < field.length || tag && 1 < tag.length); + + const promises = !_resolve && (this.worker || this.async) && []; + + // TODO solve this in one loop below + + for (let i = 0, res, key, len; i < field.length; i++) { + + let field_options; + + key = field[i]; + + if (!is_string(key)) { + + field_options = key; + key = field_options.field; + query = field_options.query || query; + limit = field_options.limit || limit; + enrich = field_options.enrich || enrich; + } + + if (promises) { + + promises[i] = this.index[key].searchAsync(query, limit, field_options || options); + + // just collect and continue + + continue; + } else if (_resolve) { + + res = _resolve[i]; + } else { + + // inherit options also when search? it is just for laziness, Object.assign() has a cost + + res = this.index[key].search(query, limit, field_options || options); + } + + len = res && res.length; + + if (tag && len) { + + const arr = []; + let count = 0; + + if (bool) { + + // prepare for intersection + + arr[0] = [res]; + } + + for (let y = 0, key, res; y < tag.length; y++) { + + key = tag[y]; + res = this.tagindex[key]; + len = res && res.length; + + if (len) { + + count++; + arr[arr.length] = bool ? [res] : res; + } + } + + if (count) { + + if (bool) { + + res = intersect(arr, limit || 100, offset || 0); + } else { + + res = intersect_union(res, arr); + } + + len = res.length; + } + } + + if (len) { + + result_field[count] = key; + result[count++] = res; + } else if (bool) { + + return []; + } + } + + if (promises) { + + const self = this; + + // anyone knows a better workaround of optionally having async promises? + // the promise.all() needs to be wrapped into additional promise, + // otherwise the recursive callback wouldn't run before return + + return new Promise(function (resolve) { + + Promise.all(promises).then(function (result) { + + resolve(self.search(query, limit, options, result)); + }); + }); + } + + if (!count) { + + // fast path "not found" + + return []; + } + + if (pluck && (!enrich || !this.store)) { + + // fast path optimization + + return result[0]; + } + + for (let i = 0, res; i < result_field.length; i++) { + + res = result[i]; + + if (res.length) { + + if (enrich) { + + res = apply_enrich.call(this, res); + } + } + + if (pluck) { + + return res; + } + + result[i] = { + + field: result_field[i], + result: res + }; + } + + return result; +}; + +/** + * @this Document + */ + +function get_tag(key, limit, offset) { + let res = this.tagindex[key], + len = res && res.length - offset; +} + +/** + * @this Document + */ + +function apply_enrich(res) { + + const arr = Array(res.length); + + for (let x = 0, id; x < res.length; x++) { + + id = res[x]; + + arr[x] = { + + id: id, + doc: this.store[id] + }; + } + + return arr; +} + +Document.prototype.contain = function (id) { + + return !!this.register[id]; +}; + +Document.prototype.get = function (id) { + + return this.store[id]; +}; + +Document.prototype.set = function (id, data) { + + this.store[id] = data; + return this; +}; + + +Document.prototype.searchCache = searchCache; + + +Document.prototype.export = exportDocument; +Document.prototype.import = importDocument; + + +apply_async(Document.prototype); \ No newline at end of file diff --git a/dist/module/engine.js b/dist/module/engine.js index f55d700..715226b 100644 --- a/dist/module/engine.js +++ b/dist/module/engine.js @@ -1 +1,28 @@ -import{DEBUG,SUPPORT_ASYNC,SUPPORT_CACHE}from"./config";import{searchCache}from"./cache";function Engine(a){if(DEBUG&&this instanceof Engine)throw new Error("Can't instantiate abstract class!");SUPPORT_CACHE&&(a.prototype.searchCache=searchCache),SUPPORT_ASYNC&&(a.prototype.addAsync=addAsync,a.prototype.appendAsync=appendAsync,a.prototype.searchAsync=searchAsync,a.prototype.updateAsync=updateAsync,a.prototype.removeAsync=removeAsync)}SUPPORT_CACHE&&(Engine.prototype.searchCache=searchCache),SUPPORT_ASYNC&&(Engine.prototype.addAsync=addAsync,Engine.prototype.appendAsync=appendAsync,Engine.prototype.searchAsync=searchAsync,Engine.prototype.updateAsync=updateAsync,Engine.prototype.removeAsync=removeAsync); \ No newline at end of file + +import { searchCache } from "./cache"; + +/** + * @constructor + * @abstract + */ + +function Engine(index) { + + index.prototype.searchCache = searchCache; + + + index.prototype.addAsync = addAsync; + index.prototype.appendAsync = appendAsync; + index.prototype.searchAsync = searchAsync; + index.prototype.updateAsync = updateAsync; + index.prototype.removeAsync = removeAsync; +} + +Engine.prototype.searchCache = searchCache; + + +Engine.prototype.addAsync = addAsync; +Engine.prototype.appendAsync = appendAsync; +Engine.prototype.searchAsync = searchAsync; +Engine.prototype.updateAsync = updateAsync; +Engine.prototype.removeAsync = removeAsync; \ No newline at end of file diff --git a/dist/module/global.js b/dist/module/global.js index 591abaa..bd7da48 100644 --- a/dist/module/global.js +++ b/dist/module/global.js @@ -1 +1,22 @@ -export const global_lang={};export const global_charset={};export function registerCharset(a,b){global_charset[a]=b}export function registerLanguage(a,b){global_lang[a]=b} \ No newline at end of file +export const global_lang = {}; +export const global_charset = {}; + +/** + * @param {!string} name + * @param {Object} charset + */ + +export function registerCharset(name, charset) { + + global_charset[name] = charset; +} + +/** + * @param {!string} name + * @param {Object} lang + */ + +export function registerLanguage(name, lang) { + + global_lang[name] = lang; +} \ No newline at end of file diff --git a/dist/module/index.js b/dist/module/index.js index c4a7e9a..d6f8703 100644 --- a/dist/module/index.js +++ b/dist/module/index.js @@ -1 +1,784 @@ -import{SUPPORT_ENCODER,SUPPORT_CACHE,SUPPORT_ASYNC,SUPPORT_SUGGESTION,SUPPORT_SERIALIZE}from"./config.js";import{IndexInterface}from"./type.js";import{encode as default_encoder}from"./lang/latin/default.js";import{create_object,create_object_array,concat,sort_by_length_down,is_array,is_string,is_object,parse_option}from"./common.js";import{pipeline,init_stemmer_or_matcher,init_filter}from"./lang.js";import{global_lang,global_charset}from"./global.js";import apply_async from"./async.js";import{intersect}from"./intersect.js";import Cache,{searchCache}from"./cache.js";import apply_preset from"./preset.js";import{exportIndex,importIndex}from"./serialize.js";function Index(a,b){if(!(this instanceof Index))return new Index(a);let c,d,e;a?(SUPPORT_ENCODER&&(a=apply_preset(a)),c=a.charset,d=a.lang,is_string(c)&&(-1===c.indexOf(":")&&(c+=":default"),c=global_charset[c]),is_string(d)&&(d=global_lang[d])):a={};let f,g,h=a.context||{};this.encode=a.encode||c&&c.encode||default_encoder,this.register=b||create_object(),this.resolution=f=a.resolution||9,this.tokenize=e=c&&c.tokenize||a.tokenize||"strict",this.depth="strict"===e&&h.depth,this.bidirectional=parse_option(h.bidirectional,!0),this.optimize=g=parse_option(a.optimize,!0),this.fastupdate=parse_option(a.fastupdate,!0),this.minlength=a.minlength||1,this.boost=a.boost,this.map=g?create_object_array(f):create_object(),this.resolution_ctx=f=h.resolution||1,this.ctx=g?create_object_array(f):create_object(),this.rtl=c&&c.rtl||a.rtl,this.matcher=(e=a.matcher||d&&d.matcher)&&init_stemmer_or_matcher(e,!1),this.stemmer=(e=a.stemmer||d&&d.stemmer)&&init_stemmer_or_matcher(e,!0),this.filter=(e=a.filter||d&&d.filter)&&init_filter(e),SUPPORT_CACHE&&(this.cache=(e=a.cache)&&new Cache(e))}export default Index;Index.prototype.append=function(a,b){return this.add(a,b,!0)},Index.prototype.add=function(a,b,c,d){if(b&&(a||0===a)){if(!d&&!c&&this.register[a])return this.update(a,b);b=this.encode(""+b);const e=b.length;if(e){const d=create_object(),f=create_object(),g=this.depth,h=this.resolution;for(let j=0;j=this.minlength&&(g||!f[i])){let l=get_score(h,e,j),m="";switch(this.tokenize){case"full":if(2b;d--)if(d-b>=this.minlength){const g=get_score(h,e,j,k,b);m=i.substring(b,d),this.push_index(f,m,g,a,c)}break}case"reverse":if(1=this.minlength){const d=get_score(h,e,j,k,b);this.push_index(f,m,d,a,c)}m=""}case"forward":if(1=this.minlength&&this.push_index(f,m,l,a,c);break}default:if(this.boost&&(l=Math.min(0|l/this.boost(b,i,j),h-1)),this.push_index(f,i,l,a,c),g&&1=this.minlength&&!f[i]){f[i]=1;const b=get_score(h+(e/2>h?0:1),e,j,l-1,g-1),m=this.bidirectional&&i>k;this.push_index(d,m?k:i,b,a,c,m?i:k)}}}}}this.fastupdate||(this.register[a]=1)}}return this};function get_score(a,b,c,d,e){return c&&1=this.minlength&&!b[e]){if(!this.optimize&&!f&&!this.map[e])return g;c[i++]=e,b[e]=1}a=c,d=a.length}if(!d)return g;b||(b=100);let i,j=this.depth&&1=c)))));l++);if(b)return e?single_result(h,c,0):void(a[a.length]=h)}return!b&&h};function single_result(a,b,c){return a=1===a.length?a[0]:concat(a),c||a.length>b?a.slice(c,c+b):a}function get_array(a,b,c,d){if(c){const e=d&&b>c;a=a[e?b:c],a=a&&a[e?c:b]}else a=a[b];return a}Index.prototype.contain=function(a){return!!this.register[a]},Index.prototype.update=function(a,b){return this.remove(a).add(a,b)},Index.prototype.remove=function(a,b){const c=this.register[a];if(c){if(this.fastupdate)for(let b,d=0;d= this.minlength && (depth || !dupes[term])) { + let score = get_score(resolution, length, i), + token = ""; + + + switch (this.tokenize) { + + case "full": + + if (2 < term_length) { + + for (let x = 0; x < term_length; x++) { + + for (let y = term_length; y > x; y--) { + + if (y - x >= this.minlength) { + + const partial_score = get_score(resolution, length, i, term_length, x); + token = term.substring(x, y); + this.push_index(dupes, token, partial_score, id, _append); + } + } + } + + break; + } + + // fallthrough to next case when term length < 3 + + case "reverse": + + // skip last round (this token exist already in "forward") + + if (1 < term_length) { + + for (let x = term_length - 1; 0 < x; x--) { + + token = term[x] + token; + + if (token.length >= this.minlength) { + + const partial_score = get_score(resolution, length, i, term_length, x); + this.push_index(dupes, token, partial_score, id, _append); + } + } + + token = ""; + } + + // fallthrough to next case to apply forward also + + case "forward": + + if (1 < term_length) { + + for (let x = 0; x < term_length; x++) { + + token += term[x]; + + if (token.length >= this.minlength) { + + this.push_index(dupes, token, score, id, _append); + } + } + + break; + } + + // fallthrough to next case when token has a length of 1 + + default: + // case "strict": + + if (this.boost) { + + score = Math.min(0 | score / this.boost(content, term, i), resolution - 1); + } + + this.push_index(dupes, term, score, id, _append); + + // context is just supported by tokenizer "strict" + + if (depth) { + + if (1 < length && i < length - 1) { + + // check inner dupes to skip repeating words in the current context + + const dupes_inner = create_object(), + resolution = this.resolution_ctx, + keyword = term, + size = Math.min(depth + 1, length - i); + + + dupes_inner[keyword] = 1; + + for (let x = 1; x < size; x++) { + + term = content[this.rtl ? length - 1 - i - x : i + x]; + + if (term && term.length >= this.minlength && !dupes_inner[term]) { + + dupes_inner[term] = 1; + + const context_score = get_score(resolution + (length / 2 > resolution ? 0 : 1), length, i, size - 1, x - 1), + swap = this.bidirectional && term > keyword; + + this.push_index(dupes_ctx, swap ? keyword : term, context_score, id, _append, swap ? term : keyword); + } + } + } + } + } + } + } + + this.fastupdate || (this.register[id] = 1); + } + } + + return this; +}; + +/** + * @param {number} resolution + * @param {number} length + * @param {number} i + * @param {number=} term_length + * @param {number=} x + * @returns {number} + */ + +function get_score(resolution, length, i, term_length, x) { + + // console.log("resolution", resolution); + // console.log("length", length); + // console.log("term_length", term_length); + // console.log("i", i); + // console.log("x", x); + // console.log((resolution - 1) / (length + (term_length || 0)) * (i + (x || 0)) + 1); + + // the first resolution slot is reserved for the best match, + // when a query matches the first word(s). + + // also to stretch score to the whole range of resolution, the + // calculation is shift by one and cut the floating point. + // this needs the resolution "1" to be handled additionally. + + // do not stretch the resolution more than the term length will + // improve performance and memory, also it improves scoring in + // most cases between a short document and a long document + + return i && 1 < resolution ? length + (term_length || 0) <= resolution ? i + (x || 0) : 0 | (resolution - 1) / (length + (term_length || 0)) * (i + (x || 0)) + 1 : 0; +} + +/** + * @private + * @param dupes + * @param value + * @param score + * @param id + * @param {boolean=} append + * @param {string=} keyword + */ + +Index.prototype.push_index = function (dupes, value, score, id, append, keyword) { + + let arr = keyword ? this.ctx : this.map; + + if (!dupes[value] || keyword && !dupes[value][keyword]) { + + if (this.optimize) { + + arr = arr[score]; + } + + if (keyword) { + + dupes = dupes[value] || (dupes[value] = create_object()); + dupes[keyword] = 1; + + arr = arr[keyword] || (arr[keyword] = create_object()); + } else { + + dupes[value] = 1; + } + + arr = arr[value] || (arr[value] = []); + + if (!this.optimize) { + + arr = arr[score] || (arr[score] = []); + } + + if (!append || !arr.includes(id)) { + + arr[arr.length] = id; + + // add a reference to the register for fast updates + + if (this.fastupdate) { + + const tmp = this.register[id] || (this.register[id] = []); + tmp[tmp.length] = arr; + } + } + } +}; + +/** + * @param {string|Object} query + * @param {number|Object=} limit + * @param {Object=} options + * @returns {Array} + */ + +Index.prototype.search = function (query, limit, options) { + + if (!options) { + + if (!limit && is_object(query)) { + + options = /** @type {Object} */query; + query = options.query; + } else if (is_object(limit)) { + + options = /** @type {Object} */limit; + } + } + + let result = [], + length, + context, + suggest, + offset = 0; + + + if (options) { + + query = options.query || query; + limit = options.limit; + offset = options.offset || 0; + context = options.context; + suggest = options.suggest; + } + + if (query) { + + query = /** @type {Array} */this.encode("" + query); + length = query.length; + + // TODO: solve this in one single loop below + + if (1 < length) { + const dupes = create_object(), + query_new = []; + + + for (let i = 0, count = 0, term; i < length; i++) { + + term = query[i]; + + if (term && term.length >= this.minlength && !dupes[term]) { + + // this fast path can just apply when not in memory-optimized mode + + if (!this.optimize && !suggest && !this.map[term]) { + + // fast path "not found" + + return result; + } else { + + query_new[count++] = term; + dupes[term] = 1; + } + } + } + + query = query_new; + length = query.length; + } + } + + if (!length) { + + return result; + } + + limit || (limit = 100); + + let depth = this.depth && 1 < length && !1 !== context, + index = 0, + keyword; + + + if (depth) { + + keyword = query[0]; + index = 1; + } else { + + if (1 < length) { + + query.sort(sort_by_length_down); + } + } + + for (let arr, term; index < length; index++) { + + term = query[index]; + + // console.log(keyword); + // console.log(term); + // console.log(""); + + if (depth) { + + arr = this.add_result(result, suggest, limit, offset, 2 === length, term, keyword); + + // console.log(arr); + // console.log(result); + + // when suggestion enabled just forward keyword if term was found + // as long as the result is empty forward the pointer also + + if (!suggest || !1 !== arr || !result.length) { + + keyword = term; + } + } else { + + arr = this.add_result(result, suggest, limit, offset, 1 === length, term); + } + + if (arr) { + + return (/** @type {Array} */arr + ); + } + + // apply suggestions on last loop or fallback + + if (suggest && index == length - 1) { + + let length = result.length; + + if (!length) { + + if (depth) { + + // fallback to non-contextual search when no result was found + + depth = 0; + index = -1; + + continue; + } + + return result; + } else if (1 === length) { + + // fast path optimization + + return single_result(result[0], limit, offset); + } + } + } + + return intersect(result, limit, offset, suggest); +}; + +/** + * Returns an array when the result is done (to stop the process immediately), + * returns false when suggestions is enabled and no result was found, + * or returns nothing when a set was pushed successfully to the results + * + * @private + * @param {Array} result + * @param {Array} suggest + * @param {number} limit + * @param {number} offset + * @param {boolean} single_term + * @param {string} term + * @param {string=} keyword + * @return {Array>|boolean|undefined} + */ + +Index.prototype.add_result = function (result, suggest, limit, offset, single_term, term, keyword) { + let word_arr = [], + arr = keyword ? this.ctx : this.map; + + + if (!this.optimize) { + + arr = get_array(arr, term, keyword, this.bidirectional); + } + + if (arr) { + + let count = 0; + const arr_len = Math.min(arr.length, keyword ? this.resolution_ctx : this.resolution); + + // relevance: + for (let x = 0, size = 0, tmp, len; x < arr_len; x++) { + + tmp = arr[x]; + + if (tmp) { + + if (this.optimize) { + + tmp = get_array(tmp, term, keyword, this.bidirectional); + } + + if (offset) { + + if (tmp && single_term) { + + len = tmp.length; + + if (len <= offset) { + + offset -= len; + tmp = null; + } else { + + tmp = tmp.slice(offset); + offset = 0; + } + } + } + + if (tmp) { + + // keep score (sparse array): + //word_arr[x] = tmp; + + // simplified score order: + word_arr[count++] = tmp; + + if (single_term) { + + size += tmp.length; + + if (size >= limit) { + + // fast path optimization + + break; + } + } + } + } + } + + if (count) { + + if (single_term) { + + // fast path optimization + // offset was already applied at this point + + return single_result(word_arr, limit, 0); + } + + result[result.length] = word_arr; + return; + } + } + + // return an empty array will stop the loop, + // to prevent stop when using suggestions return a false value + + return !suggest && word_arr; +}; + +function single_result(result, limit, offset) { + + if (1 === result.length) { + + result = result[0]; + } else { + + result = concat(result); + } + + return offset || result.length > limit ? result.slice(offset, offset + limit) : result; +} + +function get_array(arr, term, keyword, bidirectional) { + + if (keyword) { + + // the frequency of the starting letter is slightly less + // on the last half of the alphabet (m-z) in almost every latin language, + // so we sort downwards (https://en.wikipedia.org/wiki/Letter_frequency) + + const swap = bidirectional && term > keyword; + + arr = arr[swap ? term : keyword]; + arr = arr && arr[swap ? keyword : term]; + } else { + + arr = arr[term]; + } + + return arr; +} + +Index.prototype.contain = function (id) { + + return !!this.register[id]; +}; + +Index.prototype.update = function (id, content) { + + return this.remove(id).add(id, content); +}; + +/** + * @param {boolean=} _skip_deletion + */ + +Index.prototype.remove = function (id, _skip_deletion) { + + const refs = this.register[id]; + + if (refs) { + + if (this.fastupdate) { + + // fast updates performs really fast but did not fully cleanup the key entries + + for (let i = 0, tmp; i < refs.length; i++) { + + tmp = refs[i]; + tmp.splice(tmp.indexOf(id), 1); + } + } else { + + remove_index(this.map, id, this.resolution, this.optimize); + + if (this.depth) { + + remove_index(this.ctx, id, this.resolution_ctx, this.optimize); + } + } + + _skip_deletion || delete this.register[id]; + + if (this.cache) { + + this.cache.del(id); + } + } + + return this; +}; + +/** + * @param map + * @param id + * @param res + * @param optimize + * @param {number=} resolution + * @return {number} + */ + +function remove_index(map, id, res, optimize, resolution) { + + let count = 0; + + if (is_array(map)) { + + // the first array is the score array in both strategies + + if (!resolution) { + + resolution = Math.min(map.length, res); + + for (let x = 0, arr; x < resolution; x++) { + + arr = map[x]; + + if (arr) { + + count = remove_index(arr, id, res, optimize, resolution); + + if (!optimize && !count) { + + // when not memory optimized the score index should removed + + delete map[x]; + } + } + } + } else { + + const pos = map.indexOf(id); + + if (-1 !== pos) { + + // fast path, when length is 1 or lower then the whole field gets deleted + + if (1 < map.length) { + + map.splice(pos, 1); + count++; + } + } else { + + count++; + } + } + } else { + + for (let key in map) { + + count = remove_index(map[key], id, res, optimize, resolution); + + if (!count) { + + delete map[key]; + } + } + } + + return count; +} + +Index.prototype.searchCache = searchCache; + + +Index.prototype.export = exportIndex; +Index.prototype.import = importIndex; + + +apply_async(Index.prototype); \ No newline at end of file diff --git a/dist/module/intersect.js b/dist/module/intersect.js index 26b6ab9..2935747 100644 --- a/dist/module/intersect.js +++ b/dist/module/intersect.js @@ -1 +1,394 @@ -import{create_object,concat}from"./common.js";export function intersect(a,b,c,d){const e=a.length;let f,g,h=[],i=0;d&&(d=[]);for(let j=e-1;0<=j;j--){const k=a[j],l=k.length,m=create_object();let n=!f;for(let a=0;a= 0; x--){ +// +// if(x !== smallest_index){ +// +// steps++; +// +// const word_arr = arrays[x]; +// const word_arr_len = word_arr.length; +// const new_arr = []; +// +// let count = 0; +// +// for(let z = 0, id; z < smallest_arr.length; z++){ +// +// id = smallest_arr[z]; +// +// let found; +// +// // process relevance in forward order (direction is +// // important for adding IDs during the last round) +// +// for(let y = 0; y < word_arr_len; y++){ +// +// const arr = word_arr[y]; +// +// if(arr.length){ +// +// found = arr.includes(id); +// +// if(found){ +// +// // check if in last round +// +// if(steps === length - 1){ +// +// if(offset){ +// +// offset--; +// } +// else{ +// +// result[size++] = id; +// +// if(size === limit){ +// +// // fast path "end reached" +// +// return result; +// } +// } +// +// if(suggest){ +// +// check[id] = 1; +// } +// } +// +// break; +// } +// } +// } +// +// if(found){ +// +// new_arr[count++] = id; +// } +// } +// +// if(suggest){ +// +// suggest[steps] = new_arr; +// } +// else if(!count){ +// +// return []; +// } +// +// smallest_arr = new_arr; +// } +// } +// +// if(suggest){ +// +// // needs to iterate in reverse direction +// +// for(let x = suggest.length - 1, arr, len; x >= 0; x--){ +// +// arr = suggest[x]; +// len = arr && arr.length; +// +// if(len){ +// +// for(let y = 0, id; y < len; y++){ +// +// id = arr[y]; +// +// if(!check[id]){ +// +// check[id] = 1; +// +// if(offset){ +// +// offset--; +// } +// else{ +// +// result[size++] = id; +// +// if(size === limit){ +// +// // fast path "end reached" +// +// return result; +// } +// } +// } +// } +// } +// } +// } +// +// return result; +// } + +/** + * Implementation based on Object[key] provides better suggestions + * capabilities and has less performance scaling issues on large indexes. + * + * @param arrays + * @param limit + * @param offset + * @param {boolean|Array=} suggest + * @returns {Array} + */ + +export function intersect(arrays, limit, offset, suggest) { + + const length = arrays.length; + let result = [], + check, + check_suggest, + size = 0; + + + if (suggest) { + + suggest = []; + } + + // process terms in reversed order often has advantage for the fast path "end reached". + // also a reversed order prioritize the order of words from a query. + + for (let x = length - 1; 0 <= x; x--) { + const word_arr = arrays[x], + word_arr_len = word_arr.length, + check_new = create_object(); + + + let found = !check; + + // process relevance in forward order (direction is + // important for adding IDs during the last round) + + for (let y = 0; y < word_arr_len; y++) { + const arr = word_arr[y], + arr_len = arr.length; + + + if (arr_len) { + + // loop through IDs + + for (let z = 0, check_idx, id; z < arr_len; z++) { + + id = arr[z]; + + if (check) { + + if (check[id]) { + + // check if in last round + + if (!x) { + + if (offset) { + + offset--; + } else { + + result[size++] = id; + + if (size === limit) { + + // fast path "end reached" + + return result; + } + } + } + + if (x || suggest) { + + check_new[id] = 1; + } + + found = /* append: */ /* skip update: */ /* skip_update: */!0; + } + + if (suggest) { + + check_idx = (check_suggest[id] || 0) + 1; + check_suggest[id] = check_idx; + + // do not adding IDs which are already included in the result (saves one loop) + // the first intersection match has the check index 2, so shift by -2 + + if (check_idx < length) { + + const tmp = suggest[check_idx - 2] || (suggest[check_idx - 2] = []); + tmp[tmp.length] = id; + } + } + } else { + + // pre-fill in first round + + check_new[id] = 1; + } + } + } + } + + if (suggest) { + + // re-use the first pre-filled check for suggestions + + check || (check_suggest = check_new); + } else if (!found) { + + return []; + } + + check = check_new; + } + + if (suggest) { + + // needs to iterate in reverse direction + + for (let x = suggest.length - 1, arr, len; 0 <= x; x--) { + + arr = suggest[x]; + len = arr.length; + + for (let y = 0, id; y < len; y++) { + + id = arr[y]; + + if (!check[id]) { + + if (offset) { + + offset--; + } else { + + result[size++] = id; + + if (size === limit) { + + // fast path "end reached" + + return result; + } + } + + check[id] = 1; + } + } + } + } + + return result; +} + +/** + * @param mandatory + * @param arrays + * @returns {Array} + */ + +export function intersect_union(mandatory, arrays) { + const check = create_object(), + union = create_object(), + result = []; + + + for (let x = 0; x < mandatory.length; x++) { + + check[mandatory[x]] = 1; + } + + for (let x = 0, arr; x < arrays.length; x++) { + + arr = arrays[x]; + + for (let y = 0, id; y < arr.length; y++) { + + id = arr[y]; + + if (check[id]) { + + if (!union[id]) { + + union[id] = 1; + result[result.length] = id; + } + } + } + } + + return result; +} \ No newline at end of file diff --git a/dist/module/lang.js b/dist/module/lang.js index 0667758..954ae86 100644 --- a/dist/module/lang.js +++ b/dist/module/lang.js @@ -1 +1,321 @@ -import{IndexInterface}from"./type.js";import{create_object,get_keys}from"./common.js";export function pipeline(a,b,c,d){if(a&&(b&&(a=replace(a,b)),this.matcher&&(a=replace(a,this.matcher)),this.stemmer&&1=} normalize + * @param {boolean|string|RegExp=} split + * @param {boolean=} _collapse + * @returns {string|Array} + * @this IndexInterface + */ + +export function pipeline(str, normalize, split, _collapse) { + + if (str) { + + if (normalize) { + + str = replace(str, /** @type {Array} */normalize); + } + + if (this.matcher) { + + str = replace(str, this.matcher); + } + + if (this.stemmer && 1 < str.length) { + + str = replace(str, this.stemmer); + } + + if (_collapse && 1 < str.length) { + + str = collapse(str); + } + + if (split || "" === split) { + + const words = str.split( /** @type {string|RegExp} */split); + + return this.filter ? filter(words, this.filter) : words; + } + } + + return str; +} + +// TODO improve normalize + remove non-delimited chars like in "I'm" + split on whitespace+ + +export const regex_whitespace = /[\p{Z}\p{S}\p{P}\p{C}]+/u; +// https://github.com/nextapps-de/flexsearch/pull/414 +//export const regex_whitespace = /[\s\xA0\u2000-\u200B\u2028\u2029\u3000\ufeff!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/ +const regex_normalize = /[\u0300-\u036f]/g; + +export function normalize(str) { + + if (str.normalize) { + + str = str.normalize("NFD").replace(regex_normalize, ""); + } + + return str; +} + +/** + * @param {!string} str + * @param {boolean|Array=} normalize + * @param {boolean|string|RegExp=} split + * @param {boolean=} _collapse + * @returns {string|Array} + */ + +// FlexSearch.prototype.pipeline = function(str, normalize, split, _collapse){ +// +// if(str){ +// +// if(normalize && str){ +// +// str = replace(str, /** @type {Array} */ (normalize)); +// } +// +// if(str && this.matcher){ +// +// str = replace(str, this.matcher); +// } +// +// if(this.stemmer && str.length > 1){ +// +// str = replace(str, this.stemmer); +// } +// +// if(_collapse && str.length > 1){ +// +// str = collapse(str); +// } +// +// if(str){ +// +// if(split || (split === "")){ +// +// const words = str.split(/** @type {string|RegExp} */ (split)); +// +// return this.filter ? filter(words, this.filter) : words; +// } +// } +// } +// +// return str; +// }; + +// export function pipeline(str, normalize, matcher, stemmer, split, _filter, _collapse){ +// +// if(str){ +// +// if(normalize && str){ +// +// str = replace(str, normalize); +// } +// +// if(matcher && str){ +// +// str = replace(str, matcher); +// } +// +// if(stemmer && str.length > 1){ +// +// str = replace(str, stemmer); +// } +// +// if(_collapse && str.length > 1){ +// +// str = collapse(str); +// } +// +// if(str){ +// +// if(split !== false){ +// +// str = str.split(split); +// +// if(_filter){ +// +// str = filter(str, _filter); +// } +// } +// } +// } +// +// return str; +// } + + +/** + * @param {Array} words + * @returns {Object} + */ + +export function init_filter(words) { + + const filter = create_object(); + + for (let i = 0, length = words.length; i < length; i++) { + + filter[words[i]] = 1; + } + + return filter; +} + +/** + * @param {!Object} obj + * @param {boolean} is_stemmer + * @returns {Array} + */ + +export function init_stemmer_or_matcher(obj, is_stemmer) { + const keys = get_keys(obj), + length = keys.length, + final = []; + + + let removal = "", + count = 0; + + for (let i = 0, key, tmp; i < length; i++) { + + key = keys[i]; + tmp = obj[key]; + + if (tmp) { + + final[count++] = regex(is_stemmer ? "(?!\\b)" + key + "(\\b|_)" : key); + final[count++] = tmp; + } else { + + removal += (removal ? "|" : "") + key; + } + } + + if (removal) { + + final[count++] = regex(is_stemmer ? "(?!\\b)(" + removal + ")(\\b|_)" : "(" + removal + ")"); + final[count] = ""; + } + + return final; +} + +/** + * @param {!string} str + * @param {Array} regexp + * @returns {string} + */ + +export function replace(str, regexp) { + + for (let i = 0, len = regexp.length; i < len; i += 2) { + + str = str.replace(regexp[i], regexp[i + 1]); + + if (!str) { + + break; + } + } + + return str; +} + +/** + * @param {!string} str + * @returns {RegExp} + */ + +export function regex(str) { + + return new RegExp(str, "g"); +} + +/** + * Regex: replace(/(?:(\w)(?:\1)*)/g, "$1") + * @param {!string} string + * @returns {string} + */ + +export function collapse(string) { + + let final = "", + prev = ""; + + for (let i = 0, len = string.length, char; i < len; i++) { + + if ((char = string[i]) !== prev) { + + final += prev = char; + } + } + + return final; +} + +// TODO using fast-swap +export function filter(words, map) { + const length = words.length, + filtered = []; + + + for (let i = 0, count = 0; i < length; i++) { + + const word = words[i]; + + if (word && !map[word]) { + + filtered[count++] = word; + } + } + + return filtered; +} + +// const chars = {a:1, e:1, i:1, o:1, u:1, y:1}; +// +// function collapse_repeating_chars(string){ +// +// let collapsed_string = "", +// char_prev = "", +// char_next = ""; +// +// for(let i = 0; i < string.length; i++){ +// +// const char = string[i]; +// +// if(char !== char_prev){ +// +// if(i && (char === "h")){ +// +// if((chars[char_prev] && chars[char_next]) || (char_prev === " ")){ +// +// collapsed_string += char; +// } +// } +// else{ +// +// collapsed_string += char; +// } +// } +// +// char_next = ( +// +// (i === (string.length - 1)) ? +// +// "" +// : +// string[i + 1] +// ); +// +// char_prev = char; +// } +// +// return collapsed_string; +// } \ No newline at end of file diff --git a/dist/module/lang/arabic/default.js b/dist/module/lang/arabic/default.js index c29f429..89f65a6 100644 --- a/dist/module/lang/arabic/default.js +++ b/dist/module/lang/arabic/default.js @@ -1 +1,27 @@ -import{IndexInterface}from"../../type.js";import{pipeline}from"../../lang.js";export const rtl=!0;export const tokenize="";export default{encode:encode,rtl:!0};const regex=/[\x00-\x7F]+/g,split=/\s+/;export function encode(a){return pipeline.call(this,(""+a).replace(regex," "),!1,split,!1)} \ No newline at end of file +import { IndexInterface } from "../../type.js"; +import { pipeline } from "../../lang.js"; + +export const rtl = /* append: */ /* skip update: */ /* skip_update: */!0; +export const tokenize = ""; +export default { + encode: encode, + rtl: !0 +}; + +const regex = /[\x00-\x7F]+/g, + split = /\s+/; + + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).replace(regex, " "), + /* normalize: */ + /* collapse: */!1, + /* split: */split, !1); +} \ No newline at end of file diff --git a/dist/module/lang/at.js b/dist/module/lang/at.js index 2bb3e62..af404df 100644 --- a/dist/module/lang/at.js +++ b/dist/module/lang/at.js @@ -1 +1,41 @@ -export const filter=["aber","als","am","an","auch","auf","aus","bei","bin","bis","bist","da","dadurch","daher","darum","das","da\xDF","dass","dein","deine","dem","den","der","des","dessen","deshalb","die","dies","dieser","dieses","doch","dort","du","durch","ein","eine","einem","einen","einer","eines","er","es","euer","eure","f\xFCr","hatte","hatten","hattest","hattet","hier","hinter","ich","ihr","ihre","im","in","ist","ja","jede","jedem","jeden","jeder","jedes","jener","jenes","jetzt","kann","kannst","k\xF6nnen","k\xF6nnt","machen","mein","meine","mit","mu\xDF","mu\xDFt","musst","m\xFCssen","m\xFC\xDFt","nach","nachdem","nein","nicht","nun","oder","seid","sein","seine","sich","sie","sind","soll","sollen","sollst","sollt","sonst","soweit","sowie","und","unser","unsere","unter","vom","von","vor","wann","warum","was","weiter","weitere","wenn","wer","werde","werden","werdet","weshalb","wie","wieder","wieso","wir","wird","wirst","wo","woher","wohin","zu","zum","zur","\xFCber"];export const stemmer={niss:"",isch:"",lich:"",heit:"",keit:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""};export const matcher={};export default{filter:filter,stemmer:stemmer,matcher:matcher}; \ No newline at end of file +/** + * http://www.ranks.nl/stopwords + * @type {Array} + */ + +export const filter = ["aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", "bis", "bist", "da", "dadurch", "daher", "darum", "das", "daß", "dass", "dein", "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", "es", "euer", "eure", "für", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", "ich", "ihr", "ihre", "im", "in", "ist", "ja", "jede", "jedem", "jeden", "jeder", "jedes", "jener", "jenes", "jetzt", "kann", "kannst", "können", "könnt", "machen", "mein", "meine", "mit", "muß", "mußt", "musst", "müssen", "müßt", "nach", "nachdem", "nein", "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", "wer", "werde", "werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "über"]; + +/** + * @type {Object} + */ + +export const stemmer = { + + niss: "", + isch: "", + lich: "", + heit: "", + keit: "", + end: "", + ung: "", + est: "", + ern: "", + em: "", + er: "", + en: "", + es: "", + st: "", + ig: "", + ik: "", + e: "", + s: "" +}; + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module/lang/cjk/default.js b/dist/module/lang/cjk/default.js index a2a9870..a0e94f2 100644 --- a/dist/module/lang/cjk/default.js +++ b/dist/module/lang/cjk/default.js @@ -1 +1,26 @@ -import{IndexInterface}from"../../type.js";import{pipeline}from"../../lang.js";export const rtl=!1;export const tokenize="strict";export default{encode:encode,rtl:!1,tokenize:"strict"};const regex=/[\x00-\x7F]+/g;export function encode(a){return pipeline.call(this,(""+a).replace(regex,""),!1,"",!1)} \ No newline at end of file +import { IndexInterface } from "../../type.js"; +import { pipeline } from "../../lang.js"; + +export const rtl = /* normalize: */ /* collapse: */ +/* normalize: */ +/* collapse: */!1; +export const tokenize = "strict"; +export default { + encode: encode, + rtl: !1, + tokenize: "strict" +}; + +const regex = /[\x00-\x7F]+/g; + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).replace(regex, ""), !1, + /* split: */"", !1); +} \ No newline at end of file diff --git a/dist/module/lang/cyrillic/default.js b/dist/module/lang/cyrillic/default.js index b28f425..de45263 100644 --- a/dist/module/lang/cyrillic/default.js +++ b/dist/module/lang/cyrillic/default.js @@ -1 +1,27 @@ -import{IndexInterface}from"../../type.js";import{pipeline}from"../../lang.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1};const regex=/[\x00-\x7F]+/g,split=/\s+/;export function encode(a){return pipeline.call(this,(""+a).replace(regex," "),!1,split,!1)} \ No newline at end of file +import { IndexInterface } from "../../type.js"; +import { pipeline } from "../../lang.js"; + +export const rtl = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ +/* normalize: */ +/* collapse: */!1; +export const tokenize = ""; +export default { + encode: encode, + rtl: !1 +}; + +const regex = /[\x00-\x7F]+/g, + split = /\s+/; + + +/** + * @param {string|number} str + * @this IndexInterface + */ + +export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).replace(regex, " "), !1, + /* split: */split, !1); +} \ No newline at end of file diff --git a/dist/module/lang/de.js b/dist/module/lang/de.js index b137675..8196777 100644 --- a/dist/module/lang/de.js +++ b/dist/module/lang/de.js @@ -1 +1,54 @@ -export const filter=["aber","als","am","an","auch","auf","aus","bei","bin","bis","bist","da","dadurch","daher","darum","das","da\xDF","dass","dein","deine","dem","den","der","des","dessen","deshalb","die","dies","dieser","dieses","doch","dort","du","durch","ein","eine","einem","einen","einer","eines","er","es","euer","eure","f\xFCr","hatte","hatten","hattest","hattet","hier","hinter","ich","ihr","ihre","im","in","ist","ja","jede","jedem","jeden","jeder","jedes","jener","jenes","jetzt","kann","kannst","k\xF6nnen","k\xF6nnt","machen","mein","meine","mit","mu\xDF","mu\xDFt","musst","m\xFCssen","m\xFC\xDFt","nach","nachdem","nein","nicht","nun","oder","seid","sein","seine","sich","sie","sind","soll","sollen","sollst","sollt","sonst","soweit","sowie","und","unser","unsere","unter","vom","von","vor","wann","warum","was","weiter","weitere","wenn","wer","werde","werden","werdet","weshalb","wie","wieder","wieso","wir","wird","wirst","wo","woher","wohin","zu","zum","zur","\xFCber"];export const stemmer={niss:"",isch:"",lich:"",heit:"",keit:"",ell:"",bar:"",end:"",ung:"",est:"",ern:"",em:"",er:"",en:"",es:"",st:"",ig:"",ik:"",e:"",s:""};export const matcher={};export default{filter:filter,stemmer:stemmer,matcher:matcher}; \ No newline at end of file +/** + * Filter are also known as "stopwords", they completely filter out words from being indexed. + * Source: http://www.ranks.nl/stopwords + * Object Definition: Just provide an array of words. + * @type {Array} + */ + +export const filter = ["aber", "als", "am", "an", "auch", "auf", "aus", "bei", "bin", "bis", "bist", "da", "dadurch", "daher", "darum", "das", "daß", "dass", "dein", "deine", "dem", "den", "der", "des", "dessen", "deshalb", "die", "dies", "dieser", "dieses", "doch", "dort", "du", "durch", "ein", "eine", "einem", "einen", "einer", "eines", "er", "es", "euer", "eure", "für", "hatte", "hatten", "hattest", "hattet", "hier", "hinter", "ich", "ihr", "ihre", "im", "in", "ist", "ja", "jede", "jedem", "jeden", "jeder", "jedes", "jener", "jenes", "jetzt", "kann", "kannst", "können", "könnt", "machen", "mein", "meine", "mit", "muß", "mußt", "musst", "müssen", "müßt", "nach", "nachdem", "nein", "nicht", "nun", "oder", "seid", "sein", "seine", "sich", "sie", "sind", "soll", "sollen", "sollst", "sollt", "sonst", "soweit", "sowie", "und", "unser", "unsere", "unter", "vom", "von", "vor", "wann", "warum", "was", "weiter", "weitere", "wenn", "wer", "werde", "werden", "werdet", "weshalb", "wie", "wieder", "wieso", "wir", "wird", "wirst", "wo", "woher", "wohin", "zu", "zum", "zur", "über"]; + +/** + * Stemmer removes word endings and is a kind of "partial normalization". A word ending just matched when the word length is bigger than the matched partial. + * Example: The word "correct" and "correctness" could be the same word, so you can define {"ness": ""} to normalize the ending. + * Object Definition: the key represents the word ending, the value contains the replacement (or empty string for removal). + * @type {Object} + */ + +export const stemmer = { + + niss: "", + isch: "", + lich: "", + heit: "", + keit: "", + ell: "", + bar: "", + end: "", + ung: "", + est: "", + ern: "", + em: "", + er: "", + en: "", + es: "", + st: "", + ig: "", + ik: "", + e: "", + s: "" +}; + +/** + * Matcher replaces all occurrences of a given string regardless of its position and is also a kind of "partial normalization". + * Object Definition: the key represents the target term, the value contains the search string which should be replaced (could also be an array of multiple terms). + * @type {Object|string>} + */ + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module/lang/en.js b/dist/module/lang/en.js index 226d36b..7b1ba3a 100644 --- a/dist/module/lang/en.js +++ b/dist/module/lang/en.js @@ -1 +1,100 @@ -export const filter=["a","about","above","after","again","against","all","also","am","an","and","any","are","aren't","as","at","be","because","been","before","being","below","both","but","by","can","cannot","can't","come","could","couldn't","did","didn't","do","does","doesn't","doing","dont","down","during","each","even","few","first","for","from","further","get","go","had","hadn't","has","hasn't","have","haven't","having","he","hed","her","here","here's","hers","herself","hes","him","himself","his","how","how's","i","id","if","ill","im","in","into","is","isn't","it","it's","itself","i've","just","know","let's","like","make","me","more","most","mustn't","my","myself","new","no","nor","not","now","of","off","on","once","only","or","other","ought","our","our's","ourselves","out","over","own","same","say","see","shan't","she","she'd","shell","shes","should","shouldn't","so","some","such","than","that","that's","the","their","theirs","them","themselves","then","there","there's","these","they","they'd","they'll","they're","they've","this","those","through","time","to","too","until","up","us","very","want","was","wasn't","way","we","wed","well","were","weren't","we've","what","what's","when","when's","where","where's","which","while","who","whom","who's","why","why's","will","with","won't","would","wouldn't","you","you'd","you'll","your","you're","your's","yourself","yourselves","you've"];export const stemmer={ational:"ate",iveness:"ive",fulness:"ful",ousness:"ous",ization:"ize",tional:"tion",biliti:"ble",icate:"ic",ative:"",alize:"al",iciti:"ic",entli:"ent",ousli:"ous",alism:"al",ation:"ate",aliti:"al",iviti:"ive",ement:"",enci:"ence",anci:"ance",izer:"ize",alli:"al",ator:"ate",logi:"log",ical:"ic",ance:"",ence:"",ness:"",able:"",ible:"",ment:"",eli:"e",bli:"ble",ful:"",ant:"",ent:"",ism:"",ate:"",iti:"",ous:"",ive:"",ize:"",al:"",ou:"",er:"",ic:""};export const matcher={};export default{filter:filter,stemmer:stemmer,matcher:matcher}; \ No newline at end of file +/** + * http://www.ranks.nl/stopwords + * @type {Array} + */ + +export const filter = ["a", "about", "above", "after", "again", "against", "all", "also", "am", "an", "and", "any", "are", "aren't", "as", "at", +//"back", +"be", "because", "been", "before", "being", "below", +//"between", +"both", "but", "by", "can", "cannot", "can't", "come", "could", "couldn't", +//"day", +"did", "didn't", "do", "does", "doesn't", "doing", "dont", "down", "during", "each", "even", "few", "first", "for", "from", "further", "get", +//"give", +"go", +//"good", +"had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "hed", +//"hell", +"her", "here", "here's", "hers", "herself", "hes", "him", "himself", "his", "how", "how's", "i", "id", "if", "ill", "im", "in", "into", "is", "isn't", "it", "it's", "itself", "i've", "just", "know", "let's", "like", +//"look", +"make", "me", "more", "most", "mustn't", "my", "myself", "new", "no", "nor", "not", "now", "of", "off", "on", "once", +//"one", +"only", "or", "other", "ought", "our", "our's", "ourselves", "out", "over", "own", +//"people", +"same", "say", "see", "shan't", "she", "she'd", "shell", "shes", "should", "shouldn't", "so", "some", "such", +//"take", +"than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", +//"think", +"this", "those", "through", "time", "to", "too", +//"two", +//"under", +"until", "up", "us", +//"use", +"very", "want", "was", "wasn't", "way", "we", "wed", "well", "were", "weren't", "we've", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "whom", "who's", "why", "why's", "will", "with", "won't", +//"work", +"would", "wouldn't", +//"year", +"you", "you'd", "you'll", "your", "you're", "your's", "yourself", "yourselves", "you've"]; + +/** + * @type {Object} + */ + +export const stemmer = { + + ational: "ate", + iveness: "ive", + fulness: "ful", + ousness: "ous", + ization: "ize", + tional: "tion", + biliti: "ble", + icate: "ic", + ative: "", + alize: "al", + iciti: "ic", + entli: "ent", + ousli: "ous", + alism: "al", + ation: "ate", + aliti: "al", + iviti: "ive", + ement: "", + enci: "ence", + anci: "ance", + izer: "ize", + alli: "al", + ator: "ate", + logi: "log", + ical: "ic", + ance: "", + ence: "", + ness: "", + able: "", + ible: "", + ment: "", + eli: "e", + bli: "ble", + ful: "", + ant: "", + ent: "", + ism: "", + ate: "", + iti: "", + ous: "", + ive: "", + ize: "", + al: "", + ou: "", + er: "", + ic: "" +}; + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module/lang/latin/advanced.js b/dist/module/lang/latin/advanced.js index 5e8778e..94f5cb1 100644 --- a/dist/module/lang/latin/advanced.js +++ b/dist/module/lang/latin/advanced.js @@ -1 +1,89 @@ -import{IndexInterface}from"../../type.js";import{regex,replace,collapse}from"../../lang.js";import{encode as encode_balance}from"./balance.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1,tokenize:""};const regex_ae=regex("ae"),regex_oe=regex("oe"),regex_sh=regex("sh"),regex_th=regex("th"),regex_ph=regex("ph"),regex_pf=regex("pf"),pairs=[regex_ae,"a",regex_oe,"o",regex_sh,"s",regex_th,"t",regex_ph,"f",regex_pf,"f",regex("(?![aeo])h(?![aeo])"),"",regex("(?!^[aeo])h(?!^[aeo])"),""];export function encode(a,b){return a&&(a=encode_balance.call(this,a).join(" "),2 2)*/!this.filter || !this.filter[str])) { + + tmp = str[0]; + let code = soundex[tmp] || tmp, + previous = code; //str[0]; + + //soundex[code] || code; + + for (let i = 1; i < str.length; i++) { + + tmp = str[i]; + const current = soundex[tmp] || tmp; + + if (current && current !== previous) { + + code += current; + previous = current; + + // if(code.length === 7){ + // + // break; + // } + } + } + + result[count++] = code; //(code + "0000").substring(0, 4); + } + } + } + + return result; +} \ No newline at end of file diff --git a/dist/module/lang/latin/default.js b/dist/module/lang/latin/default.js index 3ab62d7..dac5a9c 100644 --- a/dist/module/lang/latin/default.js +++ b/dist/module/lang/latin/default.js @@ -1 +1,23 @@ -import{IndexInterface}from"../../type.js";import{pipeline,normalize,regex_whitespace}from"../../lang.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1,tokenize:""};export function encode(a){return pipeline.call(this,(""+a).toLowerCase(),!1,regex_whitespace,!1)} \ No newline at end of file +import { IndexInterface } from "../../type.js"; +import { pipeline, normalize, regex_whitespace } from "../../lang.js"; + +export const rtl = /* normalize: */ +/* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ +/* normalize: */ +/* collapse: */!1; +export const tokenize = ""; +export default { + encode: encode, + rtl: !1, + tokenize: "" + + /** + * @param {string|number} str + * @this IndexInterface + */ + +};export function encode(str) { + + return pipeline.call(this, + /* string: */("" + str).toLowerCase(), !1, /* split: */regex_whitespace, !1); +} \ No newline at end of file diff --git a/dist/module/lang/latin/extra.js b/dist/module/lang/latin/extra.js index 4ba9176..c55ea6a 100644 --- a/dist/module/lang/latin/extra.js +++ b/dist/module/lang/latin/extra.js @@ -1 +1,65 @@ -import{IndexInterface}from"../../type.js";import{regex,replace,collapse}from"../../lang.js";import{encode as encode_advanced}from"./advanced.js";export const rtl=!1;export const tokenize="";export default{encode:encode,rtl:!1,tokenize:""};const prefix="(?!\\b)",regex_vowel=regex("(?!\\b)[aeo]"),pairs=[regex_vowel,""];export function encode(a){return a&&(a=encode_advanced.call(this,a,!0),1} + */ + +export const filter = ["a", "about", "above", "after", "again", "against", "all", "also", "am", "an", "and", "any", "are", "aren't", "as", "at", +//"back", +"be", "because", "been", "before", "being", "below", +//"between", +"both", "but", "by", "can", "cannot", "can't", "come", "could", "couldn't", +//"day", +"did", "didn't", "do", "does", "doesn't", "doing", "dont", "down", "during", "each", "even", "few", "first", "for", "from", "further", "get", +//"give", +"go", +//"good", +"had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "hed", +//"hell", +"her", "here", "here's", "hers", "herself", "hes", "him", "himself", "his", "how", "how's", "i", "id", "if", "ill", "im", "in", "into", "is", "isn't", "it", "it's", "itself", "i've", "just", "know", "let's", "like", +//"look", +"make", "me", "more", "most", "mustn't", "my", "myself", "new", "no", "nor", "not", "now", "of", "off", "on", "once", +//"one", +"only", "or", "other", "ought", "our", "our's", "ourselves", "out", "over", "own", +//"people", +"same", "say", "see", "shan't", "she", "she'd", "shell", "shes", "should", "shouldn't", "so", "some", "such", +//"take", +"than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", +//"think", +"this", "those", "through", "time", "to", "too", +//"two", +//"under", +"until", "up", "us", +//"use", +"very", "want", "was", "wasn't", "way", "we", "wed", "well", "were", "weren't", "we've", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "whom", "who's", "why", "why's", "will", "with", "won't", +//"work", +"would", "wouldn't", +//"year", +"you", "you'd", "you'll", "your", "you're", "your's", "yourself", "yourselves", "you've"]; + +/** + * @type {Object} + */ + +export const stemmer = { + + ational: "ate", + iveness: "ive", + fulness: "ful", + ousness: "ous", + ization: "ize", + tional: "tion", + biliti: "ble", + icate: "ic", + ative: "", + alize: "al", + iciti: "ic", + entli: "ent", + ousli: "ous", + alism: "al", + ation: "ate", + aliti: "al", + iviti: "ive", + ement: "", + enci: "ence", + anci: "ance", + izer: "ize", + alli: "al", + ator: "ate", + logi: "log", + ical: "ic", + ance: "", + ence: "", + ness: "", + able: "", + ible: "", + ment: "", + eli: "e", + bli: "ble", + ful: "", + ant: "", + ent: "", + ism: "", + ate: "", + iti: "", + ous: "", + ive: "", + ize: "", + al: "", + ou: "", + er: "", + ic: "" +}; + +export const matcher = {}; + +export default { + + filter: filter, + stemmer: stemmer, + matcher: matcher +}; \ No newline at end of file diff --git a/dist/module/polyfill.js b/dist/module/polyfill.js index ad14857..e8c7408 100644 --- a/dist/module/polyfill.js +++ b/dist/module/polyfill.js @@ -1 +1,74 @@ -import{POLYFILL,SUPPORT_ASYNC}from"./config.js";export let promise=Promise;if(POLYFILL&&(Object.assign||(Object.assign=function(){const a=arguments,b=a.length,c=a[0];for(let d,e,f,g=1;g { + on_done = resolve; + }); + } + + let key, data; + + switch (index || (index = 0)) { + + case 0: + + key = "reg"; + + // fastupdate isn't supported by export + + if (this.fastupdate) { + + data = create_object(); + + for (let key in this.register) { + + data[key] = 1; + } + } else { + + data = this.register; + } + + break; + + case 1: + + key = "cfg"; + data = { + doc: 0, + opt: this.optimize ? 1 : 0 + }; + + break; + + case 2: + + key = "map"; + data = this.map; + break; + + case 3: + + key = "ctx"; + data = this.ctx; + break; + + default: + + if ('undefined' == typeof field && on_done) { + + on_done(); + } + + return; + } + + async(callback, self || this, field, key, index_doc, index, data, on_done); + + return return_value; +} + +/** + * @this IndexInterface + */ + +export function importIndex(key, data) { + + if (!data) { + + return; + } + + if (is_string(data)) { + + data = JSON.parse(data); + } + + switch (key) { + + case "cfg": + + this.optimize = !!data.opt; + break; + + case "reg": + + // fastupdate isn't supported by import + + this.fastupdate = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* collapse: */!1; + this.register = data; + break; + + case "map": + + this.map = data; + break; + + case "ctx": + + this.ctx = data; + break; + } +} + +/** + * @this DocumentInterface + */ + +export function exportDocument(callback, self, field, index_doc, index, on_done) { + + let return_value; + if ('undefined' == typeof on_done) { + return_value = new Promise(resolve => { + on_done = resolve; + }); + } + + index || (index = 0); + index_doc || (index_doc = 0); + + if (index_doc < this.field.length) { + const field = this.field[index_doc], + idx = this.index[field]; + + + self = this; + + setTimeout(function () { + + if (!idx.export(callback, self, index ? field /*.replace(":", "-")*/ : "", index_doc, index++, on_done)) { + + index_doc++; + index = 1; + + self.export(callback, self, field, index_doc, index, on_done); + } + }); + } else { + + let key, data; + + switch (index) { + + case 1: + + key = "tag"; + data = this.tagindex; + field = null; + break; + + case 2: + + key = "store"; + data = this.store; + field = null; + break; + + // case 3: + // + // key = "reg"; + // data = this.register; + // break; + + default: + + on_done(); + return; + } + + async(callback, this, field, key, index_doc, index, data, on_done); + } + + return return_value; +} + +/** + * @this DocumentInterface + */ + +export function importDocument(key, data) { + + if (!data) { + + return; + } + + if (is_string(data)) { + + data = JSON.parse(data); + } + + switch (key) { + + case "tag": + + this.tagindex = data; + break; + + case "reg": + + // fastupdate isn't supported by import + + this.fastupdate = !1; + this.register = data; + + for (let i = 0, index; i < this.field.length; i++) { + + index = this.index[this.field[i]]; + index.register = data; + index.fastupdate = !1; + } + + break; + + case "store": + + this.store = data; + break; + + default: + + key = key.split("."); + const field = key[0]; + key = key[1]; + + if (field && key) { + + this.index[field].import(key, data); + } + } +} \ No newline at end of file diff --git a/dist/module/type.js b/dist/module/type.js index 1dc5fab..1a784b3 100644 --- a/dist/module/type.js +++ b/dist/module/type.js @@ -1 +1,69 @@ -export function IndexInterface(){this.cache=null,this.matcher=null,this.stemmer=null,this.filter=null}IndexInterface.prototype.add,IndexInterface.prototype.append,IndexInterface.prototype.search,IndexInterface.prototype.update,IndexInterface.prototype.remove;export function DocumentInterface(){this.field=null,this.index=null} \ No newline at end of file +/** + * @interface + */ + +export function IndexInterface() { + + this.cache = null; + this.matcher = null; + this.stemmer = null; + this.filter = null; +} + +/** + * @param {!string} str + * @param {boolean|Array=} normalize + * @param {boolean|string|RegExp=} split + * @param {boolean=} collapse + * @returns {string|Array} + */ + +//IndexInterface.prototype.pipeline; + +/** + * @param {!number|string} id + * @param {!string} content + */ + +IndexInterface.prototype.add; + +/** + * @param {!number|string} id + * @param {!string} content + */ + +IndexInterface.prototype.append; + +/** + * @param {!string|Object} query + * @param {number|Object=} limit + * @param {Object=} options + * @returns {Array} + */ + +IndexInterface.prototype.search; + +/** + * @param {!number|string} id + * @param {!string} content + */ + +IndexInterface.prototype.update; + +/** + * @param {!number|string} id + */ + +IndexInterface.prototype.remove; + +/** + * @interface + */ + +export function DocumentInterface() { + + this.field = null; + + /** @type IndexInterface */ + this.index = null; +} \ No newline at end of file diff --git a/dist/module/webpack.js b/dist/module/webpack.js deleted file mode 100644 index d34f590..0000000 --- a/dist/module/webpack.js +++ /dev/null @@ -1 +0,0 @@ -import{SUPPORT_ASYNC,SUPPORT_DOCUMENT,SUPPORT_CACHE,SUPPORT_SERIALIZE,SUPPORT_WORKER,SUPPORT_ENCODER}from"./config.js";import Document from"./document.js";import Index from"./index.js";import WorkerIndex from"./worker/index.js";import{registerCharset,registerLanguage}from"./global.js";import charset_default from"./lang/latin/default.js";import charset_simple from"./lang/latin/simple.js";import charset_balance from"./lang/latin/balance.js";import charset_advanced from"./lang/latin/advanced.js";import charset_extra from"./lang/latin/extra.js";Document.prototype.add,Document.prototype.append,Document.prototype.search,Document.prototype.update,Document.prototype.remove,Document.prototype.contain,Document.prototype.get,Document.prototype.set,Index.prototype.add,Index.prototype.append,Index.prototype.search,Index.prototype.update,Index.prototype.remove,Index.prototype.contain,SUPPORT_CACHE&&(Index.prototype.searchCache,Document.prototype.searchCache),SUPPORT_ASYNC&&(Document.prototype.addAsync,Document.prototype.appendAsync,Document.prototype.searchAsync,Document.prototype.updateAsync,Document.prototype.removeAsync,Index.prototype.addAsync,Index.prototype.appendAsync,Index.prototype.searchAsync,Index.prototype.updateAsync,Index.prototype.removeAsync),SUPPORT_SERIALIZE&&(Index.prototype.export,Index.prototype.import,Document.prototype.export,Document.prototype.import),SUPPORT_ENCODER&&(registerCharset("latin:default",charset_default),registerCharset("latin:simple",charset_simple),registerCharset("latin:balance",charset_balance),registerCharset("latin:advanced",charset_advanced),registerCharset("latin:extra",charset_extra));const root=self;let tmp;const FlexSearch={Index:Index,Document:SUPPORT_DOCUMENT?Document:null,Worker:SUPPORT_WORKER?WorkerIndex:null,registerCharset:registerCharset,registerLanguage:registerLanguage};(tmp=root.define)&&tmp.amd?tmp([],function(){return FlexSearch}):root.exports?root.exports=FlexSearch:root.FlexSearch=FlexSearch; \ No newline at end of file diff --git a/dist/module/worker/handler.js b/dist/module/worker/handler.js index 5c8c9f9..914439c 100644 --- a/dist/module/worker/handler.js +++ b/dist/module/worker/handler.js @@ -1 +1,52 @@ -import Index from"../index.js";export default function(a){a=a.data;const b=self._index,c=a.args,d=a.task;switch(d){case"init":const e=a.options||{},f=a.factory,g=e.encode;e.cache=!1,g&&0===g.indexOf("function")&&(e.encode=Function("return "+g)()),f?(Function("return "+f)()(self),self._index=new self.FlexSearch.Index(e),delete self.FlexSearch):self._index=new Index(e);break;default:const h=a.id,i=b[d].apply(b,c);postMessage("search"===d?{id:h,msg:i}:{id:h});}} \ No newline at end of file +import Index from "../index.js"; + +export default function (data) { + + data = data.data; + + /** @type Index */ + const index = self._index, + args = data.args, + task = data.task; + + + switch (task) { + + case "init": + const options = data.options || {}, + factory = data.factory, + encode = options.encode; + + + options.cache = /* normalize: */ /* collapse: */ /* normalize: */ + + /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* collapse: */!1; + + if (encode && 0 === encode.indexOf("function")) { + options.encode = Function("return " + encode)(); + } + + if (factory) { + + // export the FlexSearch global payload to "self" + Function("return " + factory)()(self); + + /** @type Index */ + self._index = new self.FlexSearch.Index(options); + + // destroy the exported payload + delete self.FlexSearch; + } else { + + self._index = new Index(options); + } + + break; + + default: + const id = data.id, + message = index[task].apply(index, args); + + postMessage("search" === task ? { id: id, msg: message } : { id: id }); + } +} \ No newline at end of file diff --git a/dist/module/worker/index.js b/dist/module/worker/index.js index df2a569..7987bfb 100644 --- a/dist/module/worker/index.js +++ b/dist/module/worker/index.js @@ -1 +1,136 @@ -import{create_object,is_function,is_object,is_string}from"../common.js";import handler from"./handler.js";let pid=0;function WorkerIndex(a){if(!(this instanceof WorkerIndex))return new WorkerIndex(a);let b;a?is_function(b=a.encode)&&(a.encode=b.toString()):a={};let c=(self||window)._factory;c&&(c=c.toString());const d="undefined"==typeof window&&self.exports,e=this;this.worker=create(c,d,a.worker),this.resolver=create_object();this.worker&&(d?this.worker.on("message",function(a){e.resolver[a.id](a.msg),delete e.resolver[a.id]}):this.worker.onmessage=function(a){a=a.data,e.resolver[a.id](a.msg),delete e.resolver[a.id]},this.worker.postMessage({task:"init",factory:c,options:a}))}export default WorkerIndex;register("add"),register("append"),register("search"),register("update"),register("remove");function register(a){WorkerIndex.prototype[a]=WorkerIndex.prototype[a+"Async"]=function(){const b=this,c=[].slice.call(arguments),d=c[c.length-1];let e;is_function(d)&&(e=d,c.splice(c.length-1,1));const f=new Promise(function(d){setTimeout(function(){b.resolver[++pid]=d,b.worker.postMessage({task:a,id:pid,args:c})})});return e?(f.then(e),this):f}}function create(factory,is_node_js,worker_path){let worker;try{worker=is_node_js?eval("new (require(\"worker_threads\")[\"Worker\"])(\"../dist/node/node.js\")"):factory?new Worker(URL.createObjectURL(new Blob(["onmessage="+handler.toString()],{type:"text/javascript"}))):new Worker(is_string(worker_path)?worker_path:"worker/worker.js",{type:"module"})}catch(a){}return worker} \ No newline at end of file +//import { promise as Promise } from "../polyfill.js"; +import { create_object, is_function, is_object, is_string } from "../common.js"; +import handler from "./handler.js"; + +let pid = 0; + +/** + * @param {Object=} options + * @constructor + */ + +function WorkerIndex(options) { + + if (!(this instanceof WorkerIndex)) { + + return new WorkerIndex(options); + } + + let opt; + + if (options) { + + if (is_function(opt = options.encode)) { + + options.encode = opt.toString(); + } + } else { + + options = {}; + } + + // the factory is the outer wrapper from the build + // we use "self" as a trap for node.js + + let factory = (self || window)._factory; + + if (factory) { + + factory = factory.toString(); + } + + const is_node_js = "undefined" == typeof window && self.exports, + _self = this; + + this.worker = create(factory, is_node_js, options.worker); + this.resolver = create_object(); + + if (!this.worker) { + + return; + } + + if (is_node_js) { + + this.worker.on("message", function (msg) { + + _self.resolver[msg.id](msg.msg); + delete _self.resolver[msg.id]; + }); + } else { + + this.worker.onmessage = function (msg) { + + msg = msg.data; + _self.resolver[msg.id](msg.msg); + delete _self.resolver[msg.id]; + }; + } + + this.worker.postMessage({ + + task: "init", + factory: factory, + options: options + }); +} + +export default WorkerIndex; + +register("add"); +register("append"); +register("search"); +register("update"); +register("remove"); + +function register(key) { + + WorkerIndex.prototype[key] = WorkerIndex.prototype[key + "Async"] = function () { + const self = this, + args = [].slice.call(arguments), + arg = args[args.length - 1]; + + let callback; + + if (is_function(arg)) { + + callback = arg; + args.splice(args.length - 1, 1); + } + + const promise = new Promise(function (resolve) { + + setTimeout(function () { + + self.resolver[++pid] = resolve; + self.worker.postMessage({ + + task: key, + id: pid, + args: args + }); + }); + }); + + if (callback) { + + promise.then(callback); + return this; + } else { + + return promise; + } + }; +} + +function create(factory, is_node_js, worker_path) { + + let worker; + + try { + + worker = is_node_js ? eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")') : factory ? new Worker(URL.createObjectURL(new Blob(["onmessage=" + handler.toString()], { type: "text/javascript" }))) : new Worker(is_string(worker_path) ? worker_path : "worker/worker.js", { type: "module" }); + } catch (e) {} + + return worker; +} \ No newline at end of file diff --git a/dist/module/worker/node.js b/dist/module/worker/node.js index 13df942..5326018 100644 --- a/dist/module/worker/node.js +++ b/dist/module/worker/node.js @@ -1 +1,36 @@ -const{parentPort}=require("worker_threads"),{Index}=require("../flexsearch.bundle.js");let index;parentPort.on("message",function(a){const b=a.args,c=a.task,d=a.id;switch(c){case"init":const e=a.options||{},f=e.encode;e.cache=!1,f&&0===f.indexOf("function")&&(e.encode=new Function("return "+f)()),index=new Index(e);break;default:const g=index[c].apply(index,b);parentPort.postMessage("search"===c?{id:d,msg:g}:{id:d});}}); \ No newline at end of file +const { parentPort } = require("worker_threads"), + { Index } = require("../flexsearch.bundle.min.js"); + +let index; + +parentPort.on("message", function (data) { + + /** @type Index */ + const args = data.args, + task = data.task, + id = data.id; + + + switch (task) { + + case "init": + const options = data.options || {}, + encode = options.encode; + + + options.cache = /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* normalize: */ /* collapse: */ /* collapse: */!1; + + if (encode && 0 === encode.indexOf("function")) { + + options.encode = new Function("return " + encode)(); + } + + index = new Index(options); + break; + + default: + + const message = index[task].apply(index, args); + parentPort.postMessage("search" === task ? { id: id, msg: message } : { id: id }); + } +}); \ No newline at end of file diff --git a/dist/module/worker/worker.js b/dist/module/worker/worker.js index 2abc20b..7d295f2 100644 --- a/dist/module/worker/worker.js +++ b/dist/module/worker/worker.js @@ -1 +1,2 @@ -import handler from"./handler.js";onmessage=handler; \ No newline at end of file +import handler from "./handler.js"; +onmessage = handler; \ No newline at end of file diff --git a/dist/node/node.js b/dist/node/node.js index 4e1a20b..8a8a468 100644 --- a/dist/node/node.js +++ b/dist/node/node.js @@ -1,5 +1,5 @@ const { parentPort } = require("worker_threads"); -const { Index } = require("../flexsearch.bundle.js"); +const { Index } = require("../flexsearch.bundle.min.js"); let index; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..4190a04 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5752 @@ +{ + "name": "flexsearch", + "version": "0.7.39", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "flexsearch", + "version": "0.7.39", + "license": "Apache-2.0", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-plugin-conditional-compile": "^0.0.5", + "babel-plugin-minify-constant-folding": "^0.5.0", + "babel-plugin-minify-dead-code-elimination": "^0.5.2", + "babel-plugin-minify-flip-comparisons": "^0.4.3", + "babel-plugin-minify-guarded-expressions": "^0.4.4", + "babel-plugin-minify-infinity": "^0.4.3", + "babel-plugin-minify-mangle-names": "^0.5.1", + "babel-plugin-minify-replace": "^0.5.0", + "babel-plugin-minify-simplify": "^0.5.1", + "babel-plugin-minify-type-constructors": "^0.4.3", + "babel-plugin-transform-member-expression-literals": "^6.9.4", + "babel-plugin-transform-merge-sibling-variables": "^6.9.5", + "babel-plugin-transform-minify-booleans": "^6.9.4", + "babel-plugin-transform-property-literals": "^6.9.4", + "babel-plugin-transform-simplify-comparison-operators": "^6.9.4", + "babel-plugin-transform-undefined-to-void": "^6.9.4", + "google-closure-compiler": "^20230802.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "optional": true, + "dependencies": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "node_modules/anymatch/node_modules/arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "optional": true, + "dependencies": { + "arr-flatten": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch/node_modules/array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch/node_modules/braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "optional": true, + "dependencies": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch/node_modules/expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "optional": true, + "dependencies": { + "is-posix-bracket": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch/node_modules/extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "optional": true, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch/node_modules/micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "optional": true, + "dependencies": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true, + "optional": true + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "optional": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "dev": true, + "dependencies": { + "babel-core": "^6.26.0", + "babel-polyfill": "^6.26.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "commander": "^2.11.0", + "convert-source-map": "^1.5.0", + "fs-readdir-recursive": "^1.0.0", + "glob": "^7.1.2", + "lodash": "^4.17.4", + "output-file-sync": "^1.1.2", + "path-is-absolute": "^1.0.1", + "slash": "^1.0.0", + "source-map": "^0.5.6", + "v8flags": "^2.1.1" + }, + "bin": { + "babel": "bin/babel.js", + "babel-doctor": "bin/babel-doctor.js", + "babel-external-helpers": "bin/babel-external-helpers.js", + "babel-node": "bin/babel-node.js" + }, + "optionalDependencies": { + "chokidar": "^1.6.1" + } + }, + "node_modules/babel-cli/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/babel-cli/node_modules/slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "dependencies": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "node_modules/babel-code-frame/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "node_modules/babel-code-frame/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "dependencies": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + } + }, + "node_modules/babel-core/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/babel-core/node_modules/json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/babel-core/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/babel-core/node_modules/slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "dependencies": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + } + }, + "node_modules/babel-generator/node_modules/jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/babel-helper-evaluate-path": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", + "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", + "dev": true + }, + "node_modules/babel-helper-flip-expressions": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz", + "integrity": "sha1-NpZzahKKwYvCUlS19AoizrPB0/0=", + "dev": true + }, + "node_modules/babel-helper-is-nodes-equiv": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", + "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", + "dev": true + }, + "node_modules/babel-helper-is-void-0": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz", + "integrity": "sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=", + "dev": true + }, + "node_modules/babel-helper-mark-eval-scopes": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", + "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", + "dev": true + }, + "node_modules/babel-helper-remove-or-void": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", + "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", + "dev": true + }, + "node_modules/babel-helper-to-multiple-sequence-expressions": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz", + "integrity": "sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==", + "dev": true + }, + "node_modules/babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "node_modules/babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-conditional-compile": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/babel-plugin-conditional-compile/-/babel-plugin-conditional-compile-0.0.5.tgz", + "integrity": "sha512-K9t3XHwlLiPvpxGweJd8ZGX61UyEEgmaVvmaFh6zcsgqtOgRRo2h8JwTfjYwWpVXObZXo1eDquRogUyn5+VztQ==", + "dev": true + }, + "node_modules/babel-plugin-minify-constant-folding": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz", + "integrity": "sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "node_modules/babel-plugin-minify-dead-code-elimination": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.2.tgz", + "integrity": "sha512-krq9Lwi0QIzyAlcNBXTL4usqUvevB4BzktdEsb8srcXC1AaYqRJiAQw6vdKdJSaXbz6snBvziGr6ch/aoRCfpA==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-mark-eval-scopes": "^0.4.3", + "babel-helper-remove-or-void": "^0.4.3", + "lodash": "^4.17.11" + } + }, + "node_modules/babel-plugin-minify-flip-comparisons": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz", + "integrity": "sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=", + "dev": true, + "dependencies": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-guarded-expressions": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz", + "integrity": "sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-infinity": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz", + "integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=", + "dev": true + }, + "node_modules/babel-plugin-minify-mangle-names": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.1.tgz", + "integrity": "sha512-8KMichAOae2FHlipjNDTo2wz97MdEb2Q0jrn4NIRXzHH7SJ3c5TaNNBkeTHbk9WUsMnqpNUx949ugM9NFWewzw==", + "dev": true, + "dependencies": { + "babel-helper-mark-eval-scopes": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-replace": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz", + "integrity": "sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==", + "dev": true + }, + "node_modules/babel-plugin-minify-simplify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz", + "integrity": "sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3", + "babel-helper-is-nodes-equiv": "^0.0.1", + "babel-helper-to-multiple-sequence-expressions": "^0.5.0" + } + }, + "node_modules/babel-plugin-minify-type-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz", + "integrity": "sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=", + "dev": true, + "dependencies": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "node_modules/babel-plugin-transform-member-expression-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", + "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", + "dev": true + }, + "node_modules/babel-plugin-transform-merge-sibling-variables": { + "version": "6.9.5", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.5.tgz", + "integrity": "sha512-xj/KrWi6/uP+DrD844h66Qh2cZN++iugEIgH8QcIxhmZZPNP6VpOE9b4gP2FFW39xDAY43kCmYMM6U0QNKN8fw==", + "dev": true + }, + "node_modules/babel-plugin-transform-minify-booleans": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", + "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", + "dev": true + }, + "node_modules/babel-plugin-transform-property-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", + "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + } + }, + "node_modules/babel-plugin-transform-simplify-comparison-operators": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", + "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", + "dev": true + }, + "node_modules/babel-plugin-transform-undefined-to-void": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", + "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", + "dev": true + }, + "node_modules/babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + } + }, + "node_modules/babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "dependencies": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "node_modules/babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "dependencies": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-traverse/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/babel-traverse/node_modules/globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-traverse/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "node_modules/babel-types/node_modules/to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true, + "bin": { + "babylon": "bin/babylon.js" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "optional": true, + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "optional": true, + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", + "dev": true, + "optional": true, + "dependencies": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + }, + "optionalDependencies": { + "fsevents": "^1.0.0" + } + }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "optional": true, + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "node_modules/cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "optional": true, + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true, + "optional": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "dependencies": { + "repeating": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "optional": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "node_modules/expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "optional": true, + "dependencies": { + "fill-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-range/node_modules/fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "optional": true, + "dependencies": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-range/node_modules/is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-range/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "optional": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "node_modules/filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "optional": true, + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "optional": true, + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "node_modules/glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "optional": true, + "dependencies": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "optional": true, + "dependencies": { + "is-glob": "^2.0.0" + } + }, + "node_modules/google-closure-compiler": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20230802.0.0.tgz", + "integrity": "sha512-o2fYoc8lqOBdhm95Ick0vWrtwH2Icd5yLZhbTcQ0T7NfGiBepYvx1BB63hR8ebgzEZemz9Fh+O6Kg/3Mjm28ww==", + "dev": true, + "dependencies": { + "chalk": "4.x", + "google-closure-compiler-java": "^20230802.0.0", + "minimist": "1.x", + "vinyl": "2.x", + "vinyl-sourcemaps-apply": "^0.2.0" + }, + "bin": { + "google-closure-compiler": "cli.js" + }, + "engines": { + "node": ">=10" + }, + "optionalDependencies": { + "google-closure-compiler-linux": "^20230802.0.0", + "google-closure-compiler-osx": "^20230802.0.0", + "google-closure-compiler-windows": "^20230802.0.0" + } + }, + "node_modules/google-closure-compiler-java": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20230802.0.0.tgz", + "integrity": "sha512-PWKLMLwj7pR/U0yYbiy649LLqAscu+F1gyY4Y/jK6CmSLb8cIJbL8BTJd00828TzTNfWnYwxbkcQw0y9C2YsGw==", + "dev": true + }, + "node_modules/google-closure-compiler-linux": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20230802.0.0.tgz", + "integrity": "sha512-F13U4iSXiWeGtHOFS25LVem1s6zI+pJvXVPVR7zSib5ppoUJ0JXnABJQezUR3FnpxmnkALG4oIGW0syH9zPLZA==", + "cpu": [ + "x32", + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/google-closure-compiler-osx": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-osx/-/google-closure-compiler-osx-20230802.0.0.tgz", + "integrity": "sha512-ANAi/ux92Tt+Na7vFDLeK2hRzotjC5j+nxoPtE0OcuNcbjji5dREKoJxkq7r0YwRTCzAFZszK5ip/NPdTOdCEg==", + "cpu": [ + "x32", + "x64", + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/google-closure-compiler-windows": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-windows/-/google-closure-compiler-windows-20230802.0.0.tgz", + "integrity": "sha512-ZQPujoNiiUyTGl8zEGR/0yAygWnbMtX/NQ/S/EHVgq5nmYkvDEVuiVbgpPAmO9lzBTq0hvUTRRATZbTU2ISxgA==", + "cpu": [ + "x32", + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "optional": true, + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "optional": true, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "optional": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "optional": true + }, + "node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "optional": true, + "dependencies": { + "is-primitive": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "optional": true, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "optional": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "optional": true, + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true, + "optional": true + }, + "node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/micromatch/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "optional": true, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mixin-deep/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "optional": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "optional": true, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "optional": true, + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "optional": true, + "dependencies": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "optional": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.4", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.0" + } + }, + "node_modules/parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "optional": true, + "dependencies": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "node_modules/randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "optional": true, + "dependencies": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/randomatic/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/randomatic/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", + "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + }, + "node_modules/regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "optional": true, + "dependencies": { + "is-equal-shallow": "^0.1.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "optional": true, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regex-not/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regex-not/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "dependencies": { + "is-finite": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true, + "optional": true + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "optional": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "optional": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "optional": true, + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "optional": true, + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "optional": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "dependencies": { + "source-map": "^0.5.6" + } + }, + "node_modules/source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "dev": true, + "optional": true + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "optional": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "optional": true, + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "optional": true, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "optional": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "optional": true, + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "optional": true, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true, + "optional": true + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true, + "bin": { + "user-home": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "dependencies": { + "user-home": "^1.1.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "dependencies": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "dependencies": { + "source-map": "^0.5.1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true, + "optional": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "optional": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "optional": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + } + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "optional": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "optional": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "optional": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "optional": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "optional": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true, + "optional": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "optional": true + }, + "babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-polyfill": "^6.26.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "chokidar": "^1.6.1", + "commander": "^2.11.0", + "convert-source-map": "^1.5.0", + "fs-readdir-recursive": "^1.0.0", + "glob": "^7.1.2", + "lodash": "^4.17.4", + "output-file-sync": "^1.1.2", + "path-is-absolute": "^1.0.1", + "slash": "^1.0.0", + "source-map": "^0.5.6", + "v8flags": "^2.1.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + } + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-helper-evaluate-path": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", + "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", + "dev": true + }, + "babel-helper-flip-expressions": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz", + "integrity": "sha1-NpZzahKKwYvCUlS19AoizrPB0/0=", + "dev": true + }, + "babel-helper-is-nodes-equiv": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", + "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", + "dev": true + }, + "babel-helper-is-void-0": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz", + "integrity": "sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=", + "dev": true + }, + "babel-helper-mark-eval-scopes": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", + "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", + "dev": true + }, + "babel-helper-remove-or-void": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", + "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", + "dev": true + }, + "babel-helper-to-multiple-sequence-expressions": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz", + "integrity": "sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==", + "dev": true + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-conditional-compile": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/babel-plugin-conditional-compile/-/babel-plugin-conditional-compile-0.0.5.tgz", + "integrity": "sha512-K9t3XHwlLiPvpxGweJd8ZGX61UyEEgmaVvmaFh6zcsgqtOgRRo2h8JwTfjYwWpVXObZXo1eDquRogUyn5+VztQ==", + "dev": true + }, + "babel-plugin-minify-constant-folding": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz", + "integrity": "sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "babel-plugin-minify-dead-code-elimination": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.2.tgz", + "integrity": "sha512-krq9Lwi0QIzyAlcNBXTL4usqUvevB4BzktdEsb8srcXC1AaYqRJiAQw6vdKdJSaXbz6snBvziGr6ch/aoRCfpA==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-mark-eval-scopes": "^0.4.3", + "babel-helper-remove-or-void": "^0.4.3", + "lodash": "^4.17.11" + } + }, + "babel-plugin-minify-flip-comparisons": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz", + "integrity": "sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=", + "dev": true, + "requires": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "babel-plugin-minify-guarded-expressions": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz", + "integrity": "sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3" + } + }, + "babel-plugin-minify-infinity": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz", + "integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=", + "dev": true + }, + "babel-plugin-minify-mangle-names": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.1.tgz", + "integrity": "sha512-8KMichAOae2FHlipjNDTo2wz97MdEb2Q0jrn4NIRXzHH7SJ3c5TaNNBkeTHbk9WUsMnqpNUx949ugM9NFWewzw==", + "dev": true, + "requires": { + "babel-helper-mark-eval-scopes": "^0.4.3" + } + }, + "babel-plugin-minify-replace": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz", + "integrity": "sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==", + "dev": true + }, + "babel-plugin-minify-simplify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz", + "integrity": "sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3", + "babel-helper-is-nodes-equiv": "^0.0.1", + "babel-helper-to-multiple-sequence-expressions": "^0.5.0" + } + }, + "babel-plugin-minify-type-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz", + "integrity": "sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=", + "dev": true, + "requires": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "babel-plugin-transform-member-expression-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", + "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", + "dev": true + }, + "babel-plugin-transform-merge-sibling-variables": { + "version": "6.9.5", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.5.tgz", + "integrity": "sha512-xj/KrWi6/uP+DrD844h66Qh2cZN++iugEIgH8QcIxhmZZPNP6VpOE9b4gP2FFW39xDAY43kCmYMM6U0QNKN8fw==", + "dev": true + }, + "babel-plugin-transform-minify-booleans": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", + "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", + "dev": true + }, + "babel-plugin-transform-property-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", + "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "babel-plugin-transform-simplify-comparison-operators": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", + "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", + "dev": true + }, + "babel-plugin-transform-undefined-to-void": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", + "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", + "dev": true + }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + }, + "dependencies": { + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + } + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "optional": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "optional": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + } + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "optional": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "optional": true + }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "optional": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "optional": true, + "requires": { + "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "optional": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "optional": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "optional": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "optional": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "optional": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "optional": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "optional": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "google-closure-compiler": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20230802.0.0.tgz", + "integrity": "sha512-o2fYoc8lqOBdhm95Ick0vWrtwH2Icd5yLZhbTcQ0T7NfGiBepYvx1BB63hR8ebgzEZemz9Fh+O6Kg/3Mjm28ww==", + "dev": true, + "requires": { + "chalk": "4.x", + "google-closure-compiler-java": "^20230802.0.0", + "google-closure-compiler-linux": "^20230802.0.0", + "google-closure-compiler-osx": "^20230802.0.0", + "google-closure-compiler-windows": "^20230802.0.0", + "minimist": "1.x", + "vinyl": "2.x", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, + "google-closure-compiler-java": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20230802.0.0.tgz", + "integrity": "sha512-PWKLMLwj7pR/U0yYbiy649LLqAscu+F1gyY4Y/jK6CmSLb8cIJbL8BTJd00828TzTNfWnYwxbkcQw0y9C2YsGw==", + "dev": true + }, + "google-closure-compiler-linux": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20230802.0.0.tgz", + "integrity": "sha512-F13U4iSXiWeGtHOFS25LVem1s6zI+pJvXVPVR7zSib5ppoUJ0JXnABJQezUR3FnpxmnkALG4oIGW0syH9zPLZA==", + "dev": true, + "optional": true + }, + "google-closure-compiler-osx": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-osx/-/google-closure-compiler-osx-20230802.0.0.tgz", + "integrity": "sha512-ANAi/ux92Tt+Na7vFDLeK2hRzotjC5j+nxoPtE0OcuNcbjji5dREKoJxkq7r0YwRTCzAFZszK5ip/NPdTOdCEg==", + "dev": true, + "optional": true + }, + "google-closure-compiler-windows": { + "version": "20230802.0.0", + "resolved": "https://registry.npmjs.org/google-closure-compiler-windows/-/google-closure-compiler-windows-20230802.0.0.tgz", + "integrity": "sha512-ZQPujoNiiUyTGl8zEGR/0yAygWnbMtX/NQ/S/EHVgq5nmYkvDEVuiVbgpPAmO9lzBTq0hvUTRRATZbTU2ISxgA==", + "dev": true, + "optional": true + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + }, + "dependencies": { + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "optional": true + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + }, + "dependencies": { + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + } + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true, + "optional": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "optional": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "optional": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true, + "optional": true + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true, + "optional": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true, + "optional": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "optional": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "optional": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "optional": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true, + "optional": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + } + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "optional": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + } + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "optional": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "optional": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.4", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.0" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "optional": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "optional": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "optional": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true, + "optional": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "optional": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "optional": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", + "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "optional": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "dev": true, + "optional": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "optional": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true, + "optional": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "optional": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "optional": true, + "requires": { + "ret": "~0.1.10" + } + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "optional": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "optional": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + }, + "source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "dev": true, + "optional": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "optional": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + } + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "optional": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "optional": true + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true, + "optional": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "optional": true + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "requires": { + "user-home": "^1.1.1" + } + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "^0.5.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 074dfc8..850050b 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,14 @@ { + "public": true, + "preferGlobal": false, "name": "flexsearch", - "version": "0.7.34", + "version": "0.7.39", "description": "Next-Generation full text search library with zero dependencies.", "homepage": "https://github.com/nextapps-de/flexsearch/", "author": "Thomas Wilkerling", "copyright": "Nextapps GmbH", "license": "Apache-2.0", + "readme": "README.md", "keywords": [ "fulltext search", "elastic search", @@ -16,34 +19,43 @@ "fuzzy match", "search engine" ], - "bugs": { - "url": "https://github.com/nextapps-de/flexsearch/issues", - "email": "info@nextapps.de" - }, - "main": "dist/flexsearch.bundle.js", - "browser": "dist/flexsearch.bundle.js", - "module": "dist/module/index.js", - "preferGlobal": false, "repository": { "type": "git", "url": "https://github.com/nextapps-de/flexsearch.git" }, + "bugs": { + "url": "https://github.com/nextapps-de/flexsearch/issues", + "email": "info@nextapps.de" + }, + "main": "dist/flexsearch.bundle.min.js", + "module": "dist/flexsearch.bundle.module.min.js", + "browser": { + "dist/flexsearch.bundle.min.js": "dist/flexsearch.bundle.min.js", + "dist/flexsearch.bundle.module.min.js": "dist/flexsearch.bundle.module.min.js" + }, "scripts": { - "copy": "npm run clean && cpx \"src/**\" tmp/", - "clean": "npx shx rm -rf tmp && mkdir tmp", "build": "npm run copy && npm run build:bundle", - "build:bundle": "node task/build RELEASE=bundle && cpx \"src/worker/node.js\" dist/node/", - "build:debug": "node task/build RELEASE=debug COMPILATION_LEVEL=SIMPLE FORMATTING=PRETTY_PRINT", - "build:compact": "node task/build RELEASE=compact", - "build:light": "node task/build RELEASE=light", + "build:bundle": "node task/build RELEASE=bundle DEBUG=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false", + "build:bundle:debug": "node task/build RELEASE=bundle DEBUG=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false FORMATTING=PRETTY_PRINT", + "build:compact": "node task/build RELEASE=compact DEBUG=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=false SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=true POLYFILL=false", + "build:compact:debug": "node task/build RELEASE=compact DEBUG=true SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=false SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=true POLYFILL=false FORMATTING=PRETTY_PRINT", + "build:light": "node task/build RELEASE=light DEBUG=false SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false", + "build:light:debug": "node task/build RELEASE=light DEBUG=true SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false FORMATTING=PRETTY_PRINT", "build:custom": "node task/build RELEASE=custom", - "build:es5": "node task/build RELEASE=es5 LANGUAGE_OUT=ECMASCRIPT5_STRICT POLYFILL=true", - "build:pre": "node task/build RELEASE=pre COMPILATION_LEVEL=WHITESPACE FORMATTING=PRETTY_PRINT", + "build:es5": "node task/build RELEASE=es5 DEBUG=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true LANGUAGE_OUT=ECMASCRIPT5_STRICT POLYFILL=true", + "build:es5:debug": "node task/build RELEASE=es5 DEBUG=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true LANGUAGE_OUT=ECMASCRIPT5_STRICT POLYFILL=true FORMATTING=PRETTY_PRINT", "build:lang": "node task/build RELEASE=lang", - "build:module": "npx babel src -d dist/module && exit 0", - "build:all": "npm run build && npm run build:light && npm run build:compact && npm run build:es5 && npm run build:debug && npm run build:module", - "test": "cd test && npm install && npm run test", - "server": "node task/server" + "build:module": "node task/babel && exit 0", + "build:module:debug": "node task/babel DEBUG=true && exit 0", + "build:module:min": "node task/babel RELEASE=min && exit 0", + "build:module:bundle": "node task/build RELEASE=bundle.module DEBUG=false SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false", + "build:module:bundle:debug": "node task/build RELEASE=bundle.module DEBUG=true SUPPORT_WORKER=true SUPPORT_ENCODER=true SUPPORT_CACHE=true SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=true SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=true SUPPORT_DOCUMENT=true POLYFILL=false FORMATTING=PRETTY_PRINT", + "build:module:compact": "node task/build RELEASE=compact.module DEBUG=false SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=false SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=true POLYFILL=false", + "build:module:compact:debug": "node task/build RELEASE=compact.module DEBUG=true SUPPORT_WORKER=false SUPPORT_ENCODER=true SUPPORT_CACHE=false SUPPORT_ASYNC=true SUPPORT_STORE=true SUPPORT_TAGS=false SUPPORT_SUGGESTION=true SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=true POLYFILL=false FORMATTING=PRETTY_PRINT", + "build:module:light": "node task/build RELEASE=light.module DEBUG=false SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false", + "build:module:light:debug": "node task/build RELEASE=light.module DEBUG=true SUPPORT_WORKER=false SUPPORT_ENCODER=false SUPPORT_CACHE=false SUPPORT_ASYNC=false SUPPORT_STORE=false SUPPORT_TAGS=false SUPPORT_SUGGESTION=false SUPPORT_SERIALIZE=false SUPPORT_DOCUMENT=false POLYFILL=false FORMATTING=PRETTY_PRINT", + "build:all": "npm version --no-git-tag-version patch && npm run build:bundle && npm run build:bundle:debug && npm run build:light && npm run build:light:debug && npm run build:compact && npm run build:compact:debug && npm run build:es5 && npm run build:es5:debug && npm run build:module && npm run build:module:debug && npm run build:module:min && npm run build:module:bundle && npm run build:module:bundle:debug && npm run build:module:light && npm run build:module:light:debug && npm run build:module:compact && npm run build:module:compact:debug", + "test": "cd test && npm install && npm run test" }, "files": [ "dist/**", @@ -53,27 +65,24 @@ "CHANGELOG.md", "LICENSE" ], - "readme": "README.md", "devDependencies": { "babel-cli": "^6.26.0", + "babel-plugin-conditional-compile": "^0.0.5", "babel-plugin-minify-constant-folding": "^0.5.0", - "babel-plugin-minify-dead-code-elimination": "^0.5.1", + "babel-plugin-minify-dead-code-elimination": "^0.5.2", "babel-plugin-minify-flip-comparisons": "^0.4.3", "babel-plugin-minify-guarded-expressions": "^0.4.4", "babel-plugin-minify-infinity": "^0.4.3", - "babel-plugin-minify-mangle-names": "^0.5.0", + "babel-plugin-minify-mangle-names": "^0.5.1", "babel-plugin-minify-replace": "^0.5.0", "babel-plugin-minify-simplify": "^0.5.1", "babel-plugin-minify-type-constructors": "^0.4.3", "babel-plugin-transform-member-expression-literals": "^6.9.4", - "babel-plugin-transform-merge-sibling-variables": "^6.9.4", + "babel-plugin-transform-merge-sibling-variables": "^6.9.5", "babel-plugin-transform-minify-booleans": "^6.9.4", "babel-plugin-transform-property-literals": "^6.9.4", "babel-plugin-transform-simplify-comparison-operators": "^6.9.4", "babel-plugin-transform-undefined-to-void": "^6.9.4", - "cpx": "^1.5.0", - "google-closure-compiler": "^20220905.0.0", - "shx": "^0.3.3", - "web-servo": "^0.5.1" + "google-closure-compiler": "^20230802.0.0" } } diff --git a/src/config/bundle/config.js b/src/config/bundle/config.js deleted file mode 100644 index 49c23f2..0000000 --- a/src/config/bundle/config.js +++ /dev/null @@ -1,32 +0,0 @@ -/** @define {boolean} */ -export const DEBUG = false; - -/** @define {boolean} */ -export const POLYFILL = false; - -/** @define {boolean} */ -export const SUPPORT_WORKER = true; - -/** @define {boolean|string} */ -export const SUPPORT_ENCODER = true; - -/** @define {boolean} */ -export const SUPPORT_CACHE = true; - -/** @define {boolean} */ -export const SUPPORT_ASYNC = true; - -/** @define {boolean} */ -export const SUPPORT_STORE = true; - -/** @define {boolean} */ -export const SUPPORT_TAGS = true; - -/** @define {boolean} */ -export const SUPPORT_SUGGESTION = true; - -/** @define {boolean} */ -export const SUPPORT_SERIALIZE = true; - -/** @define {boolean} */ -export const SUPPORT_DOCUMENT = true; diff --git a/src/config/compact/config.js b/src/config/compact/config.js deleted file mode 100644 index 34361cc..0000000 --- a/src/config/compact/config.js +++ /dev/null @@ -1,32 +0,0 @@ -/** @define {boolean} */ -export const DEBUG = false; - -/** @define {boolean} */ -export const POLYFILL = false; - -/** @define {boolean} */ -export const SUPPORT_WORKER = false; - -/** @define {boolean|string} */ -export const SUPPORT_ENCODER = true; - -/** @define {boolean} */ -export const SUPPORT_CACHE = false; - -/** @define {boolean} */ -export const SUPPORT_ASYNC = true; - -/** @define {boolean} */ -export const SUPPORT_STORE = true; - -/** @define {boolean} */ -export const SUPPORT_TAGS = false; - -/** @define {boolean} */ -export const SUPPORT_SUGGESTION = true; - -/** @define {boolean} */ -export const SUPPORT_SERIALIZE = false; - -/** @define {boolean} */ -export const SUPPORT_DOCUMENT = true; diff --git a/src/config/debug/config.js b/src/config/debug/config.js deleted file mode 100644 index 80dd0ed..0000000 --- a/src/config/debug/config.js +++ /dev/null @@ -1,32 +0,0 @@ -/** @define {boolean} */ -export const DEBUG = true; - -/** @define {boolean} */ -export const POLYFILL = false; - -/** @define {boolean} */ -export const SUPPORT_WORKER = true; - -/** @define {boolean|string} */ -export const SUPPORT_ENCODER = true; - -/** @define {boolean} */ -export const SUPPORT_CACHE = true; - -/** @define {boolean} */ -export const SUPPORT_ASYNC = true; - -/** @define {boolean} */ -export const SUPPORT_STORE = true; - -/** @define {boolean} */ -export const SUPPORT_TAGS = true; - -/** @define {boolean} */ -export const SUPPORT_SUGGESTION = true; - -/** @define {boolean} */ -export const SUPPORT_SERIALIZE = true; - -/** @define {boolean} */ -export const SUPPORT_DOCUMENT = true; diff --git a/src/config/light/config.js b/src/config/light/config.js deleted file mode 100644 index 456f782..0000000 --- a/src/config/light/config.js +++ /dev/null @@ -1,32 +0,0 @@ -/** @define {boolean} */ -export const DEBUG = false; - -/** @define {boolean} */ -export const POLYFILL = false; - -/** @define {boolean} */ -export const SUPPORT_WORKER = false; - -/** @define {boolean|string} */ -export const SUPPORT_ENCODER = false; - -/** @define {boolean} */ -export const SUPPORT_CACHE = false; - -/** @define {boolean} */ -export const SUPPORT_ASYNC = false; - -/** @define {boolean} */ -export const SUPPORT_STORE = false; - -/** @define {boolean} */ -export const SUPPORT_TAGS = false; - -/** @define {boolean} */ -export const SUPPORT_SUGGESTION = false; - -/** @define {boolean} */ -export const SUPPORT_SERIALIZE = false; - -/** @define {boolean} */ -export const SUPPORT_DOCUMENT = false; diff --git a/src/document.js b/src/document.js index d114d5d..9bb16c8 100644 --- a/src/document.js +++ b/src/document.js @@ -6,6 +6,7 @@ * https://github.com/nextapps-de/flexsearch */ +// COMPILER BLOCK --> import { SUPPORT_ASYNC, @@ -16,6 +17,7 @@ import { SUPPORT_WORKER } from "./config.js"; +// <-- COMPILER BLOCK import Index from "./index.js"; import { DocumentInterface } from "./type.js"; @@ -28,7 +30,7 @@ import WorkerIndex from "./worker/index.js"; /** * @constructor - * @implements DocumentInterface + * @implements {DocumentInterface} * @param {Object=} options * @return {Document} */ diff --git a/src/engine.js b/src/engine.js index 57da76b..0e3b0a8 100644 --- a/src/engine.js +++ b/src/engine.js @@ -1,4 +1,6 @@ +// COMPILER BLOCK --> import { DEBUG, SUPPORT_ASYNC, SUPPORT_CACHE } from "./config"; +// <-- COMPILER BLOCK import { searchCache } from "./cache"; /** diff --git a/src/index.js b/src/index.js index 09e09f3..49fcdad 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ * https://github.com/nextapps-de/flexsearch */ +// COMPILER BLOCK --> import { SUPPORT_ENCODER, @@ -15,6 +16,7 @@ import { SUPPORT_SERIALIZE } from "./config.js"; +// <-- COMPILER BLOCK import { IndexInterface } from "./type.js"; import { encode as default_encoder } from "./lang/latin/default.js"; diff --git a/src/polyfill.js b/src/polyfill.js index 17a039a..394fd8a 100644 --- a/src/polyfill.js +++ b/src/polyfill.js @@ -1,5 +1,6 @@ +// COMPILER BLOCK --> import { POLYFILL, SUPPORT_ASYNC } from "./config.js"; - +// <-- COMPILER BLOCK export let promise = Promise; if(POLYFILL){ diff --git a/src/preset.js b/src/preset.js index 42a637a..a10dd00 100644 --- a/src/preset.js +++ b/src/preset.js @@ -1,4 +1,6 @@ +// COMPILER BLOCK --> import { DEBUG } from "./config.js"; +// <-- COMPILER BLOCK import { is_string } from "./common.js"; /** diff --git a/src/worker/node.js b/src/worker/node.js index 4e1a20b..8a8a468 100644 --- a/src/worker/node.js +++ b/src/worker/node.js @@ -1,5 +1,5 @@ const { parentPort } = require("worker_threads"); -const { Index } = require("../flexsearch.bundle.js"); +const { Index } = require("../flexsearch.bundle.min.js"); let index; diff --git a/task/babel.bundle.json b/task/babel.bundle.json new file mode 100644 index 0000000..1b52d66 --- /dev/null +++ b/task/babel.bundle.json @@ -0,0 +1,41 @@ +{ + "plugins": [ + ["conditional-compile", { + "dropDebugger": true, + "define": { + "RELEASE": "module", + "DEBUG": false, + "POLYFILL": true, + "SUPPORT_WORKER": true, + "SUPPORT_ENCODER": true, + "SUPPORT_CACHE": true, + "SUPPORT_ASYNC": true, + "SUPPORT_STORE": true, + "SUPPORT_TAGS": true, + "SUPPORT_SUGGESTION": true, + "SUPPORT_SERIALIZE": true, + "SUPPORT_DOCUMENT": true + } + }], + "babel-plugin-minify-constant-folding", + "babel-plugin-minify-dead-code-elimination", + "babel-plugin-minify-flip-comparisons", + "babel-plugin-minify-guarded-expressions", + "babel-plugin-minify-infinity", + "babel-plugin-minify-replace", + "babel-plugin-minify-type-constructors", + "babel-plugin-transform-member-expression-literals", + "babel-plugin-transform-merge-sibling-variables", + "babel-plugin-transform-minify-booleans", + "babel-plugin-transform-property-literals", + "babel-plugin-transform-simplify-comparison-operators", + "babel-plugin-transform-undefined-to-void" + ], + "ignore": [ + "webpack.js", + "config.js" + ], + "minified": false, + "compact": false, + "comments": true +} diff --git a/task/babel.debug.json b/task/babel.debug.json new file mode 100644 index 0000000..6faad82 --- /dev/null +++ b/task/babel.debug.json @@ -0,0 +1,41 @@ +{ + "plugins": [ + ["conditional-compile", { + "dropDebugger": true, + "define": { + "RELEASE": "module", + "DEBUG": true, + "POLYFILL": true, + "SUPPORT_WORKER": true, + "SUPPORT_ENCODER": true, + "SUPPORT_CACHE": true, + "SUPPORT_ASYNC": true, + "SUPPORT_STORE": true, + "SUPPORT_TAGS": true, + "SUPPORT_SUGGESTION": true, + "SUPPORT_SERIALIZE": true, + "SUPPORT_DOCUMENT": true + } + }], + "babel-plugin-minify-constant-folding", + "babel-plugin-minify-dead-code-elimination", + "babel-plugin-minify-flip-comparisons", + "babel-plugin-minify-guarded-expressions", + "babel-plugin-minify-infinity", + "babel-plugin-minify-replace", + "babel-plugin-minify-type-constructors", + "babel-plugin-transform-member-expression-literals", + "babel-plugin-transform-merge-sibling-variables", + "babel-plugin-transform-minify-booleans", + "babel-plugin-transform-property-literals", + "babel-plugin-transform-simplify-comparison-operators", + "babel-plugin-transform-undefined-to-void" + ], + "ignore": [ + "webpack.js", + "config.js" + ], + "minified": false, + "compact": false, + "comments": true +} diff --git a/task/babel.js b/task/babel.js new file mode 100644 index 0000000..7c1bd5c --- /dev/null +++ b/task/babel.js @@ -0,0 +1,65 @@ +const child_process = require("child_process"); +const fs = require("fs"); +const debug = process.argv[2] && process.argv[2].toLowerCase().includes("debug=true"); +const minify = process.argv[2] && process.argv[2].toLowerCase().includes("release=min"); + +console.log("Start build ....."); +console.log('Bundle: ' + ('module' /* 'custom' */) + (debug ? ":debug" : (minify ? ":min" : ""))); + +//fs.existsSync("log") || fs.mkdirSync("log"); +fs.existsSync("tmp") || fs.mkdirSync("tmp"); +fs.existsSync("dist") || fs.mkdirSync("dist"); + +const files = [ + + "async.js", + "cache.js", + "common.js", + "config.js", + "document.js", + "engine.js", + "global.js", + "index.js", + "intersect.js", + "lang.js", + "polyfill.js", + "preset.js", + "serialize.js", + "type.js", + "webpack.js" +]; + +files.forEach(function(file){ + + let src = String(fs.readFileSync("src/" + file)); + src = src.replace(/\/\/ COMPILER BLOCK -->(.*)<-- COMPILER BLOCK/gs, ""); + fs.writeFileSync("tmp/" + file, src); +}); + +fs.copyFileSync("task/babel." + (debug ? "debug": (minify ? "min" : "bundle")) + ".json", "tmp/.babelrc"); + +exec("npx babel tmp -d dist/module" + (debug ? "-debug" : (minify ? "-min --minified --compact true" : "")) + " --config-file tmp/.babelrc && exit 0", function(){ + + console.log("Build Complete."); +}); + +function exec(prompt, callback){ + + const child = child_process.exec(prompt, function(err, stdout, stderr){ + + if(err){ + + console.error(err); + } + else{ + + if(callback){ + + callback(); + } + } + }); + + child.stdout.pipe(process.stdout); + child.stderr.pipe(process.stderr); +} diff --git a/task/babel.min.json b/task/babel.min.json new file mode 100644 index 0000000..ee5724a --- /dev/null +++ b/task/babel.min.json @@ -0,0 +1,43 @@ +{ + "plugins": [ + ["conditional-compile", { + "dropDebugger": true, + "define": { + "RELEASE": "module", + "DEBUG": false, + "POLYFILL": true, + "SUPPORT_WORKER": true, + "SUPPORT_ENCODER": true, + "SUPPORT_CACHE": true, + "SUPPORT_ASYNC": true, + "SUPPORT_STORE": true, + "SUPPORT_TAGS": true, + "SUPPORT_SUGGESTION": true, + "SUPPORT_SERIALIZE": true, + "SUPPORT_DOCUMENT": true + } + }], + "babel-plugin-minify-constant-folding", + "babel-plugin-minify-dead-code-elimination", + "babel-plugin-minify-flip-comparisons", + "babel-plugin-minify-guarded-expressions", + "babel-plugin-minify-infinity", + "babel-plugin-minify-mangle-names", + "babel-plugin-minify-replace", + "babel-plugin-minify-simplify", + "babel-plugin-minify-type-constructors", + "babel-plugin-transform-member-expression-literals", + "babel-plugin-transform-merge-sibling-variables", + "babel-plugin-transform-minify-booleans", + "babel-plugin-transform-property-literals", + "babel-plugin-transform-simplify-comparison-operators", + "babel-plugin-transform-undefined-to-void" + ], + "ignore": [ + "webpack.js", + "config.js" + ], + "minified": true, + "compact": true, + "comments": false +} diff --git a/task/build.js b/task/build.js index 48ca7a8..eb0c25a 100644 --- a/task/build.js +++ b/task/build.js @@ -1,11 +1,11 @@ -const child_process = require('child_process'); -const fs = require('fs'); +const child_process = require("child_process"); +const fs = require("fs"); console.log("Start build ....."); -console.log(); -fs.existsSync("log") || fs.mkdirSync("log"); -fs.existsSync("tmp") || fs.mkdirSync("tmp"); +fs.rmSync("tmp/", { recursive: true }); +fs.mkdirSync("tmp"); +//fs.existsSync("log") || fs.mkdirSync("log"); fs.existsSync("dist") || fs.mkdirSync("dist"); var supported_lang = [ @@ -61,46 +61,34 @@ var options = (function(argv){ } else{ - // if(index !== "RELEASE"){ - // - // flag_str += " --define='" + index + "=" + val + "'"; - // } - + if(val === "false") val = false; arr[index] = val; } - - if(count > 3) console.log(index + ': ' + val); } }); - console.log('RELEASE: ' + (arr['RELEASE'] || 'custom')); + console.log('Release: ' + (arr['RELEASE'] || 'custom') + (arr['DEBUG'] ? ":debug" : "")); return arr; })(process.argv); -var release = options["RELEASE"]; +let release = options["RELEASE"].toLowerCase(); +const light_version = (release === "light") || (process.argv[2] === "--light"); +const es5_version = (release === "es5") || (process.argv[2] === "--es5"); +const module_version = (release === "module") || (process.argv[2] === "--module"); -// const light_version = (release === "light") || (process.argv[2] === "--light"); -// const es5_version = (release === "es5") || (process.argv[2] === "--es5"); -// const module_version = (release === "module") || (process.argv[2] === "--module"); - -if(release){ - - let filename - - if(!fs.existsSync(filename = "src/config/" + release + "/config.js")){ - - filename = "src/config/bundle/config.js"; - } - - fs.writeFileSync("tmp/config.js", fs.readFileSync(filename)); -} - -if(release === "es5"){ - - release = "ES5"; -} +// if(release){ +// +// let filename +// +// if(!fs.existsSync(filename = "src/config/" + release + "/config.js")){ +// +// filename = "src/config/bundle/config.js"; +// } +// +// fs.writeFileSync("tmp/config.js", fs.readFileSync(filename)); +// } let parameter = (function(opt){ @@ -115,7 +103,7 @@ let parameter = (function(opt){ if(opt.hasOwnProperty(index)){ - if((release !== "lang") || (index !== "entry_point")){ + if((release !== "lang") /*|| (index !== "entry_point")*/){ parameter += ' --' + index + '=' + opt[index]; } @@ -127,26 +115,16 @@ let parameter = (function(opt){ compilation_level: compilation_level || "ADVANCED_OPTIMIZATIONS", //"SIMPLE" use_types_for_optimization: true, - //new_type_inf: true, - //jscomp_warning: "newCheckTypes", - //jscomp_error: "strictCheckTypes", - //jscomp_error: "newCheckTypesExtraChecks", generate_exports: true, export_local_property_definitions: true, - language_in: "ECMASCRIPT_2017", - language_out: language_out || "ECMASCRIPT6_STRICT", + //language_in: "ECMASCRIPT_2017", + language_out: language_out || "ECMASCRIPT_2020", process_closure_primitives: true, summary_detail_level: 3, warning_level: "VERBOSE", - emit_use_strict: true, // release !== "lang", - - output_manifest: "log/manifest.log", - //output_module_dependencies: "log/module_dependencies.log", - property_renaming_report: "log/property_renaming.log", - create_source_map: "log/source_map.log", - variable_renaming_report: "log/variable_renaming.log", + //emit_use_strict: true, // release !== "lang",, strict_mode_input: true, - assume_function_wrapper: true, + //assume_function_wrapper: true, //transform_amd_modules: true, process_common_js_modules: false, @@ -155,24 +133,23 @@ let parameter = (function(opt){ //js_module_root: "./", entry_point: "./tmp/webpack.js", //manage_closure_dependencies: true, - dependency_mode: "PRUNE", // PRUNE_LEGACY + dependency_mode: "PRUNE_LEGACY", // PRUNE_LEGACY rewrite_polyfills: use_polyfill || false, - // isolation_mode: "IIFE", - output_wrapper: /*release === "lang" ? "%output%" :*/ "\"(function(self){%output%}(this));\"" - + //isolation_mode: "IIFE", + //output_wrapper: /*release === "lang" ? "%output%" :*/ "\"(function(self){%output%}(this));\"" //formatting: "PRETTY_PRINT" }); -// if(release === "pre" || release === "debug"){ -// +// if(options["DEBUG"]){ // parameter += ' --formatting=PRETTY_PRINT'; // } -// if(release === "demo"){ -// -// options['RELEASE'] = "custom"; -// } +if(release !== "bundle.module" && release !== "light.module"){ + //parameter += ' --isolation_mode=IIFE'; + parameter += ' --emit_use_strict=true'; + parameter += ' --output_wrapper="\"(function(self){%output%}(this));\""'; +} const custom = (!release || (release === "custom")); @@ -181,103 +158,151 @@ if(custom){ release = "custom." + hashCode(parameter + flag_str).replace(/[^a-zA-Z0-9]/g, "").toLowerCase(); } -if(release === "lang"){ +// if(release === "lang"){ +// +// const charsets = Object.keys(supported_charset); +// +// (function next(x, y, z){ +// +// if(x < supported_lang.length){ +// +// (function(lang){ +// +// fs.writeFileSync("tmp/" + lang + ".js", ` +// import lang from "../src/lang/${lang}.js"; +// self["FlexSearch"]["registerLanguage"]("${lang}", lang); +// `); +// +// exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + lang + ".js' --js='tmp/" + lang + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + lang + ".min.js' && exit 0", function(){ +// +// console.log("Build Complete: " + lang + ".min.js"); +// next(++x, y, z); +// }); +// +// })(supported_lang[x]); +// } +// else if(y < charsets.length){ +// +// const charset = charsets[y]; +// const variants = supported_charset[charset]; +// +// if(z < variants.length){ +// +// (function(charset, variant){ +// +// fs.writeFileSync("tmp/" + charset + "_" + variant + ".js", ` +// import charset from "../src/lang/${charset}/${variant}.js"; +// /*try{if(module)self=module}catch(e){}*/ +// self["FlexSearch"]["registerCharset"]("${charset}:${variant}", charset); +// `); +// +// exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + charset + "_" + variant + ".js' --js='tmp/" + charset + "_" + variant + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + charset + "/" + variant + ".min.js' && exit 0", function(){ +// +// console.log("Build Complete: " + charset + "/" + variant + ".min.js"); +// next(x, y, ++z); +// }); +// +// })(charset, variants[z]); +// } +// else{ +// +// next(x, ++y, 0); +// } +// } +// +// }(0, 0, 0)); +// } +// else{ - const charsets = Object.keys(supported_charset); + if(release === "lang") throw new Error("disabled"); - (function next(x, y, z){ - if(x < supported_lang.length){ +const files = [ - (function(lang){ + "async.js", + "cache.js", + "common.js", + "config.js", + "document.js", + "engine.js", + "global.js", + "index.js", + "intersect.js", + "lang.js", + "polyfill.js", + "preset.js", + "serialize.js", + "type.js", + "webpack.js" +]; - fs.writeFileSync("tmp/" + lang + ".js", ` - import lang from "../src/lang/${lang}.js"; - /*try{if(module)self=module}catch(e){}*/ - self["FlexSearch"]["registerLanguage"]("${lang}", lang); - `); +files.forEach(function(file){ - exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + lang + ".js' --js='tmp/" + lang + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + lang + ".min.js' && exit 0", function(){ + if(file === "config.js"){ - console.log("Build Complete: " + lang + ".min.js"); - next(++x, y, z); - }); + let src = String(fs.readFileSync("src/" + file)); - })(supported_lang[x]); - } - else if(y < charsets.length){ + for(let opt in options){ - const charset = charsets[y]; - const variants = supported_charset[charset]; - - if(z < variants.length){ - - (function(charset, variant){ - - fs.writeFileSync("tmp/" + charset + "_" + variant + ".js", ` - import charset from "../src/lang/${charset}/${variant}.js"; - /*try{if(module)self=module}catch(e){}*/ - self["FlexSearch"]["registerCharset"]("${charset}:${variant}", charset); - `); - - exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --entry_point='tmp/" + charset + "_" + variant + ".js' --js='tmp/" + charset + "_" + variant + ".js' --js='src/**.js'" + flag_str + " --js_output_file='dist/lang/" + charset + "/" + variant + ".min.js' && exit 0", function(){ - - console.log("Build Complete: " + charset + "/" + variant + ".min.js"); - next(x, y, ++z); - }); - - })(charset, variants[z]); - } - else{ - - next(x, ++y, 0); - } + src = src.replace(new RegExp('(export const ' + opt + ' = )(")?[^";]+(")?;'), "$1$2" + options[opt] + "$3;"); } - }(0, 0, 0)); -} -else{ + fs.writeFileSync("tmp/" + file, src); + } + else{ - var filename = "dist/flexsearch." + (release || "custom") + ".js"; + fs.copyFileSync("src/" + file, "tmp/" + file); + } +}); - exec((/^win/.test(process.platform) ? +fs.cpSync("src/lang/", "tmp/lang/", { recursive: true }); +fs.cpSync("src/worker/", "tmp/worker/", { recursive: true }); - "\"node_modules/google-closure-compiler-windows/compiler.exe\"" - : - "java -jar node_modules/google-closure-compiler-java/compiler.jar" +const filename = "dist/flexsearch." + (release || "custom") + (options["DEBUG"] ? ".debug" : ".min") + ".js"; - ) + parameter + " --js='tmp/**.js' --js='!tmp/**/node.js'" + flag_str + " --js_output_file='" + filename + "' && exit 0", function(){ +const executable = process.platform === "win32" ? "\"node_modules/google-closure-compiler-windows/compiler.exe\"" : + process.platform === "darwin" ? "\"node_modules/google-closure-compiler-osx/compiler\"" : + "java -jar node_modules/google-closure-compiler-java/compiler.jar"; - let build = fs.readFileSync(filename); - let preserve = fs.readFileSync("src/index.js", "utf8"); +exec(executable + parameter + " --js='tmp/**.js' --js='!tmp/**/node.js'" + flag_str + " --js_output_file='" + filename + "' && exit 0", function(){ - const package_json = require("../package.json"); + let build = fs.readFileSync(filename); + let preserve = fs.readFileSync("src/index.js", "utf8"); - preserve = preserve.replace("* FlexSearch.js", "* FlexSearch.js v" + package_json.version + (release ? " (" + (release.charAt(0).toUpperCase() + release.substring(1)) + ")" : "")); - build = preserve.substring(0, preserve.indexOf('*/') + 2) + "\n" + build; + const package_json = require("../package.json"); - if(release === "bundle"){ + preserve = preserve.replace("* FlexSearch.js", "* FlexSearch.js v" + package_json.version + (release ? " (" + (release.charAt(0).toUpperCase() + release.substring(1)) + ")" : "")); + build = preserve.substring(0, preserve.indexOf('*/') + 2) + "\n" + build; - build = build.replace("(function(self){'use strict';", "(function _f(self){'use strict';try{if(module)self=module}catch(e){}self._factory=_f;"); - } + if(release === "bundle"){ - if(release === "pre"){ + build = build.replace("(function(self){'use strict';", "(function _factory(self){'use strict';"); + } - fs.existsSync("test/dist") || fs.mkdirSync("test/dist"); - fs.writeFileSync("test/" + filename, build); - } - else{ + if(release === "bundle.module" || release === "light.module"){ - fs.writeFileSync(filename, build); - } + build = build.replace(/window\.FlexSearch(\s+)?=(\s+)?/, "export default "); + } - console.log("Build Complete."); - }); -} + // if(release === "pre"){ + // + // fs.existsSync("test/dist") || fs.mkdirSync("test/dist"); + // fs.writeFileSync("test/" + filename, build); + // } + // else{ + + fs.writeFileSync(filename, build); + // } + + fs.copyFileSync("src/worker/node.js", "dist/node/node.js"); + + console.log("Build Complete."); +}); +//} function hashCode(str) { - var hash = 0, i, chr; + let hash = 0, i, chr; if(str.length === 0){