@redvars/peacock 3.1.1 → 3.1.2

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 (132) hide show
  1. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.css.js.map +1 -1
  2. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.d.ts +19 -0
  3. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js +19 -0
  4. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/avatar.js.map +1 -1
  5. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.d.ts +0 -7
  6. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.js +0 -7
  7. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/avatar/p-avatar.js.map +1 -1
  8. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.css.js +5 -4
  9. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.css.js.map +1 -1
  10. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.d.ts +15 -1
  11. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js +27 -10
  12. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/badge.js.map +1 -1
  13. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.d.ts +0 -5
  14. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.js +0 -5
  15. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/badge/p-badge.js.map +1 -1
  16. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.css.d.ts +1 -0
  17. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.css.js +12 -0
  18. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.css.js.map +1 -0
  19. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.d.ts +27 -0
  20. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.js +58 -0
  21. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/clock.js.map +1 -0
  22. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/index.d.ts +1 -0
  23. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/index.js +2 -0
  24. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/clock/index.js.map +1 -0
  25. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.css.d.ts +1 -0
  26. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.css.js +58 -0
  27. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.css.js.map +1 -0
  28. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.d.ts +28 -0
  29. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.js +68 -0
  30. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/divider.js.map +1 -0
  31. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/index.d.ts +1 -0
  32. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/index.js +2 -0
  33. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/divider/index.js.map +1 -0
  34. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.d.ts +21 -1
  35. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js +16 -0
  36. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/icon.js.map +1 -1
  37. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.d.ts +0 -7
  38. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.js +0 -7
  39. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/icon/p-icon.js.map +1 -1
  40. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.d.ts +2 -0
  41. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js +2 -0
  42. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/index.js.map +1 -1
  43. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js +12 -2
  44. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/peacock-loader.js.map +1 -1
  45. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.d.ts +1 -0
  46. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js +32 -0
  47. package/.rollup.cache/E/git/redvars/peacock/components/dist/src/utils.js.map +1 -1
  48. package/.rollup.cache/E/git/redvars/peacock/components/dist/tsconfig.tsbuildinfo +1 -1
  49. package/bin/typedoc-gen.mjs +64 -0
  50. package/custom-elements-manifest.config.mjs +5 -6
  51. package/demo/index.html +4 -5
  52. package/demo/int.html +2 -0
  53. package/dist/{component/avatar.js → avatar.js} +25 -19
  54. package/dist/avatar.js.map +1 -0
  55. package/dist/badge.js +89 -0
  56. package/dist/badge.js.map +1 -0
  57. package/dist/class-map-DpvLRi0h.js +11 -0
  58. package/dist/class-map-DpvLRi0h.js.map +1 -0
  59. package/dist/clock.js +70 -0
  60. package/dist/clock.js.map +1 -0
  61. package/dist/custom-elements-jsdocs.json +656 -0
  62. package/dist/directive-BKuZRRPO.js +9 -0
  63. package/dist/directive-BKuZRRPO.js.map +1 -0
  64. package/dist/divider.js +123 -0
  65. package/dist/divider.js.map +1 -0
  66. package/dist/{component/icon.js → icon.js} +20 -101
  67. package/dist/icon.js.map +1 -0
  68. package/dist/index.js +11 -67
  69. package/dist/index.js.map +1 -1
  70. package/dist/peacock-loader.js +21 -12
  71. package/dist/peacock-loader.js.map +1 -1
  72. package/dist/{directive-CKEA2P55.js → property-D4Kn9TsY.js} +6 -13
  73. package/dist/property-D4Kn9TsY.js.map +1 -0
  74. package/dist/src/avatar/avatar.d.ts +19 -0
  75. package/dist/src/avatar/p-avatar.d.ts +0 -7
  76. package/dist/src/badge/badge.d.ts +15 -1
  77. package/dist/src/badge/p-badge.d.ts +0 -5
  78. package/dist/src/clock/clock.css.d.ts +1 -0
  79. package/dist/src/clock/clock.d.ts +27 -0
  80. package/dist/src/clock/index.d.ts +1 -0
  81. package/dist/src/divider/divider.css.d.ts +1 -0
  82. package/dist/src/divider/divider.d.ts +28 -0
  83. package/dist/src/divider/index.d.ts +1 -0
  84. package/dist/src/icon/icon.d.ts +21 -1
  85. package/dist/src/icon/p-icon.d.ts +0 -7
  86. package/dist/src/index.d.ts +2 -0
  87. package/dist/src/utils.d.ts +1 -0
  88. package/dist/state-CxzmLNIi.js +10 -0
  89. package/dist/state-CxzmLNIi.js.map +1 -0
  90. package/dist/styleMixins.css-CivfMYtB.js +17 -0
  91. package/dist/styleMixins.css-CivfMYtB.js.map +1 -0
  92. package/dist/tsconfig.tsbuildinfo +1 -1
  93. package/dist/utils-_5no4mk7.js +128 -0
  94. package/dist/utils-_5no4mk7.js.map +1 -0
  95. package/package.json +8 -8
  96. package/readme.md +5 -17
  97. package/rollup.config.js +71 -37
  98. package/scratch.mjs +0 -0
  99. package/src/avatar/avatar.css.ts +1 -1
  100. package/src/avatar/avatar.ts +19 -0
  101. package/src/avatar/p-avatar.ts +0 -7
  102. package/src/badge/badge.css.ts +5 -4
  103. package/src/badge/badge.ts +30 -8
  104. package/src/badge/demo/index.html +9 -1
  105. package/src/badge/p-badge.ts +0 -5
  106. package/src/clock/clock.css.ts +12 -0
  107. package/src/clock/clock.ts +57 -0
  108. package/src/clock/demo/index.html +26 -0
  109. package/src/clock/index.ts +1 -0
  110. package/src/divider/demo/index.html +58 -0
  111. package/src/divider/divider.css.ts +58 -0
  112. package/src/divider/divider.ts +65 -0
  113. package/src/divider/index.ts +1 -0
  114. package/src/icon/icon.ts +21 -1
  115. package/src/icon/p-icon.ts +0 -7
  116. package/src/index.ts +2 -0
  117. package/src/peacock-loader.ts +12 -3
  118. package/src/utils.ts +43 -0
  119. package/assets/tokens.css +0 -522
  120. package/copyDesignFiles.js +0 -11
  121. package/custom-elements.md +0 -192
  122. package/dist/avatar-GQwWRGRw.js +0 -418
  123. package/dist/avatar-GQwWRGRw.js.map +0 -1
  124. package/dist/avatar-jfcIDB8G.js +0 -424
  125. package/dist/avatar-jfcIDB8G.js.map +0 -1
  126. package/dist/component/avatar.js.map +0 -1
  127. package/dist/component/icon.js.map +0 -1
  128. package/dist/directive-CKEA2P55.js.map +0 -1
  129. package/dist/utils-CSwoJIcG.js +0 -171
  130. package/dist/utils-CSwoJIcG.js.map +0 -1
  131. package/dist/web-types.json +0 -78
  132. package/readme-gen.mjs +0 -24
@@ -1,192 +0,0 @@
1
- # `src/avatar/avatar.ts`:
2
-
3
- ## class: `Avatar`
4
-
5
- ### Superclass
6
-
7
- | Name | Module | Package |
8
- | ------------ | ------ | ------- |
9
- | `LitElement` | | lit |
10
-
11
- ### Fields
12
-
13
- | Name | Privacy | Type | Default | Description | Inherited From |
14
- | ------ | ------- | --------------------- | ------- | ----------- | -------------- |
15
- | `name` | | `string` | `''` | | |
16
- | `src` | | `string \| undefined` | | | |
17
-
18
- ### Attributes
19
-
20
- | Name | Field | Inherited From |
21
- | ------ | ----- | -------------- |
22
- | `name` | name | |
23
- | `src` | src | |
24
-
25
- <hr/>
26
-
27
- ## Exports
28
-
29
- | Kind | Name | Declaration | Module | Package |
30
- | ---- | -------- | ----------- | -------------------- | ------- |
31
- | `js` | `Avatar` | Avatar | src/avatar/avatar.ts | |
32
-
33
- # `src/avatar/p-avatar.ts`:
34
-
35
- ## class: `PAvatar`, `p-avatar`
36
-
37
- ### Superclass
38
-
39
- | Name | Module | Package |
40
- | -------- | --------------------- | ------- |
41
- | `Avatar` | /src/avatar/avatar.js | |
42
-
43
- ### Fields
44
-
45
- | Name | Privacy | Type | Default | Description | Inherited From |
46
- | ------ | ------- | --------------------- | ------- | ----------- | -------------- |
47
- | `name` | | `string` | `''` | | Avatar |
48
- | `src` | | `string \| undefined` | | | Avatar |
49
-
50
- ### Attributes
51
-
52
- | Name | Field | Inherited From |
53
- | ------ | ----- | -------------- |
54
- | `name` | name | Avatar |
55
- | `src` | src | Avatar |
56
-
57
- ### CSS Properties
58
-
59
- | Name | Default | Description |
60
- | --------------------------- | ------- | --------------------------------- |
61
- | `--avatar-background-color` | | Controls the color of the avatar. |
62
- | `--avatar-size` | | Controls the size of the avatar. |
63
-
64
- <hr/>
65
-
66
- ## Exports
67
-
68
- | Kind | Name | Declaration | Module | Package |
69
- | --------------------------- | ---------- | ----------- | ---------------------- | ------- |
70
- | `js` | `PAvatar` | PAvatar | src/avatar/p-avatar.ts | |
71
- | `custom-element-definition` | `p-avatar` | PAvatar | src/avatar/p-avatar.ts | |
72
-
73
- # `src/badge/badge.ts`:
74
-
75
- ## class: `Badge`
76
-
77
- ### Superclass
78
-
79
- | Name | Module | Package |
80
- | ------------ | ------ | ------- |
81
- | `LitElement` | | lit |
82
-
83
- ### Fields
84
-
85
- | Name | Privacy | Type | Default | Description | Inherited From |
86
- | ---------------- | ------- | --------------------- | ------- | ----------- | -------------- |
87
- | `name` | | `string` | `''` | | |
88
- | `src` | | `string \| undefined` | | | |
89
- | `slotHasContent` | | `boolean` | `false` | | |
90
-
91
- ### Attributes
92
-
93
- | Name | Field | Inherited From |
94
- | ------ | ----- | -------------- |
95
- | `name` | name | |
96
- | `src` | src | |
97
-
98
- <hr/>
99
-
100
- ## Exports
101
-
102
- | Kind | Name | Declaration | Module | Package |
103
- | ---- | ------- | ----------- | ------------------ | ------- |
104
- | `js` | `Badge` | Badge | src/badge/badge.ts | |
105
-
106
- # `src/icon/icon.ts`:
107
-
108
- ## class: `Icon`
109
-
110
- ### Superclass
111
-
112
- | Name | Module | Package |
113
- | ------------ | ------ | ------- |
114
- | `LitElement` | | lit |
115
-
116
- ### Fields
117
-
118
- | Name | Privacy | Type | Default | Description | Inherited From |
119
- | ---------- | ------- | --------------------------------------------- | -------------------- | ----------- | -------------- |
120
- | `name` | | `string \| undefined` | | | |
121
- | `src` | | `string \| undefined` | | | |
122
- | `provider` | | `'material-symbols' \| 'carbon' \| undefined` | `'material-symbols'` | | |
123
-
124
- ### Events
125
-
126
- | Name | Type | Description | Inherited From |
127
- | ------------ | ------------- | ----------- | -------------- |
128
- | `icon-error` | `CustomEvent` | | |
129
-
130
- ### Attributes
131
-
132
- | Name | Field | Inherited From |
133
- | ---------- | -------- | -------------- |
134
- | `name` | name | |
135
- | `src` | src | |
136
- | `provider` | provider | |
137
-
138
- <hr/>
139
-
140
- ## Exports
141
-
142
- | Kind | Name | Declaration | Module | Package |
143
- | ---- | ------ | ----------- | ---------------- | ------- |
144
- | `js` | `Icon` | Icon | src/icon/icon.ts | |
145
-
146
- # `src/icon/p-icon.ts`:
147
-
148
- ## class: `PIcon`, `p-icon`
149
-
150
- ### Superclass
151
-
152
- | Name | Module | Package |
153
- | ------ | ----------------- | ------- |
154
- | `Icon` | /src/icon/icon.js | |
155
-
156
- ### Fields
157
-
158
- | Name | Privacy | Type | Default | Description | Inherited From |
159
- | ---------- | ------- | --------------------------------------------- | -------------------- | ----------- | -------------- |
160
- | `name` | | `string \| undefined` | | | Icon |
161
- | `src` | | `string \| undefined` | | | Icon |
162
- | `provider` | | `'material-symbols' \| 'carbon' \| undefined` | `'material-symbols'` | | Icon |
163
-
164
- ### Events
165
-
166
- | Name | Type | Description | Inherited From |
167
- | ------------ | ------------- | ----------- | -------------- |
168
- | `icon-error` | `CustomEvent` | | Icon |
169
-
170
- ### Attributes
171
-
172
- | Name | Field | Inherited From |
173
- | ---------- | -------- | -------------- |
174
- | `name` | name | Icon |
175
- | `src` | src | Icon |
176
- | `provider` | provider | Icon |
177
-
178
- ### CSS Properties
179
-
180
- | Name | Default | Description |
181
- | -------------- | ------- | ------------------------------------------------- |
182
- | `--icon-color` | | Controls the color of the icon. |
183
- | `--icon-size` | `1rem` | Controls the size of the icon. Defaults to "1rem" |
184
-
185
- <hr/>
186
-
187
- ## Exports
188
-
189
- | Kind | Name | Declaration | Module | Package |
190
- | --------------------------- | -------- | ----------- | ------------------ | ------- |
191
- | `js` | `PIcon` | PIcon | src/icon/p-icon.ts | |
192
- | `custom-element-definition` | `p-icon` | PIcon | src/icon/p-icon.ts | |
@@ -1,418 +0,0 @@
1
- /******************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
16
-
17
-
18
- function __decorate(decorators, target, key, desc) {
19
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23
- }
24
-
25
- function __classPrivateFieldGet(receiver, state, kind, f) {
26
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
27
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
28
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
29
- }
30
-
31
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
32
- var e = new Error(message);
33
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
34
- };
35
-
36
- /**
37
- * @license
38
- * Copyright 2019 Google LLC
39
- * SPDX-License-Identifier: BSD-3-Clause
40
- */
41
- const t$3=globalThis,e$5=t$3.ShadowRoot&&(void 0===t$3.ShadyCSS||t$3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$5&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$4=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$3(o,t,s$2)},S$1=(s,o)=>{if(e$5)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$3.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$5?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
42
-
43
- /**
44
- * @license
45
- * Copyright 2017 Google LLC
46
- * SPDX-License-Identifier: BSD-3-Clause
47
- */const{is:i$3,defineProperty:e$4,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$3(t,s),b$1={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b$1){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$4(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$3(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.2");
48
-
49
- /**
50
- * @license
51
- * Copyright 2017 Google LLC
52
- * SPDX-License-Identifier: BSD-3-Clause
53
- */
54
- const t$2=globalThis,i$2=t=>t,s$1=t$2.trustedTypes,e$3=s$1?s$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,h="$lit$",o$3=`lit$${Math.random().toFixed(9).slice(2)}$`,n$1="?"+o$3,r$2=`<${n$1}>`,l=document,c=()=>l.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u=Array.isArray,d=t=>u(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b=x(1),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$3?e$3.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v?"!--"===u[1]?c=_:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p):void 0!==u[3]&&(c=p):c===p?">"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p:'"'===u[3]?$:g):c===$||c===g?c=p:c===_||c===m?c=v:(c=p,n=void 0);const x=c===p&&t[i+1].startsWith("/>")?" ":"";l+=c===v?s+r$2:d>=0?(e.push(a),s.slice(0,d)+h+s.slice(d)+o$3+x):s+o$3+(-2===d?i:x);}return [V(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h)){const i=v[a++],s=r.getAttribute(t).split(o$3),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I:"?"===e[1]?L:"@"===e[1]?z:H}),r.removeAttribute(t);}else t.startsWith(o$3)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$3),i=t.length-1;if(i>0){r.textContent=s$1?s$1.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c());}}}else if(8===r.nodeType)if(r.data===n$1)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$3,t+1));)d.push({type:7,index:l}),t+=o$3.length-1;}l++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function M(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M(t,h._$AS(t,i.values),h,e)),i}class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l).importNode(i,true);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P.nextNode(),o++);}return P.currentNode=l,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M(this,t,i),a(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==A&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c()),this.O(c()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$2(t).nextSibling;i$2(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class I extends H{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A?void 0:t;}}class L extends H{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A);}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t);}}const B=t$2.litHtmlPolyfillSupport;B?.(S,k),(t$2.litHtmlVersions??=[]).push("3.3.2");const D=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k(i.insertBefore(c(),t),t,void 0,s??{});}return h._$AI(t),h};
55
-
56
- /**
57
- * @license
58
- * Copyright 2017 Google LLC
59
- * SPDX-License-Identifier: BSD-3-Clause
60
- */const s=globalThis;let i$1 = class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}};i$1._$litElement$=true,i$1["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i$1});const o$2=s.litElementPolyfillSupport;o$2?.({LitElement:i$1});(s.litElementVersions??=[]).push("4.2.2");
61
-
62
- /**
63
- * @license
64
- * Copyright 2017 Google LLC
65
- * SPDX-License-Identifier: BSD-3-Clause
66
- */const o$1={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r$1=(t=o$1,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t,true,r);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t,true,r);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
67
-
68
- /**
69
- * @license
70
- * Copyright 2017 Google LLC
71
- * SPDX-License-Identifier: BSD-3-Clause
72
- */function r(r){return n({...r,state:true,attribute:false})}
73
-
74
- /**
75
- * @license
76
- * Copyright 2017 Google LLC
77
- * SPDX-License-Identifier: BSD-3-Clause
78
- */
79
- const t$1={ATTRIBUTE:1,CHILD:2},e$2=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
80
-
81
- /**
82
- * @license
83
- * Copyright 2017 Google LLC
84
- * SPDX-License-Identifier: BSD-3-Clause
85
- */let e$1 = class e extends i{constructor(i){if(super(i),this.it=A,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===A||null==r)return this._t=void 0,this.it=r;if(r===E)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};e$1.directiveName="unsafeHTML",e$1.resultType=1;
86
-
87
- /**
88
- * @license
89
- * Copyright 2017 Google LLC
90
- * SPDX-License-Identifier: BSD-3-Clause
91
- */class t extends e$1{}t.directiveName="unsafeSVG",t.resultType=2;const o=e$2(t);
92
-
93
- async function createCacheFetch(name) {
94
- let cache = null;
95
- // This map tracks requests currently being processed
96
- const inFlightRequests = new Map();
97
- try {
98
- cache = await window.caches.open(name);
99
- }
100
- catch (e) {
101
- console.warn('window.caches access not allowed');
102
- }
103
- return async (url) => {
104
- // 1. Check if we are already fetching this URL
105
- if (inFlightRequests.has(url)) {
106
- // Return the existing promise instead of starting a new one
107
- return inFlightRequests.get(url);
108
- }
109
- // 2. Create the main logic as a promise
110
- const fetchPromise = (async () => {
111
- const request = new Request(url);
112
- // Check Cache first
113
- if (cache) {
114
- const cachedResponse = await cache.match(request);
115
- if (cachedResponse) {
116
- return await cachedResponse.text();
117
- }
118
- }
119
- // Prepare network request
120
- const urlObj = new URL(request.url);
121
- const isSameOrigin = urlObj.origin === window.location.origin;
122
- const response = await fetch(request.url, {
123
- method: 'GET',
124
- mode: isSameOrigin ? 'no-cors' : 'cors',
125
- credentials: isSameOrigin ? 'same-origin' : 'omit',
126
- });
127
- // --- Handle 404 ---
128
- if (response.status === 404) {
129
- console.error(`[Fetch Error] Resource not found (404): ${url}`);
130
- return ''; // Return empty string as requested
131
- }
132
- const result = await response.text();
133
- // Update Cache if applicable
134
- if (cache && response.status === 200) {
135
- // We clone the response logic by creating a new Response with the text body
136
- await cache.put(request, new Response(result, {
137
- status: response.status,
138
- statusText: response.statusText,
139
- headers: response.headers,
140
- }));
141
- }
142
- return result;
143
- })();
144
- // 3. Store the promise in the map
145
- inFlightRequests.set(url, fetchPromise);
146
- try {
147
- // 4. Wait for the result
148
- return await fetchPromise;
149
- }
150
- finally {
151
- // 5. Clean up: Remove the promise from the map when done
152
- // This ensures subsequent calls (after this one finishes) can start fresh
153
- inFlightRequests.delete(url);
154
- }
155
- };
156
- }
157
- // Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes
158
- function sanitizeSvg(rawSvg) {
159
- try {
160
- const parser = new DOMParser();
161
- const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
162
- // remove script tags
163
- const scripts = Array.from(doc.querySelectorAll('script'));
164
- scripts.forEach(n => n.remove());
165
- // remove foreignObject and iframe-like elements
166
- const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));
167
- foreigns.forEach(n => n.remove());
168
- // remove event handler attributes like onload, onclick, etc.
169
- const all = Array.from(doc.querySelectorAll('*'));
170
- all.forEach(el => {
171
- const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));
172
- attrs.forEach(a => el.removeAttribute(a.name));
173
- });
174
- const el = doc.documentElement;
175
- if (!el)
176
- return '';
177
- // serialize back to string
178
- const serializer = new XMLSerializer();
179
- return serializer.serializeToString(el);
180
- }
181
- catch (e) {
182
- // parsing failed; fall back to empty content to avoid injecting unsafe content
183
- return '';
184
- }
185
- }
186
- const getTypography = (name) => `
187
- font-family: var(--typography-${name}-font-family) !important;
188
- font-size: var(--typography-${name}-font-size) !important;
189
- font-weight: var(--typography-${name}-font-weight) !important;
190
- line-height: var(--typography-${name}-line-height) !important;
191
- letter-spacing: var(--typography-${name}-letter-spacing) !important;
192
- `;
193
-
194
- const PROVIDERS = {
195
- 'material-symbols': (name) => `https://cdn.jsdelivr.net/npm/@material-symbols/svg-500@0.40.1/outlined/${name}.svg`,
196
- carbon: (name) => `https://cdn.jsdelivr.net/npm/@carbon/icons@11.41.0/svg/32/${name}.svg`,
197
- };
198
- const cacheFetch = await createCacheFetch('svg-cache');
199
- async function fetchSVG(url) {
200
- if (!url)
201
- return '';
202
- return cacheFetch(url);
203
- }
204
- async function fetchIcon(name, provider = 'material-symbols') {
205
- if (!name)
206
- return '';
207
- if (!PROVIDERS[provider]) {
208
- throw new Error(`Provider '${provider}' not found`);
209
- }
210
- return fetchSVG(PROVIDERS[provider](name));
211
- }
212
-
213
- const styles$1 = i$4 `
214
- :host {
215
- display: inline-block;
216
- line-height: 0;
217
- --icon-size: inherit;
218
- --icon-color: inherit;
219
- }
220
-
221
- .icon {
222
- display: inline-block;
223
- height: var(--icon-size, 1rem);
224
- width: var(--icon-size, 1rem);
225
-
226
- svg {
227
- fill: var(--icon-color);
228
- height: 100%;
229
- width: 100%;
230
- }
231
- }
232
- `;
233
-
234
- class Icon extends i$1 {
235
- constructor() {
236
- super(...arguments);
237
- this.provider = 'material-symbols';
238
- this.svgContent = '';
239
- // loading + error states for consumers/tests
240
- this.loading = false;
241
- this.error = null;
242
- // token to avoid race conditions when multiple fetches overlap
243
- this._fetchId = 0;
244
- }
245
- firstUpdated() {
246
- // perform initial fetch once component is connected and rendered
247
- this.__scheduleUpdate();
248
- }
249
- updated(changedProperties) {
250
- // only refetch when name or src changed
251
- if (changedProperties.has('name') || changedProperties.has('src')) {
252
- this.__scheduleUpdate();
253
- }
254
- }
255
- render() {
256
- // accessible wrapper; consumers can provide a fallback via <slot name="fallback">.
257
- return b ` <div class="icon">
258
- ${this.svgContent
259
- ? o(this.svgContent)
260
- : b `<slot name="fallback"></slot>`}
261
- </div>`;
262
- }
263
- // small debounce to coalesce rapid changes (50ms)
264
- __scheduleUpdate() {
265
- if (this._debounceTimer) {
266
- clearTimeout(this._debounceTimer);
267
- }
268
- // @ts-ignore - setTimeout in DOM returns number
269
- this._debounceTimer = window.setTimeout(() => this.__updateSvg(), 50);
270
- }
271
- /**
272
- * @internal
273
- */
274
- async __updateSvg() {
275
- this._fetchId += 1;
276
- const currentId = this._fetchId;
277
- this.loading = true;
278
- this.error = null;
279
- try {
280
- let raw;
281
- if (this.name) {
282
- raw = await fetchIcon(this.name, this.provider);
283
- }
284
- else if (this.src) {
285
- raw = await fetchSVG(this.src);
286
- }
287
- else {
288
- raw = '';
289
- }
290
- // If another fetch started after this one, ignore this result
291
- if (currentId !== this._fetchId)
292
- return;
293
- if (raw) {
294
- this.svgContent = sanitizeSvg(raw);
295
- }
296
- else {
297
- this.svgContent = '';
298
- }
299
- }
300
- catch (err) {
301
- // capture and surface error, but avoid throwing
302
- this.error = err instanceof Error ? err : new Error(String(err));
303
- this.svgContent = '';
304
- // bubble an event so consumers can react
305
- this.dispatchEvent(new CustomEvent('icon-error', {
306
- detail: { name: this.name, src: this.src, error: this.error },
307
- bubbles: true,
308
- composed: true,
309
- }));
310
- }
311
- finally {
312
- // ensure loading is cleared unless another fetch started
313
- if (currentId === this._fetchId) {
314
- this.loading = false;
315
- }
316
- }
317
- }
318
- }
319
- Icon.styles = [styles$1];
320
- __decorate([
321
- n({ type: String, reflect: true })
322
- ], Icon.prototype, "name", void 0);
323
- __decorate([
324
- n({ type: String, reflect: true })
325
- ], Icon.prototype, "src", void 0);
326
- __decorate([
327
- n({ type: String })
328
- ], Icon.prototype, "provider", void 0);
329
- __decorate([
330
- r()
331
- ], Icon.prototype, "svgContent", void 0);
332
- __decorate([
333
- r()
334
- ], Icon.prototype, "loading", void 0);
335
- __decorate([
336
- r()
337
- ], Icon.prototype, "error", void 0);
338
-
339
- /**
340
- * @license
341
- * Copyright 2018 Google LLC
342
- * SPDX-License-Identifier: BSD-3-Clause
343
- */const e=e$2(class extends i{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return E}});
344
-
345
- const styles = i$4 `
346
- :host {
347
- display: inline-block;
348
- pointer-events: none;
349
- --avatar-size: 2rem;
350
- --avatar-background-color: var(--color-primary);
351
- --avatar-text-color: var(--color-on-primary);
352
- --avatar-border-radius: var(--global-avatar-border-radius);
353
- }
354
-
355
- .avatar-container {
356
- display: flex;
357
- align-items: center;
358
- gap: var(--spacing-050);
359
- line-height: 0;
360
- }
361
-
362
- .avatar {
363
- border-radius: var(--avatar-border-radius);
364
- display: flex;
365
- justify-content: center;
366
- align-items: center;
367
- color: var(--avatar-text-color);
368
- width: var(--avatar-size);
369
- height: var(--avatar-size);
370
- ${r$4(getTypography('body-large-emphasized'))}
371
- background-color: var(--avatar-background-color);
372
-
373
- font-size: calc(var(--avatar-size) * 0.4);
374
-
375
- .image {
376
- width: 100%;
377
- height: 100%;
378
- overflow: hidden;
379
- border-radius: inherit;
380
- }
381
- }
382
- `;
383
-
384
- class Avatar extends i$1 {
385
- constructor() {
386
- super(...arguments);
387
- this.name = '';
388
- }
389
- render() {
390
- return b `<div class="avatar-container">
391
- <div
392
- class=${e({
393
- avatar: true,
394
- initials: !this.src,
395
- image: !!this.src,
396
- })}
397
- >
398
- ${this.src
399
- ? b `<img class="image" src=${this.src} alt=${this.name} />`
400
- : b `<div class="initials">${this.__getInitials()}</div>`}
401
- </div>
402
- </div>`;
403
- }
404
- __getInitials() {
405
- const [first = '', last = ''] = this.name.split(' ');
406
- return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase();
407
- }
408
- }
409
- Avatar.styles = [styles];
410
- __decorate([
411
- n({ type: String, reflect: true })
412
- ], Avatar.prototype, "name", void 0);
413
- __decorate([
414
- n({ type: String, reflect: true })
415
- ], Avatar.prototype, "src", void 0);
416
-
417
- export { Avatar as A, Icon as I, __decorate as _, r as a, i$1 as b, __classPrivateFieldGet as c, b as d, e, getTypography as g, i$4 as i, n, r$4 as r };
418
- //# sourceMappingURL=avatar-GQwWRGRw.js.map