@lokalise/harmony 1.18.1 → 1.18.2
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 +431 -408
- package/dist/types/src/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.test.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Avatar/Avatar.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.test.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.test.d.ts +1 -0
- package/dist/types/tests/mocks/sidebar/tasks.d.ts +3 -1
- package/package.json +1 -1
package/dist/harmony.mjs
CHANGED
@@ -3,8 +3,8 @@ var Zt = (e, t, n) => t in e ? Vt(e, t, { enumerable: !0, configurable: !0, writ
|
|
3
3
|
var ne = (e, t, n) => Zt(e, typeof t != "symbol" ? t + "" : t, n);
|
4
4
|
import { jsx as s, jsxs as h, Fragment as Ue } from "react/jsx-runtime";
|
5
5
|
import * as G from "react";
|
6
|
-
import { useRef as wt, useState as R, useCallback as We, useEffect as z, useContext as Ct, createContext as
|
7
|
-
import { Tooltip as q, Link as L, Menu as ce, MenuList as le, CaretUpIcon as nn, UserIcon as It, MenuItem as J, MenuDivider as At, ConfirmModal as rn, Alert as
|
6
|
+
import { useRef as wt, useState as R, useCallback as We, useEffect as z, useContext as Ct, createContext as kt, cloneElement as en, Fragment as Pt, forwardRef as tn } from "react";
|
7
|
+
import { Tooltip as q, Link as L, Menu as ce, MenuList as le, CaretUpIcon as nn, UserIcon as It, MenuItem as J, MenuDivider as At, ConfirmModal as rn, Alert as an, Tag as je, Button as xe, Loading as on, Popover as sn, JobIcon as cn } from "@lokalise/louis";
|
8
8
|
import { format as Rt, parseISO as ln, isThisSecond as dn } from "date-fns";
|
9
9
|
import { toZonedTime as un } from "date-fns-tz";
|
10
10
|
import { z as r } from "zod";
|
@@ -17,7 +17,7 @@ const Oe = {
|
|
17
17
|
InProgress: "in_progress",
|
18
18
|
Created: "created",
|
19
19
|
Queued: "queued"
|
20
|
-
},
|
20
|
+
}, P = {
|
21
21
|
...Oe,
|
22
22
|
NotStarted: "not_started"
|
23
23
|
}, re = {
|
@@ -26,7 +26,7 @@ const Oe = {
|
|
26
26
|
lqa_by_ai: "lqa_by_ai",
|
27
27
|
automatic_translation: "automatic_translation"
|
28
28
|
};
|
29
|
-
var
|
29
|
+
var ae = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
30
30
|
function Nt(e) {
|
31
31
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
32
32
|
}
|
@@ -44,7 +44,7 @@ var ge, Xe;
|
|
44
44
|
function fn() {
|
45
45
|
if (Xe) return ge;
|
46
46
|
Xe = 1;
|
47
|
-
var e = typeof
|
47
|
+
var e = typeof ae == "object" && ae && ae.Object === Object && ae;
|
48
48
|
return ge = e, ge;
|
49
49
|
}
|
50
50
|
var he, Ye;
|
@@ -69,9 +69,9 @@ function gn() {
|
|
69
69
|
Ze = 1;
|
70
70
|
var e = /\s/;
|
71
71
|
function t(n) {
|
72
|
-
for (var
|
72
|
+
for (var a = n.length; a-- && e.test(n.charAt(a)); )
|
73
73
|
;
|
74
|
-
return
|
74
|
+
return a;
|
75
75
|
}
|
76
76
|
return be = t, be;
|
77
77
|
}
|
@@ -80,8 +80,8 @@ function hn() {
|
|
80
80
|
if (et) return ve;
|
81
81
|
et = 1;
|
82
82
|
var e = gn(), t = /^\s+/;
|
83
|
-
function n(
|
84
|
-
return
|
83
|
+
function n(a) {
|
84
|
+
return a && a.slice(0, e(a) + 1).replace(t, "");
|
85
85
|
}
|
86
86
|
return ve = n, ve;
|
87
87
|
}
|
@@ -96,16 +96,16 @@ var ye, nt;
|
|
96
96
|
function pn() {
|
97
97
|
if (nt) return ye;
|
98
98
|
nt = 1;
|
99
|
-
var e = xt(), t = Object.prototype, n = t.hasOwnProperty,
|
99
|
+
var e = xt(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
|
100
100
|
function i(c) {
|
101
|
-
var d = n.call(c,
|
101
|
+
var d = n.call(c, o), u = c[o];
|
102
102
|
try {
|
103
|
-
c[
|
103
|
+
c[o] = void 0;
|
104
104
|
var l = !0;
|
105
105
|
} catch {
|
106
106
|
}
|
107
|
-
var m =
|
108
|
-
return l && (d ? c[
|
107
|
+
var m = a.call(c);
|
108
|
+
return l && (d ? c[o] = u : delete c[o]), m;
|
109
109
|
}
|
110
110
|
return ye = i, ye;
|
111
111
|
}
|
@@ -114,25 +114,25 @@ function bn() {
|
|
114
114
|
if (rt) return Se;
|
115
115
|
rt = 1;
|
116
116
|
var e = Object.prototype, t = e.toString;
|
117
|
-
function n(
|
118
|
-
return t.call(
|
117
|
+
function n(a) {
|
118
|
+
return t.call(a);
|
119
119
|
}
|
120
120
|
return Se = n, Se;
|
121
121
|
}
|
122
|
-
var Ee,
|
122
|
+
var Ee, at;
|
123
123
|
function vn() {
|
124
|
-
if (
|
125
|
-
|
126
|
-
var e = xt(), t = pn(), n = bn(),
|
124
|
+
if (at) return Ee;
|
125
|
+
at = 1;
|
126
|
+
var e = xt(), t = pn(), n = bn(), a = "[object Null]", o = "[object Undefined]", i = e ? e.toStringTag : void 0;
|
127
127
|
function c(d) {
|
128
|
-
return d == null ? d === void 0 ?
|
128
|
+
return d == null ? d === void 0 ? o : a : i && i in Object(d) ? t(d) : n(d);
|
129
129
|
}
|
130
130
|
return Ee = c, Ee;
|
131
131
|
}
|
132
|
-
var we,
|
132
|
+
var we, ot;
|
133
133
|
function Tn() {
|
134
|
-
if (
|
135
|
-
|
134
|
+
if (ot) return we;
|
135
|
+
ot = 1;
|
136
136
|
function e(t) {
|
137
137
|
return t != null && typeof t == "object";
|
138
138
|
}
|
@@ -143,21 +143,21 @@ function yn() {
|
|
143
143
|
if (st) return Ce;
|
144
144
|
st = 1;
|
145
145
|
var e = vn(), t = Tn(), n = "[object Symbol]";
|
146
|
-
function o
|
147
|
-
return typeof
|
146
|
+
function a(o) {
|
147
|
+
return typeof o == "symbol" || t(o) && e(o) == n;
|
148
148
|
}
|
149
|
-
return Ce =
|
149
|
+
return Ce = a, Ce;
|
150
150
|
}
|
151
|
-
var
|
151
|
+
var ke, it;
|
152
152
|
function Sn() {
|
153
|
-
if (it) return
|
153
|
+
if (it) return ke;
|
154
154
|
it = 1;
|
155
|
-
var e = hn(), t = Be(), n = yn(),
|
155
|
+
var e = hn(), t = Be(), n = yn(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, c = /^0o[0-7]+$/i, d = parseInt;
|
156
156
|
function u(l) {
|
157
157
|
if (typeof l == "number")
|
158
158
|
return l;
|
159
159
|
if (n(l))
|
160
|
-
return
|
160
|
+
return a;
|
161
161
|
if (t(l)) {
|
162
162
|
var m = typeof l.valueOf == "function" ? l.valueOf() : l;
|
163
163
|
l = t(m) ? m + "" : m;
|
@@ -166,20 +166,20 @@ function Sn() {
|
|
166
166
|
return l === 0 ? l : +l;
|
167
167
|
l = e(l);
|
168
168
|
var _ = i.test(l);
|
169
|
-
return _ || c.test(l) ? d(l.slice(2), _ ? 2 : 8) :
|
169
|
+
return _ || c.test(l) ? d(l.slice(2), _ ? 2 : 8) : o.test(l) ? a : +l;
|
170
170
|
}
|
171
|
-
return
|
171
|
+
return ke = u, ke;
|
172
172
|
}
|
173
|
-
var
|
173
|
+
var Pe, ct;
|
174
174
|
function Ot() {
|
175
|
-
if (ct) return
|
175
|
+
if (ct) return Pe;
|
176
176
|
ct = 1;
|
177
|
-
var e = Be(), t = _n(), n = Sn(),
|
177
|
+
var e = Be(), t = _n(), n = Sn(), a = "Expected a function", o = Math.max, i = Math.min;
|
178
178
|
function c(d, u, l) {
|
179
179
|
var m, _, T, y, f, E, b = 0, g = !1, p = !1, v = !0;
|
180
180
|
if (typeof d != "function")
|
181
|
-
throw new TypeError(
|
182
|
-
u = n(u) || 0, e(l) && (g = !!l.leading, p = "maxWait" in l, T = p ?
|
181
|
+
throw new TypeError(a);
|
182
|
+
u = n(u) || 0, e(l) && (g = !!l.leading, p = "maxWait" in l, T = p ? o(n(l.maxWait) || 0, u) : T, v = "trailing" in l ? !!l.trailing : v);
|
183
183
|
function C(S) {
|
184
184
|
var j = m, $ = _;
|
185
185
|
return m = _ = void 0, b = S, y = d.apply($, j), y;
|
@@ -222,7 +222,7 @@ function Ot() {
|
|
222
222
|
}
|
223
223
|
return fe.cancel = Xt, fe.flush = Yt, fe;
|
224
224
|
}
|
225
|
-
return
|
225
|
+
return Pe = c, Pe;
|
226
226
|
}
|
227
227
|
var En = Ot();
|
228
228
|
const wn = /* @__PURE__ */ Nt(En);
|
@@ -231,25 +231,25 @@ function Cn() {
|
|
231
231
|
if (lt) return Ie;
|
232
232
|
lt = 1;
|
233
233
|
var e = Ot(), t = Be(), n = "Expected a function";
|
234
|
-
function o
|
234
|
+
function a(o, i, c) {
|
235
235
|
var d = !0, u = !0;
|
236
|
-
if (typeof
|
236
|
+
if (typeof o != "function")
|
237
237
|
throw new TypeError(n);
|
238
|
-
return t(c) && (d = "leading" in c ? !!c.leading : d, u = "trailing" in c ? !!c.trailing : u), e(
|
238
|
+
return t(c) && (d = "leading" in c ? !!c.leading : d, u = "trailing" in c ? !!c.trailing : u), e(o, i, {
|
239
239
|
leading: d,
|
240
240
|
maxWait: i,
|
241
241
|
trailing: u
|
242
242
|
});
|
243
243
|
}
|
244
|
-
return Ie =
|
244
|
+
return Ie = a, Ie;
|
245
245
|
}
|
246
|
-
var
|
247
|
-
const
|
246
|
+
var kn = Cn();
|
247
|
+
const Pn = /* @__PURE__ */ Nt(kn), In = (e, t, n, a) => {
|
248
248
|
switch (t) {
|
249
249
|
case "debounce":
|
250
|
-
return wn(e, n,
|
250
|
+
return wn(e, n, a);
|
251
251
|
case "throttle":
|
252
|
-
return
|
252
|
+
return Pn(e, n, a);
|
253
253
|
default:
|
254
254
|
return e;
|
255
255
|
}
|
@@ -260,8 +260,8 @@ const kn = /* @__PURE__ */ Nt(Pn), In = (e, t, n, o) => {
|
|
260
260
|
return G.useEffect(() => {
|
261
261
|
t.current = e;
|
262
262
|
}), G.useMemo(() => (...n) => {
|
263
|
-
var
|
264
|
-
return (
|
263
|
+
var a;
|
264
|
+
return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
|
265
265
|
}, []);
|
266
266
|
}
|
267
267
|
), Rn = (
|
@@ -270,14 +270,14 @@ const kn = /* @__PURE__ */ Nt(Pn), In = (e, t, n, o) => {
|
|
270
270
|
const [t, n] = G.useState((e == null ? void 0 : e.current) || null);
|
271
271
|
return e && setTimeout(() => {
|
272
272
|
e.current !== t && n(e.current);
|
273
|
-
}, 0), { refProxy: G.useMemo(() => new Proxy((
|
274
|
-
|
273
|
+
}, 0), { refProxy: G.useMemo(() => new Proxy((o) => {
|
274
|
+
o !== t && n(o);
|
275
275
|
}, {
|
276
|
-
get(
|
277
|
-
return i === "current" ? t :
|
276
|
+
get(o, i) {
|
277
|
+
return i === "current" ? t : o[i];
|
278
278
|
},
|
279
|
-
set(
|
280
|
-
return i === "current" ? n(c) :
|
279
|
+
set(o, i, c) {
|
280
|
+
return i === "current" ? n(c) : o[i] = c, !0;
|
281
281
|
}
|
282
282
|
}), [t]), refElement: t, setRefElement: n };
|
283
283
|
}
|
@@ -291,18 +291,18 @@ const kn = /* @__PURE__ */ Nt(Pn), In = (e, t, n, o) => {
|
|
291
291
|
width: e.contentRect.width,
|
292
292
|
height: e.contentRect.height
|
293
293
|
};
|
294
|
-
function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions:
|
294
|
+
function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: a, handleWidth: o = !0, handleHeight: i = !0, targetRef: c, observerOptions: d, onResize: u } = {}) {
|
295
295
|
const l = wt(e), m = An(u), [_, T] = R({
|
296
296
|
width: void 0,
|
297
297
|
height: void 0
|
298
298
|
}), { refProxy: y, refElement: f } = Rn(c), { box: E } = d || {}, b = We((p) => {
|
299
|
-
if (!
|
299
|
+
if (!o && !i)
|
300
300
|
return;
|
301
301
|
if (l.current) {
|
302
302
|
l.current = !1;
|
303
303
|
return;
|
304
304
|
}
|
305
|
-
const v = (C, w) =>
|
305
|
+
const v = (C, w) => o && C.width !== w.width || i && C.height !== w.height;
|
306
306
|
p.forEach((C) => {
|
307
307
|
const w = Nn(C, E);
|
308
308
|
T((ee) => v(ee, w) ? (m == null || m({
|
@@ -311,11 +311,11 @@ function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refresh
|
|
311
311
|
entry: C
|
312
312
|
}), w) : ee);
|
313
313
|
});
|
314
|
-
}, [
|
314
|
+
}, [o, i, l, E]), g = We(In(b, t, n, a), [
|
315
315
|
b,
|
316
316
|
t,
|
317
317
|
n,
|
318
|
-
|
318
|
+
a
|
319
319
|
]);
|
320
320
|
return z(() => {
|
321
321
|
let p;
|
@@ -330,17 +330,17 @@ function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refresh
|
|
330
330
|
}, [g, f]), Object.assign({ ref: y }, _);
|
331
331
|
}
|
332
332
|
function Lt(e) {
|
333
|
-
var t, n,
|
334
|
-
if (typeof e == "string" || typeof e == "number")
|
333
|
+
var t, n, a = "";
|
334
|
+
if (typeof e == "string" || typeof e == "number") a += e;
|
335
335
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
336
|
-
var
|
337
|
-
for (t = 0; t <
|
338
|
-
} else for (n in e) e[n] && (
|
339
|
-
return
|
336
|
+
var o = e.length;
|
337
|
+
for (t = 0; t < o; t++) e[t] && (n = Lt(e[t])) && (a && (a += " "), a += n);
|
338
|
+
} else for (n in e) e[n] && (a && (a += " "), a += n);
|
339
|
+
return a;
|
340
340
|
}
|
341
341
|
function N() {
|
342
|
-
for (var e, t, n = 0,
|
343
|
-
return
|
342
|
+
for (var e, t, n = 0, a = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Lt(e)) && (a && (a += " "), a += t);
|
343
|
+
return a;
|
344
344
|
}
|
345
345
|
const xn = "_headerContainer_1cubo_1", On = "_navigationTabList_1cubo_8", Ln = "_navigationTab_1cubo_8", Mn = "_headerContent_1cubo_34", Un = "_staticEnabled_1cubo_50", H = {
|
346
346
|
headerContainer: xn,
|
@@ -348,18 +348,18 @@ const xn = "_headerContainer_1cubo_1", On = "_navigationTabList_1cubo_8", Ln = "
|
|
348
348
|
navigationTab: Ln,
|
349
349
|
headerContent: Mn,
|
350
350
|
staticEnabled: Un
|
351
|
-
}, Hn = 77,
|
352
|
-
const { ref: n, height:
|
351
|
+
}, Hn = 77, oe = ({ sticky: e, children: t }) => {
|
352
|
+
const { ref: n, height: a } = jn({
|
353
353
|
refreshMode: "debounce",
|
354
354
|
refreshRate: 0
|
355
|
-
}), [
|
355
|
+
}), [o, i] = R(!1), c = () => o ? !e : !0;
|
356
356
|
z(() => {
|
357
357
|
const u = () => {
|
358
358
|
i(window.scrollY > 0);
|
359
359
|
};
|
360
360
|
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
361
361
|
}, []);
|
362
|
-
const d = `${
|
362
|
+
const d = `${a || Hn}px`;
|
363
363
|
return /* @__PURE__ */ s("div", { style: { minHeight: d }, children: /* @__PURE__ */ s("div", { children: /* @__PURE__ */ h(
|
364
364
|
"div",
|
365
365
|
{
|
@@ -368,20 +368,25 @@ const xn = "_headerContainer_1cubo_1", On = "_navigationTabList_1cubo_8", Ln = "
|
|
368
368
|
[H.staticEnabled]: c()
|
369
369
|
}),
|
370
370
|
children: [
|
371
|
-
/* @__PURE__ */ s(
|
372
|
-
/* @__PURE__ */ s(
|
371
|
+
/* @__PURE__ */ s(oe.Header, {}),
|
372
|
+
/* @__PURE__ */ s(oe.Tabs, {}),
|
373
373
|
t
|
374
374
|
]
|
375
375
|
}
|
376
376
|
) }) });
|
377
377
|
};
|
378
|
-
|
379
|
-
|
378
|
+
oe.Header = ({ children: e }) => /* @__PURE__ */ s("div", { className: H.headerContainer, children: e });
|
379
|
+
oe.Tabs = ({ children: e }) => /* @__PURE__ */ s("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
380
380
|
const qn = "_sidebarContainer_bmdti_1", Bn = {
|
381
381
|
sidebarContainer: qn
|
382
382
|
}, Dn = "_logoLink_1baxb_1", $n = {
|
383
383
|
logoLink: Dn
|
384
|
-
}, Fn = ({
|
384
|
+
}, Fn = ({
|
385
|
+
src: e,
|
386
|
+
href: t = "/",
|
387
|
+
ariaLabel: n = "Lokalise App Home",
|
388
|
+
alt: a = "Lokalise Logo"
|
389
|
+
}) => /* @__PURE__ */ s("a", { className: $n.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ s("img", { src: e, alt: a }) }), Gn = "_link_18vhx_1", Kn = "_active_18vhx_18", dt = {
|
385
390
|
link: Gn,
|
386
391
|
active: Kn
|
387
392
|
}, zn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ s(q, { placement: "right", tooltip: e, children: /* @__PURE__ */ s(
|
@@ -433,12 +438,12 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
433
438
|
profileImageHighlight: tr,
|
434
439
|
profileImageUpgradeIcon: nr,
|
435
440
|
userIconWrapper: rr
|
436
|
-
}, Ut =
|
441
|
+
}, Ut = kt({}), X = () => Ct(Ut), ar = ({ children: e }) => {
|
437
442
|
const {
|
438
443
|
currentTeam: t,
|
439
444
|
otherTeams: n,
|
440
|
-
showUpgradeCta:
|
441
|
-
showBillingButton:
|
445
|
+
showUpgradeCta: a,
|
446
|
+
showBillingButton: o,
|
442
447
|
allowTeamCreation: i,
|
443
448
|
isProviderAlpha: c,
|
444
449
|
canAccessTeamSettings: d,
|
@@ -455,7 +460,7 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
455
460
|
{
|
456
461
|
src: t.logoUrl,
|
457
462
|
className: N(x.profileImage, {
|
458
|
-
[x.profileImageHighlight]:
|
463
|
+
[x.profileImageHighlight]: a
|
459
464
|
}),
|
460
465
|
alt: "Team Logo"
|
461
466
|
}
|
@@ -463,12 +468,12 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
463
468
|
"div",
|
464
469
|
{
|
465
470
|
className: N(x.userIconWrapper, "flex-row", "align-center", "items-center", {
|
466
|
-
[x.profileImageHighlight]:
|
471
|
+
[x.profileImageHighlight]: a
|
467
472
|
}),
|
468
473
|
children: /* @__PURE__ */ s(It, { size: "25px" })
|
469
474
|
}
|
470
475
|
),
|
471
|
-
|
476
|
+
a && /* @__PURE__ */ s(Mt, { className: x.profileImageUpgradeIcon })
|
472
477
|
] }),
|
473
478
|
children: /* @__PURE__ */ s(le, { placement: "right-end", className: x.menuContainer, children: e({
|
474
479
|
allowTeamCreation: i,
|
@@ -476,24 +481,24 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
476
481
|
canAccessTeamSettings: d,
|
477
482
|
isEndOfTrialActive: u,
|
478
483
|
isTeamSuspended: l,
|
479
|
-
showBillingButton:
|
484
|
+
showBillingButton: o,
|
480
485
|
isProviderAlpha: c,
|
481
486
|
isFullyAuthenticated: m
|
482
487
|
}) })
|
483
488
|
}
|
484
489
|
);
|
485
|
-
}, Ht = 0,
|
486
|
-
const
|
487
|
-
if (
|
490
|
+
}, Ht = 0, or = 9999, sr = [150, 151, 250, 251], ir = [152, 153, 252, 253], cr = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], lr = [156, 159, 160, 256, 259, 260], qt = 9998, De = (e) => e === Ht, Bt = (e) => e === or, Lo = (e) => sr.includes(e), Mo = (e) => ir.includes(e), Uo = (e) => cr.includes(e), Ho = (e) => lr.includes(e), qo = (e) => e > Ht && e < qt, Bo = (e) => e === qt, dr = /\n/, mt = (e, t, n) => e.split(t).flatMap((a, o) => o !== 0 ? [en(n, { key: Math.random().toString(32).slice(0, 10) }), a] : a), ur = (e, t, n) => typeof e == "string" ? mt(e, t, n) : e.flatMap((a) => typeof a == "string" ? mt(a, t, n) : a), mr = (e) => ur(e, dr, /* @__PURE__ */ s("br", {})), fr = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, _r = (e) => e.match(fr) ?? [], ft = (e, t, n) => {
|
491
|
+
const a = e.split(t);
|
492
|
+
if (a.length === 1)
|
488
493
|
return e;
|
489
|
-
const
|
490
|
-
return
|
494
|
+
const o = [];
|
495
|
+
return a[0] !== "" && o.push(a[0]), a.shift(), a[a.length - 1] === "" && a.pop(), o.push(
|
491
496
|
/* @__PURE__ */ s("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
|
492
|
-
),
|
497
|
+
), o.push(a.join(t)), o.filter((i) => i !== "");
|
493
498
|
}, _t = (e) => {
|
494
499
|
const t = _r(e);
|
495
|
-
return t != null && t.length ? t.reduce((n,
|
496
|
-
}, gr = (e) => typeof e == "string" ? _t(e) : e.flatMap((t) => typeof t == "string" ? _t(t) : t, e), hr = (e, t = "PP") => Rt(e, t),
|
500
|
+
return t != null && t.length ? t.reduce((n, a, o) => typeof n == "string" ? ft(n, a, o) : n.flatMap((i) => typeof i == "string" ? ft(i, a, o) : i), e) : e;
|
501
|
+
}, gr = (e) => typeof e == "string" ? _t(e) : e.flatMap((t) => typeof t == "string" ? _t(t) : t, e), hr = (e, t = "PP") => Rt(e, t), Do = (e, t, n = "PP") => Rt(un(e, t), n), $e = (e) => {
|
497
502
|
z(e, []);
|
498
503
|
}, gt = {
|
499
504
|
biller: "biller",
|
@@ -502,7 +507,7 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
502
507
|
gt.biller,
|
503
508
|
gt.owner
|
504
509
|
], pr = ({ children: e, config: t }) => {
|
505
|
-
const { teams: n, currentTeamId:
|
510
|
+
const { teams: n, currentTeamId: a, planId: o, isEndOfTrialActive: i, isFullyAuthenticated: c, userTeamRole: d } = t, u = n.find((g) => g.id === a), l = n.filter((g) => g.id !== a), m = ht.includes(d), _ = ht.includes(d), T = De(o) || Bt(o), b = {
|
506
511
|
...t,
|
507
512
|
currentTeam: u,
|
508
513
|
otherTeams: l,
|
@@ -514,17 +519,17 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
514
519
|
allowTeamCreation: c && !i
|
515
520
|
};
|
516
521
|
return /* @__PURE__ */ s(Ut.Provider, { value: b, children: e });
|
517
|
-
}, br = ({ config: e, children: t }) => /* @__PURE__ */ s(pr, { config: e, children: /* @__PURE__ */ s(
|
522
|
+
}, br = ({ config: e, children: t }) => /* @__PURE__ */ s(pr, { config: e, children: /* @__PURE__ */ s(ar, { children: t }) }), vr = "_container_q5pot_1", Tr = "_profileEmail_q5pot_5", pt = {
|
518
523
|
container: vr,
|
519
524
|
profileEmail: Tr
|
520
525
|
}, yr = ({
|
521
526
|
href: e,
|
522
527
|
onClick: t,
|
523
528
|
userEmail: n,
|
524
|
-
hideBottomDivider:
|
529
|
+
hideBottomDivider: a
|
525
530
|
}) => {
|
526
|
-
const { isEndOfTrialActive:
|
527
|
-
return
|
531
|
+
const { isEndOfTrialActive: o, isTeamSuspended: i } = X();
|
532
|
+
return o || i ? null : /* @__PURE__ */ h(Ue, { children: [
|
528
533
|
/* @__PURE__ */ s(
|
529
534
|
J,
|
530
535
|
{
|
@@ -538,20 +543,20 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
538
543
|
] })
|
539
544
|
}
|
540
545
|
),
|
541
|
-
!
|
546
|
+
!a && /* @__PURE__ */ s(At, {})
|
542
547
|
] });
|
543
|
-
}, Sr = "_wrapper_15d85_1", Er = "_profileImage_15d85_14", wr = "_teamName_15d85_22", Cr = "_planLabel_15d85_29",
|
548
|
+
}, Sr = "_wrapper_15d85_1", Er = "_profileImage_15d85_14", wr = "_teamName_15d85_22", Cr = "_planLabel_15d85_29", kr = "_membership_15d85_38", Pr = "_defaultProfileImage_15d85_44", M = {
|
544
549
|
wrapper: Sr,
|
545
550
|
profileImage: Er,
|
546
551
|
teamName: wr,
|
547
552
|
planLabel: Cr,
|
548
|
-
membership:
|
549
|
-
defaultProfileImage:
|
553
|
+
membership: kr,
|
554
|
+
defaultProfileImage: Pr
|
550
555
|
}, Dt = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
551
|
-
const { currentTeam:
|
556
|
+
const { currentTeam: a, planId: o } = X(), i = e || a;
|
552
557
|
if (!i)
|
553
558
|
return null;
|
554
|
-
const c = De(
|
559
|
+
const c = De(o) ? "Free" : Bt(o) ? "Trial" : void 0;
|
555
560
|
return /* @__PURE__ */ h(
|
556
561
|
t ? J : "div",
|
557
562
|
{
|
@@ -573,23 +578,38 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
573
578
|
teamsContainer: Ir
|
574
579
|
}, Rr = ({ onSwitchTeam: e }) => {
|
575
580
|
const { otherTeams: t } = X();
|
576
|
-
return t.length === 0 ? null : /* @__PURE__ */ s(
|
581
|
+
return t.length === 0 ? null : /* @__PURE__ */ s(
|
582
|
+
"div",
|
583
|
+
{
|
584
|
+
"data-testid": "sidebar-team-switch",
|
585
|
+
className: `flex-col items-stretch ${Ar.teamsContainer}`,
|
586
|
+
children: t.map((n) => /* @__PURE__ */ s(Dt, { team: n, onClick: e, hidePlanLabel: !0 }, n.id))
|
587
|
+
}
|
588
|
+
);
|
577
589
|
}, Nr = "_container_1u995_1", jr = "_planCta_1u995_15", xr = "_upgradeIconWrapper_1u995_19", Ae = {
|
578
590
|
container: Nr,
|
579
591
|
planCta: jr,
|
580
592
|
upgradeIconWrapper: xr
|
581
593
|
}, Or = ({ upgradeOptionHref: e }) => {
|
582
|
-
const { planId: t, trialDaysLeft: n, showUpgradeCta:
|
583
|
-
if (!
|
594
|
+
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = X();
|
595
|
+
if (!a)
|
584
596
|
return null;
|
585
597
|
const c = De(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
586
|
-
return /* @__PURE__ */ h(
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
598
|
+
return /* @__PURE__ */ h(
|
599
|
+
J,
|
600
|
+
{
|
601
|
+
"data-testid": "sidebar-upgrade-menu-item",
|
602
|
+
href: e,
|
603
|
+
className: `flex-col gap-1 items-start ${Ae.container}`,
|
604
|
+
children: [
|
605
|
+
/* @__PURE__ */ s("span", { className: Ae.planCta, children: c }),
|
606
|
+
/* @__PURE__ */ h("div", { className: `flex-row items-center gap-1 ${Ae.upgradeIconWrapper}`, children: [
|
607
|
+
/* @__PURE__ */ s(Mt, {}),
|
608
|
+
/* @__PURE__ */ s("span", { children: "See upgrade options" })
|
609
|
+
] })
|
610
|
+
]
|
611
|
+
}
|
612
|
+
);
|
593
613
|
}, Lr = Math.min, Mr = Math.max;
|
594
614
|
function bt(e, t, n) {
|
595
615
|
return Mr(e, Lr(t, n));
|
@@ -627,16 +647,16 @@ function vt(e) {
|
|
627
647
|
const {
|
628
648
|
x: t,
|
629
649
|
y: n,
|
630
|
-
width:
|
631
|
-
height:
|
650
|
+
width: a,
|
651
|
+
height: o
|
632
652
|
} = e;
|
633
653
|
return {
|
634
|
-
width:
|
635
|
-
height:
|
654
|
+
width: a,
|
655
|
+
height: o,
|
636
656
|
top: n,
|
637
657
|
left: t,
|
638
|
-
right: t +
|
639
|
-
bottom: n +
|
658
|
+
right: t + a,
|
659
|
+
bottom: n + o,
|
640
660
|
x: t,
|
641
661
|
y: n
|
642
662
|
};
|
@@ -645,8 +665,8 @@ async function Dr(e, t) {
|
|
645
665
|
var n;
|
646
666
|
t === void 0 && (t = {});
|
647
667
|
const {
|
648
|
-
x:
|
649
|
-
y:
|
668
|
+
x: a,
|
669
|
+
y: o,
|
650
670
|
platform: i,
|
651
671
|
rects: c,
|
652
672
|
elements: d,
|
@@ -663,8 +683,8 @@ async function Dr(e, t) {
|
|
663
683
|
rootBoundary: m,
|
664
684
|
strategy: u
|
665
685
|
})), p = _ === "floating" ? {
|
666
|
-
x:
|
667
|
-
y:
|
686
|
+
x: a,
|
687
|
+
y: o,
|
668
688
|
width: c.floating.width,
|
669
689
|
height: c.floating.height
|
670
690
|
} : c.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(d.floating)), C = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
|
@@ -693,8 +713,8 @@ const $r = function(e) {
|
|
693
713
|
async fn(t) {
|
694
714
|
const {
|
695
715
|
x: n,
|
696
|
-
y:
|
697
|
-
placement:
|
716
|
+
y: a,
|
717
|
+
placement: o
|
698
718
|
} = t, {
|
699
719
|
mainAxis: i = !0,
|
700
720
|
crossAxis: c = !1,
|
@@ -713,8 +733,8 @@ const $r = function(e) {
|
|
713
733
|
...u
|
714
734
|
} = $t(e, t), l = {
|
715
735
|
x: n,
|
716
|
-
y:
|
717
|
-
}, m = await Dr(t, u), _ = Hr(Ft(
|
736
|
+
y: a
|
737
|
+
}, m = await Dr(t, u), _ = Hr(Ft(o)), T = Ur(_);
|
718
738
|
let y = l[T], f = l[_];
|
719
739
|
if (i) {
|
720
740
|
const b = T === "y" ? "top" : "left", g = T === "y" ? "bottom" : "right", p = y + m[b], v = y - m[g];
|
@@ -733,7 +753,7 @@ const $r = function(e) {
|
|
733
753
|
...E,
|
734
754
|
data: {
|
735
755
|
x: E.x - n,
|
736
|
-
y: E.y -
|
756
|
+
y: E.y - a,
|
737
757
|
enabled: {
|
738
758
|
[T]: i,
|
739
759
|
[_]: c
|
@@ -746,27 +766,27 @@ const $r = function(e) {
|
|
746
766
|
navItem: Fr,
|
747
767
|
activeNavItem: Gr,
|
748
768
|
badge: Kr
|
749
|
-
}, Gt =
|
750
|
-
const t = e.lastIndexOf("."), n = e.slice(0, t),
|
751
|
-
return { name: n, extension:
|
769
|
+
}, Gt = kt({}), Y = () => Ct(Gt), zr = (e) => {
|
770
|
+
const t = e.lastIndexOf("."), n = e.slice(0, t), a = e.slice(t + 1);
|
771
|
+
return { name: n, extension: a };
|
752
772
|
}, Jr = (e, t) => {
|
753
773
|
switch (e) {
|
754
|
-
case
|
774
|
+
case P.Completed:
|
755
775
|
return t < 100 ? "Closed" : "Completed";
|
756
|
-
case
|
776
|
+
case P.Created:
|
757
777
|
return t > 0 ? "In progress" : "Not started";
|
758
|
-
case
|
778
|
+
case P.InProgress:
|
759
779
|
return "In progress";
|
760
|
-
case
|
780
|
+
case P.Queued:
|
761
781
|
return "Queued";
|
762
|
-
case
|
782
|
+
case P.NotStarted:
|
763
783
|
return "Not started";
|
764
784
|
default:
|
765
785
|
return "-";
|
766
786
|
}
|
767
787
|
}, Wr = (e) => {
|
768
788
|
const t = e.progress ?? 0;
|
769
|
-
return e.status ===
|
789
|
+
return e.status === P.Created && t > 0 ? P.InProgress : e.status;
|
770
790
|
}, Qr = {
|
771
791
|
[re.translation]: "#0891B2",
|
772
792
|
[re.review]: "#16922D",
|
@@ -774,17 +794,17 @@ const $r = function(e) {
|
|
774
794
|
[re.automatic_translation]: "#60A5FA"
|
775
795
|
}, Xr = (e) => {
|
776
796
|
const t = [
|
777
|
-
|
778
|
-
|
779
|
-
|
797
|
+
P.InProgress,
|
798
|
+
P.Created,
|
799
|
+
P.Completed
|
780
800
|
];
|
781
|
-
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Wr(n) })).sort((n,
|
782
|
-
}, Tt = (e) =>
|
783
|
-
const [n,
|
801
|
+
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Wr(n) })).sort((n, a) => n.status === P.InProgress && n.progress === 100 ? -1 : a.status === P.InProgress && a.progress === 100 ? 1 : n.status === a.status ? n.name < a.name ? 1 : -1 : t.indexOf(n.status) - t.indexOf(a.status));
|
802
|
+
}, Tt = (e) => [Oe.InProgress, Oe.Created].includes(e), Yr = (e, t) => Tt(e.status) && Tt(t.status) && (t.progress ?? 0) >= 100, Vr = ({ task: e, language: t }) => {
|
803
|
+
const [n, a] = R(!1), [o, i] = R(!1), { onLanguageCompleteConfirm: c, fetchTasks: d } = Y(), u = () => {
|
784
804
|
i(!1);
|
785
805
|
};
|
786
806
|
return /* @__PURE__ */ h(Ue, { children: [
|
787
|
-
|
807
|
+
o && /* @__PURE__ */ s(
|
788
808
|
rn,
|
789
809
|
{
|
790
810
|
opened: !0,
|
@@ -794,9 +814,9 @@ const $r = function(e) {
|
|
794
814
|
closeText: "Cancel",
|
795
815
|
onClose: u,
|
796
816
|
onConfirm: async () => {
|
797
|
-
|
817
|
+
a(!0), await c({ task: e, language: t, closePrompt: u }), d();
|
798
818
|
},
|
799
|
-
children: /* @__PURE__ */ h(
|
819
|
+
children: /* @__PURE__ */ h(an, { status: "info", children: [
|
800
820
|
"Make sure you are finished and ",
|
801
821
|
/* @__PURE__ */ s("strong", { children: "mark it as done" }),
|
802
822
|
" to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
|
@@ -814,12 +834,12 @@ const $r = function(e) {
|
|
814
834
|
}
|
815
835
|
)
|
816
836
|
] });
|
817
|
-
}, Zr = "_langRowCompleted_vpgdi_1",
|
837
|
+
}, Zr = "_langRowCompleted_vpgdi_1", ea = "_langCellSecondary_vpgdi_15", ta = "_langStatus_vpgdi_20", Ne = {
|
818
838
|
langRowCompleted: Zr,
|
819
|
-
langCellSecondary:
|
820
|
-
langStatus:
|
821
|
-
},
|
822
|
-
const { getProjectUrl: n, langNameOnClick:
|
839
|
+
langCellSecondary: ea,
|
840
|
+
langStatus: ta
|
841
|
+
}, na = ({ language: e, task: t }) => {
|
842
|
+
const { getProjectUrl: n, langNameOnClick: a, langProgressOnClick: o } = Y(), i = e.progress ?? 0, c = e.status === P.Completed, d = Yr(t, e);
|
823
843
|
return /* @__PURE__ */ h(
|
824
844
|
"tr",
|
825
845
|
{
|
@@ -832,7 +852,7 @@ const $r = function(e) {
|
|
832
852
|
{
|
833
853
|
href: n({ task: t, language: e }),
|
834
854
|
onClick: () => {
|
835
|
-
|
855
|
+
a == null || a({ task: t, language: e });
|
836
856
|
},
|
837
857
|
children: e.name
|
838
858
|
}
|
@@ -842,7 +862,7 @@ const $r = function(e) {
|
|
842
862
|
{
|
843
863
|
href: n({ task: t, language: e, taskUncompleted: !0 }),
|
844
864
|
onClick: () => {
|
845
|
-
|
865
|
+
o == null || o({ task: t, language: e });
|
846
866
|
},
|
847
867
|
children: e.base_words_total - e.base_words_done
|
848
868
|
}
|
@@ -862,21 +882,21 @@ const $r = function(e) {
|
|
862
882
|
]
|
863
883
|
}
|
864
884
|
);
|
865
|
-
},
|
866
|
-
taskContainer:
|
867
|
-
taskTitle:
|
868
|
-
taskDescription:
|
869
|
-
languagesTable:
|
870
|
-
metadata:
|
871
|
-
},
|
872
|
-
const {
|
873
|
-
|
874
|
-
`/style-guide/${e.team_id}/download/${
|
885
|
+
}, ra = "_taskContainer_mt2or_1", aa = "_taskTitle_mt2or_21", oa = "_taskDescription_mt2or_28", sa = "_languagesTable_mt2or_35", ia = "_metadata_mt2or_87", U = {
|
886
|
+
taskContainer: ra,
|
887
|
+
taskTitle: aa,
|
888
|
+
taskDescription: oa,
|
889
|
+
languagesTable: sa,
|
890
|
+
metadata: ia
|
891
|
+
}, ca = ({ task: e }) => {
|
892
|
+
const { getProjectUrl: t, taskTitleOnClick: n } = Y(), a = Xr(e.langs), o = (i) => {
|
893
|
+
window.open(
|
894
|
+
`/style-guide/${e.team_id}/download/${i.id}/link`,
|
875
895
|
"_blank",
|
876
896
|
"noopener,noreferrer"
|
877
897
|
);
|
878
898
|
};
|
879
|
-
return
|
899
|
+
return /* @__PURE__ */ h("div", { className: U.taskContainer, children: [
|
880
900
|
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-center", children: [
|
881
901
|
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
|
882
902
|
/* @__PURE__ */ s(je, { color: Qr[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
|
@@ -890,20 +910,20 @@ const $r = function(e) {
|
|
890
910
|
{
|
891
911
|
size: "sm",
|
892
912
|
variant: "secondary",
|
893
|
-
onClick: () =>
|
913
|
+
onClick: () => o(e.style_guides[0]),
|
894
914
|
children: "Download style guide"
|
895
915
|
}
|
896
916
|
) : /* @__PURE__ */ s(
|
897
917
|
ce,
|
898
918
|
{
|
899
919
|
menuButton: /* @__PURE__ */ s(xe, { variant: "secondary", size: "sm", children: "Download style guide" }),
|
900
|
-
children: /* @__PURE__ */ s(le, { children: e.style_guides.map((
|
920
|
+
children: /* @__PURE__ */ s(le, { children: e.style_guides.map((i) => /* @__PURE__ */ s(
|
901
921
|
J,
|
902
922
|
{
|
903
|
-
onClick: () => i
|
904
|
-
children: zr(
|
923
|
+
onClick: () => o(i),
|
924
|
+
children: zr(i.name).name
|
905
925
|
},
|
906
|
-
|
926
|
+
i.id
|
907
927
|
)) })
|
908
928
|
}
|
909
929
|
) })
|
@@ -911,9 +931,9 @@ const $r = function(e) {
|
|
911
931
|
/* @__PURE__ */ s("h4", { className: U.taskTitle, children: /* @__PURE__ */ s(
|
912
932
|
L,
|
913
933
|
{
|
914
|
-
href:
|
934
|
+
href: t({ task: e, view: "multi" }),
|
915
935
|
onClick: () => {
|
916
|
-
|
936
|
+
n == null || n({ task: e });
|
917
937
|
},
|
918
938
|
children: e.title
|
919
939
|
}
|
@@ -926,9 +946,9 @@ const $r = function(e) {
|
|
926
946
|
/* @__PURE__ */ s("th", { children: "Progress" }),
|
927
947
|
/* @__PURE__ */ s("th", { children: "Status" })
|
928
948
|
] }) }),
|
929
|
-
/* @__PURE__ */ s("tbody", { children: a.map((
|
949
|
+
/* @__PURE__ */ s("tbody", { children: a.map((i) => /* @__PURE__ */ s(na, { language: i, task: e }, i.lang_id)) })
|
930
950
|
] }),
|
931
|
-
/* @__PURE__ */ h("div", { className: U.metadata, children: [
|
951
|
+
/* @__PURE__ */ h("div", { "data-testid": "sidebar-task-overview-metadata", className: U.metadata, children: [
|
932
952
|
/* @__PURE__ */ h("span", { children: [
|
933
953
|
"Source: ",
|
934
954
|
e.source_lang_name
|
@@ -940,32 +960,35 @@ const $r = function(e) {
|
|
940
960
|
e.master_branching_enabled === "1" && /* @__PURE__ */ s("div", { className: U.tag, children: e.branch_name ? e.branch_name : "master" })
|
941
961
|
] })
|
942
962
|
] })
|
943
|
-
] })
|
944
|
-
},
|
963
|
+
] });
|
964
|
+
}, k = {
|
945
965
|
TaskCompleted: "task_completed",
|
946
966
|
TaskClosed: "task_closed",
|
947
967
|
Refresh: "refresh",
|
948
968
|
ShowDialog: "show_dialog"
|
949
|
-
},
|
950
|
-
loadingContainer:
|
951
|
-
noTasksContainer:
|
952
|
-
noTasksHeading:
|
953
|
-
noTasksText:
|
954
|
-
tasksContainer:
|
955
|
-
},
|
956
|
-
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks:
|
957
|
-
return $e(() => (
|
958
|
-
|
959
|
-
|
969
|
+
}, la = "_loadingContainer_19d6m_1", da = "_noTasksContainer_19d6m_7", ua = "_noTasksHeading_19d6m_14", ma = "_noTasksText_19d6m_18", fa = "_tasksContainer_19d6m_23", F = {
|
970
|
+
loadingContainer: la,
|
971
|
+
noTasksContainer: da,
|
972
|
+
noTasksHeading: ua,
|
973
|
+
noTasksText: ma,
|
974
|
+
tasksContainer: fa
|
975
|
+
}, _a = () => {
|
976
|
+
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: a } = Y();
|
977
|
+
return $e(() => ((async () => {
|
978
|
+
const i = await a();
|
979
|
+
t == null || t({ tasks: i });
|
980
|
+
})(), document.addEventListener(k.TaskCompleted, a), document.addEventListener(k.TaskClosed, a), document.addEventListener(k.Refresh, a), () => {
|
981
|
+
document.removeEventListener(k.TaskCompleted, a), document.removeEventListener(k.TaskClosed, a), document.removeEventListener(k.Refresh, a);
|
982
|
+
})), n ? /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-loading-popover", className: F.loadingContainer, children: /* @__PURE__ */ s(on, {}) }) : e.length === 0 ? /* @__PURE__ */ h("div", { "data-testid": "sidebar-no-tasks-popover", className: F.noTasksContainer, children: [
|
960
983
|
/* @__PURE__ */ s("h3", { className: F.noTasksHeading, children: "No tasks" }),
|
961
984
|
/* @__PURE__ */ h("div", { className: F.noTasksText, children: [
|
962
985
|
"Your incoming tasks will appear here.",
|
963
986
|
/* @__PURE__ */ s("br", {}),
|
964
987
|
/* @__PURE__ */ s(L, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
|
965
988
|
] })
|
966
|
-
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((
|
967
|
-
},
|
968
|
-
const [n,
|
989
|
+
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((o) => /* @__PURE__ */ s(ca, { task: o }, o.id)) });
|
990
|
+
}, ga = ({ children: e, config: t }) => {
|
991
|
+
const [n, a] = R([]), [o, i] = R(!0), [c, d] = R(0), {
|
969
992
|
getProjectUrl: u,
|
970
993
|
onLanguageCompleteConfirm: l,
|
971
994
|
onTasksWidgetOpen: m,
|
@@ -975,19 +998,19 @@ const $r = function(e) {
|
|
975
998
|
} = t, { getTasks: f, getTasksCount: E } = t, b = async () => {
|
976
999
|
i(!0);
|
977
1000
|
const v = await f();
|
978
|
-
|
1001
|
+
return a(v), i(!1), v;
|
979
1002
|
}, g = async () => {
|
980
1003
|
const v = await E();
|
981
1004
|
d(v);
|
982
1005
|
};
|
983
|
-
$e(() => (g(), document.addEventListener(
|
984
|
-
document.removeEventListener(
|
1006
|
+
$e(() => (g(), document.addEventListener(k.TaskCompleted, g), document.addEventListener(k.TaskClosed, g), document.addEventListener(k.Refresh, g), () => {
|
1007
|
+
document.removeEventListener(k.TaskCompleted, g), document.removeEventListener(k.TaskClosed, g), document.removeEventListener(k.Refresh, g);
|
985
1008
|
}));
|
986
1009
|
const p = {
|
987
1010
|
fetchTasks: b,
|
988
1011
|
tasks: n,
|
989
1012
|
tasksCount: c,
|
990
|
-
loadingTasks:
|
1013
|
+
loadingTasks: o,
|
991
1014
|
getProjectUrl: u,
|
992
1015
|
onLanguageCompleteConfirm: l,
|
993
1016
|
onTasksWidgetOpen: m,
|
@@ -996,22 +1019,22 @@ const $r = function(e) {
|
|
996
1019
|
taskTitleOnClick: y
|
997
1020
|
};
|
998
1021
|
return /* @__PURE__ */ s(Gt.Provider, { value: p, children: e });
|
999
|
-
},
|
1000
|
-
const { config:
|
1001
|
-
return /* @__PURE__ */ s(
|
1002
|
-
},
|
1022
|
+
}, ha = (e) => function(n) {
|
1023
|
+
const { config: a, ...o } = n;
|
1024
|
+
return /* @__PURE__ */ s(ga, { config: a, children: /* @__PURE__ */ s(e, { ...o }) });
|
1025
|
+
}, pa = ha(() => {
|
1003
1026
|
const [e, t] = R(!1), { tasksCount: n } = Y();
|
1004
1027
|
return $e(() => {
|
1005
|
-
const
|
1028
|
+
const a = () => {
|
1006
1029
|
t(!0);
|
1007
1030
|
};
|
1008
|
-
return document.addEventListener(
|
1009
|
-
document.removeEventListener(
|
1031
|
+
return document.addEventListener(k.ShowDialog, a), () => {
|
1032
|
+
document.removeEventListener(k.ShowDialog, a);
|
1010
1033
|
};
|
1011
1034
|
}), /* @__PURE__ */ s(q, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ s(
|
1012
1035
|
sn,
|
1013
1036
|
{
|
1014
|
-
content: /* @__PURE__ */ s(
|
1037
|
+
content: /* @__PURE__ */ s(_a, {}),
|
1015
1038
|
placement: "right",
|
1016
1039
|
open: e,
|
1017
1040
|
onOpenChange: t,
|
@@ -1025,14 +1048,14 @@ const $r = function(e) {
|
|
1025
1048
|
}
|
1026
1049
|
})
|
1027
1050
|
],
|
1028
|
-
children: (
|
1051
|
+
children: (a) => /* @__PURE__ */ h(
|
1029
1052
|
xe,
|
1030
1053
|
{
|
1031
1054
|
type: "button",
|
1032
1055
|
"data-testid": "sidebar-tasks-widget-button",
|
1033
1056
|
"aria-label": "Tasks",
|
1034
1057
|
className: N(Re.navItem, {
|
1035
|
-
[Re.activeNavItem]:
|
1058
|
+
[Re.activeNavItem]: a
|
1036
1059
|
}),
|
1037
1060
|
children: [
|
1038
1061
|
/* @__PURE__ */ s(cn, { size: "25px" }),
|
@@ -1042,10 +1065,10 @@ const $r = function(e) {
|
|
1042
1065
|
)
|
1043
1066
|
}
|
1044
1067
|
) });
|
1045
|
-
}), I = ({ children: e, ...t }) => /* @__PURE__ */ s("nav", { ...t, className: Bn.sidebarContainer, children: e }),
|
1046
|
-
I.Top =
|
1047
|
-
const
|
1048
|
-
I.Bottom =
|
1068
|
+
}), I = ({ children: e, ...t }) => /* @__PURE__ */ s("nav", { ...t, className: Bn.sidebarContainer, children: e }), ba = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1069
|
+
I.Top = ba;
|
1070
|
+
const va = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1071
|
+
I.Bottom = va;
|
1049
1072
|
I.Avatar = Fn;
|
1050
1073
|
I.IconLink = zn;
|
1051
1074
|
I.Menu = Qn;
|
@@ -1054,23 +1077,23 @@ I.TeamSwitch = Rr;
|
|
1054
1077
|
I.TeamMenuItem = Dt;
|
1055
1078
|
I.UpgradeMenuItem = Or;
|
1056
1079
|
I.ProfileSettingsMenuItem = yr;
|
1057
|
-
I.Tasks =
|
1058
|
-
const
|
1059
|
-
breadcrumbsItem:
|
1060
|
-
breadcrumbs:
|
1061
|
-
}, $
|
1080
|
+
I.Tasks = pa;
|
1081
|
+
const Ta = "_breadcrumbsItem_1hm6a_1", ya = "_breadcrumbs_1hm6a_1", yt = {
|
1082
|
+
breadcrumbsItem: Ta,
|
1083
|
+
breadcrumbs: ya
|
1084
|
+
}, $o = ({ items: e }) => /* @__PURE__ */ s("nav", { "aria-label": "breadcrumb", className: yt.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ h(Pt, { children: [
|
1062
1085
|
/* @__PURE__ */ s(L, { className: yt.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
1063
1086
|
n < e.length - 1 && /* @__PURE__ */ s("span", { children: " — " })
|
1064
|
-
] }, `${t.link}-${t.name}`)) }),
|
1065
|
-
!!n && t.some((
|
1066
|
-
t.filter(({ visible:
|
1067
|
-
] }, t[0].label)) }),
|
1068
|
-
badge:
|
1069
|
-
tag:
|
1070
|
-
withNavLinkStyle:
|
1071
|
-
disabled:
|
1072
|
-
projectNavigationItem:
|
1073
|
-
projectNavigationItemDisabled:
|
1087
|
+
] }, `${t.link}-${t.name}`)) }), Sa = ({ items: e }) => /* @__PURE__ */ s(Ue, { children: e.map((t, n) => /* @__PURE__ */ h(Pt, { children: [
|
1088
|
+
!!n && t.some((a) => a.visible) && /* @__PURE__ */ s(At, {}),
|
1089
|
+
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: i }) => /* @__PURE__ */ s(J, { href: a || "#", "aria-label": o, onClick: i, children: o }, o))
|
1090
|
+
] }, t[0].label)) }), Ea = "_badge_1pc1v_1", wa = "_tag_1pc1v_15", Ca = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", ka = "_disabled_1pc1v_57", Pa = "_projectNavigationItem_1pc1v_61", Ia = "_projectNavigationItemDisabled_1pc1v_67", O = {
|
1091
|
+
badge: Ea,
|
1092
|
+
tag: wa,
|
1093
|
+
withNavLinkStyle: Ca,
|
1094
|
+
disabled: ka,
|
1095
|
+
projectNavigationItem: Pa,
|
1096
|
+
projectNavigationItemDisabled: Ia
|
1074
1097
|
}, St = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ h("div", { className: "flex gap-1", children: [
|
1075
1098
|
/* @__PURE__ */ h("div", { children: [
|
1076
1099
|
/* @__PURE__ */ s("span", { children: e }),
|
@@ -1078,11 +1101,11 @@ const yo = "_breadcrumbsItem_1hm6a_1", So = "_breadcrumbs_1hm6a_1", yt = {
|
|
1078
1101
|
] }),
|
1079
1102
|
!!n && /* @__PURE__ */ s(je, { className: O.tag, children: n })
|
1080
1103
|
] }), Le = tn(
|
1081
|
-
({ label: e, href: t = "", disabled: n = !1, badge:
|
1104
|
+
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: i }, c) => /* @__PURE__ */ s(q, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ s(
|
1082
1105
|
"div",
|
1083
1106
|
{
|
1084
1107
|
className: n ? O.projectNavigationItemDisabled : O.projectNavigationItem,
|
1085
|
-
children:
|
1108
|
+
children: o || n || !t ? /* @__PURE__ */ s(
|
1086
1109
|
"button",
|
1087
1110
|
{
|
1088
1111
|
type: "button",
|
@@ -1091,27 +1114,27 @@ const yo = "_breadcrumbsItem_1hm6a_1", So = "_breadcrumbs_1hm6a_1", yt = {
|
|
1091
1114
|
[O.disabled]: n
|
1092
1115
|
}),
|
1093
1116
|
disabled: n,
|
1094
|
-
onClick:
|
1095
|
-
children: /* @__PURE__ */ s(St, { label: e, badge:
|
1117
|
+
onClick: o,
|
1118
|
+
children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i })
|
1096
1119
|
}
|
1097
|
-
) : /* @__PURE__ */ s("a", { href: t, className: O.withNavLinkStyle, children: /* @__PURE__ */ s(St, { label: e, badge:
|
1120
|
+
) : /* @__PURE__ */ s("a", { href: t, className: O.withNavLinkStyle, children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i }) })
|
1098
1121
|
}
|
1099
1122
|
) })
|
1100
1123
|
);
|
1101
1124
|
Le.displayName = "NavigationTabsItem";
|
1102
|
-
const
|
1103
|
-
var
|
1125
|
+
const Aa = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, Ra = (e) => e.visible && (!e.dropdown || Aa(e.dropdown)), Fo = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ s("nav", { "aria-label": "Project", children: /* @__PURE__ */ s("ul", { className: H.navigationTabList, "aria-orientation": "horizontal", children: e.filter(Ra).map((n) => {
|
1126
|
+
var a, o, i;
|
1104
1127
|
return n.dropdown ? /* @__PURE__ */ s(
|
1105
1128
|
"li",
|
1106
1129
|
{
|
1107
1130
|
className: H.navigationTab,
|
1108
1131
|
"data-testid": n.key,
|
1109
|
-
"aria-selected": (
|
1132
|
+
"aria-selected": (a = n.isActive) == null ? void 0 : a.call(n, t),
|
1110
1133
|
children: /* @__PURE__ */ s(
|
1111
1134
|
ce,
|
1112
1135
|
{
|
1113
1136
|
menuButton: ({ opened: c }) => /* @__PURE__ */ s(Le, { label: n.label, disabled: n.disabled, active: c }),
|
1114
|
-
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(
|
1137
|
+
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(Sa, { items: n.dropdown }) })
|
1115
1138
|
}
|
1116
1139
|
)
|
1117
1140
|
},
|
@@ -1121,7 +1144,7 @@ const Ro = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
1121
1144
|
{
|
1122
1145
|
className: H.navigationTab,
|
1123
1146
|
"data-testid": n.key,
|
1124
|
-
"aria-selected": (
|
1147
|
+
"aria-selected": (o = n.isActive) == null ? void 0 : o.call(n, t),
|
1125
1148
|
children: /* @__PURE__ */ s(
|
1126
1149
|
Le,
|
1127
1150
|
{
|
@@ -1274,21 +1297,21 @@ class A {
|
|
1274
1297
|
* console.log(headers) // { 'Content-Type': 'application/json' }
|
1275
1298
|
*/
|
1276
1299
|
async resolve() {
|
1277
|
-
const t = this.factories.map((
|
1300
|
+
const t = this.factories.map((a) => a()), n = await Promise.all(t);
|
1278
1301
|
return Object.assign({}, ...n);
|
1279
1302
|
}
|
1280
1303
|
}
|
1281
1304
|
function Kt(e) {
|
1282
|
-
return new
|
1305
|
+
return new Na(e);
|
1283
1306
|
}
|
1284
|
-
class
|
1307
|
+
class Na {
|
1285
1308
|
constructor(t) {
|
1286
1309
|
this.middleware = t;
|
1287
1310
|
}
|
1288
1311
|
apply(t) {
|
1289
1312
|
return t.from(async () => {
|
1290
1313
|
const n = this.middleware(A.create());
|
1291
|
-
return n instanceof Promise ? n.then((
|
1314
|
+
return n instanceof Promise ? n.then((a) => a.resolve()) : n.resolve();
|
1292
1315
|
});
|
1293
1316
|
}
|
1294
1317
|
}
|
@@ -1297,7 +1320,7 @@ const zt = r.union([
|
|
1297
1320
|
r.literal("admin"),
|
1298
1321
|
r.literal("biller"),
|
1299
1322
|
r.literal("member")
|
1300
|
-
]),
|
1323
|
+
]), ja = r.object({
|
1301
1324
|
userId: r.number(),
|
1302
1325
|
userUuid: r.string(),
|
1303
1326
|
teamId: r.number(),
|
@@ -1314,7 +1337,7 @@ const zt = r.union([
|
|
1314
1337
|
function V(e) {
|
1315
1338
|
try {
|
1316
1339
|
const t = e.split(".")[1], n = atob(t);
|
1317
|
-
return
|
1340
|
+
return ja.parse(JSON.parse(n));
|
1318
1341
|
} catch {
|
1319
1342
|
return;
|
1320
1343
|
}
|
@@ -1326,36 +1349,36 @@ class se extends Error {
|
|
1326
1349
|
ne(this, "status", 401);
|
1327
1350
|
}
|
1328
1351
|
}
|
1329
|
-
function
|
1352
|
+
function Go(e) {
|
1330
1353
|
return Kt(async (t) => {
|
1331
1354
|
var i, c;
|
1332
1355
|
const n = e.getCurrentToken() ?? await ((i = e.generateNewToken) == null ? void 0 : i.call(e));
|
1333
1356
|
if (!n)
|
1334
1357
|
throw new se();
|
1335
|
-
const { exp:
|
1336
|
-
if (!dn(new Date(
|
1358
|
+
const { exp: a } = V(n.accessToken) ?? { exp: 0 };
|
1359
|
+
if (!dn(new Date(a)))
|
1337
1360
|
return t.add("authorization", `Bearer ${n.accessToken}`);
|
1338
|
-
const
|
1339
|
-
if (!
|
1361
|
+
const o = await e.refreshToken(n);
|
1362
|
+
if (!o)
|
1340
1363
|
throw new se();
|
1341
|
-
return (c = e.onNewTokenIssued) == null || c.call(e,
|
1364
|
+
return (c = e.onNewTokenIssued) == null || c.call(e, o), t.add("authorization", `Bearer ${o.accessToken}`);
|
1342
1365
|
});
|
1343
1366
|
}
|
1344
|
-
const
|
1367
|
+
const Ko = Kt(
|
1345
1368
|
(e) => e.and({ "x-lokalise-plugin": "true" })
|
1346
1369
|
);
|
1347
1370
|
function Jt() {
|
1348
1371
|
const e = Me(document.cookie, "accessToken"), t = Me(document.cookie, "refreshToken");
|
1349
1372
|
return !e || !t ? null : { accessToken: e, refreshToken: t };
|
1350
1373
|
}
|
1351
|
-
function
|
1374
|
+
function xa() {
|
1352
1375
|
return Me(document.cookie, "csrf_token") ?? null;
|
1353
1376
|
}
|
1354
1377
|
function Me(e, t) {
|
1355
|
-
var n,
|
1356
|
-
return (
|
1378
|
+
var n, a;
|
1379
|
+
return (a = (n = e.split(";").find((o) => o.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : a.substring(t.length + 1);
|
1357
1380
|
}
|
1358
|
-
function
|
1381
|
+
function zo() {
|
1359
1382
|
const e = Jt();
|
1360
1383
|
if (!e)
|
1361
1384
|
return;
|
@@ -1366,68 +1389,68 @@ function za() {
|
|
1366
1389
|
const Wt = r.union([
|
1367
1390
|
r.object({ authorization: r.string() }),
|
1368
1391
|
r.object({ AUTHORIZATION: r.string() })
|
1369
|
-
]),
|
1392
|
+
]), Oa = r.union([
|
1370
1393
|
r.object({ "X-API-Token": r.string() }),
|
1371
1394
|
r.object({ "X-Api-Token": r.string() }),
|
1372
1395
|
r.object({ "x-api-token": r.string() }),
|
1373
1396
|
r.object({ "X-API-TOKEN": r.string() })
|
1374
|
-
]),
|
1397
|
+
]), La = r.union([
|
1375
1398
|
Wt,
|
1376
|
-
|
1377
|
-
]),
|
1399
|
+
Oa
|
1400
|
+
]), Ma = r.union([
|
1378
1401
|
r.object({ "X-Lokalise-Plugin": r.string() }),
|
1379
1402
|
r.object({ "x-lokalise-plugin": r.string() }),
|
1380
1403
|
r.object({ "X-LOKALISE-PLUGIN": r.string() })
|
1381
|
-
]), Z =
|
1404
|
+
]), Z = La.and(Ma), Ua = r.object({
|
1382
1405
|
accessToken: r.string(),
|
1383
1406
|
refreshToken: r.string()
|
1384
|
-
}),
|
1407
|
+
}), Ha = r.union([
|
1385
1408
|
r.object({ "X-Csrf-Token": r.string() }),
|
1386
1409
|
r.object({ "X-CSRF-Token": r.string() }),
|
1387
1410
|
r.object({ "x-csrf-token": r.string() }),
|
1388
1411
|
r.object({ "X-CSRF-TOKEN": r.string() })
|
1389
|
-
]),
|
1412
|
+
]), qa = r.union([
|
1390
1413
|
Wt,
|
1391
|
-
|
1414
|
+
Ha
|
1392
1415
|
]), Fe = He({
|
1393
1416
|
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
1394
1417
|
method: "post",
|
1395
1418
|
requestPathParamsSchema: r.object({ teamId: r.number() }),
|
1396
1419
|
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
1397
|
-
requestHeaderSchema:
|
1420
|
+
requestHeaderSchema: qa,
|
1398
1421
|
requestBodySchema: r.undefined(),
|
1399
1422
|
isEmptyResponseExpected: !0,
|
1400
|
-
successResponseBodySchema:
|
1423
|
+
successResponseBodySchema: Ua
|
1401
1424
|
});
|
1402
|
-
function
|
1425
|
+
function Jo(e, t, n) {
|
1403
1426
|
return async () => {
|
1404
|
-
const
|
1405
|
-
if (!
|
1427
|
+
const a = t();
|
1428
|
+
if (!a)
|
1406
1429
|
throw new se();
|
1407
1430
|
return B(e, Fe, {
|
1408
1431
|
pathParams: { teamId: Number(await n()) },
|
1409
|
-
headers: await A.create().add("x-csrf-token",
|
1432
|
+
headers: await A.create().add("x-csrf-token", a).resolve()
|
1410
1433
|
});
|
1411
1434
|
};
|
1412
1435
|
}
|
1413
|
-
function
|
1436
|
+
function Wo(e) {
|
1414
1437
|
return async ({ accessToken: t, refreshToken: n }) => {
|
1415
|
-
const
|
1416
|
-
if (!
|
1438
|
+
const a = V(t);
|
1439
|
+
if (!a)
|
1417
1440
|
throw new se();
|
1418
1441
|
return B(e, Fe, {
|
1419
|
-
pathParams: { teamId:
|
1442
|
+
pathParams: { teamId: a.teamId },
|
1420
1443
|
headers: await A.create().add("authorization", `Bearer ${n}`).resolve()
|
1421
1444
|
});
|
1422
1445
|
};
|
1423
1446
|
}
|
1424
|
-
const
|
1447
|
+
const Ba = {
|
1425
1448
|
teamKey: (e) => ["getUserToken", e]
|
1426
|
-
},
|
1449
|
+
}, Da = (e, t, n) => D({
|
1427
1450
|
...n,
|
1428
|
-
queryFn: async ({ queryKey: [
|
1451
|
+
queryFn: async ({ queryKey: [a, o] }) => B(e, Fe, {
|
1429
1452
|
headers: await t.resolve(),
|
1430
|
-
pathParams: { teamId:
|
1453
|
+
pathParams: { teamId: o }
|
1431
1454
|
})
|
1432
1455
|
}), ie = class ie extends CustomEvent {
|
1433
1456
|
constructor(t) {
|
@@ -1438,148 +1461,148 @@ const Do = {
|
|
1438
1461
|
};
|
1439
1462
|
ne(ie, "eventName", "new-jwt-issued");
|
1440
1463
|
let K = ie;
|
1441
|
-
function
|
1442
|
-
const
|
1443
|
-
queryKey:
|
1444
|
-
enabled:
|
1464
|
+
function Qo(e, t, n) {
|
1465
|
+
const a = xa(), o = Da(e, t.add("x-csrf-token", a ?? ""), {
|
1466
|
+
queryKey: Ba.teamKey(n),
|
1467
|
+
enabled: a !== void 0
|
1445
1468
|
}), i = wt();
|
1446
1469
|
return z(() => {
|
1447
|
-
|
1448
|
-
}, [
|
1470
|
+
o.data && o.data.accessToken !== i.current && (window.dispatchEvent(new K(o.data)), i.current = o.data.accessToken);
|
1471
|
+
}, [o.data]), o;
|
1449
1472
|
}
|
1450
1473
|
function Qt() {
|
1451
1474
|
const [e, t] = R();
|
1452
1475
|
return z(() => {
|
1453
|
-
const n = (
|
1454
|
-
t(
|
1455
|
-
},
|
1456
|
-
return t(
|
1476
|
+
const n = (o) => {
|
1477
|
+
t(o.detail.payload);
|
1478
|
+
}, a = Jt();
|
1479
|
+
return t(a ? V(a.accessToken) : void 0), window.addEventListener(K.eventName, n), () => {
|
1457
1480
|
window.removeEventListener(K.eventName, n);
|
1458
1481
|
};
|
1459
1482
|
}, []), e;
|
1460
1483
|
}
|
1461
|
-
const
|
1484
|
+
const $a = Z, Fa = r.object({
|
1462
1485
|
user_id: r.number(),
|
1463
1486
|
email: r.string().email(),
|
1464
1487
|
fullname: r.string(),
|
1465
1488
|
created_at: r.string(),
|
1466
1489
|
created_at_timestamp: r.number(),
|
1467
1490
|
role: zt
|
1468
|
-
}),
|
1491
|
+
}), Ga = r.object({
|
1469
1492
|
team_id: r.number(),
|
1470
|
-
team_user:
|
1471
|
-
}),
|
1493
|
+
team_user: Fa
|
1494
|
+
}), Ka = Q({
|
1472
1495
|
description: "Get the details of a team user",
|
1473
|
-
requestHeaderSchema:
|
1496
|
+
requestHeaderSchema: $a,
|
1474
1497
|
requestPathParamsSchema: r.object({ teamId: r.number(), userId: r.number() }),
|
1475
1498
|
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
1476
|
-
successResponseBodySchema:
|
1477
|
-
}),
|
1499
|
+
successResponseBodySchema: Ga
|
1500
|
+
}), za = {
|
1478
1501
|
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
1479
|
-
},
|
1502
|
+
}, Ja = (e, t, n) => D({
|
1480
1503
|
...n,
|
1481
|
-
queryFn: async ({ queryKey: [
|
1504
|
+
queryFn: async ({ queryKey: [a, o, i] }) => W(e, Ka, {
|
1482
1505
|
headers: await t.resolve(),
|
1483
|
-
pathParams: { teamId:
|
1506
|
+
pathParams: { teamId: o, userId: i }
|
1484
1507
|
})
|
1485
1508
|
});
|
1486
|
-
function
|
1509
|
+
function Xo(e, t) {
|
1487
1510
|
const n = Qt();
|
1488
|
-
return
|
1489
|
-
queryKey:
|
1511
|
+
return Ja(e, t, {
|
1512
|
+
queryKey: za.teamUserKey((n == null ? void 0 : n.teamId) ?? 0, (n == null ? void 0 : n.userId) ?? 0),
|
1490
1513
|
enabled: (n == null ? void 0 : n.userId) !== void 0 && n.teamId !== void 0
|
1491
1514
|
});
|
1492
1515
|
}
|
1493
|
-
const
|
1516
|
+
const Wa = r.object({
|
1494
1517
|
lang_id: r.number(),
|
1495
1518
|
lang_iso: r.string(),
|
1496
1519
|
lang_name: r.string(),
|
1497
1520
|
is_writable: r.union([r.literal(0), r.literal(1)])
|
1498
|
-
}),
|
1521
|
+
}), Qa = r.object({
|
1499
1522
|
user_id: r.number(),
|
1500
1523
|
email: r.string().email(),
|
1501
1524
|
fullname: r.string(),
|
1502
1525
|
created_at: r.string(),
|
1503
1526
|
created_at_timestamp: r.number(),
|
1504
1527
|
admin_rights: r.array(r.string()),
|
1505
|
-
languages: r.array(
|
1528
|
+
languages: r.array(Wa),
|
1506
1529
|
is_admin: r.boolean(),
|
1507
1530
|
is_reviewer: r.boolean()
|
1508
|
-
}),
|
1531
|
+
}), Xa = r.object({
|
1509
1532
|
project_id: r.string(),
|
1510
|
-
contributors: r.array(
|
1511
|
-
}),
|
1533
|
+
contributors: r.array(Qa)
|
1534
|
+
}), Ya = Q({
|
1512
1535
|
description: "Get the details of a project contributor",
|
1513
1536
|
requestHeaderSchema: Z,
|
1514
1537
|
requestPathParamsSchema: r.object({ projectId: r.string(), contributorId: r.number() }),
|
1515
1538
|
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
1516
|
-
successResponseBodySchema:
|
1517
|
-
}),
|
1539
|
+
successResponseBodySchema: Xa
|
1540
|
+
}), Va = {
|
1518
1541
|
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
1519
|
-
},
|
1542
|
+
}, Za = (e, t, n) => D({
|
1520
1543
|
...n,
|
1521
|
-
queryFn: async ({ queryKey: [
|
1522
|
-
pathParams: { projectId:
|
1544
|
+
queryFn: async ({ queryKey: [a, o, i] }) => W(e, Ya, {
|
1545
|
+
pathParams: { projectId: o, contributorId: i },
|
1523
1546
|
headers: await t.resolve()
|
1524
1547
|
})
|
1525
1548
|
});
|
1526
|
-
function
|
1527
|
-
const
|
1528
|
-
return
|
1529
|
-
queryKey:
|
1530
|
-
enabled:
|
1549
|
+
function Yo(e, t, n) {
|
1550
|
+
const a = Qt();
|
1551
|
+
return Za(e, t, {
|
1552
|
+
queryKey: Va.projectUserKey(n, (a == null ? void 0 : a.userId) ?? 0),
|
1553
|
+
enabled: a !== void 0
|
1531
1554
|
});
|
1532
1555
|
}
|
1533
|
-
const
|
1556
|
+
const eo = r.object({
|
1534
1557
|
lang_iso: r.string(),
|
1535
1558
|
custom_iso: r.string().optional()
|
1536
|
-
}),
|
1559
|
+
}), to = r.object({
|
1537
1560
|
language_id: r.number(),
|
1538
1561
|
language_iso: r.string(),
|
1539
1562
|
progress: r.number(),
|
1540
1563
|
words_to_do: r.number()
|
1541
|
-
}),
|
1564
|
+
}), no = r.object({
|
1542
1565
|
projectId: r.string()
|
1543
|
-
}),
|
1566
|
+
}), ro = r.object({
|
1544
1567
|
lang_id: r.number(),
|
1545
1568
|
lang_iso: r.string(),
|
1546
1569
|
lang_name: r.string(),
|
1547
1570
|
is_rtl: r.boolean(),
|
1548
1571
|
plural_forms: r.array(r.string().optional())
|
1549
|
-
}),
|
1572
|
+
}), ao = r.object({
|
1550
1573
|
project_id: r.string(),
|
1551
1574
|
project_uuid: r.string().uuid(),
|
1552
|
-
languages: r.array(
|
1553
|
-
}),
|
1575
|
+
languages: r.array(ro)
|
1576
|
+
}), oo = r.object({
|
1554
1577
|
projectId: r.string()
|
1555
|
-
}),
|
1578
|
+
}), so = r.object({
|
1556
1579
|
langs: r.array(
|
1557
1580
|
r.object({
|
1558
1581
|
lang_iso: r.string(),
|
1559
1582
|
base_lang: r.boolean()
|
1560
1583
|
})
|
1561
1584
|
)
|
1562
|
-
}),
|
1585
|
+
}), io = r.object({
|
1563
1586
|
success: r.boolean()
|
1564
|
-
}),
|
1587
|
+
}), co = Q({
|
1565
1588
|
description: "List of project languages",
|
1566
1589
|
requestHeaderSchema: Z,
|
1567
|
-
requestPathParamsSchema:
|
1590
|
+
requestPathParamsSchema: no,
|
1568
1591
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
1569
|
-
successResponseBodySchema:
|
1570
|
-
}),
|
1592
|
+
successResponseBodySchema: ao
|
1593
|
+
}), lo = mn({
|
1571
1594
|
description: "Bulk update project languages",
|
1572
1595
|
requestHeaderSchema: Z,
|
1573
1596
|
method: "put",
|
1574
|
-
requestPathParamsSchema:
|
1597
|
+
requestPathParamsSchema: oo,
|
1575
1598
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages/bulk-update`,
|
1576
|
-
requestBodySchema:
|
1577
|
-
successResponseBodySchema:
|
1599
|
+
requestBodySchema: so,
|
1600
|
+
successResponseBodySchema: io
|
1578
1601
|
}), de = Z, Ge = r.union([
|
1579
1602
|
r.literal("localization_files"),
|
1580
1603
|
r.literal("paged_documents"),
|
1581
1604
|
r.literal("marketing")
|
1582
|
-
]),
|
1605
|
+
]), uo = r.object({
|
1583
1606
|
per_platform_key_names: r.boolean(),
|
1584
1607
|
reviewing: r.boolean(),
|
1585
1608
|
auto_toggle_unverified: r.boolean(),
|
@@ -1590,7 +1613,7 @@ const ta = r.object({
|
|
1590
1613
|
custom_translation_statuses_allow_multiple: r.boolean(),
|
1591
1614
|
segmentation: r.boolean(),
|
1592
1615
|
contributor_preview_download_enabled: r.boolean()
|
1593
|
-
}),
|
1616
|
+
}), mo = r.object({
|
1594
1617
|
not_reviewed: r.number(),
|
1595
1618
|
unverified: r.number(),
|
1596
1619
|
spelling_grammar: r.number(),
|
@@ -1607,14 +1630,14 @@ const ta = r.object({
|
|
1607
1630
|
double_space: r.number(),
|
1608
1631
|
special_placeholder: r.number(),
|
1609
1632
|
unbalanced_brackets: r.number()
|
1610
|
-
}),
|
1633
|
+
}), fo = r.object({
|
1611
1634
|
progress_total: r.number(),
|
1612
1635
|
keys_total: r.number(),
|
1613
1636
|
team: r.number(),
|
1614
1637
|
base_words: r.number(),
|
1615
1638
|
qa_issues_total: r.number(),
|
1616
|
-
qa_issues:
|
1617
|
-
languages: r.array(
|
1639
|
+
qa_issues: mo,
|
1640
|
+
languages: r.array(to)
|
1618
1641
|
}), ue = r.object({
|
1619
1642
|
project_id: r.string(),
|
1620
1643
|
uuid: r.string().uuid(),
|
@@ -1628,16 +1651,16 @@ const ta = r.object({
|
|
1628
1651
|
team_id: r.number(),
|
1629
1652
|
base_language_id: r.number(),
|
1630
1653
|
base_language_iso: r.string(),
|
1631
|
-
settings:
|
1632
|
-
statistics:
|
1633
|
-
}),
|
1654
|
+
settings: uo.optional(),
|
1655
|
+
statistics: fo.optional()
|
1656
|
+
}), _o = r.object({
|
1634
1657
|
name: r.string(),
|
1635
1658
|
team_id: r.string(),
|
1636
1659
|
base_lang_iso: r.string(),
|
1637
|
-
languages: r.array(
|
1660
|
+
languages: r.array(eo),
|
1638
1661
|
project_type: Ge,
|
1639
1662
|
is_segmentation_enabled: r.boolean()
|
1640
|
-
}), Et = r.union([r.literal(0), r.literal(1)]),
|
1663
|
+
}), Et = r.union([r.literal(0), r.literal(1)]), go = r.object({
|
1641
1664
|
filter_type: Ge.optional(),
|
1642
1665
|
filter_team_id: r.number().optional(),
|
1643
1666
|
filter_names: r.string().optional(),
|
@@ -1645,61 +1668,61 @@ const ta = r.object({
|
|
1645
1668
|
include_settings: Et.optional(),
|
1646
1669
|
limit: r.number().optional(),
|
1647
1670
|
page: r.number().optional()
|
1648
|
-
}),
|
1671
|
+
}), ho = r.object({
|
1649
1672
|
projects: r.array(ue)
|
1650
|
-
}),
|
1673
|
+
}), po = r.object({
|
1651
1674
|
project_id: r.string()
|
1652
|
-
}),
|
1675
|
+
}), bo = r.object({
|
1653
1676
|
project_id: r.string()
|
1654
|
-
}),
|
1677
|
+
}), vo = r.object({
|
1655
1678
|
name: r.string().min(1),
|
1656
1679
|
description: r.string().optional()
|
1657
|
-
}), me = () => "/projects",
|
1680
|
+
}), me = () => "/projects", To = He({
|
1658
1681
|
description: "Create a new project",
|
1659
1682
|
requestHeaderSchema: de,
|
1660
1683
|
method: "post",
|
1661
1684
|
pathResolver: me,
|
1662
|
-
requestBodySchema:
|
1685
|
+
requestBodySchema: _o,
|
1663
1686
|
successResponseBodySchema: ue
|
1664
|
-
}),
|
1687
|
+
}), yo = Q({
|
1665
1688
|
description: "List all projects",
|
1666
1689
|
requestHeaderSchema: de,
|
1667
1690
|
pathResolver: me,
|
1668
|
-
requestQuerySchema:
|
1669
|
-
successResponseBodySchema:
|
1670
|
-
}),
|
1691
|
+
requestQuerySchema: go,
|
1692
|
+
successResponseBodySchema: ho
|
1693
|
+
}), So = Q({
|
1671
1694
|
description: "Retrieve a project",
|
1672
1695
|
requestHeaderSchema: de,
|
1673
|
-
requestPathParamsSchema:
|
1696
|
+
requestPathParamsSchema: po,
|
1674
1697
|
pathResolver: ({ project_id: e }) => `${me()}/${e}`,
|
1675
1698
|
successResponseBodySchema: ue
|
1676
|
-
}),
|
1699
|
+
}), Eo = He({
|
1677
1700
|
description: "Update a project",
|
1678
1701
|
requestHeaderSchema: de,
|
1679
1702
|
method: "put",
|
1680
|
-
requestPathParamsSchema:
|
1703
|
+
requestPathParamsSchema: bo,
|
1681
1704
|
pathResolver: ({ project_id: e }) => `${me()}/${e}`,
|
1682
|
-
requestBodySchema:
|
1705
|
+
requestBodySchema: vo,
|
1683
1706
|
successResponseBodySchema: ue
|
1684
1707
|
});
|
1685
|
-
function
|
1708
|
+
function Vo(e, t, n = {}) {
|
1686
1709
|
return qe({
|
1687
1710
|
...n,
|
1688
|
-
mutationFn: async (
|
1711
|
+
mutationFn: async (a) => B(e, To, {
|
1689
1712
|
headers: await t.resolve(),
|
1690
|
-
body:
|
1713
|
+
body: a
|
1691
1714
|
})
|
1692
1715
|
});
|
1693
1716
|
}
|
1694
|
-
const
|
1717
|
+
const Zo = {
|
1695
1718
|
projectIdKey: (e) => ["listProjectLanguages", e]
|
1696
1719
|
};
|
1697
1720
|
function es(e, t, n) {
|
1698
1721
|
return D({
|
1699
1722
|
...n,
|
1700
|
-
queryFn: async ({ queryKey: [
|
1723
|
+
queryFn: async ({ queryKey: [a, o] }) => W(e, co, {
|
1701
1724
|
headers: await t.resolve(),
|
1702
|
-
pathParams: { projectId:
|
1725
|
+
pathParams: { projectId: o }
|
1703
1726
|
})
|
1704
1727
|
});
|
1705
1728
|
}
|
@@ -1709,109 +1732,109 @@ const ts = {
|
|
1709
1732
|
function ns(e, t, n) {
|
1710
1733
|
return D({
|
1711
1734
|
...n,
|
1712
|
-
queryFn: async ({ queryKey: [
|
1735
|
+
queryFn: async ({ queryKey: [a, o] }) => W(e, yo, {
|
1713
1736
|
headers: await t.resolve(),
|
1714
|
-
queryParams:
|
1737
|
+
queryParams: o
|
1715
1738
|
})
|
1716
1739
|
});
|
1717
1740
|
}
|
1718
1741
|
const rs = {
|
1719
1742
|
projectIdKey: (e) => ["retrieveProject", e]
|
1720
1743
|
};
|
1721
|
-
function
|
1744
|
+
function as(e, t, n) {
|
1722
1745
|
return D({
|
1723
1746
|
...n,
|
1724
|
-
queryFn: async ({ queryKey: [
|
1747
|
+
queryFn: async ({ queryKey: [a, o] }) => W(e, So, {
|
1725
1748
|
headers: await t.resolve(),
|
1726
|
-
pathParams: { project_id:
|
1749
|
+
pathParams: { project_id: o }
|
1727
1750
|
})
|
1728
1751
|
});
|
1729
1752
|
}
|
1730
|
-
function
|
1753
|
+
function os(e, t, n, a = {}) {
|
1731
1754
|
return qe({
|
1732
|
-
...
|
1733
|
-
mutationFn: async (
|
1755
|
+
...a,
|
1756
|
+
mutationFn: async (o) => B(e, Eo, {
|
1734
1757
|
headers: await t.resolve(),
|
1735
|
-
body:
|
1758
|
+
body: o,
|
1736
1759
|
pathParams: n
|
1737
1760
|
})
|
1738
1761
|
});
|
1739
1762
|
}
|
1740
|
-
function ss(e, t, n,
|
1763
|
+
function ss(e, t, n, a = {}) {
|
1741
1764
|
return qe({
|
1742
|
-
...
|
1743
|
-
mutationFn: async (
|
1765
|
+
...a,
|
1766
|
+
mutationFn: async (o) => B(e, lo, {
|
1744
1767
|
pathParams: t,
|
1745
1768
|
headers: await n.resolve(),
|
1746
|
-
body:
|
1769
|
+
body: o
|
1747
1770
|
})
|
1748
1771
|
});
|
1749
1772
|
}
|
1750
1773
|
export {
|
1751
|
-
$
|
1774
|
+
$o as Breadcrumbs,
|
1752
1775
|
qt as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1753
1776
|
lr as ENTERPRISE_PLAN_IDS,
|
1754
1777
|
ir as ESSENTIAL_PLAN_IDS,
|
1755
1778
|
Ht as FREE_PLAN_ID,
|
1756
1779
|
A as HeaderBuilder,
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1780
|
+
Go as JwtAuthHeaderBuilderMiddleware,
|
1781
|
+
oe as NavigationPanel,
|
1782
|
+
Fo as NavigationTabs,
|
1760
1783
|
cr as PRO_PLAN_IDS,
|
1761
|
-
|
1784
|
+
Ko as PublicApiHeaderBuilderMiddleware,
|
1762
1785
|
sr as START_PLAN_IDS,
|
1763
1786
|
I as Sidebar,
|
1764
|
-
|
1787
|
+
P as SidebarTaskLanguageStatuses,
|
1765
1788
|
Oe as SidebarTaskStatuses,
|
1766
1789
|
re as SidebarTaskTypeOptions,
|
1767
|
-
|
1790
|
+
or as TRIAL_PLAN_ID,
|
1768
1791
|
se as UnauthorizedError,
|
1769
|
-
|
1792
|
+
lo as bulkUpdateProjectLanguages,
|
1770
1793
|
mr as convertNewLineToBreakTag,
|
1771
1794
|
Kt as createHeaderBuilderMiddleware,
|
1772
|
-
|
1795
|
+
To as createProject,
|
1773
1796
|
hr as formatDate,
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1797
|
+
Do as formatDateTz,
|
1798
|
+
Jo as generateTokenFromClassicSession,
|
1799
|
+
zo as getAuthenticatedSessionDetailFromRequest,
|
1800
|
+
xa as getCsrfTokenFromCookie,
|
1778
1801
|
Jt as getJwtTokenFromCookie,
|
1779
|
-
|
1780
|
-
|
1802
|
+
Ka as getTeamUser,
|
1803
|
+
za as getTeamUsersQueryKey,
|
1781
1804
|
Fe as getUserToken,
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1805
|
+
Ba as getUserTokenKey,
|
1806
|
+
Bo as isEnterpriseOpenSourcePlan,
|
1807
|
+
Ho as isEnterprisePlan,
|
1808
|
+
Mo as isEssentialPlan,
|
1786
1809
|
De as isFreePlan,
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1810
|
+
qo as isPaidPlan,
|
1811
|
+
Uo as isProPlan,
|
1812
|
+
Lo as isStartPlan,
|
1790
1813
|
Bt as isTrialPlan,
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1814
|
+
co as listProjectLanguages,
|
1815
|
+
Zo as listProjectLanguagesKey,
|
1816
|
+
yo as listProjects,
|
1794
1817
|
ts as listProjectsKey,
|
1795
1818
|
gr as makeUrlClickable,
|
1796
1819
|
V as parseJwtTokenPayload,
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1820
|
+
Wo as refreshExpiredToken,
|
1821
|
+
Ya as retrieveContributor,
|
1822
|
+
Va as retrieveContributorKeys,
|
1823
|
+
So as retrieveProject,
|
1801
1824
|
rs as retrieveProjectQueryKey,
|
1802
|
-
|
1803
|
-
|
1825
|
+
Eo as updateProject,
|
1826
|
+
Yo as useAuthenticatedProjectContributor,
|
1804
1827
|
Qt as useAuthenticatedSessionPayload,
|
1805
|
-
|
1828
|
+
Xo as useAuthenticatedUser,
|
1806
1829
|
ss as useBulkUpdateProjectLanguagesMutation,
|
1807
|
-
|
1830
|
+
Vo as useCreateProjectMutation,
|
1808
1831
|
$e as useEffectOnce,
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1832
|
+
Qo as useGetPromotedClassicSessionJwtQuery,
|
1833
|
+
Ja as useGetTeamUsersQuery,
|
1834
|
+
Da as useGetUserTokenQuery,
|
1812
1835
|
es as useListProjectLanguagesQuery,
|
1813
1836
|
ns as useListProjectsQuery,
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1837
|
+
Za as useRetrieveContributorQuery,
|
1838
|
+
as as useRetrieveProjectQuery,
|
1839
|
+
os as useUpdateProjectMutation
|
1817
1840
|
};
|