import{a as e,r,I as s}from"./p-35c7f358.js";class t extends e{run(e,r,s,t,n){return{value:r[n.id],visible:this.shouldShow(e,r,s,t)}}}function n(e,r){if(!e||!r)return!0;if("group"===e.type){if(!e.rules||0===e.rules.length)return!0;for(let s=0;s<(e.rules||[]).length;s++){const t=n(e.rules[s],r);if(t&&"or"===e.operator)return!0;if(!t&&"and"===e.operator)return!1;if(t&&"and"===e.operator&&s===e.rules.length-1)return!0}}else if("condition"===e.type){const{condition:s,value:t,key:n}=e;if(!s||!n)return!1;switch(s){case"eq":switch(typeof r[n]){case"boolean":case"number":return r[n]==t;case"string":return(r[n]||"").trim()==(t||"").trim()}return!1;case"ne":switch(typeof r[n]){case"boolean":case"number":return r[n]!=t;case"string":return(r[n]||"").trim()!=(t||"").trim()}return!1}}return!1}class c extends s{constructor(e){super("concealerGenericRule"),this.rule=e}}c.id="concealerGenericRule";class i extends t{constructor(e){super(),this.config=e}shouldShow(e,r,s,t){return n(this.config.rule,r)}}r(c.id,(e=>new i(e)));class o extends class{constructor(e){this.type=e}}{constructor(e,r){super("condition"),this.condition="eq",this.key=e,this.value=r}}export{c as C,o as E}