@kedem/okdb 2.0.1 → 2.0.3
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/algorithm-worker-thread.js +1 -1
- package/bin/okdb.js +1 -1
- package/docs/index.md +1 -0
- package/docs/licensing.md +152 -0
- package/docs/manifest.json +1 -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/docs/index.md
CHANGED
|
@@ -121,6 +121,7 @@ await okdb.close();
|
|
|
121
121
|
- [HTTP Clustering](./http-cluster.md) — the CLI's N-capable-nodes cluster
|
|
122
122
|
- [Process Registry](./process-registry.md) — root-wide process visibility and control
|
|
123
123
|
- [Auth & Sync](./auth-and-sync.md) / [Auth Permissions](./auth-permissions.md) — tokens, OAuth, grants
|
|
124
|
+
- [Licensing](./licensing.md) — free tier, adding a license file, PIN activation
|
|
124
125
|
- [Logging](./logging.md) — structured logs, retention
|
|
125
126
|
- [Diagnostics](./diagnostics.md) — opt-in triage tooling (write-origin ring, fatal report, loop lag)
|
|
126
127
|
- [Plugins](./plugins.md) — extending OKDB before open
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Licensing
|
|
2
|
+
|
|
3
|
+
OKDB runs without a license on a **free tier** that is enough to evaluate and build something
|
|
4
|
+
real. A license is a signed file from your vendor that unlocks additional features and raises
|
|
5
|
+
limits. Everything is managed from the CLI:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
okdb license [<blob|path|uuid|activation-token>] [--path <db-dir>]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Licenses are stored **inside the database** (in the `~system` environment), so always point the
|
|
12
|
+
command at the same data directory your server runs with — via `--path`, the `OKDB_PATH`
|
|
13
|
+
environment variable, or the `path` key in `.kdbconfig`.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Free tier
|
|
18
|
+
|
|
19
|
+
With no license stored, OKDB applies the free tier:
|
|
20
|
+
|
|
21
|
+
| Feature | Free tier | Feature | Free tier |
|
|
22
|
+
| ------- | --------- | ------------- | --------- |
|
|
23
|
+
| `fts` | ✓ | `sync` | ✗ |
|
|
24
|
+
| `views` | ✓ | `embeddings` | ✗ |
|
|
25
|
+
| `files` | ✓ | `engines` | ✗ |
|
|
26
|
+
| `mcp` | ✓ | `timeMachine` | ✗ |
|
|
27
|
+
|
|
28
|
+
| Limit | Free tier |
|
|
29
|
+
| ------------- | --------- |
|
|
30
|
+
| Environments | 2 |
|
|
31
|
+
| Types per env | 10 |
|
|
32
|
+
| Total writes | 1,000,000 |
|
|
33
|
+
|
|
34
|
+
Using a disabled feature throws `LICENSE_FEATURE_DISABLED`; crossing a limit throws
|
|
35
|
+
`LICENSE_LIMIT_EXCEEDED`. A license lists its own feature set and limits — anything the
|
|
36
|
+
vendor left unset is unlimited.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Activating a license file
|
|
41
|
+
|
|
42
|
+
Your vendor sends you a `.license` file. The flow has two steps, because standard licenses are
|
|
43
|
+
**bound to one node**: the database generates a PIN unique to this node + license pair, and the
|
|
44
|
+
vendor answers with an activation token.
|
|
45
|
+
|
|
46
|
+
### 1. Add the license file
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
okdb license ./acme.license --path ./okdb-data
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The CLI reads the file, verifies the signature, stores the license, and prints a **PIN**:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
✓ License added
|
|
56
|
+
licensee: Acme Corp
|
|
57
|
+
...
|
|
58
|
+
PIN: AB3D-EF7H
|
|
59
|
+
|
|
60
|
+
Next step — activate the license:
|
|
61
|
+
1. Send the PIN above (AB3DEF7H) to your license vendor.
|
|
62
|
+
2. You will receive an activation token.
|
|
63
|
+
3. Run: okdb license <activation-token>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The PIN is derived from the node identity and the license — it contains no secrets and is safe
|
|
67
|
+
to send over email or chat.
|
|
68
|
+
|
|
69
|
+
You can also paste the license blob string directly instead of a file path — the CLI
|
|
70
|
+
auto-detects what it was given.
|
|
71
|
+
|
|
72
|
+
### 2. Apply the activation token
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
okdb license <activation-token>
|
|
76
|
+
# or, if the vendor sent it as a file:
|
|
77
|
+
okdb license ./acme-activation.txt
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
✓ License activated
|
|
82
|
+
licensee: Acme Corp
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Done. A running server picks the change up on its periodic license recheck; restart it if you
|
|
86
|
+
want the new tier immediately.
|
|
87
|
+
|
|
88
|
+
### Open licenses (POC / demo)
|
|
89
|
+
|
|
90
|
+
Some licenses are issued as **open**: not node-bound, maximum 6 months validity. These are
|
|
91
|
+
active immediately after step 1 — no PIN, no activation token. The server logs a warning
|
|
92
|
+
banner while an open license is active, as a reminder that it is for evaluation only.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Managing licenses
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
okdb license # list all stored licenses, current tier, and usage
|
|
100
|
+
okdb license <uuid|prefix> # details for one license (features, limits, status, usage)
|
|
101
|
+
okdb license remove <id> # remove a stored license
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The list shows each license's status:
|
|
105
|
+
|
|
106
|
+
| Status | Meaning |
|
|
107
|
+
| ------------ | -------------------------------------------------------------------------- |
|
|
108
|
+
| `active` | Verified and in effect (the first active license wins) |
|
|
109
|
+
| `pending` | Added but not yet activated — send the PIN to your vendor |
|
|
110
|
+
| `expired` | Past its expiry date; the node falls back to the next license or free tier |
|
|
111
|
+
| `wrong_node` | The activation belongs to a different node identity (see below) |
|
|
112
|
+
| `invalid` | The blob is corrupt or not signed by the key this build trusts |
|
|
113
|
+
|
|
114
|
+
`okdb serve` also prints a one-line license summary at startup (licensee and expiry, or the
|
|
115
|
+
current free-tier usage).
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Node identity, reset, and moving a database
|
|
120
|
+
|
|
121
|
+
The activation is bound to the node identity created when the database was first initialized.
|
|
122
|
+
Two consequences:
|
|
123
|
+
|
|
124
|
+
- **`okdb reset` preserves your license.** The reset command deliberately carries the node
|
|
125
|
+
identity and all stored licenses into the fresh database, so activation survives.
|
|
126
|
+
- **Deleting the data directory by hand does not.** A new directory means a new node identity;
|
|
127
|
+
previously activated licenses show `wrong_node` and need a re-activation from your vendor
|
|
128
|
+
(add the license again, send the new PIN).
|
|
129
|
+
|
|
130
|
+
The same applies to copying a license between machines: the blob can be added anywhere, but
|
|
131
|
+
each node needs its own activation.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Expiry
|
|
136
|
+
|
|
137
|
+
The server rechecks licenses periodically. When the active license expires, the node logs a
|
|
138
|
+
warning, emits a `LICENSE_INVALID` event, and drops to the next valid license or the free tier
|
|
139
|
+
— by default it **keeps running** (`onLicenseExpired: 'log'`). Set the constructor option
|
|
140
|
+
`onLicenseExpired: 'shutdown'` (or `OKDB_LICENSE_EXPIRED_ACTION=shutdown`) to make the process
|
|
141
|
+
exit instead.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Errors
|
|
146
|
+
|
|
147
|
+
| Code | When |
|
|
148
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
149
|
+
| `LICENSE_INVALID` | Blob corrupt, duplicate, or signed by a key this build does not trust — the error includes the build's expected key fingerprint |
|
|
150
|
+
| `LICENSE_ACTIVATION_INVALID` | Token malformed, or no stored license matches it — add the license blob first |
|
|
151
|
+
| `LICENSE_FEATURE_DISABLED` | The current tier does not include the feature |
|
|
152
|
+
| `LICENSE_LIMIT_EXCEEDED` | An operation would cross a licensed limit |
|
package/docs/manifest.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
{ "file": "process-registry.md", "label": "Process Registry" },
|
|
39
39
|
{ "file": "plugins.md", "label": "Plugins" },
|
|
40
40
|
{ "file": "processors.md", "label": "Processors (modes & registration)" },
|
|
41
|
+
{ "file": "licensing.md", "label": "Licensing" },
|
|
41
42
|
{ "file": "logging.md", "label": "Logging" },
|
|
42
43
|
{ "file": "diagnostics.md", "label": "Diagnostics" },
|
|
43
44
|
{ "file": "migration.md", "label": "Migration" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x2c7ed1=_0x1d78;(function(_0x3eee2e,_0x4f51de){const _0x530d47=_0x1d78,_0x9fdc32=_0x3eee2e();while(!![]){try{const _0x38d9ab=parseInt(_0x530d47(0x1d9))/0x1+-parseInt(_0x530d47(0x11e))/0x2*(parseInt(_0x530d47(0x1ad))/0x3)+parseInt(_0x530d47(0x11d))/0x4+parseInt(_0x530d47(0x27d))/0x5*(-parseInt(_0x530d47(0x153))/0x6)+-parseInt(_0x530d47(0x146))/0x7+-parseInt(_0x530d47(0x163))/0x8*(-parseInt(_0x530d47(0x239))/0x9)+parseInt(_0x530d47(0x1c3))/0xa;if(_0x38d9ab===_0x4f51de)break;else _0x9fdc32['push'](_0x9fdc32['shift']());}catch(_0x28cbe9){_0x9fdc32['push'](_0x9fdc32['shift']());}}}(_0x4abc,0x1ed5a));var require$$0$3=require(_0x2c7ed1(0x226)),require$$2=require('v8'),require$$0=require('node:vm'),require$$0$2=require(_0x2c7ed1(0x230)),require$$0$1=require('node:perf_hooks'),require$$6=require(_0x2c7ed1(0x265));function getDefaultExportFromCjs(_0x467fd4){const _0x4491fb=_0x2c7ed1;return _0x467fd4&&_0x467fd4[_0x4491fb(0x1e4)]&&Object[_0x4491fb(0x12f)][_0x4491fb(0x168)][_0x4491fb(0x241)](_0x467fd4,'default')?_0x467fd4[_0x4491fb(0x184)]:_0x467fd4;}var okdbFunctionsSandboxWorker$1={},okdbFatalReport,hasRequiredOkdbFatalReport;function requireOkdbFatalReport(){if(hasRequiredOkdbFatalReport)return okdbFatalReport;hasRequiredOkdbFatalReport=0x1;function _0x386208(_0x46ded0){const _0x2d6dc6=_0x1d78;if(process.env.OKDB_FATAL_REPORT!=='1')return;try{if(!process[_0x2d6dc6(0x25f)])return;process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x1f7)]=!![];try{if(_0x2d6dc6(0x111)in process[_0x2d6dc6(0x25f)])process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x111)]=process.env.OKDB_FATAL_REPORT_ENV!=='1';}catch{}if(process[_0x2d6dc6(0x260)]!==_0x2d6dc6(0x1e6))try{process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x1df)]=!![];if(typeof process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x122)]===_0x2d6dc6(0x24a))process[_0x2d6dc6(0x25f)][_0x2d6dc6(0x122)]='SIGSEGV';}catch{}if(process.env.OKDB_REPORT_DIR)try{require('fs')[_0x2d6dc6(0x1ff)](process.env.OKDB_REPORT_DIR,{'recursive':!![]}),process['report'][_0x2d6dc6(0x261)]=process.env.OKDB_REPORT_DIR;}catch{}try{process['report'][_0x2d6dc6(0x195)]='';}catch{}if(_0x46ded0)process.env.OKDB_REPORT_TAG=String(_0x46ded0);}catch{}}return okdbFatalReport={'enableFatalReport':_0x386208},okdbFatalReport;}var okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x3a8693=require$$0;function _0x55c56c(_0x104d68){const _0x1374f6=_0x104d68==='*',_0x4a9fcf=_0x1374f6?null:new Set(Array['isArray'](_0x104d68)?_0x104d68:[]);return function _0x4587f4(_0x27ad7,_0x49577f){const _0x34042e=_0x1d78;if(!_0x1374f6){let _0x130228;try{const _0x5be7f3=new URL(typeof _0x27ad7===_0x34042e(0x24a)?_0x27ad7:_0x27ad7?.[_0x34042e(0x12b)]??String(_0x27ad7));_0x130228=_0x5be7f3[_0x34042e(0x152)];}catch{const _0x454118=new Error(_0x34042e(0x1bb));return _0x454118[_0x34042e(0x205)]='FETCH_NOT_ALLOWED',Promise[_0x34042e(0x1ba)](_0x454118);}if(!_0x4a9fcf['has'](_0x130228)){const _0x1dabcf=new Error(_0x4a9fcf[_0x34042e(0x132)]===0x0?_0x34042e(0x26e):_0x34042e(0x24f)+_0x130228+_0x34042e(0x1ac));return _0x1dabcf[_0x34042e(0x205)]='FETCH_NOT_ALLOWED',Promise['reject'](_0x1dabcf);}}return fetch(_0x27ad7,_0x49577f);};}function _0x191e46(_0x19bc13={}){const _0x283992=_0x1d78,_0xed964b=_0x19bc13[_0x283992(0x201)]!==![],_0x406565=_0x19bc13[_0x283992(0x1cb)]??[],_0x384a6c={'Date':Date,'Math':Math,'JSON':JSON,'Array':Array,'Object':Object,'String':String,'Number':Number,'Boolean':Boolean,'Map':Map,'Set':Set,'Promise':Promise,'URL':URL,'URLSearchParams':URLSearchParams,'TextEncoder':TextEncoder,'TextDecoder':TextDecoder,'AbortController':AbortController,'AbortSignal':AbortSignal,'setTimeout':setTimeout,'clearTimeout':clearTimeout,'setInterval':setInterval,'clearInterval':clearInterval,'queueMicrotask':queueMicrotask,'structuredClone':structuredClone,'crypto':globalThis[_0x283992(0x227)]};return _0xed964b&&typeof fetch===_0x283992(0x249)&&(_0x384a6c[_0x283992(0x179)]=_0x55c56c(_0x406565)),_0x384a6c[_0x283992(0x128)]=_0x384a6c,_0x384a6c;}function _0x321dc5(_0x244443,_0x2d03d8={}){const _0x3a0773=_0x1d78,_0x3a784d=_0x191e46(_0x2d03d8),_0x5817d9=_0x3a8693[_0x3a0773(0x20c)](_0x3a784d,{'name':'okdb-function-sandbox','codeGeneration':{'strings':![],'wasm':![]}});let _0x4f25e3;try{_0x4f25e3=new _0x3a8693[(_0x3a0773(0x220))]('('+_0x244443+')',{'filename':_0x2d03d8[_0x3a0773(0x195)]??_0x3a0773(0x224)});}catch(_0x554b9b){const _0x425f06=new Error(_0x554b9b?.[_0x3a0773(0x165)]||_0x3a0773(0x244));_0x425f06[_0x3a0773(0x205)]=_0x3a0773(0x248),_0x425f06[_0x3a0773(0x19f)]=_0x554b9b;throw _0x425f06;}let _0x230836;try{_0x230836=_0x4f25e3[_0x3a0773(0x25d)](_0x5817d9,{'timeout':_0x2d03d8[_0x3a0773(0x1a7)]??0x64});}catch(_0x3d04de){const _0x413b5e=new Error(_0x3d04de?.[_0x3a0773(0x165)]||_0x3a0773(0x1c9));_0x413b5e['code']=_0x3a0773(0x248),_0x413b5e[_0x3a0773(0x19f)]=_0x3d04de;throw _0x413b5e;}if(typeof _0x230836!==_0x3a0773(0x249)){const _0x3046b3=new Error(_0x3a0773(0x256));_0x3046b3[_0x3a0773(0x205)]=_0x3a0773(0x218);throw _0x3046b3;}return _0x230836;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x191e46,'compileFunctionExpression':_0x321dc5,'_buildRestrictedFetch':_0x55c56c},okdbFunctionsSandbox;}function _0x4abc(){const _0x523218=['upload','win32','_undoHooks','disable','query','license:invalid','sourceEnv','type:drop','\x20does\x20not\x20exist','env:removed','getTTL','txn:rollback','envName','remove','openEnv','stringify','loop-lag','system:env_release','reportOnFatalError','ref:violation','sync:apply','captureStackTrace','cancel','_admissionTimer','timeout','length','mkdirSync','result','allowFetch','txn:start','OKDBError','percentile','code','txn\x20ops\x20must\x20be\x20an\x20array','getIndex','getChanges','OKDBUniqueConstraintError','applyOps','requestedAt','createContext','cron','getByPrefix','requestId','getJob','stop','Type\x20\x27','index:ready','byIndex','fts:registered','emit','rollback','FUNCTION_SCRIPT_INVALID_SHAPE','license:added','onUndo','txn-commit','cursorKey','type:registered','functionName','bucket','Script','runtime','getClock','start','okdb-function.js','_closeReadTransaction','worker_threads','crypto','sourceType','TXN_ROLLBACK','getBucket','TXN_INVALID_ACTION','failures','INVALID_PRIMARY_KEY','geoQuery','\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict','uuid','pid','files','index:registered','registerIndex','stderr','FOREIGN_KEY_VIOLATION','warn','Index\x20\x27','1038591vFHdvy','fatal','createWriteFacade','OKDBForeignKeyDeleteError','fts:reset','removeJob','close','ms/','call','dropIndex','addBucket','Function\x20script\x20failed\x20to\x20compile','txnId','view:progress','materializerContext','FUNCTION_SCRIPT_COMPILE_FAILED','function','string','commit','envPath','_windowCbs','actions','fetch\x20blocked:\x20hostname\x20\x22','_timer','_buckets','delete','name','createEnvironment','readTransaction','Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function','Cannot\x20set\x20enforce\x20schema\x20on\x20','_doHooks','setTTL','patch','Invalid\x20primary\x20key\x20type:\x20','creating','runInContext','timeoutMs','report','platform','directory','OKDBTypeAlreadyRegisteredError','getMany','isArray','./okdb','system:stopped','fieldPath','OKDBNotFoundError','priority','set','runId','Unknown\x20custom\x20function\x20error','Version\x20mismatch\x20for\x20','fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)','maxExtra','_admissionStarted','TXN_CLOSED','now','bind','schema:drop','processor','OKDBAlreadyExistsError','clearTTL','TXN_INVALID_OPS','VERSION_MISMATCH','ms\x20p99=','\x22\x20on\x20\x22','targetType','35DiidKg','job','getKeys','registerType','any','ready','item:create','reset','ttl:clear','excludeEnv','_closed','hasType','OKDBIndexNotRegisteredError','info','bus:env_release','index:progress','Transaction\x20already\x20closed','Unknown\x20OKDB\x20transaction\x20error','get','Invalid\x20index\x20key\x20type\x20for\x20\x27','INDEX_ALREADY_REGISTERED','595540YOFJQW','214iYLiIT','\x20references\x20',':\x20expected\x20','TXN_ERROR','signal','run','map','system:type_drop','env','registerFts','globalThis','write','okdb','url','abort','freeze','used_heap_size','prototype','clearTtl','ensureType','size','postMessage','OKDBIndexHasConsumersError','\x27,\x20cannot\x20map\x20to\x20\x27','unique:violation','getCount','started','bus:poke','Cannot\x20delete\x20','~system','key','INDEX_NOT_REGISTERED','updateJob','job_heartbeat','dropType','ttl:set','_report','exports','dryRun','entries','1545208VqqoKY','has','\x20documents\x20fail\x20validation','resetIndex','args','(worst\x20','ttl','\x27\x20on\x20type\x20\x27','useReadTransaction','push','txn','payload','hostname','49926Jvlzel','sweepExpiredTTL','sandbox-','create','.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20','\x20which\x20does\x20not\x20exist','log','getIndexStatus','\x27\x20already\x20registered','transaction\x20commit\x20failed','Unique\x20constraint\x20violated\x20on\x20','put','OKDBSchemaValidationError','clearDefaultTTL','references','action','16sXsqdX',':\x20key\x20[','message','cancelled\x20by\x20caller','enqueue','hasOwnProperty','system:drain','getByPath','OKDBTypeNotRegisteredError','TYPE_NOT_REGISTERED','ms\x20busy=','errors','enable','bus:drain','actionCount','\x27\x20is\x20already\x20registered','SCHEMA_VALIDATION_FAILED','INVALID_VALUE','OKDBForeignKeyError','getRange','_envs','fts:drop','fetch','tries','starting','unref','resetFts','hasIndex','claimId','maxMs','stream','setTtl','range','default','OKDBVersionMismatchError','targetEnv','system:ready','transaction','ref:violation_resolved','options','ttl:expired','getValues','_writer','ms\x20max=','.okdb-function.js','type','enabled','update','INVALID_INDEX_KEY','events','filename','ttlStats','materializer','queue','license:removed','FOREIGN_KEY_DELETE_RESTRICTED','getEntry','setDefaultTTL','INDEX_HAS_CONSUMERS','_startAdmission','cause','script','schema:set','jobContext','tags','_assertOpen','resetting','sourceKey','compileTimeoutMs','NOT_FOUND','Unknown\x20transaction\x20action:\x20','_log','kind','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','6444JOKcBy','targetKey','created','item:remove','dryRunActions','index:reset','listBuckets',',\x20got\x20','details','\x27\x20doesn\x27t\x20exist','UNIQUE_CONSTRAINT','debug','object','reject','fetch\x20blocked:\x20invalid\x20URL','mode','processorContext','error','toFixed','_started','engineKey','stack','1390400UIJEjX','version','stopping','keys','sdk','exit','Function\x20script\x20failed\x20to\x20initialize','unsafe','allowedFetchDomains','list','item:update','join','\x20already\x20exists','OKDBInvalidValueError','max','nativeCode','system:bus_state_change','OKDBSchemaCollectionError','hash','unique:violation_resolved','global','txn:end','116402XJqcMg','listTTL','Index\x20\x22',']\x20already\x20maps\x20to\x20\x27','stopped','count','reportOnSignal','TYPE_ALREADY_REGISTERED','value','add','OKDBInvalidPrimaryKeyError','__esModule'];_0x4abc=function(){return _0x523218;};return _0x4abc();}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x530694(_0x24702e){const _0x5f2b1d=_0x1d78;if(!_0x24702e)return null;return{'message':_0x24702e[_0x5f2b1d(0x165)]||String(_0x24702e),'stack':_0x24702e[_0x5f2b1d(0x1c2)]||null,'code':_0x24702e[_0x5f2b1d(0x205)]||null,'details':_0x24702e[_0x5f2b1d(0x1b5)]||null};}function _0x575957(_0x509c46){const _0x20ca9e=_0x1d78;if(!_0x509c46)return new Error(_0x20ca9e(0x26c));const _0x5e552f=new Error(_0x509c46[_0x20ca9e(0x165)]||String(_0x509c46));if(_0x509c46[_0x20ca9e(0x1c2)])_0x5e552f[_0x20ca9e(0x1c2)]=_0x509c46['stack'];if(_0x509c46[_0x20ca9e(0x205)])_0x5e552f['code']=_0x509c46[_0x20ca9e(0x205)];if(_0x509c46[_0x20ca9e(0x1b5)])_0x5e552f['details']=_0x509c46[_0x20ca9e(0x1b5)];return _0x5e552f;}return okdbFunctionsIpc={'serializeError':_0x530694,'deserializeError':_0x575957},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function _0x1d78(_0x4ae8c9,_0x22df4f){_0x4ae8c9=_0x4ae8c9-0x111;const _0x4abc94=_0x4abc();let _0x1d7808=_0x4abc94[_0x4ae8c9];return _0x1d7808;}function requireOkdbEnums(){const _0x339720=_0x2c7ed1;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x93ffe3={'PUT':_0x339720(0x15e),'REMOVE':_0x339720(0x1f2),'INDEX_DROP':_0x339720(0x242),'INDEX_REGISTER':'registerIndex','INDEX_RESET':_0x339720(0x149),'TYPE_REGISTER':_0x339720(0x280),'TYPE_DROP':_0x339720(0x140),'FTS_REGISTER':_0x339720(0x127),'FTS_DROP':'dropFts','FTS_RESET':_0x339720(0x17d),'SCHEMA_SET':'setSchema','SCHEMA_DROP':'dropSchema','TTL_SET':_0x339720(0x182),'TTL_CLEAR':_0x339720(0x130)},_0x2d2c22={'SYSTEM_READY':_0x339720(0x187),'SYSTEM_STOPPED':_0x339720(0x266),'SYSTEM_CLOCK_CHANGE':'system:clock_change','SYSTEM_POKE':'system:poke','SYSTEM_DRAIN':_0x339720(0x169),'SYSTEM_TYPE_DROP':_0x339720(0x125),'SYSTEM_PROC':'system:proc','SYSTEM_BUS_STATE_CHANGE':_0x339720(0x1d3),'ITEM_CREATE':_0x339720(0x283),'ITEM_UPDATE':_0x339720(0x1cd),'ITEM_REMOVE':_0x339720(0x1b0),'INDEX_RESET':_0x339720(0x1b2),'INDEX_READY':_0x339720(0x213),'INDEX_PROGRESS':_0x339720(0x117),'VIEW_PROGRESS':_0x339720(0x246),'INDEX_DROP':'index:drop','INDEX_REGISTERED':_0x339720(0x233),'FTS_REGISTERED':_0x339720(0x215),'FTS_DROP':_0x339720(0x178),'FTS_RESET':_0x339720(0x23d),'SCHEMA_SET':_0x339720(0x1a1),'SCHEMA_DROP':_0x339720(0x274),'UNIQUE_VIOLATION':_0x339720(0x136),'UNIQUE_VIOLATION_RESOLVED':_0x339720(0x1d6),'REF_VIOLATION':_0x339720(0x1f8),'REF_VIOLATION_RESOLVED':_0x339720(0x189),'SYNC_APPLY':_0x339720(0x1f9),'TXN_START':_0x339720(0x202),'TXN_END':_0x339720(0x1d8),'TXN_ROLLBACK':_0x339720(0x1f0),'TYPE_REGISTERED':_0x339720(0x21d),'TYPE_DROP':_0x339720(0x1ec),'ENV_OPENED':'env:opened','ENV_REMOVED':_0x339720(0x1ee),'SYSTEM_ENV_RELEASE':_0x339720(0x1f6),'TTL_EXPIRED':_0x339720(0x18b),'TTL_SET':_0x339720(0x141),'TTL_CLEAR':_0x339720(0x285),'LICENSE_INVALID':_0x339720(0x1ea),'LICENSE_ADDED':_0x339720(0x219),'LICENSE_ACTIVATED':'license:activated','LICENSE_REMOVED':_0x339720(0x199)},_0x28f175={'CREATING':_0x339720(0x25c),'RESETTING':'resetting','READY':_0x339720(0x282),'DROPPING':'dropping','WAITING':'waiting'},_0x168272={'CREATED':_0x339720(0x1af),'STARTING':_0x339720(0x17b),'STARTED':_0x339720(0x138),'STOPPING':_0x339720(0x1c5),'STOPPED':'stopped'},_0x2105c0={'CREATING':'creating','READY':'ready','HALTED':'halted','STOPPED':_0x339720(0x1dd),'RESETTING':_0x339720(0x1a5)},_0x48638e=Object[_0x339720(0x12d)]({'POKE':_0x339720(0x139),'DRAIN':_0x339720(0x170),'TYPE_DROP':'bus:type_drop','PROC':'bus:proc','ENV_RELEASE':_0x339720(0x116)});return okdbEnums={'BUS_EVENTS':_0x48638e,'CHANGE_ACTIONS':_0x93ffe3,'EVENTS':_0x2d2c22,'INDEX_STATE':_0x28f175,'OKDB_STATE':_0x168272,'VIEW_STATE':_0x2105c0},okdbEnums;}var okdbError,hasRequiredOkdbError;function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x39f2f6 extends Error{constructor(_0x5e68fe,_0x1948b9,_0x20267b={}){const _0x5d7ff0=_0x1d78;super(_0x5e68fe),this[_0x5d7ff0(0x253)]=_0x5d7ff0(0x203),this['code']=_0x1948b9,this[_0x5d7ff0(0x1b5)]=_0x20267b,_0x20267b[_0x5d7ff0(0x19f)]&&(this[_0x5d7ff0(0x19f)]=_0x20267b['cause']),Error[_0x5d7ff0(0x1fa)](this,this['constructor']);}}class _0xf4f53f extends _0x39f2f6{constructor(_0x3a3e87,_0x42a4d1,_0x4c43ed,_0x45bd53){const _0xff10a7=_0x1d78;super(_0xff10a7(0x26d)+_0x3a3e87+'@'+_0x42a4d1+_0xff10a7(0x120)+_0x4c43ed+_0xff10a7(0x1b4)+_0x45bd53,_0xff10a7(0x279),{'type':_0x3a3e87,'key':_0x42a4d1,'expectedVersion':_0x4c43ed,'actualVersion':_0x45bd53}),this['name']=_0xff10a7(0x185);}}class _0x5a4d1b extends _0x39f2f6{constructor(_0x10599b,_0x1508da){const _0x464d5f=_0x1d78;super(_0x10599b+'@'+_0x1508da+_0x464d5f(0x1ed),_0x464d5f(0x1a8),{'type':_0x10599b,'key':_0x1508da}),this[_0x464d5f(0x253)]=_0x464d5f(0x268);}}class _0x21969f extends _0x39f2f6{constructor(_0x56e2ee,_0x5aaf3f){const _0x27dc60=_0x1d78;super(_0x56e2ee+'@'+_0x5aaf3f+_0x27dc60(0x1cf),'ALREADY_EXISTS',{'type':_0x56e2ee,'key':_0x5aaf3f}),this[_0x27dc60(0x253)]=_0x27dc60(0x276);}}class _0x5d8a16 extends _0x39f2f6{constructor(_0x8ff56,_0x7d24c6){const _0x37d0dd=_0x1d78,_0x57d37d=typeof _0x7d24c6;super(_0x37d0dd(0x11b)+_0x8ff56+'\x27:\x20'+_0x57d37d+'.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20'+_0x7d24c6,_0x37d0dd(0x193),{'index':_0x8ff56,'key':_0x7d24c6,'keyType':_0x57d37d}),this[_0x37d0dd(0x253)]='OKDBInvalidIndexKeyError';}}class _0x45f366 extends _0x39f2f6{constructor(_0x3afd21){const _0x3b6bd1=_0x1d78,_0x3d8027=typeof _0x3afd21;super(_0x3b6bd1(0x25b)+_0x3d8027+_0x3b6bd1(0x157)+_0x3afd21,_0x3b6bd1(0x22d),{'key':_0x3afd21,'keyType':_0x3d8027}),this[_0x3b6bd1(0x253)]=_0x3b6bd1(0x1e3);}}class _0x5c8bf4 extends _0x39f2f6{constructor(_0x4eff27){const _0x99a9b8=_0x1d78;super(_0x99a9b8(0x212)+_0x4eff27+'\x27\x20doesn\x27t\x20exist',_0x99a9b8(0x16c),{'type':_0x4eff27}),this['name']=_0x99a9b8(0x16b);}}class _0x54f48d extends _0x39f2f6{constructor(_0x2f8736){const _0x2b5aad=_0x1d78;super(_0x2b5aad(0x212)+_0x2f8736+_0x2b5aad(0x15b),_0x2b5aad(0x1e0),{'type':_0x2f8736}),this['name']=_0x2b5aad(0x262);}}class _0x3e4bab extends _0x39f2f6{constructor(_0x4d194b,_0x508d08){const _0x24c128=_0x1d78;super('Index\x20\x27'+_0x508d08+_0x24c128(0x14d)+_0x4d194b+_0x24c128(0x1b6),_0x24c128(0x13d),{'type':_0x4d194b,'index':_0x508d08}),this[_0x24c128(0x253)]=_0x24c128(0x114);}}class _0x34082d extends _0x39f2f6{constructor(_0xff10e3,_0x59f3a0){const _0x53afc6=_0x1d78;super(_0x53afc6(0x238)+_0x59f3a0+_0x53afc6(0x14d)+_0xff10e3+_0x53afc6(0x172),_0x53afc6(0x11c),{'type':_0xff10e3,'index':_0x59f3a0}),this[_0x53afc6(0x253)]='OKDBIndexAlreadyRegisteredError';}}class _0x402536 extends _0x39f2f6{constructor(_0x2ca024,_0x5edaca={}){const _0x16adc9=_0x1d78;super(_0x2ca024,_0x16adc9(0x174),_0x5edaca),this[_0x16adc9(0x253)]=_0x16adc9(0x1d0);}}class _0xb4bee8 extends _0x39f2f6{constructor(_0x23bf62,_0x14698e,_0x455edb,_0x38d2bb,_0x11f3af){const _0x5ea66e=_0x1d78;super(_0x5ea66e(0x15d)+_0x23bf62+'@'+_0x14698e+_0x5ea66e(0x164)+_0x455edb+_0x5ea66e(0x1dc)+_0x38d2bb+_0x5ea66e(0x135)+_0x11f3af+'\x27',_0x5ea66e(0x1b7),{'type':_0x23bf62,'index':_0x14698e,'indexKey':_0x455edb,'existingKey':_0x38d2bb,'conflictingKey':_0x11f3af}),this[_0x5ea66e(0x253)]=_0x5ea66e(0x209);}}class _0x170891 extends _0x39f2f6{constructor(_0xf18f88,_0x522450,_0x50ff62){const _0x4a365d=_0x1d78;super('Schema\x20validation\x20failed\x20for\x20'+_0xf18f88+'@'+_0x522450,_0x4a365d(0x173),{'type':_0xf18f88,'key':_0x522450,'errors':_0x50ff62}),this[_0x4a365d(0x253)]=_0x4a365d(0x15f),this[_0x4a365d(0x190)]=_0xf18f88,this[_0x4a365d(0x13c)]=_0x522450,this[_0x4a365d(0x16e)]=_0x50ff62;}}class _0x2e07d5 extends _0x39f2f6{constructor(_0x1a4fb1,_0x3f0d8d){const _0x364362=_0x1d78;super(_0x364362(0x257)+_0x1a4fb1+':\x20'+_0x3f0d8d[_0x364362(0x1fe)]+_0x364362(0x148),'SCHEMA_COLLECTION_INVALID',{'type':_0x1a4fb1,'failures':_0x3f0d8d}),this[_0x364362(0x253)]=_0x364362(0x1d4),this[_0x364362(0x190)]=_0x1a4fb1,this[_0x364362(0x22c)]=_0x3f0d8d;}}class _0xe89c8d extends _0x39f2f6{constructor(_0x9de961,_0x42730b,_0x11b8e0,_0x225b0b,_0x49b5b1){const _0x26cbcb=_0x1d78;super('Foreign\x20key\x20violation:\x20'+_0x9de961+'@'+_0x42730b+'.'+_0x11b8e0+_0x26cbcb(0x11f)+_0x225b0b+'@'+_0x49b5b1+_0x26cbcb(0x158),_0x26cbcb(0x236),{'sourceType':_0x9de961,'sourceKey':_0x42730b,'fieldPath':_0x11b8e0,'targetType':_0x225b0b,'targetKey':_0x49b5b1}),this[_0x26cbcb(0x253)]=_0x26cbcb(0x175),this[_0x26cbcb(0x228)]=_0x9de961,this[_0x26cbcb(0x1a6)]=_0x42730b,this[_0x26cbcb(0x267)]=_0x11b8e0,this[_0x26cbcb(0x27c)]=_0x225b0b,this[_0x26cbcb(0x1ae)]=_0x49b5b1;}}class _0x4ab416 extends _0x39f2f6{constructor(_0x445acf,_0x3936a8,_0x32d82a){const _0xbe077=_0x1d78;super(_0xbe077(0x13a)+_0x445acf+'@'+_0x3936a8+':\x20'+_0x32d82a[_0xbe077(0x1fe)]+_0xbe077(0x22f),_0xbe077(0x19a),{'targetType':_0x445acf,'targetKey':_0x3936a8,'references':_0x32d82a}),this['name']=_0xbe077(0x23c),this[_0xbe077(0x27c)]=_0x445acf,this[_0xbe077(0x1ae)]=_0x3936a8,this[_0xbe077(0x161)]=_0x32d82a;}}class _0x1f0dba extends _0x39f2f6{constructor(_0x1cbb54,_0x5e69ae,_0x4c8646){const _0x120e0f=_0x1d78;super(_0x120e0f(0x1db)+_0x5e69ae+_0x120e0f(0x27b)+_0x1cbb54+'\x22\x20is\x20used\x20by:\x20'+_0x4c8646[_0x120e0f(0x124)](_0x2d4809=>_0x2d4809[_0x120e0f(0x1ab)]+':'+_0x2d4809[_0x120e0f(0x253)])[_0x120e0f(0x1ce)](',\x20'),_0x120e0f(0x19d),{'type':_0x1cbb54,'index':_0x5e69ae,'usedBy':_0x4c8646}),this[_0x120e0f(0x253)]=_0x120e0f(0x134);}}return okdbError={'OKDBError':_0x39f2f6,'OKDBVersionMismatchError':_0xf4f53f,'OKDBNotFoundError':_0x5a4d1b,'OKDBAlreadyExistsError':_0x21969f,'OKDBInvalidIndexKeyError':_0x5d8a16,'OKDBInvalidPrimaryKeyError':_0x45f366,'OKDBTypeNotRegisteredError':_0x5c8bf4,'OKDBTypeAlreadyRegisteredError':_0x54f48d,'OKDBIndexNotRegisteredError':_0x3e4bab,'OKDBIndexAlreadyRegisteredError':_0x34082d,'OKDBInvalidValueError':_0x402536,'OKDBUniqueConstraintError':_0xb4bee8,'OKDBSchemaValidationError':_0x170891,'OKDBSchemaCollectionError':_0x2e07d5,'OKDBForeignKeyError':_0xe89c8d,'OKDBForeignKeyDeleteError':_0x4ab416,'OKDBIndexHasConsumersError':_0x1f0dba},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x48a41b=_0x2c7ed1;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x18ff31,performance:_0x1c8110}=require$$0$1,_0x4c1507=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG==='true',_0x3f0c0c=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x4d0428=process.env.OKDB_LOOP_LAG_ALL==='1',_0x139a8e=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x1e7ecc{constructor(){const _0x1d1a35=_0x1d78;this[_0x1d1a35(0x191)]=_0x4c1507,this[_0x1d1a35(0x251)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x1d1a35(0x1c0)]=![],this[_0x1d1a35(0x1aa)]=(_0x5687f8,_0x1f0337)=>process[_0x1d1a35(0x235)][_0x1d1a35(0x129)](_0x5687f8+(_0x1f0337?'\x20'+JSON[_0x1d1a35(0x1f4)](_0x1f0337):'')+'\x0a');}[_0x48a41b(0x272)](){const _0x9ecaae=_0x48a41b;return _0x1c8110[_0x9ecaae(0x272)]();}['setLogger'](_0x574fa9){const _0x23747b=_0x48a41b;if(typeof _0x574fa9===_0x23747b(0x249))this[_0x23747b(0x1aa)]=_0x574fa9;}['note'](_0x1da940,_0x3c64f3,_0x14d537){const _0xaa92a9=_0x48a41b;if(!this['enabled'])return;let _0x40b21d=this['_buckets'][_0xaa92a9(0x11a)](_0x1da940);!_0x40b21d&&(_0x40b21d={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0xaa92a9(0x251)][_0xaa92a9(0x26a)](_0x1da940,_0x40b21d)),_0x40b21d['ms']+=_0x3c64f3,_0x40b21d[_0xaa92a9(0x1de)]+=0x1,_0x3c64f3>_0x40b21d[_0xaa92a9(0x180)]&&(_0x40b21d[_0xaa92a9(0x180)]=_0x3c64f3,_0x40b21d['maxExtra']=_0x14d537||'');}[_0x48a41b(0x223)](_0x3f716e){const _0x248850=_0x48a41b;if(!this[_0x248850(0x191)]||this[_0x248850(0x1c0)])return;this[_0x248850(0x1c0)]=!![];if(_0x3f716e)this[_0x248850(0x1aa)]=_0x3f716e;this['_h']=_0x18ff31({'resolution':0xa}),this['_h'][_0x248850(0x16f)](),this[_0x248850(0x250)]=setInterval(()=>this[_0x248850(0x142)](),_0x3f0c0c);if(this[_0x248850(0x250)][_0x248850(0x17c)])this['_timer'][_0x248850(0x17c)]();}['onWindow'](_0x74520e){const _0x23a95d=_0x48a41b;if(!this[_0x23a95d(0x24d)])this[_0x23a95d(0x24d)]=new Set();this['_windowCbs'][_0x23a95d(0x1e2)](_0x74520e);if(!this[_0x23a95d(0x1c0)])this[_0x23a95d(0x19e)]();}['offWindow'](_0x224161){const _0x147e45=_0x48a41b;this[_0x147e45(0x24d)]?.[_0x147e45(0x252)](_0x224161);}[_0x48a41b(0x19e)](){const _0xc4e63d=_0x48a41b;if(this[_0xc4e63d(0x270)])return;this[_0xc4e63d(0x270)]=!![];!this['_h']&&(this['_h']=_0x18ff31({'resolution':0xa}),this['_h'][_0xc4e63d(0x16f)]());const _0x18a0c9=_0x3f0c0c;this['_admissionTimer']=setInterval(()=>{const _0x10f18c=_0xc4e63d,_0x143fde=this['_h'];if(!_0x143fde)return;const _0x22d062=_0x143fde[_0x10f18c(0x204)](0x63)/0xf4240,_0x2fb06d=_0x143fde[_0x10f18c(0x1d1)]/0xf4240,_0x4ed8bf=_0x143fde['mean']/0xf4240;_0x143fde[_0x10f18c(0x284)]();if(this['_windowCbs'])for(const _0x4cc5a5 of this[_0x10f18c(0x24d)]){try{_0x4cc5a5({'p99Ms':_0x22d062,'maxMs':_0x2fb06d,'meanMs':_0x4ed8bf,'reportMs':_0x18a0c9});}catch{}}},_0x18a0c9);if(this['_admissionTimer']['unref'])this[_0xc4e63d(0x1fc)][_0xc4e63d(0x17c)]();}[_0x48a41b(0x142)](){const _0xf11dcb=_0x48a41b,_0xec383d=this['_h'],_0x240563=_0xec383d[_0xf11dcb(0x1d1)]/0xf4240,_0x5a506e=_0xec383d[_0xf11dcb(0x204)](0x63)/0xf4240,_0x56dbff=_0xec383d['mean']/0xf4240;_0xec383d[_0xf11dcb(0x284)]();const _0x5ee03a=[...this[_0xf11dcb(0x251)][_0xf11dcb(0x145)]()][_0xf11dcb(0x124)](([_0x3b9102,_0x4c8839])=>({'label':_0x3b9102,..._0x4c8839}))['sort']((_0x1a6fc8,_0x1261b7)=>_0x1261b7['ms']-_0x1a6fc8['ms'])['slice'](0x0,0x8);this['_buckets']['clear']();const _0x325456=_0x5ee03a['reduce']((_0x5d0c9d,_0x26db10)=>_0x5d0c9d+_0x26db10['ms'],0x0),_0x5c2ecf=_0x5ee03a['map'](_0x4e8a88=>_0x4e8a88['label']+'='+_0x4e8a88['ms']['toFixed'](0x0)+_0xf11dcb(0x240)+_0x4e8a88[_0xf11dcb(0x1de)]+(_0x4e8a88[_0xf11dcb(0x180)]>0x5?_0xf11dcb(0x14b)+_0x4e8a88[_0xf11dcb(0x180)][_0xf11dcb(0x1bf)](0x0)+'ms'+(_0x4e8a88[_0xf11dcb(0x26f)]?'\x20'+_0x4e8a88[_0xf11dcb(0x26f)]:'')+')':''));(_0x4d0428||_0x240563>=_0x139a8e)&&this[_0xf11dcb(0x1aa)]('loop-lag\x20'+_0x3f0c0c+_0xf11dcb(0x18e)+_0x240563['toFixed'](0x0)+_0xf11dcb(0x27a)+_0x5a506e['toFixed'](0x0)+'ms\x20mean='+_0x56dbff[_0xf11dcb(0x1bf)](0x0)+_0xf11dcb(0x16d)+_0x325456['toFixed'](0x0)+'ms'+(_0x5c2ecf[_0xf11dcb(0x1fe)]?'\x20│\x20'+_0x5c2ecf[_0xf11dcb(0x1ce)]('\x20\x20'):''),{'feature':_0xf11dcb(0x1f5)});if(this['_windowCbs'])for(const _0x6d87f2 of this[_0xf11dcb(0x24d)]){try{_0x6d87f2({'p99Ms':_0x5a506e,'maxMs':_0x240563,'meanMs':_0x56dbff,'reportMs':_0x3f0c0c});}catch{}}}[_0x48a41b(0x211)](){const _0x30adab=_0x48a41b;if(this[_0x30adab(0x250)])clearInterval(this[_0x30adab(0x250)]);if(this['_h'])this['_h'][_0x30adab(0x1e8)]();this[_0x30adab(0x250)]=null,this['_h']=null,this[_0x30adab(0x1c0)]=![];}}const _0x19e934=new _0x1e7ecc();if(_0x19e934['enabled'])_0x19e934[_0x48a41b(0x223)]();return okdbLoopMonitor={'LOOP':_0x19e934},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x4e74ee=_0x2c7ed1;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0x3867c1=require$$0$2,{EVENTS:_0x5847d6}=requireOkdbEnums(),{OKDBError:_0x132856}=requireOkdbError(),{LOOP:_0x1629df}=requireOkdbLoopMonitor();function _0x1a1f2b(_0x2b2884){const _0x364be0=_0x1d78;return _0x2b2884[_0x364be0(0x124)](_0x83093a=>{const _0x3238d9=_0x364be0,[_0x2823b4,_0x29b1ac]=_0x83093a[_0x3238d9(0x14a)]||[];return{'action':_0x83093a[_0x3238d9(0x162)],'type':_0x2823b4,'key':_0x29b1ac};});}class _0x5af86d{[_0x4e74ee(0x12a)];[_0x4e74ee(0x24e)]=[];[_0x4e74ee(0x258)]=[];[_0x4e74ee(0x1e7)]=[];constructor(_0x42b6e1,_0x24c386={'useReadTransaction':![]}){const _0x5b55ac=_0x4e74ee;this['okdb']=_0x42b6e1,this[_0x5b55ac(0x18a)]=_0x24c386,this['id']=_0x3867c1['v4'](),this['readTransaction']=this[_0x5b55ac(0x18a)][_0x5b55ac(0x14e)]?this[_0x5b55ac(0x12a)]['db'][_0x5b55ac(0x14e)]():null,this['_closed']=![];}['onDo'](_0xc0ec4d){const _0x420fd6=_0x4e74ee;this['_doHooks'][_0x420fd6(0x14f)](_0xc0ec4d);}[_0x4e74ee(0x21a)](_0x15709f){const _0x44089f=_0x4e74ee;this[_0x44089f(0x1e7)]['push'](_0x15709f);}[_0x4e74ee(0x225)](){const _0x34e6f6=_0x4e74ee;if(!this['readTransaction'])return;try{this['readTransaction']['done']();}catch(_0x49b4b8){}this[_0x34e6f6(0x255)]=null;}[_0x4e74ee(0x1a4)](){const _0xd758b3=_0x4e74ee;if(this[_0xd758b3(0x112)])throw new _0x132856(_0xd758b3(0x118),_0xd758b3(0x271));}['get'](_0xf0c2a7,_0x4a47c6){return this['_assertOpen'](),this['okdb']['get'](_0xf0c2a7,_0x4a47c6,{'transaction':this['readTransaction']});}['getEntry'](_0x1c064b,_0x2aff47){const _0x415bd6=_0x4e74ee;return this[_0x415bd6(0x1a4)](),this[_0x415bd6(0x12a)][_0x415bd6(0x19b)](_0x1c064b,_0x2aff47,{'transaction':this[_0x415bd6(0x255)]});}[_0x4e74ee(0x263)](_0x3b30b0,_0x59b35d){const _0x179192=_0x4e74ee;return this[_0x179192(0x1a4)](),this[_0x179192(0x12a)][_0x179192(0x263)](_0x3b30b0,_0x59b35d,{'transaction':this[_0x179192(0x255)]});}[_0x4e74ee(0x176)](_0x36da6e,_0x391a34={}){const _0x5a09b6=_0x4e74ee;return this[_0x5a09b6(0x1a4)](),this[_0x5a09b6(0x12a)]['getRange'](_0x36da6e,{'transaction':this[_0x5a09b6(0x255)],..._0x391a34});}[_0x4e74ee(0x18c)](_0x5cde8d,_0x278a8d={}){return this['_assertOpen'](),this['okdb']['getValues'](_0x5cde8d,{'transaction':this['readTransaction'],..._0x278a8d});}['getKeys'](_0x5d6c8e,_0x2d6510={}){const _0x2546d9=_0x4e74ee;return this[_0x2546d9(0x1a4)](),this[_0x2546d9(0x12a)][_0x2546d9(0x27f)](_0x5d6c8e,{'transaction':this[_0x2546d9(0x255)],..._0x2d6510});}['byIndex'](_0x56e5b4,_0x899db,_0x3a0a9d={}){const _0xa85fc=_0x4e74ee;return this[_0xa85fc(0x1a4)](),this[_0xa85fc(0x12a)][_0xa85fc(0x214)](_0x56e5b4,_0x899db,{'transaction':this['readTransaction'],..._0x3a0a9d});}['query'](_0x1e78e8,_0x2d253f,_0x2a5afb={}){const _0x19a498=_0x4e74ee;return this['_assertOpen'](),this[_0x19a498(0x12a)][_0x19a498(0x1e9)](_0x1e78e8,_0x2d253f,{'transaction':this['readTransaction'],..._0x2a5afb});}['getClock'](_0x2831bb=null){const _0x158b5e=_0x4e74ee;return this[_0x158b5e(0x1a4)](),this['okdb'][_0x158b5e(0x222)](_0x2831bb,{'transaction':this[_0x158b5e(0x255)]});}['getCount'](_0x4f06c6){const _0x2361e6=_0x4e74ee;return this[_0x2361e6(0x1a4)](),this[_0x2361e6(0x12a)][_0x2361e6(0x137)](_0x4f06c6,{'transaction':this[_0x2361e6(0x255)]});}['put'](_0x2553c0,_0x203a68,_0x21e04f,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x57b2cd=_0x4e74ee;this['actions'][_0x57b2cd(0x14f)]({'action':_0x57b2cd(0x15e),'args':[_0x2553c0,_0x203a68,_0x21e04f,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x192)](_0x26f080,_0x3da62c,_0x2769a1,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x28e300=_0x4e74ee;this[_0x28e300(0x24e)][_0x28e300(0x14f)]({'action':_0x28e300(0x192),'args':[_0x26f080,_0x3da62c,_0x2769a1,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x25a)](_0x3e7474,_0x2a69ec,_0x18fcf4,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x2a7d56=_0x4e74ee;this[_0x2a7d56(0x24e)][_0x2a7d56(0x14f)]({'action':'patch','args':[_0x3e7474,_0x2a69ec,_0x18fcf4,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x156)](_0x4365d3,_0x20f457,_0x2d4544,{version:version=null,timestamp:timestamp=Date[_0x4e74ee(0x272)](),origin:origin=null,ttl:ttl=null}={}){const _0x3cce91=_0x4e74ee;this[_0x3cce91(0x24e)][_0x3cce91(0x14f)]({'action':_0x3cce91(0x156),'args':[_0x4365d3,_0x20f457,_0x2d4544,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x4e74ee(0x1f2)](_0x32ac7e,_0x2ff8dc,{ifVersion:ifVersion=null,timestamp:timestamp=Date['now'](),origin:origin=null}={}){const _0x2e4d4c=_0x4e74ee;this['actions'][_0x2e4d4c(0x14f)]({'action':_0x2e4d4c(0x1f2),'args':[_0x32ac7e,_0x2ff8dc,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}['setTTL'](_0x513263,_0x559ce9,_0x4b7cfb){const _0x1364e6=_0x4e74ee;this['actions']['push']({'action':_0x1364e6(0x259),'args':[_0x513263,_0x559ce9,_0x4b7cfb]});}[_0x4e74ee(0x277)](_0x49df12,_0x5aa32b){const _0x57a898=_0x4e74ee;this[_0x57a898(0x24e)][_0x57a898(0x14f)]({'action':'clearTTL','args':[_0x49df12,_0x5aa32b]});}['rollback'](){const _0x2e41f9=_0x4e74ee;if(this[_0x2e41f9(0x112)])return;for(const _0x2c5d93 of this[_0x2e41f9(0x1e7)]){try{_0x2c5d93();}catch{}}this[_0x2e41f9(0x12a)][_0x2e41f9(0x194)][_0x2e41f9(0x216)](_0x5847d6[_0x2e41f9(0x229)],{'id':this['id']}),this[_0x2e41f9(0x24e)]=[],this[_0x2e41f9(0x225)](),this[_0x2e41f9(0x112)]=!![];}async[_0x4e74ee(0x24b)](){const _0x1621df=_0x4e74ee;if(this[_0x1621df(0x112)])throw new Error(_0x1621df(0x118));const _0x5ac287={'id':this['id'],'timestamp':Date[_0x1621df(0x272)](),'actions':this[_0x1621df(0x24e)]};this['okdb'][_0x1621df(0x194)][_0x1621df(0x216)](_0x5847d6['TXN_START'],_0x5ac287);try{const _0x59433e=_0x1629df[_0x1621df(0x191)]?_0x1629df[_0x1621df(0x272)]():0x0;await this[_0x1621df(0x12a)][_0x1621df(0x18d)][_0x1621df(0x188)](()=>{const _0x4deefb=_0x1621df;for(const _0x522b39 of this[_0x4deefb(0x24e)]){const _0xbed48e=this[_0x4deefb(0x12a)]['_'+_0x522b39[_0x4deefb(0x162)]];if(typeof _0xbed48e!==_0x4deefb(0x249))throw new Error(_0x4deefb(0x1a9)+_0x522b39[_0x4deefb(0x162)]);_0xbed48e['call'](this['okdb'],this,..._0x522b39['args']);}}),_0x1629df[_0x1621df(0x191)]&&_0x1629df['note'](_0x1621df(0x21b),_0x1629df[_0x1621df(0x272)]()-_0x59433e,(this[_0x1621df(0x12a)][_0x1621df(0x253)]??'?')+'\x20actions='+this[_0x1621df(0x24e)][_0x1621df(0x1fe)]);}catch(_0x2eb9c2){for(const _0x2f3ac6 of this[_0x1621df(0x1e7)]){try{_0x2f3ac6();}catch{}}this['_closeReadTransaction'](),this['_closed']=!![];if(_0x2eb9c2 instanceof _0x132856)throw _0x2eb9c2;const _0x243692={'cause':_0x2eb9c2,'env':this[_0x1621df(0x12a)]?.[_0x1621df(0x253)],'envPath':this[_0x1621df(0x12a)]?.['path'],'pid':process['pid'],'txnId':this['id'],'actionCount':this[_0x1621df(0x24e)]['length'],'actions':_0x1a1f2b(this[_0x1621df(0x24e)]),'nativeCode':_0x2eb9c2?.[_0x1621df(0x205)],'nativeName':_0x2eb9c2?.['name']};try{this[_0x1621df(0x12a)]?.[_0x1621df(0x159)]?.[_0x1621df(0x1be)]?.(_0x1621df(0x15c),{'env':_0x243692[_0x1621df(0x126)],'envPath':_0x243692[_0x1621df(0x24c)],'pid':_0x243692[_0x1621df(0x231)],'txnId':_0x243692[_0x1621df(0x245)],'actionCount':_0x243692[_0x1621df(0x171)],'actions':_0x243692['actions'],'nativeCode':_0x243692[_0x1621df(0x1d2)],'error':_0x2eb9c2?.[_0x1621df(0x165)],'stack':_0x2eb9c2?.[_0x1621df(0x1c2)]});}catch{}throw new _0x132856(_0x2eb9c2?.[_0x1621df(0x165)]||_0x1621df(0x119),_0x1621df(0x121),_0x243692);}this['okdb']['events'][_0x1621df(0x216)](_0x5847d6['TXN_END'],_0x5ac287);for(const _0xeed0e7 of this['_doHooks']){try{await _0xeed0e7();}catch{}}this[_0x1621df(0x24e)]=[],this['_closeReadTransaction'](),this[_0x1621df(0x112)]=!![];}static[_0x4e74ee(0x23b)](_0x5793d4){const _0x1f3aa9=_0x4e74ee;return Object[_0x1f3aa9(0x12d)]({'id':_0x5793d4['id'],'put':_0x5793d4[_0x1f3aa9(0x15e)][_0x1f3aa9(0x273)](_0x5793d4),'update':_0x5793d4['update'][_0x1f3aa9(0x273)](_0x5793d4),'patch':_0x5793d4[_0x1f3aa9(0x25a)][_0x1f3aa9(0x273)](_0x5793d4),'create':_0x5793d4['create'][_0x1f3aa9(0x273)](_0x5793d4),'remove':_0x5793d4[_0x1f3aa9(0x1f2)][_0x1f3aa9(0x273)](_0x5793d4),'setTTL':_0x5793d4[_0x1f3aa9(0x259)]['bind'](_0x5793d4),'clearTTL':_0x5793d4[_0x1f3aa9(0x277)]['bind'](_0x5793d4),'commit':_0x5793d4['commit'][_0x1f3aa9(0x273)](_0x5793d4),'rollback':_0x5793d4[_0x1f3aa9(0x217)][_0x1f3aa9(0x273)](_0x5793d4),'get':_0x5793d4['get'][_0x1f3aa9(0x273)](_0x5793d4),'getEntry':_0x5793d4[_0x1f3aa9(0x19b)][_0x1f3aa9(0x273)](_0x5793d4),'getMany':_0x5793d4['getMany'][_0x1f3aa9(0x273)](_0x5793d4),'getRange':_0x5793d4[_0x1f3aa9(0x176)][_0x1f3aa9(0x273)](_0x5793d4),'getValues':_0x5793d4[_0x1f3aa9(0x18c)]['bind'](_0x5793d4),'getKeys':_0x5793d4[_0x1f3aa9(0x27f)]['bind'](_0x5793d4),'byIndex':_0x5793d4[_0x1f3aa9(0x214)][_0x1f3aa9(0x273)](_0x5793d4),'query':_0x5793d4[_0x1f3aa9(0x1e9)][_0x1f3aa9(0x273)](_0x5793d4),'getClock':_0x5793d4['getClock'][_0x1f3aa9(0x273)](_0x5793d4),'getCount':_0x5793d4[_0x1f3aa9(0x137)][_0x1f3aa9(0x273)](_0x5793d4),'read':_0x5793d4,'raw':_0x5793d4});}static[_0x4e74ee(0x20a)](_0x1aea79,_0x205523=[]){const _0x5a23fd=_0x4e74ee;if(!Array[_0x5a23fd(0x264)](_0x205523))throw new _0x132856(_0x5a23fd(0x206),_0x5a23fd(0x278));for(const _0xe055b1 of _0x205523){if(Array[_0x5a23fd(0x264)](_0xe055b1)){const [_0x564264,..._0x5c9ca2]=_0xe055b1;if(typeof _0x1aea79[_0x564264]!==_0x5a23fd(0x249))throw new _0x132856(_0x5a23fd(0x1a9)+_0x564264,_0x5a23fd(0x22b),{'action':_0x564264});_0x1aea79[_0x564264](..._0x5c9ca2);continue;}if(!_0xe055b1||typeof _0xe055b1!==_0x5a23fd(0x1b9))throw new _0x132856('txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple','TXN_INVALID_OP');const {action:_0x2cfa35}=_0xe055b1;if(typeof _0x2cfa35!==_0x5a23fd(0x24a)||typeof _0x1aea79[_0x2cfa35]!==_0x5a23fd(0x249))throw new _0x132856(_0x5a23fd(0x1a9)+_0x2cfa35,_0x5a23fd(0x22b),{'action':_0x2cfa35});switch(_0x2cfa35){case _0x5a23fd(0x15e):case _0x5a23fd(0x192):case _0x5a23fd(0x156):_0x1aea79[_0x2cfa35](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1['key'],_0xe055b1[_0x5a23fd(0x1e1)],{..._0xe055b1['options'],'ttl':_0xe055b1[_0x5a23fd(0x14c)]??_0xe055b1[_0x5a23fd(0x18a)]?.[_0x5a23fd(0x14c)]??null});break;case _0x5a23fd(0x25a):_0x1aea79[_0x5a23fd(0x25a)](_0xe055b1['type'],_0xe055b1['key'],_0xe055b1['patch'],{..._0xe055b1[_0x5a23fd(0x18a)],'ttl':_0xe055b1[_0x5a23fd(0x14c)]??_0xe055b1[_0x5a23fd(0x18a)]?.[_0x5a23fd(0x14c)]??null});break;case _0x5a23fd(0x1f2):_0x1aea79[_0x5a23fd(0x1f2)](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1[_0x5a23fd(0x13c)],_0xe055b1[_0x5a23fd(0x18a)]||{});break;case _0x5a23fd(0x259):_0x1aea79[_0x5a23fd(0x259)](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1['key'],_0xe055b1['ttl']);break;case _0x5a23fd(0x277):_0x1aea79[_0x5a23fd(0x277)](_0xe055b1[_0x5a23fd(0x190)],_0xe055b1[_0x5a23fd(0x13c)]);break;default:throw new _0x132856('Unsupported\x20transaction\x20action:\x20'+_0x2cfa35,'TXN_INVALID_ACTION',{'action':_0x2cfa35});}}}static async[_0x4e74ee(0x123)](_0x40e062,_0xd82436,_0x53743a={}){const _0x47bd8b=_0x4e74ee,_0x6e3a4e=new _0x5af86d(_0x40e062,_0x53743a),_0x3c7670=_0x5af86d[_0x47bd8b(0x23b)](_0x6e3a4e);try{typeof _0xd82436===_0x47bd8b(0x249)?await _0xd82436(_0x3c7670):_0x5af86d[_0x47bd8b(0x20a)](_0x6e3a4e,_0xd82436||[]);const _0x59e642=_0x6e3a4e[_0x47bd8b(0x24e)][_0x47bd8b(0x1fe)];return await _0x6e3a4e['commit'](),{'id':_0x6e3a4e['id'],'actions':_0x59e642};}catch(_0x55d563){try{_0x6e3a4e[_0x47bd8b(0x217)]();}catch(_0x115d7c){}throw _0x55d563;}}}return okdbTransaction=_0x5af86d,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x5becbd=requireOkdbTransaction();function _0x1d3b81(_0xfa17ee){const _0x1d742c=_0x1d78;return{'transaction':typeof _0xfa17ee['transaction']===_0x1d742c(0x249)?_0xfa17ee[_0x1d742c(0x188)][_0x1d742c(0x273)](_0xfa17ee):_0x18e772=>new _0x5becbd(_0xfa17ee,_0x18e772),'txn':typeof _0xfa17ee[_0x1d742c(0x150)]==='function'?_0xfa17ee[_0x1d742c(0x150)][_0x1d742c(0x273)](_0xfa17ee):(_0x2eba82,_0x303916)=>_0x5becbd[_0x1d742c(0x123)](_0xfa17ee,_0x2eba82,_0x303916)};}function _0x57f11e(_0x192db8){const _0xce997=_0x1d78;return{'name':_0x192db8[_0xce997(0x253)],..._0x1d3b81(_0x192db8),'put':_0x192db8[_0xce997(0x15e)][_0xce997(0x273)](_0x192db8),'update':_0x192db8[_0xce997(0x192)][_0xce997(0x273)](_0x192db8),'patch':_0x192db8[_0xce997(0x25a)][_0xce997(0x273)](_0x192db8),'create':_0x192db8['create'][_0xce997(0x273)](_0x192db8),'remove':_0x192db8[_0xce997(0x1f2)][_0xce997(0x273)](_0x192db8),'get':_0x192db8['get'][_0xce997(0x273)](_0x192db8),'getMany':_0x192db8[_0xce997(0x263)][_0xce997(0x273)](_0x192db8),'getEntry':_0x192db8[_0xce997(0x19b)][_0xce997(0x273)](_0x192db8),'getRange':_0x192db8[_0xce997(0x176)][_0xce997(0x273)](_0x192db8),'getValues':_0x192db8[_0xce997(0x18c)][_0xce997(0x273)](_0x192db8),'getKeys':_0x192db8[_0xce997(0x27f)][_0xce997(0x273)](_0x192db8),'getCount':_0x192db8[_0xce997(0x137)][_0xce997(0x273)](_0x192db8),'getByPrefix':_0x192db8[_0xce997(0x20e)][_0xce997(0x273)](_0x192db8),'getIndex':_0x192db8[_0xce997(0x207)][_0xce997(0x273)](_0x192db8),'byIndex':_0x192db8[_0xce997(0x214)][_0xce997(0x273)](_0x192db8),'query':_0x192db8[_0xce997(0x1e9)][_0xce997(0x273)](_0x192db8),'geoQuery':_0x192db8[_0xce997(0x22e)]['bind'](_0x192db8),'ftsQuery':_0x192db8['ftsQuery']['bind'](_0x192db8),'setTTL':_0x192db8['setTTL'][_0xce997(0x273)](_0x192db8),'getTTL':_0x192db8['getTTL'][_0xce997(0x273)](_0x192db8),'clearTTL':_0x192db8['clearTTL'][_0xce997(0x273)](_0x192db8),'sweepExpiredTTL':_0x192db8[_0xce997(0x154)][_0xce997(0x273)](_0x192db8),'listTTL':_0x192db8[_0xce997(0x1da)][_0xce997(0x273)](_0x192db8),'ttlStats':_0x192db8[_0xce997(0x196)][_0xce997(0x273)](_0x192db8),'setDefaultTTL':_0x192db8[_0xce997(0x19c)][_0xce997(0x273)](_0x192db8),'getDefaultTTL':_0x192db8['getDefaultTTL'][_0xce997(0x273)](_0x192db8),'clearDefaultTTL':_0x192db8['clearDefaultTTL'][_0xce997(0x273)](_0x192db8),'registerType':_0x192db8[_0xce997(0x280)]['bind'](_0x192db8),'ensureType':_0x192db8[_0xce997(0x131)][_0xce997(0x273)](_0x192db8),'hasType':_0x192db8['hasType'][_0xce997(0x273)](_0x192db8),'dropType':_0x192db8['dropType'][_0xce997(0x273)](_0x192db8),'registerIndex':_0x192db8['registerIndex'][_0xce997(0x273)](_0x192db8),'hasIndex':_0x192db8[_0xce997(0x17e)][_0xce997(0x273)](_0x192db8),'dropIndex':_0x192db8[_0xce997(0x242)][_0xce997(0x273)](_0x192db8),'resetIndex':_0x192db8['resetIndex']['bind'](_0x192db8),'indexReady':_0x192db8['indexReady'][_0xce997(0x273)](_0x192db8),'getIndexStatus':_0x192db8[_0xce997(0x15a)][_0xce997(0x273)](_0x192db8),'getClock':_0x192db8['getClock'][_0xce997(0x273)](_0x192db8),'getChanges':_0x192db8[_0xce997(0x208)][_0xce997(0x273)](_0x192db8),'count':_0x192db8[_0xce997(0x1de)][_0xce997(0x273)](_0x192db8),'range':_0x192db8[_0xce997(0x183)][_0xce997(0x273)](_0x192db8),'now':_0x192db8[_0xce997(0x272)][_0xce997(0x273)](_0x192db8)};}function _0x51ba7a(_0x33c266){const _0x124d2c=_0x1d78;if(!_0x33c266)return null;const _0x4e9815={};for(const _0x218e8c of[_0x124d2c(0x167),_0x124d2c(0x210),'list',_0x124d2c(0x13e),_0x124d2c(0x23e),_0x124d2c(0x243),_0x124d2c(0x22a),_0x124d2c(0x1b3)]){if(typeof _0x33c266[_0x218e8c]===_0x124d2c(0x249))_0x4e9815[_0x218e8c]=_0x33c266[_0x218e8c][_0x124d2c(0x273)](_0x33c266);}return Object[_0x124d2c(0x1c6)](_0x4e9815)[_0x124d2c(0x1fe)]?_0x4e9815:null;}function _0x5b6ebb(_0x485023){const _0x1b25f9=_0x1d78;if(!_0x485023)return null;const _0x564a5b={};for(const _0x1de119 of[_0x1b25f9(0x1e5),'stream',_0x1b25f9(0x1f2),'get',_0x1b25f9(0x1cc),_0x1b25f9(0x16a)]){if(typeof _0x485023[_0x1de119]===_0x1b25f9(0x249))_0x564a5b[_0x1de119]=_0x485023[_0x1de119][_0x1b25f9(0x273)](_0x485023);}return Object[_0x1b25f9(0x1c6)](_0x564a5b)['length']?_0x564a5b:null;}function _0x2b1153(_0x401e9f){const _0x4486f3=_0x1d78;return{'env':_0x401e9f[_0x4486f3(0x126)][_0x4486f3(0x273)](_0x401e9f),'createEnvironment':_0x401e9f[_0x4486f3(0x254)][_0x4486f3(0x273)](_0x401e9f),'removeEnvironment':_0x401e9f['removeEnvironment'][_0x4486f3(0x273)](_0x401e9f),'info':_0x401e9f[_0x4486f3(0x115)],..._0x1d3b81(_0x401e9f),'put':_0x401e9f[_0x4486f3(0x15e)][_0x4486f3(0x273)](_0x401e9f),'update':_0x401e9f[_0x4486f3(0x192)][_0x4486f3(0x273)](_0x401e9f),'patch':_0x401e9f[_0x4486f3(0x25a)][_0x4486f3(0x273)](_0x401e9f),'create':_0x401e9f['create'][_0x4486f3(0x273)](_0x401e9f),'remove':_0x401e9f[_0x4486f3(0x1f2)][_0x4486f3(0x273)](_0x401e9f),'get':_0x401e9f['get']['bind'](_0x401e9f),'getMany':_0x401e9f[_0x4486f3(0x263)]['bind'](_0x401e9f),'getEntry':_0x401e9f[_0x4486f3(0x19b)]['bind'](_0x401e9f),'getRange':_0x401e9f['getRange'][_0x4486f3(0x273)](_0x401e9f),'getValues':_0x401e9f[_0x4486f3(0x18c)][_0x4486f3(0x273)](_0x401e9f),'getKeys':_0x401e9f['getKeys'][_0x4486f3(0x273)](_0x401e9f),'getCount':_0x401e9f['getCount'][_0x4486f3(0x273)](_0x401e9f),'getByPrefix':_0x401e9f[_0x4486f3(0x20e)][_0x4486f3(0x273)](_0x401e9f),'getIndex':_0x401e9f[_0x4486f3(0x207)][_0x4486f3(0x273)](_0x401e9f),'byIndex':_0x401e9f[_0x4486f3(0x214)][_0x4486f3(0x273)](_0x401e9f),'query':_0x401e9f[_0x4486f3(0x1e9)]['bind'](_0x401e9f),'setTTL':_0x401e9f[_0x4486f3(0x259)][_0x4486f3(0x273)](_0x401e9f),'getTTL':_0x401e9f[_0x4486f3(0x1ef)][_0x4486f3(0x273)](_0x401e9f),'clearTTL':_0x401e9f[_0x4486f3(0x277)][_0x4486f3(0x273)](_0x401e9f),'sweepExpiredTTL':_0x401e9f['sweepExpiredTTL'][_0x4486f3(0x273)](_0x401e9f),'listTTL':_0x401e9f[_0x4486f3(0x1da)]['bind'](_0x401e9f),'ttlStats':_0x401e9f[_0x4486f3(0x196)][_0x4486f3(0x273)](_0x401e9f),'setDefaultTTL':_0x401e9f[_0x4486f3(0x19c)][_0x4486f3(0x273)](_0x401e9f),'getDefaultTTL':_0x401e9f['getDefaultTTL'][_0x4486f3(0x273)](_0x401e9f),'clearDefaultTTL':_0x401e9f[_0x4486f3(0x160)]['bind'](_0x401e9f),'ensureType':_0x401e9f[_0x4486f3(0x131)][_0x4486f3(0x273)](_0x401e9f),'registerType':_0x401e9f[_0x4486f3(0x280)][_0x4486f3(0x273)](_0x401e9f),'hasType':_0x401e9f[_0x4486f3(0x113)][_0x4486f3(0x273)](_0x401e9f),'dropType':_0x401e9f['dropType'][_0x4486f3(0x273)](_0x401e9f),'registerIndex':_0x401e9f[_0x4486f3(0x234)][_0x4486f3(0x273)](_0x401e9f),'hasIndex':_0x401e9f['hasIndex']['bind'](_0x401e9f),'dropIndex':_0x401e9f[_0x4486f3(0x242)][_0x4486f3(0x273)](_0x401e9f),'resetIndex':_0x401e9f[_0x4486f3(0x149)][_0x4486f3(0x273)](_0x401e9f),'indexReady':_0x401e9f['indexReady'][_0x4486f3(0x273)](_0x401e9f),'getIndexStatus':_0x401e9f[_0x4486f3(0x15a)]['bind'](_0x401e9f),'getClock':_0x401e9f[_0x4486f3(0x222)][_0x4486f3(0x273)](_0x401e9f),'getChanges':_0x401e9f[_0x4486f3(0x208)][_0x4486f3(0x273)](_0x401e9f),'queue':_0x401e9f[_0x4486f3(0x198)],'files':_0x401e9f[_0x4486f3(0x232)]};}return okdbFunctionsFacades={'createEnvFacade':_0x57f11e,'createQueueFacade':_0x51ba7a,'createFilesFacade':_0x5b6ebb,'createGlobalFacade':_0x2b1153},okdbFunctionsFacades;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x10f12a=_0x2c7ed1;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0x5db320=new Set([_0x10f12a(0x15e),_0x10f12a(0x25a),_0x10f12a(0x156),_0x10f12a(0x1f2),_0x10f12a(0x192),'setTTL',_0x10f12a(0x277),_0x10f12a(0x154),'setDefaultTTL',_0x10f12a(0x160),'dropType',_0x10f12a(0x242),'resetIndex']),_0x4b3aa6=new Set([_0x10f12a(0x167),'updateJob','removeJob',_0x10f12a(0x243)]),_0x157b0e=new Set([_0x10f12a(0x1e5),'remove']);function _0x39345f(_0x7ded98,_0x301a25){const _0x202e01=_0x10f12a;if(_0x7ded98===_0x202e01(0x126)||_0x7ded98===_0x202e01(0x1d7))return _0x5db320[_0x202e01(0x147)](_0x301a25);if(_0x7ded98===_0x202e01(0x198))return _0x4b3aa6[_0x202e01(0x147)](_0x301a25);if(_0x7ded98===_0x202e01(0x232))return _0x157b0e[_0x202e01(0x147)](_0x301a25);return![];}function _0x1121fb(_0x1082fb,_0x48d1df,_0x5bf8e4,_0x40c9da){if(!_0x1082fb)return _0x1082fb;return new Proxy(_0x1082fb,{'get'(_0x3b69ce,_0x180492,_0x355444){const _0x3275ca=_0x1d78,_0x173e87=Reflect[_0x3275ca(0x11a)](_0x3b69ce,_0x180492,_0x355444);if(typeof _0x173e87!=='function')return _0x173e87;if(!_0x39345f(_0x48d1df,_0x180492))return _0x173e87[_0x3275ca(0x273)](_0x3b69ce);return function(..._0x386015){const _0x187581=_0x3275ca;return _0x40c9da[_0x187581(0x14f)]({'scope':_0x48d1df,'method':_0x180492,'envName':_0x5bf8e4,'args':_0x386015}),null;};}});}function _0xec4e49(_0x4eaf20,_0x2a25e4,_0x536702,_0x2ab3ea){const _0x20eca4={};for(const _0x2b288f of _0x536702){_0x20eca4[_0x2b288f]=(..._0x5ed6eb)=>{const _0x2bc846=_0x1d78;return _0x39345f(_0x4eaf20,_0x2b288f)&&_0x2ab3ea[_0x2bc846(0x14f)]({'scope':_0x4eaf20,'method':_0x2b288f,'envName':_0x2a25e4,'args':_0x5ed6eb}),null;};}return _0x20eca4;}return okdbFunctionsDryrun={'isWriteMethod':_0x39345f,'wrapForDryRun':_0x1121fb,'syntheticDryRunFacade':_0xec4e49,'ENV_WRITE_METHODS':_0x5db320,'QUEUE_WRITE_METHODS':_0x4b3aa6,'FILES_WRITE_METHODS':_0x157b0e},okdbFunctionsDryrun;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function requireOkdbFunctionsContext(){const _0x57f005=_0x2c7ed1;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x56dd3f,createQueueFacade:_0x57a025,createFilesFacade:_0x1e11c8,createGlobalFacade:_0x9f9b67}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x50b498,syntheticDryRunFacade:_0x41975c}=requireOkdbFunctionsDryrun(),_0xa63a88=[_0x57f005(0x167),_0x57f005(0x210),_0x57f005(0x1cc),_0x57f005(0x13e),_0x57f005(0x23e),_0x57f005(0x243),'getBucket','listBuckets'],_0x4a41b2=[_0x57f005(0x1e5),_0x57f005(0x181),_0x57f005(0x1f2),_0x57f005(0x11a),_0x57f005(0x1cc),_0x57f005(0x16a)];function _0x39aaa6(_0x72be09,_0x3a1fd9){const _0x59d782=_0x57f005,_0xa7e6bc=(_0x1e1f30,_0x4f0bd0,_0xddfbf6)=>_0x3a1fd9({'type':_0x59d782(0x159),'requestId':_0x72be09[_0x59d782(0x20f)],'runId':_0x72be09[_0x59d782(0x26b)],'entry':{'level':_0x1e1f30,'msg':_0x4f0bd0,'context':_0xddfbf6,'ts':Date[_0x59d782(0x272)]()}}),_0xd02866=(_0x380dc7,_0x76e738)=>_0xa7e6bc('info',_0x380dc7,_0x76e738);return _0xd02866['info']=(_0x5b1d5a,_0x3234ba)=>_0xa7e6bc('info',_0x5b1d5a,_0x3234ba),_0xd02866['warn']=(_0x40fbde,_0x14607a)=>_0xa7e6bc(_0x59d782(0x237),_0x40fbde,_0x14607a),_0xd02866[_0x59d782(0x1be)]=(_0x3cbce1,_0x30e138)=>_0xa7e6bc(_0x59d782(0x1be),_0x3cbce1,_0x30e138),_0xd02866['debug']=(_0xe5209c,_0x29b0d2)=>_0xa7e6bc(_0x59d782(0x1b8),_0xe5209c,_0x29b0d2),_0xd02866;}function _0x307a7e(_0x43764a,_0x1ab009,_0xc2e409){const _0x3ff36a=_0x57f005;if(!_0x43764a)return null;return{'id':_0x43764a['id']??null,'type':_0x43764a['type']??null,'tries':_0x43764a[_0x3ff36a(0x17a)]??null,'created':_0x43764a[_0x3ff36a(0x1af)]??null,'tags':_0x43764a[_0x3ff36a(0x1a3)]??null,'priority':_0x43764a[_0x3ff36a(0x269)]??null,'bucket':_0x43764a[_0x3ff36a(0x21f)]??null,'cron':_0x43764a[_0x3ff36a(0x20d)]??null,'heartbeat'(){const _0x16e0ff=_0x3ff36a;_0xc2e409({'type':_0x16e0ff(0x13f),'requestId':_0x1ab009[_0x16e0ff(0x20f)],'runId':_0x1ab009['runId'],'jobId':_0x43764a['id'],'claimId':_0x43764a[_0x16e0ff(0x17f)]});},'markProgress'(_0x4f795d){const _0x1163c3=_0x3ff36a;_0xc2e409({'type':'job_progress','requestId':_0x1ab009[_0x1163c3(0x20f)],'runId':_0x1ab009['runId'],'jobId':_0x43764a['id'],'claimId':_0x43764a['claimId'],'message':_0x4f795d});}};}function _0xc1553d(_0x40b263){const _0x15ca97=_0x57f005;if(!_0x40b263)return null;return{'mode':_0x40b263[_0x15ca97(0x1bc)]??null,'sourceType':_0x40b263['sourceType']??null,'sourceEnv':_0x40b263[_0x15ca97(0x1eb)]??null,'processor':_0x40b263[_0x15ca97(0x275)]??null,'engineKey':_0x40b263[_0x15ca97(0x1c1)]??null,'cursorKey':_0x40b263[_0x15ca97(0x21c)]??null};}function _0x448c58(_0x205e46){const _0x1f0edf=_0x57f005;if(!_0x205e46)return null;return{'mode':_0x205e46[_0x1f0edf(0x1bc)]??null,'sourceType':_0x205e46[_0x1f0edf(0x228)]??null,'targetType':_0x205e46[_0x1f0edf(0x27c)]??null,'sourceEnv':_0x205e46[_0x1f0edf(0x1eb)]??null,'targetEnv':_0x205e46[_0x1f0edf(0x186)]??null,'engineKey':_0x205e46['engineKey']??null,'cursorKey':_0x205e46[_0x1f0edf(0x21c)]??null};}function _0xb0ed37(_0x4c6876,_0x49b3df,_0x3595ee,_0x21daf9=null,_0x395e47=null){const _0x1fc518=_0x57f005,_0x13b805={'runId':_0x49b3df[_0x1fc518(0x26b)],'scope':_0x1fc518(0x126),'env':_0x49b3df['envName']??null,'functionName':_0x49b3df[_0x1fc518(0x21e)],'trigger':_0x49b3df[_0x1fc518(0x115)]?.['trigger']??_0x1fc518(0x1c7),'requestedAt':_0x49b3df[_0x1fc518(0x115)]?.[_0x1fc518(0x20b)]??Date[_0x1fc518(0x272)]()},_0x2ccaef=_0x39aaa6(_0x49b3df,_0x3595ee),_0x474063=AbortSignal[_0x1fc518(0x1fd)](Math[_0x1fc518(0x1d1)](0x1,_0x49b3df['runtime']?.[_0x1fc518(0x25e)]??0x3e8)),_0x1351e7=_0x395e47?AbortSignal[_0x1fc518(0x281)]([_0x474063,_0x395e47]):_0x474063,_0x26edd1=_0x4c6876[_0x1fc518(0x126)](_0x49b3df[_0x1fc518(0x1f1)]),_0x599aea=_0x21daf9?_0x50b498(_0x26edd1,_0x1fc518(0x126),_0x49b3df[_0x1fc518(0x1f1)],_0x21daf9):_0x26edd1,_0x4824e0=_0x21daf9?_0x26edd1['queue']?_0x50b498(_0x26edd1[_0x1fc518(0x198)],_0x1fc518(0x198),_0x49b3df[_0x1fc518(0x1f1)],_0x21daf9):_0x41975c(_0x1fc518(0x198),_0x49b3df[_0x1fc518(0x1f1)],_0xa63a88,_0x21daf9):_0x26edd1[_0x1fc518(0x198)],_0x24867a=_0x21daf9?_0x26edd1[_0x1fc518(0x232)]?_0x50b498(_0x26edd1['files'],_0x1fc518(0x232),_0x49b3df[_0x1fc518(0x1f1)],_0x21daf9):_0x41975c(_0x1fc518(0x232),_0x49b3df['envName'],_0x4a41b2,_0x21daf9):_0x26edd1['files'],_0x33523a=_0x56dd3f(_0x599aea),_0x34278f=_0x57a025(_0x4824e0),_0x5ba357=_0x1e11c8(_0x24867a);if(_0x34278f)_0x33523a['queue']=_0x34278f;if(_0x5ba357)_0x33523a[_0x1fc518(0x232)]=_0x5ba357;const _0x28fc92={'payload':_0x49b3df[_0x1fc518(0x151)]??null,'info':_0x13b805,'signal':_0x1351e7,'log':_0x2ccaef,'env':_0x33523a},_0x3c88e8=_0x307a7e(_0x49b3df[_0x1fc518(0x1a2)],_0x49b3df,_0x3595ee);if(_0x3c88e8)_0x28fc92[_0x1fc518(0x27e)]=_0x3c88e8;const _0x337eca=_0xc1553d(_0x49b3df[_0x1fc518(0x1bd)]);if(_0x337eca)_0x28fc92[_0x1fc518(0x275)]=_0x337eca;const _0x1778eb=_0x448c58(_0x49b3df[_0x1fc518(0x247)]);if(_0x1778eb)_0x28fc92[_0x1fc518(0x197)]=_0x1778eb;if(_0x49b3df[_0x1fc518(0x1ca)]){const _0x5d5915=_0x21daf9?_0x50b498(_0x4c6876,_0x1fc518(0x1d7),null,_0x21daf9):_0x4c6876;_0x28fc92['okdb']=_0x9f9b67(_0x5d5915);}return _0x28fc92;}return okdbFunctionsContext={'createExecutionContext':_0xb0ed37,'createScriptLogger':_0x39aaa6},okdbFunctionsContext;}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0x1ff91d,workerData:_0x277fa3}=require$$0$3;requireOkdbFatalReport()['enableFatalReport']('sandbox');const _0x3d4e1d=require$$2,{compileFunctionExpression:_0xd50e6d}=requireOkdbFunctionsSandbox(),{serializeError:_0x4143c5}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x452ae8}=requireOkdbFunctionsContext(),_0x56df09=require$$6;let _0x28c902=null,_0x627b10=![];const _0xcd5326=new Map(),_0x17147e=new Map();function _0x210992(_0x4f816a){const _0xb3f235=_0x1d78;try{_0x1ff91d[_0xb3f235(0x133)](_0x4f816a);}catch{}}function _0x412a24(_0x53b8b7){const _0x4d1476=_0x1d78,_0x453685=(_0x53b8b7['envName']||_0x4d1476(0x13b))+':'+_0x53b8b7[_0x4d1476(0x21e)]+':'+_0x53b8b7[_0x4d1476(0x1c4)]+':'+_0x53b8b7[_0x4d1476(0x1d5)];let _0x4d7522=_0xcd5326[_0x4d1476(0x11a)](_0x453685);return!_0x4d7522&&(_0x4d7522=_0xd50e6d(_0x53b8b7[_0x4d1476(0x1a0)],{'allowFetch':_0x53b8b7[_0x4d1476(0x221)]?.[_0x4d1476(0x201)]!==![],'allowedFetchDomains':_0x53b8b7[_0x4d1476(0x221)]?.[_0x4d1476(0x1cb)],'filename':_0x53b8b7[_0x4d1476(0x21e)]+_0x4d1476(0x18f)}),_0xcd5326[_0x4d1476(0x26a)](_0x453685,_0x4d7522)),_0x4d7522;}async function _0xf45c9a(_0x4da3bd){const _0x39db9b=_0x1d78,_0x371674=Date[_0x39db9b(0x272)](),_0x3faeef=new AbortController();_0x17147e[_0x39db9b(0x26a)](_0x4da3bd[_0x39db9b(0x20f)],_0x3faeef);try{const _0x2c6f6c=_0x412a24(_0x4da3bd);if(_0x4da3bd[_0x39db9b(0x1f1)])await _0x28c902[_0x39db9b(0x1f3)](_0x4da3bd[_0x39db9b(0x1f1)]);const _0x482f04=_0x4da3bd[_0x39db9b(0x144)]?[]:null,_0x1f3990=_0x452ae8(_0x28c902,_0x4da3bd,_0x210992,_0x482f04,_0x3faeef[_0x39db9b(0x122)]),_0x5f0a62=await _0x2c6f6c(_0x1f3990),_0x26d604={'type':_0x39db9b(0x200),'requestId':_0x4da3bd[_0x39db9b(0x20f)],'runId':_0x4da3bd[_0x39db9b(0x26b)],'result':_0x5f0a62,'meta':{'runnerId':'sandbox-'+process[_0x39db9b(0x231)],'startedAt':_0x371674,'finishedAt':Date[_0x39db9b(0x272)](),'durationMs':Date[_0x39db9b(0x272)]()-_0x371674}};if(_0x482f04)_0x26d604[_0x39db9b(0x1b1)]=_0x482f04;_0x210992(_0x26d604);}catch(_0x10d338){_0x210992({'type':_0x39db9b(0x1be),'requestId':_0x4da3bd[_0x39db9b(0x20f)],'runId':_0x4da3bd['runId'],'error':_0x4143c5(_0x10d338),'meta':{'runnerId':_0x39db9b(0x155)+process[_0x39db9b(0x231)],'startedAt':_0x371674,'finishedAt':Date[_0x39db9b(0x272)](),'durationMs':Date['now']()-_0x371674}});}finally{_0x17147e['delete'](_0x4da3bd[_0x39db9b(0x20f)]);}}async function _0x41caea(){const _0x5d6d0b=_0x1d78;if(_0x627b10)return;_0x627b10=!![];try{await _0x28c902?.[_0x5d6d0b(0x23f)]?.();}catch{}process[_0x5d6d0b(0x1c8)](0x0);}async function _0x311c64(){const _0x3c4b70=_0x1d78,{rootPath:_0x571df4}=_0x277fa3??{};if(!_0x571df4)throw new Error('sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData');_0x28c902=new _0x56df09(_0x571df4,{'engines':![],'processors':![],'compaction':![],'http':![],'auth':{'open':!![]},'processes':![]}),await _0x28c902['open']();const _0x4e2763=setInterval(()=>{const _0x37c98b=_0x1d78;if(_0x627b10)return;for(const [,_0x39782b]of _0x28c902[_0x37c98b(0x177)]){try{_0x39782b['_drainHandler']?.();}catch{}}},0xc8);if(typeof _0x4e2763['unref']===_0x3c4b70(0x249))_0x4e2763['unref']();_0x1ff91d['on']('message',_0x28f1f9=>{const _0x4a45e1=_0x3c4b70;if(!_0x28f1f9||typeof _0x28f1f9!==_0x4a45e1(0x1b9))return;if(_0x28f1f9[_0x4a45e1(0x190)]===_0x4a45e1(0x211))return void _0x41caea();if(_0x28f1f9[_0x4a45e1(0x190)]===_0x4a45e1(0x1fb)){_0x17147e['get'](_0x28f1f9[_0x4a45e1(0x20f)])?.[_0x4a45e1(0x12c)](new Error(_0x4a45e1(0x166)));return;}_0x28f1f9[_0x4a45e1(0x190)]==='run'&&void _0xf45c9a(_0x28f1f9['job']);});const _0x57b213=Math[_0x3c4b70(0x1d1)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x324603=setInterval(()=>{const _0x2649cb=_0x3c4b70;try{_0x210992({'type':'stats','heapUsed':_0x3d4e1d['getHeapStatistics']()[_0x2649cb(0x12e)]});}catch{}},_0x57b213);if(typeof _0x324603[_0x3c4b70(0x17c)]===_0x3c4b70(0x249))_0x324603[_0x3c4b70(0x17c)]();_0x210992({'type':'ready'});}return _0x311c64()['catch'](_0x437f2b=>{const _0x4e91d1=_0x1d78;_0x210992({'type':_0x4e91d1(0x23a),'error':_0x4143c5(_0x437f2b)}),process[_0x4e91d1(0x1c8)](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);module[_0x2c7ed1(0x143)]=okdbFunctionsSandboxWorker;
|
|
1
|
+
'use strict';const _0x4794cd=_0x5daa;(function(_0x506e62,_0x1fcdfa){const _0x4c1658=_0x5daa,_0x405ec2=_0x506e62();while(!![]){try{const _0x4a43d6=parseInt(_0x4c1658(0x270))/0x1+-parseInt(_0x4c1658(0x24d))/0x2*(parseInt(_0x4c1658(0x1fa))/0x3)+parseInt(_0x4c1658(0x1af))/0x4+parseInt(_0x4c1658(0x283))/0x5+parseInt(_0x4c1658(0x1ab))/0x6*(-parseInt(_0x4c1658(0x200))/0x7)+parseInt(_0x4c1658(0x2a7))/0x8+-parseInt(_0x4c1658(0x29c))/0x9*(parseInt(_0x4c1658(0x2a5))/0xa);if(_0x4a43d6===_0x1fcdfa)break;else _0x405ec2['push'](_0x405ec2['shift']());}catch(_0x6e81a){_0x405ec2['push'](_0x405ec2['shift']());}}}(_0x4194,0x50930));var require$$0$3=require(_0x4794cd(0x2c3)),require$$2=require('v8'),require$$0=require('node:vm'),require$$0$2=require(_0x4794cd(0x1a5)),require$$0$1=require(_0x4794cd(0x2e7)),require$$6=require(_0x4794cd(0x2ba));function getDefaultExportFromCjs(_0x1ac78f){const _0x566ec4=_0x4794cd;return _0x1ac78f&&_0x1ac78f[_0x566ec4(0x291)]&&Object[_0x566ec4(0x25f)][_0x566ec4(0x2b5)][_0x566ec4(0x276)](_0x1ac78f,_0x566ec4(0x293))?_0x1ac78f[_0x566ec4(0x293)]:_0x1ac78f;}var okdbFunctionsSandboxWorker$1={},okdbFatalReport,hasRequiredOkdbFatalReport;function requireOkdbFatalReport(){if(hasRequiredOkdbFatalReport)return okdbFatalReport;hasRequiredOkdbFatalReport=0x1;function _0x574810(_0x58697d){const _0x48e38a=_0x5daa;if(process.env.OKDB_FATAL_REPORT!=='1')return;try{if(!process[_0x48e38a(0x2f6)])return;process[_0x48e38a(0x2f6)][_0x48e38a(0x1d5)]=!![];try{if(_0x48e38a(0x1d6)in process['report'])process[_0x48e38a(0x2f6)][_0x48e38a(0x1d6)]=process.env.OKDB_FATAL_REPORT_ENV!=='1';}catch{}if(process['platform']!==_0x48e38a(0x269))try{process[_0x48e38a(0x2f6)][_0x48e38a(0x1ee)]=!![];if(typeof process['report']['signal']==='string')process[_0x48e38a(0x2f6)][_0x48e38a(0x19d)]=_0x48e38a(0x257);}catch{}if(process.env.OKDB_REPORT_DIR)try{require('fs')[_0x48e38a(0x2db)](process.env.OKDB_REPORT_DIR,{'recursive':!![]}),process[_0x48e38a(0x2f6)][_0x48e38a(0x24a)]=process.env.OKDB_REPORT_DIR;}catch{}try{process[_0x48e38a(0x2f6)][_0x48e38a(0x1c3)]='';}catch{}if(_0x58697d)process.env.OKDB_REPORT_TAG=String(_0x58697d);}catch{}}return okdbFatalReport={'enableFatalReport':_0x574810},okdbFatalReport;}var okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x36279d=require$$0;function _0x43fbd2(_0x3586b1){const _0x274125=_0x5daa,_0x448c4c=_0x3586b1==='*',_0xbe132a=_0x448c4c?null:new Set(Array[_0x274125(0x2a8)](_0x3586b1)?_0x3586b1:[]);return function _0x56ceef(_0x599662,_0x4b1488){const _0x1fa4d5=_0x274125;if(!_0x448c4c){let _0x3998c4;try{const _0x36f8d7=new URL(typeof _0x599662===_0x1fa4d5(0x225)?_0x599662:_0x599662?.[_0x1fa4d5(0x299)]??String(_0x599662));_0x3998c4=_0x36f8d7[_0x1fa4d5(0x210)];}catch{const _0x319409=new Error(_0x1fa4d5(0x2ab));return _0x319409['code']=_0x1fa4d5(0x25c),Promise[_0x1fa4d5(0x2f7)](_0x319409);}if(!_0xbe132a[_0x1fa4d5(0x309)](_0x3998c4)){const _0x5cc136=new Error(_0xbe132a[_0x1fa4d5(0x1ec)]===0x0?_0x1fa4d5(0x2fa):_0x1fa4d5(0x2a0)+_0x3998c4+_0x1fa4d5(0x2d8));return _0x5cc136[_0x1fa4d5(0x296)]=_0x1fa4d5(0x25c),Promise[_0x1fa4d5(0x2f7)](_0x5cc136);}}return fetch(_0x599662,_0x4b1488);};}function _0x1a9898(_0x537d65={}){const _0xc5d413=_0x5daa,_0x5bed4f=_0x537d65[_0xc5d413(0x201)]!==![],_0x30db24=_0x537d65[_0xc5d413(0x289)]??[],_0x759bff={'Date':Date,'Math':Math,'JSON':JSON,'Array':Array,'Object':Object,'String':String,'Number':Number,'Boolean':Boolean,'Map':Map,'Set':Set,'Promise':Promise,'URL':URL,'URLSearchParams':URLSearchParams,'TextEncoder':TextEncoder,'TextDecoder':TextDecoder,'AbortController':AbortController,'AbortSignal':AbortSignal,'setTimeout':setTimeout,'clearTimeout':clearTimeout,'setInterval':setInterval,'clearInterval':clearInterval,'queueMicrotask':queueMicrotask,'structuredClone':structuredClone,'crypto':globalThis[_0xc5d413(0x255)]};return _0x5bed4f&&typeof fetch===_0xc5d413(0x1e6)&&(_0x759bff[_0xc5d413(0x1a0)]=_0x43fbd2(_0x30db24)),_0x759bff[_0xc5d413(0x29d)]=_0x759bff,_0x759bff;}function _0x2055e9(_0x226766,_0x2a89ab={}){const _0x13eba9=_0x5daa,_0x5a2cba=_0x1a9898(_0x2a89ab),_0x1fae26=_0x36279d['createContext'](_0x5a2cba,{'name':_0x13eba9(0x2e5),'codeGeneration':{'strings':![],'wasm':![]}});let _0x48fb7e;try{_0x48fb7e=new _0x36279d[(_0x13eba9(0x215))]('('+_0x226766+')',{'filename':_0x2a89ab[_0x13eba9(0x1c3)]??_0x13eba9(0x29a)});}catch(_0x2a9dfe){const _0x32ca15=new Error(_0x2a9dfe?.[_0x13eba9(0x1e4)]||_0x13eba9(0x231));_0x32ca15[_0x13eba9(0x296)]=_0x13eba9(0x22c),_0x32ca15[_0x13eba9(0x2c2)]=_0x2a9dfe;throw _0x32ca15;}let _0x5db0a6;try{_0x5db0a6=_0x48fb7e[_0x13eba9(0x27f)](_0x1fae26,{'timeout':_0x2a89ab[_0x13eba9(0x2d1)]??0x64});}catch(_0x17b200){const _0x513043=new Error(_0x17b200?.[_0x13eba9(0x1e4)]||_0x13eba9(0x22a));_0x513043[_0x13eba9(0x296)]=_0x13eba9(0x22c),_0x513043['cause']=_0x17b200;throw _0x513043;}if(typeof _0x5db0a6!==_0x13eba9(0x1e6)){const _0x3a80bf=new Error(_0x13eba9(0x274));_0x3a80bf['code']=_0x13eba9(0x1e8);throw _0x3a80bf;}return _0x5db0a6;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x1a9898,'compileFunctionExpression':_0x2055e9,'_buildRestrictedFetch':_0x43fbd2},okdbFunctionsSandbox;}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x57c379(_0x4244fc){const _0x9ca911=_0x5daa;if(!_0x4244fc)return null;return{'message':_0x4244fc[_0x9ca911(0x1e4)]||String(_0x4244fc),'stack':_0x4244fc[_0x9ca911(0x211)]||null,'code':_0x4244fc[_0x9ca911(0x296)]||null,'details':_0x4244fc[_0x9ca911(0x1f5)]||null};}function _0x5eca81(_0xad0566){const _0x3247d2=_0x5daa;if(!_0xad0566)return new Error(_0x3247d2(0x26e));const _0x4c8448=new Error(_0xad0566['message']||String(_0xad0566));if(_0xad0566['stack'])_0x4c8448[_0x3247d2(0x211)]=_0xad0566[_0x3247d2(0x211)];if(_0xad0566['code'])_0x4c8448['code']=_0xad0566[_0x3247d2(0x296)];if(_0xad0566[_0x3247d2(0x1f5)])_0x4c8448[_0x3247d2(0x1f5)]=_0xad0566[_0x3247d2(0x1f5)];return _0x4c8448;}return okdbFunctionsIpc={'serializeError':_0x57c379,'deserializeError':_0x5eca81},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x241b6d=_0x4794cd;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x5e81c6={'PUT':_0x241b6d(0x253),'REMOVE':_0x241b6d(0x2bf),'INDEX_DROP':_0x241b6d(0x1aa),'INDEX_REGISTER':'registerIndex','INDEX_RESET':_0x241b6d(0x29f),'TYPE_REGISTER':_0x241b6d(0x1b3),'TYPE_DROP':'dropType','FTS_REGISTER':_0x241b6d(0x1bd),'FTS_DROP':_0x241b6d(0x214),'FTS_RESET':_0x241b6d(0x27e),'SCHEMA_SET':_0x241b6d(0x24c),'SCHEMA_DROP':'dropSchema','TTL_SET':_0x241b6d(0x2e4),'TTL_CLEAR':'clearTtl'},_0x4967f3={'SYSTEM_READY':_0x241b6d(0x1c8),'SYSTEM_STOPPED':_0x241b6d(0x1c5),'SYSTEM_CLOCK_CHANGE':_0x241b6d(0x275),'SYSTEM_POKE':_0x241b6d(0x1f8),'SYSTEM_DRAIN':_0x241b6d(0x27d),'SYSTEM_TYPE_DROP':_0x241b6d(0x2e3),'SYSTEM_PROC':_0x241b6d(0x281),'SYSTEM_BUS_STATE_CHANGE':_0x241b6d(0x193),'ITEM_CREATE':_0x241b6d(0x1d0),'ITEM_UPDATE':_0x241b6d(0x21f),'ITEM_REMOVE':_0x241b6d(0x2fe),'INDEX_RESET':_0x241b6d(0x2d0),'INDEX_READY':_0x241b6d(0x232),'INDEX_PROGRESS':_0x241b6d(0x25b),'VIEW_PROGRESS':'view:progress','INDEX_DROP':_0x241b6d(0x1d9),'INDEX_REGISTERED':'index:registered','FTS_REGISTERED':_0x241b6d(0x2f5),'FTS_DROP':_0x241b6d(0x24f),'FTS_RESET':_0x241b6d(0x297),'SCHEMA_SET':'schema:set','SCHEMA_DROP':_0x241b6d(0x2aa),'UNIQUE_VIOLATION':_0x241b6d(0x280),'UNIQUE_VIOLATION_RESOLVED':'unique:violation_resolved','REF_VIOLATION':_0x241b6d(0x25a),'REF_VIOLATION_RESOLVED':'ref:violation_resolved','SYNC_APPLY':_0x241b6d(0x2c5),'TXN_START':_0x241b6d(0x2f2),'TXN_END':_0x241b6d(0x30c),'TXN_ROLLBACK':_0x241b6d(0x216),'TYPE_REGISTERED':_0x241b6d(0x233),'TYPE_DROP':'type:drop','ENV_OPENED':'env:opened','ENV_REMOVED':_0x241b6d(0x277),'SYSTEM_ENV_RELEASE':'system:env_release','TTL_EXPIRED':_0x241b6d(0x208),'TTL_SET':_0x241b6d(0x2b2),'TTL_CLEAR':_0x241b6d(0x2a1),'LICENSE_INVALID':'license:invalid','LICENSE_ADDED':_0x241b6d(0x2ff),'LICENSE_ACTIVATED':_0x241b6d(0x252),'LICENSE_REMOVED':_0x241b6d(0x1b2)},_0x536d8b={'CREATING':_0x241b6d(0x1ba),'RESETTING':_0x241b6d(0x1db),'READY':_0x241b6d(0x23c),'DROPPING':_0x241b6d(0x22f),'WAITING':'waiting'},_0x106033={'CREATED':_0x241b6d(0x242),'STARTING':_0x241b6d(0x23d),'STARTED':_0x241b6d(0x273),'STOPPING':_0x241b6d(0x1bc),'STOPPED':_0x241b6d(0x282)},_0x55905b={'CREATING':'creating','READY':'ready','HALTED':_0x241b6d(0x191),'STOPPED':'stopped','RESETTING':_0x241b6d(0x1db)},_0x39acdf=Object[_0x241b6d(0x2d3)]({'POKE':_0x241b6d(0x2cb),'DRAIN':_0x241b6d(0x29e),'TYPE_DROP':_0x241b6d(0x1c1),'PROC':_0x241b6d(0x1b5),'ENV_RELEASE':_0x241b6d(0x26a)});return okdbEnums={'BUS_EVENTS':_0x39acdf,'CHANGE_ACTIONS':_0x5e81c6,'EVENTS':_0x4967f3,'INDEX_STATE':_0x536d8b,'OKDB_STATE':_0x106033,'VIEW_STATE':_0x55905b},okdbEnums;}var okdbError,hasRequiredOkdbError;function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x379d55 extends Error{constructor(_0x10edb2,_0x4f67bc,_0x388a54={}){const _0x5498fe=_0x5daa;super(_0x10edb2),this[_0x5498fe(0x2d2)]=_0x5498fe(0x266),this['code']=_0x4f67bc,this[_0x5498fe(0x1f5)]=_0x388a54,_0x388a54[_0x5498fe(0x2c2)]&&(this['cause']=_0x388a54[_0x5498fe(0x2c2)]),Error[_0x5498fe(0x30a)](this,this[_0x5498fe(0x1f2)]);}}class _0x5c85b9 extends _0x379d55{constructor(_0x275131,_0x5c8156,_0x498172,_0x3bf6d4){const _0x2e5782=_0x5daa;super(_0x2e5782(0x1b9)+_0x275131+'@'+_0x5c8156+_0x2e5782(0x2f0)+_0x498172+_0x2e5782(0x2ad)+_0x3bf6d4,_0x2e5782(0x1b1),{'type':_0x275131,'key':_0x5c8156,'expectedVersion':_0x498172,'actualVersion':_0x3bf6d4}),this['name']='OKDBVersionMismatchError';}}class _0x30e6f7 extends _0x379d55{constructor(_0x189fe1,_0x42d908){const _0x2296aa=_0x5daa;super(_0x189fe1+'@'+_0x42d908+'\x20does\x20not\x20exist',_0x2296aa(0x1ea),{'type':_0x189fe1,'key':_0x42d908}),this[_0x2296aa(0x2d2)]=_0x2296aa(0x19c);}}class _0x2ba170 extends _0x379d55{constructor(_0x5992fa,_0x28d372){const _0x1cdf67=_0x5daa;super(_0x5992fa+'@'+_0x28d372+'\x20already\x20exists',_0x1cdf67(0x1fb),{'type':_0x5992fa,'key':_0x28d372}),this[_0x1cdf67(0x2d2)]=_0x1cdf67(0x194);}}class _0x5c6414 extends _0x379d55{constructor(_0x2b7a4d,_0x449168){const _0x183574=_0x5daa,_0x3ae125=typeof _0x449168;super(_0x183574(0x28f)+_0x2b7a4d+_0x183574(0x248)+_0x3ae125+_0x183574(0x272)+_0x449168,_0x183574(0x20b),{'index':_0x2b7a4d,'key':_0x449168,'keyType':_0x3ae125}),this['name']=_0x183574(0x2fd);}}class _0x1cd60e extends _0x379d55{constructor(_0x5a0506){const _0xe81190=_0x5daa,_0x45b138=typeof _0x5a0506;super(_0xe81190(0x1a2)+_0x45b138+'.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20'+_0x5a0506,'INVALID_PRIMARY_KEY',{'key':_0x5a0506,'keyType':_0x45b138}),this[_0xe81190(0x2d2)]=_0xe81190(0x267);}}class _0x5da853 extends _0x379d55{constructor(_0x136d9d){const _0x30b1e7=_0x5daa;super('Type\x20\x27'+_0x136d9d+_0x30b1e7(0x241),_0x30b1e7(0x19b),{'type':_0x136d9d}),this[_0x30b1e7(0x2d2)]=_0x30b1e7(0x2de);}}class _0x2a55d1 extends _0x379d55{constructor(_0x1bacde){const _0x2bb16e=_0x5daa;super(_0x2bb16e(0x22e)+_0x1bacde+_0x2bb16e(0x2e9),_0x2bb16e(0x2b3),{'type':_0x1bacde}),this[_0x2bb16e(0x2d2)]=_0x2bb16e(0x285);}}class _0x434952 extends _0x379d55{constructor(_0x57a7d9,_0x67fbb1){const _0x48cde6=_0x5daa;super('Index\x20\x27'+_0x67fbb1+_0x48cde6(0x1c9)+_0x57a7d9+'\x27\x20doesn\x27t\x20exist','INDEX_NOT_REGISTERED',{'type':_0x57a7d9,'index':_0x67fbb1}),this['name']=_0x48cde6(0x1f3);}}class _0x109bd1 extends _0x379d55{constructor(_0x4ac5a0,_0x44598b){const _0x39c91d=_0x5daa;super(_0x39c91d(0x203)+_0x44598b+'\x27\x20on\x20type\x20\x27'+_0x4ac5a0+'\x27\x20is\x20already\x20registered',_0x39c91d(0x294),{'type':_0x4ac5a0,'index':_0x44598b}),this[_0x39c91d(0x2d2)]='OKDBIndexAlreadyRegisteredError';}}class _0x587959 extends _0x379d55{constructor(_0x4362b9,_0x51d23e={}){const _0xc6a54d=_0x5daa;super(_0x4362b9,_0xc6a54d(0x2bb),_0x51d23e),this[_0xc6a54d(0x2d2)]='OKDBInvalidValueError';}}class _0x3bc693 extends _0x379d55{constructor(_0x47677b,_0x17e390,_0x488e76,_0x4ffa9f,_0x550285){const _0x279b22=_0x5daa;super(_0x279b22(0x2f1)+_0x47677b+'@'+_0x17e390+_0x279b22(0x1d4)+_0x488e76+_0x279b22(0x279)+_0x4ffa9f+_0x279b22(0x288)+_0x550285+'\x27',_0x279b22(0x21c),{'type':_0x47677b,'index':_0x17e390,'indexKey':_0x488e76,'existingKey':_0x4ffa9f,'conflictingKey':_0x550285}),this[_0x279b22(0x2d2)]='OKDBUniqueConstraintError';}}class _0x409458 extends _0x379d55{constructor(_0x53846f,_0x2d82e7,_0x16fd96){const _0x5d61af=_0x5daa;super(_0x5d61af(0x2d4)+_0x53846f+'@'+_0x2d82e7,_0x5d61af(0x306),{'type':_0x53846f,'key':_0x2d82e7,'errors':_0x16fd96}),this[_0x5d61af(0x2d2)]='OKDBSchemaValidationError',this['type']=_0x53846f,this[_0x5d61af(0x258)]=_0x2d82e7,this[_0x5d61af(0x247)]=_0x16fd96;}}class _0x58b4df extends _0x379d55{constructor(_0x23ab94,_0x4aef48){const _0x34e70d=_0x5daa;super(_0x34e70d(0x30b)+_0x23ab94+':\x20'+_0x4aef48[_0x34e70d(0x220)]+'\x20documents\x20fail\x20validation',_0x34e70d(0x197),{'type':_0x23ab94,'failures':_0x4aef48}),this['name']=_0x34e70d(0x239),this[_0x34e70d(0x302)]=_0x23ab94,this['failures']=_0x4aef48;}}class _0x598f53 extends _0x379d55{constructor(_0x5d9483,_0x39b35c,_0x4c0b95,_0x34884f,_0x4272f0){const _0x56e227=_0x5daa;super('Foreign\x20key\x20violation:\x20'+_0x5d9483+'@'+_0x39b35c+'.'+_0x4c0b95+_0x56e227(0x196)+_0x34884f+'@'+_0x4272f0+_0x56e227(0x2b9),'FOREIGN_KEY_VIOLATION',{'sourceType':_0x5d9483,'sourceKey':_0x39b35c,'fieldPath':_0x4c0b95,'targetType':_0x34884f,'targetKey':_0x4272f0}),this[_0x56e227(0x2d2)]=_0x56e227(0x2e2),this[_0x56e227(0x303)]=_0x5d9483,this[_0x56e227(0x1ce)]=_0x39b35c,this[_0x56e227(0x298)]=_0x4c0b95,this[_0x56e227(0x27c)]=_0x34884f,this[_0x56e227(0x1d1)]=_0x4272f0;}}class _0x5b875d extends _0x379d55{constructor(_0x262f64,_0x4c01f6,_0x320e5a){const _0x1afa9e=_0x5daa;super(_0x1afa9e(0x2b4)+_0x262f64+'@'+_0x4c01f6+':\x20'+_0x320e5a[_0x1afa9e(0x220)]+'\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict',_0x1afa9e(0x1fe),{'targetType':_0x262f64,'targetKey':_0x4c01f6,'references':_0x320e5a}),this[_0x1afa9e(0x2d2)]=_0x1afa9e(0x2a6),this[_0x1afa9e(0x27c)]=_0x262f64,this[_0x1afa9e(0x1d1)]=_0x4c01f6,this[_0x1afa9e(0x1ae)]=_0x320e5a;}}class _0x378025 extends _0x379d55{constructor(_0xc2008e,_0x2ada57,_0x25bd62){const _0x1678b=_0x5daa;super(_0x1678b(0x1dc)+_0x2ada57+_0x1678b(0x27a)+_0xc2008e+_0x1678b(0x2a3)+_0x25bd62[_0x1678b(0x205)](_0x4d64d3=>_0x4d64d3[_0x1678b(0x199)]+':'+_0x4d64d3['name'])['join'](',\x20'),'INDEX_HAS_CONSUMERS',{'type':_0xc2008e,'index':_0x2ada57,'usedBy':_0x25bd62}),this[_0x1678b(0x2d2)]=_0x1678b(0x22b);}}return okdbError={'OKDBError':_0x379d55,'OKDBVersionMismatchError':_0x5c85b9,'OKDBNotFoundError':_0x30e6f7,'OKDBAlreadyExistsError':_0x2ba170,'OKDBInvalidIndexKeyError':_0x5c6414,'OKDBInvalidPrimaryKeyError':_0x1cd60e,'OKDBTypeNotRegisteredError':_0x5da853,'OKDBTypeAlreadyRegisteredError':_0x2a55d1,'OKDBIndexNotRegisteredError':_0x434952,'OKDBIndexAlreadyRegisteredError':_0x109bd1,'OKDBInvalidValueError':_0x587959,'OKDBUniqueConstraintError':_0x3bc693,'OKDBSchemaValidationError':_0x409458,'OKDBSchemaCollectionError':_0x58b4df,'OKDBForeignKeyError':_0x598f53,'OKDBForeignKeyDeleteError':_0x5b875d,'OKDBIndexHasConsumersError':_0x378025},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x52c097=_0x4794cd;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x36375a,performance:_0x5590b0}=require$$0$1,_0x1303e6=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x52c097(0x1bf),_0x27b244=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x2e6b49=process.env.OKDB_LOOP_LAG_ALL==='1',_0x5ba643=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x30584d{constructor(){const _0x3b7a1b=_0x52c097;this['enabled']=_0x1303e6,this[_0x3b7a1b(0x2ae)]=new Map(),this['_h']=null,this[_0x3b7a1b(0x246)]=null,this['_started']=![],this[_0x3b7a1b(0x286)]=(_0x4757e8,_0x41d453)=>process['stderr'][_0x3b7a1b(0x1c4)](_0x4757e8+(_0x41d453?'\x20'+JSON[_0x3b7a1b(0x229)](_0x41d453):'')+'\x0a');}[_0x52c097(0x1b8)](){const _0x1bc78a=_0x52c097;return _0x5590b0[_0x1bc78a(0x1b8)]();}[_0x52c097(0x221)](_0x53c7a3){const _0x4e3018=_0x52c097;if(typeof _0x53c7a3===_0x4e3018(0x1e6))this[_0x4e3018(0x286)]=_0x53c7a3;}[_0x52c097(0x245)](_0x4fe4fd,_0x3ff940,_0x270a42){const _0x214bf5=_0x52c097;if(!this[_0x214bf5(0x264)])return;let _0x5fadaf=this[_0x214bf5(0x2ae)]['get'](_0x4fe4fd);!_0x5fadaf&&(_0x5fadaf={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x214bf5(0x2ae)]['set'](_0x4fe4fd,_0x5fadaf)),_0x5fadaf['ms']+=_0x3ff940,_0x5fadaf[_0x214bf5(0x29b)]+=0x1,_0x3ff940>_0x5fadaf[_0x214bf5(0x1ac)]&&(_0x5fadaf[_0x214bf5(0x1ac)]=_0x3ff940,_0x5fadaf[_0x214bf5(0x1cc)]=_0x270a42||'');}[_0x52c097(0x265)](_0x2ee387){const _0x1db3a9=_0x52c097;if(!this['enabled']||this[_0x1db3a9(0x1bb)])return;this['_started']=!![];if(_0x2ee387)this['_log']=_0x2ee387;this['_h']=_0x36375a({'resolution':0xa}),this['_h'][_0x1db3a9(0x1f0)](),this[_0x1db3a9(0x246)]=setInterval(()=>this['_report'](),_0x27b244);if(this[_0x1db3a9(0x246)][_0x1db3a9(0x192)])this[_0x1db3a9(0x246)][_0x1db3a9(0x192)]();}[_0x52c097(0x2b1)](_0x5c3104){const _0x25ab8b=_0x52c097;if(!this[_0x25ab8b(0x26f)])this[_0x25ab8b(0x26f)]=new Set();this[_0x25ab8b(0x26f)][_0x25ab8b(0x262)](_0x5c3104);if(!this[_0x25ab8b(0x1bb)])this[_0x25ab8b(0x1fd)]();}[_0x52c097(0x2f4)](_0x233284){const _0x124b60=_0x52c097;this[_0x124b60(0x26f)]?.['delete'](_0x233284);}[_0x52c097(0x1fd)](){const _0x30fb72=_0x52c097;if(this[_0x30fb72(0x260)])return;this[_0x30fb72(0x260)]=!![];!this['_h']&&(this['_h']=_0x36375a({'resolution':0xa}),this['_h'][_0x30fb72(0x1f0)]());const _0x45aab8=_0x27b244;this[_0x30fb72(0x26b)]=setInterval(()=>{const _0x380b69=_0x30fb72,_0x2f5630=this['_h'];if(!_0x2f5630)return;const _0x1e62dd=_0x2f5630[_0x380b69(0x2da)](0x63)/0xf4240,_0x2d8f3b=_0x2f5630[_0x380b69(0x244)]/0xf4240,_0x201b3e=_0x2f5630[_0x380b69(0x25d)]/0xf4240;_0x2f5630[_0x380b69(0x2a2)]();if(this[_0x380b69(0x26f)])for(const _0x581304 of this['_windowCbs']){try{_0x581304({'p99Ms':_0x1e62dd,'maxMs':_0x2d8f3b,'meanMs':_0x201b3e,'reportMs':_0x45aab8});}catch{}}},_0x45aab8);if(this[_0x30fb72(0x26b)][_0x30fb72(0x192)])this['_admissionTimer']['unref']();}[_0x52c097(0x24e)](){const _0x2c668b=_0x52c097,_0x14be4c=this['_h'],_0x1a5c0a=_0x14be4c[_0x2c668b(0x244)]/0xf4240,_0x310543=_0x14be4c[_0x2c668b(0x2da)](0x63)/0xf4240,_0x1a5280=_0x14be4c[_0x2c668b(0x25d)]/0xf4240;_0x14be4c[_0x2c668b(0x2a2)]();const _0x2ad6c6=[...this[_0x2c668b(0x2ae)][_0x2c668b(0x218)]()]['map'](([_0x116fec,_0x35730e])=>({'label':_0x116fec,..._0x35730e}))[_0x2c668b(0x2dd)]((_0x50469b,_0x446d59)=>_0x446d59['ms']-_0x50469b['ms'])[_0x2c668b(0x2cc)](0x0,0x8);this['_buckets']['clear']();const _0x232fc0=_0x2ad6c6[_0x2c668b(0x261)]((_0x3c348f,_0x52eba0)=>_0x3c348f+_0x52eba0['ms'],0x0),_0x4e4aaf=_0x2ad6c6['map'](_0x17b21d=>_0x17b21d[_0x2c668b(0x301)]+'='+_0x17b21d['ms'][_0x2c668b(0x1a8)](0x0)+_0x2c668b(0x2c1)+_0x17b21d[_0x2c668b(0x29b)]+(_0x17b21d[_0x2c668b(0x1ac)]>0x5?_0x2c668b(0x290)+_0x17b21d['maxMs']['toFixed'](0x0)+'ms'+(_0x17b21d[_0x2c668b(0x1cc)]?'\x20'+_0x17b21d['maxExtra']:'')+')':''));(_0x2e6b49||_0x1a5c0a>=_0x5ba643)&&this[_0x2c668b(0x286)](_0x2c668b(0x1a9)+_0x27b244+_0x2c668b(0x198)+_0x1a5c0a['toFixed'](0x0)+_0x2c668b(0x263)+_0x310543['toFixed'](0x0)+'ms\x20mean='+_0x1a5280['toFixed'](0x0)+'ms\x20busy='+_0x232fc0[_0x2c668b(0x1a8)](0x0)+'ms'+(_0x4e4aaf[_0x2c668b(0x220)]?_0x2c668b(0x28c)+_0x4e4aaf[_0x2c668b(0x1e1)]('\x20\x20'):''),{'feature':_0x2c668b(0x23e)});if(this[_0x2c668b(0x26f)])for(const _0x13b980 of this[_0x2c668b(0x26f)]){try{_0x13b980({'p99Ms':_0x310543,'maxMs':_0x1a5c0a,'meanMs':_0x1a5280,'reportMs':_0x27b244});}catch{}}}[_0x52c097(0x240)](){const _0x17e5aa=_0x52c097;if(this[_0x17e5aa(0x246)])clearInterval(this['_timer']);if(this['_h'])this['_h'][_0x17e5aa(0x1be)]();this[_0x17e5aa(0x246)]=null,this['_h']=null,this[_0x17e5aa(0x1bb)]=![];}}const _0x386a79=new _0x30584d();if(_0x386a79[_0x52c097(0x264)])_0x386a79[_0x52c097(0x265)]();return okdbLoopMonitor={'LOOP':_0x386a79},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x58e204=_0x4794cd;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0xc32d2f=require$$0$2,{EVENTS:_0x315408}=requireOkdbEnums(),{OKDBError:_0x3627d8}=requireOkdbError(),{LOOP:_0x57867e}=requireOkdbLoopMonitor();function _0x4a0025(_0x1aab28){const _0x1bc277=_0x5daa;return _0x1aab28[_0x1bc277(0x205)](_0x273260=>{const _0x970756=_0x1bc277,[_0x1317f6,_0xc98ac7]=_0x273260[_0x970756(0x1fc)]||[];return{'action':_0x273260[_0x970756(0x2df)],'type':_0x1317f6,'key':_0xc98ac7};});}class _0x5aabf4{[_0x58e204(0x1ca)];[_0x58e204(0x2f3)]=[];[_0x58e204(0x1da)]=[];[_0x58e204(0x1d2)]=[];constructor(_0xb28baf,_0x4a7ea4={'useReadTransaction':![]}){const _0x15de8e=_0x58e204;this[_0x15de8e(0x1ca)]=_0xb28baf,this[_0x15de8e(0x202)]=_0x4a7ea4,this['id']=_0xc32d2f['v4'](),this[_0x15de8e(0x2c7)]=this[_0x15de8e(0x202)][_0x15de8e(0x1f1)]?this['okdb']['db']['useReadTransaction']():null,this['_closed']=![];}[_0x58e204(0x23a)](_0x40c618){const _0x5c61b0=_0x58e204;this[_0x5c61b0(0x1da)][_0x5c61b0(0x305)](_0x40c618);}[_0x58e204(0x278)](_0x396f0f){const _0x4857f0=_0x58e204;this[_0x4857f0(0x1d2)][_0x4857f0(0x305)](_0x396f0f);}[_0x58e204(0x21a)](){const _0x185e64=_0x58e204;if(!this[_0x185e64(0x2c7)])return;try{this[_0x185e64(0x2c7)][_0x185e64(0x20e)]();}catch(_0x270d6c){}this[_0x185e64(0x2c7)]=null;}[_0x58e204(0x1d3)](){const _0x2297b5=_0x58e204;if(this[_0x2297b5(0x19e)])throw new _0x3627d8(_0x2297b5(0x27b),'TXN_CLOSED');}[_0x58e204(0x237)](_0x52d57d,_0x4f7fd1){const _0xe1b670=_0x58e204;return this[_0xe1b670(0x1d3)](),this[_0xe1b670(0x1ca)][_0xe1b670(0x237)](_0x52d57d,_0x4f7fd1,{'transaction':this[_0xe1b670(0x2c7)]});}['getEntry'](_0x53fd27,_0x27e55c){const _0x4acabb=_0x58e204;return this['_assertOpen'](),this[_0x4acabb(0x1ca)][_0x4acabb(0x2f9)](_0x53fd27,_0x27e55c,{'transaction':this[_0x4acabb(0x2c7)]});}[_0x58e204(0x20a)](_0x594fe9,_0xd94d9b){const _0x56510e=_0x58e204;return this[_0x56510e(0x1d3)](),this[_0x56510e(0x1ca)]['getMany'](_0x594fe9,_0xd94d9b,{'transaction':this['readTransaction']});}[_0x58e204(0x1de)](_0x23cff7,_0x3b0d7c={}){const _0x205208=_0x58e204;return this[_0x205208(0x1d3)](),this[_0x205208(0x1ca)][_0x205208(0x1de)](_0x23cff7,{'transaction':this[_0x205208(0x2c7)],..._0x3b0d7c});}['getValues'](_0x2a55fc,_0x4263bc={}){const _0x4fabbb=_0x58e204;return this[_0x4fabbb(0x1d3)](),this[_0x4fabbb(0x1ca)][_0x4fabbb(0x268)](_0x2a55fc,{'transaction':this['readTransaction'],..._0x4263bc});}[_0x58e204(0x2b8)](_0x4de28b,_0x41a9ac={}){const _0x1fff25=_0x58e204;return this[_0x1fff25(0x1d3)](),this[_0x1fff25(0x1ca)][_0x1fff25(0x2b8)](_0x4de28b,{'transaction':this[_0x1fff25(0x2c7)],..._0x41a9ac});}[_0x58e204(0x2cf)](_0x447d96,_0x1b93ba,_0x3fdf2f={}){const _0x52d5a8=_0x58e204;return this[_0x52d5a8(0x1d3)](),this[_0x52d5a8(0x1ca)]['byIndex'](_0x447d96,_0x1b93ba,{'transaction':this[_0x52d5a8(0x2c7)],..._0x3fdf2f});}[_0x58e204(0x25e)](_0xb58623,_0x357b99,_0x517b1d={}){const _0x8d43bf=_0x58e204;return this[_0x8d43bf(0x1d3)](),this[_0x8d43bf(0x1ca)][_0x8d43bf(0x25e)](_0xb58623,_0x357b99,{'transaction':this[_0x8d43bf(0x2c7)],..._0x517b1d});}[_0x58e204(0x2d5)](_0x3afce9=null){const _0xa203d5=_0x58e204;return this[_0xa203d5(0x1d3)](),this[_0xa203d5(0x1ca)]['getClock'](_0x3afce9,{'transaction':this[_0xa203d5(0x2c7)]});}['getCount'](_0x26e529){const _0x263b30=_0x58e204;return this[_0x263b30(0x1d3)](),this['okdb']['getCount'](_0x26e529,{'transaction':this['readTransaction']});}[_0x58e204(0x253)](_0x2d3876,_0x136510,_0x188f90,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x58e204(0x1b8)](),origin:origin=null,ttl:ttl=null}={}){const _0x1940a7=_0x58e204;this[_0x1940a7(0x2f3)][_0x1940a7(0x305)]({'action':_0x1940a7(0x253),'args':[_0x2d3876,_0x136510,_0x188f90,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}['update'](_0x25829b,_0x1f11a6,_0x534e4f,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date[_0x58e204(0x1b8)](),origin:origin=null,ttl:ttl=null}={}){const _0x1ccd90=_0x58e204;this[_0x1ccd90(0x2f3)][_0x1ccd90(0x305)]({'action':_0x1ccd90(0x21e),'args':[_0x25829b,_0x1f11a6,_0x534e4f,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}['patch'](_0x26d13f,_0x24acd5,_0x2d7bb3,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x58e204(0x1b8)](),origin:origin=null,ttl:ttl=null}={}){const _0x145ae2=_0x58e204;this[_0x145ae2(0x2f3)][_0x145ae2(0x305)]({'action':_0x145ae2(0x23f),'args':[_0x26d13f,_0x24acd5,_0x2d7bb3,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}['create'](_0x375f80,_0x3185cc,_0x393c6f,{version:version=null,timestamp:timestamp=Date[_0x58e204(0x1b8)](),origin:origin=null,ttl:ttl=null}={}){const _0x3b4ea5=_0x58e204;this['actions'][_0x3b4ea5(0x305)]({'action':_0x3b4ea5(0x2c6),'args':[_0x375f80,_0x3185cc,_0x393c6f,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x58e204(0x2bf)](_0x297266,_0x1dcda5,{ifVersion:ifVersion=null,timestamp:timestamp=Date['now'](),origin:origin=null}={}){const _0x3ff244=_0x58e204;this[_0x3ff244(0x2f3)][_0x3ff244(0x305)]({'action':'remove','args':[_0x297266,_0x1dcda5,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}['setTTL'](_0x529633,_0x37905e,_0x324317){const _0x55c0dc=_0x58e204;this[_0x55c0dc(0x2f3)]['push']({'action':_0x55c0dc(0x1b4),'args':[_0x529633,_0x37905e,_0x324317]});}[_0x58e204(0x2c9)](_0x4107d7,_0x586170){const _0x2f4f6f=_0x58e204;this[_0x2f4f6f(0x2f3)][_0x2f4f6f(0x305)]({'action':_0x2f4f6f(0x2c9),'args':[_0x4107d7,_0x586170]});}['rollback'](){const _0x3affc5=_0x58e204;if(this['_closed'])return;for(const _0x1430bd of this['_undoHooks']){try{_0x1430bd();}catch{}}this[_0x3affc5(0x1ca)][_0x3affc5(0x1e2)][_0x3affc5(0x295)](_0x315408[_0x3affc5(0x236)],{'id':this['id']}),this['actions']=[],this['_closeReadTransaction'](),this[_0x3affc5(0x19e)]=!![];}async[_0x58e204(0x26d)](){const _0x356dcf=_0x58e204;if(this[_0x356dcf(0x19e)])throw new Error(_0x356dcf(0x27b));const _0x31e480={'id':this['id'],'timestamp':Date[_0x356dcf(0x1b8)](),'actions':this[_0x356dcf(0x2f3)]};this[_0x356dcf(0x1ca)][_0x356dcf(0x1e2)][_0x356dcf(0x295)](_0x315408[_0x356dcf(0x207)],_0x31e480);try{const _0x3c70cc=_0x57867e['enabled']?_0x57867e[_0x356dcf(0x1b8)]():0x0;await this[_0x356dcf(0x1ca)]['_writer']['transaction'](()=>{const _0x2cfa7f=_0x356dcf;for(const _0x18b7db of this[_0x2cfa7f(0x2f3)]){const _0x57c3c4=this['okdb']['_'+_0x18b7db[_0x2cfa7f(0x2df)]];if(typeof _0x57c3c4!==_0x2cfa7f(0x1e6))throw new Error('Unknown\x20transaction\x20action:\x20'+_0x18b7db[_0x2cfa7f(0x2df)]);_0x57c3c4[_0x2cfa7f(0x276)](this[_0x2cfa7f(0x1ca)],this,..._0x18b7db[_0x2cfa7f(0x1fc)]);}}),_0x57867e['enabled']&&_0x57867e[_0x356dcf(0x245)](_0x356dcf(0x2bc),_0x57867e[_0x356dcf(0x1b8)]()-_0x3c70cc,(this[_0x356dcf(0x1ca)][_0x356dcf(0x2d2)]??'?')+_0x356dcf(0x292)+this[_0x356dcf(0x2f3)]['length']);}catch(_0x13408c){for(const _0x42f135 of this[_0x356dcf(0x1d2)]){try{_0x42f135();}catch{}}this[_0x356dcf(0x21a)](),this[_0x356dcf(0x19e)]=!![];if(_0x13408c instanceof _0x3627d8)throw _0x13408c;const _0x98d174={'cause':_0x13408c,'env':this[_0x356dcf(0x1ca)]?.['name'],'envPath':this[_0x356dcf(0x1ca)]?.['path'],'pid':process[_0x356dcf(0x2b6)],'txnId':this['id'],'actionCount':this['actions'][_0x356dcf(0x220)],'actions':_0x4a0025(this['actions']),'nativeCode':_0x13408c?.['code'],'nativeName':_0x13408c?.[_0x356dcf(0x2d2)]};try{this[_0x356dcf(0x1ca)]?.[_0x356dcf(0x1ed)]?.[_0x356dcf(0x1a4)]?.(_0x356dcf(0x1dd),{'env':_0x98d174['env'],'envPath':_0x98d174[_0x356dcf(0x22d)],'pid':_0x98d174['pid'],'txnId':_0x98d174[_0x356dcf(0x2c0)],'actionCount':_0x98d174[_0x356dcf(0x1f4)],'actions':_0x98d174[_0x356dcf(0x2f3)],'nativeCode':_0x98d174[_0x356dcf(0x28a)],'error':_0x13408c?.[_0x356dcf(0x1e4)],'stack':_0x13408c?.[_0x356dcf(0x211)]});}catch{}throw new _0x3627d8(_0x13408c?.[_0x356dcf(0x1e4)]||_0x356dcf(0x1eb),_0x356dcf(0x1f7),_0x98d174);}this[_0x356dcf(0x1ca)]['events'][_0x356dcf(0x295)](_0x315408[_0x356dcf(0x1c2)],_0x31e480);for(const _0x4b18ea of this['_doHooks']){try{await _0x4b18ea();}catch{}}this['actions']=[],this[_0x356dcf(0x21a)](),this[_0x356dcf(0x19e)]=!![];}static['createWriteFacade'](_0x157357){const _0x255097=_0x58e204;return Object[_0x255097(0x2d3)]({'id':_0x157357['id'],'put':_0x157357['put'][_0x255097(0x217)](_0x157357),'update':_0x157357[_0x255097(0x21e)]['bind'](_0x157357),'patch':_0x157357[_0x255097(0x23f)]['bind'](_0x157357),'create':_0x157357[_0x255097(0x2c6)][_0x255097(0x217)](_0x157357),'remove':_0x157357[_0x255097(0x2bf)][_0x255097(0x217)](_0x157357),'setTTL':_0x157357[_0x255097(0x1b4)][_0x255097(0x217)](_0x157357),'clearTTL':_0x157357[_0x255097(0x2c9)][_0x255097(0x217)](_0x157357),'commit':_0x157357[_0x255097(0x26d)][_0x255097(0x217)](_0x157357),'rollback':_0x157357[_0x255097(0x1e7)][_0x255097(0x217)](_0x157357),'get':_0x157357['get'][_0x255097(0x217)](_0x157357),'getEntry':_0x157357[_0x255097(0x2f9)][_0x255097(0x217)](_0x157357),'getMany':_0x157357['getMany']['bind'](_0x157357),'getRange':_0x157357[_0x255097(0x1de)]['bind'](_0x157357),'getValues':_0x157357[_0x255097(0x268)][_0x255097(0x217)](_0x157357),'getKeys':_0x157357[_0x255097(0x2b8)][_0x255097(0x217)](_0x157357),'byIndex':_0x157357[_0x255097(0x2cf)][_0x255097(0x217)](_0x157357),'query':_0x157357[_0x255097(0x25e)][_0x255097(0x217)](_0x157357),'getClock':_0x157357[_0x255097(0x2d5)][_0x255097(0x217)](_0x157357),'getCount':_0x157357['getCount'][_0x255097(0x217)](_0x157357),'read':_0x157357,'raw':_0x157357});}static['applyOps'](_0x1574b4,_0x52bdd2=[]){const _0x3e9532=_0x58e204;if(!Array[_0x3e9532(0x2a8)](_0x52bdd2))throw new _0x3627d8(_0x3e9532(0x234),_0x3e9532(0x19f));for(const _0x17f9d3 of _0x52bdd2){if(Array['isArray'](_0x17f9d3)){const [_0x5b8df7,..._0x1cd8f7]=_0x17f9d3;if(typeof _0x1574b4[_0x5b8df7]!==_0x3e9532(0x1e6))throw new _0x3627d8(_0x3e9532(0x2ac)+_0x5b8df7,_0x3e9532(0x251),{'action':_0x5b8df7});_0x1574b4[_0x5b8df7](..._0x1cd8f7);continue;}if(!_0x17f9d3||typeof _0x17f9d3!==_0x3e9532(0x195))throw new _0x3627d8(_0x3e9532(0x235),_0x3e9532(0x250));const {action:_0x149690}=_0x17f9d3;if(typeof _0x149690!==_0x3e9532(0x225)||typeof _0x1574b4[_0x149690]!=='function')throw new _0x3627d8(_0x3e9532(0x2ac)+_0x149690,_0x3e9532(0x251),{'action':_0x149690});switch(_0x149690){case'put':case _0x3e9532(0x21e):case _0x3e9532(0x2c6):_0x1574b4[_0x149690](_0x17f9d3[_0x3e9532(0x302)],_0x17f9d3[_0x3e9532(0x258)],_0x17f9d3[_0x3e9532(0x222)],{..._0x17f9d3[_0x3e9532(0x202)],'ttl':_0x17f9d3[_0x3e9532(0x2cd)]??_0x17f9d3[_0x3e9532(0x202)]?.[_0x3e9532(0x2cd)]??null});break;case _0x3e9532(0x23f):_0x1574b4[_0x3e9532(0x23f)](_0x17f9d3[_0x3e9532(0x302)],_0x17f9d3[_0x3e9532(0x258)],_0x17f9d3[_0x3e9532(0x23f)],{..._0x17f9d3[_0x3e9532(0x202)],'ttl':_0x17f9d3[_0x3e9532(0x2cd)]??_0x17f9d3[_0x3e9532(0x202)]?.[_0x3e9532(0x2cd)]??null});break;case _0x3e9532(0x2bf):_0x1574b4['remove'](_0x17f9d3[_0x3e9532(0x302)],_0x17f9d3[_0x3e9532(0x258)],_0x17f9d3[_0x3e9532(0x202)]||{});break;case _0x3e9532(0x1b4):_0x1574b4[_0x3e9532(0x1b4)](_0x17f9d3['type'],_0x17f9d3[_0x3e9532(0x258)],_0x17f9d3[_0x3e9532(0x2cd)]);break;case _0x3e9532(0x2c9):_0x1574b4['clearTTL'](_0x17f9d3[_0x3e9532(0x302)],_0x17f9d3[_0x3e9532(0x258)]);break;default:throw new _0x3627d8(_0x3e9532(0x190)+_0x149690,_0x3e9532(0x251),{'action':_0x149690});}}}static async['run'](_0x4fb3a0,_0x4f0cdd,_0x29a62d={}){const _0x134b1f=_0x58e204,_0x3a78cf=new _0x5aabf4(_0x4fb3a0,_0x29a62d),_0x3f780e=_0x5aabf4['createWriteFacade'](_0x3a78cf);try{typeof _0x4f0cdd===_0x134b1f(0x1e6)?await _0x4f0cdd(_0x3f780e):_0x5aabf4[_0x134b1f(0x2a9)](_0x3a78cf,_0x4f0cdd||[]);const _0xd0b1d=_0x3a78cf[_0x134b1f(0x2f3)]['length'];return await _0x3a78cf[_0x134b1f(0x26d)](),{'id':_0x3a78cf['id'],'actions':_0xd0b1d};}catch(_0x5b6520){try{_0x3a78cf['rollback']();}catch(_0x440674){}throw _0x5b6520;}}}return okdbTransaction=_0x5aabf4,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x4167c2=requireOkdbTransaction();function _0x8e048c(_0x61e244){const _0x5b6c72=_0x5daa;return{'transaction':typeof _0x61e244[_0x5b6c72(0x28b)]===_0x5b6c72(0x1e6)?_0x61e244['transaction'][_0x5b6c72(0x217)](_0x61e244):_0x394408=>new _0x4167c2(_0x61e244,_0x394408),'txn':typeof _0x61e244[_0x5b6c72(0x2ee)]===_0x5b6c72(0x1e6)?_0x61e244[_0x5b6c72(0x2ee)][_0x5b6c72(0x217)](_0x61e244):(_0x5eea4c,_0xeab1d7)=>_0x4167c2[_0x5b6c72(0x18f)](_0x61e244,_0x5eea4c,_0xeab1d7)};}function _0x2a3ac8(_0x190115){const _0x420a42=_0x5daa;return{'name':_0x190115[_0x420a42(0x2d2)],..._0x8e048c(_0x190115),'put':_0x190115[_0x420a42(0x253)][_0x420a42(0x217)](_0x190115),'update':_0x190115['update'][_0x420a42(0x217)](_0x190115),'patch':_0x190115[_0x420a42(0x23f)][_0x420a42(0x217)](_0x190115),'create':_0x190115[_0x420a42(0x2c6)][_0x420a42(0x217)](_0x190115),'remove':_0x190115[_0x420a42(0x2bf)][_0x420a42(0x217)](_0x190115),'get':_0x190115['get'][_0x420a42(0x217)](_0x190115),'getMany':_0x190115[_0x420a42(0x20a)][_0x420a42(0x217)](_0x190115),'getEntry':_0x190115[_0x420a42(0x2f9)][_0x420a42(0x217)](_0x190115),'getRange':_0x190115['getRange'][_0x420a42(0x217)](_0x190115),'getValues':_0x190115[_0x420a42(0x268)][_0x420a42(0x217)](_0x190115),'getKeys':_0x190115[_0x420a42(0x2b8)][_0x420a42(0x217)](_0x190115),'getCount':_0x190115[_0x420a42(0x2fc)][_0x420a42(0x217)](_0x190115),'getByPrefix':_0x190115[_0x420a42(0x2b0)][_0x420a42(0x217)](_0x190115),'getIndex':_0x190115[_0x420a42(0x1d8)][_0x420a42(0x217)](_0x190115),'byIndex':_0x190115[_0x420a42(0x2cf)]['bind'](_0x190115),'query':_0x190115[_0x420a42(0x25e)][_0x420a42(0x217)](_0x190115),'geoQuery':_0x190115[_0x420a42(0x1b7)][_0x420a42(0x217)](_0x190115),'ftsQuery':_0x190115[_0x420a42(0x284)][_0x420a42(0x217)](_0x190115),'setTTL':_0x190115[_0x420a42(0x1b4)][_0x420a42(0x217)](_0x190115),'getTTL':_0x190115[_0x420a42(0x1ad)]['bind'](_0x190115),'clearTTL':_0x190115['clearTTL'][_0x420a42(0x217)](_0x190115),'sweepExpiredTTL':_0x190115['sweepExpiredTTL']['bind'](_0x190115),'listTTL':_0x190115[_0x420a42(0x1b6)][_0x420a42(0x217)](_0x190115),'ttlStats':_0x190115[_0x420a42(0x219)][_0x420a42(0x217)](_0x190115),'setDefaultTTL':_0x190115[_0x420a42(0x307)][_0x420a42(0x217)](_0x190115),'getDefaultTTL':_0x190115[_0x420a42(0x2c8)]['bind'](_0x190115),'clearDefaultTTL':_0x190115['clearDefaultTTL'][_0x420a42(0x217)](_0x190115),'registerType':_0x190115['registerType'][_0x420a42(0x217)](_0x190115),'ensureType':_0x190115[_0x420a42(0x1a1)]['bind'](_0x190115),'hasType':_0x190115['hasType'][_0x420a42(0x217)](_0x190115),'dropType':_0x190115['dropType'][_0x420a42(0x217)](_0x190115),'registerIndex':_0x190115[_0x420a42(0x212)][_0x420a42(0x217)](_0x190115),'hasIndex':_0x190115[_0x420a42(0x1cd)][_0x420a42(0x217)](_0x190115),'dropIndex':_0x190115[_0x420a42(0x1aa)][_0x420a42(0x217)](_0x190115),'resetIndex':_0x190115[_0x420a42(0x29f)][_0x420a42(0x217)](_0x190115),'indexReady':_0x190115['indexReady'][_0x420a42(0x217)](_0x190115),'getIndexStatus':_0x190115[_0x420a42(0x1e3)][_0x420a42(0x217)](_0x190115),'getClock':_0x190115[_0x420a42(0x2d5)]['bind'](_0x190115),'getChanges':_0x190115[_0x420a42(0x1e5)][_0x420a42(0x217)](_0x190115),'count':_0x190115[_0x420a42(0x29b)][_0x420a42(0x217)](_0x190115),'range':_0x190115[_0x420a42(0x2be)][_0x420a42(0x217)](_0x190115),'now':_0x190115[_0x420a42(0x1b8)]['bind'](_0x190115)};}function _0x3b20b7(_0x6b0dd1){const _0x572db3=_0x5daa;if(!_0x6b0dd1)return null;const _0x592bd4={};for(const _0x2f4f50 of['enqueue',_0x572db3(0x1c7),_0x572db3(0x19a),_0x572db3(0x26c),_0x572db3(0x20f),_0x572db3(0x2ea),_0x572db3(0x271),'listBuckets']){if(typeof _0x6b0dd1[_0x2f4f50]===_0x572db3(0x1e6))_0x592bd4[_0x2f4f50]=_0x6b0dd1[_0x2f4f50]['bind'](_0x6b0dd1);}return Object[_0x572db3(0x1f9)](_0x592bd4)[_0x572db3(0x220)]?_0x592bd4:null;}function _0x10d72e(_0x45f978){const _0x4f4f86=_0x5daa;if(!_0x45f978)return null;const _0x532cb9={};for(const _0x3b87b2 of['upload',_0x4f4f86(0x226),'remove',_0x4f4f86(0x237),_0x4f4f86(0x19a),_0x4f4f86(0x224)]){if(typeof _0x45f978[_0x3b87b2]==='function')_0x532cb9[_0x3b87b2]=_0x45f978[_0x3b87b2][_0x4f4f86(0x217)](_0x45f978);}return Object[_0x4f4f86(0x1f9)](_0x532cb9)[_0x4f4f86(0x220)]?_0x532cb9:null;}function _0x34f1de(_0x484ff2){const _0x31c267=_0x5daa;return{'env':_0x484ff2[_0x31c267(0x256)]['bind'](_0x484ff2),'createEnvironment':_0x484ff2[_0x31c267(0x2ce)]['bind'](_0x484ff2),'removeEnvironment':_0x484ff2[_0x31c267(0x1cb)][_0x31c267(0x217)](_0x484ff2),'info':_0x484ff2[_0x31c267(0x21b)],..._0x8e048c(_0x484ff2),'put':_0x484ff2[_0x31c267(0x253)][_0x31c267(0x217)](_0x484ff2),'update':_0x484ff2['update'][_0x31c267(0x217)](_0x484ff2),'patch':_0x484ff2[_0x31c267(0x23f)][_0x31c267(0x217)](_0x484ff2),'create':_0x484ff2['create']['bind'](_0x484ff2),'remove':_0x484ff2[_0x31c267(0x2bf)][_0x31c267(0x217)](_0x484ff2),'get':_0x484ff2['get'][_0x31c267(0x217)](_0x484ff2),'getMany':_0x484ff2['getMany'][_0x31c267(0x217)](_0x484ff2),'getEntry':_0x484ff2[_0x31c267(0x2f9)][_0x31c267(0x217)](_0x484ff2),'getRange':_0x484ff2[_0x31c267(0x1de)][_0x31c267(0x217)](_0x484ff2),'getValues':_0x484ff2[_0x31c267(0x268)][_0x31c267(0x217)](_0x484ff2),'getKeys':_0x484ff2[_0x31c267(0x2b8)]['bind'](_0x484ff2),'getCount':_0x484ff2[_0x31c267(0x2fc)][_0x31c267(0x217)](_0x484ff2),'getByPrefix':_0x484ff2[_0x31c267(0x2b0)][_0x31c267(0x217)](_0x484ff2),'getIndex':_0x484ff2[_0x31c267(0x1d8)][_0x31c267(0x217)](_0x484ff2),'byIndex':_0x484ff2[_0x31c267(0x2cf)][_0x31c267(0x217)](_0x484ff2),'query':_0x484ff2[_0x31c267(0x25e)]['bind'](_0x484ff2),'setTTL':_0x484ff2[_0x31c267(0x1b4)][_0x31c267(0x217)](_0x484ff2),'getTTL':_0x484ff2[_0x31c267(0x1ad)][_0x31c267(0x217)](_0x484ff2),'clearTTL':_0x484ff2[_0x31c267(0x2c9)]['bind'](_0x484ff2),'sweepExpiredTTL':_0x484ff2[_0x31c267(0x206)]['bind'](_0x484ff2),'listTTL':_0x484ff2[_0x31c267(0x1b6)][_0x31c267(0x217)](_0x484ff2),'ttlStats':_0x484ff2[_0x31c267(0x219)][_0x31c267(0x217)](_0x484ff2),'setDefaultTTL':_0x484ff2[_0x31c267(0x307)][_0x31c267(0x217)](_0x484ff2),'getDefaultTTL':_0x484ff2[_0x31c267(0x2c8)][_0x31c267(0x217)](_0x484ff2),'clearDefaultTTL':_0x484ff2[_0x31c267(0x2ca)][_0x31c267(0x217)](_0x484ff2),'ensureType':_0x484ff2[_0x31c267(0x1a1)]['bind'](_0x484ff2),'registerType':_0x484ff2['registerType'][_0x31c267(0x217)](_0x484ff2),'hasType':_0x484ff2[_0x31c267(0x2af)]['bind'](_0x484ff2),'dropType':_0x484ff2[_0x31c267(0x28d)][_0x31c267(0x217)](_0x484ff2),'registerIndex':_0x484ff2['registerIndex'][_0x31c267(0x217)](_0x484ff2),'hasIndex':_0x484ff2['hasIndex'][_0x31c267(0x217)](_0x484ff2),'dropIndex':_0x484ff2[_0x31c267(0x1aa)][_0x31c267(0x217)](_0x484ff2),'resetIndex':_0x484ff2[_0x31c267(0x29f)][_0x31c267(0x217)](_0x484ff2),'indexReady':_0x484ff2[_0x31c267(0x1c0)]['bind'](_0x484ff2),'getIndexStatus':_0x484ff2[_0x31c267(0x1e3)][_0x31c267(0x217)](_0x484ff2),'getClock':_0x484ff2[_0x31c267(0x2d5)][_0x31c267(0x217)](_0x484ff2),'getChanges':_0x484ff2[_0x31c267(0x1e5)][_0x31c267(0x217)](_0x484ff2),'queue':_0x484ff2[_0x31c267(0x2ed)],'files':_0x484ff2[_0x31c267(0x2fb)]};}return okdbFunctionsFacades={'createEnvFacade':_0x2a3ac8,'createQueueFacade':_0x3b20b7,'createFilesFacade':_0x10d72e,'createGlobalFacade':_0x34f1de},okdbFunctionsFacades;}function _0x5daa(_0x460f9e,_0x50bf05){_0x460f9e=_0x460f9e-0x18e;const _0x419431=_0x4194();let _0x5daa3a=_0x419431[_0x460f9e];return _0x5daa3a;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x33fddd=_0x4794cd;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0x582d50=new Set([_0x33fddd(0x253),'patch',_0x33fddd(0x2c6),_0x33fddd(0x2bf),_0x33fddd(0x21e),_0x33fddd(0x1b4),_0x33fddd(0x2c9),_0x33fddd(0x206),_0x33fddd(0x307),_0x33fddd(0x2ca),_0x33fddd(0x28d),'dropIndex',_0x33fddd(0x29f)]),_0x59e98f=new Set([_0x33fddd(0x2e0),'updateJob',_0x33fddd(0x20f),_0x33fddd(0x2ea)]),_0x1422c3=new Set([_0x33fddd(0x21d),_0x33fddd(0x2bf)]);function _0x264549(_0x1d6fd3,_0x14a88f){const _0x23bf95=_0x33fddd;if(_0x1d6fd3===_0x23bf95(0x256)||_0x1d6fd3===_0x23bf95(0x20c))return _0x582d50['has'](_0x14a88f);if(_0x1d6fd3===_0x23bf95(0x2ed))return _0x59e98f[_0x23bf95(0x309)](_0x14a88f);if(_0x1d6fd3===_0x23bf95(0x2fb))return _0x1422c3[_0x23bf95(0x309)](_0x14a88f);return![];}function _0x1cd806(_0x14edaf,_0x5eb9b2,_0x4a1e27,_0x17ff9c){if(!_0x14edaf)return _0x14edaf;return new Proxy(_0x14edaf,{'get'(_0x1d7610,_0x27f353,_0x39014e){const _0x13bd9c=_0x5daa,_0xc52dc4=Reflect[_0x13bd9c(0x237)](_0x1d7610,_0x27f353,_0x39014e);if(typeof _0xc52dc4!==_0x13bd9c(0x1e6))return _0xc52dc4;if(!_0x264549(_0x5eb9b2,_0x27f353))return _0xc52dc4[_0x13bd9c(0x217)](_0x1d7610);return function(..._0x3eb201){const _0x288f81=_0x13bd9c;return _0x17ff9c[_0x288f81(0x305)]({'scope':_0x5eb9b2,'method':_0x27f353,'envName':_0x4a1e27,'args':_0x3eb201}),null;};}});}function _0x37f51c(_0x39928d,_0x7ed2e6,_0x343659,_0x21536e){const _0x4204fd={};for(const _0x2e99b2 of _0x343659){_0x4204fd[_0x2e99b2]=(..._0x388f3d)=>{const _0x171169=_0x5daa;return _0x264549(_0x39928d,_0x2e99b2)&&_0x21536e[_0x171169(0x305)]({'scope':_0x39928d,'method':_0x2e99b2,'envName':_0x7ed2e6,'args':_0x388f3d}),null;};}return _0x4204fd;}return okdbFunctionsDryrun={'isWriteMethod':_0x264549,'wrapForDryRun':_0x1cd806,'syntheticDryRunFacade':_0x37f51c,'ENV_WRITE_METHODS':_0x582d50,'QUEUE_WRITE_METHODS':_0x59e98f,'FILES_WRITE_METHODS':_0x1422c3},okdbFunctionsDryrun;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function requireOkdbFunctionsContext(){const _0x21513a=_0x4794cd;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x381715,createQueueFacade:_0x11a225,createFilesFacade:_0x18cb11,createGlobalFacade:_0x517b14}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x1e9944,syntheticDryRunFacade:_0x1cca4b}=requireOkdbFunctionsDryrun(),_0x5beb1d=['enqueue',_0x21513a(0x1c7),'list','updateJob',_0x21513a(0x20f),_0x21513a(0x2ea),_0x21513a(0x271),'listBuckets'],_0x24bc61=[_0x21513a(0x21d),'stream','remove',_0x21513a(0x237),_0x21513a(0x19a),_0x21513a(0x224)];function _0x5d0a7a(_0x33d940,_0x29ea4f){const _0x43cf67=_0x21513a,_0x156c9e=(_0x30835c,_0x395ce7,_0xd3b610)=>_0x29ea4f({'type':_0x43cf67(0x1ed),'requestId':_0x33d940[_0x43cf67(0x2b7)],'runId':_0x33d940['runId'],'entry':{'level':_0x30835c,'msg':_0x395ce7,'context':_0xd3b610,'ts':Date[_0x43cf67(0x1b8)]()}}),_0x41cc09=(_0x25949e,_0x5eda7e)=>_0x156c9e(_0x43cf67(0x21b),_0x25949e,_0x5eda7e);return _0x41cc09['info']=(_0x56bb91,_0x4b9f20)=>_0x156c9e(_0x43cf67(0x21b),_0x56bb91,_0x4b9f20),_0x41cc09[_0x43cf67(0x2e8)]=(_0x332601,_0x11981a)=>_0x156c9e('warn',_0x332601,_0x11981a),_0x41cc09['error']=(_0x159ada,_0x3aeb7c)=>_0x156c9e(_0x43cf67(0x1a4),_0x159ada,_0x3aeb7c),_0x41cc09[_0x43cf67(0x1c6)]=(_0x7e2522,_0xd1436)=>_0x156c9e(_0x43cf67(0x1c6),_0x7e2522,_0xd1436),_0x41cc09;}function _0x20e881(_0x4cc53a,_0x273b05,_0x129fd0){const _0x440d74=_0x21513a;if(!_0x4cc53a)return null;return{'id':_0x4cc53a['id']??null,'type':_0x4cc53a[_0x440d74(0x302)]??null,'tries':_0x4cc53a[_0x440d74(0x1e9)]??null,'created':_0x4cc53a[_0x440d74(0x242)]??null,'tags':_0x4cc53a['tags']??null,'priority':_0x4cc53a[_0x440d74(0x1e0)]??null,'bucket':_0x4cc53a[_0x440d74(0x2e1)]??null,'cron':_0x4cc53a[_0x440d74(0x213)]??null,'heartbeat'(){const _0x18ba99=_0x440d74;_0x129fd0({'type':_0x18ba99(0x254),'requestId':_0x273b05[_0x18ba99(0x2b7)],'runId':_0x273b05[_0x18ba99(0x1b0)],'jobId':_0x4cc53a['id'],'claimId':_0x4cc53a['claimId']});},'markProgress'(_0x48f3e1){const _0x3462b5=_0x440d74;_0x129fd0({'type':_0x3462b5(0x1f6),'requestId':_0x273b05[_0x3462b5(0x2b7)],'runId':_0x273b05[_0x3462b5(0x1b0)],'jobId':_0x4cc53a['id'],'claimId':_0x4cc53a[_0x3462b5(0x2f8)],'message':_0x48f3e1});}};}function _0x21e05e(_0x4af647){const _0x58bc3d=_0x21513a;if(!_0x4af647)return null;return{'mode':_0x4af647[_0x58bc3d(0x2d7)]??null,'sourceType':_0x4af647[_0x58bc3d(0x303)]??null,'sourceEnv':_0x4af647['sourceEnv']??null,'processor':_0x4af647[_0x58bc3d(0x1a3)]??null,'engineKey':_0x4af647['engineKey']??null,'cursorKey':_0x4af647['cursorKey']??null};}function _0x2cc083(_0xb5fa8a){const _0x451cf1=_0x21513a;if(!_0xb5fa8a)return null;return{'mode':_0xb5fa8a['mode']??null,'sourceType':_0xb5fa8a[_0x451cf1(0x303)]??null,'targetType':_0xb5fa8a[_0x451cf1(0x27c)]??null,'sourceEnv':_0xb5fa8a['sourceEnv']??null,'targetEnv':_0xb5fa8a[_0x451cf1(0x1a7)]??null,'engineKey':_0xb5fa8a[_0x451cf1(0x1ef)]??null,'cursorKey':_0xb5fa8a[_0x451cf1(0x230)]??null};}function _0x44c7fc(_0x6d3a26,_0x44de68,_0x2b2e77,_0x29d6e0=null,_0x58f797=null){const _0x36f907=_0x21513a,_0x9129b7={'runId':_0x44de68['runId'],'scope':'env','env':_0x44de68['envName']??null,'functionName':_0x44de68[_0x36f907(0x1cf)],'trigger':_0x44de68[_0x36f907(0x21b)]?.[_0x36f907(0x1a6)]??_0x36f907(0x2d9),'requestedAt':_0x44de68[_0x36f907(0x21b)]?.['requestedAt']??Date['now']()},_0x4dac7a=_0x5d0a7a(_0x44de68,_0x2b2e77),_0x57261b=AbortSignal['timeout'](Math[_0x36f907(0x244)](0x1,_0x44de68['runtime']?.[_0x36f907(0x1d7)]??0x3e8)),_0x62ad0=_0x58f797?AbortSignal[_0x36f907(0x228)]([_0x57261b,_0x58f797]):_0x57261b,_0x5c4965=_0x6d3a26[_0x36f907(0x256)](_0x44de68['envName']),_0x205eb4=_0x29d6e0?_0x1e9944(_0x5c4965,_0x36f907(0x256),_0x44de68['envName'],_0x29d6e0):_0x5c4965,_0x5b5f12=_0x29d6e0?_0x5c4965[_0x36f907(0x2ed)]?_0x1e9944(_0x5c4965[_0x36f907(0x2ed)],_0x36f907(0x2ed),_0x44de68[_0x36f907(0x2e6)],_0x29d6e0):_0x1cca4b(_0x36f907(0x2ed),_0x44de68[_0x36f907(0x2e6)],_0x5beb1d,_0x29d6e0):_0x5c4965[_0x36f907(0x2ed)],_0x324629=_0x29d6e0?_0x5c4965[_0x36f907(0x2fb)]?_0x1e9944(_0x5c4965[_0x36f907(0x2fb)],'files',_0x44de68[_0x36f907(0x2e6)],_0x29d6e0):_0x1cca4b(_0x36f907(0x2fb),_0x44de68['envName'],_0x24bc61,_0x29d6e0):_0x5c4965[_0x36f907(0x2fb)],_0x79492f=_0x381715(_0x205eb4),_0x29b368=_0x11a225(_0x5b5f12),_0x4894f9=_0x18cb11(_0x324629);if(_0x29b368)_0x79492f[_0x36f907(0x2ed)]=_0x29b368;if(_0x4894f9)_0x79492f['files']=_0x4894f9;const _0x1330bb={'payload':_0x44de68['payload']??null,'info':_0x9129b7,'signal':_0x62ad0,'log':_0x4dac7a,'env':_0x79492f},_0x7903c2=_0x20e881(_0x44de68[_0x36f907(0x28e)],_0x44de68,_0x2b2e77);if(_0x7903c2)_0x1330bb[_0x36f907(0x243)]=_0x7903c2;const _0x48599e=_0x21e05e(_0x44de68[_0x36f907(0x259)]);if(_0x48599e)_0x1330bb[_0x36f907(0x1a3)]=_0x48599e;const _0x14919f=_0x2cc083(_0x44de68['materializerContext']);if(_0x14919f)_0x1330bb[_0x36f907(0x23b)]=_0x14919f;if(_0x44de68[_0x36f907(0x204)]){const _0x517721=_0x29d6e0?_0x1e9944(_0x6d3a26,'global',null,_0x29d6e0):_0x6d3a26;_0x1330bb[_0x36f907(0x1ca)]=_0x517b14(_0x517721);}return _0x1330bb;}return okdbFunctionsContext={'createExecutionContext':_0x44c7fc,'createScriptLogger':_0x5d0a7a},okdbFunctionsContext;}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){const _0xc85986=_0x4794cd;if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0x287a66,workerData:_0x2fb42a}=require$$0$3;requireOkdbFatalReport()[_0xc85986(0x308)]('sandbox');const _0x2fb99e=require$$2,{compileFunctionExpression:_0x3c3623}=requireOkdbFunctionsSandbox(),{serializeError:_0x5638ae}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x217833}=requireOkdbFunctionsContext(),_0x331cf3=require$$6;let _0x33fe2f=null,_0x58c69b=![];const _0x36bfca=new Map(),_0x25ebdb=new Map();function _0x20ed7d(_0x2dc492){try{_0x287a66['postMessage'](_0x2dc492);}catch{}}function _0x2222c9(_0x1a4e4f){const _0x2ff72d=_0xc85986,_0xa7f84e=(_0x1a4e4f[_0x2ff72d(0x2e6)]||_0x2ff72d(0x2a4))+':'+_0x1a4e4f['functionName']+':'+_0x1a4e4f['version']+':'+_0x1a4e4f[_0x2ff72d(0x227)];let _0x460ea9=_0x36bfca[_0x2ff72d(0x237)](_0xa7f84e);return!_0x460ea9&&(_0x460ea9=_0x3c3623(_0x1a4e4f[_0x2ff72d(0x24b)],{'allowFetch':_0x1a4e4f[_0x2ff72d(0x238)]?.['allowFetch']!==![],'allowedFetchDomains':_0x1a4e4f[_0x2ff72d(0x238)]?.[_0x2ff72d(0x289)],'filename':_0x1a4e4f['functionName']+_0x2ff72d(0x2c4)}),_0x36bfca[_0x2ff72d(0x2ef)](_0xa7f84e,_0x460ea9)),_0x460ea9;}async function _0x366dde(_0x92b4a8){const _0x888889=_0xc85986,_0x176959=Date[_0x888889(0x1b8)](),_0x4e0c3a=new AbortController();_0x25ebdb[_0x888889(0x2ef)](_0x92b4a8[_0x888889(0x2b7)],_0x4e0c3a);try{const _0x4270b7=_0x2222c9(_0x92b4a8);if(_0x92b4a8[_0x888889(0x2e6)])await _0x33fe2f[_0x888889(0x304)](_0x92b4a8[_0x888889(0x2e6)]);const _0x2e4736=_0x92b4a8[_0x888889(0x20d)]?[]:null,_0xc5513c=_0x217833(_0x33fe2f,_0x92b4a8,_0x20ed7d,_0x2e4736,_0x4e0c3a[_0x888889(0x19d)]),_0x169433=await _0x4270b7(_0xc5513c),_0x3df26a={'type':_0x888889(0x287),'requestId':_0x92b4a8[_0x888889(0x2b7)],'runId':_0x92b4a8[_0x888889(0x1b0)],'result':_0x169433,'meta':{'runnerId':'sandbox-'+process['pid'],'startedAt':_0x176959,'finishedAt':Date[_0x888889(0x1b8)](),'durationMs':Date['now']()-_0x176959}};if(_0x2e4736)_0x3df26a[_0x888889(0x249)]=_0x2e4736;_0x20ed7d(_0x3df26a);}catch(_0x35d622){_0x20ed7d({'type':'error','requestId':_0x92b4a8[_0x888889(0x2b7)],'runId':_0x92b4a8[_0x888889(0x1b0)],'error':_0x5638ae(_0x35d622),'meta':{'runnerId':'sandbox-'+process['pid'],'startedAt':_0x176959,'finishedAt':Date['now'](),'durationMs':Date[_0x888889(0x1b8)]()-_0x176959}});}finally{_0x25ebdb[_0x888889(0x18e)](_0x92b4a8['requestId']);}}async function _0x59981c(){const _0x2e6ef4=_0xc85986;if(_0x58c69b)return;_0x58c69b=!![];try{await _0x33fe2f?.[_0x2e6ef4(0x2d6)]?.();}catch{}process[_0x2e6ef4(0x1ff)](0x0);}async function _0x462d65(){const _0x536d8e=_0xc85986,{rootPath:_0x9d84f2}=_0x2fb42a??{};if(!_0x9d84f2)throw new Error(_0x536d8e(0x2eb));_0x33fe2f=new _0x331cf3(_0x9d84f2,{'engines':![],'processors':![],'compaction':![],'http':![],'auth':{'open':!![]},'processes':![]}),await _0x33fe2f[_0x536d8e(0x2dc)]();const _0x3bf036=setInterval(()=>{const _0x3bc9e5=_0x536d8e;if(_0x58c69b)return;for(const [,_0x4496b7]of _0x33fe2f['_envs']){try{_0x4496b7[_0x3bc9e5(0x1df)]?.();}catch{}}},0xc8);if(typeof _0x3bf036[_0x536d8e(0x192)]===_0x536d8e(0x1e6))_0x3bf036[_0x536d8e(0x192)]();_0x287a66['on'](_0x536d8e(0x1e4),_0x415c1e=>{const _0x1a0a56=_0x536d8e;if(!_0x415c1e||typeof _0x415c1e!==_0x1a0a56(0x195))return;if(_0x415c1e['type']==='stop')return void _0x59981c();if(_0x415c1e[_0x1a0a56(0x302)]===_0x1a0a56(0x300)){_0x25ebdb['get'](_0x415c1e[_0x1a0a56(0x2b7)])?.[_0x1a0a56(0x2ec)](new Error(_0x1a0a56(0x223)));return;}_0x415c1e[_0x1a0a56(0x302)]===_0x1a0a56(0x18f)&&void _0x366dde(_0x415c1e[_0x1a0a56(0x243)]);});const _0x52cf19=Math[_0x536d8e(0x244)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x10bdc3=setInterval(()=>{const _0x4b27bd=_0x536d8e;try{_0x20ed7d({'type':'stats','heapUsed':_0x2fb99e[_0x4b27bd(0x2bd)]()['used_heap_size']});}catch{}},_0x52cf19);if(typeof _0x10bdc3['unref']===_0x536d8e(0x1e6))_0x10bdc3[_0x536d8e(0x192)]();_0x20ed7d({'type':_0x536d8e(0x23c)});}return _0x462d65()['catch'](_0x2252c6=>{const _0x1a3802=_0xc85986;_0x20ed7d({'type':_0x1a3802(0x30d),'error':_0x5638ae(_0x2252c6)}),process[_0x1a3802(0x1ff)](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);function _0x4194(){const _0x1103d3=['bus:poke','slice','ttl','createEnvironment','byIndex','index:reset','compileTimeoutMs','name','freeze','Schema\x20validation\x20failed\x20for\x20','getClock','close','mode','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','sdk','percentile','mkdirSync','open','sort','OKDBTypeNotRegisteredError','action','enqueue','bucket','OKDBForeignKeyError','system:type_drop','setTtl','okdb-function-sandbox','envName','node:perf_hooks','warn','\x27\x20already\x20registered','addBucket','sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData','abort','queue','txn','set',':\x20expected\x20','Unique\x20constraint\x20violated\x20on\x20','txn:start','actions','offWindow','fts:registered','report','reject','claimId','getEntry','fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)','files','getCount','OKDBInvalidIndexKeyError','item:remove','license:added','cancel','label','type','sourceType','openEnv','push','SCHEMA_VALIDATION_FAILED','setDefaultTTL','enableFatalReport','has','captureStackTrace','Cannot\x20set\x20enforce\x20schema\x20on\x20','txn:end','fatal','delete','run','Unsupported\x20transaction\x20action:\x20','halted','unref','system:bus_state_change','OKDBAlreadyExistsError','object','\x20references\x20','SCHEMA_COLLECTION_INVALID','ms\x20max=','kind','list','TYPE_NOT_REGISTERED','OKDBNotFoundError','signal','_closed','TXN_INVALID_OPS','fetch','ensureType','Invalid\x20primary\x20key\x20type:\x20','processor','error','uuid','trigger','targetEnv','toFixed','loop-lag\x20','dropIndex','88806UPVMcx','maxMs','getTTL','references','1500220mZKMJB','runId','VERSION_MISMATCH','license:removed','registerType','setTTL','bus:proc','listTTL','geoQuery','now','Version\x20mismatch\x20for\x20','creating','_started','stopping','registerFts','disable','true','indexReady','bus:type_drop','TXN_END','filename','write','system:stopped','debug','getJob','system:ready','\x27\x20on\x20type\x20\x27','okdb','removeEnvironment','maxExtra','hasIndex','sourceKey','functionName','item:create','targetKey','_undoHooks','_assertOpen',':\x20key\x20[','reportOnFatalError','excludeEnv','timeoutMs','getIndex','index:drop','_doHooks','resetting','Index\x20\x22','transaction\x20commit\x20failed','getRange','_drainHandler','priority','join','events','getIndexStatus','message','getChanges','function','rollback','FUNCTION_SCRIPT_INVALID_SHAPE','tries','NOT_FOUND','Unknown\x20OKDB\x20transaction\x20error','size','log','reportOnSignal','engineKey','enable','useReadTransaction','constructor','OKDBIndexNotRegisteredError','actionCount','details','job_progress','TXN_ERROR','system:poke','keys','231261FWYiuS','ALREADY_EXISTS','args','_startAdmission','FOREIGN_KEY_DELETE_RESTRICTED','exit','77bblrLH','allowFetch','options','Index\x20\x27','unsafe','map','sweepExpiredTTL','TXN_START','ttl:expired','exports','getMany','INVALID_INDEX_KEY','global','dryRun','done','removeJob','hostname','stack','registerIndex','cron','dropFts','Script','txn:rollback','bind','entries','ttlStats','_closeReadTransaction','info','UNIQUE_CONSTRAINT','upload','update','item:update','length','setLogger','value','cancelled\x20by\x20caller','getByPath','string','stream','hash','any','stringify','Function\x20script\x20failed\x20to\x20initialize','OKDBIndexHasConsumersError','FUNCTION_SCRIPT_COMPILE_FAILED','envPath','Type\x20\x27','dropping','cursorKey','Function\x20script\x20failed\x20to\x20compile','index:ready','type:registered','txn\x20ops\x20must\x20be\x20an\x20array','txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple','TXN_ROLLBACK','get','runtime','OKDBSchemaCollectionError','onDo','materializer','ready','starting','loop-lag','patch','stop','\x27\x20doesn\x27t\x20exist','created','job','max','note','_timer','errors','\x27:\x20','dryRunActions','directory','script','setSchema','6AsnjIp','_report','fts:drop','TXN_INVALID_OP','TXN_INVALID_ACTION','license:activated','put','job_heartbeat','crypto','env','SIGSEGV','key','processorContext','ref:violation','index:progress','FETCH_NOT_ALLOWED','mean','query','prototype','_admissionStarted','reduce','add','ms\x20p99=','enabled','start','OKDBError','OKDBInvalidPrimaryKeyError','getValues','win32','bus:env_release','_admissionTimer','updateJob','commit','Unknown\x20custom\x20function\x20error','_windowCbs','292445MxpEwI','getBucket','.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20','started','Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function','system:clock_change','call','env:removed','onUndo',']\x20already\x20maps\x20to\x20\x27','\x22\x20on\x20\x22','Transaction\x20already\x20closed','targetType','system:drain','resetFts','runInContext','unique:violation','system:proc','stopped','2171970NZYVuV','ftsQuery','OKDBTypeAlreadyRegisteredError','_log','result','\x27,\x20cannot\x20map\x20to\x20\x27','allowedFetchDomains','nativeCode','transaction','\x20│\x20','dropType','jobContext','Invalid\x20index\x20key\x20type\x20for\x20\x27','(worst\x20','__esModule','\x20actions=','default','INDEX_ALREADY_REGISTERED','emit','code','fts:reset','fieldPath','url','okdb-function.js','count','9tWuzkD','globalThis','bus:drain','resetIndex','fetch\x20blocked:\x20hostname\x20\x22','ttl:clear','reset','\x22\x20is\x20used\x20by:\x20','~system','4511090JAKVgm','OKDBForeignKeyDeleteError','586552ilEPrd','isArray','applyOps','schema:drop','fetch\x20blocked:\x20invalid\x20URL','Unknown\x20transaction\x20action:\x20',',\x20got\x20','_buckets','hasType','getByPrefix','onWindow','ttl:set','TYPE_ALREADY_REGISTERED','Cannot\x20delete\x20','hasOwnProperty','pid','requestId','getKeys','\x20which\x20does\x20not\x20exist','./okdb','INVALID_VALUE','txn-commit','getHeapStatistics','range','remove','txnId','ms/','cause','worker_threads','.okdb-function.js','sync:apply','create','readTransaction','getDefaultTTL','clearTTL','clearDefaultTTL'];_0x4194=function(){return _0x1103d3;};return _0x4194();}module[_0x4794cd(0x209)]=okdbFunctionsSandboxWorker;
|