import * as i0 from '@angular/core';
import { input, booleanAttribute, signal, output, Component } from '@angular/core';
import { Icon } from '@masterteam/icons';
import { RouterLinkActive, RouterLink } from '@angular/router';
import { Tooltip } from '@masterteam/components/tooltip';

class Sidebar {
    items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
    logo = input(...(ngDevMode ? [undefined, { debugName: "logo" }] : []));
    logoLink = input(...(ngDevMode ? [undefined, { debugName: "logoLink" }] : []));
    title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
    subTitle = input(...(ngDevMode ? [undefined, { debugName: "subTitle" }] : []));
    bgColor = input(...(ngDevMode ? [undefined, { debugName: "bgColor" }] : []));
    bgImage = input(...(ngDevMode ? [undefined, { debugName: "bgImage" }] : []));
    bgRepeat = input(false, { ...(ngDevMode ? { debugName: "bgRepeat" } : {}), transform: booleanAttribute });
    iconsColor = input('var(--p-text-color)', ...(ngDevMode ? [{ debugName: "iconsColor" }] : []));
    expanded = signal(false, ...(ngDevMode ? [{ debugName: "expanded" }] : []));
    expandedChange = output();
    toggleSidebar() {
        this.expanded.update((v) => !v);
        this.expandedChange.emit(this.expanded());
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Sidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: Sidebar, isStandalone: true, selector: "mt-sidebar", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoLink: { classPropertyName: "logoLink", publicName: "logoLink", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subTitle: { classPropertyName: "subTitle", publicName: "subTitle", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, bgImage: { classPropertyName: "bgImage", publicName: "bgImage", isSignal: true, isRequired: false, transformFunction: null }, bgRepeat: { classPropertyName: "bgRepeat", publicName: "bgRepeat", isSignal: true, isRequired: false, transformFunction: null }, iconsColor: { classPropertyName: "iconsColor", publicName: "iconsColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedChange: "expandedChange" }, ngImport: i0, template: "<div\r\n  class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n  [style.width]=\"expanded() ? '16rem' : '4rem'\"\r\n>\r\n  <div\r\n    class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n    [style.backgroundColor]=\"bgColor()\"\r\n    [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n    [class.bg-no-repeat]=\"!bgRepeat()\"\r\n    [class.bg-repeat-y]=\"bgRepeat()\"\r\n  >\r\n    <!-- Toggle Button & Branding -->\r\n    <div class=\"flex shrink-0 items-center gap-2\">\r\n      <button\r\n        type=\"button\"\r\n        size=\"large\"\r\n        class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n        [style.color]=\"iconsColor()\"\r\n        (click)=\"toggleSidebar()\"\r\n      >\r\n        <mt-icon\r\n          icon=\"general.menu-01\"\r\n          class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n          [class.rotate-180]=\"expanded()\"\r\n        />\r\n      </button>\r\n\r\n      @if (logo() || title()) {\r\n        <div\r\n          class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n          [class.max-w-0]=\"!expanded()\"\r\n          [class.opacity-0]=\"!expanded()\"\r\n          [class.max-w-xs]=\"expanded()\"\r\n          [class.opacity-100]=\"expanded()\"\r\n        >\r\n          @if (logo()) {\r\n            <img\r\n              [src]=\"logo()\"\r\n              alt=\"Logo\"\r\n              class=\"h-8 shrink-0\"\r\n              [routerLink]=\"logoLink()\"\r\n              [class.cursor-pointer]=\"logoLink()\"\r\n            />\r\n          }\r\n          @if (logo() && (title() || subTitle())) {\r\n            <div\r\n              class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n              [style.color]=\"iconsColor()\"\r\n            ></div>\r\n          }\r\n          @if (title() || subTitle()) {\r\n            <div\r\n              class=\"flex flex-col gap-0.5 min-w-0\"\r\n              [style.color]=\"iconsColor()\"\r\n            >\r\n              <span class=\"text-sm font-semibold truncate\">{{ title() }}</span>\r\n              @if (subTitle()) {\r\n                <span class=\"text-xs opacity-70 truncate\">{{\r\n                  subTitle()\r\n                }}</span>\r\n              }\r\n            </div>\r\n          }\r\n        </div>\r\n      }\r\n    </div>\r\n\r\n    <div\r\n      class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n      [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n      [class.pr-1]=\"expanded()\"\r\n      [class.pr-px]=\"!expanded()\"\r\n    >\r\n      @for (item of items(); track item.id) {\r\n        <a\r\n          [routerLink]=\"item.routerLink\"\r\n          routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n          #rla=\"routerLinkActive\"\r\n          class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-xl overflow-hidden\"\r\n          mtTooltip=\"{{ item.title }}\"\r\n          [style.color]=\"rla.isActive ? 'var(--p-primary-500)' : iconsColor()\"\r\n        >\r\n          <div class=\"px-4\">\r\n            <mt-icon [icon]=\"item.icon\" class=\"shrink-0\" />\r\n          </div>\r\n          <div\r\n            class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n            [class.opacity-0]=\"!expanded()\"\r\n            [class.max-w-xs]=\"expanded()\"\r\n            [class.opacity-100]=\"expanded()\"\r\n          >\r\n            {{ item.title }}\r\n          </div>\r\n        </a>\r\n      }\r\n    </div>\r\n  </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%;min-height:0}.mt-sidebar-menu{scrollbar-width:thin;scrollbar-color:var(--p-surface-400) transparent}.mt-sidebar-menu::-webkit-scrollbar{width:6px}.mt-sidebar-menu::-webkit-scrollbar-track{background:transparent}.mt-sidebar-menu::-webkit-scrollbar-thumb{border-radius:9999px;background:color-mix(in srgb,var(--p-surface-500) 58%,transparent)}.mt-sidebar-menu::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--p-surface-600) 72%,transparent)}.mt-sidebar-menu-collapsed{scrollbar-color:var(--p-surface-500) transparent}.mt-sidebar-menu-collapsed::-webkit-scrollbar{width:2px}.mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--p-surface-600) 82%,transparent)}\n"], dependencies: [{ kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: Tooltip, selector: "[mtTooltip]" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Sidebar, decorators: [{
            type: Component,
            args: [{ selector: 'mt-sidebar', standalone: true, imports: [RouterLinkActive, RouterLink, Icon, Tooltip], template: "<div\r\n  class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n  [style.width]=\"expanded() ? '16rem' : '4rem'\"\r\n>\r\n  <div\r\n    class=\"flex h-full min-h-0 flex-col gap-3 px-2 py-4\"\r\n    [style.backgroundColor]=\"bgColor()\"\r\n    [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n    [class.bg-no-repeat]=\"!bgRepeat()\"\r\n    [class.bg-repeat-y]=\"bgRepeat()\"\r\n  >\r\n    <!-- Toggle Button & Branding -->\r\n    <div class=\"flex shrink-0 items-center gap-2\">\r\n      <button\r\n        type=\"button\"\r\n        size=\"large\"\r\n        class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n        [style.color]=\"iconsColor()\"\r\n        (click)=\"toggleSidebar()\"\r\n      >\r\n        <mt-icon\r\n          icon=\"general.menu-01\"\r\n          class=\"text-lg transition-transform duration-400 ease-in-out\"\r\n          [class.rotate-180]=\"expanded()\"\r\n        />\r\n      </button>\r\n\r\n      @if (logo() || title()) {\r\n        <div\r\n          class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n          [class.max-w-0]=\"!expanded()\"\r\n          [class.opacity-0]=\"!expanded()\"\r\n          [class.max-w-xs]=\"expanded()\"\r\n          [class.opacity-100]=\"expanded()\"\r\n        >\r\n          @if (logo()) {\r\n            <img\r\n              [src]=\"logo()\"\r\n              alt=\"Logo\"\r\n              class=\"h-8 shrink-0\"\r\n              [routerLink]=\"logoLink()\"\r\n              [class.cursor-pointer]=\"logoLink()\"\r\n            />\r\n          }\r\n          @if (logo() && (title() || subTitle())) {\r\n            <div\r\n              class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n              [style.color]=\"iconsColor()\"\r\n            ></div>\r\n          }\r\n          @if (title() || subTitle()) {\r\n            <div\r\n              class=\"flex flex-col gap-0.5 min-w-0\"\r\n              [style.color]=\"iconsColor()\"\r\n            >\r\n              <span class=\"text-sm font-semibold truncate\">{{ title() }}</span>\r\n              @if (subTitle()) {\r\n                <span class=\"text-xs opacity-70 truncate\">{{\r\n                  subTitle()\r\n                }}</span>\r\n              }\r\n            </div>\r\n          }\r\n        </div>\r\n      }\r\n    </div>\r\n\r\n    <div\r\n      class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-1 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n      [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n      [class.pr-1]=\"expanded()\"\r\n      [class.pr-px]=\"!expanded()\"\r\n    >\r\n      @for (item of items(); track item.id) {\r\n        <a\r\n          [routerLink]=\"item.routerLink\"\r\n          routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n          #rla=\"routerLinkActive\"\r\n          class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-xl overflow-hidden\"\r\n          mtTooltip=\"{{ item.title }}\"\r\n          [style.color]=\"rla.isActive ? 'var(--p-primary-500)' : iconsColor()\"\r\n        >\r\n          <div class=\"px-4\">\r\n            <mt-icon [icon]=\"item.icon\" class=\"shrink-0\" />\r\n          </div>\r\n          <div\r\n            class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n            [class.opacity-0]=\"!expanded()\"\r\n            [class.max-w-xs]=\"expanded()\"\r\n            [class.opacity-100]=\"expanded()\"\r\n          >\r\n            {{ item.title }}\r\n          </div>\r\n        </a>\r\n      }\r\n    </div>\r\n  </div>\r\n</div>\r\n", styles: [":host{display:block;height:100%;min-height:0}.mt-sidebar-menu{scrollbar-width:thin;scrollbar-color:var(--p-surface-400) transparent}.mt-sidebar-menu::-webkit-scrollbar{width:6px}.mt-sidebar-menu::-webkit-scrollbar-track{background:transparent}.mt-sidebar-menu::-webkit-scrollbar-thumb{border-radius:9999px;background:color-mix(in srgb,var(--p-surface-500) 58%,transparent)}.mt-sidebar-menu::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--p-surface-600) 72%,transparent)}.mt-sidebar-menu-collapsed{scrollbar-color:var(--p-surface-500) transparent}.mt-sidebar-menu-collapsed::-webkit-scrollbar{width:2px}.mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--p-surface-600) 82%,transparent)}\n"] }]
        }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], logo: [{ type: i0.Input, args: [{ isSignal: true, alias: "logo", required: false }] }], logoLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoLink", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subTitle", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], bgImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgImage", required: false }] }], bgRepeat: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgRepeat", required: false }] }], iconsColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconsColor", required: false }] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }] } });

/**
 * Generated bundle index. Do not edit.
 */

export { Sidebar };
//# sourceMappingURL=masterteam-components-sidebar.mjs.map
