import { p as proxyCustomElement, H, h, f as forceUpdate } from './p-3b962989.js';
import { E as EventBus } from './p-9d530225.js';
import { d as defineCustomElement$e } from './p-fcdd38ae.js';
import { d as defineCustomElement$d } from './p-a4838a07.js';
import { d as defineCustomElement$c } from './p-05fde321.js';
import { d as defineCustomElement$b } from './p-5eac8600.js';
import { d as defineCustomElement$a } from './p-9f047e8e.js';
import { d as defineCustomElement$9 } from './p-178e95ec.js';
import { d as defineCustomElement$8 } from './p-bbb0c6b7.js';
import { d as defineCustomElement$7 } from './p-90a680f0.js';
import { d as defineCustomElement$6 } from './p-d31c6271.js';
import { d as defineCustomElement$5 } from './p-d55ae1aa.js';
import { d as defineCustomElement$4 } from './p-bb71cb69.js';
import { d as defineCustomElement$3 } from './p-56650981.js';
import { d as defineCustomElement$2 } from './p-c79c8bc4.js';

var ToastEventsEnum;
(function (ToastEventsEnum) {
    ToastEventsEnum["OPEN_NOTIFICATIONS_FEED"] = "OPEN_NOTIFICATIONS_FEED";
    ToastEventsEnum["CLOSE_TOAST"] = "CLOSE_TOAST";
    // Event to update the transaction toast data
    ToastEventsEnum["TRANSACTION_TOAST_DATA_UPDATE"] = "TRANSACTION_TOAST_DATA_UPDATE";
    // Event to update the custom toast data
    ToastEventsEnum["CUSTOM_TOAST_DATA_UPDATE"] = "CUSTOM_TOAST_DATA_UPDATE";
})(ToastEventsEnum || (ToastEventsEnum = {}));

const toastListCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.flex{display:flex}.border{border-width:1px}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.toast-list{bottom:1rem;left:1rem;position:fixed;right:1rem;z-index:9999}@media (min-width:760px){.toast-list{bottom:2rem;left:auto;right:2rem;width:22.5rem}}.view-all-button-container{display:flex;justify-content:center;margin-top:.75rem}.view-all-button{background-color:rgba(50,50,60,.8);border:none;border-radius:1.5rem;color:hsla(0,0%,100%,.9);cursor:pointer;font-size:.875rem;font-weight:500;padding:.5rem 1.5rem;transition:background-color .2s ease}.view-all-button:hover{background-color:rgba(60,60,70,.9)}.static{position:static}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.\\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}";
const ToastListStyle0 = toastListCss;

const ToastList$1 = /*@__PURE__*/ proxyCustomElement(class ToastList extends H {
    constructor() {
        super();
        this.__registerHost();
        this.eventBus = new EventBus();
    }
    async getEventBus() {
        return this.eventBus;
    }
    disconnectedCallback() {
        this.eventBus.unsubscribe(ToastEventsEnum.TRANSACTION_TOAST_DATA_UPDATE, this.transactionToastUpdate.bind(this));
        this.eventBus.unsubscribe(ToastEventsEnum.CUSTOM_TOAST_DATA_UPDATE, this.customToastsUpdate.bind(this));
    }
    handleCustomToastDelete(toastId) {
        this.eventBus.publish(ToastEventsEnum.CLOSE_TOAST, toastId);
    }
    handleTransactionToastDelete(toastId) {
        this.eventBus.publish(ToastEventsEnum.CLOSE_TOAST, toastId);
    }
    handleViewAllClick() {
        this.eventBus.publish(ToastEventsEnum.OPEN_NOTIFICATIONS_FEED);
    }
    render() {
        var _a, _b, _c;
        return (h("div", { key: 'ecd27ee25917846af7652af3134088c3a566bd0d', class: "toast-list", id: "toast-list" }, (_a = this.customToasts) === null || _a === void 0 ? void 0 :
            _a.map(toast => h("generic-toast", { toast: toast, onHandleDeleteToast: this.handleCustomToastDelete.bind(this, toast.toastId) })), (_b = this.transactionToasts) === null || _b === void 0 ? void 0 :
            _b.map(toast => h("transaction-toast", Object.assign({}, toast, { onHandleDeleteToast: this.handleTransactionToastDelete.bind(this, toast.toastId) }))), ((_c = this.transactionToasts) === null || _c === void 0 ? void 0 : _c.length) > 0 && (h("div", { key: '044ea08bc44746eb925c9e48a61c6edfa7ea4a2f', class: "view-all-button-container" }, h("button", { key: 'e5b2929bf2e99f1d8bd29394d5ccef20dd7b671b', class: "view-all-button", onClick: this.handleViewAllClick.bind(this) }, "View All")))));
    }
    transactionToastUpdate(payload) {
        this.transactionToasts = [...payload];
        forceUpdate(this);
    }
    customToastsUpdate(payload) {
        this.customToasts = [...payload];
        forceUpdate(this);
    }
    componentDidLoad() {
        this.eventBus.subscribe(ToastEventsEnum.TRANSACTION_TOAST_DATA_UPDATE, this.transactionToastUpdate.bind(this));
        this.eventBus.subscribe(ToastEventsEnum.CUSTOM_TOAST_DATA_UPDATE, this.customToastsUpdate.bind(this));
    }
    static get style() { return ToastListStyle0; }
}, [0, "toast-list", {
        "transactionToasts": [16],
        "customToasts": [16],
        "getEventBus": [64]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["toast-list", "copy-button", "custom-toast", "explorer-link", "fa-icon", "generic-toast", "simple-toast", "transaction-toast", "transaction-toast-content", "transaction-toast-details", "transaction-toast-details-body", "transaction-toast-progress", "transaction-toast-wrapper", "trim-text"];
    components.forEach(tagName => { switch (tagName) {
        case "toast-list":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, ToastList$1);
            }
            break;
        case "copy-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$e();
            }
            break;
        case "custom-toast":
            if (!customElements.get(tagName)) {
                defineCustomElement$d();
            }
            break;
        case "explorer-link":
            if (!customElements.get(tagName)) {
                defineCustomElement$c();
            }
            break;
        case "fa-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$b();
            }
            break;
        case "generic-toast":
            if (!customElements.get(tagName)) {
                defineCustomElement$a();
            }
            break;
        case "simple-toast":
            if (!customElements.get(tagName)) {
                defineCustomElement$9();
            }
            break;
        case "transaction-toast":
            if (!customElements.get(tagName)) {
                defineCustomElement$8();
            }
            break;
        case "transaction-toast-content":
            if (!customElements.get(tagName)) {
                defineCustomElement$7();
            }
            break;
        case "transaction-toast-details":
            if (!customElements.get(tagName)) {
                defineCustomElement$6();
            }
            break;
        case "transaction-toast-details-body":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "transaction-toast-progress":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "transaction-toast-wrapper":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "trim-text":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const ToastList = ToastList$1;
const defineCustomElement = defineCustomElement$1;

export { ToastList, defineCustomElement };

//# sourceMappingURL=toast-list.js.map