@paynext/sdk 0.0.118 → 0.0.119
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/index.d.ts +2 -1
- package/dist/index.es.js +695 -689
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -10,7 +10,7 @@ var xt = (n, e, t) => e in n ? kr(n, e, { enumerable: !0, configurable: !0, writ
|
|
|
10
10
|
Cn.call(e, t) && xt(n, t, e[t]);
|
|
11
11
|
return n;
|
|
12
12
|
}, I = (n, e) => Er(n, xr(e));
|
|
13
|
-
var
|
|
13
|
+
var ae = (n, e) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var i in n)
|
|
16
16
|
yn.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
@@ -20,20 +20,20 @@ var se = (n, e) => {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
var c = (n, e, t) => xt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
23
|
-
var
|
|
24
|
-
var
|
|
23
|
+
var k = (n, e, t) => new Promise((i, r) => {
|
|
24
|
+
var a = (l) => {
|
|
25
25
|
try {
|
|
26
26
|
o(t.next(l));
|
|
27
27
|
} catch (u) {
|
|
28
28
|
r(u);
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, s = (l) => {
|
|
31
31
|
try {
|
|
32
32
|
o(t.throw(l));
|
|
33
33
|
} catch (u) {
|
|
34
34
|
r(u);
|
|
35
35
|
}
|
|
36
|
-
}, o = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(
|
|
36
|
+
}, o = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, s);
|
|
37
37
|
o((t = t.apply(n, e)).next());
|
|
38
38
|
});
|
|
39
39
|
import wr from "react";
|
|
@@ -44,7 +44,7 @@ class iu {
|
|
|
44
44
|
typeof window != "undefined" && (this.parent = e);
|
|
45
45
|
}
|
|
46
46
|
mount(e) {
|
|
47
|
-
return
|
|
47
|
+
return k(this, null, function* () {
|
|
48
48
|
if (!this.parent)
|
|
49
49
|
return;
|
|
50
50
|
if (!this.core) {
|
|
@@ -62,7 +62,7 @@ class iu {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
unmount() {
|
|
65
|
-
return
|
|
65
|
+
return k(this, null, function* () {
|
|
66
66
|
!this.parent || !this.core || (this.parent.innerHTML = "", this.core.clearState());
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -141,15 +141,15 @@ const kn = {
|
|
|
141
141
|
token_service_provider: e.token.tokenServiceProvider
|
|
142
142
|
};
|
|
143
143
|
}, Ir = (n) => {
|
|
144
|
-
var t, i, r,
|
|
144
|
+
var t, i, r, a, s, o;
|
|
145
145
|
const e = n.applePay;
|
|
146
146
|
if (e)
|
|
147
147
|
return {
|
|
148
148
|
cryptogram: e.cryptogram,
|
|
149
149
|
eci: e.eci,
|
|
150
150
|
exp_month: (i = (t = e.networkToken) == null ? void 0 : t.expiry) != null && i.month ? Number(e.networkToken.expiry.month) : void 0,
|
|
151
|
-
exp_year: (
|
|
152
|
-
token: (
|
|
151
|
+
exp_year: (a = (r = e.networkToken) == null ? void 0 : r.expiry) != null && a.year ? Number(e.networkToken.expiry.year) : void 0,
|
|
152
|
+
token: (s = e.networkToken) == null ? void 0 : s.number,
|
|
153
153
|
token_service_provider: (o = e.networkToken) == null ? void 0 : o.tokenServiceProvider
|
|
154
154
|
};
|
|
155
155
|
}, Mr = (n) => {
|
|
@@ -159,33 +159,33 @@ const kn = {
|
|
|
159
159
|
payment_method_nonce: e.nonce
|
|
160
160
|
};
|
|
161
161
|
}, En = (n) => {
|
|
162
|
-
var i, r,
|
|
162
|
+
var i, r, a, s, o, l, u, d, h, m, p, g, b, y;
|
|
163
163
|
const { applePay: e, googlePay: t } = n;
|
|
164
164
|
if (!(!e && !t))
|
|
165
165
|
return {
|
|
166
166
|
city: ((i = e == null ? void 0 : e.billingContact) == null ? void 0 : i.locality) || ((r = t == null ? void 0 : t.billingAddress) == null ? void 0 : r.locality) || void 0,
|
|
167
|
-
country: ((
|
|
167
|
+
country: ((a = e == null ? void 0 : e.billingContact) == null ? void 0 : a.countryCode) || ((s = t == null ? void 0 : t.billingAddress) == null ? void 0 : s.countryCode) || void 0,
|
|
168
168
|
line1: ((l = (o = e == null ? void 0 : e.billingContact) == null ? void 0 : o.addressLines) == null ? void 0 : l.at(0)) || ((u = t == null ? void 0 : t.billingAddress) == null ? void 0 : u.address1) || void 0,
|
|
169
169
|
line2: ((h = (d = e == null ? void 0 : e.billingContact) == null ? void 0 : d.addressLines) == null ? void 0 : h.at(1)) || ((m = t == null ? void 0 : t.billingAddress) == null ? void 0 : m.address2) || void 0,
|
|
170
170
|
postal_code: ((p = e == null ? void 0 : e.billingContact) == null ? void 0 : p.postalCode) || ((g = t == null ? void 0 : t.billingAddress) == null ? void 0 : g.postalCode) || void 0,
|
|
171
171
|
state: ((b = e == null ? void 0 : e.billingContact) == null ? void 0 : b.administrativeArea) || ((y = t == null ? void 0 : t.billingAddress) == null ? void 0 : y.administrativeArea) || void 0
|
|
172
172
|
};
|
|
173
173
|
}, xn = (n) => {
|
|
174
|
-
var r,
|
|
174
|
+
var r, a, s, o, l, u, d, h, m, p, g, b, y, E, V, _, M, T, D;
|
|
175
175
|
const { card: e, googlePay: t, applePay: i } = n;
|
|
176
176
|
if (!(!e && !(t != null && t.card) && !(i != null && i.card)))
|
|
177
177
|
return {
|
|
178
178
|
bin: e == null ? void 0 : e.firstSixDigits,
|
|
179
179
|
bin_data: {
|
|
180
|
-
brand: (e == null ? void 0 : e.cardBrand) || ((r = t == null ? void 0 : t.card) == null ? void 0 : r.brand) || ((
|
|
181
|
-
country: (e == null ? void 0 : e.country) || ((
|
|
180
|
+
brand: (e == null ? void 0 : e.cardBrand) || ((r = t == null ? void 0 : t.card) == null ? void 0 : r.brand) || ((a = i == null ? void 0 : i.card) == null ? void 0 : a.brand),
|
|
181
|
+
country: (e == null ? void 0 : e.country) || ((s = t == null ? void 0 : t.card) == null ? void 0 : s.country) || ((o = i == null ? void 0 : i.card) == null ? void 0 : o.country),
|
|
182
182
|
currency_code: (e == null ? void 0 : e.currency) || ((l = t == null ? void 0 : t.card) == null ? void 0 : l.currency) || ((u = i == null ? void 0 : i.card) == null ? void 0 : u.currency),
|
|
183
183
|
funding: (e == null ? void 0 : e.funding) || ((d = t == null ? void 0 : t.card) == null ? void 0 : d.funding) || ((h = i == null ? void 0 : i.card) == null ? void 0 : h.funding),
|
|
184
184
|
issuer: (e == null ? void 0 : e.issuer) || ((m = t == null ? void 0 : t.card) == null ? void 0 : m.issuer) || ((p = i == null ? void 0 : i.card) == null ? void 0 : p.issuer),
|
|
185
185
|
type: (e == null ? void 0 : e.type) || ((g = t == null ? void 0 : t.card) == null ? void 0 : g.segment) || ((b = i == null ? void 0 : i.card) == null ? void 0 : b.segment)
|
|
186
186
|
},
|
|
187
187
|
cvc: e == null ? void 0 : e.cvc,
|
|
188
|
-
exp_month: e != null && e.expMonth || (y = t == null ? void 0 : t.card) != null && y.expiry.month ? Number((e == null ? void 0 : e.expMonth) || ((
|
|
188
|
+
exp_month: e != null && e.expMonth || (y = t == null ? void 0 : t.card) != null && y.expiry.month ? Number((e == null ? void 0 : e.expMonth) || ((E = t == null ? void 0 : t.card) == null ? void 0 : E.expiry.month)) : void 0,
|
|
189
189
|
exp_year: e != null && e.expYear || (V = t == null ? void 0 : t.card) != null && V.expiry.year ? Number((e == null ? void 0 : e.expYear) || ((_ = t == null ? void 0 : t.card) == null ? void 0 : _.expiry.year)) : void 0,
|
|
190
190
|
last4: (e == null ? void 0 : e.lastFourDigits) || ((M = t == null ? void 0 : t.card) == null ? void 0 : M.lastFour) || ((T = i == null ? void 0 : i.card) == null ? void 0 : T.lastFour),
|
|
191
191
|
number: (e == null ? void 0 : e.number) || ((D = t == null ? void 0 : t.card) == null ? void 0 : D.number)
|
|
@@ -195,7 +195,7 @@ const kn = {
|
|
|
195
195
|
const { applePay: e, card: t } = n;
|
|
196
196
|
return (i = e == null ? void 0 : e.billingContact) != null && i.givenName ? `${e.billingContact.givenName} ${e.billingContact.familyName || ""}`.trim() : (r = t == null ? void 0 : t.metadata) == null ? void 0 : r.name;
|
|
197
197
|
}, Pr = (n) => {
|
|
198
|
-
var i, r,
|
|
198
|
+
var i, r, a, s, o, l, u, d;
|
|
199
199
|
const e = Ar(n), t = {
|
|
200
200
|
client_session: n.clientSession,
|
|
201
201
|
three_ds_session_id: n.threeDsSessionId,
|
|
@@ -214,7 +214,7 @@ const kn = {
|
|
|
214
214
|
case x.GOOGLE_PAY:
|
|
215
215
|
return I(v({}, t), {
|
|
216
216
|
name: (r = (i = n.googlePay) == null ? void 0 : i.billingAddress) == null ? void 0 : r.name,
|
|
217
|
-
phone: (
|
|
217
|
+
phone: (l = (o = (s = (a = n.googlePay) == null ? void 0 : a.billingAddress) == null ? void 0 : s.phoneNumber) == null ? void 0 : o.replace(/ /g, "")) == null ? void 0 : l.replace(/-/g, ""),
|
|
218
218
|
card: xn(n),
|
|
219
219
|
google_pay: Vr(n),
|
|
220
220
|
billing_address: En(n)
|
|
@@ -224,7 +224,7 @@ const kn = {
|
|
|
224
224
|
name: wn(n),
|
|
225
225
|
card: xn(n),
|
|
226
226
|
apple_pay: Ir(n),
|
|
227
|
-
phone: (
|
|
227
|
+
phone: (d = (u = n.applePay) == null ? void 0 : u.shippingContact) == null ? void 0 : d.phoneNumber,
|
|
228
228
|
billing_address: En(n)
|
|
229
229
|
});
|
|
230
230
|
case x.VENMO:
|
|
@@ -234,27 +234,27 @@ const kn = {
|
|
|
234
234
|
default:
|
|
235
235
|
throw new Error(`Unsupported payment method: ${e}`);
|
|
236
236
|
}
|
|
237
|
-
}, Dr = (n, e, t) =>
|
|
237
|
+
}, Dr = (n, e, t) => k(void 0, null, function* () {
|
|
238
238
|
const i = `${Xt(e)}/payments/create`, r = new Headers();
|
|
239
239
|
r.append("Content-Type", "application/json"), r.append("X-API-Version", t);
|
|
240
|
-
const
|
|
240
|
+
const a = Pr(n);
|
|
241
241
|
return yield (yield fetch(i, {
|
|
242
242
|
method: "POST",
|
|
243
243
|
headers: r,
|
|
244
|
-
body: JSON.stringify(
|
|
244
|
+
body: JSON.stringify(a)
|
|
245
245
|
})).json();
|
|
246
|
-
}), Rr = (n, e, t) =>
|
|
246
|
+
}), Rr = (n, e, t) => k(void 0, null, function* () {
|
|
247
247
|
const i = `${Xt(e)}/payments/create/billing/agreement`, r = new Headers();
|
|
248
248
|
return r.append("Content-Type", "application/json"), r.append("X-API-Version", t), (yield (yield fetch(i, {
|
|
249
249
|
method: "POST",
|
|
250
250
|
headers: r,
|
|
251
251
|
body: JSON.stringify({ client_session: n })
|
|
252
252
|
})).json()).paypal_agreement_token_response.token_id || "";
|
|
253
|
-
}), Or = (n, e, t) =>
|
|
253
|
+
}), Or = (n, e, t) => k(void 0, null, function* () {
|
|
254
254
|
const i = new Headers();
|
|
255
255
|
i.append("X-API-Version", t);
|
|
256
|
-
const r = `${Xt(e)}/payments/config?client_session_id=${n}`,
|
|
257
|
-
return
|
|
256
|
+
const r = `${Xt(e)}/payments/config?client_session_id=${n}`, s = yield (yield fetch(r, { headers: i })).json();
|
|
257
|
+
return s.checkout_config || (s.checkout_config = Tr), s;
|
|
258
258
|
});
|
|
259
259
|
let Nr = class {
|
|
260
260
|
constructor(e) {
|
|
@@ -264,14 +264,14 @@ let Nr = class {
|
|
|
264
264
|
this.ev = e;
|
|
265
265
|
}
|
|
266
266
|
init(u, d) {
|
|
267
|
-
return
|
|
267
|
+
return k(this, arguments, function* ({
|
|
268
268
|
transaction: e,
|
|
269
269
|
locale: t,
|
|
270
270
|
// supportedCardTypes,
|
|
271
271
|
onReady: i,
|
|
272
272
|
onError: r,
|
|
273
|
-
onSuccess:
|
|
274
|
-
onCancel:
|
|
273
|
+
onSuccess: a,
|
|
274
|
+
onCancel: s,
|
|
275
275
|
onPaymentAttempt: o
|
|
276
276
|
}, l) {
|
|
277
277
|
const h = this.ev.transactions.create(e);
|
|
@@ -288,25 +288,25 @@ let Nr = class {
|
|
|
288
288
|
allowedCardNetworks: ["visa", "masterCard"],
|
|
289
289
|
requestBillingAddress: !0,
|
|
290
290
|
requestPayerDetails: ["name", "email", "phone"],
|
|
291
|
-
process: (b, y) =>
|
|
291
|
+
process: (b, y) => k(this, [b, y], function* (p, { fail: g }) {
|
|
292
292
|
o == null || o({
|
|
293
293
|
paymentMethod: x.GOOGLE_PAY
|
|
294
294
|
});
|
|
295
295
|
try {
|
|
296
|
-
|
|
297
|
-
} catch (
|
|
298
|
-
console.error(
|
|
296
|
+
a == null || a(p);
|
|
297
|
+
} catch (E) {
|
|
298
|
+
console.error(E), g({
|
|
299
299
|
message: "Cannot pay with payment credentials"
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
})
|
|
303
303
|
}));
|
|
304
|
-
const m =
|
|
305
|
-
this.isAvailable = m === "available", this.isAvailable || r == null || r("Apple Pay is not supported on this device"), r && this.apple.on("error", r),
|
|
304
|
+
const m = "available";
|
|
305
|
+
this.isAvailable = m === "available", this.isAvailable || r == null || r("Apple Pay is not supported on this device"), r && this.apple.on("error", r), s && this.apple.on("cancel", s), this.onReady = i;
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
render(e) {
|
|
309
|
-
return
|
|
309
|
+
return k(this, null, function* () {
|
|
310
310
|
var t;
|
|
311
311
|
!this.apple || !this.isAvailable || (e.innerHTML = "", yield this.apple.mount(e), (t = this.onReady) == null || t.call(this));
|
|
312
312
|
});
|
|
@@ -317,7 +317,7 @@ let Nr = class {
|
|
|
317
317
|
this.ev = e;
|
|
318
318
|
}
|
|
319
319
|
init(u, d) {
|
|
320
|
-
return
|
|
320
|
+
return k(this, arguments, function* ({ transaction: e, locale: t, onReady: i, onError: r, onSuccess: a, onCancel: s, onPaymentAttempt: o }, l) {
|
|
321
321
|
const h = this.ev.transactions.create(e);
|
|
322
322
|
this.google = this.ev.ui.googlePay(h, I(v({
|
|
323
323
|
locale: t,
|
|
@@ -334,23 +334,23 @@ let Nr = class {
|
|
|
334
334
|
allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
|
|
335
335
|
// ToDo: Temporary we have only Visa and Master card
|
|
336
336
|
allowedCardNetworks: ["VISA", "MASTERCARD"],
|
|
337
|
-
process: (g, b) =>
|
|
337
|
+
process: (g, b) => k(this, [g, b], function* (m, { fail: p }) {
|
|
338
338
|
o == null || o({
|
|
339
339
|
paymentMethod: x.GOOGLE_PAY
|
|
340
340
|
});
|
|
341
341
|
try {
|
|
342
|
-
|
|
342
|
+
a == null || a(m);
|
|
343
343
|
} catch (y) {
|
|
344
344
|
console.error(y), p({
|
|
345
345
|
message: "Cannot pay with payment credentials"
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
})
|
|
349
|
-
})),
|
|
349
|
+
})), s && this.google.on("cancel", s), i && this.google.on("ready", i), r && this.google.on("error", r);
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
352
|
render(e) {
|
|
353
|
-
return
|
|
353
|
+
return k(this, null, function* () {
|
|
354
354
|
this.google && (e.innerHTML = "", this.google.mount(e));
|
|
355
355
|
});
|
|
356
356
|
}
|
|
@@ -378,13 +378,13 @@ class Fr {
|
|
|
378
378
|
c(this, "threeDs", null);
|
|
379
379
|
this.ev = e;
|
|
380
380
|
}
|
|
381
|
-
init(
|
|
382
|
-
return
|
|
381
|
+
init(a) {
|
|
382
|
+
return k(this, arguments, function* ({ threeDsId: e, onReady: t, onSuccess: i, onError: r }) {
|
|
383
383
|
this.threeDs = this.ev.ui.threeDSecure(e), this.threeDs.on("ready", () => t == null ? void 0 : t()), this.threeDs.on("success", () => i == null ? void 0 : i()), this.threeDs.on("failure", () => r == null ? void 0 : r()), this.threeDs.on("error", () => r == null ? void 0 : r());
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
386
|
render(e) {
|
|
387
|
-
return
|
|
387
|
+
return k(this, null, function* () {
|
|
388
388
|
this.threeDs && this.threeDs.mount(e);
|
|
389
389
|
});
|
|
390
390
|
}
|
|
@@ -405,34 +405,40 @@ class jr {
|
|
|
405
405
|
var i, r;
|
|
406
406
|
return ((i = this.ev) == null ? void 0 : i.config.appId) !== t || ((r = this.ev) == null ? void 0 : r.config.teamId) !== e;
|
|
407
407
|
}
|
|
408
|
-
//
|
|
409
|
-
|
|
410
|
-
return
|
|
408
|
+
// preload evervault
|
|
409
|
+
preloadEvervault(e) {
|
|
410
|
+
return k(this, null, function* () {
|
|
411
411
|
if (!this.isShouldLoad(e)) return;
|
|
412
412
|
if (typeof window == "undefined")
|
|
413
413
|
throw new Error("Evervault can only be initialized in browser environment");
|
|
414
414
|
this.isReady = !1;
|
|
415
415
|
const { loadEvervault: t } = yield import("./evervault-js-37KtqVz5.js");
|
|
416
|
-
this.ev = yield t(e.teamId, e.appId), this.apple = new Nr(this.ev), this.google = new Sr(this.ev)
|
|
416
|
+
this.ev = yield t(e.teamId, e.appId), this.apple = new Nr(this.ev), this.google = new Sr(this.ev);
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
// init ev
|
|
420
|
+
initEv(e) {
|
|
421
|
+
return k(this, null, function* () {
|
|
422
|
+
this.events.ready.emit(), this.isReady = !0;
|
|
417
423
|
});
|
|
418
424
|
}
|
|
419
425
|
// init three ds
|
|
420
426
|
initThreeDs(e) {
|
|
421
|
-
return
|
|
427
|
+
return k(this, null, function* () {
|
|
422
428
|
if (!this.ev) throw new Error("Evervault should be init before using Three DS Secure");
|
|
423
429
|
this.threeDs = new Fr(this.ev), yield this.threeDs.init(e), yield this.threeDs.render();
|
|
424
430
|
});
|
|
425
431
|
}
|
|
426
432
|
// init apple
|
|
427
433
|
initApple(e, t) {
|
|
428
|
-
return
|
|
434
|
+
return k(this, null, function* () {
|
|
429
435
|
if (!this.apple) throw new Error("Evervault should be init before using Apple Pay");
|
|
430
436
|
yield this.apple.init(e, t);
|
|
431
437
|
});
|
|
432
438
|
}
|
|
433
439
|
// init google
|
|
434
440
|
initGoogle(e, t) {
|
|
435
|
-
return
|
|
441
|
+
return k(this, null, function* () {
|
|
436
442
|
if (!this.google) throw new Error("Evervault should be init before using Google Pay");
|
|
437
443
|
yield this.google.init(e, t);
|
|
438
444
|
});
|
|
@@ -448,14 +454,14 @@ class jr {
|
|
|
448
454
|
}
|
|
449
455
|
// render apple
|
|
450
456
|
renderApple(e) {
|
|
451
|
-
return
|
|
457
|
+
return k(this, null, function* () {
|
|
452
458
|
var t;
|
|
453
459
|
return (t = this.apple) == null ? void 0 : t.render(e);
|
|
454
460
|
});
|
|
455
461
|
}
|
|
456
462
|
// render google
|
|
457
463
|
renderGoogle(e) {
|
|
458
|
-
return
|
|
464
|
+
return k(this, null, function* () {
|
|
459
465
|
var t;
|
|
460
466
|
return (t = this.google) == null ? void 0 : t.render(e);
|
|
461
467
|
});
|
|
@@ -476,8 +482,8 @@ function Br(n, e, t) {
|
|
|
476
482
|
return [n];
|
|
477
483
|
if (typeof n == "string") {
|
|
478
484
|
let r = document;
|
|
479
|
-
const
|
|
480
|
-
return
|
|
485
|
+
const a = (i = t == null ? void 0 : t[n]) != null ? i : r.querySelectorAll(n);
|
|
486
|
+
return a ? Array.from(a) : [];
|
|
481
487
|
}
|
|
482
488
|
return Array.from(n);
|
|
483
489
|
}
|
|
@@ -511,13 +517,13 @@ function qr(n, e, t) {
|
|
|
511
517
|
r.at > e && r.at < t && (gi(n, r), i--);
|
|
512
518
|
}
|
|
513
519
|
}
|
|
514
|
-
function Gr(n, e, t, i, r,
|
|
515
|
-
qr(n, r,
|
|
516
|
-
for (let
|
|
520
|
+
function Gr(n, e, t, i, r, a) {
|
|
521
|
+
qr(n, r, a);
|
|
522
|
+
for (let s = 0; s < e.length; s++)
|
|
517
523
|
n.push({
|
|
518
|
-
value: e[
|
|
519
|
-
at: nt(r,
|
|
520
|
-
easing: fi(t,
|
|
524
|
+
value: e[s],
|
|
525
|
+
at: nt(r, a, i[s]),
|
|
526
|
+
easing: fi(t, s)
|
|
521
527
|
});
|
|
522
528
|
}
|
|
523
529
|
function Hr(n, e) {
|
|
@@ -554,12 +560,12 @@ function nn(n) {
|
|
|
554
560
|
e += t, i = n.next(e);
|
|
555
561
|
return e >= mt ? 1 / 0 : e;
|
|
556
562
|
}
|
|
557
|
-
const
|
|
563
|
+
const se = /* @__NO_SIDE_EFFECTS__ */ (n) => n * 1e3, le = /* @__NO_SIDE_EFFECTS__ */ (n) => n / 1e3;
|
|
558
564
|
function yi(n, e = 100, t) {
|
|
559
565
|
const i = t(I(v({}, n), { keyframes: [0, e] })), r = Math.min(nn(i), mt);
|
|
560
566
|
return {
|
|
561
567
|
type: "keyframes",
|
|
562
|
-
ease: (
|
|
568
|
+
ease: (a) => i.next(r * a).value / e,
|
|
563
569
|
duration: /* @__PURE__ */ le(r)
|
|
564
570
|
};
|
|
565
571
|
}
|
|
@@ -573,8 +579,8 @@ process.env.NODE_ENV !== "production" && (it = (n, e) => {
|
|
|
573
579
|
throw new Error(e);
|
|
574
580
|
});
|
|
575
581
|
const Ur = "easeInOut", Wr = 20;
|
|
576
|
-
function Zr(n,
|
|
577
|
-
var
|
|
582
|
+
function Zr(n, a = {}, i, r) {
|
|
583
|
+
var s = a, { defaultTransition: e = {} } = s, t = ae(s, ["defaultTransition"]);
|
|
578
584
|
const o = e.duration || 0.3, l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = {}, h = /* @__PURE__ */ new Map();
|
|
579
585
|
let m = 0, p = 0, g = 0;
|
|
580
586
|
for (let b = 0; b < n.length; b++) {
|
|
@@ -586,21 +592,21 @@ function Zr(n, s = {}, i, r) {
|
|
|
586
592
|
h.set(y.name, Tn(p, y.at, m, h));
|
|
587
593
|
continue;
|
|
588
594
|
}
|
|
589
|
-
let [
|
|
595
|
+
let [E, V, _ = {}] = y;
|
|
590
596
|
_.at !== void 0 && (p = Tn(p, _.at, m, h));
|
|
591
597
|
let M = 0;
|
|
592
598
|
const T = (D, C, w, R = 0, O = 0) => {
|
|
593
|
-
const q = Jr(D), _e = C, { delay: Te = 0, times: te = vi(q), type: fe = "keyframes", repeat: he, repeatType: kt, repeatDelay: Et = 0 } = _e,
|
|
599
|
+
const q = Jr(D), _e = C, { delay: Te = 0, times: te = vi(q), type: fe = "keyframes", repeat: he, repeatType: kt, repeatDelay: Et = 0 } = _e, st = ae(_e, ["delay", "times", "type", "repeat", "repeatType", "repeatDelay"]);
|
|
594
600
|
let { ease: ne = e.ease || "easeOut", duration: f } = C;
|
|
595
601
|
const P = typeof Te == "function" ? Te(R, O) : Te, N = q.length, G = tn(fe) ? fe : r == null ? void 0 : r[fe];
|
|
596
602
|
if (N <= 2 && G) {
|
|
597
603
|
let z = 100;
|
|
598
|
-
if (N === 2 &&
|
|
604
|
+
if (N === 2 && ea(q)) {
|
|
599
605
|
const ge = q[1] - q[0];
|
|
600
606
|
z = Math.abs(ge);
|
|
601
607
|
}
|
|
602
|
-
const re = v({},
|
|
603
|
-
f !== void 0 && (re.duration = /* @__PURE__ */
|
|
608
|
+
const re = v({}, st);
|
|
609
|
+
f !== void 0 && (re.duration = /* @__PURE__ */ se(f));
|
|
604
610
|
const pe = yi(re, z, G);
|
|
605
611
|
ne = pe.ease, f = pe.duration;
|
|
606
612
|
}
|
|
@@ -623,11 +629,11 @@ function Zr(n, s = {}, i, r) {
|
|
|
623
629
|
const Ae = ie + f;
|
|
624
630
|
Gr(w, q, ne, te, ie, Ae), M = Math.max(P + f, M), g = Math.max(Ae, g);
|
|
625
631
|
};
|
|
626
|
-
if (J(
|
|
627
|
-
const D = An(
|
|
632
|
+
if (J(E)) {
|
|
633
|
+
const D = An(E, u);
|
|
628
634
|
T(V, _, _n("default", D));
|
|
629
635
|
} else {
|
|
630
|
-
const D = pi(
|
|
636
|
+
const D = pi(E, V, i, d), C = D.length;
|
|
631
637
|
for (let w = 0; w < C; w++) {
|
|
632
638
|
V = V, _ = _;
|
|
633
639
|
const R = D[w], O = An(R, u);
|
|
@@ -638,8 +644,8 @@ function Zr(n, s = {}, i, r) {
|
|
|
638
644
|
m = p, p += M;
|
|
639
645
|
}
|
|
640
646
|
return u.forEach((b, y) => {
|
|
641
|
-
for (const
|
|
642
|
-
const V = b[
|
|
647
|
+
for (const E in b) {
|
|
648
|
+
const V = b[E];
|
|
643
649
|
V.sort(Yr);
|
|
644
650
|
const _ = [], M = [], T = [];
|
|
645
651
|
for (let C = 0; C < V.length; C++) {
|
|
@@ -651,7 +657,7 @@ function Zr(n, s = {}, i, r) {
|
|
|
651
657
|
transition: {}
|
|
652
658
|
});
|
|
653
659
|
const D = l.get(y);
|
|
654
|
-
D.keyframes[
|
|
660
|
+
D.keyframes[E] = _, D.transition[E] = v(I(v({}, e), {
|
|
655
661
|
duration: g,
|
|
656
662
|
ease: T,
|
|
657
663
|
times: M
|
|
@@ -671,7 +677,7 @@ function Jr(n) {
|
|
|
671
677
|
function Xr(n, e) {
|
|
672
678
|
return n && n[e] ? v(v({}, n), n[e]) : v({}, n);
|
|
673
679
|
}
|
|
674
|
-
const Qr = (n) => typeof n == "number",
|
|
680
|
+
const Qr = (n) => typeof n == "number", ea = (n) => n.every(Qr), Je = /* @__PURE__ */ new WeakMap(), ta = (n) => Array.isArray(n);
|
|
675
681
|
function Ln(n) {
|
|
676
682
|
const e = [{}, {}];
|
|
677
683
|
return n == null || n.values.forEach((t, i) => {
|
|
@@ -680,16 +686,16 @@ function Ln(n) {
|
|
|
680
686
|
}
|
|
681
687
|
function Ci(n, e, t, i) {
|
|
682
688
|
if (typeof e == "function") {
|
|
683
|
-
const [r,
|
|
684
|
-
e = e(t !== void 0 ? t : n.custom, r,
|
|
689
|
+
const [r, a] = Ln(i);
|
|
690
|
+
e = e(t !== void 0 ? t : n.custom, r, a);
|
|
685
691
|
}
|
|
686
692
|
if (typeof e == "string" && (e = n.variants && n.variants[e]), typeof e == "function") {
|
|
687
|
-
const [r,
|
|
688
|
-
e = e(t !== void 0 ? t : n.custom, r,
|
|
693
|
+
const [r, a] = Ln(i);
|
|
694
|
+
e = e(t !== void 0 ? t : n.custom, r, a);
|
|
689
695
|
}
|
|
690
696
|
return e;
|
|
691
697
|
}
|
|
692
|
-
function
|
|
698
|
+
function na(n, e, t) {
|
|
693
699
|
const i = n.getProps();
|
|
694
700
|
return Ci(i, e, i.custom, n);
|
|
695
701
|
}
|
|
@@ -711,16 +717,16 @@ const lt = [
|
|
|
711
717
|
"postRender"
|
|
712
718
|
// Compute
|
|
713
719
|
];
|
|
714
|
-
function
|
|
715
|
-
let t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = !1,
|
|
716
|
-
const
|
|
720
|
+
function ia(n, e) {
|
|
721
|
+
let t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = !1, a = !1;
|
|
722
|
+
const s = /* @__PURE__ */ new WeakSet();
|
|
717
723
|
let o = {
|
|
718
724
|
delta: 0,
|
|
719
725
|
timestamp: 0,
|
|
720
726
|
isProcessing: !1
|
|
721
727
|
};
|
|
722
728
|
function l(d) {
|
|
723
|
-
|
|
729
|
+
s.has(d) && (u.schedule(d), n()), d(o);
|
|
724
730
|
}
|
|
725
731
|
const u = {
|
|
726
732
|
/**
|
|
@@ -728,57 +734,57 @@ function is(n, e) {
|
|
|
728
734
|
*/
|
|
729
735
|
schedule: (d, h = !1, m = !1) => {
|
|
730
736
|
const g = m && r ? t : i;
|
|
731
|
-
return h &&
|
|
737
|
+
return h && s.add(d), g.has(d) || g.add(d), d;
|
|
732
738
|
},
|
|
733
739
|
/**
|
|
734
740
|
* Cancel the provided callback from running on the next frame.
|
|
735
741
|
*/
|
|
736
742
|
cancel: (d) => {
|
|
737
|
-
i.delete(d),
|
|
743
|
+
i.delete(d), s.delete(d);
|
|
738
744
|
},
|
|
739
745
|
/**
|
|
740
746
|
* Execute all schedule callbacks.
|
|
741
747
|
*/
|
|
742
748
|
process: (d) => {
|
|
743
749
|
if (o = d, r) {
|
|
744
|
-
|
|
750
|
+
a = !0;
|
|
745
751
|
return;
|
|
746
752
|
}
|
|
747
|
-
r = !0, [t, i] = [i, t], t.forEach(l), t.clear(), r = !1,
|
|
753
|
+
r = !0, [t, i] = [i, t], t.forEach(l), t.clear(), r = !1, a && (a = !1, u.process(d));
|
|
748
754
|
}
|
|
749
755
|
};
|
|
750
756
|
return u;
|
|
751
757
|
}
|
|
752
|
-
const de = {},
|
|
753
|
-
function
|
|
758
|
+
const de = {}, ra = 40;
|
|
759
|
+
function aa(n, e) {
|
|
754
760
|
let t = !1, i = !0;
|
|
755
761
|
const r = {
|
|
756
762
|
delta: 0,
|
|
757
763
|
timestamp: 0,
|
|
758
764
|
isProcessing: !1
|
|
759
|
-
},
|
|
765
|
+
}, a = () => t = !0, s = lt.reduce((_, M) => (_[M] = ia(a), _), {}), { setup: o, read: l, resolveKeyframes: u, preUpdate: d, update: h, preRender: m, render: p, postRender: g } = s, b = () => {
|
|
760
766
|
const _ = de.useManualTiming ? r.timestamp : performance.now();
|
|
761
|
-
t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(_ - r.timestamp,
|
|
767
|
+
t = !1, de.useManualTiming || (r.delta = i ? 1e3 / 60 : Math.max(Math.min(_ - r.timestamp, ra), 1)), r.timestamp = _, r.isProcessing = !0, o.process(r), l.process(r), u.process(r), d.process(r), h.process(r), m.process(r), p.process(r), g.process(r), r.isProcessing = !1, t && e && (i = !1, n(b));
|
|
762
768
|
}, y = () => {
|
|
763
769
|
t = !0, i = !0, r.isProcessing || n(b);
|
|
764
770
|
};
|
|
765
771
|
return { schedule: lt.reduce((_, M) => {
|
|
766
|
-
const T =
|
|
772
|
+
const T = s[M];
|
|
767
773
|
return _[M] = (D, C = !1, w = !1) => (t || y(), T.schedule(D, C, w)), _;
|
|
768
774
|
}, {}), cancel: (_) => {
|
|
769
775
|
for (let M = 0; M < lt.length; M++)
|
|
770
|
-
|
|
771
|
-
}, state: r, steps:
|
|
776
|
+
s[lt[M]].cancel(_);
|
|
777
|
+
}, state: r, steps: s };
|
|
772
778
|
}
|
|
773
|
-
const De = /* @__NO_SIDE_EFFECTS__ */ (n) => n, { schedule: ue, cancel: Rt, state: ft } = /* @__PURE__ */
|
|
779
|
+
const De = /* @__NO_SIDE_EFFECTS__ */ (n) => n, { schedule: ue, cancel: Rt, state: ft } = /* @__PURE__ */ aa(typeof requestAnimationFrame != "undefined" ? requestAnimationFrame : De, !0);
|
|
774
780
|
let pt;
|
|
775
|
-
function
|
|
781
|
+
function sa() {
|
|
776
782
|
pt = void 0;
|
|
777
783
|
}
|
|
778
784
|
const ee = {
|
|
779
785
|
now: () => (pt === void 0 && ee.set(ft.isProcessing || de.useManualTiming ? ft.timestamp : performance.now()), pt),
|
|
780
786
|
set: (n) => {
|
|
781
|
-
pt = n, queueMicrotask(
|
|
787
|
+
pt = n, queueMicrotask(sa);
|
|
782
788
|
}
|
|
783
789
|
}, Vn = /* @__PURE__ */ new Set();
|
|
784
790
|
function ki(n, e, t) {
|
|
@@ -797,9 +803,9 @@ class Ei {
|
|
|
797
803
|
if (r === 1)
|
|
798
804
|
this.subscriptions[0](e, t, i);
|
|
799
805
|
else
|
|
800
|
-
for (let
|
|
801
|
-
const
|
|
802
|
-
|
|
806
|
+
for (let a = 0; a < r; a++) {
|
|
807
|
+
const s = this.subscriptions[a];
|
|
808
|
+
s && s(e, t, i);
|
|
803
809
|
}
|
|
804
810
|
}
|
|
805
811
|
getSize() {
|
|
@@ -812,8 +818,8 @@ class Ei {
|
|
|
812
818
|
function xi(n, e) {
|
|
813
819
|
return e ? n * (1e3 / e) : 0;
|
|
814
820
|
}
|
|
815
|
-
const In = 30,
|
|
816
|
-
class
|
|
821
|
+
const In = 30, oa = (n) => !isNaN(parseFloat(n));
|
|
822
|
+
class la {
|
|
817
823
|
/**
|
|
818
824
|
* @param init - The initiating value
|
|
819
825
|
* @param config - Optional configuration options
|
|
@@ -822,16 +828,16 @@ class ls {
|
|
|
822
828
|
*/
|
|
823
829
|
constructor(e, t = {}) {
|
|
824
830
|
this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i, r = !0) => {
|
|
825
|
-
var
|
|
826
|
-
const
|
|
827
|
-
if (this.updatedAt !==
|
|
831
|
+
var s, o;
|
|
832
|
+
const a = ee.now();
|
|
833
|
+
if (this.updatedAt !== a && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && ((s = this.events.change) == null || s.notify(this.current), this.dependents))
|
|
828
834
|
for (const l of this.dependents)
|
|
829
835
|
l.dirty();
|
|
830
836
|
r && ((o = this.events.renderRequest) == null || o.notify(this.current));
|
|
831
837
|
}, this.hasAnimated = !1, this.setCurrent(e), this.owner = t.owner;
|
|
832
838
|
}
|
|
833
839
|
setCurrent(e) {
|
|
834
|
-
this.current = e, this.updatedAt = ee.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity =
|
|
840
|
+
this.current = e, this.updatedAt = ee.now(), this.canTrackVelocity === null && e !== void 0 && (this.canTrackVelocity = oa(this.current));
|
|
835
841
|
}
|
|
836
842
|
setPrevFrameValue(e = this.current) {
|
|
837
843
|
this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
|
|
@@ -1017,42 +1023,42 @@ class ls {
|
|
|
1017
1023
|
}
|
|
1018
1024
|
}
|
|
1019
1025
|
function Xe(n, e) {
|
|
1020
|
-
return new
|
|
1026
|
+
return new la(n, e);
|
|
1021
1027
|
}
|
|
1022
|
-
function
|
|
1028
|
+
function ca(n, e, t) {
|
|
1023
1029
|
n.hasValue(e) ? n.getValue(e).set(t) : n.addValue(e, Xe(t));
|
|
1024
1030
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1031
|
+
function da(n) {
|
|
1032
|
+
return ta(n) ? n[n.length - 1] || 0 : n;
|
|
1027
1033
|
}
|
|
1028
|
-
function
|
|
1029
|
-
let
|
|
1030
|
-
|
|
1031
|
-
for (const o in
|
|
1032
|
-
const l =
|
|
1033
|
-
|
|
1034
|
+
function ua(n, e) {
|
|
1035
|
+
let s = na(n, e) || {}, { transitionEnd: i = {}, transition: r = {} } = s, a = ae(s, ["transitionEnd", "transition"]);
|
|
1036
|
+
a = v(v({}, a), i);
|
|
1037
|
+
for (const o in a) {
|
|
1038
|
+
const l = da(a[o]);
|
|
1039
|
+
ca(n, o, l);
|
|
1034
1040
|
}
|
|
1035
1041
|
}
|
|
1036
|
-
function
|
|
1042
|
+
function ha(n) {
|
|
1037
1043
|
return !!(J(n) && n.add);
|
|
1038
1044
|
}
|
|
1039
|
-
function
|
|
1045
|
+
function pa(n, e) {
|
|
1040
1046
|
const t = n.getValue("willChange");
|
|
1041
|
-
if (
|
|
1047
|
+
if (ha(t))
|
|
1042
1048
|
return t.add(e);
|
|
1043
1049
|
if (!t && de.WillChange) {
|
|
1044
1050
|
const i = new de.WillChange("auto");
|
|
1045
1051
|
n.addValue("willChange", i), i.add(e);
|
|
1046
1052
|
}
|
|
1047
1053
|
}
|
|
1048
|
-
const rn = (n) => n.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(),
|
|
1049
|
-
function
|
|
1050
|
-
return n.props[
|
|
1054
|
+
const rn = (n) => n.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), ma = "framerAppearId", fa = "data-" + rn(ma);
|
|
1055
|
+
function ga(n) {
|
|
1056
|
+
return n.props[fa];
|
|
1051
1057
|
}
|
|
1052
|
-
const
|
|
1053
|
-
function
|
|
1054
|
-
const r = n.filter(
|
|
1055
|
-
return r[
|
|
1058
|
+
const ba = (n) => n !== null;
|
|
1059
|
+
function va(n, { repeat: e, repeatType: t = "loop" }, i) {
|
|
1060
|
+
const r = n.filter(ba), a = e && t !== "loop" && e % 2 === 1 ? 0 : r.length - 1;
|
|
1061
|
+
return r[a];
|
|
1056
1062
|
}
|
|
1057
1063
|
const Re = [
|
|
1058
1064
|
"transformPerspective",
|
|
@@ -1072,33 +1078,33 @@ const Re = [
|
|
|
1072
1078
|
"skew",
|
|
1073
1079
|
"skewX",
|
|
1074
1080
|
"skewY"
|
|
1075
|
-
], Oe = new Set(Re),
|
|
1081
|
+
], Oe = new Set(Re), ya = {
|
|
1076
1082
|
type: "spring",
|
|
1077
1083
|
stiffness: 500,
|
|
1078
1084
|
damping: 25,
|
|
1079
1085
|
restSpeed: 10
|
|
1080
|
-
},
|
|
1086
|
+
}, Ca = (n) => ({
|
|
1081
1087
|
type: "spring",
|
|
1082
1088
|
stiffness: 550,
|
|
1083
1089
|
damping: n === 0 ? 2 * Math.sqrt(550) : 30,
|
|
1084
1090
|
restSpeed: 10
|
|
1085
|
-
}),
|
|
1091
|
+
}), ka = {
|
|
1086
1092
|
type: "keyframes",
|
|
1087
1093
|
duration: 0.8
|
|
1088
|
-
},
|
|
1094
|
+
}, Ea = {
|
|
1089
1095
|
type: "keyframes",
|
|
1090
1096
|
ease: [0.25, 0.1, 0.35, 1],
|
|
1091
1097
|
duration: 0.3
|
|
1092
|
-
},
|
|
1093
|
-
function
|
|
1094
|
-
var m = h, { when: n, delay: e, delayChildren: t, staggerChildren: i, staggerDirection: r, repeat:
|
|
1098
|
+
}, xa = (n, { keyframes: e }) => e.length > 2 ? ka : Oe.has(n) ? n.startsWith("scale") ? Ca(e[1]) : ya : Ea;
|
|
1099
|
+
function wa(h) {
|
|
1100
|
+
var m = h, { when: n, delay: e, delayChildren: t, staggerChildren: i, staggerDirection: r, repeat: a, repeatType: s, repeatDelay: o, from: l, elapsed: u } = m, d = ae(m, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from", "elapsed"]);
|
|
1095
1101
|
return !!Object.keys(d).length;
|
|
1096
1102
|
}
|
|
1097
1103
|
function wi(n, e) {
|
|
1098
1104
|
var t, i;
|
|
1099
1105
|
return (i = (t = n == null ? void 0 : n[e]) != null ? t : n == null ? void 0 : n.default) != null ? i : n;
|
|
1100
1106
|
}
|
|
1101
|
-
const Ti = (n) => (e) => typeof e == "string" && e.startsWith(n), Ai = /* @__PURE__ */ Ti("--"),
|
|
1107
|
+
const Ti = (n) => (e) => typeof e == "string" && e.startsWith(n), Ai = /* @__PURE__ */ Ti("--"), Ta = /* @__PURE__ */ Ti("var(--"), an = (n) => Ta(n) ? Aa.test(n.split("/*")[0].trim()) : !1, Aa = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, xe = (n, e, t) => t > e ? e : t < n ? n : t, Ne = {
|
|
1102
1108
|
test: (n) => typeof n == "number",
|
|
1103
1109
|
parse: parseFloat,
|
|
1104
1110
|
transform: (n) => n
|
|
@@ -1106,28 +1112,28 @@ const Ti = (n) => (e) => typeof e == "string" && e.startsWith(n), Ai = /* @__PUR
|
|
|
1106
1112
|
transform: (n) => xe(0, 1, n)
|
|
1107
1113
|
}), ct = I(v({}, Ne), {
|
|
1108
1114
|
default: 1
|
|
1109
|
-
}), We = (n) => Math.round(n * 1e5) / 1e5,
|
|
1110
|
-
function
|
|
1115
|
+
}), We = (n) => Math.round(n * 1e5) / 1e5, sn = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
1116
|
+
function _a(n) {
|
|
1111
1117
|
return n == null;
|
|
1112
1118
|
}
|
|
1113
|
-
const
|
|
1119
|
+
const La = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, on = (n, e) => (t) => !!(typeof t == "string" && La.test(t) && t.startsWith(n) || e && !_a(t) && Object.prototype.hasOwnProperty.call(t, e)), _i = (n, e, t) => (i) => {
|
|
1114
1120
|
if (typeof i != "string")
|
|
1115
1121
|
return i;
|
|
1116
|
-
const [r,
|
|
1122
|
+
const [r, a, s, o] = i.match(sn);
|
|
1117
1123
|
return {
|
|
1118
1124
|
[n]: parseFloat(r),
|
|
1119
|
-
[e]: parseFloat(
|
|
1120
|
-
[t]: parseFloat(
|
|
1125
|
+
[e]: parseFloat(a),
|
|
1126
|
+
[t]: parseFloat(s),
|
|
1121
1127
|
alpha: o !== void 0 ? parseFloat(o) : 1
|
|
1122
1128
|
};
|
|
1123
|
-
},
|
|
1124
|
-
transform: (n) => Math.round(
|
|
1129
|
+
}, Va = (n) => xe(0, 255, n), wt = I(v({}, Ne), {
|
|
1130
|
+
transform: (n) => Math.round(Va(n))
|
|
1125
1131
|
}), ye = {
|
|
1126
1132
|
test: /* @__PURE__ */ on("rgb", "red"),
|
|
1127
1133
|
parse: /* @__PURE__ */ _i("red", "green", "blue"),
|
|
1128
1134
|
transform: ({ red: n, green: e, blue: t, alpha: i = 1 }) => "rgba(" + wt.transform(n) + ", " + wt.transform(e) + ", " + wt.transform(t) + ", " + We(Qe.transform(i)) + ")"
|
|
1129
1135
|
};
|
|
1130
|
-
function
|
|
1136
|
+
function Ia(n) {
|
|
1131
1137
|
let e = "", t = "", i = "", r = "";
|
|
1132
1138
|
return n.length > 5 ? (e = n.substring(1, 3), t = n.substring(3, 5), i = n.substring(5, 7), r = n.substring(7, 9)) : (e = n.substring(1, 2), t = n.substring(2, 3), i = n.substring(3, 4), r = n.substring(4, 5), e += e, t += t, i += i, r += r), {
|
|
1133
1139
|
red: parseInt(e, 16),
|
|
@@ -1138,13 +1144,13 @@ function Is(n) {
|
|
|
1138
1144
|
}
|
|
1139
1145
|
const Ot = {
|
|
1140
1146
|
test: /* @__PURE__ */ on("#"),
|
|
1141
|
-
parse:
|
|
1147
|
+
parse: Ia,
|
|
1142
1148
|
transform: ye.transform
|
|
1143
1149
|
}, rt = /* @__NO_SIDE_EFFECTS__ */ (n) => ({
|
|
1144
1150
|
test: (e) => typeof e == "string" && e.endsWith(n) && e.split(" ").length === 1,
|
|
1145
1151
|
parse: parseFloat,
|
|
1146
1152
|
transform: (e) => `${e}${n}`
|
|
1147
|
-
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"), L = /* @__PURE__ */ rt("px"),
|
|
1153
|
+
}), me = /* @__PURE__ */ rt("deg"), Me = /* @__PURE__ */ rt("%"), L = /* @__PURE__ */ rt("px"), Ma = /* @__PURE__ */ rt("vh"), Pa = /* @__PURE__ */ rt("vw"), Mn = I(v({}, Me), {
|
|
1148
1154
|
parse: (n) => Me.parse(n) / 100,
|
|
1149
1155
|
transform: (n) => Me.transform(n * 100)
|
|
1150
1156
|
}), Ve = {
|
|
@@ -1155,20 +1161,20 @@ const Ot = {
|
|
|
1155
1161
|
test: (n) => ye.test(n) || Ot.test(n) || Ve.test(n),
|
|
1156
1162
|
parse: (n) => ye.test(n) ? ye.parse(n) : Ve.test(n) ? Ve.parse(n) : Ot.parse(n),
|
|
1157
1163
|
transform: (n) => typeof n == "string" ? n : n.hasOwnProperty("red") ? ye.transform(n) : Ve.transform(n)
|
|
1158
|
-
},
|
|
1159
|
-
function
|
|
1164
|
+
}, Da = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
1165
|
+
function Ra(n) {
|
|
1160
1166
|
var e, t;
|
|
1161
|
-
return isNaN(n) && typeof n == "string" && (((e = n.match(
|
|
1167
|
+
return isNaN(n) && typeof n == "string" && (((e = n.match(sn)) == null ? void 0 : e.length) || 0) + (((t = n.match(Da)) == null ? void 0 : t.length) || 0) > 0;
|
|
1162
1168
|
}
|
|
1163
|
-
const Li = "number", Vi = "color",
|
|
1169
|
+
const Li = "number", Vi = "color", Oa = "var", Na = "var(", Pn = "${}", Sa = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
|
|
1164
1170
|
function et(n) {
|
|
1165
1171
|
const e = n.toString(), t = [], i = {
|
|
1166
1172
|
color: [],
|
|
1167
1173
|
number: [],
|
|
1168
1174
|
var: []
|
|
1169
1175
|
}, r = [];
|
|
1170
|
-
let
|
|
1171
|
-
const o = e.replace(
|
|
1176
|
+
let a = 0;
|
|
1177
|
+
const o = e.replace(Sa, (l) => (U.test(l) ? (i.color.push(a), r.push(Vi), t.push(U.parse(l))) : l.startsWith(Na) ? (i.var.push(a), r.push(Oa), t.push(l)) : (i.number.push(a), r.push(Li), t.push(parseFloat(l))), ++a, Pn)).split(Pn);
|
|
1172
1178
|
return { values: t, split: o, indexes: i, types: r };
|
|
1173
1179
|
}
|
|
1174
1180
|
function Ii(n) {
|
|
@@ -1177,42 +1183,42 @@ function Ii(n) {
|
|
|
1177
1183
|
function Mi(n) {
|
|
1178
1184
|
const { split: e, types: t } = et(n), i = e.length;
|
|
1179
1185
|
return (r) => {
|
|
1180
|
-
let
|
|
1181
|
-
for (let
|
|
1182
|
-
if (
|
|
1183
|
-
const o = t[
|
|
1184
|
-
o === Li ?
|
|
1186
|
+
let a = "";
|
|
1187
|
+
for (let s = 0; s < i; s++)
|
|
1188
|
+
if (a += e[s], r[s] !== void 0) {
|
|
1189
|
+
const o = t[s];
|
|
1190
|
+
o === Li ? a += We(r[s]) : o === Vi ? a += U.transform(r[s]) : a += r[s];
|
|
1185
1191
|
}
|
|
1186
|
-
return
|
|
1192
|
+
return a;
|
|
1187
1193
|
};
|
|
1188
1194
|
}
|
|
1189
|
-
const
|
|
1190
|
-
function
|
|
1195
|
+
const Fa = (n) => typeof n == "number" ? 0 : n;
|
|
1196
|
+
function ja(n) {
|
|
1191
1197
|
const e = Ii(n);
|
|
1192
|
-
return Mi(n)(e.map(
|
|
1198
|
+
return Mi(n)(e.map(Fa));
|
|
1193
1199
|
}
|
|
1194
1200
|
const Se = {
|
|
1195
|
-
test:
|
|
1201
|
+
test: Ra,
|
|
1196
1202
|
parse: Ii,
|
|
1197
1203
|
createTransformer: Mi,
|
|
1198
|
-
getAnimatableNone:
|
|
1204
|
+
getAnimatableNone: ja
|
|
1199
1205
|
};
|
|
1200
1206
|
function Tt(n, e, t) {
|
|
1201
1207
|
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * (2 / 3 - t) * 6 : n;
|
|
1202
1208
|
}
|
|
1203
|
-
function
|
|
1209
|
+
function Ba({ hue: n, saturation: e, lightness: t, alpha: i }) {
|
|
1204
1210
|
n /= 360, e /= 100, t /= 100;
|
|
1205
|
-
let r = 0,
|
|
1211
|
+
let r = 0, a = 0, s = 0;
|
|
1206
1212
|
if (!e)
|
|
1207
|
-
r =
|
|
1213
|
+
r = a = s = t;
|
|
1208
1214
|
else {
|
|
1209
1215
|
const o = t < 0.5 ? t * (1 + e) : t + e - t * e, l = 2 * t - o;
|
|
1210
|
-
r = Tt(l, o, n + 1 / 3),
|
|
1216
|
+
r = Tt(l, o, n + 1 / 3), a = Tt(l, o, n), s = Tt(l, o, n - 1 / 3);
|
|
1211
1217
|
}
|
|
1212
1218
|
return {
|
|
1213
1219
|
red: Math.round(r * 255),
|
|
1214
|
-
green: Math.round(
|
|
1215
|
-
blue: Math.round(
|
|
1220
|
+
green: Math.round(a * 255),
|
|
1221
|
+
blue: Math.round(s * 255),
|
|
1216
1222
|
alpha: i
|
|
1217
1223
|
};
|
|
1218
1224
|
}
|
|
@@ -1222,66 +1228,66 @@ function gt(n, e) {
|
|
|
1222
1228
|
const At = (n, e, t) => {
|
|
1223
1229
|
const i = n * n, r = t * (e * e - i) + i;
|
|
1224
1230
|
return r < 0 ? 0 : Math.sqrt(r);
|
|
1225
|
-
},
|
|
1231
|
+
}, za = [Ot, ye, Ve], $a = (n) => za.find((e) => e.test(n));
|
|
1226
1232
|
function Dn(n) {
|
|
1227
|
-
const e = $
|
|
1233
|
+
const e = $a(n);
|
|
1228
1234
|
if (it(!!e, `'${n}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
1229
1235
|
return !1;
|
|
1230
1236
|
let t = e.parse(n);
|
|
1231
|
-
return e === Ve && (t =
|
|
1237
|
+
return e === Ve && (t = Ba(t)), t;
|
|
1232
1238
|
}
|
|
1233
1239
|
const Rn = (n, e) => {
|
|
1234
1240
|
const t = Dn(n), i = Dn(e);
|
|
1235
1241
|
if (!t || !i)
|
|
1236
1242
|
return gt(n, e);
|
|
1237
1243
|
const r = v({}, t);
|
|
1238
|
-
return (
|
|
1244
|
+
return (a) => (r.red = At(t.red, i.red, a), r.green = At(t.green, i.green, a), r.blue = At(t.blue, i.blue, a), r.alpha = nt(t.alpha, i.alpha, a), ye.transform(r));
|
|
1239
1245
|
}, Nt = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
1240
|
-
function
|
|
1246
|
+
function Ka(n, e) {
|
|
1241
1247
|
return Nt.has(n) ? (t) => t <= 0 ? n : e : (t) => t >= 1 ? e : n;
|
|
1242
1248
|
}
|
|
1243
|
-
const
|
|
1244
|
-
function
|
|
1249
|
+
const qa = (n, e) => (t) => e(n(t)), ln = (...n) => n.reduce(qa);
|
|
1250
|
+
function Ga(n, e) {
|
|
1245
1251
|
return (t) => nt(n, e, t);
|
|
1246
1252
|
}
|
|
1247
1253
|
function cn(n) {
|
|
1248
|
-
return typeof n == "number" ?
|
|
1254
|
+
return typeof n == "number" ? Ga : typeof n == "string" ? an(n) ? gt : U.test(n) ? Rn : Ua : Array.isArray(n) ? Pi : typeof n == "object" ? U.test(n) ? Rn : Ha : gt;
|
|
1249
1255
|
}
|
|
1250
1256
|
function Pi(n, e) {
|
|
1251
|
-
const t = [...n], i = t.length, r = n.map((
|
|
1252
|
-
return (
|
|
1253
|
-
for (let
|
|
1254
|
-
t[
|
|
1257
|
+
const t = [...n], i = t.length, r = n.map((a, s) => cn(a)(a, e[s]));
|
|
1258
|
+
return (a) => {
|
|
1259
|
+
for (let s = 0; s < i; s++)
|
|
1260
|
+
t[s] = r[s](a);
|
|
1255
1261
|
return t;
|
|
1256
1262
|
};
|
|
1257
1263
|
}
|
|
1258
|
-
function
|
|
1264
|
+
function Ha(n, e) {
|
|
1259
1265
|
const t = v(v({}, n), e), i = {};
|
|
1260
1266
|
for (const r in t)
|
|
1261
1267
|
n[r] !== void 0 && e[r] !== void 0 && (i[r] = cn(n[r])(n[r], e[r]));
|
|
1262
1268
|
return (r) => {
|
|
1263
|
-
for (const
|
|
1264
|
-
t[
|
|
1269
|
+
for (const a in i)
|
|
1270
|
+
t[a] = i[a](r);
|
|
1265
1271
|
return t;
|
|
1266
1272
|
};
|
|
1267
1273
|
}
|
|
1268
|
-
function
|
|
1274
|
+
function Ya(n, e) {
|
|
1269
1275
|
var r;
|
|
1270
1276
|
const t = [], i = { color: 0, var: 0, number: 0 };
|
|
1271
|
-
for (let
|
|
1272
|
-
const
|
|
1273
|
-
t[
|
|
1277
|
+
for (let a = 0; a < e.values.length; a++) {
|
|
1278
|
+
const s = e.types[a], o = n.indexes[s][i[s]], l = (r = n.values[o]) != null ? r : 0;
|
|
1279
|
+
t[a] = l, i[s]++;
|
|
1274
1280
|
}
|
|
1275
1281
|
return t;
|
|
1276
1282
|
}
|
|
1277
|
-
const
|
|
1283
|
+
const Ua = (n, e) => {
|
|
1278
1284
|
const t = Se.createTransformer(e), i = et(n), r = et(e);
|
|
1279
|
-
return i.indexes.var.length === r.indexes.var.length && i.indexes.color.length === r.indexes.color.length && i.indexes.number.length >= r.indexes.number.length ? Nt.has(n) && !r.values.length || Nt.has(e) && !i.values.length ?
|
|
1285
|
+
return i.indexes.var.length === r.indexes.var.length && i.indexes.color.length === r.indexes.color.length && i.indexes.number.length >= r.indexes.number.length ? Nt.has(n) && !r.values.length || Nt.has(e) && !i.values.length ? Ka(n, e) : ln(Pi(Ya(i, r), r.values), t) : (it(!0, `Complex values '${n}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), gt(n, e));
|
|
1280
1286
|
};
|
|
1281
1287
|
function Di(n, e, t) {
|
|
1282
1288
|
return typeof n == "number" && typeof e == "number" && typeof t == "number" ? nt(n, e, t) : cn(n)(n, e);
|
|
1283
1289
|
}
|
|
1284
|
-
const
|
|
1290
|
+
const Wa = (n) => {
|
|
1285
1291
|
const e = ({ timestamp: t }) => n(t);
|
|
1286
1292
|
return {
|
|
1287
1293
|
start: (t = !0) => ue.update(e, t),
|
|
@@ -1295,12 +1301,12 @@ const Ws = (n) => {
|
|
|
1295
1301
|
}, Ri = (n, e, t = 10) => {
|
|
1296
1302
|
let i = "";
|
|
1297
1303
|
const r = Math.max(Math.round(e / t), 2);
|
|
1298
|
-
for (let
|
|
1299
|
-
i += n(
|
|
1304
|
+
for (let a = 0; a < r; a++)
|
|
1305
|
+
i += n(a / (r - 1)) + ", ";
|
|
1300
1306
|
return `linear(${i.substring(0, i.length - 2)})`;
|
|
1301
|
-
},
|
|
1307
|
+
}, Za = 5;
|
|
1302
1308
|
function Oi(n, e, t) {
|
|
1303
|
-
const i = Math.max(e -
|
|
1309
|
+
const i = Math.max(e - Za, 0);
|
|
1304
1310
|
return xi(t - n(i), e - i);
|
|
1305
1311
|
}
|
|
1306
1312
|
const B = {
|
|
@@ -1332,25 +1338,25 @@ const B = {
|
|
|
1332
1338
|
minDamping: 0.05,
|
|
1333
1339
|
maxDamping: 1
|
|
1334
1340
|
}, _t = 1e-3;
|
|
1335
|
-
function
|
|
1336
|
-
let r,
|
|
1337
|
-
it(n <= /* @__PURE__ */
|
|
1338
|
-
let
|
|
1339
|
-
|
|
1340
|
-
const d = u *
|
|
1341
|
+
function Ja({ duration: n = B.duration, bounce: e = B.bounce, velocity: t = B.velocity, mass: i = B.mass }) {
|
|
1342
|
+
let r, a;
|
|
1343
|
+
it(n <= /* @__PURE__ */ se(B.maxDuration), "Spring duration must be 10 seconds or less");
|
|
1344
|
+
let s = 1 - e;
|
|
1345
|
+
s = xe(B.minDamping, B.maxDamping, s), n = xe(B.minDuration, B.maxDuration, /* @__PURE__ */ le(n)), s < 1 ? (r = (u) => {
|
|
1346
|
+
const d = u * s, h = d * n, m = d - t, p = St(u, s), g = Math.exp(-h);
|
|
1341
1347
|
return _t - m / p * g;
|
|
1342
|
-
},
|
|
1343
|
-
const h = u *
|
|
1348
|
+
}, a = (u) => {
|
|
1349
|
+
const h = u * s * n, m = h * t + t, p = Math.pow(s, 2) * Math.pow(u, 2) * n, g = Math.exp(-h), b = St(Math.pow(u, 2), s);
|
|
1344
1350
|
return (-r(u) + _t > 0 ? -1 : 1) * ((m - p) * g) / b;
|
|
1345
1351
|
}) : (r = (u) => {
|
|
1346
1352
|
const d = Math.exp(-u * n), h = (u - t) * n + 1;
|
|
1347
1353
|
return -_t + d * h;
|
|
1348
|
-
},
|
|
1354
|
+
}, a = (u) => {
|
|
1349
1355
|
const d = Math.exp(-u * n), h = (t - u) * (n * n);
|
|
1350
1356
|
return d * h;
|
|
1351
1357
|
});
|
|
1352
|
-
const o = 5 / n, l =
|
|
1353
|
-
if (n = /* @__PURE__ */
|
|
1358
|
+
const o = 5 / n, l = Qa(r, a, o);
|
|
1359
|
+
if (n = /* @__PURE__ */ se(n), isNaN(l))
|
|
1354
1360
|
return {
|
|
1355
1361
|
stiffness: B.stiffness,
|
|
1356
1362
|
damping: B.damping,
|
|
@@ -1360,26 +1366,26 @@ function Js({ duration: n = B.duration, bounce: e = B.bounce, velocity: t = B.ve
|
|
|
1360
1366
|
const u = Math.pow(l, 2) * i;
|
|
1361
1367
|
return {
|
|
1362
1368
|
stiffness: u,
|
|
1363
|
-
damping:
|
|
1369
|
+
damping: s * 2 * Math.sqrt(i * u),
|
|
1364
1370
|
duration: n
|
|
1365
1371
|
};
|
|
1366
1372
|
}
|
|
1367
1373
|
}
|
|
1368
|
-
const
|
|
1369
|
-
function
|
|
1374
|
+
const Xa = 12;
|
|
1375
|
+
function Qa(n, e, t) {
|
|
1370
1376
|
let i = t;
|
|
1371
|
-
for (let r = 1; r <
|
|
1377
|
+
for (let r = 1; r < Xa; r++)
|
|
1372
1378
|
i = i - n(i) / e(i);
|
|
1373
1379
|
return i;
|
|
1374
1380
|
}
|
|
1375
1381
|
function St(n, e) {
|
|
1376
1382
|
return n * Math.sqrt(1 - e * e);
|
|
1377
1383
|
}
|
|
1378
|
-
const
|
|
1384
|
+
const es = ["duration", "bounce"], ts = ["stiffness", "damping", "mass"];
|
|
1379
1385
|
function On(n, e) {
|
|
1380
1386
|
return e.some((t) => n[t] !== void 0);
|
|
1381
1387
|
}
|
|
1382
|
-
function
|
|
1388
|
+
function ns(n) {
|
|
1383
1389
|
let e = v({
|
|
1384
1390
|
velocity: B.velocity,
|
|
1385
1391
|
stiffness: B.stiffness,
|
|
@@ -1387,16 +1393,16 @@ function na(n) {
|
|
|
1387
1393
|
mass: B.mass,
|
|
1388
1394
|
isResolvedFromDuration: !1
|
|
1389
1395
|
}, n);
|
|
1390
|
-
if (!On(n,
|
|
1396
|
+
if (!On(n, ts) && On(n, es))
|
|
1391
1397
|
if (n.visualDuration) {
|
|
1392
|
-
const t = n.visualDuration, i = 2 * Math.PI / (t * 1.2), r = i * i,
|
|
1398
|
+
const t = n.visualDuration, i = 2 * Math.PI / (t * 1.2), r = i * i, a = 2 * xe(0.05, 1, 1 - (n.bounce || 0)) * Math.sqrt(r);
|
|
1393
1399
|
e = I(v({}, e), {
|
|
1394
1400
|
mass: B.mass,
|
|
1395
1401
|
stiffness: r,
|
|
1396
|
-
damping:
|
|
1402
|
+
damping: a
|
|
1397
1403
|
});
|
|
1398
1404
|
} else {
|
|
1399
|
-
const t =
|
|
1405
|
+
const t = Ja(n);
|
|
1400
1406
|
e = I(v(v({}, e), t), {
|
|
1401
1407
|
mass: B.mass
|
|
1402
1408
|
}), e.isResolvedFromDuration = !0;
|
|
@@ -1410,24 +1416,24 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1410
1416
|
bounce: e
|
|
1411
1417
|
} : n;
|
|
1412
1418
|
let { restSpeed: i, restDelta: r } = t;
|
|
1413
|
-
const
|
|
1419
|
+
const a = t.keyframes[0], s = t.keyframes[t.keyframes.length - 1], o = { done: !1, value: a }, { stiffness: l, damping: u, mass: d, duration: h, velocity: m, isResolvedFromDuration: p } = ns(I(v({}, t), {
|
|
1414
1420
|
velocity: -/* @__PURE__ */ le(t.velocity || 0)
|
|
1415
|
-
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)), y =
|
|
1421
|
+
})), g = m || 0, b = u / (2 * Math.sqrt(l * d)), y = s - a, E = /* @__PURE__ */ le(Math.sqrt(l / d)), V = Math.abs(y) < 5;
|
|
1416
1422
|
i || (i = V ? B.restSpeed.granular : B.restSpeed.default), r || (r = V ? B.restDelta.granular : B.restDelta.default);
|
|
1417
1423
|
let _;
|
|
1418
1424
|
if (b < 1) {
|
|
1419
|
-
const T = St(
|
|
1425
|
+
const T = St(E, b);
|
|
1420
1426
|
_ = (D) => {
|
|
1421
|
-
const C = Math.exp(-b *
|
|
1422
|
-
return
|
|
1427
|
+
const C = Math.exp(-b * E * D);
|
|
1428
|
+
return s - C * ((g + b * E * y) / T * Math.sin(T * D) + y * Math.cos(T * D));
|
|
1423
1429
|
};
|
|
1424
1430
|
} else if (b === 1)
|
|
1425
|
-
_ = (T) =>
|
|
1431
|
+
_ = (T) => s - Math.exp(-E * T) * (y + (g + E * y) * T);
|
|
1426
1432
|
else {
|
|
1427
|
-
const T =
|
|
1433
|
+
const T = E * Math.sqrt(b * b - 1);
|
|
1428
1434
|
_ = (D) => {
|
|
1429
|
-
const C = Math.exp(-b *
|
|
1430
|
-
return
|
|
1435
|
+
const C = Math.exp(-b * E * D), w = Math.min(T * D, 300);
|
|
1436
|
+
return s - C * ((g + b * E * y) * Math.sinh(w) + T * y * Math.cosh(w)) / T;
|
|
1431
1437
|
};
|
|
1432
1438
|
}
|
|
1433
1439
|
const M = {
|
|
@@ -1438,11 +1444,11 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1438
1444
|
o.done = T >= h;
|
|
1439
1445
|
else {
|
|
1440
1446
|
let C = T === 0 ? g : 0;
|
|
1441
|
-
b < 1 && (C = T === 0 ? /* @__PURE__ */
|
|
1442
|
-
const w = Math.abs(C) <= i, R = Math.abs(
|
|
1447
|
+
b < 1 && (C = T === 0 ? /* @__PURE__ */ se(g) : Oi(_, T, D));
|
|
1448
|
+
const w = Math.abs(C) <= i, R = Math.abs(s - D) <= r;
|
|
1443
1449
|
o.done = w && R;
|
|
1444
1450
|
}
|
|
1445
|
-
return o.value = o.done ?
|
|
1451
|
+
return o.value = o.done ? s : D, o;
|
|
1446
1452
|
},
|
|
1447
1453
|
toString: () => {
|
|
1448
1454
|
const T = Math.min(nn(M), mt), D = Ri((C) => M.next(T * C).value, T, 30);
|
|
@@ -1455,19 +1461,19 @@ function tt(n = B.visualDuration, e = B.bounce) {
|
|
|
1455
1461
|
}
|
|
1456
1462
|
tt.applyToOptions = (n) => {
|
|
1457
1463
|
const e = yi(n, 100, tt);
|
|
1458
|
-
return n.ease = e.ease, n.duration = /* @__PURE__ */
|
|
1464
|
+
return n.ease = e.ease, n.duration = /* @__PURE__ */ se(e.duration), n.type = "keyframes", n;
|
|
1459
1465
|
};
|
|
1460
|
-
function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 325, bounceDamping: r = 10, bounceStiffness:
|
|
1466
|
+
function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 325, bounceDamping: r = 10, bounceStiffness: a = 500, modifyTarget: s, min: o, max: l, restDelta: u = 0.5, restSpeed: d }) {
|
|
1461
1467
|
const h = n[0], m = {
|
|
1462
1468
|
done: !1,
|
|
1463
1469
|
value: h
|
|
1464
1470
|
}, p = (w) => o !== void 0 && w < o || l !== void 0 && w > l, g = (w) => o === void 0 ? l : l === void 0 || Math.abs(o - w) < Math.abs(l - w) ? o : l;
|
|
1465
1471
|
let b = t * e;
|
|
1466
|
-
const y = h + b,
|
|
1467
|
-
|
|
1468
|
-
const V = (w) => -b * Math.exp(-w / i), _ = (w) =>
|
|
1472
|
+
const y = h + b, E = s === void 0 ? y : s(y);
|
|
1473
|
+
E !== y && (b = E - h);
|
|
1474
|
+
const V = (w) => -b * Math.exp(-w / i), _ = (w) => E + V(w), M = (w) => {
|
|
1469
1475
|
const R = V(w), O = _(w);
|
|
1470
|
-
m.done = Math.abs(R) <= u, m.value = m.done ?
|
|
1476
|
+
m.done = Math.abs(R) <= u, m.value = m.done ? E : O;
|
|
1471
1477
|
};
|
|
1472
1478
|
let T, D;
|
|
1473
1479
|
const C = (w) => {
|
|
@@ -1476,7 +1482,7 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1476
1482
|
velocity: Oi(_, w, m.value),
|
|
1477
1483
|
// TODO: This should be passing * 1000
|
|
1478
1484
|
damping: r,
|
|
1479
|
-
stiffness:
|
|
1485
|
+
stiffness: a,
|
|
1480
1486
|
restDelta: u,
|
|
1481
1487
|
restSpeed: d
|
|
1482
1488
|
}));
|
|
@@ -1489,28 +1495,28 @@ function Ft({ keyframes: n, velocity: e = 0, power: t = 0.8, timeConstant: i = 3
|
|
|
1489
1495
|
}
|
|
1490
1496
|
};
|
|
1491
1497
|
}
|
|
1492
|
-
function
|
|
1493
|
-
const i = [], r = t || de.mix || Di,
|
|
1494
|
-
for (let
|
|
1495
|
-
let o = r(n[
|
|
1498
|
+
function is(n, e, t) {
|
|
1499
|
+
const i = [], r = t || de.mix || Di, a = n.length - 1;
|
|
1500
|
+
for (let s = 0; s < a; s++) {
|
|
1501
|
+
let o = r(n[s], n[s + 1]);
|
|
1496
1502
|
if (e) {
|
|
1497
|
-
const l = Array.isArray(e) ? e[
|
|
1503
|
+
const l = Array.isArray(e) ? e[s] || De : e;
|
|
1498
1504
|
o = ln(l, o);
|
|
1499
1505
|
}
|
|
1500
1506
|
i.push(o);
|
|
1501
1507
|
}
|
|
1502
1508
|
return i;
|
|
1503
1509
|
}
|
|
1504
|
-
function
|
|
1505
|
-
const
|
|
1506
|
-
if (ce(
|
|
1510
|
+
function rs(n, e, { clamp: t = !0, ease: i, mixer: r } = {}) {
|
|
1511
|
+
const a = n.length;
|
|
1512
|
+
if (ce(a === e.length, "Both input and output ranges must be the same length"), a === 1)
|
|
1507
1513
|
return () => e[0];
|
|
1508
|
-
if (
|
|
1514
|
+
if (a === 2 && e[0] === e[1])
|
|
1509
1515
|
return () => e[1];
|
|
1510
|
-
const
|
|
1511
|
-
n[0] > n[
|
|
1512
|
-
const o =
|
|
1513
|
-
if (
|
|
1516
|
+
const s = n[0] === n[1];
|
|
1517
|
+
n[0] > n[a - 1] && (n = [...n].reverse(), e = [...e].reverse());
|
|
1518
|
+
const o = is(e, i, r), l = o.length, u = (d) => {
|
|
1519
|
+
if (s && d < n[0])
|
|
1514
1520
|
return e[0];
|
|
1515
1521
|
let h = 0;
|
|
1516
1522
|
if (l > 1)
|
|
@@ -1519,72 +1525,72 @@ function ra(n, e, { clamp: t = !0, ease: i, mixer: r } = {}) {
|
|
|
1519
1525
|
const m = /* @__PURE__ */ en(n[h], n[h + 1], d);
|
|
1520
1526
|
return o[h](m);
|
|
1521
1527
|
};
|
|
1522
|
-
return t ? (d) => u(xe(n[0], n[
|
|
1528
|
+
return t ? (d) => u(xe(n[0], n[a - 1], d)) : u;
|
|
1523
1529
|
}
|
|
1524
|
-
function
|
|
1530
|
+
function as(n, e) {
|
|
1525
1531
|
return n.map((t) => t * e);
|
|
1526
1532
|
}
|
|
1527
|
-
const Ni = (n, e, t) => (((1 - 3 * t + 3 * e) * n + (3 * t - 6 * e)) * n + 3 * e) * n,
|
|
1528
|
-
function
|
|
1529
|
-
let
|
|
1533
|
+
const Ni = (n, e, t) => (((1 - 3 * t + 3 * e) * n + (3 * t - 6 * e)) * n + 3 * e) * n, ss = 1e-7, os = 12;
|
|
1534
|
+
function ls(n, e, t, i, r) {
|
|
1535
|
+
let a, s, o = 0;
|
|
1530
1536
|
do
|
|
1531
|
-
|
|
1532
|
-
while (Math.abs(
|
|
1533
|
-
return
|
|
1537
|
+
s = e + (t - e) / 2, a = Ni(s, i, r) - n, a > 0 ? t = s : e = s;
|
|
1538
|
+
while (Math.abs(a) > ss && ++o < os);
|
|
1539
|
+
return s;
|
|
1534
1540
|
}
|
|
1535
|
-
function
|
|
1541
|
+
function at(n, e, t, i) {
|
|
1536
1542
|
if (n === e && t === i)
|
|
1537
1543
|
return De;
|
|
1538
|
-
const r = (
|
|
1539
|
-
return (
|
|
1544
|
+
const r = (a) => ls(a, 0, 1, n, t);
|
|
1545
|
+
return (a) => a === 0 || a === 1 ? a : Ni(r(a), e, i);
|
|
1540
1546
|
}
|
|
1541
|
-
const
|
|
1547
|
+
const cs = /* @__PURE__ */ at(0.42, 0, 1, 1), ds = /* @__PURE__ */ at(0, 0, 0.58, 1), Si = /* @__PURE__ */ at(0.42, 0, 0.58, 1), Fi = (n) => (e) => e <= 0.5 ? n(2 * e) / 2 : (2 - n(2 * (1 - e))) / 2, ji = (n) => (e) => 1 - n(1 - e), Bi = /* @__PURE__ */ at(0.33, 1.53, 0.69, 0.99), dn = /* @__PURE__ */ ji(Bi), zi = /* @__PURE__ */ Fi(dn), $i = (n) => (n *= 2) < 1 ? 0.5 * dn(n) : 0.5 * (2 - Math.pow(2, -10 * (n - 1))), un = (n) => 1 - Math.sin(Math.acos(n)), us = ji(un), Ki = Fi(un), qi = (n) => Array.isArray(n) && typeof n[0] == "number", Nn = {
|
|
1542
1548
|
linear: De,
|
|
1543
|
-
easeIn:
|
|
1549
|
+
easeIn: cs,
|
|
1544
1550
|
easeInOut: Si,
|
|
1545
|
-
easeOut:
|
|
1551
|
+
easeOut: ds,
|
|
1546
1552
|
circIn: un,
|
|
1547
1553
|
circInOut: Ki,
|
|
1548
|
-
circOut:
|
|
1554
|
+
circOut: us,
|
|
1549
1555
|
backIn: dn,
|
|
1550
1556
|
backInOut: zi,
|
|
1551
1557
|
backOut: Bi,
|
|
1552
1558
|
anticipate: $i
|
|
1553
|
-
},
|
|
1559
|
+
}, hs = (n) => typeof n == "string", Sn = (n) => {
|
|
1554
1560
|
if (qi(n)) {
|
|
1555
1561
|
ce(n.length === 4, "Cubic bezier arrays must contain four numerical values.");
|
|
1556
1562
|
const [e, t, i, r] = n;
|
|
1557
|
-
return
|
|
1558
|
-
} else if (
|
|
1563
|
+
return at(e, t, i, r);
|
|
1564
|
+
} else if (hs(n))
|
|
1559
1565
|
return ce(Nn[n] !== void 0, `Invalid easing type '${n}'`), Nn[n];
|
|
1560
1566
|
return n;
|
|
1561
1567
|
};
|
|
1562
|
-
function
|
|
1568
|
+
function ps(n, e) {
|
|
1563
1569
|
return n.map(() => e || Si).splice(0, n.length - 1);
|
|
1564
1570
|
}
|
|
1565
1571
|
function Ie({ duration: n = 300, keyframes: e, times: t, ease: i = "easeInOut" }) {
|
|
1566
|
-
const r = mi(i) ? i.map(Sn) : Sn(i),
|
|
1572
|
+
const r = mi(i) ? i.map(Sn) : Sn(i), a = {
|
|
1567
1573
|
done: !1,
|
|
1568
1574
|
value: e[0]
|
|
1569
|
-
},
|
|
1575
|
+
}, s = as(
|
|
1570
1576
|
// Only use the provided offsets if they're the correct length
|
|
1571
1577
|
// TODO Maybe we should warn here if there's a length mismatch
|
|
1572
1578
|
t && t.length === e.length ? t : vi(e),
|
|
1573
1579
|
n
|
|
1574
|
-
), o =
|
|
1575
|
-
ease: Array.isArray(r) ? r :
|
|
1580
|
+
), o = rs(s, e, {
|
|
1581
|
+
ease: Array.isArray(r) ? r : ps(e, r)
|
|
1576
1582
|
});
|
|
1577
1583
|
return {
|
|
1578
1584
|
calculatedDuration: n,
|
|
1579
|
-
next: (l) => (
|
|
1585
|
+
next: (l) => (a.value = o(l), a.done = l >= n, a)
|
|
1580
1586
|
};
|
|
1581
1587
|
}
|
|
1582
|
-
const
|
|
1588
|
+
const ms = (n) => n !== null;
|
|
1583
1589
|
function hn(n, { repeat: e, repeatType: t = "loop" }, i, r = 1) {
|
|
1584
|
-
const
|
|
1585
|
-
return !o || i === void 0 ?
|
|
1590
|
+
const a = n.filter(ms), o = r < 0 || e && t !== "loop" && e % 2 === 1 ? 0 : a.length - 1;
|
|
1591
|
+
return !o || i === void 0 ? a[o] : i;
|
|
1586
1592
|
}
|
|
1587
|
-
const
|
|
1593
|
+
const fs = {
|
|
1588
1594
|
decay: Ft,
|
|
1589
1595
|
inertia: Ft,
|
|
1590
1596
|
tween: Ie,
|
|
@@ -1592,7 +1598,7 @@ const fa = {
|
|
|
1592
1598
|
spring: tt
|
|
1593
1599
|
};
|
|
1594
1600
|
function Gi(n) {
|
|
1595
|
-
typeof n.type == "string" && (n.type =
|
|
1601
|
+
typeof n.type == "string" && (n.type = fs[n.type]);
|
|
1596
1602
|
}
|
|
1597
1603
|
class pn {
|
|
1598
1604
|
constructor() {
|
|
@@ -1618,7 +1624,7 @@ class pn {
|
|
|
1618
1624
|
return this.finished.then(e, t);
|
|
1619
1625
|
}
|
|
1620
1626
|
}
|
|
1621
|
-
const
|
|
1627
|
+
const gs = (n) => n / 100;
|
|
1622
1628
|
class mn extends pn {
|
|
1623
1629
|
constructor(e) {
|
|
1624
1630
|
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.stop = () => {
|
|
@@ -1630,14 +1636,14 @@ class mn extends pn {
|
|
|
1630
1636
|
initAnimation() {
|
|
1631
1637
|
const { options: e } = this;
|
|
1632
1638
|
Gi(e);
|
|
1633
|
-
const { type: t = Ie, repeat: i = 0, repeatDelay: r = 0, repeatType:
|
|
1639
|
+
const { type: t = Ie, repeat: i = 0, repeatDelay: r = 0, repeatType: a, velocity: s = 0 } = e;
|
|
1634
1640
|
let { keyframes: o } = e;
|
|
1635
1641
|
const l = t || Ie;
|
|
1636
|
-
process.env.NODE_ENV !== "production" && l !== Ie && ce(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`), l !== Ie && typeof o[0] != "number" && (this.mixKeyframes = ln(
|
|
1642
|
+
process.env.NODE_ENV !== "production" && l !== Ie && ce(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`), l !== Ie && typeof o[0] != "number" && (this.mixKeyframes = ln(gs, Di(o[0], o[1])), o = [0, 100]);
|
|
1637
1643
|
const u = l(I(v({}, e), { keyframes: o }));
|
|
1638
|
-
|
|
1644
|
+
a === "mirror" && (this.mirroredGenerator = l(I(v({}, e), {
|
|
1639
1645
|
keyframes: [...o].reverse(),
|
|
1640
|
-
velocity: -
|
|
1646
|
+
velocity: -s
|
|
1641
1647
|
}))), u.calculatedDuration === null && (u.calculatedDuration = nn(u));
|
|
1642
1648
|
const { calculatedDuration: d } = u;
|
|
1643
1649
|
this.calculatedDuration = d, this.resolvedDuration = d + r, this.totalDuration = this.resolvedDuration * (i + 1) - r, this.generator = u;
|
|
@@ -1647,21 +1653,21 @@ class mn extends pn {
|
|
|
1647
1653
|
this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = t;
|
|
1648
1654
|
}
|
|
1649
1655
|
tick(e, t = !1) {
|
|
1650
|
-
const { generator: i, totalDuration: r, mixKeyframes:
|
|
1656
|
+
const { generator: i, totalDuration: r, mixKeyframes: a, mirroredGenerator: s, resolvedDuration: o, calculatedDuration: l } = this;
|
|
1651
1657
|
if (this.startTime === null)
|
|
1652
1658
|
return i.next(0);
|
|
1653
1659
|
const { delay: u = 0, keyframes: d, repeat: h, repeatType: m, repeatDelay: p, type: g, onUpdate: b, finalKeyframe: y } = this.options;
|
|
1654
1660
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, e) : this.speed < 0 && (this.startTime = Math.min(e - r / this.speed, this.startTime)), t ? this.currentTime = e : this.updateTime(e);
|
|
1655
|
-
const
|
|
1656
|
-
this.currentTime = Math.max(
|
|
1661
|
+
const E = this.currentTime - u * (this.playbackSpeed >= 0 ? 1 : -1), V = this.playbackSpeed >= 0 ? E < 0 : E > r;
|
|
1662
|
+
this.currentTime = Math.max(E, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
|
|
1657
1663
|
let _ = this.currentTime, M = i;
|
|
1658
1664
|
if (h) {
|
|
1659
1665
|
const w = Math.min(this.currentTime, r) / o;
|
|
1660
1666
|
let R = Math.floor(w), O = w % 1;
|
|
1661
|
-
!O && w >= 1 && (O = 1), O === 1 && R--, R = Math.min(R, h + 1), !!(R % 2) && (m === "reverse" ? (O = 1 - O, p && (O -= p / o)) : m === "mirror" && (M =
|
|
1667
|
+
!O && w >= 1 && (O = 1), O === 1 && R--, R = Math.min(R, h + 1), !!(R % 2) && (m === "reverse" ? (O = 1 - O, p && (O -= p / o)) : m === "mirror" && (M = s)), _ = xe(0, 1, O) * o;
|
|
1662
1668
|
}
|
|
1663
1669
|
const T = V ? { done: !1, value: d[0] } : M.next(_);
|
|
1664
|
-
|
|
1670
|
+
a && (T.value = a(T.value));
|
|
1665
1671
|
let { done: D } = T;
|
|
1666
1672
|
!V && l !== null && (D = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
|
|
1667
1673
|
const C = this.holdTime === null && (this.state === "finished" || this.state === "running" && D);
|
|
@@ -1683,7 +1689,7 @@ class mn extends pn {
|
|
|
1683
1689
|
}
|
|
1684
1690
|
set time(e) {
|
|
1685
1691
|
var t;
|
|
1686
|
-
e = /* @__PURE__ */
|
|
1692
|
+
e = /* @__PURE__ */ se(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), (t = this.driver) == null || t.start(!1);
|
|
1687
1693
|
}
|
|
1688
1694
|
get speed() {
|
|
1689
1695
|
return this.playbackSpeed;
|
|
@@ -1694,11 +1700,11 @@ class mn extends pn {
|
|
|
1694
1700
|
this.playbackSpeed = e, t && (this.time = /* @__PURE__ */ le(this.currentTime));
|
|
1695
1701
|
}
|
|
1696
1702
|
play() {
|
|
1697
|
-
var r,
|
|
1703
|
+
var r, a;
|
|
1698
1704
|
if (this.isStopped)
|
|
1699
1705
|
return;
|
|
1700
|
-
const { driver: e =
|
|
1701
|
-
this.driver || (this.driver = e((
|
|
1706
|
+
const { driver: e = Wa, startTime: t } = this.options;
|
|
1707
|
+
this.driver || (this.driver = e((s) => this.tick(s))), (a = (r = this.options).onPlay) == null || a.call(r);
|
|
1702
1708
|
const i = this.driver.now();
|
|
1703
1709
|
this.state === "finished" ? (this.updateFinished(), this.startTime = i) : this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime || (this.startTime = t != null ? t : i), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
1704
1710
|
}
|
|
@@ -1730,7 +1736,7 @@ class mn extends pn {
|
|
|
1730
1736
|
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), (t = this.driver) == null || t.stop(), e.observe(this);
|
|
1731
1737
|
}
|
|
1732
1738
|
}
|
|
1733
|
-
function
|
|
1739
|
+
function bs(n) {
|
|
1734
1740
|
var e;
|
|
1735
1741
|
for (let t = 1; t < n.length; t++)
|
|
1736
1742
|
(e = n[t]) != null || (n[t] = n[t - 1]);
|
|
@@ -1738,7 +1744,7 @@ function ba(n) {
|
|
|
1738
1744
|
const Ce = (n) => n * 180 / Math.PI, jt = (n) => {
|
|
1739
1745
|
const e = Ce(Math.atan2(n[1], n[0]));
|
|
1740
1746
|
return Bt(e);
|
|
1741
|
-
},
|
|
1747
|
+
}, vs = {
|
|
1742
1748
|
x: 4,
|
|
1743
1749
|
y: 5,
|
|
1744
1750
|
translateX: 4,
|
|
@@ -1751,7 +1757,7 @@ const Ce = (n) => n * 180 / Math.PI, jt = (n) => {
|
|
|
1751
1757
|
skewX: (n) => Ce(Math.atan(n[1])),
|
|
1752
1758
|
skewY: (n) => Ce(Math.atan(n[2])),
|
|
1753
1759
|
skew: (n) => (Math.abs(n[1]) + Math.abs(n[2])) / 2
|
|
1754
|
-
}, Bt = (n) => (n = n % 360, n < 0 && (n += 360), n), Fn = jt, jn = (n) => Math.sqrt(n[0] * n[0] + n[1] * n[1]), Bn = (n) => Math.sqrt(n[4] * n[4] + n[5] * n[5]),
|
|
1760
|
+
}, Bt = (n) => (n = n % 360, n < 0 && (n += 360), n), Fn = jt, jn = (n) => Math.sqrt(n[0] * n[0] + n[1] * n[1]), Bn = (n) => Math.sqrt(n[4] * n[4] + n[5] * n[5]), ys = {
|
|
1755
1761
|
x: 12,
|
|
1756
1762
|
y: 13,
|
|
1757
1763
|
z: 14,
|
|
@@ -1778,27 +1784,27 @@ function $t(n, e) {
|
|
|
1778
1784
|
const t = n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);
|
|
1779
1785
|
let i, r;
|
|
1780
1786
|
if (t)
|
|
1781
|
-
i =
|
|
1787
|
+
i = ys, r = t;
|
|
1782
1788
|
else {
|
|
1783
1789
|
const o = n.match(/^matrix\(([-\d.e\s,]+)\)$/u);
|
|
1784
|
-
i =
|
|
1790
|
+
i = vs, r = o;
|
|
1785
1791
|
}
|
|
1786
1792
|
if (!r)
|
|
1787
1793
|
return zt(e);
|
|
1788
|
-
const
|
|
1789
|
-
return typeof
|
|
1794
|
+
const a = i[e], s = r[1].split(",").map(ks);
|
|
1795
|
+
return typeof a == "function" ? a(s) : s[a];
|
|
1790
1796
|
}
|
|
1791
|
-
const
|
|
1797
|
+
const Cs = (n, e) => {
|
|
1792
1798
|
const { transform: t = "none" } = getComputedStyle(n);
|
|
1793
1799
|
return $t(t, e);
|
|
1794
1800
|
};
|
|
1795
|
-
function
|
|
1801
|
+
function ks(n) {
|
|
1796
1802
|
return parseFloat(n.trim());
|
|
1797
1803
|
}
|
|
1798
|
-
const zn = (n) => n === Ne || n === L,
|
|
1799
|
-
function
|
|
1804
|
+
const zn = (n) => n === Ne || n === L, Es = /* @__PURE__ */ new Set(["x", "y", "z"]), xs = Re.filter((n) => !Es.has(n));
|
|
1805
|
+
function ws(n) {
|
|
1800
1806
|
const e = [];
|
|
1801
|
-
return
|
|
1807
|
+
return xs.forEach((t) => {
|
|
1802
1808
|
const i = n.getValue(t);
|
|
1803
1809
|
i !== void 0 && (e.push([t, i.get()]), i.set(t.startsWith("scale") ? 1 : 0));
|
|
1804
1810
|
}), e;
|
|
@@ -1823,14 +1829,14 @@ function Hi() {
|
|
|
1823
1829
|
if (qt) {
|
|
1824
1830
|
const n = Array.from(Ee).filter((i) => i.needsMeasurement), e = new Set(n.map((i) => i.element)), t = /* @__PURE__ */ new Map();
|
|
1825
1831
|
e.forEach((i) => {
|
|
1826
|
-
const r =
|
|
1832
|
+
const r = ws(i);
|
|
1827
1833
|
r.length && (t.set(i, r), i.render());
|
|
1828
1834
|
}), n.forEach((i) => i.measureInitialState()), e.forEach((i) => {
|
|
1829
1835
|
i.render();
|
|
1830
1836
|
const r = t.get(i);
|
|
1831
|
-
r && r.forEach(([
|
|
1837
|
+
r && r.forEach(([a, s]) => {
|
|
1832
1838
|
var o;
|
|
1833
|
-
(o = i.getValue(
|
|
1839
|
+
(o = i.getValue(a)) == null || o.set(s);
|
|
1834
1840
|
});
|
|
1835
1841
|
}), n.forEach((i) => i.measureEndState()), n.forEach((i) => {
|
|
1836
1842
|
i.suspendedScrollY !== void 0 && window.scrollTo(0, i.suspendedScrollY);
|
|
@@ -1843,12 +1849,12 @@ function Yi() {
|
|
|
1843
1849
|
n.readKeyframes(), n.needsMeasurement && (qt = !0);
|
|
1844
1850
|
});
|
|
1845
1851
|
}
|
|
1846
|
-
function
|
|
1852
|
+
function Ts() {
|
|
1847
1853
|
Gt = !0, Yi(), Hi(), Gt = !1;
|
|
1848
1854
|
}
|
|
1849
1855
|
class fn {
|
|
1850
|
-
constructor(e, t, i, r,
|
|
1851
|
-
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = t, this.name = i, this.motionValue = r, this.element =
|
|
1856
|
+
constructor(e, t, i, r, a, s = !1) {
|
|
1857
|
+
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = t, this.name = i, this.motionValue = r, this.element = a, this.isAsync = s;
|
|
1852
1858
|
}
|
|
1853
1859
|
scheduleResolve() {
|
|
1854
1860
|
this.state = "scheduled", this.isAsync ? (Ee.add(this), Kt || (Kt = !0, ue.read(Yi), ue.resolveKeyframes(Hi))) : (this.readKeyframes(), this.complete());
|
|
@@ -1856,16 +1862,16 @@ class fn {
|
|
|
1856
1862
|
readKeyframes() {
|
|
1857
1863
|
const { unresolvedKeyframes: e, name: t, element: i, motionValue: r } = this;
|
|
1858
1864
|
if (e[0] === null) {
|
|
1859
|
-
const
|
|
1860
|
-
if (
|
|
1861
|
-
e[0] =
|
|
1865
|
+
const a = r == null ? void 0 : r.get(), s = e[e.length - 1];
|
|
1866
|
+
if (a !== void 0)
|
|
1867
|
+
e[0] = a;
|
|
1862
1868
|
else if (i && t) {
|
|
1863
|
-
const o = i.readValue(t,
|
|
1869
|
+
const o = i.readValue(t, s);
|
|
1864
1870
|
o != null && (e[0] = o);
|
|
1865
1871
|
}
|
|
1866
|
-
e[0] === void 0 && (e[0] =
|
|
1872
|
+
e[0] === void 0 && (e[0] = s), r && a === void 0 && r.set(e[0]);
|
|
1867
1873
|
}
|
|
1868
|
-
|
|
1874
|
+
bs(e);
|
|
1869
1875
|
}
|
|
1870
1876
|
setFinalKeyframe() {
|
|
1871
1877
|
}
|
|
@@ -1885,24 +1891,24 @@ class fn {
|
|
|
1885
1891
|
this.state === "pending" && this.scheduleResolve();
|
|
1886
1892
|
}
|
|
1887
1893
|
}
|
|
1888
|
-
const
|
|
1889
|
-
function
|
|
1890
|
-
|
|
1894
|
+
const As = (n) => n.startsWith("--");
|
|
1895
|
+
function _s(n, e, t) {
|
|
1896
|
+
As(e) ? n.style.setProperty(e, t) : n.style[e] = t;
|
|
1891
1897
|
}
|
|
1892
1898
|
// @__NO_SIDE_EFFECTS__
|
|
1893
1899
|
function gn(n) {
|
|
1894
1900
|
let e;
|
|
1895
1901
|
return () => (e === void 0 && (e = n()), e);
|
|
1896
1902
|
}
|
|
1897
|
-
const
|
|
1898
|
-
function
|
|
1903
|
+
const Ls = /* @__PURE__ */ gn(() => window.ScrollTimeline !== void 0), Vs = {};
|
|
1904
|
+
function Is(n, e) {
|
|
1899
1905
|
const t = /* @__PURE__ */ gn(n);
|
|
1900
1906
|
return () => {
|
|
1901
1907
|
var i;
|
|
1902
|
-
return (i =
|
|
1908
|
+
return (i = Vs[e]) != null ? i : t();
|
|
1903
1909
|
};
|
|
1904
1910
|
}
|
|
1905
|
-
const Ui = /* @__PURE__ */
|
|
1911
|
+
const Ui = /* @__PURE__ */ Is(() => {
|
|
1906
1912
|
try {
|
|
1907
1913
|
document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
|
|
1908
1914
|
} catch (n) {
|
|
@@ -1924,7 +1930,7 @@ function Wi(n, e) {
|
|
|
1924
1930
|
if (n)
|
|
1925
1931
|
return typeof n == "function" ? Ui() ? Ri(n, e) : "ease-out" : qi(n) ? Ue(n) : Array.isArray(n) ? n.map((t) => Wi(t, e) || $n.easeOut) : $n[n];
|
|
1926
1932
|
}
|
|
1927
|
-
function
|
|
1933
|
+
function Ms(n, e, t, { delay: i = 0, duration: r = 300, repeat: a = 0, repeatType: s = "loop", ease: o = "easeOut", times: l } = {}, u = void 0) {
|
|
1928
1934
|
const d = {
|
|
1929
1935
|
[e]: t
|
|
1930
1936
|
};
|
|
@@ -1936,27 +1942,27 @@ function Ma(n, e, t, { delay: i = 0, duration: r = 300, repeat: s = 0, repeatTyp
|
|
|
1936
1942
|
duration: r,
|
|
1937
1943
|
easing: Array.isArray(h) ? "linear" : h,
|
|
1938
1944
|
fill: "both",
|
|
1939
|
-
iterations:
|
|
1940
|
-
direction:
|
|
1945
|
+
iterations: a + 1,
|
|
1946
|
+
direction: s === "reverse" ? "alternate" : "normal"
|
|
1941
1947
|
};
|
|
1942
1948
|
return u && (m.pseudoElement = u), n.animate(d, m);
|
|
1943
1949
|
}
|
|
1944
|
-
function
|
|
1945
|
-
var i = t, { type: n } = i, e =
|
|
1946
|
-
var r,
|
|
1947
|
-
return tn(n) && Ui() ? n.applyToOptions(e) : ((r = e.duration) != null || (e.duration = 300), (
|
|
1950
|
+
function Ps(t) {
|
|
1951
|
+
var i = t, { type: n } = i, e = ae(i, ["type"]);
|
|
1952
|
+
var r, a;
|
|
1953
|
+
return tn(n) && Ui() ? n.applyToOptions(e) : ((r = e.duration) != null || (e.duration = 300), (a = e.ease) != null || (e.ease = "easeOut"), e);
|
|
1948
1954
|
}
|
|
1949
|
-
class
|
|
1955
|
+
class Ds extends pn {
|
|
1950
1956
|
constructor(e) {
|
|
1951
1957
|
if (super(), this.finishedTime = null, this.isStopped = !1, !e)
|
|
1952
1958
|
return;
|
|
1953
|
-
const { element: t, name: i, keyframes: r, pseudoElement:
|
|
1954
|
-
this.isPseudoElement = !!
|
|
1955
|
-
const u =
|
|
1956
|
-
this.animation =
|
|
1957
|
-
if (this.finishedTime = this.time, !
|
|
1959
|
+
const { element: t, name: i, keyframes: r, pseudoElement: a, allowFlatten: s = !1, finalKeyframe: o, onComplete: l } = e;
|
|
1960
|
+
this.isPseudoElement = !!a, this.allowFlatten = s, this.options = e, ce(typeof e.type != "string", `animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);
|
|
1961
|
+
const u = Ps(e);
|
|
1962
|
+
this.animation = Ms(t, i, r, u, a), u.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
1963
|
+
if (this.finishedTime = this.time, !a) {
|
|
1958
1964
|
const d = hn(r, this.options, o, this.speed);
|
|
1959
|
-
this.updateMotionValue ? this.updateMotionValue(d) :
|
|
1965
|
+
this.updateMotionValue ? this.updateMotionValue(d) : _s(t, i, d), this.animation.cancel();
|
|
1960
1966
|
}
|
|
1961
1967
|
l == null || l(), this.notifyFinished();
|
|
1962
1968
|
};
|
|
@@ -2009,7 +2015,7 @@ class Da extends pn {
|
|
|
2009
2015
|
return /* @__PURE__ */ le(Number(this.animation.currentTime) || 0);
|
|
2010
2016
|
}
|
|
2011
2017
|
set time(e) {
|
|
2012
|
-
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */
|
|
2018
|
+
this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ se(e);
|
|
2013
2019
|
}
|
|
2014
2020
|
/**
|
|
2015
2021
|
* The playback speed of the animation.
|
|
@@ -2035,7 +2041,7 @@ class Da extends pn {
|
|
|
2035
2041
|
*/
|
|
2036
2042
|
attachTimeline({ timeline: e, observe: t }) {
|
|
2037
2043
|
var i;
|
|
2038
|
-
return this.allowFlatten && ((i = this.animation.effect) == null || i.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e &&
|
|
2044
|
+
return this.allowFlatten && ((i = this.animation.effect) == null || i.updateTiming({ easing: "linear" })), this.animation.onfinish = null, e && Ls() ? (this.animation.timeline = e, De) : t(this);
|
|
2039
2045
|
}
|
|
2040
2046
|
}
|
|
2041
2047
|
const Zi = {
|
|
@@ -2043,16 +2049,16 @@ const Zi = {
|
|
|
2043
2049
|
backInOut: zi,
|
|
2044
2050
|
circInOut: Ki
|
|
2045
2051
|
};
|
|
2046
|
-
function
|
|
2052
|
+
function Rs(n) {
|
|
2047
2053
|
return n in Zi;
|
|
2048
2054
|
}
|
|
2049
|
-
function
|
|
2050
|
-
typeof n.ease == "string" &&
|
|
2055
|
+
function Os(n) {
|
|
2056
|
+
typeof n.ease == "string" && Rs(n.ease) && (n.ease = Zi[n.ease]);
|
|
2051
2057
|
}
|
|
2052
2058
|
const Kn = 10;
|
|
2053
|
-
class
|
|
2059
|
+
class Ns extends Ds {
|
|
2054
2060
|
constructor(e) {
|
|
2055
|
-
|
|
2061
|
+
Os(e), Gi(e), super(e), e.startTime && (this.startTime = e.startTime), this.options = e;
|
|
2056
2062
|
}
|
|
2057
2063
|
/**
|
|
2058
2064
|
* WAAPI doesn't natively have any interruption capabilities.
|
|
@@ -2064,23 +2070,23 @@ class Na extends Da {
|
|
|
2064
2070
|
*/
|
|
2065
2071
|
updateMotionValue(e) {
|
|
2066
2072
|
var d;
|
|
2067
|
-
const u = this.options, { motionValue: t, onUpdate: i, onComplete: r, element:
|
|
2073
|
+
const u = this.options, { motionValue: t, onUpdate: i, onComplete: r, element: a } = u, s = ae(u, ["motionValue", "onUpdate", "onComplete", "element"]);
|
|
2068
2074
|
if (!t)
|
|
2069
2075
|
return;
|
|
2070
2076
|
if (e !== void 0) {
|
|
2071
2077
|
t.set(e);
|
|
2072
2078
|
return;
|
|
2073
2079
|
}
|
|
2074
|
-
const o = new mn(I(v({},
|
|
2080
|
+
const o = new mn(I(v({}, s), {
|
|
2075
2081
|
autoplay: !1
|
|
2076
|
-
})), l = /* @__PURE__ */
|
|
2082
|
+
})), l = /* @__PURE__ */ se((d = this.finishedTime) != null ? d : this.time);
|
|
2077
2083
|
t.setWithVelocity(o.sample(l - Kn).value, o.sample(l).value, Kn), o.stop();
|
|
2078
2084
|
}
|
|
2079
2085
|
}
|
|
2080
2086
|
const qn = (n, e) => e === "zIndex" ? !1 : !!(typeof n == "number" || Array.isArray(n) || typeof n == "string" && // It's animatable if we have a string
|
|
2081
2087
|
(Se.test(n) || n === "0") && // And it contains numbers and/or colors
|
|
2082
2088
|
!n.startsWith("url("));
|
|
2083
|
-
function
|
|
2089
|
+
function Ss(n) {
|
|
2084
2090
|
const e = n[0];
|
|
2085
2091
|
if (n.length === 1)
|
|
2086
2092
|
return !0;
|
|
@@ -2088,73 +2094,73 @@ function Sa(n) {
|
|
|
2088
2094
|
if (n[t] !== e)
|
|
2089
2095
|
return !0;
|
|
2090
2096
|
}
|
|
2091
|
-
function
|
|
2097
|
+
function Fs(n, e, t, i) {
|
|
2092
2098
|
const r = n[0];
|
|
2093
2099
|
if (r === null)
|
|
2094
2100
|
return !1;
|
|
2095
2101
|
if (e === "display" || e === "visibility")
|
|
2096
2102
|
return !0;
|
|
2097
|
-
const
|
|
2098
|
-
return it(
|
|
2103
|
+
const a = n[n.length - 1], s = qn(r, e), o = qn(a, e);
|
|
2104
|
+
return it(s === o, `You are trying to animate ${e} from "${r}" to "${a}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${a} via the \`style\` property.`), !s || !o ? !1 : Ss(n) || (t === "spring" || tn(t)) && i;
|
|
2099
2105
|
}
|
|
2100
2106
|
function Ji(n) {
|
|
2101
2107
|
return typeof n == "object" && n !== null;
|
|
2102
2108
|
}
|
|
2103
|
-
function
|
|
2109
|
+
function js(n) {
|
|
2104
2110
|
return Ji(n) && "offsetHeight" in n;
|
|
2105
2111
|
}
|
|
2106
|
-
const
|
|
2112
|
+
const Bs = /* @__PURE__ */ new Set([
|
|
2107
2113
|
"opacity",
|
|
2108
2114
|
"clipPath",
|
|
2109
2115
|
"filter",
|
|
2110
2116
|
"transform"
|
|
2111
2117
|
// TODO: Could be re-enabled now we have support for linear() easing
|
|
2112
2118
|
// "background-color"
|
|
2113
|
-
]),
|
|
2114
|
-
function $
|
|
2119
|
+
]), zs = /* @__PURE__ */ gn(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
|
|
2120
|
+
function $s(n) {
|
|
2115
2121
|
var u;
|
|
2116
|
-
const { motionValue: e, name: t, repeatDelay: i, repeatType: r, damping:
|
|
2117
|
-
if (!
|
|
2122
|
+
const { motionValue: e, name: t, repeatDelay: i, repeatType: r, damping: a, type: s } = n;
|
|
2123
|
+
if (!js((u = e == null ? void 0 : e.owner) == null ? void 0 : u.current))
|
|
2118
2124
|
return !1;
|
|
2119
2125
|
const { onUpdate: o, transformTemplate: l } = e.owner.getProps();
|
|
2120
|
-
return
|
|
2126
|
+
return zs() && t && Bs.has(t) && (t !== "transform" || !l) && /**
|
|
2121
2127
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
2122
2128
|
* no way to read the value from WAAPI every frame.
|
|
2123
2129
|
*/
|
|
2124
|
-
!o && !i && r !== "mirror" &&
|
|
2130
|
+
!o && !i && r !== "mirror" && a !== 0 && s !== "inertia";
|
|
2125
2131
|
}
|
|
2126
|
-
const
|
|
2127
|
-
class
|
|
2132
|
+
const Ks = 40;
|
|
2133
|
+
class qs extends pn {
|
|
2128
2134
|
constructor(m) {
|
|
2129
|
-
var p = m, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay:
|
|
2135
|
+
var p = m, { autoplay: e = !0, delay: t = 0, type: i = "keyframes", repeat: r = 0, repeatDelay: a = 0, repeatType: s = "loop", keyframes: o, name: l, motionValue: u, element: d } = p, h = ae(p, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType", "keyframes", "name", "motionValue", "element"]);
|
|
2130
2136
|
var y;
|
|
2131
2137
|
super(), this.stop = () => {
|
|
2132
|
-
var
|
|
2133
|
-
this._animation && (this._animation.stop(), (
|
|
2138
|
+
var E, V;
|
|
2139
|
+
this._animation && (this._animation.stop(), (E = this.stopTimeline) == null || E.call(this)), (V = this.keyframeResolver) == null || V.cancel();
|
|
2134
2140
|
}, this.createdAt = ee.now();
|
|
2135
2141
|
const g = v({
|
|
2136
2142
|
autoplay: e,
|
|
2137
2143
|
delay: t,
|
|
2138
2144
|
type: i,
|
|
2139
2145
|
repeat: r,
|
|
2140
|
-
repeatDelay:
|
|
2141
|
-
repeatType:
|
|
2146
|
+
repeatDelay: a,
|
|
2147
|
+
repeatType: s,
|
|
2142
2148
|
name: l,
|
|
2143
2149
|
motionValue: u,
|
|
2144
2150
|
element: d
|
|
2145
2151
|
}, h), b = (d == null ? void 0 : d.KeyframeResolver) || fn;
|
|
2146
|
-
this.keyframeResolver = new b(o, (
|
|
2152
|
+
this.keyframeResolver = new b(o, (E, V, _) => this.onKeyframesResolved(E, V, g, !_), l, u, d), (y = this.keyframeResolver) == null || y.scheduleResolve();
|
|
2147
2153
|
}
|
|
2148
2154
|
onKeyframesResolved(e, t, i, r) {
|
|
2149
2155
|
this.keyframeResolver = void 0;
|
|
2150
|
-
const { name:
|
|
2151
|
-
this.resolvedAt = ee.now(),
|
|
2152
|
-
const h = r ? this.resolvedAt ? this.resolvedAt - this.createdAt >
|
|
2156
|
+
const { name: a, type: s, velocity: o, delay: l, isHandoff: u, onUpdate: d } = i;
|
|
2157
|
+
this.resolvedAt = ee.now(), Fs(e, a, s, o) || ((de.instantAnimations || !l) && (d == null || d(hn(e, i, t))), e[0] = e[e.length - 1], i.duration = 0, i.repeat = 0);
|
|
2158
|
+
const h = r ? this.resolvedAt ? this.resolvedAt - this.createdAt > Ks ? this.resolvedAt : this.createdAt : this.createdAt : void 0, m = I(v({
|
|
2153
2159
|
startTime: h,
|
|
2154
2160
|
finalKeyframe: t
|
|
2155
2161
|
}, i), {
|
|
2156
2162
|
keyframes: e
|
|
2157
|
-
}), p = !u && $
|
|
2163
|
+
}), p = !u && $s(m) ? new Ns(I(v({}, m), {
|
|
2158
2164
|
element: m.motionValue.owner.current
|
|
2159
2165
|
})) : new mn(m);
|
|
2160
2166
|
p.finished.then(() => this.notifyFinished()).catch(De), this.pendingTimeline && (this.stopTimeline = p.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = p;
|
|
@@ -2168,7 +2174,7 @@ class qa extends pn {
|
|
|
2168
2174
|
}
|
|
2169
2175
|
get animation() {
|
|
2170
2176
|
var e;
|
|
2171
|
-
return this._animation || ((e = this.keyframeResolver) == null || e.resume(),
|
|
2177
|
+
return this._animation || ((e = this.keyframeResolver) == null || e.resume(), Ts()), this._animation;
|
|
2172
2178
|
}
|
|
2173
2179
|
get duration() {
|
|
2174
2180
|
return this.animation.duration;
|
|
@@ -2208,10 +2214,10 @@ class qa extends pn {
|
|
|
2208
2214
|
this._animation && this.animation.cancel(), (e = this.keyframeResolver) == null || e.cancel();
|
|
2209
2215
|
}
|
|
2210
2216
|
}
|
|
2211
|
-
const Xi = (n, e, t, i = {}, r,
|
|
2217
|
+
const Xi = (n, e, t, i = {}, r, a) => (s) => {
|
|
2212
2218
|
const o = wi(i, n) || {}, l = o.delay || i.delay || 0;
|
|
2213
2219
|
let { elapsed: u = 0 } = i;
|
|
2214
|
-
u = u - /* @__PURE__ */
|
|
2220
|
+
u = u - /* @__PURE__ */ se(l);
|
|
2215
2221
|
const d = I(v({
|
|
2216
2222
|
keyframes: Array.isArray(t) ? t : [null, t],
|
|
2217
2223
|
ease: "easeOut",
|
|
@@ -2222,16 +2228,16 @@ const Xi = (n, e, t, i = {}, r, s) => (a) => {
|
|
|
2222
2228
|
e.set(m), o.onUpdate && o.onUpdate(m);
|
|
2223
2229
|
},
|
|
2224
2230
|
onComplete: () => {
|
|
2225
|
-
|
|
2231
|
+
s(), o.onComplete && o.onComplete();
|
|
2226
2232
|
},
|
|
2227
2233
|
name: n,
|
|
2228
2234
|
motionValue: e,
|
|
2229
|
-
element:
|
|
2235
|
+
element: a ? void 0 : r
|
|
2230
2236
|
});
|
|
2231
|
-
|
|
2237
|
+
wa(o) || Object.assign(d, xa(n, d)), d.duration && (d.duration = /* @__PURE__ */ se(d.duration)), d.repeatDelay && (d.repeatDelay = /* @__PURE__ */ se(d.repeatDelay)), d.from !== void 0 && (d.keyframes[0] = d.from);
|
|
2232
2238
|
let h = !1;
|
|
2233
|
-
if ((d.type === !1 || d.duration === 0 && !d.repeatDelay) && (d.duration = 0, d.delay === 0 && (h = !0)), (de.instantAnimations || de.skipAnimations) && (h = !0, d.duration = 0, d.delay = 0), d.allowFlatten = !o.type && !o.ease, h && !
|
|
2234
|
-
const m =
|
|
2239
|
+
if ((d.type === !1 || d.duration === 0 && !d.repeatDelay) && (d.duration = 0, d.delay === 0 && (h = !0)), (de.instantAnimations || de.skipAnimations) && (h = !0, d.duration = 0, d.delay = 0), d.allowFlatten = !o.type && !o.ease, h && !a && e.get() !== void 0) {
|
|
2240
|
+
const m = va(d.keyframes, o);
|
|
2235
2241
|
if (m !== void 0) {
|
|
2236
2242
|
ue.update(() => {
|
|
2237
2243
|
d.onUpdate(m), d.onComplete();
|
|
@@ -2239,7 +2245,7 @@ const Xi = (n, e, t, i = {}, r, s) => (a) => {
|
|
|
2239
2245
|
return;
|
|
2240
2246
|
}
|
|
2241
2247
|
}
|
|
2242
|
-
return o.isSync ? new mn(d) : new
|
|
2248
|
+
return o.isSync ? new mn(d) : new qs(d);
|
|
2243
2249
|
}, Qi = /* @__PURE__ */ new Set([
|
|
2244
2250
|
"width",
|
|
2245
2251
|
"height",
|
|
@@ -2249,49 +2255,49 @@ const Xi = (n, e, t, i = {}, r, s) => (a) => {
|
|
|
2249
2255
|
"bottom",
|
|
2250
2256
|
...Re
|
|
2251
2257
|
]);
|
|
2252
|
-
function
|
|
2258
|
+
function Gs({ protectedKeys: n, needsAnimating: e }, t) {
|
|
2253
2259
|
const i = n.hasOwnProperty(t) && e[t] !== !0;
|
|
2254
2260
|
return e[t] = !1, i;
|
|
2255
2261
|
}
|
|
2256
|
-
function
|
|
2262
|
+
function Hs(n, e, { delay: t = 0, transitionOverride: i, type: r } = {}) {
|
|
2257
2263
|
var h;
|
|
2258
|
-
let d = e, { transition:
|
|
2259
|
-
i && (
|
|
2264
|
+
let d = e, { transition: a = n.getDefaultTransition(), transitionEnd: s } = d, o = ae(d, ["transition", "transitionEnd"]);
|
|
2265
|
+
i && (a = i);
|
|
2260
2266
|
const l = [], u = r && n.animationState && n.animationState.getState()[r];
|
|
2261
2267
|
for (const m in o) {
|
|
2262
2268
|
const p = n.getValue(m, (h = n.latestValues[m]) != null ? h : null), g = o[m];
|
|
2263
|
-
if (g === void 0 || u &&
|
|
2269
|
+
if (g === void 0 || u && Gs(u, m))
|
|
2264
2270
|
continue;
|
|
2265
2271
|
const b = v({
|
|
2266
2272
|
delay: t
|
|
2267
|
-
}, wi(
|
|
2273
|
+
}, wi(a || {}, m)), y = p.get();
|
|
2268
2274
|
if (y !== void 0 && !p.isAnimating && !Array.isArray(g) && g === y && !b.velocity)
|
|
2269
2275
|
continue;
|
|
2270
|
-
let
|
|
2276
|
+
let E = !1;
|
|
2271
2277
|
if (window.MotionHandoffAnimation) {
|
|
2272
|
-
const _ =
|
|
2278
|
+
const _ = ga(n);
|
|
2273
2279
|
if (_) {
|
|
2274
2280
|
const M = window.MotionHandoffAnimation(_, m, ue);
|
|
2275
|
-
M !== null && (b.startTime = M,
|
|
2281
|
+
M !== null && (b.startTime = M, E = !0);
|
|
2276
2282
|
}
|
|
2277
2283
|
}
|
|
2278
|
-
|
|
2284
|
+
pa(n, m), p.start(Xi(m, p, g, n.shouldReduceMotion && Qi.has(m) ? { type: !1 } : b, n, E));
|
|
2279
2285
|
const V = p.animation;
|
|
2280
2286
|
V && l.push(V);
|
|
2281
2287
|
}
|
|
2282
|
-
return
|
|
2288
|
+
return s && Promise.all(l).then(() => {
|
|
2283
2289
|
ue.update(() => {
|
|
2284
|
-
|
|
2290
|
+
s && ua(n, s);
|
|
2285
2291
|
});
|
|
2286
2292
|
}), l;
|
|
2287
2293
|
}
|
|
2288
|
-
function
|
|
2294
|
+
function Ys({ top: n, left: e, right: t, bottom: i }) {
|
|
2289
2295
|
return {
|
|
2290
2296
|
x: { min: e, max: t },
|
|
2291
2297
|
y: { min: n, max: i }
|
|
2292
2298
|
};
|
|
2293
2299
|
}
|
|
2294
|
-
function
|
|
2300
|
+
function Us(n, e) {
|
|
2295
2301
|
if (!e)
|
|
2296
2302
|
return n;
|
|
2297
2303
|
const t = e({ x: n.left, y: n.top }), i = e({ x: n.right, y: n.bottom });
|
|
@@ -2302,8 +2308,8 @@ function Ua(n, e) {
|
|
|
2302
2308
|
right: i.x
|
|
2303
2309
|
};
|
|
2304
2310
|
}
|
|
2305
|
-
function
|
|
2306
|
-
return
|
|
2311
|
+
function Ws(n, e) {
|
|
2312
|
+
return Ys(Us(n.getBoundingClientRect(), e));
|
|
2307
2313
|
}
|
|
2308
2314
|
const Gn = {
|
|
2309
2315
|
animation: [
|
|
@@ -2332,19 +2338,19 @@ for (const n in Gn)
|
|
|
2332
2338
|
const Hn = () => ({ min: 0, max: 0 }), bn = () => ({
|
|
2333
2339
|
x: Hn(),
|
|
2334
2340
|
y: Hn()
|
|
2335
|
-
}),
|
|
2336
|
-
function
|
|
2337
|
-
if (er.current = !0, !!
|
|
2341
|
+
}), Zs = typeof window != "undefined", Yt = { current: null }, er = { current: !1 };
|
|
2342
|
+
function Js() {
|
|
2343
|
+
if (er.current = !0, !!Zs)
|
|
2338
2344
|
if (window.matchMedia) {
|
|
2339
2345
|
const n = window.matchMedia("(prefers-reduced-motion)"), e = () => Yt.current = n.matches;
|
|
2340
2346
|
n.addListener(e), e();
|
|
2341
2347
|
} else
|
|
2342
2348
|
Yt.current = !1;
|
|
2343
2349
|
}
|
|
2344
|
-
function
|
|
2350
|
+
function Xs(n) {
|
|
2345
2351
|
return n !== null && typeof n == "object" && typeof n.start == "function";
|
|
2346
2352
|
}
|
|
2347
|
-
function
|
|
2353
|
+
function Qs(n) {
|
|
2348
2354
|
return typeof n == "string" || Array.isArray(n);
|
|
2349
2355
|
}
|
|
2350
2356
|
const eo = [
|
|
@@ -2357,25 +2363,25 @@ const eo = [
|
|
|
2357
2363
|
"exit"
|
|
2358
2364
|
], to = ["initial", ...eo];
|
|
2359
2365
|
function tr(n) {
|
|
2360
|
-
return
|
|
2366
|
+
return Xs(n.animate) || to.some((e) => Qs(n[e]));
|
|
2361
2367
|
}
|
|
2362
2368
|
function no(n) {
|
|
2363
2369
|
return !!(tr(n) || n.variants);
|
|
2364
2370
|
}
|
|
2365
2371
|
function io(n, e, t) {
|
|
2366
2372
|
for (const i in e) {
|
|
2367
|
-
const r = e[i],
|
|
2373
|
+
const r = e[i], a = t[i];
|
|
2368
2374
|
if (J(r))
|
|
2369
2375
|
n.addValue(i, r);
|
|
2370
|
-
else if (J(
|
|
2376
|
+
else if (J(a))
|
|
2371
2377
|
n.addValue(i, Xe(r, { owner: n }));
|
|
2372
|
-
else if (
|
|
2378
|
+
else if (a !== r)
|
|
2373
2379
|
if (n.hasValue(i)) {
|
|
2374
|
-
const
|
|
2375
|
-
|
|
2380
|
+
const s = n.getValue(i);
|
|
2381
|
+
s.liveStyle === !0 ? s.jump(r) : s.hasAnimated || s.set(r);
|
|
2376
2382
|
} else {
|
|
2377
|
-
const
|
|
2378
|
-
n.addValue(i, Xe(
|
|
2383
|
+
const s = n.getStaticValue(i);
|
|
2384
|
+
n.addValue(i, Xe(s !== void 0 ? s : r, { owner: n }));
|
|
2379
2385
|
}
|
|
2380
2386
|
}
|
|
2381
2387
|
for (const i in t)
|
|
@@ -2385,17 +2391,17 @@ function io(n, e, t) {
|
|
|
2385
2391
|
const nr = (n) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n), ir = (n) => /^0[^.\s]+$/u.test(n), ro = {
|
|
2386
2392
|
test: (n) => n === "auto",
|
|
2387
2393
|
parse: (n) => n
|
|
2388
|
-
}, rr = (n) => (e) => e.test(n),
|
|
2394
|
+
}, rr = (n) => (e) => e.test(n), ar = [Ne, L, Me, me, Pa, Ma, ro], Yn = (n) => ar.find(rr(n)), ao = [...ar, U, Se], so = (n) => ao.find(rr(n)), oo = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
|
|
2389
2395
|
function lo(n) {
|
|
2390
2396
|
const [e, t] = n.slice(0, -1).split("(");
|
|
2391
2397
|
if (e === "drop-shadow")
|
|
2392
2398
|
return n;
|
|
2393
|
-
const [i] = t.match(
|
|
2399
|
+
const [i] = t.match(sn) || [];
|
|
2394
2400
|
if (!i)
|
|
2395
2401
|
return n;
|
|
2396
2402
|
const r = t.replace(i, "");
|
|
2397
|
-
let
|
|
2398
|
-
return i !== t && (
|
|
2403
|
+
let a = oo.has(e) ? 1 : 0;
|
|
2404
|
+
return i !== t && (a *= 100), e + "(" + a + r + ")";
|
|
2399
2405
|
}
|
|
2400
2406
|
const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
2401
2407
|
getAnimatableNone: (n) => {
|
|
@@ -2486,9 +2492,9 @@ const co = /\b([a-z-]*)\(.*?\)/gu, Ut = I(v({}, Se), {
|
|
|
2486
2492
|
borderLeftColor: U,
|
|
2487
2493
|
filter: Ut,
|
|
2488
2494
|
WebkitFilter: Ut
|
|
2489
|
-
}),
|
|
2495
|
+
}), sr = (n) => ho[n];
|
|
2490
2496
|
function or(n, e) {
|
|
2491
|
-
let t =
|
|
2497
|
+
let t = sr(n);
|
|
2492
2498
|
return t !== Ut && (t = Se), t.getAnimatableNone ? t.getAnimatableNone(e) : void 0;
|
|
2493
2499
|
}
|
|
2494
2500
|
const Wn = [
|
|
@@ -2511,23 +2517,23 @@ class lr {
|
|
|
2511
2517
|
scrapeMotionValuesFromProps(e, t, i) {
|
|
2512
2518
|
return {};
|
|
2513
2519
|
}
|
|
2514
|
-
constructor({ parent: e, props: t, presenceContext: i, reducedMotionConfig: r, blockInitialAnimation:
|
|
2520
|
+
constructor({ parent: e, props: t, presenceContext: i, reducedMotionConfig: r, blockInitialAnimation: a, visualState: s }, o = {}) {
|
|
2515
2521
|
this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = fn, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
|
|
2516
2522
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2517
2523
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2518
2524
|
const p = ee.now();
|
|
2519
2525
|
this.renderScheduledAt < p && (this.renderScheduledAt = p, ue.render(this.render, !1, !0));
|
|
2520
2526
|
};
|
|
2521
|
-
const { latestValues: l, renderState: u } =
|
|
2522
|
-
this.latestValues = l, this.baseTarget = v({}, l), this.initialValues = t.initial ? v({}, l) : {}, this.renderState = u, this.parent = e, this.props = t, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = o, this.blockInitialAnimation = !!
|
|
2523
|
-
const m = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: d } = m, h =
|
|
2527
|
+
const { latestValues: l, renderState: u } = s;
|
|
2528
|
+
this.latestValues = l, this.baseTarget = v({}, l), this.initialValues = t.initial ? v({}, l) : {}, this.renderState = u, this.parent = e, this.props = t, this.presenceContext = i, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.options = o, this.blockInitialAnimation = !!a, this.isControllingVariants = tr(t), this.isVariantNode = no(t), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
|
|
2529
|
+
const m = this.scrapeMotionValuesFromProps(t, {}, this), { willChange: d } = m, h = ae(m, ["willChange"]);
|
|
2524
2530
|
for (const p in h) {
|
|
2525
2531
|
const g = h[p];
|
|
2526
2532
|
l[p] !== void 0 && J(g) && g.set(l[p], !1);
|
|
2527
2533
|
}
|
|
2528
2534
|
}
|
|
2529
2535
|
mount(e) {
|
|
2530
|
-
this.current = e, Je.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((t, i) => this.bindToMotionValue(i, t)), er.current ||
|
|
2536
|
+
this.current = e, Je.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((t, i) => this.bindToMotionValue(i, t)), er.current || Js(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : Yt.current, process.env.NODE_ENV !== "production" && ki(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
|
|
2531
2537
|
}
|
|
2532
2538
|
unmount() {
|
|
2533
2539
|
this.projection && this.projection.unmount(), Rt(this.notifyUpdate), Rt(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
|
|
@@ -2545,10 +2551,10 @@ class lr {
|
|
|
2545
2551
|
i && this.onBindTransform && this.onBindTransform();
|
|
2546
2552
|
const r = t.on("change", (o) => {
|
|
2547
2553
|
this.latestValues[e] = o, this.props.onUpdate && ue.preRender(this.notifyUpdate), i && this.projection && (this.projection.isTransformDirty = !0);
|
|
2548
|
-
}),
|
|
2549
|
-
let
|
|
2550
|
-
window.MotionCheckAppearSync && (
|
|
2551
|
-
r(),
|
|
2554
|
+
}), a = t.on("renderRequest", this.scheduleRender);
|
|
2555
|
+
let s;
|
|
2556
|
+
window.MotionCheckAppearSync && (s = window.MotionCheckAppearSync(this, e, t)), this.valueSubscriptions.set(e, () => {
|
|
2557
|
+
r(), a(), s && s(), t.owner && t.stop();
|
|
2552
2558
|
});
|
|
2553
2559
|
}
|
|
2554
2560
|
sortNodePosition(e) {
|
|
@@ -2562,8 +2568,8 @@ class lr {
|
|
|
2562
2568
|
continue;
|
|
2563
2569
|
const { isEnabled: i, Feature: r } = t;
|
|
2564
2570
|
if (!this.features[e] && r && i(this.props) && (this.features[e] = new r(this)), this.features[e]) {
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2571
|
+
const a = this.features[e];
|
|
2572
|
+
a.isMounted ? a.update() : (a.mount(), a.isMounted = !0);
|
|
2567
2573
|
}
|
|
2568
2574
|
}
|
|
2569
2575
|
}
|
|
@@ -2593,8 +2599,8 @@ class lr {
|
|
|
2593
2599
|
for (let i = 0; i < Wn.length; i++) {
|
|
2594
2600
|
const r = Wn[i];
|
|
2595
2601
|
this.propEventSubscriptions[r] && (this.propEventSubscriptions[r](), delete this.propEventSubscriptions[r]);
|
|
2596
|
-
const
|
|
2597
|
-
|
|
2602
|
+
const a = "on" + r, s = e[a];
|
|
2603
|
+
s && (this.propEventSubscriptions[r] = this.on(r, s));
|
|
2598
2604
|
}
|
|
2599
2605
|
this.prevMotionValues = io(this, this.scrapeMotionValuesFromProps(e, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
2600
2606
|
}
|
|
@@ -2662,7 +2668,7 @@ class lr {
|
|
|
2662
2668
|
readValue(e, t) {
|
|
2663
2669
|
var r;
|
|
2664
2670
|
let i = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : (r = this.getBaseTargetFromProps(this.props, e)) != null ? r : this.readValueFromInstance(this.current, e, this.options);
|
|
2665
|
-
return i != null && (typeof i == "string" && (nr(i) || ir(i)) ? i = parseFloat(i) : !
|
|
2671
|
+
return i != null && (typeof i == "string" && (nr(i) || ir(i)) ? i = parseFloat(i) : !so(i) && Se.test(t) && (i = or(e, t)), this.setBaseTarget(e, J(i) ? i.get() : i)), J(i) ? i.get() : i;
|
|
2666
2672
|
}
|
|
2667
2673
|
/**
|
|
2668
2674
|
* Set the base target to later animate back to. This is currently
|
|
@@ -2676,12 +2682,12 @@ class lr {
|
|
|
2676
2682
|
* props.
|
|
2677
2683
|
*/
|
|
2678
2684
|
getBaseTarget(e) {
|
|
2679
|
-
var
|
|
2685
|
+
var a;
|
|
2680
2686
|
const { initial: t } = this.props;
|
|
2681
2687
|
let i;
|
|
2682
2688
|
if (typeof t == "string" || typeof t == "object") {
|
|
2683
|
-
const
|
|
2684
|
-
|
|
2689
|
+
const s = Ci(this.props, t, (a = this.presenceContext) == null ? void 0 : a.custom);
|
|
2690
|
+
s && (i = s[e]);
|
|
2685
2691
|
}
|
|
2686
2692
|
if (t && i !== void 0)
|
|
2687
2693
|
return i;
|
|
@@ -2712,12 +2718,12 @@ function cr(n, e, t = 1) {
|
|
|
2712
2718
|
const [i, r] = mo(n);
|
|
2713
2719
|
if (!i)
|
|
2714
2720
|
return;
|
|
2715
|
-
const
|
|
2716
|
-
if (
|
|
2717
|
-
const
|
|
2718
|
-
return nr(
|
|
2721
|
+
const a = window.getComputedStyle(e).getPropertyValue(i);
|
|
2722
|
+
if (a) {
|
|
2723
|
+
const s = a.trim();
|
|
2724
|
+
return nr(s) ? parseFloat(s) : s;
|
|
2719
2725
|
}
|
|
2720
|
-
return
|
|
2726
|
+
return an(r) ? cr(r, e, t + 1) : r;
|
|
2721
2727
|
}
|
|
2722
2728
|
function go(n) {
|
|
2723
2729
|
return typeof n == "number" ? n === 0 : n !== null ? n === "none" || n === "0" || ir(n) : !0;
|
|
@@ -2726,16 +2732,16 @@ const bo = /* @__PURE__ */ new Set(["auto", "none", "0"]);
|
|
|
2726
2732
|
function vo(n, e, t) {
|
|
2727
2733
|
let i = 0, r;
|
|
2728
2734
|
for (; i < n.length && !r; ) {
|
|
2729
|
-
const
|
|
2730
|
-
typeof
|
|
2735
|
+
const a = n[i];
|
|
2736
|
+
typeof a == "string" && !bo.has(a) && et(a).values.length && (r = n[i]), i++;
|
|
2731
2737
|
}
|
|
2732
2738
|
if (r && t)
|
|
2733
|
-
for (const
|
|
2734
|
-
n[
|
|
2739
|
+
for (const a of e)
|
|
2740
|
+
n[a] = or(t, r);
|
|
2735
2741
|
}
|
|
2736
2742
|
class yo extends fn {
|
|
2737
|
-
constructor(e, t, i, r,
|
|
2738
|
-
super(e, t, i, r,
|
|
2743
|
+
constructor(e, t, i, r, a) {
|
|
2744
|
+
super(e, t, i, r, a, !0);
|
|
2739
2745
|
}
|
|
2740
2746
|
readKeyframes() {
|
|
2741
2747
|
const { unresolvedKeyframes: e, element: t, name: i } = this;
|
|
@@ -2744,16 +2750,16 @@ class yo extends fn {
|
|
|
2744
2750
|
super.readKeyframes();
|
|
2745
2751
|
for (let l = 0; l < e.length; l++) {
|
|
2746
2752
|
let u = e[l];
|
|
2747
|
-
if (typeof u == "string" && (u = u.trim(),
|
|
2753
|
+
if (typeof u == "string" && (u = u.trim(), an(u))) {
|
|
2748
2754
|
const d = cr(u, t.current);
|
|
2749
2755
|
d !== void 0 && (e[l] = d), l === e.length - 1 && (this.finalKeyframe = u);
|
|
2750
2756
|
}
|
|
2751
2757
|
}
|
|
2752
2758
|
if (this.resolveNoneKeyframes(), !Qi.has(i) || e.length !== 2)
|
|
2753
2759
|
return;
|
|
2754
|
-
const [r,
|
|
2755
|
-
if (
|
|
2756
|
-
if (zn(
|
|
2760
|
+
const [r, a] = e, s = Yn(r), o = Yn(a);
|
|
2761
|
+
if (s !== o)
|
|
2762
|
+
if (zn(s) && zn(o))
|
|
2757
2763
|
for (let l = 0; l < e.length; l++) {
|
|
2758
2764
|
const u = e[l];
|
|
2759
2765
|
typeof u == "string" && (e[l] = parseFloat(u));
|
|
@@ -2781,8 +2787,8 @@ class yo extends fn {
|
|
|
2781
2787
|
return;
|
|
2782
2788
|
const r = e.getValue(t);
|
|
2783
2789
|
r && r.jump(this.measuredOrigin, !1);
|
|
2784
|
-
const
|
|
2785
|
-
i[
|
|
2790
|
+
const a = i.length - 1, s = i[a];
|
|
2791
|
+
i[a] = ke[t](e.measureViewportBox(), window.getComputedStyle(e.current)), s !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = s), (o = this.removedTransforms) != null && o.length && this.removedTransforms.forEach(([l, u]) => {
|
|
2786
2792
|
e.getValue(l).set(u);
|
|
2787
2793
|
}), this.resolveNoneKeyframes();
|
|
2788
2794
|
}
|
|
@@ -2816,58 +2822,58 @@ const ur = (n, e) => e && typeof n == "number" ? e.transform(n) : n, Co = {
|
|
|
2816
2822
|
}, ko = Re.length;
|
|
2817
2823
|
function Eo(n, e, t) {
|
|
2818
2824
|
let i = "", r = !0;
|
|
2819
|
-
for (let
|
|
2820
|
-
const
|
|
2825
|
+
for (let a = 0; a < ko; a++) {
|
|
2826
|
+
const s = Re[a], o = n[s];
|
|
2821
2827
|
if (o === void 0)
|
|
2822
2828
|
continue;
|
|
2823
2829
|
let l = !0;
|
|
2824
|
-
if (typeof o == "number" ? l = o === (
|
|
2825
|
-
const u = ur(o, vn[
|
|
2830
|
+
if (typeof o == "number" ? l = o === (s.startsWith("scale") ? 1 : 0) : l = parseFloat(o) === 0, !l || t) {
|
|
2831
|
+
const u = ur(o, vn[s]);
|
|
2826
2832
|
if (!l) {
|
|
2827
2833
|
r = !1;
|
|
2828
|
-
const d = Co[
|
|
2834
|
+
const d = Co[s] || s;
|
|
2829
2835
|
i += `${d}(${u}) `;
|
|
2830
2836
|
}
|
|
2831
|
-
t && (e[
|
|
2837
|
+
t && (e[s] = u);
|
|
2832
2838
|
}
|
|
2833
2839
|
}
|
|
2834
2840
|
return i = i.trim(), t ? i = t(e, r ? "" : i) : r && (i = "none"), i;
|
|
2835
2841
|
}
|
|
2836
2842
|
function hr(n, e, t) {
|
|
2837
|
-
const { style: i, vars: r, transformOrigin:
|
|
2838
|
-
let
|
|
2843
|
+
const { style: i, vars: r, transformOrigin: a } = n;
|
|
2844
|
+
let s = !1, o = !1;
|
|
2839
2845
|
for (const l in e) {
|
|
2840
2846
|
const u = e[l];
|
|
2841
2847
|
if (Oe.has(l)) {
|
|
2842
|
-
|
|
2848
|
+
s = !0;
|
|
2843
2849
|
continue;
|
|
2844
2850
|
} else if (Ai(l)) {
|
|
2845
2851
|
r[l] = u;
|
|
2846
2852
|
continue;
|
|
2847
2853
|
} else {
|
|
2848
2854
|
const d = ur(u, vn[l]);
|
|
2849
|
-
l.startsWith("origin") ? (o = !0,
|
|
2855
|
+
l.startsWith("origin") ? (o = !0, a[l] = d) : i[l] = d;
|
|
2850
2856
|
}
|
|
2851
2857
|
}
|
|
2852
|
-
if (e.transform || (
|
|
2853
|
-
const { originX: l = "50%", originY: u = "50%", originZ: d = 0 } =
|
|
2858
|
+
if (e.transform || (s || t ? i.transform = Eo(e, n.transform, t) : i.transform && (i.transform = "none")), o) {
|
|
2859
|
+
const { originX: l = "50%", originY: u = "50%", originZ: d = 0 } = a;
|
|
2854
2860
|
i.transformOrigin = `${l} ${u} ${d}`;
|
|
2855
2861
|
}
|
|
2856
2862
|
}
|
|
2857
2863
|
function pr(n, { style: e, vars: t }, i, r) {
|
|
2858
2864
|
Object.assign(n.style, e, r && r.getProjectionStyles(i));
|
|
2859
|
-
for (const
|
|
2860
|
-
n.style.setProperty(
|
|
2865
|
+
for (const a in t)
|
|
2866
|
+
n.style.setProperty(a, t[a]);
|
|
2861
2867
|
}
|
|
2862
2868
|
const xo = {};
|
|
2863
2869
|
function wo(n, { layout: e, layoutId: t }) {
|
|
2864
2870
|
return Oe.has(n) || n.startsWith("origin") || (e || t !== void 0) && (!!xo[n] || n === "opacity");
|
|
2865
2871
|
}
|
|
2866
2872
|
function mr(n, e, t) {
|
|
2867
|
-
var
|
|
2873
|
+
var a;
|
|
2868
2874
|
const { style: i } = n, r = {};
|
|
2869
|
-
for (const
|
|
2870
|
-
(J(i[
|
|
2875
|
+
for (const s in i)
|
|
2876
|
+
(J(i[s]) || e.style && J(e.style[s]) || wo(s, n) || ((a = t == null ? void 0 : t.getValue(s)) == null ? void 0 : a.liveStyle) !== void 0) && (r[s] = i[s]);
|
|
2871
2877
|
return r;
|
|
2872
2878
|
}
|
|
2873
2879
|
function To(n) {
|
|
@@ -2880,14 +2886,14 @@ class Ao extends dr {
|
|
|
2880
2886
|
readValueFromInstance(e, t) {
|
|
2881
2887
|
var i;
|
|
2882
2888
|
if (Oe.has(t))
|
|
2883
|
-
return (i = this.projection) != null && i.isProjecting ? zt(t) :
|
|
2889
|
+
return (i = this.projection) != null && i.isProjecting ? zt(t) : Cs(e, t);
|
|
2884
2890
|
{
|
|
2885
|
-
const r = To(e),
|
|
2886
|
-
return typeof
|
|
2891
|
+
const r = To(e), a = (Ai(t) ? r.getPropertyValue(t) : r[t]) || 0;
|
|
2892
|
+
return typeof a == "string" ? a.trim() : a;
|
|
2887
2893
|
}
|
|
2888
2894
|
}
|
|
2889
2895
|
measureInstanceViewportBox(e, { transformPagePoint: t }) {
|
|
2890
|
-
return
|
|
2896
|
+
return Ws(e, t);
|
|
2891
2897
|
}
|
|
2892
2898
|
build(e, t, i) {
|
|
2893
2899
|
hr(e, t, i.transformTemplate);
|
|
@@ -2937,10 +2943,10 @@ const Vo = {
|
|
|
2937
2943
|
};
|
|
2938
2944
|
function Mo(n, e, t = 1, i = 0, r = !0) {
|
|
2939
2945
|
n.pathLength = 1;
|
|
2940
|
-
const
|
|
2941
|
-
n[
|
|
2942
|
-
const
|
|
2943
|
-
n[
|
|
2946
|
+
const a = r ? Vo : Io;
|
|
2947
|
+
n[a.offset] = L.transform(-i);
|
|
2948
|
+
const s = L.transform(e), o = L.transform(t);
|
|
2949
|
+
n[a.array] = `${s} ${o}`;
|
|
2944
2950
|
}
|
|
2945
2951
|
function Po(n, h, l, u, d) {
|
|
2946
2952
|
var m = h, {
|
|
@@ -2948,9 +2954,9 @@ function Po(n, h, l, u, d) {
|
|
|
2948
2954
|
attrY: t,
|
|
2949
2955
|
attrScale: i,
|
|
2950
2956
|
pathLength: r,
|
|
2951
|
-
pathSpacing:
|
|
2952
|
-
pathOffset:
|
|
2953
|
-
} = m, o =
|
|
2957
|
+
pathSpacing: a = 1,
|
|
2958
|
+
pathOffset: s = 0
|
|
2959
|
+
} = m, o = ae(m, [
|
|
2954
2960
|
"attrX",
|
|
2955
2961
|
"attrY",
|
|
2956
2962
|
"attrScale",
|
|
@@ -2965,7 +2971,7 @@ function Po(n, h, l, u, d) {
|
|
|
2965
2971
|
}
|
|
2966
2972
|
n.attrs = n.style, n.style = {};
|
|
2967
2973
|
const { attrs: p, style: g } = n;
|
|
2968
|
-
p.transform && (g.transform = p.transform, delete p.transform), (g.transform || p.transformOrigin) && (g.transformOrigin = (b = p.transformOrigin) != null ? b : "50% 50%", delete p.transformOrigin), g.transform && (g.transformBox = (y = d == null ? void 0 : d.transformBox) != null ? y : "fill-box", delete p.transformBox), e !== void 0 && (p.x = e), t !== void 0 && (p.y = t), i !== void 0 && (p.scale = i), r !== void 0 && Mo(p, r,
|
|
2974
|
+
p.transform && (g.transform = p.transform, delete p.transform), (g.transform || p.transformOrigin) && (g.transformOrigin = (b = p.transformOrigin) != null ? b : "50% 50%", delete p.transformOrigin), g.transform && (g.transformBox = (y = d == null ? void 0 : d.transformBox) != null ? y : "fill-box", delete p.transformBox), e !== void 0 && (p.x = e), t !== void 0 && (p.y = t), i !== void 0 && (p.scale = i), r !== void 0 && Mo(p, r, a, s, !1);
|
|
2969
2975
|
}
|
|
2970
2976
|
const fr = /* @__PURE__ */ new Set([
|
|
2971
2977
|
"baseFrequency",
|
|
@@ -3001,8 +3007,8 @@ function Oo(n, e, t) {
|
|
|
3001
3007
|
const i = mr(n, e, t);
|
|
3002
3008
|
for (const r in n)
|
|
3003
3009
|
if (J(n[r]) || J(e[r])) {
|
|
3004
|
-
const
|
|
3005
|
-
i[
|
|
3010
|
+
const a = Re.indexOf(r) !== -1 ? "attr" + r.charAt(0).toUpperCase() + r.substring(1) : r;
|
|
3011
|
+
i[a] = n[r];
|
|
3006
3012
|
}
|
|
3007
3013
|
return i;
|
|
3008
3014
|
}
|
|
@@ -3015,7 +3021,7 @@ class No extends dr {
|
|
|
3015
3021
|
}
|
|
3016
3022
|
readValueFromInstance(e, t) {
|
|
3017
3023
|
if (Oe.has(t)) {
|
|
3018
|
-
const i =
|
|
3024
|
+
const i = sr(t);
|
|
3019
3025
|
return i && i.default || 0;
|
|
3020
3026
|
}
|
|
3021
3027
|
return t = fr.has(t) ? t : rn(t), e.getAttribute(t);
|
|
@@ -3081,21 +3087,21 @@ function br(n, e, t, i) {
|
|
|
3081
3087
|
if (zo(n, e))
|
|
3082
3088
|
r.push(Bo(n, Qt(e) && e.default || e, t && (t.default || t)));
|
|
3083
3089
|
else {
|
|
3084
|
-
const
|
|
3085
|
-
ce(!!
|
|
3086
|
-
for (let o = 0; o <
|
|
3087
|
-
const l =
|
|
3090
|
+
const a = pi(n, e, i), s = a.length;
|
|
3091
|
+
ce(!!s, "No valid elements provided.");
|
|
3092
|
+
for (let o = 0; o < s; o++) {
|
|
3093
|
+
const l = a[o], u = l instanceof Element ? Fo : jo;
|
|
3088
3094
|
Je.has(l) || u(l);
|
|
3089
3095
|
const d = Je.get(l), h = v({}, t);
|
|
3090
|
-
"delay" in h && typeof h.delay == "function" && (h.delay = h.delay(o,
|
|
3096
|
+
"delay" in h && typeof h.delay == "function" && (h.delay = h.delay(o, s)), r.push(...Hs(d, I(v({}, e), { transition: h }), {}));
|
|
3091
3097
|
}
|
|
3092
3098
|
}
|
|
3093
3099
|
return r;
|
|
3094
3100
|
}
|
|
3095
3101
|
function $o(n, e, t) {
|
|
3096
3102
|
const i = [];
|
|
3097
|
-
return Zr(n, e, t, { spring: tt }).forEach(({ keyframes:
|
|
3098
|
-
i.push(...br(o,
|
|
3103
|
+
return Zr(n, e, t, { spring: tt }).forEach(({ keyframes: a, transition: s }, o) => {
|
|
3104
|
+
i.push(...br(o, a, s));
|
|
3099
3105
|
}), i;
|
|
3100
3106
|
}
|
|
3101
3107
|
class Ko {
|
|
@@ -3174,8 +3180,8 @@ function Go(n) {
|
|
|
3174
3180
|
}
|
|
3175
3181
|
function Ho(n) {
|
|
3176
3182
|
function e(t, i, r) {
|
|
3177
|
-
let
|
|
3178
|
-
return Go(t) ?
|
|
3183
|
+
let a = [];
|
|
3184
|
+
return Go(t) ? a = $o(t, i, n) : a = br(t, i, r, n), new qo(a);
|
|
3179
3185
|
}
|
|
3180
3186
|
return e;
|
|
3181
3187
|
}
|
|
@@ -3233,9 +3239,9 @@ class rl {
|
|
|
3233
3239
|
return this.loader;
|
|
3234
3240
|
}
|
|
3235
3241
|
}
|
|
3236
|
-
const
|
|
3237
|
-
checkout:
|
|
3238
|
-
hidden:
|
|
3242
|
+
const al = "_checkout_mcuv2_1", sl = "_hidden_mcuv2_8", ol = "_formInitial_mcuv2_12", ll = "_btnsInitial_mcuv2_22", Z = {
|
|
3243
|
+
checkout: al,
|
|
3244
|
+
hidden: sl,
|
|
3239
3245
|
formInitial: ol,
|
|
3240
3246
|
btnsInitial: ll
|
|
3241
3247
|
}, cl = "_buttons_qc8am_1", dl = "_hidden_qc8am_8", ul = "_skeleton_qc8am_12", be = {
|
|
@@ -3457,9 +3463,9 @@ var $e = {}, Qn;
|
|
|
3457
3463
|
function fl() {
|
|
3458
3464
|
if (Qn) return $e;
|
|
3459
3465
|
Qn = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.matches = void 0;
|
|
3460
|
-
function n(i, r,
|
|
3461
|
-
var
|
|
3462
|
-
return r = parseInt(String(r).substr(0, o.length), 10),
|
|
3466
|
+
function n(i, r, a) {
|
|
3467
|
+
var s = String(r).length, o = i.substr(0, s), l = parseInt(o, 10);
|
|
3468
|
+
return r = parseInt(String(r).substr(0, o.length), 10), a = parseInt(String(a).substr(0, o.length), 10), l >= r && l <= a;
|
|
3463
3469
|
}
|
|
3464
3470
|
function e(i, r) {
|
|
3465
3471
|
return r = String(r), r.substring(0, i.length) === i.substring(0, r.length);
|
|
@@ -3474,13 +3480,13 @@ function gl() {
|
|
|
3474
3480
|
if (ei) return Be;
|
|
3475
3481
|
ei = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.addMatchingCardsToResults = void 0;
|
|
3476
3482
|
var n = yr(), e = fl();
|
|
3477
|
-
function t(i, r,
|
|
3478
|
-
var
|
|
3479
|
-
for (
|
|
3480
|
-
var l = r.patterns[
|
|
3483
|
+
function t(i, r, a) {
|
|
3484
|
+
var s, o;
|
|
3485
|
+
for (s = 0; s < r.patterns.length; s++) {
|
|
3486
|
+
var l = r.patterns[s];
|
|
3481
3487
|
if ((0, e.matches)(i, l)) {
|
|
3482
3488
|
var u = (0, n.clone)(r);
|
|
3483
|
-
Array.isArray(l) ? o = String(l[0]).length : o = String(l).length, i.length >= o && (u.matchStrength = o),
|
|
3489
|
+
Array.isArray(l) ? o = String(l[0]).length : o = String(l).length, i.length >= o && (u.matchStrength = o), a.push(u);
|
|
3484
3490
|
break;
|
|
3485
3491
|
}
|
|
3486
3492
|
}
|
|
@@ -3519,13 +3525,13 @@ function yl() {
|
|
|
3519
3525
|
ii = 1;
|
|
3520
3526
|
var n = Ge && Ge.__assign || function() {
|
|
3521
3527
|
return n = Object.assign || function(g) {
|
|
3522
|
-
for (var b, y = 1,
|
|
3528
|
+
for (var b, y = 1, E = arguments.length; y < E; y++) {
|
|
3523
3529
|
b = arguments[y];
|
|
3524
3530
|
for (var V in b) Object.prototype.hasOwnProperty.call(b, V) && (g[V] = b[V]);
|
|
3525
3531
|
}
|
|
3526
3532
|
return g;
|
|
3527
3533
|
}, n.apply(this, arguments);
|
|
3528
|
-
}, e = ml(), t = gl(), i = bl(), r = vl(),
|
|
3534
|
+
}, e = ml(), t = gl(), i = bl(), r = vl(), a = yr(), s = {}, o = {
|
|
3529
3535
|
VISA: "visa",
|
|
3530
3536
|
MASTERCARD: "mastercard",
|
|
3531
3537
|
AMERICAN_EXPRESS: "american-express",
|
|
@@ -3551,13 +3557,13 @@ function yl() {
|
|
|
3551
3557
|
o.MIR,
|
|
3552
3558
|
o.HIPER,
|
|
3553
3559
|
o.HIPERCARD
|
|
3554
|
-
], u = (0,
|
|
3560
|
+
], u = (0, a.clone)(l);
|
|
3555
3561
|
function d(g) {
|
|
3556
|
-
return
|
|
3562
|
+
return s[g] || e[g];
|
|
3557
3563
|
}
|
|
3558
3564
|
function h() {
|
|
3559
3565
|
return u.map(function(g) {
|
|
3560
|
-
return (0,
|
|
3566
|
+
return (0, a.clone)(d(g));
|
|
3561
3567
|
});
|
|
3562
3568
|
}
|
|
3563
3569
|
function m(g, b) {
|
|
@@ -3573,34 +3579,34 @@ function yl() {
|
|
|
3573
3579
|
return b;
|
|
3574
3580
|
if (g.length === 0)
|
|
3575
3581
|
return h();
|
|
3576
|
-
u.forEach(function(
|
|
3577
|
-
var V = d(
|
|
3582
|
+
u.forEach(function(E) {
|
|
3583
|
+
var V = d(E);
|
|
3578
3584
|
(0, t.addMatchingCardsToResults)(g, V, b);
|
|
3579
3585
|
});
|
|
3580
3586
|
var y = (0, r.findBestMatch)(b);
|
|
3581
3587
|
return y ? [y] : b;
|
|
3582
3588
|
}
|
|
3583
3589
|
return p.getTypeInfo = function(g) {
|
|
3584
|
-
return (0,
|
|
3590
|
+
return (0, a.clone)(d(g));
|
|
3585
3591
|
}, p.removeCard = function(g) {
|
|
3586
3592
|
var b = m(g);
|
|
3587
3593
|
u.splice(b, 1);
|
|
3588
3594
|
}, p.addCard = function(g) {
|
|
3589
3595
|
var b = m(g.type, !0);
|
|
3590
|
-
|
|
3596
|
+
s[g.type] = g, b === -1 && u.push(g.type);
|
|
3591
3597
|
}, p.updateCard = function(g, b) {
|
|
3592
|
-
var y =
|
|
3598
|
+
var y = s[g] || e[g];
|
|
3593
3599
|
if (!y)
|
|
3594
3600
|
throw new Error('"'.concat(g, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
3595
3601
|
if (b.type && y.type !== b.type)
|
|
3596
3602
|
throw new Error("Cannot overwrite type parameter.");
|
|
3597
|
-
var
|
|
3598
|
-
|
|
3603
|
+
var E = (0, a.clone)(y);
|
|
3604
|
+
E = n(n({}, E), b), s[E.type] = E;
|
|
3599
3605
|
}, p.changeOrder = function(g, b) {
|
|
3600
3606
|
var y = m(g);
|
|
3601
3607
|
u.splice(y, 1), u.splice(b, 0, g);
|
|
3602
3608
|
}, p.resetModifications = function() {
|
|
3603
|
-
u = (0,
|
|
3609
|
+
u = (0, a.clone)(l), s = {};
|
|
3604
3610
|
}, p.types = o, Ge = p, Ge;
|
|
3605
3611
|
}
|
|
3606
3612
|
var Pe = yl();
|
|
@@ -3611,12 +3617,12 @@ Pe.updateCard("unionpay", {
|
|
|
3611
3617
|
gaps: [4, 8, 12, 16]
|
|
3612
3618
|
});
|
|
3613
3619
|
const Cl = (n, e) => {
|
|
3614
|
-
const t = Pe.getTypeInfo(e), i = n.replace(/\D/g, ""), r = (t == null ? void 0 : t.gaps) || [4, 8, 12],
|
|
3615
|
-
for (let l = 0;
|
|
3616
|
-
const u =
|
|
3620
|
+
const t = Pe.getTypeInfo(e), i = n.replace(/\D/g, ""), r = (t == null ? void 0 : t.gaps) || [4, 8, 12], a = t ? Math.max(...t.lengths) + r.length : 19, s = [0].concat(r, i.length), o = [];
|
|
3621
|
+
for (let l = 0; s[l] < i.length; l++) {
|
|
3622
|
+
const u = s[l], d = Math.min(s[l + 1], i.length);
|
|
3617
3623
|
o.push(i.slice(u, d));
|
|
3618
3624
|
}
|
|
3619
|
-
return o.join(" ").slice(0,
|
|
3625
|
+
return o.join(" ").slice(0, a);
|
|
3620
3626
|
}, kl = (n, e) => {
|
|
3621
3627
|
const t = Pe.getTypeInfo(e), i = (t == null ? void 0 : t.code.size) || 4;
|
|
3622
3628
|
return n.replace(/\D/g, "").slice(0, i);
|
|
@@ -3714,7 +3720,7 @@ const bt = [
|
|
|
3714
3720
|
t && (r *= 2, r > 9 && (r -= 9)), e += r, t = !t;
|
|
3715
3721
|
}
|
|
3716
3722
|
return e % 10 === 0;
|
|
3717
|
-
},
|
|
3723
|
+
}, ai = (n, e) => {
|
|
3718
3724
|
const t = n.replace(/\D/g, "");
|
|
3719
3725
|
if (!t)
|
|
3720
3726
|
return { isValid: !1, cardType: null, error: Y.Empty };
|
|
@@ -3763,7 +3769,7 @@ const bt = [
|
|
|
3763
3769
|
}, Ml = (n) => {
|
|
3764
3770
|
var e, t;
|
|
3765
3771
|
return n ? typeof n.amount != "number" ? (console.error("Transaction amount is missing or invalid for Apple Pay"), null) : n.currency ? n.country ? n.merchant_id ? n.checkout_config && !((e = n.checkout_config) == null ? void 0 : e.find(
|
|
3766
|
-
({ is_active: r, type:
|
|
3772
|
+
({ is_active: r, type: a }) => r && a === x.APPLE_PAY
|
|
3767
3773
|
)) ? null : {
|
|
3768
3774
|
amount: n.amount,
|
|
3769
3775
|
currency: n.currency,
|
|
@@ -3889,24 +3895,24 @@ var dt = { exports: {} }, He = {};
|
|
|
3889
3895
|
* This source code is licensed under the MIT license found in the
|
|
3890
3896
|
* LICENSE file in the root directory of this source tree.
|
|
3891
3897
|
*/
|
|
3892
|
-
var
|
|
3898
|
+
var si;
|
|
3893
3899
|
function Nl() {
|
|
3894
|
-
if (
|
|
3895
|
-
|
|
3900
|
+
if (si) return He;
|
|
3901
|
+
si = 1;
|
|
3896
3902
|
var n = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
3897
|
-
function t(i, r,
|
|
3898
|
-
var
|
|
3899
|
-
if (
|
|
3900
|
-
|
|
3903
|
+
function t(i, r, a) {
|
|
3904
|
+
var s = null;
|
|
3905
|
+
if (a !== void 0 && (s = "" + a), r.key !== void 0 && (s = "" + r.key), "key" in r) {
|
|
3906
|
+
a = {};
|
|
3901
3907
|
for (var o in r)
|
|
3902
|
-
o !== "key" && (
|
|
3903
|
-
} else
|
|
3904
|
-
return r =
|
|
3908
|
+
o !== "key" && (a[o] = r[o]);
|
|
3909
|
+
} else a = r;
|
|
3910
|
+
return r = a.ref, {
|
|
3905
3911
|
$$typeof: n,
|
|
3906
3912
|
type: i,
|
|
3907
|
-
key:
|
|
3913
|
+
key: s,
|
|
3908
3914
|
ref: r !== void 0 ? r : null,
|
|
3909
|
-
props:
|
|
3915
|
+
props: a
|
|
3910
3916
|
};
|
|
3911
3917
|
}
|
|
3912
3918
|
return He.Fragment = e, He.jsx = t, He.jsxs = t, He;
|
|
@@ -3932,7 +3938,7 @@ function Sl() {
|
|
|
3932
3938
|
switch (f) {
|
|
3933
3939
|
case b:
|
|
3934
3940
|
return "Fragment";
|
|
3935
|
-
case
|
|
3941
|
+
case E:
|
|
3936
3942
|
return "Profiler";
|
|
3937
3943
|
case y:
|
|
3938
3944
|
return "StrictMode";
|
|
@@ -4002,10 +4008,10 @@ function Sl() {
|
|
|
4002
4008
|
var f = q.A;
|
|
4003
4009
|
return f === null ? null : f.getOwner();
|
|
4004
4010
|
}
|
|
4005
|
-
function
|
|
4011
|
+
function a() {
|
|
4006
4012
|
return Error("react-stack-top-frame");
|
|
4007
4013
|
}
|
|
4008
|
-
function
|
|
4014
|
+
function s(f) {
|
|
4009
4015
|
if (Te.call(f, "key")) {
|
|
4010
4016
|
var P = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
4011
4017
|
if (P && P.isReactWarning) return !1;
|
|
@@ -4093,7 +4099,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4093
4099
|
z
|
|
4094
4100
|
), ne[z + G] = !0);
|
|
4095
4101
|
}
|
|
4096
|
-
if (z = null, N !== void 0 && (t(N), z = "" + N),
|
|
4102
|
+
if (z = null, N !== void 0 && (t(N), z = "" + N), s(P) && (t(P.key), z = "" + P.key), "key" in P) {
|
|
4097
4103
|
N = {};
|
|
4098
4104
|
for (var pe in P)
|
|
4099
4105
|
pe !== "key" && (N[pe] = P[pe]);
|
|
@@ -4115,7 +4121,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4115
4121
|
function h(f) {
|
|
4116
4122
|
typeof f == "object" && f !== null && f.$$typeof === p && f._store && (f._store.validated = 1);
|
|
4117
4123
|
}
|
|
4118
|
-
var m = wr, p = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"),
|
|
4124
|
+
var m = wr, p = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), R = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), q = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Te = Object.prototype.hasOwnProperty, te = Array.isArray, fe = console.createTask ? console.createTask : function() {
|
|
4119
4125
|
return null;
|
|
4120
4126
|
};
|
|
4121
4127
|
m = {
|
|
@@ -4125,8 +4131,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4125
4131
|
};
|
|
4126
4132
|
var he, kt = {}, Et = m.react_stack_bottom_frame.bind(
|
|
4127
4133
|
m,
|
|
4128
|
-
|
|
4129
|
-
)(),
|
|
4134
|
+
a
|
|
4135
|
+
)(), st = fe(i(a)), ne = {};
|
|
4130
4136
|
Ye.Fragment = b, Ye.jsx = function(f, P, N, G, ie) {
|
|
4131
4137
|
var X = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
4132
4138
|
return d(
|
|
@@ -4137,7 +4143,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4137
4143
|
G,
|
|
4138
4144
|
ie,
|
|
4139
4145
|
X ? Error("react-stack-top-frame") : Et,
|
|
4140
|
-
X ? fe(i(f)) :
|
|
4146
|
+
X ? fe(i(f)) : st
|
|
4141
4147
|
);
|
|
4142
4148
|
}, Ye.jsxs = function(f, P, N, G, ie) {
|
|
4143
4149
|
var X = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
@@ -4149,7 +4155,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4149
4155
|
G,
|
|
4150
4156
|
ie,
|
|
4151
4157
|
X ? Error("react-stack-top-frame") : Et,
|
|
4152
|
-
X ? fe(i(f)) :
|
|
4158
|
+
X ? fe(i(f)) : st
|
|
4153
4159
|
);
|
|
4154
4160
|
};
|
|
4155
4161
|
}()), Ye;
|
|
@@ -4184,28 +4190,28 @@ class Bl {
|
|
|
4184
4190
|
this.onPaymentAttempt = this.config.state.checkout.getState().onCheckoutAttempt, this.ev = this.config.service.ev, this.customButtonStyles = t, this.element = document.createElement("div"), this.element.classList.add(Lt.applePay, Lt.hidden);
|
|
4185
4191
|
}
|
|
4186
4192
|
init(e) {
|
|
4187
|
-
return
|
|
4193
|
+
return k(this, null, function* () {
|
|
4188
4194
|
if (!this.config) return !1;
|
|
4189
4195
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Ml(t);
|
|
4190
4196
|
if (!r)
|
|
4191
4197
|
return !1;
|
|
4192
|
-
const
|
|
4193
|
-
onError: (
|
|
4198
|
+
const a = e ? I(v({}, e), {
|
|
4199
|
+
onError: (s) => {
|
|
4194
4200
|
var l, u;
|
|
4195
4201
|
if (!this.isInitialized) {
|
|
4196
|
-
console.error("Apple Pay error:",
|
|
4202
|
+
console.error("Apple Pay error:", s);
|
|
4197
4203
|
return;
|
|
4198
4204
|
}
|
|
4199
4205
|
const o = this.config.state.translate.messages();
|
|
4200
|
-
|
|
4206
|
+
s != null && s.toLowerCase().includes("cancelled") ? (l = e.onCancel) == null || l.call(e) : (vt(s, o), (u = e.onError) == null || u.call(e, s));
|
|
4201
4207
|
},
|
|
4202
|
-
onSuccess: (
|
|
4208
|
+
onSuccess: (s) => {
|
|
4203
4209
|
var o;
|
|
4204
|
-
(o = e.onSuccess) == null || o.call(e,
|
|
4210
|
+
(o = e.onSuccess) == null || o.call(e, s);
|
|
4205
4211
|
}
|
|
4206
4212
|
}) : void 0;
|
|
4207
4213
|
return yield this.ev.initApple(
|
|
4208
|
-
I(v({},
|
|
4214
|
+
I(v({}, a), {
|
|
4209
4215
|
transaction: r,
|
|
4210
4216
|
supportedCardTypes: Pl(jl),
|
|
4211
4217
|
locale: Dl(i || "en"),
|
|
@@ -4261,27 +4267,27 @@ class ql {
|
|
|
4261
4267
|
this.config = e, this.ev = this.config.service.ev, this.customButtonStyles = this.config.state.styles.getState().GooglePayButton, this.onPaymentAttempt = this.config.state.checkout.getState().onCheckoutAttempt, this.element = document.createElement("div"), this.element.classList.add(It.googlePay, It.hidden);
|
|
4262
4268
|
}
|
|
4263
4269
|
init(e) {
|
|
4264
|
-
return
|
|
4270
|
+
return k(this, null, function* () {
|
|
4265
4271
|
if (!this.config) return !1;
|
|
4266
4272
|
const t = this.config.state.transaction.getState(), i = this.config.state.translate.locale(), r = Il(t);
|
|
4267
4273
|
if (!r)
|
|
4268
4274
|
return !1;
|
|
4269
|
-
const
|
|
4270
|
-
onError: (
|
|
4275
|
+
const a = e ? I(v({}, e), {
|
|
4276
|
+
onError: (s) => {
|
|
4271
4277
|
var o;
|
|
4272
4278
|
if (!this.isInitialized) {
|
|
4273
|
-
console.error("Google Pay error:",
|
|
4279
|
+
console.error("Google Pay error:", s);
|
|
4274
4280
|
return;
|
|
4275
4281
|
}
|
|
4276
|
-
vt(
|
|
4282
|
+
vt(s, this.config.state.translate.messages()), (o = e.onError) == null || o.call(e, s);
|
|
4277
4283
|
},
|
|
4278
|
-
onSuccess: (
|
|
4284
|
+
onSuccess: (s) => {
|
|
4279
4285
|
var o;
|
|
4280
|
-
(o = e.onSuccess) == null || o.call(e,
|
|
4286
|
+
(o = e.onSuccess) == null || o.call(e, s);
|
|
4281
4287
|
}
|
|
4282
4288
|
}) : void 0;
|
|
4283
4289
|
return yield this.ev.initGoogle(
|
|
4284
|
-
I(v({},
|
|
4290
|
+
I(v({}, a), {
|
|
4285
4291
|
transaction: r,
|
|
4286
4292
|
locale: Rl(i || "en"),
|
|
4287
4293
|
onPaymentAttempt: this.onPaymentAttempt
|
|
@@ -4317,11 +4323,11 @@ class Yl {
|
|
|
4317
4323
|
}
|
|
4318
4324
|
// init
|
|
4319
4325
|
init(e) {
|
|
4320
|
-
return
|
|
4321
|
-
var
|
|
4326
|
+
return k(this, null, function* () {
|
|
4327
|
+
var s, o;
|
|
4322
4328
|
if (!this.config)
|
|
4323
4329
|
return !1;
|
|
4324
|
-
const t = this.config.state.transaction.getState(), i = this.config.state.checkout.getState(), r = () =>
|
|
4330
|
+
const t = this.config.state.transaction.getState(), i = this.config.state.checkout.getState(), r = () => k(this, null, function* () {
|
|
4325
4331
|
try {
|
|
4326
4332
|
return yield Rr(i.clientToken, i.environment, i.apiVersion);
|
|
4327
4333
|
} catch (l) {
|
|
@@ -4330,7 +4336,7 @@ class Yl {
|
|
|
4330
4336
|
});
|
|
4331
4337
|
if (!t || Object.keys(t).length === 0)
|
|
4332
4338
|
return console.error("PayPal transaction data is empty or invalid"), !1;
|
|
4333
|
-
if (!((
|
|
4339
|
+
if (!((s = t == null ? void 0 : t.paypal_info) != null && s.client_id))
|
|
4334
4340
|
return !1;
|
|
4335
4341
|
try {
|
|
4336
4342
|
if (yield this.paypal.init({
|
|
@@ -4344,7 +4350,7 @@ class Yl {
|
|
|
4344
4350
|
} catch (l) {
|
|
4345
4351
|
return !1;
|
|
4346
4352
|
}
|
|
4347
|
-
const
|
|
4353
|
+
const a = e ? I(v({}, e), {
|
|
4348
4354
|
onError: (l) => {
|
|
4349
4355
|
var d, h;
|
|
4350
4356
|
if (this.emitAttemptOnce(), !this.isInitialized) {
|
|
@@ -4363,24 +4369,24 @@ class Yl {
|
|
|
4363
4369
|
}
|
|
4364
4370
|
}) : void 0;
|
|
4365
4371
|
try {
|
|
4366
|
-
yield this.paypal.render(this.element, I(v({},
|
|
4372
|
+
yield this.paypal.render(this.element, I(v({}, a), {
|
|
4367
4373
|
createBillingAgreement: r,
|
|
4368
4374
|
onClick: () => {
|
|
4369
4375
|
this.emitAttemptOnce();
|
|
4370
4376
|
},
|
|
4371
|
-
onApprove: (u) =>
|
|
4377
|
+
onApprove: (u) => k(this, [u], function* ({ billingToken: l }) {
|
|
4372
4378
|
var d;
|
|
4373
|
-
(d =
|
|
4379
|
+
(d = a == null ? void 0 : a.onSuccess) == null || d.call(a, l || "");
|
|
4374
4380
|
}),
|
|
4375
4381
|
style: (o = this.customButtonStyles) == null ? void 0 : o.styles,
|
|
4376
4382
|
onCancel: () => {
|
|
4377
4383
|
var l;
|
|
4378
|
-
(l =
|
|
4384
|
+
(l = a == null ? void 0 : a.onCancel) == null || l.call(a);
|
|
4379
4385
|
},
|
|
4380
4386
|
onError: (l) => {
|
|
4381
4387
|
var d, h;
|
|
4382
4388
|
const u = this.isUserCancellationError(l);
|
|
4383
|
-
!u && l ? (d =
|
|
4389
|
+
!u && l ? (d = a == null ? void 0 : a.onError) == null || d.call(a, l) : u && ((h = a == null ? void 0 : a.onCancel) == null || h.call(a));
|
|
4384
4390
|
}
|
|
4385
4391
|
}));
|
|
4386
4392
|
} catch (l) {
|
|
@@ -4408,7 +4414,7 @@ class Yl {
|
|
|
4408
4414
|
"cancelled by user",
|
|
4409
4415
|
"user cancelled",
|
|
4410
4416
|
"popup close"
|
|
4411
|
-
].some((
|
|
4417
|
+
].some((a) => t.toLowerCase().includes(a));
|
|
4412
4418
|
}
|
|
4413
4419
|
setupInterceptOverlay() {
|
|
4414
4420
|
if (this.interceptOverlay) return;
|
|
@@ -4469,8 +4475,8 @@ class Zl {
|
|
|
4469
4475
|
const t = this.config.state.styles.getState().WalletButton, i = this.config.state.translate;
|
|
4470
4476
|
this.element = document.createElement("button"), this.element.classList.add(ci.button, ci.press), t != null && t.className && F(this.element, t.className), t != null && t.styles && Object.assign(this.element.style, t.styles);
|
|
4471
4477
|
const r = document.createElement("span");
|
|
4472
|
-
r.textContent = i.getState().messages.card.compact.button, this.element.append(this.icon.render(), r), i.subscribe(({ messages:
|
|
4473
|
-
r.textContent =
|
|
4478
|
+
r.textContent = i.getState().messages.card.compact.button, this.element.append(this.icon.render(), r), i.subscribe(({ messages: a }) => {
|
|
4479
|
+
r.textContent = a.card.compact.button;
|
|
4474
4480
|
});
|
|
4475
4481
|
}
|
|
4476
4482
|
addEventListener(e) {
|
|
@@ -4509,7 +4515,7 @@ class ic {
|
|
|
4509
4515
|
}
|
|
4510
4516
|
// init
|
|
4511
4517
|
init(e) {
|
|
4512
|
-
return
|
|
4518
|
+
return k(this, null, function* () {
|
|
4513
4519
|
var i;
|
|
4514
4520
|
if (!this.config) return !1;
|
|
4515
4521
|
const t = this.config.state.transaction.getState();
|
|
@@ -4529,7 +4535,7 @@ class ic {
|
|
|
4529
4535
|
}
|
|
4530
4536
|
// display venmo button
|
|
4531
4537
|
displayVenmoButton(e) {
|
|
4532
|
-
Object.assign(this.venmoButton.style, tc), this.venmoButton.addEventListener("click", () =>
|
|
4538
|
+
Object.assign(this.venmoButton.style, tc), this.venmoButton.addEventListener("click", () => k(this, null, function* () {
|
|
4533
4539
|
if (this.events.onPaymentAttempt.emit(x.VENMO), !this.isProcessing) {
|
|
4534
4540
|
this.isProcessing = !0, this.venmoButton.disabled = !0;
|
|
4535
4541
|
try {
|
|
@@ -4545,7 +4551,7 @@ class ic {
|
|
|
4545
4551
|
}
|
|
4546
4552
|
// handle existing tokenization results
|
|
4547
4553
|
handleExistingTokenization(e) {
|
|
4548
|
-
return
|
|
4554
|
+
return k(this, null, function* () {
|
|
4549
4555
|
try {
|
|
4550
4556
|
const t = yield this.braintree.tokenize();
|
|
4551
4557
|
this.handleVenmoSuccess(t, e);
|
|
@@ -4561,8 +4567,8 @@ class ic {
|
|
|
4561
4567
|
}
|
|
4562
4568
|
// handle venmo errors
|
|
4563
4569
|
handleVenmoError(e, t) {
|
|
4564
|
-
var i, r,
|
|
4565
|
-
this.isInitialized && ((i = e == null ? void 0 : e.message) != null && i.toLowerCase().includes("close") ? (r = t == null ? void 0 : t.onCancel) == null || r.call(t) : (
|
|
4570
|
+
var i, r, a;
|
|
4571
|
+
this.isInitialized && ((i = e == null ? void 0 : e.message) != null && i.toLowerCase().includes("close") ? (r = t == null ? void 0 : t.onCancel) == null || r.call(t) : (a = t == null ? void 0 : t.onError) == null || a.call(t, e));
|
|
4566
4572
|
}
|
|
4567
4573
|
// add event listener
|
|
4568
4574
|
addEventListener(e, t) {
|
|
@@ -4595,7 +4601,7 @@ class rc {
|
|
|
4595
4601
|
}
|
|
4596
4602
|
// init
|
|
4597
4603
|
init() {
|
|
4598
|
-
return
|
|
4604
|
+
return k(this, null, function* () {
|
|
4599
4605
|
this.config.state.transaction.subscribe(() => {
|
|
4600
4606
|
this.config.service.ev.isReady && this.initPaymentMethods().catch(console.error);
|
|
4601
4607
|
}), this.config.state.checkout.subscribe(() => {
|
|
@@ -4607,7 +4613,7 @@ class rc {
|
|
|
4607
4613
|
}
|
|
4608
4614
|
// init apple
|
|
4609
4615
|
initApple(e) {
|
|
4610
|
-
return
|
|
4616
|
+
return k(this, null, function* () {
|
|
4611
4617
|
if (!this.applePay) {
|
|
4612
4618
|
e == null || e.remove();
|
|
4613
4619
|
return;
|
|
@@ -4632,8 +4638,8 @@ class rc {
|
|
|
4632
4638
|
};
|
|
4633
4639
|
i.addEventListener("pointerdown", r, { capture: !0 }), i.addEventListener("click", r, { capture: !0 }), i.addEventListener(
|
|
4634
4640
|
"keydown",
|
|
4635
|
-
(
|
|
4636
|
-
((
|
|
4641
|
+
(a) => {
|
|
4642
|
+
((a == null ? void 0 : a.key) === "Enter" || (a == null ? void 0 : a.key) === " ") && r();
|
|
4637
4643
|
},
|
|
4638
4644
|
{ capture: !0 }
|
|
4639
4645
|
), i.addEventListener("focusin", r, { capture: !0 }), e == null || e.addEventListener("pointerdown", r, { capture: !0 }), e == null || e.addEventListener("click", r, { capture: !0 }), e == null || e.addEventListener("focusin", r, { capture: !0 });
|
|
@@ -4646,7 +4652,7 @@ class rc {
|
|
|
4646
4652
|
}
|
|
4647
4653
|
// init google
|
|
4648
4654
|
initGoogle(e) {
|
|
4649
|
-
return
|
|
4655
|
+
return k(this, null, function* () {
|
|
4650
4656
|
if (!this.googlePay) {
|
|
4651
4657
|
e == null || e.remove();
|
|
4652
4658
|
return;
|
|
@@ -4671,8 +4677,8 @@ class rc {
|
|
|
4671
4677
|
};
|
|
4672
4678
|
i.addEventListener("pointerdown", r, { capture: !0 }), i.addEventListener("click", r, { capture: !0 }), i.addEventListener(
|
|
4673
4679
|
"keydown",
|
|
4674
|
-
(
|
|
4675
|
-
((
|
|
4680
|
+
(a) => {
|
|
4681
|
+
((a == null ? void 0 : a.key) === "Enter" || (a == null ? void 0 : a.key) === " ") && r();
|
|
4676
4682
|
},
|
|
4677
4683
|
{ capture: !0 }
|
|
4678
4684
|
), i.addEventListener("focusin", r, { capture: !0 }), e == null || e.addEventListener("pointerdown", r, { capture: !0 }), e == null || e.addEventListener("click", r, { capture: !0 }), e == null || e.addEventListener("focusin", r, { capture: !0 });
|
|
@@ -4685,7 +4691,7 @@ class rc {
|
|
|
4685
4691
|
}
|
|
4686
4692
|
// init paypal
|
|
4687
4693
|
initPayPal(e) {
|
|
4688
|
-
return
|
|
4694
|
+
return k(this, null, function* () {
|
|
4689
4695
|
if (!this.paypal) {
|
|
4690
4696
|
e == null || e.remove();
|
|
4691
4697
|
return;
|
|
@@ -4711,7 +4717,7 @@ class rc {
|
|
|
4711
4717
|
}
|
|
4712
4718
|
// init braintree
|
|
4713
4719
|
initBraintreeVenmo(e) {
|
|
4714
|
-
return
|
|
4720
|
+
return k(this, null, function* () {
|
|
4715
4721
|
if (!this.braintree) {
|
|
4716
4722
|
e == null || e.remove();
|
|
4717
4723
|
return;
|
|
@@ -4738,7 +4744,7 @@ class rc {
|
|
|
4738
4744
|
}
|
|
4739
4745
|
// init card
|
|
4740
4746
|
initCard(e) {
|
|
4741
|
-
return
|
|
4747
|
+
return k(this, null, function* () {
|
|
4742
4748
|
if (!this.card) {
|
|
4743
4749
|
e == null || e.remove();
|
|
4744
4750
|
return;
|
|
@@ -4748,20 +4754,20 @@ class rc {
|
|
|
4748
4754
|
}
|
|
4749
4755
|
// init payment methods
|
|
4750
4756
|
initPaymentMethods() {
|
|
4751
|
-
return
|
|
4752
|
-
const e = this.config.state.transaction.getState(), t = Jl(zl, (e == null ? void 0 : e.checkout_config) || [], (
|
|
4753
|
-
let r = t.filter(({ is_active:
|
|
4754
|
-
(i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type:
|
|
4755
|
-
const
|
|
4756
|
-
Promise.all(
|
|
4757
|
+
return k(this, null, function* () {
|
|
4758
|
+
const e = this.config.state.transaction.getState(), t = Jl(zl, (e == null ? void 0 : e.checkout_config) || [], (s, o) => s.type === o.type), i = this.config.state.checkout.getState();
|
|
4759
|
+
let r = t.filter(({ is_active: s }) => s);
|
|
4760
|
+
(i == null ? void 0 : i.variant) === "default" && (r = r.filter(({ type: s }) => s !== x.CARD));
|
|
4761
|
+
const a = this.initializeButtonInstances(r);
|
|
4762
|
+
Promise.all(a).then(() => {
|
|
4757
4763
|
this.handleOnFormLoaded();
|
|
4758
4764
|
}), this.handleReady();
|
|
4759
4765
|
});
|
|
4760
4766
|
}
|
|
4761
4767
|
// initialize button instances
|
|
4762
4768
|
initializeButtonInstances(e) {
|
|
4763
|
-
const t = e.map(({ type: h }) => h), i = t.includes(x.APPLE_PAY), r = t.includes(x.GOOGLE_PAY),
|
|
4764
|
-
i && !this.applePay && (this.applePay = new Bl(this.config)), r && !this.googlePay && (this.googlePay = new ql(this.config)),
|
|
4769
|
+
const t = e.map(({ type: h }) => h), i = t.includes(x.APPLE_PAY), r = t.includes(x.GOOGLE_PAY), a = t.includes(x.PAYPAL), s = t.includes(x.VENMO), o = t.includes(x.CARD);
|
|
4770
|
+
i && !this.applePay && (this.applePay = new Bl(this.config)), r && !this.googlePay && (this.googlePay = new ql(this.config)), a && !this.paypal && (this.paypal = new Yl(this.config), this.paypal.addEventListener("onPaymentAttempt", (h) => this.events.onPaymentAttempt.emit(h))), s && !this.braintree && (this.braintree = new ic(this.config), this.braintree.addEventListener("onPaymentAttempt", (h) => this.events.onPaymentAttempt.emit(h))), o && !this.card && (this.card = new Zl(this.config), this.card.addEventListener(() => {
|
|
4765
4771
|
this.events.open.emit();
|
|
4766
4772
|
}));
|
|
4767
4773
|
const l = e.sort((h, m) => h.order - m.order), u = /* @__PURE__ */ new Map();
|
|
@@ -4805,7 +4811,7 @@ class rc {
|
|
|
4805
4811
|
return this.buttons;
|
|
4806
4812
|
}
|
|
4807
4813
|
}
|
|
4808
|
-
class
|
|
4814
|
+
class ac {
|
|
4809
4815
|
constructor(e) {
|
|
4810
4816
|
c(this, "template", `
|
|
4811
4817
|
<svg
|
|
@@ -4831,14 +4837,14 @@ class sc {
|
|
|
4831
4837
|
return this.element;
|
|
4832
4838
|
}
|
|
4833
4839
|
}
|
|
4834
|
-
const
|
|
4835
|
-
button:
|
|
4840
|
+
const sc = "_button_125my_1", oc = {
|
|
4841
|
+
button: sc
|
|
4836
4842
|
};
|
|
4837
4843
|
class lc {
|
|
4838
4844
|
constructor(e) {
|
|
4839
4845
|
c(this, "element");
|
|
4840
4846
|
c(this, "icon");
|
|
4841
|
-
this.element = document.createElement("div"), this.element.classList.add(oc.button), this.icon = new
|
|
4847
|
+
this.element = document.createElement("div"), this.element.classList.add(oc.button), this.icon = new ac(e), this.element.appendChild(this.icon.render());
|
|
4842
4848
|
}
|
|
4843
4849
|
addEventListener(e) {
|
|
4844
4850
|
return this.element.addEventListener("click", e);
|
|
@@ -4928,9 +4934,9 @@ class Ac {
|
|
|
4928
4934
|
c(this, "events", {
|
|
4929
4935
|
change: new K()
|
|
4930
4936
|
});
|
|
4931
|
-
var r,
|
|
4937
|
+
var r, a, s, o, l, u, d, h, m;
|
|
4932
4938
|
const i = e.messages();
|
|
4933
|
-
if (this.element = document.createElement("div"), this.element.classList.add($.wrapper), this.inputContainer.classList.add($.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (
|
|
4939
|
+
if (this.element = document.createElement("div"), this.element.classList.add($.wrapper), this.inputContainer.classList.add($.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (a = t == null ? void 0 : t.container) != null && a.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-name"), this.input.setAttribute("placeholder", i.card.name.placeholder), this.input.classList.add($.input), (s = t == null ? void 0 : t.field) != null && s.className && F(this.input, t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
|
|
4934
4940
|
const p = (b) => b.replace(/[A-Z]/g, (y) => "-" + y.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([b, y]) => `${p(b)}:${y};`).join("");
|
|
4935
4941
|
this.placeholderStyle.textContent = `#${this.id}::placeholder{${g}}`, this.element.appendChild(this.placeholderStyle);
|
|
4936
4942
|
}
|
|
@@ -4953,7 +4959,7 @@ class Ac {
|
|
|
4953
4959
|
}), this.render();
|
|
4954
4960
|
}
|
|
4955
4961
|
toggleLabelError(e) {
|
|
4956
|
-
return
|
|
4962
|
+
return k(this, null, function* () {
|
|
4957
4963
|
if (e) {
|
|
4958
4964
|
this.inputContainer.classList.add($.errorInput), this.endContent.classList.remove($.hidden), this.labelError.classList.remove($.hidden), yield H(this.labelError, W.open, W.transition);
|
|
4959
4965
|
return;
|
|
@@ -5133,11 +5139,11 @@ class zc {
|
|
|
5133
5139
|
c(this, "events", {
|
|
5134
5140
|
change: new K()
|
|
5135
5141
|
});
|
|
5136
|
-
var r,
|
|
5142
|
+
var r, a, s, o, l, u, d, h, m;
|
|
5137
5143
|
this.translate = e;
|
|
5138
5144
|
const i = e.messages();
|
|
5139
|
-
if (this.element = document.createElement("div"), this.element.classList.add(j.wrapper), this.inputContainer.classList.add(j.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (
|
|
5140
|
-
const p = (y) => y.replace(/[A-Z]/g, (
|
|
5145
|
+
if (this.element = document.createElement("div"), this.element.classList.add(j.wrapper), this.inputContainer.classList.add(j.inputContainer), (r = t == null ? void 0 : t.container) != null && r.className && F(this.inputContainer, t.container.className), (a = t == null ? void 0 : t.container) != null && a.styles && Object.assign(this.inputContainer.style, t.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("autocomplete", "cc-number"), this.input.setAttribute("placeholder", "1234 1234 1234 1234"), this.input.setAttribute("inputmode", "numeric"), this.input.setAttribute("pattern", "[0-9]*"), this.input.setAttribute("enterkeyhint", "done"), this.input.classList.add(j.input), (s = t == null ? void 0 : t.field) != null && s.className && F(this.input, t.field.className), (o = t == null ? void 0 : t.field) != null && o.styles && Object.assign(this.input.style, t.field.styles), (l = t == null ? void 0 : t.placeholder) != null && l.styles && Object.keys(t.placeholder.styles).length) {
|
|
5146
|
+
const p = (y) => y.replace(/[A-Z]/g, (E) => "-" + E.toLowerCase()), g = Object.entries(t.placeholder.styles).map(([y, E]) => `${p(y)}:${E} !important;`).join(""), b = `#${this.id}`;
|
|
5141
5147
|
this.placeholderStyle.textContent = `${b}::placeholder{${g}}
|
|
5142
5148
|
${b}::-webkit-input-placeholder{${g}}
|
|
5143
5149
|
${b}::-moz-placeholder{${g}}
|
|
@@ -5163,16 +5169,16 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5163
5169
|
handleChange(e) {
|
|
5164
5170
|
if (this.isDisabled) return;
|
|
5165
5171
|
this.isRequired = !1, this.errorMessage = "", this.isChanged || (this.isChanged = !0);
|
|
5166
|
-
const t = ri(e).map((
|
|
5172
|
+
const t = ri(e).map((a) => a.type), i = Cr(e), r = Cl(e, (i == null ? void 0 : i.type) || "");
|
|
5167
5173
|
this.supportedCardTypes = t.length ? t : this.initialCardTypes, r.replace(/\D/g, "").length === ((i == null ? void 0 : i.maxLength) || 16) && this.validate(r), this.input.value = r, this.events.change.emit({
|
|
5168
5174
|
card: r,
|
|
5169
5175
|
cardType: i == null ? void 0 : i.type,
|
|
5170
5176
|
cardTypes: t,
|
|
5171
|
-
isValid:
|
|
5177
|
+
isValid: ai(e, this.supportedCardTypes).isValid
|
|
5172
5178
|
}), this.render();
|
|
5173
5179
|
}
|
|
5174
5180
|
toggleLabelError(e) {
|
|
5175
|
-
return
|
|
5181
|
+
return k(this, null, function* () {
|
|
5176
5182
|
if (e) {
|
|
5177
5183
|
this.inputContainer.classList.add(j.errorInput), this.labelError.classList.remove(j.hidden), yield H(this.labelError, W.open, W.transition);
|
|
5178
5184
|
return;
|
|
@@ -5181,7 +5187,7 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5181
5187
|
});
|
|
5182
5188
|
}
|
|
5183
5189
|
toggleErrorMessage(e) {
|
|
5184
|
-
return
|
|
5190
|
+
return k(this, null, function* () {
|
|
5185
5191
|
if (e) {
|
|
5186
5192
|
this.inputContainer.classList.add(j.errorInput), this.error.textContent = this.errorMessage, this.error.classList.remove(j.hidden), yield H(this.error, Q.open, Q.transition);
|
|
5187
5193
|
return;
|
|
@@ -5217,7 +5223,7 @@ ${b}::-ms-input-placeholder{${g}}
|
|
|
5217
5223
|
};
|
|
5218
5224
|
}
|
|
5219
5225
|
validate(e) {
|
|
5220
|
-
const t = this.translate.messages(), { isValid: i, error: r } =
|
|
5226
|
+
const t = this.translate.messages(), { isValid: i, error: r } = ai(e, this.supportedCardTypes);
|
|
5221
5227
|
return i ? (this.isRequired = !1, this.errorMessage = "", this.render(), i) : (r === Y.Empty ? (this.errorMessage = "", this.isRequired = !0) : r === Y.Unsupported ? (this.errorMessage = t.card.number.error.unsupported, this.isRequired = !1) : (this.errorMessage = r === Y.Incomplete ? t.card.number.error.incomplete : t.card.number.error.invalid, this.isRequired = !1), this.render(), i);
|
|
5222
5228
|
}
|
|
5223
5229
|
render() {
|
|
@@ -5303,24 +5309,24 @@ class ed {
|
|
|
5303
5309
|
expiryChange: new K(),
|
|
5304
5310
|
cvcChange: new K()
|
|
5305
5311
|
});
|
|
5306
|
-
var
|
|
5312
|
+
var s, o, l, u, d, h, m, p, g, b, y, E, V, _, M, T, D;
|
|
5307
5313
|
this.translate = e;
|
|
5308
5314
|
const i = e.messages();
|
|
5309
|
-
this.element = document.createElement("div"), this.element.classList.add(A.securityContent), this.expiryInputContainer.classList.add(A.inputContainer), (
|
|
5315
|
+
this.element = document.createElement("div"), this.element.classList.add(A.securityContent), this.expiryInputContainer.classList.add(A.inputContainer), (s = t == null ? void 0 : t.container) != null && s.className && F(this.expiryInputContainer, t.container.className), (o = t == null ? void 0 : t.container) != null && o.styles && Object.assign(this.expiryInputContainer.style, t.container.styles), this.expiryInput.setAttribute("id", this.expiryId), this.expiryInput.setAttribute("autocomplete", "cc-exp"), this.expiryInput.setAttribute("placeholder", i.card.expiry.placeholder), this.expiryInput.setAttribute("inputmode", "numeric"), this.expiryInput.setAttribute("pattern", "[0-9]*"), this.expiryInput.setAttribute("enterkeyhint", "next"), this.expiryInput.classList.add(A.input), (l = t == null ? void 0 : t.field) != null && l.className && F(this.expiryInput, t.field.className), (u = t == null ? void 0 : t.field) != null && u.styles && Object.assign(this.expiryInput.style, t.field.styles), this.expiryEndContent.classList.add(A.endContent), this.expiryEndContent.appendChild(this.expiryWarning.render()), this.expiryInputContainer.append(this.expiryInput, this.expiryEndContent), this.expiryLabel.setAttribute("for", this.expiryId), this.expiryLabel.classList.add(A.label), (d = t == null ? void 0 : t.label) != null && d.className && F(this.expiryLabel, t.label.className), (h = t == null ? void 0 : t.label) != null && h.styles && Object.assign(this.expiryLabel.style, t.label.styles), this.expiryLabelText.contentEditable = "false", this.expiryLabelText.textContent = i.card.expiry.label, this.expiryLabelError.textContent = i.card.required, this.expiryLabelError.classList.add(A.labelError, A.hidden), this.expiryLabel.append(this.expiryLabelText, this.expiryLabelError), this.expiryError.classList.add(A.error, A.hidden), (m = t == null ? void 0 : t.error) != null && m.className && F(this.expiryError, t.error.className), (p = t == null ? void 0 : t.error) != null && p.styles && Object.assign(this.expiryError.style, t.error.styles);
|
|
5310
5316
|
const r = document.createElement("div");
|
|
5311
|
-
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(A.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && F(this.cvcInputContainer, t.container.className), (b = t == null ? void 0 : t.container) != null && b.styles && Object.assign(this.cvcInputContainer.style, t.container.styles), this.cvcInput.setAttribute("id", this.cvcId), this.cvcInput.setAttribute("autocomplete", "cc-csc"), this.cvcInput.setAttribute("placeholder", i.card.cvc.placeholder), this.cvcInput.setAttribute("inputmode", "numeric"), this.cvcInput.setAttribute("pattern", "[0-9]*"), this.cvcInput.setAttribute("enterkeyhint", "done"), this.cvcInput.classList.add(A.input), (y = t == null ? void 0 : t.field) != null && y.className && F(this.cvcInput, t.field.className), (
|
|
5317
|
+
if (r.appendChild(this.expiryError), this.cvcInputContainer.classList.add(A.inputContainer), (g = t == null ? void 0 : t.container) != null && g.className && F(this.cvcInputContainer, t.container.className), (b = t == null ? void 0 : t.container) != null && b.styles && Object.assign(this.cvcInputContainer.style, t.container.styles), this.cvcInput.setAttribute("id", this.cvcId), this.cvcInput.setAttribute("autocomplete", "cc-csc"), this.cvcInput.setAttribute("placeholder", i.card.cvc.placeholder), this.cvcInput.setAttribute("inputmode", "numeric"), this.cvcInput.setAttribute("pattern", "[0-9]*"), this.cvcInput.setAttribute("enterkeyhint", "done"), this.cvcInput.classList.add(A.input), (y = t == null ? void 0 : t.field) != null && y.className && F(this.cvcInput, t.field.className), (E = t == null ? void 0 : t.field) != null && E.styles && Object.assign(this.cvcInput.style, t.field.styles), (V = t == null ? void 0 : t.placeholder) != null && V.styles && Object.keys(t.placeholder.styles).length) {
|
|
5312
5318
|
const C = (R) => R.replace(/[A-Z]/g, (O) => "-" + O.toLowerCase()), w = Object.entries(t.placeholder.styles).map(([R, O]) => `${C(R)}:${O};`).join("");
|
|
5313
5319
|
this.placeholderStyle.textContent = `#${this.expiryId}::placeholder{${w}}#${this.cvcId}::placeholder{${w}}`, this.element.appendChild(this.placeholderStyle);
|
|
5314
5320
|
}
|
|
5315
5321
|
this.cvcEndContent.classList.add(A.endContent), this.cvcEndContent.appendChild(this.cardCvc.render()), this.cvcInputContainer.append(this.cvcInput, this.cvcEndContent), this.cvcLabel.setAttribute("for", this.cvcId), this.cvcLabel.classList.add(A.label), (_ = t == null ? void 0 : t.label) != null && _.className && F(this.cvcLabel, t.label.className), (M = t == null ? void 0 : t.label) != null && M.styles && Object.assign(this.cvcLabel.style, t.label.styles), this.cvcLabelText.textContent = i.card.cvc.label, this.cvcLabelError.textContent = i.card.required, this.cvcLabelError.classList.add(A.labelError, A.hidden), (T = t == null ? void 0 : t.error) != null && T.className && F(this.cvcLabel, t.error.className), (D = t == null ? void 0 : t.error) != null && D.styles && Object.assign(this.cvcLabelError.style, t.error.styles), this.cvcLabel.append(this.cvcLabelText, this.cvcLabelError), this.cvcError.classList.add(A.error, A.hidden);
|
|
5316
|
-
const
|
|
5317
|
-
|
|
5322
|
+
const a = document.createElement("div");
|
|
5323
|
+
a.appendChild(this.cvcError), this.element.append(
|
|
5318
5324
|
this.expiryLabel,
|
|
5319
5325
|
this.cvcLabel,
|
|
5320
5326
|
this.expiryInputContainer,
|
|
5321
5327
|
this.cvcInputContainer,
|
|
5322
5328
|
r,
|
|
5323
|
-
|
|
5329
|
+
a
|
|
5324
5330
|
), this.expiryInput.addEventListener("input", (C) => {
|
|
5325
5331
|
C.preventDefault();
|
|
5326
5332
|
const R = this.expiryInput.value.replace(/\D/g, "");
|
|
@@ -5365,7 +5371,7 @@ class ed {
|
|
|
5365
5371
|
}), this.cvcInput.value = t, this.render();
|
|
5366
5372
|
}
|
|
5367
5373
|
toggleCvcLabelError(e) {
|
|
5368
|
-
return
|
|
5374
|
+
return k(this, null, function* () {
|
|
5369
5375
|
if (e) {
|
|
5370
5376
|
this.cvcInputContainer.classList.add(A.errorInput), this.cvcLabelError.classList.remove(A.hidden), yield H(this.cvcLabelError, W.open, W.transition);
|
|
5371
5377
|
return;
|
|
@@ -5374,7 +5380,7 @@ class ed {
|
|
|
5374
5380
|
});
|
|
5375
5381
|
}
|
|
5376
5382
|
toggleCvcErrorMessage(e) {
|
|
5377
|
-
return
|
|
5383
|
+
return k(this, null, function* () {
|
|
5378
5384
|
if (e) {
|
|
5379
5385
|
this.cvcInputContainer.classList.add(A.errorInput), this.cvcError.textContent = this.cvcErrorMessage, this.cvcError.classList.remove(A.hidden), yield H(this.cvcError, Q.open, Q.transition);
|
|
5380
5386
|
return;
|
|
@@ -5383,8 +5389,8 @@ class ed {
|
|
|
5383
5389
|
});
|
|
5384
5390
|
}
|
|
5385
5391
|
expiryValidator(e) {
|
|
5386
|
-
const t = !e, i = e.length < 7, r = /* @__PURE__ */ new Date(), [
|
|
5387
|
-
r.setFullYear(2e3 + parseInt(
|
|
5392
|
+
const t = !e, i = e.length < 7, r = /* @__PURE__ */ new Date(), [a, s] = e.split(" / ");
|
|
5393
|
+
r.setFullYear(2e3 + parseInt(s), parseInt(a) - 1, 31);
|
|
5388
5394
|
const o = r.getTime() < Date.now(), l = /* @__PURE__ */ new Date(), u = /* @__PURE__ */ new Date();
|
|
5389
5395
|
u.setFullYear(l.getFullYear() + 50);
|
|
5390
5396
|
const d = r.getTime() > u.getTime() || r.getFullYear() < l.getFullYear();
|
|
@@ -5416,7 +5422,7 @@ class ed {
|
|
|
5416
5422
|
}
|
|
5417
5423
|
// toggle expiry label error
|
|
5418
5424
|
toggleExpiryLabelError(e) {
|
|
5419
|
-
return
|
|
5425
|
+
return k(this, null, function* () {
|
|
5420
5426
|
if (e) {
|
|
5421
5427
|
this.expiryInputContainer.classList.add(A.errorInput), this.expiryLabelError.classList.remove(A.hidden), yield H(this.expiryLabelError, W.open, W.transition);
|
|
5422
5428
|
return;
|
|
@@ -5426,7 +5432,7 @@ class ed {
|
|
|
5426
5432
|
}
|
|
5427
5433
|
// toggle expiry error message
|
|
5428
5434
|
toggleExpiryErrorMessage(e) {
|
|
5429
|
-
return
|
|
5435
|
+
return k(this, null, function* () {
|
|
5430
5436
|
if (e) {
|
|
5431
5437
|
this.expiryInputContainer.classList.add(A.errorInput), this.expiryError.textContent = this.expiryErrorMessage, this.expiryError.classList.remove(A.hidden), yield H(this.expiryError, Q.open, Q.transition);
|
|
5432
5438
|
return;
|
|
@@ -5466,12 +5472,12 @@ class ed {
|
|
|
5466
5472
|
render() {
|
|
5467
5473
|
const e = this.isTouchSubmit || this.isExpiryChanged, t = e && !this.isDisabled && this.isExpiryRequired, i = e && !this.isDisabled && !!this.expiryErrorMessage;
|
|
5468
5474
|
this.toggleExpiryLabelError(t), this.toggleExpiryErrorMessage(i), !t && !i ? (this.expiryInputContainer.classList.remove(A.errorInput), this.expiryEndContent.classList.add(A.hidden)) : this.expiryEndContent.classList.remove(A.hidden);
|
|
5469
|
-
const r = this.isTouchSubmit || this.isCvcChanged,
|
|
5470
|
-
return this.toggleCvcLabelError(
|
|
5475
|
+
const r = this.isTouchSubmit || this.isCvcChanged, a = r && !this.isDisabled && this.isCvcRequired, s = r && !this.isDisabled && !!this.cvcErrorMessage;
|
|
5476
|
+
return this.toggleCvcLabelError(a), this.toggleCvcErrorMessage(s), !a && !s ? (this.cvcInputContainer.classList.remove(A.errorInput), this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cardCvc.render())) : (this.cvcEndContent.innerHTML = "", this.cvcEndContent.appendChild(this.cvcWarning.render())), this.isDisabled ? (this.expiryInputContainer.classList.add(A.disabled), this.expiryInput.classList.add(A.disabledInput), this.cvcInputContainer.classList.add(A.disabled), this.cvcInput.classList.add(A.disabledInput)) : (this.expiryInputContainer.classList.remove(A.disabled), this.expiryInput.classList.remove(A.disabledInput), this.cvcInputContainer.classList.remove(A.disabled), this.cvcInput.classList.remove(A.disabledInput)), this.element;
|
|
5471
5477
|
}
|
|
5472
5478
|
}
|
|
5473
5479
|
class td {
|
|
5474
|
-
constructor({ translate: e, className: t, stylesState: i, isDefaultVariant: r, onPaymentAttempt:
|
|
5480
|
+
constructor({ translate: e, className: t, stylesState: i, isDefaultVariant: r, onPaymentAttempt: a }) {
|
|
5475
5481
|
c(this, "element");
|
|
5476
5482
|
c(this, "submit");
|
|
5477
5483
|
c(this, "back");
|
|
@@ -5484,8 +5490,8 @@ class td {
|
|
|
5484
5490
|
submit: new K(),
|
|
5485
5491
|
close: new K()
|
|
5486
5492
|
});
|
|
5487
|
-
const
|
|
5488
|
-
this.element = document.createElement("form"), this.onPaymentAttempt =
|
|
5493
|
+
const s = i.getState();
|
|
5494
|
+
this.element = document.createElement("form"), this.onPaymentAttempt = a, this.submit = new pc(e, s.SubmitButton), this.back = new lc(s.BackButton), this.number = new zc(e, s.Input), this.name = new Ac(e, s.Input), this.cardSecurity = new ed(e, s.Input), this.element.classList.add(ve.cardForm), t && F(this.element, t);
|
|
5489
5495
|
const o = this.back.render();
|
|
5490
5496
|
r && (this.isBackVisible = !1, o.classList.add(ve.hidden), this.element.classList.add(ve.topOffset)), this.element.append(
|
|
5491
5497
|
o,
|
|
@@ -5567,7 +5573,7 @@ const id = "_container_79xkl_1", rd = "_title_79xkl_5", di = {
|
|
|
5567
5573
|
container: id,
|
|
5568
5574
|
title: rd
|
|
5569
5575
|
};
|
|
5570
|
-
class
|
|
5576
|
+
class ad {
|
|
5571
5577
|
constructor() {
|
|
5572
5578
|
c(this, "element");
|
|
5573
5579
|
c(this, "message", document.createElement("p"));
|
|
@@ -5584,8 +5590,8 @@ class sd {
|
|
|
5584
5590
|
return this.element;
|
|
5585
5591
|
}
|
|
5586
5592
|
}
|
|
5587
|
-
const
|
|
5588
|
-
container:
|
|
5593
|
+
const sd = "_container_g3abj_1", od = "_title_g3abj_12", ui = {
|
|
5594
|
+
container: sd,
|
|
5589
5595
|
title: od
|
|
5590
5596
|
}, Ze = class Ze {
|
|
5591
5597
|
constructor(e, t) {
|
|
@@ -5654,11 +5660,11 @@ class ld {
|
|
|
5654
5660
|
var i, r;
|
|
5655
5661
|
return (r = (i = this.config.state.checkout.getState()).onCheckoutAttempt) == null ? void 0 : r.call(i, t);
|
|
5656
5662
|
}
|
|
5657
|
-
}), this.success = new
|
|
5663
|
+
}), this.success = new ad(), this.success.addClassName(Z.hidden), this.error = new Wt(e.state.translate, e.state.checkout.getState().errorMessageText), this.error.hide(), this.container.append(this.loader.render(), this.buttons.render(), this.form.render()), this.checkout = document.createElement("div"), this.checkout.classList.add(Z.checkout), this.checkout.append(this.container, this.error.render(), this.success.render());
|
|
5658
5664
|
}
|
|
5659
5665
|
// init
|
|
5660
5666
|
init() {
|
|
5661
|
-
return
|
|
5667
|
+
return k(this, null, function* () {
|
|
5662
5668
|
this.buttons.addEventListener("onPaymentAttempt", (e) => {
|
|
5663
5669
|
var i;
|
|
5664
5670
|
const t = this.config.state.checkout.getState();
|
|
@@ -5666,7 +5672,7 @@ class ld {
|
|
|
5666
5672
|
}), this.buttons.addEventListener("onFormLoaded", () => {
|
|
5667
5673
|
const { onCheckoutLoaded: e } = this.config.state.checkout.getState();
|
|
5668
5674
|
!this.hasLoadedOnce && e && (this.hasLoadedOnce = !0, e({ success: !0 }));
|
|
5669
|
-
}), this.buttons.addEventListener("ready", () =>
|
|
5675
|
+
}), this.buttons.addEventListener("ready", () => k(this, null, function* () {
|
|
5670
5676
|
var t;
|
|
5671
5677
|
this.loader.setClassName(Z.hidden);
|
|
5672
5678
|
const { variant: e } = this.config.state.checkout.getState();
|
|
@@ -5677,7 +5683,7 @@ class ld {
|
|
|
5677
5683
|
{ duration: 250, easing: "ease-out", fill: "forwards" }
|
|
5678
5684
|
).finished) != null ? t : Promise.resolve(), this.checkout.style.height = ""), this.isFormOpen = !0;
|
|
5679
5685
|
}
|
|
5680
|
-
})), this.buttons.addEventListener("open", () =>
|
|
5686
|
+
})), this.buttons.addEventListener("open", () => k(this, null, function* () {
|
|
5681
5687
|
var r;
|
|
5682
5688
|
if (this.isLoading) return;
|
|
5683
5689
|
this.hideError();
|
|
@@ -5693,9 +5699,9 @@ class ld {
|
|
|
5693
5699
|
i != null ? i : Promise.resolve()
|
|
5694
5700
|
]), t < this.FORM_HEIGHT && (this.checkout.style.height = ""), this.isFormOpen = !0;
|
|
5695
5701
|
})), this.buttons.addEventListener("error", (e) => {
|
|
5696
|
-
const { onCheckoutFail: t, onCheckoutLoaded: i } = this.config.state.checkout.getState(), r = this.config.state.translate.messages(),
|
|
5697
|
-
this.showError(
|
|
5698
|
-
const
|
|
5702
|
+
const { onCheckoutFail: t, onCheckoutLoaded: i } = this.config.state.checkout.getState(), r = this.config.state.translate.messages(), a = vt(e, r);
|
|
5703
|
+
this.showError(a);
|
|
5704
|
+
const s = {
|
|
5699
5705
|
status: "failed",
|
|
5700
5706
|
status_reason: {
|
|
5701
5707
|
advice_code: "try_again_later",
|
|
@@ -5703,7 +5709,7 @@ class ld {
|
|
|
5703
5709
|
message: e.message || e
|
|
5704
5710
|
}
|
|
5705
5711
|
};
|
|
5706
|
-
!this.hasLoadedOnce && i && (this.hasLoadedOnce = !0, i({ success: !1, error:
|
|
5712
|
+
!this.hasLoadedOnce && i && (this.hasLoadedOnce = !0, i({ success: !1, error: s })), t == null || t(s);
|
|
5707
5713
|
}), this.buttons.addEventListener("success", (e) => {
|
|
5708
5714
|
const { clientToken: t } = this.config.state.checkout.getState();
|
|
5709
5715
|
switch (e.type) {
|
|
@@ -5719,29 +5725,29 @@ class ld {
|
|
|
5719
5725
|
case "venmo":
|
|
5720
5726
|
return this.handleSuccess({ clientSession: t, braintree: { nonce: e } });
|
|
5721
5727
|
}
|
|
5722
|
-
}), this.form.addEventListener("close", () =>
|
|
5723
|
-
var
|
|
5728
|
+
}), this.form.addEventListener("close", () => k(this, null, function* () {
|
|
5729
|
+
var a, s;
|
|
5724
5730
|
if (this.isLoading) return;
|
|
5725
5731
|
this.hideError();
|
|
5726
5732
|
const e = this.checkout.getBoundingClientRect().height;
|
|
5727
5733
|
let t = null;
|
|
5728
|
-
this.closedHeight > 0 && e > this.closedHeight && (this.checkout.style.height = `${e}px`, t = (
|
|
5734
|
+
this.closedHeight > 0 && e > this.closedHeight && (this.checkout.style.height = `${e}px`, t = (a = this.checkout.animate(
|
|
5729
5735
|
{ minHeight: [`${e}px`, `${this.closedHeight}px`] },
|
|
5730
5736
|
{ duration: 250, easing: "ease-out", fill: "forwards" }
|
|
5731
|
-
).finished) != null ?
|
|
5737
|
+
).finished) != null ? a : Promise.resolve()), yield H(this.form.element, Le.close, Le.transition), this.form.element.classList.add(Z.hidden);
|
|
5732
5738
|
const { variant: r } = this.config.state.checkout.getState();
|
|
5733
5739
|
if (r !== "default") {
|
|
5734
5740
|
this.buttons.buttons.classList.add(Z.btnsInitial), this.buttons.buttons.classList.remove(Z.hidden);
|
|
5735
5741
|
const o = H(this.buttons.buttons, ut.open, ut.transition);
|
|
5736
5742
|
yield Promise.all([o, t != null ? t : Promise.resolve()]);
|
|
5737
5743
|
}
|
|
5738
|
-
this.closedHeight > 0 && (t = (
|
|
5744
|
+
this.closedHeight > 0 && (t = (s = this.checkout.animate(
|
|
5739
5745
|
{ minHeight: [`${e}px`, `${this.closedHeight}px`] },
|
|
5740
5746
|
{ duration: 250, easing: "ease-out", fill: "forwards" }
|
|
5741
|
-
).finished) != null ?
|
|
5742
|
-
})), this.form.addEventListener("submit", (e) =>
|
|
5747
|
+
).finished) != null ? s : Promise.resolve(), this.checkout.style.height = "auto"), this.isFormOpen = !1;
|
|
5748
|
+
})), this.form.addEventListener("submit", (e) => k(this, null, function* () {
|
|
5743
5749
|
if (this.isLoading || (this.form.touchSubmit(), this.hideError(), !this.form.validate())) return;
|
|
5744
|
-
const i = e.number.replace(/\D/g, ""), r = this.config.state.checkout.getState(),
|
|
5750
|
+
const i = e.number.replace(/\D/g, ""), r = this.config.state.checkout.getState(), a = this.config.service.ev.getEv(), [s, o] = yield Promise.all([a.encrypt(i), a.encrypt(e.cvc)]), [l, u] = e.expiry.split("/");
|
|
5745
5751
|
yield this.handleSuccess({
|
|
5746
5752
|
clientSession: r.clientToken,
|
|
5747
5753
|
card: {
|
|
@@ -5750,7 +5756,7 @@ class ld {
|
|
|
5750
5756
|
expMonth: Number(l),
|
|
5751
5757
|
expYear: Number(u),
|
|
5752
5758
|
cardBrand: e.cardBrand || "",
|
|
5753
|
-
number:
|
|
5759
|
+
number: s,
|
|
5754
5760
|
cvc: o,
|
|
5755
5761
|
type: x.CARD,
|
|
5756
5762
|
metadata: {
|
|
@@ -5764,21 +5770,21 @@ class ld {
|
|
|
5764
5770
|
}
|
|
5765
5771
|
// handle error
|
|
5766
5772
|
handleError(e) {
|
|
5767
|
-
var
|
|
5773
|
+
var a;
|
|
5768
5774
|
const t = this.config.state.checkout.getState(), i = this.config.state.translate.messages(), r = vt(e, i);
|
|
5769
|
-
e && (this.showError(r), (
|
|
5775
|
+
e && (this.showError(r), (a = t.onCheckoutFail) == null || a.call(t, e)), this.setLoading(!1);
|
|
5770
5776
|
}
|
|
5771
5777
|
// handle success
|
|
5772
5778
|
handleSuccess(e) {
|
|
5773
|
-
return
|
|
5774
|
-
var
|
|
5779
|
+
return k(this, null, function* () {
|
|
5780
|
+
var a, s;
|
|
5775
5781
|
if (this.isLoading) return;
|
|
5776
5782
|
this.hideError(), this.setLoading(!0);
|
|
5777
5783
|
const t = this.config.state.checkout.getState(), i = this.config.state.translate.messages();
|
|
5778
5784
|
let r;
|
|
5779
5785
|
try {
|
|
5780
5786
|
if (r = yield Dr(e, t.environment, t.apiVersion), r.error)
|
|
5781
|
-
throw new Error(((
|
|
5787
|
+
throw new Error(((a = r.error) == null ? void 0 : a.message) || i.status.error);
|
|
5782
5788
|
if (r.three_ds_session_id) {
|
|
5783
5789
|
yield this.config.service.ev.initThreeDs({
|
|
5784
5790
|
threeDsId: r.three_ds_session_id,
|
|
@@ -5806,12 +5812,12 @@ class ld {
|
|
|
5806
5812
|
}
|
|
5807
5813
|
});
|
|
5808
5814
|
}
|
|
5809
|
-
(
|
|
5815
|
+
(s = t.onCheckoutComplete) == null || s.call(t, r);
|
|
5810
5816
|
});
|
|
5811
5817
|
}
|
|
5812
5818
|
// show success
|
|
5813
5819
|
showSuccess() {
|
|
5814
|
-
return
|
|
5820
|
+
return k(this, null, function* () {
|
|
5815
5821
|
this.container.classList.add(Z.hidden), this.success.removeClassName(Z.hidden), yield H(this.success.element, Le.open, Le.transition);
|
|
5816
5822
|
});
|
|
5817
5823
|
}
|
|
@@ -5862,13 +5868,13 @@ class cd {
|
|
|
5862
5868
|
}
|
|
5863
5869
|
// init
|
|
5864
5870
|
init() {
|
|
5865
|
-
return
|
|
5866
|
-
const { checkout: e, transaction: t, translate: i, styles: r } = this.config.state, { apiVersion:
|
|
5867
|
-
e.subscribe(({ clientToken:
|
|
5871
|
+
return k(this, null, function* () {
|
|
5872
|
+
const { checkout: e, transaction: t, translate: i, styles: r } = this.config.state, { apiVersion: a } = e.getState();
|
|
5873
|
+
e.subscribe(({ clientToken: s, environment: o, locale: l, translate: u, styles: d }) => {
|
|
5868
5874
|
const h = kn.teamId, m = kn.appIds[o];
|
|
5869
|
-
l && i.locale() !== l && i.setLocale(l), u && i.overrides() !== u && i.setMessages(u), d && r.setState(d), t.updateTransaction(
|
|
5875
|
+
this.config.service.ev.preloadEvervault({ teamId: h, appId: m }).finally(), l && i.locale() !== l && i.setLocale(l), u && i.overrides() !== u && i.setMessages(u), d && r.setState(d), t.updateTransaction(s, o, a).then((p) => {
|
|
5870
5876
|
if (!p)
|
|
5871
|
-
throw new Error("
|
|
5877
|
+
throw new Error("Payment config not found");
|
|
5872
5878
|
return this.config.service.ev.initEv({ teamId: h, appId: m });
|
|
5873
5879
|
}).catch((p) => {
|
|
5874
5880
|
if (console.error(p), this.component) {
|
|
@@ -5881,7 +5887,7 @@ class cd {
|
|
|
5881
5887
|
}
|
|
5882
5888
|
// mount
|
|
5883
5889
|
mount() {
|
|
5884
|
-
return
|
|
5890
|
+
return k(this, null, function* () {
|
|
5885
5891
|
return this.component || (this.component = new ld(this.config)), yield this.init(), yield this.component.init(), this.component.render();
|
|
5886
5892
|
});
|
|
5887
5893
|
}
|
|
@@ -5930,16 +5936,16 @@ class md extends Ct {
|
|
|
5930
5936
|
}
|
|
5931
5937
|
// update transaction
|
|
5932
5938
|
updateTransaction(t, i, r) {
|
|
5933
|
-
return
|
|
5939
|
+
return k(this, null, function* () {
|
|
5934
5940
|
if (this.clientToken === t) return this.getState();
|
|
5935
5941
|
this.clientToken = t;
|
|
5936
5942
|
try {
|
|
5937
|
-
const
|
|
5938
|
-
return this.setState(
|
|
5939
|
-
} catch (
|
|
5940
|
-
console.error("Failed to update transaction:",
|
|
5941
|
-
const
|
|
5942
|
-
throw
|
|
5943
|
+
const a = yield Or(t, i, r);
|
|
5944
|
+
return this.setState(a), a;
|
|
5945
|
+
} catch (a) {
|
|
5946
|
+
console.error("Failed to update transaction:", a);
|
|
5947
|
+
const s = new Error("INVALID_SESSION");
|
|
5948
|
+
throw s.name = "INVALID_SESSION", s;
|
|
5943
5949
|
}
|
|
5944
5950
|
});
|
|
5945
5951
|
}
|
|
@@ -7533,7 +7539,7 @@ const fd = {
|
|
|
7533
7539
|
const n = navigator == null ? void 0 : navigator.language.split("-")[0];
|
|
7534
7540
|
return Zt[n] || Zt.en;
|
|
7535
7541
|
}, hi = (n, e = {}) => {
|
|
7536
|
-
var r,
|
|
7542
|
+
var r, a;
|
|
7537
7543
|
if (!n) return Jt();
|
|
7538
7544
|
const t = Zt[n] || Jt();
|
|
7539
7545
|
return {
|
|
@@ -7554,7 +7560,7 @@ const fd = {
|
|
|
7554
7560
|
}),
|
|
7555
7561
|
status: {
|
|
7556
7562
|
error: ((r = e == null ? void 0 : e.status) == null ? void 0 : r.error) || t.status.error,
|
|
7557
|
-
invalidSession: ((
|
|
7563
|
+
invalidSession: ((a = e == null ? void 0 : e.status) == null ? void 0 : a.invalidSession) || t.status.invalidSession
|
|
7558
7564
|
}
|
|
7559
7565
|
};
|
|
7560
7566
|
};
|
|
@@ -7601,7 +7607,7 @@ class Qd {
|
|
|
7601
7607
|
}
|
|
7602
7608
|
// init
|
|
7603
7609
|
init(e) {
|
|
7604
|
-
return
|
|
7610
|
+
return k(this, null, function* () {
|
|
7605
7611
|
if (typeof window == "undefined")
|
|
7606
7612
|
throw new Error("PayPal can only be initialized in browser environment");
|
|
7607
7613
|
try {
|
|
@@ -7618,16 +7624,16 @@ class Qd {
|
|
|
7618
7624
|
}
|
|
7619
7625
|
// render
|
|
7620
7626
|
render(e, t) {
|
|
7621
|
-
return
|
|
7627
|
+
return k(this, null, function* () {
|
|
7622
7628
|
var i, r;
|
|
7623
7629
|
if (!e.isConnected)
|
|
7624
7630
|
throw new Error("PayPal parent element must be connected to DOM before render()");
|
|
7625
7631
|
if (this.paypal) {
|
|
7626
|
-
const
|
|
7632
|
+
const a = v(v({}, Xd), (t == null ? void 0 : t.style) || {}), s = I(v({
|
|
7627
7633
|
fundingSource: "paypal"
|
|
7628
7634
|
}, t), {
|
|
7629
|
-
style:
|
|
7630
|
-
}), o = (r = (i = this.paypal).Buttons) == null ? void 0 : r.call(i,
|
|
7635
|
+
style: a
|
|
7636
|
+
}), o = (r = (i = this.paypal).Buttons) == null ? void 0 : r.call(i, s);
|
|
7631
7637
|
if (!o)
|
|
7632
7638
|
throw new Error("PayPal Buttons instance is null");
|
|
7633
7639
|
yield o.render(e);
|
|
@@ -7643,20 +7649,20 @@ class eu {
|
|
|
7643
7649
|
}
|
|
7644
7650
|
// init
|
|
7645
7651
|
init(e) {
|
|
7646
|
-
return
|
|
7652
|
+
return k(this, null, function* () {
|
|
7647
7653
|
if (typeof window == "undefined")
|
|
7648
7654
|
throw new Error("Braintree can only be initialized in browser environment");
|
|
7649
7655
|
try {
|
|
7650
7656
|
const [t, i] = yield Promise.all([
|
|
7651
|
-
import("./client-Cz7Nq-cT.js").then((
|
|
7652
|
-
import("./data-collector-DPBfun3X.js").then((
|
|
7653
|
-
]), r = t.default,
|
|
7657
|
+
import("./client-Cz7Nq-cT.js").then((s) => s.c),
|
|
7658
|
+
import("./data-collector-DPBfun3X.js").then((s) => s.d)
|
|
7659
|
+
]), r = t.default, a = i.default;
|
|
7654
7660
|
this.client = yield r.create({ authorization: e.authorization });
|
|
7655
7661
|
try {
|
|
7656
|
-
const
|
|
7657
|
-
this.deviceData =
|
|
7658
|
-
} catch (
|
|
7659
|
-
console.warn("Braintree device data collection failed:",
|
|
7662
|
+
const s = yield a.create({ client: this.client, paypal: !0 });
|
|
7663
|
+
this.deviceData = s.deviceData || null;
|
|
7664
|
+
} catch (s) {
|
|
7665
|
+
console.warn("Braintree device data collection failed:", s), this.deviceData = null;
|
|
7660
7666
|
}
|
|
7661
7667
|
} catch (t) {
|
|
7662
7668
|
throw console.error("Failed to initialize Braintree client:", t), t;
|
|
@@ -7665,7 +7671,7 @@ class eu {
|
|
|
7665
7671
|
}
|
|
7666
7672
|
// create venmo instance
|
|
7667
7673
|
createVenmo(e) {
|
|
7668
|
-
return
|
|
7674
|
+
return k(this, null, function* () {
|
|
7669
7675
|
if (!this.client)
|
|
7670
7676
|
throw new Error("Braintree client must be initialized before creating Venmo instance");
|
|
7671
7677
|
try {
|
|
@@ -7694,7 +7700,7 @@ class eu {
|
|
|
7694
7700
|
}
|
|
7695
7701
|
// tokenize venmo payment
|
|
7696
7702
|
tokenize() {
|
|
7697
|
-
return
|
|
7703
|
+
return k(this, null, function* () {
|
|
7698
7704
|
if (!this.venmoInstance)
|
|
7699
7705
|
throw new Error("Venmo instance not initialized");
|
|
7700
7706
|
return new Promise((e, t) => {
|
|
@@ -7702,9 +7708,9 @@ class eu {
|
|
|
7702
7708
|
if (i)
|
|
7703
7709
|
t(i);
|
|
7704
7710
|
else {
|
|
7705
|
-
const
|
|
7711
|
+
const a = I(v({}, r), {
|
|
7706
7712
|
device_data: this.deviceData || void 0
|
|
7707
|
-
}),
|
|
7713
|
+
}), s = r, o = (s == null ? void 0 : s.billingAddress) || (s == null ? void 0 : s.billing_address);
|
|
7708
7714
|
if (o) {
|
|
7709
7715
|
const l = {
|
|
7710
7716
|
city: o.adminArea2,
|
|
@@ -7714,16 +7720,16 @@ class eu {
|
|
|
7714
7720
|
postal_code: o.postalCode,
|
|
7715
7721
|
state: o.adminArea1
|
|
7716
7722
|
};
|
|
7717
|
-
|
|
7723
|
+
a.billing_address = l;
|
|
7718
7724
|
}
|
|
7719
|
-
e(
|
|
7725
|
+
e(a);
|
|
7720
7726
|
}
|
|
7721
7727
|
});
|
|
7722
7728
|
});
|
|
7723
7729
|
});
|
|
7724
7730
|
}
|
|
7725
7731
|
}
|
|
7726
|
-
class
|
|
7732
|
+
class su {
|
|
7727
7733
|
constructor() {
|
|
7728
7734
|
c(this, "ev", new jr());
|
|
7729
7735
|
c(this, "paypal", new Qd());
|
|
@@ -7744,7 +7750,7 @@ class au {
|
|
|
7744
7750
|
}
|
|
7745
7751
|
}
|
|
7746
7752
|
export {
|
|
7747
|
-
|
|
7753
|
+
su as Core,
|
|
7748
7754
|
iu as PayNextCheckout,
|
|
7749
7755
|
x as PaymentMethod
|
|
7750
7756
|
};
|