@bwg-ui/core 1.1.6 → 1.1.8

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.
Files changed (104) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/BwgLargeUploader-1yDku10l.cjs +3 -0
  3. package/dist/chunks/BwgLargeUploader-1yDku10l.cjs.map +1 -0
  4. package/dist/chunks/{BwgLargeUploader-CZllyq7K.js → BwgLargeUploader-DsaIHpYz.js} +311 -297
  5. package/dist/chunks/BwgLargeUploader-DsaIHpYz.js.map +1 -0
  6. package/dist/chunks/LoadingOverlay-CAO6_FuF.js +29 -0
  7. package/dist/chunks/LoadingOverlay-CAO6_FuF.js.map +1 -0
  8. package/dist/chunks/LoadingOverlay-NX9Mo_6n.cjs +2 -0
  9. package/dist/chunks/LoadingOverlay-NX9Mo_6n.cjs.map +1 -0
  10. package/dist/chunks/{PublicLayout-BiTPwkVq.cjs → PublicLayout-3v46YZdi.cjs} +2 -2
  11. package/dist/chunks/{PublicLayout-BiTPwkVq.cjs.map → PublicLayout-3v46YZdi.cjs.map} +1 -1
  12. package/dist/chunks/{PublicLayout-g9WMtoZ0.js → PublicLayout-B4wGo0ut.js} +2 -2
  13. package/dist/chunks/{PublicLayout-g9WMtoZ0.js.map → PublicLayout-B4wGo0ut.js.map} +1 -1
  14. package/dist/chunks/{SSOHandler-Bu3v95k0.js → SSOHandler-B5rmYk8s.js} +2565 -2568
  15. package/dist/chunks/SSOHandler-B5rmYk8s.js.map +1 -0
  16. package/dist/chunks/SSOHandler-DjL0sH7k.cjs +184 -0
  17. package/dist/chunks/SSOHandler-DjL0sH7k.cjs.map +1 -0
  18. package/dist/chunks/ScreenProtectContext-3my4PHFa.js +154 -0
  19. package/dist/chunks/ScreenProtectContext-3my4PHFa.js.map +1 -0
  20. package/dist/chunks/ScreenProtectContext-CVuXrJm6.cjs +2 -0
  21. package/dist/chunks/ScreenProtectContext-CVuXrJm6.cjs.map +1 -0
  22. package/dist/chunks/{UtilsContext-CSgz9o2Z.js → UtilsContext-BKUZmmKx.js} +2 -2
  23. package/dist/chunks/{UtilsContext-CSgz9o2Z.js.map → UtilsContext-BKUZmmKx.js.map} +1 -1
  24. package/dist/chunks/{UtilsContext-5l7yFRQI.cjs → UtilsContext-DczQBfFi.cjs} +2 -2
  25. package/dist/chunks/{UtilsContext-5l7yFRQI.cjs.map → UtilsContext-DczQBfFi.cjs.map} +1 -1
  26. package/dist/chunks/{commonUtils-BV6WFv-z.js → commonUtils-Cvx6_eK2.js} +24 -23
  27. package/dist/chunks/commonUtils-Cvx6_eK2.js.map +1 -0
  28. package/dist/chunks/commonUtils-DaFg0y7C.cjs +2 -0
  29. package/dist/chunks/commonUtils-DaFg0y7C.cjs.map +1 -0
  30. package/dist/chunks/menuViewStore-BJak0NMm.cjs +3 -0
  31. package/dist/chunks/menuViewStore-BJak0NMm.cjs.map +1 -0
  32. package/dist/chunks/menuViewStore-BwR3vgPM.js +339 -0
  33. package/dist/chunks/menuViewStore-BwR3vgPM.js.map +1 -0
  34. package/dist/components/common/BwgButtonGroup.d.ts +2 -2
  35. package/dist/components/common/BwgButtonGroup.d.ts.map +1 -1
  36. package/dist/components/common/BwgTitleBox.d.ts +2 -2
  37. package/dist/components/common/BwgTitleBox.d.ts.map +1 -1
  38. package/dist/components/common/BwgView.d.ts.map +1 -1
  39. package/dist/components/common/QuickServiceToggle.d.ts.map +1 -1
  40. package/dist/components/common/index.cjs +1 -1
  41. package/dist/components/common/index.js +1 -1
  42. package/dist/components/core/BwgForm.d.ts.map +1 -1
  43. package/dist/components/core/BwgUploader.d.ts +5 -0
  44. package/dist/components/core/BwgUploader.d.ts.map +1 -1
  45. package/dist/components/core/index.cjs +1 -1
  46. package/dist/components/core/index.js +1 -1
  47. package/dist/components/layout/LoadingOverlay.d.ts +5 -0
  48. package/dist/components/layout/LoadingOverlay.d.ts.map +1 -0
  49. package/dist/components/layout/index.cjs +1 -1
  50. package/dist/components/layout/index.d.ts +1 -0
  51. package/dist/components/layout/index.d.ts.map +1 -1
  52. package/dist/components/layout/index.js +3 -1
  53. package/dist/components/layout/index.js.map +1 -1
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.js +295 -291
  56. package/dist/index.js.map +1 -1
  57. package/dist/provider/contexts/ScreenProtectContext.d.ts +9 -4
  58. package/dist/provider/contexts/ScreenProtectContext.d.ts.map +1 -1
  59. package/dist/provider/hooks/index.d.ts +0 -1
  60. package/dist/provider/hooks/index.d.ts.map +1 -1
  61. package/dist/provider/index.cjs +1 -1
  62. package/dist/provider/index.js +2 -2
  63. package/dist/public/realgrid/css/realgrid-style-custom.css +65 -60
  64. package/dist/stores/favoriteStore.d.ts +1 -1
  65. package/dist/stores/favoriteStore.d.ts.map +1 -1
  66. package/dist/stores/index.cjs +1 -1
  67. package/dist/stores/index.cjs.map +1 -1
  68. package/dist/stores/index.d.ts +34 -3
  69. package/dist/stores/index.d.ts.map +1 -1
  70. package/dist/stores/index.js +17 -15
  71. package/dist/stores/index.js.map +1 -1
  72. package/dist/stores/menuModelStore.d.ts +36 -0
  73. package/dist/stores/menuModelStore.d.ts.map +1 -0
  74. package/dist/stores/menuViewStore.d.ts +31 -0
  75. package/dist/stores/menuViewStore.d.ts.map +1 -0
  76. package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
  77. package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
  78. package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
  79. package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
  80. package/dist/utils/index.cjs +1 -1
  81. package/dist/utils/index.js +1 -1
  82. package/package.json +10 -4
  83. package/scripts/gen-component-registry.js +138 -0
  84. package/dist/chunks/BwgLargeUploader-CZllyq7K.js.map +0 -1
  85. package/dist/chunks/BwgLargeUploader-xAjj4TQ1.cjs +0 -3
  86. package/dist/chunks/BwgLargeUploader-xAjj4TQ1.cjs.map +0 -1
  87. package/dist/chunks/SSOHandler-Bu3v95k0.js.map +0 -1
  88. package/dist/chunks/SSOHandler-kghWABfM.cjs +0 -184
  89. package/dist/chunks/SSOHandler-kghWABfM.cjs.map +0 -1
  90. package/dist/chunks/ScreenProtectContext-ofv2QgMp.cjs +0 -2
  91. package/dist/chunks/ScreenProtectContext-ofv2QgMp.cjs.map +0 -1
  92. package/dist/chunks/ScreenProtectContext-zByHldrr.js +0 -115
  93. package/dist/chunks/ScreenProtectContext-zByHldrr.js.map +0 -1
  94. package/dist/chunks/commonUtils-BV6WFv-z.js.map +0 -1
  95. package/dist/chunks/commonUtils-L9Jgc5y-.cjs +0 -2
  96. package/dist/chunks/commonUtils-L9Jgc5y-.cjs.map +0 -1
  97. package/dist/chunks/menuStore-2zsN-PRt.js +0 -266
  98. package/dist/chunks/menuStore-2zsN-PRt.js.map +0 -1
  99. package/dist/chunks/menuStore-D7zl2c89.cjs +0 -2
  100. package/dist/chunks/menuStore-D7zl2c89.cjs.map +0 -1
  101. package/dist/provider/hooks/useViewState.d.ts +0 -15
  102. package/dist/provider/hooks/useViewState.d.ts.map +0 -1
  103. package/dist/stores/menuStore.d.ts +0 -53
  104. package/dist/stores/menuStore.d.ts.map +0 -1
@@ -0,0 +1,154 @@
1
+ import { j as t } from "./jsx-runtime-Dpn_P65e.js";
2
+ import { Input as F } from "antd";
3
+ import { useContext as R, createContext as T, useState as v, useRef as D, useEffect as E, useMemo as M } from "react";
4
+ const L = T(null), V = () => {
5
+ const i = R(L);
6
+ if (!i)
7
+ throw new Error("useLock must be used within ScreenProtectProvider");
8
+ return i;
9
+ }, W = ({
10
+ children: i,
11
+ idleMs: x = 1e4,
12
+ onUnlock: m,
13
+ persistLocked: n = !0,
14
+ storageKey: s = "inactivityLocked",
15
+ eventTarget: a,
16
+ overlayScope: f = "global",
17
+ overlayId: r = "lock-overlay-root",
18
+ overlayPosition: b = "fixed"
19
+ }) => {
20
+ const I = n && typeof window < "u" && window.localStorage.getItem(s) === "1", [o, k] = v(I), [p, P] = v(x), h = Number.isFinite(p) && p > 0, l = D(null), S = () => {
21
+ try {
22
+ n && window.localStorage.setItem(s, "1");
23
+ } catch {
24
+ }
25
+ k(!0);
26
+ }, g = async (c) => {
27
+ if (!(m && !await m(c))) {
28
+ try {
29
+ n && window.localStorage.removeItem(s);
30
+ } catch {
31
+ }
32
+ k(!1), h && y();
33
+ }
34
+ }, N = () => {
35
+ try {
36
+ n && window.localStorage.setItem(s, "1");
37
+ } catch {
38
+ }
39
+ k(!0);
40
+ }, y = () => {
41
+ h && (l.current && window.clearTimeout(l.current), l.current = window.setTimeout(() => {
42
+ N();
43
+ }, p));
44
+ };
45
+ E(() => {
46
+ if (!h) return;
47
+ const c = () => {
48
+ o || y();
49
+ }, d = { passive: !0 }, u = [
50
+ "pointermove",
51
+ "pointerdown",
52
+ "keydown",
53
+ "wheel",
54
+ "touchstart"
55
+ ], w = a ?? window;
56
+ return u.forEach((e) => w.addEventListener(e, c, d)), y(), () => {
57
+ l.current && window.clearTimeout(l.current), u.forEach((e) => w.removeEventListener(e, c));
58
+ };
59
+ }, [p, o, a, h]), E(() => {
60
+ if (!o) return;
61
+ const c = (e) => {
62
+ const j = document.getElementById(r);
63
+ j && j.contains(e.target) || (e.stopPropagation(), e.preventDefault());
64
+ }, d = { capture: !0 }, u = [
65
+ "pointerdown",
66
+ "pointerup",
67
+ "pointermove",
68
+ "click",
69
+ "wheel",
70
+ "keydown",
71
+ "keyup",
72
+ "touchstart",
73
+ "touchmove"
74
+ ], w = f === "scoped" ? a ?? window : window;
75
+ return u.forEach((e) => w.addEventListener(e, c, d)), () => u.forEach((e) => w.removeEventListener(e, c, d));
76
+ }, [o, f, r, a]);
77
+ const C = M(
78
+ () => ({ locked: o, lock: S, unlock: g, setIdleMs: P }),
79
+ [o]
80
+ );
81
+ return /* @__PURE__ */ t.jsxs(L.Provider, { value: C, children: [
82
+ /* @__PURE__ */ t.jsx(
83
+ "div",
84
+ {
85
+ style: { width: "100%", height: "100%" },
86
+ ...o ? { inert: "" } : {},
87
+ ...o ? { "aria-hidden": !0 } : {},
88
+ children: i
89
+ }
90
+ ),
91
+ o && /* @__PURE__ */ t.jsx(
92
+ O,
93
+ {
94
+ onUnlock: g,
95
+ overlayId: r,
96
+ overlayPosition: b
97
+ }
98
+ )
99
+ ] });
100
+ }, O = ({
101
+ onUnlock: i,
102
+ overlayId: x = "lock-overlay-root",
103
+ overlayPosition: m = "fixed"
104
+ }) => {
105
+ const [n] = v(4), [s, a] = v("");
106
+ return /* @__PURE__ */ t.jsx(
107
+ "div",
108
+ {
109
+ id: x,
110
+ "aria-modal": "true",
111
+ role: "dialog",
112
+ "aria-label": "Locked screen",
113
+ style: {
114
+ position: m,
115
+ inset: 0,
116
+ background: "rgba(12, 14, 18, 0.85)",
117
+ backdropFilter: "blur(4px)",
118
+ display: "grid",
119
+ placeItems: "center",
120
+ zIndex: 9999
121
+ },
122
+ children: /* @__PURE__ */ t.jsxs("div", { className: "lockscreen-form", style: { width: 420, maxWidth: "92vw" }, children: [
123
+ /* @__PURE__ */ t.jsx("div", { className: "lock-icon-wrap", children: /* @__PURE__ */ t.jsx("span", { className: "lock-icon-box" }) }),
124
+ /* @__PURE__ */ t.jsx("h2", { children: "잠금됨" }),
125
+ /* @__PURE__ */ t.jsx("p", { children: "PIN 번호를 입력하세요" }),
126
+ /* @__PURE__ */ t.jsx(
127
+ "div",
128
+ {
129
+ className: "lock-ipt-wrap",
130
+ style: { display: "flex", justifyContent: "center" },
131
+ children: /* @__PURE__ */ t.jsx(
132
+ F.OTP,
133
+ {
134
+ mask: "*",
135
+ autoFocus: !0,
136
+ length: n,
137
+ value: s,
138
+ onChange: (f) => {
139
+ const r = (f ?? "").replace(/\D/g, "").slice(0, n);
140
+ a(r), r.length === n && i(r);
141
+ }
142
+ }
143
+ )
144
+ }
145
+ )
146
+ ] })
147
+ }
148
+ );
149
+ };
150
+ export {
151
+ W as S,
152
+ V as u
153
+ };
154
+ //# sourceMappingURL=ScreenProtectContext-3my4PHFa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenProtectContext-3my4PHFa.js","sources":["../../src/provider/contexts/ScreenProtectContext.tsx"],"sourcesContent":["import { Input } from \"antd\";\r\nimport React, {\r\n createContext,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from \"react\";\r\n\r\n/**\r\n * ScreenProtectProvider\r\n * - 전역용(기본값): window 활동감지 + fixed 전체 오버레이\r\n * - 탭스코프용(옵션): eventTarget 활동감지 + absolute 탭 영역 오버레이\r\n */\r\n\r\n// ===================== Lock Context =====================\r\ntype LockContextValue = {\r\n locked: boolean;\r\n lock: () => void;\r\n unlock: (pin?: string) => Promise<void> | void;\r\n setIdleMs: (ms: number) => void;\r\n};\r\n\r\nconst LockContext = createContext<LockContextValue | null>(null);\r\n\r\nexport const useLock = () => {\r\n const ctx = useContext(LockContext);\r\n if (!ctx)\r\n throw new Error(\"useLock must be used within ScreenProtectProvider\");\r\n return ctx;\r\n};\r\n\r\n// ===================== Provider =====================\r\nexport const ScreenProtectProvider: React.FC<{\r\n children: React.ReactNode;\r\n idleMs?: number;\r\n onUnlock?: (pin?: string) => Promise<boolean> | boolean;\r\n persistLocked?: boolean;\r\n storageKey?: string;\r\n\r\n /** ▼ 탭 스코프용 확장 옵션 */\r\n eventTarget?: EventTarget | null; // 활동 감지/가드 대상 (기본: window)\r\n overlayScope?: \"global\" | \"scoped\"; // 캡처가드 범위\r\n overlayId?: string; // 오버레이 DOM id\r\n overlayPosition?: \"fixed\" | \"absolute\"; // 오버레이 위치 (전역: fixed, 탭: absolute)\r\n}> = ({\r\n children,\r\n idleMs = 10_000,\r\n onUnlock,\r\n persistLocked = true,\r\n storageKey = \"inactivityLocked\",\r\n eventTarget,\r\n overlayScope = \"global\",\r\n overlayId = \"lock-overlay-root\",\r\n overlayPosition = \"fixed\",\r\n}) => {\r\n const initialLocked =\r\n persistLocked &&\r\n typeof window !== \"undefined\" &&\r\n window.localStorage.getItem(storageKey) === \"1\";\r\n\r\n const [locked, setLocked] = useState(initialLocked);\r\n const [idle, setIdle] = useState(idleMs);\r\n const isIdleEnabled = Number.isFinite(idle) && idle > 0;\r\n const timerRef = useRef<number | null>(null);\r\n\r\n const lock = () => {\r\n try {\r\n if (persistLocked) window.localStorage.setItem(storageKey, \"1\");\r\n } catch {}\r\n setLocked(true);\r\n };\r\n\r\n const unlock = async (pin?: string) => {\r\n if (onUnlock) {\r\n const ok = await onUnlock(pin);\r\n if (!ok) return;\r\n }\r\n try {\r\n if (persistLocked) window.localStorage.removeItem(storageKey);\r\n } catch {}\r\n setLocked(false);\r\n if (isIdleEnabled) resetTimer();\r\n };\r\n\r\n const doLock = () => {\r\n try {\r\n if (persistLocked) window.localStorage.setItem(storageKey, \"1\");\r\n } catch {}\r\n setLocked(true);\r\n };\r\n\r\n const resetTimer = () => {\r\n if (!isIdleEnabled) return;\r\n if (timerRef.current) window.clearTimeout(timerRef.current);\r\n timerRef.current = window.setTimeout(() => {\r\n doLock();\r\n }, idle);\r\n };\r\n\r\n // 활동 감지: window → target(옵션)으로 스코프 전환 가능\r\n useEffect(() => {\r\n if (!isIdleEnabled) return;\r\n const onActivity = () => {\r\n if (!locked) resetTimer();\r\n };\r\n const opts = { passive: true } as AddEventListenerOptions;\r\n const evts = [\r\n \"pointermove\",\r\n \"pointerdown\",\r\n \"keydown\",\r\n \"wheel\",\r\n \"touchstart\",\r\n ];\r\n\r\n const target = (eventTarget ?? window) as any;\r\n evts.forEach((e) => target.addEventListener(e, onActivity, opts));\r\n resetTimer();\r\n\r\n return () => {\r\n if (timerRef.current) window.clearTimeout(timerRef.current);\r\n evts.forEach((e) => target.removeEventListener(e, onActivity as any));\r\n };\r\n }, [idle, locked, eventTarget, isIdleEnabled]);\r\n\r\n // 잠금 중 캡처가드: 전역(global) 또는 스코프(scoped)로 범위 선택\r\n useEffect(() => {\r\n if (!locked) return;\r\n\r\n const stop = (e: Event) => {\r\n const overlay = document.getElementById(overlayId);\r\n if (overlay && overlay.contains(e.target as Node)) return; // 오버레이 내부는 통과\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n\r\n const opts = { capture: true } as AddEventListenerOptions;\r\n const evs = [\r\n \"pointerdown\",\r\n \"pointerup\",\r\n \"pointermove\",\r\n \"click\",\r\n \"wheel\",\r\n \"keydown\",\r\n \"keyup\",\r\n \"touchstart\",\r\n \"touchmove\",\r\n ];\r\n\r\n // 전역이면 window, 스코프면 eventTarget(없으면 window)\r\n const guardTarget = (\r\n overlayScope === \"scoped\" ? eventTarget ?? window : window\r\n ) as any;\r\n evs.forEach((t) => guardTarget.addEventListener(t, stop, opts));\r\n return () =>\r\n evs.forEach((t) => guardTarget.removeEventListener(t, stop as any, opts));\r\n }, [locked, overlayScope, overlayId, eventTarget]);\r\n\r\n const value = useMemo(\r\n () => ({ locked, lock, unlock, setIdleMs: setIdle }),\r\n [locked]\r\n );\r\n\r\n return (\r\n <LockContext.Provider value={value}>\r\n <div\r\n style={{ width: \"100%\", height: \"100%\" }}\r\n {...(locked ? ({ inert: \"\" } as any) : {})}\r\n {...(locked ? { \"aria-hidden\": true } : {})}\r\n >\r\n {children}\r\n </div>\r\n {locked && (\r\n <LockOverlay\r\n onUnlock={unlock}\r\n overlayId={overlayId}\r\n overlayPosition={overlayPosition}\r\n />\r\n )}\r\n </LockContext.Provider>\r\n );\r\n};\r\n\r\nconst LockOverlay: React.FC<{\r\n onUnlock: (pin?: string) => void;\r\n overlayId?: string;\r\n overlayPosition?: \"fixed\" | \"absolute\";\r\n}> = ({\r\n onUnlock,\r\n overlayId = \"lock-overlay-root\",\r\n overlayPosition = \"fixed\",\r\n}) => {\r\n const [pinLen] = useState(4);\r\n const [val, setVal] = useState(\"\");\r\n\r\n return (\r\n <div\r\n id={overlayId}\r\n aria-modal=\"true\"\r\n role=\"dialog\"\r\n aria-label=\"Locked screen\"\r\n style={{\r\n position: overlayPosition,\r\n inset: 0,\r\n background: \"rgba(12, 14, 18, 0.85)\",\r\n backdropFilter: \"blur(4px)\",\r\n display: \"grid\",\r\n placeItems: \"center\",\r\n zIndex: 9999,\r\n }}\r\n >\r\n <div className=\"lockscreen-form\" style={{ width: 420, maxWidth: \"92vw\" }}>\r\n <div className=\"lock-icon-wrap\">\r\n <span className=\"lock-icon-box\"></span>\r\n </div>\r\n <h2>잠금됨</h2>\r\n <p>PIN 번호를 입력하세요</p>\r\n <div\r\n className=\"lock-ipt-wrap\"\r\n style={{ display: \"flex\", justifyContent: \"center\" }}\r\n >\r\n <Input.OTP\r\n mask={\"*\"}\r\n autoFocus\r\n length={pinLen}\r\n value={val}\r\n onChange={(v) => {\r\n const next = (v ?? \"\").replace(/\\D/g, \"\").slice(0, pinLen);\r\n setVal(next);\r\n if (next.length === pinLen) onUnlock(next);\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["LockContext","createContext","useLock","ctx","useContext","ScreenProtectProvider","children","idleMs","onUnlock","persistLocked","storageKey","eventTarget","overlayScope","overlayId","overlayPosition","initialLocked","locked","setLocked","useState","idle","setIdle","isIdleEnabled","timerRef","useRef","lock","unlock","pin","resetTimer","doLock","useEffect","onActivity","opts","evts","target","stop","overlay","evs","guardTarget","t","value","useMemo","jsxs","jsx","LockOverlay","pinLen","val","setVal","Input","v","next"],"mappings":";;;AAwBA,MAAMA,IAAcC,EAAuC,IAAI,GAElDC,IAAU,MAAM;AAC3B,QAAMC,IAAMC,EAAWJ,CAAW;AAClC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,mDAAmD;AACrE,SAAOA;AACT,GAGaE,IAYR,CAAC;AAAA,EACJ,UAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,YAAAC,IAAa;AAAA,EACb,aAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY;AAAA,EACZ,iBAAAC,IAAkB;AACpB,MAAM;AACJ,QAAMC,IACJN,KACA,OAAO,SAAW,OAClB,O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A,cAACK,EAAM;AAAA,cAAN;AAAA,gBACC,MAAM;AAAA,gBACN,WAAS;AAAA,gBACT,QAAQH;AAAA,gBACR,OAAOC;AAAA,gBACP,UAAU,CAACG,MAAM;AACf,wBAAMC,KAAQD,KAAK,IAAI,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAGJ,CAAM;AACzD,kBAAAE,EAAOG,CAAI,GACPA,EAAK,WAAWL,KAAQpC,EAASyC,CAAI;AAAA,gBAC3C;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const t=require("./jsx-runtime-CeSfJrVB.cjs"),N=require("antd"),o=require("react"),g=o.createContext(null),C=()=>{const c=o.useContext(g);if(!c)throw new Error("useLock must be used within ScreenProtectProvider");return c},q=({children:c,idleMs:v=1e4,onUnlock:p,persistLocked:r=!0,storageKey:u="inactivityLocked",eventTarget:a,overlayScope:w="global",overlayId:s="lock-overlay-root",overlayPosition:R="fixed"})=>{const L=r&&typeof window<"u"&&window.localStorage.getItem(u)==="1",[n,k]=o.useState(L),[f,b]=o.useState(v),h=Number.isFinite(f)&&f>0,l=o.useRef(null),I=()=>{try{r&&window.localStorage.setItem(u,"1")}catch{}k(!0)},E=async i=>{if(!(p&&!await p(i))){try{r&&window.localStorage.removeItem(u)}catch{}k(!1),h&&j()}},P=()=>{try{r&&window.localStorage.setItem(u,"1")}catch{}k(!0)},j=()=>{h&&(l.current&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{P()},f))};o.useEffect(()=>{if(!h)return;const i=()=>{n||j()},d={passive:!0},x=["pointermove","pointerdown","keydown","wheel","touchstart"],m=a??window;return x.forEach(e=>m.addEventListener(e,i,d)),j(),()=>{l.current&&window.clearTimeout(l.current),x.forEach(e=>m.removeEventListener(e,i))}},[f,n,a,h]),o.useEffect(()=>{if(!n)return;const i=e=>{const y=document.getElementById(s);y&&y.contains(e.target)||(e.stopPropagation(),e.preventDefault())},d={capture:!0},x=["pointerdown","pointerup","pointermove","click","wheel","keydown","keyup","touchstart","touchmove"],m=w==="scoped"?a??window:window;return x.forEach(e=>m.addEventListener(e,i,d)),()=>x.forEach(e=>m.removeEventListener(e,i,d))},[n,w,s,a]);const S=o.useMemo(()=>({locked:n,lock:I,unlock:E,setIdleMs:b}),[n]);return t.jsxRuntimeExports.jsxs(g.Provider,{value:S,children:[t.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},...n?{inert:""}:{},...n?{"aria-hidden":!0}:{},children:c}),n&&t.jsxRuntimeExports.jsx(F,{onUnlock:E,overlayId:s,overlayPosition:R})]})},F=({onUnlock:c,overlayId:v="lock-overlay-root",overlayPosition:p="fixed"})=>{const[r]=o.useState(4),[u,a]=o.useState("");return t.jsxRuntimeExports.jsx("div",{id:v,"aria-modal":"true",role:"dialog","aria-label":"Locked screen",style:{position:p,inset:0,background:"rgba(12, 14, 18, 0.85)",backdropFilter:"blur(4px)",display:"grid",placeItems:"center",zIndex:9999},children:t.jsxRuntimeExports.jsxs("div",{className:"lockscreen-form",style:{width:420,maxWidth:"92vw"},children:[t.jsxRuntimeExports.jsx("div",{className:"lock-icon-wrap",children:t.jsxRuntimeExports.jsx("span",{className:"lock-icon-box"})}),t.jsxRuntimeExports.jsx("h2",{children:"잠금됨"}),t.jsxRuntimeExports.jsx("p",{children:"PIN 번호를 입력하세요"}),t.jsxRuntimeExports.jsx("div",{className:"lock-ipt-wrap",style:{display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(N.Input.OTP,{mask:"*",autoFocus:!0,length:r,value:u,onChange:w=>{const s=(w??"").replace(/\D/g,"").slice(0,r);a(s),s.length===r&&c(s)}})})]})})};exports.ScreenProtectProvider=q;exports.useLock=C;
2
+ //# sourceMappingURL=ScreenProtectContext-CVuXrJm6.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenProtectContext-CVuXrJm6.cjs","sources":["../../src/provider/contexts/ScreenProtectContext.tsx"],"sourcesContent":["import { Input } from \"antd\";\r\nimport React, {\r\n createContext,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from \"react\";\r\n\r\n/**\r\n * ScreenProtectProvider\r\n * - 전역용(기본값): window 활동감지 + fixed 전체 오버레이\r\n * - 탭스코프용(옵션): eventTarget 활동감지 + absolute 탭 영역 오버레이\r\n */\r\n\r\n// ===================== Lock Context =====================\r\ntype LockContextValue = {\r\n locked: boolean;\r\n lock: () => void;\r\n unlock: (pin?: string) => Promise<void> | void;\r\n setIdleMs: (ms: number) => void;\r\n};\r\n\r\nconst LockContext = createContext<LockContextValue | null>(null);\r\n\r\nexport const useLock = () => {\r\n const ctx = useContext(LockContext);\r\n if (!ctx)\r\n throw new Error(\"useLock must be used within ScreenProtectProvider\");\r\n return ctx;\r\n};\r\n\r\n// ===================== Provider =====================\r\nexport const ScreenProtectProvider: React.FC<{\r\n children: React.ReactNode;\r\n idleMs?: number;\r\n onUnlock?: (pin?: string) => Promise<boolean> | boolean;\r\n persistLocked?: boolean;\r\n storageKey?: string;\r\n\r\n /** ▼ 탭 스코프용 확장 옵션 */\r\n eventTarget?: EventTarget | null; // 활동 감지/가드 대상 (기본: window)\r\n overlayScope?: \"global\" | \"scoped\"; // 캡처가드 범위\r\n overlayId?: string; // 오버레이 DOM id\r\n overlayPosition?: \"fixed\" | \"absolute\"; // 오버레이 위치 (전역: fixed, 탭: absolute)\r\n}> = ({\r\n children,\r\n idleMs = 10_000,\r\n onUnlock,\r\n persistLocked = true,\r\n storageKey = \"inactivityLocked\",\r\n eventTarget,\r\n overlayScope = \"global\",\r\n overlayId = \"lock-overlay-root\",\r\n overlayPosition = \"fixed\",\r\n}) => {\r\n const initialLocked =\r\n persistLocked &&\r\n typeof window !== \"undefined\" &&\r\n window.localStorage.getItem(storageKey) === \"1\";\r\n\r\n const [locked, setLocked] = useState(initialLocked);\r\n const [idle, setIdle] = useState(idleMs);\r\n const isIdleEnabled = Number.isFinite(idle) && idle > 0;\r\n const timerRef = useRef<number | null>(null);\r\n\r\n const lock = () => {\r\n try {\r\n if (persistLocked) window.localStorage.setItem(storageKey, \"1\");\r\n } catch {}\r\n setLocked(true);\r\n };\r\n\r\n const unlock = async (pin?: string) => {\r\n if (onUnlock) {\r\n const ok = await onUnlock(pin);\r\n if (!ok) return;\r\n }\r\n try {\r\n if (persistLocked) window.localStorage.removeItem(storageKey);\r\n } catch {}\r\n setLocked(false);\r\n if (isIdleEnabled) resetTimer();\r\n };\r\n\r\n const doLock = () => {\r\n try {\r\n if (persistLocked) window.localStorage.setItem(storageKey, \"1\");\r\n } catch {}\r\n setLocked(true);\r\n };\r\n\r\n const resetTimer = () => {\r\n if (!isIdleEnabled) return;\r\n if (timerRef.current) window.clearTimeout(timerRef.current);\r\n timerRef.current = window.setTimeout(() => {\r\n doLock();\r\n }, idle);\r\n };\r\n\r\n // 활동 감지: window → target(옵션)으로 스코프 전환 가능\r\n useEffect(() => {\r\n if (!isIdleEnabled) return;\r\n const onActivity = () => {\r\n if (!locked) resetTimer();\r\n };\r\n const opts = { passive: true } as AddEventListenerOptions;\r\n const evts = [\r\n \"pointermove\",\r\n \"pointerdown\",\r\n \"keydown\",\r\n \"wheel\",\r\n \"touchstart\",\r\n ];\r\n\r\n const target = (eventTarget ?? window) as any;\r\n evts.forEach((e) => target.addEventListener(e, onActivity, opts));\r\n resetTimer();\r\n\r\n return () => {\r\n if (timerRef.current) window.clearTimeout(timerRef.current);\r\n evts.forEach((e) => target.removeEventListener(e, onActivity as any));\r\n };\r\n }, [idle, locked, eventTarget, isIdleEnabled]);\r\n\r\n // 잠금 중 캡처가드: 전역(global) 또는 스코프(scoped)로 범위 선택\r\n useEffect(() => {\r\n if (!locked) return;\r\n\r\n const stop = (e: Event) => {\r\n const overlay = document.getElementById(overlayId);\r\n if (overlay && overlay.contains(e.target as Node)) return; // 오버레이 내부는 통과\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n\r\n const opts = { capture: true } as AddEventListenerOptions;\r\n const evs = [\r\n \"pointerdown\",\r\n \"pointerup\",\r\n \"pointermove\",\r\n \"click\",\r\n \"wheel\",\r\n \"keydown\",\r\n \"keyup\",\r\n \"touchstart\",\r\n \"touchmove\",\r\n ];\r\n\r\n // 전역이면 window, 스코프면 eventTarget(없으면 window)\r\n const guardTarget = (\r\n overlayScope === \"scoped\" ? eventTarget ?? window : window\r\n ) as any;\r\n evs.forEach((t) => guardTarget.addEventListener(t, stop, opts));\r\n return () =>\r\n evs.forEach((t) => guardTarget.removeEventListener(t, stop as any, opts));\r\n }, [locked, overlayScope, overlayId, eventTarget]);\r\n\r\n const value = useMemo(\r\n () => ({ locked, lock, unlock, setIdleMs: setIdle }),\r\n [locked]\r\n );\r\n\r\n return (\r\n <LockContext.Provider value={value}>\r\n <div\r\n style={{ width: \"100%\", height: \"100%\" }}\r\n {...(locked ? ({ inert: \"\" } as any) : {})}\r\n {...(locked ? { \"aria-hidden\": true } : {})}\r\n >\r\n {children}\r\n </div>\r\n {locked && (\r\n <LockOverlay\r\n onUnlock={unlock}\r\n overlayId={overlayId}\r\n overlayPosition={overlayPosition}\r\n />\r\n )}\r\n </LockContext.Provider>\r\n );\r\n};\r\n\r\nconst LockOverlay: React.FC<{\r\n onUnlock: (pin?: string) => void;\r\n overlayId?: string;\r\n overlayPosition?: \"fixed\" | \"absolute\";\r\n}> = ({\r\n onUnlock,\r\n overlayId = \"lock-overlay-root\",\r\n overlayPosition = \"fixed\",\r\n}) => {\r\n const [pinLen] = useState(4);\r\n const [val, setVal] = useState(\"\");\r\n\r\n return (\r\n <div\r\n id={overlayId}\r\n aria-modal=\"true\"\r\n role=\"dialog\"\r\n aria-label=\"Locked screen\"\r\n style={{\r\n position: overlayPosition,\r\n inset: 0,\r\n background: \"rgba(12, 14, 18, 0.85)\",\r\n backdropFilter: \"blur(4px)\",\r\n display: \"grid\",\r\n placeItems: \"center\",\r\n zIndex: 9999,\r\n }}\r\n >\r\n <div className=\"lockscreen-form\" style={{ width: 420, maxWidth: \"92vw\" }}>\r\n <div className=\"lock-icon-wrap\">\r\n <span className=\"lock-icon-box\"></span>\r\n </div>\r\n <h2>잠금됨</h2>\r\n <p>PIN 번호를 입력하세요</p>\r\n <div\r\n className=\"lock-ipt-wrap\"\r\n style={{ display: \"flex\", justifyContent: \"center\" }}\r\n >\r\n <Input.OTP\r\n mask={\"*\"}\r\n autoFocus\r\n length={pinLen}\r\n value={val}\r\n onChange={(v) => {\r\n const next = (v ?? \"\").replace(/\\D/g, \"\").slice(0, pinLen);\r\n setVal(next);\r\n if (next.length === pinLen) onUnlock(next);\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["LockContext","createContext","useLock","ctx","useContext","ScreenProtectProvider","children","idleMs","onUnlock","persistLocked","storageKey","eventTarget","overlayScope","overlayId","overlayPosition","initialLocked","locked","setLocked","useState","idle","setIdle","isIdleEnabled","timerRef","useRef","lock","unlock","pin","resetTimer","doLock","useEffect","onActivity","opts","evts","target","stop","overlay","evs","guardTarget","t","value","useMemo","jsxs","jsx","LockOverlay","pinLen","val","setVal","Input","v","next"],"mappings":"gGAwBMA,EAAcC,EAAAA,cAAuC,IAAI,EAElDC,EAAU,IAAM,CAC3B,MAAMC,EAAMC,EAAAA,WAAWJ,CAAW,EAClC,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,mDAAmD,EACrE,OAAOA,CACT,EAGaE,EAYR,CAAC,CACJ,SAAAC,EACA,OAAAC,EAAS,IACT,SAAAC,EACA,cAAAC,EAAgB,GAChB,WAAAC,EAAa,mBACb,YAAAC,EACA,aAAAC,EAAe,SACf,UAAAC,EAAY,oBACZ,gBAAAC,EAAkB,OACpB,IAAM,CACJ,MAAMC,EACJN,GACA,OAAO,OAAW,KAClB,OAAO,aAAa,QAAQC,CAAU,IAAM,IAExC,CAACM,EAAQC,CAAS,EAAIC,EAAAA,SAASH,CAAa,EAC5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A,IAAC,MAAA,CACC,GAAI7B,EACJ,aAAW,OACX,KAAK,SACL,aAAW,gBACX,MAAO,CACL,SAAUC,EACV,MAAO,EACP,WAAY,yBACZ,eAAgB,YAChB,QAAS,OACT,WAAY,SACZ,OAAQ,IAAA,EAGV,SAAA2B,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,kBAAkB,MAAO,CAAE,MAAO,IAAK,SAAU,MAAA,EAC9D,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,OAAI,UAAU,iBACb,iCAAC,OAAA,CAAK,UAAU,gBAAgB,CAAA,CAClC,EACAA,EAAAA,kBAAAA,IAAC,MAAG,SAAA,KAAA,CAAG,EACPA,EAAAA,kBAAAA,IAAC,KAAE,SAAA,eAAA,CAAa,EAChBA,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAU,gBACV,MAAO,CAAE,QAAS,OAAQ,eAAgB,QAAA,EAE1C,SAAAA,EAAAA,kBAAAA,IAACK,EAAAA,MAAM,IAAN,CACC,KAAM,IACN,UAAS,GACT,OAAQH,EACR,MAAOC,EACP,SAAWG,GAAM,CACf,MAAMC,GAAQD,GAAK,IAAI,QAAQ,MAAO,EAAE,EAAE,MAAM,EAAGJ,CAAM,EACzDE,EAAOG,CAAI,EACPA,EAAK,SAAWL,GAAQpC,EAASyC,CAAI,CAC3C,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CAGN"}
@@ -2,7 +2,7 @@ import { useCallback as P, createContext as g, useContext as d } from "react";
2
2
  import { u as v } from "./popupStore-BJ_IYrdY.js";
3
3
  import { j as y } from "./jsx-runtime-Dpn_P65e.js";
4
4
  import { u as L } from "./codeStore-rU4v3QIA.js";
5
- import { am as E, ap as S, ac as x, aI as A, aJ as I, ai as N, aF as T, aH as G, ad as k, aK as w, a6 as H, T as B, Z as M, Y as q, X as O, W as R, P as W, O as j, R as V, aL as F, aM as K, aN as z } from "./commonUtils-BV6WFv-z.js";
5
+ import { am as E, ap as S, ac as x, aI as A, aJ as I, ai as N, aF as T, aH as G, ad as k, aK as w, a6 as H, T as B, Z as M, Y as q, X as O, W as R, P as W, O as j, R as V, aL as F, aM as K, aN as z } from "./commonUtils-Cvx6_eK2.js";
6
6
  import { S as J, Q, U as X, T as Y, R as Z, V as _, aq as $ } from "./serviceConfig-lAlRNVIw.js";
7
7
  const ne = () => !1, ue = () => {
8
8
  const { popups: e, activePopupId: o, setActivePopup: a, closePopup: u, openPopup: i } = v(), c = P(
@@ -238,4 +238,4 @@ export {
238
238
  ue as m,
239
239
  r as u
240
240
  };
241
- //# sourceMappingURL=UtilsContext-CSgz9o2Z.js.map
241
+ //# sourceMappingURL=UtilsContext-BKUZmmKx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UtilsContext-CSgz9o2Z.js","sources":["../../src/provider/hooks/usePopup.ts","../../src/provider/contexts/CommonCodeContext.tsx","../../src/provider/contexts/UtilsContext.tsx"],"sourcesContent":["import { useCallback } from 'react';\r\nimport { usePopupStore, type PopupConfig } from '../../stores/popupStore';\r\n\r\n/**\r\n * 팝업 컨텍스트를 감지하는 훅\r\n * 팝업 내부에서 사용하면 true, 일반 페이지에서는 false 반환\r\n */\r\nexport const usePopupContext = (): boolean => {\r\n // 팝업 내부에서만 true를 반환하도록 수정\r\n // 현재는 팝업이 열려있으면 모든 컴포넌트가 팝업으로 인식되는 문제가 있음\r\n // 임시로 false 반환 (수동으로 isPopup prop 사용 권장)\r\n return false;\r\n};\r\n\r\n/**\r\n * 팝업 데이터와 이벤트를 관리하는 훅\r\n */\r\nexport const usePopup = () => {\r\n const { popups, activePopupId, setActivePopup, closePopup, openPopup } =\r\n usePopupStore();\r\n\r\n // 팝업 열기 함수\r\n const showPopup = useCallback(\r\n async (popupCode: string, popParams?: any, config?: PopupConfig) => {\r\n try {\r\n await openPopup(popupCode, popParams, config);\r\n } catch (error) {\r\n console.error('팝업 열기 실패:', error);\r\n throw error;\r\n }\r\n },\r\n [openPopup]\r\n );\r\n\r\n return {\r\n popups,\r\n activePopupId,\r\n setActivePopup,\r\n closePopup,\r\n showPopup,\r\n isPopup: popups.length > 0,\r\n };\r\n};\r\n","import { useCodeStore, type CommonCodeContextType } from '../../stores/codeStore';\r\nimport { createContext, useContext, ReactNode } from 'react';\r\n\r\n// 공통코드 컨텍스트 생성\r\nconst CommonCodeContext = createContext<CommonCodeContextType | undefined>(\r\n undefined\r\n);\r\n\r\n// 공통코드 컨텍스트 프로바이더 컴포넌트\r\ninterface CommonCodeProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const CommonCodeProvider: React.FC<CommonCodeProviderProps> = ({\r\n children,\r\n}) => {\r\n const {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n fetchCommonCodes,\r\n } = useCodeStore();\r\n\r\n const contextValue: CommonCodeContextType = {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n refreshCodes: fetchCommonCodes,\r\n };\r\n\r\n return (\r\n <CommonCodeContext.Provider value={contextValue}>\r\n {children}\r\n </CommonCodeContext.Provider>\r\n );\r\n};\r\n\r\n// 공통코드 컨텍스트 사용 훅\r\nexport const useCommonCode = (): CommonCodeContextType => {\r\n const context = useContext(CommonCodeContext);\r\n if (context === undefined) {\r\n throw new Error('useCommonCode must be used within a CommonCodeProvider');\r\n }\r\n return context;\r\n};\r\n\r\n// 편의 훅들 (Fast Refresh 호환성을 위해 매개변수 없는 함수로 변경)\r\nexport const useCodeList = () => {\r\n const { getCodeList, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeList,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeName = () => {\r\n const { getCodeName, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeName,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeColor = () => {\r\n const { getCodeColor, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeColor,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeListByOption = () => {\r\n const { getCodeListByOption, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeListByOption,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useGridLookup = () => {\r\n const { getGridLookup, isLoading, error } = useCommonCode();\r\n return {\r\n getGridLookup,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n","import React, { createContext, useContext } from \"react\";\r\nimport type { ReactNode } from \"react\";\r\nimport * as dateUtils from \"../../utils/dateUtils\";\r\nimport * as stringUtils from \"../../utils/stringUtils\";\r\nimport * as arrayUtils from \"../../utils/arrayUtils\";\r\nimport * as objectUtils from \"../../utils/objectUtils\";\r\nimport * as commonUtils from \"../../utils/commonUtils\";\r\nimport * as apiUtils from \"../../utils/apiUtils\";\r\n\r\n// 모든 유틸리티 함수들을 하나의 객체로 결합 (충돌하는 함수명은 별칭 사용)\r\nconst utils = {\r\n // 날짜 유틸리티\r\n ...dateUtils,\r\n // 문자열 유틸리티\r\n ...stringUtils,\r\n // 배열 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n isEmptyArray: arrayUtils.isEmptyArray,\r\n isNotEmptyArray: arrayUtils.isNotEmptyArray,\r\n unique: arrayUtils.unique,\r\n shuffle: arrayUtils.shuffle,\r\n sortBy: arrayUtils.sortBy,\r\n max: arrayUtils.max,\r\n min: arrayUtils.min,\r\n average: arrayUtils.average,\r\n sum: arrayUtils.sum,\r\n randomFromArray: arrayUtils.randomFromArray,\r\n flattenArray: arrayUtils.flattenArray,\r\n // 객체 유틸리티\r\n ...objectUtils,\r\n // 일반 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n debounce: commonUtils.debounce,\r\n throttle: commonUtils.throttle,\r\n setLocalStorage: commonUtils.setLocalStorage,\r\n getLocalStorage: commonUtils.getLocalStorage,\r\n formatNumber: commonUtils.formatNumber,\r\n formatCurrency: commonUtils.formatCurrency,\r\n copyToClipboard: commonUtils.copyToClipboard,\r\n isMobile: commonUtils.isMobile,\r\n isDesktop: commonUtils.isDesktop,\r\n // API 유틸리티\r\n callService: apiUtils.callService,\r\n apiGet: apiUtils.apiGet,\r\n apiPost: apiUtils.apiPost,\r\n apiPut: apiUtils.apiPut,\r\n apiDelete: apiUtils.apiDelete,\r\n apiPatch: apiUtils.apiPatch,\r\n};\r\n\r\n// Context 타입 정의\r\ninterface UtilsContextType {\r\n utils: typeof utils;\r\n}\r\n\r\n// Context 생성\r\nconst UtilsContext = createContext<UtilsContextType | undefined>(undefined);\r\n\r\n// Provider 컴포넌트\r\ninterface UtilsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const UtilsProvider: React.FC<UtilsProviderProps> = ({ children }) => {\r\n return (\r\n <UtilsContext.Provider value={{ utils }}>{children}</UtilsContext.Provider>\r\n );\r\n};\r\n\r\n// Hook for using utils\r\nexport const useUtils = () => {\r\n const context = useContext(UtilsContext);\r\n if (context === undefined) {\r\n throw new Error(\"useUtils must be used within a UtilsProvider\");\r\n }\r\n return context.utils;\r\n};\r\n\r\n// 안전한 함수 가져오기 헬퍼\r\nconst safeGet = (obj: any, key: string, fallback?: any) => {\r\n return obj && typeof obj[key] === \"function\"\r\n ? obj[key]\r\n : fallback || (() => {});\r\n};\r\n\r\n// 개별 유틸리티 훅들 (선택사항)\r\nexport const useDateUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n formatDate: safeGet(utils, \"formatDate\"),\r\n formatDateKorean: safeGet(utils, \"formatDateKorean\"),\r\n getCurrentDate: safeGet(utils, \"getCurrentDate\"),\r\n getCurrentDateString: safeGet(utils, \"getCurrentDateString\"),\r\n getRelativeTime: safeGet(utils, \"getRelativeTime\"),\r\n isToday: safeGet(utils, \"isToday\"),\r\n isThisWeek: safeGet(utils, \"isThisWeek\"),\r\n isThisMonth: safeGet(utils, \"isThisMonth\"),\r\n getDateDiff: safeGet(utils, \"getDateDiff\"),\r\n calculateAge: safeGet(utils, \"calculateAge\"),\r\n };\r\n};\r\n\r\nexport const useStringUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmpty: safeGet(utils, \"isEmpty\"),\r\n isNotEmpty: safeGet(utils, \"isNotEmpty\"),\r\n truncate: safeGet(utils, \"truncate\"),\r\n capitalize: safeGet(utils, \"capitalize\"),\r\n formatPhoneNumber: safeGet(utils, \"formatPhoneNumber\"),\r\n isValidEmail: safeGet(utils, \"isValidEmail\"),\r\n removeHtmlTags: safeGet(utils, \"removeHtmlTags\"),\r\n // UID 생성 함수들\r\n generateUID: safeGet(utils, \"generateUID\"),\r\n generateShortUID: safeGet(utils, \"generateShortUID\"),\r\n generateLongUID: safeGet(utils, \"generateLongUID\"),\r\n generateNumericUID: safeGet(utils, \"generateNumericUID\"),\r\n generateAlphanumericUID: safeGet(utils, \"generateAlphanumericUID\"),\r\n generateGUID: safeGet(utils, \"generateGUID\"),\r\n generateGUIDWithoutHyphens: safeGet(utils, \"generateGUIDWithoutHyphens\"),\r\n generateTimestampUID: safeGet(utils, \"generateTimestampUID\"),\r\n generateCustomUID: safeGet(utils, \"generateCustomUID\"),\r\n // 암호화 관련 함수들\r\n encryptSha256: safeGet(utils, \"encryptSha256\"),\r\n bxmEncrypt: safeGet(utils, \"bxmEncrypt\"),\r\n bxmDecrypt: safeGet(utils, \"bxmDecrypt\"),\r\n simpleEncrypt: safeGet(utils, \"simpleEncrypt\"),\r\n simpleDecrypt: safeGet(utils, \"simpleDecrypt\"),\r\n md5Hash: safeGet(utils, \"md5Hash\"),\r\n sha256Hash: safeGet(utils, \"sha256Hash\"),\r\n base64Encode: safeGet(utils, \"base64Encode\"),\r\n base64Decode: safeGet(utils, \"base64Decode\"),\r\n };\r\n};\r\n\r\nexport const useArrayUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmptyArray: safeGet(utils, \"isEmptyArray\"),\r\n isNotEmptyArray: safeGet(utils, \"isNotEmptyArray\"),\r\n unique: safeGet(utils, \"unique\"),\r\n shuffle: safeGet(utils, \"shuffle\"),\r\n sortBy: safeGet(utils, \"sortBy\"),\r\n max: safeGet(utils, \"max\"),\r\n min: safeGet(utils, \"min\"),\r\n average: safeGet(utils, \"average\"),\r\n sum: safeGet(utils, \"sum\"),\r\n };\r\n};\r\n\r\nexport const useCommonUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n debounce: safeGet(utils, \"debounce\"),\r\n throttle: safeGet(utils, \"throttle\"),\r\n setLocalStorage: safeGet(utils, \"setLocalStorage\"),\r\n getLocalStorage: safeGet(utils, \"getLocalStorage\"),\r\n formatNumber: safeGet(utils, \"formatNumber\"),\r\n formatCurrency: safeGet(utils, \"formatCurrency\"),\r\n copyToClipboard: safeGet(utils, \"copyToClipboard\"),\r\n isMobile: safeGet(utils, \"isMobile\"),\r\n isDesktop: safeGet(utils, \"isDesktop\"),\r\n };\r\n};\r\n\r\nexport const useApiUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n callService: safeGet(utils, \"callService\"),\r\n apiGet: safeGet(utils, \"apiGet\"),\r\n apiPost: safeGet(utils, \"apiPost\"),\r\n apiPut: safeGet(utils, \"apiPut\"),\r\n apiDelete: safeGet(utils, \"apiDelete\"),\r\n apiPatch: safeGet(utils, \"apiPatch\"),\r\n };\r\n};\r\n"],"names":["usePopupContext","usePopup","popups","activePopupId","setActivePopup","closePopup","openPopup","usePopupStore","showPopup","useCallback","popupCode","popParams","config","error","CommonCodeContext","createContext","CommonCodeProvider","children","codeData","isLoading","lastUpdated","getCodeList","getCodeListByOption","getCodeName","getCodeColor","getCodeByOption","getAvailableGroupCodes","getGridLookup","fetchCommonCodes","useCodeStore","contextValue","useCommonCode","context","useContext","useCodeList","useCodeName","useCodeColor","useCodeListByOption","useGridLookup","utils","dateUtils","stringUtils","arrayUtils.isEmptyArray","arrayUtils.isNotEmptyArray","arrayUtils.unique","arrayUtils.shuffle","arrayUtils.sortBy","arrayUtils.max","arrayUtils.min","arrayUtils.average","arrayUtils.sum","arrayUtils.randomFromArray","arrayUtils.flattenArray","objectUtils","commonUtils.debounce","commonUtils.throttle","commonUtils.setLocalStorage","commonUtils.getLocalStorage","commonUtils.formatNumber","commonUtils.formatCurrency","commonUtils.copyToClipboard","commonUtils.isMobile","commonUtils.isDesktop","apiUtils.callService","apiUtils.apiGet","apiUtils.apiPost","apiUtils.apiPut","apiUtils.apiDelete","apiUtils.apiPatch","UtilsContext","UtilsProvider","jsx","useUtils","safeGet","obj","key","fallback","useDateUtils","useStringUtils","useArrayUtils","useCommonUtils","useApiUtils"],"mappings":";;;;;;AAOO,MAAMA,KAAkB,MAItB,IAMIC,KAAW,MAAM;AAC5B,QAAM,EAAE,QAAAC,GAAQ,eAAAC,GAAe,gBAAAC,GAAgB,YAAAC,GAAY,WAAAC,EAAA,IACzDC,EAAA,GAGIC,IAAYC;AAAA,IAChB,OAAOC,GAAmBC,GAAiBC,MAAyB;AAClE,UAAI;AACF,cAAMN,EAAUI,GAAWC,GAAWC,CAAM;AAAA,MAC9C,SAASC,GAAO;AACd,sBAAQ,MAAM,aAAaA,CAAK,GAC1BA;AAAA,MACR;AAAA,IACF;AAAA,IACA,CAACP,CAAS;AAAA,EAAA;AAGZ,SAAO;AAAA,IACL,QAAAJ;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAG;AAAA,IACA,SAASN,EAAO,SAAS;AAAA,EAAA;AAE7B,GCtCMY,IAAoBC;AAAA,EACxB;AACF,GAOaC,KAAwD,CAAC;AAAA,EACpE,UAAAC;AACF,MAAM;AACJ,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAN;AAAA,IACA,aAAAO;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,cAAAC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AO,gBAAgB;AAAA,IAC/C,iBAAiBkC,EAAQlC,GAAO,iBAAiB;AAAA,IACjD,UAAUkC,EAAQlC,GAAO,UAAU;AAAA,IACnC,WAAWkC,EAAQlC,GAAO,WAAW;AAAA,EAAA;AAEzC,GAEa0C,KAAc,MAAM;AAC/B,QAAM1C,IAAQiC,EAAA;AACd,SAAO;AAAA,IACL,aAAaC,EAAQlC,GAAO,aAAa;AAAA,IACzC,QAAQkC,EAAQlC,GAAO,QAAQ;AAAA,IAC/B,SAASkC,EAAQlC,GAAO,SAAS;AAAA,IACjC,QAAQkC,EAAQlC,GAAO,QAAQ;AAAA,IAC/B,WAAWkC,EAAQlC,GAAO,WAAW;AAAA,IACrC,UAAUkC,EAAQlC,GAAO,UAAU;AAAA,EAAA;AAEvC;"}
1
+ {"version":3,"file":"UtilsContext-BKUZmmKx.js","sources":["../../src/provider/hooks/usePopup.ts","../../src/provider/contexts/CommonCodeContext.tsx","../../src/provider/contexts/UtilsContext.tsx"],"sourcesContent":["import { useCallback } from 'react';\r\nimport { usePopupStore, type PopupConfig } from '../../stores/popupStore';\r\n\r\n/**\r\n * 팝업 컨텍스트를 감지하는 훅\r\n * 팝업 내부에서 사용하면 true, 일반 페이지에서는 false 반환\r\n */\r\nexport const usePopupContext = (): boolean => {\r\n // 팝업 내부에서만 true를 반환하도록 수정\r\n // 현재는 팝업이 열려있으면 모든 컴포넌트가 팝업으로 인식되는 문제가 있음\r\n // 임시로 false 반환 (수동으로 isPopup prop 사용 권장)\r\n return false;\r\n};\r\n\r\n/**\r\n * 팝업 데이터와 이벤트를 관리하는 훅\r\n */\r\nexport const usePopup = () => {\r\n const { popups, activePopupId, setActivePopup, closePopup, openPopup } =\r\n usePopupStore();\r\n\r\n // 팝업 열기 함수\r\n const showPopup = useCallback(\r\n async (popupCode: string, popParams?: any, config?: PopupConfig) => {\r\n try {\r\n await openPopup(popupCode, popParams, config);\r\n } catch (error) {\r\n console.error('팝업 열기 실패:', error);\r\n throw error;\r\n }\r\n },\r\n [openPopup]\r\n );\r\n\r\n return {\r\n popups,\r\n activePopupId,\r\n setActivePopup,\r\n closePopup,\r\n showPopup,\r\n isPopup: popups.length > 0,\r\n };\r\n};\r\n","import { useCodeStore, type CommonCodeContextType } from '../../stores/codeStore';\r\nimport { createContext, useContext, ReactNode } from 'react';\r\n\r\n// 공통코드 컨텍스트 생성\r\nconst CommonCodeContext = createContext<CommonCodeContextType | undefined>(\r\n undefined\r\n);\r\n\r\n// 공통코드 컨텍스트 프로바이더 컴포넌트\r\ninterface CommonCodeProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const CommonCodeProvider: React.FC<CommonCodeProviderProps> = ({\r\n children,\r\n}) => {\r\n const {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n fetchCommonCodes,\r\n } = useCodeStore();\r\n\r\n const contextValue: CommonCodeContextType = {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n refreshCodes: fetchCommonCodes,\r\n };\r\n\r\n return (\r\n <CommonCodeContext.Provider value={contextValue}>\r\n {children}\r\n </CommonCodeContext.Provider>\r\n );\r\n};\r\n\r\n// 공통코드 컨텍스트 사용 훅\r\nexport const useCommonCode = (): CommonCodeContextType => {\r\n const context = useContext(CommonCodeContext);\r\n if (context === undefined) {\r\n throw new Error('useCommonCode must be used within a CommonCodeProvider');\r\n }\r\n return context;\r\n};\r\n\r\n// 편의 훅들 (Fast Refresh 호환성을 위해 매개변수 없는 함수로 변경)\r\nexport const useCodeList = () => {\r\n const { getCodeList, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeList,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeName = () => {\r\n const { getCodeName, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeName,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeColor = () => {\r\n const { getCodeColor, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeColor,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeListByOption = () => {\r\n const { getCodeListByOption, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeListByOption,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useGridLookup = () => {\r\n const { getGridLookup, isLoading, error } = useCommonCode();\r\n return {\r\n getGridLookup,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n","import React, { createContext, useContext } from \"react\";\r\nimport type { ReactNode } from \"react\";\r\nimport * as dateUtils from \"../../utils/dateUtils\";\r\nimport * as stringUtils from \"../../utils/stringUtils\";\r\nimport * as arrayUtils from \"../../utils/arrayUtils\";\r\nimport * as objectUtils from \"../../utils/objectUtils\";\r\nimport * as commonUtils from \"../../utils/commonUtils\";\r\nimport * as apiUtils from \"../../utils/apiUtils\";\r\n\r\n// 모든 유틸리티 함수들을 하나의 객체로 결합 (충돌하는 함수명은 별칭 사용)\r\nconst utils = {\r\n // 날짜 유틸리티\r\n ...dateUtils,\r\n // 문자열 유틸리티\r\n ...stringUtils,\r\n // 배열 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n isEmptyArray: arrayUtils.isEmptyArray,\r\n isNotEmptyArray: arrayUtils.isNotEmptyArray,\r\n unique: arrayUtils.unique,\r\n shuffle: arrayUtils.shuffle,\r\n sortBy: arrayUtils.sortBy,\r\n max: arrayUtils.max,\r\n min: arrayUtils.min,\r\n average: arrayUtils.average,\r\n sum: arrayUtils.sum,\r\n randomFromArray: arrayUtils.randomFromArray,\r\n flattenArray: arrayUtils.flattenArray,\r\n // 객체 유틸리티\r\n ...objectUtils,\r\n // 일반 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n debounce: commonUtils.debounce,\r\n throttle: commonUtils.throttle,\r\n setLocalStorage: commonUtils.setLocalStorage,\r\n getLocalStorage: commonUtils.getLocalStorage,\r\n formatNumber: commonUtils.formatNumber,\r\n formatCurrency: commonUtils.formatCurrency,\r\n copyToClipboard: commonUtils.copyToClipboard,\r\n isMobile: commonUtils.isMobile,\r\n isDesktop: commonUtils.isDesktop,\r\n // API 유틸리티\r\n callService: apiUtils.callService,\r\n apiGet: apiUtils.apiGet,\r\n apiPost: apiUtils.apiPost,\r\n apiPut: apiUtils.apiPut,\r\n apiDelete: apiUtils.apiDelete,\r\n apiPatch: apiUtils.apiPatch,\r\n};\r\n\r\n// Context 타입 정의\r\ninterface UtilsContextType {\r\n utils: typeof utils;\r\n}\r\n\r\n// Context 생성\r\nconst UtilsContext = createContext<UtilsContextType | undefined>(undefined);\r\n\r\n// Provider 컴포넌트\r\ninterface UtilsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const UtilsProvider: React.FC<UtilsProviderProps> = ({ children }) => {\r\n return (\r\n <UtilsContext.Provider value={{ utils }}>{children}</UtilsContext.Provider>\r\n );\r\n};\r\n\r\n// Hook for using utils\r\nexport const useUtils = () => {\r\n const context = useContext(UtilsContext);\r\n if (context === undefined) {\r\n throw new Error(\"useUtils must be used within a UtilsProvider\");\r\n }\r\n return context.utils;\r\n};\r\n\r\n// 안전한 함수 가져오기 헬퍼\r\nconst safeGet = (obj: any, key: string, fallback?: any) => {\r\n return obj && typeof obj[key] === \"function\"\r\n ? obj[key]\r\n : fallback || (() => {});\r\n};\r\n\r\n// 개별 유틸리티 훅들 (선택사항)\r\nexport const useDateUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n formatDate: safeGet(utils, \"formatDate\"),\r\n formatDateKorean: safeGet(utils, \"formatDateKorean\"),\r\n getCurrentDate: safeGet(utils, \"getCurrentDate\"),\r\n getCurrentDateString: safeGet(utils, \"getCurrentDateString\"),\r\n getRelativeTime: safeGet(utils, \"getRelativeTime\"),\r\n isToday: safeGet(utils, \"isToday\"),\r\n isThisWeek: safeGet(utils, \"isThisWeek\"),\r\n isThisMonth: safeGet(utils, \"isThisMonth\"),\r\n getDateDiff: safeGet(utils, \"getDateDiff\"),\r\n calculateAge: safeGet(utils, \"calculateAge\"),\r\n };\r\n};\r\n\r\nexport const useStringUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmpty: safeGet(utils, \"isEmpty\"),\r\n isNotEmpty: safeGet(utils, \"isNotEmpty\"),\r\n truncate: safeGet(utils, \"truncate\"),\r\n capitalize: safeGet(utils, \"capitalize\"),\r\n formatPhoneNumber: safeGet(utils, \"formatPhoneNumber\"),\r\n isValidEmail: safeGet(utils, \"isValidEmail\"),\r\n removeHtmlTags: safeGet(utils, \"removeHtmlTags\"),\r\n // UID 생성 함수들\r\n generateUID: safeGet(utils, \"generateUID\"),\r\n generateShortUID: safeGet(utils, \"generateShortUID\"),\r\n generateLongUID: safeGet(utils, \"generateLongUID\"),\r\n generateNumericUID: safeGet(utils, \"generateNumericUID\"),\r\n generateAlphanumericUID: safeGet(utils, \"generateAlphanumericUID\"),\r\n generateGUID: safeGet(utils, \"generateGUID\"),\r\n generateGUIDWithoutHyphens: safeGet(utils, \"generateGUIDWithoutHyphens\"),\r\n generateTimestampUID: safeGet(utils, \"generateTimestampUID\"),\r\n generateCustomUID: safeGet(utils, \"generateCustomUID\"),\r\n // 암호화 관련 함수들\r\n encryptSha256: safeGet(utils, \"encryptSha256\"),\r\n bxmEncrypt: safeGet(utils, \"bxmEncrypt\"),\r\n bxmDecrypt: safeGet(utils, \"bxmDecrypt\"),\r\n simpleEncrypt: safeGet(utils, \"simpleEncrypt\"),\r\n simpleDecrypt: safeGet(utils, \"simpleDecrypt\"),\r\n md5Hash: safeGet(utils, \"md5Hash\"),\r\n sha256Hash: safeGet(utils, \"sha256Hash\"),\r\n base64Encode: safeGet(utils, \"base64Encode\"),\r\n base64Decode: safeGet(utils, \"base64Decode\"),\r\n };\r\n};\r\n\r\nexport const useArrayUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmptyArray: safeGet(utils, \"isEmptyArray\"),\r\n isNotEmptyArray: safeGet(utils, \"isNotEmptyArray\"),\r\n unique: safeGet(utils, \"unique\"),\r\n shuffle: safeGet(utils, \"shuffle\"),\r\n sortBy: safeGet(utils, \"sortBy\"),\r\n max: safeGet(utils, \"max\"),\r\n min: safeGet(utils, \"min\"),\r\n average: safeGet(utils, \"average\"),\r\n sum: safeGet(utils, \"sum\"),\r\n };\r\n};\r\n\r\nexport const useCommonUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n debounce: safeGet(utils, \"debounce\"),\r\n throttle: safeGet(utils, \"throttle\"),\r\n setLocalStorage: safeGet(utils, \"setLocalStorage\"),\r\n getLocalStorage: safeGet(utils, \"getLocalStorage\"),\r\n formatNumber: safeGet(utils, \"formatNumber\"),\r\n formatCurrency: safeGet(utils, \"formatCurrency\"),\r\n copyToClipboard: safeGet(utils, \"copyToClipboard\"),\r\n isMobile: safeGet(utils, \"isMobile\"),\r\n isDesktop: safeGet(utils, \"isDesktop\"),\r\n };\r\n};\r\n\r\nexport const useApiUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n callService: safeGet(utils, \"callService\"),\r\n apiGet: safeGet(utils, \"apiGet\"),\r\n apiPost: safeGet(utils, \"apiPost\"),\r\n apiPut: safeGet(utils, \"apiPut\"),\r\n apiDelete: safeGet(utils, \"apiDelete\"),\r\n apiPatch: safeGet(utils, \"apiPatch\"),\r\n };\r\n};\r\n"],"names":["usePopupContext","usePopup","popups","activePopupId","setActivePopup","closePopup","openPopup","usePopupStore","showPopup","useCallback","popupCode","popParams","config","error","CommonCodeContext","createContext","CommonCodeProvider","children","codeData","isLoading","lastUpdated","getCodeList","getCodeListByOption","getCodeName","getCodeColor","getCodeByOption","getAvailableGroupCodes","getGridLookup","fetchCommonCodes","useCodeStore","contextValue","useCommonCode","context","useContext","useCodeList","useCodeName","useCodeColor","useCodeListByOption","useGridLookup","utils","dateUtils","stringUtils","arrayUtils.isEmptyArray","arrayUtils.isNotEmptyArray","arrayUtils.unique","arrayUtils.shuffle","arrayUtils.sortBy","arrayUtils.max","arrayUtils.min","arrayUtils.average","arrayUtils.sum","arrayUtils.randomFromArray","arrayUtils.flattenArray","objectUtils","commonUtils.debounce","commonUtils.throttle","commonUtils.setLocalStorage","commonUtils.getLocalStorage","commonUtils.formatNumber","commonUtils.formatCurrency","commonUtils.copyToClipboard","commonUtils.isMobile","commonUtils.isDesktop","apiUtils.callService","apiUtils.apiGet","apiUtils.apiPost","apiUtils.apiPut","apiUtils.apiDelete","apiUtils.apiPatch","UtilsContext","UtilsProvider","jsx","useUtils","safeGet","obj","key","fallback","useDateUtils","useStringUtils","useArrayUtils","useCommonUtils","useApiUtils"],"mappings":";;;;;;AAOO,MAAMA,KAAkB,MAItB,IAMIC,KAAW,MAAM;AAC5B,QAAM,EAAE,QAAAC,GAAQ,eAAAC,GAAe,gBAAAC,GAAgB,YAAAC,GAAY,WAAAC,EAAA,IACzDC,EAAA,GAGIC,IAAYC;AAAA,IAChB,OAAOC,GAAmBC,GAAiBC,MAAyB;AAClE,UAAI;AACF,cAAMN,EAAUI,GAAWC,GAAWC,CAAM;AAAA,MAC9C,SAASC,GAAO;AACd,sBAAQ,MAAM,aAAaA,CAAK,GAC1BA;AAAA,MACR;AAAA,IACF;AAAA,IACA,CAACP,CAAS;AAAA,EAAA;AAGZ,SAAO;AAAA,IACL,QAAAJ;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAG;AAAA,IACA,SAASN,EAAO,SAAS;AAAA,EAAA;AAE7B,GCtCMY,IAAoBC;AAAA,EACxB;AACF,GAOaC,KAAwD,CAAC;AAAA,EACpE,UAAAC;AACF,MAAM;AACJ,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAN;AAAA,IACA,aAAAO;AAAA,IACA,aAAAC;AAAA,IACA,qBAA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Ac;AAAA,IAC3C,gBAAgBkC,EAAQlC,GAAO,gBAAgB;AAAA,IAC/C,iBAAiBkC,EAAQlC,GAAO,iBAAiB;AAAA,IACjD,UAAUkC,EAAQlC,GAAO,UAAU;AAAA,IACnC,WAAWkC,EAAQlC,GAAO,WAAW;AAAA,EAAA;AAEzC,GAEa0C,KAAc,MAAM;AAC/B,QAAM1C,IAAQiC,EAAA;AACd,SAAO;AAAA,IACL,aAAaC,EAAQlC,GAAO,aAAa;AAAA,IACzC,QAAQkC,EAAQlC,GAAO,QAAQ;AAAA,IAC/B,SAASkC,EAAQlC,GAAO,SAAS;AAAA,IACjC,QAAQkC,EAAQlC,GAAO,QAAQ;AAAA,IAC/B,WAAWkC,EAAQlC,GAAO,WAAW;AAAA,IACrC,UAAUkC,EAAQlC,GAAO,UAAU;AAAA,EAAA;AAEvC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const u=require("react"),b=require("./popupStore-BGubYHZh.cjs"),y=require("./jsx-runtime-CeSfJrVB.cjs"),L=require("./codeStore-BG8S_mdS.cjs"),o=require("./commonUtils-L9Jgc5y-.cjs"),i=require("./serviceConfig-Cc8jfw_Y.cjs"),x=()=>!1,E=()=>{const{popups:e,activePopupId:r,setActivePopup:s,closePopup:m,openPopup:c}=b.usePopupStore(),l=u.useCallback(async(d,g,C)=>{try{await c(d,g,C)}catch(p){throw console.error("팝업 열기 실패:",p),p}},[c]);return{popups:e,activePopupId:r,setActivePopup:s,closePopup:m,showPopup:l,isPopup:e.length>0}},D=u.createContext(void 0),S=({children:e})=>{const{codeData:r,isLoading:s,error:m,lastUpdated:c,getCodeList:l,getCodeListByOption:d,getCodeName:g,getCodeColor:C,getCodeByOption:p,getAvailableGroupCodes:U,getGridLookup:f,fetchCommonCodes:P}=L.useCodeStore(),v={codeData:r,isLoading:s,error:m,lastUpdated:c,getCodeList:l,getCodeListByOption:d,getCodeName:g,getCodeColor:C,getCodeByOption:p,getAvailableGroupCodes:U,getGridLookup:f,refreshCodes:P};return y.jsxRuntimeExports.jsx(D.Provider,{value:v,children:e})},a=()=>{const e=u.useContext(D);if(e===void 0)throw new Error("useCommonCode must be used within a CommonCodeProvider");return e},A=()=>{const{getCodeList:e,isLoading:r,error:s}=a();return{getCodeList:e,isLoading:r,error:s}},I=()=>{const{getCodeName:e,isLoading:r,error:s}=a();return{getCodeName:e,isLoading:r,error:s}},N=()=>{const{getCodeColor:e,isLoading:r,error:s}=a();return{getCodeColor:e,isLoading:r,error:s}},T=()=>{const{getCodeListByOption:e,isLoading:r,error:s}=a();return{getCodeListByOption:e,isLoading:r,error:s}},G=()=>{const{getGridLookup:e,isLoading:r,error:s}=a();return{getGridLookup:e,isLoading:r,error:s}},k={...o.dateUtils,...i.stringUtils,isEmptyArray:o.isEmptyArray,isNotEmptyArray:o.isNotEmptyArray,unique:o.unique,shuffle:o.shuffle,sortBy:o.sortBy,max:o.max,min:o.min,average:o.average,sum:o.sum,randomFromArray:o.randomFromArray,flattenArray:o.flattenArray,...o.objectUtils,debounce:o.debounce,throttle:o.throttle,setLocalStorage:o.setLocalStorage,getLocalStorage:o.getLocalStorage,formatNumber:o.formatNumber,formatCurrency:o.formatCurrency,copyToClipboard:o.copyToClipboard,isMobile:o.isMobile,isDesktop:o.isDesktop,callService:i.callService,apiGet:i.apiGet,apiPost:i.apiPost,apiPut:i.apiPut,apiDelete:i.apiDelete,apiPatch:i.apiPatch},h=u.createContext(void 0),q=({children:e})=>y.jsxRuntimeExports.jsx(h.Provider,{value:{utils:k},children:e}),n=()=>{const e=u.useContext(h);if(e===void 0)throw new Error("useUtils must be used within a UtilsProvider");return e.utils},t=(e,r,s)=>e&&typeof e[r]=="function"?e[r]:s||(()=>{}),w=()=>{const e=n();return{formatDate:t(e,"formatDate"),formatDateKorean:t(e,"formatDateKorean"),getCurrentDate:t(e,"getCurrentDate"),getCurrentDateString:t(e,"getCurrentDateString"),getRelativeTime:t(e,"getRelativeTime"),isToday:t(e,"isToday"),isThisWeek:t(e,"isThisWeek"),isThisMonth:t(e,"isThisMonth"),getDateDiff:t(e,"getDateDiff"),calculateAge:t(e,"calculateAge")}},B=()=>{const e=n();return{isEmpty:t(e,"isEmpty"),isNotEmpty:t(e,"isNotEmpty"),truncate:t(e,"truncate"),capitalize:t(e,"capitalize"),formatPhoneNumber:t(e,"formatPhoneNumber"),isValidEmail:t(e,"isValidEmail"),removeHtmlTags:t(e,"removeHtmlTags"),generateUID:t(e,"generateUID"),generateShortUID:t(e,"generateShortUID"),generateLongUID:t(e,"generateLongUID"),generateNumericUID:t(e,"generateNumericUID"),generateAlphanumericUID:t(e,"generateAlphanumericUID"),generateGUID:t(e,"generateGUID"),generateGUIDWithoutHyphens:t(e,"generateGUIDWithoutHyphens"),generateTimestampUID:t(e,"generateTimestampUID"),generateCustomUID:t(e,"generateCustomUID"),encryptSha256:t(e,"encryptSha256"),bxmEncrypt:t(e,"bxmEncrypt"),bxmDecrypt:t(e,"bxmDecrypt"),simpleEncrypt:t(e,"simpleEncrypt"),simpleDecrypt:t(e,"simpleDecrypt"),md5Hash:t(e,"md5Hash"),sha256Hash:t(e,"sha256Hash"),base64Encode:t(e,"base64Encode"),base64Decode:t(e,"base64Decode")}},H=()=>{const e=n();return{isEmptyArray:t(e,"isEmptyArray"),isNotEmptyArray:t(e,"isNotEmptyArray"),unique:t(e,"unique"),shuffle:t(e,"shuffle"),sortBy:t(e,"sortBy"),max:t(e,"max"),min:t(e,"min"),average:t(e,"average"),sum:t(e,"sum")}},M=()=>{const e=n();return{debounce:t(e,"debounce"),throttle:t(e,"throttle"),setLocalStorage:t(e,"setLocalStorage"),getLocalStorage:t(e,"getLocalStorage"),formatNumber:t(e,"formatNumber"),formatCurrency:t(e,"formatCurrency"),copyToClipboard:t(e,"copyToClipboard"),isMobile:t(e,"isMobile"),isDesktop:t(e,"isDesktop")}},R=()=>{const e=n();return{callService:t(e,"callService"),apiGet:t(e,"apiGet"),apiPost:t(e,"apiPost"),apiPut:t(e,"apiPut"),apiDelete:t(e,"apiDelete"),apiPatch:t(e,"apiPatch")}};exports.CommonCodeProvider=S;exports.UtilsProvider=q;exports.useApiUtils=R;exports.useArrayUtils=H;exports.useCodeColor=N;exports.useCodeList=A;exports.useCodeListByOption=T;exports.useCodeName=I;exports.useCommonCode=a;exports.useCommonUtils=M;exports.useDateUtils=w;exports.useGridLookup=G;exports.usePopup=E;exports.usePopupContext=x;exports.useStringUtils=B;exports.useUtils=n;
2
- //# sourceMappingURL=UtilsContext-5l7yFRQI.cjs.map
1
+ "use strict";const u=require("react"),b=require("./popupStore-BGubYHZh.cjs"),y=require("./jsx-runtime-CeSfJrVB.cjs"),L=require("./codeStore-BG8S_mdS.cjs"),o=require("./commonUtils-DaFg0y7C.cjs"),i=require("./serviceConfig-Cc8jfw_Y.cjs"),x=()=>!1,E=()=>{const{popups:e,activePopupId:r,setActivePopup:s,closePopup:m,openPopup:c}=b.usePopupStore(),l=u.useCallback(async(d,g,C)=>{try{await c(d,g,C)}catch(p){throw console.error("팝업 열기 실패:",p),p}},[c]);return{popups:e,activePopupId:r,setActivePopup:s,closePopup:m,showPopup:l,isPopup:e.length>0}},D=u.createContext(void 0),S=({children:e})=>{const{codeData:r,isLoading:s,error:m,lastUpdated:c,getCodeList:l,getCodeListByOption:d,getCodeName:g,getCodeColor:C,getCodeByOption:p,getAvailableGroupCodes:U,getGridLookup:f,fetchCommonCodes:P}=L.useCodeStore(),v={codeData:r,isLoading:s,error:m,lastUpdated:c,getCodeList:l,getCodeListByOption:d,getCodeName:g,getCodeColor:C,getCodeByOption:p,getAvailableGroupCodes:U,getGridLookup:f,refreshCodes:P};return y.jsxRuntimeExports.jsx(D.Provider,{value:v,children:e})},a=()=>{const e=u.useContext(D);if(e===void 0)throw new Error("useCommonCode must be used within a CommonCodeProvider");return e},A=()=>{const{getCodeList:e,isLoading:r,error:s}=a();return{getCodeList:e,isLoading:r,error:s}},I=()=>{const{getCodeName:e,isLoading:r,error:s}=a();return{getCodeName:e,isLoading:r,error:s}},N=()=>{const{getCodeColor:e,isLoading:r,error:s}=a();return{getCodeColor:e,isLoading:r,error:s}},T=()=>{const{getCodeListByOption:e,isLoading:r,error:s}=a();return{getCodeListByOption:e,isLoading:r,error:s}},G=()=>{const{getGridLookup:e,isLoading:r,error:s}=a();return{getGridLookup:e,isLoading:r,error:s}},k={...o.dateUtils,...i.stringUtils,isEmptyArray:o.isEmptyArray,isNotEmptyArray:o.isNotEmptyArray,unique:o.unique,shuffle:o.shuffle,sortBy:o.sortBy,max:o.max,min:o.min,average:o.average,sum:o.sum,randomFromArray:o.randomFromArray,flattenArray:o.flattenArray,...o.objectUtils,debounce:o.debounce,throttle:o.throttle,setLocalStorage:o.setLocalStorage,getLocalStorage:o.getLocalStorage,formatNumber:o.formatNumber,formatCurrency:o.formatCurrency,copyToClipboard:o.copyToClipboard,isMobile:o.isMobile,isDesktop:o.isDesktop,callService:i.callService,apiGet:i.apiGet,apiPost:i.apiPost,apiPut:i.apiPut,apiDelete:i.apiDelete,apiPatch:i.apiPatch},h=u.createContext(void 0),q=({children:e})=>y.jsxRuntimeExports.jsx(h.Provider,{value:{utils:k},children:e}),n=()=>{const e=u.useContext(h);if(e===void 0)throw new Error("useUtils must be used within a UtilsProvider");return e.utils},t=(e,r,s)=>e&&typeof e[r]=="function"?e[r]:s||(()=>{}),w=()=>{const e=n();return{formatDate:t(e,"formatDate"),formatDateKorean:t(e,"formatDateKorean"),getCurrentDate:t(e,"getCurrentDate"),getCurrentDateString:t(e,"getCurrentDateString"),getRelativeTime:t(e,"getRelativeTime"),isToday:t(e,"isToday"),isThisWeek:t(e,"isThisWeek"),isThisMonth:t(e,"isThisMonth"),getDateDiff:t(e,"getDateDiff"),calculateAge:t(e,"calculateAge")}},B=()=>{const e=n();return{isEmpty:t(e,"isEmpty"),isNotEmpty:t(e,"isNotEmpty"),truncate:t(e,"truncate"),capitalize:t(e,"capitalize"),formatPhoneNumber:t(e,"formatPhoneNumber"),isValidEmail:t(e,"isValidEmail"),removeHtmlTags:t(e,"removeHtmlTags"),generateUID:t(e,"generateUID"),generateShortUID:t(e,"generateShortUID"),generateLongUID:t(e,"generateLongUID"),generateNumericUID:t(e,"generateNumericUID"),generateAlphanumericUID:t(e,"generateAlphanumericUID"),generateGUID:t(e,"generateGUID"),generateGUIDWithoutHyphens:t(e,"generateGUIDWithoutHyphens"),generateTimestampUID:t(e,"generateTimestampUID"),generateCustomUID:t(e,"generateCustomUID"),encryptSha256:t(e,"encryptSha256"),bxmEncrypt:t(e,"bxmEncrypt"),bxmDecrypt:t(e,"bxmDecrypt"),simpleEncrypt:t(e,"simpleEncrypt"),simpleDecrypt:t(e,"simpleDecrypt"),md5Hash:t(e,"md5Hash"),sha256Hash:t(e,"sha256Hash"),base64Encode:t(e,"base64Encode"),base64Decode:t(e,"base64Decode")}},H=()=>{const e=n();return{isEmptyArray:t(e,"isEmptyArray"),isNotEmptyArray:t(e,"isNotEmptyArray"),unique:t(e,"unique"),shuffle:t(e,"shuffle"),sortBy:t(e,"sortBy"),max:t(e,"max"),min:t(e,"min"),average:t(e,"average"),sum:t(e,"sum")}},M=()=>{const e=n();return{debounce:t(e,"debounce"),throttle:t(e,"throttle"),setLocalStorage:t(e,"setLocalStorage"),getLocalStorage:t(e,"getLocalStorage"),formatNumber:t(e,"formatNumber"),formatCurrency:t(e,"formatCurrency"),copyToClipboard:t(e,"copyToClipboard"),isMobile:t(e,"isMobile"),isDesktop:t(e,"isDesktop")}},R=()=>{const e=n();return{callService:t(e,"callService"),apiGet:t(e,"apiGet"),apiPost:t(e,"apiPost"),apiPut:t(e,"apiPut"),apiDelete:t(e,"apiDelete"),apiPatch:t(e,"apiPatch")}};exports.CommonCodeProvider=S;exports.UtilsProvider=q;exports.useApiUtils=R;exports.useArrayUtils=H;exports.useCodeColor=N;exports.useCodeList=A;exports.useCodeListByOption=T;exports.useCodeName=I;exports.useCommonCode=a;exports.useCommonUtils=M;exports.useDateUtils=w;exports.useGridLookup=G;exports.usePopup=E;exports.usePopupContext=x;exports.useStringUtils=B;exports.useUtils=n;
2
+ //# sourceMappingURL=UtilsContext-DczQBfFi.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"UtilsContext-5l7yFRQI.cjs","sources":["../../src/provider/hooks/usePopup.ts","../../src/provider/contexts/CommonCodeContext.tsx","../../src/provider/contexts/UtilsContext.tsx"],"sourcesContent":["import { useCallback } from 'react';\r\nimport { usePopupStore, type PopupConfig } from '../../stores/popupStore';\r\n\r\n/**\r\n * 팝업 컨텍스트를 감지하는 훅\r\n * 팝업 내부에서 사용하면 true, 일반 페이지에서는 false 반환\r\n */\r\nexport const usePopupContext = (): boolean => {\r\n // 팝업 내부에서만 true를 반환하도록 수정\r\n // 현재는 팝업이 열려있으면 모든 컴포넌트가 팝업으로 인식되는 문제가 있음\r\n // 임시로 false 반환 (수동으로 isPopup prop 사용 권장)\r\n return false;\r\n};\r\n\r\n/**\r\n * 팝업 데이터와 이벤트를 관리하는 훅\r\n */\r\nexport const usePopup = () => {\r\n const { popups, activePopupId, setActivePopup, closePopup, openPopup } =\r\n usePopupStore();\r\n\r\n // 팝업 열기 함수\r\n const showPopup = useCallback(\r\n async (popupCode: string, popParams?: any, config?: PopupConfig) => {\r\n try {\r\n await openPopup(popupCode, popParams, config);\r\n } catch (error) {\r\n console.error('팝업 열기 실패:', error);\r\n throw error;\r\n }\r\n },\r\n [openPopup]\r\n );\r\n\r\n return {\r\n popups,\r\n activePopupId,\r\n setActivePopup,\r\n closePopup,\r\n showPopup,\r\n isPopup: popups.length > 0,\r\n };\r\n};\r\n","import { useCodeStore, type CommonCodeContextType } from '../../stores/codeStore';\r\nimport { createContext, useContext, ReactNode } from 'react';\r\n\r\n// 공통코드 컨텍스트 생성\r\nconst CommonCodeContext = createContext<CommonCodeContextType | undefined>(\r\n undefined\r\n);\r\n\r\n// 공통코드 컨텍스트 프로바이더 컴포넌트\r\ninterface CommonCodeProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const CommonCodeProvider: React.FC<CommonCodeProviderProps> = ({\r\n children,\r\n}) => {\r\n const {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n fetchCommonCodes,\r\n } = useCodeStore();\r\n\r\n const contextValue: CommonCodeContextType = {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n refreshCodes: fetchCommonCodes,\r\n };\r\n\r\n return (\r\n <CommonCodeContext.Provider value={contextValue}>\r\n {children}\r\n </CommonCodeContext.Provider>\r\n );\r\n};\r\n\r\n// 공통코드 컨텍스트 사용 훅\r\nexport const useCommonCode = (): CommonCodeContextType => {\r\n const context = useContext(CommonCodeContext);\r\n if (context === undefined) {\r\n throw new Error('useCommonCode must be used within a CommonCodeProvider');\r\n }\r\n return context;\r\n};\r\n\r\n// 편의 훅들 (Fast Refresh 호환성을 위해 매개변수 없는 함수로 변경)\r\nexport const useCodeList = () => {\r\n const { getCodeList, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeList,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeName = () => {\r\n const { getCodeName, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeName,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeColor = () => {\r\n const { getCodeColor, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeColor,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeListByOption = () => {\r\n const { getCodeListByOption, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeListByOption,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useGridLookup = () => {\r\n const { getGridLookup, isLoading, error } = useCommonCode();\r\n return {\r\n getGridLookup,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n","import React, { createContext, useContext } from \"react\";\r\nimport type { ReactNode } from \"react\";\r\nimport * as dateUtils from \"../../utils/dateUtils\";\r\nimport * as stringUtils from \"../../utils/stringUtils\";\r\nimport * as arrayUtils from \"../../utils/arrayUtils\";\r\nimport * as objectUtils from \"../../utils/objectUtils\";\r\nimport * as commonUtils from \"../../utils/commonUtils\";\r\nimport * as apiUtils from \"../../utils/apiUtils\";\r\n\r\n// 모든 유틸리티 함수들을 하나의 객체로 결합 (충돌하는 함수명은 별칭 사용)\r\nconst utils = {\r\n // 날짜 유틸리티\r\n ...dateUtils,\r\n // 문자열 유틸리티\r\n ...stringUtils,\r\n // 배열 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n isEmptyArray: arrayUtils.isEmptyArray,\r\n isNotEmptyArray: arrayUtils.isNotEmptyArray,\r\n unique: arrayUtils.unique,\r\n shuffle: arrayUtils.shuffle,\r\n sortBy: arrayUtils.sortBy,\r\n max: arrayUtils.max,\r\n min: arrayUtils.min,\r\n average: arrayUtils.average,\r\n sum: arrayUtils.sum,\r\n randomFromArray: arrayUtils.randomFromArray,\r\n flattenArray: arrayUtils.flattenArray,\r\n // 객체 유틸리티\r\n ...objectUtils,\r\n // 일반 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n debounce: commonUtils.debounce,\r\n throttle: commonUtils.throttle,\r\n setLocalStorage: commonUtils.setLocalStorage,\r\n getLocalStorage: commonUtils.getLocalStorage,\r\n formatNumber: commonUtils.formatNumber,\r\n formatCurrency: commonUtils.formatCurrency,\r\n copyToClipboard: commonUtils.copyToClipboard,\r\n isMobile: commonUtils.isMobile,\r\n isDesktop: commonUtils.isDesktop,\r\n // API 유틸리티\r\n callService: apiUtils.callService,\r\n apiGet: apiUtils.apiGet,\r\n apiPost: apiUtils.apiPost,\r\n apiPut: apiUtils.apiPut,\r\n apiDelete: apiUtils.apiDelete,\r\n apiPatch: apiUtils.apiPatch,\r\n};\r\n\r\n// Context 타입 정의\r\ninterface UtilsContextType {\r\n utils: typeof utils;\r\n}\r\n\r\n// Context 생성\r\nconst UtilsContext = createContext<UtilsContextType | undefined>(undefined);\r\n\r\n// Provider 컴포넌트\r\ninterface UtilsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const UtilsProvider: React.FC<UtilsProviderProps> = ({ children }) => {\r\n return (\r\n <UtilsContext.Provider value={{ utils }}>{children}</UtilsContext.Provider>\r\n );\r\n};\r\n\r\n// Hook for using utils\r\nexport const useUtils = () => {\r\n const context = useContext(UtilsContext);\r\n if (context === undefined) {\r\n throw new Error(\"useUtils must be used within a UtilsProvider\");\r\n }\r\n return context.utils;\r\n};\r\n\r\n// 안전한 함수 가져오기 헬퍼\r\nconst safeGet = (obj: any, key: string, fallback?: any) => {\r\n return obj && typeof obj[key] === \"function\"\r\n ? obj[key]\r\n : fallback || (() => {});\r\n};\r\n\r\n// 개별 유틸리티 훅들 (선택사항)\r\nexport const useDateUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n formatDate: safeGet(utils, \"formatDate\"),\r\n formatDateKorean: safeGet(utils, \"formatDateKorean\"),\r\n getCurrentDate: safeGet(utils, \"getCurrentDate\"),\r\n getCurrentDateString: safeGet(utils, \"getCurrentDateString\"),\r\n getRelativeTime: safeGet(utils, \"getRelativeTime\"),\r\n isToday: safeGet(utils, \"isToday\"),\r\n isThisWeek: safeGet(utils, \"isThisWeek\"),\r\n isThisMonth: safeGet(utils, \"isThisMonth\"),\r\n getDateDiff: safeGet(utils, \"getDateDiff\"),\r\n calculateAge: safeGet(utils, \"calculateAge\"),\r\n };\r\n};\r\n\r\nexport const useStringUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmpty: safeGet(utils, \"isEmpty\"),\r\n isNotEmpty: safeGet(utils, \"isNotEmpty\"),\r\n truncate: safeGet(utils, \"truncate\"),\r\n capitalize: safeGet(utils, \"capitalize\"),\r\n formatPhoneNumber: safeGet(utils, \"formatPhoneNumber\"),\r\n isValidEmail: safeGet(utils, \"isValidEmail\"),\r\n removeHtmlTags: safeGet(utils, \"removeHtmlTags\"),\r\n // UID 생성 함수들\r\n generateUID: safeGet(utils, \"generateUID\"),\r\n generateShortUID: safeGet(utils, \"generateShortUID\"),\r\n generateLongUID: safeGet(utils, \"generateLongUID\"),\r\n generateNumericUID: safeGet(utils, \"generateNumericUID\"),\r\n generateAlphanumericUID: safeGet(utils, \"generateAlphanumericUID\"),\r\n generateGUID: safeGet(utils, \"generateGUID\"),\r\n generateGUIDWithoutHyphens: safeGet(utils, \"generateGUIDWithoutHyphens\"),\r\n generateTimestampUID: safeGet(utils, \"generateTimestampUID\"),\r\n generateCustomUID: safeGet(utils, \"generateCustomUID\"),\r\n // 암호화 관련 함수들\r\n encryptSha256: safeGet(utils, \"encryptSha256\"),\r\n bxmEncrypt: safeGet(utils, \"bxmEncrypt\"),\r\n bxmDecrypt: safeGet(utils, \"bxmDecrypt\"),\r\n simpleEncrypt: safeGet(utils, \"simpleEncrypt\"),\r\n simpleDecrypt: safeGet(utils, \"simpleDecrypt\"),\r\n md5Hash: safeGet(utils, \"md5Hash\"),\r\n sha256Hash: safeGet(utils, \"sha256Hash\"),\r\n base64Encode: safeGet(utils, \"base64Encode\"),\r\n base64Decode: safeGet(utils, \"base64Decode\"),\r\n };\r\n};\r\n\r\nexport const useArrayUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmptyArray: safeGet(utils, \"isEmptyArray\"),\r\n isNotEmptyArray: safeGet(utils, \"isNotEmptyArray\"),\r\n unique: safeGet(utils, \"unique\"),\r\n shuffle: safeGet(utils, \"shuffle\"),\r\n sortBy: safeGet(utils, \"sortBy\"),\r\n max: safeGet(utils, \"max\"),\r\n min: safeGet(utils, \"min\"),\r\n average: safeGet(utils, \"average\"),\r\n sum: safeGet(utils, \"sum\"),\r\n };\r\n};\r\n\r\nexport const useCommonUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n debounce: safeGet(utils, \"debounce\"),\r\n throttle: safeGet(utils, \"throttle\"),\r\n setLocalStorage: safeGet(utils, \"setLocalStorage\"),\r\n getLocalStorage: safeGet(utils, \"getLocalStorage\"),\r\n formatNumber: safeGet(utils, \"formatNumber\"),\r\n formatCurrency: safeGet(utils, \"formatCurrency\"),\r\n copyToClipboard: safeGet(utils, \"copyToClipboard\"),\r\n isMobile: safeGet(utils, \"isMobile\"),\r\n isDesktop: safeGet(utils, \"isDesktop\"),\r\n };\r\n};\r\n\r\nexport const useApiUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n callService: safeGet(utils, \"callService\"),\r\n apiGet: safeGet(utils, \"apiGet\"),\r\n apiPost: safeGet(utils, \"apiPost\"),\r\n apiPut: safeGet(utils, \"apiPut\"),\r\n apiDelete: safeGet(utils, \"apiDelete\"),\r\n apiPatch: safeGet(utils, \"apiPatch\"),\r\n };\r\n};\r\n"],"names":["usePopupContext","usePopup","popups","activePopupId","setActivePopup","closePopup","openPopup","usePopupStore","showPopup","useCallback","popupCode","popParams","config","error","CommonCodeContext","createContext","CommonCodeProvider","children","codeData","isLoading","lastUpdated","getCodeList","getCodeListByOption","getCodeName","getCodeColor","getCodeByOption","getAvailableGroupCodes","getGridLookup","fetchCommonCodes","useCodeStore","contextValue","useCommonCode","context","useContext","useCodeList","useCodeName","useCodeColor","useCodeListByOption","useGridLookup","utils","dateUtils","stringUtils","arrayUtils.isEmptyArray","arrayUtils.isNotEmptyArray","arrayUtils.unique","arrayUtils.shuffle","arrayUtils.sortBy","arrayUtils.max","arrayUtils.min","arrayUtils.average","arrayUtils.sum","arrayUtils.randomFromArray","arrayUtils.flattenArray","objectUtils","commonUtils.debounce","commonUtils.throttle","commonUtils.setLocalStorage","commonUtils.getLocalStorage","commonUtils.formatNumber","commonUtils.formatCurrency","commonUtils.copyToClipboard","commonUtils.isMobile","commonUtils.isDesktop","apiUtils.callService","apiUtils.apiGet","apiUtils.apiPost","apiUtils.apiPut","apiUtils.apiDelete","apiUtils.apiPatch","UtilsContext","UtilsProvider","jsx","useUtils","safeGet","obj","key","fallback","useDateUtils","useStringUtils","useArrayUtils","useCommonUtils","useApiUtils"],"mappings":"6OAOaA,EAAkB,IAItB,GAMIC,EAAW,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAQ,cAAAC,EAAe,eAAAC,EAAgB,WAAAC,EAAY,UAAAC,CAAA,EACzDC,gBAAA,EAGIC,EAAYC,EAAAA,YAChB,MAAOC,EAAmBC,EAAiBC,IAAyB,CAClE,GAAI,CACF,MAAMN,EAAUI,EAAWC,EAAWC,CAAM,CAC9C,OAASC,EAAO,CACd,cAAQ,MAAM,YAAaA,CAAK,EAC1BA,CACR,CACF,EACA,CAACP,CAAS,CAAA,EAGZ,MAAO,CACL,OAAAJ,EACA,cAAAC,EACA,eAAAC,EACA,WAAAC,EACA,UAAAG,EACA,QAASN,EAAO,OAAS,CAAA,CAE7B,ECtCMY,EAAoBC,EAAAA,cACxB,MACF,EAOaC,EAAwD,CAAC,CACpE,SAAAC,CACF,IAAM,CACJ,KAAM,CACJ,SAAAC,EACA,UAAAC,EACA,MAAAN,EACA,YAAAO,EACA,YAAAC,EACA,oBAAAC,EACA,YAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,uBAAAC,EACA,cAAAC,EACA,iBAAAC,CAAA,EACEC,eAAA,EAEEC,EAAsC,CAC1C,SAAAZ,EACA,UAAAC,EACA,MAAAN,EACA,YAAAO,EACA,YAAAC,EACA,oBAAAC,EACA,YAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,uBAAAC,EACA,cAAAC,EACA,aAAcC,CAAA,EAGhB,+BACGd,EAAkB,SAAlB,CAA2B,MAAOgB,EAChC,SAAAb,EACH,CAEJ,EAGac,EAAgB,IAA6B,CACxD,MAAMC,EAAUC,EAAAA,WAAWnB,CAAiB,EAC5C,GAAIkB,IAAY,OACd,MAAM,IAAI,MAAM,wDAAwD,EAE1E,OAAOA,CACT,EAGaE,EAAc,IAAM,CAC/B,KAAM,CAAE,YAAAb,EAAa,UAAAF,EAAW,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,UAAU,EACnC,gBAAiBkC,EAAQlC,EAAO,iBAAiB,EACjD,gBAAiBkC,EAAQlC,EAAO,iBAAiB,EACjD,aAAckC,EAAQlC,EAAO,cAAc,EAC3C,eAAgBkC,EAAQlC,EAAO,gBAAgB,EAC/C,gBAAiBkC,EAAQlC,EAAO,iBAAiB,EACjD,SAAUkC,EAAQlC,EAAO,UAAU,EACnC,UAAWkC,EAAQlC,EAAO,WAAW,CAAA,CAEzC,EAEa0C,EAAc,IAAM,CAC/B,MAAM1C,EAAQiC,EAAA,EACd,MAAO,CACL,YAAaC,EAAQlC,EAAO,aAAa,EACzC,OAAQkC,EAAQlC,EAAO,QAAQ,EAC/B,QAASkC,EAAQlC,EAAO,SAAS,EACjC,OAAQkC,EAAQlC,EAAO,QAAQ,EAC/B,UAAWkC,EAAQlC,EAAO,WAAW,EACrC,SAAUkC,EAAQlC,EAAO,UAAU,CAAA,CAEvC"}
1
+ {"version":3,"file":"UtilsContext-DczQBfFi.cjs","sources":["../../src/provider/hooks/usePopup.ts","../../src/provider/contexts/CommonCodeContext.tsx","../../src/provider/contexts/UtilsContext.tsx"],"sourcesContent":["import { useCallback } from 'react';\r\nimport { usePopupStore, type PopupConfig } from '../../stores/popupStore';\r\n\r\n/**\r\n * 팝업 컨텍스트를 감지하는 훅\r\n * 팝업 내부에서 사용하면 true, 일반 페이지에서는 false 반환\r\n */\r\nexport const usePopupContext = (): boolean => {\r\n // 팝업 내부에서만 true를 반환하도록 수정\r\n // 현재는 팝업이 열려있으면 모든 컴포넌트가 팝업으로 인식되는 문제가 있음\r\n // 임시로 false 반환 (수동으로 isPopup prop 사용 권장)\r\n return false;\r\n};\r\n\r\n/**\r\n * 팝업 데이터와 이벤트를 관리하는 훅\r\n */\r\nexport const usePopup = () => {\r\n const { popups, activePopupId, setActivePopup, closePopup, openPopup } =\r\n usePopupStore();\r\n\r\n // 팝업 열기 함수\r\n const showPopup = useCallback(\r\n async (popupCode: string, popParams?: any, config?: PopupConfig) => {\r\n try {\r\n await openPopup(popupCode, popParams, config);\r\n } catch (error) {\r\n console.error('팝업 열기 실패:', error);\r\n throw error;\r\n }\r\n },\r\n [openPopup]\r\n );\r\n\r\n return {\r\n popups,\r\n activePopupId,\r\n setActivePopup,\r\n closePopup,\r\n showPopup,\r\n isPopup: popups.length > 0,\r\n };\r\n};\r\n","import { useCodeStore, type CommonCodeContextType } from '../../stores/codeStore';\r\nimport { createContext, useContext, ReactNode } from 'react';\r\n\r\n// 공통코드 컨텍스트 생성\r\nconst CommonCodeContext = createContext<CommonCodeContextType | undefined>(\r\n undefined\r\n);\r\n\r\n// 공통코드 컨텍스트 프로바이더 컴포넌트\r\ninterface CommonCodeProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const CommonCodeProvider: React.FC<CommonCodeProviderProps> = ({\r\n children,\r\n}) => {\r\n const {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n fetchCommonCodes,\r\n } = useCodeStore();\r\n\r\n const contextValue: CommonCodeContextType = {\r\n codeData,\r\n isLoading,\r\n error,\r\n lastUpdated,\r\n getCodeList,\r\n getCodeListByOption,\r\n getCodeName,\r\n getCodeColor,\r\n getCodeByOption,\r\n getAvailableGroupCodes,\r\n getGridLookup,\r\n refreshCodes: fetchCommonCodes,\r\n };\r\n\r\n return (\r\n <CommonCodeContext.Provider value={contextValue}>\r\n {children}\r\n </CommonCodeContext.Provider>\r\n );\r\n};\r\n\r\n// 공통코드 컨텍스트 사용 훅\r\nexport const useCommonCode = (): CommonCodeContextType => {\r\n const context = useContext(CommonCodeContext);\r\n if (context === undefined) {\r\n throw new Error('useCommonCode must be used within a CommonCodeProvider');\r\n }\r\n return context;\r\n};\r\n\r\n// 편의 훅들 (Fast Refresh 호환성을 위해 매개변수 없는 함수로 변경)\r\nexport const useCodeList = () => {\r\n const { getCodeList, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeList,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeName = () => {\r\n const { getCodeName, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeName,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeColor = () => {\r\n const { getCodeColor, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeColor,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useCodeListByOption = () => {\r\n const { getCodeListByOption, isLoading, error } = useCommonCode();\r\n return {\r\n getCodeListByOption,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n\r\nexport const useGridLookup = () => {\r\n const { getGridLookup, isLoading, error } = useCommonCode();\r\n return {\r\n getGridLookup,\r\n isLoading,\r\n error,\r\n };\r\n};\r\n","import React, { createContext, useContext } from \"react\";\r\nimport type { ReactNode } from \"react\";\r\nimport * as dateUtils from \"../../utils/dateUtils\";\r\nimport * as stringUtils from \"../../utils/stringUtils\";\r\nimport * as arrayUtils from \"../../utils/arrayUtils\";\r\nimport * as objectUtils from \"../../utils/objectUtils\";\r\nimport * as commonUtils from \"../../utils/commonUtils\";\r\nimport * as apiUtils from \"../../utils/apiUtils\";\r\n\r\n// 모든 유틸리티 함수들을 하나의 객체로 결합 (충돌하는 함수명은 별칭 사용)\r\nconst utils = {\r\n // 날짜 유틸리티\r\n ...dateUtils,\r\n // 문자열 유틸리티\r\n ...stringUtils,\r\n // 배열 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n isEmptyArray: arrayUtils.isEmptyArray,\r\n isNotEmptyArray: arrayUtils.isNotEmptyArray,\r\n unique: arrayUtils.unique,\r\n shuffle: arrayUtils.shuffle,\r\n sortBy: arrayUtils.sortBy,\r\n max: arrayUtils.max,\r\n min: arrayUtils.min,\r\n average: arrayUtils.average,\r\n sum: arrayUtils.sum,\r\n randomFromArray: arrayUtils.randomFromArray,\r\n flattenArray: arrayUtils.flattenArray,\r\n // 객체 유틸리티\r\n ...objectUtils,\r\n // 일반 유틸리티 (충돌하는 함수명은 별칭 사용)\r\n debounce: commonUtils.debounce,\r\n throttle: commonUtils.throttle,\r\n setLocalStorage: commonUtils.setLocalStorage,\r\n getLocalStorage: commonUtils.getLocalStorage,\r\n formatNumber: commonUtils.formatNumber,\r\n formatCurrency: commonUtils.formatCurrency,\r\n copyToClipboard: commonUtils.copyToClipboard,\r\n isMobile: commonUtils.isMobile,\r\n isDesktop: commonUtils.isDesktop,\r\n // API 유틸리티\r\n callService: apiUtils.callService,\r\n apiGet: apiUtils.apiGet,\r\n apiPost: apiUtils.apiPost,\r\n apiPut: apiUtils.apiPut,\r\n apiDelete: apiUtils.apiDelete,\r\n apiPatch: apiUtils.apiPatch,\r\n};\r\n\r\n// Context 타입 정의\r\ninterface UtilsContextType {\r\n utils: typeof utils;\r\n}\r\n\r\n// Context 생성\r\nconst UtilsContext = createContext<UtilsContextType | undefined>(undefined);\r\n\r\n// Provider 컴포넌트\r\ninterface UtilsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport const UtilsProvider: React.FC<UtilsProviderProps> = ({ children }) => {\r\n return (\r\n <UtilsContext.Provider value={{ utils }}>{children}</UtilsContext.Provider>\r\n );\r\n};\r\n\r\n// Hook for using utils\r\nexport const useUtils = () => {\r\n const context = useContext(UtilsContext);\r\n if (context === undefined) {\r\n throw new Error(\"useUtils must be used within a UtilsProvider\");\r\n }\r\n return context.utils;\r\n};\r\n\r\n// 안전한 함수 가져오기 헬퍼\r\nconst safeGet = (obj: any, key: string, fallback?: any) => {\r\n return obj && typeof obj[key] === \"function\"\r\n ? obj[key]\r\n : fallback || (() => {});\r\n};\r\n\r\n// 개별 유틸리티 훅들 (선택사항)\r\nexport const useDateUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n formatDate: safeGet(utils, \"formatDate\"),\r\n formatDateKorean: safeGet(utils, \"formatDateKorean\"),\r\n getCurrentDate: safeGet(utils, \"getCurrentDate\"),\r\n getCurrentDateString: safeGet(utils, \"getCurrentDateString\"),\r\n getRelativeTime: safeGet(utils, \"getRelativeTime\"),\r\n isToday: safeGet(utils, \"isToday\"),\r\n isThisWeek: safeGet(utils, \"isThisWeek\"),\r\n isThisMonth: safeGet(utils, \"isThisMonth\"),\r\n getDateDiff: safeGet(utils, \"getDateDiff\"),\r\n calculateAge: safeGet(utils, \"calculateAge\"),\r\n };\r\n};\r\n\r\nexport const useStringUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmpty: safeGet(utils, \"isEmpty\"),\r\n isNotEmpty: safeGet(utils, \"isNotEmpty\"),\r\n truncate: safeGet(utils, \"truncate\"),\r\n capitalize: safeGet(utils, \"capitalize\"),\r\n formatPhoneNumber: safeGet(utils, \"formatPhoneNumber\"),\r\n isValidEmail: safeGet(utils, \"isValidEmail\"),\r\n removeHtmlTags: safeGet(utils, \"removeHtmlTags\"),\r\n // UID 생성 함수들\r\n generateUID: safeGet(utils, \"generateUID\"),\r\n generateShortUID: safeGet(utils, \"generateShortUID\"),\r\n generateLongUID: safeGet(utils, \"generateLongUID\"),\r\n generateNumericUID: safeGet(utils, \"generateNumericUID\"),\r\n generateAlphanumericUID: safeGet(utils, \"generateAlphanumericUID\"),\r\n generateGUID: safeGet(utils, \"generateGUID\"),\r\n generateGUIDWithoutHyphens: safeGet(utils, \"generateGUIDWithoutHyphens\"),\r\n generateTimestampUID: safeGet(utils, \"generateTimestampUID\"),\r\n generateCustomUID: safeGet(utils, \"generateCustomUID\"),\r\n // 암호화 관련 함수들\r\n encryptSha256: safeGet(utils, \"encryptSha256\"),\r\n bxmEncrypt: safeGet(utils, \"bxmEncrypt\"),\r\n bxmDecrypt: safeGet(utils, \"bxmDecrypt\"),\r\n simpleEncrypt: safeGet(utils, \"simpleEncrypt\"),\r\n simpleDecrypt: safeGet(utils, \"simpleDecrypt\"),\r\n md5Hash: safeGet(utils, \"md5Hash\"),\r\n sha256Hash: safeGet(utils, \"sha256Hash\"),\r\n base64Encode: safeGet(utils, \"base64Encode\"),\r\n base64Decode: safeGet(utils, \"base64Decode\"),\r\n };\r\n};\r\n\r\nexport const useArrayUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n isEmptyArray: safeGet(utils, \"isEmptyArray\"),\r\n isNotEmptyArray: safeGet(utils, \"isNotEmptyArray\"),\r\n unique: safeGet(utils, \"unique\"),\r\n shuffle: safeGet(utils, \"shuffle\"),\r\n sortBy: safeGet(utils, \"sortBy\"),\r\n max: safeGet(utils, \"max\"),\r\n min: safeGet(utils, \"min\"),\r\n average: safeGet(utils, \"average\"),\r\n sum: safeGet(utils, \"sum\"),\r\n };\r\n};\r\n\r\nexport const useCommonUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n debounce: safeGet(utils, \"debounce\"),\r\n throttle: safeGet(utils, \"throttle\"),\r\n setLocalStorage: safeGet(utils, \"setLocalStorage\"),\r\n getLocalStorage: safeGet(utils, \"getLocalStorage\"),\r\n formatNumber: safeGet(utils, \"formatNumber\"),\r\n formatCurrency: safeGet(utils, \"formatCurrency\"),\r\n copyToClipboard: safeGet(utils, \"copyToClipboard\"),\r\n isMobile: safeGet(utils, \"isMobile\"),\r\n isDesktop: safeGet(utils, \"isDesktop\"),\r\n };\r\n};\r\n\r\nexport const useApiUtils = () => {\r\n const utils = useUtils();\r\n return {\r\n callService: safeGet(utils, \"callService\"),\r\n apiGet: safeGet(utils, \"apiGet\"),\r\n apiPost: safeGet(utils, \"apiPost\"),\r\n apiPut: safeGet(utils, \"apiPut\"),\r\n apiDelete: safeGet(utils, \"apiDelete\"),\r\n apiPatch: safeGet(utils, \"apiPatch\"),\r\n };\r\n};\r\n"],"names":["usePopupContext","usePopup","popups","activePopupId","setActivePopup","closePopup","openPopup","usePopupStore","showPopup","useCallback","popupCode","popParams","config","error","CommonCodeContext","createContext","CommonCodeProvider","children","codeData","isLoading","lastUpdated","getCodeList","getCodeListByOption","getCodeName","getCodeColor","getCodeByOption","getAvailableGroupCodes","getGridLookup","fetchCommonCodes","useCodeStore","contextValue","useCommonCode","context","useContext","useCodeList","useCodeName","useCodeColor","useCodeListByOption","useGridLookup","utils","dateUtils","stringUtils","arrayUtils.isEmptyArray","arrayUtils.isNotEmptyArray","arrayUtils.unique","arrayUtils.shuffle","arrayUtils.sortBy","arrayUtils.max","arrayUtils.min","arrayUtils.average","arrayUtils.sum","arrayUtils.randomFromArray","arrayUtils.flattenArray","objectUtils","commonUtils.debounce","commonUtils.throttle","commonUtils.setLocalStorage","commonUtils.getLocalStorage","commonUtils.formatNumber","commonUtils.formatCurrency","commonUtils.copyToClipboard","commonUtils.isMobile","commonUtils.isDesktop","apiUtils.callService","apiUtils.apiGet","apiUtils.apiPost","apiUtils.apiPut","apiUtils.apiDelete","apiUtils.apiPatch","UtilsContext","UtilsProvider","jsx","useUtils","safeGet","obj","key","fallback","useDateUtils","useStringUtils","useArrayUtils","useCommonUtils","useApiUtils"],"mappings":"6OAOaA,EAAkB,IAItB,GAMIC,EAAW,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAQ,cAAAC,EAAe,eAAAC,EAAgB,WAAAC,EAAY,UAAAC,CAAA,EACzDC,gBAAA,EAGIC,EAAYC,EAAAA,YAChB,MAAOC,EAAmBC,EAAiBC,IAAyB,CAClE,GAAI,CACF,MAAMN,EAAUI,EAAWC,EAAWC,CAAM,CAC9C,OAASC,EAAO,CACd,cAAQ,MAAM,YAAaA,CAAK,EAC1BA,CACR,CACF,EACA,CAACP,CAAS,CAAA,EAGZ,MAAO,CACL,OAAAJ,EACA,cAAAC,EACA,eAAAC,EACA,WAAAC,EACA,UAAAG,EACA,QAASN,EAAO,OAAS,CAAA,CAE7B,ECtCMY,EAAoBC,EAAAA,cACxB,MACF,EAOaC,EAAwD,CAAC,CACpE,SAAAC,CACF,IAAM,CACJ,KAAM,CACJ,SAAAC,EACA,UAAAC,EACA,MAAAN,EACA,YAAAO,EACA,YAAAC,EACA,oBAAAC,EACA,YAAAC,EACA,aAAAC,EACA,gBAAAC,EAC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AM,CACjC,MAAMxC,EAAQiC,EAAA,EACd,MAAO,CACL,aAAcC,EAAQlC,EAAO,cAAc,EAC3C,gBAAiBkC,EAAQlC,EAAO,iBAAiB,EACjD,OAAQkC,EAAQlC,EAAO,QAAQ,EAC/B,QAASkC,EAAQlC,EAAO,SAAS,EACjC,OAAQkC,EAAQlC,EAAO,QAAQ,EAC/B,IAAKkC,EAAQlC,EAAO,KAAK,EACzB,IAAKkC,EAAQlC,EAAO,KAAK,EACzB,QAASkC,EAAQlC,EAAO,SAAS,EACjC,IAAKkC,EAAQlC,EAAO,KAAK,CAAA,CAE7B,EAEayC,EAAiB,IAAM,CAClC,MAAMzC,EAAQiC,EAAA,EACd,MAAO,CACL,SAAUC,EAAQlC,EAAO,UAAU,EACnC,SAAUkC,EAAQlC,EAAO,UAAU,EACnC,gBAAiBkC,EAAQlC,EAAO,iBAAiB,EACjD,gBAAiBkC,EAAQlC,EAAO,iBAAiB,EACjD,aAAckC,EAAQlC,EAAO,cAAc,EAC3C,eAAgBkC,EAAQlC,EAAO,gBAAgB,EAC/C,gBAAiBkC,EAAQlC,EAAO,iBAAiB,EACjD,SAAUkC,EAAQlC,EAAO,UAAU,EACnC,UAAWkC,EAAQlC,EAAO,WAAW,CAAA,CAEzC,EAEa0C,EAAc,IAAM,CAC/B,MAAM1C,EAAQiC,EAAA,EACd,MAAO,CACL,YAAaC,EAAQlC,EAAO,aAAa,EACzC,OAAQkC,EAAQlC,EAAO,QAAQ,EAC/B,QAASkC,EAAQlC,EAAO,SAAS,EACjC,OAAQkC,EAAQlC,EAAO,QAAQ,EAC/B,UAAWkC,EAAQlC,EAAO,WAAW,EACrC,SAAUkC,EAAQlC,EAAO,UAAU,CAAA,CAEvC"}
@@ -32,12 +32,12 @@ function Q() {
32
32
  return c.fromToBase(y, $, _, f);
33
33
  }
34
34
  o.en.relativeTime = a, c.fromToBase = function(y, $, _, f, M) {
35
- for (var l, s, u, p = _.$locale().relativeTime || a, g = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], v = g.length, S = 0; S < v; S += 1) {
36
- var d = g[S];
35
+ for (var l, s, u, p = _.$locale().relativeTime || a, v = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], g = v.length, S = 0; S < g; S += 1) {
36
+ var d = v[S];
37
37
  d.d && (l = f ? o(y).diff(_, d.d, !0) : _.diff(y, d.d, !0));
38
38
  var O = (r.rounding || Math.round)(Math.abs(l));
39
39
  if (u = l > 0, O <= d.r || !d.r) {
40
- O <= 1 && S > 0 && (d = g[S - 1]);
40
+ O <= 1 && S > 0 && (d = v[S - 1]);
41
41
  var Y = p[d.l];
42
42
  M && (O = M("" + O)), s = typeof Y == "string" ? Y.replace("%d", O) : Y(O, $, d.l, u);
43
43
  break;
@@ -105,12 +105,13 @@ function tt() {
105
105
  var Y = ("" + O[0]).match(o) || ["-", 0, 0], D = Y[0], w = 60 * +Y[1] + +Y[2];
106
106
  return w === 0 ? 0 : D === "+" ? w : -w;
107
107
  })(s), s === null)) return this;
108
- var g = Math.abs(s) <= 16 ? 60 * s : s;
109
- if (g === 0) return this.utc(u);
110
- var v = this.clone();
111
- if (u) return v.$offset = g, v.$u = !1, v;
112
- var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
113
- return (v = this.local().add(g + S, r)).$offset = g, v.$x.$localOffset = S, v;
108
+ var v = Math.abs(s) <= 16 ? 60 * s : s, g = this;
109
+ if (u) return g.$offset = v, g.$u = s === 0, g;
110
+ if (s !== 0) {
111
+ var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
112
+ (g = this.local().add(v + S, r)).$offset = v, g.$x.$localOffset = S;
113
+ } else g = this.utc();
114
+ return g;
114
115
  };
115
116
  var f = m.format;
116
117
  m.format = function(s) {
@@ -133,8 +134,8 @@ function tt() {
133
134
  var l = m.diff;
134
135
  m.diff = function(s, u, p) {
135
136
  if (s && this.$u === s.$u) return l.call(this, s, u, p);
136
- var g = this.local(), v = h(s).local();
137
- return l.call(g, v, u, p);
137
+ var v = this.local(), g = h(s).local();
138
+ return l.call(v, g, u, p);
138
139
  };
139
140
  };
140
141
  }));
@@ -152,25 +153,25 @@ function ot() {
152
153
  return function(o, c, a) {
153
154
  var h, m = function(f, M, l) {
154
155
  l === void 0 && (l = {});
155
- var s = new Date(f), u = (function(p, g) {
156
- g === void 0 && (g = {});
157
- var v = g.timeZoneName || "short", S = p + "|" + v, d = n[S];
158
- return d || (d = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: p, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: v }), n[S] = d), d;
156
+ var s = new Date(f), u = (function(p, v) {
157
+ v === void 0 && (v = {});
158
+ var g = v.timeZoneName || "short", S = p + "|" + g, d = n[S];
159
+ return d || (d = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: p, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: g }), n[S] = d), d;
159
160
  })(M, l);
160
161
  return u.formatToParts(s);
161
162
  }, y = function(f, M) {
162
163
  for (var l = m(f, M), s = [], u = 0; u < l.length; u += 1) {
163
- var p = l[u], g = p.type, v = p.value, S = r[g];
164
- S >= 0 && (s[S] = parseInt(v, 10));
164
+ var p = l[u], v = p.type, g = p.value, S = r[v];
165
+ S >= 0 && (s[S] = parseInt(g, 10));
165
166
  }
166
167
  var d = s[3], O = d === 24 ? 0 : d, Y = s[0] + "-" + s[1] + "-" + s[2] + " " + O + ":" + s[4] + ":" + s[5] + ":000", D = +f;
167
168
  return (a.utc(Y).valueOf() - (D -= D % 1e3)) / 6e4;
168
169
  }, $ = c.prototype;
169
170
  $.tz = function(f, M) {
170
171
  f === void 0 && (f = h);
171
- var l, s = this.utcOffset(), u = this.toDate(), p = u.toLocaleString("en-US", { timeZone: f }), g = Math.round((u - new Date(p)) / 1e3 / 60), v = 15 * -Math.round(u.getTimezoneOffset() / 15) - g;
172
- if (!Number(v)) l = this.utcOffset(0, M);
173
- else if (l = a(p, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(v, !0), M) {
172
+ var l, s = this.utcOffset(), u = this.toDate(), p = u.toLocaleString("en-US", { timeZone: f }), v = Math.round((u - new Date(p)) / 1e3 / 60), g = 15 * -Math.round(u.getTimezoneOffset() / 15) - v;
173
+ if (!Number(g)) l = this.utcOffset(0, M);
174
+ else if (l = a(p, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(g, !0), M) {
174
175
  var S = l.utcOffset();
175
176
  l = l.add(s - S, "minute");
176
177
  }
@@ -189,12 +190,12 @@ function ot() {
189
190
  }, a.tz = function(f, M, l) {
190
191
  var s = l && M, u = l || M || h, p = y(+a(), u);
191
192
  if (typeof f != "string") return a(f).tz(u);
192
- var g = (function(O, Y, D) {
193
+ var v = (function(O, Y, D) {
193
194
  var w = O - 60 * Y * 1e3, T = y(w, D);
194
195
  if (Y === T) return [w, Y];
195
196
  var z = y(w -= 60 * (T - Y) * 1e3, D);
196
197
  return T === z ? [w, T] : [O - 60 * Math.min(T, z) * 1e3, Math.max(T, z)];
197
- })(a.utc(f, s).valueOf(), p, u), v = g[0], S = g[1], d = a(v).utcOffset(S);
198
+ })(a.utc(f, s).valueOf(), p, u), g = v[0], S = v[1], d = a(g).utcOffset(S);
198
199
  return d.$x.$timezone = u, d;
199
200
  }, a.tz.guess = function() {
200
201
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -626,4 +627,4 @@ export {
626
627
  W as y,
627
628
  Lt as z
628
629
  };
629
- //# sourceMappingURL=commonUtils-BV6WFv-z.js.map
630
+ //# sourceMappingURL=commonUtils-Cvx6_eK2.js.map