1import{Ft as e,r as t}from"./CMDJWWg3.chunk.js";import{_ as n,r,u as i}from"./BftnFbcr.chunk.js";t();var a=class extends r{constructor(){super(),this.constructors={},this.destructors={},this.instances={},this.singletonInstances={},this.referenceCounts={}}get name(){return`InstanceManager`}static get Instance(){return this.instance||=new this}registerDataService(e,t){this.validateConstructor(e);let r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=()=>new e({dataProvider:this.getInstance(t.dataProvider),cache:this.getInstance(t.cache),bootstrapData:t.bootstrapData,defaultErrorHandler:t.defaultErrorHandler,alertService:t.alertService}),this.destructors[r]=()=>{this.instances[r]?this.instances[r].destroy():n.throw(new i(`Trying to destroy a ${r} instance that has already been destroyed`)),this.releaseInstance(t.dataProvider),this.releaseInstance(t.cache)},this}registerInstance(t,n){this.validateConstructor(t);let r=t.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=()=>new t(n),this.destructors[r]=()=>e(this.instances[r].destroy)&&this.instances[r].destroy(),this}registerSingleton(e){let t=e.name;return this.singletonInstances[t]=e,this}getInstance(e,t){return this.singletonInstances[e]?this.singletonInstances[e]:(this.constructors[e]||n.throw(new i(`${e} was not registered with ${this.name}`)),this.referenceCounts[e]++,t&&this.listenTo(t,`destroy`,()=>this.releaseInstance(e)),this.instances[e]||(this.instances[e]=this.constructors[e]()),this.instances[e])}releaseInstance(e){if(this.instances[e])return window.setTimeout(()=>{this.referenceCounts[e]--,this.referenceCounts[e]<1&&(this.destructors[e](),delete this.instances[e])},0),this}validateConstructor(e){let t=e.prototype.name;t||n.throw(new i(`Classes registered with ${this.name} must have a unique name property.`)),this.constructors[t]&&n.throw(new i(`A class with the name: ${t} has already been registered with ${this.name}`))}}.Instance;export{a as t}; 2//# sourceMappingURL=TTO6HcNP.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.