@ahriknow/lux 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/README_zh-CN.md +127 -0
  4. package/dist/components/lux-button/index.iife.min.js +292 -0
  5. package/dist/components/lux-button/index.min.js +292 -0
  6. package/dist/components/lux-code/index.iife.min.js +290 -0
  7. package/dist/components/lux-code/index.min.js +290 -0
  8. package/dist/components/lux-dropdown/index.iife.min.js +162 -0
  9. package/dist/components/lux-dropdown/index.min.js +162 -0
  10. package/dist/components/lux-example/index.iife.min.js +88 -0
  11. package/dist/components/lux-example/index.min.js +88 -0
  12. package/dist/components/lux-icon/index.iife.min.js +22 -0
  13. package/dist/components/lux-icon/index.min.js +22 -0
  14. package/dist/components/lux-input/index.iife.min.js +238 -0
  15. package/dist/components/lux-input/index.min.js +238 -0
  16. package/dist/components/lux-layout/index.iife.min.js +90 -0
  17. package/dist/components/lux-layout/index.min.js +90 -0
  18. package/dist/components/lux-menu/index.iife.min.js +193 -0
  19. package/dist/components/lux-menu/index.min.js +193 -0
  20. package/dist/components/lux-scroll/index.iife.min.js +137 -0
  21. package/dist/components/lux-scroll/index.min.js +137 -0
  22. package/dist/components/lux-switch/index.iife.min.js +116 -0
  23. package/dist/components/lux-switch/index.min.js +116 -0
  24. package/dist/components/lux-table/index.iife.min.js +67 -0
  25. package/dist/components/lux-table/index.min.js +67 -0
  26. package/dist/lux.core.min.js +1 -0
  27. package/dist/lux.i18n.min.js +1 -0
  28. package/dist/lux.iife.js +1822 -0
  29. package/dist/lux.iife.js.map +1 -0
  30. package/dist/lux.iife.min.js +1 -0
  31. package/dist/lux.js +1792 -0
  32. package/dist/lux.js.map +1 -0
  33. package/dist/lux.min.js +1 -0
  34. package/dist/lux.router.min.js +1 -0
  35. package/dist/lux.template.min.js +1 -0
  36. package/dist/lux.theme.min.js +1 -0
  37. package/dist/themes/dark.css +130 -0
  38. package/dist/themes/light.css +128 -0
  39. package/package.json +64 -0
  40. package/src/components/lux-button/index.js +319 -0
  41. package/src/components/lux-code/index.js +382 -0
  42. package/src/components/lux-dropdown/index.js +256 -0
  43. package/src/components/lux-example/index.js +117 -0
  44. package/src/components/lux-icon/index.js +180 -0
  45. package/src/components/lux-input/index.js +363 -0
  46. package/src/components/lux-layout/index.js +222 -0
  47. package/src/components/lux-menu/index.js +283 -0
  48. package/src/components/lux-scroll/index.js +349 -0
  49. package/src/components/lux-switch/index.js +203 -0
  50. package/src/components/lux-table/index.js +105 -0
  51. package/src/core.js +7 -0
  52. package/src/element.js +477 -0
  53. package/src/i18n/format.js +108 -0
  54. package/src/i18n/index.js +102 -0
  55. package/src/i18n/locale.js +26 -0
  56. package/src/index.js +22 -0
  57. package/src/router.js +330 -0
  58. package/src/template.js +402 -0
  59. package/src/theme/color.js +148 -0
  60. package/src/theme/create.js +97 -0
  61. package/src/theme/index.js +2 -0
  62. package/src/theme/tokens.js +128 -0
  63. package/src/themes/dark.css +130 -0
  64. package/src/themes/light.css +128 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ahriknow
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ <div align="center">
2
+
3
+ # Lux
4
+
5
+ **English** | [中文](./README_zh-CN.md)
6
+
7
+ A lightweight Web Components framework with reactive properties, template engine, router, and i18n.
8
+
9
+ [![npm version](https://img.shields.io/npm/v/@ahriknow/lux.svg)](https://www.npmjs.com/package/@ahriknow/lux)
10
+ [![license](https://img.shields.io/npm/l/@ahriknow/lux.svg)](./LICENSE)
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## Features
17
+
18
+ - **Reactive Properties** — Declare `static properties`, Lux handles change detection, batching, and incremental DOM updates
19
+ - **Shadow DOM Styles** — `static styles` with `css` tagged template, injected via `adoptedStyleSheets`
20
+ - **Template Engine** — Tagged template literals with event, property, boolean, class, and style bindings
21
+ - **repeat() Directive** — Keyed list rendering with O(n) diff algorithm
22
+ - **Router** — Hash-based SPA routing with params, nested routes, lazy loading, and guards
23
+ - **i18n** — ICU MessageFormat with number/date formatting
24
+ - **Theme System** — CSS custom properties for light/dark themes
25
+ - **Zero Dependencies** — Pure JS, no build-time requirements for end users
26
+
27
+ ## Bundle Size
28
+
29
+ | Module | Size |
30
+ |--------|------|
31
+ | Template | 4.5 KB |
32
+ | Core | 10.7 KB |
33
+ | Router | 4.1 KB |
34
+ | i18n | 1.4 KB |
35
+ | Theme | 4.0 KB |
36
+ | Full | 20.1 KB |
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ npm install @ahriknow/lux
42
+ ```
43
+
44
+ ## Quick Start
45
+
46
+ ```javascript
47
+ import { html, css, LuxElement, registerComponent } from '@ahriknow/lux';
48
+
49
+ class MyCounter extends LuxElement {
50
+ static styles = css`
51
+ :host { display: flex; gap: 12px; align-items: center; }
52
+ button { padding: 8px 16px; border-radius: 6px; cursor: pointer; }
53
+ `;
54
+
55
+ static properties = { count: { type: Number } };
56
+
57
+ constructor() {
58
+ super();
59
+ this.count = 0;
60
+ }
61
+
62
+ render() {
63
+ return html`
64
+ <button @click=${() => this.count--}>-</button>
65
+ <span>${this.count}</span>
66
+ <button @click=${() => this.count++}>+</button>
67
+ `;
68
+ }
69
+ }
70
+
71
+ registerComponent('my-counter', MyCounter);
72
+ ```
73
+
74
+ ## Template Bindings
75
+
76
+ | Syntax | Type | Description |
77
+ |--------|------|-------------|
78
+ | `${value}` | Text | Text interpolation |
79
+ | `@click=${fn}` | Event | Event listener |
80
+ | `.value=${val}` | Property | Property binding |
81
+ | `?hidden=${bool}` | Boolean | Attribute toggle |
82
+ | `class=${classMap({...})}` | Class | Class binding |
83
+ | `style=${styleMap({...})}` | Style | Style binding |
84
+ | `ref=${fn}` | Ref | Element reference |
85
+
86
+ ## Directives
87
+
88
+ - `repeat(items, keyFn, renderFn)` — Keyed list rendering
89
+ - `when(condition, trueFn, falseFn?)` — Conditional rendering
90
+ - `show(condition)` — Display toggle (`""` or `"none"`)
91
+ - `nothing` — Symbol to clear a container
92
+
93
+ ## Router
94
+
95
+ ```javascript
96
+ import { createRouter } from '@ahriknow/lux';
97
+
98
+ createRouter({
99
+ routes: [
100
+ { path: '/', component: HomePage, redirect: '/home', children: [
101
+ { path: '/home', component: () => import('./home.js') },
102
+ { path: '/users/:id', component: () => import('./profile.js') },
103
+ ]}
104
+ ]
105
+ });
106
+ ```
107
+
108
+ ## i18n
109
+
110
+ ```javascript
111
+ import { createI18n, msg } from '@ahriknow/lux';
112
+
113
+ createI18n({
114
+ locale: 'en',
115
+ messages: {
116
+ 'en': { hello: 'Hello', items: '{count, plural, =0{No items} other{# items}}' },
117
+ 'ru': { hello: 'Привет', items: '{count, plural, =0{Нет элементов} other{# элементов}}' },
118
+ }
119
+ });
120
+
121
+ msg('hello'); // "Hello"
122
+ msg('items', { count: 5 }); // "5 items"
123
+ ```
124
+
125
+ ## License
126
+
127
+ [MIT](./LICENSE)
@@ -0,0 +1,127 @@
1
+ <div align="center">
2
+
3
+ # Lux
4
+
5
+ [English](./README.md) | **中文**
6
+
7
+ 轻量级 Web Components 框架,提供响应式属性、模板引擎、路由和国际化。
8
+
9
+ [![npm version](https://img.shields.io/npm/v/@ahriknow/lux.svg)](https://www.npmjs.com/package/@ahriknow/lux)
10
+ [![license](https://img.shields.io/npm/l/@ahriknow/lux.svg)](./LICENSE)
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## 特性
17
+
18
+ - **响应式属性** — 声明 `static properties`,Lux 自动处理变更检测、批量更新和增量 DOM 操作
19
+ - **Shadow DOM 样式** — `static styles` 配合 `css` 标签模板,通过 `adoptedStyleSheets` 注入
20
+ - **模板引擎** — 标签模板字面量,支持事件、属性、布尔、类名和样式绑定
21
+ - **repeat() 指令** — 带键列表渲染,O(n) 差异算法
22
+ - **路由** — 基于 Hash 的 SPA 路由,支持参数、嵌套路由、懒加载和路由守卫
23
+ - **国际化** — ICU MessageFormat,数字/日期格式化
24
+ - **主题系统** — CSS 自定义属性,支持亮色/暗色主题
25
+ - **零依赖** — 纯 JS 实现,无需构建工具
26
+
27
+ ## 包体积
28
+
29
+ | 模块 | 大小 |
30
+ |------|------|
31
+ | Template | 4.5 KB |
32
+ | Core | 10.7 KB |
33
+ | Router | 4.1 KB |
34
+ | i18n | 1.4 KB |
35
+ | Theme | 4.0 KB |
36
+ | 完整包 | 20.1 KB |
37
+
38
+ ## 安装
39
+
40
+ ```bash
41
+ npm install @ahriknow/lux
42
+ ```
43
+
44
+ ## 快速开始
45
+
46
+ ```javascript
47
+ import { html, css, LuxElement, registerComponent } from '@ahriknow/lux';
48
+
49
+ class MyCounter extends LuxElement {
50
+ static styles = css`
51
+ :host { display: flex; gap: 12px; align-items: center; }
52
+ button { padding: 8px 16px; border-radius: 6px; cursor: pointer; }
53
+ `;
54
+
55
+ static properties = { count: { type: Number } };
56
+
57
+ constructor() {
58
+ super();
59
+ this.count = 0;
60
+ }
61
+
62
+ render() {
63
+ return html`
64
+ <button @click=${() => this.count--}>-</button>
65
+ <span>${this.count}</span>
66
+ <button @click=${() => this.count++}>+</button>
67
+ `;
68
+ }
69
+ }
70
+
71
+ registerComponent('my-counter', MyCounter);
72
+ ```
73
+
74
+ ## 模板绑定
75
+
76
+ | 语法 | 类型 | 说明 |
77
+ |------|------|------|
78
+ | `${value}` | 文本 | 文本插值 |
79
+ | `@click=${fn}` | 事件 | 事件监听 |
80
+ | `.value=${val}` | 属性 | 属性绑定 |
81
+ | `?hidden=${bool}` | 布尔 | 属性开关 |
82
+ | `class=${classMap({...})}` | 类名 | 类名绑定 |
83
+ | `style=${styleMap({...})}` | 样式 | 样式绑定 |
84
+ | `ref=${fn}` | 引用 | 元素引用 |
85
+
86
+ ## 指令
87
+
88
+ - `repeat(items, keyFn, renderFn)` — 带键列表渲染
89
+ - `when(condition, trueFn, falseFn?)` — 条件渲染
90
+ - `show(condition)` — 显示切换(`""` 或 `"none"`)
91
+ - `nothing` — Symbol,清空容器
92
+
93
+ ## 路由
94
+
95
+ ```javascript
96
+ import { createRouter } from '@ahriknow/lux';
97
+
98
+ createRouter({
99
+ routes: [
100
+ { path: '/', component: HomePage, redirect: '/home', children: [
101
+ { path: '/home', component: () => import('./home.js') },
102
+ { path: '/users/:id', component: () => import('./profile.js') },
103
+ ]}
104
+ ]
105
+ });
106
+ ```
107
+
108
+ ## 国际化
109
+
110
+ ```javascript
111
+ import { createI18n, msg } from '@ahriknow/lux';
112
+
113
+ createI18n({
114
+ locale: 'zh-CN',
115
+ messages: {
116
+ 'zh-CN': { hello: '你好', items: '{count, plural, =0{没有} other{# 个}}' },
117
+ 'en': { hello: 'Hello', items: '{count, plural, =0{none} other{# items}}' },
118
+ }
119
+ });
120
+
121
+ msg('hello'); // "你好"
122
+ msg('items', { count: 5 }); // "5 个"
123
+ ```
124
+
125
+ ## 许可证
126
+
127
+ [MIT](./LICENSE)
@@ -0,0 +1,292 @@
1
+ var LuxButton=function(){"use strict";const t=Symbol.for("lux-nothing");function e(t,...e){return{_$luxType$:1,strings:t,values:e}}function r(t,...e){return{_$luxType$:3,strings:t,values:e}}function o(t){return t&&void 0!==t._$luxType$}const n=/(?:([@.?][\w-]+)|(ref)|(class))=\s*$/;function s(e,r,n){if(r!==t&&null!=r)if(function(t){return t&&"repeat"===t._type}(r))!function(t,e){const{items:r,keyFn:n,renderFn:s}=e,i=t._repeatState;if(i)for(const t of i.entries)t.span&&t.span.parentNode&&t.span.parentNode.removeChild(t.span);const a=document.createDocumentFragment(),l=[];for(const t of r){const e=n(t),r=s(t),i=document.createElement("span");i.style.display="contents",o(r)?c(r,i):null!=r&&!1!==r&&i.appendChild(document.createTextNode(String(r))),a.appendChild(i),l.push({key:e,result:r,span:i})}t.appendChild(a),t._repeatState={entries:l}}(e,r);else if(o(r))c(r,e);else if(Array.isArray(r)){i(e);for(const t of r)if(o(t)){const r=document.createElement("span");r.style.display="contents",c(t,r),e.appendChild(r)}else t instanceof Node?e.appendChild(t):null!=t&&!1!==t&&e.appendChild(document.createTextNode(String(t)))}else{if(r instanceof Node)return i(e),void e.appendChild(r);1===e.childNodes.length&&e.firstChild.nodeType===Node.TEXT_NODE?e.firstChild.textContent=String(r):(i(e),e.appendChild(document.createTextNode(String(r))))}else i(e)}function i(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function a(e,r){const{element:o,name:n,prefix:s}=e;switch(s){case"@":{const s=e.committedValue,i=null==r||r===t,a=i&&null!=s||r?.capture!==s?.capture||r?.once!==s?.once||r?.passive!==s?.passive,c=!i&&(null==s||a);if(a&&o.removeEventListener(n,e._handler||s,s),c)if("function"==typeof r){const t=e._host||(e._host={handleEvent(t){const r=e.committedValue;if("function"==typeof r){const e=o.getRootNode().host||o;r.call(e,t)}}});e._handler=t,o.addEventListener(n,t)}else if("object"==typeof r&&r?.handleEvent){const t={handleEvent:t=>r.handleEvent.call(r,t)};e._handler=t,o.addEventListener(n,t,{capture:r.capture,once:r.once,passive:r.passive})}e.committedValue=r;break}case".":o[n]=r===t?void 0:r;break;case"?":o.toggleAttribute(n,!!r);break;case"ref":"function"==typeof r&&r(o);break;case"class":if("string"==typeof r)o.className=r;else if("object"==typeof r&&null!=r){const t=o.className||"",e=t?t.split(/\s+/):[];for(const[t,o]of Object.entries(r))if(o)e.includes(t)||e.push(t);else{const r=e.indexOf(t);-1!==r&&e.splice(r,1)}o.className=e.filter(Boolean).join(" ")}break;default:null==r||!1===r?o.removeAttribute(n):o.setAttribute(n,!0===r?"":String(r))}}function c(t,e,r){if(!o(t))return void(e.textContent=t??"");const{strings:i,values:c}=t;if(e._luxActiveParts&&e._luxStrings===i){for(const t of e._luxActiveParts)t.index<c.length&&("child"===t.type?s(t.span,c[t.index]):a(t,c[t.index]));return}const l=document.createElement("template"),h=function(t){const e=[];let r="";for(let o=0;o<t.length;o++)if(r+=t[o],o<t.length-1){const t=r.match(n);if(t){const n=t[1],s=!!t[2],i=!!t[3];let a="",c="";n?(a=n[0],c=n.slice(1)):s?(a="ref",c="ref"):i&&(a="class",c="class");const l=`lux-attr-${o}`;r=r.slice(0,-t[0].length)+`${l}="${c}" `,e.push({type:"attr",name:c,prefix:a,marker:l,index:o})}else{const t=`lux-${o}`;r+=`\x3c!--${t}--\x3e`,e.push({type:"child",marker:t,index:o})}}return{html:r,parts:e}}(i);l.innerHTML=h.html;const d=l.content.cloneNode(!0),p=[];for(const t of h.parts)if("child"===t.type){const e=document.createTreeWalker(d,NodeFilter.SHOW_COMMENT);let r;for(;r=e.nextNode();)if(r.data===t.marker){const e=document.createElement("span");e.style.display="contents",r.parentNode.replaceChild(e,r),s(e,c[t.index]),p.push({type:"child",span:e,index:t.index});break}}else{const e=d.querySelector(`[${t.marker}]`);if(e){e.removeAttribute(t.marker);const r={type:"attr",element:e,name:t.name,prefix:t.prefix,index:t.index,committedValue:void 0};a(r,c[t.index]),p.push(r)}}e.textContent="",e.appendChild(d),e._luxActiveParts=p,e._luxStrings=i}const l=new Set;let h=!1;function d(t){var e;l.add(t),h||(h=!0,e=()=>{h=!1;const t=[...l];l.clear();for(const e of t)e._$performUpdate()},Promise.resolve().then(e))}const p={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?null:JSON.stringify(t);default:return t}},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return Number(t);case Object:case Array:try{return JSON.parse(t)}catch{return null}default:return t}}};class u extends HTMLElement{static properties={};static styles=void 0;static finalized=!1;static elementProperties=new Map;static __prepare(){if(this.hasOwnProperty("elementProperties"))return;const t=Object.getPrototypeOf(this);t.finalize&&t.finalize(),this.elementProperties=new Map(t.elementProperties)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap?[...this.__attributeToPropertyMap.keys()]:[]}static finalize(){if(!this.hasOwnProperty("finalized")){if(this.finalized=!0,this.__prepare(),this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of e)this.createProperty(r,t[r])}this.__attributeToPropertyMap=new Map;for(const[t,e]of this.elementProperties){const r=this.__attributeNameForProperty(t,e);void 0!==r&&this.__attributeToPropertyMap.set(r,t)}this.elementStyles=this.styles}}static __attributeNameForProperty(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.replace(/([A-Z])/g,"-$1").toLowerCase():void 0}static createProperty(t,e={}){if(this.__prepare(),!this.elementProperties.has(t)&&(e.state&&(e={...e,attribute:!1}),this.elementProperties.set(t,e),!e.noAccessor)){const r=Symbol(),o=this.getPropertyDescriptor(t,r,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,r){const{type:o,reflect:n,converter:s}=r;return{get(){return this[e]},set(o){const n=this[e];this[e]=o,this.requestUpdate(t,n,r)},configurable:!0,enumerable:!0}}static _initializers=[];static addInitializer(t){this._initializers=[...this._initializers||[],t]}static shadowRootOptions={mode:"open"};constructor(){super(),this.__updatePending=!1,this.__hasUpdated=!1,this.__controllers=new Set,this.__reflectingProperty=null,this.constructor.hasOwnProperty("finalized")||this.constructor.finalize(),this.__saveInstanceProperties(),this.requestUpdate();for(const t of this.constructor._initializers||[])t(this)}__saveInstanceProperties(){const t=this.constructor.elementProperties;if(t)for(const[e,r]of t)if(!r.noAccessor&&this.hasOwnProperty(e)){const t=this[e];delete this[e],this.__instancePropertyValues=this.__instancePropertyValues||new Map,this.__instancePropertyValues.set(e,t)}}connectedCallback(){this.__controllers.forEach(t=>t.hostConnected?.()),this.constructor.hasOwnProperty("finalized")||this.constructor.finalize();const t=this.constructor.__attributeToPropertyMap;if(t)for(const[e,r]of t){const t=this.getAttribute(e);if(null!==t){const e=this.constructor.elementProperties.get(r);if(e){const o=e.converter?.fromAttribute??p.fromAttribute;this[r]=o(t,e.type)}}}if(this.__instancePropertyValues){for(const[t,e]of this.__instancePropertyValues)this[t]=e;this.__instancePropertyValues=void 0}this.renderRoot,this.__hasUpdated||this.requestUpdate()}disconnectedCallback(){this.__controllers.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){const o=this.constructor.__attributeToPropertyMap?.get(t);if(void 0!==o&&this.__reflectingProperty!==o){const t=this.constructor.elementProperties.get(o);if(t){const e="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:p;this.__reflectingProperty=o;const n=e.fromAttribute(r,t.type);this[o]=n,this.__reflectingProperty=null}}}get renderRoot(){return this._renderRoot||(this._renderRoot=this.createRenderRoot(),this.__adoptStyles()),this._renderRoot}createRenderRoot(){return this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions)}__adoptStyles(){const t=this.constructor.elementStyles;if(!t)return;const e=Array.isArray(t)?t:[t],r=[];for(const t of e)"string"==typeof t?r.push(t):o(t)&&r.push(t.strings.join(""));if(0!==r.length)if(void 0!==this._renderRoot.adoptedStyleSheets){const t=new CSSStyleSheet;t.replaceSync(r.join("\n")),this._renderRoot.adoptedStyleSheets=[...this._renderRoot.adoptedStyleSheets,t]}else{const t=document.createElement("style");t.textContent=r.join("\n"),this._renderRoot.appendChild(t)}}enableUpdating(t){}get updateComplete(){return this.__updateCompletePromise??Promise.resolve()}get hasUpdated(){return this.__hasUpdated}get isUpdatePending(){return this.__updatePending}requestUpdate(t,e,r){if(void 0!==t){if(!(r?.hasChanged??((t,e)=>!Object.is(t,e)))(this[t],e))return}this.__updatePending||(this.__updatePending=!0,d(this))}async performUpdate(){if(this.isUpdatePending){this.__updatePending=!1,this.willUpdate(new Map),this.__controllers.forEach(t=>t.hostUpdate?.()),this.update(new Map),this.__hasUpdated=!0;for(const[t,e]of this.constructor.elementProperties)if(e.reflect){const r=this[t],o=e.converter?.toAttribute??p.toAttribute,n=this.constructor.__attributeNameForProperty(t,e);if(void 0!==n){this.__reflectingProperty=t;const s=o(r,e.type);null==s?this.removeAttribute(n):this.setAttribute(n,String(s)),this.__reflectingProperty=null}}this.__controllers.forEach(t=>t.hostUpdated?.()),this.firstUpdated(new Map),this.updated(new Map)}}_$performUpdate(){this.performUpdate()}shouldUpdate(t){return!0}willUpdate(t){}update(t){const e=this.render();e&&c(e,this.renderRoot)}render(){return e``}firstUpdated(t){}updated(t){}propertyChangedCallback(t,e,r){}addController(t){this.__controllers.add(t),this.isConnected&&t.hostConnected?.()}removeController(t){this.__controllers.delete(t)}emit(t,e,r={}){return this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,...r}))}$(t){return this.renderRoot.querySelector(t)}$$(t){return this.renderRoot.querySelectorAll(t)}}function v(t,e){if(!t.includes("-"))throw new Error(`Component name must contain a hyphen: ${t}`);customElements.get(t)||customElements.define(t,e)}const b={check:'<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/>',content_copy:'<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/>',close:'<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>',search:'<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>',menu:'<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>',arrow_back:'<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>',arrow_forward:'<path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"/>',add:'<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>',remove:'<path d="M19 13H5v-2h14v2z"/>',edit:'<path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',delete:'<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>',home:'<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>',settings:'<path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/>',star:'<path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>',heart:'<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>',share:'<path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"/>',link:'<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.1 0-2-.9-2-2s.9-2 2-2h4v-1.9H7c-2.76 0-5 2.24-5 5zm7-3h4v1.9h-4V9zm3.9 6h-4v1.9h4c1.1 0 2-.9 2-2s-.9-2-2-2h-4v-1.9h4c2.76 0 5 2.24 5 5s-2.24 5-5 5z"/>',download:'<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>',upload:'<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/>',refresh:'<path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.73 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>',more_vert:'<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>',more_horiz:'<path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm8 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm8 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>',expand_more:'<path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/>',expand_less:'<path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"/>',visibility:'<path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/>',visibility_off:'<path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.12 2.12C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.21.53-2.76 0-5-2.24-5-5 0-.8.2-1.54.53-2.21zm4.21-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/>',info:'<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>',warning:'<path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/>',error_outline:'<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>',help_outline:'<path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 1-2.5 3-5V8c-1.1 0-2-.9-2-2zm0 10c-.59 0-1-.51-1-1s.41-1 1-1 1 .51 1 1-.41 1-1 1z"/>',light_mode:'<path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"/>',dark_mode:'<path d="M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49zM12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"/>',view_quilt:'<path d="M3 3v8h8V3H3zm6 6H5V5h4v4zm-6 4v8h8v-8H3zm6 6H5v-4h4v4zm4-16v8h8V3h-8zm6 6h-4V5h4v4zm-6 4v8h8v-8h-8zm6 6h-4v-4h4v4z"/>',code:'<path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0L19.2 12l-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/>',toggle_on:'<path d="M6 7h12a5 5 0 010 10H6a5 5 0 010-10z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="18" cy="12" r="3"/>',swap_vert:'<path d="M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"/>',arrow_down:'<path d="M3 8l9 9 9-9H3z"/>',language:'<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"/>',smart_button:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/>',table_chart:'<path d="M3 3v18h18V3H3zm8 16H5v-6h6v6zm0-8H5V5h6v6zm8 8h-6v-6h6v6zm0-8h-6V5h6v6z"/>',check_circle:'<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>',cancel:'<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/>',pause:'<path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>',play:'<path d="M8 5v14l11-7z"/>',stop:'<path d="M6 6h12v12H6z"/>',save:'<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>',folder:'<path d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/>',file:'<path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/>',email:'<path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>',person:'<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>',lock:'<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>',filter:'<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>',sort:'<path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/>',calendar:'<path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11z"/>',map:'<path d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"/>',camera:'<path d="M12 12m-3.2 0a3.2 3.2 0 1 0 6.4 0a3.2 3.2 0 1 0-6.4 0M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/>',bookmark:'<path d="M17 3H7c-1.1 0-2 .9-2 2v16l7-3 7 3V5c0-1.1-.9-2-2-2z"/>',clock:'<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>',chat:'<path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/>',phone:'<path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/>',notification:'<path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/>',cloud:'<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/>',download_done:'<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>',github:'<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>',npm:'<path d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/>'},f=r`
2
+ :host {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ width: 1em;
7
+ height: 1em;
8
+ vertical-align: middle;
9
+ fill: currentColor;
10
+ flex-shrink: 0;
11
+ }
12
+
13
+ :host([size]) {
14
+ width: var(--icon-size);
15
+ height: var(--icon-size);
16
+ }
17
+
18
+ svg {
19
+ width: 100%;
20
+ height: 100%;
21
+ }
22
+ `;v("lux-icon",class extends u{static styles=f;static properties={name:{type:String,reflect:!0},size:{type:String,reflect:!0},color:{type:String,reflect:!0}};constructor(){super()}updated(){this.size&&this.style.setProperty("--icon-size",this._parseSize(this.size)),this.color&&(this.style.color=this.color);const t=this.renderRoot.querySelector(".icon-svg");t&&this.name&&b[this.name]&&(t.innerHTML=b[this.name])}_parseSize(t){return null==t?"":"number"==typeof t||/^\d+(\.\d+)?$/.test(t)?t+"px":t}render(){return this.childNodes.length>0?e`<slot></slot>`:this.name&&b[this.name]?e`<svg class="icon-svg" viewBox="0 0 24 24"></svg>`:e`<span style="font-size:0.75em;font-weight:600">${this.name||"?"}</span>`}});const g=r`
23
+ :host {
24
+ display: inline-flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ cursor: pointer;
28
+ vertical-align: middle;
29
+ user-select: none;
30
+ -webkit-tap-highlight-color: transparent;
31
+ font-family: inherit;
32
+ }
33
+ :host([block]) {
34
+ display: flex;
35
+ width: 100%;
36
+ }
37
+
38
+ /* ── Base ── */
39
+ .btn {
40
+ display: inline-flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ gap: var(--btn-gap, 8px);
44
+ padding: var(--btn-py, 6px) var(--btn-px, 16px);
45
+ border: 1px solid transparent;
46
+ border-radius: var(--btn-radius, 6px);
47
+ font-size: var(--btn-font, 13px);
48
+ font-weight: 500;
49
+ line-height: 1;
50
+ cursor: pointer;
51
+ transition: all var(--lux-transition, 150ms ease);
52
+ white-space: nowrap;
53
+ }
54
+ :host(:not([block])) .btn {
55
+ width: 100%;
56
+ box-sizing: border-box;
57
+ }
58
+ .btn:active {
59
+ transform: translateY(1px);
60
+ }
61
+
62
+ /* ── Default (primary solid) ── */
63
+ .btn {
64
+ background: rgb(var(--lux-primary-500));
65
+ color: #fff;
66
+ border-color: rgb(var(--lux-primary-500));
67
+ }
68
+ .btn:hover {
69
+ background: rgb(var(--lux-primary-600));
70
+ border-color: rgb(var(--lux-primary-600));
71
+ }
72
+ .btn:active {
73
+ background: rgb(var(--lux-primary-700));
74
+ }
75
+
76
+ /* ── Color variants (solid) ── */
77
+ :host([variant='secondary']) .btn {
78
+ background: rgb(var(--lux-card));
79
+ color: rgb(var(--lux-text));
80
+ border-color: rgb(var(--lux-border));
81
+ }
82
+ :host([variant='secondary']) .btn:hover {
83
+ background: rgb(var(--lux-hover));
84
+ border-color: rgb(var(--lux-border-hover));
85
+ }
86
+
87
+ :host([variant='success']) .btn {
88
+ background: rgb(var(--lux-success));
89
+ color: #fff;
90
+ border-color: rgb(var(--lux-success));
91
+ }
92
+ :host([variant='success']) .btn:hover {
93
+ background: rgb(22 163 74);
94
+ }
95
+
96
+ :host([variant='warning']) .btn {
97
+ background: rgb(var(--lux-warning));
98
+ color: #fff;
99
+ border-color: rgb(var(--lux-warning));
100
+ }
101
+ :host([variant='warning']) .btn:hover {
102
+ background: rgb(217 119 6);
103
+ }
104
+
105
+ :host([variant='error']) .btn,
106
+ :host([variant='danger']) .btn {
107
+ background: rgb(var(--lux-error));
108
+ color: #fff;
109
+ border-color: rgb(var(--lux-error));
110
+ }
111
+ :host([variant='error']) .btn:hover,
112
+ :host([variant='danger']) .btn:hover {
113
+ background: rgb(239 68 68);
114
+ }
115
+
116
+ :host([variant='info']) .btn {
117
+ background: rgb(var(--lux-info));
118
+ color: #fff;
119
+ border-color: rgb(var(--lux-info));
120
+ }
121
+ :host([variant='info']) .btn:hover {
122
+ background: rgb(37 99 235);
123
+ }
124
+
125
+ /* ── Outline (transparent bg, colored border/text) ── */
126
+ :host([outline]) .btn {
127
+ background: transparent;
128
+ color: rgb(var(--lux-primary-500));
129
+ border-color: rgb(var(--lux-primary-500));
130
+ }
131
+ :host([outline]) .btn:hover {
132
+ background: rgb(var(--lux-primary-500) / 10%);
133
+ }
134
+ :host([outline]) .btn:active {
135
+ background: rgb(var(--lux-primary-500) / 18%);
136
+ }
137
+
138
+ :host([outline][variant='secondary']) .btn {
139
+ color: rgb(var(--lux-text));
140
+ border-color: rgb(var(--lux-border));
141
+ }
142
+ :host([outline][variant='secondary']) .btn:hover {
143
+ background: rgb(var(--lux-hover));
144
+ }
145
+
146
+ :host([outline][variant='success']) .btn {
147
+ color: rgb(var(--lux-success));
148
+ border-color: rgb(var(--lux-success));
149
+ }
150
+ :host([outline][variant='success']) .btn:hover {
151
+ background: rgb(var(--lux-success) / 10%);
152
+ }
153
+
154
+ :host([outline][variant='warning']) .btn {
155
+ color: rgb(var(--lux-warning));
156
+ border-color: rgb(var(--lux-warning));
157
+ }
158
+ :host([outline][variant='warning']) .btn:hover {
159
+ background: rgb(var(--lux-warning) / 10%);
160
+ }
161
+
162
+ :host([outline][variant='error']) .btn,
163
+ :host([outline][variant='danger']) .btn {
164
+ color: rgb(var(--lux-error));
165
+ border-color: rgb(var(--lux-error));
166
+ }
167
+ :host([outline][variant='error']) .btn:hover,
168
+ :host([outline][variant='danger']) .btn:hover {
169
+ background: rgb(var(--lux-error) / 10%);
170
+ }
171
+
172
+ :host([outline][variant='info']) .btn {
173
+ color: rgb(var(--lux-info));
174
+ border-color: rgb(var(--lux-info));
175
+ }
176
+ :host([outline][variant='info']) .btn:hover {
177
+ background: rgb(var(--lux-info) / 10%);
178
+ }
179
+
180
+ /* ── Ghost (transparent, no border, colored text) ── */
181
+ :host([ghost]) .btn {
182
+ background: transparent;
183
+ border-color: transparent;
184
+ color: rgb(var(--lux-primary-500));
185
+ }
186
+ :host([ghost]) .btn:hover {
187
+ background: rgb(var(--lux-primary-500) / 10%);
188
+ }
189
+ :host([ghost]) .btn:active {
190
+ background: rgb(var(--lux-primary-500) / 18%);
191
+ }
192
+
193
+ :host([ghost][variant='secondary']) .btn {
194
+ color: rgb(var(--lux-text));
195
+ }
196
+ :host([ghost][variant='secondary']) .btn:hover {
197
+ background: rgb(var(--lux-hover));
198
+ }
199
+
200
+ :host([ghost][variant='success']) .btn {
201
+ color: rgb(var(--lux-success));
202
+ }
203
+ :host([ghost][variant='success']) .btn:hover {
204
+ background: rgb(var(--lux-success) / 10%);
205
+ }
206
+
207
+ :host([ghost][variant='warning']) .btn {
208
+ color: rgb(var(--lux-warning));
209
+ }
210
+ :host([ghost][variant='warning']) .btn:hover {
211
+ background: rgb(var(--lux-warning) / 10%);
212
+ }
213
+
214
+ :host([ghost][variant='error']) .btn,
215
+ :host([ghost][variant='danger']) .btn {
216
+ color: rgb(var(--lux-error));
217
+ }
218
+ :host([ghost][variant='error']) .btn:hover,
219
+ :host([ghost][variant='danger']) .btn:hover {
220
+ background: rgb(var(--lux-error) / 10%);
221
+ }
222
+
223
+ :host([ghost][variant='info']) .btn {
224
+ color: rgb(var(--lux-info));
225
+ }
226
+ :host([ghost][variant='info']) .btn:hover {
227
+ background: rgb(var(--lux-info) / 10%);
228
+ }
229
+
230
+ /* ── Size ── */
231
+ :host([size='sm']) .btn {
232
+ --btn-py: 4px;
233
+ --btn-px: 12px;
234
+ --btn-font: 12px;
235
+ --btn-gap: 4px;
236
+ }
237
+ :host([size='lg']) .btn {
238
+ --btn-py: 10px;
239
+ --btn-px: 20px;
240
+ --btn-font: 15px;
241
+ --btn-gap: 10px;
242
+ }
243
+
244
+ /* ── Shape: circle ── */
245
+ :host([shape='circle']) .btn {
246
+ border-radius: 50%;
247
+ --btn-px: 0;
248
+ width: var(--icon-size, 36px);
249
+ height: var(--icon-size, 36px);
250
+ padding: 0;
251
+ }
252
+ :host([shape='circle'][size='sm']) .btn {
253
+ --icon-size: 32px;
254
+ }
255
+ :host([shape='circle'][size='lg']) .btn {
256
+ --icon-size: 44px;
257
+ }
258
+
259
+ /* ── Shape: square ── */
260
+ :host([shape='square']) .btn {
261
+ --btn-px: 0;
262
+ width: var(--icon-size, 36px);
263
+ height: var(--icon-size, 36px);
264
+ padding: 0;
265
+ }
266
+ :host([shape='square'][size='sm']) .btn {
267
+ --icon-size: 32px;
268
+ }
269
+ :host([shape='square'][size='lg']) .btn {
270
+ --icon-size: 44px;
271
+ }
272
+
273
+ /* ── Loading ── */
274
+ .spinner {
275
+ width: 1em;
276
+ height: 1em;
277
+ border: 2px solid currentColor;
278
+ border-top-color: transparent;
279
+ border-radius: 50%;
280
+ animation: lux-spin 0.6s linear infinite;
281
+ }
282
+ @keyframes lux-spin {
283
+ to {
284
+ transform: rotate(360deg);
285
+ }
286
+ }
287
+ `;class m extends u{static styles=g;static properties={variant:{type:String,reflect:!0},size:{type:String,reflect:!0},shape:{type:String,reflect:!0},icon:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},block:{type:Boolean,reflect:!0},outline:{type:Boolean,reflect:!0},ghost:{type:Boolean,reflect:!0}};constructor(){super(),this.variant="primary",this.size="md"}render(){const t=!!this.icon;return e`
288
+ <div class="btn">
289
+ ${this.loading?e`<span class="spinner"></span>`:t?e`<lux-icon name=${this.icon}></lux-icon>`:""}
290
+ ${t?"":e`<slot></slot>`}
291
+ </div>
292
+ `}}return v("lux-button",m),m}();