var __extends=this&&this.__extends||function(){var e=function(r,t){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return e(r,t)};return function(r,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(r,t);function n(){this.constructor=r}r.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();import{a as InterceptorHandler,r as registerInterceptor,I as InterceptorConfig}from"./InterceptorHandler-6474bcf4.js";var VisibilityHandler=function(e){__extends(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}r.prototype.run=function(e,r,t,n,o){return{value:r[o.id],visible:this.shouldShow(e,r,t,n)}};return r}(InterceptorHandler);function doesSatisfyRule(e,r){if(!e||!r){return true}if(e.type==="group"){if(!e.rules||e.rules.length===0){return true}for(var t=0;t<(e.rules||[]).length;t++){var n=doesSatisfyRule(e.rules[t],r);if(n&&e.operator==="or"){return true}else if(!n&&e.operator==="and"){return false}else if(n&&e.operator==="and"&&t===e.rules.length-1){return true}}}else if(e.type==="condition"){var o=e.condition,i=e.value,u=e.key;if(!o||!u){return false}switch(o){case"eq":{switch(typeof r[u]){case"boolean":{return r[u]==i}case"number":{return r[u]==i}case"string":{return(r[u]||"").trim()==(i||"").trim()}}return false}case"ne":{switch(typeof r[u]){case"boolean":{return r[u]!=i}case"number":{return r[u]!=i}case"string":{return(r[u]||"").trim()!=(i||"").trim()}}return false}}}return false}var ConcealerConditional=function(e){__extends(r,e);function r(r){var t=e.call(this,"concealerGenericRule")||this;t.rule=r;return t}return r}(InterceptorConfig);ConcealerConditional.id="concealerGenericRule";var ConcealerGenericRuleHandler=function(e){__extends(r,e);function r(r){var t=e.call(this)||this;t.config=r;return t}r.prototype.shouldShow=function(e,r,t,n){return doesSatisfyRule(this.config.rule,r)};return r}(VisibilityHandler);registerInterceptor(ConcealerConditional.id,(function(e){return new ConcealerGenericRuleHandler(e)}));var Rule=function(){function e(e){this.type=e}return e}();var Equal=function(e){__extends(r,e);function r(r,t){var n=e.call(this,"condition")||this;n.condition="eq";n.key=r;n.value=t;return n}return r}(Rule);export{ConcealerConditional as C,Equal as E};