dirk-cfx-react 1.1.2 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1372 @@
1
+ import { createContext, useRef, useState, useEffect, useContext } from 'react';
2
+ import { create, useStore } from 'zustand';
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
+ import { Flex, Text, Image, useMantineTheme, alpha, Progress, RingProgress, Button } from '@mantine/core';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+ import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
7
+ import clickSoundUrl from '../click_sound-PNCRRTM4.mp3';
8
+ import hoverSoundUrl from '../hover_sound-NBUA222C.mp3';
9
+ import { useClickOutside } from '@mantine/hooks';
10
+
11
+ // src/utils/colorWithAlpha.ts
12
+ var colorNames = {
13
+ AliceBlue: { r: 240, g: 248, b: 255 },
14
+ AntiqueWhite: { r: 250, g: 235, b: 215 },
15
+ Aqua: { r: 0, g: 255, b: 255 },
16
+ Aquamarine: { r: 127, g: 255, b: 212 },
17
+ Azure: { r: 240, g: 255, b: 255 },
18
+ Beige: { r: 245, g: 245, b: 220 },
19
+ Bisque: { r: 255, g: 228, b: 196 },
20
+ Black: { r: 0, g: 0, b: 0 },
21
+ BlanchedAlmond: { r: 255, g: 235, b: 205 },
22
+ Blue: { r: 0, g: 0, b: 255 },
23
+ BlueViolet: { r: 138, g: 43, b: 226 },
24
+ Brown: { r: 165, g: 42, b: 42 },
25
+ BurlyWood: { r: 222, g: 184, b: 135 },
26
+ CadetBlue: { r: 95, g: 158, b: 160 },
27
+ Chartreuse: { r: 127, g: 255, b: 0 },
28
+ Chocolate: { r: 210, g: 105, b: 30 },
29
+ Coral: { r: 255, g: 127, b: 80 },
30
+ CornflowerBlue: { r: 100, g: 149, b: 237 },
31
+ Cornsilk: { r: 255, g: 248, b: 220 },
32
+ Crimson: { r: 220, g: 20, b: 60 },
33
+ Cyan: { r: 0, g: 255, b: 255 },
34
+ DarkBlue: { r: 0, g: 0, b: 139 },
35
+ DarkCyan: { r: 0, g: 139, b: 139 },
36
+ DarkGoldenRod: { r: 184, g: 134, b: 11 },
37
+ DarkGray: { r: 169, g: 169, b: 169 },
38
+ DarkGreen: { r: 0, g: 100, b: 0 },
39
+ DarkKhaki: { r: 189, g: 183, b: 107 },
40
+ DarkMagenta: { r: 139, g: 0, b: 139 },
41
+ DarkOliveGreen: { r: 85, g: 107, b: 47 },
42
+ DarkOrange: { r: 255, g: 140, b: 0 },
43
+ DarkOrchid: { r: 153, g: 50, b: 204 },
44
+ DarkRed: { r: 139, g: 0, b: 0 },
45
+ DarkSalmon: { r: 233, g: 150, b: 122 },
46
+ DarkSeaGreen: { r: 143, g: 188, b: 143 },
47
+ DarkSlateBlue: { r: 72, g: 61, b: 139 },
48
+ DarkSlateGray: { r: 47, g: 79, b: 79 },
49
+ DarkTurquoise: { r: 0, g: 206, b: 209 },
50
+ DarkViolet: { r: 148, g: 0, b: 211 },
51
+ DeepPink: { r: 255, g: 20, b: 147 },
52
+ DeepSkyBlue: { r: 0, g: 191, b: 255 },
53
+ DimGray: { r: 105, g: 105, b: 105 },
54
+ DodgerBlue: { r: 30, g: 144, b: 255 },
55
+ FireBrick: { r: 178, g: 34, b: 34 },
56
+ FloralWhite: { r: 255, g: 250, b: 240 },
57
+ ForestGreen: { r: 34, g: 139, b: 34 },
58
+ Fuchsia: { r: 255, g: 0, b: 255 },
59
+ Gainsboro: { r: 220, g: 220, b: 220 },
60
+ GhostWhite: { r: 248, g: 248, b: 255 },
61
+ Gold: { r: 255, g: 215, b: 0 },
62
+ GoldenRod: { r: 218, g: 165, b: 32 },
63
+ Gray: { r: 128, g: 128, b: 128 },
64
+ Green: { r: 0, g: 128, b: 0 },
65
+ GreenYellow: { r: 173, g: 255, b: 47 },
66
+ HoneyDew: { r: 240, g: 255, b: 240 },
67
+ HotPink: { r: 255, g: 105, b: 180 },
68
+ IndianRed: { r: 205, g: 92, b: 92 },
69
+ Indigo: { r: 75, g: 0, b: 130 },
70
+ Ivory: { r: 255, g: 255, b: 240 },
71
+ Khaki: { r: 240, g: 230, b: 140 },
72
+ Lavender: { r: 230, g: 230, b: 250 },
73
+ LavenderBlush: { r: 255, g: 240, b: 245 },
74
+ LawnGreen: { r: 124, g: 252, b: 0 },
75
+ LemonChiffon: { r: 255, g: 250, b: 205 },
76
+ LightBlue: { r: 173, g: 216, b: 230 },
77
+ LightCoral: { r: 240, g: 128, b: 128 },
78
+ LightCyan: { r: 224, g: 255, b: 255 },
79
+ LightGoldenRodYellow: { r: 250, g: 250, b: 210 },
80
+ LightGray: { r: 211, g: 211, b: 211 },
81
+ LightGreen: { r: 144, g: 238, b: 144 },
82
+ LightPink: { r: 255, g: 182, b: 193 },
83
+ LightSalmon: { r: 255, g: 160, b: 122 },
84
+ LightSeaGreen: { r: 32, g: 178, b: 170 },
85
+ LightSkyBlue: { r: 135, g: 206, b: 250 },
86
+ LightSlateGray: { r: 119, g: 136, b: 153 },
87
+ LightSteelBlue: { r: 176, g: 196, b: 222 },
88
+ LightYellow: { r: 255, g: 255, b: 224 },
89
+ Lime: { r: 0, g: 255, b: 0 },
90
+ LimeGreen: { r: 50, g: 205, b: 50 },
91
+ Linen: { r: 250, g: 240, b: 230 },
92
+ Magenta: { r: 255, g: 0, b: 255 },
93
+ Maroon: { r: 128, g: 0, b: 0 },
94
+ // Maroon
95
+ MediumAquaMarine: { r: 102, g: 205, b: 170 },
96
+ MediumBlue: { r: 0, g: 0, b: 205 },
97
+ MediumOrchid: { r: 186, g: 85, b: 211 },
98
+ MediumPurple: { r: 147, g: 112, b: 219 },
99
+ MediumSeaGreen: { r: 60, g: 179, b: 113 },
100
+ MediumSlateBlue: { r: 123, g: 104, b: 238 },
101
+ MediumSpringGreen: { r: 0, g: 250, b: 154 },
102
+ MediumTurquoise: { r: 72, g: 209, b: 204 },
103
+ MediumVioletRed: { r: 199, g: 21, b: 133 },
104
+ MidnightBlue: { r: 25, g: 25, b: 112 },
105
+ MintCream: { r: 245, g: 255, b: 250 },
106
+ MistyRose: { r: 255, g: 228, b: 225 },
107
+ Moccasin: { r: 255, g: 228, b: 181 },
108
+ NavajoWhite: { r: 255, g: 222, b: 173 },
109
+ Navy: { r: 0, g: 0, b: 128 },
110
+ OldLace: { r: 253, g: 245, b: 230 },
111
+ Olive: { r: 128, g: 128, b: 0 },
112
+ OliveDrab: { r: 107, g: 142, b: 35 },
113
+ Orange: { r: 255, g: 165, b: 0 },
114
+ OrangeRed: { r: 255, g: 69, b: 0 },
115
+ Orchid: { r: 218, g: 112, b: 214 },
116
+ PaleGoldenRod: { r: 238, g: 232, b: 170 },
117
+ PaleGreen: { r: 152, g: 251, b: 152 },
118
+ PaleTurquoise: { r: 175, g: 238, b: 238 },
119
+ PaleVioletRed: { r: 219, g: 112, b: 147 },
120
+ PapayaWhip: { r: 255, g: 239, b: 213 },
121
+ PeachPuff: { r: 255, g: 218, b: 185 },
122
+ Peru: { r: 205, g: 133, b: 63 },
123
+ Pink: { r: 255, g: 192, b: 203 },
124
+ Plum: { r: 221, g: 160, b: 221 },
125
+ PowderBlue: { r: 176, g: 224, b: 230 },
126
+ Purple: { r: 128, g: 0, b: 128 },
127
+ RebeccaPurple: { r: 102, g: 51, b: 153 },
128
+ Red: { r: 255, g: 0, b: 0 },
129
+ RosyBrown: { r: 188, g: 143, b: 143 },
130
+ RoyalBlue: { r: 65, g: 105, b: 225 },
131
+ SaddleBrown: { r: 139, g: 69, b: 19 },
132
+ Salmon: { r: 250, g: 128, b: 114 },
133
+ SandyBrown: { r: 244, g: 164, b: 96 },
134
+ SeaGreen: { r: 46, g: 139, b: 87 },
135
+ SeaShell: { r: 255, g: 245, b: 238 },
136
+ Sienna: { r: 160, g: 82, b: 45 },
137
+ Silver: { r: 192, g: 192, b: 192 },
138
+ SkyBlue: { r: 135, g: 206, b: 235 },
139
+ SlateBlue: { r: 106, g: 90, b: 205 },
140
+ SlateGray: { r: 112, g: 128, b: 144 },
141
+ Snow: { r: 255, g: 250, b: 250 },
142
+ SpringGreen: { r: 0, g: 255, b: 127 },
143
+ SteelBlue: { r: 70, g: 130, b: 180 },
144
+ Tan: { r: 210, g: 180, b: 140 },
145
+ Teal: { r: 0, g: 128, b: 128 },
146
+ Thistle: { r: 216, g: 191, b: 216 },
147
+ Tomato: { r: 255, g: 99, b: 71 },
148
+ Turquoise: { r: 64, g: 224, b: 208 },
149
+ Violet: { r: 238, g: 130, b: 238 },
150
+ Wheat: { r: 245, g: 222, b: 179 },
151
+ White: { r: 255, g: 255, b: 255 },
152
+ WhiteSmoke: { r: 245, g: 245, b: 245 },
153
+ Yellow: { r: 255, g: 255, b: 0 },
154
+ YellowGreen: { r: 154, g: 205, b: 50 }
155
+ };
156
+ function colorWithAlpha(color, alpha4) {
157
+ const lowerCasedColor = color.toLowerCase();
158
+ if (colorNames[lowerCasedColor]) {
159
+ const rgb = colorNames[lowerCasedColor];
160
+ return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha4})`;
161
+ }
162
+ if (/^#([A-Fa-f0-9]{6})$/.test(color)) {
163
+ const hex = color.slice(1);
164
+ const bigint = parseInt(hex, 16);
165
+ const r = bigint >> 16 & 255;
166
+ const g = bigint >> 8 & 255;
167
+ const b = bigint & 255;
168
+ return `rgba(${r}, ${g}, ${b}, ${alpha4})`;
169
+ }
170
+ if (/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/.test(color)) {
171
+ const result = color.match(/^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/);
172
+ if (result) {
173
+ return `rgba(${result[1]}, ${result[2]}, ${result[3]}, ${alpha4})`;
174
+ }
175
+ }
176
+ return color;
177
+ }
178
+
179
+ // src/utils/misc.ts
180
+ var isEnvBrowser = () => !window.invokeNative;
181
+
182
+ // src/utils/fetchNui.ts
183
+ async function fetchNui(eventName, data, mockData) {
184
+ const options = {
185
+ method: "post",
186
+ headers: {
187
+ "Content-Type": "application/json; charset=UTF-8"
188
+ },
189
+ body: JSON.stringify(data)
190
+ };
191
+ if (isEnvBrowser() && mockData === void 0) {
192
+ console.warn(
193
+ `[fetchNui] Called fetchNui for event "${eventName}" in browser environment without mockData. Returning empty object.`
194
+ );
195
+ return {};
196
+ }
197
+ const resourceName = window.GetParentResourceName ? window.GetParentResourceName() : "nui-frame-app";
198
+ const resp = await fetch(`https://${resourceName}/${eventName}`, options);
199
+ return await resp.json();
200
+ }
201
+ async function registerInitialFetch(eventName, data, mockData) {
202
+ const fetcher = () => fetchNui(eventName, data, mockData);
203
+ return fetcher();
204
+ }
205
+ var localeStore = create((set, get) => {
206
+ return {
207
+ locales: {
208
+ "OccupantsDesc": "Here you can view and manage the occupants of your traphouse. These occupants can be used mainly for selling drugs to the NPCs surrounding your traphouse. However they have other uses to so be careful who you add as an occupant."
209
+ },
210
+ locale: (key, ...args) => {
211
+ const exists = get().locales[key];
212
+ let translation = exists || key;
213
+ if (args.length) {
214
+ translation = translation.replace(/%s/g, () => String(args.shift() || ""));
215
+ }
216
+ return translation;
217
+ }
218
+ };
219
+ });
220
+ var locale = localeStore.getState().locale;
221
+ registerInitialFetch("GET_LOCALES", void 0).then((data) => {
222
+ localeStore.setState({ locales: data });
223
+ });
224
+ function BorderedIcon(props) {
225
+ const theme = useMantineTheme();
226
+ return /* @__PURE__ */ jsx(
227
+ FontAwesomeIcon,
228
+ {
229
+ icon: props.icon,
230
+ color: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][theme.primaryShade], props.hovered ? 0.9 : 0.9),
231
+ style: {
232
+ // backgroundColor: colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7 as number], (props.hoverable ? (props.hovered ? 0.3 : 0.2) : 0.2)),
233
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
234
+ padding: props.p || theme.spacing.xs,
235
+ transition: "all 0.2s ease-in-out",
236
+ aspectRatio: "1/1",
237
+ fontSize: props.fontSize ? props.fontSize : "2.5vh",
238
+ borderRadius: theme.radius.xs,
239
+ // border: `2px solid var(--mantine-primary-color-9)`,
240
+ outline: `0.2vh solid ${colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][9], 0.8)}`,
241
+ boxShadow: `inset 0 0 2vh ${colorWithAlpha(props.color ? props.color : theme.colors[theme.primaryColor][7], 0.5)}`
242
+ }
243
+ }
244
+ );
245
+ }
246
+ var MotionFlex = motion.create(Flex);
247
+ var MotionText = motion.create(Text);
248
+ var MotionImage = motion.create(Image);
249
+ var MotionIcon = motion.create(FontAwesomeIcon);
250
+ function Counter(props) {
251
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: props.count > 0 && /* @__PURE__ */ jsx(
252
+ MotionFlex,
253
+ {
254
+ initial: { opacity: 0 },
255
+ animate: { opacity: 1 },
256
+ exit: { opacity: 0 },
257
+ fz: "1.25vh",
258
+ h: "1.75vh",
259
+ justify: "center",
260
+ align: "center",
261
+ bg: props.color || "rgba(0, 0, 0, 0.51)",
262
+ style: {
263
+ borderRadius: "50%",
264
+ aspectRatio: "1/1",
265
+ marginBottom: "0.3vh",
266
+ fontFamily: "Akrobat Bold",
267
+ boxShadow: "0 0 5px rgba(0, 0, 0, 0.3)",
268
+ ...props.style
269
+ },
270
+ children: props.count
271
+ },
272
+ "counter"
273
+ ) });
274
+ }
275
+ var FloatingParticles = ({
276
+ icons = [],
277
+ particleCount = 55,
278
+ color = "#00a552ff",
279
+ size = 32,
280
+ speed = "slow",
281
+ opacity = 0.3,
282
+ style = {},
283
+ mouseRepelDistance = 150,
284
+ mouseRepelStrength = 50,
285
+ backgroundColor = "transparent"
286
+ }) => {
287
+ const containerRef = useRef(null);
288
+ const [particles, setParticles] = useState([]);
289
+ const mouseX = useMotionValue(0);
290
+ const mouseY = useMotionValue(0);
291
+ const durationMap = {
292
+ slow: { base: 10, variance: 10 },
293
+ medium: { base: 2, variance: 2 },
294
+ fast: { base: 4, variance: 2 }
295
+ };
296
+ const duration = durationMap[speed];
297
+ const seededRandom = (seed) => {
298
+ const x = Math.sin(seed) * 1e4;
299
+ return x - Math.floor(x);
300
+ };
301
+ useEffect(() => {
302
+ if (!containerRef.current) return;
303
+ const bounds = containerRef.current.getBoundingClientRect();
304
+ const newParticles = [...Array(particleCount)].map((_, i) => {
305
+ const seedX = i * 123.456;
306
+ const seedY = i * 789.012;
307
+ const seedDuration = i * 345.678;
308
+ const baseX = seededRandom(seedX) * bounds.width;
309
+ const baseY = seededRandom(seedY) * bounds.height;
310
+ return {
311
+ id: i,
312
+ baseX,
313
+ baseY,
314
+ currentX: baseX,
315
+ currentY: baseY,
316
+ icon: icons.length > 0 ? icons[i % icons.length] : null,
317
+ animationDuration: duration.base + seededRandom(seedDuration) * duration.variance
318
+ };
319
+ });
320
+ setParticles(newParticles);
321
+ }, [particleCount, icons.length, duration.base, duration.variance]);
322
+ useEffect(() => {
323
+ if (!containerRef.current) return;
324
+ const handleMouseMove = (e) => {
325
+ const bounds = containerRef.current.getBoundingClientRect();
326
+ const x = e.clientX - bounds.left;
327
+ const y = e.clientY - bounds.top;
328
+ mouseX.set(x);
329
+ mouseY.set(y);
330
+ setParticles(
331
+ (prevParticles) => prevParticles.map((particle) => {
332
+ const dx = x - particle.baseX;
333
+ const dy = y - particle.baseY;
334
+ const distance = Math.sqrt(dx * dx + dy * dy);
335
+ if (distance < mouseRepelDistance && distance > 0) {
336
+ const force = (mouseRepelDistance - distance) / mouseRepelDistance;
337
+ const repelX = dx / distance * force * mouseRepelStrength * -1;
338
+ const repelY = dy / distance * force * mouseRepelStrength * -1;
339
+ return {
340
+ ...particle,
341
+ currentX: particle.baseX + repelX,
342
+ currentY: particle.baseY + repelY
343
+ };
344
+ } else {
345
+ return {
346
+ ...particle,
347
+ currentX: particle.baseX,
348
+ currentY: particle.baseY
349
+ };
350
+ }
351
+ })
352
+ );
353
+ };
354
+ const handleMouseLeave = () => {
355
+ setParticles(
356
+ (prevParticles) => prevParticles.map((particle) => ({
357
+ ...particle,
358
+ currentX: particle.baseX,
359
+ currentY: particle.baseY
360
+ }))
361
+ );
362
+ };
363
+ const container = containerRef.current;
364
+ container.addEventListener("mousemove", handleMouseMove);
365
+ container.addEventListener("mouseleave", handleMouseLeave);
366
+ return () => {
367
+ container.removeEventListener("mousemove", handleMouseMove);
368
+ container.removeEventListener("mouseleave", handleMouseLeave);
369
+ };
370
+ }, [mouseX, mouseY, mouseRepelDistance, mouseRepelStrength]);
371
+ useEffect(() => {
372
+ const handleResize = () => {
373
+ if (!containerRef.current) return;
374
+ const bounds = containerRef.current.getBoundingClientRect();
375
+ setParticles(
376
+ (prevParticles) => prevParticles.map((particle, i) => {
377
+ const seedX = i * 123.456 + bounds.width;
378
+ const seedY = i * 789.012 + bounds.height;
379
+ const newBaseX = seededRandom(seedX) * bounds.width;
380
+ const newBaseY = seededRandom(seedY) * bounds.height;
381
+ return {
382
+ ...particle,
383
+ baseX: newBaseX,
384
+ baseY: newBaseY,
385
+ currentX: newBaseX,
386
+ currentY: newBaseY
387
+ };
388
+ })
389
+ );
390
+ };
391
+ window.addEventListener("resize", handleResize);
392
+ return () => window.removeEventListener("resize", handleResize);
393
+ }, []);
394
+ return /* @__PURE__ */ jsx(
395
+ "div",
396
+ {
397
+ ref: containerRef,
398
+ style: {
399
+ position: "absolute",
400
+ overflow: "hidden",
401
+ width: "100%",
402
+ height: "100%",
403
+ zIndex: -1,
404
+ backgroundColor,
405
+ ...style
406
+ },
407
+ children: /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: particles.map((particle) => /* @__PURE__ */ jsx(
408
+ motion.div,
409
+ {
410
+ style: {
411
+ position: "absolute",
412
+ width: size,
413
+ height: size,
414
+ color,
415
+ opacity,
416
+ left: 0,
417
+ top: 0
418
+ },
419
+ animate: {
420
+ x: particle.currentX,
421
+ y: particle.currentY,
422
+ scale: [0.8, 1.1, 0.8],
423
+ opacity: [opacity * 0.5, opacity, opacity * 0.5],
424
+ // random rotate between 0 and 360 so that not all particles rotate the same
425
+ rotate: particle.id % 2 === 0 ? [0, 360] : [360, 0]
426
+ },
427
+ transition: {
428
+ x: { type: "spring", stiffness: 150, damping: 20 },
429
+ y: { type: "spring", stiffness: 150, damping: 20 },
430
+ rotate: {
431
+ duration: particle.animationDuration,
432
+ repeat: Infinity,
433
+ ease: "linear"
434
+ },
435
+ scale: {
436
+ duration: particle.animationDuration,
437
+ repeat: Infinity,
438
+ delay: seededRandom(particle.id * 111.222) * 5,
439
+ ease: "easeInOut"
440
+ },
441
+ opacity: {
442
+ duration: particle.animationDuration,
443
+ repeat: Infinity,
444
+ delay: seededRandom(particle.id * 333.444) * 5,
445
+ ease: "easeInOut"
446
+ }
447
+ },
448
+ children: particle.icon ? /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: particle.icon, style: { width: "70%", height: "70%" } }) }) : /* @__PURE__ */ jsx(
449
+ "div",
450
+ {
451
+ style: {
452
+ width: "100%",
453
+ height: "100%",
454
+ borderRadius: "50%",
455
+ backgroundColor: color
456
+ }
457
+ }
458
+ )
459
+ },
460
+ particle.id
461
+ )) })
462
+ }
463
+ );
464
+ };
465
+ function InfoBox(props) {
466
+ const theme = useMantineTheme();
467
+ return /* @__PURE__ */ jsxs(
468
+ Flex,
469
+ {
470
+ w: "fit-content",
471
+ h: "fit-content",
472
+ style: {
473
+ borderRadius: theme.radius.xs,
474
+ overflow: "hidden",
475
+ border: `0.2vh solid rgba(77,77,77,0.3)`
476
+ },
477
+ align: "center",
478
+ children: [
479
+ /* @__PURE__ */ jsx(
480
+ Flex,
481
+ {
482
+ miw: "4vh",
483
+ p: "xxs",
484
+ bg: "rgba(77,77,77,0.2)",
485
+ direction: "column",
486
+ justify: "center",
487
+ align: "center",
488
+ children: /* @__PURE__ */ jsx(
489
+ Text,
490
+ {
491
+ c: "lightgrey",
492
+ size: "xxs",
493
+ style: {
494
+ fontFamily: "Akrobat Bold",
495
+ letterSpacing: "0.05em",
496
+ textTransform: "uppercase"
497
+ },
498
+ children: props.leftSide
499
+ }
500
+ )
501
+ }
502
+ ),
503
+ /* @__PURE__ */ jsx(
504
+ Flex,
505
+ {
506
+ p: "xxs",
507
+ flex: 1,
508
+ miw: "4vh",
509
+ bg: "rgba(77,77,77,0.5)",
510
+ direction: "column",
511
+ align: "center",
512
+ justify: "center",
513
+ children: /* @__PURE__ */ jsx(
514
+ Text,
515
+ {
516
+ c: "lightgrey",
517
+ size: "xxs",
518
+ style: {
519
+ fontFamily: "Akrobat Bold",
520
+ letterSpacing: "0.05em",
521
+ textTransform: "uppercase"
522
+ },
523
+ children: props.rightSide
524
+ }
525
+ )
526
+ }
527
+ )
528
+ ]
529
+ }
530
+ );
531
+ }
532
+ function InputContainer(props) {
533
+ const theme = useMantineTheme();
534
+ return /* @__PURE__ */ jsxs(
535
+ MotionFlex,
536
+ {
537
+ w: props.w || "100%",
538
+ flex: props.flex,
539
+ direction: "column",
540
+ h: props.h,
541
+ gap: props.title ? "xs" : 0,
542
+ bg: props.bg || alpha("var(--mantine-color-dark-9)", 0.65),
543
+ p: props.p || "sm",
544
+ style: {
545
+ borderRadius: theme.radius.xs,
546
+ boxShadow: theme.shadows.sm,
547
+ overflow: "hidden",
548
+ border: props.error ? `1px solid rgba(255, 100, 100, 0.8)` : "1px solid var(--mantine-color-dark-7)",
549
+ ...props.style
550
+ },
551
+ variants: props.variants,
552
+ children: [
553
+ /* @__PURE__ */ jsxs(
554
+ Flex,
555
+ {
556
+ align: "center",
557
+ gap: "xs",
558
+ children: [
559
+ (props.title || props.description) && /* @__PURE__ */ jsxs(
560
+ Flex,
561
+ {
562
+ direction: "column",
563
+ gap: "xxs",
564
+ p: props.p == "0" ? "sm" : 0,
565
+ children: [
566
+ props.title && /* @__PURE__ */ jsx(
567
+ Text,
568
+ {
569
+ size: "sm",
570
+ style: {
571
+ lineHeight: "1.25vh",
572
+ fontFamily: "Akrobat Bold",
573
+ letterSpacing: "0.05em",
574
+ textTransform: "uppercase"
575
+ },
576
+ children: props.title
577
+ }
578
+ ),
579
+ props.description && /* @__PURE__ */ jsx(
580
+ Text,
581
+ {
582
+ size: "xs",
583
+ c: "rgba(255, 255, 255, 0.8)",
584
+ fw: 400,
585
+ children: props.description
586
+ }
587
+ )
588
+ ]
589
+ }
590
+ ),
591
+ props.error && /* @__PURE__ */ jsx(
592
+ Text,
593
+ {
594
+ size: "xs",
595
+ c: theme.colors.red[9],
596
+ fw: 600,
597
+ mb: "auto",
598
+ lh: "0.8",
599
+ children: props.error
600
+ }
601
+ ),
602
+ /* @__PURE__ */ jsx(
603
+ Flex,
604
+ {
605
+ ml: "auto",
606
+ children: props.rightSection
607
+ }
608
+ )
609
+ ]
610
+ }
611
+ ),
612
+ props.children
613
+ ]
614
+ }
615
+ );
616
+ }
617
+ var useAudio = create(() => {
618
+ const audioRefs = {};
619
+ const sounds = {
620
+ click: clickSoundUrl,
621
+ hover: hoverSoundUrl
622
+ };
623
+ for (const [key, src] of Object.entries(sounds)) {
624
+ audioRefs[key] = new Audio(src);
625
+ }
626
+ return {
627
+ play: (sound) => {
628
+ const audio = audioRefs[sound];
629
+ if (!audio) return console.warn(`Sound '${sound}' not found.`);
630
+ audio.currentTime = 0;
631
+ audio.volume = 0.1;
632
+ audio.play();
633
+ },
634
+ stop: (sound) => {
635
+ const audio = audioRefs[sound];
636
+ if (!audio) return console.warn(`Sound '${sound}' not found.`);
637
+ audio.pause();
638
+ audio.currentTime = 0;
639
+ }
640
+ };
641
+ });
642
+ function SegmentedControl(props) {
643
+ const theme = useMantineTheme();
644
+ const play = useAudio((state) => state.play);
645
+ const handleChange = (newValue) => {
646
+ if (props.sounds) play("click");
647
+ if (props.onChange) {
648
+ props.onChange(newValue);
649
+ }
650
+ };
651
+ return /* @__PURE__ */ jsx(
652
+ Flex,
653
+ {
654
+ bg: "rgba(33, 33, 33, 0.6)",
655
+ w: props.w || "fit-content",
656
+ style: {
657
+ borderRadius: props.roundEdges !== false ? theme.radius.xs : 0,
658
+ overflow: "hidden"
659
+ },
660
+ ...props,
661
+ children: props.items.map((item, index) => /* @__PURE__ */ jsx(
662
+ motion.div,
663
+ {
664
+ initial: { x: -100, opacity: 0 },
665
+ animate: { x: 0, opacity: 1 },
666
+ transition: { duration: 0.3, delay: index * 0.1, ease: "easeInOut" },
667
+ style: {
668
+ display: "flex",
669
+ flexDirection: "row",
670
+ alignItems: "center",
671
+ flex: 1
672
+ },
673
+ children: /* @__PURE__ */ jsx(
674
+ Segment,
675
+ {
676
+ label: item.label,
677
+ value: item.value,
678
+ icon: item.icon,
679
+ rightSection: item.rightSection,
680
+ fz: props.fz,
681
+ color: props.color,
682
+ selected: !props.multi ? props.value === item.value : Array.isArray(props.value) && props.value.includes(item.value),
683
+ onClick: () => {
684
+ if (props.multi) {
685
+ const newValue = Array.isArray(props.value) ? props.value.includes(item.value) ? props.value.filter((v) => v !== item.value) : [...props.value, item.value] : [item.value];
686
+ handleChange(newValue);
687
+ } else {
688
+ handleChange(item.value);
689
+ }
690
+ }
691
+ },
692
+ item.value
693
+ )
694
+ },
695
+ index
696
+ ))
697
+ }
698
+ );
699
+ }
700
+ function Segment(props) {
701
+ const theme = useMantineTheme();
702
+ return /* @__PURE__ */ jsxs(
703
+ MotionFlex,
704
+ {
705
+ onClick: props.onClick,
706
+ w: "100%",
707
+ direction: "column",
708
+ align: "center",
709
+ h: "100%",
710
+ bg: props.selected ? props.color ? alpha(props.color, 0.2) : colorWithAlpha(theme.colors[theme.primaryColor][theme.primaryShade], 0.2) : "transparent",
711
+ pos: "relative",
712
+ style: {
713
+ // position: "relative",
714
+ cursor: "pointer"
715
+ },
716
+ justify: "center",
717
+ whileHover: { scale: 1.05 },
718
+ whileTap: { scale: 0.95 },
719
+ children: [
720
+ /* @__PURE__ */ jsxs(
721
+ Flex,
722
+ {
723
+ align: "center",
724
+ gap: "xs",
725
+ p: "xs",
726
+ children: [
727
+ props.icon && /* @__PURE__ */ jsx(
728
+ MotionIcon,
729
+ {
730
+ icon: props.icon,
731
+ initial: {
732
+ color: props.selected ? props.color || theme.colors[theme.primaryColor][5] : "inherit"
733
+ },
734
+ animate: {
735
+ color: props.selected ? props.color || theme.colors[theme.primaryColor][5] : "inherit"
736
+ },
737
+ exit: {
738
+ color: "inherit"
739
+ },
740
+ style: {
741
+ fontSize: theme.fontSizes.xs,
742
+ marginBottom: "0.2vh"
743
+ }
744
+ }
745
+ ),
746
+ /* @__PURE__ */ jsx(
747
+ MotionText,
748
+ {
749
+ size: props.fz || "xs",
750
+ initial: {
751
+ color: props.selected ? props.color || theme.colors[theme.primaryColor][5] : "rgba(255, 255, 255, 0.7)"
752
+ },
753
+ animate: {
754
+ color: props.selected ? props.color || theme.colors[theme.primaryColor][5] : "rgba(255, 255, 255, 0.7)"
755
+ },
756
+ exit: {
757
+ color: "rgba(255, 255, 255, 0.7)"
758
+ },
759
+ style: {
760
+ fontFamily: "Akrobat Bold",
761
+ letterSpacing: "0.1em",
762
+ textTransform: "uppercase"
763
+ },
764
+ children: props.label.toUpperCase()
765
+ }
766
+ ),
767
+ props.rightSection
768
+ ]
769
+ }
770
+ ),
771
+ /* @__PURE__ */ jsx(
772
+ motion.div,
773
+ {
774
+ initial: false,
775
+ animate: {
776
+ scaleX: props.selected ? 1 : 0,
777
+ opacity: props.selected ? 1 : 0
778
+ },
779
+ transition: {
780
+ duration: 0.3,
781
+ ease: [0.4, 0, 0.2, 1]
782
+ // Custom easing curve for smooth feel
783
+ },
784
+ style: {
785
+ position: "absolute",
786
+ bottom: 0,
787
+ left: 0,
788
+ right: 0,
789
+ height: "0.2vh",
790
+ backgroundColor: props.color || theme.colors[theme.primaryColor][5],
791
+ transformOrigin: "center"
792
+ }
793
+ }
794
+ )
795
+ ]
796
+ }
797
+ );
798
+ }
799
+ var NavigationContext = createContext(null);
800
+ function useNavigation(selector) {
801
+ const navigation = useContext(NavigationContext);
802
+ if (!navigation) {
803
+ throw new Error("useNavigation must be used within a NavigationProvider");
804
+ }
805
+ return useStore(navigation, selector);
806
+ }
807
+ function useNavigationStore() {
808
+ const navigation = useContext(NavigationContext);
809
+ if (!navigation) {
810
+ throw new Error("useNavigationStore must be used within a NavigationProvider");
811
+ }
812
+ return navigation;
813
+ }
814
+ function NavigationProvider({ children, defaultPage }) {
815
+ const storeRef = useRef(
816
+ create(() => ({
817
+ pageId: defaultPage || "home"
818
+ }))
819
+ );
820
+ return /* @__PURE__ */ jsx(NavigationContext.Provider, { value: storeRef.current, children });
821
+ }
822
+ function NavBar(props) {
823
+ const pageId = useNavigation((state) => state.pageId);
824
+ const store = useNavigationStore();
825
+ return /* @__PURE__ */ jsx(
826
+ SegmentedControl,
827
+ {
828
+ sounds: true,
829
+ w: "100%",
830
+ value: pageId,
831
+ items: props.items,
832
+ onChange: (value) => {
833
+ store.setState({ pageId: value });
834
+ }
835
+ }
836
+ );
837
+ }
838
+ var containerVariants = {
839
+ hidden: { opacity: 0 },
840
+ visible: {
841
+ opacity: 1,
842
+ transition: {
843
+ staggerChildren: 0.1,
844
+ delayChildren: 0.05
845
+ }
846
+ },
847
+ exit: {
848
+ opacity: 0,
849
+ transition: {
850
+ staggerChildren: 0.05,
851
+ staggerDirection: -1
852
+ }
853
+ }
854
+ };
855
+ var itemVariants = {
856
+ hidden: {
857
+ opacity: 0,
858
+ x: 20,
859
+ scale: 0.95
860
+ },
861
+ visible: {
862
+ opacity: 1,
863
+ x: 0,
864
+ scale: 1,
865
+ transition: {
866
+ type: "spring",
867
+ stiffness: 300,
868
+ damping: 24
869
+ }
870
+ },
871
+ exit: {
872
+ opacity: 0,
873
+ x: -10,
874
+ scale: 0.95,
875
+ transition: {
876
+ duration: 0.2
877
+ }
878
+ }
879
+ };
880
+ function SegmentedProgress(props) {
881
+ const progressPerSegment = 100 / props.segments;
882
+ const filledSegments = Math.floor(props.progress / progressPerSegment);
883
+ const partialFill = props.progress % progressPerSegment / progressPerSegment;
884
+ return /* @__PURE__ */ jsx(
885
+ MotionFlex,
886
+ {
887
+ w: "100%",
888
+ h: props.size || "1vh",
889
+ gap: "xs",
890
+ initial: "hidden",
891
+ animate: "visible",
892
+ variants: containerVariants,
893
+ children: [...Array(props.segments)].map((_, index) => {
894
+ const isFilled = index < filledSegments;
895
+ const isPartial = index === filledSegments;
896
+ return /* @__PURE__ */ jsx(
897
+ motion.div,
898
+ {
899
+ variants: itemVariants,
900
+ style: {
901
+ width: `${100 / props.segments}%`,
902
+ // Ensures equal width distribution
903
+ height: "100%",
904
+ background: isFilled ? "rgba(255, 255, 255, 0.8)" : isPartial ? `linear-gradient(to right, rgba(255, 255, 255, 0.8) ${partialFill * 100}%, rgba(255, 255, 255, 0.2) ${partialFill * 100}%)` : "rgba(255, 255, 255, 0.2)",
905
+ transition: "background 0.3s ease"
906
+ }
907
+ },
908
+ index
909
+ );
910
+ })
911
+ }
912
+ );
913
+ }
914
+ var useSettings = create(() => ({
915
+ hydrated: false,
916
+ game: "fivem",
917
+ primaryColor: "dirk",
918
+ primaryShade: 9,
919
+ itemImgPath: "",
920
+ customTheme: {}
921
+ }));
922
+ registerInitialFetch("GET_SETTINGS").then((data) => {
923
+ useSettings.setState({
924
+ ...data,
925
+ hydrated: true
926
+ });
927
+ }).catch(() => {
928
+ useSettings.setState({ hydrated: true });
929
+ });
930
+ function Title(props) {
931
+ const game = useSettings((state) => state.game);
932
+ const theme = useMantineTheme();
933
+ return /* @__PURE__ */ jsx(
934
+ Flex,
935
+ {
936
+ direction: "column",
937
+ bg: props.bg || "transparent",
938
+ gap: "xs",
939
+ w: props.w || "100%",
940
+ p: props.p || "0",
941
+ style: {
942
+ userSelect: "none",
943
+ borderBottom: props.removeBorder ? "none" : `0.2vh solid ${props.borderColor || colorWithAlpha(theme.colors[theme.primaryColor][9], 0.5)}`
944
+ },
945
+ children: /* @__PURE__ */ jsxs(
946
+ Flex,
947
+ {
948
+ align: "center",
949
+ justify: "center",
950
+ children: [
951
+ /* @__PURE__ */ jsxs(
952
+ Flex,
953
+ {
954
+ align: "center",
955
+ gap: "sm",
956
+ pr: "xs",
957
+ children: [
958
+ /* @__PURE__ */ jsx(
959
+ BorderedIcon,
960
+ {
961
+ icon: props.icon,
962
+ fontSize: theme.fontSizes.md,
963
+ color: props.iconColor
964
+ }
965
+ ),
966
+ /* @__PURE__ */ jsxs(
967
+ Flex,
968
+ {
969
+ direction: "column",
970
+ gap: "0.25vh",
971
+ children: [
972
+ /* @__PURE__ */ jsx(Text, { p: "0", size: "sm", style: {
973
+ lineHeight: theme.fontSizes.md,
974
+ fontFamily: game == "fivem" ? "Akrobat Bold" : "Red Dead",
975
+ letterSpacing: "0.05em",
976
+ textTransform: "uppercase"
977
+ }, children: props.title }),
978
+ /* @__PURE__ */ jsx(
979
+ Text,
980
+ {
981
+ size: "xs",
982
+ c: "grey",
983
+ style: { whiteSpace: "normal", wordWrap: "break-word" },
984
+ children: props.description
985
+ }
986
+ )
987
+ ]
988
+ }
989
+ )
990
+ ]
991
+ }
992
+ ),
993
+ /* @__PURE__ */ jsx(
994
+ Flex,
995
+ {
996
+ ml: "auto",
997
+ align: "center",
998
+ gap: "xs",
999
+ children: props.rightSection
1000
+ }
1001
+ )
1002
+ ]
1003
+ }
1004
+ )
1005
+ }
1006
+ );
1007
+ }
1008
+ function LevelBanner(props) {
1009
+ return /* @__PURE__ */ jsxs(
1010
+ MotionFlex,
1011
+ {
1012
+ w: "35vh",
1013
+ pos: "absolute",
1014
+ left: "50%",
1015
+ align: "center",
1016
+ gap: "xs",
1017
+ style: {
1018
+ borderRadius: useMantineTheme().radius.xxs
1019
+ },
1020
+ initial: { opacity: 0, y: -10, transform: "translateX(-50%)" },
1021
+ animate: { opacity: 1, y: 0, transform: "translateX(-50%)" },
1022
+ exit: { opacity: 0, y: -10, transform: "translateX(-50%)" },
1023
+ transition: { duration: 0.3 },
1024
+ direction: "column",
1025
+ children: [
1026
+ /* @__PURE__ */ jsxs(
1027
+ Flex,
1028
+ {
1029
+ w: "100%",
1030
+ justify: "space-between",
1031
+ children: [
1032
+ /* @__PURE__ */ jsxs(
1033
+ Text,
1034
+ {
1035
+ size: "xxs",
1036
+ c: "rgba(255, 255, 255, 0.9)",
1037
+ style: {
1038
+ fontFamily: "Akrobat Bold",
1039
+ letterSpacing: "0.1em"
1040
+ },
1041
+ children: [
1042
+ "LVL ",
1043
+ props.level
1044
+ ]
1045
+ }
1046
+ ),
1047
+ /* @__PURE__ */ jsxs(
1048
+ Text,
1049
+ {
1050
+ size: "xxs",
1051
+ c: "rgba(255, 255, 255, 0.7)",
1052
+ style: {
1053
+ fontFamily: "Akrobat Bold",
1054
+ letterSpacing: "0.1em"
1055
+ },
1056
+ children: [
1057
+ props.exp,
1058
+ "/",
1059
+ props.nextLevelXP,
1060
+ " XP"
1061
+ ]
1062
+ }
1063
+ ),
1064
+ /* @__PURE__ */ jsxs(
1065
+ Text,
1066
+ {
1067
+ size: "xxs",
1068
+ c: "rgba(255, 255, 255, 0.7)",
1069
+ style: {
1070
+ fontFamily: "Akrobat Bold",
1071
+ letterSpacing: "0.1em"
1072
+ },
1073
+ children: [
1074
+ "LVL ",
1075
+ props.level + 1
1076
+ ]
1077
+ }
1078
+ )
1079
+ ]
1080
+ }
1081
+ ),
1082
+ /* @__PURE__ */ jsx(
1083
+ Progress,
1084
+ {
1085
+ color: props.color,
1086
+ w: "100%",
1087
+ size: "sm",
1088
+ value: props.progressToLevel
1089
+ }
1090
+ )
1091
+ ]
1092
+ }
1093
+ );
1094
+ }
1095
+ function LevelPanel(props) {
1096
+ const theme = useMantineTheme();
1097
+ return /* @__PURE__ */ jsxs(
1098
+ Flex,
1099
+ {
1100
+ w: "fit-content",
1101
+ pr: "8vh",
1102
+ pl: "8vh",
1103
+ bg: "linear-gradient(180deg, rgba(30, 30, 30, 0.82) 0%, rgba(30, 30, 30, 0.3) 50%, rgba(30, 30, 30, 0.6) 100%)",
1104
+ style: {
1105
+ borderRadius: theme.radius.xs,
1106
+ boxShadow: theme.shadows.sm,
1107
+ outline: "0.2vh solid rgba(255,255,255,0.1)"
1108
+ },
1109
+ justify: "center",
1110
+ align: "center",
1111
+ direction: "column",
1112
+ p: "sm",
1113
+ children: [
1114
+ /* @__PURE__ */ jsx(
1115
+ RingProgress,
1116
+ {
1117
+ size: 190,
1118
+ roundCaps: true,
1119
+ thickness: 10,
1120
+ sections: [{ value: props.progressToLevel, color: alpha(props.color || theme.colors[theme.primaryColor][theme.primaryShade], 0.9) }],
1121
+ label: /* @__PURE__ */ jsx(
1122
+ Flex,
1123
+ {
1124
+ justify: "center",
1125
+ align: "center",
1126
+ direction: "column",
1127
+ children: /* @__PURE__ */ jsx(
1128
+ Text,
1129
+ {
1130
+ size: "6vh",
1131
+ c: alpha(props.color || theme.colors[theme.primaryColor][theme.primaryShade], 0.9),
1132
+ style: {
1133
+ fontFamily: "Akrobat Black",
1134
+ textShadow: `0 0 10px ${alpha(props.color || theme.colors[theme.primaryColor][theme.primaryShade], 0.7)}`
1135
+ },
1136
+ children: props.level
1137
+ }
1138
+ )
1139
+ }
1140
+ )
1141
+ }
1142
+ ),
1143
+ /* @__PURE__ */ jsx(
1144
+ Text,
1145
+ {
1146
+ size: "sm",
1147
+ style: {
1148
+ fontFamily: "Akrobat Black",
1149
+ letterSpacing: "0.05em",
1150
+ textTransform: "uppercase"
1151
+ },
1152
+ children: props.text || locale("Level")
1153
+ }
1154
+ ),
1155
+ /* @__PURE__ */ jsxs(
1156
+ Text,
1157
+ {
1158
+ size: "xs",
1159
+ c: "rgba(255,255,255,0.6)",
1160
+ children: [
1161
+ props.exp,
1162
+ "/",
1163
+ props.nextLevelXP,
1164
+ " ",
1165
+ locale("EXP")
1166
+ ]
1167
+ }
1168
+ )
1169
+ ]
1170
+ }
1171
+ );
1172
+ }
1173
+ var ModalContext = createContext(null);
1174
+ function useModal(selector) {
1175
+ const modal = useContext(ModalContext);
1176
+ if (!modal) {
1177
+ throw new Error("useModal must be used within a ModalProvider");
1178
+ }
1179
+ return useStore(modal, selector);
1180
+ }
1181
+ function ModalProvider({ children, defaultPage }) {
1182
+ const storeRef = useRef(
1183
+ create(() => ({
1184
+ active: null
1185
+ }))
1186
+ );
1187
+ return /* @__PURE__ */ jsxs(ModalContext.Provider, { value: storeRef.current, children: [
1188
+ /* @__PURE__ */ jsx(Modal, {}),
1189
+ children
1190
+ ] });
1191
+ }
1192
+ function useModalActions() {
1193
+ const modal = useContext(ModalContext);
1194
+ if (!modal) throw new Error("useModalActions must be used within a ModalProvider");
1195
+ const showModal = (openModal) => {
1196
+ modal.setState({ active: openModal });
1197
+ };
1198
+ const hideModal = () => {
1199
+ modal.setState({ active: null });
1200
+ };
1201
+ return { showModal, hideModal };
1202
+ }
1203
+ function Modal() {
1204
+ const active = useModal((state) => state.active);
1205
+ const { hideModal } = useModalActions();
1206
+ const ref = useClickOutside(() => {
1207
+ if (!active) return;
1208
+ if (active.clickOutside == false) return;
1209
+ if (active) {
1210
+ hideModal();
1211
+ }
1212
+ });
1213
+ const theme = useMantineTheme();
1214
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: active && /* @__PURE__ */ jsx(
1215
+ MotionFlex,
1216
+ {
1217
+ h: "100%",
1218
+ w: "100%",
1219
+ bg: "rgba(0, 0, 0, 0.3)",
1220
+ pos: "absolute",
1221
+ style: {
1222
+ zIndex: 2e3,
1223
+ filter: "drop-shadow(0 0 2vh black)"
1224
+ },
1225
+ initial: { opacity: 0 },
1226
+ animate: { opacity: 1 },
1227
+ exit: { opacity: 0 },
1228
+ align: "center",
1229
+ justify: "center",
1230
+ children: /* @__PURE__ */ jsxs(
1231
+ MotionFlex,
1232
+ {
1233
+ pos: "absolute",
1234
+ top: "50%",
1235
+ left: "50%",
1236
+ ref,
1237
+ w: active.width || "40%",
1238
+ style: {
1239
+ transform: "translate(-50%, -50%)",
1240
+ borderRadius: theme.radius.xs,
1241
+ boxShadow: theme.shadows.xl,
1242
+ zIndex: 2100
1243
+ },
1244
+ bg: "rgba(48, 48, 48, 0.84)",
1245
+ initial: { scale: 0.8, opacity: 0, transform: "translate(-50%, -50%)" },
1246
+ animate: { scale: 1, opacity: 1, transform: "translate(-50%, -50%)" },
1247
+ exit: { scale: 0.8, opacity: 0, transform: "translate(-50%, -50%)" },
1248
+ p: "sm",
1249
+ direction: "column",
1250
+ maw: "70%",
1251
+ gap: "xs",
1252
+ children: [
1253
+ /* @__PURE__ */ jsxs(
1254
+ Flex,
1255
+ {
1256
+ direction: "column",
1257
+ w: "100%",
1258
+ children: [
1259
+ /* @__PURE__ */ jsxs(
1260
+ Flex,
1261
+ {
1262
+ w: "100%",
1263
+ align: "center",
1264
+ gap: "xs",
1265
+ children: [
1266
+ active.icon && /* @__PURE__ */ jsx(
1267
+ FontAwesomeIcon,
1268
+ {
1269
+ icon: active.icon,
1270
+ style: {
1271
+ fontSize: theme.fontSizes.xs
1272
+ }
1273
+ }
1274
+ ),
1275
+ /* @__PURE__ */ jsx(
1276
+ Text,
1277
+ {
1278
+ size: "sm",
1279
+ children: active.title
1280
+ }
1281
+ ),
1282
+ /* @__PURE__ */ jsx(
1283
+ MotionIcon,
1284
+ {
1285
+ icon: "times",
1286
+ color: "rgba(255, 255, 255, 0.7)",
1287
+ whileHover: {
1288
+ scale: 1.1,
1289
+ filter: "brightness(1.2)"
1290
+ },
1291
+ style: {
1292
+ marginLeft: "auto",
1293
+ cursor: "pointer",
1294
+ fontSize: theme.fontSizes.sm
1295
+ },
1296
+ onClick: () => {
1297
+ hideModal();
1298
+ }
1299
+ }
1300
+ )
1301
+ ]
1302
+ }
1303
+ ),
1304
+ active.description && /* @__PURE__ */ jsx(
1305
+ Text,
1306
+ {
1307
+ size: "xs",
1308
+ c: "rgba(255, 255, 255, 0.7)",
1309
+ children: active.description
1310
+ }
1311
+ )
1312
+ ]
1313
+ }
1314
+ ),
1315
+ active.children
1316
+ ]
1317
+ }
1318
+ )
1319
+ }
1320
+ ) });
1321
+ }
1322
+ function PromptModal(props) {
1323
+ const theme = useMantineTheme();
1324
+ return /* @__PURE__ */ jsxs(
1325
+ MotionFlex,
1326
+ {
1327
+ gap: "sm",
1328
+ direction: "column",
1329
+ flex: 1,
1330
+ children: [
1331
+ /* @__PURE__ */ jsx(
1332
+ Text,
1333
+ {
1334
+ size: "xs",
1335
+ c: "rgba(255, 255, 255, 0.8)",
1336
+ children: props.message
1337
+ }
1338
+ ),
1339
+ /* @__PURE__ */ jsx(
1340
+ Flex,
1341
+ {
1342
+ gap: "sm",
1343
+ children: props.buttons.map((button, index) => /* @__PURE__ */ jsx(
1344
+ Button,
1345
+ {
1346
+ variant: button.variant,
1347
+ color: button.color,
1348
+ flex: 0.5,
1349
+ onClick: button.onClick,
1350
+ leftSection: button.icon ? /* @__PURE__ */ jsx(
1351
+ FontAwesomeIcon,
1352
+ {
1353
+ icon: button.icon,
1354
+ style: {
1355
+ fontSize: theme.fontSizes.xs
1356
+ }
1357
+ }
1358
+ ) : void 0,
1359
+ children: button.text
1360
+ },
1361
+ index
1362
+ ))
1363
+ }
1364
+ )
1365
+ ]
1366
+ }
1367
+ );
1368
+ }
1369
+
1370
+ export { BorderedIcon, Counter, FloatingParticles, InfoBox, InputContainer, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PromptModal, SegmentedControl, SegmentedProgress, Title, useModal, useModalActions, useNavigation, useNavigationStore };
1371
+ //# sourceMappingURL=index.js.map
1372
+ //# sourceMappingURL=index.js.map