import { InterceptorConfig } from '../../InterceptorConfig';
import { registerInterceptor } from '../../InterceptorGenerator';
import { VisibilityHandler } from '../../VisibilityHandler';
import { doesSatisfyRule } from './RuleUtils';
export class ConcealerConditional extends InterceptorConfig {
  constructor(rule) {
    super('concealerGenericRule');
    this.rule = rule;
  }
}
ConcealerConditional.id = 'concealerGenericRule';
export class ConcealerGenericRuleHandler extends VisibilityHandler {
  constructor(config) {
    super();
    this.config = config;
  }
  shouldShow(_context, values, _field, _value) {
    return doesSatisfyRule(this.config.rule, values);
  }
}
registerInterceptor(ConcealerConditional.id, (config) => new ConcealerGenericRuleHandler(config));
