@adimm/x-injection 0.4.0 → 0.5.1

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/index.cjs CHANGED
@@ -11,34 +11,35 @@ var e, i = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Objec
11
11
  enumerable: !0
12
12
  });
13
13
  })(s, {
14
- AppModule: () => H,
14
+ AppModule: () => Y,
15
15
  GLOBAL_APP_MODULE_ID: () => d,
16
- GlobalAppModule: () => z,
16
+ GlobalAppModule: () => H,
17
17
  GlobalContainer: () => X,
18
- Inject: () => b,
19
- InjectFromBase: () => B,
18
+ Inject: () => E,
19
+ InjectFromBase: () => w,
20
20
  Injectable: () => I,
21
21
  InjectionScope: () => a,
22
- MultiInject: () => T,
23
- Named: () => D,
24
- Optional: () => P,
25
- PostConstruct: () => C,
26
- PreDestroy: () => x,
27
- ProviderModule: () => $,
28
- ProviderModuleHelpers: () => f,
29
- ProviderTokenHelpers: () => l,
30
- Tagged: () => O,
22
+ MultiInject: () => P,
23
+ Named: () => B,
24
+ Optional: () => j,
25
+ PostConstruct: () => k,
26
+ PreDestroy: () => A,
27
+ ProviderModule: () => z,
28
+ ProviderModuleHelpers: () => l,
29
+ ProviderTokenHelpers: () => p,
30
+ Tagged: () => R,
31
31
  Unmanaged: () => q,
32
- XInjectionDynamicExportsOutOfRange: () => G,
33
- XInjectionError: () => F,
34
- XInjectionProviderModuleDisposedError: () => U,
35
- XInjectionProviderModuleError: () => N,
36
- XInjectionProviderModuleMissingIdentifierError: () => V,
32
+ XInjectionDynamicExportsOutOfRange: () => V,
33
+ XInjectionError: () => N,
34
+ XInjectionProviderModuleDisposedError: () => G,
35
+ XInjectionProviderModuleError: () => U,
36
+ XInjectionProviderModuleMissingIdentifierError: () => W,
37
37
  bindingScopeToInjectionScope: () => h,
38
38
  injectionScopeToBindingScope: () => u,
39
- isClass: () => g,
40
- isClassOrFunction: () => S,
41
- isPlainObject: () => y
39
+ isClass: () => v,
40
+ isClassOrFunction: () => g,
41
+ isFunction: () => y,
42
+ isPlainObject: () => m
42
43
  }), module.exports = (e = s, ((e, o, s, d) => {
43
44
  if (o && "object" == typeof o || "function" == typeof o) for (let c of n(o)) r.call(e, c) || c === s || i(e, c, {
44
45
  get: () => o[c],
@@ -82,44 +83,49 @@ function h(e) {
82
83
 
83
84
  o(u, "injectionScopeToBindingScope"), o(h, "bindingScopeToInjectionScope");
84
85
 
85
- var l, f, p = require("@inversifyjs/core");
86
+ var p, l, f = require("@inversifyjs/core");
87
+
88
+ function v(e) {
89
+ return "function" == typeof e && Function.prototype.toString.call(e).startsWith("class ");
90
+ }
86
91
 
87
92
  function g(e) {
88
- return "function" == typeof e && /^class\s/.test(Function.prototype.toString.call(e));
93
+ return "function" == typeof e;
89
94
  }
90
95
 
91
- function v(e) {
96
+ function y(e) {
97
+ return "function" == typeof e && !Function.prototype.toString.call(e).startsWith("class ");
98
+ }
99
+
100
+ function S(e) {
92
101
  return "[object Object]" === Object.prototype.toString.call(e);
93
102
  }
94
103
 
95
- function y(e) {
96
- if (!1 === v(e)) return !1;
104
+ function m(e) {
105
+ if (!1 === S(e)) return !1;
97
106
  const i = e.constructor;
98
107
  if (void 0 === i) return !0;
99
108
  const t = i.prototype;
100
- return !1 !== v(t) && !1 !== t.hasOwnProperty("isPrototypeOf");
101
- }
102
-
103
- function S(e) {
104
- return "function" == typeof e;
109
+ return !1 !== S(t) && !1 !== t.hasOwnProperty("isPrototypeOf");
105
110
  }
106
111
 
107
112
  function I(e) {
108
113
  return void 0 === e ? (0, c.injectable)() : (0, c.injectable)(u(e));
109
114
  }
110
115
 
111
- o(g, "isClass"), o(v, "isObject"), o(y, "isPlainObject"), function(e) {
116
+ o(v, "isClass"), o(g, "isClassOrFunction"), o(y, "isFunction"), o(S, "isObject"),
117
+ o(m, "isPlainObject"), function(e) {
112
118
  function i(e) {
113
- return f(e) && "useClass" in e;
119
+ return S(e) && "useClass" in e;
114
120
  }
115
121
  function t(e) {
116
- return f(e) && "useValue" in e;
122
+ return S(e) && "useValue" in e;
117
123
  }
118
124
  function n(e) {
119
- return f(e) && "useFactory" in e;
125
+ return S(e) && "useFactory" in e;
120
126
  }
121
127
  function r(e) {
122
- return "string" == typeof e || "symbol" == typeof e || g(e) || "function" == typeof e;
128
+ return "string" == typeof e || "symbol" == typeof e || g(e);
123
129
  }
124
130
  function s(e) {
125
131
  return r(e) ? e : e.provide;
@@ -128,32 +134,46 @@ o(g, "isClass"), o(v, "isObject"), o(y, "isPlainObject"), function(e) {
128
134
  return e.map((e => s(e)));
129
135
  }
130
136
  function c(e, i) {
131
- return u(e) ?? l(e) ?? i;
132
- }
133
- function a(e) {
134
- if (f(e)) return e;
137
+ return v(e) ? {
138
+ ...i,
139
+ provide: i?.provide ?? e,
140
+ useClass: i?.useClass ?? e
141
+ } : y(e) ? {
142
+ ...i,
143
+ provide: i?.provide ?? e,
144
+ useFactory: i?.useFactory ?? e
145
+ } : {
146
+ ...e,
147
+ ...i
148
+ };
149
+ }
150
+ function a(e, i) {
151
+ return p(e) ?? l(e) ?? i;
135
152
  }
136
153
  function u(e) {
137
- const i = a(e);
154
+ if (S(e)) return e;
155
+ }
156
+ function p(e) {
157
+ const i = u(e);
138
158
  if (i) return i.scope;
139
159
  }
140
160
  function l(e) {
141
161
  const i = s(e);
142
- if (!g(i)) return;
143
- const t = (0, p.getClassMetadata)(i)?.scope;
162
+ if (!v(i)) return;
163
+ const t = (0, f.getClassMetadata)(i)?.scope;
144
164
  return t ? h(t) : void 0;
145
165
  }
146
- function f(e) {
147
- return y(e) && "object" == typeof e && "provide" in e;
166
+ function S(e) {
167
+ return m(e) && "object" == typeof e && "provide" in e;
148
168
  }
149
169
  o(i, "isClassToken"), e.isClassToken = i, o(t, "isValueToken"), e.isValueToken = t,
150
170
  o(n, "isFactoryToken"), e.isFactoryToken = n, o(r, "isProviderIdentifier"), e.isProviderIdentifier = r,
151
171
  o(s, "toServiceIdentifier"), e.toServiceIdentifier = s, o(d, "toServiceIdentifiers"),
152
- e.toServiceIdentifiers = d, o(c, "getInjectionScopeByPriority"), e.getInjectionScopeByPriority = c,
153
- o(a, "tryGetProviderOptions"), e.tryGetProviderOptions = a, o(u, "tryGetScopeFromProvider"),
154
- e.tryGetScopeFromProvider = u, o(l, "tryGetDecoratorScopeFromClass"), e.tryGetDecoratorScopeFromClass = l,
155
- o(f, "hasProvideProperty");
156
- }(l || (l = {})), function(e) {
172
+ e.toServiceIdentifiers = d, o(c, "toDependencyProviderWithOptions"), e.toDependencyProviderWithOptions = c,
173
+ o(a, "getInjectionScopeByPriority"), e.getInjectionScopeByPriority = a, o(u, "tryGetProviderOptions"),
174
+ e.tryGetProviderOptions = u, o(p, "tryGetScopeFromProvider"), e.tryGetScopeFromProvider = p,
175
+ o(l, "tryGetDecoratorScopeFromClass"), e.tryGetDecoratorScopeFromClass = l, o(S, "hasProvideProperty");
176
+ }(p || (p = {})), function(e) {
157
177
  function i(e) {
158
178
  return e;
159
179
  }
@@ -162,86 +182,86 @@ o(g, "isClass"), o(v, "isObject"), o(y, "isPlainObject"), function(e) {
162
182
  }
163
183
  o(i, "buildInternalConstructorParams"), e.buildInternalConstructorParams = i, o(t, "isDynamicExport"),
164
184
  e.isDynamicExport = t;
165
- }(f || (f = {})), o(S, "isClassOrFunction"), o(I, "Injectable");
185
+ }(l || (l = {})), o(I, "Injectable");
166
186
 
167
- var m = require("inversify");
187
+ var b = require("inversify");
168
188
 
169
- function b(e) {
170
- return (0, m.inject)(l.toServiceIdentifier(e));
189
+ function E(e) {
190
+ return (0, b.inject)(p.toServiceIdentifier(e));
171
191
  }
172
192
 
173
- o(b, "Inject");
193
+ o(E, "Inject");
174
194
 
175
- var E = require("inversify");
195
+ var T = require("inversify");
176
196
 
177
- function T(e) {
178
- return (0, E.multiInject)(l.toServiceIdentifier(e));
197
+ function P(e) {
198
+ return (0, T.multiInject)(p.toServiceIdentifier(e));
179
199
  }
180
200
 
181
- o(T, "MultiInject");
201
+ o(P, "MultiInject");
182
202
 
183
203
  var _ = require("inversify");
184
204
 
185
- function B(e) {
205
+ function w(e) {
186
206
  return (0, _.injectFromBase)(e);
187
207
  }
188
208
 
189
- o(B, "InjectFromBase");
209
+ o(w, "InjectFromBase");
190
210
 
191
- var w = require("inversify");
211
+ var D = require("inversify");
192
212
 
193
- function D(e) {
194
- return (0, w.named)(e);
213
+ function B(e) {
214
+ return (0, D.named)(e);
195
215
  }
196
216
 
197
- o(D, "Named");
217
+ o(B, "Named");
198
218
 
199
- var j = require("inversify");
219
+ var M = require("inversify");
200
220
 
201
- function P() {
202
- return (0, j.optional)();
221
+ function j() {
222
+ return (0, M.optional)();
203
223
  }
204
224
 
205
- o(P, "Optional");
225
+ o(j, "Optional");
206
226
 
207
- var M = require("inversify");
227
+ var C = require("inversify");
208
228
 
209
- function C() {
210
- return (0, M.postConstruct)();
229
+ function k() {
230
+ return (0, C.postConstruct)();
211
231
  }
212
232
 
213
- o(C, "PostConstruct");
233
+ o(k, "PostConstruct");
214
234
 
215
- var k = require("inversify");
235
+ var x = require("inversify");
216
236
 
217
- function x() {
218
- return (0, k.preDestroy)();
237
+ function A() {
238
+ return (0, x.preDestroy)();
219
239
  }
220
240
 
221
- o(x, "PreDestroy");
241
+ o(A, "PreDestroy");
222
242
 
223
- var A = require("inversify");
243
+ var O = require("inversify");
224
244
 
225
- function O(e, i) {
226
- return (0, A.tagged)(e, i);
245
+ function R(e, i) {
246
+ return (0, O.tagged)(e, i);
227
247
  }
228
248
 
229
- o(O, "Tagged");
249
+ o(R, "Tagged");
230
250
 
231
- var R = require("inversify");
251
+ var F = require("inversify");
232
252
 
233
253
  function q() {
234
- return (0, R.unmanaged)();
254
+ return (0, F.unmanaged)();
235
255
  }
236
256
 
237
257
  o(q, "Unmanaged");
238
258
 
239
- var F = class e extends Error {
259
+ var N = class e extends Error {
240
260
  static {
241
261
  o(this, "XInjectionError");
242
262
  }
243
263
  name=e.name;
244
- }, N = class e extends Error {
264
+ }, U = class e extends Error {
245
265
  static {
246
266
  o(this, "XInjectionProviderModuleError");
247
267
  }
@@ -249,7 +269,7 @@ var F = class e extends Error {
249
269
  constructor(e, i) {
250
270
  super(`{ProviderModule.${e.toString()}} => ${i}`);
251
271
  }
252
- }, U = class e extends N {
272
+ }, G = class e extends U {
253
273
  static {
254
274
  o(this, "XInjectionProviderModuleDisposedError");
255
275
  }
@@ -257,7 +277,7 @@ var F = class e extends Error {
257
277
  constructor(e) {
258
278
  super(e, "Has been disposed! You can re-initialize it by using the `_lazyInit` method.");
259
279
  }
260
- }, G = class e extends N {
280
+ }, V = class e extends U {
261
281
  static {
262
282
  o(this, "XInjectionDynamicExportsOutOfRange");
263
283
  }
@@ -265,7 +285,7 @@ var F = class e extends Error {
265
285
  constructor(e) {
266
286
  super(e, `The 'ProviderModule.${e.toString()}' is trying to dynamically export providers/modules out of the declared range of the static exports!`);
267
287
  }
268
- }, V = class e extends N {
288
+ }, W = class e extends U {
269
289
  static {
270
290
  o(this, "XInjectionProviderModuleMissingIdentifierError");
271
291
  }
@@ -275,7 +295,7 @@ var F = class e extends Error {
275
295
  }
276
296
  }, X = new (require("inversify").Container)({
277
297
  defaultScope: "Singleton"
278
- }), L = require("inversify"), W = class {
298
+ }), L = require("inversify"), $ = class {
279
299
  static {
280
300
  o(this, "ProviderModuleUtils");
281
301
  }
@@ -288,30 +308,27 @@ var F = class e extends Error {
288
308
  this.module = e, this.moduleNaked = e.toNaked();
289
309
  }
290
310
  bindToContainer(e, i) {
291
- return l.isProviderIdentifier(e) ? this.bindSelfTokenToContainer(e, i) : l.isClassToken(e) ? this.bindClassTokenToContainer(e, i) : l.isValueToken(e) ? this.bindValueTokenToContainer(e) : !!l.isFactoryToken(e) && this.bindFactoryTokenToContainer(e, i);
292
- }
293
- bindManyToContainer(e, i) {
294
- e.forEach((e => this.bindToContainer(e, i)));
311
+ return p.isProviderIdentifier(e) ? this.bindSelfTokenToContainer(e, i) : p.isClassToken(e) ? this.bindClassTokenToContainer(e, i) : p.isValueToken(e) ? this.bindValueTokenToContainer(e) : !!p.isFactoryToken(e) && this.bindFactoryTokenToContainer(e, i);
295
312
  }
296
313
  bindSelfTokenToContainer(e, i) {
297
- return this.setBindingScope(e, this.container.bind(l.toServiceIdentifier(e)).toSelf(), i),
314
+ return this.setBindingScope(e, this.container.bind(p.toServiceIdentifier(e)).toSelf(), i),
298
315
  this.moduleNaked.__isCurrentBound(e);
299
316
  }
300
317
  bindClassTokenToContainer(e, i) {
301
- return this.setBindingOnEvent(e, this.setWhenBinding(e, this.setBindingScope(e, this.container.bind(l.toServiceIdentifier(e)).to(e.useClass), i))),
318
+ return this.setBindingOnEvent(e, this.setWhenBinding(e, this.setBindingScope(e, this.container.bind(p.toServiceIdentifier(e)).to(e.useClass), i))),
302
319
  this.moduleNaked.__isCurrentBound(e);
303
320
  }
304
321
  bindValueTokenToContainer(e) {
305
- return this.setBindingOnEvent(e, this.setWhenBinding(e, this.container.bind(l.toServiceIdentifier(e)).toConstantValue(e.useValue))),
322
+ return this.setBindingOnEvent(e, this.setWhenBinding(e, this.container.bind(p.toServiceIdentifier(e)).toConstantValue(e.useValue))),
306
323
  this.moduleNaked.__isCurrentBound(e);
307
324
  }
308
325
  bindFactoryTokenToContainer(e, i) {
309
- return this.setBindingOnEvent(e, this.setWhenBinding(e, this.setBindingScope(e, this.container.bind(l.toServiceIdentifier(e)).toResolvedValue(e.useFactory, l.toServiceIdentifiers(e.inject ?? [])), i))),
326
+ return this.setBindingOnEvent(e, this.setWhenBinding(e, this.setBindingScope(e, this.container.bind(p.toServiceIdentifier(e)).toResolvedValue(e.useFactory, p.toServiceIdentifiers(e.inject ?? [])), i))),
310
327
  this.moduleNaked.__isCurrentBound(e);
311
328
  }
312
329
  setBindingScope(e, i, t) {
313
- if (l.isValueToken(e)) return i;
314
- switch (l.getInjectionScopeByPriority(e, t)) {
330
+ if (p.isValueToken(e)) return i;
331
+ switch (p.getInjectionScopeByPriority(e, t)) {
315
332
  case a.Singleton:
316
333
  return i.inSingletonScope();
317
334
 
@@ -323,16 +340,16 @@ var F = class e extends Error {
323
340
  }
324
341
  }
325
342
  setWhenBinding(e, i) {
326
- if (l.isProviderIdentifier(e)) return i;
343
+ if (p.isProviderIdentifier(e)) return i;
327
344
  const t = e.when;
328
345
  return t ? i.when(t) : i;
329
346
  }
330
347
  setBindingOnEvent(e, i) {
331
- if (l.isProviderIdentifier(e)) return;
348
+ if (p.isProviderIdentifier(e)) return;
332
349
  const t = e;
333
350
  t.onEvent?.activation && i.onActivation(t.onEvent.activation), t.onEvent?.deactivation && i.onDeactivation(t.onEvent.deactivation);
334
351
  }
335
- }, $ = class e {
352
+ }, z = class e {
336
353
  static {
337
354
  o(this, "ProviderModule");
338
355
  }
@@ -344,14 +361,16 @@ var F = class e extends Error {
344
361
  dynamicExports;
345
362
  onReady;
346
363
  onDispose;
364
+ importedProvidersMap;
347
365
  moduleUtils;
366
+ imports;
348
367
  providers;
368
+ importedProviders;
349
369
  exports;
350
- imports;
351
370
  registeredBindingSideEffects;
352
371
  constructor({identifier: e, imports: i, providers: t, exports: n, defaultScope: r, dynamicExports: o, onReady: s, onDispose: d, ...c}) {
353
372
  const a = c;
354
- this.identifier = this.setIdentifier(e), this.isAppModule = a.isAppModule ?? !1,
373
+ this.identifier = this.setIdentifier(e), this.isDisposed = a.isDisposed ?? !1, this.isAppModule = a.isAppModule ?? !1,
355
374
  this.isAppModule || this._lazyInit({
356
375
  imports: i,
357
376
  providers: t,
@@ -370,24 +389,39 @@ var F = class e extends Error {
370
389
  }
371
390
  getMany(...e) {
372
391
  return e.map((e => {
373
- const i = y(e) && "provider" in e;
392
+ const i = m(e) && "provider" in e;
374
393
  return this.get(i ? e.provider : e, !!i && e.isOptional);
375
394
  }));
376
395
  }
377
396
  onActivationEvent(e, i) {
378
- this.container.onActivation(l.toServiceIdentifier(e), i);
397
+ this.shouldThrowIfDisposed(), this.container.onActivation(p.toServiceIdentifier(e), i);
379
398
  }
380
399
  onDeactivationEvent(e, i) {
381
- this.container.onDeactivation(l.toServiceIdentifier(e), i);
400
+ this.shouldThrowIfDisposed(), this.container.onDeactivation(p.toServiceIdentifier(e), i);
382
401
  }
383
402
  toNaked() {
384
403
  return this;
385
404
  }
405
+ clone(i) {
406
+ let t = [ ...this.providers ];
407
+ return i?.providersMap && (t = t.map((e => i.providersMap(e, this)))), new e(l.buildInternalConstructorParams({
408
+ isAppModule: this.isAppModule,
409
+ identifier: this.identifier,
410
+ defaultScope: this.defaultScope.native,
411
+ dynamicExports: this.dynamicExports,
412
+ onReady: this.onReady,
413
+ onDispose: this.onDispose,
414
+ importedProvidersMap: i?.importedProvidersMap,
415
+ imports: [ ...this.imports ],
416
+ providers: t,
417
+ exports: [ ...this.exports ]
418
+ }));
419
+ }
386
420
  toString() {
387
421
  return this.identifier?.description ?? "Unknown";
388
422
  }
389
423
  setIdentifier(e) {
390
- if (!e) throw new V(this);
424
+ if (!e) throw new W(this);
391
425
  return e;
392
426
  }
393
427
  prepareContainer(e) {
@@ -399,7 +433,7 @@ var F = class e extends Error {
399
433
  }
400
434
  injectImportedModules(i) {
401
435
  i && 0 !== i.length && i.forEach((i => {
402
- if ("GlobalAppModule" === i.toString()) throw new N(this, "The 'GlobalAppModule' can't be imported!");
436
+ if ("GlobalAppModule" === i.toString()) throw new U(this, "The 'GlobalAppModule' can't be imported!");
403
437
  const t = i._getExportableModulesAndProviders(), n = i.dynamicExports?.(this, t);
404
438
  void 0 !== n && this.shouldThrowWhenModuleDynamicExportsDontMatchTheStaticExports(i, t, n),
405
439
  (n ?? t).forEach((t => {
@@ -407,17 +441,18 @@ var F = class e extends Error {
407
441
  const e = t.toNaked();
408
442
  return void this.injectImportedModules([ e ]);
409
443
  }
410
- const n = t;
411
- this.moduleUtils.bindToContainer({
412
- scope: l.getInjectionScopeByPriority(n, i.defaultScope.native),
413
- provide: l.toServiceIdentifier(n),
414
- useFactory: o((() => this._importedDependencyFactory(n, i)), "useFactory")
415
- }, i.defaultScope.native);
444
+ const n = t, r = this.importedProvidersMap({
445
+ scope: p.getInjectionScopeByPriority(n, i.defaultScope.native),
446
+ provide: p.toServiceIdentifier(n),
447
+ useFactory: o((() => i.get(n)), "useFactory")
448
+ }, n, i);
449
+ this.importedProviders.set(i, [ ...this.importedProviders.get(i) ?? [], r ]), this.moduleUtils.bindToContainer(r, i.defaultScope.native),
450
+ i._onUnbind(n, (() => this.__unbind(r)));
416
451
  }));
417
452
  }));
418
453
  }
419
454
  injectProviders() {
420
- this.moduleUtils.bindManyToContainer(this.providers, this.defaultScope.native);
455
+ this.providers.forEach((e => this.moduleUtils.bindToContainer(e, this.defaultScope.native)));
421
456
  }
422
457
  registerBindingSideEffect(e, i, t) {
423
458
  this.registeredBindingSideEffects.has(e) || this.registeredBindingSideEffects.set(e, {
@@ -437,28 +472,27 @@ var F = class e extends Error {
437
472
  this.registeredBindingSideEffects.delete(e)) : this.registeredBindingSideEffects.forEach((({onUnbindEffects: e}) => e.forEach((e => e())))));
438
473
  }
439
474
  shouldThrowWhenModuleDynamicExportsDontMatchTheStaticExports(e, i, t) {
440
- if (t.length > i.length || t.some((e => !i.includes(e)))) throw new G(e);
475
+ if (t.length > i.length || t.some((e => !i.includes(e)))) throw new V(e);
441
476
  }
442
477
  shouldThrowIfDisposed() {
443
- if (null === this.container) throw new U(this);
444
- }
445
- _importedDependencyFactory(e, i) {
446
- return i.get(e);
478
+ if (null === this.container) throw new G(this);
447
479
  }
448
480
  async _dispose() {
449
481
  await (this.onDispose?.(this)), await this.__unbindAll(), this.container = null,
450
- this.imports = null, this.providers = null, this.exports = null, this.dynamicExports = null,
451
- this.registeredBindingSideEffects = null, this.isDisposed = !0;
482
+ this.imports = null, this.providers = null, this.importedProviders = null, this.exports = null,
483
+ this.dynamicExports = null, this.registeredBindingSideEffects = null, this.isDisposed = !0;
452
484
  }
453
485
  _lazyInit({imports: e = [], providers: i = [], exports: t = [], defaultScope: n = a.Singleton, dynamicExports: r, onReady: o, onDispose: s, ...d}) {
454
- this.isDisposed = !1, this.imports = e, this.providers = i, this.exports = t, this.defaultScope = {
486
+ return this.isDisposed = !1, this.imports = e, this.providers = i, this.importedProviders = d.importedProviders ?? new Map,
487
+ this.exports = t, this.defaultScope = {
455
488
  native: n,
456
489
  inversify: u(n)
457
- }, this.dynamicExports = r, this.onReady = o, this.onDispose = s, this.container = this.prepareContainer({
490
+ }, this.dynamicExports = r, this.onReady = o, this.onDispose = s, this.importedProvidersMap = d.importedProvidersMap ?? (e => e),
491
+ this.container = this.prepareContainer({
458
492
  ...d
459
- }), this.moduleUtils = new W(this), this.registeredBindingSideEffects = new Map,
493
+ }), this.moduleUtils = new $(this), this.registeredBindingSideEffects = new Map,
460
494
  this.injectImportedModules(this._getImportedModules()), this.injectProviders(),
461
- this.onReady?.(this);
495
+ this.onReady?.(this), this;
462
496
  }
463
497
  _getImportedModules() {
464
498
  return this.shouldThrowIfDisposed(), this.imports;
@@ -483,26 +517,26 @@ var F = class e extends Error {
483
517
  }
484
518
  __bind(e) {
485
519
  this.shouldThrowIfDisposed();
486
- const i = this.container.bind(l.toServiceIdentifier(e));
520
+ const i = this.container.bind(p.toServiceIdentifier(e));
487
521
  return this.invokeRegisteredBindingSideEffects(e, "onBind"), i;
488
522
  }
489
523
  __get(e, i) {
490
- return this.shouldThrowIfDisposed(), this.container.get(l.toServiceIdentifier(e), i);
524
+ return this.shouldThrowIfDisposed(), this.container.get(p.toServiceIdentifier(e), i);
491
525
  }
492
526
  async __getAsync(e, i) {
493
- return this.shouldThrowIfDisposed(), this.container.getAsync(l.toServiceIdentifier(e), i);
527
+ return this.shouldThrowIfDisposed(), this.container.getAsync(p.toServiceIdentifier(e), i);
494
528
  }
495
529
  __getAll(e, i) {
496
- return this.shouldThrowIfDisposed(), this.container.getAll(l.toServiceIdentifier(e), i);
530
+ return this.shouldThrowIfDisposed(), this.container.getAll(p.toServiceIdentifier(e), i);
497
531
  }
498
532
  async __getAllAsync(e, i) {
499
- return this.shouldThrowIfDisposed(), this.container.getAllAsync(l.toServiceIdentifier(e), i);
533
+ return this.shouldThrowIfDisposed(), this.container.getAllAsync(p.toServiceIdentifier(e), i);
500
534
  }
501
535
  __isBound(e, i) {
502
- return this.shouldThrowIfDisposed(), this.container.isBound(l.toServiceIdentifier(e), i);
536
+ return this.shouldThrowIfDisposed(), this.container.isBound(p.toServiceIdentifier(e), i);
503
537
  }
504
538
  __isCurrentBound(e, i) {
505
- return this.shouldThrowIfDisposed(), this.container.isCurrentBound(l.toServiceIdentifier(e), i);
539
+ return this.shouldThrowIfDisposed(), this.container.isCurrentBound(p.toServiceIdentifier(e), i);
506
540
  }
507
541
  __takeSnapshot() {
508
542
  this.shouldThrowIfDisposed(), this.container.snapshot();
@@ -512,39 +546,39 @@ var F = class e extends Error {
512
546
  }
513
547
  async __rebind(e) {
514
548
  this.shouldThrowIfDisposed();
515
- const i = await this.container.rebind(l.toServiceIdentifier(e));
549
+ const i = await this.container.rebind(p.toServiceIdentifier(e));
516
550
  return this.invokeRegisteredBindingSideEffects(e, "onRebind"), i;
517
551
  }
518
552
  __rebindSync(e) {
519
553
  this.shouldThrowIfDisposed();
520
- const i = this.container.rebindSync(l.toServiceIdentifier(e));
554
+ const i = this.container.rebindSync(p.toServiceIdentifier(e));
521
555
  return this.invokeRegisteredBindingSideEffects(e, "onRebind"), i;
522
556
  }
523
557
  async __unbind(e) {
524
- this.shouldThrowIfDisposed(), await this.container.unbind(l.toServiceIdentifier(e)),
558
+ this.shouldThrowIfDisposed(), await this.container.unbind(p.toServiceIdentifier(e)),
525
559
  this.removeRegisteredBindingSideEffects(e);
526
560
  }
527
561
  __unbindSync(e) {
528
- this.shouldThrowIfDisposed(), this.container.unbindSync(l.toServiceIdentifier(e)),
562
+ this.shouldThrowIfDisposed(), this.container.unbindSync(p.toServiceIdentifier(e)),
529
563
  this.removeRegisteredBindingSideEffects(e);
530
564
  }
531
565
  async __unbindAll() {
532
566
  this.shouldThrowIfDisposed(), await this.container.unbindAll(), this.removeRegisteredBindingSideEffects("all");
533
567
  }
534
- }, z = class extends $ {
568
+ }, H = class extends z {
535
569
  static {
536
570
  o(this, "GlobalAppModule");
537
571
  }
538
572
  nakedModule=this;
539
573
  isLoaded=!1;
540
574
  constructor() {
541
- super(f.buildInternalConstructorParams({
575
+ super(l.buildInternalConstructorParams({
542
576
  identifier: Symbol(d),
543
577
  isAppModule: !0
544
578
  }));
545
579
  }
546
580
  register(e) {
547
- if (this.isLoaded) throw new F(`The '${this.toString()}' has already been registered!`);
581
+ if (this.isLoaded) throw new N(`The '${this.toString()}' has already been registered!`);
548
582
  return this.nakedModule._lazyInit(e), this.isLoaded = !0, this;
549
583
  }
550
584
  toNaked() {
@@ -553,4 +587,4 @@ var F = class e extends Error {
553
587
  async _dispose() {
554
588
  this.isLoaded = !1, super._dispose();
555
589
  }
556
- }, H = new z;//# sourceMappingURL=index.cjs.map
590
+ }, Y = new H;//# sourceMappingURL=index.cjs.map