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