import { h } from "@stencil/core";
import { Operator, } from "@limetech/lime-web-components";
/**
 * Lime Query Filter NOT Component
 *
 * Renders a negated filter expression. This inverts the logic of the child expression,
 * so records that would normally match will be excluded, and vice versa.
 *
 * For example:
 * - NOT (status = "won") → Include all records where status is NOT "won"
 * - NOT (value > 100000) → Include all records where value is NOT greater than 100000
 *
 * This component displays:
 * - A "Not" label
 * - A single child expression (which can be a comparison or nested AND/OR group)
 *
 * Clicking the trash icon removes the entire NOT expression.
 *
 * @private
 */
export class LimeQueryFilterNotComponent {
    constructor() {
        this.handleExpressionChange = (event) => {
            var _a;
            event.stopPropagation();
            const updatedExpression = (_a = event.detail) !== null && _a !== void 0 ? _a : undefined;
            if (updatedExpression === undefined) {
                this.expressionChange.emit(undefined);
                return;
            }
            this.expressionChange.emit({
                op: Operator.NOT,
                exp: updatedExpression,
            });
        };
    }
    render() {
        return (h("div", { key: '16246e10be820ad18713cb097146040d30e242bf', class: "expression" }, this.label && h("limel-header", { key: '539d60a4567727282463dec2a90e06a3630501aa', heading: this.label }), h("limebb-lime-query-filter-expression", { key: '67f892704ea3e5a061acdcb8f3ffe22271971569', platform: this.platform, context: this.context, label: "Not", limetype: this.limetype, activeLimetype: this.activeLimetype, expression: this.expression.exp, onExpressionChange: this.handleExpressionChange })));
    }
    static get is() { return "limebb-lime-query-filter-not"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["lime-query-filter-not.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["lime-query-filter-not.css"]
        };
    }
    static get properties() {
        return {
            "platform": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "LimeWebComponentPlatform",
                    "resolved": "LimeWebComponentPlatform",
                    "references": {
                        "LimeWebComponentPlatform": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::LimeWebComponentPlatform",
                            "referenceLocation": "LimeWebComponentPlatform"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Platform service provider"
                },
                "getter": false,
                "setter": false
            },
            "context": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "LimeWebComponentContext",
                    "resolved": "LimeWebComponentContext",
                    "references": {
                        "LimeWebComponentContext": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::LimeWebComponentContext",
                            "referenceLocation": "LimeWebComponentContext"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Component context"
                },
                "getter": false,
                "setter": false
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Optional label for the NOT expression"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "limetype": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The limetype being queried (e.g., \"deal\", \"company\")"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "limetype"
            },
            "activeLimetype": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string | undefined",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "The limetype of the active object (for %activeObject% placeholders)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "active-limetype"
            },
            "expression": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "NotExpression",
                    "resolved": "{ op: Operator.NOT; exp: Expression; }",
                    "references": {
                        "NotExpression": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::NotExpression",
                            "referenceLocation": "NotExpression"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "The NOT expression containing the child expression to negate"
                },
                "getter": false,
                "setter": false
            }
        };
    }
    static get events() {
        return [{
                "method": "expressionChange",
                "name": "expressionChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the NOT expression changes (child expression modified or removed)\nEmits undefined when the expression should be removed"
                },
                "complexType": {
                    "original": "NotExpression | undefined",
                    "resolved": "undefined | { op: Operator.NOT; exp: Expression; }",
                    "references": {
                        "NotExpression": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::NotExpression",
                            "referenceLocation": "NotExpression"
                        }
                    }
                }
            }];
    }
}
