import { r as registerInstance, d as createEvent, h } from './core-34fac203.js';

const ButtonCollapse = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.expanded = true;
        /**
         * If true will render as a free button instead of the standard icon.
         */
        this.free = false;
        this.anjCollapse = createEvent(this, "anjCollapse", 7);
    }
    onClick() {
        if (this.context !== 'clear') {
            this.anjCollapse.emit(this.expanded);
        }
        this.expanded = !this.expanded;
    }
    render() {
        return (h("anj-button", { context: this.free ? 'free' : 'icon', onClick: () => this.onClick(), ariaLabel: this.expanded ? 'Collapse' : 'Expand' }, this.expanded
            ? h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, h("path", { fill: "none", d: "M0 0h24v24H0V0z" }), h("path", { d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z" }))
            : h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" }, h("path", { fill: "none", d: "M0 0h24v24H0V0z" }), h("path", { d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" }))));
    }
    static get style() { return ".sc-anj-button-collapse-h {\n  display: block;\n}\n[context=floating].sc-anj-button-collapse-h {\n  position: absolute;\n  right: 0.5rem;\n  top: 0.5rem;\n  z-index: 1;\n}"; }
};

export { ButtonCollapse as anj_button_collapse };
