@owp/core 1.26.0 → 1.27.0

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 (69) hide show
  1. package/dist/Close-DA97hwNx.js +914 -0
  2. package/dist/Close-DA97hwNx.js.map +1 -0
  3. package/dist/{OwpStoreProvider-CqHkIIUm.js → OwpStoreProvider-BKRp9Maw.js} +2 -2
  4. package/dist/{OwpStoreProvider-CqHkIIUm.js.map → OwpStoreProvider-BKRp9Maw.js.map} +1 -1
  5. package/dist/{OwpUtils-DxEd-Pjo.js → OwpUtils-9lHSCdan.js} +10 -17
  6. package/dist/OwpUtils-9lHSCdan.js.map +1 -0
  7. package/dist/{QuickPanel-DNAisp_R.js → QuickPanel-EyvjMTxX.js} +2 -2
  8. package/dist/{QuickPanel-DNAisp_R.js.map → QuickPanel-EyvjMTxX.js.map} +1 -1
  9. package/dist/context.js +66 -22
  10. package/dist/context.js.map +1 -1
  11. package/dist/hooks.js +36 -36
  12. package/dist/{index-fDrAKBzK.js → index-CdxKoZlQ.js} +11866 -13172
  13. package/dist/index-CdxKoZlQ.js.map +1 -0
  14. package/dist/index.js +121 -127
  15. package/dist/index.js.map +1 -1
  16. package/dist/{isTypedArray-DPyC49cI.js → isTypedArray-xp-fB7W4.js} +3 -3
  17. package/dist/{isTypedArray-DPyC49cI.js.map → isTypedArray-xp-fB7W4.js.map} +1 -1
  18. package/dist/{lazyLoadedSlices-CsgnywgU.js → lazyLoadedSlices-Bjy1crVY.js} +679 -700
  19. package/dist/{lazyLoadedSlices-CsgnywgU.js.map → lazyLoadedSlices-Bjy1crVY.js.map} +1 -1
  20. package/dist/owp-app.css +1 -1
  21. package/dist/store.js +1 -1
  22. package/dist/{toUpper-BhzrnIm3.js → toUpper-CilZrxEa.js} +2 -2
  23. package/dist/{toUpper-BhzrnIm3.js.map → toUpper-CilZrxEa.js.map} +1 -1
  24. package/dist/{treeGridUtil-DaqTz5v3.js → treeGridUtil-_FDvRzzt.js} +2 -2
  25. package/dist/{treeGridUtil-DaqTz5v3.js.map → treeGridUtil-_FDvRzzt.js.map} +1 -1
  26. package/dist/types/components/{ErrorBoundary/ErrorBoundary.d.ts → OwpErrorBoundary/OwpErrorBoundary.d.ts} +5 -5
  27. package/dist/types/components/OwpErrorBoundary/index.d.ts +1 -0
  28. package/dist/types/components/OwpEventEmitter/OwpEventEmitter.d.ts +27 -0
  29. package/dist/types/components/OwpEventEmitter/index.d.ts +1 -0
  30. package/dist/types/components/OwpStyleProvider/OwpStyleProvider.d.ts +18 -0
  31. package/dist/types/components/OwpStyleProvider/index.d.ts +2 -0
  32. package/dist/types/context/OwpAppProvider.d.ts +5 -3
  33. package/dist/types/context/OwpUiProvider.d.ts +17 -0
  34. package/dist/types/context/index.d.ts +1 -0
  35. package/dist/types/index.d.ts +3 -9
  36. package/dist/types/utils/common/OwpUtils.d.ts +3 -4
  37. package/dist/types/utils/getTrimmedValue.d.ts +5 -0
  38. package/dist/types/utils/index.d.ts +1 -0
  39. package/dist/useOwpTranslation-VarZsCQ4.js +233 -0
  40. package/dist/useOwpTranslation-VarZsCQ4.js.map +1 -0
  41. package/dist/useTreeGridExcelExport-BGh2y8Cg.js +195 -0
  42. package/dist/useTreeGridExcelExport-BGh2y8Cg.js.map +1 -0
  43. package/dist/utils.js +717 -712
  44. package/dist/utils.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/OwpAppProvider-F48yHfyI.js +0 -22
  47. package/dist/OwpAppProvider-F48yHfyI.js.map +0 -1
  48. package/dist/OwpUtils-DxEd-Pjo.js.map +0 -1
  49. package/dist/index-fDrAKBzK.js.map +0 -1
  50. package/dist/types/components/ErrorBoundary/index.d.ts +0 -1
  51. package/dist/types/components/EventEmitter/EventEmitter.d.ts +0 -34
  52. package/dist/types/components/EventEmitter/index.d.ts +0 -1
  53. package/dist/types/components/OwpButtonDelete/OwpButtonDelete.d.ts +0 -12
  54. package/dist/types/components/OwpButtonDelete/index.d.ts +0 -1
  55. package/dist/types/components/OwpButtonSave/OwpButtonSave.d.ts +0 -12
  56. package/dist/types/components/OwpButtonSave/index.d.ts +0 -1
  57. package/dist/types/components/OwpPageSimple/OwpPageSimple.d.ts +0 -55
  58. package/dist/types/components/OwpPageSimple/OwpPageSimpleHeader.d.ts +0 -14
  59. package/dist/types/components/OwpPageSimple/OwpPageSimpleSidebar.d.ts +0 -19
  60. package/dist/types/components/OwpPageSimple/OwpPageSimpleSidebarContent.d.ts +0 -13
  61. package/dist/types/components/OwpPageSimple/index.d.ts +0 -1
  62. package/dist/types/components/OwpTreeView/OwpSlotTreeView.d.ts +0 -27
  63. package/dist/types/components/OwpTreeView/index.d.ts +0 -1
  64. package/dist/types/components/withRouterAndRef/index.d.ts +0 -1
  65. package/dist/types/components/withRouterAndRef/withRouterAndRef.d.ts +0 -14
  66. package/dist/useStorage-B4ZrPct1.js +0 -65
  67. package/dist/useStorage-B4ZrPct1.js.map +0 -1
  68. package/dist/useTreeGridExcelExport-BjyBdpz1.js +0 -360
  69. package/dist/useTreeGridExcelExport-BjyBdpz1.js.map +0 -1
@@ -0,0 +1,914 @@
1
+ var Jt = Object.defineProperty;
2
+ var r = (e, t) => Jt(e, "name", { value: t, configurable: !0 });
3
+ import { j as K, a as gt, b as Yt } from "./emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js";
4
+ import { b as At, a as qt, u as zt } from "./useOwpTranslation-VarZsCQ4.js";
5
+ import { createContext as It, useContext as Wt, useRef as d, useLayoutEffect as Ht, forwardRef as Kt, useEffect as w, useCallback as g, useMemo as Xt, Component as $t, useState as yt } from "react";
6
+ import { DialogContent as Zt, DialogActions as Qt, Dialog as en, DialogTitle as tn, Box as nn, Button as Et, Typography as rn } from "@mui/material";
7
+ import { useTranslation as on } from "react-i18next";
8
+ import { useNavigate as un, useLocation as an } from "react-router-dom";
9
+ import { createSvgIcon as sn } from "@mui/material/utils";
10
+ const kt = It(void 0), Xn = /* @__PURE__ */ r(({ configs: e, slots: t, children: n, env: i }) => {
11
+ const o = d({ ...e, env: i, slots: t }), { setEnv: l } = At();
12
+ return Ht(() => {
13
+ l(i ?? {});
14
+ }, [i, l]), /* @__PURE__ */ K(kt.Provider, { value: o.current, children: n });
15
+ }, "OwpAppProvider"), $n = /* @__PURE__ */ r(() => {
16
+ const e = Wt(kt);
17
+ if (e === void 0)
18
+ throw new Error("useOwpAppContext must be used within a OwpAppProvider");
19
+ return e;
20
+ }, "useOwpAppContext");
21
+ function Me(e) {
22
+ return typeof e == "number" || e instanceof Number;
23
+ }
24
+ r(Me, "isNumber");
25
+ const cn = Kt(
26
+ ({
27
+ title: e,
28
+ children: t,
29
+ canCancel: n = !0,
30
+ canConfirm: i = !0,
31
+ onConfirm: o,
32
+ onCancel: l,
33
+ onClose: s,
34
+ useSubmit: a,
35
+ actions: c,
36
+ contentProps: f,
37
+ ...y
38
+ }, _) => {
39
+ const { t: V, i18n: T } = on("owp"), A = (y == null ? void 0 : y.confirmText) ?? V(T.exists("button.save") ? "button.save" : "Button.저장", { defaultValue: "저장" }), m = (y == null ? void 0 : y.cancelText) ?? V(
40
+ i ? T.exists("button.cancel") ? "button.cancel" : "Button.취소" : "Button.닫기",
41
+ { defaultValue: i ? "취소" : "닫기" }
42
+ );
43
+ return /* @__PURE__ */ gt(
44
+ en,
45
+ {
46
+ ref: _,
47
+ fullWidth: !0,
48
+ component: a ? "form" : void 0,
49
+ onClose: /* @__PURE__ */ r((G, k) => {
50
+ k !== "backdropClick" && (s == null || s(G, k));
51
+ }, "onClose"),
52
+ ...y,
53
+ children: [
54
+ e && /* @__PURE__ */ K(tn, { children: e }),
55
+ /* @__PURE__ */ K(Zt, { dividers: !0, ...f, children: t }),
56
+ /* @__PURE__ */ gt(Qt, { children: [
57
+ c && /* @__PURE__ */ K(nn, { className: "flex w-full items-start", children: c }),
58
+ n && /* @__PURE__ */ K(
59
+ Et,
60
+ {
61
+ variant: "outlined",
62
+ onClick: /* @__PURE__ */ r(() => {
63
+ if (typeof l == "function") {
64
+ l();
65
+ return;
66
+ }
67
+ s == null || s({}, "escapeKeyDown");
68
+ }, "onClick"),
69
+ children: m
70
+ }
71
+ ),
72
+ i && /* @__PURE__ */ K(
73
+ Et,
74
+ {
75
+ variant: "contained",
76
+ color: "secondary",
77
+ type: a ? "submit" : "button",
78
+ onClick: /* @__PURE__ */ r(() => {
79
+ if (!a) {
80
+ if (typeof o == "function") {
81
+ o();
82
+ return;
83
+ }
84
+ s == null || s({}, "escapeKeyDown");
85
+ }
86
+ }, "onClick"),
87
+ children: A
88
+ }
89
+ )
90
+ ] })
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ );
96
+ var ln = Object.create, Lt = Object.defineProperty, fn = Object.getOwnPropertyDescriptor, hn = Object.getOwnPropertyNames, dn = Object.getPrototypeOf, vn = Object.prototype.hasOwnProperty, mn = /* @__PURE__ */ r(function(e, t) {
97
+ return function() {
98
+ return t || e((t = { exports: {} }).exports, t), t.exports;
99
+ };
100
+ }, "yr"), pn = /* @__PURE__ */ r(function(e, t, n, i) {
101
+ if (t && typeof t == "object" || typeof t == "function") for (var o = hn(t), l = 0, s = o.length, a; l < s; l++) a = o[l], !vn.call(e, a) && a !== n && Lt(e, a, { get: (function(c) {
102
+ return t[c];
103
+ }).bind(null, a), enumerable: !(i = fn(t, a)) || i.enumerable });
104
+ return e;
105
+ }, "gr"), gn = /* @__PURE__ */ r(function(e, t, n) {
106
+ return n = e != null ? ln(dn(e)) : {}, pn(!e || !e.__esModule ? Lt(n, "default", { value: e, enumerable: !0 }) : n, e);
107
+ }, "wr"), yn = mn(function(e, t) {
108
+ (function(n, i) {
109
+ typeof e == "object" && typeof t < "u" ? i(e) : typeof define == "function" && define.amd ? define(["exports"], i) : (n = typeof globalThis < "u" ? globalThis : n || self, i(n.fastUniqueNumbers = {}));
110
+ })(e, function(n) {
111
+ var i = /* @__PURE__ */ r(function(T) {
112
+ return function(A) {
113
+ var m = T(A);
114
+ return A.add(m), m;
115
+ };
116
+ }, "r"), o = /* @__PURE__ */ r(function(T) {
117
+ return function(A, m) {
118
+ return T.set(A, m), m;
119
+ };
120
+ }, "t"), l = Number.MAX_SAFE_INTEGER === void 0 ? 9007199254740991 : Number.MAX_SAFE_INTEGER, s = 536870912, a = s * 2, c = /* @__PURE__ */ r(function(T, A) {
121
+ return function(m) {
122
+ var G = A.get(m), k = G === void 0 ? m.size : G < a ? G + 1 : 0;
123
+ if (!m.has(k)) return T(m, k);
124
+ if (m.size < s) {
125
+ for (; m.has(k); ) k = Math.floor(Math.random() * a);
126
+ return T(m, k);
127
+ }
128
+ if (m.size > l) throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");
129
+ for (; m.has(k); ) k = Math.floor(Math.random() * l);
130
+ return T(m, k);
131
+ };
132
+ }, "s"), f = /* @__PURE__ */ new WeakMap(), y = o(f), _ = c(y, f), V = i(_);
133
+ n.addUniqueNumber = V, n.generateUniqueNumber = _;
134
+ });
135
+ });
136
+ function te(e) {
137
+ if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
138
+ return e;
139
+ }
140
+ r(te, "Y");
141
+ function St(e, t) {
142
+ return t != null && typeof Symbol < "u" && t[Symbol.hasInstance] ? !!t[Symbol.hasInstance](e) : St(e, t);
143
+ }
144
+ r(St, "je");
145
+ function ge(e, t) {
146
+ if (!St(e, t)) throw new TypeError("Cannot call a class as a function");
147
+ }
148
+ r(ge, "z");
149
+ function Ge(e, t) {
150
+ return Ge = Object.setPrototypeOf || function(n, i) {
151
+ return n.__proto__ = i, n;
152
+ }, Ge(e, t);
153
+ }
154
+ r(Ge, "De");
155
+ function Ot(e, t) {
156
+ if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
157
+ e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && Ge(e, t);
158
+ }
159
+ r(Ot, "Ke");
160
+ function b(e, t, n) {
161
+ return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
162
+ }
163
+ r(b, "h");
164
+ function Pe(e) {
165
+ return Pe = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
166
+ return t.__proto__ || Object.getPrototypeOf(t);
167
+ }, Pe(e);
168
+ }
169
+ r(Pe, "be");
170
+ function En() {
171
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
172
+ if (typeof Proxy == "function") return !0;
173
+ try {
174
+ return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
175
+ })), !0;
176
+ } catch {
177
+ return !1;
178
+ }
179
+ }
180
+ r(En, "Pt");
181
+ function Mt(e) {
182
+ "@swc/helpers - typeof";
183
+ return e && typeof Symbol < "u" && e.constructor === Symbol ? "symbol" : typeof e;
184
+ }
185
+ r(Mt, "Ne");
186
+ function bn(e, t) {
187
+ return t && (Mt(t) === "object" || typeof t == "function") ? t : te(e);
188
+ }
189
+ r(bn, "kt");
190
+ function Pt(e) {
191
+ var t = En();
192
+ return function() {
193
+ var n = Pe(e), i;
194
+ if (t) {
195
+ var o = Pe(this).constructor;
196
+ i = Reflect.construct(n, arguments, o);
197
+ } else i = n.apply(this, arguments);
198
+ return bn(this, i);
199
+ };
200
+ }
201
+ r(Pt, "Ze");
202
+ var wn = function(e) {
203
+ Ot(n, e);
204
+ var t = Pt(n);
205
+ function n() {
206
+ return ge(this, n), t.apply(this, arguments);
207
+ }
208
+ return r(n, "t"), n;
209
+ }($t);
210
+ (function(e) {
211
+ Ot(n, e);
212
+ var t = Pt(n);
213
+ function n(i) {
214
+ ge(this, n);
215
+ var o;
216
+ return o = t.call(this, i), o.onPresenceChange && i.setOnPresenceChange(o.onPresenceChange.bind(te(o))), o.onPrompt && i.setOnPrompt(o.onPrompt.bind(te(o))), o.onIdle && i.setOnIdle(o.onIdle.bind(te(o))), o.onActive && i.setOnActive(o.onActive.bind(te(o))), o.onAction && i.setOnAction(o.onAction.bind(te(o))), o.onMessage && i.setOnMessage(o.onMessage.bind(te(o))), o;
217
+ }
218
+ return r(n, "t"), n;
219
+ })(wn);
220
+ function Be(e, t) {
221
+ (t == null || t > e.length) && (t = e.length);
222
+ for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
223
+ return i;
224
+ }
225
+ r(Be, "Ee");
226
+ function Tn(e) {
227
+ if (Array.isArray(e)) return Be(e);
228
+ }
229
+ r(Tn, "At");
230
+ function An(e) {
231
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
232
+ }
233
+ r(An, "Rt");
234
+ function In() {
235
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
236
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
237
+ }
238
+ r(In, "Mt");
239
+ function kn(e, t) {
240
+ if (e) {
241
+ if (typeof e == "string") return Be(e, t);
242
+ var n = Object.prototype.toString.call(e).slice(8, -1);
243
+ if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(n);
244
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Be(e, t);
245
+ }
246
+ }
247
+ r(kn, "Ct");
248
+ function j(e) {
249
+ return Tn(e) || An(e) || kn(e) || In();
250
+ }
251
+ r(j, "O");
252
+ function Ln(e, t) {
253
+ for (var n = 0; n < t.length; n++) {
254
+ var i = t[n];
255
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
256
+ }
257
+ }
258
+ r(Ln, "jt");
259
+ function Ue(e, t, n) {
260
+ return t && Ln(e.prototype, t), e;
261
+ }
262
+ r(Ue, "ce");
263
+ gn(yn());
264
+ var z = (typeof window > "u" || typeof window > "u" ? "undefined" : Mt(window)) === "object", N = { setTimeout: z ? setTimeout.bind(window) : setTimeout, clearTimeout: z ? clearTimeout.bind(window) : clearTimeout, setInterval: z ? setInterval.bind(window) : setInterval, clearInterval: z ? clearInterval.bind(window) : clearInterval };
265
+ function Sn(e) {
266
+ N.setTimeout = e.setTimeout, N.clearTimeout = e.clearTimeout, N.setInterval = e.setInterval, N.clearInterval = e.clearInterval;
267
+ }
268
+ r(Sn, "Jt");
269
+ var ue = {}, On = function() {
270
+ function e(t) {
271
+ ge(this, e), b(this, "name", void 0), b(this, "closed", !1), b(this, "mc", new MessageChannel()), this.name = t, ue[t] = ue[t] || [], ue[t].push(this), this.mc.port1.start(), this.mc.port2.start(), this.onStorage = this.onStorage.bind(this), window.addEventListener("storage", this.onStorage);
272
+ }
273
+ return r(e, "e"), Ue(e, [{ key: "onStorage", value: /* @__PURE__ */ r(function(t) {
274
+ if (t.storageArea === window.localStorage && t.key.substring(0, this.name.length) === this.name && t.newValue !== null) {
275
+ var n = JSON.parse(t.newValue);
276
+ this.mc.port2.postMessage(n);
277
+ }
278
+ }, "value") }, { key: "postMessage", value: /* @__PURE__ */ r(function(t) {
279
+ var n = this;
280
+ if (this.closed) throw new Error("InvalidStateError");
281
+ var i = JSON.stringify(t), o = "".concat(this.name, ":").concat(String(Date.now())).concat(String(Math.random()));
282
+ window.localStorage.setItem(o, i), N.setTimeout(function() {
283
+ window.localStorage.removeItem(o);
284
+ }, 500), ue[this.name].forEach(function(l) {
285
+ l !== n && l.mc.port2.postMessage(JSON.parse(i));
286
+ });
287
+ }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
288
+ if (!this.closed) {
289
+ this.closed = !0, this.mc.port1.close(), this.mc.port2.close(), window.removeEventListener("storage", this.onStorage);
290
+ var t = ue[this.name].indexOf(this);
291
+ ue[this.name].splice(t, 1);
292
+ }
293
+ }, "value") }, { key: "onmessage", get: /* @__PURE__ */ r(function() {
294
+ return this.mc.port1.onmessage;
295
+ }, "get"), set: /* @__PURE__ */ r(function(t) {
296
+ this.mc.port1.onmessage = t;
297
+ }, "set") }, { key: "onmessageerror", get: /* @__PURE__ */ r(function() {
298
+ return this.mc.port1.onmessageerror;
299
+ }, "get"), set: /* @__PURE__ */ r(function(t) {
300
+ this.mc.port1.onmessageerror = t;
301
+ }, "set") }, { key: "addEventListener", value: /* @__PURE__ */ r(function(t, n) {
302
+ return this.mc.port1.addEventListener(t, n);
303
+ }, "value") }, { key: "removeEventListener", value: /* @__PURE__ */ r(function(t, n) {
304
+ return this.mc.port1.removeEventListener(t, n);
305
+ }, "value") }, { key: "dispatchEvent", value: /* @__PURE__ */ r(function(t) {
306
+ return this.mc.port1.dispatchEvent(t);
307
+ }, "value") }]), e;
308
+ }(), Mn = typeof window > "u" ? void 0 : typeof window.BroadcastChannel == "function" ? window.BroadcastChannel : On;
309
+ function bt(e, t, n, i, o, l, s) {
310
+ try {
311
+ var a = e[l](s), c = a.value;
312
+ } catch (f) {
313
+ n(f);
314
+ return;
315
+ }
316
+ a.done ? t(c) : Promise.resolve(c).then(i, o);
317
+ }
318
+ r(bt, "Xt");
319
+ function Pn(e) {
320
+ return function() {
321
+ var t = this, n = arguments;
322
+ return new Promise(function(i, o) {
323
+ var l = e.apply(t, n);
324
+ function s(c) {
325
+ bt(l, i, o, s, a, "next", c);
326
+ }
327
+ r(s, "s");
328
+ function a(c) {
329
+ bt(l, i, o, s, a, "throw", c);
330
+ }
331
+ r(a, "a"), s(void 0);
332
+ });
333
+ };
334
+ }
335
+ r(Pn, "$t");
336
+ function Rn(e, t) {
337
+ var n = /* @__PURE__ */ r(function(f) {
338
+ return function(y) {
339
+ return i([f, y]);
340
+ };
341
+ }, "t"), i = /* @__PURE__ */ r(function(f) {
342
+ if (l) throw new TypeError("Generator is already executing.");
343
+ for (; c && (c = 0, f[0] && (o = 0)), o; ) try {
344
+ if (l = 1, s && (a = f[0] & 2 ? s.return : f[0] ? s.throw || ((a = s.return) && a.call(s), 0) : s.next) && !(a = a.call(s, f[1])).done) return a;
345
+ switch (s = 0, a && (f = [f[0] & 2, a.value]), f[0]) {
346
+ case 0:
347
+ case 1:
348
+ a = f;
349
+ break;
350
+ case 4:
351
+ return o.label++, { value: f[1], done: !1 };
352
+ case 5:
353
+ o.label++, s = f[1], f = [0];
354
+ continue;
355
+ case 7:
356
+ f = o.ops.pop(), o.trys.pop();
357
+ continue;
358
+ default:
359
+ if (a = o.trys, !(a = a.length > 0 && a[a.length - 1]) && (f[0] === 6 || f[0] === 2)) {
360
+ o = 0;
361
+ continue;
362
+ }
363
+ if (f[0] === 3 && (!a || f[1] > a[0] && f[1] < a[3])) {
364
+ o.label = f[1];
365
+ break;
366
+ }
367
+ if (f[0] === 6 && o.label < a[1]) {
368
+ o.label = a[1], a = f;
369
+ break;
370
+ }
371
+ if (a && o.label < a[2]) {
372
+ o.label = a[2], o.ops.push(f);
373
+ break;
374
+ }
375
+ a[2] && o.ops.pop(), o.trys.pop();
376
+ continue;
377
+ }
378
+ f = t.call(e, o);
379
+ } catch (y) {
380
+ f = [6, y], s = 0;
381
+ } finally {
382
+ l = a = 0;
383
+ }
384
+ if (f[0] & 5) throw f[1];
385
+ return { value: f[0] ? f[1] : void 0, done: !0 };
386
+ }, "o"), o = { label: 0, sent: /* @__PURE__ */ r(function() {
387
+ if (a[0] & 1) throw a[1];
388
+ return a[1];
389
+ }, "sent"), trys: [], ops: [] }, l, s, a, c;
390
+ return c = { next: n(0), throw: n(1), return: n(2) }, typeof Symbol == "function" && (c[Symbol.iterator] = function() {
391
+ return this;
392
+ }), c;
393
+ }
394
+ r(Rn, "Ve");
395
+ function Cn() {
396
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
397
+ return new Promise(function(t) {
398
+ return N.setTimeout(t, e);
399
+ });
400
+ }
401
+ r(Cn, "Kt");
402
+ function Rt() {
403
+ return Math.random().toString(36).substring(2);
404
+ }
405
+ r(Rt, "Ge");
406
+ var v;
407
+ (function(e) {
408
+ e[e.APPLY = 0] = "APPLY", e[e.TELL = 1] = "TELL", e[e.CLOSE = 2] = "CLOSE", e[e.REGISTER = 3] = "REGISTER", e[e.DEREGISTER = 4] = "DEREGISTER", e[e.IDLE = 5] = "IDLE", e[e.ACTIVE = 6] = "ACTIVE", e[e.PROMPT = 7] = "PROMPT", e[e.START = 8] = "START", e[e.RESET = 9] = "RESET", e[e.ACTIVATE = 10] = "ACTIVATE", e[e.PAUSE = 11] = "PAUSE", e[e.RESUME = 12] = "RESUME", e[e.MESSAGE = 13] = "MESSAGE";
409
+ })(v || (v = {}));
410
+ var Dn = function() {
411
+ function e(t, n) {
412
+ ge(this, e), b(this, "options", void 0), b(this, "channel", void 0), b(this, "token", Rt()), b(this, "isLeader", !1), b(this, "isDead", !1), b(this, "isApplying", !1), b(this, "reApply", !1), b(this, "intervals", []), b(this, "listeners", []), b(this, "deferred", void 0), this.channel = t, this.options = n, this.apply = this.apply.bind(this), this.awaitLeadership = this.awaitLeadership.bind(this), this.sendAction = this.sendAction.bind(this);
413
+ }
414
+ return r(e, "e"), Ue(e, [{ key: "apply", value: /* @__PURE__ */ r(function() {
415
+ var t = this;
416
+ return Pn(function() {
417
+ var n, i;
418
+ return Rn(this, function(o) {
419
+ switch (o.label) {
420
+ case 0:
421
+ if (t.isLeader) return [2, !1];
422
+ if (t.isDead) return [2, !1];
423
+ if (t.isApplying) return t.reApply = !0, [2, !1];
424
+ t.isApplying = !0, n = !1, i = /* @__PURE__ */ r(function(l) {
425
+ var s = l.data, a = s.token, c = s.action;
426
+ a !== t.token && (c === v.APPLY && a > t.token && (n = !0), c === v.TELL && (n = !0));
427
+ }, "n"), t.channel.addEventListener("message", i), o.label = 1;
428
+ case 1:
429
+ return o.trys.push([1, 3, , 4]), t.sendAction(v.APPLY), [4, Cn(t.options.responseTime)];
430
+ case 2:
431
+ return o.sent(), t.channel.removeEventListener("message", i), t.isApplying = !1, n ? t.reApply ? [2, t.apply()] : [2, !1] : (t.assumeLead(), [2, !0]);
432
+ case 3:
433
+ return o.sent(), [2, !1];
434
+ case 4:
435
+ return [2];
436
+ }
437
+ });
438
+ })();
439
+ }, "value") }, { key: "awaitLeadership", value: /* @__PURE__ */ r(function() {
440
+ var t = this;
441
+ if (this.isLeader) return Promise.resolve();
442
+ var n = !1, i = null;
443
+ return new Promise(function(o) {
444
+ var l = /* @__PURE__ */ r(function() {
445
+ if (!n) {
446
+ n = !0;
447
+ try {
448
+ N.clearInterval(i);
449
+ } catch {
450
+ }
451
+ var a = t.intervals.indexOf(i);
452
+ a >= 0 && t.intervals.splice(a, 1), t.channel.removeEventListener("message", s), o();
453
+ }
454
+ }, "s");
455
+ i = N.setInterval(function() {
456
+ t.apply().then(function() {
457
+ t.isLeader && l();
458
+ });
459
+ }, t.options.fallbackInterval), t.intervals.push(i);
460
+ var s = /* @__PURE__ */ r(function(a) {
461
+ var c = a.data.action;
462
+ c === v.CLOSE && t.apply().then(function() {
463
+ t.isLeader && l();
464
+ });
465
+ }, "a");
466
+ t.channel.addEventListener("message", s);
467
+ });
468
+ }, "value") }, { key: "sendAction", value: /* @__PURE__ */ r(function(t) {
469
+ this.channel.postMessage({ action: t, token: this.token });
470
+ }, "value") }, { key: "assumeLead", value: /* @__PURE__ */ r(function() {
471
+ var t = this;
472
+ this.isLeader = !0;
473
+ var n = /* @__PURE__ */ r(function(i) {
474
+ var o = i.data.action;
475
+ o === v.APPLY && t.sendAction(v.TELL);
476
+ }, "o");
477
+ return this.channel.addEventListener("message", n), this.listeners.push(n), this.sendAction(v.TELL);
478
+ }, "value") }, { key: "waitForLeadership", value: /* @__PURE__ */ r(function() {
479
+ return this.deferred ? this.deferred : (this.deferred = this.awaitLeadership(), this.deferred);
480
+ }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
481
+ var t = this;
482
+ if (!this.isDead) {
483
+ this.isDead = !0, this.isLeader = !1, this.sendAction(v.CLOSE);
484
+ try {
485
+ this.listeners.forEach(function(n) {
486
+ return t.channel.removeEventListener("message", n);
487
+ }), this.intervals.forEach(function(n) {
488
+ return N.clearInterval(n);
489
+ });
490
+ } catch {
491
+ }
492
+ }
493
+ }, "value") }]), e;
494
+ }(), M;
495
+ (function(e) {
496
+ e[e.PROMPTED = 0] = "PROMPTED", e[e.ACTIVE = 1] = "ACTIVE", e[e.IDLE = 2] = "IDLE";
497
+ })(M || (M = {}));
498
+ var xn = function() {
499
+ function e(t) {
500
+ var n = this;
501
+ ge(this, e), b(this, "channel", void 0), b(this, "options", void 0), b(this, "elector", void 0), b(this, "token", Rt()), b(this, "registry", /* @__PURE__ */ new Map()), b(this, "allIdle", !1), b(this, "isLastActive", !1);
502
+ var i = t.channelName;
503
+ if (this.options = t, this.channel = new Mn(i), this.registry.set(this.token, M.ACTIVE), t.leaderElection) {
504
+ var o = { fallbackInterval: 2e3, responseTime: 100 };
505
+ this.elector = new Dn(this.channel, o), this.elector.waitForLeadership();
506
+ }
507
+ this.channel.addEventListener("message", function(l) {
508
+ var s = l.data, a = s.action, c = s.token, f = s.data;
509
+ switch (a) {
510
+ case v.REGISTER:
511
+ n.registry.set(c, M.IDLE);
512
+ break;
513
+ case v.DEREGISTER:
514
+ n.registry.delete(c);
515
+ break;
516
+ case v.IDLE:
517
+ n.idle(c);
518
+ break;
519
+ case v.ACTIVE:
520
+ n.active(c);
521
+ break;
522
+ case v.PROMPT:
523
+ n.prompt(c);
524
+ break;
525
+ case v.START:
526
+ n.start(c);
527
+ break;
528
+ case v.RESET:
529
+ n.reset(c);
530
+ break;
531
+ case v.ACTIVATE:
532
+ n.activate(c);
533
+ break;
534
+ case v.PAUSE:
535
+ n.pause(c);
536
+ break;
537
+ case v.RESUME:
538
+ n.resume(c);
539
+ break;
540
+ case v.MESSAGE:
541
+ n.options.onMessage(f);
542
+ break;
543
+ }
544
+ }), this.send(v.REGISTER);
545
+ }
546
+ return r(e, "e"), Ue(e, [{ key: "isLeader", get: /* @__PURE__ */ r(function() {
547
+ if (!this.elector) throw new Error('❌ Leader election is not enabled. To Enable it set the "leaderElection" property to true.');
548
+ return this.elector.isLeader;
549
+ }, "get") }, { key: "prompt", value: /* @__PURE__ */ r(function() {
550
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
551
+ this.registry.set(t, M.PROMPTED);
552
+ var n = j(this.registry.values()).every(function(i) {
553
+ return i === M.PROMPTED;
554
+ });
555
+ t === this.token && this.send(v.PROMPT), n && this.options.onPrompt();
556
+ }, "value") }, { key: "idle", value: /* @__PURE__ */ r(function() {
557
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
558
+ this.registry.set(t, M.IDLE);
559
+ var n = j(this.registry.values()).every(function(i) {
560
+ return i === M.IDLE;
561
+ });
562
+ t === this.token && this.send(v.IDLE), !this.allIdle && n && (this.allIdle = !0, this.options.onIdle());
563
+ }, "value") }, { key: "active", value: /* @__PURE__ */ r(function() {
564
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
565
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE);
566
+ var n = j(this.registry.values()).some(function(i) {
567
+ return i === M.ACTIVE;
568
+ });
569
+ t === this.token && this.send(v.ACTIVE), n && this.options.onActive(), this.isLastActive = t === this.token;
570
+ }, "value") }, { key: "start", value: /* @__PURE__ */ r(function() {
571
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
572
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(v.START) : this.options.start(!0), this.isLastActive = t === this.token;
573
+ }, "value") }, { key: "reset", value: /* @__PURE__ */ r(function() {
574
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
575
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(v.RESET) : this.options.reset(!0), this.isLastActive = t === this.token;
576
+ }, "value") }, { key: "activate", value: /* @__PURE__ */ r(function() {
577
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
578
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(v.ACTIVATE) : this.options.activate(!0), this.isLastActive = t === this.token;
579
+ }, "value") }, { key: "pause", value: /* @__PURE__ */ r(function() {
580
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
581
+ t === this.token ? this.send(v.PAUSE) : this.options.pause(!0);
582
+ }, "value") }, { key: "resume", value: /* @__PURE__ */ r(function() {
583
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
584
+ t === this.token ? this.send(v.RESUME) : this.options.resume(!0);
585
+ }, "value") }, { key: "message", value: /* @__PURE__ */ r(function(t) {
586
+ try {
587
+ this.channel.postMessage({ action: v.MESSAGE, token: this.token, data: t });
588
+ } catch {
589
+ }
590
+ }, "value") }, { key: "send", value: /* @__PURE__ */ r(function(t) {
591
+ try {
592
+ this.channel.postMessage({ action: t, token: this.token });
593
+ } catch {
594
+ }
595
+ }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
596
+ this.options.leaderElection && this.elector.close(), this.send(v.DEREGISTER), this.channel.close();
597
+ }, "value") }]), e;
598
+ }(), jn = z ? document : null, Nn = ["mousemove", "keydown", "wheel", "DOMMouseScroll", "mousewheel", "mousedown", "touchstart", "touchmove", "MSPointerDown", "MSPointerMove", "visibilitychange", "focus"];
599
+ function _n(e, t) {
600
+ var n = /* @__PURE__ */ r(function() {
601
+ for (var o = arguments.length, l = new Array(o), s = 0; s < o; s++) l[s] = arguments[s];
602
+ i && clearTimeout(i), i = setTimeout(function() {
603
+ e.apply(void 0, j(l)), i = null;
604
+ }, t);
605
+ }, "t"), i;
606
+ return n.cancel = function() {
607
+ clearTimeout(i);
608
+ }, n;
609
+ }
610
+ r(_n, "tr");
611
+ function Ve(e, t) {
612
+ var n = 0;
613
+ return function() {
614
+ for (var i = arguments.length, o = new Array(i), l = 0; l < i; l++) o[l] = arguments[l];
615
+ var s = (/* @__PURE__ */ new Date()).getTime();
616
+ if (!(s - n < t)) return n = s, e.apply(void 0, j(o));
617
+ };
618
+ }
619
+ r(Ve, "Fe");
620
+ var E = /* @__PURE__ */ r(function() {
621
+ return Date.now();
622
+ }, "g"), ae = 2147483647;
623
+ function Vn() {
624
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.timeout, n = t === void 0 ? 1e3 * 60 * 20 : t, i = e.promptTimeout, o = i === void 0 ? 0 : i, l = e.promptBeforeIdle, s = l === void 0 ? 0 : l, a = e.element, c = a === void 0 ? jn : a, f = e.events, y = f === void 0 ? Nn : f, _ = e.timers, V = _ === void 0 ? void 0 : _, T = e.immediateEvents, A = T === void 0 ? [] : T, m = e.onPresenceChange, G = m === void 0 ? function() {
625
+ } : m, k = e.onPrompt, ye = k === void 0 ? function() {
626
+ } : k, Fe = e.onIdle, Ee = Fe === void 0 ? function() {
627
+ } : Fe, Je = e.onActive, be = Je === void 0 ? function() {
628
+ } : Je, Ye = e.onAction, we = Ye === void 0 ? function() {
629
+ } : Ye, qe = e.onMessage, se = qe === void 0 ? function() {
630
+ } : qe, ze = e.debounce, ce = ze === void 0 ? 0 : ze, We = e.throttle, le = We === void 0 ? 0 : We, He = e.eventsThrottle, Re = He === void 0 ? 200 : He, Ke = e.startOnMount, fe = Ke === void 0 ? !0 : Ke, Xe = e.startManually, U = Xe === void 0 ? !1 : Xe, $e = e.stopOnIdle, Te = $e === void 0 ? !1 : $e, Ze = e.crossTab, ne = Ze === void 0 ? !1 : Ze, Qe = e.name, et = Qe === void 0 ? "idle-timer" : Qe, tt = e.syncTimers, he = tt === void 0 ? 0 : tt, nt = e.leaderElection, rt = nt === void 0 ? !1 : nt, it = e.disabled, B = it === void 0 ? !1 : it, ot = d(E()), Ae = d(E()), L = d(null), R = d(null), W = d(0), de = d(0), F = d(0), P = d(0), p = d(!1), I = d(!1), J = d(!1), Y = d(!0), ve = d(!1), q = d(null), h = d(null), C = d(n), X = d(0);
631
+ w(function() {
632
+ if (o && console.warn("⚠️ IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."), s && o) throw new Error("❌ Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");
633
+ if (n >= ae) throw new Error("❌ The value for the timeout property must fit in a 32 bit signed integer, ".concat(ae, "."));
634
+ if (o >= ae) throw new Error("❌ The value for the promptTimeout property must fit in a 32 bit signed integer, ".concat(ae, "."));
635
+ if (s >= ae) throw new Error("❌ The value for the promptBeforeIdle property must fit in a 32 bit signed integer, ".concat(ae, "."));
636
+ if (s >= n) throw new Error("❌ The value for the promptBeforeIdle property must be less than the timeout property, ".concat(n, "."));
637
+ if (s ? (C.current = n - s, X.current = s) : (C.current = n, X.current = o), !Y.current) {
638
+ if (U || B) return;
639
+ p.current && (re.current(null, O), h.current && h.current.active()), ee();
640
+ }
641
+ }, [n, o, s, U, B]);
642
+ var ut = d(Te);
643
+ w(function() {
644
+ ut.current = Te;
645
+ }, [Te]);
646
+ var at = d(A), me = d(c), Ce = d(j(new Set(j(y).concat(j(A))).values())), D = d(B);
647
+ w(function() {
648
+ D.current = B, !Y.current && (B ? Oe() : U || ee());
649
+ }, [B]);
650
+ var pe = d(G);
651
+ w(function() {
652
+ pe.current = G;
653
+ }, [G]);
654
+ var Ie = d(ye);
655
+ w(function() {
656
+ Ie.current = ye;
657
+ }, [ye]);
658
+ var ke = d(Ee);
659
+ w(function() {
660
+ ke.current = Ee;
661
+ }, [Ee]);
662
+ var re = d(be);
663
+ w(function() {
664
+ re.current = be;
665
+ }, [be]);
666
+ var Le = d(we);
667
+ w(function() {
668
+ Le.current = we;
669
+ }, [we]);
670
+ var ie = d(se);
671
+ w(function() {
672
+ ie.current = se;
673
+ }, [se]);
674
+ var $ = Xt(function() {
675
+ var u = /* @__PURE__ */ r(function(S, oe) {
676
+ return Le.current(S, oe);
677
+ }, "i");
678
+ return ce > 0 ? _n(u, ce) : le > 0 ? Ve(u, le) : u;
679
+ }, [le, ce]), st = d();
680
+ w(function() {
681
+ ne && he && (st.current = Ve(function() {
682
+ h.current.active();
683
+ }, he));
684
+ }, [ne, he]);
685
+ var x = /* @__PURE__ */ r(function() {
686
+ q.current !== null && (N.clearTimeout(q.current), q.current = null);
687
+ }, "N"), Z = /* @__PURE__ */ r(function(u) {
688
+ var S = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
689
+ x(), q.current = N.setTimeout(xe, u || C.current), S && (R.current = E());
690
+ }, "Z"), ct = /* @__PURE__ */ r(function(u) {
691
+ !I.current && !p.current && (Ie.current(u, O), pe.current({ type: "active", prompted: !0 }, O)), P.current = 0, F.current = E(), I.current = !0, Z(X.current, !1);
692
+ }, "wt"), lt = /* @__PURE__ */ r(function() {
693
+ x(), p.current || (ke.current(null, O), pe.current({ type: "idle" }, O)), p.current = !0, L.current = E(), ut.current ? Q() : I.current && (F.current = 0, I.current = !1);
694
+ }, "bt"), De = /* @__PURE__ */ r(function(u) {
695
+ x(), (p.current || I.current) && (re.current(u, O), pe.current({ type: "active", prompted: !1 }, O)), I.current = !1, F.current = 0, p.current = !1, W.current += E() - L.current, de.current += E() - L.current, H(), Z();
696
+ }, "ze"), xe = /* @__PURE__ */ r(function(u) {
697
+ var S = !p.current;
698
+ if (S) {
699
+ $.cancel && $.cancel();
700
+ var oe = E() - R.current, Ft = C.current + X.current < oe;
701
+ if (!Ft && X.current > 0 && !I.current) {
702
+ h.current ? h.current.prompt() : ct(u);
703
+ return;
704
+ }
705
+ h.current ? h.current.idle() : lt();
706
+ return;
707
+ }
708
+ h.current ? h.current.active() : De(u);
709
+ }, "Je"), je = /* @__PURE__ */ r(function(u) {
710
+ if (!fe && !R.current && (R.current = E(), re.current(null, O)), $(u, O), !I.current) {
711
+ if (x(), !p.current && at.current.includes(u.type)) {
712
+ xe(u);
713
+ return;
714
+ }
715
+ var S = E() - R.current;
716
+ if (p.current && !Te || !p.current && S >= C.current) {
717
+ xe(u);
718
+ return;
719
+ }
720
+ J.current = !1, P.current = 0, F.current = 0, Z(), ne && he && st.current();
721
+ }
722
+ }, "He"), Se = d(je);
723
+ w(function() {
724
+ var u = ve.current;
725
+ u && Q(), Re > 0 ? Se.current = Ve(je, Re) : Se.current = je, u && H();
726
+ }, [Re, le, ce, Le, ne, he]);
727
+ var H = /* @__PURE__ */ r(function() {
728
+ z && me.current && (ve.current || (Ce.current.forEach(function(u) {
729
+ me.current.addEventListener(u, Se.current, { capture: !0, passive: !0 });
730
+ }), ve.current = !0));
731
+ }, "H"), Q = /* @__PURE__ */ r(function() {
732
+ var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
733
+ z && me.current && (ve.current || u) && (Ce.current.forEach(function(S) {
734
+ me.current.removeEventListener(S, Se.current, { capture: !0 });
735
+ }), ve.current = !1);
736
+ }, "ee"), ee = g(function(u) {
737
+ return D.current ? !1 : (x(), H(), p.current = !1, I.current = !1, J.current = !1, P.current = 0, F.current = 0, h.current && !u && h.current.start(), Z(), !0);
738
+ }, [q, p, D, C, h]), Ne = g(function(u) {
739
+ return D.current ? !1 : (x(), H(), Ae.current = E(), W.current += E() - L.current, de.current += E() - L.current, W.current = 0, p.current = !1, I.current = !1, J.current = !1, P.current = 0, F.current = 0, h.current && !u && h.current.reset(), U || Z(), !0);
740
+ }, [q, p, C, U, D, h]), ft = g(function(u) {
741
+ return D.current ? !1 : (x(), H(), (p.current || I.current) && De(), p.current = !1, I.current = !1, J.current = !1, P.current = 0, F.current = 0, Ae.current = E(), h.current && !u && h.current.activate(), Z(), !0);
742
+ }, [q, p, I, D, C, h]), Oe = g(function() {
743
+ var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
744
+ return D.current || J.current ? !1 : (P.current = ht(), J.current = !0, Q(), x(), h.current && !u && h.current.pause(), !0);
745
+ }, [q, D, h]), _e = g(function() {
746
+ var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
747
+ return D.current || !J.current ? !1 : (J.current = !1, I.current || H(), p.current || Z(P.current), F.current && (F.current = E()), h.current && !u && h.current.resume(), !0);
748
+ }, [q, C, D, P, h]), Ct = g(function(u, S) {
749
+ return h.current ? (S && ie.current(u, O), h.current.message(u)) : S && ie.current(u, O), !0;
750
+ }, [se]), Dt = g(function() {
751
+ return p.current;
752
+ }, [p]), xt = g(function() {
753
+ return I.current;
754
+ }, [I]), jt = g(function() {
755
+ return h.current ? h.current.isLeader : null;
756
+ }, [h]), Nt = g(function() {
757
+ return h.current ? h.current.isLastActive : null;
758
+ }, [h]), _t = g(function() {
759
+ return h.current ? h.current.token : null;
760
+ }, [h]), ht = g(function() {
761
+ if (J.current) return P.current;
762
+ var u = P.current ? P.current : X.current + C.current, S = R.current ? E() - R.current : 0, oe = Math.floor(u - S);
763
+ return oe < 0 ? 0 : Math.abs(oe);
764
+ }, [C, X, I, P, R]), dt = g(function() {
765
+ return Math.round(E() - Ae.current);
766
+ }, [Ae]), vt = g(function() {
767
+ return Math.round(E() - ot.current);
768
+ }, [ot]), Vt = g(function() {
769
+ return L.current ? new Date(L.current) : null;
770
+ }, [L]), Gt = g(function() {
771
+ return R.current ? new Date(R.current) : null;
772
+ }, [R]), mt = g(function() {
773
+ return p.current ? Math.round(E() - L.current + W.current) : Math.round(W.current);
774
+ }, [L, W]), pt = g(function() {
775
+ return p.current ? Math.round(E() - L.current + de.current) : Math.round(de.current);
776
+ }, [L, de]), Bt = g(function() {
777
+ var u = Math.round(dt() - mt());
778
+ return u >= 0 ? u : 0;
779
+ }, [L, W]), Ut = g(function() {
780
+ var u = Math.round(vt() - pt());
781
+ return u >= 0 ? u : 0;
782
+ }, [L, W]);
783
+ w(function() {
784
+ if (ce > 0 && le > 0) throw new Error("❌ onAction can either be throttled or debounced, not both.");
785
+ V && Sn(V);
786
+ var u = /* @__PURE__ */ r(function() {
787
+ h.current && h.current.close(), $.cancel && $.cancel(), x(), Q(!0);
788
+ }, "i");
789
+ return z && window.addEventListener("beforeunload", u), function() {
790
+ z && window.removeEventListener("beforeunload", u), h.current && h.current.close(), $.cancel && $.cancel(), x(), Q(!0);
791
+ };
792
+ }, []), w(function() {
793
+ h.current && h.current.close(), ne ? h.current = new xn({ channelName: et, leaderElection: rt, onPrompt: /* @__PURE__ */ r(function() {
794
+ ct();
795
+ }, "onPrompt"), onIdle: /* @__PURE__ */ r(function() {
796
+ lt();
797
+ }, "onIdle"), onActive: /* @__PURE__ */ r(function() {
798
+ De();
799
+ }, "onActive"), onMessage: /* @__PURE__ */ r(function(u) {
800
+ ie.current(u, O);
801
+ }, "onMessage"), start: ee, reset: Ne, activate: ft, pause: Oe, resume: _e }) : h.current = null;
802
+ }, [ne, et, rt, Ie, ke, re, ie, ee, Ne, Oe, _e]), w(function() {
803
+ Y.current || (x(), Q(!0)), !(U || B) && (fe ? ee() : H());
804
+ }, [U, fe, B, Y]), w(function() {
805
+ if (!Y.current) {
806
+ var u = j(new Set(j(y).concat(j(A))).values());
807
+ if (Q(), Ce.current = u, me.current = c, at.current = A, U || B) return;
808
+ fe ? ee() : H();
809
+ }
810
+ }, [c, JSON.stringify(y), JSON.stringify(A), Y, B, U, fe]), w(function() {
811
+ Y.current && (Y.current = !1);
812
+ }, [Y]);
813
+ var O = { message: Ct, start: ee, reset: Ne, activate: ft, pause: Oe, resume: _e, isIdle: Dt, isPrompted: xt, isLeader: jt, isLastActiveTab: Nt, getTabId: _t, getRemainingTime: ht, getElapsedTime: dt, getTotalElapsedTime: vt, getLastIdleTime: Vt, getLastActiveTime: Gt, getIdleTime: mt, getTotalIdleTime: pt, getActiveTime: Bt, getTotalActiveTime: Ut, setOnPresenceChange: /* @__PURE__ */ r(function(u) {
814
+ G = u, pe.current = u;
815
+ }, "setOnPresenceChange"), setOnPrompt: /* @__PURE__ */ r(function(u) {
816
+ ye = u, Ie.current = u;
817
+ }, "setOnPrompt"), setOnIdle: /* @__PURE__ */ r(function(u) {
818
+ Ee = u, ke.current = u;
819
+ }, "setOnIdle"), setOnActive: /* @__PURE__ */ r(function(u) {
820
+ be = u, re.current = u;
821
+ }, "setOnActive"), setOnAction: /* @__PURE__ */ r(function(u) {
822
+ we = u, Le.current = u;
823
+ }, "setOnAction"), setOnMessage: /* @__PURE__ */ r(function(u) {
824
+ se = u, ie.current = u;
825
+ }, "setOnMessage") };
826
+ return O;
827
+ }
828
+ r(Vn, "Te");
829
+ var Gn = It(null);
830
+ Gn.Consumer;
831
+ const wt = 6e4, Bn = 36e5, Tt = "/auth/login";
832
+ function Un(e) {
833
+ return Me(e) ? Math.floor(e / 1e3) : "";
834
+ }
835
+ r(Un, "millisToSeconds");
836
+ function Zn({ timeout: e }) {
837
+ const t = un(), { pathname: n } = an(), { t: i } = qt(), { confirmInfo: o } = zt(), { resetStorage: l } = At(), [s, a] = yt(!1), [c, f] = yt(null), y = d(!1), { getRemainingTime: _, reset: V } = Vn({
838
+ timeout: e ?? Bn,
839
+ events: [
840
+ "mousemove",
841
+ "keydown",
842
+ "wheel",
843
+ "DOMMouseScroll",
844
+ "mousewheel",
845
+ "mousedown",
846
+ "touchstart",
847
+ "touchmove",
848
+ "MSPointerDown",
849
+ "MSPointerMove",
850
+ "visibilitychange"
851
+ ],
852
+ throttle: 500
853
+ });
854
+ w(() => {
855
+ const m = setInterval(() => {
856
+ f(_());
857
+ }, 500);
858
+ return () => {
859
+ clearInterval(m);
860
+ };
861
+ }, [_]);
862
+ const T = g(() => {
863
+ a(!1), V();
864
+ }, [V]), A = g(async () => {
865
+ y.current || (y.current = !0, f(null), a(!1), await o({
866
+ title: i("Message.로그인 페이지로 이동합니다.", {
867
+ defaultValue: "로그인 페이지로 이동합니다."
868
+ })
869
+ }), l(), t(Tt));
870
+ }, [o, t, l, i]);
871
+ return w(() => {
872
+ if (n === Tt) {
873
+ a(!1);
874
+ return;
875
+ }
876
+ if (!s && Me(c) && c > 0 && c <= wt) {
877
+ a(!0);
878
+ return;
879
+ }
880
+ if (s && Me(c) && c > wt) {
881
+ T();
882
+ return;
883
+ }
884
+ Me(c) && c <= 0 && A();
885
+ }, [s, c, n, T, A]), /* @__PURE__ */ K(
886
+ cn,
887
+ {
888
+ title: i("Title.로그인 연장", { defaultValue: "로그인 연장" }),
889
+ canConfirm: !1,
890
+ open: s,
891
+ onClose: /* @__PURE__ */ r(() => T(), "onClose"),
892
+ maxWidth: "xs",
893
+ fullWidth: !0,
894
+ children: /* @__PURE__ */ K(rn, { variant: "h6", children: i("Message.자동 로그아웃 남은 시간 안내", {
895
+ defaultValue: "{{seconds}}초 후 로그인 페이지로 이동합니다.",
896
+ seconds: Un(c)
897
+ }) })
898
+ }
899
+ );
900
+ }
901
+ r(Zn, "OwpAutoLogoutDialog");
902
+ const Qn = sn(/* @__PURE__ */ Yt.jsx("path", {
903
+ d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
904
+ }), "Close");
905
+ export {
906
+ Qn as C,
907
+ Xn as O,
908
+ Zn as a,
909
+ kt as b,
910
+ cn as c,
911
+ Me as i,
912
+ $n as u
913
+ };
914
+ //# sourceMappingURL=Close-DA97hwNx.js.map