{"version":3,"file":"logo-pkX65cTW.js","sources":["../../src/atoms/logo.ts"],"sourcesContent":["import { css, html, LitElement, PropertyValues } from \"lit\";\nimport { customElement } from \"lit/decorators/custom-element.js\";\nimport { sharedStyles } from \"../styles/shared\";\nimport { property } from \"lit/decorators/property.js\";\nimport \"./title\";\nimport { Controller } from \"../state/controller\";\nimport { themeStore } from \"../state/theme/theme-store\";\nimport { COLOR_MODE_COLORS, Size } from \"shared\";\nimport { ASSETS_PATHS, DEFAULT_COLOR_MODE, ROUTES } from \"../config\";\nimport { pushState } from \"../util/route-util\";\nimport { Store } from \"../state/store\";\n\nclass LogoStore extends Store {\n\tmodel$ = {\n\t\tcolorMode: themeStore.model$.colorMode\n\t};\n}\n\n@customElement(\"bs-logo\")\nexport class BsLogo extends LitElement {\n\t@property({ type: String, reflect: true }) size: Size = \"medium\";\n\t@property({ type: Boolean, reflect: true }) dark = false;\n\n\tprotected controller = new Controller(this, new LogoStore(), {\n\t\tcolorMode: this.updateColorMode.bind(this)\n\t});\n\n\tstatic get styles() {\n\t\treturn [\n\t\t\tsharedStyles,\n\t\t\tcss`\n\t\t\t\t:host {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t\talign-items: center;\n\t\t\t\t\tgap: var(--space-s);\n\t\t\t\t\tuser-select: none;\n\t\t\t\t\tcursor: pointer;\n\t\t\t\t}\n\n\t\t\t\t#logo {\n\t\t\t\t\twidth: var(--logo-size, 30px);\n\t\t\t\t\theight: var(--logo-size, 30px);\n\t\t\t\t}\n\n\t\t\t\t:host([size=\"small\"]) {\n\t\t\t\t\t--logo-size: 28px;\n\t\t\t\t}\n\n\t\t\t\t:host([size=\"large\"]) {\n\t\t\t\t\t--logo-size: 40px;\n\t\t\t\t}\n\n\t\t\t\t:host([size=\"huge\"]) {\n\t\t\t\t\t--logo-size: 60px;\n\t\t\t\t}\n\n\t\t\t\t#extension {\n\t\t\t\t\tcolor: var(--shade-dark);\n\t\t\t\t\tfont-weight: normal;\n\t\t\t\t}\n\n\t\t\t\t#text {\n\t\t\t\t\tdisplay: inline-flex;\n\t\t\t\t}\n\t\t\t`\n\t\t];\n\t}\n\n\tprotected boundGoHome = this.goHome.bind(this);\n\n\tprotected firstUpdated(props: PropertyValues) {\n\t\tsuper.firstUpdated(props);\n\t\tthis.addEventListener(\"click\", this.boundGoHome);\n\t\tthis.updateColorMode();\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.removeEventListener(\"click\", this.boundGoHome);\n\t}\n\n\tupdateColorMode() {\n\t\tthis.dark = COLOR_MODE_COLORS[this.controller.model.colorMode ?? DEFAULT_COLOR_MODE]?.isDark ?? false;\n\t}\n\n\tgoHome() {\n\t\tif (location.pathname === ROUTES.index) {\n\t\t\twindow.scrollTo({ top: 0, left: 0, behavior: \"smooth\" });\n\t\t} else {\n\t\t\tpushState(ROUTES.index);\n\t\t}\n\t}\n\n\trender() {\n\t\tconst logoUrl = `${ASSETS_PATHS.brand}/logo/round/${this.dark ? \"light\" : \"dark\"}/logo.svg`;\n\t\treturn html`\n\t\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tIdeamap\n\t\t\t\t\t.ai\n\t\t\t\t\n\t\t\t\n\t\t`;\n\t}\n}\n"],"names":["LogoStore","Store","themeStore","BsLogo","LitElement","Controller","sharedStyles","css","props","_a","COLOR_MODE_COLORS","DEFAULT_COLOR_MODE","ROUTES","pushState","logoUrl","ASSETS_PATHS","html","__decorateClass","property","customElement"],"mappings":"6VAYA,MAAMA,UAAkBC,CAAM,CAA9B,aAAA,CAAA,MAAA,GAAA,SAAA,EACU,KAAA,OAAA,CACR,UAAWC,EAAW,OAAO,SAAA,CAC9B,CACD,CAGa,IAAAC,EAAN,cAAqBC,CAAW,CAAhC,aAAA,CAAA,MAAA,GAAA,SAAA,EACkD,KAAA,KAAA,SACL,KAAA,KAAA,GAEnD,KAAU,WAAa,IAAIC,EAAW,KAAM,IAAIL,EAAa,CAC5D,UAAW,KAAK,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