var w;function N(t,e,i){const s=typeof i,n=typeof t;if(s!=="undefined"){if(n!=="undefined"){if(i){if(n==="function"&&s===n)return function(o){return t(i(o))};if(e=t.constructor,e===i.constructor){if(e===Array)return i.concat(t);if(e===Map){var r=new Map(i);for(var h of t)r.set(h[0],h[1]);return r}if(e===Set){h=new Set(i);for(r of t.values())h.add(r);return h}}}return t}return i}return n==="undefined"?e:t}function I(){return Object.create(null)}function D(t){return typeof t=="string"}function rt(t){return typeof t=="object"}function fe(t){const e=[];for(const i of t.keys())e.push(i);return e}function ht(t,e){if(D(e))t=t[e];else for(let i=0;t&&i"a1a".split(i).length;this.numeric=N(t.numeric,s)}else{try{this.split=N(this.split,ce)}catch{this.split=/\s+/}this.numeric=N(t.numeric,N(this.numeric,!0))}if(this.prepare=N(t.prepare,null,this.prepare),this.finalize=N(t.finalize,null,this.finalize),i=t.filter,this.filter=typeof i=="function"?i:N(i&&new Set(i),null,this.filter),this.dedupe=N(t.dedupe,!0,this.dedupe),this.matcher=N((i=t.matcher)&&new Map(i),null,this.matcher),this.mapper=N((i=t.mapper)&&new Map(i),null,this.mapper),this.stemmer=N((i=t.stemmer)&&new Map(i),null,this.stemmer),this.replacer=N(t.replacer,null,this.replacer),this.minlength=N(t.minlength,1,this.minlength),this.maxlength=N(t.maxlength,1024,this.maxlength),this.rtl=N(t.rtl,!1,this.rtl),(this.cache=i=N(t.cache,!0,this.cache))&&(this.H=null,this.S=typeof i=="number"?i:2e5,this.B=new Map,this.G=new Map,this.L=this.K=128),this.h="",this.M=null,this.A="",this.N=null,this.matcher)for(const n of this.matcher.keys())this.h+=(this.h?"|":"")+n;if(this.stemmer)for(const n of this.stemmer.keys())this.A+=(this.A?"|":"")+n;return this};w.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.N=null,this.cache&&Y(this),this};w.addFilter=function(t){return typeof t=="function"?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&Y(this),this};w.addMapper=function(t,e){return typeof t=="object"?this.addReplacer(t,e):1t.length&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.M=null,this.cache&&Y(this),this)};w.addReplacer=function(t,e){return typeof t=="string"?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&Y(this),this)};w.encode=function(t,e){if(this.cache&&t.length<=this.K)if(this.H){if(this.B.has(t))return this.B.get(t)}else this.H=setTimeout(Y,50,this);this.normalize&&(typeof this.normalize=="function"?t=this.normalize(t):t=bt?t.normalize("NFKD").replace(bt,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&3this.maxlength)){if(e){if(n[u])continue;n[u]=1}else{if(r===u)continue;r=u}if(i)s.push(u);else if(!this.filter||(typeof this.filter=="function"?this.filter(u):!this.filter.has(u))){if(this.cache&&u.length<=this.L)if(this.H){var l=this.G.get(u);if(l||l===""){l&&s.push(l);continue}}else this.H=setTimeout(Y,50,this);if(this.stemmer){this.N||(this.N=new RegExp("(?!^)("+this.A+")$"));let a;for(;a!==u&&2this.stemmer.get(d))}if(u&&(this.mapper||this.dedupe&&1this.matcher.get(a))),u&&this.replacer)for(l=0;u&&lthis.S&&(this.G.clear(),this.L=this.L/1.1|0)),u){if(u!==c)if(e){if(n[u])continue;n[u]=1}else{if(h===u)continue;h=u}s.push(u)}}}return this.finalize&&(s=this.finalize(s)||s),this.cache&&t.length<=this.K&&(this.B.set(t,s),this.B.size>this.S&&(this.B.clear(),this.K=this.K/1.1|0)),s};function Y(t){t.H=null,t.B.clear(),t.G.clear()}let V,it;async function pe(t){t=t.data;var e=t.task;const i=t.id;let s=t.args;switch(e){case"init":it=t.options||{},(e=t.factory)?(Function("return "+e)()(self),V=new self.FlexSearch.Index(it),delete self.FlexSearch):V=new $(it),postMessage({id:i});break;default:let n;e==="export"&&(s[1]?(s[0]=it.export,s[2]=0,s[3]=1):s=null),e==="import"?s[0]&&(t=await it.import.call(V,s[0]),V.import(s[0],t)):(n=s&&V[e].apply(V,s))&&n.then&&(n=await n),postMessage(e==="search"?{id:i,msg:n}:{id:i})}}function It(t){nt.call(t,"add"),nt.call(t,"append"),nt.call(t,"search"),nt.call(t,"update"),nt.call(t,"remove")}let St,Dt,at;function me(){St=at=0}function nt(t){this[t+"Async"]=function(){const e=arguments;var i=e[e.length-1];let s;if(typeof i=="function"&&(s=i,delete e[e.length-1]),St?at||(at=Date.now()-Dt>=this.priority*this.priority*3):(St=setTimeout(me,0),Dt=Date.now()),at){const r=this;return new Promise(h=>{setTimeout(function(){h(r[t+"Async"].apply(r,e))},0)})}const n=this[t].apply(this,e);return i=n.then?n:new Promise(r=>r(n)),s&&i.then(s),i}}let Q=0;function ot(t={}){function e(h){function o(l){l=l.data||l;const f=l.id,u=f&&n.h[f];u&&(u(l.msg),delete n.h[f])}if(this.worker=h,this.h=I(),this.worker)return s?this.worker.on("message",o):this.worker.onmessage=o,t.config?new Promise(function(l){n.h[++Q]=function(){l(n),1e9"u",n=this,r=we(i,s,t.worker);return r.then?r.then(function(h){return e.call(n,h)}):e.call(this,r)}J("add");J("append");J("search");J("update");J("remove");J("clear");J("export");J("import");It(ot.prototype);function J(t){ot.prototype[t]=function(){const e=this,i=[].slice.call(arguments);var s=i[i.length-1];let n;return typeof s=="function"&&(n=s,i.pop()),s=new Promise(function(r){t==="export"&&typeof i[0]=="function"&&(i[0]=null),e.h[++Q]=r,e.worker.postMessage({task:t,id:Q,args:i})}),n?(s.then(n),this):s}}function we(t,e,i){return e?typeof module<"u"?new(require("worker_threads")).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(function(){return ze}).then(function(s){return new s.Worker(import.meta.dirname+"/node/node.mjs")}):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+pe.toString()],{type:"text/javascript"}))):new window.Worker(typeof i=="string"?i:import.meta.url.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js"),{type:"module"})}function Lt(t,e=0){let i=[],s=[];e&&(e=25e4/e*5e3|0);for(const n of t.entries())s.push(n),s.length===e&&(i.push(s),s=[]);return s.length&&i.push(s),i}function Bt(t,e){e||(e=new Map);for(let i=0,s;i=h.length)e-=h.length;else{e=h[s?"splice":"slice"](e,i);const o=e.length;if(o&&(n=n.length?n.concat(e):e,i-=o,s&&(t.length-=o),!i))break;e=0}return n}function H(t){if(!this||this.constructor!==H)return new H(t);this.index=t?[t]:[],this.length=t?t.length:0;const e=this;return new Proxy([],{get(i,s){if(s==="length")return e.length;if(s==="push")return function(n){e.index[e.index.length-1].push(n),e.length++};if(s==="pop")return function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()};if(s==="indexOf")return function(n){let r=0;for(let h=0,o,l;hi||s?l.slice(s,i+s):l;else{if(ti||s)&&(l=l.slice(s,i+s));else{n=[];for(let c=0,a;cs)s-=a.length;else if((a.length>i||s)&&(a=a.slice(s,i+s),i-=a.length,s&&(s-=a.length)),n.push(a),!i)break;l=1e?e?t.slice(i,i+e):t.slice(i):t,s?G.call(this,t):t;let n=[];for(let r=0,h,o;r=o){i-=o;continue}ie&&(h=h.slice(0,e),o=e),!n.length&&o>=e)return s?G.call(this,h):h;if(n.push(h),e-=o,!e)break}return n=1t.length?this.result=t[0]:(this.result=te(t,i,s,!1,this.h),s=0)),r?this.resolve(i,s,n):this}O.prototype.and=function(){let t=this.result.length,e,i,s,n;if(!t){const r=arguments[0];r&&(t=!!r.suggest,n=r.resolve,e=r.limit,i=r.offset,s=r.enrich&&n)}if(t){const{O:r,P:h,limit:o,offset:l,enrich:f,resolve:u,suggest:c}=yt(this,"and",arguments);return ie.call(this,r,h,o,l,f,u,c)}return n?this.resolve(e,i,s):this};function ie(t,e,i,s,n,r,h){if(e.length){const o=this;return Promise.all(e).then(function(l){t=[];for(let f=0,u;ft.length)this.result=t[0];else{if(e=ue(t))return this.result=Kt(t,e,i,s,h,this.h,r),r?n?G.call(this.index,this.result):this.result:this;this.result=[]}else h||(this.result=t);return r?this.resolve(i,s,n):this}O.prototype.xor=function(){const{O:t,P:e,limit:i,offset:s,enrich:n,resolve:r,suggest:h}=yt(this,"xor",arguments);return ne.call(this,t,e,i,s,n,r,h)};function ne(t,e,i,s,n,r,h){if(e.length){const o=this;return Promise.all(e).then(function(l){t=[];for(let f=0,u;ft.length)this.result=t[0];else return this.result=xe.call(this,t,i,s,r,this.h),r?n?G.call(this.index,this.result):this.result:this;else h||(this.result=t);return r?this.resolve(i,s,n):this}function xe(t,e,i,s,n){const r=[],h=I();let o=0;for(let l=0,f;lL&&(L=g.length+(g?1:0)),M=g.length+(g?1:0)+R.length,v+=z,ct.push(y.length),y.push({match:R})),g+=(g?" ":"")+R)}if(!k)_=x[j],g+=(g?" ":"")+_,l&&y.push({text:_});else if(l&&v>=l)break}if(v=ct.length*(r.length-2),d||p||l&&g.length-v>l)if(v=l+v-2*a,j=M-L,0x&&(x=0)),y=y.length-1){if(A>=y.length){j[k+1]=1,A>=x.length&&(v[k+1]=1);continue}z-=a}if(g=y[A].text,B=p&&S[k])if(0B)if(j[k+1]=1,f)g=g.substring(0,B);else continue;(B-=g.length)||(B=-1),S[k]=B}else{j[k+1]=1;continue}if(z+g.length+1<=l)g=" "+g,M[k]+=g;else if(f)C=l-z-1,0=A){if(0>A){j[k]=1,v[k]=1;continue}z-=a}if(g=y[A].text,B=d&&_[k])if(0B)if(j[k]=1,f)g=g.substring(g.length-B);else continue;(B-=g.length)||(B=-1),_[k]=B}else{j[k]=1;continue}if(z+g.length+1<=l)g+=" ",M[k]=g+M[k];else if(f)C=g.length+1-(l-z),0<=C&&C=x.length-1||A"u"&&(this.db?g.push(d=this.index.get(this.field[0]).db.enrich(d)):d=G.call(this,d)),h)return c?a?kt(t,d,this.index,h,a):d:new O(d);n[m]={field:r[m],result:d}}if(p&&this.db&&g.length){const M=this;return Promise.all(g).then(function(v){for(let j=0;ji||s)&&(t=t.slice(s,s+i)),n&&(t=G.call(this,t)),t}function G(t){if(!this||!this.store)return t;const e=Array(t.length);for(let i=0,s;ithis.limit&&this.cache.delete(this.cache.keys().next().value)};q.prototype.get=function(t){const e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e};q.prototype.remove=function(t){for(const e of this.cache){const i=e[0];e[1].includes(t)&&this.cache.delete(i)}};q.prototype.clear=function(){this.cache.clear(),this.h=""};const Tt={normalize:!1,numeric:!1,dedupe:!1},gt={},jt=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),Et=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),Gt=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],Jt={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6};var Me={Exact:Tt,Default:gt,Normalize:gt,LatinBalance:{mapper:jt},LatinAdvanced:{mapper:jt,matcher:Et,replacer:Gt},LatinExtra:{mapper:jt,replacer:Gt.concat([/(?!^)[aeo]/g,""]),matcher:Et},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let i=0;in.length)n.pop();else{const r=n.indexOf(t);r===i.length-1?n.pop():n.splice(r,1)}}else ft(this.map,t),this.depth&&ft(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.T&&he(this)),this.cache&&this.cache.remove(t),this};function ft(t,e){let i=0;var s=typeof e>"u";if(t.constructor===Array){for(let n=0,r,h;nm;r--){h=p.substring(m,r),g=this.rtl?n-1-m:m;var o=this.score?this.score(e,p,d,h,g):dt(a,f,d,n,g);st(this,c,h,o,t,i)}break}case"bidirectional":case"reverse":if(1h?0:1),f,d,o-1,l-1),g=this.bidirectional&&p>r;st(this,u,g?r:p,m,t,i,g?p:r)}}}}}this.fastupdate||this.reg.add(t)}else e=""}return this.db&&(e||this.commit_task.push({del:t}),this.T&&he(this)),this};function st(t,e,i,s,n,r,h){let o=h?t.ctx:t.map,l;if((!e[i]||h&&!(l=e[i])[h])&&(h?(e=l||(e[i]=I()),e[h]=1,(l=o.get(h))?o=l:o.set(h,o=new Map)):e[i]=1,(l=o.get(i))?o=l:o.set(i,o=l=[]),o=o[s]||(o[s]=[]),!r||!o.includes(n))){if(o.length===2**31-1){if(e=new H(o),t.fastupdate)for(let f of t.reg.values())f.includes(o)&&(f[f.indexOf(o)]=e);l[s]=o=e}o.push(n),t.fastupdate&&((s=t.reg.get(n))?s.push(o):t.reg.set(n,[o]))}}function dt(t,e,i,s,n){return i&&1i)&&(l=i,i=e,e=l),t.db?t.db.get(e,i,s,n,r,h,o):(t=i?(t=t.ctx.get(i))&&t.get(e):t.map.get(e),t)}function $(t,e){if(!this||this.constructor!==$)return new $(t);if(t){var i=D(t)?t:t.preset;i&&(t=Object.assign({},_e[i],t))}else t={};i=t.context;const s=i===!0?{depth:1}:i||{},n=D(t.encoder)?Me[t.encoder]:t.encode||t.encoder||{};this.encoder=n.encode?n:typeof n=="object"?new lt(n):{encode:n},this.resolution=t.resolution||9,this.tokenize=i=(i=t.tokenize)&&i!=="default"&&i!=="exact"&&i||"strict",this.depth=i==="strict"&&s.depth||0,this.bidirectional=s.bidirectional!==!1,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(i=t.keystore||0)&&(this.keystore=i),this.map=i?new T(i):new Map,this.ctx=i?new T(i):new Map,this.reg=e||(this.fastupdate?i?new T(i):new Map:i?new F(i):new Set),this.U=s.resolution||3,this.rtl=n.rtl||t.rtl||!1,this.cache=(i=t.cache||null)&&new q(i),this.resolve=t.resolve!==!1,(i=t.db)&&(this.db=this.mount(i)),this.T=t.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}w=$.prototype;w.mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)};w.commit=function(t,e){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this,t,e)};w.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function he(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t,void 0,void 0)},1))}w.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db&&(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[{clear:!0}]),this};w.append=function(t,e){return this.add(t,e,!0)};w.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)};w.update=function(t,e){const i=this,s=this.remove(t);return s&&s.then?s.then(()=>i.add(t,e)):this.add(t,e)};w.cleanup=function(){return this.fastupdate?(ft(this.map),this.depth&&ft(this.ctx),this):this};w.searchCache=re;w.export=function(t,e,i=0,s=0){let n,r;switch(s){case 0:n="reg",r=Ht(this.reg);break;case 1:n="cfg",r=null;break;case 2:n="map",r=Lt(this.map,this.reg.size);break;case 3:n="ctx",r=Xt(this.ctx,this.reg.size);break;default:return}return pt.call(this,t,e,n,r,i,s)};w.import=function(t,e){if(e)switch(typeof e=="string"&&(e=JSON.parse(e)),t=t.split("."),t[t.length-1]==="json"&&t.pop(),t.length===3&&t.shift(),t=1=u.length){s-=u.length;continue}const c=i?s+Math.min(u.length-s,i):u.length;for(let a=s;a=r.length?[]:!e&&!i?r:(r=r.slice(i,i+e),s?n.enrich(r):r)})};w.enrich=function(t){typeof t!="object"&&(t=[t]);const e=this.db.transaction("reg","readonly").objectStore("reg"),i=[];for(let s=0;s{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,i(this.result)},t.onerror=t.onblocked=s,t=null})}const oe=$;let _t=new oe;self.onmessage=t=>{switch(t.data.type){case"clear":_t=new oe,postMessage({identifier:t.data.identifier});break;case"points":for(let i of t.data.points)_t.add(i.id,i.text);postMessage({identifier:t.data.identifier});break;case"query":let e=_t.search(t.data.query,{limit:t.data.limit});postMessage({identifier:t.data.identifier,result:e});break}};var Se={},ze=Object.freeze({__proto__:null,default:Se});