@kedem/okdb 1.9.2 → 2.0.0

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.
Files changed (48) hide show
  1. package/README.md +3 -2
  2. package/bin/okdb.js +1 -1
  3. package/docs/deployment.md +155 -0
  4. package/docs/diagnostics.md +115 -0
  5. package/docs/embeddings.md +1 -1
  6. package/docs/functions.md +30 -27
  7. package/docs/getting-started.md +14 -3
  8. package/docs/http-api.md +3 -3
  9. package/docs/http-cluster.md +93 -60
  10. package/docs/index.md +13 -1
  11. package/docs/manifest.json +6 -3
  12. package/docs/pipelines.md +1 -1
  13. package/docs/process-registry.md +5 -5
  14. package/docs/processors.md +35 -18
  15. package/docs/queue.md +112 -42
  16. package/docs/sync.md +10 -7
  17. package/docs/ttl.md +1 -1
  18. package/docs/upgrade-2.0.md +290 -0
  19. package/okdb-functions-sandbox-worker.js +1 -1
  20. package/okdb-http-worker-child.js +1 -1
  21. package/okdb-views-bootstrap-worker.js +1 -1
  22. package/okdb.js +1 -1
  23. package/package.json +1 -1
  24. package/public/layouts/_default.ok.html +1 -1
  25. package/public/sections/db/modals/create-env-modal.ok.js +1 -1
  26. package/public/sections/db/modals/demo-env-modal.ok.js +1 -1
  27. package/public/sections/db/parts/db-overview.ok.js +1 -1
  28. package/public/sections/engines/engine-ui-utils.js +1 -1
  29. package/public/sections/engines/parts/engine-declaration-editor.ok.js +1 -1
  30. package/public/sections/engines/parts/generic-engine-panel.ok.js +1 -1
  31. package/public/sections/queue/parts/code-panel.ok.js +1 -1
  32. package/public/sections/queue/parts/job-log-panel.ok.js +1 -1
  33. package/public/sections/queue/parts/queue-jobs.ok.js +1 -1
  34. package/public/sections/sync/parts/sync-topology.ok.js +1 -1
  35. package/public/sections/system/index.ok.html +1 -1
  36. package/public/sections/system/parts/system-process-panel.ok.js +1 -1
  37. package/public/sections/system/parts/system-processing-panel.ok.js +1 -1
  38. package/public/sections/system/parts/system-runtime-overview.ok.js +1 -1
  39. package/public/setup-app.js +1 -1
  40. package/public/setup.html +116 -55
  41. package/types/index.d.ts +33 -3
  42. package/types/options.d.ts +19 -10
  43. package/docs/worker-fleet.md +0 -139
  44. package/okdb-functions-runner-child.js +0 -1
  45. package/okdb-queue-load-handler.js +0 -1
  46. package/okdb-queue-spawn-child.js +0 -1
  47. package/okdb-worker-child.js +0 -1
  48. package/public/sections/system/parts/system-workers-panel.ok.js +0 -1
@@ -0,0 +1,290 @@
1
+ # Upgrading to okdb 2.0
2
+
3
+ okdb 2.0 is a **breaking redesign of the runtime model**. The document model, storage
4
+ formats, HLC, sync wire protocol, and query/index APIs are **unchanged** — your data and
5
+ your read/write code keep working as-is. What changed is **how a process declares the work
6
+ it does**.
7
+
8
+ > **The one-sentence shift.** okdb stops being a runtime _orchestrator_ (a managed,
9
+ > auto-scaled "worker population") and becomes a _substrate_: **the process is the control
10
+ > unit**, it **declares** what it runs (it is never told by a supervisor), the per-`(env,type)`
11
+ > lease is the load balancer, and **spawning/placement is the launcher's job** — `bin/okdb`,
12
+ > systemd/k8s, or your own code. `new OKDB(path)` is still a correct, do-everything
13
+ > single-process node; you only add nodes when you decide you need them.
14
+
15
+ If you only ever used `new OKDB(path)` and the built-in CLI, **most of this doesn't affect
16
+ you** — the zero-config default is unchanged. The breaking surface is concentrated in the
17
+ constructor options and a few cluster/worker APIs.
18
+
19
+ ---
20
+
21
+ ## Constructor: now pure policy
22
+
23
+ The constructor declares **what role a node plays**. Every _mechanism_ that used to be a flag
24
+ is now **derived** — okdb turns it on the moment it's needed.
25
+
26
+ ```js
27
+ new OKDB(path, {
28
+ processors: true | false, // does this node participate in processing? (claim leases + drain)
29
+ engines: true | false, // embeddings/vector-search this node runs
30
+ compaction: true | false, // eligible to claim the per-env compaction lease
31
+ auth,
32
+ encryptionKey,
33
+ });
34
+ ```
35
+
36
+ There is no `http` constructor option — the HTTP server exists only when you call
37
+ `db.http.listen(port)`.
38
+
39
+ > **`processors` is a plain boolean.** An earlier 2.0 draft exposed a _filtered_ claim API
40
+ > (`processors: '<filter>'`, `db.processors.process()/processRest()/processEverything()`,
41
+ > per-node "dedication" + intent/complement). That was **removed** before release — it is one
42
+ > boolean: `true` = participate (claim every unclaimed `single` lease, the default), `false` =
43
+ > passive (claim nothing). Passing a filter string/array throws. See _Processors: one boolean_ below.
44
+
45
+ ### Removed options — they now **throw** with a migration message
46
+
47
+ | 1.9 option | 2.0 | Error |
48
+ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
49
+ | `asyncProcessors: true` | `processors: true` (participate — claim every unclaimed lease) | _(thrown, with message)_ |
50
+ | `asyncProcessors: false` | `processors: false` (passive — claim nothing) | _(thrown, with message)_ |
51
+ | `processors: '<filter>'` (2.0 draft) | `processors: true \| false` — the filtered claim form was removed before release | _(thrown, with message)_ |
52
+ | `bus: true \| false` | **removed** — auto-enabled when the LMDB path is shared and the shmbuf native binding is present | `BUS_OPTION_REMOVED` |
53
+ | `envs: 'all' \| 'core' \| […]` | **removed** — envs always open lazily; `removeEnvironment` broadcasts a release signal so handles close | `ENVS_REMOVED` |
54
+ | `sync: false` (per env) | **removed** — the changelog auto-enables for every user env; a pure local store simply never gets a consumer | `SYNC_OPTION_REMOVED` |
55
+ | `processing: 'auto' \| 'main'` | **removed** — participation is the `processors` boolean (see below) | `PROCESSING_REMOVED` _(thrown)_ |
56
+ | `processing: 'threads' \| 'processes'` | **removed** — there is no execution placement to configure: all drains run on the owner's loop in bounded quanta (see _Execution_ below) | `PROCESSING_REMOVED` _(thrown)_ |
57
+ | `workers: …` | **removed** — there is no managed population (see _Workers dissolved_) | _(see `db.workers` below)_ |
58
+ | `compaction: 'active' \| 'passive'` | **removed** (pre-release draft alias, never shipped) — `compaction` is boolean-only, like the other role flags | `COMPACTION_ALIAS_REMOVED` |
59
+
60
+ **Why these are safe to remove:** `bus` is load-bearing but detectable (shared path ⇒ on);
61
+ `envs` was never a real boundary (self-trusted embedded code can `openEnv()` anything) — its
62
+ only job was a Windows file-deletion race, now fixed by the env-release broadcast; the
63
+ changelog only costs anything when something consumes it, so it switches on with the first
64
+ consumer (a view, FTS, processor, subscription, or replication peer) — pre-existing writes are
65
+ covered by that consumer's normal bootstrap (snapshot scan + replay tail).
66
+
67
+ ---
68
+
69
+ ## Processors: one boolean
70
+
71
+ A node either **participates** in processing or it doesn't. That's the whole control surface.
72
+
73
+ ```js
74
+ new OKDB(path, { processors: true }); // participate: claim every unclaimed `single` lease (default)
75
+ new OKDB(path, { processors: false }); // passive: claim nothing (reads/writes + inline still work)
76
+ ```
77
+
78
+ - `new OKDB(path)` (no `processors` option) ⇒ **`processors: true`** — a single node claims
79
+ everything, exactly like 1.9's default full-role instance.
80
+ - The per-`(env,type)` `OKDBLock` lease is the load balancer: with N participating nodes, each
81
+ `single` processor is claimed by exactly one of them (1-of-N); a dead node's leases lapse and a
82
+ survivor re-claims (failover).
83
+ - Under sustained load the lease **load-shares by cooperative hold-window claiming**: a holder
84
+ drains for up to `OKDB_LEASE_HOLD_MS` (200 ms) per window and yields **only if a peer has
85
+ signalled it wants a turn** (a decaying marker in `~lock:want`). A lone process therefore keeps
86
+ its leases and drains at full speed with zero lock churn; when a second process has backlog they
87
+ rotate, splitting the work ≈evenly.
88
+ - Coverage is guaranteed while ≥1 participating node is live. A `single` processor that **no**
89
+ live node claims surfaces as **`unclaimed`** in the Processors view (a warning).
90
+
91
+ `asyncProcessors: true` ≡ `processors: true`; `asyncProcessors: false` ≡ `processors: false`.
92
+
93
+ > **Removed:** the filtered claim API — `processors: '<filter>'`, `db.processors.process(filter)`,
94
+ > `processRest()`, `processEverything()`, and per-node dedication/intent/complement. There is no
95
+ > per-type claim filter: every participating node is identical and the lease distributes the work.
96
+ > The verbs throw with a migration message; a filter value throws at construction. To **dedicate**
97
+ > hardware to processing, invert the flag: run the dedicated node with `processors: true` and open
98
+ > every other node `processors: false` — participation is per-node, so the passive nodes serve
99
+ > reads/writes while the dedicated one drains everything.
100
+
101
+ ---
102
+
103
+ ## Execution: everything on the owner's loop
104
+
105
+ There is exactly **one** execution model, and it is the simple one:
106
+
107
+ - **The event loop** runs reads/writes, sync apply, and every derived-work drain (FTS, views,
108
+ time-machine, materializer, embeddings). A drain never runs monolithically: `_flush` works in
109
+ **FLUSH_QUANTUM-bounded batches** (default 5 000 changes, `OKDB_PROCESSOR_FLUSH_QUANTUM`;
110
+ heavy per-item handlers like FTS use a smaller per-processor quantum), yielding to the loop
111
+ between chunks. The single async **`OKDBWriter`** per env keeps commit fsyncs on lmdb-js's
112
+ native committer thread, so the loop is never blocked on durability.
113
+ - **The sandbox** is the one thread in the engine — it runs **untrusted** per-call function code
114
+ only. Its concurrency is capped per process (`OKDB_FN_SANDBOX_CONCURRENCY`).
115
+ - There is **no processing pool, no slot threads, no off-loop trusted compute**. This was built
116
+ and measured: okdb's derived work is write-dominated (posting/group read-modify-write + fsync),
117
+ which cannot leave the owner — threads bought ~1.0× at real workloads while adding shared-env
118
+ lifecycle hazards. If one process's loop is not enough, run more processes — the 1-of-N lease
119
+ spreads the processors across them (see _Processors_ above).
120
+
121
+ **Ephemeral nodes** (CLI one-shots, serverless, short-lived scripts) should pass
122
+ `processors: false`: a process that grabs a 1-of-N lease and exits mid-quantum would thrash it.
123
+ `bin/okdb`'s one-shot subcommands already open passive.
124
+
125
+ ---
126
+
127
+ ## Workers dissolved — placement is the launcher's job
128
+
129
+ There is **no managed worker population** in 2.0. A "worker" was only ever a process that
130
+ opened the root and claimed processors.
131
+
132
+ | 1.9 | 2.0 |
133
+ | --------------------------------------------- | --------------------------------------------------------------------------------------------------- |
134
+ | `db.workers.ensure({ scale })` | **throws `WORKERS_REMOVED`.** Fork your own nodes: `new OKDB(path, { processors: true })`. |
135
+ | `db.workers.destroy()` | **throws `WORKERS_REMOVED`.** |
136
+ | autoscaler / desired-state / supervisor | gone from the library; survives only as **`bin/okdb`** launcher internals (the reference launcher). |
137
+ | `GET /api/workers`, `POST /api/workers/scale` | **410 `WORKERS_REMOVED`.** |
138
+
139
+ **To run a multi-process processing tier:** start more nodes over the same path — a plain
140
+ `new OKDB(path, { processors: true })` in a process you launch (pm2, systemd, docker, k8s, or
141
+ your own `child_process`). Opening the path _is_ joining — the leases distribute the work across
142
+ whatever nodes exist, and the hold-window rotation load-shares under sustained backlog.
143
+
144
+ okdb still **exposes the scaling signals** (per-processor durable lag, writer queue depth,
145
+ loop-lag) on the Processors/Processes admin surfaces so an external orchestrator can decide when
146
+ to add or retire nodes — but the _policy_ lives wherever you run the processes, not inside okdb.
147
+
148
+ ---
149
+
150
+ ## HTTP clustering: launcher-level only
151
+
152
+ A library node **never forks**. The embeddable child-entry clustering API is removed.
153
+
154
+ | 1.9 | 2.0 |
155
+ | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
156
+ | `http.listen(port, { workers, makeOkdb, primaryOkdb })` | **throws `HTTP_CLUSTER_REMOVED`.** |
157
+ | `bin/okdb` HTTP cluster | **N identical capable nodes** — each forked worker serves HTTP **and** processes (claims leases, drains on its own loop). No privileged processor; the Node-cluster primary is a thin **passive supervisor** (seeds the shared token secret, owns the registry). A dead worker's claims fail over to the rest. |
158
+ | embedder wants socket-sharing | use plain Node `cluster` yourself — a cluster worker calling `http.listen(port)` shares the socket natively, no okdb involvement. Or run **N independent `new OKDB(path)` full nodes** behind your balancer (same "N capable nodes" shape; they coordinate via the shared LMDB + bus + the 1-of-N lease). |
159
+
160
+ `http.listen(port)` (single-process) is **unchanged** and still returns a plain `http.Server`.
161
+
162
+ ---
163
+
164
+ ## Queue & functions
165
+
166
+ **Queue.** The queue is a **substrate okdb coordinates but does not place** — handlers are trusted
167
+ user code of unknown nature. Single-execution and at-least-once come from the CAS claim on the
168
+ durable job row, not from any pool. One verb:
169
+
170
+ - `queue.process(type, closure)` — an in-process consumer on **this** loop.
171
+
172
+ Scale by running more independent consumer processes (pm2, systemd, docker, kubernetes). Each opens
173
+ okdb and calls `process()` — the durable CAS claim hands each job to exactly one consumer without
174
+ coordination. The canonical pattern is a `workers/default.js` standalone script (see docs/queue.md).
175
+
176
+ `queue.worker(type, module)` — the auto-adopted "shared pool" form — was **removed** (throws
177
+ `QUEUE_WORKER_REMOVED`). `queue.spawn(type, module)` — the dedicated forked child — was also
178
+ **removed** in 2.0. Run independent consumer processes instead; they claim the same durable jobs
179
+ exactly once via CAS. The orphan-lock hazard (a forked okdb child that outlives its parent holds
180
+ the LMDB lock) is avoided by using independent processes instead of `child_process.fork`.
181
+
182
+ **Functions.** A function runs on **the node it was asked on**, in that node's per-process
183
+ sandbox thread — no `~fn:requests` round-trip for synchronous calls. Durable / run-eventually
184
+ functions become a queue job on a designated node. `OKDB_FN_LEGACY_POOL` and the fork-pool
185
+ path are gone.
186
+
187
+ ---
188
+
189
+ ## Processor handlers: named-registry vocab
190
+
191
+ okdb 2.0 adopts the **named-registry vocab** for processor handlers (PV-04). The document
192
+ model, storage formats, HLC, sync wire protocol, query/index, and view APIs are **unchanged**.
193
+
194
+ ### Breaking: closure handlers rejected without a quantum or durable definition
195
+
196
+ Bare closures passed as `handler` to `processor.register()` are no longer accepted for
197
+ `single`/`fanout` processors. Replace them with one of:
198
+
199
+ - **Named handler** (built-in, resolved at runtime):
200
+
201
+ ```js
202
+ // Register once at feature-load time:
203
+ OKDBProcessor.registerHandler('my:handler', async (ctx, changes, info) => { ... });
204
+
205
+ // Then register the processor:
206
+ env.processor.register('MyType', { handler: 'my:handler', mode: 'async', distribution: 'single', cursorKey: 'my:key' });
207
+ ```
208
+
209
+ - **Module reference** (external file, resolved via `require`):
210
+ ```js
211
+ env.processor.register('MyType', {
212
+ module: { path: require.resolve('./my-handler.js'), export: 'apply' },
213
+ mode: 'async',
214
+ distribution: 'single',
215
+ cursorKey: 'my:key',
216
+ });
217
+ ```
218
+
219
+ Internal processors that need a closure snapshot-handler must pair it with a `quantum`
220
+ (the reconstructible drain module — FTS, time-machine, materializer use this form) or declare
221
+ `definition: { durable: true }` for inline processors.
222
+
223
+ ### New: handler identity in status output
224
+
225
+ `processor.status()`, `GET /api/processors`, and `GET /api/processors/status` now include:
226
+
227
+ - `handler`: the registered handler name (`'my:handler'`), or `null`
228
+ - `module`: the module spec (`{ path, export }`), or `null`
229
+
230
+ These fields are also persisted to `~proc:state` as `<cursorKey>:handlerMeta` so the
231
+ handler identity is durable across restarts.
232
+
233
+ ### Stored-meta migration
234
+
235
+ On open, FTS type meta (`typesDb`) and procmode desired-state records are automatically
236
+ migrated: `runIn` is dropped, and old mode tokens (`worker`→`single`, `async`→`fanout`)
237
+ are normalized. This migration is idempotent and runs at most once per env.
238
+
239
+ ---
240
+
241
+ ## Compaction, replication, engines — claimed responsibilities
242
+
243
+ Three things that were "a role flag standing in for a cross-process lock" are now explicit
244
+ **claims on the existing flat `OKDBLock`** — which fixes real latent bugs:
245
+
246
+ - **Compaction** is a per-env lease. Concurrent compaction is now impossible by construction
247
+ (1.9 had _no_ lock — two `active` nodes could race the `data.mdb` swap). `compaction: true`
248
+ means "eligible to claim," not "the sole compactor by fiat." A **two-phase drain** shrinks
249
+ reader unavailability from the whole compaction to just the file swap.
250
+ - **Replication** is a `replicate:<peer>` claim — one local owner per remote peer, with
251
+ **lease failover** (1.9 had none; if the syncing process died, replication stopped). The peer
252
+ set stays a durable definition; `sync` never returns as a constructor flag.
253
+ - **Engines** (`vector-search`) fold into the same filter/claim model: a node loads only the
254
+ engines it's placed to run, lazy-loads the HNSW on first query, and evicts when idle (fixing
255
+ the eager-load memory bomb). `embeddings.search()` is **location-transparent** — it resolves
256
+ the index holder and proxies the query over internal HTTP, so search works on any node. The
257
+ `affinity`-tag placement mechanism is deleted.
258
+
259
+ ---
260
+
261
+ ## Persisted records — one open-time shim (automatic)
262
+
263
+ On the first 2.0 `open()`, an idempotent shim reconciles old records. You do nothing.
264
+
265
+ | Record | 2.0 action |
266
+ | --------------------------------------- | ------------------------------------------ |
267
+ | desired-state scope `'workers'` (scale) | obsolete — ignored + deleted |
268
+ | scope `'queue-worker'` definitions | obsolete — auto-adoption removed; inert |
269
+ | scope `'procmode'` records | kept — already canonical `single`/`fanout` |
270
+ | `~engines` records: `affinity` field | stripped/ignored — placement is claims now |
271
+ | `~engines` records: definition fields | kept — the durable engine config |
272
+ | scope `'node'` registry rows | kept |
273
+
274
+ ---
275
+
276
+ ## Quick checklist
277
+
278
+ 1. Remove `asyncProcessors`, `bus`, `envs`, `sync`, `processing`, `workers` from your
279
+ constructor calls. Map `asyncProcessors:true/false` → `processors:true/false`.
280
+ 2. Replace any filtered claim (`processors:'<filter>'`, `db.processors.process()/processRest()/
281
+ processEverything()`) with the boolean `processors: true|false`. Place a processor type by
282
+ running a node where you want it — claiming is first-come on the lease, not configured.
283
+ 3. Replace `queue.worker(type, module)` or `queue.spawn(type, module)` with `queue.process(type, fn)`
284
+ (in-loop), or run a consumer on another independent process/node.
285
+ 4. Replace `db.workers.ensure({scale})` with launching extra `new OKDB(path, { processors: true })`
286
+ nodes (or let `bin/okdb` do it). Use `processors: false` for short-lived/ephemeral processes.
287
+ 5. Replace any `http.listen(port, { workers })` with `bin/okdb` clustering or plain Node `cluster`.
288
+ 6. Drop `sync: false` on environments — a pure local store simply never attaches a consumer.
289
+ 7. If you scraped `/api/workers`, read the registry-sourced `/api/processes/tree` +
290
+ `/api/processors/status` instead.
@@ -1 +1 @@
1
- 'use strict';const _0x1da89e=_0x3fa0;(function(_0x484bf5,_0x4d2516){const _0x157de0=_0x3fa0,_0xa0640e=_0x484bf5();while(!![]){try{const _0x5e92d8=-parseInt(_0x157de0(0x211))/0x1*(-parseInt(_0x157de0(0x2f4))/0x2)+parseInt(_0x157de0(0x299))/0x3*(-parseInt(_0x157de0(0x21b))/0x4)+parseInt(_0x157de0(0x292))/0x5+parseInt(_0x157de0(0x1e2))/0x6*(-parseInt(_0x157de0(0x24d))/0x7)+-parseInt(_0x157de0(0x2bc))/0x8*(-parseInt(_0x157de0(0x2bf))/0x9)+-parseInt(_0x157de0(0x31f))/0xa*(-parseInt(_0x157de0(0x1cb))/0xb)+-parseInt(_0x157de0(0x218))/0xc*(parseInt(_0x157de0(0x2d5))/0xd);if(_0x5e92d8===_0x4d2516)break;else _0xa0640e['push'](_0xa0640e['shift']());}catch(_0x199cc5){_0xa0640e['push'](_0xa0640e['shift']());}}}(_0x42d0,0x433f3));var require$$0$3=require('worker_threads'),require$$1=require('v8'),require$$0=require(_0x1da89e(0x2e5)),require$$0$2=require('uuid'),require$$0$1=require(_0x1da89e(0x2ac)),require$$5=require(_0x1da89e(0x264));function getDefaultExportFromCjs(_0x36e0e9){const _0x58bf2a=_0x1da89e;return _0x36e0e9&&_0x36e0e9[_0x58bf2a(0x2cf)]&&Object[_0x58bf2a(0x269)][_0x58bf2a(0x2dd)]['call'](_0x36e0e9,'default')?_0x36e0e9['default']:_0x36e0e9;}var okdbFunctionsSandboxWorker$1={},okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x109e3a=require$$0;function _0x589b07(_0x25b847){const _0x3a1472=_0x3fa0,_0x37f788=_0x25b847==='*',_0x14a2a5=_0x37f788?null:new Set(Array[_0x3a1472(0x261)](_0x25b847)?_0x25b847:[]);return function _0x57199e(_0x2e219c,_0x36bffc){const _0x1c57d6=_0x3a1472;if(!_0x37f788){let _0x5637a0;try{const _0x17cf48=new URL(typeof _0x2e219c==='string'?_0x2e219c:_0x2e219c?.[_0x1c57d6(0x1df)]??String(_0x2e219c));_0x5637a0=_0x17cf48[_0x1c57d6(0x2f8)];}catch{const _0x757598=new Error(_0x1c57d6(0x304));return _0x757598['code']=_0x1c57d6(0x256),Promise[_0x1c57d6(0x298)](_0x757598);}if(!_0x14a2a5[_0x1c57d6(0x1d1)](_0x5637a0)){const _0x3bd2cd=new Error(_0x14a2a5[_0x1c57d6(0x24a)]===0x0?'fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)':'fetch\x20blocked:\x20hostname\x20\x22'+_0x5637a0+_0x1c57d6(0x1ea));return _0x3bd2cd['code']=_0x1c57d6(0x256),Promise['reject'](_0x3bd2cd);}}return fetch(_0x2e219c,_0x36bffc);};}function _0x363bae(_0xebf73e={}){const _0x21e285=_0x3fa0,_0x4a421a=_0xebf73e[_0x21e285(0x262)]!==![],_0x5008cd=_0xebf73e[_0x21e285(0x2b7)]??[],_0x4f3e86={'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[_0x21e285(0x307)]};return _0x4a421a&&typeof fetch==='function'&&(_0x4f3e86['fetch']=_0x589b07(_0x5008cd)),_0x4f3e86[_0x21e285(0x21d)]=_0x4f3e86,_0x4f3e86;}function _0xbcd0c1(_0x50ec8d,_0xd59e={}){const _0x3e1cc2=_0x3fa0,_0x3c69f0=_0x363bae(_0xd59e),_0x325662=_0x109e3a[_0x3e1cc2(0x31b)](_0x3c69f0,{'name':'okdb-function-sandbox','codeGeneration':{'strings':![],'wasm':![]}});let _0x370266;try{_0x370266=new _0x109e3a[(_0x3e1cc2(0x23c))]('('+_0x50ec8d+')',{'filename':_0xd59e[_0x3e1cc2(0x31d)]??_0x3e1cc2(0x30a)});}catch(_0x4d08d8){const _0xcd6766=new Error(_0x4d08d8?.[_0x3e1cc2(0x28d)]||_0x3e1cc2(0x1e6));_0xcd6766[_0x3e1cc2(0x2f2)]='FUNCTION_SCRIPT_COMPILE_FAILED',_0xcd6766[_0x3e1cc2(0x220)]=_0x4d08d8;throw _0xcd6766;}let _0x376bf3;try{_0x376bf3=_0x370266[_0x3e1cc2(0x210)](_0x325662,{'timeout':_0xd59e['compileTimeoutMs']??0x64});}catch(_0x486d3e){const _0x570fec=new Error(_0x486d3e?.[_0x3e1cc2(0x28d)]||_0x3e1cc2(0x2c9));_0x570fec['code']=_0x3e1cc2(0x22a),_0x570fec['cause']=_0x486d3e;throw _0x570fec;}if(typeof _0x376bf3!==_0x3e1cc2(0x23b)){const _0xa5b789=new Error(_0x3e1cc2(0x2a6));_0xa5b789['code']=_0x3e1cc2(0x1de);throw _0xa5b789;}return _0x376bf3;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x363bae,'compileFunctionExpression':_0xbcd0c1,'_buildRestrictedFetch':_0x589b07},okdbFunctionsSandbox;}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function _0x3fa0(_0x20fcb4,_0x2aef7c){_0x20fcb4=_0x20fcb4-0x1c6;const _0x42d00c=_0x42d0();let _0x3fa026=_0x42d00c[_0x20fcb4];return _0x3fa026;}function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x27bbd9(_0x9ffa34){const _0x38e66c=_0x3fa0;if(!_0x9ffa34)return null;return{'message':_0x9ffa34[_0x38e66c(0x28d)]||String(_0x9ffa34),'stack':_0x9ffa34[_0x38e66c(0x305)]||null,'code':_0x9ffa34[_0x38e66c(0x2f2)]||null,'details':_0x9ffa34[_0x38e66c(0x1e8)]||null};}function _0x5738a1(_0x141aff){const _0x4ada2a=_0x3fa0;if(!_0x141aff)return new Error('Unknown\x20custom\x20function\x20error');const _0x4a427f=new Error(_0x141aff[_0x4ada2a(0x28d)]||String(_0x141aff));if(_0x141aff['stack'])_0x4a427f['stack']=_0x141aff[_0x4ada2a(0x305)];if(_0x141aff[_0x4ada2a(0x2f2)])_0x4a427f[_0x4ada2a(0x2f2)]=_0x141aff[_0x4ada2a(0x2f2)];if(_0x141aff['details'])_0x4a427f['details']=_0x141aff[_0x4ada2a(0x1e8)];return _0x4a427f;}return okdbFunctionsIpc={'serializeError':_0x27bbd9,'deserializeError':_0x5738a1},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x3279b6=_0x1da89e;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x5441aa={'PUT':'put','REMOVE':_0x3279b6(0x293),'INDEX_DROP':'dropIndex','INDEX_REGISTER':_0x3279b6(0x277),'INDEX_RESET':_0x3279b6(0x280),'TYPE_REGISTER':_0x3279b6(0x223),'TYPE_DROP':_0x3279b6(0x27c),'FTS_REGISTER':_0x3279b6(0x2a4),'FTS_DROP':_0x3279b6(0x2b4),'FTS_RESET':'resetFts','SCHEMA_SET':_0x3279b6(0x2f1),'SCHEMA_DROP':_0x3279b6(0x1dd),'TTL_SET':_0x3279b6(0x2f3),'TTL_CLEAR':'clearTtl'},_0x4a75f6={'SYSTEM_READY':_0x3279b6(0x21f),'SYSTEM_STOPPED':_0x3279b6(0x243),'SYSTEM_CLOCK_CHANGE':'system:clock_change','SYSTEM_POKE':_0x3279b6(0x28c),'SYSTEM_DRAIN':_0x3279b6(0x2c6),'SYSTEM_TYPE_DROP':_0x3279b6(0x301),'SYSTEM_PROC':_0x3279b6(0x2bb),'SYSTEM_BUS_STATE_CHANGE':_0x3279b6(0x29f),'ITEM_CREATE':'item:create','ITEM_UPDATE':_0x3279b6(0x24e),'ITEM_REMOVE':_0x3279b6(0x1d9),'INDEX_RESET':_0x3279b6(0x25a),'INDEX_READY':_0x3279b6(0x21e),'INDEX_PROGRESS':'index:progress','VIEW_PROGRESS':_0x3279b6(0x1f3),'INDEX_DROP':_0x3279b6(0x2c5),'INDEX_REGISTERED':_0x3279b6(0x229),'FTS_REGISTERED':_0x3279b6(0x20d),'FTS_DROP':_0x3279b6(0x2b1),'FTS_RESET':_0x3279b6(0x1ec),'SCHEMA_SET':'schema:set','SCHEMA_DROP':_0x3279b6(0x1ce),'UNIQUE_VIOLATION':_0x3279b6(0x238),'UNIQUE_VIOLATION_RESOLVED':_0x3279b6(0x30b),'REF_VIOLATION':_0x3279b6(0x1f5),'REF_VIOLATION_RESOLVED':_0x3279b6(0x202),'SYNC_APPLY':'sync:apply','TXN_START':_0x3279b6(0x29d),'TXN_END':_0x3279b6(0x253),'TXN_ROLLBACK':_0x3279b6(0x2a7),'TYPE_REGISTERED':'type:registered','TYPE_DROP':_0x3279b6(0x2a5),'ENV_OPENED':_0x3279b6(0x2d8),'ENV_REMOVED':'env:removed','TTL_EXPIRED':_0x3279b6(0x270),'TTL_SET':'ttl:set','TTL_CLEAR':_0x3279b6(0x1f1),'LICENSE_INVALID':'license:invalid','LICENSE_ADDED':_0x3279b6(0x26b),'LICENSE_ACTIVATED':_0x3279b6(0x2c1),'LICENSE_REMOVED':'license:removed'},_0x65a6a2={'CREATING':_0x3279b6(0x250),'RESETTING':_0x3279b6(0x21c),'READY':_0x3279b6(0x231),'DROPPING':'dropping','WAITING':_0x3279b6(0x308)},_0x54df45={'CREATED':'created','STARTING':'starting','STARTED':_0x3279b6(0x31c),'STOPPING':_0x3279b6(0x2b5),'STOPPED':'stopped'},_0x2a6c29={'CREATING':_0x3279b6(0x250),'READY':_0x3279b6(0x231),'HALTED':'halted','STOPPED':_0x3279b6(0x31a),'RESETTING':_0x3279b6(0x21c)},_0xf87ea3=Object['freeze']({'POKE':_0x3279b6(0x22d),'DRAIN':_0x3279b6(0x2c2),'TYPE_DROP':_0x3279b6(0x22c),'PROC':_0x3279b6(0x318)});return okdbEnums={'BUS_EVENTS':_0xf87ea3,'CHANGE_ACTIONS':_0x5441aa,'EVENTS':_0x4a75f6,'INDEX_STATE':_0x65a6a2,'OKDB_STATE':_0x54df45,'VIEW_STATE':_0x2a6c29},okdbEnums;}var okdbError,hasRequiredOkdbError;function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x1ebfbc extends Error{constructor(_0x4d0947,_0x4a5876,_0x5738d3={}){const _0x532ccf=_0x3fa0;super(_0x4d0947),this[_0x532ccf(0x2df)]=_0x532ccf(0x213),this[_0x532ccf(0x2f2)]=_0x4a5876,this[_0x532ccf(0x1e8)]=_0x5738d3,_0x5738d3[_0x532ccf(0x220)]&&(this[_0x532ccf(0x220)]=_0x5738d3[_0x532ccf(0x220)]),Error[_0x532ccf(0x2a3)](this,this[_0x532ccf(0x215)]);}}class _0x46382d extends _0x1ebfbc{constructor(_0x1eaa99,_0x37f8e6,_0xfe5753,_0x318796){const _0x23ef99=_0x3fa0;super(_0x23ef99(0x25e)+_0x1eaa99+'@'+_0x37f8e6+_0x23ef99(0x276)+_0xfe5753+_0x23ef99(0x27f)+_0x318796,_0x23ef99(0x2ad),{'type':_0x1eaa99,'key':_0x37f8e6,'expectedVersion':_0xfe5753,'actualVersion':_0x318796}),this['name']=_0x23ef99(0x227);}}class _0x406b14 extends _0x1ebfbc{constructor(_0x3d4ce0,_0x5ecc27){const _0x4b670e=_0x3fa0;super(_0x3d4ce0+'@'+_0x5ecc27+_0x4b670e(0x232),_0x4b670e(0x1e3),{'type':_0x3d4ce0,'key':_0x5ecc27}),this['name']=_0x4b670e(0x302);}}class _0x31407d extends _0x1ebfbc{constructor(_0x34dce5,_0x32262f){const _0x451caf=_0x3fa0;super(_0x34dce5+'@'+_0x32262f+_0x451caf(0x2f6),_0x451caf(0x2d6),{'type':_0x34dce5,'key':_0x32262f}),this[_0x451caf(0x2df)]='OKDBAlreadyExistsError';}}class _0x900e3 extends _0x1ebfbc{constructor(_0x521155,_0x319058){const _0x276e6a=_0x3fa0,_0x1ea993=typeof _0x319058;super(_0x276e6a(0x2e2)+_0x521155+_0x276e6a(0x30f)+_0x1ea993+_0x276e6a(0x252)+_0x319058,'INVALID_INDEX_KEY',{'index':_0x521155,'key':_0x319058,'keyType':_0x1ea993}),this['name']=_0x276e6a(0x30c);}}class _0x2bb951 extends _0x1ebfbc{constructor(_0x21518f){const _0x22aa2e=_0x3fa0,_0x5d9581=typeof _0x21518f;super('Invalid\x20primary\x20key\x20type:\x20'+_0x5d9581+'.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20'+_0x21518f,_0x22aa2e(0x306),{'key':_0x21518f,'keyType':_0x5d9581}),this[_0x22aa2e(0x2df)]=_0x22aa2e(0x282);}}class _0x105782 extends _0x1ebfbc{constructor(_0x58d3bf){const _0x267e49=_0x3fa0;super(_0x267e49(0x21a)+_0x58d3bf+_0x267e49(0x247),_0x267e49(0x201),{'type':_0x58d3bf}),this[_0x267e49(0x2df)]=_0x267e49(0x1fe);}}class _0x1514cb extends _0x1ebfbc{constructor(_0x3b154a){const _0x3cf534=_0x3fa0;super('Type\x20\x27'+_0x3b154a+_0x3cf534(0x2b2),'TYPE_ALREADY_REGISTERED',{'type':_0x3b154a}),this[_0x3cf534(0x2df)]='OKDBTypeAlreadyRegisteredError';}}class _0x2bbc84 extends _0x1ebfbc{constructor(_0x52a1f8,_0x3ea1d3){const _0x246b8e=_0x3fa0;super(_0x246b8e(0x244)+_0x3ea1d3+'\x27\x20on\x20type\x20\x27'+_0x52a1f8+_0x246b8e(0x247),_0x246b8e(0x24b),{'type':_0x52a1f8,'index':_0x3ea1d3}),this[_0x246b8e(0x2df)]=_0x246b8e(0x2ed);}}class _0x3904b5 extends _0x1ebfbc{constructor(_0x33caf3,_0x7d3fdd){const _0x1bbefc=_0x3fa0;super('Index\x20\x27'+_0x7d3fdd+'\x27\x20on\x20type\x20\x27'+_0x33caf3+_0x1bbefc(0x1d3),_0x1bbefc(0x1cd),{'type':_0x33caf3,'index':_0x7d3fdd}),this[_0x1bbefc(0x2df)]=_0x1bbefc(0x24c);}}class _0x27e925 extends _0x1ebfbc{constructor(_0x372fed,_0x27b588={}){const _0x47be81=_0x3fa0;super(_0x372fed,_0x47be81(0x258),_0x27b588),this['name']=_0x47be81(0x1c7);}}class _0x4b2acc extends _0x1ebfbc{constructor(_0x5c5727,_0x28943e,_0x3af958,_0x269460,_0xc5c193){const _0x43531b=_0x3fa0;super('Unique\x20constraint\x20violated\x20on\x20'+_0x5c5727+'@'+_0x28943e+_0x43531b(0x2da)+_0x3af958+']\x20already\x20maps\x20to\x20\x27'+_0x269460+_0x43531b(0x2c8)+_0xc5c193+'\x27',_0x43531b(0x27e),{'type':_0x5c5727,'index':_0x28943e,'indexKey':_0x3af958,'existingKey':_0x269460,'conflictingKey':_0xc5c193}),this['name']=_0x43531b(0x281);}}class _0x3a7ab8 extends _0x1ebfbc{constructor(_0xc91f8,_0x43b2a0,_0x1e1e53){const _0x33970a=_0x3fa0;super(_0x33970a(0x2b0)+_0xc91f8+'@'+_0x43b2a0,'SCHEMA_VALIDATION_FAILED',{'type':_0xc91f8,'key':_0x43b2a0,'errors':_0x1e1e53}),this[_0x33970a(0x2df)]=_0x33970a(0x2b8),this[_0x33970a(0x2dc)]=_0xc91f8,this[_0x33970a(0x28e)]=_0x43b2a0,this[_0x33970a(0x2f9)]=_0x1e1e53;}}class _0x3ff7ee extends _0x1ebfbc{constructor(_0x411908,_0x1f07ed){const _0x4a8dfb=_0x3fa0;super(_0x4a8dfb(0x290)+_0x411908+':\x20'+_0x1f07ed[_0x4a8dfb(0x1c8)]+_0x4a8dfb(0x1f4),_0x4a8dfb(0x26c),{'type':_0x411908,'failures':_0x1f07ed}),this[_0x4a8dfb(0x2df)]='OKDBSchemaCollectionError',this[_0x4a8dfb(0x2dc)]=_0x411908,this[_0x4a8dfb(0x23a)]=_0x1f07ed;}}class _0x1d1806 extends _0x1ebfbc{constructor(_0x3d70ee,_0x7e3e4f,_0x3bae58,_0x49b21a,_0x2e57bc){const _0x10a314=_0x3fa0;super(_0x10a314(0x2d7)+_0x3d70ee+'@'+_0x7e3e4f+'.'+_0x3bae58+_0x10a314(0x2ba)+_0x49b21a+'@'+_0x2e57bc+_0x10a314(0x2c4),_0x10a314(0x29a),{'sourceType':_0x3d70ee,'sourceKey':_0x7e3e4f,'fieldPath':_0x3bae58,'targetType':_0x49b21a,'targetKey':_0x2e57bc}),this['name']=_0x10a314(0x26d),this[_0x10a314(0x203)]=_0x3d70ee,this[_0x10a314(0x245)]=_0x7e3e4f,this[_0x10a314(0x2e0)]=_0x3bae58,this[_0x10a314(0x205)]=_0x49b21a,this[_0x10a314(0x1db)]=_0x2e57bc;}}class _0x5cdebd extends _0x1ebfbc{constructor(_0x322a3d,_0x553b92,_0x79447c){const _0x1be65f=_0x3fa0;super(_0x1be65f(0x1c6)+_0x322a3d+'@'+_0x553b92+':\x20'+_0x79447c[_0x1be65f(0x1c8)]+_0x1be65f(0x1e5),'FOREIGN_KEY_DELETE_RESTRICTED',{'targetType':_0x322a3d,'targetKey':_0x553b92,'references':_0x79447c}),this[_0x1be65f(0x2df)]=_0x1be65f(0x267),this[_0x1be65f(0x205)]=_0x322a3d,this[_0x1be65f(0x1db)]=_0x553b92,this[_0x1be65f(0x2e1)]=_0x79447c;}}class _0xb5bbff extends _0x1ebfbc{constructor(_0x316bb2,_0x2ddd28,_0x1b1d21){const _0x631096=_0x3fa0;super(_0x631096(0x236)+_0x2ddd28+_0x631096(0x2ec)+_0x316bb2+'\x22\x20is\x20used\x20by:\x20'+_0x1b1d21['map'](_0x2df38d=>_0x2df38d[_0x631096(0x241)]+':'+_0x2df38d[_0x631096(0x2df)])['join'](',\x20'),_0x631096(0x1e1),{'type':_0x316bb2,'index':_0x2ddd28,'usedBy':_0x1b1d21}),this[_0x631096(0x2df)]=_0x631096(0x240);}}return okdbError={'OKDBError':_0x1ebfbc,'OKDBVersionMismatchError':_0x46382d,'OKDBNotFoundError':_0x406b14,'OKDBAlreadyExistsError':_0x31407d,'OKDBInvalidIndexKeyError':_0x900e3,'OKDBInvalidPrimaryKeyError':_0x2bb951,'OKDBTypeNotRegisteredError':_0x105782,'OKDBTypeAlreadyRegisteredError':_0x1514cb,'OKDBIndexNotRegisteredError':_0x2bbc84,'OKDBIndexAlreadyRegisteredError':_0x3904b5,'OKDBInvalidValueError':_0x27e925,'OKDBUniqueConstraintError':_0x4b2acc,'OKDBSchemaValidationError':_0x3a7ab8,'OKDBSchemaCollectionError':_0x3ff7ee,'OKDBForeignKeyError':_0x1d1806,'OKDBForeignKeyDeleteError':_0x5cdebd,'OKDBIndexHasConsumersError':_0xb5bbff},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x2d3970=_0x1da89e;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x4c7c63,performance:_0x2fe85e}=require$$0$1,_0x4bc4f7=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG==='true',_0x3ee5ab=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x452e0b=process.env.OKDB_LOOP_LAG_ALL==='1',_0x34db66=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x495a22{constructor(){const _0x4dd08e=_0x3fa0;this[_0x4dd08e(0x1fa)]=_0x4bc4f7,this[_0x4dd08e(0x2e7)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x4dd08e(0x309)]=![],this[_0x4dd08e(0x2c0)]=(_0x4f8dbf,_0x6d8379)=>process['stderr']['write'](_0x4f8dbf+(_0x6d8379?'\x20'+JSON[_0x4dd08e(0x206)](_0x6d8379):'')+'\x0a');}[_0x2d3970(0x26a)](){const _0x143c60=_0x2d3970;return _0x2fe85e[_0x143c60(0x26a)]();}[_0x2d3970(0x279)](_0x22f471){if(typeof _0x22f471==='function')this['_log']=_0x22f471;}[_0x2d3970(0x2f0)](_0x26f289,_0x2c8539,_0x22fbf9){const _0x1f8df7=_0x2d3970;if(!this[_0x1f8df7(0x1fa)])return;let _0x4ef763=this['_buckets'][_0x1f8df7(0x1ed)](_0x26f289);!_0x4ef763&&(_0x4ef763={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x1f8df7(0x2e7)]['set'](_0x26f289,_0x4ef763)),_0x4ef763['ms']+=_0x2c8539,_0x4ef763[_0x1f8df7(0x219)]+=0x1,_0x2c8539>_0x4ef763[_0x1f8df7(0x296)]&&(_0x4ef763[_0x1f8df7(0x296)]=_0x2c8539,_0x4ef763[_0x1f8df7(0x2d3)]=_0x22fbf9||'');}[_0x2d3970(0x2a1)](_0x1c161a){const _0x240987=_0x2d3970;if(!this[_0x240987(0x1fa)]||this[_0x240987(0x309)])return;this[_0x240987(0x309)]=!![];if(_0x1c161a)this[_0x240987(0x2c0)]=_0x1c161a;this['_h']=_0x4c7c63({'resolution':0xa}),this['_h'][_0x240987(0x2fd)](),this[_0x240987(0x272)]=setInterval(()=>this[_0x240987(0x266)](),_0x3ee5ab);if(this[_0x240987(0x272)][_0x240987(0x2e4)])this[_0x240987(0x272)][_0x240987(0x2e4)]();}[_0x2d3970(0x1f0)](_0x299c30){const _0x40766c=_0x2d3970;if(!this[_0x40766c(0x1e7)])this[_0x40766c(0x1e7)]=new Set();this[_0x40766c(0x1e7)][_0x40766c(0x1c9)](_0x299c30);if(!this['_started'])this['_startAdmission']();}[_0x2d3970(0x2ce)](_0x34e604){const _0x3a4292=_0x2d3970;this[_0x3a4292(0x1e7)]?.[_0x3a4292(0x22f)](_0x34e604);}['_startAdmission'](){const _0x324087=_0x2d3970;if(this[_0x324087(0x2cc)])return;this[_0x324087(0x2cc)]=!![];!this['_h']&&(this['_h']=_0x4c7c63({'resolution':0xa}),this['_h'][_0x324087(0x2fd)]());const _0x2f2ce0=_0x3ee5ab;this['_admissionTimer']=setInterval(()=>{const _0x3b125a=_0x324087,_0x50060b=this['_h'];if(!_0x50060b)return;const _0x2d9be2=_0x50060b[_0x3b125a(0x2af)](0x63)/0xf4240,_0x2a957f=_0x50060b['max']/0xf4240,_0x423a1a=_0x50060b[_0x3b125a(0x2ca)]/0xf4240;_0x50060b[_0x3b125a(0x24f)]();if(this[_0x3b125a(0x1e7)])for(const _0x2cc46b of this['_windowCbs']){try{_0x2cc46b({'p99Ms':_0x2d9be2,'maxMs':_0x2a957f,'meanMs':_0x423a1a,'reportMs':_0x2f2ce0});}catch{}}},_0x2f2ce0);if(this[_0x324087(0x221)]['unref'])this[_0x324087(0x221)]['unref']();}[_0x2d3970(0x266)](){const _0x1362d0=_0x2d3970,_0x239ea3=this['_h'],_0x3042f2=_0x239ea3[_0x1362d0(0x1d5)]/0xf4240,_0x5f43da=_0x239ea3[_0x1362d0(0x2af)](0x63)/0xf4240,_0x3da5bf=_0x239ea3[_0x1362d0(0x2ca)]/0xf4240;_0x239ea3[_0x1362d0(0x24f)]();const _0x1c444b=[...this[_0x1362d0(0x2e7)][_0x1362d0(0x2fe)]()][_0x1362d0(0x2eb)](([_0x4fe394,_0x2f82aa])=>({'label':_0x4fe394,..._0x2f82aa}))[_0x1362d0(0x249)]((_0x586f49,_0x22256f)=>_0x22256f['ms']-_0x586f49['ms'])['slice'](0x0,0x8);this[_0x1362d0(0x2e7)][_0x1362d0(0x2be)]();const _0x19243c=_0x1c444b[_0x1362d0(0x200)]((_0x454011,_0x1972cf)=>_0x454011+_0x1972cf['ms'],0x0),_0x43fa10=_0x1c444b[_0x1362d0(0x2eb)](_0x2c2974=>_0x2c2974[_0x1362d0(0x2e6)]+'='+_0x2c2974['ms']['toFixed'](0x0)+'ms/'+_0x2c2974[_0x1362d0(0x219)]+(_0x2c2974[_0x1362d0(0x296)]>0x5?'(worst\x20'+_0x2c2974['maxMs'][_0x1362d0(0x313)](0x0)+'ms'+(_0x2c2974[_0x1362d0(0x2d3)]?'\x20'+_0x2c2974['maxExtra']:'')+')':''));(_0x452e0b||_0x3042f2>=_0x34db66)&&this['_log'](_0x1362d0(0x222)+_0x3ee5ab+'ms\x20max='+_0x3042f2[_0x1362d0(0x313)](0x0)+_0x1362d0(0x214)+_0x5f43da[_0x1362d0(0x313)](0x0)+_0x1362d0(0x20e)+_0x3da5bf['toFixed'](0x0)+_0x1362d0(0x291)+_0x19243c['toFixed'](0x0)+'ms'+(_0x43fa10[_0x1362d0(0x1c8)]?_0x1362d0(0x207)+_0x43fa10['join']('\x20\x20'):''),{'feature':'loop-lag'});if(this[_0x1362d0(0x1e7)])for(const _0x50921c of this['_windowCbs']){try{_0x50921c({'p99Ms':_0x5f43da,'maxMs':_0x3042f2,'meanMs':_0x3da5bf,'reportMs':_0x3ee5ab});}catch{}}}['stop'](){const _0x843e=_0x2d3970;if(this[_0x843e(0x272)])clearInterval(this[_0x843e(0x272)]);if(this['_h'])this['_h']['disable']();this[_0x843e(0x272)]=null,this['_h']=null,this[_0x843e(0x309)]=![];}}const _0x33dcca=new _0x495a22();if(_0x33dcca[_0x2d3970(0x1fa)])_0x33dcca['start']();return okdbLoopMonitor={'LOOP':_0x33dcca},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x38be38=_0x1da89e;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0x2248f7=require$$0$2,{EVENTS:_0x398079}=requireOkdbEnums(),{OKDBError:_0x3aa78a}=requireOkdbError(),{LOOP:_0x1702a0}=requireOkdbLoopMonitor();class _0x5c21b0{[_0x38be38(0x1f6)];[_0x38be38(0x2d9)]=[];[_0x38be38(0x1e0)]=[];['_undoHooks']=[];constructor(_0x539989,_0x5f0c25={'useReadTransaction':![]}){const _0x4da76b=_0x38be38;this[_0x4da76b(0x1f6)]=_0x539989,this[_0x4da76b(0x314)]=_0x5f0c25,this['id']=_0x2248f7['v4'](),this[_0x4da76b(0x2e9)]=this[_0x4da76b(0x314)][_0x4da76b(0x2fc)]?this['okdb']['db']['useReadTransaction']():null,this['_closed']=![];}[_0x38be38(0x295)](_0xf44cb5){const _0x3327a2=_0x38be38;this[_0x3327a2(0x1e0)]['push'](_0xf44cb5);}['onUndo'](_0x2fd787){const _0x109085=_0x38be38;this[_0x109085(0x237)][_0x109085(0x22e)](_0x2fd787);}[_0x38be38(0x2d1)](){const _0x461714=_0x38be38;if(!this[_0x461714(0x2e9)])return;try{this[_0x461714(0x2e9)][_0x461714(0x310)]();}catch(_0xcffd53){}this[_0x461714(0x2e9)]=null;}[_0x38be38(0x2a2)](){const _0x43dcf9=_0x38be38;if(this['_closed'])throw new _0x3aa78a(_0x43dcf9(0x20b),'TXN_CLOSED');}['get'](_0x5bae13,_0x3ead45){const _0x2325b7=_0x38be38;return this['_assertOpen'](),this[_0x2325b7(0x1f6)][_0x2325b7(0x1ed)](_0x5bae13,_0x3ead45,{'transaction':this[_0x2325b7(0x2e9)]});}[_0x38be38(0x29e)](_0x241368,_0x52c990){const _0x2eb585=_0x38be38;return this[_0x2eb585(0x2a2)](),this[_0x2eb585(0x1f6)][_0x2eb585(0x29e)](_0x241368,_0x52c990,{'transaction':this['readTransaction']});}[_0x38be38(0x208)](_0x225d58,_0x59cfc2){const _0x33d02d=_0x38be38;return this[_0x33d02d(0x2a2)](),this[_0x33d02d(0x1f6)][_0x33d02d(0x208)](_0x225d58,_0x59cfc2,{'transaction':this[_0x33d02d(0x2e9)]});}[_0x38be38(0x2d2)](_0x1d1f8d,_0x5af7c4={}){const _0xba81b=_0x38be38;return this[_0xba81b(0x2a2)](),this[_0xba81b(0x1f6)][_0xba81b(0x2d2)](_0x1d1f8d,{'transaction':this[_0xba81b(0x2e9)],..._0x5af7c4});}[_0x38be38(0x294)](_0x1e4e0b,_0x4b5e78={}){const _0x25caa3=_0x38be38;return this[_0x25caa3(0x2a2)](),this[_0x25caa3(0x1f6)][_0x25caa3(0x294)](_0x1e4e0b,{'transaction':this[_0x25caa3(0x2e9)],..._0x4b5e78});}['getKeys'](_0x4212f3,_0x1ddb38={}){const _0x4b06a5=_0x38be38;return this[_0x4b06a5(0x2a2)](),this[_0x4b06a5(0x1f6)][_0x4b06a5(0x321)](_0x4212f3,{'transaction':this['readTransaction'],..._0x1ddb38});}['byIndex'](_0x4d6f5a,_0x309589,_0x38a5bb={}){const _0x46fe1d=_0x38be38;return this[_0x46fe1d(0x2a2)](),this['okdb']['byIndex'](_0x4d6f5a,_0x309589,{'transaction':this[_0x46fe1d(0x2e9)],..._0x38a5bb});}[_0x38be38(0x2ae)](_0x46591f,_0x508167,_0x4329a0={}){const _0x4e3a9a=_0x38be38;return this['_assertOpen'](),this['okdb'][_0x4e3a9a(0x2ae)](_0x46591f,_0x508167,{'transaction':this[_0x4e3a9a(0x2e9)],..._0x4329a0});}[_0x38be38(0x2fa)](_0xb12b21=null){const _0x4e1bce=_0x38be38;return this[_0x4e1bce(0x2a2)](),this['okdb'][_0x4e1bce(0x2fa)](_0xb12b21,{'transaction':this['readTransaction']});}[_0x38be38(0x1ee)](_0x1c3b97){const _0x37fc58=_0x38be38;return this[_0x37fc58(0x2a2)](),this[_0x37fc58(0x1f6)]['getCount'](_0x1c3b97,{'transaction':this[_0x37fc58(0x2e9)]});}[_0x38be38(0x20a)](_0x3c0110,_0x4d9104,_0x566041,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x571054=_0x38be38;this[_0x571054(0x2d9)][_0x571054(0x22e)]({'action':_0x571054(0x20a),'args':[_0x3c0110,_0x4d9104,_0x566041,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x38be38(0x273)](_0xb02bcd,_0x36ca92,_0xc5765b,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x59736d=_0x38be38;this[_0x59736d(0x2d9)][_0x59736d(0x22e)]({'action':_0x59736d(0x273),'args':[_0xb02bcd,_0x36ca92,_0xc5765b,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x38be38(0x26f)](_0xaaa77e,_0x628833,_0x303439,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x38be38(0x26a)](),origin:origin=null,ttl:ttl=null}={}){const _0x57796c=_0x38be38;this[_0x57796c(0x2d9)]['push']({'action':_0x57796c(0x26f),'args':[_0xaaa77e,_0x628833,_0x303439,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x38be38(0x274)](_0x1274a5,_0x2dd791,_0x241442,{version:version=null,timestamp:timestamp=Date[_0x38be38(0x26a)](),origin:origin=null,ttl:ttl=null}={}){const _0x444dcd=_0x38be38;this['actions']['push']({'action':_0x444dcd(0x274),'args':[_0x1274a5,_0x2dd791,_0x241442,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x38be38(0x293)](_0x4b1e47,_0x1015c0,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x38be38(0x26a)](),origin:origin=null}={}){const _0x24a4c4=_0x38be38;this[_0x24a4c4(0x2d9)][_0x24a4c4(0x22e)]({'action':_0x24a4c4(0x293),'args':[_0x4b1e47,_0x1015c0,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}[_0x38be38(0x2f5)](_0x4f49de,_0x5058df,_0x253239){const _0x46ab36=_0x38be38;this[_0x46ab36(0x2d9)][_0x46ab36(0x22e)]({'action':'setTTL','args':[_0x4f49de,_0x5058df,_0x253239]});}[_0x38be38(0x1da)](_0x37f0cf,_0x490a4e){const _0x587803=_0x38be38;this[_0x587803(0x2d9)][_0x587803(0x22e)]({'action':_0x587803(0x1da),'args':[_0x37f0cf,_0x490a4e]});}[_0x38be38(0x235)](){const _0x1f98eb=_0x38be38;if(this['_closed'])return;for(const _0x41a44f of this['_undoHooks']){try{_0x41a44f();}catch{}}this[_0x1f98eb(0x1f6)][_0x1f98eb(0x1ff)][_0x1f98eb(0x1e9)](_0x398079['TXN_ROLLBACK'],{'id':this['id']}),this['actions']=[],this[_0x1f98eb(0x2d1)](),this[_0x1f98eb(0x2e8)]=!![];}async[_0x38be38(0x283)](){const _0x135b59=_0x38be38;if(this[_0x135b59(0x2e8)])throw new Error(_0x135b59(0x20b));const _0x99029={'id':this['id'],'timestamp':Date['now'](),'actions':this[_0x135b59(0x2d9)]};this[_0x135b59(0x1f6)][_0x135b59(0x1ff)][_0x135b59(0x1e9)](_0x398079[_0x135b59(0x224)],_0x99029);try{const _0x174025=_0x1702a0[_0x135b59(0x1fa)]?_0x1702a0[_0x135b59(0x26a)]():0x0;this[_0x135b59(0x1f6)]['db'][_0x135b59(0x25d)](()=>{const _0x39e5df=_0x135b59;for(const _0x1c0bf3 of this[_0x39e5df(0x2d9)]){const _0x4ae21c=this[_0x39e5df(0x1f6)]['_'+_0x1c0bf3[_0x39e5df(0x209)]];if(typeof _0x4ae21c!==_0x39e5df(0x23b))throw new Error(_0x39e5df(0x316)+_0x1c0bf3[_0x39e5df(0x209)]);_0x4ae21c[_0x39e5df(0x2ab)](this[_0x39e5df(0x1f6)],this,..._0x1c0bf3[_0x39e5df(0x2c7)]);}}),_0x1702a0[_0x135b59(0x1fa)]&&_0x1702a0[_0x135b59(0x2f0)](_0x135b59(0x2e3),_0x1702a0[_0x135b59(0x26a)]()-_0x174025,(this[_0x135b59(0x1f6)][_0x135b59(0x2df)]??'?')+_0x135b59(0x2cd)+this[_0x135b59(0x2d9)][_0x135b59(0x1c8)]);}catch(_0x28f6a0){for(const _0x51869c of this['_undoHooks']){try{_0x51869c();}catch{}}this[_0x135b59(0x2d1)](),this[_0x135b59(0x2e8)]=!![];if(_0x28f6a0 instanceof _0x3aa78a)throw _0x28f6a0;throw new _0x3aa78a(_0x28f6a0?.[_0x135b59(0x28d)]||_0x135b59(0x1fc),_0x135b59(0x278),{'cause':_0x28f6a0});}this[_0x135b59(0x1f6)][_0x135b59(0x1ff)][_0x135b59(0x1e9)](_0x398079[_0x135b59(0x2a0)],_0x99029);for(const _0x25b922 of this[_0x135b59(0x1e0)]){try{_0x25b922();}catch{}}this['actions']=[],this['_closeReadTransaction'](),this[_0x135b59(0x2e8)]=!![];}static['createWriteFacade'](_0x587862){const _0x487fab=_0x38be38;return Object[_0x487fab(0x30d)]({'id':_0x587862['id'],'put':_0x587862[_0x487fab(0x20a)]['bind'](_0x587862),'update':_0x587862[_0x487fab(0x273)][_0x487fab(0x234)](_0x587862),'patch':_0x587862[_0x487fab(0x26f)][_0x487fab(0x234)](_0x587862),'create':_0x587862[_0x487fab(0x274)][_0x487fab(0x234)](_0x587862),'remove':_0x587862[_0x487fab(0x293)][_0x487fab(0x234)](_0x587862),'setTTL':_0x587862['setTTL'][_0x487fab(0x234)](_0x587862),'clearTTL':_0x587862[_0x487fab(0x1da)][_0x487fab(0x234)](_0x587862),'commit':_0x587862['commit']['bind'](_0x587862),'rollback':_0x587862['rollback'][_0x487fab(0x234)](_0x587862),'get':_0x587862[_0x487fab(0x1ed)][_0x487fab(0x234)](_0x587862),'getEntry':_0x587862[_0x487fab(0x29e)]['bind'](_0x587862),'getMany':_0x587862[_0x487fab(0x208)][_0x487fab(0x234)](_0x587862),'getRange':_0x587862[_0x487fab(0x2d2)][_0x487fab(0x234)](_0x587862),'getValues':_0x587862[_0x487fab(0x294)][_0x487fab(0x234)](_0x587862),'getKeys':_0x587862[_0x487fab(0x321)][_0x487fab(0x234)](_0x587862),'byIndex':_0x587862[_0x487fab(0x319)][_0x487fab(0x234)](_0x587862),'query':_0x587862[_0x487fab(0x2ae)][_0x487fab(0x234)](_0x587862),'getClock':_0x587862[_0x487fab(0x2fa)][_0x487fab(0x234)](_0x587862),'getCount':_0x587862['getCount'][_0x487fab(0x234)](_0x587862),'read':_0x587862,'raw':_0x587862});}static['applyOps'](_0x88d5bb,_0x397a35=[]){const _0x1c8088=_0x38be38;if(!Array[_0x1c8088(0x261)](_0x397a35))throw new _0x3aa78a('txn\x20ops\x20must\x20be\x20an\x20array',_0x1c8088(0x1ef));for(const _0x4d6e20 of _0x397a35){if(Array['isArray'](_0x4d6e20)){const [_0x53f30e,..._0x42400c]=_0x4d6e20;if(typeof _0x88d5bb[_0x53f30e]!==_0x1c8088(0x23b))throw new _0x3aa78a('Unknown\x20transaction\x20action:\x20'+_0x53f30e,_0x1c8088(0x2b9),{'action':_0x53f30e});_0x88d5bb[_0x53f30e](..._0x42400c);continue;}if(!_0x4d6e20||typeof _0x4d6e20!=='object')throw new _0x3aa78a('txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple',_0x1c8088(0x212));const {action:_0x1ea471}=_0x4d6e20;if(typeof _0x1ea471!=='string'||typeof _0x88d5bb[_0x1ea471]!==_0x1c8088(0x23b))throw new _0x3aa78a(_0x1c8088(0x316)+_0x1ea471,_0x1c8088(0x2b9),{'action':_0x1ea471});switch(_0x1ea471){case _0x1c8088(0x20a):case _0x1c8088(0x273):case _0x1c8088(0x274):_0x88d5bb[_0x1ea471](_0x4d6e20[_0x1c8088(0x2dc)],_0x4d6e20[_0x1c8088(0x28e)],_0x4d6e20[_0x1c8088(0x2ff)],{..._0x4d6e20['options'],'ttl':_0x4d6e20[_0x1c8088(0x29b)]??_0x4d6e20['options']?.[_0x1c8088(0x29b)]??null});break;case _0x1c8088(0x26f):_0x88d5bb['patch'](_0x4d6e20[_0x1c8088(0x2dc)],_0x4d6e20[_0x1c8088(0x28e)],_0x4d6e20['patch'],{..._0x4d6e20[_0x1c8088(0x314)],'ttl':_0x4d6e20[_0x1c8088(0x29b)]??_0x4d6e20['options']?.['ttl']??null});break;case _0x1c8088(0x293):_0x88d5bb[_0x1c8088(0x293)](_0x4d6e20[_0x1c8088(0x2dc)],_0x4d6e20['key'],_0x4d6e20['options']||{});break;case _0x1c8088(0x2f5):_0x88d5bb[_0x1c8088(0x2f5)](_0x4d6e20['type'],_0x4d6e20[_0x1c8088(0x28e)],_0x4d6e20[_0x1c8088(0x29b)]);break;case'clearTTL':_0x88d5bb['clearTTL'](_0x4d6e20[_0x1c8088(0x2dc)],_0x4d6e20[_0x1c8088(0x28e)]);break;default:throw new _0x3aa78a('Unsupported\x20transaction\x20action:\x20'+_0x1ea471,_0x1c8088(0x2b9),{'action':_0x1ea471});}}}static async[_0x38be38(0x225)](_0x4d0ff7,_0x36621c,_0x43d698={}){const _0x34e76e=_0x38be38,_0x319265=new _0x5c21b0(_0x4d0ff7,_0x43d698),_0x5f4bb9=_0x5c21b0[_0x34e76e(0x2b6)](_0x319265);try{typeof _0x36621c===_0x34e76e(0x23b)?await _0x36621c(_0x5f4bb9):_0x5c21b0[_0x34e76e(0x226)](_0x319265,_0x36621c||[]);const _0xa89b97=_0x319265['actions'][_0x34e76e(0x1c8)];return await _0x319265[_0x34e76e(0x283)](),{'id':_0x319265['id'],'actions':_0xa89b97};}catch(_0x4825b9){try{_0x319265[_0x34e76e(0x235)]();}catch(_0x5d820d){}throw _0x4825b9;}}}return okdbTransaction=_0x5c21b0,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x537050=requireOkdbTransaction();function _0x4c98ad(_0x338184){const _0x224cdd=_0x3fa0;return{'transaction':typeof _0x338184['transaction']===_0x224cdd(0x23b)?_0x338184[_0x224cdd(0x20f)][_0x224cdd(0x234)](_0x338184):_0x323f0d=>new _0x537050(_0x338184,_0x323f0d),'txn':typeof _0x338184['txn']===_0x224cdd(0x23b)?_0x338184['txn'][_0x224cdd(0x234)](_0x338184):(_0x42e68b,_0x213a63)=>_0x537050[_0x224cdd(0x225)](_0x338184,_0x42e68b,_0x213a63)};}function _0x2ae85a(_0x5d3964){const _0xdd86cf=_0x3fa0;return{'name':_0x5d3964[_0xdd86cf(0x2df)],..._0x4c98ad(_0x5d3964),'put':_0x5d3964['put'][_0xdd86cf(0x234)](_0x5d3964),'update':_0x5d3964['update'][_0xdd86cf(0x234)](_0x5d3964),'patch':_0x5d3964[_0xdd86cf(0x26f)]['bind'](_0x5d3964),'create':_0x5d3964[_0xdd86cf(0x274)][_0xdd86cf(0x234)](_0x5d3964),'remove':_0x5d3964[_0xdd86cf(0x293)][_0xdd86cf(0x234)](_0x5d3964),'get':_0x5d3964['get'][_0xdd86cf(0x234)](_0x5d3964),'getMany':_0x5d3964[_0xdd86cf(0x208)][_0xdd86cf(0x234)](_0x5d3964),'getEntry':_0x5d3964[_0xdd86cf(0x29e)][_0xdd86cf(0x234)](_0x5d3964),'getRange':_0x5d3964[_0xdd86cf(0x2d2)][_0xdd86cf(0x234)](_0x5d3964),'getValues':_0x5d3964[_0xdd86cf(0x294)][_0xdd86cf(0x234)](_0x5d3964),'getKeys':_0x5d3964[_0xdd86cf(0x321)][_0xdd86cf(0x234)](_0x5d3964),'getCount':_0x5d3964['getCount'][_0xdd86cf(0x234)](_0x5d3964),'getByPrefix':_0x5d3964[_0xdd86cf(0x2ea)][_0xdd86cf(0x234)](_0x5d3964),'getIndex':_0x5d3964['getIndex'][_0xdd86cf(0x234)](_0x5d3964),'byIndex':_0x5d3964[_0xdd86cf(0x319)][_0xdd86cf(0x234)](_0x5d3964),'query':_0x5d3964['query'][_0xdd86cf(0x234)](_0x5d3964),'geoQuery':_0x5d3964[_0xdd86cf(0x315)][_0xdd86cf(0x234)](_0x5d3964),'ftsQuery':_0x5d3964[_0xdd86cf(0x20c)][_0xdd86cf(0x234)](_0x5d3964),'setTTL':_0x5d3964[_0xdd86cf(0x2f5)][_0xdd86cf(0x234)](_0x5d3964),'getTTL':_0x5d3964[_0xdd86cf(0x28a)][_0xdd86cf(0x234)](_0x5d3964),'clearTTL':_0x5d3964[_0xdd86cf(0x1da)][_0xdd86cf(0x234)](_0x5d3964),'sweepExpiredTTL':_0x5d3964[_0xdd86cf(0x25b)][_0xdd86cf(0x234)](_0x5d3964),'listTTL':_0x5d3964[_0xdd86cf(0x275)][_0xdd86cf(0x234)](_0x5d3964),'ttlStats':_0x5d3964['ttlStats']['bind'](_0x5d3964),'setDefaultTTL':_0x5d3964[_0xdd86cf(0x2bd)][_0xdd86cf(0x234)](_0x5d3964),'getDefaultTTL':_0x5d3964[_0xdd86cf(0x1fb)][_0xdd86cf(0x234)](_0x5d3964),'clearDefaultTTL':_0x5d3964[_0xdd86cf(0x217)][_0xdd86cf(0x234)](_0x5d3964),'registerType':_0x5d3964['registerType'][_0xdd86cf(0x234)](_0x5d3964),'ensureType':_0x5d3964[_0xdd86cf(0x259)][_0xdd86cf(0x234)](_0x5d3964),'hasType':_0x5d3964[_0xdd86cf(0x1d4)][_0xdd86cf(0x234)](_0x5d3964),'dropType':_0x5d3964[_0xdd86cf(0x27c)]['bind'](_0x5d3964),'registerIndex':_0x5d3964['registerIndex'][_0xdd86cf(0x234)](_0x5d3964),'hasIndex':_0x5d3964[_0xdd86cf(0x1dc)][_0xdd86cf(0x234)](_0x5d3964),'dropIndex':_0x5d3964[_0xdd86cf(0x1d2)][_0xdd86cf(0x234)](_0x5d3964),'resetIndex':_0x5d3964[_0xdd86cf(0x280)]['bind'](_0x5d3964),'indexReady':_0x5d3964['indexReady']['bind'](_0x5d3964),'getIndexStatus':_0x5d3964['getIndexStatus'][_0xdd86cf(0x234)](_0x5d3964),'getClock':_0x5d3964['getClock'][_0xdd86cf(0x234)](_0x5d3964),'getChanges':_0x5d3964['getChanges'][_0xdd86cf(0x234)](_0x5d3964),'count':_0x5d3964[_0xdd86cf(0x219)][_0xdd86cf(0x234)](_0x5d3964),'range':_0x5d3964[_0xdd86cf(0x27b)][_0xdd86cf(0x234)](_0x5d3964),'now':_0x5d3964['now'][_0xdd86cf(0x234)](_0x5d3964)};}function _0x39f7e7(_0x472922){const _0x3b4821=_0x3fa0;if(!_0x472922)return null;const _0x22f542={};for(const _0x2e310c of[_0x3b4821(0x2cb),_0x3b4821(0x27a),_0x3b4821(0x1d8),'updateJob',_0x3b4821(0x2d0),_0x3b4821(0x246),'getBucket',_0x3b4821(0x2db)]){if(typeof _0x472922[_0x2e310c]===_0x3b4821(0x23b))_0x22f542[_0x2e310c]=_0x472922[_0x2e310c]['bind'](_0x472922);}return Object[_0x3b4821(0x1cf)](_0x22f542)[_0x3b4821(0x1c8)]?_0x22f542:null;}function _0x1fd98e(_0x54f439){const _0x29d76d=_0x3fa0;if(!_0x54f439)return null;const _0x4e3254={};for(const _0x2be428 of[_0x29d76d(0x248),_0x29d76d(0x2f7),'remove',_0x29d76d(0x1ed),_0x29d76d(0x1d8),'getByPath']){if(typeof _0x54f439[_0x2be428]==='function')_0x4e3254[_0x2be428]=_0x54f439[_0x2be428][_0x29d76d(0x234)](_0x54f439);}return Object[_0x29d76d(0x1cf)](_0x4e3254)[_0x29d76d(0x1c8)]?_0x4e3254:null;}function _0x14125e(_0x4f20cf){const _0x56e2d7=_0x3fa0;return{'env':_0x4f20cf[_0x56e2d7(0x251)]['bind'](_0x4f20cf),'createEnvironment':_0x4f20cf[_0x56e2d7(0x25c)][_0x56e2d7(0x234)](_0x4f20cf),'removeEnvironment':_0x4f20cf['removeEnvironment'][_0x56e2d7(0x234)](_0x4f20cf),'info':_0x4f20cf['info'],..._0x4c98ad(_0x4f20cf),'put':_0x4f20cf[_0x56e2d7(0x20a)]['bind'](_0x4f20cf),'update':_0x4f20cf['update'][_0x56e2d7(0x234)](_0x4f20cf),'patch':_0x4f20cf[_0x56e2d7(0x26f)][_0x56e2d7(0x234)](_0x4f20cf),'create':_0x4f20cf[_0x56e2d7(0x274)][_0x56e2d7(0x234)](_0x4f20cf),'remove':_0x4f20cf[_0x56e2d7(0x293)]['bind'](_0x4f20cf),'get':_0x4f20cf['get'][_0x56e2d7(0x234)](_0x4f20cf),'getMany':_0x4f20cf[_0x56e2d7(0x208)][_0x56e2d7(0x234)](_0x4f20cf),'getEntry':_0x4f20cf[_0x56e2d7(0x29e)]['bind'](_0x4f20cf),'getRange':_0x4f20cf[_0x56e2d7(0x2d2)][_0x56e2d7(0x234)](_0x4f20cf),'getValues':_0x4f20cf['getValues'][_0x56e2d7(0x234)](_0x4f20cf),'getKeys':_0x4f20cf[_0x56e2d7(0x321)][_0x56e2d7(0x234)](_0x4f20cf),'getCount':_0x4f20cf[_0x56e2d7(0x1ee)][_0x56e2d7(0x234)](_0x4f20cf),'getByPrefix':_0x4f20cf['getByPrefix'][_0x56e2d7(0x234)](_0x4f20cf),'getIndex':_0x4f20cf['getIndex'][_0x56e2d7(0x234)](_0x4f20cf),'byIndex':_0x4f20cf[_0x56e2d7(0x319)][_0x56e2d7(0x234)](_0x4f20cf),'query':_0x4f20cf['query'][_0x56e2d7(0x234)](_0x4f20cf),'setTTL':_0x4f20cf[_0x56e2d7(0x2f5)][_0x56e2d7(0x234)](_0x4f20cf),'getTTL':_0x4f20cf[_0x56e2d7(0x28a)][_0x56e2d7(0x234)](_0x4f20cf),'clearTTL':_0x4f20cf[_0x56e2d7(0x1da)][_0x56e2d7(0x234)](_0x4f20cf),'sweepExpiredTTL':_0x4f20cf[_0x56e2d7(0x25b)]['bind'](_0x4f20cf),'listTTL':_0x4f20cf[_0x56e2d7(0x275)][_0x56e2d7(0x234)](_0x4f20cf),'ttlStats':_0x4f20cf[_0x56e2d7(0x1f2)][_0x56e2d7(0x234)](_0x4f20cf),'setDefaultTTL':_0x4f20cf[_0x56e2d7(0x2bd)][_0x56e2d7(0x234)](_0x4f20cf),'getDefaultTTL':_0x4f20cf[_0x56e2d7(0x1fb)]['bind'](_0x4f20cf),'clearDefaultTTL':_0x4f20cf[_0x56e2d7(0x217)][_0x56e2d7(0x234)](_0x4f20cf),'ensureType':_0x4f20cf[_0x56e2d7(0x259)][_0x56e2d7(0x234)](_0x4f20cf),'registerType':_0x4f20cf[_0x56e2d7(0x223)][_0x56e2d7(0x234)](_0x4f20cf),'hasType':_0x4f20cf[_0x56e2d7(0x1d4)][_0x56e2d7(0x234)](_0x4f20cf),'dropType':_0x4f20cf[_0x56e2d7(0x27c)]['bind'](_0x4f20cf),'registerIndex':_0x4f20cf[_0x56e2d7(0x277)][_0x56e2d7(0x234)](_0x4f20cf),'hasIndex':_0x4f20cf[_0x56e2d7(0x1dc)][_0x56e2d7(0x234)](_0x4f20cf),'dropIndex':_0x4f20cf[_0x56e2d7(0x1d2)][_0x56e2d7(0x234)](_0x4f20cf),'resetIndex':_0x4f20cf['resetIndex'][_0x56e2d7(0x234)](_0x4f20cf),'indexReady':_0x4f20cf[_0x56e2d7(0x1cc)]['bind'](_0x4f20cf),'getIndexStatus':_0x4f20cf['getIndexStatus']['bind'](_0x4f20cf),'getClock':_0x4f20cf['getClock']['bind'](_0x4f20cf),'getChanges':_0x4f20cf['getChanges']['bind'](_0x4f20cf),'queue':_0x4f20cf[_0x56e2d7(0x23d)],'files':_0x4f20cf[_0x56e2d7(0x27d)]};}return okdbFunctionsFacades={'createEnvFacade':_0x2ae85a,'createQueueFacade':_0x39f7e7,'createFilesFacade':_0x1fd98e,'createGlobalFacade':_0x14125e},okdbFunctionsFacades;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x16c6d8=_0x1da89e;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0x2de48b=new Set([_0x16c6d8(0x20a),'patch','create',_0x16c6d8(0x293),'update',_0x16c6d8(0x2f5),_0x16c6d8(0x1da),_0x16c6d8(0x25b),'setDefaultTTL',_0x16c6d8(0x217),_0x16c6d8(0x27c),'dropIndex','resetIndex']),_0x269527=new Set(['enqueue',_0x16c6d8(0x2ef),_0x16c6d8(0x2d0),'addBucket']),_0x2202a4=new Set([_0x16c6d8(0x248),_0x16c6d8(0x293)]);function _0x15d2f3(_0x31386c,_0x3b948d){const _0x5a7852=_0x16c6d8;if(_0x31386c===_0x5a7852(0x251)||_0x31386c==='global')return _0x2de48b['has'](_0x3b948d);if(_0x31386c===_0x5a7852(0x23d))return _0x269527[_0x5a7852(0x1d1)](_0x3b948d);if(_0x31386c===_0x5a7852(0x27d))return _0x2202a4[_0x5a7852(0x1d1)](_0x3b948d);return![];}function _0x128aa4(_0x2ccab8,_0x3b57fa,_0x54d6e9,_0x55a1e2){if(!_0x2ccab8)return _0x2ccab8;return new Proxy(_0x2ccab8,{'get'(_0x1a81b1,_0x5680e9,_0x508645){const _0x2a1232=_0x3fa0,_0x14f850=Reflect[_0x2a1232(0x1ed)](_0x1a81b1,_0x5680e9,_0x508645);if(typeof _0x14f850!==_0x2a1232(0x23b))return _0x14f850;if(!_0x15d2f3(_0x3b57fa,_0x5680e9))return _0x14f850['bind'](_0x1a81b1);return function(..._0x26a98a){const _0x31896c=_0x2a1232;return _0x55a1e2[_0x31896c(0x22e)]({'scope':_0x3b57fa,'method':_0x5680e9,'envName':_0x54d6e9,'args':_0x26a98a}),null;};}});}function _0x5117d8(_0x3d6e73,_0x4aab99,_0x2773c7,_0x47e6bc){const _0x381f6b={};for(const _0x5365d5 of _0x2773c7){_0x381f6b[_0x5365d5]=(..._0x5317e3)=>{const _0x37f02a=_0x3fa0;return _0x15d2f3(_0x3d6e73,_0x5365d5)&&_0x47e6bc[_0x37f02a(0x22e)]({'scope':_0x3d6e73,'method':_0x5365d5,'envName':_0x4aab99,'args':_0x5317e3}),null;};}return _0x381f6b;}return okdbFunctionsDryrun={'isWriteMethod':_0x15d2f3,'wrapForDryRun':_0x128aa4,'syntheticDryRunFacade':_0x5117d8,'ENV_WRITE_METHODS':_0x2de48b,'QUEUE_WRITE_METHODS':_0x269527,'FILES_WRITE_METHODS':_0x2202a4},okdbFunctionsDryrun;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function requireOkdbFunctionsContext(){const _0x2bc32d=_0x1da89e;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x83d1b8,createQueueFacade:_0x40af69,createFilesFacade:_0x5eb89b,createGlobalFacade:_0x47b4d8}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x2070ed,syntheticDryRunFacade:_0x922f37}=requireOkdbFunctionsDryrun(),_0x436713=[_0x2bc32d(0x2cb),_0x2bc32d(0x27a),_0x2bc32d(0x1d8),_0x2bc32d(0x2ef),'removeJob',_0x2bc32d(0x246),_0x2bc32d(0x23e),_0x2bc32d(0x2db)],_0x17c5d3=[_0x2bc32d(0x248),_0x2bc32d(0x2f7),_0x2bc32d(0x293),_0x2bc32d(0x1ed),'list','getByPath'];function _0x111ab4(_0xe9b618,_0x360b25){const _0x215833=_0x2bc32d,_0x3773d0=(_0x2eb69d,_0x57b8ee,_0xc384f)=>_0x360b25({'type':_0x215833(0x2c3),'requestId':_0xe9b618['requestId'],'runId':_0xe9b618[_0x215833(0x288)],'entry':{'level':_0x2eb69d,'msg':_0x57b8ee,'context':_0xc384f,'ts':Date[_0x215833(0x26a)]()}}),_0x4801cc=(_0x217cbb,_0x37cc6a)=>_0x3773d0(_0x215833(0x1f9),_0x217cbb,_0x37cc6a);return _0x4801cc[_0x215833(0x1f9)]=(_0x2e4bd9,_0x4db859)=>_0x3773d0('info',_0x2e4bd9,_0x4db859),_0x4801cc[_0x215833(0x254)]=(_0x49e1fa,_0x3f298b)=>_0x3773d0(_0x215833(0x254),_0x49e1fa,_0x3f298b),_0x4801cc['error']=(_0x16f365,_0x3145fe)=>_0x3773d0(_0x215833(0x311),_0x16f365,_0x3145fe),_0x4801cc['debug']=(_0x52bdb6,_0x4a0c11)=>_0x3773d0(_0x215833(0x1e4),_0x52bdb6,_0x4a0c11),_0x4801cc;}function _0x2e8567(_0x501404,_0x5cbb78,_0x54e76c){const _0x5f5cf0=_0x2bc32d;if(!_0x501404)return null;return{'id':_0x501404['id']??null,'type':_0x501404[_0x5f5cf0(0x2dc)]??null,'tries':_0x501404[_0x5f5cf0(0x1f7)]??null,'created':_0x501404['created']??null,'tags':_0x501404[_0x5f5cf0(0x271)]??null,'priority':_0x501404['priority']??null,'bucket':_0x501404[_0x5f5cf0(0x1fd)]??null,'cron':_0x501404[_0x5f5cf0(0x230)]??null,'heartbeat'(){const _0x5ce1d8=_0x5f5cf0;_0x54e76c({'type':'job_heartbeat','requestId':_0x5cbb78[_0x5ce1d8(0x25f)],'runId':_0x5cbb78['runId'],'jobId':_0x501404['id'],'claimId':_0x501404[_0x5ce1d8(0x2d4)]});},'markProgress'(_0x3fe056){const _0x58e273=_0x5f5cf0;_0x54e76c({'type':_0x58e273(0x2ee),'requestId':_0x5cbb78[_0x58e273(0x25f)],'runId':_0x5cbb78[_0x58e273(0x288)],'jobId':_0x501404['id'],'claimId':_0x501404['claimId'],'message':_0x3fe056});}};}function _0x40a087(_0x4adcc7){const _0x1a6a99=_0x2bc32d;if(!_0x4adcc7)return null;return{'mode':_0x4adcc7['mode']??null,'sourceType':_0x4adcc7[_0x1a6a99(0x203)]??null,'sourceEnv':_0x4adcc7[_0x1a6a99(0x216)]??null,'processor':_0x4adcc7[_0x1a6a99(0x28f)]??null,'engineKey':_0x4adcc7[_0x1a6a99(0x317)]??null,'cursorKey':_0x4adcc7[_0x1a6a99(0x285)]??null};}function _0xed221f(_0x232e79){const _0x9d6faa=_0x2bc32d;if(!_0x232e79)return null;return{'mode':_0x232e79[_0x9d6faa(0x297)]??null,'sourceType':_0x232e79[_0x9d6faa(0x203)]??null,'targetType':_0x232e79[_0x9d6faa(0x205)]??null,'sourceEnv':_0x232e79[_0x9d6faa(0x216)]??null,'targetEnv':_0x232e79[_0x9d6faa(0x239)]??null,'engineKey':_0x232e79['engineKey']??null,'cursorKey':_0x232e79['cursorKey']??null};}function _0xf6fad9(_0x4e41f4,_0x18a520,_0x5a8275,_0x1a56bc=null,_0x1ca4f3=null){const _0x54e7ec=_0x2bc32d,_0x1d9c1d={'runId':_0x18a520['runId'],'scope':_0x54e7ec(0x251),'env':_0x18a520['envName']??null,'functionName':_0x18a520[_0x54e7ec(0x1d6)],'trigger':_0x18a520[_0x54e7ec(0x1f9)]?.[_0x54e7ec(0x29c)]??'sdk','requestedAt':_0x18a520[_0x54e7ec(0x1f9)]?.[_0x54e7ec(0x2b3)]??Date['now']()},_0x4c9381=_0x111ab4(_0x18a520,_0x5a8275),_0x2c79ed=AbortSignal[_0x54e7ec(0x26e)](Math[_0x54e7ec(0x1d5)](0x1,_0x18a520[_0x54e7ec(0x265)]?.['timeoutMs']??0x3e8)),_0x2d5405=_0x1ca4f3?AbortSignal['any']([_0x2c79ed,_0x1ca4f3]):_0x2c79ed,_0x4328b3=_0x4e41f4['env'](_0x18a520[_0x54e7ec(0x2de)]),_0x21e821=_0x1a56bc?_0x2070ed(_0x4328b3,_0x54e7ec(0x251),_0x18a520[_0x54e7ec(0x2de)],_0x1a56bc):_0x4328b3,_0xd51a2d=_0x1a56bc?_0x4328b3[_0x54e7ec(0x23d)]?_0x2070ed(_0x4328b3[_0x54e7ec(0x23d)],'queue',_0x18a520[_0x54e7ec(0x2de)],_0x1a56bc):_0x922f37(_0x54e7ec(0x23d),_0x18a520[_0x54e7ec(0x2de)],_0x436713,_0x1a56bc):_0x4328b3[_0x54e7ec(0x23d)],_0x3bb3bf=_0x1a56bc?_0x4328b3[_0x54e7ec(0x27d)]?_0x2070ed(_0x4328b3[_0x54e7ec(0x27d)],_0x54e7ec(0x27d),_0x18a520['envName'],_0x1a56bc):_0x922f37('files',_0x18a520[_0x54e7ec(0x2de)],_0x17c5d3,_0x1a56bc):_0x4328b3[_0x54e7ec(0x27d)],_0xa227db=_0x83d1b8(_0x21e821),_0x3aa95c=_0x40af69(_0xd51a2d),_0x1b38e1=_0x5eb89b(_0x3bb3bf);if(_0x3aa95c)_0xa227db['queue']=_0x3aa95c;if(_0x1b38e1)_0xa227db[_0x54e7ec(0x27d)]=_0x1b38e1;const _0x34f873={'payload':_0x18a520['payload']??null,'info':_0x1d9c1d,'signal':_0x2d5405,'log':_0x4c9381,'env':_0xa227db},_0x1f18bf=_0x2e8567(_0x18a520[_0x54e7ec(0x260)],_0x18a520,_0x5a8275);if(_0x1f18bf)_0x34f873[_0x54e7ec(0x2a9)]=_0x1f18bf;const _0x2b3408=_0x40a087(_0x18a520[_0x54e7ec(0x28b)]);if(_0x2b3408)_0x34f873[_0x54e7ec(0x28f)]=_0x2b3408;const _0xcbe5cd=_0xed221f(_0x18a520['materializerContext']);if(_0xcbe5cd)_0x34f873[_0x54e7ec(0x31e)]=_0xcbe5cd;if(_0x18a520[_0x54e7ec(0x312)]){const _0x4464f7=_0x1a56bc?_0x2070ed(_0x4e41f4,'global',null,_0x1a56bc):_0x4e41f4;_0x34f873[_0x54e7ec(0x1f6)]=_0x47b4d8(_0x4464f7);}return _0x34f873;}return okdbFunctionsContext={'createExecutionContext':_0xf6fad9,'createScriptLogger':_0x111ab4},okdbFunctionsContext;}function _0x42d0(){const _0x1f035f=['clear','18VfmsDb','_log','license:activated','bus:drain','log','\x20which\x20does\x20not\x20exist','index:drop','system:drain','args','\x27,\x20cannot\x20map\x20to\x20\x27','Function\x20script\x20failed\x20to\x20initialize','mean','enqueue','_admissionStarted','\x20actions=','offWindow','__esModule','removeJob','_closeReadTransaction','getRange','maxExtra','claimId','1131TzRjII','ALREADY_EXISTS','Foreign\x20key\x20violation:\x20','env:opened','actions',':\x20key\x20[','listBuckets','type','hasOwnProperty','envName','name','fieldPath','references','Invalid\x20index\x20key\x20type\x20for\x20\x27','txn-commit','unref','node:vm','label','_buckets','_closed','readTransaction','getByPrefix','map','\x22\x20on\x20\x22','OKDBIndexNotRegisteredError','job_progress','updateJob','note','setSchema','code','setTtl','338XjRDOs','setTTL','\x20already\x20exists','stream','hostname','errors','getClock','stop','useReadTransaction','enable','entries','value','catch','system:type_drop','OKDBNotFoundError','cancelled\x20by\x20caller','fetch\x20blocked:\x20invalid\x20URL','stack','INVALID_PRIMARY_KEY','crypto','waiting','_started','okdb-function.js','unique:violation_resolved','OKDBInvalidIndexKeyError','freeze','dryRun','\x27:\x20','done','error','unsafe','toFixed','options','geoQuery','Unknown\x20transaction\x20action:\x20','engineKey','bus:proc','byIndex','stopped','createContext','started','filename','materializer','4550kBoRxh','object','getKeys','Cannot\x20delete\x20','OKDBInvalidValueError','length','add','passive','11088ZarDnf','indexReady','INDEX_ALREADY_REGISTERED','schema:drop','keys','result','has','dropIndex','\x27\x20is\x20already\x20registered','hasType','max','functionName','script','list','item:remove','clearTTL','targetKey','hasIndex','dropSchema','FUNCTION_SCRIPT_INVALID_SHAPE','url','_doHooks','INDEX_HAS_CONSUMERS','66HaFnZl','NOT_FOUND','debug','\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict','Function\x20script\x20failed\x20to\x20compile','_windowCbs','details','emit','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','abort','fts:reset','get','getCount','TXN_INVALID_OPS','onWindow','ttl:clear','ttlStats','view:progress','\x20documents\x20fail\x20validation','ref:violation','okdb','tries','~system','info','enabled','getDefaultTTL','Unknown\x20OKDB\x20transaction\x20error','bucket','OKDBTypeNotRegisteredError','events','reduce','TYPE_NOT_REGISTERED','ref:violation_resolved','sourceType','close','targetType','stringify','\x20│\x20','getMany','action','put','Transaction\x20already\x20closed','ftsQuery','fts:registered','ms\x20mean=','transaction','runInContext','958WZzQwm','TXN_INVALID_OP','OKDBError','ms\x20p99=','constructor','sourceEnv','clearDefaultTTL','31764itHXTL','count','Type\x20\x27','10156MXUhqq','resetting','globalThis','index:ready','system:ready','cause','_admissionTimer','loop-lag\x20','registerType','TXN_START','run','applyOps','OKDBVersionMismatchError','exit','index:registered','FUNCTION_SCRIPT_COMPILE_FAILED','cancel','bus:type_drop','bus:poke','push','delete','cron','ready','\x20does\x20not\x20exist','pid','bind','rollback','Index\x20\x22','_undoHooks','unique:violation','targetEnv','failures','function','Script','queue','getBucket','getHeapStatistics','OKDBIndexHasConsumersError','kind','dryRunActions','system:stopped','Index\x20\x27','sourceKey','addBucket','\x27\x20doesn\x27t\x20exist','upload','sort','size','INDEX_NOT_REGISTERED','OKDBIndexAlreadyRegisteredError','162757sGOPoh','item:update','reset','creating','env','.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20','txn:end','warn','.okdb-function.js','FETCH_NOT_ALLOWED','signal','INVALID_VALUE','ensureType','index:reset','sweepExpiredTTL','createEnvironment','transactionSync','Version\x20mismatch\x20for\x20','requestId','jobContext','isArray','allowFetch','version','./okdb','runtime','_report','OKDBForeignKeyDeleteError','set','prototype','now','license:added','SCHEMA_COLLECTION_INVALID','OKDBForeignKeyError','timeout','patch','ttl:expired','tags','_timer','update','create','listTTL',':\x20expected\x20','registerIndex','TXN_ERROR','setLogger','getJob','range','dropType','files','UNIQUE_CONSTRAINT',',\x20got\x20','resetIndex','OKDBUniqueConstraintError','OKDBInvalidPrimaryKeyError','commit','fatal','cursorKey','sandbox-','_envs','runId','sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData','getTTL','processorContext','system:poke','message','key','processor','Cannot\x20set\x20enforce\x20schema\x20on\x20','ms\x20busy=','348880MrIIis','remove','getValues','onDo','maxMs','mode','reject','15SQnVvs','FOREIGN_KEY_VIOLATION','ttl','trigger','txn:start','getEntry','system:bus_state_change','TXN_END','start','_assertOpen','captureStackTrace','registerFts','type:drop','Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function','txn:rollback','openEnv','job','exports','call','node:perf_hooks','VERSION_MISMATCH','query','percentile','Schema\x20validation\x20failed\x20for\x20','fts:drop','\x27\x20already\x20registered','requestedAt','dropFts','stopping','createWriteFacade','allowedFetchDomains','OKDBSchemaValidationError','TXN_INVALID_ACTION','\x20references\x20','system:proc','335480qnDHaB','setDefaultTTL'];_0x42d0=function(){return _0x1f035f;};return _0x42d0();}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){const _0x3eb21b=_0x1da89e;if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0x1d5afc,workerData:_0x1e366c}=require$$0$3,_0x1c594f=require$$1,{compileFunctionExpression:_0x34ac85}=requireOkdbFunctionsSandbox(),{serializeError:_0x5ba8e1}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x51e19e}=requireOkdbFunctionsContext(),_0x59154c=require$$5;let _0x5bc4a5=null,_0x25b74c=![];const _0xfa372d=new Map(),_0x1e10db=new Map();function _0x2a3f72(_0x140355){try{_0x1d5afc['postMessage'](_0x140355);}catch{}}function _0x55db8e(_0xcd135b){const _0x393bd7=_0x3fa0,_0x5a15ab=(_0xcd135b[_0x393bd7(0x2de)]||_0x393bd7(0x1f8))+':'+_0xcd135b[_0x393bd7(0x1d6)]+':'+_0xcd135b[_0x393bd7(0x263)]+':'+_0xcd135b['hash'];let _0x4eb7fb=_0xfa372d[_0x393bd7(0x1ed)](_0x5a15ab);return!_0x4eb7fb&&(_0x4eb7fb=_0x34ac85(_0xcd135b[_0x393bd7(0x1d7)],{'allowFetch':_0xcd135b[_0x393bd7(0x265)]?.[_0x393bd7(0x262)]!==![],'allowedFetchDomains':_0xcd135b['runtime']?.[_0x393bd7(0x2b7)],'filename':_0xcd135b[_0x393bd7(0x1d6)]+_0x393bd7(0x255)}),_0xfa372d[_0x393bd7(0x268)](_0x5a15ab,_0x4eb7fb)),_0x4eb7fb;}async function _0x14f94a(_0x5a4b68){const _0x174280=_0x3fa0,_0x3848f1=Date['now'](),_0x3146c4=new AbortController();_0x1e10db[_0x174280(0x268)](_0x5a4b68[_0x174280(0x25f)],_0x3146c4);try{const _0x443180=_0x55db8e(_0x5a4b68);if(_0x5a4b68[_0x174280(0x2de)])await _0x5bc4a5[_0x174280(0x2a8)](_0x5a4b68['envName']);const _0x413919=_0x5a4b68[_0x174280(0x30e)]?[]:null,_0xca1eb9=_0x51e19e(_0x5bc4a5,_0x5a4b68,_0x2a3f72,_0x413919,_0x3146c4[_0x174280(0x257)]),_0x36b97a=await _0x443180(_0xca1eb9),_0x53661b={'type':_0x174280(0x1d0),'requestId':_0x5a4b68['requestId'],'runId':_0x5a4b68[_0x174280(0x288)],'result':_0x36b97a,'meta':{'runnerId':_0x174280(0x286)+process[_0x174280(0x233)],'startedAt':_0x3848f1,'finishedAt':Date[_0x174280(0x26a)](),'durationMs':Date[_0x174280(0x26a)]()-_0x3848f1}};if(_0x413919)_0x53661b[_0x174280(0x242)]=_0x413919;_0x2a3f72(_0x53661b);}catch(_0x1cf865){_0x2a3f72({'type':'error','requestId':_0x5a4b68[_0x174280(0x25f)],'runId':_0x5a4b68['runId'],'error':_0x5ba8e1(_0x1cf865),'meta':{'runnerId':'sandbox-'+process[_0x174280(0x233)],'startedAt':_0x3848f1,'finishedAt':Date[_0x174280(0x26a)](),'durationMs':Date[_0x174280(0x26a)]()-_0x3848f1}});}finally{_0x1e10db['delete'](_0x5a4b68[_0x174280(0x25f)]);}}async function _0x84e9d8(){const _0x227141=_0x3fa0;if(_0x25b74c)return;_0x25b74c=!![];try{await _0x5bc4a5?.[_0x227141(0x204)]?.();}catch{}process[_0x227141(0x228)](0x0);}async function _0x5b761d(){const _0x2a61f3=_0x3fa0,{rootPath:_0x3caf7c}=_0x1e366c??{};if(!_0x3caf7c)throw new Error(_0x2a61f3(0x289));_0x5bc4a5=new _0x59154c(_0x3caf7c,{'engines':![],'asyncProcessors':![],'compaction':_0x2a61f3(0x1ca),'http':![],'auth':{'open':!![]}}),await _0x5bc4a5['open']();const _0x16f12a=setInterval(()=>{const _0x1cfc25=_0x2a61f3;if(_0x25b74c)return;for(const [,_0x1a66f7]of _0x5bc4a5[_0x1cfc25(0x287)]){try{_0x1a66f7['_drainHandler']?.();}catch{}}},0xc8);if(typeof _0x16f12a['unref']===_0x2a61f3(0x23b))_0x16f12a['unref']();_0x1d5afc['on'](_0x2a61f3(0x28d),_0x2ca31b=>{const _0x2f7a4b=_0x2a61f3;if(!_0x2ca31b||typeof _0x2ca31b!==_0x2f7a4b(0x320))return;if(_0x2ca31b[_0x2f7a4b(0x2dc)]===_0x2f7a4b(0x2fb))return void _0x84e9d8();if(_0x2ca31b['type']===_0x2f7a4b(0x22b)){_0x1e10db['get'](_0x2ca31b[_0x2f7a4b(0x25f)])?.[_0x2f7a4b(0x1eb)](new Error(_0x2f7a4b(0x303)));return;}_0x2ca31b[_0x2f7a4b(0x2dc)]===_0x2f7a4b(0x225)&&void _0x14f94a(_0x2ca31b[_0x2f7a4b(0x2a9)]);});const _0x57d701=Math[_0x2a61f3(0x1d5)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0x26e375=setInterval(()=>{const _0x40af36=_0x2a61f3;try{_0x2a3f72({'type':'stats','heapUsed':_0x1c594f[_0x40af36(0x23f)]()['used_heap_size']});}catch{}},_0x57d701);if(typeof _0x26e375['unref']==='function')_0x26e375[_0x2a61f3(0x2e4)]();_0x2a3f72({'type':_0x2a61f3(0x231)});}return _0x5b761d()[_0x3eb21b(0x300)](_0x3c5a51=>{const _0x5cf145=_0x3eb21b;_0x2a3f72({'type':_0x5cf145(0x284),'error':_0x5ba8e1(_0x3c5a51)}),process[_0x5cf145(0x228)](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);module[_0x1da89e(0x2aa)]=okdbFunctionsSandboxWorker;
1
+ 'use strict';const _0x17c8b9=_0x1403;(function(_0x23f997,_0x4ec4ff){const _0x2a3a20=_0x1403,_0x1d26b4=_0x23f997();while(!![]){try{const _0x12a7c3=parseInt(_0x2a3a20(0x1b1))/0x1+parseInt(_0x2a3a20(0x184))/0x2+parseInt(_0x2a3a20(0x1c8))/0x3+-parseInt(_0x2a3a20(0x197))/0x4+-parseInt(_0x2a3a20(0x86))/0x5+parseInt(_0x2a3a20(0x146))/0x6*(parseInt(_0x2a3a20(0x1cd))/0x7)+-parseInt(_0x2a3a20(0x137))/0x8*(parseInt(_0x2a3a20(0x1ce))/0x9);if(_0x12a7c3===_0x4ec4ff)break;else _0x1d26b4['push'](_0x1d26b4['shift']());}catch(_0x2865a7){_0x1d26b4['push'](_0x1d26b4['shift']());}}}(_0x1c24,0xe03eb));var require$$0$3=require(_0x17c8b9(0x180)),require$$2=require('v8'),require$$0=require(_0x17c8b9(0x149)),require$$0$2=require('uuid'),require$$0$1=require(_0x17c8b9(0xc3)),require$$6=require('./okdb');function getDefaultExportFromCjs(_0x48bc3c){const _0x2579e0=_0x17c8b9;return _0x48bc3c&&_0x48bc3c[_0x2579e0(0x19e)]&&Object[_0x2579e0(0x11d)][_0x2579e0(0x85)][_0x2579e0(0x1ad)](_0x48bc3c,_0x2579e0(0x1b9))?_0x48bc3c[_0x2579e0(0x1b9)]:_0x48bc3c;}var okdbFunctionsSandboxWorker$1={},okdbFatalReport,hasRequiredOkdbFatalReport;function requireOkdbFatalReport(){if(hasRequiredOkdbFatalReport)return okdbFatalReport;hasRequiredOkdbFatalReport=0x1;function _0x551c9a(_0x35b93f){const _0x9b670b=_0x1403;if(process.env.OKDB_FATAL_REPORT!=='1')return;try{if(!process[_0x9b670b(0xfe)])return;process['report'][_0x9b670b(0x1b8)]=!![];try{if(_0x9b670b(0x104)in process[_0x9b670b(0xfe)])process['report'][_0x9b670b(0x104)]=process.env.OKDB_FATAL_REPORT_ENV!=='1';}catch{}if(process['platform']!=='win32')try{process[_0x9b670b(0xfe)][_0x9b670b(0x17b)]=!![];if(typeof process[_0x9b670b(0xfe)][_0x9b670b(0x1a5)]===_0x9b670b(0x108))process['report'][_0x9b670b(0x1a5)]=_0x9b670b(0x16e);}catch{}if(process.env.OKDB_REPORT_DIR)try{require('fs')[_0x9b670b(0xcf)](process.env.OKDB_REPORT_DIR,{'recursive':!![]}),process['report'][_0x9b670b(0x13e)]=process.env.OKDB_REPORT_DIR;}catch{}try{process[_0x9b670b(0xfe)][_0x9b670b(0x166)]='';}catch{}if(_0x35b93f)process.env.OKDB_REPORT_TAG=String(_0x35b93f);}catch{}}return okdbFatalReport={'enableFatalReport':_0x551c9a},okdbFatalReport;}var okdbFunctionsSandbox,hasRequiredOkdbFunctionsSandbox;function requireOkdbFunctionsSandbox(){if(hasRequiredOkdbFunctionsSandbox)return okdbFunctionsSandbox;hasRequiredOkdbFunctionsSandbox=0x1;const _0x39a6f2=require$$0;function _0x5db1b7(_0x3f02a3){const _0x383aa7=_0x1403,_0x2d25d3=_0x3f02a3==='*',_0x473623=_0x2d25d3?null:new Set(Array[_0x383aa7(0xce)](_0x3f02a3)?_0x3f02a3:[]);return function _0x4abc06(_0x4528c0,_0x38b40f){const _0xd5309d=_0x383aa7;if(!_0x2d25d3){let _0x19258b;try{const _0x26f710=new URL(typeof _0x4528c0===_0xd5309d(0x108)?_0x4528c0:_0x4528c0?.[_0xd5309d(0xf3)]??String(_0x4528c0));_0x19258b=_0x26f710[_0xd5309d(0xeb)];}catch{const _0xe85f42=new Error(_0xd5309d(0x1b2));return _0xe85f42[_0xd5309d(0xf8)]=_0xd5309d(0x1bf),Promise[_0xd5309d(0xa7)](_0xe85f42);}if(!_0x473623['has'](_0x19258b)){const _0x5a3ff1=new Error(_0x473623[_0xd5309d(0x6d)]===0x0?_0xd5309d(0x193):_0xd5309d(0x19b)+_0x19258b+_0xd5309d(0x160));return _0x5a3ff1['code']='FETCH_NOT_ALLOWED',Promise['reject'](_0x5a3ff1);}}return fetch(_0x4528c0,_0x38b40f);};}function _0x435f21(_0x4a079f={}){const _0x32bffb=_0x1403,_0xd2233e=_0x4a079f[_0x32bffb(0x6c)]!==![],_0x53a0ef=_0x4a079f[_0x32bffb(0x136)]??[],_0x45f720={'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[_0x32bffb(0xb1)]};return _0xd2233e&&typeof fetch===_0x32bffb(0x74)&&(_0x45f720[_0x32bffb(0x16b)]=_0x5db1b7(_0x53a0ef)),_0x45f720[_0x32bffb(0xe5)]=_0x45f720,_0x45f720;}function _0x35dc5d(_0x36c14f,_0x18d945={}){const _0x3d3f43=_0x1403,_0x50eb42=_0x435f21(_0x18d945),_0x111878=_0x39a6f2[_0x3d3f43(0x68)](_0x50eb42,{'name':'okdb-function-sandbox','codeGeneration':{'strings':![],'wasm':![]}});let _0x242882;try{_0x242882=new _0x39a6f2['Script']('('+_0x36c14f+')',{'filename':_0x18d945['filename']??_0x3d3f43(0x7b)});}catch(_0x5d3ccf){const _0x1569b1=new Error(_0x5d3ccf?.['message']||_0x3d3f43(0x6e));_0x1569b1[_0x3d3f43(0xf8)]=_0x3d3f43(0x92),_0x1569b1[_0x3d3f43(0xa8)]=_0x5d3ccf;throw _0x1569b1;}let _0x7900a4;try{_0x7900a4=_0x242882[_0x3d3f43(0x9a)](_0x111878,{'timeout':_0x18d945[_0x3d3f43(0x130)]??0x64});}catch(_0x4f6122){const _0x58d5fc=new Error(_0x4f6122?.[_0x3d3f43(0x132)]||_0x3d3f43(0x129));_0x58d5fc[_0x3d3f43(0xf8)]=_0x3d3f43(0x92),_0x58d5fc['cause']=_0x4f6122;throw _0x58d5fc;}if(typeof _0x7900a4!=='function'){const _0x3731be=new Error(_0x3d3f43(0x176));_0x3731be[_0x3d3f43(0xf8)]='FUNCTION_SCRIPT_INVALID_SHAPE';throw _0x3731be;}return _0x7900a4;}return okdbFunctionsSandbox={'createSandboxGlobals':_0x435f21,'compileFunctionExpression':_0x35dc5d,'_buildRestrictedFetch':_0x5db1b7},okdbFunctionsSandbox;}var okdbFunctionsIpc,hasRequiredOkdbFunctionsIpc;function requireOkdbFunctionsIpc(){if(hasRequiredOkdbFunctionsIpc)return okdbFunctionsIpc;hasRequiredOkdbFunctionsIpc=0x1;function _0x1072a1(_0x19514d){const _0x3cb01b=_0x1403;if(!_0x19514d)return null;return{'message':_0x19514d[_0x3cb01b(0x132)]||String(_0x19514d),'stack':_0x19514d[_0x3cb01b(0x174)]||null,'code':_0x19514d[_0x3cb01b(0xf8)]||null,'details':_0x19514d[_0x3cb01b(0xab)]||null};}function _0x3e6a17(_0x40cc7c){const _0x165fd4=_0x1403;if(!_0x40cc7c)return new Error('Unknown\x20custom\x20function\x20error');const _0x34aec3=new Error(_0x40cc7c[_0x165fd4(0x132)]||String(_0x40cc7c));if(_0x40cc7c[_0x165fd4(0x174)])_0x34aec3[_0x165fd4(0x174)]=_0x40cc7c['stack'];if(_0x40cc7c[_0x165fd4(0xf8)])_0x34aec3[_0x165fd4(0xf8)]=_0x40cc7c[_0x165fd4(0xf8)];if(_0x40cc7c['details'])_0x34aec3['details']=_0x40cc7c['details'];return _0x34aec3;}return okdbFunctionsIpc={'serializeError':_0x1072a1,'deserializeError':_0x3e6a17},okdbFunctionsIpc;}var okdbEnums,hasRequiredOkdbEnums;function requireOkdbEnums(){const _0x117c38=_0x17c8b9;if(hasRequiredOkdbEnums)return okdbEnums;hasRequiredOkdbEnums=0x1;const _0x138c7c={'PUT':_0x117c38(0xcd),'REMOVE':_0x117c38(0x12d),'INDEX_DROP':_0x117c38(0x10b),'INDEX_REGISTER':'registerIndex','INDEX_RESET':_0x117c38(0x88),'TYPE_REGISTER':_0x117c38(0xd2),'TYPE_DROP':_0x117c38(0xc1),'FTS_REGISTER':'registerFts','FTS_DROP':_0x117c38(0x127),'FTS_RESET':_0x117c38(0x8a),'SCHEMA_SET':_0x117c38(0x157),'SCHEMA_DROP':_0x117c38(0x17f),'TTL_SET':_0x117c38(0x15e),'TTL_CLEAR':_0x117c38(0x1b5)},_0x4c33e0={'SYSTEM_READY':_0x117c38(0xc0),'SYSTEM_STOPPED':_0x117c38(0xed),'SYSTEM_CLOCK_CHANGE':_0x117c38(0x1ae),'SYSTEM_POKE':_0x117c38(0x10c),'SYSTEM_DRAIN':_0x117c38(0x1b3),'SYSTEM_TYPE_DROP':'system:type_drop','SYSTEM_PROC':_0x117c38(0x96),'SYSTEM_BUS_STATE_CHANGE':_0x117c38(0x9b),'ITEM_CREATE':'item:create','ITEM_UPDATE':'item:update','ITEM_REMOVE':_0x117c38(0x126),'INDEX_RESET':'index:reset','INDEX_READY':_0x117c38(0x143),'INDEX_PROGRESS':_0x117c38(0x1ab),'VIEW_PROGRESS':_0x117c38(0x155),'INDEX_DROP':_0x117c38(0xa1),'INDEX_REGISTERED':'index:registered','FTS_REGISTERED':'fts:registered','FTS_DROP':_0x117c38(0x1c1),'FTS_RESET':_0x117c38(0x161),'SCHEMA_SET':_0x117c38(0x76),'SCHEMA_DROP':_0x117c38(0x1bb),'UNIQUE_VIOLATION':'unique:violation','UNIQUE_VIOLATION_RESOLVED':_0x117c38(0xd0),'REF_VIOLATION':_0x117c38(0x84),'REF_VIOLATION_RESOLVED':_0x117c38(0x11c),'SYNC_APPLY':'sync:apply','TXN_START':_0x117c38(0x158),'TXN_END':'txn:end','TXN_ROLLBACK':_0x117c38(0xdd),'TYPE_REGISTERED':_0x117c38(0x120),'TYPE_DROP':_0x117c38(0x17a),'ENV_OPENED':_0x117c38(0xc7),'ENV_REMOVED':'env:removed','SYSTEM_ENV_RELEASE':_0x117c38(0x9f),'TTL_EXPIRED':_0x117c38(0x78),'TTL_SET':_0x117c38(0x7a),'TTL_CLEAR':_0x117c38(0x13c),'LICENSE_INVALID':_0x117c38(0x1cf),'LICENSE_ADDED':_0x117c38(0xdc),'LICENSE_ACTIVATED':'license:activated','LICENSE_REMOVED':_0x117c38(0x19f)},_0x236460={'CREATING':'creating','RESETTING':'resetting','READY':'ready','DROPPING':_0x117c38(0xbc),'WAITING':_0x117c38(0x101)},_0x16dab1={'CREATED':_0x117c38(0x187),'STARTING':_0x117c38(0x121),'STARTED':_0x117c38(0x103),'STOPPING':_0x117c38(0xa3),'STOPPED':_0x117c38(0x1bd)},_0x40c0da={'CREATING':'creating','READY':_0x117c38(0x8e),'HALTED':_0x117c38(0xe6),'STOPPED':_0x117c38(0x1bd),'RESETTING':'resetting'},_0x4bb6e4=Object['freeze']({'POKE':_0x117c38(0xde),'DRAIN':_0x117c38(0x15b),'TYPE_DROP':_0x117c38(0x173),'PROC':_0x117c38(0x178),'ENV_RELEASE':'bus:env_release'});return okdbEnums={'BUS_EVENTS':_0x4bb6e4,'CHANGE_ACTIONS':_0x138c7c,'EVENTS':_0x4c33e0,'INDEX_STATE':_0x236460,'OKDB_STATE':_0x16dab1,'VIEW_STATE':_0x40c0da},okdbEnums;}var okdbError,hasRequiredOkdbError;function requireOkdbError(){if(hasRequiredOkdbError)return okdbError;hasRequiredOkdbError=0x1;class _0x339c63 extends Error{constructor(_0x4a2025,_0x563697,_0xdb30d6={}){const _0x4c081d=_0x1403;super(_0x4a2025),this[_0x4c081d(0x145)]='OKDBError',this[_0x4c081d(0xf8)]=_0x563697,this[_0x4c081d(0xab)]=_0xdb30d6,_0xdb30d6['cause']&&(this[_0x4c081d(0xa8)]=_0xdb30d6['cause']),Error[_0x4c081d(0x7d)](this,this[_0x4c081d(0xf2)]);}}class _0x1ab5e0 extends _0x339c63{constructor(_0x45c1b5,_0xf4630,_0x35bbfb,_0x335277){const _0x4e5ae7=_0x1403;super('Version\x20mismatch\x20for\x20'+_0x45c1b5+'@'+_0xf4630+_0x4e5ae7(0x97)+_0x35bbfb+_0x4e5ae7(0x95)+_0x335277,_0x4e5ae7(0x142),{'type':_0x45c1b5,'key':_0xf4630,'expectedVersion':_0x35bbfb,'actualVersion':_0x335277}),this[_0x4e5ae7(0x145)]='OKDBVersionMismatchError';}}class _0x2ce5d1 extends _0x339c63{constructor(_0x2ac82e,_0xdd7f70){const _0x511c84=_0x1403;super(_0x2ac82e+'@'+_0xdd7f70+_0x511c84(0x1cc),_0x511c84(0x172),{'type':_0x2ac82e,'key':_0xdd7f70}),this['name']=_0x511c84(0xf0);}}class _0x593b96 extends _0x339c63{constructor(_0x15e1e1,_0x75d15c){const _0x511f62=_0x1403;super(_0x15e1e1+'@'+_0x75d15c+_0x511f62(0x1a7),_0x511f62(0x1a0),{'type':_0x15e1e1,'key':_0x75d15c}),this['name']=_0x511f62(0xe3);}}class _0xdda65c extends _0x339c63{constructor(_0x11fdd7,_0x44ed23){const _0x3213b8=_0x1403,_0xfcaea5=typeof _0x44ed23;super(_0x3213b8(0xd4)+_0x11fdd7+_0x3213b8(0xe4)+_0xfcaea5+_0x3213b8(0xbf)+_0x44ed23,_0x3213b8(0x11b),{'index':_0x11fdd7,'key':_0x44ed23,'keyType':_0xfcaea5}),this[_0x3213b8(0x145)]=_0x3213b8(0x171);}}class _0x5e158e extends _0x339c63{constructor(_0x30a0be){const _0x5c369d=_0x1403,_0x5790fb=typeof _0x30a0be;super(_0x5c369d(0x8f)+_0x5790fb+_0x5c369d(0xd7)+_0x30a0be,'INVALID_PRIMARY_KEY',{'key':_0x30a0be,'keyType':_0x5790fb}),this[_0x5c369d(0x145)]=_0x5c369d(0x1aa);}}class _0x3f67bb extends _0x339c63{constructor(_0x4acf01){const _0x15f97c=_0x1403;super(_0x15f97c(0x11f)+_0x4acf01+_0x15f97c(0x1a1),_0x15f97c(0x1ac),{'type':_0x4acf01}),this[_0x15f97c(0x145)]=_0x15f97c(0x1a2);}}class _0x1c7b5a extends _0x339c63{constructor(_0xeafcd3){const _0x38ac46=_0x1403;super(_0x38ac46(0x11f)+_0xeafcd3+_0x38ac46(0xfc),'TYPE_ALREADY_REGISTERED',{'type':_0xeafcd3}),this[_0x38ac46(0x145)]=_0x38ac46(0xc8);}}class _0x4bfbdb extends _0x339c63{constructor(_0x27868c,_0x4cfc09){const _0x29ef4b=_0x1403;super(_0x29ef4b(0xb3)+_0x4cfc09+_0x29ef4b(0xf4)+_0x27868c+_0x29ef4b(0x1a1),_0x29ef4b(0x175),{'type':_0x27868c,'index':_0x4cfc09}),this[_0x29ef4b(0x145)]='OKDBIndexNotRegisteredError';}}class _0x521700 extends _0x339c63{constructor(_0xbfa9f4,_0x1b96ab){const _0x4e8bb8=_0x1403;super('Index\x20\x27'+_0x1b96ab+_0x4e8bb8(0xf4)+_0xbfa9f4+_0x4e8bb8(0x1cb),_0x4e8bb8(0x16d),{'type':_0xbfa9f4,'index':_0x1b96ab}),this[_0x4e8bb8(0x145)]=_0x4e8bb8(0x188);}}class _0x5d4c67 extends _0x339c63{constructor(_0x457946,_0x28d23e={}){const _0x467dad=_0x1403;super(_0x457946,_0x467dad(0xa6),_0x28d23e),this[_0x467dad(0x145)]=_0x467dad(0x186);}}class _0x23d793 extends _0x339c63{constructor(_0x36a355,_0x13e582,_0x2b5b63,_0xfb4483,_0x53f059){const _0x26eb7b=_0x1403;super(_0x26eb7b(0xe9)+_0x36a355+'@'+_0x13e582+_0x26eb7b(0x165)+_0x2b5b63+_0x26eb7b(0xc4)+_0xfb4483+_0x26eb7b(0x13b)+_0x53f059+'\x27','UNIQUE_CONSTRAINT',{'type':_0x36a355,'index':_0x13e582,'indexKey':_0x2b5b63,'existingKey':_0xfb4483,'conflictingKey':_0x53f059}),this[_0x26eb7b(0x145)]=_0x26eb7b(0x1a8);}}class _0x426d05 extends _0x339c63{constructor(_0x1884f7,_0x3a5d03,_0x4efac0){const _0x458ed6=_0x1403;super('Schema\x20validation\x20failed\x20for\x20'+_0x1884f7+'@'+_0x3a5d03,_0x458ed6(0xd9),{'type':_0x1884f7,'key':_0x3a5d03,'errors':_0x4efac0}),this[_0x458ed6(0x145)]='OKDBSchemaValidationError',this[_0x458ed6(0x91)]=_0x1884f7,this['key']=_0x3a5d03,this['errors']=_0x4efac0;}}class _0x5d9b63 extends _0x339c63{constructor(_0x8e86fd,_0x3a28ae){const _0x4a1e0f=_0x1403;super(_0x4a1e0f(0xa2)+_0x8e86fd+':\x20'+_0x3a28ae[_0x4a1e0f(0xaa)]+_0x4a1e0f(0x16f),_0x4a1e0f(0x1ba),{'type':_0x8e86fd,'failures':_0x3a28ae}),this[_0x4a1e0f(0x145)]='OKDBSchemaCollectionError',this['type']=_0x8e86fd,this[_0x4a1e0f(0x1c3)]=_0x3a28ae;}}class _0x3117d2 extends _0x339c63{constructor(_0x441023,_0x4ab055,_0x2e582c,_0x5eb2d6,_0x58bf9e){const _0x3a4fdf=_0x1403;super(_0x3a4fdf(0x1bc)+_0x441023+'@'+_0x4ab055+'.'+_0x2e582c+'\x20references\x20'+_0x5eb2d6+'@'+_0x58bf9e+_0x3a4fdf(0x10a),'FOREIGN_KEY_VIOLATION',{'sourceType':_0x441023,'sourceKey':_0x4ab055,'fieldPath':_0x2e582c,'targetType':_0x5eb2d6,'targetKey':_0x58bf9e}),this[_0x3a4fdf(0x145)]='OKDBForeignKeyError',this['sourceType']=_0x441023,this[_0x3a4fdf(0x139)]=_0x4ab055,this['fieldPath']=_0x2e582c,this[_0x3a4fdf(0x1b6)]=_0x5eb2d6,this['targetKey']=_0x58bf9e;}}class _0x69af44 extends _0x339c63{constructor(_0x1b0997,_0x779256,_0x12087a){const _0x3e5959=_0x1403;super(_0x3e5959(0x141)+_0x1b0997+'@'+_0x779256+':\x20'+_0x12087a[_0x3e5959(0xaa)]+'\x20document(s)\x20reference\x20it\x20with\x20onDelete:restrict','FOREIGN_KEY_DELETE_RESTRICTED',{'targetType':_0x1b0997,'targetKey':_0x779256,'references':_0x12087a}),this[_0x3e5959(0x145)]='OKDBForeignKeyDeleteError',this['targetType']=_0x1b0997,this[_0x3e5959(0x151)]=_0x779256,this['references']=_0x12087a;}}class _0x27c2fd extends _0x339c63{constructor(_0xcbedfd,_0x5521f9,_0x5c939f){const _0x487470=_0x1403;super(_0x487470(0x65)+_0x5521f9+'\x22\x20on\x20\x22'+_0xcbedfd+'\x22\x20is\x20used\x20by:\x20'+_0x5c939f['map'](_0x2c6538=>_0x2c6538['kind']+':'+_0x2c6538[_0x487470(0x145)])[_0x487470(0x167)](',\x20'),_0x487470(0xee),{'type':_0xcbedfd,'index':_0x5521f9,'usedBy':_0x5c939f}),this[_0x487470(0x145)]=_0x487470(0xad);}}return okdbError={'OKDBError':_0x339c63,'OKDBVersionMismatchError':_0x1ab5e0,'OKDBNotFoundError':_0x2ce5d1,'OKDBAlreadyExistsError':_0x593b96,'OKDBInvalidIndexKeyError':_0xdda65c,'OKDBInvalidPrimaryKeyError':_0x5e158e,'OKDBTypeNotRegisteredError':_0x3f67bb,'OKDBTypeAlreadyRegisteredError':_0x1c7b5a,'OKDBIndexNotRegisteredError':_0x4bfbdb,'OKDBIndexAlreadyRegisteredError':_0x521700,'OKDBInvalidValueError':_0x5d4c67,'OKDBUniqueConstraintError':_0x23d793,'OKDBSchemaValidationError':_0x426d05,'OKDBSchemaCollectionError':_0x5d9b63,'OKDBForeignKeyError':_0x3117d2,'OKDBForeignKeyDeleteError':_0x69af44,'OKDBIndexHasConsumersError':_0x27c2fd},okdbError;}var okdbLoopMonitor,hasRequiredOkdbLoopMonitor;function requireOkdbLoopMonitor(){const _0x1b7917=_0x17c8b9;if(hasRequiredOkdbLoopMonitor)return okdbLoopMonitor;hasRequiredOkdbLoopMonitor=0x1;const {monitorEventLoopDelay:_0x35b366,performance:_0x4228aa}=require$$0$1,_0x91e8ed=process.env.OKDB_LOOP_LAG==='1'||process.env.OKDB_LOOP_LAG===_0x1b7917(0x1be),_0x158fec=Number(process.env.OKDB_LOOP_LAG_MS)||0x7d0,_0x1dd06a=process.env.OKDB_LOOP_LAG_ALL==='1',_0x1d8bfe=Number(process.env.OKDB_LOOP_LAG_MIN_MS)||0x64;class _0x18c21c{constructor(){const _0x587965=_0x1b7917;this[_0x587965(0x198)]=_0x91e8ed,this[_0x587965(0x77)]=new Map(),this['_h']=null,this['_timer']=null,this[_0x587965(0x12f)]=![],this['_log']=(_0x1868fc,_0x2b3451)=>process[_0x587965(0x19d)]['write'](_0x1868fc+(_0x2b3451?'\x20'+JSON[_0x587965(0x1d0)](_0x2b3451):'')+'\x0a');}[_0x1b7917(0xfa)](){const _0x4f47cd=_0x1b7917;return _0x4228aa[_0x4f47cd(0xfa)]();}[_0x1b7917(0xbe)](_0x3c76b3){const _0x13b27c=_0x1b7917;if(typeof _0x3c76b3===_0x13b27c(0x74))this[_0x13b27c(0x119)]=_0x3c76b3;}[_0x1b7917(0x153)](_0x2c29df,_0x17f7f3,_0x3e0366){const _0x18b317=_0x1b7917;if(!this[_0x18b317(0x198)])return;let _0x32089b=this[_0x18b317(0x77)][_0x18b317(0x73)](_0x2c29df);!_0x32089b&&(_0x32089b={'ms':0x0,'count':0x0,'maxMs':0x0,'maxExtra':''},this[_0x18b317(0x77)][_0x18b317(0x114)](_0x2c29df,_0x32089b)),_0x32089b['ms']+=_0x17f7f3,_0x32089b[_0x18b317(0x181)]+=0x1,_0x17f7f3>_0x32089b[_0x18b317(0x138)]&&(_0x32089b[_0x18b317(0x138)]=_0x17f7f3,_0x32089b[_0x18b317(0x71)]=_0x3e0366||'');}[_0x1b7917(0xae)](_0x490c64){const _0x5b5ba9=_0x1b7917;if(!this['enabled']||this[_0x5b5ba9(0x12f)])return;this[_0x5b5ba9(0x12f)]=!![];if(_0x490c64)this[_0x5b5ba9(0x119)]=_0x490c64;this['_h']=_0x35b366({'resolution':0xa}),this['_h'][_0x5b5ba9(0x147)](),this[_0x5b5ba9(0x168)]=setInterval(()=>this[_0x5b5ba9(0x1b4)](),_0x158fec);if(this[_0x5b5ba9(0x168)]['unref'])this[_0x5b5ba9(0x168)][_0x5b5ba9(0xb4)]();}[_0x1b7917(0xac)](_0x6ac1c1){const _0xdc8a5f=_0x1b7917;if(!this[_0xdc8a5f(0x112)])this[_0xdc8a5f(0x112)]=new Set();this[_0xdc8a5f(0x112)]['add'](_0x6ac1c1);if(!this[_0xdc8a5f(0x12f)])this[_0xdc8a5f(0x1a9)]();}[_0x1b7917(0x69)](_0x5e74fd){const _0x123c3f=_0x1b7917;this[_0x123c3f(0x112)]?.[_0x123c3f(0x15d)](_0x5e74fd);}['_startAdmission'](){const _0x32924c=_0x1b7917;if(this[_0x32924c(0x72)])return;this[_0x32924c(0x72)]=!![];!this['_h']&&(this['_h']=_0x35b366({'resolution':0xa}),this['_h'][_0x32924c(0x147)]());const _0x33d3c8=_0x158fec;this[_0x32924c(0x140)]=setInterval(()=>{const _0x2b3773=_0x32924c,_0x3e1815=this['_h'];if(!_0x3e1815)return;const _0x568837=_0x3e1815[_0x2b3773(0xa9)](0x63)/0xf4240,_0x2beab6=_0x3e1815[_0x2b3773(0x1c7)]/0xf4240,_0x492fd2=_0x3e1815[_0x2b3773(0x13a)]/0xf4240;_0x3e1815[_0x2b3773(0x191)]();if(this[_0x2b3773(0x112)])for(const _0x293d06 of this[_0x2b3773(0x112)]){try{_0x293d06({'p99Ms':_0x568837,'maxMs':_0x2beab6,'meanMs':_0x492fd2,'reportMs':_0x33d3c8});}catch{}}},_0x33d3c8);if(this[_0x32924c(0x140)][_0x32924c(0xb4)])this[_0x32924c(0x140)][_0x32924c(0xb4)]();}[_0x1b7917(0x1b4)](){const _0x104759=_0x1b7917,_0x357df7=this['_h'],_0x49d67b=_0x357df7[_0x104759(0x1c7)]/0xf4240,_0x1e6508=_0x357df7[_0x104759(0xa9)](0x63)/0xf4240,_0x432b62=_0x357df7[_0x104759(0x13a)]/0xf4240;_0x357df7[_0x104759(0x191)]();const _0x254494=[...this[_0x104759(0x77)]['entries']()]['map'](([_0x5ad551,_0x4c61de])=>({'label':_0x5ad551,..._0x4c61de}))['sort']((_0x40672f,_0x16a010)=>_0x16a010['ms']-_0x40672f['ms'])[_0x104759(0xb7)](0x0,0x8);this[_0x104759(0x77)][_0x104759(0xdf)]();const _0x4ac2a3=_0x254494[_0x104759(0x13d)]((_0x254e82,_0x2538df)=>_0x254e82+_0x2538df['ms'],0x0),_0x4ebd37=_0x254494['map'](_0x5f18d9=>_0x5f18d9[_0x104759(0x179)]+'='+_0x5f18d9['ms']['toFixed'](0x0)+'ms/'+_0x5f18d9[_0x104759(0x181)]+(_0x5f18d9[_0x104759(0x138)]>0x5?_0x104759(0x82)+_0x5f18d9[_0x104759(0x138)][_0x104759(0xdb)](0x0)+'ms'+(_0x5f18d9[_0x104759(0x71)]?'\x20'+_0x5f18d9[_0x104759(0x71)]:'')+')':''));(_0x1dd06a||_0x49d67b>=_0x1d8bfe)&&this[_0x104759(0x119)](_0x104759(0x148)+_0x158fec+_0x104759(0xc6)+_0x49d67b[_0x104759(0xdb)](0x0)+_0x104759(0x131)+_0x1e6508[_0x104759(0xdb)](0x0)+_0x104759(0x93)+_0x432b62[_0x104759(0xdb)](0x0)+_0x104759(0xe7)+_0x4ac2a3['toFixed'](0x0)+'ms'+(_0x4ebd37[_0x104759(0xaa)]?'\x20│\x20'+_0x4ebd37[_0x104759(0x167)]('\x20\x20'):''),{'feature':_0x104759(0x133)});if(this[_0x104759(0x112)])for(const _0x310ef0 of this['_windowCbs']){try{_0x310ef0({'p99Ms':_0x1e6508,'maxMs':_0x49d67b,'meanMs':_0x432b62,'reportMs':_0x158fec});}catch{}}}[_0x1b7917(0xe0)](){const _0x5723ba=_0x1b7917;if(this[_0x5723ba(0x168)])clearInterval(this[_0x5723ba(0x168)]);if(this['_h'])this['_h'][_0x5723ba(0x199)]();this[_0x5723ba(0x168)]=null,this['_h']=null,this[_0x5723ba(0x12f)]=![];}}const _0x45fd13=new _0x18c21c();if(_0x45fd13[_0x1b7917(0x198)])_0x45fd13[_0x1b7917(0xae)]();return okdbLoopMonitor={'LOOP':_0x45fd13},okdbLoopMonitor;}var okdbTransaction,hasRequiredOkdbTransaction;function requireOkdbTransaction(){const _0x29ab7d=_0x17c8b9;if(hasRequiredOkdbTransaction)return okdbTransaction;hasRequiredOkdbTransaction=0x1;const _0x1c3bf0=require$$0$2,{EVENTS:_0x2bf331}=requireOkdbEnums(),{OKDBError:_0xfe62ed}=requireOkdbError(),{LOOP:_0x20544b}=requireOkdbLoopMonitor();function _0xd630e9(_0x5ee014){const _0x2af538=_0x1403;return _0x5ee014[_0x2af538(0x162)](_0x868274=>{const _0x49ae5e=_0x2af538,[_0x37b360,_0x121494]=_0x868274[_0x49ae5e(0xaf)]||[];return{'action':_0x868274['action'],'type':_0x37b360,'key':_0x121494};});}class _0x53d5f1{['okdb'];['actions']=[];['_doHooks']=[];[_0x29ab7d(0x16c)]=[];constructor(_0xe5ad28,_0x587c3b={'useReadTransaction':![]}){const _0x1dc65c=_0x29ab7d;this[_0x1dc65c(0x83)]=_0xe5ad28,this['options']=_0x587c3b,this['id']=_0x1c3bf0['v4'](),this[_0x1dc65c(0x190)]=this[_0x1dc65c(0x10f)][_0x1dc65c(0xd3)]?this[_0x1dc65c(0x83)]['db'][_0x1dc65c(0xd3)]():null,this[_0x1dc65c(0x8d)]=![];}[_0x29ab7d(0x6a)](_0x1a1c2c){const _0x1f766c=_0x29ab7d;this[_0x1f766c(0x15f)][_0x1f766c(0xc5)](_0x1a1c2c);}[_0x29ab7d(0x113)](_0x31e72f){const _0x246ba7=_0x29ab7d;this['_undoHooks'][_0x246ba7(0xc5)](_0x31e72f);}[_0x29ab7d(0xcc)](){const _0x49e98d=_0x29ab7d;if(!this['readTransaction'])return;try{this[_0x49e98d(0x190)][_0x49e98d(0xa4)]();}catch(_0x45b224){}this['readTransaction']=null;}[_0x29ab7d(0x170)](){const _0x8313da=_0x29ab7d;if(this['_closed'])throw new _0xfe62ed(_0x8313da(0xd8),_0x8313da(0x134));}[_0x29ab7d(0x73)](_0x281cda,_0x157548){const _0x10c988=_0x29ab7d;return this[_0x10c988(0x170)](),this[_0x10c988(0x83)]['get'](_0x281cda,_0x157548,{'transaction':this[_0x10c988(0x190)]});}[_0x29ab7d(0x110)](_0x12a9dc,_0x3bb1ae){const _0x189334=_0x29ab7d;return this[_0x189334(0x170)](),this[_0x189334(0x83)]['getEntry'](_0x12a9dc,_0x3bb1ae,{'transaction':this[_0x189334(0x190)]});}[_0x29ab7d(0xb2)](_0xff7b91,_0xc8d3bf){const _0x473328=_0x29ab7d;return this[_0x473328(0x170)](),this[_0x473328(0x83)][_0x473328(0xb2)](_0xff7b91,_0xc8d3bf,{'transaction':this['readTransaction']});}[_0x29ab7d(0x13f)](_0x545afc,_0x588062={}){const _0x5097d1=_0x29ab7d;return this['_assertOpen'](),this['okdb'][_0x5097d1(0x13f)](_0x545afc,{'transaction':this['readTransaction'],..._0x588062});}[_0x29ab7d(0xf5)](_0x19b2b7,_0x26cd18={}){const _0xc9dff5=_0x29ab7d;return this[_0xc9dff5(0x170)](),this['okdb'][_0xc9dff5(0xf5)](_0x19b2b7,{'transaction':this['readTransaction'],..._0x26cd18});}['getKeys'](_0x5abc52,_0x48b838={}){const _0x4cd8cd=_0x29ab7d;return this['_assertOpen'](),this['okdb'][_0x4cd8cd(0x118)](_0x5abc52,{'transaction':this[_0x4cd8cd(0x190)],..._0x48b838});}[_0x29ab7d(0x163)](_0x10c67b,_0x5e0cd7,_0x527329={}){const _0x5b79c5=_0x29ab7d;return this['_assertOpen'](),this[_0x5b79c5(0x83)][_0x5b79c5(0x163)](_0x10c67b,_0x5e0cd7,{'transaction':this[_0x5b79c5(0x190)],..._0x527329});}[_0x29ab7d(0x7f)](_0x5a4823,_0x36c125,_0x5d3bb2={}){const _0x10cee7=_0x29ab7d;return this[_0x10cee7(0x170)](),this[_0x10cee7(0x83)][_0x10cee7(0x7f)](_0x5a4823,_0x36c125,{'transaction':this['readTransaction'],..._0x5d3bb2});}['getClock'](_0x5e673c=null){const _0x33a850=_0x29ab7d;return this['_assertOpen'](),this[_0x33a850(0x83)]['getClock'](_0x5e673c,{'transaction':this[_0x33a850(0x190)]});}[_0x29ab7d(0xca)](_0x258c41){const _0x2c1590=_0x29ab7d;return this[_0x2c1590(0x170)](),this[_0x2c1590(0x83)]['getCount'](_0x258c41,{'transaction':this[_0x2c1590(0x190)]});}['put'](_0xb4cbea,_0x87b705,_0x32afba,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x104690=_0x29ab7d;this['actions'][_0x104690(0xc5)]({'action':'put','args':[_0xb4cbea,_0x87b705,_0x32afba,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x195)](_0x5457f3,_0x33c163,_0x337abc,{ifVersion:ifVersion=null,version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x4edb63=_0x29ab7d;this[_0x4edb63(0x1af)][_0x4edb63(0xc5)]({'action':_0x4edb63(0x195),'args':[_0x5457f3,_0x33c163,_0x337abc,{'ifVersion':ifVersion,'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x189)](_0x431eda,_0x267ce0,_0x3f7903,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x29ab7d(0xfa)](),origin:origin=null,ttl:ttl=null}={}){const _0x396cb4=_0x29ab7d;this[_0x396cb4(0x1af)][_0x396cb4(0xc5)]({'action':_0x396cb4(0x189),'args':[_0x431eda,_0x267ce0,_0x3f7903,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x116)](_0x94344e,_0xb7e373,_0x26bd84,{version:version=null,timestamp:timestamp=Date['now'](),origin:origin=null,ttl:ttl=null}={}){const _0x22853d=_0x29ab7d;this[_0x22853d(0x1af)][_0x22853d(0xc5)]({'action':_0x22853d(0x116),'args':[_0x94344e,_0xb7e373,_0x26bd84,{'version':version,'timestamp':timestamp,'origin':origin,'ttl':ttl}]});}[_0x29ab7d(0x12d)](_0x2457bf,_0x535ac8,{ifVersion:ifVersion=null,timestamp:timestamp=Date[_0x29ab7d(0xfa)](),origin:origin=null}={}){const _0x38f3b8=_0x29ab7d;this['actions'][_0x38f3b8(0xc5)]({'action':_0x38f3b8(0x12d),'args':[_0x2457bf,_0x535ac8,{'ifVersion':ifVersion,'timestamp':timestamp,'origin':origin}]});}[_0x29ab7d(0x152)](_0x10deba,_0xc796a5,_0x32c494){const _0x283f2e=_0x29ab7d;this[_0x283f2e(0x1af)][_0x283f2e(0xc5)]({'action':_0x283f2e(0x152),'args':[_0x10deba,_0xc796a5,_0x32c494]});}['clearTTL'](_0x31d0f9,_0xd5d52b){const _0x200355=_0x29ab7d;this[_0x200355(0x1af)][_0x200355(0xc5)]({'action':_0x200355(0x14c),'args':[_0x31d0f9,_0xd5d52b]});}[_0x29ab7d(0xb9)](){const _0x2b7f83=_0x29ab7d;if(this[_0x2b7f83(0x8d)])return;for(const _0x55da2f of this[_0x2b7f83(0x16c)]){try{_0x55da2f();}catch{}}this[_0x2b7f83(0x83)][_0x2b7f83(0x64)]['emit'](_0x2bf331[_0x2b7f83(0xba)],{'id':this['id']}),this[_0x2b7f83(0x1af)]=[],this[_0x2b7f83(0xcc)](),this[_0x2b7f83(0x8d)]=!![];}async[_0x29ab7d(0xe2)](){const _0x1aa3dc=_0x29ab7d;if(this[_0x1aa3dc(0x8d)])throw new Error(_0x1aa3dc(0xd8));const _0xf4007c={'id':this['id'],'timestamp':Date['now'](),'actions':this[_0x1aa3dc(0x1af)]};this['okdb']['events'][_0x1aa3dc(0x99)](_0x2bf331['TXN_START'],_0xf4007c);try{const _0x293380=_0x20544b[_0x1aa3dc(0x198)]?_0x20544b[_0x1aa3dc(0xfa)]():0x0;await this['okdb']['_writer'][_0x1aa3dc(0x106)](()=>{const _0x2f1c1e=_0x1aa3dc;for(const _0x259ca4 of this[_0x2f1c1e(0x1af)]){const _0x53e50f=this[_0x2f1c1e(0x83)]['_'+_0x259ca4[_0x2f1c1e(0x1b7)]];if(typeof _0x53e50f!==_0x2f1c1e(0x74))throw new Error('Unknown\x20transaction\x20action:\x20'+_0x259ca4[_0x2f1c1e(0x1b7)]);_0x53e50f[_0x2f1c1e(0x1ad)](this[_0x2f1c1e(0x83)],this,..._0x259ca4[_0x2f1c1e(0xaf)]);}}),_0x20544b[_0x1aa3dc(0x198)]&&_0x20544b[_0x1aa3dc(0x153)](_0x1aa3dc(0xa5),_0x20544b['now']()-_0x293380,(this[_0x1aa3dc(0x83)]['name']??'?')+_0x1aa3dc(0x19c)+this[_0x1aa3dc(0x1af)]['length']);}catch(_0x255357){for(const _0x20ae3c of this[_0x1aa3dc(0x16c)]){try{_0x20ae3c();}catch{}}this[_0x1aa3dc(0xcc)](),this[_0x1aa3dc(0x8d)]=!![];if(_0x255357 instanceof _0xfe62ed)throw _0x255357;const _0x310243={'cause':_0x255357,'env':this[_0x1aa3dc(0x83)]?.[_0x1aa3dc(0x145)],'envPath':this[_0x1aa3dc(0x83)]?.[_0x1aa3dc(0x18b)],'pid':process[_0x1aa3dc(0x1c6)],'txnId':this['id'],'actionCount':this[_0x1aa3dc(0x1af)][_0x1aa3dc(0xaa)],'actions':_0xd630e9(this[_0x1aa3dc(0x1af)]),'nativeCode':_0x255357?.['code'],'nativeName':_0x255357?.[_0x1aa3dc(0x145)]};try{this['okdb']?.[_0x1aa3dc(0x17c)]?.[_0x1aa3dc(0x192)]?.('transaction\x20commit\x20failed',{'env':_0x310243[_0x1aa3dc(0xf6)],'envPath':_0x310243[_0x1aa3dc(0x8c)],'pid':_0x310243[_0x1aa3dc(0x1c6)],'txnId':_0x310243[_0x1aa3dc(0x87)],'actionCount':_0x310243[_0x1aa3dc(0xc2)],'actions':_0x310243[_0x1aa3dc(0x1af)],'nativeCode':_0x310243[_0x1aa3dc(0xe1)],'error':_0x255357?.[_0x1aa3dc(0x132)],'stack':_0x255357?.[_0x1aa3dc(0x174)]});}catch{}throw new _0xfe62ed(_0x255357?.[_0x1aa3dc(0x132)]||'Unknown\x20OKDB\x20transaction\x20error','TXN_ERROR',_0x310243);}this['okdb'][_0x1aa3dc(0x64)][_0x1aa3dc(0x99)](_0x2bf331[_0x1aa3dc(0x6f)],_0xf4007c);for(const _0x176e86 of this[_0x1aa3dc(0x15f)]){try{await _0x176e86();}catch{}}this[_0x1aa3dc(0x1af)]=[],this['_closeReadTransaction'](),this[_0x1aa3dc(0x8d)]=!![];}static[_0x29ab7d(0x183)](_0x718b28){const _0x6558a5=_0x29ab7d;return Object[_0x6558a5(0x1c4)]({'id':_0x718b28['id'],'put':_0x718b28[_0x6558a5(0xcd)][_0x6558a5(0x128)](_0x718b28),'update':_0x718b28[_0x6558a5(0x195)]['bind'](_0x718b28),'patch':_0x718b28[_0x6558a5(0x189)][_0x6558a5(0x128)](_0x718b28),'create':_0x718b28['create'][_0x6558a5(0x128)](_0x718b28),'remove':_0x718b28['remove'][_0x6558a5(0x128)](_0x718b28),'setTTL':_0x718b28['setTTL'][_0x6558a5(0x128)](_0x718b28),'clearTTL':_0x718b28[_0x6558a5(0x14c)][_0x6558a5(0x128)](_0x718b28),'commit':_0x718b28[_0x6558a5(0xe2)][_0x6558a5(0x128)](_0x718b28),'rollback':_0x718b28['rollback'][_0x6558a5(0x128)](_0x718b28),'get':_0x718b28[_0x6558a5(0x73)][_0x6558a5(0x128)](_0x718b28),'getEntry':_0x718b28[_0x6558a5(0x110)]['bind'](_0x718b28),'getMany':_0x718b28[_0x6558a5(0xb2)][_0x6558a5(0x128)](_0x718b28),'getRange':_0x718b28[_0x6558a5(0x13f)]['bind'](_0x718b28),'getValues':_0x718b28['getValues'][_0x6558a5(0x128)](_0x718b28),'getKeys':_0x718b28[_0x6558a5(0x118)][_0x6558a5(0x128)](_0x718b28),'byIndex':_0x718b28[_0x6558a5(0x163)][_0x6558a5(0x128)](_0x718b28),'query':_0x718b28['query'][_0x6558a5(0x128)](_0x718b28),'getClock':_0x718b28[_0x6558a5(0x9e)][_0x6558a5(0x128)](_0x718b28),'getCount':_0x718b28[_0x6558a5(0xca)]['bind'](_0x718b28),'read':_0x718b28,'raw':_0x718b28});}static['applyOps'](_0x451809,_0x4f0d18=[]){const _0x2723e4=_0x29ab7d;if(!Array[_0x2723e4(0xce)](_0x4f0d18))throw new _0xfe62ed(_0x2723e4(0x1a6),'TXN_INVALID_OPS');for(const _0x1fe59a of _0x4f0d18){if(Array[_0x2723e4(0xce)](_0x1fe59a)){const [_0x480420,..._0x5a552b]=_0x1fe59a;if(typeof _0x451809[_0x480420]!=='function')throw new _0xfe62ed('Unknown\x20transaction\x20action:\x20'+_0x480420,'TXN_INVALID_ACTION',{'action':_0x480420});_0x451809[_0x480420](..._0x5a552b);continue;}if(!_0x1fe59a||typeof _0x1fe59a!=='object')throw new _0xfe62ed('txn\x20op\x20must\x20be\x20an\x20object\x20or\x20tuple',_0x2723e4(0x16a));const {action:_0x13ee30}=_0x1fe59a;if(typeof _0x13ee30!==_0x2723e4(0x108)||typeof _0x451809[_0x13ee30]!==_0x2723e4(0x74))throw new _0xfe62ed(_0x2723e4(0x169)+_0x13ee30,_0x2723e4(0xfd),{'action':_0x13ee30});switch(_0x13ee30){case _0x2723e4(0xcd):case'update':case'create':_0x451809[_0x13ee30](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a[_0x2723e4(0x14f)],_0x1fe59a[_0x2723e4(0x1c9)],{..._0x1fe59a[_0x2723e4(0x10f)],'ttl':_0x1fe59a[_0x2723e4(0x109)]??_0x1fe59a[_0x2723e4(0x10f)]?.[_0x2723e4(0x109)]??null});break;case _0x2723e4(0x189):_0x451809['patch'](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a[_0x2723e4(0x14f)],_0x1fe59a[_0x2723e4(0x189)],{..._0x1fe59a['options'],'ttl':_0x1fe59a['ttl']??_0x1fe59a[_0x2723e4(0x10f)]?.['ttl']??null});break;case _0x2723e4(0x12d):_0x451809[_0x2723e4(0x12d)](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a['key'],_0x1fe59a[_0x2723e4(0x10f)]||{});break;case'setTTL':_0x451809[_0x2723e4(0x152)](_0x1fe59a['type'],_0x1fe59a[_0x2723e4(0x14f)],_0x1fe59a[_0x2723e4(0x109)]);break;case _0x2723e4(0x14c):_0x451809[_0x2723e4(0x14c)](_0x1fe59a[_0x2723e4(0x91)],_0x1fe59a[_0x2723e4(0x14f)]);break;default:throw new _0xfe62ed(_0x2723e4(0x10d)+_0x13ee30,_0x2723e4(0xfd),{'action':_0x13ee30});}}}static async['run'](_0x1a0adc,_0x451c9e,_0x468a91={}){const _0x259c48=_0x29ab7d,_0x3df53a=new _0x53d5f1(_0x1a0adc,_0x468a91),_0x33574f=_0x53d5f1['createWriteFacade'](_0x3df53a);try{typeof _0x451c9e===_0x259c48(0x74)?await _0x451c9e(_0x33574f):_0x53d5f1['applyOps'](_0x3df53a,_0x451c9e||[]);const _0x7d3337=_0x3df53a[_0x259c48(0x1af)]['length'];return await _0x3df53a[_0x259c48(0xe2)](),{'id':_0x3df53a['id'],'actions':_0x7d3337};}catch(_0x576d22){try{_0x3df53a['rollback']();}catch(_0x16fcf0){}throw _0x576d22;}}}return okdbTransaction=_0x53d5f1,okdbTransaction;}var okdbFunctionsFacades,hasRequiredOkdbFunctionsFacades;function _0x1403(_0xf9f2b1,_0x1535a2){_0xf9f2b1=_0xf9f2b1-0x64;const _0x1c2409=_0x1c24();let _0x1403ed=_0x1c2409[_0xf9f2b1];return _0x1403ed;}function requireOkdbFunctionsFacades(){if(hasRequiredOkdbFunctionsFacades)return okdbFunctionsFacades;hasRequiredOkdbFunctionsFacades=0x1;const _0x3a9ad8=requireOkdbTransaction();function _0x5b81ae(_0xc6f303){const _0x2b7481=_0x1403;return{'transaction':typeof _0xc6f303[_0x2b7481(0x106)]===_0x2b7481(0x74)?_0xc6f303[_0x2b7481(0x106)][_0x2b7481(0x128)](_0xc6f303):_0x53aa29=>new _0x3a9ad8(_0xc6f303,_0x53aa29),'txn':typeof _0xc6f303['txn']===_0x2b7481(0x74)?_0xc6f303[_0x2b7481(0x81)]['bind'](_0xc6f303):(_0x372ea7,_0x3d6dd1)=>_0x3a9ad8['run'](_0xc6f303,_0x372ea7,_0x3d6dd1)};}function _0x25eba3(_0xe406ec){const _0x36f955=_0x1403;return{'name':_0xe406ec['name'],..._0x5b81ae(_0xe406ec),'put':_0xe406ec['put'][_0x36f955(0x128)](_0xe406ec),'update':_0xe406ec[_0x36f955(0x195)][_0x36f955(0x128)](_0xe406ec),'patch':_0xe406ec[_0x36f955(0x189)][_0x36f955(0x128)](_0xe406ec),'create':_0xe406ec[_0x36f955(0x116)][_0x36f955(0x128)](_0xe406ec),'remove':_0xe406ec[_0x36f955(0x12d)]['bind'](_0xe406ec),'get':_0xe406ec[_0x36f955(0x73)][_0x36f955(0x128)](_0xe406ec),'getMany':_0xe406ec[_0x36f955(0xb2)][_0x36f955(0x128)](_0xe406ec),'getEntry':_0xe406ec[_0x36f955(0x110)][_0x36f955(0x128)](_0xe406ec),'getRange':_0xe406ec['getRange'][_0x36f955(0x128)](_0xe406ec),'getValues':_0xe406ec[_0x36f955(0xf5)][_0x36f955(0x128)](_0xe406ec),'getKeys':_0xe406ec[_0x36f955(0x118)][_0x36f955(0x128)](_0xe406ec),'getCount':_0xe406ec[_0x36f955(0xca)][_0x36f955(0x128)](_0xe406ec),'getByPrefix':_0xe406ec['getByPrefix'][_0x36f955(0x128)](_0xe406ec),'getIndex':_0xe406ec['getIndex'][_0x36f955(0x128)](_0xe406ec),'byIndex':_0xe406ec[_0x36f955(0x163)][_0x36f955(0x128)](_0xe406ec),'query':_0xe406ec[_0x36f955(0x7f)][_0x36f955(0x128)](_0xe406ec),'geoQuery':_0xe406ec[_0x36f955(0x15c)][_0x36f955(0x128)](_0xe406ec),'ftsQuery':_0xe406ec[_0x36f955(0x150)][_0x36f955(0x128)](_0xe406ec),'setTTL':_0xe406ec['setTTL'][_0x36f955(0x128)](_0xe406ec),'getTTL':_0xe406ec[_0x36f955(0x17d)]['bind'](_0xe406ec),'clearTTL':_0xe406ec['clearTTL'][_0x36f955(0x128)](_0xe406ec),'sweepExpiredTTL':_0xe406ec[_0x36f955(0xf7)][_0x36f955(0x128)](_0xe406ec),'listTTL':_0xe406ec[_0x36f955(0x94)][_0x36f955(0x128)](_0xe406ec),'ttlStats':_0xe406ec['ttlStats'][_0x36f955(0x128)](_0xe406ec),'setDefaultTTL':_0xe406ec[_0x36f955(0x107)][_0x36f955(0x128)](_0xe406ec),'getDefaultTTL':_0xe406ec[_0x36f955(0x135)][_0x36f955(0x128)](_0xe406ec),'clearDefaultTTL':_0xe406ec[_0x36f955(0x122)][_0x36f955(0x128)](_0xe406ec),'registerType':_0xe406ec[_0x36f955(0xd2)]['bind'](_0xe406ec),'ensureType':_0xe406ec[_0x36f955(0x1c5)][_0x36f955(0x128)](_0xe406ec),'hasType':_0xe406ec[_0x36f955(0x6b)][_0x36f955(0x128)](_0xe406ec),'dropType':_0xe406ec[_0x36f955(0xc1)][_0x36f955(0x128)](_0xe406ec),'registerIndex':_0xe406ec['registerIndex'][_0x36f955(0x128)](_0xe406ec),'hasIndex':_0xe406ec['hasIndex'][_0x36f955(0x128)](_0xe406ec),'dropIndex':_0xe406ec[_0x36f955(0x10b)]['bind'](_0xe406ec),'resetIndex':_0xe406ec['resetIndex'][_0x36f955(0x128)](_0xe406ec),'indexReady':_0xe406ec[_0x36f955(0xa0)][_0x36f955(0x128)](_0xe406ec),'getIndexStatus':_0xe406ec[_0x36f955(0xda)][_0x36f955(0x128)](_0xe406ec),'getClock':_0xe406ec[_0x36f955(0x9e)]['bind'](_0xe406ec),'getChanges':_0xe406ec[_0x36f955(0x117)][_0x36f955(0x128)](_0xe406ec),'count':_0xe406ec['count'][_0x36f955(0x128)](_0xe406ec),'range':_0xe406ec[_0x36f955(0x14e)][_0x36f955(0x128)](_0xe406ec),'now':_0xe406ec[_0x36f955(0xfa)][_0x36f955(0x128)](_0xe406ec)};}function _0x2fa408(_0x231509){const _0x4e646c=_0x1403;if(!_0x231509)return null;const _0x2771d9={};for(const _0x38538e of[_0x4e646c(0x164),_0x4e646c(0x18f),_0x4e646c(0x18c),_0x4e646c(0x159),_0x4e646c(0xd5),_0x4e646c(0x12c),'getBucket',_0x4e646c(0x90)]){if(typeof _0x231509[_0x38538e]==='function')_0x2771d9[_0x38538e]=_0x231509[_0x38538e]['bind'](_0x231509);}return Object[_0x4e646c(0x100)](_0x2771d9)[_0x4e646c(0xaa)]?_0x2771d9:null;}function _0x2d61ce(_0x5657ff){const _0x1f21a3=_0x1403;if(!_0x5657ff)return null;const _0x3913a4={};for(const _0x3355eb of[_0x1f21a3(0x144),_0x1f21a3(0x17e),_0x1f21a3(0x12d),'get','list','getByPath']){if(typeof _0x5657ff[_0x3355eb]===_0x1f21a3(0x74))_0x3913a4[_0x3355eb]=_0x5657ff[_0x3355eb][_0x1f21a3(0x128)](_0x5657ff);}return Object[_0x1f21a3(0x100)](_0x3913a4)['length']?_0x3913a4:null;}function _0x1aaa2f(_0xef6f84){const _0x161e90=_0x1403;return{'env':_0xef6f84[_0x161e90(0xf6)][_0x161e90(0x128)](_0xef6f84),'createEnvironment':_0xef6f84[_0x161e90(0xef)][_0x161e90(0x128)](_0xef6f84),'removeEnvironment':_0xef6f84['removeEnvironment'][_0x161e90(0x128)](_0xef6f84),'info':_0xef6f84[_0x161e90(0x7e)],..._0x5b81ae(_0xef6f84),'put':_0xef6f84[_0x161e90(0xcd)][_0x161e90(0x128)](_0xef6f84),'update':_0xef6f84[_0x161e90(0x195)][_0x161e90(0x128)](_0xef6f84),'patch':_0xef6f84[_0x161e90(0x189)][_0x161e90(0x128)](_0xef6f84),'create':_0xef6f84[_0x161e90(0x116)][_0x161e90(0x128)](_0xef6f84),'remove':_0xef6f84[_0x161e90(0x12d)][_0x161e90(0x128)](_0xef6f84),'get':_0xef6f84['get']['bind'](_0xef6f84),'getMany':_0xef6f84[_0x161e90(0xb2)][_0x161e90(0x128)](_0xef6f84),'getEntry':_0xef6f84[_0x161e90(0x110)][_0x161e90(0x128)](_0xef6f84),'getRange':_0xef6f84[_0x161e90(0x13f)][_0x161e90(0x128)](_0xef6f84),'getValues':_0xef6f84[_0x161e90(0xf5)][_0x161e90(0x128)](_0xef6f84),'getKeys':_0xef6f84[_0x161e90(0x118)][_0x161e90(0x128)](_0xef6f84),'getCount':_0xef6f84[_0x161e90(0xca)][_0x161e90(0x128)](_0xef6f84),'getByPrefix':_0xef6f84['getByPrefix'][_0x161e90(0x128)](_0xef6f84),'getIndex':_0xef6f84[_0x161e90(0x75)][_0x161e90(0x128)](_0xef6f84),'byIndex':_0xef6f84['byIndex'][_0x161e90(0x128)](_0xef6f84),'query':_0xef6f84['query'][_0x161e90(0x128)](_0xef6f84),'setTTL':_0xef6f84[_0x161e90(0x152)][_0x161e90(0x128)](_0xef6f84),'getTTL':_0xef6f84[_0x161e90(0x17d)][_0x161e90(0x128)](_0xef6f84),'clearTTL':_0xef6f84[_0x161e90(0x14c)][_0x161e90(0x128)](_0xef6f84),'sweepExpiredTTL':_0xef6f84[_0x161e90(0xf7)]['bind'](_0xef6f84),'listTTL':_0xef6f84[_0x161e90(0x94)]['bind'](_0xef6f84),'ttlStats':_0xef6f84[_0x161e90(0x185)][_0x161e90(0x128)](_0xef6f84),'setDefaultTTL':_0xef6f84[_0x161e90(0x107)][_0x161e90(0x128)](_0xef6f84),'getDefaultTTL':_0xef6f84[_0x161e90(0x135)][_0x161e90(0x128)](_0xef6f84),'clearDefaultTTL':_0xef6f84['clearDefaultTTL'][_0x161e90(0x128)](_0xef6f84),'ensureType':_0xef6f84[_0x161e90(0x1c5)][_0x161e90(0x128)](_0xef6f84),'registerType':_0xef6f84[_0x161e90(0xd2)][_0x161e90(0x128)](_0xef6f84),'hasType':_0xef6f84[_0x161e90(0x6b)][_0x161e90(0x128)](_0xef6f84),'dropType':_0xef6f84[_0x161e90(0xc1)][_0x161e90(0x128)](_0xef6f84),'registerIndex':_0xef6f84[_0x161e90(0xd1)][_0x161e90(0x128)](_0xef6f84),'hasIndex':_0xef6f84['hasIndex']['bind'](_0xef6f84),'dropIndex':_0xef6f84[_0x161e90(0x10b)]['bind'](_0xef6f84),'resetIndex':_0xef6f84[_0x161e90(0x88)][_0x161e90(0x128)](_0xef6f84),'indexReady':_0xef6f84[_0x161e90(0xa0)][_0x161e90(0x128)](_0xef6f84),'getIndexStatus':_0xef6f84[_0x161e90(0xda)][_0x161e90(0x128)](_0xef6f84),'getClock':_0xef6f84[_0x161e90(0x9e)]['bind'](_0xef6f84),'getChanges':_0xef6f84['getChanges'][_0x161e90(0x128)](_0xef6f84),'queue':_0xef6f84[_0x161e90(0x115)],'files':_0xef6f84[_0x161e90(0x105)]};}return okdbFunctionsFacades={'createEnvFacade':_0x25eba3,'createQueueFacade':_0x2fa408,'createFilesFacade':_0x2d61ce,'createGlobalFacade':_0x1aaa2f},okdbFunctionsFacades;}var okdbFunctionsDryrun,hasRequiredOkdbFunctionsDryrun;function requireOkdbFunctionsDryrun(){const _0x208243=_0x17c8b9;if(hasRequiredOkdbFunctionsDryrun)return okdbFunctionsDryrun;hasRequiredOkdbFunctionsDryrun=0x1;const _0x32ce75=new Set([_0x208243(0xcd),_0x208243(0x189),_0x208243(0x116),_0x208243(0x12d),_0x208243(0x195),_0x208243(0x152),_0x208243(0x14c),_0x208243(0xf7),'setDefaultTTL','clearDefaultTTL','dropType',_0x208243(0x10b),'resetIndex']),_0x36cb51=new Set([_0x208243(0x164),'updateJob',_0x208243(0xd5),'addBucket']),_0x8447e4=new Set([_0x208243(0x144),'remove']);function _0xf51cef(_0x9a5b50,_0x323b26){const _0x56b3aa=_0x208243;if(_0x9a5b50==='env'||_0x9a5b50==='global')return _0x32ce75[_0x56b3aa(0x14b)](_0x323b26);if(_0x9a5b50===_0x56b3aa(0x115))return _0x36cb51[_0x56b3aa(0x14b)](_0x323b26);if(_0x9a5b50===_0x56b3aa(0x105))return _0x8447e4[_0x56b3aa(0x14b)](_0x323b26);return![];}function _0xfcd78d(_0xf36093,_0x2f480a,_0x2ebb49,_0x494a94){if(!_0xf36093)return _0xf36093;return new Proxy(_0xf36093,{'get'(_0x3de567,_0x1015dc,_0x330f17){const _0x369bec=_0x1403,_0x43dd69=Reflect['get'](_0x3de567,_0x1015dc,_0x330f17);if(typeof _0x43dd69!==_0x369bec(0x74))return _0x43dd69;if(!_0xf51cef(_0x2f480a,_0x1015dc))return _0x43dd69['bind'](_0x3de567);return function(..._0x111cf1){const _0x486a04=_0x369bec;return _0x494a94[_0x486a04(0xc5)]({'scope':_0x2f480a,'method':_0x1015dc,'envName':_0x2ebb49,'args':_0x111cf1}),null;};}});}function _0xdf3db4(_0x25228e,_0x537b6b,_0x218e59,_0x45c380){const _0x449c12={};for(const _0x298243 of _0x218e59){_0x449c12[_0x298243]=(..._0x42a2d5)=>{const _0x34a6ef=_0x1403;return _0xf51cef(_0x25228e,_0x298243)&&_0x45c380[_0x34a6ef(0xc5)]({'scope':_0x25228e,'method':_0x298243,'envName':_0x537b6b,'args':_0x42a2d5}),null;};}return _0x449c12;}return okdbFunctionsDryrun={'isWriteMethod':_0xf51cef,'wrapForDryRun':_0xfcd78d,'syntheticDryRunFacade':_0xdf3db4,'ENV_WRITE_METHODS':_0x32ce75,'QUEUE_WRITE_METHODS':_0x36cb51,'FILES_WRITE_METHODS':_0x8447e4},okdbFunctionsDryrun;}var okdbFunctionsContext,hasRequiredOkdbFunctionsContext;function requireOkdbFunctionsContext(){const _0x182a78=_0x17c8b9;if(hasRequiredOkdbFunctionsContext)return okdbFunctionsContext;hasRequiredOkdbFunctionsContext=0x1;const {createEnvFacade:_0x42789f,createQueueFacade:_0x1ec890,createFilesFacade:_0x3779a0,createGlobalFacade:_0x13aff4}=requireOkdbFunctionsFacades(),{wrapForDryRun:_0x148525,syntheticDryRunFacade:_0x328dd3}=requireOkdbFunctionsDryrun(),_0x523a56=[_0x182a78(0x164),_0x182a78(0x18f),_0x182a78(0x18c),'updateJob',_0x182a78(0xd5),_0x182a78(0x12c),_0x182a78(0xc9),_0x182a78(0x90)],_0xae119=[_0x182a78(0x144),_0x182a78(0x17e),'remove',_0x182a78(0x73),_0x182a78(0x18c),_0x182a78(0x7c)];function _0xda0b96(_0x4206c7,_0x484539){const _0x599bc0=_0x182a78,_0xf4e7e8=(_0x5637c1,_0x10a8bf,_0x27d38e)=>_0x484539({'type':_0x599bc0(0x17c),'requestId':_0x4206c7['requestId'],'runId':_0x4206c7[_0x599bc0(0x12a)],'entry':{'level':_0x5637c1,'msg':_0x10a8bf,'context':_0x27d38e,'ts':Date[_0x599bc0(0xfa)]()}}),_0x5dd92f=(_0x277ea1,_0xb263c4)=>_0xf4e7e8(_0x599bc0(0x7e),_0x277ea1,_0xb263c4);return _0x5dd92f[_0x599bc0(0x7e)]=(_0x552d7b,_0x6f8c7e)=>_0xf4e7e8(_0x599bc0(0x7e),_0x552d7b,_0x6f8c7e),_0x5dd92f[_0x599bc0(0x194)]=(_0x9733fa,_0x1c0cbe)=>_0xf4e7e8('warn',_0x9733fa,_0x1c0cbe),_0x5dd92f[_0x599bc0(0x192)]=(_0x113cba,_0x38e1a4)=>_0xf4e7e8(_0x599bc0(0x192),_0x113cba,_0x38e1a4),_0x5dd92f['debug']=(_0x4fbd53,_0x4c6c59)=>_0xf4e7e8(_0x599bc0(0xb5),_0x4fbd53,_0x4c6c59),_0x5dd92f;}function _0x26ae00(_0x50284e,_0x56a0b0,_0xa02570){const _0x4727f2=_0x182a78;if(!_0x50284e)return null;return{'id':_0x50284e['id']??null,'type':_0x50284e['type']??null,'tries':_0x50284e[_0x4727f2(0x9d)]??null,'created':_0x50284e[_0x4727f2(0x187)]??null,'tags':_0x50284e['tags']??null,'priority':_0x50284e[_0x4727f2(0xf9)]??null,'bucket':_0x50284e[_0x4727f2(0x156)]??null,'cron':_0x50284e[_0x4727f2(0x1ca)]??null,'heartbeat'(){const _0x2e0bf4=_0x4727f2;_0xa02570({'type':_0x2e0bf4(0xec),'requestId':_0x56a0b0['requestId'],'runId':_0x56a0b0[_0x2e0bf4(0x12a)],'jobId':_0x50284e['id'],'claimId':_0x50284e[_0x2e0bf4(0x1a3)]});},'markProgress'(_0x27a170){const _0x264970=_0x4727f2;_0xa02570({'type':_0x264970(0x10e),'requestId':_0x56a0b0[_0x264970(0xd6)],'runId':_0x56a0b0[_0x264970(0x12a)],'jobId':_0x50284e['id'],'claimId':_0x50284e[_0x264970(0x1a3)],'message':_0x27a170});}};}function _0x2e732c(_0x2ed454){const _0x2ff0e5=_0x182a78;if(!_0x2ed454)return null;return{'mode':_0x2ed454[_0x2ff0e5(0x1b0)]??null,'sourceType':_0x2ed454[_0x2ff0e5(0x177)]??null,'sourceEnv':_0x2ed454[_0x2ff0e5(0x111)]??null,'processor':_0x2ed454[_0x2ff0e5(0xea)]??null,'engineKey':_0x2ed454[_0x2ff0e5(0x182)]??null,'cursorKey':_0x2ed454[_0x2ff0e5(0xbb)]??null};}function _0x5be1c6(_0x4b9829){const _0x4b8adc=_0x182a78;if(!_0x4b9829)return null;return{'mode':_0x4b9829[_0x4b8adc(0x1b0)]??null,'sourceType':_0x4b9829[_0x4b8adc(0x177)]??null,'targetType':_0x4b9829[_0x4b8adc(0x1b6)]??null,'sourceEnv':_0x4b9829['sourceEnv']??null,'targetEnv':_0x4b9829['targetEnv']??null,'engineKey':_0x4b9829[_0x4b8adc(0x182)]??null,'cursorKey':_0x4b9829[_0x4b8adc(0xbb)]??null};}function _0x1417b6(_0x4ee70f,_0x10d092,_0x424717,_0x1dbe80=null,_0x485b08=null){const _0x2c0c9b=_0x182a78,_0x43f52d={'runId':_0x10d092[_0x2c0c9b(0x12a)],'scope':_0x2c0c9b(0xf6),'env':_0x10d092[_0x2c0c9b(0xcb)]??null,'functionName':_0x10d092[_0x2c0c9b(0x124)],'trigger':_0x10d092[_0x2c0c9b(0x7e)]?.['trigger']??_0x2c0c9b(0x123),'requestedAt':_0x10d092[_0x2c0c9b(0x7e)]?.[_0x2c0c9b(0x70)]??Date[_0x2c0c9b(0xfa)]()},_0x3146a4=_0xda0b96(_0x10d092,_0x424717),_0x95dedb=AbortSignal[_0x2c0c9b(0x125)](Math['max'](0x1,_0x10d092['runtime']?.[_0x2c0c9b(0x11e)]??0x3e8)),_0x169001=_0x485b08?AbortSignal[_0x2c0c9b(0xb0)]([_0x95dedb,_0x485b08]):_0x95dedb,_0x5f41ca=_0x4ee70f[_0x2c0c9b(0xf6)](_0x10d092[_0x2c0c9b(0xcb)]),_0x1485c8=_0x1dbe80?_0x148525(_0x5f41ca,_0x2c0c9b(0xf6),_0x10d092['envName'],_0x1dbe80):_0x5f41ca,_0x1394b1=_0x1dbe80?_0x5f41ca['queue']?_0x148525(_0x5f41ca['queue'],'queue',_0x10d092[_0x2c0c9b(0xcb)],_0x1dbe80):_0x328dd3('queue',_0x10d092[_0x2c0c9b(0xcb)],_0x523a56,_0x1dbe80):_0x5f41ca['queue'],_0x1910fe=_0x1dbe80?_0x5f41ca[_0x2c0c9b(0x105)]?_0x148525(_0x5f41ca['files'],_0x2c0c9b(0x105),_0x10d092[_0x2c0c9b(0xcb)],_0x1dbe80):_0x328dd3('files',_0x10d092[_0x2c0c9b(0xcb)],_0xae119,_0x1dbe80):_0x5f41ca['files'],_0x548aef=_0x42789f(_0x1485c8),_0x1e6dd6=_0x1ec890(_0x1394b1),_0x246d17=_0x3779a0(_0x1910fe);if(_0x1e6dd6)_0x548aef[_0x2c0c9b(0x115)]=_0x1e6dd6;if(_0x246d17)_0x548aef[_0x2c0c9b(0x105)]=_0x246d17;const _0x3fcc3b={'payload':_0x10d092[_0x2c0c9b(0x12e)]??null,'info':_0x43f52d,'signal':_0x169001,'log':_0x3146a4,'env':_0x548aef},_0x43dca5=_0x26ae00(_0x10d092[_0x2c0c9b(0x1a4)],_0x10d092,_0x424717);if(_0x43dca5)_0x3fcc3b['job']=_0x43dca5;const _0x5274cf=_0x2e732c(_0x10d092[_0x2c0c9b(0x14a)]);if(_0x5274cf)_0x3fcc3b[_0x2c0c9b(0xea)]=_0x5274cf;const _0x208dfb=_0x5be1c6(_0x10d092[_0x2c0c9b(0xb8)]);if(_0x208dfb)_0x3fcc3b[_0x2c0c9b(0xb6)]=_0x208dfb;if(_0x10d092['unsafe']){const _0xf20af5=_0x1dbe80?_0x148525(_0x4ee70f,_0x2c0c9b(0x18d),null,_0x1dbe80):_0x4ee70f;_0x3fcc3b[_0x2c0c9b(0x83)]=_0x13aff4(_0xf20af5);}return _0x3fcc3b;}return okdbFunctionsContext={'createExecutionContext':_0x1417b6,'createScriptLogger':_0xda0b96},okdbFunctionsContext;}var hasRequiredOkdbFunctionsSandboxWorker;function requireOkdbFunctionsSandboxWorker(){const _0x5b83a6=_0x17c8b9;if(hasRequiredOkdbFunctionsSandboxWorker)return okdbFunctionsSandboxWorker$1;hasRequiredOkdbFunctionsSandboxWorker=0x1;const {parentPort:_0xd738b5,workerData:_0x452f76}=require$$0$3;requireOkdbFatalReport()[_0x5b83a6(0xe8)]('sandbox');const _0x4b298f=require$$2,{compileFunctionExpression:_0x33ef02}=requireOkdbFunctionsSandbox(),{serializeError:_0x13d0ca}=requireOkdbFunctionsIpc(),{createExecutionContext:_0x59827a}=requireOkdbFunctionsContext(),_0x4dcecc=require$$6;let _0x38f9b4=null,_0x3e3d00=![];const _0x46bda1=new Map(),_0x39b031=new Map();function _0x2cb42c(_0x29e1f5){const _0x4a5054=_0x5b83a6;try{_0xd738b5[_0x4a5054(0x14d)](_0x29e1f5);}catch{}}function _0xc3069c(_0x2888b5){const _0x24760c=_0x5b83a6,_0x487796=(_0x2888b5[_0x24760c(0xcb)]||_0x24760c(0x1c2))+':'+_0x2888b5[_0x24760c(0x124)]+':'+_0x2888b5[_0x24760c(0x98)]+':'+_0x2888b5[_0x24760c(0x18a)];let _0x51d26b=_0x46bda1[_0x24760c(0x73)](_0x487796);return!_0x51d26b&&(_0x51d26b=_0x33ef02(_0x2888b5[_0x24760c(0x66)],{'allowFetch':_0x2888b5['runtime']?.[_0x24760c(0x6c)]!==![],'allowedFetchDomains':_0x2888b5[_0x24760c(0xfb)]?.[_0x24760c(0x136)],'filename':_0x2888b5[_0x24760c(0x124)]+'.okdb-function.js'}),_0x46bda1[_0x24760c(0x114)](_0x487796,_0x51d26b)),_0x51d26b;}async function _0x31f060(_0x2b72d2){const _0x160202=_0x5b83a6,_0xddb339=Date[_0x160202(0xfa)](),_0x590e74=new AbortController();_0x39b031[_0x160202(0x114)](_0x2b72d2[_0x160202(0xd6)],_0x590e74);try{const _0x5c6782=_0xc3069c(_0x2b72d2);if(_0x2b72d2[_0x160202(0xcb)])await _0x38f9b4[_0x160202(0x67)](_0x2b72d2[_0x160202(0xcb)]);const _0x537943=_0x2b72d2['dryRun']?[]:null,_0x25c281=_0x59827a(_0x38f9b4,_0x2b72d2,_0x2cb42c,_0x537943,_0x590e74[_0x160202(0x1a5)]),_0x42cc62=await _0x5c6782(_0x25c281),_0x17b73b={'type':'result','requestId':_0x2b72d2[_0x160202(0xd6)],'runId':_0x2b72d2[_0x160202(0x12a)],'result':_0x42cc62,'meta':{'runnerId':_0x160202(0x12b)+process[_0x160202(0x1c6)],'startedAt':_0xddb339,'finishedAt':Date['now'](),'durationMs':Date[_0x160202(0xfa)]()-_0xddb339}};if(_0x537943)_0x17b73b[_0x160202(0x89)]=_0x537943;_0x2cb42c(_0x17b73b);}catch(_0x4b7922){_0x2cb42c({'type':'error','requestId':_0x2b72d2[_0x160202(0xd6)],'runId':_0x2b72d2[_0x160202(0x12a)],'error':_0x13d0ca(_0x4b7922),'meta':{'runnerId':_0x160202(0x12b)+process[_0x160202(0x1c6)],'startedAt':_0xddb339,'finishedAt':Date[_0x160202(0xfa)](),'durationMs':Date['now']()-_0xddb339}});}finally{_0x39b031['delete'](_0x2b72d2[_0x160202(0xd6)]);}}async function _0x4ce826(){if(_0x3e3d00)return;_0x3e3d00=!![];try{await _0x38f9b4?.['close']?.();}catch{}process['exit'](0x0);}async function _0x1f5184(){const _0x1b25fd=_0x5b83a6,{rootPath:_0x54cf6c}=_0x452f76??{};if(!_0x54cf6c)throw new Error(_0x1b25fd(0xf1));_0x38f9b4=new _0x4dcecc(_0x54cf6c,{'engines':![],'processors':![],'compaction':![],'http':![],'auth':{'open':!![]},'processes':![]}),await _0x38f9b4[_0x1b25fd(0x1c0)]();const _0x230d5a=setInterval(()=>{const _0x5a28d3=_0x1b25fd;if(_0x3e3d00)return;for(const [,_0x28bd4d]of _0x38f9b4[_0x5a28d3(0x18e)]){try{_0x28bd4d['_drainHandler']?.();}catch{}}},0xc8);if(typeof _0x230d5a['unref']===_0x1b25fd(0x74))_0x230d5a[_0x1b25fd(0xb4)]();_0xd738b5['on'](_0x1b25fd(0x132),_0x24d7ce=>{const _0x36aa91=_0x1b25fd;if(!_0x24d7ce||typeof _0x24d7ce!==_0x36aa91(0x15a))return;if(_0x24d7ce[_0x36aa91(0x91)]==='stop')return void _0x4ce826();if(_0x24d7ce[_0x36aa91(0x91)]===_0x36aa91(0x11a)){_0x39b031[_0x36aa91(0x73)](_0x24d7ce[_0x36aa91(0xd6)])?.[_0x36aa91(0x102)](new Error('cancelled\x20by\x20caller'));return;}_0x24d7ce[_0x36aa91(0x91)]===_0x36aa91(0x80)&&void _0x31f060(_0x24d7ce[_0x36aa91(0x79)]);});const _0x140b54=Math[_0x1b25fd(0x1c7)](0x3e8,Number(process.env.OKDB_STATS_INTERVAL_MS)||0x1388),_0xcbfe58=setInterval(()=>{const _0x4528d6=_0x1b25fd;try{_0x2cb42c({'type':_0x4528d6(0x154),'heapUsed':_0x4b298f[_0x4528d6(0x196)]()[_0x4528d6(0x9c)]});}catch{}},_0x140b54);if(typeof _0xcbfe58[_0x1b25fd(0xb4)]===_0x1b25fd(0x74))_0xcbfe58[_0x1b25fd(0xb4)]();_0x2cb42c({'type':_0x1b25fd(0x8e)});}return _0x1f5184()[_0x5b83a6(0xff)](_0x1da701=>{const _0x29ed4f=_0x5b83a6;_0x2cb42c({'type':_0x29ed4f(0x19a),'error':_0x13d0ca(_0x1da701)}),process[_0x29ed4f(0xbd)](0x1);}),okdbFunctionsSandboxWorker$1;}var okdbFunctionsSandboxWorkerExports=requireOkdbFunctionsSandboxWorker(),okdbFunctionsSandboxWorker=getDefaultExportFromCjs(okdbFunctionsSandboxWorkerExports);module[_0x17c8b9(0x8b)]=okdbFunctionsSandboxWorker;function _0x1c24(){const _0x587cc6=['3128406etxnLJ','ttlStats','OKDBInvalidValueError','created','OKDBIndexAlreadyRegisteredError','patch','hash','path','list','global','_envs','getJob','readTransaction','reset','error','fetch\x20is\x20not\x20allowed\x20in\x20this\x20function\x20sandbox\x20(no\x20allowedFetchDomains\x20configured)','warn','update','getHeapStatistics','5802480harfWB','enabled','disable','fatal','fetch\x20blocked:\x20hostname\x20\x22','\x20actions=','stderr','__esModule','license:removed','ALREADY_EXISTS','\x27\x20doesn\x27t\x20exist','OKDBTypeNotRegisteredError','claimId','jobContext','signal','txn\x20ops\x20must\x20be\x20an\x20array','\x20already\x20exists','OKDBUniqueConstraintError','_startAdmission','OKDBInvalidPrimaryKeyError','index:progress','TYPE_NOT_REGISTERED','call','system:clock_change','actions','mode','1359916YlfEXR','fetch\x20blocked:\x20invalid\x20URL','system:drain','_report','clearTtl','targetType','action','reportOnFatalError','default','SCHEMA_COLLECTION_INVALID','schema:drop','Foreign\x20key\x20violation:\x20','stopped','true','FETCH_NOT_ALLOWED','open','fts:drop','~system','failures','freeze','ensureType','pid','max','3818514GSEJiL','value','cron','\x27\x20is\x20already\x20registered','\x20does\x20not\x20exist','844669PUJzrz','1241397aiuoAX','license:invalid','stringify','events','Index\x20\x22','script','openEnv','createContext','offWindow','onDo','hasType','allowFetch','size','Function\x20script\x20failed\x20to\x20compile','TXN_END','requestedAt','maxExtra','_admissionStarted','get','function','getIndex','schema:set','_buckets','ttl:expired','job','ttl:set','okdb-function.js','getByPath','captureStackTrace','info','query','run','txn','(worst\x20','okdb','ref:violation','hasOwnProperty','6638505IkTVof','txnId','resetIndex','dryRunActions','resetFts','exports','envPath','_closed','ready','Invalid\x20primary\x20key\x20type:\x20','listBuckets','type','FUNCTION_SCRIPT_COMPILE_FAILED','ms\x20mean=','listTTL',',\x20got\x20','system:proc',':\x20expected\x20','version','emit','runInContext','system:bus_state_change','used_heap_size','tries','getClock','system:env_release','indexReady','index:drop','Cannot\x20set\x20enforce\x20schema\x20on\x20','stopping','done','txn-commit','INVALID_VALUE','reject','cause','percentile','length','details','onWindow','OKDBIndexHasConsumersError','start','args','any','crypto','getMany','Index\x20\x27','unref','debug','materializer','slice','materializerContext','rollback','TXN_ROLLBACK','cursorKey','dropping','exit','setLogger','.\x20Only\x20primitives,\x20null,\x20Buffers,\x20and\x20arrays\x20are\x20allowed.\x20Got:\x20','system:ready','dropType','actionCount','node:perf_hooks',']\x20already\x20maps\x20to\x20\x27','push','ms\x20max=','env:opened','OKDBTypeAlreadyRegisteredError','getBucket','getCount','envName','_closeReadTransaction','put','isArray','mkdirSync','unique:violation_resolved','registerIndex','registerType','useReadTransaction','Invalid\x20index\x20key\x20type\x20for\x20\x27','removeJob','requestId','.\x20Primary\x20keys\x20must\x20be\x20string\x20or\x20number.\x20Got:\x20','Transaction\x20already\x20closed','SCHEMA_VALIDATION_FAILED','getIndexStatus','toFixed','license:added','txn:rollback','bus:poke','clear','stop','nativeCode','commit','OKDBAlreadyExistsError','\x27:\x20','globalThis','halted','ms\x20busy=','enableFatalReport','Unique\x20constraint\x20violated\x20on\x20','processor','hostname','job_heartbeat','system:stopped','INDEX_HAS_CONSUMERS','createEnvironment','OKDBNotFoundError','sandbox\x20worker:\x20rootPath\x20missing\x20from\x20workerData','constructor','url','\x27\x20on\x20type\x20\x27','getValues','env','sweepExpiredTTL','code','priority','now','runtime','\x27\x20already\x20registered','TXN_INVALID_ACTION','report','catch','keys','waiting','abort','started','excludeEnv','files','transaction','setDefaultTTL','string','ttl','\x20which\x20does\x20not\x20exist','dropIndex','system:poke','Unsupported\x20transaction\x20action:\x20','job_progress','options','getEntry','sourceEnv','_windowCbs','onUndo','set','queue','create','getChanges','getKeys','_log','cancel','INVALID_INDEX_KEY','ref:violation_resolved','prototype','timeoutMs','Type\x20\x27','type:registered','starting','clearDefaultTTL','sdk','functionName','timeout','item:remove','dropFts','bind','Function\x20script\x20failed\x20to\x20initialize','runId','sandbox-','addBucket','remove','payload','_started','compileTimeoutMs','ms\x20p99=','message','loop-lag','TXN_CLOSED','getDefaultTTL','allowedFetchDomains','64DOVzvo','maxMs','sourceKey','mean','\x27,\x20cannot\x20map\x20to\x20\x27','ttl:clear','reduce','directory','getRange','_admissionTimer','Cannot\x20delete\x20','VERSION_MISMATCH','index:ready','upload','name','30nxPyoL','enable','loop-lag\x20','node:vm','processorContext','has','clearTTL','postMessage','range','key','ftsQuery','targetKey','setTTL','note','stats','view:progress','bucket','setSchema','txn:start','updateJob','object','bus:drain','geoQuery','delete','setTtl','_doHooks','\x22\x20is\x20not\x20in\x20the\x20allowedFetchDomains\x20list','fts:reset','map','byIndex','enqueue',':\x20key\x20[','filename','join','_timer','Unknown\x20transaction\x20action:\x20','TXN_INVALID_OP','fetch','_undoHooks','INDEX_ALREADY_REGISTERED','SIGSEGV','\x20documents\x20fail\x20validation','_assertOpen','OKDBInvalidIndexKeyError','NOT_FOUND','bus:type_drop','stack','INDEX_NOT_REGISTERED','Function\x20script\x20must\x20evaluate\x20to\x20a\x20callable\x20function','sourceType','bus:proc','label','type:drop','reportOnSignal','log','getTTL','stream','dropSchema','worker_threads','count','engineKey','createWriteFacade'];_0x1c24=function(){return _0x587cc6;};return _0x1c24();}