1import{t as s}from"./chunk-1354792126-1-81-19.js";var i=Symbol;i.dispose??=Symbol.for("Symbol.dispose"),i.asyncDispose??=Symbol.for("Symbol.asyncDispose");var e=Symbol("disposableFields");function isDisposable(s){return"object"==typeof s&&null!==s&&Symbol.dispose in s&&"function"==typeof s[Symbol.dispose]}function disposable(s,i){Object.hasOwn(s,e)||(s[e]=[]),s[e].push(i)}var o=class DisposableObject{static undisposedDisposables=new Set;static disposableFinalizationRegistry=new FinalizationRegistry(s=>{const i=s;if(this.undisposedDisposables.delete(i.id))throw console.error("A DisposableObject was garbage collected without first being disposed",i.creationCallStack??"Call stack unavailable"),new Error("A DisposableObject was garbage collected without first being disposed")});static nextDisposableId=0;owner;childDisposables;_isDisposed=!1;_isDisposing=!1;_disposableId;constructor(){if(s.isDevEnv){this._disposableId=DisposableObject.nextDisposableId++,DisposableObject.undisposedDisposables.add(this._disposableId);const s={id:this._disposableId};DisposableObject.disposableFinalizationRegistry.register(this,s,this)}}untrackForLeakDetection(){void 0!==this._disposableId&&(DisposableObject.undisposedDisposables.delete(this._disposableId),DisposableObject.disposableFinalizationRegistry.unregister(this),this._disposableId=void 0)}get isDisposed(){return this._isDisposed}addDisposable(s){if(this.isDisposed)throw new Error("The instance was already disposed");if(Array.isArray(s)){if(0===s.length)return;for(const i of s)this.addDisposable(i)}else{if(s instanceof DisposableObject){const i=s;
1if(void 0!==i.owner)throw new Error("The disposable already has an owner");i.owner=this}this.childDisposables??=[],this.childDisposables.push(s)}}removeDisposable(s){if(this.isDisposed)throw new Error("The instance was already disposed");if(Array.isArray(s))for(const i of s)this.removeDisposable(i);else{const i=this.childDisposables?.indexOf(s)??-1;if(i<0)throw new Error("Disposable was not added");if(s instanceof DisposableObject){const i=s;if(i.owner!==this)throw new Error("The disposable was not owned by this disposable");i.owner=void 0}this.childDisposables?.splice(i,1)}}dispose=()=>{if(this.isDisposed)throw new Error("Dispose called multiple times");if(void 0!==this._disposableId&&(DisposableObject.undisposedDisposables.delete(this._disposableId),DisposableObject.disposableFinalizationRegistry.unregister(this)),this._isDisposed=!0,this._isDisposing=!0,void 0!==this.childDisposables){for(let s=this.childDisposables.length-1;s>=0;s--){const i=this.childDisposables[s];if(Array.isArray(i))for(let s=i.length-1;s>=0;s--)i[s][Symbol.dispose]();else i[Symbol.dispose]()}this.childDisposables=void 0}let s=Object.getPrototypeOf(this);for(;null!==s;){if(Object.hasOwn(s,e)){const i=s[e];for(let s=i.length-1;s>=0;s--){const e=i[s],o=this[e];if(null!=o)if(Array.isArray(o))for(let s=o.length-1;s>=0;s--){if(!isDisposable(o[s]))throw new Error(`@disposable field "${e}" contains a non-disposable element at index ${s} in ${this.constructor.name}`);o[s][Symbol.dispose]()}else{if(!isDisposable(o))throw new Error(`@disposable field "${e}" is not Disposable in ${this.constructor.name}`);o[Symbol.dispose]()}}}s=Object.getPrototypeOf(s)}this.disposeImplementation(),void 0===this.owner||this.owner._isDisposing||(this.owner.removeDisposable(this),this.owner=void 0),this._isDisposing=!1};[Symbol.dispose](){this.dispose()}disposeImplementation(){}};export{disposable as n,o as t}; 2//# sourceMappingURL=chunk-812720800-1-81-19.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.