@lokalise/harmony 1.5.6 → 1.6.0-exp-jwtutils.1
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/harmony.cjs +1 -1
- package/dist/harmony.mjs +514 -372
- package/dist/types/src/features/auth/core/jwtAuthAddon.d.ts +6 -0
- package/dist/types/src/features/auth/core/jwtTokenPayload.d.ts +48 -0
- package/dist/types/src/features/auth/core/jwtTokenPayload.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +7 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/service/authService.d.ts +40 -0
- package/dist/types/src/features/auth/core/service/contributors.d.ts +205 -0
- package/dist/types/src/features/auth/core/service/teamUsersService.d.ts +128 -0
- package/dist/types/src/features/auth/core/types/teamRole.d.ts +3 -0
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +3 -0
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.test.d.ts +1 -0
- package/dist/types/src/features/auth/frontend/addon/browserJwtAuthAddon.d.ts +15 -0
- package/dist/types/src/features/auth/frontend/events/NewJwtIssuedEvent.d.ts +17 -0
- package/dist/types/src/features/auth/frontend/hooks/services/useGetUserTokenQuery.d.ts +10 -0
- package/dist/types/src/features/auth/frontend/hooks/services/useRetrieveContributorQuery.d.ts +25 -0
- package/dist/types/src/features/auth/frontend/hooks/services/userGetTeamUsersQuery.d.ts +17 -0
- package/dist/types/src/features/auth/frontend/hooks/utility/useAuthenticatedProjectContributor.d.ts +23 -0
- package/dist/types/src/features/auth/frontend/hooks/utility/useAuthenticatedUser.d.ts +15 -0
- package/dist/types/src/features/auth/frontend/hooks/utility/useGetPromotedClassicSessionJwtQuery.d.ts +8 -0
- package/dist/types/src/features/auth/frontend/hooks/utility/useJwtTokenPayload.d.ts +16 -0
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts +6 -0
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.test.d.ts +1 -0
- package/dist/types/src/features/auth/frontend/utils/cookieToken.d.ts +2 -0
- package/dist/types/src/features/auth/frontend/utils/tokenStorage.d.ts +7 -0
- package/dist/types/src/node.d.ts +9 -0
- package/dist/types/src/utils/types/apiQueryOverrides.d.ts +2 -0
- package/dist/types/tests/utils.d.ts +6 -1
- package/package.json +14 -3
package/dist/harmony.mjs
CHANGED
@@ -1,265 +1,272 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import {
|
1
|
+
var gn = Object.defineProperty;
|
2
|
+
var bn = (e, n, t) => n in e ? gn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
3
|
+
var ve = (e, n, t) => bn(e, typeof n != "symbol" ? n + "" : n, t);
|
4
|
+
import { jsx as i, jsxs as _, Fragment as Je } from "react/jsx-runtime";
|
5
|
+
import * as x from "react";
|
6
|
+
import { useRef as Ge, useState as Ke, useCallback as Te, useEffect as W, useContext as pn, createContext as _n, cloneElement as vn, Fragment as Ve, forwardRef as Tn } from "react";
|
7
|
+
import { Tooltip as le, Link as Ye, Menu as ue, MenuList as de, CaretUpIcon as wn, UserIcon as Qe, MenuItem as F, MenuDivider as Ze, Tag as yn } from "@lokalise/louis";
|
8
|
+
import { z as f } from "zod";
|
9
|
+
import { sendByPayloadRoute as fe } from "@lokalise/frontend-http-client";
|
10
|
+
import { useQuery as In } from "@tanstack/react-query";
|
11
|
+
import { buildPayloadRoute as Nn } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
12
|
+
import { format as Xe } from "date-fns";
|
13
|
+
import { toZonedTime as Sn } from "date-fns-tz";
|
7
14
|
var B = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
8
|
-
function
|
15
|
+
function en(e) {
|
9
16
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
10
17
|
}
|
11
|
-
var
|
12
|
-
function
|
13
|
-
if (
|
14
|
-
|
18
|
+
var J, we;
|
19
|
+
function me() {
|
20
|
+
if (we) return J;
|
21
|
+
we = 1;
|
15
22
|
function e(n) {
|
16
23
|
var t = typeof n;
|
17
24
|
return n != null && (t == "object" || t == "function");
|
18
25
|
}
|
19
|
-
return
|
26
|
+
return J = e, J;
|
20
27
|
}
|
21
|
-
var
|
22
|
-
function
|
23
|
-
if (
|
24
|
-
|
28
|
+
var G, ye;
|
29
|
+
function kn() {
|
30
|
+
if (ye) return G;
|
31
|
+
ye = 1;
|
25
32
|
var e = typeof B == "object" && B && B.Object === Object && B;
|
26
|
-
return
|
33
|
+
return G = e, G;
|
27
34
|
}
|
28
|
-
var
|
29
|
-
function
|
30
|
-
if (
|
31
|
-
|
32
|
-
var e =
|
33
|
-
return
|
35
|
+
var K, Ie;
|
36
|
+
function nn() {
|
37
|
+
if (Ie) return K;
|
38
|
+
Ie = 1;
|
39
|
+
var e = kn(), n = typeof self == "object" && self && self.Object === Object && self, t = e || n || Function("return this")();
|
40
|
+
return K = t, K;
|
34
41
|
}
|
35
|
-
var
|
36
|
-
function
|
37
|
-
if (
|
38
|
-
|
39
|
-
var e =
|
42
|
+
var V, Ne;
|
43
|
+
function Pn() {
|
44
|
+
if (Ne) return V;
|
45
|
+
Ne = 1;
|
46
|
+
var e = nn(), n = function() {
|
40
47
|
return e.Date.now();
|
41
48
|
};
|
42
|
-
return
|
49
|
+
return V = n, V;
|
43
50
|
}
|
44
|
-
var
|
45
|
-
function
|
46
|
-
if (
|
47
|
-
|
51
|
+
var Y, Se;
|
52
|
+
function En() {
|
53
|
+
if (Se) return Y;
|
54
|
+
Se = 1;
|
48
55
|
var e = /\s/;
|
49
56
|
function n(t) {
|
50
57
|
for (var r = t.length; r-- && e.test(t.charAt(r)); )
|
51
58
|
;
|
52
59
|
return r;
|
53
60
|
}
|
54
|
-
return
|
61
|
+
return Y = n, Y;
|
55
62
|
}
|
56
|
-
var
|
57
|
-
function
|
58
|
-
if (
|
59
|
-
|
60
|
-
var e =
|
63
|
+
var Q, ke;
|
64
|
+
function jn() {
|
65
|
+
if (ke) return Q;
|
66
|
+
ke = 1;
|
67
|
+
var e = En(), n = /^\s+/;
|
61
68
|
function t(r) {
|
62
69
|
return r && r.slice(0, e(r) + 1).replace(n, "");
|
63
70
|
}
|
64
|
-
return
|
71
|
+
return Q = t, Q;
|
65
72
|
}
|
66
|
-
var
|
67
|
-
function
|
68
|
-
if (
|
69
|
-
|
70
|
-
var e =
|
71
|
-
return
|
73
|
+
var Z, Pe;
|
74
|
+
function tn() {
|
75
|
+
if (Pe) return Z;
|
76
|
+
Pe = 1;
|
77
|
+
var e = nn(), n = e.Symbol;
|
78
|
+
return Z = n, Z;
|
72
79
|
}
|
73
|
-
var
|
74
|
-
function
|
75
|
-
if (
|
76
|
-
|
77
|
-
var e =
|
78
|
-
function o(
|
79
|
-
var l = t.call(
|
80
|
+
var X, Ee;
|
81
|
+
function Cn() {
|
82
|
+
if (Ee) return X;
|
83
|
+
Ee = 1;
|
84
|
+
var e = tn(), n = Object.prototype, t = n.hasOwnProperty, r = n.toString, a = e ? e.toStringTag : void 0;
|
85
|
+
function o(s) {
|
86
|
+
var l = t.call(s, a), u = s[a];
|
80
87
|
try {
|
81
|
-
|
82
|
-
var
|
88
|
+
s[a] = void 0;
|
89
|
+
var c = !0;
|
83
90
|
} catch {
|
84
91
|
}
|
85
|
-
var d = r.call(
|
86
|
-
return
|
92
|
+
var d = r.call(s);
|
93
|
+
return c && (l ? s[a] = u : delete s[a]), d;
|
87
94
|
}
|
88
|
-
return
|
95
|
+
return X = o, X;
|
89
96
|
}
|
90
|
-
var
|
91
|
-
function
|
92
|
-
if (
|
93
|
-
|
97
|
+
var ee, je;
|
98
|
+
function An() {
|
99
|
+
if (je) return ee;
|
100
|
+
je = 1;
|
94
101
|
var e = Object.prototype, n = e.toString;
|
95
102
|
function t(r) {
|
96
103
|
return n.call(r);
|
97
104
|
}
|
98
|
-
return
|
105
|
+
return ee = t, ee;
|
99
106
|
}
|
100
|
-
var
|
101
|
-
function
|
102
|
-
if (
|
103
|
-
|
104
|
-
var e =
|
105
|
-
function
|
107
|
+
var ne, Ce;
|
108
|
+
function Rn() {
|
109
|
+
if (Ce) return ne;
|
110
|
+
Ce = 1;
|
111
|
+
var e = tn(), n = Cn(), t = An(), r = "[object Null]", a = "[object Undefined]", o = e ? e.toStringTag : void 0;
|
112
|
+
function s(l) {
|
106
113
|
return l == null ? l === void 0 ? a : r : o && o in Object(l) ? n(l) : t(l);
|
107
114
|
}
|
108
|
-
return
|
115
|
+
return ne = s, ne;
|
109
116
|
}
|
110
|
-
var
|
111
|
-
function
|
112
|
-
if (
|
113
|
-
|
117
|
+
var te, Ae;
|
118
|
+
function Ln() {
|
119
|
+
if (Ae) return te;
|
120
|
+
Ae = 1;
|
114
121
|
function e(n) {
|
115
122
|
return n != null && typeof n == "object";
|
116
123
|
}
|
117
|
-
return
|
124
|
+
return te = e, te;
|
118
125
|
}
|
119
|
-
var
|
120
|
-
function
|
121
|
-
if (
|
122
|
-
|
123
|
-
var e =
|
126
|
+
var re, Re;
|
127
|
+
function xn() {
|
128
|
+
if (Re) return re;
|
129
|
+
Re = 1;
|
130
|
+
var e = Rn(), n = Ln(), t = "[object Symbol]";
|
124
131
|
function r(a) {
|
125
132
|
return typeof a == "symbol" || n(a) && e(a) == t;
|
126
133
|
}
|
127
|
-
return
|
134
|
+
return re = r, re;
|
128
135
|
}
|
129
|
-
var
|
130
|
-
function
|
131
|
-
if (
|
132
|
-
|
133
|
-
var e =
|
134
|
-
function u(
|
135
|
-
if (typeof
|
136
|
-
return
|
137
|
-
if (t(
|
136
|
+
var ae, Le;
|
137
|
+
function On() {
|
138
|
+
if (Le) return ae;
|
139
|
+
Le = 1;
|
140
|
+
var e = jn(), n = me(), t = xn(), r = NaN, a = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, s = /^0o[0-7]+$/i, l = parseInt;
|
141
|
+
function u(c) {
|
142
|
+
if (typeof c == "number")
|
143
|
+
return c;
|
144
|
+
if (t(c))
|
138
145
|
return r;
|
139
|
-
if (n(
|
140
|
-
var d = typeof
|
141
|
-
|
146
|
+
if (n(c)) {
|
147
|
+
var d = typeof c.valueOf == "function" ? c.valueOf() : c;
|
148
|
+
c = n(d) ? d + "" : d;
|
142
149
|
}
|
143
|
-
if (typeof
|
144
|
-
return
|
145
|
-
|
146
|
-
var
|
147
|
-
return
|
150
|
+
if (typeof c != "string")
|
151
|
+
return c === 0 ? c : +c;
|
152
|
+
c = e(c);
|
153
|
+
var b = o.test(c);
|
154
|
+
return b || s.test(c) ? l(c.slice(2), b ? 2 : 8) : a.test(c) ? r : +c;
|
148
155
|
}
|
149
|
-
return
|
156
|
+
return ae = u, ae;
|
150
157
|
}
|
151
|
-
var
|
152
|
-
function
|
153
|
-
if (
|
154
|
-
|
155
|
-
var e =
|
156
|
-
function
|
157
|
-
var d,
|
158
|
+
var ie, xe;
|
159
|
+
function rn() {
|
160
|
+
if (xe) return ie;
|
161
|
+
xe = 1;
|
162
|
+
var e = me(), n = Pn(), t = On(), r = "Expected a function", a = Math.max, o = Math.min;
|
163
|
+
function s(l, u, c) {
|
164
|
+
var d, b, T, w, g, y, N = 0, k = !1, h = !1, S = !0;
|
158
165
|
if (typeof l != "function")
|
159
166
|
throw new TypeError(r);
|
160
|
-
u = t(u) || 0, e(
|
161
|
-
function
|
162
|
-
var
|
163
|
-
return d =
|
167
|
+
u = t(u) || 0, e(c) && (k = !!c.leading, h = "maxWait" in c, T = h ? a(t(c.maxWait) || 0, u) : T, S = "trailing" in c ? !!c.trailing : S);
|
168
|
+
function v(m) {
|
169
|
+
var P = d, L = b;
|
170
|
+
return d = b = void 0, N = m, w = l.apply(L, P), w;
|
164
171
|
}
|
165
|
-
function p(
|
166
|
-
return
|
172
|
+
function p(m) {
|
173
|
+
return N = m, g = setTimeout(M, u), k ? v(m) : w;
|
167
174
|
}
|
168
|
-
function
|
169
|
-
var
|
170
|
-
return
|
175
|
+
function q(m) {
|
176
|
+
var P = m - y, L = m - N, _e = u - P;
|
177
|
+
return h ? o(_e, T - L) : _e;
|
171
178
|
}
|
172
|
-
function
|
173
|
-
var
|
174
|
-
return
|
179
|
+
function be(m) {
|
180
|
+
var P = m - y, L = m - N;
|
181
|
+
return y === void 0 || P >= u || P < 0 || h && L >= T;
|
175
182
|
}
|
176
|
-
function
|
177
|
-
var
|
178
|
-
if (
|
179
|
-
return
|
180
|
-
g = setTimeout(
|
183
|
+
function M() {
|
184
|
+
var m = n();
|
185
|
+
if (be(m))
|
186
|
+
return pe(m);
|
187
|
+
g = setTimeout(M, q(m));
|
181
188
|
}
|
182
|
-
function
|
183
|
-
return g = void 0,
|
189
|
+
function pe(m) {
|
190
|
+
return g = void 0, S && d ? v(m) : (d = b = void 0, w);
|
184
191
|
}
|
185
|
-
function
|
186
|
-
g !== void 0 && clearTimeout(g),
|
192
|
+
function mn() {
|
193
|
+
g !== void 0 && clearTimeout(g), N = 0, d = y = b = g = void 0;
|
187
194
|
}
|
188
|
-
function
|
189
|
-
return g === void 0 ?
|
195
|
+
function hn() {
|
196
|
+
return g === void 0 ? w : pe(n());
|
190
197
|
}
|
191
|
-
function
|
192
|
-
var
|
193
|
-
if (d = arguments,
|
198
|
+
function H() {
|
199
|
+
var m = n(), P = be(m);
|
200
|
+
if (d = arguments, b = this, y = m, P) {
|
194
201
|
if (g === void 0)
|
195
|
-
return p(
|
196
|
-
if (
|
197
|
-
return clearTimeout(g), g = setTimeout(
|
202
|
+
return p(y);
|
203
|
+
if (h)
|
204
|
+
return clearTimeout(g), g = setTimeout(M, u), v(y);
|
198
205
|
}
|
199
|
-
return g === void 0 && (g = setTimeout(
|
206
|
+
return g === void 0 && (g = setTimeout(M, u)), w;
|
200
207
|
}
|
201
|
-
return
|
208
|
+
return H.cancel = mn, H.flush = hn, H;
|
202
209
|
}
|
203
|
-
return
|
210
|
+
return ie = s, ie;
|
204
211
|
}
|
205
|
-
var
|
206
|
-
const
|
207
|
-
var
|
208
|
-
function
|
209
|
-
if (
|
210
|
-
|
211
|
-
var e =
|
212
|
-
function r(a, o,
|
212
|
+
var qn = rn();
|
213
|
+
const Mn = /* @__PURE__ */ en(qn);
|
214
|
+
var oe, Oe;
|
215
|
+
function Bn() {
|
216
|
+
if (Oe) return oe;
|
217
|
+
Oe = 1;
|
218
|
+
var e = rn(), n = me(), t = "Expected a function";
|
219
|
+
function r(a, o, s) {
|
213
220
|
var l = !0, u = !0;
|
214
221
|
if (typeof a != "function")
|
215
222
|
throw new TypeError(t);
|
216
|
-
return n(
|
223
|
+
return n(s) && (l = "leading" in s ? !!s.leading : l, u = "trailing" in s ? !!s.trailing : u), e(a, o, {
|
217
224
|
leading: l,
|
218
225
|
maxWait: o,
|
219
226
|
trailing: u
|
220
227
|
});
|
221
228
|
}
|
222
|
-
return
|
229
|
+
return oe = r, oe;
|
223
230
|
}
|
224
|
-
var
|
225
|
-
const
|
231
|
+
var $n = Bn();
|
232
|
+
const Un = /* @__PURE__ */ en($n), zn = (e, n, t, r) => {
|
226
233
|
switch (n) {
|
227
234
|
case "debounce":
|
228
|
-
return
|
235
|
+
return Mn(e, t, r);
|
229
236
|
case "throttle":
|
230
|
-
return
|
237
|
+
return Un(e, t, r);
|
231
238
|
default:
|
232
239
|
return e;
|
233
240
|
}
|
234
|
-
},
|
241
|
+
}, Dn = (
|
235
242
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
236
243
|
(e) => {
|
237
|
-
const n =
|
238
|
-
return
|
244
|
+
const n = x.useRef(e);
|
245
|
+
return x.useEffect(() => {
|
239
246
|
n.current = e;
|
240
|
-
}),
|
247
|
+
}), x.useMemo(() => (...t) => {
|
241
248
|
var r;
|
242
249
|
return (r = n.current) === null || r === void 0 ? void 0 : r.call(n, ...t);
|
243
250
|
}, []);
|
244
251
|
}
|
245
|
-
),
|
252
|
+
), Wn = (
|
246
253
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
247
254
|
(e) => {
|
248
|
-
const [n, t] =
|
255
|
+
const [n, t] = x.useState((e == null ? void 0 : e.current) || null);
|
249
256
|
return e && setTimeout(() => {
|
250
257
|
e.current !== n && t(e.current);
|
251
|
-
}, 0), { refProxy:
|
258
|
+
}, 0), { refProxy: x.useMemo(() => new Proxy((a) => {
|
252
259
|
a !== n && t(a);
|
253
260
|
}, {
|
254
261
|
get(a, o) {
|
255
262
|
return o === "current" ? n : a[o];
|
256
263
|
},
|
257
|
-
set(a, o,
|
258
|
-
return o === "current" ? t(
|
264
|
+
set(a, o, s) {
|
265
|
+
return o === "current" ? t(s) : a[o] = s, !0;
|
259
266
|
}
|
260
267
|
}), [n]), refElement: n, setRefElement: t };
|
261
268
|
}
|
262
|
-
),
|
269
|
+
), Fn = (e, n) => n === "border-box" ? {
|
263
270
|
width: e.borderBoxSize[0].inlineSize,
|
264
271
|
height: e.borderBoxSize[0].blockSize
|
265
272
|
} : n === "content-box" ? {
|
@@ -269,198 +276,198 @@ const En = /* @__PURE__ */ Fe(Sn), Pn = (e, n, t, r) => {
|
|
269
276
|
width: e.contentRect.width,
|
270
277
|
height: e.contentRect.height
|
271
278
|
};
|
272
|
-
function
|
273
|
-
const
|
279
|
+
function Hn({ skipOnMount: e = !1, refreshMode: n, refreshRate: t = 1e3, refreshOptions: r, handleWidth: a = !0, handleHeight: o = !0, targetRef: s, observerOptions: l, onResize: u } = {}) {
|
280
|
+
const c = Ge(e), d = Dn(u), [b, T] = Ke({
|
274
281
|
width: void 0,
|
275
282
|
height: void 0
|
276
|
-
}), { refProxy:
|
283
|
+
}), { refProxy: w, refElement: g } = Wn(s), { box: y } = l || {}, N = Te((h) => {
|
277
284
|
if (!a && !o)
|
278
285
|
return;
|
279
|
-
if (
|
280
|
-
|
286
|
+
if (c.current) {
|
287
|
+
c.current = !1;
|
281
288
|
return;
|
282
289
|
}
|
283
|
-
const
|
284
|
-
|
285
|
-
const p =
|
286
|
-
|
290
|
+
const S = (v, p) => a && v.width !== p.width || o && v.height !== p.height;
|
291
|
+
h.forEach((v) => {
|
292
|
+
const p = Fn(v, y);
|
293
|
+
T((q) => S(q, p) ? (d == null || d({
|
287
294
|
width: p.width,
|
288
295
|
height: p.height,
|
289
|
-
entry:
|
290
|
-
}), p) :
|
296
|
+
entry: v
|
297
|
+
}), p) : q);
|
291
298
|
});
|
292
|
-
}, [a, o,
|
293
|
-
|
299
|
+
}, [a, o, c, y]), k = Te(zn(N, n, t, r), [
|
300
|
+
N,
|
294
301
|
n,
|
295
302
|
t,
|
296
303
|
r
|
297
304
|
]);
|
298
|
-
return
|
299
|
-
let
|
300
|
-
return g ? (
|
305
|
+
return W(() => {
|
306
|
+
let h;
|
307
|
+
return g ? (h = new window.ResizeObserver(k), h.observe(g, l)) : (b.width || b.height) && (d == null || d({
|
301
308
|
width: null,
|
302
309
|
height: null,
|
303
310
|
entry: null
|
304
|
-
}),
|
305
|
-
var
|
306
|
-
(
|
311
|
+
}), T({ width: void 0, height: void 0 })), () => {
|
312
|
+
var S, v, p;
|
313
|
+
(S = h == null ? void 0 : h.disconnect) === null || S === void 0 || S.call(h), (p = (v = k).cancel) === null || p === void 0 || p.call(v);
|
307
314
|
};
|
308
|
-
}, [
|
315
|
+
}, [k, g]), Object.assign({ ref: w }, b);
|
309
316
|
}
|
310
|
-
function
|
317
|
+
function an(e) {
|
311
318
|
var n, t, r = "";
|
312
319
|
if (typeof e == "string" || typeof e == "number") r += e;
|
313
320
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
314
321
|
var a = e.length;
|
315
|
-
for (n = 0; n < a; n++) e[n] && (t =
|
322
|
+
for (n = 0; n < a; n++) e[n] && (t = an(e[n])) && (r && (r += " "), r += t);
|
316
323
|
} else for (t in e) e[t] && (r && (r += " "), r += t);
|
317
324
|
return r;
|
318
325
|
}
|
319
|
-
function
|
320
|
-
for (var e, n, t = 0, r = "", a = arguments.length; t < a; t++) (e = arguments[t]) && (n =
|
326
|
+
function C() {
|
327
|
+
for (var e, n, t = 0, r = "", a = arguments.length; t < a; t++) (e = arguments[t]) && (n = an(e)) && (r && (r += " "), r += n);
|
321
328
|
return r;
|
322
329
|
}
|
323
|
-
const
|
324
|
-
headerContainer:
|
325
|
-
navigationTabList:
|
326
|
-
navigationTab:
|
327
|
-
headerContent:
|
328
|
-
staticEnabled:
|
329
|
-
},
|
330
|
-
const { ref: t, height: r } =
|
330
|
+
const Jn = "_headerContainer_1cubo_1", Gn = "_navigationTabList_1cubo_8", Kn = "_navigationTab_1cubo_8", Vn = "_headerContent_1cubo_34", Yn = "_staticEnabled_1cubo_50", R = {
|
331
|
+
headerContainer: Jn,
|
332
|
+
navigationTabList: Gn,
|
333
|
+
navigationTab: Kn,
|
334
|
+
headerContent: Vn,
|
335
|
+
staticEnabled: Yn
|
336
|
+
}, Qn = 77, U = ({ sticky: e, children: n }) => {
|
337
|
+
const { ref: t, height: r } = Hn({
|
331
338
|
refreshMode: "debounce",
|
332
339
|
refreshRate: 0
|
333
|
-
}), [a, o] =
|
334
|
-
|
340
|
+
}), [a, o] = Ke(!1), s = () => a ? !e : !0;
|
341
|
+
W(() => {
|
335
342
|
const u = () => {
|
336
343
|
o(window.scrollY > 0);
|
337
344
|
};
|
338
345
|
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
339
346
|
}, []);
|
340
|
-
const l = `${r ||
|
341
|
-
return /* @__PURE__ */ i("div", { style: { minHeight: l }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */
|
347
|
+
const l = `${r || Qn}px`;
|
348
|
+
return /* @__PURE__ */ i("div", { style: { minHeight: l }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ _(
|
342
349
|
"div",
|
343
350
|
{
|
344
351
|
ref: t,
|
345
|
-
className:
|
346
|
-
[
|
352
|
+
className: C(R.headerContent, {
|
353
|
+
[R.staticEnabled]: s()
|
347
354
|
}),
|
348
355
|
children: [
|
349
|
-
/* @__PURE__ */ i(
|
350
|
-
/* @__PURE__ */ i(
|
356
|
+
/* @__PURE__ */ i(U.Header, {}),
|
357
|
+
/* @__PURE__ */ i(U.Tabs, {}),
|
351
358
|
n
|
352
359
|
]
|
353
360
|
}
|
354
361
|
) }) });
|
355
362
|
};
|
356
|
-
|
357
|
-
|
358
|
-
const
|
359
|
-
sidebarContainer:
|
360
|
-
},
|
361
|
-
logoLink:
|
362
|
-
},
|
363
|
-
link:
|
364
|
-
active:
|
365
|
-
},
|
366
|
-
|
363
|
+
U.Header = ({ children: e }) => /* @__PURE__ */ i("div", { className: R.headerContainer, children: e });
|
364
|
+
U.Tabs = ({ children: e }) => /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
365
|
+
const Zn = "_sidebarContainer_bmdti_1", Xn = {
|
366
|
+
sidebarContainer: Zn
|
367
|
+
}, et = "_logoLink_1baxb_1", nt = {
|
368
|
+
logoLink: et
|
369
|
+
}, tt = ({ src: e, href: n = "/", ariaLabel: t = "Home", alt: r = "Lokalise" }) => /* @__PURE__ */ i("a", { className: nt.logoLink, href: n, "aria-label": t, children: /* @__PURE__ */ i("img", { src: e, alt: r }) }), rt = "_link_1weq1_1", at = "_active_1weq1_18", qe = {
|
370
|
+
link: rt,
|
371
|
+
active: at
|
372
|
+
}, it = ({ label: e, to: n, icon: t }) => /* @__PURE__ */ i(le, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
|
373
|
+
Ye,
|
367
374
|
{
|
368
|
-
className:
|
369
|
-
[
|
375
|
+
className: C(qe.link, {
|
376
|
+
[qe.active]: window.location.pathname.startsWith(n)
|
370
377
|
}),
|
371
378
|
href: n,
|
372
379
|
children: /* @__PURE__ */ i(t, { size: "25px" })
|
373
380
|
}
|
374
|
-
) }),
|
375
|
-
dropdownButton:
|
376
|
-
dropdownButtonActive:
|
377
|
-
},
|
378
|
-
|
381
|
+
) }), ot = "_dropdownButton_hwh0c_1", st = "_dropdownButtonActive_hwh0c_18", Me = {
|
382
|
+
dropdownButton: ot,
|
383
|
+
dropdownButtonActive: st
|
384
|
+
}, ct = ({ children: e, icon: n }) => /* @__PURE__ */ i(
|
385
|
+
ue,
|
379
386
|
{
|
380
|
-
menuButton: ({ opened: t }) => /* @__PURE__ */ i(
|
387
|
+
menuButton: ({ opened: t }) => /* @__PURE__ */ i(le, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
|
381
388
|
"button",
|
382
389
|
{
|
383
390
|
type: "button",
|
384
|
-
className:
|
385
|
-
[
|
391
|
+
className: C(Me.dropdownButton, {
|
392
|
+
[Me.dropdownButtonActive]: t
|
386
393
|
}),
|
387
394
|
children: /* @__PURE__ */ i(n, { size: "25px" })
|
388
395
|
}
|
389
396
|
) }),
|
390
|
-
children: /* @__PURE__ */ i(
|
397
|
+
children: /* @__PURE__ */ i(de, { placement: "right-start", children: e })
|
391
398
|
}
|
392
|
-
),
|
393
|
-
iconContainer:
|
394
|
-
},
|
399
|
+
), lt = "_iconContainer_nz34m_1", ut = {
|
400
|
+
iconContainer: lt
|
401
|
+
}, on = ({ className: e = "" }) => /* @__PURE__ */ i(
|
395
402
|
"div",
|
396
403
|
{
|
397
404
|
"aria-label": "Upgrade Icon",
|
398
|
-
className:
|
399
|
-
|
405
|
+
className: C(
|
406
|
+
ut.iconContainer,
|
400
407
|
"flex-row",
|
401
408
|
"items-center",
|
402
409
|
"justify-center",
|
403
410
|
e
|
404
411
|
),
|
405
|
-
children: /* @__PURE__ */ i(
|
412
|
+
children: /* @__PURE__ */ i(wn, {})
|
406
413
|
}
|
407
|
-
),
|
408
|
-
menuContainer:
|
409
|
-
profileButton:
|
410
|
-
profileImage:
|
411
|
-
profileImageHighlight:
|
412
|
-
profileImageUpgradeIcon:
|
413
|
-
userIconWrapper:
|
414
|
-
},
|
414
|
+
), dt = "_menuContainer_wbu3u_5", ft = "_profileButton_wbu3u_16", mt = "_profileImage_wbu3u_29", ht = "_profileImageHighlight_wbu3u_37", gt = "_profileImageUpgradeIcon_wbu3u_41", bt = "_userIconWrapper_wbu3u_47", E = {
|
415
|
+
menuContainer: dt,
|
416
|
+
profileButton: ft,
|
417
|
+
profileImage: mt,
|
418
|
+
profileImageHighlight: ht,
|
419
|
+
profileImageUpgradeIcon: gt,
|
420
|
+
userIconWrapper: bt
|
421
|
+
}, sn = _n({}), O = () => pn(sn), pt = ({ children: e }) => {
|
415
422
|
const {
|
416
423
|
currentTeam: n,
|
417
424
|
otherTeams: t,
|
418
425
|
showUpgradeCta: r,
|
419
426
|
showBillingButton: a,
|
420
427
|
allowTeamCreation: o,
|
421
|
-
isLimitedView:
|
428
|
+
isLimitedView: s,
|
422
429
|
isProviderAlpha: l,
|
423
430
|
canAccessTeamSettings: u,
|
424
|
-
isEndOfTrialActive:
|
431
|
+
isEndOfTrialActive: c,
|
425
432
|
isTeamSuspended: d
|
426
433
|
} = O();
|
427
434
|
return /* @__PURE__ */ i(
|
428
|
-
|
435
|
+
ue,
|
429
436
|
{
|
430
|
-
menuButton: () => /* @__PURE__ */
|
437
|
+
menuButton: () => /* @__PURE__ */ _("button", { className: E.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
431
438
|
n != null && n.logoUrl ? /* @__PURE__ */ i(
|
432
439
|
"img",
|
433
440
|
{
|
434
441
|
src: n.logoUrl,
|
435
|
-
className:
|
436
|
-
[
|
442
|
+
className: C(E.profileImage, {
|
443
|
+
[E.profileImageHighlight]: r
|
437
444
|
}),
|
438
445
|
alt: "Team Logo"
|
439
446
|
}
|
440
447
|
) : /* @__PURE__ */ i(
|
441
448
|
"div",
|
442
449
|
{
|
443
|
-
className:
|
444
|
-
[
|
450
|
+
className: C(E.userIconWrapper, "flex-row", "align-center", "items-center", {
|
451
|
+
[E.profileImageHighlight]: r
|
445
452
|
}),
|
446
|
-
children: /* @__PURE__ */ i(
|
453
|
+
children: /* @__PURE__ */ i(Qe, { size: "25px" })
|
447
454
|
}
|
448
455
|
),
|
449
|
-
r && /* @__PURE__ */ i(
|
456
|
+
r && /* @__PURE__ */ i(on, { className: E.profileImageUpgradeIcon })
|
450
457
|
] }),
|
451
|
-
children: /* @__PURE__ */ i(
|
458
|
+
children: /* @__PURE__ */ i(de, { placement: "right-end", className: E.menuContainer, children: e({
|
452
459
|
allowTeamCreation: o,
|
453
460
|
otherTeams: t,
|
454
|
-
isLimitedView:
|
461
|
+
isLimitedView: s,
|
455
462
|
canAccessTeamSettings: u,
|
456
|
-
isEndOfTrialActive:
|
463
|
+
isEndOfTrialActive: c,
|
457
464
|
isTeamSuspended: d,
|
458
465
|
showBillingButton: a,
|
459
466
|
isProviderAlpha: l
|
460
467
|
}) })
|
461
468
|
}
|
462
469
|
);
|
463
|
-
},
|
470
|
+
}, cn = 0, _t = 9999, vt = [150, 151, 250, 251], Tt = [152, 153, 252, 253], wt = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], yt = [156, 159, 160, 256, 259, 260], ln = 9998, he = (e) => e === cn, un = (e) => e === _t, Tr = (e) => vt.includes(e), wr = (e) => Tt.includes(e), yr = (e) => wt.includes(e), Ir = (e) => yt.includes(e), Nr = (e) => e > cn && e < ln, Sr = (e) => e === ln, It = /\n/, Be = (e, n, t) => e.split(n).flatMap((r, a) => a !== 0 ? [vn(t, { key: Math.random().toString(32).slice(0, 10) }), r] : r), Nt = (e, n, t) => typeof e == "string" ? Be(e, n, t) : e.flatMap((r) => typeof r == "string" ? Be(r, n, t) : r), kr = (e) => Nt(e, It, /* @__PURE__ */ i("br", {})), St = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, kt = (e) => e.match(St) ?? [], $e = (e, n, t) => {
|
464
471
|
const r = e.split(n);
|
465
472
|
if (r.length === 1)
|
466
473
|
return e;
|
@@ -468,142 +475,142 @@ const Mn = "_sidebarContainer_bmdti_1", $n = {
|
|
468
475
|
return r[0] !== "" && a.push(r[0]), r.shift(), r[r.length - 1] === "" && r.pop(), a.push(
|
469
476
|
/* @__PURE__ */ i("a", { href: n, target: "_blank", rel: "noreferrer noopener", children: n }, n + t)
|
470
477
|
), a.push(r.join(n)), a.filter((o) => o !== "");
|
471
|
-
},
|
472
|
-
const n =
|
473
|
-
return n != null && n.length ? n.reduce((t, r, a) => typeof t == "string" ?
|
474
|
-
},
|
475
|
-
|
476
|
-
},
|
478
|
+
}, Ue = (e) => {
|
479
|
+
const n = kt(e);
|
480
|
+
return n != null && n.length ? n.reduce((t, r, a) => typeof t == "string" ? $e(t, r, a) : t.flatMap((o) => typeof o == "string" ? $e(o, r, a) : o), e) : e;
|
481
|
+
}, Pr = (e) => typeof e == "string" ? Ue(e) : e.flatMap((n) => typeof n == "string" ? Ue(n) : n, e), Er = (e, n = "PP") => Xe(e, n), jr = (e, n, t = "PP") => Xe(Sn(e, n), t), Cr = (e) => {
|
482
|
+
W(e, []);
|
483
|
+
}, Pt = ({ children: e, config: n }) => {
|
477
484
|
const {
|
478
485
|
teams: t,
|
479
486
|
currentTeamId: r,
|
480
487
|
planId: a,
|
481
488
|
isLimitedView: o,
|
482
|
-
isTeamSuspended:
|
489
|
+
isTeamSuspended: s,
|
483
490
|
canAccessTeamSettings: l,
|
484
491
|
isEndOfTrialActive: u
|
485
|
-
} = n,
|
492
|
+
} = n, c = t.find((h) => h.id === r), d = t.filter((h) => h.id !== r), b = (c == null ? void 0 : c.role) ?? "", T = ["biller", "owner"].includes(b), w = he(a) || un(a), k = {
|
486
493
|
...n,
|
487
|
-
currentTeam:
|
494
|
+
currentTeam: c,
|
488
495
|
otherTeams: d,
|
489
|
-
canChangeBilling:
|
490
|
-
isOnFreeOrTrialPlan:
|
491
|
-
showUpgradeCta: !o &&
|
492
|
-
showBillingButton: !o && l &&
|
496
|
+
canChangeBilling: T,
|
497
|
+
isOnFreeOrTrialPlan: w,
|
498
|
+
showUpgradeCta: !o && w && T && !s,
|
499
|
+
showBillingButton: !o && l && T,
|
493
500
|
allowTeamCreation: !o && !u
|
494
501
|
};
|
495
|
-
return /* @__PURE__ */ i(
|
496
|
-
},
|
497
|
-
container:
|
498
|
-
profileEmail:
|
499
|
-
},
|
502
|
+
return /* @__PURE__ */ i(sn.Provider, { value: k, children: e });
|
503
|
+
}, Et = ({ config: e, children: n }) => /* @__PURE__ */ i(Pt, { config: e, children: /* @__PURE__ */ i(pt, { children: n }) }), jt = "_container_q5pot_1", Ct = "_profileEmail_q5pot_5", ze = {
|
504
|
+
container: jt,
|
505
|
+
profileEmail: Ct
|
506
|
+
}, At = ({
|
500
507
|
href: e,
|
501
508
|
onClick: n,
|
502
509
|
userEmail: t,
|
503
510
|
hideBottomDivider: r
|
504
511
|
}) => {
|
505
512
|
const { isEndOfTrialActive: a, isTeamSuspended: o } = O();
|
506
|
-
return a || o ? null : /* @__PURE__ */
|
513
|
+
return a || o ? null : /* @__PURE__ */ _(Je, { children: [
|
507
514
|
/* @__PURE__ */ i(
|
508
|
-
|
515
|
+
F,
|
509
516
|
{
|
510
517
|
href: e,
|
511
518
|
onClick: () => {
|
512
519
|
n == null || n();
|
513
520
|
},
|
514
|
-
children: /* @__PURE__ */
|
521
|
+
children: /* @__PURE__ */ _("div", { className: `flex-col ${ze.container}`, children: [
|
515
522
|
/* @__PURE__ */ i("span", { children: "Profile Settings" }),
|
516
|
-
/* @__PURE__ */ i("span", { className:
|
523
|
+
/* @__PURE__ */ i("span", { className: ze.profileEmail, children: t })
|
517
524
|
] })
|
518
525
|
}
|
519
526
|
),
|
520
|
-
!r && /* @__PURE__ */ i(
|
527
|
+
!r && /* @__PURE__ */ i(Ze, {})
|
521
528
|
] });
|
522
|
-
},
|
523
|
-
wrapper:
|
524
|
-
profileImage:
|
525
|
-
teamName:
|
526
|
-
planLabel:
|
527
|
-
membership:
|
528
|
-
defaultProfileImage:
|
529
|
-
},
|
529
|
+
}, Rt = "_wrapper_15d85_1", Lt = "_profileImage_15d85_14", xt = "_teamName_15d85_22", Ot = "_planLabel_15d85_29", qt = "_membership_15d85_38", Mt = "_defaultProfileImage_15d85_44", A = {
|
530
|
+
wrapper: Rt,
|
531
|
+
profileImage: Lt,
|
532
|
+
teamName: xt,
|
533
|
+
planLabel: Ot,
|
534
|
+
membership: qt,
|
535
|
+
defaultProfileImage: Mt
|
536
|
+
}, dn = ({ team: e, onClick: n, hidePlanLabel: t }) => {
|
530
537
|
const { currentTeam: r, planId: a } = O(), o = e || r;
|
531
538
|
if (!o)
|
532
539
|
return null;
|
533
|
-
const
|
534
|
-
return /* @__PURE__ */
|
535
|
-
n ?
|
540
|
+
const s = he(a) ? "Free" : un(a) ? "Trial" : void 0;
|
541
|
+
return /* @__PURE__ */ _(
|
542
|
+
n ? F : "div",
|
536
543
|
{
|
537
|
-
className: `flex-row gap-2 flex-nowrap items-center ${
|
544
|
+
className: `flex-row gap-2 flex-nowrap items-center ${A.wrapper}`,
|
538
545
|
...n && { onClick: () => n(o) },
|
539
546
|
children: [
|
540
|
-
o.logoUrl ? /* @__PURE__ */ i("img", { className:
|
541
|
-
/* @__PURE__ */
|
542
|
-
/* @__PURE__ */
|
543
|
-
/* @__PURE__ */ i("span", { title: o.name, className:
|
544
|
-
|
547
|
+
o.logoUrl ? /* @__PURE__ */ i("img", { className: A.profileImage, src: o.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${A.defaultProfileImage}`, children: /* @__PURE__ */ i(Qe, { size: "25px" }) }),
|
548
|
+
/* @__PURE__ */ _("div", { className: "flex-col items-start", children: [
|
549
|
+
/* @__PURE__ */ _("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
550
|
+
/* @__PURE__ */ i("span", { title: o.name, className: A.teamName, children: o.name }),
|
551
|
+
s && !t && /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${A.planLabel}`, children: s })
|
545
552
|
] }),
|
546
|
-
/* @__PURE__ */ i("span", { className:
|
553
|
+
/* @__PURE__ */ i("span", { className: A.membership, children: o.role })
|
547
554
|
] })
|
548
555
|
]
|
549
556
|
}
|
550
557
|
);
|
551
|
-
},
|
552
|
-
teamsContainer:
|
553
|
-
},
|
558
|
+
}, Bt = "_teamsContainer_1t68g_1", $t = {
|
559
|
+
teamsContainer: Bt
|
560
|
+
}, Ut = ({ onSwitchTeam: e }) => {
|
554
561
|
const { otherTeams: n } = O();
|
555
|
-
return n.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${
|
556
|
-
},
|
557
|
-
container:
|
558
|
-
planCta:
|
559
|
-
upgradeIconWrapper:
|
560
|
-
},
|
562
|
+
return n.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${$t.teamsContainer}`, children: n.map((t) => /* @__PURE__ */ i(dn, { team: t, onClick: e, hidePlanLabel: !0 }, t.id)) });
|
563
|
+
}, zt = "_container_1u995_1", Dt = "_planCta_1u995_15", Wt = "_upgradeIconWrapper_1u995_19", se = {
|
564
|
+
container: zt,
|
565
|
+
planCta: Dt,
|
566
|
+
upgradeIconWrapper: Wt
|
567
|
+
}, Ft = ({ upgradeOptionHref: e }) => {
|
561
568
|
const { planId: n, trialDaysLeft: t, showUpgradeCta: r } = O();
|
562
569
|
if (!r)
|
563
570
|
return null;
|
564
|
-
const
|
565
|
-
return /* @__PURE__ */
|
566
|
-
/* @__PURE__ */ i("span", { className:
|
567
|
-
/* @__PURE__ */
|
568
|
-
/* @__PURE__ */ i(
|
571
|
+
const s = he(n) ? "Your team is currently on the Free plan" : `Free trial ends in ${t} ${t === 1 ? "day" : "days"}`;
|
572
|
+
return /* @__PURE__ */ _(F, { href: e, className: `flex-col gap-1 items-start ${se.container}`, children: [
|
573
|
+
/* @__PURE__ */ i("span", { className: se.planCta, children: s }),
|
574
|
+
/* @__PURE__ */ _("div", { className: `flex-row items-center gap-1 ${se.upgradeIconWrapper}`, children: [
|
575
|
+
/* @__PURE__ */ i(on, {}),
|
569
576
|
/* @__PURE__ */ i("span", { children: "See upgrade options" })
|
570
577
|
] })
|
571
578
|
] });
|
572
|
-
}, I = ({ children: e, ...n }) => /* @__PURE__ */ i("nav", { ...n, className:
|
579
|
+
}, I = ({ children: e, ...n }) => /* @__PURE__ */ i("nav", { ...n, className: Xn.sidebarContainer, children: e });
|
573
580
|
I.Top = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
574
581
|
I.Bottom = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
575
|
-
I.Avatar =
|
576
|
-
I.IconLink =
|
577
|
-
I.Menu =
|
578
|
-
I.ProfileMenu =
|
579
|
-
I.TeamSwitch =
|
580
|
-
I.TeamMenuItem =
|
581
|
-
I.UpgradeMenuItem =
|
582
|
-
I.ProfileSettingsMenuItem =
|
583
|
-
const
|
584
|
-
breadcrumbsItem:
|
585
|
-
breadcrumbs:
|
586
|
-
},
|
587
|
-
/* @__PURE__ */ i(
|
582
|
+
I.Avatar = tt;
|
583
|
+
I.IconLink = it;
|
584
|
+
I.Menu = ct;
|
585
|
+
I.ProfileMenu = Et;
|
586
|
+
I.TeamSwitch = Ut;
|
587
|
+
I.TeamMenuItem = dn;
|
588
|
+
I.UpgradeMenuItem = Ft;
|
589
|
+
I.ProfileSettingsMenuItem = At;
|
590
|
+
const Ht = "_breadcrumbsItem_1hm6a_1", Jt = "_breadcrumbs_1hm6a_1", De = {
|
591
|
+
breadcrumbsItem: Ht,
|
592
|
+
breadcrumbs: Jt
|
593
|
+
}, Ar = ({ items: e }) => /* @__PURE__ */ i("nav", { "aria-label": "breadcrumb", className: De.breadcrumbs, children: e.map((n, t) => /* @__PURE__ */ _(Ve, { children: [
|
594
|
+
/* @__PURE__ */ i(Ye, { className: De.breadcrumbsItem, href: n.link, rel: "noreferrer", children: n.name }),
|
588
595
|
t < e.length - 1 && /* @__PURE__ */ i("span", { children: " — " })
|
589
|
-
] }, `${n.link}-${n.name}`)) }),
|
590
|
-
!!t && n.some((r) => r.visible) && /* @__PURE__ */ i(
|
591
|
-
n.filter(({ visible: r }) => r).map(({ link: r, label: a, onClick: o }) => /* @__PURE__ */ i(
|
592
|
-
] }, n[0].label)) }),
|
593
|
-
badge:
|
594
|
-
tag:
|
595
|
-
withNavLinkStyle:
|
596
|
-
disabled:
|
597
|
-
projectNavigationItem:
|
598
|
-
projectNavigationItemDisabled:
|
599
|
-
},
|
600
|
-
/* @__PURE__ */
|
596
|
+
] }, `${n.link}-${n.name}`)) }), Gt = ({ items: e }) => /* @__PURE__ */ i(Je, { children: e.map((n, t) => /* @__PURE__ */ _(Ve, { children: [
|
597
|
+
!!t && n.some((r) => r.visible) && /* @__PURE__ */ i(Ze, {}),
|
598
|
+
n.filter(({ visible: r }) => r).map(({ link: r, label: a, onClick: o }) => /* @__PURE__ */ i(F, { href: r || "#", "aria-label": a, onClick: o, children: a }, a))
|
599
|
+
] }, n[0].label)) }), Kt = "_badge_1pc1v_1", Vt = "_tag_1pc1v_15", Yt = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", Qt = "_disabled_1pc1v_57", Zt = "_projectNavigationItem_1pc1v_61", Xt = "_projectNavigationItemDisabled_1pc1v_67", j = {
|
600
|
+
badge: Kt,
|
601
|
+
tag: Vt,
|
602
|
+
withNavLinkStyle: Yt,
|
603
|
+
disabled: Qt,
|
604
|
+
projectNavigationItem: Zt,
|
605
|
+
projectNavigationItemDisabled: Xt
|
606
|
+
}, We = ({ label: e, badge: n, novel: t }) => /* @__PURE__ */ _("div", { className: "flex gap-1", children: [
|
607
|
+
/* @__PURE__ */ _("div", { children: [
|
601
608
|
/* @__PURE__ */ i("span", { children: e }),
|
602
609
|
!!n && /* @__PURE__ */ i("div", { className: j.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
|
603
610
|
] }),
|
604
|
-
!!t && /* @__PURE__ */ i(
|
605
|
-
] }),
|
606
|
-
({ label: e, href: n = "", disabled: t = !1, badge: r, onClick: a, novel: o },
|
611
|
+
!!t && /* @__PURE__ */ i(yn, { className: j.tag, children: t })
|
612
|
+
] }), ce = Tn(
|
613
|
+
({ label: e, href: n = "", disabled: t = !1, badge: r, onClick: a, novel: o }, s) => /* @__PURE__ */ i(le, { tooltip: "You do not have access to this function", show: t, children: /* @__PURE__ */ i(
|
607
614
|
"div",
|
608
615
|
{
|
609
616
|
className: t ? j.projectNavigationItemDisabled : j.projectNavigationItem,
|
@@ -611,32 +618,32 @@ const Ct = "_breadcrumbsItem_1hm6a_1", Rt = "_breadcrumbs_1hm6a_1", Ae = {
|
|
611
618
|
"button",
|
612
619
|
{
|
613
620
|
type: "button",
|
614
|
-
ref:
|
615
|
-
className:
|
621
|
+
ref: s,
|
622
|
+
className: C(j.withNavLinkStyle, {
|
616
623
|
[j.disabled]: t
|
617
624
|
}),
|
618
625
|
disabled: t,
|
619
626
|
onClick: a,
|
620
|
-
children: /* @__PURE__ */ i(
|
627
|
+
children: /* @__PURE__ */ i(We, { label: e, badge: r, novel: o })
|
621
628
|
}
|
622
|
-
) : /* @__PURE__ */ i("a", { href: n, className: j.withNavLinkStyle, children: /* @__PURE__ */ i(
|
629
|
+
) : /* @__PURE__ */ i("a", { href: n, className: j.withNavLinkStyle, children: /* @__PURE__ */ i(We, { label: e, badge: r, novel: o }) })
|
623
630
|
}
|
624
631
|
) })
|
625
632
|
);
|
626
|
-
|
627
|
-
const
|
633
|
+
ce.displayName = "NavigationTabsItem";
|
634
|
+
const er = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible))) ?? !1, nr = (e) => e.visible && (!e.dropdown || er(e.dropdown)), Rr = ({ navigation: e, activeItem: n }) => /* @__PURE__ */ i("nav", { "aria-label": "Project", children: /* @__PURE__ */ i("ul", { className: R.navigationTabList, "aria-orientation": "horizontal", children: e.filter(nr).map((t) => {
|
628
635
|
var r, a, o;
|
629
636
|
return t.dropdown ? /* @__PURE__ */ i(
|
630
637
|
"li",
|
631
638
|
{
|
632
|
-
className:
|
639
|
+
className: R.navigationTab,
|
633
640
|
"data-testid": t.key,
|
634
641
|
"aria-selected": (r = t.isActive) == null ? void 0 : r.call(t, n),
|
635
642
|
children: /* @__PURE__ */ i(
|
636
|
-
|
643
|
+
ue,
|
637
644
|
{
|
638
|
-
menuButton: ({ opened:
|
639
|
-
children: /* @__PURE__ */ i(
|
645
|
+
menuButton: ({ opened: s }) => /* @__PURE__ */ i(ce, { label: t.label, disabled: t.disabled, active: s }),
|
646
|
+
children: /* @__PURE__ */ i(de, { children: /* @__PURE__ */ i(Gt, { items: t.dropdown }) })
|
640
647
|
}
|
641
648
|
)
|
642
649
|
},
|
@@ -644,11 +651,11 @@ const Ut = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible)))
|
|
644
651
|
) : /* @__PURE__ */ i(
|
645
652
|
"li",
|
646
653
|
{
|
647
|
-
className:
|
654
|
+
className: R.navigationTab,
|
648
655
|
"data-testid": t.key,
|
649
656
|
"aria-selected": (a = t.isActive) == null ? void 0 : a.call(t, n),
|
650
657
|
children: /* @__PURE__ */ i(
|
651
|
-
|
658
|
+
ce,
|
652
659
|
{
|
653
660
|
label: t.label,
|
654
661
|
href: t.link,
|
@@ -662,30 +669,165 @@ const Ut = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible)))
|
|
662
669
|
},
|
663
670
|
t.key
|
664
671
|
);
|
665
|
-
}) }) })
|
672
|
+
}) }) }), tr = f.union([
|
673
|
+
f.literal("owner"),
|
674
|
+
f.literal("admin"),
|
675
|
+
f.literal("biller"),
|
676
|
+
f.literal("member")
|
677
|
+
]), rr = f.object({
|
678
|
+
userId: f.number(),
|
679
|
+
teamId: f.number(),
|
680
|
+
userTeamRole: tr,
|
681
|
+
userEmail: f.string().email(),
|
682
|
+
userCurrentTeamId: f.number(),
|
683
|
+
planId: f.number(),
|
684
|
+
planName: f.string(),
|
685
|
+
isProviderAlpha: f.boolean(),
|
686
|
+
isFullyAuthenticated: f.boolean(),
|
687
|
+
exp: f.number()
|
688
|
+
});
|
689
|
+
function fn(e) {
|
690
|
+
try {
|
691
|
+
const n = e.split(".")[1], t = atob(n);
|
692
|
+
return rr.parse(JSON.parse(t));
|
693
|
+
} catch {
|
694
|
+
return;
|
695
|
+
}
|
696
|
+
}
|
697
|
+
const D = class D extends CustomEvent {
|
698
|
+
constructor(n) {
|
699
|
+
super(D.eventName, { detail: { token: n, payload: fn(n.accessToken) } });
|
700
|
+
}
|
701
|
+
};
|
702
|
+
ve(D, "eventName", "new-jwt-issued");
|
703
|
+
let z = D;
|
704
|
+
const ar = f.object({
|
705
|
+
accessToken: f.string(),
|
706
|
+
refreshToken: f.string()
|
707
|
+
}), ge = Nn({
|
708
|
+
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
709
|
+
method: "post",
|
710
|
+
requestPathParamsSchema: f.object({ teamId: f.number() }),
|
711
|
+
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
712
|
+
requestHeaderSchema: f.object({ Authorization: f.string().optional() }),
|
713
|
+
requestBodySchema: f.undefined(),
|
714
|
+
successResponseBodySchema: ar
|
715
|
+
}), ir = {
|
716
|
+
teamKey: (e) => ["getUserToken", e]
|
717
|
+
}, or = (e, n, t) => In({
|
718
|
+
...t,
|
719
|
+
queryFn: ({ queryKey: [r, a] }) => fe(e, ge, {
|
720
|
+
pathParams: { teamId: a },
|
721
|
+
headers: {}
|
722
|
+
}),
|
723
|
+
queryKey: ir.teamKey(n)
|
724
|
+
});
|
725
|
+
function Lr(e, n) {
|
726
|
+
const t = or(e, n), r = Ge();
|
727
|
+
return W(() => {
|
728
|
+
t.data && t.data.accessToken !== r.current && (window.dispatchEvent(new z(t.data)), r.current = t.data.accessToken);
|
729
|
+
}, [t.data]), t;
|
730
|
+
}
|
731
|
+
function $(e) {
|
732
|
+
return { Authorization: `Bearer ${e}` };
|
733
|
+
}
|
734
|
+
function sr(e, n) {
|
735
|
+
return (t) => async (r, a) => {
|
736
|
+
var l;
|
737
|
+
const o = await n.getCachedJwtToken();
|
738
|
+
if (o === void 0)
|
739
|
+
return t(r, a);
|
740
|
+
const s = await t(r, {
|
741
|
+
...a,
|
742
|
+
headers: { ...a.headers, ...$(o.accessToken) }
|
743
|
+
});
|
744
|
+
if (o && (s.status === 401 || s.status === 403)) {
|
745
|
+
const u = fn(o.accessToken);
|
746
|
+
if (!u)
|
747
|
+
return s;
|
748
|
+
const c = await fe(e, ge, {
|
749
|
+
pathParams: { teamId: u.teamId },
|
750
|
+
headers: $(o.refreshToken)
|
751
|
+
});
|
752
|
+
return await ((l = n.onNewJwtTokenIssued) == null ? void 0 : l.call(n, c)), t(r, {
|
753
|
+
...a,
|
754
|
+
headers: { ...a.headers, ...$(c.accessToken) }
|
755
|
+
});
|
756
|
+
}
|
757
|
+
return s;
|
758
|
+
};
|
759
|
+
}
|
760
|
+
const Fe = {
|
761
|
+
wretch: {
|
762
|
+
jwtAuth(e) {
|
763
|
+
return this.middlewares([sr(this, e)]);
|
764
|
+
}
|
765
|
+
}
|
766
|
+
};
|
767
|
+
function cr(e, n) {
|
768
|
+
return (t) => async (r, a) => {
|
769
|
+
var l;
|
770
|
+
if (await n.getCachedJwtToken() !== void 0)
|
771
|
+
return t(r, a);
|
772
|
+
const s = await fe(e, ge, {
|
773
|
+
pathParams: { teamId: await n.getTeamId() },
|
774
|
+
headers: {}
|
775
|
+
});
|
776
|
+
return await ((l = n.onNewJwtTokenIssued) == null ? void 0 : l.call(n, s)), t(r, {
|
777
|
+
...a,
|
778
|
+
headers: { ...a.headers, ...$(s.accessToken) }
|
779
|
+
});
|
780
|
+
};
|
781
|
+
}
|
782
|
+
async function lr() {
|
783
|
+
}
|
784
|
+
const xr = {
|
785
|
+
wretch: {
|
786
|
+
jwtAuth(e) {
|
787
|
+
return this.addon(Fe).jwtAuth(He(e));
|
788
|
+
},
|
789
|
+
jwtAuthWithClassicSessionPromotion(e) {
|
790
|
+
const n = He(e);
|
791
|
+
return this.addon(Fe).jwtAuth(n).middlewares([cr(this, n)]);
|
792
|
+
}
|
793
|
+
}
|
794
|
+
};
|
795
|
+
function He(e) {
|
796
|
+
return {
|
797
|
+
...e,
|
798
|
+
getCachedJwtToken: e.getCachedJwtToken ?? lr,
|
799
|
+
onNewJwtTokenIssued: async (n) => {
|
800
|
+
var t;
|
801
|
+
return window.dispatchEvent(new z(n)), (t = e.onNewJwtTokenIssued) == null ? void 0 : t.call(e, n);
|
802
|
+
}
|
803
|
+
};
|
804
|
+
}
|
666
805
|
export {
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
806
|
+
Ar as Breadcrumbs,
|
807
|
+
xr as BrowserJwtAuthAddon,
|
808
|
+
ln as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
809
|
+
yt as ENTERPRISE_PLAN_IDS,
|
810
|
+
Tt as ESSENTIAL_PLAN_IDS,
|
811
|
+
cn as FREE_PLAN_ID,
|
812
|
+
Fe as JwtAuthAddon,
|
813
|
+
U as NavigationPanel,
|
814
|
+
Rr as NavigationTabs,
|
815
|
+
wt as PRO_PLAN_IDS,
|
816
|
+
vt as START_PLAN_IDS,
|
676
817
|
I as Sidebar,
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
818
|
+
_t as TRIAL_PLAN_ID,
|
819
|
+
kr as convertNewLineToBreakTag,
|
820
|
+
Er as formatDate,
|
821
|
+
jr as formatDateTz,
|
822
|
+
Sr as isEnterpriseOpenSourcePlan,
|
823
|
+
Ir as isEnterprisePlan,
|
824
|
+
wr as isEssentialPlan,
|
825
|
+
he as isFreePlan,
|
826
|
+
Nr as isPaidPlan,
|
827
|
+
yr as isProPlan,
|
828
|
+
Tr as isStartPlan,
|
829
|
+
un as isTrialPlan,
|
830
|
+
Pr as makeUrlClickable,
|
831
|
+
Cr as useEffectOnce,
|
832
|
+
Lr as useGetPromotedClassicSessionJwtQuery
|
691
833
|
};
|