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