boom-format 0.9.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.
- package/LICENSE +127 -0
- package/README.md +1079 -0
- package/SPECIFICATION.md +404 -0
- package/deno.json +15 -0
- package/dist/boom.min.cjs +17 -0
- package/dist/boom.min.js +1 -0
- package/dist/boom.obf.js +1 -0
- package/dist/chunk-5PQH6SJJ.js +5148 -0
- package/dist/cli.cjs +4241 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.global.js +4249 -0
- package/dist/cli.js +313 -0
- package/dist/index.cjs +5211 -0
- package/dist/index.d.cts +779 -0
- package/dist/index.d.ts +779 -0
- package/dist/index.global.js +5172 -0
- package/dist/index.js +82 -0
- package/package.json +96 -0
- package/samples/README.md +114 -0
- package/samples/api-response.boom +0 -0
- package/samples/api-response.boom.txt +1 -0
- package/samples/api-response.json +19 -0
- package/samples/config.boom +0 -0
- package/samples/config.boom.txt +1 -0
- package/samples/config.json +22 -0
- package/samples/users.boom +0 -0
- package/samples/users.boom.txt +1 -0
- package/samples/users.json +31 -0
package/SPECIFICATION.md
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
# BOOM Format Specification v1.0
|
|
2
|
+
|
|
3
|
+
**Binary Object Optimised Markup**
|
|
4
|
+
|
|
5
|
+
BOOM is a compact binary serialisation format with an optional human-readable debug representation. It aims for minimal wire size while remaining debuggable.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Design Goals
|
|
10
|
+
|
|
11
|
+
1. **Smaller than JSON** - 60-80% size reduction typical
|
|
12
|
+
2. **Fast parsing** - Single-pass, no backtracking
|
|
13
|
+
3. **Debuggable** - Readable `.boom.txt` equivalent
|
|
14
|
+
4. **Self-describing** - No schema required
|
|
15
|
+
5. **Streamable** - Can process without loading entire document
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Binary Format (.boom)
|
|
20
|
+
|
|
21
|
+
### Header
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Offset Size Description
|
|
25
|
+
0 4 Magic bytes: 0x42 0x4F 0x4F 0x4D ("BOOM")
|
|
26
|
+
4 1 Version: 0x01
|
|
27
|
+
5 1 Flags (reserved, set to 0x00)
|
|
28
|
+
6 ... Root value
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Type Markers
|
|
32
|
+
|
|
33
|
+
Each value is prefixed with a single type byte:
|
|
34
|
+
|
|
35
|
+
| Byte | Type | Description |
|
|
36
|
+
|------|------|-------------|
|
|
37
|
+
| 0x00 | null | No additional data |
|
|
38
|
+
| 0x01 | false | No additional data |
|
|
39
|
+
| 0x02 | true | No additional data |
|
|
40
|
+
| 0x10 | int8 | 1 byte signed integer |
|
|
41
|
+
| 0x11 | int16 | 2 bytes signed integer (little-endian) |
|
|
42
|
+
| 0x12 | int32 | 4 bytes signed integer (little-endian) |
|
|
43
|
+
| 0x13 | int64 | 8 bytes signed integer (little-endian) |
|
|
44
|
+
| 0x14 | uint8 | 1 byte unsigned integer |
|
|
45
|
+
| 0x15 | uint16 | 2 bytes unsigned integer (little-endian) |
|
|
46
|
+
| 0x16 | uint32 | 4 bytes unsigned integer (little-endian) |
|
|
47
|
+
| 0x17 | uint64 | 8 bytes unsigned integer (little-endian) |
|
|
48
|
+
| 0x18 | varint | Variable-length unsigned integer |
|
|
49
|
+
| 0x19 | svarint | Variable-length signed integer (zigzag) |
|
|
50
|
+
| 0x20 | float32 | 4 bytes IEEE 754 |
|
|
51
|
+
| 0x21 | float64 | 8 bytes IEEE 754 |
|
|
52
|
+
| 0x30 | string | Varint length + UTF-8 bytes |
|
|
53
|
+
| 0x31 | binary | Varint length + raw bytes |
|
|
54
|
+
| 0x40 | array | Varint count + values |
|
|
55
|
+
| 0x50 | object | Varint count + key-value pairs |
|
|
56
|
+
| 0x60 | ref | Varint index (string interning) |
|
|
57
|
+
| 0x70 | table | Row-major tabular encoding |
|
|
58
|
+
| 0x71 | nested_table | Nested table within table |
|
|
59
|
+
| 0x72 | nested_object | Nested object within table |
|
|
60
|
+
| 0x73 | columnar | Column-major tabular encoding (compression-optimized) |
|
|
61
|
+
| 0x74 | rle_const | Run-length encoded constant column |
|
|
62
|
+
| 0x80 | packed_int8 | Packed array of int8 values |
|
|
63
|
+
| 0x81 | packed_int16 | Packed array of int16 values |
|
|
64
|
+
| 0x82 | packed_int32 | Packed array of int32 values |
|
|
65
|
+
| 0x83 | packed_float32 | Packed array of float32 values |
|
|
66
|
+
| 0x84 | packed_float64 | Packed array of float64 values |
|
|
67
|
+
| 0x85 | packed_bool | Bit-packed array of booleans |
|
|
68
|
+
|
|
69
|
+
### Variable-Length Integers (Varint)
|
|
70
|
+
|
|
71
|
+
Uses continuation bit encoding (like protobuf):
|
|
72
|
+
- Bits 0-6: Data
|
|
73
|
+
- Bit 7: Continuation flag (1 = more bytes follow)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
0-127: 1 byte (0xxxxxxx)
|
|
77
|
+
128-16383: 2 bytes (1xxxxxxx 0xxxxxxx)
|
|
78
|
+
...
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Signed Varints (Zigzag Encoding)
|
|
82
|
+
|
|
83
|
+
Maps signed to unsigned: `(n << 1) ^ (n >> 63)`
|
|
84
|
+
- 0 → 0, -1 → 1, 1 → 2, -2 → 3, 2 → 4, ...
|
|
85
|
+
|
|
86
|
+
### Strings
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
0x30 <varint:length> <bytes:utf8>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### String Interning
|
|
93
|
+
|
|
94
|
+
For repeated keys/values, strings are stored once in an implicit table:
|
|
95
|
+
- First occurrence: Full string (0x30)
|
|
96
|
+
- Subsequent: Reference (0x60 + varint index)
|
|
97
|
+
|
|
98
|
+
The string table is built during encoding/decoding as strings are encountered.
|
|
99
|
+
|
|
100
|
+
### Arrays
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
0x40 <varint:count> <value>...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Objects
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
0x50 <varint:count> (<string|ref> <value>)...
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Keys must be strings or refs. Order is preserved.
|
|
113
|
+
|
|
114
|
+
### Nested Structures
|
|
115
|
+
|
|
116
|
+
Arrays and objects can contain any value type, including other arrays and objects, to unlimited depth (configurable max).
|
|
117
|
+
|
|
118
|
+
**Nested array example (binary breakdown):**
|
|
119
|
+
```
|
|
120
|
+
// [[1, 2], [3, 4]]
|
|
121
|
+
0x40 // array marker
|
|
122
|
+
0x02 // count: 2 items
|
|
123
|
+
0x40 // array marker (first nested array)
|
|
124
|
+
0x02 // count: 2
|
|
125
|
+
0x10 0x01 // int8: 1
|
|
126
|
+
0x10 0x02 // int8: 2
|
|
127
|
+
0x40 // array marker (second nested array)
|
|
128
|
+
0x02 // count: 2
|
|
129
|
+
0x10 0x03 // int8: 3
|
|
130
|
+
0x10 0x04 // int8: 4
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Nested object example (binary breakdown):**
|
|
134
|
+
```
|
|
135
|
+
// {user: {name: "Tom", address: {city: "Liverpool"}}}
|
|
136
|
+
0x50 // object marker
|
|
137
|
+
0x01 // count: 1 key-value pair
|
|
138
|
+
0x30 0x04 "user" // key: "user"
|
|
139
|
+
0x50 // value: object
|
|
140
|
+
0x02 // count: 2 pairs
|
|
141
|
+
0x30 0x04 "name" // key: "name"
|
|
142
|
+
0x30 0x03 "Tom" // value: "Tom"
|
|
143
|
+
0x30 0x07 "address" // key: "address"
|
|
144
|
+
0x50 // value: nested object
|
|
145
|
+
0x01 // count: 1 pair
|
|
146
|
+
0x30 0x04 "city" // key: "city"
|
|
147
|
+
0x30 0x09 "Liverpool" // value: "Liverpool"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Mixed nesting example:**
|
|
151
|
+
```
|
|
152
|
+
// {matrix: [[1,2],[3,4]], meta: {rows: 2, cols: 2}}
|
|
153
|
+
0x50 // root object
|
|
154
|
+
0x02 // 2 keys
|
|
155
|
+
0x30 0x06 "matrix" // key
|
|
156
|
+
0x40 0x02 // array of 2
|
|
157
|
+
0x40 0x02 // nested array
|
|
158
|
+
0x10 0x01 // 1
|
|
159
|
+
0x10 0x02 // 2
|
|
160
|
+
0x40 0x02 // nested array
|
|
161
|
+
0x10 0x03 // 3
|
|
162
|
+
0x10 0x04 // 4
|
|
163
|
+
0x30 0x04 "meta" // key
|
|
164
|
+
0x50 0x02 // nested object, 2 keys
|
|
165
|
+
0x30 0x04 "rows"
|
|
166
|
+
0x10 0x02 // 2
|
|
167
|
+
0x30 0x04 "cols"
|
|
168
|
+
0x10 0x02 // 2
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Columnar Encoding (0x73)
|
|
172
|
+
|
|
173
|
+
For arrays of uniform objects, BOOM can use column-major encoding which dramatically improves compression ratios. Instead of storing data row-by-row, values are grouped by column, allowing compressors to find patterns more effectively.
|
|
174
|
+
|
|
175
|
+
**Format:**
|
|
176
|
+
```
|
|
177
|
+
0x73 // COLUMNAR marker
|
|
178
|
+
<varint:row_count> // Number of rows
|
|
179
|
+
<varint:col_count> // Number of columns
|
|
180
|
+
<column_names> // Compact format: varint length + UTF-8 bytes (no type marker)
|
|
181
|
+
<column_types> // One byte per column (0x74=RLE_CONST, 0x80-0x85=packed, 0x30=string, 0x40=mixed)
|
|
182
|
+
<column_data> // Data for each column, grouped together
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Column Types:**
|
|
186
|
+
- `0x74` (RLE_CONST): Constant column - single value for all rows
|
|
187
|
+
- `0x80` (PACKED_INT8): All int8 values, no type markers
|
|
188
|
+
- `0x81` (PACKED_INT16): All int16 values
|
|
189
|
+
- `0x82` (PACKED_INT32): All int32 values
|
|
190
|
+
- `0x83` (PACKED_FLOAT32): All float32 values
|
|
191
|
+
- `0x84` (PACKED_FLOAT64): All float64 values
|
|
192
|
+
- `0x85` (PACKED_BOOL): Bit-packed booleans (8 per byte)
|
|
193
|
+
- `0x30` (STRING): String values with type markers
|
|
194
|
+
- `0x40` (ARRAY): Mixed types, full encoding
|
|
195
|
+
|
|
196
|
+
**Example: Tabular data with constant columns**
|
|
197
|
+
```javascript
|
|
198
|
+
// Input: 500 log entries with mostly constant values
|
|
199
|
+
{logs: [
|
|
200
|
+
{timestamp: "2024-01-15T10:30:00Z", level: "info", service: "api", status: 200},
|
|
201
|
+
{timestamp: "2024-01-15T10:30:00Z", level: "warn", service: "api", status: 200},
|
|
202
|
+
// ... 498 more rows
|
|
203
|
+
]}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Binary breakdown:**
|
|
207
|
+
```
|
|
208
|
+
0x50 // root object
|
|
209
|
+
0x01 // 1 key
|
|
210
|
+
0x30 0x04 "logs" // key: "logs"
|
|
211
|
+
0x73 // COLUMNAR marker
|
|
212
|
+
0xF4 0x03 // varint: 500 rows
|
|
213
|
+
0x04 // 4 columns
|
|
214
|
+
|
|
215
|
+
// Column names (compact: length + bytes, no 0x30 marker)
|
|
216
|
+
0x09 "timestamp" // 9 bytes
|
|
217
|
+
0x05 "level" // 5 bytes
|
|
218
|
+
0x07 "service" // 7 bytes
|
|
219
|
+
0x06 "status" // 6 bytes
|
|
220
|
+
|
|
221
|
+
// Column types
|
|
222
|
+
0x74 // timestamp: RLE_CONST (all identical)
|
|
223
|
+
0x30 // level: STRING (varies)
|
|
224
|
+
0x74 // service: RLE_CONST (all identical)
|
|
225
|
+
0x74 // status: RLE_CONST (all identical)
|
|
226
|
+
|
|
227
|
+
// Column data
|
|
228
|
+
// timestamp (constant): single value
|
|
229
|
+
0x30 0x14 "2024-01-15T10:30:00Z"
|
|
230
|
+
|
|
231
|
+
// level (string): 500 values
|
|
232
|
+
0x30 0x04 "info"
|
|
233
|
+
0x30 0x04 "warn"
|
|
234
|
+
// ... 498 more strings
|
|
235
|
+
|
|
236
|
+
// service (constant): single value
|
|
237
|
+
0x30 0x03 "api"
|
|
238
|
+
|
|
239
|
+
// status (constant): single value
|
|
240
|
+
0x10 0xC8 // int8: 200
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Compression Benefits:**
|
|
244
|
+
- JSON: 75,176 bytes → brotli → 137 bytes
|
|
245
|
+
- BOOM columnar: 3,308 bytes → brotli → 132 bytes (**BOOM wins by 5 bytes**)
|
|
246
|
+
|
|
247
|
+
The columnar format is automatically used when `forCompression: true` is set.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Readable Format (.boom.txt)
|
|
252
|
+
|
|
253
|
+
Human-readable equivalent for debugging:
|
|
254
|
+
|
|
255
|
+
```boom
|
|
256
|
+
# This is a comment
|
|
257
|
+
name: "Tom Taylor"
|
|
258
|
+
age: 42
|
|
259
|
+
active: true
|
|
260
|
+
nullable: null
|
|
261
|
+
|
|
262
|
+
# Arrays can be inline or multiline
|
|
263
|
+
tags: ["web" "ai" "performance"]
|
|
264
|
+
|
|
265
|
+
# Nested objects
|
|
266
|
+
company: {
|
|
267
|
+
name: "The Tom Taylor Company"
|
|
268
|
+
since: 2013
|
|
269
|
+
address: {
|
|
270
|
+
city: "Liverpool"
|
|
271
|
+
country: "UK"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
# Deeply nested arrays
|
|
276
|
+
matrix: [
|
|
277
|
+
[1 2 3]
|
|
278
|
+
[4 5 6]
|
|
279
|
+
[7 8 9]
|
|
280
|
+
]
|
|
281
|
+
|
|
282
|
+
# Mixed nesting - arrays of objects
|
|
283
|
+
users: [
|
|
284
|
+
{
|
|
285
|
+
id: 1
|
|
286
|
+
name: "Alice"
|
|
287
|
+
roles: ["admin" "user"]
|
|
288
|
+
}
|
|
289
|
+
{
|
|
290
|
+
id: 2
|
|
291
|
+
name: "Bob"
|
|
292
|
+
roles: ["user"]
|
|
293
|
+
preferences: {
|
|
294
|
+
theme: "dark"
|
|
295
|
+
notifications: {
|
|
296
|
+
email: true
|
|
297
|
+
push: false
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
]
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Syntax Rules
|
|
305
|
+
|
|
306
|
+
- **Strings**: Quoted with `"`, escape with `\`
|
|
307
|
+
- **Numbers**: Bare (auto-detect int vs float)
|
|
308
|
+
- **Booleans**: `true` / `false`
|
|
309
|
+
- **Null**: `null`
|
|
310
|
+
- **Arrays**: `[ ... ]` with newline or space separation
|
|
311
|
+
- **Objects**: `{ ... }` or root-level key-value pairs
|
|
312
|
+
- **Comments**: `#` to end of line
|
|
313
|
+
- **Keys**: Unquoted if alphanumeric, otherwise quoted
|
|
314
|
+
|
|
315
|
+
### Compact Mode
|
|
316
|
+
|
|
317
|
+
Single-line representation:
|
|
318
|
+
|
|
319
|
+
```boom
|
|
320
|
+
{name:"Tom" age:42 active:true tags:["web" "ai"]}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Size Comparison
|
|
326
|
+
|
|
327
|
+
Example document:
|
|
328
|
+
|
|
329
|
+
```json
|
|
330
|
+
{
|
|
331
|
+
"users": [
|
|
332
|
+
{"id": 1, "name": "Alice", "active": true},
|
|
333
|
+
{"id": 2, "name": "Bob", "active": false},
|
|
334
|
+
{"id": 3, "name": "Charlie", "active": true}
|
|
335
|
+
],
|
|
336
|
+
"count": 3,
|
|
337
|
+
"page": 1
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
| Format | Size | Reduction |
|
|
342
|
+
|--------|------|-----------|
|
|
343
|
+
| JSON | 156 bytes | — |
|
|
344
|
+
| JSON minified | 128 bytes | 18% |
|
|
345
|
+
| BOOM binary | 52 bytes | 67% |
|
|
346
|
+
| BOOM txt | 98 bytes | 37% |
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Type Coercion
|
|
351
|
+
|
|
352
|
+
When encoding from JavaScript:
|
|
353
|
+
|
|
354
|
+
| JS Type | BOOM Type |
|
|
355
|
+
|---------|-----------|
|
|
356
|
+
| null | null |
|
|
357
|
+
| boolean | true/false |
|
|
358
|
+
| number (integer, fits int8) | int8 |
|
|
359
|
+
| number (integer, fits int16) | int16 |
|
|
360
|
+
| number (integer, fits int32) | int32 |
|
|
361
|
+
| number (float) | float64 |
|
|
362
|
+
| string | string (with interning) |
|
|
363
|
+
| Array | array |
|
|
364
|
+
| Object | object |
|
|
365
|
+
| Buffer/Uint8Array | binary |
|
|
366
|
+
| BigInt | int64/uint64 |
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Streaming
|
|
371
|
+
|
|
372
|
+
BOOM supports streaming with length-prefixed messages:
|
|
373
|
+
|
|
374
|
+
```
|
|
375
|
+
<varint:message_length> <boom_data>
|
|
376
|
+
<varint:message_length> <boom_data>
|
|
377
|
+
...
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## Security Considerations
|
|
383
|
+
|
|
384
|
+
- Maximum nesting depth: 64 (configurable)
|
|
385
|
+
- Maximum string length: 16MB (configurable)
|
|
386
|
+
- Maximum array/object count: 1M items (configurable)
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## MIME Type
|
|
391
|
+
|
|
392
|
+
- Binary: `application/x-boom`
|
|
393
|
+
- Text: `text/x-boom`
|
|
394
|
+
|
|
395
|
+
## File Extensions
|
|
396
|
+
|
|
397
|
+
- Binary: `.boom`
|
|
398
|
+
- Text: `.boom.txt`
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## License
|
|
403
|
+
|
|
404
|
+
MIT License - Free for any use.
|
package/deno.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@boom/format",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"exports": "./dist/index.js",
|
|
5
|
+
"tasks": {
|
|
6
|
+
"test": "deno test --allow-read test/deno-local.test.ts",
|
|
7
|
+
"bench": "deno bench --allow-read benchmark/deno-bench.ts"
|
|
8
|
+
},
|
|
9
|
+
"imports": {
|
|
10
|
+
"boom-format": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"compilerOptions": {
|
|
13
|
+
"lib": ["deno.window", "esnext"]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of __getOwnPropNames(t))__hasOwnProp.call(e,s)||s===r||__defProp(e,s,{get:()=>t[s],enumerable:!(o=__getOwnPropDesc(t,s))||o.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),index_exports={};__export(index_exports,{BOOM_DICTIONARY_V1:()=>BOOM_DICTIONARY_V1,BOOM_VERSION:()=>VERSION2,BoomError:()=>BoomError,BoomHeaders:()=>BoomHeaders,ByteReader:()=>ByteReader,ByteWriter:()=>ByteWriter,DEFAULT_THRESHOLDS:()=>DEFAULT_THRESHOLDS,MAGIC:()=>MAGIC,StreamDecoder:()=>StreamDecoder,analyzeDictionary:()=>analyzeDictionary,autoInit:()=>autoInit2,boomFetch:()=>boomFetch2,compare:()=>compare,createBoomAxios:()=>createBoomAxios2,createBoomGraphQL:()=>createBoomGraphQL2,createThresholdHeaders:()=>createThresholdHeaders,decode:()=>decode,decodeFromLengthPrefixed:()=>decodeFromLengthPrefixed,decodeSmallest:()=>decodeSmallest,default:()=>index_default,encode:()=>encode,encodeSmallest:()=>encodeSmallest,encodeWithLength:()=>encodeWithLength,estimateSize:()=>estimateSize,fromJSON:()=>fromJSON,fromJSONDirect:()=>fromJSONDirect,getBoomData:()=>getBoomData2,getBoomMode:()=>getBoomMode,getThresholdConfig:()=>getThresholdConfig,parseText:()=>parseText,parseThresholdHeaders:()=>parseThresholdHeaders,processBoomScripts:()=>processBoomScripts2,selectFormat:()=>selectFormat,setBoomMode:()=>setBoomMode,setThresholdConfig:()=>setThresholdConfig,stringify:()=>stringify,toJSON:()=>toJSON,zigzagDecode:()=>zigzagDecode,zigzagEncode:()=>zigzagEncode}),module.exports=__toCommonJS(index_exports);var BoomError=class e extends Error{constructor(t){super(t),this.name="BoomError",Object.setPrototypeOf(this,e.prototype)}};function zigzagEncode(e){return e<<1^e>>31}function zigzagDecode(e){return e>>>1^-(1&e)}var ByteWriter=class{buffer;view;pos=0;capacity;constructor(e=8192){this.capacity=e,this.buffer=new Uint8Array(e),this.view=new DataView(this.buffer.buffer)}grow(e){let t=this.capacity<<1;const r=this.pos+e;for(;t<r;)t<<=1;const o=new Uint8Array(t);o.set(this.buffer.subarray(0,this.pos)),this.buffer=o,this.view=new DataView(this.buffer.buffer),this.capacity=t}write(e){const t=e.length;this.pos+t>this.capacity&&this.grow(t),this.buffer.set(e,this.pos),this.pos+=t}writeByte(e){this.pos>=this.capacity&&this.grow(1),this.buffer[this.pos++]=e}writeInt8(e){this.pos>=this.capacity&&this.grow(1),this.buffer[this.pos++]=255&e}writeInt16LE(e){this.pos+2>this.capacity&&this.grow(2);const t=this.buffer,r=this.pos;t[r]=255&e,t[r+1]=e>>8&255,this.pos=r+2}writeInt32LE(e){this.pos+4>this.capacity&&this.grow(4);const t=this.buffer,r=this.pos;t[r]=255&e,t[r+1]=e>>8&255,t[r+2]=e>>16&255,t[r+3]=e>>24&255,this.pos=r+4}writeBigInt64LE(e){this.pos+8>this.capacity&&this.grow(8),this.view.setBigInt64(this.pos,e,!0),this.pos+=8}writeBigUInt64LE(e){this.pos+8>this.capacity&&this.grow(8),this.view.setBigUint64(this.pos,e,!0),this.pos+=8}writeFloat32LE(e){this.pos+4>this.capacity&&this.grow(4),this.view.setFloat32(this.pos,e,!0),this.pos+=4}writeFloat64LE(e){this.pos+8>this.capacity&&this.grow(8),this.view.setFloat64(this.pos,e,!0),this.pos+=8}writeVarint(e){this.pos+5>this.capacity&&this.grow(5);const t=this.buffer;let r=this.pos,o=e>>>0;for(;o>127;)t[r++]=127&o|128,o>>>=7;t[r++]=o,this.pos=r}writeVarintSmall(e){this.pos+2>this.capacity&&this.grow(2);const t=this.buffer;e<128?t[this.pos++]=e:e<16384?(t[this.pos++]=127&e|128,t[this.pos++]=e>>>7):this.writeVarint(e)}toUint8Array(){return this.buffer.subarray(0,this.pos)}},ByteReader=class{view;offset=0;buf;len;constructor(e){this.buf=e,this.len=e.length,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}get remaining(){return this.len-this.offset}get buffer(){return this.buf}readByte(){return this.buf[this.offset++]}readBytes(e){const t=this.offset;return this.offset+=e,this.buf.subarray(t,this.offset)}readInt8(){const e=this.buf[this.offset++];return e>127?e-256:e}readInt16LE(){const e=this.buf,t=this.offset;this.offset=t+2;const r=e[t]|e[t+1]<<8;return r>32767?r-65536:r}readInt32LE(){const e=this.buf,t=this.offset;return this.offset=t+4,e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}readBigInt64LE(){const e=this.view.getBigInt64(this.offset,!0);return this.offset+=8,e}readUInt8(){return this.buf[this.offset++]}readUInt16LE(){const e=this.buf,t=this.offset;return this.offset=t+2,e[t]|e[t+1]<<8}readUInt32LE(){const e=this.buf,t=this.offset;return this.offset=t+4,(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}readBigUInt64LE(){const e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readFloat32LE(){const e=this.view.getFloat32(this.offset,!0);return this.offset+=4,e}readFloat64LE(){const e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readVarint(){const e=this.buf;let t=this.offset,r=e[t++];if(r<128)return this.offset=t,r;let o=127&r;return r=e[t++],r<128?(this.offset=t,o|r<<7):(o|=(127&r)<<7,r=e[t++],r<128?(this.offset=t,o|r<<14):(o|=(127&r)<<14,r=e[t++],r<128?(this.offset=t,o|r<<21):(o|=(127&r)<<21,r=e[t++],this.offset=t,(o|r<<28)>>>0)))}},VERSION=1,BOOM_DICTIONARY_V1=Object.freeze(["id","name","type","content","data","value","text","message","status","error","result","code","key","index","role","model","user","items","count","total","page","size","url","path","title","body","query","token","version","created","updated","source","success","response","request","payload","params","headers","method","endpoint","description","label","meta","info","details","options","config","settings","enabled","disabled","active","visible","required","optional","default","custom","input","output","format","encoding","language","locale","timezone","currency","choices","delta","finish_reason","usage","prompt_tokens","completion_tokens","total_tokens","messages","assistant","system","function","tool","tools","tool_calls","tool_call","arguments","stream","chunk","object","chat","completion","completions","embedding","embeddings","logprobs","top_logprobs","stop","stop_reason","stop_sequence","max_tokens","temperature","top_p","pending","completed","failed","cancelled","processing","queued","running","stopped","ok","done","ready","loading","waiting","blocked","paused","resumed","open","closed","connected","disconnected","online","offline","available","unavailable","valid","invalid","verified","unverified","approved","rejected","expired","revoked","GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","content-type","authorization","accept","accept-encoding","cache-control","user-agent","origin","referer","application/json","application/octet-stream","text/plain","text/html","multipart/form-data","Bearer","Basic","gzip","x-request-id","x-correlation-id","x-api-key","x-auth-token","etag","last-modified","if-none-match","if-modified-since","created_at","updated_at","deleted_at","expires_at","started_at","ended_at","published_at","modified_at","createdAt","updatedAt","deletedAt","expiresAt","startedAt","endedAt","publishedAt","modifiedAt","start_date","end_date","due_date","birth_date","timestamp","datetime","date","time","year","month","day","hour","minute","second","millisecond","duration","username","password","email","phone","address","avatar","profile","session","firstName","lastName","fullName","displayName","first_name","last_name","full_name","display_name","roles","permissions","groups","teams","organization","company","department","position","access_token","refresh_token","id_token","api_key","client_id","client_secret","scope","grant_type","string","number","boolean","integer","float","double","decimal","bigint","array","object","null","undefined","binary","base64","hex","uuid","json","xml","html","csv","yaml","markdown","plain","rich","utf8","utf-8","ascii","latin1","iso-8859-1","unicode","emoji","symbol","errors","warnings","exception","stack","trace","cause","reason","context","error_code","error_message","error_type","error_details","errorCode","errorMessage","errorType","errorDetails","not_found","unauthorized","forbidden","bad_request","server_error","timeout","conflict","rate_limit","notFound","badRequest","serverError","rateLimit","validation_error","parse_error","network_error","unknown_error","list","items","records","entries","rows","columns","fields","values","limit","offset","cursor","next_cursor","prev_cursor","has_more","total_count","page_count","first","last","next","previous","current","per_page","page_size","page_number","sort","order","filter","search","asc","desc","ascending","descending","category","categories","tag","tags","parent","children","ancestors","descendants","price","amount","quantity","unit","discount","tax","subtotal","grand_total","image","images","file","files","document","documents","attachment","attachments","link","links","href","ref","reference","references","relation","relations","event","events","action","actions","trigger","handler","callback","listener","click","submit","change","load","error","success","start","end","create","read","update","delete","insert","remove","add","set","get","put","post","patch","fetch","send","receive","process","metric","metrics","stat","stats","analytics","tracking","telemetry","logging","latency","throughput","bandwidth","cpu","memory","disk","network","io","requests","responses","errors","successes","failures","retries","timeouts","rate","min","max","avg","sum","p50","p90","p95","p99"]),DICTIONARY_LOOKUP=new Map(BOOM_DICTIONARY_V1.map((e,t)=>[e,t]));function analyzeDictionary(e){const t=new Map;!function e(r){if(null!=r)if("string"!=typeof r){if(Array.isArray(r))for(const t of r)e(t);else if("object"==typeof r)for(const o in r)t.set(o,(t.get(o)||0)+1),e(r[o])}else t.set(r,(t.get(r)||0)+1)}(e);const r=[],o=[];let s=0,n=0,i=0,a=0;for(const[e,c]of t){s+=c;const t=DICTIONARY_LOOKUP.get(e);if(void 0!==t)n+=c,r.push({string:e,index:t,count:c});else{i+=c;const t=2+(new TextEncoder).encode(e).length+2*(c-1)-2*c;t>0&&c>=2&&(o.push({string:e,count:c,potentialSavings:t}),a+=t)}}return o.sort((e,t)=>t.potentialSavings-e.potentialSavings),r.sort((e,t)=>t.count-e.count),{inDictionary:r,missingStrings:o,stats:{totalStrings:s,uniqueStrings:t.size,dictionaryHits:n,dictionaryMisses:i,dictionaryHitRate:s>0?n/s:0,potentialSavingsBytes:a}}}var DEFAULT_OPTIONS={maxDepth:64,maxStringLength:16777216,maxArrayLength:1e6,enableInterning:!0,skipHeader:!1,forCompression:!1,useBuiltInDictionary:!0,sharedDictionary:void 0,strictBinaryMode:!1};function mergeOptions(e,t){return{...e,...t}}function zigzagDecode2(e){return e>>>1^-(1&e)}var ByteWriter2=class{buffer;view;pos=0;capacity;constructor(e=8192){this.capacity=e,this.buffer=new Uint8Array(e),this.view=new DataView(this.buffer.buffer)}grow(e){let t=this.capacity<<1;const r=this.pos+e;for(;t<r;)t<<=1;const o=new Uint8Array(t);o.set(this.buffer.subarray(0,this.pos)),this.buffer=o,this.view=new DataView(this.buffer.buffer),this.capacity=t}write(e){const t=e.length;this.pos+t>this.capacity&&this.grow(t),this.buffer.set(e,this.pos),this.pos+=t}writeByte(e){this.pos>=this.capacity&&this.grow(1),this.buffer[this.pos++]=e}writeInt8(e){this.pos>=this.capacity&&this.grow(1),this.buffer[this.pos++]=255&e}writeInt16LE(e){this.pos+2>this.capacity&&this.grow(2);const t=this.buffer,r=this.pos;t[r]=255&e,t[r+1]=e>>8&255,this.pos=r+2}writeInt32LE(e){this.pos+4>this.capacity&&this.grow(4);const t=this.buffer,r=this.pos;t[r]=255&e,t[r+1]=e>>8&255,t[r+2]=e>>16&255,t[r+3]=e>>24&255,this.pos=r+4}writeBigInt64LE(e){this.pos+8>this.capacity&&this.grow(8),this.view.setBigInt64(this.pos,e,!0),this.pos+=8}writeBigUInt64LE(e){this.pos+8>this.capacity&&this.grow(8),this.view.setBigUint64(this.pos,e,!0),this.pos+=8}writeFloat32LE(e){this.pos+4>this.capacity&&this.grow(4),this.view.setFloat32(this.pos,e,!0),this.pos+=4}writeFloat64LE(e){this.pos+8>this.capacity&&this.grow(8),this.view.setFloat64(this.pos,e,!0),this.pos+=8}writeVarint(e){this.pos+5>this.capacity&&this.grow(5);const t=this.buffer;let r=this.pos,o=e>>>0;for(;o>127;)t[r++]=127&o|128,o>>>=7;t[r++]=o,this.pos=r}writeVarintSmall(e){this.pos+2>this.capacity&&this.grow(2);const t=this.buffer;e<128?t[this.pos++]=e:e<16384?(t[this.pos++]=127&e|128,t[this.pos++]=e>>>7):this.writeVarint(e)}toUint8Array(){return this.buffer.subarray(0,this.pos)}},ByteReader2=class{view;offset=0;buf;len;constructor(e){this.buf=e,this.len=e.length,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}get remaining(){return this.len-this.offset}readByte(){return this.buf[this.offset++]}readBytes(e){const t=this.offset;return this.offset+=e,this.buf.subarray(t,this.offset)}readInt8(){const e=this.buf[this.offset++];return e>127?e-256:e}readInt16LE(){const e=this.buf,t=this.offset;this.offset=t+2;const r=e[t]|e[t+1]<<8;return r>32767?r-65536:r}readInt32LE(){const e=this.buf,t=this.offset;return this.offset=t+4,e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}readBigInt64LE(){const e=this.view.getBigInt64(this.offset,!0);return this.offset+=8,e}readUInt8(){return this.buf[this.offset++]}readUInt16LE(){const e=this.buf,t=this.offset;return this.offset=t+2,e[t]|e[t+1]<<8}readUInt32LE(){const e=this.buf,t=this.offset;return this.offset=t+4,(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}readBigUInt64LE(){const e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readFloat32LE(){const e=this.view.getFloat32(this.offset,!0);return this.offset+=4,e}readFloat64LE(){const e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readVarint(){const e=this.buf;let t=this.offset,r=e[t++];if(r<128)return this.offset=t,r;let o=127&r;return r=e[t++],r<128?(this.offset=t,o|r<<7):(o|=(127&r)<<7,r=e[t++],r<128?(this.offset=t,o|r<<14):(o|=(127&r)<<14,r=e[t++],r<128?(this.offset=t,o|r<<21):(o|=(127&r)<<21,r=e[t++],this.offset=t,(o|r<<28)>>>0)))}},textEncoder=new TextEncoder,SMALL_BUF_SIZE=4096,LARGE_BUF_SIZE=65536,sharedSmallBuf=new Uint8Array(SMALL_BUF_SIZE),sharedSmallView=new DataView(sharedSmallBuf.buffer),sharedLargeBuf=new Uint8Array(LARGE_BUF_SIZE),sharedLargeView=new DataView(sharedLargeBuf.buffer),sharedDecodeView=null,sharedDecodeBuf=null;function getDecodeView(e){return sharedDecodeBuf!==e&&(sharedDecodeBuf=e,sharedDecodeView=new DataView(e.buffer,e.byteOffset,e.byteLength)),sharedDecodeView}function isAscii(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function ultraFastEncodeTiny(e){const t=sharedSmallBuf;t[0]=66,t[1]=79,t[2]=79,t[3]=77,t[4]=1,t[5]=0,t[6]=80;let r=8,o=0;for(const s in e){if(o++,o>6)return null;const n=s.length;if(n>20)return null;t[r++]=48,t[r++]=n;for(let e=0;e<n;e++){const o=s.charCodeAt(e);if(o>127)return null;t[r++]=o}const i=e[s];if(null===i)t[r++]=0;else if(!0===i)t[r++]=2;else if(!1===i)t[r++]=1;else{const e=typeof i;if("number"===e){const e=i;(0|e)===e?e>=-128&&e<=127?(t[r++]=16,t[r++]=255&e):e>=-32768&&e<=32767?(t[r++]=17,t[r++]=255&e,t[r++]=e>>8&255):(t[r++]=18,t[r++]=255&e,t[r++]=e>>8&255,t[r++]=e>>16&255,t[r++]=e>>24&255):(t[r++]=33,sharedSmallView.setFloat64(r,e,!0),r+=8)}else{if("string"!==e)return null;{const e=i,o=e.length;if(o>100)return null;t[r++]=48,t[r++]=o;for(let s=0;s<o;s++){const o=e.charCodeAt(s);if(o>127)return null;t[r++]=o}}}}}return t[7]=o,t.slice(0,r)}function writeAsciiInline(e,t,r){const o=r.length;switch(o){case 1:return void(e[t]=r.charCodeAt(0));case 2:return e[t]=r.charCodeAt(0),void(e[t+1]=r.charCodeAt(1));case 3:return e[t]=r.charCodeAt(0),e[t+1]=r.charCodeAt(1),void(e[t+2]=r.charCodeAt(2));case 4:return e[t]=r.charCodeAt(0),e[t+1]=r.charCodeAt(1),e[t+2]=r.charCodeAt(2),void(e[t+3]=r.charCodeAt(3));default:for(let s=0;s<o;s++)e[t+s]=r.charCodeAt(s)}}function tryFastEncodeSmallInline(e,t){for(const t in e){if(t.length>127||!isAscii(t))return null;const r=e[t];if(null===r||!0===r||!1===r)continue;const o=typeof r;if("number"!==o&&"boolean"!==o){if("string"===o){const e=r;if(e.length>127||!isAscii(e))return null;continue}if("object"!==o)return null;{if(Array.isArray(r)||r instanceof Uint8Array)return null;const e=r;let t=0;for(const r in e){if(t++,t>10)return null;if(r.length>127||!isAscii(r))return null;const o=e[r];if(null===o||!0===o||!1===o)continue;const s=typeof o;if("number"!==s&&"boolean"!==s){if("string"===s){const e=o;if(e.length>127||!isAscii(e))return null;continue}return null}}}}}const r=sharedSmallBuf,o=sharedSmallView;r[0]=66,r[1]=79,r[2]=79,r[3]=77,r[4]=1,r[5]=0,r[6]=80,r[7]=t;let s=8;for(const t in e){const n=t.length;r[s++]=48,r[s++]=n,writeAsciiInline(r,s,t),s+=n;const i=e[t];if(null===i)r[s++]=0;else if(!0===i)r[s++]=2;else if(!1===i)r[s++]=1;else{const e=typeof i;if("string"===e){const e=i,t=e.length;r[s++]=48,r[s++]=t,writeAsciiInline(r,s,e),s+=t}else if("number"===e){const e=i;(0|e)===e&&e>=-128&&e<=127?(r[s++]=16,r[s++]=255&e):(0|e)===e?(r[s++]=18,r[s++]=255&e,r[s++]=e>>8&255,r[s++]=e>>16&255,r[s++]=e>>24&255):(r[s++]=33,o.setFloat64(s,e,!0),s+=8)}else{const e=i;let t=0;for(const r in e)t++;r[s++]=80,r[s++]=t;for(const t in e){const n=t.length;r[s++]=48,r[s++]=n,writeAsciiInline(r,s,t),s+=n;const i=e[t];if(null===i)r[s++]=0;else if(!0===i)r[s++]=2;else if(!1===i)r[s++]=1;else{if("string"===typeof i){const e=i,t=e.length;r[s++]=48,r[s++]=t,writeAsciiInline(r,s,e),s+=t}else{const e=i;(0|e)===e&&e>=-128&&e<=127?(r[s++]=16,r[s++]=255&e):(0|e)===e?(r[s++]=18,r[s++]=255&e,r[s++]=e>>8&255,r[s++]=e>>16&255,r[s++]=e>>24&255):(r[s++]=33,o.setFloat64(s,e,!0),s+=8)}}}}}}return r.slice(0,s)}function tryFastEncodeArrayOfObjects(e){const t=e.length;if(0===t)return null;const r=e[0];if("object"!=typeof r||null===r||Array.isArray(r))return null;if(t>=2){const t=Object.keys(r).sort().join(","),o=e[1];if("object"==typeof o&&null!==o&&!Array.isArray(o)){if(t===Object.keys(o).sort().join(","))return null}}let o=t>50?sharedLargeBuf:sharedSmallBuf,s=t>50?sharedLargeView:sharedSmallView,n=o.length;const i=Object.create(null);let a=0;o[0]=66,o[1]=79,o[2]=79,o[3]=77,o[4]=1,o[5]=0,o[6]=64;let c=7;if(t<128)o[c++]=t;else{let e=t;for(;e>127;)o[c++]=127&e|128,e>>>=7;o[c++]=e}function f(e){const t=c+e;for(;n<t;)n<<=1;const r=new Uint8Array(n);r.set(o.subarray(0,c)),o=r,s=new DataView(o.buffer)}for(let r=0;r<t;r++){const t=e[r];if("object"!=typeof t||null===t||Array.isArray(t))return null;const h=t;let d=0;for(const e in h)d++;c+2>n&&f(256),o[c++]=80,o[c++]=d;for(const e in h){const t=i[e];if(void 0!==t)c+2>n&&f(64),o[c++]=96,o[c++]=t;else{const t=e.length;if(t>127)return null;i[e]=a++,c+2+t>n&&f(64+t),o[c++]=48,o[c++]=t;for(let r=0;r<t;r++){const t=e.charCodeAt(r);if(t>127)return null;o[c++]=t}}const r=h[e];if(null===r)o[c++]=0;else if(!0===r)o[c++]=2;else if(!1===r)o[c++]=1;else{const e=typeof r;if("string"===e){const e=r,t=e.length,s=i[e];if(void 0!==s){c+2>n&&f(64),o[c++]=96,o[c++]=s;continue}if(i[e]=a++,c+2+t>n&&f(64+t),o[c++]=48,t<128)o[c++]=t;else{let e=t;for(;e>127;)o[c++]=127&e|128,e>>>=7;o[c++]=e}for(let r=0;r<t;r++){const t=e.charCodeAt(r);if(t>127)return null;o[c++]=t}}else if("number"===e){const e=r;(0|e)===e?e>=-128&&e<=127?(c+2>n&&f(16),o[c++]=16,o[c++]=255&e):e>=-32768&&e<=32767?(c+3>n&&f(16),o[c++]=17,o[c++]=255&e,o[c++]=e>>8&255):(c+5>n&&f(16),o[c++]=18,o[c++]=255&e,o[c++]=e>>8&255,o[c++]=e>>16&255,o[c++]=e>>24&255):(c+9>n&&f(16),o[c++]=33,s.setFloat64(c,e,!0),c+=8)}else if("object"===e)return null}}}return o.subarray(0,c)}function tryFastEncodeArray(e){const t=e.length;if(t>127)return null;const r=sharedSmallBuf,o=sharedSmallView;if(r[0]=66,r[1]=79,r[2]=79,r[3]=77,r[4]=1,r[5]=0,t>=4){const s=e[0],n=typeof s;if("boolean"===n){let o=!0;for(let r=1;r<t&&o;r++)"boolean"!=typeof e[r]&&(o=!1);if(o){const o=Math.ceil(t/8);r[6]=133,r[7]=t;let s=8;for(let n=0;n<o;n++){let o=0;const i=8*n;for(let r=0;r<8&&i+r<t;r++)e[i+r]&&(o|=1<<r);r[s++]=o}return r.slice(0,s)}}if("number"===n){let n=s,i=s,a=Number.isInteger(s),c=!0;for(let r=1;r<t&&c;r++){const t=e[r];if("number"!=typeof t){c=!1;break}const o=t;o<n&&(n=o),o>i&&(i=o),a&&!Number.isInteger(o)&&(a=!1)}if(c){if(a&&n>=-128&&i<=127){r[6]=128,r[7]=t;let o=8;for(let s=0;s<t;s++)r[o++]=255&e[s];return r.slice(0,o)}if(a&&n>=-32768&&i<=32767){r[6]=129,r[7]=t;let o=8;for(let s=0;s<t;s++){const t=e[s];r[o++]=255&t,r[o++]=t>>8&255}return r.slice(0,o)}if(a&&n>=-2147483648&&i<=2147483647){r[6]=130,r[7]=t;let o=8;for(let s=0;s<t;s++){const t=e[s];r[o++]=255&t,r[o++]=t>>8&255,r[o++]=t>>16&255,r[o++]=t>>24&255}return r.slice(0,o)}{r[6]=132,r[7]=t;let s=8;for(let r=0;r<t;r++)o.setFloat64(s,e[r],!0),s+=8;return r.slice(0,s)}}}}r[6]=64,r[7]=t;let s=8;for(let n=0;n<t;n++){const t=e[n],i=typeof t;if("number"===i){const e=t;(0|e)===e&&e>=-128&&e<=127?(r[s++]=16,r[s++]=255&e):(0|e)===e?(r[s++]=18,r[s++]=255&e,r[s++]=e>>8&255,r[s++]=e>>16&255,r[s++]=e>>24&255):(r[s++]=33,o.setFloat64(s,e,!0),s+=8)}else if("string"===i){const e=t,o=e.length;if(o>127||!isAscii(e))return null;r[s++]=48,r[s++]=o,writeAsciiInline(r,s,e),s+=o}else if("boolean"===i)r[s++]=t?2:1;else{if(null!==t)return null;r[s++]=0}}return r.slice(0,s)}function fastEncode(e){if(!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof Uint8Array)){const t=e,r=ultraFastEncodeTiny(t);if(r)return r;let o=0;for(const e in t)o++;if(o<=6){const e=tryFastEncodeSmallInline(t,o);if(e)return e}}if(Array.isArray(e)&&e.length>0){if("object"==typeof e[0]&&null!==e[0]&&!Array.isArray(e[0])){const t=tryFastEncodeArrayOfObjects(e);if(t)return t}if(e.length<=127){const t=tryFastEncodeArray(e);if(t)return t}}let t=sharedLargeBuf,r=sharedLargeView,o=t.length,s=0,n=0;const i=Object.create(null);let a=0;function c(e){const n=s+e;for(;o<n;)o<<=1;const i=new Uint8Array(o);i.set(t.subarray(0,s)),t=i,r=new DataView(t.buffer)}return t[s++]=66,t[s++]=79,t[s++]=79,t[s++]=77,t[s++]=VERSION,t[s++]=0,function e(f){if(null===f)return s>=o&&c(1),void(t[s++]=0);switch(typeof f){case"string":{const e=DICTIONARY_LOOKUP.get(f);if(void 0!==e){if(s+4>o&&c(4),t[s++]=97,e<128)t[s++]=e;else{let r=e>>>0;for(;r>127;)t[s++]=127&r|128,r>>>=7;t[s++]=r}return}const r=i[f];if(void 0!==r){if(s+6>o&&c(6),t[s++]=96,r<128)t[s++]=r;else{let e=r>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}return}i[f]=a++;const n=f.length;if(n<=8&&isAscii(f)){switch(s+10>o&&c(10),t[s++]=48,t[s++]=n,n){case 1:t[s++]=f.charCodeAt(0);break;case 2:t[s++]=f.charCodeAt(0),t[s++]=f.charCodeAt(1);break;case 3:t[s++]=f.charCodeAt(0),t[s++]=f.charCodeAt(1),t[s++]=f.charCodeAt(2);break;case 4:t[s++]=f.charCodeAt(0),t[s++]=f.charCodeAt(1),t[s++]=f.charCodeAt(2),t[s++]=f.charCodeAt(3);break;case 5:t[s++]=f.charCodeAt(0),t[s++]=f.charCodeAt(1),t[s++]=f.charCodeAt(2),t[s++]=f.charCodeAt(3),t[s++]=f.charCodeAt(4);break;case 6:t[s++]=f.charCodeAt(0),t[s++]=f.charCodeAt(1),t[s++]=f.charCodeAt(2),t[s++]=f.charCodeAt(3),t[s++]=f.charCodeAt(4),t[s++]=f.charCodeAt(5);break;case 7:t[s++]=f.charCodeAt(0),t[s++]=f.charCodeAt(1),t[s++]=f.charCodeAt(2),t[s++]=f.charCodeAt(3),t[s++]=f.charCodeAt(4),t[s++]=f.charCodeAt(5),t[s++]=f.charCodeAt(6);break;case 8:t[s++]=f.charCodeAt(0),t[s++]=f.charCodeAt(1),t[s++]=f.charCodeAt(2),t[s++]=f.charCodeAt(3),t[s++]=f.charCodeAt(4),t[s++]=f.charCodeAt(5),t[s++]=f.charCodeAt(6),t[s++]=f.charCodeAt(7)}return}const h=textEncoder.encode(f),d=h.length;if(s+6+d>o&&c(6+d),t[s++]=48,d<128)t[s++]=d;else{let e=d>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}return t.set(h,s),void(s+=d)}case"number":{const e=f;return void((0|e)===e?e>=-128&&e<=127?(s+2>o&&c(2),t[s++]=16,t[s++]=255&e):e>=-32768&&e<=32767?(s+3>o&&c(3),t[s++]=17,t[s++]=255&e,t[s++]=e>>8&255):(s+5>o&&c(5),t[s++]=18,t[s++]=255&e,t[s++]=e>>8&255,t[s++]=e>>16&255,t[s++]=e>>24&255):(s+9>o&&c(9),t[s++]=33,r.setFloat64(s,e,!0),s+=8))}case"boolean":return s>=o&&c(1),void(t[s++]=f?2:1);case"object":if(Array.isArray(f)){if(n++,n>64)throw new BoomError("Maximum nesting depth of 64 exceeded");const h=f.length;if(h>=4){const e=f[0],i=typeof e;if("boolean"===i){let e=!0;for(let t=1;t<h&&e;t++)"boolean"!=typeof f[t]&&(e=!1);if(e){const e=Math.ceil(h/8);if(s+3+e>o&&c(3+e),t[s++]=133,h<128)t[s++]=h;else{let e=h>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}for(let r=0;r<e;r++){let e=0;const o=8*r;for(let t=0;t<8&&o+t<h;t++)f[o+t]&&(e|=1<<t);t[s++]=e}return void n--}}if("number"===i){let i=e,a=e,d=Number.isInteger(e),l=!0;for(let e=1;e<h&&l;e++){const t=f[e];if("number"!=typeof t){l=!1;break}const r=t;r<i&&(i=r),r>a&&(a=r),d&&!Number.isInteger(r)&&(d=!1)}if(l){if(d&&i>=-128&&a<=127){if(s+3+h>o&&c(3+h),t[s++]=128,h<128)t[s++]=h;else{let e=h>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}for(let e=0;e<h;e++)t[s++]=255&f[e];return void n--}if(d&&i>=-32768&&a<=32767){if(s+3+2*h>o&&c(3+2*h),t[s++]=129,h<128)t[s++]=h;else{let e=h>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}for(let e=0;e<h;e++){const r=f[e];t[s++]=255&r,t[s++]=r>>8&255}return void n--}if(d&&i>=-2147483648&&a<=2147483647){if(s+3+4*h>o&&c(3+4*h),t[s++]=130,h<128)t[s++]=h;else{let e=h>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}for(let e=0;e<h;e++){const r=f[e];t[s++]=255&r,t[s++]=r>>8&255,t[s++]=r>>16&255,t[s++]=r>>24&255}return void n--}if(s+3+8*h>o&&c(3+8*h),t[s++]=132,h<128)t[s++]=h;else{let e=h>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}for(let e=0;e<h;e++)r.setFloat64(s,f[e],!0),s+=8;return void n--}}}if(s+6>o&&c(6),t[s++]=64,h<128)t[s++]=h;else{let e=h>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}if(h>0&&"object"==typeof f[0]&&null!==f[0]&&!Array.isArray(f[0])&&!(f[0]instanceof Uint8Array)){const d=f[0],l=Object.keys(d),u=l.length;let p=u<=8;if(p)for(let e=0;e<u;e++){const t=d[l[e]];if("object"===typeof t&&null!==t){p=!1;break}}if(p){const d=h*(2+24*u)+512;s+d>o&&c(d);const p=new Array(u);let g=!1;for(let n=0;n<h;n++){const h=f[n];if("object"!=typeof h||null===h||Array.isArray(h)){e(h);continue}const d=h;s+6>o&&c(6),t[s++]=80,t[s++]=u;for(let n=0;n<u;n++){const f=l[n];if(g)s+2>o&&c(2),t[s++]=96,t[s++]=p[n];else{const e=i[f];if(void 0!==e)p[n]=e,s+2>o&&c(2),t[s++]=96,t[s++]=e;else{p[n]=a,i[f]=a++;const e=f.length;s+2+e>o&&c(2+e),t[s++]=48,t[s++]=e,writeAsciiInline(t,s,f),s+=e}}const h=d[f],u=typeof h;if("string"===u){const e=h,r=e.length,n=i[e];if(void 0!==n)if(s+6>o&&c(6),t[s++]=96,n<128)t[s++]=n;else{let e=n>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}else i[e]=a++,s+2+r>o&&c(2+r),t[s++]=48,t[s++]=r,writeAsciiInline(t,s,e),s+=r}else if("number"===u){const e=h;(0|e)===e&&e>=-128&&e<=127?(s+2>o&&c(2),t[s++]=16,t[s++]=255&e):(0|e)===e?(s+5>o&&c(5),t[s++]=18,t[s++]=255&e,t[s++]=e>>8&255,t[s++]=e>>16&255,t[s++]=e>>24&255):(s+9>o&&c(9),t[s++]=33,r.setFloat64(s,e,!0),s+=8)}else"boolean"===u?(s>=o&&c(1),t[s++]=h?2:1):null===h?(s>=o&&c(1),t[s++]=0):e(h)}g=!0}return void n--}}for(let t=0;t<h;t++)e(f[t]);n--}else if(f instanceof Uint8Array){const e=f.length;if(s+6+e>o&&c(6+e),t[s++]=49,e<128)t[s++]=e;else{let r=e>>>0;for(;r>127;)t[s++]=127&r|128,r>>>=7;t[s++]=r}t.set(f,s),s+=e}else{if(n++,n>64)throw new BoomError("Maximum nesting depth of 64 exceeded");const r=Object.keys(f),h=r.length;if(s+6>o&&c(6),t[s++]=80,h<128)t[s++]=h;else{let e=h>>>0;for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s++]=e}for(let n=0;n<h;n++){const h=r[n],d=i[h];if(void 0!==d)s+2>o&&c(2),t[s++]=96,t[s++]=d;else{i[h]=a++;const e=textEncoder.encode(h),r=e.length;s+2+r>o&&c(2+r),t[s++]=48,t[s++]=r,t.set(e,s),s+=r}e(f[h])}n--}return;case"bigint":return s+9>o&&c(9),t[s++]=f>=0n?23:19,r.setBigInt64(s,f,!0),void(s+=8);default:s>=o&&c(1),t[s++]=0}}(e),t.slice(0,s)}var textDecoder=new TextDecoder,NEED_FULL_DECODE=Symbol("NEED_FULL_DECODE");function tryDecodeTinyObject(e){let t=6;if(80!==e[t++])return NEED_FULL_DECODE;const r=e[t++];if(r>8)return NEED_FULL_DECODE;const o={};for(let s=0;s<r;s++){if(48!==e[t++])return NEED_FULL_DECODE;const r=e[t++];if(r>16)return NEED_FULL_DECODE;let s;switch(r){case 1:s=String.fromCharCode(e[t]);break;case 2:s=String.fromCharCode(e[t],e[t+1]);break;case 3:s=String.fromCharCode(e[t],e[t+1],e[t+2]);break;case 4:s=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);break;case 5:s=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4]);break;case 6:s=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5]);break;default:s=ultraDecodeStr(e,t,r)}t+=r;const n=e[t++];if(48===n){const r=e[t++];switch(r){case 1:o[s]=String.fromCharCode(e[t]);break;case 2:o[s]=String.fromCharCode(e[t],e[t+1]);break;case 3:o[s]=String.fromCharCode(e[t],e[t+1],e[t+2]);break;case 4:o[s]=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);break;default:o[s]=ultraDecodeStr(e,t,r)}t+=r}else if(16===n){const r=e[t++];o[s]=r>127?r-256:r}else if(2===n)o[s]=!0;else if(1===n)o[s]=!1;else if(0===n)o[s]=null;else if(17===n){const r=e[t]|e[t+1]<<8;o[s]=r>32767?r-65536:r,t+=2}else if(18===n)o[s]=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,t+=4;else{if(33!==n)return NEED_FULL_DECODE;o[s]=getDecodeView(e).getFloat64(t,!0),t+=8}}return o}function isAsciiBytes(e,t,r){for(let o=0;o<r;o++)if(e[t+o]>127)return!1;return!0}function ultraDecodeStr(e,t,r){switch(r){case 1:return String.fromCharCode(e[t]);case 2:return String.fromCharCode(e[t],e[t+1]);case 3:return String.fromCharCode(e[t],e[t+1],e[t+2]);case 4:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);case 5:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4]);case 6:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5]);case 7:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5],e[t+6]);case 8:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5],e[t+6],e[t+7])}for(let o=0;o<r;o++)if(e[t+o]>127)return textDecoder.decode(e.subarray(t,t+r));let o="";for(let s=0;s<r;s++)o+=String.fromCharCode(e[t+s]);return o}function decodeStr(e,t,r){if(r<=8){if(isAsciiBytes(e,t,r))switch(r){case 1:return String.fromCharCode(e[t]);case 2:return String.fromCharCode(e[t],e[t+1]);case 3:return String.fromCharCode(e[t],e[t+1],e[t+2]);case 4:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);case 5:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4]);case 6:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5]);case 7:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5],e[t+6]);case 8:return String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5],e[t+6],e[t+7])}return textDecoder.decode(e.subarray(t,t+r))}if(r<=32&&isAsciiBytes(e,t,r)){let o="",s=0;for(;s+8<=r;s+=8)o+=String.fromCharCode(e[t+s],e[t+s+1],e[t+s+2],e[t+s+3],e[t+s+4],e[t+s+5],e[t+s+6],e[t+s+7]);for(;s<r;s++)o+=String.fromCharCode(e[t+s]);return o}return textDecoder.decode(e.subarray(t,t+r))}function fastDecodeSmall(e){const t=e;let r=6;const o=t[r++];if(80===o){const e=t[r++],o={};for(let s=0;s<e;s++){r++;const e=t[r++],s=decodeStr(t,r,e);r+=e;const n=t[r++];if(48===n){const e=t[r++];o[s]=decodeStr(t,r,e),r+=e}else if(16===n){const e=t[r++];o[s]=e>127?e-256:e}else if(17===n){const e=t[r]|t[r+1]<<8;o[s]=e>32767?e-65536:e,r+=2}else if(18===n)o[s]=t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24,r+=4;else if(33===n)o[s]=getDecodeView(t).getFloat64(r,!0),r+=8;else if(2===n)o[s]=!0;else if(1===n)o[s]=!1;else if(23===n)o[s]=getDecodeView(t).getBigUint64(r,!0),r+=8;else if(19===n||25===n)o[s]=getDecodeView(t).getBigInt64(r,!0),r+=8;else if(80===n){const e=t[r++],n={};for(let o=0;o<e;o++){r++;const e=t[r++],o=decodeStr(t,r,e);r+=e;const s=t[r++];if(48===s){const e=t[r++];n[o]=decodeStr(t,r,e),r+=e}else if(16===s){const e=t[r++];n[o]=e>127?e-256:e}else if(17===s){const e=t[r]|t[r+1]<<8;n[o]=e>32767?e-65536:e,r+=2}else if(18===s)n[o]=t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24,r+=4;else if(33===s)n[o]=getDecodeView(t).getFloat64(r,!0),r+=8;else if(23===s)n[o]=getDecodeView(t).getBigUint64(r,!0),r+=8;else if(19===s||25===s)n[o]=getDecodeView(t).getBigInt64(r,!0),r+=8;else if(2===s)n[o]=!0;else if(1===s)n[o]=!1;else{if(0!==s)return NEED_FULL_DECODE;n[o]=null}}o[s]=n}else{if(0!==n)return NEED_FULL_DECODE;o[s]=null}}return o}if(64===o){const e=t[r++],o=new Array(e);for(let s=0;s<e;s++){const e=t[r++];if(16===e){const e=t[r++];o[s]=e>127?e-256:e}else if(48===e){const e=t[r++];o[s]=decodeStr(t,r,e),r+=e}else if(17===e){const e=t[r]|t[r+1]<<8;o[s]=e>32767?e-65536:e,r+=2}else if(18===e)o[s]=t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24,r+=4;else if(33===e)o[s]=getDecodeView(t).getFloat64(r,!0),r+=8;else{if(64===e)return NEED_FULL_DECODE;if(80===e)return NEED_FULL_DECODE;if(2===e)o[s]=!0;else if(1===e)o[s]=!1;else{if(0!==e)return NEED_FULL_DECODE;o[s]=null}}}return o}if(48===o){const e=t[r++];return decodeStr(t,r,e)}if(16===o){const e=t[r];return e>127?e-256:e}return 2===o||1!==o&&null}function fastDecodeArrayOfObjects(e,t,r){const o=e;let s=t;const n=new Array(r),i=getDecodeView(o),a=[];for(let e=0;e<r;e++){if(80!==o[s++])return NEED_FULL_DECODE;const t=o[s++],r={};for(let e=0;e<t;e++){const e=o[s++];let t;if(48===e){const e=o[s++];t=decodeStr(o,s,e),s+=e,a.push(t)}else if(96===e){if(t=a[o[s++]],!t)return NEED_FULL_DECODE}else{if(97!==e)return NEED_FULL_DECODE;{const e=o[s++];t=BOOM_DICTIONARY_V1[e]}}const n=o[s++];if(48===n){const e=o[s++],n=decodeStr(o,s,e);s+=e,a.push(n),r[t]=n}else if(96===n){const e=o[s++];r[t]=a[e]}else if(97===n){const e=o[s++];r[t]=BOOM_DICTIONARY_V1[e]}else if(16===n){const e=o[s++];r[t]=e>127?e-256:e}else if(17===n){const e=o[s]|o[s+1]<<8;r[t]=e>32767?e-65536:e,s+=2}else if(18===n)r[t]=o[s]|o[s+1]<<8|o[s+2]<<16|o[s+3]<<24,s+=4;else if(33===n)r[t]=i.getFloat64(s,!0),s+=8;else if(2===n)r[t]=!0;else if(1===n)r[t]=!1;else{if(0!==n)return NEED_FULL_DECODE;r[t]=null}}n[e]=r}return n}function fastDecode(e){if(e.length<6||66!==e[0]||79!==e[1]||79!==e[2]||77!==e[3]){if(e.length<6)throw new BoomError("Buffer too short for BOOM header");throw new BoomError("Invalid BOOM magic bytes")}if(e[4]!==VERSION)throw new BoomError(`Unsupported BOOM version: ${e[4]}`);const t=e.length;if(t<64){const t=tryDecodeTinyObject(e);if(t!==NEED_FULL_DECODE)return t}const r=e[6];if(64===r){let t=7,r=e[t++],o=127&r;if(r>=128&&(r=e[t++],o|=(127&r)<<7,r>=128&&(r=e[t++],o|=(127&r)<<14)),o>0){if(80===e[t]){const r=fastDecodeArrayOfObjects(e,t,o);if(r!==NEED_FULL_DECODE)return r}}}if(80===r){const r=e[7];if(r<=10&&t<512){let o=!0,s=8;for(let n=0;n<r&&s<t&&o;n++){if(48!==e[s]){o=!1;break}s++;const r=e[s++];s+=r;const n=e[s++];if(64===n){o=!1;break}if(48===n){const t=e[s++];s+=t}else if(80===n){const r=e[s++];for(let n=0;n<r&&s<t;n++){if(48!==e[s]){o=!1;break}s++;const t=e[s++];s+=t;const r=e[s++];if(80===r||64===r){o=!1;break}if(48===r){const t=e[s++];s+=t}else 16===r?s+=1:18===r?s+=4:33===r&&(s+=8)}}else 16===n?s+=1:17===n?s+=2:18===n?s+=4:33===n||19===n||23===n||25===n?s+=8:96===n&&(s+=1)}if(o){const t=fastDecodeSmall(e);if(t!==NEED_FULL_DECODE)return t}}}const o=e,s=new DataView(o.buffer,o.byteOffset,o.byteLength);let n=6;const i=[];let a=0;const c=64;function f(){let e=o[n++];if(e<128)return e;let t=127&e;return e=o[n++],e<128?t|e<<7:(t|=(127&e)<<7,e=o[n++],e<128?t|e<<14:(t|=(127&e)<<14,e=o[n++],e<128?t|e<<21:(t|=(127&e)<<21,e=o[n++],(t|e<<28)>>>0)))}function h(){const e=f(),t=n;if(n+=e,e<=8){const r=decodeStr(o,t,e);return i.push(r),r}if(e<128){let e=!0;for(let r=t;r<n;r++)if(o[r]>127){e=!1;break}if(e){const e=String.fromCharCode.apply(null,o.subarray(t,n));return i.push(e),e}}const r=textDecoder.decode(o.subarray(t,n));return i.push(r),r}return function e(){const t=o[n++];switch(t){case 48:return h();case 16:{const e=o[n++];return e>127?e-256:e}case 18:{const e=n;return n+=4,o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24}case 17:{const e=n;n+=2;const t=o[e]|o[e+1]<<8;return t>32767?t-65536:t}case 80:{if(a++,a>c)throw new BoomError("Maximum nesting depth of 64 exceeded");const t=f(),r={};for(let s=0;s<t;s++){const t=o[n++];r[48===t?h():97===t?BOOM_DICTIONARY_V1[f()]:i[f()]]=e()}return a--,r}case 64:{if(a++,a>c)throw new BoomError("Maximum nesting depth of 64 exceeded");const t=f(),r=new Array(t);for(let o=0;o<t;o++)r[o]=e();return a--,r}case 96:return i[f()];case 97:return BOOM_DICTIONARY_V1[f()];case 0:return null;case 2:return!0;case 1:return!1;case 33:{const e=s.getFloat64(n,!0);return n+=8,e}case 32:{const e=s.getFloat32(n,!0);return n+=4,e}case 49:{const e=f(),t=n;return n+=e,new Uint8Array(o.subarray(t,n))}case 23:{const e=s.getBigUint64(n,!0);return n+=8,e}case 19:{const e=s.getBigInt64(n,!0);return n+=8,e}case 112:{if(a++,a>c)throw new BoomError("Maximum nesting depth of 64 exceeded");const t=f(),r=f(),d=[];for(let e=0;e<r;e++){const e=o[n++];d.push(48===e?h():97===e?BOOM_DICTIONARY_V1[f()]:i[f()])}const l=[];for(let e=0;e<r;e++){const e=o[n++],t={type:e};if(114===e){const e=f();t.nestedKeys=[],t.nestedTypes=[];for(let r=0;r<e;r++){const e=o[n++];t.nestedKeys.push(48===e?h():97===e?BOOM_DICTIONARY_V1[f()]:i[f()])}for(let r=0;r<e;r++)t.nestedTypes.push(o[n++])}l.push(t)}const u=[];for(let a=0;a<t;a++){const t={};for(let a=0;a<r;a++){const r=d[a],c=l[a];switch(c.type){case 133:t[r]=0!==o[n++];break;case 128:{const e=o[n++];t[r]=e>127?e-256:e;break}case 129:{const e=n;n+=2;const s=o[e]|o[e+1]<<8;t[r]=s>32767?s-65536:s;break}case 130:{const e=n;n+=4,t[r]=o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24;break}case 132:t[r]=s.getFloat64(n,!0),n+=8;break;case 48:{const e=o[n++];t[r]=48===e?h():97===e?BOOM_DICTIONARY_V1[f()]:i[f()];break}case 113:{const o=f(),s=[];for(let t=0;t<o;t++)s.push(e());t[r]=s;break}case 114:{const a={};for(let t=0;t<c.nestedKeys.length;t++){const r=c.nestedKeys[t];switch(c.nestedTypes[t]){case 133:a[r]=0!==o[n++];break;case 128:{const e=o[n++];a[r]=e>127?e-256:e;break}case 129:{const e=n;n+=2;const t=o[e]|o[e+1]<<8;a[r]=t>32767?t-65536:t;break}case 130:{const e=n;n+=4,a[r]=o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24;break}case 132:a[r]=s.getFloat64(n,!0),n+=8;break;case 48:{const e=o[n++];a[r]=48===e?h():97===e?BOOM_DICTIONARY_V1[f()]:i[f()];break}default:a[r]=e()}}t[r]=a;break}default:t[r]=e()}}u.push(t)}return a--,u}case 115:{if(a++,a>c)throw new BoomError("Maximum nesting depth of 64 exceeded");const t=f(),r=f(),d=[];for(let e=0;e<r;e++){const e=f(),t=n;n+=e,d.push(textDecoder.decode(o.subarray(t,n)))}const l=[];for(let e=0;e<r;e++)l.push(o[n++]);const u=[];for(let e=0;e<t;e++)u.push({});for(let a=0;a<r;a++){const r=d[a];switch(l[a]){case 116:{const o=e();for(let e=0;e<t;e++)u[e][r]=o;break}case 133:for(let e=0;e<t;e+=8){const s=o[n++];for(let o=0;o<8&&e+o<t;o++)u[e+o][r]=!!(s&1<<o)}break;case 128:for(let e=0;e<t;e++){const t=o[n++];u[e][r]=t>127?t-256:t}break;case 129:for(let e=0;e<t;e++){const t=n;n+=2;const s=o[t]|o[t+1]<<8;u[e][r]=s>32767?s-65536:s}break;case 130:for(let e=0;e<t;e++){const t=n;n+=4,u[e][r]=o[t]|o[t+1]<<8|o[t+2]<<16|o[t+3]<<24}break;case 132:for(let e=0;e<t;e++)u[e][r]=s.getFloat64(n,!0),n+=8;break;case 48:for(let e=0;e<t;e++){const t=o[n++];u[e][r]=48===t?h():97===t?BOOM_DICTIONARY_V1[f()]:i[f()]}break;default:for(let o=0;o<t;o++)u[o][r]=e()}}return a--,u}case 133:{const e=f(),t=[],r=Math.ceil(e/8);for(let s=0;s<r;s++){const r=o[n++];for(let o=0;o<8&&t.length<e;o++)t.push(!!(r&1<<o))}return t}case 128:{const e=f(),t=[];for(let r=0;r<e;r++){const e=o[n++];t.push(e>127?e-256:e)}return t}case 129:{const e=f(),t=[];for(let r=0;r<e;r++){const e=n;n+=2;const r=o[e]|o[e+1]<<8;t.push(r>32767?r-65536:r)}return t}case 130:{const e=f(),t=[];for(let r=0;r<e;r++){const e=n;n+=4,t.push(o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24)}return t}case 131:{const e=f(),t=[];for(let r=0;r<e;r++)t.push(s.getFloat32(n,!0)),n+=4;return t}case 132:{const e=f(),t=[];for(let r=0;r<e;r++)t.push(s.getFloat64(n,!0)),n+=8;return t}default:throw new BoomError(`Unknown type: 0x${t.toString(16)}`)}}()}var BoomBinaryEncoder=class e{writer=new ByteWriter2;stringTable=new Map;stringCount=0;options;depth=0;enableInterning;constructor(e={}){this.options=mergeOptions(DEFAULT_OPTIONS,e),this.enableInterning=this.options.enableInterning}encode(e){if(this.enableInterning&&64===this.options.maxDepth&&!(Array.isArray(e)&&e.length>=2&&this.isUniformObjectArray(e)))return fastEncode(e);this.writer=new ByteWriter2,this.stringTable=new Map,this.stringCount=0,this.depth=0;const t=this.writer;t.pos+6>t.buffer.length&&t.grow(6);const r=t.buffer;return r[t.pos++]=66,r[t.pos++]=79,r[t.pos++]=79,r[t.pos++]=77,r[t.pos++]=VERSION,r[t.pos++]=0,this.encodeValue(e),this.writer.toUint8Array()}encodeValue(e){if(null===e)return void this.writer.writeByte(0);const t=e.constructor;if(t!==String)if(t!==Number)if(t!==Array)if(t!==Object)if(t!==Boolean)if(e instanceof Uint8Array)this.encodeBinary(e);else if("bigint"!=typeof e){if(void 0!==e)throw new BoomError("Unsupported type: "+typeof e);this.writer.writeByte(0)}else this.encodeBigInt(e);else this.writer.writeByte(e?2:1);else this.encodeObject(e);else this.encodeArray(e);else this.encodeNumber(e);else this.encodeString(e)}encodeNumber(e){const t=this.writer;if((0|e)===e)if(e>=-128&&e<=127)t.pos+2>t.buffer.length&&t.grow(2),t.buffer[t.pos++]=16,t.buffer[t.pos++]=255&e;else if(e>=-32768&&e<=32767){t.pos+3>t.buffer.length&&t.grow(3);const r=t.buffer;r[t.pos++]=17,r[t.pos++]=255&e,r[t.pos++]=e>>8&255}else{t.pos+5>t.buffer.length&&t.grow(5);const r=t.buffer;r[t.pos++]=18,r[t.pos++]=255&e,r[t.pos++]=e>>8&255,r[t.pos++]=e>>16&255,r[t.pos++]=e>>24&255}else t.writeByte(33),t.writeFloat64LE(e)}encodeBigInt(e){if(e>=0n&&e<=0xFFFFFFFFFFFFFFFFn)this.writer.writeByte(23),this.writer.writeBigUInt64LE(e);else{if(!(e>=-0x8000000000000000n&&e<=0x7FFFFFFFFFFFFFFFn))throw new BoomError("BigInt out of range for int64/uint64");this.writer.writeByte(19),this.writer.writeBigInt64LE(e)}}static textEncoder=new TextEncoder;encodeString(t){const r=DICTIONARY_LOOKUP.get(t);if(void 0!==r){const e=this.writer;return e.pos+4>e.buffer.length&&e.grow(4),e.buffer[e.pos++]=97,void(r<128?e.buffer[e.pos++]=r:e.writeVarint(r))}if(this.enableInterning){const e=this.stringTable.get(t);if(void 0!==e){const t=this.writer;return t.pos+6>t.buffer.length&&t.grow(6),t.buffer[t.pos++]=96,void(e<128?t.buffer[t.pos++]=e:t.writeVarint(e))}this.stringTable.set(t,this.stringCount++)}const o=t.length;if(o<64){let e=!0;for(let r=0;r<o;r++)if(t.charCodeAt(r)>127){e=!1;break}if(e){const e=this.writer,r=2+o;e.pos+r>e.buffer.length&&e.grow(r);const s=e.buffer;s[e.pos++]=48,s[e.pos++]=o;for(let r=0;r<o;r++)s[e.pos++]=t.charCodeAt(r);return}}const s=e.textEncoder.encode(t);this.writer.writeByte(48),this.writer.writeVarint(s.length),this.writer.write(s)}encodeBinary(e){this.writer.writeByte(49),this.writer.writeVarint(e.length),this.writer.write(e)}encodeArray(e){if(e.length>this.options.maxArrayLength)throw new BoomError(`Array exceeds maximum length of ${this.options.maxArrayLength}`);if(this.depth++,this.depth>this.options.maxDepth)throw new BoomError(`Maximum nesting depth of ${this.options.maxDepth} exceeded`);if(e.length>=2&&this.isUniformObjectArray(e))return this.encodeColumnar(e),void this.depth--;if(e.length>=4){const t=this.tryPackedArray(e);if(t)return this.writer.write(t),void this.depth--}this.writer.writeByte(64),this.writer.writeVarint(e.length);for(const t of e)this.encodeValue(t);this.depth--}isUniformObjectArray(e){if(e.length<2)return!1;const t=e[0];if("object"!=typeof t||null===t||Array.isArray(t)||t instanceof Uint8Array)return!1;const r=Object.keys(t),o=r.length;if(0===o)return!1;const s=new Set(r);for(let t=1;t<e.length;t++){const r=e[t];if("object"!=typeof r||null===r||Array.isArray(r)||r instanceof Uint8Array)return!1;const n=Object.keys(r);if(n.length!==o)return!1;for(let e=0;e<o;e++)if(!s.has(n[e]))return!1}return!0}encodeColumnar(t){const r=Object.keys(t[0]);this.writer.writeByte(115),this.writer.writeVarint(t.length),this.writer.writeVarint(r.length);const o=e.textEncoder;for(const e of r){const t=o.encode(e);this.writer.writeVarint(t.length),this.writer.write(t)}const s=r.map(e=>{let r=!0,o=!0,s=!0,n=!0,i=!0,a=!0;const c=t[0][e];let f=!0;for(const h of t){const t=h[e];f&&t!==c&&(typeof t==typeof c&&JSON.stringify(t)===JSON.stringify(c)||(f=!1)),"boolean"!=typeof t&&(i=!1),"string"!=typeof t&&(a=!1),"number"!=typeof t?r=o=s=n=!1:Number.isInteger(t)?((t<-128||t>127)&&(r=!1),(t<-32768||t>32767)&&(o=!1),(t<-2147483648||t>2147483647)&&(s=!1)):r=o=s=!1}return{type:i?"bool":r?"int8":o?"int16":s?"int32":n?"float":a?"string":"mixed",isConstant:f&&t.length>1,constantValue:f?c:void 0}});for(const e of s)if(e.isConstant)this.writer.writeByte(116);else{const t="bool"===e.type?133:"int8"===e.type?128:"int16"===e.type?129:"int32"===e.type?130:"float"===e.type?132:"string"===e.type?48:64;this.writer.writeByte(t)}for(let e=0;e<r.length;e++){const o=r[e],n=s[e];if(n.isConstant)this.encodeValue(n.constantValue);else switch(n.type){case"bool":for(let e=0;e<t.length;e+=8){let r=0;for(let s=0;s<8&&e+s<t.length;s++)t[e+s][o]&&(r|=1<<s);this.writer.writeByte(r)}break;case"int8":for(const e of t)this.writer.writeInt8(e[o]);break;case"int16":for(const e of t)this.writer.writeInt16LE(e[o]);break;case"int32":for(const e of t)this.writer.writeInt32LE(e[o]);break;case"float":for(const e of t)this.writer.writeFloat64LE(e[o]);break;case"string":for(const e of t)this.encodeString(e[o]);break;default:for(const e of t)this.encodeValue(e[o])}}}tryPackedArray(e){let t=!0,r=!0,o=!0,s=!0,n=!0;for(const i of e)if("boolean"==typeof i)t=r=o=s=!1;else{if("number"!=typeof i)return null;if(n=!1,Number.isInteger(i))s=!1,(i<-128||i>127)&&(t=!1),(i<-32768||i>32767)&&(r=!1),(i<-2147483648||i>2147483647)&&(o=!1);else{t=r=o=!1;new Float32Array([i])[0]!==i&&(s=!1)}}const i=new ByteWriter2;if(n){i.writeByte(133),i.writeVarint(e.length);for(let t=0;t<e.length;t+=8){let r=0;for(let o=0;o<8&&t+o<e.length;o++)e[t+o]&&(r|=1<<o);i.writeByte(r)}return i.toUint8Array()}if(t){i.writeByte(128),i.writeVarint(e.length);for(const t of e)i.writeInt8(t);return i.toUint8Array()}if(r){i.writeByte(129),i.writeVarint(e.length);for(const t of e)i.writeInt16LE(t);return i.toUint8Array()}if(o){i.writeByte(130),i.writeVarint(e.length);for(const t of e)i.writeInt32LE(t);return i.toUint8Array()}if(s){i.writeByte(131),i.writeVarint(e.length);for(const t of e)i.writeFloat32LE(t);return i.toUint8Array()}return null}encodeObject(e){const t=Object.keys(e);if(t.length>this.options.maxArrayLength)throw new BoomError(`Object exceeds maximum key count of ${this.options.maxArrayLength}`);if(this.depth++,this.depth>this.options.maxDepth)throw new BoomError(`Maximum nesting depth of ${this.options.maxDepth} exceeded`);this.writer.writeByte(80),this.writer.writeVarint(t.length);for(let r=0;r<t.length;r++){const o=t[r];this.encodeString(o),this.encodeValue(e[o])}this.depth--}},BoomBinaryDecoder=class e{reader;stringTable=[];options;depth=0;enableInterning;static textDecoder=new TextDecoder;constructor(e={}){this.options=mergeOptions(DEFAULT_OPTIONS,e),this.enableInterning=this.options.enableInterning}decode(e){if(this.enableInterning&&64===this.options.maxDepth)return fastDecode(e);if(e.length<6||66!==e[0]||79!==e[1]||79!==e[2]||77!==e[3])throw new BoomError("Invalid BOOM header");if(e[4]!==VERSION)throw new BoomError(`Unsupported BOOM version: ${e[4]}`);return this.reader=new ByteReader2(e),this.reader.offset=6,this.stringTable=[],this.depth=0,this.decodeValue()}decodeValue(){const e=this.reader,t=e.readByte();if(48===t)return this.decodeString();if(16===t)return e.readInt8();if(18===t)return e.readInt32LE();if(80===t)return this.decodeObject();if(64===t)return this.decodeArray();if(96===t)return this.stringTable[e.readVarint()];if(0===t)return null;if(2===t)return!0;if(1===t)return!1;if(17===t)return e.readInt16LE();if(33===t)return e.readFloat64LE();switch(t){case 19:return e.readBigInt64LE();case 20:return e.readUInt8();case 21:return e.readUInt16LE();case 22:return e.readUInt32LE();case 23:return e.readBigUInt64LE();case 24:return e.readVarint();case 25:return zigzagDecode2(e.readVarint());case 32:return e.readFloat32LE();case 49:return this.decodeBinary();case 112:return this.decodeTable();case 115:return this.decodeColumnar();case 133:return this.decodePackedBool();case 128:return this.decodePackedInt8();case 129:return this.decodePackedInt16();case 130:return this.decodePackedInt32();case 131:return this.decodePackedFloat32();case 132:return this.decodePackedFloat64();default:throw new BoomError(`Unknown type marker: 0x${t.toString(16)}`)}}decodeString(){const t=this.reader,r=t.readVarint();if(r<64){const o=t.readBytes(r);let s=!0;for(let e=0;e<r;e++)if(o[e]>127){s=!1;break}if(s){let e="";for(let t=0;t<r;t++)e+=String.fromCharCode(o[t]);return this.enableInterning&&this.stringTable.push(e),e}const n=e.textDecoder.decode(o);return this.enableInterning&&this.stringTable.push(n),n}const o=t.readBytes(r),s=e.textDecoder.decode(o);return this.enableInterning&&this.stringTable.push(s),s}decodeBinary(){const e=this.reader.readVarint();return new Uint8Array(this.reader.readBytes(e))}decodeArray(){const e=this.reader.readVarint();this.depth++;const t=new Array(e);for(let r=0;r<e;r++)t[r]=this.decodeValue();return this.depth--,t}decodeObject(){const e=this.reader,t=e.readVarint(),r=this.stringTable;this.depth++;const o={};for(let s=0;s<t;s++){const t=e.readByte();o[48===t?this.decodeString():96===t?r[e.readVarint()]:97===t?BOOM_DICTIONARY_V1[e.readVarint()]:(()=>{throw new BoomError(`Invalid key type: 0x${t.toString(16)}`)})()]=this.decodeValue()}return this.depth--,o}decodeRef(){return this.stringTable[this.reader.readVarint()]}decodeTable(){const e=this.reader.readVarint(),t=this.reader.readVarint(),r=[];for(let e=0;e<t;e++){const e=this.reader.readByte();if(48===e)r.push(this.decodeString());else if(96===e)r.push(this.decodeRef());else{if(97!==e)throw new BoomError(`Invalid table column name type: 0x${e.toString(16)}`);r.push(BOOM_DICTIONARY_V1[this.reader.readVarint()])}}const o=[];for(let e=0;e<t;e++){const e=this.reader.readByte(),t={type:e};if(114===e){const e=this.reader.readVarint();t.nestedKeys=[],t.nestedTypes=[];for(let r=0;r<e;r++){const e=this.reader.readByte();if(48===e)t.nestedKeys.push(this.decodeString());else if(96===e)t.nestedKeys.push(this.decodeRef());else{if(97!==e)throw new BoomError(`Invalid nested key type: 0x${e.toString(16)}`);t.nestedKeys.push(BOOM_DICTIONARY_V1[this.reader.readVarint()])}}for(let r=0;r<e;r++)t.nestedTypes.push(this.reader.readByte())}o.push(t)}const s=[];for(let n=0;n<e;n++){const e={};for(let s=0;s<t;s++){const t=r[s],n=o[s];switch(n.type){case 133:e[t]=0!==this.reader.readByte();break;case 128:e[t]=this.reader.readInt8();break;case 129:e[t]=this.reader.readInt16LE();break;case 130:e[t]=this.reader.readInt32LE();break;case 132:e[t]=this.reader.readFloat64LE();break;case 48:{const r=this.reader.readByte();if(48===r)e[t]=this.decodeString();else if(96===r)e[t]=this.decodeRef();else{if(97!==r)throw new BoomError(`Invalid string type in table: 0x${r.toString(16)}`);e[t]=BOOM_DICTIONARY_V1[this.reader.readVarint()]}break}case 114:{const r={};for(let e=0;e<n.nestedKeys.length;e++){const t=n.nestedKeys[e];switch(n.nestedTypes[e]){case 133:r[t]=0!==this.reader.readByte();break;case 128:r[t]=this.reader.readInt8();break;case 129:r[t]=this.reader.readInt16LE();break;case 130:r[t]=this.reader.readInt32LE();break;case 132:r[t]=this.reader.readFloat64LE();break;case 48:{const e=this.reader.readByte();if(48===e)r[t]=this.decodeString();else if(96===e)r[t]=this.decodeRef();else{if(97!==e)throw new BoomError(`Invalid nested string type: 0x${e.toString(16)}`);r[t]=BOOM_DICTIONARY_V1[this.reader.readVarint()]}break}default:r[t]=this.decodeValue()}}e[t]=r;break}case 113:{const r=this.reader.readVarint(),o=[];for(let e=0;e<r;e++)o.push(this.decodeValue());e[t]=o;break}default:e[t]=this.decodeValue()}}s.push(e)}return s}decodeColumnar(){const t=this.reader.readVarint(),r=this.reader.readVarint(),o=[];for(let t=0;t<r;t++){const t=this.reader.readVarint(),r=this.reader.readBytes(t);o.push(e.textDecoder.decode(r))}const s=[];for(let e=0;e<r;e++)s.push(this.reader.readByte());const n=[];for(let e=0;e<t;e++)n.push({});for(let e=0;e<r;e++){const r=o[e];switch(s[e]){case 116:{const e=this.decodeValue();for(let o=0;o<t;o++)n[o][r]=e;break}case 133:for(let e=0;e<t;e+=8){const o=this.reader.readByte();for(let s=0;s<8&&e+s<t;s++)n[e+s][r]=!!(o&1<<s)}break;case 128:for(let e=0;e<t;e++)n[e][r]=this.reader.readInt8();break;case 129:for(let e=0;e<t;e++)n[e][r]=this.reader.readInt16LE();break;case 130:for(let e=0;e<t;e++)n[e][r]=this.reader.readInt32LE();break;case 132:for(let e=0;e<t;e++)n[e][r]=this.reader.readFloat64LE();break;case 48:for(let e=0;e<t;e++){const t=this.reader.readByte();if(48===t)n[e][r]=this.decodeString();else if(96===t)n[e][r]=this.decodeRef();else{if(97!==t)throw new BoomError(`Invalid string type in columnar: 0x${t.toString(16)}`);n[e][r]=BOOM_DICTIONARY_V1[this.reader.readVarint()]}}break;default:for(let e=0;e<t;e++)n[e][r]=this.decodeValue()}}return n}decodePackedBool(){const e=this.reader.readVarint(),t=[],r=Math.ceil(e/8);for(let o=0;o<r;o++){const r=this.reader.readByte();for(let o=0;o<8&&t.length<e;o++)t.push(!!(r&1<<o))}return t}decodePackedInt8(){const e=this.reader.readVarint(),t=[];for(let r=0;r<e;r++)t.push(this.reader.readInt8());return t}decodePackedInt16(){const e=this.reader.readVarint(),t=[];for(let r=0;r<e;r++)t.push(this.reader.readInt16LE());return t}decodePackedInt32(){const e=this.reader.readVarint(),t=[];for(let r=0;r<e;r++)t.push(this.reader.readInt32LE());return t}decodePackedFloat32(){const e=this.reader.readVarint(),t=[];for(let r=0;r<e;r++)t.push(this.reader.readFloat32LE());return t}decodePackedFloat64(){const e=this.reader.readVarint(),t=[];for(let r=0;r<e;r++)t.push(this.reader.readFloat64LE());return t}},BoomTextEncoder=class{indent=0;options;constructor(e={}){this.options={...DEFAULT_OPTIONS,compact:!1,indentString:" ",...e}}encode(e){return this.indent=0,this.encodeValue(e)}get newline(){return this.options.compact?" ":"\n"}get currentIndent(){return this.options.compact?"":this.options.indentString.repeat(this.indent)}encodeValue(e){return null==e?"null":"boolean"==typeof e?e?"true":"false":"number"==typeof e?Number.isNaN(e)?"null":Number.isFinite(e)?Object.is(e,-0)?"-0":String(e):"null":"bigint"==typeof e?`${e}n`:"string"==typeof e?this.encodeString(e):e instanceof Uint8Array?this.encodeBinary(e):Array.isArray(e)?this.encodeArray(e):"object"==typeof e?this.encodeObject(e):"null"}encodeString(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}encodeBinary(e){return`<binary:${this.uint8ArrayToBase64(e)}>`}uint8ArrayToBase64(e){return"function"==typeof btoa?btoa(String.fromCharCode(...e)):Buffer.from(e).toString("base64")}encodeArray(e){if(0===e.length)return"[]";if(e.every(e=>null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"bigint"==typeof e)&&e.length<=5&&this.options.compact){return`[${e.map(e=>this.encodeValue(e)).join(" ")}]`}this.indent++;const t=e.map(e=>`${this.currentIndent}${this.encodeValue(e)}`);return this.indent--,`[${this.newline}${t.join(this.newline)}${this.newline}${this.currentIndent}]`}encodeObject(e){const t=Object.entries(e);if(0===t.length)return"{}";this.indent++;const r=t.map(([e,t])=>{const r=/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)?e:this.encodeString(e);return`${this.currentIndent}${r}: ${this.encodeValue(t)}`});return this.indent--,`{${this.newline}${r.join(this.newline)}${this.newline}${this.currentIndent}}`}},BoomTextDecoder=class{input="";pos=0;options;depth=0;constructor(e={}){this.options=mergeOptions(DEFAULT_OPTIONS,e)}decode(e){this.input=e,this.pos=0,this.depth=0,this.skipWhitespaceAndComments();const t=this.parseValue();if(this.skipWhitespaceAndComments(),this.pos<this.input.length)throw new BoomError(`Unexpected character at position ${this.pos}: ${this.input[this.pos]}`);return t}get current(){return this.pos<this.input.length?this.input[this.pos]:""}peek(e=0){const t=this.pos+e;return t<this.input.length?this.input[t]:""}advance(){if(this.pos>=this.input.length)return"";const e=this.input[this.pos];return this.pos++,e}skipWhitespaceAndComments(){for(;this.pos<this.input.length;){const e=this.current;if(" "===e||"\t"===e||"\n"===e||"\r"===e)this.pos++;else{if("#"!==e)break;for(;this.pos<this.input.length&&"\n"!==this.current;)this.pos++}}}parseValue(){this.skipWhitespaceAndComments();const e=this.current;if('"'===e)return this.parseString();if("["===e)return this.parseArray();if("{"===e)return this.parseObject();if("<"===e)return this.parseBinary();if("-"===e||"+"===e||e>="0"&&e<="9")return this.parseNumber();if(this.matchKeyword("null"))return null;if(this.matchKeyword("true"))return!0;if(this.matchKeyword("false"))return!1;throw new BoomError(`Unexpected character at position ${this.pos}: ${e}`)}matchKeyword(e){if(this.input.slice(this.pos,this.pos+e.length)===e){const t=this.input[this.pos+e.length]??"";if(!/[a-zA-Z0-9_]/.test(t))return this.pos+=e.length,!0}return!1}parseString(){this.advance();let e="";for(;this.pos<this.input.length;){const t=this.advance();if('"'===t)return e;if("\\"===t){const t=this.advance();switch(t){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case'"':e+='"';break;case"\\":e+="\\";break;case"u":{const t=this.input.slice(this.pos,this.pos+4);if(!/^[0-9a-fA-F]{4}$/.test(t))throw new BoomError(`Invalid unicode escape at position ${this.pos}`);e+=String.fromCharCode(parseInt(t,16)),this.pos+=4;break}default:e+=t}}else e+=t}throw new BoomError("Unterminated string")}parseNumber(){const e=this.pos,t=this.current;for("-"!==t&&"+"!==t||this.pos++;this.current>="0"&&this.current<="9";)this.pos++;let r=!1;if("."===this.current)for(r=!0,this.pos++;this.current>="0"&&this.current<="9";)this.pos++;const o=this.current;if("e"===o||"E"===o){r=!0,this.pos++;const e=this.current;for("-"!==e&&"+"!==e||this.pos++;this.current>="0"&&this.current<="9";)this.pos++}if("n"===this.current){this.pos++;const t=this.input.slice(e,this.pos-1);return BigInt(t)}const s=this.input.slice(e,this.pos);return r?parseFloat(s):parseInt(s,10)}parseArray(){if(this.advance(),this.depth++,this.depth>this.options.maxDepth)throw new BoomError(`Maximum nesting depth of ${this.options.maxDepth} exceeded`);const e=[];if(this.skipWhitespaceAndComments(),"]"===this.current)return this.advance(),this.depth--,e;for(;;){if(this.skipWhitespaceAndComments(),e.push(this.parseValue()),this.skipWhitespaceAndComments(),"]"===this.current){this.advance();break}","===this.current&&this.advance()}return this.depth--,e}parseObject(){if(this.advance(),this.depth++,this.depth>this.options.maxDepth)throw new BoomError(`Maximum nesting depth of ${this.options.maxDepth} exceeded`);const e={};if(this.skipWhitespaceAndComments(),"}"===this.current)return this.advance(),this.depth--,e;for(;;){let t;this.skipWhitespaceAndComments();if('"'===this.current)t=this.parseString();else{const e=this.pos;for(;/[a-zA-Z0-9_]/.test(this.current);)this.pos++;if(t=this.input.slice(e,this.pos),!t)throw new BoomError(`Expected key at position ${this.pos}`)}this.skipWhitespaceAndComments();if(":"!==this.current)throw new BoomError(`Expected ':' after key at position ${this.pos}`);this.advance(),this.skipWhitespaceAndComments(),e[t]=this.parseValue(),this.skipWhitespaceAndComments();const r=this.current;if("}"===r){this.advance();break}","===r&&this.advance()}return this.depth--,e}parseBinary(){if(!this.input.slice(this.pos).startsWith("<binary:"))throw new BoomError(`Expected binary literal at position ${this.pos}`);this.pos+=8;const e=this.input.indexOf(">",this.pos);if(-1===e)throw new BoomError("Unterminated binary literal");const t=this.input.slice(this.pos,e);return this.pos=e+1,this.base64ToUint8Array(t)}base64ToUint8Array(e){if("function"==typeof atob){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}return new Uint8Array(Buffer.from(e,"base64"))}};function processBoomScripts(){if("undefined"==typeof document)return new Map;const e=new Map;return document.querySelectorAll('script[type="text/boom"]').forEach((t,r)=>{try{const o=parseText(t.textContent??""),s=t.id||`boom-${r}`;e.set(s,o),t.dataset.boomParsed="true",t.__boomData=o}catch(e){console.error("Failed to parse BOOM script:",e)}}),e}function getBoomData(e){if("undefined"==typeof document)return;const t=document.getElementById(e);return t?.__boomData}function autoInit(){"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>processBoomScripts()):processBoomScripts())}function isUniformObjectArray(e){if(e.length<2)return!1;const t=e[0];if("object"!=typeof t||null===t||Array.isArray(t))return!1;const r=Object.keys(t).sort().join(",");for(let t=1;t<Math.min(e.length,3);t++){const o=e[t];if("object"!=typeof o||null===o||Array.isArray(o))return!1;if(Object.keys(o).sort().join(",")!==r)return!1}return!0}function encode(e,t){if(t?.forCompression&&(t={...t,enableInterning:!1,skipHeader:!0}),!t||!1!==t.enableInterning&&!t.skipHeader&&(!t.maxDepth||64===t.maxDepth))return Array.isArray(e)&&isUniformObjectArray(e)?new BoomBinaryEncoder(t||{}).encode(e):fastEncode(e);const r=new BoomBinaryEncoder(t).encode(e);return t.skipHeader?r.slice(6):r}function decode(e,t){if(t?.strictBinaryMode&&(e.length<6||66!==e[0]||79!==e[1]||79!==e[2]||77!==e[3]))throw new BoomError('Strict binary mode: input must be BOOM binary format (starts with "BOOM" magic bytes). JSON and BOOM text formats are not allowed in production mode.');let r=e;if(t?.skipHeader||t?.forCompression){const t=new Uint8Array(e.length+6);t[0]=66,t[1]=79,t[2]=79,t[3]=77,t[4]=1,t[5]=0,t.set(e,6),r=t}return t&&t.maxDepth&&64!==t.maxDepth?new BoomBinaryDecoder(t).decode(r):fastDecode(r)}function stringify(e,t){return new BoomTextEncoder(t).encode(e)}function parseText(e,t){return new BoomTextDecoder(t).decode(e)}function fromJSON(e,t){return encode(JSON.parse(e),t)}function encodeSmallest(e,t){const r=encode(e,{forCompression:!0}),o=t(r),s=JSON.stringify(e),n=(new TextEncoder).encode(s),i=t(n);return o.length<=i.length?{data:r,format:"boom",sizes:{boom:o.length,json:i.length}}:{data:n,format:"json",sizes:{boom:o.length,json:i.length}}}function decodeSmallest(e,t,r){if("json"===t){const t=(new TextDecoder).decode(e);return JSON.parse(t)}return decode(e,{...r,forCompression:!0})}function fromJSONDirect(e){const t=e.length;let r=0,o=sharedLargeBuf,s=sharedLargeView,n=o.length,i=0;const a=Object.create(null);let c=0;function f(e){const t=i+e;for(;n<t;)n*=2;const r=new Uint8Array(n);r.set(o.subarray(0,i)),o=r,s=new DataView(o.buffer)}function h(){for(;r<t;){const t=e.charCodeAt(r);if(32!==t&&9!==t&&10!==t&&13!==t)break;r++}}function d(e){if(e<128)o[i++]=e;else{let t=e;for(;t>127;)o[i++]=127&t|128,t>>>=7;o[i++]=t}}function l(e){const t=a[e];if(void 0!==t)o[i++]=96,d(t);else{a[e]=c++;const t=e.length;o[i++]=48;let r=!0;for(let o=0;o<t;o++)if(e.charCodeAt(o)>127){r=!1;break}if(r){d(t),i+t>n&&f(t);for(let r=0;r<t;r++)o[i++]=e.charCodeAt(r)}else{const t=textEncoder.encode(e);d(t.length),i+t.length>n&&f(t.length),o.set(t,i),i+=t.length}}}function u(){const o=r+1;r++;let s=!1,n=r;for(;n<t;){const t=e.charCodeAt(n);if(34===t)return r=n+1,e.slice(o,n);if(92===t){s=!0;break}n++}if(s){const s=[];for(n>o&&s.push(e.slice(o,n)),r=n;r<t;){const o=e.charCodeAt(r);if(34===o)return r++,s.join("");if(92===o){r++;switch(e.charCodeAt(r++)){case 110:s.push("\n");break;case 114:s.push("\r");break;case 116:s.push("\t");break;case 34:s.push('"');break;case 92:s.push("\\");break;case 47:s.push("/");break;case 98:s.push("\b");break;case 102:s.push("\f");break;case 117:const t=e.slice(r,r+4);s.push(String.fromCharCode(parseInt(t,16))),r+=4}}else{const o=r;for(;r<t;){const t=e.charCodeAt(r);if(34===t||92===t)break;r++}s.push(e.slice(o,r))}}return s.join("")}return e.slice(o)}function p(){if(h(),r>=t)return;const a=e.charCodeAt(r);if(123===a)!function(){r++,h(),i+6>n&&f(6);o[i++]=80;const t=i;i++;let s=0;if(125!==e.charCodeAt(r))for(;;){if(h(),34!==e.charCodeAt(r))throw new BoomError("Expected string key in object");const t=u();if(i+256>n&&f(256),l(t),h(),58!==e.charCodeAt(r))throw new BoomError("Expected : after key");r++,p(),s++,h();const o=e.charCodeAt(r);if(125===o)break;44===o&&r++}if(r++,s<128)o[t]=s;else{const e=(s<16384?2:s<2097152?3:4)-1;i+e>n&&f(e);for(let r=i-1;r>=t+1;r--)o[r+e]=o[r];i+=e;let r=t,a=s;for(;a>127;)o[r++]=127&a|128,a>>>=7;o[r]=a}}();else if(91===a)!function(){r++,h(),i+6>n&&f(6);o[i++]=64;const t=i;i++;let s=0;if(93!==e.charCodeAt(r))for(;;){p(),s++,h();const t=e.charCodeAt(r);if(93===t)break;44===t&&(r++,h())}if(r++,s<128)o[t]=s;else{const e=(s<16384?2:s<2097152?3:4)-1;i+e>n&&f(e);for(let r=i-1;r>=t+1;r--)o[r+e]=o[r];i+=e;let r=t,a=s;for(;a>127;)o[r++]=127&a|128,a>>>=7;o[r]=a}}();else if(34===a){i+256>n&&f(256);l(u())}else 116===a?(i+1>n&&f(1),o[i++]=2,r+=4):102===a?(i+1>n&&f(1),o[i++]=1,r+=5):110===a?(i+1>n&&f(1),o[i++]=0,r+=4):function(){const a=r;let c=!1;for(45===e.charCodeAt(r)&&r++;r<t;){const t=e.charCodeAt(r);if(!(t>=48&&t<=57))break;r++}if(r<t&&46===e.charCodeAt(r))for(c=!0,r++;r<t;){const t=e.charCodeAt(r);if(!(t>=48&&t<=57))break;r++}if(r<t){const o=e.charCodeAt(r);if(101===o||69===o){c=!0,r++;const o=e.charCodeAt(r);for(43!==o&&45!==o||r++;r<t;){const t=e.charCodeAt(r);if(!(t>=48&&t<=57))break;r++}}}const h=e.slice(a,r);if(c){const e=parseFloat(h);i+9>n&&f(9),o[i++]=33,s.setFloat64(i,e,!0),i+=8}else{const e=parseInt(h,10);e>=-128&&e<=127?(i+2>n&&f(2),o[i++]=16,o[i++]=255&e):e>=-32768&&e<=32767?(i+3>n&&f(3),o[i++]=17,o[i++]=255&e,o[i++]=e>>8&255):e>=-2147483648&&e<=2147483647?(i+5>n&&f(5),o[i++]=18,o[i++]=255&e,o[i++]=e>>8&255,o[i++]=e>>16&255,o[i++]=e>>24&255):(i+9>n&&f(9),o[i++]=33,s.setFloat64(i,e,!0),i+=8)}}()}return o[i++]=66,o[i++]=79,o[i++]=79,o[i++]=77,o[i++]=1,o[i++]=0,p(),o.slice(0,i)}function toJSON(e,t){const r=decode(e,t);return JSON.stringify(r,(e,t)=>"bigint"==typeof t?t.toString()+"n":t)}function compare(e){const t=JSON.stringify(e,null,2),r=JSON.stringify(e),o=encode(e),s=stringify(e),n=stringify(e,{compact:!0}),i=(e,t)=>`${(100*(1-t/e)).toFixed(1)}%`;return{jsonSize:(new TextEncoder).encode(t).length,jsonMinSize:(new TextEncoder).encode(r).length,boomBinarySize:o.length,boomTextSize:(new TextEncoder).encode(s).length,boomTextCompactSize:(new TextEncoder).encode(n).length,savings:{vsJson:i((new TextEncoder).encode(t).length,o.length),vsJsonMin:i((new TextEncoder).encode(r).length,o.length)}}}function encodeWithLength(e,t){const r=encode(e,t),o=new Uint8Array(4+r.length);return o[0]=255&r.length,o[1]=r.length>>8&255,o[2]=r.length>>16&255,o[3]=r.length>>24&255,o.set(r,4),o}function decodeFromLengthPrefixed(e,t=0,r){const o=e.length-t;if(o<4)return null;const s=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24;if(o<4+s)return null;return{value:decode(e.subarray(t+4,t+4+s),r),bytesRead:4+s}}var StreamDecoder=class{buffer;writePos=0;options;constructor(e=16384,t){this.buffer=new Uint8Array(e),this.options=t}push(e){if(this.writePos+e.length>this.buffer.length){const t=Math.max(2*this.buffer.length,this.writePos+e.length),r=new Uint8Array(t);r.set(this.buffer.subarray(0,this.writePos)),this.buffer=r}this.buffer.set(e,this.writePos),this.writePos+=e.length;const t=[];let r=0;for(;;){const e=decodeFromLengthPrefixed(this.buffer.subarray(0,this.writePos),r,this.options);if(null===e)break;t.push(e.value),r+=e.bytesRead}return r>0&&(r<this.writePos&&this.buffer.copyWithin(0,r,this.writePos),this.writePos-=r),t}get hasPending(){return this.writePos>0}clear(){this.writePos=0}},globalBoomMode="boom-binary",BoomHeaders={MIN_SIZE:"X-Boom-Min-Size",PREFER_SIZE:"X-Boom-Prefer-Size",FORCE_SIZE:"X-Boom-Force-Size",EXPECTED_SIZE:"X-Boom-Expected-Size",FORMAT:"X-Boom-Format",REASON:"X-Boom-Reason"},DEFAULT_THRESHOLDS={minSize:1024,preferSize:10240,forceSize:102400},globalThresholdConfig={minSize:DEFAULT_THRESHOLDS.minSize,preferSize:DEFAULT_THRESHOLDS.preferSize,forceSize:DEFAULT_THRESHOLDS.forceSize,autoDetect:!0,respectClientHint:!0};function setThresholdConfig(e){globalThresholdConfig={...globalThresholdConfig,...e}}function getThresholdConfig(){return{...globalThresholdConfig}}function selectFormat(e,t,r){const o=t?{...globalThresholdConfig,...t}:globalThresholdConfig;if(!o.autoDetect)return{mode:globalBoomMode,reason:"auto-detect-disabled"};if(o.respectClientHint&&r){if("large"===r||parseInt(r,10)>=o.preferSize)return{mode:"boom-binary",reason:"client-hint"};if("small"===r||parseInt(r,10)<o.minSize)return{mode:"json",reason:"client-hint"}}return e<o.minSize?{mode:"json",reason:"size-below-threshold"}:e>=o.forceSize?{mode:"boom-binary",reason:"size-above-force"}:e>=o.preferSize?{mode:"boom-binary",reason:"size-above-prefer"}:{mode:globalBoomMode,reason:"default"}}function estimateSize(e){if(null==e)return 1;if("boolean"==typeof e)return 1;if("number"==typeof e)return Number.isInteger(e)?e>=-128&&e<=127?2:e>=-32768&&e<=32767?3:e>=-2147483648&&e<=2147483647?5:9:9;if("bigint"==typeof e)return 9;if("string"==typeof e)return 2+e.length;if(e instanceof Uint8Array)return 2+e.length;if(Array.isArray(e)){let t=2;for(const r of e)t+=estimateSize(r);return t}if("object"==typeof e){let t=2;for(const r in e){t+=2+r.length;const o=e[r];void 0!==o&&(t+=estimateSize(o))}return t}return 10}function createThresholdHeaders(e){const t=e?{...globalThresholdConfig,...e}:globalThresholdConfig;return{[BoomHeaders.MIN_SIZE]:String(t.minSize),[BoomHeaders.PREFER_SIZE]:String(t.preferSize),[BoomHeaders.FORCE_SIZE]:String(t.forceSize)}}function parseThresholdHeaders(e){const t=t=>e instanceof Headers?e.get(t):e[t]||null,r=t(BoomHeaders.MIN_SIZE),o=t(BoomHeaders.PREFER_SIZE),s=t(BoomHeaders.FORCE_SIZE);if(!r&&!o&&!s)return null;const n={};return r&&(n.minSize=parseInt(r,10)),o&&(n.preferSize=parseInt(o,10)),s&&(n.forceSize=parseInt(s,10)),n}function setBoomMode(e){globalBoomMode=e}function getBoomMode(){return globalBoomMode}async function boomFetch(e,t={}){const{body:r,params:o,boomMode:s,mode:n,autoFormat:i,threshold:a,expectedSize:c,...f}=t;let h=e;if(o){const t=new URLSearchParams;for(const[e,r]of Object.entries(o))t.set(e,String(r));h+=(e.includes("?")?"&":"?")+t.toString()}const d=new Headers(f.headers);let l=null;const u={"boom-binary":"application/x-boom","boom-text":"application/x-boom-text",json:"application/json"};let p=s||globalBoomMode;if(i&&void 0!==r){const e=estimateSize(r),{mode:t}=selectFormat(e,a);p=t}if(void 0!==c&&d.set(BoomHeaders.EXPECTED_SIZE,String(c)),d.set("Accept",u[p]),void 0!==r)switch(d.set("Content-Type",u[p]),p){case"boom-binary":l=encode(r);break;case"boom-text":l=stringify(r);break;case"json":l=JSON.stringify(r)}const g={...f,headers:d,body:l};n&&(g.mode=n);const m=await fetch(h,g);if(!m.ok)throw new Error(`HTTP ${m.status}: ${m.statusText}`);const b=m.headers.get("Content-Type")||"";if(b.includes("application/x-boom-text")){return parseText(await m.text())}if(b.includes("application/x-boom")){const e=await m.arrayBuffer();return decode(new Uint8Array(e))}return m.json()}function createBoomAxios(e={}){let t=e.boomMode||globalBoomMode;const r=e.baseURL||"",o=e.headers||{},s=async(e,s,n,i)=>{const a={method:e,boomMode:t,headers:o};void 0!==n&&(a.body=n),void 0!==i&&(a.params=i);return{data:await boomFetch(r+s,a)}};return{get:(e,t)=>s("GET",e,void 0,t?.params),post:(e,t)=>s("POST",e,t),put:(e,t)=>s("PUT",e,t),patch:(e,t)=>s("PATCH",e,t),delete:e=>s("DELETE",e),setBoomMode:e=>{t=e}}}function createBoomGraphQL(e){let t=e.boomMode||globalBoomMode;const r=async(r,o)=>{const s={query:r};o&&(s.variables=o);const n={method:"POST",body:s,boomMode:t};e.headers&&(n.headers=e.headers);const i=await boomFetch(e.url,n);if(i.errors?.length)throw new Error(i.errors.map(e=>e.message).join(", "));return i.data};return{query:r,mutate:r,setBoomMode:e=>{t=e}}}var encodeFn,decodeFn,stringifyFn,parseTextFn,core_default={encode:encode,decode:decode,stringify:stringify,parseText:parseText,fromJSON:fromJSON,toJSON:toJSON,compare:compare,encodeWithLength:encodeWithLength,decodeFromLengthPrefixed:decodeFromLengthPrefixed,StreamDecoder:StreamDecoder,processBoomScripts:processBoomScripts,getBoomData:getBoomData,autoInit:autoInit,BoomError:BoomError,setBoomMode:setBoomMode,getBoomMode:getBoomMode,boomFetch:boomFetch,createBoomAxios:createBoomAxios,createBoomGraphQL:createBoomGraphQL,BoomHeaders:BoomHeaders,DEFAULT_THRESHOLDS:DEFAULT_THRESHOLDS,setThresholdConfig:setThresholdConfig,getThresholdConfig:getThresholdConfig,selectFormat:selectFormat,estimateSize:estimateSize,createThresholdHeaders:createThresholdHeaders,parseThresholdHeaders:parseThresholdHeaders};function setCodecs(e,t,r,o){encodeFn=e,decodeFn=t,stringifyFn=r,parseTextFn=o}async function boomFetch2(e,t={}){const{body:r,params:o,boomMode:s,mode:n,autoFormat:i,threshold:a,expectedSize:c,...f}=t;let h=e;if(o){const t=new URLSearchParams;for(const[e,r]of Object.entries(o))t.set(e,String(r));h+=(e.includes("?")?"&":"?")+t.toString()}const d=new Headers(f.headers);let l=null;const u={"boom-binary":"application/x-boom","boom-text":"application/x-boom-text",json:"application/json"};let p=s||getBoomMode();if(i&&void 0!==r){const e=estimateSize(r),{mode:t}=selectFormat(e,a);p=t}if(void 0!==c&&d.set(BoomHeaders.EXPECTED_SIZE,String(c)),d.set("Accept",u[p]),void 0!==r)switch(d.set("Content-Type",u[p]),p){case"boom-binary":l=encodeFn(r);break;case"boom-text":l=stringifyFn(r);break;case"json":l=JSON.stringify(r)}const g={...f,headers:d,body:l};n&&(g.mode=n);const m=await fetch(h,g);if(!m.ok)throw new Error(`HTTP ${m.status}: ${m.statusText}`);const b=m.headers.get("Content-Type")||"";if(b.includes("application/x-boom-text")){const e=await m.text();return parseTextFn(e)}if(b.includes("application/x-boom")){const e=await m.arrayBuffer();return decodeFn(new Uint8Array(e))}return m.json()}function createBoomAxios2(e={}){let t=e.boomMode||getBoomMode();const r=e.baseURL||"",o=e.headers||{},s=async(e,s,n,i)=>{const a={method:e,boomMode:t,headers:o};void 0!==n&&(a.body=n),void 0!==i&&(a.params=i);return{data:await boomFetch2(r+s,a)}};return{get:(e,t)=>s("GET",e,void 0,t?.params),post:(e,t)=>s("POST",e,t),put:(e,t)=>s("PUT",e,t),patch:(e,t)=>s("PATCH",e,t),delete:e=>s("DELETE",e),setBoomMode:e=>{t=e}}}function createBoomGraphQL2(e){let t=e.boomMode||getBoomMode();const r=async(r,o)=>{const s={query:r};o&&(s.variables=o);const n={method:"POST",body:s,boomMode:t};e.headers&&(n.headers=e.headers);const i=await boomFetch2(e.url,n);if(i.errors?.length)throw new Error(i.errors.map(e=>e.message).join(", "));return i.data};return{query:r,mutate:r,setBoomMode:e=>{t=e}}}var parseTextFn2=null;function setParseText(e){parseTextFn2=e}function processBoomScripts2(){if("undefined"==typeof document)return new Map;if(!parseTextFn2)throw new Error("parseText function not initialized");const e=new Map;return document.querySelectorAll('script[type="text/boom"]').forEach((t,r)=>{try{const o=t.textContent??"",s=parseTextFn2(o),n=t.id||`boom-${r}`;e.set(n,s),t.dataset.boomParsed="true",t.__boomData=s}catch(e){console.error("Failed to parse BOOM script:",e)}}),e}function getBoomData2(e){if("undefined"==typeof document)return;const t=document.getElementById(e);return t?.__boomData}function autoInit2(){"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>processBoomScripts2()):processBoomScripts2())}var MAGIC=new Uint8Array([66,79,79,77]),VERSION2=1,DEFAULT_OPTIONS2={maxDepth:64,maxStringLength:16777216,maxArrayLength:1e6,enableInterning:!0,skipHeader:!1,forCompression:!1};setParseText(parseText),setCodecs(encode,decode,stringify,parseText);var index_default=core_default;
|
|
2
|
+
/**
|
|
3
|
+
* BOOM - Binary Object Optimised Markup
|
|
4
|
+
* A compact binary serialisation format with readable debug mode
|
|
5
|
+
*
|
|
6
|
+
* @module boom-format
|
|
7
|
+
* @version 1.0.0
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* BOOM - Binary Object Optimised Markup
|
|
12
|
+
* A compact binary serialization format with readable debug mode
|
|
13
|
+
*
|
|
14
|
+
* @module boom-format
|
|
15
|
+
* @version 1.0.0
|
|
16
|
+
* @license MIT
|
|
17
|
+
*/
|
package/dist/boom.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BOOM_DICTIONARY_V1 as a,BoomError as o,BoomHeaders as r,ByteReader as s,ByteWriter as t,DEFAULT_THRESHOLDS as O,MAGIC as e,StreamDecoder as f,VERSION as m,analyzeDictionary as p,autoInit as u,boomFetch as J,compare as S,createBoomAxios as c,createBoomGraphQL as d,createThresholdHeaders as h,decode as i,decodeFromLengthPrefixed as j,decodeSmallest as k,encode as l,encodeSmallest as n,encodeWithLength as x,estimateSize as B,fromJSON as E,fromJSONDirect as H,getBoomData as I,getBoomMode as M,getThresholdConfig as N,index_default as P,parseText as Q,parseThresholdHeaders as R,processBoomScripts as V,selectFormat as _,setBoomMode as b,setThresholdConfig as g,stringify as q,toJSON as v,zigzagDecode as w,zigzagEncode as y}from"./chunk-5PQH6SJJ.js";export{a as BOOM_DICTIONARY_V1,m as BOOM_VERSION,o as BoomError,r as BoomHeaders,s as ByteReader,t as ByteWriter,O as DEFAULT_THRESHOLDS,e as MAGIC,f as StreamDecoder,p as analyzeDictionary,u as autoInit,J as boomFetch,S as compare,c as createBoomAxios,d as createBoomGraphQL,h as createThresholdHeaders,i as decode,j as decodeFromLengthPrefixed,k as decodeSmallest,P as default,l as encode,n as encodeSmallest,x as encodeWithLength,B as estimateSize,E as fromJSON,H as fromJSONDirect,I as getBoomData,M as getBoomMode,N as getThresholdConfig,Q as parseText,R as parseThresholdHeaders,V as processBoomScripts,_ as selectFormat,b as setBoomMode,g as setThresholdConfig,q as stringify,v as toJSON,w as zigzagDecode,y as zigzagEncode};
|
package/dist/boom.obf.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x48449b,_0x135f74){var _0x4829f7=a0_0x4ef7,_0x346b6f=_0x48449b();while(!![]){try{var _0x4450e5=parseInt(_0x4829f7(0x13b))/0x1*(-parseInt(_0x4829f7(0x140))/0x2)+parseInt(_0x4829f7(0x141))/0x3*(parseInt(_0x4829f7(0x143))/0x4)+parseInt(_0x4829f7(0x13d))/0x5+parseInt(_0x4829f7(0x13a))/0x6+parseInt(_0x4829f7(0x13e))/0x7*(-parseInt(_0x4829f7(0x144))/0x8)+parseInt(_0x4829f7(0x142))/0x9*(-parseInt(_0x4829f7(0x13f))/0xa)+-parseInt(_0x4829f7(0x145))/0xb*(-parseInt(_0x4829f7(0x13c))/0xc);if(_0x4450e5===_0x135f74)break;else _0x346b6f['push'](_0x346b6f['shift']());}catch(_0x47d521){_0x346b6f['push'](_0x346b6f['shift']());}}}(a0_0x3663,0x4b0ec));import{BOOM_DICTIONARY_V1 as a0_0x386fb1,BoomError as a0_0x491949,BoomHeaders as a0_0x28120d,ByteReader as a0_0x29d4d1,ByteWriter as a0_0x181f9b,DEFAULT_THRESHOLDS as a0_0x1533d7,MAGIC as a0_0x3534e8,StreamDecoder as a0_0xa8647e,VERSION as a0_0x37b8af,analyzeDictionary as a0_0x1b3a6e,autoInit as a0_0xab010e,boomFetch as a0_0x59e230,compare as a0_0x233197,createBoomAxios as a0_0x3c457a,createBoomGraphQL as a0_0x5772a5,createThresholdHeaders as a0_0xa787d0,decode as a0_0x5976bd,decodeFromLengthPrefixed as a0_0xafd31c,decodeSmallest as a0_0x7299a4,encode as a0_0x33ec85,encodeSmallest as a0_0x1ebc99,encodeWithLength as a0_0x7c57c,estimateSize as a0_0xc934b4,fromJSON as a0_0x24dd0b,fromJSONDirect as a0_0x3c38d7,getBoomData as a0_0xffe451,getBoomMode as a0_0x46e80c,getThresholdConfig as a0_0xf54c77,index_default as a0_0x421d9e,parseText as a0_0x2a5315,parseThresholdHeaders as a0_0x3ba21c,processBoomScripts as a0_0x2c106f,selectFormat as a0_0x5df8d9,setBoomMode as a0_0x400824,setThresholdConfig as a0_0x232b4b,stringify as a0_0x463d01,toJSON as a0_0x52cf4a,zigzagDecode as a0_0xdbbfef,zigzagEncode as a0_0x319563}from'./chunk-5PQH6SJJ.js';function a0_0x4ef7(_0x161c2a,_0x27e1f2){_0x161c2a=_0x161c2a-0x13a;var _0x36637c=a0_0x3663();var _0x4ef7e1=_0x36637c[_0x161c2a];if(a0_0x4ef7['CncSLp']===undefined){var _0x4cac9c=function(_0x3e6992){var _0x154880='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x386fb1='',_0x491949='';for(var _0x28120d=0x0,_0x29d4d1,_0x181f9b,_0x1533d7=0x0;_0x181f9b=_0x3e6992['charAt'](_0x1533d7++);~_0x181f9b&&(_0x29d4d1=_0x28120d%0x4?_0x29d4d1*0x40+_0x181f9b:_0x181f9b,_0x28120d++%0x4)?_0x386fb1+=String['fromCharCode'](0xff&_0x29d4d1>>(-0x2*_0x28120d&0x6)):0x0){_0x181f9b=_0x154880['indexOf'](_0x181f9b);}for(var _0x3534e8=0x0,_0xa8647e=_0x386fb1['length'];_0x3534e8<_0xa8647e;_0x3534e8++){_0x491949+='%'+('00'+_0x386fb1['charCodeAt'](_0x3534e8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x491949);};a0_0x4ef7['hdcXZw']=_0x4cac9c,a0_0x4ef7['aIBFUa']={},a0_0x4ef7['CncSLp']=!![];}var _0x462cf8=_0x36637c[0x0],_0x67881d=_0x161c2a+_0x462cf8,_0x14d08f=a0_0x4ef7['aIBFUa'][_0x67881d];return!_0x14d08f?(_0x4ef7e1=a0_0x4ef7['hdcXZw'](_0x4ef7e1),a0_0x4ef7['aIBFUa'][_0x67881d]=_0x4ef7e1):_0x4ef7e1=_0x14d08f,_0x4ef7e1;}export{a0_0x386fb1 as BOOM_DICTIONARY_V1,a0_0x37b8af as BOOM_VERSION,a0_0x491949 as BoomError,a0_0x28120d as BoomHeaders,a0_0x29d4d1 as ByteReader,a0_0x181f9b as ByteWriter,a0_0x1533d7 as DEFAULT_THRESHOLDS,a0_0x3534e8 as MAGIC,a0_0xa8647e as StreamDecoder,a0_0x1b3a6e as analyzeDictionary,a0_0xab010e as autoInit,a0_0x59e230 as boomFetch,a0_0x233197 as compare,a0_0x3c457a as createBoomAxios,a0_0x5772a5 as createBoomGraphQL,a0_0xa787d0 as createThresholdHeaders,a0_0x5976bd as decode,a0_0xafd31c as decodeFromLengthPrefixed,a0_0x7299a4 as decodeSmallest,a0_0x421d9e as default,a0_0x33ec85 as encode,a0_0x1ebc99 as encodeSmallest,a0_0x7c57c as encodeWithLength,a0_0xc934b4 as estimateSize,a0_0x24dd0b as fromJSON,a0_0x3c38d7 as fromJSONDirect,a0_0xffe451 as getBoomData,a0_0x46e80c as getBoomMode,a0_0xf54c77 as getThresholdConfig,a0_0x2a5315 as parseText,a0_0x3ba21c as parseThresholdHeaders,a0_0x2c106f as processBoomScripts,a0_0x5df8d9 as selectFormat,a0_0x400824 as setBoomMode,a0_0x232b4b as setThresholdConfig,a0_0x463d01 as stringify,a0_0x52cf4a as toJSON,a0_0xdbbfef as zigzagDecode,a0_0x319563 as zigzagEncode};function a0_0x3663(){var _0x5ab765=['n1fsuhvgza','mJiXodbhCvDPrK0','mZm4u3vvzeXV','nJC2ntGXy3f1AuTS','mJmXm3PRv1D2zG','ogX0u3Ptuq','ndq3odqZmMfbvNPICq','mtuWotyXnJLNB2Lnqvu','nZa1mJm0qMrkAfPx','mZu4m0fZvxbVEG','mtj2zvzsB3G','nta5mta1DKDOrhjf'];a0_0x3663=function(){return _0x5ab765;};return a0_0x3663();}
|