@bwg-ui/core 1.1.21 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/BwgSwitch-B79pseQM.js +269 -0
- package/dist/chunks/BwgSwitch-B79pseQM.js.map +1 -0
- package/dist/chunks/BwgSwitch-CAI-kEaM.cjs +2 -0
- package/dist/chunks/BwgSwitch-CAI-kEaM.cjs.map +1 -0
- package/dist/chunks/{BwgDownload-COsACbpJ.js → BwgUploader-BcVlE61B.js} +2933 -2982
- package/dist/chunks/BwgUploader-BcVlE61B.js.map +1 -0
- package/dist/chunks/BwgUploader-DaNV2URT.cjs +3 -0
- package/dist/chunks/BwgUploader-DaNV2URT.cjs.map +1 -0
- package/dist/chunks/LoadingOverlay-DAZJF5wg.js +19 -0
- package/dist/chunks/LoadingOverlay-DAZJF5wg.js.map +1 -0
- package/dist/chunks/LoadingOverlay-DcmKvoZA.cjs +2 -0
- package/dist/chunks/LoadingOverlay-DcmKvoZA.cjs.map +1 -0
- package/dist/chunks/{SSOHandler-BHJ5NexT.js → SSOHandler-CkPcSHIm.js} +12085 -10934
- package/dist/chunks/SSOHandler-CkPcSHIm.js.map +1 -0
- package/dist/chunks/SSOHandler-DiW4Ft9i.cjs +237 -0
- package/dist/chunks/SSOHandler-DiW4Ft9i.cjs.map +1 -0
- package/dist/chunks/{SearchBoxContext-BxJN-x3-.js → SearchBoxContext-BCvEYyFk.js} +7 -7
- package/dist/chunks/{SearchBoxContext-BxJN-x3-.js.map → SearchBoxContext-BCvEYyFk.js.map} +1 -1
- package/dist/chunks/{SearchBoxContext-DnQGaRgo.cjs → SearchBoxContext-DwFDOyYG.cjs} +2 -2
- package/dist/chunks/{SearchBoxContext-DnQGaRgo.cjs.map → SearchBoxContext-DwFDOyYG.cjs.map} +1 -1
- package/dist/chunks/{ViewContainer-HSyLfryI.cjs → ViewContainer-Bhq22_B3.cjs} +2 -2
- package/dist/chunks/{ViewContainer-HSyLfryI.cjs.map → ViewContainer-Bhq22_B3.cjs.map} +1 -1
- package/dist/chunks/{ViewContainer-x2yzKkIG.js → ViewContainer-CjpJqoGG.js} +2 -2
- package/dist/chunks/{ViewContainer-x2yzKkIG.js.map → ViewContainer-CjpJqoGG.js.map} +1 -1
- package/dist/chunks/apiUtils-BZ6s0_NI.cjs +3 -0
- package/dist/chunks/apiUtils-BZ6s0_NI.cjs.map +1 -0
- package/dist/chunks/apiUtils-DxzLqPhU.js +1441 -0
- package/dist/chunks/apiUtils-DxzLqPhU.js.map +1 -0
- package/dist/chunks/{codeStore-DefmZVgs.js → codeStore-CfI4Wh5M.js} +4 -4
- package/dist/chunks/{codeStore-DefmZVgs.js.map → codeStore-CfI4Wh5M.js.map} +1 -1
- package/dist/chunks/{codeStore-pQbDqWkZ.cjs → codeStore-il4-kZPe.cjs} +2 -2
- package/dist/chunks/{codeStore-pQbDqWkZ.cjs.map → codeStore-il4-kZPe.cjs.map} +1 -1
- package/dist/chunks/core-BHejg5iS.cjs +2 -0
- package/dist/chunks/core-BHejg5iS.cjs.map +1 -0
- package/dist/chunks/core-bHd8azE6.js +514 -0
- package/dist/chunks/core-bHd8azE6.js.map +1 -0
- package/dist/chunks/enc-base64-BQYwLKgk.js +102 -0
- package/dist/chunks/enc-base64-BQYwLKgk.js.map +1 -0
- package/dist/chunks/enc-base64-BkBtNBQV.cjs +2 -0
- package/dist/chunks/enc-base64-BkBtNBQV.cjs.map +1 -0
- package/dist/chunks/{favoriteStore-BXBziAgB.cjs → favoriteStore-CcKg_nEH.cjs} +2 -2
- package/dist/chunks/{favoriteStore-BXBziAgB.cjs.map → favoriteStore-CcKg_nEH.cjs.map} +1 -1
- package/dist/chunks/{favoriteStore-DAPC01iF.js → favoriteStore-Cemc-26t.js} +2 -2
- package/dist/chunks/{favoriteStore-DAPC01iF.js.map → favoriteStore-Cemc-26t.js.map} +1 -1
- package/dist/chunks/{popupStore-CcQg9AvK.js → popupStore-Bi6o78lP.js} +2 -2
- package/dist/chunks/{popupStore-CcQg9AvK.js.map → popupStore-Bi6o78lP.js.map} +1 -1
- package/dist/chunks/{popupStore-BV632k5p.cjs → popupStore-DUApUBF2.cjs} +2 -2
- package/dist/chunks/{popupStore-BV632k5p.cjs.map → popupStore-DUApUBF2.cjs.map} +1 -1
- package/dist/chunks/sha256-BZfJs28k.js +79 -0
- package/dist/chunks/sha256-BZfJs28k.js.map +1 -0
- package/dist/chunks/sha256-DiIRoCQ8.cjs +2 -0
- package/dist/chunks/sha256-DiIRoCQ8.cjs.map +1 -0
- package/dist/chunks/{usePopup-Cw5xsOaH.js → usePopup-BSqsnSz7.js} +3 -3
- package/dist/chunks/{usePopup-Cw5xsOaH.js.map → usePopup-BSqsnSz7.js.map} +1 -1
- package/dist/chunks/{usePopup-DoVGuobp.cjs → usePopup-D2JEuDrO.cjs} +2 -2
- package/dist/chunks/{usePopup-DoVGuobp.cjs.map → usePopup-D2JEuDrO.cjs.map} +1 -1
- package/dist/components/common/BwgDraggable.d.ts +1 -1
- package/dist/components/common/BwgDraggable.d.ts.map +1 -1
- package/dist/components/common/BwgEditor.d.ts +43 -36
- package/dist/components/common/BwgEditor.d.ts.map +1 -1
- package/dist/components/common/BwgGrid.d.ts +13 -5
- package/dist/components/common/BwgGrid.d.ts.map +1 -1
- package/dist/components/common/BwgPagination.d.ts +25 -5
- package/dist/components/common/BwgPagination.d.ts.map +1 -1
- package/dist/components/common/BwgView.d.ts.map +1 -1
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgCheck.d.ts +11 -0
- package/dist/components/core/BwgCheck.d.ts.map +1 -1
- package/dist/components/core/BwgDownload.d.ts.map +1 -1
- package/dist/components/core/BwgSelect.d.ts +2 -2
- package/dist/components/core/BwgSelect.d.ts.map +1 -1
- package/dist/components/core/BwgSwitch.d.ts +24 -0
- package/dist/components/core/BwgSwitch.d.ts.map +1 -0
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.d.ts +20 -19
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +22 -21
- package/dist/components/layout/LoadingOverlay.d.ts +3 -3
- package/dist/components/layout/LoadingOverlay.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +2 -2
- package/dist/components/popup/MenuReport.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +116 -115
- package/dist/provider/index.cjs +1 -1
- package/dist/provider/index.js +2 -2
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.cjs.map +1 -1
- package/dist/stores/index.d.ts +7 -7
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +16 -15
- package/dist/stores/index.js.map +1 -1
- package/dist/stores/loadingStore.d.ts +1 -0
- package/dist/stores/loadingStore.d.ts.map +1 -1
- package/dist/stores/menuModelStore.d.ts.map +1 -1
- package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
- package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
- package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
- package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
- package/dist/styles/layout.css +14 -1
- package/dist/utils/apiUtils.d.ts +4 -8
- package/dist/utils/apiUtils.d.ts.map +1 -1
- package/dist/utils/commonUtils.d.ts +6 -0
- package/dist/utils/commonUtils.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +53 -54
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunks/BwgCheck-BDt8r0gn.js +0 -200
- package/dist/chunks/BwgCheck-BDt8r0gn.js.map +0 -1
- package/dist/chunks/BwgCheck-Dtzr-6rg.cjs +0 -2
- package/dist/chunks/BwgCheck-Dtzr-6rg.cjs.map +0 -1
- package/dist/chunks/BwgDownload-COsACbpJ.js.map +0 -1
- package/dist/chunks/BwgDownload-i6w7ZD-i.cjs +0 -3
- package/dist/chunks/BwgDownload-i6w7ZD-i.cjs.map +0 -1
- package/dist/chunks/LoadingOverlay-CAO6_FuF.js +0 -29
- package/dist/chunks/LoadingOverlay-CAO6_FuF.js.map +0 -1
- package/dist/chunks/LoadingOverlay-NX9Mo_6n.cjs +0 -2
- package/dist/chunks/LoadingOverlay-NX9Mo_6n.cjs.map +0 -1
- package/dist/chunks/SSOHandler-BHJ5NexT.js.map +0 -1
- package/dist/chunks/SSOHandler-BtrmIPzQ.cjs +0 -236
- package/dist/chunks/SSOHandler-BtrmIPzQ.cjs.map +0 -1
- package/dist/chunks/apiUtils-CudW_FKE.cjs +0 -3
- package/dist/chunks/apiUtils-CudW_FKE.cjs.map +0 -1
- package/dist/chunks/apiUtils-DfPv_gmI.js +0 -2064
- package/dist/chunks/apiUtils-DfPv_gmI.js.map +0 -1
|
@@ -0,0 +1,1441 @@
|
|
|
1
|
+
import ne from "axios";
|
|
2
|
+
import $ from "dayjs";
|
|
3
|
+
import { message as X, notification as L } from "antd";
|
|
4
|
+
import { create as F } from "zustand";
|
|
5
|
+
var Cr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6
|
+
function se(e) {
|
|
7
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
8
|
+
}
|
|
9
|
+
function Ir(e) {
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
|
|
11
|
+
var r = e.default;
|
|
12
|
+
if (typeof r == "function") {
|
|
13
|
+
var t = function n() {
|
|
14
|
+
var s = !1;
|
|
15
|
+
try {
|
|
16
|
+
s = this instanceof n;
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
return s ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
t.prototype = r.prototype;
|
|
22
|
+
} else t = {};
|
|
23
|
+
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
|
|
24
|
+
var s = Object.getOwnPropertyDescriptor(e, n);
|
|
25
|
+
Object.defineProperty(t, n, s.get ? s : {
|
|
26
|
+
enumerable: !0,
|
|
27
|
+
get: function() {
|
|
28
|
+
return e[n];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}), t;
|
|
32
|
+
}
|
|
33
|
+
const pe = {
|
|
34
|
+
// 권한 관련
|
|
35
|
+
AUTH_BTNS: "SCMSIGN00202",
|
|
36
|
+
// 버튼 권한 조회
|
|
37
|
+
AUTH_MENU: "SCMSIGN00201",
|
|
38
|
+
// 메뉴 권한 조회
|
|
39
|
+
SRCH_CODE: "SCMSIGN00301",
|
|
40
|
+
// 코드 조회
|
|
41
|
+
// 팝업 관련
|
|
42
|
+
SRCH_POPU: "SCMPOPU00101",
|
|
43
|
+
// 팝업 조회
|
|
44
|
+
// 즐겨찾기 관련
|
|
45
|
+
AUTH_BMRK: "SCMBMRK00101"
|
|
46
|
+
// 즐겨찾기 관리
|
|
47
|
+
};
|
|
48
|
+
let A = {};
|
|
49
|
+
function Ne(e) {
|
|
50
|
+
A = e, console.log("🔧 Provider 서비스코드 오버라이드 설정:", e);
|
|
51
|
+
}
|
|
52
|
+
function oe(e) {
|
|
53
|
+
return A[e] && A[e].trim() !== "" ? A[e] : pe[e];
|
|
54
|
+
}
|
|
55
|
+
function ye() {
|
|
56
|
+
const e = {};
|
|
57
|
+
for (const r of Object.keys(pe))
|
|
58
|
+
e[r] = oe(r);
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
function Ee() {
|
|
62
|
+
console.log("🔧 bwg-core 서비스코드 설정:"), console.log("📋 Provider 설정 > 기본값 순서로 확인");
|
|
63
|
+
const e = ye();
|
|
64
|
+
for (const [r, t] of Object.entries(e)) {
|
|
65
|
+
const n = A[r] ? "Provider 설정" : "기본값";
|
|
66
|
+
console.log(` ${r}: ${t} (${n})`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
70
|
+
__proto__: null,
|
|
71
|
+
getAllServiceCodes: ye,
|
|
72
|
+
getServiceCode: oe,
|
|
73
|
+
logServiceCodeConfig: Ee,
|
|
74
|
+
setServiceCodeOverrides: Ne
|
|
75
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
76
|
+
import.meta.env.DEV;
|
|
77
|
+
function Ue(e, r) {
|
|
78
|
+
let t;
|
|
79
|
+
try {
|
|
80
|
+
t = e();
|
|
81
|
+
} catch {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
getItem: (s) => {
|
|
86
|
+
var a;
|
|
87
|
+
const i = (d) => d === null ? null : JSON.parse(d, void 0), h = (a = t.getItem(s)) != null ? a : null;
|
|
88
|
+
return h instanceof Promise ? h.then(i) : i(h);
|
|
89
|
+
},
|
|
90
|
+
setItem: (s, a) => t.setItem(s, JSON.stringify(a, void 0)),
|
|
91
|
+
removeItem: (s) => t.removeItem(s)
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const Q = (e) => (r) => {
|
|
95
|
+
try {
|
|
96
|
+
const t = e(r);
|
|
97
|
+
return t instanceof Promise ? t : {
|
|
98
|
+
then(n) {
|
|
99
|
+
return Q(n)(t);
|
|
100
|
+
},
|
|
101
|
+
catch(n) {
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
} catch (t) {
|
|
106
|
+
return {
|
|
107
|
+
then(n) {
|
|
108
|
+
return this;
|
|
109
|
+
},
|
|
110
|
+
catch(n) {
|
|
111
|
+
return Q(n)(t);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}, Ae = (e, r) => (t, n, s) => {
|
|
116
|
+
let a = {
|
|
117
|
+
storage: Ue(() => localStorage),
|
|
118
|
+
partialize: (o) => o,
|
|
119
|
+
version: 0,
|
|
120
|
+
merge: (o, f) => ({
|
|
121
|
+
...f,
|
|
122
|
+
...o
|
|
123
|
+
}),
|
|
124
|
+
...r
|
|
125
|
+
}, i = !1;
|
|
126
|
+
const h = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
127
|
+
let y = a.storage;
|
|
128
|
+
if (!y)
|
|
129
|
+
return e(
|
|
130
|
+
(...o) => {
|
|
131
|
+
console.warn(
|
|
132
|
+
`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`
|
|
133
|
+
), t(...o);
|
|
134
|
+
},
|
|
135
|
+
n,
|
|
136
|
+
s
|
|
137
|
+
);
|
|
138
|
+
const g = () => {
|
|
139
|
+
const o = a.partialize({ ...n() });
|
|
140
|
+
return y.setItem(a.name, {
|
|
141
|
+
state: o,
|
|
142
|
+
version: a.version
|
|
143
|
+
});
|
|
144
|
+
}, p = s.setState;
|
|
145
|
+
s.setState = (o, f) => (p(o, f), g());
|
|
146
|
+
const c = e(
|
|
147
|
+
(...o) => (t(...o), g()),
|
|
148
|
+
n,
|
|
149
|
+
s
|
|
150
|
+
);
|
|
151
|
+
s.getInitialState = () => c;
|
|
152
|
+
let u;
|
|
153
|
+
const l = () => {
|
|
154
|
+
var o, f;
|
|
155
|
+
if (!y) return;
|
|
156
|
+
i = !1, h.forEach((m) => {
|
|
157
|
+
var M;
|
|
158
|
+
return m((M = n()) != null ? M : c);
|
|
159
|
+
});
|
|
160
|
+
const v = ((f = a.onRehydrateStorage) == null ? void 0 : f.call(a, (o = n()) != null ? o : c)) || void 0;
|
|
161
|
+
return Q(y.getItem.bind(y))(a.name).then((m) => {
|
|
162
|
+
if (m)
|
|
163
|
+
if (typeof m.version == "number" && m.version !== a.version) {
|
|
164
|
+
if (a.migrate) {
|
|
165
|
+
const M = a.migrate(
|
|
166
|
+
m.state,
|
|
167
|
+
m.version
|
|
168
|
+
);
|
|
169
|
+
return M instanceof Promise ? M.then((w) => [!0, w]) : [!0, M];
|
|
170
|
+
}
|
|
171
|
+
console.error(
|
|
172
|
+
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
173
|
+
);
|
|
174
|
+
} else
|
|
175
|
+
return [!1, m.state];
|
|
176
|
+
return [!1, void 0];
|
|
177
|
+
}).then((m) => {
|
|
178
|
+
var M;
|
|
179
|
+
const [w, S] = m;
|
|
180
|
+
if (u = a.merge(
|
|
181
|
+
S,
|
|
182
|
+
(M = n()) != null ? M : c
|
|
183
|
+
), t(u, !0), w)
|
|
184
|
+
return g();
|
|
185
|
+
}).then(() => {
|
|
186
|
+
v?.(u, void 0), u = n(), i = !0, d.forEach((m) => m(u));
|
|
187
|
+
}).catch((m) => {
|
|
188
|
+
v?.(void 0, m);
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
return s.persist = {
|
|
192
|
+
setOptions: (o) => {
|
|
193
|
+
a = {
|
|
194
|
+
...a,
|
|
195
|
+
...o
|
|
196
|
+
}, o.storage && (y = o.storage);
|
|
197
|
+
},
|
|
198
|
+
clearStorage: () => {
|
|
199
|
+
y?.removeItem(a.name);
|
|
200
|
+
},
|
|
201
|
+
getOptions: () => a,
|
|
202
|
+
rehydrate: () => l(),
|
|
203
|
+
hasHydrated: () => i,
|
|
204
|
+
onHydrate: (o) => (h.add(o), () => {
|
|
205
|
+
h.delete(o);
|
|
206
|
+
}),
|
|
207
|
+
onFinishHydration: (o) => (d.add(o), () => {
|
|
208
|
+
d.delete(o);
|
|
209
|
+
})
|
|
210
|
+
}, a.skipHydration || l(), u || c;
|
|
211
|
+
}, ke = Ae, D = F()(
|
|
212
|
+
ke(
|
|
213
|
+
(e, r) => ({
|
|
214
|
+
user: null,
|
|
215
|
+
isLoggedIn: !1,
|
|
216
|
+
// 로그인
|
|
217
|
+
login: (t) => {
|
|
218
|
+
e({ user: t, isLoggedIn: !0 }), console.log("사용자 로그인:", t);
|
|
219
|
+
},
|
|
220
|
+
// 로그아웃
|
|
221
|
+
logout: () => {
|
|
222
|
+
e({ user: null, isLoggedIn: !1 }), console.log("사용자 로그아웃");
|
|
223
|
+
},
|
|
224
|
+
// 사용자 정보 업데이트
|
|
225
|
+
updateUser: (t) => {
|
|
226
|
+
const n = r().user;
|
|
227
|
+
n && e({ user: { ...n, ...t } });
|
|
228
|
+
}
|
|
229
|
+
}),
|
|
230
|
+
{
|
|
231
|
+
name: "user-storage",
|
|
232
|
+
// 로컬 스토리지 키
|
|
233
|
+
partialize: (e) => ({
|
|
234
|
+
user: e.user,
|
|
235
|
+
isLoggedIn: e.isLoggedIn
|
|
236
|
+
})
|
|
237
|
+
// 저장할 상태만 선택
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
), Ye = () => D.getState().user?.crprCd || null, ve = () => D.getState().user?.userId || null, Me = () => D.getState().user?.userNm || null, Fe = () => D.getState().user?.userDvsn || null, je = () => D.getState().user?.emplNo || null, Se = () => D.getState().user?.dprtCd || null, we = () => D.getState().user?.dprtNm || null, G = () => D.getState().user?.roleList || null, Re = (e) => {
|
|
241
|
+
const r = G();
|
|
242
|
+
return r ? r.includes(e) : !1;
|
|
243
|
+
}, He = (e) => {
|
|
244
|
+
const r = G();
|
|
245
|
+
return r ? e.some((t) => r.includes(t)) : !1;
|
|
246
|
+
}, ze = (e) => {
|
|
247
|
+
const r = G();
|
|
248
|
+
return r ? e.every((t) => r.includes(t)) : !1;
|
|
249
|
+
}, qe = () => D.getState().isLoggedIn, j = () => D.getState().user, Be = () => j() !== null, Ge = () => {
|
|
250
|
+
const e = Me(), r = ve();
|
|
251
|
+
return e || r || null;
|
|
252
|
+
}, We = () => {
|
|
253
|
+
const e = we(), r = Se();
|
|
254
|
+
return e || (r ? String(r) : null);
|
|
255
|
+
}, br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
256
|
+
__proto__: null,
|
|
257
|
+
getCrprCd: Ye,
|
|
258
|
+
getDepartmentInfo: We,
|
|
259
|
+
getDisplayName: Ge,
|
|
260
|
+
getDprtCd: Se,
|
|
261
|
+
getDprtNm: we,
|
|
262
|
+
getEmplNo: je,
|
|
263
|
+
getRoleList: G,
|
|
264
|
+
getUserDvsn: Fe,
|
|
265
|
+
getUserId: ve,
|
|
266
|
+
getUserInfo: j,
|
|
267
|
+
getUserNm: Me,
|
|
268
|
+
hasAllRoles: ze,
|
|
269
|
+
hasAnyRole: He,
|
|
270
|
+
hasRole: Re,
|
|
271
|
+
hasUserInfo: Be,
|
|
272
|
+
isLoggedIn: qe
|
|
273
|
+
}, Symbol.toStringTag, { value: "Module" })), ee = {
|
|
274
|
+
DEFAULT_PRNT_GBCD: 1
|
|
275
|
+
}, Je = (e) => e && typeof e == "object" && typeof e.menuId == "string" && typeof e.menuNm == "string", le = (e) => Array.isArray(e) && e.every(Je);
|
|
276
|
+
let Z = [], de = [];
|
|
277
|
+
const Ke = (e) => {
|
|
278
|
+
if (e && typeof e == "object") {
|
|
279
|
+
const r = e;
|
|
280
|
+
if (r.menus && le(r.menus)) return r.menus;
|
|
281
|
+
if (le(e)) return e;
|
|
282
|
+
}
|
|
283
|
+
return console.warn("⚠️ 메뉴 응답이 비어있거나 예상과 다릅니다."), [];
|
|
284
|
+
}, Xe = (e, r) => !!r && e.crprCd === r.crprCd && e.userId === r.userId && (e.prntGbcd ?? ee.DEFAULT_PRNT_GBCD) === (r.prntGbcd ?? ee.DEFAULT_PRNT_GBCD), Ze = (e) => {
|
|
285
|
+
if (Z.length === e.length && Z.every(
|
|
286
|
+
(a, i) => a.menuId === e[i]?.menuId && a.menuPrntId === e[i]?.menuPrntId
|
|
287
|
+
))
|
|
288
|
+
return de;
|
|
289
|
+
if (!e.length) return [];
|
|
290
|
+
const r = /* @__PURE__ */ new Map(), t = [];
|
|
291
|
+
e.forEach((a) => a?.menuId && r.set(a.menuId, { ...a, children: [] })), e.forEach((a) => {
|
|
292
|
+
const i = r.get(a.menuId);
|
|
293
|
+
i && (a.menuPrntId && a.menuPrntId !== "" && a.menuPrntId !== "-" ? r.get(a.menuPrntId)?.children?.push(i) : t.push(i));
|
|
294
|
+
});
|
|
295
|
+
const n = (a) => a.sort((i, h) => (i?.menuNo ?? 0) - (h?.menuNo ?? 0)).map((i) => ({
|
|
296
|
+
...i,
|
|
297
|
+
children: i.children && i.children.length ? n(i.children) : void 0
|
|
298
|
+
})), s = n(t);
|
|
299
|
+
return Z = [...e], de = s, s;
|
|
300
|
+
}, Ve = F((e, r) => ({
|
|
301
|
+
// 📊 초기 상태값
|
|
302
|
+
menuList: [],
|
|
303
|
+
flatMenuList: [],
|
|
304
|
+
isLoading: !1,
|
|
305
|
+
error: null,
|
|
306
|
+
_lastFetchParams: null,
|
|
307
|
+
// 🔧 메뉴 모델 조회
|
|
308
|
+
// 서버에서 사용자별 메뉴 권한 데이터를 가져와서 트리/플랫 구조로 저장
|
|
309
|
+
fetchMenu: async ({ crprCd: t, userId: n, prntGbcd: s }) => {
|
|
310
|
+
const a = {
|
|
311
|
+
crprCd: t,
|
|
312
|
+
userId: n,
|
|
313
|
+
prntGbcd: s ?? ee.DEFAULT_PRNT_GBCD
|
|
314
|
+
};
|
|
315
|
+
if (Xe(a, r()._lastFetchParams)) {
|
|
316
|
+
console.log("✅ 중복 fetch 차단", a);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
e({ isLoading: !0, error: null, _lastFetchParams: a });
|
|
320
|
+
try {
|
|
321
|
+
const i = await N(oe("AUTH_MENU"), a), h = Ke(i), d = Ze(h);
|
|
322
|
+
e({
|
|
323
|
+
flatMenuList: h,
|
|
324
|
+
// 평면 리스트 저장
|
|
325
|
+
menuList: d,
|
|
326
|
+
// 트리 구조 저장
|
|
327
|
+
isLoading: !1,
|
|
328
|
+
error: null
|
|
329
|
+
});
|
|
330
|
+
} catch (i) {
|
|
331
|
+
e({ isLoading: !1, error: i?.message ?? "메뉴 로드 실패" });
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
// 🔧 메뉴 모델 초기화
|
|
335
|
+
// 로그아웃 시나 사용자 변경 시 메뉴 모델 클리어
|
|
336
|
+
clearMenu: () => {
|
|
337
|
+
e({
|
|
338
|
+
menuList: [],
|
|
339
|
+
flatMenuList: [],
|
|
340
|
+
error: null,
|
|
341
|
+
_lastFetchParams: null
|
|
342
|
+
});
|
|
343
|
+
},
|
|
344
|
+
// 🔧 메뉴 ID로 메뉴 아이템 찾기
|
|
345
|
+
// URL 파라미터나 프로그래밍 방식으로 특정 메뉴를 찾을 때 사용
|
|
346
|
+
findMenuById: (t) => {
|
|
347
|
+
const { flatMenuList: n } = r();
|
|
348
|
+
return n.find((s) => s.menuId === t) ?? null;
|
|
349
|
+
}
|
|
350
|
+
})), V = {
|
|
351
|
+
MAX_TABS: 15
|
|
352
|
+
}, Te = F((e, r) => ({
|
|
353
|
+
// 📊 초기 상태값
|
|
354
|
+
activeMenuId: null,
|
|
355
|
+
activeMenuItem: null,
|
|
356
|
+
activeDetailItem: null,
|
|
357
|
+
tabs: [],
|
|
358
|
+
sidebarCollapsed: !1,
|
|
359
|
+
maxTabs: V.MAX_TABS,
|
|
360
|
+
tabProtectFlag: {},
|
|
361
|
+
tabParams: {},
|
|
362
|
+
componentLabelMap: {},
|
|
363
|
+
// 🔧 탭 추가 (메뉴 아이템 객체로)
|
|
364
|
+
// 사이드바에서 메뉴 클릭 시 호출되는 메인 함수
|
|
365
|
+
openTabFromMenu: (t, n) => {
|
|
366
|
+
const { tabs: s, activeMenuId: a } = r(), i = s.find((d) => d.key === t.menuId), h = s.find((d) => d.key === t.menuId);
|
|
367
|
+
if (i)
|
|
368
|
+
h != null ? (e({ activeMenuId: t.menuId, activeMenuItem: t }), r().setTabParams(t.menuId, n || {}), t?.prsnInfoYn === "Y" && r().setProtectFlagForKey(t.menuId)) : X.warning("유효하지 않은 메뉴정보입니다.");
|
|
369
|
+
else {
|
|
370
|
+
if (s.length > V.MAX_TABS) {
|
|
371
|
+
console.warn("❌ 최대 탭 개수를 초과했습니다."), X.warning(
|
|
372
|
+
`최대 ${V.MAX_TABS}개의 탭만 열 수 있습니다.
|
|
373
|
+
기존 탭을 닫고 다시 시도해주세요.`
|
|
374
|
+
);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
const d = {
|
|
378
|
+
key: t.menuId,
|
|
379
|
+
label: t.menuNm,
|
|
380
|
+
gubun: "M",
|
|
381
|
+
menuItem: t,
|
|
382
|
+
closable: !0
|
|
383
|
+
};
|
|
384
|
+
e({
|
|
385
|
+
tabs: [...s, d],
|
|
386
|
+
// 탭 목록에 추가
|
|
387
|
+
activeMenuId: t.menuId,
|
|
388
|
+
// 새 탭을 활성화
|
|
389
|
+
activeMenuItem: t
|
|
390
|
+
// 현재 프로그램으로 설정
|
|
391
|
+
}), r().setTabParams(t.menuId, n || {}), t?.prsnInfoYn === "Y" && r().setProtectFlagForKey(t.menuId);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
// 🔧 탭 추가 (메뉴 ID로)
|
|
395
|
+
// URL 파라미터로 메뉴 열기 시 사용 (예: ?menuId=CM000301)
|
|
396
|
+
openTabByMenuId: (t, n) => {
|
|
397
|
+
const s = Ve.getState().findMenuById(t);
|
|
398
|
+
s ? r().openTabFromMenu(s, n) : X.warning("메뉴 ID를 찾을 수 없습니다.");
|
|
399
|
+
},
|
|
400
|
+
openDetailView: (t, n, s) => {
|
|
401
|
+
const { tabs: a, activeMenuId: i } = r();
|
|
402
|
+
if (a.find((d) => d.key === t.viewId))
|
|
403
|
+
r().focusTab(t.viewId);
|
|
404
|
+
else {
|
|
405
|
+
const d = {
|
|
406
|
+
key: t.viewId,
|
|
407
|
+
label: t.viewLabel,
|
|
408
|
+
gubun: "C",
|
|
409
|
+
componentItem: {
|
|
410
|
+
scrnPath: n,
|
|
411
|
+
prsnInfoYn: s,
|
|
412
|
+
prntInfo: t.prntInfo
|
|
413
|
+
},
|
|
414
|
+
closable: !0
|
|
415
|
+
};
|
|
416
|
+
e({
|
|
417
|
+
tabs: [...a, d],
|
|
418
|
+
// 탭 목록에 추가
|
|
419
|
+
activeMenuId: t.viewId,
|
|
420
|
+
// 새 탭을 활성화
|
|
421
|
+
activeDetailItem: t
|
|
422
|
+
}), r().setTabParams(t.viewId, t.viewParams || {});
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
// 🔧 탭 제거
|
|
426
|
+
// X 버튼 클릭 시 탭을 닫고 관련 상태도 정리
|
|
427
|
+
closeTab: (t) => {
|
|
428
|
+
const { tabs: n, activeMenuId: s } = r();
|
|
429
|
+
n.find((h) => h.key === t);
|
|
430
|
+
const a = n.filter((h) => h.key !== t);
|
|
431
|
+
let i = s;
|
|
432
|
+
if (s === t) {
|
|
433
|
+
const h = n.findIndex((d) => d.key === t);
|
|
434
|
+
i = a.length ? a[Math.min(h, a.length - 1)]?.key ?? null : null;
|
|
435
|
+
}
|
|
436
|
+
e({
|
|
437
|
+
tabs: a
|
|
438
|
+
}), i && r().focusTab(i);
|
|
439
|
+
},
|
|
440
|
+
// 🔧 활성 탭 변경
|
|
441
|
+
// 탭 헤더 클릭 시 해당 탭으로 전환
|
|
442
|
+
focusTab: (t) => {
|
|
443
|
+
const { tabs: n } = r(), s = n.find((a) => a.key === t);
|
|
444
|
+
if (s) {
|
|
445
|
+
const a = s.gubun === "C" ? {
|
|
446
|
+
viewId: s.key,
|
|
447
|
+
viewLabel: s.label,
|
|
448
|
+
prntInfo: s.componentItem?.prntInfo
|
|
449
|
+
} : null;
|
|
450
|
+
s.menuItem?.prsnInfoYn === "Y" ? (e({
|
|
451
|
+
activeMenuId: t,
|
|
452
|
+
activeMenuItem: s.menuItem,
|
|
453
|
+
activeDetailItem: a
|
|
454
|
+
}), console.log(
|
|
455
|
+
"✅ 탭 포커스 (개인정보) - activeMenuItem:",
|
|
456
|
+
s.menuItem
|
|
457
|
+
), r().setProtectFlagForKey(t)) : (e({
|
|
458
|
+
activeMenuId: t,
|
|
459
|
+
activeMenuItem: s.menuItem,
|
|
460
|
+
activeDetailItem: a
|
|
461
|
+
}), r().clearProtectFlagForKey(t));
|
|
462
|
+
} else
|
|
463
|
+
e({ activeMenuId: t, activeMenuItem: null, activeDetailItem: null }), console.warn("❌ 탭을 찾을 수 없음:", t);
|
|
464
|
+
},
|
|
465
|
+
// 🔧 모든 탭 제거
|
|
466
|
+
// 로그아웃이나 전체 초기화 시 사용
|
|
467
|
+
closeAllTabs: () => e({ tabs: [], activeMenuId: null, activeMenuItem: null, activeDetailItem: null }),
|
|
468
|
+
// 🔧 사이드바 토글
|
|
469
|
+
// 햄버거 메뉴 클릭 시 사이드바 접기/펼치기
|
|
470
|
+
toggleSidebar: () => e((t) => ({ sidebarCollapsed: !t.sidebarCollapsed })),
|
|
471
|
+
// useMenuViewStore.ts
|
|
472
|
+
reorderTabs: (t) => e((n) => {
|
|
473
|
+
const s = new Map(n.tabs.map((a) => [a.key, a]));
|
|
474
|
+
return { tabs: t.map((a) => s.get(a)).filter(Boolean) };
|
|
475
|
+
}),
|
|
476
|
+
// 개인정보 포함여부에 따른 탭 잠금 Flag 설정
|
|
477
|
+
setProtectFlagForKey: (t) => e((n) => ({
|
|
478
|
+
tabProtectFlag: { ...n.tabProtectFlag, [t]: !0 }
|
|
479
|
+
})),
|
|
480
|
+
// 개인정보 포함여부에 따른 탭 잠금 해제
|
|
481
|
+
clearProtectFlagForKey: (t) => e((n) => {
|
|
482
|
+
const s = { ...n.tabProtectFlag };
|
|
483
|
+
return delete s[t], { tabProtectFlag: s };
|
|
484
|
+
}),
|
|
485
|
+
// 탭 파라미터 설정
|
|
486
|
+
setTabParams: (t, n) => e((s) => {
|
|
487
|
+
const a = s.tabParams[t] || {}, i = { ...n || {} };
|
|
488
|
+
return Object.keys(a).length === Object.keys(i).length && Object.keys(i).every((d) => a[d] === i[d]) ? s : {
|
|
489
|
+
tabParams: { ...s.tabParams, [t]: i }
|
|
490
|
+
};
|
|
491
|
+
}),
|
|
492
|
+
// 컴포넌트 라벨 맵 설정
|
|
493
|
+
setComponentLabelMap: (t, n) => e({ componentLabelMap: t })
|
|
494
|
+
})), te = F((e) => ({
|
|
495
|
+
requestCount: 0,
|
|
496
|
+
loading: !1,
|
|
497
|
+
showLoading: () => e((r) => {
|
|
498
|
+
const t = r.requestCount + 1;
|
|
499
|
+
return { requestCount: t, loading: t > 0 };
|
|
500
|
+
}),
|
|
501
|
+
hideLoading: () => e((r) => {
|
|
502
|
+
const t = Math.max(0, r.requestCount - 1);
|
|
503
|
+
return { requestCount: t, loading: t > 0 };
|
|
504
|
+
})
|
|
505
|
+
})), re = F((e) => ({
|
|
506
|
+
requestCount: 0,
|
|
507
|
+
loading: !1,
|
|
508
|
+
showLoading: () => e((r) => {
|
|
509
|
+
const t = r.requestCount + 1;
|
|
510
|
+
return { requestCount: t, loading: t > 0 };
|
|
511
|
+
}),
|
|
512
|
+
hideLoading: () => e((r) => {
|
|
513
|
+
const t = Math.max(0, r.requestCount - 1);
|
|
514
|
+
return { requestCount: t, loading: t > 0 };
|
|
515
|
+
})
|
|
516
|
+
}));
|
|
517
|
+
var R = { exports: {} }, Qe = R.exports, fe;
|
|
518
|
+
function et() {
|
|
519
|
+
return fe || (fe = 1, (function(e, r) {
|
|
520
|
+
(function(t, n) {
|
|
521
|
+
e.exports = n($);
|
|
522
|
+
})(Qe, (function(t) {
|
|
523
|
+
function n(i) {
|
|
524
|
+
return i && typeof i == "object" && "default" in i ? i : { default: i };
|
|
525
|
+
}
|
|
526
|
+
var s = n(t), a = { name: "ko", weekdays: "일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"), weekdaysShort: "일_월_화_수_목_금_토".split("_"), weekdaysMin: "일_월_화_수_목_금_토".split("_"), months: "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), monthsShort: "1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"), ordinal: function(i) {
|
|
527
|
+
return i + "일";
|
|
528
|
+
}, formats: { LT: "A h:mm", LTS: "A h:mm:ss", L: "YYYY.MM.DD.", LL: "YYYY년 MMMM D일", LLL: "YYYY년 MMMM D일 A h:mm", LLLL: "YYYY년 MMMM D일 dddd A h:mm", l: "YYYY.MM.DD.", ll: "YYYY년 MMMM D일", lll: "YYYY년 MMMM D일 A h:mm", llll: "YYYY년 MMMM D일 dddd A h:mm" }, meridiem: function(i) {
|
|
529
|
+
return i < 12 ? "오전" : "오후";
|
|
530
|
+
}, relativeTime: { future: "%s 후", past: "%s 전", s: "몇 초", m: "1분", mm: "%d분", h: "한 시간", hh: "%d시간", d: "하루", dd: "%d일", M: "한 달", MM: "%d달", y: "일 년", yy: "%d년" } };
|
|
531
|
+
return s.default.locale(a, null, !0), a;
|
|
532
|
+
}));
|
|
533
|
+
})(R)), R.exports;
|
|
534
|
+
}
|
|
535
|
+
et();
|
|
536
|
+
var H = { exports: {} }, tt = H.exports, me;
|
|
537
|
+
function rt() {
|
|
538
|
+
return me || (me = 1, (function(e, r) {
|
|
539
|
+
(function(t, n) {
|
|
540
|
+
e.exports = n();
|
|
541
|
+
})(tt, (function() {
|
|
542
|
+
return function(t, n, s) {
|
|
543
|
+
t = t || {};
|
|
544
|
+
var a = n.prototype, i = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
545
|
+
function h(y, g, p, c) {
|
|
546
|
+
return a.fromToBase(y, g, p, c);
|
|
547
|
+
}
|
|
548
|
+
s.en.relativeTime = i, a.fromToBase = function(y, g, p, c, u) {
|
|
549
|
+
for (var l, o, f, v = p.$locale().relativeTime || i, m = t.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" }], M = m.length, w = 0; w < M; w += 1) {
|
|
550
|
+
var S = m[w];
|
|
551
|
+
S.d && (l = c ? s(y).diff(p, S.d, !0) : p.diff(y, S.d, !0));
|
|
552
|
+
var C = (t.rounding || Math.round)(Math.abs(l));
|
|
553
|
+
if (f = l > 0, C <= S.r || !S.r) {
|
|
554
|
+
C <= 1 && w > 0 && (S = m[w - 1]);
|
|
555
|
+
var I = v[S.l];
|
|
556
|
+
u && (C = u("" + C)), o = typeof I == "string" ? I.replace("%d", C) : I(C, g, S.l, f);
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (g) return o;
|
|
561
|
+
var _ = f ? v.future : v.past;
|
|
562
|
+
return typeof _ == "function" ? _(o) : _.replace("%s", o);
|
|
563
|
+
}, a.to = function(y, g) {
|
|
564
|
+
return h(y, g, this, !0);
|
|
565
|
+
}, a.from = function(y, g) {
|
|
566
|
+
return h(y, g, this);
|
|
567
|
+
};
|
|
568
|
+
var d = function(y) {
|
|
569
|
+
return y.$u ? s.utc() : s();
|
|
570
|
+
};
|
|
571
|
+
a.toNow = function(y) {
|
|
572
|
+
return this.to(d(this), y);
|
|
573
|
+
}, a.fromNow = function(y) {
|
|
574
|
+
return this.from(d(this), y);
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
}));
|
|
578
|
+
})(H)), H.exports;
|
|
579
|
+
}
|
|
580
|
+
var nt = rt();
|
|
581
|
+
const st = /* @__PURE__ */ se(nt);
|
|
582
|
+
var z = { exports: {} }, ot = z.exports, he;
|
|
583
|
+
function at() {
|
|
584
|
+
return he || (he = 1, (function(e, r) {
|
|
585
|
+
(function(t, n) {
|
|
586
|
+
e.exports = n();
|
|
587
|
+
})(ot, (function() {
|
|
588
|
+
var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, n = {};
|
|
589
|
+
return function(s, a, i) {
|
|
590
|
+
var h, d = function(c, u, l) {
|
|
591
|
+
l === void 0 && (l = {});
|
|
592
|
+
var o = new Date(c), f = (function(v, m) {
|
|
593
|
+
m === void 0 && (m = {});
|
|
594
|
+
var M = m.timeZoneName || "short", w = v + "|" + M, S = n[w];
|
|
595
|
+
return S || (S = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: v, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: M }), n[w] = S), S;
|
|
596
|
+
})(u, l);
|
|
597
|
+
return f.formatToParts(o);
|
|
598
|
+
}, y = function(c, u) {
|
|
599
|
+
for (var l = d(c, u), o = [], f = 0; f < l.length; f += 1) {
|
|
600
|
+
var v = l[f], m = v.type, M = v.value, w = t[m];
|
|
601
|
+
w >= 0 && (o[w] = parseInt(M, 10));
|
|
602
|
+
}
|
|
603
|
+
var S = o[3], C = S === 24 ? 0 : S, I = o[0] + "-" + o[1] + "-" + o[2] + " " + C + ":" + o[4] + ":" + o[5] + ":000", _ = +c;
|
|
604
|
+
return (i.utc(I).valueOf() - (_ -= _ % 1e3)) / 6e4;
|
|
605
|
+
}, g = a.prototype;
|
|
606
|
+
g.tz = function(c, u) {
|
|
607
|
+
c === void 0 && (c = h);
|
|
608
|
+
var l, o = this.utcOffset(), f = this.toDate(), v = f.toLocaleString("en-US", { timeZone: c }), m = Math.round((f - new Date(v)) / 1e3 / 60), M = 15 * -Math.round(f.getTimezoneOffset() / 15) - m;
|
|
609
|
+
if (!Number(M)) l = this.utcOffset(0, u);
|
|
610
|
+
else if (l = i(v, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(M, !0), u) {
|
|
611
|
+
var w = l.utcOffset();
|
|
612
|
+
l = l.add(o - w, "minute");
|
|
613
|
+
}
|
|
614
|
+
return l.$x.$timezone = c, l;
|
|
615
|
+
}, g.offsetName = function(c) {
|
|
616
|
+
var u = this.$x.$timezone || i.tz.guess(), l = d(this.valueOf(), u, { timeZoneName: c }).find((function(o) {
|
|
617
|
+
return o.type.toLowerCase() === "timezonename";
|
|
618
|
+
}));
|
|
619
|
+
return l && l.value;
|
|
620
|
+
};
|
|
621
|
+
var p = g.startOf;
|
|
622
|
+
g.startOf = function(c, u) {
|
|
623
|
+
if (!this.$x || !this.$x.$timezone) return p.call(this, c, u);
|
|
624
|
+
var l = i(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
625
|
+
return p.call(l, c, u).tz(this.$x.$timezone, !0);
|
|
626
|
+
}, i.tz = function(c, u, l) {
|
|
627
|
+
var o = l && u, f = l || u || h, v = y(+i(), f);
|
|
628
|
+
if (typeof c != "string") return i(c).tz(f);
|
|
629
|
+
var m = (function(C, I, _) {
|
|
630
|
+
var P = C - 60 * I * 1e3, E = y(P, _);
|
|
631
|
+
if (I === E) return [P, I];
|
|
632
|
+
var K = y(P -= 60 * (E - I) * 1e3, _);
|
|
633
|
+
return E === K ? [P, E] : [C - 60 * Math.min(E, K) * 1e3, Math.max(E, K)];
|
|
634
|
+
})(i.utc(c, o).valueOf(), v, f), M = m[0], w = m[1], S = i(M).utcOffset(w);
|
|
635
|
+
return S.$x.$timezone = f, S;
|
|
636
|
+
}, i.tz.guess = function() {
|
|
637
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
638
|
+
}, i.tz.setDefault = function(c) {
|
|
639
|
+
h = c;
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
}));
|
|
643
|
+
})(z)), z.exports;
|
|
644
|
+
}
|
|
645
|
+
var it = at();
|
|
646
|
+
const ct = /* @__PURE__ */ se(it);
|
|
647
|
+
var q = { exports: {} }, ut = q.exports, ge;
|
|
648
|
+
function lt() {
|
|
649
|
+
return ge || (ge = 1, (function(e, r) {
|
|
650
|
+
(function(t, n) {
|
|
651
|
+
e.exports = n();
|
|
652
|
+
})(ut, (function() {
|
|
653
|
+
var t = "minute", n = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
|
|
654
|
+
return function(a, i, h) {
|
|
655
|
+
var d = i.prototype;
|
|
656
|
+
h.utc = function(o) {
|
|
657
|
+
var f = { date: o, utc: !0, args: arguments };
|
|
658
|
+
return new i(f);
|
|
659
|
+
}, d.utc = function(o) {
|
|
660
|
+
var f = h(this.toDate(), { locale: this.$L, utc: !0 });
|
|
661
|
+
return o ? f.add(this.utcOffset(), t) : f;
|
|
662
|
+
}, d.local = function() {
|
|
663
|
+
return h(this.toDate(), { locale: this.$L, utc: !1 });
|
|
664
|
+
};
|
|
665
|
+
var y = d.parse;
|
|
666
|
+
d.parse = function(o) {
|
|
667
|
+
o.utc && (this.$u = !0), this.$utils().u(o.$offset) || (this.$offset = o.$offset), y.call(this, o);
|
|
668
|
+
};
|
|
669
|
+
var g = d.init;
|
|
670
|
+
d.init = function() {
|
|
671
|
+
if (this.$u) {
|
|
672
|
+
var o = this.$d;
|
|
673
|
+
this.$y = o.getUTCFullYear(), this.$M = o.getUTCMonth(), this.$D = o.getUTCDate(), this.$W = o.getUTCDay(), this.$H = o.getUTCHours(), this.$m = o.getUTCMinutes(), this.$s = o.getUTCSeconds(), this.$ms = o.getUTCMilliseconds();
|
|
674
|
+
} else g.call(this);
|
|
675
|
+
};
|
|
676
|
+
var p = d.utcOffset;
|
|
677
|
+
d.utcOffset = function(o, f) {
|
|
678
|
+
var v = this.$utils().u;
|
|
679
|
+
if (v(o)) return this.$u ? 0 : v(this.$offset) ? p.call(this) : this.$offset;
|
|
680
|
+
if (typeof o == "string" && (o = (function(S) {
|
|
681
|
+
S === void 0 && (S = "");
|
|
682
|
+
var C = S.match(n);
|
|
683
|
+
if (!C) return null;
|
|
684
|
+
var I = ("" + C[0]).match(s) || ["-", 0, 0], _ = I[0], P = 60 * +I[1] + +I[2];
|
|
685
|
+
return P === 0 ? 0 : _ === "+" ? P : -P;
|
|
686
|
+
})(o), o === null)) return this;
|
|
687
|
+
var m = Math.abs(o) <= 16 ? 60 * o : o;
|
|
688
|
+
if (m === 0) return this.utc(f);
|
|
689
|
+
var M = this.clone();
|
|
690
|
+
if (f) return M.$offset = m, M.$u = !1, M;
|
|
691
|
+
var w = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
692
|
+
return (M = this.local().add(m + w, t)).$offset = m, M.$x.$localOffset = w, M;
|
|
693
|
+
};
|
|
694
|
+
var c = d.format;
|
|
695
|
+
d.format = function(o) {
|
|
696
|
+
var f = o || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
697
|
+
return c.call(this, f);
|
|
698
|
+
}, d.valueOf = function() {
|
|
699
|
+
var o = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
700
|
+
return this.$d.valueOf() - 6e4 * o;
|
|
701
|
+
}, d.isUTC = function() {
|
|
702
|
+
return !!this.$u;
|
|
703
|
+
}, d.toISOString = function() {
|
|
704
|
+
return this.toDate().toISOString();
|
|
705
|
+
}, d.toString = function() {
|
|
706
|
+
return this.toDate().toUTCString();
|
|
707
|
+
};
|
|
708
|
+
var u = d.toDate;
|
|
709
|
+
d.toDate = function(o) {
|
|
710
|
+
return o === "s" && this.$offset ? h(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : u.call(this);
|
|
711
|
+
};
|
|
712
|
+
var l = d.diff;
|
|
713
|
+
d.diff = function(o, f, v) {
|
|
714
|
+
if (o && this.$u === o.$u) return l.call(this, o, f, v);
|
|
715
|
+
var m = this.local(), M = h(o).local();
|
|
716
|
+
return l.call(m, M, f, v);
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
}));
|
|
720
|
+
})(q)), q.exports;
|
|
721
|
+
}
|
|
722
|
+
var dt = lt();
|
|
723
|
+
const ft = /* @__PURE__ */ se(dt), mt = "ui_theme", ht = (e) => typeof e == "string", gt = (e) => typeof e == "number" && !isNaN(e), pt = (e) => typeof e == "boolean", yt = (e) => typeof e == "function", vt = (e) => e !== null && typeof e == "object", Mt = (e) => Array.isArray(e), St = (e) => e === null, wt = (e) => e === void 0, Tt = (e) => e == null, Ct = (e, r) => {
|
|
724
|
+
let t = 0;
|
|
725
|
+
return (...n) => {
|
|
726
|
+
const s = Date.now();
|
|
727
|
+
s - t >= r && (t = s, e(...n));
|
|
728
|
+
};
|
|
729
|
+
}, It = (e, r) => {
|
|
730
|
+
let t;
|
|
731
|
+
return (...n) => {
|
|
732
|
+
clearTimeout(t), t = setTimeout(() => e(...n), r);
|
|
733
|
+
};
|
|
734
|
+
}, _t = async (e) => {
|
|
735
|
+
try {
|
|
736
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
737
|
+
} catch (r) {
|
|
738
|
+
return console.error("Error copying to clipboard:", r), !1;
|
|
739
|
+
}
|
|
740
|
+
}, W = () => {
|
|
741
|
+
const e = window.innerWidth;
|
|
742
|
+
return e < 768 ? "mobile" : e < 1024 ? "tablet" : "desktop";
|
|
743
|
+
}, bt = () => W() === "mobile", xt = () => W() === "tablet", Dt = () => W() === "desktop", Pt = () => "#" + Math.floor(Math.random() * 16777215).toString(16), J = (e) => !e || e.length === 0, Ot = (e) => [...new Set(e)], Lt = (e) => {
|
|
744
|
+
if (!J(e))
|
|
745
|
+
return Math.max(...e);
|
|
746
|
+
}, $t = (e) => {
|
|
747
|
+
if (!J(e))
|
|
748
|
+
return Math.min(...e);
|
|
749
|
+
}, Nt = (e) => {
|
|
750
|
+
if (!J(e))
|
|
751
|
+
return e.reduce((r, t) => r + t, 0) / e.length;
|
|
752
|
+
}, Et = (e) => e.reduce((r, t) => r + t, 0), Ut = (e, r) => e.filter(r).length, At = (e) => [...e].reverse(), kt = (e) => {
|
|
753
|
+
const r = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
754
|
+
return e.forEach((n) => {
|
|
755
|
+
r.has(n) ? t.add(n) : r.add(n);
|
|
756
|
+
}), Array.from(t);
|
|
757
|
+
}, Yt = (e, r) => Math.random() * (r - e) + e, Ft = (e, r, t) => Math.min(Math.max(e, r), t), jt = (e, r = 0) => Math.round(e * Math.pow(10, r)) / Math.pow(10, r), Rt = (e, r) => {
|
|
758
|
+
try {
|
|
759
|
+
sessionStorage.setItem(e, JSON.stringify(r));
|
|
760
|
+
} catch (t) {
|
|
761
|
+
console.error("Error saving to sessionStorage:", t);
|
|
762
|
+
}
|
|
763
|
+
}, Ht = (e, r) => {
|
|
764
|
+
try {
|
|
765
|
+
const t = sessionStorage.getItem(e);
|
|
766
|
+
return t ? JSON.parse(t) : r || null;
|
|
767
|
+
} catch (t) {
|
|
768
|
+
return console.error("Error reading from sessionStorage:", t), r || null;
|
|
769
|
+
}
|
|
770
|
+
}, zt = (e) => {
|
|
771
|
+
try {
|
|
772
|
+
sessionStorage.removeItem(e);
|
|
773
|
+
} catch (r) {
|
|
774
|
+
console.error("Error removing from sessionStorage:", r);
|
|
775
|
+
}
|
|
776
|
+
}, qt = () => {
|
|
777
|
+
try {
|
|
778
|
+
sessionStorage.clear();
|
|
779
|
+
} catch (e) {
|
|
780
|
+
console.error("Error clearing sessionStorage:", e);
|
|
781
|
+
}
|
|
782
|
+
}, Bt = (e, r, t = 30) => {
|
|
783
|
+
const n = /* @__PURE__ */ new Date();
|
|
784
|
+
n.setTime(n.getTime() + t * 24 * 60 * 60 * 1e3), document.cookie = `${e}=${r};expires=${n.toUTCString()};path=/`;
|
|
785
|
+
}, Gt = (e) => {
|
|
786
|
+
const r = e + "=", t = document.cookie.split(";");
|
|
787
|
+
for (let n = 0; n < t.length; n++) {
|
|
788
|
+
let s = t[n];
|
|
789
|
+
for (; s.charAt(0) === " "; ) s = s.substring(1, s.length);
|
|
790
|
+
if (s.indexOf(r) === 0) return s.substring(r.length, s.length);
|
|
791
|
+
}
|
|
792
|
+
return null;
|
|
793
|
+
}, Wt = (e) => {
|
|
794
|
+
document.cookie = `${e}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/`;
|
|
795
|
+
}, Ce = (e) => typeof e != "string" ? !e : e.trim().length === 0, Jt = (e, r) => Ce(e) ? r : e || "", Kt = (e) => e.replace(/-([a-z])/g, (r) => r[1].toUpperCase()), Xt = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e), Zt = (e) => {
|
|
796
|
+
try {
|
|
797
|
+
return new URL(e), !0;
|
|
798
|
+
} catch {
|
|
799
|
+
return !1;
|
|
800
|
+
}
|
|
801
|
+
}, Vt = (e, r, t = " ") => e.padStart(r, t), Qt = (e, r, t = " ") => e.padEnd(r, t), Ie = (e, r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") => {
|
|
802
|
+
let t = "";
|
|
803
|
+
for (let n = 0; n < e; n++)
|
|
804
|
+
t += r.charAt(Math.floor(Math.random() * r.length));
|
|
805
|
+
return t;
|
|
806
|
+
}, er = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
807
|
+
const r = Math.random() * 16 | 0;
|
|
808
|
+
return (e === "x" ? r : r & 3 | 8).toString(16);
|
|
809
|
+
}), _e = (e = 32) => {
|
|
810
|
+
const t = er().replace(/-/g, "");
|
|
811
|
+
return e >= 32 ? t + Ie(e - 32, "0123456789abcdef") : t.substring(0, e);
|
|
812
|
+
};
|
|
813
|
+
async function tr(e) {
|
|
814
|
+
const [{ default: r }, { default: t }] = await Promise.all([
|
|
815
|
+
import("./sha256-BZfJs28k.js").then((n) => n.s),
|
|
816
|
+
import("./enc-base64-BQYwLKgk.js").then((n) => n.e)
|
|
817
|
+
]);
|
|
818
|
+
return r(e).toString(t);
|
|
819
|
+
}
|
|
820
|
+
$.extend(st);
|
|
821
|
+
$.extend(ft);
|
|
822
|
+
$.extend(ct);
|
|
823
|
+
$.locale("ko");
|
|
824
|
+
const rr = () => $(), nr = (e = "YYYY-MM-DD") => $().format(e), xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
825
|
+
__proto__: null,
|
|
826
|
+
THEME_COOKIE_NAME: mt,
|
|
827
|
+
arrAverage: Nt,
|
|
828
|
+
arrCount: Ut,
|
|
829
|
+
arrMax: Lt,
|
|
830
|
+
arrMin: $t,
|
|
831
|
+
arrReverse: At,
|
|
832
|
+
arrSum: Et,
|
|
833
|
+
arrUnique: Ot,
|
|
834
|
+
clamp: Ft,
|
|
835
|
+
clearSessionStorage: qt,
|
|
836
|
+
copyToClipboard: _t,
|
|
837
|
+
debounce: It,
|
|
838
|
+
deleteCookie: Wt,
|
|
839
|
+
duplicates: kt,
|
|
840
|
+
encryptSha256: tr,
|
|
841
|
+
generateRandomColor: Pt,
|
|
842
|
+
generateRandomString: Ie,
|
|
843
|
+
generateUID: _e,
|
|
844
|
+
getCookie: Gt,
|
|
845
|
+
getCurrentDate: rr,
|
|
846
|
+
getCurrentDateString: nr,
|
|
847
|
+
getDeviceType: W,
|
|
848
|
+
getSessionStorage: Ht,
|
|
849
|
+
isArray: Mt,
|
|
850
|
+
isBoolean: pt,
|
|
851
|
+
isDesktop: Dt,
|
|
852
|
+
isEmpty: Ce,
|
|
853
|
+
isEmptyArray: J,
|
|
854
|
+
isFunction: yt,
|
|
855
|
+
isMobile: bt,
|
|
856
|
+
isNull: St,
|
|
857
|
+
isNullOrUndefined: Tt,
|
|
858
|
+
isNumber: gt,
|
|
859
|
+
isObject: vt,
|
|
860
|
+
isSafeEmpty: Jt,
|
|
861
|
+
isString: ht,
|
|
862
|
+
isTablet: xt,
|
|
863
|
+
isUndefined: wt,
|
|
864
|
+
isValidEmail: Xt,
|
|
865
|
+
isValidUrl: Zt,
|
|
866
|
+
padLeft: Vt,
|
|
867
|
+
padRight: Qt,
|
|
868
|
+
random: Yt,
|
|
869
|
+
removeSessionStorage: zt,
|
|
870
|
+
round: jt,
|
|
871
|
+
setCookie: Bt,
|
|
872
|
+
setSessionStorage: Rt,
|
|
873
|
+
throttle: Ct,
|
|
874
|
+
toCamelCase: Kt
|
|
875
|
+
}, Symbol.toStringTag, { value: "Module" })), k = (() => {
|
|
876
|
+
try {
|
|
877
|
+
if (import.meta.env.DEV)
|
|
878
|
+
return !0;
|
|
879
|
+
} catch {
|
|
880
|
+
}
|
|
881
|
+
return !1;
|
|
882
|
+
})();
|
|
883
|
+
let be = [], xe = [];
|
|
884
|
+
function sr(e) {
|
|
885
|
+
e.devHosts && (be = e.devHosts), e.prodHosts && (xe = e.prodHosts);
|
|
886
|
+
}
|
|
887
|
+
function De() {
|
|
888
|
+
if (typeof window < "u" && window.location)
|
|
889
|
+
return window.location.hostname;
|
|
890
|
+
}
|
|
891
|
+
const Pe = (() => {
|
|
892
|
+
const e = De();
|
|
893
|
+
return !!(e && be.includes(e));
|
|
894
|
+
})(), Oe = (() => {
|
|
895
|
+
const e = De();
|
|
896
|
+
return !!(e && xe.includes(e));
|
|
897
|
+
})();
|
|
898
|
+
function or() {
|
|
899
|
+
return k ? "X" : Pe ? "D" : Oe ? "P" : "X";
|
|
900
|
+
}
|
|
901
|
+
const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
902
|
+
__proto__: null,
|
|
903
|
+
configureEnvUtils: sr,
|
|
904
|
+
getEnvCode: or,
|
|
905
|
+
isDev: Pe,
|
|
906
|
+
isLocal: k,
|
|
907
|
+
isProd: Oe
|
|
908
|
+
}, Symbol.toStringTag, { value: "Module" })), b = {
|
|
909
|
+
duration: 4.5,
|
|
910
|
+
// 4.5초
|
|
911
|
+
placement: "topRight"
|
|
912
|
+
};
|
|
913
|
+
class U {
|
|
914
|
+
constructor() {
|
|
915
|
+
}
|
|
916
|
+
static getInstance() {
|
|
917
|
+
return U.instance || (U.instance = new U()), U.instance;
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* BwgError 전용 에러 알림
|
|
921
|
+
* @param props - 에러 메시지 설정
|
|
922
|
+
*/
|
|
923
|
+
showBwgError(r) {
|
|
924
|
+
const {
|
|
925
|
+
message: t,
|
|
926
|
+
description: n,
|
|
927
|
+
duration: s = b.duration,
|
|
928
|
+
placement: a = b.placement
|
|
929
|
+
} = r;
|
|
930
|
+
L.error({
|
|
931
|
+
message: `${t}`,
|
|
932
|
+
description: n || "오류가 발생했습니다. 다시 시도해주세요.",
|
|
933
|
+
duration: s,
|
|
934
|
+
placement: a,
|
|
935
|
+
style: {
|
|
936
|
+
borderLeft: "4px solid #ff4d4f",
|
|
937
|
+
backgroundColor: "#fff2f0"
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* 성공 알림
|
|
943
|
+
*/
|
|
944
|
+
showSuccess(r, t, n) {
|
|
945
|
+
L.success({
|
|
946
|
+
message: `${r}`,
|
|
947
|
+
description: t,
|
|
948
|
+
duration: n || b.duration,
|
|
949
|
+
placement: b.placement
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* 정보 알림
|
|
954
|
+
*/
|
|
955
|
+
showInfo(r, t, n) {
|
|
956
|
+
L.info({
|
|
957
|
+
message: `${r}`,
|
|
958
|
+
description: t,
|
|
959
|
+
duration: n || b.duration,
|
|
960
|
+
placement: b.placement
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* 경고 알림
|
|
965
|
+
*/
|
|
966
|
+
showWarning(r, t, n) {
|
|
967
|
+
L.warning({
|
|
968
|
+
message: `${r}`,
|
|
969
|
+
description: t,
|
|
970
|
+
duration: n || b.duration,
|
|
971
|
+
placement: b.placement
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* 일반 에러 알림
|
|
976
|
+
*/
|
|
977
|
+
showError(r, t, n) {
|
|
978
|
+
L.error({
|
|
979
|
+
message: `${r}`,
|
|
980
|
+
description: t,
|
|
981
|
+
duration: n || b.duration,
|
|
982
|
+
placement: b.placement
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* 모든 알림 닫기
|
|
987
|
+
*/
|
|
988
|
+
destroy() {
|
|
989
|
+
L.destroy();
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* 특정 키의 알림 닫기
|
|
993
|
+
*/
|
|
994
|
+
close(r) {
|
|
995
|
+
L.destroy();
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
const O = U.getInstance(), ae = (e) => {
|
|
999
|
+
O.showBwgError(e);
|
|
1000
|
+
}, ar = (e, r, t) => {
|
|
1001
|
+
O.showSuccess(e, r, t);
|
|
1002
|
+
}, ie = (e, r, t) => {
|
|
1003
|
+
O.showInfo(e, r, t);
|
|
1004
|
+
}, ce = (e, r, t) => {
|
|
1005
|
+
O.showWarning(e, r, t);
|
|
1006
|
+
}, ir = (e, r, t) => {
|
|
1007
|
+
O.showError(e, r, t);
|
|
1008
|
+
}, cr = () => {
|
|
1009
|
+
O.destroy();
|
|
1010
|
+
}, ur = (e) => {
|
|
1011
|
+
O.close(e);
|
|
1012
|
+
}, Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1013
|
+
__proto__: null,
|
|
1014
|
+
closeNotification: ur,
|
|
1015
|
+
destroyNotifications: cr,
|
|
1016
|
+
notiBwgError: ae,
|
|
1017
|
+
notiError: ir,
|
|
1018
|
+
notiInfo: ie,
|
|
1019
|
+
notiSuccess: ar,
|
|
1020
|
+
notiWarning: ce,
|
|
1021
|
+
notificationService: O
|
|
1022
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1023
|
+
let x = null;
|
|
1024
|
+
const ue = async (e) => {
|
|
1025
|
+
if (x === null)
|
|
1026
|
+
if (e === void 0)
|
|
1027
|
+
try {
|
|
1028
|
+
let t = (await ne.get("/api/ip")).data.trim();
|
|
1029
|
+
t = t.replace(/\s+/g, ""), x = t;
|
|
1030
|
+
} catch (r) {
|
|
1031
|
+
console.warn("IP 가져오기 실패:", r), x = "unknown";
|
|
1032
|
+
}
|
|
1033
|
+
else
|
|
1034
|
+
x = e;
|
|
1035
|
+
}, lr = () => x, dr = async () => (console.log("IP 검증 비활성화됨 (성능 최적화)"), x || "unknown");
|
|
1036
|
+
class T extends Error {
|
|
1037
|
+
constructor(r, t, n, s, a) {
|
|
1038
|
+
super(r), this.name = "ApiError", this.detailMsg = t, this.response = n, this.msgCd = s, this.errorType = a, Error.captureStackTrace && Error.captureStackTrace(this, T);
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
const B = {
|
|
1042
|
+
method: "POST",
|
|
1043
|
+
timeout: 3e4,
|
|
1044
|
+
// 30초
|
|
1045
|
+
withCredentials: !0,
|
|
1046
|
+
// 쿠키 포함
|
|
1047
|
+
showLoading: !0,
|
|
1048
|
+
isPopup: !1,
|
|
1049
|
+
showError: !0,
|
|
1050
|
+
retryCount: 0,
|
|
1051
|
+
retryDelay: 1e3
|
|
1052
|
+
}, Y = ne.create({
|
|
1053
|
+
timeout: B.timeout,
|
|
1054
|
+
withCredentials: B.withCredentials,
|
|
1055
|
+
headers: {
|
|
1056
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
1057
|
+
Accept: "application/json; charset=utf-8",
|
|
1058
|
+
"Apm-Guid": _e()
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
Y.interceptors.request.use(
|
|
1062
|
+
(e) => {
|
|
1063
|
+
e.showLoading && !e.isPopup && te.getState().showLoading(), e.showLoading && e.isPopup && re.getState().showLoading();
|
|
1064
|
+
let r = "UNKNOWN";
|
|
1065
|
+
(/* @__PURE__ */ new Date()).getTime();
|
|
1066
|
+
try {
|
|
1067
|
+
e.data && e.data.header ? r = e.data.header.trxCd || "UNKNOWN" : e.params && e.params.header && (r = e.params.header.trxCd || "UNKNOWN");
|
|
1068
|
+
} catch (n) {
|
|
1069
|
+
console.warn("trxCd/guid 추출 실패:", n);
|
|
1070
|
+
}
|
|
1071
|
+
e.trxCd = r, e.requestStartTime = Date.now(), console.log(
|
|
1072
|
+
`🚀 API 요청 시작 [거래코드: ${r} / 서비스요청자: ${j()?.userId}]`
|
|
1073
|
+
);
|
|
1074
|
+
const t = localStorage.getItem("accessToken");
|
|
1075
|
+
return t && (e.headers.Authorization = `Bearer ${t}`), e.headers["Content-Type"] = "application/json; charset=UTF-8", e.headers.Accept = "application/json; charset=UTF-8", e;
|
|
1076
|
+
},
|
|
1077
|
+
(e) => (console.error("❌ 요청 인터셉터 에러:", e), Promise.reject(e))
|
|
1078
|
+
);
|
|
1079
|
+
Y.interceptors.response.use(
|
|
1080
|
+
(e) => {
|
|
1081
|
+
e.config.showLoading && !e.config.isPopup && te.getState().hideLoading(), e.config.isPopup && re.getState().hideLoading();
|
|
1082
|
+
let r = "UNKNOWN", t = "UNKNOWN";
|
|
1083
|
+
const n = (/* @__PURE__ */ new Date()).getTime();
|
|
1084
|
+
try {
|
|
1085
|
+
e.config.trxCd && (r = e.config.trxCd), e.config.guid ? t = e.config.guid : e.data && e.data.header && e.data.header.trxCd ? (r = e.data.header.trxCd, t = e.data.header.guid || "UNKNOWN") : e.config.data && e.config.data.header ? (r = e.config.data.header.trxCd || "UNKNOWN", t = e.config.data.header.guid || "UNKNOWN") : e.config.params && e.config.params.header && (r = e.config.params.header.trxCd || "UNKNOWN", t = e.config.params.header.guid || "UNKNOWN");
|
|
1086
|
+
} catch (a) {
|
|
1087
|
+
console.warn("trxCd/guid 추출 실패:", a);
|
|
1088
|
+
}
|
|
1089
|
+
let s = 0;
|
|
1090
|
+
return e.config.requestStartTime && (s = n - e.config.requestStartTime), console.log(
|
|
1091
|
+
`✅ API 응답 성공 [거래코드: ${r} / GUID : ${t}] - (소요시간: ${s}ms)`
|
|
1092
|
+
), e;
|
|
1093
|
+
},
|
|
1094
|
+
async (e) => {
|
|
1095
|
+
if (e.config && e.config.showLoading && !e.config.isPopup && te.getState().hideLoading(), e.config && e.config.isPopup && re.getState().hideLoading(), console.error("❌ API 응답 에러:", e), k && console.error("🚨 Error Details:", {
|
|
1096
|
+
message: e.message,
|
|
1097
|
+
status: e.response?.status,
|
|
1098
|
+
statusText: e.response?.statusText,
|
|
1099
|
+
data: e.response?.data,
|
|
1100
|
+
config: {
|
|
1101
|
+
url: e.config?.url,
|
|
1102
|
+
method: e.config?.method,
|
|
1103
|
+
baseURL: e.config?.baseURL
|
|
1104
|
+
}
|
|
1105
|
+
}), e.response?.status === 401) {
|
|
1106
|
+
const r = localStorage.getItem("refreshToken");
|
|
1107
|
+
if (r)
|
|
1108
|
+
try {
|
|
1109
|
+
const t = await ne.post("/auth/refresh", {
|
|
1110
|
+
refreshToken: r
|
|
1111
|
+
});
|
|
1112
|
+
if (t.data.accessToken) {
|
|
1113
|
+
localStorage.setItem(
|
|
1114
|
+
"accessToken",
|
|
1115
|
+
t.data.accessToken
|
|
1116
|
+
);
|
|
1117
|
+
const n = e.config;
|
|
1118
|
+
if (n)
|
|
1119
|
+
return n.headers.Authorization = `Bearer ${t.data.accessToken}`, Y(n);
|
|
1120
|
+
}
|
|
1121
|
+
} catch {
|
|
1122
|
+
localStorage.removeItem("accessToken"), localStorage.removeItem("refreshToken"), window.location.href = "/login";
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
return Promise.reject(e);
|
|
1126
|
+
}
|
|
1127
|
+
);
|
|
1128
|
+
const N = async (e, r, t) => {
|
|
1129
|
+
try {
|
|
1130
|
+
const n = {
|
|
1131
|
+
...B,
|
|
1132
|
+
...t
|
|
1133
|
+
}, { activeMenuId: s } = Te.getState();
|
|
1134
|
+
if (x === null) {
|
|
1135
|
+
const p = Date.now();
|
|
1136
|
+
await ue();
|
|
1137
|
+
const c = Date.now();
|
|
1138
|
+
console.log(`[INFO] IP 조회 소요시간: ${c - p}ms`);
|
|
1139
|
+
}
|
|
1140
|
+
const a = {
|
|
1141
|
+
method: n.method,
|
|
1142
|
+
url: "/api/service",
|
|
1143
|
+
timeout: n.timeout,
|
|
1144
|
+
withCredentials: n.withCredentials,
|
|
1145
|
+
showLoading: n.showLoading,
|
|
1146
|
+
isPopup: n.isPopup
|
|
1147
|
+
};
|
|
1148
|
+
n.headers && (a.headers = n.headers);
|
|
1149
|
+
const i = x || "unknown", h = __APP_CD__, d = __SYS_CD__, y = {
|
|
1150
|
+
header: {
|
|
1151
|
+
trxCd: e,
|
|
1152
|
+
userInfo: j(),
|
|
1153
|
+
clientIp: i,
|
|
1154
|
+
// 클라이언트 IP 추가 (서버에서 재확인 권장)
|
|
1155
|
+
domainId: "DEFAULT",
|
|
1156
|
+
appCd: h,
|
|
1157
|
+
sysCd: d,
|
|
1158
|
+
screenId: s
|
|
1159
|
+
},
|
|
1160
|
+
// data: bxmEncrypt(JSON.stringify(data)),
|
|
1161
|
+
data: r
|
|
1162
|
+
};
|
|
1163
|
+
n.method === "GET" ? a.params = y || n.params : (a.data = y || n.data, n.params && (a.params = n.params));
|
|
1164
|
+
let g;
|
|
1165
|
+
for (let p = 0; p <= (n.retryCount || 0); p++)
|
|
1166
|
+
try {
|
|
1167
|
+
const c = await Y(a);
|
|
1168
|
+
if (c.data.header?.resCd == 0) {
|
|
1169
|
+
for (const u in c.data)
|
|
1170
|
+
if (u !== "header")
|
|
1171
|
+
return c.data[u];
|
|
1172
|
+
return {};
|
|
1173
|
+
} else {
|
|
1174
|
+
const u = c.data.header, l = u?.msgs?.basicMsg || "요청 처리 중 오류가 발생했습니다.", o = u?.msgs?.detailMsgs || l, f = u?.msgCd, v = u?.msgs?.type;
|
|
1175
|
+
throw new T(l, o, c, f, v);
|
|
1176
|
+
}
|
|
1177
|
+
} catch (c) {
|
|
1178
|
+
if (c.isAxiosError && c.response) {
|
|
1179
|
+
const u = c, l = u.response, o = l.data, f = o?.header?.msgs?.basicMsg || u.message || // 실패 시 Axios 에러 메시지 사용
|
|
1180
|
+
"서버에서 오류가 발생했습니다.", v = o?.header?.msgs?.detailMsgs || // 상세 메시지로 응답 본문 제공 (문자열이 아니면 JSON으로 변환)
|
|
1181
|
+
(typeof l.data == "string" ? l.data : JSON.stringify(l.data)) || f, m = o?.header?.msgCd, M = o?.header?.msgs?.type;
|
|
1182
|
+
g = new T(
|
|
1183
|
+
f,
|
|
1184
|
+
v,
|
|
1185
|
+
l,
|
|
1186
|
+
m,
|
|
1187
|
+
M
|
|
1188
|
+
);
|
|
1189
|
+
} else
|
|
1190
|
+
g = c;
|
|
1191
|
+
if (c.isAxiosError && Le(c) && p < (n.retryCount || 0)) {
|
|
1192
|
+
await $e(n.retryDelay || 1e3);
|
|
1193
|
+
continue;
|
|
1194
|
+
}
|
|
1195
|
+
break;
|
|
1196
|
+
}
|
|
1197
|
+
if (g) {
|
|
1198
|
+
if (n.showError) {
|
|
1199
|
+
const p = g instanceof T ? g.message : "요청 처리 중 오류가 발생했습니다.", c = g instanceof T ? g.msgCd : "요청 처리 중 오류가 발생했습니다.", u = g instanceof T ? g.detailMsg : g.message, l = g instanceof T ? g.errorType : "";
|
|
1200
|
+
c?.startsWith("BXM") ? ae({
|
|
1201
|
+
message: p,
|
|
1202
|
+
description: u,
|
|
1203
|
+
duration: 5
|
|
1204
|
+
}) : l == "I" ? ie(p, u, 5) : ce(p, u, 5);
|
|
1205
|
+
}
|
|
1206
|
+
throw g;
|
|
1207
|
+
}
|
|
1208
|
+
throw new Error("알 수 없는 API 오류가 발생했습니다.");
|
|
1209
|
+
} catch (n) {
|
|
1210
|
+
throw console.error("callService 최종 에러:", n), n;
|
|
1211
|
+
}
|
|
1212
|
+
}, fr = async (e, r, t, n) => {
|
|
1213
|
+
try {
|
|
1214
|
+
const s = {
|
|
1215
|
+
...B,
|
|
1216
|
+
...n
|
|
1217
|
+
}, { activeMenuId: a } = Te.getState();
|
|
1218
|
+
if (x === null) {
|
|
1219
|
+
const c = Date.now();
|
|
1220
|
+
await ue();
|
|
1221
|
+
const u = Date.now();
|
|
1222
|
+
console.log(`[INFO] IP 조회 소요시간: ${u - c}ms`);
|
|
1223
|
+
}
|
|
1224
|
+
const i = {
|
|
1225
|
+
method: s.method,
|
|
1226
|
+
url: "/api/" + e + "/service",
|
|
1227
|
+
timeout: s.timeout,
|
|
1228
|
+
withCredentials: s.withCredentials,
|
|
1229
|
+
showLoading: s.showLoading,
|
|
1230
|
+
isPopup: s.isPopup
|
|
1231
|
+
};
|
|
1232
|
+
s.headers && (i.headers = s.headers);
|
|
1233
|
+
const h = x || "unknown", d = __APP_CD__, y = __SYS_CD__, g = {
|
|
1234
|
+
header: {
|
|
1235
|
+
trxCd: r,
|
|
1236
|
+
userInfo: j(),
|
|
1237
|
+
clientIp: h,
|
|
1238
|
+
// 클라이언트 IP 추가 (서버에서 재확인 권장)
|
|
1239
|
+
domainId: "DEFAULT",
|
|
1240
|
+
appCd: d,
|
|
1241
|
+
sysCd: y,
|
|
1242
|
+
screenId: a
|
|
1243
|
+
},
|
|
1244
|
+
// data: bxmEncrypt(JSON.stringify(data)),
|
|
1245
|
+
data: t
|
|
1246
|
+
};
|
|
1247
|
+
k && console.log("__BWG_LOCAL__ 테스트 입니다. ", k), s.method === "GET" ? i.params = g || s.params : (i.data = g || s.data, s.params && (i.params = s.params));
|
|
1248
|
+
let p;
|
|
1249
|
+
for (let c = 0; c <= (s.retryCount || 0); c++)
|
|
1250
|
+
try {
|
|
1251
|
+
const u = await Y(i);
|
|
1252
|
+
if (u.data.header?.resCd == 0) {
|
|
1253
|
+
for (const l in u.data)
|
|
1254
|
+
if (l !== "header")
|
|
1255
|
+
return u.data[l];
|
|
1256
|
+
return {};
|
|
1257
|
+
} else {
|
|
1258
|
+
const l = u.data.header, o = l?.msgs?.basicMsg || "요청 처리 중 오류가 발생했습니다.", f = l?.msgs?.detailMsgs || o, v = l?.msgCd, m = l?.msgs?.type;
|
|
1259
|
+
throw new T(o, f, u, v, m);
|
|
1260
|
+
}
|
|
1261
|
+
} catch (u) {
|
|
1262
|
+
if (u.isAxiosError && u.response) {
|
|
1263
|
+
const l = u, o = l.response, f = o.data, v = f?.header?.msgs?.basicMsg || l.message || // 실패 시 Axios 에러 메시지 사용
|
|
1264
|
+
"서버에서 오류가 발생했습니다.", m = f?.header?.msgs?.detailMsgs || // 상세 메시지로 응답 본문 제공 (문자열이 아니면 JSON으로 변환)
|
|
1265
|
+
(typeof o.data == "string" ? o.data : JSON.stringify(o.data)) || v, M = f?.header?.msgCd, w = f?.header?.msgs?.type;
|
|
1266
|
+
p = new T(
|
|
1267
|
+
v,
|
|
1268
|
+
m,
|
|
1269
|
+
o,
|
|
1270
|
+
M,
|
|
1271
|
+
w
|
|
1272
|
+
);
|
|
1273
|
+
} else
|
|
1274
|
+
p = u;
|
|
1275
|
+
if (u.isAxiosError && Le(u) && c < (s.retryCount || 0)) {
|
|
1276
|
+
await $e(s.retryDelay || 1e3);
|
|
1277
|
+
continue;
|
|
1278
|
+
}
|
|
1279
|
+
break;
|
|
1280
|
+
}
|
|
1281
|
+
if (p) {
|
|
1282
|
+
if (s.showError) {
|
|
1283
|
+
const c = p instanceof T ? p.message : "요청 처리 중 오류가 발생했습니다.", u = p instanceof T ? p.msgCd : "요청 처리 중 오류가 발생했습니다.", l = p instanceof T ? p.detailMsg : p.message, o = p instanceof T ? p.errorType : "";
|
|
1284
|
+
u?.startsWith("BXM") ? ae({
|
|
1285
|
+
message: c,
|
|
1286
|
+
description: l,
|
|
1287
|
+
duration: 5
|
|
1288
|
+
}) : o == "I" ? ie(c, l, 5) : ce(c, l, 5);
|
|
1289
|
+
}
|
|
1290
|
+
throw p;
|
|
1291
|
+
}
|
|
1292
|
+
throw new Error("알 수 없는 API 오류가 발생했습니다.");
|
|
1293
|
+
} catch (s) {
|
|
1294
|
+
throw console.error("callService 최종 에러:", s), s;
|
|
1295
|
+
}
|
|
1296
|
+
}, Le = (e) => !e.response || e.response.status >= 500 && e.response.status < 600, $e = (e) => new Promise((r) => setTimeout(r, e)), mr = (e, r, t) => N(e, r, { ...t, method: "GET" }), hr = (e, r, t) => N(e, r, { ...t, method: "POST" }), gr = (e, r, t) => N(e, r, { ...t, method: "PUT" }), pr = (e, r, t) => N(e, r, { ...t, method: "DELETE" }), yr = (e, r, t) => N(e, r, { ...t, method: "PATCH" }), vr = async (e, r, t) => {
|
|
1297
|
+
try {
|
|
1298
|
+
const n = await fetch("/api/permissions", {
|
|
1299
|
+
method: "POST",
|
|
1300
|
+
headers: {
|
|
1301
|
+
"Content-Type": "application/json"
|
|
1302
|
+
},
|
|
1303
|
+
body: JSON.stringify({
|
|
1304
|
+
userId: e,
|
|
1305
|
+
menuId: r,
|
|
1306
|
+
popupId: t
|
|
1307
|
+
})
|
|
1308
|
+
});
|
|
1309
|
+
if (!n.ok)
|
|
1310
|
+
throw new Error(`권한 확인 실패: ${n.status}`);
|
|
1311
|
+
return await n.json();
|
|
1312
|
+
} catch (n) {
|
|
1313
|
+
throw console.error("권한 확인 서비스 오류:", n), n;
|
|
1314
|
+
}
|
|
1315
|
+
}, Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1316
|
+
__proto__: null,
|
|
1317
|
+
ApiError: T,
|
|
1318
|
+
apiDelete: pr,
|
|
1319
|
+
apiGet: mr,
|
|
1320
|
+
apiPatch: yr,
|
|
1321
|
+
apiPost: hr,
|
|
1322
|
+
apiPut: gr,
|
|
1323
|
+
callService: N,
|
|
1324
|
+
callService_SYSCD: fr,
|
|
1325
|
+
getClientIp: lr,
|
|
1326
|
+
getPermissionService: vr,
|
|
1327
|
+
setClientIp: ue,
|
|
1328
|
+
verifyClientIp: dr
|
|
1329
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1330
|
+
export {
|
|
1331
|
+
Zt as $,
|
|
1332
|
+
T as A,
|
|
1333
|
+
Dt as B,
|
|
1334
|
+
Pt as C,
|
|
1335
|
+
J as D,
|
|
1336
|
+
Ot as E,
|
|
1337
|
+
Lt as F,
|
|
1338
|
+
$t as G,
|
|
1339
|
+
Nt as H,
|
|
1340
|
+
Et as I,
|
|
1341
|
+
Ut as J,
|
|
1342
|
+
At as K,
|
|
1343
|
+
kt as L,
|
|
1344
|
+
Yt as M,
|
|
1345
|
+
Ft as N,
|
|
1346
|
+
jt as O,
|
|
1347
|
+
Rt as P,
|
|
1348
|
+
Ht as Q,
|
|
1349
|
+
zt as R,
|
|
1350
|
+
qt as S,
|
|
1351
|
+
mt as T,
|
|
1352
|
+
Bt as U,
|
|
1353
|
+
Gt as V,
|
|
1354
|
+
Wt as W,
|
|
1355
|
+
Ce as X,
|
|
1356
|
+
Jt as Y,
|
|
1357
|
+
Kt as Z,
|
|
1358
|
+
Xt as _,
|
|
1359
|
+
fr as a,
|
|
1360
|
+
Vt as a0,
|
|
1361
|
+
Qt as a1,
|
|
1362
|
+
Ie as a2,
|
|
1363
|
+
_e as a3,
|
|
1364
|
+
tr as a4,
|
|
1365
|
+
rr as a5,
|
|
1366
|
+
nr as a6,
|
|
1367
|
+
k as a7,
|
|
1368
|
+
sr as a8,
|
|
1369
|
+
Pe as a9,
|
|
1370
|
+
j as aA,
|
|
1371
|
+
Be as aB,
|
|
1372
|
+
Ge as aC,
|
|
1373
|
+
We as aD,
|
|
1374
|
+
te as aE,
|
|
1375
|
+
re as aF,
|
|
1376
|
+
Ve as aG,
|
|
1377
|
+
Te as aH,
|
|
1378
|
+
D as aI,
|
|
1379
|
+
ke as aJ,
|
|
1380
|
+
Or as aK,
|
|
1381
|
+
xr as aL,
|
|
1382
|
+
Dr as aM,
|
|
1383
|
+
Pr as aN,
|
|
1384
|
+
_r as aO,
|
|
1385
|
+
br as aP,
|
|
1386
|
+
se as aQ,
|
|
1387
|
+
Ir as aR,
|
|
1388
|
+
Cr as aS,
|
|
1389
|
+
Oe as aa,
|
|
1390
|
+
or as ab,
|
|
1391
|
+
O as ac,
|
|
1392
|
+
ae as ad,
|
|
1393
|
+
ar as ae,
|
|
1394
|
+
ie as af,
|
|
1395
|
+
ce as ag,
|
|
1396
|
+
ir as ah,
|
|
1397
|
+
cr as ai,
|
|
1398
|
+
ur as aj,
|
|
1399
|
+
Ne as ak,
|
|
1400
|
+
oe as al,
|
|
1401
|
+
ye as am,
|
|
1402
|
+
Ee as an,
|
|
1403
|
+
Ye as ao,
|
|
1404
|
+
ve as ap,
|
|
1405
|
+
Me as aq,
|
|
1406
|
+
Fe as ar,
|
|
1407
|
+
je as as,
|
|
1408
|
+
Se as at,
|
|
1409
|
+
we as au,
|
|
1410
|
+
G as av,
|
|
1411
|
+
Re as aw,
|
|
1412
|
+
He as ax,
|
|
1413
|
+
ze as ay,
|
|
1414
|
+
qe as az,
|
|
1415
|
+
mr as b,
|
|
1416
|
+
N as c,
|
|
1417
|
+
hr as d,
|
|
1418
|
+
gr as e,
|
|
1419
|
+
pr as f,
|
|
1420
|
+
lr as g,
|
|
1421
|
+
yr as h,
|
|
1422
|
+
vr as i,
|
|
1423
|
+
ht as j,
|
|
1424
|
+
gt as k,
|
|
1425
|
+
pt as l,
|
|
1426
|
+
yt as m,
|
|
1427
|
+
vt as n,
|
|
1428
|
+
Mt as o,
|
|
1429
|
+
St as p,
|
|
1430
|
+
wt as q,
|
|
1431
|
+
Tt as r,
|
|
1432
|
+
ue as s,
|
|
1433
|
+
Ct as t,
|
|
1434
|
+
It as u,
|
|
1435
|
+
dr as v,
|
|
1436
|
+
_t as w,
|
|
1437
|
+
W as x,
|
|
1438
|
+
bt as y,
|
|
1439
|
+
xt as z
|
|
1440
|
+
};
|
|
1441
|
+
//# sourceMappingURL=apiUtils-DxzLqPhU.js.map
|