bippy 0.3.2 → 0.3.4
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/{chunk-LMTDJIAV.cjs → chunk-5UPESIXB.cjs} +9 -9
- package/dist/{chunk-OZZZ2ACU.cjs → chunk-HBEFN4VG.cjs} +68 -1
- package/dist/{chunk-AMVCK6H6.js → chunk-IXOVE6NU.js} +1 -1
- package/dist/{chunk-SI6Y374H.js → chunk-W6TIDV6X.js} +68 -2
- package/dist/{chunk-E67XFKKG.js → chunk-XG3B2MUK.js} +1 -1
- package/dist/{chunk-J2F3EJOS.cjs → chunk-ZGXPNYXM.cjs} +2 -2
- package/dist/core.cjs +74 -70
- package/dist/core.d.cts +8 -1
- package/dist/core.d.ts +8 -1
- package/dist/core.js +1 -1
- package/dist/experiments/inspect.cjs +262 -513
- package/dist/experiments/inspect.d.cts +10 -5
- package/dist/experiments/inspect.d.ts +10 -5
- package/dist/experiments/inspect.js +237 -488
- package/dist/index.cjs +75 -71
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.js +2 -2
- package/dist/jsx-runtime.cjs +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/source.cjs +77 -73
- package/dist/source.d.cts +2 -2
- package/dist/source.d.ts +2 -2
- package/dist/source.global.js +2 -2
- package/dist/source.js +3 -3
- package/package.json +6 -5
- package/dist/experiments/shrinkwrap.cjs +0 -375
- package/dist/experiments/shrinkwrap.d.cts +0 -10
- package/dist/experiments/shrinkwrap.d.ts +0 -10
- package/dist/experiments/shrinkwrap.js +0 -370
- package/dist/shrinkwrap.global.js +0 -9
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
import '../chunk-E67XFKKG.js';
|
|
2
|
-
import { getFiberFromHostInstance, instrument, traverseFiber, isHostFiber } from '../chunk-SI6Y374H.js';
|
|
3
|
-
import '../chunk-EPG3GO3H.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @license bippy
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) Aiden Bai, Million Software, Inc.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
// src/experiments/shrinkwrap.ts
|
|
15
|
-
var getDpr = () => {
|
|
16
|
-
return Math.min(window.devicePixelRatio || 1, 2);
|
|
17
|
-
};
|
|
18
|
-
var CANVAS_HTML_STR = `<canvas style="position:fixed;top:0;left:0;pointer-events:none;z-index:2147483646" aria-hidden="true"></canvas>`;
|
|
19
|
-
var COLORS = [
|
|
20
|
-
[255, 0, 0],
|
|
21
|
-
[0, 255, 0],
|
|
22
|
-
[0, 0, 255],
|
|
23
|
-
[255, 165, 0],
|
|
24
|
-
[128, 0, 128],
|
|
25
|
-
[0, 128, 128],
|
|
26
|
-
[255, 105, 180],
|
|
27
|
-
[75, 0, 130],
|
|
28
|
-
[255, 69, 0],
|
|
29
|
-
[46, 139, 87],
|
|
30
|
-
[220, 20, 60],
|
|
31
|
-
[70, 130, 180]
|
|
32
|
-
];
|
|
33
|
-
var interactiveElements = [
|
|
34
|
-
"a",
|
|
35
|
-
"button",
|
|
36
|
-
"details",
|
|
37
|
-
"embed",
|
|
38
|
-
"input",
|
|
39
|
-
"label",
|
|
40
|
-
"menu",
|
|
41
|
-
"menuitem",
|
|
42
|
-
"object",
|
|
43
|
-
"select",
|
|
44
|
-
"textarea",
|
|
45
|
-
"summary"
|
|
46
|
-
];
|
|
47
|
-
var interactiveRoles = [
|
|
48
|
-
"button",
|
|
49
|
-
"menu",
|
|
50
|
-
"menuitem",
|
|
51
|
-
"link",
|
|
52
|
-
"checkbox",
|
|
53
|
-
"radio",
|
|
54
|
-
"slider",
|
|
55
|
-
"tab",
|
|
56
|
-
"tabpanel",
|
|
57
|
-
"textbox",
|
|
58
|
-
"combobox",
|
|
59
|
-
"grid",
|
|
60
|
-
"listbox",
|
|
61
|
-
"option",
|
|
62
|
-
"progressbar",
|
|
63
|
-
"scrollbar",
|
|
64
|
-
"searchbox",
|
|
65
|
-
"switch",
|
|
66
|
-
"tree",
|
|
67
|
-
"treeitem",
|
|
68
|
-
"spinbutton",
|
|
69
|
-
"tooltip",
|
|
70
|
-
"a-button-inner",
|
|
71
|
-
"a-dropdown-button",
|
|
72
|
-
"click",
|
|
73
|
-
"menuitemcheckbox",
|
|
74
|
-
"menuitemradio",
|
|
75
|
-
"a-button-text",
|
|
76
|
-
"button-text",
|
|
77
|
-
"button-icon",
|
|
78
|
-
"button-icon-only",
|
|
79
|
-
"button-text-icon-only",
|
|
80
|
-
"dropdown",
|
|
81
|
-
"combobox"
|
|
82
|
-
];
|
|
83
|
-
var interactiveEvents = [
|
|
84
|
-
"click",
|
|
85
|
-
"mousedown",
|
|
86
|
-
"mouseup",
|
|
87
|
-
"touchstart",
|
|
88
|
-
"touchend",
|
|
89
|
-
"keydown",
|
|
90
|
-
"keyup",
|
|
91
|
-
"focus",
|
|
92
|
-
"blur"
|
|
93
|
-
];
|
|
94
|
-
var isScrollable = (element) => {
|
|
95
|
-
const isScrollable2 = element.hasAttribute("aria-scrollable") || element.hasAttribute("scrollable") || "style" in element && (element.style.overflow === "auto" || element.style.overflow === "scroll" || element.style.overflowY === "auto" || element.style.overflowY === "scroll" || element.style.overflowX === "auto" || element.style.overflowX === "scroll");
|
|
96
|
-
return isScrollable2;
|
|
97
|
-
};
|
|
98
|
-
var isInteractive = (element) => {
|
|
99
|
-
const fiber = getFiberFromHostInstance(element);
|
|
100
|
-
if (fiber?.stateNode instanceof Element) {
|
|
101
|
-
for (const propName of Object.keys(fiber.memoizedProps || {})) {
|
|
102
|
-
if (!propName.startsWith("on")) continue;
|
|
103
|
-
const event = propName.slice(2).toLowerCase().replace(/capture$/, "");
|
|
104
|
-
if (!interactiveEvents.includes(event)) continue;
|
|
105
|
-
if (fiber.memoizedProps[propName]) {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
for (const event of interactiveEvents) {
|
|
111
|
-
const dotOnHandler = element[`on${event}`];
|
|
112
|
-
const explicitOnHandler = element.hasAttribute(`on${event}`);
|
|
113
|
-
const ngClick = element.hasAttribute(`ng-${event}`);
|
|
114
|
-
const atClick = element.hasAttribute(`@${event}`);
|
|
115
|
-
const vOnClick = element.hasAttribute(`v-on:${event}`);
|
|
116
|
-
if (dotOnHandler || explicitOnHandler || ngClick || atClick || vOnClick) {
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
const tagName = element.tagName.toLowerCase();
|
|
121
|
-
const role = element.getAttribute("role");
|
|
122
|
-
const ariaRole = element.getAttribute("aria-role");
|
|
123
|
-
const tabIndex = element.getAttribute("tabindex");
|
|
124
|
-
const hasInteractiveRole = interactiveElements.includes(tagName) || role && interactiveRoles.includes(role) || ariaRole && interactiveRoles.includes(ariaRole) || tabIndex !== null && tabIndex !== "-1";
|
|
125
|
-
const hasAriaProps = element.hasAttribute("aria-expanded") || element.hasAttribute("aria-pressed") || element.hasAttribute("aria-selected") || element.hasAttribute("aria-checked");
|
|
126
|
-
const isFormRelated = "form" in element && element.form !== void 0 || element.hasAttribute("contenteditable");
|
|
127
|
-
const isDraggable = "draggable" in element && element.draggable || element.getAttribute("draggable") === "true";
|
|
128
|
-
return hasInteractiveRole || isFormRelated || isDraggable || hasAriaProps;
|
|
129
|
-
};
|
|
130
|
-
var isElementVisible = (element) => {
|
|
131
|
-
const style = window.getComputedStyle(element);
|
|
132
|
-
return element.offsetWidth > 0 && element.offsetHeight > 0 && style.visibility !== "hidden" && style.display !== "none";
|
|
133
|
-
};
|
|
134
|
-
var isTopElement = (element) => {
|
|
135
|
-
const doc = element.ownerDocument;
|
|
136
|
-
if (doc !== window.document) {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
const shadowRoot = element.getRootNode();
|
|
140
|
-
if (shadowRoot instanceof ShadowRoot) {
|
|
141
|
-
const rect2 = element.getBoundingClientRect();
|
|
142
|
-
const point = {
|
|
143
|
-
x: rect2.left + rect2.width / 2,
|
|
144
|
-
y: rect2.top + rect2.height / 2
|
|
145
|
-
};
|
|
146
|
-
try {
|
|
147
|
-
const topEl = shadowRoot.elementFromPoint(point.x, point.y);
|
|
148
|
-
if (!topEl) return false;
|
|
149
|
-
let current = topEl;
|
|
150
|
-
while (current && current !== shadowRoot) {
|
|
151
|
-
if (current === element) return true;
|
|
152
|
-
current = current.parentElement;
|
|
153
|
-
}
|
|
154
|
-
return false;
|
|
155
|
-
} catch {
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
const rect = element.getBoundingClientRect();
|
|
160
|
-
const scrollX = window.scrollX;
|
|
161
|
-
const scrollY = window.scrollY;
|
|
162
|
-
const viewportTop = scrollY;
|
|
163
|
-
const viewportLeft = scrollX;
|
|
164
|
-
const viewportBottom = window.innerHeight + scrollY;
|
|
165
|
-
const viewportRight = window.innerWidth + scrollX;
|
|
166
|
-
const absTop = rect.top + scrollY;
|
|
167
|
-
const absLeft = rect.left + scrollX;
|
|
168
|
-
const absBottom = rect.bottom + scrollY;
|
|
169
|
-
const absRight = rect.right + scrollX;
|
|
170
|
-
if (absBottom < viewportTop || absTop > viewportBottom || absRight < viewportLeft || absLeft > viewportRight) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
try {
|
|
174
|
-
const centerX = rect.left + rect.width / 2;
|
|
175
|
-
const centerY = rect.top + rect.height / 2;
|
|
176
|
-
const point = {
|
|
177
|
-
x: centerX,
|
|
178
|
-
y: centerY
|
|
179
|
-
};
|
|
180
|
-
if (point.x < 0 || point.x >= window.innerWidth || point.y < 0 || point.y >= window.innerHeight) {
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
183
|
-
const topEl = document.elementFromPoint(point.x, point.y);
|
|
184
|
-
if (!topEl) return false;
|
|
185
|
-
let current = topEl;
|
|
186
|
-
while (current && current !== document.documentElement) {
|
|
187
|
-
if (current === element) return true;
|
|
188
|
-
current = current.parentElement;
|
|
189
|
-
}
|
|
190
|
-
return false;
|
|
191
|
-
} catch {
|
|
192
|
-
return true;
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
var createShrinkwrap = () => {
|
|
196
|
-
const draw = async (elements) => {
|
|
197
|
-
if (!ctx) return;
|
|
198
|
-
const rectMap = await getRectMap(elements);
|
|
199
|
-
clear();
|
|
200
|
-
const drawnLabelBounds = [];
|
|
201
|
-
let visibleCount = 0;
|
|
202
|
-
const visibleIndices = /* @__PURE__ */ new Map();
|
|
203
|
-
const viewportWidth = window.innerWidth;
|
|
204
|
-
const viewportHeight = window.innerHeight;
|
|
205
|
-
const COVERAGE_THRESHOLD = 0.97;
|
|
206
|
-
for (let i = 0, len = elements.length; i < len; i++) {
|
|
207
|
-
const element = elements[i];
|
|
208
|
-
const rect = rectMap.get(element);
|
|
209
|
-
if (!rect) continue;
|
|
210
|
-
const { width: width2, height: height2 } = rect;
|
|
211
|
-
const x = rect.x;
|
|
212
|
-
const y = rect.y;
|
|
213
|
-
if (width2 / viewportWidth > COVERAGE_THRESHOLD && height2 / viewportHeight > COVERAGE_THRESHOLD)
|
|
214
|
-
continue;
|
|
215
|
-
const text = `${visibleCount + 1}`;
|
|
216
|
-
const textSize = 16;
|
|
217
|
-
ctx.textRendering = "optimizeSpeed";
|
|
218
|
-
ctx.font = `${textSize}px monospace`;
|
|
219
|
-
const { width: textWidth } = ctx.measureText(text);
|
|
220
|
-
let labelY = y - textSize - 4;
|
|
221
|
-
if (labelY < 0) {
|
|
222
|
-
labelY = 0;
|
|
223
|
-
}
|
|
224
|
-
const labelBounds = {
|
|
225
|
-
x,
|
|
226
|
-
y: labelY,
|
|
227
|
-
width: textWidth + 4,
|
|
228
|
-
height: textSize + 4
|
|
229
|
-
};
|
|
230
|
-
const hasCollision = drawnLabelBounds.some(
|
|
231
|
-
(bound) => labelBounds.x < bound.x + bound.width && labelBounds.x + labelBounds.width > bound.x && labelBounds.y < bound.y + bound.height && labelBounds.y + labelBounds.height > bound.y
|
|
232
|
-
);
|
|
233
|
-
if (!hasCollision) {
|
|
234
|
-
drawnLabelBounds.push(labelBounds);
|
|
235
|
-
visibleCount++;
|
|
236
|
-
visibleIndices.set(element, visibleCount);
|
|
237
|
-
ctx.beginPath();
|
|
238
|
-
ctx.rect(x, y, width2, height2);
|
|
239
|
-
const color = COLORS[i % COLORS.length].join(",");
|
|
240
|
-
ctx.fillStyle = `rgba(${color},0.1)`;
|
|
241
|
-
ctx.strokeStyle = `rgba(${color})`;
|
|
242
|
-
ctx.fill();
|
|
243
|
-
ctx.stroke();
|
|
244
|
-
ctx.fillStyle = `rgba(${color})`;
|
|
245
|
-
ctx.fillRect(x, labelY, textWidth + 4, textSize + 4);
|
|
246
|
-
ctx.fillStyle = "rgba(255,255,255)";
|
|
247
|
-
ctx.fillText(text, x + 2, labelY + textSize);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return visibleIndices;
|
|
251
|
-
};
|
|
252
|
-
const clear = () => {
|
|
253
|
-
if (!ctx) return;
|
|
254
|
-
ctx.clearRect(0, 0, canvas.width / dpr, canvas.height / dpr);
|
|
255
|
-
};
|
|
256
|
-
const host = document.createElement("div");
|
|
257
|
-
host.setAttribute("data-react-scan", "true");
|
|
258
|
-
const root = host.attachShadow({ mode: "open" });
|
|
259
|
-
root.innerHTML = CANVAS_HTML_STR;
|
|
260
|
-
const canvas = root.firstChild;
|
|
261
|
-
let dpr = Math.min(window.devicePixelRatio || 1, 2);
|
|
262
|
-
const { innerWidth, innerHeight } = window;
|
|
263
|
-
canvas.style.width = `${innerWidth}px`;
|
|
264
|
-
canvas.style.height = `${innerHeight}px`;
|
|
265
|
-
const width = innerWidth * dpr;
|
|
266
|
-
const height = innerHeight * dpr;
|
|
267
|
-
canvas.width = width;
|
|
268
|
-
canvas.height = height;
|
|
269
|
-
const ctx = canvas.getContext("2d", { alpha: true });
|
|
270
|
-
if (ctx) {
|
|
271
|
-
ctx.scale(dpr, dpr);
|
|
272
|
-
}
|
|
273
|
-
root.appendChild(canvas);
|
|
274
|
-
document.documentElement.appendChild(host);
|
|
275
|
-
let isResizeScheduled = false;
|
|
276
|
-
const resizeHandler = () => {
|
|
277
|
-
if (!isResizeScheduled) {
|
|
278
|
-
isResizeScheduled = true;
|
|
279
|
-
setTimeout(() => {
|
|
280
|
-
const width2 = window.innerWidth;
|
|
281
|
-
const height2 = window.innerHeight;
|
|
282
|
-
dpr = getDpr();
|
|
283
|
-
canvas.style.width = `${width2}px`;
|
|
284
|
-
canvas.style.height = `${height2}px`;
|
|
285
|
-
canvas.width = width2 * dpr;
|
|
286
|
-
canvas.height = height2 * dpr;
|
|
287
|
-
if (ctx) {
|
|
288
|
-
ctx.resetTransform();
|
|
289
|
-
ctx.scale(dpr, dpr);
|
|
290
|
-
}
|
|
291
|
-
shrinkwrap.trackInteractive();
|
|
292
|
-
isResizeScheduled = false;
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
let isScrollScheduled = false;
|
|
297
|
-
const scrollHandler = () => {
|
|
298
|
-
if (isScrollScheduled) return;
|
|
299
|
-
isScrollScheduled = true;
|
|
300
|
-
setTimeout(() => {
|
|
301
|
-
requestAnimationFrame(() => {
|
|
302
|
-
shrinkwrap.trackInteractive();
|
|
303
|
-
});
|
|
304
|
-
isScrollScheduled = false;
|
|
305
|
-
}, 8);
|
|
306
|
-
};
|
|
307
|
-
const fiberRoots = /* @__PURE__ */ new Set();
|
|
308
|
-
const shrinkwrap = {
|
|
309
|
-
draw(elements) {
|
|
310
|
-
draw(elements).then((visibleIndices) => {
|
|
311
|
-
if (!visibleIndices) return;
|
|
312
|
-
const elementMap = {};
|
|
313
|
-
visibleIndices.forEach((index, element) => {
|
|
314
|
-
elementMap[index] = element;
|
|
315
|
-
});
|
|
316
|
-
window.shrinkwrap = {
|
|
317
|
-
elementMap
|
|
318
|
-
};
|
|
319
|
-
});
|
|
320
|
-
},
|
|
321
|
-
trackInteractive() {
|
|
322
|
-
instrument({
|
|
323
|
-
onCommitFiberRoot(_, root2) {
|
|
324
|
-
fiberRoots.add(root2);
|
|
325
|
-
const elements = [];
|
|
326
|
-
for (const fiberRoot of fiberRoots) {
|
|
327
|
-
traverseFiber(fiberRoot.current, (fiber) => {
|
|
328
|
-
if (isHostFiber(fiber) && isInteractive(fiber.stateNode) && isElementVisible(fiber.stateNode) && isTopElement(fiber.stateNode)) {
|
|
329
|
-
elements.push(fiber.stateNode);
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
shrinkwrap.draw(elements);
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
},
|
|
337
|
-
cleanup() {
|
|
338
|
-
fiberRoots.clear();
|
|
339
|
-
window.removeEventListener("scroll", scrollHandler);
|
|
340
|
-
window.removeEventListener("resize", resizeHandler);
|
|
341
|
-
document.documentElement.removeChild(host);
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
window.addEventListener("scroll", scrollHandler);
|
|
345
|
-
window.addEventListener("resize", resizeHandler);
|
|
346
|
-
return shrinkwrap;
|
|
347
|
-
};
|
|
348
|
-
var getRectMap = (elements) => {
|
|
349
|
-
return new Promise((resolve) => {
|
|
350
|
-
const rects = /* @__PURE__ */ new Map();
|
|
351
|
-
const observer = new IntersectionObserver((entries) => {
|
|
352
|
-
for (let i = 0, len = entries.length; i < len; i++) {
|
|
353
|
-
const entry = entries[i];
|
|
354
|
-
const element = entry.target;
|
|
355
|
-
const rect = entry.boundingClientRect;
|
|
356
|
-
if (entry.isIntersecting && rect.width && rect.height) {
|
|
357
|
-
rects.set(element, rect);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
observer.disconnect();
|
|
361
|
-
resolve(rects);
|
|
362
|
-
});
|
|
363
|
-
for (let i = 0, len = elements.length; i < len; i++) {
|
|
364
|
-
const element = elements[i];
|
|
365
|
-
observer.observe(element);
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
export { createShrinkwrap, getRectMap, isInteractive, isScrollable };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var Bippy=function(t){"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license bippy
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Aiden Bai, Million Software, Inc.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var e="bippy-0.3.2",n=Object.defineProperty,o=Object.prototype.hasOwnProperty,i=()=>{},r=t=>{try{Function.prototype.toString.call(t).indexOf("^_^")>-1&&setTimeout((()=>{throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")}))}catch{}},s=!1,c=void 0,a=(t=h())=>!!s||("function"==typeof t.inject&&(c=t.inject.toString()),Boolean(c?.includes("(injected)"))),l=new Set,u=t=>{const o=new Map;let s=0;const c={checkDCE:r,supportsFiber:!0,supportsFlight:!0,hasUnsupportedRendererAttached:!1,renderers:o,onCommitFiberRoot:i,onCommitFiberUnmount:i,onPostCommitFiberRoot:i,inject(t){const e=++s;return o.set(e,t),c._instrumentationIsActive||(c._instrumentationIsActive=!0,l.forEach((t=>t()))),e},_instrumentationSource:e,_instrumentationIsActive:!1};try{n(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{get:()=>c,set(e){if(e&&"object"==typeof e){const n=c.renderers;globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=e,n.size>0&&(n.forEach(((t,n)=>{e.renderers.set(n,t)})),d(t))}},configurable:!0,enumerable:!0});const e=window.hasOwnProperty;let o=!1;n(window,"hasOwnProperty",{value:function(){return o||"__REACT_DEVTOOLS_GLOBAL_HOOK__"!==arguments[0]?e.apply(this,arguments):(globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,o=!0,-0)},configurable:!0,writable:!0})}catch{d(t)}return c},d=t=>{t&&l.add(t);try{const n=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n)return;if(!n._instrumentationSource){if(n.checkDCE=r,n.supportsFiber=!0,n.supportsFlight=!0,n.hasUnsupportedRendererAttached=!1,n._instrumentationSource=e,n._instrumentationIsActive=!1,n.renderers.size)return n._instrumentationIsActive=!0,void l.forEach((t=>t()));const t=n.inject;if(a(n)&&!((t=h())=>"getFiberRoots"in t)()){s=!0;n.inject({scheduleRefresh(){}})&&(n._instrumentationIsActive=!0)}n.inject=e=>{const o=t(e);return n._instrumentationIsActive=!0,l.forEach((t=>t())),o}}(n.renderers.size||n._instrumentationIsActive||a())&&t?.()}catch{}},h=t=>o.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?(d(t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):u(t),m=t=>{switch(t.tag){case 5:case 26:case 27:return!0;default:return"string"==typeof t.type}},b=(t,e,n=!1)=>{if(!t)return null;if(!0===e(t))return t;let o=n?t.return:t.child;for(;o;){const t=b(o,e,n);if(t)return t;o=n?null:o.sibling}return null},f=[[255,0,0],[0,255,0],[0,0,255],[255,165,0],[128,0,128],[0,128,128],[255,105,180],[75,0,130],[255,69,0],[46,139,87],[220,20,60],[70,130,180]],w=["a","button","details","embed","input","label","menu","menuitem","object","select","textarea","summary"],p=["button","menu","menuitem","link","checkbox","radio","slider","tab","tabpanel","textbox","combobox","grid","listbox","option","progressbar","scrollbar","searchbox","switch","tree","treeitem","spinbutton","tooltip","a-button-inner","a-dropdown-button","click","menuitemcheckbox","menuitemradio","a-button-text","button-text","button-icon","button-icon-only","button-text-icon-only","dropdown","combobox"],g=["click","mousedown","mouseup","touchstart","touchend","keydown","keyup","focus","blur"],_=t=>{const e=(t=>{const e=h();for(const n of e.renderers.values())try{const e=n.findFiberByHostInstance?.(t);if(e)return e}catch{}if("object"==typeof t&&null!=t){if("_reactRootContainer"in t)return t._reactRootContainer?._internalRoot?.current?.child;for(const e in t)if(e.startsWith("__reactInternalInstance$")||e.startsWith("__reactFiber"))return t[e]||null}return null})(t);if(e?.stateNode instanceof Element)for(const t of Object.keys(e.memoizedProps||{})){if(!t.startsWith("on"))continue;const n=t.slice(2).toLowerCase().replace(/capture$/,"");if(g.includes(n)&&e.memoizedProps[t])return!0}for(const e of g){const n=t[`on${e}`],o=t.hasAttribute(`on${e}`),i=t.hasAttribute(`ng-${e}`),r=t.hasAttribute(`@${e}`),s=t.hasAttribute(`v-on:${e}`);if(n||o||i||r||s)return!0}const n=t.tagName.toLowerCase(),o=t.getAttribute("role"),i=t.getAttribute("aria-role"),r=t.getAttribute("tabindex"),s=w.includes(n)||o&&p.includes(o)||i&&p.includes(i)||null!==r&&"-1"!==r,c=t.hasAttribute("aria-expanded")||t.hasAttribute("aria-pressed")||t.hasAttribute("aria-selected")||t.hasAttribute("aria-checked"),a="form"in t&&void 0!==t.form||t.hasAttribute("contenteditable"),l="draggable"in t&&t.draggable||"true"===t.getAttribute("draggable");return s||a||l||c},y=t=>{const e=window.getComputedStyle(t);return t.offsetWidth>0&&t.offsetHeight>0&&"hidden"!==e.visibility&&"none"!==e.display},v=t=>{if(t.ownerDocument!==window.document)return!0;const e=t.getRootNode();if(e instanceof ShadowRoot){const n=t.getBoundingClientRect(),o={x:n.left+n.width/2,y:n.top+n.height/2};try{const n=e.elementFromPoint(o.x,o.y);if(!n)return!1;let i=n;for(;i&&i!==e;){if(i===t)return!0;i=i.parentElement}return!1}catch{return!0}}const n=t.getBoundingClientRect(),o=window.scrollX,i=window.scrollY,r=i,s=o,c=window.innerHeight+i,a=window.innerWidth+o,l=n.top+i,u=n.left+o,d=n.bottom+i,h=n.right+o;if(d<r||l>c||h<s||u>a)return!1;try{const e=n.left+n.width/2,o={x:e,y:n.top+n.height/2};if(o.x<0||o.x>=window.innerWidth||o.y<0||o.y>=window.innerHeight)return!0;const i=document.elementFromPoint(o.x,o.y);if(!i)return!1;let r=i;for(;r&&r!==document.documentElement;){if(r===t)return!0;r=r.parentElement}return!1}catch{return!0}},O=t=>new Promise((e=>{const n=new Map,o=new IntersectionObserver((t=>{for(let e=0,o=t.length;e<o;e++){const o=t[e],i=o.target,r=o.boundingClientRect;o.isIntersecting&&r.width&&r.height&&n.set(i,r)}o.disconnect(),e(n)}));for(let e=0,n=t.length;e<n;e++){const n=t[e];o.observe(n)}}));return t.createShrinkwrap=()=>{const t=()=>{u&&u.clearRect(0,0,i.width/r,i.height/r)},n=document.createElement("div");n.setAttribute("data-react-scan","true");const o=n.attachShadow({mode:"open"});o.innerHTML='<canvas style="position:fixed;top:0;left:0;pointer-events:none;z-index:2147483646" aria-hidden="true"></canvas>';const i=o.firstChild;let r=Math.min(window.devicePixelRatio||1,2);const{innerWidth:s,innerHeight:c}=window;i.style.width=`${s}px`,i.style.height=`${c}px`;const a=s*r,l=c*r;i.width=a,i.height=l;const u=i.getContext("2d",{alpha:!0});u&&u.scale(r,r),o.appendChild(i),document.documentElement.appendChild(n);let d=!1;const w=()=>{d||(d=!0,setTimeout((()=>{const t=window.innerWidth,e=window.innerHeight;r=Math.min(window.devicePixelRatio||1,2),i.style.width=`${t}px`,i.style.height=`${e}px`,i.width=t*r,i.height=e*r,u&&(u.resetTransform(),u.scale(r,r)),x.trackInteractive(),d=!1})))};let p=!1;const g=()=>{p||(p=!0,setTimeout((()=>{requestAnimationFrame((()=>{x.trackInteractive()})),p=!1}),8))},A=new Set,x={draw(e){(async e=>{if(!u)return;const n=await O(e);t();const o=[];let i=0;const r=new Map,s=window.innerWidth,c=window.innerHeight;for(let t=0,a=e.length;t<a;t++){const a=e[t],l=n.get(a);if(!l)continue;const{width:d,height:h}=l,m=l.x,b=l.y;if(d/s>.97&&h/c>.97)continue;const w=`${i+1}`,p=16;u.textRendering="optimizeSpeed",u.font=`${p}px monospace`;const{width:g}=u.measureText(w);let _=b-p-4;_<0&&(_=0);const y={x:m,y:_,width:g+4,height:p+4};if(!o.some((t=>y.x<t.x+t.width&&y.x+y.width>t.x&&y.y<t.y+t.height&&y.y+y.height>t.y))){o.push(y),i++,r.set(a,i),u.beginPath(),u.rect(m,b,d,h);const e=f[t%f.length].join(",");u.fillStyle=`rgba(${e},0.1)`,u.strokeStyle=`rgba(${e})`,u.fill(),u.stroke(),u.fillStyle=`rgba(${e})`,u.fillRect(m,_,g+4,p+4),u.fillStyle="rgba(255,255,255)",u.fillText(w,m+2,_+p)}}return r})(e).then((t=>{if(!t)return;const e={};t.forEach(((t,n)=>{e[t]=n})),window.shrinkwrap={elementMap:e}}))},trackInteractive(){var t;t={onCommitFiberRoot(t,e){A.add(e);const n=[];for(const t of A)b(t.current,(t=>{m(t)&&_(t.stateNode)&&y(t.stateNode)&&v(t.stateNode)&&n.push(t.stateNode)}));x.draw(n)}},h((()=>{const n=h();t.onActive?.(),n._instrumentationSource=t.name??e;const o=n.onCommitFiberRoot;t.onCommitFiberRoot&&(n.onCommitFiberRoot=(e,n,i)=>{o&&o(e,n,i),t.onCommitFiberRoot?.(e,n,i)});const i=n.onCommitFiberUnmount;t.onCommitFiberUnmount&&(n.onCommitFiberUnmount=(e,n)=>{i&&i(e,n),t.onCommitFiberUnmount?.(e,n)});const r=n.onPostCommitFiberRoot;t.onPostCommitFiberRoot&&(n.onPostCommitFiberRoot=(e,n)=>{r&&r(e,n),t.onPostCommitFiberRoot?.(e,n)})}))},cleanup(){A.clear(),window.removeEventListener("scroll",g),window.removeEventListener("resize",w),document.documentElement.removeChild(n)}};return window.addEventListener("scroll",g),window.addEventListener("resize",w),x},t.getRectMap=O,t.isInteractive=_,t.isScrollable=t=>t.hasAttribute("aria-scrollable")||t.hasAttribute("scrollable")||"style"in t&&("auto"===t.style.overflow||"scroll"===t.style.overflow||"auto"===t.style.overflowY||"scroll"===t.style.overflowY||"auto"===t.style.overflowX||"scroll"===t.style.overflowX),t}({});
|