uilint-react 0.2.51 → 0.2.52

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.js CHANGED
@@ -1,338 +1,338 @@
1
- import O, { useState as C, useRef as K, useCallback as I, useEffect as A, useMemo as W } from "react";
2
- import { createPortal as U } from "react-dom";
3
- import { i as an, a as un, b as dn, s as fn } from "./environment-DVxa60C6.js";
4
- import { createEmptyStyleGuide as hn, createStyleSummary as gn, extractStylesFromDOM as mn, generateStyleGuideFromStyles as bn, mergeStyleGuides as xn, parseStyleGuide as vn, serializeStyles as yn } from "uilint-core";
5
- var Y = { exports: {} }, M = {};
6
- var pe;
7
- function Fe() {
8
- if (pe) return M;
9
- pe = 1;
10
- var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
11
- function n(o, r, s) {
12
- var c = null;
13
- if (s !== void 0 && (c = "" + s), r.key !== void 0 && (c = "" + r.key), "key" in r) {
14
- s = {};
15
- for (var a in r)
16
- a !== "key" && (s[a] = r[a]);
17
- } else s = r;
18
- return r = s.ref, {
19
- $$typeof: e,
1
+ import D, { forwardRef as Ie, createElement as oe, useState as T, useRef as J, useCallback as E, useEffect as z, useMemo as _ } from "react";
2
+ import { createPortal as Y } from "react-dom";
3
+ import { i as Fn, a as Mn, b as Bn, s as Wn } from "./environment-DVxa60C6.js";
4
+ import { createEmptyStyleGuide as Hn, createStyleSummary as Yn, extractStylesFromDOM as qn, generateStyleGuideFromStyles as Gn, mergeStyleGuides as Kn, parseStyleGuide as Vn, serializeStyles as Jn } from "uilint-core";
5
+ var G = { exports: {} }, M = {};
6
+ var he;
7
+ function He() {
8
+ if (he) return M;
9
+ he = 1;
10
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
11
+ function n(o, r, i) {
12
+ var l = null;
13
+ if (i !== void 0 && (l = "" + i), r.key !== void 0 && (l = "" + r.key), "key" in r) {
14
+ i = {};
15
+ for (var c in r)
16
+ c !== "key" && (i[c] = r[c]);
17
+ } else i = r;
18
+ return r = i.ref, {
19
+ $$typeof: t,
20
20
  type: o,
21
- key: c,
21
+ key: l,
22
22
  ref: r !== void 0 ? r : null,
23
- props: s
23
+ props: i
24
24
  };
25
25
  }
26
- return M.Fragment = t, M.jsx = n, M.jsxs = n, M;
27
- }
28
- var F = {};
29
- var he;
30
- function Be() {
31
- return he || (he = 1, process.env.NODE_ENV !== "production" && (function() {
32
- function e(l) {
33
- if (l == null) return null;
34
- if (typeof l == "function")
35
- return l.$$typeof === Oe ? null : l.displayName || l.name || null;
36
- if (typeof l == "string") return l;
37
- switch (l) {
38
- case b:
26
+ return M.Fragment = e, M.jsx = n, M.jsxs = n, M;
27
+ }
28
+ var B = {};
29
+ var me;
30
+ function Ye() {
31
+ return me || (me = 1, process.env.NODE_ENV !== "production" && (function() {
32
+ function t(a) {
33
+ if (a == null) return null;
34
+ if (typeof a == "function")
35
+ return a.$$typeof === Be ? null : a.displayName || a.name || null;
36
+ if (typeof a == "string") return a;
37
+ switch (a) {
38
+ case y:
39
39
  return "Fragment";
40
- case N:
40
+ case p:
41
41
  return "Profiler";
42
- case S:
42
+ case I:
43
43
  return "StrictMode";
44
- case Ae:
44
+ case $e:
45
45
  return "Suspense";
46
- case _e:
46
+ case De:
47
47
  return "SuspenseList";
48
- case Le:
48
+ case Me:
49
49
  return "Activity";
50
50
  }
51
- if (typeof l == "object")
52
- switch (typeof l.tag == "number" && console.error(
51
+ if (typeof a == "object")
52
+ switch (typeof a.tag == "number" && console.error(
53
53
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
54
- ), l.$$typeof) {
55
- case _:
54
+ ), a.$$typeof) {
55
+ case R:
56
56
  return "Portal";
57
- case Pe:
58
- return l.displayName || "Context";
59
- case J:
60
- return (l._context.displayName || "Context") + ".Consumer";
61
- case Te:
62
- var h = l.render;
63
- return l = l.displayName, l || (l = h.displayName || h.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
64
- case Ne:
65
- return h = l.displayName || null, h !== null ? h : e(l.type) || "Memo";
66
- case X:
67
- h = l._payload, l = l._init;
57
+ case A:
58
+ return a.displayName || "Context";
59
+ case m:
60
+ return (a._context.displayName || "Context") + ".Consumer";
61
+ case ze:
62
+ var g = a.render;
63
+ return a = a.displayName, a || (a = g.displayName || g.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
64
+ case Fe:
65
+ return g = a.displayName || null, g !== null ? g : t(a.type) || "Memo";
66
+ case Z:
67
+ g = a._payload, a = a._init;
68
68
  try {
69
- return e(l(h));
69
+ return t(a(g));
70
70
  } catch {
71
71
  }
72
72
  }
73
73
  return null;
74
74
  }
75
- function t(l) {
76
- return "" + l;
75
+ function e(a) {
76
+ return "" + a;
77
77
  }
78
- function n(l) {
78
+ function n(a) {
79
79
  try {
80
- t(l);
81
- var h = !1;
80
+ e(a);
81
+ var g = !1;
82
82
  } catch {
83
- h = !0;
83
+ g = !0;
84
84
  }
85
- if (h) {
86
- h = console;
87
- var v = h.error, y = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
88
- return v.call(
89
- h,
85
+ if (g) {
86
+ g = console;
87
+ var w = g.error, S = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
88
+ return w.call(
89
+ g,
90
90
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
91
- y
92
- ), t(l);
91
+ S
92
+ ), e(a);
93
93
  }
94
94
  }
95
- function o(l) {
96
- if (l === b) return "<>";
97
- if (typeof l == "object" && l !== null && l.$$typeof === X)
95
+ function o(a) {
96
+ if (a === y) return "<>";
97
+ if (typeof a == "object" && a !== null && a.$$typeof === Z)
98
98
  return "<...>";
99
99
  try {
100
- var h = e(l);
101
- return h ? "<" + h + ">" : "<...>";
100
+ var g = t(a);
101
+ return g ? "<" + g + ">" : "<...>";
102
102
  } catch {
103
103
  return "<...>";
104
104
  }
105
105
  }
106
106
  function r() {
107
- var l = Z.A;
108
- return l === null ? null : l.getOwner();
107
+ var a = Q.A;
108
+ return a === null ? null : a.getOwner();
109
109
  }
110
- function s() {
110
+ function i() {
111
111
  return Error("react-stack-top-frame");
112
112
  }
113
- function c(l) {
114
- if (le.call(l, "key")) {
115
- var h = Object.getOwnPropertyDescriptor(l, "key").get;
116
- if (h && h.isReactWarning) return !1;
113
+ function l(a) {
114
+ if (ce.call(a, "key")) {
115
+ var g = Object.getOwnPropertyDescriptor(a, "key").get;
116
+ if (g && g.isReactWarning) return !1;
117
117
  }
118
- return l.key !== void 0;
118
+ return a.key !== void 0;
119
119
  }
120
- function a(l, h) {
121
- function v() {
122
- ce || (ce = !0, console.error(
120
+ function c(a, g) {
121
+ function w() {
122
+ ue || (ue = !0, console.error(
123
123
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
124
- h
124
+ g
125
125
  ));
126
126
  }
127
- v.isReactWarning = !0, Object.defineProperty(l, "key", {
128
- get: v,
127
+ w.isReactWarning = !0, Object.defineProperty(a, "key", {
128
+ get: w,
129
129
  configurable: !0
130
130
  });
131
131
  }
132
- function u() {
133
- var l = e(this.type);
134
- return ae[l] || (ae[l] = !0, console.error(
132
+ function f() {
133
+ var a = t(this.type);
134
+ return de[a] || (de[a] = !0, console.error(
135
135
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
136
- )), l = this.props.ref, l !== void 0 ? l : null;
136
+ )), a = this.props.ref, a !== void 0 ? a : null;
137
137
  }
138
- function d(l, h, v, y, H, ee) {
139
- var w = v.ref;
140
- return l = {
141
- $$typeof: R,
142
- type: l,
143
- key: h,
144
- props: v,
145
- _owner: y
146
- }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(l, "ref", {
138
+ function d(a, g, w, S, q, te) {
139
+ var C = w.ref;
140
+ return a = {
141
+ $$typeof: k,
142
+ type: a,
143
+ key: g,
144
+ props: w,
145
+ _owner: S
146
+ }, (C !== void 0 ? C : null) !== null ? Object.defineProperty(a, "ref", {
147
147
  enumerable: !1,
148
- get: u
149
- }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
148
+ get: f
149
+ }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
150
150
  configurable: !1,
151
151
  enumerable: !1,
152
152
  writable: !0,
153
153
  value: 0
154
- }), Object.defineProperty(l, "_debugInfo", {
154
+ }), Object.defineProperty(a, "_debugInfo", {
155
155
  configurable: !1,
156
156
  enumerable: !1,
157
157
  writable: !0,
158
158
  value: null
159
- }), Object.defineProperty(l, "_debugStack", {
159
+ }), Object.defineProperty(a, "_debugStack", {
160
160
  configurable: !1,
161
161
  enumerable: !1,
162
162
  writable: !0,
163
- value: H
164
- }), Object.defineProperty(l, "_debugTask", {
163
+ value: q
164
+ }), Object.defineProperty(a, "_debugTask", {
165
165
  configurable: !1,
166
166
  enumerable: !1,
167
167
  writable: !0,
168
- value: ee
169
- }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
168
+ value: te
169
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
170
170
  }
171
- function f(l, h, v, y, H, ee) {
172
- var w = h.children;
173
- if (w !== void 0)
174
- if (y)
175
- if (De(w)) {
176
- for (y = 0; y < w.length; y++)
177
- m(w[y]);
178
- Object.freeze && Object.freeze(w);
171
+ function u(a, g, w, S, q, te) {
172
+ var C = g.children;
173
+ if (C !== void 0)
174
+ if (S)
175
+ if (We(C)) {
176
+ for (S = 0; S < C.length; S++)
177
+ h(C[S]);
178
+ Object.freeze && Object.freeze(C);
179
179
  } else
180
180
  console.error(
181
181
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
182
182
  );
183
- else m(w);
184
- if (le.call(h, "key")) {
185
- w = e(l);
186
- var L = Object.keys(h).filter(function(Me) {
187
- return Me !== "key";
183
+ else h(C);
184
+ if (ce.call(g, "key")) {
185
+ C = t(a);
186
+ var $ = Object.keys(g).filter(function(Ue) {
187
+ return Ue !== "key";
188
188
  });
189
- y = 0 < L.length ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}", fe[w + y] || (L = 0 < L.length ? "{" + L.join(": ..., ") + ": ...}" : "{}", console.error(
189
+ S = 0 < $.length ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}", ge[C + S] || ($ = 0 < $.length ? "{" + $.join(": ..., ") + ": ...}" : "{}", console.error(
190
190
  `A props object containing a "key" prop is being spread into JSX:
191
191
  let props = %s;
192
192
  <%s {...props} />
193
193
  React keys must be passed directly to JSX without using spread:
194
194
  let props = %s;
195
195
  <%s key={someKey} {...props} />`,
196
- y,
197
- w,
198
- L,
199
- w
200
- ), fe[w + y] = !0);
196
+ S,
197
+ C,
198
+ $,
199
+ C
200
+ ), ge[C + S] = !0);
201
201
  }
202
- if (w = null, v !== void 0 && (n(v), w = "" + v), c(h) && (n(h.key), w = "" + h.key), "key" in h) {
203
- v = {};
204
- for (var te in h)
205
- te !== "key" && (v[te] = h[te]);
206
- } else v = h;
207
- return w && a(
208
- v,
209
- typeof l == "function" ? l.displayName || l.name || "Unknown" : l
202
+ if (C = null, w !== void 0 && (n(w), C = "" + w), l(g) && (n(g.key), C = "" + g.key), "key" in g) {
203
+ w = {};
204
+ for (var ne in g)
205
+ ne !== "key" && (w[ne] = g[ne]);
206
+ } else w = g;
207
+ return C && c(
208
+ w,
209
+ typeof a == "function" ? a.displayName || a.name || "Unknown" : a
210
210
  ), d(
211
- l,
211
+ a,
212
+ C,
212
213
  w,
213
- v,
214
214
  r(),
215
- H,
216
- ee
215
+ q,
216
+ te
217
217
  );
218
218
  }
219
- function m(l) {
220
- p(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === X && (l._payload.status === "fulfilled" ? p(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
219
+ function h(a) {
220
+ x(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === Z && (a._payload.status === "fulfilled" ? x(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
221
221
  }
222
- function p(l) {
223
- return typeof l == "object" && l !== null && l.$$typeof === R;
222
+ function x(a) {
223
+ return typeof a == "object" && a !== null && a.$$typeof === k;
224
224
  }
225
- var g = O, R = /* @__PURE__ */ Symbol.for("react.transitional.element"), _ = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), N = /* @__PURE__ */ Symbol.for("react.profiler"), J = /* @__PURE__ */ Symbol.for("react.consumer"), Pe = /* @__PURE__ */ Symbol.for("react.context"), Te = /* @__PURE__ */ Symbol.for("react.forward_ref"), Ae = /* @__PURE__ */ Symbol.for("react.suspense"), _e = /* @__PURE__ */ Symbol.for("react.suspense_list"), Ne = /* @__PURE__ */ Symbol.for("react.memo"), X = /* @__PURE__ */ Symbol.for("react.lazy"), Le = /* @__PURE__ */ Symbol.for("react.activity"), Oe = /* @__PURE__ */ Symbol.for("react.client.reference"), Z = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, le = Object.prototype.hasOwnProperty, De = Array.isArray, Q = console.createTask ? console.createTask : function() {
225
+ var b = D, k = /* @__PURE__ */ Symbol.for("react.transitional.element"), R = /* @__PURE__ */ Symbol.for("react.portal"), y = /* @__PURE__ */ Symbol.for("react.fragment"), I = /* @__PURE__ */ Symbol.for("react.strict_mode"), p = /* @__PURE__ */ Symbol.for("react.profiler"), m = /* @__PURE__ */ Symbol.for("react.consumer"), A = /* @__PURE__ */ Symbol.for("react.context"), ze = /* @__PURE__ */ Symbol.for("react.forward_ref"), $e = /* @__PURE__ */ Symbol.for("react.suspense"), De = /* @__PURE__ */ Symbol.for("react.suspense_list"), Fe = /* @__PURE__ */ Symbol.for("react.memo"), Z = /* @__PURE__ */ Symbol.for("react.lazy"), Me = /* @__PURE__ */ Symbol.for("react.activity"), Be = /* @__PURE__ */ Symbol.for("react.client.reference"), Q = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ce = Object.prototype.hasOwnProperty, We = Array.isArray, ee = console.createTask ? console.createTask : function() {
226
226
  return null;
227
227
  };
228
- g = {
229
- react_stack_bottom_frame: function(l) {
230
- return l();
228
+ b = {
229
+ react_stack_bottom_frame: function(a) {
230
+ return a();
231
231
  }
232
232
  };
233
- var ce, ae = {}, ue = g.react_stack_bottom_frame.bind(
234
- g,
235
- s
236
- )(), de = Q(o(s)), fe = {};
237
- F.Fragment = b, F.jsx = function(l, h, v) {
238
- var y = 1e4 > Z.recentlyCreatedOwnerStacks++;
239
- return f(
240
- l,
241
- h,
242
- v,
233
+ var ue, de = {}, fe = b.react_stack_bottom_frame.bind(
234
+ b,
235
+ i
236
+ )(), pe = ee(o(i)), ge = {};
237
+ B.Fragment = y, B.jsx = function(a, g, w) {
238
+ var S = 1e4 > Q.recentlyCreatedOwnerStacks++;
239
+ return u(
240
+ a,
241
+ g,
242
+ w,
243
243
  !1,
244
- y ? Error("react-stack-top-frame") : ue,
245
- y ? Q(o(l)) : de
244
+ S ? Error("react-stack-top-frame") : fe,
245
+ S ? ee(o(a)) : pe
246
246
  );
247
- }, F.jsxs = function(l, h, v) {
248
- var y = 1e4 > Z.recentlyCreatedOwnerStacks++;
249
- return f(
250
- l,
251
- h,
252
- v,
247
+ }, B.jsxs = function(a, g, w) {
248
+ var S = 1e4 > Q.recentlyCreatedOwnerStacks++;
249
+ return u(
250
+ a,
251
+ g,
252
+ w,
253
253
  !0,
254
- y ? Error("react-stack-top-frame") : ue,
255
- y ? Q(o(l)) : de
254
+ S ? Error("react-stack-top-frame") : fe,
255
+ S ? ee(o(a)) : pe
256
256
  );
257
257
  };
258
- })()), F;
258
+ })()), B;
259
259
  }
260
- var ge;
261
- function $e() {
262
- return ge || (ge = 1, process.env.NODE_ENV === "production" ? Y.exports = Fe() : Y.exports = Be()), Y.exports;
260
+ var be;
261
+ function qe() {
262
+ return be || (be = 1, process.env.NODE_ENV === "production" ? G.exports = He() : G.exports = Ye()), G.exports;
263
263
  }
264
- var i = $e();
265
- const E = {
264
+ var s = qe();
265
+ const j = {
266
266
  floatingIconPosition: "uilint:floatingIconPosition",
267
267
  inspectorDocked: "uilint:inspectorDocked",
268
268
  inspectorWidth: "uilint:inspectorWidth",
269
269
  inspectorFloatingPosition: "uilint:inspectorFloatingPosition",
270
270
  inspectorFloatingSize: "uilint:inspectorFloatingSize"
271
271
  };
272
- function ye() {
272
+ function Ee() {
273
273
  return typeof window < "u" && typeof localStorage < "u";
274
274
  }
275
- function z(e, t) {
276
- if (!ye()) return t;
275
+ function H(t, e) {
276
+ if (!Ee()) return e;
277
277
  try {
278
- const n = localStorage.getItem(e);
279
- return n === null ? t : JSON.parse(n);
278
+ const n = localStorage.getItem(t);
279
+ return n === null ? e : JSON.parse(n);
280
280
  } catch (n) {
281
- return console.warn(`[UILint] Failed to load ${e} from localStorage:`, n), t;
281
+ return console.warn(`[UILint] Failed to load ${t} from localStorage:`, n), e;
282
282
  }
283
283
  }
284
- function B(e, t) {
285
- if (ye())
284
+ function W(t, e) {
285
+ if (Ee())
286
286
  try {
287
- localStorage.setItem(e, JSON.stringify(t));
287
+ localStorage.setItem(t, JSON.stringify(e));
288
288
  } catch (n) {
289
- console.warn(`[UILint] Failed to save ${e} to localStorage:`, n);
289
+ console.warn(`[UILint] Failed to save ${t} to localStorage:`, n);
290
290
  }
291
291
  }
292
- const me = {
292
+ const ye = {
293
293
  open: !1,
294
294
  query: "",
295
295
  selectedIndex: 0,
296
296
  filters: []
297
- }, ze = 400;
298
- function We() {
297
+ }, Ge = 400;
298
+ function Ke() {
299
299
  return {
300
300
  open: !1,
301
301
  panelId: null,
302
302
  data: null,
303
- docked: z(E.inspectorDocked, !0),
304
- width: z(E.inspectorWidth, ze),
305
- floatingPosition: z(E.inspectorFloatingPosition, null),
306
- floatingSize: z(E.inspectorFloatingSize, null)
303
+ docked: H(j.inspectorDocked, !0),
304
+ width: H(j.inspectorWidth, Ge),
305
+ floatingPosition: H(j.inspectorFloatingPosition, null),
306
+ floatingSize: H(j.inspectorFloatingSize, null)
307
307
  };
308
308
  }
309
- const Ue = (e) => (t, n) => ({
309
+ const Ve = (t) => (e, n) => ({
310
310
  // ============ Floating Icon ============
311
- floatingIconPosition: z(
312
- E.floatingIconPosition,
311
+ floatingIconPosition: H(
312
+ j.floatingIconPosition,
313
313
  null
314
314
  ),
315
315
  setFloatingIconPosition: (o) => {
316
- B(E.floatingIconPosition, o), t({ floatingIconPosition: o });
316
+ W(j.floatingIconPosition, o), e({ floatingIconPosition: o });
317
317
  },
318
318
  // ============ Alt Key Mode ============
319
319
  altKeyHeld: !1,
320
320
  setAltKeyHeld: (o) => {
321
- t({ altKeyHeld: o });
321
+ e({ altKeyHeld: o });
322
322
  },
323
323
  // ============ Selection ============
324
324
  selectedElementId: null,
325
325
  hoveredElementId: null,
326
326
  setSelectedElementId: (o) => {
327
- t({ selectedElementId: o });
327
+ e({ selectedElementId: o });
328
328
  },
329
329
  setHoveredElementId: (o) => {
330
- t({ hoveredElementId: o });
330
+ e({ hoveredElementId: o });
331
331
  },
332
332
  // ============ Command Palette ============
333
- commandPalette: { ...me },
333
+ commandPalette: { ...ye },
334
334
  openCommandPalette: () => {
335
- t({
335
+ e({
336
336
  commandPalette: {
337
337
  ...n().commandPalette,
338
338
  open: !0,
@@ -342,15 +342,15 @@ const Ue = (e) => (t, n) => ({
342
342
  });
343
343
  },
344
344
  closeCommandPalette: () => {
345
- t({
345
+ e({
346
346
  commandPalette: {
347
- ...me,
347
+ ...ye,
348
348
  open: !1
349
349
  }
350
350
  });
351
351
  },
352
352
  setCommandPaletteQuery: (o) => {
353
- t({
353
+ e({
354
354
  commandPalette: {
355
355
  ...n().commandPalette,
356
356
  query: o,
@@ -359,7 +359,7 @@ const Ue = (e) => (t, n) => ({
359
359
  });
360
360
  },
361
361
  setCommandPaletteSelectedIndex: (o) => {
362
- t({
362
+ e({
363
363
  commandPalette: {
364
364
  ...n().commandPalette,
365
365
  selectedIndex: o
@@ -368,7 +368,7 @@ const Ue = (e) => (t, n) => ({
368
368
  },
369
369
  addFilter: (o) => {
370
370
  const r = n().commandPalette;
371
- t({
371
+ e({
372
372
  commandPalette: {
373
373
  ...r,
374
374
  filters: [...r.filters, o],
@@ -378,16 +378,16 @@ const Ue = (e) => (t, n) => ({
378
378
  },
379
379
  removeFilter: (o) => {
380
380
  const r = n().commandPalette;
381
- t({
381
+ e({
382
382
  commandPalette: {
383
383
  ...r,
384
- filters: r.filters.filter((s, c) => c !== o),
384
+ filters: r.filters.filter((i, l) => l !== o),
385
385
  selectedIndex: 0
386
386
  }
387
387
  });
388
388
  },
389
389
  clearFilters: () => {
390
- t({
390
+ e({
391
391
  commandPalette: {
392
392
  ...n().commandPalette,
393
393
  filters: [],
@@ -396,9 +396,9 @@ const Ue = (e) => (t, n) => ({
396
396
  });
397
397
  },
398
398
  // ============ Inspector ============
399
- inspector: We(),
399
+ inspector: Ke(),
400
400
  openInspector: (o, r) => {
401
- t({
401
+ e({
402
402
  inspector: {
403
403
  ...n().inspector,
404
404
  open: !0,
@@ -408,7 +408,7 @@ const Ue = (e) => (t, n) => ({
408
408
  });
409
409
  },
410
410
  closeInspector: () => {
411
- t({
411
+ e({
412
412
  inspector: {
413
413
  ...n().inspector,
414
414
  open: !1,
@@ -419,7 +419,7 @@ const Ue = (e) => (t, n) => ({
419
419
  },
420
420
  toggleInspectorDocked: () => {
421
421
  const o = n().inspector, r = !o.docked;
422
- B(E.inspectorDocked, r), t({
422
+ W(j.inspectorDocked, r), e({
423
423
  inspector: {
424
424
  ...o,
425
425
  docked: r
@@ -427,7 +427,7 @@ const Ue = (e) => (t, n) => ({
427
427
  });
428
428
  },
429
429
  setInspectorWidth: (o) => {
430
- B(E.inspectorWidth, o), t({
430
+ W(j.inspectorWidth, o), e({
431
431
  inspector: {
432
432
  ...n().inspector,
433
433
  width: o
@@ -435,7 +435,7 @@ const Ue = (e) => (t, n) => ({
435
435
  });
436
436
  },
437
437
  setInspectorFloatingPosition: (o) => {
438
- B(E.inspectorFloatingPosition, o), t({
438
+ W(j.inspectorFloatingPosition, o), e({
439
439
  inspector: {
440
440
  ...n().inspector,
441
441
  floatingPosition: o
@@ -443,7 +443,7 @@ const Ue = (e) => (t, n) => ({
443
443
  });
444
444
  },
445
445
  setInspectorFloatingSize: (o) => {
446
- B(E.inspectorFloatingSize, o), t({
446
+ W(j.inspectorFloatingSize, o), e({
447
447
  inspector: {
448
448
  ...n().inspector,
449
449
  floatingSize: o
@@ -451,33 +451,278 @@ const Ue = (e) => (t, n) => ({
451
451
  });
452
452
  },
453
453
  // ============ Connection (delegated from websocket service) ============
454
- wsConnected: e.websocket.isConnected,
455
- wsUrl: e.websocket.url
456
- }), be = (e) => {
457
- let t;
458
- const n = /* @__PURE__ */ new Set(), o = (d, f) => {
459
- const m = typeof d == "function" ? d(t) : d;
460
- if (!Object.is(m, t)) {
461
- const p = t;
462
- t = f ?? (typeof m != "object" || m === null) ? m : Object.assign({}, t, m), n.forEach((g) => g(t, p));
454
+ wsConnected: t.websocket.isConnected,
455
+ wsUrl: t.websocket.url
456
+ }), xe = (t) => {
457
+ let e;
458
+ const n = /* @__PURE__ */ new Set(), o = (d, u) => {
459
+ const h = typeof d == "function" ? d(e) : d;
460
+ if (!Object.is(h, e)) {
461
+ const x = e;
462
+ e = u ?? (typeof h != "object" || h === null) ? h : Object.assign({}, e, h), n.forEach((b) => b(e, x));
463
463
  }
464
- }, r = () => t, a = { setState: o, getState: r, getInitialState: () => u, subscribe: (d) => (n.add(d), () => n.delete(d)) }, u = t = e(o, r, a);
465
- return a;
466
- }, He = ((e) => e ? be(e) : be), Ye = (e) => e;
467
- function qe(e, t = Ye) {
468
- const n = O.useSyncExternalStore(
469
- e.subscribe,
470
- O.useCallback(() => t(e.getState()), [e, t]),
471
- O.useCallback(() => t(e.getInitialState()), [e, t])
464
+ }, r = () => e, c = { setState: o, getState: r, getInitialState: () => f, subscribe: (d) => (n.add(d), () => n.delete(d)) }, f = e = t(o, r, c);
465
+ return c;
466
+ }, Je = ((t) => t ? xe(t) : xe), Xe = (t) => t;
467
+ function Ze(t, e = Xe) {
468
+ const n = D.useSyncExternalStore(
469
+ t.subscribe,
470
+ D.useCallback(() => e(t.getState()), [t, e]),
471
+ D.useCallback(() => e(t.getInitialState()), [t, e])
472
472
  );
473
- return O.useDebugValue(n), n;
474
- }
475
- const xe = (e) => {
476
- const t = He(e), n = (o) => qe(t, o);
477
- return Object.assign(n, t), n;
478
- }, Ge = ((e) => e ? xe(e) : xe);
479
- let P = null;
480
- const Ke = () => ({
473
+ return D.useDebugValue(n), n;
474
+ }
475
+ const ve = (t) => {
476
+ const e = Je(t), n = (o) => Ze(e, o);
477
+ return Object.assign(n, e), n;
478
+ }, Qe = ((t) => t ? ve(t) : ve);
479
+ function we(t) {
480
+ const e = /* @__PURE__ */ new Map();
481
+ for (const l of t)
482
+ e.set(l.id, l);
483
+ const n = [], o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
484
+ function i(l) {
485
+ const c = l.id;
486
+ if (o.has(c))
487
+ return;
488
+ if (r.has(c))
489
+ throw new Error(
490
+ `[PluginRegistry] Circular dependency detected involving plugin: ${c}`
491
+ );
492
+ r.add(c);
493
+ const f = l.dependencies || [];
494
+ for (const d of f) {
495
+ const u = e.get(d);
496
+ u && i(u);
497
+ }
498
+ r.delete(c), o.add(c), n.push(l);
499
+ }
500
+ for (const l of t)
501
+ i(l);
502
+ return n;
503
+ }
504
+ class et {
505
+ plugins = /* @__PURE__ */ new Map();
506
+ services = null;
507
+ /**
508
+ * Register a plugin with the registry.
509
+ *
510
+ * @param plugin - The plugin to register
511
+ * @throws Warning if plugin with same ID already registered
512
+ * @throws Warning if plugin dependencies are not registered
513
+ */
514
+ register(e) {
515
+ if (console.log(`[PluginRegistry] Registering plugin: ${e.id}`), this.plugins.has(e.id)) {
516
+ console.warn(
517
+ `[PluginRegistry] Plugin "${e.id}" is already registered. Skipping duplicate registration.`
518
+ );
519
+ return;
520
+ }
521
+ const n = e.dependencies || [], o = [];
522
+ for (const r of n)
523
+ this.plugins.has(r) || o.push(r);
524
+ o.length > 0 && console.warn(
525
+ `[PluginRegistry] Plugin "${e.id}" has unregistered dependencies: ${o.join(", ")}. These plugins should be registered first for proper initialization order.`
526
+ ), this.plugins.set(e.id, {
527
+ plugin: e,
528
+ initialized: !1
529
+ }), console.log(
530
+ `[PluginRegistry] Plugin "${e.id}" registered successfully`
531
+ );
532
+ }
533
+ /**
534
+ * Initialize all registered plugins in dependency order.
535
+ *
536
+ * @param services - Plugin services to pass to each plugin's initialize method
537
+ */
538
+ async initializeAll(e) {
539
+ console.log("[PluginRegistry] Initializing all plugins..."), this.services = e;
540
+ const n = Array.from(this.plugins.values()).map((r) => r.plugin), o = we(n);
541
+ console.log(
542
+ `[PluginRegistry] Initialization order: ${o.map((r) => r.id).join(" -> ")}`
543
+ );
544
+ for (const r of o) {
545
+ const i = this.plugins.get(r.id);
546
+ if (i) {
547
+ if (i.initialized) {
548
+ console.log(
549
+ `[PluginRegistry] Plugin "${r.id}" already initialized, skipping`
550
+ );
551
+ continue;
552
+ }
553
+ try {
554
+ console.log(`[PluginRegistry] Initializing plugin: ${r.id}`), r.initialize && await r.initialize(e), i.initialized = !0, console.log(
555
+ `[PluginRegistry] Plugin "${r.id}" initialized successfully`
556
+ );
557
+ } catch (l) {
558
+ console.error(
559
+ `[PluginRegistry] Failed to initialize plugin "${r.id}":`,
560
+ l
561
+ );
562
+ }
563
+ }
564
+ }
565
+ console.log("[PluginRegistry] All plugins initialized");
566
+ }
567
+ /**
568
+ * Get all registered plugins.
569
+ *
570
+ * @returns Array of all registered plugins
571
+ */
572
+ getPlugins() {
573
+ return Array.from(this.plugins.values()).map((e) => e.plugin);
574
+ }
575
+ /**
576
+ * Get a specific plugin by ID.
577
+ *
578
+ * @param id - The plugin ID to look up
579
+ * @returns The plugin if found, undefined otherwise
580
+ */
581
+ getPlugin(e) {
582
+ return this.plugins.get(e)?.plugin;
583
+ }
584
+ /**
585
+ * Aggregate all commands from all registered plugins.
586
+ *
587
+ * @returns Array of all commands from all plugins
588
+ */
589
+ getAllCommands() {
590
+ const e = [];
591
+ for (const { plugin: n } of this.plugins.values())
592
+ n.commands && e.push(...n.commands);
593
+ return e;
594
+ }
595
+ /**
596
+ * Aggregate all analyzers from all registered plugins.
597
+ *
598
+ * @returns Array of all analyzers from all plugins
599
+ */
600
+ getAllAnalyzers() {
601
+ const e = [];
602
+ for (const { plugin: n } of this.plugins.values())
603
+ n.analyzers && e.push(...n.analyzers);
604
+ return e;
605
+ }
606
+ /**
607
+ * Aggregate all inspector panels from all registered plugins.
608
+ * Panels are sorted by priority (higher priority first).
609
+ *
610
+ * @returns Array of all inspector panels, sorted by priority
611
+ */
612
+ getAllInspectorPanels() {
613
+ const e = [];
614
+ for (const { plugin: n } of this.plugins.values())
615
+ n.inspectorPanels && e.push(...n.inspectorPanels);
616
+ return e.sort((n, o) => (o.priority ?? 0) - (n.priority ?? 0));
617
+ }
618
+ /**
619
+ * Resolve which plugin handles a specific rule.
620
+ *
621
+ * First checks for plugins that explicitly claim the rule via ruleContributions,
622
+ * then falls back to matching by rule category.
623
+ *
624
+ * @param ruleId - The rule ID to look up
625
+ * @param ruleMeta - The rule metadata
626
+ * @returns The plugin that handles this rule, or a default core plugin
627
+ */
628
+ getPluginForRule(e, n) {
629
+ for (const { plugin: i } of this.plugins.values())
630
+ if (i.ruleContributions && i.ruleContributions.find(
631
+ (c) => c.ruleId === e
632
+ ))
633
+ return i;
634
+ for (const { plugin: i } of this.plugins.values())
635
+ if (e.startsWith(`${i.id}/`) || n.category && i.ruleCategories && i.ruleCategories.includes(n.category))
636
+ return i;
637
+ const o = this.plugins.get("core")?.plugin;
638
+ if (o)
639
+ return o;
640
+ const r = this.plugins.values().next().value;
641
+ return r ? r.plugin : {
642
+ id: "default",
643
+ name: "Default",
644
+ version: "1.0.0"
645
+ };
646
+ }
647
+ /**
648
+ * Get custom UI contribution for a specific rule.
649
+ *
650
+ * @param ruleId - The rule ID to look up
651
+ * @returns The rule UI contribution if found, undefined otherwise
652
+ */
653
+ getRuleContribution(e) {
654
+ for (const { plugin: n } of this.plugins.values())
655
+ if (n.ruleContributions) {
656
+ const o = n.ruleContributions.find(
657
+ (r) => r.ruleId === e
658
+ );
659
+ if (o)
660
+ return o;
661
+ }
662
+ }
663
+ /**
664
+ * Dispose all plugins and clean up resources.
665
+ * Calls dispose on each plugin in reverse initialization order.
666
+ */
667
+ disposeAll() {
668
+ console.log("[PluginRegistry] Disposing all plugins...");
669
+ const e = Array.from(this.plugins.values()).map((o) => o.plugin), n = we(e).reverse();
670
+ for (const o of n) {
671
+ const r = this.plugins.get(o.id);
672
+ if (!(!r || !r.initialized))
673
+ try {
674
+ console.log(`[PluginRegistry] Disposing plugin: ${o.id}`), o.dispose && this.services && o.dispose(this.services), r.initialized = !1, console.log(
675
+ `[PluginRegistry] Plugin "${o.id}" disposed successfully`
676
+ );
677
+ } catch (i) {
678
+ console.error(
679
+ `[PluginRegistry] Failed to dispose plugin "${o.id}":`,
680
+ i
681
+ );
682
+ }
683
+ }
684
+ this.services = null, console.log("[PluginRegistry] All plugins disposed");
685
+ }
686
+ /**
687
+ * Check if a plugin is registered.
688
+ *
689
+ * @param id - The plugin ID to check
690
+ * @returns true if the plugin is registered
691
+ */
692
+ isRegistered(e) {
693
+ return this.plugins.has(e);
694
+ }
695
+ /**
696
+ * Check if a plugin is initialized.
697
+ *
698
+ * @param id - The plugin ID to check
699
+ * @returns true if the plugin is initialized, false otherwise
700
+ */
701
+ isInitialized(e) {
702
+ return this.plugins.get(e)?.initialized ?? !1;
703
+ }
704
+ /**
705
+ * Get the current plugin services (available after initializeAll).
706
+ *
707
+ * @returns The plugin services, or null if not yet initialized
708
+ */
709
+ getServices() {
710
+ return this.services;
711
+ }
712
+ /**
713
+ * Clear all registered plugins.
714
+ * Useful for testing or resetting the registry.
715
+ */
716
+ clear() {
717
+ console.log("[PluginRegistry] Clearing all plugins"), this.disposeAll(), this.plugins.clear();
718
+ }
719
+ }
720
+ function tt() {
721
+ return new et();
722
+ }
723
+ const nt = tt();
724
+ let L = null, ke = null;
725
+ const ot = () => ({
481
726
  isConnected: !1,
482
727
  url: "ws://localhost:9234",
483
728
  connect: () => {
@@ -493,7 +738,7 @@ const Ke = () => ({
493
738
  }),
494
739
  onConnectionChange: () => (console.warn("[ComposedStore] WebSocket onConnectionChange called but not implemented"), () => {
495
740
  })
496
- }), Ve = () => ({
741
+ }), rt = () => ({
497
742
  start: () => {
498
743
  console.warn("[ComposedStore] DOMObserver start called but not implemented");
499
744
  },
@@ -505,215 +750,306 @@ const Ke = () => ({
505
750
  onElementsRemoved: () => (console.warn("[ComposedStore] DOMObserver onElementsRemoved called but not implemented"), () => {
506
751
  })
507
752
  });
508
- function Je(e = {}) {
509
- const t = e.websocket ?? Ke(), n = e.domObserver ?? Ve();
753
+ function it(t = {}) {
754
+ const e = t.websocket ?? ot(), n = t.domObserver ?? rt();
510
755
  let o;
511
- return { store: Ge()((s, c) => (o = {
756
+ const r = Qe()((i, l) => (o = {
512
757
  websocket: {
513
758
  get isConnected() {
514
- return t.isConnected;
759
+ return e.isConnected;
515
760
  },
516
761
  get url() {
517
- return t.url;
762
+ return e.url;
518
763
  },
519
- connect: t.connect,
520
- disconnect: t.disconnect,
521
- send: t.send,
522
- on: t.on,
523
- onConnectionChange: t.onConnectionChange
764
+ connect: e.connect.bind(e),
765
+ disconnect: e.disconnect.bind(e),
766
+ send: e.send.bind(e),
767
+ on: e.on.bind(e),
768
+ onConnectionChange: e.onConnectionChange.bind(e)
769
+ },
770
+ domObserver: {
771
+ start: n.start.bind(n),
772
+ stop: n.stop.bind(n),
773
+ onElementsAdded: n.onElementsAdded.bind(n),
774
+ onElementsRemoved: n.onElementsRemoved.bind(n)
524
775
  },
525
- domObserver: n,
526
- getState: () => c(),
776
+ getState: () => l(),
527
777
  setState: (d) => {
528
- s(d);
778
+ i(d);
529
779
  },
530
- openInspector: (d, f) => {
531
- const m = c();
532
- f.ruleId ? m.openInspector("rule", { ruleId: f.ruleId }) : f.elementId ? m.openInspector("element", { elementId: f.elementId }) : s({
780
+ openInspector: (d, u) => {
781
+ const h = l();
782
+ u.ruleId ? h.openInspector("rule", { ruleId: u.ruleId }) : u.elementId ? h.openInspector("element", { elementId: u.elementId }) : i({
533
783
  inspector: {
534
- ...m.inspector,
784
+ ...h.inspector,
535
785
  open: !0,
536
786
  panelId: d,
537
- data: f
787
+ data: u
538
788
  }
539
789
  });
540
790
  },
541
791
  closeCommandPalette: () => {
542
- c().closeCommandPalette();
792
+ l().closeCommandPalette();
543
793
  }
544
794
  }, {
545
795
  // Core slice state and actions
546
- ...Ue(o)(s, c, {
547
- setState: s,
548
- getState: c,
549
- getInitialState: () => c(),
796
+ ...Ve(o)(i, l, {
797
+ setState: i,
798
+ getState: l,
799
+ getInitialState: () => l(),
550
800
  subscribe: () => () => {
551
801
  }
552
802
  }),
553
803
  // Plugin slices namespace (empty initially)
554
804
  plugins: {},
555
805
  // Actions for managing plugin slices
556
- registerPluginSlice: (d, f) => {
557
- console.log(`[ComposedStore] Registering plugin slice: ${String(d)}`), s((m) => ({
806
+ registerPluginSlice: (d, u) => {
807
+ console.log(`[ComposedStore] Registering plugin slice: ${String(d)}`), i((h) => ({
558
808
  plugins: {
559
- ...m.plugins,
560
- [d]: f
809
+ ...h.plugins,
810
+ [d]: u
561
811
  }
562
812
  }));
563
813
  },
564
814
  unregisterPluginSlice: (d) => {
565
- console.log(`[ComposedStore] Unregistering plugin slice: ${String(d)}`), s((f) => {
566
- const { [d]: m, ...p } = f.plugins;
567
- return { plugins: p };
815
+ console.log(`[ComposedStore] Unregistering plugin slice: ${String(d)}`), i((u) => {
816
+ const { [d]: h, ...x } = u.plugins;
817
+ return { plugins: x };
568
818
  });
569
819
  },
570
- getPluginSlice: (d) => c().plugins[d],
571
- setPluginSlice: (d, f) => {
572
- s((m) => {
573
- const p = m.plugins[d];
574
- return p ? {
820
+ getPluginSlice: (d) => l().plugins[d],
821
+ setPluginSlice: (d, u) => {
822
+ i((h) => {
823
+ const x = h.plugins[d];
824
+ return x ? {
575
825
  plugins: {
576
- ...m.plugins,
826
+ ...h.plugins,
577
827
  [d]: {
578
- ...p,
579
- ...f
828
+ ...x,
829
+ ...u
580
830
  }
581
831
  }
582
832
  } : (console.warn(
583
833
  `[ComposedStore] Cannot update unregistered plugin slice: ${String(d)}`
584
- ), m);
834
+ ), h);
585
835
  });
586
836
  }
587
- })), services: o };
837
+ }));
838
+ return e.onConnectionChange((i) => {
839
+ r.setState({ wsConnected: i, wsUrl: e.url });
840
+ }), { store: r, services: o };
588
841
  }
589
- function Xe(e) {
590
- return P || (P = Je(e).store, P);
842
+ function st(t) {
843
+ if (L)
844
+ return L;
845
+ const e = it(t);
846
+ return L = e.store, ke = e.services, L;
591
847
  }
592
- function x(e) {
593
- return P || Xe(), e ? P(e) : P();
848
+ function v(t) {
849
+ return L || st(), t ? L(t) : L();
594
850
  }
595
- const k = {
851
+ function lt() {
852
+ return ke;
853
+ }
854
+ const at = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ct = (t) => t.replace(
855
+ /^([A-Z])|[\s-_]+(\w)/g,
856
+ (e, n, o) => o ? o.toUpperCase() : n.toLowerCase()
857
+ ), Se = (t) => {
858
+ const e = ct(t);
859
+ return e.charAt(0).toUpperCase() + e.slice(1);
860
+ }, Pe = (...t) => t.filter((e, n, o) => !!e && e.trim() !== "" && o.indexOf(e) === n).join(" ").trim(), ut = (t) => {
861
+ for (const e in t)
862
+ if (e.startsWith("aria-") || e === "role" || e === "title")
863
+ return !0;
864
+ };
865
+ var dt = {
866
+ xmlns: "http://www.w3.org/2000/svg",
867
+ width: 24,
868
+ height: 24,
869
+ viewBox: "0 0 24 24",
596
870
  fill: "none",
597
871
  stroke: "currentColor",
598
872
  strokeWidth: 2,
599
873
  strokeLinecap: "round",
600
874
  strokeLinejoin: "round"
601
875
  };
602
- function Ze({ size: e = 24, color: t = "currentColor", className: n }) {
603
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
604
- /* @__PURE__ */ i.jsx("path", { d: "M9 12l2 2 4-4" }),
605
- /* @__PURE__ */ i.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3" })
606
- ] });
607
- }
608
- function Qe({ size: e = 20, color: t = "currentColor", className: n }) {
609
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
610
- /* @__PURE__ */ i.jsx("circle", { cx: "11", cy: "11", r: "8" }),
611
- /* @__PURE__ */ i.jsx("path", { d: "M21 21l-4.35-4.35" })
612
- ] });
613
- }
614
- function we({ size: e = 20, color: t = "currentColor", className: n }) {
615
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
616
- /* @__PURE__ */ i.jsx("path", { d: "M18 6L6 18" }),
617
- /* @__PURE__ */ i.jsx("path", { d: "M6 6l12 12" })
618
- ] });
619
- }
620
- function ne({ size: e = 16, color: t = "currentColor", className: n }) {
621
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
622
- /* @__PURE__ */ i.jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }),
623
- /* @__PURE__ */ i.jsx("path", { d: "M12 9v4" }),
624
- /* @__PURE__ */ i.jsx("path", { d: "M12 17h.01" })
625
- ] });
626
- }
627
- function oe({ size: e = 16, color: t = "currentColor", className: n }) {
628
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
629
- /* @__PURE__ */ i.jsx("circle", { cx: "12", cy: "12", r: "10" }),
630
- /* @__PURE__ */ i.jsx("path", { d: "M15 9l-6 6" }),
631
- /* @__PURE__ */ i.jsx("path", { d: "M9 9l6 6" })
632
- ] });
633
- }
634
- function re({ size: e = 16, color: t = "currentColor", className: n }) {
635
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
636
- /* @__PURE__ */ i.jsx("circle", { cx: "12", cy: "12", r: "10" }),
637
- /* @__PURE__ */ i.jsx("path", { d: "M12 16v-4" }),
638
- /* @__PURE__ */ i.jsx("path", { d: "M12 8h.01" })
639
- ] });
640
- }
641
- function Se({ size: e = 16, color: t = "currentColor", className: n }) {
642
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
643
- /* @__PURE__ */ i.jsx("path", { d: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" }),
644
- /* @__PURE__ */ i.jsx("path", { d: "M14 2v6h6" })
645
- ] });
646
- }
647
- function Ie({ size: e = 16, color: t = "currentColor", className: n }) {
648
- return /* @__PURE__ */ i.jsxs("svg", { width: e, height: e, viewBox: "0 0 24 24", className: n, ...k, stroke: t, children: [
649
- /* @__PURE__ */ i.jsx("path", { d: "M4 6h16" }),
650
- /* @__PURE__ */ i.jsx("path", { d: "M4 12h16" }),
651
- /* @__PURE__ */ i.jsx("path", { d: "M4 18h12" })
652
- ] });
653
- }
654
- function et() {
876
+ const ft = Ie(
877
+ ({
878
+ color: t = "currentColor",
879
+ size: e = 24,
880
+ strokeWidth: n = 2,
881
+ absoluteStrokeWidth: o,
882
+ className: r = "",
883
+ children: i,
884
+ iconNode: l,
885
+ ...c
886
+ }, f) => oe(
887
+ "svg",
888
+ {
889
+ ref: f,
890
+ ...dt,
891
+ width: e,
892
+ height: e,
893
+ stroke: t,
894
+ strokeWidth: o ? Number(n) * 24 / Number(e) : n,
895
+ className: Pe("lucide", r),
896
+ ...!i && !ut(c) && { "aria-hidden": "true" },
897
+ ...c
898
+ },
899
+ [
900
+ ...l.map(([d, u]) => oe(d, u)),
901
+ ...Array.isArray(i) ? i : [i]
902
+ ]
903
+ )
904
+ );
905
+ const P = (t, e) => {
906
+ const n = Ie(
907
+ ({ className: o, ...r }, i) => oe(ft, {
908
+ ref: i,
909
+ iconNode: e,
910
+ className: Pe(
911
+ `lucide-${at(Se(t))}`,
912
+ `lucide-${t}`,
913
+ o
914
+ ),
915
+ ...r
916
+ })
917
+ );
918
+ return n.displayName = Se(t), n;
919
+ };
920
+ const pt = [
921
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
922
+ ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
923
+ ["path", { d: "m9 9 6 6", key: "z0biqf" }]
924
+ ], re = P("circle-x", pt);
925
+ const gt = [
926
+ [
927
+ "path",
928
+ {
929
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
930
+ key: "1oefj6"
931
+ }
932
+ ],
933
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
934
+ ], Re = P("file", gt);
935
+ const ht = [
936
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
937
+ ["path", { d: "M12 16v-4", key: "1dtifu" }],
938
+ ["path", { d: "M12 8h.01", key: "e9boi3" }]
939
+ ], ie = P("info", ht);
940
+ const mt = [
941
+ ["path", { d: "M3 5h.01", key: "18ugdj" }],
942
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
943
+ ["path", { d: "M3 19h.01", key: "noohij" }],
944
+ ["path", { d: "M8 5h13", key: "1pao27" }],
945
+ ["path", { d: "M8 12h13", key: "1za7za" }],
946
+ ["path", { d: "M8 19h13", key: "m83p4d" }]
947
+ ], je = P("list", mt);
948
+ const bt = [
949
+ [
950
+ "path",
951
+ {
952
+ d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
953
+ key: "10ikf1"
954
+ }
955
+ ]
956
+ ], yt = P("play", bt);
957
+ const xt = [
958
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
959
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
960
+ ], vt = P("rotate-ccw", xt);
961
+ const wt = [
962
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
963
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
964
+ ], St = P("search", wt);
965
+ const Ct = [
966
+ [
967
+ "path",
968
+ { d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344", key: "2acyp4" }
969
+ ],
970
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
971
+ ], It = P("square-check-big", Ct);
972
+ const Et = [
973
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
974
+ ], kt = P("square", Et);
975
+ const Pt = [
976
+ [
977
+ "path",
978
+ {
979
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
980
+ key: "wmoenq"
981
+ }
982
+ ],
983
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
984
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
985
+ ], se = P("triangle-alert", Pt);
986
+ const Rt = [
987
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
988
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
989
+ ], Ae = P("x", Rt);
990
+ function jt() {
655
991
  return typeof window > "u" ? { x: 0, y: 16 } : { x: window.innerWidth / 2 - 24, y: 16 };
656
992
  }
657
- function tt() {
658
- const e = x((b) => b.openCommandPalette), t = x((b) => b.wsConnected), n = x((b) => b.floatingIconPosition), o = x((b) => b.setFloatingIconPosition), r = x((b) => {
659
- const S = b.plugins?.eslint?.issues;
660
- if (!S) return 0;
661
- let N = 0;
662
- return S.forEach((J) => {
663
- N += J.length;
664
- }), N;
665
- }), [s, c] = C(!1), [a, u] = C({ x: 0, y: 0 }), d = K(null), f = n ?? et(), m = I((b) => {
666
- if (b.button !== 0) return;
667
- const S = d.current?.getBoundingClientRect();
668
- S && (u({
669
- x: b.clientX - S.left,
670
- y: b.clientY - S.top
671
- }), c(!0), b.preventDefault());
672
- }, []), p = I((b) => {
673
- if (!s) return;
674
- const S = Math.max(0, Math.min(window.innerWidth - 48, b.clientX - a.x)), N = Math.max(0, Math.min(window.innerHeight - 48, b.clientY - a.y));
675
- o({ x: S, y: N });
676
- }, [s, a, o]), g = I(() => {
677
- c(!1);
993
+ function At() {
994
+ const t = v((y) => y.openCommandPalette), e = v((y) => y.wsConnected), n = v((y) => y.floatingIconPosition), o = v((y) => y.setFloatingIconPosition), r = v((y) => {
995
+ const I = y.plugins?.eslint?.issues;
996
+ if (!I) return 0;
997
+ let p = 0;
998
+ return I.forEach((m) => {
999
+ p += m.length;
1000
+ }), p;
1001
+ }), [i, l] = T(!1), [c, f] = T({ x: 0, y: 0 }), d = J(null), u = n ?? jt(), h = E((y) => {
1002
+ if (y.button !== 0) return;
1003
+ const I = d.current?.getBoundingClientRect();
1004
+ I && (f({
1005
+ x: y.clientX - I.left,
1006
+ y: y.clientY - I.top
1007
+ }), l(!0), y.preventDefault());
1008
+ }, []), x = E((y) => {
1009
+ if (!i) return;
1010
+ const I = Math.max(0, Math.min(window.innerWidth - 48, y.clientX - c.x)), p = Math.max(0, Math.min(window.innerHeight - 48, y.clientY - c.y));
1011
+ o({ x: I, y: p });
1012
+ }, [i, c, o]), b = E(() => {
1013
+ l(!1);
678
1014
  }, []);
679
- A(() => {
680
- if (s)
681
- return window.addEventListener("mousemove", p), window.addEventListener("mouseup", g), () => {
682
- window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", g);
1015
+ z(() => {
1016
+ if (i)
1017
+ return window.addEventListener("mousemove", x), window.addEventListener("mouseup", b), () => {
1018
+ window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", b);
683
1019
  };
684
- }, [s, p, g]);
685
- const R = I(() => {
686
- s || e();
687
- }, [s, e]), _ = document.getElementById("uilint-portal") || document.body;
688
- return U(
689
- /* @__PURE__ */ i.jsxs(
1020
+ }, [i, x, b]);
1021
+ const k = E(() => {
1022
+ i || t();
1023
+ }, [i, t]), R = document.getElementById("uilint-portal") || document.body;
1024
+ return Y(
1025
+ /* @__PURE__ */ s.jsxs(
690
1026
  "button",
691
1027
  {
692
1028
  ref: d,
693
- onClick: R,
694
- onMouseDown: m,
1029
+ onClick: k,
1030
+ onMouseDown: h,
695
1031
  style: {
696
1032
  position: "fixed",
697
- left: f.x,
698
- top: f.y,
1033
+ left: u.x,
1034
+ top: u.y,
699
1035
  width: 48,
700
1036
  height: 48,
701
1037
  borderRadius: "50%",
702
1038
  border: "none",
703
- background: t ? "#3b82f6" : "#6b7280",
1039
+ background: e ? "#3b82f6" : "#6b7280",
704
1040
  color: "white",
705
- cursor: s ? "grabbing" : "grab",
1041
+ cursor: i ? "grabbing" : "grab",
706
1042
  display: "flex",
707
1043
  alignItems: "center",
708
1044
  justifyContent: "center",
709
1045
  boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
710
1046
  zIndex: 99999,
711
- transition: s ? "none" : "background 0.2s"
1047
+ transition: i ? "none" : "background 0.2s"
712
1048
  },
713
- title: `UILint: ${r} issues${t ? "" : " (disconnected)"}`,
1049
+ title: `UILint: ${r} issues${e ? "" : " (disconnected)"}`,
714
1050
  children: [
715
- /* @__PURE__ */ i.jsx(Ze, { size: 24 }),
716
- r > 0 && /* @__PURE__ */ i.jsx(
1051
+ /* @__PURE__ */ s.jsx(It, { size: 24 }),
1052
+ r > 0 && /* @__PURE__ */ s.jsx(
717
1053
  "span",
718
1054
  {
719
1055
  style: {
@@ -735,7 +1071,7 @@ function tt() {
735
1071
  children: r > 99 ? "99+" : r
736
1072
  }
737
1073
  ),
738
- !t && /* @__PURE__ */ i.jsx(
1074
+ !e && /* @__PURE__ */ s.jsx(
739
1075
  "span",
740
1076
  {
741
1077
  style: {
@@ -753,54 +1089,54 @@ function tt() {
753
1089
  ]
754
1090
  }
755
1091
  ),
756
- _
1092
+ R
757
1093
  );
758
1094
  }
759
- function nt(e) {
760
- const [t, n] = C(/* @__PURE__ */ new Map()), o = K(null), r = K(null), s = I(() => {
761
- if (!e) {
1095
+ function Tt(t) {
1096
+ const [e, n] = T(/* @__PURE__ */ new Map()), o = J(null), r = J(null), i = E(() => {
1097
+ if (!t) {
762
1098
  n(/* @__PURE__ */ new Map());
763
1099
  return;
764
1100
  }
765
- const a = e instanceof Set ? e : new Set(e.keys());
766
- if (a.size === 0) {
1101
+ const c = t instanceof Set ? t : new Set(t.keys());
1102
+ if (c.size === 0) {
767
1103
  n(/* @__PURE__ */ new Map());
768
1104
  return;
769
1105
  }
770
- const u = /* @__PURE__ */ new Map();
771
- document.querySelectorAll("[data-loc]").forEach((f) => {
772
- const m = f.getAttribute("data-loc");
773
- if (m && a.has(m)) {
774
- const p = f.getBoundingClientRect();
775
- p.width > 0 && p.height > 0 && u.set(m, { dataLoc: m, rect: p, element: f });
1106
+ const f = /* @__PURE__ */ new Map();
1107
+ document.querySelectorAll("[data-loc]").forEach((u) => {
1108
+ const h = u.getAttribute("data-loc");
1109
+ if (h && c.has(h)) {
1110
+ const x = u.getBoundingClientRect();
1111
+ x.width > 0 && x.height > 0 && f.set(h, { dataLoc: h, rect: x, element: u });
776
1112
  }
777
- }), n(u);
778
- }, [e]), c = I(() => {
1113
+ }), n(f);
1114
+ }, [t]), l = E(() => {
779
1115
  r.current || (r.current = requestAnimationFrame(() => {
780
- s(), r.current = null;
1116
+ i(), r.current = null;
781
1117
  }));
782
- }, [s]);
783
- return A(() => (s(), window.addEventListener("scroll", c, { passive: !0 }), window.addEventListener("resize", c, { passive: !0 }), o.current = new MutationObserver(c), o.current.observe(document.body, {
1118
+ }, [i]);
1119
+ return z(() => (i(), window.addEventListener("scroll", l, { passive: !0 }), window.addEventListener("resize", l, { passive: !0 }), o.current = new MutationObserver(l), o.current.observe(document.body, {
784
1120
  childList: !0,
785
1121
  subtree: !0,
786
1122
  attributes: !0,
787
1123
  attributeFilter: ["data-loc"]
788
1124
  }), () => {
789
- window.removeEventListener("scroll", c), window.removeEventListener("resize", c), o.current?.disconnect(), r.current && cancelAnimationFrame(r.current);
790
- }), [s, c]), t;
1125
+ window.removeEventListener("scroll", l), window.removeEventListener("resize", l), o.current?.disconnect(), r.current && cancelAnimationFrame(r.current);
1126
+ }), [i, l]), e;
791
1127
  }
792
- function ot(e) {
793
- const t = e.split(":"), n = parseInt(t.pop() || "0", 10), o = parseInt(t.pop() || "0", 10);
794
- return { filePath: t.join(":"), line: o, column: n };
1128
+ function _t(t) {
1129
+ const e = t.split(":"), n = parseInt(e.pop() || "0", 10), o = parseInt(e.pop() || "0", 10);
1130
+ return { filePath: e.join(":"), line: o, column: n };
795
1131
  }
796
- function rt(e, t, n, o) {
797
- return `${e}:${t}:${n}:${o}`;
1132
+ function Nt(t, e, n, o) {
1133
+ return `${t}:${e}:${n}:${o}`;
798
1134
  }
799
- function it(e) {
800
- return e === 2 ? "error" : "warning";
1135
+ function Lt(t) {
1136
+ return t === 2 ? "error" : "warning";
801
1137
  }
802
- function ie(e) {
803
- switch (e) {
1138
+ function le(t) {
1139
+ switch (t) {
804
1140
  case "error":
805
1141
  return "#ef4444";
806
1142
  // red-500
@@ -811,34 +1147,34 @@ function ie(e) {
811
1147
  return "#3b82f6";
812
1148
  }
813
1149
  }
814
- function Yt(e, t = "eslint") {
815
- if (!e.message || !e.line) return null;
816
- const n = e.dataLoc || "", { filePath: o } = n ? ot(n) : { filePath: "" }, r = e.ruleId || "unknown", s = e.severity ? it(e.severity) : "warning";
1150
+ function Sn(t, e = "eslint") {
1151
+ if (!t.message || !t.line) return null;
1152
+ const n = t.dataLoc || "", { filePath: o } = n ? _t(n) : { filePath: "" }, r = t.ruleId || "unknown", i = t.severity ? Lt(t.severity) : "warning";
817
1153
  return {
818
- id: rt(t, r, n, e.line),
819
- message: e.message,
820
- severity: s,
1154
+ id: Nt(e, r, n, t.line),
1155
+ message: t.message,
1156
+ severity: i,
821
1157
  dataLoc: n,
822
1158
  ruleId: r,
823
- pluginId: t,
1159
+ pluginId: e,
824
1160
  filePath: o,
825
- line: e.line,
826
- column: e.column
1161
+ line: t.line,
1162
+ column: t.column
827
1163
  };
828
1164
  }
829
- function st({ dataLoc: e, rect: t, issues: n, isHovered: o, showDetails: r, onClick: s }) {
830
- const c = W(() => n.some((d) => d.severity === "error") ? "error" : n.some((d) => d.severity === "warning") ? "warning" : "info", [n]), a = ie(c), u = n.length;
831
- return /* @__PURE__ */ i.jsxs(
1165
+ function Ot({ dataLoc: t, rect: e, issues: n, isHovered: o, showDetails: r, onClick: i }) {
1166
+ const l = _(() => n.some((d) => d.severity === "error") ? "error" : n.some((d) => d.severity === "warning") ? "warning" : "info", [n]), c = le(l), f = n.length;
1167
+ return /* @__PURE__ */ s.jsxs(
832
1168
  "div",
833
1169
  {
834
- onClick: s,
1170
+ onClick: i,
835
1171
  style: {
836
1172
  position: "fixed",
837
- left: t.left - 2,
838
- top: t.top - 2,
839
- width: t.width + 4,
840
- height: t.height + 4,
841
- border: `2px solid ${a}`,
1173
+ left: e.left - 2,
1174
+ top: e.top - 2,
1175
+ width: e.width + 4,
1176
+ height: e.height + 4,
1177
+ border: `2px solid ${c}`,
842
1178
  borderRadius: 4,
843
1179
  pointerEvents: "auto",
844
1180
  cursor: "pointer",
@@ -847,7 +1183,7 @@ function st({ dataLoc: e, rect: t, issues: n, isHovered: o, showDetails: r, onCl
847
1183
  zIndex: 99990
848
1184
  },
849
1185
  children: [
850
- /* @__PURE__ */ i.jsx(
1186
+ /* @__PURE__ */ s.jsx(
851
1187
  "span",
852
1188
  {
853
1189
  style: {
@@ -857,7 +1193,7 @@ function st({ dataLoc: e, rect: t, issues: n, isHovered: o, showDetails: r, onCl
857
1193
  minWidth: 18,
858
1194
  height: 18,
859
1195
  borderRadius: 9,
860
- background: a,
1196
+ background: c,
861
1197
  color: "white",
862
1198
  fontSize: 10,
863
1199
  fontWeight: 600,
@@ -866,10 +1202,10 @@ function st({ dataLoc: e, rect: t, issues: n, isHovered: o, showDetails: r, onCl
866
1202
  justifyContent: "center",
867
1203
  padding: "0 4px"
868
1204
  },
869
- children: u
1205
+ children: f
870
1206
  }
871
1207
  ),
872
- r && o && /* @__PURE__ */ i.jsxs(
1208
+ r && o && /* @__PURE__ */ s.jsxs(
873
1209
  "div",
874
1210
  {
875
1211
  style: {
@@ -888,18 +1224,18 @@ function st({ dataLoc: e, rect: t, issues: n, isHovered: o, showDetails: r, onCl
888
1224
  zIndex: 99991
889
1225
  },
890
1226
  children: [
891
- /* @__PURE__ */ i.jsxs("strong", { children: [
892
- u,
1227
+ /* @__PURE__ */ s.jsxs("strong", { children: [
1228
+ f,
893
1229
  " issue",
894
- u !== 1 ? "s" : ""
1230
+ f !== 1 ? "s" : ""
895
1231
  ] }),
896
- /* @__PURE__ */ i.jsxs("div", { style: { marginTop: 4, opacity: 0.8 }, children: [
897
- n.slice(0, 3).map((d, f) => /* @__PURE__ */ i.jsxs("div", { style: { marginTop: f > 0 ? 4 : 0 }, children: [
1232
+ /* @__PURE__ */ s.jsxs("div", { style: { marginTop: 4, opacity: 0.8 }, children: [
1233
+ n.slice(0, 3).map((d, u) => /* @__PURE__ */ s.jsxs("div", { style: { marginTop: u > 0 ? 4 : 0 }, children: [
898
1234
  "• ",
899
1235
  d.message.slice(0, 60),
900
1236
  d.message.length > 60 ? "..." : ""
901
- ] }, f)),
902
- n.length > 3 && /* @__PURE__ */ i.jsxs("div", { style: { marginTop: 4, opacity: 0.6 }, children: [
1237
+ ] }, u)),
1238
+ n.length > 3 && /* @__PURE__ */ s.jsxs("div", { style: { marginTop: 4, opacity: 0.6 }, children: [
903
1239
  "+",
904
1240
  n.length - 3,
905
1241
  " more..."
@@ -912,15 +1248,15 @@ function st({ dataLoc: e, rect: t, issues: n, isHovered: o, showDetails: r, onCl
912
1248
  }
913
1249
  );
914
1250
  }
915
- function lt() {
916
- const e = x((u) => u.altKeyHeld), t = x((u) => u.openInspector), n = x((u) => u.hoveredElementId), o = x((u) => u.setHoveredElementId), r = x((u) => u.plugins?.eslint?.issues), s = nt(r), c = (u) => {
917
- t("element", { dataLoc: u });
1251
+ function zt() {
1252
+ const t = v((f) => f.altKeyHeld), e = v((f) => f.openInspector), n = v((f) => f.hoveredElementId), o = v((f) => f.setHoveredElementId), r = v((f) => f.plugins?.eslint?.issues), i = Tt(r), l = (f) => {
1253
+ e("element", { dataLoc: f });
918
1254
  };
919
1255
  if (!r || r.size === 0)
920
1256
  return null;
921
- const a = document.getElementById("uilint-portal") || document.body;
922
- return U(
923
- /* @__PURE__ */ i.jsx(
1257
+ const c = document.getElementById("uilint-portal") || document.body;
1258
+ return Y(
1259
+ /* @__PURE__ */ s.jsx(
924
1260
  "div",
925
1261
  {
926
1262
  style: {
@@ -932,101 +1268,101 @@ function lt() {
932
1268
  pointerEvents: "none",
933
1269
  zIndex: 99990
934
1270
  },
935
- onMouseMove: (u) => {
936
- const f = u.target.getAttribute?.("data-loc");
937
- o(f || null);
1271
+ onMouseMove: (f) => {
1272
+ const u = f.target.getAttribute?.("data-loc");
1273
+ o(u || null);
938
1274
  },
939
- children: Array.from(s.entries()).map(([u, { rect: d }]) => {
940
- const f = r.get(u) || [];
941
- return f.length === 0 ? null : /* @__PURE__ */ i.jsx(
942
- st,
1275
+ children: Array.from(i.entries()).map(([f, { rect: d }]) => {
1276
+ const u = r.get(f) || [];
1277
+ return u.length === 0 ? null : /* @__PURE__ */ s.jsx(
1278
+ Ot,
943
1279
  {
944
- dataLoc: u,
1280
+ dataLoc: f,
945
1281
  rect: d,
946
- issues: f,
947
- isHovered: n === u,
948
- showDetails: e,
949
- onClick: () => c(u)
1282
+ issues: u,
1283
+ isHovered: n === f,
1284
+ showDetails: t,
1285
+ onClick: () => l(f)
950
1286
  },
951
- u
1287
+ f
952
1288
  );
953
1289
  })
954
1290
  }
955
1291
  ),
956
- a
1292
+ c
957
1293
  );
958
1294
  }
959
- function Ee() {
960
- const e = x((c) => c.plugins?.eslint?.issues), t = W(() => {
961
- const c = [];
962
- return e?.forEach((a) => c.push(...a)), c;
963
- }, [e]), n = W(() => {
964
- const c = /* @__PURE__ */ new Map();
965
- for (const a of t) {
966
- const u = c.get(a.filePath) || [];
967
- u.push(a), c.set(a.filePath, u);
1295
+ function Te() {
1296
+ const t = v((l) => l.plugins?.eslint?.issues), e = _(() => {
1297
+ const l = [];
1298
+ return t?.forEach((c) => l.push(...c)), l;
1299
+ }, [t]), n = _(() => {
1300
+ const l = /* @__PURE__ */ new Map();
1301
+ for (const c of e) {
1302
+ const f = l.get(c.filePath) || [];
1303
+ f.push(c), l.set(c.filePath, f);
968
1304
  }
969
- return c;
970
- }, [t]), o = I(
971
- (c) => e?.get(c) || [],
972
- [e]
973
- ), r = t.length, s = W(
1305
+ return l;
1306
+ }, [e]), o = E(
1307
+ (l) => t?.get(l) || [],
1308
+ [t]
1309
+ ), r = e.length, i = _(
974
1310
  () => ({
975
- error: t.filter((c) => c.severity === "error").length,
976
- warning: t.filter((c) => c.severity === "warning").length,
977
- info: t.filter((c) => c.severity === "info").length
1311
+ error: e.filter((l) => l.severity === "error").length,
1312
+ warning: e.filter((l) => l.severity === "warning").length,
1313
+ info: e.filter((l) => l.severity === "info").length
978
1314
  }),
979
- [t]
1315
+ [e]
980
1316
  );
981
1317
  return {
982
- allIssues: t,
1318
+ allIssues: e,
983
1319
  byFile: n,
984
- byDataLoc: e ?? /* @__PURE__ */ new Map(),
1320
+ byDataLoc: t ?? /* @__PURE__ */ new Map(),
985
1321
  getIssuesForDataLoc: o,
986
1322
  totalCount: r,
987
- countBySeverity: s
1323
+ countBySeverity: i
988
1324
  };
989
1325
  }
990
- function ct() {
991
- const e = x((r) => r.openCommandPalette), t = x((r) => r.closeCommandPalette), n = x((r) => r.setAltKeyHeld), o = x((r) => r.commandPalette.open);
992
- A(() => {
993
- const r = (c) => {
994
- if ((c.metaKey || c.ctrlKey) && c.key === "k") {
995
- c.preventDefault(), o ? t() : e();
1326
+ function $t() {
1327
+ const t = v((r) => r.openCommandPalette), e = v((r) => r.closeCommandPalette), n = v((r) => r.setAltKeyHeld), o = v((r) => r.commandPalette.open);
1328
+ z(() => {
1329
+ const r = (l) => {
1330
+ if ((l.metaKey || l.ctrlKey) && l.key === "k") {
1331
+ l.preventDefault(), o ? e() : t();
996
1332
  return;
997
1333
  }
998
- if (c.key === "Escape" && o) {
999
- c.preventDefault(), t();
1334
+ if (l.key === "Escape" && o) {
1335
+ l.preventDefault(), e();
1000
1336
  return;
1001
1337
  }
1002
- c.key === "Alt" && n(!0);
1003
- }, s = (c) => {
1004
- c.key === "Alt" && n(!1);
1338
+ l.key === "Alt" && n(!0);
1339
+ }, i = (l) => {
1340
+ l.key === "Alt" && n(!1);
1005
1341
  };
1006
- return window.addEventListener("keydown", r), window.addEventListener("keyup", s), () => {
1007
- window.removeEventListener("keydown", r), window.removeEventListener("keyup", s);
1342
+ return window.addEventListener("keydown", r), window.addEventListener("keyup", i), () => {
1343
+ window.removeEventListener("keydown", r), window.removeEventListener("keyup", i);
1008
1344
  };
1009
- }, [o, e, t, n]);
1345
+ }, [o, t, e, n]);
1010
1346
  }
1011
- function at({ value: e, onChange: t, placeholder: n = "Search issues, rules, files..." }) {
1012
- const o = K(null);
1013
- return A(() => {
1347
+ function Dt({ value: t, onChange: e, placeholder: n = "Search issues, rules, files..." }) {
1348
+ const o = J(null);
1349
+ return z(() => {
1014
1350
  o.current?.focus();
1015
- }, []), /* @__PURE__ */ i.jsxs("div", { style: {
1351
+ }, []), /* @__PURE__ */ s.jsxs("div", { style: {
1016
1352
  display: "flex",
1017
1353
  alignItems: "center",
1018
1354
  padding: "12px 16px",
1019
1355
  borderBottom: "1px solid #e5e7eb",
1020
1356
  gap: 12
1021
1357
  }, children: [
1022
- /* @__PURE__ */ i.jsx(Qe, { size: 20, color: "#9ca3af" }),
1023
- /* @__PURE__ */ i.jsx(
1358
+ /* @__PURE__ */ s.jsx(St, { size: 20, color: "#9ca3af" }),
1359
+ /* @__PURE__ */ s.jsx(
1024
1360
  "input",
1025
1361
  {
1026
1362
  ref: o,
1027
1363
  type: "text",
1028
- value: e,
1029
- onChange: (r) => t(r.target.value),
1364
+ value: t,
1365
+ onChange: (r) => e(r.target.value),
1030
1366
  placeholder: n,
1031
1367
  style: {
1032
1368
  flex: 1,
@@ -1038,10 +1374,10 @@ function at({ value: e, onChange: t, placeholder: n = "Search issues, rules, fil
1038
1374
  }
1039
1375
  }
1040
1376
  ),
1041
- e && /* @__PURE__ */ i.jsx(
1377
+ t && /* @__PURE__ */ s.jsx(
1042
1378
  "button",
1043
1379
  {
1044
- onClick: () => t(""),
1380
+ onClick: () => e(""),
1045
1381
  style: {
1046
1382
  border: "none",
1047
1383
  background: "none",
@@ -1054,9 +1390,9 @@ function at({ value: e, onChange: t, placeholder: n = "Search issues, rules, fil
1054
1390
  )
1055
1391
  ] });
1056
1392
  }
1057
- function ut({ issue: e, isSelected: t, onClick: n }) {
1058
- const o = e.severity === "error" ? oe : e.severity === "warning" ? ne : re, r = e.severity === "error" ? "#ef4444" : e.severity === "warning" ? "#f59e0b" : "#3b82f6", s = e.filePath.split("/").pop() || e.filePath;
1059
- return /* @__PURE__ */ i.jsxs(
1393
+ function Ft({ issue: t, isSelected: e, onClick: n }) {
1394
+ const o = t.severity === "error" ? re : t.severity === "warning" ? se : ie, r = t.severity === "error" ? "#ef4444" : t.severity === "warning" ? "#f59e0b" : "#3b82f6", i = t.filePath.split("/").pop() || t.filePath;
1395
+ return /* @__PURE__ */ s.jsxs(
1060
1396
  "div",
1061
1397
  {
1062
1398
  onClick: n,
@@ -1065,21 +1401,21 @@ function ut({ issue: e, isSelected: t, onClick: n }) {
1065
1401
  alignItems: "flex-start",
1066
1402
  padding: "10px 16px",
1067
1403
  cursor: "pointer",
1068
- background: t ? "#f3f4f6" : "transparent",
1404
+ background: e ? "#f3f4f6" : "transparent",
1069
1405
  gap: 12,
1070
1406
  borderBottom: "1px solid #f3f4f6"
1071
1407
  },
1072
1408
  children: [
1073
- /* @__PURE__ */ i.jsx(o, { size: 16, color: r }),
1074
- /* @__PURE__ */ i.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
1075
- /* @__PURE__ */ i.jsx("div", { style: {
1409
+ /* @__PURE__ */ s.jsx(o, { size: 16, color: r }),
1410
+ /* @__PURE__ */ s.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
1411
+ /* @__PURE__ */ s.jsx("div", { style: {
1076
1412
  fontSize: 14,
1077
1413
  color: "#111827",
1078
1414
  overflow: "hidden",
1079
1415
  textOverflow: "ellipsis",
1080
1416
  whiteSpace: "nowrap"
1081
- }, children: e.message }),
1082
- /* @__PURE__ */ i.jsxs("div", { style: {
1417
+ }, children: t.message }),
1418
+ /* @__PURE__ */ s.jsxs("div", { style: {
1083
1419
  fontSize: 12,
1084
1420
  color: "#6b7280",
1085
1421
  marginTop: 2,
@@ -1087,15 +1423,15 @@ function ut({ issue: e, isSelected: t, onClick: n }) {
1087
1423
  alignItems: "center",
1088
1424
  gap: 8
1089
1425
  }, children: [
1090
- /* @__PURE__ */ i.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
1091
- /* @__PURE__ */ i.jsx(Se, { size: 12 }),
1092
- s,
1426
+ /* @__PURE__ */ s.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
1427
+ /* @__PURE__ */ s.jsx(Re, { size: 12 }),
1428
+ i,
1093
1429
  ":",
1094
- e.line
1430
+ t.line
1095
1431
  ] }),
1096
- /* @__PURE__ */ i.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
1097
- /* @__PURE__ */ i.jsx(Ie, { size: 12 }),
1098
- e.ruleId
1432
+ /* @__PURE__ */ s.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
1433
+ /* @__PURE__ */ s.jsx(je, { size: 12 }),
1434
+ t.ruleId
1099
1435
  ] })
1100
1436
  ] })
1101
1437
  ] })
@@ -1103,24 +1439,145 @@ function ut({ issue: e, isSelected: t, onClick: n }) {
1103
1439
  }
1104
1440
  );
1105
1441
  }
1106
- function dt() {
1107
- const e = x((p) => p.commandPalette.open), t = x((p) => p.closeCommandPalette), n = x((p) => p.openInspector), [o, r] = C(""), [s, c] = C(0), { allIssues: a } = Ee(), u = W(() => {
1108
- if (!o.trim()) return a.slice(0, 100);
1442
+ function Mt({
1443
+ command: t,
1444
+ isSelected: e,
1445
+ onClick: n
1446
+ }) {
1447
+ return /* @__PURE__ */ s.jsxs(
1448
+ "div",
1449
+ {
1450
+ onClick: n,
1451
+ style: {
1452
+ padding: "12px 16px",
1453
+ cursor: "pointer",
1454
+ background: e ? "#f3f4f6" : "transparent",
1455
+ borderBottom: "1px solid #f3f4f6",
1456
+ display: "flex",
1457
+ alignItems: "center",
1458
+ gap: 12
1459
+ },
1460
+ children: [
1461
+ /* @__PURE__ */ s.jsx(
1462
+ "div",
1463
+ {
1464
+ style: {
1465
+ width: 32,
1466
+ height: 32,
1467
+ borderRadius: 6,
1468
+ background: "#3b82f6",
1469
+ color: "white",
1470
+ display: "flex",
1471
+ alignItems: "center",
1472
+ justifyContent: "center",
1473
+ flexShrink: 0
1474
+ },
1475
+ children: t.id.includes("start") ? /* @__PURE__ */ s.jsx(yt, { size: 16 }) : t.id.includes("stop") ? /* @__PURE__ */ s.jsx(kt, { size: 16 }) : t.id.includes("clear") ? /* @__PURE__ */ s.jsx(vt, { size: 16 }) : /* @__PURE__ */ s.jsx("span", { style: { fontSize: 14 }, children: "⚡" })
1476
+ }
1477
+ ),
1478
+ /* @__PURE__ */ s.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
1479
+ /* @__PURE__ */ s.jsx(
1480
+ "div",
1481
+ {
1482
+ style: {
1483
+ fontWeight: 500,
1484
+ color: "#111827",
1485
+ marginBottom: 2
1486
+ },
1487
+ children: t.title
1488
+ }
1489
+ ),
1490
+ t.subtitle && /* @__PURE__ */ s.jsx(
1491
+ "div",
1492
+ {
1493
+ style: {
1494
+ fontSize: 12,
1495
+ color: "#6b7280",
1496
+ overflow: "hidden",
1497
+ textOverflow: "ellipsis",
1498
+ whiteSpace: "nowrap"
1499
+ },
1500
+ children: t.subtitle
1501
+ }
1502
+ )
1503
+ ] }),
1504
+ /* @__PURE__ */ s.jsx(
1505
+ "span",
1506
+ {
1507
+ style: {
1508
+ fontSize: 10,
1509
+ fontWeight: 500,
1510
+ textTransform: "uppercase",
1511
+ background: "#dbeafe",
1512
+ color: "#1d4ed8",
1513
+ padding: "2px 6px",
1514
+ borderRadius: 4
1515
+ },
1516
+ children: t.category
1517
+ }
1518
+ )
1519
+ ]
1520
+ }
1521
+ );
1522
+ }
1523
+ function Bt() {
1524
+ const t = v((p) => p.commandPalette.open), e = v((p) => p.closeCommandPalette), n = v((p) => p.openInspector), [o, r] = T(""), [i, l] = T(0), { allIssues: c } = Te(), f = v((p) => p), d = _(() => nt.getAllCommands().filter((m) => m.isAvailable ? m.isAvailable(f) : !0), [f]), u = _(() => {
1525
+ if (!o.trim()) return d;
1109
1526
  const p = o.toLowerCase();
1110
- return a.filter(
1111
- (g) => g.message.toLowerCase().includes(p) || g.ruleId.toLowerCase().includes(p) || g.filePath.toLowerCase().includes(p)
1112
- ).slice(0, 100);
1113
- }, [a, o]), d = I((p) => {
1114
- p.key === "ArrowDown" ? (p.preventDefault(), c((g) => Math.min(g + 1, u.length - 1))) : p.key === "ArrowUp" ? (p.preventDefault(), c((g) => Math.max(g - 1, 0))) : p.key === "Enter" && u[s] && (p.preventDefault(), f(u[s]));
1115
- }, [u, s]), f = I((p) => {
1116
- n("issue", { issue: p }), t();
1117
- }, [n, t]);
1118
- if (O.useEffect(() => {
1119
- c(0);
1120
- }, [o]), !e) return null;
1121
- const m = document.getElementById("uilint-portal") || document.body;
1122
- return U(
1123
- /* @__PURE__ */ i.jsx(
1527
+ return d.filter(
1528
+ (m) => m.title.toLowerCase().includes(p) || m.keywords.some((A) => A.toLowerCase().includes(p)) || m.category.toLowerCase().includes(p) || m.subtitle && m.subtitle.toLowerCase().includes(p)
1529
+ );
1530
+ }, [d, o]), h = _(() => {
1531
+ if (!o.trim()) return c.slice(0, 50);
1532
+ const p = o.toLowerCase();
1533
+ return c.filter(
1534
+ (m) => m.message.toLowerCase().includes(p) || m.ruleId.toLowerCase().includes(p) || m.filePath.toLowerCase().includes(p)
1535
+ ).slice(0, 50);
1536
+ }, [c, o]), x = _(() => {
1537
+ const p = u.map((A) => ({
1538
+ kind: "command",
1539
+ command: A
1540
+ })), m = h.map((A) => ({
1541
+ kind: "issue",
1542
+ issue: A
1543
+ }));
1544
+ return [...p, ...m];
1545
+ }, [u, h]), b = E(
1546
+ (p) => {
1547
+ p.key === "ArrowDown" ? (p.preventDefault(), l((m) => Math.min(m + 1, x.length - 1))) : p.key === "ArrowUp" ? (p.preventDefault(), l((m) => Math.max(m - 1, 0))) : p.key === "Enter" && x[i] && (p.preventDefault(), y(x[i]));
1548
+ },
1549
+ [x, i]
1550
+ ), k = E(
1551
+ (p) => {
1552
+ n("issue", { issue: p }), e();
1553
+ },
1554
+ [n, e]
1555
+ ), R = E(
1556
+ async (p) => {
1557
+ const m = lt();
1558
+ if (!m) {
1559
+ console.error("[CommandPalette] Plugin services not available");
1560
+ return;
1561
+ }
1562
+ try {
1563
+ await p.execute(m);
1564
+ } catch (A) {
1565
+ console.error(`[CommandPalette] Error executing command "${p.id}":`, A);
1566
+ }
1567
+ },
1568
+ []
1569
+ ), y = E(
1570
+ (p) => {
1571
+ p.kind === "command" ? R(p.command) : k(p.issue);
1572
+ },
1573
+ [R, k]
1574
+ );
1575
+ if (D.useEffect(() => {
1576
+ l(0);
1577
+ }, [o]), !t) return null;
1578
+ const I = document.getElementById("uilint-portal") || document.body;
1579
+ return Y(
1580
+ /* @__PURE__ */ s.jsx(
1124
1581
  "div",
1125
1582
  {
1126
1583
  style: {
@@ -1134,10 +1591,10 @@ function dt() {
1134
1591
  zIndex: 99998
1135
1592
  },
1136
1593
  onClick: (p) => {
1137
- p.target === p.currentTarget && t();
1594
+ p.target === p.currentTarget && e();
1138
1595
  },
1139
- onKeyDown: d,
1140
- children: /* @__PURE__ */ i.jsxs(
1596
+ onKeyDown: b,
1597
+ children: /* @__PURE__ */ s.jsxs(
1141
1598
  "div",
1142
1599
  {
1143
1600
  style: {
@@ -1149,106 +1606,176 @@ function dt() {
1149
1606
  overflow: "hidden"
1150
1607
  },
1151
1608
  children: [
1152
- /* @__PURE__ */ i.jsxs("div", { style: {
1153
- display: "flex",
1154
- alignItems: "center",
1155
- justifyContent: "space-between",
1156
- padding: "12px 16px",
1157
- borderBottom: "1px solid #e5e7eb"
1158
- }, children: [
1159
- /* @__PURE__ */ i.jsxs("span", { style: { fontWeight: 600, color: "#111827" }, children: [
1160
- "UILint (",
1161
- a.length,
1162
- " issues)"
1163
- ] }),
1164
- /* @__PURE__ */ i.jsx(
1165
- "button",
1166
- {
1167
- onClick: t,
1168
- style: {
1169
- border: "none",
1170
- background: "none",
1171
- cursor: "pointer",
1172
- padding: 4,
1173
- color: "#6b7280"
1174
- },
1175
- children: /* @__PURE__ */ i.jsx(we, { size: 20 })
1176
- }
1177
- )
1178
- ] }),
1179
- /* @__PURE__ */ i.jsx(at, { value: o, onChange: r }),
1180
- /* @__PURE__ */ i.jsx("div", { style: {
1181
- maxHeight: 400,
1182
- overflowY: "auto"
1183
- }, children: u.length === 0 ? /* @__PURE__ */ i.jsx("div", { style: {
1184
- padding: 24,
1185
- textAlign: "center",
1186
- color: "#6b7280"
1187
- }, children: o ? "No issues match your search" : "No issues found" }) : u.map((p, g) => /* @__PURE__ */ i.jsx(
1188
- ut,
1609
+ /* @__PURE__ */ s.jsxs(
1610
+ "div",
1189
1611
  {
1190
- issue: p,
1191
- isSelected: g === s,
1192
- onClick: () => f(p)
1193
- },
1194
- p.id
1195
- )) }),
1196
- /* @__PURE__ */ i.jsxs("div", { style: {
1197
- padding: "8px 16px",
1198
- borderTop: "1px solid #e5e7eb",
1199
- fontSize: 12,
1200
- color: "#9ca3af",
1201
- display: "flex",
1202
- gap: 16
1203
- }, children: [
1204
- /* @__PURE__ */ i.jsx("span", { children: "↑↓ Navigate" }),
1205
- /* @__PURE__ */ i.jsx("span", { children: "↵ Select" }),
1206
- /* @__PURE__ */ i.jsx("span", { children: "Esc Close" })
1207
- ] })
1612
+ style: {
1613
+ display: "flex",
1614
+ alignItems: "center",
1615
+ justifyContent: "space-between",
1616
+ padding: "12px 16px",
1617
+ borderBottom: "1px solid #e5e7eb"
1618
+ },
1619
+ children: [
1620
+ /* @__PURE__ */ s.jsxs("span", { style: { fontWeight: 600, color: "#111827" }, children: [
1621
+ "UILint",
1622
+ c.length > 0 && /* @__PURE__ */ s.jsxs("span", { style: { fontWeight: 400, color: "#6b7280", marginLeft: 8 }, children: [
1623
+ c.length,
1624
+ " issue",
1625
+ c.length !== 1 ? "s" : ""
1626
+ ] })
1627
+ ] }),
1628
+ /* @__PURE__ */ s.jsx(
1629
+ "button",
1630
+ {
1631
+ onClick: e,
1632
+ style: {
1633
+ border: "none",
1634
+ background: "none",
1635
+ cursor: "pointer",
1636
+ padding: 4,
1637
+ color: "#6b7280"
1638
+ },
1639
+ children: /* @__PURE__ */ s.jsx(Ae, { size: 20 })
1640
+ }
1641
+ )
1642
+ ]
1643
+ }
1644
+ ),
1645
+ /* @__PURE__ */ s.jsx(Dt, { value: o, onChange: r }),
1646
+ /* @__PURE__ */ s.jsx(
1647
+ "div",
1648
+ {
1649
+ style: {
1650
+ maxHeight: 400,
1651
+ overflowY: "auto"
1652
+ },
1653
+ children: x.length === 0 ? /* @__PURE__ */ s.jsx(
1654
+ "div",
1655
+ {
1656
+ style: {
1657
+ padding: 24,
1658
+ textAlign: "center",
1659
+ color: "#6b7280"
1660
+ },
1661
+ children: o ? "No results match your search" : "No commands or issues available"
1662
+ }
1663
+ ) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1664
+ u.length > 0 && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1665
+ /* @__PURE__ */ s.jsx(
1666
+ "div",
1667
+ {
1668
+ style: {
1669
+ padding: "8px 16px",
1670
+ fontSize: 11,
1671
+ fontWeight: 600,
1672
+ textTransform: "uppercase",
1673
+ color: "#9ca3af",
1674
+ background: "#f9fafb"
1675
+ },
1676
+ children: "Commands"
1677
+ }
1678
+ ),
1679
+ u.map((p, m) => /* @__PURE__ */ s.jsx(
1680
+ Mt,
1681
+ {
1682
+ command: p,
1683
+ isSelected: m === i,
1684
+ onClick: () => R(p)
1685
+ },
1686
+ p.id
1687
+ ))
1688
+ ] }),
1689
+ h.length > 0 && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1690
+ /* @__PURE__ */ s.jsx(
1691
+ "div",
1692
+ {
1693
+ style: {
1694
+ padding: "8px 16px",
1695
+ fontSize: 11,
1696
+ fontWeight: 600,
1697
+ textTransform: "uppercase",
1698
+ color: "#9ca3af",
1699
+ background: "#f9fafb"
1700
+ },
1701
+ children: "Issues"
1702
+ }
1703
+ ),
1704
+ h.map((p, m) => /* @__PURE__ */ s.jsx(
1705
+ Ft,
1706
+ {
1707
+ issue: p,
1708
+ isSelected: u.length + m === i,
1709
+ onClick: () => k(p)
1710
+ },
1711
+ p.id
1712
+ ))
1713
+ ] })
1714
+ ] })
1715
+ }
1716
+ ),
1717
+ /* @__PURE__ */ s.jsxs(
1718
+ "div",
1719
+ {
1720
+ style: {
1721
+ padding: "8px 16px",
1722
+ borderTop: "1px solid #e5e7eb",
1723
+ fontSize: 12,
1724
+ color: "#9ca3af",
1725
+ display: "flex",
1726
+ gap: 16
1727
+ },
1728
+ children: [
1729
+ /* @__PURE__ */ s.jsx("span", { children: "↑↓ Navigate" }),
1730
+ /* @__PURE__ */ s.jsx("span", { children: "↵ Select" }),
1731
+ /* @__PURE__ */ s.jsx("span", { children: "Esc Close" })
1732
+ ]
1733
+ }
1734
+ )
1208
1735
  ]
1209
1736
  }
1210
1737
  )
1211
1738
  }
1212
1739
  ),
1213
- m
1740
+ I
1214
1741
  );
1215
1742
  }
1216
- function ft({ issue: e }) {
1217
- const t = e.severity === "error" ? oe : e.severity === "warning" ? ne : re;
1218
- return /* @__PURE__ */ i.jsxs("div", { style: { padding: 16 }, children: [
1219
- /* @__PURE__ */ i.jsxs("div", { style: {
1743
+ function Wt({ issue: t }) {
1744
+ const e = t.severity === "error" ? re : t.severity === "warning" ? se : ie;
1745
+ return /* @__PURE__ */ s.jsxs("div", { style: { padding: 16 }, children: [
1746
+ /* @__PURE__ */ s.jsxs("div", { style: {
1220
1747
  display: "flex",
1221
1748
  alignItems: "flex-start",
1222
1749
  gap: 12,
1223
1750
  marginBottom: 16
1224
1751
  }, children: [
1225
- /* @__PURE__ */ i.jsx(t, { size: 24, color: ie(e.severity) }),
1226
- /* @__PURE__ */ i.jsxs("div", { children: [
1227
- /* @__PURE__ */ i.jsx("div", { style: {
1752
+ /* @__PURE__ */ s.jsx(e, { size: 24, color: le(t.severity) }),
1753
+ /* @__PURE__ */ s.jsxs("div", { children: [
1754
+ /* @__PURE__ */ s.jsx("div", { style: {
1228
1755
  fontSize: 16,
1229
1756
  fontWeight: 600,
1230
1757
  color: "#111827"
1231
- }, children: e.message }),
1232
- /* @__PURE__ */ i.jsx("div", { style: {
1758
+ }, children: t.message }),
1759
+ /* @__PURE__ */ s.jsx("div", { style: {
1233
1760
  fontSize: 12,
1234
1761
  color: "#6b7280",
1235
1762
  marginTop: 4
1236
- }, children: e.severity.toUpperCase() })
1763
+ }, children: t.severity.toUpperCase() })
1237
1764
  ] })
1238
1765
  ] }),
1239
- /* @__PURE__ */ i.jsxs("div", { style: {
1766
+ /* @__PURE__ */ s.jsxs("div", { style: {
1240
1767
  background: "#f9fafb",
1241
1768
  borderRadius: 8,
1242
1769
  padding: 12
1243
1770
  }, children: [
1244
- /* @__PURE__ */ i.jsx(q, { icon: /* @__PURE__ */ i.jsx(Se, { size: 14 }), label: "File", value: e.filePath }),
1245
- /* @__PURE__ */ i.jsx(q, { icon: /* @__PURE__ */ i.jsx("span", { children: "📍" }), label: "Line", value: `${e.line}${e.column ? `:${e.column}` : ""}` }),
1246
- /* @__PURE__ */ i.jsx(q, { icon: /* @__PURE__ */ i.jsx(Ie, { size: 14 }), label: "Rule", value: e.ruleId }),
1247
- /* @__PURE__ */ i.jsx(q, { icon: /* @__PURE__ */ i.jsx("span", { children: "🔌" }), label: "Plugin", value: e.pluginId })
1771
+ /* @__PURE__ */ s.jsx(K, { icon: /* @__PURE__ */ s.jsx(Re, { size: 14 }), label: "File", value: t.filePath }),
1772
+ /* @__PURE__ */ s.jsx(K, { icon: /* @__PURE__ */ s.jsx("span", { children: "📍" }), label: "Line", value: `${t.line}${t.column ? `:${t.column}` : ""}` }),
1773
+ /* @__PURE__ */ s.jsx(K, { icon: /* @__PURE__ */ s.jsx(je, { size: 14 }), label: "Rule", value: t.ruleId }),
1774
+ /* @__PURE__ */ s.jsx(K, { icon: /* @__PURE__ */ s.jsx("span", { children: "🔌" }), label: "Plugin", value: t.pluginId })
1248
1775
  ] }),
1249
- e.dataLoc && /* @__PURE__ */ i.jsxs("div", { style: { marginTop: 16 }, children: [
1250
- /* @__PURE__ */ i.jsx("div", { style: { fontSize: 12, color: "#6b7280", marginBottom: 4 }, children: "Data Location" }),
1251
- /* @__PURE__ */ i.jsx("code", { style: {
1776
+ t.dataLoc && /* @__PURE__ */ s.jsxs("div", { style: { marginTop: 16 }, children: [
1777
+ /* @__PURE__ */ s.jsx("div", { style: { fontSize: 12, color: "#6b7280", marginBottom: 4 }, children: "Data Location" }),
1778
+ /* @__PURE__ */ s.jsx("code", { style: {
1252
1779
  display: "block",
1253
1780
  padding: 8,
1254
1781
  background: "#1f2937",
@@ -1257,27 +1784,27 @@ function ft({ issue: e }) {
1257
1784
  fontSize: 12,
1258
1785
  fontFamily: "monospace",
1259
1786
  wordBreak: "break-all"
1260
- }, children: e.dataLoc })
1787
+ }, children: t.dataLoc })
1261
1788
  ] })
1262
1789
  ] });
1263
1790
  }
1264
- function q({ icon: e, label: t, value: n }) {
1265
- return /* @__PURE__ */ i.jsxs("div", { style: {
1791
+ function K({ icon: t, label: e, value: n }) {
1792
+ return /* @__PURE__ */ s.jsxs("div", { style: {
1266
1793
  display: "flex",
1267
1794
  alignItems: "center",
1268
1795
  gap: 8,
1269
1796
  padding: "6px 0",
1270
1797
  borderBottom: "1px solid #e5e7eb"
1271
1798
  }, children: [
1272
- e,
1273
- /* @__PURE__ */ i.jsx("span", { style: { fontSize: 12, color: "#6b7280", width: 50 }, children: t }),
1274
- /* @__PURE__ */ i.jsx("span", { style: { fontSize: 13, color: "#111827", flex: 1, wordBreak: "break-word" }, children: n })
1799
+ t,
1800
+ /* @__PURE__ */ s.jsx("span", { style: { fontSize: 12, color: "#6b7280", width: 50 }, children: e }),
1801
+ /* @__PURE__ */ s.jsx("span", { style: { fontSize: 13, color: "#111827", flex: 1, wordBreak: "break-word" }, children: n })
1275
1802
  ] });
1276
1803
  }
1277
- function pt({ dataLoc: e, onSelectIssue: t }) {
1278
- const { getIssuesForDataLoc: n } = Ee(), o = n(e);
1279
- return o.length === 0 ? /* @__PURE__ */ i.jsx("div", { style: { padding: 16, textAlign: "center", color: "#6b7280" }, children: "No issues for this element" }) : /* @__PURE__ */ i.jsxs("div", { style: { padding: 16 }, children: [
1280
- /* @__PURE__ */ i.jsxs("div", { style: {
1804
+ function Ut({ dataLoc: t, onSelectIssue: e }) {
1805
+ const { getIssuesForDataLoc: n } = Te(), o = n(t);
1806
+ return o.length === 0 ? /* @__PURE__ */ s.jsx("div", { style: { padding: 16, textAlign: "center", color: "#6b7280" }, children: "No issues for this element" }) : /* @__PURE__ */ s.jsxs("div", { style: { padding: 16 }, children: [
1807
+ /* @__PURE__ */ s.jsxs("div", { style: {
1281
1808
  fontSize: 14,
1282
1809
  fontWeight: 600,
1283
1810
  color: "#111827",
@@ -1288,32 +1815,32 @@ function pt({ dataLoc: e, onSelectIssue: t }) {
1288
1815
  o.length !== 1 ? "s" : "",
1289
1816
  " at this location"
1290
1817
  ] }),
1291
- /* @__PURE__ */ i.jsx("div", { style: {
1818
+ /* @__PURE__ */ s.jsx("div", { style: {
1292
1819
  background: "#f9fafb",
1293
1820
  borderRadius: 8,
1294
1821
  overflow: "hidden"
1295
- }, children: o.map((r, s) => {
1296
- const c = r.severity === "error" ? oe : r.severity === "warning" ? ne : re;
1297
- return /* @__PURE__ */ i.jsxs(
1822
+ }, children: o.map((r, i) => {
1823
+ const l = r.severity === "error" ? re : r.severity === "warning" ? se : ie;
1824
+ return /* @__PURE__ */ s.jsxs(
1298
1825
  "div",
1299
1826
  {
1300
- onClick: () => t(r),
1827
+ onClick: () => e(r),
1301
1828
  style: {
1302
1829
  display: "flex",
1303
1830
  alignItems: "flex-start",
1304
1831
  gap: 10,
1305
1832
  padding: 12,
1306
1833
  cursor: "pointer",
1307
- borderBottom: s < o.length - 1 ? "1px solid #e5e7eb" : void 0
1834
+ borderBottom: i < o.length - 1 ? "1px solid #e5e7eb" : void 0
1308
1835
  },
1309
1836
  children: [
1310
- /* @__PURE__ */ i.jsx(c, { size: 16, color: ie(r.severity) }),
1311
- /* @__PURE__ */ i.jsxs("div", { style: { flex: 1 }, children: [
1312
- /* @__PURE__ */ i.jsx("div", { style: {
1837
+ /* @__PURE__ */ s.jsx(l, { size: 16, color: le(r.severity) }),
1838
+ /* @__PURE__ */ s.jsxs("div", { style: { flex: 1 }, children: [
1839
+ /* @__PURE__ */ s.jsx("div", { style: {
1313
1840
  fontSize: 13,
1314
1841
  color: "#111827"
1315
1842
  }, children: r.message }),
1316
- /* @__PURE__ */ i.jsx("div", { style: {
1843
+ /* @__PURE__ */ s.jsx("div", { style: {
1317
1844
  fontSize: 11,
1318
1845
  color: "#6b7280",
1319
1846
  marginTop: 2
@@ -1324,31 +1851,31 @@ function pt({ dataLoc: e, onSelectIssue: t }) {
1324
1851
  r.id
1325
1852
  );
1326
1853
  }) }),
1327
- /* @__PURE__ */ i.jsx("div", { style: {
1854
+ /* @__PURE__ */ s.jsx("div", { style: {
1328
1855
  marginTop: 12,
1329
1856
  fontSize: 11,
1330
1857
  color: "#9ca3af",
1331
1858
  wordBreak: "break-all"
1332
- }, children: e })
1859
+ }, children: t })
1333
1860
  ] });
1334
1861
  }
1335
- function ht() {
1336
- const e = x((f) => f.inspector.open), t = x((f) => f.inspector.panelId), n = x((f) => f.inspector.data), o = x((f) => f.inspector.width), r = x((f) => f.closeInspector), s = x((f) => f.openInspector);
1337
- if (!e) return null;
1338
- const c = (f) => {
1339
- s("issue", { issue: f });
1862
+ function Ht() {
1863
+ const t = v((u) => u.inspector.open), e = v((u) => u.inspector.panelId), n = v((u) => u.inspector.data), o = v((u) => u.inspector.width), r = v((u) => u.closeInspector), i = v((u) => u.openInspector);
1864
+ if (!t) return null;
1865
+ const l = (u) => {
1866
+ i("issue", { issue: u });
1340
1867
  };
1341
- let a = null, u = "Inspector";
1342
- t === "issue" && n?.issue ? (u = "Issue Details", a = /* @__PURE__ */ i.jsx(ft, { issue: n.issue })) : t === "element" && n?.dataLoc ? (u = "Element Issues", a = /* @__PURE__ */ i.jsx(
1343
- pt,
1868
+ let c = null, f = "Inspector";
1869
+ e === "issue" && n?.issue ? (f = "Issue Details", c = /* @__PURE__ */ s.jsx(Wt, { issue: n.issue })) : e === "element" && n?.dataLoc ? (f = "Element Issues", c = /* @__PURE__ */ s.jsx(
1870
+ Ut,
1344
1871
  {
1345
1872
  dataLoc: n.dataLoc,
1346
- onSelectIssue: c
1873
+ onSelectIssue: l
1347
1874
  }
1348
- )) : a = /* @__PURE__ */ i.jsx("div", { style: { padding: 16, color: "#6b7280", textAlign: "center" }, children: "Select an issue or element to inspect" });
1875
+ )) : c = /* @__PURE__ */ s.jsx("div", { style: { padding: 16, color: "#6b7280", textAlign: "center" }, children: "Select an issue or element to inspect" });
1349
1876
  const d = document.getElementById("uilint-portal") || document.body;
1350
- return U(
1351
- /* @__PURE__ */ i.jsxs(
1877
+ return Y(
1878
+ /* @__PURE__ */ s.jsxs(
1352
1879
  "div",
1353
1880
  {
1354
1881
  style: {
@@ -1365,15 +1892,15 @@ function ht() {
1365
1892
  flexDirection: "column"
1366
1893
  },
1367
1894
  children: [
1368
- /* @__PURE__ */ i.jsxs("div", { style: {
1895
+ /* @__PURE__ */ s.jsxs("div", { style: {
1369
1896
  display: "flex",
1370
1897
  alignItems: "center",
1371
1898
  justifyContent: "space-between",
1372
1899
  padding: "12px 16px",
1373
1900
  borderBottom: "1px solid #e5e7eb"
1374
1901
  }, children: [
1375
- /* @__PURE__ */ i.jsx("span", { style: { fontWeight: 600, color: "#111827" }, children: u }),
1376
- /* @__PURE__ */ i.jsx(
1902
+ /* @__PURE__ */ s.jsx("span", { style: { fontWeight: 600, color: "#111827" }, children: f }),
1903
+ /* @__PURE__ */ s.jsx(
1377
1904
  "button",
1378
1905
  {
1379
1906
  onClick: r,
@@ -1384,33 +1911,33 @@ function ht() {
1384
1911
  padding: 4,
1385
1912
  color: "#6b7280"
1386
1913
  },
1387
- children: /* @__PURE__ */ i.jsx(we, { size: 20 })
1914
+ children: /* @__PURE__ */ s.jsx(Ae, { size: 20 })
1388
1915
  }
1389
1916
  )
1390
1917
  ] }),
1391
- /* @__PURE__ */ i.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: a })
1918
+ /* @__PURE__ */ s.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: c })
1392
1919
  ]
1393
1920
  }
1394
1921
  ),
1395
1922
  d
1396
1923
  );
1397
1924
  }
1398
- function gt() {
1925
+ function Yt() {
1399
1926
  if (typeof document > "u") return;
1400
- let e = document.getElementById("uilint-portal");
1401
- return e || (e = document.createElement("div"), e.id = "uilint-portal", e.style.cssText = "position: fixed; top: 0; left: 0; z-index: 99990; pointer-events: none;", document.body.appendChild(e)), e;
1402
- }
1403
- function qt({ enabled: e = !0 }) {
1404
- return ct(), A(() => {
1405
- e && gt();
1406
- }, [e]), e ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1407
- /* @__PURE__ */ i.jsx(tt, {}),
1408
- /* @__PURE__ */ i.jsx(lt, {}),
1409
- /* @__PURE__ */ i.jsx(dt, {}),
1410
- /* @__PURE__ */ i.jsx(ht, {})
1927
+ let t = document.getElementById("uilint-portal");
1928
+ return t || (t = document.createElement("div"), t.id = "uilint-portal", t.style.cssText = "position: fixed; top: 0; left: 0; z-index: 99990; pointer-events: none;", document.body.appendChild(t)), t;
1929
+ }
1930
+ function Cn({ enabled: t = !0 }) {
1931
+ return $t(), z(() => {
1932
+ t && Yt();
1933
+ }, [t]), t ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1934
+ /* @__PURE__ */ s.jsx(At, {}),
1935
+ /* @__PURE__ */ s.jsx(zt, {}),
1936
+ /* @__PURE__ */ s.jsx(Bt, {}),
1937
+ /* @__PURE__ */ s.jsx(Ht, {})
1411
1938
  ] }) : null;
1412
1939
  }
1413
- const Gt = [
1940
+ const In = [
1414
1941
  "#3B82F6",
1415
1942
  // blue
1416
1943
  "#8B5CF6",
@@ -1435,10 +1962,10 @@ const Gt = [
1435
1962
  // teal
1436
1963
  "#A855F7"
1437
1964
  // purple
1438
- ], Kt = {
1965
+ ], En = {
1439
1966
  hideNodeModules: !0,
1440
1967
  autoScanEnabled: !1
1441
- }, j = "data-loc", ve = [
1968
+ }, N = "data-loc", Ce = [
1442
1969
  "#3B82F6",
1443
1970
  "#8B5CF6",
1444
1971
  "#EC4899",
@@ -1451,7 +1978,7 @@ const Gt = [
1451
1978
  "#F97316",
1452
1979
  "#14B8A6",
1453
1980
  "#A855F7"
1454
- ], mt = /* @__PURE__ */ new Set([
1981
+ ], qt = /* @__PURE__ */ new Set([
1455
1982
  "SCRIPT",
1456
1983
  "STYLE",
1457
1984
  "SVG",
@@ -1461,131 +1988,131 @@ const Gt = [
1461
1988
  "META",
1462
1989
  "LINK"
1463
1990
  ]);
1464
- function bt(e) {
1465
- let t = e.getAttribute(j);
1466
- if (!t) return null;
1467
- if (t.startsWith("loc:")) {
1468
- t = t.slice(4);
1469
- const a = t.lastIndexOf("#");
1470
- a !== -1 && (t = t.slice(0, a));
1991
+ function Gt(t) {
1992
+ let e = t.getAttribute(N);
1993
+ if (!e) return null;
1994
+ if (e.startsWith("loc:")) {
1995
+ e = e.slice(4);
1996
+ const c = e.lastIndexOf("#");
1997
+ c !== -1 && (e = e.slice(0, c));
1471
1998
  }
1472
- const n = t.split(":");
1999
+ const n = e.split(":");
1473
2000
  if (n.length < 2) return null;
1474
- const o = n[n.length - 1], r = n[n.length - 2], s = /^\d+$/.test(o), c = /^\d+$/.test(r);
1475
- if (s && c) {
1476
- const a = parseInt(o, 10), u = parseInt(r, 10), d = n.slice(0, -2).join(":");
1477
- return isNaN(u) || isNaN(a) || !d ? null : { fileName: d, lineNumber: u, columnNumber: a };
1478
- } else if (s) {
1479
- const a = parseInt(o, 10), u = n.slice(0, -1).join(":");
1480
- return isNaN(a) || !u ? null : { fileName: u, lineNumber: a };
2001
+ const o = n[n.length - 1], r = n[n.length - 2], i = /^\d+$/.test(o), l = /^\d+$/.test(r);
2002
+ if (i && l) {
2003
+ const c = parseInt(o, 10), f = parseInt(r, 10), d = n.slice(0, -2).join(":");
2004
+ return isNaN(f) || isNaN(c) || !d ? null : { fileName: d, lineNumber: f, columnNumber: c };
2005
+ } else if (i) {
2006
+ const c = parseInt(o, 10), f = n.slice(0, -1).join(":");
2007
+ return isNaN(c) || !f ? null : { fileName: f, lineNumber: c };
1481
2008
  }
1482
2009
  return null;
1483
2010
  }
1484
- function xt(e) {
1485
- return e.includes("node_modules");
2011
+ function Kt(t) {
2012
+ return t.includes("node_modules");
1486
2013
  }
1487
- function vt(e) {
1488
- const t = e.split("/");
1489
- return t[t.length - 1] || e;
2014
+ function Vt(t) {
2015
+ const e = t.split("/");
2016
+ return e[e.length - 1] || t;
1490
2017
  }
1491
- function yt(e) {
1492
- if (mt.has(e.tagName.toUpperCase()) || e.hasAttribute("data-ui-lint") || e.getAttribute("aria-hidden") === "true") return !0;
1493
- const t = window.getComputedStyle(e);
1494
- if (t.display === "none" || t.visibility === "hidden") return !0;
1495
- const n = e.getBoundingClientRect();
2018
+ function Jt(t) {
2019
+ if (qt.has(t.tagName.toUpperCase()) || t.hasAttribute("data-ui-lint") || t.getAttribute("aria-hidden") === "true") return !0;
2020
+ const e = window.getComputedStyle(t);
2021
+ if (e.display === "none" || e.visibility === "hidden") return !0;
2022
+ const n = t.getBoundingClientRect();
1496
2023
  return n.width === 0 || n.height === 0;
1497
2024
  }
1498
- function Vt(e = document.body, t = !0) {
2025
+ function kn(t = document.body, e = !0) {
1499
2026
  const n = [], o = /* @__PURE__ */ new Map();
1500
- wt();
1501
- const r = e.querySelectorAll(`[${j}]`);
1502
- for (const s of r) {
1503
- if (yt(s)) continue;
1504
- const c = bt(s);
1505
- if (!c || t && xt(c.fileName))
2027
+ Xt();
2028
+ const r = t.querySelectorAll(`[${N}]`);
2029
+ for (const i of r) {
2030
+ if (Jt(i)) continue;
2031
+ const l = Gt(i);
2032
+ if (!l || e && Kt(l.fileName))
1506
2033
  continue;
1507
- let a = s.getAttribute(j);
1508
- if (a.startsWith("loc:")) {
1509
- a = a.slice(4);
1510
- const f = a.lastIndexOf("#");
1511
- f !== -1 && (a = a.slice(0, f));
2034
+ let c = i.getAttribute(N);
2035
+ if (c.startsWith("loc:")) {
2036
+ c = c.slice(4);
2037
+ const u = c.lastIndexOf("#");
2038
+ u !== -1 && (c = c.slice(0, u));
1512
2039
  }
1513
- const u = (o.get(a) ?? 0) + 1;
1514
- o.set(a, u);
1515
- const d = `loc:${a}#${u}`;
1516
- s.setAttribute(j, d), n.push({
2040
+ const f = (o.get(c) ?? 0) + 1;
2041
+ o.set(c, f);
2042
+ const d = `loc:${c}#${f}`;
2043
+ i.setAttribute(N, d), n.push({
1517
2044
  id: d,
1518
- element: s,
1519
- tagName: s.tagName.toLowerCase(),
1520
- className: typeof s.className == "string" ? s.className : "",
1521
- source: c,
1522
- rect: s.getBoundingClientRect()
2045
+ element: i,
2046
+ tagName: i.tagName.toLowerCase(),
2047
+ className: typeof i.className == "string" ? i.className : "",
2048
+ source: l,
2049
+ rect: i.getBoundingClientRect()
1523
2050
  });
1524
2051
  }
1525
2052
  return n;
1526
2053
  }
1527
- function Jt(e) {
1528
- const t = /* @__PURE__ */ new Map();
1529
- for (const r of e) {
2054
+ function Pn(t) {
2055
+ const e = /* @__PURE__ */ new Map();
2056
+ for (const r of t) {
1530
2057
  if (!r.source) continue;
1531
- const s = r.source.fileName, c = t.get(s) || [];
1532
- c.push(r), t.set(s, c);
2058
+ const i = r.source.fileName, l = e.get(i) || [];
2059
+ l.push(r), e.set(i, l);
1533
2060
  }
1534
2061
  const n = [];
1535
2062
  let o = 0;
1536
- for (const [r, s] of t)
2063
+ for (const [r, i] of e)
1537
2064
  n.push({
1538
2065
  path: r,
1539
- displayName: vt(r),
1540
- color: ve[o % ve.length],
1541
- elements: s
2066
+ displayName: Vt(r),
2067
+ color: Ce[o % Ce.length],
2068
+ elements: i
1542
2069
  }), o++;
1543
- return n.sort((r, s) => s.elements.length - r.elements.length), n;
2070
+ return n.sort((r, i) => i.elements.length - r.elements.length), n;
1544
2071
  }
1545
- function wt() {
1546
- document.querySelectorAll(`[${j}]`).forEach((t) => {
1547
- const n = t.getAttribute(j);
2072
+ function Xt() {
2073
+ document.querySelectorAll(`[${N}]`).forEach((e) => {
2074
+ const n = e.getAttribute(N);
1548
2075
  if (n && n.startsWith("loc:")) {
1549
2076
  let o = n.slice(4);
1550
2077
  const r = o.lastIndexOf("#");
1551
- r !== -1 && (o = o.slice(0, r)), t.setAttribute(j, o);
2078
+ r !== -1 && (o = o.slice(0, r)), e.setAttribute(N, o);
1552
2079
  }
1553
2080
  });
1554
2081
  }
1555
- function Xt(e) {
1556
- return document.querySelector(`[${j}="${e}"]`);
2082
+ function Rn(t) {
2083
+ return document.querySelector(`[${N}="${t}"]`);
1557
2084
  }
1558
- function Zt(e) {
1559
- return e.map((t) => ({
1560
- ...t,
1561
- rect: t.element.getBoundingClientRect()
2085
+ function jn(t) {
2086
+ return t.map((e) => ({
2087
+ ...e,
2088
+ rect: e.element.getBoundingClientRect()
1562
2089
  }));
1563
2090
  }
1564
- function Qt(e, t = "cursor", n) {
1565
- const { fileName: o, lineNumber: r, columnNumber: s } = e, c = s ?? 1;
1566
- let a = o;
1567
- return n && !o.startsWith("/") && (a = `${n.endsWith("/") ? n.slice(0, -1) : n}/${o}`), t === "cursor" ? `cursor://file/${encodeURIComponent(
1568
- a
1569
- )}:${r}:${c}` : `vscode://file/${encodeURIComponent(
1570
- a
1571
- )}:${r}:${c}`;
1572
- }
1573
- const D = /* @__PURE__ */ new Map(), se = 300 * 1e3, St = "/api/.uilint/source";
1574
- async function Ce(e) {
1575
- const t = D.get(e);
1576
- if (t && Date.now() - t.fetchedAt < se)
2091
+ function An(t, e = "cursor", n) {
2092
+ const { fileName: o, lineNumber: r, columnNumber: i } = t, l = i ?? 1;
2093
+ let c = o;
2094
+ return n && !o.startsWith("/") && (c = `${n.endsWith("/") ? n.slice(0, -1) : n}/${o}`), e === "cursor" ? `cursor://file/${encodeURIComponent(
2095
+ c
2096
+ )}:${r}:${l}` : `vscode://file/${encodeURIComponent(
2097
+ c
2098
+ )}:${r}:${l}`;
2099
+ }
2100
+ const F = /* @__PURE__ */ new Map(), ae = 300 * 1e3, Zt = "/api/.uilint/source";
2101
+ async function _e(t) {
2102
+ const e = F.get(t);
2103
+ if (e && Date.now() - e.fetchedAt < ae)
1577
2104
  return {
1578
- content: t.content,
1579
- relativePath: t.relativePath
2105
+ content: e.content,
2106
+ relativePath: e.relativePath
1580
2107
  };
1581
2108
  try {
1582
2109
  const n = await fetch(
1583
- `${St}?path=${encodeURIComponent(e)}`
2110
+ `${Zt}?path=${encodeURIComponent(t)}`
1584
2111
  );
1585
2112
  if (!n.ok)
1586
2113
  return console.warn(`[UILint] Failed to fetch source: ${n.statusText}`), null;
1587
2114
  const o = await n.json();
1588
- return D.set(e, {
2115
+ return F.set(t, {
1589
2116
  ...o,
1590
2117
  fetchedAt: Date.now()
1591
2118
  }), o;
@@ -1593,40 +2120,40 @@ async function Ce(e) {
1593
2120
  return console.error("[UILint] Error fetching source:", n), null;
1594
2121
  }
1595
2122
  }
1596
- async function en(e, t = 5) {
1597
- const n = await Ce(e.fileName);
2123
+ async function Tn(t, e = 5) {
2124
+ const n = await _e(t.fileName);
1598
2125
  if (!n) return null;
1599
2126
  const o = n.content.split(`
1600
- `), r = e.lineNumber - 1, s = Math.max(0, r - t), c = Math.min(o.length, r + t + 1);
2127
+ `), r = t.lineNumber - 1, i = Math.max(0, r - e), l = Math.min(o.length, r + e + 1);
1601
2128
  return {
1602
- lines: o.slice(s, c),
1603
- startLine: s + 1,
2129
+ lines: o.slice(i, l),
2130
+ startLine: i + 1,
1604
2131
  // Back to 1-indexed
1605
- highlightLine: e.lineNumber,
2132
+ highlightLine: t.lineNumber,
1606
2133
  relativePath: n.relativePath
1607
2134
  };
1608
2135
  }
1609
- function tn() {
1610
- D.clear();
2136
+ function _n() {
2137
+ F.clear();
1611
2138
  }
1612
- function nn(e) {
1613
- const t = D.get(e);
1614
- return t ? Date.now() - t.fetchedAt >= se ? (D.delete(e), null) : {
1615
- content: t.content,
1616
- relativePath: t.relativePath
2139
+ function Nn(t) {
2140
+ const e = F.get(t);
2141
+ return e ? Date.now() - e.fetchedAt >= ae ? (F.delete(t), null) : {
2142
+ content: e.content,
2143
+ relativePath: e.relativePath
1617
2144
  } : null;
1618
2145
  }
1619
- async function on(e) {
1620
- const t = [...new Set(e)].filter((o) => {
1621
- const r = D.get(o);
1622
- return !r || Date.now() - r.fetchedAt >= se;
2146
+ async function Ln(t) {
2147
+ const e = [...new Set(t)].filter((o) => {
2148
+ const r = F.get(o);
2149
+ return !r || Date.now() - r.fetchedAt >= ae;
1623
2150
  }), n = 5;
1624
- for (let o = 0; o < t.length; o += n) {
1625
- const r = t.slice(o, o + n);
1626
- await Promise.all(r.map(Ce));
2151
+ for (let o = 0; o < e.length; o += n) {
2152
+ const r = e.slice(o, o + n);
2153
+ await Promise.all(r.map(_e));
1627
2154
  }
1628
2155
  }
1629
- const V = "data-elements", It = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "SVG", "NOSCRIPT", "TEMPLATE"]), Et = /* @__PURE__ */ new Set([
2156
+ const X = "data-elements", Qt = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "SVG", "NOSCRIPT", "TEMPLATE"]), en = /* @__PURE__ */ new Set([
1630
2157
  "HEADER",
1631
2158
  "NAV",
1632
2159
  "MAIN",
@@ -1634,124 +2161,124 @@ const V = "data-elements", It = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "SVG
1634
2161
  "SECTION",
1635
2162
  "ARTICLE",
1636
2163
  "ASIDE"
1637
- ]), G = {
2164
+ ]), V = {
1638
2165
  button: /\b(btn|button)\b/i,
1639
2166
  card: /\b(card)\b/i,
1640
2167
  input: /\b(input|field|form-control)\b/i,
1641
2168
  link: /\b(link)\b/i
1642
2169
  };
1643
- let je = 0;
1644
- function Ct() {
1645
- document.querySelectorAll(`[${V}]`).forEach((t) => t.removeAttribute(V)), je = 0;
2170
+ let Ne = 0;
2171
+ function tn() {
2172
+ document.querySelectorAll(`[${X}]`).forEach((e) => e.removeAttribute(X)), Ne = 0;
1646
2173
  }
1647
- function jt() {
1648
- return `el-${++je}`;
2174
+ function nn() {
2175
+ return `el-${++Ne}`;
1649
2176
  }
1650
- function kt(e, t = 50) {
1651
- const n = e.trim().replace(/\s+/g, " ");
1652
- return n.length <= t ? n : n.slice(0, t - 3) + "...";
2177
+ function on(t, e = 50) {
2178
+ const n = t.trim().replace(/\s+/g, " ");
2179
+ return n.length <= e ? n : n.slice(0, e - 3) + "...";
1653
2180
  }
1654
- function Rt(e, t) {
1655
- const n = e.getAttribute("role");
2181
+ function rn(t, e) {
2182
+ const n = t.getAttribute("role");
1656
2183
  if (n) {
1657
2184
  if (n === "button") return "button";
1658
2185
  if (n === "link") return "link";
1659
2186
  if (n === "textbox" || n === "searchbox") return "input";
1660
2187
  if (n === "heading") return "heading";
1661
2188
  }
1662
- const o = e.tagName.toUpperCase();
2189
+ const o = t.tagName.toUpperCase();
1663
2190
  if (o === "BUTTON") return "button";
1664
2191
  if (o === "A") return "link";
1665
2192
  if (o === "INPUT" || o === "TEXTAREA" || o === "SELECT") return "input";
1666
2193
  if (/^H[1-6]$/.test(o)) return "heading";
1667
- const r = e.getAttribute("data-ui-component");
2194
+ const r = t.getAttribute("data-ui-component");
1668
2195
  if (r) {
1669
- const a = r.toLowerCase();
1670
- if (a.includes("button")) return "button";
1671
- if (a.includes("card")) return "card";
1672
- if (a.includes("input") || a.includes("field")) return "input";
1673
- if (a.includes("link")) return "link";
2196
+ const c = r.toLowerCase();
2197
+ if (c.includes("button")) return "button";
2198
+ if (c.includes("card")) return "card";
2199
+ if (c.includes("input") || c.includes("field")) return "input";
2200
+ if (c.includes("link")) return "link";
1674
2201
  }
1675
- const s = e.className;
1676
- if (typeof s == "string") {
1677
- if (G.button.test(s)) return "button";
1678
- if (G.card.test(s)) return "card";
1679
- if (G.input.test(s)) return "input";
1680
- if (G.link.test(s)) return "link";
2202
+ const i = t.className;
2203
+ if (typeof i == "string") {
2204
+ if (V.button.test(i)) return "button";
2205
+ if (V.card.test(i)) return "card";
2206
+ if (V.input.test(i)) return "input";
2207
+ if (V.link.test(i)) return "link";
1681
2208
  }
1682
- if (Pt(e, t)) return "card";
1683
- if (Tt(t)) return "container";
1684
- const c = e.textContent?.trim() || "";
1685
- return c.length > 0 && c.length < 200 ? "text" : "other";
1686
- }
1687
- function Pt(e, t) {
1688
- if (e.children.length === 0) return !1;
1689
- const n = t.boxShadow && t.boxShadow !== "none", o = t.backgroundColor && t.backgroundColor !== "transparent" && t.backgroundColor !== "rgba(0, 0, 0, 0)", r = t.border && t.border !== "none" && !t.border.includes("0px"), s = t.borderRadius && t.borderRadius !== "0px";
1690
- return !!(n || (o || r) && s);
1691
- }
1692
- function Tt(e) {
1693
- const t = e.display;
1694
- if (t !== "flex" && t !== "grid") return !1;
1695
- const n = e.gap;
2209
+ if (sn(t, e)) return "card";
2210
+ if (ln(e)) return "container";
2211
+ const l = t.textContent?.trim() || "";
2212
+ return l.length > 0 && l.length < 200 ? "text" : "other";
2213
+ }
2214
+ function sn(t, e) {
2215
+ if (t.children.length === 0) return !1;
2216
+ const n = e.boxShadow && e.boxShadow !== "none", o = e.backgroundColor && e.backgroundColor !== "transparent" && e.backgroundColor !== "rgba(0, 0, 0, 0)", r = e.border && e.border !== "none" && !e.border.includes("0px"), i = e.borderRadius && e.borderRadius !== "0px";
2217
+ return !!(n || (o || r) && i);
2218
+ }
2219
+ function ln(t) {
2220
+ const e = t.display;
2221
+ if (e !== "flex" && e !== "grid") return !1;
2222
+ const n = t.gap;
1696
2223
  if (n && n !== "normal" && n !== "0px") return !0;
1697
- const o = e.padding;
2224
+ const o = t.padding;
1698
2225
  if (o && o !== "0px") {
1699
2226
  const r = o.match(/(\d+)px/);
1700
2227
  if (r && parseInt(r[1], 10) > 8) return !0;
1701
2228
  }
1702
2229
  return !1;
1703
2230
  }
1704
- function At(e) {
1705
- const t = [];
1706
- let n = e.parentElement;
1707
- for (; n && t.length < 3; ) {
2231
+ function an(t) {
2232
+ const e = [];
2233
+ let n = t.parentElement;
2234
+ for (; n && e.length < 3; ) {
1708
2235
  const o = n.tagName.toUpperCase();
1709
- Et.has(o) && t.unshift(o.toLowerCase()), n = n.parentElement;
2236
+ en.has(o) && e.unshift(o.toLowerCase()), n = n.parentElement;
1710
2237
  }
1711
- return t.join(" > ") || "root";
2238
+ return e.join(" > ") || "root";
1712
2239
  }
1713
- function _t(e) {
2240
+ function cn(t) {
1714
2241
  return {
1715
- fontSize: e.fontSize || void 0,
1716
- fontWeight: e.fontWeight || void 0,
1717
- color: e.color || void 0,
1718
- backgroundColor: e.backgroundColor === "rgba(0, 0, 0, 0)" ? void 0 : e.backgroundColor || void 0,
1719
- padding: e.padding === "0px" ? void 0 : e.padding || void 0,
1720
- borderRadius: e.borderRadius === "0px" ? void 0 : e.borderRadius || void 0,
1721
- border: e.border === "none" || e.border?.includes("0px") ? void 0 : e.border || void 0,
1722
- boxShadow: e.boxShadow === "none" ? void 0 : e.boxShadow || void 0,
1723
- gap: e.gap === "normal" || e.gap === "0px" ? void 0 : e.gap || void 0
2242
+ fontSize: t.fontSize || void 0,
2243
+ fontWeight: t.fontWeight || void 0,
2244
+ color: t.color || void 0,
2245
+ backgroundColor: t.backgroundColor === "rgba(0, 0, 0, 0)" ? void 0 : t.backgroundColor || void 0,
2246
+ padding: t.padding === "0px" ? void 0 : t.padding || void 0,
2247
+ borderRadius: t.borderRadius === "0px" ? void 0 : t.borderRadius || void 0,
2248
+ border: t.border === "none" || t.border?.includes("0px") ? void 0 : t.border || void 0,
2249
+ boxShadow: t.boxShadow === "none" ? void 0 : t.boxShadow || void 0,
2250
+ gap: t.gap === "normal" || t.gap === "0px" ? void 0 : t.gap || void 0
1724
2251
  };
1725
2252
  }
1726
- function ke(e) {
1727
- if (It.has(e.tagName.toUpperCase()) || e.hasAttribute("data-ui-lint-ignore") || e.getAttribute("aria-hidden") === "true") return !0;
1728
- const t = window.getComputedStyle(e);
1729
- return t.display === "none" || t.visibility === "hidden";
2253
+ function Le(t) {
2254
+ if (Qt.has(t.tagName.toUpperCase()) || t.hasAttribute("data-ui-lint-ignore") || t.getAttribute("aria-hidden") === "true") return !0;
2255
+ const e = window.getComputedStyle(t);
2256
+ return e.display === "none" || e.visibility === "hidden";
1730
2257
  }
1731
- function Nt(e) {
1732
- if (ke(e)) return null;
1733
- const t = window.getComputedStyle(e), n = Rt(e, t);
2258
+ function un(t) {
2259
+ if (Le(t)) return null;
2260
+ const e = window.getComputedStyle(t), n = rn(t, e);
1734
2261
  if (n === "other") return null;
1735
- const o = jt();
1736
- e.setAttribute(V, o);
1737
- const r = e.getBoundingClientRect(), s = e.textContent?.trim().slice(0, 100) || e.getAttribute("aria-label") || "";
2262
+ const o = nn();
2263
+ t.setAttribute(X, o);
2264
+ const r = t.getBoundingClientRect(), i = t.textContent?.trim().slice(0, 100) || t.getAttribute("aria-label") || "";
1738
2265
  return {
1739
2266
  id: o,
1740
- tag: e.tagName.toLowerCase(),
2267
+ tag: t.tagName.toLowerCase(),
1741
2268
  role: n,
1742
- text: kt(s),
1743
- component: e.getAttribute("data-ui-component") || void 0,
1744
- context: At(e),
1745
- styles: _t(t),
2269
+ text: on(i),
2270
+ component: t.getAttribute("data-ui-component") || void 0,
2271
+ context: an(t),
2272
+ styles: cn(e),
1746
2273
  rect: {
1747
2274
  width: Math.round(r.width),
1748
2275
  height: Math.round(r.height)
1749
2276
  }
1750
2277
  };
1751
2278
  }
1752
- function rn(e) {
1753
- Ct();
1754
- const t = e || document.body, n = {
2279
+ function On(t) {
2280
+ tn();
2281
+ const e = t || document.body, n = {
1755
2282
  buttons: [],
1756
2283
  headings: [],
1757
2284
  cards: [],
@@ -1759,35 +2286,35 @@ function rn(e) {
1759
2286
  inputs: [],
1760
2287
  containers: []
1761
2288
  }, o = document.createTreeWalker(
1762
- t,
2289
+ e,
1763
2290
  NodeFilter.SHOW_ELEMENT,
1764
2291
  {
1765
- acceptNode: (s) => ke(s) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
2292
+ acceptNode: (i) => Le(i) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1766
2293
  }
1767
2294
  );
1768
2295
  let r = o.currentNode;
1769
2296
  for (; r; ) {
1770
2297
  if (r instanceof Element) {
1771
- const s = Nt(r);
1772
- if (s)
1773
- switch (s.role) {
2298
+ const i = un(r);
2299
+ if (i)
2300
+ switch (i.role) {
1774
2301
  case "button":
1775
- n.buttons.push(s);
2302
+ n.buttons.push(i);
1776
2303
  break;
1777
2304
  case "heading":
1778
- n.headings.push(s);
2305
+ n.headings.push(i);
1779
2306
  break;
1780
2307
  case "card":
1781
- n.cards.push(s);
2308
+ n.cards.push(i);
1782
2309
  break;
1783
2310
  case "link":
1784
- n.links.push(s);
2311
+ n.links.push(i);
1785
2312
  break;
1786
2313
  case "input":
1787
- n.inputs.push(s);
2314
+ n.inputs.push(i);
1788
2315
  break;
1789
2316
  case "container":
1790
- n.containers.push(s);
2317
+ n.containers.push(i);
1791
2318
  break;
1792
2319
  }
1793
2320
  }
@@ -1795,86 +2322,86 @@ function rn(e) {
1795
2322
  }
1796
2323
  return n;
1797
2324
  }
1798
- function Re(e) {
1799
- return document.querySelector(`[${V}="${e}"]`);
2325
+ function Oe(t) {
2326
+ return document.querySelector(`[${X}="${t}"]`);
1800
2327
  }
1801
- function Lt() {
2328
+ function dn() {
1802
2329
  if (typeof document > "u")
1803
2330
  throw new Error("getUILintPortalHost() called outside of a DOM environment");
1804
2331
  return document.querySelector(".uilint-devtool-root") ?? document.body;
1805
2332
  }
1806
- const T = "#3b82f6", Ot = 14, Dt = 22, Mt = 2, Ft = 3, $ = 2;
1807
- function Bt(e, t = !1) {
2333
+ const O = "#3b82f6", fn = 14, pn = 22, gn = 2, hn = 3, U = 2;
2334
+ function mn(t, e = !1) {
1808
2335
  const n = [];
1809
- return e.forEach((o, r) => {
1810
- const s = Re(o);
1811
- if (!s) return;
1812
- const c = s.getBoundingClientRect();
2336
+ return t.forEach((o, r) => {
2337
+ const i = Oe(o);
2338
+ if (!i) return;
2339
+ const l = i.getBoundingClientRect();
1813
2340
  n.push({
1814
2341
  id: o,
1815
2342
  rect: {
1816
- top: c.top,
1817
- left: c.left,
1818
- width: c.width,
1819
- height: c.height
2343
+ top: l.top,
2344
+ left: l.left,
2345
+ width: l.width,
2346
+ height: l.height
1820
2347
  },
1821
- badgeNumber: t && e.length > 1 ? r + 1 : void 0
2348
+ badgeNumber: e && t.length > 1 ? r + 1 : void 0
1822
2349
  });
1823
2350
  }), n;
1824
2351
  }
1825
- function $t(e) {
1826
- const t = /* @__PURE__ */ new Set();
1827
- return e.forEach((n) => {
1828
- n.elementIds.forEach((o) => t.add(o));
1829
- }), t;
2352
+ function bn(t) {
2353
+ const e = /* @__PURE__ */ new Set();
2354
+ return t.forEach((n) => {
2355
+ n.elementIds.forEach((o) => e.add(o));
2356
+ }), e;
1830
2357
  }
1831
- function zt({ rect: e }) {
1832
- const [t, n] = C(!1), o = t ? Dt : Ot, r = t ? Ft : Mt, s = t ? 10 : 6;
1833
- return /* @__PURE__ */ i.jsxs(
2358
+ function yn({ rect: t }) {
2359
+ const [e, n] = T(!1), o = e ? pn : fn, r = e ? hn : gn, i = e ? 10 : 6;
2360
+ return /* @__PURE__ */ s.jsxs(
1834
2361
  "div",
1835
2362
  {
1836
2363
  onMouseEnter: () => n(!0),
1837
2364
  onMouseLeave: () => n(!1),
1838
2365
  style: {
1839
2366
  position: "fixed",
1840
- top: e.top - o / 2,
1841
- left: e.left + e.width - o / 2,
2367
+ top: t.top - o / 2,
2368
+ left: t.left + t.width - o / 2,
1842
2369
  width: o,
1843
2370
  height: o,
1844
- borderRadius: t ? 4 : 3,
1845
- backgroundColor: t ? T : "rgba(59, 130, 246, 0.15)",
1846
- border: `${r}px solid ${T}`,
2371
+ borderRadius: e ? 4 : 3,
2372
+ backgroundColor: e ? O : "rgba(59, 130, 246, 0.15)",
2373
+ border: `${r}px solid ${O}`,
1847
2374
  pointerEvents: "auto",
1848
2375
  cursor: "pointer",
1849
2376
  zIndex: 99997,
1850
- boxShadow: t ? "0 2px 8px rgba(59, 130, 246, 0.4)" : "0 0 4px rgba(59, 130, 246, 0.3)",
2377
+ boxShadow: e ? "0 2px 8px rgba(59, 130, 246, 0.4)" : "0 0 4px rgba(59, 130, 246, 0.3)",
1851
2378
  display: "flex",
1852
2379
  alignItems: "center",
1853
2380
  justifyContent: "center",
1854
2381
  transition: "all 0.15s ease-out"
1855
2382
  },
1856
2383
  children: [
1857
- /* @__PURE__ */ i.jsx(
2384
+ /* @__PURE__ */ s.jsx(
1858
2385
  "div",
1859
2386
  {
1860
2387
  style: {
1861
2388
  position: "absolute",
1862
- width: s,
2389
+ width: i,
1863
2390
  height: r,
1864
- backgroundColor: t ? "white" : T,
2391
+ backgroundColor: e ? "white" : O,
1865
2392
  borderRadius: 1,
1866
2393
  transition: "all 0.15s ease-out"
1867
2394
  }
1868
2395
  }
1869
2396
  ),
1870
- /* @__PURE__ */ i.jsx(
2397
+ /* @__PURE__ */ s.jsx(
1871
2398
  "div",
1872
2399
  {
1873
2400
  style: {
1874
2401
  position: "absolute",
1875
2402
  width: r,
1876
- height: s,
1877
- backgroundColor: t ? "white" : T,
2403
+ height: i,
2404
+ backgroundColor: e ? "white" : O,
1878
2405
  borderRadius: 1,
1879
2406
  transition: "all 0.15s ease-out"
1880
2407
  }
@@ -1884,40 +2411,40 @@ function zt({ rect: e }) {
1884
2411
  }
1885
2412
  );
1886
2413
  }
1887
- function Wt({
1888
- rect: e,
1889
- badgeNumber: t
2414
+ function xn({
2415
+ rect: t,
2416
+ badgeNumber: e
1890
2417
  }) {
1891
- return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1892
- /* @__PURE__ */ i.jsx(
2418
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2419
+ /* @__PURE__ */ s.jsx(
1893
2420
  "div",
1894
2421
  {
1895
2422
  style: {
1896
2423
  position: "fixed",
1897
- top: e.top - $,
1898
- left: e.left - $,
1899
- width: e.width + $ * 2,
1900
- height: e.height + $ * 2,
1901
- border: `${$}px solid ${T}`,
2424
+ top: t.top - U,
2425
+ left: t.left - U,
2426
+ width: t.width + U * 2,
2427
+ height: t.height + U * 2,
2428
+ border: `${U}px solid ${O}`,
1902
2429
  borderRadius: 4,
1903
- backgroundColor: `${T}10`,
2430
+ backgroundColor: `${O}10`,
1904
2431
  pointerEvents: "none",
1905
2432
  zIndex: 99998,
1906
2433
  transition: "all 0.15s ease-out"
1907
2434
  }
1908
2435
  }
1909
2436
  ),
1910
- t !== void 0 && /* @__PURE__ */ i.jsx(
2437
+ e !== void 0 && /* @__PURE__ */ s.jsx(
1911
2438
  "div",
1912
2439
  {
1913
2440
  style: {
1914
2441
  position: "fixed",
1915
- top: e.top - 12,
1916
- left: e.left - 4,
2442
+ top: t.top - 12,
2443
+ left: t.left - 4,
1917
2444
  minWidth: 20,
1918
2445
  height: 20,
1919
2446
  borderRadius: 10,
1920
- backgroundColor: T,
2447
+ backgroundColor: O,
1921
2448
  color: "white",
1922
2449
  fontSize: 11,
1923
2450
  fontWeight: 600,
@@ -1929,105 +2456,105 @@ function Wt({
1929
2456
  zIndex: 99999,
1930
2457
  fontFamily: "system-ui, -apple-system, sans-serif"
1931
2458
  },
1932
- children: t
2459
+ children: e
1933
2460
  }
1934
2461
  )
1935
2462
  ] });
1936
2463
  }
1937
- function sn({
1938
- violations: e,
1939
- selectedViolation: t,
2464
+ function zn({
2465
+ violations: t,
2466
+ selectedViolation: e,
1940
2467
  lockedViolation: n
1941
2468
  }) {
1942
- const [o, r] = C([]), [s, c] = C(
2469
+ const [o, r] = T([]), [i, l] = T(
1943
2470
  []
1944
- ), [a, u] = C(!1), d = n || t, f = I(() => {
2471
+ ), [c, f] = T(!1), d = n || e, u = E(() => {
1945
2472
  if (d) {
1946
2473
  r([]);
1947
2474
  return;
1948
2475
  }
1949
- const g = $t(e), R = [];
1950
- g.forEach((_) => {
1951
- const b = Re(_);
1952
- if (!b) return;
1953
- const S = b.getBoundingClientRect();
1954
- R.push({
1955
- id: _,
2476
+ const b = bn(t), k = [];
2477
+ b.forEach((R) => {
2478
+ const y = Oe(R);
2479
+ if (!y) return;
2480
+ const I = y.getBoundingClientRect();
2481
+ k.push({
2482
+ id: R,
1956
2483
  rect: {
1957
- top: S.top,
1958
- left: S.left,
1959
- width: S.width,
1960
- height: S.height
2484
+ top: I.top,
2485
+ left: I.left,
2486
+ width: I.width,
2487
+ height: I.height
1961
2488
  }
1962
2489
  });
1963
- }), r(R);
1964
- }, [e, d]), m = I(() => {
2490
+ }), r(k);
2491
+ }, [t, d]), h = E(() => {
1965
2492
  if (!d) {
1966
- c([]);
2493
+ l([]);
1967
2494
  return;
1968
2495
  }
1969
- const g = Bt(d.elementIds, !0);
1970
- c(g);
2496
+ const b = mn(d.elementIds, !0);
2497
+ l(b);
1971
2498
  }, [d]);
1972
- if (A(() => (u(!0), () => u(!1)), []), A(() => {
1973
- f(), m();
1974
- const g = () => {
1975
- f(), m();
2499
+ if (z(() => (f(!0), () => f(!1)), []), z(() => {
2500
+ u(), h();
2501
+ const b = () => {
2502
+ u(), h();
1976
2503
  };
1977
- return window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), () => {
1978
- window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
2504
+ return window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), () => {
2505
+ window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
1979
2506
  };
1980
- }, [f, m]), !a || e.length === 0) return null;
1981
- const p = /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1982
- !d && o.map((g) => /* @__PURE__ */ i.jsx(zt, { rect: g.rect }, g.id)),
1983
- d && s.map((g) => /* @__PURE__ */ i.jsx(Wt, { rect: g.rect, badgeNumber: g.badgeNumber }, g.id))
2507
+ }, [u, h]), !c || t.length === 0) return null;
2508
+ const x = /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2509
+ !d && o.map((b) => /* @__PURE__ */ s.jsx(yn, { rect: b.rect }, b.id)),
2510
+ d && i.map((b) => /* @__PURE__ */ s.jsx(xn, { rect: b.rect, badgeNumber: b.badgeNumber }, b.id))
1984
2511
  ] });
1985
- return U(p, Lt());
2512
+ return Y(x, dn());
1986
2513
  }
1987
2514
  export {
1988
- dt as CommandPalette,
1989
- sn as ConsistencyHighlighter,
1990
- j as DATA_UILINT_ID,
1991
- Kt as DEFAULT_SETTINGS,
1992
- Gt as FILE_COLORS,
1993
- tt as FloatingIcon,
1994
- ht as InspectorSidebar,
1995
- qt as UILint,
1996
- Qt as buildEditorUrl,
1997
- wt as cleanupDataAttributes,
1998
- Ct as cleanupDataElements,
1999
- tn as clearSourceCache,
2000
- hn as createEmptyStyleGuide,
2001
- rt as createIssueId,
2002
- rn as createSnapshot,
2003
- gn as createStyleSummary,
2004
- mn as extractStylesFromDOM,
2005
- Ce as fetchSource,
2006
- en as fetchSourceWithContext,
2007
- Yt as fromESLintIssue,
2008
- bn as generateStyleGuide,
2009
- nn as getCachedSource,
2010
- vt as getDisplayName,
2011
- Xt as getElementById,
2012
- Re as getElementBySnapshotId,
2013
- bt as getSourceFromDataLoc,
2014
- Jt as groupBySourceFile,
2015
- an as isBrowser,
2016
- un as isJSDOM,
2017
- dn as isNode,
2018
- xt as isNodeModulesPath,
2019
- xn as mergeStyleGuides,
2020
- ot as parseDataLoc,
2021
- vn as parseStyleGuide,
2022
- on as prefetchSources,
2023
- fn as scanDOM,
2024
- Vt as scanDOMForSources,
2025
- yn as serializeStyles,
2026
- it as severityFromNumber,
2027
- ie as severityToColor,
2028
- Zt as updateElementRects,
2029
- nt as useElementRects,
2030
- Ee as useIssues,
2031
- ct as useKeyboardShortcuts
2515
+ Bt as CommandPalette,
2516
+ zn as ConsistencyHighlighter,
2517
+ N as DATA_UILINT_ID,
2518
+ En as DEFAULT_SETTINGS,
2519
+ In as FILE_COLORS,
2520
+ At as FloatingIcon,
2521
+ Ht as InspectorSidebar,
2522
+ Cn as UILint,
2523
+ An as buildEditorUrl,
2524
+ Xt as cleanupDataAttributes,
2525
+ tn as cleanupDataElements,
2526
+ _n as clearSourceCache,
2527
+ Hn as createEmptyStyleGuide,
2528
+ Nt as createIssueId,
2529
+ On as createSnapshot,
2530
+ Yn as createStyleSummary,
2531
+ qn as extractStylesFromDOM,
2532
+ _e as fetchSource,
2533
+ Tn as fetchSourceWithContext,
2534
+ Sn as fromESLintIssue,
2535
+ Gn as generateStyleGuide,
2536
+ Nn as getCachedSource,
2537
+ Vt as getDisplayName,
2538
+ Rn as getElementById,
2539
+ Oe as getElementBySnapshotId,
2540
+ Gt as getSourceFromDataLoc,
2541
+ Pn as groupBySourceFile,
2542
+ Fn as isBrowser,
2543
+ Mn as isJSDOM,
2544
+ Bn as isNode,
2545
+ Kt as isNodeModulesPath,
2546
+ Kn as mergeStyleGuides,
2547
+ _t as parseDataLoc,
2548
+ Vn as parseStyleGuide,
2549
+ Ln as prefetchSources,
2550
+ Wn as scanDOM,
2551
+ kn as scanDOMForSources,
2552
+ Jn as serializeStyles,
2553
+ Lt as severityFromNumber,
2554
+ le as severityToColor,
2555
+ jn as updateElementRects,
2556
+ Tt as useElementRects,
2557
+ Te as useIssues,
2558
+ $t as useKeyboardShortcuts
2032
2559
  };
2033
2560
  //# sourceMappingURL=index.js.map