@wsxjs/wsx-base-components 0.0.13 → 0.0.15
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.
- package/dist/index.cjs +2 -2
- package/dist/index.js +1051 -1117
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import { autoRegister as re, WebComponent as X, jsx as n, createLogger as ne, LightComponent as
|
|
2
|
-
const
|
|
3
|
-
var
|
|
4
|
-
let
|
|
1
|
+
import { autoRegister as re, WebComponent as X, jsx as n, createLogger as ae, state as ne, LightComponent as fe } from "@wsxjs/wsx-core";
|
|
2
|
+
const Rt = ':host{position:relative;display:inline-flex;padding:.25em .625em;box-sizing:border-box;vertical-align:middle;line-height:1.8;overflow:hidden;align-items:center;justify-content:center;font-size:14px;color:var(--fontColor, #333);border-radius:var(--borderRadius, .25em);background:var(--fontColor, #333);transition:background .3s,box-shadow .3s,border-color .3s,color .3s}:host([size="xxxs"]){padding:.03125em .0625em;font-size:6px;line-height:1;min-width:10px;min-height:8px;border-radius:1px}:host([size="xxs"]){padding:.0625em .125em;font-size:8px;line-height:1.1;min-width:14px;min-height:12px;border-radius:2px}:host([size="xs"]){padding:.125em .25em;font-size:10px;line-height:1.2;min-width:18px;min-height:16px;border-radius:3px}:host([size="sm"]){padding:.25em .5em;font-size:12px;line-height:1.4;min-width:24px;min-height:20px;border-radius:4px}:host([size="md"]){padding:.375em .75em;font-size:14px;line-height:1.5;min-width:32px;min-height:28px;border-radius:6px}:host([size="lg"]){padding:.5em 1em;font-size:14px;line-height:1.6;min-width:40px;min-height:32px;border-radius:6px}:host([size="xl"]){padding:.625em 1.25em;font-size:16px;line-height:1.6;min-width:48px;min-height:40px;border-radius:8px}:host([shape="circle"]){border-radius:50%}:host([disabled]),:host([loading]){pointer-events:none;opacity:.6}:host([block]){display:flex}:host([disabled]:not([variant])){background:#0000001a}:host([disabled]) .btn,:host([loading]) .btn{cursor:not-allowed;pointer-events:all}:host(:not([variant="primary"]):not([variant="danger"]):not([disabled]):hover),:host(:not([variant="primary"]):not([variant="danger"]):focus-within),:host([variant="flat"][focus]){color:var(--themeColor, #42b983);border-color:var(--themeColor, #42b983)}:host(:not([variant="primary"]):not([variant="danger"])) .btn:after{background-image:radial-gradient(circle,var(--themeColor, #42b983) 10%,transparent 10.01%)}:host([variant="primary"]){color:#fff;background:var(--themeBackground, var(--themeColor, #42b983))}:host([variant="danger"]){color:#fff;background:var(--themeBackground, var(--dangerColor, #ff7875))}:host([variant="dashed"]){border-style:dashed}:host([variant="flat"]),:host([variant="primary"]),:host([variant="danger"]){border:0;padding:calc(.25em + 1px) calc(.625em + 1px)}:host([variant="flat"]) .btn:before{content:"";position:absolute;background:var(--themeColor, #42b983);pointer-events:none;left:0;right:0;top:0;bottom:0;opacity:0;transition:.3s}:host([variant="flat"]:not([disabled]):hover) .btn:before{opacity:.1}:host(:not([disabled]):hover){z-index:1}:host([variant="flat"]:focus-within) .btn:before,:host([variant="flat"][focus]) .btn:before{opacity:.2}.btn{background:none;outline:0;border:0;position:absolute;left:0;top:0;width:100%;height:100%;padding:0;-webkit-user-select:none;user-select:none;cursor:unset}.loading{margin-right:.35em}::-moz-focus-inner{border:0}.btn:before{content:"";display:block;position:absolute;width:100%;height:100%;left:0;top:0;transition:.2s;background:#fff;opacity:0}:host(:not([disabled]):active) .btn:before{opacity:.2}.btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--x, 0);top:var(--y, 0);pointer-events:none;background-image:radial-gradient(circle,#fff 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}.btn:not([disabled]):active:after{transform:translate(-50%,-50%) scale(0);opacity:.3;transition:0s}.icon{margin-right:.35em;transition:none}:host(:empty) .icon{margin:auto}:host(:empty){padding:.65em}:host([type="flat"]:empty),:host([type="primary"]:empty){padding:calc(.65em + 1px)}::slotted(.icon){transition:none}:host([href]){cursor:pointer}';
|
|
3
|
+
var je;
|
|
4
|
+
let Ie, Oe;
|
|
5
5
|
function q(t, e, r) {
|
|
6
6
|
return (e = Pe(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
function
|
|
10
|
-
return function(
|
|
11
|
-
return u && u(
|
|
8
|
+
function Bt(t, e, r, b, R, U) {
|
|
9
|
+
function E(o, l, u) {
|
|
10
|
+
return function(a, s) {
|
|
11
|
+
return u && u(a), o[l].call(a, s);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function B(o, l) {
|
|
15
15
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
16
16
|
return l;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
if (typeof o != "function" && (
|
|
18
|
+
function T(o, l, u, a) {
|
|
19
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
20
20
|
return o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
23
23
|
function v(c) {
|
|
24
24
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
25
25
|
}
|
|
26
|
-
var d, x = l[0], k = l[3],
|
|
27
|
-
if (!
|
|
26
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
27
|
+
if (!_) {
|
|
28
28
|
u || Array.isArray(x) || (x = [x]);
|
|
29
|
-
var i = {}, C = [], m =
|
|
30
|
-
y ? (
|
|
29
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
30
|
+
y ? (g || f ? i = { get: xe(function() {
|
|
31
31
|
return k(this);
|
|
32
|
-
},
|
|
32
|
+
}, a, "get"), set: function(c) {
|
|
33
33
|
l[4](this, c);
|
|
34
|
-
} } : i[m] = k,
|
|
34
|
+
} } : i[m] = k, g || xe(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
35
35
|
}
|
|
36
36
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
37
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
37
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
38
38
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
39
|
-
|
|
39
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
40
40
|
}).bind(null, J) };
|
|
41
41
|
try {
|
|
42
|
-
if (
|
|
42
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
43
43
|
else {
|
|
44
|
-
var $,
|
|
45
|
-
D.static =
|
|
44
|
+
var $, O;
|
|
45
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
46
46
|
return v(c), i.value;
|
|
47
|
-
} : (
|
|
48
|
-
return c[
|
|
49
|
-
}, (
|
|
50
|
-
c[
|
|
47
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
48
|
+
return c[a];
|
|
49
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
50
|
+
c[a] = w;
|
|
51
51
|
}));
|
|
52
52
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
53
|
-
return
|
|
53
|
+
return a in c;
|
|
54
54
|
} };
|
|
55
|
-
if ($ && (W.get = $),
|
|
56
|
-
if (typeof h == "object" && h) (d =
|
|
55
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
56
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
57
57
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
58
|
-
} else
|
|
58
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
59
59
|
}
|
|
60
60
|
} finally {
|
|
61
61
|
J.v = !0;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return (
|
|
65
|
-
for (var
|
|
64
|
+
return (g || f) && S.push(function(c, w) {
|
|
65
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
66
66
|
return w;
|
|
67
|
-
}),
|
|
67
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function M(o, l) {
|
|
70
70
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
71
71
|
}
|
|
72
|
-
if (arguments.length >= 6) var H =
|
|
73
|
-
var
|
|
74
|
-
var
|
|
75
|
-
return
|
|
76
|
-
},
|
|
72
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
73
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
74
|
+
var s, z, L = [], S = function(m) {
|
|
75
|
+
return Mt(m) === o;
|
|
76
|
+
}, j = /* @__PURE__ */ new Map();
|
|
77
77
|
function y(m) {
|
|
78
78
|
m && L.push(B.bind(null, m));
|
|
79
79
|
}
|
|
80
|
-
for (var
|
|
81
|
-
var f = l[
|
|
80
|
+
for (var g = 0; g < l.length; g++) {
|
|
81
|
+
var f = l[g];
|
|
82
82
|
if (Array.isArray(f)) {
|
|
83
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
84
|
-
if (!
|
|
85
|
-
var C =
|
|
83
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
84
|
+
if (!_ && !d) {
|
|
85
|
+
var C = j.get(i);
|
|
86
86
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
87
|
-
|
|
87
|
+
j.set(i, !(p > 2) || p);
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : Pe(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
return y(
|
|
93
|
-
}(t, e,
|
|
94
|
-
return r.length ||
|
|
92
|
+
return y(s), y(z), L;
|
|
93
|
+
}(t, e, R, A);
|
|
94
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
95
95
|
var o = [];
|
|
96
|
-
return r.length && [
|
|
96
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
97
97
|
} };
|
|
98
98
|
}
|
|
99
99
|
function Pe(t) {
|
|
100
|
-
var e =
|
|
100
|
+
var e = Nt(t, "string");
|
|
101
101
|
return typeof e == "symbol" ? e : e + "";
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Nt(t, e) {
|
|
104
104
|
if (typeof t != "object" || !t) return t;
|
|
105
105
|
var r = t[Symbol.toPrimitive];
|
|
106
106
|
if (r !== void 0) {
|
|
107
|
-
var
|
|
108
|
-
if (typeof
|
|
107
|
+
var b = r.call(t, e);
|
|
108
|
+
if (typeof b != "object") return b;
|
|
109
109
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
110
110
|
}
|
|
111
111
|
return String(t);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function xe(t, e, r) {
|
|
114
114
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
115
115
|
try {
|
|
116
116
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -118,15 +118,15 @@ function ve(t, e, r) {
|
|
|
118
118
|
}
|
|
119
119
|
return t;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Mt(t) {
|
|
122
122
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
123
123
|
return t;
|
|
124
124
|
}
|
|
125
125
|
Oe = [re({
|
|
126
126
|
tagName: "xy-button"
|
|
127
127
|
})];
|
|
128
|
-
let
|
|
129
|
-
class
|
|
128
|
+
let Ut;
|
|
129
|
+
class Ht extends X {
|
|
130
130
|
static get observedAttributes() {
|
|
131
131
|
return ["disabled", "icon", "loading", "href", "type", "target", "rel", "download", "toggle", "checked", "variant", "shape", "block", "size"];
|
|
132
132
|
}
|
|
@@ -134,10 +134,10 @@ class Lt extends X {
|
|
|
134
134
|
super({
|
|
135
135
|
styleName: "xy-button",
|
|
136
136
|
...e
|
|
137
|
-
}), q(this, "_autoStyles",
|
|
137
|
+
}), q(this, "_autoStyles", Rt), q(this, "disabled", !1), q(this, "loading", !1), q(this, "toggle", !1), q(this, "checked", !1), q(this, "icon", null), q(this, "href", null), q(this, "type", null), q(this, "target", "_blank"), q(this, "rel", null), q(this, "download", null), q(this, "variant", "flat"), q(this, "size", "md"), q(this, "btnElement", void 0), q(this, "iconElement", void 0), q(this, "loadingElement", void 0), q(this, "handleMouseDown", (r) => {
|
|
138
138
|
if (this.disabled) return;
|
|
139
|
-
const
|
|
140
|
-
this.style.setProperty("--x", `${
|
|
139
|
+
const b = this.getBoundingClientRect(), R = r.clientX - b.left, U = r.clientY - b.top;
|
|
140
|
+
this.style.setProperty("--x", `${R}px`), this.style.setProperty("--y", `${U}px`);
|
|
141
141
|
}), q(this, "handleKeyDown", (r) => {
|
|
142
142
|
(r.code === "Enter" || r.code === "Space") && r.stopPropagation();
|
|
143
143
|
}), q(this, "handleClick", () => {
|
|
@@ -145,12 +145,12 @@ class Lt extends X {
|
|
|
145
145
|
}), this.disabled = e.disabled || !1, this.loading = e.loading || !1, this.toggle = e.toggle || !1, this.checked = e.checked || !1, this.icon = e.icon || null, this.href = e.href || null, this.type = e.type || null, this.target = e.target || "_blank", this.rel = e.rel || null, this.download = e.download || null, this.variant = e.variant || "flat", this.size = e.size || "md";
|
|
146
146
|
}
|
|
147
147
|
render() {
|
|
148
|
-
const e = !!this.href, r = /* @__PURE__ */ n("a", { href: this.href, target: this.target, rel: this.rel || void 0, download: this.download || void 0, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (
|
|
149
|
-
this.btnElement =
|
|
150
|
-
} }, this.renderContent()),
|
|
151
|
-
this.btnElement =
|
|
148
|
+
const e = !!this.href, r = /* @__PURE__ */ n("a", { href: this.href, target: this.target, rel: this.rel || void 0, download: this.download || void 0, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (R) => {
|
|
149
|
+
this.btnElement = R;
|
|
150
|
+
} }, this.renderContent()), b = /* @__PURE__ */ n("button", { type: this.type || "button", disabled: this.disabled, className: "btn", onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown, ref: (R) => {
|
|
151
|
+
this.btnElement = R;
|
|
152
152
|
}, "data-wsx-key": "XyButton-button-text-0" }, this.renderContent());
|
|
153
|
-
return /* @__PURE__ */ n("div", { className: "xy-button-container" }, e ? r :
|
|
153
|
+
return /* @__PURE__ */ n("div", { className: "xy-button-container" }, e ? r : b);
|
|
154
154
|
}
|
|
155
155
|
renderContent() {
|
|
156
156
|
const e = [];
|
|
@@ -175,43 +175,43 @@ class Lt extends X {
|
|
|
175
175
|
/**
|
|
176
176
|
* 属性变化处理
|
|
177
177
|
*/
|
|
178
|
-
onAttributeChanged(e, r,
|
|
178
|
+
onAttributeChanged(e, r, b) {
|
|
179
179
|
switch (e) {
|
|
180
180
|
case "disabled":
|
|
181
|
-
this.disabled =
|
|
181
|
+
this.disabled = b !== null, this.updateButtonState();
|
|
182
182
|
break;
|
|
183
183
|
case "loading":
|
|
184
|
-
this.loading =
|
|
184
|
+
this.loading = b !== null, this.updateButtonState(), this.rerender();
|
|
185
185
|
break;
|
|
186
186
|
case "icon":
|
|
187
|
-
this.icon =
|
|
187
|
+
this.icon = b, this.rerender();
|
|
188
188
|
break;
|
|
189
189
|
case "href":
|
|
190
|
-
this.href =
|
|
190
|
+
this.href = b, this.rerender();
|
|
191
191
|
break;
|
|
192
192
|
case "type":
|
|
193
|
-
this.type =
|
|
193
|
+
this.type = b, this.updateButtonState();
|
|
194
194
|
break;
|
|
195
195
|
case "target":
|
|
196
|
-
this.target =
|
|
196
|
+
this.target = b || "_blank";
|
|
197
197
|
break;
|
|
198
198
|
case "rel":
|
|
199
|
-
this.rel =
|
|
199
|
+
this.rel = b;
|
|
200
200
|
break;
|
|
201
201
|
case "download":
|
|
202
|
-
this.download =
|
|
202
|
+
this.download = b;
|
|
203
203
|
break;
|
|
204
204
|
case "toggle":
|
|
205
|
-
this.toggle =
|
|
205
|
+
this.toggle = b !== null;
|
|
206
206
|
break;
|
|
207
207
|
case "checked":
|
|
208
|
-
this.checked =
|
|
208
|
+
this.checked = b !== null;
|
|
209
209
|
break;
|
|
210
210
|
case "variant":
|
|
211
|
-
this.variant =
|
|
211
|
+
this.variant = b || "flat";
|
|
212
212
|
break;
|
|
213
213
|
case "size":
|
|
214
|
-
this.size =
|
|
214
|
+
this.size = b || "md";
|
|
215
215
|
break;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
@@ -256,121 +256,121 @@ class Lt extends X {
|
|
|
256
256
|
e ? this.setAttr("icon", e) : this.removeAttr("icon");
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
|
|
260
|
-
[
|
|
261
|
-
|
|
262
|
-
const
|
|
263
|
-
var
|
|
264
|
-
let
|
|
265
|
-
function
|
|
266
|
-
return (e =
|
|
259
|
+
je = Ht;
|
|
260
|
+
[Ut, Ie] = Bt(je, [], Oe, 0, void 0, X).c;
|
|
261
|
+
Ie();
|
|
262
|
+
const Ft = ':host{display:inline-flex}::slotted(xy-button:not(:first-of-type):not(:last-of-type)){border-radius:0}::slotted(xy-button){margin:0!important}::slotted(xy-button:not(:first-of-type)){margin-left:-1px!important}::slotted(xy-button[type]:not([type="dashed"]):not(:first-of-type)){margin-left:1px!important}::slotted(xy-button:first-of-type){border-top-right-radius:0;border-bottom-right-radius:0}::slotted(xy-button:last-of-type){border-top-left-radius:0;border-bottom-left-radius:0}';
|
|
263
|
+
var Re;
|
|
264
|
+
let Be, Ne;
|
|
265
|
+
function ke(t, e, r) {
|
|
266
|
+
return (e = Me(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
function
|
|
270
|
-
return function(
|
|
271
|
-
return u && u(
|
|
268
|
+
function Kt(t, e, r, b, R, U) {
|
|
269
|
+
function E(o, l, u) {
|
|
270
|
+
return function(a, s) {
|
|
271
|
+
return u && u(a), o[l].call(a, s);
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
function B(o, l) {
|
|
275
275
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
276
276
|
return l;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
if (typeof o != "function" && (
|
|
278
|
+
function T(o, l, u, a) {
|
|
279
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
280
280
|
return o;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
283
283
|
function v(c) {
|
|
284
284
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
285
285
|
}
|
|
286
|
-
var d, x = l[0], k = l[3],
|
|
287
|
-
if (!
|
|
286
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
287
|
+
if (!_) {
|
|
288
288
|
u || Array.isArray(x) || (x = [x]);
|
|
289
|
-
var i = {}, C = [], m =
|
|
290
|
-
y ? (
|
|
289
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
290
|
+
y ? (g || f ? i = { get: Ce(function() {
|
|
291
291
|
return k(this);
|
|
292
|
-
},
|
|
292
|
+
}, a, "get"), set: function(c) {
|
|
293
293
|
l[4](this, c);
|
|
294
|
-
} } : i[m] = k,
|
|
294
|
+
} } : i[m] = k, g || Ce(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
295
295
|
}
|
|
296
296
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
297
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
297
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
298
298
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
299
|
-
|
|
299
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
300
300
|
}).bind(null, J) };
|
|
301
301
|
try {
|
|
302
|
-
if (
|
|
302
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
303
303
|
else {
|
|
304
|
-
var $,
|
|
305
|
-
D.static =
|
|
304
|
+
var $, O;
|
|
305
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
306
306
|
return v(c), i.value;
|
|
307
|
-
} : (
|
|
308
|
-
return c[
|
|
309
|
-
}, (
|
|
310
|
-
c[
|
|
307
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
308
|
+
return c[a];
|
|
309
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
310
|
+
c[a] = w;
|
|
311
311
|
}));
|
|
312
312
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
313
|
-
return
|
|
313
|
+
return a in c;
|
|
314
314
|
} };
|
|
315
|
-
if ($ && (W.get = $),
|
|
316
|
-
if (typeof h == "object" && h) (d =
|
|
315
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
316
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
317
317
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
318
|
-
} else
|
|
318
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
319
319
|
}
|
|
320
320
|
} finally {
|
|
321
321
|
J.v = !0;
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
return (
|
|
325
|
-
for (var
|
|
324
|
+
return (g || f) && S.push(function(c, w) {
|
|
325
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
326
326
|
return w;
|
|
327
|
-
}),
|
|
327
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function M(o, l) {
|
|
330
330
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
331
331
|
}
|
|
332
|
-
if (arguments.length >= 6) var H =
|
|
333
|
-
var
|
|
334
|
-
var
|
|
335
|
-
return
|
|
336
|
-
},
|
|
332
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
333
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
334
|
+
var s, z, L = [], S = function(m) {
|
|
335
|
+
return Wt(m) === o;
|
|
336
|
+
}, j = /* @__PURE__ */ new Map();
|
|
337
337
|
function y(m) {
|
|
338
338
|
m && L.push(B.bind(null, m));
|
|
339
339
|
}
|
|
340
|
-
for (var
|
|
341
|
-
var f = l[
|
|
340
|
+
for (var g = 0; g < l.length; g++) {
|
|
341
|
+
var f = l[g];
|
|
342
342
|
if (Array.isArray(f)) {
|
|
343
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
344
|
-
if (!
|
|
345
|
-
var C =
|
|
343
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
344
|
+
if (!_ && !d) {
|
|
345
|
+
var C = j.get(i);
|
|
346
346
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
347
|
-
|
|
347
|
+
j.set(i, !(p > 2) || p);
|
|
348
348
|
}
|
|
349
|
-
|
|
349
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : Me(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
return y(
|
|
353
|
-
}(t, e,
|
|
354
|
-
return r.length ||
|
|
352
|
+
return y(s), y(z), L;
|
|
353
|
+
}(t, e, R, A);
|
|
354
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
355
355
|
var o = [];
|
|
356
|
-
return r.length && [
|
|
356
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
357
357
|
} };
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
var e =
|
|
359
|
+
function Me(t) {
|
|
360
|
+
var e = Jt(t, "string");
|
|
361
361
|
return typeof e == "symbol" ? e : e + "";
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Jt(t, e) {
|
|
364
364
|
if (typeof t != "object" || !t) return t;
|
|
365
365
|
var r = t[Symbol.toPrimitive];
|
|
366
366
|
if (r !== void 0) {
|
|
367
|
-
var
|
|
368
|
-
if (typeof
|
|
367
|
+
var b = r.call(t, e);
|
|
368
|
+
if (typeof b != "object") return b;
|
|
369
369
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
370
370
|
}
|
|
371
371
|
return String(t);
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Ce(t, e, r) {
|
|
374
374
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
375
375
|
try {
|
|
376
376
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -378,15 +378,15 @@ function ke(t, e, r) {
|
|
|
378
378
|
}
|
|
379
379
|
return t;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Wt(t) {
|
|
382
382
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
383
383
|
return t;
|
|
384
384
|
}
|
|
385
|
-
|
|
385
|
+
Ne = [re({
|
|
386
386
|
tagName: "xy-button-group"
|
|
387
387
|
})];
|
|
388
|
-
let
|
|
389
|
-
class
|
|
388
|
+
let Gt;
|
|
389
|
+
class Xt extends X {
|
|
390
390
|
static get observedAttributes() {
|
|
391
391
|
return ["disabled"];
|
|
392
392
|
}
|
|
@@ -394,7 +394,7 @@ class Rt extends X {
|
|
|
394
394
|
super({
|
|
395
395
|
styleName: "xy-button-group",
|
|
396
396
|
...e
|
|
397
|
-
}),
|
|
397
|
+
}), ke(this, "_autoStyles", Ft), ke(this, "disabled", !1), this.disabled = e.disabled || !1;
|
|
398
398
|
}
|
|
399
399
|
render() {
|
|
400
400
|
return /* @__PURE__ */ n("div", { class: "button-group-container" }, /* @__PURE__ */ n("slot", null));
|
|
@@ -402,10 +402,10 @@ class Rt extends X {
|
|
|
402
402
|
/**
|
|
403
403
|
* 属性变化处理
|
|
404
404
|
*/
|
|
405
|
-
onAttributeChanged(e, r,
|
|
405
|
+
onAttributeChanged(e, r, b) {
|
|
406
406
|
switch (e) {
|
|
407
407
|
case "disabled":
|
|
408
|
-
this.disabled =
|
|
408
|
+
this.disabled = b !== null, this.updateChildrenDisabledState();
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
@@ -456,160 +456,160 @@ class Rt extends X {
|
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
|
|
460
|
-
[
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
function
|
|
459
|
+
Re = Xt;
|
|
460
|
+
[Gt, Be] = Kt(Re, [], Ne, 0, void 0, X).c;
|
|
461
|
+
Be();
|
|
462
|
+
const pe = "editor-js-text-color-cache";
|
|
463
|
+
function qt(t) {
|
|
464
464
|
return t.startsWith("var(") && t.endsWith(")");
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function Yt(t) {
|
|
467
467
|
return t.slice(4, -1).trim();
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Qt(t) {
|
|
470
470
|
return getComputedStyle(document.documentElement).getPropertyValue(t).trim() || t;
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
if (
|
|
474
|
-
const e =
|
|
475
|
-
return
|
|
472
|
+
function de(t) {
|
|
473
|
+
if (qt(t)) {
|
|
474
|
+
const e = Yt(t);
|
|
475
|
+
return Qt(e);
|
|
476
476
|
}
|
|
477
477
|
return t;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
480
|
-
return sessionStorage.setItem(`${
|
|
479
|
+
function Vt(t, e) {
|
|
480
|
+
return sessionStorage.setItem(`${pe}-${e}`, JSON.stringify(t)), t;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
sessionStorage.setItem(`${
|
|
482
|
+
function Zt(t, e) {
|
|
483
|
+
sessionStorage.setItem(`${pe}-${e}-custom`, JSON.stringify(t));
|
|
484
484
|
}
|
|
485
|
-
function
|
|
486
|
-
const e = sessionStorage.getItem(`${
|
|
485
|
+
function er(t) {
|
|
486
|
+
const e = sessionStorage.getItem(`${pe}-${t}-custom`);
|
|
487
487
|
return e ? JSON.parse(e) : null;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function tr(t, e) {
|
|
490
490
|
let r = null;
|
|
491
|
-
return (...
|
|
491
|
+
return (...b) => {
|
|
492
492
|
r || (r = setTimeout(() => {
|
|
493
|
-
t(...
|
|
493
|
+
t(...b), r = null;
|
|
494
494
|
}, e));
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
const r = sessionStorage.getItem(`${
|
|
497
|
+
function lo(t, e) {
|
|
498
|
+
const r = sessionStorage.getItem(`${pe}-${e}`);
|
|
499
499
|
return r ? JSON.parse(r) : t;
|
|
500
500
|
}
|
|
501
|
-
const
|
|
502
|
-
var
|
|
503
|
-
let
|
|
501
|
+
const co = "ce-inline-toolbar__dropdown", uo = "ce-conversion-toolbar--showed", rr = '.color-section{display:inline-block;position:relative}.color-popover{display:inline-block;position:relative;overflow:visible}.color-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:1px solid #e1e5e9;border-radius:3px;background:var(--theme-color, #000);color:transparent;cursor:pointer;transition:all .2s ease;box-sizing:border-box}.color-btn:hover:not(.disabled){border-color:#3f51b5;box-shadow:0 2px 8px #3f51b54d}.color-btn.disabled{opacity:.5;cursor:not-allowed}.color-indicator{font-size:12px;line-height:1;-webkit-user-select:none;user-select:none}.color-panel{position:absolute;top:100%;left:0;z-index:10000;background:#fff;border:1px solid #e1e5e9;border-radius:6px;box-shadow:0 4px 20px #00000026;padding:8px;margin-top:4px;box-sizing:border-box;transform-origin:top left;animation:colorPanelShow .2s ease-out}@keyframes colorPanelShow{0%{opacity:0;transform:scale(.9) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}.color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;min-width:160px}.color-cube{width:20px;height:20px;border:1px solid #e1e5e9;border-radius:3px;cursor:pointer;transition:all .2s ease;box-sizing:border-box;background-color:var(--cube-color, #000)}.color-cube:hover{border-color:#3f51b5;transform:scale(1.1);box-shadow:0 2px 8px #3f51b566;z-index:1}.color-cube:active{transform:scale(.95)}.color-cube.custom-picker{background:linear-gradient(45deg,red,#ff8000,#ff0,#80ff00 42%,#0f0 57%,#00ff80,#0ff 85%,#0080ff);position:relative}.color-cube.custom-picker:after{content:"+";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:12px;font-weight:700;text-shadow:0 0 2px rgba(0,0,0,.8);pointer-events:none}:host([disabled]) .color-btn{opacity:.5;cursor:not-allowed}:host([open]) .color-panel{display:block}:host(:not([open])) .color-panel{display:none}@media (max-width: 768px){.color-panel{position:fixed;top:auto;left:50%;bottom:10px;transform:translate(-50%);width:90vw;max-width:300px}.color-grid{grid-template-columns:repeat(8,1fr);gap:6px}.color-cube{width:24px;height:24px}}@media (prefers-color-scheme: dark){.color-panel{background:#2d2d2d;border-color:#404040;color:#fff}.color-btn,.color-cube{border-color:#404040}}';
|
|
502
|
+
var Ue;
|
|
503
|
+
let He, Fe;
|
|
504
504
|
function Y(t, e, r) {
|
|
505
|
-
return (e =
|
|
505
|
+
return (e = Ke(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
function
|
|
509
|
-
return function(
|
|
510
|
-
return u && u(
|
|
507
|
+
function or(t, e, r, b, R, U) {
|
|
508
|
+
function E(o, l, u) {
|
|
509
|
+
return function(a, s) {
|
|
510
|
+
return u && u(a), o[l].call(a, s);
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
513
|
function B(o, l) {
|
|
514
514
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
515
515
|
return l;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
if (typeof o != "function" && (
|
|
517
|
+
function T(o, l, u, a) {
|
|
518
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
519
519
|
return o;
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
522
522
|
function v(c) {
|
|
523
523
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
524
524
|
}
|
|
525
|
-
var d, x = l[0], k = l[3],
|
|
526
|
-
if (!
|
|
525
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
526
|
+
if (!_) {
|
|
527
527
|
u || Array.isArray(x) || (x = [x]);
|
|
528
|
-
var i = {}, C = [], m =
|
|
529
|
-
y ? (
|
|
528
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
529
|
+
y ? (g || f ? i = { get: we(function() {
|
|
530
530
|
return k(this);
|
|
531
|
-
},
|
|
531
|
+
}, a, "get"), set: function(c) {
|
|
532
532
|
l[4](this, c);
|
|
533
|
-
} } : i[m] = k,
|
|
533
|
+
} } : i[m] = k, g || we(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
534
534
|
}
|
|
535
535
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
536
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
536
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
537
537
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
538
|
-
|
|
538
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
539
539
|
}).bind(null, J) };
|
|
540
540
|
try {
|
|
541
|
-
if (
|
|
541
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
542
542
|
else {
|
|
543
|
-
var $,
|
|
544
|
-
D.static =
|
|
543
|
+
var $, O;
|
|
544
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
545
545
|
return v(c), i.value;
|
|
546
|
-
} : (
|
|
547
|
-
return c[
|
|
548
|
-
}, (
|
|
549
|
-
c[
|
|
546
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
547
|
+
return c[a];
|
|
548
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
549
|
+
c[a] = w;
|
|
550
550
|
}));
|
|
551
551
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
552
|
-
return
|
|
552
|
+
return a in c;
|
|
553
553
|
} };
|
|
554
|
-
if ($ && (W.get = $),
|
|
555
|
-
if (typeof h == "object" && h) (d =
|
|
554
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
555
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
556
556
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
557
|
-
} else
|
|
557
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
558
558
|
}
|
|
559
559
|
} finally {
|
|
560
560
|
J.v = !0;
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
return (
|
|
564
|
-
for (var
|
|
563
|
+
return (g || f) && S.push(function(c, w) {
|
|
564
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
565
565
|
return w;
|
|
566
|
-
}),
|
|
566
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function M(o, l) {
|
|
569
569
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
570
570
|
}
|
|
571
|
-
if (arguments.length >= 6) var H =
|
|
572
|
-
var
|
|
573
|
-
var
|
|
574
|
-
return
|
|
575
|
-
},
|
|
571
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
572
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
573
|
+
var s, z, L = [], S = function(m) {
|
|
574
|
+
return nr(m) === o;
|
|
575
|
+
}, j = /* @__PURE__ */ new Map();
|
|
576
576
|
function y(m) {
|
|
577
577
|
m && L.push(B.bind(null, m));
|
|
578
578
|
}
|
|
579
|
-
for (var
|
|
580
|
-
var f = l[
|
|
579
|
+
for (var g = 0; g < l.length; g++) {
|
|
580
|
+
var f = l[g];
|
|
581
581
|
if (Array.isArray(f)) {
|
|
582
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
583
|
-
if (!
|
|
584
|
-
var C =
|
|
582
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
583
|
+
if (!_ && !d) {
|
|
584
|
+
var C = j.get(i);
|
|
585
585
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
586
|
-
|
|
586
|
+
j.set(i, !(p > 2) || p);
|
|
587
587
|
}
|
|
588
|
-
|
|
588
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : Ke(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
return y(
|
|
592
|
-
}(t, e,
|
|
593
|
-
return r.length ||
|
|
591
|
+
return y(s), y(z), L;
|
|
592
|
+
}(t, e, R, A);
|
|
593
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
594
594
|
var o = [];
|
|
595
|
-
return r.length && [
|
|
595
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
596
596
|
} };
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
var e =
|
|
598
|
+
function Ke(t) {
|
|
599
|
+
var e = ir(t, "string");
|
|
600
600
|
return typeof e == "symbol" ? e : e + "";
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function ir(t, e) {
|
|
603
603
|
if (typeof t != "object" || !t) return t;
|
|
604
604
|
var r = t[Symbol.toPrimitive];
|
|
605
605
|
if (r !== void 0) {
|
|
606
|
-
var
|
|
607
|
-
if (typeof
|
|
606
|
+
var b = r.call(t, e);
|
|
607
|
+
if (typeof b != "object") return b;
|
|
608
608
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
609
609
|
}
|
|
610
610
|
return String(t);
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function we(t, e, r) {
|
|
613
613
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
614
614
|
try {
|
|
615
615
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -617,16 +617,16 @@ function Ce(t, e, r) {
|
|
|
617
617
|
}
|
|
618
618
|
return t;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function nr(t) {
|
|
621
621
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
622
622
|
return t;
|
|
623
623
|
}
|
|
624
|
-
const
|
|
625
|
-
|
|
624
|
+
const ue = ae("ColorPicker"), ar = ["#ff1300", "#EC7878", "#9C27B0", "#673AB7", "#3F51B5", "#0070FF", "#03A9F4", "#00BCD4", "#4CAF50", "#8BC34A", "#CDDC39", "#FFE500", "#FFBF00", "#FF9800", "#795548", "#9E9E9E", "#5A5A5A", "#FFF"];
|
|
625
|
+
Fe = [re({
|
|
626
626
|
tagName: "color-picker"
|
|
627
627
|
})];
|
|
628
|
-
let
|
|
629
|
-
class
|
|
628
|
+
let sr;
|
|
629
|
+
class lr extends X {
|
|
630
630
|
static get observedAttributes() {
|
|
631
631
|
return ["disabled", "selected-color", "open"];
|
|
632
632
|
}
|
|
@@ -634,21 +634,21 @@ class Qt extends X {
|
|
|
634
634
|
super({
|
|
635
635
|
styleName: "base-color-picker",
|
|
636
636
|
...e
|
|
637
|
-
}), Y(this, "_autoStyles",
|
|
637
|
+
}), Y(this, "_autoStyles", rr), Y(this, "colorCollections", void 0), Y(this, "onColorPicked", void 0), Y(this, "hasCustomPicker", void 0), Y(this, "defaultColor", void 0), Y(this, "pluginType", void 0), Y(this, "disabled", void 0), Y(this, "selectedColor", void 0), Y(this, "customColor", void 0), Y(this, "isOpen", void 0), Y(this, "colorBtn", void 0), Y(this, "colorPanel", void 0), Y(this, "handleButtonClick", (r) => {
|
|
638
638
|
r.stopPropagation(), this.togglePanel();
|
|
639
639
|
}), Y(this, "handlePanelClick", (r) => {
|
|
640
640
|
r.stopPropagation();
|
|
641
641
|
}), Y(this, "handleColorSelect", (r) => {
|
|
642
|
-
var
|
|
643
|
-
const
|
|
644
|
-
this.setSelectedColor(
|
|
642
|
+
var R;
|
|
643
|
+
const b = de(r);
|
|
644
|
+
this.setSelectedColor(b), this.closePanel(), Vt(b, this.pluginType), (R = this.onColorPicked) == null || R.call(this, b), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
645
645
|
detail: {
|
|
646
|
-
color:
|
|
646
|
+
color: b
|
|
647
647
|
},
|
|
648
648
|
bubbles: !0,
|
|
649
649
|
composed: !0
|
|
650
|
-
})),
|
|
651
|
-
color:
|
|
650
|
+
})), ue.debug("Color selected", {
|
|
651
|
+
color: b
|
|
652
652
|
});
|
|
653
653
|
}), Y(this, "handleCustomPickerClick", () => {
|
|
654
654
|
const r = document.createElement("input");
|
|
@@ -658,25 +658,25 @@ class Qt extends X {
|
|
|
658
658
|
opacity: 0;
|
|
659
659
|
pointer-events: none;
|
|
660
660
|
`;
|
|
661
|
-
const
|
|
661
|
+
const b = tr((R) => {
|
|
662
662
|
var B;
|
|
663
|
-
const
|
|
664
|
-
this.setSelectedColor(
|
|
663
|
+
const U = R.target, E = de(U.value);
|
|
664
|
+
this.setSelectedColor(E), this.setCustomColor(E), document.body.removeChild(r), (B = this.onColorPicked) == null || B.call(this, E), this.dispatchEvent(new CustomEvent("colorchange", {
|
|
665
665
|
detail: {
|
|
666
|
-
color:
|
|
666
|
+
color: E
|
|
667
667
|
},
|
|
668
668
|
bubbles: !0,
|
|
669
669
|
composed: !0
|
|
670
|
-
})),
|
|
671
|
-
color:
|
|
670
|
+
})), ue.debug("Custom color selected", {
|
|
671
|
+
color: E
|
|
672
672
|
});
|
|
673
673
|
}, 30);
|
|
674
|
-
r.addEventListener("input",
|
|
674
|
+
r.addEventListener("input", b), document.body.appendChild(r), requestAnimationFrame(() => {
|
|
675
675
|
r.focus(), r.click();
|
|
676
676
|
});
|
|
677
677
|
}), Y(this, "handleDocumentClick", (r) => {
|
|
678
678
|
this.isOpen && !this.contains(r.target) && this.closePanel();
|
|
679
|
-
}), this.colorCollections = e.colorCollections ||
|
|
679
|
+
}), this.colorCollections = e.colorCollections || ar, this.onColorPicked = e.onColorPicked, this.hasCustomPicker = e.hasCustomPicker || !1, this.pluginType = e.pluginType || "text", this.disabled = e.disabled || !1, this.defaultColor = de(e.defaultColor || this.colorCollections[0]), this.selectedColor = this.defaultColor, this.customColor = er(this.pluginType) || "", this.isOpen = !1, ue.debug("ColorPicker initialized", {
|
|
680
680
|
colorCollections: this.colorCollections.length,
|
|
681
681
|
hasCustomPicker: this.hasCustomPicker,
|
|
682
682
|
pluginType: this.pluginType
|
|
@@ -741,7 +741,7 @@ class Qt extends X {
|
|
|
741
741
|
* 设置自定义颜色
|
|
742
742
|
*/
|
|
743
743
|
setCustomColor(e) {
|
|
744
|
-
this.customColor = e,
|
|
744
|
+
this.customColor = e, Zt(e, this.pluginType);
|
|
745
745
|
}
|
|
746
746
|
/**
|
|
747
747
|
* 设置面板开关状态
|
|
@@ -759,27 +759,27 @@ class Qt extends X {
|
|
|
759
759
|
* 组件连接到DOM后的初始化
|
|
760
760
|
*/
|
|
761
761
|
onConnected() {
|
|
762
|
-
document.addEventListener("click", this.handleDocumentClick),
|
|
762
|
+
document.addEventListener("click", this.handleDocumentClick), ue.info("ColorPicker connected to DOM");
|
|
763
763
|
}
|
|
764
764
|
/**
|
|
765
765
|
* 组件从DOM断开时的清理
|
|
766
766
|
*/
|
|
767
767
|
onDisconnected() {
|
|
768
|
-
document.removeEventListener("click", this.handleDocumentClick),
|
|
768
|
+
document.removeEventListener("click", this.handleDocumentClick), ue.info("ColorPicker disconnected from DOM");
|
|
769
769
|
}
|
|
770
770
|
/**
|
|
771
771
|
* 属性变化处理
|
|
772
772
|
*/
|
|
773
|
-
onAttributeChanged(e, r,
|
|
773
|
+
onAttributeChanged(e, r, b) {
|
|
774
774
|
switch (e) {
|
|
775
775
|
case "disabled":
|
|
776
|
-
this.disabled =
|
|
776
|
+
this.disabled = b !== null, this.rerender();
|
|
777
777
|
break;
|
|
778
778
|
case "selected-color":
|
|
779
|
-
|
|
779
|
+
b && b !== this.selectedColor && (this.selectedColor = b, this.updateColorButton());
|
|
780
780
|
break;
|
|
781
781
|
case "open":
|
|
782
|
-
this.isOpen =
|
|
782
|
+
this.isOpen = b !== null;
|
|
783
783
|
break;
|
|
784
784
|
}
|
|
785
785
|
}
|
|
@@ -793,7 +793,7 @@ class Qt extends X {
|
|
|
793
793
|
* 公共API:设置颜色
|
|
794
794
|
*/
|
|
795
795
|
setColor(e) {
|
|
796
|
-
this.setSelectedColor(
|
|
796
|
+
this.setSelectedColor(de(e));
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
799
799
|
* 公共API:聚焦组件
|
|
@@ -803,121 +803,121 @@ class Qt extends X {
|
|
|
803
803
|
(e = this.colorBtn) == null || e.focus();
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
|
|
807
|
-
[
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
var
|
|
811
|
-
let
|
|
812
|
-
function
|
|
813
|
-
return (e =
|
|
806
|
+
Ue = lr;
|
|
807
|
+
[sr, He] = or(Ue, [], Fe, 0, void 0, X).c;
|
|
808
|
+
He();
|
|
809
|
+
const cr = ".reactive-counter{max-width:500px;margin:20px auto;padding:24px;border-radius:12px;box-shadow:0 4px 12px #0000001a;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;transition:all .3s ease}.theme-light{background:#fff;color:#333;border:1px solid #e1e5e9}.theme-dark{background:#1a1a1a;color:#fff;border:1px solid #333333}.theme-blue{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:1px solid #5a67d8}.header{text-align:center;margin-bottom:24px}.header h3{margin:0 0 8px;font-size:24px;font-weight:600}.subtitle{margin:0;opacity:.8;font-size:14px}.counter-display{text-align:center;margin-bottom:32px}.count-value{font-size:48px;font-weight:700;line-height:1;margin-bottom:8px;font-variant-numeric:tabular-nums}.step-info{font-size:14px;opacity:.7}.controls{display:flex;gap:12px;justify-content:center;margin-bottom:24px;flex-wrap:wrap}.btn{padding:10px 20px;border:none;border-radius:8px;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease;min-width:60px}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#4299e1;color:#fff}.btn-primary:hover:not(:disabled){background:#3182ce;transform:translateY(-1px)}.btn-secondary{background:#718096;color:#fff}.btn-secondary:hover:not(:disabled){background:#4a5568;transform:translateY(-1px)}.btn-warning{background:#ed8936;color:#fff}.btn-warning:hover:not(:disabled){background:#dd6b20;transform:translateY(-1px)}.btn-success{background:#48bb78;color:#fff}.btn-success:hover:not(:disabled){background:#38a169;transform:translateY(-1px)}.btn-danger{background:#f56565;color:#fff}.btn-danger:hover:not(:disabled){background:#e53e3e;transform:translateY(-1px)}.btn-sm{padding:6px 12px;font-size:14px;min-width:auto}.step-controls,.auto-controls,.theme-controls,.message-controls{margin-bottom:20px;text-align:center}.step-controls label{display:flex;align-items:center;justify-content:center;gap:12px;font-size:14px}.step-controls input[type=range]{flex:0 0 150px}.step-controls span{font-weight:700;min-width:20px}.theme-controls select,.message-controls input{padding:8px 12px;border:1px solid #cbd5e0;border-radius:6px;font-size:14px;margin-left:8px}.theme-dark .theme-controls select,.theme-dark .message-controls input{background:#2d3748;border-color:#4a5568;color:#fff}.theme-blue .theme-controls select,.theme-blue .message-controls input{background:#ffffff1a;border-color:#fff3;color:#fff}.message-controls input{width:250px;max-width:100%}.history{margin-top:24px;padding:16px;background:#0000000d;border-radius:8px}.theme-dark .history{background:#ffffff0d}.theme-blue .history{background:#ffffff1a}.history h4{margin:0 0 12px;font-size:16px}.history-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.history-item{padding:4px 8px;background:#4299e11a;border:1px solid rgba(66,153,225,.2);border-radius:4px;font-size:12px;font-weight:500}.debug-info{margin-top:24px;font-size:12px}.debug-info details{border:1px solid #e2e8f0;border-radius:6px;padding:8px}.theme-dark .debug-info details{border-color:#4a5568}.theme-blue .debug-info details{border-color:#fff3}.debug-info summary{cursor:pointer;font-weight:500;margin-bottom:8px}.debug-info pre{margin:0;padding:8px;background:#0000000d;border-radius:4px;overflow-x:auto;font-size:11px;line-height:1.4}.theme-dark .debug-info pre{background:#ffffff0d}.theme-blue .debug-info pre{background:#ffffff1a}@media (max-width: 600px){.reactive-counter{margin:10px;padding:16px}.count-value{font-size:36px}.controls{flex-direction:column;align-items:center}.btn{width:200px}.step-controls label{flex-direction:column;gap:8px}.message-controls input{width:100%}}";
|
|
810
|
+
var Je;
|
|
811
|
+
let We, Ge, Xe, qe, Ye;
|
|
812
|
+
function Z(t, e, r) {
|
|
813
|
+
return (e = Qe(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
function
|
|
817
|
-
return function(
|
|
818
|
-
return u && u(
|
|
815
|
+
function ur(t, e, r, b, R, U) {
|
|
816
|
+
function E(o, l, u) {
|
|
817
|
+
return function(a, s) {
|
|
818
|
+
return u && u(a), o[l].call(a, s);
|
|
819
819
|
};
|
|
820
820
|
}
|
|
821
821
|
function B(o, l) {
|
|
822
822
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
823
823
|
return l;
|
|
824
824
|
}
|
|
825
|
-
function
|
|
826
|
-
if (typeof o != "function" && (
|
|
825
|
+
function T(o, l, u, a) {
|
|
826
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
827
827
|
return o;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
830
830
|
function v(c) {
|
|
831
831
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
832
832
|
}
|
|
833
|
-
var d, x = l[0], k = l[3],
|
|
834
|
-
if (!
|
|
833
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
834
|
+
if (!_) {
|
|
835
835
|
u || Array.isArray(x) || (x = [x]);
|
|
836
|
-
var i = {}, C = [], m =
|
|
837
|
-
y ? (
|
|
836
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
837
|
+
y ? (g || f ? i = { get: Te(function() {
|
|
838
838
|
return k(this);
|
|
839
|
-
},
|
|
839
|
+
}, a, "get"), set: function(c) {
|
|
840
840
|
l[4](this, c);
|
|
841
|
-
} } : i[m] = k,
|
|
841
|
+
} } : i[m] = k, g || Te(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
842
842
|
}
|
|
843
843
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
844
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
844
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
845
845
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
846
|
-
|
|
846
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
847
847
|
}).bind(null, J) };
|
|
848
848
|
try {
|
|
849
|
-
if (
|
|
849
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
850
850
|
else {
|
|
851
|
-
var $,
|
|
852
|
-
D.static =
|
|
851
|
+
var $, O;
|
|
852
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
853
853
|
return v(c), i.value;
|
|
854
|
-
} : (
|
|
855
|
-
return c[
|
|
856
|
-
}, (
|
|
857
|
-
c[
|
|
854
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
855
|
+
return c[a];
|
|
856
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
857
|
+
c[a] = w;
|
|
858
858
|
}));
|
|
859
859
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
860
|
-
return
|
|
860
|
+
return a in c;
|
|
861
861
|
} };
|
|
862
|
-
if ($ && (W.get = $),
|
|
863
|
-
if (typeof h == "object" && h) (d =
|
|
862
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
863
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
864
864
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
865
|
-
} else
|
|
865
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
866
866
|
}
|
|
867
867
|
} finally {
|
|
868
868
|
J.v = !0;
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
|
-
return (
|
|
872
|
-
for (var
|
|
871
|
+
return (g || f) && S.push(function(c, w) {
|
|
872
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
873
873
|
return w;
|
|
874
|
-
}),
|
|
874
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function M(o, l) {
|
|
877
877
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
878
878
|
}
|
|
879
|
-
if (arguments.length >= 6) var H =
|
|
880
|
-
var
|
|
881
|
-
var
|
|
882
|
-
return
|
|
883
|
-
},
|
|
879
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
880
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
881
|
+
var s, z, L = [], S = function(m) {
|
|
882
|
+
return hr(m) === o;
|
|
883
|
+
}, j = /* @__PURE__ */ new Map();
|
|
884
884
|
function y(m) {
|
|
885
885
|
m && L.push(B.bind(null, m));
|
|
886
886
|
}
|
|
887
|
-
for (var
|
|
888
|
-
var f = l[
|
|
887
|
+
for (var g = 0; g < l.length; g++) {
|
|
888
|
+
var f = l[g];
|
|
889
889
|
if (Array.isArray(f)) {
|
|
890
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
891
|
-
if (!
|
|
892
|
-
var C =
|
|
890
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
891
|
+
if (!_ && !d) {
|
|
892
|
+
var C = j.get(i);
|
|
893
893
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
894
|
-
|
|
894
|
+
j.set(i, !(p > 2) || p);
|
|
895
895
|
}
|
|
896
|
-
|
|
896
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : Qe(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
|
-
return y(
|
|
900
|
-
}(t, e,
|
|
901
|
-
return r.length ||
|
|
899
|
+
return y(s), y(z), L;
|
|
900
|
+
}(t, e, R, A);
|
|
901
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
902
902
|
var o = [];
|
|
903
|
-
return r.length && [
|
|
903
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
904
904
|
} };
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
var e =
|
|
906
|
+
function Qe(t) {
|
|
907
|
+
var e = dr(t, "string");
|
|
908
908
|
return typeof e == "symbol" ? e : e + "";
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function dr(t, e) {
|
|
911
911
|
if (typeof t != "object" || !t) return t;
|
|
912
912
|
var r = t[Symbol.toPrimitive];
|
|
913
913
|
if (r !== void 0) {
|
|
914
|
-
var
|
|
915
|
-
if (typeof
|
|
914
|
+
var b = r.call(t, e);
|
|
915
|
+
if (typeof b != "object") return b;
|
|
916
916
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
917
917
|
}
|
|
918
918
|
return String(t);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function Te(t, e, r) {
|
|
921
921
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
922
922
|
try {
|
|
923
923
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -925,67 +925,42 @@ function we(t, e, r) {
|
|
|
925
925
|
}
|
|
926
926
|
return t;
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function hr(t) {
|
|
929
929
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
930
930
|
return t;
|
|
931
931
|
}
|
|
932
|
-
const
|
|
933
|
-
|
|
932
|
+
const me = ae("ReactiveCounter");
|
|
933
|
+
Ge = [re({
|
|
934
934
|
tagName: "reactive-counter"
|
|
935
935
|
})];
|
|
936
|
-
let
|
|
937
|
-
class
|
|
936
|
+
let fr;
|
|
937
|
+
class pr extends X {
|
|
938
938
|
constructor() {
|
|
939
|
-
super(),
|
|
939
|
+
super(), Z(this, "_autoStyles", cr), Z(this, "state", Xe(this, {
|
|
940
|
+
count: 0,
|
|
941
|
+
step: 1,
|
|
942
|
+
message: "Hello WSX Reactive!",
|
|
943
|
+
isRunning: !1
|
|
944
|
+
})), Z(this, "theme", qe(this, "light")), Z(this, "history", Ye(this, [])), Z(this, "increment", () => {
|
|
940
945
|
this.state.count += this.state.step, this.addToHistory(this.state.count);
|
|
941
|
-
}),
|
|
946
|
+
}), Z(this, "decrement", () => {
|
|
942
947
|
this.state.count -= this.state.step, this.addToHistory(this.state.count);
|
|
943
|
-
}),
|
|
948
|
+
}), Z(this, "reset", () => {
|
|
944
949
|
this.state.count = 0, this.addToHistory(0);
|
|
945
|
-
}),
|
|
946
|
-
const
|
|
947
|
-
this.state.step = parseInt(
|
|
948
|
-
}),
|
|
949
|
-
const
|
|
950
|
-
this.theme =
|
|
951
|
-
}),
|
|
952
|
-
const
|
|
953
|
-
this.state.message =
|
|
954
|
-
}),
|
|
950
|
+
}), Z(this, "handleStepChange", (e) => {
|
|
951
|
+
const r = e.target;
|
|
952
|
+
this.state.step = parseInt(r.value);
|
|
953
|
+
}), Z(this, "handleThemeChange", (e) => {
|
|
954
|
+
const r = e.target;
|
|
955
|
+
this.theme = r.value;
|
|
956
|
+
}), Z(this, "handleMessageChange", (e) => {
|
|
957
|
+
const r = e.target;
|
|
958
|
+
this.state.message = r.value;
|
|
959
|
+
}), Z(this, "toggleAutoIncrement", () => {
|
|
955
960
|
this.state.isRunning = !this.state.isRunning, this.state.isRunning && this.startAutoIncrement();
|
|
956
|
-
}),
|
|
961
|
+
}), Z(this, "clearHistory", () => {
|
|
957
962
|
this.history = [];
|
|
958
|
-
}),
|
|
959
|
-
let e = this.reactive({
|
|
960
|
-
count: 0,
|
|
961
|
-
step: 1,
|
|
962
|
-
message: "Hello WSX Reactive!",
|
|
963
|
-
isRunning: !1
|
|
964
|
-
});
|
|
965
|
-
Object.defineProperty(this, "state", {
|
|
966
|
-
get: () => e,
|
|
967
|
-
set: (A) => {
|
|
968
|
-
e = A !== null && typeof A < "u" && (Array.isArray(A) || typeof A == "object") ? this.reactive(A) : A, this.scheduleRerender();
|
|
969
|
-
},
|
|
970
|
-
enumerable: !0,
|
|
971
|
-
configurable: !0
|
|
972
|
-
});
|
|
973
|
-
const [r, g] = this.useState("theme", "light");
|
|
974
|
-
Object.defineProperty(this, "theme", {
|
|
975
|
-
get: r,
|
|
976
|
-
set: g,
|
|
977
|
-
enumerable: !0,
|
|
978
|
-
configurable: !0
|
|
979
|
-
});
|
|
980
|
-
let S = this.reactive([]);
|
|
981
|
-
Object.defineProperty(this, "history", {
|
|
982
|
-
get: () => S,
|
|
983
|
-
set: (A) => {
|
|
984
|
-
S = A !== null && typeof A < "u" && (Array.isArray(A) || typeof A == "object") ? this.reactive(A) : A, this.scheduleRerender();
|
|
985
|
-
},
|
|
986
|
-
enumerable: !0,
|
|
987
|
-
configurable: !0
|
|
988
|
-
});
|
|
963
|
+
}), me.info("ReactiveCounter initialized");
|
|
989
964
|
}
|
|
990
965
|
render() {
|
|
991
966
|
return /* @__PURE__ */ n("div", { class: `reactive-counter theme-${this.theme}` }, /* @__PURE__ */ n("div", { class: "header" }, /* @__PURE__ */ n("h3", null, "🔄 Reactive Counter"), /* @__PURE__ */ n("p", { class: "subtitle" }, this.state.message)), /* @__PURE__ */ n("div", { class: "counter-display" }, /* @__PURE__ */ n("div", { class: "count-value" }, this.state.count), /* @__PURE__ */ n("div", { class: "step-info" }, "Step: ", this.state.step)), /* @__PURE__ */ n("div", { class: "controls" }, /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.increment, disabled: this.state.isRunning, "data-wsx-key": "ReactiveCounter-button-text-5-1" }, "+", this.state.step), /* @__PURE__ */ n("button", { class: "btn btn-secondary", onClick: this.decrement, disabled: this.state.isRunning, "data-wsx-key": "ReactiveCounter-button-text-5-3" }, "-", this.state.step), /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.reset, disabled: this.state.isRunning, "data-wsx-key": "ReactiveCounter-button-text-5-5" }, "Reset")), /* @__PURE__ */ n("div", { class: "step-controls" }, /* @__PURE__ */ n("label", null, "Step Size:", /* @__PURE__ */ n("input", { type: "range", min: "1", max: "10", value: this.state.step, onInput: this.handleStepChange, "data-wsx-key": "ReactiveCounter-input-range-7-1-1" }), /* @__PURE__ */ n("span", null, this.state.step))), /* @__PURE__ */ n("div", { class: "auto-controls" }, /* @__PURE__ */ n("button", { class: `btn ${this.state.isRunning ? "btn-danger" : "btn-success"}`, onClick: this.toggleAutoIncrement, "data-wsx-key": "ReactiveCounter-button-text-9-1" }, this.state.isRunning ? "Stop" : "Start", " Auto Increment")), /* @__PURE__ */ n("div", { class: "theme-controls" }, /* @__PURE__ */ n("label", null, "Theme:", /* @__PURE__ */ n("select", { value: this.theme, onChange: this.handleThemeChange, "data-wsx-key": "ReactiveCounter-select-text-11-1-1" }, /* @__PURE__ */ n("option", { value: "light" }, "Light"), /* @__PURE__ */ n("option", { value: "dark" }, "Dark"), /* @__PURE__ */ n("option", { value: "blue" }, "Blue")))), /* @__PURE__ */ n("div", { class: "message-controls" }, /* @__PURE__ */ n("input", { type: "text", value: this.state.message, onInput: this.handleMessageChange, placeholder: "Enter a message...", "data-wsx-key": "ReactiveCounter-input-text-13-1" })), this.history.length > 0 && /* @__PURE__ */ n("div", { class: "history" }, /* @__PURE__ */ n("h4", null, "History (last 10):"), /* @__PURE__ */ n("div", { class: "history-list" }, this.history.slice(-10).map((e, r) => /* @__PURE__ */ n("span", { key: r, class: "history-item" }, e))), /* @__PURE__ */ n("button", { class: "btn btn-sm", onClick: this.clearHistory, "data-wsx-key": "ReactiveCounter-button-text-5" }, "Clear History")), /* @__PURE__ */ n("div", { class: "debug-info" }, /* @__PURE__ */ n("details", null, /* @__PURE__ */ n("summary", null, "Debug Info"), /* @__PURE__ */ n("pre", null, JSON.stringify({
|
|
@@ -1007,129 +982,132 @@ class or extends X {
|
|
|
1007
982
|
this.history = [...this.history, e];
|
|
1008
983
|
}
|
|
1009
984
|
onConnected() {
|
|
1010
|
-
|
|
985
|
+
me.info("ReactiveCounter connected to DOM"), setTimeout(() => {
|
|
1011
986
|
this.state.message = "Ready to count! 🚀";
|
|
1012
987
|
}, 500);
|
|
1013
988
|
}
|
|
1014
989
|
onDisconnected() {
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
990
|
+
me.info("ReactiveCounter disconnected from DOM"), this.state.isRunning = !1;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
Je = pr;
|
|
994
|
+
({
|
|
995
|
+
e: [Xe, qe, Ye],
|
|
996
|
+
c: [fr, We]
|
|
997
|
+
} = ur(Je, [[ne, 0, "state"], [ne, 0, "theme"], [ne, 0, "history"]], Ge, 0, void 0, X));
|
|
998
|
+
We();
|
|
999
|
+
const mr = ":host{display:block}.theme-switcher-container{position:relative;display:flex;align-items:center}.theme-switcher-btn{width:var(--theme-switcher-width, 2.5rem);height:var(--theme-switcher-height, 2.5rem);padding:var(--theme-switcher-padding, .5rem);border-radius:var(--theme-switcher-border-radius, 8px);background:var(--theme-switcher-bg, #dc2626);border:var(--theme-switcher-border, none);color:var(--theme-switcher-color, white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--theme-switcher-transition, .3s ease);box-shadow:var(--theme-switcher-shadow, 0 4px 15px rgba(220, 38, 38, .4));font-weight:var(--theme-switcher-font-weight, 600);font-family:var(--theme-switcher-font-family, inherit)}.theme-switcher-btn:hover{background:var(--theme-switcher-hover-bg, #b91c1c);transform:var(--theme-switcher-hover-transform, translateY(-2px));box-shadow:var(--theme-switcher-hover-shadow, 0 8px 25px rgba(220, 38, 38, .5))}.theme-switcher-btn:active{transform:var(--theme-switcher-active-transform, translateY(0))}.theme-switcher-icon{font-size:var(--theme-switcher-icon-size, 1rem);line-height:1;transition:transform var(--theme-switcher-icon-transition, .3s ease)}.theme-switcher-btn:hover .theme-switcher-icon{transform:var(--theme-switcher-icon-hover-transform, rotate(360deg))}.theme-switcher-btn[data-theme=light]{background:var(--theme-switcher-light-bg, #dc2626);color:var(--theme-switcher-light-color, white)}.theme-switcher-btn[data-theme=light]:hover{background:var(--theme-switcher-light-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=dark]{background:var(--theme-switcher-dark-bg, #dc2626);color:var(--theme-switcher-dark-color, white)}.theme-switcher-btn[data-theme=dark]:hover{background:var(--theme-switcher-dark-hover-bg, #b91c1c)}.theme-switcher-btn[data-theme=auto]{background:var(--theme-switcher-auto-bg, linear-gradient(135deg, #dc2626, #b91c1c));color:var(--theme-switcher-auto-color, white)}.theme-switcher-btn[data-theme=auto]:hover{background:var(--theme-switcher-auto-hover-bg, linear-gradient(135deg, #b91c1c, #991b1b))}@media (max-width: 768px){.theme-switcher-btn{width:var(--theme-switcher-mobile-width, 2rem);height:var(--theme-switcher-mobile-height, 2rem)}.theme-switcher-icon{font-size:var(--theme-switcher-mobile-icon-size, .9rem)}}";
|
|
1000
|
+
var Ve;
|
|
1001
|
+
let Ze, et;
|
|
1002
|
+
function ge(t, e, r) {
|
|
1003
|
+
return (e = tt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1026
1004
|
}
|
|
1027
|
-
function
|
|
1028
|
-
function
|
|
1029
|
-
return function(
|
|
1030
|
-
return u && u(
|
|
1005
|
+
function gr(t, e, r, b, R, U) {
|
|
1006
|
+
function E(o, l, u) {
|
|
1007
|
+
return function(a, s) {
|
|
1008
|
+
return u && u(a), o[l].call(a, s);
|
|
1031
1009
|
};
|
|
1032
1010
|
}
|
|
1033
1011
|
function B(o, l) {
|
|
1034
1012
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1035
1013
|
return l;
|
|
1036
1014
|
}
|
|
1037
|
-
function
|
|
1038
|
-
if (typeof o != "function" && (
|
|
1015
|
+
function T(o, l, u, a) {
|
|
1016
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
1039
1017
|
return o;
|
|
1040
1018
|
}
|
|
1041
|
-
function
|
|
1019
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
1042
1020
|
function v(c) {
|
|
1043
1021
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1044
1022
|
}
|
|
1045
|
-
var d, x = l[0], k = l[3],
|
|
1046
|
-
if (!
|
|
1023
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
1024
|
+
if (!_) {
|
|
1047
1025
|
u || Array.isArray(x) || (x = [x]);
|
|
1048
|
-
var i = {}, C = [], m =
|
|
1049
|
-
y ? (
|
|
1026
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1027
|
+
y ? (g || f ? i = { get: Se(function() {
|
|
1050
1028
|
return k(this);
|
|
1051
|
-
},
|
|
1029
|
+
}, a, "get"), set: function(c) {
|
|
1052
1030
|
l[4](this, c);
|
|
1053
|
-
} } : i[m] = k,
|
|
1031
|
+
} } : i[m] = k, g || Se(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
1054
1032
|
}
|
|
1055
1033
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1056
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
1034
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
1057
1035
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1058
|
-
|
|
1036
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
1059
1037
|
}).bind(null, J) };
|
|
1060
1038
|
try {
|
|
1061
|
-
if (
|
|
1039
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1062
1040
|
else {
|
|
1063
|
-
var $,
|
|
1064
|
-
D.static =
|
|
1041
|
+
var $, O;
|
|
1042
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
1065
1043
|
return v(c), i.value;
|
|
1066
|
-
} : (
|
|
1067
|
-
return c[
|
|
1068
|
-
}, (
|
|
1069
|
-
c[
|
|
1044
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
1045
|
+
return c[a];
|
|
1046
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
1047
|
+
c[a] = w;
|
|
1070
1048
|
}));
|
|
1071
1049
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1072
|
-
return
|
|
1050
|
+
return a in c;
|
|
1073
1051
|
} };
|
|
1074
|
-
if ($ && (W.get = $),
|
|
1075
|
-
if (typeof h == "object" && h) (d =
|
|
1052
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1053
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
1076
1054
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1077
|
-
} else
|
|
1055
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1078
1056
|
}
|
|
1079
1057
|
} finally {
|
|
1080
1058
|
J.v = !0;
|
|
1081
1059
|
}
|
|
1082
1060
|
}
|
|
1083
|
-
return (
|
|
1084
|
-
for (var
|
|
1061
|
+
return (g || f) && S.push(function(c, w) {
|
|
1062
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
1085
1063
|
return w;
|
|
1086
|
-
}),
|
|
1064
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
1087
1065
|
}
|
|
1088
|
-
function
|
|
1066
|
+
function M(o, l) {
|
|
1089
1067
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1090
1068
|
}
|
|
1091
|
-
if (arguments.length >= 6) var H =
|
|
1092
|
-
var
|
|
1093
|
-
var
|
|
1094
|
-
return
|
|
1095
|
-
},
|
|
1069
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1070
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
1071
|
+
var s, z, L = [], S = function(m) {
|
|
1072
|
+
return yr(m) === o;
|
|
1073
|
+
}, j = /* @__PURE__ */ new Map();
|
|
1096
1074
|
function y(m) {
|
|
1097
1075
|
m && L.push(B.bind(null, m));
|
|
1098
1076
|
}
|
|
1099
|
-
for (var
|
|
1100
|
-
var f = l[
|
|
1077
|
+
for (var g = 0; g < l.length; g++) {
|
|
1078
|
+
var f = l[g];
|
|
1101
1079
|
if (Array.isArray(f)) {
|
|
1102
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
1103
|
-
if (!
|
|
1104
|
-
var C =
|
|
1080
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1081
|
+
if (!_ && !d) {
|
|
1082
|
+
var C = j.get(i);
|
|
1105
1083
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1106
|
-
|
|
1084
|
+
j.set(i, !(p > 2) || p);
|
|
1107
1085
|
}
|
|
1108
|
-
|
|
1086
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : tt(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
1109
1087
|
}
|
|
1110
1088
|
}
|
|
1111
|
-
return y(
|
|
1112
|
-
}(t, e,
|
|
1113
|
-
return r.length ||
|
|
1089
|
+
return y(s), y(z), L;
|
|
1090
|
+
}(t, e, R, A);
|
|
1091
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
1114
1092
|
var o = [];
|
|
1115
|
-
return r.length && [
|
|
1093
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
1116
1094
|
} };
|
|
1117
1095
|
}
|
|
1118
|
-
function
|
|
1119
|
-
var e =
|
|
1096
|
+
function tt(t) {
|
|
1097
|
+
var e = br(t, "string");
|
|
1120
1098
|
return typeof e == "symbol" ? e : e + "";
|
|
1121
1099
|
}
|
|
1122
|
-
function
|
|
1100
|
+
function br(t, e) {
|
|
1123
1101
|
if (typeof t != "object" || !t) return t;
|
|
1124
1102
|
var r = t[Symbol.toPrimitive];
|
|
1125
1103
|
if (r !== void 0) {
|
|
1126
|
-
var
|
|
1127
|
-
if (typeof
|
|
1104
|
+
var b = r.call(t, e);
|
|
1105
|
+
if (typeof b != "object") return b;
|
|
1128
1106
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1129
1107
|
}
|
|
1130
1108
|
return String(t);
|
|
1131
1109
|
}
|
|
1132
|
-
function
|
|
1110
|
+
function Se(t, e, r) {
|
|
1133
1111
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1134
1112
|
try {
|
|
1135
1113
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -1137,21 +1115,21 @@ function Te(t, e, r) {
|
|
|
1137
1115
|
}
|
|
1138
1116
|
return t;
|
|
1139
1117
|
}
|
|
1140
|
-
function
|
|
1118
|
+
function yr(t) {
|
|
1141
1119
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1142
1120
|
return t;
|
|
1143
1121
|
}
|
|
1144
|
-
|
|
1122
|
+
et = [re({
|
|
1145
1123
|
tagName: "theme-switcher"
|
|
1146
1124
|
})];
|
|
1147
|
-
let
|
|
1148
|
-
class
|
|
1125
|
+
let vr;
|
|
1126
|
+
class xr extends X {
|
|
1149
1127
|
constructor() {
|
|
1150
1128
|
super({
|
|
1151
1129
|
styleName: "theme-switcher"
|
|
1152
|
-
}),
|
|
1153
|
-
const e = ["auto", "light", "dark"],
|
|
1154
|
-
this.setTheme(e[
|
|
1130
|
+
}), ge(this, "_autoStyles", mr), ge(this, "currentTheme", "auto"), ge(this, "toggleTheme", () => {
|
|
1131
|
+
const e = ["auto", "light", "dark"], b = (e.indexOf(this.currentTheme) + 1) % e.length;
|
|
1132
|
+
this.setTheme(e[b]);
|
|
1155
1133
|
}), this.initTheme();
|
|
1156
1134
|
}
|
|
1157
1135
|
render() {
|
|
@@ -1184,120 +1162,120 @@ class cr extends X {
|
|
|
1184
1162
|
});
|
|
1185
1163
|
}
|
|
1186
1164
|
}
|
|
1187
|
-
|
|
1188
|
-
[
|
|
1189
|
-
|
|
1190
|
-
var
|
|
1191
|
-
let
|
|
1192
|
-
function
|
|
1193
|
-
return (e =
|
|
1165
|
+
Ve = xr;
|
|
1166
|
+
[vr, Ze] = gr(Ve, [], et, 0, void 0, X).c;
|
|
1167
|
+
Ze();
|
|
1168
|
+
var rt;
|
|
1169
|
+
let ot, it;
|
|
1170
|
+
function be(t, e, r) {
|
|
1171
|
+
return (e = nt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1194
1172
|
}
|
|
1195
|
-
function
|
|
1196
|
-
function
|
|
1197
|
-
return function(
|
|
1198
|
-
return u && u(
|
|
1173
|
+
function kr(t, e, r, b, R, U) {
|
|
1174
|
+
function E(o, l, u) {
|
|
1175
|
+
return function(a, s) {
|
|
1176
|
+
return u && u(a), o[l].call(a, s);
|
|
1199
1177
|
};
|
|
1200
1178
|
}
|
|
1201
1179
|
function B(o, l) {
|
|
1202
1180
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1203
1181
|
return l;
|
|
1204
1182
|
}
|
|
1205
|
-
function
|
|
1206
|
-
if (typeof o != "function" && (
|
|
1183
|
+
function T(o, l, u, a) {
|
|
1184
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
1207
1185
|
return o;
|
|
1208
1186
|
}
|
|
1209
|
-
function
|
|
1187
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
1210
1188
|
function v(c) {
|
|
1211
1189
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1212
1190
|
}
|
|
1213
|
-
var d, x = l[0], k = l[3],
|
|
1214
|
-
if (!
|
|
1191
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
1192
|
+
if (!_) {
|
|
1215
1193
|
u || Array.isArray(x) || (x = [x]);
|
|
1216
|
-
var i = {}, C = [], m =
|
|
1217
|
-
y ? (
|
|
1194
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1195
|
+
y ? (g || f ? i = { get: _e(function() {
|
|
1218
1196
|
return k(this);
|
|
1219
|
-
},
|
|
1197
|
+
}, a, "get"), set: function(c) {
|
|
1220
1198
|
l[4](this, c);
|
|
1221
|
-
} } : i[m] = k,
|
|
1199
|
+
} } : i[m] = k, g || _e(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
1222
1200
|
}
|
|
1223
1201
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1224
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
1202
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
1225
1203
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1226
|
-
|
|
1204
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
1227
1205
|
}).bind(null, J) };
|
|
1228
1206
|
try {
|
|
1229
|
-
if (
|
|
1207
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1230
1208
|
else {
|
|
1231
|
-
var $,
|
|
1232
|
-
D.static =
|
|
1209
|
+
var $, O;
|
|
1210
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
1233
1211
|
return v(c), i.value;
|
|
1234
|
-
} : (
|
|
1235
|
-
return c[
|
|
1236
|
-
}, (
|
|
1237
|
-
c[
|
|
1212
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
1213
|
+
return c[a];
|
|
1214
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
1215
|
+
c[a] = w;
|
|
1238
1216
|
}));
|
|
1239
1217
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1240
|
-
return
|
|
1218
|
+
return a in c;
|
|
1241
1219
|
} };
|
|
1242
|
-
if ($ && (W.get = $),
|
|
1243
|
-
if (typeof h == "object" && h) (d =
|
|
1220
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1221
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
1244
1222
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1245
|
-
} else
|
|
1223
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1246
1224
|
}
|
|
1247
1225
|
} finally {
|
|
1248
1226
|
J.v = !0;
|
|
1249
1227
|
}
|
|
1250
1228
|
}
|
|
1251
|
-
return (
|
|
1252
|
-
for (var
|
|
1229
|
+
return (g || f) && S.push(function(c, w) {
|
|
1230
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
1253
1231
|
return w;
|
|
1254
|
-
}),
|
|
1232
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
1255
1233
|
}
|
|
1256
|
-
function
|
|
1234
|
+
function M(o, l) {
|
|
1257
1235
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1258
1236
|
}
|
|
1259
|
-
if (arguments.length >= 6) var H =
|
|
1260
|
-
var
|
|
1261
|
-
var
|
|
1262
|
-
return
|
|
1263
|
-
},
|
|
1237
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1238
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
1239
|
+
var s, z, L = [], S = function(m) {
|
|
1240
|
+
return wr(m) === o;
|
|
1241
|
+
}, j = /* @__PURE__ */ new Map();
|
|
1264
1242
|
function y(m) {
|
|
1265
1243
|
m && L.push(B.bind(null, m));
|
|
1266
1244
|
}
|
|
1267
|
-
for (var
|
|
1268
|
-
var f = l[
|
|
1245
|
+
for (var g = 0; g < l.length; g++) {
|
|
1246
|
+
var f = l[g];
|
|
1269
1247
|
if (Array.isArray(f)) {
|
|
1270
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
1271
|
-
if (!
|
|
1272
|
-
var C =
|
|
1248
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1249
|
+
if (!_ && !d) {
|
|
1250
|
+
var C = j.get(i);
|
|
1273
1251
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1274
|
-
|
|
1252
|
+
j.set(i, !(p > 2) || p);
|
|
1275
1253
|
}
|
|
1276
|
-
|
|
1254
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : nt(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
1277
1255
|
}
|
|
1278
1256
|
}
|
|
1279
|
-
return y(
|
|
1280
|
-
}(t, e,
|
|
1281
|
-
return r.length ||
|
|
1257
|
+
return y(s), y(z), L;
|
|
1258
|
+
}(t, e, R, A);
|
|
1259
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
1282
1260
|
var o = [];
|
|
1283
|
-
return r.length && [
|
|
1261
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
1284
1262
|
} };
|
|
1285
1263
|
}
|
|
1286
|
-
function
|
|
1287
|
-
var e =
|
|
1264
|
+
function nt(t) {
|
|
1265
|
+
var e = Cr(t, "string");
|
|
1288
1266
|
return typeof e == "symbol" ? e : e + "";
|
|
1289
1267
|
}
|
|
1290
|
-
function
|
|
1268
|
+
function Cr(t, e) {
|
|
1291
1269
|
if (typeof t != "object" || !t) return t;
|
|
1292
1270
|
var r = t[Symbol.toPrimitive];
|
|
1293
1271
|
if (r !== void 0) {
|
|
1294
|
-
var
|
|
1295
|
-
if (typeof
|
|
1272
|
+
var b = r.call(t, e);
|
|
1273
|
+
if (typeof b != "object") return b;
|
|
1296
1274
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1297
1275
|
}
|
|
1298
1276
|
return String(t);
|
|
1299
1277
|
}
|
|
1300
|
-
function
|
|
1278
|
+
function _e(t, e, r) {
|
|
1301
1279
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1302
1280
|
try {
|
|
1303
1281
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -1305,19 +1283,19 @@ function Se(t, e, r) {
|
|
|
1305
1283
|
}
|
|
1306
1284
|
return t;
|
|
1307
1285
|
}
|
|
1308
|
-
function
|
|
1286
|
+
function wr(t) {
|
|
1309
1287
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1310
1288
|
return t;
|
|
1311
1289
|
}
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1290
|
+
const ye = ae("SvgIcon");
|
|
1291
|
+
it = [re({
|
|
1314
1292
|
tagName: "svg-icon"
|
|
1315
1293
|
})];
|
|
1316
|
-
let
|
|
1317
|
-
class
|
|
1294
|
+
let Tr;
|
|
1295
|
+
class Sr extends X {
|
|
1318
1296
|
constructor() {
|
|
1319
|
-
super(),
|
|
1320
|
-
|
|
1297
|
+
super(), be(this, "handleClick", (e) => {
|
|
1298
|
+
ye.debug("SVG icon clicked", {
|
|
1321
1299
|
name: this.getAttribute("name")
|
|
1322
1300
|
}), this.dispatchEvent(new CustomEvent("icon-click", {
|
|
1323
1301
|
detail: {
|
|
@@ -1326,16 +1304,16 @@ class pr extends X {
|
|
|
1326
1304
|
},
|
|
1327
1305
|
bubbles: !0
|
|
1328
1306
|
}));
|
|
1329
|
-
}),
|
|
1307
|
+
}), be(this, "handleMouseEnter", (e) => {
|
|
1330
1308
|
const r = e.target;
|
|
1331
1309
|
r.style.transform = "scale(1.1)";
|
|
1332
|
-
}),
|
|
1310
|
+
}), be(this, "handleMouseLeave", (e) => {
|
|
1333
1311
|
const r = e.target;
|
|
1334
1312
|
r.style.transform = "scale(1)";
|
|
1335
|
-
}),
|
|
1313
|
+
}), ye.info("SvgIcon component initialized");
|
|
1336
1314
|
}
|
|
1337
1315
|
render() {
|
|
1338
|
-
const e = this.getAttribute("size") || "24", r = this.getAttribute("color") || "currentColor",
|
|
1316
|
+
const e = this.getAttribute("size") || "24", r = this.getAttribute("color") || "currentColor", b = this.getAttribute("name") || "star", R = {
|
|
1339
1317
|
star: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",
|
|
1340
1318
|
heart: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",
|
|
1341
1319
|
check: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",
|
|
@@ -1343,130 +1321,130 @@ class pr extends X {
|
|
|
1343
1321
|
github: "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22",
|
|
1344
1322
|
play: "M8 5v14l11-7z",
|
|
1345
1323
|
settings: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
|
1346
|
-
},
|
|
1347
|
-
return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: r, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "svg-icon", onClick: this.handleClick, style: "cursor: pointer; transition: transform 0.2s ease; display: inline-block;", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, /* @__PURE__ */ n("path", { d:
|
|
1324
|
+
}, U = R[b] || R.star;
|
|
1325
|
+
return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: r, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "svg-icon", onClick: this.handleClick, style: "cursor: pointer; transition: transform 0.2s ease; display: inline-block;", onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave }, /* @__PURE__ */ n("path", { d: U, fill: r }));
|
|
1348
1326
|
}
|
|
1349
1327
|
static get observedAttributes() {
|
|
1350
1328
|
return ["name", "size", "color"];
|
|
1351
1329
|
}
|
|
1352
|
-
onAttributeChanged(e, r,
|
|
1353
|
-
|
|
1330
|
+
onAttributeChanged(e, r, b) {
|
|
1331
|
+
ye.debug(`Attribute ${e} changed from ${r} to ${b}`), this.connected && this.rerender();
|
|
1354
1332
|
}
|
|
1355
1333
|
}
|
|
1356
|
-
|
|
1357
|
-
[
|
|
1358
|
-
|
|
1359
|
-
var
|
|
1360
|
-
let
|
|
1361
|
-
function
|
|
1362
|
-
return (e =
|
|
1334
|
+
rt = Sr;
|
|
1335
|
+
[Tr, ot] = kr(rt, [], it, 0, void 0, X).c;
|
|
1336
|
+
ot();
|
|
1337
|
+
var at;
|
|
1338
|
+
let st, lt;
|
|
1339
|
+
function ce(t, e, r) {
|
|
1340
|
+
return (e = ct(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1363
1341
|
}
|
|
1364
|
-
function
|
|
1365
|
-
function
|
|
1366
|
-
return function(
|
|
1367
|
-
return u && u(
|
|
1342
|
+
function _r(t, e, r, b, R, U) {
|
|
1343
|
+
function E(o, l, u) {
|
|
1344
|
+
return function(a, s) {
|
|
1345
|
+
return u && u(a), o[l].call(a, s);
|
|
1368
1346
|
};
|
|
1369
1347
|
}
|
|
1370
1348
|
function B(o, l) {
|
|
1371
1349
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1372
1350
|
return l;
|
|
1373
1351
|
}
|
|
1374
|
-
function
|
|
1375
|
-
if (typeof o != "function" && (
|
|
1352
|
+
function T(o, l, u, a) {
|
|
1353
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
1376
1354
|
return o;
|
|
1377
1355
|
}
|
|
1378
|
-
function
|
|
1356
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
1379
1357
|
function v(c) {
|
|
1380
1358
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1381
1359
|
}
|
|
1382
|
-
var d, x = l[0], k = l[3],
|
|
1383
|
-
if (!
|
|
1360
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
1361
|
+
if (!_) {
|
|
1384
1362
|
u || Array.isArray(x) || (x = [x]);
|
|
1385
|
-
var i = {}, C = [], m =
|
|
1386
|
-
y ? (
|
|
1363
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1364
|
+
y ? (g || f ? i = { get: Ee(function() {
|
|
1387
1365
|
return k(this);
|
|
1388
|
-
},
|
|
1366
|
+
}, a, "get"), set: function(c) {
|
|
1389
1367
|
l[4](this, c);
|
|
1390
|
-
} } : i[m] = k,
|
|
1368
|
+
} } : i[m] = k, g || Ee(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
1391
1369
|
}
|
|
1392
1370
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1393
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
1371
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
1394
1372
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1395
|
-
|
|
1373
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
1396
1374
|
}).bind(null, J) };
|
|
1397
1375
|
try {
|
|
1398
|
-
if (
|
|
1376
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1399
1377
|
else {
|
|
1400
|
-
var $,
|
|
1401
|
-
D.static =
|
|
1378
|
+
var $, O;
|
|
1379
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
1402
1380
|
return v(c), i.value;
|
|
1403
|
-
} : (
|
|
1404
|
-
return c[
|
|
1405
|
-
}, (
|
|
1406
|
-
c[
|
|
1381
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
1382
|
+
return c[a];
|
|
1383
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
1384
|
+
c[a] = w;
|
|
1407
1385
|
}));
|
|
1408
1386
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1409
|
-
return
|
|
1387
|
+
return a in c;
|
|
1410
1388
|
} };
|
|
1411
|
-
if ($ && (W.get = $),
|
|
1412
|
-
if (typeof h == "object" && h) (d =
|
|
1389
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1390
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
1413
1391
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1414
|
-
} else
|
|
1392
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1415
1393
|
}
|
|
1416
1394
|
} finally {
|
|
1417
1395
|
J.v = !0;
|
|
1418
1396
|
}
|
|
1419
1397
|
}
|
|
1420
|
-
return (
|
|
1421
|
-
for (var
|
|
1398
|
+
return (g || f) && S.push(function(c, w) {
|
|
1399
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
1422
1400
|
return w;
|
|
1423
|
-
}),
|
|
1401
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
1424
1402
|
}
|
|
1425
|
-
function
|
|
1403
|
+
function M(o, l) {
|
|
1426
1404
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1427
1405
|
}
|
|
1428
|
-
if (arguments.length >= 6) var H =
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1431
|
-
return
|
|
1432
|
-
},
|
|
1406
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1407
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
1408
|
+
var s, z, L = [], S = function(m) {
|
|
1409
|
+
return zr(m) === o;
|
|
1410
|
+
}, j = /* @__PURE__ */ new Map();
|
|
1433
1411
|
function y(m) {
|
|
1434
1412
|
m && L.push(B.bind(null, m));
|
|
1435
1413
|
}
|
|
1436
|
-
for (var
|
|
1437
|
-
var f = l[
|
|
1414
|
+
for (var g = 0; g < l.length; g++) {
|
|
1415
|
+
var f = l[g];
|
|
1438
1416
|
if (Array.isArray(f)) {
|
|
1439
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
1440
|
-
if (!
|
|
1441
|
-
var C =
|
|
1417
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1418
|
+
if (!_ && !d) {
|
|
1419
|
+
var C = j.get(i);
|
|
1442
1420
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1443
|
-
|
|
1421
|
+
j.set(i, !(p > 2) || p);
|
|
1444
1422
|
}
|
|
1445
|
-
|
|
1423
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : ct(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
1446
1424
|
}
|
|
1447
1425
|
}
|
|
1448
|
-
return y(
|
|
1449
|
-
}(t, e,
|
|
1450
|
-
return r.length ||
|
|
1426
|
+
return y(s), y(z), L;
|
|
1427
|
+
}(t, e, R, A);
|
|
1428
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
1451
1429
|
var o = [];
|
|
1452
|
-
return r.length && [
|
|
1430
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
1453
1431
|
} };
|
|
1454
1432
|
}
|
|
1455
|
-
function
|
|
1456
|
-
var e =
|
|
1433
|
+
function ct(t) {
|
|
1434
|
+
var e = Er(t, "string");
|
|
1457
1435
|
return typeof e == "symbol" ? e : e + "";
|
|
1458
1436
|
}
|
|
1459
|
-
function
|
|
1437
|
+
function Er(t, e) {
|
|
1460
1438
|
if (typeof t != "object" || !t) return t;
|
|
1461
1439
|
var r = t[Symbol.toPrimitive];
|
|
1462
1440
|
if (r !== void 0) {
|
|
1463
|
-
var
|
|
1464
|
-
if (typeof
|
|
1441
|
+
var b = r.call(t, e);
|
|
1442
|
+
if (typeof b != "object") return b;
|
|
1465
1443
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1466
1444
|
}
|
|
1467
1445
|
return String(t);
|
|
1468
1446
|
}
|
|
1469
|
-
function
|
|
1447
|
+
function Ee(t, e, r) {
|
|
1470
1448
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1471
1449
|
try {
|
|
1472
1450
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -1474,162 +1452,162 @@ function _e(t, e, r) {
|
|
|
1474
1452
|
}
|
|
1475
1453
|
return t;
|
|
1476
1454
|
}
|
|
1477
|
-
function
|
|
1455
|
+
function zr(t) {
|
|
1478
1456
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1479
1457
|
return t;
|
|
1480
1458
|
}
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1459
|
+
const he = ae("SvgDemo");
|
|
1460
|
+
lt = [re({
|
|
1483
1461
|
tagName: "svg-demo"
|
|
1484
1462
|
})];
|
|
1485
|
-
let
|
|
1486
|
-
class
|
|
1463
|
+
let Lr;
|
|
1464
|
+
class Dr extends X {
|
|
1487
1465
|
constructor() {
|
|
1488
|
-
super(),
|
|
1489
|
-
e.target.setAttribute("fill", "#e74c3c"),
|
|
1490
|
-
}),
|
|
1466
|
+
super(), ce(this, "animationId", null), ce(this, "rotationAngle", 0), ce(this, "showTooltip", (e, r) => {
|
|
1467
|
+
e.target.setAttribute("fill", "#e74c3c"), he.debug(`Tooltip value: ${r}`);
|
|
1468
|
+
}), ce(this, "hideTooltip", (e) => {
|
|
1491
1469
|
e.target.setAttribute("fill", "#3498db");
|
|
1492
|
-
}),
|
|
1470
|
+
}), ce(this, "startAnimation", () => {
|
|
1493
1471
|
if (this.animationId) return;
|
|
1494
1472
|
const e = () => {
|
|
1495
1473
|
this.rotationAngle += 2, this.rotationAngle >= 360 && (this.rotationAngle = 0), this.rerender(), this.animationId = requestAnimationFrame(e);
|
|
1496
1474
|
};
|
|
1497
1475
|
this.animationId = requestAnimationFrame(e);
|
|
1498
|
-
}),
|
|
1476
|
+
}), ce(this, "stopAnimation", () => {
|
|
1499
1477
|
this.animationId && (cancelAnimationFrame(this.animationId), this.animationId = null);
|
|
1500
|
-
}),
|
|
1478
|
+
}), he.info("SvgDemo component initialized");
|
|
1501
1479
|
}
|
|
1502
1480
|
render() {
|
|
1503
1481
|
return /* @__PURE__ */ n("div", { style: "padding: 20px; background: #f5f5f5; border-radius: 8px; margin: 10px 0;" }, /* @__PURE__ */ n("h3", { style: "margin-top: 0; color: #333;" }, "SVG Showcase"), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Basic Shapes"), /* @__PURE__ */ n("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ n("circle", { cx: "50", cy: "50", r: "30", fill: "#e74c3c", stroke: "#c0392b", strokeWidth: "2" }), /* @__PURE__ */ n("rect", { x: "100", y: "20", width: "60", height: "60", fill: "#3498db", stroke: "#2980b9", strokeWidth: "2", rx: "5" }), /* @__PURE__ */ n("polygon", { points: "200,20 230,80 170,80", fill: "#2ecc71", stroke: "#27ae60", strokeWidth: "2" }), /* @__PURE__ */ n("line", { x1: "250", y1: "20", x2: "290", y2: "80", stroke: "#9b59b6", strokeWidth: "3", strokeLinecap: "round" }))), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Gradients & Effects"), /* @__PURE__ */ n("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ n("defs", null, /* @__PURE__ */ n("linearGradient", { id: "blueGradient", x1: "0%", y1: "0%", x2: "100%", y2: "0%" }, /* @__PURE__ */ n("stop", { offset: "0%", stopColor: "#3498db" }), /* @__PURE__ */ n("stop", { offset: "100%", stopColor: "#9b59b6" })), /* @__PURE__ */ n("radialGradient", { id: "redGradient", cx: "50%", cy: "50%", r: "50%" }, /* @__PURE__ */ n("stop", { offset: "0%", stopColor: "#e74c3c" }), /* @__PURE__ */ n("stop", { offset: "100%", stopColor: "#c0392b" }))), /* @__PURE__ */ n("rect", { x: "20", y: "20", width: "120", height: "60", fill: "url(#blueGradient)", rx: "10" }), /* @__PURE__ */ n("circle", { cx: "200", cy: "50", r: "35", fill: "url(#redGradient)" }))), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Animation"), /* @__PURE__ */ n("svg", { width: "300", height: "100", style: "border: 1px solid #ddd; background: white;" }, /* @__PURE__ */ n("g", { transform: `translate(150, 50) rotate(${this.rotationAngle})` }, /* @__PURE__ */ n("polygon", { points: "-30,0 0,-40 30,0 0,40", fill: "#f39c12", stroke: "#e67e22", strokeWidth: "2" }), /* @__PURE__ */ n("circle", { cx: "0", cy: "0", r: "8", fill: "#2c3e50" }))), /* @__PURE__ */ n("div", { style: "margin-top: 10px;" }, /* @__PURE__ */ n("button", { onClick: this.startAnimation, style: "margin-right: 10px; padding: 5px 10px;", "data-wsx-key": "SvgDemo-button-text-13-5-1" }, "Start Animation"), /* @__PURE__ */ n("button", { onClick: this.stopAnimation, style: "padding: 5px 10px;", "data-wsx-key": "SvgDemo-button-text-13-5-3" }, "Stop Animation"))), /* @__PURE__ */ n("div", { style: "margin-bottom: 20px;" }, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Interactive Chart"), this.renderChart()), /* @__PURE__ */ n("div", null, /* @__PURE__ */ n("h4", { style: "margin: 10px 0; color: #666;" }, "Icon Components"), /* @__PURE__ */ n("div", { style: "display: flex; gap: 15px; align-items: center;" }, /* @__PURE__ */ n("svg-icon", { name: "star", size: "32", color: "#f39c12" }), /* @__PURE__ */ n("svg-icon", { name: "heart", size: "32", color: "#e74c3c" }), /* @__PURE__ */ n("svg-icon", { name: "check", size: "32", color: "#27ae60" }), /* @__PURE__ */ n("svg-icon", { name: "github", size: "32", color: "#333" }), /* @__PURE__ */ n("svg-icon", { name: "play", size: "32", color: "#3498db" }), /* @__PURE__ */ n("svg-icon", { name: "settings", size: "32", color: "#9b59b6" }))));
|
|
1504
1482
|
}
|
|
1505
1483
|
renderChart() {
|
|
1506
|
-
const e = [30, 80, 45, 60, 20, 90, 55], r = Math.max(...e),
|
|
1507
|
-
return /* @__PURE__ */ n("svg", { width:
|
|
1508
|
-
const
|
|
1509
|
-
return /* @__PURE__ */ n("g", { key:
|
|
1484
|
+
const e = [30, 80, 45, 60, 20, 90, 55], r = Math.max(...e), b = 30, R = 40, U = 120, E = e.length * R + 40;
|
|
1485
|
+
return /* @__PURE__ */ n("svg", { width: E, height: U + 40, style: "border: 1px solid #ddd; background: white;" }, e.map((B, T) => {
|
|
1486
|
+
const N = B / r * U, M = T * R + 20, H = U - N + 20;
|
|
1487
|
+
return /* @__PURE__ */ n("g", { key: T }, /* @__PURE__ */ n("rect", { x: M, y: H, width: b, height: N, fill: "#3498db", stroke: "#2980b9", strokeWidth: "1", onMouseEnter: (A) => this.showTooltip(A, B), onMouseLeave: this.hideTooltip, style: "cursor: pointer; transition: fill 0.2s;" }), /* @__PURE__ */ n("text", { x: M + b / 2, y: U + 35, textAnchor: "middle", fontSize: "12", fill: "#666" }, T + 1));
|
|
1510
1488
|
}));
|
|
1511
1489
|
}
|
|
1512
1490
|
onConnected() {
|
|
1513
|
-
|
|
1491
|
+
he.info("SvgDemo connected to DOM");
|
|
1514
1492
|
}
|
|
1515
1493
|
onDisconnected() {
|
|
1516
|
-
|
|
1494
|
+
he.info("SvgDemo disconnected from DOM"), this.stopAnimation();
|
|
1517
1495
|
}
|
|
1518
1496
|
}
|
|
1519
|
-
|
|
1520
|
-
[
|
|
1521
|
-
|
|
1522
|
-
var
|
|
1523
|
-
let
|
|
1524
|
-
function
|
|
1525
|
-
return (e =
|
|
1497
|
+
at = Dr;
|
|
1498
|
+
[Lr, st] = _r(at, [], lt, 0, void 0, X).c;
|
|
1499
|
+
st();
|
|
1500
|
+
var ut;
|
|
1501
|
+
let dt, ht, ft;
|
|
1502
|
+
function ve(t, e, r) {
|
|
1503
|
+
return (e = pt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1526
1504
|
}
|
|
1527
|
-
function
|
|
1528
|
-
function
|
|
1529
|
-
return function(
|
|
1530
|
-
return u && u(
|
|
1505
|
+
function $r(t, e, r, b, R, U) {
|
|
1506
|
+
function E(o, l, u) {
|
|
1507
|
+
return function(a, s) {
|
|
1508
|
+
return u && u(a), o[l].call(a, s);
|
|
1531
1509
|
};
|
|
1532
1510
|
}
|
|
1533
1511
|
function B(o, l) {
|
|
1534
1512
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1535
1513
|
return l;
|
|
1536
1514
|
}
|
|
1537
|
-
function
|
|
1538
|
-
if (typeof o != "function" && (
|
|
1515
|
+
function T(o, l, u, a) {
|
|
1516
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
1539
1517
|
return o;
|
|
1540
1518
|
}
|
|
1541
|
-
function
|
|
1519
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
1542
1520
|
function v(c) {
|
|
1543
1521
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1544
1522
|
}
|
|
1545
|
-
var d, x = l[0], k = l[3],
|
|
1546
|
-
if (!
|
|
1523
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
1524
|
+
if (!_) {
|
|
1547
1525
|
u || Array.isArray(x) || (x = [x]);
|
|
1548
|
-
var i = {}, C = [], m =
|
|
1549
|
-
y ? (
|
|
1526
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1527
|
+
y ? (g || f ? i = { get: ze(function() {
|
|
1550
1528
|
return k(this);
|
|
1551
|
-
},
|
|
1529
|
+
}, a, "get"), set: function(c) {
|
|
1552
1530
|
l[4](this, c);
|
|
1553
|
-
} } : i[m] = k,
|
|
1531
|
+
} } : i[m] = k, g || ze(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
1554
1532
|
}
|
|
1555
1533
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1556
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
1534
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
1557
1535
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1558
|
-
|
|
1536
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
1559
1537
|
}).bind(null, J) };
|
|
1560
1538
|
try {
|
|
1561
|
-
if (
|
|
1539
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1562
1540
|
else {
|
|
1563
|
-
var $,
|
|
1564
|
-
D.static =
|
|
1541
|
+
var $, O;
|
|
1542
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
1565
1543
|
return v(c), i.value;
|
|
1566
|
-
} : (
|
|
1567
|
-
return c[
|
|
1568
|
-
}, (
|
|
1569
|
-
c[
|
|
1544
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
1545
|
+
return c[a];
|
|
1546
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
1547
|
+
c[a] = w;
|
|
1570
1548
|
}));
|
|
1571
1549
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1572
|
-
return
|
|
1550
|
+
return a in c;
|
|
1573
1551
|
} };
|
|
1574
|
-
if ($ && (W.get = $),
|
|
1575
|
-
if (typeof h == "object" && h) (d =
|
|
1552
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1553
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
1576
1554
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1577
|
-
} else
|
|
1555
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1578
1556
|
}
|
|
1579
1557
|
} finally {
|
|
1580
1558
|
J.v = !0;
|
|
1581
1559
|
}
|
|
1582
1560
|
}
|
|
1583
|
-
return (
|
|
1584
|
-
for (var
|
|
1561
|
+
return (g || f) && S.push(function(c, w) {
|
|
1562
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
1585
1563
|
return w;
|
|
1586
|
-
}),
|
|
1564
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
1587
1565
|
}
|
|
1588
|
-
function
|
|
1566
|
+
function M(o, l) {
|
|
1589
1567
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1590
1568
|
}
|
|
1591
|
-
if (arguments.length >= 6) var H =
|
|
1592
|
-
var
|
|
1593
|
-
var
|
|
1594
|
-
return
|
|
1595
|
-
},
|
|
1569
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1570
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
1571
|
+
var s, z, L = [], S = function(m) {
|
|
1572
|
+
return jr(m) === o;
|
|
1573
|
+
}, j = /* @__PURE__ */ new Map();
|
|
1596
1574
|
function y(m) {
|
|
1597
1575
|
m && L.push(B.bind(null, m));
|
|
1598
1576
|
}
|
|
1599
|
-
for (var
|
|
1600
|
-
var f = l[
|
|
1577
|
+
for (var g = 0; g < l.length; g++) {
|
|
1578
|
+
var f = l[g];
|
|
1601
1579
|
if (Array.isArray(f)) {
|
|
1602
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
1603
|
-
if (!
|
|
1604
|
-
var C =
|
|
1580
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1581
|
+
if (!_ && !d) {
|
|
1582
|
+
var C = j.get(i);
|
|
1605
1583
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1606
|
-
|
|
1584
|
+
j.set(i, !(p > 2) || p);
|
|
1607
1585
|
}
|
|
1608
|
-
|
|
1586
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : pt(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
1609
1587
|
}
|
|
1610
1588
|
}
|
|
1611
|
-
return y(
|
|
1612
|
-
}(t, e,
|
|
1613
|
-
return r.length ||
|
|
1589
|
+
return y(s), y(z), L;
|
|
1590
|
+
}(t, e, R, A);
|
|
1591
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
1614
1592
|
var o = [];
|
|
1615
|
-
return r.length && [
|
|
1593
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
1616
1594
|
} };
|
|
1617
1595
|
}
|
|
1618
|
-
function
|
|
1619
|
-
var e =
|
|
1596
|
+
function pt(t) {
|
|
1597
|
+
var e = Ar(t, "string");
|
|
1620
1598
|
return typeof e == "symbol" ? e : e + "";
|
|
1621
1599
|
}
|
|
1622
|
-
function
|
|
1600
|
+
function Ar(t, e) {
|
|
1623
1601
|
if (typeof t != "object" || !t) return t;
|
|
1624
1602
|
var r = t[Symbol.toPrimitive];
|
|
1625
1603
|
if (r !== void 0) {
|
|
1626
|
-
var
|
|
1627
|
-
if (typeof
|
|
1604
|
+
var b = r.call(t, e);
|
|
1605
|
+
if (typeof b != "object") return b;
|
|
1628
1606
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1629
1607
|
}
|
|
1630
1608
|
return String(t);
|
|
1631
1609
|
}
|
|
1632
|
-
function
|
|
1610
|
+
function ze(t, e, r) {
|
|
1633
1611
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1634
1612
|
try {
|
|
1635
1613
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -1637,154 +1615,148 @@ function Ee(t, e, r) {
|
|
|
1637
1615
|
}
|
|
1638
1616
|
return t;
|
|
1639
1617
|
}
|
|
1640
|
-
function
|
|
1618
|
+
function jr(t) {
|
|
1641
1619
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1642
1620
|
return t;
|
|
1643
1621
|
}
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1622
|
+
const Ir = ae("SimpleReactiveDemo");
|
|
1623
|
+
ht = [re({
|
|
1646
1624
|
tagName: "simple-reactive-demo"
|
|
1647
1625
|
})];
|
|
1648
|
-
let
|
|
1649
|
-
class
|
|
1626
|
+
let Or;
|
|
1627
|
+
class Pr extends X {
|
|
1650
1628
|
constructor() {
|
|
1651
|
-
super(),
|
|
1652
|
-
this.state.count++, this.state.message = `Clicked ${this.state.count} time${this.state.count === 1 ? "" : "s"}!`;
|
|
1653
|
-
}), ye(this, "reset", () => {
|
|
1654
|
-
this.state.count = 0, this.state.message = "Reset! Click again!";
|
|
1655
|
-
}), wr.info("SimpleReactiveDemo initialized");
|
|
1656
|
-
let e = this.reactive({
|
|
1629
|
+
super(), ve(this, "state", ft(this, {
|
|
1657
1630
|
count: 0,
|
|
1658
1631
|
message: "Click the button!"
|
|
1659
|
-
})
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
},
|
|
1665
|
-
enumerable: !0,
|
|
1666
|
-
configurable: !0
|
|
1667
|
-
});
|
|
1632
|
+
})), ve(this, "increment", () => {
|
|
1633
|
+
this.state.count++, this.state.message = `Clicked ${this.state.count} time${this.state.count === 1 ? "" : "s"}!`;
|
|
1634
|
+
}), ve(this, "reset", () => {
|
|
1635
|
+
this.state.count = 0, this.state.message = "Reset! Click again!";
|
|
1636
|
+
}), Ir.info("SimpleReactiveDemo initialized");
|
|
1668
1637
|
}
|
|
1669
1638
|
render() {
|
|
1670
1639
|
return /* @__PURE__ */ n("div", { style: "padding: 20px; border: 1px solid #ccc; border-radius: 8px; margin: 20px;" }, /* @__PURE__ */ n("h3", null, "📱 Simple Reactive Demo"), /* @__PURE__ */ n("p", null, this.state.message), /* @__PURE__ */ n("div", { style: "font-size: 24px; margin: 16px 0;" }, "Count: ", /* @__PURE__ */ n("strong", null, this.state.count)), /* @__PURE__ */ n("div", null, /* @__PURE__ */ n("button", { onClick: this.increment, style: "margin-right: 8px; padding: 8px 16px;", "data-wsx-key": "SimpleReactiveDemo-button-text-7-1" }, "+ Increment"), /* @__PURE__ */ n("button", { onClick: this.reset, style: "padding: 8px 16px;", "data-wsx-key": "SimpleReactiveDemo-button-text-7-3" }, "🔄 Reset")), /* @__PURE__ */ n("div", { style: "margin-top: 16px; font-size: 12px; color: #666;" }, "💡 State changes automatically trigger re-renders!"));
|
|
1671
1640
|
}
|
|
1672
1641
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1642
|
+
ut = Pr;
|
|
1643
|
+
({
|
|
1644
|
+
e: [ft],
|
|
1645
|
+
c: [Or, dt]
|
|
1646
|
+
} = $r(ut, [[ne, 0, "state"]], ht, 0, void 0, X));
|
|
1647
|
+
dt();
|
|
1648
|
+
const Rr = ".todo-list{padding:1.5rem;max-width:600px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.todo-header{margin-bottom:1.5rem;text-align:center}.todo-header h2{margin:0 0 .5rem;color:#333;font-size:1.75rem}.subtitle{margin:0;color:#666;font-size:.9rem}.todo-input-section{display:flex;gap:.5rem;margin-bottom:1rem}.todo-input{flex:1;padding:.75rem;border:2px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s}.todo-input:focus{outline:none;border-color:#4caf50}.todo-filters{display:flex;gap:.5rem;margin-bottom:1rem;justify-content:center}.filter-btn{padding:.5rem 1rem;border:2px solid #ddd;background:#fff;border-radius:4px;cursor:pointer;transition:all .2s;font-size:.9rem}.filter-btn:hover{background:#f5f5f5}.filter-btn.active{background:#4caf50;color:#fff;border-color:#4caf50}.todo-list-container{min-height:200px;margin-bottom:1rem}.empty-state{text-align:center;padding:3rem 1rem;color:#999;font-style:italic}.todo-items{list-style:none;padding:0;margin:0}.todo-item{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.5rem;background:#f9f9f9;border-radius:4px;transition:background .2s}.todo-item:hover{background:#f0f0f0}.todo-item.completed{opacity:.6}.todo-checkbox{width:1.25rem;height:1.25rem;cursor:pointer}.todo-text{flex:1;font-size:1rem}.todo-item.completed .todo-text{text-decoration:line-through;color:#999}.todo-actions{display:flex;gap:.5rem;justify-content:center;margin-top:1rem}.btn{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;transition:all .2s}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#4caf50;color:#fff}.btn-primary:hover:not(:disabled){background:#45a049}.btn-warning{background:#ff9800;color:#fff}.btn-warning:hover{background:#e68900}.btn-danger{background:#f44336;color:#fff}.btn-danger:hover{background:#da190b}.btn-sm{padding:.25rem .5rem;font-size:.8rem}.debug-info{margin-top:2rem;padding-top:1rem;border-top:1px solid #ddd}.debug-info summary{cursor:pointer;color:#666;font-size:.9rem}.debug-info pre{background:#f5f5f5;padding:1rem;border-radius:4px;overflow-x:auto;font-size:.85rem;margin-top:.5rem}";
|
|
1649
|
+
var mt;
|
|
1650
|
+
let gt, bt, yt, vt;
|
|
1679
1651
|
function ee(t, e, r) {
|
|
1680
|
-
return (e =
|
|
1652
|
+
return (e = xt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1681
1653
|
}
|
|
1682
|
-
function
|
|
1683
|
-
function
|
|
1684
|
-
return function(
|
|
1685
|
-
return u && u(
|
|
1654
|
+
function Br(t, e, r, b, R, U) {
|
|
1655
|
+
function E(o, l, u) {
|
|
1656
|
+
return function(a, s) {
|
|
1657
|
+
return u && u(a), o[l].call(a, s);
|
|
1686
1658
|
};
|
|
1687
1659
|
}
|
|
1688
1660
|
function B(o, l) {
|
|
1689
1661
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1690
1662
|
return l;
|
|
1691
1663
|
}
|
|
1692
|
-
function
|
|
1693
|
-
if (typeof o != "function" && (
|
|
1664
|
+
function T(o, l, u, a) {
|
|
1665
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
1694
1666
|
return o;
|
|
1695
1667
|
}
|
|
1696
|
-
function
|
|
1668
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
1697
1669
|
function v(c) {
|
|
1698
1670
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1699
1671
|
}
|
|
1700
|
-
var d, x = l[0], k = l[3],
|
|
1701
|
-
if (!
|
|
1672
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
1673
|
+
if (!_) {
|
|
1702
1674
|
u || Array.isArray(x) || (x = [x]);
|
|
1703
|
-
var i = {}, C = [], m =
|
|
1704
|
-
y ? (
|
|
1675
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1676
|
+
y ? (g || f ? i = { get: Le(function() {
|
|
1705
1677
|
return k(this);
|
|
1706
|
-
},
|
|
1678
|
+
}, a, "get"), set: function(c) {
|
|
1707
1679
|
l[4](this, c);
|
|
1708
|
-
} } : i[m] = k,
|
|
1680
|
+
} } : i[m] = k, g || Le(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
1709
1681
|
}
|
|
1710
1682
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1711
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
1683
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
1712
1684
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1713
|
-
|
|
1685
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
1714
1686
|
}).bind(null, J) };
|
|
1715
1687
|
try {
|
|
1716
|
-
if (
|
|
1688
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1717
1689
|
else {
|
|
1718
|
-
var $,
|
|
1719
|
-
D.static =
|
|
1690
|
+
var $, O;
|
|
1691
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
1720
1692
|
return v(c), i.value;
|
|
1721
|
-
} : (
|
|
1722
|
-
return c[
|
|
1723
|
-
}, (
|
|
1724
|
-
c[
|
|
1693
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
1694
|
+
return c[a];
|
|
1695
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
1696
|
+
c[a] = w;
|
|
1725
1697
|
}));
|
|
1726
1698
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1727
|
-
return
|
|
1699
|
+
return a in c;
|
|
1728
1700
|
} };
|
|
1729
|
-
if ($ && (W.get = $),
|
|
1730
|
-
if (typeof h == "object" && h) (d =
|
|
1701
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1702
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
1731
1703
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1732
|
-
} else
|
|
1704
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1733
1705
|
}
|
|
1734
1706
|
} finally {
|
|
1735
1707
|
J.v = !0;
|
|
1736
1708
|
}
|
|
1737
1709
|
}
|
|
1738
|
-
return (
|
|
1739
|
-
for (var
|
|
1710
|
+
return (g || f) && S.push(function(c, w) {
|
|
1711
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
1740
1712
|
return w;
|
|
1741
|
-
}),
|
|
1713
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
1742
1714
|
}
|
|
1743
|
-
function
|
|
1715
|
+
function M(o, l) {
|
|
1744
1716
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1745
1717
|
}
|
|
1746
|
-
if (arguments.length >= 6) var H =
|
|
1747
|
-
var
|
|
1748
|
-
var
|
|
1749
|
-
return
|
|
1750
|
-
},
|
|
1718
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1719
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
1720
|
+
var s, z, L = [], S = function(m) {
|
|
1721
|
+
return Mr(m) === o;
|
|
1722
|
+
}, j = /* @__PURE__ */ new Map();
|
|
1751
1723
|
function y(m) {
|
|
1752
1724
|
m && L.push(B.bind(null, m));
|
|
1753
1725
|
}
|
|
1754
|
-
for (var
|
|
1755
|
-
var f = l[
|
|
1726
|
+
for (var g = 0; g < l.length; g++) {
|
|
1727
|
+
var f = l[g];
|
|
1756
1728
|
if (Array.isArray(f)) {
|
|
1757
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
1758
|
-
if (!
|
|
1759
|
-
var C =
|
|
1729
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1730
|
+
if (!_ && !d) {
|
|
1731
|
+
var C = j.get(i);
|
|
1760
1732
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1761
|
-
|
|
1733
|
+
j.set(i, !(p > 2) || p);
|
|
1762
1734
|
}
|
|
1763
|
-
|
|
1735
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : xt(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
1764
1736
|
}
|
|
1765
1737
|
}
|
|
1766
|
-
return y(
|
|
1767
|
-
}(t, e,
|
|
1768
|
-
return r.length ||
|
|
1738
|
+
return y(s), y(z), L;
|
|
1739
|
+
}(t, e, R, A);
|
|
1740
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
1769
1741
|
var o = [];
|
|
1770
|
-
return r.length && [
|
|
1742
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
1771
1743
|
} };
|
|
1772
1744
|
}
|
|
1773
|
-
function
|
|
1774
|
-
var e =
|
|
1745
|
+
function xt(t) {
|
|
1746
|
+
var e = Nr(t, "string");
|
|
1775
1747
|
return typeof e == "symbol" ? e : e + "";
|
|
1776
1748
|
}
|
|
1777
|
-
function
|
|
1749
|
+
function Nr(t, e) {
|
|
1778
1750
|
if (typeof t != "object" || !t) return t;
|
|
1779
1751
|
var r = t[Symbol.toPrimitive];
|
|
1780
1752
|
if (r !== void 0) {
|
|
1781
|
-
var
|
|
1782
|
-
if (typeof
|
|
1753
|
+
var b = r.call(t, e);
|
|
1754
|
+
if (typeof b != "object") return b;
|
|
1783
1755
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1784
1756
|
}
|
|
1785
1757
|
return String(t);
|
|
1786
1758
|
}
|
|
1787
|
-
function
|
|
1759
|
+
function Le(t, e, r) {
|
|
1788
1760
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
1789
1761
|
try {
|
|
1790
1762
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -1792,76 +1764,60 @@ function ze(t, e, r) {
|
|
|
1792
1764
|
}
|
|
1793
1765
|
return t;
|
|
1794
1766
|
}
|
|
1795
|
-
function
|
|
1767
|
+
function Mr(t) {
|
|
1796
1768
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
1797
1769
|
return t;
|
|
1798
1770
|
}
|
|
1799
|
-
const se =
|
|
1800
|
-
|
|
1771
|
+
const se = ae("TodoList");
|
|
1772
|
+
bt = [re({
|
|
1801
1773
|
tagName: "todo-list"
|
|
1802
1774
|
})];
|
|
1803
|
-
let
|
|
1804
|
-
class
|
|
1775
|
+
let Ur;
|
|
1776
|
+
class Hr extends X {
|
|
1805
1777
|
constructor() {
|
|
1806
|
-
super(), ee(this, "_autoStyles",
|
|
1807
|
-
var
|
|
1808
|
-
const
|
|
1809
|
-
this._newTodoText =
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1812
|
-
}), ee(this, "handleKeyDown", (
|
|
1813
|
-
|
|
1778
|
+
super(), ee(this, "_autoStyles", Rr), ee(this, "todos", yt(this, [])), ee(this, "_newTodoText", ""), ee(this, "filter", vt(this, "all")), ee(this, "nextId", 1), ee(this, "handleInputChange", (e) => {
|
|
1779
|
+
var R;
|
|
1780
|
+
const r = e.target;
|
|
1781
|
+
this._newTodoText = r.value;
|
|
1782
|
+
const b = (R = this.shadowRoot) == null ? void 0 : R.querySelector(".todo-input-section .btn-primary");
|
|
1783
|
+
b && (b.disabled = !this._newTodoText.trim());
|
|
1784
|
+
}), ee(this, "handleKeyDown", (e) => {
|
|
1785
|
+
e.key === "Enter" && this._newTodoText.trim() && this.addTodo();
|
|
1814
1786
|
}), ee(this, "addTodo", () => {
|
|
1815
|
-
var
|
|
1816
|
-
const
|
|
1817
|
-
if (
|
|
1787
|
+
var b, R;
|
|
1788
|
+
const e = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".todo-input"), r = (e == null ? void 0 : e.value.trim()) || this._newTodoText.trim();
|
|
1789
|
+
if (r) {
|
|
1818
1790
|
if (this.todos = [...this.todos, {
|
|
1819
1791
|
id: this.nextId++,
|
|
1820
|
-
text:
|
|
1792
|
+
text: r,
|
|
1821
1793
|
completed: !1,
|
|
1822
1794
|
createdAt: Date.now()
|
|
1823
|
-
}], this._newTodoText = "",
|
|
1824
|
-
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1795
|
+
}], this._newTodoText = "", e) {
|
|
1796
|
+
e.value = "";
|
|
1797
|
+
const U = (R = this.shadowRoot) == null ? void 0 : R.querySelector(".todo-input-section .btn-primary");
|
|
1798
|
+
U && (U.disabled = !0);
|
|
1827
1799
|
}
|
|
1828
1800
|
se.debug("Todo added", {
|
|
1829
1801
|
count: this.todos.length
|
|
1830
1802
|
});
|
|
1831
1803
|
}
|
|
1832
|
-
}), ee(this, "removeTodo", (
|
|
1833
|
-
this.todos = this.todos.filter((
|
|
1834
|
-
id:
|
|
1804
|
+
}), ee(this, "removeTodo", (e) => {
|
|
1805
|
+
this.todos = this.todos.filter((r) => r.id !== e), se.debug("Todo removed", {
|
|
1806
|
+
id: e,
|
|
1835
1807
|
remaining: this.todos.length
|
|
1836
1808
|
});
|
|
1837
|
-
}), ee(this, "toggleTodo", (
|
|
1838
|
-
this.todos = this.todos.map((
|
|
1839
|
-
...
|
|
1840
|
-
completed: !
|
|
1841
|
-
} :
|
|
1842
|
-
id:
|
|
1809
|
+
}), ee(this, "toggleTodo", (e) => {
|
|
1810
|
+
this.todos = this.todos.map((r) => r.id === e ? {
|
|
1811
|
+
...r,
|
|
1812
|
+
completed: !r.completed
|
|
1813
|
+
} : r), se.debug("Todo toggled", {
|
|
1814
|
+
id: e
|
|
1843
1815
|
});
|
|
1844
1816
|
}), ee(this, "clearCompleted", () => {
|
|
1845
|
-
this.todos = this.todos.filter((
|
|
1817
|
+
this.todos = this.todos.filter((e) => !e.completed), se.debug("Completed todos cleared");
|
|
1846
1818
|
}), ee(this, "clearAll", () => {
|
|
1847
1819
|
this.todos = [], se.debug("All todos cleared");
|
|
1848
1820
|
}), se.info("TodoList initialized");
|
|
1849
|
-
let e = this.reactive([]);
|
|
1850
|
-
Object.defineProperty(this, "todos", {
|
|
1851
|
-
get: () => e,
|
|
1852
|
-
set: (S) => {
|
|
1853
|
-
e = S !== null && typeof S < "u" && (Array.isArray(S) || typeof S == "object") ? this.reactive(S) : S, this.scheduleRerender();
|
|
1854
|
-
},
|
|
1855
|
-
enumerable: !0,
|
|
1856
|
-
configurable: !0
|
|
1857
|
-
});
|
|
1858
|
-
const [r, g] = this.useState("filter", "all");
|
|
1859
|
-
Object.defineProperty(this, "filter", {
|
|
1860
|
-
get: r,
|
|
1861
|
-
set: g,
|
|
1862
|
-
enumerable: !0,
|
|
1863
|
-
configurable: !0
|
|
1864
|
-
});
|
|
1865
1821
|
}
|
|
1866
1822
|
render() {
|
|
1867
1823
|
const e = this.getFilteredTodos();
|
|
@@ -1895,121 +1851,124 @@ class Lr extends X {
|
|
|
1895
1851
|
se.info("TodoList disconnected from DOM");
|
|
1896
1852
|
}
|
|
1897
1853
|
}
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1854
|
+
mt = Hr;
|
|
1855
|
+
({
|
|
1856
|
+
e: [yt, vt],
|
|
1857
|
+
c: [Ur, gt]
|
|
1858
|
+
} = Br(mt, [[ne, 0, "todos"], [ne, 0, "filter"]], bt, 0, void 0, X));
|
|
1859
|
+
gt();
|
|
1860
|
+
const Fr = ".todo-list-light{padding:1.5rem;max-width:600px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.todo-header{margin-bottom:1.5rem;text-align:center}.todo-header h2{margin:0 0 .5rem;color:#2196f3;font-size:1.75rem}.subtitle{margin:0;color:#666;font-size:.9rem}.todo-input-section{display:flex;gap:.5rem;margin-bottom:1rem}.todo-input{flex:1;padding:.75rem;border:2px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s}.todo-input:focus{outline:none;border-color:#2196f3}.todo-filters{display:flex;gap:.5rem;margin-bottom:1rem;justify-content:center}.filter-btn{padding:.5rem 1rem;border:2px solid #ddd;background:#fff;border-radius:4px;cursor:pointer;transition:all .2s;font-size:.9rem}.filter-btn:hover{background:#f5f5f5}.filter-btn.active{background:#2196f3;color:#fff;border-color:#2196f3}.todo-list-container{min-height:200px;margin-bottom:1rem}.empty-state{text-align:center;padding:3rem 1rem;color:#999;font-style:italic}.todo-items{list-style:none;padding:0;margin:0}.todo-item{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.5rem;background:#f0f7ff;border-radius:4px;transition:background .2s}.todo-item:hover{background:#e3f2fd}.todo-item.completed{opacity:.6}.todo-checkbox{width:1.25rem;height:1.25rem;cursor:pointer}.todo-text{flex:1;font-size:1rem}.todo-item.completed .todo-text{text-decoration:line-through;color:#999}.todo-actions{display:flex;gap:.5rem;justify-content:center;margin-top:1rem}.btn{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;transition:all .2s}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:#2196f3;color:#fff}.btn-primary:hover:not(:disabled){background:#1976d2}.btn-warning{background:#ff9800;color:#fff}.btn-warning:hover{background:#e68900}.btn-danger{background:#f44336;color:#fff}.btn-danger:hover{background:#da190b}.btn-sm{padding:.25rem .5rem;font-size:.8rem}.debug-info{margin-top:2rem;padding-top:1rem;border-top:1px solid #ddd}.debug-info summary{cursor:pointer;color:#666;font-size:.9rem}.debug-info pre{background:#f5f5f5;padding:1rem;border-radius:4px;overflow-x:auto;font-size:.85rem;margin-top:.5rem}";
|
|
1861
|
+
var kt;
|
|
1862
|
+
let Ct, wt, Tt, St;
|
|
1904
1863
|
function te(t, e, r) {
|
|
1905
|
-
return (e =
|
|
1864
|
+
return (e = _t(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
1906
1865
|
}
|
|
1907
|
-
function
|
|
1908
|
-
function
|
|
1909
|
-
return function(
|
|
1910
|
-
return u && u(
|
|
1866
|
+
function Kr(t, e, r, b, R, U) {
|
|
1867
|
+
function E(o, l, u) {
|
|
1868
|
+
return function(a, s) {
|
|
1869
|
+
return u && u(a), o[l].call(a, s);
|
|
1911
1870
|
};
|
|
1912
1871
|
}
|
|
1913
1872
|
function B(o, l) {
|
|
1914
1873
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
1915
1874
|
return l;
|
|
1916
1875
|
}
|
|
1917
|
-
function
|
|
1918
|
-
if (typeof o != "function" && (
|
|
1876
|
+
function T(o, l, u, a) {
|
|
1877
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
1919
1878
|
return o;
|
|
1920
1879
|
}
|
|
1921
|
-
function
|
|
1880
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
1922
1881
|
function v(c) {
|
|
1923
1882
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1924
1883
|
}
|
|
1925
|
-
var d, x = l[0], k = l[3],
|
|
1926
|
-
if (!
|
|
1884
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
1885
|
+
if (!_) {
|
|
1927
1886
|
u || Array.isArray(x) || (x = [x]);
|
|
1928
|
-
var i = {}, C = [], m =
|
|
1929
|
-
y ? (
|
|
1887
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
1888
|
+
y ? (g || f ? i = { get: De(function() {
|
|
1930
1889
|
return k(this);
|
|
1931
|
-
},
|
|
1890
|
+
}, a, "get"), set: function(c) {
|
|
1932
1891
|
l[4](this, c);
|
|
1933
|
-
} } : i[m] = k,
|
|
1892
|
+
} } : i[m] = k, g || De(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
1934
1893
|
}
|
|
1935
1894
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
1936
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
1895
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
1937
1896
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1938
|
-
|
|
1897
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
1939
1898
|
}).bind(null, J) };
|
|
1940
1899
|
try {
|
|
1941
|
-
if (
|
|
1900
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
1942
1901
|
else {
|
|
1943
|
-
var $,
|
|
1944
|
-
D.static =
|
|
1902
|
+
var $, O;
|
|
1903
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
1945
1904
|
return v(c), i.value;
|
|
1946
|
-
} : (
|
|
1947
|
-
return c[
|
|
1948
|
-
}, (
|
|
1949
|
-
c[
|
|
1905
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
1906
|
+
return c[a];
|
|
1907
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
1908
|
+
c[a] = w;
|
|
1950
1909
|
}));
|
|
1951
1910
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
1952
|
-
return
|
|
1911
|
+
return a in c;
|
|
1953
1912
|
} };
|
|
1954
|
-
if ($ && (W.get = $),
|
|
1955
|
-
if (typeof h == "object" && h) (d =
|
|
1913
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
1914
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
1956
1915
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
1957
|
-
} else
|
|
1916
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
1958
1917
|
}
|
|
1959
1918
|
} finally {
|
|
1960
1919
|
J.v = !0;
|
|
1961
1920
|
}
|
|
1962
1921
|
}
|
|
1963
|
-
return (
|
|
1964
|
-
for (var
|
|
1922
|
+
return (g || f) && S.push(function(c, w) {
|
|
1923
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
1965
1924
|
return w;
|
|
1966
|
-
}),
|
|
1925
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
1967
1926
|
}
|
|
1968
|
-
function
|
|
1927
|
+
function M(o, l) {
|
|
1969
1928
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
1970
1929
|
}
|
|
1971
|
-
if (arguments.length >= 6) var H =
|
|
1972
|
-
var
|
|
1973
|
-
var
|
|
1974
|
-
return
|
|
1975
|
-
},
|
|
1930
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
1931
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
1932
|
+
var s, z, L = [], S = function(m) {
|
|
1933
|
+
return Wr(m) === o;
|
|
1934
|
+
}, j = /* @__PURE__ */ new Map();
|
|
1976
1935
|
function y(m) {
|
|
1977
1936
|
m && L.push(B.bind(null, m));
|
|
1978
1937
|
}
|
|
1979
|
-
for (var
|
|
1980
|
-
var f = l[
|
|
1938
|
+
for (var g = 0; g < l.length; g++) {
|
|
1939
|
+
var f = l[g];
|
|
1981
1940
|
if (Array.isArray(f)) {
|
|
1982
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
1983
|
-
if (!
|
|
1984
|
-
var C =
|
|
1941
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
1942
|
+
if (!_ && !d) {
|
|
1943
|
+
var C = j.get(i);
|
|
1985
1944
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
1986
|
-
|
|
1945
|
+
j.set(i, !(p > 2) || p);
|
|
1987
1946
|
}
|
|
1988
|
-
|
|
1947
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : _t(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
1989
1948
|
}
|
|
1990
1949
|
}
|
|
1991
|
-
return y(
|
|
1992
|
-
}(t, e,
|
|
1993
|
-
return r.length ||
|
|
1950
|
+
return y(s), y(z), L;
|
|
1951
|
+
}(t, e, R, A);
|
|
1952
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
1994
1953
|
var o = [];
|
|
1995
|
-
return r.length && [
|
|
1954
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
1996
1955
|
} };
|
|
1997
1956
|
}
|
|
1998
|
-
function
|
|
1999
|
-
var e =
|
|
1957
|
+
function _t(t) {
|
|
1958
|
+
var e = Jr(t, "string");
|
|
2000
1959
|
return typeof e == "symbol" ? e : e + "";
|
|
2001
1960
|
}
|
|
2002
|
-
function
|
|
1961
|
+
function Jr(t, e) {
|
|
2003
1962
|
if (typeof t != "object" || !t) return t;
|
|
2004
1963
|
var r = t[Symbol.toPrimitive];
|
|
2005
1964
|
if (r !== void 0) {
|
|
2006
|
-
var
|
|
2007
|
-
if (typeof
|
|
1965
|
+
var b = r.call(t, e);
|
|
1966
|
+
if (typeof b != "object") return b;
|
|
2008
1967
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2009
1968
|
}
|
|
2010
1969
|
return String(t);
|
|
2011
1970
|
}
|
|
2012
|
-
function
|
|
1971
|
+
function De(t, e, r) {
|
|
2013
1972
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
2014
1973
|
try {
|
|
2015
1974
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -2017,74 +1976,58 @@ function Ae(t, e, r) {
|
|
|
2017
1976
|
}
|
|
2018
1977
|
return t;
|
|
2019
1978
|
}
|
|
2020
|
-
function
|
|
1979
|
+
function Wr(t) {
|
|
2021
1980
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
2022
1981
|
return t;
|
|
2023
1982
|
}
|
|
2024
|
-
const
|
|
2025
|
-
|
|
1983
|
+
const le = ae("TodoListLight");
|
|
1984
|
+
wt = [re({
|
|
2026
1985
|
tagName: "todo-list-light"
|
|
2027
1986
|
})];
|
|
2028
|
-
let
|
|
2029
|
-
class
|
|
1987
|
+
let Gr;
|
|
1988
|
+
class Xr extends fe {
|
|
2030
1989
|
constructor() {
|
|
2031
|
-
super(), te(this, "_autoStyles",
|
|
2032
|
-
const
|
|
2033
|
-
this._newTodoText =
|
|
2034
|
-
const
|
|
2035
|
-
|
|
2036
|
-
}), te(this, "handleKeyDown", (
|
|
2037
|
-
|
|
1990
|
+
super(), te(this, "_autoStyles", Fr), te(this, "todos", Tt(this, [])), te(this, "_newTodoText", ""), te(this, "filter", St(this, "all")), te(this, "nextId", 1), te(this, "handleInputChange", (e) => {
|
|
1991
|
+
const r = e.target;
|
|
1992
|
+
this._newTodoText = r.value;
|
|
1993
|
+
const b = this.querySelector(".todo-input-section .btn-primary");
|
|
1994
|
+
b && (b.disabled = !this._newTodoText.trim());
|
|
1995
|
+
}), te(this, "handleKeyDown", (e) => {
|
|
1996
|
+
e.key === "Enter" && this._newTodoText.trim() && this.addTodo();
|
|
2038
1997
|
}), te(this, "addTodo", () => {
|
|
2039
|
-
const
|
|
2040
|
-
if (
|
|
1998
|
+
const e = this.querySelector(".todo-input"), r = (e == null ? void 0 : e.value.trim()) || this._newTodoText.trim();
|
|
1999
|
+
if (r) {
|
|
2041
2000
|
if (this.todos = [...this.todos, {
|
|
2042
2001
|
id: this.nextId++,
|
|
2043
|
-
text:
|
|
2002
|
+
text: r,
|
|
2044
2003
|
completed: !1,
|
|
2045
2004
|
createdAt: Date.now()
|
|
2046
|
-
}], this._newTodoText = "",
|
|
2047
|
-
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2005
|
+
}], this._newTodoText = "", e) {
|
|
2006
|
+
e.value = "";
|
|
2007
|
+
const b = this.querySelector(".todo-input-section .btn-primary");
|
|
2008
|
+
b && (b.disabled = !0);
|
|
2050
2009
|
}
|
|
2051
|
-
|
|
2010
|
+
le.debug("Todo added", {
|
|
2052
2011
|
count: this.todos.length
|
|
2053
2012
|
});
|
|
2054
2013
|
}
|
|
2055
|
-
}), te(this, "removeTodo", (
|
|
2056
|
-
this.todos = this.todos.filter((
|
|
2057
|
-
id:
|
|
2014
|
+
}), te(this, "removeTodo", (e) => {
|
|
2015
|
+
this.todos = this.todos.filter((r) => r.id !== e), le.debug("Todo removed", {
|
|
2016
|
+
id: e,
|
|
2058
2017
|
remaining: this.todos.length
|
|
2059
2018
|
});
|
|
2060
|
-
}), te(this, "toggleTodo", (
|
|
2061
|
-
this.todos = this.todos.map((
|
|
2062
|
-
...
|
|
2063
|
-
completed: !
|
|
2064
|
-
} :
|
|
2065
|
-
id:
|
|
2019
|
+
}), te(this, "toggleTodo", (e) => {
|
|
2020
|
+
this.todos = this.todos.map((r) => r.id === e ? {
|
|
2021
|
+
...r,
|
|
2022
|
+
completed: !r.completed
|
|
2023
|
+
} : r), le.debug("Todo toggled", {
|
|
2024
|
+
id: e
|
|
2066
2025
|
});
|
|
2067
2026
|
}), te(this, "clearCompleted", () => {
|
|
2068
|
-
this.todos = this.todos.filter((
|
|
2027
|
+
this.todos = this.todos.filter((e) => !e.completed), le.debug("Completed todos cleared");
|
|
2069
2028
|
}), te(this, "clearAll", () => {
|
|
2070
|
-
this.todos = [],
|
|
2071
|
-
}),
|
|
2072
|
-
let e = this.reactive([]);
|
|
2073
|
-
Object.defineProperty(this, "todos", {
|
|
2074
|
-
get: () => e,
|
|
2075
|
-
set: (S) => {
|
|
2076
|
-
e = S !== null && typeof S < "u" && (Array.isArray(S) || typeof S == "object") ? this.reactive(S) : S, this.scheduleRerender();
|
|
2077
|
-
},
|
|
2078
|
-
enumerable: !0,
|
|
2079
|
-
configurable: !0
|
|
2080
|
-
});
|
|
2081
|
-
const [r, g] = this.useState("filter", "all");
|
|
2082
|
-
Object.defineProperty(this, "filter", {
|
|
2083
|
-
get: r,
|
|
2084
|
-
set: g,
|
|
2085
|
-
enumerable: !0,
|
|
2086
|
-
configurable: !0
|
|
2087
|
-
});
|
|
2029
|
+
this.todos = [], le.debug("All todos cleared");
|
|
2030
|
+
}), le.info("TodoListLight initialized");
|
|
2088
2031
|
}
|
|
2089
2032
|
render() {
|
|
2090
2033
|
const e = this.getFilteredTodos();
|
|
@@ -2112,127 +2055,130 @@ class Rr extends he {
|
|
|
2112
2055
|
return this.todos.filter((e) => e.completed).length;
|
|
2113
2056
|
}
|
|
2114
2057
|
onConnected() {
|
|
2115
|
-
|
|
2058
|
+
le.info("TodoListLight connected to DOM");
|
|
2116
2059
|
}
|
|
2117
2060
|
onDisconnected() {
|
|
2118
|
-
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2061
|
+
le.info("TodoListLight disconnected from DOM");
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
kt = Xr;
|
|
2065
|
+
({
|
|
2066
|
+
e: [Tt, St],
|
|
2067
|
+
c: [Gr, Ct]
|
|
2068
|
+
} = Kr(kt, [[ne, 0, "todos"], [ne, 0, "filter"]], wt, 0, void 0, fe));
|
|
2069
|
+
Ct();
|
|
2070
|
+
const qr = ".user-profile{padding:1.5rem;max-width:800px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.profile-header{margin-bottom:2rem;text-align:center}.profile-header h2{margin:0 0 .5rem;color:#333;font-size:1.75rem}.profile-header .subtitle{color:#666;font-size:.9rem;margin:0}.profile-content{display:flex;flex-direction:column;gap:2rem}.profile-section{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-section h3{margin:0 0 1rem;color:#333;font-size:1.25rem;border-bottom:2px solid #007bff;padding-bottom:.5rem}.form-group{margin-bottom:1rem}.form-group label{display:block;margin-bottom:.5rem;color:#555;font-weight:500;font-size:.9rem}.form-group input[type=checkbox]{margin-right:.5rem}.input-field{width:100%;padding:.75rem;border:1px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s;box-sizing:border-box}.input-field:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 3px #007bff1a}.profile-actions{display:flex;gap:1rem;flex-wrap:wrap}.btn{padding:.75rem 1.5rem;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all .2s;font-weight:500}.btn-primary{background:#007bff;color:#fff}.btn-primary:hover{background:#0056b3}.btn-secondary{background:#6c757d;color:#fff}.btn-secondary:hover{background:#545b62}.btn-warning{background:#ffc107;color:#212529}.btn-warning:hover{background:#e0a800}.profile-display{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-display h3{margin:0 0 1rem;color:#333;font-size:1.25rem}.json-display{background:#2d2d2d;color:#f8f8f2;padding:1rem;border-radius:4px;overflow-x:auto;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word}";
|
|
2071
|
+
var Et;
|
|
2072
|
+
let zt, Lt, Dt;
|
|
2127
2073
|
function Q(t, e, r) {
|
|
2128
|
-
return (e =
|
|
2074
|
+
return (e = $t(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
2129
2075
|
}
|
|
2130
|
-
function
|
|
2131
|
-
function
|
|
2132
|
-
return function(
|
|
2133
|
-
return u && u(
|
|
2076
|
+
function Yr(t, e, r, b, R, U) {
|
|
2077
|
+
function E(o, l, u) {
|
|
2078
|
+
return function(a, s) {
|
|
2079
|
+
return u && u(a), o[l].call(a, s);
|
|
2134
2080
|
};
|
|
2135
2081
|
}
|
|
2136
2082
|
function B(o, l) {
|
|
2137
2083
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
2138
2084
|
return l;
|
|
2139
2085
|
}
|
|
2140
|
-
function
|
|
2141
|
-
if (typeof o != "function" && (
|
|
2086
|
+
function T(o, l, u, a) {
|
|
2087
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
2142
2088
|
return o;
|
|
2143
2089
|
}
|
|
2144
|
-
function
|
|
2090
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
2145
2091
|
function v(c) {
|
|
2146
2092
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
2147
2093
|
}
|
|
2148
|
-
var d, x = l[0], k = l[3],
|
|
2149
|
-
if (!
|
|
2094
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
2095
|
+
if (!_) {
|
|
2150
2096
|
u || Array.isArray(x) || (x = [x]);
|
|
2151
|
-
var i = {}, C = [], m =
|
|
2152
|
-
y ? (
|
|
2097
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
2098
|
+
y ? (g || f ? i = { get: $e(function() {
|
|
2153
2099
|
return k(this);
|
|
2154
|
-
},
|
|
2100
|
+
}, a, "get"), set: function(c) {
|
|
2155
2101
|
l[4](this, c);
|
|
2156
|
-
} } : i[m] = k,
|
|
2102
|
+
} } : i[m] = k, g || $e(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
2157
2103
|
}
|
|
2158
2104
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
2159
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
2105
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
2160
2106
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
2161
|
-
|
|
2107
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
2162
2108
|
}).bind(null, J) };
|
|
2163
2109
|
try {
|
|
2164
|
-
if (
|
|
2110
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
2165
2111
|
else {
|
|
2166
|
-
var $,
|
|
2167
|
-
D.static =
|
|
2112
|
+
var $, O;
|
|
2113
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
2168
2114
|
return v(c), i.value;
|
|
2169
|
-
} : (
|
|
2170
|
-
return c[
|
|
2171
|
-
}, (
|
|
2172
|
-
c[
|
|
2115
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
2116
|
+
return c[a];
|
|
2117
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
2118
|
+
c[a] = w;
|
|
2173
2119
|
}));
|
|
2174
2120
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
2175
|
-
return
|
|
2121
|
+
return a in c;
|
|
2176
2122
|
} };
|
|
2177
|
-
if ($ && (W.get = $),
|
|
2178
|
-
if (typeof h == "object" && h) (d =
|
|
2123
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
2124
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
2179
2125
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2180
|
-
} else
|
|
2126
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
2181
2127
|
}
|
|
2182
2128
|
} finally {
|
|
2183
2129
|
J.v = !0;
|
|
2184
2130
|
}
|
|
2185
2131
|
}
|
|
2186
|
-
return (
|
|
2187
|
-
for (var
|
|
2132
|
+
return (g || f) && S.push(function(c, w) {
|
|
2133
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
2188
2134
|
return w;
|
|
2189
|
-
}),
|
|
2135
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
2190
2136
|
}
|
|
2191
|
-
function
|
|
2137
|
+
function M(o, l) {
|
|
2192
2138
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
2193
2139
|
}
|
|
2194
|
-
if (arguments.length >= 6) var H =
|
|
2195
|
-
var
|
|
2196
|
-
var
|
|
2197
|
-
return
|
|
2198
|
-
},
|
|
2140
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2141
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
2142
|
+
var s, z, L = [], S = function(m) {
|
|
2143
|
+
return Vr(m) === o;
|
|
2144
|
+
}, j = /* @__PURE__ */ new Map();
|
|
2199
2145
|
function y(m) {
|
|
2200
2146
|
m && L.push(B.bind(null, m));
|
|
2201
2147
|
}
|
|
2202
|
-
for (var
|
|
2203
|
-
var f = l[
|
|
2148
|
+
for (var g = 0; g < l.length; g++) {
|
|
2149
|
+
var f = l[g];
|
|
2204
2150
|
if (Array.isArray(f)) {
|
|
2205
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
2206
|
-
if (!
|
|
2207
|
-
var C =
|
|
2151
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
2152
|
+
if (!_ && !d) {
|
|
2153
|
+
var C = j.get(i);
|
|
2208
2154
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
2209
|
-
|
|
2155
|
+
j.set(i, !(p > 2) || p);
|
|
2210
2156
|
}
|
|
2211
|
-
|
|
2157
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : $t(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
2212
2158
|
}
|
|
2213
2159
|
}
|
|
2214
|
-
return y(
|
|
2215
|
-
}(t, e,
|
|
2216
|
-
return r.length ||
|
|
2160
|
+
return y(s), y(z), L;
|
|
2161
|
+
}(t, e, R, A);
|
|
2162
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
2217
2163
|
var o = [];
|
|
2218
|
-
return r.length && [
|
|
2164
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
2219
2165
|
} };
|
|
2220
2166
|
}
|
|
2221
|
-
function
|
|
2222
|
-
var e =
|
|
2167
|
+
function $t(t) {
|
|
2168
|
+
var e = Qr(t, "string");
|
|
2223
2169
|
return typeof e == "symbol" ? e : e + "";
|
|
2224
2170
|
}
|
|
2225
|
-
function
|
|
2171
|
+
function Qr(t, e) {
|
|
2226
2172
|
if (typeof t != "object" || !t) return t;
|
|
2227
2173
|
var r = t[Symbol.toPrimitive];
|
|
2228
2174
|
if (r !== void 0) {
|
|
2229
|
-
var
|
|
2230
|
-
if (typeof
|
|
2175
|
+
var b = r.call(t, e);
|
|
2176
|
+
if (typeof b != "object") return b;
|
|
2231
2177
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2232
2178
|
}
|
|
2233
2179
|
return String(t);
|
|
2234
2180
|
}
|
|
2235
|
-
function
|
|
2181
|
+
function $e(t, e, r) {
|
|
2236
2182
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
2237
2183
|
try {
|
|
2238
2184
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -2240,20 +2186,30 @@ function je(t, e, r) {
|
|
|
2240
2186
|
}
|
|
2241
2187
|
return t;
|
|
2242
2188
|
}
|
|
2243
|
-
function
|
|
2189
|
+
function Vr(t) {
|
|
2244
2190
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
2245
2191
|
return t;
|
|
2246
2192
|
}
|
|
2247
|
-
const oe =
|
|
2248
|
-
|
|
2193
|
+
const oe = ae("UserProfile");
|
|
2194
|
+
Lt = [re({
|
|
2249
2195
|
tagName: "user-profile"
|
|
2250
2196
|
})];
|
|
2251
|
-
let
|
|
2252
|
-
class
|
|
2197
|
+
let Zr;
|
|
2198
|
+
class eo extends X {
|
|
2253
2199
|
constructor() {
|
|
2254
|
-
super(), Q(this, "_autoStyles",
|
|
2255
|
-
|
|
2256
|
-
|
|
2200
|
+
super(), Q(this, "_autoStyles", qr), Q(this, "profile", Dt(this, {
|
|
2201
|
+
name: "John Doe",
|
|
2202
|
+
email: "john@example.com",
|
|
2203
|
+
age: 30,
|
|
2204
|
+
preferences: {
|
|
2205
|
+
theme: "light",
|
|
2206
|
+
language: "en",
|
|
2207
|
+
notifications: !0
|
|
2208
|
+
},
|
|
2209
|
+
lastLogin: Date.now()
|
|
2210
|
+
})), Q(this, "handleNameChange", (e) => {
|
|
2211
|
+
const r = e.target;
|
|
2212
|
+
this.profile.name = r.value;
|
|
2257
2213
|
}), Q(this, "handleNameBlur", () => {
|
|
2258
2214
|
this.profile = {
|
|
2259
2215
|
...this.profile,
|
|
@@ -2261,9 +2217,9 @@ class Fr extends X {
|
|
|
2261
2217
|
}, oe.debug("Name updated", {
|
|
2262
2218
|
name: this.profile.name
|
|
2263
2219
|
});
|
|
2264
|
-
}), Q(this, "handleEmailChange", (
|
|
2265
|
-
const
|
|
2266
|
-
this.profile.email =
|
|
2220
|
+
}), Q(this, "handleEmailChange", (e) => {
|
|
2221
|
+
const r = e.target;
|
|
2222
|
+
this.profile.email = r.value;
|
|
2267
2223
|
}), Q(this, "handleEmailBlur", () => {
|
|
2268
2224
|
this.profile = {
|
|
2269
2225
|
...this.profile,
|
|
@@ -2271,9 +2227,9 @@ class Fr extends X {
|
|
|
2271
2227
|
}, oe.debug("Email updated", {
|
|
2272
2228
|
email: this.profile.email
|
|
2273
2229
|
});
|
|
2274
|
-
}), Q(this, "handleAgeChange", (
|
|
2275
|
-
const
|
|
2276
|
-
this.profile.age = parseInt(
|
|
2230
|
+
}), Q(this, "handleAgeChange", (e) => {
|
|
2231
|
+
const r = e.target;
|
|
2232
|
+
this.profile.age = parseInt(r.value, 10) || 0;
|
|
2277
2233
|
}), Q(this, "handleAgeBlur", () => {
|
|
2278
2234
|
this.profile = {
|
|
2279
2235
|
...this.profile,
|
|
@@ -2281,20 +2237,20 @@ class Fr extends X {
|
|
|
2281
2237
|
}, oe.debug("Age updated", {
|
|
2282
2238
|
age: this.profile.age
|
|
2283
2239
|
});
|
|
2284
|
-
}), Q(this, "handleThemeChange", (
|
|
2285
|
-
const
|
|
2286
|
-
this.profile.preferences.theme =
|
|
2287
|
-
theme:
|
|
2240
|
+
}), Q(this, "handleThemeChange", (e) => {
|
|
2241
|
+
const r = e.target;
|
|
2242
|
+
this.profile.preferences.theme = r.value, oe.debug("Theme updated", {
|
|
2243
|
+
theme: r.value
|
|
2288
2244
|
});
|
|
2289
|
-
}), Q(this, "handleLanguageChange", (
|
|
2290
|
-
const
|
|
2291
|
-
this.profile.preferences.language =
|
|
2292
|
-
language:
|
|
2245
|
+
}), Q(this, "handleLanguageChange", (e) => {
|
|
2246
|
+
const r = e.target;
|
|
2247
|
+
this.profile.preferences.language = r.value, oe.debug("Language updated", {
|
|
2248
|
+
language: r.value
|
|
2293
2249
|
});
|
|
2294
|
-
}), Q(this, "handleNotificationsChange", (
|
|
2295
|
-
const
|
|
2296
|
-
this.profile.preferences.notifications =
|
|
2297
|
-
notifications:
|
|
2250
|
+
}), Q(this, "handleNotificationsChange", (e) => {
|
|
2251
|
+
const r = e.target;
|
|
2252
|
+
this.profile.preferences.notifications = r.checked, oe.debug("Notifications updated", {
|
|
2253
|
+
notifications: r.checked
|
|
2298
2254
|
});
|
|
2299
2255
|
}), Q(this, "resetProfile", () => {
|
|
2300
2256
|
this.profile = {
|
|
@@ -2328,145 +2284,129 @@ class Fr extends X {
|
|
|
2328
2284
|
lastLogin: Date.now()
|
|
2329
2285
|
}, oe.debug("Entire profile replaced");
|
|
2330
2286
|
}), oe.info("UserProfile initialized");
|
|
2331
|
-
let e = this.reactive({
|
|
2332
|
-
name: "John Doe",
|
|
2333
|
-
email: "john@example.com",
|
|
2334
|
-
age: 30,
|
|
2335
|
-
preferences: {
|
|
2336
|
-
theme: "light",
|
|
2337
|
-
language: "en",
|
|
2338
|
-
notifications: !0
|
|
2339
|
-
},
|
|
2340
|
-
lastLogin: Date.now()
|
|
2341
|
-
});
|
|
2342
|
-
Object.defineProperty(this, "profile", {
|
|
2343
|
-
get: () => e,
|
|
2344
|
-
set: (r) => {
|
|
2345
|
-
e = r !== null && typeof r < "u" && (Array.isArray(r) || typeof r == "object") ? this.reactive(r) : r, this.scheduleRerender();
|
|
2346
|
-
},
|
|
2347
|
-
enumerable: !0,
|
|
2348
|
-
configurable: !0
|
|
2349
|
-
});
|
|
2350
2287
|
}
|
|
2351
2288
|
render() {
|
|
2352
2289
|
return /* @__PURE__ */ n("div", { class: "user-profile" }, /* @__PURE__ */ n("div", { class: "profile-header" }, /* @__PURE__ */ n("h2", null, "👤 User Profile (WebComponent)"), /* @__PURE__ */ n("p", { class: "subtitle" }, "Demonstrates @state decorator with objects")), /* @__PURE__ */ n("div", { class: "profile-content" }, /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Basic Information"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Name:"), /* @__PURE__ */ n("input", { type: "text", value: this.profile.name, onInput: this.handleNameChange, onBlur: this.handleNameBlur, class: "input-field", "data-wsx-key": "UserProfile-input-text-3-1-3-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Email:"), /* @__PURE__ */ n("input", { type: "email", value: this.profile.email, onInput: this.handleEmailChange, onBlur: this.handleEmailBlur, class: "input-field", "data-wsx-key": "UserProfile-input-email-3-1-5-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Age:"), /* @__PURE__ */ n("input", { type: "number", value: this.profile.age.toString(), onInput: this.handleAgeChange, onBlur: this.handleAgeBlur, class: "input-field", "data-wsx-key": "UserProfile-input-number-3-1-7-3" }))), /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Preferences"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Theme:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.theme, onChange: this.handleThemeChange, class: "input-field", "data-wsx-key": "UserProfile-select-text-3-3-3-3" }, /* @__PURE__ */ n("option", { value: "light" }, "Light"), /* @__PURE__ */ n("option", { value: "dark" }, "Dark"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Language:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.language, onChange: this.handleLanguageChange, class: "input-field", "data-wsx-key": "UserProfile-select-text-3-3-5-3" }, /* @__PURE__ */ n("option", { value: "en" }, "English"), /* @__PURE__ */ n("option", { value: "zh" }, "中文"), /* @__PURE__ */ n("option", { value: "es" }, "Español"), /* @__PURE__ */ n("option", { value: "fr" }, "Français"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, /* @__PURE__ */ n("input", { type: "checkbox", checked: this.profile.preferences.notifications, onChange: this.handleNotificationsChange, "data-wsx-key": "UserProfile-input-checkbox-3-3-7-1-1" }), "Enable Notifications"))), /* @__PURE__ */ n("div", { class: "profile-actions" }, /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.resetProfile, "data-wsx-key": "UserProfile-button-text-3-5-1" }, "Reset to Default"), /* @__PURE__ */ n("button", { class: "btn btn-secondary", onClick: this.updateLastLogin, "data-wsx-key": "UserProfile-button-text-3-5-3" }, "Update Last Login"), /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.replaceEntireProfile, "data-wsx-key": "UserProfile-button-text-3-5-5" }, "Replace Entire Profile")), /* @__PURE__ */ n("div", { class: "profile-display" }, /* @__PURE__ */ n("h3", null, "Current Profile Data"), /* @__PURE__ */ n("pre", { class: "json-display" }, JSON.stringify(this.profile, null, 2)))));
|
|
2353
2290
|
}
|
|
2354
2291
|
}
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2292
|
+
Et = eo;
|
|
2293
|
+
({
|
|
2294
|
+
e: [Dt],
|
|
2295
|
+
c: [Zr, zt]
|
|
2296
|
+
} = Yr(Et, [[ne, 0, "profile"]], Lt, 0, void 0, X));
|
|
2297
|
+
zt();
|
|
2298
|
+
const to = ".user-profile{padding:1.5rem;max-width:800px;margin:0 auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.profile-header{margin-bottom:2rem;text-align:center}.profile-header h2{margin:0 0 .5rem;color:#333;font-size:1.75rem}.profile-header .subtitle{color:#666;font-size:.9rem;margin:0}.profile-content{display:flex;flex-direction:column;gap:2rem}.profile-section{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-section h3{margin:0 0 1rem;color:#333;font-size:1.25rem;border-bottom:2px solid #007bff;padding-bottom:.5rem}.form-group{margin-bottom:1rem}.form-group label{display:block;margin-bottom:.5rem;color:#555;font-weight:500;font-size:.9rem}.form-group input[type=checkbox]{margin-right:.5rem}.input-field{width:100%;padding:.75rem;border:1px solid #ddd;border-radius:4px;font-size:1rem;transition:border-color .2s;box-sizing:border-box}.input-field:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 3px #007bff1a}.profile-actions{display:flex;gap:1rem;flex-wrap:wrap}.btn{padding:.75rem 1.5rem;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all .2s;font-weight:500}.btn-primary{background:#007bff;color:#fff}.btn-primary:hover{background:#0056b3}.btn-secondary{background:#6c757d;color:#fff}.btn-secondary:hover{background:#545b62}.btn-warning{background:#ffc107;color:#212529}.btn-warning:hover{background:#e0a800}.profile-display{background:#f8f9fa;padding:1.5rem;border-radius:8px;border:1px solid #e0e0e0}.profile-display h3{margin:0 0 1rem;color:#333;font-size:1.25rem}.json-display{background:#2d2d2d;color:#f8f8f2;padding:1rem;border-radius:4px;overflow-x:auto;font-family:Courier New,monospace;font-size:.875rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word}";
|
|
2299
|
+
var At;
|
|
2300
|
+
let jt, It, Ot;
|
|
2301
|
+
function V(t, e, r) {
|
|
2302
|
+
return (e = Pt(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
2363
2303
|
}
|
|
2364
|
-
function
|
|
2365
|
-
function
|
|
2366
|
-
return function(
|
|
2367
|
-
return u && u(
|
|
2304
|
+
function ro(t, e, r, b, R, U) {
|
|
2305
|
+
function E(o, l, u) {
|
|
2306
|
+
return function(a, s) {
|
|
2307
|
+
return u && u(a), o[l].call(a, s);
|
|
2368
2308
|
};
|
|
2369
2309
|
}
|
|
2370
2310
|
function B(o, l) {
|
|
2371
2311
|
for (var u = 0; u < o.length; u++) o[u].call(l);
|
|
2372
2312
|
return l;
|
|
2373
2313
|
}
|
|
2374
|
-
function
|
|
2375
|
-
if (typeof o != "function" && (
|
|
2314
|
+
function T(o, l, u, a) {
|
|
2315
|
+
if (typeof o != "function" && (a || o !== void 0)) throw new TypeError(l + " must " + (u || "be") + " a function" + (a ? "" : " or undefined"));
|
|
2376
2316
|
return o;
|
|
2377
2317
|
}
|
|
2378
|
-
function
|
|
2318
|
+
function N(o, l, u, a, s, z, L, S, j, y, g, f, p) {
|
|
2379
2319
|
function v(c) {
|
|
2380
2320
|
if (!p(c)) throw new TypeError("Attempted to access private element on non-instance");
|
|
2381
2321
|
}
|
|
2382
|
-
var d, x = l[0], k = l[3],
|
|
2383
|
-
if (!
|
|
2322
|
+
var d, x = l[0], k = l[3], _ = !S;
|
|
2323
|
+
if (!_) {
|
|
2384
2324
|
u || Array.isArray(x) || (x = [x]);
|
|
2385
|
-
var i = {}, C = [], m =
|
|
2386
|
-
y ? (
|
|
2325
|
+
var i = {}, C = [], m = s === 3 ? "get" : s === 4 || f ? "set" : "value";
|
|
2326
|
+
y ? (g || f ? i = { get: Ae(function() {
|
|
2387
2327
|
return k(this);
|
|
2388
|
-
},
|
|
2328
|
+
}, a, "get"), set: function(c) {
|
|
2389
2329
|
l[4](this, c);
|
|
2390
|
-
} } : i[m] = k,
|
|
2330
|
+
} } : i[m] = k, g || Ae(i[m], a, s === 2 ? "" : m)) : g || (i = Object.getOwnPropertyDescriptor(o, a));
|
|
2391
2331
|
}
|
|
2392
2332
|
for (var h = o, I = x.length - 1; I >= 0; I -= u ? 2 : 1) {
|
|
2393
|
-
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][
|
|
2333
|
+
var F = x[I], K = u ? x[I - 1] : void 0, J = {}, D = { kind: ["field", "accessor", "method", "getter", "setter", "class"][s], name: a, metadata: z, addInitializer: (function(c, w) {
|
|
2394
2334
|
if (c.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
2395
|
-
|
|
2335
|
+
T(w, "An initializer", "be", !0), L.push(w);
|
|
2396
2336
|
}).bind(null, J) };
|
|
2397
2337
|
try {
|
|
2398
|
-
if (
|
|
2338
|
+
if (_) (d = T(F.call(K, h, D), "class decorators", "return")) && (h = d);
|
|
2399
2339
|
else {
|
|
2400
|
-
var $,
|
|
2401
|
-
D.static =
|
|
2340
|
+
var $, O;
|
|
2341
|
+
D.static = j, D.private = y, y ? s === 2 ? $ = function(c) {
|
|
2402
2342
|
return v(c), i.value;
|
|
2403
|
-
} : (
|
|
2404
|
-
return c[
|
|
2405
|
-
}, (
|
|
2406
|
-
c[
|
|
2343
|
+
} : (s < 4 && ($ = E(i, "get", v)), s !== 3 && (O = E(i, "set", v))) : ($ = function(c) {
|
|
2344
|
+
return c[a];
|
|
2345
|
+
}, (s < 2 || s === 4) && (O = function(c, w) {
|
|
2346
|
+
c[a] = w;
|
|
2407
2347
|
}));
|
|
2408
2348
|
var W = D.access = { has: y ? p.bind() : function(c) {
|
|
2409
|
-
return
|
|
2349
|
+
return a in c;
|
|
2410
2350
|
} };
|
|
2411
|
-
if ($ && (W.get = $),
|
|
2412
|
-
if (typeof h == "object" && h) (d =
|
|
2351
|
+
if ($ && (W.get = $), O && (W.set = O), h = F.call(K, f ? { get: i.get, set: i.set } : i[m], D), f) {
|
|
2352
|
+
if (typeof h == "object" && h) (d = T(h.get, "accessor.get")) && (i.get = d), (d = T(h.set, "accessor.set")) && (i.set = d), (d = T(h.init, "accessor.init")) && C.push(d);
|
|
2413
2353
|
else if (h !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
2414
|
-
} else
|
|
2354
|
+
} else T(h, (g ? "field" : "method") + " decorators", "return") && (g ? C.push(h) : i[m] = h);
|
|
2415
2355
|
}
|
|
2416
2356
|
} finally {
|
|
2417
2357
|
J.v = !0;
|
|
2418
2358
|
}
|
|
2419
2359
|
}
|
|
2420
|
-
return (
|
|
2421
|
-
for (var
|
|
2360
|
+
return (g || f) && S.push(function(c, w) {
|
|
2361
|
+
for (var P = C.length - 1; P >= 0; P--) w = C[P].call(c, w);
|
|
2422
2362
|
return w;
|
|
2423
|
-
}),
|
|
2363
|
+
}), g || _ || (y ? f ? S.push(E(i, "get"), E(i, "set")) : S.push(s === 2 ? i[m] : E.call.bind(i[m])) : Object.defineProperty(o, a, i)), h;
|
|
2424
2364
|
}
|
|
2425
|
-
function
|
|
2365
|
+
function M(o, l) {
|
|
2426
2366
|
return Object.defineProperty(o, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: l });
|
|
2427
2367
|
}
|
|
2428
|
-
if (arguments.length >= 6) var H =
|
|
2429
|
-
var
|
|
2430
|
-
var
|
|
2431
|
-
return
|
|
2432
|
-
},
|
|
2368
|
+
if (arguments.length >= 6) var H = U[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
2369
|
+
var A = Object.create(H ?? null), G = function(o, l, u, a) {
|
|
2370
|
+
var s, z, L = [], S = function(m) {
|
|
2371
|
+
return io(m) === o;
|
|
2372
|
+
}, j = /* @__PURE__ */ new Map();
|
|
2433
2373
|
function y(m) {
|
|
2434
2374
|
m && L.push(B.bind(null, m));
|
|
2435
2375
|
}
|
|
2436
|
-
for (var
|
|
2437
|
-
var f = l[
|
|
2376
|
+
for (var g = 0; g < l.length; g++) {
|
|
2377
|
+
var f = l[g];
|
|
2438
2378
|
if (Array.isArray(f)) {
|
|
2439
|
-
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p),
|
|
2440
|
-
if (!
|
|
2441
|
-
var C =
|
|
2379
|
+
var p = f[1], v = f[2], d = f.length > 3, x = 16 & p, k = !!(8 & p), _ = (p &= 7) == 0, i = v + "/" + k;
|
|
2380
|
+
if (!_ && !d) {
|
|
2381
|
+
var C = j.get(i);
|
|
2442
2382
|
if (C === !0 || C === 3 && p !== 4 || C === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
|
|
2443
|
-
|
|
2383
|
+
j.set(i, !(p > 2) || p);
|
|
2444
2384
|
}
|
|
2445
|
-
|
|
2385
|
+
N(k ? o : o.prototype, f, x, d ? "#" + v : Pt(v), p, a, k ? z = z || [] : s = s || [], L, k, d, _, p === 1, k && d ? S : u);
|
|
2446
2386
|
}
|
|
2447
2387
|
}
|
|
2448
|
-
return y(
|
|
2449
|
-
}(t, e,
|
|
2450
|
-
return r.length ||
|
|
2388
|
+
return y(s), y(z), L;
|
|
2389
|
+
}(t, e, R, A);
|
|
2390
|
+
return r.length || M(t, A), { e: G, get c() {
|
|
2451
2391
|
var o = [];
|
|
2452
|
-
return r.length && [
|
|
2392
|
+
return r.length && [M(N(t, [r], b, t.name, 5, A, o), A), B.bind(null, o, t)];
|
|
2453
2393
|
} };
|
|
2454
2394
|
}
|
|
2455
|
-
function
|
|
2456
|
-
var e =
|
|
2395
|
+
function Pt(t) {
|
|
2396
|
+
var e = oo(t, "string");
|
|
2457
2397
|
return typeof e == "symbol" ? e : e + "";
|
|
2458
2398
|
}
|
|
2459
|
-
function
|
|
2399
|
+
function oo(t, e) {
|
|
2460
2400
|
if (typeof t != "object" || !t) return t;
|
|
2461
2401
|
var r = t[Symbol.toPrimitive];
|
|
2462
2402
|
if (r !== void 0) {
|
|
2463
|
-
var
|
|
2464
|
-
if (typeof
|
|
2403
|
+
var b = r.call(t, e);
|
|
2404
|
+
if (typeof b != "object") return b;
|
|
2465
2405
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2466
2406
|
}
|
|
2467
2407
|
return String(t);
|
|
2468
2408
|
}
|
|
2469
|
-
function
|
|
2409
|
+
function Ae(t, e, r) {
|
|
2470
2410
|
typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
|
|
2471
2411
|
try {
|
|
2472
2412
|
Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
|
|
@@ -2474,63 +2414,73 @@ function Le(t, e, r) {
|
|
|
2474
2414
|
}
|
|
2475
2415
|
return t;
|
|
2476
2416
|
}
|
|
2477
|
-
function
|
|
2417
|
+
function io(t) {
|
|
2478
2418
|
if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
|
|
2479
2419
|
return t;
|
|
2480
2420
|
}
|
|
2481
|
-
const ie =
|
|
2482
|
-
|
|
2421
|
+
const ie = ae("UserProfileLight");
|
|
2422
|
+
It = [re({
|
|
2483
2423
|
tagName: "user-profile-light"
|
|
2484
2424
|
})];
|
|
2485
|
-
let
|
|
2486
|
-
class
|
|
2425
|
+
let no;
|
|
2426
|
+
class ao extends fe {
|
|
2487
2427
|
constructor() {
|
|
2488
|
-
super(),
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2428
|
+
super(), V(this, "_autoStyles", to), V(this, "profile", Ot(this, {
|
|
2429
|
+
name: "John Doe",
|
|
2430
|
+
email: "john@example.com",
|
|
2431
|
+
age: 30,
|
|
2432
|
+
preferences: {
|
|
2433
|
+
theme: "light",
|
|
2434
|
+
language: "en",
|
|
2435
|
+
notifications: !0
|
|
2436
|
+
},
|
|
2437
|
+
lastLogin: Date.now()
|
|
2438
|
+
})), V(this, "handleNameChange", (e) => {
|
|
2439
|
+
const r = e.target;
|
|
2440
|
+
this.profile.name = r.value;
|
|
2441
|
+
}), V(this, "handleNameBlur", () => {
|
|
2492
2442
|
this.profile = {
|
|
2493
2443
|
...this.profile,
|
|
2494
2444
|
name: this.profile.name
|
|
2495
2445
|
}, ie.debug("Name updated", {
|
|
2496
2446
|
name: this.profile.name
|
|
2497
2447
|
});
|
|
2498
|
-
}),
|
|
2499
|
-
const
|
|
2500
|
-
this.profile.email =
|
|
2501
|
-
}),
|
|
2448
|
+
}), V(this, "handleEmailChange", (e) => {
|
|
2449
|
+
const r = e.target;
|
|
2450
|
+
this.profile.email = r.value;
|
|
2451
|
+
}), V(this, "handleEmailBlur", () => {
|
|
2502
2452
|
this.profile = {
|
|
2503
2453
|
...this.profile,
|
|
2504
2454
|
email: this.profile.email
|
|
2505
2455
|
}, ie.debug("Email updated", {
|
|
2506
2456
|
email: this.profile.email
|
|
2507
2457
|
});
|
|
2508
|
-
}),
|
|
2509
|
-
const
|
|
2510
|
-
this.profile.age = parseInt(
|
|
2511
|
-
}),
|
|
2458
|
+
}), V(this, "handleAgeChange", (e) => {
|
|
2459
|
+
const r = e.target;
|
|
2460
|
+
this.profile.age = parseInt(r.value, 10) || 0;
|
|
2461
|
+
}), V(this, "handleAgeBlur", () => {
|
|
2512
2462
|
this.profile = {
|
|
2513
2463
|
...this.profile,
|
|
2514
2464
|
age: this.profile.age
|
|
2515
2465
|
}, ie.debug("Age updated", {
|
|
2516
2466
|
age: this.profile.age
|
|
2517
2467
|
});
|
|
2518
|
-
}),
|
|
2519
|
-
const
|
|
2520
|
-
this.profile.preferences.theme =
|
|
2521
|
-
theme:
|
|
2468
|
+
}), V(this, "handleThemeChange", (e) => {
|
|
2469
|
+
const r = e.target;
|
|
2470
|
+
this.profile.preferences.theme = r.value, ie.debug("Theme updated", {
|
|
2471
|
+
theme: r.value
|
|
2522
2472
|
});
|
|
2523
|
-
}),
|
|
2524
|
-
const
|
|
2525
|
-
this.profile.preferences.language =
|
|
2526
|
-
language:
|
|
2473
|
+
}), V(this, "handleLanguageChange", (e) => {
|
|
2474
|
+
const r = e.target;
|
|
2475
|
+
this.profile.preferences.language = r.value, ie.debug("Language updated", {
|
|
2476
|
+
language: r.value
|
|
2527
2477
|
});
|
|
2528
|
-
}),
|
|
2529
|
-
const
|
|
2530
|
-
this.profile.preferences.notifications =
|
|
2531
|
-
notifications:
|
|
2478
|
+
}), V(this, "handleNotificationsChange", (e) => {
|
|
2479
|
+
const r = e.target;
|
|
2480
|
+
this.profile.preferences.notifications = r.checked, ie.debug("Notifications updated", {
|
|
2481
|
+
notifications: r.checked
|
|
2532
2482
|
});
|
|
2533
|
-
}),
|
|
2483
|
+
}), V(this, "resetProfile", () => {
|
|
2534
2484
|
this.profile = {
|
|
2535
2485
|
name: "John Doe",
|
|
2536
2486
|
email: "john@example.com",
|
|
@@ -2542,14 +2492,14 @@ class qr extends he {
|
|
|
2542
2492
|
},
|
|
2543
2493
|
lastLogin: Date.now()
|
|
2544
2494
|
}, this._name = "John Doe", this._email = "john@example.com", this._age = 30, ie.debug("Profile reset to default");
|
|
2545
|
-
}),
|
|
2495
|
+
}), V(this, "updateLastLogin", () => {
|
|
2546
2496
|
this.profile = {
|
|
2547
2497
|
...this.profile,
|
|
2548
2498
|
lastLogin: Date.now()
|
|
2549
2499
|
}, ie.debug("Last login updated", {
|
|
2550
2500
|
lastLogin: this.profile.lastLogin
|
|
2551
2501
|
});
|
|
2552
|
-
}),
|
|
2502
|
+
}), V(this, "replaceEntireProfile", () => {
|
|
2553
2503
|
this.profile = {
|
|
2554
2504
|
name: "Jane Smith",
|
|
2555
2505
|
email: "jane@example.com",
|
|
@@ -2562,52 +2512,36 @@ class qr extends he {
|
|
|
2562
2512
|
lastLogin: Date.now()
|
|
2563
2513
|
}, this._name = "Jane Smith", this._email = "jane@example.com", this._age = 25, ie.debug("Entire profile replaced");
|
|
2564
2514
|
}), ie.info("UserProfileLight initialized");
|
|
2565
|
-
let e = this.reactive({
|
|
2566
|
-
name: "John Doe",
|
|
2567
|
-
email: "john@example.com",
|
|
2568
|
-
age: 30,
|
|
2569
|
-
preferences: {
|
|
2570
|
-
theme: "light",
|
|
2571
|
-
language: "en",
|
|
2572
|
-
notifications: !0
|
|
2573
|
-
},
|
|
2574
|
-
lastLogin: Date.now()
|
|
2575
|
-
});
|
|
2576
|
-
Object.defineProperty(this, "profile", {
|
|
2577
|
-
get: () => e,
|
|
2578
|
-
set: (r) => {
|
|
2579
|
-
e = r !== null && typeof r < "u" && (Array.isArray(r) || typeof r == "object") ? this.reactive(r) : r, this.scheduleRerender();
|
|
2580
|
-
},
|
|
2581
|
-
enumerable: !0,
|
|
2582
|
-
configurable: !0
|
|
2583
|
-
});
|
|
2584
2515
|
}
|
|
2585
2516
|
render() {
|
|
2586
2517
|
return /* @__PURE__ */ n("div", { class: "user-profile" }, /* @__PURE__ */ n("div", { class: "profile-header" }, /* @__PURE__ */ n("h2", null, "👤 User Profile (LightComponent)"), /* @__PURE__ */ n("p", { class: "subtitle" }, "Demonstrates @state decorator with objects")), /* @__PURE__ */ n("div", { class: "profile-content" }, /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Basic Information"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Name:"), /* @__PURE__ */ n("input", { type: "text", value: this.profile.name, onInput: this.handleNameChange, onBlur: this.handleNameBlur, class: "input-field", "data-wsx-key": "UserProfileLight-input-text-3-1-3-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Email:"), /* @__PURE__ */ n("input", { type: "email", value: this.profile.email, onInput: this.handleEmailChange, onBlur: this.handleEmailBlur, class: "input-field", "data-wsx-key": "UserProfileLight-input-email-3-1-5-3" })), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Age:"), /* @__PURE__ */ n("input", { type: "number", value: this.profile.age.toString(), onInput: this.handleAgeChange, onBlur: this.handleAgeBlur, class: "input-field", "data-wsx-key": "UserProfileLight-input-number-3-1-7-3" }))), /* @__PURE__ */ n("div", { class: "profile-section" }, /* @__PURE__ */ n("h3", null, "Preferences"), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Theme:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.theme, onChange: this.handleThemeChange, class: "input-field", "data-wsx-key": "UserProfileLight-select-text-3-3-3-3" }, /* @__PURE__ */ n("option", { value: "light" }, "Light"), /* @__PURE__ */ n("option", { value: "dark" }, "Dark"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, "Language:"), /* @__PURE__ */ n("select", { value: this.profile.preferences.language, onChange: this.handleLanguageChange, class: "input-field", "data-wsx-key": "UserProfileLight-select-text-3-3-5-3" }, /* @__PURE__ */ n("option", { value: "en" }, "English"), /* @__PURE__ */ n("option", { value: "zh" }, "中文"), /* @__PURE__ */ n("option", { value: "es" }, "Español"), /* @__PURE__ */ n("option", { value: "fr" }, "Français"))), /* @__PURE__ */ n("div", { class: "form-group" }, /* @__PURE__ */ n("label", null, /* @__PURE__ */ n("input", { type: "checkbox", checked: this.profile.preferences.notifications, onChange: this.handleNotificationsChange, "data-wsx-key": "UserProfileLight-input-checkbox-3-3-7-1-1" }), "Enable Notifications"))), /* @__PURE__ */ n("div", { class: "profile-actions" }, /* @__PURE__ */ n("button", { class: "btn btn-primary", onClick: this.resetProfile, "data-wsx-key": "UserProfileLight-button-text-3-5-1" }, "Reset to Default"), /* @__PURE__ */ n("button", { class: "btn btn-secondary", onClick: this.updateLastLogin, "data-wsx-key": "UserProfileLight-button-text-3-5-3" }, "Update Last Login"), /* @__PURE__ */ n("button", { class: "btn btn-warning", onClick: this.replaceEntireProfile, "data-wsx-key": "UserProfileLight-button-text-3-5-5" }, "Replace Entire Profile")), /* @__PURE__ */ n("div", { class: "profile-display" }, /* @__PURE__ */ n("h3", null, "Current Profile Data"), /* @__PURE__ */ n("pre", { class: "json-display" }, JSON.stringify(this.profile, null, 2)))));
|
|
2587
2518
|
}
|
|
2588
2519
|
}
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2520
|
+
At = ao;
|
|
2521
|
+
({
|
|
2522
|
+
e: [Ot],
|
|
2523
|
+
c: [no, jt]
|
|
2524
|
+
} = ro(At, [[ne, 0, "profile"]], It, 0, void 0, fe));
|
|
2525
|
+
jt();
|
|
2592
2526
|
export {
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2527
|
+
co as CONVERTER_BTN,
|
|
2528
|
+
uo as CONVERTER_PANEL,
|
|
2529
|
+
sr as ColorPicker,
|
|
2530
|
+
fr as ReactiveCounter,
|
|
2531
|
+
Or as SimpleReactiveDemo,
|
|
2532
|
+
Lr as SvgDemo,
|
|
2533
|
+
Tr as SvgIcon,
|
|
2534
|
+
vr as ThemeSwitcher,
|
|
2535
|
+
Ur as TodoList,
|
|
2536
|
+
Gr as TodoListLight,
|
|
2537
|
+
Zr as UserProfile,
|
|
2538
|
+
no as UserProfileLight,
|
|
2539
|
+
Ut as XyButton,
|
|
2540
|
+
Gt as XyButtonGroup,
|
|
2541
|
+
er as getCustomColorCache,
|
|
2542
|
+
lo as getDefaultColorCache,
|
|
2543
|
+
de as handleCSSVariables,
|
|
2544
|
+
Zt as setCustomColorCache,
|
|
2545
|
+
Vt as setDefaultColorCache,
|
|
2546
|
+
tr as throttle
|
|
2613
2547
|
};
|