devtools-guardian 1.0.1

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.mjs ADDED
@@ -0,0 +1,628 @@
1
+ // src/hooks/useDevToolsDetector.ts
2
+ import { useState, useEffect, useRef, useCallback } from "react";
3
+ var DEFAULT_BLOCKED_KEYS = [
4
+ // 'F12',
5
+ "Ctrl+Shift+I",
6
+ "Ctrl+Shift+J",
7
+ "Ctrl+Shift+C",
8
+ "Ctrl+U",
9
+ "Ctrl+S"
10
+ ];
11
+ var CONSOLE_STYLES = {
12
+ owner: "color:rgba(89, 255, 0, 1);font-size:28px;font-weight:900;font-family:monospace;text-shadow:0 0 10px rgba(89, 255, 0, 1);padding:5px 0;",
13
+ warning: "color:#FF8C00;font-size:22px;font-weight:800;font-family:monospace;text-shadow:0 0 10px rgba(255, 189, 0, 1);padding:5px 0;",
14
+ message: "color:red;font-size:14px;font-family:monospace;font-weight:bold;margin-bottom:8px;",
15
+ labelGreen: "color:#10b981;font-size:13px;font-family:monospace;font-weight:bold;",
16
+ linkPurple: "color:#6366f1;font-size:13px;font-family:monospace;text-decoration:underline;font-weight:bold;"
17
+ };
18
+ var isMobileDevice = () => {
19
+ if (typeof window === "undefined") return false;
20
+ return window.matchMedia("(pointer: coarse)").matches || /Mobi|Android|iPhone|iPad/i.test(navigator.userAgent);
21
+ };
22
+ var isDevMode = () => {
23
+ if (typeof process !== "undefined" && process.env?.NODE_ENV === "development") {
24
+ return true;
25
+ }
26
+ if (typeof window !== "undefined" && window.location) {
27
+ const hostname = window.location.hostname;
28
+ if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname.startsWith("192.168.") || hostname.startsWith("10.") || hostname.startsWith("172.")) {
29
+ return true;
30
+ }
31
+ }
32
+ return false;
33
+ };
34
+ function useDevToolsDetector(options = {}) {
35
+ const {
36
+ blockedKeys = DEFAULT_BLOCKED_KEYS,
37
+ disableRightClick = true,
38
+ disableSelection = true,
39
+ onDetect,
40
+ onClose,
41
+ pollInterval = 1500,
42
+ thresholdBuffer = 0
43
+ } = options;
44
+ const [isOpen, setIsOpen] = useState(false);
45
+ const isOpenRef = useRef(false);
46
+ const onDetectRef = useRef(onDetect);
47
+ const onCloseRef = useRef(onClose);
48
+ useEffect(() => {
49
+ onDetectRef.current = onDetect;
50
+ }, [onDetect]);
51
+ useEffect(() => {
52
+ onCloseRef.current = onClose;
53
+ }, [onClose]);
54
+ const triggerDetection = useCallback(() => {
55
+ if (!isOpenRef.current) {
56
+ isOpenRef.current = true;
57
+ setIsOpen(true);
58
+ onDetectRef.current?.();
59
+ }
60
+ }, []);
61
+ const triggerClose = useCallback(() => {
62
+ if (isOpenRef.current) {
63
+ isOpenRef.current = false;
64
+ setIsOpen(false);
65
+ onCloseRef.current?.();
66
+ }
67
+ }, []);
68
+ const printConsoleBranding = useCallback(() => {
69
+ console.clear();
70
+ console.log("%c Built with \u2764\uFE0F by Ali Arshad", CONSOLE_STYLES.owner);
71
+ console.log("%c \u26A0 UNAUTHORIZED REVERSE ENGINEERING DETECTED.", CONSOLE_STYLES.warning);
72
+ console.log(
73
+ "%c \u26A0 Stealing code harms innovation. Let's build together instead!",
74
+ CONSOLE_STYLES.message
75
+ );
76
+ console.log(
77
+ "%c \u26A0 Portfolio: %chttps://ali-arshad-110.github.io",
78
+ CONSOLE_STYLES.labelGreen,
79
+ CONSOLE_STYLES.linkPurple
80
+ );
81
+ }, []);
82
+ useEffect(() => {
83
+ const blockedSet = new Set(blockedKeys);
84
+ const handleKeyDown = (e) => {
85
+ const key = e.key.toLowerCase();
86
+ if (blockedSet.has("F12") && e.key === "F12") {
87
+ e.preventDefault();
88
+ triggerDetection();
89
+ return;
90
+ }
91
+ if (e.ctrlKey && e.shiftKey) {
92
+ if (blockedSet.has("Ctrl+Shift+I") && key === "i" || blockedSet.has("Ctrl+Shift+J") && key === "j" || blockedSet.has("Ctrl+Shift+C") && key === "c") {
93
+ e.preventDefault();
94
+ triggerDetection();
95
+ return;
96
+ }
97
+ }
98
+ if (blockedSet.has("Ctrl+U") && e.ctrlKey && key === "u") {
99
+ e.preventDefault();
100
+ triggerDetection();
101
+ return;
102
+ }
103
+ if (blockedSet.has("Ctrl+S") && e.ctrlKey && key === "s") {
104
+ e.preventDefault();
105
+ }
106
+ };
107
+ const handleContextMenu = (e) => {
108
+ if (disableRightClick) e.preventDefault();
109
+ };
110
+ window.addEventListener("keydown", handleKeyDown);
111
+ window.addEventListener("contextmenu", handleContextMenu);
112
+ return () => {
113
+ window.removeEventListener("keydown", handleKeyDown);
114
+ window.removeEventListener("contextmenu", handleContextMenu);
115
+ };
116
+ }, [blockedKeys, disableRightClick, triggerDetection]);
117
+ useEffect(() => {
118
+ const el = document.body;
119
+ if (disableSelection) {
120
+ el.style.userSelect = "none";
121
+ el.style.webkitUserSelect = "none";
122
+ }
123
+ return () => {
124
+ el.style.userSelect = "";
125
+ el.style.webkitUserSelect = "";
126
+ };
127
+ }, [disableSelection]);
128
+ useEffect(() => {
129
+ const checkDimensions = () => {
130
+ if (isMobileDevice()) return false;
131
+ const dpr = window.devicePixelRatio || 1;
132
+ const widthThreshold = Math.max(50, 160 / dpr) + thresholdBuffer;
133
+ const heightThreshold = Math.max(120, 250 / dpr) + thresholdBuffer;
134
+ return window.outerWidth - window.innerWidth > widthThreshold || window.outerHeight - window.innerHeight > heightThreshold;
135
+ };
136
+ const handleResize = () => {
137
+ if (checkDimensions()) triggerDetection();
138
+ };
139
+ window.addEventListener("resize", handleResize);
140
+ handleResize();
141
+ return () => window.removeEventListener("resize", handleResize);
142
+ }, [thresholdBuffer, triggerDetection]);
143
+ useEffect(() => {
144
+ let consoleGetterFired = false;
145
+ const sentinel = {
146
+ [Symbol.toPrimitive]() {
147
+ consoleGetterFired = true;
148
+ return "devtools-probe";
149
+ },
150
+ toString() {
151
+ consoleGetterFired = true;
152
+ return "devtools-probe";
153
+ }
154
+ };
155
+ const checkDebuggerTiming = () => {
156
+ if (isDevMode()) return false;
157
+ const t0 = performance.now();
158
+ debugger;
159
+ return performance.now() - t0 > 100;
160
+ };
161
+ const checkDimensions = () => {
162
+ if (isMobileDevice()) return false;
163
+ const dpr = window.devicePixelRatio || 1;
164
+ return window.outerWidth - window.innerWidth > Math.max(60, 80 / dpr) + thresholdBuffer || window.outerHeight - window.innerHeight > Math.max(80, 150 / dpr) + thresholdBuffer;
165
+ };
166
+ const tick = () => {
167
+ consoleGetterFired = false;
168
+ const _orig = console.log;
169
+ try {
170
+ console.log = (...args) => {
171
+ if (args[0] === sentinel) return;
172
+ _orig.apply(console, args);
173
+ };
174
+ console.log(sentinel);
175
+ } finally {
176
+ console.log = _orig;
177
+ }
178
+ setTimeout(() => {
179
+ const detected = consoleGetterFired || checkDimensions() || checkDebuggerTiming();
180
+ if (detected) {
181
+ triggerDetection();
182
+ printConsoleBranding();
183
+ } else {
184
+ triggerClose();
185
+ }
186
+ }, 50);
187
+ };
188
+ const intervalId = setInterval(tick, pollInterval);
189
+ tick();
190
+ return () => clearInterval(intervalId);
191
+ }, [pollInterval, thresholdBuffer, triggerDetection, triggerClose, printConsoleBranding]);
192
+ return isOpen;
193
+ }
194
+
195
+ // src/components/DevToolsWarningOverlay.tsx
196
+ import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
197
+ import { motion, AnimatePresence } from "framer-motion";
198
+
199
+ // #style-inject:#style-inject
200
+ function styleInject(css, { insertAt } = {}) {
201
+ if (!css || typeof document === "undefined") return;
202
+ const head = document.head || document.getElementsByTagName("head")[0];
203
+ const style = document.createElement("style");
204
+ style.type = "text/css";
205
+ if (insertAt === "top") {
206
+ if (head.firstChild) {
207
+ head.insertBefore(style, head.firstChild);
208
+ } else {
209
+ head.appendChild(style);
210
+ }
211
+ } else {
212
+ head.appendChild(style);
213
+ }
214
+ if (style.styleSheet) {
215
+ style.styleSheet.cssText = css;
216
+ } else {
217
+ style.appendChild(document.createTextNode(css));
218
+ }
219
+ }
220
+
221
+ // src/styles/index.css
222
+ styleInject('.dtg-overlay {\n position: fixed;\n inset: 0;\n z-index: 99999;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n background: rgba(3, 5, 8, 0.93);\n backdrop-filter: blur(6px);\n}\n.dtg-canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n opacity: 0.18;\n}\n.dtg-scanlines {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.dtg-vignette {\n position: absolute;\n inset: 0;\n pointer-events: none;\n background:\n radial-gradient(\n ellipse 60% 55% at 50% 50%,\n rgba(190, 18, 60, 0.07) 0%,\n transparent 70%);\n}\n.dtg-card {\n position: relative;\n width: 100%;\n max-width: 512px;\n margin-left: 16px;\n margin-right: 16px;\n border-radius: 12px;\n overflow: hidden;\n background: rgba(8, 12, 18, 0.92);\n border: 1px solid rgba(244, 63, 94, 0.2);\n box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.05), 0 32px 64px rgba(0, 0, 0, 0.6);\n}\n.dtg-card-padding {\n padding: 32px;\n}\n.dtg-neon-edge {\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n background:\n linear-gradient(\n 90deg,\n transparent 0%,\n #f43f5e 30%,\n #f43f5e 70%,\n transparent 100%);\n box-shadow: 0 0 6px 1px rgba(244, 63, 94, 0.6);\n}\n.dtg-neon-edge-top {\n top: 0;\n}\n.dtg-neon-edge-bottom {\n bottom: 0;\n}\n.dtg-pulse-dot {\n position: relative;\n display: flex;\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.dtg-pulse-dot-ping {\n position: absolute;\n display: inline-flex;\n height: 100%;\n width: 100%;\n border-radius: 9999px;\n opacity: 0.6;\n animation: dtg-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;\n}\n.dtg-pulse-dot-inner {\n position: relative;\n display: inline-flex;\n border-radius: 9999px;\n height: 10px;\n width: 10px;\n}\n@keyframes dtg-ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n.dtg-creator-grid {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 12px;\n padding-top: 4px;\n}\n.dtg-creator-card {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 6px;\n padding: 16px 8px;\n border-radius: 8px;\n border: 1px solid rgba(148, 163, 184, 0.12);\n background: rgba(15, 20, 30, 0.7);\n text-decoration: none;\n transition: all 0.2s ease-in-out;\n}\n.dtg-creator-icon {\n width: 36px;\n height: 36px;\n border-radius: 9999px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 2px;\n transition: background-color 0.2s, color 0.2s;\n}\n.dtg-creator-label {\n font-size: 13px;\n font-weight: 600;\n color: #e2e8f0;\n}\n.dtg-creator-sub {\n font-size: 10px;\n color: #64748b;\n letter-spacing: 0.025em;\n}\n.dtg-scan-container {\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n.dtg-flex-row {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.dtg-scan-title {\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.2em;\n text-transform: uppercase;\n color: #fb7185;\n}\n.dtg-steps-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dtg-step-item {\n display: flex;\n align-items: start;\n gap: 10px;\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n font-size: 14px;\n}\n.dtg-step-indicator {\n margin-top: 2px;\n width: 16px;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dtg-step-dot {\n width: 6px;\n height: 6px;\n border-radius: 9999px;\n background-color: #334155;\n display: inline-block;\n}\n.dtg-text-done {\n color: #64748b;\n text-decoration: line-through;\n text-decoration-color: #475569;\n}\n.dtg-text-active {\n color: #fda4af;\n font-weight: 500;\n}\n.dtg-text-pending {\n color: #475569;\n}\n.dtg-progress-track {\n width: 100%;\n height: 3px;\n border-radius: 9999px;\n overflow: hidden;\n background: rgba(255, 255, 255, 0.06);\n}\n.dtg-progress-fill {\n height: 100%;\n border-radius: 9999px;\n background:\n linear-gradient(\n 90deg,\n #be123c,\n #f43f5e,\n #fb7185);\n}\n.dtg-log-stream {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n font-size: 10px;\n color: #065f46;\n line-height: 1.625;\n display: flex;\n flex-direction: column;\n gap: 2px;\n opacity: 0.6;\n user-select: none;\n}\n.dtg-warning-container {\n text-align: center;\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n.dtg-shield-wrapper {\n display: inline-flex;\n padding: 16px;\n border-radius: 9999px;\n border: 1px solid rgba(244, 63, 94, 0.3);\n background: rgba(190, 18, 60, 0.12);\n box-shadow: 0 0 24px rgba(244, 63, 94, 0.18);\n margin: 0 auto;\n}\n.dtg-shield-icon {\n width: 40px;\n height: 40px;\n color: #f43f5e;\n}\n.dtg-warning-title {\n font-size: 20px;\n font-weight: 700;\n letter-spacing: 0.15em;\n text-transform: uppercase;\n color: #f43f5e;\n text-shadow: 0 0 20px rgba(244, 63, 94, 0.35);\n margin: 0;\n}\n.dtg-divider {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n margin: 0 auto;\n width: 100%;\n max-width: 320px;\n}\n.dtg-divider-line {\n flex: 1 1 0%;\n height: 1px;\n background:\n linear-gradient(\n 90deg,\n transparent,\n rgba(244, 63, 94, 0.4));\n}\n.dtg-divider-line-rev {\n flex: 1 1 0%;\n height: 1px;\n background:\n linear-gradient(\n 90deg,\n rgba(244, 63, 94, 0.4),\n transparent);\n}\n.dtg-divider-text {\n font-size: 9px;\n letter-spacing: 0.25em;\n text-transform: uppercase;\n color: rgba(190, 18, 60, 0.7);\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n}\n.dtg-description {\n color: #94a3b8;\n font-size: 14px;\n line-height: 1.625;\n max-width: 384px;\n margin: 0 auto;\n}\n.dtg-close-button {\n margin-top: 4px;\n padding: 8px 28px;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.15em;\n text-transform: uppercase;\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n border: 1px solid rgba(244, 63, 94, 0.25);\n color: #fda4af;\n background: transparent;\n align-self: center;\n}\n.dtg-close-button:hover {\n background: rgba(244, 63, 94, 0.08);\n border-color: rgba(244, 63, 94, 0.5);\n}\n.dtg-footer {\n padding-top: 16px;\n border-top: 1px solid rgba(255, 255, 255, 0.05);\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n font-size: 9px;\n color: rgba(148, 163, 184, 0.3);\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.dtg-uppercase-track {\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n');
223
+
224
+ // src/components/DevToolsWarningOverlay.tsx
225
+ import { jsx, jsxs } from "react/jsx-runtime";
226
+ var SCAN_STEPS = [
227
+ { id: "step-1", label: "Tracing unauthorized debugger session..." },
228
+ { id: "step-2", label: "Analyzing reverse-engineering attempt..." },
229
+ { id: "step-3", label: "Access monitored \u2014 preparing security report..." }
230
+ ];
231
+ var STEP_INTERVAL_MS = 1e3;
232
+ var MATRIX_CHARS = "\uFF71\uFF72\uFF73\uFF74\uFF75\uFF76\uFF77\uFF78\uFF79\uFF7A\uFF7B\uFF7C\uFF7D\uFF7E\uFF7F\uFF80\uFF81\uFF82\uFF83\uFF84\uFF85\uFF86\uFF87\uFF88\uFF89\uFF8A\uFF8B\uFF8C\uFF8D\uFF8E\uFF8F\uFF90\uFF91\uFF92\uFF93\uFF94\uFF95\uFF96\uFF97\uFF98\uFF99\uFF9A\uFF9B\uFF9C\uFF9D0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
233
+ var MATRIX_FONT_SIZE = 15;
234
+ var MatrixBackground = () => {
235
+ const canvasRef = useRef2(null);
236
+ useEffect2(() => {
237
+ const canvas = canvasRef.current;
238
+ if (!canvas) return;
239
+ const ctx = canvas.getContext("2d");
240
+ if (!ctx) return;
241
+ const chars = MATRIX_CHARS.split("");
242
+ let rainDrops = [];
243
+ let animId;
244
+ let mounted = true;
245
+ const initDrops = () => {
246
+ const cols = Math.floor(canvas.width / MATRIX_FONT_SIZE);
247
+ rainDrops = Array.from(
248
+ { length: cols },
249
+ () => Math.floor(Math.random() * (canvas.height / MATRIX_FONT_SIZE))
250
+ );
251
+ };
252
+ const resize = () => {
253
+ canvas.width = window.innerWidth;
254
+ canvas.height = window.innerHeight;
255
+ initDrops();
256
+ };
257
+ resize();
258
+ const draw = () => {
259
+ if (!mounted) return;
260
+ ctx.fillStyle = "rgba(5, 7, 10, 0.055)";
261
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
262
+ ctx.font = `${MATRIX_FONT_SIZE}px monospace`;
263
+ for (let i = 0; i < rainDrops.length; i++) {
264
+ const ch = chars[Math.floor(Math.random() * chars.length)];
265
+ const x = i * MATRIX_FONT_SIZE;
266
+ const y = rainDrops[i] * MATRIX_FONT_SIZE;
267
+ const r = Math.random();
268
+ if (r > 0.985) {
269
+ ctx.fillStyle = "#f43f5e";
270
+ } else if (r > 0.96) {
271
+ ctx.fillStyle = "#22d3ee";
272
+ } else {
273
+ ctx.fillStyle = "#10b981";
274
+ }
275
+ ctx.fillText(ch, x, y);
276
+ if (y > canvas.height && Math.random() > 0.975) {
277
+ rainDrops[i] = 0;
278
+ }
279
+ rainDrops[i]++;
280
+ }
281
+ animId = requestAnimationFrame(draw);
282
+ };
283
+ animId = requestAnimationFrame(draw);
284
+ window.addEventListener("resize", resize);
285
+ return () => {
286
+ mounted = false;
287
+ cancelAnimationFrame(animId);
288
+ window.removeEventListener("resize", resize);
289
+ };
290
+ }, []);
291
+ return /* @__PURE__ */ jsx(
292
+ "canvas",
293
+ {
294
+ ref: canvasRef,
295
+ "aria-hidden": "true",
296
+ className: "dtg-canvas"
297
+ }
298
+ );
299
+ };
300
+ var ScanlineOverlay = () => /* @__PURE__ */ jsx(
301
+ "div",
302
+ {
303
+ "aria-hidden": "true",
304
+ className: "dtg-scanlines",
305
+ style: {
306
+ backgroundImage: [
307
+ "repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px)",
308
+ "repeating-linear-gradient(90deg, rgba(255,0,0,0.025), rgba(0,255,0,0.015), rgba(0,0,255,0.025))"
309
+ ].join(", ")
310
+ }
311
+ }
312
+ );
313
+ var NeonEdge = ({ position }) => /* @__PURE__ */ jsx(
314
+ "div",
315
+ {
316
+ "aria-hidden": "true",
317
+ className: `dtg-neon-edge dtg-neon-edge-${position}`
318
+ }
319
+ );
320
+ var PulseDot = ({ color = "#f43f5e" }) => /* @__PURE__ */ jsxs("span", { className: "dtg-pulse-dot", "aria-hidden": "true", children: [
321
+ /* @__PURE__ */ jsx(
322
+ "span",
323
+ {
324
+ className: "dtg-pulse-dot-ping",
325
+ style: { backgroundColor: color }
326
+ }
327
+ ),
328
+ /* @__PURE__ */ jsx(
329
+ "span",
330
+ {
331
+ className: "dtg-pulse-dot-inner",
332
+ style: { backgroundColor: color }
333
+ }
334
+ )
335
+ ] });
336
+ var IconGithub = ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
337
+ "path",
338
+ {
339
+ fillRule: "evenodd",
340
+ clipRule: "evenodd",
341
+ d: "M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483\n 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466\n -.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832\n .092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688\n -.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844\n c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651\n .64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855\n 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482C19.138 20.197 22 16.44 22 12.017\n 22 6.484 17.522 2 12 2z"
342
+ }
343
+ ) });
344
+ var IconLinkedin = ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M19 0H5C2.239 0 0 2.239 0 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5V5c0-2.761-2.238-5-5-5zM8 19H5V8h3v11zM6.5 6.732c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zM20 19h-3v-5.604c0-3.368-4-3.113-4 0V19h-3V8h3v1.765c1.396-2.586 7-2.777 7 2.476V19z" }) });
345
+ var IconGlobe = ({ className }) => /* @__PURE__ */ jsxs("svg", { className, fill: "none", stroke: "currentColor", strokeWidth: 1.8, viewBox: "0 0 24 24", "aria-hidden": "true", children: [
346
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
347
+ /* @__PURE__ */ jsx("path", { d: "M12 2a14.5 14.5 0 010 20M12 2a14.5 14.5 0 000 20M2 12h20" })
348
+ ] });
349
+ var IconShield = ({ className }) => /* @__PURE__ */ jsx("svg", { className, fill: "none", stroke: "currentColor", strokeWidth: 1.5, viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
350
+ "path",
351
+ {
352
+ strokeLinecap: "round",
353
+ strokeLinejoin: "round",
354
+ d: "M12 2L4 6v6c0 5.25 3.5 10.15 8 11 4.5-.85 8-5.75 8-11V6l-8-4z"
355
+ }
356
+ ) });
357
+ var CreatorCard = ({ href, icon, label, sub, accentColor }) => /* @__PURE__ */ jsxs(
358
+ motion.a,
359
+ {
360
+ href,
361
+ target: "_blank",
362
+ rel: "noopener noreferrer",
363
+ whileHover: { y: -2, scale: 1.02 },
364
+ whileTap: { scale: 0.97 },
365
+ transition: { type: "spring", stiffness: 400, damping: 20 },
366
+ className: "dtg-creator-card",
367
+ onMouseEnter: (e) => {
368
+ e.currentTarget.style.borderColor = `${accentColor}55`;
369
+ e.currentTarget.style.background = `${accentColor}0d`;
370
+ },
371
+ onMouseLeave: (e) => {
372
+ e.currentTarget.style.borderColor = "rgba(148,163,184,0.12)";
373
+ e.currentTarget.style.background = "rgba(15,20,30,0.7)";
374
+ },
375
+ children: [
376
+ /* @__PURE__ */ jsx(
377
+ "span",
378
+ {
379
+ className: "dtg-creator-icon",
380
+ style: { background: `${accentColor}18`, color: accentColor },
381
+ children: icon
382
+ }
383
+ ),
384
+ /* @__PURE__ */ jsx("span", { className: "dtg-creator-label", children: label }),
385
+ /* @__PURE__ */ jsx("span", { className: "dtg-creator-sub", children: sub })
386
+ ]
387
+ }
388
+ );
389
+ var ScanPhase = ({ step }) => {
390
+ const progress = Math.min((step + 1) / SCAN_STEPS.length * 100, 100);
391
+ return /* @__PURE__ */ jsxs(
392
+ motion.div,
393
+ {
394
+ initial: { opacity: 0, y: 12 },
395
+ animate: { opacity: 1, y: 0 },
396
+ exit: { opacity: 0, y: -12 },
397
+ transition: { duration: 0.25 },
398
+ className: "dtg-scan-container",
399
+ children: [
400
+ /* @__PURE__ */ jsxs("div", { className: "dtg-flex-row", children: [
401
+ /* @__PURE__ */ jsx(PulseDot, {}),
402
+ /* @__PURE__ */ jsx("span", { className: "dtg-scan-title", children: "Security scan running" })
403
+ ] }),
404
+ /* @__PURE__ */ jsx("ol", { className: "dtg-steps-list", "aria-live": "polite", "aria-label": "Scan progress", children: SCAN_STEPS.map((s, idx) => {
405
+ const done = idx < step;
406
+ const active = idx === step;
407
+ const pending = idx > step;
408
+ return /* @__PURE__ */ jsxs(
409
+ motion.li,
410
+ {
411
+ initial: { opacity: 0, x: -8 },
412
+ animate: { opacity: pending ? 0.3 : 1, x: 0 },
413
+ transition: { duration: 0.3, delay: active ? 0.05 : 0 },
414
+ className: "dtg-step-item",
415
+ children: [
416
+ /* @__PURE__ */ jsxs("span", { className: "dtg-step-indicator", children: [
417
+ done && /* @__PURE__ */ jsx("svg", { style: { width: "14px", height: "14px", color: "#34d399" }, fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }),
418
+ active && /* @__PURE__ */ jsx(PulseDot, { color: "#f43f5e" }),
419
+ pending && /* @__PURE__ */ jsx("span", { className: "dtg-step-dot" })
420
+ ] }),
421
+ /* @__PURE__ */ jsx(
422
+ "span",
423
+ {
424
+ className: done ? "dtg-text-done" : active ? "dtg-text-active" : "dtg-text-pending",
425
+ children: s.label
426
+ }
427
+ )
428
+ ]
429
+ },
430
+ s.id
431
+ );
432
+ }) }),
433
+ /* @__PURE__ */ jsx(
434
+ "div",
435
+ {
436
+ role: "progressbar",
437
+ "aria-valuenow": Math.round(progress),
438
+ "aria-valuemin": 0,
439
+ "aria-valuemax": 100,
440
+ "aria-label": "Scan progress",
441
+ className: "dtg-progress-track",
442
+ children: /* @__PURE__ */ jsx(
443
+ motion.div,
444
+ {
445
+ initial: { width: "0%" },
446
+ animate: { width: `${progress}%` },
447
+ transition: { duration: STEP_INTERVAL_MS / 1e3, ease: "easeInOut" },
448
+ className: "dtg-progress-fill"
449
+ }
450
+ )
451
+ }
452
+ ),
453
+ /* @__PURE__ */ jsxs(
454
+ "div",
455
+ {
456
+ "aria-hidden": "true",
457
+ className: "dtg-log-stream",
458
+ children: [
459
+ /* @__PURE__ */ jsxs("div", { children: [
460
+ "> pid=",
461
+ "{",
462
+ "0x",
463
+ Math.floor(Math.random() * 65535).toString(16).padStart(4, "0"),
464
+ `'}`,
465
+ " signal=SIGINT"
466
+ ] }),
467
+ /* @__PURE__ */ jsxs("div", { children: [
468
+ "> stack_trace captured at 0x",
469
+ Math.floor(Math.random() * 16777215).toString(16)
470
+ ] }),
471
+ /* @__PURE__ */ jsxs("div", { children: [
472
+ "> hash_check: ",
473
+ step >= 1 ? "MISMATCH \u2717" : "pending..."
474
+ ] }),
475
+ /* @__PURE__ */ jsxs("div", { children: [
476
+ "> exfil_guard: ",
477
+ step >= 2 ? "BLOCKED \u2717" : "scanning..."
478
+ ] })
479
+ ]
480
+ }
481
+ )
482
+ ]
483
+ },
484
+ "scan"
485
+ );
486
+ };
487
+ var WarningPhase = ({ onClose }) => /* @__PURE__ */ jsxs(
488
+ motion.div,
489
+ {
490
+ initial: { opacity: 0, scale: 0.97 },
491
+ animate: { opacity: 1, scale: 1 },
492
+ transition: { duration: 0.35, type: "spring", stiffness: 260, damping: 22 },
493
+ className: "dtg-warning-container",
494
+ children: [
495
+ /* @__PURE__ */ jsx(
496
+ motion.div,
497
+ {
498
+ initial: { scale: 0.6, opacity: 0 },
499
+ animate: { scale: 1, opacity: 1 },
500
+ transition: { delay: 0.1, type: "spring", stiffness: 300, damping: 18 },
501
+ className: "dtg-shield-wrapper",
502
+ children: /* @__PURE__ */ jsx(IconShield, { className: "dtg-shield-icon" })
503
+ }
504
+ ),
505
+ /* @__PURE__ */ jsxs("div", { className: "dtg-flex-row", style: { flexDirection: "column", gap: "10px" }, children: [
506
+ /* @__PURE__ */ jsx("h2", { className: "dtg-warning-title", children: "Developer Tools Detected" }),
507
+ /* @__PURE__ */ jsxs("div", { className: "dtg-divider", children: [
508
+ /* @__PURE__ */ jsx("div", { className: "dtg-divider-line" }),
509
+ /* @__PURE__ */ jsx("span", { className: "dtg-divider-text", children: "alert" }),
510
+ /* @__PURE__ */ jsx("div", { className: "dtg-divider-line-rev" })
511
+ ] })
512
+ ] }),
513
+ /* @__PURE__ */ jsx("p", { className: "dtg-description", children: "This platform is protected intellectual property. Reverse engineering or code extraction is monitored. If you're curious about what was built here, reach out directly." }),
514
+ /* @__PURE__ */ jsxs("div", { className: "dtg-creator-grid", children: [
515
+ /* @__PURE__ */ jsx(
516
+ CreatorCard,
517
+ {
518
+ href: "https://github.com/Ali-Arshad-110",
519
+ icon: /* @__PURE__ */ jsx(IconGithub, { className: "w-4 h-4" }),
520
+ label: "GitHub",
521
+ sub: "My Work",
522
+ accentColor: "#818cf8"
523
+ }
524
+ ),
525
+ /* @__PURE__ */ jsx(
526
+ CreatorCard,
527
+ {
528
+ href: "https://www.linkedin.com/in/aliarshad110",
529
+ icon: /* @__PURE__ */ jsx(IconLinkedin, { className: "w-4 h-4" }),
530
+ label: "LinkedIn",
531
+ sub: "Connect",
532
+ accentColor: "#38bdf8"
533
+ }
534
+ ),
535
+ /* @__PURE__ */ jsx(
536
+ CreatorCard,
537
+ {
538
+ href: "https://github.com/Ali-Arshad-110",
539
+ icon: /* @__PURE__ */ jsx(IconGlobe, { className: "w-4 h-4" }),
540
+ label: "Portfolio",
541
+ sub: "About me",
542
+ accentColor: "#34d399"
543
+ }
544
+ )
545
+ ] }),
546
+ onClose && /* @__PURE__ */ jsx(
547
+ motion.button,
548
+ {
549
+ onClick: onClose,
550
+ whileHover: { scale: 1.03 },
551
+ whileTap: { scale: 0.97 },
552
+ className: "dtg-close-button",
553
+ children: "Close & return to platform"
554
+ }
555
+ ),
556
+ /* @__PURE__ */ jsxs("div", { className: "dtg-footer", children: [
557
+ /* @__PURE__ */ jsx("span", { className: "dtg-uppercase-track", children: "Secured \xB7 SSL/TLS" }),
558
+ /* @__PURE__ */ jsxs("span", { className: "dtg-uppercase-track", children: [
559
+ "Copyright \xA9 ",
560
+ (/* @__PURE__ */ new Date()).getFullYear()
561
+ ] })
562
+ ] })
563
+ ]
564
+ },
565
+ "warning"
566
+ );
567
+ var DevToolsWarningOverlay = ({ onClose }) => {
568
+ const [scanStep, setScanStep] = useState2(0);
569
+ const [phase, setPhase] = useState2("scan");
570
+ useEffect2(() => {
571
+ if (phase !== "scan") return;
572
+ if (scanStep < SCAN_STEPS.length - 1) {
573
+ const t = setTimeout(() => setScanStep((s) => s + 1), STEP_INTERVAL_MS);
574
+ return () => clearTimeout(t);
575
+ } else {
576
+ const t = setTimeout(() => setPhase("warning"), STEP_INTERVAL_MS);
577
+ return () => clearTimeout(t);
578
+ }
579
+ }, [scanStep, phase]);
580
+ return /* @__PURE__ */ jsxs(
581
+ "div",
582
+ {
583
+ role: "alertdialog",
584
+ "aria-modal": "true",
585
+ "aria-label": "Security alert: developer tools detected",
586
+ className: "dtg-overlay",
587
+ children: [
588
+ /* @__PURE__ */ jsx(MatrixBackground, {}),
589
+ /* @__PURE__ */ jsx(ScanlineOverlay, {}),
590
+ /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "dtg-vignette" }),
591
+ /* @__PURE__ */ jsxs(
592
+ motion.div,
593
+ {
594
+ initial: { opacity: 0, y: 16, scale: 0.98 },
595
+ animate: { opacity: 1, y: 0, scale: 1 },
596
+ transition: { duration: 0.4, type: "spring", stiffness: 240, damping: 26 },
597
+ className: "dtg-card",
598
+ children: [
599
+ /* @__PURE__ */ jsx(NeonEdge, { position: "top" }),
600
+ /* @__PURE__ */ jsx(NeonEdge, { position: "bottom" }),
601
+ /* @__PURE__ */ jsx("div", { className: "dtg-card-padding", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: phase === "scan" ? /* @__PURE__ */ jsx(ScanPhase, { step: scanStep }, "scan") : /* @__PURE__ */ jsx(WarningPhase, { onClose }, "warning") }) })
602
+ ]
603
+ }
604
+ )
605
+ ]
606
+ }
607
+ );
608
+ };
609
+ var DevToolsWarningOverlay_default = DevToolsWarningOverlay;
610
+
611
+ // src/provider/DevToolsProtection.tsx
612
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
613
+ var DevToolsProtection = ({
614
+ children,
615
+ overlay = true
616
+ }) => {
617
+ const isOpen = useDevToolsDetector();
618
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
619
+ children,
620
+ overlay && isOpen && /* @__PURE__ */ jsx2(DevToolsWarningOverlay_default, {})
621
+ ] });
622
+ };
623
+ export {
624
+ DevToolsProtection,
625
+ DevToolsWarningOverlay_default as DevToolsWarningOverlay,
626
+ useDevToolsDetector
627
+ };
628
+ //# sourceMappingURL=index.mjs.map