@h3ravel/config 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-AJP2XXVX.js +1660 -0
- package/dist/chunk-AJP2XXVX.js.map +1 -0
- package/dist/{dist-MPQ4EAQT.js → dist-3TY2VKAS.js} +2 -2
- package/dist/index.cjs +36 -20274
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-4W6577EG.js +0 -21574
- package/dist/chunk-4W6577EG.js.map +0 -1
- /package/dist/{dist-MPQ4EAQT.js.map → dist-3TY2VKAS.js.map} +0 -0
|
@@ -0,0 +1,1660 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
// ../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
|
|
29
|
+
var require_Reflect = __commonJS({
|
|
30
|
+
"../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js"() {
|
|
31
|
+
"use strict";
|
|
32
|
+
var Reflect2;
|
|
33
|
+
(function(Reflect3) {
|
|
34
|
+
(function(factory) {
|
|
35
|
+
var root = typeof globalThis === "object" ? globalThis : typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis();
|
|
36
|
+
var exporter = makeExporter(Reflect3);
|
|
37
|
+
if (typeof root.Reflect !== "undefined") {
|
|
38
|
+
exporter = makeExporter(root.Reflect, exporter);
|
|
39
|
+
}
|
|
40
|
+
factory(exporter, root);
|
|
41
|
+
if (typeof root.Reflect === "undefined") {
|
|
42
|
+
root.Reflect = Reflect3;
|
|
43
|
+
}
|
|
44
|
+
function makeExporter(target, previous) {
|
|
45
|
+
return function(key, value) {
|
|
46
|
+
Object.defineProperty(target, key, {
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value
|
|
50
|
+
});
|
|
51
|
+
if (previous)
|
|
52
|
+
previous(key, value);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
__name(makeExporter, "makeExporter");
|
|
56
|
+
function functionThis() {
|
|
57
|
+
try {
|
|
58
|
+
return Function("return this;")();
|
|
59
|
+
} catch (_) {
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
__name(functionThis, "functionThis");
|
|
63
|
+
function indirectEvalThis() {
|
|
64
|
+
try {
|
|
65
|
+
return (0, eval)("(function() { return this; })()");
|
|
66
|
+
} catch (_) {
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
__name(indirectEvalThis, "indirectEvalThis");
|
|
70
|
+
function sloppyModeThis() {
|
|
71
|
+
return functionThis() || indirectEvalThis();
|
|
72
|
+
}
|
|
73
|
+
__name(sloppyModeThis, "sloppyModeThis");
|
|
74
|
+
})(function(exporter, root) {
|
|
75
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
76
|
+
var supportsSymbol = typeof Symbol === "function";
|
|
77
|
+
var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
|
|
78
|
+
var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
79
|
+
var supportsCreate = typeof Object.create === "function";
|
|
80
|
+
var supportsProto = {
|
|
81
|
+
__proto__: []
|
|
82
|
+
} instanceof Array;
|
|
83
|
+
var downLevel = !supportsCreate && !supportsProto;
|
|
84
|
+
var HashMap = {
|
|
85
|
+
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
86
|
+
create: supportsCreate ? function() {
|
|
87
|
+
return MakeDictionary(/* @__PURE__ */ Object.create(null));
|
|
88
|
+
} : supportsProto ? function() {
|
|
89
|
+
return MakeDictionary({
|
|
90
|
+
__proto__: null
|
|
91
|
+
});
|
|
92
|
+
} : function() {
|
|
93
|
+
return MakeDictionary({});
|
|
94
|
+
},
|
|
95
|
+
has: downLevel ? function(map, key) {
|
|
96
|
+
return hasOwn.call(map, key);
|
|
97
|
+
} : function(map, key) {
|
|
98
|
+
return key in map;
|
|
99
|
+
},
|
|
100
|
+
get: downLevel ? function(map, key) {
|
|
101
|
+
return hasOwn.call(map, key) ? map[key] : void 0;
|
|
102
|
+
} : function(map, key) {
|
|
103
|
+
return map[key];
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var functionPrototype = Object.getPrototypeOf(Function);
|
|
107
|
+
var _Map = typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
108
|
+
var _Set = typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
109
|
+
var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
110
|
+
var registrySymbol = supportsSymbol ? Symbol.for("@reflect-metadata:registry") : void 0;
|
|
111
|
+
var metadataRegistry = GetOrCreateMetadataRegistry();
|
|
112
|
+
var metadataProvider = CreateMetadataProvider(metadataRegistry);
|
|
113
|
+
function decorate(decorators, target, propertyKey, attributes) {
|
|
114
|
+
if (!IsUndefined(propertyKey)) {
|
|
115
|
+
if (!IsArray(decorators))
|
|
116
|
+
throw new TypeError();
|
|
117
|
+
if (!IsObject(target))
|
|
118
|
+
throw new TypeError();
|
|
119
|
+
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
|
|
120
|
+
throw new TypeError();
|
|
121
|
+
if (IsNull(attributes))
|
|
122
|
+
attributes = void 0;
|
|
123
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
124
|
+
return DecorateProperty(decorators, target, propertyKey, attributes);
|
|
125
|
+
} else {
|
|
126
|
+
if (!IsArray(decorators))
|
|
127
|
+
throw new TypeError();
|
|
128
|
+
if (!IsConstructor(target))
|
|
129
|
+
throw new TypeError();
|
|
130
|
+
return DecorateConstructor(decorators, target);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
__name(decorate, "decorate");
|
|
134
|
+
exporter("decorate", decorate);
|
|
135
|
+
function metadata(metadataKey, metadataValue) {
|
|
136
|
+
function decorator(target, propertyKey) {
|
|
137
|
+
if (!IsObject(target))
|
|
138
|
+
throw new TypeError();
|
|
139
|
+
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
|
|
140
|
+
throw new TypeError();
|
|
141
|
+
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
142
|
+
}
|
|
143
|
+
__name(decorator, "decorator");
|
|
144
|
+
return decorator;
|
|
145
|
+
}
|
|
146
|
+
__name(metadata, "metadata");
|
|
147
|
+
exporter("metadata", metadata);
|
|
148
|
+
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
149
|
+
if (!IsObject(target))
|
|
150
|
+
throw new TypeError();
|
|
151
|
+
if (!IsUndefined(propertyKey))
|
|
152
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
153
|
+
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
154
|
+
}
|
|
155
|
+
__name(defineMetadata, "defineMetadata");
|
|
156
|
+
exporter("defineMetadata", defineMetadata);
|
|
157
|
+
function hasMetadata(metadataKey, target, propertyKey) {
|
|
158
|
+
if (!IsObject(target))
|
|
159
|
+
throw new TypeError();
|
|
160
|
+
if (!IsUndefined(propertyKey))
|
|
161
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
162
|
+
return OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
163
|
+
}
|
|
164
|
+
__name(hasMetadata, "hasMetadata");
|
|
165
|
+
exporter("hasMetadata", hasMetadata);
|
|
166
|
+
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
167
|
+
if (!IsObject(target))
|
|
168
|
+
throw new TypeError();
|
|
169
|
+
if (!IsUndefined(propertyKey))
|
|
170
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
171
|
+
return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
172
|
+
}
|
|
173
|
+
__name(hasOwnMetadata, "hasOwnMetadata");
|
|
174
|
+
exporter("hasOwnMetadata", hasOwnMetadata);
|
|
175
|
+
function getMetadata(metadataKey, target, propertyKey) {
|
|
176
|
+
if (!IsObject(target))
|
|
177
|
+
throw new TypeError();
|
|
178
|
+
if (!IsUndefined(propertyKey))
|
|
179
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
180
|
+
return OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
181
|
+
}
|
|
182
|
+
__name(getMetadata, "getMetadata");
|
|
183
|
+
exporter("getMetadata", getMetadata);
|
|
184
|
+
function getOwnMetadata(metadataKey, target, propertyKey) {
|
|
185
|
+
if (!IsObject(target))
|
|
186
|
+
throw new TypeError();
|
|
187
|
+
if (!IsUndefined(propertyKey))
|
|
188
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
189
|
+
return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
|
|
190
|
+
}
|
|
191
|
+
__name(getOwnMetadata, "getOwnMetadata");
|
|
192
|
+
exporter("getOwnMetadata", getOwnMetadata);
|
|
193
|
+
function getMetadataKeys(target, propertyKey) {
|
|
194
|
+
if (!IsObject(target))
|
|
195
|
+
throw new TypeError();
|
|
196
|
+
if (!IsUndefined(propertyKey))
|
|
197
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
198
|
+
return OrdinaryMetadataKeys(target, propertyKey);
|
|
199
|
+
}
|
|
200
|
+
__name(getMetadataKeys, "getMetadataKeys");
|
|
201
|
+
exporter("getMetadataKeys", getMetadataKeys);
|
|
202
|
+
function getOwnMetadataKeys(target, propertyKey) {
|
|
203
|
+
if (!IsObject(target))
|
|
204
|
+
throw new TypeError();
|
|
205
|
+
if (!IsUndefined(propertyKey))
|
|
206
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
207
|
+
return OrdinaryOwnMetadataKeys(target, propertyKey);
|
|
208
|
+
}
|
|
209
|
+
__name(getOwnMetadataKeys, "getOwnMetadataKeys");
|
|
210
|
+
exporter("getOwnMetadataKeys", getOwnMetadataKeys);
|
|
211
|
+
function deleteMetadata(metadataKey, target, propertyKey) {
|
|
212
|
+
if (!IsObject(target))
|
|
213
|
+
throw new TypeError();
|
|
214
|
+
if (!IsUndefined(propertyKey))
|
|
215
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
216
|
+
if (!IsObject(target))
|
|
217
|
+
throw new TypeError();
|
|
218
|
+
if (!IsUndefined(propertyKey))
|
|
219
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
220
|
+
var provider = GetMetadataProvider(
|
|
221
|
+
target,
|
|
222
|
+
propertyKey,
|
|
223
|
+
/*Create*/
|
|
224
|
+
false
|
|
225
|
+
);
|
|
226
|
+
if (IsUndefined(provider))
|
|
227
|
+
return false;
|
|
228
|
+
return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);
|
|
229
|
+
}
|
|
230
|
+
__name(deleteMetadata, "deleteMetadata");
|
|
231
|
+
exporter("deleteMetadata", deleteMetadata);
|
|
232
|
+
function DecorateConstructor(decorators, target) {
|
|
233
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
234
|
+
var decorator = decorators[i];
|
|
235
|
+
var decorated = decorator(target);
|
|
236
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
237
|
+
if (!IsConstructor(decorated))
|
|
238
|
+
throw new TypeError();
|
|
239
|
+
target = decorated;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return target;
|
|
243
|
+
}
|
|
244
|
+
__name(DecorateConstructor, "DecorateConstructor");
|
|
245
|
+
function DecorateProperty(decorators, target, propertyKey, descriptor) {
|
|
246
|
+
for (var i = decorators.length - 1; i >= 0; --i) {
|
|
247
|
+
var decorator = decorators[i];
|
|
248
|
+
var decorated = decorator(target, propertyKey, descriptor);
|
|
249
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
250
|
+
if (!IsObject(decorated))
|
|
251
|
+
throw new TypeError();
|
|
252
|
+
descriptor = decorated;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return descriptor;
|
|
256
|
+
}
|
|
257
|
+
__name(DecorateProperty, "DecorateProperty");
|
|
258
|
+
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
259
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
260
|
+
if (hasOwn2)
|
|
261
|
+
return true;
|
|
262
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
263
|
+
if (!IsNull(parent))
|
|
264
|
+
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
__name(OrdinaryHasMetadata, "OrdinaryHasMetadata");
|
|
268
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
269
|
+
var provider = GetMetadataProvider(
|
|
270
|
+
O,
|
|
271
|
+
P,
|
|
272
|
+
/*Create*/
|
|
273
|
+
false
|
|
274
|
+
);
|
|
275
|
+
if (IsUndefined(provider))
|
|
276
|
+
return false;
|
|
277
|
+
return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));
|
|
278
|
+
}
|
|
279
|
+
__name(OrdinaryHasOwnMetadata, "OrdinaryHasOwnMetadata");
|
|
280
|
+
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
281
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
282
|
+
if (hasOwn2)
|
|
283
|
+
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
284
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
285
|
+
if (!IsNull(parent))
|
|
286
|
+
return OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
287
|
+
return void 0;
|
|
288
|
+
}
|
|
289
|
+
__name(OrdinaryGetMetadata, "OrdinaryGetMetadata");
|
|
290
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
291
|
+
var provider = GetMetadataProvider(
|
|
292
|
+
O,
|
|
293
|
+
P,
|
|
294
|
+
/*Create*/
|
|
295
|
+
false
|
|
296
|
+
);
|
|
297
|
+
if (IsUndefined(provider))
|
|
298
|
+
return;
|
|
299
|
+
return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
300
|
+
}
|
|
301
|
+
__name(OrdinaryGetOwnMetadata, "OrdinaryGetOwnMetadata");
|
|
302
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
303
|
+
var provider = GetMetadataProvider(
|
|
304
|
+
O,
|
|
305
|
+
P,
|
|
306
|
+
/*Create*/
|
|
307
|
+
true
|
|
308
|
+
);
|
|
309
|
+
provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);
|
|
310
|
+
}
|
|
311
|
+
__name(OrdinaryDefineOwnMetadata, "OrdinaryDefineOwnMetadata");
|
|
312
|
+
function OrdinaryMetadataKeys(O, P) {
|
|
313
|
+
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
|
314
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
315
|
+
if (parent === null)
|
|
316
|
+
return ownKeys;
|
|
317
|
+
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
|
318
|
+
if (parentKeys.length <= 0)
|
|
319
|
+
return ownKeys;
|
|
320
|
+
if (ownKeys.length <= 0)
|
|
321
|
+
return parentKeys;
|
|
322
|
+
var set = new _Set();
|
|
323
|
+
var keys = [];
|
|
324
|
+
for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
|
|
325
|
+
var key = ownKeys_1[_i];
|
|
326
|
+
var hasKey = set.has(key);
|
|
327
|
+
if (!hasKey) {
|
|
328
|
+
set.add(key);
|
|
329
|
+
keys.push(key);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
|
|
333
|
+
var key = parentKeys_1[_a];
|
|
334
|
+
var hasKey = set.has(key);
|
|
335
|
+
if (!hasKey) {
|
|
336
|
+
set.add(key);
|
|
337
|
+
keys.push(key);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return keys;
|
|
341
|
+
}
|
|
342
|
+
__name(OrdinaryMetadataKeys, "OrdinaryMetadataKeys");
|
|
343
|
+
function OrdinaryOwnMetadataKeys(O, P) {
|
|
344
|
+
var provider = GetMetadataProvider(
|
|
345
|
+
O,
|
|
346
|
+
P,
|
|
347
|
+
/*create*/
|
|
348
|
+
false
|
|
349
|
+
);
|
|
350
|
+
if (!provider) {
|
|
351
|
+
return [];
|
|
352
|
+
}
|
|
353
|
+
return provider.OrdinaryOwnMetadataKeys(O, P);
|
|
354
|
+
}
|
|
355
|
+
__name(OrdinaryOwnMetadataKeys, "OrdinaryOwnMetadataKeys");
|
|
356
|
+
function Type(x) {
|
|
357
|
+
if (x === null)
|
|
358
|
+
return 1;
|
|
359
|
+
switch (typeof x) {
|
|
360
|
+
case "undefined":
|
|
361
|
+
return 0;
|
|
362
|
+
case "boolean":
|
|
363
|
+
return 2;
|
|
364
|
+
case "string":
|
|
365
|
+
return 3;
|
|
366
|
+
case "symbol":
|
|
367
|
+
return 4;
|
|
368
|
+
case "number":
|
|
369
|
+
return 5;
|
|
370
|
+
case "object":
|
|
371
|
+
return x === null ? 1 : 6;
|
|
372
|
+
default:
|
|
373
|
+
return 6;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
__name(Type, "Type");
|
|
377
|
+
function IsUndefined(x) {
|
|
378
|
+
return x === void 0;
|
|
379
|
+
}
|
|
380
|
+
__name(IsUndefined, "IsUndefined");
|
|
381
|
+
function IsNull(x) {
|
|
382
|
+
return x === null;
|
|
383
|
+
}
|
|
384
|
+
__name(IsNull, "IsNull");
|
|
385
|
+
function IsSymbol(x) {
|
|
386
|
+
return typeof x === "symbol";
|
|
387
|
+
}
|
|
388
|
+
__name(IsSymbol, "IsSymbol");
|
|
389
|
+
function IsObject(x) {
|
|
390
|
+
return typeof x === "object" ? x !== null : typeof x === "function";
|
|
391
|
+
}
|
|
392
|
+
__name(IsObject, "IsObject");
|
|
393
|
+
function ToPrimitive(input, PreferredType) {
|
|
394
|
+
switch (Type(input)) {
|
|
395
|
+
case 0:
|
|
396
|
+
return input;
|
|
397
|
+
case 1:
|
|
398
|
+
return input;
|
|
399
|
+
case 2:
|
|
400
|
+
return input;
|
|
401
|
+
case 3:
|
|
402
|
+
return input;
|
|
403
|
+
case 4:
|
|
404
|
+
return input;
|
|
405
|
+
case 5:
|
|
406
|
+
return input;
|
|
407
|
+
}
|
|
408
|
+
var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
|
|
409
|
+
var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
410
|
+
if (exoticToPrim !== void 0) {
|
|
411
|
+
var result = exoticToPrim.call(input, hint);
|
|
412
|
+
if (IsObject(result))
|
|
413
|
+
throw new TypeError();
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
|
|
417
|
+
}
|
|
418
|
+
__name(ToPrimitive, "ToPrimitive");
|
|
419
|
+
function OrdinaryToPrimitive(O, hint) {
|
|
420
|
+
if (hint === "string") {
|
|
421
|
+
var toString_1 = O.toString;
|
|
422
|
+
if (IsCallable(toString_1)) {
|
|
423
|
+
var result = toString_1.call(O);
|
|
424
|
+
if (!IsObject(result))
|
|
425
|
+
return result;
|
|
426
|
+
}
|
|
427
|
+
var valueOf = O.valueOf;
|
|
428
|
+
if (IsCallable(valueOf)) {
|
|
429
|
+
var result = valueOf.call(O);
|
|
430
|
+
if (!IsObject(result))
|
|
431
|
+
return result;
|
|
432
|
+
}
|
|
433
|
+
} else {
|
|
434
|
+
var valueOf = O.valueOf;
|
|
435
|
+
if (IsCallable(valueOf)) {
|
|
436
|
+
var result = valueOf.call(O);
|
|
437
|
+
if (!IsObject(result))
|
|
438
|
+
return result;
|
|
439
|
+
}
|
|
440
|
+
var toString_2 = O.toString;
|
|
441
|
+
if (IsCallable(toString_2)) {
|
|
442
|
+
var result = toString_2.call(O);
|
|
443
|
+
if (!IsObject(result))
|
|
444
|
+
return result;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
throw new TypeError();
|
|
448
|
+
}
|
|
449
|
+
__name(OrdinaryToPrimitive, "OrdinaryToPrimitive");
|
|
450
|
+
function ToBoolean(argument) {
|
|
451
|
+
return !!argument;
|
|
452
|
+
}
|
|
453
|
+
__name(ToBoolean, "ToBoolean");
|
|
454
|
+
function ToString(argument) {
|
|
455
|
+
return "" + argument;
|
|
456
|
+
}
|
|
457
|
+
__name(ToString, "ToString");
|
|
458
|
+
function ToPropertyKey(argument) {
|
|
459
|
+
var key = ToPrimitive(
|
|
460
|
+
argument,
|
|
461
|
+
3
|
|
462
|
+
/* String */
|
|
463
|
+
);
|
|
464
|
+
if (IsSymbol(key))
|
|
465
|
+
return key;
|
|
466
|
+
return ToString(key);
|
|
467
|
+
}
|
|
468
|
+
__name(ToPropertyKey, "ToPropertyKey");
|
|
469
|
+
function IsArray(argument) {
|
|
470
|
+
return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
|
|
471
|
+
}
|
|
472
|
+
__name(IsArray, "IsArray");
|
|
473
|
+
function IsCallable(argument) {
|
|
474
|
+
return typeof argument === "function";
|
|
475
|
+
}
|
|
476
|
+
__name(IsCallable, "IsCallable");
|
|
477
|
+
function IsConstructor(argument) {
|
|
478
|
+
return typeof argument === "function";
|
|
479
|
+
}
|
|
480
|
+
__name(IsConstructor, "IsConstructor");
|
|
481
|
+
function IsPropertyKey(argument) {
|
|
482
|
+
switch (Type(argument)) {
|
|
483
|
+
case 3:
|
|
484
|
+
return true;
|
|
485
|
+
case 4:
|
|
486
|
+
return true;
|
|
487
|
+
default:
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
__name(IsPropertyKey, "IsPropertyKey");
|
|
492
|
+
function SameValueZero(x, y) {
|
|
493
|
+
return x === y || x !== x && y !== y;
|
|
494
|
+
}
|
|
495
|
+
__name(SameValueZero, "SameValueZero");
|
|
496
|
+
function GetMethod(V, P) {
|
|
497
|
+
var func = V[P];
|
|
498
|
+
if (func === void 0 || func === null)
|
|
499
|
+
return void 0;
|
|
500
|
+
if (!IsCallable(func))
|
|
501
|
+
throw new TypeError();
|
|
502
|
+
return func;
|
|
503
|
+
}
|
|
504
|
+
__name(GetMethod, "GetMethod");
|
|
505
|
+
function GetIterator(obj) {
|
|
506
|
+
var method = GetMethod(obj, iteratorSymbol);
|
|
507
|
+
if (!IsCallable(method))
|
|
508
|
+
throw new TypeError();
|
|
509
|
+
var iterator = method.call(obj);
|
|
510
|
+
if (!IsObject(iterator))
|
|
511
|
+
throw new TypeError();
|
|
512
|
+
return iterator;
|
|
513
|
+
}
|
|
514
|
+
__name(GetIterator, "GetIterator");
|
|
515
|
+
function IteratorValue(iterResult) {
|
|
516
|
+
return iterResult.value;
|
|
517
|
+
}
|
|
518
|
+
__name(IteratorValue, "IteratorValue");
|
|
519
|
+
function IteratorStep(iterator) {
|
|
520
|
+
var result = iterator.next();
|
|
521
|
+
return result.done ? false : result;
|
|
522
|
+
}
|
|
523
|
+
__name(IteratorStep, "IteratorStep");
|
|
524
|
+
function IteratorClose(iterator) {
|
|
525
|
+
var f = iterator["return"];
|
|
526
|
+
if (f)
|
|
527
|
+
f.call(iterator);
|
|
528
|
+
}
|
|
529
|
+
__name(IteratorClose, "IteratorClose");
|
|
530
|
+
function OrdinaryGetPrototypeOf(O) {
|
|
531
|
+
var proto = Object.getPrototypeOf(O);
|
|
532
|
+
if (typeof O !== "function" || O === functionPrototype)
|
|
533
|
+
return proto;
|
|
534
|
+
if (proto !== functionPrototype)
|
|
535
|
+
return proto;
|
|
536
|
+
var prototype = O.prototype;
|
|
537
|
+
var prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
538
|
+
if (prototypeProto == null || prototypeProto === Object.prototype)
|
|
539
|
+
return proto;
|
|
540
|
+
var constructor = prototypeProto.constructor;
|
|
541
|
+
if (typeof constructor !== "function")
|
|
542
|
+
return proto;
|
|
543
|
+
if (constructor === O)
|
|
544
|
+
return proto;
|
|
545
|
+
return constructor;
|
|
546
|
+
}
|
|
547
|
+
__name(OrdinaryGetPrototypeOf, "OrdinaryGetPrototypeOf");
|
|
548
|
+
function CreateMetadataRegistry() {
|
|
549
|
+
var fallback;
|
|
550
|
+
if (!IsUndefined(registrySymbol) && typeof root.Reflect !== "undefined" && !(registrySymbol in root.Reflect) && typeof root.Reflect.defineMetadata === "function") {
|
|
551
|
+
fallback = CreateFallbackProvider(root.Reflect);
|
|
552
|
+
}
|
|
553
|
+
var first;
|
|
554
|
+
var second;
|
|
555
|
+
var rest;
|
|
556
|
+
var targetProviderMap = new _WeakMap();
|
|
557
|
+
var registry = {
|
|
558
|
+
registerProvider,
|
|
559
|
+
getProvider,
|
|
560
|
+
setProvider
|
|
561
|
+
};
|
|
562
|
+
return registry;
|
|
563
|
+
function registerProvider(provider) {
|
|
564
|
+
if (!Object.isExtensible(registry)) {
|
|
565
|
+
throw new Error("Cannot add provider to a frozen registry.");
|
|
566
|
+
}
|
|
567
|
+
switch (true) {
|
|
568
|
+
case fallback === provider:
|
|
569
|
+
break;
|
|
570
|
+
case IsUndefined(first):
|
|
571
|
+
first = provider;
|
|
572
|
+
break;
|
|
573
|
+
case first === provider:
|
|
574
|
+
break;
|
|
575
|
+
case IsUndefined(second):
|
|
576
|
+
second = provider;
|
|
577
|
+
break;
|
|
578
|
+
case second === provider:
|
|
579
|
+
break;
|
|
580
|
+
default:
|
|
581
|
+
if (rest === void 0)
|
|
582
|
+
rest = new _Set();
|
|
583
|
+
rest.add(provider);
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
__name(registerProvider, "registerProvider");
|
|
588
|
+
function getProviderNoCache(O, P) {
|
|
589
|
+
if (!IsUndefined(first)) {
|
|
590
|
+
if (first.isProviderFor(O, P))
|
|
591
|
+
return first;
|
|
592
|
+
if (!IsUndefined(second)) {
|
|
593
|
+
if (second.isProviderFor(O, P))
|
|
594
|
+
return first;
|
|
595
|
+
if (!IsUndefined(rest)) {
|
|
596
|
+
var iterator = GetIterator(rest);
|
|
597
|
+
while (true) {
|
|
598
|
+
var next = IteratorStep(iterator);
|
|
599
|
+
if (!next) {
|
|
600
|
+
return void 0;
|
|
601
|
+
}
|
|
602
|
+
var provider = IteratorValue(next);
|
|
603
|
+
if (provider.isProviderFor(O, P)) {
|
|
604
|
+
IteratorClose(iterator);
|
|
605
|
+
return provider;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {
|
|
612
|
+
return fallback;
|
|
613
|
+
}
|
|
614
|
+
return void 0;
|
|
615
|
+
}
|
|
616
|
+
__name(getProviderNoCache, "getProviderNoCache");
|
|
617
|
+
function getProvider(O, P) {
|
|
618
|
+
var providerMap = targetProviderMap.get(O);
|
|
619
|
+
var provider;
|
|
620
|
+
if (!IsUndefined(providerMap)) {
|
|
621
|
+
provider = providerMap.get(P);
|
|
622
|
+
}
|
|
623
|
+
if (!IsUndefined(provider)) {
|
|
624
|
+
return provider;
|
|
625
|
+
}
|
|
626
|
+
provider = getProviderNoCache(O, P);
|
|
627
|
+
if (!IsUndefined(provider)) {
|
|
628
|
+
if (IsUndefined(providerMap)) {
|
|
629
|
+
providerMap = new _Map();
|
|
630
|
+
targetProviderMap.set(O, providerMap);
|
|
631
|
+
}
|
|
632
|
+
providerMap.set(P, provider);
|
|
633
|
+
}
|
|
634
|
+
return provider;
|
|
635
|
+
}
|
|
636
|
+
__name(getProvider, "getProvider");
|
|
637
|
+
function hasProvider(provider) {
|
|
638
|
+
if (IsUndefined(provider))
|
|
639
|
+
throw new TypeError();
|
|
640
|
+
return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);
|
|
641
|
+
}
|
|
642
|
+
__name(hasProvider, "hasProvider");
|
|
643
|
+
function setProvider(O, P, provider) {
|
|
644
|
+
if (!hasProvider(provider)) {
|
|
645
|
+
throw new Error("Metadata provider not registered.");
|
|
646
|
+
}
|
|
647
|
+
var existingProvider = getProvider(O, P);
|
|
648
|
+
if (existingProvider !== provider) {
|
|
649
|
+
if (!IsUndefined(existingProvider)) {
|
|
650
|
+
return false;
|
|
651
|
+
}
|
|
652
|
+
var providerMap = targetProviderMap.get(O);
|
|
653
|
+
if (IsUndefined(providerMap)) {
|
|
654
|
+
providerMap = new _Map();
|
|
655
|
+
targetProviderMap.set(O, providerMap);
|
|
656
|
+
}
|
|
657
|
+
providerMap.set(P, provider);
|
|
658
|
+
}
|
|
659
|
+
return true;
|
|
660
|
+
}
|
|
661
|
+
__name(setProvider, "setProvider");
|
|
662
|
+
}
|
|
663
|
+
__name(CreateMetadataRegistry, "CreateMetadataRegistry");
|
|
664
|
+
function GetOrCreateMetadataRegistry() {
|
|
665
|
+
var metadataRegistry2;
|
|
666
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
667
|
+
metadataRegistry2 = root.Reflect[registrySymbol];
|
|
668
|
+
}
|
|
669
|
+
if (IsUndefined(metadataRegistry2)) {
|
|
670
|
+
metadataRegistry2 = CreateMetadataRegistry();
|
|
671
|
+
}
|
|
672
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
673
|
+
Object.defineProperty(root.Reflect, registrySymbol, {
|
|
674
|
+
enumerable: false,
|
|
675
|
+
configurable: false,
|
|
676
|
+
writable: false,
|
|
677
|
+
value: metadataRegistry2
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
return metadataRegistry2;
|
|
681
|
+
}
|
|
682
|
+
__name(GetOrCreateMetadataRegistry, "GetOrCreateMetadataRegistry");
|
|
683
|
+
function CreateMetadataProvider(registry) {
|
|
684
|
+
var metadata2 = new _WeakMap();
|
|
685
|
+
var provider = {
|
|
686
|
+
isProviderFor: function(O, P) {
|
|
687
|
+
var targetMetadata = metadata2.get(O);
|
|
688
|
+
if (IsUndefined(targetMetadata))
|
|
689
|
+
return false;
|
|
690
|
+
return targetMetadata.has(P);
|
|
691
|
+
},
|
|
692
|
+
OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata2,
|
|
693
|
+
OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata2,
|
|
694
|
+
OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata2,
|
|
695
|
+
OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys2,
|
|
696
|
+
OrdinaryDeleteMetadata
|
|
697
|
+
};
|
|
698
|
+
metadataRegistry.registerProvider(provider);
|
|
699
|
+
return provider;
|
|
700
|
+
function GetOrCreateMetadataMap(O, P, Create) {
|
|
701
|
+
var targetMetadata = metadata2.get(O);
|
|
702
|
+
var createdTargetMetadata = false;
|
|
703
|
+
if (IsUndefined(targetMetadata)) {
|
|
704
|
+
if (!Create)
|
|
705
|
+
return void 0;
|
|
706
|
+
targetMetadata = new _Map();
|
|
707
|
+
metadata2.set(O, targetMetadata);
|
|
708
|
+
createdTargetMetadata = true;
|
|
709
|
+
}
|
|
710
|
+
var metadataMap = targetMetadata.get(P);
|
|
711
|
+
if (IsUndefined(metadataMap)) {
|
|
712
|
+
if (!Create)
|
|
713
|
+
return void 0;
|
|
714
|
+
metadataMap = new _Map();
|
|
715
|
+
targetMetadata.set(P, metadataMap);
|
|
716
|
+
if (!registry.setProvider(O, P, provider)) {
|
|
717
|
+
targetMetadata.delete(P);
|
|
718
|
+
if (createdTargetMetadata) {
|
|
719
|
+
metadata2.delete(O);
|
|
720
|
+
}
|
|
721
|
+
throw new Error("Wrong provider for target.");
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
return metadataMap;
|
|
725
|
+
}
|
|
726
|
+
__name(GetOrCreateMetadataMap, "GetOrCreateMetadataMap");
|
|
727
|
+
function OrdinaryHasOwnMetadata2(MetadataKey, O, P) {
|
|
728
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
729
|
+
O,
|
|
730
|
+
P,
|
|
731
|
+
/*Create*/
|
|
732
|
+
false
|
|
733
|
+
);
|
|
734
|
+
if (IsUndefined(metadataMap))
|
|
735
|
+
return false;
|
|
736
|
+
return ToBoolean(metadataMap.has(MetadataKey));
|
|
737
|
+
}
|
|
738
|
+
__name(OrdinaryHasOwnMetadata2, "OrdinaryHasOwnMetadata");
|
|
739
|
+
function OrdinaryGetOwnMetadata2(MetadataKey, O, P) {
|
|
740
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
741
|
+
O,
|
|
742
|
+
P,
|
|
743
|
+
/*Create*/
|
|
744
|
+
false
|
|
745
|
+
);
|
|
746
|
+
if (IsUndefined(metadataMap))
|
|
747
|
+
return void 0;
|
|
748
|
+
return metadataMap.get(MetadataKey);
|
|
749
|
+
}
|
|
750
|
+
__name(OrdinaryGetOwnMetadata2, "OrdinaryGetOwnMetadata");
|
|
751
|
+
function OrdinaryDefineOwnMetadata2(MetadataKey, MetadataValue, O, P) {
|
|
752
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
753
|
+
O,
|
|
754
|
+
P,
|
|
755
|
+
/*Create*/
|
|
756
|
+
true
|
|
757
|
+
);
|
|
758
|
+
metadataMap.set(MetadataKey, MetadataValue);
|
|
759
|
+
}
|
|
760
|
+
__name(OrdinaryDefineOwnMetadata2, "OrdinaryDefineOwnMetadata");
|
|
761
|
+
function OrdinaryOwnMetadataKeys2(O, P) {
|
|
762
|
+
var keys = [];
|
|
763
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
764
|
+
O,
|
|
765
|
+
P,
|
|
766
|
+
/*Create*/
|
|
767
|
+
false
|
|
768
|
+
);
|
|
769
|
+
if (IsUndefined(metadataMap))
|
|
770
|
+
return keys;
|
|
771
|
+
var keysObj = metadataMap.keys();
|
|
772
|
+
var iterator = GetIterator(keysObj);
|
|
773
|
+
var k = 0;
|
|
774
|
+
while (true) {
|
|
775
|
+
var next = IteratorStep(iterator);
|
|
776
|
+
if (!next) {
|
|
777
|
+
keys.length = k;
|
|
778
|
+
return keys;
|
|
779
|
+
}
|
|
780
|
+
var nextValue = IteratorValue(next);
|
|
781
|
+
try {
|
|
782
|
+
keys[k] = nextValue;
|
|
783
|
+
} catch (e) {
|
|
784
|
+
try {
|
|
785
|
+
IteratorClose(iterator);
|
|
786
|
+
} finally {
|
|
787
|
+
throw e;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
k++;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
__name(OrdinaryOwnMetadataKeys2, "OrdinaryOwnMetadataKeys");
|
|
794
|
+
function OrdinaryDeleteMetadata(MetadataKey, O, P) {
|
|
795
|
+
var metadataMap = GetOrCreateMetadataMap(
|
|
796
|
+
O,
|
|
797
|
+
P,
|
|
798
|
+
/*Create*/
|
|
799
|
+
false
|
|
800
|
+
);
|
|
801
|
+
if (IsUndefined(metadataMap))
|
|
802
|
+
return false;
|
|
803
|
+
if (!metadataMap.delete(MetadataKey))
|
|
804
|
+
return false;
|
|
805
|
+
if (metadataMap.size === 0) {
|
|
806
|
+
var targetMetadata = metadata2.get(O);
|
|
807
|
+
if (!IsUndefined(targetMetadata)) {
|
|
808
|
+
targetMetadata.delete(P);
|
|
809
|
+
if (targetMetadata.size === 0) {
|
|
810
|
+
metadata2.delete(targetMetadata);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return true;
|
|
815
|
+
}
|
|
816
|
+
__name(OrdinaryDeleteMetadata, "OrdinaryDeleteMetadata");
|
|
817
|
+
}
|
|
818
|
+
__name(CreateMetadataProvider, "CreateMetadataProvider");
|
|
819
|
+
function CreateFallbackProvider(reflect) {
|
|
820
|
+
var defineMetadata2 = reflect.defineMetadata, hasOwnMetadata2 = reflect.hasOwnMetadata, getOwnMetadata2 = reflect.getOwnMetadata, getOwnMetadataKeys2 = reflect.getOwnMetadataKeys, deleteMetadata2 = reflect.deleteMetadata;
|
|
821
|
+
var metadataOwner = new _WeakMap();
|
|
822
|
+
var provider = {
|
|
823
|
+
isProviderFor: function(O, P) {
|
|
824
|
+
var metadataPropertySet = metadataOwner.get(O);
|
|
825
|
+
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
|
|
826
|
+
return true;
|
|
827
|
+
}
|
|
828
|
+
if (getOwnMetadataKeys2(O, P).length) {
|
|
829
|
+
if (IsUndefined(metadataPropertySet)) {
|
|
830
|
+
metadataPropertySet = new _Set();
|
|
831
|
+
metadataOwner.set(O, metadataPropertySet);
|
|
832
|
+
}
|
|
833
|
+
metadataPropertySet.add(P);
|
|
834
|
+
return true;
|
|
835
|
+
}
|
|
836
|
+
return false;
|
|
837
|
+
},
|
|
838
|
+
OrdinaryDefineOwnMetadata: defineMetadata2,
|
|
839
|
+
OrdinaryHasOwnMetadata: hasOwnMetadata2,
|
|
840
|
+
OrdinaryGetOwnMetadata: getOwnMetadata2,
|
|
841
|
+
OrdinaryOwnMetadataKeys: getOwnMetadataKeys2,
|
|
842
|
+
OrdinaryDeleteMetadata: deleteMetadata2
|
|
843
|
+
};
|
|
844
|
+
return provider;
|
|
845
|
+
}
|
|
846
|
+
__name(CreateFallbackProvider, "CreateFallbackProvider");
|
|
847
|
+
function GetMetadataProvider(O, P, Create) {
|
|
848
|
+
var registeredProvider = metadataRegistry.getProvider(O, P);
|
|
849
|
+
if (!IsUndefined(registeredProvider)) {
|
|
850
|
+
return registeredProvider;
|
|
851
|
+
}
|
|
852
|
+
if (Create) {
|
|
853
|
+
if (metadataRegistry.setProvider(O, P, metadataProvider)) {
|
|
854
|
+
return metadataProvider;
|
|
855
|
+
}
|
|
856
|
+
throw new Error("Illegal state.");
|
|
857
|
+
}
|
|
858
|
+
return void 0;
|
|
859
|
+
}
|
|
860
|
+
__name(GetMetadataProvider, "GetMetadataProvider");
|
|
861
|
+
function CreateMapPolyfill() {
|
|
862
|
+
var cacheSentinel = {};
|
|
863
|
+
var arraySentinel = [];
|
|
864
|
+
var MapIterator = (
|
|
865
|
+
/** @class */
|
|
866
|
+
function() {
|
|
867
|
+
function MapIterator2(keys, values, selector) {
|
|
868
|
+
this._index = 0;
|
|
869
|
+
this._keys = keys;
|
|
870
|
+
this._values = values;
|
|
871
|
+
this._selector = selector;
|
|
872
|
+
}
|
|
873
|
+
__name(MapIterator2, "MapIterator");
|
|
874
|
+
MapIterator2.prototype["@@iterator"] = function() {
|
|
875
|
+
return this;
|
|
876
|
+
};
|
|
877
|
+
MapIterator2.prototype[iteratorSymbol] = function() {
|
|
878
|
+
return this;
|
|
879
|
+
};
|
|
880
|
+
MapIterator2.prototype.next = function() {
|
|
881
|
+
var index = this._index;
|
|
882
|
+
if (index >= 0 && index < this._keys.length) {
|
|
883
|
+
var result = this._selector(this._keys[index], this._values[index]);
|
|
884
|
+
if (index + 1 >= this._keys.length) {
|
|
885
|
+
this._index = -1;
|
|
886
|
+
this._keys = arraySentinel;
|
|
887
|
+
this._values = arraySentinel;
|
|
888
|
+
} else {
|
|
889
|
+
this._index++;
|
|
890
|
+
}
|
|
891
|
+
return {
|
|
892
|
+
value: result,
|
|
893
|
+
done: false
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
return {
|
|
897
|
+
value: void 0,
|
|
898
|
+
done: true
|
|
899
|
+
};
|
|
900
|
+
};
|
|
901
|
+
MapIterator2.prototype.throw = function(error) {
|
|
902
|
+
if (this._index >= 0) {
|
|
903
|
+
this._index = -1;
|
|
904
|
+
this._keys = arraySentinel;
|
|
905
|
+
this._values = arraySentinel;
|
|
906
|
+
}
|
|
907
|
+
throw error;
|
|
908
|
+
};
|
|
909
|
+
MapIterator2.prototype.return = function(value) {
|
|
910
|
+
if (this._index >= 0) {
|
|
911
|
+
this._index = -1;
|
|
912
|
+
this._keys = arraySentinel;
|
|
913
|
+
this._values = arraySentinel;
|
|
914
|
+
}
|
|
915
|
+
return {
|
|
916
|
+
value,
|
|
917
|
+
done: true
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
return MapIterator2;
|
|
921
|
+
}()
|
|
922
|
+
);
|
|
923
|
+
var Map1 = (
|
|
924
|
+
/** @class */
|
|
925
|
+
function() {
|
|
926
|
+
function Map12() {
|
|
927
|
+
this._keys = [];
|
|
928
|
+
this._values = [];
|
|
929
|
+
this._cacheKey = cacheSentinel;
|
|
930
|
+
this._cacheIndex = -2;
|
|
931
|
+
}
|
|
932
|
+
__name(Map12, "Map1");
|
|
933
|
+
Object.defineProperty(Map12.prototype, "size", {
|
|
934
|
+
get: function() {
|
|
935
|
+
return this._keys.length;
|
|
936
|
+
},
|
|
937
|
+
enumerable: true,
|
|
938
|
+
configurable: true
|
|
939
|
+
});
|
|
940
|
+
Map12.prototype.has = function(key) {
|
|
941
|
+
return this._find(
|
|
942
|
+
key,
|
|
943
|
+
/*insert*/
|
|
944
|
+
false
|
|
945
|
+
) >= 0;
|
|
946
|
+
};
|
|
947
|
+
Map12.prototype.get = function(key) {
|
|
948
|
+
var index = this._find(
|
|
949
|
+
key,
|
|
950
|
+
/*insert*/
|
|
951
|
+
false
|
|
952
|
+
);
|
|
953
|
+
return index >= 0 ? this._values[index] : void 0;
|
|
954
|
+
};
|
|
955
|
+
Map12.prototype.set = function(key, value) {
|
|
956
|
+
var index = this._find(
|
|
957
|
+
key,
|
|
958
|
+
/*insert*/
|
|
959
|
+
true
|
|
960
|
+
);
|
|
961
|
+
this._values[index] = value;
|
|
962
|
+
return this;
|
|
963
|
+
};
|
|
964
|
+
Map12.prototype.delete = function(key) {
|
|
965
|
+
var index = this._find(
|
|
966
|
+
key,
|
|
967
|
+
/*insert*/
|
|
968
|
+
false
|
|
969
|
+
);
|
|
970
|
+
if (index >= 0) {
|
|
971
|
+
var size = this._keys.length;
|
|
972
|
+
for (var i = index + 1; i < size; i++) {
|
|
973
|
+
this._keys[i - 1] = this._keys[i];
|
|
974
|
+
this._values[i - 1] = this._values[i];
|
|
975
|
+
}
|
|
976
|
+
this._keys.length--;
|
|
977
|
+
this._values.length--;
|
|
978
|
+
if (SameValueZero(key, this._cacheKey)) {
|
|
979
|
+
this._cacheKey = cacheSentinel;
|
|
980
|
+
this._cacheIndex = -2;
|
|
981
|
+
}
|
|
982
|
+
return true;
|
|
983
|
+
}
|
|
984
|
+
return false;
|
|
985
|
+
};
|
|
986
|
+
Map12.prototype.clear = function() {
|
|
987
|
+
this._keys.length = 0;
|
|
988
|
+
this._values.length = 0;
|
|
989
|
+
this._cacheKey = cacheSentinel;
|
|
990
|
+
this._cacheIndex = -2;
|
|
991
|
+
};
|
|
992
|
+
Map12.prototype.keys = function() {
|
|
993
|
+
return new MapIterator(this._keys, this._values, getKey);
|
|
994
|
+
};
|
|
995
|
+
Map12.prototype.values = function() {
|
|
996
|
+
return new MapIterator(this._keys, this._values, getValue);
|
|
997
|
+
};
|
|
998
|
+
Map12.prototype.entries = function() {
|
|
999
|
+
return new MapIterator(this._keys, this._values, getEntry);
|
|
1000
|
+
};
|
|
1001
|
+
Map12.prototype["@@iterator"] = function() {
|
|
1002
|
+
return this.entries();
|
|
1003
|
+
};
|
|
1004
|
+
Map12.prototype[iteratorSymbol] = function() {
|
|
1005
|
+
return this.entries();
|
|
1006
|
+
};
|
|
1007
|
+
Map12.prototype._find = function(key, insert) {
|
|
1008
|
+
if (!SameValueZero(this._cacheKey, key)) {
|
|
1009
|
+
this._cacheIndex = -1;
|
|
1010
|
+
for (var i = 0; i < this._keys.length; i++) {
|
|
1011
|
+
if (SameValueZero(this._keys[i], key)) {
|
|
1012
|
+
this._cacheIndex = i;
|
|
1013
|
+
break;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (this._cacheIndex < 0 && insert) {
|
|
1018
|
+
this._cacheIndex = this._keys.length;
|
|
1019
|
+
this._keys.push(key);
|
|
1020
|
+
this._values.push(void 0);
|
|
1021
|
+
}
|
|
1022
|
+
return this._cacheIndex;
|
|
1023
|
+
};
|
|
1024
|
+
return Map12;
|
|
1025
|
+
}()
|
|
1026
|
+
);
|
|
1027
|
+
return Map1;
|
|
1028
|
+
function getKey(key, _) {
|
|
1029
|
+
return key;
|
|
1030
|
+
}
|
|
1031
|
+
__name(getKey, "getKey");
|
|
1032
|
+
function getValue(_, value) {
|
|
1033
|
+
return value;
|
|
1034
|
+
}
|
|
1035
|
+
__name(getValue, "getValue");
|
|
1036
|
+
function getEntry(key, value) {
|
|
1037
|
+
return [
|
|
1038
|
+
key,
|
|
1039
|
+
value
|
|
1040
|
+
];
|
|
1041
|
+
}
|
|
1042
|
+
__name(getEntry, "getEntry");
|
|
1043
|
+
}
|
|
1044
|
+
__name(CreateMapPolyfill, "CreateMapPolyfill");
|
|
1045
|
+
function CreateSetPolyfill() {
|
|
1046
|
+
var Set1 = (
|
|
1047
|
+
/** @class */
|
|
1048
|
+
function() {
|
|
1049
|
+
function Set12() {
|
|
1050
|
+
this._map = new _Map();
|
|
1051
|
+
}
|
|
1052
|
+
__name(Set12, "Set1");
|
|
1053
|
+
Object.defineProperty(Set12.prototype, "size", {
|
|
1054
|
+
get: function() {
|
|
1055
|
+
return this._map.size;
|
|
1056
|
+
},
|
|
1057
|
+
enumerable: true,
|
|
1058
|
+
configurable: true
|
|
1059
|
+
});
|
|
1060
|
+
Set12.prototype.has = function(value) {
|
|
1061
|
+
return this._map.has(value);
|
|
1062
|
+
};
|
|
1063
|
+
Set12.prototype.add = function(value) {
|
|
1064
|
+
return this._map.set(value, value), this;
|
|
1065
|
+
};
|
|
1066
|
+
Set12.prototype.delete = function(value) {
|
|
1067
|
+
return this._map.delete(value);
|
|
1068
|
+
};
|
|
1069
|
+
Set12.prototype.clear = function() {
|
|
1070
|
+
this._map.clear();
|
|
1071
|
+
};
|
|
1072
|
+
Set12.prototype.keys = function() {
|
|
1073
|
+
return this._map.keys();
|
|
1074
|
+
};
|
|
1075
|
+
Set12.prototype.values = function() {
|
|
1076
|
+
return this._map.keys();
|
|
1077
|
+
};
|
|
1078
|
+
Set12.prototype.entries = function() {
|
|
1079
|
+
return this._map.entries();
|
|
1080
|
+
};
|
|
1081
|
+
Set12.prototype["@@iterator"] = function() {
|
|
1082
|
+
return this.keys();
|
|
1083
|
+
};
|
|
1084
|
+
Set12.prototype[iteratorSymbol] = function() {
|
|
1085
|
+
return this.keys();
|
|
1086
|
+
};
|
|
1087
|
+
return Set12;
|
|
1088
|
+
}()
|
|
1089
|
+
);
|
|
1090
|
+
return Set1;
|
|
1091
|
+
}
|
|
1092
|
+
__name(CreateSetPolyfill, "CreateSetPolyfill");
|
|
1093
|
+
function CreateWeakMapPolyfill() {
|
|
1094
|
+
var UUID_SIZE = 16;
|
|
1095
|
+
var keys = HashMap.create();
|
|
1096
|
+
var rootKey = CreateUniqueKey();
|
|
1097
|
+
return (
|
|
1098
|
+
/** @class */
|
|
1099
|
+
function() {
|
|
1100
|
+
function WeakMap1() {
|
|
1101
|
+
this._key = CreateUniqueKey();
|
|
1102
|
+
}
|
|
1103
|
+
__name(WeakMap1, "WeakMap1");
|
|
1104
|
+
WeakMap1.prototype.has = function(target) {
|
|
1105
|
+
var table = GetOrCreateWeakMapTable(
|
|
1106
|
+
target,
|
|
1107
|
+
/*create*/
|
|
1108
|
+
false
|
|
1109
|
+
);
|
|
1110
|
+
return table !== void 0 ? HashMap.has(table, this._key) : false;
|
|
1111
|
+
};
|
|
1112
|
+
WeakMap1.prototype.get = function(target) {
|
|
1113
|
+
var table = GetOrCreateWeakMapTable(
|
|
1114
|
+
target,
|
|
1115
|
+
/*create*/
|
|
1116
|
+
false
|
|
1117
|
+
);
|
|
1118
|
+
return table !== void 0 ? HashMap.get(table, this._key) : void 0;
|
|
1119
|
+
};
|
|
1120
|
+
WeakMap1.prototype.set = function(target, value) {
|
|
1121
|
+
var table = GetOrCreateWeakMapTable(
|
|
1122
|
+
target,
|
|
1123
|
+
/*create*/
|
|
1124
|
+
true
|
|
1125
|
+
);
|
|
1126
|
+
table[this._key] = value;
|
|
1127
|
+
return this;
|
|
1128
|
+
};
|
|
1129
|
+
WeakMap1.prototype.delete = function(target) {
|
|
1130
|
+
var table = GetOrCreateWeakMapTable(
|
|
1131
|
+
target,
|
|
1132
|
+
/*create*/
|
|
1133
|
+
false
|
|
1134
|
+
);
|
|
1135
|
+
return table !== void 0 ? delete table[this._key] : false;
|
|
1136
|
+
};
|
|
1137
|
+
WeakMap1.prototype.clear = function() {
|
|
1138
|
+
this._key = CreateUniqueKey();
|
|
1139
|
+
};
|
|
1140
|
+
return WeakMap1;
|
|
1141
|
+
}()
|
|
1142
|
+
);
|
|
1143
|
+
function CreateUniqueKey() {
|
|
1144
|
+
var key;
|
|
1145
|
+
do
|
|
1146
|
+
key = "@@WeakMap@@" + CreateUUID();
|
|
1147
|
+
while (HashMap.has(keys, key));
|
|
1148
|
+
keys[key] = true;
|
|
1149
|
+
return key;
|
|
1150
|
+
}
|
|
1151
|
+
__name(CreateUniqueKey, "CreateUniqueKey");
|
|
1152
|
+
function GetOrCreateWeakMapTable(target, create) {
|
|
1153
|
+
if (!hasOwn.call(target, rootKey)) {
|
|
1154
|
+
if (!create)
|
|
1155
|
+
return void 0;
|
|
1156
|
+
Object.defineProperty(target, rootKey, {
|
|
1157
|
+
value: HashMap.create()
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
return target[rootKey];
|
|
1161
|
+
}
|
|
1162
|
+
__name(GetOrCreateWeakMapTable, "GetOrCreateWeakMapTable");
|
|
1163
|
+
function FillRandomBytes(buffer, size) {
|
|
1164
|
+
for (var i = 0; i < size; ++i)
|
|
1165
|
+
buffer[i] = Math.random() * 255 | 0;
|
|
1166
|
+
return buffer;
|
|
1167
|
+
}
|
|
1168
|
+
__name(FillRandomBytes, "FillRandomBytes");
|
|
1169
|
+
function GenRandomBytes(size) {
|
|
1170
|
+
if (typeof Uint8Array === "function") {
|
|
1171
|
+
var array = new Uint8Array(size);
|
|
1172
|
+
if (typeof crypto !== "undefined") {
|
|
1173
|
+
crypto.getRandomValues(array);
|
|
1174
|
+
} else if (typeof msCrypto !== "undefined") {
|
|
1175
|
+
msCrypto.getRandomValues(array);
|
|
1176
|
+
} else {
|
|
1177
|
+
FillRandomBytes(array, size);
|
|
1178
|
+
}
|
|
1179
|
+
return array;
|
|
1180
|
+
}
|
|
1181
|
+
return FillRandomBytes(new Array(size), size);
|
|
1182
|
+
}
|
|
1183
|
+
__name(GenRandomBytes, "GenRandomBytes");
|
|
1184
|
+
function CreateUUID() {
|
|
1185
|
+
var data = GenRandomBytes(UUID_SIZE);
|
|
1186
|
+
data[6] = data[6] & 79 | 64;
|
|
1187
|
+
data[8] = data[8] & 191 | 128;
|
|
1188
|
+
var result = "";
|
|
1189
|
+
for (var offset = 0; offset < UUID_SIZE; ++offset) {
|
|
1190
|
+
var byte = data[offset];
|
|
1191
|
+
if (offset === 4 || offset === 6 || offset === 8)
|
|
1192
|
+
result += "-";
|
|
1193
|
+
if (byte < 16)
|
|
1194
|
+
result += "0";
|
|
1195
|
+
result += byte.toString(16).toLowerCase();
|
|
1196
|
+
}
|
|
1197
|
+
return result;
|
|
1198
|
+
}
|
|
1199
|
+
__name(CreateUUID, "CreateUUID");
|
|
1200
|
+
}
|
|
1201
|
+
__name(CreateWeakMapPolyfill, "CreateWeakMapPolyfill");
|
|
1202
|
+
function MakeDictionary(obj) {
|
|
1203
|
+
obj.__ = void 0;
|
|
1204
|
+
delete obj.__;
|
|
1205
|
+
return obj;
|
|
1206
|
+
}
|
|
1207
|
+
__name(MakeDictionary, "MakeDictionary");
|
|
1208
|
+
});
|
|
1209
|
+
})(Reflect2 || (Reflect2 = {}));
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
// ../core/dist/index.js
|
|
1214
|
+
var import_reflect_metadata = __toESM(require_Reflect(), 1);
|
|
1215
|
+
import { PathLoader } from "@h3ravel/shared";
|
|
1216
|
+
import dotenv from "dotenv";
|
|
1217
|
+
import path from "path";
|
|
1218
|
+
import { Edge } from "edge.js";
|
|
1219
|
+
var __defProp2 = Object.defineProperty;
|
|
1220
|
+
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
|
|
1221
|
+
value,
|
|
1222
|
+
configurable: true
|
|
1223
|
+
}), "__name");
|
|
1224
|
+
var Container = class {
|
|
1225
|
+
static {
|
|
1226
|
+
__name(this, "Container");
|
|
1227
|
+
}
|
|
1228
|
+
static {
|
|
1229
|
+
__name2(this, "Container");
|
|
1230
|
+
}
|
|
1231
|
+
bindings = /* @__PURE__ */ new Map();
|
|
1232
|
+
singletons = /* @__PURE__ */ new Map();
|
|
1233
|
+
/**
|
|
1234
|
+
* Check if the target has any decorators
|
|
1235
|
+
*
|
|
1236
|
+
* @param target
|
|
1237
|
+
* @returns
|
|
1238
|
+
*/
|
|
1239
|
+
static hasAnyDecorator(target) {
|
|
1240
|
+
if (Reflect.getMetadataKeys(target).length > 0)
|
|
1241
|
+
return true;
|
|
1242
|
+
const paramLength = target.length;
|
|
1243
|
+
for (let i = 0; i < paramLength; i++) {
|
|
1244
|
+
if (Reflect.getMetadataKeys(target, `__param_${i}`).length > 0) {
|
|
1245
|
+
return true;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
return false;
|
|
1249
|
+
}
|
|
1250
|
+
bind(key, factory) {
|
|
1251
|
+
this.bindings.set(key, factory);
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Bind a singleton service to the container
|
|
1255
|
+
*/
|
|
1256
|
+
singleton(key, factory) {
|
|
1257
|
+
this.bindings.set(key, () => {
|
|
1258
|
+
if (!this.singletons.has(key)) {
|
|
1259
|
+
this.singletons.set(key, factory());
|
|
1260
|
+
}
|
|
1261
|
+
return this.singletons.get(key);
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Resolve a service from the container
|
|
1266
|
+
*/
|
|
1267
|
+
make(key) {
|
|
1268
|
+
if (this.bindings.has(key)) {
|
|
1269
|
+
return this.bindings.get(key)();
|
|
1270
|
+
}
|
|
1271
|
+
if (typeof key === "function") {
|
|
1272
|
+
return this.build(key);
|
|
1273
|
+
}
|
|
1274
|
+
throw new Error(`No binding found for key: ${typeof key === "string" ? key : key?.name}`);
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Automatically build a class with constructor dependency injection
|
|
1278
|
+
*/
|
|
1279
|
+
build(ClassType) {
|
|
1280
|
+
let dependencies = [];
|
|
1281
|
+
if (Array.isArray(ClassType.__inject__)) {
|
|
1282
|
+
dependencies = ClassType.__inject__.map((alias) => {
|
|
1283
|
+
return this.make(alias);
|
|
1284
|
+
});
|
|
1285
|
+
} else {
|
|
1286
|
+
const paramTypes = Reflect.getMetadata("design:paramtypes", ClassType) || [];
|
|
1287
|
+
dependencies = paramTypes.map((dep) => this.make(dep));
|
|
1288
|
+
}
|
|
1289
|
+
return new ClassType(...dependencies);
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* Check if a service is registered
|
|
1293
|
+
*/
|
|
1294
|
+
has(key) {
|
|
1295
|
+
return this.bindings.has(key);
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
var Application = class _Application extends Container {
|
|
1299
|
+
static {
|
|
1300
|
+
__name(this, "_Application");
|
|
1301
|
+
}
|
|
1302
|
+
static {
|
|
1303
|
+
__name2(this, "Application");
|
|
1304
|
+
}
|
|
1305
|
+
paths = new PathLoader();
|
|
1306
|
+
booted = false;
|
|
1307
|
+
versions = {
|
|
1308
|
+
app: "0",
|
|
1309
|
+
ts: "0"
|
|
1310
|
+
};
|
|
1311
|
+
basePath;
|
|
1312
|
+
providers = [];
|
|
1313
|
+
externalProviders = [];
|
|
1314
|
+
constructor(basePath) {
|
|
1315
|
+
super();
|
|
1316
|
+
this.basePath = basePath;
|
|
1317
|
+
this.setPath("base", basePath);
|
|
1318
|
+
this.loadOptions();
|
|
1319
|
+
this.registerBaseBindings();
|
|
1320
|
+
dotenv.config({
|
|
1321
|
+
quiet: true
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
/**
|
|
1325
|
+
* Register core bindings into the container
|
|
1326
|
+
*/
|
|
1327
|
+
registerBaseBindings() {
|
|
1328
|
+
this.bind(_Application, () => this);
|
|
1329
|
+
this.bind("path.base", () => this.basePath);
|
|
1330
|
+
this.bind("load.paths", () => this.paths);
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Dynamically register all configured providers
|
|
1334
|
+
*/
|
|
1335
|
+
async registerConfiguredProviders() {
|
|
1336
|
+
const providers = await this.getAllProviders();
|
|
1337
|
+
for (const ProviderClass of providers) {
|
|
1338
|
+
if (!ProviderClass)
|
|
1339
|
+
continue;
|
|
1340
|
+
const provider = new ProviderClass(this);
|
|
1341
|
+
await this.register(provider);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
async loadOptions() {
|
|
1345
|
+
const app = await this.safeImport(this.getPath("base", "package.json"));
|
|
1346
|
+
const core = await this.safeImport("../package.json");
|
|
1347
|
+
if (app && app.dependencies) {
|
|
1348
|
+
this.versions.app = app.dependencies["@h3ravel/core"];
|
|
1349
|
+
}
|
|
1350
|
+
if (core && core.devDependencies) {
|
|
1351
|
+
this.versions.ts = app.devDependencies.typescript;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Load default and optional providers dynamically
|
|
1356
|
+
*
|
|
1357
|
+
* Auto-Registration Behavior
|
|
1358
|
+
*
|
|
1359
|
+
* Minimal App: Loads only core, config, http, router by default.
|
|
1360
|
+
* Full-Stack App: Installs database, mail, queue, cache → they self-register via their providers.
|
|
1361
|
+
*/
|
|
1362
|
+
async getConfiguredProviders() {
|
|
1363
|
+
return [
|
|
1364
|
+
(await Promise.resolve().then(() => require_dist())).AppServiceProvider,
|
|
1365
|
+
(await Promise.resolve().then(() => require_dist())).ViewServiceProvider
|
|
1366
|
+
];
|
|
1367
|
+
}
|
|
1368
|
+
async getAllProviders() {
|
|
1369
|
+
const coreProviders = await this.getConfiguredProviders();
|
|
1370
|
+
const allProviders = [
|
|
1371
|
+
...coreProviders,
|
|
1372
|
+
...this.externalProviders
|
|
1373
|
+
];
|
|
1374
|
+
const uniqueProviders = Array.from(new Set(allProviders));
|
|
1375
|
+
return this.sortProviders(uniqueProviders);
|
|
1376
|
+
}
|
|
1377
|
+
sortProviders(providers) {
|
|
1378
|
+
const priorityMap = /* @__PURE__ */ new Map();
|
|
1379
|
+
providers.forEach((Provider) => {
|
|
1380
|
+
priorityMap.set(Provider.name, Provider.priority ?? 0);
|
|
1381
|
+
});
|
|
1382
|
+
providers.forEach((Provider) => {
|
|
1383
|
+
const order = Provider.order;
|
|
1384
|
+
if (!order)
|
|
1385
|
+
return;
|
|
1386
|
+
const [direction, target] = order.split(":");
|
|
1387
|
+
const targetPriority = priorityMap.get(target) ?? 0;
|
|
1388
|
+
if (direction === "before") {
|
|
1389
|
+
priorityMap.set(Provider.name, targetPriority - 1);
|
|
1390
|
+
} else if (direction === "after") {
|
|
1391
|
+
priorityMap.set(Provider.name, targetPriority + 1);
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
const sorted = providers.sort((A, B) => (priorityMap.get(B.name) ?? 0) - (priorityMap.get(A.name) ?? 0));
|
|
1395
|
+
if (process.env.APP_DEBUG === "true") {
|
|
1396
|
+
console.table(sorted.map((P) => ({
|
|
1397
|
+
Provider: P.name,
|
|
1398
|
+
Priority: priorityMap.get(P.name),
|
|
1399
|
+
Order: P.order || "N/A"
|
|
1400
|
+
})));
|
|
1401
|
+
}
|
|
1402
|
+
return sorted;
|
|
1403
|
+
}
|
|
1404
|
+
registerProviders(providers) {
|
|
1405
|
+
this.externalProviders.push(...providers);
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* Register a provider
|
|
1409
|
+
*/
|
|
1410
|
+
async register(provider) {
|
|
1411
|
+
await provider.register();
|
|
1412
|
+
this.providers.push(provider);
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Boot all providers after registration
|
|
1416
|
+
*/
|
|
1417
|
+
async boot() {
|
|
1418
|
+
if (this.booted)
|
|
1419
|
+
return;
|
|
1420
|
+
for (const provider of this.providers) {
|
|
1421
|
+
if (provider.boot) {
|
|
1422
|
+
await provider.boot();
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
this.booted = true;
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Attempt to dynamically import an optional module
|
|
1429
|
+
*/
|
|
1430
|
+
async safeImport(moduleName) {
|
|
1431
|
+
try {
|
|
1432
|
+
const mod = await import(moduleName);
|
|
1433
|
+
return mod.default ?? mod ?? {};
|
|
1434
|
+
} catch {
|
|
1435
|
+
return null;
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* Get the base path of the app
|
|
1440
|
+
*
|
|
1441
|
+
* @returns
|
|
1442
|
+
*/
|
|
1443
|
+
getBasePath() {
|
|
1444
|
+
return this.basePath;
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Dynamically retrieves a path property from the class.
|
|
1448
|
+
* Any property ending with "Path" is accessible automatically.
|
|
1449
|
+
*
|
|
1450
|
+
* @param name - The base name of the path property
|
|
1451
|
+
* @returns
|
|
1452
|
+
*/
|
|
1453
|
+
getPath(name, pth) {
|
|
1454
|
+
return path.join(this.paths.getPath(name, this.basePath), pth ?? "");
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Programatically set the paths.
|
|
1458
|
+
*
|
|
1459
|
+
* @param name - The base name of the path property
|
|
1460
|
+
* @param path - The new path
|
|
1461
|
+
* @returns
|
|
1462
|
+
*/
|
|
1463
|
+
setPath(name, path2) {
|
|
1464
|
+
return this.paths.setPath(name, path2, this.basePath);
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Returns the installed version of the system core and typescript.
|
|
1468
|
+
*
|
|
1469
|
+
* @returns
|
|
1470
|
+
*/
|
|
1471
|
+
getVersion(key) {
|
|
1472
|
+
return this.versions[key]?.replaceAll(/\^|~/g, "");
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
var Controller = class {
|
|
1476
|
+
static {
|
|
1477
|
+
__name(this, "Controller");
|
|
1478
|
+
}
|
|
1479
|
+
static {
|
|
1480
|
+
__name2(this, "Controller");
|
|
1481
|
+
}
|
|
1482
|
+
app;
|
|
1483
|
+
constructor(app) {
|
|
1484
|
+
this.app = app;
|
|
1485
|
+
}
|
|
1486
|
+
show(_ctx) {
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
index(_ctx) {
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1492
|
+
store(_ctx) {
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
update(_ctx) {
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
destroy(_ctx) {
|
|
1499
|
+
return;
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1502
|
+
var ServiceProvider = class {
|
|
1503
|
+
static {
|
|
1504
|
+
__name(this, "ServiceProvider");
|
|
1505
|
+
}
|
|
1506
|
+
static {
|
|
1507
|
+
__name2(this, "ServiceProvider");
|
|
1508
|
+
}
|
|
1509
|
+
static order;
|
|
1510
|
+
static priority = 0;
|
|
1511
|
+
app;
|
|
1512
|
+
constructor(app) {
|
|
1513
|
+
this.app = app;
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
function Inject(...dependencies) {
|
|
1517
|
+
return function(target) {
|
|
1518
|
+
target.__inject__ = dependencies;
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
__name(Inject, "Inject");
|
|
1522
|
+
__name2(Inject, "Inject");
|
|
1523
|
+
function Injectable() {
|
|
1524
|
+
return (_arget) => {
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
__name(Injectable, "Injectable");
|
|
1528
|
+
__name2(Injectable, "Injectable");
|
|
1529
|
+
var Kernel = class {
|
|
1530
|
+
static {
|
|
1531
|
+
__name(this, "Kernel");
|
|
1532
|
+
}
|
|
1533
|
+
static {
|
|
1534
|
+
__name2(this, "Kernel");
|
|
1535
|
+
}
|
|
1536
|
+
context;
|
|
1537
|
+
middleware;
|
|
1538
|
+
/**
|
|
1539
|
+
* @param context - A factory function that converts an H3Event into an HttpContext.
|
|
1540
|
+
* @param middleware - An array of middleware classes that will be executed in sequence.
|
|
1541
|
+
*/
|
|
1542
|
+
constructor(context, middleware = []) {
|
|
1543
|
+
this.context = context;
|
|
1544
|
+
this.middleware = middleware;
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Handles an incoming request and passes it through middleware before invoking the next handler.
|
|
1548
|
+
*
|
|
1549
|
+
* @param event - The raw H3 event object.
|
|
1550
|
+
* @param next - A callback function that represents the next layer (usually the controller or final handler).
|
|
1551
|
+
* @returns A promise resolving to the result of the request pipeline.
|
|
1552
|
+
*/
|
|
1553
|
+
async handle(event, next) {
|
|
1554
|
+
const ctx = this.context(event);
|
|
1555
|
+
const { app } = ctx.request;
|
|
1556
|
+
app.bind("view", () => async (template, params) => {
|
|
1557
|
+
const edge = app.make("edge");
|
|
1558
|
+
return ctx.response.html(await edge.render(template, params));
|
|
1559
|
+
});
|
|
1560
|
+
const result = await this.runMiddleware(ctx, () => next(ctx));
|
|
1561
|
+
if (result !== void 0 && this.isPlainObject(result)) {
|
|
1562
|
+
event.res.headers.set("Content-Type", "application/json; charset=UTF-8");
|
|
1563
|
+
}
|
|
1564
|
+
return result;
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Sequentially runs middleware in the order they were registered.
|
|
1568
|
+
*
|
|
1569
|
+
* @param context - The standardized HttpContext.
|
|
1570
|
+
* @param next - Callback to execute when middleware completes.
|
|
1571
|
+
* @returns A promise resolving to the final handler's result.
|
|
1572
|
+
*/
|
|
1573
|
+
async runMiddleware(context, next) {
|
|
1574
|
+
let index = -1;
|
|
1575
|
+
const runner = /* @__PURE__ */ __name2(async (i) => {
|
|
1576
|
+
if (i <= index)
|
|
1577
|
+
throw new Error("next() called multiple times");
|
|
1578
|
+
index = i;
|
|
1579
|
+
const middleware = this.middleware[i];
|
|
1580
|
+
if (middleware) {
|
|
1581
|
+
return middleware.handle(context, () => runner(i + 1));
|
|
1582
|
+
} else {
|
|
1583
|
+
return next(context);
|
|
1584
|
+
}
|
|
1585
|
+
}, "runner");
|
|
1586
|
+
return runner(0);
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* Utility function to determine if a value is a plain object or array.
|
|
1590
|
+
*
|
|
1591
|
+
* @param value - The value to check.
|
|
1592
|
+
* @returns True if the value is a plain object or array, otherwise false.
|
|
1593
|
+
*/
|
|
1594
|
+
isPlainObject(value) {
|
|
1595
|
+
return typeof value === "object" && value !== null && (value.constructor === Object || value.constructor === Array);
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
var AppServiceProvider = class extends ServiceProvider {
|
|
1599
|
+
static {
|
|
1600
|
+
__name(this, "AppServiceProvider");
|
|
1601
|
+
}
|
|
1602
|
+
static {
|
|
1603
|
+
__name2(this, "AppServiceProvider");
|
|
1604
|
+
}
|
|
1605
|
+
static priority = 999;
|
|
1606
|
+
register() {
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
var ViewServiceProvider = class extends ServiceProvider {
|
|
1610
|
+
static {
|
|
1611
|
+
__name(this, "ViewServiceProvider");
|
|
1612
|
+
}
|
|
1613
|
+
static {
|
|
1614
|
+
__name2(this, "ViewServiceProvider");
|
|
1615
|
+
}
|
|
1616
|
+
static priority = 995;
|
|
1617
|
+
register() {
|
|
1618
|
+
const config = this.app.make("config");
|
|
1619
|
+
const edge = Edge.create({
|
|
1620
|
+
cache: process.env.NODE_ENV === "production"
|
|
1621
|
+
});
|
|
1622
|
+
edge.mount(this.app.getPath("views"));
|
|
1623
|
+
edge.global("asset", this.app.make("asset"));
|
|
1624
|
+
edge.global("config", config.get);
|
|
1625
|
+
edge.global("app", this.app);
|
|
1626
|
+
this.app.bind("edge", () => edge);
|
|
1627
|
+
}
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
export {
|
|
1631
|
+
__name,
|
|
1632
|
+
Container,
|
|
1633
|
+
Application,
|
|
1634
|
+
Controller,
|
|
1635
|
+
ServiceProvider,
|
|
1636
|
+
Inject,
|
|
1637
|
+
Injectable,
|
|
1638
|
+
Kernel,
|
|
1639
|
+
AppServiceProvider,
|
|
1640
|
+
ViewServiceProvider
|
|
1641
|
+
};
|
|
1642
|
+
/*! Bundled license information:
|
|
1643
|
+
|
|
1644
|
+
reflect-metadata/Reflect.js:
|
|
1645
|
+
(*! *****************************************************************************
|
|
1646
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
1647
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
1648
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
1649
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
1650
|
+
|
|
1651
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
1652
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
1653
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
1654
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
1655
|
+
|
|
1656
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
1657
|
+
and limitations under the License.
|
|
1658
|
+
***************************************************************************** *)
|
|
1659
|
+
*/
|
|
1660
|
+
//# sourceMappingURL=chunk-AJP2XXVX.js.map
|