-
Notifications
You must be signed in to change notification settings - Fork 5
/
seneca-browser.js
533 lines (384 loc) · 372 KB
/
seneca-browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Seneca = f()}})(function(){var define,module,exports;
var createModuleFactory = function createModuleFactory(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}};
var _$main_138 = createModuleFactory(function (module, exports) {
(function (setImmediate,clearImmediate){(function (){
var nextTick=_$browser_108.nextTick,apply=Function.prototype.apply,slice=Array.prototype.slice,immediateIds={},nextImmediateId=0;function Timeout(e,t){this._id=e,this._clearFn=t}exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(e){e.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},exports.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},exports._unrefActive=exports.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},exports.setImmediate="function"==typeof setImmediate?setImmediate:function(e){var t=nextImmediateId++,i=!(arguments.length<2)&&slice.call(arguments,1);return immediateIds[t]=!0,nextTick((function(){immediateIds[t]&&(i?e.apply(null,i):e.call(null),exports.clearImmediate(t))})),t},exports.clearImmediate="function"==typeof clearImmediate?clearImmediate:function(e){delete immediateIds[e]};
}).call(this)}).call(this,_$main_138({}).setImmediate,_$main_138({}).clearImmediate)
});
var _$isArguments_99 = createModuleFactory(function (module, exports) {
"use strict";var toStr=Object.prototype.toString;module.exports=function(t){var e=toStr.call(t),o="[object Arguments]"===e;return o||(o="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===toStr.call(t.callee)),o};
});
"use strict";var _$shams_78=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0};
"use strict";/* removed: var _$shams_78=require("has-symbols/shams"); */;var _$shams_79=function(){return _$shams_78()&&!!Symbol.toStringTag};
"use strict";var _$Error_55=Error;
"use strict";var _$EvalError_54=EvalError;
"use strict";var _$RangeError_56=RangeError;
"use strict";var _$ReferenceError_57=ReferenceError;
"use strict";var _$SyntaxError_58=SyntaxError;
"use strict";var _$TypeError_59=TypeError;
"use strict";var _$URIError_60=URIError;
"use strict";var origSymbol="undefined"!=typeof Symbol&&Symbol;var _$hasSymbols_77=function(){return"function"==typeof origSymbol&&("function"==typeof Symbol&&("symbol"==typeof origSymbol("foo")&&("symbol"==typeof Symbol("bar")&&_$shams_78())))};
"use strict";var test={__proto__:null,foo:{}},$Object=Object;var _$hasProto_76=function(){return{__proto__:test}.foo===test.foo&&!(test instanceof $Object)};
"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function(t,n){for(var r=[],o=0;o<t.length;o+=1)r[o]=t[o];for(var e=0;e<n.length;e+=1)r[e+t.length]=n[e];return r},slicy=function(t,n){for(var r=[],o=n||0,e=0;o<t.length;o+=1,e+=1)r[e]=t[o];return r},joiny=function(t,n){for(var r="",o=0;o<t.length;o+=1)r+=t[o],o+1<t.length&&(r+=n);return r};var _$implementation_69=function(t){var n=this;if("function"!=typeof n||toStr.apply(n)!==funcType)throw new TypeError(ERROR_MESSAGE+n);for(var r,o=slicy(arguments,1),e=max(0,n.length-o.length),i=[],c=0;c<e;c++)i[c]="$"+c;if(r=Function("binder","return function ("+joiny(i,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var e=n.apply(this,concatty(o,arguments));return Object(e)===e?e:this}return n.apply(t,concatty(o,arguments))})),n.prototype){var p=function(){};p.prototype=n.prototype,r.prototype=new p,p.prototype=null}return r};
"use strict";/* removed: var _$implementation_69=require("./implementation"); */;var _$functionBind_70=Function.prototype.bind||_$implementation_69;
"use strict";var call=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty;var _$hasown_80=_$functionBind_70.call(call,$hasOwn);
"use strict";var undefined,$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=Object.getOwnPropertyDescriptor;if($gOPD)try{$gOPD({},"")}catch(r){$gOPD=null}var throwTypeError=function(){throw new _$TypeError_59},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,__hasSymbols_72=_$hasSymbols_77(),hasProto=_$hasProto_76(),getProto=Object.getPrototypeOf||(hasProto?function(r){return r.__proto__}:null),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":__hasSymbols_72&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":_$Error_55,"%eval%":eval,"%EvalError%":_$EvalError_54,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":__hasSymbols_72&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&__hasSymbols_72&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":_$RangeError_56,"%ReferenceError%":_$ReferenceError_57,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&__hasSymbols_72&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":__hasSymbols_72&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":__hasSymbols_72?Symbol:undefined,"%SyntaxError%":_$SyntaxError_58,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":_$TypeError_59,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":_$URIError_60,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function r(e){var t;if("%AsyncFunction%"===e)t=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===e)t=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===e)t=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===e){var o=r("%AsyncGeneratorFunction%");o&&(t=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=r("%AsyncGenerator%");n&&getProto&&(t=getProto(n.prototype))}return INTRINSICS[e]=t,t},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$concat=_$functionBind_70.call(Function.call,Array.prototype.concat),$spliceApply=_$functionBind_70.call(Function.apply,Array.prototype.splice),$replace=_$functionBind_70.call(Function.call,String.prototype.replace),$strSlice=_$functionBind_70.call(Function.call,String.prototype.slice),$exec=_$functionBind_70.call(Function.call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new _$SyntaxError_58("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new _$SyntaxError_58("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,(function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r})),o},getBaseIntrinsic=function(r,e){var t,o=r;if(_$hasown_80(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),_$hasown_80(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new _$TypeError_59("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new _$SyntaxError_58("intrinsic "+r+" does not exist!")};var _$getIntrinsic_72=function(r,e){if("string"!=typeof r||0===r.length)throw new _$TypeError_59("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new _$TypeError_59('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new _$SyntaxError_58("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,y=n.value,i=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var d=1,s=!0;d<t.length;d+=1){var f=t[d],u=$strSlice(f,0,1),l=$strSlice(f,-1);if(('"'===u||"'"===u||"`"===u||'"'===l||"'"===l||"`"===l)&&u!==l)throw new _$SyntaxError_58("property names with quotes must have matching quotes");if("constructor"!==f&&s||(i=!0),_$hasown_80(INTRINSICS,a="%"+(o+="."+f)+"%"))y=INTRINSICS[a];else if(null!=y){if(!(f in y)){if(!e)throw new _$TypeError_59("base intrinsic for "+r+" exists, but the property is not available.");return}if($gOPD&&d+1>=t.length){var c=$gOPD(y,f);y=(s=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:y[f]}else s=_$hasown_80(y,f),y=y[f];s&&!i&&(INTRINSICS[a]=y)}}return y};
"use strict";var $defineProperty=_$getIntrinsic_72("%Object.defineProperty%",!0)||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}var _$$defineProperty_53=$defineProperty;
"use strict";var __$gOPD_73=_$getIntrinsic_72("%Object.getOwnPropertyDescriptor%",!0);if(__$gOPD_73)try{__$gOPD_73([],"length")}catch(t){__$gOPD_73=null}var _$$gOPD_73=__$gOPD_73;
"use strict";/* removed: var _$$gOPD_73=require("gopd"); */;var _$defineDataProperty_11=function(e,r,o){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new _$TypeError_59("`obj` must be an object or a function`");if("string"!=typeof r&&"symbol"!=typeof r)throw new _$TypeError_59("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new _$TypeError_59("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new _$TypeError_59("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new _$TypeError_59("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new _$TypeError_59("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,t=arguments.length>5?arguments[5]:null,i=arguments.length>6&&arguments[6],u=!!_$$gOPD_73&&_$$gOPD_73(e,r);if(_$$defineProperty_53)_$$defineProperty_53(e,r,{configurable:null===t&&u?u.configurable:!t,enumerable:null===n&&u?u.enumerable:!n,value:o,writable:null===l&&u?u.writable:!l});else{if(!i&&(n||l||t))throw new _$SyntaxError_58("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[r]=o}};
var _$hasPropertyDescriptors_75 = {};
"use strict";var hasPropertyDescriptors=function(){return!!_$$defineProperty_53};hasPropertyDescriptors.hasArrayLengthDefineBug=function(){if(!_$$defineProperty_53)return null;try{return 1!==_$$defineProperty_53([],"length",{value:1}).length}catch(r){return!0}},_$hasPropertyDescriptors_75=hasPropertyDescriptors;
"use strict";var hasDescriptors=_$hasPropertyDescriptors_75(),$floor=_$getIntrinsic_72("%Math.floor%");var _$setFunctionLength_133=function(e,r){if("function"!=typeof e)throw new _$TypeError_59("`fn` is not a function");if("number"!=typeof r||r<0||r>4294967295||$floor(r)!==r)throw new _$TypeError_59("`length` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],i=!0,n=!0;if("length"in e&&_$$gOPD_73){var o=_$$gOPD_73(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(n=!1)}return(i||n||!t)&&(hasDescriptors?_$defineDataProperty_11(e,"length",r,!0,!0):_$defineDataProperty_11(e,"length",r)),e};
var _$callBind_10 = {};
"use strict";var $apply=_$getIntrinsic_72("%Function.prototype.apply%"),$call=_$getIntrinsic_72("%Function.prototype.call%"),$reflectApply=_$getIntrinsic_72("%Reflect.apply%",!0)||_$functionBind_70.call($call,$apply),$max=_$getIntrinsic_72("%Math.max%");_$callBind_10=function(e){if("function"!=typeof e)throw new _$TypeError_59("a function is required");var t=$reflectApply(_$functionBind_70,$call,arguments);return _$setFunctionLength_133(t,1+$max(0,e.length-(arguments.length-1)),!0)};var applyBind=function(){return $reflectApply(_$functionBind_70,$apply,arguments)};_$$defineProperty_53?_$$defineProperty_53(_$callBind_10,"apply",{value:applyBind}):_$callBind_10.apply=applyBind;
"use strict";var $indexOf=_$callBind_10(_$getIntrinsic_72("String.prototype.indexOf"));var _$callBound_9=function(i,n){var t=_$getIntrinsic_72(i,!!n);return"function"==typeof t&&$indexOf(i,".prototype.")>-1?_$callBind_10(t):t};
var _$isArguments_82 = {};
"use strict";var hasToStringTag=_$shams_79(),$toString=_$callBound_9("Object.prototype.toString"),isStandardArguments=function(t){return!(hasToStringTag&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===$toString(t)},isLegacyArguments=function(t){return!!isStandardArguments(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==$toString(t)&&"[object Function]"===$toString(t.callee)},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments,_$isArguments_82=supportsStandardArguments?isStandardArguments:isLegacyArguments;
"use strict";var GeneratorFunction,__toStr_85=Object.prototype.toString,fnToStr=Function.prototype.toString,isFnRegex=/^\s*(?:function)?\*/,__hasToStringTag_85=_$shams_79(),__getProto_85=Object.getPrototypeOf,getGeneratorFunc=function(){if(!__hasToStringTag_85)return!1;try{return Function("return function*() {}")()}catch(t){}};var _$isGeneratorFunction_85=function(t){if("function"!=typeof t)return!1;if(isFnRegex.test(fnToStr.call(t)))return!0;if(!__hasToStringTag_85)return"[object GeneratorFunction]"===__toStr_85.call(t);if(!__getProto_85)return!1;if(void 0===GeneratorFunction){var r=getGeneratorFunc();GeneratorFunction=!!r&&__getProto_85(r)}return __getProto_85(t)===GeneratorFunction};
"use strict";var badArrayLike,isCallableMarker,__fnToStr_83=Function.prototype.toString,reflectApply="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof reflectApply&&"function"==typeof Object.defineProperty)try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply((function(){throw 42}),null,badArrayLike)}catch(t){t!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(t){try{var e=__fnToStr_83.call(t);return constructorRegex.test(e)}catch(t){return!1}},tryFunctionObject=function(t){try{return!isES6ClassFn(t)&&(__fnToStr_83.call(t),!0)}catch(t){return!1}},__toStr_83=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",__hasToStringTag_83="function"==typeof Symbol&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if("object"==typeof document){var all=document.all;__toStr_83.call(all)===__toStr_83.call(document.all)&&(isDDA=function(t){if((isIE68||!t)&&(void 0===t||"object"==typeof t))try{var e=__toStr_83.call(t);return(e===ddaClass||e===ddaClass2||e===ddaClass3||e===objectClass)&&null==t("")}catch(t){}return!1})}var _$isCallable_83=reflectApply?function(t){if(isDDA(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{reflectApply(t,null,badArrayLike)}catch(t){if(t!==isCallableMarker)return!1}return!isES6ClassFn(t)&&tryFunctionObject(t)}:function(t){if(isDDA(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(__hasToStringTag_83)return tryFunctionObject(t);if(isES6ClassFn(t))return!1;var e=__toStr_83.call(t);return!(e!==fnClass&&e!==genClass&&!/^\[object HTML/.test(e))&&tryFunctionObject(t)};
"use strict";var __toStr_68=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,forEachArray=function(r,t,a){for(var o=0,l=r.length;o<l;o++)hasOwnProperty.call(r,o)&&(null==a?t(r[o],o,r):t.call(a,r[o],o,r))},forEachString=function(r,t,a){for(var o=0,l=r.length;o<l;o++)null==a?t(r.charAt(o),o,r):t.call(a,r.charAt(o),o,r)},forEachObject=function(r,t,a){for(var o in r)hasOwnProperty.call(r,o)&&(null==a?t(r[o],o,r):t.call(a,r[o],o,r))},forEach=function(r,t,a){if(!_$isCallable_83(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===__toStr_68.call(r)?forEachArray(r,t,o):"string"==typeof r?forEachString(r,t,o):forEachObject(r,t,o)};var _$forEach_68=forEach;
"use strict";var _$possibleTypedArrayNames_107=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"];
var _$availableTypedArrays_6 = {};
(function (global){(function (){
"use strict";var g="undefined"==typeof globalThis?global:globalThis;_$availableTypedArrays_6=function(){for(var e=[],s=0;s<_$possibleTypedArrayNames_107.length;s++)"function"==typeof g[_$possibleTypedArrayNames_107[s]]&&(e[e.length]=_$possibleTypedArrayNames_107[s]);return e};
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
var _$whichTypedArray_146 = {};
(function (global){(function (){
"use strict";var $toString=_$callBound_9("Object.prototype.toString"),hasToStringTag=_$shams_79(),g="undefined"==typeof globalThis?global:globalThis,typedArrays=_$availableTypedArrays_6(),$slice=_$callBound_9("String.prototype.slice"),getPrototypeOf=Object.getPrototypeOf,$indexOf=_$callBound_9("Array.prototype.indexOf",!0)||function(r,t){for(var e=0;e<r.length;e+=1)if(r[e]===t)return e;return-1},cache={__proto__:null};_$forEach_68(typedArrays,hasToStringTag&&_$$gOPD_73&&getPrototypeOf?function(r){var t=new g[r];if(Symbol.toStringTag in t){var e=getPrototypeOf(t),a=_$$gOPD_73(e,Symbol.toStringTag);if(!a){var o=getPrototypeOf(e);a=_$$gOPD_73(o,Symbol.toStringTag)}cache["$"+r]=_$callBind_10(a.get)}}:function(r){var t=new g[r],e=t.slice||t.set;e&&(cache["$"+r]=_$callBind_10(e))});var tryTypedArrays=function(r){var t=!1;return _$forEach_68(cache,(function(e,a){if(!t)try{"$"+e(r)===a&&(t=$slice(a,1))}catch(r){}})),t},trySlices=function(r){var t=!1;return _$forEach_68(cache,(function(e,a){if(!t)try{e(r),t=$slice(a,1)}catch(r){}})),t};_$whichTypedArray_146=function(r){if(!r||"object"!=typeof r)return!1;if(!hasToStringTag){var t=$slice($toString(r),8,-1);return $indexOf(typedArrays,t)>-1?t:"Object"===t&&trySlices(r)}return _$$gOPD_73?tryTypedArrays(r):null};
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
"use strict";/* removed: var _$whichTypedArray_146=require("which-typed-array"); */;var _$isTypedArray_89=function(r){return!!_$whichTypedArray_146(r)};
var _$types_144 = {};
"use strict";/* removed: var _$isTypedArray_89=require("is-typed-array"); */;function uncurryThis(r){return r.call.bind(r)}var BigIntSupported="undefined"!=typeof BigInt,SymbolSupported="undefined"!=typeof Symbol,ObjectToString=uncurryThis(Object.prototype.toString),numberValue=uncurryThis(Number.prototype.valueOf),stringValue=uncurryThis(String.prototype.valueOf),booleanValue=uncurryThis(Boolean.prototype.valueOf);if(BigIntSupported)var bigIntValue=uncurryThis(BigInt.prototype.valueOf);if(SymbolSupported)var symbolValue=uncurryThis(Symbol.prototype.valueOf);function checkBoxedPrimitive(r,e){if("object"!=typeof r)return!1;try{return e(r),!0}catch(r){return!1}}function isPromise(r){return"undefined"!=typeof Promise&&r instanceof Promise||null!==r&&"object"==typeof r&&"function"==typeof r.then&&"function"==typeof r.catch}function isArrayBufferView(r){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(r):_$isTypedArray_89(r)||isDataView(r)}function isUint8Array(r){return"Uint8Array"===_$whichTypedArray_146(r)}function isUint8ClampedArray(r){return"Uint8ClampedArray"===_$whichTypedArray_146(r)}function isUint16Array(r){return"Uint16Array"===_$whichTypedArray_146(r)}function isUint32Array(r){return"Uint32Array"===_$whichTypedArray_146(r)}function isInt8Array(r){return"Int8Array"===_$whichTypedArray_146(r)}function isInt16Array(r){return"Int16Array"===_$whichTypedArray_146(r)}function isInt32Array(r){return"Int32Array"===_$whichTypedArray_146(r)}function isFloat32Array(r){return"Float32Array"===_$whichTypedArray_146(r)}function isFloat64Array(r){return"Float64Array"===_$whichTypedArray_146(r)}function isBigInt64Array(r){return"BigInt64Array"===_$whichTypedArray_146(r)}function isBigUint64Array(r){return"BigUint64Array"===_$whichTypedArray_146(r)}function isMapToString(r){return"[object Map]"===ObjectToString(r)}function isMap(r){return"undefined"!=typeof Map&&(isMapToString.working?isMapToString(r):r instanceof Map)}function isSetToString(r){return"[object Set]"===ObjectToString(r)}function isSet(r){return"undefined"!=typeof Set&&(isSetToString.working?isSetToString(r):r instanceof Set)}function isWeakMapToString(r){return"[object WeakMap]"===ObjectToString(r)}function isWeakMap(r){return"undefined"!=typeof WeakMap&&(isWeakMapToString.working?isWeakMapToString(r):r instanceof WeakMap)}function isWeakSetToString(r){return"[object WeakSet]"===ObjectToString(r)}function isWeakSet(r){return isWeakSetToString(r)}function isArrayBufferToString(r){return"[object ArrayBuffer]"===ObjectToString(r)}function isArrayBuffer(r){return"undefined"!=typeof ArrayBuffer&&(isArrayBufferToString.working?isArrayBufferToString(r):r instanceof ArrayBuffer)}function isDataViewToString(r){return"[object DataView]"===ObjectToString(r)}function isDataView(r){return"undefined"!=typeof DataView&&(isDataViewToString.working?isDataViewToString(r):r instanceof DataView)}_$types_144.isArgumentsObject=_$isArguments_82,_$types_144.isGeneratorFunction=_$isGeneratorFunction_85,_$types_144.isTypedArray=_$isTypedArray_89,_$types_144.isPromise=isPromise,_$types_144.isArrayBufferView=isArrayBufferView,_$types_144.isUint8Array=isUint8Array,_$types_144.isUint8ClampedArray=isUint8ClampedArray,_$types_144.isUint16Array=isUint16Array,_$types_144.isUint32Array=isUint32Array,_$types_144.isInt8Array=isInt8Array,_$types_144.isInt16Array=isInt16Array,_$types_144.isInt32Array=isInt32Array,_$types_144.isFloat32Array=isFloat32Array,_$types_144.isFloat64Array=isFloat64Array,_$types_144.isBigInt64Array=isBigInt64Array,_$types_144.isBigUint64Array=isBigUint64Array,isMapToString.working="undefined"!=typeof Map&&isMapToString(new Map),_$types_144.isMap=isMap,isSetToString.working="undefined"!=typeof Set&&isSetToString(new Set),_$types_144.isSet=isSet,isWeakMapToString.working="undefined"!=typeof WeakMap&&isWeakMapToString(new WeakMap),_$types_144.isWeakMap=isWeakMap,isWeakSetToString.working="undefined"!=typeof WeakSet&&isWeakSetToString(new WeakSet),_$types_144.isWeakSet=isWeakSet,isArrayBufferToString.working="undefined"!=typeof ArrayBuffer&&isArrayBufferToString(new ArrayBuffer),_$types_144.isArrayBuffer=isArrayBuffer,isDataViewToString.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&isDataViewToString(new DataView(new ArrayBuffer(1),0,1)),_$types_144.isDataView=isDataView;var SharedArrayBufferCopy="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function isSharedArrayBufferToString(r){return"[object SharedArrayBuffer]"===ObjectToString(r)}function isSharedArrayBuffer(r){return void 0!==SharedArrayBufferCopy&&(void 0===isSharedArrayBufferToString.working&&(isSharedArrayBufferToString.working=isSharedArrayBufferToString(new SharedArrayBufferCopy)),isSharedArrayBufferToString.working?isSharedArrayBufferToString(r):r instanceof SharedArrayBufferCopy)}function isAsyncFunction(r){return"[object AsyncFunction]"===ObjectToString(r)}function isMapIterator(r){return"[object Map Iterator]"===ObjectToString(r)}function isSetIterator(r){return"[object Set Iterator]"===ObjectToString(r)}function isGeneratorObject(r){return"[object Generator]"===ObjectToString(r)}function isWebAssemblyCompiledModule(r){return"[object WebAssembly.Module]"===ObjectToString(r)}function isNumberObject(r){return checkBoxedPrimitive(r,numberValue)}function isStringObject(r){return checkBoxedPrimitive(r,stringValue)}function isBooleanObject(r){return checkBoxedPrimitive(r,booleanValue)}function isBigIntObject(r){return BigIntSupported&&checkBoxedPrimitive(r,bigIntValue)}function isSymbolObject(r){return SymbolSupported&&checkBoxedPrimitive(r,symbolValue)}function isBoxedPrimitive(r){return isNumberObject(r)||isStringObject(r)||isBooleanObject(r)||isBigIntObject(r)||isSymbolObject(r)}function isAnyArrayBuffer(r){return"undefined"!=typeof Uint8Array&&(isArrayBuffer(r)||isSharedArrayBuffer(r))}_$types_144.isSharedArrayBuffer=isSharedArrayBuffer,_$types_144.isAsyncFunction=isAsyncFunction,_$types_144.isMapIterator=isMapIterator,_$types_144.isSetIterator=isSetIterator,_$types_144.isGeneratorObject=isGeneratorObject,_$types_144.isWebAssemblyCompiledModule=isWebAssemblyCompiledModule,_$types_144.isNumberObject=isNumberObject,_$types_144.isStringObject=isStringObject,_$types_144.isBooleanObject=isBooleanObject,_$types_144.isBigIntObject=isBigIntObject,_$types_144.isSymbolObject=isSymbolObject,_$types_144.isBoxedPrimitive=isBoxedPrimitive,_$types_144.isAnyArrayBuffer=isAnyArrayBuffer,["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(r){Object.defineProperty(_$types_144,r,{enumerable:!1,value:function(){throw new Error(r+" is not supported in userland")}})}));
var _$isBufferBrowser_143=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8};
var _$inherits_browser_81 = {};
"function"==typeof Object.create?_$inherits_browser_81=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:_$inherits_browser_81=function(t,e){if(e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}};
var _$browser_108 = {};
var cachedSetTimeout,cachedClearTimeout,process=_$browser_108={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
var _$util_145 = {};
(function (process){(function (){
var getOwnPropertyDescriptors=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),t={},n=0;n<r.length;n++)t[r[n]]=Object.getOwnPropertyDescriptor(e,r[n]);return t},formatRegExp=/%[sdj%]/g;_$util_145.format=function(e){if(!isString(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(inspect(arguments[t]));return r.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(e).replace(formatRegExp,(function(e){if("%%"===e)return"%";if(t>=i)return e;switch(e){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(e){return"[Circular]"}default:return e}})),s=n[t];t<i;s=n[++t])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o},_$util_145.deprecate=function(e,r){if("undefined"!=typeof process&&!0===process.noDeprecation)return e;if("undefined"==typeof process)return function(){return _$util_145.deprecate(e,r).apply(this,arguments)};var t=!1;return function(){if(!t){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}};var debugs={},debugEnvRegex=/^$/;if(process.env.NODE_DEBUG){var debugEnv=process.env.NODE_DEBUG;debugEnv=debugEnv.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),debugEnvRegex=new RegExp("^"+debugEnv+"$","i")}function inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&_$util_145._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?"["+inspect.colors[t][0]+"m"+e+"["+inspect.colors[t][1]+"m":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach((function(e,t){r[e]=!0})),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==_$util_145.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c,p="",a=!1,l=["{","}"];(isArray(r)&&(a=!0,l=["[","]"]),isFunction(r))&&(p=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(p=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(p=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(p=" "+formatError(r)),0!==o.length||a&&0!=r.length?t<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=a?formatArray(e,r,t,s,o):o.map((function(n){return formatProperty(e,r,t,s,n,a)})),e.seen.pop(),reduceToSingleString(c,p,l)):l[0]+p+l[1]}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize("undefined","undefined");if(isString(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return isNumber(r)?e.stylize(""+r,"number"):isBoolean(r)?e.stylize(""+r,"boolean"):isNull(r)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;s<u;++s)hasOwnProperty(r,String(s))?o.push(formatProperty(e,r,t,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(formatProperty(e,r,t,n,i,!0))})),o}function formatProperty(e,r,t,n,i,o){var s,u,c;if((c=Object.getOwnPropertyDescriptor(r,i)||{value:r[i]}).get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=isNull(t)?formatValue(e,c.value,null):formatValue(e,c.value,t-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+u.split("\n").map((function(e){return" "+e})).join("\n")):u=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return u;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function reduceToSingleString(e,r,t){return e.reduce((function(e,r){return r.indexOf("\n")>=0&&0,e+r.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?t[0]+(""===r?"":r+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}_$util_145.debuglog=function(e){if(e=e.toUpperCase(),!debugs[e])if(debugEnvRegex.test(e)){var r=process.pid;debugs[e]=function(){var t=_$util_145.format.apply(_$util_145,arguments);console.error("%s %d: %s",e,r,t)}}else debugs[e]=function(){};return debugs[e]},_$util_145.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},_$util_145.types=_$types_144,_$util_145.isArray=isArray,_$util_145.isBoolean=isBoolean,_$util_145.isNull=isNull,_$util_145.isNullOrUndefined=isNullOrUndefined,_$util_145.isNumber=isNumber,_$util_145.isString=isString,_$util_145.isSymbol=isSymbol,_$util_145.isUndefined=isUndefined,_$util_145.isRegExp=isRegExp,_$util_145.types.isRegExp=isRegExp,_$util_145.isObject=isObject,_$util_145.isDate=isDate,_$util_145.types.isDate=isDate,_$util_145.isError=isError,_$util_145.types.isNativeError=isError,_$util_145.isFunction=isFunction,_$util_145.isPrimitive=isPrimitive,_$util_145.isBuffer=_$isBufferBrowser_143;var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],r].join(" ")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}_$util_145.log=function(){console.log("%s - %s",timestamp(),_$util_145.format.apply(_$util_145,arguments))},_$util_145.inherits=_$inherits_browser_81,_$util_145._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e};var kCustomPromisifiedSymbol="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function callbackifyOnRejected(e,r){if(!e){var t=new Error("Promise was rejected with a falsy value");t.reason=e,e=t}return r(e)}function callbackify(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);var n=r.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,o=function(){return n.apply(i,arguments)};e.apply(this,r).then((function(e){process.nextTick(o.bind(null,null,e))}),(function(e){process.nextTick(callbackifyOnRejected.bind(null,e,o))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,getOwnPropertyDescriptors(e)),r}_$util_145.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&e[kCustomPromisifiedSymbol]){var r;if("function"!=typeof(r=e[kCustomPromisifiedSymbol]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,kCustomPromisifiedSymbol,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var r,t,n=new Promise((function(e,n){r=e,t=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?t(e):r(n)}));try{e.apply(this,i)}catch(e){t(e)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),kCustomPromisifiedSymbol&&Object.defineProperty(r,kCustomPromisifiedSymbol,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,getOwnPropertyDescriptors(e))},_$util_145.promisify.custom=kCustomPromisifiedSymbol,_$util_145.callbackify=callbackify;
}).call(this)}).call(this,_$browser_108)
"use strict";var keysShim;if(!Object.keys){var has=Object.prototype.hasOwnProperty,__toStr_97=Object.prototype.toString,isArgs=_$isArguments_99({}),isEnumerable=Object.prototype.propertyIsEnumerable,hasDontEnumBug=!isEnumerable.call({toString:null},"toString"),hasProtoEnumBug=isEnumerable.call((function(){}),"prototype"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],equalsConstructorPrototype=function(t){var o=t.constructor;return o&&o.prototype===t},excludedKeys={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hasAutomationEqualityBug=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!excludedKeys["$"+t]&&has.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{equalsConstructorPrototype(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),equalsConstructorPrototypeIfNotBuggy=function(t){if("undefined"==typeof window||!hasAutomationEqualityBug)return equalsConstructorPrototype(t);try{return equalsConstructorPrototype(t)}catch(t){return!1}};keysShim=function(t){var o=null!==t&&"object"==typeof t,r="[object Function]"===__toStr_97.call(t),e=isArgs(t),n=o&&"[object String]"===__toStr_97.call(t),u=[];if(!o&&!r&&!e)throw new TypeError("Object.keys called on a non-object");var s=hasProtoEnumBug&&r;if(n&&t.length>0&&!has.call(t,0))for(var a=0;a<t.length;++a)u.push(String(a));if(e&&t.length>0)for(var l=0;l<t.length;++l)u.push(String(l));else for(var i in t)s&&"prototype"===i||!has.call(t,i)||u.push(String(i));if(hasDontEnumBug)for(var c=equalsConstructorPrototypeIfNotBuggy(t),p=0;p<dontEnums.length;++p)c&&"constructor"===dontEnums[p]||!has.call(t,dontEnums[p])||u.push(dontEnums[p]);return u}}var _$keysShim_97=keysShim;
var _$objectKeys_98 = {};
"use strict";var slice=Array.prototype.slice,__isArgs_98=_$isArguments_99({}),origKeys=Object.keys,__keysShim_98=origKeys?function(e){return origKeys(e)}:_$keysShim_97,originalKeys=Object.keys;__keysShim_98.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return __isArgs_98(e)?originalKeys(slice.call(e)):originalKeys(e)})}else Object.keys=__keysShim_98;return Object.keys||__keysShim_98},_$objectKeys_98=__keysShim_98;
var _$defineProperties_12 = {};
"use strict";var __hasSymbols_12="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),__toStr_12=Object.prototype.toString,concat=Array.prototype.concat,isFunction=function(e){return"function"==typeof e&&"[object Function]"===__toStr_12.call(e)},supportsDescriptors=_$hasPropertyDescriptors_75(),defineProperty=function(e,r,t,o){if(r in e)if(!0===o){if(e[r]===t)return}else if(!isFunction(o)||!o())return;supportsDescriptors?_$defineDataProperty_11(e,r,t,!0):_$defineDataProperty_11(e,r,t)},defineProperties=function(e,r){var t=arguments.length>2?arguments[2]:{},o=_$objectKeys_98(r);__hasSymbols_12&&(o=concat.call(o,Object.getOwnPropertySymbols(r)));for(var i=0;i<o.length;i+=1)defineProperty(e,o[i],r[o[i]],t[o[i]])};defineProperties.supportsDescriptors=!!supportsDescriptors,_$defineProperties_12=defineProperties;
"use strict";var _$IsPropertyKey_25=function(t){return"string"==typeof t||"symbol"==typeof t};
"use strict";var allowed={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};var _$propertyDescriptor_51=function(r){if(!r||"object"!=typeof r)return!1;for(var e in r)if(_$hasown_80(r,e)&&!allowed[e])return!1;var t=_$hasown_80(r,"[[Value]]")||_$hasown_80(r,"[[Writable]]"),a=_$hasown_80(r,"[[Get]]")||_$hasown_80(r,"[[Set]]");if(t&&a)throw new _$TypeError_59("Property Descriptors may not be both accessor and data descriptors");return!0};
"use strict";/* removed: var _$propertyDescriptor_51=require("../helpers/records/property-descriptor"); */;var _$IsAccessorDescriptor_19=function(r){if(void 0===r)return!1;if(!_$propertyDescriptor_51(r))throw new _$TypeError_59("Assertion failed: `Desc` must be a Property Descriptor");return!(!_$hasown_80(r,"[[Get]]")&&!_$hasown_80(r,"[[Set]]"))};
"use strict";var _$isPrimitive_49=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t};
"use strict";var $preventExtensions=_$getIntrinsic_72("%Object.preventExtensions%",!0),$isExtensible=_$getIntrinsic_72("%Object.isExtensible%",!0);var _$IsExtensible_23=$preventExtensions?function(i){return!_$isPrimitive_49(i)&&$isExtensible(i)}:function(i){return!_$isPrimitive_49(i)};
"use strict";var _$Type_42=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0};
"use strict";/* removed: var _$Type_42=require("../5/Type"); */;var _$Type_38=function(e){return"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":_$Type_42(e)};
"use strict";var _$ToBoolean_31=function(t){return!!t};
"use strict";var _$IsCallable_21=_$isCallable_83;
"use strict";/* removed: var _$IsCallable_21=require("./IsCallable"); */;var _$ToPropertyDescriptor_36=function(e){if("Object"!==_$Type_38(e))throw new _$TypeError_59("ToPropertyDescriptor requires an object");var r={};if(_$hasown_80(e,"enumerable")&&(r["[[Enumerable]]"]=_$ToBoolean_31(e.enumerable)),_$hasown_80(e,"configurable")&&(r["[[Configurable]]"]=_$ToBoolean_31(e.configurable)),_$hasown_80(e,"value")&&(r["[[Value]]"]=e.value),_$hasown_80(e,"writable")&&(r["[[Writable]]"]=_$ToBoolean_31(e.writable)),_$hasown_80(e,"get")){var a=e.get;if(void 0!==a&&!_$IsCallable_21(a))throw new _$TypeError_59("getter must be a function");r["[[Get]]"]=a}if(_$hasown_80(e,"set")){var o=e.set;if(void 0!==o&&!_$IsCallable_21(o))throw new _$TypeError_59("setter must be a function");r["[[Set]]"]=o}if((_$hasown_80(r,"[[Get]]")||_$hasown_80(r,"[[Set]]"))&&(_$hasown_80(r,"[[Value]]")||_$hasown_80(r,"[[Writable]]")))throw new _$TypeError_59("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return r};
"use strict";var _$isNaN_48=Number.isNaN||function(e){return e!=e};
"use strict";/* removed: var _$isNaN_48=require("../helpers/isNaN"); */;var _$SameValue_29=function(e,r){return e===r?0!==e||1/e==1/r:_$isNaN_48(e)&&_$isNaN_48(r)};
"use strict";var $Array=_$getIntrinsic_72("%Array%"),__toStr_44=!$Array.isArray&&_$callBound_9("Object.prototype.toString");var _$IsArray_44=$Array.isArray||function(r){return"[object Array]"===__toStr_44(r)};
"use strict";var hasArrayLengthDefineBug=_$hasPropertyDescriptors_75.hasArrayLengthDefineBug(),isArray=hasArrayLengthDefineBug&&_$IsArray_44,$isEnumerable=_$callBound_9("Object.prototype.propertyIsEnumerable");var _$DefineOwnProperty_43=function(e,r,n,t,a,i){if(!_$$defineProperty_53){if(!e(i))return!1;if(!i["[[Configurable]]"]||!i["[[Writable]]"])return!1;if(a in t&&$isEnumerable(t,a)!==!!i["[[Enumerable]]"])return!1;var u=i["[[Value]]"];return t[a]=u,r(t[a],u)}return hasArrayLengthDefineBug&&"length"===a&&"[[Value]]"in i&&isArray(t)&&t.length!==i["[[Value]]"]?(t.length=i["[[Value]]"],t.length===i["[[Value]]"]):(_$$defineProperty_53(t,a,n(i)),!0)};
"use strict";/* removed: var _$propertyDescriptor_51=require("./records/property-descriptor"); */;var _$isFullyPopulatedPropertyDescriptor_47=function(r,e){return _$propertyDescriptor_51(e)&&"object"==typeof e&&"[[Enumerable]]"in e&&"[[Configurable]]"in e&&(r.IsAccessorDescriptor(e)||r.IsDataDescriptor(e))};
"use strict";var _$fromPropertyDescriptor_45=function(e){if(void 0===e)return e;var i={};return"[[Value]]"in e&&(i.value=e["[[Value]]"]),"[[Writable]]"in e&&(i.writable=!!e["[[Writable]]"]),"[[Get]]"in e&&(i.get=e["[[Get]]"]),"[[Set]]"in e&&(i.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(i.enumerable=!!e["[[Enumerable]]"]),"[[Configurable]]"in e&&(i.configurable=!!e["[[Configurable]]"]),i};
"use strict";/* removed: var _$fromPropertyDescriptor_45=require("../helpers/fromPropertyDescriptor"); */;var _$FromPropertyDescriptor_16=function(r){if(void 0!==r&&!_$propertyDescriptor_51(r))throw new _$TypeError_59("Assertion failed: `Desc` must be a Property Descriptor");return _$fromPropertyDescriptor_45(r)};
"use strict";/* removed: var _$propertyDescriptor_51=require("../helpers/records/property-descriptor"); */;var _$IsDataDescriptor_22=function(r){if(void 0===r)return!1;if(!_$propertyDescriptor_51(r))throw new _$TypeError_59("Assertion failed: `Desc` must be a Property Descriptor");return!(!_$hasown_80(r,"[[Value]]")&&!_$hasown_80(r,"[[Writable]]"))};
"use strict";/* removed: var _$propertyDescriptor_51=require("../helpers/records/property-descriptor"); */;var _$IsGenericDescriptor_24=function(r){if(void 0===r)return!1;if(!_$propertyDescriptor_51(r))throw new _$TypeError_59("Assertion failed: `Desc` must be a Property Descriptor");return!_$IsAccessorDescriptor_19(r)&&!_$IsDataDescriptor_22(r)};
"use strict";/* removed: var _$Type_38=require("./Type"); */;var _$ValidateAndApplyPropertyDescriptor_39=function(e,r,t,i,o){var s,a,n=_$Type_38(e);if("Undefined"!==n&&"Object"!==n)throw new _$TypeError_59("Assertion failed: O must be undefined or an Object");if(!_$IsPropertyKey_25(r))throw new _$TypeError_59("Assertion failed: P must be a Property Key");if("boolean"!=typeof t)throw new _$TypeError_59("Assertion failed: extensible must be a Boolean");if(!_$propertyDescriptor_51(i))throw new _$TypeError_59("Assertion failed: Desc must be a Property Descriptor");if(void 0!==o&&!_$propertyDescriptor_51(o))throw new _$TypeError_59("Assertion failed: current must be a Property Descriptor, or undefined");if(void 0===o)return!!t&&("Undefined"===n||(_$IsAccessorDescriptor_19(i)?_$DefineOwnProperty_43(_$IsDataDescriptor_22,_$SameValue_29,_$FromPropertyDescriptor_16,e,r,i):_$DefineOwnProperty_43(_$IsDataDescriptor_22,_$SameValue_29,_$FromPropertyDescriptor_16,e,r,{"[[Configurable]]":!!i["[[Configurable]]"],"[[Enumerable]]":!!i["[[Enumerable]]"],"[[Value]]":i["[[Value]]"],"[[Writable]]":!!i["[[Writable]]"]})));if(!_$isFullyPopulatedPropertyDescriptor_47({IsAccessorDescriptor:_$IsAccessorDescriptor_19,IsDataDescriptor:_$IsDataDescriptor_22},o))throw new _$TypeError_59("`current`, when present, must be a fully populated and valid Property Descriptor");if(!o["[[Configurable]]"]){if("[[Configurable]]"in i&&i["[[Configurable]]"])return!1;if("[[Enumerable]]"in i&&!_$SameValue_29(i["[[Enumerable]]"],o["[[Enumerable]]"]))return!1;if(!_$IsGenericDescriptor_24(i)&&!_$SameValue_29(_$IsAccessorDescriptor_19(i),_$IsAccessorDescriptor_19(o)))return!1;if(_$IsAccessorDescriptor_19(o)){if("[[Get]]"in i&&!_$SameValue_29(i["[[Get]]"],o["[[Get]]"]))return!1;if("[[Set]]"in i&&!_$SameValue_29(i["[[Set]]"],o["[[Set]]"]))return!1}else if(!o["[[Writable]]"]){if("[[Writable]]"in i&&i["[[Writable]]"])return!1;if("[[Value]]"in i&&!_$SameValue_29(i["[[Value]]"],o["[[Value]]"]))return!1}}return"Undefined"===n||(_$IsDataDescriptor_22(o)&&_$IsAccessorDescriptor_19(i)?(s=("[[Configurable]]"in i?i:o)["[[Configurable]]"],a=("[[Enumerable]]"in i?i:o)["[[Enumerable]]"],_$DefineOwnProperty_43(_$IsDataDescriptor_22,_$SameValue_29,_$FromPropertyDescriptor_16,e,r,{"[[Configurable]]":!!s,"[[Enumerable]]":!!a,"[[Get]]":("[[Get]]"in i?i:o)["[[Get]]"],"[[Set]]":("[[Set]]"in i?i:o)["[[Set]]"]})):_$IsAccessorDescriptor_19(o)&&_$IsDataDescriptor_22(i)?(s=("[[Configurable]]"in i?i:o)["[[Configurable]]"],a=("[[Enumerable]]"in i?i:o)["[[Enumerable]]"],_$DefineOwnProperty_43(_$IsDataDescriptor_22,_$SameValue_29,_$FromPropertyDescriptor_16,e,r,{"[[Configurable]]":!!s,"[[Enumerable]]":!!a,"[[Value]]":("[[Value]]"in i?i:o)["[[Value]]"],"[[Writable]]":!!("[[Writable]]"in i?i:o)["[[Writable]]"]})):_$DefineOwnProperty_43(_$IsDataDescriptor_22,_$SameValue_29,_$FromPropertyDescriptor_16,e,r,i))};
"use strict";/* removed: var _$ValidateAndApplyPropertyDescriptor_39=require("./ValidateAndApplyPropertyDescriptor"); */;var _$OrdinaryDefineOwnProperty_27=function(r,e,o){if("Object"!==_$Type_38(r))throw new _$TypeError_59("Assertion failed: O must be an Object");if(!_$IsPropertyKey_25(e))throw new _$TypeError_59("Assertion failed: P must be a Property Key");if(!_$propertyDescriptor_51(o))throw new _$TypeError_59("Assertion failed: Desc must be a Property Descriptor");if(!_$$gOPD_73){if(_$IsAccessorDescriptor_19(o))throw new _$SyntaxError_58("This environment does not support accessor property descriptors.");var t=!(e in r)&&o["[[Writable]]"]&&o["[[Enumerable]]"]&&o["[[Configurable]]"]&&"[[Value]]"in o,i=e in r&&(!("[[Configurable]]"in o)||o["[[Configurable]]"])&&(!("[[Enumerable]]"in o)||o["[[Enumerable]]"])&&(!("[[Writable]]"in o)||o["[[Writable]]"])&&"[[Value]]"in o;if(t||i)return r[e]=o["[[Value]]"],_$SameValue_29(r[e],o["[[Value]]"]);throw new _$SyntaxError_58("This environment does not support defining non-writable, non-enumerable, or non-configurable properties")}var s=_$$gOPD_73(r,e),n=s&&_$ToPropertyDescriptor_36(s),p=_$IsExtensible_23(r);return _$ValidateAndApplyPropertyDescriptor_39(r,e,p,o,n)};
"use strict";/* removed: var _$Type_38=require("./Type"); */;var _$CreateDataProperty_15=function(e,r,t){if("Object"!==_$Type_38(e))throw new _$TypeError_59("Assertion failed: Type(O) is not Object");if(!_$IsPropertyKey_25(r))throw new _$TypeError_59("Assertion failed: IsPropertyKey(P) is not true");return _$OrdinaryDefineOwnProperty_27(e,r,{"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Value]]":t,"[[Writable]]":!0})};
"use strict";/* removed: var _$TypeError_59=require("es-errors/type"); */;var _$RequireObjectCoercible_61=function(r){if(null==r)throw new _$TypeError_59(arguments.length>0&&arguments[1]||"Cannot call method on "+r);return r};
"use strict";var _$Object_63=Object;
"use strict";/* removed: var _$RequireObjectCoercible_61=require("./RequireObjectCoercible"); */;var _$ToObject_62=function(e){return _$RequireObjectCoercible_61(e),_$Object_63(e)};
var toString={}.toString;var _$isarray_111=Array.isArray||function(r){return"[object Array]"==toString.call(r)};
"use strict";var __$concat_110=_$getIntrinsic_72("%Array.prototype.concat%"),$slice=_$callBound_9("Array.prototype.slice"),__hasSymbols_110=_$shams_78(),isConcatSpreadable=__hasSymbols_110&&Symbol.isConcatSpreadable,empty=[],$concatApply=isConcatSpreadable?_$callBind_10.apply(__$concat_110,empty):null,__isArray_110=isConcatSpreadable?_$isarray_111:null;var _$safeArrayConcat_110=isConcatSpreadable?function(a){for(var e=0;e<arguments.length;e+=1){var r=arguments[e];if(r&&"object"==typeof r&&"boolean"==typeof r[isConcatSpreadable]){empty[isConcatSpreadable]||(empty[isConcatSpreadable]=!0);var l=__isArray_110(r)?$slice(r):[r];l[isConcatSpreadable]=!0,arguments[e]=l}}return $concatApply(arguments)}:_$callBind_10(__$concat_110,empty);
"use strict";var _$RequireObjectCoercible_28=_$RequireObjectCoercible_61;
"use strict";var _$IsArray_20=_$IsArray_44;
"use strict";var __$apply_14=_$getIntrinsic_72("%Reflect.apply%",!0)||_$callBound_9("Function.prototype.apply");var _$Call_14=function(r,e){var t=arguments.length>2?arguments[2]:[];if(!_$IsArray_20(t))throw new _$TypeError_59("Assertion failed: optional `argumentsList`, if provided, must be a List");return __$apply_14(r,e,t)};
var _$empty_7 = {};
var _$t_96 = {};
(function (global){(function (){
var hasMap="function"==typeof Map&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize=hasMap&&mapSizeDescriptor&&"function"==typeof mapSizeDescriptor.get?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet="function"==typeof Set&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&"function"==typeof setSizeDescriptor.get?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,hasWeakMap="function"==typeof WeakMap&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet="function"==typeof WeakSet&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef="function"==typeof WeakRef&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf="function"==typeof BigInt?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,hasShammedSymbols="function"==typeof Symbol&&"object"==typeof Symbol.iterator,toStringTag="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||"symbol")?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function addNumericSeparator(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),a=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var inspectCustom=_$empty_7.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;function wrapQuotes(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function quote(t){return $replace.call(String(t),/"/g,""")}function isArray(t){return!("[object Array]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isDate(t){return!("[object Date]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isRegExp(t){return!("[object RegExp]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isError(t){return!("[object Error]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isString(t){return!("[object String]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isNumber(t){return!("[object Number]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isBoolean(t){return!("[object Boolean]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}_$t_96=function t(e,r,n,o){var a=r||{};if(has(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(a,"customInspect")||a.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=a.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return inspectString(e,a);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var c=String(e);return l?addNumericSeparator(e,c):c}if("bigint"==typeof e){var u=String(e)+"n";return l?addNumericSeparator(e,u):u}var p=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=p&&p>0&&"object"==typeof e)return isArray(e)?"[Array]":"[Object]";var f=getIndent(a,n);if(void 0===o)o=[];else if(indexOf(o,e)>=0)return"[Circular]";function s(e,r,i){if(r&&(o=$arrSlice.call(o)).push(r),i){var l={depth:a.depth};return has(a,"quoteStyle")&&(l.quoteStyle=a.quoteStyle),t(e,l,n+1,o)}return t(e,a,n+1,o)}if("function"==typeof e&&!isRegExp(e)){var y=nameOf(e),S=arrObjKeys(e,s);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(S.length>0?" { "+$join.call(S,", ")+" }":"")}if(isSymbol(e)){var g=hasShammedSymbols?$replace.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(e);return"object"!=typeof e||hasShammedSymbols?g:markBoxed(g)}if(isElement(e)){for(var b="<"+$toLowerCase.call(String(e.nodeName)),m=e.attributes||[],h=0;h<m.length;h++)b+=" "+m[h].name+"="+wrapQuotes(quote(m[h].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+$toLowerCase.call(String(e.nodeName))+">"}if(isArray(e)){if(0===e.length)return"[]";var d=arrObjKeys(e,s);return f&&!singleLineValues(d)?"["+indentedJoin(d,f)+"]":"[ "+$join.call(d,", ")+" ]"}if(isError(e)){var j=arrObjKeys(e,s);return"cause"in Error.prototype||!("cause"in e)||isEnumerable.call(e,"cause")?0===j.length?"["+String(e)+"]":"{ ["+String(e)+"] "+$join.call(j,", ")+" }":"{ ["+String(e)+"] "+$join.call($concat.call("[cause]: "+s(e.cause),j),", ")+" }"}if("object"==typeof e&&i){if(inspectSymbol&&"function"==typeof e[inspectSymbol]&&_$empty_7)return _$empty_7(e,{depth:p-n});if("symbol"!==i&&"function"==typeof e.inspect)return e.inspect()}if(isMap(e)){var O=[];return mapForEach&&mapForEach.call(e,(function(t,r){O.push(s(r,e,!0)+" => "+s(t,e))})),collectionOf("Map",mapSize.call(e),O,f)}if(isSet(e)){var w=[];return setForEach&&setForEach.call(e,(function(t){w.push(s(t,e))})),collectionOf("Set",setSize.call(e),w,f)}if(isWeakMap(e))return weakCollectionOf("WeakMap");if(isWeakSet(e))return weakCollectionOf("WeakSet");if(isWeakRef(e))return weakCollectionOf("WeakRef");if(isNumber(e))return markBoxed(s(Number(e)));if(isBigInt(e))return markBoxed(s(bigIntValueOf.call(e)));if(isBoolean(e))return markBoxed(booleanValueOf.call(e));if(isString(e))return markBoxed(s(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||"undefined"!=typeof global&&e===global)return"{ [object globalThis] }";if(!isDate(e)&&!isRegExp(e)){var $=arrObjKeys(e,s),k=gPO?gPO(e)===Object.prototype:e instanceof Object||e.constructor===Object,v=e instanceof Object?"":"null prototype",T=!k&&toStringTag&&Object(e)===e&&toStringTag in e?$slice.call(toStr(e),8,-1):v?"Object":"",E=(k||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(T||v?"["+$join.call($concat.call([],T||[],v||[]),": ")+"] ":"");return 0===$.length?E+"{}":f?E+"{"+indentedJoin($,f)+"}":E+"{ "+$join.call($,", ")+" }"}return String(e)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function isMap(t){if(!mapSize||!t||"object"!=typeof t)return!1;try{mapSize.call(t);try{setSize.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}function isWeakMap(t){if(!weakMapHas||!t||"object"!=typeof t)return!1;try{weakMapHas.call(t,weakMapHas);try{weakSetHas.call(t,weakSetHas)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}function isWeakRef(t){if(!weakRefDeref||!t||"object"!=typeof t)return!1;try{return weakRefDeref.call(t),!0}catch(t){}return!1}function isSet(t){if(!setSize||!t||"object"!=typeof t)return!1;try{setSize.call(t);try{mapSize.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}function isWeakSet(t){if(!weakSetHas||!t||"object"!=typeof t)return!1;try{weakSetHas.call(t,weakSetHas);try{weakMapHas.call(t,weakMapHas)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}function isElement(t){return!(!t||"object"!=typeof t)&&("undefined"!=typeof HTMLElement&&t instanceof HTMLElement||"string"==typeof t.nodeName&&"function"==typeof t.getAttribute)}function inspectString(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}return wrapQuotes($replace.call($replace.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e<t.length;e++)if(indexOf(t[e],"\n")>=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=has(t,o)?e(t[o],t):""}var a,i="function"==typeof gOPS?gOPS(t):[];if(hasShammedSymbols){a={};for(var l=0;l<i.length;l++)a["$"+i[l]]=i[l]}for(var c in t)has(t,c)&&(r&&String(Number(c))===c&&c<t.length||hasShammedSymbols&&a["$"+c]instanceof Symbol||($test.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if("function"==typeof gOPS)for(var u=0;u<i.length;u++)isEnumerable.call(t,i[u])&&n.push("["+e(i[u])+"]: "+e(t[i[u]],t));return n}
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
"use strict";/* removed: var _$Type_38=require("./Type"); */;var _$Get_17=function(e,r){if("Object"!==_$Type_38(e))throw new _$TypeError_59("Assertion failed: Type(O) is not Object");if(!_$IsPropertyKey_25(r))throw new _$TypeError_59("Assertion failed: IsPropertyKey(P) is not true, got "+_$t_96(r));return e[r]};
"use strict";/* removed: var _$Type_38=require("./Type"); */;var _$HasProperty_18=function(e,r){if("Object"!==_$Type_38(e))throw new _$TypeError_59("Assertion failed: `O` must be an Object");if(!_$IsPropertyKey_25(r))throw new _$TypeError_59("Assertion failed: `P` must be a Property Key");return r in e};
"use strict";var _$maxSafeInteger_50=Number.MAX_SAFE_INTEGER||9007199254740991;
"use strict";var _$isPrimitive_65=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t};
"use strict";var getDay=Date.prototype.getDay,tryDateObject=function(t){try{return getDay.call(t),!0}catch(t){return!1}},__toStr_84=Object.prototype.toString,dateClass="[object Date]",__hasToStringTag_84=_$shams_79();var _$isDateObject_84=function(t){return"object"==typeof t&&null!==t&&(__hasToStringTag_84?tryDateObject(t):__toStr_84.call(t)===dateClass)};
var _$isSymbol_88 = {};
"use strict";var __toStr_88=Object.prototype.toString,__hasSymbols_88=_$hasSymbols_77();if(__hasSymbols_88){var symToStr=Symbol.prototype.toString,symStringRegex=/^Symbol\(.*\)$/,__isSymbolObject_88=function(t){return"symbol"==typeof t.valueOf()&&symStringRegex.test(symToStr.call(t))};_$isSymbol_88=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==__toStr_88.call(t))return!1;try{return __isSymbolObject_88(t)}catch(t){return!1}}}else _$isSymbol_88=function(t){return!1};
"use strict";var __hasSymbols_64="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,ordinaryToPrimitive=function(r,e){if(null==r)throw new TypeError("Cannot call method on "+r);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var i,t,o,l="string"===e?["toString","valueOf"]:["valueOf","toString"];for(o=0;o<l.length;++o)if(i=r[l[o]],_$isCallable_83(i)&&(t=i.call(r),_$isPrimitive_65(t)))return t;throw new TypeError("No default value")},GetMethod=function(r,e){var i=r[e];if(null!=i){if(!_$isCallable_83(i))throw new TypeError(i+" returned for property "+e+" of object "+r+" is not a function");return i}};var _$es2015_64=function(r){if(_$isPrimitive_65(r))return r;var e,i="default";if(arguments.length>1&&(arguments[1]===String?i="string":arguments[1]===Number&&(i="number")),__hasSymbols_64&&(Symbol.toPrimitive?e=GetMethod(r,Symbol.toPrimitive):_$isSymbol_88(r)&&(e=Symbol.prototype.valueOf)),void 0!==e){var t=e.call(r,i);if(_$isPrimitive_65(t))return t;throw new TypeError("unable to convert exotic object to primitive")}return"default"===i&&(_$isDateObject_84(r)||_$isSymbol_88(r))&&(i="string"),ordinaryToPrimitive(r,"default"===i?"number":i)};
"use strict";/* removed: var _$es2015_64=require("es-to-primitive/es2015"); */;var _$ToPrimitive_35=function(i){return arguments.length>1?_$es2015_64(i,arguments[1]):_$es2015_64(i)};
"use strict";var __has_86,__$exec_86,isRegexMarker,badStringifier,__hasToStringTag_86=_$shams_79();if(__hasToStringTag_86){__has_86=_$callBound_9("Object.prototype.hasOwnProperty"),__$exec_86=_$callBound_9("RegExp.prototype.exec"),isRegexMarker={};var throwRegexMarker=function(){throw isRegexMarker};badStringifier={toString:throwRegexMarker,valueOf:throwRegexMarker},"symbol"==typeof Symbol.toPrimitive&&(badStringifier[Symbol.toPrimitive]=throwRegexMarker)}var __$toString_86=_$callBound_9("Object.prototype.toString"),__gOPD_86=Object.getOwnPropertyDescriptor,regexClass="[object RegExp]";var _$isRegex_86=__hasToStringTag_86?function(e){if(!e||"object"!=typeof e)return!1;var r=__gOPD_86(e,"lastIndex");if(!(r&&__has_86(r,"value")))return!1;try{__$exec_86(e,badStringifier)}catch(e){return e===isRegexMarker}}:function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&__$toString_86(e)===regexClass};
"use strict";var __$exec_112=_$callBound_9("RegExp.prototype.exec");var _$safeRegexTest_112=function(e){if(!_$isRegex_86(e))throw new _$TypeError_59("`regex` must be a RegExp");return function(r){return null!==__$exec_112(e,r)}};
"use strict";var $String=_$getIntrinsic_72("%String%");var _$ToString_37=function(r){if("symbol"==typeof r)throw new _$TypeError_59("Cannot convert a Symbol value to a string");return $String(r)};
"use strict";var __$replace_134=_$callBound_9("String.prototype.replace"),mvsIsWS=/^\s$/.test(""),leftWhitespace=mvsIsWS?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,rightWhitespace=mvsIsWS?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;var _$implementation_134=function(){var u=_$ToString_37(_$RequireObjectCoercible_61(this));return __$replace_134(__$replace_134(u,leftWhitespace,""),rightWhitespace,"")};
"use strict";var zeroWidthSpace="",mongolianVowelSeparator="";var _$polyfill_136=function(){return String.prototype.trim&&zeroWidthSpace.trim()===zeroWidthSpace&&mongolianVowelSeparator.trim()===mongolianVowelSeparator&&("_"+mongolianVowelSeparator).trim()==="_"+mongolianVowelSeparator&&(mongolianVowelSeparator+"_").trim()===mongolianVowelSeparator+"_"?String.prototype.trim:_$implementation_134};
"use strict";/* removed: var _$polyfill_136=require("./polyfill"); */;var _$shim_137=function(){var e=_$polyfill_136();return _$defineProperties_12(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e};
var _$stringPrototypeTrim_135 = {};
"use strict";var bound=_$callBind_10(_$polyfill_136()),boundMethod=function(e){return _$RequireObjectCoercible_61(e),bound(e)};_$defineProperties_12(boundMethod,{getPolyfill:_$polyfill_136,implementation:_$implementation_134,shim:_$shim_137}),_$stringPrototypeTrim_135=boundMethod;
"use strict";var $Number=_$getIntrinsic_72("%Number%"),$RegExp=_$getIntrinsic_72("%RegExp%"),$parseInteger=_$getIntrinsic_72("%parseInt%"),__$strSlice_30=_$callBound_9("String.prototype.slice"),isBinary=_$safeRegexTest_112(/^0b[01]+$/i),isOctal=_$safeRegexTest_112(/^0o[0-7]+$/i),isInvalidHexLiteral=_$safeRegexTest_112(/^[-+]0x[0-9a-f]+$/i),nonWS=["
","",""].join(""),nonWSregex=new $RegExp("["+nonWS+"]","g"),hasNonWS=_$safeRegexTest_112(nonWSregex);var _$e_30=function e(r){if("string"!=typeof r)throw new _$TypeError_59("Assertion failed: `argument` is not a String");if(isBinary(r))return $Number($parseInteger(__$strSlice_30(r,2),2));if(isOctal(r))return $Number($parseInteger(__$strSlice_30(r,2),8));if(hasNonWS(r)||isInvalidHexLiteral(r))return NaN;var i=_$stringPrototypeTrim_135(r);return i!==r?e(i):$Number(r)};
"use strict";var __$Number_34=_$getIntrinsic_72("%Number%");var _$ToNumber_34=function(r){var e=_$isPrimitive_49(r)?r:_$ToPrimitive_35(r,__$Number_34);if("symbol"==typeof e)throw new _$TypeError_59("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new _$TypeError_59("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?_$e_30(e):__$Number_34(e)};
"use strict";var __$floor_40=Math.floor;var _$floor_40=function(o){return"bigint"==typeof o?o:__$floor_40(o)};
"use strict";/* removed: var _$TypeError_59=require("es-errors/type"); */;var _$truncate_41=function(r){if("number"!=typeof r&&"bigint"!=typeof r)throw new _$TypeError_59("argument must be a Number or a BigInt");var e=r<0?-_$floor_40(-r):_$floor_40(r);return 0===e?0:e};
"use strict";/* removed: var _$isNaN_48=require("./isNaN"); */;var _$isFinite_46=function(e){return("number"==typeof e||"bigint"==typeof e)&&!_$isNaN_48(e)&&e!==1/0&&e!==-1/0};
"use strict";/* removed: var _$isFinite_46=require("../helpers/isFinite"); */;var _$ToIntegerOrInfinity_32=function(e){var r=_$ToNumber_34(e);return _$isNaN_48(r)||0===r?0:_$isFinite_46(r)?_$truncate_41(r):r};
"use strict";/* removed: var _$ToIntegerOrInfinity_32=require("./ToIntegerOrInfinity"); */;var _$ToLength_33=function(e){var r=_$ToIntegerOrInfinity_32(e);return r<=0?0:r>_$maxSafeInteger_50?_$maxSafeInteger_50:r};
"use strict";/* removed: var _$Type_38=require("./Type"); */;var _$LengthOfArrayLike_26=function(e){if("Object"!==_$Type_38(e))throw new _$TypeError_59("Assertion failed: `obj` must be an Object");return _$ToLength_33(_$Get_17(e,"length"))};
"use strict";var strValue=String.prototype.valueOf,tryStringObject=function(t){try{return strValue.call(t),!0}catch(t){return!1}},__toStr_87=Object.prototype.toString,strClass="[object String]",__hasToStringTag_87=_$shams_79();var _$isString_87=function(t){return"string"==typeof t||"object"==typeof t&&(__hasToStringTag_87?tryStringObject(t):__toStr_87.call(t)===strClass)};
"use strict";var boxedString=_$Object_63("a"),splitString="a"!==boxedString[0]||!(0 in boxedString),strSplit=_$callBound_9("%String.prototype.split%");var _$implementation_2=function(r){var e=_$ToObject_62(this),t=splitString&&_$isString_87(e)?strSplit(e,""):e,i=_$LengthOfArrayLike_26(t);if(!_$IsCallable_21(r))throw new _$TypeError_59("Array.prototype.reduce callback must be a function");if(0===i&&arguments.length<2)throw new _$TypeError_59("reduce of empty array with no initial value");var a,o,s,l=0;if(arguments.length>1)a=arguments[1];else{for(s=!1;!s&&l<i;)o=_$ToString_37(l),(s=_$HasProperty_18(e,o))&&(a=_$Get_17(e,o)),l+=1;if(!s)throw new _$TypeError_59("reduce of empty array with no initial value")}for(;l<i;){if(o=_$ToString_37(l),s=_$HasProperty_18(e,o)){var n=_$Get_17(e,o);a=_$Call_14(r,void 0,[a,n,l,e])}l+=1}return a};
var _$esArrayMethodBoxesProperly_52=function(t){var n=!0,c=!0,o=!1;if("function"==typeof t){try{t.call("f",(function(t,c,o){"object"!=typeof o&&(n=!1)})),t.call([null],(function(){"use strict";c="string"==typeof this}),"x")}catch(t){o=!0}return!o&&n&&c}return!1};
"use strict";/* removed: var _$implementation_2=require("./implementation"); */;var _$polyfill_4=function(){var e=Array.prototype.reduce;return _$esArrayMethodBoxesProperly_52(e)?e:_$implementation_2};
"use strict";/* removed: var _$polyfill_4=require("./polyfill"); */;var _$shim_5=function(){var e=_$polyfill_4();return _$defineProperties_12(Array.prototype,{reduce:e},{reduce:function(){return Array.prototype.reduce!==e}}),e};
var _$arrayPrototypeReduce_3 = {};
"use strict";var polyfill=_$callBind_10.apply(_$polyfill_4()),__$slice_3=_$callBound_9("%Array.prototype.slice%"),boundShim=function(e,i){return _$RequireObjectCoercible_28(e),polyfill(e,__$slice_3(arguments,1))};_$defineProperties_12(boundShim,{getPolyfill:_$polyfill_4,implementation:_$implementation_2,shim:_$shim_5}),_$arrayPrototypeReduce_3=boundShim;
"use strict";var $getOwnNames=_$Object_63.getOwnPropertyNames,$getSymbols=_$Object_63.getOwnPropertySymbols,getAll=$getSymbols?function(e){return _$safeArrayConcat_110($getOwnNames(e),$getSymbols(e))}:$getOwnNames,isES5=_$$gOPD_73&&"function"==typeof $getOwnNames;var _$implementation_100=function(e){if(_$RequireObjectCoercible_61(e),!isES5)throw new TypeError("getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor");var r=_$ToObject_62(e);return _$arrayPrototypeReduce_3(getAll(r),(function(e,t){var o=_$$gOPD_73(r,t);return void 0!==o&&_$CreateDataProperty_15(e,t,o),e}),{})};
"use strict";/* removed: var _$implementation_100=require("./implementation"); */;var _$polyfill_102=function(){return"function"==typeof Object.getOwnPropertyDescriptors?Object.getOwnPropertyDescriptors:_$implementation_100};
"use strict";/* removed: var _$defineProperties_12=require("define-properties"); */;var _$shim_103=function(){var e=_$polyfill_102();return _$defineProperties_12(Object,{getOwnPropertyDescriptors:e},{getOwnPropertyDescriptors:function(){return Object.getOwnPropertyDescriptors!==e}}),e};
var _$objectGetownpropertydescriptors_101 = {};
"use strict";var __bound_101=_$callBind_10(_$polyfill_102(),Object);_$defineProperties_12(__bound_101,{getPolyfill:_$polyfill_102,implementation:_$implementation_100,shim:_$shim_103}),_$objectGetownpropertydescriptors_101=__bound_101;
var _$implementation_140 = {};
"use strict";var __isES5_140="function"==typeof Object.defineProperty,gPO=Object.getPrototypeOf,sPO=Object.setPrototypeOf,__hasProto_140=_$hasProto_76()||"function"==typeof gPO&&gPO([])===Array.prototype;if(!__isES5_140||!__hasProto_140)throw new TypeError("util.promisify requires a true ES5+ environment, that also supports `__proto__` and/or `Object.getPrototypeOf`");/* removed: var _$objectGetownpropertydescriptors_101=require("object.getownpropertydescriptors"); */;if("function"!=typeof Promise)throw new TypeError("`Promise` must be globally available for util.promisify to work.");var oDP=Object.defineProperty,$Promise=Promise,__$TypeError_140=TypeError,__$slice_140=_$callBound_9("Array.prototype.slice"),__hasSymbols_140=_$shams_78(),kCustomPromisifiedSymbol=__hasSymbols_140?Symbol.for("nodejs.util.promisify.custom"):null,kCustomPromisifyArgsSymbol=__hasSymbols_140?Symbol("customPromisifyArgs"):null;_$implementation_140=function(o){if("function"!=typeof o){var r=new __$TypeError_140('The "original" argument must be of type function');throw r.code="ERR_INVALID_ARG_TYPE",r.toString=function(){return this.name+"["+this.code+"]: "+this.message},r}if(__hasSymbols_140&&o[kCustomPromisifiedSymbol]){var e=o[kCustomPromisifiedSymbol];if("function"!=typeof e){var t=__$TypeError_140("The [util.promisify.custom] property must be of type function.");throw t.code="ERR_INVALID_ARG_TYPE",t.toString=function(){return this.name+"["+this.code+"]: "+this.message},t}return oDP(e,kCustomPromisifiedSymbol,{configurable:!0,enumerable:!1,value:e,writable:!1}),e}var i=o[kCustomPromisifyArgsSymbol],s=function(){var r=__$slice_140(arguments),e=this;return new $Promise((function(t,s){o.apply(e,_$safeArrayConcat_110(r,(function(o){var r=arguments.length>1?__$slice_140(arguments,1):[];if(o)s(o);else if(void 0!==i&&r.length>1){var e={};_$forEach_68(i,(function(o,t){e[o]=r[t]})),t(e)}else t(r[0])})))}))};"function"==typeof sPO&&"function"==typeof gPO?sPO(s,gPO(o)):s.__proto__=o.__proto__,oDP(s,kCustomPromisifiedSymbol,{configurable:!0,enumerable:!1,value:s,writable:!1});var n=_$objectGetownpropertydescriptors_101(o);return _$forEach_68(n,(function(o,r){try{oDP(s,o,r)}catch(o){}})),s},_$implementation_140.custom=kCustomPromisifiedSymbol,_$implementation_140.customPromisifyArgs=kCustomPromisifyArgsSymbol;
"use strict";/* removed: var _$implementation_140=require("./implementation"); */;var _$polyfill_141=function(){return"function"==typeof _$util_145.promisify&&_$util_145.promisify.custom===_$implementation_140.custom?_$util_145.promisify:_$implementation_140};
"use strict";/* removed: var _$polyfill_141=require("./polyfill"); */;var _$shim_142=function(){var e=_$polyfill_141();return e!==_$util_145.promisify&&Object.defineProperty(_$util_145,"promisify",{configurable:!0,enumerable:!0,value:e,writable:!0}),e};
var _$events_66 = {};
"use strict";var ReflectOwnKeys,R="object"==typeof Reflect?Reflect:null,ReflectApply=R&&"function"==typeof R.apply?R.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}ReflectOwnKeys=R&&"function"==typeof R.ownKeys?R.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var NumberIsNaN=Number.isNaN||function(e){return e!=e};function EventEmitter(){EventEmitter.init.call(this)}_$events_66=EventEmitter,_$events_66.once=once,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function _getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function _addListener(e,t,n,r){var i,o,s;if(checkListener(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=_getMaxListeners(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,ProcessEmitWarning(u)}return e}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=onceWrapper.bind(r);return i.listener=n,r.wrapFn=i,i}function _listeners(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?unwrapListeners(i):arrayClone(i,i.length)}function listenerCount(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function arrayClone(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function once(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}eventTargetAgnosticAddListener(e,t,o,{once:!0}),"error"!==t&&addErrorHandlerIfEventEmitter(e,i,{once:!0})}))}function addErrorHandlerIfEventEmitter(e,t,n){"function"==typeof e.on&&eventTargetAgnosticAddListener(e,"error",t,n)}function eventTargetAgnosticAddListener(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(e){if("number"!=typeof e||e<0||NumberIsNaN(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");defaultMaxListeners=e}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||NumberIsNaN(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},EventEmitter.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)ReflectApply(u,this,t);else{var f=u.length,v=arrayClone(u,f);for(n=0;n<f;++n)ReflectApply(v[n],this,t)}return!0},EventEmitter.prototype.addListener=function(e,t){return _addListener(this,e,t,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(e,t){return _addListener(this,e,t,!0)},EventEmitter.prototype.once=function(e,t){return checkListener(t),this.on(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.prependOnceListener=function(e,t){return checkListener(t),this.prependListener(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.removeListener=function(e,t){var n,r,i,o,s;if(checkListener(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():spliceOne(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},EventEmitter.prototype.listeners=function(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};
var _$gateExecutorMin_71 = { exports: {} };
(function (global){(function (){
!function(t){"object"==typeof _$gateExecutorMin_71.exports&&"undefined"!="object"?_$gateExecutorMin_71.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).GateExecutor=t()}((function(){var t,e,n,r,i=(t=function(t,e){(function(t,n){(function(){var r=o.nextTick,i=(Function.prototype.apply,Array.prototype.slice),l={},u=0;function c(t,e){this._id=t,this._clearFn=e}c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},e.setImmediate="function"==typeof t?t:function(t){var n=u++,o=!(arguments.length<2)&&i.call(arguments,1);return l[n]=!0,r((function(){l[n]&&(o?t.apply(null,o):t.call(null),e.clearImmediate(n))})),n},e.clearImmediate="function"==typeof n?n:function(t){delete l[t]}}).call(this)}).call(this,i({}).setImmediate,i({}).clearImmediate)},function(n){return e||t(e={exports:{},parent:n},e.exports),e.exports}),o={},l=o={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===u||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:u}catch(t){n=u}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(t){r=c}}();var s,f=[],h=!1,d=-1;function p(){h&&s&&(h=!1,s.length?f=s.concat(f):d=-1,f.length&&m())}function m(){if(!h){var t=a(p);h=!0;for(var e=f.length;e;){for(s=f,f=[];++d<e;)s&&s[d].run();d=-1,e=f.length}s=null,h=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function y(){}l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new g(t,e)),1!==f.length||h||a(m)},g.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=y,l.addListener=y,l.once=y,l.off=y,l.removeListener=y,l.removeAllListeners=y,l.emit=y,l.prependListener=y,l.prependOnceListener=y,l.listeners=function(t){return[]},l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0};var w={};return function(t){(function(){"use strict";function e(e){return(e=e||{}).interval=null==e.interval?111:e.interval,e.timeout=null==e.timeout?2222:e.timeout,function e(n,r){let i={};i.id=++r,i.options=n;let o=[],l={lookup:{},history:[]},u=[],c={work_counter:0,gate:!1,running:!1,clear:null,firstclear:null,tm_in:null,hw_tmc:0,hw_hst:0};function a(){if(!c.running)return;i.isclear()||c.tm_in||(c.tm_in=setInterval(f,n.interval));let t=!1;do{t=!1;let e=null;c.gate||(e=o.shift()),e&&(l.lookup[e.id]=e,l.history.push(e),c.hw_hst=l.history.length>c.hw_hst?l.history.length:c.hw_hst,c.gate=e.gate,e.start=Date.now(),e.callback=s(e),u.push(e),c.hw_tmc=u.length>c.hw_tmc?u.length:c.hw_tmc,e.fn(e.callback),t=!0)}while(t)}function s(e){return function(){if(!e.done){for(e.end=Date.now(),e.done=!0,delete l.lookup[e.id];l.history[0]&&l.history[0].done;)l.history.shift();for(;u[0]&&u[0].done;)u.shift();if(e.gate&&(c.gate=!1),0===o.length&&0===l.history.length){if(clearInterval(c.tm_in),c.tm_in=null,c.firstclear){let t=c.firstclear;c.firstclear=null,t()}c.clear&&c.clear()}t(a)}}}function f(){let t=Date.now(),e=null;for(let n=0;n<u.length;++n)!(e=u[n]).gate&&!e.done&&e.tm<t-e.start&&(e.ontm&&e.ontm(e.tm,e.start,t),e.callback())}return i.start=function(e){return t((function(){c.running=!0,e&&(c.firstclear=e),a()})),i},i.pause=function(){c.running=!1},i.clear=function(t){return c.clear=t,i},i.isclear=function(){return 0===o.length&&0===l.history.length},i.add=function(e){return c.work_counter+=1,e.id=e.id||""+c.work_counter,e.ge=i.id,e.tm=null==e.tm?n.timeout:e.tm,e.dn=e.dn||e.fn.name||""+Date.now(),e.ctxt={},o.push(e),c.running&&t(a),i},i.gate=function(){let t=e(n,r);return i.add({gate:t,fn:function(e){t.start(e)}}),t},i.state=function(){let t=[];for(let e=0;e<l.history.length;++e){let n=l.history[e];n.done||t.push({s:"a",ge:n.ge,dn:n.dn,id:n.id})}for(let e=0;e<o.length;++e){let n=o[e];n.gate?t.push(n.gate.state()):t.push({s:"w",ge:n.ge,dn:n.dn,id:n.id})}return t.internal={qlen:o.length,hlen:l.history.length,klen:Object.keys(l.lookup).length,tlen:f.length,hw_hst:c.hw_hst,hw_tmc:c.hw_tmc},t},i}(e,0)}Object.defineProperty(w,"__esModule",{value:!0}),w.default=e,null!=typeof w&&(w=e)}).call(this)}.call(this,i({}).setImmediate),w}));
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$gateExecutorMin_71 = _$gateExecutorMin_71.exports
var _$jsonicMin_1 = { exports: {} };
(function (global){(function (){
!function(e){"object"==typeof _$jsonicMin_1.exports&&"undefined"!="object"?_$jsonicMin_1.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Jsonic=e()}((function(){var e=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},t=e((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.modlist=t.findTokenSet=t.values=t.keys=t.omap=t.str=t.prop=t.parserwrap=t.trimstk=t.tokenize=t.srcfmt=t.snip=t.regexp=t.mesc=t.makelog=t.isarr=t.filterRules=t.extract=t.escre=t.errinject=t.errdesc=t.entries=t.defprop=t.deep=t.configure=t.clone=t.clean=t.charset=t.badlex=t.assign=t.S=t.JsonicError=void 0;const l=n({}),i=e=>null==e?[]:Object.keys(e);t.keys=i;const s=e=>null==e?[]:Object.values(e);t.values=s;const o=e=>null==e?[]:Object.entries(e);t.entries=o;const a=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=a,t.isarr=e=>Array.isArray(e);const c=Object.defineProperty;t.defprop=c;const u=(e,t)=>Object.entries(e||{}).reduce(((e,n)=>{let r=t?t(n):n;void 0===r[0]?delete e[n[0]]:e[r[0]]=r[1];let l=2;for(;void 0!==r[l];)e[r[l]]=r[l+1],l+=2;return e}),{});t.omap=u;const d={indent:". ",logindent:" ",space:" ",gap:" ",Object:"Object",Array:"Array",object:"object",string:"string",function:"function",unexpected:"unexpected",map:"map",list:"list",elem:"elem",pair:"pair",val:"val",node:"node",no_re_flags:r.EMPTY,unprintable:"unprintable",invalid_ascii:"invalid_ascii",invalid_unicode:"invalid_unicode",invalid_lex_state:"invalid_lex_state",unterminated_string:"unterminated_string",unterminated_comment:"unterminated_comment",lex:"lex",parse:"parse",error:"error",none:"none",imp_map:"imp,map",imp_list:"imp,list",imp_null:"imp,null",end:"end",open:"open",close:"close",rule:"rule",stack:"stack",nUll:"null",name:"name",make:"make",colon:":"};t.S=d;class p extends SyntaxError{constructor(e,t,n,r,l){let i=x(e,t=g({},t),n,r,l);super(i.message),a(this,i),v(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function m(e,t,n){let l=t.t,i=l[e];return null==i&&r.STRING===typeof e&&(i=t.tI++,l[i]=e,l[e]=i,l[e.substring(1)]=i,null!=n&&a(n.token,t.t)),i}function h(e,...t){return new RegExp(t.map((e=>e.esc?f(e.toString()):e)).join(r.EMPTY),null==e?"":e)}function f(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function g(e,...t){let n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n);for(let l of t){let t,i=d.function===typeof l,s=null!=l&&(d.object===typeof l||i);if(r&&s&&!i&&Array.isArray(e)===Array.isArray(l))for(let t in l)e[t]=g(e[t],l[t]);else e=void 0===l?e:i?l:s?d.function===typeof(t=l.constructor)&&d.Object!==t.name&&d.Array!==t.name?l:g(Array.isArray(l)?[]:{},l):l,n=d.function===typeof e,r=null!=e&&(d.object===typeof e||n)}return e}function k(e,t,n,r,l,i){let s={code:t,details:n,token:r,rule:l,ctx:i};return null==e?"":e.replace(/\$(\{?)([\w_0-9]+)(\}?)/g,((e,t,o,a)=>{let c=null!=s[o]?s[o]:null!=n[o]?n[o]:i.meta&&null!=i.meta[o]?i.meta[o]:null!=r[o]?r[o]:null!=l[o]?l[o]:null!=i.opts[o]?i.opts[o]:null!=i.cfg[o]?i.cfg[o]:null!=i[o]?i[o]:"$"+o,u=t&&a?c:JSON.stringify(c);return u=null==u?"":u,u.replace(/\n/g,"\n ")}))}function v(e){e.stack&&(e.stack=e.stack.split("\n").filter((e=>!e.includes("jsonic/jsonic"))).map((e=>e.replace(/ at /,"at "))).join("\n"))}function b(e,t,n){let l=0<n.sI?n.sI:0,i=0<n.rI?n.rI:1,s=0<n.cI?n.cI:1,o=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,l-333),l).split("\n"),c=e.substring(l,l+333).split("\n"),u=2+(r.EMPTY+(i+2)).length,d=i<3?1:i-2,p=e=>"[34m"+(r.EMPTY+d++).padStart(u," ")+" | [0m"+(null==e?r.EMPTY:e),m=a.length;return[2<m?p(a[m-3]):null,1<m?p(a[m-2]):null,p(a[m-1]+c[0])," ".repeat(u)+" "+" ".repeat(s-1)+"[31m"+"^".repeat(o.length||1)+" "+t+"[0m",p(c[1]),p(c[2])].filter((e=>null!=e)).join("\n")}function x(e,t,n,r,l){var i,s,o;try{let a=l.cfg,c=l.meta,u=k(a.error[e]||(null===(i=null==t?void 0:t.use)||void 0===i?void 0:i.err)&&(t.use.err.code||t.use.err.message)||a.error.unknown,e,t,n,r,l);d.function===typeof a.hint&&(a.hint={...a.hint(),...a.hint});let p=["[31m[jsonic/"+e+"]:[0m "+u," [34m--\x3e[0m "+(c&&c.fileName||"<no-file>")+":"+n.rI+":"+n.cI,b(l.src(),u,n),"",k((a.hint[e]||(null===(o=null===(s=t.use)||void 0===s?void 0:s.err)||void 0===o?void 0:o.message)||a.hint.unknown||"").trim().split("\n").map((e=>" "+e)).join("\n"),e,t,n,r,l),""," [2mhttps://jsonic.senecajs.org[0m"," [2m--internal: rule="+r.name+"~"+r.state+"; token="+m(n.tin,l.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+l.plgn().map((e=>e.name)).join(",")+"--[0m\n"].join("\n"),h={internal:{token:n,ctx:l}};return h={...Object.create(h),message:p,code:e,details:t,meta:c,fileName:c?c.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI},h}catch(e){return console.log(e),{}}}function y(e){return"function"==typeof e.debug.print.src?e.debug.print.src:t=>{let n=null==t?r.EMPTY:Array.isArray(t)?JSON.stringify(t).replace(/]$/,o(t).filter((e=>isNaN(e[0]))).map(((e,t)=>(0===t?", ":"")+e[0]+": "+JSON.stringify(e[1])))+"]"):JSON.stringify(t);return n=n.substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY),n}}function S(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(t){n=""+e}return j(t<n.length?n.substring(0,t-3)+"...":n,t)}function j(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function E(...e){return null==e?{}:e.filter((e=>!1!==e)).map((e=>"object"==typeof e?i(e).join(r.EMPTY):e)).join(r.EMPTY).split(r.EMPTY).reduce(((e,t)=>(e[t]=t.charCodeAt(0),e)),{})}function O(e){for(let t in e)null==e[t]&&delete e[t];return e}t.JsonicError=p,t.configure=function(e,t,n){var r,l,c,d,p,g,k,v,b,x,y,S,j,I,T,M,N,P,C,w,R,_,A,L,Y,$,F,U,J,B,K,V,D,z,G,Z,W,q,H,X,Q,ee,te,ne,re,le,ie,se,oe,ae;const ce=t||{};ce.t=ce.t||{},ce.tI=ce.tI||1;const ue=e=>m(e,ce);!1!==n.standard$&&(ue("#BD"),ue("#ZZ"),ue("#UK"),ue("#AA"),ue("#SP"),ue("#LN"),ue("#CM"),ue("#NR"),ue("#ST"),ue("#TX"),ue("#VL")),ce.safe={key:!1!==(null===(r=n.safe)||void 0===r?void 0:r.key)},ce.fixed={lex:!!(null===(l=n.fixed)||void 0===l?void 0:l.lex),token:n.fixed?u(O(n.fixed.token),(([e,t])=>[t,m(e,ce)])):{},ref:void 0,check:null===(c=n.fixed)||void 0===c?void 0:c.check},ce.fixed.ref=u(ce.fixed.token,(([e,t])=>[e,t])),ce.fixed.ref=Object.assign(ce.fixed.ref,u(ce.fixed.ref,(([e,t])=>[t,e]))),ce.match={lex:!!(null===(d=n.match)||void 0===d?void 0:d.lex),value:n.match?u(O(n.match.value),(([e,t])=>[e,t])):{},token:n.match?u(O(n.match.token),(([e,t])=>[m(e,ce),t])):{},check:null===(p=n.match)||void 0===p?void 0:p.check},u(ce.match.token,(([e,t])=>[e,(t.tin$=+e,t)]));const de=n.tokenSet?Object.keys(n.tokenSet).reduce(((e,t)=>(e[t]=n.tokenSet[t].filter((e=>null!=e)).map((e=>ue(e))),e)),{}):{};ce.tokenSet=ce.tokenSet||{},o(de).map((e=>{let t=e[0],n=e[1];ce.tokenSet[t]?(ce.tokenSet[t].length=0,ce.tokenSet[t].push(...n)):ce.tokenSet[t]=n})),ce.tokenSetTins=o(ce.tokenSet).reduce(((e,t)=>(e[t[0]]=e[t[0]]||{},t[1].map((n=>e[t[0]][n]=!0)),e)),{}),ce.tokenSetTins.IGNORE=ce.tokenSetTins.IGNORE||{},ce.space={lex:!!(null===(g=n.space)||void 0===g?void 0:g.lex),chars:E(null===(k=n.space)||void 0===k?void 0:k.chars),check:null===(v=n.space)||void 0===v?void 0:v.check},ce.line={lex:!!(null===(b=n.line)||void 0===b?void 0:b.lex),chars:E(null===(x=n.line)||void 0===x?void 0:x.chars),rowChars:E(null===(y=n.line)||void 0===y?void 0:y.rowChars),single:!!(null===(S=n.line)||void 0===S?void 0:S.single),check:null===(j=n.line)||void 0===j?void 0:j.check},ce.text={lex:!!(null===(I=n.text)||void 0===I?void 0:I.lex),modify:((null===(T=ce.text)||void 0===T?void 0:T.modify)||[]).concat(([null===(M=n.text)||void 0===M?void 0:M.modify]||[]).flat()).filter((e=>null!=e)),check:null===(N=n.text)||void 0===N?void 0:N.check},ce.number={lex:!!(null===(P=n.number)||void 0===P?void 0:P.lex),hex:!!(null===(C=n.number)||void 0===C?void 0:C.hex),oct:!!(null===(w=n.number)||void 0===w?void 0:w.oct),bin:!!(null===(R=n.number)||void 0===R?void 0:R.bin),sep:null!=(null===(_=n.number)||void 0===_?void 0:_.sep)&&""!==n.number.sep,exclude:null===(A=n.number)||void 0===A?void 0:A.exclude,sepChar:null===(L=n.number)||void 0===L?void 0:L.sep,check:null===(Y=n.number)||void 0===Y?void 0:Y.check},ce.value={lex:!!(null===($=n.value)||void 0===$?void 0:$.lex),def:o((null===(F=n.value)||void 0===F?void 0:F.def)||{}).reduce(((e,t)=>(null==t[1]||!1===t[1]||t[1].match||(e[t[0]]=t[1]),e)),{}),defre:o((null===(U=n.value)||void 0===U?void 0:U.def)||{}).reduce(((e,t)=>(t[1]&&t[1].match&&(e[t[0]]=t[1],e[t[0]].consume=!!e[t[0]].consume),e)),{})},ce.rule={start:null==(null===(J=n.rule)||void 0===J?void 0:J.start)?"val":n.rule.start,maxmul:null==(null===(B=n.rule)||void 0===B?void 0:B.maxmul)?3:n.rule.maxmul,finish:!!(null===(K=n.rule)||void 0===K?void 0:K.finish),include:(null===(V=n.rule)||void 0===V?void 0:V.include)?n.rule.include.split(/\s*,+\s*/).filter((e=>""!==e)):[],exclude:(null===(D=n.rule)||void 0===D?void 0:D.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter((e=>""!==e)):[]},ce.map={extend:!!(null===(z=n.map)||void 0===z?void 0:z.extend),merge:null===(G=n.map)||void 0===G?void 0:G.merge},ce.list={property:!!(null===(Z=n.list)||void 0===Z?void 0:Z.property)};let pe=Object.keys(ce.fixed.token).sort(((e,t)=>t.length-e.length)).map((e=>f(e))).join("|"),me=(null===(W=n.comment)||void 0===W?void 0:W.lex)?(n.comment.def?s(n.comment.def):[]).filter((e=>e&&e.lex)).map((e=>f(e.start))).join("|"):"",he=["([",f(i(E(ce.space.lex&&ce.space.chars,ce.line.lex&&ce.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map((e=>"|"+f(e))).join(""),""===pe?"":"|",pe,""===me?"":"|",me,"|$)"];return ce.rePart={fixed:pe,ender:he,commentStart:me},ce.re={ender:h(null,...he),rowChars:h(null,f(null===(q=n.line)||void 0===q?void 0:q.rowChars)),columns:h(null,"["+f(null===(H=n.line)||void 0===H?void 0:H.chars)+"]","(.*)$")},ce.lex={empty:!!(null===(X=n.lex)||void 0===X?void 0:X.empty),emptyResult:null===(Q=n.lex)||void 0===Q?void 0:Q.emptyResult,match:(null===(ee=n.lex)||void 0===ee?void 0:ee.match)?o(n.lex.match).reduce(((e,t)=>{let r=t[0],l=t[1];if(l){let t=l.make(ce,n);t&&(t.matcher=r,t.make=l.make,t.order=l.order),e.push(t)}return e}),[]).filter((e=>null!=e&&!1!==e&&-1<+e.order)).sort(((e,t)=>e.order-t.order)):[]},ce.parse={prepare:s(null===(te=n.parse)||void 0===te?void 0:te.prepare)},ce.debug={get_console:(null===(ne=n.debug)||void 0===ne?void 0:ne.get_console)||(()=>console),maxlen:null==(null===(re=n.debug)||void 0===re?void 0:re.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(ie=null===(le=n.debug)||void 0===le?void 0:le.print)||void 0===ie?void 0:ie.config),src:null===(oe=null===(se=n.debug)||void 0===se?void 0:se.print)||void 0===oe?void 0:oe.src}},ce.error=n.error||{},ce.hint=n.hint||{},(null===(ae=n.config)||void 0===ae?void 0:ae.modify)&&i(n.config.modify).forEach((e=>n.config.modify[e](ce,n))),ce.debug.print.config&&ce.debug.get_console().dir(ce,{depth:null}),ce.result={fail:[]},n.result&&(ce.result.fail=[...n.result.fail]),a(e.options,n),a(e.token,ce.t),a(e.tokenSet,ce.tokenSet),a(e.fixed,ce.fixed.ref),ce},t.tokenize=m,t.findTokenSet=function(e,t){return t.tokenSet[e]},t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=h,t.escre=f,t.deep=g,t.errinject=k,t.trimstk=v,t.extract=b,t.errdesc=x,t.badlex=function(e,t,n){let r=e.next.bind(e);return e.next=(e,l,i,s)=>{let o=r(e,l,i,s);if(t===o.tin){let t={};throw null!=o.use&&(t.use=o.use),new p(o.why||d.unexpected,t,o,e,n)}return o},e},t.makelog=function(e,t){var n,r,l;let i=null===(l=null===(r=null===(n=e.opts)||void 0===n?void 0:n.plugin)||void 0===r?void 0:r.debug)||void 0===l?void 0:l.trace;if(t||i)if("number"==typeof(null==t?void 0:t.log)||i){let n=!1,r=null==t?void 0:t.log;(-1===r||i)&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter((e=>d.object!=typeof e)).map((e=>d.function==typeof e?e.name:e)).join(d.gap);e.cfg.debug.get_console().log(n)}else e.cfg.debug.get_console().dir(t,{depth:r})}}else"function"==typeof t.log&&(e.log=t.log);return e.log},t.srcfmt=y,t.str=S,t.snip=j,t.clone=function(e){return g(Object.create(Object.getPrototypeOf(e)),e)},t.charset=E,t.clean=O,t.filterRules=function(e,t){let n=["open","close"];for(let r of n)e.def[r]=e.def[r].map((e=>(e.g="string"==typeof e.g?(e.g||"").split(/\s*,+\s*/):e.g||[],e))).filter((e=>t.rule.include.reduce(((t,n)=>t||null!=e.g&&-1!==e.g.indexOf(n)),0===t.rule.include.length))).filter((e=>t.rule.exclude.reduce(((t,n)=>t&&(null==e.g||-1===e.g.indexOf(n))),!0)));return e},t.prop=function(e,t,n){let r=e;try{let r,l=t.split(".");for(let t=0;t<l.length;t++)r=l[t],t<l.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(e){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+S(r)+(void 0===n?"":" to value: "+S(n,22)))}},t.modlist=function(e,t){if(t&&e){if(0<e.length){if(t.delete&&0<t.delete.length)for(let n=0;n<t.delete.length;n++){let r=t.delete[n];(r<0?-1*r<=e.length:r<e.length)&&(e[(e.length+r)%e.length]=null)}if(t.move)for(let n=0;n<t.move.length;n+=2){let r=(e.length+t.move[n])%e.length,l=(e.length+t.move[n+1])%e.length,i=e[r];e.splice(r,1),e.splice(l,0,i)}let n=e.filter((e=>null!=e));n.length!==e.length&&(e.length=0,e.push(...n))}if(t.custom){let n=t.custom(e);null!=n&&(e=n)}}return e},t.parserwrap=function(e){return{start:function(t,n,i,s){try{return e.start(t,n,i,s)}catch(e){if("SyntaxError"===e.name){let s=0,o=0,a=0,c=r.EMPTY,u=e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(u){c=u[1],s=parseInt(u[2]),o=t.substring(0,s).replace(/[^\n]/g,r.EMPTY).length;let e=s-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;a=Math.max(t.substring(e,s).length,0)}let d=e.token||(0,l.makeToken)("#UK",m("#UK",n.internal().config),void 0,c,(0,l.makePoint)(c.length,s,e.lineNumber||o,e.columnNumber||a));throw new p(e.code||"json",e.details||{msg:e.message},d,{},e.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:d,meta:i,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,inst:()=>n,rule:{name:"no-rule"},sub:{},xs:-1,v2:d,v1:d,t0:d,t1:d,tC:-1,kI:-1,rs:[],rsI:0,rsm:{},n:{},log:i?i.log:void 0,F:y(n.internal().config),u:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw e}}}}})),n=e((function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeTextMatcher=n.makeNumberMatcher=n.makeCommentMatcher=n.makeStringMatcher=n.makeLineMatcher=n.makeSpaceMatcher=n.makeFixedMatcher=n.makeMatchMatcher=n.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const l=t({});class i{constructor(e,t,n,r){this.len=-1,this.sI=0,this.rI=1,this.cI=1,this.token=[],this.len=e,null!=t&&(this.sI=t),null!=n&&(this.rI=n),null!=r&&(this.cI=r)}toString(){return"Point["+[this.sI+"/"+this.len,this.rI,this.cI]+(0<this.token.length?" "+this.token:"")+"]"}[r.INSPECT](){return this.toString()}}const s=(...e)=>new i(...e);n.makePoint=s;class o{constructor(e,t,n,l,i,s,o){this.isToken=!0,this.name=r.EMPTY,this.tin=-1,this.val=void 0,this.src=r.EMPTY,this.sI=-1,this.rI=-1,this.cI=-1,this.len=-1,this.name=e,this.tin=t,this.src=l,this.val=n,this.sI=i.sI,this.rI=i.rI,this.cI=i.cI,this.use=s,this.why=o,this.len=null==l?0:l.length}resolveVal(e,t){return"function"==typeof this.val?this.val(e,t):this.val}bad(e,t){return this.err=e,null!=t&&(this.use=(0,l.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,l.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,l.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,l.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,l.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new o(...e);function c(e,t,n){let r=e.pnt,l=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let i,s=e.cfg.fixed.token[n];null!=s&&(i=e.token(s,void 0,n,r)),null!=i&&(r.sI+=i.src.length,r.cI+=i.src.length,null==t?l=i:r.token.push(i))}return l}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,s(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,l.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;if(e.fixed.check){let n=e.fixed.check(t);if(n&&n.done)return n.token}let l=t.pnt,i=t.src.substring(l.sI).match(n);if(i){let e=i[1],n=e.length;if(0<n){let i,s=r.token[e];return null!=s&&(i=t.token(s,void 0,e,l),l.sI+=n,l.cI+=n),i}}}},n.makeMatchMatcher=(e,t)=>{let n=(0,l.values)(e.match.value),r=(0,l.values)(e.match.token);return 0===n.length&&0===r.length?null:function(t,l,i=0){if(!e.match.lex)return;if(e.match.check){let n=e.match.check(t);if(n&&n.done)return n.token}let s=t.pnt,o=t.src.substring(s.sI),a="o"===l.state?0:1;for(let e of n)if(e.match instanceof RegExp){let n=o.match(e.match);if(n){let r=n[0],l=r.length;if(0<l){let i,o=e.val?e.val(n):r;return i=t.token("#VL",o,r,s),s.sI+=l,s.cI+=l,i}}}else{let n=e.match(t,l);if(null!=n)return n}for(let e of r)if(!e.tin$||l.spec.def.tcol[a][i].includes(e.tin$))if(e instanceof RegExp){let n=o.match(e);if(n){let r=n[0],l=r.length;if(0<l){let n,i=e.tin$;return n=t.token(i,r,r,s),s.sI+=l,s.cI+=l,n}}}else{let n=e(t,l);if(null!=n)return n}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,def:((null==n?void 0:n.def)?(0,l.entries)(n.def):[]).reduce(((e,[t,n])=>{if(null==n||!1===n)return e;let r={name:t,start:n.start,end:n.end,line:!!n.line,lex:!!n.lex,eatline:!!n.eatline};return e[t]=r,e}),{})};let r=e.comment.lex?(0,l.values)(e.comment.def).filter((e=>e.lex&&e.line)):[],i=e.comment.lex?(0,l.values)(e.comment.def).filter((e=>e.lex&&!e.line)):[];return function(t,n){if(!e.comment.lex)return;if(e.comment.check){let n=e.comment.check(t);if(n&&n.done)return n.token}let s=t.pnt,o=t.src.substring(s.sI),a=s.rI,c=s.cI;for(let n of r)if(o.startsWith(n.start)){let r=o.length,l=n.start.length;for(c+=n.start.length;l<r&&!e.line.chars[o[l]];)c++,l++;if(n.eatline)for(;l<r&&e.line.chars[o[l]];)e.line.rowChars[o[l]]&&a++,l++;let i=o.substring(0,l),u=t.token("#CM",void 0,i,s);return s.sI+=i.length,s.cI=c,s.rI=a,u}for(let n of i)if(o.startsWith(n.start)){let r=o.length,i=n.start.length,u=n.end;for(c+=n.start.length;i<r&&!o.substring(i).startsWith(u);)e.line.rowChars[o[i]]&&(a++,c=0),c++,i++;if(o.substring(i).startsWith(u)){if(c+=u.length,n.eatline)for(;i<r&&e.line.chars[o[i]];)e.line.rowChars[o[i]]&&a++,i++;let l=o.substring(0,i+u.length),d=t.token("#CM",void 0,l,s);return s.sI+=l.length,s.rI=a,s.cI=c,d}return t.bad(l.S.unterminated_comment,s.sI,s.sI+9*n.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,l.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){if(e.text.check){let t=e.text.check(r);if(t&&t.done)return t.token}let l=e.text,i=r.pnt,s=r.src.substring(i.sI),o=e.value.def,a=e.value.defre,u=s.match(n);if(u){let n,d=u[1],p=u[2];if(null!=d){let t=d.length;if(0<t){let c;if(e.value.lex)if(void 0!==(c=o[d]))n=r.token("#VL",c.val,d,i),i.sI+=t,i.cI+=t;else for(let e in a){let t=a[e];if(t.match){let e=t.match.exec(t.consume?s:d);if(e&&(t.consume||e[0].length===d.length)){let l=e[0];if(null==t.val)n=r.token("#VL",l,l,i);else{let s=t.val(e);n=r.token("#VL",s,l,i)}i.sI+=l.length,i.cI+=l.length}}}null==n&&l.lex&&(n=r.token("#TX",d,d,i),i.sI+=t,i.cI+=t)}}if(n&&(n=c(r,n,p)),n&&0<e.text.modify.length){const l=e.text.modify;for(let i=0;i<l.length;i++)n.val=l[i](n.val,r,e,t)}return n}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,l.regexp)(null,["^([-+]?(0(",[n.hex?"x[0-9a-fA-F_]+":null,n.oct?"o[0-7_]+":null,n.bin?"b[01_]+":null].filter((e=>null!=e)).join("|"),")|\\.?[0-9]+([0-9_]*[0-9])?)","(\\.[0-9]?([0-9_]*[0-9])?)?","([eE][-+]?[0-9]+([0-9_]*[0-9])?)?"].join("").replace(/_/g,n.sep?(0,l.escre)(n.sepChar):""),")",...e.rePart.ender),i=n.sep?(0,l.regexp)("g",(0,l.escre)(n.sepChar)):void 0;return function(t){if(n=e.number,!n.lex)return;if(e.number.check){let n=e.number.check(t);if(n&&n.done)return n.token}let l=t.pnt,s=t.src.substring(l.sI),o=e.value.def,a=s.match(r);if(a){let n,r=a[1],s=a[9],u=!0;if(null!=r&&(u=!e.number.exclude||!r.match(e.number.exclude))){let s=r.length;if(0<s){let a;if(e.value.lex&&void 0!==(a=o[r]))n=t.token("#VL",a.val,r,l);else{let e=i?r.replace(i,""):r,o=+e;if(isNaN(o)){let t=e[0];"-"!==t&&"+"!==t||(o=("-"===t?-1:1)*+e.substring(1))}isNaN(o)||(n=t.token("#NR",o,r,l),l.sI+=s,l.cI+=s)}}}return u&&(n=c(t,n,s)),n}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,l.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,l.charset)(n.chars),multiChars:(0,l.charset)(n.multiChars),escMap:{...n.escape},escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,l.omap)((0,l.clean)({...n.replace}),(([e,t])=>[e.charCodeAt(0),t])),hasReplace:!1,abandon:!!n.abandon}),e.string.escMap=(0,l.clean)(e.string.escMap),e.string.hasReplace=0<(0,l.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;if(e.string.check){let n=e.string.check(t);if(n&&n.done)return n.token}let{quoteMap:i,escMap:s,escChar:o,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:d,hasReplace:p}=n,{pnt:m,src:h}=t,{sI:f,rI:g,cI:k}=m,v=h.length;if(i[h[f]]){const i=h[f],b=f,x=g,y=c[i];++f,++k;let S,j=[];for(;f<v;f++){k++;let r=h[f];if(S=void 0,i===r){f++;break}if(o===r){f++,k++;let e=s[h[f]];if(null!=e)j.push(e);else if("x"===h[f]){f++;let e=parseInt(h.substring(f,f+2),16);if(isNaN(e)){if(n.abandon)return;return f-=2,k-=2,m.sI=f,m.cI=k,t.bad(l.S.invalid_ascii,f,f+4)}let r=String.fromCharCode(e);j.push(r),f+=1,k+=2}else if("u"===h[f]){f++;let e="{"===h[f]?(f++,1):0,r=e?6:4,i=parseInt(h.substring(f,f+r),16);if(isNaN(i)){if(n.abandon)return;return f=f-2-e,k-=2,m.sI=f,m.cI=k,t.bad(l.S.invalid_unicode,f,f+r+2+2*e)}let s=String.fromCodePoint(i);j.push(s),f+=r-1+e,k+=r+e}else{if(!u){if(n.abandon)return;return m.sI=f,m.cI=k-1,t.bad(l.S.unexpected,f,f+1)}j.push(h[f])}}else if(p&&void 0!==(S=d[h.charCodeAt(f)]))j.push(S),k++;else{let r=f,s=i.charCodeAt(0),o=h.charCodeAt(f);for(;(!p||void 0===(S=d[o]))&&f<v&&32<=o&&s!==o&&a!==o;)o=h.charCodeAt(++f),k++;if(k--,void 0===S&&o<32){if(!y||!e.line.chars[h[f]]){if(n.abandon)return;return m.sI=f,m.cI=k,t.bad(l.S.unprintable,f,f+1)}e.line.rowChars[h[f]]&&(m.rI=++g),k=1,j.push(h.substring(r,f+1))}else j.push(h.substring(r,f)),f--}}if(h[f-1]!==i||m.sI===f-1){if(n.abandon)return;return m.rI=x,t.bad(l.S.unterminated_string,b,f)}const E=t.token("#ST",j.join(r.EMPTY),h.substring(m.sI,f),m);return m.sI=f,m.rI=g,m.cI=k,E}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;if(e.line.check){let n=e.line.check(t);if(n&&n.done)return n.token}let n,{chars:r,rowChars:l}=e.line,{pnt:i,src:s}=t,{sI:o,rI:a}=i,c=e.line.single;for(c&&(n={});r[s[o]]&&!(n&&(n[s[o]]=(n[s[o]]||0)+1,c&&1<n[s[o]]));)a+=l[s[o]]?1:0,o++;if(i.sI<o){let e=s.substring(i.sI,o);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=a,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;if(e.space.check){let n=e.space.check(t);if(n&&n.done)return n.token}let{chars:n}=e.space,{pnt:r,src:l}=t,{sI:i,cI:s}=r;for(;n[l[i]];)i++,s++;if(r.sI<i){let e=l.substring(r.sI,i);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=s,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=s(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=s(this.src.length)}token(e,t,n,r,i,s){let o,c;return"string"==typeof e?(c=e,o=(0,l.tokenize)(c,this.cfg)):(o=e,c=(0,l.tokenize)(e,this.cfg)),a(c,o,t,n,r||this.pnt,i,s)}next(e,t,n,r){let i,s,o=this.pnt,a=o.sI;if(o.end)i=o.end;else if(0<o.token.length)i=o.token.shift();else if(o.len<=o.sI)o.end=this.token("#ZZ",void 0,"",o),i=o.end;else{try{for(let t of this.cfg.lex.match)if(i=t(this,e,r)){s=t;break}}catch(e){i=i||this.token("#BD",void 0,this.src[o.sI],o,{err:e},e.code||l.S.unexpected)}i=i||this.token("#BD",void 0,this.src[o.sI],o,void 0,l.S.unexpected)}return this.ctx.log&&this.ctx.log(l.S.lex,this.ctx,e,this,o,a,s,i,t,n,r),this.ctx.sub.lex&&this.ctx.sub.lex.map((t=>t(i,e,this.ctx))),i}tokenize(e){return(0,l.tokenize)(e,this.cfg)}bad(e,t,n){return this.token("#BD",void 0,0<=t&&t<=n?this.src.substring(t,n):this.src[this.pnt.sI],void 0,void 0,e)}}n.makeLex=(...e)=>new u(...e)})),r={};Object.defineProperty(r,"__esModule",{value:!0}),r.STRING=r.INSPECT=r.EMPTY=r.AFTER=r.BEFORE=r.CLOSE=r.OPEN=void 0,r.OPEN="o",r.CLOSE="c",r.BEFORE="b",r.AFTER="a",r.EMPTY="",r.INSPECT=Symbol.for("nodejs.util.inspect.custom"),r.STRING="string";var l={};Object.defineProperty(l,"__esModule",{value:!0}),l.defaults=void 0;const i=n({}),s={safe:{key:!0},tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},match:{lex:!0,token:{}},tokenSet:{IGNORE:["#SP","#LN","#CM"],VAL:["#TX","#NR","#ST","#VL"],KEY:["#TX","#NR","#ST","#VL"]},space:{lex:!0,chars:" \t"},line:{lex:!0,chars:"\r\n",rowChars:"\n",single:!1},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_",exclude:void 0},comment:{lex:!0,def:{hash:{line:!0,start:"#",lex:!0,eatline:!1},slash:{line:!0,start:"//",lex:!0,eatline:!1},multi:{line:!1,start:"/*",end:"*/",lex:!0,eatline:!1}}},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0,abandon:!1},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,def:{true:{val:!0},false:{val:!1},null:{val:null}}},ender:[],plugin:{},debug:{get_console:()=>console,maxlen:99,print:{config:!1,src:void 0}},error:{unknown:"unknown error: $code",unexpected:"unexpected character(s): $src",invalid_unicode:"invalid unicode escape: $src",invalid_ascii:"invalid ascii escape: $src",unprintable:"unprintable character: $src",unterminated_string:"unterminated string: $src",unterminated_comment:"unterminated comment: $src",unknown_rule:"unknown rule: $rulename"},hint:function(e=(e,t="replace")=>e[t](/[A-Z]/g,(e=>" "+e.toLowerCase()))[t](/[~%][a-z]/g,(e=>("~"==e[0]?" ":"")+e[1].toUpperCase())),t="~sinceTheErrorIsUnknown,ThisIsProbablyABugInsideJsonic\nitself,OrAPlugin.~pleaseConsiderPostingAGithubIssue -Thanks!\n\n~code: $code,~details: \n$details|~theCharacter(s) $srcWereNotExpectedAtThisPointAsTheyDoNot\nmatchTheExpectedSyntax,EvenUnderTheRelaxedJsonicRules.~ifIt\nisNotObviouslyWrong,TheActualSyntaxErrorMayBeElsewhere.~try\ncommentingOutLargerAreasAroundThisPointUntilYouGetNoErrors,\nthenRemoveTheCommentsInSmallSectionsUntilYouFindThe\noffendingSyntax.~n%o%t%e:~alsoCheckIfAnyPluginsYouAreUsing\nexpectDifferentSyntaxInThisCase.|~theEscapeSequence $srcDoesNotEncodeAValidUnicodeCodePoint\nnumber.~youMayNeedToValidateYourStringDataManuallyUsingTest\ncodeToSeeHow~javaScriptWillInterpretIt.~alsoConsiderThatYour\ndataMayHaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeen\ngeneratedCorrectly.|~theEscapeSequence $srcDoesNotEncodeAValid~a%s%c%i%iCharacter.~you\nmayNeedToValidateYourStringDataManuallyUsingTestCodeToSee\nhow~javaScriptWillInterpretIt.~alsoConsiderThatYourDataMay\nhaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeenGenerated\ncorrectly.|~stringValuesCannotContainUnprintableCharacters (characterCodes\nbelow 32).~theCharacter $srcIsUnprintable.~youMayNeedToRemove\ntheseCharactersFromYourSourceData.~alsoCheckThatItHasNot\nbecomeCorrupted.|~thisStringHasNoEndQuote.|~thisCommentIsNeverClosed.|~noRuleNamed $rulenameIsDefined.~thisIsProbablyAnErrorInThe\ngrammarOfAPlugin.".split("|")){return"unknown|unexpected|invalid_unicode|invalid_ascii|unprintable|unterminated_string|unterminated_comment|unknown_rule".split("|").reduce(((n,r,l)=>(n[r]=e(t[l]),n)),{})},lex:{match:{match:{order:1e6,make:i.makeMatchMatcher},fixed:{order:2e6,make:i.makeFixedMatcher},space:{order:3e6,make:i.makeSpaceMatcher},line:{order:4e6,make:i.makeLineMatcher},string:{order:5e6,make:i.makeStringMatcher},comment:{order:6e6,make:i.makeCommentMatcher},number:{order:7e6,make:i.makeNumberMatcher},text:{order:8e6,make:i.makeTextMatcher}},empty:!0,emptyResult:void 0},parse:{prepare:{}},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};l.defaults=s;var o={};Object.defineProperty(o,"__esModule",{value:!0}),o.makeRuleSpec=o.makeNoRule=o.makeRule=void 0;const a=t({});class c{constructor(e,t,n){this.i=-1,this.name=r.EMPTY,this.node=null,this.state=r.OPEN,this.n=Object.create(null),this.d=-1,this.u=Object.create(null),this.k=Object.create(null),this.bo=!1,this.ao=!1,this.bc=!1,this.ac=!1,this.os=0,this.cs=0,this.need=0,this.i=t.uI++,this.name=e.name,this.spec=e,this.child=t.NORULE,this.parent=t.NORULE,this.prev=t.NORULE,this.o0=t.NOTOKEN,this.o1=t.NOTOKEN,this.c0=t.NOTOKEN,this.c1=t.NOTOKEN,this.node=n,this.d=t.rsI,this.bo=null!=e.def.bo,this.ao=null!=e.def.ao,this.bc=null!=e.def.bc,this.ac=null!=e.def.ac}process(e,t){return this.spec.process(this,e,t,this.state)}eq(e,t=0){let n=this.n[e];return null==n||n===t}lt(e,t=0){let n=this.n[e];return null==n||n<t}gt(e,t=0){let n=this.n[e];return null==n||n>t}lte(e,t=0){let n=this.n[e];return null==n||n<=t}gte(e,t=0){let n=this.n[e];return null==n||n>=t}toString(){return"[Rule "+this.name+"~"+this.i+"]"}}const u=(...e)=>new c(...e);o.makeRule=u,o.makeNoRule=e=>u(g(e.cfg,{}),e);class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const p=(...e)=>new d(...e),m=p(),h=p();class f{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[],tcol:[]},this.cfg=e,this.def=Object.assign(this.def,t),this.def.open=(this.def.open||[]).filter((e=>null!=e)),this.def.close=(this.def.close||[]).filter((e=>null!=e));for(let e of[...this.def.open,...this.def.close])k(e)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",l=((0,a.isarr)(t)?t:[t]).filter((e=>null!=e&&"object"==typeof e)).map((e=>k(e))),i="o"===e?"open":"close",s=this.def[i];return s[r](...l),s=this.def[i]=(0,a.modlist)(s,n),(0,a.filterRules)(this,this.cfg),this.norm(),this}open(e,t){return this.add("o",e,t)}close(e,t){return this.add("c",e,t)}action(e,t,n,r){let l=this.def[t+n];return e?l.push(r):l.unshift(r),this}bo(e,t){return this.action(!t||!!e,r.BEFORE,r.OPEN,t||e)}ao(e,t){return this.action(!t||!!e,r.AFTER,r.OPEN,t||e)}bc(e,t){return this.action(!t||!!e,r.BEFORE,r.CLOSE,t||e)}ac(e,t){return this.action(!t||!!e,r.AFTER,r.CLOSE,t||e)}clear(){return this.def.open.length=0,this.def.close.length=0,this.def.bo.length=0,this.def.ao.length=0,this.def.bc.length=0,this.def.ac.length=0,this}norm(){this.def.open.map((e=>k(e))),this.def.close.map((e=>k(e)));const e=[];function t(e,t,n){return n[e]=n[e]||[],[function(e,n){if(n.s&&n.s[t]){let r=[...new Set(e.concat(n.s[t]))];e.length=0,e.push(...r)}return e},n[e][t]=n[e][t]||[]]}return this.def.open.reduce(...t(0,0,e)),this.def.open.reduce(...t(0,1,e)),this.def.close.reduce(...t(1,0,e)),this.def.close.reduce(...t(1,1,e)),this.def.tcol=e,this}process(e,t,n,l){t.log&&t.log(a.S.rule,t,e,n);let i="o"===l,s=i?e:t.NORULE,o=i?"O":"C",c=this.def,d=i?c.open:c.close,p=i?e.bo?c.bo:null:e.bc?c.bc:null;if(p){let n;for(let r=0;r<p.length;r++)if(n=p[r].call(this,e,t,s,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}let f=0<d.length?function(e,t,n,l,i){let s=m;s.b=0,s.p=r.EMPTY,s.r=r.EMPTY,s.n=void 0,s.h=void 0,s.a=void 0,s.u=void 0,s.k=void 0,s.e=void 0;let o=null,c=0,u=!0,d=1<<i.cfg.t.AA-1,p=i.cfg.tokenSetTins.IGNORE;function h(e,t,r,l){let s;do{s=n.next(e,t,r,l),i.tC++}while(p[s.tin]);return s}let f=t.length;for(c=0;c<f;c++){o=t[c];let n=!1,r=!1;if(u=!0,o.S0){let e=(i.t0=i.NOTOKEN!==i.t0?i.t0:i.t0=h(l,o,c,0)).tin;if(n=!0,u=!!(o.S0[e/31|0]&(1<<e%31-1|d)),u&&(r=null!=o.S1,o.S1)){let e=(i.t1=i.NOTOKEN!==i.t1?i.t1:i.t1=h(l,o,c,1)).tin;r=!0,u=!!(o.S1[e/31|0]&(1<<e%31-1|d))}}if(e?(l.o0=n?i.t0:i.NOTOKEN,l.o1=r?i.t1:i.NOTOKEN,l.os=(n?1:0)+(r?1:0)):(l.c0=n?i.t0:i.NOTOKEN,l.c1=r?i.t1:i.NOTOKEN,l.cs=(n?1:0)+(r?1:0)),u&&o.c&&(u=u&&o.c(l,i,s)),u)break;o=null}u||(s.e=i.t0),o&&(s.n=null!=o.n?o.n:s.n,s.h=null!=o.h?o.h:s.h,s.a=null!=o.a?o.a:s.a,s.u=null!=o.u?o.u:s.u,s.k=null!=o.k?o.k:s.k,s.g=null!=o.g?o.g:s.g,s.e=o.e&&o.e(l,i,s)||void 0,s.p=null!=o.p&&!1!==o.p?"string"==typeof o.p?o.p:o.p(l,i,s):s.p,s.r=null!=o.r&&!1!==o.r?"string"==typeof o.r?o.r:o.r(l,i,s):s.r,s.b=null!=o.b&&!1!==o.b?"number"==typeof o.b?o.b:o.b(l,i,s):s.b);let g=c<t.length;return i.log&&i.log(a.S.parse,i,l,n,g,u,c,o,s),s}(i,d,n,e,t):h;if(f.h&&(f=f.h(e,t,f,s)||f,o+="H"),f.e)return this.bad(f.e,e,t,{is_open:i});if(f.n)for(let t in f.n)e.n[t]=0===f.n[t]?0:(null==e.n[t]?0:e.n[t])+f.n[t];if(f.u&&(e.u=Object.assign(e.u,f.u)),f.k&&(e.k=Object.assign(e.k,f.k)),f.a){o+="A";let n=f.a(e,t,f);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:i})}if(f.p){t.rs[t.rsI++]=e;let n=t.rsm[f.p];if(!n)return this.bad(this.unknownRule(t.t0,f.p),e,t,{is_open:i});s=e.child=u(n,t,e.node),s.parent=e,s.n={...e.n},0<Object.keys(e.k).length&&(s.k={...e.k}),o+="P`"+f.p+"`"}else if(f.r){let n=t.rsm[f.r];if(!n)return this.bad(this.unknownRule(t.t0,f.r),e,t,{is_open:i});s=u(n,t,e.node),s.parent=e.parent,s.prev=e,s.n={...e.n},0<Object.keys(e.k).length&&(s.k={...e.k}),o+="R`"+f.r+"`"}else i||(s=t.rs[--t.rsI]||t.NORULE);let g=i?e.ao?c.ao:null:e.ac?c.ac:null;if(g){let n;for(let r=0;r<g.length;r++)if(n=g[r](e,t,s,n),(null==n?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:i})}s.why=o,t.log&&t.log(a.S.node,t,e,n,s),r.OPEN===e.state&&(e.state=r.CLOSE);let k=e[i?"os":"cs"]-(f.b||0);return 1===k?(t.v2=t.v1,t.v1=t.t0,t.t0=t.t1,t.t1=t.NOTOKEN):2==k&&(t.v2=t.t1,t.v1=t.t0,t.t0=t.NOTOKEN,t.t1=t.NOTOKEN),s}bad(e,t,n,r){throw new a.JsonicError(e.err||a.S.unexpected,{...e.use,state:r.is_open?a.S.open:a.S.close},e,t,n)}unknownRule(e,t){return e.err="unknown_rule",e.use=e.use||{},e.use.rulename=t,e}}const g=(...e)=>new f(...e);function k(e){if(r.STRING===typeof e.g?e.g=e.g.split(/\s*,\s*/):null==e.g&&(e.g=[]),e.g=e.g.sort(),e.s&&0!==e.s.length){const t=e=>e.flat().filter((e=>"number"==typeof e)),n=(e,t)=>e.filter((e=>31*t<=e&&e<31*(t+1))),r=(e,t)=>e.reduce(((e,n)=>1<<n-(31*t+1)|e),0),l=t([e.s[0]]),i=t([e.s[1]]),s=e;s.S0=0<l.length?new Array(Math.max(...l.map((e=>1+e/31|0)))).fill(null).map(((e,t)=>t)).map((e=>r(n(l,e),e))):null,s.S1=0<i.length?new Array(Math.max(...i.map((e=>1+e/31|0)))).fill(null).map(((e,t)=>t)).map((e=>r(n(i,e),e))):null}else e.s=null;return e.p||(e.p=null),e.r||(e.r=null),e.b||(e.b=null),e}o.makeRuleSpec=g;var v={};Object.defineProperty(v,"__esModule",{value:!0}),v.makeParser=v.makeRuleSpec=v.makeRule=void 0;const b=t({}),x=n({});Object.defineProperty(v,"makeRule",{enumerable:!0,get:function(){return o.makeRule}}),Object.defineProperty(v,"makeRuleSpec",{enumerable:!0,get:function(){return o.makeRuleSpec}});class y{constructor(e,t){this.rsm={},this.options=e,this.cfg=t}rule(e,t){if(null==e)return this.rsm;let n=this.rsm[e];if(null===t)delete this.rsm[e];else if(void 0!==t)return n=this.rsm[e]=this.rsm[e]||(0,o.makeRuleSpec)(this.cfg,{}),n=this.rsm[e]=t(this.rsm[e],this)||this.rsm[e],void(n.name=e);return n}start(e,t,n,l){let i,s=(0,x.makeToken)("#ZZ",(0,b.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,x.makePoint)(-1)),a=(0,x.makeNoToken)(),c={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>i,plgn:()=>t.internal().plugins,inst:()=>t,rule:{},sub:t.internal().sub,xs:-1,v2:s,v1:s,t0:a,t1:a,tC:-2,kI:-1,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,b.srcfmt)(this.cfg),u:{},NOTOKEN:a,NORULE:{}};c=(0,b.deep)(c,l);let u=(0,o.makeNoRule)(c);if(c.NORULE=u,c.rule=u,n&&b.S.function===typeof n.log&&(c.log=n.log),this.cfg.parse.prepare.forEach((e=>e(t,c,n))),""===e){if(this.cfg.lex.empty)return this.cfg.lex.emptyResult;throw new b.JsonicError(b.S.unexpected,{src:e},c.t0,u,c)}let d=(0,b.badlex)((0,x.makeLex)(c),(0,b.tokenize)("#BD",this.cfg),c),p=this.rsm[this.cfg.rule.start];if(null==p)return;let m=(0,o.makeRule)(p,c);i=m;let h=2*(0,b.keys)(this.rsm).length*d.src.length*2*c.cfg.rule.maxmul,f=0;for(;u!==m&&f<h;)c.kI=f,c.rule=m,c.log&&c.log("",c.kI+":"),c.sub.rule&&c.sub.rule.map((e=>e(m,c))),m=m.process(c,d),c.log&&c.log(b.S.stack,c,m,d),f++;if(s.tin!==d.next(m).tin)throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);const g=c.root().node;if(this.cfg.result.fail.includes(g))throw new b.JsonicError(b.S.unexpected,{},c.t0,u,c);return g}clone(e,t){let n=new y(e,t);return n.rsm=Object.keys(this.rsm).reduce(((e,t)=>(e[t]=(0,b.filterRules)(this.rsm[t],this.cfg),e)),{}),n.norm(),n}norm(){(0,b.values)(this.rsm).map((e=>e.norm()))}}v.makeParser=(...e)=>new y(...e);var S={};function j(e){const{deep:t}=e.util,{OB:n,CB:r,OS:l,CS:i,CL:s,CA:o,TX:a,ST:c,ZZ:u}=e.token,{VAL:d,KEY:p}=e.tokenSet,m=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0},h=e=>{const t=e.o0,n=c===t.tin||a===t.tin?t.val:t.src;e.u.key=n};e.rule("val",(e=>{e.bo((e=>e.node=void 0)).open([{s:[n],p:"map",b:1,g:"map,json"},{s:[l],p:"list",b:1,g:"list,json"},{s:[d],g:"val,json"}]).close([{s:[u],g:"end,json"},{b:1,g:"more,json"}]).bc(((e,t)=>{e.node=void 0===e.node?void 0===e.child.node?0===e.os?void 0:e.o0.resolveVal(e,t):e.child.node:e.node}))})),e.rule("map",(e=>{e.bo((e=>{e.node=Object.create(null)})).open([{s:[n,r],b:1,n:{pk:0},g:"map,json"},{s:[n],p:"pair",n:{pk:0},g:"map,json,pair"}]).close([{s:[r],g:"end,json"}])})),e.rule("list",(e=>{e.bo((e=>{e.node=[]})).open([{s:[l,i],b:1,g:"list,json"},{s:[l],p:"elem",g:"list,elem,json"}]).close([{s:[i],g:"end,json"}])})),e.rule("pair",(e=>{e.open([{s:[p,s],p:"val",u:{pair:!0},a:h,g:"map,pair,key,json"}]).bc(((e,t)=>{e.u.pair&&(e.u.prev=e.node[e.u.key],e.node[e.u.key]=e.child.node)})).close([{s:[o],r:"pair",g:"map,pair,json"},{s:[r],b:1,g:"map,pair,json"}])})),e.rule("elem",(e=>{e.open([{p:"val",g:"list,elem,val,json"}]).bc((e=>{!0!==e.u.done&&e.node.push(e.child.node)})).close([{s:[o],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"}])}));const f=(e,n)=>{let r=e.u.key,l=e.child.node;const i=e.u.prev;l=void 0===l?null:l,e.u.list&&n.cfg.safe.key&&("__proto__"===r||"constructor"===r)||(e.node[r]=null==i?l:n.cfg.map.merge?n.cfg.map.merge(i,l,e,n):n.cfg.map.extend?t(i,l):l)};e.rule("val",(e=>{e.open([{s:[p,s],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[d],g:"val,json"},{s:[[r,i]],b:1,c:e=>0<e.d,g:"val,imp,null,jsonic"},{s:[o],c:e=>0===e.d,p:"list",b:1,g:"list,imp,jsonic"},{s:[o],b:1,g:"list,val,imp,null,jsonic"},{s:[u],g:"jsonic"}],{append:!0,delete:[2]}).close([{s:[[r,i]],b:1,g:"val,json,close",e:(e,t)=>0===e.d?t.t0:void 0},{s:[o],c:e=>e.lte("dlist")&&e.lte("dmap"),r:"list",u:{implist:!0},g:"list,val,imp,comma,jsonic"},{c:e=>e.lte("dlist")&&e.lte("dmap"),r:"list",u:{implist:!0},g:"list,val,imp,space,jsonic",b:1},{s:[u],g:"jsonic"}],{append:!0,move:[1,-1]})})),e.rule("map",(e=>{e.bo((e=>{e.n.dmap=1+(e.n.dmap?e.n.dmap:0)})).open([{s:[n,u],b:1,e:m,g:"end,jsonic"}]).open([{s:[p,s],p:"pair",b:2,g:"pair,list,val,imp,jsonic"}],{append:!0}).close([{s:[r],c:e=>e.lte("pk"),g:"end,json"},{s:[r],b:1,g:"path,jsonic"},{s:[[o,i,...d]],b:1,g:"end,path,jsonic"},{s:[u],e:m,g:"end,jsonic"}],{append:!0,delete:[0]})})),e.rule("list",(e=>{e.bo((e=>{e.n.dlist=1+(e.n.dlist?e.n.dlist:0),e.prev.u.implist&&(e.node.push(e.prev.node),e.prev.node=e.node)})).open({c:e=>e.prev.u.implist,p:"elem"}).open([{s:[o],p:"elem",b:1,g:"list,elem,val,imp,jsonic"},{p:"elem",g:"list,elem.jsonic"}],{append:!0}).close([{s:[u],e:m,g:"end,jsonic"}],{append:!0})})),e.rule("pair",((e,t)=>{e.open([{s:[o],g:"map,pair,comma,jsonic"}],{append:!0}).bc(((e,t)=>{e.u.pair&&f(e,t)})).close([{s:[r],c:e=>e.lte("pk"),b:1,g:"map,pair,json"},{s:[o,r],c:e=>e.lte("pk"),b:1,g:"map,pair,comma,jsonic"},{s:[o,u],g:"end,jsonic"},{s:[o],c:e=>e.lte("pk"),r:"pair",g:"map,pair,json"},{s:[o],c:e=>e.lte("dmap",1),r:"pair",g:"map,pair,jsonic"},{s:[p],c:e=>e.lte("dmap",1),r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[r,o,i,...p]],c:e=>0<e.n.pk,b:1,g:"map,pair,imp,path,jsonic"},{s:[i],e:e=>e.c0,g:"end,jsonic"},{s:[u],e:m,g:"map,pair,json"},{r:"pair",b:1,g:"map,pair,imp,jsonic"}],{append:!0,delete:[0,1]})})),e.rule("elem",((e,t)=>{e.open([{s:[o,o],b:2,u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[o],u:{done:!0},a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[p,s],e:t.cfg.list.property?void 0:(e,t)=>t.t0,p:"val",n:{pk:1,dmap:1},u:{done:!0,pair:!0,list:!0},a:h,g:"elem,pair,jsonic"}]).bc(((e,t)=>{!0===e.u.pair&&(e.u.prev=e.node[e.u.key],f(e,t))})).close([{s:[o,[i,u]],b:1,g:"list,elem,comma,jsonic"},{s:[o],r:"elem",g:"list,elem,json"},{s:[i],b:1,g:"list,elem,json"},{s:[u],e:m,g:"list,elem,json"},{s:[r],e:e=>e.c0,g:"end,jsonic"},{r:"elem",b:1,g:"list,elem,imp,jsonic"}],{delete:[-1,-2]})}))}Object.defineProperty(S,"__esModule",{value:!0}),S.makeJSON=S.grammar=void 0,S.grammar=j,S.makeJSON=function(e){let t=e.make({grammar$:!1,text:{lex:!1},number:{hex:!1,oct:!1,bin:!1,sep:null,exclude:/^00+/},string:{chars:'"',multiChars:"",allowUnknown:!1,escape:{v:null}},comment:{lex:!1},map:{extend:!1},lex:{empty:!1},rule:{finish:!1,include:"json"},result:{fail:[void 0,NaN]},tokenSet:{KEY:["#ST",null,null,null]}});return j(t),t};var E={exports:{}};Object.defineProperty(E.exports,"__esModule",{value:!0}),E.exports.root=E.exports.S=E.exports.EMPTY=E.exports.AFTER=E.exports.BEFORE=E.exports.CLOSE=E.exports.OPEN=E.exports.makeTextMatcher=E.exports.makeNumberMatcher=E.exports.makeCommentMatcher=E.exports.makeStringMatcher=E.exports.makeLineMatcher=E.exports.makeSpaceMatcher=E.exports.makeFixedMatcher=E.exports.makeParser=E.exports.makeLex=E.exports.makeRuleSpec=E.exports.makeRule=E.exports.makePoint=E.exports.makeToken=E.exports.make=E.exports.util=E.exports.JsonicError=E.exports.Jsonic=void 0,Object.defineProperty(E.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(E.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(E.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(E.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}}),Object.defineProperty(E.exports,"EMPTY",{enumerable:!0,get:function(){return r.EMPTY}});const O=t({});Object.defineProperty(E.exports,"JsonicError",{enumerable:!0,get:function(){return O.JsonicError}}),Object.defineProperty(E.exports,"S",{enumerable:!0,get:function(){return O.S}});const I=n({});Object.defineProperty(E.exports,"makePoint",{enumerable:!0,get:function(){return I.makePoint}}),Object.defineProperty(E.exports,"makeToken",{enumerable:!0,get:function(){return I.makeToken}}),Object.defineProperty(E.exports,"makeLex",{enumerable:!0,get:function(){return I.makeLex}}),Object.defineProperty(E.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return I.makeFixedMatcher}}),Object.defineProperty(E.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return I.makeSpaceMatcher}}),Object.defineProperty(E.exports,"makeLineMatcher",{enumerable:!0,get:function(){return I.makeLineMatcher}}),Object.defineProperty(E.exports,"makeStringMatcher",{enumerable:!0,get:function(){return I.makeStringMatcher}}),Object.defineProperty(E.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return I.makeCommentMatcher}}),Object.defineProperty(E.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return I.makeNumberMatcher}}),Object.defineProperty(E.exports,"makeTextMatcher",{enumerable:!0,get:function(){return I.makeTextMatcher}}),Object.defineProperty(E.exports,"makeRule",{enumerable:!0,get:function(){return v.makeRule}}),Object.defineProperty(E.exports,"makeRuleSpec",{enumerable:!0,get:function(){return v.makeRuleSpec}}),Object.defineProperty(E.exports,"makeParser",{enumerable:!0,get:function(){return v.makeParser}});const T={tokenize:O.tokenize,srcfmt:O.srcfmt,clone:O.clone,charset:O.charset,trimstk:O.trimstk,makelog:O.makelog,badlex:O.badlex,extract:O.extract,errinject:O.errinject,errdesc:O.errdesc,configure:O.configure,parserwrap:O.parserwrap,mesc:O.mesc,escre:O.escre,regexp:O.regexp,prop:O.prop,str:O.str,clean:O.clean,deep:O.deep,omap:O.omap,keys:O.keys,values:O.values,entries:O.entries};function M(e,t){let n=!0;if("jsonic"===e)n=!1;else if("json"===e)return(0,S.makeJSON)(N);e="string"==typeof e?{}:e;let r={parser:null,config:null,plugins:[],sub:{lex:void 0,rule:void 0},mark:Math.random()},i=(0,O.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:l.defaults,e||{}),s=function(e,t,n){var r;if(O.S.string===typeof e){let l=s.internal();return((null===(r=o.parser)||void 0===r?void 0:r.start)?(0,O.parserwrap)(o.parser):l.parser).start(e,s,t,n)}return e},o=e=>{if(null!=e&&O.S.object===typeof e){(0,O.deep)(i,e),(0,O.configure)(s,r.config,i);let t=s.internal().parser;r.parser=t.clone(i,r.config)}return{...s.options}},a={token:e=>(0,O.tokenize)(e,r.config,s),tokenSet:e=>(0,O.findTokenSet)(e,r.config),fixed:e=>r.config.fixed.ref[e],options:(0,O.deep)(o,i),config:()=>(0,O.deep)(r.config),parse:s,use:function(e,t){if(O.S.function!==typeof e)throw new Error("Jsonic.use: the first argument must be a function defining a plugin. See https://jsonic.senecajs.org/plugin");const n=e.name.toLowerCase(),r=(0,O.deep)({},e.defaults||{},t||{});s.options({plugin:{[n]:r}});let l=s.options.plugin[n];return s.internal().plugins.push(e),e.options=l,e(s,l)||s},rule:(e,t)=>s.internal().parser.rule(e,t)||s,make:e=>M(e,s),empty:e=>M({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==o.tag?"":"/"+o.tag),toString:()=>a.id,sub:e=>(e.lex&&(r.sub.lex=r.sub.lex||[],r.sub.lex.push(e.lex)),e.rule&&(r.sub.rule=r.sub.rule||[],r.sub.rule.push(e.rule)),s),util:T};if((0,O.defprop)(a.make,O.S.name,{value:O.S.make}),n?(0,O.assign)(s,a):(0,O.assign)(s,{empty:a.empty,parse:a.parse,sub:a.sub,id:a.id,toString:a.toString}),(0,O.defprop)(s,"internal",{value:()=>r}),t){for(let e in t)void 0===s[e]&&(s[e]=t[e]);s.parent=t;let e=t.internal();r.config=(0,O.deep)({},e.config),(0,O.configure)(s,r.config,i),(0,O.assign)(s.token,r.config.t),r.plugins=[...e.plugins],r.parser=e.parser.clone(i,r.config)}else{let e={...s,...a};r.config=(0,O.configure)(e,void 0,i),r.plugins=[],r.parser=(0,v.makeParser)(i,r.config),!1!==i.grammar$&&(0,S.grammar)(e)}return s}let N;E.exports.util=T,E.exports.make=M,E.exports.root=N;let P=E.exports.root=N=M("jsonic");return E.exports.Jsonic=P,N.Jsonic=N,N.JsonicError=O.JsonicError,N.makeLex=I.makeLex,N.makeParser=v.makeParser,N.makeToken=I.makeToken,N.makePoint=I.makePoint,N.makeRule=v.makeRule,N.makeRuleSpec=v.makeRuleSpec,N.makeFixedMatcher=I.makeFixedMatcher,N.makeSpaceMatcher=I.makeSpaceMatcher,N.makeLineMatcher=I.makeLineMatcher,N.makeStringMatcher=I.makeStringMatcher,N.makeCommentMatcher=I.makeCommentMatcher,N.makeNumberMatcher=I.makeNumberMatcher,N.makeTextMatcher=I.makeTextMatcher,N.OPEN=r.OPEN,N.CLOSE=r.CLOSE,N.BEFORE=r.BEFORE,N.AFTER=r.AFTER,N.EMPTY=r.EMPTY,N.util=T,N.make=M,N.S=O.S,E.exports.default=P,E.exports=P,E.exports}));
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$jsonicMin_1 = _$jsonicMin_1.exports
var _$pathBrowserify_105 = {};
(function (process){(function (){
"use strict";function assertPath(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function normalizeStringPosix(e,t){for(var r,n="",i=0,a=-1,o=0,l=0;l<=e.length;++l){if(l<e.length)r=e.charCodeAt(l);else{if(47===r)break;r=47}if(47===r){if(a===l-1||1===o);else if(a!==l-1&&2===o){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var s=n.lastIndexOf("/");if(s!==n.length-1){-1===s?(n="",i=0):i=(n=n.slice(0,s)).length-1-n.lastIndexOf("/"),a=l,o=0;continue}}else if(2===n.length||1===n.length){n="",i=0,a=l,o=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),i=l-a-1;a=l,o=0}else 46===r&&-1!==o?++o:o=-1}return n}function _format(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}var posix={resolve:function(){for(var e,t="",r=!1,n=arguments.length-1;n>=-1&&!r;n--){var i;n>=0?i=arguments[n]:(void 0===e&&(e=process.cwd()),i=e),assertPath(i),0!==i.length&&(t=i+"/"+t,r=47===i.charCodeAt(0))}return t=normalizeStringPosix(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(assertPath(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=normalizeStringPosix(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return assertPath(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var r=arguments[t];assertPath(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":posix.normalize(e)},relative:function(e,t){if(assertPath(e),assertPath(t),e===t)return"";if((e=posix.resolve(e))===(t=posix.resolve(t)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var n=e.length,i=n-r,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var o=t.length-a,l=i<o?i:o,s=-1,h=0;h<=l;++h){if(h===l){if(o>l){if(47===t.charCodeAt(a+h))return t.slice(a+h+1);if(0===h)return t.slice(a+h)}else i>l&&(47===e.charCodeAt(r+h)?s=h:0===h&&(s=0));break}var f=e.charCodeAt(r+h);if(f!==t.charCodeAt(a+h))break;47===f&&(s=h)}var c="";for(h=r+s+1;h<=n;++h)h!==n&&47!==e.charCodeAt(h)||(0===c.length?c+="..":c+="/..");return c.length>0?c+t.slice(a+s):(a+=s,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(assertPath(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){n=a;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');assertPath(e);var r,n=0,i=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var o=t.length-1,l=-1;for(r=e.length-1;r>=0;--r){var s=e.charCodeAt(r);if(47===s){if(!a){n=r+1;break}}else-1===l&&(a=!1,l=r+1),o>=0&&(s===t.charCodeAt(o)?-1==--o&&(i=r):(o=-1,i=l))}return n===i?i=l:-1===i&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!a){n=r+1;break}}else-1===i&&(a=!1,i=r+1);return-1===i?"":e.slice(n,i)},extname:function(e){assertPath(e);for(var t=-1,r=0,n=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(47!==l)-1===n&&(i=!1,n=o+1),46===l?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){r=o+1;break}}return-1===t||-1===n||0===a||1===a&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return _format("/",e)},parse:function(e){assertPath(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,n=e.charCodeAt(0),i=47===n;i?(t.root="/",r=1):r=0;for(var a=-1,o=0,l=-1,s=!0,h=e.length-1,f=0;h>=r;--h)if(47!==(n=e.charCodeAt(h)))-1===l&&(s=!1,l=h+1),46===n?-1===a?a=h:1!==f&&(f=1):-1!==a&&(f=-1);else if(!s){o=h+1;break}return-1===a||-1===l||0===f||1===f&&a===l-1&&a===o+1?-1!==l&&(t.base=t.name=0===o&&i?e.slice(1,l):e.slice(o,l)):(0===o&&i?(t.name=e.slice(1,a),t.base=e.slice(1,l)):(t.name=e.slice(o,a),t.base=e.slice(o,l)),t.ext=e.slice(a,l)),o>0?t.dir=e.slice(0,o-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};posix.posix=posix,_$pathBrowserify_105=posix;
}).call(this)}).call(this,_$browser_108)
var _$_empty_8 = {};
var _$nidMin_94 = { exports: {} };
(function (global){(function (){
!function(e){"object"==typeof _$nidMin_94.exports&&"undefined"!="object"?_$nidMin_94.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Nid=e()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0});const n=[[102,117,99,107],[115,104,105,116],[99,117,110,116],[110,105,103,103],[99,111,99,107],[115,117,99,107],[98,105,116,99,104],[97,115,115],[104,111,108,101],[119,104,111,114,101],[119,97,110,107],[115,108,117,116],[112,117,115,115],[101,114,114,111,114]],t={len:6,alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"};let o,l;function r(e){return"string"==typeof e&&(e=e.split(/\s*,\s*/)),Array.isArray(e)?function(n){const t=n.toLowerCase();for(let n=0;n<e.length;n++)if(-1!=t.indexOf(e[n]))return!0}:"function"==typeof e?e:e instanceof RegExp?n=>!!n.match(e):()=>!1}function f(e){let f=t.len||0,u=t.alphabet;null==o&&(l=n.map((e=>e.map((e=>String.fromCharCode(e))).join(""))),o=r(l));let a=o;e&&(f=e.length||e.len||f||0,u=e.alphabet||u,a=e.curses?r(e.curses):a),u=null==u?"":u;let s=null;const i=u.length||0;do{const e=(new Date).getTime(),n=[];for(let t=0;t<f;t++){const t=Math.floor(e*Math.random()%i);n.push(u[t])}s=n.join("")}while(a(s));return s}function u(e){return e?"number"==typeof e?f({len:e}):"object"==typeof e?function(e){e.len=e.len||e.length,["len","alphabet","curses"].forEach((function(n){e[n]=void 0===e[n]?t[n]:e[n]})),e.hex?e.alphabet="0123456789abcdef":e.HEX&&(e.alphabet="0123456789ABCDEF"),e.curses=e.exclude||e.curses;let n=function(){return f(e)};const l=e.curses;return n.curses=()=>l||o,n.len=e.len,n.alphabet=e.alphabet,n}(e):f():f()}return u(),u.curses=()=>l,u.len=t.len,u.alphabet=t.alphabet,e.default=u,u}));
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$nidMin_94 = _$nidMin_94.exports
var _$gubuMin_74 = { exports: {} };
(function (global){(function (){
!function(e){"object"==typeof _$gubuMin_74.exports&&"undefined"!="object"?_$gubuMin_74.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Gubu=e()}((function(){var e={},t={};Object.defineProperty(t,"__esModule",{value:!0}),t.Gubu=void 0;const n=Symbol.for("gubu$"),r={gubu$:n,v$:"8.2.1"},l=/^[A-Z]/,{toString:i}=Object.prototype,o="name",s="nan",u="never",a="number",c="required",f="array",p="function",h="object",v="string",d="undefined",g="any",y="list",m="instance",b="null",$="type",k="closed",x="shape",I="check",w="regexp",j="String",S="Number",N="Boolean",O="Object",V="Array",A="Function",R="Value",D="Below",E="Check",C="Exact",G="Some",T=" for property ",B='"$PATH"',J='"$VALUE"',W={[j]:String,[S]:Number,[N]:Boolean,[O]:Object,[V]:Array,Symbol:Symbol,[A]:Function},M=e=>Object.keys(e),F=(e,t,n)=>Object.defineProperty(e,t,n),P=e=>Array.isArray(e),z=e=>JSON.parse(e),L=(e,t)=>JSON.stringify(e,t);class _{constructor(e,t,n,r){this.match=!1,this.dI=0,this.nI=2,this.cI=-1,this.pI=0,this.sI=-1,this.valType=u,this.isRoot=!1,this.key="",this.type=u,this.stop=!0,this.nextSibling=!0,this.fromDflt=!1,this.ignoreVal=void 0,this.curerr=[],this.err=[],this.parents=[],this.keys=[],this.ancestors=[],this.path=[],this.root=e,this.vals=[e,-1],this.node=t,this.nodes=[t,-1],this.ctx=n||{},this.match=!!r}next(){this.stop=!1,this.fromDflt=!1,this.ignoreVal=void 0,this.isRoot=0===this.pI,this.check=void 0;let e=this.nodes[this.pI];for(this.ancestors[this.dI]=this.node;+e;)this.dI--,this.ctx.log&&-1<this.dI&&this.ctx.log("e"+(P(this.parents[this.pI])?"a":"o"),this),this.pI=+e,e=this.nodes[this.pI];e?(this.node=e,this.updateVal(this.vals[this.pI]),this.key=this.keys[this.pI],this.cI=this.pI,this.sI=this.pI+1,Object.isFrozen(this.parents[this.pI])&&(this.parents[this.pI]={...this.parents[this.pI]}),this.parent=this.parents[this.pI],this.nextSibling=!0,this.type=this.node.t,this.path[this.dI]=this.key,this.oval=this.val,this.curerr.length=0):this.stop=!0}updateVal(e){this.val=e,this.valType=typeof this.val,a===this.valType&&isNaN(this.val)&&(this.valType=s),this.isRoot&&!this.match&&(this.root=this.val)}}class q extends TypeError{constructor(e,t,n,r){var l;super((t=null==t||t.startsWith("G$")?"":t+": ")+n.map((e=>e.text)).join("\n")),this.gubu=!0,this.name="GubuError",this.code=e,this.gname=t,this.desc=()=>({name:"GubuError",code:e,err:n,ctx:r}),this.stack=null===(l=this.stack)||void 0===l?void 0:l.replace(/.*\/gubu\/gubu\.[tj]s.*\n/g,""),this.props=n.map((e=>{var t;return{path:e.path,what:e.why,type:null===(t=e.node)||void 0===t?void 0:t.t,value:e.value}}))}toJSON(){return{...this,err:this.desc().err,name:this.name,message:this.message}}}const H={Array:!0,BigInt:!0,Boolean:!0,Function:!0,Number:!0,Object:!0,String:!0,Symbol:!0},U={string:"",number:0,boolean:!1,object:{},array:[],symbol:Symbol(""),bigint:BigInt(0),null:null,regexp:/.*/};function K(e,t,o){var u,c,y,$;if(Q===e)e=void 0;else if(null!=e&&(null===(u=e.$)||void 0===u?void 0:u.gubu$)){if(n===e.$.gubu$)return e.d=null==t?e.d:t,e;if(!0===e.$.gubu$){let r={...e};return r.$={v$:"8.2.1",...r.$,gubu$:n},r.v=null!=r.v&&h===typeof r.v?{...r.v}:r.v,r.t=r.t||typeof r.v,p===r.t&&H[r.v.name]&&(r.t=r.v.name.toLowerCase(),r.v=Ee(U[r.t]),r.f=r.v),r.r=!!r.r,r.p=!!r.p,r.d=null==t?null==r.d?-1:r.d:t,r.b=r.b||[],r.a=r.a||[],r.u=r.u||{},r.m=r.m||o||{},r}}let k=null===e?b:typeof e;k=d===k?g:k;let x,I=e,j=I,S=!1,N={},V=[],R=[];if(h===k)j=void 0,P(I)?(k=f,1===I.length&&(x=I[0],I=[])):null!=I&&Function!==I.constructor&&Object!==I.constructor&&null!=I.constructor?("[object RegExp]"===i.call(I)?(k=w,S=!0):(k=m,N.n=I.constructor.name,N.i=I.constructor),j=I):0===M(I).length&&(x=le());else if(p===k)if(H[e.name])k=e.name.toLowerCase(),S=!0,I=Ee(U[k]),j=I,O===e.name&&(x=le());else if(I.gubu===r||!0===(null===(c=I.$)||void 0===c?void 0:c.gubu)){let e=I.node?I.node():I;k=e.t,I=e.v,j=I,S=e.r,N={...e.u},V=[...e.a],R=[...e.b]}else A===I.constructor.name&&l.test(I.name)&&(k=m,S=!0,N.n=null===($=null===(y=I.prototype)||void 0===y?void 0:y.constructor)||void 0===$?void 0:$.name,N.i=I);else a===k&&isNaN(I)?k=s:v===k&&""===I&&(N.empty=!0);let D=null==I||h!==k&&f!==k?I:{...I};return{$:r,t:k,v:D,f:j,n:null!=D&&h===typeof D?M(D).length:0,c:x,r:S,p:!1,d:null==t?-1:t,k:[],e:!0,u:N,a:V,b:R,m:o||{},[Symbol.for("nodejs.util.inspect.custom")](){const e={...this};return delete e.$,JSON.stringify(e,((e,t)=>"function"!=typeof t||Ce[t.name]?t:t.name)).replace(/"/g,"").replace(/,/g," ")}}}function Z(e,t){var n;const r=[[{},"root",e,t]];for(let e=0;e<r.length;e++){const t=r[e],l=t[0][t[1]]=K(t[2],t[3]);void 0!==l.c&&((null===(n=l.c.$)||void 0===n?void 0:n.gubu$)||r.push([l,"c",l.c,l.d]));let i=typeof l.v;h===i&&null!=l.v&&Object.entries(l.v).map((e=>{var t;(null===(t=e[1].$)||void 0===t?void 0:t.gubu$)||r.push([l.v,e[0],e[1],l.d+1])}))}return r[0][0].root}function Q(t,l){const i=null==l?{}:l;i.name=null==i.name?"G$"+(""+Math.random()).substring(2,8):""+i.name;let o=i.meta=i.meta||{};o.active=!0===o.active||!1,o.suffix=v==typeof o.suffix?o.suffix:"$$";let s=i.keyexpr=i.keyexpr||{};s.active=!1!==s.active;let a=i.valexpr=i.valexpr||{};a.active=!0===a.active,a.keymark=v==typeof a.keymark?a.keymark:o.suffix;let p,j=K(t,0),S="";function N(e,t,n){var r,l,p;const S=null===(r=null==t?void 0:t.skip)||void 0===r?void 0:r.depth,N=Array.isArray(null===(l=null==t?void 0:t.skip)||void 0===l?void 0:l.depth)?t.skip.depth:null,O=Array.isArray(null===(p=null==t?void 0:t.skip)||void 0===p?void 0:p.keys)?t.skip.keys:null,V=new _(e,j,t,n);for(;V.next(),!V.stop;){let t=V.node,n=!1,r=!1,l=!!(t.d===S||N&&N.includes(t.d)||O&&1===t.d&&O.includes(V.key))||t.p;if(0<t.b.length)for(let e=0;e<t.b.length;e++){let l=Y(t.b[e],V);t=V.node,void 0!==l.done&&(n=l.done),r=r||!!l.fatal}if(!n){let n=!0,r=void 0===V.val;if(u===V.type)V.curerr.push(Ae(u,V,1070));else if(h===V.type){let e;if(void 0!==t.c&&(t.c=Z(t.c,1+V.dI)),t.r&&r?(V.ignoreVal=!0,V.curerr.push(Ae(c,V,1010))):r||null!==V.val&&h===V.valType&&!P(V.val)?!l&&r&&void 0!==t.f?(V.updateVal(t.f),V.fromDflt=!0,e=V.val,n=!1):l&&r||(V.updateVal(V.val||(V.fromDflt=!0,{})),e=V.val):(V.curerr.push(Ae($,V,1020)),e=P(V.val)?V.val:{}),n&&(e=null==e&&!1===V.ctx.err?{}:e,null!=e)){V.ctx.log&&V.ctx.log("so",V);let n=!1,r=M(t.v),l=V.nI;if(0<r.length){n=!0,V.pI=l;for(let n=0;n<r.length;n++){let l,i=r[n];if(o.active&&i.endsWith(o.suffix)){if(l={short:""},v===typeof t.v[i]?l.short=t.v[i]:l={...l,...t.v[i]},delete t.v[i],n++,r.length<=n)break;if(r[n]!==i.substring(0,i.length-o.suffix.length))throw new Error("Invalid meta key: "+i);i=r[n]}let u=i,c=t.v[i];if(s.active){let e=/^\s*("(\\.|[^"\\])*"|[^\s]+):\s*(.*?)\s*$/.exec(i);e&&(u=e[1],c=X({src:e[3],d:1+V.dI,meta:l},c),delete t.v[i])}if(a.active&&i.startsWith(a.keymark)){if(i===a.keymark){let e=X({src:c,d:1+V.dI,meta:l,ancestors:V.ancestors,node:t},t);Object.assign(t,e)}else t.m.$$=t.m.$$||{},t.m.$$[i.substring(a.keymark.length)]=t.v[i];delete t.v[i];continue}let f=K(c,1+V.dI,l);t.v[u]=f,t.k.includes(u)||t.k.push(u),V.nodes[V.nI]=f,V.vals[V.nI]=e[u],V.parents[V.nI]=e,V.keys[V.nI]=u,V.nI++}}let i=M(e).filter((e=>void 0===t.v[e]));if(0<i.length)if(void 0===t.c)V.ignoreVal=!0,V.curerr.push(Ae(k,V,1100,void 0,{k:i}));else{n=!0,V.pI=l;for(let n of i){let r=t.c=K(t.c,1+V.dI);V.nodes[V.nI]=r,V.vals[V.nI]=e[n],V.parents[V.nI]=e,V.keys[V.nI]=n,V.nI++}}n?(V.dI++,V.nodes[V.nI]=V.sI,V.parents[V.nI]=e,V.nextSibling=!1,V.nI++):V.ctx.log&&V.ctx.log("eo",V)}}else if(f===V.type)if(t.r&&r)V.ignoreVal=!0,V.curerr.push(Ae(c,V,1030));else if(r||P(V.val)){if(!l&&r&&void 0!==t.f)V.updateVal(t.f),V.fromDflt=!0;else if(!l||null!=V.val){V.updateVal(V.val||(V.fromDflt=!0,[]));let n=void 0!==t.c,r=0<V.val.length,l=M(t.v).filter((e=>!isNaN(+e))),i=0<l.length;if(n&&(t.c=Z(t.c,1+V.dI)),V.ctx.log&&V.ctx.log("sa",V),r||i){V.pI=V.nI;let e=0;if(i)if(l.length<V.val.length&&!n)V.ignoreVal=!0,V.curerr.push(Ae(k,V,1090,void 0,{k:l.length}));else for(;e<l.length;e++){let n=t.v[e]=K(t.v[e],1+V.dI);V.nodes[V.nI]=n,V.vals[V.nI]=V.val[e],V.parents[V.nI]=V.val,V.keys[V.nI]=""+e,V.nI++}if(n&&r){let n=t.c;for(;e<V.val.length;e++)V.nodes[V.nI]=n,V.vals[V.nI]=V.val[e],V.parents[V.nI]=V.val,V.keys[V.nI]=""+e,V.nI++}V.ignoreVal||(V.dI++,V.nodes[V.nI]=V.sI,V.parents[V.nI]=V.val,V.nextSibling=!1,V.nI++)}else V.ctx.log&&n&&null==e&&V.ctx.log("kv",{...V,key:0,val:t.c}),V.ctx.log&&V.ctx.log("ea",V)}}else V.curerr.push(Ae($,V,1040));else if(w===V.type)r&&!t.r?V.ignoreVal=!0:v!==V.valType?(V.ignoreVal=!0,V.curerr.push(Ae($,V,1045))):V.val.match(t.v)||(V.ignoreVal=!0,V.curerr.push(Ae(w,V,1045)));else if(g===V.type||y===V.type||I===V.type||void 0===V.val||V.type===V.valType||m===V.type&&t.u.i&&V.val instanceof t.u.i||b===V.type&&null===V.val)if(void 0===V.val){let e=V.path[V.dI];l||!t.r||d===V.type&&V.parent.hasOwnProperty(e)?void 0!==t.f&&!l||d===V.type?(V.updateVal(t.f),V.fromDflt=!0):g===V.type&&(V.ignoreVal=void 0===V.ignoreVal||V.ignoreVal):(V.ignoreVal=!0,V.curerr.push(Ae(c,V,1060))),V.ctx.log&&V.ctx.log("kv",V)}else v!==V.type||""!==V.val||t.u.empty||V.curerr.push(Ae(c,V,1080)),V.ctx.log&&V.ctx.log("kv",V);else V.curerr.push(Ae($,V,1050))}if(0<t.a.length)for(let e=0;e<t.a.length;e++){let l=Y(t.a[e],V);t=V.node,void 0!==l.done&&(n=l.done),r=r||!!l.fatal}let i=l?!1!==V.ignoreVal:!!V.ignoreVal;!V.match&&null!=V.parent&&!n&&!i&&(V.parent[V.key]=V.val),V.nextSibling&&(V.pI=V.sI),(V.node.e||r)&&V.err.push(...V.curerr)}if(0<V.err.length)if(P(V.ctx.err))V.ctx.err.push(...V.err);else if(!V.match&&!1!==V.ctx.err)throw new q(x,i.name,V.err,V.ctx);return V.match?0===V.err.length:V.root}function O(e,t){return N(e,t,!1)}return O.valid=function(e,t){let n=t||{};return n.err=n.err||[],N(e,n,!1),0===n.err.length},O.match=(e,t)=>N(e,t=t||{},!0),O.error=(e,t)=>{let n=t||{};return n.err=n.err||[],N(e,n,!1),n.err},O.spec=()=>{O(void 0,{err:!1});const e=De(j,((e,t)=>n===t||t),!1,!0);return z(e)},O.node=()=>(O.spec(),j),O.stringify=(...e)=>{const t=O.jsonify();return""===S?S="string"==typeof t?t.replace(/^"(.*)"$/,"$1"):JSON.stringify(t,...e):S},O.jsonify=()=>null==p?p=Re(O.node()):p,O.toString=()=>(S=te(""===S?De(null==j||!j.$||n!==j.$.gubu$&&!0!==j.$.gubu$?j:j.v,null,!0):S),`[Gubu ${i.name} ${S}]`),e.inspect&&e.inspect.custom&&(O[e.inspect.custom]=O.toString),O.gubu=r,O.spec(),O}function X(e,t){var n,r;let l,i=!1;"string"==typeof e&&(e={src:e}),e.keymark=e.keymark||"$$";const o=null===(n=null==t?void 0:t.$)||void 0===n?void 0:n.gubu$;if(e.i=e.i||0,null==e.tokens){l=null!=e.val?K(e.val,(e.d||0)+1,e.meta):void 0,i=!0,e.tokens=[];let n=/\s*,?\s*([)(\.]|"(\\.|[^"\\])*"|\/(\\.|[^\/\\])*\/[a-z]?|[^)(,.\s]+)\s*/g,r=null;for(;r=n.exec(e.src);)e.tokens.push(r[1]);if(!o){let n=0,r=!1;for(;n<e.tokens.length;n++)if(")"==e.tokens[n]){r=!0;break}if((r||n===e.tokens.length)&&void 0!==t){let l="token_"+e.d+"_"+e.i;e.refs=e.refs||{},e.refs[l]=t,r?e.tokens.splice(n,0,e.keymark+l):e.tokens.push("(",e.keymark+l,")")}}}let s=e.tokens[e.i],u=Ce[s];if(")"===e.tokens[e.i])return e.i++,t;e.i++;let a=[];if(null==u)try{let t;if(W[s])u=ke,a.unshift(s);else{if(d===s)return;if("NaN"===s)return NaN;if(s.match(/^\/.+\/$/))return new RegExp(s.substring(1,s.length-1));if(t=s.match(/^\$\$([^$]+)$/))return e.node?((null===(r=e.node.m)||void 0===r?void 0:r.$$)||{})[t[1]]||e.node.v["$$"+t[1]]:e.refs?e.refs[t[1]]:void 0;{let e=z(s);if(!i)return e;u=ue,a.unshift(e)}}}catch(t){throw new SyntaxError(`Gubu: unexpected token ${s} in builder expression ${e.src}`)}if("("===e.tokens[e.i]){e.i++;let t=null;for(;null!=(t=e.tokens[e.i])&&")"!==t;){let t=X(e);a.push(t)}e.i++}return l=o?u.call(t,...a):u.call(void 0,...a),"."===e.tokens[e.i]?(e.i++,l=X(e,l)):i&&e.i<e.tokens.length&&(l=X(e,l)),l}function Y(e,t){var n;let r,l={},i=!1;try{i=!(void 0!==t.val||!(null===(n=e.gubu$)||void 0===n?void 0:n.Check))||(t.check=e,e(t.val,l,t))}catch(e){r=e}let o=P(l.err)?0<l.err.length:null!=l.err;if(!i||o){if(void 0===t.val&&(t.node.p||!t.node.r)&&!0!==l.done)return delete l.err,l;let n=l.why||I,i=ee(t);if(v===typeof l.err)t.curerr.push(Ve(t,l.err));else if(h===typeof l.err)t.curerr.push(...[l.err].flat().filter((e=>null!=e)).map((e=>(e.p=null==e.p?i:e.p,e.m=null==e.m?2010:e.m,e))));else{let l=e.name;null!=l&&""!=l||(l=te(e.toString().replace(/[ \t\r\n]+/g," "))),t.curerr.push(Ae(n,t,1045,void 0,{thrown:r},l))}l.done=null==l.done||l.done}return l.hasOwnProperty("uval")?(t.updateVal(l.uval),t.ignoreVal=!1):void 0===l.val||Number.isNaN(l.val)||(t.updateVal(l.val),t.ignoreVal=!1),void 0!==l.node&&(t.node=l.node),void 0!==l.type&&(t.type=l.type),l}function ee(e){return e.path.slice(1,e.dI+1).filter((e=>null!=e)).join(".")}function te(e,t){let n=String(e),r=null==t||isNaN(t)?30:t<0?0:~~t,l=null==e?0:n.length,i=null==e?"":n.substring(0,l);return i=r<l?i.substring(0,r-3)+"...":i,i.substring(0,r)}const ne=function(e){var t;let n=Oe(this,e);return n.r=!0,n.p=!1,void 0===e?(n.f=void 0,1===arguments.length&&(n.t=d,n.v=void 0)):(null===(t=null==this?void 0:this.$)||void 0===t?void 0:t.gubu$)&&(n.f=void 0),n},re=function(e){let t=Oe(this,e);return t.c=le(),t},le=function(e){let t=Oe(this,e);return t.t=g,void 0!==e&&(t.v=e,t.f=e),t},ie=function(e,t){let n=Oe(this,t);return n.z=e,n},oe=function(e){let t=Oe(this,e);return t.r=!1,t.p=!0,t},se=function(e){let t=Oe(this,e);return t.r=!1,t.p=!0,t.e=!1,t.a.push((function(e,t,n){return 0<n.curerr.length&&(t.uval=void 0,t.done=!1),!0})),t},ue=function(e,t){let n=Oe(this,e);if(void 0!==t&&(n=Oe(n,t)),n.r=!1,n.f=e,void 0===t)p===typeof e&&H[e.name]&&(n.t=e.name.toLowerCase(),n.f=Ee(U[n.t]));else{const e=K(t);n.t=e.t}return n.p=!1,n},ae=function(e){let t=Oe(this,e);return t.u.empty=!0,t},ce=function(e){let t=Oe(this,e);return t.t=u,t},fe=function(...e){const t=Oe(this),n=function(t,n,r){for(let n=0;n<e.length;n++)if(t===e[n])return!0;if(r.node.hasOwnProperty("f")&&void 0===t){const t=r.node.f;for(let n=0;n<e.length;n++)if(t===e[n])return!0}return n.err=Ve(r,R+" "+J+T+B+" must be exactly one of: "+e.map((e=>De(e,null,!0))).join(", ")),n.done=!0,!1};return n.n=C,n.a=e,n.s=()=>C+"("+e.map((e=>De(e,null,!0))).join(",")+")",t.b.push(n),t},pe=function(e,t){let n=Oe(this,t);return n.b.push(e),n},he=function(e,t){let n=Oe(this,t);return n.a.push(e),n},ve=function(e,t){let n=Oe(this,t);if(n.r=!0,p===typeof e){let t=e;t.gubu$=t.gubu$||{},t.gubu$.Check=!0,t.s=()=>E+"("+De(e,null,!0)+")",n.b.push(e),n.t=I}else if(h===typeof e){if(Object.prototype.toString.call(e).includes("RegExp")){let t=t=>null!=t&&!Number.isNaN(t)&&!!String(t).match(e);F(t,o,{value:String(e)}),F(t,"gubu$",{value:{Check:!0}}),t.s=()=>E+"("+De(e,null,!0)+")",n.b.push(t),n.t=I}}else v===typeof e&&(n.t=e);if(void 0!==t){const e=K(t);n.t=e.t}return n},de=function(e){let t=Oe(this,e);return f===t.t&&void 0!==t.c&&0===t.n&&(t.v=[t.c]),t.c=void 0,t},ge=function(e,t){let n=Oe(this,t),r=v===typeof e?e:(h===typeof e&&e||{}).name;return null!=r&&""!=r&&n.b.push((function(e,t,n){return(n.ctx.ref=n.ctx.ref||{})[r]=n.node,!0})),n},ye=function(e,t){let n=Oe(this,t),r=h===typeof e&&e||{},l=v===typeof e?e:r.name,i=!!r.fill;return null!=l&&""!=l&&n.b.push((function(e,t,n){if(void 0!==e||i){let e=n.ctx.ref=n.ctx.ref||{};if(void 0!==e[l]){let n={...e[l]};n.t=n.t||u,t.node=n,t.type=n.t}}return!0})),n},me=function(e,t){let n=Oe(this,t),r=h===typeof e&&e||{},l=v===typeof e?e:r.name,i="boolean"==typeof r.keep?r.keep:void 0,s=P(r.claim)?r.claim:[];if(null!=l&&""!=l){let e=(e,t,n)=>{if(void 0===e&&0<s.length){n.ctx.Rename=n.ctx.Rename||{},n.ctx.Rename.fromDflt=n.ctx.Rename.fromDflt||{};for(let e of s){let r=n.ctx.Rename.fromDflt[e]||{};if(void 0!==n.parent[e]&&!r.yes){t.val=n.parent[e],n.match||(n.parent[l]=t.val),t.node=r.node;for(let e=0;e<n.err.length;e++)n.err[e].k===r.key&&(n.err.splice(e,1),e--);if(i){let t=n.cI+1;n.nodes.splice(t,0,K(r.dval)),n.vals.splice(t,0,void 0),n.parents.splice(t,0,n.parent),n.keys.splice(t,0,e),n.nI++,n.pI++}else delete n.parent[e];break}}void 0===t.val&&(t.val=n.node.v)}return!0};F(e,o,{value:"Rename:"+l}),n.b.push(e);let t=(e,t,n)=>(n.parent[l]=e,n.match||i||n.key===l||P(n.parent)&&!1!==i||(delete n.parent[n.key],t.done=!0),n.ctx.Rename=n.ctx.Rename||{},n.ctx.Rename.fromDflt=n.ctx.Rename.fromDflt||{},n.ctx.Rename.fromDflt[l]={yes:n.fromDflt,key:n.key,dval:n.node.v,node:n.node},!0);F(t,o,{value:"Rename:"+l}),n.a.push(t)}return n},be=function(e,t){let n=Oe(this,t);return n.c=K(e),void 0===n.v&&(n.t="object",n.v={},n.f={}),n},$e=function(e,t){let n=Oe(this,t||[]);return n.t="array",n.c=K(e),n.m=n.m||{},n.m.rest=!0,n},ke=function(e,t){let n=K(W[e]),r=Oe(this,t);return r!==n&&(r.t=n.t,r.r=n.r,r.p=n.p,r.v=n.v),r};function xe(e,t,n,r,l){let i=Oe(e,n);t=+t;let s=function(e,n,r){return l(function(e){return a===typeof e?e:a===typeof(null==e?void 0:e.length)?e.length:null!=e&&h===typeof e?M(e).length:NaN}(e),t,e,n,r)};return Object.defineProperty(s,o,{value:r}),s.n=r,s.a=[t],s.s=()=>r+"("+t+")",s[Symbol.for("nodejs.util.inspect.custom")]=s.s(),s.toJSON=()=>s.s(),i.b.push(s),i}const Ie=function(e,t){return xe(this,e,t,"Min",((e,t,n,r,l)=>{if(t<=e)return!0;l.checkargs={min:1};let i=a===typeof n?"":"length ";return r.err=Ve(l,R+" "+J+T+B+` must be a minimum ${i}of ${t} (was ${e}).`),!1}))},we=function(e,t){return xe(this,e,t,"Max",((e,t,n,r,l)=>{if(e<=t)return!0;let i=a===typeof n?"":"length ";return r.err=Ve(l,R+" "+J+T+B+` must be a maximum ${i}of ${t} (was ${e}).`),!1}))},je=function(e,t){return xe(this,e,t,"Above",((e,t,n,r,l)=>{if(t<e)return!0;let i=a===typeof n?"be":"have length";return r.err=Ve(l,R+" "+J+T+B+` must ${i} above ${t} (was ${e}).`),!1}))},Se=function(e,t){return xe(this,e,t,D,((e,t,n,r,l)=>{if(e<t)return!0;let i=a===typeof n?"be":"have length";return r.err=Ve(l,R+" "+J+T+B+` must ${i} below ${t} (was ${e}).`),!1}))},Ne=function(e,t){return xe(this,e,t,D,((e,t,n,r,l)=>{if(t===e)return!0;let i=a===typeof n?"":" in length";return r.err=Ve(l,R+" "+J+T+B+` must be exactly ${t}${i} (was ${e}).`),!1}))};function Oe(e,t){let n,r=null!=e&&(e.window===e||e.global===e);if(void 0!==e&&!r||void 0===t)if(void 0===e||r)n=K(void 0);else if(void 0!==t){n=K(t);let r=K(e);void 0===n.v&&"list"!==n.t&&(n.v=r.v,n.t=r.t),["f","r","p","c","e","z"].map((e=>n[e]=void 0!==r[e]?r[e]:n[e])),n.u=Object.assign({...r.u},n.u),n.m=Object.assign({...r.m},n.m),n.a=r.a.concat(n.a),n.b=r.b.concat(n.b)}else n=K(e);else n=K(t);return n.Above?n:Object.assign(n,{Above:je,After:he,Any:le,Before:pe,Below:Se,Check:ve,Child:be,Closed:de,Default:ue,Define:ge,Empty:ae,Exact:fe,Fault:ie,Ignore:se,Len:Ne,Max:we,Min:Ie,Never:ce,Open:re,Refer:ye,Rename:me,Required:ne,Rest:$e,Skip:oe,Type:ke})}function Ve(e,t,n,r){return Ae(n||I,e,4e3,t,r)}function Ae(e,t,n,r,l,i){var o;let s={key:t.key,type:t.node.t,node:t.node,value:t.val,path:ee(t),why:e,check:(null===(o=t.check)||void 0===o?void 0:o.name)||"none",args:t.checkargs||{},mark:n,text:"",use:l||{}},p=te((void 0===t.val?d:De(t.val)).replace(/"/g,""));if(null==(r=r||t.node.z)||""===r){let n=p.startsWith("[")?f:p.startsWith("{")?h:null==t.val||a===typeof t.val&&isNaN(t.val)?"value":typeof t.val,r=p.startsWith("[")||P(t.parents[t.pI])?"index":"property",o="is",d=null==l?void 0:l.k;d=P(d)?(r=1<d.length?(o="are","properties"):r,d.join(", ")):d,s.text="Validation failed for "+(0<s.path.length?`${r} "${s.path}" with `:"")+`${n} "${p}" because `+($===e?m===t.node.t?`the ${n} is not an instance of ${t.node.u.n}`:`the ${n} is not of type ${w===t.node.t?v:t.node.t}`:c===e?""===t.val?"an empty string is not allowed":`the ${n} is required`:"closed"===e?`the ${r} "${d}" ${o} not allowed`:w===e?"the string did not match "+t.node.v:u===e?"no value is allowed":`check "${null==i?e:i}" failed`)+(s.use.thrown?" (threw: "+s.use.thrown.message+")":".")}else s.text=r.replace(/\$VALUE/g,p).replace(/\$PATH/g,s.path);return s}function Re(e){var t;let n=e.t;const r={number:S,string:j,boolean:N};if(r[n]){let t="";return e.r&&(t+=r[n]),""===t&&(t=JSON.stringify(e.v)),t+=e.b.map((t=>t.s?"."+t.s(e):"")).join(""),t}if(g===n){let n="";return e.r&&(n+="Required()"),"any"==(null===(t=e.c)||void 0===t?void 0:t.t)&&(n+=(""===n?"":".")+"Open()"),n+=e.b.map((t=>t.s?"."+t.s(e):"")).join(""),n.startsWith(".")&&(n=n.slice(1)),""===n&&(n="Any()"),n}if(I===n){let t="";return t+=e.b.map((t=>t.s?"."+t.s(e):"")).join(""),t.startsWith(".")&&(t=t.slice(1)),t}if(h===n){let t={};for(let n in e.v)t[n]=Re(e.v[n]);return void 0!==e.c&&(r[e.c.t]?t.$$="Child("+r[e.c.t]+")":"any"===e.c.t?t.$$="Open()":(t.$$="Child($$child)",t.$$child=Re(e.c))),0<e.b.length&&(void 0===t.$$&&(t.$$=""),t.$$+=e.b.map((t=>t.s?"."+t.s(e):"")).join(""),t.$$.startsWith(".")&&(t.$$=t.$$.slice(1))),t.$$&&1===Object.keys(t).length&&t.$$.startsWith("Child")?t.$$:t}if("list"===n){let t={},n=0,r=e.u.list.map((e=>Re(e))).map(((e,r)=>h===typeof e?(t[r="$$ref"+n++]=e,r):e)),l=(e.b[0].n||e.b[0].name)+"("+r.join(",")+")";return 0===n?l:{$$:l,...t}}if("array"===n){let t=[];return void 0!==e.c?t[0]=Re(e.c):t=Object.keys(e.v).reduce(((t,n)=>(t[+n]=e.v[n],t)),[]).map((e=>Re(e))),t}}function De(e,t,r,l){let o;if(!l&&e&&e.$&&(n===e.$.gubu$||!0===e.$.gubu$))return e=JSON.stringify(Re(e)),r&&(e="string"==typeof e?e.replace(/\\/g,"").replace(/"/g,""):""),e;try{o=L(e,((e,o)=>{var s,u,a;if(t&&(o=t(e,o)),null!=o&&h===typeof o&&o.constructor&&O!==o.constructor.name&&V!==o.constructor.name)o="[object RegExp]"===i.call(o)||p===typeof o.toString?o.toString():o.constructor.name;else if(l||n!==(null===(s=null==o?void 0:o.$)||void 0===s?void 0:s.gubu$))if(p===typeof o)o=p===typeof Q[o.name]&&isNaN(+e)?void 0:null!=o.name&&""!==o.name?o.name:te(o.toString().replace(/[ \t\r\n]+/g," "));else if("bigint"==typeof o)o=String(o.toString());else{if(Number.isNaN(o))return"NaN";!0===l||!0!==(null===(u=null==o?void 0:o.$)||void 0===u?void 0:u.gubu$)&&n!==(null===(a=null==o?void 0:o.$)||void 0===a?void 0:a.gubu$)||(o=JSON.stringify(Re(o)))}else"number"===o.t||"string"===o.t||"boolean"===o.t?o=o.v:(o=Re(o),o=JSON.stringify(o),r&&(o="string"==typeof o?o.replace(/\\/g,"").replace(/"/g,""):""));return o})),o=String(o)}catch(t){o=L(String(e))}return!0===r&&(o=o.replace(/^"/,"").replace(/"$/,"")),o}function Ee(e){return null==e||h!==typeof e?e:z(L(e))}const Ce={Above:je,After:he,All:function(...e){const t=Oe(this);t.t=y,t.r=!0;const n=e.map((e=>Ge(e)));t.u.list=n.map((e=>e.node()));const r=function(t,r,l){let i=!0;for(let e of n){let n={...l.ctx,err:[]};e(t,n),0<n.err.length&&(i=!1)}return i||(r.why="All",r.err=[Ve(l,R+" "+J+T+B+" does not satisfy all of: "+e.map((e=>De(e,null,!0))).join(", "))]),i};return r.n="All",r.a=e,t.b.push(r),t},Any:le,Before:pe,Below:Se,Check:ve,Child:be,Closed:de,Default:ue,Define:ge,Empty:ae,Exact:fe,Fault:ie,Func:function(e){let t=Oe(this);return t.t=p,t.v=e,t.f=e,t},Ignore:se,Key:function(e,t){let n=Oe(this),r=a===typeof e;n.t=v,r&&null==t&&(n=K([]));let l=null;return p===typeof e&&(l=e,n=le()),n.b.push((function(n,i,o){if(l)i.val=l(o.path,o);else if(r){let n=e;i.val=o.path.slice(o.path.length-1-(0<=n?n:0),o.path.length-1+(0<=n?0:1)),v===typeof t&&(i.val=i.val.join(t))}else null==e&&(i.val=o.path[o.path.length-2]);return!0})),n},Len:Ne,Max:we,Min:Ie,Never:ce,One:function(...e){let t=Oe(this);t.t=y,t.r=!0;let n=e.map((e=>Ge(e)));t.u.list=n.map((e=>e.node()));const r=function(t,r,l){let i=0;for(let e of n){let n={...l.ctx,err:[]};if(e.match(t,n)){i++,r.val=e(t,n);break}}return 1!==i&&(r.why="One",r.err=[Ve(l,R+" "+J+T+B+" does not satisfy one of: "+e.map((e=>De(e,null,!0))).join(", "))]),!0};return r.n="One",r.a=e,t.b.push(r),t},Open:re,Optional:function(e){let t=Oe(this,e);return t.r=!1,void 0===e&&1===arguments.length&&(t.t=d,t.v=void 0),t},Refer:ye,Rename:me,Required:ne,Skip:oe,Some:function(...e){let t=Oe(this);t.t=y,t.r=!0;let n=e.map((e=>Ge(e)));t.u.list=n.map((e=>e.node()));const r=function(t,r,l){let i=!1;for(let e of n){let n={...l.ctx,err:[]},o=e.match(t,n);o&&(r.val=e(t,n)),i||(i=o)}return i||(r.why=G,r.err=[Ve(l,R+" "+J+T+B+" does not satisfy any of: "+e.map((e=>De(e,null,!0))).join(", "))]),i};return r.n=G,r.a=e,t.b.push(r),t},Rest:$e,Type:ke};if(d!==typeof window)for(let e in Ce)F(Ce[e],o,{value:e});Object.assign(Q,{Gubu:Q,...Ce,...Object.entries(Ce).reduce(((e,t)=>(e["G"+t[0]]=t[1],e)),{}),isShape:e=>e&&r===e.gubu,G$:e=>K({...e,$:{gubu$:!0}}),buildize:Oe,makeErr:Ve,stringify:De,truncate:te,nodize:K,expr:X,build:function e(t,n={},r=!0){let l;const i=Array.isArray(t)?"array":null===t?"null":typeof t;return"string"===i?l=X(t):"number"===i||"boolean"===i?l=t:h===i?l=Object.entries(t).reduce(((t,r)=>{var l;return t[r[0]]=((null===(l=n.valexpr)||void 0===l?void 0:l.keymark)||"$$")===r[0]?r[1]:e(r[1],n,!1),t}),{}):f===i&&(l=t.map((t=>e(t,n,!1)))),r?(n.valexpr=n.valexpr||{},n.valexpr.active=!0,Ge(l,n)):l},MakeArgu:function(e){return function(t,n,r){let l=!1;v===typeof t&&(l=!0,r=n,n=t);const i=Ge(r=r||n,{name:e+(n=v===typeof n?" ("+n+")":"")}),o=i.node(),s=o.k;let u=t,a={},c=0,f=0;for(;c<s.length;c++){let e=o.v[s[c]];e.p&&(e=o.v[s[c]]=(t=>he((function(e,n,r){if(0<r.curerr.length){f++;for(let e=s.length-1;e>t;e--)o.v[s[e]].m.rest?a[s[e]].splice(o.v[s[e]].m.rest_pos+t-e,0,a[s[e-1]]):(r.vals[r.pI+e-t]=r.vals[r.pI+e-t-1],a[s[e]]=a[s[e-1]]);n.uval=void 0,n.done=!1}return!0}),e))(c),e.e=!1),c!==s.length-1||o.v[s[c]].m.rest||(o.v[s[c]]=he((function(e,t,n){return!(s.length-f<u.length&&(0===n.curerr.length&&(t.err=`Too many arguments for type signature (was ${u.length}, expected ${s.length-f})`),t.fatal=!0,1))}),o.v[s[c]]))}function p(e){for(let t=0;t<s.length;t++){let n=o.v[s[t]];n.m.rest?(a[s[t]]=[...e].slice(t),n.m.rest_pos=a[s[t]].length):a[s[t]]=e[t]}return a}return l?function(e){return u=e,a={},c=0,f=0,i(p(e))}:i(p(t))}}}),F(Q,o,{value:"gubu"});const Ge=Q;t.Gubu=Ge;const{Gubu:Te}=t;return Te}));
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$gubuMin_74 = _$gubuMin_74.exports
var _$eraro_13 = { exports: {} };
"use strict";/* removed: const _$util_145=require("util"); */;function eraro(e){const r=!1===(e=e||{}).prefix?"":"string"==typeof e.prefix?e.prefix:"string"==typeof e.package?e.package+": ":"",t=e.package||"unknown",n=e.module||_$eraro_13,i=e.msgmap||{},s=null==e.inspect||!!e.inspect,o=[_$eraro_13.filename],l=n.filename;l&&o.push(l);const a=function(n,l,a,g){if(_$util_145.isError(n)){if(n.eraro&&!e.override)return n}else n=null,l=arguments[0],a=arguments[1],g=arguments[2];l="string"==typeof l?l:n?n.code?n.code:n.message?n.message:"unknown":"unknown",g="object"==typeof g?g:"object"==typeof a?a:{},n&&(g.errmsg=n.message,g.errline=callpoint(n,o)),a=buildmessage(e,a="string"==typeof a?a:null,i,r,s,l,g,n);const c=new Error(a);if(n){g.orig$=null==g.orig$?n:g.orig$,g.message$=null==g.message$?n.message:g.message$;for(const e in n)c[e]=n[e]}return c.eraro=!0,c.orig=n,c.code=l,c[t]=!0,c.package=t,c.msg=a,c.details=g,c.stack=n?n.stack:c.stack,c.callpoint=g.errline||callpoint(c,o),c};return a.callpoint=callpoint,a.has=function(e){return!!i[e]},a}function callpoint(e,r){r=Array.isArray(r)?r:[];const t=e?e.stack:null;let n="";if(t){const e=t.split("\n");let i=0;e:for(i=1;i<e.length;i++){const t=e[i];let n=!1;for(let e=0;e<r.length&&("string"!=typeof r[e]||(n=-1!=t.indexOf(r[e]),!n));e++);if(!n)break e}n="string"==typeof e[i]?e[i].substring(4):n}return n}function buildmessage(e,r,t,n,i,s,o,l){let a=n+("string"==typeof r?r:"string"==typeof t[s]?t[s]:l?originalmsg(e.override,l):s),g=Object.assign({},o,{code:s});return a=a.replace(/<%=\s*(.*?)\s*%>/g,((e,r)=>{let t=g[r];return t="object"==typeof t&&null!=t?stringify(t):t,t})),a}function stringify(e){try{return JSON.stringify(e).substring(0,111).replace(/([^\\])"/g,"$1")}catch(r){return""+e}}function originalmsg(e,r){if(r)return e&&r.eraro&&r.orig?r.orig.message:r.message}_$eraro_13.exports=eraro;
_$eraro_13 = _$eraro_13.exports
var _$lodashDefaultsdeep_90 = { exports: {} };
(function (global){(function (){
var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",HOT_COUNT=800,HOT_SPAN=16,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof _$lodashDefaultsdeep_90.exports&&_$lodashDefaultsdeep_90.exports&&!_$lodashDefaultsdeep_90.exports.nodeType&&_$lodashDefaultsdeep_90.exports,freeModule=freeExports&&"object"=="object"&&_$lodashDefaultsdeep_90&&!_$lodashDefaultsdeep_90.nodeType&&_$lodashDefaultsdeep_90,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{var e=freeModule&&freeModule.require&&freeModule.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;function apply(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function baseTimes(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}function baseUnary(e){return function(t){return e(t)}}function getValue(e,t){return null==e?void 0:e[t]}function overArg(e,t){return function(r){return e(t(r))}}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:void 0,Symbol=root.Symbol,Uint8Array=root.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,symToStringTag=Symbol?Symbol.toStringTag:void 0,defineProperty=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),nativeIsBuffer=Buffer?Buffer.isBuffer:void 0,nativeMax=Math.max,nativeNow=Date.now,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),baseCreate=function(){function e(){}return function(t){if(!isObject(t))return{};if(objectCreate)return objectCreate(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty.call(t,e)?t[e]:void 0}function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}function listCacheClear(){this.__data__=[],this.size=0}function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,a=assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var a=r.__data__;if(!Map||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(a)}return r.set(e,t),this.size=r.size,this}function arrayLikeKeys(e,t){var r=isArray(e),a=!r&&isArguments(e),n=!r&&!a&&isBuffer(e),o=!r&&!a&&!n&&isTypedArray(e),s=r||a||n||o,i=s?baseTimes(e.length,String):[],c=i.length;for(var u in e)!t&&!hasOwnProperty.call(e,u)||s&&("length"==u||n&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||isIndex(u,c))||i.push(u);return i}function assignMergeValue(e,t,r){(void 0!==r&&!eq(e[t],r)||void 0===r&&!(t in e))&&baseAssignValue(e,t,r)}function assignValue(e,t,r){var a=e[t];hasOwnProperty.call(e,t)&&eq(a,r)&&(void 0!==r||t in e)||baseAssignValue(e,t,r)}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseAssignValue(e,t,r){"__proto__"==t&&defineProperty?defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseFor=createBaseFor();function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag}function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseKeysIn(e){if(!isObject(e))return nativeKeysIn(e);var t=isPrototype(e),r=[];for(var a in e)("constructor"!=a||!t&&hasOwnProperty.call(e,a))&&r.push(a);return r}function baseMerge(e,t,r,a,n){e!==t&&baseFor(t,(function(o,s){if(n||(n=new Stack),isObject(o))baseMergeDeep(e,t,s,r,baseMerge,a,n);else{var i=a?a(safeGet(e,s),o,s+"",e,t,n):void 0;void 0===i&&(i=o),assignMergeValue(e,s,i)}}),keysIn)}function baseMergeDeep(e,t,r,a,n,o,s){var i=safeGet(e,r),c=safeGet(t,r),u=s.get(c);if(u)assignMergeValue(e,r,u);else{var f=o?o(i,c,r+"",e,t,s):void 0,l=void 0===f;if(l){var y=isArray(c),g=!y&&isBuffer(c),p=!y&&!g&&isTypedArray(c);f=c,y||g||p?isArray(i)?f=i:isArrayLikeObject(i)?f=copyArray(i):g?(l=!1,f=cloneBuffer(c,!0)):p?(l=!1,f=cloneTypedArray(c,!0)):f=[]:isPlainObject(c)||isArguments(c)?(f=i,isArguments(i)?f=toPlainObject(i):isObject(i)&&!isFunction(i)||(f=initCloneObject(c))):l=!1}l&&(s.set(c,f),n(f,c,a,o,s),s.delete(c)),assignMergeValue(e,r,f)}}function baseRest(e,t){return setToString(overRest(e,t,identity),e+"")}var baseSetToString=defineProperty?function(e,t){return defineProperty(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity;function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,a=allocUnsafe?allocUnsafe(r):new e.constructor(r);return e.copy(a),a}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function copyArray(e,t){var r=-1,a=e.length;for(t||(t=Array(a));++r<a;)t[r]=e[r];return t}function copyObject(e,t,r,a){var n=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var i=t[o],c=a?a(r[i],e[i],i,r,e):void 0;void 0===c&&(c=e[i]),n?baseAssignValue(r,i,c):assignValue(r,i,c)}return r}function createAssigner(e){return baseRest((function(t,r){var a=-1,n=r.length,o=n>1?r[n-1]:void 0,s=n>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(n--,o):void 0,s&&isIterateeCall(r[0],r[1],s)&&(o=n<3?void 0:o,n=1),t=Object(t);++a<n;){var i=r[a];i&&e(t,i,a,o)}return t}))}function createBaseFor(e){return function(t,r,a){for(var n=-1,o=Object(t),s=a(t),i=s.length;i--;){var c=s[e?i:++n];if(!1===r(o[c],c,o))break}return t}}function customDefaultsMerge(e,t,r,a,n,o){return isObject(e)&&isObject(t)&&(o.set(t,e),baseMerge(e,t,void 0,customDefaultsMerge,o),o.delete(t)),e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}function getRawTag(e){var t=hasOwnProperty.call(e,symToStringTag),r=e[symToStringTag];try{e[symToStringTag]=void 0;var a=!0}catch(e){}var n=nativeObjectToString.call(e);return a&&(t?e[symToStringTag]=r:delete e[symToStringTag]),n}function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate(getPrototype(e))}function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}function isIterateeCall(e,t,r){if(!isObject(r))return!1;var a=typeof t;return!!("number"==a?isArrayLike(r)&&isIndex(t,r.length):"string"==a&&t in r)&&eq(r[t],e)}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto)}function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}function objectToString(e){return nativeObjectToString.call(e)}function overRest(e,t,r){return t=nativeMax(void 0===t?e.length-1:t,0),function(){for(var a=arguments,n=-1,o=nativeMax(a.length-t,0),s=Array(o);++n<o;)s[n]=a[t+n];n=-1;for(var i=Array(t+1);++n<t;)i[n]=a[n];return i[t]=r(s),apply(e,this,i)}}function safeGet(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var setToString=shortOut(baseSetToString);function shortOut(e){var t=0,r=0;return function(){var a=nativeNow(),n=HOT_SPAN-(a-r);if(r=a,n>0){if(++t>=HOT_COUNT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function eq(e,t){return e===t||e!=e&&t!=t}var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArray=Array.isArray;function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}var isBuffer=nativeIsBuffer||stubFalse;function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function isObjectLike(e){return null!=e&&"object"==typeof e}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=objectTag)return!1;var t=getPrototype(e);if(null===t)return!0;var r=hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&funcToString.call(r)==objectCtorString}var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;function toPlainObject(e){return copyObject(e,keysIn(e))}var defaultsDeep=baseRest((function(e){return e.push(void 0,customDefaultsMerge),apply(mergeWith,void 0,e)}));function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var mergeWith=createAssigner((function(e,t,r,a){baseMerge(e,t,r,a)}));function constant(e){return function(){return e}}function identity(e){return e}function stubFalse(){return!1}_$lodashDefaultsdeep_90.exports=defaultsDeep;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$lodashDefaultsdeep_90 = _$lodashDefaultsdeep_90.exports
var _$use_139 = { exports: {} };
"use strict";const {MakeArgu:MakeArgu,Skip:Skip,One:One,Empty:Empty}=_$gubuMin_74,Argu=MakeArgu("use"),PluginArgu=Argu("plugin",{plugin:One(Object,Function,String),options:Skip(One(Object,String)),callback:Skip(One(Function,null))});function make(e){e=Object.assign({prefix:"plugin-",builtin:"../plugin/",module:({}),errmsgprefix:!0,system_modules:intern.make_system_modules(),merge_defaults:!0,gubu:!0},e);const n=_$eraro_13({package:"use-plugin",msgmap:msgmap(),module:_$use_139,prefix:e.errmsgprefix});function i(){try{return use_plugin_desc(build_plugin_desc(PluginArgu(arguments),e,n),e,n)}catch(e){throw"shape"===e.code&&(e.code="invalid_arguments"),e}}return i.use_plugin_desc=function(i){return use_plugin_desc(i,e,n)},i.build_plugin_desc=function(){try{return build_plugin_desc(PluginArgu(arguments),e,n)}catch(e){throw"shape"===e.code&&(e.code="invalid_arguments"),e}},i}function use_plugin_desc(e,n,i){e.search=build_plugin_names(e.name,n.builtin,n.prefix,n.system_modules),"function"!=typeof e.init&&load_plugin(e,n.module,i);let t=null;if(t=e.init&&e.init.defaults&&(e.init.defaults.gubu&&e.init.defaults.gubu.gubu$||"function"==typeof e.init.defaults)?e.init.defaults:e.defaults&&e.defaults.gubu&&e.defaults.gubu.gubu$||"function"==typeof e.defaults?e.defaults:Object.assign({},e.defaults,e.init&&e.init.defaults),e.defaults=t,n.merge_defaults&&"object"==typeof t&&(e.options=_$lodashDefaultsdeep_90({},e.options,t)),"function"!=typeof e.init){if(null==e.found){const n={};for(let i=0;i<e.history.length;i++){const t=e.history[i],u=_$pathBrowserify_105.dirname(t.module);n[u]=n[u]||[],n[u].push(t.path)}const t=[];throw Object.keys(n).forEach((function(e){t.push("\n"+_$pathBrowserify_105.resolve(e)+":"),n[e].forEach((function(e){t.push("\n "+e)})),t.push("\n")})),e.searchlist=t.join(""),i("not_found",e)}throw i("invalid_definition",e)}return e}function build_plugin_desc(e,n,i){const t=e.plugin;let u=null==e.options?null==t.options?{}:t.options:e.options;u="object"==typeof u?u:{value$:u};let r={options:u,callback:e.callback,history:[]};if("string"==typeof t)r.name=t;else if("function"==typeof t){if(""!==t.name)r.name=t.name;else{const e=Array.isArray(n.prefix)?n.prefix[0]:n.prefix;r.name=e+_$nidMin_94()}r.init=t}else if("object"==typeof t){r=Object.assign({},t,r);let e=r.name;if("string"!=typeof e&&(e=null!=r.init?r.init.name:null),null==e)throw i("no_name",{plugin:t});if(r.name=e,null!=r.init&&"function"!=typeof r.init)throw i("no_init_function",{name:e,plugin:t})}r.options=Object.assign({},r.options||{},u||{});const o=/^(.+)\$(.+)$/.exec(r.name);if(o&&(r.name=o[1],r.tag=o[2]),r.full=r.name+(null==r.tag||""==r.tag?"":"$"+r.tag),!r.name)throw i("no_name",r);return r}function load_plugin(e,n,i){let t,u=n,r=!0,o=0,a={};for(;null==a.initfunc&&(t=make_reqfunc(u));){if(a=perform_require(t,e,r,o),a.error)throw handle_load_error(a.error,a.found,e,i);r=!1,o++,u=u.parent}e.modulepath=a.module,e.requirepath=a.require,e.found=a.found,null!=a.initfunc&&"object"==typeof a.initfunc&&"function"==typeof a.initfunc.default&&(a.initfunc=a.initfunc.default),a.initfunc&&null!=a.initfunc.name&&""!==a.initfunc.name&&(e.name=a.initfunc.name),e.init=a.initfunc,e.init&&"object"==typeof e.init.defaults&&(e.defaults=Object.assign({},e.init.defaults))}function handle_load_error(e,n,i,t){return i.err=e,i.found=n,i.found_name=i.found.name,i.err_msg=e.message,e instanceof SyntaxError?t("syntax_error",i):"MODULE_NOT_FOUND"==e.code?(i.err_msg=e.stack.replace(/\n.*\(module\.js:.*/g,""),i.err_msg=i.err_msg.replace(/\s+/g," "),t("require_failed",i)):t("load_failed",i)}function make_reqfunc(e){if(null==e)return null;const n=e.require.bind(e);return n.module=e.id,n}function perform_require(e,n,i,t){const u=n.search;let r,o,a;e:for(let l=0;l<u.length;l++)if(o=u[l],(i||"builtin"!=o.type)&&(0!==t||"builtin"==o.type||!o.name.match(/^[./]/)))try{e.resolve?o.path=e.resolve(o.name):o.path=o.path||o.name;const i={module:e.module,path:o.path,name:o.name};n.history.push(i),r=e(o.name),a=o;break}catch(e){if("MODULE_NOT_FOUND"==e.code){if(-1==e.message.indexOf(o.name))return{error:e,found:o};continue e}return{error:e,found:o}}return{initfunc:r,module:e.module,require:o.name,path:o.path,found:a}}_$use_139.exports=make;const BuildNameArgu=Argu("build-name",{name:String,builtin:Skip(One(Empty(String),Array)),prefix:Skip(One(Empty(String),Array)),system:Skip(Array)});function build_plugin_names(){const e=BuildNameArgu(arguments),n=e.name,i=n.match(/^[./]/),t=e.builtin?Array.isArray(e.builtin)?e.builtin:[e.builtin]:[],u=e.prefix?Array.isArray(e.prefix)?e.prefix:[e.prefix]:[],r=e.system||[],o=[];i||(t.forEach((function(e){o.push({type:"builtin",name:e+n}),u.forEach((function(i){o.push({type:"builtin",name:e+i+n})}))})),u.forEach((function(e){o.push({type:"normal",name:e+n})}))),-1==r.indexOf(n)&&o.push({type:"normal",name:n}),i||(o.push({type:"normal",name:"./"+n}),u.forEach((function(e){o.push({type:"normal",name:"./"+e+n})})));return o.slice(0).forEach((e=>{e.name.match(/[a-z][A-Z]/)?o.push({...e,name:e.name.replace(/([a-z])([A-Z])/g,((e,n,i)=>n+"-"+i.toLowerCase())).replace(/([A-Z])/g,((e,n)=>n.toLowerCase()))}):e.name.match(/[a-z]-[a-z]/)&&o.push({...e,name:e.name.replace(/([a-z])-([a-z])/g,((e,n,i)=>n+i.toUpperCase())).replace(/([^\w])([a-z])/g,((e,n,i)=>n+i.toUpperCase())).replace(/^([a-z])/g,((e,n)=>n.toUpperCase()))})})),o}function msgmap(){return{syntax_error:"Could not load plugin <%=name%> defined in <%=found_name%> due to syntax error: <%=err_msg%>. See STDERR for details.",not_found:"Could not load plugin <%=name%>; searched the following folder and file paths: <%=searchlist%>.",require_failed:"Could not load plugin <%=name%> defined in <%=found_name%> as a require call inside the plugin (or a module required by the plugin) failed: <%=err_msg%>.",no_name:"No name property found for plugin defined by Object <%=plugin%>.",no_init_function:"The init property is not a function for plugin <%=name%> defined by Object <%=plugin%>.",load_failed:"Could not load plugin <%=name%> defined in <%=found_name%> due to error: <%=err_msg%>.",invalid_option:"Plugin <%=name%>: option value is not valid: <%=err_msg%> in options <%=options%>",invalid_definition:"Plugin <%=name%>: no definition function found."}}const intern=_$use_139.exports.intern={make_system_modules:function(){return _$_empty_8.builtinModules}};
_$use_139 = _$use_139.exports
var _$patrunMin_106 = { exports: {} };
(function (global){(function (){
!function(e){"object"==typeof _$patrunMin_106.exports&&"undefined"!="object"?_$patrunMin_106.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Patrun=e()}((function(){var e={exports:{}};(function(t){(function(){!function(n){"object"==typeof e.exports?e.exports=n():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).Gex=n()}((function(){var e={exports:{}};Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.Gex=void 0;class t{constructor(e){this.desc="",this.gexmap={},null!=e&&(Array.isArray(e)?e:[e]).forEach((e=>{this.gexmap[e]=this.re(this.clean(e))}))}dodgy(e){return null==e||Number.isNaN(e)}clean(e){let t=""+e;return this.dodgy(e)?"":t}match(e){e=""+e;let t=!1,n=Object.keys(this.gexmap);for(let r=0;r<n.length&&!t;r++)t=!!this.gexmap[n[r]].exec(e);return t}on(e){if(null==e)return null;let t=typeof e;if("string"===t||"number"===t||"boolean"===t||e instanceof Date||e instanceof RegExp)return this.match(e)?e:null;if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)!this.dodgy(e[n])&&this.match(e[n])&&t.push(e[n]);return t}{let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.match(n)&&(t[n]=e[n]);return t}}esc(e){let t=this.clean(e);return(t=t.replace(/\*/g,"**")).replace(/\?/g,"*?")}escregexp(e){return e?(""+e).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):""}re(e){if(""===e||e)return e="^"+(e=(e=(e=(e=(e=this.escregexp(e)).replace(/\\\*/g,"[\\s\\S]*")).replace(/\\\?/g,"[\\s\\S]")).replace(/\[\\s\\S\]\*\[\\s\\S\]\*/g,"\\*")).replace(/\[\\s\\S\]\*\[\\s\\S\]/g,"\\?"))+"$",new RegExp(e);{let e=Object.keys(this.gexmap);return 1==e.length?this.gexmap[e[0]]:{...this.gexmap}}}toString(){let e=this.desc;return""!=e?e:this.desc="Gex["+Object.keys(this.gexmap)+"]"}inspect(){return this.toString()}}function n(e){return new t(e)}return e.exports.Gex=n,e.exports=n,e.exports.Gex=n,e.exports.default=n,e.exports}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),e=e.exports;var t,n,r,s,i,o,l,u,a,f={},p=this&&this.__classPrivateFieldGet||function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};Object.defineProperty(f,"__esModule",{value:!0}),f.IntervalMatcher=f.GexMatcher=void 0,f.GexMatcher=class{constructor(){}make(t,n){if("string"==typeof n&&n.match(/[*?]/)){let t=(0,e.Gex)(n);return{kind:"gex",match:e=>null!=t.on(e),fix:n,meta:{},same(e){return null!=e&&e.kind===this.kind&&e.fix===this.fix}}}}scan(e,t){let n=e.filter((e=>"*"===e.fix)).length>0;return{complete:n,sound:n,gaps:[],overs:[],why:"no-star"}}};const h=new RegExp(["^/s*","(=*[<>/(/[]?=*)?/s*([-+0-9a-fA-FeEoOxX]+(/.([0-9a-fA-FeEoOxX]+))?)([/)/]]?)(/s*(,|&+|/|+|/./.)/s*(=*[<>]?=*)/s*([-+.0-9a-fA-FeEoOxX]+)/s*([/)/]]?))?/s*$"].join("").replace(/\//g,"\\"));class c{constructor(){this.kind="interval",t.set(this,((e,t)=>function(n){return e(n)&&t(n)})),n.set(this,((e,t)=>function(n){return e(n)||t(n)})),r.set(this,(e=>function(e){return!1})),s.set(this,(e=>function(e){return!1})),i.set(this,(e=>function(t){return t>e})),o.set(this,(e=>function(t){return t>=e})),l.set(this,(e=>function(t){return t<e})),u.set(this,(e=>function(t){return t<=e})),a.set(this,(e=>function(t){return t===e}))}make(e,f){if("string"==typeof f&&f.match(/[=<>.[()\]]/)){let e=f.match(h),d={jo:"and",o0:"err",n0:NaN,o1:"err",n1:NaN},g=e=>!1;if(null!=e){let h=c.normop(e[1])||c.normop(e[5]),m=c.normop(e[8])||c.normop(e[10]),v=p(this,"="===h?a:"<"===h||")"===h?l:"<="===h||"]"===h?u:">"===h||"("===h?i:">="===h||"["===h?o:s,"f"),x=Number(e[2]),k=null==e[9]?NaN:Number(e[9]),y=e[7],w=null==y?p(this,n,"f"):"&"===y.substring(0,1)||","===y.substring(0,1)?p(this,t,"f"):p(this,n,"f");".."===y&&(w=p(this,t,"f"),v=p(this,s,"f")===v?p(this,o,"f"):v,m=""===m?"<=":m);let N=p(this,null==m?r:"="===m?a:"<"===m||")"===m?l:"<="===m||"]"===m?u:">"===m?i:">="===m?o:s,"f");if(x===k&&("="===h&&null!=m?(k=NaN,N=p(this,r,"f"),v=m.includes("<")?p(this,u,"f"):m.includes(">")?p(this,o,"f"):m.includes("=")?p(this,a,"f"):p(this,s,"f")):"="===m&&null!=h&&(k=NaN,N=p(this,r,"f"),v=h.includes("<")?p(this,u,"f"):h.includes(">")?p(this,o,"f"):p(this,s,"f"))),p(this,s,"f")!==v&&p(this,r,"f")===N&&(p(this,l,"f")===v||p(this,u,"f")===v?(N=v,k=x,v=p(this,o,"f"),x=Number.NEGATIVE_INFINITY,w=p(this,t,"f")):p(this,i,"f")!==v&&p(this,o,"f")!==v||(N=p(this,u,"f"),k=Number.POSITIVE_INFINITY,w=p(this,t,"f"))),!isNaN(k)&&k<x){let e=N,t=k;k=x,x=t,".."!==y&&(N=v,v=e)}let b=v(x),O=N(k),j=w(b,O);return{kind:"interval",fix:f,meta:d={jo:j.name,o0:b.name,n0:x,o1:O.name,n1:k},match:g=e=>{let t=!1,n=parseFloat(e);return isNaN(n)||(t=j(n)),t},same(e){return null!=e&&e.kind===this.kind&&e.meta.jo===this.meta.jo&&e.meta.o0===this.meta.o0&&e.meta.n0===this.meta.n0&&e.meta.o1===this.meta.o1&&e.meta.n1===this.meta.n1}}}}}scan(e,t){let n={complete:!1,sound:!1,gaps:[],overs:[],lower:null,upper:null},r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=this.half_intervals(e);i.reduce(((e,t)=>{let n="eq"===t.o,s="lt"===t.o,i="lte"===t.o,o="gt"===t.o,l="gte"===t.o,u=t.n;if(null==e.lower){let s={n:r,o:"gte"};e.lower=s,e.upper=t,r==u&&l||(o||l?e.gaps.push([s,{n:u,o:o?"lte":"lt",m:0}]):n&&e.gaps.push([s,{n:u,o:"lte",m:1}]))}else{let r="eq"===e.upper.o,a="lt"===e.upper.o,f="lte"===e.upper.o,p=(e.upper.o,e.upper.o,e.upper.n),h=e.upper;u===p?a&&(l||n)||(f||r)&&o||(r||a||f)&&e.gaps.push([{n:p,o:r||f?"gt":"gte",m:2,d:{u:h,h:t}},{n:u,o:n||l?"lt":"lte",m:3}]):p<u?s||i||(r||a||f)&&e.gaps.push([{n:p,o:r||f?"gt":"gte",m:4},{n:u,o:n||l?"lt":"lte",m:5}]):e.overs.push([{n:u,o:n||l?"gte":"gt",m:10},{n:p,o:r||f?"lte":"lt",m:11}]),e.upper=t}return e}),n);let o=0<i.length&&i[i.length-1];return o&&s!==o.n&&"gt"!==o.o&&"gte"!==o.o&&n.gaps.push([{n:o.n,o:"eq"===o.o||"lte"===o.o?"gt":"gte",m:6},{n:s,o:"lte",m:7}]),n.complete=0===n.gaps.length,n.sound=0===n.overs.length,n}half_intervals(e){let t=[];for(let n of e)t.push([{n:n.meta.n0,o:n.meta.o0},{n:n.meta.n1,o:n.meta.o1}]);var n=["lt","lte","eq","gte","gt"];return t.map((e=>[isNaN(e[0].n)||null==e[0].n?null:e[0],isNaN(e[1].n)||null==e[1].n?null:e[1]].filter((e=>null!=e)))).sort(((e,t)=>{if(e[0].n<t[0].n)return-1;if(t[0].n<e[0].n)return 1;var r=n.indexOf(e[0].o),s=n.indexOf(t[0].o);if(r<s)return-1;if(s<r)return 1;if(e[1].n<t[1].n)return-1;if(t[1].n<e[1].n)return 1;var i=n.indexOf(e[1].o),o=n.indexOf(t[1].o);return i<o?-1:o<i?1:0})).reduce(((e,t)=>e.concat(...t)),[])}}f.IntervalMatcher=c,t=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakMap,i=new WeakMap,o=new WeakMap,l=new WeakMap,u=new WeakMap,a=new WeakMap,c.normop=e=>null==e?null:((e.match(/([<>\(\)\[\]])/)||[])[1]||"")+((e.match(/(=)/)||[])[1]||"");var d={exports:{}};function g(t){var n={},r={};let s=[];return(t=t||{}).gex&&s.push(new f.GexMatcher),t.interval&&s.push(new f.IntervalMatcher),n.top=function(){return r},n.add=function(e,i){e={...e};var o="function"==typeof t?t.call(n,e,i):null,l=Object.keys(e).filter((t=>null!=e[t])).sort();l.forEach((function(t){e[t]=String(e[t])}));for(var u,a=r,f=0;f<l.length;f++){var p=l[f],h=e[p];let t=s.reduce(((e,t)=>e||t.make(p,h)),void 0);if((u=a.v)&&p==a.k)if(t){var c=(g=a.g=a.g||{})[p]=g[p]||[];a=(t=c.find((e=>e.same(t)))||(c.push(t),t)).keymap||(t.keymap={})}else a=u[h]||(u[h]={});else if(a.k)if(p<a.k){var d=a.s;g=a.g,a.s={k:a.k,v:a.v},d&&(a.s.s=d),g&&(a.s.g=g),a.g&&(a.g={}),a.k=p,a.v={},t?(c=(g=a.g=a.g||{})[p]=g[p]||[],a=(t=c.find((e=>e.same(t)))||(c.push(t),t)).keymap||(t.keymap={})):a=a.v[h]={}}else a=a.s||(a.s={}),f--;else if(a.k=p,a.v={},t){var g;c=(g=a.g=a.g||{})[p]=g[p]||[],a=(t=c.find((e=>e.same(t)))||(c.push(t),t)).keymap||(t.keymap={})}else a=a.v[h]={}}return void 0!==i&&a&&(a.d=i,o&&(a.f="function"==typeof o?o:o.find,a.r="function"==typeof o.remove?o.remove:void 0)),n},n.findexact=function(e){return n.find(e,!0)},n.find=function(e,t,s){if(null==e)return null;var i=r,o=void 0===r.d?null:r.d,l=r.f,u=null,a=[],f={},p=Object.keys(e).length,h=[];void 0!==r.d&&h.push(r.d);do{if(u=i.k,i.v){var c=e[u],d=i.v[c];if(!d&&i.g&&i.g[u])for(var g=i.g[u],m=0;m<g.length;m++)if(g[m].match(c)){d=g[m].keymap;break}d?(f[u]=!0,i.s&&a.push(i.s),o=void 0===d.d?t?null:o:d.d,s&&void 0!==d.d&&h.push(d.d),l=d.f,i=d):i=i.s}else i=null;null==i&&0<a.length&&(null==o||s&&!t)&&(i=a.pop())}while(i);return t?Object.keys(f).length!==p&&(o=null):null==o&&void 0!==r.d&&(o=r.d),l&&(o=l.call(n,e,o)),s?h:o},n.remove=function(e){var t,n=r,s=null,i=[];do{if(t=n.k,n.v||n.g){if(n.v){var o=n.v[e[t]];o&&i.push({km:n,v:e[t]})}if(null==o&&n.g){let r=n.g[t]||[];for(let s=0;s<r.length;s++)if(r[s].fix===e[t]){i.push({km:n,v:e[t],mv:r[s]}),o=r[s].keymap;break}}o?(s=o.d,n=o):n=n.s}else n=null}while(n);if(void 0!==s){var l=i[i.length-1];if(l&&l.km&&l.km.v){var u=l.km.v[l.v]||l.mv&&l.mv.keymap;!u||u.r&&!u.r(e,u.d)||delete u.d}}},n.list=function(t,n){t=t||{};var s=[];return r.d&&s.push({match:{},data:r.d,find:r.f}),function r(s,i,o,l){if(s.v){var u,a=s.k,f=(0,e.Gex)(t?null==t[a]?n?null:"*":t[a]:"*"),p={...i},h={...o};for(var c in s.v)if(c===t[a]||!n&&null==t[a]||f.on(c)){var d={...p};d[a]=c;var g={...h};delete g[a],u=s.v[c],0===Object.keys(g).length&&u&&u.d&&l.push({match:d,data:u.d,find:u.f}),u&&null!=u.v&&r(u,{...d},{...g},l)}(u=s.s)&&r(u,{...p},{...h},l)}}(r,{},{...t},s),s},n.toString=function(e,t){var n=!0===e||!!t,s="function"==typeof e?e:function(e){return"function"==typeof e?"<"+e.name+">":"<"+e+">"};function i(e,t){for(var n=0;n<t;n++)e.push(" ")}var o=[],l=[];return function e(t,n,r,l){var u;if(void 0!==t.d&&(n.push(" "+s(t.d)),o.push(l.join(", ")+" -> "+s(t.d))),t.k&&(n.push("\n"),i(n,r),n.push(t.k+":")),(t.v||t.s||t.g)&&r++,t.v)for(var a=Object.keys(t.v).sort(),f=0;f<a.length;f++){var p=a[f];n.push("\n"),i(n,r),n.push(p+" ->"),(u=l.slice()).push(t.k+"="+p),e(t.v[p],n,r+1,u)}if(t.g)for(a=Object.keys(t.g).sort(),f=0;f<a.length;f++)for(var h=t.g[a[f]],c=0;c<h.length;c++){var d=h[c];n.push("\n"),i(n,r),n.push(d.fix+" ~>"),(u=l.slice()).push(t.k+"~"+d.fix),e(d.keymap,n,r+1,u)}t.s&&(n.push("\n"),i(n,r),n.push("|"),u=l.slice(),e(t.s,n,r+1,u))}(r,l,0,[]),n?l.join(""):o.join("\n")},n.inspect=n.toString,n.toJSON=function(e){return JSON.stringify(r,(function(e,t){return"function"==typeof t?"[Function]":t}),e)},n}function m(e){return new g(e)}return Object.defineProperty(d.exports,"__esModule",{value:!0}),d.exports.Gex=d.exports.Patrun=void 0,Object.defineProperty(d.exports,"Gex",{enumerable:!0,get:function(){return e.Gex}}),d.exports.Patrun=g,d.exports=m,d.exports.Patrun=g,d.exports.Gex=e.Gex,d.exports.default=m,d.exports}));
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$patrunMin_106 = _$patrunMin_106.exports
var _$rollingStats_109 = { exports: {} };
"use strict";Object.defineProperty(_$rollingStats_109.exports,"__esModule",{value:!0});class Stats{constructor(t,s,i){this.head=-1,this.count=0,this.sum=0,this.allcount=0,this.allsum=0,this.size=t||1111,this.duration=s||6e4,this.clock=null==i?Date.now:i,this.start=this.clock(),this.vals=new Array(t),this.times=new Array(t),this.head=-1,this.count=0,this.sum=0,this.allmin=0,this.allmax=0,this.allcount=0,this.allsum=0,this.minrate=0,this.maxrate=0}point(t){if(null==t)return;let s=this.clock();this.head=(this.head+1)%this.size,this.count===this.size&&(this.sum-=this.vals[this.head],this.count--),this.vals[this.head]=t,this.times[this.head]=s,this.count++,this.sum+=t,this.allcount++,this.allsum+=t,this.allmin=null==this.allmin||t<this.allmin?t:this.allmin,this.allmax=null==this.allmax||this.allmax<t?t:this.allmax}calculate(){let t,s=this.clock(),i=s-this.duration;if(0<this.count){let s=(this.size+this.head-this.count+1)%this.size;for(t=0;t++<this.count&&this.times[s]<=i;)this.sum-=this.vals[s],this.count--,s=(s+1)%this.size}let l,a,h,n=0<this.count?this.sum/this.count:0,e=0;for(t=0;t<this.count;t++)l=this.vals[(this.size+this.head-t)%this.size],e+=Math.pow(l-n,2),a=void 0===a||l<a?l:a,h=void 0===h||h<l?l:h;let u=1e3*this.count/this.duration;return this.minrate=null==this.minrate||u<this.minrate?u:this.minrate,this.maxrate=null==this.maxrate||this.maxrate<u?u:this.maxrate,{now:s,from:i,start:this.start,count:this.count,sum:this.sum,mean:n,min:a,max:h,stddev:1<this.count?Math.sqrt(e/(this.count-1)):0,rate:u,minrate:this.minrate,maxrate:this.maxrate,allmin:this.allmin,allmax:this.allmax,allcount:this.allcount,allsum:this.allsum,allmean:0<this.allcount?this.allsum/this.allcount:0,allrate:1e3*this.allcount/(s-this.start)}}}function NamedStats(t,s,i){let l=Object.create(null),a=new Stats(1,1).calculate(),h={};return l.point=function(l,a){if(null==l||null==a)return;(h[a]=h[a]||new Stats(t,s,i)).point(l)},l.calculate=function(i){if(null==i){let t={};for(let s in h)t[s]=h[s].calculate();return t}let l=h[i]=h[i]||new Stats(t,s);return null==l?a:l.calculate()},l.names=function(){let t=[];for(let s in h)t.push(s);return t},l}const RollingStats=function(t,s,i){return new Stats(t,s,i)};RollingStats.Stats=Stats,RollingStats.NamedStats=NamedStats,_$rollingStats_109.exports.default=RollingStats,"undefined"!="object"&&(_$rollingStats_109.exports=RollingStats);
_$rollingStats_109 = _$rollingStats_109.exports
var _$orduMin_104 = { exports: {} };
(function (global){(function (){
!function(t){"object"==typeof _$orduMin_104.exports&&"undefined"!="object"?_$orduMin_104.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Ordu=t()}((function(){var t,e,r,n=(t=function(t,e){(function(t){(function(){"use strict";function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=r.prototype,e}function r(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return i(t)}return n(t,e,r)}function n(e,n,o){if("string"==typeof e)return function(e,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=0|a(e,n),i=t(o),s=i.write(e,n);return s!==o&&(i=i.slice(0,s)),i}(e,n);if(ArrayBuffer.isView(e))return s(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var o;return(o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n)).__proto__=r.prototype,o}(e,n,o);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return r.from(i,n,o);var f=function(e){if(r.isBuffer(e)){var n=0|u(e.length),o=t(n);return 0===o.length||e.copy(o,0,0,n),o}return void 0!==e.length?"number"!=typeof e.length||R(e.length)?t(0):s(e):"Buffer"===e.type&&Array.isArray(e.data)?s(e.data):void 0}(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function i(e){return o(e),t(e<0?0:0|u(e))}function s(e){for(var r=e.length<0?0:0|u(e.length),n=t(r),o=0;o<r;o+=1)n[o]=255&e[o];return n}function u(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function a(t,e){if(r.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||U(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(t).length;default:if(i)return o?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function f(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function c(t,e,n,o,i){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),R(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=r.from(e,o)),r.isBuffer(e))return 0===e.length?-1:l(t,e,n,o,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):l(t,[e],n,o,i);throw new TypeError("val must be string, number or Buffer")}function l(t,e,r,n,o){var i,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var c=-1;for(i=r;i<u;i++)if(f(t,i)===f(e,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===a)return c*s}else-1!==c&&(i-=i-c),c=-1}else for(r+a>u&&(r=u-a),i=r;i>=0;i--){for(var l=!0,h=0;h<a;h++)if(f(t,i+h)!==f(e,h)){l=!1;break}if(l)return i}return-1}function h(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(R(u))return s;t[r+s]=u}return s}function p(t,e,r,n){return P(M(e,t.length-r),t,r,n)}function y(t,e,r,n){return P(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function g(t,e,r,n){return y(t,e,r,n)}function d(t,e,r,n){return P(C(e),t,r,n)}function v(t,e,r,n){return P(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function m(t,e,r){return 0===e&&r===t.length?A.fromByteArray(t):A.fromByteArray(t.slice(e,r))}function w(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,u,a,f=t[o],c=null,l=f>239?4:f>223?3:f>191?2:1;if(o+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(i=t[o+1]))&&(a=(31&f)<<6|63&i)>127&&(c=a);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(a=(15&f)<<12|(63&i)<<6|63&s)>2047&&(a<55296||a>57343)&&(c=a);break;case 4:i=t[o+1],s=t[o+2],u=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&u)&&(a=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(c=a)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=l}return function(t){var e=t.length;if(e<=b)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=b));return r}(n)}e.Buffer=r,e.INSPECT_MAX_BYTES=50,r.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),r.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),r.poolSize=8192,r.from=function(t,e,r){return n(t,e,r)},r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,r.alloc=function(e,r,n){return function(e,r,n){return o(e),e<=0?t(e):void 0!==r?"string"==typeof n?t(e).fill(r,n):t(e).fill(r):t(e)}(e,r,n)},r.allocUnsafe=function(t){return i(t)},r.allocUnsafeSlow=function(t){return i(t)},r.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==r.prototype},r.compare=function(t,e){if(U(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),U(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.isBuffer(t)||!r.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,o=e.length,i=0,s=Math.min(n,o);i<s;++i)if(t[i]!==e[i]){n=t[i],o=e[i];break}return n<o?-1:o<n?1:0},r.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return r.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var o=r.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(U(s,Uint8Array)&&(s=r.from(s)),!r.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(o,i),i+=s.length}return o},r.byteLength=a,r.prototype._isBuffer=!0,r.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)f(this,e,e+1);return this},r.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)f(this,e,e+3),f(this,e+1,e+2);return this},r.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)f(this,e,e+7),f(this,e+1,e+6),f(this,e+2,e+5),f(this,e+3,e+4);return this},r.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?w(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return w(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return _(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===r.compare(this,t)},r.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},r.prototype.compare=function(t,e,n,o,i){if(U(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(o>>>=0),u=(n>>>=0)-(e>>>=0),a=Math.min(s,u),f=this.slice(o,i),c=t.slice(e,n),l=0;l<a;++l)if(f[l]!==c[l]){s=f[l],u=c[l];break}return s<u?-1:u<s?1:0},r.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},r.prototype.indexOf=function(t,e,r){return c(this,t,e,r,!0)},r.prototype.lastIndexOf=function(t,e,r){return c(this,t,e,r,!1)},r.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return h(this,t,e,r);case"utf8":case"utf-8":return p(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return g(this,t,e,r);case"base64":return d(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var b=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function O(t,e,r){var n,o=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>o)&&(r=o);for(var i="",s=e;s<r;++s)i+=(n=t[s])<16?"0"+n.toString(16):n.toString(16);return i}function j(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function k(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,n,o,i,s){if(!r.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),x.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),x.write(t,e,r,n,52,8),r+8}r.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var o=this.subarray(t,e);return o.__proto__=r.prototype,o},r.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},r.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},r.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},r.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},r.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return t>>>=0,e||k(t,4,this.length),x.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),x.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),x.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),x.read(this,t,!1,52,8)},r.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},r.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},r.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,1,255,0),this[e]=255&t,e+1},r.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},r.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);S(this,t,e,r,o-1,-o)}var i=0,s=1,u=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},r.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);S(this,t,e,r,o-1,-o)}var i=r-1,s=1,u=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/s|0)-u&255;return e+r},r.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},r.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},r.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},r.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},r.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||S(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},r.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},r.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},r.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},r.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},r.prototype.copy=function(t,e,n,o){if(!r.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o<n&&(o=n),o===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e<o-n&&(o=t.length-e+n);var i=o-n;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,n,o);else if(this===t&&n<e&&e<o)for(var s=i-1;s>=0;--s)t[s+e]=this[s+n];else Uint8Array.prototype.set.call(t,this.subarray(n,o),e);return i},r.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!r.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){var i=t.charCodeAt(0);("utf8"===o&&i<128||"latin1"===o)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var u=r.isBuffer(t)?t:r.from(t,o),a=u.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<n-e;++s)this[s+e]=u[s%a]}return this};var I=/[^+/0-9A-Za-z-_]/g;function M(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function C(t){return A.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function P(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function U(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function R(t){return t!=t}}).call(this)}).call(this,n({}).Buffer)},function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}),o={},i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var u=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}(o=a).once=function(t,e){return new Promise((function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}v(t,e,i,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,o)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var f=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var o,i,s,u;if(c(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),s=i[e]),void 0===s)s=i[e]=r,++t._eventsCount;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=l(t))>0&&s.length>o&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function p(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(n);return o.listener=r,n.wrapFn=o,o}function y(t,e,r){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(o):d(o,o.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function v(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){n.once&&t.removeEventListener(e,o),r(i)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(t){if("number"!=typeof t||t<0||u(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");f=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||u(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var i;if(e.length>0&&(i=e[0]),i instanceof Error)throw i;var u=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw u.context=i,u}var a=o[t];if(void 0===a)return!1;if("function"==typeof a)s(a,this,e);else{var f=a.length,c=d(a,f);for(r=0;r<f;++r)s(c[r],this,e)}return!0},a.prototype.addListener=function(t,e){return h(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return h(this,t,e,!0)},a.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,o,i,s;if(c(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,o),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return y(this,t,!0)},a.prototype.rawListeners=function(t){return y(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};var m=function(...t){try{return JSON.stringify.apply(null,t)}catch(t){return"[Cannot display object: "+t.message+"]"}},w={};w=class extends Error{constructor(t){super(t.filter((t=>""!==t)).map((t=>"string"==typeof t?t:t instanceof Error?t.message:m(t))).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,w.assert)}};var b,E=function(t,...e){if(!t){if(1===e.length&&e[0]instanceof Error)throw e[0];throw new w(e)}};const _={};b=function(t,e,r){if(!1===e||null==e)return t;"string"==typeof(r=r||{})&&(r={separator:r});const n=Array.isArray(e);E(!n||!r.separator,"Separator option no valid for array-based chain");const o=n?e:e.split(r.separator||".");let i=t;for(let t=0;t<o.length;++t){let n=o[t];const s=r.iterables&&_.iterables(i);if(Array.isArray(i)||"set"===s){const t=Number(n);Number.isInteger(t)&&(n=t<0?i.length+t:t)}if(!i||"function"==typeof i&&!1===r.functions||!s&&void 0===i[n]){E(!r.strict||t+1===o.length,"Missing segment",n,"in reach path ",e),E("object"==typeof i||!0===r.functions||"function"!=typeof i,"Invalid segment",n,"in reach path ",e),i=r.default;break}i=s?"set"===s?[...i][n]:i.get(n):i[n]}return i},_.iterables=function(t){return t instanceof Set?"set":t instanceof Map?"map":void 0};for(var A={toByteArray:function(t){var e,r,n=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),o=n[0],i=n[1],s=new k(function(t,e,r){return 3*(e+r)/4-r}(0,o,i)),u=0,a=i>0?o-4:o;for(r=0;r<a;r+=4)e=j[t.charCodeAt(r)]<<18|j[t.charCodeAt(r+1)]<<12|j[t.charCodeAt(r+2)]<<6|j[t.charCodeAt(r+3)],s[u++]=e>>16&255,s[u++]=e>>8&255,s[u++]=255&e;return 2===i&&(e=j[t.charCodeAt(r)]<<2|j[t.charCodeAt(r+1)]>>4,s[u++]=255&e),1===i&&(e=j[t.charCodeAt(r)]<<10|j[t.charCodeAt(r+1)]<<4|j[t.charCodeAt(r+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e),s},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],i=0,s=r-n;i<s;i+=16383)o.push(B(t,i,i+16383>s?s:i+16383));return 1===n?(e=t[r-1],o.push(O[e>>2]+O[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(O[e>>10]+O[e>>4&63]+O[e<<2&63]+"=")),o.join("")}},O=[],j=[],k="undefined"!=typeof Uint8Array?Uint8Array:Array,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L=0;L<64;++L)O[L]=S[L],j[S.charCodeAt(L)]=L;function B(t,e,r){for(var n,o,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),i.push(O[(o=n)>>18&63]+O[o>>12&63]+O[o>>6&63]+O[63&o]);return i.join("")}j["-".charCodeAt(0)]=62,j["_".charCodeAt(0)]=63;var x={read:function(t,e,r,n,o){var i,s,u=8*o-n-1,a=(1<<u)-1,f=a>>1,c=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-c)-1,p>>=-c,c+=u;c>0;i=256*i+t[e+l],l+=h,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+t[e+l],l+=h,c-=8);if(0===i)i=1-f;else{if(i===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var s,u,a,f=8*i-o-1,c=(1<<f)-1,l=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+l>=1?h/a:h*Math.pow(2,1-l))*a>=2&&(s++,a/=2),s+l>=c?(u=0,s=c):s+l>=1?(u=(e*a-1)*Math.pow(2,o),s+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&u,p+=y,u/=256,o-=8);for(s=s<<o|u,f+=o;f>0;t[r+p]=255&s,p+=y,s/=256,f-=8);t[r+p-y]|=128*g}},T={};(function(t){(function(){"use strict";const e={};T=T={array:Array.prototype,buffer:t&&t.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},e.typeMap=new Map([["[object Error]",T.error],["[object Map]",T.map],["[object Promise]",T.promise],["[object Set]",T.set],["[object WeakMap]",T.weakMap],["[object WeakSet]",T.weakSet]]),T.getInternalProto=function(r){if(Array.isArray(r))return T.array;if(t&&r instanceof t)return T.buffer;if(r instanceof Date)return T.date;if(r instanceof RegExp)return T.regex;if(r instanceof Error)return T.error;const n=Object.prototype.toString.call(r);return e.typeMap.get(n)||T.generic}}).call(this)}).call(this,n({}).Buffer);var I=function(t,e={}){return!1!==e.symbols?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)},M={};(function(t){(function(){"use strict";const e={needsProtoHack:new Set([T.set,T.map,T.weakSet,T.weakMap])};M=e.clone=function(r,n={},o=null){if("object"!=typeof r||null===r)return r;let i=e.clone,s=o;if(n.shallow){if(!0!==n.shallow)return e.cloneWithShallow(r,n);i=t=>t}else if(s){const t=s.get(r);if(t)return t}else s=new Map;const u=T.getInternalProto(r);if(u===T.buffer)return t&&t.from(r);if(u===T.date)return new Date(r.getTime());if(u===T.regex)return new RegExp(r);const a=e.base(r,u,n);if(a===r)return r;if(s&&s.set(r,a),u===T.set)for(const t of r)a.add(i(t,n,s));else if(u===T.map)for(const[t,e]of r)a.set(t,i(e,n,s));const f=I(r,n);for(const t of f){if("__proto__"===t)continue;if(u===T.array&&"length"===t){a.length=r.length;continue}const e=Object.getOwnPropertyDescriptor(r,t);e?e.get||e.set?Object.defineProperty(a,t,e):e.enumerable?a[t]=i(r[t],n,s):Object.defineProperty(a,t,{enumerable:!1,writable:!0,configurable:!0,value:i(r[t],n,s)}):Object.defineProperty(a,t,{enumerable:!0,writable:!0,configurable:!0,value:i(r[t],n,s)})}return a},e.cloneWithShallow=function(t,r){const n=r.shallow;(r=Object.assign({},r)).shallow=!1;const o=new Map;for(const e of n){const r=b(t,e);"object"!=typeof r&&"function"!=typeof r||o.set(r,r)}return e.clone(t,r,o)},e.base=function(t,r,n){if(!1===n.prototype)return e.needsProtoHack.has(r)?new r.constructor:r===T.array?[]:{};const o=Object.getPrototypeOf(t);if(o&&o.isImmutable)return t;if(r===T.array){const t=[];return o!==r&&Object.setPrototypeOf(t,o),t}if(e.needsProtoHack.has(r)){const t=new o.constructor;return o!==r&&Object.setPrototypeOf(t,o),t}return Object.create(o)}}).call(this)}).call(this,n({}).Buffer);var C,P={};(function(t){(function(){"use strict";const e={};P=e.merge=function(r,n,o){if(E(r&&"object"==typeof r,"Invalid target value: must be an object"),E(null==n||"object"==typeof n,"Invalid source value: must be null, undefined, or an object"),!n)return r;if(o=Object.assign({nullOverride:!0,mergeArrays:!0},o),Array.isArray(n)){E(Array.isArray(r),"Cannot merge array onto an object"),o.mergeArrays||(r.length=0);for(let t=0;t<n.length;++t)r.push(M(n[t],{symbols:o.symbols}));return r}const i=I(n,o);for(let s=0;s<i.length;++s){const u=i[s];if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(n,u))continue;const a=n[u];if(a&&"object"==typeof a){if(r[u]===a)continue;!r[u]||"object"!=typeof r[u]||Array.isArray(r[u])!==Array.isArray(a)||a instanceof Date||t&&t.isBuffer(a)||a instanceof RegExp?r[u]=M(a,{symbols:o.symbols}):e.merge(r[u],a,o)}else(null!=a||o.nullOverride)&&(r[u]=a)}return r}}).call(this)}).call(this,n({}).Buffer);const U={};C=function(t,e,r={}){if(E(t&&"object"==typeof t,"Invalid defaults value: must be an object"),E(!e||!0===e||"object"==typeof e,"Invalid source value: must be true, falsy or an object"),E("object"==typeof r,"Invalid options: must be an object"),!e)return null;if(r.shallow)return U.applyToDefaultsWithShallow(t,e,r);const n=M(t);if(!0===e)return n;const o=void 0!==r.nullOverride&&r.nullOverride;return P(n,e,{nullOverride:o,mergeArrays:!1})},U.applyToDefaultsWithShallow=function(t,e,r){const n=r.shallow;E(Array.isArray(n),"Invalid keys");const o=new Map,i=!0===e?null:new Set;for(let r of n){r=Array.isArray(r)?r:r.split(".");const n=b(t,r);n&&"object"==typeof n?o.set(n,i&&b(e,r)||n):i&&i.add(r)}const s=M(t,{},o);if(!i)return s;for(const t of i)U.reachCopy(s,e,t);const u=void 0!==r.nullOverride&&r.nullOverride;return P(s,e,{nullOverride:u,mergeArrays:!1})},U.reachCopy=function(t,e,r){for(const t of r){if(!(t in e))return;const r=e[t];if("object"!=typeof r||null===r)return;e=r}const n=e;let o=t;for(let t=0;t<r.length-1;++t){const e=r[t];"object"!=typeof o[e]&&(o[e]={}),o=o[e]}o[r[r.length-1]]=n};var R,N,D,z=R={};function $(){throw new Error("setTimeout has not been defined")}function q(){throw new Error("clearTimeout has not been defined")}function F(t){if(N===setTimeout)return setTimeout(t,0);if((N===$||!N)&&setTimeout)return N=setTimeout,setTimeout(t,0);try{return N(t,0)}catch(e){try{return N.call(null,t,0)}catch(e){return N.call(this,t,0)}}}!function(){try{N="function"==typeof setTimeout?setTimeout:$}catch(t){N=$}try{D="function"==typeof clearTimeout?clearTimeout:q}catch(t){D=q}}();var W,H=[],Y=!1,J=-1;function V(){Y&&W&&(Y=!1,W.length?H=W.concat(H):J=-1,H.length&&X())}function X(){if(!Y){var t=F(V);Y=!0;for(var e=H.length;e;){for(W=H,H=[];++J<e;)W&&W[J].run();J=-1,e=H.length}W=null,Y=!1,function(t){if(D===clearTimeout)return clearTimeout(t);if((D===q||!D)&&clearTimeout)return D=clearTimeout,clearTimeout(t);try{D(t)}catch(e){try{return D.call(null,t)}catch(e){return D.call(this,t)}}}(t)}}function K(t,e){this.fun=t,this.array=e}function G(){}z.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];H.push(new K(t,e)),1!==H.length||Y||F(X)},K.prototype.run=function(){this.fun.apply(null,this.array)},z.title="browser",z.browser=!0,z.env={},z.argv=[],z.version="",z.versions={},z.on=G,z.addListener=G,z.once=G,z.off=G,z.removeListener=G,z.removeAllListeners=G,z.emit=G,z.prependListener=G,z.prependOnceListener=G,z.listeners=function(t){return[]},z.binding=function(t){throw new Error("process.binding is not supported")},z.cwd=function(){return"/"},z.chdir=function(t){throw new Error("process.chdir is not supported")},z.umask=function(){return 0};var Z={};(function(t){(function(){"use strict";const e={};Z=e.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=e.Bench.now()}elapsed(){return e.Bench.now()-this.ts}static now(){const e=t.hrtime();return 1e3*e[0]+e[1]/1e6}}}).call(this)}).call(this,R);var Q=function(){},tt={};(function(t){(function(){"use strict";const e={mismatched:null};tt=function(t,r,n){return n=Object.assign({prototype:!0},n),!!e.isDeepEqual(t,r,n,[])},e.isDeepEqual=function(r,n,o,i){if(r===n)return 0!==r||1/r==1/n;const s=typeof r;if(s!==typeof n)return!1;if(null===r||null===n)return!1;if("function"===s){if(!o.deepFunction||r.toString()!==n.toString())return!1}else if("object"!==s)return r!=r&&n!=n;const u=e.getSharedType(r,n,!!o.prototype);switch(u){case T.buffer:return t&&t.prototype.equals.call(r,n);case T.promise:return r===n;case T.regex:return r.toString()===n.toString();case e.mismatched:return!1}for(let t=i.length-1;t>=0;--t)if(i[t].isSame(r,n))return!0;i.push(new e.SeenEntry(r,n));try{return!!e.isDeepEqualObj(u,r,n,o,i)}finally{i.pop()}},e.getSharedType=function(t,r,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(r)?e.mismatched:T.getInternalProto(t);const o=T.getInternalProto(t);return o!==T.getInternalProto(r)?e.mismatched:o},e.valueOf=function(t){const e=t.valueOf;if(void 0===e)return t;try{return e.call(t)}catch(t){return t}},e.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)},e.isSetSimpleEqual=function(t,e){for(const r of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,r))return!1;return!0},e.isDeepEqualObj=function(t,r,n,o,i){const{isDeepEqual:s,valueOf:u,hasOwnEnumerableProperty:a}=e,{keys:f,getOwnPropertySymbols:c}=Object;if(t===T.array){if(!o.part){if(r.length!==n.length)return!1;for(let t=0;t<r.length;++t)if(!s(r[t],n[t],o,i))return!1;return!0}for(const t of r)for(const e of n)if(s(t,e,o,i))return!0}else if(t===T.set){if(r.size!==n.size)return!1;if(!e.isSetSimpleEqual(r,n)){const t=new Set(Set.prototype.values.call(n));for(const e of Set.prototype.values.call(r)){if(t.delete(e))continue;let r=!1;for(const n of t)if(s(e,n,o,i)){t.delete(n),r=!0;break}if(!r)return!1}}}else if(t===T.map){if(r.size!==n.size)return!1;for(const[t,e]of Map.prototype.entries.call(r)){if(void 0===e&&!Map.prototype.has.call(n,t))return!1;if(!s(e,Map.prototype.get.call(n,t),o,i))return!1}}else if(t===T.error&&(r.name!==n.name||r.message!==n.message))return!1;const l=u(r),h=u(n);if((r!==l||n!==h)&&!s(l,h,o,i))return!1;const p=f(r);if(!o.part&&p.length!==f(n).length&&!o.skip)return!1;let y=0;for(const t of p)if(o.skip&&o.skip.includes(t))void 0===n[t]&&++y;else{if(!a(n,t))return!1;if(!s(r[t],n[t],o,i))return!1}if(!o.part&&p.length-y!==f(n).length)return!1;if(!1!==o.symbols){const t=c(r),e=new Set(c(n));for(const u of t){if(!o.skip||!o.skip.includes(u))if(a(r,u)){if(!a(n,u))return!1;if(!s(r[u],n[u],o,i))return!1}else if(a(n,u))return!1;e.delete(u)}for(const t of e)if(a(n,t))return!1}return!0},e.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}}).call(this)}).call(this,n({}).Buffer);var et,rt=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")};const nt={};var ot;et=function(t,e,r={}){return"object"!=typeof e&&(e=[e]),E(!Array.isArray(e)||e.length,"Values array cannot be empty"),"string"==typeof t?nt.string(t,e,r):Array.isArray(t)?nt.array(t,e,r):(E("object"==typeof t,"Reference must be string or an object"),nt.object(t,e,r))},nt.array=function(t,e,r){if(Array.isArray(e)||(e=[e]),!t.length)return!1;if(r.only&&r.once&&t.length!==e.length)return!1;let n;const o=new Map;for(const t of e)if(r.deep&&t&&"object"==typeof t){n=n||nt.compare(r);let e=!1;for(const[r,i]of o.entries())if(n(r,t)){++i.allowed,e=!0;break}e||o.set(t,{allowed:1,hits:0})}else{const e=o.get(t);e?++e.allowed:o.set(t,{allowed:1,hits:0})}let i=0;for(const e of t){let t;if(r.deep&&e&&"object"==typeof e){n=n||nt.compare(r);for(const[r,i]of o.entries())if(n(r,e)){t=i;break}}else t=o.get(e);if(t&&(++t.hits,++i,r.once&&t.hits>t.allowed))return!1}if(r.only&&i!==t.length)return!1;for(const t of o.values())if(t.hits!==t.allowed&&t.hits<t.allowed&&!r.part)return!1;return!!i},nt.object=function(t,e,r){E(void 0===r.once,"Cannot use option once with object");const n=I(t,r);if(!n.length)return!1;if(Array.isArray(e))return nt.array(n,e,r);const o=Object.getOwnPropertySymbols(e).filter((t=>e.propertyIsEnumerable(t))),i=[...Object.keys(e),...o],s=nt.compare(r),u=new Set(i);for(const o of n)if(u.has(o)){if(!s(e[o],t[o]))return!1;u.delete(o)}else if(r.only)return!1;return!u.size||!!r.part&&u.size<i.length},nt.string=function(t,e,r){if(""===t)return 1===e.length&&""===e[0]||!r.once&&!e.some((t=>""!==t));const n=new Map,o=[];for(const t of e)if(E("string"==typeof t,"Cannot compare string reference to non-string value"),t){const e=n.get(t);e?++e.allowed:(n.set(t,{allowed:1,hits:0}),o.push(rt(t)))}else if(r.once||r.only)return!1;if(!o.length)return!0;const i=new RegExp(`(${o.join("|")})`,"g"),s=t.replace(i,((t,e)=>(++n.get(e).hits,"")));if(r.only&&s)return!1;let u=!1;for(const t of n.values())if(t.hits&&(u=!0),t.hits!==t.allowed){if(t.hits<t.allowed&&!r.part)return!1;if(r.once)return!1}return!!u},nt.compare=function(t){if(!t.deep)return nt.shallow;const e=void 0!==t.only,r=void 0!==t.part,n={prototype:e?t.only:!!r&&!t.part,part:e?!t.only:!!r&&t.part};return(t,e)=>tt(t,e,n)},nt.shallow=function(t,e){return t===e};const it={};ot=function(t){if(!t)return"";let e="";for(let r=0;r<t.length;++r){const n=t.charCodeAt(r);it.isSafe(n)?e+=t[r]:e+=it.escapeHtmlChar(n)}return e},it.escapeHtmlChar=function(t){const e=it.namedHtml[t];return void 0!==e?e:t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`},it.isSafe=function(t){return void 0!==it.safeCharCodes[t]},it.namedHtml={38:"&",60:"<",62:">",34:""",160:" ",162:"¢",163:"£",164:"¤",169:"©",174:"®"},it.safeCharCodes=function(){const t={};for(let e=32;e<123;++e)(e>=97||e>=65&&e<=90||e>=48&&e<=57||32===e||46===e||44===e||45===e||58===e||95===e)&&(t[e]=null);return t}();const st={};var ut,at=st.flatten=function(t,e){const r=e||[];for(let e=0;e<t.length;++e)Array.isArray(t[e])?st.flatten(t[e],r):r.push(t[e]);return r};const ft={};ut=function(t,e,r={}){if(!t||!e)return r.first?null:[];const n=[],o=Array.isArray(t)?new Set(t):t,i=new Set;for(const t of e)if(ft.has(o,t)&&!i.has(t)){if(r.first)return t;n.push(t),i.add(t)}return r.first?null:n},ft.has=function(t,e){return"function"==typeof t.has?t.has(e):void 0!==t[e]};var ct={};ct.applyToDefaults=C,ct.assert=E,ct.Bench=Z,ct.block=function(){return new Promise(Q)},ct.clone=M,ct.contain=et,ct.deepEqual=tt,ct.Error=w,ct.escapeHeaderAttribute=function(t){return E(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(t),"Bad attribute value ("+t+")"),t.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')},ct.escapeHtml=ot,ct.escapeJson=function(t){if(!t)return"";let e;return t.replace(/[<>&\u2028\u2029]/g,(t=>60===(e=t.charCodeAt(0))?"\\u003c":62===e?"\\u003e":38===e?"\\u0026":8232===e?"\\u2028":"\\u2029"))},ct.escapeRegex=rt,ct.flatten=at,ct.ignore=Q,ct.intersect=ut,ct.isPromise=function(t){return!!t&&"function"==typeof t.then},ct.merge=P,ct.once=function(t){if(t._hoekOnce)return t;let e=!1;const r=function(...r){e||(e=!0,t(...r))};return r._hoekOnce=!0,r},ct.reach=b,ct.reachTemplate=function(t,e,r){return e.replace(/{([^{}]+)}/g,((e,n)=>{const o=b(t,n,r);return null==o?"":o}))},ct.stringify=m,ct.wait=function(t,e){if("number"!=typeof t&&void 0!==t)throw new TypeError("Timeout must be a number");return new Promise((r=>setTimeout(r,t,e)))};var lt={exports:{}};(function(t){(function(){!function(e){"object"==typeof lt.exports?lt.exports=e():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).Nua=e()}((function(){return function(t,e,r){var n=(r=r||{}).depth||Number.MAX_VALUE,o=r.setter,i=!!r.preserve;"object"==typeof t&&"object"==typeof e&&function t(e,r,s){if(!(null==e||null==r||n<=s)){var u=s+1;if(Array.isArray(e)&&Array.isArray(r)){for(var a=0;a<e.length;a++)"object"==typeof e[a]?t(e[a],r[a],u):o?o(e,a,r[a]):e[a]=r[a];for(;a<r.length;a++)o?o(e,a,r[a]):e[a]=r[a];e.splice(r.length)}else{for(var f=Object.keys(e),c=0;c<f.length;c++){var l=e[f[c]],h=r[f[c]];"object"==(null===l?"null":typeof l)&&"object"==(null===h?"null":typeof h)?t(l,h,u):void 0===h?i||delete e[f[c]]:o?o(e,f[c],h):e[f[c]]=h}for(var p=Object.keys(r),y=0;y<p.length;y++)void 0===e[p[y]]&&(o?(o(e,p[y],r[p[y]]),null==r[p[y]]||!Array.isArray(r[p[y]])&&"object"!=typeof r[p[y]]||t(e[p[y]],r[p[y]],u)):e[p[y]]=r[p[y]])}}}(t,e,0)}}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),lt=lt.exports;var ht={},pt=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),yt=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gt=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&pt(e,t,r);return yt(e,t),e},dt=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ht,"__esModule",{value:!0}),ht.LegacyOrdu=ht.Task=ht.Ordu=void 0;const vt=gt(ct),mt=dt(lt);class wt{constructor(t){var e;this.runid=null==t.id?(""+Math.random()).substring(2):t.id,this.name=t.name||"task"+wt.count++,this.before=t.before,this.after=t.after,this.exec=t.exec||(t=>{}),this.if=t.if||void 0,this.active=null==t.active||t.active,this.meta=Object.assign(t.meta||{},{when:Date.now(),from:null===(e=t.meta)||void 0===e?void 0:e.from})}}ht.Task=wt,wt.count=0;class bt{constructor(t,e,r,n){this.op="not-defined",this.task=t,this.name=t.name,this.start=Date.now(),this.end=Number.MAX_SAFE_INTEGER,this.index=e,this.total=r,this.async=!1,this.runid=n}update(t){t=null==t?{}:t,this.out=null==t.out?{}:t.out,this.err=t instanceof Error?t:t.err,this.op=null!=this.err?"stop":"string"==typeof t.op?t.op:"next",this.why=t.why||""}}function Et(t,e){for(var r=0;r<e.length;++r)if(-1===t.indexOf(e[r]))return!1;return!0}return ht.Ordu=class extends o.EventEmitter{constructor(t){super(),this.task={},this._opts={debug:!1,...t},this._tasks=[],this._operator_map={next:()=>({stop:!1}),skip:()=>({stop:!1}),stop:(t,e,r)=>((0,mt.default)(r,t.out,{preserve:!0}),{stop:!0,err:t.err}),merge:(t,e,r)=>((0,mt.default)(r,t.out,{preserve:!0}),{stop:!1})}}operator(t,e){let r="string"==typeof t?t:t.name;this._operator_map[r]=e||t}operators(){return this._operator_map}add(t,e){let r;var n;if(this._opts.debug&&(r=null==(n=new Error)?[]:(n.stack||"").split(/\n/).slice(4).map((t=>t.substring(4)))),"function"==typeof t){let n=e=e||{};n.exec=t,n.name=t.name?t.name:n.name,this._add_task(n,r)}else if(Array.isArray(t))for(var o=0;o<t.length;o++){let e=t[o];"function"==typeof t[o]&&(e={name:t[o].name,exec:t[o]}),this._add_task(e,r)}else this._add_task(t,r);return this}_add_task(t,e){e&&(t.meta=t.meta||{},t.meta.from=Object.assign(t.meta.from||{},{callpoint$:e}));let r=new wt(t),n=0;for(;n<this._tasks.length&&(null==r.before||this._tasks[n].name!==r.before);n++)if(null!=r.after&&this._tasks[n].name===r.after){n++;break}this._tasks.splice(n,0,r),this.task[r.name]=r}execSync(t,e,r){return this._execImpl(t,e,r)}async exec(t,e,r){return new Promise((n=>{this._execImpl(t,e,r,n)}))}_execImpl(t,e,r,n){const o=this;let i,s=(r=null==r?{}:r).runid||(Math.random()+"").substring(2),u=Date.now(),a=[...o._tasks],f={ctx:t||{},data:e||{}},c=[],l=0,h=0;return p(0);function p(t){if(t>=a.length){let t=function(){let t=i?i.err:null,e={tasklog:c,task:t?a[h]:void 0,taskcount:l,tasktotal:a.length,start:u,end:Date.now(),err:t,data:f.data};return r.done&&r.done(e),e}();return n?n(t):t}h=t;let e,p,g=a[t],d=new bt(g,t,a.length,s);if(g.active&&o._task_if(g,f.data))try{l++;let r=Object.assign({task:g},f);(e=g.exec(r))instanceof Promise?(d.async=!0,e.then((t=>p=t)).catch((t=>p=t)).finally((()=>y(t,g,p,d)))):p=e}catch(t){p=t}else p={op:"skip"};if(!d.async)return y(t,g,p,d)}function y(t,e,r,n){n.end=Date.now(),n.update(r),o.emit("task-result",n);let i={stop:!1,err:void 0,async:!1};try{let r=o._operate(n,f.ctx,f.data);r instanceof Promise?(i.async=!0,r.then((t=>{Object.assign(i,t)})).catch((t=>{i.stop=!0,i.err=t})).finally((()=>{g(t,e,n,i)}))):(i=r).async=!1}catch(t){i.stop=!0,i.err=t}if(!i.async)return g(t,e,n,i)}function g(t,e,r,n){i=n;let s={name:e.name,op:r.op,task:e,result:r,operate:n,data:o._opts.debug?JSON.parse(JSON.stringify(f.data)):void 0};return c.push(s),o.emit("task-end",s),n.stop?t=a.length:++t,p(t)}}tasks(){return[...this._tasks]}_operate(t,e,r){if(t.err)return{stop:!0,err:t.err,async:!1};let n=this._operator_map[t.op];return n?n(t,e,r):{stop:!0,err:new Error("Unknown operation: "+t.op),async:!1}}_task_if(t,e){if(t.if){let r=t.if;return Object.keys(r).reduce(((t,n)=>{let o=vt.reach(e,n);return t&&vt.contain({$:o},{$:r[n]},{deep:!0})}),!0)}return!0}},ht.LegacyOrdu=function(t){var e={};(t=t||{}).name=t.name||"ordu0",e.add=function(n,o){return(o=o||n).name||Object.defineProperty(o,"name",{value:t.name+"_task"+r.length}),o.tags=n.tags||[],r.push(o),e},e.process=function(){var t=arguments.length,e=0<t&&arguments[--t],n=0<t&&arguments[--t],o=0<t&&arguments[--t];e=e||{},n=n||{},(o=o||{}).tags=o.tags||[];for(var i=0;i<r.length;++i){var s=r[i];if(!(0<o.tags.length)||Et(s.tags,o.tags)){var u=i,a=s.name;n.index$=u,n.taskname$=a;var f=s(n,e);if(f)return f.index$=u,f.taskname$=a,f.ctxt$=n,f.data$=e,f}}return null},e.tasknames=function(){return r.map((function(t){return t.name}))},e.taskdetails=function(){return r.map((function(t){return t.name+":{tags:"+t.tags+"}"}))},e.toString=function(){return t.name+":["+e.tasknames()+"]"};var r=[];return e},ht}));
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$orduMin_104 = _$orduMin_104.exports
var _$fastSafeStringify_67 = {};
_$fastSafeStringify_67=__stringify_67,__stringify_67.default=__stringify_67,__stringify_67.stable=deterministicStringify,__stringify_67.stableStringify=deterministicStringify;var LIMIT_REPLACE_NODE="[...]",CIRCULAR_REPLACE_NODE="[Circular]",arr=[],replacerStack=[];function defaultOptions(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function __stringify_67(e,r,t,i){var n;void 0===i&&(i=defaultOptions()),decirc(e,"",0,[],void 0,0,i);try{n=0===replacerStack.length?JSON.stringify(e,r,t):JSON.stringify(e,replaceGetterValues(r),t)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==arr.length;){var c=arr.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return n}function setReplace(e,r,t,i){var n=Object.getOwnPropertyDescriptor(i,t);void 0!==n.get?n.configurable?(Object.defineProperty(i,t,{value:e}),arr.push([i,t,r,n])):replacerStack.push([r,t,e]):(i[t]=e,arr.push([i,t,r]))}function decirc(e,r,t,i,n,c,a){var o;if(c+=1,"object"==typeof e&&null!==e){for(o=0;o<i.length;o++)if(i[o]===e)return void setReplace(CIRCULAR_REPLACE_NODE,e,r,n);if(void 0!==a.depthLimit&&c>a.depthLimit)return void setReplace(LIMIT_REPLACE_NODE,e,r,n);if(void 0!==a.edgesLimit&&t+1>a.edgesLimit)return void setReplace(LIMIT_REPLACE_NODE,e,r,n);if(i.push(e),Array.isArray(e))for(o=0;o<e.length;o++)decirc(e[o],o,o,i,e,c,a);else{var l=Object.keys(e);for(o=0;o<l.length;o++){var f=l[o];decirc(e[f],f,o,i,e,c,a)}}i.pop()}}function compareFunction(e,r){return e<r?-1:e>r?1:0}function deterministicStringify(e,r,t,i){void 0===i&&(i=defaultOptions());var n,c=deterministicDecirc(e,"",0,[],void 0,0,i)||e;try{n=0===replacerStack.length?JSON.stringify(c,r,t):JSON.stringify(c,replaceGetterValues(r),t)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==arr.length;){var a=arr.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return n}function deterministicDecirc(e,r,t,i,n,c,a){var o;if(c+=1,"object"==typeof e&&null!==e){for(o=0;o<i.length;o++)if(i[o]===e)return void setReplace(CIRCULAR_REPLACE_NODE,e,r,n);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==a.depthLimit&&c>a.depthLimit)return void setReplace(LIMIT_REPLACE_NODE,e,r,n);if(void 0!==a.edgesLimit&&t+1>a.edgesLimit)return void setReplace(LIMIT_REPLACE_NODE,e,r,n);if(i.push(e),Array.isArray(e))for(o=0;o<e.length;o++)deterministicDecirc(e[o],o,o,i,e,c,a);else{var l={},f=Object.keys(e).sort(compareFunction);for(o=0;o<f.length;o++){var s=f[o];deterministicDecirc(e[s],s,o,i,e,c,a),l[s]=e[s]}if(void 0===n)return l;arr.push([n,r,e]),n[r]=l}i.pop()}}function replaceGetterValues(e){return e=void 0!==e?e:function(e,r){return r},function(r,t){if(replacerStack.length>0)for(var i=0;i<replacerStack.length;i++){var n=replacerStack[i];if(n[1]===r&&n[0]===t){t=n[2],replacerStack.splice(i,1);break}}return e.call(this,r,t)}}
"use strict";function hasKey(t,o){var n=t;return o.slice(0,-1).forEach((function(t){n=n[t]||{}})),o[o.length-1]in n}function isNumber(t){return"number"==typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t))}function isConstructorOrProto(t,o){return"constructor"===o&&"function"==typeof t[o]||"__proto__"===o}var _$minimist_93=function(t,o){o||(o={});var n={bools:{},strings:{},unknownFn:null};"function"==typeof o.unknown&&(n.unknownFn=o.unknown),"boolean"==typeof o.boolean&&o.boolean?n.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach((function(t){n.bools[t]=!0}));var r={};function e(t){return r[t].some((function(t){return n.bools[t]}))}Object.keys(o.alias||{}).forEach((function(t){r[t]=[].concat(o.alias[t]),r[t].forEach((function(o){r[o]=[t].concat(r[t].filter((function(t){return o!==t})))}))})),[].concat(o.string).filter(Boolean).forEach((function(t){n.strings[t]=!0,r[t]&&[].concat(r[t]).forEach((function(t){n.strings[t]=!0}))}));var s=o.default||{},i={_:[]};function c(t,o,r){for(var e=t,s=0;s<o.length-1;s++){var i=o[s];if(isConstructorOrProto(e,i))return;void 0===e[i]&&(e[i]={}),e[i]!==Object.prototype&&e[i]!==Number.prototype&&e[i]!==String.prototype||(e[i]={}),e[i]===Array.prototype&&(e[i]=[]),e=e[i]}var c=o[o.length-1];isConstructorOrProto(e,c)||(e!==Object.prototype&&e!==Number.prototype&&e!==String.prototype||(e={}),e===Array.prototype&&(e=[]),void 0===e[c]||n.bools[c]||"boolean"==typeof e[c]?e[c]=r:Array.isArray(e[c])?e[c].push(r):e[c]=[e[c],r])}function a(t,o,e){if(!e||!n.unknownFn||function(t,o){return n.allBools&&/^--[^=]+$/.test(o)||n.strings[t]||n.bools[t]||r[t]}(t,e)||!1!==n.unknownFn(e)){var s=!n.strings[t]&&isNumber(o)?Number(o):o;c(i,t.split("."),s),(r[t]||[]).forEach((function(t){c(i,t.split("."),s)}))}}Object.keys(n.bools).forEach((function(t){a(t,void 0!==s[t]&&s[t])}));var l=[];-1!==t.indexOf("--")&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var u,p,b=t[f];if(/^--.+=/.test(b)){var h=b.match(/^--([^=]+)=([\s\S]*)$/);u=h[1];var y=h[2];n.bools[u]&&(y="false"!==y),a(u,y,b)}else if(/^--no-.+/.test(b))a(u=b.match(/^--no-(.+)/)[1],!1,b);else if(/^--.+/.test(b))u=b.match(/^--(.+)/)[1],void 0===(p=t[f+1])||/^(-|--)[^-]/.test(p)||n.bools[u]||n.allBools||r[u]&&e(u)?/^(true|false)$/.test(p)?(a(u,"true"===p,b),f+=1):a(u,!n.strings[u]||"",b):(a(u,p,b),f+=1);else if(/^-[^-]+/.test(b)){for(var v=b.slice(1,-1).split(""),g=!1,d=0;d<v.length;d++)if("-"!==(p=b.slice(d+2))){if(/[A-Za-z]/.test(v[d])&&"="===p[0]){a(v[d],p.slice(1),b),g=!0;break}if(/[A-Za-z]/.test(v[d])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){a(v[d],p,b),g=!0;break}if(v[d+1]&&v[d+1].match(/\W/)){a(v[d],b.slice(d+2),b),g=!0;break}a(v[d],!n.strings[v[d]]||"",b)}else a(v[d],p,b);u=b.slice(-1)[0],g||"-"===u||(!t[f+1]||/^(-|--)[^-]/.test(t[f+1])||n.bools[u]||r[u]&&e(u)?t[f+1]&&/^(true|false)$/.test(t[f+1])?(a(u,"true"===t[f+1],b),f+=1):a(u,!n.strings[u]||"",b):(a(u,t[f+1],b),f+=1))}else if(n.unknownFn&&!1===n.unknownFn(b)||i._.push(n.strings._||!isNumber(b)?b:Number(b)),o.stopEarly){i._.push.apply(i._,t.slice(f+1));break}}return Object.keys(s).forEach((function(t){hasKey(i,t.split("."))||(c(i,t.split("."),s[t]),(r[t]||[]).forEach((function(o){c(i,o.split("."),s[t])})))})),o["--"]?i["--"]=l.slice():l.forEach((function(t){i._.push(t)})),i};
var _$print_126 = {};
"use strict";Object.defineProperty(_$print_126,"__esModule",{value:!0}),_$print_126.Print=Print;/* removed: var _$minimist_93=require("minimist"); */;function Print(n,i){var t=_$minimist_93(i.slice(2)),r=t.seneca;n.root.argv=r,t.seneca&&r.print&&r.print.options&&n.options({debug:{print:{options:!0}}})}function print_options(n,i){i.debug.print.options&&(n.private$.print.log("\nSeneca Options ("+n.id+"): before plugins\n===\n"),n.private$.print.log(_$util_145.inspect(i,{depth:i.debug.print.depth})),n.private$.print.log(""))}function print_reply(n,i){n?internal_err("ERROR: "+n.message):internal_log(_$util_145.inspect(i,{depth:this&&this.options?this.options().debug.print.depth:null}))}function internal_log(...n){var i=console.log;i.apply(i,n)}function internal_err(...n){console.error.apply(console.error,n)}function plugin_options(n,i,t){n.private$.print.log("\nSeneca Options ("+n.id+"): plugin: "+i+"\n===\n"),n.private$.print.log(_$util_145.inspect(t,{depth:n.options().debug.print.depth})),n.private$.print.log("")}Object.assign(Print,{print_options:print_options,internal_log:internal_log,internal_err:internal_err,plugin_options:plugin_options,print:print_reply});
var _$errors_118 = {};
"use strict";Object.defineProperty(_$errors_118,"__esModule",{value:!0}),_$errors_118.default={test_msg:"Test message.",test_args:"Test args <%=arg0%> <%=arg1%>.",test_prop:"TESTING: exists: <%=exists%>, notfound:<%=notfound%>, str=<%=str%>, obj=<%=obj%>, arr=<%=arr%>, bool=<%=bool%>, null=<%=null$%>, delete=<%=delete$%>, undefined=<%=undefined$%>, void=<%=void$%>, NaN=<%=NaN$%>",add_string_pattern_syntax:'Could not add action due to syntax error in pattern string: "<%=argstr%>": Line:<%=line%>, Column:<%=col%>; <%=syntax%>',act_string_args_syntax:'Could execute action due to syntax error in argument string: "<%=argstr%>": Line:<%=line%>, Column:<%=col%>; <%=syntax%>',add_pattern_object_expected_after_string_pattern:'Could not add action; unexpected argument; a pattern object or function should follow the pattern string; arguments were: "<%=args%>".',add_pattern_object_expected:'Could not add action; unexpected argument; a pattern object or string should be the first argument; arguments were: "<%=args%>".',add_action_function_expected:'Could not add action: the action function should appear after the pattern; arguments were: "<%=args%>".',add_action_metadata_not_an_object:"Could not add action: the argument after the action function should be a metadata object: <%=actdef%>.",add_empty_pattern:'Could not add action, as the action pattern is empty: "<%=args%>"',act_if_expects_boolean:'The method act_if expects a boolean value as its first argument, was: "<%=first%>".',act_not_found:"No matching action pattern found for <%=args%>, and no default result provided (using a default$ property).",act_default_bad:"No matching action pattern found for <%=args%>, and default result is not a plain object or an array: <%=xdefault%>.",act_no_args:'No action pattern defined in "<%=args%>"; the first argument should be a string or object pattern.',act_invalid_msg:"Action <%=pattern%> received an invalid message; <%=message%>; message content was: <%=msg%>.",act_execute:"Action <%=pattern%> failed: <%=message%>.",act_callback:"Action <%=pattern%> callback threw: <%=message%>.",act_loop:"Action <%=pattern%> loops back on itself. Action details: <%=actdef%>, history: <%=history%>",result_not_objarr:"Action <%=pattern%> responded with result that was not an object or array: <%=result%>; Use option strict:{result:false} to allow; arguments were: <%=args%>",no_client:'Transport client was not created; arguments were: "<%=args%>".',invalid_options:"Invalid options; <%=message%>",plugin_required:"The <%=name%> plugin depends on the <%=dependency%> plugin, which is not loaded yet.",plugin_init:"The <%=name%> plugin failed to initialize: <%=plugin_error%>.",plugin_init_timeout:'The <%=name%> plugin failed to initialize within <%=timeout%> milliseconds (The init:<%=name%> action did not call the "done" callback in time).',export_not_found:"The export <%=key%> has not been defined by a plugin.",store_cmd_missing:'Entity data store implementation is missing a command; "<%=cmd%>": "<%=store%>".',sub_inward_action_failed:"Subscription action on inward pattern <%=pattern%> threw: <%=errmsg%> at <%=errline%> on message data: <%=msg%>. To start debugging, find the `seneca.sub` method call that defines the subscription action, and review the code of the action function.",sub_outward_action_failed:"Subscription action on outward pattern <%=pattern%> threw: <%=errmsg%> at <%=errline%> on message data: <%=msg%>. To start debugging, find the `seneca.sub` method call that defines the subscription action, and review the code of the action function.",ready_failed:"Ready function failed: <%=message%>",unknown_message_reply:"Reply for message <%=id%> failed as message is unknown: <%=args%>",maxparents:"Message has too many parent messages (<%=maxparents%>). There may be an infinite loop. Parents: <%=parents%>, Message: <%=args%>",plugin_define_failed:"The definition action for the plugin <%=fullname%> has failed: <%=message%>. This error is considered fatal as all plugins have to initialize correctly. You should test the plugin by itself to verify that it is working correctly. Also ensure that the configuration options passed to the plugin are correct. These are shown below under in the DETAILS section. There could also be a bug in the plugin. If you think that is the case, please create a github issue on the plugin's repository<%=repo%>, and include this error report.",no_transport_client:"The transport client defined by <%=config%> does not exist for message: <%=msg%>",invalid_plugin_option:"Plugin <%=name%>: option value is not valid: <%=err_msg%> in options <%=options%>",no_prior_action:"The `prior` method must be called inside an action function. Arguments were: <%=args%>",missing_plugin_name:"The plugin name string was missing or empty.",bad_plugin_name:"The plugin name string cannot be empty and must be alphanumeric (matching /^[a-zA-Z][a-zA-Z0-9_]*$/), and cannot be longer than 1024 characters. Name was '<%=name.substring(0,1032)%>'.",bad_plugin_tag:"The plugin tag string, if defined, must be alphanumeric (matching /^[a-zA-Z0-9_]+$/), and cannot be longer than 1024 characters. Name was '<%=name.substring(0,1032)%>', and tag was '<%=tag.substring(0,1032)%>'.",bad_jsonic:"Data string provided in Jsonic format (https://github.com/rjrodger/jsonic) has a syntax error: <%=syntax%> (line:<%=line%>, col:<%=col%>); original: <%=argstr%>",no_error_code:"The Seneca.error or Seneca.fail method was called without an error code string as first argument.",fail_wrong_number_of_args:"The Seneca.fail method was called with the wrong number of arguments: <%=num_args%>",fail_cond_must_be_bool:"The Seneca.fail method expected the `cond` param to be a boolean.",action_timeout:"<%=legacy_string%>Action <%=pattern%> timed out. Timeout was: <%=timeout%> (start: <%=start%>, end: <%=end%>. Message was: <%=message%>.",use_no_args:"The seneca.use method needs at least one argument to define a plugin.",act_invalid_args:"Action <%=pattern%> has invalid arguments; <%=message%>; arguments were: <%=msg%>.",deprecation:{}};
var _$common_117 = {};
(function (process){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_$common_117,"__esModule",{value:!0}),_$common_117.TRACE_ACTION=_$common_117.TRACE_SYNC=_$common_117.TRACE_END=_$common_117.TRACE_START=_$common_117.TRACE_VERSION=_$common_117.TRACE_TAG=_$common_117.TRACE_INSTANCE=_$common_117.TRACE_ID=_$common_117.TRACE_PATTERN=_$common_117.error=_$common_117.tagnid=_$common_117.print=void 0,_$common_117.pins=pins,_$common_117.promiser=promiser,_$common_117.stringify=stringify,_$common_117.wrap_error=wrap_error,_$common_117.make_plugin_key=make_plugin_key,_$common_117.parse_jsonic=parse_jsonic,_$common_117.pattern=pattern,_$common_117.pincanon=pincanon,_$common_117.noop=noop,_$common_117.clean=clean,_$common_117.deep=deep,_$common_117.each=each,_$common_117.makedie=makedie,_$common_117.make_standard_act_log_entry=make_standard_act_log_entry,_$common_117.make_standard_err_log_entry=make_standard_err_log_entry,_$common_117.resolve_option=resolve_option,_$common_117.autoincr=autoincr,_$common_117.make_callpoint=make_callpoint,_$common_117.make_trace_desc=make_trace_desc,_$common_117.history=history,_$common_117.inspect=inspect,_$common_117.msgstr=msgstr,_$common_117.jsonic_stringify=jsonic_stringify;const util_1=__importDefault(_$util_145),fast_safe_stringify_1=__importDefault(_$fastSafeStringify_67),jsonic_next_1=__importDefault(_$jsonicMin_1),nid_1=__importDefault(_$nidMin_94),{Print:Print}=_$print_126,errors_1=__importDefault(_$errors_118),error=_$common_117.error=_$common_117.eraro=_$eraro_13({package:"seneca",msgmap:errors_1.default,override:!0});function pins(t){return(Array.isArray(t)?t:[t]).reduce(((t,e)=>(t.push("string"==typeof e?e.split(";").map((t=>(0,jsonic_next_1.default)(t))):e),t)),[]).filter((t=>null!=t)).flat()}function promiser(t,e){return e="function"==typeof t&&null==e?t:e.bind(t),new Promise(((t,r)=>{e(((e,n)=>e?r(e):t(n)))}))}function stringify(...t){return fast_safe_stringify_1.default(...t)}function wrap_error(t){throw t.seneca?t:error.call(null,...arguments)}function make_plugin_key(t,e){if(null==t)throw error("missing_plugin_name");let r=null==t.name?t:t.name,n=null==t.tag?null==e?"":e:t.tag;if("number"==typeof r&&(r=""+r),"number"==typeof n&&(n=""+n),""==r||"string"!=typeof r)throw error("bad_plugin_name",{name:r});let i=r.match(/^([a-zA-Z@][a-zA-Z0-9.~_\-/]*)\$([a-zA-Z0-9.~_-]+)$/);if(i&&(r=i[1],n=i[2]),!r.match(/^(\.|\/|\\|\w:)/)&&(!r.match(/^[a-zA-Z@][a-zA-Z0-9.~_\-/]*$/)||1024<r.length))throw error("bad_plugin_name",{name:r});if(""!=n&&(!n.match(/^[a-zA-Z0-9.~_-]+$/)||1024<n.length))throw error("bad_plugin_tag",{tag:n});return r+(n?"$"+n:"")}_$common_117.error=error;const tagnid=(0,nid_1.default)({length:3,alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ"});function parse_jsonic(t,e){e=e||"bad_jsonic";try{return null==t?null:(0,jsonic_next_1.default)(t)}catch(r){throw error(e,{argstr:t,syntax:r.message,line:r.lineNumber,col:r.columnNumber})}}function pattern(t){if("string"==typeof t)return t;t=t||{};let e=[];return Object.keys(t).forEach((r=>{let n=t[r];~r.indexOf("$")||"function"==typeof n||"object"==typeof n||e.push(r+":"+n)})),e.sort(),e.join(",")}function pincanon(t){if("string"==typeof t)return pattern((0,jsonic_next_1.default)(t));if(Array.isArray(t)){let e=t.map(pincanon);return e.sort(),e.join(";")}return pattern(t)}function noop(){}function clean(t,e){if(null==t)return t;let r=Array.isArray(t)?[]:{},n=Object.getOwnPropertyNames(t);for(let e=0;e<n.length;e++){let i=n[e];"$"!=i[i.length-1]&&(r[i]=t[i])}return r}function deep(...t){return(t=t.reverse()).unshift({}),_$lodashDefaultsdeep_90.apply(null,t)}_$common_117.tagnid=tagnid;const print=Print.print;function each(t,e){return null==t||null==e?null:Array.isArray(t)?t.forEach(e):void Object.keys(t).forEach((r=>e(t[r],r)))}function makedie(t,e){e=Object.assign(e,t.die?t.die.context:{});let r=0,n=function(n){let i=t.options(),s=i.test,o=i.debug&&i.debug.undead||n&&n.undead,a=i.debug&&i.debug.print&&"full"===i.debug.print.fatal||!1,l=i.debug&&i.debug.print.env||!1;if(0<r){if(!o)throw error(n,"[DEATH LOOP] die count: "+r)}else{r++;try{n?i.error.identify(n)||(n=new Error("string"==typeof n?n:inspect(n))):n=new Error("unknown"),n.fatal$=!0;let r={kind:e.txt||"fatal",level:e.level||"fatal",plugin:e.plugin,tag:e.tag,id:e.id,code:n.code||"fatal",notice:n.message,err:n,callpoint:e.callpoint&&e.callpoint()};t.log.fatal(r);let c=n.stack||"";c=c.substring(c.indexOf("\n")+5).replace(/\n\s+/g,"\n ");let p="pid="+process.pid+", arch="+process.arch+", platform="+process.platform+(a?", path="+process.execPath:"")+", argv="+inspect(process.argv).replace(/\n/g,"")+(a&&l?", env="+inspect(process.env).replace(/\n/g,""):""),u=new Date,_=null,f="\n\n=== SENECA FATAL ERROR ===\nMESSAGE ::: "+n.message+"\nCODE ::: "+n.code+"\nINSTANCE ::: "+t.toString()+"\nDETAILS ::: "+inspect(a?n.details:(_=clean(n.details)||{},delete _.instance,_),{depth:i.debug.print.depth}).replace(/\n/g,"\n ")+"\nSTACK ::: "+c+"\nWHEN ::: "+u.toISOString()+", "+u.getTime()+"\nLOG ::: "+jsonic_stringify(r)+"\nNODE ::: "+process.version+", "+process.title+(a?", "+inspect(process.versions).replace(/\s+/g," ")+", "+inspect(process.features).replace(/\s+/g," ")+", "+inspect(process.moduleLoadList).replace(/\s+/g," "):"")+"\nPROCESS ::: "+p+"\nFOLDER ::: "+process.env.PWD;if(i.errhandler&&i.errhandler.call(t,n),t.flags.closed)return;if(o||(t.act("sys:seneca,info:fatal,closing$:true",{err:n}),t.close((function(e){o||process.nextTick((function(){e&&t.log.fatal({kind:"close",err:inspect(e)}),s&&(e&&Print.internal_err(e),Print.internal_err(f),Print.internal_err("\nSENECA TERMINATED at "+(new Date).toISOString()+". See above for error report.\n")),i.system.exit(1)}))}))),!o){let e=setTimeout((function(){t.log.fatal({kind:"close",timeout:!0}),i.test&&(Print.internal_err(f),Print.internal_err("\n\nSENECA TERMINATED (on timeout) at "+(new Date).toISOString()+".\n\n")),i.system.exit(2)}),i.death_delay);e.unref&&e.unref()}}catch(t){if(this.log.fatal({kind:"panic",panic:inspect(t),orig:arguments[0]}),i.test){let e="\n\nSeneca Panic\n============\n\n"+t.stack+"\n\nOriginal Error:\n"+(arguments[0]&&arguments[0].stack?arguments[0].stack:arguments[0]);Print.internal_err(e)}}}};return n.context=e,n}function make_standard_act_log_entry(t,e,r,n,i){let s=n.transport$||{},o=r||e.meta$||{},a=o.prior||{};return t=t||{},Object.assign({actid:o.id,msg:e,meta:r,entry:a.entry,prior:a.chain,gate:n.gate$,caller:n.caller$,actdef:t,client:t.client,listen:!!s.origin,transport:s},i)}function make_standard_err_log_entry(t,e){if(!t)return e;return t.details&&e&&e.caller&&(t.details.caller=e.caller),Object.assign({notice:t.message,code:t.code,err:t},e)}function resolve_option(t,e){return"function"==typeof t?t(e):t}function autoincr(){let t=0;return function(){return t++}}function inspect(t,e){return util_1.default.inspect(t,e)}function make_callpoint(t){return function(e){return t||e?error.callpoint(new Error,["/ordu.js","/seneca/seneca.js","/seneca/lib/","/lodash.js"]):void 0}}function make_trace_desc(t){return[t.pattern,t.id,t.instance,t.tag,t.version,t.start,t.end,t.sync,t.action]}function msgstr(t,e=111){let r=inspect(clean(t)).replace(/\n/g,"");return r=r.substring(0,e)+(e<r.length?"...":""),r}function jsonic_strify(t,e,r){if(r++,null==t)return"null";var n=Object.prototype.toString.call(t).charAt(8);if("F"===n&&!e.showfunc)return null;if(e.custom){if(Object.prototype.hasOwnProperty.call(t,"toString"))return t.toString();if(Object.prototype.hasOwnProperty.call(t,"inspect"))return t.inspect()}var i,s,o,a=0;if("N"===n)return isNaN(t)?"null":t.toString();if("O"===n){if(i=[],r<=e.depth){s=0;for(let n in t){if(s>=e.maxitems)break;var l=!0;for(o=0;o<e.exclude.length&&l;o++)l=!~n.indexOf(e.exclude[o]);l=l&&!e.omit[n];let a=jsonic_strify(t[n],e,r);if(null!=a&&l){var c=n.match(/^[a-zA-Z0-9_$]+$/)?n:JSON.stringify(n);i.push(c+":"+a),s++}}}return"{"+i.join(",")+"}"}if("A"===n){if(i=[],r<=e.depth)for(;a<t.length&&a<e.maxitems;a++){let n=jsonic_strify(t[a],e,r);null!=n&&i.push(n)}return"["+i.join(",")+"]"}var p=t.toString();return(~" \"'\r\n\t,}]".indexOf(p[0])||!~p.match(/,}]/)||~" \r\n\t".indexOf(p[p.length-1]))&&(p="'"+p.replace(/'/g,"\\'")+"'"),p}function jsonic_stringify(t,e){try{e=e||{};var r={};r.showfunc=e.showfunc||e.f||!1,r.custom=e.custom||e.c||!1,r.depth=e.depth||e.d||3,r.maxitems=e.maxitems||e.mi||11,r.maxchars=e.maxchars||e.mc||111,r.exclude=e.exclude||e.x||["$"];var n=e.omit||e.o||[];r.omit={};for(var i=0;i<n.length;i++)r.omit[n[i]]=!0;var s=jsonic_strify(t,r,0);return s=null==s?"":s.substring(0,r.maxchars)}catch(e){return"ERROR: jsonic_stringify: "+e+" input was: "+JSON.stringify(t)}}_$common_117.print=print;const TRACE_PATTERN=0;_$common_117.TRACE_PATTERN=0;const TRACE_ID=1;_$common_117.TRACE_ID=1;const TRACE_INSTANCE=2;_$common_117.TRACE_INSTANCE=2;const TRACE_TAG=3;_$common_117.TRACE_TAG=3;const TRACE_VERSION=4;_$common_117.TRACE_VERSION=4;const TRACE_START=5;_$common_117.TRACE_START=5;const TRACE_END=6;_$common_117.TRACE_END=6;const TRACE_SYNC=7;_$common_117.TRACE_SYNC=7;const TRACE_ACTION=8;function history(t){return new ActHistory(t)}_$common_117.TRACE_ACTION=8;class ActHistory{constructor(t){this._total=0,this._list=[],this._map={};let e=this;(t=t||{}).prune&&(this._prune_interval=setInterval((function(){e.prune(Date.now())}),t.interval||100),this._prune_interval.unref&&this._prune_interval.unref())}stats(){return{total:this._total}}add(t){this._map[t.id]=t;let e=this._list.length-1;e<0||this._list[e].timelimit<=t.timelimit?this._list.push(t):(e=this.place(t.timelimit),this._list.splice(e,0,t))}place(t){let e=this._list.length,r=0,n=e;if(0===this._list.length)return 0;do{if(e=Math.floor((r+n)/2),t>this._list[e].timelimit)r=e+1,e=r;else{if(!(t<this._list[e].timelimit)){e++;break}n=e}}while(r<n);return e}prune(t){let e=this.place(t);if(0<=e&&e<=this._list.length){for(let t=0;t<e;t++)delete this._map[this._list[t].id];this._list=this._list.slice(e)}}get(t){return this._map[t]||null}list(){return this._list}close(){this._prune_interval&&clearInterval(this._prune_interval)}toString(){return inspect({total:this._total,map:this._map,list:this._list})}[util_1.default.inspect.custom](){return this.toString()}}
}).call(this)}).call(this,_$browser_108)
var _$logging_121 = {};
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$logging_121,"__esModule",{value:!0}),_$logging_121.make_logging=make_logging;const util_1=__importDefault(_$util_145),default_logspec={level:"info",default_level:"debug",level_text:{100:"all",200:"debug",300:"info",400:"warn",500:"error",600:"fatal",999:"none"},logger:json_logger},level_abbrev={quiet:"none",silent:"none",any:"all",all:"all",print:"debug",standard:"info",test:"warn"},internal_loggers={flat_logger:flat_logger,test_logger:test_logger,json_logger:json_logger};function make_logging(){return{default_logspec:_$common_117.deep(default_logspec),level_abbrev:_$common_117.deep(level_abbrev),load_logger:load_logger,build_log_spec:build_log_spec,build_log:build_log,flat_logger:flat_logger,test_logger:test_logger,json_logger:json_logger}}function flat_logger(e){let t=this.options();var l=t.debug.datalen||111,n=(e.level_name+"").toUpperCase();n.length<5&&(n+="_".repeat(5-n.length)),n=n.substring(0,5);for(var r=null!=e.err?[e.err.message,e.err.callpoint,e.err.plugin||"",e.err.plugin_callpoint||""]:null!=e.res?[e.res]:null!=e.msg?[e.msg]:Array.isArray(e.data)?e.data:null!=e.data?[e.data]:[],i=new Array(r.length),a=0;a<r.length;a++)i[a]=r[a]&&"object"==typeof r[a]?_$common_117.clean(r[a]):r[a],i[a]=util_1.default.inspect(i[a],{compact:!0,depth:e.depth$||t.debug.print.depth,breakLength:1/0});var o=i.join(" ");o=o.substring(0,l)+(l<o.length?"...":"");var s=null==e.plugin_name?"":e.plugin_name+(null==e.plugin_tag||"-"==e.plugin_tag?"":"$"+e.plugin_tag),g=[e.isot,"string"==typeof e.seneca_id?e.seneca_id.substring(0,5):"-----",n,null==e.kind?"log":e.kind,null==e.case?"LOG":e.case,s,null==e.pattern?"":e.pattern,null==e.action?"":e.action,null==e.idpath?"":e.idpath,o,e.callpoint?util_1.default.inspect(e.callpoint):""];this.private$.print.log(g.join("\t").substring(0,e.maxlen$||11111)),e.err&&t.debug.print.err&&this.private$.print.err(e.err)}function json_logger(e){var t=_$common_117.stringify(e);this.private$.print.log(t)}function test_logger(e){try{var t=build_test_log(this,e);this.private$.print.log(t)}catch(t){this.private$.print.log(t,e)}}function load_logger(e,t){var l=t=t||json_logger;if("string"==typeof l&&(l=internal_loggers[l+"_logger"]),t.preload&&((l=t.preload.call(e).extend.logger).from_options$=t.from_options$),2==l.length){var n=function(e){return l(this,e)};return n.from_options$=l.from_options$,n}return l}function build_log_spec(e){var t=e.options(),l=t.log,n=_$common_117.deep({text_level:{}},default_logspec,l&&"object"==typeof l?l:{});Object.keys(n.level_text).forEach((e=>{n.text_level[n.level_text[e]]=parseInt(e,10)}));var r=n.text_level,i=n.level_text,a=t.internal&&t.internal.logger||t.logger||n.logger;if("string"==typeof l){let e=null,t=null;if(r[l])n.level=l;else if(level_abbrev[l])n.level=level_abbrev[l];else if(isNaN(e=parseInt(l,10))){if("function"!=typeof(t=internal_loggers[l+"_logger"]))throw _$common_117.error("bad_logspec_string",{logspec:l});a=t}else n.level=e}else if("number"==typeof l)n.level=parseInt(l,10);else if("function"==typeof l)a=l;else if(l&&"object"!=typeof l&&null!=l)throw _$common_117.error("bad_logspec",{logspec:l});n.level=i[n.level]||""+n.level;var o=r[n.level]||parseInt(n.level,10);return o=o<100?100:999<o?999:o,n.live_level=o,a&&(n.logger=a),n}function build_log(e){var t=build_log_spec(e);e.private$.logspec=t;var l=load_logger(e,t.logger);return e.private$.logger=l,e.log=function(e){var t=this;t.entity$?(t=t.private$.get_instance(),e={data:Array.prototype.slice.call(arguments)}):"string"==typeof e&&(e={data:Array.prototype.slice.call(arguments)});var l=t.private$.logspec;e.level=e.level||l.default_level,"number"!=typeof e.level&&(e.level=l.text_level[e.level]||l.text_level[l.default_level]);var n=new Date;return e.isot=e.isot||n.toISOString(),e.when=e.when||n.getTime(),e.level_name=e.level_name||l.level_text[e.level],e.seneca_id=e.seneca_id||t.id,t.did&&(e.seneca_did=e.seneca_did||t.did),t.fixedargs.plugin$&&(e.plugin_name=e.plugin_name||t.fixedargs.plugin$.name,e.plugin_tag=e.plugin_tag||t.fixedargs.plugin$.tag),t.private$.act&&__intern_121.build_act_entry(t.private$.act,e),t.emit("log",e),l.live_level<=e.level&&t.private$.logger.call(this,e),this},e.log.self=()=>e,Object.keys(t.text_level).forEach((l=>{e.log[l]=make_log_level(l,t)})),t}function make_log_level(e,t){var l=t.text_level[e],n=function(e){var t=this.self();return e&&"object"!=typeof e&&(e={data:Array.prototype.slice.call(arguments)}),e.level=l,t.log(e)};return Object.defineProperty(n,"name",{value:"log_"+e}),n}function build_test_log(e,t){var l=t.when-e.start_time,n=e.private$.exports,r=n&&n.options&&n.options.debug,i=r&&r.datalen||111,a=[l+"/"+e.id.substring(0,2)+"/"+e.tag+" "+(t.level_name+"").toUpperCase(),(t.kind||"data")+(t.case?"/"+t.case:"")+(t.meta?t.meta.sync?"/s":"/a":"")];if("act"===t.kind){if(t.meta&&(a.push(t.meta.id.split("/").map((function(e){return e.substring(0,2)})).join("/")),a.push(t.meta.pattern)),t.res||t.result||t.msg){let l=t.res||t.result||t.msg||{},n=util_1.default.inspect(e.util.clean(l)).replace(/\s+/g,"").substring(0,i);n.length<=22||!t.err?a.push(n):a.push(n.substring(0,22))}t.actdef&&a.push(t.actdef.id),t.notice&&a.push(t.notice),t.data&&a.push(t.data),"ERR"===t.case&&t.err&&a.push((t.err.code?"\n\n"+t.err.code:"")+"\n\n"+t.err.stack+"\n"+t.caller+"\n")}else if("add"===t.kind)a.push(t.pattern),a.push(t.name);else if("ready"===t.kind)a.push(t.name);else if("plugin"===t.kind)a.push(t.plugin_name+(t.plugin_tag?"$"+t.plugin_tag:""));else if("options"===t.kind);else if("notice"===t.kind)a.push(t.notice);else if("fatal"===t.kind)a.push(t.notice),a.push(t.err&&t.err.stack);else if("listen"===t.kind||"client"===t.kind){var o=(t.options?t.options[0]:t.data?t.data[0]:{})||{};a.push([o.type,o.pin,o.host,"function"==typeof o.port?"":o.port].join(";"))}else{let l=util_1.default.inspect(e.util.clean(t.data||t)).replace(/\s+/g,"");a.push(l.length<=i?l:l.substring(0,i)+"...")}return t.did&&a.push(t.did),a.join("\t")}const __intern_121={build_act_entry:function(e,t){if(t.kind=t.kind||"act",t.actid=t.actid||e.meta.id,t.pattern=t.pattern||e.meta.pattern,t.action=t.action||e.def.id,t.idpath=(""+e.meta.tx).substring(0,5),e.meta.parents)for(var l=0;l<e.meta.parents.length;l++)t.idpath+=("."+((e.meta.parents[l]||[])[1]||"-").split("/")[0]).substring(0,6);t.idpath+=("."+e.meta.mi).substring(0,6)}};make_logging.intern=__intern_121;
var _$api_116 = {};
(function (process){(function (){
"use strict";Object.defineProperty(_$api_116,"__esModule",{value:!0}),_$api_116.API=void 0;const Argu=(0,_$gubuMin_74.MakeArgu)("seneca"),errlog=_$common_117.make_standard_err_log_entry,intern={};function wrap(t,e,n){const i=this;return n="function"==typeof e?e:n,e="function"==typeof e?{}:e,t=Array.isArray(t)?t:[t],(0,_$common_117.each)(t,(function(t){(0,_$common_117.each)(i.list(t),(function(t){i.add(t,n,e)}))})),this}function fix(t,e,n){const i=this;t=i.util.Jsonic(t||{});const r=i.delegate(t);return r.add=function(){return i.add.apply(this,intern.fix_args(arguments,t,e,n))},r.sub=function(){return i.sub.apply(this,intern.fix_args(arguments,t,e,n))},r}function options(t,e){const n=this,i=n.private$;if(null==t)return i.optioner.get();n.log&&n.log.debug({kind:"options",case:"SET",data:t});let r=i.exports.options=i.optioner.set(t);if("string"==typeof t.tag){const e=n.root.tag;n.root.tag=t.tag,n.root.id=n.root.id.substring(0,n.root.id.indexOf("/"+e))+"/"+t.tag}if(t.log){const t=i.logging.build_log(n);r=i.exports.options=i.optioner.set({log:t})}return r.debug.callpoint&&(i.callpoint=(0,_$common_117.make_callpoint)(r.debug.callpoint)),e?n:r}function close(t){return function(e){const n=this;return!1!==e&&null==e?(0,_$common_117.promiser)(intern.close.bind(n,t)):intern.close.call(n,t,e)}}function toString(){return this.fullname}function seneca(){return this}function explain(t){if(!0===t)return this.private$.explain=[];if(!1===t){const t=this.private$.explain;return delete this.private$.explain,t}}function error(t){if("function"==typeof t)return this.options({errhandler:t}),this;{if(null==t)throw this.util.error("no_error_code");const e=this.fixedargs&&this.fixedargs.plugin$&&this.fixedargs.plugin$.full,n=null!=e?this.private$.plugins[e]:this.context.plugin;let i=null;return i=n&&n.eraro&&n.eraro.has(t)?n.eraro.apply(this,arguments):_$common_117.error.apply(this,arguments),i}}function fail(...t){if(t.length<=2)return e(this,!0,t[0],t[1]);if(3===t.length)return e(this,t[0],t[1],t[2]);throw this.util.error("fail_wrong_number_of_args",{num_args:t.length});function e(t,e,n,i){if("boolean"!=typeof e)throw t.util.error("fail_cond_must_be_bool");if(!e)return;const r=t.error(n,i);if(i&&!1===i.throw$)return r;throw r}}function inward(){const t=Argu(arguments,{inward:Function});return this.root.order.inward.add(t.inward),this}function outward(){const t=Argu(arguments,{outward:Function});return this.root.order.outward.add(t.outward),this}function delegate(t,e){const n=this,i=this.root,r=this.options();t=t||{},e=e||{};const o=Object.create(n);function s(){return i.log.apply(o,arguments)}let a;o.private$=Object.create(n.private$),o.did=(o.did?o.did+"/":"")+n.private$.didnid(),Object.assign(s,i.log),s.self=()=>o;const l=r.strict.fixedargs?Object.assign({},t,n.fixedargs):Object.assign({},n.fixedargs,t),c=r.strict.fixedmeta?Object.assign({},e,n.fixedmeta):Object.assign({},n.fixedmeta,e);const u=Object.assign({},n.context);return Object.defineProperties(o,{log:{value:s,writable:!0},toString:{value:function(){if(a)return a;const e={};return Object.keys(t).forEach((n=>{const i=t[n];~n.indexOf("$")||(e[n]=i)})),a=n.toString()+(Object.keys(e).length?"/"+(0,_$common_117.jsonic_stringify)(e):""),a},writable:!0},fixedargs:{value:l,writable:!0},fixedmeta:{value:c,writable:!0},delegate:{value:function(t,e){const i=Object.assign({},o.fixedargs,t||{}),r=Object.assign({},o.fixedmeta,e||{});return n.delegate.call(this,i,r)},writable:!0},context:{value:u,writable:!0}}),o}function depends(){const t=this,e=this.private$,n=this.util.error,i=Argu(arguments,{pluginname:String,deps:(0,_$gubuMin_74.Skip)([String]),moredeps:(0,_$gubuMin_74.Rest)(String)}),r=i.deps||i.moredeps||[];for(let o=0;o<r.length;o++){const s=r[o];if(!e.plugin_order.byname.includes(s)&&!e.plugin_order.byname.includes("seneca-"+s)){t.die(n("plugin_required",{name:i.pluginname,dependency:s}));break}}}function export$(t){const e=this,n=this.private$,i=this.util.error,r=this.options();"util"===t&&(t="basic");const o=n.exports[t];return!o&&r.strict.exports?e.die(i("export_not_found",{key:t})):o}function quiet(t){t=t||{};return this.options({test:!1,quiet:!0,log:"none",reload$:!0}).test&&"test"!==t.from?this.test():(this.private$.logging.build_log(this),this)}function test(t,e){const n=this.options();"-"!=n.tag&&(this.root.id=null==n.id$?this.private$.actnid().substring(0,4)+"/"+n.tag:""+n.id$),"function"!=typeof t&&null!==t&&(e=t,t=null);const i={errhandler:null==t?null:t,test:!0,quiet:!1,reload$:!0,log:(e=!0===e||"true"===e?"test":e)||"test",debug:{callpoint:!0}};return this.options(i).quiet?this.quiet({from:"test"}):(this.private$.logging.build_log(this),this.private$.logger.from_options$||(this.root.private$.logger=this.private$.logging.test_logger),this)}function ping(){const t=Date.now();return{now:t,uptime:t-this.private$.stats.start,id:this.id,cpu:process.cpuUsage(),mem:process.memoryUsage(),act:this.private$.stats.act,tr:this.private$.transport.register.map((function(t){return Object.assign({when:t.when,err:t.err},t.config)}))}}function translate(t,e,n,i){const r="string"==typeof t?this.util.Jsonic(t):t,o="string"==typeof e?this.util.Jsonic(e):e;let s={};"string"==typeof n&&(n=n.split(/\s*,\s*/)),Array.isArray(n)?n.forEach((function(t){t.startsWith("-")?s[t.substring(1)]=!1:s[t]=!0})):s=n&&"object"==typeof n?Object.assign({},n):null;let a=function(t){let e;s?(e={},Object.keys(s).forEach((function(n){s[n]&&(e[n]=t[n])}))):e=(0,_$common_117.clean)(t);let n=Object.assign(e,o);for(let t in n)null==n[t]&&delete n[t];return n};this.private$.translationrouter.add(r,a);let l=function(t,e){let n=a(t);this.act(n,e)};return Object.defineProperty(l,"name",{value:"translation__"+(0,_$common_117.jsonic_stringify)(r)+"__"+(0,_$common_117.jsonic_stringify)(o)}),r.translate$=!1,this.add(r,l),this}function gate(){return this.delegate({gate$:!0})}function ungate(){return this.fixedargs.gate$=!1,this}function list_plugins(){return Object.assign({},this.private$.plugins)}function find_plugin(t,e){const n=(0,_$common_117.make_plugin_key)(t,e);return this.private$.plugins[n]}function has_plugin(t,e){const n=(0,_$common_117.make_plugin_key)(t,e);return!!this.private$.plugins[n]}function ignore_plugin(t,e,n){"boolean"==typeof e&&(n=e,e=null);const i=(0,_$common_117.make_plugin_key)(t,e),r=this.private$.ignore_plugins[i]=null==n||!!n;return this.log.info({kind:"plugin",case:"ignore",full:i,ignore:r}),this}function find(t,e){const n=this;let i="string"==typeof t?n.util.Jsonic(t):t;i=n.util.clean(i),i=i||{};let r=n.private$.actrouter.find(i,e&&e.exact);return r||(r=n.private$.actrouter.find({})),r}function has(t){return!!this.find(t,{exact:!0})}function list(t){return this.private$.actrouter.list(null==t?{}:this.util.Jsonic(t)).map((t=>t.match))}function status(t){t=t||{};const e=this.private$.history.stats();e.log=this.private$.history.list();return{stats:this.stats(t.stats),history:e,transport:this.private$.transport}}function reply(t){const e=this;let n=null;return t&&t.meta&&(n=e.private$.history.get(t.meta.id),n&&n.reply(t.err,t.out,t.meta)),!!n}function listen(t){return function(...e){const n=this.private$,i=this;let r=e[e.length-1];"function"==typeof r?e.pop():r=()=>{},i.log.info({kind:"listen",case:"INIT",data:e,callpoint:t(!0)});const o=i.options().transport||{},s=intern.resolve_config(intern.parse_config(e),o);return i.act("role:transport,cmd:listen",{config:s,gate$:!0},(function(t,e){if(t)return i.die(n.error(t,"transport_listen",s));r(null,e),r=()=>{}})),i}}function client(t){return function(){const e=this.private$,n=Array.prototype.slice.call(arguments),i=this;i.log.info({kind:"client",case:"INIT",data:n,callpoint:t(!0)});const r=i.options().legacy||{},o=i.options().transport||{},s=intern.parse_config(n);s.pg=(0,_$common_117.pincanon)(s.pin||s.pins);const a=intern.resolve_config(s,o);a.id=a.id||(0,_$common_117.pattern)(s);let l=a.pins||(Array.isArray(a.pin)?a.pin:[a.pin||""]);l=l.map((t=>"string"==typeof t?i.util.Jsonic(t):t));const c=i.order.plugin.task.delegate.exec({ctx:{seneca:i},data:{plugin:{name:"seneca_internal_client",tag:void 0}}}).out.delegate;let u;const p=function(t,e,n){r.meta&&(n=n||t.meta$),n.local?this.prior(t,e):u&&u.send?(r.meta&&(t.meta$=n),u.send.call(this,t,e,n)):this.log.error("no-transport-client",{config:a,msg:t})};return p.id=a.id,a.makehandle&&(p.handle=a.makehandle(a)),l.forEach((t=>{t=Object.assign({},t),a.override&&c.wrap(c.util.clean(t),{client_pattern:c.util.pattern(t)},p),t.client$=!0,t.strict$={add:!0},c.add(t,p)})),c.act("role:transport,cmd:client",{config:a,gate$:!0},(function(t,n){return t?c.die(e.error(t,"transport_client",a)):null==n?c.die(e.error("transport_client_null",(0,_$common_117.clean)(a))):void(u=n)})),i}}function decorate(){let t=Argu(arguments,{property:(0,_$gubuMin_74.Check)(/^[^_]/,String).Fault("Decorate property cannot start with underscore (was $VALUE)"),value:(0,_$gubuMin_74.Any)()}),e=t.property;if(this.private$.decorations[e])throw new Error("seneca: Decoration already exists: "+e);if(this.root[e])throw new Error("seneca: Decoration overrides core property:"+e);this.root[e]=this.private$.decorations[e]=t.value}function prepare(t){if(null==t||"function"!=typeof t)throw new Error("seneca: first argument to prepare must be a function");async function e(e){return await t.call(this,e),this.prior(e)}""!=t.name&&Object.defineProperty(e,"name",{value:"prepare_"+t.name});const n=this.plugin;let i={role:"seneca",plugin:"init",init:n.name,tag:void 0};return null!=n.tag&&"-"!=n.tag&&(i.tag=n.tag),this.message(i,e),this.plugin.prepare=this.plugin.prepare||[],this.plugin.prepare.push(t),this}function destroy(t){async function e(e){return await t.call(this,e),this.prior(e)}return""!=t.name&&Object.defineProperty(e,"name",{value:"destroy_"+t.name}),this.message("sys:seneca,cmd:close",e),this.plugin.destroy=this.plugin.destroy||[],this.plugin.destroy.push(t),this}intern.parse_config=function(t){let e={};const n=t.filter((t=>null!=t)),i=n.length;return 1===i?n[0]&&"object"==typeof n[0]?e=Object.assign({},n[0]):e.port=parseInt(n[0],10):2===i?(e.port=parseInt(n[0],10),e.host=n[1]):3===i&&(e.port=parseInt(n[0],10),e.host=n[1],e.path=n[2]),e},intern.resolve_config=function(t,e){let n=Object.assign({},t);Object.keys(e).forEach((t=>{const i=e[t];i&&"object"==typeof i||(n[t]=void 0===n[t]?i:n[t])})),n.type=n.type||"web";const i=e[n.type]||{};return n=Object.assign({},i,n),"web"!==n.type&&"tcp"!==n.type||(n.port=null==n.port?i.port:n.port,n.host=null==n.host?i.host:n.host,n.path=null==n.path?i.path:n.path),n},intern.close=function(t,e){const n=this,i=n.options();let r=!1;const o=function(t){if(!r&&"function"==typeof e)return r=!0,e.call(n,t)};if(n.flags.closed)return o();n.ready(a);const s=setTimeout(a,i.close_delay);function a(){if(clearTimeout(s),n.flags.closed)return o();n.closed=!0,n.flags.closed=!0,(0,_$common_117.each)(i.system.close_signals,(function(t,e){t&&process.removeListener(e,n.private$.exit_close)})),n.log.debug({kind:"close",notice:"start",callpoint:t(!0)}),n.act("sys:seneca,cmd:close,closing$:true",(function(t){return n.log.debug(errlog(t,{kind:"close",notice:"end"})),n.removeAllListeners("act-in"),n.removeAllListeners("act-out"),n.removeAllListeners("act-err"),n.removeAllListeners("pin"),n.removeAllListeners("after-pin"),n.removeAllListeners("ready"),n.removeAllListeners("act-err-4"),n.private$.history.close(),n.private$.status_interval&&clearInterval(n.private$.status_interval),o(t)}))}return n};const FixArgu=Argu("fix",{props:(0,_$gubuMin_74.One)((0,_$gubuMin_74.Empty)(String),Object),moreprops:(0,_$gubuMin_74.Skip)(Object),rest:(0,_$gubuMin_74.Rest)((0,_$gubuMin_74.Any)())});intern.fix_args=function(t,e,n,i){const r=FixArgu(t);r.pattern=Object.assign({},r.moreprops?r.moreprops:null,"string"==typeof r.props?(0,_$common_117.parse_jsonic)(r.props,"add_string_pattern_syntax"):r.props,e);return[r.pattern].concat({fixed$:Object.assign({},n,r.pattern.fixed$),custom$:Object.assign({},i,r.pattern.custom$)}).concat(r.rest)};let API={wrap:wrap,fix:fix,options:options,close:close,toString:toString,seneca:seneca,explain:explain,error:error,fail:fail,inward:inward,outward:outward,delegate:delegate,depends:depends,export:export$,quiet:quiet,test:test,ping:ping,translate:translate,gate:gate,ungate:ungate,list_plugins:list_plugins,find_plugin:find_plugin,has_plugin:has_plugin,ignore_plugin:ignore_plugin,find:find,has:has,list:list,status:status,reply:reply,listen:listen,client:client,decorate:decorate,prepare:prepare,destroy:destroy};_$api_116.API=API;
}).call(this)}).call(this,_$browser_108)
var _$ready_128 = {};
"use strict";Object.defineProperty(_$ready_128,"__esModule",{value:!0}),_$ready_128.make_ready=make_ready;/* removed: const _$common_117=require("./common"); */;function make_ready(e){var r=e.private$;return r.next_ready_id=(0,_$common_117.autoincr)(),r.ready_list=[],{api_ready:api_ready,clear_ready:clear_ready.bind(e),execute_ready:execute_ready}}function api_ready(e){const r=this;if(!e){const e=r.root.private$.cleared;return new Promise((a=>{const t=setInterval((()=>{e<r.root.private$.cleared&&(clearInterval(t),a(r))}),r.private$.ge.options.interval)}))}return setTimeout((function(){const a=r.root.private$,t=function(){e.call(r)};var n=(null==e.name||""===e.name||"ready"===e.name?"ready_":e.name+"_ready_")+a.next_ready_id();Object.defineProperty(t,"name",{value:n}),a.ge.isclear()?execute_ready(r,t):a.ready_list.push(t)}),r.private$.ge.options.interval),r}function clear_ready(){const e=this,r=e.private$;if(r.cleared=(r.cleared||0)+1,e.emit("ready"),execute_ready(e,r.ready_list.shift()),r.ge.isclear())for(;0<r.ready_list.length;)execute_ready(e,r.ready_list.shift())}function execute_ready(e,r){if(null!=r){var a=e.options();try{e.log.debug({kind:"ready",case:"call",name:r.name}),r()}catch(r){var t=e.error(r,"ready_failed",{message:r.message});a.errhandler?a.errhandler.call(e,t):e.die(t)}}}
var _$meta_122 = {};
"use strict";Object.defineProperty(_$meta_122,"__esModule",{value:!0}),_$meta_122.Meta=void 0;class Meta{constructor(t,i,s,e){this.start=Date.now(),this.mi="",this.tx="",this.id="",this.version="0.1.0",this.gate=!1,this.fatal=!1,this.closing=!1,this.sync=!0,this.local=!0,this.remote=!1,this.direct=!1,this.timeout=0;let l=Meta.resolve_msg_id_tx(t,s),a=s.meta$,h=t.fixedmeta||{};this.mi=l[0],this.tx=l[1],this.id=l[0]+"/"+l[1],this.instance=t.id,this.tag=t.tag,this.seneca=t.version,this.gate=!!s.gate$||h.gate,this.fatal=!!s.fatal$||h.fatal,this.local=!!s.local$||h.local,this.direct=!!s.direct$||h.direct,this.closing=!!s.closing$||a&&a.closing,this.timeout=Math.max(0,"number"==typeof s.timeout$?s.timeout$:i.timeout),this.dflt=s.default$||a&&a.dflt,this.custom=s.custom$||a&&a.custom||null,this.plugin=s.plugin$,this.prior=s.prior$,this.caller=s.caller$,this.parents=s.parents$,this.remote=!!s.remote$,this.sync=null!=s.sync$?!!s.sync$:a&&null!=a.sync?!!a.sync:"function"==typeof e,this.trace=null,this.sub=null,this.data=null,this.err=null,this.err_trace=null,this.error=null,this.empty=null}static resolve_msg_id_tx(t,i){let s=(i.id$||i.actid$||t.idgen()).split("/");return s[1]=s[1]||i.tx$||t.fixedargs.tx$||t.idgen(),s[0]=s[0]||t.idgen(),s}}_$meta_122.Meta=Meta;
var _$act_113 = {};
"use strict";Object.defineProperty(_$act_113,"__esModule",{value:!0});const {MakeArgu:__MakeArgu_113,Skip:__Skip_113,One:__One_113,Empty:__Empty_113}=_$gubuMin_74.Gubu,__Argu_113=__MakeArgu_113("seneca"),ActArgu=__Argu_113("act",{props:__One_113(__Empty_113(String),Object),moreprops:__Skip_113(Object),reply:__Skip_113(Function)});_$act_113.api_act=function(){const e=this,{opts:r,msg:t,reply:n}=__intern_113.prep_act(e,arguments);return __intern_113.do_act(e,r,t,n),e},_$act_113.api_direct=function(){const{opts:e,msg:r,reply:t}=__intern_113.prep_act(this,arguments);r.direct$=!0;return __intern_113.do_act(this,e,r,t)};const __intern_113=_$act_113.intern={prep_act:function(e,r){const t=ActArgu(r);return t.opts=e.options(),t.msg=Object.assign({},t.moreprops?t.moreprops:null,"string"==typeof t.props?(0,_$common_117.parse_jsonic)(t.props,"msg_jsonic_syntax"):t.props,e.fixedargs),(t.opts.debug.act_caller||t.opts.test)&&(t.msg.caller$="\n Action call arguments and location: "+(new Error((0,_$common_117.msgstr)(t.msg,t.opts.debug.datalen)).stack+"\n").replace(/Error: /,"").replace(/.*\/gate-executor\.[jt]s:.*\n/g,"").replace(/.*\/seneca\.[jt]s:.*\n/g,"").replace(/.*\/seneca\/lib\/.*\.[jt]s:.*\n/g,"")),t},do_act:function(e,r,t,n){let o=!1;const a=__intern_113.make_actmsg(t),c=new _$meta_122.Meta(e,r,t,n);c.gate&&((e=e.delegate()).private$.ge=e.private$.ge.gate());const l={seneca:e,origmsg:t,reply:n||_$common_117.noop,options:e.options(),callpoint:e.private$.callpoint()},i={};if(i.dn=c.id,i.fn=function(t){const n=(e,n,i)=>{o||__intern_113.handle_reply(r,c,l,a,e,n,i),t()};try{return __intern_113.execute_action(i,e,r,l,a,c,n)}catch(e){const n=r.error.identify(e)?e:new Error((0,_$common_117.inspect)(e));__intern_113.handle_reply(r,c,l,a,n),t()}},i.ontm=function(e,t,n){o=!0;const s=(0,_$common_117.error)("action_timeout",{timeout:e,start:t,end:n,message:a,pattern:i.ctxt.pattern});__intern_113.handle_reply(r,c,l,a,s)},i.tm=c.timeout,c.direct){i.ctxt={};let e=i.fn((function(){}));return null==c.end&&__intern_113.handle_reply(r,c,l,a,null,e),e}e.private$.ge.add(i)},make_actmsg:function(e){const r=Object.assign({},e);return null!=r.id$&&delete r.id$,null!=r.caller$&&delete r.caller$,null!=r.meta$&&delete r.meta$,null!=r.prior$&&delete r.prior$,null!=r.parents$&&delete r.parents$,r},handle_reply:function(e,r,t,n,o,a,c){r.end=Date.now();const l=t.seneca,i=t.reply,s={meta:r,msg:n,res:o||a,reply_meta:c,has_callback:!0,err:o||null,out:a||null};if(t.duration=r.end-r.start,t.actlog=__intern_113.actlog,t.errlog=__intern_113.errlog,t.error=_$common_117.error,r.error=e.error.identify(s.res),r.error||s.res!==s.err||(s.err=null),r.explain&&c&&c.explain&&r.explain.length<c.explain.length)for(let e=r.explain.length;e<c.explain.length;e++)r.explain.push(c.explain[e]);if(__intern_113.process_outward(t,s),s.has_callback)try{i.call(l,s.err,s.res,s.meta)}catch(e){__intern_113.callback_error(l,e,t,s)}},errlog:_$common_117.make_standard_err_log_entry,actlog:_$common_117.make_standard_act_log_entry,process_outward:function(e,r){const t=e.seneca.order.outward.execSync(e,r);if(t.err)throw t.err;const n=t.data;if(null!=n.kind){if("sub_outward_action_failed"===n.code){const t={pattern:e.actdef.pattern,msg:r.msg,...n.info||{}};r.err=(0,_$common_117.error)(n.error,n.code,t)}else r.err=n.error||(0,_$common_117.error)(n.code||"invalid-process-outward-code",n.info||{});r.meta=r.meta||{},r.meta.error=!0}},execute_action:function(e,r,t,n,o,a,c){const l=r.private$,i=a.prior?l.actdef[a.prior]:r.find(o),s=__intern_113.make_act_delegate(r,o,a,i);n.seneca=s,n.actdef=i,e.ctxt.pattern=i?i.pattern:null;const p={meta:a,msg:o,reply:c},m=r.order.inward.execSync(n,p);if(m.err)throw m.err;const d=m.data;if(!__intern_113.handle_inward_break(d,r,p,i,n.origmsg))return i.sub||s.log.debug(__intern_113.actlog(i,o,a,n.origmsg,{kind:"act",case:"IN",did:s.did})),p.id=p.meta.id,p.result=[],p.timelimit=Date.now()+p.meta.timeout,t.history.active&&l.history.add(p),t.legacy.meta&&(p.msg.meta$=a),i.func.call(s,p.msg,p.reply,p.meta)},make_act_delegate:function(e,r,t,n){t=t||{};const o={plugin$:{full:(n=n||{}).plugin_fullname,name:n.plugin_name,tag:n.plugin_tag}},a={};t.direct&&(a.direct=t.direct);const c=e.delegate(o,a),l=e.private$.act||t.parent;return c.private$.act={parent:l&&l.meta,meta:t,def:n,msg:r},t.tx&&(c.fixedargs.tx$=t.tx),c},handle_inward_break:function(e,r,t,n,o){if(!e)return!1;const a=t.msg,c=t.reply,l=t.meta;if("error"===e.kind){let o=e.error;if("sub_inward_action_failed"===e.code){const r={pattern:n.pattern,msg:t.msg,...e.info||{}};o=(0,_$common_117.error)(o,e.code,r)}else o=o||(0,_$common_117.error)(e.code,e.info);return l.error=!0,e.log&&e.log.level&&r.log[e.log.level](__intern_113.errlog(o,__intern_113.errlog(n||{},l.prior))),c.call(r,o),!0}return"result"===e.kind?(e.log&&e.log.level&&r.log[e.log.level](__intern_113.actlog(n||{},a,l,o,e.log.data)),c.call(r,null,e.result),!0):void 0},callback_error:function(e,r,t,n){const o=t.duration,a=t.callpoint,c=t.actdef||{},l=t.origmsg,i=t.reply,s=n.meta,p=n.msg;let m=e.options().error.identify(r)?r:new Error((0,_$common_117.inspect)(r));const d=e.options();m.seneca||(m=(0,_$common_117.error)(m,"act_callback",(0,_$common_117.deep)({},m.details,{message:m.message,pattern:c.pattern,fn:c.func,callback:i,instance:e.toString(),callpoint:a}))),e.log.error(__intern_113.actlog(c,p,s,l,{kind:"act",case:"ERR",info:m.message,code:m.code,err:m,duration:o,did:e.did})),e.emit("act-err","callback",p,s,m,n.res),e.emit("act-err-4","callback",p,s,m,n.res),d.errhandler&&d.errhandler.call(e,m,m.meta$)}};
var _$add_115 = {};
(function (setImmediate){(function (){
"use strict";Object.defineProperty(_$add_115,"__esModule",{value:!0}),_$add_115.task=void 0,_$add_115.api_add=api_add,_$add_115.api_message=api_message;const Argu=(0,_$gubuMin_74.MakeArgu)("seneca"),AddArgu=Argu("add",{props:(0,_$gubuMin_74.One)((0,_$gubuMin_74.Empty)(String),Object),moreprops:(0,_$gubuMin_74.Skip)(Object),action:(0,_$gubuMin_74.Skip)(Function),actdef:(0,_$gubuMin_74.Skip)(Object)});function api_add(){let t=AddArgu(arguments);t.pattern=Object.assign({},t.moreprops?t.moreprops:null,"string"==typeof t.props?(0,_$common_117.parse_jsonic)(t.props,"add_string_pattern_syntax"):t.props);let e={opts:this.options(),args:t,private:this.private$,instance:this},a=this.order.add.execSync(e,{actdef:null,pattern:null,action:null,strict_add:null,addroute:null});if(a.err)throw a.err;return this}function api_message(t,e,a){let n=a||e;const r=null==n?null:function(t,e,a){n.call(this,t,a).then(e).catch(e)};if(null!=n&&null!=r){for(var i in""!=n.name&&Object.defineProperty(r,"name",{value:n.name}),n)r[i]=n[i];setImmediate((function(){for(var t in n)r[t]=n[t]}))}return a?this.add(t,e,r):r?this.add(t,r):this.add(t),this}const task={translate(t){let e=t.ctx.args.pattern,a=null;if(!1!==e.translate$){let n=t.ctx.private.translationrouter.find(e);n&&(a=n(e))}return{op:"merge",out:{pattern:a}}},prepare(t){const e=t.ctx.args;let a=t.data.pattern||e.pattern,n=(0,_$common_117.clean)(a),r=e.action||function(t,e,a){a?e.call(this,null,a.dflt||null,a):e.call(this,null,null)},i=(0,_$common_117.deep)(e.actdef)||{};return i.raw=(0,_$common_117.deep)({},a),{op:"merge",out:{actdef:i,action:r,pattern:n}}},plugin(t){const e=t.data.actdef;return e.plugin_name=e.plugin_name||"root$",e.plugin_fullname=e.plugin_fullname||e.plugin_name+(("-"===e.plugin_tag?void 0:e.plugin_tag)?"$"+e.plugin_tag:""),e.plugin={name:e.plugin_name,tag:e.plugin_tag,fullname:e.plugin_fullname},{op:"merge",out:{actdef:e}}},callpoint(t){const e=t.ctx.private,a=t.data.actdef;let n=e.callpoint();return n&&(a.callpoint=n),{op:"merge",out:{actdef:a}}},flags(t){const e=t.data.actdef,a=t.data.pattern,n=t.ctx.opts,r=t.ctx.instance.util.Jsonic;e.sub=!!e.raw.sub$,e.client=!!e.raw.client$,e.deprecate=e.raw.deprecate$,e.fixed=r(e.raw.fixed$||{}),e.custom=r(e.raw.custom$||{});var i=e.raw.strict$&&null!==e.raw.strict$.add?!!e.raw.strict$.add:!!n.strict.add;return e.pattern=(0,_$common_117.pattern)(a),e.msgcanon=r(e.pattern),e.pattern=(0,_$common_117.pattern)(a),e.msgcanon=r(e.pattern),{op:"merge",out:{actdef:e,strict_add:i}}},action(t){const e=t.data.actdef,a=t.data.action,n=t.ctx.private,r=e.plugin||{},i=null==a.name||""===a.name?"action":a.name;return e.id=(null==r.fullname||""===r.fullname?"":r.fullname+"/")+i+"/"+n.next_action_id(),e.name=i,e.func=a,"function"==typeof a.handle&&(e.handle=a.handle),{op:"merge",out:{actdef:e}}},prior(t){const e=t.data.actdef,a=t.data.pattern,n=t.data.strict_add;let r=!0;var i=t.ctx.instance.find(a);return i&&n&&i.pattern!==e.pattern&&(i=null),i?("function"==typeof i.handle&&(i.client&&e.client||!i.client&&!e.client)?(i.handle(e),r=!1):e.priordef=i,e.priorpath=i.id+";"+i.priorpath):e.priorpath="",{op:"merge",out:{actdef:e,addroute:r}}},rules(t){const e=t.data.actdef,a=t.data.pattern;let n={},r=!1,i=0;return(0,_$common_117.each)(e.raw,(function(t,e){null==t||"object"!=typeof t&&"function"!=typeof t||~e.indexOf("$")||(n[e]=t,i++,delete a[e],t.$_root&&(r=!0))})),e.rules=n,!r&&0<i&&(e.gubu=(0,_$gubuMin_74.Gubu)((0,_$gubuMin_74.Open)(n))),{op:"merge",out:{actdef:e}}},register(t){const e=t.data.actdef,a=t.data.pattern,n=t.data.addroute,r=t.ctx.private,i=t.ctx.instance;return n&&(i.log.debug({kind:"add",case:e.sub?"SUB":"ADD",action:e.id,pattern:e.pattern,callpoint:r.callpoint(!0)}),r.actrouter.add(a,e)),r.stats.actmap[e.pattern]=r.stats.actmap[e.pattern]||intern.make_action_stats(e),r.actdef[e.id]=e,{op:"next"}},modify(t){const e=t.data.actdef,a=t.ctx.instance;return intern.deferred_modify_action(a,e),{op:"next"}}};_$add_115.task=task;const intern=_$add_115.intern={make_action_stats:function(t){return{id:t.id,plugin:{full:t.plugin_fullname,name:t.plugin_name,tag:t.plugin_tag},prior:t.priorpath,calls:0,done:0,fails:0,time:{}}},deferred_modify_action:function(t,e){setImmediate((function(){(0,_$common_117.each)(t.private$.action_modifiers,(function(a){a.call(t,e)}))}))}};
}).call(this)}).call(this,_$main_138({}).setImmediate)
var _$sub_129 = {};
"use strict";Object.defineProperty(_$sub_129,"__esModule",{value:!0}),_$sub_129.api_sub=api_sub;const __Argu_129=(0,_$gubuMin_74.MakeArgu)("seneca"),SubArgu=__Argu_129("sub",{props:(0,_$gubuMin_74.One)((0,_$gubuMin_74.Empty)(String),Object),moreprops:(0,_$gubuMin_74.Skip)(Object),action:Function});function api_sub(){const t=this,r=SubArgu(arguments);r.pattern=Object.assign({},r.moreprops?r.moreprops:null,"string"==typeof r.props?(0,_$common_117.parse_jsonic)(r.props,"add_string_pattern_syntax"):r.props);const e=r.pattern,u=r.action;let n=!!e.in$,o=!!e.out$;o||(n=!0);let s=e;if(!1!==e.translate$){let t=this.private$.translationrouter.find(e);t&&(s=t(e))}const p=t.util.clean(s);return[n?t.private$.subrouter.inward:null,o?t.private$.subrouter.outward:null].filter((t=>t)).forEach((t=>{let r=t.find(p,!0);r||(t.add(p,r=[]),r.pattern=(0,_$common_117.pattern)(p)),r.push(u)})),t}
var _$prior_127 = {};
"use strict";Object.defineProperty(_$prior_127,"__esModule",{value:!0}),_$prior_127.Prior=void 0;const __Argu_127=(0,_$gubuMin_74.MakeArgu)("seneca"),__ActArgu_127=__Argu_127("prior",{props:(0,_$gubuMin_74.One)((0,_$gubuMin_74.Empty)(String),Object),moreprops:(0,_$gubuMin_74.Skip)(Object),reply:(0,_$gubuMin_74.Skip)(Function)});function api_prior(){if(null==this.private$.act)throw this.util.error("no_prior_action",{args:arguments});const r=this.private$.act.def.priordef,o=__ActArgu_127(arguments);o.msg=Object.assign({},o.moreprops?o.moreprops:null,"string"==typeof o.props?(0,_$common_117.parse_jsonic)(o.props,"msg_jsonic_syntax"):o.props);const t=o.msg,i=o.reply;if(r)return t.prior$=r.id,i?this.act(t,i):this.post(t);{const r=t.meta$||{};let o=t.default$||r.dflt||null;return o=null==o?o:Object.assign({},o),i?i.call(this,null,o,r):o}}const Prior={api_prior:api_prior};_$prior_127.Prior=Prior;
var _$uniq_92 = {};
(function (global){(function (){
var LARGE_ARRAY_SIZE=200,HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,funcTag="[object Function]",genTag="[object GeneratorFunction]",reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function arrayIncludes(t,e){return!!(t?t.length:0)&&baseIndexOf(t,e,0)>-1}function arrayIncludesWith(t,e,a){for(var r=-1,n=t?t.length:0;++r<n;)if(a(e,t[r]))return!0;return!1}function baseFindIndex(t,e,a,r){for(var n=t.length,o=a+(r?1:-1);r?o--:++o<n;)if(e(t[o],o,t))return o;return-1}function baseIndexOf(t,e,a){if(e!=e)return baseFindIndex(t,baseIsNaN,a);for(var r=a-1,n=t.length;++r<n;)if(t[r]===e)return r;return-1}function baseIsNaN(t){return t!=t}function cacheHas(t,e){return t.has(e)}function getValue(t,e){return null==t?void 0:t[e]}function isHostObject(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function setToArray(t){var e=-1,a=Array(t.size);return t.forEach((function(t){a[++e]=t})),a}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var t=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),splice=arrayProto.splice,Map=getNative(root,"Map"),Set=getNative(root,"Set"),nativeCreate=getNative(Object,"create");function Hash(t){var e=-1,a=t?t.length:0;for(this.clear();++e<a;){var r=t[e];this.set(r[0],r[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(t){return this.has(t)&&delete this.__data__[t]}function hashGet(t){var e=this.__data__;if(nativeCreate){var a=e[t];return a===HASH_UNDEFINED?void 0:a}return hasOwnProperty.call(e,t)?e[t]:void 0}function hashHas(t){var e=this.__data__;return nativeCreate?void 0!==e[t]:hasOwnProperty.call(e,t)}function hashSet(t,e){return this.__data__[t]=nativeCreate&&void 0===e?HASH_UNDEFINED:e,this}function ListCache(t){var e=-1,a=t?t.length:0;for(this.clear();++e<a;){var r=t[e];this.set(r[0],r[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(t){var e=this.__data__,a=assocIndexOf(e,t);return!(a<0)&&(a==e.length-1?e.pop():splice.call(e,a,1),!0)}function listCacheGet(t){var e=this.__data__,a=assocIndexOf(e,t);return a<0?void 0:e[a][1]}function listCacheHas(t){return assocIndexOf(this.__data__,t)>-1}function listCacheSet(t,e){var a=this.__data__,r=assocIndexOf(a,t);return r<0?a.push([t,e]):a[r][1]=e,this}function MapCache(t){var e=-1,a=t?t.length:0;for(this.clear();++e<a;){var r=t[e];this.set(r[0],r[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(t){return getMapData(this,t).delete(t)}function mapCacheGet(t){return getMapData(this,t).get(t)}function mapCacheHas(t){return getMapData(this,t).has(t)}function mapCacheSet(t,e){return getMapData(this,t).set(t,e),this}function SetCache(t){var e=-1,a=t?t.length:0;for(this.__data__=new MapCache;++e<a;)this.add(t[e])}function setCacheAdd(t){return this.__data__.set(t,HASH_UNDEFINED),this}function setCacheHas(t){return this.__data__.has(t)}function assocIndexOf(t,e){for(var a=t.length;a--;)if(eq(t[a][0],e))return a;return-1}function baseIsNative(t){return!(!isObject(t)||isMasked(t))&&(isFunction(t)||isHostObject(t)?reIsNative:reIsHostCtor).test(toSource(t))}function baseUniq(t,e,a){var r=-1,n=arrayIncludes,o=t.length,s=!0,c=[],i=c;if(a)s=!1,n=arrayIncludesWith;else if(o>=LARGE_ARRAY_SIZE){var h=e?null:createSet(t);if(h)return setToArray(h);s=!1,n=cacheHas,i=new SetCache}else i=e?[]:c;t:for(;++r<o;){var u=t[r],l=e?e(u):u;if(u=a||0!==u?u:0,s&&l==l){for(var f=i.length;f--;)if(i[f]===l)continue t;e&&i.push(l),c.push(u)}else n(i,l,a)||(i!==c&&i.push(l),c.push(u))}return c}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(t){return new Set(t)}:noop;function getMapData(t,e){var a=t.__data__;return isKeyable(e)?a["string"==typeof e?"string":"hash"]:a.map}function getNative(t,e){var a=getValue(t,e);return baseIsNative(a)?a:void 0}function isKeyable(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function isMasked(t){return!!maskSrcKey&&maskSrcKey in t}function toSource(t){if(null!=t){try{return funcToString.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function uniq(t){return t&&t.length?baseUniq(t):[]}function eq(t,e){return t===e||t!=t&&e!=e}function isFunction(t){var e=isObject(t)?objectToString.call(t):"";return e==funcTag||e==genTag}function isObject(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function noop(){}_$uniq_92=uniq;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
var _$nuaMin_95 = { exports: {} };
(function (global){(function (){
!function(e){"object"==typeof _$nuaMin_95.exports&&"undefined"!="object"?_$nuaMin_95.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Nua=e()}((function(){return function(e,t,o){var n=(o=o||{}).depth||Number.MAX_VALUE,f=o.setter,l=!!o.preserve;"object"==typeof e&&"object"==typeof t&&function e(t,o,r){if(!(null==t||null==o||n<=r)){var i=r+1;if(Array.isArray(t)&&Array.isArray(o)){for(var u=0;u<t.length;u++)"object"==typeof t[u]?e(t[u],o[u],i):f?f(t,u,o[u]):t[u]=o[u];for(;u<o.length;u++)f?f(t,u,o[u]):t[u]=o[u];t.splice(o.length)}else{for(var d=Object.keys(t),y=0;y<d.length;y++){var p=t[d[y]],a=o[d[y]];"object"==(null===p?"null":typeof p)&&"object"==(null===a?"null":typeof a)?e(p,a,i):void 0===a?l||delete t[d[y]]:f?f(t,d[y],a):t[d[y]]=a}for(var c=Object.keys(o),s=0;s<c.length;s++)void 0===t[c[s]]&&(f?(f(t,c[s],o[c[s]]),null==o[c[s]]||!Array.isArray(o[c[s]])&&"object"!=typeof o[c[s]]||e(t[c[s]],o[c[s]],i)):t[c[s]]=o[c[s]])}}}(e,t,0)}}));
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
_$nuaMin_95 = _$nuaMin_95.exports
var _$plugin_125 = {};
"use strict";var ____importDefault_125=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$plugin_125,"__esModule",{value:!0}),_$plugin_125.Plugin=void 0;const nua_1=____importDefault_125(_$nuaMin_95),{Print:__Print_125}=_$print_126,__intern_125=make_intern();function api_use(e,n){const t=make_tasks(),a=new _$orduMin_104.Ordu({debug:n.debug});return a.operator("seneca_plugin",__intern_125.op.seneca_plugin),a.operator("seneca_export",__intern_125.op.seneca_export),a.operator("seneca_options",__intern_125.op.seneca_options),a.operator("seneca_complete",__intern_125.op.seneca_complete),a.add([t.args,t.load,t.normalize,{name:"pre_options",exec:e=>{if("function"==typeof e.data.plugin.define.preload)return t.options(e)}},t.preload,{name:"pre_meta",exec:t.meta},{name:"pre_legacy_extend",exec:t.legacy_extend},t.delegate,t.call_define,t.options,t.define,{name:"post_meta",exec:t.meta},{name:"post_legacy_extend",exec:t.legacy_extend},t.call_prepare,t.complete]),{use:make_use(a,e),ordu:a,tasks:t}}function make_use(e,n){let t={index:0};return function(){let a=this,i=[...arguments];if(0===i.length)throw a.error("use_no_args");let l={seq:t,args:i,seneca:this,callpoint:n(!0)},r={seq:-1,args:[],plugin:null,meta:null,delegate:null,plugin_done:null,exports:{},prepare:{}};return async function(){await e.exec(l,r,{done:function(e){if(e.err){var n=e.err.seneca?e.err:a.private$.error(e.err,e.err.code);n.plugin=n.plugin||(r.plugin?r.plugin.fullname||r.plugin.name:i.join(" ")),n.plugin_callpoint=n.plugin_callpoint||l.callpoint,a.die(n)}}})}(),a}}function make_tasks(){return{args:e=>{let n=[...e.ctx.args];return null!=n[0]&&"object"==typeof n[0]&&(n[0].init=n[0].define||n[0].init),{op:"merge",out:{plugin:{args:n}}}},load:e=>{let n=e.data.plugin.args,t=e.ctx.seneca,a=t.private$;"request"===n[0]&&(n[0]="@seneca/request");let i=a.use.build_plugin_desc(...n);if(i.callpoint=e.ctx.callpoint,a.ignore_plugins[i.full])return t.log.info({kind:"plugin",case:"ignore",plugin_full:i.full,plugin_name:i.name,plugin_tag:i.tag}),{op:"stop",why:"ignore"};return{op:"merge",out:{plugin:a.use.use_plugin_desc(i)}}},normalize:e=>{let n=e.data.plugin,t={};return t.define=n.define||n.init,t.fullname=_$common_117.make_plugin_key(n),t.loading=!0,{op:"merge",out:{plugin:t}}},preload:e=>{let n=e.ctx.seneca,t=e.data.plugin;if(n.options().system.plugin.load_once&&n.has_plugin(t))return{op:"stop",why:"already-loaded",out:{plugin:{loading:!1}}};let a={};"function"==typeof t.define.preload&&(a=t.define.preload.call(n,t)||{});let i=a.name||t.name;return{op:"seneca_plugin",out:{merge:{meta:a,plugin:{name:i,fullname:_$common_117.make_plugin_key(i,t.tag)}},plugin:t}}},meta:e=>{let n=e.ctx.seneca,t=e.data.plugin,a=e.data.meta,i={};i[t.name]=a.export||t,i[t.fullname]=a.export||t;let l=a.exportmap||a.exports||{};if(Object.keys(l).forEach((e=>{let n=l[e];if(void 0!==n){let a=t.fullname+"/"+e;i[a]=n;let l=t.name+"/"+e;i[l]=n}})),a.order&&a.order.plugin){let e=Array.isArray(a.order.plugin)?a.order.plugin:[a.order.plugin];n.order.plugin.add(e),delete a.order.plugin}return{op:"seneca_export",out:{exports:i}}},legacy_extend:e=>{let n=e.ctx.seneca,t=e.data.meta;t.extend&&"object"==typeof t.extend&&("function"==typeof t.extend.action_modifier&&n.private$.action_modifiers.push(t.extend.action_modifier),"function"==typeof t.extend.logger&&(t.extend.logger.replace||"function"!=typeof n.private$.logger.add?n.private$.logger=t.extend.logger:n.private$.logger.add(t.extend.logger)))},delegate:e=>{let n=e.ctx.seneca,t=e.data.plugin,a=n.delegate({plugin$:{name:t.name,tag:t.tag},fatal$:!0});t.shared=Object.create(null),a.shared=t.shared,a.plugin=t,a.private$=Object.create(n.private$),a.private$.ge=a.private$.ge.gate(),a.die=_$common_117.makedie(a,{type:"plugin",plugin:t.name});let i=[];return a.add=function(){let e=[...arguments],l=e[e.length-1]||{};return"function"==typeof l&&(l={},e.push(l)),null!=l&&"object"==typeof l&&(l.plugin_name=t.name||"-",l.plugin_tag=t.tag||"-",l.plugin_fullname=t.fullname,l.log=a.log,i.push(l)),n.add.apply(a,e),this},a.__update_plugin__=function(e){a.context.name=e.name||"-",a.context.tag=e.tag||"-",a.context.full=e.fullname||"-",i.forEach((function(n){n.plugin_name=e.name||n.plugin_name||"-",n.plugin_tag=e.tag||n.plugin_tag||"-",n.plugin_fullname=e.fullname||n.plugin_fullname||"-"}))},a.init=function(e){let n={role:"seneca",plugin:"init",init:t.name};null!=t.tag&&"-"!=t.tag&&(n.tag=t.tag),a.add(n,(function(n,t){e.call(this,t)}))},a.context.plugin=t,a.context.plugin.mark=Math.random(),{op:"merge",out:{delegate:a}}},call_define:e=>{let n=e.data.plugin,t=e.data.delegate,a=e.ctx.seq.index++,i={role:"seneca",plugin:"define",name:n.name,seq:a};return null!==n.tag&&(i.tag=n.tag),new Promise((e=>{t.add(i,((n,t)=>{e({op:"merge",out:{seq:a,plugin_done:t}})})),t.act({role:"seneca",plugin:"define",name:n.name,tag:n.tag,seq:a,default$:{},fatal$:!0,local$:!0})}))},options:e=>{let n=e.data.plugin,t=e.data.delegate||e.ctx.seneca,a=t.options(),i=n.fullname,l=n.defaults,r=Object.assign({},a.plugin[i],a.plugin[i+"$"+n.tag]),o=i!==n.name?n.name:null;o||0!==i.indexOf("seneca-")||(o=i.substring(7));let u=Object.assign({},a.plugin[o],a.plugin[o+"$"+n.tag]),p={},g=n.errors||n.define&&n.define.errors;g&&(p.errors=g);let s,d=Object.assign(p,u,r,n.options||{}),c={},m=t.valid,_=t.util.Joi,f="function"!=typeof l||l.gubu?l:l({valid:m,Joi:_});if(null!=f&&0!==Object.keys(f).length&&a.valid.active&&a.valid.plugin)if(f.$_root)c=t.util.deep(f,d);else{let e=f.gubu&&f.gubu.gubu$;e||null!=f.errors||null==g||(f.errors={});let n=[];c=(e?f:t.valid(f))(d,{err:n}),0<n.length&&(s=t.error("invalid_plugin_option",{name:i,err_msg:n.map((e=>e.t)).join("; "),options:d}))}else c=d;return{op:"seneca_options",err:s,out:{plugin:{options:c,options_schema:null}}}},define:e=>{let n,t=e.ctx.seneca,a=e.data.plugin,i=e.data.delegate,l=e.data.plugin.options;return i.log.debug({kind:"plugin",case:"DEFINE",name:a.name,tag:a.tag,options:l,callpoint:e.ctx.callpoint}),n=__intern_125.define_plugin(i,a,t.util.clean(l)),n instanceof Promise?n.then(r):r(n);function r(e){return a.meta=e,"function"==typeof e&&(e={service:e}),a.name=e.name||a.name,a.tag=e.tag||a.tag||a.options&&a.options.tag$,a.fullname=_$common_117.make_plugin_key(a),a.service=e.service||a.service,i.__update_plugin__(a),t.private$.plugins[a.fullname]=a,t.private$.plugin_order.byname.push(a.name),t.private$.plugin_order.byname=_$uniq_92(t.private$.plugin_order.byname),t.private$.plugin_order.byref.push(a.fullname),"function"==typeof l.defined$&&l.defined$(a),{op:"merge",out:{meta:e}}}},call_prepare:e=>{let n=e.data.plugin,t=e.data.plugin.options,a=e.data.delegate;if(!1===t.init$)return;let i=e.data.exports;return a.log.debug({kind:"plugin",case:"INIT",name:n.name,tag:n.tag,exports:i}),new Promise((t=>{a.act({role:"seneca",plugin:"init",seq:e.data.seq,init:n.name,tag:n.tag,default$:{},fatal$:!0,local$:!0},(function(e,n){t({op:"merge",out:{prepare:{err:e,res:n}}})}))}))},complete:e=>{let n=e.data.prepare,t=e.data.plugin,a=e.data.plugin_done,i=e.data.plugin.options,l=e.data.delegate,r=l.options();if(n){if(n.err){let e={err_code:"plugin_init"};return e.plugin_error=n.err.message,"action-timeout"===n.err.code&&(e.err_code="plugin_init_timeout",e.timeout=r.timeout),{op:"seneca_complete",out:{plugin:e}}}let e=t.name+(t.tag?"$"+t.tag:"");r.debug.print&&r.debug.print.options&&__Print_125.plugin_options(l,e,i),l.log.info({kind:"plugin",case:"READY",name:t.name,tag:t.tag}),"function"==typeof i.inited$&&i.inited$(t)}return a(),{op:"seneca_complete",out:{plugin:{loading:!1}}}}}}function make_intern(){return{op:{seneca_plugin:(e,n,t)=>((0,nua_1.default)(t,e.out.merge,{preserve:!0}),n.seneca.private$.plugins[t.plugin.fullname]=e.out.plugin,{stop:!1}),seneca_export:(e,n,t)=>(Object.assign(t.exports,e.out.exports),Object.assign(n.seneca.private$.exports,e.out.exports),{stop:!1}),seneca_options:(e,n,t)=>{(0,nua_1.default)(t.plugin,e.out.plugin,{preserve:!0});let a=t.plugin.fullname,i=t.plugin.options,l={plugin:{}};return l.plugin[a]=i,n.seneca.options(l),{stop:!1}},seneca_complete:(e,n,t)=>((0,nua_1.default)(t.plugin,e.out.plugin,{preserve:!0}),t.prepare.err&&t.delegate.die(t.delegate.error(t.prepare.err,t.plugin.err_code,t.plugin)),{stop:!0})},define_plugin:function(e,n,t){if(n.define.length>1){let t=n.define.toString();throw n.init_func_sig=(t.match(/^(.*)\r*\n/)||[])[1],e.error("unsupported_legacy_plugin",n)}let a;t.errors&&(n.eraro=_$eraro_13({package:"seneca",msgmap:t.errors,override:!0}));try{a=n.define.call(e,t)||{}}catch(e){_$common_117.wrap_error(e,"plugin_define_failed",{fullname:n.fullname,message:(e.message+(" ("+e.stack.match(/\n.*?\n/)).replace(/\n.*\//g,"")).replace(/\n/g,""),options:t,repo:n.repo?" "+n.repo+"/issues":""})}return a instanceof Promise?a.then(i):i(a);function i(e){const n="string"==typeof e?{name:e}:e;return n.options=n.options||t,n}}}}const Plugin={api_use:api_use,intern:__intern_125};_$plugin_125.Plugin=Plugin;
var _$inward_119 = {};
"use strict";Object.defineProperty(_$inward_119,"__esModule",{value:!0}),_$inward_119.Inward=void 0;const __intern_119={};function inward_msg_modify(a){const e=a.ctx,t=a.data;var n=t.meta;if(e.actdef){var r=e.actdef.fixed,c=e.actdef.custom;r&&Object.assign(t.msg,r),c&&(n.custom=n.custom||{},Object.assign(n.custom,c))}}function inward_limit_msg(a){const e=a.ctx,t=a.data;var n=e.options,r=t.meta;if(r.parents&&n.limits.maxparents<r.parents.length)return{op:"stop",out:{kind:"error",code:"maxparents",info:{maxparents:n.limits.maxparents,numparents:r.parents.length,parents:r.parents.map((a=>a[_$common_117.TRACE_PATTERN]+" "+a[_$common_117.TRACE_ACTION])),args:(0,_$common_117.inspect)((0,_$common_117.clean)(t.msg)).replace(/\n/g,"")}}}}function inward_announce(a){const e=a.ctx,t=a.data;e.actdef&&("function"==typeof e.seneca.on_act_in&&e.seneca.on_act_in(e.actdef,t.msg,t.meta),e.seneca.emit("act-in",t.msg,null,t.meta))}function inward_closed(a){const e=a.ctx,t=a.data;if(e.seneca.flags.closed&&!t.meta.closing)return{op:"stop",out:{kind:"error",code:"closed",info:{args:(0,_$common_117.inspect)((0,_$common_117.clean)(t.msg)).replace(/\n/g,"")}}}}function inward_act_stats(a){const e=a.ctx;if(e.actdef){var t=e.seneca.private$;++t.stats.act.calls;var n=e.actdef.pattern;++(t.stats.actmap[n]=t.stats.actmap[n]||{}).calls}}function inward_act_default(a){const e=a.ctx,t=a.data;var n=e.options,r=t.msg,c=t.meta;if(!e.actdef){var i=c.dflt||(n.strict.find?c.dflt:{});if(null!=i&&("object"==typeof i||Array.isArray(i)))return{op:"stop",out:{kind:"result",result:i,log:{level:"debug",data:{kind:"act",case:"DEFAULT"}}}};if(null!=i)return{op:"stop",out:{kind:"error",code:"act_default_bad",info:{args:(0,_$common_117.inspect)((0,_$common_117.clean)(r)).replace(/\n/g,""),xdefault:(0,_$common_117.inspect)(i)}}}}}function inward_act_not_found(a){const e=a.ctx,t=a.data;var n=e.options,r=t.msg;if(!e.actdef)return{op:"stop",out:{kind:"error",code:"act_not_found",info:{args:(0,_$common_117.inspect)((0,_$common_117.clean)(r)).replace(/\n/g,"")},log:{level:n.trace.unknown?"warn":"debug",data:{kind:"act",case:"UNKNOWN"}}}}}function inward_validate_msg(a){const e=a.ctx,t=a.data;var n=e.options,r=t.msg,c=null;if(n.valid.active&&n.valid.message)if(e.actdef.gubu)try{t.msg=e.actdef.gubu(r)}catch(a){c=a}else"function"==typeof e.actdef.validate&&e.actdef.validate(r,(function(a){c=a}));if(c)return{op:"stop",out:{kind:"error",code:"act_invalid_msg",info:{pattern:e.actdef.pattern,message:c.message,msg:(0,_$common_117.clean)(r),error:c,props:c.gubu?c.props:[]},log:{level:n.trace.invalid?"warn":null,data:{kind:"act",case:"INVALID"}}}}}function inward_act_cache(a){const e=a.ctx,t=a.data;var n=e.options,r=t.meta.id,c=e.seneca.private$;if(null!=r&&n.history.active){var i=c.history.get(r);if(i){c.stats.act.cache++;var s=i.result[i.result.length-1]||{},o={op:"stop",out:{kind:s.err?"error":"result",result:s.res||null,error:s.err||null,log:{level:"debug",data:{kind:"act",case:"CACHE",cachetime:s.when}}}};return e.cached$=!0,o}}}function inward_warnings(a){const e=a.ctx,t=a.data;var n=e.options,r=t.msg;n.debug.deprecation&&e.actdef.deprecate&&e.seneca.log.warn({kind:"act",case:"DEPRECATED",msg:r,pattern:e.actdef.pattern,notice:e.actdef.deprecate,callpoint:e.callpoint})}function inward_msg_meta(a){const e=a.ctx,t=a.data;var n=t.meta;n.pattern=e.actdef.pattern,n.client_pattern=e.actdef.client_pattern,n.action=e.actdef.id,n.plugin=Object.assign({},n.plugin,e.actdef.plugin),n.start=null==n.start?e.start:n.start,n.parents=n.parents||[],n.trace=n.trace||[];var r=e.seneca.private$.act&&e.seneca.private$.act.parent,c=r&&r.custom||n.custom||{};r&&(n.parents=n.parents.concat(r.parents||[]),n.parents.unshift((0,_$common_117.make_trace_desc)(r))),n.custom=Object.assign(c,n.custom,e.seneca.fixedmeta&&e.seneca.fixedmeta.custom),t.msg.explain$&&Array.isArray(t.msg.explain$)?n.explain=t.msg.explain$:r&&r.explain&&(n.explain=r.explain),e.seneca.private$.explain&&(n.explain=n.explain||[],e.seneca.private$.explain.push(n.explain))}function inward_prepare_delegate(a){const e=a.ctx,t=a.data,n=t.meta,r=e.seneca.private$.plugins[n.plugin.fullname];r&&(e.seneca.plugin=r,e.seneca.shared=r.shared),e.seneca.fixedargs.tx$=t.meta.tx,t.reply=t.reply.bind(e.seneca),t.reply.seneca=e.seneca,e.seneca.reply=function a(e,t){a(e,t)},e.seneca.explain=__intern_119.explain.bind(e.seneca,n),n.explain&&e.seneca.explain({explain$:!0,msg$:(0,_$common_117.clean)(t.msg)})}function inward_sub(a){const e=a.ctx,t=a.data;var n=t.meta,r=e.seneca.private$;if(!n.prior){var c=e.seneca.util.clean(t.msg),i=r.subrouter.inward.find(c,!1,!0);c.in$=!0;for(var s=0;s<i.length;s++)for(var o=i[s],d=0;d<o.length;d++){var l=o[d];try{l.call(e.seneca,c,null,t.meta)}catch(a){return{op:"stop",out:{kind:"error",code:"sub_inward_action_failed",error:a}}}}}}__intern_119.explain=function(a,e){var t=this.explain,n=a.explain;return!0===e||!1===e?t.call(this,e):(n&&null!=e&&(e.explain$&&(e.explain$={start:a.start,pattern:a.pattern,action:a.action,id:a.id,instance:a.instance,tag:a.tag,seneca:a.seneca,version:a.version,gate:a.gate,fatal:a.fatal,local:a.local,direct:a.direct,closing:a.closing,timeout:a.timeout,dflt:a.dflt,custom:a.custom,plugin:a.plugin,prior:a.prior,caller:a.caller,parents:a.parents,remote:a.remote,sync:a.sync,trace:a.trace,sub:a.sub,data:a.data,err:a.err,err_trace:a.err_trace,error:a.error,empty:a.empty}),n.push(e&&"object"==typeof e?e:{content:e})),n&&this.explain)};let Inward={inward_msg_modify:inward_msg_modify,inward_closed:inward_closed,inward_act_cache:inward_act_cache,inward_act_default:inward_act_default,inward_act_not_found:inward_act_not_found,inward_validate_msg:inward_validate_msg,inward_warnings:inward_warnings,inward_msg_meta:inward_msg_meta,inward_limit_msg:inward_limit_msg,inward_act_stats:inward_act_stats,inward_prepare_delegate:inward_prepare_delegate,inward_announce:inward_announce,inward_sub:inward_sub,intern:__intern_119};_$inward_119.Inward=Inward;
var _$outward_124 = {};
"use strict";Object.defineProperty(_$outward_124,"__esModule",{value:!0}),_$outward_124.Outward=void 0;var __intern_124={};function outward_make_error(e){const r=e.ctx,t=e.data;if(!r.options.legacy.error&&t.res&&!t.meta.error&&t.res.meta$&&t.res.meta$.err){var a=new Error(t.res.message);for(var o in t.res)a[o]=t.res[o];t.res=a}}function outward_act_cache(e){const r=e.ctx,t=e.data;var a=r.options,o=t.res,c=t.meta.id,n=r.seneca.private$;if(null!=c&&a.history.active){var s=n.history.get(c);s&&s.result.push({when:Date.now(),res:o})}}function outward_act_stats(e){const r=e.ctx,t=e.data;if(r.actdef&&!r.cached$){var a=r.seneca.private$,o=a.stats.act,c=t.meta;++o.done,c&&null==c.prior&&a.timestats.point(r.duration,r.actdef.pattern);var n=r.actdef.pattern,s=a.stats.actmap[n]=a.stats.actmap[n]||{};c&&c.error?(++o.fails,++s.fails):++s.done}}function outward_res_object(e){const r=e.ctx,t=e.data;var a=r.options,o=t.msg,c=t.res;void 0===t.res&&(t.res=null);var n=null!=c&&!(c&&"object"==typeof c||c instanceof Error||c.meta$||c.entity$||c.force$);t.out instanceof Error&&(n=!0);var s=!("generate_id"===o.cmd||!0===o.note||"native"===o.cmd||"quickcode"===o.cmd);a.strict.result&&s&&n&&(t.res=r.seneca.private$.error("result_not_objarr",{pattern:r.actdef.pattern,args:_$util_145.inspect(_$common_117.clean(o)).replace(/\n/g,""),result:c}),t.meta.error=!0)}function outward_announce(e){const r=e.ctx,t=e.data;t.meta.error||("function"==typeof r.seneca.on_act_out&&r.seneca.on_act_out(r.actdef,t.res,t.meta),r.seneca.emit("act-out",t.msg,t.res,t.meta),r.seneca.log.debug(r.actlog(r.actdef,t.msg,t.meta,r.origmsg,{kind:"act",case:"OUT",duration:r.duration,res:t.res,did:r.seneca.did})))}function outward_trace(e){const r=e.ctx,t=e.data;var a=r.seneca.private$,o=t.meta,c=t.reply_meta;o&&c&&(o.trace=o.trace||[],o.trace.push({desc:_$common_117.make_trace_desc(c),trace:c.trace||[]}));var n=a.act&&a.act.parent;n&&(n.trace=n.trace||[],n.trace.push({desc:_$common_117.make_trace_desc(o),trace:o.trace||[]}))}function outward_msg_meta(e){const r=e.data;var t=r.meta,a=r.reply_meta;t&&a&&(t.custom=Object.assign(t.custom,a.custom))}function outward_act_error(e){const r=e.ctx,t=e.data;var a=r.seneca,o=r.actdef,c=t.meta;if(c.error){if(t.error_desc=__intern_124.act_error(a,r,t),c.fatal)return a.die(t.error_desc.err);t.has_callback=t.error_desc.call_cb,a&&"function"==typeof a.on_act_err&&a.on_act_err(o,t.res,c),t.err=t.error_desc.err,delete t.err.meta$,t.res=null,t.meta=t.error_desc.err.meta$||t.meta}else t.err=null}function outward_res_entity(e){const r=e.ctx,t=e.data;var a=r.seneca;t.res&&t.res.entity$&&a.make$&&(t.res=a.make$(t.res))}function outward_sub(e){const r=e.ctx,t=e.data;var a=t.meta,o=r.seneca.private$;if(!a.prior){var c=r.seneca.util.clean(t.msg),n=o.subrouter.outward.find(c,!1,!0);c.out$=!0;for(var s=t.res||t.err||null,i=0;i<n.length;i++)for(var u=n[i],d=0;d<u.length;d++){var l=u[d];try{l.call(r.seneca,c,s,t.meta)}catch(e){return{op:"stop",out:{kind:"error",code:"sub_outward_action_failed",error:e}}}}}}__intern_124.act_error=function(e,r,t){var a=r.duration,o=r.callpoint,c=r.actdef||{},n=r.origmsg,s=r.reply,i=t.meta,u=t.msg,d=e.options(),l=!0,_=t.res||t.err;if(_.seneca)_.orig&&"string"==typeof _.orig.code&&0===_.orig.code.indexOf("perm/")&&(_=_.orig);else{var m=Object.assign({},_.details,{message:_.eraro&&_.orig?_.orig.message:_.message,pattern:c.pattern,fn:c.func,callback:s,instance:e.toString(),callpoint:o});if(d.legacy.error)_=r.error(_,"act_execute",m);else{var f=r.error("act_execute",{pattern:c.pattern,message:_.message,callpoint:o});if(delete f.stack,_.meta$=_.meta$||i||{},_.meta$.data=e.util.clean(n),_.meta$.err){var p=Object.assign({},i);p.err=f,_.meta$.err_trace=_.meta$.err_trace||[],_.meta$.err_trace.push(p)}else _.meta$.err=f}}d.legacy.error&&(_.details=_.details||{},_.details.plugin=_.details.plugin||{});var g=r.actlog(c,u,i,n,{kind:"act",case:"ERR",duration:a});return g=r.errlog(_,g),null==_.callpoint&&(_.callpoint=_$common_117.error.callpoint(_)),e.log.error(g),e.emit("act-err","action",u,i,_),e.emit("act-err-4","callback",u,i,_),"function"!=typeof d.errhandler||u&&i.fatal||(l=!d.errhandler.call(e,_,_.meta$||i)),{call_cb:l,err:_}};const Outward={test$:{intern:__intern_124},outward_act_cache:outward_act_cache,outward_res_object:outward_res_object,outward_act_stats:outward_act_stats,outward_make_error:outward_make_error,outward_announce:outward_announce,outward_trace:outward_trace,outward_act_error:outward_act_error,outward_res_entity:outward_res_entity,outward_msg_meta:outward_msg_meta,outward_sub:outward_sub};_$outward_124.Outward=Outward;
var _$flatten_91 = {};
(function (global){(function (){
var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function arrayPush(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,Symbol=root.Symbol,propertyIsEnumerable=objectProto.propertyIsEnumerable,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0;function baseFlatten(e,t,r,n,o){var a=-1,l=e.length;for(r||(r=isFlattenable),o||(o=[]);++a<l;){var b=e[a];t>0&&r(b)?t>1?baseFlatten(b,t-1,r,n,o):arrayPush(o,b):n||(o[o.length]=b)}return o}function isFlattenable(e){return isArray(e)||isArguments(e)||!!(spreadableSymbol&&e&&e[spreadableSymbol])}function flatten(e){return(e?e.length:0)?baseFlatten(e,1):[]}function isArguments(e){return isArrayLikeObject(e)&&hasOwnProperty.call(e,"callee")&&(!propertyIsEnumerable.call(e,"callee")||objectToString.call(e)==argsTag)}var isArray=Array.isArray;function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isFunction(e){var t=isObject(e)?objectToString.call(e):"";return t==funcTag||t==genTag}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}_$flatten_91=flatten;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
var _$legacy_120 = {};
"use strict";var ____importDefault_120=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_$legacy_120,"__esModule",{value:!0}),_$legacy_120.Legacy=void 0;const __util_1_120=____importDefault_120(_$util_145),errors_1=____importDefault_120(_$errors_118),__Argu_120=(0,_$gubuMin_74.MakeArgu)("seneca"),internals={error:_$eraro_13({package:"seneca",msgmap:errors_1.default,override:!0})};function flatten(r,e){for(var t=[];null!=r&&0<r.length;){var n=_$common_117.deep(r[0]);delete n.prop,t.push(n),r=r[0][e]}return t}function nil(){for(var r=0;r<arguments.length;r++)if("function"==typeof arguments[r])return arguments[r]()}function copydata(r){var e;if(null===r||"object"!=typeof r)return r;if(__util_1_120.default.types.isNativeError(r))return e={},Object.getOwnPropertyNames(r).forEach((function(t){e[t]=r[t]})),e;if(r.constructor&&"Date"===r.constructor.name)return(e=new Date).setTime(r.getTime()),e;if(Array.isArray(r)){e=[];for(var t=0,n=r.length;t<n;++t)e[t]=copydata(r[t]);return e}for(var a in e={},r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=copydata(r[a]));return e}function recurse(r,e,t){var n=this;r="number"==typeof r?Array.from({length:r},((r,e)=>e)):[...r],function a(o,i){if(o)return t(o,i);var c=r.shift();void 0!==c?e.call(n,c,a):t.call(n,o,i)}.call(n)}function argprops(r,e,t,n){n=Array.isArray(n)?n:n&&"object"==typeof n?Object.keys(n):"string"==typeof n?n.split(/\s*,\s*/):""+n;var a=_$common_117.clean(Object.assign({},e));return a=_$common_117.deep(r,a,t),n.forEach((r=>delete a[r])),a}function findpins(){for(var r=this,e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];var n=[];return _$flatten_91(e).forEach((function(e){e="string"==typeof e?_$jsonicMin_1(e):e,n=n.concat(r.private$.actrouter.list(e).map((function(r){return r.match})))})),n}function act_if(){var r=this;const e=__Argu_120(arguments,{execute:Boolean,actargs:(0,_$gubuMin_74.Rest)((0,_$gubuMin_74.Any)())});return e.execute?r.act.apply(r,e.actargs):r}function hasact(r){return!!this.find(r,{exact:!1})}function make_legacy_fail(r){return function(){for(var e,t=new Array(arguments.length),n=0;n<t.length;++n)t[n]=arguments[n];var a="function"==typeof t[t.length-1]?t[t.length-1]:null;if(a&&t.pop(),t[0]&&"object"==typeof t[0]){var o=t[0].code;"string"==typeof o&&t.unshift(o)}var i=internals.error.apply(null,t);return i.callpoint=((null===(e=(new Error).stack)||void 0===e?void 0:e.match(/^.*\n.*\n\s*(.*)/))||[])[1],i.seneca={code:i.code,valmap:i.details},this.log.error(_$common_117.make_standard_err_log_entry(i)),r.errhandler&&r.errhandler.call(this,i),a&&a.call(this,i),i}}const Legacy={flatten:flatten,nil:nil,copydata:copydata,recurse:recurse,argprops:argprops,findpins:findpins,act_if:act_if,hasact:hasact,make_legacy_fail:make_legacy_fail};_$legacy_120.Legacy=Legacy;
var _$options_123 = {};
(function (process){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$options_123,"__esModule",{value:!0}),_$options_123.resolve_options=resolve_options;const fs_1=__importDefault(_$_empty_8),path_1=__importDefault(_$pathBrowserify_105),{Gubu:Gubu}=_$gubuMin_74,error=_$eraro_13({package:"seneca",msgmap:ERRMSGMAP()});function resolve_options(e,o,t){let r=Gubu(o);const n={argv:{},env:{},default_file:{},loaded:{}};let i,s={};function a(e,o,t){var r,i;const a="./seneca.options.js",c="./options.seneca.js";let u=t.from;"string"==typeof t&&(u=t,t={}),"string"==typeof u&&(n.loaded=l(u));const f=_$minimist_93((t&&t.debug&&t.debug.argv||process.argv).slice(2)),g=t&&t.debug&&t.debug.env||process.env;if(fs_1.default.existsSync&&fs_1.default.existsSync(c))throw error("inverted_file_name",{from:c,module:e});try{n.default_file=e.require&&e.require(a)}catch(o){if("MODULE_NOT_FOUND"!==o.code){const t={errmsg:o.message,from:a,module:e};throw error(o,"require_default_options",t)}}g.SENECA_OPTIONS&&(n.env=(0,_$common_117.deep)({},n.env,_$jsonicMin_1(g.SENECA_OPTIONS))),g.SENECA_TEST&&(n.env.test=boolify(g.SENECA_TEST)),g.SENECA_QUIET&&(n.env.quiet=boolify(g.SENECA_QUIET)),f.seneca&&(f.seneca.options&&"object"==typeof f.seneca.options?n.argv=f.seneca.options:"string"==typeof f.seneca.options&&("print"===f.seneca.options?n.argv={debug:{print:{options:!0}}}:n.argv=_$jsonicMin_1(f.seneca.options)),"string"==typeof n.argv.from&&(n.argv=(0,_$common_117.deep)(l(n.argv.from),n.argv)),boolifyDeep(n.argv),null!=f.seneca.tag&&(n.argv.tag=""+f.seneca.tag),f.seneca.log&&(n.argv.log=n.argv.log||{},function(e,o){const t=Array.isArray(e)?e[0]:e;if("string"==typeof t)try{o.log=_$jsonicMin_1(t)}catch(e){o.log=t}else if(t&&"object"==typeof t){o.log={};const e=Object.keys(t.level||t);e.length>0&&(o.log={level:e[0]})}}(f.seneca.log,n.argv)),f.seneca.test&&(n.argv.test=f.seneca.test),f.seneca.quiet&&(n.argv.quiet=f.seneca.quiet));const p={};!1===t.legacy?p.legacy={error:!1,meta:!1,builtin_actions:!1}:!0===t.legacy&&(p.legacy={});const d=!1!==(null===(r=t.valid)||void 0===r?void 0:r.active)&&!1!==(null===(i=t.valid)||void 0===i?void 0:i.option);let _=(0,_$common_117.deep)(d?{}:o(),n.default_file,s,n.loaded,t,p,n.env,n.argv);return d&&(_=o(_)),_.log=_.log||_.logger||_.logging||{},_}function l(e){let o={};const t=path_1.default.basename(e)!==e?e:path_1.default.join(process.cwd(),e);if(t.match(/\.json$/i)){const e=fs_1.default.readFileSync&&fs_1.default.readFileSync(t).toString()||"";o=_$jsonicMin_1(e)}else if(t.match(/\.js$/i))try{o=i.require(t)}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw error(e,"require_options",{from:t,module:i})}return o}return i=t.module&&t.module.require?t.module:e.parent&&e.parent.require?e.parent:e,s=a(i,r,t),delete s.module,{set:function(e){if(null==e)throw error("no_options");return s="string"==typeof e||e.reload$?a(i,r,e):(0,_$common_117.deep)(s,e),s},get:function(){return s}}}function boolify(e){try{return!!JSON.parse(e)}catch(e){return!1}}function boolifyDeep(e){return Object.keys(e).forEach((function(o){e[o]="true"===e[o]||"false"!==e[o]&&(e[o]&&"object"==typeof e[o]?boolifyDeep(e[o]):e[o])})),e}function ERRMSGMAP(){return{inverted_file_name:"Please use seneca.options.js as the default options file name. The alternate name options.seneca.js is not supported.",require_default_options:"Call to require failed for <%=from%>: <%=errmsg%>."}}
}).call(this)}).call(this,_$browser_108)
var _$actions_114 = {};
"use strict";Object.defineProperty(_$actions_114,"__esModule",{value:!0}),_$actions_114.addActions=addActions;/* removed: const _$legacy_120=require("./legacy"); */;function addActions(t){t.stats=make_action_seneca_stats(t.private$),t.add("sys:seneca,on:point",on_point).add("sys:seneca,cmd:ping",cmd_ping).add("sys:seneca,cmd:stats",t.stats).add("sys:seneca,cmd:close",action_seneca_close).add("sys:seneca,info:fatal",action_seneca_fatal).add("sys:seneca,get:options",action_options_get),t.options().legacy.builtin_actions&&(t.add({role:"seneca",cmd:"ping"},cmd_ping),t.add({role:"seneca",cmd:"stats"},t.stats),t.add({role:"seneca",cmd:"close"},action_seneca_close),t.add({role:"seneca",info:"fatal"},action_seneca_fatal),t.add({role:"seneca",get:"options"},action_options_get))}function on_point(t,a){a()}function cmd_ping(t,a){a(this.ping())}function action_seneca_fatal(t,a){a()}function action_seneca_close(t,a){this.emit("close"),a()}function make_action_seneca_stats(t){return function(a,e){var s;(a=a||{},t.stats.actmap[a.pattern])?(s=t.stats.actmap[a.pattern]).time=t.timestats.calculate(a.pattern):((s=Object.assign({},t.stats)).now=new Date,s.uptime=s.now-s.start,s.now=new Date(s.now).toISOString(),s.start=new Date(s.start).toISOString(),null==a.summary||!0===a.summary?s.actmap=void 0:Object.keys(t.stats.actmap).forEach((a=>{t.stats.actmap[a].time=t.timestats.calculate(a)})));return e&&e(s),s}}function action_options_get(t,a){var e=this.options(),s=t.base||null,n=s?e[s]||{}:e,c=t.key?n[t.key]:n;a(_$legacy_120.Legacy.copydata(c))}
var _$transport_130 = {};
"use strict";var ____importDefault_130=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_$transport_130,"__esModule",{value:!0}),_$transport_130.transport=transport;const __util_1_130=____importDefault_130(_$util_145);function transport(t){t.add("role:transport,cmd:listen",action_listen),t.add("role:transport,cmd:client",action_client);const e={};e.stringifyJSON=stringifyJSON,e.parseJSON=parseJSON,e.externalize_msg=externalize_msg,e.externalize_reply=externalize_reply,e.internalize_msg=internalize_msg,e.internalize_reply=internalize_reply,e.close=closeTransport,e.info=function(){const e=t.list(),n={local:{},remote:{}};return e.forEach((function(e){const r=t.find(e,{exact:!0});r.client?n.remote[r.pattern]=r.id:n.local[r.pattern]=r.id})),n},t.private$.exports["transport/utils"]=e}function externalize_msg(t,e,n){if(e)return(e instanceof Error||__util_1_130.default.types.isNativeError(e))&&(e=Object.getOwnPropertyNames(e).reduce(((t,n)=>(t[n]=e[n],t)),{})),e.meta$=n,e}function externalize_reply(t,e,n,r){let i=e||n;return i||(i={},r.empty=!0),i.meta$=r,(i instanceof Error||__util_1_130.default.types.isNativeError(i))&&(i=Object.getOwnPropertyNames(i).reduce(((t,e)=>(t[e]=i[e],t)),{}),i.meta$.error=!0),i}function internalize_msg(t,e){if(!e)return;const n=(e=handle_entity(t,e)).meta$||{};return delete e.meta$,delete e.fatal$,e.id$=n.id,e.sync$=n.sync,e.custom$=n.custom,e.explain$=n.explain,e.parents$=n.parents||[],e.parents$.unshift((0,_$common_117.make_trace_desc)(n)),e.remote$=!0,e}function internalize_reply(t,e){let n={},r=null,i=null;return e&&(n=e.meta$,n&&(delete e.meta$,n.remote=!0,n.error?(r=new Error(e.message),Object.assign(r,e)):n.empty||(i=handle_entity(t,e)))),{err:r,out:i,meta:n}}function stringifyJSON(t){if(t)return(0,_$common_117.stringify)(t)}function parseJSON(t){if(!t)return;const e=t.toString();try{return JSON.parse(e)}catch(t){return t.input=e,t}}function handle_entity(t,e){return t.make$&&(e.entity$&&(e=t.make$(e)),Object.keys(e).forEach((function(n){const r=e[n];r&&"object"==typeof r&&r.entity$&&(e[n]=t.make$(r))}))),e}function register(t,e){return function(n,r){this.private$.transport.register.push({when:Date.now(),config:t,err:n,res:r}),e(n,r)}}function closeTransport(t,e){t.add("role:seneca,cmd:close",(function(t,n){const r=this;e.call(r,(function(e){e&&r.log.error(e),r.prior(t,n)}))}))}function action_listen(t,e){const n=Object.assign({},t.config,{role:"transport",hook:"listen"});delete n.cmd;const r=this.util.clean(n);this.act(r,register(r,e))}function action_client(t,e){const n=Object.assign({},t.config,{role:"transport",hook:"client"});delete n.cmd;const r=this.util.clean(n);this.act(r,register(r,e))}
var _$package_131={
"name": "seneca",
"description": "A Microservices Framework for Node.js",
"version": "4.0.0-rc4",
"license": "MIT",
"homepage": "http://senecajs.org",
"keywords": [
"micro",
"service",
"microservice",
"micro-service",
"microservices",
"micro-services",
"services",
"micro services",
"micro service",
"framework",
"minimum",
"viable",
"product",
"toolkit",
"startup"
],
"author": "Richard Rodger (http://richardrodger.com/)",
"contributors": [
"Adrien Becchis (https://github.com/AdrieanKhisbe)",
"Alexandru Mircea (https://github.com/mirceaalexandru)",
"Adrian Rossouw (http://daemon.co.za)",
"Colin Ihrig (https://github.com/cjihrig)",
"Cristian Ianto (https://github.com/iantocristian)",
"Cristian Kiss (https://github.com/ckiss)",
"David Mark Clements (https://github.com/davidmarkclements)",
"Dean McDonnell (https://github.com/mcdonnelldean)",
"Dominic Tarr (https://github.com/dominictarr)",
"Dustin Deus (https://github.com/StarpTech)",
"Glen Keane (https://github.com/thekemkid)",
"Gege Pincin (https://github.com/Georgette)",
"Jake Pruitt (https://github.com/jakepruitt)",
"Maciej Małecki (http://mmalecki.com)",
"Matteo Collina (https://github.com/mcollina)",
"Marian Radulescu (https://github.com/marianr)",
"Marius Ursache (https://github.com/bamse16)",
"Martin Betak (https://github.com/matobet)",
"Maxence Dalmais (https://github.com/maxired)",
"Mihai Dima (https://github.com/mihaidma)",
"Naomi Feehan (https://github.com/naomifeehan)",
"Paolo Chiodi (https://github.com/paolochiodi)",
"Peter Elger (https://github.com/pelger)",
"Reto Inderbitzin (https://github.com/indr)",
"Reid Rankin (https://github.com/reidrankin)",
"Tane Piper (https://github.com/tanepiper)",
"Wyatt Preul (https://github.com/geek)",
"Vald Houbiev (https://github.com/vladgolubev)",
"Vito Tardia (https://github.com/vtardia)"
],
"repository": {
"type": "git",
"url": "https://github.com/senecajs/seneca.git"
},
"files": [
"LICENSE",
"README.md",
"CHANGES.md",
"lib",
"seneca.*"
],
"engines": {
"node": ">=14"
},
"main": "seneca.js",
"scripts": {
"watch": "tsc -w -d",
"build": "tsc -d",
"test": "lab -v -P test -L -t 85 --sourcemaps --transform node_modules/lab-transform-typescript -I AggregateError,atob,btoa,AbortController,AbortSignal,EventTarget,Event,MessageChannel,MessagePort,MessageEvent,performance -r console -o stdout -r html -o test/coverage.html",
"test-some": "lab -v -P test --sourcemaps --transform node_modules/lab-transform-typescript -g",
"coveralls": "lab -s -P test -I AggregateError,atob,btoa,DOMException,AbortController,AbortSignal,EventTarget,Event,MessageChannel,MessagePort,MessageEvent,performance,structuredClone -r lcov > ./coverage/lcov.info",
"coverage": "lab -v -P test -L -t 90 -r html > docs/coverage.html",
"smoke": "node test/stubs/launch.js",
"prettier": "prettier --write *.js lib/*.js test/*.js",
"clean": "rm -rf node_modules package-lock.json yarn.lock",
"reset": "npm run clean && npm i && npm run build && npm test",
"repo-tag": "REPO_VERSION=`node -e \"console.log(require('./package').version)\"` && echo TAG: v$REPO_VERSION && git commit -a -m v$REPO_VERSION && git push && git tag v$REPO_VERSION && git push --tags;",
"repo-publish": "npm run clean && npm i && npm run repo-publish-quick",
"repo-publish-quick": "npm run prettier && npm run build && npm run test && npm run repo-tag && npm publish --access public --registry https://registry.npmjs.org"
},
"dependencies": {
"eraro": "^3.0.1",
"fast-safe-stringify": "^2.1.1",
"gate-executor": "^3.1.1",
"gubu": "^8.2.1",
"@jsonic/jsonic-next": "2.12.1",
"lodash.defaultsdeep": "^4.6.1",
"lodash.flatten": "^4.4.0",
"lodash.uniq": "^4.5.0",
"minimist": "^1.2.8",
"nid": "^2.0.1",
"ordu": "^2.2.0",
"patrun": "^7.2.5",
"rolling-stats": "^0.2.1",
"use-plugin": "^13.1.0"
},
"devDependencies": {
"@hapi/code": "^9.0.3",
"@hapi/lab": "^25.2.0",
"@seneca/test-plugin": "0.1.0",
"@types/node": "^20.14.10",
"async": "^3.2.5",
"bench": "^0.3.6",
"coveralls": "^3.1.1",
"gex": "^4.0.1",
"handlebars": "^4.7.8",
"lab-transform-typescript": "^3.0.1",
"lolex": "^6.0.0",
"prettier": "^3.3.2",
"seneca-entity": "^27.2.0",
"seneca-error-test": "^0.2.2",
"seneca-promisify": "^3.7.2",
"summary": "^2.1.0",
"typescript": "^5.5.3"
}
}
var _$seneca_132 = { exports: {} };
(function (process){(function (){
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$seneca_132.exports,"__esModule",{value:!0});const nid_1=__importDefault(_$nidMin_94),{Ordu:Ordu}=_$orduMin_104,{make_logging:make_logging}=_$logging_121,{API:API}=_$api_116,{make_ready:make_ready}=_$ready_128,{Legacy:Legacy}=_$legacy_120,{resolve_options:resolve_options}=_$options_123,{Print:Print}=_$print_126,{addActions:addActions}=_$actions_114,{transport:transport}=_$transport_130,package_json_1=__importDefault(_$package_131),{error:error,deep:deep}=_$common_117,{One:One,Any:Any,Skip:Skip,Open:Open}=_$gubuMin_74.Gubu,option_defaults={tag:"-",timeout:22222,idlen:12,didlen:4,id$:Skip(String),default_plugins:Open({}),test:!1,quiet:!1,log:Any(make_logging().default_logspec),logger:One(Function,Object,String,null),death_delay:11111,deathdelay:11111,close_delay:22222,errhandler:Skip(One(Function,null)),from:Skip(String),module:Skip(),error:{capture:{},identify:e=>e instanceof Error},valid:{active:!0,message:!0,option:!0,plugin:!0},debug:{fragile:!1,undead:!1,print:{options:!1,fatal:"summary",env:!1,err:!1,depth:2},act_caller:!1,short_logs:!1,callpoint:!1,deprecation:!0,argv:One([],null),env:One({},null),datalen:333},strict:{result:!0,fixedargs:!0,add:!1,find:!0,maxloop:11,exports:!1},history:{active:!0,prune:!0,interval:100},trace:{act:One(Function,!1),stack:!1,unknown:One(String,!0),invalid:!1},stats:{size:1024,interval:6e4,running:!1},plugin:{},plugins:One({},[],null),system:{exit:(...e)=>{console.log("EXIT",e),console.trace()},close_signals:{SIGHUP:!1,SIGTERM:!1,SIGINT:!1,SIGBREAK:!1},plugin:{load_once:!1},action:{add:!0}},internal:Open({print:{log:One(Function,null),err:One(Function,null)}}),status:{interval:6e4,running:!1},transport:Open({port:10101,host:Skip(String),path:Skip(String),protocol:Skip(String)}),limits:{maxparents:33},events:{},legacy:One(Boolean,{error:!1,meta:!1,builtin_actions:!1}),order:{add:{debug:!1},inward:{debug:!1},outward:{debug:!1},use:{debug:!1}},prior:{direct:!1},reload$:Skip(Boolean)},seneca_util={Eraro:_$eraro_13,Jsonic:_$jsonicMin_1,Nid:nid_1.default,Patrun:_$patrunMin_106.Patrun,Gex:_$patrunMin_106.Gex,Gubu:_$gubuMin_74.Gubu,pins:_$common_117.pins,clean:_$common_117.clean,pattern:_$common_117.pattern,print:_$common_117.print,error:error,deep:_$common_117.deep,deepextend:_$common_117.deep,parsepattern:_$common_117.parsePattern,pincanon:_$common_117.pincanon,router:function(){return(0,_$patrunMin_106.Patrun)()},resolve_option:_$common_117.resolve_option,flatten:Legacy.flatten},intern={util:seneca_util};function Seneca(){_$events_66.EventEmitter.call(this),this.setMaxListeners(0)}function init(e,t){var n=deep({},"string"==typeof e?{from:e}:e,t);n.deathdelay=n.death_delay;var r=make_seneca(n),a=r.options();r.log.debug({kind:"notice",options:{...a,internal:null}}),Print.print_options(r,a),a.plugins=null==a.plugins?{}:a.plugins;for(var i=Object.keys(a.plugins),d=0;d<i.length;d++){var o=i[d],s=a.plugins[o];!1===s?r.private$.ignore_plugins[o]=!0:r.use(s)}return r.ready((function(){this.log.info({kind:"notice",data:"hello "+this.id})})),r}function make_seneca(e){var t=make_private();t.error=error;var n=new Seneca;n.private$=t,t.optioner=resolve_options(_$seneca_132,option_defaults,e);var r=t.optioner.get();t.print={log:r.internal.print.log||Print.internal_log,err:r.internal.print.err||Print.internal_err},t.actrouter=r.internal.actrouter||(0,_$patrunMin_106.Patrun)({gex:!0}),t.translationrouter=r.internal.translationrouter||(0,_$patrunMin_106.Patrun)({gex:!0});const a=r.internal.subrouter||{};t.subrouter={inward:a.inward||(0,_$patrunMin_106.Patrun)({gex:!0}),outward:a.outward||(0,_$patrunMin_106.Patrun)({gex:!0})};["log","act_in","act_out","act_err","ready","close"].forEach((function(e){"function"==typeof r.events[e]&&n.on(e,r.events[e])})),t.actnid=(0,nid_1.default)({length:r.idlen}),t.didnid=(0,nid_1.default)({length:r.didlen}),t.next_action_id=_$common_117.autoincr();var i=t.callpoint=_$common_117.make_callpoint(r.debug.callpoint);n.start_time=Date.now(),n.context={},n.version=package_json_1.default.version,n.fixedargs={},n.fixedmeta={},n.fixedmeta={},n.flags={closed:!1},Object.defineProperty(n,"root",{value:n}),t.history=_$common_117.history(r.history);const d=make_ready(n);n.order={};const o=_$plugin_125.Plugin.api_use(i,{debug:!!r.debug.ordu||!!r.order.use.debug});n.use=o.use,n.order.plugin=o.ordu,n.toString=API.toString,n.has=API.has,n.find=API.find,n.list=API.list,n.status=API.status,n.reply=API.reply,n.sub=_$sub_129.api_sub,n.list_plugins=API.list_plugins,n.find_plugin=API.find_plugin,n.has_plugin=API.has_plugin,n.ignore_plugin=API.ignore_plugin,n.listen=API.listen(i),n.client=API.client(i),n.gate=API.gate,n.ungate=API.ungate,n.translate=API.translate,n.ping=API.ping,n.test=API.test,n.quiet=API.quiet,n.export=API.export,n.depends=API.depends,n.delegate=API.delegate,n.prior=_$prior_127.Prior.api_prior,n.inward=API.inward,n.outward=API.outward,n.error=API.error,n.fail=API.fail,n.explain=API.explain,n.decorate=API.decorate,n.seneca=API.seneca,n.close=API.close(i),n.options=API.options,n.fix=API.fix,n.wrap=API.wrap,n.add=_$add_115.api_add,n.message=_$add_115.api_message,n.act=_$act_113.api_act,n.post=_$util_145.promisify(n.act),n.direct=_$act_113.api_direct,n.ready=d.api_ready,n.valid=_$gubuMin_74.Gubu,n.prepare=API.prepare,n.destroy=API.destroy,n.internal=function(){return{ordu:{use:o.ordu}}},n.findact=n.find,n.plugins=API.list_plugins,n.findplugin=API.find_plugin,n.hasplugin=API.has_plugin,n.hasact=Legacy.hasact,n.act_if=Legacy.act_if,n.findpins=Legacy.findpins,n.pinact=Legacy.findpins,n.next_act=Legacy.next_act,n.idgen=(0,nid_1.default)({length:r.idlen}),r.tag=null!=r.tag?r.tag:option_defaults.tag,n.id=r.id$||n.idgen()+"/"+n.start_time+"/"+process.pid+"/"+n.version+"/"+r.tag,n.tag=r.tag,(r.debug.short_logs||r.log.short)&&(r.idlen=2,n.idgen=(0,nid_1.default)({length:r.idlen}),n.id=n.idgen()+"/"+r.tag),n.fullname="Seneca/"+n.id,n.die=_$common_117.makedie(n,{type:"sys",plugin:"seneca",tag:n.version,id:n.id,callpoint:i}),n.util=seneca_util,t.exports={options:r},t.decorations={},n.on("error",n.die),t.ge=_$gateExecutorMin_71({timeout:r.timeout}).clear(d.clear_ready).start(),r.status.interval>0&&r.status.running&&(t.stats=t.stats||{},t.status_interval=setInterval((function(){n.log.info({kind:"status",alive:Date.now()-t.stats.start,act:t.stats.act})}),r.status.interval)),r.stats&&(t.timestats=new _$rollingStats_109.NamedStats(r.stats.size,r.stats.interval),r.stats.running&&setInterval((function(){t.timestats.calculate()}),r.stats.interval)),t.plugin_order={byname:[],byref:[]},t.use=_$use_139({prefix:["seneca-","@seneca/"],module:r.internal.module||_$seneca_132,msgprefix:!1,builtin:"",merge_defaults:!1}),t.action_modifiers=[function(e){e.rules=Object.assign(e.rules,deep({},e.func.validate||{}))}],t.sub={handler:null,tracers:[]},n.order.add=new Ordu({name:"add",debug:!!r.debug.ordu||!!r.order.add.debug}).add(_$add_115.task.translate).add(_$add_115.task.prepare).add(_$add_115.task.plugin).add(_$add_115.task.callpoint).add(_$add_115.task.flags).add(_$add_115.task.action).add(_$add_115.task.prior).add(_$add_115.task.rules).add(_$add_115.task.register).add(_$add_115.task.modify),n.order.inward=new Ordu({name:"inward",debug:!!r.debug.ordu||!!r.order.inward.debug}).add(_$inward_119.Inward.inward_msg_modify).add(_$inward_119.Inward.inward_closed).add(_$inward_119.Inward.inward_act_cache).add(_$inward_119.Inward.inward_act_default).add(_$inward_119.Inward.inward_act_not_found).add(_$inward_119.Inward.inward_act_stats).add(_$inward_119.Inward.inward_validate_msg).add(_$inward_119.Inward.inward_warnings).add(_$inward_119.Inward.inward_msg_meta).add(_$inward_119.Inward.inward_limit_msg).add(_$inward_119.Inward.inward_prepare_delegate).add(_$inward_119.Inward.inward_sub).add(_$inward_119.Inward.inward_announce),n.order.outward=new Ordu({name:"outward",debug:!!r.debug.ordu||!!r.order.outward.debug}).add(_$outward_124.Outward.outward_make_error).add(_$outward_124.Outward.outward_act_stats).add(_$outward_124.Outward.outward_act_cache).add(_$outward_124.Outward.outward_res_object).add(_$outward_124.Outward.outward_res_entity).add(_$outward_124.Outward.outward_msg_meta).add(_$outward_124.Outward.outward_trace).add(_$outward_124.Outward.outward_sub).add(_$outward_124.Outward.outward_announce).add(_$outward_124.Outward.outward_act_error),r.logger&&"object"==typeof r.logger&&(r.logger.from_options$=!0);var s=t.logging.build_log(n);return(r=t.exports.options=t.optioner.set({log:s})).test&&n.test("string"==typeof r.test?r.test:null),r.quiet&&n.quiet(),t.exit_close=function(){n.close((function(e){e&&1!=t.optioner.get().quiet&&t.print.err(e),r.system.exit(e?null===e.exit?1:e.exit:0)}))},r.system.action.add&&addActions(n),r.legacy.error=!1,r.transport=deep({port:62345,host:"127.0.0.1",path:"/act",protocol:"http"},r.transport),transport(n),Print(n,r.debug.argv||process.argv),_$common_117.each(r.system.close_signals,(function(e,n){e&&process.once(n,t.exit_close)})),n.act("sys:seneca,on:point,point:start"),n}function make_private(){return{logging:make_logging(),stats:{start:Date.now(),act:{calls:0,done:0,fails:0,cache:0},actmap:{}},actdef:{},transport:{register:[]},plugins:{root$:{name:"root$",fullname:"root$",tag:"-",options:Object.create(null),shared:Object.create(null)}},ignore_plugins:{},cleared:0}}_$util_145.inherits(Seneca,_$events_66.EventEmitter),Seneca.prototype.isSeneca=!0,Seneca.prototype.toJSON=function(){return{isSeneca:!0,id:this.id,did:this.did,fixedargs:this.fixedargs,fixedmeta:this.fixedmeta,start_time:this.start_time,version:this.version}},Seneca.prototype[_$util_145.inspect.custom]=Seneca.prototype.toJSON,init.Seneca=Seneca,init.loghandler=Legacy.loghandler,init.use=function(){for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];var n=init();return n.use.apply(n,e)},init.test=function(){return init().test(...arguments)},init.quiet=function(){return init().quiet(...arguments)},init.util=seneca_util,init.valid=_$gubuMin_74.Gubu,init.test$={intern:intern},_$seneca_132.exports.default=init,_$seneca_132.exports=init;
}).call(this)}).call(this,_$browser_108)
_$seneca_132 = _$seneca_132.exports
var _$senecaBrowserSrc_147 = {};
(function (global){(function (){
_$shim_142();let Timers=_$main_138({});global.setImmediate=global.setImmediate||Timers.setImmediate;let SenecaExport=function(e,t){(e=e||{}).legacy=e.legacy||!1;let n=_$seneca_132(e,t);async function o(e){let t=Object.keys(e);for(let n of t){let t=e[n];e[n]="function"==typeof t?await t():t}return e}return n.use({name:"browser",init:function(e){e.endpoint=e.endpoint||"/seneca",e.fetch=e.fetch||{},e.headers=e.headers||{},this.add("role:transport,hook:client,type:browser",(function(n,i){let a=this;i({send:async function(n,i,l){let s={method:"post",...e.fetch,mode:"cors",cache:"no-cache",headers:await o({"Content-Type":"application/json",...e.fetch.headers,...e.headers}),body:r.stringifyJSON(r.externalize_msg(a,n,l))},c=e.endpoint;if("function"==typeof c)c=c.call(a,n,s,l);else if(t){let e=t.find(n);e&&(c=null!=e.endpoint?e.endpoint:(null==e.prefix?"":"function"==typeof e.prefix?e.prefix.call(a,n,s,l):e.prefix)+c+(null==e.suffix?"":"function"==typeof e.suffix?e.suffix.call(a,n,s,l):e.suffix))}fetch(c,s).then((function(e){try{return e.json()}catch(t){return t.message=e.status+": "+e.statusText+": "+t.message,i(t)}})).then((function(e){Array.isArray(e)&&(e.meta$={id:"ID"});let t=r.internalize_reply(a,e);i(t.err,t.out,t.meta)}))}})}));let t,r=this.export("transport/utils");"object"==typeof e.pathmap&&(t=n.util.Patrun({gex:!0}),Object.entries(e.pathmap).forEach((e=>{t.add(n.util.Jsonic(e[0]),e[1])})),e.debug&&console.log("SENECA","pathmap",""+t))}}),n.root.order.inward.add({name:"debounce",before:"inward_msg_modify",exec:function(e){let t=e.data.msg;if(t.debounce$){let n=e.ctx.seneca.status().history.log,o=e.ctx.seneca.find(t);if(!o)return null;for(let e=n.length-1;-1<e;e--)if(n[e].meta.pattern===o.pattern&&0===n[e].result.length)return{op:"stop",out:{kind:"result",result:{}}}}return null}}),n};SenecaExport.util=_$seneca_132.util,SenecaExport.valid=_$seneca_132.valid,SenecaExport.prototype=_$seneca_132.prototype,SenecaExport.browser={version:"7.1.0"},_$senecaBrowserSrc_147=SenecaExport;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
return _$senecaBrowserSrc_147;
});