//#region ../../node_modules/langium/lib/workspace/ast-node-locator.js
var e = class {
	constructor() {
		this.segmentSeparator = "/", this.indexSeparator = "@";
	}
	getAstNodePath(e) {
		if (e.$container) {
			let t = this.getAstNodePath(e.$container), n = this.getPathSegment(e);
			return t + this.segmentSeparator + n;
		}
		return "";
	}
	getPathSegment({ $containerProperty: e, $containerIndex: t }) {
		if (!e) throw Error("Missing '$containerProperty' in AST node.");
		return t === void 0 ? e : e + this.indexSeparator + t;
	}
	getAstNode(e, t) {
		return t.split(this.segmentSeparator).reduce((e, t) => {
			if (!e || t.length === 0) return e;
			let n = t.indexOf(this.indexSeparator);
			if (n > 0) {
				let r = t.substring(0, n), i = parseInt(t.substring(n + 1));
				return e[r]?.[i];
			}
			return e[t];
		}, e);
	}
};
//#endregion
export { e as DefaultAstNodeLocator };
