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