-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinversify.js
More file actions
429 lines (347 loc) · 123 KB
/
Copy pathinversify.js
File metadata and controls
429 lines (347 loc) · 123 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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
let e,t,n,i,r,o,s;function a(e,t,n){return Reflect.getOwnMetadata(t,e,n)}var c,d,l,u,v="@inversifyjs/container/bindingId",h="Request",f="Singleton",p="Transient",g="Instance",$="ServiceRedirection";(m=u||={}).moduleId="moduleId",m.serviceId="serviceId";var m,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}};(eD=y||={})[eD.injectionDecoratorConflict=0]="injectionDecoratorConflict",eD[eD.missingInjectionDecorator=1]="missingInjectionDecorator",eD[eD.planning=2]="planning",eD[eD.planningMaxDepthExceeded=3]="planningMaxDepthExceeded",eD[eD.resolution=4]="resolution",eD[eD.unknown=5]="unknown",(e_=eG||={})[e_.unknown=32]="unknown",(ez=eJ||={}).id="id",ez.moduleId="moduleId",ez.serviceId="serviceId",(eK=eQ||={}).moduleId="moduleId",eK.serviceId="serviceId",(eU=eX||={})[eU.multipleInjection=0]="multipleInjection",eU[eU.singleInjection=1]="singleInjection",eU[eU.unmanaged=2]="unmanaged",(eq=eY||={})[eq.method=0]="method",eq[eq.parameter=1]="parameter",eq[eq.property=2]="property",(eH=eZ||={})[eH.multipleInjection=0]="multipleInjection",eH[eH.singleInjection=1]="singleInjection";var I=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 S(e){return("object"==typeof e&&!!e||"function"==typeof e)&&"function"==typeof e.then}function A(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 P=Symbol.for("@inversifyjs/common/islazyServiceIdentifier"),C=class{[P];#e;constructor(e){this.#e=e,this[P]=!0}static is(e){return"object"==typeof e&&!!e&&!0===e[P]}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 O=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(S)?Promise.all(n):n}},N=Symbol.for("@inversifyjs/core/DynamicallyResolvableBindingNode"),k=()=>void 0,B=class{serviceIdentifier;isContextFree;resolve;#e;constructor(e){this.serviceIdentifier=e,this.isContextFree=!0,this.resolve=k}get bindings(){return this.#e}set bindings(e){if(this.#e=e,void 0===e)this.resolve=k;else if(this.resolve=Object.hasOwn(e,"resolve")?e.resolve:e.resolve.bind(e),!0===e[N]){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: "${A(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?`${A(e)} (Root service)`:A(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: ${A(e.serviceIdentifier)}
- name: ${e.name?.toString()??"-"}${t}`}function V(e){return(t,n,i)=>{var r,o,s,c,d,l,u;let h,f,p=i.serviceIdentifier,m=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===eG.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===eG.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 I(m.last),{chained:i.isMultiple&&i.chained}),S=[];if(i.isMultiple){let n=new O(S,p);return S.push(...e(t,m,b,n,i)),n.isContextFree=!m.last.elem.getAncestorsCalled,n}let P=new B(p);S.push(...e(t,m,b,P,i)),P.isContextFree=!m.last.elem.getAncestorsCalled,r=i.optional,h=(o=m.last).elem.serviceIdentifier,f=o.previous?.elem.serviceIdentifier,Array.isArray(S)?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: "${A(n)}".
Registered bindings:
${e.map(e=>(function(e){switch(e.type){case g:return`[ type: "${e.type}", serviceIdentifier: "${A(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case $:return`[ type: "${e.type}", serviceIdentifier: "${A(e.serviceIdentifier)}", redirection: "${A(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${A(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)}}(S,r,h,f,o.elem):(s=S,c=r,d=h,l=f,u=o.elem,void 0!==s||c||R(d,l,u));let[C]=S;return P.bindings=C,P}}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 S(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(S(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=S(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:S(r)?K(e,r,o[Symbol.iterator]()):U(e,r,o[Symbol.iterator]())}function H(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 L=class{binding;resolve;constructor(e){this.binding=e,this.resolve=H(this,(e,t)=>t.binding.value)}};function W(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 G(e){return(t,n)=>{let i=t.context.getActivations(e);return void 0===i?n:S(n)?K(t,n,i[Symbol.iterator]()):U(t,n,i[Symbol.iterator]())}}var J=class{binding;[N];resolve;#e;constructor(e,t){this.binding=e,this[N]=!0;let n=void 0!==t.operations.getActivations(e.serviceIdentifier);this.#e=void 0,this.resolve=this.#t(n),!n&&this.#n()&&t.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=this.#t(!0),void 0!==this.#e)for(let e of this.#e)e(this.resolve)}addOnResolverChangedHandler(e){void 0===this.#e&&(this.#e=[]),this.#e.push(e)}#t(e){var t;let n,i,r;return this.#n()?(t=this,n=t.binding.serviceIdentifier,r=void 0===(i=e?G(n):void 0)?e=>t.binding.value(e.context):e=>i(e,t.binding.value(e.context)),W(t.binding,r)):H(this,(e,t)=>t.binding.value(e.context))}#n(){return void 0===this.binding.onActivation}},Q=class{binding;resolve;constructor(e){this.binding=e,this.resolve=H(this,(e,t)=>t.binding.factory(e.context))}};function X(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(S(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 S(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 Z(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!==eX.unmanaged&&void 0!==o.bindings&&(t[r]=o.resolve(e),S(t[r])&&i.push((async()=>{t[r]=await t[r]})()))}if(i.length>0)return Promise.all(i).then(()=>void 0)}function ee(e,t,n){if(0===n.size)return e;let i=e;for(let e of n)i=S(i)?i.then(n=>X(n,t,e)):X(i,t,e);return i}function et(e,t,n){let i=new n.binding.implementationType(...e),r=Z(t,i,n);return S(r)?r.then(()=>ee(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)):ee(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)}async function en(e,t,n){return et(await e,t,n)}function ei(e,t,n,i,r){return S(e)?S(t)?new Promise(S(n)?S(i)?(o,s)=>{let a=0,c,d,l,u;e.then(e=>{4==++a?o(r(e,d,l,u)):c=e}).catch(s),t.then(e=>{4==++a?o(r(c,e,l,u)):d=e}).catch(s),n.then(e=>{4==++a?o(r(c,d,e,u)):l=e}).catch(s),i.then(e=>{4==++a?o(r(c,d,l,e)):u=e}).catch(s)}:(o,s)=>{let a=0,c,d,l;e.then(e=>{3==++a?o(r(e,d,l,i)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,l,i)):d=e}).catch(s),n.then(e=>{3==++a?o(r(c,d,e,i)):l=e}).catch(s)}:S(i)?(o,s)=>{let a=0,c,d,l;e.then(e=>{3==++a?o(r(e,d,n,l)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,n,l)):d=e}).catch(s),i.then(e=>{3==++a?o(r(c,d,n,e)):l=e}).catch(s)}:(o,s)=>{let a=0,c,d;e.then(e=>{2==++a?o(r(e,d,n,i)):c=e}).catch(s),t.then(e=>{2==++a?o(r(c,e,n,i)):d=e}).catch(s)}):S(n)?new Promise(S(i)?(o,s)=>{let a=0,c,d,l;e.then(e=>{3==++a?o(r(e,t,d,l)):c=e}).catch(s),n.then(e=>{3==++a?o(r(c,t,e,l)):d=e}).catch(s),i.then(e=>{3==++a?o(r(c,t,d,e)):l=e}).catch(s)}:(o,s)=>{let a=0,c,d;e.then(e=>{2==++a?o(r(e,t,d,i)):c=e}).catch(s),n.then(e=>{2==++a?o(r(c,t,e,i)):d=e}).catch(s)}):S(i)?new Promise((o,s)=>{let a=0,c,d;e.then(e=>{2==++a?o(r(e,t,n,d)):c=e}).catch(s),i.then(e=>{2==++a?o(r(c,t,n,e)):d=e}).catch(s)}):e.then(async e=>r(e,t,n,i)):S(t)?S(n)?new Promise(S(i)?(o,s)=>{let a=0,c,d,l;t.then(t=>{3==++a?o(r(e,t,d,l)):c=t}).catch(s),n.then(t=>{3==++a?o(r(e,c,t,l)):d=t}).catch(s),i.then(t=>{3==++a?o(r(e,c,d,t)):l=t}).catch(s)}:(o,s)=>{let a=0,c,d;t.then(t=>{2==++a?o(r(e,t,d,i)):c=t}).catch(s),n.then(t=>{2==++a?o(r(e,c,t,i)):d=t}).catch(s)}):S(i)?new Promise((o,s)=>{let a=0,c,d;t.then(t=>{2==++a?o(r(e,t,n,d)):c=t}).catch(s),i.then(t=>{2==++a?o(r(e,c,n,t)):d=t}).catch(s)}):t.then(async t=>r(e,t,n,i)):S(n)?S(i)?new Promise((o,s)=>{let a=0,c,d;n.then(n=>{2==++a?o(r(e,t,n,d)):c=n}).catch(s),i.then(n=>{2==++a?o(r(e,t,c,n)):d=n}).catch(s)}):n.then(async n=>r(e,t,n,i)):S(i)?i.then(async i=>r(e,t,n,i)):r(e,t,n,i)}function er(e,t,n,i){return S(e)?S(t)?new Promise(S(n)?(r,o)=>{let s=0,a,c,d;e.then(e=>{3==++s?r(i(e,c,d)):a=e}).catch(o),t.then(e=>{3==++s?r(i(a,e,d)):c=e}).catch(o),n.then(e=>{3==++s?r(i(a,c,e)):d=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)}):S(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)):S(t)?S(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)):S(n)?n.then(async n=>i(e,t,n)):i(e,t,n)}function eo(e,t,n){return S(e)?S(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)):S(t)?t.then(async t=>n(e,t)):n(e,t)}function es(...e){let t=e[e.length-1],n=e.slice(0,-1);for(let e of n)if(S(e))return Promise.all(n).then(e=>t(...e));return t(...n)}var ea=0;function ec(e,t,n,i){let r=(ea++).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,d=Array.from({length:c},(e,t)=>t),l=d.map(e=>`property$${e.toString()}`).join(", "),u=`let propertyIterator = node$${r}.propertyParams.entries();
`;for(let e of d)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=d.map(e=>`if (propertyBound$${e.toString()}) { instance[propertyKey$${e.toString()}] = property$${e.toString()}; }`).join(" \n"),h=[s,l].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)}var ed=(eL=function(e,t){let n=[],i=!1;for(let r of t.constructorParams){let t=r.resolve(e);!i&&S(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n},(e,t)=>{let n=eL(e,t);return S(n)?en(n,e,t):et(n,e,t)}),el=class{binding;classMetadata;[N];constructorParams;propertyParams;resolve;#e;#t;constructor(e,t,n){this.binding=e,this.classMetadata=t,this[N]=!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=this.#n(i),!i&&this.#i()&&n.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=this.#n(!0),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)}#n(e){return this.#i()?this.#e&&this.binding.scope!==f?function(e,t){let n=e.binding.implementationType,i=e.binding.serviceIdentifier,r=t?G(i):void 0,o;switch(e.classMetadata.constructorArguments.length+e.classMetadata.properties.size){case 0:let s;s=(ea++).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=(ea++).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,S):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,S)):(c=(ea++).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,S):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,S));break;case 2:o=ec(e,n,eo,r);break;case 3:o=ec(e,n,er,r);break;case 4:o=ec(e,n,ei,r);break;default:let d,l,u,v,h,f;o=ec(e,n,(d=(ea++).toString(),u=(l=Array.from({length:e.classMetadata.constructorArguments.length+e.classMetadata.properties.size},(e,t)=>t)).map(e=>`value$${e.toString()}`).join(", "),v=l.map(e=>`resolvedValue$${e.toString()}`).join(", "),h=[u,`build$${d}`].filter(e=>e.length>0).join(", "),f=l.map(e=>`isPromise$${d}(value$${e.toString()})`).join(" || ")||"false",Function(`isPromise$${d}`,`return function resolveMany$${d}(${h}) {
if (${f}) {
return Promise.all([${u}]).then(
function ([${v}]) {
return build$${d}(${v});
},
);
}
return build$${d}(${u});
};`)(S)),r)}return W(e.binding,o)}(this,e):function(e,t){let n=e.binding.serviceIdentifier,i=t?G(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=Z(t,n,e);return S(i)?i.then(()=>n):n}:function(t){let n=new e.binding.implementationType,r=Z(t,n,e);return S(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 S(n)?n.then(t=>new e.binding.implementationType(t)):new e.binding.implementationType(n)}:function(n){let i=e.constructorParams[0].resolve(n);return S(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=Z(t,n,e);return S(i)?i.then(()=>n):n};return function(n){let i=e.constructorParams[0].resolve(n);return S(i)?i.then(i=>t(n,new e.binding.implementationType(i))):t(n,new e.binding.implementationType(i))}}let n=(n,i)=>{let r=Z(n,i,e);return S(r)?r.then(()=>t(n,i)):t(n,i)};return function(t){let i=e.constructorParams[0].resolve(t);return S(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 eo(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(t,n)=>new e.binding.implementationType(t,n))}:function(t){return eo(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 eo(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,i)=>{var r;let o;return S(o=Z(t,r=new e.binding.implementationType(n,i),e))?o.then(()=>r):r})}:function(t){return eo(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,r)=>{var o;let s;return S(s=Z(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 er(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 er(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 er(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,i,r)=>{var o;let s;return S(s=Z(t,o=new e.binding.implementationType(n,i,r),e))?s.then(()=>o):o})}:function(t){return er(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,r,o)=>{var s;let a;return S(a=Z(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 ei(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 ei(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 ei(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 S(a=Z(t,s=new e.binding.implementationType(n,i,r,o),e))?a.then(()=>s):s})}:function(t){return ei(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 S(c=Z(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=Z(n,i,e);return S(r)?r.then(()=>i):i})}:function(i){return t(...r(i),(...t)=>{let r=new e.binding.implementationType(...t),o=Z(i,r,e);return S(o)?o.then(()=>n(i,r)):n(i,r)})}}(e,es,i)}return W(e.binding,r)}(this,e):H(this,ed)}#i(){return 0===this.classMetadata.lifecycle.postConstructMethodNames.size&&void 0===this.binding.onActivation}},eu=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 ev(e,t){let n=function(e,t){let n=[],i=!1;for(let r of t.params){let t=r.resolve(e);!i&&S(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n}(e,t);return S(n)?n.then(e=>t.binding.factory(...e)):t.binding.factory(...n)}function eh(e,t,n){let i=(ea++).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)}var ef=class{binding;[N];params;resolve;#e;#t;constructor(e,t){this.binding=e,this[N]=!0,this.params=[],this.#e=t.jitEnabled;let n=void 0!==t.operations.getActivations(e.serviceIdentifier);this.#t=void 0,this.resolve=this.#n(n),!n&&this.#i()&&t.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=this.#n(!0),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)}#n(e){return this.#i()?this.#e&&this.binding.scope!==f?function(e,t){let n=e.binding.serviceIdentifier,i=t?G(n):void 0,r;switch(e.binding.metadata.arguments.length){case 0:let o;o=(ea++).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=(ea++).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,S):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,S);break;case 2:r=eh(e,eo,i);break;case 3:r=eh(e,er,i);break;case 4:r=eh(e,ei,i);break;default:r=eh(e,es,i)}return W(e.binding,r)}(this,e):function(e,t){let n=e.binding.serviceIdentifier,i=t?G(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 S(n)?n.then(t=>e.binding.factory(t)):e.binding.factory(n)}:function(t){let n=e.params[0].resolve(t);return S(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 eo(e.params[0].resolve(t),e.params[1].resolve(t),(t,n)=>e.binding.factory(t,n))}:function(t){return eo(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 er(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 er(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 ei(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 ei(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=>ev(t,e):t=>i(t,ev(t,e))}return W(e.binding,r)}(this,e):H(this,ev)}#i(){return void 0===this.binding.onActivation}};function ep(e){var t,n,i;let r=(t=e,(e,n,i)=>{let r=new el(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 ef(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 eu(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 d=[];for(let i of n){if("Factory"===i.type){d.push(new Q(i));continue}switch(i.type){case"ConstantValue":d.push(new L(i));break;case"DynamicValue":d.push(new J(i,e));break;case g:d.push(r(e,i,t));break;case"ResolvedValue":d.push(o(e,i,t));break;case $:{let n=s(e,t,i,a);d.push(n)}}}return e.servicesBranch.pop(),d}}var eg={isNoParam:!0,resolve:()=>void 0};function e$(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 em=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 ey(e,t){var n,i,r,o,s,a,c,d,l,u,v,h;let f,p,$,m=(n=e,i=t,f=(r=n,o=i,(e,t,n)=>{let i;if(n.kind===eX.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===eX.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===eX.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 em(e,r,t,a,o(e,t,a));return e$(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)??eg;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,d=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 em(e,c,t,i,d(e,t,i));return e$(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}),I=(l=e,u=t,$=(v=l,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===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!==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===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}),s=new em(e,v,t,o,h(e,t,o));return e$(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]=$(e,n,r);return e.node});return(e,t)=>e.node.binding.type===g?m(e,e.node,t):M(e.node)?b(e,e.node,t):I(e,e.node,t)}var eb=V(function(e,t,n,i,r){return ew(e,t,n,i,r)}),ew=ep(ey(eb,eb));(eW=e0||={}).bindingAdded="bindingAdded",eW.bindingRemoved="bindingRemoved";var eI=(e=V(ep(ey(eb,function(e,t,n){return eI(e,t,n)}))),(t,n,i)=>{try{return e(t,n,i)}catch(e){if(w.isErrorOfKind(e,y.planning))return;throw e}}),eS=Symbol.for("@inversifyjs/plugin/isPlugin"),eA=class{[eS]=!0;_container;_context;constructor(e,t){this._container=e,this._context=t}};function eP(e){return("object"==typeof e&&!!e||"function"==typeof e)&&"function"==typeof e.then}function eC(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 eM=Symbol.for("@inversifyjs/common/islazyServiceIdentifier"),ex=class{[eM];#e;constructor(e){this.#e=e,this[eM]=!0}static is(e){return"object"==typeof e&&!!e&&!0===e[eM]}unwrap(){return this.#e()}};function ej(e,t,n){return Reflect.getOwnMetadata(t,e,n)}function eO(e,t,n,i){Reflect.defineMetadata(t,n,e,i)}function eN(e,t,n,i,r){let o=i(ej(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:O("Symbol.toPrimitive not found."),o=i&&void 0!==Symbol.iterator?Symbol.iterator:O("Symbol.iterator not found."),s=Object.getPrototypeOf(Function),a="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:O("A valid Map constructor could not be found."),c="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:O("A valid Set constructor could not be found."),d="function"==typeof WeakMap?WeakMap:O("A valid WeakMap constructor could not be found."),l=i?Symbol.for("@reflect-metadata:registry"):void 0,u=(!m(l)&&b(t.Reflect)&&Object.isExtensible(t.Reflect)&&(n=t.Reflect[l]),m(n)&&(n=function(){m(l)||void 0===t.Reflect||l 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 d,v={isProviderFor:function(e,t){var n=u.get(e);return!!(!m(n)&&n.has(t))||!!o(e,t).length&&(m(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 d,$={registerProvider:function(e){if(!Object.isExtensible($))throw Error("Cannot add provider to a frozen registry.");switch(!0){case v===e:break;case m(h):h=e;break;case h===e:break;case m(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(m(e))throw TypeError();return h===e||f===e||!m(p)&&p.has(e)}(n))throw Error("Metadata provider not registered.");var i=y(e,t);if(i!==n){if(!m(i))return!1;var r=g.get(e);m(r)&&(r=new a,g.set(e,r)),r.set(t,n)}return!0}};return $;function y(e,t){var n,i=g.get(e);return m(i)||(n=i.get(t)),m(n)&&(n=function(e,t){if(!m(h)){if(h.isProviderFor(e,t))return h;if(!m(f)){if(f.isProviderFor(e,t))return h;if(!m(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(!m(v)&&v.isProviderFor(e,t))return v}(e,t),m(n)||(m(i)&&(i=new a,g.set(e,i)),i.set(t,n))),n}}()),!m(l)&&b(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,l,{enumerable:!1,configurable:!1,writable:!1,value:n}),n),v=function(e){var t=new d,n={isProviderFor:function(e,n){var i=t.get(e);return!m(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!m(r)&&!!r.has(e)},OrdinaryGetOwnMetadata:function(e,t,n){var r=i(t,n,!1);if(!m(r))return r.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var n=[],r=i(e,t,!1);if(m(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(m(o)||!o.delete(e))return!1;if(0===o.size){var s=t.get(n);m(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(m(s)){if(!o)return;s=new a,t.set(i,s),c=!0}var d=s.get(r);if(m(d)){if(!o)return;if(d=new a,s.set(r,d),!e.setProvider(i,r,n))throw s.delete(r),c&&t.delete(i),Error("Wrong provider for target.")}return d}}(u);function h(e,t,n){var i=N(t,n,!1);return!m(i)&&!!i.OrdinaryHasOwnMetadata(e,t,n)}function f(e,t,n){var i=N(t,n,!1);if(!m(i))return i.OrdinaryGetOwnMetadata(e,t,n)}function p(e,t,n,i){N(n,i,!0).OrdinaryDefineOwnMetadata(e,t,n,i)}function g(e,t){var n=N(e,t,!1);return n?n.OrdinaryOwnMetadataKeys(e,t):[]}function $(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 m(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($(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var t="string",n=P(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(S(n)){var i=n.call(e);if(!b(i))return i}var r=e.valueOf;if(S(r)){var i=r.call(e);if(!b(i))return i}}else{var r=e.valueOf;if(S(r)){var i=r.call(e);if(!b(i))return i}var o=e.toString;if(S(o)){var i=o.call(e);if(!b(i))return i}}throw TypeError()}(e,t)}(e);return"symbol"==typeof t?t:""+t}function I(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function S(e){return"function"==typeof e}function A(e){return"function"==typeof e}function P(e,t){var n=e[t];if(null!=n){if(!S(n))throw TypeError();return n}}function C(e){var t=P(e,o);if(!S(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 O(e){throw e}function N(e,t,n){var i=u.getProvider(e,t);if(!m(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(m(n)){if(!I(e)||!A(t))throw TypeError();for(var r=t,o=e.length-1;o>=0;--o){var s=(0,e[o])(r);if(!m(s)&&!y(s)){if(!A(s))throw TypeError();r=s}}return r}if(!I(e)||!b(t)||!b(i)&&!m(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(!m(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)||!m(i)&&!function(e){switch($(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 m(i)||(i=w(i)),p(e,t,n,i)}),e("hasMetadata",function(e,t,n){if(!b(t))throw TypeError();return m(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 m(n)||(n=w(n)),h(e,t,n)}),e("getMetadata",function(e,t,n){if(!b(t))throw TypeError();return m(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 m(n)||(n=w(n)),f(e,t,n)}),e("getMetadataKeys",function(e,t){if(!b(e))throw TypeError();return m(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=[],d=0;d<i.length;d++){var l=i[d],u=s.has(l);u||(s.add(l),a.push(l))}for(var v=0;v<o.length;v++){var l=o[v],u=s.has(l);u||(s.add(l),a.push(l))}return a}(e,t)}),e("getOwnMetadataKeys",function(e,t){if(!b(e))throw TypeError();return m(t)||(t=w(t)),g(e,t)}),e("deleteMetadata",function(e,t,n){if(!b(t))throw TypeError();m(n)||(n=w(n));var i=N(t,n,!1);return!m(i)&&i.OrdinaryDeleteMetadata(e,t,n)})})},()=>(n||(t((n={exports:{}}).exports,n),t=null),n.exports))();var ek="@inversifyjs/container/bindingId",eB=class{#e;#t;constructor(e){let t;this.#e=((t=ej(Object,ek)??0)===0x20000000000000-1?eO(Object,ek,-(0x20000000000000-1)):eN(Object,ek,()=>t,e=>e+1),t),this.#t=e}get id(){return this.#e}load(e){return this.#t(e)}},eR="@inversifyjs/container/bindingId";function eT(){let e=ej(Object,eR)??0;return e===0x20000000000000-1?eO(Object,eR,-(0x20000000000000-1)):eN(Object,eR,()=>e,e=>e+1),e}var eE={Request:"Request",Singleton:"Singleton",Transient:"Transient"},eV={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*eF(...e){for(let t of e)yield*t}var eD,e_,ez,eK,eU,eq,eH,eL,eW,eG,eJ,eQ,eX,eY,eZ,e0,e1,e2=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.#d(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}#l(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.#l(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.#l(r,n),e)}}#d(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)}}},e3=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}};(e8=e1||={}).moduleId="moduleId",e8.serviceId="serviceId";var e4=class e{#e;#t;#n;constructor(e,t){this.#e=t??new e2({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e,this.#n=new Map}static build(t){return new e(t)}add(e,t){this.#e.add(e,t),this.#i(t[e1.serviceId],e)}subscribeOnce(e,t){let n=this.#n.get(e);void 0===n&&(n=new e3,this.#n.set(e,n)),n.push(t)}clone(){return new e(this.#t,this.#e.clone())}get(e){let t=this.#e.get(e1.serviceId,e),n=this.#t()?.get(e);return void 0===t?n:void 0===n?t:eF(t,n)}removeAllByModuleId(e){this.#e.removeByRelation(e1.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(e1.serviceId,e)}#i(e,t){let n=this.#n.get(e);if(void 0!==n){for(let i of n)i.onActivationAdded(e,t);this.#n.delete(e)}}},e5="@inversifyjs/core/classMetadataReflectKey";function e6(){return{constructorArguments:[],lifecycle:{postConstructMethodNames:new Set,preDestroyMethodNames:new Set},properties:new Map,scope:void 0}}var e8,e7,e9="@inversifyjs/core/pendingClassMetadataCountReflectKey",te=Symbol.for("@inversifyjs/core/InversifyCoreError"),tt=class e extends Error{[te];kind;constructor(e,t,n){super(t,n),this[te]=!0,this.kind=e}static is(e){return"object"==typeof e&&!!e&&!0===e[te]}static isErrorOfKind(t,n){return e.is(t)&&t.kind===n}};function tn(e){let t,n=ej(e,"@inversifyjs/core/classMetadataReflectKey")??e6();if(void 0===(t=ej(e,e9))||0===t)return function(e,t){let n=[];if(t.length<e.length)throw new tt(e7.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 tt(e7.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===tc.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===tc.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 tt(e7.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 tt(e7.missingInjectionDecorator,`Invalid class metadata at type ${e.name}:
${i.join("\n\n")}`)}function ti(e,t){let n=tn(t).scope??e.scope;return{cache:{isRight:!1,value:void 0},id:eT(),implementationType:t,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:n,serviceIdentifier:t,type:eV.Instance}}function tr(e){return e.isRight?{isRight:!0,value:e.value}:e}(to=e7||={})[to.injectionDecoratorConflict=0]="injectionDecoratorConflict",to[to.missingInjectionDecorator=1]="missingInjectionDecorator",to[to.planning=2]="planning",to[to.planningMaxDepthExceeded=3]="planningMaxDepthExceeded",to[to.resolution=4]="resolution",to[to.unknown=5]="unknown",(ts=tc||={})[ts.unknown=32]="unknown",(ta=td||={}).id="id",ta.moduleId="moduleId",ta.serviceId="serviceId";var to,ts,ta,tc,td,tl,tu=class e extends e2{_buildNewInstance(t){return new e(t)}_cloneModel(e){return function(e){switch(e.type){case eV.ConstantValue:case eV.DynamicValue:return{cache:tr(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 eV.Factory:return{cache:tr(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 eV.Instance:return{cache:tr(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 eV.ResolvedValue:return{cache:tr(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 eV.ServiceRedirection:return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}}}(e)}},tv=class e{#e;#t;#n;constructor(e,t,n){this.#t=n??new tu({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=ti(this.#e,e);return this.set(t),t}};(n1=tl||={}).moduleId="moduleId",n1.serviceId="serviceId";var th=class e{#e;#t;constructor(e,t){this.#e=t??new e2({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(tl.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 eF(...t)}removeAllByModuleId(e){this.#e.removeByRelation(tl.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(tl.serviceId,e)}};function tf(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 tp(){return 0}function tg(e){return t=>{void 0!==t&&t.kind===tc.unknown&&eN(e,e9,tp,e=>e-1)}}function t$(e,t){return(...n)=>i=>{if(void 0===i)return e(...n);if(i.kind===n8.unmanaged)throw new tt(e7.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(i,...n)}}function tm(e){if(e.kind!==tc.unknown&&!0!==e.isFromTypescriptParamType)throw new tt(e7.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}(n2=n8||={})[n2.multipleInjection=0]="multipleInjection",n2[n2.singleInjection=1]="singleInjection",n2[n2.unmanaged=2]="unmanaged";var ty=t$(function(e,t,n){return e===n8.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 tm(e),t===n8.multipleInjection?{...e,chained:i?.chained??!1,kind:t,value:n}:{...e,kind:t,value:n}});function tb(e,t){return n=>{let i=n.properties.get(t);return n.properties.set(t,e(i)),n}}function tw(e,t,n,i){if(tt.isErrorOfKind(i,e7.injectionDecoratorConflict)){let r=function(e,t,n){if(void 0===n){if(void 0===t)throw new tt(e7.unknown,"Unexpected undefined property and index values");return{kind:n7.property,property:t,targetClass:e.constructor}}return"number"==typeof n?{index:n,kind:n7.parameter,targetClass:e}:{kind:n7.method,method:t,targetClass:e}}(e,t,n);throw new tt(e7.injectionDecoratorConflict,`Unexpected injection error.
Cause:
${i.message}
Details
${function(e){switch(e.kind){case n7.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case n7.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case n7.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,d,l;let u,v,h;void 0===r?(o=e,s=t,u=tS(o,s),(e,t)=>{eN(e.constructor,e5,e6,tb(u(e),t))})(n,i):"number"==typeof r?(a=e,c=t,v=tS(a,c),(e,t,n)=>{var i,r,o;if(i=e,r=t,"function"==typeof i&&void 0===r){eN(e,e5,e6,(o=v(e),e=>{let t=e.constructorArguments[n];return e.constructorArguments[n]=o(t),e}))}else throw new tt(e7.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):(d=e,l=t,h=tS(d,l),(e,t,n)=>{var i;if(i=n,void 0!==i.set)eN(e.constructor,e5,e6,tb(h(e),t));else throw new tt(e7.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){tw(n,i,r,e)}}}function tS(e,t){return n=>{let i=t(n);return t=>(i(t),e(t))}}function tA(e){return tI(ty(n8.singleInjection,e),tg)}(n3=n7||={})[n3.method=0]="method",n3[n3.parameter=1]="parameter",n3[n3.property=2]="property";var tP=[Array,BigInt,Boolean,Function,Number,Object,String];function tC(e){return t=>{var n;let i;(function(e){if(void 0!==ej(e,"@inversifyjs/core/classIsInjectableFlagReflectKey"))throw new tt(e7.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${e.name}"`);eO(e,"@inversifyjs/core/classIsInjectableFlagReflectKey",!0)})(t),void 0!==(i=ej(t,"design:paramtypes"))&&eN(t,e5,e6,(n=i,e=>(n.forEach((t,n)=>{void 0!==e.constructorArguments[n]||tP.includes(t)||(e.constructorArguments[n]={isFromTypescriptParamType:!0,kind:n8.singleInjection,name:void 0,optional:!1,tags:new Map,value:t})}),e))),void 0!==e&&eN(t,e5,e6,t=>({...t,scope:e}))}}function tM(e){return Object.getPrototypeOf(e.prototype)?.constructor}function tx(e,t,n){return e?new Set([...t,...n]):n}function tj(e){return t=>{var n,i;eN(t,e5,e6,(n=e,i=tn(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=tx(n.lifecycle?.extendPreDestroyMethods??!0,i.lifecycle.preDestroyMethodNames,e.lifecycle.preDestroyMethodNames),{postConstructMethodNames:tx(r,i.lifecycle.postConstructMethodNames,e.lifecycle.postConstructMethodNames),preDestroyMethodNames:o}),properties:n.extendProperties??!0?new Map(eF(i.properties,e.properties)):e.properties,scope:e.scope}}))}}function tO(e){return t=>{let n=tM(t);if(void 0===n)throw new tt(e7.injectionDecoratorConflict,`Expected base type for type "${t.name}", none found.`);tj({...e,type:n})(t)}}function tN(e){return t=>{let n=[],i=tM(t);for(;void 0!==i&&i!==Object;){let e=i;n.push(e),i=tM(e)}for(let i of(n.reverse(),n))tj({...e,type:i})(t)}}function tk(e,t){return tI(ty(n8.multipleInjection,e,t),tg)}function tB(e){return t=>{void 0===t&&eN(e,e9,tp,e=>e+1)}}function tR(e){return t=>{let n=t??{kind:tc.unknown,name:void 0,optional:!1,tags:new Map};if(n.kind!==n8.unmanaged)return e(n);throw new tt(e7.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections")}}function tT(e){return tI(tR(t=>{if(void 0!==t.name)throw new tt(e7.injectionDecoratorConflict,"Unexpected duplicated named decorator");return t.name=e,t}),tB)}function tE(e){if(e.optional)throw new tt(e7.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return e.optional=!0,e}function tV(){return tI(tR(tE),tB)}function tF(){return(e,t,n)=>{try{eN(e.constructor,e5,e6,e=>{if(e.lifecycle.postConstructMethodNames.has(t))throw new tt(e7.injectionDecoratorConflict,`Unexpected duplicated postConstruct method ${t.toString()}`);return e.lifecycle.postConstructMethodNames.add(t),e})}catch(n){tw(e,t,void 0,n)}}}function tD(){return(e,t,n)=>{try{eN(e.constructor,e5,e6,e=>{if(e.lifecycle.preDestroyMethodNames.has(t))throw new tt(e7.injectionDecoratorConflict,`Unexpected duplicated preDestroy method ${t.toString()}`);return e.lifecycle.preDestroyMethodNames.add(t),e})}catch(n){tw(e,t,void 0,n)}}}function t_(e,t){return tI(tR(n=>{if(n.tags.has(e))throw new tt(e7.injectionDecoratorConflict,"Unexpected duplicated tag decorator with existing tag");return n.tags.set(e,t),n}),tB)}function tz(){return{kind:n8.unmanaged}}var tK=t$(tz,function(e){var t;if(tm(e),void 0!==(t=e).name||t.optional||t.tags.size>0)throw new tt(e7.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return tz()});function tU(){return tI(tK(),tg)}(n4=n9||={})[n4.multipleInjection=0]="multipleInjection",n4[n4.singleInjection=1]="singleInjection";var tq=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 tL(e,t){return tH(t)?tW(e,t):[t.resolve(e)]}function tW(e,t){return void 0===t.redirection.bindings?[]:Array.isArray(t.redirection.bindings)?t.redirection.bindings.flatMap(t=>tL(e,t)):tL(e,t.redirection.bindings)}var tG=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(...tW(e,i)):n.push(i.resolve(e));return n.some(eP)?Promise.all(n):n}},tJ=Symbol.for("@inversifyjs/core/DynamicallyResolvableBindingNode"),tQ=()=>void 0,tX=class{serviceIdentifier;isContextFree;resolve;#e;constructor(e){this.serviceIdentifier=e,this.isContextFree=!0,this.resolve=tQ}get bindings(){return this.#e}set bindings(e){if(this.#e=e,void 0===e)this.resolve=tQ;else if(this.resolve=Object.hasOwn(e,"resolve")?e.resolve:e.resolve.bind(e),!0===e[tJ]){let t=new WeakRef(this);e.addOnResolverChangedHandler(e=>{let n=t.deref();void 0!==n&&(n.resolve=e)})}}};function tY(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=ti(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,d=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: "${eC(n)}".
Registered bindings:
${e.map(e=>(function(e){switch(e.type){case eV.Instance:return`[ type: "${e.type}", serviceIdentifier: "${eC(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case eV.ServiceRedirection:return`[ type: "${e.type}", serviceIdentifier: "${eC(e.serviceIdentifier)}", redirection: "${eC(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${eC(e.serviceIdentifier)}", scope: "${e.scope}" ]`}})(e.binding)).join("\n")}
Trying to resolve bindings for "${t1(n,i)}".${t2(r)}`;throw new tt(e7.planning,t)}}(e,t,c,d,n.elem):(i=e,r=t,o=c,s=d,a=n.elem,void 0!==i||r||t0(o,s,a))}function t0(e,t,n){let i=`No bindings found for service: "${eC(e)}".
Trying to resolve bindings for "${t1(e,t)}".${t2(n)}`;throw new tt(e7.planning,i)}function t1(e,t){return void 0===t?`${eC(e)} (Root service)`:eC(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: ${eC(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=tY(t,new tq(o.last),{chained:i.isMultiple&&i.chained}),a=[];if(i.isMultiple){let n=new tG(a,r);return a.push(...e(t,o,s,n,i)),n.isContextFree=!o.last.elem.getAncestorsCalled,n}let c=new tX(r);a.push(...e(t,o,s,c,i)),c.isContextFree=!o.last.elem.getAncestorsCalled,tZ(a,i.optional,o.last);let[d]=a;return c.bindings=d,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 eP(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(eP(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=eP(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:eP(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 eE.Singleton:return i=>{if(n.cache.isRight)return n.cache.value;let r=ns(i,n,t(i,e));return nn(n,r)};case eE.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 eE.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)}};function nd(e,t){switch(e.scope){case eE.Singleton:return n=>e.cache.isRight?e.cache.value:nn(e,t(n));case eE.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 eE.Transient:return t}}function nl(e){return(t,n)=>{let i=t.context.getActivations(e);return void 0===i?n:eP(n)?nr(t,n,i[Symbol.iterator]()):no(t,n,i[Symbol.iterator]())}}var nu=class{binding;[tJ];resolve;#e;constructor(e,t){this.binding=e,this[tJ]=!0;let n=void 0!==t.operations.getActivations(e.serviceIdentifier);this.#e=void 0,this.resolve=this.#t(n),!n&&this.#n()&&t.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=this.#t(!0),void 0!==this.#e)for(let e of this.#e)e(this.resolve)}addOnResolverChangedHandler(e){void 0===this.#e&&(this.#e=[]),this.#e.push(e)}#t(e){var t;let n,i,r;return this.#n()?(t=this,n=t.binding.serviceIdentifier,r=void 0===(i=e?nl(n):void 0)?e=>t.binding.value(e.context):e=>i(e,t.binding.value(e.context)),nd(t.binding,r)):na(this,(e,t)=>t.binding.value(e.context))}#n(){return void 0===this.binding.onActivation}},nv=class{binding;resolve;constructor(e){this.binding=e,this.resolve=na(this,(e,t)=>t.binding.factory(e.context))}};function nh(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 tt(e7.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:e})}if(eP(i))return nf(t,n,i)}else throw new tt(e7.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 tt(e7.resolution,`Expecting a "${n.toString()}" property when resolving "${t.implementationType.name}" class @postConstruct decorated method, none found.`)}(e,t,n);return eP(i)?i.then(()=>e):e}async function nf(e,t,n){try{await n}catch(n){throw new tt(e7.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:n})}}function np(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 tt(e7.resolution,`Expecting metadata at property "${r.toString()}", none found`);s.kind!==n8.unmanaged&&void 0!==o.bindings&&(t[r]=o.resolve(e),eP(t[r])&&i.push((async()=>{t[r]=await t[r]})()))}if(i.length>0)return Promise.all(i).then(()=>void 0)}function ng(e,t,n){if(0===n.size)return e;let i=e;for(let e of n)i=eP(i)?i.then(n=>nh(n,t,e)):nh(i,t,e);return i}function n$(e,t,n){let i=new n.binding.implementationType(...e),r=np(t,i,n);return eP(r)?r.then(()=>ng(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)):ng(i,n.binding,n.classMetadata.lifecycle.postConstructMethodNames)}async function nm(e,t,n){return n$(await e,t,n)}function ny(e,t,n,i,r){return eP(e)?eP(t)?new Promise(eP(n)?eP(i)?(o,s)=>{let a=0,c,d,l,u;e.then(e=>{4==++a?o(r(e,d,l,u)):c=e}).catch(s),t.then(e=>{4==++a?o(r(c,e,l,u)):d=e}).catch(s),n.then(e=>{4==++a?o(r(c,d,e,u)):l=e}).catch(s),i.then(e=>{4==++a?o(r(c,d,l,e)):u=e}).catch(s)}:(o,s)=>{let a=0,c,d,l;e.then(e=>{3==++a?o(r(e,d,l,i)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,l,i)):d=e}).catch(s),n.then(e=>{3==++a?o(r(c,d,e,i)):l=e}).catch(s)}:eP(i)?(o,s)=>{let a=0,c,d,l;e.then(e=>{3==++a?o(r(e,d,n,l)):c=e}).catch(s),t.then(e=>{3==++a?o(r(c,e,n,l)):d=e}).catch(s),i.then(e=>{3==++a?o(r(c,d,n,e)):l=e}).catch(s)}:(o,s)=>{let a=0,c,d;e.then(e=>{2==++a?o(r(e,d,n,i)):c=e}).catch(s),t.then(e=>{2==++a?o(r(c,e,n,i)):d=e}).catch(s)}):eP(n)?new Promise(eP(i)?(o,s)=>{let a=0,c,d,l;e.then(e=>{3==++a?o(r(e,t,d,l)):c=e}).catch(s),n.then(e=>{3==++a?o(r(c,t,e,l)):d=e}).catch(s),i.then(e=>{3==++a?o(r(c,t,d,e)):l=e}).catch(s)}:(o,s)=>{let a=0,c,d;e.then(e=>{2==++a?o(r(e,t,d,i)):c=e}).catch(s),n.then(e=>{2==++a?o(r(c,t,e,i)):d=e}).catch(s)}):eP(i)?new Promise((o,s)=>{let a=0,c,d;e.then(e=>{2==++a?o(r(e,t,n,d)):c=e}).catch(s),i.then(e=>{2==++a?o(r(c,t,n,e)):d=e}).catch(s)}):e.then(async e=>r(e,t,n,i)):eP(t)?eP(n)?new Promise(eP(i)?(o,s)=>{let a=0,c,d,l;t.then(t=>{3==++a?o(r(e,t,d,l)):c=t}).catch(s),n.then(t=>{3==++a?o(r(e,c,t,l)):d=t}).catch(s),i.then(t=>{3==++a?o(r(e,c,d,t)):l=t}).catch(s)}:(o,s)=>{let a=0,c,d;t.then(t=>{2==++a?o(r(e,t,d,i)):c=t}).catch(s),n.then(t=>{2==++a?o(r(e,c,t,i)):d=t}).catch(s)}):eP(i)?new Promise((o,s)=>{let a=0,c,d;t.then(t=>{2==++a?o(r(e,t,n,d)):c=t}).catch(s),i.then(t=>{2==++a?o(r(e,c,n,t)):d=t}).catch(s)}):t.then(async t=>r(e,t,n,i)):eP(n)?eP(i)?new Promise((o,s)=>{let a=0,c,d;n.then(n=>{2==++a?o(r(e,t,n,d)):c=n}).catch(s),i.then(n=>{2==++a?o(r(e,t,c,n)):d=n}).catch(s)}):n.then(async n=>r(e,t,n,i)):eP(i)?i.then(async i=>r(e,t,n,i)):r(e,t,n,i)}function nb(e,t,n,i){return eP(e)?eP(t)?new Promise(eP(n)?(r,o)=>{let s=0,a,c,d;e.then(e=>{3==++s?r(i(e,c,d)):a=e}).catch(o),t.then(e=>{3==++s?r(i(a,e,d)):c=e}).catch(o),n.then(e=>{3==++s?r(i(a,c,e)):d=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)}):eP(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)):eP(t)?eP(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)):eP(n)?n.then(async n=>i(e,t,n)):i(e,t,n)}function nw(e,t,n){return eP(e)?eP(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)):eP(t)?t.then(async t=>n(e,t)):n(e,t)}function nI(...e){let t=e[e.length-1],n=e.slice(0,-1);for(let e of n)if(eP(e))return Promise.all(n).then(e=>t(...e));return t(...n)}var nS=0;function nA(e,t,n,i){let r=(nS++).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,d=Array.from({length:c},(e,t)=>t),l=d.map(e=>`property$${e.toString()}`).join(", "),u=`let propertyIterator = node$${r}.propertyParams.entries();
`;for(let e of d)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=d.map(e=>`if (propertyBound$${e.toString()}) { instance[propertyKey$${e.toString()}] = property$${e.toString()}; }`).join(" \n"),h=[s,l].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)}var nP=(n5=function(e,t){let n=[],i=!1;for(let r of t.constructorParams){let t=r.resolve(e);!i&&eP(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n},(e,t)=>{let n=n5(e,t);return eP(n)?nm(n,e,t):n$(n,e,t)}),nC=class{binding;classMetadata;[tJ];constructorParams;propertyParams;resolve;#e;#t;constructor(e,t,n){this.binding=e,this.classMetadata=t,this[tJ]=!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=this.#n(i),!i&&this.#i()&&n.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=this.#n(!0),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)}#n(e){return this.#i()?this.#e&&this.binding.scope!==eE.Singleton?function(e,t){let n=e.binding.implementationType,i=e.binding.serviceIdentifier,r=t?nl(i):void 0,o;switch(e.classMetadata.constructorArguments.length+e.classMetadata.properties.size){case 0:let s;s=(nS++).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=(nS++).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,eP):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,eP)):(c=(nS++).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,eP):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,eP));break;case 2:o=nA(e,n,nw,r);break;case 3:o=nA(e,n,nb,r);break;case 4:o=nA(e,n,ny,r);break;default:let d,l,u,v,h,f;o=nA(e,n,(d=(nS++).toString(),u=(l=Array.from({length:e.classMetadata.constructorArguments.length+e.classMetadata.properties.size},(e,t)=>t)).map(e=>`value$${e.toString()}`).join(", "),v=l.map(e=>`resolvedValue$${e.toString()}`).join(", "),h=[u,`build$${d}`].filter(e=>e.length>0).join(", "),f=l.map(e=>`isPromise$${d}(value$${e.toString()})`).join(" || ")||"false",Function(`isPromise$${d}`,`return function resolveMany$${d}(${h}) {
if (${f}) {
return Promise.all([${u}]).then(
function ([${v}]) {
return build$${d}(${v});
},
);
}
return build$${d}(${u});
};`)(eP)),r)}return nd(e.binding,o)}(this,e):function(e,t){let n=e.binding.serviceIdentifier,i=t?nl(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=np(t,n,e);return eP(i)?i.then(()=>n):n}:function(t){let n=new e.binding.implementationType,r=np(t,n,e);return eP(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 eP(n)?n.then(t=>new e.binding.implementationType(t)):new e.binding.implementationType(n)}:function(n){let i=e.constructorParams[0].resolve(n);return eP(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=np(t,n,e);return eP(i)?i.then(()=>n):n};return function(n){let i=e.constructorParams[0].resolve(n);return eP(i)?i.then(i=>t(n,new e.binding.implementationType(i))):t(n,new e.binding.implementationType(i))}}let n=(n,i)=>{let r=np(n,i,e);return eP(r)?r.then(()=>t(n,i)):t(n,i)};return function(t){let i=e.constructorParams[0].resolve(t);return eP(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 nw(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(t,n)=>new e.binding.implementationType(t,n))}:function(t){return nw(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 nw(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,i)=>{var r;let o;return eP(o=np(t,r=new e.binding.implementationType(n,i),e))?o.then(()=>r):r})}:function(t){return nw(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),(n,r)=>{var o;let s;return eP(s=np(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 nb(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 nb(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 nb(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,i,r)=>{var o;let s;return eP(s=np(t,o=new e.binding.implementationType(n,i,r),e))?s.then(()=>o):o})}:function(t){return nb(e.constructorParams[0].resolve(t),e.constructorParams[1].resolve(t),e.constructorParams[2].resolve(t),(n,r,o)=>{var s;let a;return eP(a=np(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 ny(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 ny(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 ny(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 eP(a=np(t,s=new e.binding.implementationType(n,i,r,o),e))?a.then(()=>s):s})}:function(t){return ny(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 eP(c=np(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=np(n,i,e);return eP(r)?r.then(()=>i):i})}:function(i){return t(...r(i),(...t)=>{let r=new e.binding.implementationType(...t),o=np(i,r,e);return eP(o)?o.then(()=>n(i,r)):n(i,r)})}}(e,nI,i)}return nd(e.binding,r)}(this,e):na(this,nP)}#i(){return 0===this.classMetadata.lifecycle.postConstructMethodNames.size&&void 0===this.binding.onActivation}},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 tt(e7.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&&eP(t)&&(i=!0),n.push(t)}return i?Promise.all(n):n}(e,t);return eP(n)?n.then(e=>t.binding.factory(...e)):t.binding.factory(...n)}function nj(e,t,n){let i=(nS++).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)}var nO=class{binding;[tJ];params;resolve;#e;#t;constructor(e,t){this.binding=e,this[tJ]=!0,this.params=[],this.#e=t.jitEnabled;let n=void 0!==t.operations.getActivations(e.serviceIdentifier);this.#t=void 0,this.resolve=this.#n(n),!n&&this.#i()&&t.operations.subscribeActivationAddedOnce(e.serviceIdentifier,this)}onActivationAdded(){if(this.resolve=this.#n(!0),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)}#n(e){return this.#i()?this.#e&&this.binding.scope!==eE.Singleton?function(e,t){let n=e.binding.serviceIdentifier,i=t?nl(n):void 0,r;switch(e.binding.metadata.arguments.length){case 0:let o;o=(nS++).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=(nS++).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,eP):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,eP);break;case 2:r=nj(e,nw,i);break;case 3:r=nj(e,nb,i);break;case 4:r=nj(e,ny,i);break;default:r=nj(e,nI,i)}return nd(e.binding,r)}(this,e):function(e,t){let n=e.binding.serviceIdentifier,i=t?nl(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 eP(n)?n.then(t=>e.binding.factory(t)):e.binding.factory(n)}:function(t){let n=e.params[0].resolve(t);return eP(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 nw(e.params[0].resolve(t),e.params[1].resolve(t),(t,n)=>e.binding.factory(t,n))}:function(t){return nw(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 nb(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 nb(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 ny(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 ny(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=>nx(t,e):t=>i(t,nx(t,e))}return nd(e.binding,r)}(this,e):na(this,nx)}#i(){return void 0===this.binding.onActivation}};function nN(e){var t,n,i;let r=(t=e,(e,n,i)=>{let r=new nC(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 nO(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 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 d=[];for(let i of n){if(i.type===eV.Factory){d.push(new nv(i));continue}switch(i.type){case eV.ConstantValue:d.push(new nc(i));break;case eV.DynamicValue:d.push(new nu(i,e));break;case eV.Instance:d.push(r(e,i,t));break;case eV.ResolvedValue:d.push(o(e,i,t));break;case eV.ServiceRedirection:{let n=s(e,t,i,a);d.push(n)}}}return e.servicesBranch.pop(),d}}var nk={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,d,l,u,v,h;let f,p,g,$=(n=e,i=t,f=(r=n,o=i,(e,t,n)=>{let i;if(n.kind===n8.unmanaged)return;if(t.length>500)throw new tt(e7.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=ex.is(e.value)?e.value.unwrap():e.value;return e.kind===n8.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=ex.is(n.value)?n.value.unwrap():n.value,n.kind===n8.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)??nk;for(let[r,o]of i.properties){let i=f(e,n,o);void 0!==i&&t.propertyParams.set(r,i)}return e.node}),m=(s=e,a=t,p=(c=s,d=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=ex.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,d(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=(l=e,u=t,g=(v=l,h=u,(e,t,n)=>{let i;if(t.length>500)throw new tt(e7.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=ex.is(e.value)?e.value.unwrap():e.value;return e.kind===n9.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=ex.is(n.value)?n.value.unwrap():n.value,n.kind===n9.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===eV.Instance?$(e,e.node,t):tH(e.node)?m(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=nN(nT(nV,nV)),nD=e=>{let t=nt(e),n=tY(e,new tq(t.last),{chained:e.rootConstraints.isMultiple&&e.rootConstraints.chained}),i=[];if(e.rootConstraints.isMultiple){let r=new tG(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 tX(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}(n6=ie||={}).bindingAdded="bindingAdded",n6.bindingRemoved="bindingRemoved";var nz=nN(nT(nV,function(e,t,n){return nK(e,t,n)})),nK=(i=t3(nz),(e,t,n)=>{try{return i(e,t,n)}catch(e){if(tt.isErrorOfKind(e,e7.planning))return;throw e}});function nU(e,t,n,i,r){if(t7.is(t)&&!t.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};let o=new tq(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]=nz(e,i,[n],t,r)}catch(e){if(t6(e)||tt.isErrorOfKind(e,e7.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 tt(e7.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 nq(e,t,n,i){let r;if(t7.is(e)&&!e.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};let o=new tq(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 tt(e7.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.#l(),this.#i=this.#l(),this.#s=this.#l(),this.#r=this.#l(),this.#o=new e3}clearCache(){for(let e of this.#d())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.#$(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)}#l(){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)]}#d(){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.#m(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.#m(e,s,t,n,{key:i,value:r})}}#y(e){switch(e.binding.type){case eV.ServiceRedirection:this.#b(e.redirection);break;case eV.Instance:for(let t of e.constructorParams)n_(t)||this.#b(t);for(let t of e.propertyParams.values())this.#b(t);break;case eV.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)}#$(e){let t=this.#t.get(e.binding.serviceIdentifier);if(void 0!==t)switch(e.kind){case ie.bindingAdded:for(let[n,i]of t){let t=nU({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 ie.bindingRemoved:for(let[n,i]of t){let t=nq(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.#m(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.#m(e,o,t,void 0,{key:n,value:i})}}#m(e,t,n,i,r){if(void 0!==t&&t7.is(t.tree.root)){var o,s,a,c;let d=this.#u(e,n,i,r);switch(e.kind){case ie.bindingAdded:{let n=(o=t.tree.root,s=e.binding,t7.is(o)&&!o.isExpanded()?{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}:nU(d,o,s,nt(d),t9(d.rootConstraints)));n.isContextFreeBinding?n.shouldInvalidateServiceNode&&(this.#w(t.tree.root),t.tree.root.invalidate()):this.clearCache()}break;case ie.bindingRemoved:{let n=(a=t.tree.root,c=e.binding,t7.is(a)&&!a.isExpanded()?{bindingNodeRemoved:void 0,isContextFreeBinding:!0}:nq(a,c,nt(d),d.rootConstraints.isOptional??!1));n.isContextFreeBinding?void 0!==n.bindingNodeRemoved&&this.#y(n.bindingNodeRemoved):this.clearCache()}}}}};function nL(e,t){if("function"==typeof e[t])return e[t]()}function nW(e,t){let n,i=e.lifecycle.preDestroyMethodNames;if(0!==i.size){for(let e of i)n=void 0===n?nL(t,e):n.then(()=>nL(t,e));return n}}function nG(e,t,n){let i=e.getDeactivations(t);if(void 0!==i)return eP(n)?nJ(n,i[Symbol.iterator]()):function(e,t){let n=t.next();for(;!0!==n.done;){if(eP(n.value(e)))return nJ(e,t);n=t.next()}}(n,i[Symbol.iterator]())}async function nJ(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 eP(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?nG(e,t.serviceIdentifier,n):i.then(()=>nG(e,t.serviceIdentifier,n))}function nY(e,t){if(void 0===t)return;let n=function(e){let t=[];for(let n of e)void 0!==n.scope&&n.scope===eE.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===eV.Instance){let n=e.getClassMetadata(t.implementationType),i=t.cache.value;return eP(i)?i.then(e=>nW(n,e)):nW(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 nZ=Symbol.for("@inversifyjs/container/bindingIdentifier");function n0(e){return"object"==typeof e&&!!e&&!0===e[nZ]}var n1,n2,n3,n4,n5,n6,n8,n7,n9,ie,it,ii=class{static always=e=>!0},ir=Symbol.for("@inversifyjs/container/InversifyContainerError"),io=class e extends Error{[ir];kind;constructor(e,t,n){super(t,n),this[ir]=!0,this.kind=e}static is(e){return"object"==typeof e&&!!e&&!0===e[ir]}static isErrorOfKind(t,n){return e.is(t)&&t.kind===n}};function is(e){return{[nZ]:!0,id:e.id}}function ia(e){return t=>{for(let n=t.getAncestor();void 0!==n;n=n.getAncestor())if(e(n))return!0;return!1}}function ic(e){return t=>t.name===e}function id(e){return t=>t.serviceIdentifier===e}function il(e,t){return n=>n.tags.has(e)&&n.tags.get(e)===t}function iu(e){return void 0===e.name&&0===e.tags.size}function iv(e){let t=ia(e);return e=>!t(e)}function ih(e){return t=>{let n=t.getAncestor();return void 0===n||!e(n)}}function ip(e){return t=>{let n=t.getAncestor();return void 0!==n&&e(n)}}(d=it||={})[d.invalidOperation=0]="invalidOperation";var ig=class{#e;constructor(e){this.#e=e}getIdentifier(){return is(this.#e)}inRequestScope(){return this.#e.scope=eE.Request,new ib(this.#e)}inSingletonScope(){return this.#e.scope=eE.Singleton,new ib(this.#e)}inTransientScope(){return this.#e.scope=eE.Transient,new ib(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=tn(e),n={cache:{isRight:!1,value:void 0},id:eT(),implementationType:e,isSatisfiedBy:ii.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:t.scope??this.#n,serviceIdentifier:this.#i,type:eV.Instance};return this.#e(n),new iw(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:eT(),isSatisfiedBy:ii.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:eE.Singleton,serviceIdentifier:this.#i,type:eV.ConstantValue,value:e};return this.#e(t),new ib(t)}toDynamicValue(e){let t={cache:{isRight:!1,value:void 0},id:eT(),isSatisfiedBy:ii.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#n,serviceIdentifier:this.#i,type:eV.DynamicValue,value:e};return this.#e(t),new iw(t)}toResolvedValue(e,t){let n={cache:{isRight:!1,value:void 0},factory:e,id:eT(),isSatisfiedBy:ii.always,metadata:this.#s(t),moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#n,serviceIdentifier:this.#i,type:eV.ResolvedValue};return this.#e(n),new iw(n)}toFactory(e){let t={cache:{isRight:!1,value:void 0},factory:e,id:eT(),isSatisfiedBy:ii.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:eE.Singleton,serviceIdentifier:this.#i,type:eV.Factory};return this.#e(t),new ib(t)}toService(e){let t={id:eT(),isSatisfiedBy:ii.always,moduleId:this.#t,serviceIdentifier:this.#i,targetServiceIdentifier:e,type:eV.ServiceRedirection};this.#e(t)}#s(e){return{arguments:(e??[]).map(e=>"object"!=typeof e||ex.is(e)?{kind:n9.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}:!0===e.isMultiple?{chained:e.chained??!1,kind:n9.multipleInjection,name:e.name,optional:e.optional??!1,tags:new Map((e.tags??[]).map(e=>[e.key,e.value])),value:e.serviceIdentifier}:{kind:n9.singleInjection,name:e.name,optional:e.optional??!1,tags:new Map((e.tags??[]).map(e=>[e.key,e.value])),value:e.serviceIdentifier})}}},im=class{#e;constructor(e){this.#e=e}getIdentifier(){return is(this.#e)}onActivation(e){return this.#e.onActivation=e,new iy(this.#e)}onDeactivation(e){if(this.#e.onDeactivation=e,this.#e.scope!==eE.Singleton)throw new io(it.invalidOperation,`Binding for service "${eC(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);return new iy(this.#e)}},iy=class{#e;constructor(e){this.#e=e}getIdentifier(){return is(this.#e)}when(e){return this.#e.isSatisfiedBy=e,new im(this.#e)}whenAnyAncestor(e){return this.when(ia(e))}whenAnyAncestorIs(e){return this.when(ia(id(e)))}whenAnyAncestorNamed(e){return this.when(ia(ic(e)))}whenAnyAncestorTagged(e,t){return this.when(ia(il(e,t)))}whenDefault(){return this.when(iu)}whenNamed(e){return this.when(ic(e))}whenNoParent(e){return this.when(ih(e))}whenNoParentIs(e){return this.when(ih(id(e)))}whenNoParentNamed(e){return this.when(ih(ic(e)))}whenNoParentTagged(e,t){return this.when(ih(il(e,t)))}whenParent(e){return this.when(ip(e))}whenParentIs(e){return this.when(ip(id(e)))}whenParentNamed(e){return this.when(ip(ic(e)))}whenParentTagged(e,t){return this.when(ip(il(e,t)))}whenTagged(e,t){return this.when(il(e,t))}whenNoAncestor(e){return this.when(iv(e))}whenNoAncestorIs(e){return this.when(iv(id(e)))}whenNoAncestorNamed(e){return this.when(iv(ic(e)))}whenNoAncestorTagged(e,t){return this.when(iv(il(e,t)))}},ib=class extends iy{#e;constructor(e){super(e),this.#e=new im(e)}onActivation(e){return this.#e.onActivation(e)}onDeactivation(e){return this.#e.onDeactivation(e)}},iw=class extends ib{#e;constructor(e){super(e),this.#e=new ig(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 io(it.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:ie.bindingAdded})}#r(e){let t;if(n0(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 "${eC(n)}" binding. Consider using Container.unbindAsync() instead.`}else t=`Unexpected asynchronous deactivation when unbinding "${eC(e)}" service. Consider using Container.unbindAsync() instead.`;throw new io(it.invalidOperation,t)}#o(e){return n0(e)?this.#l(e):this.#d(e)}#l(e){let t=this.#i.bindingService.getById(e.id),n=void 0===t?void 0:[...t],i=nY(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:ie.bindingRemoved})}#c(){let e=[...this.#i.bindingService.getNonParentBoundServices()],t=e.map(e=>{var t;return t=this.#e,nY(t,t.getBindings(e))});if(t.some(e=>eP(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()}#d(e){let t=this.#i.bindingService.get(e),n=void 0===t?void 0:[...t],i=nY(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:ie.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}},iS=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.#l(...e))}load(...e){for(let t of this.#l(...e))if(void 0!==t)throw new io(it.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 io(it.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()}#l(...e){return e.map(e=>e.load(this.#r(e.id)))}#u(e){this.#s.bindingService.set(e),this.#i.invalidateService({binding:e,kind:ie.bindingAdded})}#c(...e){return e.map(e=>{var t,n;return t=this.#t,n=e.id,nY(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:tn,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)})}},iP=class{planParamsOperations;#e;constructor(e){this.#e=e,this.planParamsOperations={getActivations:this.#t.bind(this),getBindings:this.#e.bindingService.get.bind(this.#e.bindingService),getBindingsChained:this.#e.bindingService.getChained.bind(this.#e.bindingService),getClassMetadata:tn,getPlan:this.#e.planResultCacheService.get.bind(this.#e.planResultCacheService),setBinding:this.#s.bind(this),setNonCachedServiceNode:this.#e.planResultCacheService.setNonCachedServiceNode.bind(this.#e.planResultCacheService),setPlan:this.#e.planResultCacheService.set.bind(this.#e.planResultCacheService),subscribeActivationAddedOnce:this.#n.bind(this)},this.#e.onReset(()=>{this.#i()})}#t(e){return this.#e.activationService.get(e)}#n(e,t){this.#e.activationService.subscribeOnce(e,t)}#i(){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.#s.bind(this)}#s(e){this.#e.bindingService.set(e),this.#e.planResultCacheService.invalidateServiceBinding({binding:e,kind:ie.bindingAdded,operations:this.planParamsOperations})}},iC=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}invalidateService(e){this.#t.planResultCacheService.invalidateServiceBinding({...e,operations:this.#e.planParamsOperations})}},iM=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[eS])throw new io(it.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 io(it.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}}}},ix=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)}},ij=class{#e;#t;#n;#i;#s;#r;#o;#l;constructor(e,t,n,i,r){this.#o=e,this.#l=t,this.#n=e=>this.#l.activationService.get(e),this.#s=this.#f(),this.#e=n,this.#t=i,this.#i=r,this.#r=[],this.#l.onReset(()=>{this.#u()})}get(e,t){let n=this.#v(!1,e,t),i=this.#p(n);if(eP(i))throw new io(it.invalidOperation,`Unexpected asynchronous service when resolving service "${eC(e)}"`);return i}getAll(e,t){let n=this.#v(!0,e,t),i=this.#p(n);if(eP(i))throw new io(it.invalidOperation,`Unexpected asynchronous service when resolving service "${eC(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.#d(e,t,n),servicesBranch:[]};return this.#y(i,n),i}#d(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.#l.planResultCacheService.getByServiceIdentifier(t);if(void 0!==e)return e}let i=this.#c(e,t,n),r=this.#l.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)||tt.isErrorOfKind(t,e7.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(eC).join(" -> ");throw new tt(e7.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)||tt.isErrorOfKind(t,e7.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 eV.Instance:for(let e of t.constructorParams)n_(e)||n.push(e);for(let e of t.propertyParams.values())n.push(e);break;case eV.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(eC).join(" -> ");throw new tt(e7.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))}},iO=class{#e;#t;constructor(e){this.#e=e,this.#t=[]}restore(){let e=this.#t.pop();if(void 0===e)throw new io(it.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()})}},iN=eE.Transient,ik=class{#e;#t;#n;#i;#s;#r;constructor(e){let t=e?.autobind??!1,n=e?.defaultScope??iN,i=e?.jitless??!0;this.#i=this.#l(e,t,n,i);let r=new iP(this.#i),o=new iC(r,this.#i),s=new iA(this.#i);this.#e=new iI(s.deactivationParams,n,o,this.#i),this.#t=new iS(this.#e,s.deactivationParams,n,o,this.#i),this.#s=new ij(r,this.#i,t,n,!i),this.#n=new iM(this,this.#i,this.#s),this.#r=new iO(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}}#l(e,t,n,i){let r=this.#o(t,n);if(e?.parent===void 0)return new ix(e4.build(()=>void 0),tv.build(()=>void 0,r),th.build(()=>void 0),new nH(!i));let o=new nH(!i),s=e.parent;return s.#i.planResultCacheService.subscribe(o),new ix(e4.build(()=>s.#i.activationService),tv.build(()=>s.#i.bindingService,r),th.build(()=>s.#i.deactivationService),o)}};var iB=(l=[[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 l)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),iR=class extends eA{load(e){e.onPlan((e,t)=>{self.postMessage({kind:"plan",options:iB(e),result:iB(t)})})}},iT=class extends ik{constructor(){super(),this.register(iR)}};export{iT as Container,eB as ContainerModule,ex as LazyServiceIdentifier,eE as bindingScopeValues,eV as bindingTypeValues,tf as decorate,tA as inject,tO as injectFromBase,tN as injectFromHierarchy,tC as injectable,tk as multiInject,tT as named,tV as optional,tF as postConstruct,tD as preDestroy,t_ as tagged,tU as unmanaged};