@lokalise/harmony 1.15.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.css +1 -1
- package/dist/harmony.mjs +1265 -795
- package/dist/types/src/components/Sidebar/Sidebar.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguage/TaskLanguage.d.ts +6 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguageCompleted/TaskLanguageCompleted.d.ts +7 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +5 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.test.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksContext.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksPopover/TasksPopover.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksProvider.d.ts +10 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/index.d.ts +2 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +86 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.d.ts +16 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.d.ts +24 -0
- package/dist/types/src/node.d.ts +1 -0
- package/dist/types/tests/mocks/sidebar/tasks.d.ts +2 -0
- package/package.json +1 -1
package/dist/harmony.mjs
CHANGED
@@ -1,273 +1,287 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
4
|
-
import { jsx as
|
5
|
-
import * as
|
6
|
-
import { useRef as
|
7
|
-
import { Tooltip as
|
8
|
-
import { format as
|
9
|
-
import { toZonedTime as
|
10
|
-
import { sendByPayloadRoute as
|
11
|
-
import { z as
|
12
|
-
import { buildPayloadRoute as
|
13
|
-
import { useQuery as
|
14
|
-
import { buildGetRoute as
|
15
|
-
|
16
|
-
|
1
|
+
var Kt = Object.defineProperty;
|
2
|
+
var Qt = (e, t, n) => t in e ? Kt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
+
var Je = (e, t, n) => Qt(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
+
import { jsx as a, jsxs as h, Fragment as Le } from "react/jsx-runtime";
|
5
|
+
import * as H from "react";
|
6
|
+
import { useRef as yt, useState as N, useCallback as ze, useEffect as J, useContext as Ct, createContext as wt, cloneElement as Yt, Fragment as St, forwardRef as Vt } from "react";
|
7
|
+
import { Tooltip as q, Link as L, Menu as oe, MenuList as ae, CaretUpIcon as Zt, UserIcon as kt, MenuItem as z, MenuDivider as Et, ConfirmModal as Xt, Alert as en, Tag as Ne, Button as Re, Loading as tn, Popover as nn, JobIcon as rn } from "@lokalise/louis";
|
8
|
+
import { format as It, parseISO as on } from "date-fns";
|
9
|
+
import { toZonedTime as an } from "date-fns-tz";
|
10
|
+
import { sendByPayloadRoute as G, sendByGetRoute as W } from "@lokalise/frontend-http-client";
|
11
|
+
import { z as o } from "zod";
|
12
|
+
import { buildPayloadRoute as Oe } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
13
|
+
import { useQuery as B, useMutation as Pt } from "@tanstack/react-query";
|
14
|
+
import { buildGetRoute as K } from "@lokalise/universal-ts-utils/node";
|
15
|
+
const je = {
|
16
|
+
Completed: "completed",
|
17
|
+
InProgress: "in_progress",
|
18
|
+
Created: "created",
|
19
|
+
Queued: "queued"
|
20
|
+
}, I = {
|
21
|
+
...je,
|
22
|
+
NotStarted: "not_started"
|
23
|
+
}, X = {
|
24
|
+
translation: "translation",
|
25
|
+
review: "review",
|
26
|
+
lqa_by_ai: "lqa_by_ai",
|
27
|
+
automatic_translation: "automatic_translation"
|
28
|
+
};
|
29
|
+
var ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
30
|
+
function Nt(e) {
|
17
31
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
18
32
|
}
|
19
|
-
var
|
20
|
-
function
|
21
|
-
if (
|
22
|
-
|
33
|
+
var ue, Ge;
|
34
|
+
function Me() {
|
35
|
+
if (Ge) return ue;
|
36
|
+
Ge = 1;
|
23
37
|
function e(t) {
|
24
38
|
var n = typeof t;
|
25
39
|
return t != null && (n == "object" || n == "function");
|
26
40
|
}
|
27
|
-
return
|
41
|
+
return ue = e, ue;
|
28
42
|
}
|
29
|
-
var
|
30
|
-
function
|
31
|
-
if (
|
32
|
-
|
33
|
-
var e = typeof
|
34
|
-
return
|
43
|
+
var me, We;
|
44
|
+
function sn() {
|
45
|
+
if (We) return me;
|
46
|
+
We = 1;
|
47
|
+
var e = typeof ee == "object" && ee && ee.Object === Object && ee;
|
48
|
+
return me = e, me;
|
35
49
|
}
|
36
|
-
var
|
37
|
-
function
|
38
|
-
if (
|
39
|
-
|
40
|
-
var e =
|
41
|
-
return
|
50
|
+
var fe, Ke;
|
51
|
+
function Rt() {
|
52
|
+
if (Ke) return fe;
|
53
|
+
Ke = 1;
|
54
|
+
var e = sn(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
|
55
|
+
return fe = n, fe;
|
42
56
|
}
|
43
|
-
var
|
44
|
-
function
|
45
|
-
if (
|
46
|
-
|
47
|
-
var e =
|
57
|
+
var ge, Qe;
|
58
|
+
function cn() {
|
59
|
+
if (Qe) return ge;
|
60
|
+
Qe = 1;
|
61
|
+
var e = Rt(), t = function() {
|
48
62
|
return e.Date.now();
|
49
63
|
};
|
50
|
-
return
|
64
|
+
return ge = t, ge;
|
51
65
|
}
|
52
|
-
var
|
53
|
-
function
|
54
|
-
if (
|
55
|
-
|
66
|
+
var _e, Ye;
|
67
|
+
function ln() {
|
68
|
+
if (Ye) return _e;
|
69
|
+
Ye = 1;
|
56
70
|
var e = /\s/;
|
57
71
|
function t(n) {
|
58
|
-
for (var
|
72
|
+
for (var r = n.length; r-- && e.test(n.charAt(r)); )
|
59
73
|
;
|
60
|
-
return
|
74
|
+
return r;
|
61
75
|
}
|
62
|
-
return
|
76
|
+
return _e = t, _e;
|
63
77
|
}
|
64
|
-
var
|
65
|
-
function
|
66
|
-
if (
|
67
|
-
|
68
|
-
var e =
|
69
|
-
function n(
|
70
|
-
return
|
78
|
+
var he, Ve;
|
79
|
+
function dn() {
|
80
|
+
if (Ve) return he;
|
81
|
+
Ve = 1;
|
82
|
+
var e = ln(), t = /^\s+/;
|
83
|
+
function n(r) {
|
84
|
+
return r && r.slice(0, e(r) + 1).replace(t, "");
|
71
85
|
}
|
72
|
-
return
|
86
|
+
return he = n, he;
|
73
87
|
}
|
74
|
-
var
|
75
|
-
function
|
76
|
-
if (
|
77
|
-
|
78
|
-
var e =
|
79
|
-
return
|
88
|
+
var pe, Ze;
|
89
|
+
function jt() {
|
90
|
+
if (Ze) return pe;
|
91
|
+
Ze = 1;
|
92
|
+
var e = Rt(), t = e.Symbol;
|
93
|
+
return pe = t, pe;
|
80
94
|
}
|
81
|
-
var
|
82
|
-
function
|
83
|
-
if (
|
84
|
-
|
85
|
-
var e =
|
86
|
-
function
|
87
|
-
var
|
95
|
+
var be, Xe;
|
96
|
+
function un() {
|
97
|
+
if (Xe) return be;
|
98
|
+
Xe = 1;
|
99
|
+
var e = jt(), t = Object.prototype, n = t.hasOwnProperty, r = t.toString, s = e ? e.toStringTag : void 0;
|
100
|
+
function i(c) {
|
101
|
+
var l = n.call(c, s), u = c[s];
|
88
102
|
try {
|
89
|
-
c[
|
90
|
-
var
|
103
|
+
c[s] = void 0;
|
104
|
+
var d = !0;
|
91
105
|
} catch {
|
92
106
|
}
|
93
|
-
var m =
|
94
|
-
return
|
107
|
+
var m = r.call(c);
|
108
|
+
return d && (l ? c[s] = u : delete c[s]), m;
|
95
109
|
}
|
96
|
-
return
|
110
|
+
return be = i, be;
|
97
111
|
}
|
98
|
-
var
|
99
|
-
function
|
100
|
-
if (
|
101
|
-
|
112
|
+
var ve, et;
|
113
|
+
function mn() {
|
114
|
+
if (et) return ve;
|
115
|
+
et = 1;
|
102
116
|
var e = Object.prototype, t = e.toString;
|
103
|
-
function n(
|
104
|
-
return t.call(
|
117
|
+
function n(r) {
|
118
|
+
return t.call(r);
|
105
119
|
}
|
106
|
-
return
|
120
|
+
return ve = n, ve;
|
107
121
|
}
|
108
|
-
var
|
109
|
-
function
|
110
|
-
if (
|
111
|
-
|
112
|
-
var e =
|
113
|
-
function c(
|
114
|
-
return
|
122
|
+
var Te, tt;
|
123
|
+
function fn() {
|
124
|
+
if (tt) return Te;
|
125
|
+
tt = 1;
|
126
|
+
var e = jt(), t = un(), n = mn(), r = "[object Null]", s = "[object Undefined]", i = e ? e.toStringTag : void 0;
|
127
|
+
function c(l) {
|
128
|
+
return l == null ? l === void 0 ? s : r : i && i in Object(l) ? t(l) : n(l);
|
115
129
|
}
|
116
|
-
return
|
130
|
+
return Te = c, Te;
|
117
131
|
}
|
118
|
-
var
|
119
|
-
function
|
120
|
-
if (
|
121
|
-
|
132
|
+
var ye, nt;
|
133
|
+
function gn() {
|
134
|
+
if (nt) return ye;
|
135
|
+
nt = 1;
|
122
136
|
function e(t) {
|
123
137
|
return t != null && typeof t == "object";
|
124
138
|
}
|
125
|
-
return
|
139
|
+
return ye = e, ye;
|
126
140
|
}
|
127
|
-
var
|
128
|
-
function
|
129
|
-
if (
|
130
|
-
|
131
|
-
var e =
|
132
|
-
function
|
133
|
-
return typeof
|
141
|
+
var Ce, rt;
|
142
|
+
function _n() {
|
143
|
+
if (rt) return Ce;
|
144
|
+
rt = 1;
|
145
|
+
var e = fn(), t = gn(), n = "[object Symbol]";
|
146
|
+
function r(s) {
|
147
|
+
return typeof s == "symbol" || t(s) && e(s) == n;
|
134
148
|
}
|
135
|
-
return
|
149
|
+
return Ce = r, Ce;
|
136
150
|
}
|
137
|
-
var
|
138
|
-
function
|
139
|
-
if (
|
140
|
-
|
141
|
-
var e =
|
142
|
-
function d
|
143
|
-
if (typeof
|
144
|
-
return
|
145
|
-
if (n(
|
146
|
-
return
|
147
|
-
if (t(
|
148
|
-
var m = typeof
|
149
|
-
|
151
|
+
var we, ot;
|
152
|
+
function hn() {
|
153
|
+
if (ot) return we;
|
154
|
+
ot = 1;
|
155
|
+
var e = dn(), t = Me(), n = _n(), r = NaN, s = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
|
156
|
+
function u(d) {
|
157
|
+
if (typeof d == "number")
|
158
|
+
return d;
|
159
|
+
if (n(d))
|
160
|
+
return r;
|
161
|
+
if (t(d)) {
|
162
|
+
var m = typeof d.valueOf == "function" ? d.valueOf() : d;
|
163
|
+
d = t(m) ? m + "" : m;
|
150
164
|
}
|
151
|
-
if (typeof
|
152
|
-
return
|
153
|
-
|
154
|
-
var
|
155
|
-
return
|
165
|
+
if (typeof d != "string")
|
166
|
+
return d === 0 ? d : +d;
|
167
|
+
d = e(d);
|
168
|
+
var g = i.test(d);
|
169
|
+
return g || c.test(d) ? l(d.slice(2), g ? 2 : 8) : s.test(d) ? r : +d;
|
156
170
|
}
|
157
|
-
return
|
171
|
+
return we = u, we;
|
158
172
|
}
|
159
|
-
var
|
160
|
-
function
|
161
|
-
if (
|
162
|
-
|
163
|
-
var e =
|
164
|
-
function c(u, d
|
165
|
-
var m,
|
166
|
-
if (typeof
|
167
|
-
throw new TypeError(
|
168
|
-
|
169
|
-
function
|
170
|
-
var
|
171
|
-
return m =
|
173
|
+
var Se, at;
|
174
|
+
function At() {
|
175
|
+
if (at) return Se;
|
176
|
+
at = 1;
|
177
|
+
var e = Me(), t = cn(), n = hn(), r = "Expected a function", s = Math.max, i = Math.min;
|
178
|
+
function c(l, u, d) {
|
179
|
+
var m, g, T, y, f, w, b = 0, _ = !1, p = !1, v = !0;
|
180
|
+
if (typeof l != "function")
|
181
|
+
throw new TypeError(r);
|
182
|
+
u = n(u) || 0, e(d) && (_ = !!d.leading, p = "maxWait" in d, T = p ? s(n(d.maxWait) || 0, u) : T, v = "trailing" in d ? !!d.trailing : v);
|
183
|
+
function k(C) {
|
184
|
+
var j = m, $ = g;
|
185
|
+
return m = g = void 0, b = C, y = l.apply($, j), y;
|
172
186
|
}
|
173
|
-
function
|
174
|
-
return
|
187
|
+
function S(C) {
|
188
|
+
return b = C, f = setTimeout(Z, u), _ ? k(C) : y;
|
175
189
|
}
|
176
|
-
function
|
177
|
-
var
|
178
|
-
return
|
190
|
+
function V(C) {
|
191
|
+
var j = C - w, $ = C - b, Fe = u - j;
|
192
|
+
return p ? i(Fe, T - $) : Fe;
|
179
193
|
}
|
180
|
-
function
|
181
|
-
var
|
182
|
-
return
|
194
|
+
function De(C) {
|
195
|
+
var j = C - w, $ = C - b;
|
196
|
+
return w === void 0 || j >= u || j < 0 || p && $ >= T;
|
183
197
|
}
|
184
|
-
function
|
185
|
-
var
|
186
|
-
if (
|
187
|
-
return
|
188
|
-
|
198
|
+
function Z() {
|
199
|
+
var C = t();
|
200
|
+
if (De(C))
|
201
|
+
return He(C);
|
202
|
+
f = setTimeout(Z, V(C));
|
189
203
|
}
|
190
|
-
function
|
191
|
-
return
|
204
|
+
function He(C) {
|
205
|
+
return f = void 0, v && m ? k(C) : (m = g = void 0, y);
|
192
206
|
}
|
193
|
-
function
|
194
|
-
|
207
|
+
function Gt() {
|
208
|
+
f !== void 0 && clearTimeout(f), b = 0, m = w = g = f = void 0;
|
195
209
|
}
|
196
|
-
function
|
197
|
-
return
|
210
|
+
function Wt() {
|
211
|
+
return f === void 0 ? y : He(t());
|
198
212
|
}
|
199
|
-
function
|
200
|
-
var
|
201
|
-
if (m = arguments,
|
202
|
-
if (
|
203
|
-
return
|
204
|
-
if (
|
205
|
-
return clearTimeout(
|
213
|
+
function de() {
|
214
|
+
var C = t(), j = De(C);
|
215
|
+
if (m = arguments, g = this, w = C, j) {
|
216
|
+
if (f === void 0)
|
217
|
+
return S(w);
|
218
|
+
if (p)
|
219
|
+
return clearTimeout(f), f = setTimeout(Z, u), k(w);
|
206
220
|
}
|
207
|
-
return
|
221
|
+
return f === void 0 && (f = setTimeout(Z, u)), y;
|
208
222
|
}
|
209
|
-
return
|
223
|
+
return de.cancel = Gt, de.flush = Wt, de;
|
210
224
|
}
|
211
|
-
return
|
225
|
+
return Se = c, Se;
|
212
226
|
}
|
213
|
-
var
|
214
|
-
const
|
215
|
-
var
|
216
|
-
function
|
217
|
-
if (
|
218
|
-
|
219
|
-
var e =
|
220
|
-
function
|
221
|
-
var
|
222
|
-
if (typeof
|
227
|
+
var pn = At();
|
228
|
+
const bn = /* @__PURE__ */ Nt(pn);
|
229
|
+
var ke, st;
|
230
|
+
function vn() {
|
231
|
+
if (st) return ke;
|
232
|
+
st = 1;
|
233
|
+
var e = At(), t = Me(), n = "Expected a function";
|
234
|
+
function r(s, i, c) {
|
235
|
+
var l = !0, u = !0;
|
236
|
+
if (typeof s != "function")
|
223
237
|
throw new TypeError(n);
|
224
|
-
return t(c) && (
|
225
|
-
leading:
|
226
|
-
maxWait:
|
227
|
-
trailing:
|
238
|
+
return t(c) && (l = "leading" in c ? !!c.leading : l, u = "trailing" in c ? !!c.trailing : u), e(s, i, {
|
239
|
+
leading: l,
|
240
|
+
maxWait: i,
|
241
|
+
trailing: u
|
228
242
|
});
|
229
243
|
}
|
230
|
-
return
|
244
|
+
return ke = r, ke;
|
231
245
|
}
|
232
|
-
var
|
233
|
-
const
|
246
|
+
var Tn = vn();
|
247
|
+
const yn = /* @__PURE__ */ Nt(Tn), Cn = (e, t, n, r) => {
|
234
248
|
switch (t) {
|
235
249
|
case "debounce":
|
236
|
-
return
|
250
|
+
return bn(e, n, r);
|
237
251
|
case "throttle":
|
238
|
-
return
|
252
|
+
return yn(e, n, r);
|
239
253
|
default:
|
240
254
|
return e;
|
241
255
|
}
|
242
|
-
},
|
256
|
+
}, wn = (
|
243
257
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
244
258
|
(e) => {
|
245
|
-
const t =
|
246
|
-
return
|
259
|
+
const t = H.useRef(e);
|
260
|
+
return H.useEffect(() => {
|
247
261
|
t.current = e;
|
248
|
-
}),
|
249
|
-
var
|
250
|
-
return (
|
262
|
+
}), H.useMemo(() => (...n) => {
|
263
|
+
var r;
|
264
|
+
return (r = t.current) === null || r === void 0 ? void 0 : r.call(t, ...n);
|
251
265
|
}, []);
|
252
266
|
}
|
253
|
-
),
|
267
|
+
), Sn = (
|
254
268
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
255
269
|
(e) => {
|
256
|
-
const [t, n] =
|
270
|
+
const [t, n] = H.useState((e == null ? void 0 : e.current) || null);
|
257
271
|
return e && setTimeout(() => {
|
258
272
|
e.current !== t && n(e.current);
|
259
|
-
}, 0), { refProxy:
|
260
|
-
|
273
|
+
}, 0), { refProxy: H.useMemo(() => new Proxy((s) => {
|
274
|
+
s !== t && n(s);
|
261
275
|
}, {
|
262
|
-
get(
|
263
|
-
return
|
276
|
+
get(s, i) {
|
277
|
+
return i === "current" ? t : s[i];
|
264
278
|
},
|
265
|
-
set(
|
266
|
-
return
|
279
|
+
set(s, i, c) {
|
280
|
+
return i === "current" ? n(c) : s[i] = c, !0;
|
267
281
|
}
|
268
282
|
}), [t]), refElement: t, setRefElement: n };
|
269
283
|
}
|
270
|
-
),
|
284
|
+
), kn = (e, t) => t === "border-box" ? {
|
271
285
|
width: e.borderBoxSize[0].inlineSize,
|
272
286
|
height: e.borderBoxSize[0].blockSize
|
273
287
|
} : t === "content-box" ? {
|
@@ -277,386 +291,839 @@ const Vt = /* @__PURE__ */ mt(Yt), Zt = (e, t, n, o) => {
|
|
277
291
|
width: e.contentRect.width,
|
278
292
|
height: e.contentRect.height
|
279
293
|
};
|
280
|
-
function
|
281
|
-
const
|
294
|
+
function En({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: r, handleWidth: s = !0, handleHeight: i = !0, targetRef: c, observerOptions: l, onResize: u } = {}) {
|
295
|
+
const d = yt(e), m = wn(u), [g, T] = N({
|
282
296
|
width: void 0,
|
283
297
|
height: void 0
|
284
|
-
}), { refProxy:
|
285
|
-
if (!
|
298
|
+
}), { refProxy: y, refElement: f } = Sn(c), { box: w } = l || {}, b = ze((p) => {
|
299
|
+
if (!s && !i)
|
286
300
|
return;
|
287
|
-
if (
|
288
|
-
|
301
|
+
if (d.current) {
|
302
|
+
d.current = !1;
|
289
303
|
return;
|
290
304
|
}
|
291
|
-
const
|
292
|
-
|
293
|
-
const
|
294
|
-
|
295
|
-
width:
|
296
|
-
height:
|
297
|
-
entry:
|
298
|
-
}),
|
305
|
+
const v = (k, S) => s && k.width !== S.width || i && k.height !== S.height;
|
306
|
+
p.forEach((k) => {
|
307
|
+
const S = kn(k, w);
|
308
|
+
T((V) => v(V, S) ? (m == null || m({
|
309
|
+
width: S.width,
|
310
|
+
height: S.height,
|
311
|
+
entry: k
|
312
|
+
}), S) : V);
|
299
313
|
});
|
300
|
-
}, [
|
301
|
-
|
314
|
+
}, [s, i, d, w]), _ = ze(Cn(b, t, n, r), [
|
315
|
+
b,
|
302
316
|
t,
|
303
317
|
n,
|
304
|
-
|
318
|
+
r
|
305
319
|
]);
|
306
|
-
return
|
307
|
-
let
|
308
|
-
return
|
320
|
+
return J(() => {
|
321
|
+
let p;
|
322
|
+
return f ? (p = new window.ResizeObserver(_), p.observe(f, l)) : (g.width || g.height) && (m == null || m({
|
309
323
|
width: null,
|
310
324
|
height: null,
|
311
325
|
entry: null
|
312
|
-
}),
|
313
|
-
var
|
314
|
-
(
|
326
|
+
}), T({ width: void 0, height: void 0 })), () => {
|
327
|
+
var v, k, S;
|
328
|
+
(v = p == null ? void 0 : p.disconnect) === null || v === void 0 || v.call(p), (S = (k = _).cancel) === null || S === void 0 || S.call(k);
|
315
329
|
};
|
316
|
-
}, [
|
330
|
+
}, [_, f]), Object.assign({ ref: y }, g);
|
317
331
|
}
|
318
|
-
function
|
319
|
-
var t, n,
|
320
|
-
if (typeof e == "string" || typeof e == "number")
|
332
|
+
function xt(e) {
|
333
|
+
var t, n, r = "";
|
334
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
321
335
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
322
|
-
var
|
323
|
-
for (t = 0; t <
|
324
|
-
} else for (n in e) e[n] && (
|
325
|
-
return
|
336
|
+
var s = e.length;
|
337
|
+
for (t = 0; t < s; t++) e[t] && (n = xt(e[t])) && (r && (r += " "), r += n);
|
338
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
339
|
+
return r;
|
326
340
|
}
|
327
|
-
function
|
328
|
-
for (var e, t, n = 0,
|
329
|
-
return
|
341
|
+
function R() {
|
342
|
+
for (var e, t, n = 0, r = "", s = arguments.length; n < s; n++) (e = arguments[n]) && (t = xt(e)) && (r && (r += " "), r += t);
|
343
|
+
return r;
|
330
344
|
}
|
331
|
-
const
|
332
|
-
headerContainer:
|
333
|
-
navigationTabList:
|
334
|
-
navigationTab:
|
335
|
-
headerContent:
|
336
|
-
staticEnabled:
|
337
|
-
},
|
338
|
-
const { ref: n, height:
|
345
|
+
const In = "_headerContainer_1cubo_1", Pn = "_navigationTabList_1cubo_8", Nn = "_navigationTab_1cubo_8", Rn = "_headerContent_1cubo_34", jn = "_staticEnabled_1cubo_50", U = {
|
346
|
+
headerContainer: In,
|
347
|
+
navigationTabList: Pn,
|
348
|
+
navigationTab: Nn,
|
349
|
+
headerContent: Rn,
|
350
|
+
staticEnabled: jn
|
351
|
+
}, An = 77, ne = ({ sticky: e, children: t }) => {
|
352
|
+
const { ref: n, height: r } = En({
|
339
353
|
refreshMode: "debounce",
|
340
354
|
refreshRate: 0
|
341
|
-
}), [
|
342
|
-
|
343
|
-
const
|
344
|
-
|
355
|
+
}), [s, i] = N(!1), c = () => s ? !e : !0;
|
356
|
+
J(() => {
|
357
|
+
const u = () => {
|
358
|
+
i(window.scrollY > 0);
|
345
359
|
};
|
346
|
-
return window.addEventListener("scroll",
|
360
|
+
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
347
361
|
}, []);
|
348
|
-
const
|
349
|
-
return /* @__PURE__ */
|
362
|
+
const l = `${r || An}px`;
|
363
|
+
return /* @__PURE__ */ a("div", { style: { minHeight: l }, children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ h(
|
350
364
|
"div",
|
351
365
|
{
|
352
366
|
ref: n,
|
353
|
-
className:
|
354
|
-
[
|
367
|
+
className: R(U.headerContent, {
|
368
|
+
[U.staticEnabled]: c()
|
355
369
|
}),
|
356
370
|
children: [
|
357
|
-
/* @__PURE__ */
|
358
|
-
/* @__PURE__ */
|
371
|
+
/* @__PURE__ */ a(ne.Header, {}),
|
372
|
+
/* @__PURE__ */ a(ne.Tabs, {}),
|
359
373
|
t
|
360
374
|
]
|
361
375
|
}
|
362
376
|
) }) });
|
363
377
|
};
|
364
|
-
|
365
|
-
|
366
|
-
const
|
367
|
-
sidebarContainer:
|
368
|
-
},
|
369
|
-
logoLink:
|
370
|
-
},
|
371
|
-
link:
|
372
|
-
active:
|
373
|
-
},
|
374
|
-
|
378
|
+
ne.Header = ({ children: e }) => /* @__PURE__ */ a("div", { className: U.headerContainer, children: e });
|
379
|
+
ne.Tabs = ({ children: e }) => /* @__PURE__ */ a("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
380
|
+
const xn = "_sidebarContainer_bmdti_1", Ln = {
|
381
|
+
sidebarContainer: xn
|
382
|
+
}, On = "_logoLink_1baxb_1", Mn = {
|
383
|
+
logoLink: On
|
384
|
+
}, Un = ({ src: e, href: t = "/", ariaLabel: n = "Home", alt: r = "Lokalise" }) => /* @__PURE__ */ a("a", { className: Mn.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ a("img", { src: e, alt: r }) }), qn = "_link_18vhx_1", Bn = "_active_18vhx_18", it = {
|
385
|
+
link: qn,
|
386
|
+
active: Bn
|
387
|
+
}, $n = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ a(q, { placement: "right", tooltip: e, children: /* @__PURE__ */ a(
|
388
|
+
L,
|
375
389
|
{
|
376
|
-
className:
|
377
|
-
[
|
390
|
+
className: R(it.link, {
|
391
|
+
[it.active]: window.location.pathname.startsWith(t)
|
378
392
|
}),
|
379
393
|
href: t,
|
380
|
-
children: /* @__PURE__ */
|
394
|
+
children: /* @__PURE__ */ a(n, { size: "25px" })
|
381
395
|
}
|
382
|
-
) }),
|
383
|
-
dropdownButton:
|
384
|
-
dropdownButtonActive:
|
385
|
-
},
|
386
|
-
|
396
|
+
) }), Dn = "_dropdownButton_13l5r_1", Hn = "_dropdownButtonActive_13l5r_18", ct = {
|
397
|
+
dropdownButton: Dn,
|
398
|
+
dropdownButtonActive: Hn
|
399
|
+
}, Fn = ({ children: e, icon: t }) => /* @__PURE__ */ a(
|
400
|
+
oe,
|
387
401
|
{
|
388
|
-
menuButton: ({ opened: n }) => /* @__PURE__ */
|
402
|
+
menuButton: ({ opened: n }) => /* @__PURE__ */ a(q, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ a(
|
389
403
|
"button",
|
390
404
|
{
|
391
405
|
type: "button",
|
392
|
-
className:
|
393
|
-
[
|
406
|
+
className: R(ct.dropdownButton, {
|
407
|
+
[ct.dropdownButtonActive]: n
|
394
408
|
}),
|
395
|
-
children: /* @__PURE__ */
|
409
|
+
children: /* @__PURE__ */ a(t, { size: "25px" })
|
396
410
|
}
|
397
411
|
) }),
|
398
|
-
children: /* @__PURE__ */
|
412
|
+
children: /* @__PURE__ */ a(ae, { placement: "right-start", children: e })
|
399
413
|
}
|
400
|
-
),
|
401
|
-
iconContainer:
|
402
|
-
},
|
414
|
+
), Jn = "_iconContainer_nz34m_1", zn = {
|
415
|
+
iconContainer: Jn
|
416
|
+
}, Lt = ({ className: e = "" }) => /* @__PURE__ */ a(
|
403
417
|
"div",
|
404
418
|
{
|
405
419
|
"aria-label": "Upgrade Icon",
|
406
|
-
className:
|
407
|
-
|
420
|
+
className: R(
|
421
|
+
zn.iconContainer,
|
408
422
|
"flex-row",
|
409
423
|
"items-center",
|
410
424
|
"justify-center",
|
411
425
|
e
|
412
426
|
),
|
413
|
-
children: /* @__PURE__ */
|
427
|
+
children: /* @__PURE__ */ a(Zt, {})
|
414
428
|
}
|
415
|
-
),
|
416
|
-
menuContainer:
|
417
|
-
profileButton:
|
418
|
-
profileImage:
|
419
|
-
profileImageHighlight:
|
420
|
-
profileImageUpgradeIcon:
|
421
|
-
userIconWrapper:
|
422
|
-
},
|
429
|
+
), Gn = "_menuContainer_ywskt_5", Wn = "_profileButton_ywskt_15", Kn = "_profileImage_ywskt_28", Qn = "_profileImageHighlight_ywskt_36", Yn = "_profileImageUpgradeIcon_ywskt_40", Vn = "_userIconWrapper_ywskt_46", A = {
|
430
|
+
menuContainer: Gn,
|
431
|
+
profileButton: Wn,
|
432
|
+
profileImage: Kn,
|
433
|
+
profileImageHighlight: Qn,
|
434
|
+
profileImageUpgradeIcon: Yn,
|
435
|
+
userIconWrapper: Vn
|
436
|
+
}, Ot = wt({}), Q = () => Ct(Ot), Zn = ({ children: e }) => {
|
423
437
|
const {
|
424
438
|
currentTeam: t,
|
425
439
|
otherTeams: n,
|
426
|
-
showUpgradeCta:
|
427
|
-
showBillingButton:
|
428
|
-
allowTeamCreation:
|
440
|
+
showUpgradeCta: r,
|
441
|
+
showBillingButton: s,
|
442
|
+
allowTeamCreation: i,
|
429
443
|
isProviderAlpha: c,
|
430
|
-
canAccessTeamSettings:
|
431
|
-
isEndOfTrialActive:
|
432
|
-
isTeamSuspended:
|
444
|
+
canAccessTeamSettings: l,
|
445
|
+
isEndOfTrialActive: u,
|
446
|
+
isTeamSuspended: d,
|
433
447
|
isFullyAuthenticated: m
|
434
|
-
} =
|
435
|
-
return /* @__PURE__ */
|
436
|
-
|
448
|
+
} = Q();
|
449
|
+
return /* @__PURE__ */ a(
|
450
|
+
oe,
|
437
451
|
{
|
438
|
-
menuButton: () => /* @__PURE__ */
|
439
|
-
t != null && t.logoUrl ? /* @__PURE__ */
|
452
|
+
menuButton: () => /* @__PURE__ */ h("button", { className: A.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
453
|
+
t != null && t.logoUrl ? /* @__PURE__ */ a(
|
440
454
|
"img",
|
441
455
|
{
|
442
456
|
src: t.logoUrl,
|
443
|
-
className:
|
444
|
-
[
|
457
|
+
className: R(A.profileImage, {
|
458
|
+
[A.profileImageHighlight]: r
|
445
459
|
}),
|
446
460
|
alt: "Team Logo"
|
447
461
|
}
|
448
|
-
) : /* @__PURE__ */
|
462
|
+
) : /* @__PURE__ */ a(
|
449
463
|
"div",
|
450
464
|
{
|
451
|
-
className:
|
452
|
-
[
|
465
|
+
className: R(A.userIconWrapper, "flex-row", "align-center", "items-center", {
|
466
|
+
[A.profileImageHighlight]: r
|
453
467
|
}),
|
454
|
-
children: /* @__PURE__ */
|
468
|
+
children: /* @__PURE__ */ a(kt, { size: "25px" })
|
455
469
|
}
|
456
470
|
),
|
457
|
-
|
471
|
+
r && /* @__PURE__ */ a(Lt, { className: A.profileImageUpgradeIcon })
|
458
472
|
] }),
|
459
|
-
children: /* @__PURE__ */
|
460
|
-
allowTeamCreation:
|
473
|
+
children: /* @__PURE__ */ a(ae, { placement: "right-end", className: A.menuContainer, children: e({
|
474
|
+
allowTeamCreation: i,
|
461
475
|
otherTeams: n,
|
462
|
-
canAccessTeamSettings:
|
463
|
-
isEndOfTrialActive:
|
464
|
-
isTeamSuspended:
|
465
|
-
showBillingButton:
|
476
|
+
canAccessTeamSettings: l,
|
477
|
+
isEndOfTrialActive: u,
|
478
|
+
isTeamSuspended: d,
|
479
|
+
showBillingButton: s,
|
466
480
|
isProviderAlpha: c,
|
467
481
|
isFullyAuthenticated: m
|
468
482
|
}) })
|
469
483
|
}
|
470
484
|
);
|
471
|
-
},
|
472
|
-
const
|
473
|
-
if (
|
485
|
+
}, Mt = 0, Xn = 9999, er = [150, 151, 250, 251], tr = [152, 153, 252, 253], nr = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], rr = [156, 159, 160, 256, 259, 260], Ut = 9998, Ue = (e) => e === Mt, qt = (e) => e === Xn, Ta = (e) => er.includes(e), ya = (e) => tr.includes(e), Ca = (e) => nr.includes(e), wa = (e) => rr.includes(e), Sa = (e) => e > Mt && e < Ut, ka = (e) => e === Ut, or = /\n/, lt = (e, t, n) => e.split(t).flatMap((r, s) => s !== 0 ? [Yt(n, { key: Math.random().toString(32).slice(0, 10) }), r] : r), ar = (e, t, n) => typeof e == "string" ? lt(e, t, n) : e.flatMap((r) => typeof r == "string" ? lt(r, t, n) : r), sr = (e) => ar(e, or, /* @__PURE__ */ a("br", {})), ir = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, cr = (e) => e.match(ir) ?? [], dt = (e, t, n) => {
|
486
|
+
const r = e.split(t);
|
487
|
+
if (r.length === 1)
|
474
488
|
return e;
|
475
|
-
const
|
476
|
-
return
|
477
|
-
/* @__PURE__ */
|
478
|
-
),
|
479
|
-
},
|
480
|
-
const t =
|
481
|
-
return t != null && t.length ? t.reduce((n,
|
482
|
-
},
|
483
|
-
|
484
|
-
},
|
489
|
+
const s = [];
|
490
|
+
return r[0] !== "" && s.push(r[0]), r.shift(), r[r.length - 1] === "" && r.pop(), s.push(
|
491
|
+
/* @__PURE__ */ a("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
|
492
|
+
), s.push(r.join(t)), s.filter((i) => i !== "");
|
493
|
+
}, ut = (e) => {
|
494
|
+
const t = cr(e);
|
495
|
+
return t != null && t.length ? t.reduce((n, r, s) => typeof n == "string" ? dt(n, r, s) : n.flatMap((i) => typeof i == "string" ? dt(i, r, s) : i), e) : e;
|
496
|
+
}, lr = (e) => typeof e == "string" ? ut(e) : e.flatMap((t) => typeof t == "string" ? ut(t) : t, e), dr = (e, t = "PP") => It(e, t), Ea = (e, t, n = "PP") => It(an(e, t), n), qe = (e) => {
|
497
|
+
J(e, []);
|
498
|
+
}, mt = {
|
485
499
|
biller: "biller",
|
486
500
|
owner: "owner"
|
487
|
-
},
|
488
|
-
|
489
|
-
|
490
|
-
],
|
491
|
-
const { teams: n, currentTeamId:
|
501
|
+
}, ft = [
|
502
|
+
mt.biller,
|
503
|
+
mt.owner
|
504
|
+
], ur = ({ children: e, config: t }) => {
|
505
|
+
const { teams: n, currentTeamId: r, planId: s, isEndOfTrialActive: i, isFullyAuthenticated: c, userTeamRole: l } = t, u = n.find((_) => _.id === r), d = n.filter((_) => _.id !== r), m = ft.includes(l), g = ft.includes(l), T = Ue(s) || qt(s), b = {
|
492
506
|
...t,
|
493
|
-
currentTeam:
|
494
|
-
otherTeams:
|
507
|
+
currentTeam: u,
|
508
|
+
otherTeams: d,
|
495
509
|
canChangeBilling: m,
|
496
|
-
canAccessTeamSettings:
|
497
|
-
isOnFreeOrTrialPlan:
|
498
|
-
showUpgradeCta: c &&
|
499
|
-
showBillingButton: c &&
|
500
|
-
allowTeamCreation: c && !
|
510
|
+
canAccessTeamSettings: g,
|
511
|
+
isOnFreeOrTrialPlan: T,
|
512
|
+
showUpgradeCta: c && T && m,
|
513
|
+
showBillingButton: c && g && m,
|
514
|
+
allowTeamCreation: c && !i
|
501
515
|
};
|
502
|
-
return /* @__PURE__ */
|
503
|
-
},
|
504
|
-
container:
|
505
|
-
profileEmail:
|
506
|
-
},
|
516
|
+
return /* @__PURE__ */ a(Ot.Provider, { value: b, children: e });
|
517
|
+
}, mr = ({ config: e, children: t }) => /* @__PURE__ */ a(ur, { config: e, children: /* @__PURE__ */ a(Zn, { children: t }) }), fr = "_container_q5pot_1", gr = "_profileEmail_q5pot_5", gt = {
|
518
|
+
container: fr,
|
519
|
+
profileEmail: gr
|
520
|
+
}, _r = ({
|
507
521
|
href: e,
|
508
522
|
onClick: t,
|
509
523
|
userEmail: n,
|
510
|
-
hideBottomDivider:
|
524
|
+
hideBottomDivider: r
|
511
525
|
}) => {
|
512
|
-
const { isEndOfTrialActive:
|
513
|
-
return
|
514
|
-
/* @__PURE__ */
|
515
|
-
|
526
|
+
const { isEndOfTrialActive: s, isTeamSuspended: i } = Q();
|
527
|
+
return s || i ? null : /* @__PURE__ */ h(Le, { children: [
|
528
|
+
/* @__PURE__ */ a(
|
529
|
+
z,
|
516
530
|
{
|
517
531
|
href: e,
|
518
532
|
onClick: () => {
|
519
533
|
t == null || t();
|
520
534
|
},
|
521
|
-
children: /* @__PURE__ */
|
522
|
-
/* @__PURE__ */
|
523
|
-
/* @__PURE__ */
|
535
|
+
children: /* @__PURE__ */ h("div", { className: `flex-col ${gt.container}`, children: [
|
536
|
+
/* @__PURE__ */ a("span", { children: "Profile Settings" }),
|
537
|
+
/* @__PURE__ */ a("span", { className: gt.profileEmail, children: n })
|
524
538
|
] })
|
525
539
|
}
|
526
540
|
),
|
527
|
-
!
|
541
|
+
!r && /* @__PURE__ */ a(Et, {})
|
528
542
|
] });
|
529
|
-
},
|
530
|
-
wrapper:
|
531
|
-
profileImage:
|
532
|
-
teamName:
|
533
|
-
planLabel:
|
534
|
-
membership:
|
535
|
-
defaultProfileImage:
|
536
|
-
},
|
537
|
-
const { currentTeam:
|
538
|
-
if (!
|
543
|
+
}, hr = "_wrapper_15d85_1", pr = "_profileImage_15d85_14", br = "_teamName_15d85_22", vr = "_planLabel_15d85_29", Tr = "_membership_15d85_38", yr = "_defaultProfileImage_15d85_44", O = {
|
544
|
+
wrapper: hr,
|
545
|
+
profileImage: pr,
|
546
|
+
teamName: br,
|
547
|
+
planLabel: vr,
|
548
|
+
membership: Tr,
|
549
|
+
defaultProfileImage: yr
|
550
|
+
}, Bt = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
551
|
+
const { currentTeam: r, planId: s } = Q(), i = e || r;
|
552
|
+
if (!i)
|
539
553
|
return null;
|
540
|
-
const c =
|
541
|
-
return /* @__PURE__ */
|
542
|
-
t ?
|
554
|
+
const c = Ue(s) ? "Free" : qt(s) ? "Trial" : void 0;
|
555
|
+
return /* @__PURE__ */ h(
|
556
|
+
t ? z : "div",
|
543
557
|
{
|
544
|
-
className: `flex-row gap-2 flex-nowrap items-center ${
|
545
|
-
...t && { onClick: () => t(
|
558
|
+
className: `flex-row gap-2 flex-nowrap items-center ${O.wrapper}`,
|
559
|
+
...t && { onClick: () => t(i) },
|
546
560
|
children: [
|
547
|
-
|
548
|
-
/* @__PURE__ */
|
549
|
-
/* @__PURE__ */
|
550
|
-
/* @__PURE__ */
|
551
|
-
c && !n && /* @__PURE__ */
|
561
|
+
i.logoUrl ? /* @__PURE__ */ a("img", { className: O.profileImage, src: i.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ a("span", { className: `flex-row justify-center items-center ${O.defaultProfileImage}`, children: /* @__PURE__ */ a(kt, { size: "25px" }) }),
|
562
|
+
/* @__PURE__ */ h("div", { className: "flex-col items-start", children: [
|
563
|
+
/* @__PURE__ */ h("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
564
|
+
/* @__PURE__ */ a("span", { title: i.name, className: O.teamName, children: i.name }),
|
565
|
+
c && !n && /* @__PURE__ */ a("span", { className: `flex-row justify-center items-center ${O.planLabel}`, children: c })
|
552
566
|
] }),
|
553
|
-
/* @__PURE__ */
|
567
|
+
/* @__PURE__ */ a("span", { className: O.membership, children: i.role })
|
554
568
|
] })
|
555
569
|
]
|
556
570
|
}
|
557
571
|
);
|
558
|
-
},
|
559
|
-
teamsContainer:
|
560
|
-
},
|
561
|
-
const { otherTeams: t } =
|
562
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
563
|
-
},
|
564
|
-
container:
|
565
|
-
planCta:
|
566
|
-
upgradeIconWrapper:
|
567
|
-
},
|
568
|
-
const { planId: t, trialDaysLeft: n, showUpgradeCta:
|
569
|
-
if (!
|
572
|
+
}, Cr = "_teamsContainer_1t68g_1", wr = {
|
573
|
+
teamsContainer: Cr
|
574
|
+
}, Sr = ({ onSwitchTeam: e }) => {
|
575
|
+
const { otherTeams: t } = Q();
|
576
|
+
return t.length === 0 ? null : /* @__PURE__ */ a("div", { className: `flex-col items-stretch ${wr.teamsContainer}`, children: t.map((n) => /* @__PURE__ */ a(Bt, { team: n, onClick: e, hidePlanLabel: !0 }, n.id)) });
|
577
|
+
}, kr = "_container_1u995_1", Er = "_planCta_1u995_15", Ir = "_upgradeIconWrapper_1u995_19", Ee = {
|
578
|
+
container: kr,
|
579
|
+
planCta: Er,
|
580
|
+
upgradeIconWrapper: Ir
|
581
|
+
}, Pr = ({ upgradeOptionHref: e }) => {
|
582
|
+
const { planId: t, trialDaysLeft: n, showUpgradeCta: r } = Q();
|
583
|
+
if (!r)
|
570
584
|
return null;
|
571
|
-
const c =
|
572
|
-
return /* @__PURE__ */
|
573
|
-
/* @__PURE__ */
|
574
|
-
/* @__PURE__ */
|
575
|
-
/* @__PURE__ */
|
576
|
-
/* @__PURE__ */
|
585
|
+
const c = Ue(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
586
|
+
return /* @__PURE__ */ h(z, { href: e, className: `flex-col gap-1 items-start ${Ee.container}`, children: [
|
587
|
+
/* @__PURE__ */ a("span", { className: Ee.planCta, children: c }),
|
588
|
+
/* @__PURE__ */ h("div", { className: `flex-row items-center gap-1 ${Ee.upgradeIconWrapper}`, children: [
|
589
|
+
/* @__PURE__ */ a(Lt, {}),
|
590
|
+
/* @__PURE__ */ a("span", { children: "See upgrade options" })
|
577
591
|
] })
|
578
592
|
] });
|
579
|
-
},
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
}
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
593
|
+
}, Nr = Math.min, Rr = Math.max;
|
594
|
+
function _t(e, t, n) {
|
595
|
+
return Rr(e, Nr(t, n));
|
596
|
+
}
|
597
|
+
function $t(e, t) {
|
598
|
+
return typeof e == "function" ? e(t) : e;
|
599
|
+
}
|
600
|
+
function Dt(e) {
|
601
|
+
return e.split("-")[0];
|
602
|
+
}
|
603
|
+
function jr(e) {
|
604
|
+
return e === "x" ? "y" : "x";
|
605
|
+
}
|
606
|
+
function Ar(e) {
|
607
|
+
return ["top", "bottom"].includes(Dt(e)) ? "y" : "x";
|
608
|
+
}
|
609
|
+
function xr(e) {
|
610
|
+
return {
|
611
|
+
top: 0,
|
612
|
+
right: 0,
|
613
|
+
bottom: 0,
|
614
|
+
left: 0,
|
615
|
+
...e
|
616
|
+
};
|
617
|
+
}
|
618
|
+
function Lr(e) {
|
619
|
+
return typeof e != "number" ? xr(e) : {
|
620
|
+
top: e,
|
621
|
+
right: e,
|
622
|
+
bottom: e,
|
623
|
+
left: e
|
624
|
+
};
|
625
|
+
}
|
626
|
+
function ht(e) {
|
627
|
+
const {
|
628
|
+
x: t,
|
629
|
+
y: n,
|
630
|
+
width: r,
|
631
|
+
height: s
|
632
|
+
} = e;
|
633
|
+
return {
|
634
|
+
width: r,
|
635
|
+
height: s,
|
636
|
+
top: n,
|
637
|
+
left: t,
|
638
|
+
right: t + r,
|
639
|
+
bottom: n + s,
|
640
|
+
x: t,
|
641
|
+
y: n
|
642
|
+
};
|
643
|
+
}
|
644
|
+
async function Or(e, t) {
|
645
|
+
var n;
|
646
|
+
t === void 0 && (t = {});
|
647
|
+
const {
|
648
|
+
x: r,
|
649
|
+
y: s,
|
650
|
+
platform: i,
|
651
|
+
rects: c,
|
652
|
+
elements: l,
|
653
|
+
strategy: u
|
654
|
+
} = e, {
|
655
|
+
boundary: d = "clippingAncestors",
|
656
|
+
rootBoundary: m = "viewport",
|
657
|
+
elementContext: g = "floating",
|
658
|
+
altBoundary: T = !1,
|
659
|
+
padding: y = 0
|
660
|
+
} = $t(t, e), f = Lr(y), b = l[T ? g === "floating" ? "reference" : "floating" : g], _ = ht(await i.getClippingRect({
|
661
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(b))) == null || n ? b : b.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
|
662
|
+
boundary: d,
|
663
|
+
rootBoundary: m,
|
664
|
+
strategy: u
|
665
|
+
})), p = g === "floating" ? {
|
666
|
+
x: r,
|
667
|
+
y: s,
|
668
|
+
width: c.floating.width,
|
669
|
+
height: c.floating.height
|
670
|
+
} : c.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), k = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
|
671
|
+
x: 1,
|
672
|
+
y: 1
|
673
|
+
} : {
|
674
|
+
x: 1,
|
675
|
+
y: 1
|
676
|
+
}, S = ht(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
677
|
+
elements: l,
|
678
|
+
rect: p,
|
679
|
+
offsetParent: v,
|
680
|
+
strategy: u
|
681
|
+
}) : p);
|
682
|
+
return {
|
683
|
+
top: (_.top - S.top + f.top) / k.y,
|
684
|
+
bottom: (S.bottom - _.bottom + f.bottom) / k.y,
|
685
|
+
left: (_.left - S.left + f.left) / k.x,
|
686
|
+
right: (S.right - _.right + f.right) / k.x
|
687
|
+
};
|
688
|
+
}
|
689
|
+
const Mr = function(e) {
|
690
|
+
return e === void 0 && (e = {}), {
|
691
|
+
name: "shift",
|
692
|
+
options: e,
|
693
|
+
async fn(t) {
|
694
|
+
const {
|
695
|
+
x: n,
|
696
|
+
y: r,
|
697
|
+
placement: s
|
698
|
+
} = t, {
|
699
|
+
mainAxis: i = !0,
|
700
|
+
crossAxis: c = !1,
|
701
|
+
limiter: l = {
|
702
|
+
fn: (b) => {
|
703
|
+
let {
|
704
|
+
x: _,
|
705
|
+
y: p
|
706
|
+
} = b;
|
707
|
+
return {
|
708
|
+
x: _,
|
709
|
+
y: p
|
710
|
+
};
|
711
|
+
}
|
712
|
+
},
|
713
|
+
...u
|
714
|
+
} = $t(e, t), d = {
|
715
|
+
x: n,
|
716
|
+
y: r
|
717
|
+
}, m = await Or(t, u), g = Ar(Dt(s)), T = jr(g);
|
718
|
+
let y = d[T], f = d[g];
|
719
|
+
if (i) {
|
720
|
+
const b = T === "y" ? "top" : "left", _ = T === "y" ? "bottom" : "right", p = y + m[b], v = y - m[_];
|
721
|
+
y = _t(p, y, v);
|
722
|
+
}
|
723
|
+
if (c) {
|
724
|
+
const b = g === "y" ? "top" : "left", _ = g === "y" ? "bottom" : "right", p = f + m[b], v = f - m[_];
|
725
|
+
f = _t(p, f, v);
|
726
|
+
}
|
727
|
+
const w = l.fn({
|
728
|
+
...t,
|
729
|
+
[T]: y,
|
730
|
+
[g]: f
|
731
|
+
});
|
732
|
+
return {
|
733
|
+
...w,
|
734
|
+
data: {
|
735
|
+
x: w.x - n,
|
736
|
+
y: w.y - r,
|
737
|
+
enabled: {
|
738
|
+
[T]: i,
|
739
|
+
[g]: c
|
740
|
+
}
|
741
|
+
}
|
742
|
+
};
|
743
|
+
}
|
744
|
+
};
|
745
|
+
}, Ur = "_navItem_1dudv_1", qr = "_activeNavItem_1dudv_18", Br = "_badge_1dudv_23", Ie = {
|
746
|
+
navItem: Ur,
|
747
|
+
activeNavItem: qr,
|
748
|
+
badge: Br
|
749
|
+
}, Ht = wt({}), Y = () => Ct(Ht), $r = (e) => {
|
750
|
+
const t = e.lastIndexOf("."), n = e.slice(0, t), r = e.slice(t + 1);
|
751
|
+
return { name: n, extension: r };
|
752
|
+
}, Dr = (e, t) => {
|
753
|
+
switch (e) {
|
754
|
+
case I.Completed:
|
755
|
+
return t < 100 ? "Closed" : "Completed";
|
756
|
+
case I.Created:
|
757
|
+
return t > 0 ? "In progress" : "Not started";
|
758
|
+
case I.InProgress:
|
759
|
+
return "In progress";
|
760
|
+
case I.Queued:
|
761
|
+
return "Queued";
|
762
|
+
case I.NotStarted:
|
763
|
+
return "Not started";
|
764
|
+
default:
|
765
|
+
return "-";
|
766
|
+
}
|
767
|
+
}, Hr = (e) => {
|
768
|
+
const t = e.progress ?? 0;
|
769
|
+
return e.status === I.Created && t > 0 ? I.InProgress : e.status;
|
770
|
+
}, Fr = {
|
771
|
+
[X.translation]: "#0891B2",
|
772
|
+
[X.review]: "#16922D",
|
773
|
+
[X.lqa_by_ai]: "#8B5CF6",
|
774
|
+
[X.automatic_translation]: "#60A5FA"
|
775
|
+
}, Jr = (e) => {
|
776
|
+
const t = [
|
777
|
+
I.InProgress,
|
778
|
+
I.Created,
|
779
|
+
I.Completed
|
780
|
+
];
|
781
|
+
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Hr(n) })).sort((n, r) => n.status === I.InProgress && n.progress === 100 ? -1 : r.status === I.InProgress && r.progress === 100 ? 1 : n.status === r.status ? n.name < r.name ? 1 : -1 : t.indexOf(n.status) - t.indexOf(r.status));
|
782
|
+
}, pt = (e) => e in [je.InProgress, je.Created], zr = (e, t) => pt(e.status) && pt(t.status) && (t.progress ?? 0) >= 100, Gr = ({ task: e, language: t }) => {
|
783
|
+
const [n, r] = N(!1), [s, i] = N(!1), { onLanguageCompleteConfirm: c, fetchTasks: l } = Y(), u = () => {
|
784
|
+
i(!1);
|
785
|
+
};
|
786
|
+
return /* @__PURE__ */ h(Le, { children: [
|
787
|
+
s && /* @__PURE__ */ a(
|
788
|
+
Xt,
|
789
|
+
{
|
790
|
+
opened: !0,
|
791
|
+
loading: n,
|
792
|
+
title: `Are you finished with ${t.name}?`,
|
793
|
+
confirmText: "Mark as done",
|
794
|
+
closeText: "Cancel",
|
795
|
+
onClose: u,
|
796
|
+
onConfirm: async () => {
|
797
|
+
r(!0), await c({ task: e, language: t, closePrompt: u }), l();
|
798
|
+
},
|
799
|
+
children: /* @__PURE__ */ h(en, { status: "info", children: [
|
800
|
+
"Make sure you are finished and ",
|
801
|
+
/* @__PURE__ */ a("strong", { children: "mark it as done" }),
|
802
|
+
" to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
|
803
|
+
] })
|
804
|
+
}
|
805
|
+
),
|
806
|
+
/* @__PURE__ */ a(
|
807
|
+
L,
|
808
|
+
{
|
809
|
+
disabled: n,
|
810
|
+
onClick: () => {
|
811
|
+
i(!0);
|
812
|
+
},
|
813
|
+
children: "Mark as done"
|
814
|
+
}
|
815
|
+
)
|
816
|
+
] });
|
817
|
+
}, Wr = "_langRowCompleted_vpgdi_1", Kr = "_langCellSecondary_vpgdi_15", Qr = "_langStatus_vpgdi_20", Pe = {
|
818
|
+
langRowCompleted: Wr,
|
819
|
+
langCellSecondary: Kr,
|
820
|
+
langStatus: Qr
|
821
|
+
}, Yr = ({ language: e, task: t }) => {
|
822
|
+
const { getProjectUrl: n, langNameOnClick: r, langProgressOnClick: s } = Y(), i = e.progress ?? 0, c = e.status === I.Completed, l = zr(t, e);
|
823
|
+
return /* @__PURE__ */ h(
|
824
|
+
"tr",
|
825
|
+
{
|
826
|
+
className: R({
|
827
|
+
[Pe.langRowCompleted]: l
|
828
|
+
}),
|
829
|
+
children: [
|
830
|
+
/* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(q, { tooltip: "Open in bilingual view", children: /* @__PURE__ */ a(
|
831
|
+
L,
|
832
|
+
{
|
833
|
+
href: n({ task: t, language: e }),
|
834
|
+
onClick: () => {
|
835
|
+
r == null || r({ task: t, language: e });
|
836
|
+
},
|
837
|
+
children: e.name
|
838
|
+
}
|
839
|
+
) }) }),
|
840
|
+
/* @__PURE__ */ a("td", { className: Pe.langCellSecondary, children: l || c ? "0" : /* @__PURE__ */ a(q, { tooltip: "Open uncompleted items", children: /* @__PURE__ */ a(
|
841
|
+
L,
|
842
|
+
{
|
843
|
+
href: n({ task: t, language: e, taskUncompleted: !0 }),
|
844
|
+
onClick: () => {
|
845
|
+
s == null || s({ task: t, language: e });
|
846
|
+
},
|
847
|
+
children: e.base_words_total - e.base_words_done
|
848
|
+
}
|
849
|
+
) }) }),
|
850
|
+
/* @__PURE__ */ h("td", { children: [
|
851
|
+
i,
|
852
|
+
"%"
|
853
|
+
] }),
|
854
|
+
/* @__PURE__ */ a("td", { children: l ? /* @__PURE__ */ a(Gr, { task: t, language: e }) : /* @__PURE__ */ a(
|
855
|
+
"span",
|
856
|
+
{
|
857
|
+
className: `${Pe.langStatus} flex-row items-center justify-start`,
|
858
|
+
"data-status": e.status,
|
859
|
+
children: Dr(e.status, i)
|
860
|
+
}
|
861
|
+
) })
|
862
|
+
]
|
863
|
+
}
|
864
|
+
);
|
865
|
+
}, Vr = "_taskContainer_mt2or_1", Zr = "_taskTitle_mt2or_21", Xr = "_taskDescription_mt2or_28", eo = "_languagesTable_mt2or_35", to = "_metadata_mt2or_87", M = {
|
866
|
+
taskContainer: Vr,
|
867
|
+
taskTitle: Zr,
|
868
|
+
taskDescription: Xr,
|
869
|
+
languagesTable: eo,
|
870
|
+
metadata: to
|
871
|
+
}, no = ({ task: e }) => {
|
872
|
+
const { tasks: t, getProjectUrl: n, taskTitleOnClick: r } = Y(), s = Jr(e.langs), i = (c) => {
|
873
|
+
c !== void 0 && window.open(
|
874
|
+
`/style-guide/${e.team_id}/download/${c.id}/link`,
|
875
|
+
"_blank",
|
876
|
+
"noopener,noreferrer"
|
877
|
+
);
|
878
|
+
};
|
879
|
+
return t ? /* @__PURE__ */ h("div", { className: M.taskContainer, children: [
|
880
|
+
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-center", children: [
|
881
|
+
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
|
882
|
+
/* @__PURE__ */ a(Ne, { color: Fr[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
|
883
|
+
e.due_date && /* @__PURE__ */ h(Ne, { color: "#EAB308", children: [
|
884
|
+
"DUE ",
|
885
|
+
dr(on(e.due_date), "yyyy-MM-dd")
|
886
|
+
] })
|
887
|
+
] }),
|
888
|
+
e.style_guides.length > 0 && /* @__PURE__ */ a("div", { className: "flex-row", children: e.style_guides.length === 1 ? /* @__PURE__ */ a(
|
889
|
+
Re,
|
890
|
+
{
|
891
|
+
size: "sm",
|
892
|
+
variant: "secondary",
|
893
|
+
onClick: () => i(e.style_guides[0]),
|
894
|
+
children: "Download style guide"
|
895
|
+
}
|
896
|
+
) : /* @__PURE__ */ a(
|
897
|
+
oe,
|
898
|
+
{
|
899
|
+
menuButton: /* @__PURE__ */ a(Re, { variant: "secondary", size: "sm", children: "Download style guide" }),
|
900
|
+
children: /* @__PURE__ */ a(ae, { children: e.style_guides.map((c) => /* @__PURE__ */ a(
|
901
|
+
z,
|
902
|
+
{
|
903
|
+
onClick: () => i(c),
|
904
|
+
children: $r(c.name).name
|
905
|
+
},
|
906
|
+
c.id
|
907
|
+
)) })
|
908
|
+
}
|
909
|
+
) })
|
910
|
+
] }),
|
911
|
+
/* @__PURE__ */ a("h4", { className: M.taskTitle, children: /* @__PURE__ */ a(
|
912
|
+
L,
|
913
|
+
{
|
914
|
+
href: n({ task: e, view: "multi" }),
|
915
|
+
onClick: () => {
|
916
|
+
r == null || r({ task: e });
|
917
|
+
},
|
918
|
+
children: e.title
|
919
|
+
}
|
920
|
+
) }),
|
921
|
+
e.description && /* @__PURE__ */ a("div", { className: M.taskDescription, children: sr(lr(e.description)) }),
|
922
|
+
/* @__PURE__ */ h("table", { className: M.languagesTable, children: [
|
923
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
924
|
+
/* @__PURE__ */ a("th", { children: "Languages" }),
|
925
|
+
/* @__PURE__ */ a("th", { children: "Words to do" }),
|
926
|
+
/* @__PURE__ */ a("th", { children: "Progress" }),
|
927
|
+
/* @__PURE__ */ a("th", { children: "Status" })
|
928
|
+
] }) }),
|
929
|
+
/* @__PURE__ */ a("tbody", { children: s.map((c) => /* @__PURE__ */ a(Yr, { language: c, task: e }, c.lang_id)) })
|
930
|
+
] }),
|
931
|
+
/* @__PURE__ */ h("div", { className: M.metadata, children: [
|
932
|
+
/* @__PURE__ */ h("span", { children: [
|
933
|
+
"Source: ",
|
934
|
+
e.source_lang_name
|
935
|
+
] }),
|
936
|
+
/* @__PURE__ */ a("span", { children: e.created_by_fullname }),
|
937
|
+
/* @__PURE__ */ h("span", { children: [
|
938
|
+
"In ",
|
939
|
+
e.project_name,
|
940
|
+
e.master_branching_enabled === "1" && /* @__PURE__ */ a("div", { className: M.tag, children: e.branch_name ? e.branch_name : "master" })
|
941
|
+
] })
|
942
|
+
] })
|
943
|
+
] }) : null;
|
944
|
+
}, E = {
|
945
|
+
TaskCompleted: "task_completed",
|
946
|
+
TaskClosed: "task_closed",
|
947
|
+
Refresh: "refresh",
|
948
|
+
ShowDialog: "show_dialog"
|
949
|
+
}, ro = "_loadingContainer_19d6m_1", oo = "_noTasksContainer_19d6m_7", ao = "_noTasksHeading_19d6m_14", so = "_noTasksText_19d6m_18", io = "_tasksContainer_19d6m_23", D = {
|
950
|
+
loadingContainer: ro,
|
951
|
+
noTasksContainer: oo,
|
952
|
+
noTasksHeading: ao,
|
953
|
+
noTasksText: so,
|
954
|
+
tasksContainer: io
|
955
|
+
}, co = () => {
|
956
|
+
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: r } = Y();
|
957
|
+
return qe(() => (r(), t == null || t({ tasks: e }), document.addEventListener(E.TaskCompleted, r), document.addEventListener(E.TaskClosed, r), document.addEventListener(E.Refresh, r), () => {
|
958
|
+
document.removeEventListener(E.TaskCompleted, r), document.removeEventListener(E.TaskClosed, r), document.removeEventListener(E.Refresh, r);
|
959
|
+
})), n ? /* @__PURE__ */ a("div", { "data-testid": "sidebar-tasks-loading-popover", className: D.loadingContainer, children: /* @__PURE__ */ a(tn, {}) }) : e.length === 0 ? /* @__PURE__ */ h("div", { "data-testid": "sidebar-no-tasks-popover", className: D.noTasksContainer, children: [
|
960
|
+
/* @__PURE__ */ a("h3", { className: D.noTasksHeading, children: "No tasks" }),
|
961
|
+
/* @__PURE__ */ h("div", { className: D.noTasksText, children: [
|
962
|
+
"Your incoming tasks will appear here.",
|
963
|
+
/* @__PURE__ */ a("br", {}),
|
964
|
+
/* @__PURE__ */ a(L, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
|
965
|
+
] })
|
966
|
+
] }) : /* @__PURE__ */ a("div", { "data-testid": "sidebar-tasks-popover", className: D.tasksContainer, children: e.map((s) => /* @__PURE__ */ a(no, { task: s }, s.id)) });
|
967
|
+
}, lo = ({ children: e, config: t }) => {
|
968
|
+
const [n, r] = N([]), [s, i] = N(!0), [c, l] = N(0), {
|
969
|
+
getProjectUrl: u,
|
970
|
+
onLanguageCompleteConfirm: d,
|
971
|
+
onTasksWidgetOpen: m,
|
972
|
+
langNameOnClick: g,
|
973
|
+
langProgressOnClick: T,
|
974
|
+
taskTitleOnClick: y
|
975
|
+
} = t, { getTasks: f, getTasksCount: w } = t, b = async () => {
|
976
|
+
i(!0);
|
977
|
+
const v = await f();
|
978
|
+
r(v), i(!1);
|
979
|
+
}, _ = async () => {
|
980
|
+
const v = await w();
|
981
|
+
l(v);
|
982
|
+
};
|
983
|
+
qe(() => (_(), document.addEventListener(E.TaskCompleted, _), document.addEventListener(E.TaskClosed, _), document.addEventListener(E.Refresh, _), () => {
|
984
|
+
document.removeEventListener(E.TaskCompleted, _), document.removeEventListener(E.TaskClosed, _), document.removeEventListener(E.Refresh, _);
|
985
|
+
}));
|
986
|
+
const p = {
|
987
|
+
fetchTasks: b,
|
988
|
+
tasks: n,
|
989
|
+
tasksCount: c,
|
990
|
+
loadingTasks: s,
|
991
|
+
getProjectUrl: u,
|
992
|
+
onLanguageCompleteConfirm: d,
|
993
|
+
onTasksWidgetOpen: m,
|
994
|
+
langNameOnClick: g,
|
995
|
+
langProgressOnClick: T,
|
996
|
+
taskTitleOnClick: y
|
997
|
+
};
|
998
|
+
return /* @__PURE__ */ a(Ht.Provider, { value: p, children: e });
|
999
|
+
}, uo = (e) => function(n) {
|
1000
|
+
const { config: r, ...s } = n;
|
1001
|
+
return /* @__PURE__ */ a(lo, { config: r, children: /* @__PURE__ */ a(e, { ...s }) });
|
1002
|
+
}, mo = uo(() => {
|
1003
|
+
const [e, t] = N(!1), { tasksCount: n } = Y();
|
1004
|
+
return qe(() => {
|
1005
|
+
const r = () => {
|
1006
|
+
t(!0);
|
1007
|
+
};
|
1008
|
+
return document.addEventListener(E.ShowDialog, r), () => {
|
1009
|
+
document.removeEventListener(E.ShowDialog, r);
|
1010
|
+
};
|
1011
|
+
}), /* @__PURE__ */ a(q, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ a(
|
1012
|
+
nn,
|
1013
|
+
{
|
1014
|
+
content: /* @__PURE__ */ a(co, {}),
|
1015
|
+
placement: "right",
|
1016
|
+
open: e,
|
1017
|
+
onOpenChange: t,
|
1018
|
+
middlewares: [
|
1019
|
+
Mr({
|
1020
|
+
// Adding some spacing to the top and bottom so the popover
|
1021
|
+
// doesn't extend to the edges of the screen.
|
1022
|
+
padding: {
|
1023
|
+
top: 32,
|
1024
|
+
bottom: 32
|
1025
|
+
}
|
1026
|
+
})
|
1027
|
+
],
|
1028
|
+
children: (r) => /* @__PURE__ */ h(
|
1029
|
+
Re,
|
1030
|
+
{
|
1031
|
+
type: "button",
|
1032
|
+
"data-testid": "sidebar-tasks-widget-button",
|
1033
|
+
"aria-label": "Tasks",
|
1034
|
+
className: R(Ie.navItem, {
|
1035
|
+
[Ie.activeNavItem]: r
|
1036
|
+
}),
|
1037
|
+
children: [
|
1038
|
+
/* @__PURE__ */ a(rn, { size: "25px" }),
|
1039
|
+
n > 0 && /* @__PURE__ */ a("div", { className: Ie.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
|
1040
|
+
]
|
1041
|
+
}
|
1042
|
+
)
|
1043
|
+
}
|
1044
|
+
) });
|
1045
|
+
}), P = ({ children: e, ...t }) => /* @__PURE__ */ a("nav", { ...t, className: Ln.sidebarContainer, children: e }), fo = ({ children: e }) => /* @__PURE__ */ a("div", { children: e });
|
1046
|
+
P.Top = fo;
|
1047
|
+
const go = ({ children: e }) => /* @__PURE__ */ a("div", { children: e });
|
1048
|
+
P.Bottom = go;
|
1049
|
+
P.Avatar = Un;
|
1050
|
+
P.IconLink = $n;
|
1051
|
+
P.Menu = Fn;
|
1052
|
+
P.ProfileMenu = mr;
|
1053
|
+
P.TeamSwitch = Sr;
|
1054
|
+
P.TeamMenuItem = Bt;
|
1055
|
+
P.UpgradeMenuItem = Pr;
|
1056
|
+
P.ProfileSettingsMenuItem = _r;
|
1057
|
+
P.Tasks = mo;
|
1058
|
+
const _o = "_breadcrumbsItem_1hm6a_1", ho = "_breadcrumbs_1hm6a_1", bt = {
|
1059
|
+
breadcrumbsItem: _o,
|
1060
|
+
breadcrumbs: ho
|
1061
|
+
}, Ia = ({ items: e }) => /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", className: bt.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ h(St, { children: [
|
1062
|
+
/* @__PURE__ */ a(L, { className: bt.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
1063
|
+
n < e.length - 1 && /* @__PURE__ */ a("span", { children: " — " })
|
1064
|
+
] }, `${t.link}-${t.name}`)) }), po = ({ items: e }) => /* @__PURE__ */ a(Le, { children: e.map((t, n) => /* @__PURE__ */ h(St, { children: [
|
1065
|
+
!!n && t.some((r) => r.visible) && /* @__PURE__ */ a(Et, {}),
|
1066
|
+
t.filter(({ visible: r }) => r).map(({ link: r, label: s, onClick: i }) => /* @__PURE__ */ a(z, { href: r || "#", "aria-label": s, onClick: i, children: s }, s))
|
1067
|
+
] }, t[0].label)) }), bo = "_badge_1pc1v_1", vo = "_tag_1pc1v_15", To = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", yo = "_disabled_1pc1v_57", Co = "_projectNavigationItem_1pc1v_61", wo = "_projectNavigationItemDisabled_1pc1v_67", x = {
|
1068
|
+
badge: bo,
|
1069
|
+
tag: vo,
|
1070
|
+
withNavLinkStyle: To,
|
1071
|
+
disabled: yo,
|
1072
|
+
projectNavigationItem: Co,
|
1073
|
+
projectNavigationItemDisabled: wo
|
1074
|
+
}, vt = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ h("div", { className: "flex gap-1", children: [
|
1075
|
+
/* @__PURE__ */ h("div", { children: [
|
1076
|
+
/* @__PURE__ */ a("span", { children: e }),
|
1077
|
+
!!t && /* @__PURE__ */ a("div", { className: x.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
611
1078
|
] }),
|
612
|
-
!!n && /* @__PURE__ */
|
613
|
-
] }),
|
614
|
-
({ label: e, href: t = "", disabled: n = !1, badge:
|
1079
|
+
!!n && /* @__PURE__ */ a(Ne, { className: x.tag, children: n })
|
1080
|
+
] }), Ae = Vt(
|
1081
|
+
({ label: e, href: t = "", disabled: n = !1, badge: r, onClick: s, novel: i }, c) => /* @__PURE__ */ a(q, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ a(
|
615
1082
|
"div",
|
616
1083
|
{
|
617
|
-
className: n ?
|
618
|
-
children:
|
1084
|
+
className: n ? x.projectNavigationItemDisabled : x.projectNavigationItem,
|
1085
|
+
children: s || n || !t ? /* @__PURE__ */ a(
|
619
1086
|
"button",
|
620
1087
|
{
|
621
1088
|
type: "button",
|
622
1089
|
ref: c,
|
623
|
-
className:
|
624
|
-
[
|
1090
|
+
className: R(x.withNavLinkStyle, {
|
1091
|
+
[x.disabled]: n
|
625
1092
|
}),
|
626
1093
|
disabled: n,
|
627
|
-
onClick:
|
628
|
-
children: /* @__PURE__ */
|
1094
|
+
onClick: s,
|
1095
|
+
children: /* @__PURE__ */ a(vt, { label: e, badge: r, novel: i })
|
629
1096
|
}
|
630
|
-
) : /* @__PURE__ */
|
1097
|
+
) : /* @__PURE__ */ a("a", { href: t, className: x.withNavLinkStyle, children: /* @__PURE__ */ a(vt, { label: e, badge: r, novel: i }) })
|
631
1098
|
}
|
632
1099
|
) })
|
633
1100
|
);
|
634
|
-
|
635
|
-
const
|
636
|
-
var
|
637
|
-
return n.dropdown ? /* @__PURE__ */
|
1101
|
+
Ae.displayName = "NavigationTabsItem";
|
1102
|
+
const So = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, ko = (e) => e.visible && (!e.dropdown || So(e.dropdown)), Pa = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ a("nav", { "aria-label": "Project", children: /* @__PURE__ */ a("ul", { className: U.navigationTabList, "aria-orientation": "horizontal", children: e.filter(ko).map((n) => {
|
1103
|
+
var r, s, i;
|
1104
|
+
return n.dropdown ? /* @__PURE__ */ a(
|
638
1105
|
"li",
|
639
1106
|
{
|
640
|
-
className:
|
1107
|
+
className: U.navigationTab,
|
641
1108
|
"data-testid": n.key,
|
642
|
-
"aria-selected": (
|
643
|
-
children: /* @__PURE__ */
|
644
|
-
|
1109
|
+
"aria-selected": (r = n.isActive) == null ? void 0 : r.call(n, t),
|
1110
|
+
children: /* @__PURE__ */ a(
|
1111
|
+
oe,
|
645
1112
|
{
|
646
|
-
menuButton: ({ opened: c }) => /* @__PURE__ */
|
647
|
-
children: /* @__PURE__ */
|
1113
|
+
menuButton: ({ opened: c }) => /* @__PURE__ */ a(Ae, { label: n.label, disabled: n.disabled, active: c }),
|
1114
|
+
children: /* @__PURE__ */ a(ae, { children: /* @__PURE__ */ a(po, { items: n.dropdown }) })
|
648
1115
|
}
|
649
1116
|
)
|
650
1117
|
},
|
651
1118
|
n.key
|
652
|
-
) : /* @__PURE__ */
|
1119
|
+
) : /* @__PURE__ */ a(
|
653
1120
|
"li",
|
654
1121
|
{
|
655
|
-
className:
|
1122
|
+
className: U.navigationTab,
|
656
1123
|
"data-testid": n.key,
|
657
|
-
"aria-selected": (
|
658
|
-
children: /* @__PURE__ */
|
659
|
-
|
1124
|
+
"aria-selected": (s = n.isActive) == null ? void 0 : s.call(n, t),
|
1125
|
+
children: /* @__PURE__ */ a(
|
1126
|
+
Ae,
|
660
1127
|
{
|
661
1128
|
label: n.label,
|
662
1129
|
href: n.link,
|
@@ -664,83 +1131,83 @@ const _r = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
664
1131
|
disabled: n.disabled,
|
665
1132
|
badge: n.badge,
|
666
1133
|
novel: n.novel,
|
667
|
-
active: (
|
1134
|
+
active: (i = n.isActive) == null ? void 0 : i.call(n, t)
|
668
1135
|
}
|
669
1136
|
)
|
670
1137
|
},
|
671
1138
|
n.key
|
672
1139
|
);
|
673
|
-
}) }) }),
|
674
|
-
accessToken:
|
675
|
-
refreshToken:
|
676
|
-
}),
|
677
|
-
|
678
|
-
|
679
|
-
]),
|
1140
|
+
}) }) }), Eo = o.object({
|
1141
|
+
accessToken: o.string(),
|
1142
|
+
refreshToken: o.string()
|
1143
|
+
}), Io = o.union([
|
1144
|
+
o.object({ Authorization: o.string().startsWith("Bearer ") }),
|
1145
|
+
o.object({ "x-csrf-token": o.string() })
|
1146
|
+
]), Be = Oe({
|
680
1147
|
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
681
1148
|
method: "post",
|
682
|
-
requestPathParamsSchema:
|
1149
|
+
requestPathParamsSchema: o.object({ teamId: o.number() }),
|
683
1150
|
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
684
|
-
requestHeaderSchema:
|
685
|
-
requestBodySchema:
|
686
|
-
successResponseBodySchema:
|
687
|
-
}),
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
]),
|
693
|
-
userId:
|
694
|
-
userUuid:
|
695
|
-
teamId:
|
696
|
-
userTeamRole:
|
697
|
-
userEmail:
|
698
|
-
userName:
|
699
|
-
userCurrentTeamId:
|
700
|
-
planId:
|
701
|
-
planName:
|
702
|
-
isProviderAlpha:
|
703
|
-
isFullyAuthenticated:
|
704
|
-
exp:
|
1151
|
+
requestHeaderSchema: Io,
|
1152
|
+
requestBodySchema: o.undefined(),
|
1153
|
+
successResponseBodySchema: Eo
|
1154
|
+
}), Ft = o.union([
|
1155
|
+
o.literal("owner"),
|
1156
|
+
o.literal("admin"),
|
1157
|
+
o.literal("biller"),
|
1158
|
+
o.literal("member")
|
1159
|
+
]), Po = o.object({
|
1160
|
+
userId: o.number(),
|
1161
|
+
userUuid: o.string(),
|
1162
|
+
teamId: o.number(),
|
1163
|
+
userTeamRole: Ft,
|
1164
|
+
userEmail: o.string().email(),
|
1165
|
+
userName: o.string(),
|
1166
|
+
userCurrentTeamId: o.number(),
|
1167
|
+
planId: o.number(),
|
1168
|
+
planName: o.string(),
|
1169
|
+
isProviderAlpha: o.boolean(),
|
1170
|
+
isFullyAuthenticated: o.boolean(),
|
1171
|
+
exp: o.number()
|
705
1172
|
});
|
706
|
-
function
|
1173
|
+
function se(e) {
|
707
1174
|
try {
|
708
1175
|
const t = e.split(".")[1], n = atob(t);
|
709
|
-
return
|
1176
|
+
return Po.parse(JSON.parse(n));
|
710
1177
|
} catch {
|
711
1178
|
return;
|
712
1179
|
}
|
713
1180
|
}
|
714
|
-
function
|
1181
|
+
function te(e) {
|
715
1182
|
return { Authorization: `Bearer ${e}` };
|
716
1183
|
}
|
717
|
-
function
|
718
|
-
return (t) => async (n,
|
1184
|
+
function No(e) {
|
1185
|
+
return (t) => async (n, r) => {
|
719
1186
|
var c;
|
720
|
-
const
|
721
|
-
if (
|
722
|
-
return t(n,
|
723
|
-
const
|
724
|
-
...
|
725
|
-
headers: { ...
|
1187
|
+
const s = await e.getCachedJwtToken();
|
1188
|
+
if (s === void 0)
|
1189
|
+
return t(n, r);
|
1190
|
+
const i = await t(n, {
|
1191
|
+
...r,
|
1192
|
+
headers: { ...r.headers, ...te(s.accessToken) }
|
726
1193
|
});
|
727
|
-
if (
|
728
|
-
const
|
729
|
-
if (!
|
730
|
-
return
|
731
|
-
const
|
732
|
-
pathParams: { teamId:
|
733
|
-
headers:
|
1194
|
+
if (s && (i.status === 401 || i.status === 403)) {
|
1195
|
+
const l = se(s.accessToken);
|
1196
|
+
if (!l)
|
1197
|
+
return i;
|
1198
|
+
const u = await G(e.authProviderWretchClient, Be, {
|
1199
|
+
pathParams: { teamId: l.teamId },
|
1200
|
+
headers: te(s.refreshToken)
|
734
1201
|
});
|
735
|
-
return await ((c = e.onNewJwtTokenIssued) == null ? void 0 : c.call(e,
|
736
|
-
...
|
737
|
-
headers: { ...
|
1202
|
+
return await ((c = e.onNewJwtTokenIssued) == null ? void 0 : c.call(e, u)), t(n, {
|
1203
|
+
...r,
|
1204
|
+
headers: { ...r.headers, ...te(u.accessToken) }
|
738
1205
|
});
|
739
1206
|
}
|
740
|
-
return
|
1207
|
+
return i;
|
741
1208
|
};
|
742
1209
|
}
|
743
|
-
function
|
1210
|
+
function Na() {
|
744
1211
|
return (e) => (t, n) => e(t, {
|
745
1212
|
...n,
|
746
1213
|
headers: {
|
@@ -750,398 +1217,401 @@ function Eo() {
|
|
750
1217
|
credentials: "omit"
|
751
1218
|
});
|
752
1219
|
}
|
753
|
-
function
|
754
|
-
const e =
|
1220
|
+
function ie() {
|
1221
|
+
const e = xe(document.cookie, "accessToken"), t = xe(document.cookie, "refreshToken");
|
755
1222
|
if (!(!e || !t))
|
756
1223
|
return { accessToken: e, refreshToken: t };
|
757
1224
|
}
|
758
|
-
function
|
759
|
-
return
|
1225
|
+
function Jt() {
|
1226
|
+
return xe(document.cookie, "csrf_token");
|
760
1227
|
}
|
761
|
-
function
|
762
|
-
var n,
|
763
|
-
return (
|
1228
|
+
function xe(e, t) {
|
1229
|
+
var n, r;
|
1230
|
+
return (r = (n = e.split(";").find((s) => s.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : r.substring(t.length + 1);
|
764
1231
|
}
|
765
|
-
function
|
766
|
-
return
|
1232
|
+
function Ra(e) {
|
1233
|
+
return No({
|
767
1234
|
authProviderWretchClient: e.authProviderWretchClient,
|
768
|
-
getCachedJwtToken: e.getCachedJwtToken ??
|
1235
|
+
getCachedJwtToken: e.getCachedJwtToken ?? Ro,
|
769
1236
|
onNewJwtTokenIssued: e.onNewJwtTokenIssued
|
770
1237
|
});
|
771
1238
|
}
|
772
|
-
function
|
773
|
-
return Promise.resolve(
|
1239
|
+
function Ro() {
|
1240
|
+
return Promise.resolve(ie());
|
774
1241
|
}
|
775
|
-
function
|
1242
|
+
function ja(e) {
|
776
1243
|
const t = {
|
777
1244
|
authProviderWretchClient: e.authProviderWretchClient,
|
778
|
-
getCsrfToken: e.getCsrfToken ?? (async () =>
|
779
|
-
getCachedJwtToken: e.getCachedJwtToken ?? (async () =>
|
1245
|
+
getCsrfToken: e.getCsrfToken ?? (async () => Jt()),
|
1246
|
+
getCachedJwtToken: e.getCachedJwtToken ?? (async () => ie()),
|
780
1247
|
onNewJwtTokenIssued: e.onNewJwtTokenIssued,
|
781
1248
|
getTeamId: e.getTeamId
|
782
1249
|
};
|
783
|
-
return (n) => async (
|
784
|
-
var
|
1250
|
+
return (n) => async (r, s) => {
|
1251
|
+
var u;
|
785
1252
|
if (await t.getCachedJwtToken() !== void 0)
|
786
|
-
return n(
|
1253
|
+
return n(r, s);
|
787
1254
|
const c = await t.getCsrfToken();
|
788
1255
|
if (c === void 0)
|
789
|
-
return n(
|
790
|
-
const
|
1256
|
+
return n(r, s);
|
1257
|
+
const l = await G(t.authProviderWretchClient, Be, {
|
791
1258
|
pathParams: { teamId: await t.getTeamId() },
|
792
1259
|
headers: { "x-csrf-token": c }
|
793
1260
|
});
|
794
|
-
return await ((
|
795
|
-
...
|
796
|
-
headers: { ...
|
1261
|
+
return await ((u = t.onNewJwtTokenIssued) == null ? void 0 : u.call(t, l)), n(r, {
|
1262
|
+
...s,
|
1263
|
+
headers: { ...s.headers, ...te(l.accessToken) }
|
797
1264
|
});
|
798
1265
|
};
|
799
1266
|
}
|
800
|
-
function
|
801
|
-
const e =
|
1267
|
+
function Aa() {
|
1268
|
+
const e = ie();
|
802
1269
|
if (!e)
|
803
1270
|
return;
|
804
|
-
const t =
|
1271
|
+
const t = se(e.accessToken);
|
805
1272
|
if (t)
|
806
1273
|
return { ...e, payload: t };
|
807
1274
|
}
|
808
|
-
const
|
1275
|
+
const jo = {
|
809
1276
|
teamKeyCsrf: (e, t) => ["getUserToken", "x-csrf-token", t, e],
|
810
1277
|
teamKeyJwt: (e, t) => ["getUserToken", "Authorization", `Bearer ${t}`, e]
|
811
|
-
},
|
1278
|
+
}, Ao = (e, t) => B({
|
812
1279
|
...t,
|
813
|
-
queryFn: ({ queryKey: [n,
|
814
|
-
pathParams: { teamId:
|
815
|
-
headers:
|
1280
|
+
queryFn: ({ queryKey: [n, r, s, i] }) => G(e, Be, {
|
1281
|
+
pathParams: { teamId: i },
|
1282
|
+
headers: r === "x-csrf-token" ? { "x-csrf-token": s } : { Authorization: s }
|
816
1283
|
})
|
817
|
-
}),
|
1284
|
+
}), re = class re extends CustomEvent {
|
818
1285
|
constructor(t) {
|
819
|
-
super(
|
820
|
-
detail: { token: t, payload:
|
1286
|
+
super(re.eventName, {
|
1287
|
+
detail: { token: t, payload: se(t.accessToken) }
|
821
1288
|
});
|
822
1289
|
}
|
823
1290
|
};
|
824
|
-
|
825
|
-
let
|
826
|
-
function
|
827
|
-
const n =
|
828
|
-
queryKey:
|
1291
|
+
Je(re, "eventName", "new-jwt-issued");
|
1292
|
+
let F = re;
|
1293
|
+
function xa(e, t) {
|
1294
|
+
const n = Jt(), r = Ao(e, {
|
1295
|
+
queryKey: jo.teamKeyCsrf(t, n ?? ""),
|
829
1296
|
enabled: n !== void 0
|
830
|
-
}),
|
831
|
-
return
|
832
|
-
|
833
|
-
}, [
|
1297
|
+
}), s = yt();
|
1298
|
+
return J(() => {
|
1299
|
+
r.data && r.data.accessToken !== s.current && (window.dispatchEvent(new F(r.data)), s.current = r.data.accessToken);
|
1300
|
+
}, [r.data]), r;
|
834
1301
|
}
|
835
|
-
function
|
836
|
-
const [e, t] =
|
837
|
-
return
|
838
|
-
const n = (
|
839
|
-
t(
|
840
|
-
},
|
841
|
-
return t(
|
842
|
-
window.removeEventListener(
|
1302
|
+
function zt() {
|
1303
|
+
const [e, t] = N();
|
1304
|
+
return J(() => {
|
1305
|
+
const n = (s) => {
|
1306
|
+
t(s.detail.payload);
|
1307
|
+
}, r = ie();
|
1308
|
+
return t(r && se(r.accessToken)), window.addEventListener(F.eventName, n), () => {
|
1309
|
+
window.removeEventListener(F.eventName, n);
|
843
1310
|
};
|
844
1311
|
}, []), e;
|
845
1312
|
}
|
846
|
-
const
|
847
|
-
user_id:
|
848
|
-
email:
|
849
|
-
fullname:
|
850
|
-
created_at:
|
851
|
-
created_at_timestamp:
|
852
|
-
role:
|
853
|
-
}),
|
854
|
-
team_id:
|
855
|
-
team_user:
|
856
|
-
}),
|
1313
|
+
const xo = o.object({
|
1314
|
+
user_id: o.number(),
|
1315
|
+
email: o.string().email(),
|
1316
|
+
fullname: o.string(),
|
1317
|
+
created_at: o.string(),
|
1318
|
+
created_at_timestamp: o.number(),
|
1319
|
+
role: Ft
|
1320
|
+
}), Lo = o.object({
|
1321
|
+
team_id: o.number(),
|
1322
|
+
team_user: xo
|
1323
|
+
}), Oo = K({
|
857
1324
|
description: "Get the details of a team user",
|
858
|
-
requestPathParamsSchema:
|
1325
|
+
requestPathParamsSchema: o.object({ teamId: o.number(), userId: o.number() }),
|
859
1326
|
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
860
|
-
successResponseBodySchema:
|
861
|
-
}),
|
1327
|
+
successResponseBodySchema: Lo
|
1328
|
+
}), Mo = {
|
862
1329
|
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
863
|
-
},
|
1330
|
+
}, Uo = (e, t) => B({
|
864
1331
|
...t,
|
865
|
-
queryFn: ({ queryKey: [n,
|
1332
|
+
queryFn: ({ queryKey: [n, r, s] }) => W(e, Oo, { pathParams: { teamId: r, userId: s } })
|
866
1333
|
});
|
867
|
-
function
|
868
|
-
const t =
|
869
|
-
return
|
870
|
-
queryKey:
|
1334
|
+
function La(e) {
|
1335
|
+
const t = zt();
|
1336
|
+
return Uo(e, {
|
1337
|
+
queryKey: Mo.teamUserKey((t == null ? void 0 : t.teamId) ?? 0, (t == null ? void 0 : t.userId) ?? 0),
|
871
1338
|
enabled: (t == null ? void 0 : t.userId) !== void 0 && t.teamId !== void 0
|
872
1339
|
});
|
873
1340
|
}
|
874
|
-
const
|
875
|
-
lang_id:
|
876
|
-
lang_iso:
|
877
|
-
lang_name:
|
878
|
-
is_writable:
|
879
|
-
}),
|
880
|
-
user_id:
|
881
|
-
email:
|
882
|
-
fullname:
|
883
|
-
created_at:
|
884
|
-
created_at_timestamp:
|
885
|
-
admin_rights:
|
886
|
-
languages:
|
887
|
-
is_admin:
|
888
|
-
is_reviewer:
|
889
|
-
}),
|
890
|
-
project_id:
|
891
|
-
contributors:
|
892
|
-
}),
|
1341
|
+
const qo = o.object({
|
1342
|
+
lang_id: o.number(),
|
1343
|
+
lang_iso: o.string(),
|
1344
|
+
lang_name: o.string(),
|
1345
|
+
is_writable: o.union([o.literal(0), o.literal(1)])
|
1346
|
+
}), Bo = o.object({
|
1347
|
+
user_id: o.number(),
|
1348
|
+
email: o.string().email(),
|
1349
|
+
fullname: o.string(),
|
1350
|
+
created_at: o.string(),
|
1351
|
+
created_at_timestamp: o.number(),
|
1352
|
+
admin_rights: o.array(o.string()),
|
1353
|
+
languages: o.array(qo),
|
1354
|
+
is_admin: o.boolean(),
|
1355
|
+
is_reviewer: o.boolean()
|
1356
|
+
}), $o = o.object({
|
1357
|
+
project_id: o.string(),
|
1358
|
+
contributors: o.array(Bo)
|
1359
|
+
}), Do = K({
|
893
1360
|
description: "Get the details of a project contributor",
|
894
|
-
requestPathParamsSchema:
|
1361
|
+
requestPathParamsSchema: o.object({ projectId: o.string(), contributorId: o.number() }),
|
895
1362
|
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
896
|
-
successResponseBodySchema:
|
897
|
-
}),
|
1363
|
+
successResponseBodySchema: $o
|
1364
|
+
}), Ho = {
|
898
1365
|
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
899
|
-
},
|
1366
|
+
}, Fo = (e, t) => B({
|
900
1367
|
...t,
|
901
|
-
queryFn: ({ queryKey: [n,
|
902
|
-
pathParams: { projectId:
|
1368
|
+
queryFn: ({ queryKey: [n, r, s] }) => W(e, Do, {
|
1369
|
+
pathParams: { projectId: r, contributorId: s }
|
903
1370
|
})
|
904
1371
|
});
|
905
|
-
function
|
906
|
-
const n =
|
907
|
-
return
|
908
|
-
queryKey:
|
1372
|
+
function Oa(e, t) {
|
1373
|
+
const n = zt();
|
1374
|
+
return Fo(e, {
|
1375
|
+
queryKey: Ho.projectUserKey(t, (n == null ? void 0 : n.userId) ?? 0),
|
909
1376
|
enabled: n !== void 0
|
910
1377
|
});
|
911
1378
|
}
|
912
|
-
const
|
913
|
-
lang_iso:
|
914
|
-
custom_iso:
|
915
|
-
}),
|
916
|
-
language_id:
|
917
|
-
language_iso:
|
918
|
-
progress:
|
919
|
-
words_to_do:
|
920
|
-
}),
|
921
|
-
projectId:
|
922
|
-
}),
|
923
|
-
lang_id:
|
924
|
-
lang_iso:
|
925
|
-
lang_name:
|
926
|
-
is_rtl:
|
927
|
-
plural_forms:
|
928
|
-
}),
|
929
|
-
project_id:
|
930
|
-
project_uuid:
|
931
|
-
languages:
|
932
|
-
}),
|
1379
|
+
const Jo = o.object({
|
1380
|
+
lang_iso: o.string(),
|
1381
|
+
custom_iso: o.string().optional()
|
1382
|
+
}), zo = o.object({
|
1383
|
+
language_id: o.number(),
|
1384
|
+
language_iso: o.string(),
|
1385
|
+
progress: o.number(),
|
1386
|
+
words_to_do: o.number()
|
1387
|
+
}), Go = o.object({
|
1388
|
+
projectId: o.string()
|
1389
|
+
}), Wo = o.object({
|
1390
|
+
lang_id: o.number(),
|
1391
|
+
lang_iso: o.string(),
|
1392
|
+
lang_name: o.string(),
|
1393
|
+
is_rtl: o.boolean(),
|
1394
|
+
plural_forms: o.array(o.string().optional())
|
1395
|
+
}), Ko = o.object({
|
1396
|
+
project_id: o.string(),
|
1397
|
+
project_uuid: o.string().uuid(),
|
1398
|
+
languages: o.array(Wo)
|
1399
|
+
}), Qo = K({
|
933
1400
|
description: "List of project languages",
|
934
|
-
requestPathParamsSchema:
|
1401
|
+
requestPathParamsSchema: Go,
|
935
1402
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
936
|
-
successResponseBodySchema:
|
937
|
-
}),
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
]),
|
942
|
-
per_platform_key_names:
|
943
|
-
reviewing:
|
944
|
-
auto_toggle_unverified:
|
945
|
-
offline_translation:
|
946
|
-
key_editing:
|
947
|
-
inline_machine_translations:
|
948
|
-
custom_translation_statuses:
|
949
|
-
custom_translation_statuses_allow_multiple:
|
950
|
-
segmentation:
|
951
|
-
contributor_preview_download_enabled:
|
952
|
-
}),
|
953
|
-
not_reviewed:
|
954
|
-
unverified:
|
955
|
-
spelling_grammar:
|
956
|
-
inconsistent_placeholders:
|
957
|
-
inconsistent_html:
|
958
|
-
different_number_of_urls:
|
959
|
-
different_urls:
|
960
|
-
leading_whitespace:
|
961
|
-
trailing_whitespace:
|
962
|
-
different_number_of_email_address:
|
963
|
-
different_email_address:
|
964
|
-
different_brackets:
|
965
|
-
different_numbers:
|
966
|
-
double_space:
|
967
|
-
special_placeholder:
|
968
|
-
unbalanced_brackets:
|
969
|
-
}),
|
970
|
-
progress_total:
|
971
|
-
keys_total:
|
972
|
-
team:
|
973
|
-
base_words:
|
974
|
-
qa_issues_total:
|
975
|
-
qa_issues:
|
976
|
-
languages:
|
977
|
-
}),
|
978
|
-
project_id:
|
979
|
-
uuid:
|
980
|
-
project_type:
|
981
|
-
name:
|
982
|
-
description:
|
983
|
-
created_at:
|
984
|
-
created_at_timestamp:
|
985
|
-
created_by:
|
986
|
-
created_by_email:
|
987
|
-
team_id:
|
988
|
-
base_language_id:
|
989
|
-
base_language_iso:
|
990
|
-
settings:
|
991
|
-
statistics:
|
992
|
-
}),
|
993
|
-
name:
|
994
|
-
team_id:
|
995
|
-
base_lang_iso:
|
996
|
-
languages:
|
997
|
-
project_type:
|
998
|
-
is_segmentation_enabled:
|
999
|
-
}),
|
1000
|
-
filter_type:
|
1001
|
-
filter_team_id:
|
1002
|
-
filter_names:
|
1003
|
-
include_statistics:
|
1004
|
-
include_settings:
|
1005
|
-
limit:
|
1006
|
-
page:
|
1007
|
-
}),
|
1008
|
-
projects:
|
1009
|
-
}),
|
1010
|
-
project_id:
|
1011
|
-
}),
|
1012
|
-
project_id:
|
1013
|
-
}),
|
1014
|
-
name:
|
1015
|
-
description:
|
1016
|
-
}),
|
1403
|
+
successResponseBodySchema: Ko
|
1404
|
+
}), $e = o.union([
|
1405
|
+
o.literal("localization_files"),
|
1406
|
+
o.literal("paged_documents"),
|
1407
|
+
o.literal("marketing")
|
1408
|
+
]), Yo = o.object({
|
1409
|
+
per_platform_key_names: o.boolean(),
|
1410
|
+
reviewing: o.boolean(),
|
1411
|
+
auto_toggle_unverified: o.boolean(),
|
1412
|
+
offline_translation: o.boolean(),
|
1413
|
+
key_editing: o.boolean(),
|
1414
|
+
inline_machine_translations: o.boolean(),
|
1415
|
+
custom_translation_statuses: o.boolean(),
|
1416
|
+
custom_translation_statuses_allow_multiple: o.boolean(),
|
1417
|
+
segmentation: o.boolean(),
|
1418
|
+
contributor_preview_download_enabled: o.boolean()
|
1419
|
+
}), Vo = o.object({
|
1420
|
+
not_reviewed: o.number(),
|
1421
|
+
unverified: o.number(),
|
1422
|
+
spelling_grammar: o.number(),
|
1423
|
+
inconsistent_placeholders: o.number(),
|
1424
|
+
inconsistent_html: o.number(),
|
1425
|
+
different_number_of_urls: o.number(),
|
1426
|
+
different_urls: o.number(),
|
1427
|
+
leading_whitespace: o.number(),
|
1428
|
+
trailing_whitespace: o.number(),
|
1429
|
+
different_number_of_email_address: o.number(),
|
1430
|
+
different_email_address: o.number(),
|
1431
|
+
different_brackets: o.number(),
|
1432
|
+
different_numbers: o.number(),
|
1433
|
+
double_space: o.number(),
|
1434
|
+
special_placeholder: o.number(),
|
1435
|
+
unbalanced_brackets: o.number()
|
1436
|
+
}), Zo = o.object({
|
1437
|
+
progress_total: o.number(),
|
1438
|
+
keys_total: o.number(),
|
1439
|
+
team: o.number(),
|
1440
|
+
base_words: o.number(),
|
1441
|
+
qa_issues_total: o.number(),
|
1442
|
+
qa_issues: Vo,
|
1443
|
+
languages: o.array(zo)
|
1444
|
+
}), ce = o.object({
|
1445
|
+
project_id: o.string(),
|
1446
|
+
uuid: o.string().uuid(),
|
1447
|
+
project_type: $e,
|
1448
|
+
name: o.string(),
|
1449
|
+
description: o.string(),
|
1450
|
+
created_at: o.string(),
|
1451
|
+
created_at_timestamp: o.number(),
|
1452
|
+
created_by: o.number(),
|
1453
|
+
created_by_email: o.string(),
|
1454
|
+
team_id: o.number(),
|
1455
|
+
base_language_id: o.number(),
|
1456
|
+
base_language_iso: o.string(),
|
1457
|
+
settings: Yo.optional(),
|
1458
|
+
statistics: Zo.optional()
|
1459
|
+
}), Xo = o.object({
|
1460
|
+
name: o.string(),
|
1461
|
+
team_id: o.string(),
|
1462
|
+
base_lang_iso: o.string(),
|
1463
|
+
languages: o.array(Jo),
|
1464
|
+
project_type: $e,
|
1465
|
+
is_segmentation_enabled: o.boolean()
|
1466
|
+
}), Tt = o.union([o.literal(0), o.literal(1)]), ea = o.object({
|
1467
|
+
filter_type: $e.optional(),
|
1468
|
+
filter_team_id: o.number().optional(),
|
1469
|
+
filter_names: o.string().optional(),
|
1470
|
+
include_statistics: Tt.optional(),
|
1471
|
+
include_settings: Tt.optional(),
|
1472
|
+
limit: o.number().optional(),
|
1473
|
+
page: o.number().optional()
|
1474
|
+
}), ta = o.object({
|
1475
|
+
projects: o.array(ce)
|
1476
|
+
}), na = o.object({
|
1477
|
+
project_id: o.string()
|
1478
|
+
}), ra = o.object({
|
1479
|
+
project_id: o.string()
|
1480
|
+
}), oa = o.object({
|
1481
|
+
name: o.string().min(1),
|
1482
|
+
description: o.string().optional()
|
1483
|
+
}), le = () => "/projects", aa = Oe({
|
1017
1484
|
description: "Create a new project",
|
1018
1485
|
method: "post",
|
1019
|
-
pathResolver:
|
1020
|
-
requestBodySchema:
|
1021
|
-
successResponseBodySchema:
|
1022
|
-
}),
|
1486
|
+
pathResolver: le,
|
1487
|
+
requestBodySchema: Xo,
|
1488
|
+
successResponseBodySchema: ce
|
1489
|
+
}), sa = K({
|
1023
1490
|
description: "List all projects",
|
1024
|
-
pathResolver:
|
1025
|
-
requestQuerySchema:
|
1026
|
-
successResponseBodySchema:
|
1027
|
-
}),
|
1491
|
+
pathResolver: le,
|
1492
|
+
requestQuerySchema: ea,
|
1493
|
+
successResponseBodySchema: ta
|
1494
|
+
}), ia = K({
|
1028
1495
|
description: "Retrieve a project",
|
1029
|
-
requestPathParamsSchema:
|
1030
|
-
pathResolver: ({ project_id: e }) => `${
|
1031
|
-
successResponseBodySchema:
|
1032
|
-
}),
|
1496
|
+
requestPathParamsSchema: na,
|
1497
|
+
pathResolver: ({ project_id: e }) => `${le()}/${e}`,
|
1498
|
+
successResponseBodySchema: ce
|
1499
|
+
}), ca = Oe({
|
1033
1500
|
description: "Update a project",
|
1034
1501
|
method: "put",
|
1035
|
-
requestPathParamsSchema:
|
1036
|
-
pathResolver: ({ project_id: e }) => `${
|
1037
|
-
requestBodySchema:
|
1038
|
-
successResponseBodySchema:
|
1502
|
+
requestPathParamsSchema: ra,
|
1503
|
+
pathResolver: ({ project_id: e }) => `${le()}/${e}`,
|
1504
|
+
requestBodySchema: oa,
|
1505
|
+
successResponseBodySchema: ce
|
1039
1506
|
});
|
1040
|
-
function
|
1041
|
-
return
|
1507
|
+
function Ma(e, t = {}) {
|
1508
|
+
return Pt({
|
1042
1509
|
...t,
|
1043
|
-
mutationFn: (n) =>
|
1510
|
+
mutationFn: (n) => G(e, aa, {
|
1044
1511
|
body: n
|
1045
1512
|
})
|
1046
1513
|
});
|
1047
1514
|
}
|
1048
|
-
const
|
1515
|
+
const Ua = {
|
1049
1516
|
projectIdKey: (e) => ["listProjectLanguages", e]
|
1050
1517
|
};
|
1051
|
-
function
|
1052
|
-
return
|
1518
|
+
function qa(e, t) {
|
1519
|
+
return B({
|
1053
1520
|
...t,
|
1054
|
-
queryFn: ({ queryKey: [n,
|
1055
|
-
pathParams: { projectId:
|
1521
|
+
queryFn: ({ queryKey: [n, r] }) => W(e, Qo, {
|
1522
|
+
pathParams: { projectId: r }
|
1056
1523
|
})
|
1057
1524
|
});
|
1058
1525
|
}
|
1059
|
-
const
|
1526
|
+
const Ba = {
|
1060
1527
|
paramsKey: (e) => ["listProjects", e]
|
1061
1528
|
};
|
1062
|
-
function
|
1063
|
-
return
|
1529
|
+
function $a(e, t) {
|
1530
|
+
return B({
|
1064
1531
|
...t,
|
1065
|
-
queryFn: ({ queryKey: [n,
|
1066
|
-
queryParams:
|
1532
|
+
queryFn: ({ queryKey: [n, r] }) => W(e, sa, {
|
1533
|
+
queryParams: r
|
1067
1534
|
})
|
1068
1535
|
});
|
1069
1536
|
}
|
1070
|
-
const
|
1537
|
+
const Da = {
|
1071
1538
|
projectIdKey: (e) => ["retrieveProject", e]
|
1072
1539
|
};
|
1073
|
-
function
|
1074
|
-
return
|
1540
|
+
function Ha(e, t) {
|
1541
|
+
return B({
|
1075
1542
|
...t,
|
1076
|
-
queryFn: ({ queryKey: [n,
|
1077
|
-
pathParams: { project_id:
|
1543
|
+
queryFn: ({ queryKey: [n, r] }) => W(e, ia, {
|
1544
|
+
pathParams: { project_id: r }
|
1078
1545
|
})
|
1079
1546
|
});
|
1080
1547
|
}
|
1081
|
-
function
|
1082
|
-
return
|
1548
|
+
function Fa(e, t, n = {}) {
|
1549
|
+
return Pt({
|
1083
1550
|
...n,
|
1084
|
-
mutationFn: (
|
1085
|
-
body:
|
1551
|
+
mutationFn: (r) => G(e, ca, {
|
1552
|
+
body: r,
|
1086
1553
|
pathParams: t
|
1087
1554
|
})
|
1088
1555
|
});
|
1089
1556
|
}
|
1090
1557
|
export {
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1558
|
+
Ia as Breadcrumbs,
|
1559
|
+
Ut as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1560
|
+
rr as ENTERPRISE_PLAN_IDS,
|
1561
|
+
tr as ESSENTIAL_PLAN_IDS,
|
1562
|
+
Mt as FREE_PLAN_ID,
|
1563
|
+
ne as NavigationPanel,
|
1564
|
+
Pa as NavigationTabs,
|
1565
|
+
nr as PRO_PLAN_IDS,
|
1566
|
+
er as START_PLAN_IDS,
|
1567
|
+
P as Sidebar,
|
1568
|
+
I as SidebarTaskLanguageStatuses,
|
1569
|
+
je as SidebarTaskStatuses,
|
1570
|
+
X as SidebarTaskTypeOptions,
|
1571
|
+
Xn as TRIAL_PLAN_ID,
|
1572
|
+
Ra as clientSideJwtAuthMiddleware,
|
1573
|
+
sr as convertNewLineToBreakTag,
|
1574
|
+
aa as createProject,
|
1575
|
+
dr as formatDate,
|
1576
|
+
Ea as formatDateTz,
|
1577
|
+
Aa as getAuthenticatedSessionDetailFromRequest,
|
1578
|
+
Oo as getTeamUser,
|
1579
|
+
Mo as getTeamUsersQueryKey,
|
1580
|
+
Be as getUserToken,
|
1581
|
+
jo as getUserTokenKey,
|
1582
|
+
ka as isEnterpriseOpenSourcePlan,
|
1583
|
+
wa as isEnterprisePlan,
|
1584
|
+
ya as isEssentialPlan,
|
1585
|
+
Ue as isFreePlan,
|
1586
|
+
Sa as isPaidPlan,
|
1587
|
+
Ca as isProPlan,
|
1588
|
+
Ta as isStartPlan,
|
1589
|
+
qt as isTrialPlan,
|
1590
|
+
No as jwtAuthMiddleware,
|
1591
|
+
Qo as listProjectLanguages,
|
1592
|
+
Ua as listProjectLanguagesKey,
|
1593
|
+
sa as listProjects,
|
1594
|
+
Ba as listProjectsKey,
|
1595
|
+
lr as makeUrlClickable,
|
1596
|
+
se as parseJwtTokenPayload,
|
1597
|
+
ja as promoteClassicSessionToJwtMiddleware,
|
1598
|
+
Na as publicApiHeadersMiddleware,
|
1599
|
+
Do as retrieveContributor,
|
1600
|
+
Ho as retrieveContributorKeys,
|
1601
|
+
ia as retrieveProject,
|
1602
|
+
Da as retrieveProjectQueryKey,
|
1603
|
+
ca as updateProject,
|
1604
|
+
Oa as useAuthenticatedProjectContributor,
|
1605
|
+
zt as useAuthenticatedSessionPayload,
|
1606
|
+
La as useAuthenticatedUser,
|
1607
|
+
Ma as useCreateProjectMutation,
|
1608
|
+
qe as useEffectOnce,
|
1609
|
+
xa as useGetPromotedClassicSessionJwtQuery,
|
1610
|
+
Uo as useGetTeamUsersQuery,
|
1611
|
+
Ao as useGetUserTokenQuery,
|
1612
|
+
qa as useListProjectLanguagesQuery,
|
1613
|
+
$a as useListProjectsQuery,
|
1614
|
+
Fo as useRetrieveContributorQuery,
|
1615
|
+
Ha as useRetrieveProjectQuery,
|
1616
|
+
Fa as useUpdateProjectMutation
|
1147
1617
|
};
|