-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinversify.js
More file actions
408 lines (329 loc) · 118 KB
/
Copy pathinversify.js
File metadata and controls
408 lines (329 loc) · 118 KB
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
let e,t,n,i,r,o,s;function a(e,t,n){return Reflect.getOwnMetadata(t,e,n)}var c,l,d,u,v="@inversifyjs/container/bindingId",h="Request",f="Singleton",p="Transient",g="Instance",m="ServiceRedirection";($=u||={}).moduleId="moduleId",$.serviceId="serviceId";var $,y,b=Symbol.for("@inversifyjs/core/InversifyCoreError"),w=class e extends Error{[b];kind;constructor(e,t,n){super(t,n),this[b]=!0,this.kind=e}static is(e){return"object"==typeof e&&!!e&&!0===e[b]}static isErrorOfKind(t,n){return e.is(t)&&t.kind===n}};(ez=y||={})[ez.injectionDecoratorConflict=0]="injectionDecoratorConflict",ez[ez.missingInjectionDecorator=1]="missingInjectionDecorator",ez[ez.planning=2]="planning",ez[ez.planningMaxDepthExceeded=3]="planningMaxDepthExceeded",ez[ez.resolution=4]="resolution",ez[ez.unknown=5]="unknown",(eK=eY||={})[eK.unknown=32]="unknown",(eU=eQ||={}).id="id",eU.moduleId="moduleId",eU.serviceId="serviceId",(eq=eX||={}).moduleId="moduleId",eq.serviceId="serviceId",(eL=eZ||={})[eL.multipleInjection=0]="multipleInjection",eL[eL.singleInjection=1]="singleInjection",eL[eL.unmanaged=2]="unmanaged",(eH=e0||={})[eH.method=0]="method",eH[eH.parameter=1]="parameter",eH[eH.property=2]="property",(eW=e1||={})[eW.multipleInjection=0]="multipleInjection",eW[eW.singleInjection=1]="singleInjection";var S=class e{#e;constructor(e){this.#e=e}get name(){return this.#e.elem.name}get serviceIdentifier(){return this.#e.elem.serviceIdentifier}get tags(){return this.#e.elem.tags}getAncestor(){if(this.#e.elem.getAncestorsCalled=!0,void 0!==this.#e.previous)return new e(this.#e.previous)}};function I(e){return("object"==typeof e&&!!e||"function"==typeof e)&&"function"==typeof e.then}function P(e){switch(typeof e){case"string":case"symbol":return e.toString();case"function":return e.name;default:throw Error(`Unexpected ${typeof e} service id type`)}}var A=Symbol.for("@inversifyjs/common/islazyServiceIdentifier"),C=class{[A];#e;constructor(e){this.#e=e,this[A]=!0}static is(e){return"object"==typeof e&&!!e&&!0===e[A]}unwrap(){return this.#e()}};function M(e){return"redirection"in e}function x(e,t){return M(t)?j(e,t):[t.resolve(e)]}function j(e,t){return void 0===t.redirection.bindings?[]:Array.isArray(t.redirection.bindings)?t.redirection.bindings.flatMap(t=>x(e,t)):x(e,t.redirection.bindings)}var N=class{bindings;serviceIdentifier;isContextFree;constructor(e,t){this.bindings=e,this.serviceIdentifier=t,this.isContextFree=!0}resolve(e){var t=this.bindings;let n=[];for(let i of t)M(i)?n.push(...j(e,i)):n.push(i.resolve(e));return n.some(I)?Promise.all(n):n}},k=Symbol.for("@inversifyjs/core/DynamicallyResolvableBindingNode"),O=()=>void 0,B=class{serviceIdentifier;isContextFree;resolve;#e;constructor(e){this.serviceIdentifier=e,this.isContextFree=!0,this.resolve=O}get bindings(){return this.#e}set bindings(e){if(this.#e=e,void 0===e)this.resolve=O;else if(this.resolve=Object.hasOwn(e,"resolve")?e.resolve:e.resolve.bind(e),!0===e[k]){let t=new WeakRef(this);e.addOnResolverChangedHandler(e=>{let n=t.deref();void 0!==n&&(n.resolve=e)})}}};function R(e,t,n){let i=`No bindings found for service: "${P(e)}".
Trying to resolve bindings for "${T(e,t)}".${E(n)}`;throw new w(y.planning,i)}function T(e,t){return void 0===t?`${P(e)} (Root service)`:P(t)}function E(e){let t=0===e.tags.size?"":`
- tags:
- ${[...e.tags.keys()].map(e=>e.toString()).join("\n - ")}`;return`
Binding constraints:
- service identifier: ${P(e.serviceIdentifier)}
- name: ${e.name?.toString()??"-"}${t}`}function V(e){return(t,n,i)=>{var r,o,s,c,l,d,u;let h,f,p=i.serviceIdentifier,$=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:p,tags:i.tags}),b=function(e,t,n){let i=n?.customServiceIdentifier??t.serviceIdentifier,r=(n?.chained===!0?[...e.operations.getBindingsChained(i)]:[...e.operations.getBindings(i)??[]]).filter(e=>e.isSatisfiedBy(t));if(0===r.length&&void 0!==e.autobindOptions&&"function"==typeof i){var o;let n,s=(o=e.autobindOptions,n=function(e){let t,n=a(e,"@inversifyjs/core/classMetadataReflectKey")??{constructorArguments:[],lifecycle:{postConstructMethodNames:new Set,preDestroyMethodNames:new Set},properties:new Map,scope:void 0};if(void 0===(t=a(e,"@inversifyjs/core/pendingClassMetadataCountReflectKey"))||0===t)return function(e,t){let n=[];if(t.length<e.length)throw new w(y.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}". "${e.name}" constructor requires at least ${e.length.toString()} arguments, found ${t.length.toString()} instead.
Are you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let e=0;e<t.length;++e)void 0===t[e]&&n.push(e);if(n.length>0)throw new w(y.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${n.join('", "')}".
Are you using @inject, @multiInject or @unmanaged decorators at those indexes?
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(e,n.constructorArguments),n;let i=[];for(let t=0;t<n.constructorArguments.length;++t){let r=n.constructorArguments[t];(void 0===r||r.kind===eY.unknown)&&i.push(` - Missing or incomplete metadata for type "${e.name}" at constructor argument with index ${t.toString()}.
Every constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(let[t,r]of n.properties)r.kind===eY.unknown&&i.push(` - Missing or incomplete metadata for type "${e.name}" at property "${t.toString()}".
This property must be decorated either with @inject or @multiInject decorator.`);throw 0===i.length?new w(y.unknown,`Unexpected class metadata for type "${e.name}" with uncompletion traces.
This might be caused by one of the following reasons:
1. A third party library is targeting inversify reflection metadata.
2. A bug is causing the issue. Consider submiting an issue to fix it.`):new w(y.missingInjectionDecorator,`Invalid class metadata at type ${e.name}:
${i.join("\n\n")}`)}(i).scope??o.scope,{cache:{isRight:!1,value:void 0},id:function(){var e,t;let n,i=a(Object,v)??0;return i===0x20000000000000-1?Reflect.defineMetadata(v,-(0x20000000000000-1),Object,void 0):(e=Object,t=()=>i,n=(a(e,v,void 0)??t())+1,Reflect.defineMetadata(v,n,e,void 0)),i}(),implementationType:i,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:n,serviceIdentifier:i,type:g});e.operations.setBinding(s),s.isSatisfiedBy(t)&&r.push(s)}return r}(t,new S($.last),{chained:i.isMultiple&&i.chained}),I=[];if(i.isMultiple){let n=new N(I,p);return I.push(...e(t,$,b,n,i)),n.isContextFree=!$.last.elem.getAncestorsCalled,n}let A=new B(p);I.push(...e(t,$,b,A,i)),A.isContextFree=!$.last.elem.getAncestorsCalled,r=i.optional,h=(o=$.last).elem.serviceIdentifier,f=o.previous?.elem.serviceIdentifier,Array.isArray(I)?function(e,t,n,i,r){if(1!==e.length)if(0===e.length)t||R(n,i,r);else{let t=`Ambiguous bindings found for service: "${P(n)}".
Registered bindings:
${e.map(e=>(function(e){switch(e.type){case g:return`[ type: "${e.type}", serviceIdentifier: "${P(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case m:return`[ type: "${e.type}", serviceIdentifier: "${P(e.serviceIdentifier)}", redirection: "${P(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${P(e.serviceIdentifier)}", scope: "${e.scope}" ]`}})(e.binding)).join("\n")}
Trying to resolve bindings for "${T(n,i)}".${E(r)}`;throw new w(y.planning,t)}}(I,r,h,f,o.elem):(s=I,c=r,l=h,d=f,u=o.elem,void 0!==s||c||R(l,d,u));let[C]=I;return A.bindings=C,A}}var F=Symbol.for("@inversifyjs/core/LazyPlanServiceNode"),D=class{[F];_serviceIdentifier;_serviceNode;constructor(e,t){this[F]=!0,this._serviceNode=e,this._serviceIdentifier=t}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return"object"==typeof e&&!!e&&!0===e[F]}invalidate(){this._serviceNode=void 0}isExpanded(){return void 0!==this._serviceNode}resolve(e){return this._getNode().resolve(e)}_getNode(){return void 0===this._serviceNode&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}};function _(e,t){return I(t)?(e.cache={isRight:!0,value:t},t.then(t=>z(e,t))):z(e,t)}function z(e,t){return e.cache={isRight:!0,value:t},t}async function K(e,t,n){let i=await t,r=n.next();for(;!0!==r.done;)i=await r.value(e.context,i),r=n.next();return i}function U(e,t,n){let i=t,r=n.next();for(;!0!==r.done;){let t=r.value(e.context,i);if(I(t))return K(e,t,n);i=t,r=n.next()}return i}function q(e,t,n){var i,r;let o,s=n;if(void 0!==t.onActivation){let n=t.onActivation;s=I(s)?s.then(t=>n(e.context,t)):n(e.context,s)}return i=t.serviceIdentifier,r=s,void 0===(o=e.context.getActivations(i))?r:I(r)?K(e,r,o[Symbol.iterator]()):U(e,r,o[Symbol.iterator]())}function L(e,t){let n=e.binding;switch(n.scope){case f:return i=>{if(n.cache.isRight)return n.cache.value;let r=q(i,n,t(i,e));return _(n,r)};case h:return i=>{if(i.requestScopeCache?.has(n.id)===!0)return i.requestScopeCache.get(n.id);let r=q(i,n,t(i,e));return(i.requestScopeCache??=new Map).set(n.id,r),r};case p:return i=>q(i,n,t(i,e))}}var H=class{binding;resolve;constructor(e){this.binding=e,this.resolve=L(this,(e,t)=>t.binding.value)}},W=class{binding;resolve;constructor(e){this.binding=e,this.resolve=L(this,(e,t)=>t.binding.value(e.context))}},G=class{binding;resolve;constructor(e){this.binding=e,this.resolve=L(this,(e,t)=>t.binding.factory(e.context))}};function J(e,t,n){let i=function(e,t,n){if(n in e)if("function"==typeof e[n]){let i;try{i=e[n]()}catch(e){throw new w(y.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:e})}if(I(i))return Y(t,n,i)}else throw new w(y.resolution,`Expecting a "${n.toString()}" method when resolving "${t.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);else throw new w(y.resolution,`Expecting a "${n.toString()}" property when resolving "${t.implementationType.name}" class @postConstruct decorated method, none found.`)}(e,t,n);return I(i)?i.then(()=>e):e}async function Y(e,t,n){try{await n}catch(n){throw new w(y.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:n})}}function Q(e,t,n){let i=[];for(let[r,o]of n.propertyParams){let s=n.classMetadata.properties.get(r);if(void 0===s)throw new w(y.resolution,`Expecting metadata at property "${r.toString()}", none found`);s.kind!==eZ.unmanaged&&void 0!==o.bindings&&(t[r]=o.resolve(e),I(t[r])&&i.push((async()=>{t[r]=await t[r]})()))}if(i.length>0)return Promise.all(i).then(()=>void 0)}function X(e,t,n){if(0===n.size)return e;let i=e;for(let e of n)i=I(i)?i.then(n=>J(n,t,e)):J(i,t,e);return i}function Z(e,t,n){let i=new n.binding.implementationType(...e),r=Q(t,i,n);return I(r)?r.then(()=>X(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)):X(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)}async function ee(e,t,n){return Z(await e,t,n)}function et(e,t){switch(e.scope){case f:return n=>e.cache.isRight?e.cache.value:_(e,t(n));case h:return n=>{if(n.requestScopeCache?.has(e.id)===!0)return n.requestScopeCache.get(e.id);let i=t(n);return(n.requestScopeCache??=new Map).set(e.id,i),i};case p:return t}}function en(e){return(t,n)=>{let i=t.context.getActivations(e);return void 0===i?n:I(n)?K(t,n,i[Symbol.iterator]()):U(t,n,i[Symbol.iterator]())}}var ei=0;function er(e,t,n,i){let r=(ei++).toString(),o=Array.from({length:e.classMetadata.constructorArguments.length},(e,t)=>t),s=o.map(e=>`value$${e.toString()}`).join(", "),a="";for(let e of o)a+=`const value$${e.toString()} = node$${r}.constructorParams[${e.toString()}].resolve(params$${r});
`;let c=e.classMetadata.properties.size,l=Array.from({length:c},(e,t)=>t),d=l.map(e=>`property$${e.toString()}`).join(", "),u=`let propertyIterator = node$${r}.propertyParams.entries();
`;for(let e of l)u+=`const propertyNode$${e.toString()} = propertyIterator.next().value;
const propertyKey$${e.toString()} = propertyNode$${e.toString()}[0];
const propertyBound$${e.toString()} = propertyNode$${e.toString()}[1].bindings !== undefined;
const property$${e.toString()} = propertyBound$${e.toString()} ? propertyNode$${e.toString()}[1].resolve(params$${r}) : undefined;
`;let v=l.map(e=>`if (propertyBound$${e.toString()}) { instance[propertyKey$${e.toString()}] = property$${e.toString()}; }`).join(" \n"),h=[s,d].filter(e=>e.length>0).join(", ");if(void 0===i){let i=0===c?`return function resolveNode$${r}(params$${r}) {
${a}
return resolveAsyncValues$${r}(
${s},
function (${s}) {
return new ctor$${r}(${s});
},
);
}`:`return function resolveNode$${r}(params$${r}) {
${a}
${u}
return resolveAsyncValues$${r}(
${h},
function (${h}) {
const instance = new ctor$${r}(${s});
${v}
return instance;
},
);
}`;return Function(`node$${r}`,`ctor$${r}`,`resolveAsyncValues$${r}`,i)(e,t,n)}let f=0===c?`return function resolveNode$${r}(params$${r}) {
${a}
return resolveAsyncValues$${r}(
${s},
function (${s}) {
return activate$${r}(
params$${r},
new ctor$${r}(${s}),
);
},
);
}`:`return function resolveNode$${r}(params$${r}) {
${a}
${u}
return resolveAsyncValues$${r}(
${h},
function (${h}) {
const instance = new ctor$${r}(${s});
${v}
return activate$${r}(
params$${r},
instance,
);
},
);
}`;return Function(`node$${r}`,`ctor$${r}`,`activate$${r}`,`resolveAsyncValues$${r}`,f)(e,t,i,n)}function eo(e,t,n,i,r){return I(e)?I(t)?new Promise(I(n)?I(i)?(o,s)=>{let a=0,c,l,d,u;e.then(e=>{4==++a?o(r(e,l,d,u)):c=e}).catch(s),t.then(e=>{4==++a?o(r(c,e,d,u)):l=e}).catch(s),n.then(e=>{4==++a?o(r(c,l,e,u)):d=e}).catch(s),i.then(e=>{4==++a?o(r(c,l,d,e)):u=e}).catch(s)}:(o,s)=>{let a=0,c,l,d;e.then(e=>{3==++a?o(r(e,l,d,i)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,d,i)):l=e}).catch(s),n.then(e=>{3==++a?o(r(c,l,e,i)):d=e}).catch(s)}:I(i)?(o,s)=>{let a=0,c,l,d;e.then(e=>{3==++a?o(r(e,l,n,d)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,n,d)):l=e}).catch(s),i.then(e=>{3==++a?o(r(c,l,n,e)):d=e}).catch(s)}:(o,s)=>{let a=0,c,l;e.then(e=>{2==++a?o(r(e,l,n,i)):c=e}).catch(s),t.then(e=>{2==++a?o(r(c,e,n,i)):l=e}).catch(s)}):I(n)?new Promise(I(i)?(o,s)=>{let a=0,c,l,d;e.then(e=>{3==++a?o(r(e,t,l,d)):c=e}).catch(s),n.then(e=>{3==++a?o(r(c,t,e,d)):l=e}).catch(s),i.then(e=>{3==++a?o(r(c,t,l,e)):d=e}).catch(s)}:(o,s)=>{let a=0,c,l;e.then(e=>{2==++a?o(r(e,t,l,i)):c=e}).catch(s),n.then(e=>{2==++a?o(r(c,t,e,i)):l=e}).catch(s)}):I(i)?new Promise((o,s)=>{let a=0,c,l;e.then(e=>{2==++a?o(r(e,t,n,l)):c=e}).catch(s),i.then(e=>{2==++a?o(r(c,t,n,e)):l=e}).catch(s)}):e.then(async e=>r(e,t,n,i)):I(t)?I(n)?new Promise(I(i)?(o,s)=>{let a=0,c,l,d;t.then(t=>{3==++a?o(r(e,t,l,d)):c=t}).catch(s),n.then(t=>{3==++a?o(r(e,c,t,d)):l=t}).catch(s),i.then(t=>{3==++a?o(r(e,c,l,t)):d=t}).catch(s)}:(o,s)=>{let a=0,c,l;t.then(t=>{2==++a?o(r(e,t,l,i)):c=t}).catch(s),n.then(t=>{2==++a?o(r(e,c,t,i)):l=t}).catch(s)}):I(i)?new Promise((o,s)=>{let a=0,c,l;t.then(t=>{2==++a?o(r(e,t,n,l)):c=t}).catch(s),i.then(t=>{2==++a?o(r(e,c,n,t)):l=t}).catch(s)}):t.then(async t=>r(e,t,n,i)):I(n)?I(i)?new Promise((o,s)=>{let a=0,c,l;n.then(n=>{2==++a?o(r(e,t,n,l)):c=n}).catch(s),i.then(n=>{2==++a?o(r(e,t,c,n)):l=n}).catch(s)}):n.then(async n=>r(e,t,n,i)):I(i)?i.then(async i=>r(e,t,n,i)):r(e,t,n,i)}function es(e,t,n,i){return I(e)?I(t)?new Promise(I(n)?(r,o)=>{let s=0,a,c,l;e.then(e=>{3==++s?r(i(e,c,l)):a=e}).catch(o),t.then(e=>{3==++s?r(i(a,e,l)):c=e}).catch(o),n.then(e=>{3==++s?r(i(a,c,e)):l=e}).catch(o)}:(r,o)=>{let s=0,a,c;e.then(e=>{2==++s?r(i(e,c,n)):a=e}).catch(o),t.then(e=>{2==++s?r(i(a,e,n)):c=e}).catch(o)}):I(n)?new Promise((r,o)=>{let s=0,a,c;e.then(e=>{2==++s?r(i(e,t,c)):a=e}).catch(o),n.then(e=>{2==++s?r(i(a,t,e)):c=e}).catch(o)}):e.then(async e=>i(e,t,n)):I(t)?I(n)?new Promise((r,o)=>{let s=0,a,c;t.then(t=>{2==++s?r(i(e,t,c)):a=t}).catch(o),n.then(t=>{2==++s?r(i(e,a,t)):c=t}).catch(o)}):t.then(async t=>i(e,t,n)):I(n)?n.then(async n=>i(e,t,n)):i(e,t,n)}function ea(e,t,n){return I(e)?I(t)?new Promise((i,r)=>{let o=0,s,a;e.then(e=>{2==++o?i(n(e,a)):s=e}).catch(r),t.then(e=>{2==++o?i(n(s,e)):a=e}).catch(r)}):e.then(async e=>n(e,t)):I(t)?t.then(async t=>n(e,t)):n(e,t)}function ec(...e){let t=e[e.length-1],n=e.slice(0,-1);for(let e of n)if(I(e))return Promise.all(n).then(e=>t(...e));return t(...n)}var el=(eG=function(e,t){let n=[],i=!1;for(let r of t.constructorParams){let t=r.resolve(e);!i&&I(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n},(e,t)=>{let n=eG(e,t);return I(n)?ee(n,e,t):Z(n,e,t)});function ed(e,t,n){return 0===e.classMetadata.lifecycle.postConstructMethodNames.size&&void 0===e.binding.onActivation?n?function(e,t){let n=e.binding.implementationType,i=e.binding.serviceIdentifier,r=t?en(i):void 0,o;switch(e.classMetadata.constructorArguments.length+e.classMetadata.properties.size){case 0:let s;s=(ei++).toString(),o=void 0===r?Function(`ctor$${s}`,`return function resolveNode$${s}(params$${s}) {
return new ctor$${s}();
};`)(n):Function(`ctor$${s}`,`activate$${s}`,`return function resolveNode$${s}(params$${s}) {
return activate$${s}(params$${s}, new ctor$${s}());
};`)(n,r);break;case 1:let a,c;o=0===e.classMetadata.properties.size?(a=(ei++).toString(),void 0===r?Function(`node$${a}`,`ctor$${a}`,`isPromise$${a}`,`return function resolveNode$${a}(params$${a}) {
const resolvedValue$${a} = node$${a}.constructorParams[0].resolve(params$${a});
if (isPromise$${a}(resolvedValue$${a})) {
return resolvedValue$${a}.then(function (resolvedValue$${a}) {
return new ctor$${a}(resolvedValue$${a});
});
}
return new ctor$${a}(resolvedValue$${a});
};`)(e,n,I):Function(`node$${a}`,`ctor$${a}`,`activate$${a}`,`isPromise$${a}`,`return function resolveNode$${a}(params$${a}) {
const resolvedValue$${a} = node$${a}.constructorParams[0].resolve(params$${a});
if (isPromise$${a}(resolvedValue$${a})) {
return resolvedValue$${a}.then(function (resolvedValue$${a}) {
return activate$${a}(params$${a}, new ctor$${a}(resolvedValue$${a}));
});
}
return activate$${a}(params$${a}, new ctor$${a}(resolvedValue$${a}));
};`)(e,n,r,I)):(c=(ei++).toString(),void 0===r?Function(`node$${c}`,`ctor$${c}`,`isPromise$${c}`,`return function resolveNode$${c}(params$${c}) {
const propertyEntry$${c} = node$${c}.propertyParams.entries().next().value;
const propertyKey$${c} = propertyEntry$${c}[0];
const instance$${c} = new ctor$${c}();
if (propertyEntry$${c}[1].bindings === undefined) {
return instance$${c};
}
const resolvedValue$${c} = propertyEntry$${c}[1].resolve(params$${c});
if (isPromise$${c}(resolvedValue$${c})) {
return resolvedValue$${c}.then(function (resolvedValue$${c}) {
instance$${c}[propertyKey$${c}] = resolvedValue$${c};
return instance$${c};
});
}
instance$${c}[propertyKey$${c}] = resolvedValue$${c};
return instance$${c};
};`)(e,n,I):Function(`node$${c}`,`ctor$${c}`,`activate$${c}`,`isPromise$${c}`,`return function resolveNode$${c}(params$${c}) {
const propertyEntry$${c} = node$${c}.propertyParams.entries().next().value;
const propertyKey$${c} = propertyEntry$${c}[0];
const instance$${c} = new ctor$${c}();
if (propertyEntry$${c}[1].bindings === undefined) {
return activate$${c}(params$${c}, instance$${c});
}
const resolvedValue$${c} = propertyEntry$${c}[1].resolve(params$${c});
if (isPromise$${c}(resolvedValue$${c})) {
return resolvedValue$${c}.then(function (resolvedValue$${c}) {
instance$${c}[propertyKey$${c}] = resolvedValue$${c};
return activate$${c}(params$${c}, instance$${c});
});
}
instance$${c}[propertyKey$${c}] = resolvedValue$${c};
return activate$${c}(params$${c}, instance$${c});
};`)(e,n,r,I));break;case 2:o=er(e,n,ea,r);break;case 3:o=er(e,n,es,r);break;case 4:o=er(e,n,eo,r);break;default:let l,d,u,v,h;o=er(e,n,(l=(ei++).toString(),u=(d=Array.from({length:e.classMetadata.constructorArguments.length},(e,t)=>t)).map(e=>`value$${e.toString()}`).join(", "),v=d.map(e=>`resolvedValue$${e.toString()}`).join(", "),h=d.map(e=>`isPromise$${l}(value$${e.toString()})`).join(" || "),Function(`isPromise$${l}`,`return function resolveMany$${l}(${u}, build$${l}) {
if (${h}) {
return Promise.all([${u}]).then(
function ([${v}]) {
return build$${l}(${v});
},
);
}
return build$${l}(${u});
};`)(I)),r)}return et(e.binding,o)}(e,t):function(e,t){let n=e.binding.serviceIdentifier,i=t?en(n):void 0,r;switch(e.classMetadata.constructorArguments.length){case 0:r=0===e.classMetadata.properties.size?void 0===i?function(t){return new e.binding.implementationType}:function(t){return i(t,new e.binding.implementationType)}:void 0===i?function(t){let n=new e.binding.implementationType,i=Q(t,n,e);return I(i)?i.then(()=>n):n}:function(t){let n=new e.binding.implementationType,r=Q(t,n,e);return I(r)?r.then(()=>i(t,n)):i(t,n)};break;case 1:r=function(e,t){if(0===e.classMetadata.properties.size)return void 0===t?function(t){let n=e.constructorParams[0].resolve(t);return I(n)?n.then(t=>new e.binding.implementationType(t)):new e.binding.implementationType(n)}:function(n){let i=e.constructorParams[0].resolve(n);return I(i)?i.then(i=>t(n,new e.binding.implementationType(i))):t(n,new e.binding.implementationType(i))};if(void 0===t){let t=(t,n)=>{let i=Q(t,n,e);return I(i)?i.then(()=>n):n};return function(n){let i=e.constructorParams[0].resolve(n);return I(i)?i.then(i=>t(n,new e.binding.implementationType(i))):t(n,new e.binding.implementationType(i))}}let n=(n,i)=>{let r=Q(n,i,e);return I(r)?r.then(()=>t(n,i)):t(n,i)};return function(t){let i=e.constructorParams[0].resolve(t);return I(i)?i.then(i=>n(t,new e.binding.implementationType(i))):n(t,new e.binding.implementationType(i))}}(e,i);break;case 2:r=0===e.classMetadata.properties.size?void 0===i?function(t){return ea(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(t,n)=>new e.binding.implementationType(t,n))}:function(t){return ea(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,r)=>i(t,new e.binding.implementationType(n,r)))}:void 0===i?function(t){return ea(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,i)=>{var r;let o;return I(o=Q(t,r=new e.binding.implementationType(n,i),e))?o.then(()=>r):r})}:function(t){return ea(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,r)=>{var o;let s;return I(s=Q(t,o=new e.binding.implementationType(n,r),e))?s.then(()=>i(t,o)):i(t,o)})};break;case 3:r=0===e.classMetadata.properties.size?void 0===i?function(t){return es(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(t,n,i)=>new e.binding.implementationType(t,n,i))}:function(t){return es(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,r,o)=>i(t,new e.binding.implementationType(n,r,o)))}:void 0===i?function(t){return es(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,i,r)=>{var o;let s;return I(s=Q(t,o=new e.binding.implementationType(n,i,r),e))?s.then(()=>o):o})}:function(t){return es(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,r,o)=>{var s;let a;return I(a=Q(t,s=new e.binding.implementationType(n,r,o),e))?a.then(()=>i(t,s)):i(t,s)})};break;case 4:r=0===e.classMetadata.properties.size?void 0===i?function(t){return eo(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),e.constructorParams[3].resolve(t),(t,n,i,r)=>new e.binding.implementationType(t,n,i,r))}:function(t){return eo(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),e.constructorParams[3].resolve(t),(n,r,o,s)=>i(t,new e.binding.implementationType(n,r,o,s)))}:void 0===i?function(t){return eo(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),e.constructorParams[3].resolve(t),(n,i,r,o)=>{var s;let a;return I(a=Q(t,s=new e.binding.implementationType(n,i,r,o),e))?a.then(()=>s):s})}:function(t){return eo(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),e.constructorParams[3].resolve(t),(n,r,o,s)=>{var a;let c;return I(c=Q(t,a=new e.binding.implementationType(n,r,o,s),e))?c.then(()=>i(t,a)):i(t,a)})};break;default:r=function(e,t,n){let i=e.classMetadata.constructorArguments.length;function r(t){let n=Array(i);for(let r=0;r<i;r++)n[r]=e.constructorParams[r].resolve(t);return n}return 0===e.classMetadata.properties.size?void 0===n?function(n){return t(...r(n),function(...t){return new e.binding.implementationType(...t)})}:function(i){return t(...r(i),(...t)=>n(i,new e.binding.implementationType(...t)))}:void 0===n?function(n){return t(...r(n),function(...t){let i=new e.binding.implementationType(...t),r=Q(n,i,e);return I(r)?r.then(()=>i):i})}:function(i){return t(...r(i),(...t)=>{let r=new e.binding.implementationType(...t),o=Q(i,r,e);return I(o)?o.then(()=>n(i,r)):n(i,r)})}}(e,ec,i)}return et(e.binding,r)}(e,t):L(e,el)}var eu=class{binding;classMetadata;[k];constructorParams;propertyParams;resolve;#e;#t;constructor(e,t,n){this.binding=e,this.classMetadata=t,this[k]=!0,this.constructorParams=[],this.propertyParams=new Map,this.#e=n.jitEnabled;let i=void 0!==n.operations.getActivations(e.serviceIdentifier);this.#t=void 0,this.resolve=ed(this,i,this.#e),i||n.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=ed(this,!0,this.#e),void 0!==this.#t)for(let e of this.#t)e(this.resolve)}addOnResolverChangedHandler(e){void 0===this.#t&&(this.#t=[]),this.#t.push(e)}},ev=class{binding;#e;#t;constructor(e){this.binding=e,this.#e=void 0,this.#t=void 0}get redirection(){return this.#e}set redirection(e){this.#e=e,void 0===e.bindings?this.#t=()=>void 0:Array.isArray(e.bindings)?this.#t=()=>{throw new w(y.planning,"Unexpected resolver call for multiple bindings redirection")}:this.#t=t=>e.bindings.resolve(t)}resolve(e){return this.#t(e)}};function eh(e,t){let n=function(e,t){let n=[],i=!1;for(let r of t.params){let t=r.resolve(e);!i&&I(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n}(e,t);return I(n)?n.then(e=>t.binding.factory(...e)):t.binding.factory(...n)}function ef(e,t,n){let i=(ei++).toString(),r=Array.from({length:e.binding.metadata.arguments.length},(e,t)=>t),o=r.map(e=>`value$${e.toString()}`).join(", "),s="";for(let e of r)s+=`const value$${e.toString()} = node$${i}.params[${e.toString()}].resolve(params$${i});
`;return void 0===n?Function(`node$${i}`,`resolveAsyncValues$${i}`,`return function resolveNode$${i}(params$${i}) {
${s}
return resolveAsyncValues$${i}(
${o},
function (${o}) {
return node$${i}.binding.factory(${o});
},
);
}`)(e,t):Function(`node$${i}`,`activate$${i}`,`resolveAsyncValues$${i}`,`return function resolveNode$${i}(params$${i}) {
${s}
return resolveAsyncValues$${i}(
${o},
function (${o}) {
return activate$${i}(
params$${i},
node$${i}.binding.factory(${o}),
);
},
);
}`)(e,n,t)}function ep(e,t,n){return void 0===e.binding.onActivation?n?function(e,t){let n=e.binding.serviceIdentifier,i=t?en(n):void 0,r;switch(e.binding.metadata.arguments.length){case 0:let o;o=(ei++).toString(),r=void 0===i?Function(`node$${o}`,`return function resolveNode$${o}(params$${o}) {
return node$${o}.binding.factory();
};`)(e):Function(`node$${o}`,`activate$${o}`,`return function resolveNode$${o}(params$${o}) {
return activate$${o}(params$${o}, node$${o}.binding.factory());
};`)(e,i);break;case 1:let s;s=(ei++).toString(),r=void 0===i?Function(`node$${s}`,`isPromise$${s}`,`return function resolveNode$${s}(params$${s}) {
const resolvedValue$${s} = node$${s}.params[0].resolve(params$${s});
if (isPromise$${s}(resolvedValue$${s})) {
return resolvedValue$${s}.then(function (resolvedValue$${s}) {
return node$${s}.binding.factory(resolvedValue$${s});
});
}
return node$${s}.binding.factory(resolvedValue$${s});
};`)(e,I):Function(`node$${s}`,`activate$${s}`,`isPromise$${s}`,`return function resolveNode$${s}(params$${s}) {
const resolvedValue$${s} = node$${s}.params[0].resolve(params$${s});
if (isPromise$${s}(resolvedValue$${s})) {
return resolvedValue$${s}.then(function (resolvedValue$${s}) {
return activate$${s}(params$${s}, node$${s}.binding.factory(resolvedValue$${s}));
});
}
return activate$${s}(params$${s}, node$${s}.binding.factory(resolvedValue$${s}));
};`)(e,i,I);break;case 2:r=ef(e,ea,i);break;case 3:r=ef(e,es,i);break;case 4:r=ef(e,eo,i);break;default:r=void 0===i?t=>eh(t,e):t=>i(t,eh(t,e))}return et(e.binding,r)}(e,t):function(e,t){let n=e.binding.serviceIdentifier,i=t?en(n):void 0,r;switch(e.binding.metadata.arguments.length){case 0:r=void 0===i?function(t){return e.binding.factory()}:function(t){return i(t,e.binding.factory())};break;case 1:r=void 0===i?function(t){let n=e.params[0].resolve(t);return I(n)?n.then(t=>e.binding.factory(t)):e.binding.factory(n)}:function(t){let n=e.params[0].resolve(t);return I(n)?n.then(n=>i(t,e.binding.factory(n))):i(t,e.binding.factory(n))};break;case 2:r=void 0===i?function(t){return ea(e.params[0].resolve(t),e.params[1].resolve(t),(t,n)=>e.binding.factory(t,n))}:function(t){return ea(e.params[0].resolve(t),e.params[1].resolve(t),(n,r)=>i(t,e.binding.factory(n,r)))};break;case 3:r=void 0===i?function(t){return es(e.params[0].resolve(t),e.params[1].resolve(t),e.params[2].resolve(t),(t,n,i)=>e.binding.factory(t,n,i))}:function(t){return es(e.params[0].resolve(t),e.params[1].resolve(t),e.params[2].resolve(t),(n,r,o)=>i(t,e.binding.factory(n,r,o)))};break;case 4:r=void 0===i?function(t){return eo(e.params[0].resolve(t),e.params[1].resolve(t),e.params[2].resolve(t),e.params[3].resolve(t),(t,n,i,r)=>e.binding.factory(t,n,i,r))}:function(t){return eo(e.params[0].resolve(t),e.params[1].resolve(t),e.params[2].resolve(t),e.params[3].resolve(t),(n,r,o,s)=>i(t,e.binding.factory(n,r,o,s)))};break;default:r=void 0===i?t=>eh(t,e):t=>i(t,eh(t,e))}return et(e.binding,r)}(e,t):L(e,eh)}var eg=class{binding;[k];params;resolve;#e;#t;constructor(e,t){this.binding=e,this[k]=!0,this.params=[],this.#e=t.jitEnabled;let n=void 0!==t.operations.getActivations(e.serviceIdentifier);this.#t=void 0,this.resolve=ep(this,n,this.#e),n||t.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=ep(this,!0,this.#e),void 0!==this.#t)for(let e of this.#t)e(this.resolve)}addOnResolverChangedHandler(e){void 0===this.#t&&(this.#t=[]),this.#t.push(e)}};function em(e){var t,n,i;let r=(t=e,(e,n,i)=>{let r=new eu(n,e.operations.getClassMetadata(n.implementationType),e);return t({autobindOptions:e.autobindOptions,jitEnabled:e.jitEnabled,node:r,operations:e.operations,servicesBranch:e.servicesBranch},i)}),o=(n=e,(e,t,i)=>{let r=new eg(t,e);return n({autobindOptions:e.autobindOptions,jitEnabled:e.jitEnabled,node:r,operations:e.operations,servicesBranch:e.servicesBranch},i)}),s=(i=e,(e,t,n,r)=>{let o=new ev(n);return i({autobindOptions:e.autobindOptions,buildServiceNodeOptions:{...r,serviceIdentifier:n.targetServiceIdentifier},jitEnabled:e.jitEnabled,node:o,operations:e.operations,servicesBranch:e.servicesBranch},t)});return(e,t,n,i,a)=>{let c=M(i)?i.binding.targetServiceIdentifier:i.serviceIdentifier;e.servicesBranch.push(c);let l=[];for(let i of n){if("Factory"===i.type){l.push(new G(i));continue}switch(i.type){case"ConstantValue":l.push(new H(i));break;case"DynamicValue":l.push(new W(i));break;case g:l.push(r(e,i,t));break;case"ResolvedValue":l.push(o(e,i,t));break;case m:{let n=s(e,t,i,a);l.push(n)}}}return e.servicesBranch.pop(),l}}var e$={isNoParam:!0,resolve:()=>void 0};function ey(e,t,n,i){void 0!==e&&(D.is(n)&&!n.isExpanded()||n.isContextFree)?t.setPlan(e,{tree:{root:n}}):t.setNonCachedServiceNode(n,i)}var eb=class extends D{#e;#t;#n;#i;constructor(e,t,n,i,r){super(r,i.serviceIdentifier),this.#t=t,this.#e=e,this.#n=n,this.#i=i}_buildPlanServiceNode(){return this.#t(this.#e,this.#n,this.#i)}};function ew(e,t){var n,i,r,o,s,a,c,l,d,u,v,h;let f,p,m,$=(n=e,i=t,f=(r=n,o=i,(e,t,n)=>{let i;if(n.kind===eZ.unmanaged)return;if(t.length>500)throw new w(y.planningMaxDepthExceeded,"Maximum plan depth exceeded. This is likely caused by a circular dependency.");let s=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;let[n,i]=e.tags.entries().next().value;t={key:n,value:i}}let n=C.is(e.value)?e.value.unwrap():e.value;return e.kind===eZ.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(n);if(void 0!==s){let t=e.operations.getPlan(s);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}let a=(i=C.is(n.value)?n.value.unwrap():n.value,n.kind===eZ.multipleInjection?{chained:n.chained,isMultiple:!0,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}:{isMultiple:!1,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}),c=new eb(e,r,t,a,o(e,t,a));return ey(s,e.operations,c,{bindingConstraintsList:t,buildServiceNodeOptions:a}),c}),(e,t,n)=>{let i=t.classMetadata;for(let[r,o]of i.constructorArguments.entries())t.constructorParams[r]=f(e,n,o)??e$;for(let[r,o]of i.properties){let i=f(e,n,o);void 0!==i&&t.propertyParams.set(r,i)}return e.node}),b=(s=e,a=t,p=(c=s,l=a,(e,t)=>{let n=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;let[n,i]=e.tags.entries().next().value;t={key:n,value:i}}let n=C.is(e.serviceIdentifier)?e.serviceIdentifier.unwrap():e.serviceIdentifier;return e.isMultiple?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(e.buildServiceNodeOptions);if(void 0!==n){let t=e.operations.getPlan(n);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}let i=e.buildServiceNodeOptions,r=new eb(e,c,t,i,l(e,t,i));return ey(n,e.operations,r,{bindingConstraintsList:t,buildServiceNodeOptions:i}),r}),(e,t,n)=>{let i={autobindOptions:e.autobindOptions,buildServiceNodeOptions:e.buildServiceNodeOptions,jitEnabled:e.jitEnabled,node:t,operations:e.operations,servicesBranch:e.servicesBranch};return t.redirection=p(i,n),t}),S=(d=e,u=t,m=(v=d,h=u,(e,t,n)=>{let i;if(t.length>500)throw new w(y.planningMaxDepthExceeded,"Maximum plan depth exceeded. This is likely caused by a circular dependency.");let r=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;let[n,i]=e.tags.entries().next().value;t={key:n,value:i}}let n=C.is(e.value)?e.value.unwrap():e.value;return e.kind===e1.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(n);if(void 0!==r){let t=e.operations.getPlan(r);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}let o=(i=C.is(n.value)?n.value.unwrap():n.value,n.kind===e1.multipleInjection?{chained:n.chained,isMultiple:!0,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}:{isMultiple:!1,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}),s=new eb(e,v,t,o,h(e,t,o));return ey(r,e.operations,s,{bindingConstraintsList:t,buildServiceNodeOptions:o}),s}),(e,t,n)=>{for(let[i,r]of t.binding.metadata.arguments.entries())t.params[i]=m(e,n,r);return e.node});return(e,t)=>e.node.binding.type===g?$(e,e.node,t):M(e.node)?b(e,e.node,t):S(e,e.node,t)}var eS=V(function(e,t,n,i,r){return eI(e,t,n,i,r)}),eI=em(ew(eS,eS));(eJ=e2||={}).bindingAdded="bindingAdded",eJ.bindingRemoved="bindingRemoved";var eP=(e=V(em(ew(eS,function(e,t,n){return eP(e,t,n)}))),(t,n,i)=>{try{return e(t,n,i)}catch(e){if(w.isErrorOfKind(e,y.planning))return;throw e}}),eA=Symbol.for("@inversifyjs/plugin/isPlugin"),eC=class{[eA]=!0;_container;_context;constructor(e,t){this._container=e,this._context=t}};function eM(e){return("object"==typeof e&&!!e||"function"==typeof e)&&"function"==typeof e.then}function ex(e){switch(typeof e){case"string":case"symbol":return e.toString();case"function":return e.name;default:throw Error(`Unexpected ${typeof e} service id type`)}}var ej=Symbol.for("@inversifyjs/common/islazyServiceIdentifier"),eN=class{[ej];#e;constructor(e){this.#e=e,this[ej]=!0}static is(e){return"object"==typeof e&&!!e&&!0===e[ej]}unwrap(){return this.#e()}};function ek(e,t,n){return Reflect.getOwnMetadata(t,e,n)}function eO(e,t,n,i){Reflect.defineMetadata(t,n,e,i)}function eB(e,t,n,i,r){let o=i(ek(e,t,r)??n());Reflect.defineMetadata(t,o,e,r)}(t=()=>{var e,t;t=e||={},function(e){var n="object"==typeof globalThis?globalThis:"object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:function(){throw ReferenceError("globalThis could not be found. Please polyfill globalThis before loading this module.")}(),i=r(t);function r(e,t){return function(n,i){Object.defineProperty(e,n,{configurable:!0,writable:!0,value:i}),t&&t(n,i)}}void 0!==n.Reflect&&(i=r(n.Reflect,i)),e(i,n),void 0===n.Reflect&&(n.Reflect=t)}(function(e,t){var n,i="function"==typeof Symbol,r=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:N("Symbol.toPrimitive not found."),o=i&&void 0!==Symbol.iterator?Symbol.iterator:N("Symbol.iterator not found."),s=Object.getPrototypeOf(Function),a="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:N("A valid Map constructor could not be found."),c="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:N("A valid Set constructor could not be found."),l="function"==typeof WeakMap?WeakMap:N("A valid WeakMap constructor could not be found."),d=i?Symbol.for("@reflect-metadata:registry"):void 0,u=(!$(d)&&b(t.Reflect)&&Object.isExtensible(t.Reflect)&&(n=t.Reflect[d]),$(n)&&(n=function(){$(d)||void 0===t.Reflect||d in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(n=(e=t.Reflect).defineMetadata,i=e.hasOwnMetadata,r=e.getOwnMetadata,o=e.getOwnMetadataKeys,s=e.deleteMetadata,u=new l,v={isProviderFor:function(e,t){var n=u.get(e);return!!(!$(n)&&n.has(t))||!!o(e,t).length&&($(n)&&(n=new c,u.set(e,n)),n.add(t),!0)},OrdinaryDefineOwnMetadata:n,OrdinaryHasOwnMetadata:i,OrdinaryGetOwnMetadata:r,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:s});var e,n,i,r,o,s,u,v,h,f,p,g=new l,m={registerProvider:function(e){if(!Object.isExtensible(m))throw Error("Cannot add provider to a frozen registry.");switch(!0){case v===e:break;case $(h):h=e;break;case h===e:break;case $(f):f=e;break;case f===e:break;default:void 0===p&&(p=new c),p.add(e)}},getProvider:y,setProvider:function(e,t,n){if(!function(e){if($(e))throw TypeError();return h===e||f===e||!$(p)&&p.has(e)}(n))throw Error("Metadata provider not registered.");var i=y(e,t);if(i!==n){if(!$(i))return!1;var r=g.get(e);$(r)&&(r=new a,g.set(e,r)),r.set(t,n)}return!0}};return m;function y(e,t){var n,i=g.get(e);return $(i)||(n=i.get(t)),$(n)&&(n=function(e,t){if(!$(h)){if(h.isProviderFor(e,t))return h;if(!$(f)){if(f.isProviderFor(e,t))return h;if(!$(p))for(var n=C(p);;){var i=M(n);if(!i)return;var r=i.value;if(r.isProviderFor(e,t))return x(n),r}}}if(!$(v)&&v.isProviderFor(e,t))return v}(e,t),$(n)||($(i)&&(i=new a,g.set(e,i)),i.set(t,n))),n}}()),!$(d)&&b(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,d,{enumerable:!1,configurable:!1,writable:!1,value:n}),n),v=function(e){var t=new l,n={isProviderFor:function(e,n){var i=t.get(e);return!$(i)&&i.has(n)},OrdinaryDefineOwnMetadata:function(e,t,n,r){i(n,r,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,n){var r=i(t,n,!1);return!$(r)&&!!r.has(e)},OrdinaryGetOwnMetadata:function(e,t,n){var r=i(t,n,!1);if(!$(r))return r.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var n=[],r=i(e,t,!1);if($(r))return n;for(var o=C(r.keys()),s=0;;){var a=M(o);if(!a)return n.length=s,n;var c=a.value;try{n[s]=c}catch(e){try{x(o)}finally{throw e}}s++}},OrdinaryDeleteMetadata:function(e,n,r){var o=i(n,r,!1);if($(o)||!o.delete(e))return!1;if(0===o.size){var s=t.get(n);$(s)||(s.delete(r),0===s.size&&t.delete(s))}return!0}};return u.registerProvider(n),n;function i(i,r,o){var s=t.get(i),c=!1;if($(s)){if(!o)return;s=new a,t.set(i,s),c=!0}var l=s.get(r);if($(l)){if(!o)return;if(l=new a,s.set(r,l),!e.setProvider(i,r,n))throw s.delete(r),c&&t.delete(i),Error("Wrong provider for target.")}return l}}(u);function h(e,t,n){var i=k(t,n,!1);return!$(i)&&!!i.OrdinaryHasOwnMetadata(e,t,n)}function f(e,t,n){var i=k(t,n,!1);if(!$(i))return i.OrdinaryGetOwnMetadata(e,t,n)}function p(e,t,n,i){k(n,i,!0).OrdinaryDefineOwnMetadata(e,t,n,i)}function g(e,t){var n=k(e,t,!1);return n?n.OrdinaryOwnMetadataKeys(e,t):[]}function m(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function $(e){return void 0===e}function y(e){return null===e}function b(e){return"object"==typeof e?null!==e:"function"==typeof e}function w(e){var t=function(e){switch(m(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var t="string",n=A(e,r);if(void 0!==n){var i=n.call(e,t);if(b(i))throw TypeError();return i}return function(e,t){if("string"===t){var n=e.toString;if(I(n)){var i=n.call(e);if(!b(i))return i}var r=e.valueOf;if(I(r)){var i=r.call(e);if(!b(i))return i}}else{var r=e.valueOf;if(I(r)){var i=r.call(e);if(!b(i))return i}var o=e.toString;if(I(o)){var i=o.call(e);if(!b(i))return i}}throw TypeError()}(e,t)}(e);return"symbol"==typeof t?t:""+t}function S(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function I(e){return"function"==typeof e}function P(e){return"function"==typeof e}function A(e,t){var n=e[t];if(null!=n){if(!I(n))throw TypeError();return n}}function C(e){var t=A(e,o);if(!I(t))throw TypeError();var n=t.call(e);if(!b(n))throw TypeError();return n}function M(e){var t=e.next();return!t.done&&t}function x(e){var t=e.return;t&&t.call(e)}function j(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===s||t!==s)return t;var n=e.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return t;var r=i.constructor;return"function"!=typeof r||r===e?t:r}function N(e){throw e}function k(e,t,n){var i=u.getProvider(e,t);if(!$(i))return i;if(n){if(u.setProvider(e,t,v))return v;throw Error("Illegal state.")}}e("decorate",function(e,t,n,i){if($(n)){if(!S(e)||!P(t))throw TypeError();for(var r=t,o=e.length-1;o>=0;--o){var s=(0,e[o])(r);if(!$(s)&&!y(s)){if(!P(s))throw TypeError();r=s}}return r}if(!S(e)||!b(t)||!b(i)&&!$(i)&&!y(i))throw TypeError();return y(i)&&(i=void 0),function(e,t,n,i){for(var r=e.length-1;r>=0;--r){var o=(0,e[r])(t,n,i);if(!$(o)&&!y(o)){if(!b(o))throw TypeError();i=o}}return i}(e,t,n=w(n),i)}),e("metadata",function(e,t){return function(n,i){if(!b(n)||!$(i)&&!function(e){switch(m(e)){case 3:case 4:return!0;default:return!1}}(i))throw TypeError();p(e,t,n,i)}}),e("defineMetadata",function(e,t,n,i){if(!b(n))throw TypeError();return $(i)||(i=w(i)),p(e,t,n,i)}),e("hasMetadata",function(e,t,n){if(!b(t))throw TypeError();return $(n)||(n=w(n)),function e(t,n,i){if(h(t,n,i))return!0;var r=j(n);return!y(r)&&e(t,r,i)}(e,t,n)}),e("hasOwnMetadata",function(e,t,n){if(!b(t))throw TypeError();return $(n)||(n=w(n)),h(e,t,n)}),e("getMetadata",function(e,t,n){if(!b(t))throw TypeError();return $(n)||(n=w(n)),function e(t,n,i){if(h(t,n,i))return f(t,n,i);var r=j(n);if(!y(r))return e(t,r,i)}(e,t,n)}),e("getOwnMetadata",function(e,t,n){if(!b(t))throw TypeError();return $(n)||(n=w(n)),f(e,t,n)}),e("getMetadataKeys",function(e,t){if(!b(e))throw TypeError();return $(t)||(t=w(t)),function e(t,n){var i=g(t,n),r=j(t);if(null===r)return i;var o=e(r,n);if(o.length<=0)return i;if(i.length<=0)return o;for(var s=new c,a=[],l=0;l<i.length;l++){var d=i[l],u=s.has(d);u||(s.add(d),a.push(d))}for(var v=0;v<o.length;v++){var d=o[v],u=s.has(d);u||(s.add(d),a.push(d))}return a}(e,t)}),e("getOwnMetadataKeys",function(e,t){if(!b(e))throw TypeError();return $(t)||(t=w(t)),g(e,t)}),e("deleteMetadata",function(e,t,n){if(!b(t))throw TypeError();$(n)||(n=w(n));var i=k(t,n,!1);return!$(i)&&i.OrdinaryDeleteMetadata(e,t,n)})})},()=>(n||(t((n={exports:{}}).exports,n),t=null),n.exports))();var eR="@inversifyjs/container/bindingId",eT=class{#e;#t;constructor(e){let t;this.#e=((t=ek(Object,eR)??0)===0x20000000000000-1?eO(Object,eR,-(0x20000000000000-1)):eB(Object,eR,()=>t,e=>e+1),t),this.#t=e}get id(){return this.#e}load(e){return this.#t(e)}},eE="@inversifyjs/container/bindingId";function eV(){let e=ek(Object,eE)??0;return e===0x20000000000000-1?eO(Object,eE,-(0x20000000000000-1)):eB(Object,eE,()=>e,e=>e+1),e}var eF={Request:"Request",Singleton:"Singleton",Transient:"Transient"},eD={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*e_(...e){for(let t of e)yield*t}var ez,eK,eU,eq,eL,eH,eW,eG,eJ,eY,eQ,eX,eZ,e0,e1,e2,e3,e4=class e{#e;#t;#n;constructor(e){for(let t of(this.#e=new Map,this.#t={},Reflect.ownKeys(e)))this.#t[t]=new Map;this.#n=e}add(e,t){for(let n of(this.#r(e).push(t),Reflect.ownKeys(t)))this.#o(n,t[n]).push(e)}clone(){let e=this.#i(),t=this.#s(),n=Reflect.ownKeys(this.#n),i=this._buildNewInstance(this.#n);for(let r of(this.#a(this.#e,i.#e,e,t),n))this.#c(this.#t[r],i.#t[r],e);return i}get(e,t){return this.#t[e].get(t)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,t){let n=this.get(e,t);if(void 0!==n)for(let i of new Set(n)){let n=this.#e.get(i);if(void 0===n)throw Error("Expecting model relation, none found");for(let r of n)r[e]===t&&this.#l(i,r);this.#e.delete(i)}}_buildNewInstance(t){return new e(t)}_cloneModel(e){return e}_cloneRelation(e){return e}#i(){let e=new Map;for(let t of this.#e.keys()){let n=this._cloneModel(t);e.set(t,n)}return e}#s(){let e=new Map;for(let t of this.#e.values())for(let n of t){let t=this._cloneRelation(n);e.set(n,t)}return e}#r(e){let t=this.#e.get(e);return void 0===t&&(t=[],this.#e.set(e,t)),t}#o(e,t){let n=this.#t[e].get(t);return void 0===n&&(n=[],this.#t[e].set(t,n)),n}#d(e,t){let n=t.get(e);if(void 0===n)throw Error("Expecting model to be cloned, none found");return n}#u(e,t){let n=t.get(e);if(void 0===n)throw Error("Expecting relation to be cloned, none found");return n}#c(e,t,n){for(let[i,r]of e){let e=[];for(let t of r)e.push(this.#d(t,n));t.set(i,e)}}#a(e,t,n,i){for(let[r,o]of e){let e=[];for(let t of o)e.push(this.#u(t,i));t.set(this.#d(r,n),e)}}#l(e,t){for(let n of Reflect.ownKeys(t))this.#v(e,n,t[n])}#v(e,t,n){let i=this.#t[t].get(n);if(void 0!==i){let r=i.indexOf(e);-1!==r&&i.splice(r,1),0===i.length&&this.#t[t].delete(n)}}};(e7=e3||={}).moduleId="moduleId",e7.serviceId="serviceId";var e5=class e{#e;#t;constructor(e,t){this.#e=t??new e4({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(t){return new e(t)}add(e,t){this.#e.add(e,t)}clone(){return new e(this.#t,this.#e.clone())}get(e){let t=this.#e.get(e3.serviceId,e),n=this.#t()?.get(e);return void 0===t?n:void 0===n?t:e_(t,n)}removeAllByModuleId(e){this.#e.removeByRelation(e3.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(e3.serviceId,e)}},e6="@inversifyjs/core/classMetadataReflectKey";function e8(){return{constructorArguments:[],lifecycle:{postConstructMethodNames:new Set,preDestroyMethodNames:new Set},properties:new Map,scope:void 0}}var e7,e9,te="@inversifyjs/core/pendingClassMetadataCountReflectKey",tt=Symbol.for("@inversifyjs/core/InversifyCoreError"),tn=class e extends Error{[tt];kind;constructor(e,t,n){super(t,n),this[tt]=!0,this.kind=e}static is(e){return"object"==typeof e&&!!e&&!0===e[tt]}static isErrorOfKind(t,n){return e.is(t)&&t.kind===n}};function ti(e){let t,n=ek(e,"@inversifyjs/core/classMetadataReflectKey")??e8();if(void 0===(t=ek(e,te))||0===t)return function(e,t){let n=[];if(t.length<e.length)throw new tn(e9.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}". "${e.name}" constructor requires at least ${e.length.toString()} arguments, found ${t.length.toString()} instead.
Are you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let e=0;e<t.length;++e)void 0===t[e]&&n.push(e);if(n.length>0)throw new tn(e9.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${n.join('", "')}".
Are you using @inject, @multiInject or @unmanaged decorators at those indexes?
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(e,n.constructorArguments),n;let i=[];for(let t=0;t<n.constructorArguments.length;++t){let r=n.constructorArguments[t];(void 0===r||r.kind===tl.unknown)&&i.push(` - Missing or incomplete metadata for type "${e.name}" at constructor argument with index ${t.toString()}.
Every constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(let[t,r]of n.properties)r.kind===tl.unknown&&i.push(` - Missing or incomplete metadata for type "${e.name}" at property "${t.toString()}".
This property must be decorated either with @inject or @multiInject decorator.`);throw 0===i.length?new tn(e9.unknown,`Unexpected class metadata for type "${e.name}" with uncompletion traces.
This might be caused by one of the following reasons:
1. A third party library is targeting inversify reflection metadata.
2. A bug is causing the issue. Consider submiting an issue to fix it.`):new tn(e9.missingInjectionDecorator,`Invalid class metadata at type ${e.name}:
${i.join("\n\n")}`)}function tr(e,t){let n=ti(t).scope??e.scope;return{cache:{isRight:!1,value:void 0},id:eV(),implementationType:t,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:n,serviceIdentifier:t,type:eD.Instance}}function to(e){return e.isRight?{isRight:!0,value:e.value}:e}(ts=e9||={})[ts.injectionDecoratorConflict=0]="injectionDecoratorConflict",ts[ts.missingInjectionDecorator=1]="missingInjectionDecorator",ts[ts.planning=2]="planning",ts[ts.planningMaxDepthExceeded=3]="planningMaxDepthExceeded",ts[ts.resolution=4]="resolution",ts[ts.unknown=5]="unknown",(ta=tl||={})[ta.unknown=32]="unknown",(tc=td||={}).id="id",tc.moduleId="moduleId",tc.serviceId="serviceId";var ts,ta,tc,tl,td,tu,tv=class e extends e4{_buildNewInstance(t){return new e(t)}_cloneModel(e){return function(e){switch(e.type){case eD.ConstantValue:case eD.DynamicValue:return{cache:to(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type,value:e.value};case eD.Factory:return{cache:to(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type};case eD.Instance:return{cache:to(e.cache),id:e.id,implementationType:e.implementationType,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type};case eD.ResolvedValue:return{cache:to(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,metadata:e.metadata,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type};case eD.ServiceRedirection:return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}}}(e)}},th=class e{#e;#t;#n;constructor(e,t,n){this.#t=n??new tv({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#n=e,this.#e=t}static build(t,n){return new e(t,n)}clone(){return new e(this.#n,this.#e,this.#t.clone())}get(e){let t=this.getNonParentBindings(e)??this.#n()?.get(e);if(void 0!==t)return t;let n=this.#i(e);return void 0===n?n:[n]}*getChained(e){let t=this.getNonParentBindings(e);void 0!==t&&(yield*t);let n=this.#n();if(void 0===n){if(void 0===t){let t=this.#i(e);void 0!==t&&(yield t)}}else yield*n.getChained(e)}getBoundServices(){let e=new Set(this.#t.getAllKeys(td.serviceId)),t=this.#n();if(void 0!==t)for(let n of t.getBoundServices())e.add(n);return e}getById(e){return this.#t.get(td.id,e)??this.#n()?.getById(e)}getByModuleId(e){return this.#t.get(td.moduleId,e)??this.#n()?.getByModuleId(e)}getNonParentBindings(e){return this.#t.get(td.serviceId,e)}getNonParentBoundServices(){return this.#t.getAllKeys(td.serviceId)}removeById(e){this.#t.removeByRelation(td.id,e)}removeAllByModuleId(e){this.#t.removeByRelation(td.moduleId,e)}removeAllByServiceId(e){this.#t.removeByRelation(td.serviceId,e)}set(e){let t={[td.id]:e.id,[td.serviceId]:e.serviceIdentifier};void 0!==e.moduleId&&(t[td.moduleId]=e.moduleId),this.#t.add(e,t)}#i(e){if(void 0===this.#e||"function"!=typeof e)return;let t=tr(this.#e,e);return this.set(t),t}};(n2=tu||={}).moduleId="moduleId",n2.serviceId="serviceId";var tf=class e{#e;#t;constructor(e,t){this.#e=t??new e4({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(t){return new e(t)}add(e,t){this.#e.add(e,t)}clone(){return new e(this.#t,this.#e.clone())}get(e){let t=[],n=this.#e.get(tu.serviceId,e);void 0!==n&&t.push(n);let i=this.#t()?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return e_(...t)}removeAllByModuleId(e){this.#e.removeByRelation(tu.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(tu.serviceId,e)}};function tp(e,t,n,i){let r=Array.isArray(e)?e:[e];if(void 0===n)return void Reflect.decorate(r,t);if("number"==typeof n){for(let e of r)e(t,void 0,n);return}if(void 0===i)return void Reflect.decorate(r,t.prototype,n);for(let e of r)e(t,n,i)}function tg(){return 0}function tm(e){return t=>{void 0!==t&&t.kind===tl.unknown&&eB(e,te,tg,e=>e-1)}}function t$(e,t){return(...n)=>i=>{if(void 0===i)return e(...n);if(i.kind===n7.unmanaged)throw new tn(e9.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(i,...n)}}function ty(e){if(e.kind!==tl.unknown&&!0!==e.isFromTypescriptParamType)throw new tn(e9.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}(n3=n7||={})[n3.multipleInjection=0]="multipleInjection",n3[n3.singleInjection=1]="singleInjection",n3[n3.unmanaged=2]="unmanaged";var tb=t$(function(e,t,n){return e===n7.multipleInjection?{chained:n?.chained??!1,kind:e,name:void 0,optional:!1,tags:new Map,value:t}:{kind:e,name:void 0,optional:!1,tags:new Map,value:t}},function(e,t,n,i){return ty(e),t===n7.multipleInjection?{...e,chained:i?.chained??!1,kind:t,value:n}:{...e,kind:t,value:n}});function tw(e,t){return n=>{let i=n.properties.get(t);return n.properties.set(t,e(i)),n}}function tS(e,t,n,i){if(tn.isErrorOfKind(i,e9.injectionDecoratorConflict)){let r=function(e,t,n){if(void 0===n){if(void 0===t)throw new tn(e9.unknown,"Unexpected undefined property and index values");return{kind:n9.property,property:t,targetClass:e.constructor}}return"number"==typeof n?{index:n,kind:n9.parameter,targetClass:e}:{kind:n9.method,method:t,targetClass:e}}(e,t,n);throw new tn(e9.injectionDecoratorConflict,`Unexpected injection error.
Cause:
${i.message}
Details
${function(e){switch(e.kind){case n9.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case n9.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case n9.property:return`[class: "${e.targetClass.name}", property: "${e.property.toString()}"]`}}(r)}`,{cause:i})}throw i}function tI(e,t){return(n,i,r)=>{try{var o,s,a,c,l,d;let u,v,h;void 0===r?(o=e,s=t,u=tP(o,s),(e,t)=>{eB(e.constructor,e6,e8,tw(u(e),t))})(n,i):"number"==typeof r?(a=e,c=t,v=tP(a,c),(e,t,n)=>{var i,r,o;if(i=e,r=t,"function"==typeof i&&void 0===r){eB(e,e6,e8,(o=v(e),e=>{let t=e.constructorArguments[n];return e.constructorArguments[n]=o(t),e}))}else throw new tn(e9.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.
Found @inject decorator at method "${t?.toString()??""}" at class "${e.constructor.name}"`)})(n,i,r):(l=e,d=t,h=tP(l,d),(e,t,n)=>{var i;if(i=n,void 0!==i.set)eB(e.constructor,e6,e8,tw(h(e),t));else throw new tn(e9.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.
Found @inject decorator at method "${t.toString()}" at class "${e.constructor.name}"`)})(n,i,r)}catch(e){tS(n,i,r,e)}}}function tP(e,t){return n=>{let i=t(n);return t=>(i(t),e(t))}}function tA(e){return tI(tb(n7.singleInjection,e),tm)}(n4=n9||={})[n4.method=0]="method",n4[n4.parameter=1]="parameter",n4[n4.property=2]="property";var tC=[Array,BigInt,Boolean,Function,Number,Object,String];function tM(e){return t=>{var n;let i;(function(e){if(void 0!==ek(e,"@inversifyjs/core/classIsInjectableFlagReflectKey"))throw new tn(e9.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${e.name}"`);eO(e,"@inversifyjs/core/classIsInjectableFlagReflectKey",!0)})(t),void 0!==(i=ek(t,"design:paramtypes"))&&eB(t,e6,e8,(n=i,e=>(n.forEach((t,n)=>{void 0!==e.constructorArguments[n]||tC.includes(t)||(e.constructorArguments[n]={isFromTypescriptParamType:!0,kind:n7.singleInjection,name:void 0,optional:!1,tags:new Map,value:t})}),e))),void 0!==e&&eB(t,e6,e8,t=>({...t,scope:e}))}}function tx(e){return Object.getPrototypeOf(e.prototype)?.constructor}function tj(e,t,n){return e?new Set([...t,...n]):n}function tN(e){return t=>{var n,i;eB(t,e6,e8,(n=e,i=ti(e.type),e=>{let t,r,o;return{constructorArguments:(n.extendConstructorArguments??!0?(t=[...i.constructorArguments],e.constructorArguments.map((e,n)=>{t[n]=e})):t=e.constructorArguments,t),lifecycle:(r=n.lifecycle?.extendPostConstructMethods??!0,o=tj(n.lifecycle?.extendPreDestroyMethods??!0,i.lifecycle.preDestroyMethodNames,e.lifecycle.preDestroyMethodNames),{postConstructMethodNames:tj(r,i.lifecycle.postConstructMethodNames,e.lifecycle.postConstructMethodNames),preDestroyMethodNames:o}),properties:n.extendProperties??!0?new Map(e_(i.properties,e.properties)):e.properties,scope:e.scope}}))}}function tk(e){return t=>{let n=tx(t);if(void 0===n)throw new tn(e9.injectionDecoratorConflict,`Expected base type for type "${t.name}", none found.`);tN({...e,type:n})(t)}}function tO(e){return t=>{let n=[],i=tx(t);for(;void 0!==i&&i!==Object;){let e=i;n.push(e),i=tx(e)}for(let i of(n.reverse(),n))tN({...e,type:i})(t)}}function tB(e,t){return tI(tb(n7.multipleInjection,e,t),tm)}function tR(e){return t=>{void 0===t&&eB(e,te,tg,e=>e+1)}}function tT(e){return t=>{let n=t??{kind:tl.unknown,name:void 0,optional:!1,tags:new Map};if(n.kind!==n7.unmanaged)return e(n);throw new tn(e9.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections")}}function tE(e){return tI(tT(t=>{if(void 0!==t.name)throw new tn(e9.injectionDecoratorConflict,"Unexpected duplicated named decorator");return t.name=e,t}),tR)}function tV(e){if(e.optional)throw new tn(e9.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return e.optional=!0,e}function tF(){return tI(tT(tV),tR)}function tD(){return(e,t,n)=>{try{eB(e.constructor,e6,e8,e=>{if(e.lifecycle.postConstructMethodNames.has(t))throw new tn(e9.injectionDecoratorConflict,`Unexpected duplicated postConstruct method ${t.toString()}`);return e.lifecycle.postConstructMethodNames.add(t),e})}catch(n){tS(e,t,void 0,n)}}}function t_(){return(e,t,n)=>{try{eB(e.constructor,e6,e8,e=>{if(e.lifecycle.preDestroyMethodNames.has(t))throw new tn(e9.injectionDecoratorConflict,`Unexpected duplicated preDestroy method ${t.toString()}`);return e.lifecycle.preDestroyMethodNames.add(t),e})}catch(n){tS(e,t,void 0,n)}}}function tz(e,t){return tI(tT(n=>{if(n.tags.has(e))throw new tn(e9.injectionDecoratorConflict,"Unexpected duplicated tag decorator with existing tag");return n.tags.set(e,t),n}),tR)}function tK(){return{kind:n7.unmanaged}}var tU=t$(tK,function(e){var t;if(ty(e),void 0!==(t=e).name||t.optional||t.tags.size>0)throw new tn(e9.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return tK()});function tq(){return tI(tU(),tm)}(n5=ie||={})[n5.multipleInjection=0]="multipleInjection",n5[n5.singleInjection=1]="singleInjection";var tL=class e{#e;constructor(e){this.#e=e}get name(){return this.#e.elem.name}get serviceIdentifier(){return this.#e.elem.serviceIdentifier}get tags(){return this.#e.elem.tags}getAncestor(){if(this.#e.elem.getAncestorsCalled=!0,void 0!==this.#e.previous)return new e(this.#e.previous)}};function tH(e){return"redirection"in e}function tW(e,t){return tH(t)?tG(e,t):[t.resolve(e)]}function tG(e,t){return void 0===t.redirection.bindings?[]:Array.isArray(t.redirection.bindings)?t.redirection.bindings.flatMap(t=>tW(e,t)):tW(e,t.redirection.bindings)}var tJ=class{bindings;serviceIdentifier;isContextFree;constructor(e,t){this.bindings=e,this.serviceIdentifier=t,this.isContextFree=!0}resolve(e){var t=this.bindings;let n=[];for(let i of t)tH(i)?n.push(...tG(e,i)):n.push(i.resolve(e));return n.some(eM)?Promise.all(n):n}},tY=()=>void 0,tQ=class{serviceIdentifier;isContextFree;resolve;#e;constructor(e){this.serviceIdentifier=e,this.isContextFree=!0,this.resolve=tY}get bindings(){return this.#e}set bindings(e){this.#e=e,void 0===e?this.resolve=tY:this.resolve=Object.hasOwn(e,"resolve")?e.resolve:e.resolve.bind(e)}};function tX(e,t,n){let i=n?.customServiceIdentifier??t.serviceIdentifier,r=(n?.chained===!0?[...e.operations.getBindingsChained(i)]:[...e.operations.getBindings(i)??[]]).filter(e=>e.isSatisfiedBy(t));if(0===r.length&&void 0!==e.autobindOptions&&"function"==typeof i){let n=tr(e.autobindOptions,i);e.operations.setBinding(n),n.isSatisfiedBy(t)&&r.push(n)}return r}function tZ(e,t,n){var i,r,o,s,a;let c=n.elem.serviceIdentifier,l=n.previous?.elem.serviceIdentifier;Array.isArray(e)?function(e,t,n,i,r){if(1!==e.length)if(0===e.length)t||t0(n,i,r);else{let t=`Ambiguous bindings found for service: "${ex(n)}".
Registered bindings:
${e.map(e=>(function(e){switch(e.type){case eD.Instance:return`[ type: "${e.type}", serviceIdentifier: "${ex(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case eD.ServiceRedirection:return`[ type: "${e.type}", serviceIdentifier: "${ex(e.serviceIdentifier)}", redirection: "${ex(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${ex(e.serviceIdentifier)}", scope: "${e.scope}" ]`}})(e.binding)).join("\n")}
Trying to resolve bindings for "${t1(n,i)}".${t2(r)}`;throw new tn(e9.planning,t)}}(e,t,c,l,n.elem):(i=e,r=t,o=c,s=l,a=n.elem,void 0!==i||r||t0(o,s,a))}function t0(e,t,n){let i=`No bindings found for service: "${ex(e)}".
Trying to resolve bindings for "${t1(e,t)}".${t2(n)}`;throw new tn(e9.planning,i)}function t1(e,t){return void 0===t?`${ex(e)} (Root service)`:ex(t)}function t2(e){let t=0===e.tags.size?"":`
- tags:
- ${[...e.tags.keys()].map(e=>e.toString()).join("\n - ")}`;return`
Binding constraints:
- service identifier: ${ex(e.serviceIdentifier)}
- name: ${e.name?.toString()??"-"}${t}`}function t3(e){return(t,n,i)=>{let r=i.serviceIdentifier,o=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),s=tX(t,new tL(o.last),{chained:i.isMultiple&&i.chained}),a=[];if(i.isMultiple){let n=new tJ(a,r);return a.push(...e(t,o,s,n,i)),n.isContextFree=!o.last.elem.getAncestorsCalled,n}let c=new tQ(r);a.push(...e(t,o,s,c,i)),c.isContextFree=!o.last.elem.getAncestorsCalled,tZ(a,i.optional,o.last);let[l]=a;return c.bindings=l,c}}var t4=/stack space|call stack|too much recursion/i,t5=/too much recursion/;function t6(e){try{return e instanceof Error&&(e instanceof RangeError&&t4.test(e.message)||"InternalError"===e.name&&t5.test(e.message))}catch(e){return e instanceof SyntaxError&&e.message.includes("Stack overflow")}}var t8=Symbol.for("@inversifyjs/core/LazyPlanServiceNode"),t7=class{[t8];_serviceIdentifier;_serviceNode;constructor(e,t){this[t8]=!0,this._serviceNode=e,this._serviceIdentifier=t}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return"object"==typeof e&&!!e&&!0===e[t8]}invalidate(){this._serviceNode=void 0}isExpanded(){return void 0!==this._serviceNode}resolve(e){return this._getNode().resolve(e)}_getNode(){return void 0===this._serviceNode&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}};function t9(e){let t=new Map;return void 0!==e.tag&&t.set(e.tag.key,e.tag.value),e.isMultiple?{chained:e.chained,isMultiple:e.isMultiple,name:e.name,optional:e.isOptional??!1,serviceIdentifier:e.serviceIdentifier,tags:t}:{isMultiple:e.isMultiple,name:e.name,optional:e.isOptional??!1,serviceIdentifier:e.serviceIdentifier,tags:t}}var ne=class e{last;length;constructor(e,t){this.last=e,this.length=t}concat(t){return new e({elem:t,previous:this.last},this.length+1)}[Symbol.iterator](){let e=this.last;return{next:()=>{if(void 0===e)return{done:!0,value:void 0};let t=e.elem;return e=e.previous,{done:!1,value:t}}}}};function nt(e){let t=new Map;return void 0!==e.rootConstraints.tag&&t.set(e.rootConstraints.tag.key,e.rootConstraints.tag.value),new ne({elem:{getAncestorsCalled:!1,name:e.rootConstraints.name,serviceIdentifier:e.rootConstraints.serviceIdentifier,tags:t},previous:void 0},1)}function nn(e,t){return eM(t)?(e.cache={isRight:!0,value:t},t.then(t=>ni(e,t))):ni(e,t)}function ni(e,t){return e.cache={isRight:!0,value:t},t}async function nr(e,t,n){let i=await t,r=n.next();for(;!0!==r.done;)i=await r.value(e.context,i),r=n.next();return i}function no(e,t,n){let i=t,r=n.next();for(;!0!==r.done;){let t=r.value(e.context,i);if(eM(t))return nr(e,t,n);i=t,r=n.next()}return i}function ns(e,t,n){var i,r;let o,s=n;if(void 0!==t.onActivation){let n=t.onActivation;s=eM(s)?s.then(t=>n(e.context,t)):n(e.context,s)}return i=t.serviceIdentifier,r=s,void 0===(o=e.context.getActivations(i))?r:eM(r)?nr(e,r,o[Symbol.iterator]()):no(e,r,o[Symbol.iterator]())}function na(e,t){let n=e.binding;switch(n.scope){case eF.Singleton:return i=>{if(n.cache.isRight)return n.cache.value;let r=ns(i,n,t(i,e));return nn(n,r)};case eF.Request:return i=>{if(i.requestScopeCache?.has(n.id)===!0)return i.requestScopeCache.get(n.id);let r=ns(i,n,t(i,e));return(i.requestScopeCache??=new Map).set(n.id,r),r};case eF.Transient:return i=>ns(i,n,t(i,e))}}var nc=class{binding;resolve;constructor(e){this.binding=e,this.resolve=na(this,(e,t)=>t.binding.value)}},nl=class{binding;resolve;constructor(e){this.binding=e,this.resolve=na(this,(e,t)=>t.binding.value(e.context))}},nd=class{binding;resolve;constructor(e){this.binding=e,this.resolve=na(this,(e,t)=>t.binding.factory(e.context))}};function nu(e,t,n){let i=function(e,t,n){if(n in e)if("function"==typeof e[n]){let i;try{i=e[n]()}catch(e){throw new tn(e9.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:e})}if(eM(i))return nv(t,n,i)}else throw new tn(e9.resolution,`Expecting a "${n.toString()}" method when resolving "${t.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);else throw new tn(e9.resolution,`Expecting a "${n.toString()}" property when resolving "${t.implementationType.name}" class @postConstruct decorated method, none found.`)}(e,t,n);return eM(i)?i.then(()=>e):e}async function nv(e,t,n){try{await n}catch(n){throw new tn(e9.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:n})}}function nh(e,t,n){let i=[];for(let[r,o]of n.propertyParams){let s=n.classMetadata.properties.get(r);if(void 0===s)throw new tn(e9.resolution,`Expecting metadata at property "${r.toString()}", none found`);s.kind!==n7.unmanaged&&void 0!==o.bindings&&(t[r]=o.resolve(e),eM(t[r])&&i.push((async()=>{t[r]=await t[r]})()))}if(i.length>0)return Promise.all(i).then(()=>void 0)}function nf(e,t,n){if(0===n.size)return e;let i=e;for(let e of n)i=eM(i)?i.then(n=>nu(n,t,e)):nu(i,t,e);return i}function np(e,t,n){let i=new n.binding.implementationType(...e),r=nh(t,i,n);return eM(r)?r.then(()=>nf(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)):nf(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)}async function ng(e,t,n){return np(await e,t,n)}function nm(e,t){switch(e.scope){case eF.Singleton:return n=>e.cache.isRight?e.cache.value:nn(e,t(n));case eF.Request:return n=>{if(n.requestScopeCache?.has(e.id)===!0)return n.requestScopeCache.get(e.id);let i=t(n);return(n.requestScopeCache??=new Map).set(e.id,i),i};case eF.Transient:return t}}function n$(e){return(t,n)=>{let i=t.context.getActivations(e);return void 0===i?n:eM(n)?nr(t,n,i[Symbol.iterator]()):no(t,n,i[Symbol.iterator]())}}var ny=0;function nb(e,t,n,i){let r=(ny++).toString(),o=Array.from({length:e.classMetadata.constructorArguments.length},(e,t)=>t),s=o.map(e=>`value$${e.toString()}`).join(", "),a="";for(let e of o)a+=`const value$${e.toString()} = node$${r}.constructorParams[${e.toString()}].resolve(params$${r});
`;let c=e.classMetadata.properties.size,l=Array.from({length:c},(e,t)=>t),d=l.map(e=>`property$${e.toString()}`).join(", "),u=`let propertyIterator = node$${r}.propertyParams.entries();
`;for(let e of l)u+=`const propertyNode$${e.toString()} = propertyIterator.next().value;
const propertyKey$${e.toString()} = propertyNode$${e.toString()}[0];
const propertyBound$${e.toString()} = propertyNode$${e.toString()}[1].bindings !== undefined;
const property$${e.toString()} = propertyBound$${e.toString()} ? propertyNode$${e.toString()}[1].resolve(params$${r}) : undefined;
`;let v=l.map(e=>`if (propertyBound$${e.toString()}) { instance[propertyKey$${e.toString()}] = property$${e.toString()}; }`).join(" \n"),h=[s,d].filter(e=>e.length>0).join(", ");if(void 0===i){let i=0===c?`return function resolveNode$${r}(params$${r}) {
${a}
return resolveAsyncValues$${r}(
${s},
function (${s}) {
return new ctor$${r}(${s});
},
);
}`:`return function resolveNode$${r}(params$${r}) {
${a}
${u}
return resolveAsyncValues$${r}(
${h},
function (${h}) {
const instance = new ctor$${r}(${s});
${v}
return instance;
},
);
}`;return Function(`node$${r}`,`ctor$${r}`,`resolveAsyncValues$${r}`,i)(e,t,n)}let f=0===c?`return function resolveNode$${r}(params$${r}) {
${a}
return resolveAsyncValues$${r}(
${s},
function (${s}) {
return activate$${r}(
params$${r},
new ctor$${r}(${s}),
);
},
);
}`:`return function resolveNode$${r}(params$${r}) {
${a}
${u}
return resolveAsyncValues$${r}(
${h},
function (${h}) {
const instance = new ctor$${r}(${s});
${v}
return activate$${r}(
params$${r},
instance,
);
},
);
}`;return Function(`node$${r}`,`ctor$${r}`,`activate$${r}`,`resolveAsyncValues$${r}`,f)(e,t,i,n)}function nw(e,t,n,i,r){return eM(e)?eM(t)?new Promise(eM(n)?eM(i)?(o,s)=>{let a=0,c,l,d,u;e.then(e=>{4==++a?o(r(e,l,d,u)):c=e}).catch(s),t.then(e=>{4==++a?o(r(c,e,d,u)):l=e}).catch(s),n.then(e=>{4==++a?o(r(c,l,e,u)):d=e}).catch(s),i.then(e=>{4==++a?o(r(c,l,d,e)):u=e}).catch(s)}:(o,s)=>{let a=0,c,l,d;e.then(e=>{3==++a?o(r(e,l,d,i)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,d,i)):l=e}).catch(s),n.then(e=>{3==++a?o(r(c,l,e,i)):d=e}).catch(s)}:eM(i)?(o,s)=>{let a=0,c,l,d;e.then(e=>{3==++a?o(r(e,l,n,d)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,n,d)):l=e}).catch(s),i.then(e=>{3==++a?o(r(c,l,n,e)):d=e}).catch(s)}:(o,s)=>{let a=0,c,l;e.then(e=>{2==++a?o(r(e,l,n,i)):c=e}).catch(s),t.then(e=>{2==++a?o(r(c,e,n,i)):l=e}).catch(s)}):eM(n)?new Promise(eM(i)?(o,s)=>{let a=0,c,l,d;e.then(e=>{3==++a?o(r(e,t,l,d)):c=e}).catch(s),n.then(e=>{3==++a?o(r(c,t,e,d)):l=e}).catch(s),i.then(e=>{3==++a?o(r(c,t,l,e)):d=e}).catch(s)}:(o,s)=>{let a=0,c,l;e.then(e=>{2==++a?o(r(e,t,l,i)):c=e}).catch(s),n.then(e=>{2==++a?o(r(c,t,e,i)):l=e}).catch(s)}):eM(i)?new Promise((o,s)=>{let a=0,c,l;e.then(e=>{2==++a?o(r(e,t,n,l)):c=e}).catch(s),i.then(e=>{2==++a?o(r(c,t,n,e)):l=e}).catch(s)}):e.then(async e=>r(e,t,n,i)):eM(t)?eM(n)?new Promise(eM(i)?(o,s)=>{let a=0,c,l,d;t.then(t=>{3==++a?o(r(e,t,l,d)):c=t}).catch(s),n.then(t=>{3==++a?o(r(e,c,t,d)):l=t}).catch(s),i.then(t=>{3==++a?o(r(e,c,l,t)):d=t}).catch(s)}:(o,s)=>{let a=0,c,l;t.then(t=>{2==++a?o(r(e,t,l,i)):c=t}).catch(s),n.then(t=>{2==++a?o(r(e,c,t,i)):l=t}).catch(s)}):eM(i)?new Promise((o,s)=>{let a=0,c,l;t.then(t=>{2==++a?o(r(e,t,n,l)):c=t}).catch(s),i.then(t=>{2==++a?o(r(e,c,n,t)):l=t}).catch(s)}):t.then(async t=>r(e,t,n,i)):eM(n)?eM(i)?new Promise((o,s)=>{let a=0,c,l;n.then(n=>{2==++a?o(r(e,t,n,l)):c=n}).catch(s),i.then(n=>{2==++a?o(r(e,t,c,n)):l=n}).catch(s)}):n.then(async n=>r(e,t,n,i)):eM(i)?i.then(async i=>r(e,t,n,i)):r(e,t,n,i)}function nS(e,t,n,i){return eM(e)?eM(t)?new Promise(eM(n)?(r,o)=>{let s=0,a,c,l;e.then(e=>{3==++s?r(i(e,c,l)):a=e}).catch(o),t.then(e=>{3==++s?r(i(a,e,l)):c=e}).catch(o),n.then(e=>{3==++s?r(i(a,c,e)):l=e}).catch(o)}:(r,o)=>{let s=0,a,c;e.then(e=>{2==++s?r(i(e,c,n)):a=e}).catch(o),t.then(e=>{2==++s?r(i(a,e,n)):c=e}).catch(o)}):eM(n)?new Promise((r,o)=>{let s=0,a,c;e.then(e=>{2==++s?r(i(e,t,c)):a=e}).catch(o),n.then(e=>{2==++s?r(i(a,t,e)):c=e}).catch(o)}):e.then(async e=>i(e,t,n)):eM(t)?eM(n)?new Promise((r,o)=>{let s=0,a,c;t.then(t=>{2==++s?r(i(e,t,c)):a=t}).catch(o),n.then(t=>{2==++s?r(i(e,a,t)):c=t}).catch(o)}):t.then(async t=>i(e,t,n)):eM(n)?n.then(async n=>i(e,t,n)):i(e,t,n)}function nI(e,t,n){return eM(e)?eM(t)?new Promise((i,r)=>{let o=0,s,a;e.then(e=>{2==++o?i(n(e,a)):s=e}).catch(r),t.then(e=>{2==++o?i(n(s,e)):a=e}).catch(r)}):e.then(async e=>n(e,t)):eM(t)?t.then(async t=>n(e,t)):n(e,t)}function nP(...e){let t=e[e.length-1],n=e.slice(0,-1);for(let e of n)if(eM(e))return Promise.all(n).then(e=>t(...e));return t(...n)}var nA=(n6=function(e,t){let n=[],i=!1;for(let r of t.constructorParams){let t=r.resolve(e);!i&&eM(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n},(e,t)=>{let n=n6(e,t);return eM(n)?ng(n,e,t):np(n,e,t)}),nC=class{binding;classMetadata;constructorParams;propertyParams;resolve;constructor(e,t,n){var i,r;this.binding=e,this.classMetadata=t,this.constructorParams=[],this.propertyParams=new Map,this.resolve=(i=this,r=n,0===i.classMetadata.lifecycle.postConstructMethodNames.size&&void 0===i.binding.onActivation?r?function(e){let t=e.binding.implementationType,n=n$(e.binding.serviceIdentifier),i;switch(e.classMetadata.constructorArguments.length+e.classMetadata.properties.size){case 0:let r;r=(ny++).toString(),i=void 0===n?Function(`ctor$${r}`,`return function resolveNode$${r}(params$${r}) {
return new ctor$${r}();
};`)(t):Function(`ctor$${r}`,`activate$${r}`,`return function resolveNode$${r}(params$${r}) {
return activate$${r}(params$${r}, new ctor$${r}());
};`)(t,n);break;case 1:let o,s;i=0===e.classMetadata.properties.size?(o=(ny++).toString(),void 0===n?Function(`node$${o}`,`ctor$${o}`,`isPromise$${o}`,`return function resolveNode$${o}(params$${o}) {
const resolvedValue$${o} = node$${o}.constructorParams[0].resolve(params$${o});
if (isPromise$${o}(resolvedValue$${o})) {
return resolvedValue$${o}.then(function (resolvedValue$${o}) {
return new ctor$${o}(resolvedValue$${o});
});
}
return new ctor$${o}(resolvedValue$${o});
};`)(e,t,eM):Function(`node$${o}`,`ctor$${o}`,`activate$${o}`,`isPromise$${o}`,`return function resolveNode$${o}(params$${o}) {
const resolvedValue$${o} = node$${o}.constructorParams[0].resolve(params$${o});
if (isPromise$${o}(resolvedValue$${o})) {
return resolvedValue$${o}.then(function (resolvedValue$${o}) {
return activate$${o}(params$${o}, new ctor$${o}(resolvedValue$${o}));
});
}
return activate$${o}(params$${o}, new ctor$${o}(resolvedValue$${o}));
};`)(e,t,n,eM)):(s=(ny++).toString(),void 0===n?Function(`node$${s}`,`ctor$${s}`,`isPromise$${s}`,`return function resolveNode$${s}(params$${s}) {
const propertyEntry$${s} = node$${s}.propertyParams.entries().next().value;
const propertyKey$${s} = propertyEntry$${s}[0];
const instance$${s} = new ctor$${s}();
if (propertyEntry$${s}[1].bindings === undefined) {
return instance$${s};
}
const resolvedValue$${s} = propertyEntry$${s}[1].resolve(params$${s});
if (isPromise$${s}(resolvedValue$${s})) {
return resolvedValue$${s}.then(function (resolvedValue$${s}) {
instance$${s}[propertyKey$${s}] = resolvedValue$${s};
return instance$${s};
});
}
instance$${s}[propertyKey$${s}] = resolvedValue$${s};
return instance$${s};
};`)(e,t,eM):Function(`node$${s}`,`ctor$${s}`,`activate$${s}`,`isPromise$${s}`,`return function resolveNode$${s}(params$${s}) {
const propertyEntry$${s} = node$${s}.propertyParams.entries().next().value;
const propertyKey$${s} = propertyEntry$${s}[0];
const instance$${s} = new ctor$${s}();
if (propertyEntry$${s}[1].bindings === undefined) {
return activate$${s}(params$${s}, instance$${s});
}
const resolvedValue$${s} = propertyEntry$${s}[1].resolve(params$${s});
if (isPromise$${s}(resolvedValue$${s})) {
return resolvedValue$${s}.then(function (resolvedValue$${s}) {
instance$${s}[propertyKey$${s}] = resolvedValue$${s};
return activate$${s}(params$${s}, instance$${s});
});
}
instance$${s}[propertyKey$${s}] = resolvedValue$${s};
return activate$${s}(params$${s}, instance$${s});
};`)(e,t,n,eM));break;case 2:i=nb(e,t,nI,n);break;case 3:i=nb(e,t,nS,n);break;case 4:i=nb(e,t,nw,n);break;default:let a,c,l,d,u;i=nb(e,t,(a=(ny++).toString(),l=(c=Array.from({length:e.classMetadata.constructorArguments.length},(e,t)=>t)).map(e=>`value$${e.toString()}`).join(", "),d=c.map(e=>`resolvedValue$${e.toString()}`).join(", "),u=c.map(e=>`isPromise$${a}(value$${e.toString()})`).join(" || "),Function(`isPromise$${a}`,`return function resolveMany$${a}(${l}, build$${a}) {
if (${u}) {
return Promise.all([${l}]).then(
function ([${d}]) {
return build$${a}(${d});
},
);
}
return build$${a}(${l});
};`)(eM)),n)}return nm(e.binding,i)}(i):function(e){let t=n$(e.binding.serviceIdentifier),n;switch(e.classMetadata.constructorArguments.length){case 0:n=0===e.classMetadata.properties.size?void 0===t?function(t){return new e.binding.implementationType}:function(n){return t(n,new e.binding.implementationType)}:void 0===t?function(t){let n=new e.binding.implementationType,i=nh(t,n,e);return eM(i)?i.then(()=>n):n}:function(n){let i=new e.binding.implementationType,r=nh(n,i,e);return eM(r)?r.then(()=>t(n,i)):t(n,i)};break;case 1:n=function(e,t){if(0===e.classMetadata.properties.size)return void 0===t?function(t){let n=e.constructorParams[0].resolve(t);return eM(n)?n.then(t=>new e.binding.implementationType(t)):new e.binding.implementationType(n)}:function(n){let i=e.constructorParams[0].resolve(n);return eM(i)?i.then(i=>t(n,new e.binding.implementationType(i))):t(n,new e.binding.implementationType(i))};if(void 0===t){let t=(t,n)=>{let i=nh(t,n,e);return eM(i)?i.then(()=>n):n};return function(n){let i=e.constructorParams[0].resolve(n);return eM(i)?i.then(i=>t(n,new e.binding.implementationType(i))):t(n,new e.binding.implementationType(i))}}let n=(n,i)=>{let r=nh(n,i,e);return eM(r)?r.then(()=>t(n,i)):t(n,i)};return function(t){let i=e.constructorParams[0].resolve(t);return eM(i)?i.then(i=>n(t,new e.binding.implementationType(i))):n(t,new e.binding.implementationType(i))}}(e,t);break;case 2:n=0===e.classMetadata.properties.size?void 0===t?function(t){return nI(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(t,n)=>new e.binding.implementationType(t,n))}:function(n){return nI(e.constructorParams[0].resolve(n),e.constructorParams[1].resolve(n),(i,r)=>t(n,new e.binding.implementationType(i,r)))}:void 0===t?function(t){return nI(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,i)=>{var r;let o;return eM(o=nh(t,r=new e.binding.implementationType(n,i),e))?o.then(()=>r):r})}:function(n){return nI(e.constructorParams[0].resolve(n),e.constructorParams[1].resolve(n),(i,r)=>{var o;let s;return eM(s=nh(n,o=new e.binding.implementationType(i,r),e))?s.then(()=>t(n,o)):t(n,o)})};break;case 3:n=0===e.classMetadata.properties.size?void 0===t?function(t){return nS(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(t,n,i)=>new e.binding.implementationType(t,n,i))}:function(n){return nS(e.constructorParams[0].resolve(n),e.constructorParams[1].resolve(n),e.constructorParams[2].resolve(n),(i,r,o)=>t(n,new e.binding.implementationType(i,r,o)))}:void 0===t?function(t){return nS(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,i,r)=>{var o;let s;return eM(s=nh(t,o=new e.binding.implementationType(n,i,r),e))?s.then(()=>o):o})}:function(n){return nS(e.constructorParams[0].resolve(n),e.constructorParams[1].resolve(n),e.constructorParams[2].resolve(n),(i,r,o)=>{var s;let a;return eM(a=nh(n,s=new e.binding.implementationType(i,r,o),e))?a.then(()=>t(n,s)):t(n,s)})};break;case 4:n=0===e.classMetadata.properties.size?void 0===t?function(t){return nw(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),e.constructorParams[3].resolve(t),(t,n,i,r)=>new e.binding.implementationType(t,n,i,r))}:function(n){return nw(e.constructorParams[0].resolve(n),e.constructorParams[1].resolve(n),e.constructorParams[2].resolve(n),e.constructorParams[3].resolve(n),(i,r,o,s)=>t(n,new e.binding.implementationType(i,r,o,s)))}:void 0===t?function(t){return nw(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),e.constructorParams[3].resolve(t),(n,i,r,o)=>{var s;let a;return eM(a=nh(t,s=new e.binding.implementationType(n,i,r,o),e))?a.then(()=>s):s})}:function(n){return nw(e.constructorParams[0].resolve(n),e.constructorParams[1].resolve(n),e.constructorParams[2].resolve(n),e.constructorParams[3].resolve(n),(i,r,o,s)=>{var a;let c;return eM(c=nh(n,a=new e.binding.implementationType(i,r,o,s),e))?c.then(()=>t(n,a)):t(n,a)})};break;default:n=function(e,t,n){let i=e.classMetadata.constructorArguments.length;function r(t){let n=Array(i);for(let r=0;r<i;r++)n[r]=e.constructorParams[r].resolve(t);return n}return 0===e.classMetadata.properties.size?void 0===n?function(n){return t(...r(n),function(...t){return new e.binding.implementationType(...t)})}:function(i){return t(...r(i),(...t)=>n(i,new e.binding.implementationType(...t)))}:void 0===n?function(n){return t(...r(n),function(...t){let i=new e.binding.implementationType(...t),r=nh(n,i,e);return eM(r)?r.then(()=>i):i})}:function(i){return t(...r(i),(...t)=>{let r=new e.binding.implementationType(...t),o=nh(i,r,e);return eM(o)?o.then(()=>n(i,r)):n(i,r)})}}(e,nP,t)}return nm(e.binding,n)}(i):na(i,nA))}},nM=class{binding;#e;#t;constructor(e){this.binding=e,this.#e=void 0,this.#t=void 0}get redirection(){return this.#e}set redirection(e){this.#e=e,void 0===e.bindings?this.#t=()=>void 0:Array.isArray(e.bindings)?this.#t=()=>{throw new tn(e9.planning,"Unexpected resolver call for multiple bindings redirection")}:this.#t=t=>e.bindings.resolve(t)}resolve(e){return this.#t(e)}};function nx(e,t){let n=function(e,t){let n=[],i=!1;for(let r of t.params){let t=r.resolve(e);!i&&eM(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n}(e,t);return eM(n)?n.then(e=>t.binding.factory(...e)):t.binding.factory(...n)}function nj(e,t,n){let i=(ny++).toString(),r=Array.from({length:e.binding.metadata.arguments.length},(e,t)=>t),o=r.map(e=>`value$${e.toString()}`).join(", "),s="";for(let e of r)s+=`const value$${e.toString()} = node$${i}.params[${e.toString()}].resolve(params$${i});
`;return Function(`node$${i}`,`activate$${i}`,`resolveAsyncValues$${i}`,`return function resolveNode$${i}(params$${i}) {
${s}
return resolveAsyncValues$${i}(
${o},
function (${o}) {
return activate$${i}(
params$${i},
node$${i}.binding.factory(${o}),
);
},
);
}`)(e,t,n)}var nN=class{binding;params;resolve;constructor(e,t){var n,i;this.binding=e,this.params=[],this.resolve=(n=this,i=t,void 0===n.binding.onActivation?i?function(e){let t=n$(e.binding.serviceIdentifier),n;switch(e.binding.metadata.arguments.length){case 0:let i;i=(ny++).toString(),n=Function(`node$${i}`,`activate$${i}`,`return function resolveNode$${i}(params$${i}) {
return activate$${i}(params$${i}, node$${i}.binding.factory());
};`)(e,t);break;case 1:let r;r=(ny++).toString(),n=Function(`node$${r}`,`activate$${r}`,`isPromise$${r}`,`return function resolveNode$${r}(params$${r}) {
const resolvedValue$${r} = node$${r}.params[0].resolve(params$${r});
if (isPromise$${r}(resolvedValue$${r})) {
return resolvedValue$${r}.then(function (resolvedValue$${r}) {
return activate$${r}(params$${r}, node$${r}.binding.factory(resolvedValue$${r}));
});
}
return activate$${r}(params$${r}, node$${r}.binding.factory(resolvedValue$${r}));
};`)(e,t,eM);break;case 2:n=nj(e,t,nI);break;case 3:n=nj(e,t,nS);break;case 4:n=nj(e,t,nw);break;default:n=n=>t(n,nx(n,e))}return nm(e.binding,n)}(n):function(e){let t=n$(e.binding.serviceIdentifier),n;switch(e.binding.metadata.arguments.length){case 0:n=function(n){return t(n,e.binding.factory())};break;case 1:n=function(n){let i=e.params[0].resolve(n);return eM(i)?i.then(i=>t(n,e.binding.factory(i))):t(n,e.binding.factory(i))};break;case 2:n=function(n){return nI(e.params[0].resolve(n),e.params[1].resolve(n),(i,r)=>t(n,e.binding.factory(i,r)))};break;case 3:n=function(n){return nS(e.params[0].resolve(n),e.params[1].resolve(n),e.params[2].resolve(n),(i,r,o)=>t(n,e.binding.factory(i,r,o)))};break;case 4:n=function(n){return nw(e.params[0].resolve(n),e.params[1].resolve(n),e.params[2].resolve(n),e.params[3].resolve(n),(i,r,o,s)=>t(n,e.binding.factory(i,r,o,s)))};break;default:n=n=>t(n,nx(n,e))}return nm(e.binding,n)}(n):na(n,nx))}};function nk(e){var t,n,i;let r=(t=e,(e,n,i)=>{let r=new nC(n,e.operations.getClassMetadata(n.implementationType),e.jitEnabled);return t({autobindOptions:e.autobindOptions,jitEnabled:e.jitEnabled,node:r,operations:e.operations,servicesBranch:e.servicesBranch},i)}),o=(n=e,(e,t,i)=>{let r=new nN(t,e.jitEnabled);return n({autobindOptions:e.autobindOptions,jitEnabled:e.jitEnabled,node:r,operations:e.operations,servicesBranch:e.servicesBranch},i)}),s=(i=e,(e,t,n,r)=>{let o=new nM(n);return i({autobindOptions:e.autobindOptions,buildServiceNodeOptions:{...r,serviceIdentifier:n.targetServiceIdentifier},jitEnabled:e.jitEnabled,node:o,operations:e.operations,servicesBranch:e.servicesBranch},t)});return(e,t,n,i,a)=>{let c=tH(i)?i.binding.targetServiceIdentifier:i.serviceIdentifier;e.servicesBranch.push(c);let l=[];for(let i of n){if(i.type===eD.Factory){l.push(new nd(i));continue}switch(i.type){case eD.ConstantValue:l.push(new nc(i));break;case eD.DynamicValue:l.push(new nl(i));break;case eD.Instance:l.push(r(e,i,t));break;case eD.ResolvedValue:l.push(o(e,i,t));break;case eD.ServiceRedirection:{let n=s(e,t,i,a);l.push(n)}}}return e.servicesBranch.pop(),l}}var nO={isNoParam:!0,resolve:()=>void 0};function nB(e,t,n,i){void 0!==e&&(t7.is(n)&&!n.isExpanded()||n.isContextFree)?t.setPlan(e,{tree:{root:n}}):t.setNonCachedServiceNode(n,i)}var nR=class extends t7{#e;#t;#n;#i;constructor(e,t,n,i,r){super(r,i.serviceIdentifier),this.#t=t,this.#e=e,this.#n=n,this.#i=i}_buildPlanServiceNode(){return this.#t(this.#e,this.#n,this.#i)}};function nT(e,t){var n,i,r,o,s,a,c,l,d,u,v,h;let f,p,g,m=(n=e,i=t,f=(r=n,o=i,(e,t,n)=>{let i;if(n.kind===n7.unmanaged)return;if(t.length>500)throw new tn(e9.planningMaxDepthExceeded,"Maximum plan depth exceeded. This is likely caused by a circular dependency.");let s=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;let[n,i]=e.tags.entries().next().value;t={key:n,value:i}}let n=eN.is(e.value)?e.value.unwrap():e.value;return e.kind===n7.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(n);if(void 0!==s){let t=e.operations.getPlan(s);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}let a=(i=eN.is(n.value)?n.value.unwrap():n.value,n.kind===n7.multipleInjection?{chained:n.chained,isMultiple:!0,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}:{isMultiple:!1,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}),c=new nR(e,r,t,a,o(e,t,a));return nB(s,e.operations,c,{bindingConstraintsList:t,buildServiceNodeOptions:a}),c}),(e,t,n)=>{let i=t.classMetadata;for(let[r,o]of i.constructorArguments.entries())t.constructorParams[r]=f(e,n,o)??nO;for(let[r,o]of i.properties){let i=f(e,n,o);void 0!==i&&t.propertyParams.set(r,i)}return e.node}),$=(s=e,a=t,p=(c=s,l=a,(e,t)=>{let n=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;let[n,i]=e.tags.entries().next().value;t={key:n,value:i}}let n=eN.is(e.serviceIdentifier)?e.serviceIdentifier.unwrap():e.serviceIdentifier;return e.isMultiple?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(e.buildServiceNodeOptions);if(void 0!==n){let t=e.operations.getPlan(n);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}let i=e.buildServiceNodeOptions,r=new nR(e,c,t,i,l(e,t,i));return nB(n,e.operations,r,{bindingConstraintsList:t,buildServiceNodeOptions:i}),r}),(e,t,n)=>{let i={autobindOptions:e.autobindOptions,buildServiceNodeOptions:e.buildServiceNodeOptions,jitEnabled:e.jitEnabled,node:t,operations:e.operations,servicesBranch:e.servicesBranch};return t.redirection=p(i,n),t}),y=(d=e,u=t,g=(v=d,h=u,(e,t,n)=>{let i;if(t.length>500)throw new tn(e9.planningMaxDepthExceeded,"Maximum plan depth exceeded. This is likely caused by a circular dependency.");let r=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;let[n,i]=e.tags.entries().next().value;t={key:n,value:i}}let n=eN.is(e.value)?e.value.unwrap():e.value;return e.kind===ie.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(n);if(void 0!==r){let t=e.operations.getPlan(r);if(void 0!==t&&t.tree.root.isContextFree)return t.tree.root}let o=(i=eN.is(n.value)?n.value.unwrap():n.value,n.kind===ie.multipleInjection?{chained:n.chained,isMultiple:!0,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}:{isMultiple:!1,name:n.name,optional:n.optional,serviceIdentifier:i,tags:n.tags}),s=new nR(e,v,t,o,h(e,t,o));return nB(r,e.operations,s,{bindingConstraintsList:t,buildServiceNodeOptions:o}),s}),(e,t,n)=>{for(let[i,r]of t.binding.metadata.arguments.entries())t.params[i]=g(e,n,r);return e.node});return(e,t)=>e.node.binding.type===eD.Instance?m(e,e.node,t):tH(e.node)?$(e,e.node,t):y(e,e.node,t)}var nE=class extends t7{#e;constructor(e,t){super(t,t.serviceIdentifier),this.#e=e}_buildPlanServiceNode(){return nD(this.#e)}},nV=t3(function(e,t,n,i,r){return nF(e,t,n,i,r)}),nF=nk(nT(nV,nV)),nD=e=>{let t=nt(e),n=tX(e,new tL(t.last),{chained:e.rootConstraints.isMultiple&&e.rootConstraints.chained}),i=[];if(e.rootConstraints.isMultiple){let r=new tJ(i,e.rootConstraints.serviceIdentifier);return i.push(...nF(e,t,n,r,t9(e.rootConstraints))),r.isContextFree=!t.last.elem.getAncestorsCalled,r}let r=new tQ(e.rootConstraints.serviceIdentifier);i.push(...nF(e,t,n,r,t9(e.rootConstraints))),r.isContextFree=!t.last.elem.getAncestorsCalled,tZ(i,e.rootConstraints.isOptional??!1,t.last);let[o]=i;return r.bindings=o,r};function n_(e){return!0===e.isNoParam}(n8=it||={}).bindingAdded="bindingAdded",n8.bindingRemoved="bindingRemoved";var nz=class{#e;#t;#n;constructor(){this.#e=[],this.#t=8,this.#n=1024}*[Symbol.iterator](){let e=0;for(let t of this.#e){let n=t.deref();void 0===n?++e:yield n}this.#e.length>=this.#t&&this.#s(e)&&this.#i(e)}push(e){let t=new WeakRef(e);if(this.#e.push(t),this.#e.length>=this.#t&&this.#e.length%this.#n==0){let e=0;for(let t of this.#e)void 0===t.deref()&&++e;this.#s(e)&&this.#i(e)}}#i(e){let t=Array(this.#e.length-e),n=0;for(let e of this.#e)e.deref()&&(t[n++]=e);this.#e=t}#s(e){return e>=.5*this.#e.length}},nK=nk(nT(nV,function(e,t,n){return nU(e,t,n)})),nU=(i=t3(nK),(e,t,n)=>{try{return i(e,t,n)}catch(e){if(tn.isErrorOfKind(e,e9.planning))return;throw e}});function nq(e,t,n,i,r){if(t7.is(t)&&!t.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};let o=new tL(i.last);return!n.isSatisfiedBy(o)||i.last.elem.getAncestorsCalled?{isContextFreeBinding:!i.last.elem.getAncestorsCalled,shouldInvalidateServiceNode:!1}:function(e,t,n,i,r){let o;try{[o]=nK(e,i,[n],t,r)}catch(e){if(t6(e)||tn.isErrorOfKind(e,e9.planningMaxDepthExceeded))return{isContextFreeBinding:!1,shouldInvalidateServiceNode:!0};throw e}var s=t,a=o;if(Array.isArray(s.bindings))s.bindings.push(a);else if(void 0===s.bindings)s.bindings=a;else{if(!t7.is(s))throw new tn(e9.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!0}}return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}}(e,t,n,i,r)}function nL(e,t,n,i){let r;if(t7.is(e)&&!e.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};let o=new tL(n.last);if(!t.isSatisfiedBy(o)||n.last.elem.getAncestorsCalled)return{bindingNodeRemoved:void 0,isContextFreeBinding:!n.last.elem.getAncestorsCalled};if(Array.isArray(e.bindings))e.bindings=e.bindings.filter(e=>e.binding!==t||(r=e,!1));else if(e.bindings?.binding===t)if(r=e.bindings,i)e.bindings=void 0;else{if(!t7.is(e))throw new tn(e9.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");e.invalidate()}return{bindingNodeRemoved:r,isContextFreeBinding:!0}}var nH=class{#e;#t;#n;#i;#s;#r;#o;constructor(e){this.#e=e,this.#t=new Map,this.#n=this.#d(),this.#i=this.#d(),this.#s=this.#d(),this.#r=this.#d(),this.#o=new nz}clearCache(){for(let e of this.#l())e.clear();for(let e of this.#o)e.clearCache()}getByServiceIdentifier(e){return this.#n[0].get(e)}get(e){return void 0===e.name?void 0===e.tag?this.#a(this.#n,e).get(e.serviceIdentifier):this.#a(this.#r,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):void 0===e.tag?this.#a(this.#i,e).get(e.serviceIdentifier)?.get(e.name):this.#a(this.#s,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateServiceBinding(e){for(let t of(this.#h(e),this.#f(e),this.#p(e),this.#g(e),this.#m(e),this.#o))t.invalidateServiceBinding(e)}set(e,t){void 0===e.name?void 0===e.tag?this.#a(this.#n,e).set(e.serviceIdentifier,t):this.#c(this.#c(this.#a(this.#r,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):void 0===e.tag?this.#c(this.#a(this.#i,e),e.serviceIdentifier).set(e.name,t):this.#c(this.#c(this.#c(this.#a(this.#s,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}setNonCachedServiceNode(e,t){let n=this.#t.get(e.serviceIdentifier);void 0===n&&(n=new Map,this.#t.set(e.serviceIdentifier,n)),n.set(e,t)}subscribe(e){this.#o.push(e)}#d(){let e=Array(8);for(let t=0;t<e.length;++t)e[t]=new Map;return e}#u(e,t,n,i){let r=(2&t)!=0,o;return o=r?{chained:(0&t)!=0,isMultiple:r,serviceIdentifier:e.binding.serviceIdentifier}:{isMultiple:r,serviceIdentifier:e.binding.serviceIdentifier},(1&t)!=0&&(o.isOptional=!0),void 0!==n&&(o.name=n),void 0!==i&&(o.tag=i),{autobindOptions:void 0,jitEnabled:this.#e,operations:e.operations,rootConstraints:o,servicesBranch:[]}}#c(e,t){let n=e.get(t);return void 0===n&&(n=new Map,e.set(t,n)),n}#a(e,t){return e[this.#v(t)]}#l(){return[this.#t,...this.#n,...this.#i,...this.#s,...this.#r]}#v(e){return e.isMultiple?4*!!e.chained|!!e.optional|2:+!!e.optional}#f(e){for(let[t,n]of this.#i.entries()){let i=n.get(e.binding.serviceIdentifier);if(void 0!==i)for(let[n,r]of i.entries())this.#$(e,r,t,n,void 0)}}#p(e){for(let[t,n]of this.#s.entries()){let i=n.get(e.binding.serviceIdentifier);if(void 0!==i)for(let[n,r]of i.entries())for(let[i,o]of r.entries())for(let[r,s]of o.entries())this.#$(e,s,t,n,{key:i,value:r})}}#y(e){switch(e.binding.type){case eD.ServiceRedirection:this.#b(e.redirection);break;case eD.Instance:for(let t of e.constructorParams)n_(t)||this.#b(t);for(let t of e.propertyParams.values())this.#b(t);break;case eD.ResolvedValue:for(let t of e.params)this.#b(t)}}#b(e){let t=this.#t.get(e.serviceIdentifier);void 0!==t&&t.has(e)&&(t.delete(e),this.#w(e))}#w(e){if(!(t7.is(e)&&!e.isExpanded())&&void 0!==e.bindings)if(Array.isArray(e.bindings))for(let t of e.bindings)this.#y(t);else this.#y(e.bindings)}#m(e){let t=this.#t.get(e.binding.serviceIdentifier);if(void 0!==t)switch(e.kind){case it.bindingAdded:for(let[n,i]of t){let t=nq({autobindOptions:void 0,jitEnabled:this.#e,operations:e.operations,servicesBranch:[]},n,e.binding,i.bindingConstraintsList,i.buildServiceNodeOptions);t.isContextFreeBinding?t.shouldInvalidateServiceNode&&t7.is(n)&&(this.#w(n),n.invalidate()):this.clearCache()}break;case it.bindingRemoved:for(let[n,i]of t){let t=nL(n,e.binding,i.bindingConstraintsList,i.buildServiceNodeOptions.optional);t.isContextFreeBinding?void 0!==t.bindingNodeRemoved&&this.#y(t.bindingNodeRemoved):this.clearCache()}}}#h(e){for(let[t,n]of this.#n.entries()){let i=n.get(e.binding.serviceIdentifier);this.#$(e,i,t,void 0,void 0)}}#g(e){for(let[t,n]of this.#r.entries()){let i=n.get(e.binding.serviceIdentifier);if(void 0!==i)for(let[n,r]of i.entries())for(let[i,o]of r.entries())this.#$(e,o,t,void 0,{key:n,value:i})}}#$(e,t,n,i,r){if(void 0!==t&&t7.is(t.tree.root)){var o,s,a,c;let l=this.#u(e,n,i,r);switch(e.kind){case it.bindingAdded:{let n=(o=t.tree.root,s=e.binding,t7.is(o)&&!o.isExpanded()?{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}:nq(l,o,s,nt(l),t9(l.rootConstraints)));n.isContextFreeBinding?n.shouldInvalidateServiceNode&&(this.#w(t.tree.root),t.tree.root.invalidate()):this.clearCache()}break;case it.bindingRemoved:{let n=(a=t.tree.root,c=e.binding,t7.is(a)&&!a.isExpanded()?{bindingNodeRemoved:void 0,isContextFreeBinding:!0}:nL(a,c,nt(l),l.rootConstraints.isOptional??!1));n.isContextFreeBinding?void 0!==n.bindingNodeRemoved&&this.#y(n.bindingNodeRemoved):this.clearCache()}}}}};function nW(e,t){if("function"==typeof e[t])return e[t]()}function nG(e,t){let n,i=e.lifecycle.preDestroyMethodNames;if(0!==i.size){for(let e of i)n=void 0===n?nW(t,e):n.then(()=>nW(t,e));return n}}function nJ(e,t,n){let i=e.getDeactivations(t);if(void 0!==i)return eM(n)?nY(n,i[Symbol.iterator]()):function(e,t){let n=t.next();for(;!0!==n.done;){if(eM(n.value(e)))return nY(e,t);n=t.next()}}(n,i[Symbol.iterator]())}async function nY(e,t){let n=await e,i=t.next();for(;!0!==i.done;)await i.value(n),i=t.next()}function nQ(e,t){let n=t.cache;return eM(n.value)?n.value.then(n=>nX(e,t,n)):nX(e,t,n.value)}function nX(e,t,n){let i;return void 0!==t.onDeactivation&&(i=(0,t.onDeactivation)(n)),void 0===i?nJ(e,t.serviceIdentifier,n):i.then(()=>nJ(e,t.serviceIdentifier,n))}function nZ(e,t){if(void 0===t)return;let n=function(e){let t=[];for(let n of e)void 0!==n.scope&&n.scope===eF.Singleton&&n.cache.isRight&&t.push(n);return t}(t),i=[];for(let t of n){let n=function(e,t){let n=function(e,t){if(t.type===eD.Instance){let n=e.getClassMetadata(t.implementationType),i=t.cache.value;return eM(i)?i.then(e=>nG(n,e)):nG(n,i)}}(e,t);return void 0===n?nQ(e,t):n.then(()=>nQ(e,t))}(e,t);void 0!==n&&i.push(n)}if(i.length>0)return Promise.all(i).then(()=>void 0)}var n0=Symbol.for("@inversifyjs/container/bindingIdentifier");function n1(e){return"object"==typeof e&&!!e&&!0===e[n0]}var n2,n3,n4,n5,n6,n8,n7,n9,ie,it,ii,ir=class{static always=e=>!0},io=Symbol.for("@inversifyjs/container/InversifyContainerError"),is=class e extends Error{[io];kind;constructor(e,t,n){super(t,n),this[io]=!0,this.kind=e}static is(e){return"object"==typeof e&&!!e&&!0===e[io]}static isErrorOfKind(t,n){return e.is(t)&&t.kind===n}};function ia(e){return{[n0]:!0,id:e.id}}function ic(e){return t=>{for(let n=t.getAncestor();void 0!==n;n=n.getAncestor())if(e(n))return!0;return!1}}function il(e){return t=>t.name===e}function id(e){return t=>t.serviceIdentifier===e}function iu(e,t){return n=>n.tags.has(e)&&n.tags.get(e)===t}function iv(e){return void 0===e.name&&0===e.tags.size}function ih(e){let t=ic(e);return e=>!t(e)}function ip(e){return t=>{let n=t.getAncestor();return void 0===n||!e(n)}}function ig(e){return t=>{let n=t.getAncestor();return void 0!==n&&e(n)}}(l=ii||={})[l.invalidOperation=0]="invalidOperation";var im=class{#e;constructor(e){this.#e=e}getIdentifier(){return ia(this.#e)}inRequestScope(){return this.#e.scope=eF.Request,new iw(this.#e)}inSingletonScope(){return this.#e.scope=eF.Singleton,new iw(this.#e)}inTransientScope(){return this.#e.scope=eF.Transient,new iw(this.#e)}},i$=class{#e;#t;#n;#i;constructor(e,t,n,i){this.#e=e,this.#t=t,this.#n=n,this.#i=i}to(e){let t=ti(e),n={cache:{isRight:!1,value:void 0},id:eV(),implementationType:e,isSatisfiedBy:ir.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:t.scope??this.#n,serviceIdentifier:this.#i,type:eD.Instance};return this.#e(n),new iS(n)}toSelf(){if("function"!=typeof this.#i)throw Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(this.#i)}toConstantValue(e){let t={cache:{isRight:!1,value:void 0},id:eV(),isSatisfiedBy:ir.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:eF.Singleton,serviceIdentifier:this.#i,type:eD.ConstantValue,value:e};return this.#e(t),new iw(t)}toDynamicValue(e){let t={cache:{isRight:!1,value:void 0},id:eV(),isSatisfiedBy:ir.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#n,serviceIdentifier:this.#i,type:eD.DynamicValue,value:e};return this.#e(t),new iS(t)}toResolvedValue(e,t){let n={cache:{isRight:!1,value:void 0},factory:e,id:eV(),isSatisfiedBy:ir.always,metadata:this.#s(t),moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#n,serviceIdentifier:this.#i,type:eD.ResolvedValue};return this.#e(n),new iS(n)}toFactory(e){let t={cache:{isRight:!1,value:void 0},factory:e,id:eV(),isSatisfiedBy:ir.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:eF.Singleton,serviceIdentifier:this.#i,type:eD.Factory};return this.#e(t),new iw(t)}toService(e){let t={id:eV(),isSatisfiedBy:ir.always,moduleId:this.#t,serviceIdentifier:this.#i,targetServiceIdentifier:e,type:eD.ServiceRedirection};this.#e(t)}#s(e){return{arguments:(e??[]).map(e=>"object"!=typeof e||eN.is(e)?{kind:ie.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}:!0===e.isMultiple?{chained:e.chained??!1,kind:ie.multipleInjection,name:e.name,optional:e.optional??!1,tags:new Map((e.tags??[]).map(e=>[e.key,e.value])),value:e.serviceIdentifier}:{kind:ie.singleInjection,name:e.name,optional:e.optional??!1,tags:new Map((e.tags??[]).map(e=>[e.key,e.value])),value:e.serviceIdentifier})}}},iy=class{#e;constructor(e){this.#e=e}getIdentifier(){return ia(this.#e)}onActivation(e){return this.#e.onActivation=e,new ib(this.#e)}onDeactivation(e){if(this.#e.onDeactivation=e,this.#e.scope!==eF.Singleton)throw new is(ii.invalidOperation,`Binding for service "${ex(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);return new ib(this.#e)}},ib=class{#e;constructor(e){this.#e=e}getIdentifier(){return ia(this.#e)}when(e){return this.#e.isSatisfiedBy=e,new iy(this.#e)}whenAnyAncestor(e){return this.when(ic(e))}whenAnyAncestorIs(e){return this.when(ic(id(e)))}whenAnyAncestorNamed(e){return this.when(ic(il(e)))}whenAnyAncestorTagged(e,t){return this.when(ic(iu(e,t)))}whenDefault(){return this.when(iv)}whenNamed(e){return this.when(il(e))}whenNoParent(e){return this.when(ip(e))}whenNoParentIs(e){return this.when(ip(id(e)))}whenNoParentNamed(e){return this.when(ip(il(e)))}whenNoParentTagged(e,t){return this.when(ip(iu(e,t)))}whenParent(e){return this.when(ig(e))}whenParentIs(e){return this.when(ig(id(e)))}whenParentNamed(e){return this.when(ig(il(e)))}whenParentTagged(e,t){return this.when(ig(iu(e,t)))}whenTagged(e,t){return this.when(iu(e,t))}whenNoAncestor(e){return this.when(ih(e))}whenNoAncestorIs(e){return this.when(ih(id(e)))}whenNoAncestorNamed(e){return this.when(ih(il(e)))}whenNoAncestorTagged(e,t){return this.when(ih(iu(e,t)))}},iw=class extends ib{#e;constructor(e){super(e),this.#e=new iy(e)}onActivation(e){return this.#e.onActivation(e)}onDeactivation(e){return this.#e.onDeactivation(e)}},iS=class extends iw{#e;constructor(e){super(e),this.#e=new im(e)}inRequestScope(){return this.#e.inRequestScope()}inSingletonScope(){return this.#e.inSingletonScope()}inTransientScope(){return this.#e.inTransientScope()}},iI=class{#e;#t;#n;#i;constructor(e,t,n,i){this.#e=e,this.#t=t,this.#n=n,this.#i=i}bind(e){return new i$(e=>{this.#s(e)},void 0,this.#t,e)}isBound(e,t){let n=this.#i.bindingService.get(e);return this.#f(e,n,t)}isCurrentBound(e,t){let n=this.#i.bindingService.getNonParentBindings(e);return this.#f(e,n,t)}async rebindAsync(e){return await this.unbindAsync(e),this.bind(e)}rebind(e){return this.unbind(e),this.bind(e)}async unbindAsync(e){await this.#o(e)}async unbindAllAsync(){await this.#c()}unbindAll(){if(void 0!==this.#c())throw new is(ii.invalidOperation,"Unexpected asynchronous deactivation when unbinding all services. Consider using Container.unbindAllAsync() instead.")}unbind(e){void 0!==this.#o(e)&&this.#r(e)}#s(e){this.#i.bindingService.set(e),this.#n.invalidateService({binding:e,kind:it.bindingAdded})}#r(e){let t;if(n1(e)){let n=function(e){var t=e?.[Symbol.iterator]();if(void 0===t)return;let n=t.next();return!0!==n.done?n.value:void 0}(this.#i.bindingService.getById(e.id))?.serviceIdentifier;t=void 0===n?"Unexpected asynchronous deactivation when unbinding binding identifier. Consider using Container.unbindAsync() instead.":`Unexpected asynchronous deactivation when unbinding "${ex(n)}" binding. Consider using Container.unbindAsync() instead.`}else t=`Unexpected asynchronous deactivation when unbinding "${ex(e)}" service. Consider using Container.unbindAsync() instead.`;throw new is(ii.invalidOperation,t)}#o(e){return n1(e)?this.#d(e):this.#l(e)}#d(e){let t=this.#i.bindingService.getById(e.id),n=void 0===t?void 0:[...t],i=nZ(this.#e,t);if(void 0!==i)return i.then(()=>{this.#u(n,e)});this.#u(n,e)}#u(e,t){if(this.#i.bindingService.removeById(t.id),void 0!==e)for(let t of e)this.#n.invalidateService({binding:t,kind:it.bindingRemoved})}#c(){let e=[...this.#i.bindingService.getNonParentBoundServices()],t=e.map(e=>{var t;return t=this.#e,nZ(t,t.getBindings(e))});if(t.some(e=>eM(e)))return Promise.all(t).then(()=>{this.#a(e)});this.#a(e)}#a(e){for(let t of e)this.#i.activationService.removeAllByServiceId(t),this.#i.bindingService.removeAllByServiceId(t),this.#i.deactivationService.removeAllByServiceId(t);this.#i.planResultCacheService.clearCache()}#l(e){let t=this.#i.bindingService.get(e),n=void 0===t?void 0:[...t],i=nZ(this.#e,t);if(void 0!==i)return i.then(()=>{this.#v(e,n)});this.#v(e,n)}#v(e,t){if(this.#i.activationService.removeAllByServiceId(e),this.#i.bindingService.removeAllByServiceId(e),this.#i.deactivationService.removeAllByServiceId(e),void 0!==t)for(let e of t)this.#n.invalidateService({binding:e,kind:it.bindingRemoved})}#f(e,t,n){if(void 0===t)return!1;let i={getAncestor:()=>void 0,name:n?.name,serviceIdentifier:e,tags:new Map};for(let e of(n?.tag!==void 0&&i.tags.set(n.tag.key,n.tag.value),t))if(e.isSatisfiedBy(i))return!0;return!1}},iP=class{#e;#t;#n;#i;#s;constructor(e,t,n,i,r){this.#e=e,this.#t=t,this.#n=n,this.#i=i,this.#s=r}async loadAsync(...e){await Promise.all(this.#d(...e))}load(...e){for(let t of this.#d(...e))if(void 0!==t)throw new is(ii.invalidOperation,"Unexpected asynchronous module load. Consider using container.loadAsync() instead.")}async unloadAsync(...e){await Promise.all(this.#c(...e)),this.#o(e)}unload(...e){for(let t of this.#c(...e))if(void 0!==t)throw new is(ii.invalidOperation,"Unexpected asynchronous module unload. Consider using container.unloadAsync() instead.");this.#o(e)}#r(e){return{bind:t=>new i$(e=>{this.#u(e)},e,this.#n,t),isBound:this.#e.isBound.bind(this.#e),onActivation:(t,n)=>{this.#s.activationService.add(n,{moduleId:e,serviceId:t})},onDeactivation:(t,n)=>{this.#s.deactivationService.add(n,{moduleId:e,serviceId:t})},rebind:this.#e.rebind.bind(this.#e),rebindAsync:this.#e.rebindAsync.bind(this.#e),unbind:this.#e.unbind.bind(this.#e),unbindAsync:this.#e.unbindAsync.bind(this.#e)}}#o(e){for(let t of e)this.#s.activationService.removeAllByModuleId(t.id),this.#s.bindingService.removeAllByModuleId(t.id),this.#s.deactivationService.removeAllByModuleId(t.id);this.#s.planResultCacheService.clearCache()}#d(...e){return e.map(e=>e.load(this.#r(e.id)))}#u(e){this.#s.bindingService.set(e),this.#i.invalidateService({binding:e,kind:it.bindingAdded})}#c(...e){return e.map(e=>{var t,n;return t=this.#t,n=e.id,nZ(t,t.getBindingsFromModule(n))})}},iA=class{deactivationParams;constructor(e){this.deactivationParams={getBindings:e.bindingService.get.bind(e.bindingService),getBindingsFromModule:e.bindingService.getByModuleId.bind(e.bindingService),getClassMetadata:ti,getDeactivations:e.deactivationService.get.bind(e.deactivationService)},e.onReset(()=>{var t;(t=this.deactivationParams).getBindings=e.bindingService.get.bind(e.bindingService),t.getBindingsFromModule=e.bindingService.getByModuleId.bind(e.bindingService),t.getDeactivations=e.deactivationService.get.bind(e.deactivationService)})}},iC=class{planParamsOperations;#e;constructor(e){this.#e=e,this.planParamsOperations={getBindings:this.#e.bindingService.get.bind(this.#e.bindingService),getBindingsChained:this.#e.bindingService.getChained.bind(this.#e.bindingService),getClassMetadata:ti,getPlan:this.#e.planResultCacheService.get.bind(this.#e.planResultCacheService),setBinding:this.#n.bind(this),setNonCachedServiceNode:this.#e.planResultCacheService.setNonCachedServiceNode.bind(this.#e.planResultCacheService),setPlan:this.#e.planResultCacheService.set.bind(this.#e.planResultCacheService)},this.#e.onReset(()=>{this.#t()})}#t(){this.planParamsOperations.getBindings=this.#e.bindingService.get.bind(this.#e.bindingService),this.planParamsOperations.getBindingsChained=this.#e.bindingService.getChained.bind(this.#e.bindingService),this.planParamsOperations.setBinding=this.#n.bind(this)}#n(e){this.#e.bindingService.set(e),this.#e.planResultCacheService.invalidateServiceBinding({binding:e,kind:it.bindingAdded,operations:this.planParamsOperations})}},iM=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}invalidateService(e){this.#t.planResultCacheService.invalidateServiceBinding({...e,operations:this.#e.planParamsOperations})}},ix=class{#e;#t;#n;#i;constructor(e,t,n){this.#i=t,this.#n=n,this.#e=this.#r(e),this.#t=this.#o()}register(e,t){let n=new t(e,this.#t);this.#s(n),n.load(this.#e)}#s(e){if(!0!==e[eA])throw new is(ii.invalidOperation,"Invalid plugin. The plugin must extend the Plugin class")}#r(e){return{define:(t,n)=>{if(Object.prototype.hasOwnProperty.call(e,t))throw new is(ii.invalidOperation,`Container already has a method named "${String(t)}"`);e[t]=n},onPlan:this.#n.onPlan.bind(this.#n)}}#o(){let e=this.#i;return{get activationService(){return e.activationService},get bindingService(){return e.bindingService},get deactivationService(){return e.deactivationService},get planResultCacheService(){return e.planResultCacheService}}}},ij=class{activationService;bindingService;deactivationService;planResultCacheService;#e;constructor(e,t,n,i){this.activationService=e,this.bindingService=t,this.deactivationService=n,this.planResultCacheService=i,this.#e=[]}reset(e,t,n){for(let i of(this.activationService=e,this.bindingService=t,this.deactivationService=n,this.planResultCacheService.clearCache(),this.#e))i()}onReset(e){this.#e.push(e)}},iN=class{#e;#t;#n;#i;#s;#r;#o;#d;constructor(e,t,n,i,r){this.#o=e,this.#d=t,this.#n=e=>this.#d.activationService.get(e),this.#s=this.#f(),this.#e=n,this.#t=i,this.#i=r,this.#r=[],this.#d.onReset(()=>{this.#u()})}get(e,t){let n=this.#v(!1,e,t),i=this.#p(n);if(eM(i))throw new is(ii.invalidOperation,`Unexpected asynchronous service when resolving service "${ex(e)}"`);return i}getAll(e,t){let n=this.#v(!0,e,t),i=this.#p(n);if(eM(i))throw new is(ii.invalidOperation,`Unexpected asynchronous service when resolving service "${ex(e)}"`);return i}async getAllAsync(e,t){let n=this.#v(!0,e,t);return this.#p(n)}async getAsync(e,t){let n=this.#v(!1,e,t);return this.#p(n)}onPlan(e){this.#r.push(e)}#u(){this.#s=this.#f()}#c(e,t,n){let i=n?.name,r=n?.optional??!1,o=n?.tag;return e?{chained:n?.chained??!1,isMultiple:e,name:i,optional:r,serviceIdentifier:t,tag:o}:{isMultiple:e,name:i,optional:r,serviceIdentifier:t,tag:o}}#a(e,t,n){let i={autobindOptions:n?.autobind??this.#e?{scope:this.#t}:void 0,jitEnabled:this.#i,operations:this.#o.planParamsOperations,rootConstraints:this.#l(e,t,n),servicesBranch:[]};return this.#y(i,n),i}#l(e,t,n){return t?{chained:n?.chained??!1,isMultiple:t,serviceIdentifier:e}:{isMultiple:t,serviceIdentifier:e}}#v(e,t,n){if(!e&&void 0===n){let e=this.#d.planResultCacheService.getByServiceIdentifier(t);if(void 0!==e)return e}let i=this.#c(e,t,n),r=this.#d.planResultCacheService.get(i);if(void 0!==r)return r;let o=function(e){try{let t=e.rootConstraints.isMultiple?{chained:e.rootConstraints.chained,isMultiple:!0,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag}:{isMultiple:!1,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag},n=e.operations.getPlan(t);if(void 0!==n)return n;let i={tree:{root:new nE(e,nD(e))}};return e.operations.setPlan(t,i),i}catch(t){if(t6(t)||tn.isErrorOfKind(t,e9.planningMaxDepthExceeded)){let n,i=0===(n=[...function(e){let t=new Set;for(let n of e.servicesBranch){if(t.has(n))return[...t,n];t.add(n)}return[...t]}(e)]).length?"(No dependency trace)":n.map(ex).join(" -> ");throw new tn(e9.planning,`Circular dependency found: ${i}`,{cause:t})}throw t}}(this.#a(t,e,n));for(let e of this.#r)e(i,o);return o}#f(){return{get:this.get.bind(this),getActivations:this.#n,getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}}#p(e){return function(e){try{return e.planResult.tree.root.resolve(e)}catch(t){if(t6(t)||tn.isErrorOfKind(t,e9.planningMaxDepthExceeded)){let n,i,r,o=0===(r=[...(n=e.planResult.tree.root,i=[],function e(t){let n=i.indexOf(t);if(-1!==n)return[...i.slice(n),t].map(e=>e.serviceIdentifier);i.push(t);try{for(let n of function e(t){let n=[],i=t.bindings;if(void 0===i)return n;let r=t=>{if(tH(t))return void n.push(...e(t.redirection));switch(t.binding.type){case eD.Instance:for(let e of t.constructorParams)n_(e)||n.push(e);for(let e of t.propertyParams.values())n.push(e);break;case eD.ResolvedValue:for(let e of t.params)n.push(e)}};if(Array.isArray(i))for(let e of i)r(e);else r(i);return n}(t)){let t=e(n);if(void 0!==t)return t}}finally{i.pop()}}(n)??[])]).length?"(No dependency trace)":r.map(ex).join(" -> ");throw new tn(e9.planning,`Circular dependency found: ${o}`,{cause:t})}throw t}}({context:this.#s,planResult:e,requestScopeCache:void 0})}#y(e,t){void 0!==t&&(void 0!==t.name&&(e.rootConstraints.name=t.name),!0===t.optional&&(e.rootConstraints.isOptional=!0),void 0!==t.tag&&(e.rootConstraints.tag={key:t.tag.key,value:t.tag.value}),e.rootConstraints.isMultiple&&(e.rootConstraints.chained=t?.chained??!1))}},ik=class{#e;#t;constructor(e){this.#e=e,this.#t=[]}restore(){let e=this.#t.pop();if(void 0===e)throw new is(ii.invalidOperation,"No snapshot available to restore");this.#e.reset(e.activationService,e.bindingService,e.deactivationService)}snapshot(){this.#t.push({activationService:this.#e.activationService.clone(),bindingService:this.#e.bindingService.clone(),deactivationService:this.#e.deactivationService.clone()})}},iO=eF.Transient,iB=class{#e;#t;#n;#i;#s;#r;constructor(e){let t=e?.autobind??!1,n=e?.defaultScope??iO,i=e?.jitless??!0;this.#i=this.#d(e,t,n,i);let r=new iC(this.#i),o=new iM(r,this.#i),s=new iA(this.#i);this.#e=new iI(s.deactivationParams,n,o,this.#i),this.#t=new iP(this.#e,s.deactivationParams,n,o,this.#i),this.#s=new iN(r,this.#i,t,n,!i),this.#n=new ix(this,this.#i,this.#s),this.#r=new ik(this.#i)}bind(e){return this.#e.bind(e)}get(e,t){return this.#s.get(e,t)}getAll(e,t){return this.#s.getAll(e,t)}async getAllAsync(e,t){return this.#s.getAllAsync(e,t)}async getAsync(e,t){return this.#s.getAsync(e,t)}isBound(e,t){return this.#e.isBound(e,t)}isCurrentBound(e,t){return this.#e.isCurrentBound(e,t)}async loadAsync(...e){return this.#t.loadAsync(...e)}load(...e){this.#t.load(...e)}onActivation(e,t){this.#i.activationService.add(t,{serviceId:e})}onDeactivation(e,t){this.#i.deactivationService.add(t,{serviceId:e})}register(e){this.#n.register(this,e)}restore(){this.#r.restore()}async rebindAsync(e){return this.#e.rebindAsync(e)}rebind(e){return this.#e.rebind(e)}snapshot(){this.#r.snapshot()}async unbindAsync(e){await this.#e.unbindAsync(e)}async unbindAllAsync(){await this.#e.unbindAllAsync()}unbindAll(){this.#e.unbindAll()}unbind(e){this.#e.unbind(e)}async unloadAsync(...e){return this.#t.unloadAsync(...e)}unload(...e){this.#t.unload(...e)}#o(e,t){if(e)return{scope:t}}#d(e,t,n,i){let r=this.#o(t,n);if(e?.parent===void 0)return new ij(e5.build(()=>void 0),th.build(()=>void 0,r),tf.build(()=>void 0),new nH(!i));let o=new nH(!i),s=e.parent;return s.#i.planResultCacheService.subscribe(o),new ij(e5.build(()=>s.#i.activationService),th.build(()=>s.#i.bindingService,r),tf.build(()=>s.#i.deactivationService),o)}};var iR=(d=[[e=>D.is(e),(e,t)=>t({bindings:e.bindings,isContextFree:e.isContextFree,resolve:e.resolve,serviceIdentifier:e.serviceIdentifier})]],r=new WeakMap,c=o=function(e){for(let[t,n]of d)if(t(e))return n(e,o);if("function"==typeof e){var t;return{name:(t=e).name,stringifiedContent:t.toString()}}if("object"==typeof e&&e){let t=r.get(e);if(void 0!==t)return t;let n=s(e);return r.set(e,n),n}return e},s=e=>{if("function"==typeof e[Symbol.iterator])return[...e].map(e=>c(e));let t={};for(let n of Reflect.ownKeys(e))t[n]=c(e[n]);return t},o),iT=class extends eC{load(e){e.onPlan((e,t)=>{self.postMessage({kind:"plan",options:iR(e),result:iR(t)})})}},iE=class extends iB{constructor(){super(),this.register(iT)}};export{iE as Container,eT as ContainerModule,eN as LazyServiceIdentifier,eF as bindingScopeValues,eD as bindingTypeValues,tp as decorate,tA as inject,tk as injectFromBase,tO as injectFromHierarchy,tM as injectable,tB as multiInject,tE as named,tF as optional,tD as postConstruct,t_ as preDestroy,tz as tagged,tq as unmanaged};