import { h, Fragment } from "@stencil/core";
import { guid } from "../../utils";
export class DgaNotificationToast {
    constructor() {
        this.type = 'neutral'; // Default to "neutral" if not provided
        this.hasHelperText = false; // Default to false if not provided
        this.vPostion = 'top';
        this.hPostion = 'right';
        this.buttonsList = [];
        this.open = true;
        this.icons = {
            success: {
                name: 'checkmark-circle-02',
                variant: 'stroke',
                type: 'rounded',
            },
            info: {
                name: 'information-circle',
                variant: 'stroke',
                type: 'rounded',
            },
            neutral: {
                name: 'information-circle',
                variant: 'stroke',
                type: 'rounded',
            },
            warning: {
                name: 'alert-02',
                variant: 'stroke',
                type: 'rounded',
            },
            error: {
                name: 'alert-circle',
                variant: 'stroke',
                type: 'rounded',
            },
        };
    }
    render() {
        return (h("div", { key: '81b0c5991275eb32275b22c160430b3923bd303a', class: `notification-toast notification-toast--${this.type} dga-vpostion-${this.vPostion} dga-hpostion-${this.hPostion} ${this.open ? 'active' : ''}` }, h("div", { key: 'd36f650f13ae715a4d2ce47043b088eb3c7fc2a5', class: `notification-toast__header ${this.hasHelperText ? '' : 'dga-flex-center-y'}` }, h("dga-featured-icon", { key: 'd91d5937d27704ee2dc920a121999ff4cdc6708f', icon: Object.assign(Object.assign({}, this.icons[this.type]), { size: 20 }), color: this.type, size: "lg" }), h("div", { key: 'dfe749e3a0b2fcca440d105cde695986ead93b94', class: "notification-toast__body" }, h("h4", { key: '63259f5797ea01a43979264516428aa4eb855f43', class: "notification-toast__title text-md-semibold" }, this.leadText), this.hasHelperText && this.helperText && h("p", { key: '7cb6927812f829db8e3a92a42e3d2a2b4b6ecdfb', class: "notification-toast__content text-sm-regular" }, this.helperText)), this.closeButton && (h("div", { key: '4741f5f7971e56d2ce3c27d7ce99ba3c0474458e', class: "notification-toast__close-btn" }, h("button", { key: 'd92fa853aeecb76ff7a8d5c6983dae23264053f2', class: "dga-btn dga-btn--close dga-btn--icon dga-btn--md", onClick: e => { var _a; return (_a = this.onClose) === null || _a === void 0 ? void 0 : _a.call(this, e); } }, h("span", { key: '138818d41c88ef9f48bab948f8bc4b95b38ab625', class: "dga-btn-icon" }, h("dga-icon-v2", { key: 'd20d4b10017b228041a284fb9081aa97d6ad860e', name: "multiplication-sign", variant: "stroke", type: "sharp", size: 20 })))))), this.action && (h(Fragment, { key: 'b68f00d6aac5dcf204110e1095bcc0c03f897fa9' }, h("div", { key: '5eb01a64604b9c15107438c43fee3d86e57ba8ca', class: "notification-toast__action" }, this.buttonsList.length > 0 &&
            this.buttonsList.map(({ id, onClick, extraClasses, title, label }) => (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `dga-btn dga-btn--subtle dga-btn--md ${extraClasses}` }, (title && { title: title })), label)))), h("div", { key: 'a2b573d02b8c1e69622133bb9c1cb1e72d962845', class: "notification-toast__action-mobile" }, this.buttonsList.length > 0 &&
            this.buttonsList.map(({ id, onClick, extraClasses, title, label }) => (h("button", Object.assign({ key: id ? id : guid(), id: id ? id : guid(), onClick: e => onClick(e), class: `dga-btn dga-btn--secondary dga-btn--lg ${extraClasses}` }, (title && { title: title })), label))))))));
    }
    static get is() { return "dga-notification-toast"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-notification-toast.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-notification-toast.css"]
        };
    }
    static get properties() {
        return {
            "type": {
                "type": "string",
                "attribute": "type",
                "mutable": false,
                "complexType": {
                    "original": "'error' | 'warning' | 'success' | 'info' | 'neutral'",
                    "resolved": "\"error\" | \"info\" | \"neutral\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'neutral'"
            },
            "leadText": {
                "type": "string",
                "attribute": "lead-text",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "hasHelperText": {
                "type": "boolean",
                "attribute": "has-helper-text",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "helperText": {
                "type": "string",
                "attribute": "helper-text",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "action": {
                "type": "boolean",
                "attribute": "action",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "closeButton": {
                "type": "boolean",
                "attribute": "close-button",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "vPostion": {
                "type": "string",
                "attribute": "v-postion",
                "mutable": false,
                "complexType": {
                    "original": "'top' | 'bottom'",
                    "resolved": "\"bottom\" | \"top\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'top'"
            },
            "hPostion": {
                "type": "string",
                "attribute": "h-postion",
                "mutable": false,
                "complexType": {
                    "original": "'left' | 'right'",
                    "resolved": "\"left\" | \"right\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'right'"
            },
            "onClose": {
                "type": "unknown",
                "attribute": "on-close",
                "mutable": false,
                "complexType": {
                    "original": "(event: any) => void",
                    "resolved": "(event: any) => void",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "buttonsList": {
                "type": "unknown",
                "attribute": "buttons-list",
                "mutable": false,
                "complexType": {
                    "original": "{\n    id?: string;\n    label: string;\n    onClick: (event?: any) => void;\n    extraClasses?: string;\n    title?: string;\n  }[]",
                    "resolved": "{ id?: string; label: string; onClick: (event?: any) => void; extraClasses?: string; title?: string; }[]",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            },
            "open": {
                "type": "boolean",
                "attribute": "open",
                "mutable": true,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "defaultValue": "true"
            }
        };
    }
}
