@unifiedsoftware/react-ui 1.0.0 → 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,2186 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/components/Button/Button.tsx
34
+ import clsx from "clsx";
35
+ import { forwardRef } from "react";
36
+ import { jsx, jsxs } from "react/jsx-runtime";
37
+ var prefixCls = "us-";
38
+ var Button = forwardRef(
39
+ (_a, ref) => {
40
+ var _b = _a, { as: Component2 = "button", children, className, variant = "text", color = "primary", size = "md" } = _b, rest = __objRest(_b, ["as", "children", "className", "variant", "color", "size"]);
41
+ return /* @__PURE__ */ jsxs(
42
+ Component2,
43
+ __spreadProps(__spreadValues({
44
+ ref,
45
+ className: clsx(
46
+ `${prefixCls}button`,
47
+ {
48
+ [`${prefixCls}button--${variant}`]: variant,
49
+ [`${prefixCls}button--${color}`]: color,
50
+ [`${prefixCls}button--${size}`]: size
51
+ },
52
+ className
53
+ )
54
+ }, rest), {
55
+ children: [
56
+ /* @__PURE__ */ jsx("div", { className: `${prefixCls}button__elevation` }),
57
+ /* @__PURE__ */ jsx("div", { className: `${prefixCls}button__outline` }),
58
+ children
59
+ ]
60
+ })
61
+ );
62
+ }
63
+ );
64
+
65
+ // src/components/Tabs/Tab.tsx
66
+ import clsx2 from "clsx";
67
+ import mergeRefs from "merge-refs";
68
+ import { forwardRef as forwardRef2, useEffect, useRef } from "react";
69
+
70
+ // src/components/Tabs/TabsContext.ts
71
+ import { createContext, useContext } from "react";
72
+ var TabsContext = createContext(null);
73
+ var useTabs = () => {
74
+ const context = useContext(TabsContext);
75
+ if (!context) {
76
+ throw new Error("`useTabs` must be used within a `<Tabs />`");
77
+ }
78
+ return context;
79
+ };
80
+
81
+ // src/components/Tabs/Tab.tsx
82
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
83
+ var prefixCls2 = "us-";
84
+ var Tab = forwardRef2(
85
+ (_a, ref) => {
86
+ var _b = _a, { as: Component2 = "div", children, className, value, onClick } = _b, rest = __objRest(_b, ["as", "children", "className", "value", "onClick"]);
87
+ const tabRef = useRef(null);
88
+ const tabs = useTabs();
89
+ const handleClick = (event) => {
90
+ const previousTab = tabs.previousTabRef.current;
91
+ const currentTab = tabRef.current;
92
+ if (!currentTab)
93
+ return;
94
+ if (previousTab) {
95
+ const previousIndicator = previousTab.querySelector(`.${prefixCls2}tab__indicator`);
96
+ const currentIndicator = currentTab.querySelector(`.${prefixCls2}tab__indicator`);
97
+ if (!previousIndicator || !currentIndicator)
98
+ return;
99
+ const from = {};
100
+ const fromRect = previousIndicator.getBoundingClientRect();
101
+ const fromPos = fromRect.left;
102
+ const fromWidth = fromRect.width;
103
+ const toRect = currentIndicator.getBoundingClientRect();
104
+ const toPos = toRect.left;
105
+ const toWidth = toRect.width;
106
+ const scale = fromWidth / toWidth;
107
+ if (scale) {
108
+ from["transform"] = `translateX(${(fromPos - toPos).toFixed(4)}px) scaleX(${scale.toFixed(4)})`;
109
+ } else {
110
+ from["opacity"] = 0;
111
+ }
112
+ const keyframes = [from, { transform: "none" }];
113
+ currentIndicator.animate(keyframes, {
114
+ duration: 250,
115
+ easing: "cubic-bezier(.3,0,0,1)"
116
+ });
117
+ tabs.previousTabRef.current = tabRef.current;
118
+ }
119
+ tabs.previousTabRef.current = tabRef.current;
120
+ tabs.onChange(value);
121
+ onClick == null ? void 0 : onClick(event);
122
+ };
123
+ useEffect(() => {
124
+ if (value === tabs.value) {
125
+ tabs.previousTabRef.current = tabRef.current;
126
+ }
127
+ }, []);
128
+ return /* @__PURE__ */ jsx2(
129
+ Component2,
130
+ __spreadProps(__spreadValues({
131
+ ref: mergeRefs(tabRef, ref),
132
+ className: clsx2(`${prefixCls2}tab`, { [`${prefixCls2}tab--selected`]: value === tabs.value }, className),
133
+ onClick: handleClick
134
+ }, rest), {
135
+ children: /* @__PURE__ */ jsxs2("div", { className: `${prefixCls2}tab__content`, children: [
136
+ children,
137
+ /* @__PURE__ */ jsx2("div", { className: `${prefixCls2}tab__indicator` })
138
+ ] })
139
+ })
140
+ );
141
+ }
142
+ );
143
+
144
+ // src/components/Tabs/Tabs.tsx
145
+ import clsx3 from "clsx";
146
+ import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
147
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
148
+ var prefixCls3 = "us-";
149
+ var Tabs = (_a) => {
150
+ var _b = _a, { children, className, value, defaultValue, onChange } = _b, rest = __objRest(_b, ["children", "className", "value", "defaultValue", "onChange"]);
151
+ const previousTabRef = useRef2(null);
152
+ const [selfValue, setSelfValue] = useState(value != null ? value : defaultValue);
153
+ const handleChange = (value2) => {
154
+ setSelfValue(value2);
155
+ onChange == null ? void 0 : onChange(value2);
156
+ };
157
+ useEffect2(() => {
158
+ if (value !== void 0) {
159
+ setSelfValue(value);
160
+ }
161
+ }, [value]);
162
+ return /* @__PURE__ */ jsxs3(TabsContext.Provider, { value: { previousTabRef, value: selfValue, onChange: handleChange }, children: [
163
+ /* @__PURE__ */ jsx3("div", __spreadProps(__spreadValues({ className: clsx3(`${prefixCls3}tabs`, className) }, rest), { children })),
164
+ /* @__PURE__ */ jsx3("div", { className: `${prefixCls3}divider` })
165
+ ] });
166
+ };
167
+
168
+ // src/components/DropdownEnumList.tsx
169
+ import { DropDownList } from "@progress/kendo-react-dropdowns";
170
+ import { useEffect as useEffect3, useState as useState2 } from "react";
171
+ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
172
+ function parsearDataForComboBox(array, key, text, itemAll = false) {
173
+ const dataForComboBox = [];
174
+ if (itemAll)
175
+ dataForComboBox.push({ key: "", text: "ALL" });
176
+ if (array !== void 0) {
177
+ array.map((a) => {
178
+ dataForComboBox.push({ key: a[key], text: a[text] });
179
+ });
180
+ }
181
+ return dataForComboBox;
182
+ }
183
+ function GetEnumDescription(key, typeEnum, description) {
184
+ const listLabel = description.get(typeEnum);
185
+ let label = void 0;
186
+ if (listLabel != void 0)
187
+ label = listLabel.get(parseInt(key));
188
+ if (label == void 0) {
189
+ label = typeEnum[key];
190
+ return label.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
191
+ }
192
+ return label;
193
+ }
194
+ function EnumToArray(typeEnum, replaceGuionForSpace = true, description) {
195
+ const values = [];
196
+ for (const key in typeEnum) {
197
+ if (typeof typeEnum[key] === "string")
198
+ values.push({
199
+ value: Number(key),
200
+ label: replaceGuionForSpace ? GetEnumDescription(key, typeEnum, description) : typeEnum[key]
201
+ });
202
+ }
203
+ return values;
204
+ }
205
+ var DropEnumList = ({ dataEnum, description, onChange, width, defaultValue }) => {
206
+ const [value, setValue] = useState2("");
207
+ const [data, setData] = useState2([]);
208
+ useEffect3(() => {
209
+ setData(
210
+ parsearDataForComboBox(EnumToArray(dataEnum, true, description), "value", "label", false).sort(
211
+ (a, b) => Number(a.key) - Number(b.key)
212
+ )
213
+ );
214
+ }, []);
215
+ useEffect3(() => {
216
+ if (data.length > 0) {
217
+ setValue(data.filter((x) => x.key == defaultValue)[0]);
218
+ }
219
+ }, [data]);
220
+ const handleOptionClick = (e) => {
221
+ onChange(e);
222
+ setValue(e);
223
+ };
224
+ return /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsx4(
225
+ DropDownList,
226
+ {
227
+ className: "d-inline-block align-middle mr-2",
228
+ data,
229
+ dataItemKey: "key",
230
+ id: "cmbDisplay",
231
+ name: "cmbDisplay",
232
+ onChange: (event) => {
233
+ handleOptionClick(event.value);
234
+ },
235
+ textField: "text",
236
+ style: {
237
+ width: `${width}px`
238
+ },
239
+ defaultValue: value
240
+ }
241
+ ) });
242
+ };
243
+
244
+ // src/contexts/BreadCrumbContext.tsx
245
+ import { createContext as createContext2, useState as useState4 } from "react";
246
+
247
+ // src/hooks/useLocalStorage.tsx
248
+ import { useCallback, useEffect as useEffect5, useState as useState3 } from "react";
249
+
250
+ // src/hooks/useEventListener.tsx
251
+ import { useRef as useRef3 } from "react";
252
+
253
+ // src/hooks/useIsomorphicLayoutEffect.tsx
254
+ import { useEffect as useEffect4, useLayoutEffect } from "react";
255
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect4;
256
+ var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
257
+
258
+ // src/hooks/useEventListener.tsx
259
+ function useEventListener(handler) {
260
+ const savedHandler = useRef3(handler);
261
+ useIsomorphicLayoutEffect_default(() => {
262
+ savedHandler.current = handler;
263
+ }, [handler]);
264
+ }
265
+ var useEventListener_default = useEventListener;
266
+
267
+ // src/hooks/useLocalStorage.tsx
268
+ function useLocalStorage(key, initialValue) {
269
+ const readValue = useCallback(() => {
270
+ if (typeof window === "undefined") {
271
+ return initialValue;
272
+ }
273
+ try {
274
+ const item = window.localStorage.getItem(key);
275
+ return item ? parseJSON(item) : initialValue;
276
+ } catch (error) {
277
+ console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
278
+ return initialValue;
279
+ }
280
+ }, [initialValue, key]);
281
+ const [storedValue, setStoredValue] = useState3(readValue);
282
+ const setValue = useCallback(
283
+ (value) => {
284
+ if (typeof window == "undefined") {
285
+ console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
286
+ }
287
+ try {
288
+ const newValue = value instanceof Function ? value(storedValue) : value;
289
+ window.localStorage.setItem(key, JSON.stringify(newValue));
290
+ setStoredValue(newValue);
291
+ window.dispatchEvent(new Event("local-storage"));
292
+ } catch (error) {
293
+ console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
294
+ }
295
+ },
296
+ [key, storedValue]
297
+ );
298
+ useEffect5(() => {
299
+ setStoredValue(readValue());
300
+ }, []);
301
+ const handleStorageChange = useCallback(() => {
302
+ setStoredValue(readValue());
303
+ }, [readValue]);
304
+ useEventListener_default("storage", handleStorageChange);
305
+ useEventListener_default("local-storage", handleStorageChange);
306
+ return [storedValue, setValue];
307
+ }
308
+ function parseJSON(value) {
309
+ try {
310
+ return value === "undefined" ? void 0 : JSON.parse(value != null ? value : "");
311
+ } catch (e) {
312
+ console.log("parsing error on", { value });
313
+ return void 0;
314
+ }
315
+ }
316
+
317
+ // src/contexts/BreadCrumbContext.tsx
318
+ import { jsx as jsx5 } from "react/jsx-runtime";
319
+ var BreadCrumbContext = createContext2({});
320
+ var BreadCrumbContextProvider = ({ children }) => {
321
+ const [active, setActive] = useLocalStorage("@active", "");
322
+ const [path, setPath] = useLocalStorage("@path", "/");
323
+ const [goBack, setGoBack] = useLocalStorage("@goBack", false);
324
+ const [pathChild, setPathChild] = useLocalStorage("@pathChild", "");
325
+ const [routes, setRoutes] = useState4([]);
326
+ return /* @__PURE__ */ jsx5(
327
+ BreadCrumbContext.Provider,
328
+ {
329
+ value: {
330
+ active,
331
+ setActive,
332
+ path,
333
+ setPath,
334
+ goBack,
335
+ setGoBack,
336
+ pathChild,
337
+ setPathChild,
338
+ routes,
339
+ setRoutes
340
+ },
341
+ children
342
+ }
343
+ );
344
+ };
345
+
346
+ // src/contexts/DrawerContext.tsx
347
+ import { createContext as createContext3, useState as useState5 } from "react";
348
+ import { jsx as jsx6 } from "react/jsx-runtime";
349
+ var DrawerContext = createContext3({});
350
+ var DrawerContextProvider = ({ children }) => {
351
+ const [active, setActive] = useState5(false);
352
+ return /* @__PURE__ */ jsx6(DrawerContext.Provider, { value: { active, setActive }, children });
353
+ };
354
+
355
+ // src/contexts/HistoryContext.tsx
356
+ import { createContext as createContext4 } from "react";
357
+ import { jsx as jsx7 } from "react/jsx-runtime";
358
+ var HistoryContext = createContext4({});
359
+ var HistoryContextProvider = ({ children }) => {
360
+ const [list, setList] = useLocalStorage("@list_paths", []);
361
+ const updateList = (value) => {
362
+ setList(
363
+ (prev) => prev.concat({
364
+ path: value.path,
365
+ name: value.name,
366
+ date: /* @__PURE__ */ new Date()
367
+ })
368
+ );
369
+ };
370
+ return /* @__PURE__ */ jsx7(HistoryContext.Provider, { value: { list, updateList }, children });
371
+ };
372
+
373
+ // src/contexts/SidebarMainContext.tsx
374
+ import { createContext as createContext5, useState as useState6 } from "react";
375
+ import { jsx as jsx8 } from "react/jsx-runtime";
376
+ var SidebarMainContext = createContext5({});
377
+ var SidebarMainContextProvider = ({ children }) => {
378
+ const [open, setOpen] = useState6(true);
379
+ return /* @__PURE__ */ jsx8(SidebarMainContext.Provider, { value: { open, setOpen }, children });
380
+ };
381
+
382
+ // src/contexts/GlobalProvider.tsx
383
+ import { jsx as jsx9 } from "react/jsx-runtime";
384
+ function GlobalProvider({ children }) {
385
+ return /* @__PURE__ */ jsx9(HistoryContextProvider, { children: /* @__PURE__ */ jsx9(BreadCrumbContextProvider, { children: /* @__PURE__ */ jsx9(SidebarMainContextProvider, { children: /* @__PURE__ */ jsx9(DrawerContextProvider, { children }) }) }) });
386
+ }
387
+
388
+ // src/hooks/usePrevious.tsx
389
+ import { useEffect as useEffect6, useRef as useRef4 } from "react";
390
+ var usePrevious = (value) => {
391
+ const ref = useRef4();
392
+ useEffect6(() => {
393
+ ref.current = value;
394
+ });
395
+ return ref.current;
396
+ };
397
+
398
+ // src/hooks/useStep.tsx
399
+ import { useCallback as useCallback2, useMemo, useState as useState7 } from "react";
400
+ var useStep = (maxStep) => {
401
+ const [currentStep, setCurrentStep] = useState7(1);
402
+ const canGoToNextStep = useMemo(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
403
+ const canGoToPrevStep = useMemo(() => currentStep - 1 >= 1, [currentStep]);
404
+ const setStep = useCallback2(
405
+ (step) => {
406
+ const newStep = step instanceof Function ? step(currentStep) : step;
407
+ if (newStep >= 1 && newStep <= maxStep) {
408
+ setCurrentStep(newStep);
409
+ return;
410
+ }
411
+ throw new Error("Step not valid");
412
+ },
413
+ [maxStep, currentStep]
414
+ );
415
+ const goToNextStep = useCallback2(() => {
416
+ if (canGoToNextStep) {
417
+ setCurrentStep((step) => step + 1);
418
+ }
419
+ }, [canGoToNextStep]);
420
+ const goToPrevStep = useCallback2(() => {
421
+ if (canGoToPrevStep) {
422
+ setCurrentStep((step) => step - 1);
423
+ }
424
+ }, [canGoToPrevStep]);
425
+ const reset = useCallback2(() => {
426
+ setCurrentStep(1);
427
+ }, []);
428
+ return [
429
+ currentStep,
430
+ {
431
+ goToNextStep,
432
+ goToPrevStep,
433
+ canGoToNextStep,
434
+ canGoToPrevStep,
435
+ setStep,
436
+ reset
437
+ }
438
+ ];
439
+ };
440
+
441
+ // src/layout/AppBreadcrumb.tsx
442
+ import { useContext as useContext4, useEffect as useEffect9 } from "react";
443
+ import { MdClose } from "react-icons/md";
444
+ import { VscChevronRight } from "react-icons/vsc";
445
+
446
+ // ../../../node_modules/react-router-dom/dist/index.js
447
+ import * as React2 from "react";
448
+
449
+ // ../../../node_modules/react-router/dist/index.js
450
+ import * as React from "react";
451
+
452
+ // ../../../node_modules/@remix-run/router/dist/router.js
453
+ function _extends() {
454
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
455
+ for (var i = 1; i < arguments.length; i++) {
456
+ var source = arguments[i];
457
+ for (var key in source) {
458
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
459
+ target[key] = source[key];
460
+ }
461
+ }
462
+ }
463
+ return target;
464
+ };
465
+ return _extends.apply(this, arguments);
466
+ }
467
+ var Action;
468
+ (function(Action2) {
469
+ Action2["Pop"] = "POP";
470
+ Action2["Push"] = "PUSH";
471
+ Action2["Replace"] = "REPLACE";
472
+ })(Action || (Action = {}));
473
+ function invariant(value, message) {
474
+ if (value === false || value === null || typeof value === "undefined") {
475
+ throw new Error(message);
476
+ }
477
+ }
478
+ function warning(cond, message) {
479
+ if (!cond) {
480
+ if (typeof console !== "undefined")
481
+ console.warn(message);
482
+ try {
483
+ throw new Error(message);
484
+ } catch (e) {
485
+ }
486
+ }
487
+ }
488
+ function createPath(_ref) {
489
+ let {
490
+ pathname = "/",
491
+ search = "",
492
+ hash = ""
493
+ } = _ref;
494
+ if (search && search !== "?")
495
+ pathname += search.charAt(0) === "?" ? search : "?" + search;
496
+ if (hash && hash !== "#")
497
+ pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
498
+ return pathname;
499
+ }
500
+ function parsePath(path) {
501
+ let parsedPath = {};
502
+ if (path) {
503
+ let hashIndex = path.indexOf("#");
504
+ if (hashIndex >= 0) {
505
+ parsedPath.hash = path.substr(hashIndex);
506
+ path = path.substr(0, hashIndex);
507
+ }
508
+ let searchIndex = path.indexOf("?");
509
+ if (searchIndex >= 0) {
510
+ parsedPath.search = path.substr(searchIndex);
511
+ path = path.substr(0, searchIndex);
512
+ }
513
+ if (path) {
514
+ parsedPath.pathname = path;
515
+ }
516
+ }
517
+ return parsedPath;
518
+ }
519
+ var ResultType;
520
+ (function(ResultType2) {
521
+ ResultType2["data"] = "data";
522
+ ResultType2["deferred"] = "deferred";
523
+ ResultType2["redirect"] = "redirect";
524
+ ResultType2["error"] = "error";
525
+ })(ResultType || (ResultType = {}));
526
+ function convertRouteMatchToUiMatch(match, loaderData) {
527
+ let {
528
+ route,
529
+ pathname,
530
+ params
531
+ } = match;
532
+ return {
533
+ id: route.id,
534
+ pathname,
535
+ params,
536
+ data: loaderData[route.id],
537
+ handle: route.handle
538
+ };
539
+ }
540
+ function stripBasename(pathname, basename) {
541
+ if (basename === "/")
542
+ return pathname;
543
+ if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
544
+ return null;
545
+ }
546
+ let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
547
+ let nextChar = pathname.charAt(startIndex);
548
+ if (nextChar && nextChar !== "/") {
549
+ return null;
550
+ }
551
+ return pathname.slice(startIndex) || "/";
552
+ }
553
+ function resolvePath(to, fromPathname) {
554
+ if (fromPathname === void 0) {
555
+ fromPathname = "/";
556
+ }
557
+ let {
558
+ pathname: toPathname,
559
+ search = "",
560
+ hash = ""
561
+ } = typeof to === "string" ? parsePath(to) : to;
562
+ let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
563
+ return {
564
+ pathname,
565
+ search: normalizeSearch(search),
566
+ hash: normalizeHash(hash)
567
+ };
568
+ }
569
+ function resolvePathname(relativePath, fromPathname) {
570
+ let segments = fromPathname.replace(/\/+$/, "").split("/");
571
+ let relativeSegments = relativePath.split("/");
572
+ relativeSegments.forEach((segment) => {
573
+ if (segment === "..") {
574
+ if (segments.length > 1)
575
+ segments.pop();
576
+ } else if (segment !== ".") {
577
+ segments.push(segment);
578
+ }
579
+ });
580
+ return segments.length > 1 ? segments.join("/") : "/";
581
+ }
582
+ function getInvalidPathError(char, field, dest, path) {
583
+ return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
584
+ }
585
+ function getPathContributingMatches(matches) {
586
+ return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
587
+ }
588
+ function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
589
+ if (isPathRelative === void 0) {
590
+ isPathRelative = false;
591
+ }
592
+ let to;
593
+ if (typeof toArg === "string") {
594
+ to = parsePath(toArg);
595
+ } else {
596
+ to = _extends({}, toArg);
597
+ invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
598
+ invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
599
+ invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
600
+ }
601
+ let isEmptyPath = toArg === "" || to.pathname === "";
602
+ let toPathname = isEmptyPath ? "/" : to.pathname;
603
+ let from;
604
+ if (isPathRelative || toPathname == null) {
605
+ from = locationPathname;
606
+ } else {
607
+ let routePathnameIndex = routePathnames.length - 1;
608
+ if (toPathname.startsWith("..")) {
609
+ let toSegments = toPathname.split("/");
610
+ while (toSegments[0] === "..") {
611
+ toSegments.shift();
612
+ routePathnameIndex -= 1;
613
+ }
614
+ to.pathname = toSegments.join("/");
615
+ }
616
+ from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
617
+ }
618
+ let path = resolvePath(to, from);
619
+ let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
620
+ let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
621
+ if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
622
+ path.pathname += "/";
623
+ }
624
+ return path;
625
+ }
626
+ var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
627
+ var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
628
+ var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
629
+ var validMutationMethodsArr = ["post", "put", "patch", "delete"];
630
+ var validMutationMethods = new Set(validMutationMethodsArr);
631
+ var validRequestMethodsArr = ["get", ...validMutationMethodsArr];
632
+ var validRequestMethods = new Set(validRequestMethodsArr);
633
+ var UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
634
+
635
+ // ../../../node_modules/react-router/dist/index.js
636
+ function _extends2() {
637
+ _extends2 = Object.assign ? Object.assign.bind() : function(target) {
638
+ for (var i = 1; i < arguments.length; i++) {
639
+ var source = arguments[i];
640
+ for (var key in source) {
641
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
642
+ target[key] = source[key];
643
+ }
644
+ }
645
+ }
646
+ return target;
647
+ };
648
+ return _extends2.apply(this, arguments);
649
+ }
650
+ var DataRouterContext = /* @__PURE__ */ React.createContext(null);
651
+ if (process.env.NODE_ENV !== "production") {
652
+ DataRouterContext.displayName = "DataRouter";
653
+ }
654
+ var DataRouterStateContext = /* @__PURE__ */ React.createContext(null);
655
+ if (process.env.NODE_ENV !== "production") {
656
+ DataRouterStateContext.displayName = "DataRouterState";
657
+ }
658
+ var AwaitContext = /* @__PURE__ */ React.createContext(null);
659
+ if (process.env.NODE_ENV !== "production") {
660
+ AwaitContext.displayName = "Await";
661
+ }
662
+ var NavigationContext = /* @__PURE__ */ React.createContext(null);
663
+ if (process.env.NODE_ENV !== "production") {
664
+ NavigationContext.displayName = "Navigation";
665
+ }
666
+ var LocationContext = /* @__PURE__ */ React.createContext(null);
667
+ if (process.env.NODE_ENV !== "production") {
668
+ LocationContext.displayName = "Location";
669
+ }
670
+ var RouteContext = /* @__PURE__ */ React.createContext({
671
+ outlet: null,
672
+ matches: [],
673
+ isDataRoute: false
674
+ });
675
+ if (process.env.NODE_ENV !== "production") {
676
+ RouteContext.displayName = "Route";
677
+ }
678
+ var RouteErrorContext = /* @__PURE__ */ React.createContext(null);
679
+ if (process.env.NODE_ENV !== "production") {
680
+ RouteErrorContext.displayName = "RouteError";
681
+ }
682
+ function useHref(to, _temp) {
683
+ let {
684
+ relative
685
+ } = _temp === void 0 ? {} : _temp;
686
+ !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
687
+ false,
688
+ // TODO: This error is probably because they somehow have 2 versions of the
689
+ // router loaded. We can help them understand how to avoid that.
690
+ "useHref() may be used only in the context of a <Router> component."
691
+ ) : invariant(false) : void 0;
692
+ let {
693
+ basename,
694
+ navigator
695
+ } = React.useContext(NavigationContext);
696
+ let {
697
+ hash,
698
+ pathname,
699
+ search
700
+ } = useResolvedPath(to, {
701
+ relative
702
+ });
703
+ let joinedPathname = pathname;
704
+ if (basename !== "/") {
705
+ joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
706
+ }
707
+ return navigator.createHref({
708
+ pathname: joinedPathname,
709
+ search,
710
+ hash
711
+ });
712
+ }
713
+ function useInRouterContext() {
714
+ return React.useContext(LocationContext) != null;
715
+ }
716
+ function useLocation() {
717
+ !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
718
+ false,
719
+ // TODO: This error is probably because they somehow have 2 versions of the
720
+ // router loaded. We can help them understand how to avoid that.
721
+ "useLocation() may be used only in the context of a <Router> component."
722
+ ) : invariant(false) : void 0;
723
+ return React.useContext(LocationContext).location;
724
+ }
725
+ var navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
726
+ function useIsomorphicLayoutEffect2(cb) {
727
+ let isStatic = React.useContext(NavigationContext).static;
728
+ if (!isStatic) {
729
+ React.useLayoutEffect(cb);
730
+ }
731
+ }
732
+ function useNavigate() {
733
+ let {
734
+ isDataRoute
735
+ } = React.useContext(RouteContext);
736
+ return isDataRoute ? useNavigateStable() : useNavigateUnstable();
737
+ }
738
+ function useNavigateUnstable() {
739
+ !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
740
+ false,
741
+ // TODO: This error is probably because they somehow have 2 versions of the
742
+ // router loaded. We can help them understand how to avoid that.
743
+ "useNavigate() may be used only in the context of a <Router> component."
744
+ ) : invariant(false) : void 0;
745
+ let dataRouterContext = React.useContext(DataRouterContext);
746
+ let {
747
+ basename,
748
+ navigator
749
+ } = React.useContext(NavigationContext);
750
+ let {
751
+ matches
752
+ } = React.useContext(RouteContext);
753
+ let {
754
+ pathname: locationPathname
755
+ } = useLocation();
756
+ let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));
757
+ let activeRef = React.useRef(false);
758
+ useIsomorphicLayoutEffect2(() => {
759
+ activeRef.current = true;
760
+ });
761
+ let navigate = React.useCallback(function(to, options) {
762
+ if (options === void 0) {
763
+ options = {};
764
+ }
765
+ process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
766
+ if (!activeRef.current)
767
+ return;
768
+ if (typeof to === "number") {
769
+ navigator.go(to);
770
+ return;
771
+ }
772
+ let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
773
+ if (dataRouterContext == null && basename !== "/") {
774
+ path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
775
+ }
776
+ (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
777
+ }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);
778
+ return navigate;
779
+ }
780
+ function useResolvedPath(to, _temp2) {
781
+ let {
782
+ relative
783
+ } = _temp2 === void 0 ? {} : _temp2;
784
+ let {
785
+ matches
786
+ } = React.useContext(RouteContext);
787
+ let {
788
+ pathname: locationPathname
789
+ } = useLocation();
790
+ let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));
791
+ return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
792
+ }
793
+ var DataRouterHook = /* @__PURE__ */ function(DataRouterHook3) {
794
+ DataRouterHook3["UseBlocker"] = "useBlocker";
795
+ DataRouterHook3["UseRevalidator"] = "useRevalidator";
796
+ DataRouterHook3["UseNavigateStable"] = "useNavigate";
797
+ return DataRouterHook3;
798
+ }(DataRouterHook || {});
799
+ var DataRouterStateHook = /* @__PURE__ */ function(DataRouterStateHook3) {
800
+ DataRouterStateHook3["UseBlocker"] = "useBlocker";
801
+ DataRouterStateHook3["UseLoaderData"] = "useLoaderData";
802
+ DataRouterStateHook3["UseActionData"] = "useActionData";
803
+ DataRouterStateHook3["UseRouteError"] = "useRouteError";
804
+ DataRouterStateHook3["UseNavigation"] = "useNavigation";
805
+ DataRouterStateHook3["UseRouteLoaderData"] = "useRouteLoaderData";
806
+ DataRouterStateHook3["UseMatches"] = "useMatches";
807
+ DataRouterStateHook3["UseRevalidator"] = "useRevalidator";
808
+ DataRouterStateHook3["UseNavigateStable"] = "useNavigate";
809
+ DataRouterStateHook3["UseRouteId"] = "useRouteId";
810
+ return DataRouterStateHook3;
811
+ }(DataRouterStateHook || {});
812
+ function getDataRouterConsoleError(hookName) {
813
+ return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
814
+ }
815
+ function useDataRouterContext(hookName) {
816
+ let ctx = React.useContext(DataRouterContext);
817
+ !ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
818
+ return ctx;
819
+ }
820
+ function useDataRouterState(hookName) {
821
+ let state = React.useContext(DataRouterStateContext);
822
+ !state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
823
+ return state;
824
+ }
825
+ function useRouteContext(hookName) {
826
+ let route = React.useContext(RouteContext);
827
+ !route ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
828
+ return route;
829
+ }
830
+ function useCurrentRouteId(hookName) {
831
+ let route = useRouteContext(hookName);
832
+ let thisRoute = route.matches[route.matches.length - 1];
833
+ !thisRoute.route.id ? process.env.NODE_ENV !== "production" ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;
834
+ return thisRoute.route.id;
835
+ }
836
+ function useRouteId() {
837
+ return useCurrentRouteId(DataRouterStateHook.UseRouteId);
838
+ }
839
+ function useNavigation() {
840
+ let state = useDataRouterState(DataRouterStateHook.UseNavigation);
841
+ return state.navigation;
842
+ }
843
+ function useMatches() {
844
+ let {
845
+ matches,
846
+ loaderData
847
+ } = useDataRouterState(DataRouterStateHook.UseMatches);
848
+ return React.useMemo(() => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]);
849
+ }
850
+ function useNavigateStable() {
851
+ let {
852
+ router
853
+ } = useDataRouterContext(DataRouterHook.UseNavigateStable);
854
+ let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);
855
+ let activeRef = React.useRef(false);
856
+ useIsomorphicLayoutEffect2(() => {
857
+ activeRef.current = true;
858
+ });
859
+ let navigate = React.useCallback(function(to, options) {
860
+ if (options === void 0) {
861
+ options = {};
862
+ }
863
+ process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
864
+ if (!activeRef.current)
865
+ return;
866
+ if (typeof to === "number") {
867
+ router.navigate(to);
868
+ } else {
869
+ router.navigate(to, _extends2({
870
+ fromRouteId: id
871
+ }, options));
872
+ }
873
+ }, [router, id]);
874
+ return navigate;
875
+ }
876
+ var START_TRANSITION = "startTransition";
877
+ var startTransitionImpl = React[START_TRANSITION];
878
+ function Router(_ref5) {
879
+ let {
880
+ basename: basenameProp = "/",
881
+ children = null,
882
+ location: locationProp,
883
+ navigationType = Action.Pop,
884
+ navigator,
885
+ static: staticProp = false
886
+ } = _ref5;
887
+ !!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : invariant(false) : void 0;
888
+ let basename = basenameProp.replace(/^\/*/, "/");
889
+ let navigationContext = React.useMemo(() => ({
890
+ basename,
891
+ navigator,
892
+ static: staticProp
893
+ }), [basename, navigator, staticProp]);
894
+ if (typeof locationProp === "string") {
895
+ locationProp = parsePath(locationProp);
896
+ }
897
+ let {
898
+ pathname = "/",
899
+ search = "",
900
+ hash = "",
901
+ state = null,
902
+ key = "default"
903
+ } = locationProp;
904
+ let locationContext = React.useMemo(() => {
905
+ let trailingPathname = stripBasename(pathname, basename);
906
+ if (trailingPathname == null) {
907
+ return null;
908
+ }
909
+ return {
910
+ location: {
911
+ pathname: trailingPathname,
912
+ search,
913
+ hash,
914
+ state,
915
+ key
916
+ },
917
+ navigationType
918
+ };
919
+ }, [basename, pathname, search, hash, state, key, navigationType]);
920
+ process.env.NODE_ENV !== "production" ? warning(locationContext != null, '<Router basename="' + basename + '"> is not able to match the URL ' + ('"' + pathname + search + hash + '" because it does not start with the ') + "basename, so the <Router> won't render anything.") : void 0;
921
+ if (locationContext == null) {
922
+ return null;
923
+ }
924
+ return /* @__PURE__ */ React.createElement(NavigationContext.Provider, {
925
+ value: navigationContext
926
+ }, /* @__PURE__ */ React.createElement(LocationContext.Provider, {
927
+ children,
928
+ value: locationContext
929
+ }));
930
+ }
931
+ var neverSettledPromise = new Promise(() => {
932
+ });
933
+
934
+ // ../../../node_modules/react-router-dom/dist/index.js
935
+ function _extends3() {
936
+ _extends3 = Object.assign ? Object.assign.bind() : function(target) {
937
+ for (var i = 1; i < arguments.length; i++) {
938
+ var source = arguments[i];
939
+ for (var key in source) {
940
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
941
+ target[key] = source[key];
942
+ }
943
+ }
944
+ }
945
+ return target;
946
+ };
947
+ return _extends3.apply(this, arguments);
948
+ }
949
+ function _objectWithoutPropertiesLoose(source, excluded) {
950
+ if (source == null)
951
+ return {};
952
+ var target = {};
953
+ var sourceKeys = Object.keys(source);
954
+ var key, i;
955
+ for (i = 0; i < sourceKeys.length; i++) {
956
+ key = sourceKeys[i];
957
+ if (excluded.indexOf(key) >= 0)
958
+ continue;
959
+ target[key] = source[key];
960
+ }
961
+ return target;
962
+ }
963
+ var defaultMethod = "get";
964
+ var defaultEncType = "application/x-www-form-urlencoded";
965
+ function isHtmlElement(object) {
966
+ return object != null && typeof object.tagName === "string";
967
+ }
968
+ function isButtonElement(object) {
969
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
970
+ }
971
+ function isFormElement(object) {
972
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
973
+ }
974
+ function isInputElement(object) {
975
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
976
+ }
977
+ function isModifiedEvent(event) {
978
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
979
+ }
980
+ function shouldProcessLinkClick(event, target) {
981
+ return event.button === 0 && // Ignore everything but left clicks
982
+ (!target || target === "_self") && // Let browser handle "target=_blank" etc.
983
+ !isModifiedEvent(event);
984
+ }
985
+ var _formDataSupportsSubmitter = null;
986
+ function isFormDataSubmitterSupported() {
987
+ if (_formDataSupportsSubmitter === null) {
988
+ try {
989
+ new FormData(
990
+ document.createElement("form"),
991
+ // @ts-expect-error if FormData supports the submitter parameter, this will throw
992
+ 0
993
+ );
994
+ _formDataSupportsSubmitter = false;
995
+ } catch (e) {
996
+ _formDataSupportsSubmitter = true;
997
+ }
998
+ }
999
+ return _formDataSupportsSubmitter;
1000
+ }
1001
+ var supportedFormEncTypes = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
1002
+ function getFormEncType(encType) {
1003
+ if (encType != null && !supportedFormEncTypes.has(encType)) {
1004
+ process.env.NODE_ENV !== "production" ? warning(false, '"' + encType + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + defaultEncType + '"')) : void 0;
1005
+ return null;
1006
+ }
1007
+ return encType;
1008
+ }
1009
+ function getFormSubmissionInfo(target, basename) {
1010
+ let method;
1011
+ let action;
1012
+ let encType;
1013
+ let formData;
1014
+ let body;
1015
+ if (isFormElement(target)) {
1016
+ let attr = target.getAttribute("action");
1017
+ action = attr ? stripBasename(attr, basename) : null;
1018
+ method = target.getAttribute("method") || defaultMethod;
1019
+ encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
1020
+ formData = new FormData(target);
1021
+ } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
1022
+ let form = target.form;
1023
+ if (form == null) {
1024
+ throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
1025
+ }
1026
+ let attr = target.getAttribute("formaction") || form.getAttribute("action");
1027
+ action = attr ? stripBasename(attr, basename) : null;
1028
+ method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
1029
+ encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
1030
+ formData = new FormData(form, target);
1031
+ if (!isFormDataSubmitterSupported()) {
1032
+ let {
1033
+ name,
1034
+ type,
1035
+ value
1036
+ } = target;
1037
+ if (type === "image") {
1038
+ let prefix = name ? name + "." : "";
1039
+ formData.append(prefix + "x", "0");
1040
+ formData.append(prefix + "y", "0");
1041
+ } else if (name) {
1042
+ formData.append(name, value);
1043
+ }
1044
+ }
1045
+ } else if (isHtmlElement(target)) {
1046
+ throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
1047
+ } else {
1048
+ method = defaultMethod;
1049
+ action = null;
1050
+ encType = defaultEncType;
1051
+ body = target;
1052
+ }
1053
+ if (formData && encType === "text/plain") {
1054
+ body = formData;
1055
+ formData = void 0;
1056
+ }
1057
+ return {
1058
+ action,
1059
+ method: method.toLowerCase(),
1060
+ encType,
1061
+ formData,
1062
+ body
1063
+ };
1064
+ }
1065
+ var _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"];
1066
+ var _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];
1067
+ var _excluded3 = ["reloadDocument", "replace", "state", "method", "action", "onSubmit", "submit", "relative", "preventScrollReset"];
1068
+ var START_TRANSITION2 = "startTransition";
1069
+ var startTransitionImpl2 = React2[START_TRANSITION2];
1070
+ function HistoryRouter(_ref3) {
1071
+ let {
1072
+ basename,
1073
+ children,
1074
+ future,
1075
+ history
1076
+ } = _ref3;
1077
+ let [state, setStateImpl] = React2.useState({
1078
+ action: history.action,
1079
+ location: history.location
1080
+ });
1081
+ let {
1082
+ v7_startTransition
1083
+ } = future || {};
1084
+ let setState = React2.useCallback((newState) => {
1085
+ v7_startTransition && startTransitionImpl2 ? startTransitionImpl2(() => setStateImpl(newState)) : setStateImpl(newState);
1086
+ }, [setStateImpl, v7_startTransition]);
1087
+ React2.useLayoutEffect(() => history.listen(setState), [history, setState]);
1088
+ return /* @__PURE__ */ React2.createElement(Router, {
1089
+ basename,
1090
+ children,
1091
+ location: state.location,
1092
+ navigationType: state.action,
1093
+ navigator: history
1094
+ });
1095
+ }
1096
+ if (process.env.NODE_ENV !== "production") {
1097
+ HistoryRouter.displayName = "unstable_HistoryRouter";
1098
+ }
1099
+ var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
1100
+ var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1101
+ var Link = /* @__PURE__ */ React2.forwardRef(function LinkWithRef(_ref4, ref) {
1102
+ let {
1103
+ onClick,
1104
+ relative,
1105
+ reloadDocument,
1106
+ replace,
1107
+ state,
1108
+ target,
1109
+ to,
1110
+ preventScrollReset
1111
+ } = _ref4, rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
1112
+ let {
1113
+ basename
1114
+ } = React2.useContext(NavigationContext);
1115
+ let absoluteHref;
1116
+ let isExternal = false;
1117
+ if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) {
1118
+ absoluteHref = to;
1119
+ if (isBrowser) {
1120
+ try {
1121
+ let currentUrl = new URL(window.location.href);
1122
+ let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
1123
+ let path = stripBasename(targetUrl.pathname, basename);
1124
+ if (targetUrl.origin === currentUrl.origin && path != null) {
1125
+ to = path + targetUrl.search + targetUrl.hash;
1126
+ } else {
1127
+ isExternal = true;
1128
+ }
1129
+ } catch (e) {
1130
+ process.env.NODE_ENV !== "production" ? warning(false, '<Link to="' + to + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.') : void 0;
1131
+ }
1132
+ }
1133
+ }
1134
+ let href = useHref(to, {
1135
+ relative
1136
+ });
1137
+ let internalOnClick = useLinkClickHandler(to, {
1138
+ replace,
1139
+ state,
1140
+ target,
1141
+ preventScrollReset,
1142
+ relative
1143
+ });
1144
+ function handleClick(event) {
1145
+ if (onClick)
1146
+ onClick(event);
1147
+ if (!event.defaultPrevented) {
1148
+ internalOnClick(event);
1149
+ }
1150
+ }
1151
+ return (
1152
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
1153
+ /* @__PURE__ */ React2.createElement("a", _extends3({}, rest, {
1154
+ href: absoluteHref || href,
1155
+ onClick: isExternal || reloadDocument ? onClick : handleClick,
1156
+ ref,
1157
+ target
1158
+ }))
1159
+ );
1160
+ });
1161
+ if (process.env.NODE_ENV !== "production") {
1162
+ Link.displayName = "Link";
1163
+ }
1164
+ var NavLink = /* @__PURE__ */ React2.forwardRef(function NavLinkWithRef(_ref5, ref) {
1165
+ let {
1166
+ "aria-current": ariaCurrentProp = "page",
1167
+ caseSensitive = false,
1168
+ className: classNameProp = "",
1169
+ end = false,
1170
+ style: styleProp,
1171
+ to,
1172
+ children
1173
+ } = _ref5, rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
1174
+ let path = useResolvedPath(to, {
1175
+ relative: rest.relative
1176
+ });
1177
+ let location = useLocation();
1178
+ let routerState = React2.useContext(DataRouterStateContext);
1179
+ let {
1180
+ navigator
1181
+ } = React2.useContext(NavigationContext);
1182
+ let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
1183
+ let locationPathname = location.pathname;
1184
+ let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
1185
+ if (!caseSensitive) {
1186
+ locationPathname = locationPathname.toLowerCase();
1187
+ nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
1188
+ toPathname = toPathname.toLowerCase();
1189
+ }
1190
+ let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
1191
+ let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
1192
+ let ariaCurrent = isActive ? ariaCurrentProp : void 0;
1193
+ let className;
1194
+ if (typeof classNameProp === "function") {
1195
+ className = classNameProp({
1196
+ isActive,
1197
+ isPending
1198
+ });
1199
+ } else {
1200
+ className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");
1201
+ }
1202
+ let style = typeof styleProp === "function" ? styleProp({
1203
+ isActive,
1204
+ isPending
1205
+ }) : styleProp;
1206
+ return /* @__PURE__ */ React2.createElement(Link, _extends3({}, rest, {
1207
+ "aria-current": ariaCurrent,
1208
+ className,
1209
+ ref,
1210
+ style,
1211
+ to
1212
+ }), typeof children === "function" ? children({
1213
+ isActive,
1214
+ isPending
1215
+ }) : children);
1216
+ });
1217
+ if (process.env.NODE_ENV !== "production") {
1218
+ NavLink.displayName = "NavLink";
1219
+ }
1220
+ var Form = /* @__PURE__ */ React2.forwardRef((props, ref) => {
1221
+ let submit = useSubmit();
1222
+ return /* @__PURE__ */ React2.createElement(FormImpl, _extends3({}, props, {
1223
+ submit,
1224
+ ref
1225
+ }));
1226
+ });
1227
+ if (process.env.NODE_ENV !== "production") {
1228
+ Form.displayName = "Form";
1229
+ }
1230
+ var FormImpl = /* @__PURE__ */ React2.forwardRef((_ref6, forwardedRef) => {
1231
+ let {
1232
+ reloadDocument,
1233
+ replace,
1234
+ state,
1235
+ method = defaultMethod,
1236
+ action,
1237
+ onSubmit,
1238
+ submit,
1239
+ relative,
1240
+ preventScrollReset
1241
+ } = _ref6, props = _objectWithoutPropertiesLoose(_ref6, _excluded3);
1242
+ let formMethod = method.toLowerCase() === "get" ? "get" : "post";
1243
+ let formAction = useFormAction(action, {
1244
+ relative
1245
+ });
1246
+ let submitHandler = (event) => {
1247
+ onSubmit && onSubmit(event);
1248
+ if (event.defaultPrevented)
1249
+ return;
1250
+ event.preventDefault();
1251
+ let submitter = event.nativeEvent.submitter;
1252
+ let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
1253
+ submit(submitter || event.currentTarget, {
1254
+ method: submitMethod,
1255
+ replace,
1256
+ state,
1257
+ relative,
1258
+ preventScrollReset
1259
+ });
1260
+ };
1261
+ return /* @__PURE__ */ React2.createElement("form", _extends3({
1262
+ ref: forwardedRef,
1263
+ method: formMethod,
1264
+ action: formAction,
1265
+ onSubmit: reloadDocument ? onSubmit : submitHandler
1266
+ }, props));
1267
+ });
1268
+ if (process.env.NODE_ENV !== "production") {
1269
+ FormImpl.displayName = "FormImpl";
1270
+ }
1271
+ function ScrollRestoration(_ref7) {
1272
+ let {
1273
+ getKey,
1274
+ storageKey
1275
+ } = _ref7;
1276
+ useScrollRestoration({
1277
+ getKey,
1278
+ storageKey
1279
+ });
1280
+ return null;
1281
+ }
1282
+ if (process.env.NODE_ENV !== "production") {
1283
+ ScrollRestoration.displayName = "ScrollRestoration";
1284
+ }
1285
+ var DataRouterHook2;
1286
+ (function(DataRouterHook3) {
1287
+ DataRouterHook3["UseScrollRestoration"] = "useScrollRestoration";
1288
+ DataRouterHook3["UseSubmit"] = "useSubmit";
1289
+ DataRouterHook3["UseSubmitFetcher"] = "useSubmitFetcher";
1290
+ DataRouterHook3["UseFetcher"] = "useFetcher";
1291
+ })(DataRouterHook2 || (DataRouterHook2 = {}));
1292
+ var DataRouterStateHook2;
1293
+ (function(DataRouterStateHook3) {
1294
+ DataRouterStateHook3["UseFetchers"] = "useFetchers";
1295
+ DataRouterStateHook3["UseScrollRestoration"] = "useScrollRestoration";
1296
+ })(DataRouterStateHook2 || (DataRouterStateHook2 = {}));
1297
+ function getDataRouterConsoleError2(hookName) {
1298
+ return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
1299
+ }
1300
+ function useDataRouterContext2(hookName) {
1301
+ let ctx = React2.useContext(DataRouterContext);
1302
+ !ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
1303
+ return ctx;
1304
+ }
1305
+ function useDataRouterState2(hookName) {
1306
+ let state = React2.useContext(DataRouterStateContext);
1307
+ !state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
1308
+ return state;
1309
+ }
1310
+ function useLinkClickHandler(to, _temp) {
1311
+ let {
1312
+ target,
1313
+ replace: replaceProp,
1314
+ state,
1315
+ preventScrollReset,
1316
+ relative
1317
+ } = _temp === void 0 ? {} : _temp;
1318
+ let navigate = useNavigate();
1319
+ let location = useLocation();
1320
+ let path = useResolvedPath(to, {
1321
+ relative
1322
+ });
1323
+ return React2.useCallback((event) => {
1324
+ if (shouldProcessLinkClick(event, target)) {
1325
+ event.preventDefault();
1326
+ let replace = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path);
1327
+ navigate(to, {
1328
+ replace,
1329
+ state,
1330
+ preventScrollReset,
1331
+ relative
1332
+ });
1333
+ }
1334
+ }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);
1335
+ }
1336
+ function validateClientSideSubmission() {
1337
+ if (typeof document === "undefined") {
1338
+ throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
1339
+ }
1340
+ }
1341
+ function useSubmit() {
1342
+ let {
1343
+ router
1344
+ } = useDataRouterContext2(DataRouterHook2.UseSubmit);
1345
+ let {
1346
+ basename
1347
+ } = React2.useContext(NavigationContext);
1348
+ let currentRouteId = useRouteId();
1349
+ return React2.useCallback(function(target, options) {
1350
+ if (options === void 0) {
1351
+ options = {};
1352
+ }
1353
+ validateClientSideSubmission();
1354
+ let {
1355
+ action,
1356
+ method,
1357
+ encType,
1358
+ formData,
1359
+ body
1360
+ } = getFormSubmissionInfo(target, basename);
1361
+ router.navigate(options.action || action, {
1362
+ preventScrollReset: options.preventScrollReset,
1363
+ formData,
1364
+ body,
1365
+ formMethod: options.method || method,
1366
+ formEncType: options.encType || encType,
1367
+ replace: options.replace,
1368
+ state: options.state,
1369
+ fromRouteId: currentRouteId
1370
+ });
1371
+ }, [router, basename, currentRouteId]);
1372
+ }
1373
+ function useFormAction(action, _temp2) {
1374
+ let {
1375
+ relative
1376
+ } = _temp2 === void 0 ? {} : _temp2;
1377
+ let {
1378
+ basename
1379
+ } = React2.useContext(NavigationContext);
1380
+ let routeContext = React2.useContext(RouteContext);
1381
+ !routeContext ? process.env.NODE_ENV !== "production" ? invariant(false, "useFormAction must be used inside a RouteContext") : invariant(false) : void 0;
1382
+ let [match] = routeContext.matches.slice(-1);
1383
+ let path = _extends3({}, useResolvedPath(action ? action : ".", {
1384
+ relative
1385
+ }));
1386
+ let location = useLocation();
1387
+ if (action == null) {
1388
+ path.search = location.search;
1389
+ if (match.route.index) {
1390
+ let params = new URLSearchParams(path.search);
1391
+ params.delete("index");
1392
+ path.search = params.toString() ? "?" + params.toString() : "";
1393
+ }
1394
+ }
1395
+ if ((!action || action === ".") && match.route.index) {
1396
+ path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
1397
+ }
1398
+ if (basename !== "/") {
1399
+ path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
1400
+ }
1401
+ return createPath(path);
1402
+ }
1403
+ var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
1404
+ var savedScrollPositions = {};
1405
+ function useScrollRestoration(_temp3) {
1406
+ let {
1407
+ getKey,
1408
+ storageKey
1409
+ } = _temp3 === void 0 ? {} : _temp3;
1410
+ let {
1411
+ router
1412
+ } = useDataRouterContext2(DataRouterHook2.UseScrollRestoration);
1413
+ let {
1414
+ restoreScrollPosition,
1415
+ preventScrollReset
1416
+ } = useDataRouterState2(DataRouterStateHook2.UseScrollRestoration);
1417
+ let {
1418
+ basename
1419
+ } = React2.useContext(NavigationContext);
1420
+ let location = useLocation();
1421
+ let matches = useMatches();
1422
+ let navigation = useNavigation();
1423
+ React2.useEffect(() => {
1424
+ window.history.scrollRestoration = "manual";
1425
+ return () => {
1426
+ window.history.scrollRestoration = "auto";
1427
+ };
1428
+ }, []);
1429
+ usePageHide(React2.useCallback(() => {
1430
+ if (navigation.state === "idle") {
1431
+ let key = (getKey ? getKey(location, matches) : null) || location.key;
1432
+ savedScrollPositions[key] = window.scrollY;
1433
+ }
1434
+ sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));
1435
+ window.history.scrollRestoration = "auto";
1436
+ }, [storageKey, getKey, navigation.state, location, matches]));
1437
+ if (typeof document !== "undefined") {
1438
+ React2.useLayoutEffect(() => {
1439
+ try {
1440
+ let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
1441
+ if (sessionPositions) {
1442
+ savedScrollPositions = JSON.parse(sessionPositions);
1443
+ }
1444
+ } catch (e) {
1445
+ }
1446
+ }, [storageKey]);
1447
+ React2.useLayoutEffect(() => {
1448
+ let getKeyWithoutBasename = getKey && basename !== "/" ? (location2, matches2) => getKey(
1449
+ // Strip the basename to match useLocation()
1450
+ _extends3({}, location2, {
1451
+ pathname: stripBasename(location2.pathname, basename) || location2.pathname
1452
+ }),
1453
+ matches2
1454
+ ) : getKey;
1455
+ let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);
1456
+ return () => disableScrollRestoration && disableScrollRestoration();
1457
+ }, [router, basename, getKey]);
1458
+ React2.useLayoutEffect(() => {
1459
+ if (restoreScrollPosition === false) {
1460
+ return;
1461
+ }
1462
+ if (typeof restoreScrollPosition === "number") {
1463
+ window.scrollTo(0, restoreScrollPosition);
1464
+ return;
1465
+ }
1466
+ if (location.hash) {
1467
+ let el = document.getElementById(decodeURIComponent(location.hash.slice(1)));
1468
+ if (el) {
1469
+ el.scrollIntoView();
1470
+ return;
1471
+ }
1472
+ }
1473
+ if (preventScrollReset === true) {
1474
+ return;
1475
+ }
1476
+ window.scrollTo(0, 0);
1477
+ }, [location, restoreScrollPosition, preventScrollReset]);
1478
+ }
1479
+ }
1480
+ function usePageHide(callback, options) {
1481
+ let {
1482
+ capture
1483
+ } = options || {};
1484
+ React2.useEffect(() => {
1485
+ let opts = capture != null ? {
1486
+ capture
1487
+ } : void 0;
1488
+ window.addEventListener("pagehide", callback, opts);
1489
+ return () => {
1490
+ window.removeEventListener("pagehide", callback, opts);
1491
+ };
1492
+ }, [callback, capture]);
1493
+ }
1494
+
1495
+ // src/styled-components/breadcrumb.ts
1496
+ import styled from "styled-components";
1497
+ var Breadcrumb = styled.div`
1498
+ font-family: 'Inter', sans-serif;
1499
+ padding: 10px 0px;
1500
+ text-transform: uppercase;
1501
+ font-weight: bold;
1502
+ font-size: 0.9rem;
1503
+ color: #92190e;
1504
+ display: flex;
1505
+ justify-content: space-between;
1506
+ align-items: center;
1507
+ background-color: white;
1508
+ align-items: center;
1509
+
1510
+ .link {
1511
+ color: #92190e;
1512
+ &:hover {
1513
+ color: #92190e;
1514
+ cursor: pointer;
1515
+ }
1516
+ }
1517
+ `;
1518
+ var BreadCrumbTitle = styled.div`
1519
+ font-family: 'Inter', sans-serif;
1520
+ font-weight: bold;
1521
+ font-size: 1.2rem !important;
1522
+ color: #92190e;
1523
+ margin-top: 15px;
1524
+ `;
1525
+ var TitlePage = styled.div`
1526
+ font-family: 'Inter', sans-serif;
1527
+ font-weight: bold;
1528
+ font-size: 1.2rem !important;
1529
+ color: #92190e;
1530
+ margin-top: 15px;
1531
+ `;
1532
+
1533
+ // src/styled-components/menu.ts
1534
+ import styled2 from "styled-components";
1535
+ var MenuItem = styled2(Link)`
1536
+ text-decoration: none;
1537
+ color: black;
1538
+ display: flex;
1539
+ justify-content: ${(props) => props.type === "col" ? "center" : "flex-start"};
1540
+ align-items: center;
1541
+ flex-direction: ${(props) => props.type === "col" ? "column" : "row"};
1542
+ border: 1px solid transparent;
1543
+ width: ${(props) => props.width ? props.width : "100px"};
1544
+ padding: 10px;
1545
+ text-decoration: none !important;
1546
+ &:hover {
1547
+ box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
1548
+ }
1549
+
1550
+ .icon {
1551
+ width: 30px;
1552
+ text-decoration: none;
1553
+ }
1554
+ .text {
1555
+ text-align: center;
1556
+ font-size: 12px;
1557
+ text-decoration: none !important;
1558
+ color: black;
1559
+ margin-top: ${(props) => props.type === "col" ? "0px" : "15px"};
1560
+ &:hover {
1561
+ text-decoration: none !important;
1562
+ }
1563
+ }
1564
+ `;
1565
+ var MenuTitle = styled2.p`
1566
+ font-size: 16px;
1567
+ font-weight: bold !important;
1568
+ `;
1569
+
1570
+ // src/styled-components/navbar.ts
1571
+ import styled3 from "styled-components";
1572
+ var Navbar = styled3.nav`
1573
+ background: ${(props) => {
1574
+ return !props.gradient ? ` linear-gradient( 90.03deg, #92190e 80.71%, #f0b92c 107.21% ) !important` : `#92190e`;
1575
+ }};
1576
+ z-index: 10;
1577
+ width: 100%;
1578
+ max-width: 100vw;
1579
+ display: flex;
1580
+ justify-content: space-between;
1581
+ padding-top: 10px;
1582
+ padding-bottom: 10px;
1583
+ position: sticky;
1584
+ top: 0px;
1585
+ height: 40px;
1586
+ .input {
1587
+ border-radius: 2px !important;
1588
+ padding: 2px !important;
1589
+ font-size: 12px !important;
1590
+ height: 20px !important;
1591
+ border: none;
1592
+ &:focus {
1593
+ outline: none !important;
1594
+ }
1595
+ ::placeholder {
1596
+ color: #92190e;
1597
+ }
1598
+ @media (max-width: 470px) {
1599
+ display: none;
1600
+ }
1601
+ }
1602
+ .dialog {
1603
+ z-index: 20000 !important;
1604
+ position: absolute;
1605
+ width: 400px;
1606
+ height: 500px;
1607
+ min-height: 500px;
1608
+ overflow: scroll;
1609
+ overflow-x: hidden;
1610
+ min-width: 400px;
1611
+ max-width: 400px;
1612
+ background-color: white;
1613
+ border-radius: 20px;
1614
+ top: 50%;
1615
+ left: 50%;
1616
+ transform: translate(-50%, -50%);
1617
+ }
1618
+ `;
1619
+
1620
+ // src/styled-components/options.ts
1621
+ import styled4 from "styled-components";
1622
+ var MenuOptions = styled4.div`
1623
+ font-size: bold;
1624
+ display: flex;
1625
+ width: 100%;
1626
+ gap: 10px;
1627
+ justify-content: flex-start;
1628
+ border-bottom: 1px solid #e6e6e6;
1629
+ background-color: white;
1630
+ flex-wrap: wrap;
1631
+ .button-option {
1632
+ display: flex;
1633
+ flex-direction: row;
1634
+ justify-content: space-between;
1635
+ align-items: center;
1636
+ gap: 5px;
1637
+ padding: 10px 20px;
1638
+ font-weight: bold;
1639
+ background-color: white !important;
1640
+ border: none;
1641
+ .icon {
1642
+ color: #92190e;
1643
+ }
1644
+ .text {
1645
+ @media (max-width: 470px) {
1646
+ display: none;
1647
+ }
1648
+ }
1649
+ }
1650
+ `;
1651
+
1652
+ // src/styled-components/sidebar.ts
1653
+ import styled5 from "styled-components";
1654
+ var ItemSidebar = styled5.div`
1655
+ padding: 10px 25px;
1656
+ display: flex;
1657
+ align-items: center;
1658
+ gap: 30px;
1659
+ font-family: 'Inter', sans-serif;
1660
+ &:hover {
1661
+ color: white !important;
1662
+ text-decoration: none;
1663
+ background: #92190e;
1664
+ .icon-sidebar {
1665
+ color: white !important;
1666
+ }
1667
+ }
1668
+ &:active {
1669
+ color: white !important;
1670
+ text-decoration: none;
1671
+ background: #92190e;
1672
+ .icon-sidebar {
1673
+ color: white !important;
1674
+ }
1675
+ }
1676
+ `;
1677
+ var SidebarNavigation = styled5.nav`
1678
+ position: ${({ fixed = true }) => fixed ? "fixed" : "static"};
1679
+ top: 0;
1680
+ left: 0;
1681
+ min-height: 100vh;
1682
+ box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
1683
+ -webkit-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
1684
+ -moz-box-shadow: 7px 0px 14px 1px rgba(145, 141, 141, 0.51);
1685
+ background: white;
1686
+ font-family: 'Inter', sans-serif;
1687
+ padding: 0;
1688
+ width: ${({ fixed = true, active = true }) => fixed ? active ? "270px" : "0px" : "auto"};
1689
+ z-index: 11;
1690
+ transition: width 0.2s ease-in-out;
1691
+
1692
+ overflow: hidden;
1693
+ height: 100vh;
1694
+ overflow-y: auto;
1695
+ box-shadow: ${({ shadow = true }) => shadow ? "rgba(99, 99, 99, 0.2) 0px 2px 8px 0px" : "none"};
1696
+
1697
+ &::-webkit-scrollbar {
1698
+ display: none !important;
1699
+ }
1700
+ .nav {
1701
+ flex-wrap: nowrap;
1702
+ flex-direction: column;
1703
+ font-size: 12px;
1704
+
1705
+ .nav-item {
1706
+ .collapse {
1707
+ z-index: 999;
1708
+ }
1709
+
1710
+ .collapse.show,
1711
+ .collapsing {
1712
+ background: rgba(0, 0, 0);
1713
+ }
1714
+
1715
+ .nav-link {
1716
+ align-items: center;
1717
+ display: flex;
1718
+ padding-left: 40px;
1719
+ white-space: nowrap;
1720
+
1721
+ color: #92190e;
1722
+ i {
1723
+ margin-right: 20px;
1724
+ }
1725
+ .menu-title {
1726
+ color: inherit;
1727
+ display: inline-block;
1728
+ line-height: 1;
1729
+ color: black;
1730
+ vertical-align: middle;
1731
+ cursor: pointer;
1732
+ }
1733
+ }
1734
+
1735
+ &.active {
1736
+ > .nav-link {
1737
+ color: white;
1738
+ }
1739
+
1740
+ &.not-navigation-link {
1741
+ position: relative;
1742
+ }
1743
+ }
1744
+
1745
+ &:not(.sub-menu) {
1746
+ > .nav-item {
1747
+ &:hover {
1748
+ &:not(.nav-profile) {
1749
+ > .nav-link {
1750
+ background: $sidebar-light-menu-hover-bg;
1751
+ color: $sidebar-light-menu-hover-color;
1752
+ }
1753
+ }
1754
+ }
1755
+ }
1756
+ }
1757
+
1758
+ &.sub-menu {
1759
+ margin-bottom: 0;
1760
+ padding: $sidebar-submenu-padding;
1761
+
1762
+ .rtl & {
1763
+ padding: 0 4rem 0 0;
1764
+ }
1765
+
1766
+ .nav-item {
1767
+ .nav-link {
1768
+ color: $sidebar-light-submenu-color;
1769
+ padding: $sidebar-submenu-item-padding;
1770
+ font-size: $sidebar-submenu-font-size;
1771
+ line-height: 1;
1772
+ height: auto;
1773
+
1774
+ &.active {
1775
+ color: $sidebar-light-menu-active-color;
1776
+ background: transparent;
1777
+
1778
+ &:before {
1779
+ background: $sidebar-light-menu-active-color;
1780
+ }
1781
+ }
1782
+ }
1783
+
1784
+ &:hover {
1785
+ > .nav-link {
1786
+ background: $sidebar-light-submenu-hover-bg;
1787
+ color: $sidebar-light-submenu-hover-color;
1788
+
1789
+ &:before {
1790
+ background: $sidebar-light-submenu-hover-color;
1791
+ }
1792
+ }
1793
+ }
1794
+ }
1795
+ }
1796
+
1797
+ &.sub-menu2 {
1798
+ margin-bottom: 0;
1799
+ padding: $sidebar-submenu2-padding;
1800
+
1801
+ .rtl & {
1802
+ padding: 0 4rem 0 0;
1803
+ }
1804
+
1805
+ .nav-item {
1806
+ .nav-link {
1807
+ color: $sidebar-light-submenu-color;
1808
+ padding: $sidebar-submenu-item-padding;
1809
+ font-size: $sidebar-submenu-font-size;
1810
+ line-height: 1;
1811
+ height: auto;
1812
+
1813
+ &.active {
1814
+ color: $sidebar-light-menu-active-color;
1815
+ background: transparent;
1816
+
1817
+ &:before {
1818
+ background: $sidebar-light-menu-active-color;
1819
+ }
1820
+ }
1821
+ }
1822
+
1823
+ &:hover {
1824
+ > .nav-link {
1825
+ background: $sidebar-light-submenu-hover-bg;
1826
+ color: $sidebar-light-submenu-hover-color;
1827
+
1828
+ &:before {
1829
+ background: $sidebar-light-submenu-hover-color;
1830
+ }
1831
+ }
1832
+ }
1833
+ }
1834
+ }
1835
+ }
1836
+ }
1837
+ `;
1838
+ var ConfigurationOption = styled5.nav`
1839
+ position: fixed;
1840
+ top: 50px;
1841
+ right: 0;
1842
+ min-height: 100vh;
1843
+ box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
1844
+ -webkit-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
1845
+ -moz-box-shadow: 7px 0px 14px 1px rgba(201, 196, 196, 0.51);
1846
+ min-height: calc(100vh);
1847
+
1848
+ font-family: 'Inter', sans-serif;
1849
+ padding: 0;
1850
+ width: ${(props) => props.active ? "300px" : "0px"};
1851
+ z-index: 11;
1852
+ transition: width 0.2s ease-in-out;
1853
+ overflow: hidden !important;
1854
+ `;
1855
+ var ItemLinkSidebar = styled5(Link)`
1856
+ padding: 10px 25px;
1857
+ display: flex;
1858
+ align-items: center;
1859
+ gap: 30px;
1860
+ color: #343a40;
1861
+ text-decoration: none;
1862
+ font-family: 'Inter', sans-serif;
1863
+ &:hover {
1864
+ color: white !important;
1865
+ text-decoration: none;
1866
+ background: #92190e;
1867
+ .icon-sidebar {
1868
+ color: white !important;
1869
+ }
1870
+ }
1871
+ `;
1872
+
1873
+ // src/styled-components/template.ts
1874
+ import styled6 from "styled-components";
1875
+ var Main = styled6.main`
1876
+ width: 100%;
1877
+ min-height: 90vh;
1878
+ display: flex;
1879
+ flex-direction: column;
1880
+ justify-content: space-between;
1881
+ background-color: white;
1882
+ padding: 10px 60px;
1883
+ position: relative;
1884
+ padding-left: ${(props) => {
1885
+ return props.activeDrawer ? `300px` : `30px`;
1886
+ }};
1887
+ @media (max-width: 470px) {
1888
+ padding: 10px 10px;
1889
+ }
1890
+ `;
1891
+ var CloseIcon = styled6.button`
1892
+ color: black;
1893
+ text-decoration: none;
1894
+ border: none;
1895
+ padding: 10px 10px;
1896
+ background-color: white;
1897
+ border-radius: 50%;
1898
+ display: flex;
1899
+ align-items: center;
1900
+ justify-content: center;
1901
+ cursor: pointer;
1902
+ top: 10px;
1903
+ right: 10px;
1904
+ text-align: center;
1905
+ &:hover {
1906
+ color: black;
1907
+ text-decoration: none;
1908
+ background-color: #e8e8e8;
1909
+ }
1910
+ `;
1911
+
1912
+ // src/layout/AppBreadcrumb.tsx
1913
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
1914
+ var AppBreadCrumb = ({ title, paths }) => {
1915
+ const { setRoutes } = useContext4(BreadCrumbContext);
1916
+ useEffect9(() => {
1917
+ if (!(paths == null ? void 0 : paths.length))
1918
+ return;
1919
+ setRoutes(paths != null ? paths : []);
1920
+ }, []);
1921
+ return /* @__PURE__ */ jsx10(BreadCrumbTitle, { children: title != null ? title : "Home" });
1922
+ };
1923
+ var AppBreadCrumbNav = ({ paths }) => {
1924
+ const { active, path, routes, setRoutes } = useContext4(BreadCrumbContext);
1925
+ const navigate = useNavigate();
1926
+ const { updateList } = useContext4(HistoryContext);
1927
+ useEffect9(() => {
1928
+ updateList({ name: active, path });
1929
+ }, [path, active]);
1930
+ useEffect9(() => {
1931
+ setRoutes(paths != null ? paths : []);
1932
+ }, [paths]);
1933
+ return /* @__PURE__ */ jsxs4(Breadcrumb, { children: [
1934
+ /* @__PURE__ */ jsxs4("div", { className: "d-flex align-items-center", children: [
1935
+ /* @__PURE__ */ jsx10(Link, { to: "/", className: "link", children: "HOME" }),
1936
+ routes.length > 0 && /* @__PURE__ */ jsx10(VscChevronRight, { color: "black" }),
1937
+ routes.length > 0 ? routes.map((i, idx, arr) => {
1938
+ if (i.route === -1) {
1939
+ return /* @__PURE__ */ jsxs4("span", { className: "link", onClick: () => navigate(-1), children: [
1940
+ i.title,
1941
+ " ",
1942
+ idx + 1 === arr.length ? "" : /* @__PURE__ */ jsx10(VscChevronRight, { color: "black" })
1943
+ ] }, idx);
1944
+ }
1945
+ return /* @__PURE__ */ jsxs4(Link, { to: i.route, className: "link", children: [
1946
+ i.title,
1947
+ " ",
1948
+ idx + 1 === arr.length ? "" : /* @__PURE__ */ jsx10(VscChevronRight, { color: "black" })
1949
+ ] }, idx);
1950
+ }) : ""
1951
+ ] }),
1952
+ /* @__PURE__ */ jsx10(
1953
+ CloseIcon,
1954
+ {
1955
+ onClick: () => {
1956
+ if ((routes == null ? void 0 : routes.length) === 1) {
1957
+ navigate("/");
1958
+ setRoutes([]);
1959
+ return;
1960
+ }
1961
+ navigate(`${routes && routes[(routes == null ? void 0 : routes.length) - 2].route}`);
1962
+ },
1963
+ children: /* @__PURE__ */ jsx10(MdClose, { fontSize: 20 })
1964
+ }
1965
+ )
1966
+ ] });
1967
+ };
1968
+
1969
+ // src/layout/AppLoader.tsx
1970
+ import { useEffect as useEffect10 } from "react";
1971
+ import ReactDOM from "react-dom";
1972
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1973
+ var LoaderGrid = () => {
1974
+ const Loader = /* @__PURE__ */ jsxs5("div", { className: "k-loading-mask", children: [
1975
+ /* @__PURE__ */ jsx11("span", { className: "k-loading-text", children: "Loading" }),
1976
+ /* @__PURE__ */ jsx11("div", { className: "k-loading-image" }),
1977
+ /* @__PURE__ */ jsx11("div", { className: "k-loading-color" })
1978
+ ] });
1979
+ const gridContent = document && document.querySelector(".k-grid-content");
1980
+ const reportContent = document && document.querySelector(".loading-report");
1981
+ return gridContent ? ReactDOM.createPortal(Loader, gridContent) : reportContent ? ReactDOM.createPortal(Loader, reportContent) : Loader;
1982
+ };
1983
+ var AppLoader = (props) => {
1984
+ const { type = "grid", parent, minDuration } = props;
1985
+ const parentEl = type === "grid" ? document.querySelector(parent != null ? parent : ".k-grid-container") : parent ? document.querySelector(parent) : null;
1986
+ const Loading = /* @__PURE__ */ jsxs5("div", { className: `${type}-loading k-loading-mask`, children: [
1987
+ /* @__PURE__ */ jsx11("span", { className: "k-loading-text", children: "Loading" }),
1988
+ /* @__PURE__ */ jsx11("div", { className: "k-loading-image" }),
1989
+ /* @__PURE__ */ jsx11("div", { className: "k-loading-color" })
1990
+ ] });
1991
+ useEffect10(() => {
1992
+ if (type === "button") {
1993
+ const loadingEl = document.createElement("div");
1994
+ loadingEl.className = "icon button-loading k-loading-mask";
1995
+ loadingEl.innerHTML = `
1996
+ <div class="k-loading-image"></div>
1997
+ `;
1998
+ if (parentEl) {
1999
+ const button = parentEl;
2000
+ button.classList.add("btn-loading");
2001
+ button.disabled = true;
2002
+ button.insertBefore(loadingEl, button.firstChild);
2003
+ }
2004
+ return () => {
2005
+ if (parentEl) {
2006
+ if (minDuration) {
2007
+ setTimeout(() => {
2008
+ const button = parentEl;
2009
+ button.classList.remove("btn-loading");
2010
+ button.removeChild(loadingEl);
2011
+ button.disabled = false;
2012
+ }, minDuration);
2013
+ } else {
2014
+ const button = parentEl;
2015
+ button.classList.remove("btn-loading");
2016
+ button.removeChild(loadingEl);
2017
+ button.disabled = false;
2018
+ }
2019
+ }
2020
+ };
2021
+ }
2022
+ }, []);
2023
+ return type === "button" ? null : parentEl ? ReactDOM.createPortal(Loading, parentEl) : Loading;
2024
+ };
2025
+
2026
+ // src/layout/NavOptions.tsx
2027
+ import { Dropdown } from "react-bootstrap";
2028
+ import { BsArrowsFullscreen } from "react-icons/bs";
2029
+ import { FiCheckCircle, FiFilter, FiPlusSquare, FiRefreshCcw, FiSave } from "react-icons/fi";
2030
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
2031
+ var NavOptions = ({
2032
+ exportExcel,
2033
+ customButtons,
2034
+ onCreate,
2035
+ onRefresh,
2036
+ onSelect,
2037
+ onClear,
2038
+ onExpandScreen
2039
+ }) => {
2040
+ return /* @__PURE__ */ jsxs6(MenuOptions, { children: [
2041
+ onCreate && /* @__PURE__ */ jsxs6("button", { className: "button-option", onClick: onCreate, children: [
2042
+ /* @__PURE__ */ jsx12(FiPlusSquare, { className: "icon" }),
2043
+ " ",
2044
+ /* @__PURE__ */ jsx12("span", { className: "text", children: "New" })
2045
+ ] }),
2046
+ onRefresh && /* @__PURE__ */ jsxs6("button", { className: "button-option", onClick: onRefresh, children: [
2047
+ /* @__PURE__ */ jsx12(FiRefreshCcw, { className: "icon" }),
2048
+ " ",
2049
+ /* @__PURE__ */ jsx12("span", { className: "text", children: "Refresh" })
2050
+ ] }),
2051
+ exportExcel && exportExcel.length > 0 && /* @__PURE__ */ jsxs6(Dropdown, { className: "button-option", children: [
2052
+ /* @__PURE__ */ jsxs6(
2053
+ Dropdown.Toggle,
2054
+ {
2055
+ id: "btnExport",
2056
+ className: "p-2 bg-light text-dark border-0 font-weight-bold",
2057
+ title: "Export to Excel",
2058
+ children: [
2059
+ /* @__PURE__ */ jsx12(FiSave, { className: "icon" }),
2060
+ /* @__PURE__ */ jsx12(
2061
+ "span",
2062
+ {
2063
+ style: {
2064
+ fontSize: "13px",
2065
+ fontFamily: '"Inter", sans-serif'
2066
+ },
2067
+ className: "text",
2068
+ children: "Export"
2069
+ }
2070
+ )
2071
+ ]
2072
+ }
2073
+ ),
2074
+ /* @__PURE__ */ jsx12(Dropdown.Menu, { children: exportExcel.map((item, index) => {
2075
+ return /* @__PURE__ */ jsxs6(Dropdown.Item, { onClick: item.onAction, children: [
2076
+ /* @__PURE__ */ jsx12("i", { className: `${item.classNameIcon} mr-2` }),
2077
+ " ",
2078
+ item.title
2079
+ ] }, index);
2080
+ }) })
2081
+ ] }),
2082
+ onSelect && /* @__PURE__ */ jsxs6("button", { className: "button-option", onClick: onSelect, children: [
2083
+ /* @__PURE__ */ jsx12(FiCheckCircle, { className: "icon" }),
2084
+ " ",
2085
+ /* @__PURE__ */ jsx12("span", { className: "text", children: "Select All" })
2086
+ ] }),
2087
+ onClear && /* @__PURE__ */ jsxs6("button", { className: "button-option", onClick: onClear, children: [
2088
+ /* @__PURE__ */ jsx12(FiFilter, { className: "icon" }),
2089
+ " ",
2090
+ /* @__PURE__ */ jsx12("span", { className: "text", children: "Clear Filters" })
2091
+ ] }),
2092
+ onExpandScreen && /* @__PURE__ */ jsxs6("button", { className: "button-option", onClick: onExpandScreen, children: [
2093
+ /* @__PURE__ */ jsx12(BsArrowsFullscreen, { className: "icon" }),
2094
+ " ",
2095
+ /* @__PURE__ */ jsx12("span", { className: "text", children: "Full Page" })
2096
+ ] }),
2097
+ customButtons == null ? void 0 : customButtons.map((custom, index) => {
2098
+ if (custom.render) {
2099
+ return custom.render;
2100
+ }
2101
+ return /* @__PURE__ */ jsxs6("button", { className: "button-option", onClick: custom.onAction, children: [
2102
+ custom.Icon !== void 0 && /* @__PURE__ */ jsx12(custom.Icon, { className: "icon" }),
2103
+ /* @__PURE__ */ jsx12("span", { className: "text", children: custom.title })
2104
+ ] }, index);
2105
+ })
2106
+ ] });
2107
+ };
2108
+
2109
+ // src/layout/title.tsx
2110
+ import { jsx as jsx13 } from "react/jsx-runtime";
2111
+ var Title = ({ title }) => {
2112
+ return /* @__PURE__ */ jsx13(TitlePage, { children: title != null ? title : "Home" });
2113
+ };
2114
+ export {
2115
+ AppBreadCrumb,
2116
+ AppBreadCrumbNav,
2117
+ AppLoader,
2118
+ BreadCrumbContext,
2119
+ BreadCrumbContextProvider,
2120
+ BreadCrumbTitle,
2121
+ Breadcrumb,
2122
+ Button,
2123
+ CloseIcon,
2124
+ DrawerContext,
2125
+ DrawerContextProvider,
2126
+ DropEnumList,
2127
+ GlobalProvider,
2128
+ HistoryContext,
2129
+ HistoryContextProvider,
2130
+ ItemLinkSidebar,
2131
+ ItemSidebar,
2132
+ LoaderGrid,
2133
+ Main,
2134
+ MenuItem,
2135
+ MenuOptions,
2136
+ MenuTitle,
2137
+ NavOptions,
2138
+ Navbar,
2139
+ SidebarMainContext,
2140
+ SidebarMainContextProvider,
2141
+ SidebarNavigation,
2142
+ Tab,
2143
+ Tabs,
2144
+ Title,
2145
+ useLocalStorage,
2146
+ usePrevious,
2147
+ useStep
2148
+ };
2149
+ /*! Bundled license information:
2150
+
2151
+ @remix-run/router/dist/router.js:
2152
+ (**
2153
+ * @remix-run/router v1.9.0
2154
+ *
2155
+ * Copyright (c) Remix Software Inc.
2156
+ *
2157
+ * This source code is licensed under the MIT license found in the
2158
+ * LICENSE.md file in the root directory of this source tree.
2159
+ *
2160
+ * @license MIT
2161
+ *)
2162
+
2163
+ react-router/dist/index.js:
2164
+ (**
2165
+ * React Router v6.16.0
2166
+ *
2167
+ * Copyright (c) Remix Software Inc.
2168
+ *
2169
+ * This source code is licensed under the MIT license found in the
2170
+ * LICENSE.md file in the root directory of this source tree.
2171
+ *
2172
+ * @license MIT
2173
+ *)
2174
+
2175
+ react-router-dom/dist/index.js:
2176
+ (**
2177
+ * React Router DOM v6.16.0
2178
+ *
2179
+ * Copyright (c) Remix Software Inc.
2180
+ *
2181
+ * This source code is licensed under the MIT license found in the
2182
+ * LICENSE.md file in the root directory of this source tree.
2183
+ *
2184
+ * @license MIT
2185
+ *)
2186
+ */