//#region ../../node_modules/langium/lib/dependency-injection.js
var e;
(function(e) {
	e.merge = (e, t) => o(o({}, e), t);
})(e ||= {});
function t(e, t, n, i, a, s, c, l, u) {
	return r([
		e,
		t,
		n,
		i,
		a,
		s,
		c,
		l,
		u
	].reduce(o, {}));
}
var n = Symbol("isProxy");
function r(e, t) {
	let r = new Proxy({}, {
		deleteProperty: () => !1,
		set: () => {
			throw Error("Cannot set property on injected service container");
		},
		get: (i, o) => o === n ? !0 : a(i, o, e, t || r),
		getOwnPropertyDescriptor: (n, i) => (a(n, i, e, t || r), Object.getOwnPropertyDescriptor(n, i)),
		has: (t, n) => n in e,
		ownKeys: () => [...Object.getOwnPropertyNames(e)]
	});
	return r;
}
var i = Symbol();
function a(e, t, n, a) {
	if (t in e) {
		if (e[t] instanceof Error) throw Error("Construction failure. Please make sure that your dependencies are constructable. Cause: " + e[t]);
		if (e[t] === i) throw Error("Cycle detected. Please make \"" + String(t) + "\" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies");
		return e[t];
	} else if (t in n) {
		let o = n[t];
		e[t] = i;
		try {
			e[t] = typeof o == "function" ? o(a) : r(o, a);
		} catch (n) {
			throw e[t] = n instanceof Error ? n : void 0, n;
		}
		return e[t];
	} else return;
}
function o(e, t) {
	if (t) {
		for (let [n, r] of Object.entries(t)) if (r != null) if (typeof r == "object") {
			let t = e[n];
			typeof t == "object" && t ? e[n] = o(t, r) : e[n] = o({}, r);
		} else e[n] = r;
	}
	return e;
}
//#endregion
export { t as inject };
