@3r1s_s/erisui 1.0.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.
@@ -0,0 +1,1767 @@
1
+ class E extends HTMLElement {
2
+ static get observedAttributes() {
3
+ return ["size", "border-radius", "name", "color"];
4
+ }
5
+ constructor() {
6
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
7
+ <style>
8
+ :host {
9
+ aspect-ratio: 1 / 1;
10
+ width: fit-content;
11
+
12
+ user-select: none;
13
+ -webkit-user-select: none;
14
+ -webkit-user-drag: none;
15
+ -webkit-user-modify: none;
16
+ -webkit-highlight: none;
17
+ -webkit-tap-highlight-color: transparent;
18
+ }
19
+
20
+ .avatar {
21
+ width: 32px;
22
+ height: 100%;
23
+ aspect-ratio: 1 / 1;
24
+
25
+ border-radius: var(--border-radius, 50%);
26
+ overflow: hidden;
27
+ box-shadow: inset 0 0 0 1px #ffffff25;
28
+
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ background-color: #000;
33
+ color: #fff;
34
+ font-weight: 500;
35
+ font-size: 1.2rem;
36
+ text-transform: uppercase;
37
+ }
38
+
39
+ ::slotted(img) {
40
+ width: 100%;
41
+ height: 100%;
42
+ border-radius: var(--border-radius, 50%);
43
+ object-fit: cover;
44
+ display: block;
45
+ }
46
+ </style>
47
+ <div class="avatar">
48
+ <slot></slot>
49
+ <span id="initials"></span>
50
+ </div>
51
+ `;
52
+ }
53
+ connectedCallback() {
54
+ this.avatar = this.shadowRoot.querySelector(".avatar"), this.initials = this.shadowRoot.querySelector("#initials");
55
+ const t = this.shadowRoot.querySelector("slot"), e = t && t.assignedNodes().length > 0;
56
+ if (e) {
57
+ const i = t.assignedNodes()[0];
58
+ i && i.tagName === "IMG" && (this.initials.style.display = "none", this.avatar.style.backgroundColor = "transparent");
59
+ } else
60
+ this.hasAttribute("color") && (this.avatar.style.backgroundColor = this.getAttribute("color"));
61
+ if (this.hasAttribute("color") && (this.avatar.style.backgroundColor = this.getAttribute("color")), this.hasAttribute("size")) {
62
+ const i = this.getAttribute("size");
63
+ this.avatar.style.width = i + "px", this.avatar.style.height = i + "px", this.initials.style.fontSize = i / 2 + "px";
64
+ }
65
+ if (this.hasAttribute("border-radius") && (this.avatar.style.borderRadius = this.getAttribute("border-radius") + "px"), this.hasAttribute("name") && (this.avatar.title = this.getAttribute("name")), !e && this.hasAttribute("name")) {
66
+ const a = this.getAttribute("name").trim().split(/\s+/);
67
+ let n = "";
68
+ a.length === 1 ? n = a[0][0] || "" : n = (a[0][0] || "") + (a[a.length - 1][0] || ""), this.initials.textContent = n.toUpperCase();
69
+ }
70
+ }
71
+ }
72
+ customElements.define("eui-avatar", E);
73
+ const u = /* @__PURE__ */ (() => {
74
+ let o = {};
75
+ return {
76
+ register(t, e) {
77
+ o[t] = e;
78
+ },
79
+ get(t) {
80
+ return o[t] || "";
81
+ }
82
+ };
83
+ })();
84
+ u.register("menu", '<svg width="24" height="24" viewBox="0 0 24 24" focusable="false"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" fill="currentColor"></path></svg>');
85
+ u.register("home", '<svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.5258 0.204649C11.2291 -0.0682165 10.7709 -0.0682161 10.4742 0.204649L0.249923 9.68588C-0.266994 10.1612 0.0714693 11.0197 0.775759 11.0197L3.48971 11.0197V18.6923C3.48971 19.542 4.18295 20.2308 5.03811 20.2308H16.9619C17.8171 20.2308 18.5103 19.542 18.5103 18.6923V11.0197L21.2242 11.0197C21.9285 11.0197 22.267 10.1612 21.7501 9.68588L11.5258 0.204649Z" fill="currentColor"/></svg>');
86
+ u.register("kit", '<svg width="26" height="28" viewBox="0 0 26 28" xmlns="http://www.w3.org/2000/svg"><path d="m13.118 14.831c0.433 0 1.257-0.024 1.795-0.344l9.151-4.057c0.869-0.59 1.051-1.255 1.067-1.773 0.02-0.662-0.313-1.634-1.181-2.15l-8.515-3.921c-0.537-0.309-2.096-0.552-2.529-0.552-0.444 0-1.958 0.42-2.496 0.73l-8.643 4.034c-0.85 0.602-1.022 1.284-0.951 1.942 0.098 0.887 0.206 0.857 0.889 1.503l9.577 4.212c0.537 0.32 1.391 0.376 1.836 0.376zm-0.12 5.467c0.403 0 1.443-0.068 1.928-0.345l8.858-3.991c0.497-0.3 1.448-1.117 1.382-1.952-0.091-1.138-0.598-1.7-0.948-1.906l-9.22 3.888c-0.454 0.261-1.417 0.478-1.916 0.478-0.542 0-1.539-0.228-1.766-0.362l-9.395-4.012c-0.462 0.022-1.174 0.911-1.201 1.642-0.03 0.761 0.7 1.62 1.135 1.839l9.408 4.384c0.485 0.278 1.322 0.337 1.735 0.337zm0.09 5.344c0.403 0 1.296-0.053 1.781-0.342l9.147-4.299c0.485-0.289 1.129-0.789 1.053-1.879-0.056-0.794-0.071-1.123-0.918-1.765l-9.203 4.113c-0.228 0.134-0.948 0.39-1.853 0.39-0.939 0-1.603-0.224-1.831-0.359l-9.451-4.017c-0.979 0.247-1.005 1.45-1.005 1.947 0 0.455 0.403 1.279 0.9 1.568l9.465 4.262c0.486 0.29 1.502 0.381 1.915 0.381z" fill="currentColor"></path></svg>');
87
+ u.register("settings", '<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.644169 15.2044C0.751639 15.4175 0.866389 15.627 0.988219 15.8323C1.34503 16.445 1.76284 17.0223 2.23048 17.545C2.3967 17.7307 2.65856 17.7968 2.89375 17.7126L5.25826 16.8621C5.96645 16.608 6.74841 17.07 6.87902 17.8018L7.32018 20.2764C7.36418 20.5227 7.55119 20.7167 7.79454 20.7688C8.86201 20.9976 9.95753 21.057 11.0418 20.9452C11.427 20.9061 11.8095 20.8457 12.1863 20.7643C12.375 20.7232 12.5303 20.5969 12.6121 20.4275C12.6441 20.37 12.6671 20.3068 12.6794 20.2397L13.132 17.7739C13.1978 17.4162 13.4191 17.1252 13.7102 16.9498C13.7478 16.9275 13.7867 16.9072 13.8264 16.8889C14.1041 16.7654 14.426 16.7408 14.7301 16.8496L17.0889 17.6938C17.2068 17.7362 17.3318 17.7406 17.4482 17.7107C17.5805 17.6872 17.7044 17.6208 17.7983 17.5172C18.2857 16.9783 18.7189 16.3833 19.0875 15.7497C19.4503 15.1137 19.748 14.4403 19.9703 13.7471C20.0128 13.6142 20.0083 13.4742 19.9629 13.3481C19.9307 13.2315 19.8646 13.1245 19.7685 13.043L17.8596 11.4179C17.6114 11.2067 17.4714 10.912 17.4409 10.6065C17.4371 10.563 17.4355 10.5194 17.4361 10.4758C17.444 10.1379 17.5847 9.80337 17.8591 9.56905L19.7638 7.94348C19.8146 7.90007 19.857 7.84958 19.8904 7.7944C19.9978 7.63842 20.0299 7.43844 19.9706 7.25291C19.8534 6.88733 19.7151 6.52704 19.5572 6.17466C19.1114 5.17572 18.5115 4.2528 17.7787 3.43934C17.612 3.25429 17.3509 3.18886 17.1161 3.27382L14.7569 4.12827C14.0592 4.38082 13.2679 3.93321 13.1344 3.19155L12.6871 0.714256C12.6423 0.468053 12.4542 0.273849 12.2106 0.22246C11.5182 0.0764882 10.803 0.00250031 10.088 0.000608251C9.88769 -0.0015584 9.68739 0.002064 9.48735 0.0114648C8.92415 0.0369819 8.36389 0.107332 7.81778 0.222459C7.78135 0.230146 7.74615 0.241028 7.71249 0.2548C7.5098 0.328781 7.35888 0.505679 7.31996 0.723547L6.8788 3.19817C6.81394 3.56157 6.58834 3.85866 6.29097 4.03446C5.98991 4.2061 5.61923 4.25412 5.27153 4.12827L2.91237 3.27382C2.70694 3.1995 2.48138 3.24016 2.31657 3.37545C2.2857 3.39886 2.25676 3.42543 2.23026 3.45505C1.81793 3.91588 1.44433 4.4192 1.11714 4.95183C1.05788 5.04799 1.00019 5.14513 0.944072 5.24319C0.878302 5.35619 0.814661 5.4704 0.753186 5.58577C0.464267 6.12611 0.222113 6.69081 0.0338354 7.26739C0.0213426 7.30567 0.0127871 7.34455 0.00802709 7.38352C-0.0257478 7.59364 0.0518458 7.809 0.218337 7.94974L2.13633 9.56992C2.41146 9.80242 2.55518 10.1364 2.56469 10.4743C2.56917 10.8294 2.42529 11.1857 2.13611 11.4301L0.218115 13.0503C0.0484589 13.1937 -0.0289685 13.4145 0.00982709 13.6284C0.0147983 13.6634 0.0228404 13.6982 0.0340542 13.7326C0.198098 14.235 0.403035 14.7283 0.644169 15.2044ZM10 14.5C12.2091 14.5 14 12.7091 14 10.5C14 8.29086 12.2091 6.5 10 6.5C7.79086 6.5 6 8.29086 6 10.5C6 12.7091 7.79086 14.5 10 14.5Z" fill="currentColor"></path></svg>');
88
+ u.register("home", '<svg width="22" height="21" viewBox="0 0 22 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.5258 0.204649C11.2291 -0.0682165 10.7709 -0.0682161 10.4742 0.204649L0.249923 9.68588C-0.266994 10.1612 0.0714693 11.0197 0.775759 11.0197L3.48971 11.0197V18.6923C3.48971 19.542 4.18295 20.2308 5.03811 20.2308H16.9619C17.8171 20.2308 18.5103 19.542 18.5103 18.6923V11.0197L21.2242 11.0197C21.9285 11.0197 22.267 10.1612 21.7501 9.68588L11.5258 0.204649Z" fill="currentColor"/></svg>');
89
+ u.register("copy", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M2 11C2 11.7956 2.31607 12.5587 2.87868 13.1213C3.44129 13.6839 4.20435 14 5 14H11C11.7956 14 12.5587 13.6839 13.1213 13.1213C13.6839 12.5587 14 11.7956 14 11V8H11.75C10.7554 8 9.80161 7.60491 9.09835 6.90165C8.39509 6.19839 8 5.24456 8 4.25V2H5C4.20435 2 3.44129 2.31607 2.87868 2.87868C2.31607 3.44129 2 4.20435 2 5V11Z" fill="currentColor"/><path d="M13.7975 6.49965C13.6881 6.25457 13.5357 6.03105 13.3475 5.83965L10.16 2.65965C9.96921 2.4688 9.74565 2.31384 9.5 2.20215V4.24965C9.5 4.54512 9.5582 4.8377 9.67127 5.11069C9.78434 5.38367 9.95008 5.63171 10.159 5.84064C10.3679 6.04957 10.616 6.2153 10.889 6.32838C11.1619 6.44145 11.4545 6.49965 11.75 6.49965H13.7975Z" fill="currentColor"/></svg>');
90
+ u.register("arrow", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>');
91
+ u.register("back", '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" style="transform: rotate(180deg)"><path d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z"></path></svg>');
92
+ u.register("check", '<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.86368 9.12226C3.82463 9.16131 3.76131 9.16131 3.72226 9.12226L0.146522 5.54652C-0.0487403 5.35126 -0.0487401 5.03468 0.146522 4.83942L0.839416 4.14652C1.03468 3.95126 1.35126 3.95126 1.54652 4.14652L3.72226 6.32226C3.76131 6.36131 3.82463 6.36131 3.86368 6.32226L10.0394 0.146522C10.2347 -0.0487398 10.5513 -0.0487399 10.7465 0.146522L11.4394 0.839416C11.6347 1.03468 11.6347 1.35126 11.4394 1.54652L3.86368 9.12226Z" fill="currentColor"/></svg>');
93
+ class A extends HTMLElement {
94
+ static get observedAttributes() {
95
+ return ["name", "width", "height"];
96
+ }
97
+ constructor() {
98
+ super(), this.attachShadow({ mode: "open" });
99
+ }
100
+ connectedCallback() {
101
+ this.render();
102
+ }
103
+ attributeChangedCallback() {
104
+ this.render();
105
+ }
106
+ render() {
107
+ const t = this.getAttribute("name"), e = u.get(t);
108
+ if (!e) {
109
+ this.shadowRoot.innerHTML = '<span style="color:red;">?</span>';
110
+ return;
111
+ }
112
+ const i = document.createElement("template");
113
+ i.innerHTML = e.trim();
114
+ const a = i.content.cloneNode(!0), n = a.firstElementChild;
115
+ if (n && n.style) {
116
+ const r = this.getAttribute("width"), l = this.getAttribute("height");
117
+ r && n.setAttribute("width", r), l && n.setAttribute("height", l), n.style.display = "block";
118
+ }
119
+ this.shadowRoot.innerHTML = "", this.shadowRoot.appendChild(a);
120
+ }
121
+ }
122
+ customElements.define("eui-icon", A);
123
+ class L extends HTMLElement {
124
+ static get observedAttributes() {
125
+ return ["label", "value", "id", "type", "filled"];
126
+ }
127
+ constructor() {
128
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
129
+ <style>
130
+ .form {
131
+ display: flex;
132
+ flex-direction: column;
133
+ gap: 12px;
134
+ width: 100%;
135
+ max-width: 300px;
136
+ margin: 0.75rem 0;
137
+ position: relative;
138
+ }
139
+
140
+ .form-input {
141
+ padding: 5px 10px;
142
+ border-radius: 5px;
143
+ width: 100%;
144
+ box-sizing: border-box;
145
+ font-size: 1em;
146
+ font-family: inherit;
147
+ height: 52px;
148
+ background: var(--app-100, #111);
149
+ outline: none;
150
+ border: 1px solid var(--app-300, #2196F3);
151
+ caret-color: var(--app-text);
152
+ color: var(--app-text);
153
+ transition: border .15s ease-out;
154
+ }
155
+
156
+ .filled.form .form-input {
157
+ background: var(--app-200, #222);
158
+ padding-bottom: 0;
159
+ padding-top: 0.6rem;
160
+ border: none;
161
+ border-bottom-left-radius: 0;
162
+ border-bottom-right-radius: 0;
163
+ border-bottom: 1px solid var(--app-300, #333);
164
+ }
165
+
166
+ .form-input:focus {
167
+ border: 1px solid var(--app-blue, #2196F3);
168
+ }
169
+
170
+ .filled.form .form-input:focus {
171
+ border-bottom: 2.5px solid var(--app-blue, #2196F3);
172
+ }
173
+
174
+ .form {
175
+ --form-inactive-top: 14.5px;
176
+ --form-inactive-left: 6px;
177
+
178
+ --form-active-top: -10px;
179
+ --form-active-left: 5px;
180
+ }
181
+
182
+ .filled.form {
183
+ --form-active-top: 3px;
184
+ --form-active-left: 6px;
185
+ }
186
+
187
+ .form label {
188
+ transition: all .15s ease-out;
189
+ color: var(--app-400, #999);
190
+ background: var(--app-100, #111);
191
+ pointer-events: none;
192
+ display: block;
193
+ padding: 0 .25rem;
194
+ position: absolute;
195
+ left: var(--form-inactive-left);
196
+ top: var(--form-inactive-top);
197
+ border-radius: 5px;
198
+ width: fit-content;
199
+
200
+ user-select: none;
201
+ -webkit-user-select: none;
202
+ }
203
+
204
+ .filled.form label {
205
+ background: transparent;
206
+ }
207
+
208
+ .form-input:focus+label,
209
+ .form-input:not(:placeholder-shown)+label,
210
+ .form-input.filled+label,
211
+ .form.always-active label {
212
+ top: var(--form-active-top);
213
+ left: var(--form-active-left);
214
+ font-size: .75em;
215
+ }
216
+
217
+ .form-input:focus+label {
218
+ font-weight: 600;
219
+ color: var(--app-blue, #2196F3);
220
+ width: auto;
221
+ }
222
+ </style>
223
+
224
+ <div class="form">
225
+ <input class="form-input" placeholder=" ">
226
+ <label></label>
227
+ </div>
228
+ `;
229
+ }
230
+ connectedCallback() {
231
+ this.form = this.shadowRoot.querySelector(".form"), this.inputEl = this.shadowRoot.querySelector(".form-input"), this.labelEl = this.shadowRoot.querySelector("label"), this.hasAttribute("value") && (this.inputEl.value = this.getAttribute("value")), this.hasAttribute("id") && (this.inputEl.id = this.getAttribute("id")), this.hasAttribute("label") && (this.labelEl.textContent = this.getAttribute("label")), this.hasAttribute("type") && (this.inputEl.type = this.getAttribute("type")), this.hasAttribute("filled") && this.form.classList.add("filled"), this.inputEl.addEventListener("input", (t) => {
232
+ this.setAttribute("value", this.inputEl.value), this.dispatchEvent(new Event("input", { bubbles: !0, composed: !0 }));
233
+ }), this.inputEl.addEventListener("change", (t) => {
234
+ this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
235
+ });
236
+ }
237
+ attributeChangedCallback(t, e, i) {
238
+ if (!(!this.inputEl || !this.labelEl))
239
+ switch (t) {
240
+ case "value":
241
+ this.inputEl.value !== i && (this.inputEl.value = i);
242
+ break;
243
+ case "id":
244
+ this.inputEl.id = i;
245
+ break;
246
+ case "label":
247
+ this.labelEl.textContent = i;
248
+ break;
249
+ }
250
+ }
251
+ get value() {
252
+ return this.inputEl.value;
253
+ }
254
+ set value(t) {
255
+ this.setAttribute("value", t);
256
+ }
257
+ }
258
+ customElements.define("eui-input", L);
259
+ class S extends HTMLElement {
260
+ constructor() {
261
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
262
+ <style>
263
+ .loader {
264
+ width: 24px;
265
+ height: 24px;
266
+ display: inline-block;
267
+ position: relative;
268
+ }
269
+
270
+ .loader-icon {
271
+ stroke: var(--app-accent, #2196F3);
272
+ fill: none;
273
+ stroke-width: 2px;
274
+ stroke-linecap: round;
275
+ transform-origin: 50% 50%;
276
+ transform: rotate(-90deg);
277
+ transition: all 0.2s ease-in-out 0s;
278
+ animation: 2s linear 0s infinite normal none running loader-spin;
279
+ }
280
+
281
+ .loader-icon {
282
+ stroke: var(--app-text, #F2F3F6);
283
+ }
284
+
285
+ @keyframes loader-spin {
286
+ 0% {
287
+ stroke-dasharray: 0.01px, 43.97px;
288
+ transform: rotate(0deg)
289
+ }
290
+
291
+ 50% {
292
+ stroke-dasharray: 21.99px, 21.99px;
293
+ transform: rotate(450deg)
294
+ }
295
+
296
+ 100% {
297
+ stroke-dasharray: 0.01px, 43.97px;
298
+ transform: rotate(1080deg)
299
+ }
300
+ }
301
+ </style>
302
+
303
+ <span class="loader animate">
304
+ <svg viewBox="0 0 16 16"><circle class="loader-icon" cx="8px" cy="8px" r="7px"></circle></svg>
305
+ </span>
306
+ `;
307
+ }
308
+ }
309
+ customElements.define("eui-loader", S);
310
+ class z extends HTMLElement {
311
+ static get observedAttributes() {
312
+ return ["value", "intermediate", "id"];
313
+ }
314
+ constructor() {
315
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
316
+ <style>
317
+ .progressbar {
318
+ width: 100%;
319
+ height: 5px;
320
+ overflow: hidden;
321
+ position: relative;
322
+ background: var(--app-300, #333);
323
+ border-radius: 4px;
324
+ }
325
+
326
+ .progress {
327
+ display: block;
328
+ height: 100%;
329
+ background: var(--app-accent, #2196F3);
330
+ border-radius: 4px;
331
+ transition: width 0.3s ease-in-out;
332
+ }
333
+
334
+ .progress.intermediate {
335
+ height: 100%;
336
+ transform-origin: 0% 50%;
337
+ transition-property: background;
338
+ animation: progressbar-indeterminate 1s infinite linear;
339
+ }
340
+
341
+ @keyframes progressbar-indeterminate {
342
+ 0% {
343
+ transform: translateX(0) scaleX(0)
344
+ }
345
+
346
+ 40% {
347
+ transform: translateX(0) scaleX(0.5)
348
+ }
349
+
350
+ 100% {
351
+ transform: translateX(100%) scaleX(0.3)
352
+ }
353
+ }
354
+ </style>
355
+
356
+ <div class="progressbar">
357
+ <span class="progress"></span>
358
+ </div>
359
+ `;
360
+ }
361
+ set value(t) {
362
+ this.setAttribute("value", t);
363
+ }
364
+ attributeChangedCallback() {
365
+ this.connectedCallback();
366
+ }
367
+ connectedCallback() {
368
+ const t = this.shadowRoot.querySelector(".progress");
369
+ this.hasAttribute("id") && (this.progress.id = this.getAttribute("id")), this.hasAttribute("intermediate") && t.classList.add("intermediate"), this.hasAttribute("value") && (t.style.width = this.getAttribute("value") + "%");
370
+ }
371
+ }
372
+ customElements.define("eui-progressbar", z);
373
+ const v = {
374
+ is: {
375
+ iPhone: /iPhone/.test(navigator.userAgent),
376
+ iPad: /iPad/.test(navigator.userAgent),
377
+ iOS: /iPhone|iPad|iPod/.test(navigator.userAgent),
378
+ android: /Android/.test(navigator.userAgent),
379
+ mobile: /Mobi|Android/i.test(navigator.userAgent)
380
+ // matches most mobile browsers
381
+ },
382
+ prefers: {
383
+ language: navigator.language || navigator.userLanguage,
384
+ reducedMotion: window.matchMedia("(prefers-reduced-motion: reduce)").matches,
385
+ reducedTransparency: window.matchMedia("(prefers-reduced-transparency: reduce)").matches
386
+ },
387
+ supports: {
388
+ share: typeof navigator.share == "function",
389
+ directDownload: "download" in document.createElement("a"),
390
+ haptics: "vibrate" in navigator || "Vibrate" in window || typeof window.navigator.vibrate == "function"
391
+ },
392
+ userAgent: navigator.userAgent
393
+ }, U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
394
+ __proto__: null,
395
+ device: v
396
+ }, Symbol.toStringTag, { value: "Module" }));
397
+ function M() {
398
+ try {
399
+ const o = document.createElement("label");
400
+ o.ariaHidden = "true", o.style.display = "none";
401
+ const t = document.createElement("input");
402
+ t.type = "checkbox", t.setAttribute("switch", ""), o.appendChild(t), document.head.appendChild(o), o.click(), document.head.removeChild(o);
403
+ } catch {
404
+ }
405
+ }
406
+ function x(o) {
407
+ v.supports.haptics ? navigator.vibrate(o || 50) : v.is.iPhone && M();
408
+ }
409
+ const Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
410
+ __proto__: null,
411
+ haptic: x
412
+ }, Symbol.toStringTag, { value: "Module" })), w = (() => {
413
+ let o = {}, t;
414
+ try {
415
+ o = JSON.parse(localStorage.getItem(t) || "{}");
416
+ } catch (e) {
417
+ console.error(e);
418
+ }
419
+ return {
420
+ get(e) {
421
+ return o[e];
422
+ },
423
+ set(e, i) {
424
+ o[e] = i, localStorage.setItem(t, JSON.stringify(o));
425
+ },
426
+ delete(e) {
427
+ delete o[e], localStorage.setItem(t, JSON.stringify(o));
428
+ },
429
+ all() {
430
+ return o;
431
+ },
432
+ clear() {
433
+ o = {}, localStorage.setItem(t, JSON.stringify(o));
434
+ },
435
+ name(e) {
436
+ t = e;
437
+ try {
438
+ o = JSON.parse(localStorage.getItem(t) || "{}");
439
+ } catch (i) {
440
+ console.error(i);
441
+ }
442
+ },
443
+ settings: {
444
+ get(e) {
445
+ return o && o.settings && o.settings[e];
446
+ },
447
+ set(e, i) {
448
+ o.settings || (o.settings = {}), o.settings[e] = i, localStorage.setItem(t, JSON.stringify(o));
449
+ },
450
+ delete(e) {
451
+ o.settings && (delete o.settings[e], localStorage.setItem(t, JSON.stringify(o)));
452
+ },
453
+ all() {
454
+ return o.settings || {};
455
+ },
456
+ clear() {
457
+ o.settings && (o.settings = {}, localStorage.setItem(t, JSON.stringify(o)));
458
+ }
459
+ }
460
+ };
461
+ })(), T = w.settings, X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
462
+ __proto__: null,
463
+ settings: T,
464
+ storage: w
465
+ }, Symbol.toStringTag, { value: "Module" }));
466
+ class $ extends HTMLElement {
467
+ static get observedAttributes() {
468
+ return ["selected"];
469
+ }
470
+ constructor() {
471
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
472
+ <style>
473
+ .switch {
474
+ background-color: var(--app-200);
475
+ border-radius: 16px;
476
+
477
+ box-shadow: inset 0px 0px 0px 2px var(--app-400);
478
+ width: 52px;
479
+ height: 32px;
480
+ display: flex;
481
+ align-items: center;
482
+ justify-content: center;
483
+ cursor: pointer;
484
+ position: relative;
485
+ }
486
+
487
+ .switch.selected {
488
+ background-color: #B8C4FF;
489
+ box-shadow: none;
490
+ }
491
+
492
+ .handle {
493
+ width: 16px;
494
+ height: 16px;
495
+ border-radius: 50%;
496
+ background-color: var(--app-900);
497
+ margin-inline-start: 0;
498
+ margin-inline-end: calc(52px - 32px);
499
+
500
+ transition: margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
501
+ width 250ms cubic-bezier(0.2, 0, 0, 1),
502
+ height 250ms cubic-bezier(0.2, 0, 0, 1);
503
+
504
+ pointer-events: none;
505
+ user-select: none;
506
+ }
507
+
508
+ .switch.selected .handle {
509
+ background-color: #5F7AFF;
510
+ margin-inline-start: calc(52px - 32px);
511
+ margin-inline-end: 0;
512
+ width: 24px;
513
+ height: 24px;
514
+ }
515
+
516
+ .switch:active .handle {
517
+ width: 28px;
518
+ height: 28px;
519
+ }
520
+
521
+ input {
522
+ appearance: none;
523
+ opacity: 0;
524
+ height: max(100%, var(--eui-switch-touch-target-size, 48px));
525
+ width: max(100%, var(--eui-switch-touch-target-size, 48px));
526
+ position: absolute;
527
+ margin: 0;
528
+ cursor: inherit;
529
+ top: 50%;
530
+ left: 50%;
531
+ transform: translate(-50%, -50%);
532
+ z-index: 2;
533
+ }
534
+ </style>
535
+
536
+ <div class="switch">
537
+ <input type="checkbox" role="switch">
538
+ <span class="handle"></span>
539
+ </div>
540
+ `;
541
+ }
542
+ connectedCallback() {
543
+ this.inputEl = this.shadowRoot.querySelector("input"), this.switchEl = this.shadowRoot.querySelector(".switch"), this.updateFromAttribute(), this.switchEl.addEventListener("click", () => this.toggle());
544
+ }
545
+ toggle() {
546
+ this.selected = !this.selected, x(), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
547
+ }
548
+ updateFromAttribute() {
549
+ const t = this.hasAttribute("selected");
550
+ this.inputEl.checked = t, this.switchEl.classList.toggle("selected", t);
551
+ }
552
+ attributeChangedCallback(t, e, i) {
553
+ t === "selected" && this.inputEl && this.updateFromAttribute();
554
+ }
555
+ get selected() {
556
+ return this.hasAttribute("selected");
557
+ }
558
+ set selected(t) {
559
+ t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
560
+ }
561
+ }
562
+ customElements.define("eui-switch", $);
563
+ class R extends HTMLElement {
564
+ constructor() {
565
+ super(), this.attachShadow({ mode: "open" });
566
+ }
567
+ connectedCallback() {
568
+ this.shadowRoot.innerHTML = `
569
+ <style>
570
+ :host {
571
+ display: inline-flex;
572
+ align-items: center;
573
+ gap: 4px;
574
+ padding: 4px 8px;
575
+ border-radius: 8px;
576
+ border: 2px solid var(--app-400);
577
+ font-weight: 500;
578
+ font-size: 1rem;
579
+ position: relative;
580
+ color: var(--app-text);
581
+ overflow: hidden;
582
+ z-index: 1;
583
+
584
+ user-select: none;
585
+ -webkit-user-select: none;
586
+ -webkit-user-drag: none;
587
+ -webkit-user-modify: none;
588
+ -webkit-highlight: none;
589
+ -webkit-tap-highlight-color: transparent;
590
+ }
591
+
592
+ .ripple {
593
+ position: absolute;
594
+ border-radius: 50%;
595
+ transform: scale(0);
596
+ filter: blur(4px);
597
+ opacity: 0.2;
598
+ animation: ripple 600ms linear;
599
+ background-color: var(--app-400);
600
+ pointer-events: none;
601
+ z-index: -1;
602
+ }
603
+
604
+ @keyframes ripple {
605
+ to {
606
+ transform: scale(4);
607
+ opacity: 0;
608
+ filter: blur(10px);
609
+ }
610
+ }
611
+ </style>
612
+ <slot></slot>
613
+ `, this.addEventListener("pointerdown", (t) => {
614
+ const e = document.createElement("span"), i = t.currentTarget, a = Math.max(i.offsetWidth, i.offsetHeight);
615
+ e.classList.add("ripple"), e.style.left = t.clientX - i.getBoundingClientRect().left - a / 2 + "px", e.style.top = t.clientY - i.getBoundingClientRect().top - a / 2 + "px", e.style.width = a + "px", e.style.height = a + "px", this.shadowRoot.appendChild(e), setTimeout(() => {
616
+ e.remove();
617
+ }, 600);
618
+ });
619
+ }
620
+ }
621
+ customElements.define("eui-chip", R);
622
+ const b = "", y = (() => {
623
+ const o = [];
624
+ function t(s, d) {
625
+ const h = [], g = s.replace(/:([^/]+)/g, (m, f) => (h.push(f), "([^/]+)")).replace(/\//g, "\\/"), p = new RegExp(`^${b}${g}$`);
626
+ o.push({ regex: p, paramNames: h, renderFn: d });
627
+ }
628
+ function e(s) {
629
+ for (const { regex: d, paramNames: h, renderFn: g } of o) {
630
+ const p = s.match(d);
631
+ if (p) {
632
+ const m = {};
633
+ return h.forEach((f, C) => {
634
+ m[f] = decodeURIComponent(p[C + 1]);
635
+ }), { renderFn: g, params: m };
636
+ }
637
+ }
638
+ return null;
639
+ }
640
+ function i(s, d = !0) {
641
+ s.startsWith(b) || (s = b + (s.startsWith("/") ? "" : "/") + s);
642
+ const h = s.split(/[?#]/)[0];
643
+ if (h === window.location.pathname && s.includes("#")) {
644
+ d && history.pushState({}, "", s);
645
+ const p = "#" + s.split("#")[1];
646
+ a(p);
647
+ return;
648
+ }
649
+ const g = e(h);
650
+ if (g)
651
+ if (d && history.pushState({}, "", s), g.renderFn(g.params), window.dispatchEvent(new CustomEvent("route-changed", { detail: { path: s } })), s.includes("#")) {
652
+ const p = "#" + s.split("#")[1];
653
+ setTimeout(() => a(p), 100);
654
+ } else {
655
+ const p = document.getElementById("main");
656
+ p && p.scrollTo(0, 0);
657
+ }
658
+ else n ? (d && history.pushState({}, "", s), n()) : console.warn(`No route found for ${h}`);
659
+ }
660
+ function a(s) {
661
+ if (s)
662
+ try {
663
+ const d = document.querySelector(s);
664
+ d && d.scrollIntoView({ behavior: "smooth" });
665
+ } catch {
666
+ console.warn("Invalid hash:", s);
667
+ }
668
+ }
669
+ let n = null;
670
+ function r(s) {
671
+ n = s;
672
+ }
673
+ function l() {
674
+ history.back();
675
+ }
676
+ function c() {
677
+ return window.location.pathname.replace(b, "") || "/";
678
+ }
679
+ return window.addEventListener("popstate", () => {
680
+ const s = window.location.pathname + window.location.search + window.location.hash;
681
+ i(s, !1);
682
+ }), window.addEventListener("click", (s) => {
683
+ if (s.button !== 0 || s.metaKey || s.altKey || s.ctrlKey || s.shiftKey) return;
684
+ const d = s.target.closest("a");
685
+ if (!d || d.hasAttribute("download") || d.getAttribute("target") === "_blank") return;
686
+ const h = d.getAttribute("href");
687
+ if (!(!h || h.startsWith("http") && !h.startsWith(window.location.origin))) {
688
+ if (s.preventDefault(), h.startsWith("#")) {
689
+ history.pushState({}, "", h), a(h);
690
+ return;
691
+ }
692
+ i(h);
693
+ }
694
+ }), { add: t, navigate: i, back: l, location: c, setNotFound: r };
695
+ })();
696
+ async function W(o) {
697
+ try {
698
+ const t = document.getElementById("main");
699
+ t.classList.add("fade-out"), await new Promise((i) => setTimeout(i, 200));
700
+ const e = await fetch(`/src/pages/${o}.html`).then((i) => i.text());
701
+ t.innerHTML = e, t.classList.remove("fade-out"), t.classList.add("fade-in"), window.location.hash ? setTimeout(() => {
702
+ try {
703
+ const i = document.querySelector(window.location.hash);
704
+ i && i.scrollIntoView({ behavior: "smooth" });
705
+ } catch {
706
+ }
707
+ }, 100) : t && t.scrollTo(0, 0), setTimeout(() => {
708
+ t.classList.remove("fade-in");
709
+ }, 200);
710
+ } catch (t) {
711
+ console.error("Page load failed:", t);
712
+ }
713
+ }
714
+ class H extends HTMLElement {
715
+ static get observedAttributes() {
716
+ return ["path", "icon", "label", "badge", "active", "avatar-src", "avatar-name"];
717
+ }
718
+ constructor() {
719
+ super(), this.attachShadow({ mode: "open" });
720
+ }
721
+ connectedCallback() {
722
+ this.hasRendered || (this.render(), this.setupEventListeners(), this.hasRendered = !0), this.updateContent(), this.addEventListener("click", this.handleClick);
723
+ }
724
+ disconnectedCallback() {
725
+ this.removeEventListener("click", this.handleClick);
726
+ }
727
+ attributeChangedCallback(t, e, i) {
728
+ if (e !== i && this.hasRendered) {
729
+ if (t === "active")
730
+ return;
731
+ this.updateContent();
732
+ }
733
+ }
734
+ handleClick = () => {
735
+ const t = this.getAttribute("path");
736
+ t && y.navigate(t);
737
+ };
738
+ setupEventListeners() {
739
+ this.addEventListener("pointerdown", (t) => {
740
+ const e = document.createElement("span"), i = t.currentTarget, a = i.getBoundingClientRect(), n = Math.max(i.offsetWidth, i.offsetHeight), r = n / 2;
741
+ e.classList.add("ripple"), e.style.width = `${n}px`, e.style.height = `${n}px`, e.style.left = `${t.clientX - a.left - r}px`, e.style.top = `${t.clientY - a.top - r}px`, this.shadowRoot.appendChild(e), e.addEventListener("animationend", () => {
742
+ e.remove();
743
+ });
744
+ });
745
+ }
746
+ updateContent() {
747
+ const t = this.getAttribute("icon"), e = this.getAttribute("avatar-src"), i = this.getAttribute("avatar-name"), a = this.getAttribute("label") || "", n = this.getAttribute("badge"), r = this.shadowRoot.querySelector(".badge");
748
+ if (n)
749
+ if (r)
750
+ r.textContent = n;
751
+ else {
752
+ const s = document.createElement("span");
753
+ s.className = "badge", s.textContent = n, this.shadowRoot.appendChild(s);
754
+ }
755
+ else r && r.remove();
756
+ const l = this.shadowRoot.querySelector("slot[name='icon']");
757
+ if (l)
758
+ if (e || i) {
759
+ let s = '<eui-avatar size="24"';
760
+ i && (s += ` name="${i}"`), s += ">", e && (s += `<img src="${e}" alt="${i || "Avatar"}" />`), s += "</eui-avatar>", l.innerHTML = s;
761
+ } else {
762
+ const s = l.querySelector("eui-icon");
763
+ t && s ? s.getAttribute("name") !== t && s.setAttribute("name", t) : t ? l.innerHTML = `<eui-icon width="24" height="24" name="${t}"></eui-icon>` : l.innerHTML = "";
764
+ }
765
+ const c = this.shadowRoot.querySelector(".label");
766
+ c && (c.textContent = a);
767
+ }
768
+ render() {
769
+ this.shadowRoot.innerHTML = `
770
+ <style>
771
+ :host {
772
+ position: relative;
773
+ overflow: hidden;
774
+ z-index: 1;
775
+ display: flex;
776
+ align-items: center;
777
+ height: 50px;
778
+ width: 100%;
779
+ cursor: pointer;
780
+ border-radius: 100px;
781
+ justify-content: flex-start;
782
+ padding: 0 1rem;
783
+ box-sizing: border-box;
784
+ transition: background-color 0.2s cubic-bezier(.4, 0, .2, 1), transform 0.2s cubic-bezier(.4, 0, .2, 1);
785
+ user-select: none;
786
+ -webkit-user-select: none;
787
+ color: var(--app-text);
788
+ }
789
+
790
+ :host(:hover) {
791
+ background-color: var(--app-300);
792
+ }
793
+
794
+ :host(:focus-visible) {
795
+ outline: 2px solid var(--app-link);
796
+ outline-offset: 2px;
797
+ }
798
+
799
+ :host([active]) {
800
+ background-color: color-mix(in srgb, var(--app-link) 25%, transparent 100%);
801
+ color: var(--app-link);
802
+ }
803
+
804
+ :host([active]) .label {
805
+ font-weight: 600;
806
+ }
807
+
808
+ .icon-container {
809
+ display: flex;
810
+ align-items: center;
811
+ justify-content: center;
812
+ width: 28px;
813
+ height: 28px;
814
+ flex-shrink: 0;
815
+ border-radius: 100px;
816
+ }
817
+
818
+ :host([active]) .icon-container eui-avatar {
819
+ outline: 2px solid var(--app-link);
820
+ outline-offset: 1px;
821
+ border-radius: 50%;
822
+ }
823
+
824
+ .label {
825
+ opacity: var(--nav-item-label-opacity, 0);
826
+ margin-left: 1rem;
827
+ display: block;
828
+ transition: opacity 0.1s ease;
829
+ white-space: nowrap;
830
+ }
831
+
832
+ .badge {
833
+ position: absolute;
834
+ top: 4px;
835
+ left: calc(32px + 2px);
836
+ width: 20px;
837
+ height: 20px;
838
+ border-radius: 50%;
839
+ background-color: var(--app-red);
840
+ color: var(--app-white);
841
+ display: flex;
842
+ align-items: center;
843
+ justify-content: center;
844
+ font-size: 14px;
845
+ font-weight: 600;
846
+ }
847
+
848
+ .ripple {
849
+ position: absolute;
850
+ border-radius: 50%;
851
+ transform: scale(0);
852
+ opacity: 0.2;
853
+ animation: ripple 600ms linear forwards;
854
+ background-color: currentColor;
855
+ pointer-events: none;
856
+ z-index: -1;
857
+ will-change: transform, opacity;
858
+ }
859
+
860
+ @keyframes ripple {
861
+ to {
862
+ transform: scale(4);
863
+ opacity: 0;
864
+ }
865
+ }
866
+ </style>
867
+
868
+ <div class="icon-container">
869
+ <slot name="icon">
870
+ <eui-icon width="24" height="24" name=""></eui-icon>
871
+ </slot>
872
+ </div>
873
+ <span class="label"></span>
874
+ `;
875
+ }
876
+ }
877
+ customElements.define("eui-nav-item", H);
878
+ class _ extends HTMLElement {
879
+ constructor() {
880
+ super(), this.attachShadow({ mode: "open" });
881
+ }
882
+ connectedCallback() {
883
+ this.updateActiveState(), window.addEventListener("popstate", () => this.updateActiveState()), window.addEventListener("route-changed", () => this.updateActiveState()), window.addEventListener("toggle-nav", () => this.classList.toggle("expanded"));
884
+ }
885
+ render() {
886
+ this.shadowRoot.innerHTML = `
887
+ <style>
888
+ :host {
889
+ position: fixed;
890
+ top: var(--titlebar-height, 65px);
891
+ left: 0;
892
+ height: calc(100% - var(--titlebar-height, 65px));
893
+ z-index: 100;
894
+
895
+ width: var(--nav-width, 75px);
896
+ transition: width 0.2s cubic-bezier(0.2, 0, 0, 1);
897
+ }
898
+
899
+ :host(.expanded) {
900
+ width: var(--nav-expanded-width, 250px);
901
+ --nav-item-label-opacity: 1;
902
+ }
903
+
904
+ .app-nav-container {
905
+ width: 100%;
906
+ min-width: var(--nav-width, 75px);
907
+ height: 100%;
908
+ box-sizing: border-box;
909
+ background-color: var(--app-200);
910
+ overflow-x: hidden;
911
+ display: flex;
912
+ flex-direction: column;
913
+ }
914
+
915
+ .nav-items {
916
+ display: flex;
917
+ flex-direction: column;
918
+ gap: 0.5rem;
919
+ padding: 0.5rem;
920
+ box-sizing: border-box;
921
+ overflow-y: auto;
922
+ overflow-x: hidden;
923
+ }
924
+
925
+ .menu-button {
926
+ border: none;
927
+ background-color: transparent;
928
+ cursor: pointer;
929
+ width: 42px;
930
+ height: 42px;
931
+ display: flex;
932
+ align-items: center;
933
+ justify-content: center;
934
+ box-sizing: border-box;
935
+ border-radius: 50%;
936
+ color: inherit;
937
+ }
938
+
939
+ .menu-button:hover {
940
+ background-color: var(--app-300);
941
+ box-shadow: 0 0 2px 0 #00000011;
942
+ }
943
+
944
+ .menu-button:active {
945
+ transform: scale(0.95);
946
+ }
947
+
948
+ .menu-button:focus-visible {
949
+ outline: 2px solid var(--app-link);
950
+ outline-offset: 2px;
951
+ }
952
+
953
+ #skip_navigation_link {
954
+ position: fixed;
955
+ top: -100px;
956
+ left: -100px;
957
+ z-index: 1001;
958
+ width: 1px;
959
+ height: 1px;
960
+ overflow: hidden;
961
+ clip: rect(0, 0, 0, 0);
962
+ border: 0;
963
+ padding: 0;
964
+ margin: 0;
965
+ }
966
+
967
+ #skip_navigation_link:focus {
968
+ top: 0;
969
+ left: 0;
970
+ overflow: visible;
971
+ clip: auto;
972
+ border: 1px dotted;
973
+ padding: 4px 8px;
974
+ margin: 4px;
975
+ width: 80px;
976
+ height: auto;
977
+ background-color: var(--app-link);
978
+ color: var(--app-white);
979
+ text-align: center;
980
+ }
981
+ </style>
982
+
983
+ <div class="app-nav-container">
984
+ <a href="#content" id="skip_navigation_link">Skip To Content</a>
985
+ <div class="nav-items">
986
+ ${this.navItems.map((t) => {
987
+ if (t.type === "divider")
988
+ return '<div style="height: 1px; background: var(--app-300); margin: 0.5rem 0;"></div>';
989
+ const e = t.avatar?.src || "", i = t.avatar?.name || "";
990
+ return `<eui-nav-item path="${t.path}" icon="${t.icon}" avatar-src="${e}" avatar-name="${i}" label="${t.label}"></eui-nav-item>`;
991
+ }).join("")}
992
+ </div>
993
+ </div>
994
+ `;
995
+ }
996
+ set navItems(t) {
997
+ this._navItems = t, this.render(), this.updateActiveState();
998
+ }
999
+ get navItems() {
1000
+ return this._navItems || [];
1001
+ }
1002
+ updateActiveState(t) {
1003
+ t || (t = y.location()), t.startsWith("/") || (t = "/" + t), this.shadowRoot.querySelectorAll("eui-nav-item").forEach((i) => {
1004
+ i.getAttribute("path") === t ? i.setAttribute("active", "") : i.removeAttribute("active");
1005
+ });
1006
+ }
1007
+ }
1008
+ customElements.define("eui-app-nav", _);
1009
+ class F extends HTMLElement {
1010
+ static get observedAttributes() {
1011
+ return ["type", "title", "subtitle", "img"];
1012
+ }
1013
+ constructor() {
1014
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
1015
+ <style>
1016
+ :host {
1017
+ border-radius: 24px;
1018
+ background: var(--app-200, #111);
1019
+ color: var(--app-text, #FFF);
1020
+ overflow: hidden;
1021
+ display: block;
1022
+ }
1023
+
1024
+ .header {
1025
+ min-height: 180px;
1026
+ display: flex;
1027
+ flex-direction: column;
1028
+ justify-content: center;
1029
+ padding: 48px;
1030
+ box-sizing: border-box;
1031
+ position: relative;
1032
+ }
1033
+
1034
+ .hero {
1035
+ min-height: 280px;
1036
+ display: flex;
1037
+ flex-direction: column;
1038
+ justify-content: flex-end;
1039
+ color: #fff;
1040
+ background: #333;
1041
+ }
1042
+
1043
+ .img {
1044
+ position: absolute;
1045
+ inset: 0;
1046
+ background-size: cover;
1047
+ background-position: center;
1048
+ z-index: 0;
1049
+ opacity: .5;
1050
+ }
1051
+
1052
+ .content {
1053
+ position: relative;
1054
+ z-index: 1;
1055
+ }
1056
+
1057
+ h1 {
1058
+ margin: 0 0 8px;
1059
+ font-size: 3rem;
1060
+ }
1061
+
1062
+ .large h1, .hero h1 {
1063
+ font-size: 5.5rem;
1064
+ }
1065
+
1066
+ .small h1 {
1067
+ font-size: 2rem;
1068
+ margin: 0;
1069
+ }
1070
+
1071
+ .small p {
1072
+ margin: 0;
1073
+ }
1074
+
1075
+ @media (max-width: 768px) {
1076
+ .header {
1077
+ padding: 1rem;
1078
+ align-items: center;
1079
+ justify-content: center;
1080
+ text-align: center;
1081
+ }
1082
+
1083
+ .hero h1 {
1084
+ font-size: 4rem;
1085
+ }
1086
+
1087
+ .large h1 {
1088
+ font-size: 2.5rem;
1089
+ }
1090
+ }
1091
+ </style>
1092
+
1093
+ <div class="header">
1094
+ <div class="img"></div>
1095
+ <div class="content">
1096
+ <h1></h1>
1097
+ <p></p>
1098
+ </div>
1099
+ </div>
1100
+ `;
1101
+ }
1102
+ connectedCallback() {
1103
+ this.hd = this.shadowRoot.querySelector(".header"), this.hasAttribute("type") && this.hd.classList.add(this.getAttribute("type"));
1104
+ }
1105
+ attributeChangedCallback(t, e, i) {
1106
+ const a = this.shadowRoot.querySelector("h1"), n = this.shadowRoot.querySelector("p"), r = this.shadowRoot.querySelector(".img");
1107
+ t === "title" && (a.textContent = i), t === "subtitle" && (n.textContent = i), t === "img" && (r.style.backgroundImage = i ? `url(${i})` : "");
1108
+ }
1109
+ }
1110
+ customElements.define("eui-header", F);
1111
+ class I extends HTMLElement {
1112
+ static get observedAttributes() {
1113
+ return ["selected"];
1114
+ }
1115
+ constructor() {
1116
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
1117
+ <style>
1118
+ :host {
1119
+ display: inline-block;
1120
+ vertical-align: bottom;
1121
+ position: relative;
1122
+ cursor: pointer;
1123
+ width: 24px;
1124
+ height: 24px;
1125
+ }
1126
+
1127
+ .checkbox {
1128
+ position: relative;
1129
+ width: 24px;
1130
+ height: 24px;
1131
+ display: flex;
1132
+ align-items: center;
1133
+ justify-content: center;
1134
+ border-radius: 4px;
1135
+ box-shadow: inset 0px 0px 0px 2px var(--app-400);
1136
+
1137
+ color: #fff;
1138
+ }
1139
+
1140
+ .checkbox.selected, .checkbox.indeterminate {
1141
+ background-color: var(--app-accent);
1142
+ box-shadow: none;
1143
+ }
1144
+
1145
+ input {
1146
+ appearance: none;
1147
+ opacity: 0;
1148
+ height: max(100%, var(--eui-switch-touch-target-size, 48px));
1149
+ width: max(100%, var(--eui-switch-touch-target-size, 48px));
1150
+ position: absolute;
1151
+ margin: 0;
1152
+ cursor: inherit;
1153
+ top: 50%;
1154
+ left: 50%;
1155
+ transform: translate(-50%, -50%);
1156
+ z-index: 2;
1157
+ }
1158
+
1159
+ .mark.long {
1160
+ height:2px;
1161
+ transition-property:transform,width;
1162
+ width:0px;
1163
+ }
1164
+
1165
+ .mark.short {
1166
+ height: 2px;
1167
+ transition-property: transform,height;
1168
+ width: 0px;
1169
+ }
1170
+
1171
+ .mark {
1172
+ fill: #fff;
1173
+ transform: scaleY(-1) translate(7px, -14px) rotate(45deg);
1174
+ }
1175
+
1176
+ .selected .mark.long {
1177
+ animation-duration: 350ms;
1178
+ animation-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
1179
+ transition-duration: 350ms;
1180
+ transition-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
1181
+ }
1182
+
1183
+ .selected .mark.short {
1184
+ width: 2px;
1185
+ height: 5.6568542495px;
1186
+ }
1187
+
1188
+ .selected .mark.long{
1189
+ width: 11.313708499px;
1190
+ }
1191
+ </style>
1192
+
1193
+ <div class="checkbox">
1194
+ <input type="checkbox" role="checkbox">
1195
+ <svg class="icon" viewBox="0 0 18 18" aria-hidden="true">
1196
+ <rect class="mark short"></rect>
1197
+ <rect class="mark long"></rect>
1198
+ </svg>
1199
+ </div>
1200
+ `;
1201
+ }
1202
+ connectedCallback() {
1203
+ this.inputEl = this.shadowRoot.querySelector("input"), this.checkEl = this.shadowRoot.querySelector(".checkbox"), this.updateFromAttribute(), this.checkEl.addEventListener("click", () => this.toggle());
1204
+ }
1205
+ toggle() {
1206
+ this.selected = !this.selected, x(), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 }));
1207
+ }
1208
+ updateFromAttribute() {
1209
+ const t = this.hasAttribute("selected");
1210
+ this.inputEl.checked = t, this.checkEl.classList.toggle("selected", t);
1211
+ }
1212
+ attributeChangedCallback(t, e, i) {
1213
+ t === "selected" && this.inputEl && this.updateFromAttribute();
1214
+ }
1215
+ get selected() {
1216
+ return this.hasAttribute("selected");
1217
+ }
1218
+ set selected(t) {
1219
+ t ? this.setAttribute("selected", "") : this.removeAttribute("selected");
1220
+ }
1221
+ }
1222
+ customElements.define("eui-checkbox", I);
1223
+ class j extends HTMLElement {
1224
+ static observedAttributes = ["type", "width", "height", "border-radius", "icon", "link", "href"];
1225
+ constructor() {
1226
+ super(), this.attachShadow({ mode: "open" });
1227
+ }
1228
+ connectedCallback() {
1229
+ this.render();
1230
+ }
1231
+ render() {
1232
+ const t = this.getAttribute("href"), e = t ? "a" : "button";
1233
+ this.shadowRoot.innerHTML = `
1234
+ <style>
1235
+ button, a {
1236
+ display: flex;
1237
+ justify-content: center;
1238
+ align-items: center;
1239
+ gap: 0.25rem;
1240
+ padding: 0.5rem 1rem;
1241
+ font-size: 1rem;
1242
+ font-weight: 600;
1243
+ font-family: inherit;
1244
+ border-radius: 0.6rem;
1245
+ border: none;
1246
+ background: var(--app-300);
1247
+ color: var(--app-text, #FFF);
1248
+ cursor: pointer;
1249
+ box-sizing: border-box;
1250
+ text-decoration: none;
1251
+
1252
+ width: fit-content;
1253
+
1254
+ user-select: none;
1255
+ -webkit-user-select: none;
1256
+ -moz-user-select: none;
1257
+ -ms-user-select: none;
1258
+
1259
+ transition: background 0.2s cubic-bezier(.2,0,0,1);
1260
+
1261
+ position: relative;
1262
+ overflow: hidden;
1263
+ }
1264
+
1265
+ button:hover, a:hover {
1266
+ background: var(--app-400);
1267
+ text-decoration: none;
1268
+ }
1269
+
1270
+ .light button, .light a {
1271
+ background: var(--app-500);
1272
+ }
1273
+
1274
+ button.filled, a.filled {
1275
+ background: var(--app-accent-100);
1276
+ color: #fff;
1277
+ }
1278
+
1279
+ button.filled:hover, a.filled:hover {
1280
+ background: var(--app-accent-50);
1281
+ }
1282
+
1283
+ button.outlined, a.outlined {
1284
+ background: transparent;
1285
+ box-shadow: inset 0 0 0 2px var(--app-400);
1286
+ color: var(--app-accent-100);
1287
+ }
1288
+
1289
+ button.outlined:hover, a.outlined:hover {
1290
+ background: var(--app-300);
1291
+ }
1292
+
1293
+ button.icon, a.icon {
1294
+ padding: 0.5rem;
1295
+ border-radius: 50%;
1296
+ }
1297
+
1298
+ button.transparent, a.transparent {
1299
+ background: transparent;
1300
+ color: var(--app-text);
1301
+ }
1302
+
1303
+ button.transparent:hover, a.transparent:hover {
1304
+ background: var(--app-300);
1305
+ }
1306
+
1307
+ button:disabled, a[disabled] {
1308
+ opacity: 0.5;
1309
+ cursor: not-allowed;
1310
+ }
1311
+
1312
+ button.link, a.link {
1313
+ text-decoration: none;
1314
+ }
1315
+
1316
+ .ripple {
1317
+ position: absolute;
1318
+ border-radius: 50%;
1319
+ transform: scale(0);
1320
+ opacity: 0.2;
1321
+ animation: ripple 600ms linear forwards;
1322
+ background-color: currentColor;
1323
+ pointer-events: none;
1324
+ z-index: 10;
1325
+ will-change: transform, opacity;
1326
+ }
1327
+
1328
+ @keyframes ripple {
1329
+ to {
1330
+ transform: scale(4);
1331
+ opacity: 0;
1332
+ }
1333
+ }
1334
+
1335
+ </style>
1336
+ <${e}>
1337
+ <slot></slot>
1338
+ </${e}>
1339
+ `;
1340
+ const i = this.shadowRoot.querySelector(e);
1341
+ t && i.setAttribute("href", t), this.hasAttribute("type") && i.classList.add(this.getAttribute("type")), this.hasAttribute("icon") && i.classList.add("icon"), this.hasAttribute("width") && (i.style.width = this.getAttribute("width") + "px"), this.hasAttribute("height") && (i.style.height = this.getAttribute("height") + "px"), this.hasAttribute("border-radius") && (i.style.borderRadius = this.getAttribute("border-radius") + "px"), i.addEventListener("pointerdown", (a) => {
1342
+ const n = document.createElement("span"), r = a.currentTarget, l = r.getBoundingClientRect(), c = Math.max(r.offsetWidth, r.offsetHeight), s = c / 2;
1343
+ n.classList.add("ripple"), n.style.width = `${c}px`, n.style.height = `${c}px`, n.style.left = `${a.clientX - l.left - s}px`, n.style.top = `${a.clientY - l.top - s}px`, i.appendChild(n), n.addEventListener("animationend", () => {
1344
+ n.remove();
1345
+ });
1346
+ });
1347
+ }
1348
+ }
1349
+ customElements.define("eui-button", j);
1350
+ class B extends HTMLElement {
1351
+ static get observedAttributes() {
1352
+ return ["type", "anchor"];
1353
+ }
1354
+ constructor() {
1355
+ super(), this.attachShadow({ mode: "open" });
1356
+ }
1357
+ connectedCallback() {
1358
+ this.render(), this.hd = this.shadowRoot.querySelector(".hd"), this.hasAttribute("type") && this.hd.classList.add(this.getAttribute("type"));
1359
+ }
1360
+ render() {
1361
+ this.shadowRoot.innerHTML = `
1362
+ <style>
1363
+ :host {
1364
+ display: block;
1365
+ position: relative;
1366
+ margin: 16px 0;
1367
+ }
1368
+
1369
+ .hd {
1370
+ font-size: 2.5rem;
1371
+ font-weight: 600;
1372
+ margin: 0;
1373
+ }
1374
+
1375
+ .h2 {
1376
+ font-size: 2rem;
1377
+ }
1378
+
1379
+ .h3 {
1380
+ font-size: 1.5rem;
1381
+ }
1382
+
1383
+ .anchor {
1384
+ position: absolute;
1385
+ width: 100%;
1386
+ height: 100%;
1387
+
1388
+ inset: 0;
1389
+ inset-inline-start: -24px;
1390
+ opacity: 0;
1391
+ transition: opacity .25s var(--transition-function);
1392
+
1393
+ display: flex;
1394
+ align-items: center;
1395
+
1396
+ text-decoration: none;
1397
+ color: var(--app-accent);
1398
+ font-size: 1.5rem;
1399
+ }
1400
+
1401
+ .anchor:hover {
1402
+ opacity: 1;
1403
+ }
1404
+
1405
+ .anchor-hash {
1406
+ margin-inline-end: 8px;
1407
+ font-weight: 700;
1408
+ }
1409
+ </style>
1410
+
1411
+ <span class="hd">
1412
+ <slot></slot>
1413
+ </span>
1414
+ ${this.getAttribute("anchor") ? `
1415
+ <a class="anchor" href="#${this.getAttribute("anchor")}" id="${this.getAttribute("anchor")}">
1416
+ <span class="anchor-hash">#</span>
1417
+ </a>
1418
+ ` : ""}
1419
+ `;
1420
+ }
1421
+ }
1422
+ customElements.define("eui-heading", B);
1423
+ function q(o) {
1424
+ const i = Date.now() - o, a = Math.floor(i / 1e3), n = Math.floor(a / 60), r = Math.floor(n / 60), l = Math.floor(r / 24), c = Math.floor(l / 30), s = Math.floor(c / 12);
1425
+ return s > 0 ? `${s}y` : c > 0 ? `${c}mo` : l > 0 ? `${l}d` : r > 0 ? `${r}h` : n > 0 ? `${n}m` : `${a}s`;
1426
+ }
1427
+ function N(o) {
1428
+ const i = Date.now() - o, a = Math.floor(i / 1e3), n = Math.floor(a / 60), r = Math.floor(n / 60), l = Math.floor(r / 24), c = Math.floor(l / 30), s = Math.floor(c / 12);
1429
+ return s > 0 ? `${s} year${s > 1 ? "s" : ""} ago` : c > 0 ? `${c} month${c > 1 ? "s" : ""} ago` : l > 0 ? `${l} day${l > 1 ? "s" : ""} ago` : r > 0 ? `${r} hour${r > 1 ? "s" : ""} ago` : n > 0 ? `${n} minute${n > 1 ? "s" : ""} ago` : `${a} second${a > 1 ? "s" : ""} ago`;
1430
+ }
1431
+ function O(o) {
1432
+ return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;").replace(/`/g, "&#96;").replace(/'/g, "&#39;");
1433
+ }
1434
+ function k(o) {
1435
+ const t = document.createElement("input");
1436
+ t.value = o, document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
1437
+ }
1438
+ const J = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1439
+ __proto__: null,
1440
+ copystr: k,
1441
+ joinedAgo: N,
1442
+ sanitize: O,
1443
+ timeAgo: q
1444
+ }, Symbol.toStringTag, { value: "Module" }));
1445
+ class P extends HTMLElement {
1446
+ static get observedAttributes() {
1447
+ return ["copy", "id", "type", "language"];
1448
+ }
1449
+ constructor() {
1450
+ super(), this.attachShadow({ mode: "open" }), this._boundCopy = this._onCopy.bind(this), this._isRendered = !1;
1451
+ }
1452
+ connectedCallback() {
1453
+ this._isRendered || (this.render(), this._isRendered = !0);
1454
+ }
1455
+ attributeChangedCallback(t, e, i) {
1456
+ this._isRendered && e !== i && this.render();
1457
+ }
1458
+ render() {
1459
+ const t = this.hasAttribute("copy"), e = this.getAttribute("language") || "text";
1460
+ this.shadowRoot.innerHTML = `
1461
+ <style>
1462
+ :host {
1463
+ position: relative;
1464
+ display: block;
1465
+ }
1466
+
1467
+ pre {
1468
+ padding: 20px;
1469
+ background: var(--app-100);
1470
+ border: 1px solid var(--app-300);
1471
+ border-radius: 20px;
1472
+ font-family: 'Reddit Mono', monospace;
1473
+ font-size: 14px;
1474
+ overflow-x: auto;
1475
+ line-height: 1.5;
1476
+ white-space: pre;
1477
+ color: var(--app-text);
1478
+ }
1479
+
1480
+ .copy {
1481
+ position: absolute;
1482
+ top: 8px;
1483
+ right: 8px;
1484
+ opacity: 0;
1485
+ transition: opacity 0.2s;
1486
+ }
1487
+
1488
+ :host(:hover) .copy {
1489
+ opacity: 1;
1490
+ }
1491
+
1492
+ pre.g {
1493
+ padding-right: 60px;
1494
+ }
1495
+
1496
+ .token.comment { color: var(--app-700); font-style: italic; }
1497
+ .token.string { color: #9ECE6A; }
1498
+ .token.number { color: #F97C5F; }
1499
+ .token.keyword { color: #7DCFFF; }
1500
+ .token.function { color: #7DCFFF; }
1501
+ .token.tag { color: #DE5971; }
1502
+ .token.attr-name { color: #BB9AF7; }
1503
+ .token.attr-value { color: #9ECE6A; }
1504
+ .token.boolean { color: #F97C5F; }
1505
+ </style>
1506
+
1507
+ <eui-button class="copy" width="36" height="36" border-radius="100">
1508
+ <eui-icon name="copy" width="18" height="18"></eui-icon>
1509
+ </eui-button>
1510
+
1511
+ <pre class="${t ? "g" : ""}"><code></code></pre>
1512
+ `, this.copyBtn = this.shadowRoot.querySelector(".copy"), this.codeEl = this.shadowRoot.querySelector("code");
1513
+ const i = this._getFormattedText();
1514
+ this.codeEl.innerHTML = this._highlight(i, e), t ? this.copyBtn.addEventListener("click", this._boundCopy) : this.copyBtn.style.display = "none";
1515
+ }
1516
+ _getFormattedText() {
1517
+ let e = (this.querySelector("code") || this).innerHTML || "";
1518
+ e = this._unescapeHtml(e), e = e.replace(/^\s*\n/, "").replace(/\n\s*$/, "");
1519
+ const i = e.split(`
1520
+ `), a = i.filter((r) => r.trim()).map((r) => r.match(/^\s*/)[0].length), n = a.length ? Math.min(...a) : 0;
1521
+ return i.map((r) => r.slice(n)).join(`
1522
+ `);
1523
+ }
1524
+ _unescapeHtml(t) {
1525
+ const e = document.createElement("textarea");
1526
+ return e.innerHTML = t, e.value;
1527
+ }
1528
+ _highlight(t, e) {
1529
+ t = t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1530
+ const i = {};
1531
+ let a = 0;
1532
+ function n(r, l) {
1533
+ const c = `__TOKEN_${l}_${a++}__`;
1534
+ return i[c] = `<span class="token ${l}">${r}</span>`, c;
1535
+ }
1536
+ return ["javascript", "js", "json", "bash", "sh", "css"].includes(e) ? (t = t.replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/g, (r) => n(r, "string")), e === "bash" || e === "sh" ? t = t.replace(/(#.*$)/gm, (r) => n(r, "comment")) : e === "css" ? t = t.replace(/(\/\*[\s\S]*?\*\/)/g, (r) => n(r, "comment")) : t = t.replace(/(\/\/.*$|\/\*[\s\S]*?\*\/)/gm, (r) => n(r, "comment"))) : ["html", "xml"].includes(e) && (t = t.replace(/(&lt;!--[\s\S]*?--&gt;)/g, (r) => n(r, "comment")), t = t.replace(/(&lt;\/?[a-z0-9:-]+)/gi, (r) => n(r, "tag"))), e === "javascript" || e === "js" || e === "json" ? (t = t.replace(/\b(const|let|var|if|else|for|while|return|function|class|import|export|from|default|switch|case|break|continue|new|this|async|await)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(true|false|null|undefined)\b/g, '<span class="token boolean">$1</span>'), t = t.replace(/\b([a-zA-Z0-9_]+)\s*(?=\()/g, '<span class="token function">$1</span>')) : e === "bash" || e === "sh" ? (t = t.replace(/\b(npm|npx|node|git|cd|ls|mkdir|rm|mv|cp|echo|cat|sudo|docker|brew|grep|curl|wget|chmod|chown|touch)\b/g, '<span class="token keyword">$1</span>'), t = t.replace(/\b(install|run|build|start|test|dev|init|clone|pull|push|commit|add|checkout|branch|merge)\b/g, '<span class="token function">$1</span>'), t = t.replace(/(\s-+[a-zA-Z0-9-]+)/g, '<span class="token attr-name">$1</span>'), t = t.replace(/(\$[A-Z0-9_]+)/g, '<span class="token number">$1</span>')) : e === "html" || e === "xml" ? (t = t.replace(/\s([a-z0-9:-]+)=/gi, (r, l) => " " + n(l, "attr-name") + "="), t = t.replace(/(".*?")/g, (r) => n(r, "attr-value")), t = t.replace(/&gt;/g, '<span class="token tag">&gt;</span>')) : e === "css" && (t = t.replace(/([a-z-]+)(?=:)/g, '<span class="token keyword">$1</span>')), Object.keys(i).reverse().forEach((r) => {
1537
+ t = t.replace(r, i[r]);
1538
+ }), t;
1539
+ }
1540
+ _onCopy() {
1541
+ k(this._getFormattedText());
1542
+ const t = this.copyBtn.querySelector("eui-icon");
1543
+ if (t) {
1544
+ const e = t.getAttribute("name");
1545
+ t.setAttribute("name", "check"), setTimeout(() => t.setAttribute("name", e), 2e3);
1546
+ }
1547
+ }
1548
+ disconnectedCallback() {
1549
+ this.copyBtn && this.copyBtn.removeEventListener("click", this._boundCopy);
1550
+ }
1551
+ }
1552
+ customElements.define("eui-code", P);
1553
+ class V extends HTMLElement {
1554
+ constructor() {
1555
+ super(), this.attachShadow({ mode: "open" });
1556
+ }
1557
+ connectedCallback() {
1558
+ this.render(), this.setupEventListeners();
1559
+ }
1560
+ static get observedAttributes() {
1561
+ return ["name"];
1562
+ }
1563
+ attributeChangedCallback(t, e, i) {
1564
+ t === "name" && (this.render(), this.setupEventListeners());
1565
+ }
1566
+ setupEventListeners() {
1567
+ const t = this.shadowRoot.querySelector("#nav-toggle");
1568
+ t && t.addEventListener("click", () => {
1569
+ window.dispatchEvent(new CustomEvent("toggle-nav"));
1570
+ });
1571
+ }
1572
+ render() {
1573
+ const t = this.getAttribute("name") || "Title";
1574
+ this.shadowRoot.innerHTML = `
1575
+ <style>
1576
+ :host {
1577
+ display: block;
1578
+ width: 100%;
1579
+ height: var(--titlebar-height, 65px);
1580
+ background-color: var(--app-200);
1581
+ flex-shrink: 0;
1582
+ position: fixed;
1583
+ top: 0;
1584
+ left: 0;
1585
+ z-index: 200;
1586
+ box-sizing: border-box;
1587
+ }
1588
+
1589
+ .titlebar {
1590
+ height: 100%;
1591
+ display: flex;
1592
+ align-items: center;
1593
+ justify-content: space-between;
1594
+ box-sizing: border-box;
1595
+ }
1596
+
1597
+ .left-section {
1598
+ display: flex;
1599
+ align-items: center;
1600
+ }
1601
+
1602
+ .title {
1603
+ font-size: 1.25rem;
1604
+ font-weight: 400;
1605
+ color: var(--app-text);
1606
+ margin: 0;
1607
+ user-select: none;
1608
+ }
1609
+
1610
+ .menu-button {
1611
+ border: none;
1612
+ background-color: transparent;
1613
+ cursor: pointer;
1614
+ width: 42px;
1615
+ height: 42px;
1616
+ display: flex;
1617
+ align-items: center;
1618
+ justify-content: center;
1619
+ box-sizing: border-box;
1620
+ border-radius: 50%;
1621
+ color: inherit;
1622
+ padding: 0;
1623
+ }
1624
+
1625
+ .menu-button:hover {
1626
+ background-color: var(--app-300);
1627
+ }
1628
+
1629
+ .menu-button:active {
1630
+ transform: scale(0.95);
1631
+ }
1632
+
1633
+ .menu-button:focus-visible {
1634
+ outline: 2px solid var(--app-link);
1635
+ outline-offset: 2px;
1636
+ }
1637
+
1638
+ .right-section {
1639
+ display: flex;
1640
+ align-items: center;
1641
+ padding-right: 1rem;
1642
+ }
1643
+
1644
+ .nav-section {
1645
+ width: var(--nav-width, 75px);
1646
+
1647
+ display: flex;
1648
+ align-items: center;
1649
+ justify-content: center;
1650
+ }
1651
+ </style>
1652
+
1653
+ <div class="titlebar">
1654
+ <div class="left-section">
1655
+ <div class="nav-section">
1656
+ <eui-button class="menu-button" id="nav-toggle" aria-label="Toggle Navigation" aria-expanded="false" aria-controls="nav-items" tabindex="0" type="transparent" border-radius="100">
1657
+ <eui-icon width="24" height="24" name="menu"></eui-icon>
1658
+ </eui-button>
1659
+ </div>
1660
+ <h2 class="title">${t}</h2>
1661
+ </div>
1662
+ <div class="right-section">
1663
+ <slot></slot>
1664
+ </div>
1665
+ </div>
1666
+ `;
1667
+ }
1668
+ }
1669
+ customElements.define("eui-app-titlebar", V);
1670
+ class D extends HTMLElement {
1671
+ constructor() {
1672
+ super(), this.attachShadow({ mode: "open" }), this._handleMouseDown = this._addRipple.bind(this);
1673
+ }
1674
+ connectedCallback() {
1675
+ this.render(), this.setupEventListeners();
1676
+ }
1677
+ static get observedAttributes() {
1678
+ return ["elevated", "interactive", "ripple"];
1679
+ }
1680
+ attributeChangedCallback(t, e, i) {
1681
+ e !== i && t === "ripple" && this.setupEventListeners();
1682
+ }
1683
+ setupEventListeners() {
1684
+ this.removeEventListener("mousedown", this._handleMouseDown), this.hasAttribute("ripple") && this.addEventListener("mousedown", this._handleMouseDown);
1685
+ }
1686
+ _addRipple(t) {
1687
+ const e = this.getBoundingClientRect(), i = document.createElement("span"), a = Math.max(e.width, e.height), n = a / 2;
1688
+ i.style.width = i.style.height = `${a}px`, i.style.left = `${t.clientX - e.left - n}px`, i.style.top = `${t.clientY - e.top - n}px`, i.classList.add("ripple"), this.shadowRoot.querySelector(".surface").appendChild(i), i.addEventListener("animationend", () => {
1689
+ i.remove();
1690
+ });
1691
+ }
1692
+ render() {
1693
+ this.shadowRoot.innerHTML = `
1694
+ <style>
1695
+ :host {
1696
+ display: block;
1697
+ border-radius: 12px;
1698
+ background-color: var(--app-200);
1699
+ transition: background-color 0.2s cubic-bezier(.4, 0, .2, 1),
1700
+ box-shadow 0.2s cubic-bezier(.4, 0, .2, 1);
1701
+ overflow: hidden;
1702
+ position: relative;
1703
+ height: auto;
1704
+ z-index: 1;
1705
+ }
1706
+
1707
+ :host([elevated]) {
1708
+ background-color: var(--app-100);
1709
+ box-shadow: inset 0 0 0 1px var(--app-300);
1710
+ }
1711
+
1712
+ :host([interactive]) {
1713
+ cursor: pointer;
1714
+ }
1715
+
1716
+ :host([interactive]:hover) {
1717
+ background-color: var(--app-300);
1718
+ }
1719
+
1720
+ :host([interactive][elevated]:hover) {
1721
+ background-color: var(--app-100);
1722
+ box-shadow: inset 0 0 0 1px var(--app-300), 0 4px 12px rgba(0,0,0,0.1);
1723
+ }
1724
+
1725
+ .surface {
1726
+ position: relative;
1727
+ z-index: 2;
1728
+ width: 100%;
1729
+ height: 100%;
1730
+ }
1731
+
1732
+ .ripple {
1733
+ position: absolute;
1734
+ border-radius: 50%;
1735
+ transform: scale(0);
1736
+ opacity: 0.2;
1737
+ animation: ripple 600ms linear forwards;
1738
+ background-color: currentColor;
1739
+ pointer-events: none;
1740
+ z-index: -1;
1741
+ will-change: transform, opacity;
1742
+ }
1743
+
1744
+ @keyframes ripple {
1745
+ to {
1746
+ transform: scale(4);
1747
+ opacity: 0;
1748
+ }
1749
+ }
1750
+ </style>
1751
+ <div class="surface">
1752
+ <slot></slot>
1753
+ </div>
1754
+ `;
1755
+ }
1756
+ }
1757
+ customElements.define("eui-surface", D);
1758
+ typeof window < "u" && console.log("ErisUI loaded successfully");
1759
+ export {
1760
+ U as device,
1761
+ Z as haptics,
1762
+ u as icons,
1763
+ W as loadPage,
1764
+ y as router,
1765
+ X as storage,
1766
+ J as utils
1767
+ };