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