@laboratoria/sdk-js 7.2.2 → 7.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/laboratoria-sdk-es.js +90 -77
- package/dist/laboratoria-sdk-umd.js +18 -18
- package/package.json +3 -3
@@ -117,8 +117,8 @@ const Wt = function(n) {
|
|
117
117
|
const t = e ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, r = [];
|
118
118
|
for (let i = 0; i < n.length; i += 3) {
|
119
119
|
const s = n[i], o = i + 1 < n.length, c = o ? n[i + 1] : 0, a = i + 2 < n.length, u = a ? n[i + 2] : 0, y = s >> 2, b = (s & 3) << 4 | c >> 4;
|
120
|
-
let
|
121
|
-
a || (O = 64, o || (
|
120
|
+
let S = (c & 15) << 2 | u >> 6, O = u & 63;
|
121
|
+
a || (O = 64, o || (S = 64)), r.push(t[y], t[b], t[S], t[O]);
|
122
122
|
}
|
123
123
|
return r.join("");
|
124
124
|
},
|
@@ -170,8 +170,8 @@ const Wt = function(n) {
|
|
170
170
|
const b = i < n.length ? t[n.charAt(i)] : 64;
|
171
171
|
if (++i, s == null || c == null || u == null || b == null)
|
172
172
|
throw new Mn();
|
173
|
-
const
|
174
|
-
if (r.push(
|
173
|
+
const S = s << 2 | c >> 4;
|
174
|
+
if (r.push(S), u !== 64) {
|
175
175
|
const O = c << 4 & 240 | u >> 2;
|
176
176
|
if (r.push(O), b !== 64) {
|
177
177
|
const N = u << 6 & 192 | b;
|
@@ -1162,7 +1162,7 @@ const Qe = "@firebase/app", bt = "0.9.27";
|
|
1162
1162
|
* See the License for the specific language governing permissions and
|
1163
1163
|
* limitations under the License.
|
1164
1164
|
*/
|
1165
|
-
const ee = new Yt("@firebase/app"), Tr = "@firebase/app-compat",
|
1165
|
+
const ee = new Yt("@firebase/app"), Tr = "@firebase/app-compat", Ar = "@firebase/analytics-compat", Sr = "@firebase/analytics", Cr = "@firebase/app-check-compat", Rr = "@firebase/app-check", Pr = "@firebase/auth", Or = "@firebase/auth-compat", kr = "@firebase/database", Nr = "@firebase/database-compat", Dr = "@firebase/functions", Lr = "@firebase/functions-compat", $r = "@firebase/installations", Mr = "@firebase/installations-compat", Ur = "@firebase/messaging", jr = "@firebase/messaging-compat", Br = "@firebase/performance", Fr = "@firebase/performance-compat", Vr = "@firebase/remote-config", Hr = "@firebase/remote-config-compat", xr = "@firebase/storage", Wr = "@firebase/storage-compat", zr = "@firebase/firestore", qr = "@firebase/firestore-compat", Jr = "firebase", Gr = "10.8.0";
|
1166
1166
|
/**
|
1167
1167
|
* @license
|
1168
1168
|
* Copyright 2019 Google LLC
|
@@ -1182,8 +1182,8 @@ const ee = new Yt("@firebase/app"), Tr = "@firebase/app-compat", Sr = "@firebase
|
|
1182
1182
|
const Xe = "[DEFAULT]", Kr = {
|
1183
1183
|
[Qe]: "fire-core",
|
1184
1184
|
[Tr]: "fire-core-compat",
|
1185
|
-
[
|
1186
|
-
[
|
1185
|
+
[Sr]: "fire-analytics",
|
1186
|
+
[Ar]: "fire-analytics-compat",
|
1187
1187
|
[Rr]: "fire-app-check",
|
1188
1188
|
[Cr]: "fire-app-check-compat",
|
1189
1189
|
[Pr]: "fire-auth",
|
@@ -1684,7 +1684,7 @@ const ke = new Yt("@firebase/auth");
|
|
1684
1684
|
function hi(n, ...e) {
|
1685
1685
|
ke.logLevel <= T.WARN && ke.warn(`Auth (${be}): ${n}`, ...e);
|
1686
1686
|
}
|
1687
|
-
function
|
1687
|
+
function Ae(n, ...e) {
|
1688
1688
|
ke.logLevel <= T.ERROR && ke.error(`Auth (${be}): ${n}`, ...e);
|
1689
1689
|
}
|
1690
1690
|
/**
|
@@ -1728,7 +1728,7 @@ function _(n, e, ...t) {
|
|
1728
1728
|
}
|
1729
1729
|
function j(n) {
|
1730
1730
|
const e = "INTERNAL ASSERTION FAILED: " + n;
|
1731
|
-
throw
|
1731
|
+
throw Ae(e), new Error(e);
|
1732
1732
|
}
|
1733
1733
|
function F(n, e) {
|
1734
1734
|
n || j(e);
|
@@ -2103,7 +2103,7 @@ function Te(n, e, t) {
|
|
2103
2103
|
const i = $(n, e, r);
|
2104
2104
|
return i.customData._tokenResponse = t, i;
|
2105
2105
|
}
|
2106
|
-
function
|
2106
|
+
function At(n) {
|
2107
2107
|
return n !== void 0 && n.enterprise !== void 0;
|
2108
2108
|
}
|
2109
2109
|
class Ii {
|
@@ -2186,7 +2186,7 @@ function he(n) {
|
|
2186
2186
|
} catch {
|
2187
2187
|
}
|
2188
2188
|
}
|
2189
|
-
async function
|
2189
|
+
async function Ai(n, e = !1) {
|
2190
2190
|
const t = V(n), r = await t.getIdToken(e), i = lt(r);
|
2191
2191
|
_(
|
2192
2192
|
i && i.exp && i.auth_time && i.iat,
|
@@ -2211,15 +2211,15 @@ function Je(n) {
|
|
2211
2211
|
function lt(n) {
|
2212
2212
|
const [e, t, r] = n.split(".");
|
2213
2213
|
if (e === void 0 || t === void 0 || r === void 0)
|
2214
|
-
return
|
2214
|
+
return Ae("JWT malformed, contained fewer than 3 sections"), null;
|
2215
2215
|
try {
|
2216
2216
|
const i = Jt(t);
|
2217
|
-
return i ? JSON.parse(i) : (
|
2217
|
+
return i ? JSON.parse(i) : (Ae("Failed to decode base64 JWT payload"), null);
|
2218
2218
|
} catch (i) {
|
2219
|
-
return
|
2219
|
+
return Ae("Caught error parsing JWT payload as JSON", i == null ? void 0 : i.toString()), null;
|
2220
2220
|
}
|
2221
2221
|
}
|
2222
|
-
function
|
2222
|
+
function Si(n) {
|
2223
2223
|
const e = lt(n);
|
2224
2224
|
return _(
|
2225
2225
|
e,
|
@@ -2496,7 +2496,7 @@ class me {
|
|
2496
2496
|
"internal-error"
|
2497
2497
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2498
2498
|
);
|
2499
|
-
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) :
|
2499
|
+
const t = "expiresIn" in e && typeof e.expiresIn < "u" ? Number(e.expiresIn) : Si(e.idToken);
|
2500
2500
|
this.updateTokensAndExpiration(e.idToken, e.refreshToken, t);
|
2501
2501
|
}
|
2502
2502
|
async getToken(e, t = !1) {
|
@@ -2578,7 +2578,7 @@ class Z {
|
|
2578
2578
|
), this.accessToken !== t && (this.accessToken = t, await this.auth._persistUserIfCurrent(this), this.auth._notifyListenersIfCurrent(this)), t;
|
2579
2579
|
}
|
2580
2580
|
getIdTokenResult(e) {
|
2581
|
-
return
|
2581
|
+
return Ai(this, e);
|
2582
2582
|
}
|
2583
2583
|
reload() {
|
2584
2584
|
return Pi(this);
|
@@ -2646,7 +2646,7 @@ class Z {
|
|
2646
2646
|
}
|
2647
2647
|
static _fromJSON(e, t) {
|
2648
2648
|
var r, i, s, o, c, a, u, y;
|
2649
|
-
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0,
|
2649
|
+
const b = (r = t.displayName) !== null && r !== void 0 ? r : void 0, S = (i = t.email) !== null && i !== void 0 ? i : void 0, O = (s = t.phoneNumber) !== null && s !== void 0 ? s : void 0, N = (o = t.photoURL) !== null && o !== void 0 ? o : void 0, v = (c = t.tenantId) !== null && c !== void 0 ? c : void 0, I = (a = t._redirectEventId) !== null && a !== void 0 ? a : void 0, k = (u = t.createdAt) !== null && u !== void 0 ? u : void 0, C = (y = t.lastLoginAt) !== null && y !== void 0 ? y : void 0, { uid: U, emailVerified: D, isAnonymous: l, providerData: m, stsTokenManager: d } = t;
|
2650
2650
|
_(
|
2651
2651
|
U && d,
|
2652
2652
|
e,
|
@@ -2659,7 +2659,7 @@ class Z {
|
|
2659
2659
|
e,
|
2660
2660
|
"internal-error"
|
2661
2661
|
/* AuthErrorCode.INTERNAL_ERROR */
|
2662
|
-
), x(b, e.name), x(
|
2662
|
+
), x(b, e.name), x(S, e.name), _(
|
2663
2663
|
typeof D == "boolean",
|
2664
2664
|
e,
|
2665
2665
|
"internal-error"
|
@@ -2673,7 +2673,7 @@ class Z {
|
|
2673
2673
|
const E = new Z({
|
2674
2674
|
uid: U,
|
2675
2675
|
auth: e,
|
2676
|
-
email:
|
2676
|
+
email: S,
|
2677
2677
|
emailVerified: D,
|
2678
2678
|
displayName: b,
|
2679
2679
|
isAnonymous: l,
|
@@ -2684,7 +2684,7 @@ class Z {
|
|
2684
2684
|
createdAt: k,
|
2685
2685
|
lastLoginAt: C
|
2686
2686
|
});
|
2687
|
-
return m && Array.isArray(m) && (E.providerData = m.map((
|
2687
|
+
return m && Array.isArray(m) && (E.providerData = m.map((A) => Object.assign({}, A))), I && (E._redirectEventId = I), E;
|
2688
2688
|
}
|
2689
2689
|
/**
|
2690
2690
|
* Initialize a User from an idToken server response
|
@@ -2719,11 +2719,11 @@ class Z {
|
|
2719
2719
|
* See the License for the specific language governing permissions and
|
2720
2720
|
* limitations under the License.
|
2721
2721
|
*/
|
2722
|
-
const
|
2722
|
+
const St = /* @__PURE__ */ new Map();
|
2723
2723
|
function B(n) {
|
2724
2724
|
F(n instanceof Function, "Expected a class definition");
|
2725
|
-
let e =
|
2726
|
-
return e ? (F(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(),
|
2725
|
+
let e = St.get(n);
|
2726
|
+
return e ? (F(e instanceof n, "Instance stored in cache mismatched with class"), e) : (e = new n(), St.set(n, e), e);
|
2727
2727
|
}
|
2728
2728
|
/**
|
2729
2729
|
* @license
|
@@ -2781,14 +2781,14 @@ const Ct = dn;
|
|
2781
2781
|
* See the License for the specific language governing permissions and
|
2782
2782
|
* limitations under the License.
|
2783
2783
|
*/
|
2784
|
-
function
|
2784
|
+
function Se(n, e, t) {
|
2785
2785
|
return `firebase:${n}:${e}:${t}`;
|
2786
2786
|
}
|
2787
2787
|
class se {
|
2788
2788
|
constructor(e, t, r) {
|
2789
2789
|
this.persistence = e, this.auth = t, this.userKey = r;
|
2790
2790
|
const { config: i, name: s } = this.auth;
|
2791
|
-
this.fullUserKey =
|
2791
|
+
this.fullUserKey = Se(this.userKey, i.apiKey, s), this.fullPersistenceKey = Se("persistence", i.apiKey, s), this.boundEventHandler = t._onStorageEvent.bind(t), this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
2792
2792
|
}
|
2793
2793
|
setCurrentUser(e) {
|
2794
2794
|
return this.persistence._set(this.fullUserKey, e.toJSON());
|
@@ -2821,7 +2821,7 @@ class se {
|
|
2821
2821
|
return u;
|
2822
2822
|
}))).filter((u) => u);
|
2823
2823
|
let s = i[0] || B(Ct);
|
2824
|
-
const o =
|
2824
|
+
const o = Se(r, e.config.apiKey, e.name);
|
2825
2825
|
let c = null;
|
2826
2826
|
for (const u of t)
|
2827
2827
|
try {
|
@@ -3555,7 +3555,7 @@ class Gi {
|
|
3555
3555
|
}
|
3556
3556
|
function i(s, o, c) {
|
3557
3557
|
const a = window.grecaptcha;
|
3558
|
-
|
3558
|
+
At(a) ? a.enterprise.ready(() => {
|
3559
3559
|
a.enterprise.execute(s, { action: e }).then((u) => {
|
3560
3560
|
o(u);
|
3561
3561
|
}).catch(() => {
|
@@ -3565,7 +3565,7 @@ class Gi {
|
|
3565
3565
|
}
|
3566
3566
|
return new Promise((s, o) => {
|
3567
3567
|
r(this.auth).then((c) => {
|
3568
|
-
if (!t &&
|
3568
|
+
if (!t && At(window.grecaptcha))
|
3569
3569
|
i(c, s, o);
|
3570
3570
|
else {
|
3571
3571
|
if (typeof window > "u") {
|
@@ -4853,7 +4853,7 @@ function bs() {
|
|
4853
4853
|
return dt(n) || je(n);
|
4854
4854
|
}
|
4855
4855
|
const Is = 1e3, ws = 10;
|
4856
|
-
class
|
4856
|
+
class An extends Tn {
|
4857
4857
|
constructor() {
|
4858
4858
|
super(
|
4859
4859
|
() => window.localStorage,
|
@@ -4937,8 +4937,8 @@ class Sn extends Tn {
|
|
4937
4937
|
await super._remove(e), delete this.localCache[e];
|
4938
4938
|
}
|
4939
4939
|
}
|
4940
|
-
|
4941
|
-
const Es =
|
4940
|
+
An.type = "LOCAL";
|
4941
|
+
const Es = An;
|
4942
4942
|
/**
|
4943
4943
|
* @license
|
4944
4944
|
* Copyright 2020 Google LLC
|
@@ -4955,7 +4955,7 @@ const Es = Sn;
|
|
4955
4955
|
* See the License for the specific language governing permissions and
|
4956
4956
|
* limitations under the License.
|
4957
4957
|
*/
|
4958
|
-
class
|
4958
|
+
class Sn extends Tn {
|
4959
4959
|
constructor() {
|
4960
4960
|
super(
|
4961
4961
|
() => window.sessionStorage,
|
@@ -4968,8 +4968,8 @@ class An extends Tn {
|
|
4968
4968
|
_removeListener(e, t) {
|
4969
4969
|
}
|
4970
4970
|
}
|
4971
|
-
|
4972
|
-
const Cn =
|
4971
|
+
Sn.type = "SESSION";
|
4972
|
+
const Cn = Sn;
|
4973
4973
|
/**
|
4974
4974
|
* @license
|
4975
4975
|
* Copyright 2019 Google LLC
|
@@ -5124,7 +5124,7 @@ function ft(n = "", e = 10) {
|
|
5124
5124
|
* See the License for the specific language governing permissions and
|
5125
5125
|
* limitations under the License.
|
5126
5126
|
*/
|
5127
|
-
class
|
5127
|
+
class As {
|
5128
5128
|
constructor(e) {
|
5129
5129
|
this.target = e, this.handlers = /* @__PURE__ */ new Set();
|
5130
5130
|
}
|
@@ -5169,9 +5169,9 @@ class Ss {
|
|
5169
5169
|
o = {
|
5170
5170
|
messageChannel: i,
|
5171
5171
|
onMessage(b) {
|
5172
|
-
const
|
5173
|
-
if (
|
5174
|
-
switch (
|
5172
|
+
const S = b;
|
5173
|
+
if (S.data.eventId === u)
|
5174
|
+
switch (S.data.status) {
|
5175
5175
|
case "ack":
|
5176
5176
|
clearTimeout(y), s = setTimeout(
|
5177
5177
|
() => {
|
@@ -5185,7 +5185,7 @@ class Ss {
|
|
5185
5185
|
);
|
5186
5186
|
break;
|
5187
5187
|
case "done":
|
5188
|
-
clearTimeout(s), c(
|
5188
|
+
clearTimeout(s), c(S.data.response);
|
5189
5189
|
break;
|
5190
5190
|
default:
|
5191
5191
|
clearTimeout(y), clearTimeout(s), a(new Error(
|
@@ -5224,7 +5224,7 @@ class Ss {
|
|
5224
5224
|
function M() {
|
5225
5225
|
return window;
|
5226
5226
|
}
|
5227
|
-
function
|
5227
|
+
function Ss(n) {
|
5228
5228
|
M().location.href = n;
|
5229
5229
|
}
|
5230
5230
|
/**
|
@@ -5384,7 +5384,7 @@ class kn {
|
|
5384
5384
|
var e, t;
|
5385
5385
|
if (this.activeServiceWorker = await Cs(), !this.activeServiceWorker)
|
5386
5386
|
return;
|
5387
|
-
this.sender = new
|
5387
|
+
this.sender = new As(this.activeServiceWorker);
|
5388
5388
|
const r = await this.sender._send(
|
5389
5389
|
"ping",
|
5390
5390
|
{},
|
@@ -5823,7 +5823,7 @@ function zs(n) {
|
|
5823
5823
|
return B(n._redirectPersistence);
|
5824
5824
|
}
|
5825
5825
|
function qs(n) {
|
5826
|
-
return
|
5826
|
+
return Se(Vs, n.config.apiKey, n.name);
|
5827
5827
|
}
|
5828
5828
|
async function Js(n, e, t = !1) {
|
5829
5829
|
const r = ne(n), i = Ms(r, e), o = await new Hs(r, i, t).execute();
|
@@ -6157,7 +6157,7 @@ function _o(n, e, t, r = po, i = go) {
|
|
6157
6157
|
left: o
|
6158
6158
|
}), u = P().toLowerCase();
|
6159
6159
|
t && (c = hn(u) ? mo : t), un(u) && (e = e || yo, a.scrollbars = "yes");
|
6160
|
-
const y = Object.entries(a).reduce((
|
6160
|
+
const y = Object.entries(a).reduce((S, [O, N]) => `${S}${O}=${N},`, "");
|
6161
6161
|
if (Li(u) && c !== "_self")
|
6162
6162
|
return vo(e || "", c), new Ut(null);
|
6163
6163
|
const b = window.open(e || "", c, y);
|
@@ -6267,7 +6267,7 @@ class To {
|
|
6267
6267
|
async _openRedirect(e, t, r, i) {
|
6268
6268
|
await this._originValidation(e);
|
6269
6269
|
const s = await jt(e, t, r, et(), i);
|
6270
|
-
return
|
6270
|
+
return Ss(s), new Promise(() => {
|
6271
6271
|
});
|
6272
6272
|
}
|
6273
6273
|
_initialize(e) {
|
@@ -6312,7 +6312,7 @@ class To {
|
|
6312
6312
|
return yn() || dt() || je();
|
6313
6313
|
}
|
6314
6314
|
}
|
6315
|
-
const
|
6315
|
+
const Ao = To;
|
6316
6316
|
var Bt = "@firebase/auth", Ft = "1.6.0";
|
6317
6317
|
/**
|
6318
6318
|
* @license
|
@@ -6330,7 +6330,7 @@ var Bt = "@firebase/auth", Ft = "1.6.0";
|
|
6330
6330
|
* See the License for the specific language governing permissions and
|
6331
6331
|
* limitations under the License.
|
6332
6332
|
*/
|
6333
|
-
class
|
6333
|
+
class So {
|
6334
6334
|
constructor(e) {
|
6335
6335
|
this.auth = e, this.internalListeners = /* @__PURE__ */ new Map();
|
6336
6336
|
}
|
@@ -6431,7 +6431,7 @@ function Ro(n) {
|
|
6431
6431
|
"auth"
|
6432
6432
|
/* _ComponentName.AUTH */
|
6433
6433
|
).getImmediate());
|
6434
|
-
return ((r) => new
|
6434
|
+
return ((r) => new So(r))(t);
|
6435
6435
|
},
|
6436
6436
|
"PRIVATE"
|
6437
6437
|
/* ComponentType.PRIVATE */
|
@@ -6475,7 +6475,7 @@ function No(n = Zr()) {
|
|
6475
6475
|
if (e.isInitialized())
|
6476
6476
|
return e.getImmediate();
|
6477
6477
|
const t = Ki(n, {
|
6478
|
-
popupRedirectResolver:
|
6478
|
+
popupRedirectResolver: Ao,
|
6479
6479
|
persistence: [
|
6480
6480
|
$s,
|
6481
6481
|
Es,
|
@@ -6528,26 +6528,26 @@ var Ln = { exports: {} };
|
|
6528
6528
|
function r(l, m) {
|
6529
6529
|
return l << m | l >>> 32 - m;
|
6530
6530
|
}
|
6531
|
-
function i(l, m, d, w, E,
|
6532
|
-
return t(r(t(t(m, l), t(w,
|
6531
|
+
function i(l, m, d, w, E, A) {
|
6532
|
+
return t(r(t(t(m, l), t(w, A)), E), d);
|
6533
6533
|
}
|
6534
|
-
function s(l, m, d, w, E,
|
6535
|
-
return i(m & d | ~m & w, l, m, E,
|
6534
|
+
function s(l, m, d, w, E, A, R) {
|
6535
|
+
return i(m & d | ~m & w, l, m, E, A, R);
|
6536
6536
|
}
|
6537
|
-
function o(l, m, d, w, E,
|
6538
|
-
return i(m & w | d & ~w, l, m, E,
|
6537
|
+
function o(l, m, d, w, E, A, R) {
|
6538
|
+
return i(m & w | d & ~w, l, m, E, A, R);
|
6539
6539
|
}
|
6540
|
-
function c(l, m, d, w, E,
|
6541
|
-
return i(m ^ d ^ w, l, m, E,
|
6540
|
+
function c(l, m, d, w, E, A, R) {
|
6541
|
+
return i(m ^ d ^ w, l, m, E, A, R);
|
6542
6542
|
}
|
6543
|
-
function a(l, m, d, w, E,
|
6544
|
-
return i(d ^ (m | ~w), l, m, E,
|
6543
|
+
function a(l, m, d, w, E, A, R) {
|
6544
|
+
return i(d ^ (m | ~w), l, m, E, A, R);
|
6545
6545
|
}
|
6546
6546
|
function u(l, m) {
|
6547
6547
|
l[m >> 5] |= 128 << m % 32, l[(m + 64 >>> 9 << 4) + 14] = m;
|
6548
|
-
var d, w, E,
|
6548
|
+
var d, w, E, A, R, h = 1732584193, f = -271733879, p = -1732584194, g = 271733878;
|
6549
6549
|
for (d = 0; d < l.length; d += 16)
|
6550
|
-
w = h, E = f,
|
6550
|
+
w = h, E = f, A = p, R = g, h = s(h, f, p, g, l[d], 7, -680876936), g = s(g, h, f, p, l[d + 1], 12, -389564586), p = s(p, g, h, f, l[d + 2], 17, 606105819), f = s(f, p, g, h, l[d + 3], 22, -1044525330), h = s(h, f, p, g, l[d + 4], 7, -176418897), g = s(g, h, f, p, l[d + 5], 12, 1200080426), p = s(p, g, h, f, l[d + 6], 17, -1473231341), f = s(f, p, g, h, l[d + 7], 22, -45705983), h = s(h, f, p, g, l[d + 8], 7, 1770035416), g = s(g, h, f, p, l[d + 9], 12, -1958414417), p = s(p, g, h, f, l[d + 10], 17, -42063), f = s(f, p, g, h, l[d + 11], 22, -1990404162), h = s(h, f, p, g, l[d + 12], 7, 1804603682), g = s(g, h, f, p, l[d + 13], 12, -40341101), p = s(p, g, h, f, l[d + 14], 17, -1502002290), f = s(f, p, g, h, l[d + 15], 22, 1236535329), h = o(h, f, p, g, l[d + 1], 5, -165796510), g = o(g, h, f, p, l[d + 6], 9, -1069501632), p = o(p, g, h, f, l[d + 11], 14, 643717713), f = o(f, p, g, h, l[d], 20, -373897302), h = o(h, f, p, g, l[d + 5], 5, -701558691), g = o(g, h, f, p, l[d + 10], 9, 38016083), p = o(p, g, h, f, l[d + 15], 14, -660478335), f = o(f, p, g, h, l[d + 4], 20, -405537848), h = o(h, f, p, g, l[d + 9], 5, 568446438), g = o(g, h, f, p, l[d + 14], 9, -1019803690), p = o(p, g, h, f, l[d + 3], 14, -187363961), f = o(f, p, g, h, l[d + 8], 20, 1163531501), h = o(h, f, p, g, l[d + 13], 5, -1444681467), g = o(g, h, f, p, l[d + 2], 9, -51403784), p = o(p, g, h, f, l[d + 7], 14, 1735328473), f = o(f, p, g, h, l[d + 12], 20, -1926607734), h = c(h, f, p, g, l[d + 5], 4, -378558), g = c(g, h, f, p, l[d + 8], 11, -2022574463), p = c(p, g, h, f, l[d + 11], 16, 1839030562), f = c(f, p, g, h, l[d + 14], 23, -35309556), h = c(h, f, p, g, l[d + 1], 4, -1530992060), g = c(g, h, f, p, l[d + 4], 11, 1272893353), p = c(p, g, h, f, l[d + 7], 16, -155497632), f = c(f, p, g, h, l[d + 10], 23, -1094730640), h = c(h, f, p, g, l[d + 13], 4, 681279174), g = c(g, h, f, p, l[d], 11, -358537222), p = c(p, g, h, f, l[d + 3], 16, -722521979), f = c(f, p, g, h, l[d + 6], 23, 76029189), h = c(h, f, p, g, l[d + 9], 4, -640364487), g = c(g, h, f, p, l[d + 12], 11, -421815835), p = c(p, g, h, f, l[d + 15], 16, 530742520), f = c(f, p, g, h, l[d + 2], 23, -995338651), h = a(h, f, p, g, l[d], 6, -198630844), g = a(g, h, f, p, l[d + 7], 10, 1126891415), p = a(p, g, h, f, l[d + 14], 15, -1416354905), f = a(f, p, g, h, l[d + 5], 21, -57434055), h = a(h, f, p, g, l[d + 12], 6, 1700485571), g = a(g, h, f, p, l[d + 3], 10, -1894986606), p = a(p, g, h, f, l[d + 10], 15, -1051523), f = a(f, p, g, h, l[d + 1], 21, -2054922799), h = a(h, f, p, g, l[d + 8], 6, 1873313359), g = a(g, h, f, p, l[d + 15], 10, -30611744), p = a(p, g, h, f, l[d + 6], 15, -1560198380), f = a(f, p, g, h, l[d + 13], 21, 1309151649), h = a(h, f, p, g, l[d + 4], 6, -145523070), g = a(g, h, f, p, l[d + 11], 10, -1120210379), p = a(p, g, h, f, l[d + 2], 15, 718787259), f = a(f, p, g, h, l[d + 9], 21, -343485551), h = t(h, w), f = t(f, E), p = t(p, A), g = t(g, R);
|
6551
6551
|
return [h, f, p, g];
|
6552
6552
|
}
|
6553
6553
|
function y(l) {
|
@@ -6565,14 +6565,14 @@ var Ln = { exports: {} };
|
|
6565
6565
|
d[m >> 5] |= (l.charCodeAt(m / 8) & 255) << m % 32;
|
6566
6566
|
return d;
|
6567
6567
|
}
|
6568
|
-
function
|
6568
|
+
function S(l) {
|
6569
6569
|
return y(u(b(l), l.length * 8));
|
6570
6570
|
}
|
6571
6571
|
function O(l, m) {
|
6572
|
-
var d, w = b(l), E = [],
|
6573
|
-
for (E[15] =
|
6574
|
-
E[d] = w[d] ^ 909522486,
|
6575
|
-
return R = u(E.concat(b(m)), 512 + m.length * 8), y(u(
|
6572
|
+
var d, w = b(l), E = [], A = [], R;
|
6573
|
+
for (E[15] = A[15] = void 0, w.length > 16 && (w = u(w, l.length * 8)), d = 0; d < 16; d += 1)
|
6574
|
+
E[d] = w[d] ^ 909522486, A[d] = w[d] ^ 1549556828;
|
6575
|
+
return R = u(E.concat(b(m)), 512 + m.length * 8), y(u(A.concat(R), 640));
|
6576
6576
|
}
|
6577
6577
|
function N(l) {
|
6578
6578
|
var m = "0123456789abcdef", d = "", w, E;
|
@@ -6584,7 +6584,7 @@ var Ln = { exports: {} };
|
|
6584
6584
|
return unescape(encodeURIComponent(l));
|
6585
6585
|
}
|
6586
6586
|
function I(l) {
|
6587
|
-
return
|
6587
|
+
return S(v(l));
|
6588
6588
|
}
|
6589
6589
|
function k(l) {
|
6590
6590
|
return N(I(l));
|
@@ -6681,8 +6681,8 @@ const Uo = /* @__PURE__ */ $o(Mo), gt = (n, e) => async (t, r = {}) => {
|
|
6681
6681
|
primaryKey: n || "id",
|
6682
6682
|
properties: Object.keys(e || {}).reduce(
|
6683
6683
|
(r, i) => {
|
6684
|
-
var b,
|
6685
|
-
const s = e[i] || {}, { type: o, isScalar: c, isRequired: a, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (b = s.items) != null && b.$ref ? { type: s.items.$ref.split("/").pop(), isScalar: !1, isRequired: !1, isRef: !0 } : { type: (
|
6684
|
+
var b, S;
|
6685
|
+
const s = e[i] || {}, { type: o, isScalar: c, isRequired: a, isRef: u = !1 } = typeof s.type == "string" ? s.type === "array" ? s.enum ? { type: "string", isScalar: !1, isRequired: !1 } : (b = s.items) != null && b.$ref ? { type: s.items.$ref.split("/").pop(), isScalar: !1, isRequired: !1, isRef: !0 } : { type: (S = s.items) == null ? void 0 : S.type, isScalar: !1, isRequired: !1 } : { type: s.format === "date-time" ? "date" : s.type, isScalar: !0, isRequired: !0 } : Array.isArray(s.type) ? s.type.length === 2 ? { type: s.format === "date-time" ? "date" : s.type[0], isScalar: !0, isRequired: !1 } : { type: "json", isScalar: !0, isRequired: s.type.includes("null") } : s.$ref ? { type: s.$ref.split("/").pop(), isScalar: !0, isRequired: !0, isRef: !0 } : { type: s.anyOf[0].$ref.split("/").pop(), isScalar: !0, isRequired: !1, isRef: !0 }, y = s.inputType || (o === "integer" ? "number" : o);
|
6686
6686
|
return {
|
6687
6687
|
...r,
|
6688
6688
|
[i]: {
|
@@ -6702,7 +6702,7 @@ const Uo = /* @__PURE__ */ $o(Mo), gt = (n, e) => async (t, r = {}) => {
|
|
6702
6702
|
const s = xo(r), { primaryKey: o, properties: c } = s, a = jo(s), u = Ho(t), y = (...v) => gt(n, e.authUser)(...v), b = ({ data: v, ...I }) => y(u(null, I), {
|
6703
6703
|
method: "POST",
|
6704
6704
|
body: Ht(v, s)
|
6705
|
-
}),
|
6705
|
+
}), S = ({ data: v, ...I }) => {
|
6706
6706
|
const { where: k, ...C } = I;
|
6707
6707
|
return y(u(k[o], C), {
|
6708
6708
|
method: "PUT",
|
@@ -6716,13 +6716,13 @@ const Uo = /* @__PURE__ */ $o(Mo), gt = (n, e) => async (t, r = {}) => {
|
|
6716
6716
|
var E;
|
6717
6717
|
const U = c[C] || {}, { type: D, isScalar: l, isRef: m, format: d, items: w } = U;
|
6718
6718
|
if (m) {
|
6719
|
-
const
|
6719
|
+
const A = Vo(D);
|
6720
6720
|
return l ? {
|
6721
6721
|
...k,
|
6722
|
-
[C]: i[
|
6722
|
+
[C]: i[A].parse(v[C])
|
6723
6723
|
} : {
|
6724
6724
|
...k,
|
6725
|
-
[C]: typeof ((E = i[
|
6725
|
+
[C]: typeof ((E = i[A]) == null ? void 0 : E.parse) == "function" ? v[C].map((R) => i[A].parse(R)) : v[C]
|
6726
6726
|
};
|
6727
6727
|
}
|
6728
6728
|
return {
|
@@ -6767,8 +6767,8 @@ const Uo = /* @__PURE__ */ $o(Mo), gt = (n, e) => async (t, r = {}) => {
|
|
6767
6767
|
findMany: (v) => y(u(null, v)).then((I) => I.map(O)),
|
6768
6768
|
findById: (v, I) => y(u(v, I)).then(O),
|
6769
6769
|
create: b,
|
6770
|
-
update:
|
6771
|
-
upsert: (v) => v.where[o] ?
|
6770
|
+
update: S,
|
6771
|
+
upsert: (v) => v.where[o] ? S({ where: v.where, data: v.update }) : b({ data: v.create }),
|
6772
6772
|
delete: (v) => y(u(v), { method: "DELETE" }),
|
6773
6773
|
stats: () => y(u("_stats")),
|
6774
6774
|
search: (v, I = {}) => {
|
@@ -6778,10 +6778,10 @@ const Uo = /* @__PURE__ */ $o(Mo), gt = (n, e) => async (t, r = {}) => {
|
|
6778
6778
|
...w,
|
6779
6779
|
{
|
6780
6780
|
OR: k.reduce(
|
6781
|
-
(
|
6781
|
+
(A, R) => {
|
6782
6782
|
const h = R.split(".");
|
6783
6783
|
return [
|
6784
|
-
...
|
6784
|
+
...A,
|
6785
6785
|
h.reduceRight(
|
6786
6786
|
(f, p) => ({ [p]: f }),
|
6787
6787
|
{ contains: E, mode: "insensitive" }
|
@@ -9176,10 +9176,23 @@ const Uo = /* @__PURE__ */ $o(Mo), gt = (n, e) => async (t, r = {}) => {
|
|
9176
9176
|
Country: {
|
9177
9177
|
primaryKey: "code",
|
9178
9178
|
plural: "countries",
|
9179
|
+
inputProps: [
|
9180
|
+
"name",
|
9181
|
+
"incomeFilter",
|
9182
|
+
"currency",
|
9183
|
+
"canApply",
|
9184
|
+
"flag"
|
9185
|
+
],
|
9179
9186
|
searchProps: ["code", "name", "timeZone"],
|
9180
9187
|
defaultProps: ["code", "name", "timeZone", "currency"],
|
9181
9188
|
getOptionLabel: ({ code: n, name: e }) => `${n} / ${e}`
|
9182
9189
|
},
|
9190
|
+
Currency: {
|
9191
|
+
primaryKey: "code",
|
9192
|
+
plural: "currencies",
|
9193
|
+
searchProps: ["code", "name"],
|
9194
|
+
defaultProps: ["code", "name", "symbol"]
|
9195
|
+
},
|
9183
9196
|
ActivityLogEntry: {
|
9184
9197
|
plural: "activityLog"
|
9185
9198
|
},
|
@@ -28,7 +28,7 @@
|
|
28
28
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
29
29
|
* See the License for the specific language governing permissions and
|
30
30
|
* limitations under the License.
|
31
|
-
*/const ie=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},jn=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],c=n[t++],a=((i&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(a&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},_t={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,c=o?n[i+1]:0,a=i+2<n.length,u=a?n[i+2]:0,y=s>>2,b=(s&3)<<4|c>>4;let
|
31
|
+
*/const ie=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);i<128?e[t++]=i:i<2048?(e[t++]=i>>6|192,e[t++]=i&63|128):(i&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=i>>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=i&63|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=i&63|128)}return e},jn=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=n[t++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=n[t++],o=n[t++],c=n[t++],a=((i&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(a&1023))}else{const s=n[t++],o=n[t++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},_t={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<n.length;i+=3){const s=n[i],o=i+1<n.length,c=o?n[i+1]:0,a=i+2<n.length,u=a?n[i+2]:0,y=s>>2,b=(s&3)<<4|c>>4;let S=(c&15)<<2|u>>6,O=u&63;a||(O=64,o||(S=64)),r.push(t[y],t[b],t[S],t[O])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(ie(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):jn(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<n.length;){const s=t[n.charAt(i++)],c=i<n.length?t[n.charAt(i)]:0;++i;const u=i<n.length?t[n.charAt(i)]:64;++i;const b=i<n.length?t[n.charAt(i)]:64;if(++i,s==null||c==null||u==null||b==null)throw new Bn;const S=s<<2|c>>4;if(r.push(S),u!==64){const O=c<<4&240|u>>2;if(r.push(O),b!==64){const L=u<<6&192|b;r.push(L)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class Bn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Fn=function(n){const e=ie(n);return _t.encodeByteArray(e,!0)},vt=function(n){return Fn(n).replace(/\./g,"")},bt=function(n){try{return _t.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
|
32
32
|
* @license
|
33
33
|
* Copyright 2022 Google LLC
|
34
34
|
*
|
@@ -103,7 +103,7 @@
|
|
103
103
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
104
104
|
* See the License for the specific language governing permissions and
|
105
105
|
* limitations under the License.
|
106
|
-
*/const Zn="FirebaseError";class x extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Zn,Object.setPrototypeOf(this,x.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,he.prototype.create)}}class he{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?er(s,r):"Error",c=`${this.serviceName}: ${o} (${i}).`;return new x(i,c,r)}}function er(n,e){return n.replace(tr,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const tr=/\{\$([^}]+)}/g;function nr(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function
|
106
|
+
*/const Zn="FirebaseError";class x extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=Zn,Object.setPrototypeOf(this,x.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,he.prototype.create)}}class he{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?er(s,r):"Error",c=`${this.serviceName}: ${o} (${i}).`;return new x(i,c,r)}}function er(n,e){return n.replace(tr,(t,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const tr=/\{\$([^}]+)}/g;function nr(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Se(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const s=n[i],o=e[i];if(Et(s)&&Et(o)){if(!Se(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function Et(n){return n!==null&&typeof n=="object"}/**
|
107
107
|
* @license
|
108
108
|
* Copyright 2017 Google LLC
|
109
109
|
*
|
@@ -193,7 +193,7 @@
|
|
193
193
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
194
194
|
* See the License for the specific language governing permissions and
|
195
195
|
* limitations under the License.
|
196
|
-
*/var T;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(T||(T={}));const dr={debug:T.DEBUG,verbose:T.VERBOSE,info:T.INFO,warn:T.WARN,error:T.ERROR,silent:T.SILENT},ur=T.INFO,hr={[T.DEBUG]:"log",[T.VERBOSE]:"log",[T.INFO]:"info",[T.WARN]:"warn",[T.ERROR]:"error"},fr=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=hr[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Tt{constructor(e){this.name=e,this._logLevel=ur,this._logHandler=fr,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in T))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?dr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,T.DEBUG,...e),this._logHandler(this,T.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,T.VERBOSE,...e),this._logHandler(this,T.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,T.INFO,...e),this._logHandler(this,T.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,T.WARN,...e),this._logHandler(this,T.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,T.ERROR,...e),this._logHandler(this,T.ERROR,...e)}}const pr=(n,e)=>e.some(t=>n instanceof t);let St
|
196
|
+
*/var T;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(T||(T={}));const dr={debug:T.DEBUG,verbose:T.VERBOSE,info:T.INFO,warn:T.WARN,error:T.ERROR,silent:T.SILENT},ur=T.INFO,hr={[T.DEBUG]:"log",[T.VERBOSE]:"log",[T.INFO]:"info",[T.WARN]:"warn",[T.ERROR]:"error"},fr=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),i=hr[e];if(i)console[i](`[${r}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Tt{constructor(e){this.name=e,this._logLevel=ur,this._logHandler=fr,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in T))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?dr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,T.DEBUG,...e),this._logHandler(this,T.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,T.VERBOSE,...e),this._logHandler(this,T.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,T.INFO,...e),this._logHandler(this,T.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,T.WARN,...e),this._logHandler(this,T.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,T.ERROR,...e),this._logHandler(this,T.ERROR,...e)}}const pr=(n,e)=>e.some(t=>n instanceof t);let At,St;function gr(){return At||(At=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function mr(){return St||(St=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ct=new WeakMap,qe=new WeakMap,Rt=new WeakMap,Je=new WeakMap,Ge=new WeakMap;function yr(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(z(n.result)),i()},o=()=>{r(n.error),i()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Ct.set(t,n)}).catch(()=>{}),Ge.set(e,n),e}function _r(n){if(qe.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),i()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});qe.set(n,e)}let Ke={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return qe.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Rt.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return z(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function vr(n){Ke=n(Ke)}function br(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(Ye(this),e,...t);return Rt.set(r,e.sort?e.sort():[e]),z(r)}:mr().includes(n)?function(...e){return n.apply(Ye(this),e),z(Ct.get(this))}:function(...e){return z(n.apply(Ye(this),e))}}function Ir(n){return typeof n=="function"?br(n):(n instanceof IDBTransaction&&_r(n),pr(n,gr())?new Proxy(n,Ke):n)}function z(n){if(n instanceof IDBRequest)return yr(n);if(Je.has(n))return Je.get(n);const e=Ir(n);return e!==n&&(Je.set(n,e),Ge.set(e,n)),e}const Ye=n=>Ge.get(n);function wr(n,e,{blocked:t,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(n,e),c=z(o);return r&&o.addEventListener("upgradeneeded",a=>{r(z(o.result),a.oldVersion,a.newVersion,z(o.transaction),a)}),t&&o.addEventListener("blocked",a=>t(a.oldVersion,a.newVersion,a)),c.then(a=>{s&&a.addEventListener("close",()=>s()),i&&a.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),c}const Er=["get","getKey","getAll","getAllKeys","count"],Tr=["put","add","delete","clear"],Qe=new Map;function Pt(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(Qe.get(e))return Qe.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=Tr.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Er.includes(t)))return;const s=async function(o,...c){const a=this.transaction(o,i?"readwrite":"readonly");let u=a.store;return r&&(u=u.index(c.shift())),(await Promise.all([u[t](...c),i&&a.done]))[0]};return Qe.set(e,s),s}vr(n=>({...n,get:(e,t,r)=>Pt(e,t)||n.get(e,t,r),has:(e,t)=>!!Pt(e,t)||n.has(e,t)}));/**
|
197
197
|
* @license
|
198
198
|
* Copyright 2019 Google LLC
|
199
199
|
*
|
@@ -208,7 +208,7 @@
|
|
208
208
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
209
209
|
* See the License for the specific language governing permissions and
|
210
210
|
* limitations under the License.
|
211
|
-
*/class
|
211
|
+
*/class Ar{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Sr(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function Sr(n){const e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Xe="@firebase/app",Ot="0.9.27";/**
|
212
212
|
* @license
|
213
213
|
* Copyright 2019 Google LLC
|
214
214
|
*
|
@@ -298,7 +298,7 @@
|
|
298
298
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
299
299
|
* See the License for the specific language governing permissions and
|
300
300
|
* limitations under the License.
|
301
|
-
*/const ye=Qr;function Nt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Ze,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw q.create("bad-app-name",{appName:String(i)});if(t||(t=It()),!t)throw q.create("no-options");const s=Ce.get(i);if(s){if(
|
301
|
+
*/const ye=Qr;function Nt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Ze,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw q.create("bad-app-name",{appName:String(i)});if(t||(t=It()),!t)throw q.create("no-options");const s=Ce.get(i);if(s){if(Se(t,s.options)&&Se(r,s.config))return s;throw q.create("duplicate-app",{appName:i})}const o=new lr(i);for(const a of et.values())o.addComponent(a);const c=new ti(t,r,o);return Ce.set(i,c),c}function ni(n=Ze){const e=Ce.get(n);if(!e&&n===Ze&&It())return Nt();if(!e)throw q.create("no-app",{appName:n});return e}function oe(n,e,t){var r;let i=(r=Xr[n])!==null&&r!==void 0?r:n;t&&(i+=`-${t}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const c=[`Unable to register library "${i}" with version "${e}":`];s&&c.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ee.warn(c.join(" "));return}me(new se(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
|
302
302
|
* @license
|
303
303
|
* Copyright 2021 Google LLC
|
304
304
|
*
|
@@ -343,7 +343,7 @@
|
|
343
343
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
344
344
|
* See the License for the specific language governing permissions and
|
345
345
|
* limitations under the License.
|
346
|
-
*/function ui(n){me(new se("platform-logger",e=>new
|
346
|
+
*/function ui(n){me(new se("platform-logger",e=>new Ar(e),"PRIVATE")),me(new se("heartbeat",e=>new ci(e),"PRIVATE")),oe(Xe,Ot,n),oe(Xe,Ot,"esm2017"),oe("fire-js","")}ui("");var hi="firebase",fi="10.8.0";/**
|
347
347
|
* @license
|
348
348
|
* Copyright 2020 Google LLC
|
349
349
|
*
|
@@ -493,7 +493,7 @@
|
|
493
493
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
494
494
|
* See the License for the specific language governing permissions and
|
495
495
|
* limitations under the License.
|
496
|
-
*/const Ii=new ve(3e4,6e4);function J(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function V(n,e,t,r,i={}){return Ht(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const c=fe(Object.assign({key:n.config.apiKey},o)).slice(1),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/json",n.languageCode&&(a["X-Firebase-Locale"]=n.languageCode),Vt.fetch()(Wt(n,n.config.apiHost,t,c),Object.assign({method:e,headers:a,referrerPolicy:"no-referrer"},s))})}async function Ht(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},bi),e);try{const i=new Ei(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ke(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const c=s.ok?o.errorMessage:o.error.message,[a,u]=c.split(" : ");if(a==="FEDERATED_USER_ID_ALREADY_LINKED")throw ke(n,"credential-already-in-use",o);if(a==="EMAIL_EXISTS")throw ke(n,"email-already-in-use",o);if(a==="USER_DISABLED")throw ke(n,"user-disabled",o);const y=r[a]||a.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw mi(n,y,u);D(n,y)}}catch(i){if(i instanceof x)throw i;D(n,"network-request-failed",{message:String(i)})}}async function Oe(n,e,t,r,i={}){const s=await V(n,e,t,r,i);return"mfaPendingCredential"in s&&D(n,"multi-factor-auth-required",{_serverResponse:s}),s}function Wt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?st(n.config,i):`${n.config.apiScheme}://${i}`}function wi(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Ei{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(M(this.auth,"network-request-failed")),Ii.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ke(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=M(n,e,r);return i.customData._tokenResponse=t,i}function xt(n){return n!==void 0&&n.enterprise!==void 0}class Ti{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return wi(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function
|
496
|
+
*/const Ii=new ve(3e4,6e4);function J(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function V(n,e,t,r,i={}){return Ht(n,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const c=fe(Object.assign({key:n.config.apiKey},o)).slice(1),a=await n._getAdditionalHeaders();return a["Content-Type"]="application/json",n.languageCode&&(a["X-Firebase-Locale"]=n.languageCode),Vt.fetch()(Wt(n,n.config.apiHost,t,c),Object.assign({method:e,headers:a,referrerPolicy:"no-referrer"},s))})}async function Ht(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},bi),e);try{const i=new Ei(n),s=await Promise.race([t(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw ke(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const c=s.ok?o.errorMessage:o.error.message,[a,u]=c.split(" : ");if(a==="FEDERATED_USER_ID_ALREADY_LINKED")throw ke(n,"credential-already-in-use",o);if(a==="EMAIL_EXISTS")throw ke(n,"email-already-in-use",o);if(a==="USER_DISABLED")throw ke(n,"user-disabled",o);const y=r[a]||a.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw mi(n,y,u);D(n,y)}}catch(i){if(i instanceof x)throw i;D(n,"network-request-failed",{message:String(i)})}}async function Oe(n,e,t,r,i={}){const s=await V(n,e,t,r,i);return"mfaPendingCredential"in s&&D(n,"multi-factor-auth-required",{_serverResponse:s}),s}function Wt(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?st(n.config,i):`${n.config.apiScheme}://${i}`}function wi(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Ei{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(M(this.auth,"network-request-failed")),Ii.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ke(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=M(n,e,r);return i.customData._tokenResponse=t,i}function xt(n){return n!==void 0&&n.enterprise!==void 0}class Ti{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return wi(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function Ai(n,e){return V(n,"GET","/v2/recaptchaConfig",J(n,e))}/**
|
497
497
|
* @license
|
498
498
|
* Copyright 2020 Google LLC
|
499
499
|
*
|
@@ -508,7 +508,7 @@
|
|
508
508
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
509
509
|
* See the License for the specific language governing permissions and
|
510
510
|
* limitations under the License.
|
511
|
-
*/async function
|
511
|
+
*/async function Si(n,e){return V(n,"POST","/v1/accounts:delete",e)}async function Ci(n,e){return V(n,"POST","/v1/accounts:lookup",e)}/**
|
512
512
|
* @license
|
513
513
|
* Copyright 2020 Google LLC
|
514
514
|
*
|
@@ -628,7 +628,7 @@
|
|
628
628
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
629
629
|
* See the License for the specific language governing permissions and
|
630
630
|
* limitations under the License.
|
631
|
-
*/function G(n,e){_(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class te{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=nt(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ki(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new zt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Ie(this,this.stsTokenManager.getToken(this.auth,e));return _(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Ri(this,e)}reload(){return Ni(this)}_assign(e){this!==e&&(_(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new te(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){_(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await Ne(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await Ie(this,
|
631
|
+
*/function G(n,e){_(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class te{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,s=nt(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ki(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new zt(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await Ie(this,this.stsTokenManager.getToken(this.auth,e));return _(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Ri(this,e)}reload(){return Ni(this)}_assign(e){this!==e&&(_(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new te(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){_(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await Ne(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await Ie(this,Si(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,s,o,c,a,u,y;const b=(r=t.displayName)!==null&&r!==void 0?r:void 0,S=(i=t.email)!==null&&i!==void 0?i:void 0,O=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,L=(o=t.photoURL)!==null&&o!==void 0?o:void 0,v=(c=t.tenantId)!==null&&c!==void 0?c:void 0,I=(a=t._redirectEventId)!==null&&a!==void 0?a:void 0,N=(u=t.createdAt)!==null&&u!==void 0?u:void 0,C=(y=t.lastLoginAt)!==null&&y!==void 0?y:void 0,{uid:W,emailVerified:$,isAnonymous:l,providerData:m,stsTokenManager:d}=t;_(W&&d,e,"internal-error");const w=we.fromJSON(this.name,d);_(typeof W=="string",e,"internal-error"),G(b,e.name),G(S,e.name),_(typeof $=="boolean",e,"internal-error"),_(typeof l=="boolean",e,"internal-error"),G(O,e.name),G(L,e.name),G(v,e.name),G(I,e.name),G(N,e.name),G(C,e.name);const E=new te({uid:W,auth:e,email:S,emailVerified:$,displayName:b,isAnonymous:l,photoURL:L,phoneNumber:O,tenantId:v,stsTokenManager:w,createdAt:N,lastLoginAt:C});return m&&Array.isArray(m)&&(E.providerData=m.map(A=>Object.assign({},A))),I&&(E._redirectEventId=I),E}static async _fromIdTokenResponse(e,t,r=!1){const i=new we;i.updateFromServerResponse(t);const s=new te({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Ne(s),s}}/**
|
632
632
|
* @license
|
633
633
|
* Copyright 2020 Google LLC
|
634
634
|
*
|
@@ -778,7 +778,7 @@
|
|
778
778
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
779
779
|
* See the License for the specific language governing permissions and
|
780
780
|
* limitations under the License.
|
781
|
-
*/let $e={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function zi(n){$e=n}function on(n){return $e.loadJS(n)}function qi(){return $e.recaptchaEnterpriseScript}function Ji(){return $e.gapiScript}function Gi(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const Ki="recaptcha-enterprise",Yi="NO_RECAPTCHA";class Qi{constructor(e){this.type=Ki,this.auth=ne(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,c)=>{
|
781
|
+
*/let $e={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function zi(n){$e=n}function on(n){return $e.loadJS(n)}function qi(){return $e.recaptchaEnterpriseScript}function Ji(){return $e.gapiScript}function Gi(n){return`__${n}${Math.floor(Math.random()*1e6)}`}const Ki="recaptcha-enterprise",Yi="NO_RECAPTCHA";class Qi{constructor(e){this.type=Ki,this.auth=ne(e)}async verify(e="verify",t=!1){async function r(s){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,c)=>{Ai(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(a=>{if(a.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{const u=new Ti(a);return s.tenantId==null?s._agentRecaptchaConfig=u:s._tenantRecaptchaConfigs[s.tenantId]=u,o(u.siteKey)}}).catch(a=>{c(a)})})}function i(s,o,c){const a=window.grecaptcha;xt(a)?a.enterprise.ready(()=>{a.enterprise.execute(s,{action:e}).then(u=>{o(u)}).catch(()=>{o(Yi)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{r(this.auth).then(c=>{if(!t&&xt(window.grecaptcha))i(c,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let a=qi();a.length!==0&&(a+=c),on(a).then(()=>{i(c,s,o)}).catch(u=>{o(u)})}}).catch(c=>{o(c)})})}}async function an(n,e,t,r=!1){const i=new Qi(n);let s;try{s=await i.verify(t)}catch{s=await i.verify(t,!0)}const o=Object.assign({},e);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function lt(n,e,t,r){var i;if(!((i=n._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await an(n,e,t,t==="getOobCode");return r(n,s)}else return r(n,e).catch(async s=>{if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await an(n,e,t,t==="getOobCode");return r(n,o)}else return Promise.reject(s)})}/**
|
782
782
|
* @license
|
783
783
|
* Copyright 2020 Google LLC
|
784
784
|
*
|
@@ -793,7 +793,7 @@
|
|
793
793
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
794
794
|
* See the License for the specific language governing permissions and
|
795
795
|
* limitations under the License.
|
796
|
-
*/function Xi(n,e){const t=kt(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(
|
796
|
+
*/function Xi(n,e){const t=kt(n,"auth");if(t.isInitialized()){const i=t.getImmediate(),s=t.getOptions();if(Se(s,e??{}))return i;D(i,"already-initialized")}return t.initialize({options:e})}function Zi(n,e){const t=(e==null?void 0:e.persistence)||[],r=(Array.isArray(t)?t:[t]).map(H);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function es(n,e,t){const r=ne(n);_(r._canInitEmulator,r,"emulator-config-failed"),_(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!(t!=null&&t.disableWarnings),s=cn(e),{host:o,port:c}=ts(e),a=c===null?"":`:${c}`;r.config.emulator={url:`${s}//${o}${a}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||ns()}function cn(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function ts(n){const e=cn(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:ln(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:ln(o)}}}function ln(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function ns(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
|
797
797
|
* @license
|
798
798
|
* Copyright 2020 Google LLC
|
799
799
|
*
|
@@ -1123,7 +1123,7 @@
|
|
1123
1123
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1124
1124
|
* See the License for the specific language governing permissions and
|
1125
1125
|
* limitations under the License.
|
1126
|
-
*/function Es(){const n=P();return ct(n)||Le(n)}const Ts=1e3,
|
1126
|
+
*/function Es(){const n=P();return ct(n)||Le(n)}const Ts=1e3,As=10;class gn extends pn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Es()&&Bi(),this.fallbackToPolling=nn(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),i=this.localCache[t];r!==i&&e(t,i,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,c,a)=>{this.notifyListeners(o,a)});return}const r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const o=this.storage.getItem(r);if(e.newValue!==o)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}const i=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);ji()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,As):i()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},Ts)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}gn.type="LOCAL";const Ss=gn;/**
|
1127
1127
|
* @license
|
1128
1128
|
* Copyright 2020 Google LLC
|
1129
1129
|
*
|
@@ -1198,7 +1198,7 @@
|
|
1198
1198
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1199
1199
|
* See the License for the specific language governing permissions and
|
1200
1200
|
* limitations under the License.
|
1201
|
-
*/class Rs{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((c,a)=>{const u=ht("",20);i.port1.start();const y=setTimeout(()=>{a(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(b){const
|
1201
|
+
*/class Rs{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((c,a)=>{const u=ht("",20);i.port1.start();const y=setTimeout(()=>{a(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(b){const S=b;if(S.data.eventId===u)switch(S.data.status){case"ack":clearTimeout(y),s=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(S.data.response);break;default:clearTimeout(y),clearTimeout(s),a(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
|
1202
1202
|
* @license
|
1203
1203
|
* Copyright 2020 Google LLC
|
1204
1204
|
*
|
@@ -1243,7 +1243,7 @@
|
|
1243
1243
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1244
1244
|
* See the License for the specific language governing permissions and
|
1245
1245
|
* limitations under the License.
|
1246
|
-
*/const vn="firebaseLocalStorageDb",Ds=1,Be="firebaseLocalStorage",bn="fbase_key";class
|
1246
|
+
*/const vn="firebaseLocalStorageDb",Ds=1,Be="firebaseLocalStorage",bn="fbase_key";class Ae{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Fe(n,e){return n.transaction([Be],e?"readwrite":"readonly").objectStore(Be)}function Ls(){const n=indexedDB.deleteDatabase(vn);return new Ae(n).toPromise()}function ft(){const n=indexedDB.open(vn,Ds);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(Be,{keyPath:bn})}catch(i){t(i)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains(Be)?e(r):(r.close(),await Ls(),e(await ft()))})})}async function In(n,e,t){const r=Fe(n,!0).put({[bn]:e,value:t});return new Ae(r).toPromise()}async function $s(n,e){const t=Fe(n,!1).get(e),r=await new Ae(t).toPromise();return r===void 0?null:r.value}function wn(n,e){const t=Fe(n,!0).delete(e);return new Ae(t).toPromise()}const Ms=800,Us=3;class En{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await ft(),this.db)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Us)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return _n()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=je._getInstance(Ns()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await Os(),!this.activeServiceWorker)return;this.sender=new Rs(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((t=r[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||ks()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await ft();return await In(e,Ue,"1"),await wn(e,Ue),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>In(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>$s(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>wn(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Fe(i,!1).getAll();return new Ae(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),t.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),t.push(i));return t}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Ms)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}En.type="LOCAL";const js=En;new ve(3e4,6e4);/**
|
1247
1247
|
* @license
|
1248
1248
|
* Copyright 2021 Google LLC
|
1249
1249
|
*
|
@@ -1333,7 +1333,7 @@
|
|
1333
1333
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1334
1334
|
* See the License for the specific language governing permissions and
|
1335
1335
|
* limitations under the License.
|
1336
|
-
*/const Qs=10*60*1e3;class Xs{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Zs(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!
|
1336
|
+
*/const Qs=10*60*1e3;class Xs{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Zs(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!Sn(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";t.onError(M(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Qs&&this.cachedEventUids.clear(),this.cachedEventUids.has(An(e))}saveEventToCache(e){this.cachedEventUids.add(An(e)),this.lastProcessedEventTime=Date.now()}}function An(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Sn({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Zs(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Sn(n);default:return!1}}/**
|
1337
1337
|
* @license
|
1338
1338
|
* Copyright 2020 Google LLC
|
1339
1339
|
*
|
@@ -1408,7 +1408,7 @@
|
|
1408
1408
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1409
1409
|
* See the License for the specific language governing permissions and
|
1410
1410
|
* limitations under the License.
|
1411
|
-
*/const mo={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},yo=500,_o=600,vo="_blank",bo="http://localhost";class Rn{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Io(n,e,t,r=yo,i=_o){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const a=Object.assign(Object.assign({},mo),{width:r.toString(),height:i.toString(),top:s,left:o}),u=P().toLowerCase();t&&(c=Qt(u)?vo:t),Yt(u)&&(e=e||bo,a.scrollbars="yes");const y=Object.entries(a).reduce((
|
1411
|
+
*/const mo={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},yo=500,_o=600,vo="_blank",bo="http://localhost";class Rn{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Io(n,e,t,r=yo,i=_o){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const a=Object.assign(Object.assign({},mo),{width:r.toString(),height:i.toString(),top:s,left:o}),u=P().toLowerCase();t&&(c=Qt(u)?vo:t),Yt(u)&&(e=e||bo,a.scrollbars="yes");const y=Object.entries(a).reduce((S,[O,L])=>`${S}${O}=${L},`,"");if(Ui(u)&&c!=="_self")return wo(e||"",c),new Rn(null);const b=window.open(e||"",c,y);_(b,n,"popup-blocked");try{b.focus()}catch{}return new Rn(b)}function wo(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
|
1412
1412
|
* @license
|
1413
1413
|
* Copyright 2021 Google LLC
|
1414
1414
|
*
|
@@ -1423,7 +1423,7 @@
|
|
1423
1423
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1424
1424
|
* See the License for the specific language governing permissions and
|
1425
1425
|
* limitations under the License.
|
1426
|
-
*/const Eo="__/auth/handler",To="emulator/auth/handler",
|
1426
|
+
*/const Eo="__/auth/handler",To="emulator/auth/handler",Ao=encodeURIComponent("fac");async function Pn(n,e,t,r,i,s){_(n.config.authDomain,n,"auth-domain-config-required"),_(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:ye,eventId:i};if(e instanceof dn){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",nr(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[y,b]of Object.entries(s||{}))o[y]=b}if(e instanceof Te){const y=e.getScopes().filter(b=>b!=="");y.length>0&&(o.scopes=y.join(","))}n.tenantId&&(o.tid=n.tenantId);const c=o;for(const y of Object.keys(c))c[y]===void 0&&delete c[y];const a=await n._getAppCheckToken(),u=a?`#${Ao}=${encodeURIComponent(a)}`:"";return`${So(n)}?${fe(c).slice(1)}${u}`}function So({config:n}){return n.emulator?st(n,To):`https://${n.authDomain}/${Eo}`}/**
|
1427
1427
|
* @license
|
1428
1428
|
* Copyright 2020 Google LLC
|
1429
1429
|
*
|
@@ -1483,4 +1483,4 @@
|
|
1483
1483
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
1484
1484
|
* See the License for the specific language governing permissions and
|
1485
1485
|
* limitations under the License.
|
1486
|
-
*/const No=5*60,Do=wt("authIdTokenMaxAge")||No;let Nn=null;const Lo=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>Do)return;const i=t==null?void 0:t.token;Nn!==i&&(Nn=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function $o(n=ni()){const e=kt(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Xi(n,{popupRedirectResolver:Ro,persistence:[js,As,yn]}),r=wt("authTokenSyncURL");if(r){const s=Lo(r);bs(t,s,()=>s(t.currentUser)),vs(t,o=>s(o))}const i=zn("auth");return i&&es(t,`http://${i}`),t}function Mo(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}zi({loadJS(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=M("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Mo().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),ko("Browser");var Uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Dn={exports:{}};(function(n){(function(e){function t(l,m){var d=(l&65535)+(m&65535),w=(l>>16)+(m>>16)+(d>>16);return w<<16|d&65535}function r(l,m){return l<<m|l>>>32-m}function i(l,m,d,w,E,S){return t(r(t(t(m,l),t(w,S)),E),d)}function s(l,m,d,w,E,S,R){return i(m&d|~m&w,l,m,E,S,R)}function o(l,m,d,w,E,S,R){return i(m&w|d&~w,l,m,E,S,R)}function c(l,m,d,w,E,S,R){return i(m^d^w,l,m,E,S,R)}function a(l,m,d,w,E,S,R){return i(d^(m|~w),l,m,E,S,R)}function u(l,m){l[m>>5]|=128<<m%32,l[(m+64>>>9<<4)+14]=m;var d,w,E,S,R,h=1732584193,f=-271733879,p=-1732584194,g=271733878;for(d=0;d<l.length;d+=16)w=h,E=f,S=p,R=g,h=s(h,f,p,g,l[d],7,-680876936),g=s(g,h,f,p,l[d+1],12,-389564586),p=s(p,g,h,f,l[d+2],17,606105819),f=s(f,p,g,h,l[d+3],22,-1044525330),h=s(h,f,p,g,l[d+4],7,-176418897),g=s(g,h,f,p,l[d+5],12,1200080426),p=s(p,g,h,f,l[d+6],17,-1473231341),f=s(f,p,g,h,l[d+7],22,-45705983),h=s(h,f,p,g,l[d+8],7,1770035416),g=s(g,h,f,p,l[d+9],12,-1958414417),p=s(p,g,h,f,l[d+10],17,-42063),f=s(f,p,g,h,l[d+11],22,-1990404162),h=s(h,f,p,g,l[d+12],7,1804603682),g=s(g,h,f,p,l[d+13],12,-40341101),p=s(p,g,h,f,l[d+14],17,-1502002290),f=s(f,p,g,h,l[d+15],22,1236535329),h=o(h,f,p,g,l[d+1],5,-165796510),g=o(g,h,f,p,l[d+6],9,-1069501632),p=o(p,g,h,f,l[d+11],14,643717713),f=o(f,p,g,h,l[d],20,-373897302),h=o(h,f,p,g,l[d+5],5,-701558691),g=o(g,h,f,p,l[d+10],9,38016083),p=o(p,g,h,f,l[d+15],14,-660478335),f=o(f,p,g,h,l[d+4],20,-405537848),h=o(h,f,p,g,l[d+9],5,568446438),g=o(g,h,f,p,l[d+14],9,-1019803690),p=o(p,g,h,f,l[d+3],14,-187363961),f=o(f,p,g,h,l[d+8],20,1163531501),h=o(h,f,p,g,l[d+13],5,-1444681467),g=o(g,h,f,p,l[d+2],9,-51403784),p=o(p,g,h,f,l[d+7],14,1735328473),f=o(f,p,g,h,l[d+12],20,-1926607734),h=c(h,f,p,g,l[d+5],4,-378558),g=c(g,h,f,p,l[d+8],11,-2022574463),p=c(p,g,h,f,l[d+11],16,1839030562),f=c(f,p,g,h,l[d+14],23,-35309556),h=c(h,f,p,g,l[d+1],4,-1530992060),g=c(g,h,f,p,l[d+4],11,1272893353),p=c(p,g,h,f,l[d+7],16,-155497632),f=c(f,p,g,h,l[d+10],23,-1094730640),h=c(h,f,p,g,l[d+13],4,681279174),g=c(g,h,f,p,l[d],11,-358537222),p=c(p,g,h,f,l[d+3],16,-722521979),f=c(f,p,g,h,l[d+6],23,76029189),h=c(h,f,p,g,l[d+9],4,-640364487),g=c(g,h,f,p,l[d+12],11,-421815835),p=c(p,g,h,f,l[d+15],16,530742520),f=c(f,p,g,h,l[d+2],23,-995338651),h=a(h,f,p,g,l[d],6,-198630844),g=a(g,h,f,p,l[d+7],10,1126891415),p=a(p,g,h,f,l[d+14],15,-1416354905),f=a(f,p,g,h,l[d+5],21,-57434055),h=a(h,f,p,g,l[d+12],6,1700485571),g=a(g,h,f,p,l[d+3],10,-1894986606),p=a(p,g,h,f,l[d+10],15,-1051523),f=a(f,p,g,h,l[d+1],21,-2054922799),h=a(h,f,p,g,l[d+8],6,1873313359),g=a(g,h,f,p,l[d+15],10,-30611744),p=a(p,g,h,f,l[d+6],15,-1560198380),f=a(f,p,g,h,l[d+13],21,1309151649),h=a(h,f,p,g,l[d+4],6,-145523070),g=a(g,h,f,p,l[d+11],10,-1120210379),p=a(p,g,h,f,l[d+2],15,718787259),f=a(f,p,g,h,l[d+9],21,-343485551),h=t(h,w),f=t(f,E),p=t(p,S),g=t(g,R);return[h,f,p,g]}function y(l){var m,d="",w=l.length*32;for(m=0;m<w;m+=8)d+=String.fromCharCode(l[m>>5]>>>m%32&255);return d}function b(l){var m,d=[];for(d[(l.length>>2)-1]=void 0,m=0;m<d.length;m+=1)d[m]=0;var w=l.length*8;for(m=0;m<w;m+=8)d[m>>5]|=(l.charCodeAt(m/8)&255)<<m%32;return d}function A(l){return y(u(b(l),l.length*8))}function O(l,m){var d,w=b(l),E=[],S=[],R;for(E[15]=S[15]=void 0,w.length>16&&(w=u(w,l.length*8)),d=0;d<16;d+=1)E[d]=w[d]^909522486,S[d]=w[d]^1549556828;return R=u(E.concat(b(m)),512+m.length*8),y(u(S.concat(R),640))}function L(l){var m="0123456789abcdef",d="",w,E;for(E=0;E<l.length;E+=1)w=l.charCodeAt(E),d+=m.charAt(w>>>4&15)+m.charAt(w&15);return d}function v(l){return unescape(encodeURIComponent(l))}function I(l){return A(v(l))}function N(l){return L(I(l))}function C(l,m){return O(v(l),v(m))}function W(l,m){return L(C(l,m))}function $(l,m,d){return m?d?C(m,l):W(m,l):d?I(l):N(l)}n.exports?n.exports=$:e.md5=$})(Uo)})(Dn);var Bo=Dn.exports;const Fo=jo(Bo),mt=(n,e)=>async(t,r={})=>{const i=e?await e.getIdToken():null,s=await fetch(`${n}${t}`,{mode:"cors",...r,headers:{...i&&{authorization:`Bearer ${i}`},...r.body&&{"content-type":"application/json"},...r.headers},...r.body&&{body:JSON.stringify(r.body)}}),o=await s.json();if(s.status>202)throw Object.assign(new Error((o==null?void 0:o.message)||`HTTP Error ${s.status}`),{status:s.status,code:o==null?void 0:o.code,body:o});return o},Vo=n=>{const e=n.properties||{},t=n.inputProps||Object.keys(e),r=(i,s)=>{const o=e[i]||{};if([null,void 0].includes(s))return o.isRequired?{id:"value-missing-validation-error"}:void 0;if(o.enum)return o.enum.includes(s)?void 0:{id:"enum-validation-error",values:{enum:o.enum,value:s}};switch(o.type){case"integer":if(o.isScalar&&(typeof s!="number"||Number.isNaN(s)))return{id:"invalid-number-validation-error"};break;case"date":break;case"boolean":break;case"json":case"string":default:if(o.isRequired&&!s)return{id:"value-missing-validation-error"};break}};return{validate:i=>t.reduce((s,o)=>{const c=r(o,i[o]);return c?{...s,[o]:c}:s},{}),validateAttr:r}},Ho=(n={})=>Object.keys(n).length?`?q=${JSON.stringify(n)}`:"",Wo=n=>[...n].reduce((e,t)=>t===t.toUpperCase()?`${e}-${t.toLowerCase()}`:`${e}${t}`,""),xo=n=>`${n[0].toLowerCase()}${n.slice(1)}`,zo=n=>{const e=Wo(n);return(t,r)=>`/${e}${t?`/${encodeURIComponent(t)}`:""}${Ho(r)}`},Ln=(n,e)=>{const t=Array.isArray(e.inputProps);return Object.keys(n).reduce((r,i)=>{if(t&&!e.inputProps.includes(i))return r;const{isRef:s,isScalar:o,isRequired:c}=e.properties[i]||{};return s&&o&&!c&&n[i]===null?r:{...r,[i]:n[i]}},{})},qo=({primaryKey:n,properties:e,...t})=>({primaryKey:n||"id",properties:Object.keys(e||{}).reduce((r,i)=>{var b,A;const s=e[i]||{},{type:o,isScalar:c,isRequired:a,isRef:u=!1}=typeof s.type=="string"?s.type==="array"?s.enum?{type:"string",isScalar:!1,isRequired:!1}:(b=s.items)!=null&&b.$ref?{type:s.items.$ref.split("/").pop(),isScalar:!1,isRequired:!1,isRef:!0}:{type:(A=s.items)==null?void 0:A.type,isScalar:!1,isRequired:!1}:{type:s.format==="date-time"?"date":s.type,isScalar:!0,isRequired:!0}:Array.isArray(s.type)?s.type.length===2?{type:s.format==="date-time"?"date":s.type[0],isScalar:!0,isRequired:!1}:{type:"json",isScalar:!0,isRequired:s.type.includes("null")}:s.$ref?{type:s.$ref.split("/").pop(),isScalar:!0,isRequired:!0,isRef:!0}:{type:s.anyOf[0].$ref.split("/").pop(),isScalar:!0,isRequired:!1,isRef:!0},y=s.inputType||(o==="integer"?"number":o);return{...r,[i]:{...e[i],type:o,isScalar:c,isRequired:typeof s.isRequired=="boolean"?s.isRequired:a,isRef:u,inputType:y}}},{}),...t}),Jo=(n,e,t,r={},i={})=>{const s=qo(r),{primaryKey:o,properties:c}=s,a=Vo(s),u=zo(t),y=(...v)=>mt(n,e.authUser)(...v),b=({data:v,...I})=>y(u(null,I),{method:"POST",body:Ln(v,s)}),A=({data:v,...I})=>{const{where:N,...C}=I;return y(u(N[o],C),{method:"PUT",body:Ln(v,s)})},O=v=>{if(!v)return v;const I=Object.keys(v).reduce((N,C)=>{var E;const W=c[C]||{},{type:$,isScalar:l,isRef:m,format:d,items:w}=W;if(m){const S=xo($);return l?{...N,[C]:i[S].parse(v[C])}:{...N,[C]:typeof((E=i[S])==null?void 0:E.parse)=="function"?v[C].map(R=>i[S].parse(R)):v[C]}}return{...N,[C]:$==="date"&&v[C]?new Date(v[C]):v[C]}},{});return typeof s.parse=="function"?s.parse(I):I},L=Object.keys(c||{}).reduce((v,I)=>c[I].isRef&&c[I].isScalar&&c[I].isRequired?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),requiredOneToOne:v.requiredOneToOne.concat(I)}):c[I].isRef&&c[I].isScalar?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),optionalOneToOne:v.optionalOneToOne.concat(I)}):c[I].isRef?Object.assign(v,{all:v.all.concat(I),oneToMany:v.oneToMany.concat(I)}):v,{all:[],oneToOne:[],requiredOneToOne:[],optionalOneToOne:[],oneToMany:[]});return{get schema(){return s},get relations(){return L},parse:O,validateAttr:a.validateAttr,validate:a.validate,findMany:v=>y(u(null,v)).then(I=>I.map(O)),findById:(v,I)=>y(u(v,I)).then(O),create:b,update:A,upsert:v=>v.where[o]?A({where:v.where,data:v.update}):b({data:v.create}),delete:v=>y(u(v),{method:"DELETE"}),stats:()=>y(u("_stats")),search:(v,I={})=>{var d;const{searchProps:N}=s,W=v.split(" ").reduce((w,E)=>[...w,{OR:N.reduce((S,R)=>{const h=R.split(".");return[...S,h.reduceRight((f,p)=>({[p]:f}),{contains:E,mode:"insensitive"})]},[])}],[]),$={...I.select,...I.include},l=(d=s.defaultProps)!=null&&d.length?Object.assign(...s.defaultProps.map(w=>({[w]:!0}))):null,m=Object.keys($).length?$:l;return y(u(null,{where:{...I.where,AND:W},...!!m&&{select:m},...I.orderBy&&{orderBy:I.orderBy},take:I.take||100}))}}},Go=(n,e,t)=>Object.keys(t.properties).reduce((r,i)=>{const s=t.properties[i].$ref.split("/").pop();return Object.assign(r,{[i]:Jo(n,e,t.definitions[s].plural||`${i}s`,t.definitions[s],r)})},{}),Ko=(n,e)=>Object.keys(n.definitions).reduce((t,r)=>({...t,[r]:e[r]?{...n.definitions[r],...e[r],properties:Object.keys(n.definitions[r].properties).reduce((i,s)=>({...i,[s]:{...n.definitions[r].properties[s],...(e[r].properties||{})[s]}}),e[r].properties||{})}:n.definitions[r]}),{}),yt={$schema:"http://json-schema.org/draft-07/schema#",definitions:{Country:{type:"object",properties:{code:{type:"string"},name:{type:"string"},incomeFilter:{type:["integer","null"]},canApply:{type:"boolean",default:!1},capital:{type:"array",items:{type:"string"}},timeZone:{type:["string","null"]},flag:{type:["string","null"]},currency:{anyOf:[{$ref:"#/definitions/Currency"},{type:"null"}]},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},users:{type:"array",items:{$ref:"#/definitions/User"}},applications:{type:"array",items:{$ref:"#/definitions/Application"}},applicationNationalities:{type:"array",items:{$ref:"#/definitions/Application"}},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}},universities:{type:"array",items:{$ref:"#/definitions/University"}},companies:{type:"array",items:{$ref:"#/definitions/Company"}},jobs:{type:"array",items:{$ref:"#/definitions/Job"}}}},Currency:{type:"object",properties:{code:{type:"string"},name:{type:"string"},symbol:{type:"string"},countries:{type:"array",items:{$ref:"#/definitions/Country"}}}},User:{type:"object",properties:{uid:{type:"string"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},email:{type:"string"},firstName:{type:"string"},lastName:{type:["string","null"]},role:{type:["string","null"],enum:["staff","manager","finance","admin"]},disabled:{type:"boolean",default:!1},lang:{type:["string","null"],enum:["en","es","pt"]},referralSource:{type:["string","null"],enum:["word_of_mouth","codigo_m","social","google","print","tv","radio","other"]},identifiesAsFemale:{type:["boolean","null"]},dateOfBirth:{type:["string","null"],format:"date-time"},identificationNumber:{type:["string","null"]},mobileNumber:{type:["string","null"]},github:{type:["string","null"]},linkedin:{type:["string","null"]},bio:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},signupCohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]},applications:{type:"array",items:{$ref:"#/definitions/Application"}},contractsAsCheckPilot:{type:"array",items:{$ref:"#/definitions/Contract"}},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},messages:{type:"array",items:{$ref:"#/definitions/Message"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},authoredActivityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}}}},Track:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},programs:{type:"array",items:{$ref:"#/definitions/Program"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/CrawlerQuery"}},jobProfileTypes:{type:"array",items:{$ref:"#/definitions/JobProfileType"}},applicationChallenges:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}}}},Program:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},description:{type:["string","null"]},langs:{type:"array",enum:["en","es","pt"]},hidden:{type:"boolean",default:!1},track:{$ref:"#/definitions/Track"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}}}},Stage:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},order:{type:"integer"},program:{$ref:"#/definitions/Program"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}}}},Cohort:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},lang:{type:["string","null"],enum:["en","es","pt"]},start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"},timeZone:{type:["string","null"]},startTime:{type:["string","null"]},endTime:{type:["string","null"]},legacySlug:{type:"string"},vacancies:{type:["integer","null"]},admissionStart:{type:["string","null"],format:"date-time"},admissionEnd:{type:["string","null"],format:"date-time"},admissionCountries:{type:"array",items:{type:"string"}},placementStart:{type:["string","null"],format:"date-time"},placementDuration:{type:["integer","null"]},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},applications:{type:"array",items:{$ref:"#/definitions/Application"}},links:{type:"array",items:{$ref:"#/definitions/CohortLink"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},signupUsers:{type:"array",items:{$ref:"#/definitions/User"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}}}},Student:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},legacyStudentCode:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},projecTeamMembers:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},CohortLink:{type:"object",properties:{id:{type:"integer"},url:{type:"string"},visibility:{type:"string",enum:["public","members","staff","team","admin"]},cohort:{$ref:"#/definitions/Cohort"}}},Dropout:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},date:{type:"string",format:"date-time"},reasonDetail:{type:["string","null"]},notes:{type:["string","null"]},staffSad:{type:"boolean"},covidRelated:{type:["boolean","null"]},reason:{type:"string",enum:["dropout","noShow","invitedToLeave","changeCohort"]},completedProjects:{type:"integer"},lastProject:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},IscedLevel:{type:"object",properties:{id:{type:"integer"},label:{type:"string"},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}}}},EducationLevel:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},label:{type:"string"},country:{$ref:"#/definitions/Country"},iscedLevel:{$ref:"#/definitions/IscedLevel"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},University:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},name:{type:"string"},filter:{type:"boolean"},country:{$ref:"#/definitions/Country"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},Application:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},dateOfBirth:{type:"string",format:"date-time"},isAllowedToWork:{type:"boolean"},hasValidIdDocument:{type:"boolean"},locality:{type:["number","string","boolean","object","array","null"]},householdSize:{type:"integer"},children:{type:"integer"},householdIncome:{type:"integer"},racialIdentity:{type:["string","null"]},schoolType:{type:["string","null"],enum:["private","public","other","subsidized","mixed"]},educationSubject:{type:["string","null"],enum:["design_and_media","software_engineering","engineering","management_and_business","languages","science","health","social_sciences","arts","comms_and_advertising","education","cooking","tourism","economics_and_accounting","law","other"]},isStudying:{type:"boolean"},englishLevel:{type:["string","null"],enum:["NO","A1","A2","B1","B2","C1","C2"]},workStatus:{type:"string",enum:["never","not_now","yes"]},isLookingForWork:{type:["boolean","null"]},monthsLookingForWork:{type:["integer","null"]},monthsUnemployed:{type:["integer","null"]},workRole:{type:["string","null"],enum:["waitress","promoter","manager","cashier","intern","operative","call_center","receptionist","sales_agent","assistant","professional","technical","consultant","other"]},freelance:{type:["boolean","null"]},workFormal:{type:["boolean","null"]},workIncome:{type:["integer","null"]},failedFilters:{type:"array",items:{type:"string"}},bypassFilters:{type:"boolean",default:!1},isReady:{type:"boolean",default:!1},isReturningApplicant:{type:["boolean","null"]},legacyAdmissionCohortSlug:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},country:{$ref:"#/definitions/Country"},nationality:{$ref:"#/definitions/Country"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{anyOf:[{$ref:"#/definitions/University"},{type:"null"}]},challengeAssignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}},config:{maxAge:120}},ApplicationChallenge:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},slug:{type:"string"},version:{type:"string"},trackId:{type:"integer"},tracks:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}},langs:{type:"array",enum:["en","es","pt"]},json:{type:"string"},archived:{type:"boolean",default:!1},assignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallengeAssignment:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},application:{$ref:"#/definitions/Application"},challenge:{$ref:"#/definitions/ApplicationChallenge"}}},ApplicationChallengeTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},track:{$ref:"#/definitions/Track"}}},ActivityLogEntry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},type:{type:"string",enum:["challenge","application_filter","application_filter_bypass","application_cohort_change","project_assessment","project_assessment_request","project_assessment_assignment"]},data:{type:["number","string","boolean","object","array","null"]},path:{type:"string"},author:{$ref:"#/definitions/User"},user:{$ref:"#/definitions/User"},cohort:{$ref:"#/definitions/Cohort"}}},StudentProject:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},projectSlug:{type:"string"},projectVersion:{type:"string"},links:{type:"array",items:{$ref:"#/definitions/StudentProjectLink"}},team:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},StudentProjecTeamMember:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"},student:{$ref:"#/definitions/Student"}}},StudentProjectLink:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},url:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"}}},Contract:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},isEmployment:{type:"boolean"},feeAmount:{type:"integer"},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},isTrial:{type:"boolean",default:!1},source:{type:["string","null"],enum:["graduate","referral","jazzhr","web","linkedin","other"]},checkPilot:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},country:{$ref:"#/definitions/Country"},user:{$ref:"#/definitions/User"},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}}}},Gig:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},role:{type:"string",enum:["bm","pdc","js","ux"]},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},cohort:{$ref:"#/definitions/Cohort"},contract:{$ref:"#/definitions/Contract"},user:{$ref:"#/definitions/User"}}},Message:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},key:{type:"string"},from:{type:"string"},to:{type:"string"},transport:{type:"string",enum:["mandrill","slack"]},status:{type:"string",default:"PENDING",enum:["PENDING","QUEUED","ERROR","SENT"]},data:{type:["number","string","boolean","object","array","null"]},taskInfo:{type:["number","string","boolean","object","array","null"]},user:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},logs:{type:"array",items:{$ref:"#/definitions/MessageLog"}}}},MessageLog:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},statusText:{type:["string","null"]},message:{$ref:"#/definitions/Message"}}},Industry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},companies:{type:"array",items:{$ref:"#/definitions/Company"}}}},Company:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},name:{type:"string"},size:{type:["string","null"],enum:["A_2_10","B_11_50","C_51_200","D_201_500","E_501_1000","F_1001_5000","G_5001_10000","H_10001_plus"]},data:{type:["number","string","boolean","object","array","null"]},web:{type:["string","null"]},twitter:{type:["string","null"]},github:{type:["string","null"]},facebook:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},industry:{anyOf:[{$ref:"#/definitions/Industry"},{type:"null"}]},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},categories:{type:"array",enum:["Tech_Consultancy","Digital_Transformation","Agency","Startups","High_tech","Traditional_Consulting"]}}},Job:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},title:{type:"string"},publishedAt:{type:"string",format:"date-time"},modality:{type:"string"},publicUrl:{type:["string","null"]},location:{type:["string","null"]},data:{type:["number","string","boolean","object","array","null"]},description:{type:["string","null"]},descriptionHTML:{type:["string","null"]},functions:{type:["string","null"]},functionsHTML:{type:["string","null"]},seniority:{type:["string","null"]},remote:{type:["boolean","null"]},remoteOption:{type:["string","null"],enum:["remote_for_now","locally_remote","fully_remote","no_remote","mixed"]},lang:{type:["string","null"],enum:["en","es","pt"]},maxSalary:{type:["integer","null"]},minSalary:{type:["integer","null"]},tags:{type:"array",items:{type:"string"}},company:{$ref:"#/definitions/Company"},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},applications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}},crawlerLocations:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},learningObjectives:{type:["number","string","boolean","object","array","null"]},track:{anyOf:[{$ref:"#/definitions/Track"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReview:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},isValid:{type:"boolean"},invalidReason:{type:["string","null"],enum:["unrelated","experience","qualifications","other"]},comment:{type:["string","null"]},author:{$ref:"#/definitions/User"},job:{$ref:"#/definitions/Job"},profileTypes:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReviewProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},profileType:{$ref:"#/definitions/JobProfileType"}}},JobApplication:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",default:"pending",enum:["pending","applied","interview","challenge","followup","hired","not_hired"]},hireDate:{type:["string","null"],format:"date-time"},jobStartDate:{type:["string","null"],format:"date-time"},netSalary:{type:["integer","null"]},grossSalary:{type:["integer","null"]},currency:{type:["string","null"]},job:{$ref:"#/definitions/Job"},user:{$ref:"#/definitions/User"},cohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]}}},CrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},query:{type:"string"},enabled:{type:"boolean",default:!0},track:{$ref:"#/definitions/Track"},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}}}},JobCrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},query:{$ref:"#/definitions/CrawlerQuery"}}},CrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},enabled:{type:"boolean",default:!0},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobCrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},location:{$ref:"#/definitions/CrawlerLocation"}}}},type:"object",properties:{country:{$ref:"#/definitions/Country"},currency:{$ref:"#/definitions/Currency"},user:{$ref:"#/definitions/User"},track:{$ref:"#/definitions/Track"},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},cohort:{$ref:"#/definitions/Cohort"},student:{$ref:"#/definitions/Student"},cohortLink:{$ref:"#/definitions/CohortLink"},dropout:{$ref:"#/definitions/Dropout"},iscedLevel:{$ref:"#/definitions/IscedLevel"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{$ref:"#/definitions/University"},application:{$ref:"#/definitions/Application"},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},applicationChallengeAssignment:{$ref:"#/definitions/ApplicationChallengeAssignment"},applicationChallengeTrack:{$ref:"#/definitions/ApplicationChallengeTrack"},activityLogEntry:{$ref:"#/definitions/ActivityLogEntry"},studentProject:{$ref:"#/definitions/StudentProject"},studentProjecTeamMember:{$ref:"#/definitions/StudentProjecTeamMember"},studentProjectLink:{$ref:"#/definitions/StudentProjectLink"},contract:{$ref:"#/definitions/Contract"},gig:{$ref:"#/definitions/Gig"},message:{$ref:"#/definitions/Message"},messageLog:{$ref:"#/definitions/MessageLog"},industry:{$ref:"#/definitions/Industry"},company:{$ref:"#/definitions/Company"},job:{$ref:"#/definitions/Job"},jobProfileType:{$ref:"#/definitions/JobProfileType"},jobReview:{$ref:"#/definitions/JobReview"},jobReviewProfileType:{$ref:"#/definitions/JobReviewProfileType"},jobApplication:{$ref:"#/definitions/JobApplication"},crawlerQuery:{$ref:"#/definitions/CrawlerQuery"},jobCrawlerQuery:{$ref:"#/definitions/JobCrawlerQuery"},crawlerLocation:{$ref:"#/definitions/CrawlerLocation"},jobCrawlerLocation:{$ref:"#/definitions/JobCrawlerLocation"}}},$n=24*(60*60*1e3),Yo={Country:{primaryKey:"code",plural:"countries",searchProps:["code","name","timeZone"],defaultProps:["code","name","timeZone","currency"],getOptionLabel:({code:n,name:e})=>`${n} / ${e}`},ActivityLogEntry:{plural:"activityLog"},User:{primaryKey:"uid",inputProps:["firstName","lastName","email","password","lang","identifiesAsFemale","dateOfBirth","country","identificationNumber","mobileNumber","github","linkedin","bio","role","signupCohort","disabled","referralSource"],searchProps:["firstName","lastName","email"],getOptionLabel:({firstName:n,lastName:e,email:t})=>`${n} ${e} (${t})`,properties:{email:{inputType:"email"},lastName:{isRequired:!0},mobileNumber:{inputType:"phone"},bio:{inputType:"textarea"}},parse:n=>{const e=n.github?`https://github.com/${n.github}.png?size=`:`https://www.gravatar.com/avatar/${Fo(n.email)}?s=`;return{...n,fullName:`${n.firstName||""}${n.lastName?` ${n.lastName}`:""}`,avatar:t=>`${e}${t}`,isStaff:["staff","manager","finance","admin"].includes(n.role),isManager:["manager","finance","admin"].includes(n.role),isFinance:["finance","admin"].includes(n.role),isAdmin:n.role==="admin"}}},Track:{searchProps:["name"]},Program:{searchProps:["name"]},Stage:{searchProps:["name"]},Cohort:{inputProps:["program","stage","lang","name","start","end","timeZone","startTime","endTime","vacancies","admissionStart","admissionEnd","placementStart","admissionCountries"],searchProps:["name"],getOptionLabel:({id:n,name:e,stage:t})=>`${e}${t?` - ${t.name}`:""} (id: ${n})`,properties:{},parse:n=>{var s,o;const e=Date.now();let t;if(n.placementStart){const c=n.placementDuration||270;new Date(+n.placementStart+c*24*60*60*1e3)<e?t="placement_ended":n.placementStart<e&&(t="placement_started")}!t&&n.end<e&&(t="ended"),!t&&n.start<e&&(t="started");const r=n.admissionEnd?+n.admissionEnd+$n:!1;!t&&r&&r<e&&(t="admission_ended"),!t&&n.admissionStart&&n.admissionStart<e&&(t="admission_started"),!t&&n.admissionStart&&n.admissionEnd&&(t="planned"),t||(t="draft");const i=n.start>e&&n.vacancies?n.vacancies:((s=n._count)==null?void 0:s.students)||((o=n.students)==null?void 0:o.length)||0;return{...n,status:t,size:i}}},Student:{inputProps:["cohort","user"],searchProps:["user.firstName","user.lastName","user.email"],defaultProps:["id","cohort","user"],getOptionLabel:({user:n,cohort:e})=>`${n==null?void 0:n.firstName} ${(n==null?void 0:n.lastName)||""} (${e==null?void 0:e.name})`},Dropout:{inputProps:["cohort","user","date","reason","reasonDetail","lastProject","completedProjects","notes","staffSad","covidRelated"],searchProps:["user.uid","user.firstName","user.lastName","user.email","cohort.name"]},Contract:{inputProps:["user","country","isEmployment","feeAmount","hoursPerWeek","start","end","isTrial","checkPilot","source"],searchProps:["user.firstName","user.lastName","user.email"],getOptionLabel:({id:n,user:e})=>`${e==null?void 0:e.firstName} (id: ${n})`},Gig:{inputProps:["cohort","user","contract","role","hoursPerWeek","start","end"]},Application:{inputProps:["user","cohort","dateOfBirth","country","locality","nationality","isAllowedToWork","hasValidIdDocument","householdSize","children","householdIncome","racialIdentity","educationLevel","schoolType","educationSubject","university","isStudying","englishLevel","workStatus","isLookingForWork","monthsLookingForWork","monthsUnemployed","workRole","freelance","workFormal","workIncome","isReady","bypassFilters"],properties:{locality:{isRequired:!0},englishLevel:{isRequired:!0},isReady:{isRequired:!1},bypassFilters:{isRequired:!1}},parse:n=>{var s,o,c;const e=typeof n.hasFailedFilters=="boolean"?n.hasFailedFilters:typeof((s=n.failedFilters)==null?void 0:s.length)=="number"?n.failedFilters.length>0:void 0;if(!((o=n.cohort)!=null&&o.admissionEnd)||typeof e>"u")return n;const t=Date.now(),{maxAge:r}=yt.definitions.Application.config;let i;return n.isReady?i="ready":e&&!n.bypassFilters?i="rejected":n.createdAt<t-r*$n?i="expired":((c=n.cohort)==null?void 0:c.status)!=="admission_started"?i="admission_ended":i="active",{...n,status:i}}},IscedLevel:{parse:n=>{const e=Math.floor(n.id/10);return{...n,level:e,completed:e*10<n.id}}},EducationLevel:{searchProps:["label"]},University:{plural:"universities",searchProps:["name"]},Company:{plural:"companies"},CrawlerQuery:{plural:"crawlerQueries"},JobCrawlerQuery:{plural:"jobCrawlerQueries"}},Qo=(n,e)=>({...Go(n,e,{...yt,definitions:Ko(yt,Yo)}),gcpLog:{getEntries:async t=>await mt(n,e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)}}),Xo=(n,e)=>{const t=mt(n,e.authUser);return{project:{findMany:(r={})=>t(`/projects?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/projects/${r}?q=${JSON.stringify(i)}`)},topic:{findMany:(r={})=>t(`/topics?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/topics/${r}?q=${JSON.stringify(i)}`)},learningObjective:{findMany:(r={})=>t(`/learning-objectives?q=${JSON.stringify(r)}`)}}},We=n=>n>9?`${n}`:`0${n}`,Mn=n=>`${We(n.getUTCDate())}/${We(n.getUTCMonth()+1)}/${n.getUTCFullYear()}`,Un=n=>`${We(n.getUTCHours())}:${We(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`,Zo=n=>`${Mn(n)} ${Un(n)}`,ea={es:"es-ES",pt:"pt-BR"},ta=(n,e="es",t=!1)=>new Intl.DateTimeFormat(ea[e],{...t&&{year:"numeric"},month:"long",day:"numeric",timeZone:"UTC"}).format(new Date(n)),na=(n,e)=>{let t=e.getFullYear()-n.getFullYear();const r=e.getMonth()-n.getMonth();return(r<0||r===0&&e.getDate()<n.getDate())&&t--,t},ra=(n,e,t)=>{const r=i=>new Intl.NumberFormat(`${i}-${e}`,{currency:t});return r(e==="CR"?"en":n)},ia=(n,e,t,r)=>ra(e,t,r).format(n),sa=n=>parseInt(n.replace(/[,\.]/g,""),10),oa=n=>{try{return JSON.parse(window.localStorage.getItem(n))}catch{return null}},aa=({firebaseApiKey:n="AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",firebaseProject:e="laboratoria-la",coreApiUrl:t="https://us-central1-outpost-272720.cloudfunctions.net/core-api"}={})=>{const r=Nt({apiKey:n,authDomain:`${e}.firebaseapp.com`,databaseURL:`https://${e}.firebaseio.com`,projectId:e}),i=$o(r),s={authUser:void 0,user:void 0},o=Qo(t,s);return{...Xo(t,s),...o,auth:{onChange:u=>Is(i,y=>{if(!y)return Object.assign(s,{authUser:null,user:null}),u(s);Object.assign(s,{authUser:y}),o.user.findById(y.uid).then(b=>{Object.assign(s,{user:b}),u(s)}).catch(b=>{console.error(b),Object.assign(s,{authUser:null,user:null}),u(s)})}),signIn:(u,y)=>_s(i,u,y),signOut:()=>ws(i),sendPasswordResetEmail:u=>ys(i,u)},firebaseApp:r}};k.createApp=aa,k.formatCurrency=ia,k.formatDate=Mn,k.formatDateTime=Zo,k.formatMonth=ta,k.formatTime=Un,k.getAgeAt=na,k.loadFromLocalStorage=oa,k.parseCurrency=sa,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
1486
|
+
*/const No=5*60,Do=wt("authIdTokenMaxAge")||No;let Nn=null;const Lo=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>Do)return;const i=t==null?void 0:t.token;Nn!==i&&(Nn=i,await fetch(n,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function $o(n=ni()){const e=kt(n,"auth");if(e.isInitialized())return e.getImmediate();const t=Xi(n,{popupRedirectResolver:Ro,persistence:[js,Ss,yn]}),r=wt("authTokenSyncURL");if(r){const s=Lo(r);bs(t,s,()=>s(t.currentUser)),vs(t,o=>s(o))}const i=zn("auth");return i&&es(t,`http://${i}`),t}function Mo(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}zi({loadJS(n){return new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const s=M("internal-error");s.customData=i,t(s)},r.type="text/javascript",r.charset="UTF-8",Mo().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),ko("Browser");var Uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Dn={exports:{}};(function(n){(function(e){function t(l,m){var d=(l&65535)+(m&65535),w=(l>>16)+(m>>16)+(d>>16);return w<<16|d&65535}function r(l,m){return l<<m|l>>>32-m}function i(l,m,d,w,E,A){return t(r(t(t(m,l),t(w,A)),E),d)}function s(l,m,d,w,E,A,R){return i(m&d|~m&w,l,m,E,A,R)}function o(l,m,d,w,E,A,R){return i(m&w|d&~w,l,m,E,A,R)}function c(l,m,d,w,E,A,R){return i(m^d^w,l,m,E,A,R)}function a(l,m,d,w,E,A,R){return i(d^(m|~w),l,m,E,A,R)}function u(l,m){l[m>>5]|=128<<m%32,l[(m+64>>>9<<4)+14]=m;var d,w,E,A,R,h=1732584193,f=-271733879,p=-1732584194,g=271733878;for(d=0;d<l.length;d+=16)w=h,E=f,A=p,R=g,h=s(h,f,p,g,l[d],7,-680876936),g=s(g,h,f,p,l[d+1],12,-389564586),p=s(p,g,h,f,l[d+2],17,606105819),f=s(f,p,g,h,l[d+3],22,-1044525330),h=s(h,f,p,g,l[d+4],7,-176418897),g=s(g,h,f,p,l[d+5],12,1200080426),p=s(p,g,h,f,l[d+6],17,-1473231341),f=s(f,p,g,h,l[d+7],22,-45705983),h=s(h,f,p,g,l[d+8],7,1770035416),g=s(g,h,f,p,l[d+9],12,-1958414417),p=s(p,g,h,f,l[d+10],17,-42063),f=s(f,p,g,h,l[d+11],22,-1990404162),h=s(h,f,p,g,l[d+12],7,1804603682),g=s(g,h,f,p,l[d+13],12,-40341101),p=s(p,g,h,f,l[d+14],17,-1502002290),f=s(f,p,g,h,l[d+15],22,1236535329),h=o(h,f,p,g,l[d+1],5,-165796510),g=o(g,h,f,p,l[d+6],9,-1069501632),p=o(p,g,h,f,l[d+11],14,643717713),f=o(f,p,g,h,l[d],20,-373897302),h=o(h,f,p,g,l[d+5],5,-701558691),g=o(g,h,f,p,l[d+10],9,38016083),p=o(p,g,h,f,l[d+15],14,-660478335),f=o(f,p,g,h,l[d+4],20,-405537848),h=o(h,f,p,g,l[d+9],5,568446438),g=o(g,h,f,p,l[d+14],9,-1019803690),p=o(p,g,h,f,l[d+3],14,-187363961),f=o(f,p,g,h,l[d+8],20,1163531501),h=o(h,f,p,g,l[d+13],5,-1444681467),g=o(g,h,f,p,l[d+2],9,-51403784),p=o(p,g,h,f,l[d+7],14,1735328473),f=o(f,p,g,h,l[d+12],20,-1926607734),h=c(h,f,p,g,l[d+5],4,-378558),g=c(g,h,f,p,l[d+8],11,-2022574463),p=c(p,g,h,f,l[d+11],16,1839030562),f=c(f,p,g,h,l[d+14],23,-35309556),h=c(h,f,p,g,l[d+1],4,-1530992060),g=c(g,h,f,p,l[d+4],11,1272893353),p=c(p,g,h,f,l[d+7],16,-155497632),f=c(f,p,g,h,l[d+10],23,-1094730640),h=c(h,f,p,g,l[d+13],4,681279174),g=c(g,h,f,p,l[d],11,-358537222),p=c(p,g,h,f,l[d+3],16,-722521979),f=c(f,p,g,h,l[d+6],23,76029189),h=c(h,f,p,g,l[d+9],4,-640364487),g=c(g,h,f,p,l[d+12],11,-421815835),p=c(p,g,h,f,l[d+15],16,530742520),f=c(f,p,g,h,l[d+2],23,-995338651),h=a(h,f,p,g,l[d],6,-198630844),g=a(g,h,f,p,l[d+7],10,1126891415),p=a(p,g,h,f,l[d+14],15,-1416354905),f=a(f,p,g,h,l[d+5],21,-57434055),h=a(h,f,p,g,l[d+12],6,1700485571),g=a(g,h,f,p,l[d+3],10,-1894986606),p=a(p,g,h,f,l[d+10],15,-1051523),f=a(f,p,g,h,l[d+1],21,-2054922799),h=a(h,f,p,g,l[d+8],6,1873313359),g=a(g,h,f,p,l[d+15],10,-30611744),p=a(p,g,h,f,l[d+6],15,-1560198380),f=a(f,p,g,h,l[d+13],21,1309151649),h=a(h,f,p,g,l[d+4],6,-145523070),g=a(g,h,f,p,l[d+11],10,-1120210379),p=a(p,g,h,f,l[d+2],15,718787259),f=a(f,p,g,h,l[d+9],21,-343485551),h=t(h,w),f=t(f,E),p=t(p,A),g=t(g,R);return[h,f,p,g]}function y(l){var m,d="",w=l.length*32;for(m=0;m<w;m+=8)d+=String.fromCharCode(l[m>>5]>>>m%32&255);return d}function b(l){var m,d=[];for(d[(l.length>>2)-1]=void 0,m=0;m<d.length;m+=1)d[m]=0;var w=l.length*8;for(m=0;m<w;m+=8)d[m>>5]|=(l.charCodeAt(m/8)&255)<<m%32;return d}function S(l){return y(u(b(l),l.length*8))}function O(l,m){var d,w=b(l),E=[],A=[],R;for(E[15]=A[15]=void 0,w.length>16&&(w=u(w,l.length*8)),d=0;d<16;d+=1)E[d]=w[d]^909522486,A[d]=w[d]^1549556828;return R=u(E.concat(b(m)),512+m.length*8),y(u(A.concat(R),640))}function L(l){var m="0123456789abcdef",d="",w,E;for(E=0;E<l.length;E+=1)w=l.charCodeAt(E),d+=m.charAt(w>>>4&15)+m.charAt(w&15);return d}function v(l){return unescape(encodeURIComponent(l))}function I(l){return S(v(l))}function N(l){return L(I(l))}function C(l,m){return O(v(l),v(m))}function W(l,m){return L(C(l,m))}function $(l,m,d){return m?d?C(m,l):W(m,l):d?I(l):N(l)}n.exports?n.exports=$:e.md5=$})(Uo)})(Dn);var Bo=Dn.exports;const Fo=jo(Bo),mt=(n,e)=>async(t,r={})=>{const i=e?await e.getIdToken():null,s=await fetch(`${n}${t}`,{mode:"cors",...r,headers:{...i&&{authorization:`Bearer ${i}`},...r.body&&{"content-type":"application/json"},...r.headers},...r.body&&{body:JSON.stringify(r.body)}}),o=await s.json();if(s.status>202)throw Object.assign(new Error((o==null?void 0:o.message)||`HTTP Error ${s.status}`),{status:s.status,code:o==null?void 0:o.code,body:o});return o},Vo=n=>{const e=n.properties||{},t=n.inputProps||Object.keys(e),r=(i,s)=>{const o=e[i]||{};if([null,void 0].includes(s))return o.isRequired?{id:"value-missing-validation-error"}:void 0;if(o.enum)return o.enum.includes(s)?void 0:{id:"enum-validation-error",values:{enum:o.enum,value:s}};switch(o.type){case"integer":if(o.isScalar&&(typeof s!="number"||Number.isNaN(s)))return{id:"invalid-number-validation-error"};break;case"date":break;case"boolean":break;case"json":case"string":default:if(o.isRequired&&!s)return{id:"value-missing-validation-error"};break}};return{validate:i=>t.reduce((s,o)=>{const c=r(o,i[o]);return c?{...s,[o]:c}:s},{}),validateAttr:r}},Ho=(n={})=>Object.keys(n).length?`?q=${JSON.stringify(n)}`:"",Wo=n=>[...n].reduce((e,t)=>t===t.toUpperCase()?`${e}-${t.toLowerCase()}`:`${e}${t}`,""),xo=n=>`${n[0].toLowerCase()}${n.slice(1)}`,zo=n=>{const e=Wo(n);return(t,r)=>`/${e}${t?`/${encodeURIComponent(t)}`:""}${Ho(r)}`},Ln=(n,e)=>{const t=Array.isArray(e.inputProps);return Object.keys(n).reduce((r,i)=>{if(t&&!e.inputProps.includes(i))return r;const{isRef:s,isScalar:o,isRequired:c}=e.properties[i]||{};return s&&o&&!c&&n[i]===null?r:{...r,[i]:n[i]}},{})},qo=({primaryKey:n,properties:e,...t})=>({primaryKey:n||"id",properties:Object.keys(e||{}).reduce((r,i)=>{var b,S;const s=e[i]||{},{type:o,isScalar:c,isRequired:a,isRef:u=!1}=typeof s.type=="string"?s.type==="array"?s.enum?{type:"string",isScalar:!1,isRequired:!1}:(b=s.items)!=null&&b.$ref?{type:s.items.$ref.split("/").pop(),isScalar:!1,isRequired:!1,isRef:!0}:{type:(S=s.items)==null?void 0:S.type,isScalar:!1,isRequired:!1}:{type:s.format==="date-time"?"date":s.type,isScalar:!0,isRequired:!0}:Array.isArray(s.type)?s.type.length===2?{type:s.format==="date-time"?"date":s.type[0],isScalar:!0,isRequired:!1}:{type:"json",isScalar:!0,isRequired:s.type.includes("null")}:s.$ref?{type:s.$ref.split("/").pop(),isScalar:!0,isRequired:!0,isRef:!0}:{type:s.anyOf[0].$ref.split("/").pop(),isScalar:!0,isRequired:!1,isRef:!0},y=s.inputType||(o==="integer"?"number":o);return{...r,[i]:{...e[i],type:o,isScalar:c,isRequired:typeof s.isRequired=="boolean"?s.isRequired:a,isRef:u,inputType:y}}},{}),...t}),Jo=(n,e,t,r={},i={})=>{const s=qo(r),{primaryKey:o,properties:c}=s,a=Vo(s),u=zo(t),y=(...v)=>mt(n,e.authUser)(...v),b=({data:v,...I})=>y(u(null,I),{method:"POST",body:Ln(v,s)}),S=({data:v,...I})=>{const{where:N,...C}=I;return y(u(N[o],C),{method:"PUT",body:Ln(v,s)})},O=v=>{if(!v)return v;const I=Object.keys(v).reduce((N,C)=>{var E;const W=c[C]||{},{type:$,isScalar:l,isRef:m,format:d,items:w}=W;if(m){const A=xo($);return l?{...N,[C]:i[A].parse(v[C])}:{...N,[C]:typeof((E=i[A])==null?void 0:E.parse)=="function"?v[C].map(R=>i[A].parse(R)):v[C]}}return{...N,[C]:$==="date"&&v[C]?new Date(v[C]):v[C]}},{});return typeof s.parse=="function"?s.parse(I):I},L=Object.keys(c||{}).reduce((v,I)=>c[I].isRef&&c[I].isScalar&&c[I].isRequired?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),requiredOneToOne:v.requiredOneToOne.concat(I)}):c[I].isRef&&c[I].isScalar?Object.assign(v,{all:v.all.concat(I),oneToOne:v.oneToOne.concat(I),optionalOneToOne:v.optionalOneToOne.concat(I)}):c[I].isRef?Object.assign(v,{all:v.all.concat(I),oneToMany:v.oneToMany.concat(I)}):v,{all:[],oneToOne:[],requiredOneToOne:[],optionalOneToOne:[],oneToMany:[]});return{get schema(){return s},get relations(){return L},parse:O,validateAttr:a.validateAttr,validate:a.validate,findMany:v=>y(u(null,v)).then(I=>I.map(O)),findById:(v,I)=>y(u(v,I)).then(O),create:b,update:S,upsert:v=>v.where[o]?S({where:v.where,data:v.update}):b({data:v.create}),delete:v=>y(u(v),{method:"DELETE"}),stats:()=>y(u("_stats")),search:(v,I={})=>{var d;const{searchProps:N}=s,W=v.split(" ").reduce((w,E)=>[...w,{OR:N.reduce((A,R)=>{const h=R.split(".");return[...A,h.reduceRight((f,p)=>({[p]:f}),{contains:E,mode:"insensitive"})]},[])}],[]),$={...I.select,...I.include},l=(d=s.defaultProps)!=null&&d.length?Object.assign(...s.defaultProps.map(w=>({[w]:!0}))):null,m=Object.keys($).length?$:l;return y(u(null,{where:{...I.where,AND:W},...!!m&&{select:m},...I.orderBy&&{orderBy:I.orderBy},take:I.take||100}))}}},Go=(n,e,t)=>Object.keys(t.properties).reduce((r,i)=>{const s=t.properties[i].$ref.split("/").pop();return Object.assign(r,{[i]:Jo(n,e,t.definitions[s].plural||`${i}s`,t.definitions[s],r)})},{}),Ko=(n,e)=>Object.keys(n.definitions).reduce((t,r)=>({...t,[r]:e[r]?{...n.definitions[r],...e[r],properties:Object.keys(n.definitions[r].properties).reduce((i,s)=>({...i,[s]:{...n.definitions[r].properties[s],...(e[r].properties||{})[s]}}),e[r].properties||{})}:n.definitions[r]}),{}),yt={$schema:"http://json-schema.org/draft-07/schema#",definitions:{Country:{type:"object",properties:{code:{type:"string"},name:{type:"string"},incomeFilter:{type:["integer","null"]},canApply:{type:"boolean",default:!1},capital:{type:"array",items:{type:"string"}},timeZone:{type:["string","null"]},flag:{type:["string","null"]},currency:{anyOf:[{$ref:"#/definitions/Currency"},{type:"null"}]},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},users:{type:"array",items:{$ref:"#/definitions/User"}},applications:{type:"array",items:{$ref:"#/definitions/Application"}},applicationNationalities:{type:"array",items:{$ref:"#/definitions/Application"}},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}},universities:{type:"array",items:{$ref:"#/definitions/University"}},companies:{type:"array",items:{$ref:"#/definitions/Company"}},jobs:{type:"array",items:{$ref:"#/definitions/Job"}}}},Currency:{type:"object",properties:{code:{type:"string"},name:{type:"string"},symbol:{type:"string"},countries:{type:"array",items:{$ref:"#/definitions/Country"}}}},User:{type:"object",properties:{uid:{type:"string"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},email:{type:"string"},firstName:{type:"string"},lastName:{type:["string","null"]},role:{type:["string","null"],enum:["staff","manager","finance","admin"]},disabled:{type:"boolean",default:!1},lang:{type:["string","null"],enum:["en","es","pt"]},referralSource:{type:["string","null"],enum:["word_of_mouth","codigo_m","social","google","print","tv","radio","other"]},identifiesAsFemale:{type:["boolean","null"]},dateOfBirth:{type:["string","null"],format:"date-time"},identificationNumber:{type:["string","null"]},mobileNumber:{type:["string","null"]},github:{type:["string","null"]},linkedin:{type:["string","null"]},bio:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},signupCohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]},applications:{type:"array",items:{$ref:"#/definitions/Application"}},contractsAsCheckPilot:{type:"array",items:{$ref:"#/definitions/Contract"}},contracts:{type:"array",items:{$ref:"#/definitions/Contract"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},messages:{type:"array",items:{$ref:"#/definitions/Message"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},authoredActivityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobReviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}}}},Track:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},programs:{type:"array",items:{$ref:"#/definitions/Program"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/CrawlerQuery"}},jobProfileTypes:{type:"array",items:{$ref:"#/definitions/JobProfileType"}},applicationChallenges:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}}}},Program:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},description:{type:["string","null"]},langs:{type:"array",enum:["en","es","pt"]},hidden:{type:"boolean",default:!1},track:{$ref:"#/definitions/Track"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}},stages:{type:"array",items:{$ref:"#/definitions/Stage"}}}},Stage:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},name:{type:"string"},order:{type:"integer"},program:{$ref:"#/definitions/Program"},cohorts:{type:"array",items:{$ref:"#/definitions/Cohort"}}}},Cohort:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},lang:{type:["string","null"],enum:["en","es","pt"]},start:{type:"string",format:"date-time"},end:{type:"string",format:"date-time"},timeZone:{type:["string","null"]},startTime:{type:["string","null"]},endTime:{type:["string","null"]},legacySlug:{type:"string"},vacancies:{type:["integer","null"]},admissionStart:{type:["string","null"],format:"date-time"},admissionEnd:{type:["string","null"],format:"date-time"},admissionCountries:{type:"array",items:{type:"string"}},placementStart:{type:["string","null"],format:"date-time"},placementDuration:{type:["integer","null"]},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},applications:{type:"array",items:{$ref:"#/definitions/Application"}},links:{type:"array",items:{$ref:"#/definitions/CohortLink"}},dropouts:{type:"array",items:{$ref:"#/definitions/Dropout"}},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}},students:{type:"array",items:{$ref:"#/definitions/Student"}},signupUsers:{type:"array",items:{$ref:"#/definitions/User"}},activityLog:{type:"array",items:{$ref:"#/definitions/ActivityLogEntry"}},jobApplications:{type:"array",items:{$ref:"#/definitions/JobApplication"}}}},Student:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},legacyStudentCode:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},projecTeamMembers:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},CohortLink:{type:"object",properties:{id:{type:"integer"},url:{type:"string"},visibility:{type:"string",enum:["public","members","staff","team","admin"]},cohort:{$ref:"#/definitions/Cohort"}}},Dropout:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},date:{type:"string",format:"date-time"},reasonDetail:{type:["string","null"]},notes:{type:["string","null"]},staffSad:{type:"boolean"},covidRelated:{type:["boolean","null"]},reason:{type:"string",enum:["dropout","noShow","invitedToLeave","changeCohort"]},completedProjects:{type:"integer"},lastProject:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"}}},IscedLevel:{type:"object",properties:{id:{type:"integer"},label:{type:"string"},educationLevels:{type:"array",items:{$ref:"#/definitions/EducationLevel"}}}},EducationLevel:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},label:{type:"string"},country:{$ref:"#/definitions/Country"},iscedLevel:{$ref:"#/definitions/IscedLevel"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},University:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},lang:{type:"string",enum:["en","es","pt"]},name:{type:"string"},filter:{type:"boolean"},country:{$ref:"#/definitions/Country"},applications:{type:"array",items:{$ref:"#/definitions/Application"}}}},Application:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},dateOfBirth:{type:"string",format:"date-time"},isAllowedToWork:{type:"boolean"},hasValidIdDocument:{type:"boolean"},locality:{type:["number","string","boolean","object","array","null"]},householdSize:{type:"integer"},children:{type:"integer"},householdIncome:{type:"integer"},racialIdentity:{type:["string","null"]},schoolType:{type:["string","null"],enum:["private","public","other","subsidized","mixed"]},educationSubject:{type:["string","null"],enum:["design_and_media","software_engineering","engineering","management_and_business","languages","science","health","social_sciences","arts","comms_and_advertising","education","cooking","tourism","economics_and_accounting","law","other"]},isStudying:{type:"boolean"},englishLevel:{type:["string","null"],enum:["NO","A1","A2","B1","B2","C1","C2"]},workStatus:{type:"string",enum:["never","not_now","yes"]},isLookingForWork:{type:["boolean","null"]},monthsLookingForWork:{type:["integer","null"]},monthsUnemployed:{type:["integer","null"]},workRole:{type:["string","null"],enum:["waitress","promoter","manager","cashier","intern","operative","call_center","receptionist","sales_agent","assistant","professional","technical","consultant","other"]},freelance:{type:["boolean","null"]},workFormal:{type:["boolean","null"]},workIncome:{type:["integer","null"]},failedFilters:{type:"array",items:{type:"string"}},bypassFilters:{type:"boolean",default:!1},isReady:{type:"boolean",default:!1},isReturningApplicant:{type:["boolean","null"]},legacyAdmissionCohortSlug:{type:["string","null"]},cohort:{$ref:"#/definitions/Cohort"},user:{$ref:"#/definitions/User"},country:{$ref:"#/definitions/Country"},nationality:{$ref:"#/definitions/Country"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{anyOf:[{$ref:"#/definitions/University"},{type:"null"}]},challengeAssignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}},config:{maxAge:120}},ApplicationChallenge:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},slug:{type:"string"},version:{type:"string"},trackId:{type:"integer"},tracks:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeTrack"}},langs:{type:"array",enum:["en","es","pt"]},json:{type:"string"},archived:{type:"boolean",default:!1},assignments:{type:"array",items:{$ref:"#/definitions/ApplicationChallengeAssignment"}}}},ApplicationChallengeAssignment:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},application:{$ref:"#/definitions/Application"},challenge:{$ref:"#/definitions/ApplicationChallenge"}}},ApplicationChallengeTrack:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},track:{$ref:"#/definitions/Track"}}},ActivityLogEntry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},type:{type:"string",enum:["challenge","application_filter","application_filter_bypass","application_cohort_change","project_assessment","project_assessment_request","project_assessment_assignment"]},data:{type:["number","string","boolean","object","array","null"]},path:{type:"string"},author:{$ref:"#/definitions/User"},user:{$ref:"#/definitions/User"},cohort:{$ref:"#/definitions/Cohort"}}},StudentProject:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},projectSlug:{type:"string"},projectVersion:{type:"string"},links:{type:"array",items:{$ref:"#/definitions/StudentProjectLink"}},team:{type:"array",items:{$ref:"#/definitions/StudentProjecTeamMember"}}}},StudentProjecTeamMember:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"},student:{$ref:"#/definitions/Student"}}},StudentProjectLink:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},url:{type:"string"},studentProject:{$ref:"#/definitions/StudentProject"}}},Contract:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},isEmployment:{type:"boolean"},feeAmount:{type:"integer"},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},isTrial:{type:"boolean",default:!1},source:{type:["string","null"],enum:["graduate","referral","jazzhr","web","linkedin","other"]},checkPilot:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},country:{$ref:"#/definitions/Country"},user:{$ref:"#/definitions/User"},gigs:{type:"array",items:{$ref:"#/definitions/Gig"}}}},Gig:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:"string"},role:{type:"string",enum:["bm","pdc","js","ux"]},hoursPerWeek:{type:"integer"},start:{type:"string",format:"date-time"},end:{type:["string","null"],format:"date-time"},cohort:{$ref:"#/definitions/Cohort"},contract:{$ref:"#/definitions/Contract"},user:{$ref:"#/definitions/User"}}},Message:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},key:{type:"string"},from:{type:"string"},to:{type:"string"},transport:{type:"string",enum:["mandrill","slack"]},status:{type:"string",default:"PENDING",enum:["PENDING","QUEUED","ERROR","SENT"]},data:{type:["number","string","boolean","object","array","null"]},taskInfo:{type:["number","string","boolean","object","array","null"]},user:{anyOf:[{$ref:"#/definitions/User"},{type:"null"}]},logs:{type:"array",items:{$ref:"#/definitions/MessageLog"}}}},MessageLog:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},statusText:{type:["string","null"]},message:{$ref:"#/definitions/Message"}}},Industry:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},companies:{type:"array",items:{$ref:"#/definitions/Company"}}}},Company:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},name:{type:"string"},size:{type:["string","null"],enum:["A_2_10","B_11_50","C_51_200","D_201_500","E_501_1000","F_1001_5000","G_5001_10000","H_10001_plus"]},data:{type:["number","string","boolean","object","array","null"]},web:{type:["string","null"]},twitter:{type:["string","null"]},github:{type:["string","null"]},facebook:{type:["string","null"]},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},industry:{anyOf:[{$ref:"#/definitions/Industry"},{type:"null"}]},jobs:{type:"array",items:{$ref:"#/definitions/Job"}},categories:{type:"array",enum:["Tech_Consultancy","Digital_Transformation","Agency","Startups","High_tech","Traditional_Consulting"]}}},Job:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},source:{type:"string"},sourceId:{type:"string"},title:{type:"string"},publishedAt:{type:"string",format:"date-time"},modality:{type:"string"},publicUrl:{type:["string","null"]},location:{type:["string","null"]},data:{type:["number","string","boolean","object","array","null"]},description:{type:["string","null"]},descriptionHTML:{type:["string","null"]},functions:{type:["string","null"]},functionsHTML:{type:["string","null"]},seniority:{type:["string","null"]},remote:{type:["boolean","null"]},remoteOption:{type:["string","null"],enum:["remote_for_now","locally_remote","fully_remote","no_remote","mixed"]},lang:{type:["string","null"],enum:["en","es","pt"]},maxSalary:{type:["integer","null"]},minSalary:{type:["integer","null"]},tags:{type:"array",items:{type:"string"}},company:{$ref:"#/definitions/Company"},country:{anyOf:[{$ref:"#/definitions/Country"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReview"}},applications:{type:"array",items:{$ref:"#/definitions/JobApplication"}},crawlerQueries:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}},crawlerLocations:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},learningObjectives:{type:["number","string","boolean","object","array","null"]},track:{anyOf:[{$ref:"#/definitions/Track"},{type:"null"}]},reviews:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReview:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},isValid:{type:"boolean"},invalidReason:{type:["string","null"],enum:["unrelated","experience","qualifications","other"]},comment:{type:["string","null"]},author:{$ref:"#/definitions/User"},job:{$ref:"#/definitions/Job"},profileTypes:{type:"array",items:{$ref:"#/definitions/JobReviewProfileType"}}}},JobReviewProfileType:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},review:{$ref:"#/definitions/JobReview"},profileType:{$ref:"#/definitions/JobProfileType"}}},JobApplication:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},status:{type:"string",default:"pending",enum:["pending","applied","interview","challenge","followup","hired","not_hired"]},hireDate:{type:["string","null"],format:"date-time"},jobStartDate:{type:["string","null"],format:"date-time"},netSalary:{type:["integer","null"]},grossSalary:{type:["integer","null"]},currency:{type:["string","null"]},job:{$ref:"#/definitions/Job"},user:{$ref:"#/definitions/User"},cohort:{anyOf:[{$ref:"#/definitions/Cohort"},{type:"null"}]}}},CrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},query:{type:"string"},enabled:{type:"boolean",default:!0},track:{$ref:"#/definitions/Track"},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerQuery"}}}},JobCrawlerQuery:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},query:{$ref:"#/definitions/CrawlerQuery"}}},CrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},name:{type:"string"},enabled:{type:"boolean",default:!0},jobs:{type:"array",items:{$ref:"#/definitions/JobCrawlerLocation"}}}},JobCrawlerLocation:{type:"object",properties:{id:{type:"integer"},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"},createdBy:{type:["string","null"]},job:{$ref:"#/definitions/Job"},location:{$ref:"#/definitions/CrawlerLocation"}}}},type:"object",properties:{country:{$ref:"#/definitions/Country"},currency:{$ref:"#/definitions/Currency"},user:{$ref:"#/definitions/User"},track:{$ref:"#/definitions/Track"},program:{$ref:"#/definitions/Program"},stage:{$ref:"#/definitions/Stage"},cohort:{$ref:"#/definitions/Cohort"},student:{$ref:"#/definitions/Student"},cohortLink:{$ref:"#/definitions/CohortLink"},dropout:{$ref:"#/definitions/Dropout"},iscedLevel:{$ref:"#/definitions/IscedLevel"},educationLevel:{$ref:"#/definitions/EducationLevel"},university:{$ref:"#/definitions/University"},application:{$ref:"#/definitions/Application"},applicationChallenge:{$ref:"#/definitions/ApplicationChallenge"},applicationChallengeAssignment:{$ref:"#/definitions/ApplicationChallengeAssignment"},applicationChallengeTrack:{$ref:"#/definitions/ApplicationChallengeTrack"},activityLogEntry:{$ref:"#/definitions/ActivityLogEntry"},studentProject:{$ref:"#/definitions/StudentProject"},studentProjecTeamMember:{$ref:"#/definitions/StudentProjecTeamMember"},studentProjectLink:{$ref:"#/definitions/StudentProjectLink"},contract:{$ref:"#/definitions/Contract"},gig:{$ref:"#/definitions/Gig"},message:{$ref:"#/definitions/Message"},messageLog:{$ref:"#/definitions/MessageLog"},industry:{$ref:"#/definitions/Industry"},company:{$ref:"#/definitions/Company"},job:{$ref:"#/definitions/Job"},jobProfileType:{$ref:"#/definitions/JobProfileType"},jobReview:{$ref:"#/definitions/JobReview"},jobReviewProfileType:{$ref:"#/definitions/JobReviewProfileType"},jobApplication:{$ref:"#/definitions/JobApplication"},crawlerQuery:{$ref:"#/definitions/CrawlerQuery"},jobCrawlerQuery:{$ref:"#/definitions/JobCrawlerQuery"},crawlerLocation:{$ref:"#/definitions/CrawlerLocation"},jobCrawlerLocation:{$ref:"#/definitions/JobCrawlerLocation"}}},$n=24*(60*60*1e3),Yo={Country:{primaryKey:"code",plural:"countries",inputProps:["name","incomeFilter","currency","canApply","flag"],searchProps:["code","name","timeZone"],defaultProps:["code","name","timeZone","currency"],getOptionLabel:({code:n,name:e})=>`${n} / ${e}`},Currency:{primaryKey:"code",plural:"currencies",searchProps:["code","name"],defaultProps:["code","name","symbol"]},ActivityLogEntry:{plural:"activityLog"},User:{primaryKey:"uid",inputProps:["firstName","lastName","email","password","lang","identifiesAsFemale","dateOfBirth","country","identificationNumber","mobileNumber","github","linkedin","bio","role","signupCohort","disabled","referralSource"],searchProps:["firstName","lastName","email"],getOptionLabel:({firstName:n,lastName:e,email:t})=>`${n} ${e} (${t})`,properties:{email:{inputType:"email"},lastName:{isRequired:!0},mobileNumber:{inputType:"phone"},bio:{inputType:"textarea"}},parse:n=>{const e=n.github?`https://github.com/${n.github}.png?size=`:`https://www.gravatar.com/avatar/${Fo(n.email)}?s=`;return{...n,fullName:`${n.firstName||""}${n.lastName?` ${n.lastName}`:""}`,avatar:t=>`${e}${t}`,isStaff:["staff","manager","finance","admin"].includes(n.role),isManager:["manager","finance","admin"].includes(n.role),isFinance:["finance","admin"].includes(n.role),isAdmin:n.role==="admin"}}},Track:{searchProps:["name"]},Program:{searchProps:["name"]},Stage:{searchProps:["name"]},Cohort:{inputProps:["program","stage","lang","name","start","end","timeZone","startTime","endTime","vacancies","admissionStart","admissionEnd","placementStart","admissionCountries"],searchProps:["name"],getOptionLabel:({id:n,name:e,stage:t})=>`${e}${t?` - ${t.name}`:""} (id: ${n})`,properties:{},parse:n=>{var s,o;const e=Date.now();let t;if(n.placementStart){const c=n.placementDuration||270;new Date(+n.placementStart+c*24*60*60*1e3)<e?t="placement_ended":n.placementStart<e&&(t="placement_started")}!t&&n.end<e&&(t="ended"),!t&&n.start<e&&(t="started");const r=n.admissionEnd?+n.admissionEnd+$n:!1;!t&&r&&r<e&&(t="admission_ended"),!t&&n.admissionStart&&n.admissionStart<e&&(t="admission_started"),!t&&n.admissionStart&&n.admissionEnd&&(t="planned"),t||(t="draft");const i=n.start>e&&n.vacancies?n.vacancies:((s=n._count)==null?void 0:s.students)||((o=n.students)==null?void 0:o.length)||0;return{...n,status:t,size:i}}},Student:{inputProps:["cohort","user"],searchProps:["user.firstName","user.lastName","user.email"],defaultProps:["id","cohort","user"],getOptionLabel:({user:n,cohort:e})=>`${n==null?void 0:n.firstName} ${(n==null?void 0:n.lastName)||""} (${e==null?void 0:e.name})`},Dropout:{inputProps:["cohort","user","date","reason","reasonDetail","lastProject","completedProjects","notes","staffSad","covidRelated"],searchProps:["user.uid","user.firstName","user.lastName","user.email","cohort.name"]},Contract:{inputProps:["user","country","isEmployment","feeAmount","hoursPerWeek","start","end","isTrial","checkPilot","source"],searchProps:["user.firstName","user.lastName","user.email"],getOptionLabel:({id:n,user:e})=>`${e==null?void 0:e.firstName} (id: ${n})`},Gig:{inputProps:["cohort","user","contract","role","hoursPerWeek","start","end"]},Application:{inputProps:["user","cohort","dateOfBirth","country","locality","nationality","isAllowedToWork","hasValidIdDocument","householdSize","children","householdIncome","racialIdentity","educationLevel","schoolType","educationSubject","university","isStudying","englishLevel","workStatus","isLookingForWork","monthsLookingForWork","monthsUnemployed","workRole","freelance","workFormal","workIncome","isReady","bypassFilters"],properties:{locality:{isRequired:!0},englishLevel:{isRequired:!0},isReady:{isRequired:!1},bypassFilters:{isRequired:!1}},parse:n=>{var s,o,c;const e=typeof n.hasFailedFilters=="boolean"?n.hasFailedFilters:typeof((s=n.failedFilters)==null?void 0:s.length)=="number"?n.failedFilters.length>0:void 0;if(!((o=n.cohort)!=null&&o.admissionEnd)||typeof e>"u")return n;const t=Date.now(),{maxAge:r}=yt.definitions.Application.config;let i;return n.isReady?i="ready":e&&!n.bypassFilters?i="rejected":n.createdAt<t-r*$n?i="expired":((c=n.cohort)==null?void 0:c.status)!=="admission_started"?i="admission_ended":i="active",{...n,status:i}}},IscedLevel:{parse:n=>{const e=Math.floor(n.id/10);return{...n,level:e,completed:e*10<n.id}}},EducationLevel:{searchProps:["label"]},University:{plural:"universities",searchProps:["name"]},Company:{plural:"companies"},CrawlerQuery:{plural:"crawlerQueries"},JobCrawlerQuery:{plural:"jobCrawlerQueries"}},Qo=(n,e)=>({...Go(n,e,{...yt,definitions:Ko(yt,Yo)}),gcpLog:{getEntries:async t=>await mt(n,e.authUser)(`/gcp-logs?q=${JSON.stringify(t)}`)}}),Xo=(n,e)=>{const t=mt(n,e.authUser);return{project:{findMany:(r={})=>t(`/projects?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/projects/${r}?q=${JSON.stringify(i)}`)},topic:{findMany:(r={})=>t(`/topics?q=${JSON.stringify(r)}`),findBySlug:(r,i={})=>t(`/topics/${r}?q=${JSON.stringify(i)}`)},learningObjective:{findMany:(r={})=>t(`/learning-objectives?q=${JSON.stringify(r)}`)}}},We=n=>n>9?`${n}`:`0${n}`,Mn=n=>`${We(n.getUTCDate())}/${We(n.getUTCMonth()+1)}/${n.getUTCFullYear()}`,Un=n=>`${We(n.getUTCHours())}:${We(n.getUTCMinutes())}:${n.getUTCSeconds()} UTC`,Zo=n=>`${Mn(n)} ${Un(n)}`,ea={es:"es-ES",pt:"pt-BR"},ta=(n,e="es",t=!1)=>new Intl.DateTimeFormat(ea[e],{...t&&{year:"numeric"},month:"long",day:"numeric",timeZone:"UTC"}).format(new Date(n)),na=(n,e)=>{let t=e.getFullYear()-n.getFullYear();const r=e.getMonth()-n.getMonth();return(r<0||r===0&&e.getDate()<n.getDate())&&t--,t},ra=(n,e,t)=>{const r=i=>new Intl.NumberFormat(`${i}-${e}`,{currency:t});return r(e==="CR"?"en":n)},ia=(n,e,t,r)=>ra(e,t,r).format(n),sa=n=>parseInt(n.replace(/[,\.]/g,""),10),oa=n=>{try{return JSON.parse(window.localStorage.getItem(n))}catch{return null}},aa=({firebaseApiKey:n="AIzaSyAXbaEbpq8NOfn0r8mIrcoHvoGRkJThwdc",firebaseProject:e="laboratoria-la",coreApiUrl:t="https://us-central1-outpost-272720.cloudfunctions.net/core-api"}={})=>{const r=Nt({apiKey:n,authDomain:`${e}.firebaseapp.com`,databaseURL:`https://${e}.firebaseio.com`,projectId:e}),i=$o(r),s={authUser:void 0,user:void 0},o=Qo(t,s);return{...Xo(t,s),...o,auth:{onChange:u=>Is(i,y=>{if(!y)return Object.assign(s,{authUser:null,user:null}),u(s);Object.assign(s,{authUser:y}),o.user.findById(y.uid).then(b=>{Object.assign(s,{user:b}),u(s)}).catch(b=>{console.error(b),Object.assign(s,{authUser:null,user:null}),u(s)})}),signIn:(u,y)=>_s(i,u,y),signOut:()=>ws(i),sendPasswordResetEmail:u=>ys(i,u)},firebaseApp:r}};k.createApp=aa,k.formatCurrency=ia,k.formatDate=Mn,k.formatDateTime=Zo,k.formatMonth=ta,k.formatTime=Un,k.getAgeAt=na,k.loadFromLocalStorage=oa,k.parseCurrency=sa,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@laboratoria/sdk-js",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.3.0-beta.0",
|
4
4
|
"description": "Laboratoria JavaScript (browser) SDK",
|
5
5
|
"license": "MIT",
|
6
6
|
"type": "module",
|
@@ -28,10 +28,10 @@
|
|
28
28
|
"devDependencies": {
|
29
29
|
"@vitest/coverage-v8": "^1.2.2",
|
30
30
|
"jsdom": "^24.0.0",
|
31
|
-
"vite": "^5.1.
|
31
|
+
"vite": "^5.1.2",
|
32
32
|
"vitest": "^1.2.2"
|
33
33
|
},
|
34
34
|
"engines": {
|
35
35
|
"node": ">=18.0.0"
|
36
36
|
}
|
37
|
-
}
|
37
|
+
}
|