@kedem/okdb 2.3.3 → 2.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/algorithm-worker-thread.js +1 -1
- package/bin/okdb.js +1 -1
- package/docs/auth-and-sync.md +170 -463
- package/docs/auth-permissions.md +3 -1
- package/docs/deployment.md +8 -0
- package/docs/embeddings.md +1 -0
- package/docs/files.md +176 -51
- package/docs/functions.md +1 -1
- package/docs/getting-started.md +40 -13
- package/docs/http-api.md +12 -3
- package/docs/http-cluster.md +25 -0
- package/docs/resolved-fields.md +2 -0
- package/okdb-functions-sandbox-worker.js +1 -1
- package/okdb-http-worker-child.js +1 -1
- package/okdb-views-bootstrap-worker.js +1 -1
- package/okdb.js +1 -1
- package/package.json +1 -1
- package/public/sections/files/parts/files-file-list.ok.js +1 -1
- package/public/sections/files/parts/files-preview.ok.js +1 -0
- package/types/features/files.d.ts +38 -3
- package/types/index.d.ts +18 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,65 @@ All notable changes to `@kedem/okdb` are documented here. Format loosely follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/); versions follow [SemVer](https://semver.org/).
|
|
5
5
|
Dates are release dates.
|
|
6
6
|
|
|
7
|
+
## [2.3.4] - 2026-09-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Searchable file contents: `files.indexContent({ field, maxBytes })`.** Declares `~files.<field>`
|
|
12
|
+
a resolved field backed by a built-in resolver (blob → extractor → text), installed in every
|
|
13
|
+
process automatically, so FTS and embeddings over `~files` need no per-process app code.
|
|
14
|
+
Text-like mimes are extracted out of the box; `files.registerExtractor(match, fn)` adds others
|
|
15
|
+
(mime, wildcard or predicate; no parsers are bundled). A blob missing on the indexing node is
|
|
16
|
+
pulled from sync peers first, else fails retryably with `FILE_BLOB_MISSING`. Also
|
|
17
|
+
`files.get(id)` / `files.read(id)`, and `files.read` / `files.listPath` in functions.
|
|
18
|
+
- **Inline file preview: `GET /api/files/:id?inline=1`.** Passive media (non-SVG images, audio,
|
|
19
|
+
video, PDF) keep their type; everything else is served as `text/plain`, always with `nosniff`
|
|
20
|
+
and a sandboxing CSP. Single `Range` requests are honoured (206 / 416).
|
|
21
|
+
- **Admin → Files:** a preview pane (text/JSON, images, SVG, PDF, audio/video), a path filter, and
|
|
22
|
+
content search over the `~files` FTS index.
|
|
23
|
+
- **The CLI honours the role flags from its config file.** Top-level `processors`, `engines` and
|
|
24
|
+
`compaction` booleans in `.kdbconfig` (or `--config`) are passed to `new OKDB(path, opts)` with
|
|
25
|
+
the constructor's names, defaults and semantics, for the single-process node and every cluster
|
|
26
|
+
worker — so a passive serving node can run from `bin/okdb`. They were silently ignored before.
|
|
27
|
+
A non-boolean value is a startup error.
|
|
28
|
+
- **`db.http.listen(port, { host })` binds the API to chosen addresses.** `host` is a string or an
|
|
29
|
+
array (one server per address, sharing one request handler); default unchanged (all
|
|
30
|
+
interfaces). With an array, `listen()` returns the first address's `http.Server`; all of them are
|
|
31
|
+
on `db.http.servers` and `db.http.close()` closes them all. The process registry's `listenAddr`
|
|
32
|
+
shows the bound host(s). The CLI reads `http.host` from its config file (single-process and
|
|
33
|
+
every cluster worker). The documented `listen(port, '0.0.0.0')` form now actually binds that
|
|
34
|
+
host (a string is shorthand for `{ host }`); before, the argument was ignored.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **Overwriting a file id releases the old blob.** `files.upload()` under an existing id with
|
|
39
|
+
different bytes leaked the previous blob's reference (it was never deleted); same bytes no
|
|
40
|
+
longer double-count.
|
|
41
|
+
- **Downloads of files with non-Latin-1 names no longer fail** (`ERR_INVALID_CHAR`):
|
|
42
|
+
`content-disposition` carries an ASCII fallback plus RFC 6266 `filename*`.
|
|
43
|
+
- **Blob pulls from sync peers found no peers**: they looked up `~sync_nodes` in the default env
|
|
44
|
+
instead of `~system`. The fetch now has a timeout.
|
|
45
|
+
- **Admin → Files: switching folders reloads the file list.**
|
|
46
|
+
- **`docs/auth-permissions.md`: the cluster-peer token recipe needs `sync:read` too** — `join()`
|
|
47
|
+
reads `/api/sync/info` first.
|
|
48
|
+
- **`docs/auth-and-sync.md` describes the real auth and sync-peer model.** Dropped the `auth.admin`,
|
|
49
|
+
`auth.tokens`, `api.tokens` and `auth.mode` config okdb never reads; tokens live in `~tokens`, and
|
|
50
|
+
peers join once with a token or name + password, then sync with Ed25519-signed requests.
|
|
51
|
+
- **A process missing an app registration holds embedding work instead of failing it.** A
|
|
52
|
+
full-role process that lacked the pipeline's custom preparer (`registerPreparer`) or chunk
|
|
53
|
+
strategy (`registerChunkStrategy`), or whose embedder engine was not running (e.g. its
|
|
54
|
+
`registerEmbedderFactory` factory is registered only in another process), marked every doc it
|
|
55
|
+
picked up `failed` for good — measured: with a second such process on the store, 21 of 40 docs
|
|
56
|
+
ended failed and stayed failed after the owner restarted. It now holds them exactly like a
|
|
57
|
+
missing resolved-field resolver: the doc stays `pending`, the inline drain is held (and yields
|
|
58
|
+
its lease to a peer that wants it), a queue job is re-queued without using a try, and
|
|
59
|
+
`indexer.stats().waiting` reports `{ reason: 'REGISTRATION_MISSING', kind, name }` or
|
|
60
|
+
`{ reason: 'EMBEDDER_NOT_RUNNING' }` with a warning in the log. The work completes once the
|
|
61
|
+
registration arrives in that process (registering a preparer/strategy or starting the embedder
|
|
62
|
+
kicks the held drain) or a process that has it picks it up. A misspelled built-in name holds
|
|
63
|
+
too; the message lists the built-ins. Docs already marked `failed` this way by earlier versions
|
|
64
|
+
are not revisited automatically — run `indexer.retryFailed()` once.
|
|
65
|
+
|
|
7
66
|
## [2.3.3] - 2026-09-24
|
|
8
67
|
|
|
9
68
|
### Fixed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x2796(){const _0xb675a1=['usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','WRITER.LOCK','key','published','MetricKind','USEARCH_BINDINGS_UNAVAILABLE','warn','efConstruction','hnswlib-node','Original\x20error:\x20','push','reject','token','add','catch','readIndexSync','dir','HierarchicalNSW','min','has','keyToFp','listSnapshotIds','readCurrentClock','prototype','queryVec','from','78PedzFR','state','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','now','size','added','hasOwnProperty','nextLabel','trunc','manifestVersion','versions','keyForLabel','6OwdHGz','readdirSync','[SnapshotStore]','view','snapshotEveryChanges','repeat','hnsw','writeIndexSync','L2sq','startsWith','_tmp-','clear','SnapshotStore\x20requires\x20dir','set','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','filter','snapshot\x20id\x20required','byteOffset','entries','loadFrom','snapshotTo','reset','writer','delete','getCurrentCount','opts','vector','reader','snapshotsDir','resizeIndex','29817JErKlu','remove','cause','prune','writeFileSync','closeSync','labelForExisting','labels','memoryUsage','vectors','hasRows','lockPath','dims','buffer','heartbeatIntervalMs','map','unlinkSync','score','keepSnapshots','__esModule','error','slice','readFileSync','arch','labels.json','keys','removed','call','index','worker_threads','tmpMaxAgeMs','readCurrentId','Cos','rebuild','ready','isInteger','tombstone','metric','writerLockMaxAgeMs','SNAPSHOT.LOCK','hostname','1190BJqJfL','number','statSync','\x20on\x20','get','7wSaIFB','viewRefreshMs','resolve','distances','name','cosine','mkdirSync','46080rDeTmS','randomBytes','hex','EEXIST','sort','changed','ceil','hasFingerprints','2717364vXvfvY','Unknown\x20algorithm:\x20\x22','mtimeMs','initIndex',').\x20','index.hnsw','parse','length','trim','imul','usearch\x20algorithm\x20requires\x20dims\x20>\x200','usearch','stop','setFingerprint','fetchAllResult','labelForEphemeral','1259535yzQKvY','isFree','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','keyToLabel','platform','acquire','host','stringify','cleanupTmpDirs','7455984YUTzjZ','setEf','unreadable','sqrt','max','log','.tmp-','efSearch','3307096TIwYet','expansionAdd','fingerprintOf','for\x20Node\x20','default','version','flat','crypto','renameSync','info','publishSnapshot','path','stale','rmSync','candidateClock\x20must\x20be\x20finite\x20>=\x200','ScalarKind','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','.tmp','expansionSearch','code','node','snapshotMaxLagMs','lock_busy','Unknown\x20op:\x20\x22','toString','_snapshotPaths','22032714OyfKer','F32','state.json','clock','join','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','postMessage','HNSW_BINDINGS_UNAVAILABLE','count','utf8','then','connectivity','getMaxElements','load','pid','finally','labelToKey','maxElements','_tombstoneCount','latestSnapshotId','isDirectory','loadSnapshot','CURRENT','isFinite','unref','markDelete','message','search','sync','_snapshotDir','growFactor'];_0x2796=function(){return _0xb675a1;};return _0x2796();}const _0x2d7520=_0x3b7a;(function(_0x32c205,_0x32daa7){const _0x1014e4=_0x3b7a,_0x37f58e=_0x32c205();while(!![]){try{const _0x4b52b2=-parseInt(_0x1014e4(0x19c))/0x1*(parseInt(_0x1014e4(0x171))/0x2)+parseInt(_0x1014e4(0x1d9))/0x3+-parseInt(_0x1014e4(0x1fa))/0x4+parseInt(_0x1014e4(0x1e9))/0x5*(-parseInt(_0x1014e4(0x17d))/0x6)+parseInt(_0x1014e4(0x1ca))/0x7*(parseInt(_0x1014e4(0x1f2))/0x8)+parseInt(_0x1014e4(0x1d1))/0x9*(-parseInt(_0x1014e4(0x1c5))/0xa)+parseInt(_0x1014e4(0x138))/0xb;if(_0x4b52b2===_0x32daa7)break;else _0x37f58e['push'](_0x37f58e['shift']());}catch(_0x2e115a){_0x37f58e['push'](_0x37f58e['shift']());}}}(_0x2796,0xf1af0));var require$$0$1=require(_0x2d7520(0x1b9)),require$$0=require('fs'),require$$1=require(_0x2d7520(0x129)),require$$2=require('os'),require$$3=require(_0x2d7520(0x125));function getDefaultExportFromCjs(_0x48b6e1){const _0x2fa4bc=_0x2d7520;return _0x48b6e1&&_0x48b6e1[_0x2fa4bc(0x1af)]&&Object[_0x2fa4bc(0x16e)][_0x2fa4bc(0x177)][_0x2fa4bc(0x1b7)](_0x48b6e1,_0x2fa4bc(0x122))?_0x48b6e1[_0x2fa4bc(0x122)]:_0x48b6e1;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x302aee=_0x2d7520;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x3a1d7a=require$$0,_0x4cca24=require$$1,_0x4216e3=require$$2,_0x59c3d9=require$$3;function _0x3cc0ea(){const _0x325987=_0x3b7a;return Date[_0x325987(0x174)]();}function _0x497c11(_0xb90b7){try{return _0x3a1d7a['existsSync'](_0xb90b7);}catch{return![];}}function _0x57aa1c(_0x12b190){const _0x244f4d=_0x3b7a;try{return _0x3a1d7a['readFileSync'](_0x12b190,_0x244f4d(0x141));}catch{return null;}}function _0x5d5390(_0x55dd7a,_0x1af4e4){const _0x359afa=_0x3b7a,_0x344981=_0x55dd7a+_0x359afa(0x1f8)+_0x59c3d9[_0x359afa(0x1d2)](0x6)[_0x359afa(0x136)](_0x359afa(0x1d3));_0x3a1d7a[_0x359afa(0x1a0)](_0x344981,_0x1af4e4),_0x3a1d7a['renameSync'](_0x344981,_0x55dd7a);}function _0x596b85(_0x27cc1f,_0xe39a65=0x10){const _0x113b91=_0x3b7a,_0x39fd82=String(Math[_0x113b91(0x1f6)](0x0,Math['trunc'](_0x27cc1f||0x0)));return _0x39fd82['length']>=_0xe39a65?_0x39fd82:'0'[_0x113b91(0x182)](_0xe39a65-_0x39fd82[_0x113b91(0x1e0)])+_0x39fd82;}return snapshotStore=class _0xc71019{constructor({dir:_0x361cc5,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x2976b1=_0x3b7a;if(!_0x361cc5)throw new Error(_0x2976b1(0x189));this[_0x2976b1(0x167)]=_0x361cc5,this[_0x2976b1(0x19a)]=_0x4cca24['join'](_0x361cc5,'snapshots'),this['currentPath']=_0x4cca24[_0x2976b1(0x13c)](_0x361cc5,_0x2976b1(0x14e)),this[_0x2976b1(0x1a7)]=_0x4cca24[_0x2976b1(0x13c)](_0x361cc5,_0x2976b1(0x1c3)),this[_0x2976b1(0x1ae)]=keepSnapshots,this[_0x2976b1(0x1f7)]=log,_0x3a1d7a[_0x2976b1(0x1d0)](this[_0x2976b1(0x167)],{'recursive':!![]}),_0x3a1d7a[_0x2976b1(0x1d0)](this[_0x2976b1(0x19a)],{'recursive':!![]});}[_0x302aee(0x155)](_0xdf708c){const _0x28f875=_0x302aee;return _0x4cca24[_0x28f875(0x13c)](this[_0x28f875(0x19a)],_0xdf708c);}[_0x302aee(0x137)](_0x32674e){const _0x38d97e=_0x302aee,_0x3ad731=this['_snapshotDir'](_0x32674e);return{'dir':_0x3ad731,'index':_0x4cca24[_0x38d97e(0x13c)](_0x3ad731,_0x38d97e(0x1de)),'labels':_0x4cca24[_0x38d97e(0x13c)](_0x3ad731,_0x38d97e(0x1b4)),'state':_0x4cca24[_0x38d97e(0x13c)](_0x3ad731,_0x38d97e(0x13a))};}[_0x302aee(0x1bb)](){const _0x29ecb2=_0x302aee;if(!_0x497c11(this['currentPath']))return null;const _0x50a526=_0x57aa1c(this['currentPath']);if(!_0x50a526)return null;const _0x5d90c1=String(_0x50a526)[_0x29ecb2(0x1e1)]();return _0x5d90c1||null;}['readCurrentClock'](){const _0x3282a4=_0x302aee,_0x353f4f=this['readCurrentId']();if(!_0x353f4f)return 0x0;const _0x1b0688=Number(_0x353f4f);return Number[_0x3282a4(0x14f)](_0x1b0688)?_0x1b0688:0x0;}[_0x302aee(0x16c)](){const _0xc91c3d=_0x302aee;try{return _0x3a1d7a[_0xc91c3d(0x17e)](this[_0xc91c3d(0x19a)],{'withFileTypes':!![]})[_0xc91c3d(0x18d)](_0x32128c=>_0x32128c[_0xc91c3d(0x14c)]())[_0xc91c3d(0x1ab)](_0x2d70e0=>_0x2d70e0[_0xc91c3d(0x1ce)])[_0xc91c3d(0x18d)](_0x39046a=>!_0x39046a[_0xc91c3d(0x186)](_0xc91c3d(0x1f8)))[_0xc91c3d(0x18d)](_0x68343b=>!_0x68343b['startsWith'](_0xc91c3d(0x187)))[_0xc91c3d(0x1d5)]();}catch{return[];}}['latestSnapshotId'](){const _0x10830c=_0x302aee,_0x1f3d4=this[_0x10830c(0x1bb)]();if(_0x1f3d4)return _0x1f3d4;const _0x5baa6b=this[_0x10830c(0x16c)]();if(!_0x5baa6b[_0x10830c(0x1e0)])return null;return _0x5baa6b[_0x5baa6b[_0x10830c(0x1e0)]-0x1];}[_0x302aee(0x1f1)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x5e59bb=_0x302aee;let _0x30b128;try{_0x30b128=_0x3a1d7a[_0x5e59bb(0x17e)](this['snapshotsDir'],{'withFileTypes':!![]});}catch{return;}const _0x257d15=_0x3cc0ea()-maxAgeMs;for(const _0x156f15 of _0x30b128){if(!_0x156f15[_0x5e59bb(0x14c)]())continue;const _0x3a7e38=_0x156f15[_0x5e59bb(0x1ce)];if(!_0x3a7e38[_0x5e59bb(0x186)](_0x5e59bb(0x1f8))&&!_0x3a7e38['startsWith'](_0x5e59bb(0x187)))continue;const _0x4123e5=_0x4cca24[_0x5e59bb(0x13c)](this[_0x5e59bb(0x19a)],_0x3a7e38);try{const _0x294e6d=_0x3a1d7a[_0x5e59bb(0x1c7)](_0x4123e5);if(_0x294e6d[_0x5e59bb(0x1db)]>_0x257d15)continue;}catch{}try{_0x3a1d7a[_0x5e59bb(0x12b)](_0x4123e5,{'recursive':!![],'force':!![]});}catch{}}}['prune']({keep:keep=null}={}){const _0x58250e=_0x302aee,_0x597f4c=Math[_0x58250e(0x1f6)](0x1,Math[_0x58250e(0x179)](keep??this[_0x58250e(0x1ae)]??0x3)),_0x57b969=this[_0x58250e(0x16c)]();if(_0x57b969[_0x58250e(0x1e0)]<=_0x597f4c)return;const _0x9f0ffd=this['readCurrentId'](),_0x4b49e9=_0x57b969[_0x58250e(0x1b1)](0x0,Math[_0x58250e(0x1f6)](0x0,_0x57b969[_0x58250e(0x1e0)]-_0x597f4c));for(const _0x438f3e of _0x4b49e9){if(_0x9f0ffd&&_0x438f3e===_0x9f0ffd)continue;const _0x540b8b=this['_snapshotDir'](_0x438f3e);try{_0x3a1d7a[_0x58250e(0x12b)](_0x540b8b,{'recursive':!![],'force':!![]});}catch{}}}async[_0x302aee(0x14d)](_0x218a19,_0x2c8d1d){const _0x22032d=_0x302aee;if(!_0x218a19)throw new Error(_0x22032d(0x18e));const _0x50c708=this[_0x22032d(0x137)](_0x218a19);if(!_0x497c11(_0x50c708[_0x22032d(0x1b8)])||!_0x497c11(_0x50c708[_0x22032d(0x1a3)])||!_0x497c11(_0x50c708['state']))throw new Error('snapshot\x20incomplete:\x20'+_0x218a19);const _0x4004a2=await _0x2c8d1d(_0x50c708);return _0x4004a2||{};}async['publishSnapshot'](_0x5110c0,_0xd8ee3c,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x1fa840=_0x302aee,_0x13ccdf=Number(_0x5110c0);if(!Number[_0x1fa840(0x14f)](_0x13ccdf)||_0x13ccdf<0x0)throw new Error(_0x1fa840(0x12c));const _0x28c77b=_0x596b85(_0x13ccdf),_0xc3ec3b=this[_0x1fa840(0x155)](_0x28c77b),_0x35f64c=_0x4cca24['join'](this[_0x1fa840(0x19a)],_0x1fa840(0x1f8)+_0x28c77b+'-'+_0x59c3d9[_0x1fa840(0x1d2)](0x6)[_0x1fa840(0x136)](_0x1fa840(0x1d3)));_0x3a1d7a['mkdirSync'](_0x35f64c,{'recursive':!![]});const _0xfbc3e3={'dir':_0x35f64c,'index':_0x4cca24[_0x1fa840(0x13c)](_0x35f64c,'index.hnsw'),'labels':_0x4cca24[_0x1fa840(0x13c)](_0x35f64c,'labels.json'),'state':_0x4cca24[_0x1fa840(0x13c)](_0x35f64c,_0x1fa840(0x13a))};await _0xd8ee3c(_0xfbc3e3,{'id':_0x28c77b,'clock':_0x13ccdf});const _0x56d99f=JSON[_0x1fa840(0x1f0)]({'pid':process[_0x1fa840(0x146)],'host':_0x4216e3[_0x1fa840(0x1c4)](),'at':_0x3cc0ea()}),_0x2db2a7=_0x3cc0ea();let _0xe534d0=null;const _0x287173=()=>{const _0x3dec11=_0x1fa840;try{const _0x44d414=JSON[_0x3dec11(0x1df)](_0x3a1d7a[_0x3dec11(0x1b2)](this['lockPath'],_0x3dec11(0x141)));if(_0x44d414['at']&&_0x3cc0ea()-_0x44d414['at']>staleLockMaxAgeMs){const _0x1a567d=_0x3cc0ea()-_0x44d414['at'],_0x13d1a6=_0x3dec11(0x12e)+Math['round'](_0x1a567d/0x3e8)+'s,\x20pid:\x20'+_0x44d414[_0x3dec11(0x146)]+',\x20host:\x20'+_0x44d414[_0x3dec11(0x1ef)]+_0x3dec11(0x1dd)+_0x3dec11(0x1eb);this[_0x3dec11(0x1f7)]?.[_0x3dec11(0x15d)]?this[_0x3dec11(0x1f7)][_0x3dec11(0x15d)](_0x13d1a6):console['warn'](_0x3dec11(0x17f),_0x13d1a6);try{_0x3a1d7a['unlinkSync'](this[_0x3dec11(0x1a7)]);}catch{}return!![];}}catch{try{_0x3a1d7a[_0x3dec11(0x1ac)](this['lockPath']);}catch{}}return![];},_0x599225=()=>{const _0x114e62=_0x1fa840;try{return _0xe534d0=_0x3a1d7a['openSync'](this[_0x114e62(0x1a7)],'wx'),_0x3a1d7a[_0x114e62(0x1a0)](_0xe534d0,_0x56d99f),!![];}catch(_0x1e6dfc){if(_0x1e6dfc&&_0x1e6dfc['code']===_0x114e62(0x1d4))return![];throw _0x1e6dfc;}};if(!_0x599225()){_0x287173(),_0x599225();if(_0xe534d0==null&&lockTimeoutMs>0x0)while(_0x3cc0ea()-_0x2db2a7<lockTimeoutMs){await new Promise(_0x3d43a1=>setTimeout(_0x3d43a1,0x19));if(_0x599225())break;_0x287173();}}if(_0xe534d0==null){try{_0x3a1d7a[_0x1fa840(0x12b)](_0x35f64c,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x1fa840(0x134)};}try{const _0x5187b6=this['readCurrentClock']();if(_0x13ccdf<=_0x5187b6){try{_0x3a1d7a[_0x1fa840(0x12b)](_0x35f64c,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x1fa840(0x12a),'currentClock':_0x5187b6};}if(!_0x497c11(_0xc3ec3b))_0x3a1d7a['renameSync'](_0x35f64c,_0xc3ec3b);else try{_0x3a1d7a['rmSync'](_0x35f64c,{'recursive':!![],'force':!![]});}catch{}return _0x5d5390(this['currentPath'],_0x28c77b+'\x0a'),this[_0x1fa840(0x19f)]({'keep':keep}),{'published':!![],'currentClock':_0x13ccdf};}finally{try{_0x3a1d7a[_0x1fa840(0x1a1)](_0xe534d0);}catch{}try{_0x3a1d7a[_0x1fa840(0x1ac)](this[_0x1fa840(0x1a7)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x343f48=_0x2d7520;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x1f6de5=require$$0;class _0x280409{constructor(){const _0x1b4152=_0x3b7a;this[_0x1b4152(0x1ec)]=new Map(),this['labelToKey']=new Map(),this[_0x1b4152(0x178)]=0x0,this['_tombstoneCount']=0x0,this[_0x1b4152(0x16b)]=new Map(),this['hasFingerprints']=!![];}async[_0x343f48(0x193)](){const _0x2bbbc2=_0x343f48;this[_0x2bbbc2(0x1ec)]=new Map(),this[_0x2bbbc2(0x148)]=new Map(),this[_0x2bbbc2(0x16b)]=new Map(),this[_0x2bbbc2(0x1d8)]=!![],this[_0x2bbbc2(0x178)]=0x0,this[_0x2bbbc2(0x14a)]=0x0;}async[_0x343f48(0x191)](_0xa677ff){const _0x6b9ef3=_0x343f48;if(!_0xa677ff||!_0x1f6de5['existsSync'](_0xa677ff))return await this['reset'](),!![];let _0x19af96;try{_0x19af96=_0x1f6de5[_0x6b9ef3(0x1b2)](_0xa677ff,_0x6b9ef3(0x141));}catch{return await this[_0x6b9ef3(0x193)](),!![];}let _0x8137c0;try{_0x8137c0=JSON[_0x6b9ef3(0x1df)](_0x19af96);}catch{return await this[_0x6b9ef3(0x193)](),!![];}const _0x2b47f5=Array['isArray'](_0x8137c0?.[_0x6b9ef3(0x190)])?_0x8137c0[_0x6b9ef3(0x190)]:[],_0x553c98=Number[_0x6b9ef3(0x1bf)](_0x8137c0?.[_0x6b9ef3(0x178)])?_0x8137c0[_0x6b9ef3(0x178)]:0x0,_0xe23bf1=new Map(),_0x3d9d29=new Map(),_0x47234e=new Map(),_0x2d6e7d=_0x8137c0?.[_0x6b9ef3(0x123)]>=0x2;let _0x37b755=-0x1;for(const _0x4cfd71 of _0x2b47f5){if(!Array['isArray'](_0x4cfd71)||_0x4cfd71[_0x6b9ef3(0x1e0)]<0x2)continue;const _0x4821ac=Number(_0x4cfd71[0x0]),_0x45a787=String(_0x4cfd71[0x1]??'');if(!Number[_0x6b9ef3(0x1bf)](_0x4821ac)||_0x4821ac<0x0)continue;if(!_0x45a787)continue;_0xe23bf1[_0x6b9ef3(0x18a)](_0x45a787,_0x4821ac),_0x3d9d29[_0x6b9ef3(0x18a)](_0x4821ac,_0x45a787);if(_0x2d6e7d&&typeof _0x4cfd71[0x2]===_0x6b9ef3(0x1c6))_0x47234e[_0x6b9ef3(0x18a)](_0x45a787,_0x4cfd71[0x2]);if(_0x4821ac>_0x37b755)_0x37b755=_0x4821ac;}return this[_0x6b9ef3(0x1ec)]=_0xe23bf1,this[_0x6b9ef3(0x148)]=_0x3d9d29,this[_0x6b9ef3(0x16b)]=_0x47234e,this['hasFingerprints']=_0x2d6e7d,this[_0x6b9ef3(0x178)]=Math[_0x6b9ef3(0x1f6)](_0x553c98,_0x37b755+0x1,0x0),this[_0x6b9ef3(0x14a)]=0x0,!![];}[_0x343f48(0x1a2)](_0x5f3698){const _0x6b67ca=_0x343f48;return this[_0x6b67ca(0x1ec)][_0x6b67ca(0x1c9)](_0x5f3698);}['labelForEphemeral'](_0x328306){const _0x1d1cec=_0x343f48;let _0x30c065=this[_0x1d1cec(0x1ec)]['get'](_0x328306);if(_0x30c065!==undefined)return _0x30c065;return _0x30c065=this[_0x1d1cec(0x178)]++,this[_0x1d1cec(0x1ec)][_0x1d1cec(0x18a)](_0x328306,_0x30c065),this[_0x1d1cec(0x148)][_0x1d1cec(0x18a)](_0x30c065,_0x328306),_0x30c065;}[_0x343f48(0x1e6)](_0x3ee1a7,_0x1a5a69){const _0x21f279=_0x343f48;if(_0x1a5a69==null)this[_0x21f279(0x16b)]['delete'](_0x3ee1a7);else this[_0x21f279(0x16b)][_0x21f279(0x18a)](_0x3ee1a7,_0x1a5a69);}[_0x343f48(0x1fc)](_0x48bafd){const _0x709436=_0x343f48;return this[_0x709436(0x16b)]['get'](_0x48bafd);}[_0x343f48(0x1b5)](){return this['keyToLabel']['keys']();}[_0x343f48(0x1c0)](_0x23837b){const _0x22c04c=_0x343f48,_0x344bcf=this[_0x22c04c(0x1ec)]['get'](_0x23837b);if(_0x344bcf===undefined)return;this['keyToFp']['delete'](_0x23837b),this[_0x22c04c(0x1ec)][_0x22c04c(0x195)](_0x23837b),this[_0x22c04c(0x148)][_0x22c04c(0x195)](_0x344bcf),this[_0x22c04c(0x14a)]++;}[_0x343f48(0x17c)](_0xb22bee){const _0x161918=_0x343f48;return this[_0x161918(0x148)][_0x161918(0x1c9)](_0xb22bee)??null;}[_0x343f48(0x175)](){const _0x6a8303=_0x343f48;return this[_0x6a8303(0x1ec)][_0x6a8303(0x175)];}['tombstoneCount'](){const _0xea8b4a=_0x343f48;return this[_0xea8b4a(0x14a)];}async[_0x343f48(0x192)](_0x4661c4){const _0x54d090=_0x343f48,_0x402a84=_0x4661c4+_0x54d090(0x12f),_0x50efcb=[];for(const [_0x5154d6,_0x529603]of this[_0x54d090(0x148)][_0x54d090(0x190)]()){const _0x25543b=this['keyToFp'][_0x54d090(0x1c9)](_0x529603);_0x50efcb[_0x54d090(0x161)](_0x25543b==null?[_0x5154d6,_0x529603]:[_0x5154d6,_0x529603,_0x25543b]);}_0x50efcb[_0x54d090(0x1d5)]((_0x4a08ef,_0x3fe522)=>_0x4a08ef[0x0]-_0x3fe522[0x0]);const _0x1edd7e={'version':0x2,'nextLabel':this['nextLabel'],'entries':_0x50efcb};_0x1f6de5['writeFileSync'](_0x402a84,JSON[_0x54d090(0x1f0)](_0x1edd7e)),_0x1f6de5[_0x54d090(0x126)](_0x402a84,_0x4661c4);}}return labelMap=_0x280409,labelMap;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x7517a2(_0x40db98){const _0x1d464a=_0x3b7a,_0x3986e6=new Uint32Array(_0x40db98[_0x1d464a(0x1a9)],_0x40db98[_0x1d464a(0x18f)],_0x40db98['length']);let _0x28076f=0x811c9dc5,_0xf6c068=0x9747b28c;for(let _0xec47e8=0x0;_0xec47e8<_0x3986e6[_0x1d464a(0x1e0)];_0xec47e8++){const _0x559735=_0x3986e6[_0xec47e8];_0x28076f=Math[_0x1d464a(0x1e2)](_0x28076f^_0x559735,0x1000193)>>>0x0;let _0x5a7d4b=Math[_0x1d464a(0x1e2)](_0x559735,0xcc9e2d51);_0x5a7d4b=_0x5a7d4b<<0xf|_0x5a7d4b>>>0x11,_0xf6c068=Math[_0x1d464a(0x1e2)](_0xf6c068^Math[_0x1d464a(0x1e2)](_0x5a7d4b,0x1b873593),0x5)+0xe6546b64,_0xf6c068>>>=0x0;}return _0xf6c068=Math[_0x1d464a(0x1e2)](_0xf6c068^_0xf6c068>>>0x10,0x85ebca6b)>>>0x0,(_0x28076f>>>0x0)*0x100000+(_0xf6c068&0xfffff);}function _0x7ec065(_0xf5c61d,_0x1c56c0,_0x53ddf2,{upsert:_0x48ace7,remove:_0x23b5b8}){const _0x2847f3=_0x3b7a,_0x83e91f=new Set();let _0x4ac256=0x0,_0x69d7b3=0x0,_0x2e33ed=0x0;for(const {key:_0x5a82f5,vector:_0x5539d6}of _0x1c56c0){if(!(_0x5539d6 instanceof Float32Array)||_0x5539d6[_0x2847f3(0x1e0)]!==_0x53ddf2)continue;_0x83e91f[_0x2847f3(0x164)](_0x5a82f5);const _0x2f2eb7=_0x7517a2(_0x5539d6),_0x302127=_0xf5c61d[_0x2847f3(0x1a2)](_0x5a82f5)!==undefined;if(_0x302127&&_0xf5c61d['fingerprintOf'](_0x5a82f5)===_0x2f2eb7)continue;_0x48ace7(_0x5a82f5,_0x5539d6,_0x2f2eb7);if(_0x302127)_0x69d7b3++;else _0x4ac256++;}for(const _0x40ed73 of[..._0xf5c61d[_0x2847f3(0x1b5)]()]){if(_0x83e91f[_0x2847f3(0x16a)](_0x40ed73))continue;_0x23b5b8(_0x40ed73),_0x2e33ed++;}return{'added':_0x4ac256,'changed':_0x69d7b3,'removed':_0x2e33ed};}return indexConvergence={'fingerprint':_0x7517a2,'reconcileIndex':_0x7ec065},indexConvergence;}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x3861f9=requireSnapshotStore(),_0x2389fe=requireLabelMap(),{fingerprint:_0x26d219,reconcileIndex:_0x259bec}=requireIndexConvergence(),_0x235f15=0x1;let _0x464552=null;function _0x2e710b(){const _0x32e2a5=_0x3b7a;if(_0x464552)return _0x464552;try{return _0x464552=require(_0x32e2a5(0x15f)),_0x464552;}catch(_0x4a1124){const _0x496243=new Error(_0x32e2a5(0x18b)+('for\x20Node\x20'+process[_0x32e2a5(0x17b)][_0x32e2a5(0x132)]+_0x32e2a5(0x1c8)+process[_0x32e2a5(0x1ed)]+'/'+process[_0x32e2a5(0x1b3)]+'.\x20')+_0x32e2a5(0x173)+(_0x32e2a5(0x160)+(_0x4a1124?.[_0x32e2a5(0x152)]||String(_0x4a1124))));_0x496243[_0x32e2a5(0x131)]=_0x32e2a5(0x13f),_0x496243[_0x32e2a5(0x19e)]=_0x4a1124;throw _0x496243;}}return hnsw=function _0x43fb6a(_0x411353={},{dims:_0x306740,dir:_0x4c8091}){const _0x1c6874=_0x3b7a,_0x5a381c=_0x2e710b();if(!_0x306740||_0x306740<=0x0)throw new Error(_0x1c6874(0x13d));if(!_0x4c8091)throw new Error(_0x1c6874(0x18c));const _0x338170={'metric':_0x411353[_0x1c6874(0x1c1)]??_0x1c6874(0x1cf),'M':_0x411353['M']??0x10,'efConstruction':_0x411353['efConstruction']??0xc8,'efSearch':_0x411353[_0x1c6874(0x1f9)]??0x40,'maxElements':_0x411353[_0x1c6874(0x149)]??0x400,'growFactor':_0x411353[_0x1c6874(0x156)]??0x2,'snapshotEveryChanges':_0x411353[_0x1c6874(0x181)]??0xc350,'keepSnapshots':_0x411353[_0x1c6874(0x1ae)]??0x2,'tmpMaxAgeMs':_0x411353[_0x1c6874(0x1ba)]??0x6*0x36ee80},_0x597b7f=new _0x3861f9({'dir':_0x4c8091,'keepSnapshots':_0x338170['keepSnapshots']}),_0x23d149=new _0x2389fe();let _0x33b82e=null,_0x26a31a=0x0,_0x513576=null,_0x505697=Promise[_0x1c6874(0x1cc)]();const _0x470420=_0x418ffe=>{const _0x53874a=_0x1c6874,_0x4f194b=_0x505697['then'](_0x418ffe);return _0x505697=_0x4f194b[_0x53874a(0x165)](()=>{}),_0x4f194b;};async function _0x4dffb8(_0x30cbd7){const _0x134bdb=_0x1c6874;await _0x23d149[_0x134bdb(0x193)](),_0x30cbd7=_0x30cbd7??[];const _0x30551e=Math[_0x134bdb(0x1f6)](_0x338170['maxElements'],Math[_0x134bdb(0x1d7)](_0x30cbd7[_0x134bdb(0x1e0)]*(_0x338170['growFactor']||1.2)),0x1);_0x33b82e=new _0x5a381c['HierarchicalNSW'](_0x338170['metric'],_0x306740),_0x33b82e[_0x134bdb(0x1dc)]({'maxElements':_0x30551e,'efConstruction':_0x338170[_0x134bdb(0x15e)],'M':_0x338170['M']});for(const {key:_0x52deaf,vector:_0x27e393}of _0x30cbd7){if(!(_0x27e393 instanceof Float32Array)||_0x27e393['length']!==_0x306740)continue;_0x5c8063(_0x52deaf,_0x27e393);}_0x33b82e[_0x134bdb(0x1f3)](_0x338170[_0x134bdb(0x1f9)]),_0x26a31a=0x0;}async function _0x2f12e2(_0x23c676){return _0x4dffb8(_0x23c676?await _0x23c676():[]);}function _0x21f690(){const _0x37926f=_0x1c6874;if(_0x33b82e[_0x37926f(0x196)]()<_0x33b82e[_0x37926f(0x144)]())return;const _0x5f0578=Math['ceil'](_0x33b82e['getMaxElements']()*(_0x338170[_0x37926f(0x156)]||0x2));_0x33b82e[_0x37926f(0x19b)](_0x5f0578),_0x338170[_0x37926f(0x149)]=_0x5f0578;}function _0x5c8063(_0x5e8c99,_0x1df3e8,_0x181706){const _0x333440=_0x1c6874,_0x32937e=_0x23d149['labelForEphemeral'](_0x5e8c99);try{_0x33b82e[_0x333440(0x151)](_0x32937e);}catch{}_0x21f690(),_0x33b82e['addPoint'](Array['from'](_0x1df3e8),_0x32937e),_0x23d149['setFingerprint'](_0x5e8c99,_0x181706??_0x26d219(_0x1df3e8));}function _0xfadb88(_0x5aa320){const _0x2a546e=_0x1c6874,_0x29faeb=_0x23d149[_0x2a546e(0x1a2)](_0x5aa320);if(_0x29faeb===undefined)return![];try{_0x33b82e[_0x2a546e(0x151)](_0x29faeb);}catch{}return _0x23d149[_0x2a546e(0x1c0)](_0x5aa320),!![];}function _0x3b261e(){return Math['max'](Date['now'](),_0x597b7f['readCurrentClock']()+0x1);}async function _0x4e7edf(_0x393bfd){const _0x2abcf7=_0x1c6874;if(!_0x33b82e||!_0x393bfd)return![];const _0x329b00=await _0x597b7f['publishSnapshot'](_0x393bfd,async _0x59014c=>{const _0x52babf=_0x3b7a;_0x33b82e[_0x52babf(0x184)](_0x59014c['index']),await _0x23d149[_0x52babf(0x192)](_0x59014c['labels']);const _0x5c1b3d=require$$0;_0x5c1b3d[_0x52babf(0x1a0)](_0x59014c[_0x52babf(0x172)],JSON[_0x52babf(0x1f0)]({'manifestVersion':_0x235f15,'dims':_0x306740,'metric':_0x338170[_0x52babf(0x1c1)],'clock':_0x393bfd,'snapshotAt':Date[_0x52babf(0x174)]()},null,0x2));},{'keep':_0x338170['keepSnapshots']});if(_0x329b00?.['published'])_0x26a31a=0x0;return _0x329b00?.[_0x2abcf7(0x15a)]??![];}async function _0x5b085e(){const _0x2585a5=_0x1c6874,_0x27ff64=_0x597b7f['readCurrentId']()||_0x597b7f[_0x2585a5(0x14b)]();if(!_0x27ff64)return null;let _0x243bc1,_0x3ec26b=![];return await _0x597b7f[_0x2585a5(0x14d)](_0x27ff64,async _0x1c05b9=>{const _0x7ca507=_0x2585a5,_0x1fa02a=require$$0;_0x243bc1=JSON[_0x7ca507(0x1df)](_0x1fa02a[_0x7ca507(0x1b2)](_0x1c05b9[_0x7ca507(0x172)],_0x7ca507(0x141)));if(_0x243bc1[_0x7ca507(0x17a)]!==_0x235f15||_0x243bc1[_0x7ca507(0x1a8)]!==_0x306740||_0x243bc1[_0x7ca507(0x1c1)]!==_0x338170[_0x7ca507(0x1c1)]){_0x243bc1=null;return;}await _0x23d149[_0x7ca507(0x191)](_0x1c05b9[_0x7ca507(0x1a3)]),_0x33b82e=new _0x5a381c[(_0x7ca507(0x168))](_0x338170[_0x7ca507(0x1c1)],_0x306740),_0x33b82e[_0x7ca507(0x166)](_0x1c05b9[_0x7ca507(0x1b8)]),_0x33b82e[_0x7ca507(0x1f3)](_0x338170[_0x7ca507(0x1f9)]),_0x3ec26b=!![];}),_0x3ec26b?_0x243bc1?.[_0x2585a5(0x13b)]??0x0:null;}return{async 'load'(_0x51719e){return _0x470420(async()=>{const _0x45fa80=_0x3b7a;_0x597b7f['cleanupTmpDirs']({'maxAgeMs':_0x338170[_0x45fa80(0x1ba)]}),_0x513576=_0x51719e??null;const _0x506fdb=await _0x5b085e(),_0x13c2b0=_0x51719e?await _0x51719e():null;if(_0x506fdb!=null){if(_0x13c2b0){if(!_0x23d149[_0x45fa80(0x1d8)])return await _0x4dffb8(_0x13c2b0),null;const _0x5adc97=_0x259bec(_0x23d149,_0x13c2b0,_0x306740,{'upsert':_0x5c8063,'remove':_0xfadb88});_0x26a31a+=_0x5adc97['added']+_0x5adc97['changed']+_0x5adc97[_0x45fa80(0x1b6)];}return _0x506fdb;}return await _0x4dffb8(_0x13c2b0),null;});},async 'add'(_0x3e460b,_0x1d9cd9,_0x245fbf){return _0x470420(async()=>{const _0x543d5f=_0x3b7a;if(!_0x33b82e)return;const _0xc9d8c3=_0x1d9cd9 instanceof Float32Array?_0x1d9cd9:new Float32Array(_0x1d9cd9),_0x5a1ff6=_0x26d219(_0xc9d8c3);if(_0x23d149[_0x543d5f(0x1fc)](_0x3e460b)===_0x5a1ff6)return;_0x5c8063(_0x3e460b,_0xc9d8c3,_0x5a1ff6),_0x26a31a++,_0x26a31a>=_0x338170[_0x543d5f(0x181)]&&await _0x4e7edf(_0x3b261e());});},async 'remove'(_0xc63d1){return _0x470420(async()=>{if(!_0x33b82e)return;if(_0xfadb88(_0xc63d1))_0x26a31a++;});},'search'(_0x46baf2,{limit:limit=0xa,efSearch:_0x13fe46}={}){const _0x21c5ba=_0x1c6874;if(!_0x33b82e)return[];if(Number['isInteger'](_0x13fe46))_0x33b82e[_0x21c5ba(0x1f3)](_0x13fe46);const _0x475d9a=Math[_0x21c5ba(0x169)](limit,_0x33b82e[_0x21c5ba(0x196)]()||0x1),{neighbors:_0x1c558c,distances:_0x63fb39}=_0x33b82e['searchKnn'](Array[_0x21c5ba(0x170)](_0x46baf2),_0x475d9a),_0xe33b91=[];for(let _0x22e5b5=0x0;_0x22e5b5<_0x1c558c['length'];_0x22e5b5++){const _0x243abd=_0x23d149['keyForLabel'](_0x1c558c[_0x22e5b5]);if(!_0x243abd)continue;const _0x533589=_0x338170[_0x21c5ba(0x1c1)]===_0x21c5ba(0x1cf)?Math[_0x21c5ba(0x1f6)](0x0,0x1-_0x63fb39[_0x22e5b5]):0x1/(0x1+_0x63fb39[_0x22e5b5]);_0xe33b91['push']({'key':_0x243abd,'score':_0x533589});}return _0xe33b91;},async 'snapshot'(_0xed07ea){return _0x470420(()=>_0x4e7edf(_0xed07ea??_0x3b261e()));},async 'rebuild'(_0x6ff0d7){return _0x470420(()=>{if(_0x6ff0d7!=null)_0x513576=_0x6ff0d7;return _0x2f12e2(_0x6ff0d7??_0x513576);});},async 'stop'(){const _0x519547=_0x1c6874;return _0x470420(()=>_0x26a31a>0x0||!_0x597b7f[_0x519547(0x1bb)]()?_0x4e7edf(_0x3b261e()):![]);},'count'(){const _0x287a2c=_0x1c6874;return _0x23d149[_0x287a2c(0x175)]();},'info'(){const _0x10a549=_0x1c6874;return{'algorithm':_0x10a549(0x183),'metric':_0x338170[_0x10a549(0x1c1)],'M':_0x338170['M'],'efConstruction':_0x338170[_0x10a549(0x15e)],'efSearch':_0x338170['efSearch'],'maxElements':_0x33b82e?.['getMaxElements']()??_0x338170[_0x10a549(0x149)],'count':_0x23d149[_0x10a549(0x175)](),'changesSince':_0x26a31a,'snapshotDir':_0x4c8091,'latestSnapshot':_0x597b7f[_0x10a549(0x1bb)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x3b8fd4(_0x1719f4={}){const _0x4c7748=new Map();return{async 'load'(_0x1ccfa0){const _0xd9c3c0=_0x3b7a;_0x4c7748[_0xd9c3c0(0x188)]();if(_0x1ccfa0)for(const {key:_0x41f6b7,vector:_0x54007a}of await _0x1ccfa0()){_0x4c7748[_0xd9c3c0(0x18a)](_0x41f6b7,_0x54007a);}},async 'add'(_0x373644,_0x3cd71d,_0x2931fc){const _0x1a5b51=_0x3b7a;_0x4c7748[_0x1a5b51(0x18a)](_0x373644,_0x3cd71d);},async 'remove'(_0x16e853){const _0x4bcd85=_0x3b7a;_0x4c7748[_0x4bcd85(0x195)](_0x16e853);},'search'(_0x277960,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x13ae0f=_0x3b7a,_0x188670=[];for(const [_0x265978,_0x3fe8ad]of _0x4c7748){const _0x204a17=_0x2622ae(_0x277960,_0x3fe8ad);if(_0x204a17>=threshold)_0x188670['push']({'key':_0x265978,'score':_0x204a17});}return _0x188670[_0x13ae0f(0x1d5)]((_0x4ed360,_0x116e0d)=>_0x116e0d[_0x13ae0f(0x1ad)]-_0x4ed360[_0x13ae0f(0x1ad)]),_0x188670[_0x13ae0f(0x1b1)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x5f08b8){await this['load'](_0x5f08b8);},async 'stop'(){},'count'(){const _0x35bc16=_0x3b7a;return _0x4c7748[_0x35bc16(0x175)];},'info'(){const _0x485aee=_0x3b7a;return{'algorithm':_0x485aee(0x124),'count':_0x4c7748[_0x485aee(0x175)]};}};};function _0x2622ae(_0x16ce2f,_0x217994){const _0xd4bf65=_0x3b7a;let _0x289639=0x0,_0xd09fb0=0x0,_0x1a615a=0x0;for(let _0xc1f89c=0x0;_0xc1f89c<_0x16ce2f[_0xd4bf65(0x1e0)];_0xc1f89c++){_0x289639+=_0x16ce2f[_0xc1f89c]*_0x217994[_0xc1f89c],_0xd09fb0+=_0x16ce2f[_0xc1f89c]*_0x16ce2f[_0xc1f89c],_0x1a615a+=_0x217994[_0xc1f89c]*_0x217994[_0xc1f89c];}const _0x4ee72c=Math['sqrt'](_0xd09fb0)*Math[_0xd4bf65(0x1f5)](_0x1a615a);return _0x4ee72c===0x0?0x0:_0x289639/_0x4ee72c;}return flat;}var writerLock,hasRequiredWriterLock;function _0x3b7a(_0x4e8a32,_0x341b50){_0x4e8a32=_0x4e8a32-0x121;const _0x27967f=_0x2796();let _0x3b7a2b=_0x27967f[_0x4e8a32];return _0x3b7a2b;}function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x4c9979=require$$0,_0xab8532=require$$1,_0x1a06c4=require$$3;return writerLock=function _0x58f464(_0x494e22,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0xc61720=_0x3b7a,_0x5df197=_0xab8532[_0xc61720(0x13c)](_0x494e22,_0xc61720(0x158)),_0x405111=_0x1a06c4[_0xc61720(0x1d2)](0x8)[_0xc61720(0x136)](_0xc61720(0x1d3));let _0x4fcfd6=![],_0x18b818=null;const _0x1b71e7=()=>JSON[_0xc61720(0x1f0)]({'pid':process['pid'],'token':_0x405111,'at':Date['now']()});function _0x53539b(){const _0x15cf6f=_0xc61720;try{return JSON[_0x15cf6f(0x1df)](_0x4c9979[_0x15cf6f(0x1b2)](_0x5df197,_0x15cf6f(0x141)));}catch(_0x2755ea){return _0x2755ea?.['code']==='ENOENT'?null:{'unreadable':!![]};}}function _0x4d0530(){const _0x4a9fed=_0xc61720;try{const _0x3e3ffc=_0x4c9979['openSync'](_0x5df197,'wx');try{_0x4c9979['writeFileSync'](_0x3e3ffc,_0x1b71e7());}finally{_0x4c9979[_0x4a9fed(0x1a1)](_0x3e3ffc);}return!![];}catch(_0x53b568){if(_0x53b568?.[_0x4a9fed(0x131)]==='EEXIST')return![];throw _0x53b568;}}function _0x3cf160(_0x22e9d6){if(!_0x22e9d6)return!![];if(_0x22e9d6['unreadable'])return!![];return Date['now']()-(_0x22e9d6['at']??0x0)>=maxAgeMs;}function _0x30c36a(){if(_0x18b818)clearInterval(_0x18b818);_0x18b818=null;}function _0x2202e6(){const _0x23fdda=_0xc61720;_0x30c36a(),_0x18b818=setInterval(()=>{const _0x3c1392=_0x3b7a,_0xb41201=_0x53539b();if(_0xb41201&&!_0xb41201[_0x3c1392(0x1f4)]&&_0xb41201[_0x3c1392(0x163)]!==_0x405111){_0x4fcfd6=![],_0x30c36a();try{onLost?.();}catch{}return;}try{_0x4c9979[_0x3c1392(0x1a0)](_0x5df197,_0x1b71e7());}catch{}},heartbeatMs),_0x18b818[_0x23fdda(0x150)]?.();}function _0x1c4839(){const _0x4e34ed=_0xc61720,_0x4af8de=_0x53539b();return!!_0x4af8de&&_0x4af8de[_0x4e34ed(0x163)]===_0x405111;}return{'path':_0x5df197,'token':_0x405111,'acquire'(){const _0x5e8248=_0x53539b();if(_0x5e8248&&_0x5e8248['token']===_0x405111){_0x4fcfd6=!![];if(!_0x18b818)_0x2202e6();return!![];}let _0x256800=_0x4d0530();if(!_0x256800&&_0x3cf160(_0x53539b())){try{_0x4c9979['unlinkSync'](_0x5df197);}catch{}_0x256800=_0x4d0530();}if(_0x256800&&!_0x1c4839())_0x256800=![];_0x4fcfd6=_0x256800;if(_0x256800)_0x2202e6();return _0x256800;},'held'(){return _0x4fcfd6;},'isFree'(){const _0x46c5cd=_0xc61720,_0x3a084c=_0x53539b();if(_0x3a084c&&_0x3a084c[_0x46c5cd(0x163)]===_0x405111)return![];return _0x3cf160(_0x3a084c);},'release'(){_0x30c36a();if(!_0x4fcfd6)return;_0x4fcfd6=![];if(_0x1c4839())try{_0x4c9979['unlinkSync'](_0x5df197);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x537f62=require$$0,_0x3bc4d0=requireSnapshotStore(),_0x87a1ee=requireLabelMap(),_0x198c82=requireWriterLock(),{fingerprint:_0xe6b816,reconcileIndex:_0x330383}=requireIndexConvergence(),_0x76bce1=0x1;let _0x312e0e=null;function _0x5787ae(){const _0x220efc=_0x3b7a;if(_0x312e0e)return _0x312e0e;try{return _0x312e0e=require(_0x220efc(0x1e4)),_0x312e0e;}catch(_0x295a4f){const _0x4dd9fd=new Error('usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20'+(_0x220efc(0x121)+process[_0x220efc(0x17b)][_0x220efc(0x132)]+_0x220efc(0x1c8)+process[_0x220efc(0x1ed)]+'/'+process[_0x220efc(0x1b3)]+'.\x20')+'Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20'+(_0x220efc(0x160)+(_0x295a4f?.[_0x220efc(0x152)]||String(_0x295a4f))));_0x4dd9fd[_0x220efc(0x131)]=_0x220efc(0x15c),_0x4dd9fd['cause']=_0x295a4f;throw _0x4dd9fd;}}function _0x23f049(_0x3e2673,_0x43197a){const _0x2751f6=_0x3b7a;switch(_0x3e2673){case _0x2751f6(0x1cf):return _0x43197a[_0x2751f6(0x15b)]['Cos'];case'l2':return _0x43197a['MetricKind'][_0x2751f6(0x185)];case'ip':return _0x43197a[_0x2751f6(0x15b)]['IP'];default:return _0x43197a[_0x2751f6(0x15b)][_0x2751f6(0x1bc)];}}return usearch=function _0x2d8694(_0x9feea8={},{dims:_0x486b74,dir:_0x4f24e9,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x53fa46=_0x3b7a,_0x27032a=_0x5787ae();if(!_0x486b74||_0x486b74<=0x0)throw new Error(_0x53fa46(0x1e3));if(!_0x4f24e9)throw new Error(_0x53fa46(0x157));const _0x1c1484={'metric':_0x9feea8[_0x53fa46(0x1c1)]??_0x53fa46(0x1cf),'connectivity':_0x9feea8[_0x53fa46(0x143)]??0x10,'expansionAdd':_0x9feea8[_0x53fa46(0x1fb)]??0x80,'expansionSearch':_0x9feea8['expansionSearch']??0x40,'snapshotEveryChanges':_0x9feea8[_0x53fa46(0x181)]??0xc350,'snapshotMaxLagMs':_0x9feea8[_0x53fa46(0x133)]??0x2710,'keepSnapshots':_0x9feea8[_0x53fa46(0x1ae)]??0x2,'tmpMaxAgeMs':_0x9feea8[_0x53fa46(0x1ba)]??0x6*0x36ee80,'heartbeatIntervalMs':_0x9feea8[_0x53fa46(0x1aa)]??0x1388,'writerLockMaxAgeMs':_0x9feea8[_0x53fa46(0x1c2)]??0x3a98,'viewRefreshMs':_0x9feea8[_0x53fa46(0x1cb)]??0x3e8},_0x2d2127=new _0x3bc4d0({'dir':_0x4f24e9,'keepSnapshots':_0x1c1484[_0x53fa46(0x1ae)]}),_0x518c8d=_0x198c82(_0x4f24e9,{'maxAgeMs':_0x1c1484[_0x53fa46(0x1c2)],'heartbeatMs':_0x1c1484[_0x53fa46(0x1aa)],'onLost':()=>{const _0x4260bf=_0x53fa46;_0x4ca809(_0x15cbab)[_0x4260bf(0x165)](()=>{});}});let _0x42e893=new _0x87a1ee(),_0x215c73=null,_0x36e97c=0x0,_0x16b451=null,_0x45a9d7=![],_0x3122ad=![],_0x2d2f9c=null,_0x196c81=0x0,_0x4c4965=null,_0x13eec5=0x0,_0x5c3942=![],_0x1a62d9=Promise[_0x53fa46(0x1cc)]();const _0x4ca809=_0x1847bd=>{const _0x4daf4e=_0x53fa46,_0xe0a699=_0x1a62d9[_0x4daf4e(0x142)](_0x1847bd);return _0x1a62d9=_0xe0a699['catch'](()=>{}),_0xe0a699;},_0x4efd42=()=>{try{onChange?.();}catch{}};function _0x4ab8b9(){const _0x252f62=_0x53fa46;return new _0x27032a['Index']({'dimensions':_0x486b74,'metric':_0x23f049(_0x1c1484['metric'],_0x27032a),'quantization':_0x27032a[_0x252f62(0x12d)][_0x252f62(0x139)],'connectivity':_0x1c1484[_0x252f62(0x143)],'expansion_add':_0x1c1484[_0x252f62(0x1fb)],'expansion_search':_0x1c1484[_0x252f62(0x130)],'multi':![]});}function _0x35312d(_0x58665b){return _0x58665b instanceof Float32Array?_0x58665b:new Float32Array(_0x58665b);}function _0x5c1751(){const _0x66a8a8=_0x53fa46;if(fetchAll)return fetchAll();if(_0x16b451)return _0x16b451();return Promise[_0x66a8a8(0x1cc)](null);}function _0xe2b793(_0x1c2077,_0x42adb1,_0x2fd543){const _0x46d9df=_0x53fa46,_0x5bcf65=_0x42e893[_0x46d9df(0x1a2)](_0x1c2077);if(_0x5bcf65!==undefined)try{_0x215c73[_0x46d9df(0x19d)](BigInt(_0x5bcf65));}catch{}const _0x39a909=_0x42e893[_0x46d9df(0x1e8)](_0x1c2077);_0x215c73[_0x46d9df(0x164)](BigInt(_0x39a909),_0x42adb1),_0x42e893[_0x46d9df(0x1e6)](_0x1c2077,_0x2fd543??_0xe6b816(_0x42adb1));}function _0x109561(_0x116473){const _0x27d3a7=_0x53fa46,_0x5f00e9=_0x42e893[_0x27d3a7(0x1a2)](_0x116473);if(_0x5f00e9===undefined)return![];try{_0x215c73[_0x27d3a7(0x19d)](BigInt(_0x5f00e9));}catch{}return _0x42e893['tombstone'](_0x116473),!![];}function _0x4413d3(_0x2b6025){const _0xcc845d=_0x53fa46;_0x42e893=new _0x87a1ee(),_0x215c73=_0x4ab8b9();for(const {key:_0x54ae2e,vector:_0x38e2df}of _0x2b6025??[]){if(!(_0x38e2df instanceof Float32Array)||_0x38e2df[_0xcc845d(0x1e0)]!==_0x486b74)continue;_0xe2b793(_0x54ae2e,_0x38e2df);}_0x36e97c=0x0;}function _0x2c916e(){const _0x5e686c=_0x53fa46;return Math[_0x5e686c(0x1f6)](Date['now'](),_0x2d2127[_0x5e686c(0x16d)]()+0x1);}function _0x191928(){if(_0x2d2f9c)clearTimeout(_0x2d2f9c);_0x2d2f9c=null;}function _0x2b1ac2(){const _0x2834c5=_0x53fa46;if(!_0x1c1484['snapshotMaxLagMs']||_0x2d2f9c||!_0x3122ad||_0x36e97c<=0x0)return;const _0xcd887d=Math['max'](_0x1c1484[_0x2834c5(0x133)],0xa*_0x196c81);_0x2d2f9c=setTimeout(()=>{const _0x39ee5e=_0x2834c5;_0x2d2f9c=null,_0x4ca809(async()=>{if(_0x3122ad&&_0x36e97c>0x0)await _0x233827();_0x2b1ac2(),_0x4efd42();})[_0x39ee5e(0x165)](()=>{});},_0xcd887d),_0x2d2f9c[_0x2834c5(0x150)]?.();}async function _0x233827(_0x3aa331){const _0x4cede3=_0x53fa46;if(!_0x215c73)return![];const _0x3fb2cc=_0x3aa331??_0x2c916e(),_0x1c97e6=Date[_0x4cede3(0x174)](),_0x222a3a=await _0x2d2127[_0x4cede3(0x128)](_0x3fb2cc,async _0x2256df=>{const _0x5c57d0=_0x4cede3;_0x215c73['save'](_0x2256df['index']),await _0x42e893['snapshotTo'](_0x2256df[_0x5c57d0(0x1a3)]),_0x537f62['writeFileSync'](_0x2256df[_0x5c57d0(0x172)],JSON[_0x5c57d0(0x1f0)]({'manifestVersion':_0x76bce1,'algorithm':_0x5c57d0(0x1e4),'dims':_0x486b74,'metric':_0x1c1484[_0x5c57d0(0x1c1)],'clock':_0x3fb2cc,'snapshotAt':Date[_0x5c57d0(0x174)]()},null,0x2));},{'keep':_0x1c1484['keepSnapshots']});return _0x196c81=Date[_0x4cede3(0x174)]()-_0x1c97e6,_0x222a3a?.[_0x4cede3(0x15a)]&&(_0x36e97c=0x0,_0x191928()),_0x222a3a?.[_0x4cede3(0x15a)]??![];}function _0x38e48a(){const _0x42fabd=_0x53fa46;_0x36e97c++;if(_0x36e97c>=_0x1c1484[_0x42fabd(0x181)])return _0x233827();return _0x2b1ac2(),null;}async function _0xccae2f(){const _0x3099a3=_0x53fa46,_0x419039=_0x2d2127[_0x3099a3(0x1bb)]()||_0x2d2127[_0x3099a3(0x14b)]();if(!_0x419039)return null;let _0x1be271,_0x5c5a15=![];try{await _0x2d2127[_0x3099a3(0x14d)](_0x419039,async _0x3c8ce0=>{const _0x343cd9=_0x3099a3;_0x1be271=JSON['parse'](_0x537f62['readFileSync'](_0x3c8ce0[_0x343cd9(0x172)],'utf8'));if(_0x1be271[_0x343cd9(0x17a)]!==_0x76bce1||_0x1be271['algorithm']!==_0x343cd9(0x1e4)||_0x1be271[_0x343cd9(0x1a8)]!==_0x486b74||_0x1be271[_0x343cd9(0x1c1)]!==_0x1c1484[_0x343cd9(0x1c1)]){_0x1be271=null;return;}const _0x3c7702=new _0x87a1ee();await _0x3c7702[_0x343cd9(0x191)](_0x3c8ce0[_0x343cd9(0x1a3)]);const _0x8ceb3b=_0x4ab8b9();_0x8ceb3b['load'](_0x3c8ce0[_0x343cd9(0x1b8)]),_0x42e893=_0x3c7702,_0x215c73=_0x8ceb3b,_0x5c5a15=!![];});}catch{return null;}return _0x5c5a15?_0x1be271?.['clock']??0x0:null;}async function _0x40d42f(_0x1f0de5){const _0x336fc8=_0x53fa46;_0x4c4965=null;const _0x3b0df2=await _0xccae2f();if(_0x3b0df2!=null){_0x36e97c=0x0;if(_0x1f0de5){if(!_0x42e893[_0x336fc8(0x1d8)])return _0x4413d3(_0x1f0de5),await _0x233827(),null;const _0x479eab=_0x330383(_0x42e893,_0x1f0de5,_0x486b74,{'upsert':_0xe2b793,'remove':_0x109561}),_0x3ab961=_0x479eab[_0x336fc8(0x176)]+_0x479eab[_0x336fc8(0x1d6)]+_0x479eab['removed'];_0x3ab961>0x0&&(_0x36e97c+=_0x3ab961,await _0x233827());}return _0x3b0df2;}_0x4413d3(_0x1f0de5??[]);if(_0x215c73['size']()>0x0)await _0x233827();return null;}async function _0x32f846(){_0x3122ad=!![],await _0x40d42f(await _0x5c1751());}async function _0x15cbab(){const _0x3a10c0=_0x53fa46;if(!_0x3122ad)return;_0x3122ad=![],_0x191928(),_0x36e97c=0x0;const _0x2ab60f=_0x2d2127[_0x3a10c0(0x1bb)]()||_0x2d2127[_0x3a10c0(0x14b)]();await _0x590cfd(_0x2ab60f),_0x4efd42();}async function _0x590cfd(_0x463893){const _0x249654=_0x53fa46;if(!_0x463893)return![];let _0x20c331=![];try{await _0x2d2127[_0x249654(0x14d)](_0x463893,async _0x11daf5=>{const _0x112bd1=_0x249654,_0x6cd542=JSON['parse'](_0x537f62[_0x112bd1(0x1b2)](_0x11daf5[_0x112bd1(0x172)],_0x112bd1(0x141)));if(_0x6cd542[_0x112bd1(0x17a)]!==_0x76bce1||_0x6cd542['algorithm']!=='usearch'||_0x6cd542[_0x112bd1(0x1a8)]!==_0x486b74||_0x6cd542[_0x112bd1(0x1c1)]!==_0x1c1484[_0x112bd1(0x1c1)])return;const _0x3672de=new _0x87a1ee();await _0x3672de[_0x112bd1(0x191)](_0x11daf5['labels']);const _0x5918d3=_0x4ab8b9();_0x5918d3[_0x112bd1(0x180)](_0x11daf5[_0x112bd1(0x1b8)]),_0x215c73=_0x5918d3,_0x42e893=_0x3672de,_0x4c4965=_0x463893,_0x20c331=!![];});}catch{}return _0x20c331;}function _0x5ae799(){const _0x1470a2=_0x53fa46,_0x31f653=Date[_0x1470a2(0x174)]();if(_0x31f653-_0x13eec5<_0x1c1484[_0x1470a2(0x1cb)])return;_0x13eec5=_0x31f653;if(_0x5c3942)return;if(_0x518c8d[_0x1470a2(0x1ea)]()){_0x5c3942=!![],_0x4ca809(async()=>{!_0x3122ad&&_0x45a9d7&&_0x518c8d['acquire']()&&(await _0x32f846(),_0x4efd42());})[_0x1470a2(0x165)](()=>{})[_0x1470a2(0x147)](()=>{_0x5c3942=![];});return;}const _0x376de9=_0x2d2127[_0x1470a2(0x1bb)]()||_0x2d2127[_0x1470a2(0x14b)]();if(!_0x376de9||_0x376de9===_0x4c4965)return;_0x5c3942=!![],_0x4ca809(async()=>{if(!_0x3122ad&&await _0x590cfd(_0x376de9))_0x4efd42();})[_0x1470a2(0x165)](()=>{})[_0x1470a2(0x147)](()=>{_0x5c3942=![];});}return{async 'load'(_0x1b7191){return _0x4ca809(async()=>{const _0x3ad04e=_0x3b7a;_0x2d2127[_0x3ad04e(0x1f1)]({'maxAgeMs':_0x1c1484['tmpMaxAgeMs']}),_0x16b451=_0x1b7191??null,_0x3122ad=_0x518c8d[_0x3ad04e(0x1ee)]();let _0xd43fa5=null;if(_0x3122ad)_0xd43fa5=await _0x40d42f(_0x1b7191?await _0x1b7191():null);else{const _0x253c1b=_0x2d2127[_0x3ad04e(0x1bb)]()||_0x2d2127[_0x3ad04e(0x14b)]();await _0x590cfd(_0x253c1b);}return _0x45a9d7=!![],_0xd43fa5;});},async 'add'(_0x13c5df,_0x14d73f,_0x22b24f){return _0x4ca809(async()=>{const _0x3e5bc7=_0x3b7a;if(!_0x45a9d7)return;const _0x3cb691=_0x35312d(_0x14d73f);if(!_0x3122ad){if(!_0x518c8d[_0x3e5bc7(0x1ee)]())return;await _0x32f846();}if(!_0x215c73)return;const _0x577def=_0xe6b816(_0x3cb691);if(_0x42e893['fingerprintOf'](_0x13c5df)===_0x577def)return;_0xe2b793(_0x13c5df,_0x3cb691,_0x577def),await _0x38e48a();});},async 'remove'(_0x2710a2){return _0x4ca809(async()=>{const _0x4d80be=_0x3b7a;if(!_0x45a9d7)return;if(!_0x3122ad){if(!_0x518c8d[_0x4d80be(0x1ee)]())return;await _0x32f846();}if(!_0x215c73)return;if(_0x109561(_0x2710a2))await _0x38e48a();});},'search'(_0x32e96f,{limit:limit=0xa}={}){const _0x119de3=_0x53fa46;if(!_0x3122ad&&_0x45a9d7)_0x5ae799();if(!_0x215c73)return[];const _0x49dd77=_0x215c73[_0x119de3(0x175)]();if(_0x49dd77===0x0)return[];const _0x303d28=Math[_0x119de3(0x169)](limit,_0x49dd77),_0x86e203=_0x215c73['search'](_0x35312d(_0x32e96f),_0x303d28,0x0),_0x3bca28=[],_0x30421b=_0x86e203[_0x119de3(0x1b5)],_0x224f72=_0x86e203[_0x119de3(0x1cd)];for(let _0x1c7d83=0x0;_0x1c7d83<_0x30421b['length'];_0x1c7d83++){const _0x19fd97=_0x30421b[_0x1c7d83];if(_0x19fd97===0xffffffffffffffffn)continue;const _0x95a3f5=Number(_0x19fd97),_0x45a3e9=_0x42e893[_0x119de3(0x17c)](_0x95a3f5);if(!_0x45a3e9)continue;const _0x1259e4=_0x224f72[_0x1c7d83];let _0x55a6c3;if(_0x1c1484[_0x119de3(0x1c1)]===_0x119de3(0x1cf))_0x55a6c3=Math[_0x119de3(0x1f6)](0x0,0x1-_0x1259e4);else{if(_0x1c1484[_0x119de3(0x1c1)]==='ip')_0x55a6c3=-_0x1259e4;else _0x55a6c3=0x1/(0x1+_0x1259e4);}_0x3bca28[_0x119de3(0x161)]({'key':_0x45a3e9,'score':_0x55a6c3});}return _0x3bca28;},async 'snapshot'(_0x4aea80){return _0x4ca809(()=>_0x3122ad?_0x233827(_0x4aea80??undefined):![]);},async 'rebuild'(_0x5d80fd){return _0x4ca809(async()=>{if(_0x5d80fd!=null)_0x16b451=_0x5d80fd;if(!_0x3122ad){if(!_0x518c8d['acquire']())return;_0x3122ad=!![];}const _0x439674=_0x5d80fd?await _0x5d80fd():await _0x5c1751();_0x4413d3(_0x439674??[]),_0x45a9d7=!![],await _0x233827();});},async 'stop'(){return _0x4ca809(async()=>{_0x191928();if(_0x3122ad){if(_0x36e97c>0x0||!_0x2d2127['readCurrentId']())await _0x233827();_0x518c8d['release']();}_0x3122ad=![],_0x45a9d7=![];});},'count'(){return _0x42e893['size']();},'info'(){const _0x3f3d8e=_0x53fa46;return{'algorithm':_0x3f3d8e(0x1e4),'role':_0x3122ad?_0x3f3d8e(0x194):_0x3f3d8e(0x199),'metric':_0x1c1484[_0x3f3d8e(0x1c1)],'connectivity':_0x1c1484[_0x3f3d8e(0x143)],'expansionAdd':_0x1c1484[_0x3f3d8e(0x1fb)],'expansionSearch':_0x1c1484[_0x3f3d8e(0x130)],'snapshotEveryChanges':_0x1c1484['snapshotEveryChanges'],'snapshotMaxLagMs':_0x1c1484[_0x3f3d8e(0x133)],'count':_0x42e893[_0x3f3d8e(0x175)](),'size':_0x215c73?.[_0x3f3d8e(0x175)]?.()??0x0,'capacity':_0x215c73?.['capacity']?.()??0x0,'changesSince':_0x3122ad?_0x36e97c:null,'viewedSnapshot':_0x4c4965??null,'snapshotDir':_0x4f24e9,'latestSnapshot':_0x2d2127[_0x3f3d8e(0x1bb)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x2bc72f=_0x2d7520;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x84704,workerData:_0xb46431}=require$$0$1,{algorithmName:_0x20c697,algorithmConfig:_0x104c4a,dims:_0x25aa9f,dir:_0x356614}=_0xb46431;let _0x285972=0x1;const _0x7c02ae=new Map();function _0x106602(){const _0xc8858a=_0x285972++;return new Promise((_0x3bedc0,_0x454ffd)=>{const _0x4d537c=_0x3b7a;_0x7c02ae[_0x4d537c(0x18a)](_0xc8858a,{'resolve':_0x3bedc0,'reject':_0x454ffd}),_0x84704['postMessage']({'op':'fetchAll','fid':_0xc8858a});});}const _0x491c62={'dims':_0x25aa9f,'dir':_0x356614,'fetchAll':_0x106602,'onChange':()=>_0x387960()};let _0x600e70;if(_0x20c697===_0x2bc72f(0x183))_0x600e70=requireHnsw()(_0x104c4a,_0x491c62);else{if(_0x20c697===_0x2bc72f(0x124))_0x600e70=requireFlat()(_0x104c4a,_0x491c62);else{if(_0x20c697===_0x2bc72f(0x1e4))_0x600e70=requireUsearch()(_0x104c4a,_0x491c62);else throw new Error(_0x2bc72f(0x1da)+_0x20c697+'\x22');}}function _0x387960(){const _0x13d165=_0x2bc72f;try{_0x84704['postMessage']({'op':_0x13d165(0x154),'count':_0x600e70[_0x13d165(0x140)](),'info':_0x600e70[_0x13d165(0x127)](),'memory':process[_0x13d165(0x1a4)]()});}catch{}}function _0x81b102(_0x2dd0c2){const _0x1fe71a=_0x2bc72f;return(_0x2dd0c2||[])[_0x1fe71a(0x1ab)](_0x4c352f=>({'key':_0x4c352f['key'],'vector':_0x4c352f[_0x1fe71a(0x198)]instanceof Float32Array?_0x4c352f[_0x1fe71a(0x198)]:new Float32Array(_0x4c352f[_0x1fe71a(0x198)])}));}return _0x84704['on'](_0x2bc72f(0x152),async _0x4a5734=>{const _0x407617=_0x2bc72f;if(_0x4a5734['op']===_0x407617(0x1e7)){const _0x45888a=_0x7c02ae[_0x407617(0x1c9)](_0x4a5734['fid']);if(!_0x45888a)return;_0x7c02ae[_0x407617(0x195)](_0x4a5734['fid']);if(_0x4a5734[_0x407617(0x1b0)])_0x45888a[_0x407617(0x162)](new Error(_0x4a5734['error']));else _0x45888a['resolve'](_0x81b102(_0x4a5734['vectors']));return;}const {id:_0x3f2b63,op:_0x3830a4,args:_0x37fc02}=_0x4a5734;try{let _0x4606c5;switch(_0x3830a4){case _0x407617(0x145):{_0x4606c5=await _0x600e70[_0x407617(0x145)](_0x37fc02[_0x407617(0x1a6)]?_0x106602:null),_0x387960();break;}case _0x407617(0x164):{const _0x57b38b=_0x37fc02[_0x407617(0x198)]instanceof Float32Array?_0x37fc02['vector']:new Float32Array(_0x37fc02[_0x407617(0x198)]);await _0x600e70[_0x407617(0x164)](_0x37fc02[_0x407617(0x159)],_0x57b38b,_0x37fc02[_0x407617(0x13b)]??undefined),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x19d):{await _0x600e70[_0x407617(0x19d)](_0x37fc02[_0x407617(0x159)]),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x153):{const _0x563045=_0x37fc02[_0x407617(0x16f)]instanceof Float32Array?_0x37fc02[_0x407617(0x16f)]:new Float32Array(_0x37fc02['queryVec']);_0x4606c5=_0x600e70[_0x407617(0x153)](_0x563045,_0x37fc02[_0x407617(0x197)]||{});break;}case'snapshot':{_0x4606c5=await _0x600e70['snapshot'](_0x37fc02[_0x407617(0x13b)]),_0x387960();break;}case _0x407617(0x1bd):{const _0x574f89=_0x81b102(_0x37fc02[_0x407617(0x1a5)]);await _0x600e70['rebuild'](async()=>_0x574f89),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x1e5):{await _0x600e70[_0x407617(0x1e5)](),_0x387960(),_0x4606c5=null;break;}case _0x407617(0x140):{_0x4606c5=_0x600e70[_0x407617(0x140)]();break;}case _0x407617(0x127):{_0x4606c5=_0x600e70[_0x407617(0x127)]();break;}default:throw new Error(_0x407617(0x135)+_0x3830a4+'\x22');}_0x84704[_0x407617(0x13e)]({'id':_0x3f2b63,'result':_0x4606c5});}catch(_0x2aee9d){_0x84704[_0x407617(0x13e)]({'id':_0x3f2b63,'error':{'message':_0x2aee9d?.[_0x407617(0x152)]||String(_0x2aee9d),'code':_0x2aee9d?.[_0x407617(0x131)]}});}}),_0x84704[_0x2bc72f(0x13e)]({'op':_0x2bc72f(0x1be)}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module['exports']=algorithmWorkerThread;
|
|
1
|
+
'use strict';const _0x35f0f1=_0xe4ae;(function(_0x30755a,_0x5ede62){const _0x16725e=_0xe4ae,_0x631c00=_0x30755a();while(!![]){try{const _0x1e48e0=parseInt(_0x16725e(0x105))/0x1+parseInt(_0x16725e(0x121))/0x2+-parseInt(_0x16725e(0x168))/0x3*(-parseInt(_0x16725e(0xea))/0x4)+-parseInt(_0x16725e(0xce))/0x5+-parseInt(_0x16725e(0xd8))/0x6+parseInt(_0x16725e(0x13c))/0x7*(-parseInt(_0x16725e(0x135))/0x8)+-parseInt(_0x16725e(0x17f))/0x9;if(_0x1e48e0===_0x5ede62)break;else _0x631c00['push'](_0x631c00['shift']());}catch(_0x306270){_0x631c00['push'](_0x631c00['shift']());}}}(_0x2ae0,0x261a3));var require$$0$1=require(_0x35f0f1(0x12e)),require$$0=require('fs'),require$$1=require('path'),require$$2=require('os'),require$$3=require(_0x35f0f1(0x134));function getDefaultExportFromCjs(_0x1238e8){const _0x2b31e7=_0x35f0f1;return _0x1238e8&&_0x1238e8[_0x2b31e7(0x173)]&&Object[_0x2b31e7(0xe7)][_0x2b31e7(0xcc)][_0x2b31e7(0x186)](_0x1238e8,'default')?_0x1238e8['default']:_0x1238e8;}var algorithmWorkerThread$1={},snapshotStore,hasRequiredSnapshotStore;function requireSnapshotStore(){const _0x4c698c=_0x35f0f1;if(hasRequiredSnapshotStore)return snapshotStore;hasRequiredSnapshotStore=0x1;const _0x58e704=require$$0,_0x437133=require$$1,_0x197b0b=require$$2,_0xb99a1b=require$$3;function _0x2b5ba5(){const _0x60dc56=_0xe4ae;return Date[_0x60dc56(0x113)]();}function _0xc27ee(_0x50d91d){const _0x284599=_0xe4ae;try{return _0x58e704[_0x284599(0x112)](_0x50d91d);}catch{return![];}}function _0x44add9(_0x3ba4a8){try{return _0x58e704['readFileSync'](_0x3ba4a8,'utf8');}catch{return null;}}function _0x2f58c8(_0x1e630b,_0x48ee6a){const _0x15a4ee=_0xe4ae,_0x288f70=_0x1e630b+'.tmp-'+_0xb99a1b[_0x15a4ee(0x106)](0x6)['toString'](_0x15a4ee(0x146));_0x58e704[_0x15a4ee(0x170)](_0x288f70,_0x48ee6a),_0x58e704[_0x15a4ee(0xeb)](_0x288f70,_0x1e630b);}function _0x27b57b(_0x2d6224,_0x465b8c=0x10){const _0x21831b=_0xe4ae,_0xd31589=String(Math[_0x21831b(0x172)](0x0,Math[_0x21831b(0xf1)](_0x2d6224||0x0)));return _0xd31589[_0x21831b(0x163)]>=_0x465b8c?_0xd31589:'0'[_0x21831b(0x10a)](_0x465b8c-_0xd31589[_0x21831b(0x163)])+_0xd31589;}return snapshotStore=class _0x526aa8{constructor({dir:_0x8f4abd,keepSnapshots:keepSnapshots=0x3,log:log=null}={}){const _0x51d848=_0xe4ae;if(!_0x8f4abd)throw new Error('SnapshotStore\x20requires\x20dir');this[_0x51d848(0x182)]=_0x8f4abd,this[_0x51d848(0x132)]=_0x437133[_0x51d848(0x18f)](_0x8f4abd,_0x51d848(0xd9)),this['currentPath']=_0x437133[_0x51d848(0x18f)](_0x8f4abd,_0x51d848(0xdf)),this[_0x51d848(0x12c)]=_0x437133[_0x51d848(0x18f)](_0x8f4abd,_0x51d848(0xd5)),this['keepSnapshots']=keepSnapshots,this['log']=log,_0x58e704[_0x51d848(0xef)](this[_0x51d848(0x182)],{'recursive':!![]}),_0x58e704[_0x51d848(0xef)](this['snapshotsDir'],{'recursive':!![]});}['_snapshotDir'](_0x455e8e){const _0x17d5a5=_0xe4ae;return _0x437133[_0x17d5a5(0x18f)](this[_0x17d5a5(0x132)],_0x455e8e);}[_0x4c698c(0x117)](_0x2da1ce){const _0x339a26=_0x4c698c,_0x47196c=this[_0x339a26(0xcd)](_0x2da1ce);return{'dir':_0x47196c,'index':_0x437133[_0x339a26(0x18f)](_0x47196c,_0x339a26(0xed)),'labels':_0x437133[_0x339a26(0x18f)](_0x47196c,_0x339a26(0xd2)),'state':_0x437133[_0x339a26(0x18f)](_0x47196c,_0x339a26(0x177))};}[_0x4c698c(0x197)](){const _0x306b14=_0x4c698c;if(!_0xc27ee(this[_0x306b14(0x119)]))return null;const _0x254c55=_0x44add9(this[_0x306b14(0x119)]);if(!_0x254c55)return null;const _0x4d6332=String(_0x254c55)[_0x306b14(0x152)]();return _0x4d6332||null;}[_0x4c698c(0x138)](){const _0x3c34da=_0x4c698c,_0x49cc90=this['readCurrentId']();if(!_0x49cc90)return 0x0;const _0xf0c75f=Number(_0x49cc90);return Number[_0x3c34da(0xe9)](_0xf0c75f)?_0xf0c75f:0x0;}[_0x4c698c(0x15d)](){const _0x6e9b0b=_0x4c698c;try{return _0x58e704['readdirSync'](this['snapshotsDir'],{'withFileTypes':!![]})[_0x6e9b0b(0x159)](_0x31fc30=>_0x31fc30['isDirectory']())[_0x6e9b0b(0x193)](_0x8543f6=>_0x8543f6[_0x6e9b0b(0x16b)])[_0x6e9b0b(0x159)](_0x2db6b2=>!_0x2db6b2[_0x6e9b0b(0x196)](_0x6e9b0b(0x180)))[_0x6e9b0b(0x159)](_0x487b42=>!_0x487b42[_0x6e9b0b(0x196)](_0x6e9b0b(0x15b)))[_0x6e9b0b(0x187)]();}catch{return[];}}['latestSnapshotId'](){const _0x34c806=_0x4c698c,_0x43827a=this['readCurrentId']();if(_0x43827a)return _0x43827a;const _0x12c459=this[_0x34c806(0x15d)]();if(!_0x12c459['length'])return null;return _0x12c459[_0x12c459[_0x34c806(0x163)]-0x1];}[_0x4c698c(0xc6)]({maxAgeMs:maxAgeMs=0x6*0x36ee80}={}){const _0x10a44a=_0x4c698c;let _0x55afea;try{_0x55afea=_0x58e704['readdirSync'](this[_0x10a44a(0x132)],{'withFileTypes':!![]});}catch{return;}const _0x685168=_0x2b5ba5()-maxAgeMs;for(const _0x3c44e9 of _0x55afea){if(!_0x3c44e9[_0x10a44a(0x169)]())continue;const _0x381f38=_0x3c44e9['name'];if(!_0x381f38[_0x10a44a(0x196)](_0x10a44a(0x180))&&!_0x381f38[_0x10a44a(0x196)](_0x10a44a(0x15b)))continue;const _0x50b67d=_0x437133[_0x10a44a(0x18f)](this[_0x10a44a(0x132)],_0x381f38);try{const _0x35e296=_0x58e704[_0x10a44a(0x122)](_0x50b67d);if(_0x35e296[_0x10a44a(0xec)]>_0x685168)continue;}catch{}try{_0x58e704[_0x10a44a(0x126)](_0x50b67d,{'recursive':!![],'force':!![]});}catch{}}}[_0x4c698c(0x156)]({keep:keep=null}={}){const _0x2a9f8a=_0x4c698c,_0x5d0197=Math[_0x2a9f8a(0x172)](0x1,Math[_0x2a9f8a(0xf1)](keep??this[_0x2a9f8a(0x148)]??0x3)),_0x1a6672=this['listSnapshotIds']();if(_0x1a6672[_0x2a9f8a(0x163)]<=_0x5d0197)return;const _0x5917f7=this[_0x2a9f8a(0x197)](),_0x2e7921=_0x1a6672[_0x2a9f8a(0xd6)](0x0,Math[_0x2a9f8a(0x172)](0x0,_0x1a6672[_0x2a9f8a(0x163)]-_0x5d0197));for(const _0x5cb266 of _0x2e7921){if(_0x5917f7&&_0x5cb266===_0x5917f7)continue;const _0x42e94b=this[_0x2a9f8a(0xcd)](_0x5cb266);try{_0x58e704[_0x2a9f8a(0x126)](_0x42e94b,{'recursive':!![],'force':!![]});}catch{}}}async[_0x4c698c(0x19c)](_0x193765,_0x187939){const _0x2e7df9=_0x4c698c;if(!_0x193765)throw new Error(_0x2e7df9(0x129));const _0x56cc5c=this[_0x2e7df9(0x117)](_0x193765);if(!_0xc27ee(_0x56cc5c[_0x2e7df9(0x142)])||!_0xc27ee(_0x56cc5c[_0x2e7df9(0x16a)])||!_0xc27ee(_0x56cc5c[_0x2e7df9(0x157)]))throw new Error(_0x2e7df9(0x164)+_0x193765);const _0x160de3=await _0x187939(_0x56cc5c);return _0x160de3||{};}async[_0x4c698c(0x150)](_0x566ce4,_0x51dab7,{keep:keep=null,lockTimeoutMs:lockTimeoutMs=0x0,staleLockMaxAgeMs:staleLockMaxAgeMs=0xea60}={}){const _0x188471=_0x4c698c,_0x3f1ead=Number(_0x566ce4);if(!Number[_0x188471(0xe9)](_0x3f1ead)||_0x3f1ead<0x0)throw new Error(_0x188471(0x174));const _0x51bef4=_0x27b57b(_0x3f1ead),_0x18c3a3=this[_0x188471(0xcd)](_0x51bef4),_0x1936f8=_0x437133[_0x188471(0x18f)](this[_0x188471(0x132)],_0x188471(0x180)+_0x51bef4+'-'+_0xb99a1b[_0x188471(0x106)](0x6)[_0x188471(0x108)](_0x188471(0x146)));_0x58e704['mkdirSync'](_0x1936f8,{'recursive':!![]});const _0x5724af={'dir':_0x1936f8,'index':_0x437133[_0x188471(0x18f)](_0x1936f8,_0x188471(0xed)),'labels':_0x437133['join'](_0x1936f8,_0x188471(0xd2)),'state':_0x437133[_0x188471(0x18f)](_0x1936f8,_0x188471(0x177))};await _0x51dab7(_0x5724af,{'id':_0x51bef4,'clock':_0x3f1ead});const _0xa2f651=JSON[_0x188471(0x124)]({'pid':process[_0x188471(0x162)],'host':_0x197b0b[_0x188471(0x107)](),'at':_0x2b5ba5()}),_0x3a1f01=_0x2b5ba5();let _0x10eca9=null;const _0x528401=()=>{const _0x2990ce=_0x188471;try{const _0x3bb19d=JSON[_0x2990ce(0xf0)](_0x58e704['readFileSync'](this['lockPath'],'utf8'));if(_0x3bb19d['at']&&_0x2b5ba5()-_0x3bb19d['at']>staleLockMaxAgeMs){const _0x208d9a=_0x2b5ba5()-_0x3bb19d['at'],_0x19b9be=_0x2990ce(0x179)+Math[_0x2990ce(0x16c)](_0x208d9a/0x3e8)+_0x2990ce(0x17a)+_0x3bb19d[_0x2990ce(0x162)]+',\x20host:\x20'+_0x3bb19d['host']+_0x2990ce(0xc9)+_0x2990ce(0xf7);this[_0x2990ce(0x131)]?.[_0x2990ce(0xe6)]?this[_0x2990ce(0x131)][_0x2990ce(0xe6)](_0x19b9be):console[_0x2990ce(0xe6)](_0x2990ce(0xde),_0x19b9be);try{_0x58e704[_0x2990ce(0x13b)](this[_0x2990ce(0x12c)]);}catch{}return!![];}}catch{try{_0x58e704['unlinkSync'](this[_0x2990ce(0x12c)]);}catch{}}return![];},_0x3e7563=()=>{const _0x5913d7=_0x188471;try{return _0x10eca9=_0x58e704[_0x5913d7(0x17c)](this['lockPath'],'wx'),_0x58e704[_0x5913d7(0x170)](_0x10eca9,_0xa2f651),!![];}catch(_0x242093){if(_0x242093&&_0x242093[_0x5913d7(0x10f)]==='EEXIST')return![];throw _0x242093;}};if(!_0x3e7563()){_0x528401(),_0x3e7563();if(_0x10eca9==null&&lockTimeoutMs>0x0)while(_0x2b5ba5()-_0x3a1f01<lockTimeoutMs){await new Promise(_0x41f94e=>setTimeout(_0x41f94e,0x19));if(_0x3e7563())break;_0x528401();}}if(_0x10eca9==null){try{_0x58e704['rmSync'](_0x1936f8,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':_0x188471(0x145)};}try{const _0x421795=this[_0x188471(0x138)]();if(_0x3f1ead<=_0x421795){try{_0x58e704['rmSync'](_0x1936f8,{'recursive':!![],'force':!![]});}catch{}return{'published':![],'reason':'stale','currentClock':_0x421795};}if(!_0xc27ee(_0x18c3a3))_0x58e704['renameSync'](_0x1936f8,_0x18c3a3);else try{_0x58e704[_0x188471(0x126)](_0x1936f8,{'recursive':!![],'force':!![]});}catch{}return _0x2f58c8(this[_0x188471(0x119)],_0x51bef4+'\x0a'),this[_0x188471(0x156)]({'keep':keep}),{'published':!![],'currentClock':_0x3f1ead};}finally{try{_0x58e704[_0x188471(0x18b)](_0x10eca9);}catch{}try{_0x58e704[_0x188471(0x13b)](this[_0x188471(0x12c)]);}catch{}}}},snapshotStore;}var labelMap,hasRequiredLabelMap;function requireLabelMap(){const _0x575179=_0x35f0f1;if(hasRequiredLabelMap)return labelMap;hasRequiredLabelMap=0x1;const _0x17c1fa=require$$0;class _0x57b4a6{constructor(){const _0x8bc2ac=_0xe4ae;this[_0x8bc2ac(0x171)]=new Map(),this[_0x8bc2ac(0x133)]=new Map(),this[_0x8bc2ac(0xe4)]=0x0,this['_tombstoneCount']=0x0,this[_0x8bc2ac(0x188)]=new Map(),this['hasFingerprints']=!![];}async['reset'](){const _0x2057d9=_0xe4ae;this[_0x2057d9(0x171)]=new Map(),this[_0x2057d9(0x133)]=new Map(),this[_0x2057d9(0x188)]=new Map(),this[_0x2057d9(0x184)]=!![],this[_0x2057d9(0xe4)]=0x0,this[_0x2057d9(0x100)]=0x0;}async['loadFrom'](_0x24f500){const _0x7beedd=_0xe4ae;if(!_0x24f500||!_0x17c1fa[_0x7beedd(0x112)](_0x24f500))return await this[_0x7beedd(0x139)](),!![];let _0x2af32d;try{_0x2af32d=_0x17c1fa[_0x7beedd(0xfb)](_0x24f500,'utf8');}catch{return await this[_0x7beedd(0x139)](),!![];}let _0xd66840;try{_0xd66840=JSON[_0x7beedd(0xf0)](_0x2af32d);}catch{return await this[_0x7beedd(0x139)](),!![];}const _0x53bb79=Array[_0x7beedd(0x154)](_0xd66840?.[_0x7beedd(0xf5)])?_0xd66840[_0x7beedd(0xf5)]:[],_0x26a3c8=Number['isInteger'](_0xd66840?.[_0x7beedd(0xe4)])?_0xd66840['nextLabel']:0x0,_0x3db8bf=new Map(),_0x4c02d5=new Map(),_0x476b9b=new Map(),_0x1c0e8e=_0xd66840?.[_0x7beedd(0x185)]>=0x2;let _0xff9c29=-0x1;for(const _0x274344 of _0x53bb79){if(!Array[_0x7beedd(0x154)](_0x274344)||_0x274344[_0x7beedd(0x163)]<0x2)continue;const _0x36d38f=Number(_0x274344[0x0]),_0x480298=String(_0x274344[0x1]??'');if(!Number[_0x7beedd(0x198)](_0x36d38f)||_0x36d38f<0x0)continue;if(!_0x480298)continue;_0x3db8bf['set'](_0x480298,_0x36d38f),_0x4c02d5[_0x7beedd(0xe3)](_0x36d38f,_0x480298);if(_0x1c0e8e&&typeof _0x274344[0x2]===_0x7beedd(0x16f))_0x476b9b[_0x7beedd(0xe3)](_0x480298,_0x274344[0x2]);if(_0x36d38f>_0xff9c29)_0xff9c29=_0x36d38f;}return this['keyToLabel']=_0x3db8bf,this['labelToKey']=_0x4c02d5,this['keyToFp']=_0x476b9b,this[_0x7beedd(0x184)]=_0x1c0e8e,this[_0x7beedd(0xe4)]=Math[_0x7beedd(0x172)](_0x26a3c8,_0xff9c29+0x1,0x0),this[_0x7beedd(0x100)]=0x0,!![];}[_0x575179(0xe8)](_0x5f5186){return this['keyToLabel']['get'](_0x5f5186);}[_0x575179(0x12f)](_0x58806e){const _0x52fd77=_0x575179;let _0xe67020=this[_0x52fd77(0x171)][_0x52fd77(0x19a)](_0x58806e);if(_0xe67020!==undefined)return _0xe67020;return _0xe67020=this[_0x52fd77(0xe4)]++,this[_0x52fd77(0x171)][_0x52fd77(0xe3)](_0x58806e,_0xe67020),this['labelToKey'][_0x52fd77(0xe3)](_0xe67020,_0x58806e),_0xe67020;}[_0x575179(0xf3)](_0x440665,_0x2252d8){const _0x550e47=_0x575179;if(_0x2252d8==null)this['keyToFp'][_0x550e47(0x127)](_0x440665);else this['keyToFp'][_0x550e47(0xe3)](_0x440665,_0x2252d8);}['fingerprintOf'](_0x48711c){const _0x3538fb=_0x575179;return this['keyToFp'][_0x3538fb(0x19a)](_0x48711c);}['keys'](){const _0x4a928c=_0x575179;return this[_0x4a928c(0x171)][_0x4a928c(0x15e)]();}[_0x575179(0xc5)](_0x5ae4b1){const _0x14228e=_0x575179,_0x22c094=this[_0x14228e(0x171)][_0x14228e(0x19a)](_0x5ae4b1);if(_0x22c094===undefined)return;this[_0x14228e(0x188)]['delete'](_0x5ae4b1),this['keyToLabel'][_0x14228e(0x127)](_0x5ae4b1),this['labelToKey'][_0x14228e(0x127)](_0x22c094),this['_tombstoneCount']++;}['keyForLabel'](_0x5eb0c4){const _0x2d29d6=_0x575179;return this[_0x2d29d6(0x133)][_0x2d29d6(0x19a)](_0x5eb0c4)??null;}[_0x575179(0x149)](){const _0x398d07=_0x575179;return this[_0x398d07(0x171)][_0x398d07(0x149)];}[_0x575179(0xf2)](){const _0x44e71c=_0x575179;return this[_0x44e71c(0x100)];}async[_0x575179(0x141)](_0x2ec279){const _0x49ece4=_0x575179,_0x5aa1ee=_0x2ec279+_0x49ece4(0x194),_0x3827c4=[];for(const [_0x2c0ed6,_0x1d26e4]of this[_0x49ece4(0x133)][_0x49ece4(0xf5)]()){const _0x2bbb77=this[_0x49ece4(0x188)][_0x49ece4(0x19a)](_0x1d26e4);_0x3827c4[_0x49ece4(0x17d)](_0x2bbb77==null?[_0x2c0ed6,_0x1d26e4]:[_0x2c0ed6,_0x1d26e4,_0x2bbb77]);}_0x3827c4[_0x49ece4(0x187)]((_0x11fbfd,_0x2e6ef8)=>_0x11fbfd[0x0]-_0x2e6ef8[0x0]);const _0x38368d={'version':0x2,'nextLabel':this['nextLabel'],'entries':_0x3827c4};_0x17c1fa['writeFileSync'](_0x5aa1ee,JSON[_0x49ece4(0x124)](_0x38368d)),_0x17c1fa[_0x49ece4(0xeb)](_0x5aa1ee,_0x2ec279);}}return labelMap=_0x57b4a6,labelMap;}function _0xe4ae(_0x1a1a57,_0x39b725){_0x1a1a57=_0x1a1a57-0xc5;const _0x2ae020=_0x2ae0();let _0xe4ae26=_0x2ae020[_0x1a1a57];return _0xe4ae26;}var indexConvergence,hasRequiredIndexConvergence;function requireIndexConvergence(){if(hasRequiredIndexConvergence)return indexConvergence;hasRequiredIndexConvergence=0x1;function _0x21d2bb(_0x14e4ab){const _0x24bb04=_0xe4ae,_0x25dc8e=new Uint32Array(_0x14e4ab['buffer'],_0x14e4ab[_0x24bb04(0x18c)],_0x14e4ab[_0x24bb04(0x163)]);let _0xb591d1=0x811c9dc5,_0x4afb82=0x9747b28c;for(let _0x1cfbb4=0x0;_0x1cfbb4<_0x25dc8e[_0x24bb04(0x163)];_0x1cfbb4++){const _0xcff280=_0x25dc8e[_0x1cfbb4];_0xb591d1=Math['imul'](_0xb591d1^_0xcff280,0x1000193)>>>0x0;let _0x89aee4=Math[_0x24bb04(0x10d)](_0xcff280,0xcc9e2d51);_0x89aee4=_0x89aee4<<0xf|_0x89aee4>>>0x11,_0x4afb82=Math['imul'](_0x4afb82^Math['imul'](_0x89aee4,0x1b873593),0x5)+0xe6546b64,_0x4afb82>>>=0x0;}return _0x4afb82=Math[_0x24bb04(0x10d)](_0x4afb82^_0x4afb82>>>0x10,0x85ebca6b)>>>0x0,(_0xb591d1>>>0x0)*0x100000+(_0x4afb82&0xfffff);}function _0x165598(_0x151a11,_0x24d5d8,_0x263620,{upsert:_0x33a37d,remove:_0x5b542b}){const _0x70f024=_0xe4ae,_0x58bc15=new Set();let _0x5ab63b=0x0,_0x559f5c=0x0,_0x5c9686=0x0;for(const {key:_0xb4744e,vector:_0x328137}of _0x24d5d8){if(!(_0x328137 instanceof Float32Array)||_0x328137['length']!==_0x263620)continue;_0x58bc15[_0x70f024(0xf8)](_0xb4744e);const _0x3fe479=_0x21d2bb(_0x328137),_0x27fb76=_0x151a11['labelForExisting'](_0xb4744e)!==undefined;if(_0x27fb76&&_0x151a11[_0x70f024(0x10b)](_0xb4744e)===_0x3fe479)continue;_0x33a37d(_0xb4744e,_0x328137,_0x3fe479);if(_0x27fb76)_0x559f5c++;else _0x5ab63b++;}for(const _0x47bc92 of[..._0x151a11['keys']()]){if(_0x58bc15[_0x70f024(0x123)](_0x47bc92))continue;_0x5b542b(_0x47bc92),_0x5c9686++;}return{'added':_0x5ab63b,'changed':_0x559f5c,'removed':_0x5c9686};}return indexConvergence={'fingerprint':_0x21d2bb,'reconcileIndex':_0x165598},indexConvergence;}function _0x2ae0(){const _0x2384d4=['expansionSearch','currentPath','loadFrom','capacity','distances','added','getMaxElements','readIndexSync','growFactor','516332KhUtwr','statSync','has','stringify','node','rmSync','delete','writerLockMaxAgeMs','snapshot\x20id\x20required','sqrt','unref','lockPath','catch','worker_threads','labelForEphemeral','dims','log','snapshotsDir','labelToKey','crypto','1040376PdbtxK','unreadable','usearch\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','readCurrentClock','reset','snapshotEveryChanges','unlinkSync','7aBeMRa','finally','key','snapshotMaxLagMs','algorithm','snapshotTo','index','writeIndexSync','reject','lock_busy','hex','HNSW_BINDINGS_UNAVAILABLE','keepSnapshots','size','HierarchicalNSW','ready','load','getCurrentCount','reader','count','publishSnapshot','cosine','trim','flat','isArray','release','prune','state','HNSW\x20algorithm\x20unavailable:\x20the\x20native\x20\x22hnswlib-node\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','filter','hasRows','_tmp-','L2sq','listSnapshotIds','keys','ceil','postMessage','Original\x20error:\x20','pid','length','snapshot\x20incomplete:\x20','cause','\x20on\x20','vectors','69Epfprt','isDirectory','labels','name','round','hnswlib-node','latestSnapshotId','number','writeFileSync','keyToLabel','max','__esModule','candidateClock\x20must\x20be\x20finite\x20>=\x200','snapshot','MetricKind','state.json','viewRefreshMs','Breaking\x20stale\x20snapshot\x20lock\x20(age:\x20','s,\x20pid:\x20','acquire','openSync','push','efConstruction','1838916ETXsTw','.tmp-','exports','dir','changed','hasFingerprints','version','call','sort','keyToFp','fetchAll','manifestVersion','closeSync','byteOffset','then','memoryUsage','join','message','stop','Unknown\x20op:\x20\x22','map','.tmp','Unknown\x20algorithm:\x20\x22','startsWith','readCurrentId','isInteger','min','get','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22\x20instead.\x20','loadSnapshot','setEf','ENOENT','resizeIndex','tombstone','cleanupTmpDirs','fetchAllResult','keyForLabel',').\x20','addPoint','clock','hasOwnProperty','_snapshotDir','305770UIMAZY','writer','hnsw\x20algorithm\x20requires\x20dims\x20>\x200','usearch\x20algorithm\x20unavailable:\x20the\x20native\x20\x22usearch\x22\x20bindings\x20could\x20not\x20be\x20loaded\x20','labels.json','heartbeatIntervalMs','utf8','SNAPSHOT.LOCK','slice','hnsw','725772RtrxAZ','snapshots','vector','initIndex','resolve','from','[SnapshotStore]','CURRENT','token','connectivity','WRITER.LOCK','set','nextLabel','for\x20Node\x20','warn','prototype','labelForExisting','isFinite','47924EZtCoA','renameSync','mtimeMs','index.hnsw','hnsw\x20algorithm\x20requires\x20dir\x20for\x20snapshot\x20storage','mkdirSync','parse','trunc','tombstoneCount','setFingerprint','sync','entries','metric','This\x20is\x20risky\x20on\x20slow\x20disks\x20or\x20overloaded\x20machines.\x20Consider\x20increasing\x20staleLockMaxAgeMs\x20if\x20this\x20happens\x20frequently.','add','queryVec','tmpMaxAgeMs','readFileSync','rebuild','remove','search','efSearch','_tombstoneCount','markDelete','Install\x20compatible\x20bindings\x20or\x20use\x20algorithm\x20\x22flat\x22/\x22hnsw\x22\x20instead.\x20','published','expansionAdd','138825MjiJiv','randomBytes','hostname','toString','clear','repeat','fingerprintOf','searchKnn','imul','error','code','maxElements','info','existsSync','now','Cos','usearch','score','_snapshotPaths'];_0x2ae0=function(){return _0x2384d4;};return _0x2ae0();}var hnsw,hasRequiredHnsw;function requireHnsw(){if(hasRequiredHnsw)return hnsw;hasRequiredHnsw=0x1;const _0x3cd421=requireSnapshotStore(),_0x3db4a0=requireLabelMap(),{fingerprint:_0x308f08,reconcileIndex:_0x52768b}=requireIndexConvergence(),_0x23807f=0x1;let _0x108b83=null;function _0x1cc11e(){const _0x3004bf=_0xe4ae;if(_0x108b83)return _0x108b83;try{return _0x108b83=require(_0x3004bf(0x16d)),_0x108b83;}catch(_0x44e4a6){const _0x26814a=new Error(_0x3004bf(0x158)+('for\x20Node\x20'+process['versions'][_0x3004bf(0x125)]+_0x3004bf(0x166)+process['platform']+'/'+process['arch']+'.\x20')+_0x3004bf(0x19b)+(_0x3004bf(0x161)+(_0x44e4a6?.[_0x3004bf(0x190)]||String(_0x44e4a6))));_0x26814a['code']=_0x3004bf(0x147),_0x26814a[_0x3004bf(0x165)]=_0x44e4a6;throw _0x26814a;}}return hnsw=function _0x15eddc(_0x53acca={},{dims:_0x2607b8,dir:_0x50a61c}){const _0x1cd2b7=_0xe4ae,_0x4b7dd4=_0x1cc11e();if(!_0x2607b8||_0x2607b8<=0x0)throw new Error(_0x1cd2b7(0xd0));if(!_0x50a61c)throw new Error(_0x1cd2b7(0xee));const _0x3ee761={'metric':_0x53acca[_0x1cd2b7(0xf6)]??'cosine','M':_0x53acca['M']??0x10,'efConstruction':_0x53acca[_0x1cd2b7(0x17e)]??0xc8,'efSearch':_0x53acca[_0x1cd2b7(0xff)]??0x40,'maxElements':_0x53acca[_0x1cd2b7(0x110)]??0x400,'growFactor':_0x53acca[_0x1cd2b7(0x120)]??0x2,'snapshotEveryChanges':_0x53acca['snapshotEveryChanges']??0xc350,'keepSnapshots':_0x53acca[_0x1cd2b7(0x148)]??0x2,'tmpMaxAgeMs':_0x53acca[_0x1cd2b7(0xfa)]??0x6*0x36ee80},_0x41f5a3=new _0x3cd421({'dir':_0x50a61c,'keepSnapshots':_0x3ee761[_0x1cd2b7(0x148)]}),_0x5d674d=new _0x3db4a0();let _0x2b5b30=null,_0x4607c6=0x0,_0x35d06a=null,_0x164e65=Promise['resolve']();const _0x1b7073=_0xb323e0=>{const _0x2fb75c=_0x1cd2b7,_0x502a24=_0x164e65[_0x2fb75c(0x18d)](_0xb323e0);return _0x164e65=_0x502a24[_0x2fb75c(0x12d)](()=>{}),_0x502a24;};async function _0x5191c6(_0x273f35){const _0xd3bfd=_0x1cd2b7;await _0x5d674d[_0xd3bfd(0x139)](),_0x273f35=_0x273f35??[];const _0x48ca2f=Math['max'](_0x3ee761[_0xd3bfd(0x110)],Math[_0xd3bfd(0x15f)](_0x273f35['length']*(_0x3ee761[_0xd3bfd(0x120)]||1.2)),0x1);_0x2b5b30=new _0x4b7dd4[(_0xd3bfd(0x14a))](_0x3ee761[_0xd3bfd(0xf6)],_0x2607b8),_0x2b5b30[_0xd3bfd(0xdb)]({'maxElements':_0x48ca2f,'efConstruction':_0x3ee761[_0xd3bfd(0x17e)],'M':_0x3ee761['M']});for(const {key:_0x4fb285,vector:_0x21193d}of _0x273f35){if(!(_0x21193d instanceof Float32Array)||_0x21193d[_0xd3bfd(0x163)]!==_0x2607b8)continue;_0xa79734(_0x4fb285,_0x21193d);}_0x2b5b30['setEf'](_0x3ee761[_0xd3bfd(0xff)]),_0x4607c6=0x0;}async function _0x1cb9f6(_0x3a83d0){return _0x5191c6(_0x3a83d0?await _0x3a83d0():[]);}function _0x20ee83(){const _0xc08256=_0x1cd2b7;if(_0x2b5b30['getCurrentCount']()<_0x2b5b30[_0xc08256(0x11e)]())return;const _0x4120d0=Math[_0xc08256(0x15f)](_0x2b5b30[_0xc08256(0x11e)]()*(_0x3ee761[_0xc08256(0x120)]||0x2));_0x2b5b30[_0xc08256(0x19f)](_0x4120d0),_0x3ee761[_0xc08256(0x110)]=_0x4120d0;}function _0xa79734(_0x124c07,_0x4cdc74,_0x3abfde){const _0x1817d0=_0x1cd2b7,_0xd30bba=_0x5d674d[_0x1817d0(0x12f)](_0x124c07);try{_0x2b5b30[_0x1817d0(0x101)](_0xd30bba);}catch{}_0x20ee83(),_0x2b5b30[_0x1817d0(0xca)](Array[_0x1817d0(0xdd)](_0x4cdc74),_0xd30bba),_0x5d674d[_0x1817d0(0xf3)](_0x124c07,_0x3abfde??_0x308f08(_0x4cdc74));}function _0x13c972(_0x150a74){const _0x418e94=_0x1cd2b7,_0x2d53fc=_0x5d674d[_0x418e94(0xe8)](_0x150a74);if(_0x2d53fc===undefined)return![];try{_0x2b5b30['markDelete'](_0x2d53fc);}catch{}return _0x5d674d[_0x418e94(0xc5)](_0x150a74),!![];}function _0x5b5b0a(){const _0x400e7f=_0x1cd2b7;return Math[_0x400e7f(0x172)](Date[_0x400e7f(0x113)](),_0x41f5a3[_0x400e7f(0x138)]()+0x1);}async function _0x32aa97(_0x3ec0da){const _0x18bc98=_0x1cd2b7;if(!_0x2b5b30||!_0x3ec0da)return![];const _0x52a95a=await _0x41f5a3['publishSnapshot'](_0x3ec0da,async _0x149666=>{const _0x31b8ee=_0xe4ae;_0x2b5b30[_0x31b8ee(0x143)](_0x149666[_0x31b8ee(0x142)]),await _0x5d674d['snapshotTo'](_0x149666[_0x31b8ee(0x16a)]);const _0x4f7830=require$$0;_0x4f7830[_0x31b8ee(0x170)](_0x149666[_0x31b8ee(0x157)],JSON[_0x31b8ee(0x124)]({'manifestVersion':_0x23807f,'dims':_0x2607b8,'metric':_0x3ee761[_0x31b8ee(0xf6)],'clock':_0x3ec0da,'snapshotAt':Date[_0x31b8ee(0x113)]()},null,0x2));},{'keep':_0x3ee761[_0x18bc98(0x148)]});if(_0x52a95a?.[_0x18bc98(0x103)])_0x4607c6=0x0;return _0x52a95a?.[_0x18bc98(0x103)]??![];}async function _0x5efa06(){const _0x59f3fe=_0x1cd2b7,_0x5bcc55=_0x41f5a3[_0x59f3fe(0x197)]()||_0x41f5a3[_0x59f3fe(0x16e)]();if(!_0x5bcc55)return null;let _0x28e6bf,_0x50480e=![];return await _0x41f5a3[_0x59f3fe(0x19c)](_0x5bcc55,async _0x1d7dd1=>{const _0xafad80=_0x59f3fe,_0x5328bc=require$$0;_0x28e6bf=JSON[_0xafad80(0xf0)](_0x5328bc[_0xafad80(0xfb)](_0x1d7dd1[_0xafad80(0x157)],_0xafad80(0xd4)));if(_0x28e6bf[_0xafad80(0x18a)]!==_0x23807f||_0x28e6bf[_0xafad80(0x130)]!==_0x2607b8||_0x28e6bf['metric']!==_0x3ee761[_0xafad80(0xf6)]){_0x28e6bf=null;return;}await _0x5d674d[_0xafad80(0x11a)](_0x1d7dd1['labels']),_0x2b5b30=new _0x4b7dd4[(_0xafad80(0x14a))](_0x3ee761[_0xafad80(0xf6)],_0x2607b8),_0x2b5b30[_0xafad80(0x11f)](_0x1d7dd1[_0xafad80(0x142)]),_0x2b5b30['setEf'](_0x3ee761[_0xafad80(0xff)]),_0x50480e=!![];}),_0x50480e?_0x28e6bf?.[_0x59f3fe(0xcb)]??0x0:null;}return{async 'load'(_0x288c17){return _0x1b7073(async()=>{const _0x1c6445=_0xe4ae;_0x41f5a3[_0x1c6445(0xc6)]({'maxAgeMs':_0x3ee761[_0x1c6445(0xfa)]}),_0x35d06a=_0x288c17??null;const _0x313ae6=await _0x5efa06(),_0x18a837=_0x288c17?await _0x288c17():null;if(_0x313ae6!=null){if(_0x18a837){if(!_0x5d674d[_0x1c6445(0x184)])return await _0x5191c6(_0x18a837),null;const _0x27a6fd=_0x52768b(_0x5d674d,_0x18a837,_0x2607b8,{'upsert':_0xa79734,'remove':_0x13c972});_0x4607c6+=_0x27a6fd[_0x1c6445(0x11d)]+_0x27a6fd[_0x1c6445(0x183)]+_0x27a6fd['removed'];}return _0x313ae6;}return await _0x5191c6(_0x18a837),null;});},async 'add'(_0x1f934a,_0x14bd31,_0x232dad){return _0x1b7073(async()=>{const _0x29f1e1=_0xe4ae;if(!_0x2b5b30)return;const _0x511bdf=_0x14bd31 instanceof Float32Array?_0x14bd31:new Float32Array(_0x14bd31),_0x5ad021=_0x308f08(_0x511bdf);if(_0x5d674d[_0x29f1e1(0x10b)](_0x1f934a)===_0x5ad021)return;_0xa79734(_0x1f934a,_0x511bdf,_0x5ad021),_0x4607c6++,_0x4607c6>=_0x3ee761[_0x29f1e1(0x13a)]&&await _0x32aa97(_0x5b5b0a());});},async 'remove'(_0x225cb2){return _0x1b7073(async()=>{if(!_0x2b5b30)return;if(_0x13c972(_0x225cb2))_0x4607c6++;});},'search'(_0x2132f4,{limit:limit=0xa,efSearch:_0x170b14}={}){const _0x472589=_0x1cd2b7;if(!_0x2b5b30)return[];if(Number[_0x472589(0x198)](_0x170b14))_0x2b5b30[_0x472589(0x19d)](_0x170b14);const _0x23161f=Math[_0x472589(0x199)](limit,_0x2b5b30[_0x472589(0x14d)]()||0x1),{neighbors:_0x1b1863,distances:_0x38b8ce}=_0x2b5b30[_0x472589(0x10c)](Array[_0x472589(0xdd)](_0x2132f4),_0x23161f),_0x38425a=[];for(let _0x53a497=0x0;_0x53a497<_0x1b1863[_0x472589(0x163)];_0x53a497++){const _0x2e7ed=_0x5d674d[_0x472589(0xc8)](_0x1b1863[_0x53a497]);if(!_0x2e7ed)continue;const _0x214041=_0x3ee761[_0x472589(0xf6)]===_0x472589(0x151)?Math['max'](0x0,0x1-_0x38b8ce[_0x53a497]):0x1/(0x1+_0x38b8ce[_0x53a497]);_0x38425a[_0x472589(0x17d)]({'key':_0x2e7ed,'score':_0x214041});}return _0x38425a;},async 'snapshot'(_0xab50d8){return _0x1b7073(()=>_0x32aa97(_0xab50d8??_0x5b5b0a()));},async 'rebuild'(_0x377bc8){return _0x1b7073(()=>{if(_0x377bc8!=null)_0x35d06a=_0x377bc8;return _0x1cb9f6(_0x377bc8??_0x35d06a);});},async 'stop'(){const _0x444a76=_0x1cd2b7;return _0x1b7073(()=>_0x4607c6>0x0||!_0x41f5a3[_0x444a76(0x197)]()?_0x32aa97(_0x5b5b0a()):![]);},'count'(){return _0x5d674d['size']();},'info'(){const _0x361a8e=_0x1cd2b7;return{'algorithm':'hnsw','metric':_0x3ee761[_0x361a8e(0xf6)],'M':_0x3ee761['M'],'efConstruction':_0x3ee761[_0x361a8e(0x17e)],'efSearch':_0x3ee761[_0x361a8e(0xff)],'maxElements':_0x2b5b30?.[_0x361a8e(0x11e)]()??_0x3ee761['maxElements'],'count':_0x5d674d[_0x361a8e(0x149)](),'changesSince':_0x4607c6,'snapshotDir':_0x50a61c,'latestSnapshot':_0x41f5a3[_0x361a8e(0x197)]()??null};}};},hnsw;}var flat,hasRequiredFlat;function requireFlat(){if(hasRequiredFlat)return flat;hasRequiredFlat=0x1,flat=function _0x8dc52d(_0x3f823d={}){const _0x5d2111=new Map();return{async 'load'(_0x53b1ee){const _0x2d5451=_0xe4ae;_0x5d2111[_0x2d5451(0x109)]();if(_0x53b1ee)for(const {key:_0x4742eb,vector:_0x271aef}of await _0x53b1ee()){_0x5d2111[_0x2d5451(0xe3)](_0x4742eb,_0x271aef);}},async 'add'(_0x507265,_0x4a056e,_0x243de2){const _0x364997=_0xe4ae;_0x5d2111[_0x364997(0xe3)](_0x507265,_0x4a056e);},async 'remove'(_0x2b914c){const _0x4aa3d3=_0xe4ae;_0x5d2111[_0x4aa3d3(0x127)](_0x2b914c);},'search'(_0x27c2b0,{limit:limit=0xa,threshold:threshold=0x0}={}){const _0x2b1de2=_0xe4ae,_0x32ed97=[];for(const [_0xd291ff,_0x172e45]of _0x5d2111){const _0x1da5a6=_0x5a558d(_0x27c2b0,_0x172e45);if(_0x1da5a6>=threshold)_0x32ed97[_0x2b1de2(0x17d)]({'key':_0xd291ff,'score':_0x1da5a6});}return _0x32ed97[_0x2b1de2(0x187)]((_0x43cdd2,_0x486cfd)=>_0x486cfd[_0x2b1de2(0x116)]-_0x43cdd2[_0x2b1de2(0x116)]),_0x32ed97[_0x2b1de2(0xd6)](0x0,limit);},async 'snapshot'(){return![];},async 'rebuild'(_0x5878a0){await this['load'](_0x5878a0);},async 'stop'(){},'count'(){return _0x5d2111['size'];},'info'(){const _0x97b235=_0xe4ae;return{'algorithm':_0x97b235(0x153),'count':_0x5d2111[_0x97b235(0x149)]};}};};function _0x5a558d(_0x46fa35,_0x1130df){const _0x7bdddf=_0xe4ae;let _0x4711da=0x0,_0x46f3c2=0x0,_0x399ce5=0x0;for(let _0x2caf17=0x0;_0x2caf17<_0x46fa35[_0x7bdddf(0x163)];_0x2caf17++){_0x4711da+=_0x46fa35[_0x2caf17]*_0x1130df[_0x2caf17],_0x46f3c2+=_0x46fa35[_0x2caf17]*_0x46fa35[_0x2caf17],_0x399ce5+=_0x1130df[_0x2caf17]*_0x1130df[_0x2caf17];}const _0x6d460a=Math[_0x7bdddf(0x12a)](_0x46f3c2)*Math[_0x7bdddf(0x12a)](_0x399ce5);return _0x6d460a===0x0?0x0:_0x4711da/_0x6d460a;}return flat;}var writerLock,hasRequiredWriterLock;function requireWriterLock(){if(hasRequiredWriterLock)return writerLock;hasRequiredWriterLock=0x1;const _0x4240da=require$$0,_0x36f9ea=require$$1,_0xacc17f=require$$3;return writerLock=function _0x349204(_0x26c817,{maxAgeMs:maxAgeMs=0x3a98,heartbeatMs:heartbeatMs=0x1388,onLost:onLost=null}={}){const _0x3809af=_0xe4ae,_0x5a6dd0=_0x36f9ea['join'](_0x26c817,_0x3809af(0xe2)),_0x314893=_0xacc17f[_0x3809af(0x106)](0x8)[_0x3809af(0x108)](_0x3809af(0x146));let _0x2744bb=![],_0x4aa978=null;const _0x464c7b=()=>JSON[_0x3809af(0x124)]({'pid':process[_0x3809af(0x162)],'token':_0x314893,'at':Date[_0x3809af(0x113)]()});function _0x4bb962(){const _0xf707dc=_0x3809af;try{return JSON[_0xf707dc(0xf0)](_0x4240da[_0xf707dc(0xfb)](_0x5a6dd0,_0xf707dc(0xd4)));}catch(_0x1b1a9b){return _0x1b1a9b?.[_0xf707dc(0x10f)]===_0xf707dc(0x19e)?null:{'unreadable':!![]};}}function _0x1bc780(){const _0xec8616=_0x3809af;try{const _0x46739a=_0x4240da[_0xec8616(0x17c)](_0x5a6dd0,'wx');try{_0x4240da[_0xec8616(0x170)](_0x46739a,_0x464c7b());}finally{_0x4240da[_0xec8616(0x18b)](_0x46739a);}return!![];}catch(_0x2d1fc5){if(_0x2d1fc5?.[_0xec8616(0x10f)]==='EEXIST')return![];throw _0x2d1fc5;}}function _0x132e1e(_0x46f63d){const _0x18be1c=_0x3809af;if(!_0x46f63d)return!![];if(_0x46f63d['unreadable'])return!![];return Date[_0x18be1c(0x113)]()-(_0x46f63d['at']??0x0)>=maxAgeMs;}function _0x5d8c61(){if(_0x4aa978)clearInterval(_0x4aa978);_0x4aa978=null;}function _0x3e7d77(){const _0x1e6b5c=_0x3809af;_0x5d8c61(),_0x4aa978=setInterval(()=>{const _0x11ecee=_0xe4ae,_0x7d4be7=_0x4bb962();if(_0x7d4be7&&!_0x7d4be7[_0x11ecee(0x136)]&&_0x7d4be7[_0x11ecee(0xe0)]!==_0x314893){_0x2744bb=![],_0x5d8c61();try{onLost?.();}catch{}return;}try{_0x4240da[_0x11ecee(0x170)](_0x5a6dd0,_0x464c7b());}catch{}},heartbeatMs),_0x4aa978[_0x1e6b5c(0x12b)]?.();}function _0x397179(){const _0x5edde3=_0x3809af,_0x4a0f08=_0x4bb962();return!!_0x4a0f08&&_0x4a0f08[_0x5edde3(0xe0)]===_0x314893;}return{'path':_0x5a6dd0,'token':_0x314893,'acquire'(){const _0x158930=_0x3809af,_0x5515b8=_0x4bb962();if(_0x5515b8&&_0x5515b8[_0x158930(0xe0)]===_0x314893){_0x2744bb=!![];if(!_0x4aa978)_0x3e7d77();return!![];}let _0x7b8616=_0x1bc780();if(!_0x7b8616&&_0x132e1e(_0x4bb962())){try{_0x4240da[_0x158930(0x13b)](_0x5a6dd0);}catch{}_0x7b8616=_0x1bc780();}if(_0x7b8616&&!_0x397179())_0x7b8616=![];_0x2744bb=_0x7b8616;if(_0x7b8616)_0x3e7d77();return _0x7b8616;},'held'(){return _0x2744bb;},'isFree'(){const _0x23e731=_0x4bb962();if(_0x23e731&&_0x23e731['token']===_0x314893)return![];return _0x132e1e(_0x23e731);},'release'(){const _0x53ef85=_0x3809af;_0x5d8c61();if(!_0x2744bb)return;_0x2744bb=![];if(_0x397179())try{_0x4240da[_0x53ef85(0x13b)](_0x5a6dd0);}catch{}}};},writerLock;}var usearch,hasRequiredUsearch;function requireUsearch(){if(hasRequiredUsearch)return usearch;hasRequiredUsearch=0x1;const _0x2da06a=require$$0,_0x37fe5e=requireSnapshotStore(),_0x334b8c=requireLabelMap(),_0x2e2346=requireWriterLock(),{fingerprint:_0xbaced6,reconcileIndex:_0x4f1bff}=requireIndexConvergence(),_0x4012c1=0x1;let _0x56c324=null;function _0x2d9e71(){const _0x395546=_0xe4ae;if(_0x56c324)return _0x56c324;try{return _0x56c324=require('usearch'),_0x56c324;}catch(_0x4a9b26){const _0x545d21=new Error(_0x395546(0xd1)+(_0x395546(0xe5)+process['versions']['node']+'\x20on\x20'+process['platform']+'/'+process['arch']+'.\x20')+_0x395546(0x102)+('Original\x20error:\x20'+(_0x4a9b26?.[_0x395546(0x190)]||String(_0x4a9b26))));_0x545d21[_0x395546(0x10f)]='USEARCH_BINDINGS_UNAVAILABLE',_0x545d21[_0x395546(0x165)]=_0x4a9b26;throw _0x545d21;}}function _0x2d9839(_0x103e2a,_0x14ceeb){const _0x57f222=_0xe4ae;switch(_0x103e2a){case _0x57f222(0x151):return _0x14ceeb[_0x57f222(0x176)][_0x57f222(0x114)];case'l2':return _0x14ceeb[_0x57f222(0x176)][_0x57f222(0x15c)];case'ip':return _0x14ceeb[_0x57f222(0x176)]['IP'];default:return _0x14ceeb[_0x57f222(0x176)][_0x57f222(0x114)];}}return usearch=function _0x16cc0c(_0x1c135e={},{dims:_0x36c9d7,dir:_0x2809c9,fetchAll:fetchAll=null,onChange:onChange=null}={}){const _0x34dcee=_0xe4ae,_0x162ef9=_0x2d9e71();if(!_0x36c9d7||_0x36c9d7<=0x0)throw new Error('usearch\x20algorithm\x20requires\x20dims\x20>\x200');if(!_0x2809c9)throw new Error(_0x34dcee(0x137));const _0x310fd8={'metric':_0x1c135e[_0x34dcee(0xf6)]??_0x34dcee(0x151),'connectivity':_0x1c135e['connectivity']??0x10,'expansionAdd':_0x1c135e[_0x34dcee(0x104)]??0x80,'expansionSearch':_0x1c135e['expansionSearch']??0x40,'snapshotEveryChanges':_0x1c135e[_0x34dcee(0x13a)]??0xc350,'snapshotMaxLagMs':_0x1c135e[_0x34dcee(0x13f)]??0x2710,'keepSnapshots':_0x1c135e['keepSnapshots']??0x2,'tmpMaxAgeMs':_0x1c135e['tmpMaxAgeMs']??0x6*0x36ee80,'heartbeatIntervalMs':_0x1c135e[_0x34dcee(0xd3)]??0x1388,'writerLockMaxAgeMs':_0x1c135e['writerLockMaxAgeMs']??0x3a98,'viewRefreshMs':_0x1c135e[_0x34dcee(0x178)]??0x3e8},_0x3abaff=new _0x37fe5e({'dir':_0x2809c9,'keepSnapshots':_0x310fd8['keepSnapshots']}),_0x3707d1=_0x2e2346(_0x2809c9,{'maxAgeMs':_0x310fd8[_0x34dcee(0x128)],'heartbeatMs':_0x310fd8['heartbeatIntervalMs'],'onLost':()=>{const _0x1b31d9=_0x34dcee;_0x5e0290(_0x9a07b)[_0x1b31d9(0x12d)](()=>{});}});let _0x34b18e=new _0x334b8c(),_0x5c030a=null,_0x46b8c6=0x0,_0x5cb5f4=null,_0x419aee=![],_0x49b234=![],_0x4ed5dd=null,_0x18dd03=0x0,_0x913595=null,_0x9828cb=0x0,_0x575d4d=![],_0x4c2a03=Promise['resolve']();const _0x5e0290=_0x4fd552=>{const _0x28a198=_0x34dcee,_0x336721=_0x4c2a03[_0x28a198(0x18d)](_0x4fd552);return _0x4c2a03=_0x336721[_0x28a198(0x12d)](()=>{}),_0x336721;},_0x3795c4=()=>{try{onChange?.();}catch{}};function _0x3afa2e(){const _0x47bf58=_0x34dcee;return new _0x162ef9['Index']({'dimensions':_0x36c9d7,'metric':_0x2d9839(_0x310fd8[_0x47bf58(0xf6)],_0x162ef9),'quantization':_0x162ef9['ScalarKind']['F32'],'connectivity':_0x310fd8[_0x47bf58(0xe1)],'expansion_add':_0x310fd8[_0x47bf58(0x104)],'expansion_search':_0x310fd8[_0x47bf58(0x118)],'multi':![]});}function _0xb1ac1(_0x4ee966){return _0x4ee966 instanceof Float32Array?_0x4ee966:new Float32Array(_0x4ee966);}function _0x5db444(){if(fetchAll)return fetchAll();if(_0x5cb5f4)return _0x5cb5f4();return Promise['resolve'](null);}function _0x102ea8(_0xd0f281,_0x904f4c,_0x330b25){const _0x2d34cf=_0x34dcee,_0x1bcdc0=_0x34b18e[_0x2d34cf(0xe8)](_0xd0f281);if(_0x1bcdc0!==undefined)try{_0x5c030a[_0x2d34cf(0xfd)](BigInt(_0x1bcdc0));}catch{}const _0x2acaa4=_0x34b18e['labelForEphemeral'](_0xd0f281);_0x5c030a[_0x2d34cf(0xf8)](BigInt(_0x2acaa4),_0x904f4c),_0x34b18e['setFingerprint'](_0xd0f281,_0x330b25??_0xbaced6(_0x904f4c));}function _0x4f272b(_0x18d26b){const _0x23c553=_0x34dcee,_0x2a365c=_0x34b18e[_0x23c553(0xe8)](_0x18d26b);if(_0x2a365c===undefined)return![];try{_0x5c030a[_0x23c553(0xfd)](BigInt(_0x2a365c));}catch{}return _0x34b18e[_0x23c553(0xc5)](_0x18d26b),!![];}function _0x3f1d62(_0x347ba7){const _0x17f7c5=_0x34dcee;_0x34b18e=new _0x334b8c(),_0x5c030a=_0x3afa2e();for(const {key:_0x119595,vector:_0x58a139}of _0x347ba7??[]){if(!(_0x58a139 instanceof Float32Array)||_0x58a139[_0x17f7c5(0x163)]!==_0x36c9d7)continue;_0x102ea8(_0x119595,_0x58a139);}_0x46b8c6=0x0;}function _0x39a698(){const _0x4c2149=_0x34dcee;return Math[_0x4c2149(0x172)](Date[_0x4c2149(0x113)](),_0x3abaff[_0x4c2149(0x138)]()+0x1);}function _0x44cda1(){if(_0x4ed5dd)clearTimeout(_0x4ed5dd);_0x4ed5dd=null;}function _0x52b75c(){const _0x13320e=_0x34dcee;if(!_0x310fd8['snapshotMaxLagMs']||_0x4ed5dd||!_0x49b234||_0x46b8c6<=0x0)return;const _0x199c22=Math['max'](_0x310fd8[_0x13320e(0x13f)],0xa*_0x18dd03);_0x4ed5dd=setTimeout(()=>{const _0x669a92=_0x13320e;_0x4ed5dd=null,_0x5e0290(async()=>{if(_0x49b234&&_0x46b8c6>0x0)await _0x209feb();_0x52b75c(),_0x3795c4();})[_0x669a92(0x12d)](()=>{});},_0x199c22),_0x4ed5dd['unref']?.();}async function _0x209feb(_0x142376){const _0x2c0261=_0x34dcee;if(!_0x5c030a)return![];const _0x147b10=_0x142376??_0x39a698(),_0x3d31b9=Date[_0x2c0261(0x113)](),_0x1bd71f=await _0x3abaff['publishSnapshot'](_0x147b10,async _0x42b19e=>{const _0x20e2eb=_0x2c0261;_0x5c030a['save'](_0x42b19e['index']),await _0x34b18e[_0x20e2eb(0x141)](_0x42b19e[_0x20e2eb(0x16a)]),_0x2da06a[_0x20e2eb(0x170)](_0x42b19e[_0x20e2eb(0x157)],JSON['stringify']({'manifestVersion':_0x4012c1,'algorithm':_0x20e2eb(0x115),'dims':_0x36c9d7,'metric':_0x310fd8[_0x20e2eb(0xf6)],'clock':_0x147b10,'snapshotAt':Date['now']()},null,0x2));},{'keep':_0x310fd8['keepSnapshots']});return _0x18dd03=Date[_0x2c0261(0x113)]()-_0x3d31b9,_0x1bd71f?.[_0x2c0261(0x103)]&&(_0x46b8c6=0x0,_0x44cda1()),_0x1bd71f?.[_0x2c0261(0x103)]??![];}function _0x57fb93(){const _0x3818aa=_0x34dcee;_0x46b8c6++;if(_0x46b8c6>=_0x310fd8[_0x3818aa(0x13a)])return _0x209feb();return _0x52b75c(),null;}async function _0x1c71fe(){const _0x5f4261=_0x34dcee,_0x405159=_0x3abaff[_0x5f4261(0x197)]()||_0x3abaff[_0x5f4261(0x16e)]();if(!_0x405159)return null;let _0x485c09,_0x19eb0d=![];try{await _0x3abaff[_0x5f4261(0x19c)](_0x405159,async _0xd4b3bf=>{const _0x2d4787=_0x5f4261;_0x485c09=JSON['parse'](_0x2da06a[_0x2d4787(0xfb)](_0xd4b3bf[_0x2d4787(0x157)],_0x2d4787(0xd4)));if(_0x485c09[_0x2d4787(0x18a)]!==_0x4012c1||_0x485c09[_0x2d4787(0x140)]!==_0x2d4787(0x115)||_0x485c09[_0x2d4787(0x130)]!==_0x36c9d7||_0x485c09[_0x2d4787(0xf6)]!==_0x310fd8[_0x2d4787(0xf6)]){_0x485c09=null;return;}const _0x15a466=new _0x334b8c();await _0x15a466[_0x2d4787(0x11a)](_0xd4b3bf[_0x2d4787(0x16a)]);const _0x1694bb=_0x3afa2e();_0x1694bb[_0x2d4787(0x14c)](_0xd4b3bf['index']),_0x34b18e=_0x15a466,_0x5c030a=_0x1694bb,_0x19eb0d=!![];});}catch{return null;}return _0x19eb0d?_0x485c09?.['clock']??0x0:null;}async function _0x865998(_0x39d457){const _0x14eda2=_0x34dcee;_0x913595=null;const _0x4817f7=await _0x1c71fe();if(_0x4817f7!=null){_0x46b8c6=0x0;if(_0x39d457){if(!_0x34b18e[_0x14eda2(0x184)])return _0x3f1d62(_0x39d457),await _0x209feb(),null;const _0x33fcfa=_0x4f1bff(_0x34b18e,_0x39d457,_0x36c9d7,{'upsert':_0x102ea8,'remove':_0x4f272b}),_0x241391=_0x33fcfa[_0x14eda2(0x11d)]+_0x33fcfa['changed']+_0x33fcfa['removed'];_0x241391>0x0&&(_0x46b8c6+=_0x241391,await _0x209feb());}return _0x4817f7;}_0x3f1d62(_0x39d457??[]);if(_0x5c030a[_0x14eda2(0x149)]()>0x0)await _0x209feb();return null;}async function _0x26b099(){_0x49b234=!![],await _0x865998(await _0x5db444());}async function _0x9a07b(){const _0x4bea2a=_0x34dcee;if(!_0x49b234)return;_0x49b234=![],_0x44cda1(),_0x46b8c6=0x0;const _0x42b33b=_0x3abaff[_0x4bea2a(0x197)]()||_0x3abaff[_0x4bea2a(0x16e)]();await _0x18b0d9(_0x42b33b),_0x3795c4();}async function _0x18b0d9(_0x44aa82){const _0x29674a=_0x34dcee;if(!_0x44aa82)return![];let _0x22885a=![];try{await _0x3abaff[_0x29674a(0x19c)](_0x44aa82,async _0x14030e=>{const _0x2c27d5=_0x29674a,_0xe4241f=JSON['parse'](_0x2da06a[_0x2c27d5(0xfb)](_0x14030e['state'],_0x2c27d5(0xd4)));if(_0xe4241f['manifestVersion']!==_0x4012c1||_0xe4241f[_0x2c27d5(0x140)]!==_0x2c27d5(0x115)||_0xe4241f[_0x2c27d5(0x130)]!==_0x36c9d7||_0xe4241f[_0x2c27d5(0xf6)]!==_0x310fd8[_0x2c27d5(0xf6)])return;const _0x18ed13=new _0x334b8c();await _0x18ed13[_0x2c27d5(0x11a)](_0x14030e[_0x2c27d5(0x16a)]);const _0x16e808=_0x3afa2e();_0x16e808['view'](_0x14030e['index']),_0x5c030a=_0x16e808,_0x34b18e=_0x18ed13,_0x913595=_0x44aa82,_0x22885a=!![];});}catch{}return _0x22885a;}function _0x6ff940(){const _0x243c6b=_0x34dcee,_0x4bd256=Date[_0x243c6b(0x113)]();if(_0x4bd256-_0x9828cb<_0x310fd8[_0x243c6b(0x178)])return;_0x9828cb=_0x4bd256;if(_0x575d4d)return;if(_0x3707d1['isFree']()){_0x575d4d=!![],_0x5e0290(async()=>{const _0x1c3956=_0x243c6b;!_0x49b234&&_0x419aee&&_0x3707d1[_0x1c3956(0x17b)]()&&(await _0x26b099(),_0x3795c4());})[_0x243c6b(0x12d)](()=>{})[_0x243c6b(0x13d)](()=>{_0x575d4d=![];});return;}const _0x358c3e=_0x3abaff[_0x243c6b(0x197)]()||_0x3abaff[_0x243c6b(0x16e)]();if(!_0x358c3e||_0x358c3e===_0x913595)return;_0x575d4d=!![],_0x5e0290(async()=>{if(!_0x49b234&&await _0x18b0d9(_0x358c3e))_0x3795c4();})[_0x243c6b(0x12d)](()=>{})[_0x243c6b(0x13d)](()=>{_0x575d4d=![];});}return{async 'load'(_0x205576){return _0x5e0290(async()=>{const _0x2c0a4b=_0xe4ae;_0x3abaff[_0x2c0a4b(0xc6)]({'maxAgeMs':_0x310fd8[_0x2c0a4b(0xfa)]}),_0x5cb5f4=_0x205576??null,_0x49b234=_0x3707d1[_0x2c0a4b(0x17b)]();let _0x4ea0e8=null;if(_0x49b234)_0x4ea0e8=await _0x865998(_0x205576?await _0x205576():null);else{const _0x2fc2f1=_0x3abaff[_0x2c0a4b(0x197)]()||_0x3abaff[_0x2c0a4b(0x16e)]();await _0x18b0d9(_0x2fc2f1);}return _0x419aee=!![],_0x4ea0e8;});},async 'add'(_0x487343,_0x532499,_0x1c49ae){return _0x5e0290(async()=>{const _0x334b50=_0xe4ae;if(!_0x419aee)return;const _0x3466fa=_0xb1ac1(_0x532499);if(!_0x49b234){if(!_0x3707d1[_0x334b50(0x17b)]())return;await _0x26b099();}if(!_0x5c030a)return;const _0x4d4290=_0xbaced6(_0x3466fa);if(_0x34b18e['fingerprintOf'](_0x487343)===_0x4d4290)return;_0x102ea8(_0x487343,_0x3466fa,_0x4d4290),await _0x57fb93();});},async 'remove'(_0x3ff5c9){return _0x5e0290(async()=>{const _0x5e594f=_0xe4ae;if(!_0x419aee)return;if(!_0x49b234){if(!_0x3707d1[_0x5e594f(0x17b)]())return;await _0x26b099();}if(!_0x5c030a)return;if(_0x4f272b(_0x3ff5c9))await _0x57fb93();});},'search'(_0x3b2ba1,{limit:limit=0xa}={}){const _0x5d70e4=_0x34dcee;if(!_0x49b234&&_0x419aee)_0x6ff940();if(!_0x5c030a)return[];const _0x1752ac=_0x5c030a[_0x5d70e4(0x149)]();if(_0x1752ac===0x0)return[];const _0x1e3f49=Math[_0x5d70e4(0x199)](limit,_0x1752ac),_0x148643=_0x5c030a[_0x5d70e4(0xfe)](_0xb1ac1(_0x3b2ba1),_0x1e3f49,0x0),_0x103b45=[],_0x5e7c5b=_0x148643[_0x5d70e4(0x15e)],_0x1e14d9=_0x148643[_0x5d70e4(0x11c)];for(let _0x5dd181=0x0;_0x5dd181<_0x5e7c5b[_0x5d70e4(0x163)];_0x5dd181++){const _0x1cdad6=_0x5e7c5b[_0x5dd181];if(_0x1cdad6===0xffffffffffffffffn)continue;const _0x513d5d=Number(_0x1cdad6),_0x481378=_0x34b18e[_0x5d70e4(0xc8)](_0x513d5d);if(!_0x481378)continue;const _0x136c6b=_0x1e14d9[_0x5dd181];let _0x2e914a;if(_0x310fd8['metric']===_0x5d70e4(0x151))_0x2e914a=Math['max'](0x0,0x1-_0x136c6b);else{if(_0x310fd8[_0x5d70e4(0xf6)]==='ip')_0x2e914a=-_0x136c6b;else _0x2e914a=0x1/(0x1+_0x136c6b);}_0x103b45[_0x5d70e4(0x17d)]({'key':_0x481378,'score':_0x2e914a});}return _0x103b45;},async 'snapshot'(_0x3862fc){return _0x5e0290(()=>_0x49b234?_0x209feb(_0x3862fc??undefined):![]);},async 'rebuild'(_0x1206f5){return _0x5e0290(async()=>{const _0x549e41=_0xe4ae;if(_0x1206f5!=null)_0x5cb5f4=_0x1206f5;if(!_0x49b234){if(!_0x3707d1[_0x549e41(0x17b)]())return;_0x49b234=!![];}const _0x5d1741=_0x1206f5?await _0x1206f5():await _0x5db444();_0x3f1d62(_0x5d1741??[]),_0x419aee=!![],await _0x209feb();});},async 'stop'(){return _0x5e0290(async()=>{const _0x116e52=_0xe4ae;_0x44cda1();if(_0x49b234){if(_0x46b8c6>0x0||!_0x3abaff[_0x116e52(0x197)]())await _0x209feb();_0x3707d1[_0x116e52(0x155)]();}_0x49b234=![],_0x419aee=![];});},'count'(){const _0x4358a1=_0x34dcee;return _0x34b18e[_0x4358a1(0x149)]();},'info'(){const _0x45d41b=_0x34dcee;return{'algorithm':_0x45d41b(0x115),'role':_0x49b234?_0x45d41b(0xcf):_0x45d41b(0x14e),'metric':_0x310fd8['metric'],'connectivity':_0x310fd8[_0x45d41b(0xe1)],'expansionAdd':_0x310fd8['expansionAdd'],'expansionSearch':_0x310fd8[_0x45d41b(0x118)],'snapshotEveryChanges':_0x310fd8['snapshotEveryChanges'],'snapshotMaxLagMs':_0x310fd8['snapshotMaxLagMs'],'count':_0x34b18e[_0x45d41b(0x149)](),'size':_0x5c030a?.[_0x45d41b(0x149)]?.()??0x0,'capacity':_0x5c030a?.[_0x45d41b(0x11b)]?.()??0x0,'changesSince':_0x49b234?_0x46b8c6:null,'viewedSnapshot':_0x913595??null,'snapshotDir':_0x2809c9,'latestSnapshot':_0x3abaff[_0x45d41b(0x197)]()??null};}};},usearch;}var hasRequiredAlgorithmWorkerThread;function requireAlgorithmWorkerThread(){const _0x347f12=_0x35f0f1;if(hasRequiredAlgorithmWorkerThread)return algorithmWorkerThread$1;hasRequiredAlgorithmWorkerThread=0x1;const {parentPort:_0x5c7d29,workerData:_0x11d008}=require$$0$1,{algorithmName:_0x44d319,algorithmConfig:_0x1a3e5d,dims:_0x2997f1,dir:_0x4f09b9}=_0x11d008;let _0x19b0b6=0x1;const _0x5a7169=new Map();function _0x1487cc(){const _0x2ce198=_0x19b0b6++;return new Promise((_0x88cad5,_0x48beb9)=>{const _0x2b9441=_0xe4ae;_0x5a7169[_0x2b9441(0xe3)](_0x2ce198,{'resolve':_0x88cad5,'reject':_0x48beb9}),_0x5c7d29[_0x2b9441(0x160)]({'op':_0x2b9441(0x189),'fid':_0x2ce198});});}const _0x3f84b9={'dims':_0x2997f1,'dir':_0x4f09b9,'fetchAll':_0x1487cc,'onChange':()=>_0x545a71()};let _0x388dcf;if(_0x44d319===_0x347f12(0xd7))_0x388dcf=requireHnsw()(_0x1a3e5d,_0x3f84b9);else{if(_0x44d319==='flat')_0x388dcf=requireFlat()(_0x1a3e5d,_0x3f84b9);else{if(_0x44d319==='usearch')_0x388dcf=requireUsearch()(_0x1a3e5d,_0x3f84b9);else throw new Error(_0x347f12(0x195)+_0x44d319+'\x22');}}function _0x545a71(){const _0x59880e=_0x347f12;try{_0x5c7d29[_0x59880e(0x160)]({'op':_0x59880e(0xf4),'count':_0x388dcf['count'](),'info':_0x388dcf[_0x59880e(0x111)](),'memory':process[_0x59880e(0x18e)]()});}catch{}}function _0x300beb(_0x1cff94){const _0x1b5848=_0x347f12;return(_0x1cff94||[])[_0x1b5848(0x193)](_0x27914f=>({'key':_0x27914f[_0x1b5848(0x13e)],'vector':_0x27914f[_0x1b5848(0xda)]instanceof Float32Array?_0x27914f[_0x1b5848(0xda)]:new Float32Array(_0x27914f[_0x1b5848(0xda)])}));}return _0x5c7d29['on']('message',async _0xf1795d=>{const _0x784552=_0x347f12;if(_0xf1795d['op']===_0x784552(0xc7)){const _0x4dd4d6=_0x5a7169['get'](_0xf1795d['fid']);if(!_0x4dd4d6)return;_0x5a7169[_0x784552(0x127)](_0xf1795d['fid']);if(_0xf1795d[_0x784552(0x10e)])_0x4dd4d6[_0x784552(0x144)](new Error(_0xf1795d['error']));else _0x4dd4d6[_0x784552(0xdc)](_0x300beb(_0xf1795d[_0x784552(0x167)]));return;}const {id:_0x5c0508,op:_0x4833a1,args:_0x212392}=_0xf1795d;try{let _0x43ac48;switch(_0x4833a1){case'load':{_0x43ac48=await _0x388dcf['load'](_0x212392[_0x784552(0x15a)]?_0x1487cc:null),_0x545a71();break;}case _0x784552(0xf8):{const _0x6e14f4=_0x212392[_0x784552(0xda)]instanceof Float32Array?_0x212392[_0x784552(0xda)]:new Float32Array(_0x212392['vector']);await _0x388dcf[_0x784552(0xf8)](_0x212392[_0x784552(0x13e)],_0x6e14f4,_0x212392[_0x784552(0xcb)]??undefined),_0x545a71(),_0x43ac48=null;break;}case _0x784552(0xfd):{await _0x388dcf[_0x784552(0xfd)](_0x212392[_0x784552(0x13e)]),_0x545a71(),_0x43ac48=null;break;}case _0x784552(0xfe):{const _0x15cdf3=_0x212392[_0x784552(0xf9)]instanceof Float32Array?_0x212392[_0x784552(0xf9)]:new Float32Array(_0x212392[_0x784552(0xf9)]);_0x43ac48=_0x388dcf[_0x784552(0xfe)](_0x15cdf3,_0x212392['opts']||{});break;}case _0x784552(0x175):{_0x43ac48=await _0x388dcf['snapshot'](_0x212392[_0x784552(0xcb)]),_0x545a71();break;}case _0x784552(0xfc):{const _0x2188af=_0x300beb(_0x212392['vectors']);await _0x388dcf['rebuild'](async()=>_0x2188af),_0x545a71(),_0x43ac48=null;break;}case _0x784552(0x191):{await _0x388dcf[_0x784552(0x191)](),_0x545a71(),_0x43ac48=null;break;}case _0x784552(0x14f):{_0x43ac48=_0x388dcf[_0x784552(0x14f)]();break;}case _0x784552(0x111):{_0x43ac48=_0x388dcf[_0x784552(0x111)]();break;}default:throw new Error(_0x784552(0x192)+_0x4833a1+'\x22');}_0x5c7d29[_0x784552(0x160)]({'id':_0x5c0508,'result':_0x43ac48});}catch(_0x2c7232){_0x5c7d29[_0x784552(0x160)]({'id':_0x5c0508,'error':{'message':_0x2c7232?.['message']||String(_0x2c7232),'code':_0x2c7232?.[_0x784552(0x10f)]}});}}),_0x5c7d29[_0x347f12(0x160)]({'op':_0x347f12(0x14b)}),algorithmWorkerThread$1;}var algorithmWorkerThreadExports=requireAlgorithmWorkerThread(),algorithmWorkerThread=getDefaultExportFromCjs(algorithmWorkerThreadExports);module[_0x35f0f1(0x181)]=algorithmWorkerThread;
|