import*as t from"../../../core/common/common.js";var e=Object.freeze({__proto__:null,SharedObject:class{#t=new t.Mutex.Mutex;#e=0;#r;#a;#i;constructor(t,e){this.#a=t,this.#i=e}async acquire(){return await this.#t.run((async()=>{0===this.#e&&(this.#r=await this.#a()),++this.#e})),[this.#r,this.#s.bind(this,{released:!1})]}async run(t){const[e,r]=await this.acquire();try{return await t(e)}finally{await r()}}async#s(t){if(t.released)throw new Error("Attempted to release object multiple times.");try{t.released=!0,await this.#t.run((async()=>{1===this.#e&&(await this.#i(this.#r),this.#r=void 0),--this.#e}))}catch(e){throw t.released=!1,e}}}});const r=!1,a="devtools_recorder";class i{static#c;static async get(){return this.#c||(this.#c=(await fetch(new URL("../injected/injected.generated.js",import.meta.url))).text()),await this.#c}}export{a as DEVTOOLS_RECORDER_WORLD_NAME,i as InjectedScript,e as SharedObject,r as isDebugBuild};
