@nejs/basic-extensions 2.2.1 → 2.3.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/README.md +143 -65
- package/dist/@nejs/{basic-extensions.bundle.2.2.0.js → basic-extensions.bundle.2.2.1.js} +5 -5
- package/dist/@nejs/basic-extensions.bundle.2.2.1.js.map +7 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stringextensions.d.ts +13 -0
- package/dist/cjs/stringextensions.js +129 -1
- package/dist/cjs/stringextensions.js.map +1 -1
- package/dist/mjs/index.js +2 -1
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/stringextensions.d.ts +13 -0
- package/dist/mjs/stringextensions.js +128 -0
- package/dist/mjs/stringextensions.js.map +1 -1
- package/docs/index.html +618 -175
- package/package.json +2 -2
- package/src/index.js +6 -5
- package/src/stringextensions.js +139 -0
- package/tests/arrayextensions.test.js +54 -0
- package/tests/stringextensions.test.js +60 -0
- package/dist/@nejs/basic-extensions.bundle.2.2.0.js.map +0 -7
package/README.md
CHANGED
|
@@ -129,77 +129,83 @@ import { FunctionExtensions } from '@nejs/basic-extensions';
|
|
|
129
129
|
* [StringExtensions](#stringextensions)
|
|
130
130
|
* [isString](#isstring)
|
|
131
131
|
* [Parameters](#parameters-30)
|
|
132
|
+
* [parenthesisPair](#parenthesispair)
|
|
133
|
+
* [squareBracketsPair](#squarebracketspair)
|
|
134
|
+
* [curlyBracketsPair](#curlybracketspair)
|
|
135
|
+
* [StringPrototypeExtensions](#stringprototypeextensions)
|
|
136
|
+
* [extractSubstring](#extractsubstring)
|
|
137
|
+
* [Parameters](#parameters-31)
|
|
132
138
|
* [SymbolExtensions](#symbolextensions)
|
|
133
139
|
* [isSymbol](#issymbol)
|
|
134
|
-
* [Parameters](#parameters-31)
|
|
135
|
-
* [isRegistered](#isregistered)
|
|
136
140
|
* [Parameters](#parameters-32)
|
|
137
|
-
* [
|
|
141
|
+
* [isRegistered](#isregistered)
|
|
138
142
|
* [Parameters](#parameters-33)
|
|
143
|
+
* [isNonRegistered](#isnonregistered)
|
|
144
|
+
* [Parameters](#parameters-34)
|
|
139
145
|
* [ArrayPrototypeExtensions](#arrayprototypeextensions)
|
|
140
146
|
* [contains](#contains-1)
|
|
141
|
-
* [Parameters](#parameters-34)
|
|
142
|
-
* [findEntry](#findentry)
|
|
143
147
|
* [Parameters](#parameters-35)
|
|
148
|
+
* [findEntry](#findentry)
|
|
149
|
+
* [Parameters](#parameters-36)
|
|
144
150
|
* [first](#first)
|
|
145
151
|
* [last](#last)
|
|
146
152
|
* [object](#object)
|
|
147
153
|
* [constructor](#constructor)
|
|
148
|
-
* [Parameters](#parameters-
|
|
154
|
+
* [Parameters](#parameters-37)
|
|
149
155
|
* [isAccessor](#isaccessor)
|
|
150
156
|
* [isData](#isdata)
|
|
151
157
|
* [isDescriptor](#isdescriptor)
|
|
152
158
|
* [configurable](#configurable)
|
|
153
159
|
* [configurable](#configurable-1)
|
|
154
|
-
* [Parameters](#parameters-
|
|
160
|
+
* [Parameters](#parameters-38)
|
|
155
161
|
* [enumerable](#enumerable)
|
|
156
162
|
* [enumerable](#enumerable-1)
|
|
157
|
-
* [Parameters](#parameters-
|
|
163
|
+
* [Parameters](#parameters-39)
|
|
158
164
|
* [writable](#writable)
|
|
159
165
|
* [writable](#writable-1)
|
|
160
|
-
* [Parameters](#parameters-
|
|
166
|
+
* [Parameters](#parameters-40)
|
|
161
167
|
* [value](#value)
|
|
162
168
|
* [value](#value-1)
|
|
163
|
-
* [Parameters](#parameters-
|
|
169
|
+
* [Parameters](#parameters-41)
|
|
164
170
|
* [get](#get)
|
|
165
171
|
* [get](#get-1)
|
|
166
|
-
* [Parameters](#parameters-
|
|
172
|
+
* [Parameters](#parameters-42)
|
|
167
173
|
* [boundGet](#boundget)
|
|
168
174
|
* [set](#set)
|
|
169
175
|
* [set](#set-1)
|
|
170
|
-
* [Parameters](#parameters-
|
|
176
|
+
* [Parameters](#parameters-43)
|
|
171
177
|
* [boundSet](#boundset)
|
|
172
178
|
* [hasObject](#hasobject)
|
|
173
179
|
* [object](#object-1)
|
|
174
180
|
* [object](#object-2)
|
|
175
|
-
* [Parameters](#parameters-43)
|
|
176
|
-
* [for](#for)
|
|
177
181
|
* [Parameters](#parameters-44)
|
|
178
|
-
* [
|
|
182
|
+
* [for](#for)
|
|
179
183
|
* [Parameters](#parameters-45)
|
|
180
|
-
* [
|
|
184
|
+
* [applyTo](#applyto)
|
|
181
185
|
* [Parameters](#parameters-46)
|
|
182
|
-
* [
|
|
186
|
+
* [toObject](#toobject)
|
|
183
187
|
* [Parameters](#parameters-47)
|
|
188
|
+
* [toPrimitive](#toprimitive)
|
|
189
|
+
* [Parameters](#parameters-48)
|
|
184
190
|
* [toStringTag](#tostringtag)
|
|
185
191
|
* [for](#for-1)
|
|
186
|
-
* [Parameters](#parameters-48)
|
|
187
|
-
* [getData](#getdata)
|
|
188
192
|
* [Parameters](#parameters-49)
|
|
189
|
-
* [
|
|
193
|
+
* [getData](#getdata)
|
|
190
194
|
* [Parameters](#parameters-50)
|
|
191
|
-
* [
|
|
195
|
+
* [getAccessor](#getaccessor)
|
|
192
196
|
* [Parameters](#parameters-51)
|
|
193
|
-
* [
|
|
197
|
+
* [base](#base)
|
|
194
198
|
* [Parameters](#parameters-52)
|
|
195
|
-
* [
|
|
199
|
+
* [accessor](#accessor)
|
|
196
200
|
* [Parameters](#parameters-53)
|
|
197
|
-
* [
|
|
201
|
+
* [data](#data)
|
|
198
202
|
* [Parameters](#parameters-54)
|
|
199
|
-
* [
|
|
203
|
+
* [isDescriptor](#isdescriptor-1)
|
|
200
204
|
* [Parameters](#parameters-55)
|
|
201
|
-
* [
|
|
205
|
+
* [isData](#isdata-1)
|
|
202
206
|
* [Parameters](#parameters-56)
|
|
207
|
+
* [isAccessor](#isaccessor-1)
|
|
208
|
+
* [Parameters](#parameters-57)
|
|
203
209
|
* [flexible](#flexible)
|
|
204
210
|
* [enigmatic](#enigmatic)
|
|
205
211
|
* [intrinsic](#intrinsic)
|
|
@@ -208,100 +214,100 @@ import { FunctionExtensions } from '@nejs/basic-extensions';
|
|
|
208
214
|
* [ACCESSOR\_KEYS](#accessor_keys)
|
|
209
215
|
* [DATA\_KEYS](#data_keys)
|
|
210
216
|
* [maskAs](#maskas)
|
|
211
|
-
* [Parameters](#parameters-57)
|
|
212
|
-
* [maskAsString](#maskasstring)
|
|
213
217
|
* [Parameters](#parameters-58)
|
|
214
|
-
* [
|
|
218
|
+
* [maskAsString](#maskasstring)
|
|
215
219
|
* [Parameters](#parameters-59)
|
|
216
|
-
* [
|
|
220
|
+
* [maskAsNumber](#maskasnumber)
|
|
217
221
|
* [Parameters](#parameters-60)
|
|
218
|
-
* [
|
|
222
|
+
* [GenericMask](#genericmask)
|
|
219
223
|
* [Parameters](#parameters-61)
|
|
220
|
-
* [
|
|
224
|
+
* [StringMask](#stringmask)
|
|
221
225
|
* [Parameters](#parameters-62)
|
|
226
|
+
* [NumberMask](#numbermask)
|
|
227
|
+
* [Parameters](#parameters-63)
|
|
222
228
|
* [RefSet](#refset)
|
|
223
229
|
* [objectifying](#objectifying)
|
|
224
|
-
* [Parameters](#parameters-
|
|
230
|
+
* [Parameters](#parameters-64)
|
|
225
231
|
* [objectifyValues](#objectifyvalues)
|
|
226
232
|
* [objectifyValues](#objectifyvalues-1)
|
|
227
|
-
* [Parameters](#parameters-64)
|
|
228
|
-
* [add](#add)
|
|
229
233
|
* [Parameters](#parameters-65)
|
|
230
|
-
* [
|
|
234
|
+
* [add](#add)
|
|
231
235
|
* [Parameters](#parameters-66)
|
|
236
|
+
* [addAll](#addall)
|
|
237
|
+
* [Parameters](#parameters-67)
|
|
232
238
|
* [clean](#clean)
|
|
233
239
|
* [entries](#entries-1)
|
|
234
|
-
* [Parameters](#parameters-67)
|
|
235
|
-
* [forEach](#foreach)
|
|
236
240
|
* [Parameters](#parameters-68)
|
|
241
|
+
* [forEach](#foreach)
|
|
242
|
+
* [Parameters](#parameters-69)
|
|
237
243
|
* [values](#values-1)
|
|
238
244
|
* [keys](#keys)
|
|
239
245
|
* [has](#has)
|
|
240
|
-
* [Parameters](#parameters-69)
|
|
241
|
-
* [contains](#contains-2)
|
|
242
246
|
* [Parameters](#parameters-70)
|
|
243
|
-
* [
|
|
247
|
+
* [contains](#contains-2)
|
|
244
248
|
* [Parameters](#parameters-71)
|
|
245
|
-
* [
|
|
249
|
+
* [filter](#filter)
|
|
246
250
|
* [Parameters](#parameters-72)
|
|
247
|
-
* [
|
|
251
|
+
* [find](#find-1)
|
|
248
252
|
* [Parameters](#parameters-73)
|
|
253
|
+
* [map](#map-1)
|
|
254
|
+
* [Parameters](#parameters-74)
|
|
249
255
|
* [toStringTag](#tostringtag-1)
|
|
250
256
|
* [RefMap](#refmap)
|
|
251
|
-
* [Parameters](#parameters-
|
|
257
|
+
* [Parameters](#parameters-75)
|
|
252
258
|
* [objectifying](#objectifying-1)
|
|
253
|
-
* [Parameters](#parameters-
|
|
259
|
+
* [Parameters](#parameters-76)
|
|
254
260
|
* [asObject](#asobject)
|
|
255
261
|
* [objectifyValues](#objectifyvalues-2)
|
|
256
262
|
* [objectifyValues](#objectifyvalues-3)
|
|
257
|
-
* [Parameters](#parameters-76)
|
|
258
|
-
* [get](#get-2)
|
|
259
263
|
* [Parameters](#parameters-77)
|
|
260
|
-
* [
|
|
264
|
+
* [get](#get-2)
|
|
261
265
|
* [Parameters](#parameters-78)
|
|
262
|
-
* [
|
|
266
|
+
* [set](#set-2)
|
|
263
267
|
* [Parameters](#parameters-79)
|
|
268
|
+
* [setAll](#setall)
|
|
269
|
+
* [Parameters](#parameters-80)
|
|
264
270
|
* [clean](#clean-1)
|
|
265
271
|
* [entries](#entries-2)
|
|
266
|
-
* [Parameters](#parameters-80)
|
|
267
|
-
* [forEach](#foreach-1)
|
|
268
272
|
* [Parameters](#parameters-81)
|
|
273
|
+
* [forEach](#foreach-1)
|
|
274
|
+
* [Parameters](#parameters-82)
|
|
269
275
|
* [values](#values-2)
|
|
270
276
|
* [hasValue](#hasvalue)
|
|
271
|
-
* [Parameters](#parameters-82)
|
|
272
|
-
* [filter](#filter-1)
|
|
273
277
|
* [Parameters](#parameters-83)
|
|
274
|
-
* [
|
|
278
|
+
* [filter](#filter-1)
|
|
275
279
|
* [Parameters](#parameters-84)
|
|
276
|
-
* [
|
|
280
|
+
* [find](#find-2)
|
|
277
281
|
* [Parameters](#parameters-85)
|
|
282
|
+
* [map](#map-2)
|
|
283
|
+
* [Parameters](#parameters-86)
|
|
278
284
|
* [iterator](#iterator)
|
|
279
285
|
* [toStringTag](#tostringtag-2)
|
|
280
286
|
* [isValidReference](#isvalidreference)
|
|
281
|
-
* [Parameters](#parameters-86)
|
|
282
|
-
* [Deferred](#deferred)
|
|
283
287
|
* [Parameters](#parameters-87)
|
|
288
|
+
* [Deferred](#deferred)
|
|
289
|
+
* [Parameters](#parameters-88)
|
|
284
290
|
* [value](#value-2)
|
|
285
291
|
* [reason](#reason)
|
|
286
292
|
* [settled](#settled)
|
|
287
293
|
* [promise](#promise)
|
|
288
294
|
* [resolve](#resolve)
|
|
289
|
-
* [Parameters](#parameters-88)
|
|
290
|
-
* [reject](#reject)
|
|
291
295
|
* [Parameters](#parameters-89)
|
|
296
|
+
* [reject](#reject)
|
|
297
|
+
* [Parameters](#parameters-90)
|
|
292
298
|
* [species](#species)
|
|
293
299
|
* [promise](#promise-1)
|
|
294
300
|
* [reject](#reject-1)
|
|
295
301
|
* [resolve](#resolve-1)
|
|
296
302
|
* [settled](#settled-1)
|
|
297
303
|
* [AsyncIterable](#asynciterable)
|
|
298
|
-
* [Parameters](#parameters-
|
|
304
|
+
* [Parameters](#parameters-91)
|
|
299
305
|
* [asyncIterator](#asynciterator)
|
|
300
306
|
* [toStringTag](#tostringtag-3)
|
|
301
307
|
* [isAsyncIterable](#isasynciterable)
|
|
302
|
-
* [Parameters](#parameters-
|
|
308
|
+
* [Parameters](#parameters-92)
|
|
303
309
|
* [AsyncIterator](#asynciterator-1)
|
|
304
|
-
* [Parameters](#parameters-
|
|
310
|
+
* [Parameters](#parameters-93)
|
|
305
311
|
* [asArray](#asarray)
|
|
306
312
|
* [asyncIterable](#asynciterable-1)
|
|
307
313
|
* [next](#next)
|
|
@@ -309,14 +315,14 @@ import { FunctionExtensions } from '@nejs/basic-extensions';
|
|
|
309
315
|
* [asyncIterator](#asynciterator-2)
|
|
310
316
|
* [toStringTag](#tostringtag-4)
|
|
311
317
|
* [Iterable](#iterable)
|
|
312
|
-
* [Parameters](#parameters-
|
|
318
|
+
* [Parameters](#parameters-94)
|
|
313
319
|
* [iterator](#iterator-1)
|
|
314
320
|
* [asArray](#asarray-1)
|
|
315
321
|
* [toStringTag](#tostringtag-5)
|
|
316
322
|
* [isIterable](#isiterable)
|
|
317
|
-
* [Parameters](#parameters-
|
|
323
|
+
* [Parameters](#parameters-95)
|
|
318
324
|
* [Iterator](#iterator-2)
|
|
319
|
-
* [Parameters](#parameters-
|
|
325
|
+
* [Parameters](#parameters-96)
|
|
320
326
|
* [asArray](#asarray-2)
|
|
321
327
|
* [iterable](#iterable-1)
|
|
322
328
|
* [next](#next-1)
|
|
@@ -931,6 +937,78 @@ true if the string matches typeof or instanceof as a string.
|
|
|
931
937
|
|
|
932
938
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if it is a `String`, `false` otherwise
|
|
933
939
|
|
|
940
|
+
#### parenthesisPair
|
|
941
|
+
|
|
942
|
+
A getter property that returns a pair of parentheses as an array.
|
|
943
|
+
This property can be used when operations require a clear distinction
|
|
944
|
+
between the opening and closing parentheses, such as parsing or
|
|
945
|
+
matching balanced expressions in strings.
|
|
946
|
+
|
|
947
|
+
Returns **\[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)]** An array containing a pair of strings: the
|
|
948
|
+
opening parenthesis '(' as the first element, and the closing parenthesis
|
|
949
|
+
')' as the second element.
|
|
950
|
+
|
|
951
|
+
#### squareBracketsPair
|
|
952
|
+
|
|
953
|
+
A getter property that returns a pair of square brackets as an array.
|
|
954
|
+
This property is particularly useful for operations that require a clear
|
|
955
|
+
distinction between the opening and closing square brackets, such as
|
|
956
|
+
parsing arrays in strings or matching balanced expressions within
|
|
957
|
+
square brackets.
|
|
958
|
+
|
|
959
|
+
Returns **\[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)]** An array containing a pair of strings: the
|
|
960
|
+
opening square bracket '\[' as the first element, and the closing square
|
|
961
|
+
bracket ']' as the second element.
|
|
962
|
+
|
|
963
|
+
#### curlyBracketsPair
|
|
964
|
+
|
|
965
|
+
A getter property that returns a pair of curly brackets as an array.
|
|
966
|
+
This property is particularly useful for operations that require a clear
|
|
967
|
+
distinction between the opening and closing curly brackets, such as
|
|
968
|
+
parsing objects in strings or matching balanced expressions within
|
|
969
|
+
curly brackets. The returned array consists of the opening curly bracket
|
|
970
|
+
'{' as the first element, and the closing curly bracket '}' as the
|
|
971
|
+
second element.
|
|
972
|
+
|
|
973
|
+
Returns **\[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)]** An array containing a pair of strings: the
|
|
974
|
+
opening curly bracket '{' as the first element, and the closing curly
|
|
975
|
+
bracket '}' as the second element.
|
|
976
|
+
|
|
977
|
+
### StringPrototypeExtensions
|
|
978
|
+
|
|
979
|
+
`StringPrototypeExtensions` provides a set of utility methods that are
|
|
980
|
+
added to the `String` prototype. This allows all string instances to
|
|
981
|
+
access new functionality directly, enhancing their capabilities beyond
|
|
982
|
+
the standard `String` class methods. These extensions are applied using
|
|
983
|
+
the `Patch` class from '@nejs/extension', ensuring that they do not
|
|
984
|
+
interfere with the global namespace or existing properties.
|
|
985
|
+
|
|
986
|
+
The extensions include methods for extracting substrings based on
|
|
987
|
+
specific tokens, checking the presence of certain patterns, and more,
|
|
988
|
+
making string manipulation tasks more convenient and expressive.
|
|
989
|
+
|
|
990
|
+
#### extractSubstring
|
|
991
|
+
|
|
992
|
+
Extracts a substring from the current string, starting at a given offset
|
|
993
|
+
and bounded by specified opening and closing tokens. This method is
|
|
994
|
+
particularly useful for parsing nested structures or quoted strings,
|
|
995
|
+
where the level of nesting or the presence of escape characters must
|
|
996
|
+
be considered.
|
|
997
|
+
|
|
998
|
+
##### Parameters
|
|
999
|
+
|
|
1000
|
+
* `offset` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The position in the string from which to start the
|
|
1001
|
+
search for the substring. (optional, default `0`)
|
|
1002
|
+
* `tokens` **\[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)]** An array containing two strings: the
|
|
1003
|
+
opening and closing tokens that define the boundaries of the substring
|
|
1004
|
+
to be extracted. (optional, default `parenthesisPair`)
|
|
1005
|
+
|
|
1006
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** An object with two properties: `extracted`, the
|
|
1007
|
+
extracted substring, and `newOffset`, the position in the original
|
|
1008
|
+
string immediately after the end of the extracted substring. If no
|
|
1009
|
+
substring is found, `extracted` is `null` and `newOffset` is the same
|
|
1010
|
+
as the input offset.
|
|
1011
|
+
|
|
934
1012
|
### SymbolExtensions
|
|
935
1013
|
|
|
936
1014
|
`SymbolExtensions` is a patch for the JavaScript built-in `Symbol` class. It
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var nejsBasicExtensions=(()=>{var
|
|
2
|
-
`,c)}if(Reflect.has(this.owner,i))try{this.patchConflicts[i]=new
|
|
3
|
-
`,c)}}),r.patches.has(t)||r.patches.set(t,[]),r.patches.get(t).push(this)}get entries(){return Reflect.ownKeys(this.patchEntries).map(t=>[t,this.patchEntries[t]])}get appliedEntries(){return Reflect.ownKeys(this.patchEntries).filter(t=>this.patchState.get(t)===!0).map(t=>[t,this.patchEntries[t]])}get unappliedEntries(){return Reflect.ownKeys(this.patchEntries).filter(t=>this.patchState.get(t)===!1).map(t=>[t,this.patchEntries[t]])}get patches(){return this.entries.reduce((t,[e,s])=>(t[e]=s.computed,t),{})}get appliedPatches(){return this.entries.reduce((t,[e,s])=>(this.patchState.get(e)===!0&&(t[e]=s.computed),t),{})}get unappliedPatches(){return this.entries.reduce((t,[e,s])=>(this.patchState.get(e)===!1&&(t[e]=s.computed),t),{})}get patchKeys(){return this.entries.map(([t,e])=>t)}get conflicts(){return Reflect.ownKeys(this.patchConflicts).map(t=>[t,this.patchConflicts[t]])}get applied(){return this.patchesApplied>0}get isPartiallyPatched(){return this.applied}get isFullyPatched(){return this.patchCount==this.patchesApplied}apply(t){let e=this.entries,s={patches:e.length,applied:0,errors:[],notApplied:e.length};this.patchState.clear(),e.forEach(([,n])=>{if(n.isAllowed){Object.defineProperty(this.owner,n.key,n.descriptor);let i=Object.getOwnPropertyDescriptor(this.owner,n.key);this.#t(i,n.descriptor)?(s.applied+=1,s.notApplied-=1,this.patchState.set(n,!0)):(s.errors.push([n,new Error(`Could not apply patch for key ${n.key}`)]),this.patchState.set(n,!1))}else this.patchState.set(n,!1)}),this.patchesApplied=s.applied,typeof t=="function"&&t(s)}createToggle(t=!1){return new R(this,t)}revert(t){if(!this.applied)return;let e=this.entries,s=this.conflicts,n={patches:e.length,reverted:0,restored:0,conflicts:s.length,errors:[],stillApplied:0};e.forEach(([,i])=>{delete this.owner[i.key]?(this.patchesApplied-=1,n.reverted+=1,this.patchState.set(i,!1)):n.errors.push([i,new Error(`Failed to revert patch ${i.key}`)])}),s.forEach(([,i])=>{Object.defineProperty(this.owner,i.key,i.descriptor);let o=Object.getOwnPropertyDescriptor(this.owner,i.key);this.#t(i.descriptor,o)?n.restored+=1:n.errors.push([i,new Error(`Failed to restore original ${i.key}`)])}),n.stillApplied=this.patchesApplied,typeof t=="function"&&t(n)}release(){let t=r.patches.get(this.owner);t.splice(t.find(e=>e===this),1)}owner=null;options=null;patchState=new Map;[Symbol.iterator](){return this.entries.values()}#t(t,e){return!t||!e?!1:t.configurable===e.configurable&&t.enumerable===e.enumerable&&t.value===e.value&&t.writable===e.writable&&t.get===e.get&&t.set===e.set}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){let n={get quotes(){return/^(\x1B\[\d+m)?['"]|["'](\x1B\[\d+m)?$/g},get arrays(){return/^(\x1B\[\d+m)?\[ | \](\x1B\[\d+m)?$/g}},i={...e,depth:t},o=this.owner?.name??"",c=o.length?`[${s(o,e).replaceAll(n.quotes,"$1$2")}]`:"",f=s(this.patchKeys,i).replaceAll(n.arrays,"$1$2").replaceAll(/'(.*?)'/g,"$1");return`${this.constructor.name}${c} { ${f} }`}static patches=new Map;static enableFor(t){if(r.patches.has(t))for(let e of r.patches.get(t))e.apply()}static disableFor(t){if(r.patches.has(t))for(let e of r.patches.get(t))e.revert()}static get applied(){return this.#e(globalThis,!0)}static get known(){return this.#e(globalThis,!1)}static get use(){return this.#e(globalThis,!1,!0)}static get lazy(){return this.#e(globalThis,!1,!1,!0)}static scopedTo(t){let e=(s,n,i=!1,o=!1)=>this.#e(s,n,i,o);return{get applied(){return e(t,!0,!1)},get known(){return e(t,!1,!1)},get use(){return e(t,!1,!0)},get lazy(){return e(t,!1,!1,!0)}}}static#e(t,e,s=!1,n=!1){return[...r.patches.values()].flat().filter(i=>i.owner===t).reduce((i,o)=>{for(let[,c]of o.entries)if(!(e&&o.patchState.get(c)!==!0)){if(s){i[c.key]=async f=>{if(typeof f!="function")return;let u=Object.prototype.toString.call(f),p=o.createToggle();p.start(),u==="[object AsyncFunction]"?await f(c.computed,c):f(c.computed,c),p.stop()};continue}if(n){Object.defineProperty(i,c.key,{get(){return o.apply(),c.computed},enumerable:!0,configurable:!0});continue}if(c.isAccessor){let f=`applyAccessorFor_${String(c.key)}`,u={[f](p){return c.applyTo(p),p}};i[c.key]=u[f]}else c.applyTo(i)}return i},{})}static get CustomInspect(){return Symbol.for("nodejs.util.inspect.custom")}static stripExtras(t){return t.replaceAll(/^(\x1B\[\d+m)?[\[\{]\s?|\s?[\]\}](\x1B\[\d+m)?$/gm,"$1$2").replaceAll(/['"](.*?)['"]/gm,"$1")}};var mt=["number","boolean","bigint","string","symbol"],l=class r extends a{constructor(t,e,s=globalThis,n={}){let i=r.determineInput(t),{key:o,extension:c,valid:f}=i;if(c=e||c,!f)throw new j(s,o);let u=Object.getOwnPropertyDescriptor(s,o);if(u&&(Reflect.has(u,"writable")&&!u.writable||Reflect.has(u,"configurable")&&!u.configurable))throw new O(s,o);super(s,{[o]:c},n),this.key=o,this.class=i.class,this.function=i.function}get isFunction(){return!!this.function}get isClass(){return!!this.class}get isPrimitive(){return~mt.indexOf(typeof this.value)}get isObject(){return Object(this.value)===this.value}static get applied(){return a.applied}static get known(){return a.known}static get use(){return a.use}static get lazy(){return a.lazy}static scopedTo(t){return a.scopedTo(t)}static determineInput(t){let e={key:null,extension:null,valid:!1};return t instanceof Function?(e={key:t.name,extension:t,valid:!0},/^class .*/.exec(t.toString())&&(e.class=t),/^(async )?function .*/.exec(t.toString())&&(e.function=t)):(typeof t=="string"||t instanceof String)&&(e={key:t,extension:null,valid:!0}),e}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){let n={get braces(){return/^(\x1B\[\d+m)?[\[\{]|[\]\}](\x1B\[\d+m)?$/g},get quotes(){return/^(\x1B\[\d+m)?['"]|["'](\x1B\[\d+m)?$/g}},i=s(this.key,e).replaceAll(n.quotes,"$1$2"),o=s(this.patches[this.key],e).replaceAll(n.braces,"$1$2");return`Extension[${i}:${o}]`}get[Symbol.toStringTag](){return this.constructor.name}static createSet(t,...e){return new r.ExtensionSet(t,...e)}static ExtensionSet=class{constructor(e,...s){this.name=e,this.extensionObjects=new Set,this.extensions=new Set;for(let n of s)n instanceof r?(this.extensions.add(n),this.extensionObjects.add(n.patches[n.key])):n instanceof Function&&(this.extensionObjects.add(n),this.extensions.add(new r(n)))}apply(){for(let e of this.extensions)e.apply()}revert(){for(let e of this.extensions)e.revert()}}};var h=new a(Object,{isNullDefined(r){return r==null},hasStringTag(r){return Object.isObject(r)&&Reflect.has(r,Symbol.toStringTag)},getStringTag(r,t=!1){if(Object.hasStringTag(r))return r[Symbol.toStringTag];if(!t)return r&&typeof r=="function"?r.name:/\s(.+)]/.exec(Object.prototype.toString.call(r))[1]},getType(r,t=globalThis){let e=Object.getStringTag(r);switch(e){case"Null":return null;case"Undefined":return;default:return t[e]}},isObject(r){return r&&(r instanceof Object||typeof r=="object")},isPrimitive(r){if(r===null)return!0;switch(typeof r){case"string":case"number":case"bigint":case"boolean":case"undefined":case"symbol":return!0;default:return!1}},isValidKey(r){return typeof r=="string"||typeof r=="symbol"},stripTo(r,t,e=!0){if(!r||typeof r!="object")throw new TypeError("Object.stripTo requires an object to strip. Received",r);let s={};if(!Array.isArray(t))return s;for(let n of t)if(Reflect.has(r,n)){let o={...Object.getOwnPropertyDescriptor(r,n)};(typeof o.get=="function"||typeof o.set=="function")&&e&&(o.get=o.get?.bind(r),o.set=o.set?.bind(r)),Object.defineProperty(s,n,o)}return s}}),Z=new a(Object.prototype,{stripTo(r,t=!0){return Object.stripTo(this,r,t)}});var{getStringTag:_}=h.patches,$=new a(Function,{isAsync(r){let t=/(\w+)]/g.exec(Object.prototype.toString.call(r))[1];return r instanceof Function&&t.includes("Async")},isAsyncGenerator(r){let t=_(r);return r instanceof Function&&t=="AsyncGeneratorFunction"},isBigArrow(r){return r instanceof Function&&String(r).includes("=>")&&!String(r).startsWith("bound")&&!Reflect.has(r,"prototype")},isBound(r){return r instanceof Function&&String(r).startsWith("bound")&&!Reflect.has(r,"prototype")},isClass(r){return r instanceof Function&&!!/^class\s/.exec(String(r))},isFunction(r){return r instanceof Function&&!Function.isClass(r)},isGenerator(r){let t=_(r);return r instanceof Function&&t=="GeneratorFunction"}}),tt=new a(Function.prototype,{get isAsync(){return Function.isAsync(this)},get isAsyncGenerator(){return Function.isAsyncGenerator(this)},get isBigArrow(){return Function.isBigArrow(this)},get isBound(){return Function.isBound(this)},get isClass(){return Function.isClass(this)},get isFunction(){return Function.isFunction(this)},get isGenerator(){return Function.isGenerator(this)}});var et=new a(Map.prototype,{getKey(r,t=!0){for(let[e,s]of this)return t&&r===s&&!t&&r==s?e:null}});var rt=new a(Set.prototype,{concat(...r){for(let t of r){if(typeof t=="string"||!Reflect.has(t,Symbol.iterator)){this.add(t);continue}for(let e of t)this.add(e)}},contains(r){for(let t of this)if(r==t)return!0;return!1},every(r,t){if(typeof r!="function")throw new TypeError(`everyFn must be a function! Received ${String(r)}`);let e=0;for(let s of this)r.call(t,s,NaN,this)&&e++;return e===this.size},find(r,t){if(typeof r!="function")throw new TypeError(`findFn must be a function! Received ${String(r)}`);for(let e of this)if(r.call(t,e,NaN,this))return e},findLast(r,t){if(typeof r!="function")throw new TypeError(`findFn must be a function! Received ${String(r)}`);let e=[];for(let s of this)r.call(t,s,NaN,this)&&e.push(s);if(e.length)return e[e.length-1]},get length(){return this.size},map(r,t){if(typeof r!="function")throw new TypeError(`mapFn must be a function! Received ${String(r)}`);let e=[];for(let s of this)e.push(r.call(t,s,NaN,this));return e},reduce(r,t,e){if(typeof r!="function")throw new TypeError(`reduceFn must be a Function! Received ${String(r)}`);let s=t;for(let n of this)s=r.call(e,s,n,NaN,this);return s},some(r,t){if(typeof r!="function")throw new TypeError(`someFn must be a function! Received ${String(r)}`);for(let e of this)if(r.call(t,e,NaN,this))return!0;return!1}});var{isObject:st}=h.patches,D=new a(Reflect,{hasAll(r,...t){return Object.isObject(r)&&t.flat(1/0).map(e=>Reflect.has(r,e)).every(e=>e)},ownDescriptors(r){if(!st(r))throw new TypeError("The supplied object must be non-null and an object");let t={},e=Reflect.ownKeys(r);for(let s of e)t[s]=Object.getOwnPropertyDescriptor(s);return t},hasSome(r,...t){return st(r)&&t.flat(1/0).map(e=>Reflect.has(r,e)).some(e=>e)},entries(r){return!r||typeof r!="object"?[]:Reflect.ownKeys(r).map(t=>[t,Object.getOwnPropertyDescriptor(r,t)])},values(r){return Reflect.entries.map(([,t])=>t)}});var nt=new a(String,{isString(r){return r&&(typeof r=="string"||r instanceof String)?r.length>0:!1}});var k=new a(Symbol,{isSymbol(r){return r&&typeof r=="symbol"},isRegistered(r,t=!1){if(!Symbol.isSymbol(r)){if(t)throw new TypeError("allowOnlySymbols specified; value is not a symbol");return!1}return Symbol.keyFor(r)!==void 0},isNonRegistered(r,t=!1){return!Symbol.isRegistered(r,t)}});var it=new a(Array.prototype,{contains(r){return!!this.find(t=>t===r)},findEntry(r){let t=this.entries(),e=1;for(let s of t)if(r(s[e]))return s},get first(){return this[0]},get last(){return this[this.length-1]}});var{isObject:d,isValidKey:V}=h.patches,{hasSome:G}=D.patches,m=class r{#t=void 0;#e=void 0;constructor(t,e){if((t??e)===void 0?this.#t=r.enigmatic:r.isDescriptor(t)?(this.#t=t,this.#e=d(e)?e:void 0):d(t)&&V(e)&&(this.#t=Object.getOwnPropertyDescriptor(t,e),this.#e=t),!this.isDescriptor)throw console.error(`
|
|
1
|
+
var nejsBasicExtensions=(()=>{var V=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var pt=Object.prototype.hasOwnProperty;var ht=(r,t)=>{for(var e in t)V(r,e,{get:t[e],enumerable:!0})},dt=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ut(t))!pt.call(r,n)&&n!==e&&V(r,n,{get:()=>t[n],enumerable:!(s=lt(t,n))||s.enumerable});return r};var yt=r=>dt(V({},"__esModule",{value:!0}),r);var Pt={};ht(Pt,{Controls:()=>m,Extensions:()=>O,GlobalFunctionsAndProps:()=>w,InstancePatches:()=>A,Patches:()=>$,StaticPatches:()=>E,all:()=>ft,default:()=>Tt});var gt=r=>/(\w+)]/.exec(Object.prototype.toString.call(r))[1],R=class extends Error{constructor(t,e){super(`${gt(t)} disallows tampering with ${e}.`),Object.assign(this,{owner:t,key:e})}get[Symbol.toStringTag](){return this.constructor.name}};var mt=r=>/(\w+)]/.exec(Object.prototype.toString.call(r))[1],T=class extends Error{constructor(t,e){super(`${mt(t)} does not have a property named '${e}'.`),Object.assign(this,{owner:t,key:e})}get[Symbol.toStringTag](){return this.constructor.name}};var P=class{constructor(t,e=!1){this.started=!1,this.preventRevert=e,this.patch=t,this.patchName=t.owner?.name??t.owner?.constructor?.name??/(\w+)]/.exec(Object.prototype.toString.call(t.owner))[1],this.state={needsApplication:!1,needsReversion:!1}}start(){return this.started||(this.state.needsApplication=!this.patch.applied,this.state.needsReversion=this.patch.applied,this.started=!0,this.state.needsApplication&&this.patch.apply()),this}stop(){return this.started&&((this.preventRevert||this.patch.applied)&&this.patch.revert(),this.state.needsApplication=!1,this.state.needsReversion=!1,this.started=!1),this}get[Symbol.toStringTag](){return`${this.constructor.name}:${this.patchName}`}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){let n=this[Symbol.toStringTag],i=`(started: ${this.started} needed: ${this.state.needsApplication})`;return s(`${n} ${i}`,{...e,depth:t})}};var b=class{constructor(t,e=globalThis,s=void 0){let n=c=>c==null,i=(c,f=["string","symbol"])=>!n(c)&&!!f.find(l=>l===typeof c),o=c=>i(c,["object"]);if(!i(t))throw console.error("Property",t,`(type: ${typeof t})`,"owningObject",e,`(type: ${typeof e})`,"condition",s,`(type: ${typeof s})`),new TypeError("Property must be non-null and either a string or symbol");if(!o(e))throw new TypeError("Cannot create Patch entry as owning object is invalid");Object.assign(this,{key:t,descriptor:Object.getOwnPropertyDescriptor(e,t),owner:e,condition:typeof s=="function"?s:void 0})}get computed(){return this.isAccessor?this.descriptor.get.bind(this.owner).call():this.descriptor.value}get isData(){return Reflect.has(this.descriptor,"value")}get isAccessor(){return Reflect.has(this.descriptor,"get")}get isReadOnly(){return Reflect.has(this.descriptor,"configurable")&&!this.descriptor.configurable||Reflect.has(this.descriptor,"writable")&&!this.descriptor.writable}get isAllowed(){return this.condition&&typeof this.condition=="function"?this.condition():!0}applyTo(t,e=!1){let s={...this.descriptor};e&&(typeof s.get=="function"&&(s.get=s.get.bind(this.owner)),typeof s.set=="function"&&(s.set=s.set.bind(this.owner))),Object.defineProperty(t,this.key,s)}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){let n=this.isData?" Data":" Accessor",i=this.isReadOnly?" [ReadOnly]":"";return`PatchEntry<${this.key}${n}${i}>`}};var a=class r{patchConflicts={};patchEntries={};patchesOwner=void 0;patchCount=0;patchesApplied=0;constructor(t,e,s={}){Object.assign(this,{owner:t,options:s}),this.patchesOwner=e;let n=this?.options.condition;Reflect.ownKeys(e).forEach(i=>{let o=this?.options?.conditions?.[i]??n;try{this.patchEntries[i]=new b(i,this.patchesOwner,o),this.patchCount+=1}catch(c){console.error(`Failed to process patch for ${i}
|
|
2
|
+
`,c)}if(Reflect.has(this.owner,i))try{this.patchConflicts[i]=new b(i,this.owner)}catch(c){console.error(`Cannot capture conflicting patch key ${i}
|
|
3
|
+
`,c)}}),r.patches.has(t)||r.patches.set(t,[]),r.patches.get(t).push(this)}get entries(){return Reflect.ownKeys(this.patchEntries).map(t=>[t,this.patchEntries[t]])}get appliedEntries(){return Reflect.ownKeys(this.patchEntries).filter(t=>this.patchState.get(t)===!0).map(t=>[t,this.patchEntries[t]])}get unappliedEntries(){return Reflect.ownKeys(this.patchEntries).filter(t=>this.patchState.get(t)===!1).map(t=>[t,this.patchEntries[t]])}get patches(){return this.entries.reduce((t,[e,s])=>(t[e]=s.computed,t),{})}get appliedPatches(){return this.entries.reduce((t,[e,s])=>(this.patchState.get(e)===!0&&(t[e]=s.computed),t),{})}get unappliedPatches(){return this.entries.reduce((t,[e,s])=>(this.patchState.get(e)===!1&&(t[e]=s.computed),t),{})}get patchKeys(){return this.entries.map(([t,e])=>t)}get conflicts(){return Reflect.ownKeys(this.patchConflicts).map(t=>[t,this.patchConflicts[t]])}get applied(){return this.patchesApplied>0}get isPartiallyPatched(){return this.applied}get isFullyPatched(){return this.patchCount==this.patchesApplied}apply(t){let e=this.entries,s={patches:e.length,applied:0,errors:[],notApplied:e.length};this.patchState.clear(),e.forEach(([,n])=>{if(n.isAllowed){Object.defineProperty(this.owner,n.key,n.descriptor);let i=Object.getOwnPropertyDescriptor(this.owner,n.key);this.#t(i,n.descriptor)?(s.applied+=1,s.notApplied-=1,this.patchState.set(n,!0)):(s.errors.push([n,new Error(`Could not apply patch for key ${n.key}`)]),this.patchState.set(n,!1))}else this.patchState.set(n,!1)}),this.patchesApplied=s.applied,typeof t=="function"&&t(s)}createToggle(t=!1){return new P(this,t)}revert(t){if(!this.applied)return;let e=this.entries,s=this.conflicts,n={patches:e.length,reverted:0,restored:0,conflicts:s.length,errors:[],stillApplied:0};e.forEach(([,i])=>{delete this.owner[i.key]?(this.patchesApplied-=1,n.reverted+=1,this.patchState.set(i,!1)):n.errors.push([i,new Error(`Failed to revert patch ${i.key}`)])}),s.forEach(([,i])=>{Object.defineProperty(this.owner,i.key,i.descriptor);let o=Object.getOwnPropertyDescriptor(this.owner,i.key);this.#t(i.descriptor,o)?n.restored+=1:n.errors.push([i,new Error(`Failed to restore original ${i.key}`)])}),n.stillApplied=this.patchesApplied,typeof t=="function"&&t(n)}release(){let t=r.patches.get(this.owner);t.splice(t.find(e=>e===this),1)}owner=null;options=null;patchState=new Map;[Symbol.iterator](){return this.entries.values()}#t(t,e){return!t||!e?!1:t.configurable===e.configurable&&t.enumerable===e.enumerable&&t.value===e.value&&t.writable===e.writable&&t.get===e.get&&t.set===e.set}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){let n={get quotes(){return/^(\x1B\[\d+m)?['"]|["'](\x1B\[\d+m)?$/g},get arrays(){return/^(\x1B\[\d+m)?\[ | \](\x1B\[\d+m)?$/g}},i={...e,depth:t},o=this.owner?.name??"",c=o.length?`[${s(o,e).replaceAll(n.quotes,"$1$2")}]`:"",f=s(this.patchKeys,i).replaceAll(n.arrays,"$1$2").replaceAll(/'(.*?)'/g,"$1");return`${this.constructor.name}${c} { ${f} }`}static patches=new Map;static enableFor(t){if(r.patches.has(t))for(let e of r.patches.get(t))e.apply()}static disableFor(t){if(r.patches.has(t))for(let e of r.patches.get(t))e.revert()}static get applied(){return this.#e(globalThis,!0)}static get known(){return this.#e(globalThis,!1)}static get use(){return this.#e(globalThis,!1,!0)}static get lazy(){return this.#e(globalThis,!1,!1,!0)}static scopedTo(t){let e=(s,n,i=!1,o=!1)=>this.#e(s,n,i,o);return{get applied(){return e(t,!0,!1)},get known(){return e(t,!1,!1)},get use(){return e(t,!1,!0)},get lazy(){return e(t,!1,!1,!0)}}}static#e(t,e,s=!1,n=!1){return[...r.patches.values()].flat().filter(i=>i.owner===t).reduce((i,o)=>{for(let[,c]of o.entries)if(!(e&&o.patchState.get(c)!==!0)){if(s){i[c.key]=async f=>{if(typeof f!="function")return;let l=Object.prototype.toString.call(f),p=o.createToggle();p.start(),l==="[object AsyncFunction]"?await f(c.computed,c):f(c.computed,c),p.stop()};continue}if(n){Object.defineProperty(i,c.key,{get(){return o.apply(),c.computed},enumerable:!0,configurable:!0});continue}if(c.isAccessor){let f=`applyAccessorFor_${String(c.key)}`,l={[f](p){return c.applyTo(p),p}};i[c.key]=l[f]}else c.applyTo(i)}return i},{})}static get CustomInspect(){return Symbol.for("nodejs.util.inspect.custom")}static stripExtras(t){return t.replaceAll(/^(\x1B\[\d+m)?[\[\{]\s?|\s?[\]\}](\x1B\[\d+m)?$/gm,"$1$2").replaceAll(/['"](.*?)['"]/gm,"$1")}};var bt=["number","boolean","bigint","string","symbol"],u=class r extends a{constructor(t,e,s=globalThis,n={}){let i=r.determineInput(t),{key:o,extension:c,valid:f}=i;if(c=e||c,!f)throw new T(s,o);let l=Object.getOwnPropertyDescriptor(s,o);if(l&&(Reflect.has(l,"writable")&&!l.writable||Reflect.has(l,"configurable")&&!l.configurable))throw new R(s,o);super(s,{[o]:c},n),this.key=o,this.class=i.class,this.function=i.function}get isFunction(){return!!this.function}get isClass(){return!!this.class}get isPrimitive(){return~bt.indexOf(typeof this.value)}get isObject(){return Object(this.value)===this.value}static get applied(){return a.applied}static get known(){return a.known}static get use(){return a.use}static get lazy(){return a.lazy}static scopedTo(t){return a.scopedTo(t)}static determineInput(t){let e={key:null,extension:null,valid:!1};return t instanceof Function?(e={key:t.name,extension:t,valid:!0},/^class .*/.exec(t.toString())&&(e.class=t),/^(async )?function .*/.exec(t.toString())&&(e.function=t)):(typeof t=="string"||t instanceof String)&&(e={key:t,extension:null,valid:!0}),e}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){let n={get braces(){return/^(\x1B\[\d+m)?[\[\{]|[\]\}](\x1B\[\d+m)?$/g},get quotes(){return/^(\x1B\[\d+m)?['"]|["'](\x1B\[\d+m)?$/g}},i=s(this.key,e).replaceAll(n.quotes,"$1$2"),o=s(this.patches[this.key],e).replaceAll(n.braces,"$1$2");return`Extension[${i}:${o}]`}get[Symbol.toStringTag](){return this.constructor.name}static createSet(t,...e){return new r.ExtensionSet(t,...e)}static ExtensionSet=class{constructor(e,...s){this.name=e,this.extensionObjects=new Set,this.extensions=new Set;for(let n of s)n instanceof r?(this.extensions.add(n),this.extensionObjects.add(n.patches[n.key])):n instanceof Function&&(this.extensionObjects.add(n),this.extensions.add(new r(n)))}apply(){for(let e of this.extensions)e.apply()}revert(){for(let e of this.extensions)e.revert()}}};var d=new a(Object,{isNullDefined(r){return r==null},hasStringTag(r){return Object.isObject(r)&&Reflect.has(r,Symbol.toStringTag)},getStringTag(r,t=!1){if(Object.hasStringTag(r))return r[Symbol.toStringTag];if(!t)return r&&typeof r=="function"?r.name:/\s(.+)]/.exec(Object.prototype.toString.call(r))[1]},getType(r,t=globalThis){let e=Object.getStringTag(r);switch(e){case"Null":return null;case"Undefined":return;default:return t[e]}},isObject(r){return r&&(r instanceof Object||typeof r=="object")},isPrimitive(r){if(r===null)return!0;switch(typeof r){case"string":case"number":case"bigint":case"boolean":case"undefined":case"symbol":return!0;default:return!1}},isValidKey(r){return typeof r=="string"||typeof r=="symbol"},stripTo(r,t,e=!0){if(!r||typeof r!="object")throw new TypeError("Object.stripTo requires an object to strip. Received",r);let s={};if(!Array.isArray(t))return s;for(let n of t)if(Reflect.has(r,n)){let o={...Object.getOwnPropertyDescriptor(r,n)};(typeof o.get=="function"||typeof o.set=="function")&&e&&(o.get=o.get?.bind(r),o.set=o.set?.bind(r)),Object.defineProperty(s,n,o)}return s}}),Z=new a(Object.prototype,{stripTo(r,t=!0){return Object.stripTo(this,r,t)}});var{getStringTag:_}=d.patches,k=new a(Function,{isAsync(r){let t=/(\w+)]/g.exec(Object.prototype.toString.call(r))[1];return r instanceof Function&&t.includes("Async")},isAsyncGenerator(r){let t=_(r);return r instanceof Function&&t=="AsyncGeneratorFunction"},isBigArrow(r){return r instanceof Function&&String(r).includes("=>")&&!String(r).startsWith("bound")&&!Reflect.has(r,"prototype")},isBound(r){return r instanceof Function&&String(r).startsWith("bound")&&!Reflect.has(r,"prototype")},isClass(r){return r instanceof Function&&!!/^class\s/.exec(String(r))},isFunction(r){return r instanceof Function&&!Function.isClass(r)},isGenerator(r){let t=_(r);return r instanceof Function&&t=="GeneratorFunction"}}),tt=new a(Function.prototype,{get isAsync(){return Function.isAsync(this)},get isAsyncGenerator(){return Function.isAsyncGenerator(this)},get isBigArrow(){return Function.isBigArrow(this)},get isBound(){return Function.isBound(this)},get isClass(){return Function.isClass(this)},get isFunction(){return Function.isFunction(this)},get isGenerator(){return Function.isGenerator(this)}});var et=new a(Map.prototype,{getKey(r,t=!0){for(let[e,s]of this)return t&&r===s&&!t&&r==s?e:null}});var rt=new a(Set.prototype,{concat(...r){for(let t of r){if(typeof t=="string"||!Reflect.has(t,Symbol.iterator)){this.add(t);continue}for(let e of t)this.add(e)}},contains(r){for(let t of this)if(r==t)return!0;return!1},every(r,t){if(typeof r!="function")throw new TypeError(`everyFn must be a function! Received ${String(r)}`);let e=0;for(let s of this)r.call(t,s,NaN,this)&&e++;return e===this.size},find(r,t){if(typeof r!="function")throw new TypeError(`findFn must be a function! Received ${String(r)}`);for(let e of this)if(r.call(t,e,NaN,this))return e},findLast(r,t){if(typeof r!="function")throw new TypeError(`findFn must be a function! Received ${String(r)}`);let e=[];for(let s of this)r.call(t,s,NaN,this)&&e.push(s);if(e.length)return e[e.length-1]},get length(){return this.size},map(r,t){if(typeof r!="function")throw new TypeError(`mapFn must be a function! Received ${String(r)}`);let e=[];for(let s of this)e.push(r.call(t,s,NaN,this));return e},reduce(r,t,e){if(typeof r!="function")throw new TypeError(`reduceFn must be a Function! Received ${String(r)}`);let s=t;for(let n of this)s=r.call(e,s,n,NaN,this);return s},some(r,t){if(typeof r!="function")throw new TypeError(`someFn must be a function! Received ${String(r)}`);for(let e of this)if(r.call(t,e,NaN,this))return!0;return!1}});var{isObject:st}=d.patches,D=new a(Reflect,{hasAll(r,...t){return Object.isObject(r)&&t.flat(1/0).map(e=>Reflect.has(r,e)).every(e=>e)},ownDescriptors(r){if(!st(r))throw new TypeError("The supplied object must be non-null and an object");let t={},e=Reflect.ownKeys(r);for(let s of e)t[s]=Object.getOwnPropertyDescriptor(s);return t},hasSome(r,...t){return st(r)&&t.flat(1/0).map(e=>Reflect.has(r,e)).some(e=>e)},entries(r){return!r||typeof r!="object"?[]:Reflect.ownKeys(r).map(t=>[t,Object.getOwnPropertyDescriptor(r,t)])},values(r){return Reflect.entries.map(([,t])=>t)}});var St=["(",")"],nt=new a(String,{isString(r){return r&&(typeof r=="string"||r instanceof String)?r.length>0:!1},get parenthesisPair(){return["(",")"]},get squareBracketsPair(){return["[","]"]},get curlyBracketsPair(){return["{","}"]}}),it=new a(String.prototype,{extractSubstring(r=0,t=St){let[e,s]=t,n=0,i=-1,o=-1,c="",f=0;for(let h=r;h<this.length;h++){let g=this[h];if(g===e)n++,i===-1&&(i=h);else if(g===s&&(n--,n===0)){o=h;break}}let l=[Math.max(0,i-100),i],p=[...this.substring(l[0],l[1])].reverse().join(""),j;try{j=/([^ \,\"\'\`]+)/.exec(p)[1]??"",c=[...j].reverse().join("")}catch{}if(i!==-1&&o!==-1){let h=[i,o+1];return{extracted:this.slice(h[0],h[1]),range:[i,o],newOffset:o+1,leadingToken:c}}else return{extracted:null,range:[i,o],newOffset:r,leadingToken:c}}});var N=new a(Symbol,{isSymbol(r){return r&&typeof r=="symbol"},isRegistered(r,t=!1){if(!Symbol.isSymbol(r)){if(t)throw new TypeError("allowOnlySymbols specified; value is not a symbol");return!1}return Symbol.keyFor(r)!==void 0},isNonRegistered(r,t=!1){return!Symbol.isRegistered(r,t)}});var ot=new a(Array.prototype,{contains(r){return!!this.find(t=>t===r)},findEntry(r){let t=this.entries(),e=1;for(let s of t)if(r(s[e]))return s},get first(){return this[0]},get last(){return this[this.length-1]}});var{isObject:y,isValidKey:M}=d.patches,{hasSome:B}=D.patches,S=class r{#t=void 0;#e=void 0;constructor(t,e){if((t??e)===void 0?this.#t=r.enigmatic:r.isDescriptor(t)?(this.#t=t,this.#e=y(e)?e:void 0):y(t)&&M(e)&&(this.#t=Object.getOwnPropertyDescriptor(t,e),this.#e=t),!this.isDescriptor)throw console.error(`
|
|
4
4
|
Descriptor(object,key) FAILED:
|
|
5
5
|
object: ${t===globalThis?"[GLOBAL]":typeof e=="object"?JSON.stringify(t):String(t)}
|
|
6
6
|
key: ${e===globalThis?"[GLOBAL]":typeof e=="object"?JSON.stringify(e):String(e)}
|
|
7
|
-
descriptor: `,this.#t),new Error("Not a valid descriptor:",this.#t)}get isAccessor(){return r.isAccessor(this.#t)}get isData(){return r.isData(this.#t)}get isDescriptor(){return r.isDescriptor(this.#t)}get configurable(){return!!this.#t?.configurable}set configurable(t){(this.#t||{}).configurable=!!t}get enumerable(){return this.#t?.enumerable}set enumerable(t){(this.#t||{}).enumerable=t}get writable(){return this.#t?.writable}set writable(t){(this.#t||{}).writable=t}get value(){return this.#t?.value}set value(t){(this.#t||{}).value=t}get get(){return this.#t?.get}get boundGet(){return d(this.#e)?this.get?.bind(this.#e):this.get}set get(t){(this.#t||{}).get=t}get set(){return(this.#t||{}).set}get boundSet(){return d(this.#e)?this.set?.bind(this.#e):this.set}set set(t){(this.#t||{}).set=t}get hasObject(){return d(this.#e)}get object(){return this.#e}set object(t){this.#e=Object(t)}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){return`Descriptor${this.isAccessor?" (Accessor)":this.isData?" (Data)":""} ${s(this.#t,{...e,depth:t})}`}static for(t,e,s=!1){return!d(t)||!V(e)||!Reflect.has(t,e)?null:s?new r(Object.getOwnPropertyDescriptor(t,e)):Object.getOwnPropertyDescriptor(t,e)}applyTo(t,e,s=!1){if(!d(t)||!V(e))throw new Error("Cannot apply descriptor to non-object or invalid key");return Object.defineProperty(t,e,this.toObject(s))}toObject(t=!1){let e={...this.#t};return t&&this.isAccessor&&(this.hasObject?e={...e,get:this.boundGet,set:this.boundSet}:d(t)&&(e={...e,get:this.get?.bind(t),set:this.set?.bind(t)})),e}[Symbol.toPrimitive](t){switch(t){case"string":if(this.isAccessor){let e=Reflect.has(this.#t,"get")?"getter":"",s=Reflect.has(this.#t,"set")?"setter":"";return`Accessor (${e}${e&&s?", ":""}${s})`}else if(this.isData){let e=Reflect.has(this.#t,"value")?"value":"",s=Reflect.has(this.#t,"writable")?"writable":"";return`Data (${e}${e&&s?", ":""}${s})`}break;case"number":return NaN;default:return this.toObject()}}get[Symbol.toStringTag](){return this.constructor.name}static getData(t,e){if(!d(t)||!Reflect.has(t,e))return;let s=r.for(t,e,!0);return s.isData?s.value:null}static getAccessor(t,e){if(!d(t)||!Reflect.has(t,e))return;let s=r.for(t,e,!0);return s.isAccessor?s.get.bind(t)():null}static base(t=!1,e=!1){return{enumerable:t,configurable:e}}static accessor(t,e,{enumerable:s,configurable:n}=r.base()){return{get:t,set:e,enumerable:s,configurable:n}}static data(t,e=!0,{enumerable:s,configurable:n}=r.base()){return{value:t,enumerable:s,writable:e,configurable:n}}static isDescriptor(t){let e=[...r.SHARED_KEYS,...r.ACCESSOR_KEYS,...r.DATA_KEYS];return G(t,e)}static isData(t,e){let n=(typeof t=="object"||t instanceof Object)&&e instanceof String?r.for(t,e):t,{DATA_KEYS:i}=this,o=!1;return G(n,i)&&(o=!0),o}static isAccessor(t,e){let n=t&&e&&(typeof t=="object"||t instanceof Object)&&(e instanceof String||typeof e=="symbol")?r.for(t,e):t,{ACCESSOR_KEYS:i}=this,o=!1;return G(n,i)&&(o=!0),o}static get flexible(){return this.base(!0,!0)}static get enigmatic(){return this.base(!1,!0)}static get intrinsic(){return this.base(!1,!1)}static get transparent(){return this.base(!0,!1)}static get SHARED_KEYS(){return["configurable","enumerable"]}static get ACCESSOR_KEYS(){return["get","set"]}static get DATA_KEYS(){return["value","writable"]}},M=new l(m);var{isClass:bt,isFunction:N}=$.patches,St=Symbol.for("nodejs.util.inspect.custom"),b=new a(globalThis,{maskAs(r,t,e){let{prototype:s,toPrimitive:n}=GenericMask({...e,prototype:t}),i={configurable:!0,enumerable:!1},o=N(s)?s.prototype:s,c=bt(s)?s:o?.constructor;return!c&&!o?null:(Object.setPrototypeOf(r,o),Object.defineProperties(r,{valueOf:{value(){return String(n("default",r))},...i},[Symbol.toPrimitive]:{value(f){return n(f,r)},...i},[Symbol.toStringTag]:{value:c.name,...i},[Symbol.species]:{get(){return c},...i},[St]:{...i,value(f,u,p){return p(this[Symbol.toPrimitive](),{...u,depth:f})}}}),r)},maskAsString(r,t,e){return r&&Reflect.has(r,t)?maskAs(r,StringMask(t??"value",e)):null},maskAsNumber(r,t,e){return r&&Reflect.has(r,t)?maskAs(r,NumberMask(t??"value",e)):null},GenericMask({prototype:r,targetKey:t="value",toPrimitive:e}){let s={targetKey:t,toPrimitive:e,prototype:r};return N(e)||(s.toPrimitive=(n,i)=>{let o=i[t],c=typeof o=="number"&&Number.isFinite(o)||typeof o=="string"&&!isNaN(parseFloat(o))&&isFinite(o);switch(n){case"string":return c?String(o):o??String(i);case"number":return c?Number(o):NaN;case"default":default:return c?Number(o):o}}),s},StringMask(r,t){let e={targetKey:r,toPrimitive:t,prototype:String.prototype};return N(t)||(e.toPrimitive=function(n,i){switch(n){case"default":return i[r];case"number":return parseInt(i[r],36);case"string":return String(i[r]);default:return i}}),e},NumberMask(r,t){let e={targetKey:r,toPrimitive:t,prototype:Number.prototype};return N(t)||(e.toPrimitive=function(n,i){switch(n){case"default":return i[r];case"number":return Number(i[r]);case"string":return String(i[r]);default:return i}}),e}});var C=class r extends Set{#t=!1;objectifying(t=!0){return this.objectifyValues=t,this}get objectifyValues(){return this.#t}set objectifyValues(t){this.#t=!!t}add(t){if(this.#t&&(typeof t=="number"||typeof t=="string"||typeof t=="boolean"||typeof t=="bigint")&&(t=Object(t)),typeof t=="symbol"&&Symbol.keyFor(t)!==void 0)throw new TypeError("RefSet cannot accept registered symbols as values");if(typeof t!="object"&&typeof t!="symbol")throw new TypeError("RefSet values must be objects, non-registered symbols, or objectified primitives");if(t==null)throw new TypeError("RefSet values cannot be null or undefined");super.add(new WeakRef(t))}addAll(t){if(!t||typeof t!="object"||!Reflect.has(t,Symbol.iterator))throw new TypeError("The supplied values are either falsey or non-iterable");for(let e of t)this.add(e)}clean(){for(let t of this)t.deref()||this.delete(t);return this}entries(){return Array.from(super.entries()).map(([e,s])=>[s.deref(),s.deref()]).filter(([e,s])=>!!s)}forEach(t,e){let s=this;super.forEach(function(n){let i=n.deref();i&&t.call(e,i,i,s)})}values(){let t=[];for(let e of this){let s=e.deref();s&&t.push(s)}return t}keys(){return this.values()}has(t){if(this.#t)return this.contains(t);for(let e of this.values())if(e===t)return!0;return!1}contains(t){return!!Array.from(this.values()).filter(e=>t==e).length}filter(t,e){let s=[];for(let n of this){let i=n?.deref();i&&t.call(e,i,NaN,this)&&s.push(i)}return s}find(t,e){for(let s of this){let n=s?.deref();if(n&&t.call(e,n,NaN,this))return n}}map(t,e,s,n){let i=[],o=!0,c=!0;for(let f of this){let u=f?.deref();if(u){let p=t.call(e,u,NaN,this);(o||c)&&(this.#e(p)||(o=!1,c&&(c=this.#e(Object(p))))),i.push(p)}}if(s){if(o)return new r(i).objectifying(n?this.objectifyValues:!1);if(c)return new r(i.map(f=>this.#e(f)?f:Object(f))).objectifying()}return i}get[Symbol.toStringTag](){return this.constructor.name}#e(t){return!(typeof t=="symbol"&&Symbol.keyFor(t)===void 0||typeof t!="object"&&typeof t!="symbol"||t==null)}},B=new l(C);var ot=new a(WeakRef,{isValidReference(r){return!(typeof r=="symbol"&&Symbol.keyFor(r)===void 0||typeof r!="object"&&typeof r!="symbol"||r==null)}});var T=class{#t=[];constructor(t,...e){t!=null&&typeof t[Symbol.iterator]=="function"?this.#t=[...t,...e]:this.#t=[t,...e]}*[Symbol.iterator](){for(let t of this.#t)yield t}get asArray(){return this.#t}get[Symbol.toStringTag](){return this.constructor.name}static isIterable(t){return Object.prototype.toString.call(t?.[Symbol.iterator])==="[object GeneratorFunction]"}},S=class{#t=void 0;constructor(t,e){if(!t||!Reflect.has(t,Symbol.iterator))throw new TypeError("Value used to instantiate Iterator is not iterable");this.#e=t,this.#r=t[Symbol.iterator](),this.#t=typeof e=="function"?e:void 0}get asArray(){return Array.from(this.#e)}get iterable(){return this.#e}next(){let t=this.#r.next(),e=t;return e.done?{value:void 0,done:!0}:(this.#t&&typeof this.#t=="function"&&(e.value=this.#t(t.value)),{value:e.value,done:!1})}reset(){this.#r=this.#e[Symbol.iterator]()}[Symbol.iterator](){return this}get[Symbol.toStringTag](){return this.constructor.name}#e=null;#r=null},K=new l(T),W=new l(S);var{isObject:wt,isNullDefined:xt,isValidKey:Et}=h.patches,{isRegistered:At}=k.patches,{isValidReference:ct}=ot.patches,L=class r extends Map{#t=!1;constructor(...t){super(...t)}objectifying(t=!0){return this.objectifyValues=t,this}asObject(){let t={};for(let[e,s]of this){let n=Et(e)?e:String(e),i=s?.valueOf()||s;t[n]=i}return t}get objectifyValues(){return this.#t}get(t,e){let s=super.get(t);return!s||!s?.deref()?e:s?.deref()}set objectifyValues(t){this.#t=!!t}set(t,e){let s=e;if(this.#t&&(typeof s=="number"||typeof s=="string"||typeof s=="boolean"||typeof s=="bigint")&&(s=Object(s)),typeof s=="symbol"&&Symbol.keyFor(s)!==void 0)throw new TypeError("RefMap cannot accept registered symbols as values");if(typeof s!="object"&&typeof s!="symbol")throw new TypeError("RefMap values must be objects, non-registered symbols, or objectified primitives");if(s==null)throw new TypeError("RefMap values cannot be null or undefined");let n=new WeakRef(s);super.set(t,n)}setAll(t){if(!T.isIterable(t))throw new TypeError("The supplied list of entries must be an array of arrays in the format [[key1, value1], [key2, value2], ...].");let e=s=>{let[n,i]=s;!n||!wt(i)||!At(i)||this.set(n,i)};for(let s of t)e(s);return this}clean(){for(let[t,e]of this)e||this.delete(t);return this}entries(){let t=super.entries();return new S(t,s=>{if(s){let[n,i]=s,o=i?.deref();return[n,o]}return s})}forEach(t,e){for(let[s,n]of super.entries()){let i=n?.deref();i&&t.call(e,i,s,this)}}values(){return new S(super.values(),function(e){return e?.deref()||e})}hasValue(t,e=!0){if(xt(t))return!1;this.#t&&(e=!1);for(let[s,n]of this)if(e&&t===n||!e&&t==n)return!0;return!1}filter(t,e){let s=[];for(let[n,i]of this)t.call(e,i,n,this)&&s.push([n,i]);return s}find(t,e){for(let[s,n]of this){let i=super.get(s),o=t.call(e,i,s,map);if(o||(o=t.call(e,n,s,map)),o)return n}return null}map(t,e,s,n){if(typeof t!="function")throw new TypeError("mapFn must be a function! Received",t);let i=[],o=[],c=n&&this.objectifyValues,f=n===void 0,u=c;for(let[p,X]of this){let[,v]=[0,1],A=t.call(e,[p,X],p,this);ct(A[v])||ct(Object(A[v]))&&(c=!0,f&&!u&&(u=!0,A[v]=Object(A[v]))),i.push(A)}return s?new r(i).objectifying(u):i}*[Symbol.iterator](){for(let[t,e]of this.entries())yield[t,e]}get[Symbol.toStringTag](){return this.constructor.name}},Y=new l(L);var q=class r extends Promise{#t=null;#e=null;#r=null;value=null;reason=null;#s=!1;constructor(t){let e=t&&typeof t=="object"?t:{};if(e?.resolve&&e?.reject)throw new TypeError("resolve and reject options cannot be simultaneously provided");let s,n;super((i,o)=>{s=i,n=o,e?.executor&&typeof e?.executor=="function"&&e?.executor(i,o)}),this.#r=i=>(e?.doNotTrackAnswers!==!0&&(this.value=i),this.#s=!0,s(i)),this.#e=async i=>(e?.doNotTrackAnswers!==!0&&(this.reason=i),this.#s=!0,n(i)),this.#t=this,e?.resolve?this.#r(e?.resolve):e?.reject&&this.#e(e?.reject)}get settled(){return this.#s}get promise(){return this.#t}resolve(t){return this.#r(t)}reject(t){return this.#e(t)}static get[Symbol.species](){return class extends r{constructor(e){super({executor:e})}}}},z=new l(q);var U=class{#t=[];constructor(t,...e){t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")?this.#t=[...t,...e]:typeof t=="function"&&t.constructor.name==="AsyncGeneratorFunction"?this.#t=t():this.#t=[t,...e]}async*[Symbol.asyncIterator](){for await(let t of this.#t)yield t}get[Symbol.toStringTag](){return this.constructor.name}static isAsyncIterable(t){return Object.prototype.toString.call(t?.[Symbol.asyncIterator])==="[object AsyncGeneratorFunction]"}},H=class{constructor(t){if(typeof t=="function"&&t.constructor.name==="AsyncGeneratorFunction")this.#t=t();else{if(!t||!Reflect.has(t,Symbol.asyncIterator))throw new TypeError("Value used to instantiate AsyncIterator is not an async iterable");this.#t=t}this.#e=this.#t[Symbol.asyncIterator]()}async asArray(){let t=[];for await(let e of this)t.push(e);return t}get asyncIterable(){return this.#t}async next(){let t=await this.#e.next();return t.done?{value:void 0,done:!0}:{value:t.value,done:!1}}async reset(){this.#e=this.#t[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this}get[Symbol.toStringTag](){return this.constructor.name}#t=null;#e=null},J=new l(U),Q=new l(H);var w=[[Object,h,Object.name],[Function,$,Function.name],[Reflect,D,"Reflect"],[String,nt,String.name],[Symbol,k,"Symbol"]],x=[[Object.prototype,Z,Object.name],[Function.prototype,tt,Function.name],[Array.prototype,it,Array.name],[Map.prototype,et,Map.name],[Set.prototype,rt,Set.name]],P=new Map([...w,...x]),E={[J.key]:J,[Q.key]:Q,[z.key]:z,[M.key]:M,[K.key]:K,[W.key]:W,[Y.key]:Y,[B.key]:B},y={};Object.assign(y,{enableAll(){y.enablePatches(),y.enableExtensions()},enablePatches(){P.forEach(r=>{r.apply()})},enableStaticPatches(r=([t,e])=>!0){let t=w.filter(F(r));return t.forEach(([e,s])=>s.apply()),t},enableInstancePatches(r=([t,e])=>!0){let t=x.filter(F(r));return t.forEach(([e,s])=>s.apply()),t},enableExtensions(){Object.values(E).forEach(r=>{r.apply()}),b.apply()},disableAll(){y.disablePatches(),y.disableExtensions()},disablePatches(){P.forEach(r=>{r.revert()})},disableStaticPatches(r=([t,e])=>!0){let t=w.filter(F(r));return t.forEach(([e,s])=>s.revert()),t},disableInstancePatches(r=([t,e])=>!0){let t=x.filter(F(r));return t.forEach(([e,s])=>s.revert()),t},disableExtensions(){Object.values(E).forEach(r=>{r.revert()}),b.revert()}});var at=(()=>{let r={patches:{},classes:{},global:{}},t=(n,[i,o])=>(new m(o.descriptor,o.owner).applyTo(n,i,!0),n),e=(n,[i,o,c])=>(n?.[c]||(n[c]={}),[...o].reduce(t,n[c]),n),s=(n,[i,o,c])=>(n?.[c]||(n[c]={}),n[c]?.prototype||(n[c].prototype={}),[...o].reduce(t,n[c].prototype),n);w.reduce(e,r.patches),x.reduce(s,r.patches),Object.values(E).flatMap(n=>[...n]).reduce(t,r.classes);for(let[n,i]of b){let o=new m(i.descriptor,i.owner);Object.defineProperty(r.global,n,o.toObject(!0))}return r})(),Ot={...y,Extensions:E,Patches:P,GlobalFunctionsAndProps:b,StaticPatches:w,InstancePatches:x,Controls:y,extensions:E,patches:P,all:at},jt=Ot;function F(r=([t,e])=>!0){let t=r;if(typeof t!="function"){let e=Array.isArray(r)?r:[r];t=([s,n])=>{for(let i of e){let o=String(i);if(o.startsWith("^")&&(s?.name??s)!=o.substring(1)||(s?.name??s)==o)return!0}return!1}}return t}return dt(Rt);})();
|
|
8
|
-
//# sourceMappingURL=basic-extensions.bundle.2.2.
|
|
7
|
+
descriptor: `,this.#t),new Error("Not a valid descriptor:",this.#t)}get isAccessor(){return r.isAccessor(this.#t)}get isData(){return r.isData(this.#t)}get isDescriptor(){return r.isDescriptor(this.#t)}get configurable(){return!!this.#t?.configurable}set configurable(t){(this.#t||{}).configurable=!!t}get enumerable(){return this.#t?.enumerable}set enumerable(t){(this.#t||{}).enumerable=t}get writable(){return this.#t?.writable}set writable(t){(this.#t||{}).writable=t}get value(){return this.#t?.value}set value(t){(this.#t||{}).value=t}get get(){return this.#t?.get}get boundGet(){return y(this.#e)?this.get?.bind(this.#e):this.get}set get(t){(this.#t||{}).get=t}get set(){return(this.#t||{}).set}get boundSet(){return y(this.#e)?this.set?.bind(this.#e):this.set}set set(t){(this.#t||{}).set=t}get hasObject(){return y(this.#e)}get object(){return this.#e}set object(t){this.#e=Object(t)}[Symbol.for("nodejs.util.inspect.custom")](t,e,s){return`Descriptor${this.isAccessor?" (Accessor)":this.isData?" (Data)":""} ${s(this.#t,{...e,depth:t})}`}static for(t,e,s=!1){return!y(t)||!M(e)||!Reflect.has(t,e)?null:s?new r(Object.getOwnPropertyDescriptor(t,e)):Object.getOwnPropertyDescriptor(t,e)}applyTo(t,e,s=!1){if(!y(t)||!M(e))throw new Error("Cannot apply descriptor to non-object or invalid key");return Object.defineProperty(t,e,this.toObject(s))}toObject(t=!1){let e={...this.#t};return t&&this.isAccessor&&(this.hasObject?e={...e,get:this.boundGet,set:this.boundSet}:y(t)&&(e={...e,get:this.get?.bind(t),set:this.set?.bind(t)})),e}[Symbol.toPrimitive](t){switch(t){case"string":if(this.isAccessor){let e=Reflect.has(this.#t,"get")?"getter":"",s=Reflect.has(this.#t,"set")?"setter":"";return`Accessor (${e}${e&&s?", ":""}${s})`}else if(this.isData){let e=Reflect.has(this.#t,"value")?"value":"",s=Reflect.has(this.#t,"writable")?"writable":"";return`Data (${e}${e&&s?", ":""}${s})`}break;case"number":return NaN;default:return this.toObject()}}get[Symbol.toStringTag](){return this.constructor.name}static getData(t,e){if(!y(t)||!Reflect.has(t,e))return;let s=r.for(t,e,!0);return s.isData?s.value:null}static getAccessor(t,e){if(!y(t)||!Reflect.has(t,e))return;let s=r.for(t,e,!0);return s.isAccessor?s.get.bind(t)():null}static base(t=!1,e=!1){return{enumerable:t,configurable:e}}static accessor(t,e,{enumerable:s,configurable:n}=r.base()){return{get:t,set:e,enumerable:s,configurable:n}}static data(t,e=!0,{enumerable:s,configurable:n}=r.base()){return{value:t,enumerable:s,writable:e,configurable:n}}static isDescriptor(t){let e=[...r.SHARED_KEYS,...r.ACCESSOR_KEYS,...r.DATA_KEYS];return B(t,e)}static isData(t,e){let n=(typeof t=="object"||t instanceof Object)&&e instanceof String?r.for(t,e):t,{DATA_KEYS:i}=this,o=!1;return B(n,i)&&(o=!0),o}static isAccessor(t,e){let n=t&&e&&(typeof t=="object"||t instanceof Object)&&(e instanceof String||typeof e=="symbol")?r.for(t,e):t,{ACCESSOR_KEYS:i}=this,o=!1;return B(n,i)&&(o=!0),o}static get flexible(){return this.base(!0,!0)}static get enigmatic(){return this.base(!1,!0)}static get intrinsic(){return this.base(!1,!1)}static get transparent(){return this.base(!0,!1)}static get SHARED_KEYS(){return["configurable","enumerable"]}static get ACCESSOR_KEYS(){return["get","set"]}static get DATA_KEYS(){return["value","writable"]}},G=new u(S);var{isClass:wt,isFunction:F}=k.patches,xt=Symbol.for("nodejs.util.inspect.custom"),w=new a(globalThis,{maskAs(r,t,e){let{prototype:s,toPrimitive:n}=GenericMask({...e,prototype:t}),i={configurable:!0,enumerable:!1},o=F(s)?s.prototype:s,c=wt(s)?s:o?.constructor;return!c&&!o?null:(Object.setPrototypeOf(r,o),Object.defineProperties(r,{valueOf:{value(){return String(n("default",r))},...i},[Symbol.toPrimitive]:{value(f){return n(f,r)},...i},[Symbol.toStringTag]:{value:c.name,...i},[Symbol.species]:{get(){return c},...i},[xt]:{...i,value(f,l,p){return p(this[Symbol.toPrimitive](),{...l,depth:f})}}}),r)},maskAsString(r,t,e){return r&&Reflect.has(r,t)?maskAs(r,StringMask(t??"value",e)):null},maskAsNumber(r,t,e){return r&&Reflect.has(r,t)?maskAs(r,NumberMask(t??"value",e)):null},GenericMask({prototype:r,targetKey:t="value",toPrimitive:e}){let s={targetKey:t,toPrimitive:e,prototype:r};return F(e)||(s.toPrimitive=(n,i)=>{let o=i[t],c=typeof o=="number"&&Number.isFinite(o)||typeof o=="string"&&!isNaN(parseFloat(o))&&isFinite(o);switch(n){case"string":return c?String(o):o??String(i);case"number":return c?Number(o):NaN;case"default":default:return c?Number(o):o}}),s},StringMask(r,t){let e={targetKey:r,toPrimitive:t,prototype:String.prototype};return F(t)||(e.toPrimitive=function(n,i){switch(n){case"default":return i[r];case"number":return parseInt(i[r],36);case"string":return String(i[r]);default:return i}}),e},NumberMask(r,t){let e={targetKey:r,toPrimitive:t,prototype:Number.prototype};return F(t)||(e.toPrimitive=function(n,i){switch(n){case"default":return i[r];case"number":return Number(i[r]);case"string":return String(i[r]);default:return i}}),e}});var C=class r extends Set{#t=!1;objectifying(t=!0){return this.objectifyValues=t,this}get objectifyValues(){return this.#t}set objectifyValues(t){this.#t=!!t}add(t){if(this.#t&&(typeof t=="number"||typeof t=="string"||typeof t=="boolean"||typeof t=="bigint")&&(t=Object(t)),typeof t=="symbol"&&Symbol.keyFor(t)!==void 0)throw new TypeError("RefSet cannot accept registered symbols as values");if(typeof t!="object"&&typeof t!="symbol")throw new TypeError("RefSet values must be objects, non-registered symbols, or objectified primitives");if(t==null)throw new TypeError("RefSet values cannot be null or undefined");super.add(new WeakRef(t))}addAll(t){if(!t||typeof t!="object"||!Reflect.has(t,Symbol.iterator))throw new TypeError("The supplied values are either falsey or non-iterable");for(let e of t)this.add(e)}clean(){for(let t of this)t.deref()||this.delete(t);return this}entries(){return Array.from(super.entries()).map(([e,s])=>[s.deref(),s.deref()]).filter(([e,s])=>!!s)}forEach(t,e){let s=this;super.forEach(function(n){let i=n.deref();i&&t.call(e,i,i,s)})}values(){let t=[];for(let e of this){let s=e.deref();s&&t.push(s)}return t}keys(){return this.values()}has(t){if(this.#t)return this.contains(t);for(let e of this.values())if(e===t)return!0;return!1}contains(t){return!!Array.from(this.values()).filter(e=>t==e).length}filter(t,e){let s=[];for(let n of this){let i=n?.deref();i&&t.call(e,i,NaN,this)&&s.push(i)}return s}find(t,e){for(let s of this){let n=s?.deref();if(n&&t.call(e,n,NaN,this))return n}}map(t,e,s,n){let i=[],o=!0,c=!0;for(let f of this){let l=f?.deref();if(l){let p=t.call(e,l,NaN,this);(o||c)&&(this.#e(p)||(o=!1,c&&(c=this.#e(Object(p))))),i.push(p)}}if(s){if(o)return new r(i).objectifying(n?this.objectifyValues:!1);if(c)return new r(i.map(f=>this.#e(f)?f:Object(f))).objectifying()}return i}get[Symbol.toStringTag](){return this.constructor.name}#e(t){return!(typeof t=="symbol"&&Symbol.keyFor(t)===void 0||typeof t!="object"&&typeof t!="symbol"||t==null)}},K=new u(C);var ct=new a(WeakRef,{isValidReference(r){return!(typeof r=="symbol"&&Symbol.keyFor(r)===void 0||typeof r!="object"&&typeof r!="symbol"||r==null)}});var v=class{#t=[];constructor(t,...e){t!=null&&typeof t[Symbol.iterator]=="function"?this.#t=[...t,...e]:this.#t=[t,...e]}*[Symbol.iterator](){for(let t of this.#t)yield t}get asArray(){return this.#t}get[Symbol.toStringTag](){return this.constructor.name}static isIterable(t){return Object.prototype.toString.call(t?.[Symbol.iterator])==="[object GeneratorFunction]"}},x=class{#t=void 0;constructor(t,e){if(!t||!Reflect.has(t,Symbol.iterator))throw new TypeError("Value used to instantiate Iterator is not iterable");this.#e=t,this.#r=t[Symbol.iterator](),this.#t=typeof e=="function"?e:void 0}get asArray(){return Array.from(this.#e)}get iterable(){return this.#e}next(){let t=this.#r.next(),e=t;return e.done?{value:void 0,done:!0}:(this.#t&&typeof this.#t=="function"&&(e.value=this.#t(t.value)),{value:e.value,done:!1})}reset(){this.#r=this.#e[Symbol.iterator]()}[Symbol.iterator](){return this}get[Symbol.toStringTag](){return this.constructor.name}#e=null;#r=null},L=new u(v),W=new u(x);var{isObject:Et,isNullDefined:At,isValidKey:Ot}=d.patches,{isRegistered:jt}=N.patches,{isValidReference:at}=ct.patches,Y=class r extends Map{#t=!1;constructor(...t){super(...t)}objectifying(t=!0){return this.objectifyValues=t,this}asObject(){let t={};for(let[e,s]of this){let n=Ot(e)?e:String(e),i=s?.valueOf()||s;t[n]=i}return t}get objectifyValues(){return this.#t}get(t,e){let s=super.get(t);return!s||!s?.deref()?e:s?.deref()}set objectifyValues(t){this.#t=!!t}set(t,e){let s=e;if(this.#t&&(typeof s=="number"||typeof s=="string"||typeof s=="boolean"||typeof s=="bigint")&&(s=Object(s)),typeof s=="symbol"&&Symbol.keyFor(s)!==void 0)throw new TypeError("RefMap cannot accept registered symbols as values");if(typeof s!="object"&&typeof s!="symbol")throw new TypeError("RefMap values must be objects, non-registered symbols, or objectified primitives");if(s==null)throw new TypeError("RefMap values cannot be null or undefined");let n=new WeakRef(s);super.set(t,n)}setAll(t){if(!v.isIterable(t))throw new TypeError("The supplied list of entries must be an array of arrays in the format [[key1, value1], [key2, value2], ...].");let e=s=>{let[n,i]=s;!n||!Et(i)||!jt(i)||this.set(n,i)};for(let s of t)e(s);return this}clean(){for(let[t,e]of this)e||this.delete(t);return this}entries(){let t=super.entries();return new x(t,s=>{if(s){let[n,i]=s,o=i?.deref();return[n,o]}return s})}forEach(t,e){for(let[s,n]of super.entries()){let i=n?.deref();i&&t.call(e,i,s,this)}}values(){return new x(super.values(),function(e){return e?.deref()||e})}hasValue(t,e=!0){if(At(t))return!1;this.#t&&(e=!1);for(let[s,n]of this)if(e&&t===n||!e&&t==n)return!0;return!1}filter(t,e){let s=[];for(let[n,i]of this)t.call(e,i,n,this)&&s.push([n,i]);return s}find(t,e){for(let[s,n]of this){let i=super.get(s),o=t.call(e,i,s,map);if(o||(o=t.call(e,n,s,map)),o)return n}return null}map(t,e,s,n){if(typeof t!="function")throw new TypeError("mapFn must be a function! Received",t);let i=[],o=[],c=n&&this.objectifyValues,f=n===void 0,l=c;for(let[p,j]of this){let[,h]=[0,1],g=t.call(e,[p,j],p,this);at(g[h])||at(Object(g[h]))&&(c=!0,f&&!l&&(l=!0,g[h]=Object(g[h]))),i.push(g)}return s?new r(i).objectifying(l):i}*[Symbol.iterator](){for(let[t,e]of this.entries())yield[t,e]}get[Symbol.toStringTag](){return this.constructor.name}},q=new u(Y);var z=class r extends Promise{#t=null;#e=null;#r=null;value=null;reason=null;#s=!1;constructor(t){let e=t&&typeof t=="object"?t:{};if(e?.resolve&&e?.reject)throw new TypeError("resolve and reject options cannot be simultaneously provided");let s,n;super((i,o)=>{s=i,n=o,e?.executor&&typeof e?.executor=="function"&&e?.executor(i,o)}),this.#r=i=>(e?.doNotTrackAnswers!==!0&&(this.value=i),this.#s=!0,s(i)),this.#e=async i=>(e?.doNotTrackAnswers!==!0&&(this.reason=i),this.#s=!0,n(i)),this.#t=this,e?.resolve?this.#r(e?.resolve):e?.reject&&this.#e(e?.reject)}get settled(){return this.#s}get promise(){return this.#t}resolve(t){return this.#r(t)}reject(t){return this.#e(t)}static get[Symbol.species](){return class extends r{constructor(e){super({executor:e})}}}},U=new u(z);var H=class{#t=[];constructor(t,...e){t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")?this.#t=[...t,...e]:typeof t=="function"&&t.constructor.name==="AsyncGeneratorFunction"?this.#t=t():this.#t=[t,...e]}async*[Symbol.asyncIterator](){for await(let t of this.#t)yield t}get[Symbol.toStringTag](){return this.constructor.name}static isAsyncIterable(t){return Object.prototype.toString.call(t?.[Symbol.asyncIterator])==="[object AsyncGeneratorFunction]"}},J=class{constructor(t){if(typeof t=="function"&&t.constructor.name==="AsyncGeneratorFunction")this.#t=t();else{if(!t||!Reflect.has(t,Symbol.asyncIterator))throw new TypeError("Value used to instantiate AsyncIterator is not an async iterable");this.#t=t}this.#e=this.#t[Symbol.asyncIterator]()}async asArray(){let t=[];for await(let e of this)t.push(e);return t}get asyncIterable(){return this.#t}async next(){let t=await this.#e.next();return t.done?{value:void 0,done:!0}:{value:t.value,done:!1}}async reset(){this.#e=this.#t[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this}get[Symbol.toStringTag](){return this.constructor.name}#t=null;#e=null},Q=new u(H),X=new u(J);var E=[[Object,d,Object.name],[Function,k,Function.name],[Reflect,D,"Reflect"],[String,nt,String.name],[Symbol,N,"Symbol"]],A=[[Object.prototype,Z,Object.name],[String.prototype,it,String.name],[Function.prototype,tt,Function.name],[Array.prototype,ot,Array.name],[Map.prototype,et,Map.name],[Set.prototype,rt,Set.name]],$=new Map([...E,...A]),O={[Q.key]:Q,[X.key]:X,[U.key]:U,[G.key]:G,[L.key]:L,[W.key]:W,[q.key]:q,[K.key]:K},m={};Object.assign(m,{enableAll(){m.enablePatches(),m.enableExtensions()},enablePatches(){$.forEach(r=>{r.apply()})},enableStaticPatches(r=([t,e])=>!0){let t=E.filter(I(r));return t.forEach(([e,s])=>s.apply()),t},enableInstancePatches(r=([t,e])=>!0){let t=A.filter(I(r));return t.forEach(([e,s])=>s.apply()),t},enableExtensions(){Object.values(O).forEach(r=>{r.apply()}),w.apply()},disableAll(){m.disablePatches(),m.disableExtensions()},disablePatches(){$.forEach(r=>{r.revert()})},disableStaticPatches(r=([t,e])=>!0){let t=E.filter(I(r));return t.forEach(([e,s])=>s.revert()),t},disableInstancePatches(r=([t,e])=>!0){let t=A.filter(I(r));return t.forEach(([e,s])=>s.revert()),t},disableExtensions(){Object.values(O).forEach(r=>{r.revert()}),w.revert()}});var ft=(()=>{let r={patches:{},classes:{},global:{}},t=(n,[i,o])=>(new S(o.descriptor,o.owner).applyTo(n,i,!0),n),e=(n,[i,o,c])=>(n?.[c]||(n[c]={}),[...o].reduce(t,n[c]),n),s=(n,[i,o,c])=>(n?.[c]||(n[c]={}),n[c]?.prototype||(n[c].prototype={}),[...o].reduce(t,n[c].prototype),n);E.reduce(e,r.patches),A.reduce(s,r.patches),Object.values(O).flatMap(n=>[...n]).reduce(t,r.classes);for(let[n,i]of w){let o=new S(i.descriptor,i.owner);Object.defineProperty(r.global,n,o.toObject(!0))}return r})(),Rt={...m,Extensions:O,Patches:$,GlobalFunctionsAndProps:w,StaticPatches:E,InstancePatches:A,Controls:m,extensions:O,patches:$,all:ft},Tt=Rt;function I(r=([t,e])=>!0){let t=r;if(typeof t!="function"){let e=Array.isArray(r)?r:[r];t=([s,n])=>{for(let i of e){let o=String(i);if(o.startsWith("^")&&(s?.name??s)!=o.substring(1)||(s?.name??s)==o)return!0}return!1}}return t}return yt(Pt);})();
|
|
8
|
+
//# sourceMappingURL=basic-extensions.bundle.2.2.1.js.map
|