//#region src/components-core/behaviors/behaviorConditionEvaluator.ts
function e(e, n, r) {
	return e.condition ? t(e.condition, n, r) : !0;
}
function t(e, n, r) {
	switch (e.type) {
		case "and": return e.conditions.every((e) => t(e, n, r));
		case "or": return e.conditions.some((e) => t(e, n, r));
		case "not": return !t(e.condition, n, r);
		case "visual": return !n.getMetadata().nonVisual;
		case "nonVisual": return !!n.getMetadata().nonVisual;
		case "isType": return r === e.nodeType;
		case "isNotType": return r !== e.nodeType;
		case "hasProp": return !!n.getProp(e.propName);
		case "hasNoProp": return !n.getProp(e.propName);
		case "propEquals": return !!n.getProp(e.propName);
		case "propContains": return !!n.getProp(e.propName);
		case "propNotEquals": return !n.getProp(e.propName);
		case "hasEvent": return !!n.getEvent(e.eventName);
		case "hasNoEvent": return !n.getEvent(e.eventName);
		case "hasApi": return !!n.getApi(e.apiName);
		case "hasNoApi": return !n.getApi(e.apiName);
		case "hasContextVar": return !!n.contextVars?.[e.contextVarName];
		case "hasNoContextVar": return !n.contextVars?.[e.contextVarName];
		default: return !1;
	}
}
//#endregion
export { e as canBehaviorAttachToComponent };

//# sourceMappingURL=behavior-evaluator.js.map