@fluid-app/fluid-cli-theme-dev 0.1.191 → 0.1.192
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/dist-cli-preview/.vite/manifest.json +22 -22
- package/dist/dist-cli-preview/account-screens.js +1 -1
- package/dist/dist-cli-preview/chunks/{MediaScreen-BZmTCQ5F.js → MediaScreen-CYsikMQy.js} +1 -1
- package/dist/dist-cli-preview/chunks/{MemberShareablesScreen-5Gb2YLEm.js → MemberShareablesScreen-Lux3huz0.js} +1 -1
- package/dist/dist-cli-preview/chunks/{PlaylistsScreen-919LTAzI.js → PlaylistsScreen-u9ZKP99s.js} +1 -1
- package/dist/dist-cli-preview/chunks/{ProfileScreen-BJSDxDSU.js → ProfileScreen-DG3fPm_0.js} +1 -1
- package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-D3ueUfgp.js → SubscriptionsScreen-BwnIRFkg.js} +1 -1
- package/dist/dist-cli-preview/chunks/{cli-preview-Cy5IQPPb.js → cli-preview-CvjzvUpc.js} +5 -5
- package/dist/dist-cli-preview/chunks/{create-card-entry-container-uv8Tt84N.js → create-card-entry-container-DrhFmCjI.js} +930 -929
- package/dist/dist-cli-preview/chunks/{mount-account-screen-CbwrlbeV.js → mount-account-screen-BDyS_u1e.js} +2 -2
- package/dist/dist-cli-preview/chunks/{navigate-account-screen-kiBsVQYA.js → navigate-account-screen-Pu5Aev5R.js} +1 -1
- package/package.json +1 -1
|
@@ -118,7 +118,7 @@ var Jr = "ScrollArea", [w1] = Hs(Jr), [d2, ke] = w1(Jr), $1 = m.forwardRef(
|
|
|
118
118
|
dir: a,
|
|
119
119
|
scrollHideDelay: s = 600,
|
|
120
120
|
...o
|
|
121
|
-
} = e, [d, c] = m.useState(null), [u,
|
|
121
|
+
} = e, [d, c] = m.useState(null), [u, p] = m.useState(null), [h, v] = m.useState(null), [_, b] = m.useState(null), [f, y] = m.useState(null), [E, w] = m.useState(0), [z, j] = m.useState(0), [$, C] = m.useState(!1), [F, P] = m.useState(!1), k = St(n, (L) => c(L)), D = As(a);
|
|
122
122
|
return /* @__PURE__ */ i.jsx(
|
|
123
123
|
d2,
|
|
124
124
|
{
|
|
@@ -128,14 +128,14 @@ var Jr = "ScrollArea", [w1] = Hs(Jr), [d2, ke] = w1(Jr), $1 = m.forwardRef(
|
|
|
128
128
|
scrollHideDelay: s,
|
|
129
129
|
scrollArea: d,
|
|
130
130
|
viewport: u,
|
|
131
|
-
onViewportChange:
|
|
131
|
+
onViewportChange: p,
|
|
132
132
|
content: h,
|
|
133
|
-
onContentChange:
|
|
134
|
-
scrollbarX:
|
|
135
|
-
onScrollbarXChange:
|
|
133
|
+
onContentChange: v,
|
|
134
|
+
scrollbarX: _,
|
|
135
|
+
onScrollbarXChange: b,
|
|
136
136
|
scrollbarXEnabled: $,
|
|
137
137
|
onScrollbarXEnabledChange: C,
|
|
138
|
-
scrollbarY:
|
|
138
|
+
scrollbarY: f,
|
|
139
139
|
onScrollbarYChange: y,
|
|
140
140
|
scrollbarYEnabled: F,
|
|
141
141
|
onScrollbarYEnabledChange: P,
|
|
@@ -220,11 +220,11 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
220
220
|
if (d) {
|
|
221
221
|
const u = () => {
|
|
222
222
|
window.clearTimeout(c), o(!0);
|
|
223
|
-
},
|
|
223
|
+
}, p = () => {
|
|
224
224
|
c = window.setTimeout(() => o(!1), a.scrollHideDelay);
|
|
225
225
|
};
|
|
226
|
-
return d.addEventListener("pointerenter", u), d.addEventListener("pointerleave",
|
|
227
|
-
window.clearTimeout(c), d.removeEventListener("pointerenter", u), d.removeEventListener("pointerleave",
|
|
226
|
+
return d.addEventListener("pointerenter", u), d.addEventListener("pointerleave", p), () => {
|
|
227
|
+
window.clearTimeout(c), d.removeEventListener("pointerenter", u), d.removeEventListener("pointerleave", p);
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
}, [a.scrollArea, a.scrollHideDelay]), /* @__PURE__ */ i.jsx(Ln, { present: t || s, children: /* @__PURE__ */ i.jsx(
|
|
@@ -260,14 +260,14 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
260
260
|
return () => window.clearTimeout(u);
|
|
261
261
|
}
|
|
262
262
|
}, [d, a.scrollHideDelay, c]), m.useEffect(() => {
|
|
263
|
-
const u = a.viewport,
|
|
263
|
+
const u = a.viewport, p = s ? "scrollLeft" : "scrollTop";
|
|
264
264
|
if (u) {
|
|
265
|
-
let h = u[
|
|
266
|
-
const
|
|
267
|
-
const
|
|
268
|
-
h !==
|
|
265
|
+
let h = u[p];
|
|
266
|
+
const v = () => {
|
|
267
|
+
const _ = u[p];
|
|
268
|
+
h !== _ && (c("SCROLL"), o()), h = _;
|
|
269
269
|
};
|
|
270
|
-
return u.addEventListener("scroll",
|
|
270
|
+
return u.addEventListener("scroll", v), () => u.removeEventListener("scroll", v);
|
|
271
271
|
}
|
|
272
272
|
}, [a.viewport, s, c, o]), /* @__PURE__ */ i.jsx(Ln, { present: t || d !== "hidden", children: /* @__PURE__ */ i.jsx(
|
|
273
273
|
el,
|
|
@@ -282,8 +282,8 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
282
282
|
}), M1 = m.forwardRef((e, n) => {
|
|
283
283
|
const t = ke(Ke, e.__scopeScrollArea), { forceMount: r, ...a } = e, [s, o] = m.useState(!1), d = e.orientation === "horizontal", c = Wn(() => {
|
|
284
284
|
if (t.viewport) {
|
|
285
|
-
const u = t.viewport.offsetWidth < t.viewport.scrollWidth,
|
|
286
|
-
o(d ? u :
|
|
285
|
+
const u = t.viewport.offsetWidth < t.viewport.scrollWidth, p = t.viewport.offsetHeight < t.viewport.scrollHeight;
|
|
286
|
+
o(d ? u : p);
|
|
287
287
|
}
|
|
288
288
|
}, 10);
|
|
289
289
|
return zt(t.viewport, c), zt(t.content, c), /* @__PURE__ */ i.jsx(Ln, { present: r || s, children: /* @__PURE__ */ i.jsx(
|
|
@@ -299,52 +299,52 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
299
299
|
content: 0,
|
|
300
300
|
viewport: 0,
|
|
301
301
|
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
302
|
-
}), u = A1(d.viewport, d.content),
|
|
302
|
+
}), u = A1(d.viewport, d.content), p = {
|
|
303
303
|
...r,
|
|
304
304
|
sizes: d,
|
|
305
305
|
onSizesChange: c,
|
|
306
306
|
hasThumb: u > 0 && u < 1,
|
|
307
|
-
onThumbChange: (
|
|
307
|
+
onThumbChange: (v) => s.current = v,
|
|
308
308
|
onThumbPointerUp: () => o.current = 0,
|
|
309
|
-
onThumbPointerDown: (
|
|
309
|
+
onThumbPointerDown: (v) => o.current = v
|
|
310
310
|
};
|
|
311
|
-
function h(
|
|
312
|
-
return g2(
|
|
311
|
+
function h(v, _) {
|
|
312
|
+
return g2(v, o.current, d, _);
|
|
313
313
|
}
|
|
314
314
|
return t === "horizontal" ? /* @__PURE__ */ i.jsx(
|
|
315
315
|
m2,
|
|
316
316
|
{
|
|
317
|
-
...
|
|
317
|
+
...p,
|
|
318
318
|
ref: n,
|
|
319
319
|
onThumbPositionChange: () => {
|
|
320
320
|
if (a.viewport && s.current) {
|
|
321
|
-
const
|
|
322
|
-
s.current.style.transform = `translate3d(${
|
|
321
|
+
const v = a.viewport.scrollLeft, _ = Ml(v, d, a.dir);
|
|
322
|
+
s.current.style.transform = `translate3d(${_}px, 0, 0)`;
|
|
323
323
|
}
|
|
324
324
|
},
|
|
325
|
-
onWheelScroll: (
|
|
326
|
-
a.viewport && (a.viewport.scrollLeft =
|
|
325
|
+
onWheelScroll: (v) => {
|
|
326
|
+
a.viewport && (a.viewport.scrollLeft = v);
|
|
327
327
|
},
|
|
328
|
-
onDragScroll: (
|
|
329
|
-
a.viewport && (a.viewport.scrollLeft = h(
|
|
328
|
+
onDragScroll: (v) => {
|
|
329
|
+
a.viewport && (a.viewport.scrollLeft = h(v, a.dir));
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
) : t === "vertical" ? /* @__PURE__ */ i.jsx(
|
|
333
333
|
h2,
|
|
334
334
|
{
|
|
335
|
-
...
|
|
335
|
+
...p,
|
|
336
336
|
ref: n,
|
|
337
337
|
onThumbPositionChange: () => {
|
|
338
338
|
if (a.viewport && s.current) {
|
|
339
|
-
const
|
|
340
|
-
s.current.style.transform = `translate3d(0, ${
|
|
339
|
+
const v = a.viewport.scrollTop, _ = Ml(v, d);
|
|
340
|
+
s.current.style.transform = `translate3d(0, ${_}px, 0)`;
|
|
341
341
|
}
|
|
342
342
|
},
|
|
343
|
-
onWheelScroll: (
|
|
344
|
-
a.viewport && (a.viewport.scrollTop =
|
|
343
|
+
onWheelScroll: (v) => {
|
|
344
|
+
a.viewport && (a.viewport.scrollTop = v);
|
|
345
345
|
},
|
|
346
|
-
onDragScroll: (
|
|
347
|
-
a.viewport && (a.viewport.scrollTop = h(
|
|
346
|
+
onDragScroll: (v) => {
|
|
347
|
+
a.viewport && (a.viewport.scrollTop = h(v));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
) : null;
|
|
@@ -366,12 +366,12 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
366
366
|
"--radix-scroll-area-thumb-width": Gn(t) + "px",
|
|
367
367
|
...e.style
|
|
368
368
|
},
|
|
369
|
-
onThumbPointerDown: (
|
|
370
|
-
onDragScroll: (
|
|
371
|
-
onWheelScroll: (
|
|
369
|
+
onThumbPointerDown: (p) => e.onThumbPointerDown(p.x),
|
|
370
|
+
onDragScroll: (p) => e.onDragScroll(p.x),
|
|
371
|
+
onWheelScroll: (p, h) => {
|
|
372
372
|
if (s.viewport) {
|
|
373
|
-
const
|
|
374
|
-
e.onWheelScroll(
|
|
373
|
+
const v = s.viewport.scrollLeft + p.deltaX;
|
|
374
|
+
e.onWheelScroll(v), D1(v, h) && p.preventDefault();
|
|
375
375
|
}
|
|
376
376
|
},
|
|
377
377
|
onResize: () => {
|
|
@@ -406,12 +406,12 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
406
406
|
"--radix-scroll-area-thumb-height": Gn(t) + "px",
|
|
407
407
|
...e.style
|
|
408
408
|
},
|
|
409
|
-
onThumbPointerDown: (
|
|
410
|
-
onDragScroll: (
|
|
411
|
-
onWheelScroll: (
|
|
409
|
+
onThumbPointerDown: (p) => e.onThumbPointerDown(p.y),
|
|
410
|
+
onDragScroll: (p) => e.onDragScroll(p.y),
|
|
411
|
+
onWheelScroll: (p, h) => {
|
|
412
412
|
if (s.viewport) {
|
|
413
|
-
const
|
|
414
|
-
e.onWheelScroll(
|
|
413
|
+
const v = s.viewport.scrollTop + p.deltaY;
|
|
414
|
+
e.onWheelScroll(v), D1(v, h) && p.preventDefault();
|
|
415
415
|
}
|
|
416
416
|
},
|
|
417
417
|
onResize: () => {
|
|
@@ -437,10 +437,10 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
437
437
|
onThumbPointerDown: d,
|
|
438
438
|
onThumbPositionChange: c,
|
|
439
439
|
onDragScroll: u,
|
|
440
|
-
onWheelScroll:
|
|
440
|
+
onWheelScroll: p,
|
|
441
441
|
onResize: h,
|
|
442
|
-
...
|
|
443
|
-
} = e,
|
|
442
|
+
...v
|
|
443
|
+
} = e, _ = ke(Ke, t), [b, f] = m.useState(null), y = St(n, (k) => f(k)), E = m.useRef(null), w = m.useRef(""), z = _.viewport, j = r.content - r.viewport, $ = it(p), C = it(c), F = Wn(h, 10);
|
|
444
444
|
function P(k) {
|
|
445
445
|
if (E.current) {
|
|
446
446
|
const D = k.clientX - E.current.left, L = k.clientY - E.current.top;
|
|
@@ -450,14 +450,14 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
450
450
|
return m.useEffect(() => {
|
|
451
451
|
const k = (D) => {
|
|
452
452
|
const L = D.target;
|
|
453
|
-
|
|
453
|
+
b?.contains(L) && $(D, j);
|
|
454
454
|
};
|
|
455
455
|
return document.addEventListener("wheel", k, { passive: !1 }), () => document.removeEventListener("wheel", k, { passive: !1 });
|
|
456
|
-
}, [z,
|
|
456
|
+
}, [z, b, j, $]), m.useEffect(C, [r, C]), zt(b, F), zt(_.content, F), /* @__PURE__ */ i.jsx(
|
|
457
457
|
f2,
|
|
458
458
|
{
|
|
459
459
|
scope: t,
|
|
460
|
-
scrollbar:
|
|
460
|
+
scrollbar: b,
|
|
461
461
|
hasThumb: a,
|
|
462
462
|
onThumbChange: it(s),
|
|
463
463
|
onThumbPointerUp: it(o),
|
|
@@ -466,16 +466,16 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
466
466
|
children: /* @__PURE__ */ i.jsx(
|
|
467
467
|
Jt.div,
|
|
468
468
|
{
|
|
469
|
-
...
|
|
469
|
+
...v,
|
|
470
470
|
ref: y,
|
|
471
|
-
style: { position: "absolute", ...
|
|
471
|
+
style: { position: "absolute", ...v.style },
|
|
472
472
|
onPointerDown: ot(e.onPointerDown, (k) => {
|
|
473
|
-
k.button === 0 && (k.target.setPointerCapture(k.pointerId), E.current =
|
|
473
|
+
k.button === 0 && (k.target.setPointerCapture(k.pointerId), E.current = b.getBoundingClientRect(), w.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", _.viewport && (_.viewport.style.scrollBehavior = "auto"), P(k));
|
|
474
474
|
}),
|
|
475
475
|
onPointerMove: ot(e.onPointerMove, P),
|
|
476
476
|
onPointerUp: ot(e.onPointerUp, (k) => {
|
|
477
477
|
const D = k.target;
|
|
478
|
-
D.hasPointerCapture(k.pointerId) && D.releasePointerCapture(k.pointerId), document.body.style.webkitUserSelect = w.current,
|
|
478
|
+
D.hasPointerCapture(k.pointerId) && D.releasePointerCapture(k.pointerId), document.body.style.webkitUserSelect = w.current, _.viewport && (_.viewport.style.scrollBehavior = ""), E.current = null;
|
|
479
479
|
})
|
|
480
480
|
}
|
|
481
481
|
)
|
|
@@ -491,21 +491,21 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
491
491
|
const { __scopeScrollArea: t, style: r, ...a } = e, s = ke(bn, t), o = N1(bn, t), { onThumbPositionChange: d } = o, c = St(
|
|
492
492
|
n,
|
|
493
493
|
(h) => o.onThumbChange(h)
|
|
494
|
-
), u = m.useRef(void 0),
|
|
494
|
+
), u = m.useRef(void 0), p = Wn(() => {
|
|
495
495
|
u.current && (u.current(), u.current = void 0);
|
|
496
496
|
}, 100);
|
|
497
497
|
return m.useEffect(() => {
|
|
498
498
|
const h = s.viewport;
|
|
499
499
|
if (h) {
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
const
|
|
503
|
-
u.current =
|
|
500
|
+
const v = () => {
|
|
501
|
+
if (p(), !u.current) {
|
|
502
|
+
const _ = x2(h, d);
|
|
503
|
+
u.current = _, d();
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
|
-
return d(), h.addEventListener("scroll",
|
|
506
|
+
return d(), h.addEventListener("scroll", v), () => h.removeEventListener("scroll", v);
|
|
507
507
|
}
|
|
508
|
-
}, [s.viewport,
|
|
508
|
+
}, [s.viewport, p, d]), /* @__PURE__ */ i.jsx(
|
|
509
509
|
Jt.div,
|
|
510
510
|
{
|
|
511
511
|
"data-state": o.hasThumb ? "visible" : "hidden",
|
|
@@ -517,8 +517,8 @@ var c2 = m.forwardRef((e, n) => {
|
|
|
517
517
|
...r
|
|
518
518
|
},
|
|
519
519
|
onPointerDownCapture: ot(e.onPointerDownCapture, (h) => {
|
|
520
|
-
const
|
|
521
|
-
o.onThumbPointerDown({ x:
|
|
520
|
+
const _ = h.target.getBoundingClientRect(), b = h.clientX - _.left, f = h.clientY - _.top;
|
|
521
|
+
o.onThumbPointerDown({ x: b, y: f });
|
|
522
522
|
}),
|
|
523
523
|
onPointerUp: ot(e.onPointerUp, o.onThumbPointerUp)
|
|
524
524
|
}
|
|
@@ -536,11 +536,11 @@ j1.displayName = tl;
|
|
|
536
536
|
var v2 = m.forwardRef((e, n) => {
|
|
537
537
|
const { __scopeScrollArea: t, ...r } = e, a = ke(tl, t), [s, o] = m.useState(0), [d, c] = m.useState(0), u = !!(s && d);
|
|
538
538
|
return zt(a.scrollbarX, () => {
|
|
539
|
-
const
|
|
540
|
-
a.onCornerHeightChange(
|
|
539
|
+
const p = a.scrollbarX?.offsetHeight || 0;
|
|
540
|
+
a.onCornerHeightChange(p), c(p);
|
|
541
541
|
}), zt(a.scrollbarY, () => {
|
|
542
|
-
const
|
|
543
|
-
a.onCornerWidthChange(
|
|
542
|
+
const p = a.scrollbarY?.offsetWidth || 0;
|
|
543
|
+
a.onCornerWidthChange(p), o(p);
|
|
544
544
|
}), u ? /* @__PURE__ */ i.jsx(
|
|
545
545
|
Jt.div,
|
|
546
546
|
{
|
|
@@ -570,7 +570,7 @@ function Gn(e) {
|
|
|
570
570
|
return Math.max(r, 18);
|
|
571
571
|
}
|
|
572
572
|
function g2(e, n, t, r = "ltr") {
|
|
573
|
-
const a = Gn(t), s = a / 2, o = n || s, d = a - o, c = t.scrollbar.paddingStart + o, u = t.scrollbar.size - t.scrollbar.paddingEnd - d,
|
|
573
|
+
const a = Gn(t), s = a / 2, o = n || s, d = a - o, c = t.scrollbar.paddingStart + o, u = t.scrollbar.size - t.scrollbar.paddingEnd - d, p = t.content - t.viewport, h = r === "ltr" ? [0, p] : [p * -1, 0];
|
|
574
574
|
return H1([c, u], h)(e);
|
|
575
575
|
}
|
|
576
576
|
function Ml(e, n, t = "ltr") {
|
|
@@ -1436,8 +1436,8 @@ class q2 extends re {
|
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
function rl(e, n, t) {
|
|
1439
|
-
const r = Ya(), a = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = ct(e, t?.in), o = s.getDay(), c = (n % 7 + 7) % 7, u = 7 - a,
|
|
1440
|
-
return en(s,
|
|
1439
|
+
const r = Ya(), a = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = ct(e, t?.in), o = s.getDay(), c = (n % 7 + 7) % 7, u = 7 - a, p = n < 0 || n > 6 ? n - (o + u) % 7 : (c + u) % 7 - (o + u) % 7;
|
|
1440
|
+
return en(s, p, t);
|
|
1441
1441
|
}
|
|
1442
1442
|
class G2 extends re {
|
|
1443
1443
|
constructor() {
|
|
@@ -2137,32 +2137,32 @@ function xd(e, n, t, r) {
|
|
|
2137
2137
|
firstWeekContainsDate: d,
|
|
2138
2138
|
weekStartsOn: c,
|
|
2139
2139
|
locale: o
|
|
2140
|
-
},
|
|
2140
|
+
}, p = [new M2(r?.in, t)], h = n.match(hd).map((y) => {
|
|
2141
2141
|
const E = y[0];
|
|
2142
2142
|
if (E in _l) {
|
|
2143
2143
|
const w = _l[E];
|
|
2144
2144
|
return w(y, o.formatLong);
|
|
2145
2145
|
}
|
|
2146
2146
|
return y;
|
|
2147
|
-
}).join("").match(md),
|
|
2147
|
+
}).join("").match(md), v = [];
|
|
2148
2148
|
for (let y of h) {
|
|
2149
2149
|
Us(y) && El(y, n, e), qs(y) && El(y, n, e);
|
|
2150
2150
|
const E = y[0], w = ud[E];
|
|
2151
2151
|
if (w) {
|
|
2152
2152
|
const { incompatibleTokens: z } = w;
|
|
2153
2153
|
if (Array.isArray(z)) {
|
|
2154
|
-
const $ =
|
|
2154
|
+
const $ = v.find(
|
|
2155
2155
|
(C) => z.includes(C.token) || C.token === E
|
|
2156
2156
|
);
|
|
2157
2157
|
if ($)
|
|
2158
2158
|
throw new RangeError(
|
|
2159
2159
|
`The format string mustn't contain \`${$.fullToken}\` and \`${y}\` at the same time`
|
|
2160
2160
|
);
|
|
2161
|
-
} else if (w.incompatibleTokens === "*" &&
|
|
2161
|
+
} else if (w.incompatibleTokens === "*" && v.length > 0)
|
|
2162
2162
|
throw new RangeError(
|
|
2163
2163
|
`The format string mustn't contain \`${y}\` and any other token at the same time`
|
|
2164
2164
|
);
|
|
2165
|
-
|
|
2165
|
+
v.push({ token: E, fullToken: y });
|
|
2166
2166
|
const j = w.run(
|
|
2167
2167
|
e,
|
|
2168
2168
|
y,
|
|
@@ -2171,7 +2171,7 @@ function xd(e, n, t, r) {
|
|
|
2171
2171
|
);
|
|
2172
2172
|
if (!j)
|
|
2173
2173
|
return a();
|
|
2174
|
-
|
|
2174
|
+
p.push(j.setter), e = j.rest;
|
|
2175
2175
|
} else {
|
|
2176
2176
|
if (E.match(gd))
|
|
2177
2177
|
throw new RangeError(
|
|
@@ -2185,19 +2185,19 @@ function xd(e, n, t, r) {
|
|
|
2185
2185
|
}
|
|
2186
2186
|
if (e.length > 0 && vd.test(e))
|
|
2187
2187
|
return a();
|
|
2188
|
-
const
|
|
2189
|
-
(y) =>
|
|
2188
|
+
const _ = p.map((y) => y.priority).sort((y, E) => E - y).filter((y, E, w) => w.indexOf(y) === E).map(
|
|
2189
|
+
(y) => p.filter((E) => E.priority === y).sort((E, w) => w.subPriority - E.subPriority)
|
|
2190
2190
|
).map((y) => y[0]);
|
|
2191
|
-
let
|
|
2192
|
-
if (isNaN(+
|
|
2193
|
-
const
|
|
2194
|
-
for (const y of
|
|
2195
|
-
if (!y.validate(
|
|
2191
|
+
let b = ct(t, r?.in);
|
|
2192
|
+
if (isNaN(+b)) return a();
|
|
2193
|
+
const f = {};
|
|
2194
|
+
for (const y of _) {
|
|
2195
|
+
if (!y.validate(b, u))
|
|
2196
2196
|
return a();
|
|
2197
|
-
const E = y.set(
|
|
2198
|
-
Array.isArray(E) ? (
|
|
2197
|
+
const E = y.set(b, f, u);
|
|
2198
|
+
Array.isArray(E) ? (b = E[0], Object.assign(f, E[1])) : b = E;
|
|
2199
2199
|
}
|
|
2200
|
-
return
|
|
2200
|
+
return b;
|
|
2201
2201
|
}
|
|
2202
2202
|
function yd(e) {
|
|
2203
2203
|
return e.match(fd)[1].replace(pd, "'");
|
|
@@ -2442,9 +2442,9 @@ function U1({
|
|
|
2442
2442
|
m.useEffect(() => {
|
|
2443
2443
|
d.current !== null && d.current.subscriptionToken !== e && (d.current = null, o(null));
|
|
2444
2444
|
}, [e]);
|
|
2445
|
-
const
|
|
2445
|
+
const p = m.useRef({ onSucceeded: n, onFailed: t, onTimedOut: r });
|
|
2446
2446
|
m.useEffect(() => {
|
|
2447
|
-
|
|
2447
|
+
p.current = { onSucceeded: n, onFailed: t, onTimedOut: r };
|
|
2448
2448
|
}, [n, t, r]);
|
|
2449
2449
|
const { data: h } = je({
|
|
2450
2450
|
queryKey: ee.detail(e),
|
|
@@ -2452,46 +2452,46 @@ function U1({
|
|
|
2452
2452
|
enabled: u?.phase === "pending",
|
|
2453
2453
|
refetchInterval: u?.phase === "pending" ? kd : !1,
|
|
2454
2454
|
refetchIntervalInBackground: !0
|
|
2455
|
-
}),
|
|
2455
|
+
}), v = h?.subscription.status, _ = h?.subscription.last_failed_at, b = m.useRef({
|
|
2456
2456
|
subscriptionToken: e,
|
|
2457
|
-
lastFailedAt:
|
|
2457
|
+
lastFailedAt: _ ?? null
|
|
2458
2458
|
});
|
|
2459
|
-
return
|
|
2459
|
+
return b.current = {
|
|
2460
2460
|
subscriptionToken: e,
|
|
2461
|
-
lastFailedAt:
|
|
2461
|
+
lastFailedAt: _ ?? null
|
|
2462
2462
|
}, m.useEffect(() => {
|
|
2463
|
-
if (u?.phase !== "pending" ||
|
|
2463
|
+
if (u?.phase !== "pending" || v === void 0)
|
|
2464
2464
|
return;
|
|
2465
|
-
const
|
|
2466
|
-
status:
|
|
2467
|
-
lastFailedAt:
|
|
2465
|
+
const f = Dd({
|
|
2466
|
+
status: v,
|
|
2467
|
+
lastFailedAt: _ ?? null,
|
|
2468
2468
|
baselineLastFailedAt: u.baselineLastFailedAt
|
|
2469
2469
|
});
|
|
2470
2470
|
if (c.current === u.subscriptionToken)
|
|
2471
|
-
if (
|
|
2472
|
-
d.current = null, o(null),
|
|
2473
|
-
else if (
|
|
2471
|
+
if (f === "succeeded")
|
|
2472
|
+
d.current = null, o(null), p.current.onSucceeded?.();
|
|
2473
|
+
else if (f === "failed") {
|
|
2474
2474
|
const y = {
|
|
2475
2475
|
...u,
|
|
2476
2476
|
phase: "failed"
|
|
2477
2477
|
};
|
|
2478
|
-
d.current = y, o(y),
|
|
2479
|
-
} else
|
|
2480
|
-
}, [u,
|
|
2478
|
+
d.current = y, o(y), p.current.onFailed?.();
|
|
2479
|
+
} else f === "ended" && (d.current = null, o(null));
|
|
2480
|
+
}, [u, v, _]), m.useEffect(() => {
|
|
2481
2481
|
if (u?.phase !== "pending") return;
|
|
2482
|
-
const
|
|
2482
|
+
const f = u.subscriptionToken, y = setTimeout(() => {
|
|
2483
2483
|
const E = Nl(
|
|
2484
2484
|
d.current,
|
|
2485
2485
|
c.current
|
|
2486
2486
|
);
|
|
2487
|
-
E?.subscriptionToken !==
|
|
2487
|
+
E?.subscriptionToken !== f || E.phase !== "pending" || (d.current = null, o(null), p.current.onTimedOut?.());
|
|
2488
2488
|
}, Td);
|
|
2489
2489
|
return () => clearTimeout(y);
|
|
2490
2490
|
}, [u]), {
|
|
2491
2491
|
start: () => {
|
|
2492
|
-
const
|
|
2493
|
-
|
|
2494
|
-
y.subscriptionToken ===
|
|
2492
|
+
const f = c.current, y = b.current, E = Ld(
|
|
2493
|
+
f,
|
|
2494
|
+
y.subscriptionToken === f ? y.lastFailedAt : null
|
|
2495
2495
|
);
|
|
2496
2496
|
d.current = E, o(E);
|
|
2497
2497
|
},
|
|
@@ -2863,11 +2863,11 @@ function Pl(e) {
|
|
|
2863
2863
|
const [, t, r, a, s, o, d] = n, c = n[8];
|
|
2864
2864
|
if (t == null || r == null || a == null || s == null || o == null || d == null || c == null)
|
|
2865
2865
|
return null;
|
|
2866
|
-
const u = Number(t),
|
|
2867
|
-
if (
|
|
2866
|
+
const u = Number(t), p = Number(r), h = Number(a), v = Number(s), _ = Number(o), b = Number(d);
|
|
2867
|
+
if (p < 1 || p > 12 || h < 1 || h > tc(u, p) || v > 23 || _ > 59 || b > 59 || !nc(c))
|
|
2868
2868
|
return null;
|
|
2869
|
-
const
|
|
2870
|
-
return Number.isNaN(
|
|
2869
|
+
const f = new Date(e);
|
|
2870
|
+
return Number.isNaN(f.getTime()) ? null : f;
|
|
2871
2871
|
}
|
|
2872
2872
|
function tc(e, n) {
|
|
2873
2873
|
return n === 2 ? e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0) ? 29 : 28 : [4, 6, 9, 11].includes(n) ? 30 : 31;
|
|
@@ -4039,13 +4039,13 @@ function Cc(e) {
|
|
|
4039
4039
|
}
|
|
4040
4040
|
function J1() {
|
|
4041
4041
|
const [e, n] = m.useState("US"), [t, r] = m.useState(lr), [a, s] = m.useState("US"), o = m.useRef(0), d = m.useCallback(
|
|
4042
|
-
(u,
|
|
4042
|
+
(u, p) => {
|
|
4043
4043
|
n(u);
|
|
4044
|
-
const h = ++o.current,
|
|
4045
|
-
|
|
4046
|
-
h === o.current && (r(
|
|
4047
|
-
}).catch((
|
|
4048
|
-
h === o.current && (console.error("Failed to fetch states:",
|
|
4044
|
+
const h = ++o.current, v = u === "US" ? lr : [];
|
|
4045
|
+
p ? (r(v), s(null), p(u).then((_) => {
|
|
4046
|
+
h === o.current && (r(_.length > 0 ? _ : v), s(u));
|
|
4047
|
+
}).catch((_) => {
|
|
4048
|
+
h === o.current && (console.error("Failed to fetch states:", _), r(v), s(u));
|
|
4049
4049
|
})) : (r(u === "US" ? lr : []), s(u));
|
|
4050
4050
|
},
|
|
4051
4051
|
[]
|
|
@@ -4069,7 +4069,7 @@ function ei({
|
|
|
4069
4069
|
disabled: d = !1,
|
|
4070
4070
|
presentation: c = "dialog"
|
|
4071
4071
|
}) {
|
|
4072
|
-
const { t: u } = lt(), [
|
|
4072
|
+
const { t: u } = lt(), [p, h] = m.useState(!1), v = r ?? u("edit"), _ = a ?? u("delete"), b = s ?? u("make_default"), f = o ?? v;
|
|
4073
4073
|
if (c === "bottom-sheet") {
|
|
4074
4074
|
const y = (E) => {
|
|
4075
4075
|
h(!1), E();
|
|
@@ -4080,7 +4080,7 @@ function ei({
|
|
|
4080
4080
|
{
|
|
4081
4081
|
variant: "ghost",
|
|
4082
4082
|
disabled: d,
|
|
4083
|
-
"aria-label":
|
|
4083
|
+
"aria-label": f,
|
|
4084
4084
|
onClick: () => h(!0),
|
|
4085
4085
|
children: /* @__PURE__ */ i.jsx($l, { className: "text-muted-foreground size-4" })
|
|
4086
4086
|
}
|
|
@@ -4088,9 +4088,9 @@ function ei({
|
|
|
4088
4088
|
/* @__PURE__ */ i.jsx(
|
|
4089
4089
|
Ur,
|
|
4090
4090
|
{
|
|
4091
|
-
open:
|
|
4091
|
+
open: p,
|
|
4092
4092
|
onOpenChange: h,
|
|
4093
|
-
title:
|
|
4093
|
+
title: f,
|
|
4094
4094
|
children: /* @__PURE__ */ i.jsxs("div", { className: "space-y-1 px-2", children: [
|
|
4095
4095
|
n && /* @__PURE__ */ i.jsxs(
|
|
4096
4096
|
Z,
|
|
@@ -4101,7 +4101,7 @@ function ei({
|
|
|
4101
4101
|
onClick: () => y(n),
|
|
4102
4102
|
children: [
|
|
4103
4103
|
/* @__PURE__ */ i.jsx(wl, { className: "size-4" }),
|
|
4104
|
-
|
|
4104
|
+
v
|
|
4105
4105
|
]
|
|
4106
4106
|
}
|
|
4107
4107
|
),
|
|
@@ -4114,7 +4114,7 @@ function ei({
|
|
|
4114
4114
|
onClick: () => y(t),
|
|
4115
4115
|
children: [
|
|
4116
4116
|
/* @__PURE__ */ i.jsx($t, { className: "size-4" }),
|
|
4117
|
-
|
|
4117
|
+
b
|
|
4118
4118
|
]
|
|
4119
4119
|
}
|
|
4120
4120
|
),
|
|
@@ -4127,7 +4127,7 @@ function ei({
|
|
|
4127
4127
|
onClick: () => y(e),
|
|
4128
4128
|
children: [
|
|
4129
4129
|
/* @__PURE__ */ i.jsx(yn, { className: "size-4" }),
|
|
4130
|
-
|
|
4130
|
+
_
|
|
4131
4131
|
]
|
|
4132
4132
|
}
|
|
4133
4133
|
)
|
|
@@ -4142,7 +4142,7 @@ function ei({
|
|
|
4142
4142
|
{
|
|
4143
4143
|
variant: "ghost",
|
|
4144
4144
|
disabled: d,
|
|
4145
|
-
"aria-label":
|
|
4145
|
+
"aria-label": f,
|
|
4146
4146
|
children: /* @__PURE__ */ i.jsx($l, { className: "text-muted-foreground size-4" })
|
|
4147
4147
|
}
|
|
4148
4148
|
) }),
|
|
@@ -4157,7 +4157,7 @@ function ei({
|
|
|
4157
4157
|
},
|
|
4158
4158
|
children: [
|
|
4159
4159
|
/* @__PURE__ */ i.jsx(wl, { className: "size-3.5 shrink-0" }),
|
|
4160
|
-
/* @__PURE__ */ i.jsx("span", { children:
|
|
4160
|
+
/* @__PURE__ */ i.jsx("span", { children: v })
|
|
4161
4161
|
]
|
|
4162
4162
|
}
|
|
4163
4163
|
),
|
|
@@ -4173,7 +4173,7 @@ function ei({
|
|
|
4173
4173
|
},
|
|
4174
4174
|
children: [
|
|
4175
4175
|
/* @__PURE__ */ i.jsx($t, { className: "size-3.5 shrink-0" }),
|
|
4176
|
-
/* @__PURE__ */ i.jsx("span", { children:
|
|
4176
|
+
/* @__PURE__ */ i.jsx("span", { children: b })
|
|
4177
4177
|
]
|
|
4178
4178
|
}
|
|
4179
4179
|
),
|
|
@@ -4188,7 +4188,7 @@ function ei({
|
|
|
4188
4188
|
},
|
|
4189
4189
|
children: [
|
|
4190
4190
|
/* @__PURE__ */ i.jsx(yn, { className: "size-3.5 shrink-0" }),
|
|
4191
|
-
/* @__PURE__ */ i.jsx("span", { children:
|
|
4191
|
+
/* @__PURE__ */ i.jsx("span", { children: _ })
|
|
4192
4192
|
]
|
|
4193
4193
|
}
|
|
4194
4194
|
)
|
|
@@ -4206,7 +4206,7 @@ function ti({
|
|
|
4206
4206
|
actionText: d,
|
|
4207
4207
|
presentation: c = "dialog"
|
|
4208
4208
|
}) {
|
|
4209
|
-
const { t: u } = lt(),
|
|
4209
|
+
const { t: u } = lt(), p = d ?? u("delete");
|
|
4210
4210
|
return /* @__PURE__ */ i.jsxs(
|
|
4211
4211
|
Ve,
|
|
4212
4212
|
{
|
|
@@ -4236,7 +4236,7 @@ function ti({
|
|
|
4236
4236
|
className: "min-w-[70px]",
|
|
4237
4237
|
onClick: t,
|
|
4238
4238
|
disabled: o,
|
|
4239
|
-
children: o ? /* @__PURE__ */ i.jsx("div", { className: "border-primary-foreground size-5 animate-spin rounded-full border-4 border-t-4 border-t-transparent" }) :
|
|
4239
|
+
children: o ? /* @__PURE__ */ i.jsx("div", { className: "border-primary-foreground size-5 animate-spin rounded-full border-4 border-t-4 border-t-transparent" }) : p
|
|
4240
4240
|
}
|
|
4241
4241
|
)
|
|
4242
4242
|
] }) })
|
|
@@ -4450,13 +4450,13 @@ function li({
|
|
|
4450
4450
|
stateOptions: d = Dc,
|
|
4451
4451
|
id: c,
|
|
4452
4452
|
label: u,
|
|
4453
|
-
placeholder:
|
|
4453
|
+
placeholder: p,
|
|
4454
4454
|
disabled: h,
|
|
4455
|
-
inputClassName:
|
|
4455
|
+
inputClassName: v
|
|
4456
4456
|
}) {
|
|
4457
|
-
const
|
|
4458
|
-
field:
|
|
4459
|
-
fieldState: { error:
|
|
4457
|
+
const _ = Nc(), {
|
|
4458
|
+
field: b,
|
|
4459
|
+
fieldState: { error: f }
|
|
4460
4460
|
} = tn({ name: r, control: e }), [y, E] = m.useState(
|
|
4461
4461
|
[]
|
|
4462
4462
|
), [w, z] = m.useState(!1), [j, $] = m.useState(!1), C = m.useRef(null), F = m.useRef(0), P = m.useRef(null), k = m.useMemo(
|
|
@@ -4476,10 +4476,10 @@ function li({
|
|
|
4476
4476
|
), m.useEffect(() => {
|
|
4477
4477
|
P.current !== null && (clearTimeout(P.current), P.current = null), F.current += 1, E([]), z(!1), $(!1);
|
|
4478
4478
|
}, [t]), m.useEffect(() => {
|
|
4479
|
-
|
|
4479
|
+
_ || console.warn(
|
|
4480
4480
|
"AddressAutocompleteInput: no AddressAutocompleteApiProvider found — address suggestions are disabled."
|
|
4481
4481
|
);
|
|
4482
|
-
}, [
|
|
4482
|
+
}, [_]);
|
|
4483
4483
|
const L = m.useCallback(
|
|
4484
4484
|
(T) => {
|
|
4485
4485
|
n(
|
|
@@ -4507,7 +4507,7 @@ function li({
|
|
|
4507
4507
|
), S = m.useCallback(
|
|
4508
4508
|
(T) => {
|
|
4509
4509
|
const B = T.target.value;
|
|
4510
|
-
if (
|
|
4510
|
+
if (b.onChange(B), !_) return;
|
|
4511
4511
|
if (P.current !== null && (clearTimeout(P.current), P.current = null), B.length < 1) {
|
|
4512
4512
|
z(!1), $(!1), E([]);
|
|
4513
4513
|
return;
|
|
@@ -4519,12 +4519,12 @@ function li({
|
|
|
4519
4519
|
$(!1);
|
|
4520
4520
|
const Y = ++F.current;
|
|
4521
4521
|
P.current = setTimeout(() => {
|
|
4522
|
-
P.current = null,
|
|
4522
|
+
P.current = null, _.fetchSuggestions({ query: B, countryIso: t }).then((W) => {
|
|
4523
4523
|
Y === F.current && (E(W), z(!0));
|
|
4524
4524
|
});
|
|
4525
4525
|
}, Hc);
|
|
4526
4526
|
},
|
|
4527
|
-
[
|
|
4527
|
+
[_, t, b, k]
|
|
4528
4528
|
), V = m.useCallback(
|
|
4529
4529
|
async (T) => {
|
|
4530
4530
|
P.current !== null && (clearTimeout(P.current), P.current = null);
|
|
@@ -4538,8 +4538,8 @@ function li({
|
|
|
4538
4538
|
}), z(!1);
|
|
4539
4539
|
return;
|
|
4540
4540
|
}
|
|
4541
|
-
if (!
|
|
4542
|
-
const { details: Y, drilldownSuggestions: W } = await
|
|
4541
|
+
if (!_) return;
|
|
4542
|
+
const { details: Y, drilldownSuggestions: W } = await _.fetchDetails({
|
|
4543
4543
|
suggestion: T,
|
|
4544
4544
|
countryIso: t
|
|
4545
4545
|
});
|
|
@@ -4551,7 +4551,7 @@ function li({
|
|
|
4551
4551
|
E(W), z(!0);
|
|
4552
4552
|
}
|
|
4553
4553
|
},
|
|
4554
|
-
[
|
|
4554
|
+
[_, t, L]
|
|
4555
4555
|
);
|
|
4556
4556
|
return /* @__PURE__ */ i.jsxs("div", { className: "space-y-1", children: [
|
|
4557
4557
|
u && /* @__PURE__ */ i.jsx($e, { htmlFor: D, className: "mb-1.5 block text-sm font-medium", children: u }),
|
|
@@ -4560,15 +4560,15 @@ function li({
|
|
|
4560
4560
|
nn,
|
|
4561
4561
|
{
|
|
4562
4562
|
id: D,
|
|
4563
|
-
className:
|
|
4563
|
+
className: v,
|
|
4564
4564
|
type: "text",
|
|
4565
|
-
ref:
|
|
4566
|
-
value:
|
|
4565
|
+
ref: b.ref,
|
|
4566
|
+
value: b.value ?? "",
|
|
4567
4567
|
onChange: S,
|
|
4568
|
-
onBlur:
|
|
4569
|
-
placeholder:
|
|
4568
|
+
onBlur: b.onBlur,
|
|
4569
|
+
placeholder: p,
|
|
4570
4570
|
disabled: h,
|
|
4571
|
-
"aria-invalid": !!
|
|
4571
|
+
"aria-invalid": !!f
|
|
4572
4572
|
}
|
|
4573
4573
|
),
|
|
4574
4574
|
w && j && /* @__PURE__ */ i.jsx("div", { className: "bg-muted text-foreground absolute z-50 mt-1 w-full rounded-md px-3 py-2 text-sm shadow-lg", children: "Please select a country first to enable address suggestions" }),
|
|
@@ -4590,7 +4590,7 @@ function li({
|
|
|
4590
4590
|
T.id
|
|
4591
4591
|
)) })
|
|
4592
4592
|
] }),
|
|
4593
|
-
|
|
4593
|
+
f?.message && /* @__PURE__ */ i.jsx("p", { className: "text-destructive text-sm", children: f.message })
|
|
4594
4594
|
] });
|
|
4595
4595
|
}
|
|
4596
4596
|
const ai = m.createContext(null);
|
|
@@ -4718,21 +4718,21 @@ function Rc({
|
|
|
4718
4718
|
countries: d = [],
|
|
4719
4719
|
fetchStates: c,
|
|
4720
4720
|
languageIso: u,
|
|
4721
|
-
onDelete:
|
|
4721
|
+
onDelete: p,
|
|
4722
4722
|
isDeleting: h = !1,
|
|
4723
|
-
presentation:
|
|
4723
|
+
presentation: v = "dialog"
|
|
4724
4724
|
}) {
|
|
4725
|
-
const { t:
|
|
4725
|
+
const { t: _ } = lt(), [b, f] = m.useState(!1);
|
|
4726
4726
|
m.useEffect(() => {
|
|
4727
|
-
e ||
|
|
4727
|
+
e || f(!1);
|
|
4728
4728
|
}, [e]), m.useEffect(() => {
|
|
4729
|
-
if (!
|
|
4730
|
-
const q = setTimeout(() =>
|
|
4729
|
+
if (!b) return;
|
|
4730
|
+
const q = setTimeout(() => f(!1), 3e3);
|
|
4731
4731
|
return () => clearTimeout(q);
|
|
4732
|
-
}, [
|
|
4732
|
+
}, [b]);
|
|
4733
4733
|
const y = m.useMemo(
|
|
4734
|
-
() => Oc((q) =>
|
|
4735
|
-
[
|
|
4734
|
+
() => Oc((q) => _(q)),
|
|
4735
|
+
[_]
|
|
4736
4736
|
), { control: E, handleSubmit: w, reset: z, setValue: j, setError: $, clearErrors: C } = Zr(y, {
|
|
4737
4737
|
defaultValues: {
|
|
4738
4738
|
billing_address: {
|
|
@@ -4807,7 +4807,7 @@ function Rc({
|
|
|
4807
4807
|
regionKey: D?.regionLabel,
|
|
4808
4808
|
postalKey: D?.postalLabel
|
|
4809
4809
|
});
|
|
4810
|
-
return R.label ??
|
|
4810
|
+
return R.label ?? _(R.translationKey ?? q);
|
|
4811
4811
|
}, ge = {
|
|
4812
4812
|
name: "name_is_required",
|
|
4813
4813
|
address1: "address_line_1_is_required",
|
|
@@ -4824,15 +4824,15 @@ function Rc({
|
|
|
4824
4824
|
const A = ge[X];
|
|
4825
4825
|
A && $(Ll(X), {
|
|
4826
4826
|
type: "manual",
|
|
4827
|
-
message:
|
|
4827
|
+
message: _(A)
|
|
4828
4828
|
});
|
|
4829
4829
|
}
|
|
4830
4830
|
return;
|
|
4831
4831
|
}
|
|
4832
4832
|
a(q);
|
|
4833
|
-
}), Ne = m.useMemo(() =>
|
|
4833
|
+
}), Ne = m.useMemo(() => _(h ? "deleting" : b ? "tap_to_confirm" : "delete_card"), [h, b, _]);
|
|
4834
4834
|
if (!n) return null;
|
|
4835
|
-
const { details: ze } = n, Fe = gt(n,
|
|
4835
|
+
const { details: ze } = n, Fe = gt(n, _("card_fallback")), De = ze.exp_month, Ce = ze.exp_year, Pe = (q) => {
|
|
4836
4836
|
const R = G(q);
|
|
4837
4837
|
return q === "address1" ? /* @__PURE__ */ i.jsx(
|
|
4838
4838
|
li,
|
|
@@ -4856,7 +4856,7 @@ function Rc({
|
|
|
4856
4856
|
name: "billing_address.state",
|
|
4857
4857
|
label: R,
|
|
4858
4858
|
options: V,
|
|
4859
|
-
placeholder:
|
|
4859
|
+
placeholder: _("select_state")
|
|
4860
4860
|
},
|
|
4861
4861
|
q
|
|
4862
4862
|
) : /* @__PURE__ */ i.jsx(
|
|
@@ -4874,8 +4874,8 @@ function Rc({
|
|
|
4874
4874
|
{
|
|
4875
4875
|
open: e,
|
|
4876
4876
|
onOpenChange: (q) => !q && r(),
|
|
4877
|
-
title:
|
|
4878
|
-
presentation:
|
|
4877
|
+
title: _("edit_card"),
|
|
4878
|
+
presentation: v,
|
|
4879
4879
|
children: [
|
|
4880
4880
|
/* @__PURE__ */ i.jsxs("div", { className: "space-y-4", children: [
|
|
4881
4881
|
/* @__PURE__ */ i.jsx("div", { className: "bg-muted rounded-lg p-4", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
@@ -4890,7 +4890,7 @@ function Rc({
|
|
|
4890
4890
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-col", children: [
|
|
4891
4891
|
/* @__PURE__ */ i.jsx("span", { className: "text-foreground text-sm font-medium", children: Fe }),
|
|
4892
4892
|
De != null && Ce != null && /* @__PURE__ */ i.jsxs("span", { className: "text-muted-foreground text-sm", children: [
|
|
4893
|
-
|
|
4893
|
+
_("card_expires"),
|
|
4894
4894
|
" ",
|
|
4895
4895
|
De,
|
|
4896
4896
|
"/",
|
|
@@ -4899,16 +4899,16 @@ function Rc({
|
|
|
4899
4899
|
] })
|
|
4900
4900
|
] }) }),
|
|
4901
4901
|
/* @__PURE__ */ i.jsxs("div", { children: [
|
|
4902
|
-
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground mb-3 text-sm font-medium", children:
|
|
4902
|
+
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground mb-3 text-sm font-medium", children: _("billing_address") }),
|
|
4903
4903
|
/* @__PURE__ */ i.jsxs("div", { className: "space-y-3", children: [
|
|
4904
4904
|
/* @__PURE__ */ i.jsx(
|
|
4905
4905
|
Hl,
|
|
4906
4906
|
{
|
|
4907
4907
|
control: E,
|
|
4908
4908
|
name: "billing_address.country_code",
|
|
4909
|
-
label:
|
|
4909
|
+
label: _("country"),
|
|
4910
4910
|
options: S,
|
|
4911
|
-
placeholder:
|
|
4911
|
+
placeholder: _("select_an_option"),
|
|
4912
4912
|
onChange: () => {
|
|
4913
4913
|
B.current = !0, j("billing_address.state", ""), C("billing_address.state");
|
|
4914
4914
|
}
|
|
@@ -4942,19 +4942,19 @@ function Rc({
|
|
|
4942
4942
|
onCheckedChange: (R) => q.onChange(R === !0)
|
|
4943
4943
|
}
|
|
4944
4944
|
),
|
|
4945
|
-
/* @__PURE__ */ i.jsx($e, { htmlFor: "set_as_default", className: "text-sm font-normal", children:
|
|
4945
|
+
/* @__PURE__ */ i.jsx($e, { htmlFor: "set_as_default", className: "text-sm font-normal", children: _("set_as_default_payment_method") })
|
|
4946
4946
|
] })
|
|
4947
4947
|
}
|
|
4948
4948
|
),
|
|
4949
4949
|
o && /* @__PURE__ */ i.jsx("div", { className: "text-destructive text-sm", children: o }),
|
|
4950
4950
|
/* @__PURE__ */ i.jsxs(tt, { className: "flex flex-row items-center justify-between gap-2", children: [
|
|
4951
|
-
|
|
4951
|
+
p ? /* @__PURE__ */ i.jsxs(
|
|
4952
4952
|
Z,
|
|
4953
4953
|
{
|
|
4954
4954
|
type: "button",
|
|
4955
4955
|
variant: "ghost",
|
|
4956
4956
|
onClick: () => {
|
|
4957
|
-
|
|
4957
|
+
b ? p() : f(!0);
|
|
4958
4958
|
},
|
|
4959
4959
|
disabled: s || h,
|
|
4960
4960
|
className: "text-destructive hover:bg-destructive/10 hover:text-destructive",
|
|
@@ -4972,7 +4972,7 @@ function Rc({
|
|
|
4972
4972
|
variant: "secondary",
|
|
4973
4973
|
onClick: r,
|
|
4974
4974
|
disabled: s || h,
|
|
4975
|
-
children:
|
|
4975
|
+
children: _("cancel")
|
|
4976
4976
|
}
|
|
4977
4977
|
),
|
|
4978
4978
|
/* @__PURE__ */ i.jsxs(
|
|
@@ -4983,7 +4983,7 @@ function Rc({
|
|
|
4983
4983
|
disabled: s || h || !J,
|
|
4984
4984
|
children: [
|
|
4985
4985
|
s && /* @__PURE__ */ i.jsx("div", { className: "mr-2 size-4 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
|
|
4986
|
-
|
|
4986
|
+
_(s ? "saving" : "save_changes")
|
|
4987
4987
|
]
|
|
4988
4988
|
}
|
|
4989
4989
|
)
|
|
@@ -5023,7 +5023,7 @@ function Uc({
|
|
|
5023
5023
|
}) {
|
|
5024
5024
|
const {
|
|
5025
5025
|
field: u,
|
|
5026
|
-
fieldState: { error:
|
|
5026
|
+
fieldState: { error: p }
|
|
5027
5027
|
} = tn({ name: n, control: e });
|
|
5028
5028
|
return /* @__PURE__ */ i.jsxs("div", { className: ne("space-y-1", a), children: [
|
|
5029
5029
|
t && /* @__PURE__ */ i.jsx($e, { htmlFor: n, className: "mb-1.5 block text-sm font-medium", children: t }),
|
|
@@ -5038,10 +5038,10 @@ function Uc({
|
|
|
5038
5038
|
inputMode: d,
|
|
5039
5039
|
placeholder: r,
|
|
5040
5040
|
autoComplete: c,
|
|
5041
|
-
"aria-invalid": !!
|
|
5041
|
+
"aria-invalid": !!p
|
|
5042
5042
|
}
|
|
5043
5043
|
),
|
|
5044
|
-
|
|
5044
|
+
p?.message && /* @__PURE__ */ i.jsx("p", { className: "text-destructive text-sm", children: p.message })
|
|
5045
5045
|
] });
|
|
5046
5046
|
}
|
|
5047
5047
|
function Il({
|
|
@@ -5056,9 +5056,9 @@ function Il({
|
|
|
5056
5056
|
onChange: c
|
|
5057
5057
|
}) {
|
|
5058
5058
|
const u = m.useMemo(
|
|
5059
|
-
() => s?.map((
|
|
5060
|
-
label:
|
|
5061
|
-
value:
|
|
5059
|
+
() => s?.map((p) => ({
|
|
5060
|
+
label: p.name,
|
|
5061
|
+
value: p.value.toString()
|
|
5062
5062
|
})) ?? [],
|
|
5063
5063
|
[s]
|
|
5064
5064
|
);
|
|
@@ -5070,23 +5070,23 @@ function Il({
|
|
|
5070
5070
|
control: e,
|
|
5071
5071
|
name: n,
|
|
5072
5072
|
render: ({
|
|
5073
|
-
field: { onChange:
|
|
5074
|
-
fieldState: { error:
|
|
5073
|
+
field: { onChange: p, value: h },
|
|
5074
|
+
fieldState: { error: v }
|
|
5075
5075
|
}) => /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
5076
5076
|
/* @__PURE__ */ i.jsx(
|
|
5077
5077
|
Io,
|
|
5078
5078
|
{
|
|
5079
5079
|
options: u,
|
|
5080
5080
|
value: h?.toString() ?? "",
|
|
5081
|
-
onValueChange: (
|
|
5082
|
-
|
|
5081
|
+
onValueChange: (_) => {
|
|
5082
|
+
p(_), c?.(_);
|
|
5083
5083
|
},
|
|
5084
5084
|
placeholder: r,
|
|
5085
5085
|
emptyText: a,
|
|
5086
5086
|
disabled: d
|
|
5087
5087
|
}
|
|
5088
5088
|
),
|
|
5089
|
-
|
|
5089
|
+
v?.message && /* @__PURE__ */ i.jsx("p", { className: "text-destructive text-sm", children: v.message })
|
|
5090
5090
|
] })
|
|
5091
5091
|
}
|
|
5092
5092
|
)
|
|
@@ -5340,8 +5340,8 @@ function br(e, n, t, r, a) {
|
|
|
5340
5340
|
var c = Wc(o, d, r);
|
|
5341
5341
|
o = c.value, d = c.caret;
|
|
5342
5342
|
}
|
|
5343
|
-
var u = t0(o, d, t),
|
|
5344
|
-
d = u.caret, e.value =
|
|
5343
|
+
var u = t0(o, d, t), p = u.text;
|
|
5344
|
+
d = u.caret, e.value = p, mi(e, d), a && a(o);
|
|
5345
5345
|
}
|
|
5346
5346
|
var u0 = ["ref", "parse", "format", "value", "defaultValue", "controlled", "onChange", "onKeyDown"];
|
|
5347
5347
|
function Ul(e, n) {
|
|
@@ -5386,21 +5386,21 @@ function f0(e, n) {
|
|
|
5386
5386
|
return t;
|
|
5387
5387
|
}
|
|
5388
5388
|
function p0(e) {
|
|
5389
|
-
var n = e.ref, t = e.parse, r = e.format, a = e.value, s = e.defaultValue, o = e.controlled, d = o === void 0 ? !0 : o, c = e.onChange, u = e.onKeyDown,
|
|
5389
|
+
var n = e.ref, t = e.parse, r = e.format, a = e.value, s = e.defaultValue, o = e.controlled, d = o === void 0 ? !0 : o, c = e.onChange, u = e.onKeyDown, p = h0(e, u0), h = m.useRef(), v = m.useCallback(function(y) {
|
|
5390
5390
|
h.current = y, n && (typeof n == "function" ? n(y) : n.current = y);
|
|
5391
|
-
}, [n]),
|
|
5391
|
+
}, [n]), _ = m.useCallback(function(y) {
|
|
5392
5392
|
return o0(y, h.current, t, r, c);
|
|
5393
|
-
}, [h, t, r, c]),
|
|
5393
|
+
}, [h, t, r, c]), b = m.useCallback(function(y) {
|
|
5394
5394
|
if (u && u(y), !y.defaultPrevented)
|
|
5395
5395
|
return d0(y, h.current, t, r, c);
|
|
5396
|
-
}, [h, t, r, c, u]),
|
|
5397
|
-
ref:
|
|
5398
|
-
onChange:
|
|
5399
|
-
onKeyDown:
|
|
5396
|
+
}, [h, t, r, c, u]), f = ht(ht({}, p), {}, {
|
|
5397
|
+
ref: v,
|
|
5398
|
+
onChange: _,
|
|
5399
|
+
onKeyDown: b
|
|
5400
5400
|
});
|
|
5401
|
-
return d ? ht(ht({},
|
|
5401
|
+
return d ? ht(ht({}, f), {}, {
|
|
5402
5402
|
value: r(ql(a) ? "" : a).text
|
|
5403
|
-
}) : ht(ht({},
|
|
5403
|
+
}) : ht(ht({}, f), {}, {
|
|
5404
5404
|
defaultValue: r(ql(s) ? "" : s).text
|
|
5405
5405
|
});
|
|
5406
5406
|
}
|
|
@@ -5450,7 +5450,7 @@ function b0(e, n) {
|
|
|
5450
5450
|
return t;
|
|
5451
5451
|
}
|
|
5452
5452
|
function Mn(e, n) {
|
|
5453
|
-
var t = e.inputComponent, r = t === void 0 ? "input" : t, a = e.parse, s = e.format, o = e.value, d = e.defaultValue, c = e.onChange, u = e.controlled,
|
|
5453
|
+
var t = e.inputComponent, r = t === void 0 ? "input" : t, a = e.parse, s = e.format, o = e.value, d = e.defaultValue, c = e.onChange, u = e.controlled, p = e.onKeyDown, h = e.type, v = h === void 0 ? "text" : h, _ = y0(e, v0), b = p0(g0({
|
|
5454
5454
|
ref: n,
|
|
5455
5455
|
parse: a,
|
|
5456
5456
|
format: s,
|
|
@@ -5458,10 +5458,10 @@ function Mn(e, n) {
|
|
|
5458
5458
|
defaultValue: d,
|
|
5459
5459
|
onChange: c,
|
|
5460
5460
|
controlled: u,
|
|
5461
|
-
onKeyDown:
|
|
5462
|
-
type:
|
|
5463
|
-
},
|
|
5464
|
-
return /* @__PURE__ */ l.createElement(r,
|
|
5461
|
+
onKeyDown: p,
|
|
5462
|
+
type: v
|
|
5463
|
+
}, _));
|
|
5464
|
+
return /* @__PURE__ */ l.createElement(r, b);
|
|
5465
5465
|
}
|
|
5466
5466
|
Mn = /* @__PURE__ */ l.forwardRef(Mn);
|
|
5467
5467
|
Mn.propTypes = {
|
|
@@ -6105,7 +6105,7 @@ function _r(e, n) {
|
|
|
6105
6105
|
}
|
|
6106
6106
|
var u;
|
|
6107
6107
|
if (d) {
|
|
6108
|
-
var
|
|
6108
|
+
var p = e.indexOf(r[1]), h = e.slice(0, p);
|
|
6109
6109
|
h === n.numberingPlan.nationalPrefix() && (u = n.numberingPlan.nationalPrefix());
|
|
6110
6110
|
} else
|
|
6111
6111
|
u = r[0];
|
|
@@ -6204,8 +6204,8 @@ function yi(e, n, t, r, a) {
|
|
|
6204
6204
|
var s = n || t ? nt(n || t, a) : r;
|
|
6205
6205
|
if (e.indexOf(s) === 0) {
|
|
6206
6206
|
a = new _e(a), a.selectNumberingPlan(n || t, s);
|
|
6207
|
-
var o = e.slice(s.length), d = Er(o, n, a), c = d.nationalNumber, u = Er(e, n, a),
|
|
6208
|
-
if (!et(
|
|
6207
|
+
var o = e.slice(s.length), d = Er(o, n, a), c = d.nationalNumber, u = Er(e, n, a), p = u.nationalNumber;
|
|
6208
|
+
if (!et(p, a.nationalNumberPattern()) && et(c, a.nationalNumberPattern()) || Xn(p, n, a) === "TOO_LONG")
|
|
6209
6209
|
return {
|
|
6210
6210
|
countryCallingCode: s,
|
|
6211
6211
|
number: o
|
|
@@ -6243,15 +6243,15 @@ function ul(e, n, t, r, a) {
|
|
|
6243
6243
|
if (e[1] === "0")
|
|
6244
6244
|
return {};
|
|
6245
6245
|
a = new _e(a);
|
|
6246
|
-
for (var
|
|
6247
|
-
var h = e.slice(1,
|
|
6246
|
+
for (var p = 2; p - 1 <= B0 && p <= e.length; ) {
|
|
6247
|
+
var h = e.slice(1, p);
|
|
6248
6248
|
if (a.hasCallingCode(h))
|
|
6249
6249
|
return a.selectNumberingPlan(h), {
|
|
6250
6250
|
countryCallingCodeSource: s ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
|
|
6251
6251
|
countryCallingCode: h,
|
|
6252
|
-
number: e.slice(
|
|
6252
|
+
number: e.slice(p)
|
|
6253
6253
|
};
|
|
6254
|
-
|
|
6254
|
+
p++;
|
|
6255
6255
|
}
|
|
6256
6256
|
return {};
|
|
6257
6257
|
}
|
|
@@ -6292,8 +6292,8 @@ var t3 = ";ext=", ft = function(n) {
|
|
|
6292
6292
|
return "([".concat(Se, "]{1,").concat(n, "})");
|
|
6293
6293
|
};
|
|
6294
6294
|
function wi(e) {
|
|
6295
|
-
var n = "20", t = "15", r = "9", a = "6", s = "[ \\t,]*", o = "[:\\..]?[ \\t,-]*", d = "#?", c = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", u = "(?:[xx##~~]|int|int)",
|
|
6296
|
-
return
|
|
6295
|
+
var n = "20", t = "15", r = "9", a = "6", s = "[ \\t,]*", o = "[:\\..]?[ \\t,-]*", d = "#?", c = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", u = "(?:[xx##~~]|int|int)", p = "[- ]+", h = "[ \\t]*", v = "(?:,{2}|;)", _ = t3 + ft(n), b = s + c + o + ft(n) + d, f = s + u + o + ft(r) + d, y = p + ft(a) + "#", E = h + v + o + ft(t) + d, w = h + "(?:,)+" + o + ft(r) + d;
|
|
6296
|
+
return _ + "|" + b + "|" + f + "|" + y + "|" + E + "|" + w;
|
|
6297
6297
|
}
|
|
6298
6298
|
var n3 = "[" + Se + "]{" + dl + "}", r3 = "[" + Zn + "]{0,1}(?:[" + Re + "]*[" + Se + "]){3,}[" + Re + Se + "]*", l3 = new RegExp("^[" + Zn + "]{0,1}(?:[" + Re + "]*[" + Se + "]){1,2}$", "i"), a3 = r3 + // Phone number extensions
|
|
6299
6299
|
"(?:" + wi() + ")?", i3 = new RegExp(
|
|
@@ -6484,8 +6484,8 @@ var Fi = /* @__PURE__ */ (function() {
|
|
|
6484
6484
|
if (typeof t != "string")
|
|
6485
6485
|
throw new TypeError("`nationalNumber` argument must be a string");
|
|
6486
6486
|
hi(r);
|
|
6487
|
-
var c = _3(n, r), u = c.country,
|
|
6488
|
-
this.country = u, this.countryCallingCode =
|
|
6487
|
+
var c = _3(n, r), u = c.country, p = c.countryCallingCode;
|
|
6488
|
+
this.country = u, this.countryCallingCode = p, this.nationalNumber = t, this.number = "+" + this.countryCallingCode + this.nationalNumber, this.getMetadata = function() {
|
|
6489
6489
|
return r;
|
|
6490
6490
|
};
|
|
6491
6491
|
}
|
|
@@ -6871,7 +6871,7 @@ function Z3(e, n, t) {
|
|
|
6871
6871
|
throw o === "TOO_SHORT" ? new Xe("TOO_SHORT") : new Xe("NOT_A_NUMBER");
|
|
6872
6872
|
return {};
|
|
6873
6873
|
}
|
|
6874
|
-
var d = nu(a, n.defaultCountry, n.defaultCallingCode, t), c = d.country, u = d.nationalNumber,
|
|
6874
|
+
var d = nu(a, n.defaultCountry, n.defaultCallingCode, t), c = d.country, u = d.nationalNumber, p = d.countryCallingCode, h = d.countryCallingCodeSource, v = d.carrierCode;
|
|
6875
6875
|
if (!t.hasSelectedNumberingPlan()) {
|
|
6876
6876
|
if (n.v2)
|
|
6877
6877
|
throw new Xe("INVALID_COUNTRY");
|
|
@@ -6888,19 +6888,19 @@ function Z3(e, n, t) {
|
|
|
6888
6888
|
return {};
|
|
6889
6889
|
}
|
|
6890
6890
|
if (n.v2) {
|
|
6891
|
-
var
|
|
6892
|
-
return c && (
|
|
6891
|
+
var _ = new Fi(p, u, t.metadata);
|
|
6892
|
+
return c && (_.country = c), v && (_.carrierCode = v), s && (_.ext = s), _.__countryCallingCodeSource = h, _;
|
|
6893
6893
|
}
|
|
6894
|
-
var
|
|
6894
|
+
var b = (n.extended ? t.hasSelectedNumberingPlan() : c) ? et(u, t.nationalNumberPattern()) : !1;
|
|
6895
6895
|
return n.extended ? {
|
|
6896
6896
|
country: c,
|
|
6897
|
-
countryCallingCode:
|
|
6898
|
-
carrierCode:
|
|
6899
|
-
valid:
|
|
6900
|
-
possible:
|
|
6897
|
+
countryCallingCode: p,
|
|
6898
|
+
carrierCode: v,
|
|
6899
|
+
valid: b,
|
|
6900
|
+
possible: b ? !0 : !!(n.extended === !0 && t.possibleLengths() && vi(u, c, t)),
|
|
6901
6901
|
phone: u,
|
|
6902
6902
|
ext: s
|
|
6903
|
-
} :
|
|
6903
|
+
} : b ? tu(c, u, s) : {};
|
|
6904
6904
|
}
|
|
6905
6905
|
function J3(e, n, t) {
|
|
6906
6906
|
if (e) {
|
|
@@ -6952,15 +6952,15 @@ function nu(e, n, t, r) {
|
|
|
6952
6952
|
countryCallingCodeSource: s,
|
|
6953
6953
|
countryCallingCode: o
|
|
6954
6954
|
};
|
|
6955
|
-
var u = Er(Fr(d), c, r),
|
|
6956
|
-
nationalNumber:
|
|
6955
|
+
var u = Er(Fr(d), c, r), p = u.nationalNumber, h = u.carrierCode, v = cl(o, {
|
|
6956
|
+
nationalNumber: p,
|
|
6957
6957
|
metadata: r
|
|
6958
6958
|
});
|
|
6959
|
-
return
|
|
6959
|
+
return v && (c = v, v === "001" || r.selectNumberingPlan(c)), {
|
|
6960
6960
|
country: c,
|
|
6961
6961
|
countryCallingCode: o,
|
|
6962
6962
|
countryCallingCodeSource: s,
|
|
6963
|
-
nationalNumber:
|
|
6963
|
+
nationalNumber: p,
|
|
6964
6964
|
carrierCode: h
|
|
6965
6965
|
};
|
|
6966
6966
|
}
|
|
@@ -7086,8 +7086,8 @@ function fu(e, n) {
|
|
|
7086
7086
|
var r, a, s, o, d = [], c = !0, u = !1;
|
|
7087
7087
|
try {
|
|
7088
7088
|
if (s = (t = t.call(e)).next, n !== 0) for (; !(c = (r = s.call(t)).done) && (d.push(r.value), d.length !== n); c = !0) ;
|
|
7089
|
-
} catch (
|
|
7090
|
-
u = !0, a =
|
|
7089
|
+
} catch (p) {
|
|
7090
|
+
u = !0, a = p;
|
|
7091
7091
|
} finally {
|
|
7092
7092
|
try {
|
|
7093
7093
|
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
|
|
@@ -7665,21 +7665,21 @@ function Mr(e, n, t) {
|
|
|
7665
7665
|
}
|
|
7666
7666
|
switch (n.op) {
|
|
7667
7667
|
case "|":
|
|
7668
|
-
for (var c, u = va(n.args),
|
|
7669
|
-
var h =
|
|
7670
|
-
if (
|
|
7671
|
-
if (
|
|
7672
|
-
return
|
|
7673
|
-
if (
|
|
7668
|
+
for (var c, u = va(n.args), p; !(p = u()).done; ) {
|
|
7669
|
+
var h = p.value, v = Mr(e, h, t);
|
|
7670
|
+
if (v) {
|
|
7671
|
+
if (v.overflow)
|
|
7672
|
+
return v;
|
|
7673
|
+
if (v.match)
|
|
7674
7674
|
return {
|
|
7675
7675
|
match: !0,
|
|
7676
|
-
matchedChars:
|
|
7676
|
+
matchedChars: v.matchedChars
|
|
7677
7677
|
};
|
|
7678
|
-
if (
|
|
7678
|
+
if (v.partialMatch)
|
|
7679
7679
|
c = !0;
|
|
7680
7680
|
else
|
|
7681
7681
|
throw new Error(`Unsupported match result:
|
|
7682
|
-
`.concat(JSON.stringify(
|
|
7682
|
+
`.concat(JSON.stringify(v, null, 2)));
|
|
7683
7683
|
}
|
|
7684
7684
|
}
|
|
7685
7685
|
return c ? {
|
|
@@ -7687,9 +7687,9 @@ function Mr(e, n, t) {
|
|
|
7687
7687
|
// matchedChars: ...
|
|
7688
7688
|
} : void 0;
|
|
7689
7689
|
case "[]":
|
|
7690
|
-
for (var
|
|
7691
|
-
var
|
|
7692
|
-
if (e[0] ===
|
|
7690
|
+
for (var _ = va(n.args), b; !(b = _()).done; ) {
|
|
7691
|
+
var f = b.value;
|
|
7692
|
+
if (e[0] === f)
|
|
7693
7693
|
return e.length === 1 ? {
|
|
7694
7694
|
match: !0,
|
|
7695
7695
|
matchedChars: e
|
|
@@ -7697,7 +7697,7 @@ function Mr(e, n, t) {
|
|
|
7697
7697
|
overflow: !0
|
|
7698
7698
|
} : {
|
|
7699
7699
|
match: !0,
|
|
7700
|
-
matchedChars: [
|
|
7700
|
+
matchedChars: [f]
|
|
7701
7701
|
};
|
|
7702
7702
|
}
|
|
7703
7703
|
return;
|
|
@@ -7799,14 +7799,14 @@ var Nr = "9", l4 = 15, a4 = mn(Nr, l4), i4 = /[- ]/, s4 = function() {
|
|
|
7799
7799
|
for (var s = xa(this.matchingFormats), o; !(o = s()).done; ) {
|
|
7800
7800
|
var d = o.value, c = ju(r, d, {
|
|
7801
7801
|
metadata: this.metadata,
|
|
7802
|
-
shouldTryNationalPrefixFormattingRule: function(
|
|
7803
|
-
return a.shouldTryNationalPrefixFormattingRule(
|
|
7802
|
+
shouldTryNationalPrefixFormattingRule: function(p) {
|
|
7803
|
+
return a.shouldTryNationalPrefixFormattingRule(p, {
|
|
7804
7804
|
international: r.international,
|
|
7805
7805
|
nationalPrefix: r.nationalPrefix
|
|
7806
7806
|
});
|
|
7807
7807
|
},
|
|
7808
|
-
getSeparatorAfterNationalPrefix: function(
|
|
7809
|
-
return a.getSeparatorAfterNationalPrefix(
|
|
7808
|
+
getSeparatorAfterNationalPrefix: function(p) {
|
|
7809
|
+
return a.getSeparatorAfterNationalPrefix(p);
|
|
7810
7810
|
}
|
|
7811
7811
|
});
|
|
7812
7812
|
if (c)
|
|
@@ -7864,8 +7864,8 @@ var Nr = "9", l4 = 15, a4 = mn(Nr, l4), i4 = /[- ]/, s4 = function() {
|
|
|
7864
7864
|
value: function(t) {
|
|
7865
7865
|
for (var r = this, a = function() {
|
|
7866
7866
|
var u = d.value;
|
|
7867
|
-
return r.chosenFormat === u ? 0 : d4.test(r.getFormatFormat(u, t.international)) ? r.createTemplateForFormat(u, t) ? (r.chosenFormat = u, 0) : (r.matchingFormats = r.matchingFormats.filter(function(
|
|
7868
|
-
return
|
|
7867
|
+
return r.chosenFormat === u ? 0 : d4.test(r.getFormatFormat(u, t.international)) ? r.createTemplateForFormat(u, t) ? (r.chosenFormat = u, 0) : (r.matchingFormats = r.matchingFormats.filter(function(p) {
|
|
7868
|
+
return p !== u;
|
|
7869
7869
|
}), 1) : 1;
|
|
7870
7870
|
}, s, o = xa(this.matchingFormats.slice()), d; !(d = o()).done && (s = a(), s !== 0); )
|
|
7871
7871
|
;
|
|
@@ -7921,20 +7921,20 @@ var Nr = "9", l4 = 15, a4 = mn(Nr, l4), i4 = /[- ]/, s4 = function() {
|
|
|
7921
7921
|
c = c.replace(s4(), "\\d").replace(o4(), "\\d");
|
|
7922
7922
|
var u = a4.match(c)[0];
|
|
7923
7923
|
if (!(a.length > u.length)) {
|
|
7924
|
-
var
|
|
7925
|
-
|
|
7926
|
-
var
|
|
7924
|
+
var p = new RegExp("^" + c + "$"), h = a.replace(/\d/g, Nr);
|
|
7925
|
+
p.test(h) && (u = h);
|
|
7926
|
+
var v = this.getFormatFormat(t, s), _;
|
|
7927
7927
|
if (this.shouldTryNationalPrefixFormattingRule(t, {
|
|
7928
7928
|
international: s,
|
|
7929
7929
|
nationalPrefix: o
|
|
7930
7930
|
})) {
|
|
7931
|
-
var
|
|
7932
|
-
if (Sn(t.nationalPrefixFormattingRule()) === (o || "") + Sn("$1") && (
|
|
7933
|
-
for (var
|
|
7934
|
-
|
|
7931
|
+
var b = v.replace(_i, t.nationalPrefixFormattingRule());
|
|
7932
|
+
if (Sn(t.nationalPrefixFormattingRule()) === (o || "") + Sn("$1") && (v = b, _ = !0, o))
|
|
7933
|
+
for (var f = o.length; f > 0; )
|
|
7934
|
+
v = v.replace(/\d/, Be), f--;
|
|
7935
7935
|
}
|
|
7936
|
-
var y = u.replace(new RegExp(c),
|
|
7937
|
-
return
|
|
7936
|
+
var y = u.replace(new RegExp(c), v).replace(new RegExp(Nr, "g"), Be);
|
|
7937
|
+
return _ || (d ? y = mn(Be, d.length) + " " + y : o && (y = mn(Be, o.length) + this.getSeparatorAfterNationalPrefix(t) + y)), s && (y = bi(y)), y;
|
|
7938
7938
|
}
|
|
7939
7939
|
}
|
|
7940
7940
|
}, {
|
|
@@ -7992,8 +7992,8 @@ function h4(e, n) {
|
|
|
7992
7992
|
var r, a, s, o, d = [], c = !0, u = !1;
|
|
7993
7993
|
try {
|
|
7994
7994
|
if (s = (t = t.call(e)).next, n !== 0) for (; !(c = (r = s.call(t)).done) && (d.push(r.value), d.length !== n); c = !0) ;
|
|
7995
|
-
} catch (
|
|
7996
|
-
u = !0, a =
|
|
7995
|
+
} catch (p) {
|
|
7996
|
+
u = !0, a = p;
|
|
7997
7997
|
} finally {
|
|
7998
7998
|
try {
|
|
7999
7999
|
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
|
|
@@ -8131,8 +8131,8 @@ var b4 = "[" + Re + Se + "]+", _4 = new RegExp("^" + b4 + "$", "i"), E4 = "(?:["
|
|
|
8131
8131
|
if (u < 0 || u !== s.length - a.length)
|
|
8132
8132
|
d = !0;
|
|
8133
8133
|
else {
|
|
8134
|
-
var
|
|
8135
|
-
|
|
8134
|
+
var p = s.slice(0, u);
|
|
8135
|
+
p && p !== t && (c = p);
|
|
8136
8136
|
}
|
|
8137
8137
|
o({
|
|
8138
8138
|
nationalPrefix: t,
|
|
@@ -8247,8 +8247,8 @@ function j4(e, n) {
|
|
|
8247
8247
|
var r, a, s, o, d = [], c = !0, u = !1;
|
|
8248
8248
|
try {
|
|
8249
8249
|
if (s = (t = t.call(e)).next, n !== 0) for (; !(c = (r = s.call(t)).done) && (d.push(r.value), d.length !== n); c = !0) ;
|
|
8250
|
-
} catch (
|
|
8251
|
-
u = !0, a =
|
|
8250
|
+
} catch (p) {
|
|
8251
|
+
u = !0, a = p;
|
|
8252
8252
|
} finally {
|
|
8253
8253
|
try {
|
|
8254
8254
|
if (!c && t.return != null && (o = t.return(), Object(o) !== o)) return;
|
|
@@ -8505,11 +8505,11 @@ var Pt = /* @__PURE__ */ (function() {
|
|
|
8505
8505
|
d.selectNumberingPlan(o);
|
|
8506
8506
|
var c = d.numberingPlan.callingCode(), u = this.metadata.getCountryCodesForCallingCode(c);
|
|
8507
8507
|
if (u.length > 1) {
|
|
8508
|
-
var
|
|
8508
|
+
var p = xi(r, {
|
|
8509
8509
|
countries: u,
|
|
8510
8510
|
metadata: this.metadata.metadata
|
|
8511
8511
|
});
|
|
8512
|
-
|
|
8512
|
+
p && (o = p);
|
|
8513
8513
|
}
|
|
8514
8514
|
}
|
|
8515
8515
|
var h = new Fi(o || s, r, this.metadata.metadata);
|
|
@@ -8639,14 +8639,14 @@ function W4(e) {
|
|
|
8639
8639
|
function n(t, r) {
|
|
8640
8640
|
var a = t.onKeyDown, s = t.country, o = t.inputFormat, d = t.metadata, c = d === void 0 ? e : d;
|
|
8641
8641
|
t.international, t.withCountryCallingCode;
|
|
8642
|
-
var u = q4(t, U4),
|
|
8643
|
-
var
|
|
8642
|
+
var u = q4(t, U4), p = m.useCallback(function(v) {
|
|
8643
|
+
var _ = new Pt(s, c), b = Si({
|
|
8644
8644
|
inputFormat: o,
|
|
8645
8645
|
country: s,
|
|
8646
8646
|
metadata: c
|
|
8647
|
-
}),
|
|
8648
|
-
return
|
|
8649
|
-
text:
|
|
8647
|
+
}), f = _.input(b + v), y = _.getTemplate();
|
|
8648
|
+
return b && (f = Pr(f, b), y && (y = Pr(y, b))), {
|
|
8649
|
+
text: f,
|
|
8650
8650
|
template: y
|
|
8651
8651
|
};
|
|
8652
8652
|
}, [s, c]), h = Pi({
|
|
@@ -8656,7 +8656,7 @@ function W4(e) {
|
|
|
8656
8656
|
return /* @__PURE__ */ l.createElement(Mn, jr({}, u, {
|
|
8657
8657
|
ref: r,
|
|
8658
8658
|
parse: O4,
|
|
8659
|
-
format:
|
|
8659
|
+
format: p,
|
|
8660
8660
|
onKeyDown: h
|
|
8661
8661
|
}));
|
|
8662
8662
|
}
|
|
@@ -8732,27 +8732,27 @@ function X4(e, n) {
|
|
|
8732
8732
|
}
|
|
8733
8733
|
function Z4(e) {
|
|
8734
8734
|
function n(t, r) {
|
|
8735
|
-
var a = t.value, s = t.onChange, o = t.onKeyDown, d = t.country, c = t.inputFormat, u = t.metadata,
|
|
8735
|
+
var a = t.value, s = t.onChange, o = t.onKeyDown, d = t.country, c = t.inputFormat, u = t.metadata, p = u === void 0 ? e : u, h = t.inputComponent, v = h === void 0 ? "input" : h;
|
|
8736
8736
|
t.international, t.withCountryCallingCode;
|
|
8737
|
-
var
|
|
8737
|
+
var _ = Q4(t, Y4), b = Si({
|
|
8738
8738
|
inputFormat: c,
|
|
8739
8739
|
country: d,
|
|
8740
|
-
metadata:
|
|
8741
|
-
}),
|
|
8740
|
+
metadata: p
|
|
8741
|
+
}), f = m.useCallback(function(E) {
|
|
8742
8742
|
var w = Fr(E.target.value);
|
|
8743
8743
|
if (w === a) {
|
|
8744
|
-
var z = wa(
|
|
8744
|
+
var z = wa(b, w, d, p);
|
|
8745
8745
|
z.indexOf(E.target.value) === 0 && (w = w.slice(0, -1));
|
|
8746
8746
|
}
|
|
8747
8747
|
s(w);
|
|
8748
|
-
}, [
|
|
8748
|
+
}, [b, a, s, d, p]), y = Pi({
|
|
8749
8749
|
onKeyDown: o,
|
|
8750
8750
|
inputFormat: c
|
|
8751
8751
|
});
|
|
8752
|
-
return /* @__PURE__ */ l.createElement(
|
|
8752
|
+
return /* @__PURE__ */ l.createElement(v, Ar({}, _, {
|
|
8753
8753
|
ref: r,
|
|
8754
|
-
value: wa(
|
|
8755
|
-
onChange:
|
|
8754
|
+
value: wa(b, a, d, p),
|
|
8755
|
+
onChange: f,
|
|
8756
8756
|
onKeyDown: y
|
|
8757
8757
|
}));
|
|
8758
8758
|
}
|
|
@@ -8878,13 +8878,13 @@ function Ai(e) {
|
|
|
8878
8878
|
value: n || "ZZ",
|
|
8879
8879
|
onChange: d
|
|
8880
8880
|
}), r.map(function(c) {
|
|
8881
|
-
var u = c.value,
|
|
8881
|
+
var u = c.value, p = c.label, h = c.divider;
|
|
8882
8882
|
return /* @__PURE__ */ l.createElement("option", {
|
|
8883
8883
|
key: h ? "|" : u || "ZZ",
|
|
8884
8884
|
value: h ? "|" : u || "ZZ",
|
|
8885
8885
|
disabled: !!h,
|
|
8886
8886
|
style: h ? i5 : void 0
|
|
8887
|
-
},
|
|
8887
|
+
}, p);
|
|
8888
8888
|
}));
|
|
8889
8889
|
}
|
|
8890
8890
|
Ai.propTypes = {
|
|
@@ -9185,12 +9185,12 @@ function y5(e, n) {
|
|
|
9185
9185
|
else if (u === "..." || u === "…")
|
|
9186
9186
|
a = r;
|
|
9187
9187
|
else {
|
|
9188
|
-
var
|
|
9189
|
-
u === "🌐" ?
|
|
9190
|
-
var h = e.indexOf(e.filter(function(
|
|
9191
|
-
return
|
|
9192
|
-
})[0]),
|
|
9193
|
-
e.splice(h, 1), a.push(
|
|
9188
|
+
var p;
|
|
9189
|
+
u === "🌐" ? p = void 0 : p = u;
|
|
9190
|
+
var h = e.indexOf(e.filter(function(_) {
|
|
9191
|
+
return _.value === p;
|
|
9192
|
+
})[0]), v = e[h];
|
|
9193
|
+
e.splice(h, 1), a.push(v);
|
|
9194
9194
|
}
|
|
9195
9195
|
}, o = g5(n), d; !(d = o()).done; )
|
|
9196
9196
|
s();
|
|
@@ -9249,8 +9249,8 @@ function w5(e, n) {
|
|
|
9249
9249
|
function Oi(e) {
|
|
9250
9250
|
var n = e.flags, t = e.flagUrl, r = e.flagComponent, a = e.internationalIcon;
|
|
9251
9251
|
function s(o) {
|
|
9252
|
-
var d = o.country, c = o.label, u = o.aspectRatio,
|
|
9253
|
-
return /* @__PURE__ */ l.createElement("div", Dr({},
|
|
9252
|
+
var d = o.country, c = o.label, u = o.aspectRatio, p = E5(o, _5), h = a === Jn ? u : void 0;
|
|
9253
|
+
return /* @__PURE__ */ l.createElement("div", Dr({}, p, {
|
|
9254
9254
|
className: Cn("PhoneInputCountryIcon", {
|
|
9255
9255
|
"PhoneInputCountryIcon--square": h === 1,
|
|
9256
9256
|
"PhoneInputCountryIcon--border": d
|
|
@@ -9422,21 +9422,21 @@ function Ui(e, n) {
|
|
|
9422
9422
|
return t;
|
|
9423
9423
|
}
|
|
9424
9424
|
function H5(e, n) {
|
|
9425
|
-
var t = n.prevPhoneDigits, r = n.country, a = n.defaultCountry, s = n.latestCountrySelectedByUser, o = n.countryRequired, d = n.getAnyCountry, c = n.countries, u = n.international,
|
|
9425
|
+
var t = n.prevPhoneDigits, r = n.country, a = n.defaultCountry, s = n.latestCountrySelectedByUser, o = n.countryRequired, d = n.getAnyCountry, c = n.countries, u = n.international, p = n.limitMaxLength, h = n.countryCallingCodeEditable, v = n.metadata;
|
|
9426
9426
|
if (u && h === !1 && r) {
|
|
9427
|
-
var
|
|
9428
|
-
if (e.indexOf(
|
|
9429
|
-
var
|
|
9430
|
-
return
|
|
9427
|
+
var _ = Ze(r, v);
|
|
9428
|
+
if (e.indexOf(_) !== 0) {
|
|
9429
|
+
var b, f = e && e[0] !== "+";
|
|
9430
|
+
return f ? (e = _ + e, b = xt(e, r, v)) : e = _, {
|
|
9431
9431
|
phoneDigits: e,
|
|
9432
|
-
value:
|
|
9432
|
+
value: b,
|
|
9433
9433
|
country: r
|
|
9434
9434
|
};
|
|
9435
9435
|
}
|
|
9436
9436
|
}
|
|
9437
|
-
u === !1 && r && e && e[0] === "+" && (e = Ma(e, r,
|
|
9437
|
+
u === !1 && r && e && e[0] === "+" && (e = Ma(e, r, v)), e && r && p && (e = j5(e, r, v)), e && e[0] !== "+" && (!r || u) && (e = "+" + e), !e && t && t[0] === "+" && (u ? r = void 0 : r = a), e === "+" && t && t[0] === "+" && t.length > 1 && (r = void 0);
|
|
9438
9438
|
var y;
|
|
9439
|
-
return e && (e[0] === "+" && (e === "+" || r && Ze(r,
|
|
9439
|
+
return e && (e[0] === "+" && (e === "+" || r && Ze(r, v).indexOf(e) === 0) ? y = void 0 : y = xt(e, r, v)), y && (r = Ui(y, {
|
|
9440
9440
|
country: r,
|
|
9441
9441
|
countries: c,
|
|
9442
9442
|
defaultCountry: a,
|
|
@@ -9444,8 +9444,8 @@ function H5(e, n) {
|
|
|
9444
9444
|
// `countryRequired` flag is not passed here.
|
|
9445
9445
|
// Instead, it's explicitly checked a bit later in the code.
|
|
9446
9446
|
required: !1,
|
|
9447
|
-
metadata:
|
|
9448
|
-
}), u === !1 && r && e && e[0] === "+" && (e = Ma(e, r,
|
|
9447
|
+
metadata: v
|
|
9448
|
+
}), u === !1 && r && e && e[0] === "+" && (e = Ma(e, r, v), y = xt(e, r, v))), !r && o && (r = a || d()), {
|
|
9449
9449
|
// `phoneDigits` returned here are a "normalized" version of the original `phoneDigits`.
|
|
9450
9450
|
// The returned `phoneDigits` shouldn't be used anywhere except for passing it as
|
|
9451
9451
|
// `prevPhoneDigits` parameter to this same function on next input change event.
|
|
@@ -9551,16 +9551,16 @@ function O5(e, n) {
|
|
|
9551
9551
|
return (n === "string" ? String : Number)(e);
|
|
9552
9552
|
}
|
|
9553
9553
|
function B5(e, n, t) {
|
|
9554
|
-
var r = e.metadata, a = e.countries, s = e.defaultCountry, o = e.value, d = e.reset, c = e.international, u = e.displayInitialValueAsLocalNumber,
|
|
9554
|
+
var r = e.metadata, a = e.countries, s = e.defaultCountry, o = e.value, d = e.reset, c = e.international, u = e.displayInitialValueAsLocalNumber, p = e.initialValueFormat, h = n.defaultCountry, v = n.value, _ = n.reset;
|
|
9555
9555
|
t.country;
|
|
9556
|
-
var
|
|
9556
|
+
var b = t.value, f = t.hasUserSelectedACountry, y = t.latestCountrySelectedByUser, E = function(L) {
|
|
9557
9557
|
return Gi(dn(dn({}, L), {}, {
|
|
9558
9558
|
international: c,
|
|
9559
|
-
useNationalFormat: u ||
|
|
9559
|
+
useNationalFormat: u || p === "national",
|
|
9560
9560
|
metadata: r
|
|
9561
9561
|
}));
|
|
9562
9562
|
};
|
|
9563
|
-
if (d !==
|
|
9563
|
+
if (d !== _)
|
|
9564
9564
|
return {
|
|
9565
9565
|
phoneDigits: E({
|
|
9566
9566
|
value: void 0,
|
|
@@ -9574,16 +9574,16 @@ function B5(e, n, t) {
|
|
|
9574
9574
|
if (s !== h) {
|
|
9575
9575
|
var w = !s || er(s, r), z = (
|
|
9576
9576
|
// By default, "no value has been entered" means `value` is `undefined`.
|
|
9577
|
-
!
|
|
9577
|
+
!b || // When `international` is `true`, and some country has been pre-selected,
|
|
9578
9578
|
// then the `<input/>` contains a pre-filled value of `+${countryCallingCode}${leadingDigits}`,
|
|
9579
9579
|
// so in case of `international` being `true`, "the user hasn't entered anything" situation
|
|
9580
9580
|
// doesn't just mean `value` is `undefined`, but could also mean `value` is `+${countryCallingCode}`.
|
|
9581
|
-
c &&
|
|
9581
|
+
c && b === E({
|
|
9582
9582
|
value: void 0,
|
|
9583
9583
|
defaultCountry: h
|
|
9584
9584
|
})
|
|
9585
9585
|
), j = !o && z;
|
|
9586
|
-
if (!
|
|
9586
|
+
if (!f && w && j)
|
|
9587
9587
|
return {
|
|
9588
9588
|
country: s,
|
|
9589
9589
|
// If `phoneDigits` is empty, then automatically select the new `country`
|
|
@@ -9599,7 +9599,7 @@ function B5(e, n, t) {
|
|
|
9599
9599
|
value: void 0
|
|
9600
9600
|
};
|
|
9601
9601
|
}
|
|
9602
|
-
if (!Sa(o,
|
|
9602
|
+
if (!Sa(o, v) && !Sa(o, b)) {
|
|
9603
9603
|
var $, C;
|
|
9604
9604
|
if (o) {
|
|
9605
9605
|
o && Li(o), $ = Vi(o, r);
|
|
@@ -9854,35 +9854,35 @@ var Z5 = /* @__PURE__ */ (function(e) {
|
|
|
9854
9854
|
}), r.inputRef = /* @__PURE__ */ l.createRef();
|
|
9855
9855
|
var a = r.props, s = a.value;
|
|
9856
9856
|
a.labels;
|
|
9857
|
-
var o = a.international, d = a.addInternationalOption, c = a.displayInitialValueAsLocalNumber, u = a.initialValueFormat,
|
|
9858
|
-
|
|
9859
|
-
var
|
|
9857
|
+
var o = a.international, d = a.addInternationalOption, c = a.displayInitialValueAsLocalNumber, u = a.initialValueFormat, p = a.metadata, h = r.props, v = h.defaultCountry, _ = h.countries;
|
|
9858
|
+
v && (r.isCountrySupportedWithError(v) || (v = void 0)), s && Li(s), _ = Ii(_, p);
|
|
9859
|
+
var b = Vi(s, p);
|
|
9860
9860
|
r.CountryIcon = Oi(r.props);
|
|
9861
|
-
var
|
|
9861
|
+
var f = M5({
|
|
9862
9862
|
value: s,
|
|
9863
|
-
phoneNumber:
|
|
9864
|
-
defaultCountry:
|
|
9863
|
+
phoneNumber: b,
|
|
9864
|
+
defaultCountry: v,
|
|
9865
9865
|
required: !d,
|
|
9866
|
-
countries:
|
|
9866
|
+
countries: _ || Sr(p),
|
|
9867
9867
|
getAnyCountry: function() {
|
|
9868
9868
|
return r.getFirstSupportedCountry({
|
|
9869
|
-
countries:
|
|
9869
|
+
countries: _
|
|
9870
9870
|
});
|
|
9871
9871
|
},
|
|
9872
|
-
metadata:
|
|
9872
|
+
metadata: p
|
|
9873
9873
|
});
|
|
9874
9874
|
return r.state = {
|
|
9875
9875
|
// Workaround for `this.props` inside `getDerivedStateFromProps()`.
|
|
9876
9876
|
props: r.props,
|
|
9877
9877
|
// The country selected.
|
|
9878
|
-
country:
|
|
9878
|
+
country: f,
|
|
9879
9879
|
// `countries` are stored in `this.state` because they're filtered.
|
|
9880
9880
|
// For example, a developer might theoretically pass some unsupported
|
|
9881
9881
|
// countries as part of the `countries` property, and because of that
|
|
9882
9882
|
// the component uses `this.state.countries` (which are filtered)
|
|
9883
9883
|
// instead of `this.props.countries`
|
|
9884
9884
|
// (which could potentially contain unsupported countries).
|
|
9885
|
-
countries:
|
|
9885
|
+
countries: _,
|
|
9886
9886
|
// `phoneDigits` state property holds non-formatted user's input.
|
|
9887
9887
|
// The reason is that there's no way of finding out
|
|
9888
9888
|
// in which form should `value` be displayed: international or national.
|
|
@@ -9895,11 +9895,11 @@ var Z5 = /* @__PURE__ */ (function(e) {
|
|
|
9895
9895
|
// then value is `+78005553535` and `phoneDigits` are `+78005553535`.
|
|
9896
9896
|
phoneDigits: Gi({
|
|
9897
9897
|
value: s,
|
|
9898
|
-
phoneNumber:
|
|
9899
|
-
defaultCountry:
|
|
9898
|
+
phoneNumber: b,
|
|
9899
|
+
defaultCountry: v,
|
|
9900
9900
|
international: o,
|
|
9901
9901
|
useNationalFormat: c || u === "national",
|
|
9902
|
-
metadata:
|
|
9902
|
+
metadata: p
|
|
9903
9903
|
}),
|
|
9904
9904
|
// `value` property is duplicated in state.
|
|
9905
9905
|
// The reason is that `getDerivedStateFromProps()`
|
|
@@ -9926,16 +9926,16 @@ var Z5 = /* @__PURE__ */ (function(e) {
|
|
|
9926
9926
|
}, {
|
|
9927
9927
|
key: "getCountrySelectOptions",
|
|
9928
9928
|
value: function(r) {
|
|
9929
|
-
var a = r.countries, s = this.props, o = s.international, d = s.countryCallingCodeEditable, c = s.countryOptionsOrder, u = s.addInternationalOption,
|
|
9929
|
+
var a = r.countries, s = this.props, o = s.international, d = s.countryCallingCodeEditable, c = s.countryOptionsOrder, u = s.addInternationalOption, p = s.labels, h = s.locales, v = s.metadata;
|
|
9930
9930
|
return this.useMemoCountrySelectOptions(function() {
|
|
9931
9931
|
return y5(N5({
|
|
9932
|
-
countries: a || Sr(
|
|
9933
|
-
countryNames:
|
|
9932
|
+
countries: a || Sr(v),
|
|
9933
|
+
countryNames: p,
|
|
9934
9934
|
addInternationalOption: o && d === !1 ? !1 : u,
|
|
9935
9935
|
compareStringsLocales: h
|
|
9936
9936
|
// compareStrings
|
|
9937
|
-
}), b5(c,
|
|
9938
|
-
}, [a, c, u,
|
|
9937
|
+
}), b5(c, v));
|
|
9938
|
+
}, [a, c, u, p, v]);
|
|
9939
9939
|
}
|
|
9940
9940
|
}, {
|
|
9941
9941
|
key: "useMemoCountrySelectOptions",
|
|
@@ -9955,33 +9955,33 @@ var Z5 = /* @__PURE__ */ (function(e) {
|
|
|
9955
9955
|
value: function() {
|
|
9956
9956
|
var r = this.props, a = r.name, s = r.disabled, o = r.readOnly, d = r.autoComplete, c = r.style, u = r.className;
|
|
9957
9957
|
r.inputRef;
|
|
9958
|
-
var
|
|
9958
|
+
var p = r.inputComponent, h = r.numberInputProps, v = r.smartCaret, _ = r.countrySelectComponent, b = r.countrySelectProps, f = r.containerComponent, y = r.containerComponentProps;
|
|
9959
9959
|
r.defaultCountry, r.countries, r.countryOptionsOrder;
|
|
9960
9960
|
var E = r.labels;
|
|
9961
9961
|
r.flags, r.flagComponent, r.flagUrl, r.addInternationalOption, r.internationalIcon, r.displayInitialValueAsLocalNumber, r.initialValueFormat, r.onCountryChange, r.limitMaxLength, r.countryCallingCodeEditable, r.focusInputOnCountrySelection, r.reset;
|
|
9962
9962
|
var w = r.metadata, z = r.international;
|
|
9963
9963
|
r.locales;
|
|
9964
|
-
var j = V5(r, R5), $ = this.state, C = $.country, F = $.countries, P = $.phoneDigits, k = $.isFocused, D =
|
|
9964
|
+
var j = V5(r, R5), $ = this.state, C = $.country, F = $.countries, P = $.phoneDigits, k = $.isFocused, D = v ? K4 : J4, L = this.getCountrySelectOptions({
|
|
9965
9965
|
countries: F
|
|
9966
9966
|
});
|
|
9967
|
-
return /* @__PURE__ */ l.createElement(
|
|
9967
|
+
return /* @__PURE__ */ l.createElement(f, Et({
|
|
9968
9968
|
style: c,
|
|
9969
9969
|
className: Cn(u, "PhoneInput", {
|
|
9970
9970
|
"PhoneInput--focus": k,
|
|
9971
9971
|
"PhoneInput--disabled": s,
|
|
9972
9972
|
"PhoneInput--readOnly": o
|
|
9973
9973
|
})
|
|
9974
|
-
}, y), /* @__PURE__ */ l.createElement(
|
|
9974
|
+
}, y), /* @__PURE__ */ l.createElement(_, Et({
|
|
9975
9975
|
name: a ? "".concat(a, "Country") : void 0,
|
|
9976
9976
|
"aria-label": E.country
|
|
9977
|
-
},
|
|
9977
|
+
}, b, {
|
|
9978
9978
|
value: C,
|
|
9979
9979
|
options: L,
|
|
9980
9980
|
onChange: this.onCountryChange,
|
|
9981
9981
|
onFocus: this.onCountryFocus,
|
|
9982
9982
|
onBlur: this.onCountryBlur,
|
|
9983
|
-
disabled: s ||
|
|
9984
|
-
readOnly: o ||
|
|
9983
|
+
disabled: s || b && b.disabled,
|
|
9984
|
+
readOnly: o || b && b.readOnly,
|
|
9985
9985
|
iconComponent: this.CountryIcon
|
|
9986
9986
|
})), /* @__PURE__ */ l.createElement(D, Et({
|
|
9987
9987
|
ref: this.setInputRef,
|
|
@@ -10000,7 +10000,7 @@ var Z5 = /* @__PURE__ */ (function(e) {
|
|
|
10000
10000
|
onBlur: this.onBlur,
|
|
10001
10001
|
disabled: s,
|
|
10002
10002
|
readOnly: o,
|
|
10003
|
-
inputComponent:
|
|
10003
|
+
inputComponent: p,
|
|
10004
10004
|
className: Cn("PhoneInputInput", h && h.className, j.className)
|
|
10005
10005
|
})));
|
|
10006
10006
|
}
|
|
@@ -16791,7 +16791,7 @@ function nx({
|
|
|
16791
16791
|
smartCaret: !1,
|
|
16792
16792
|
inputComponent: Ji,
|
|
16793
16793
|
value: n || void 0,
|
|
16794
|
-
onChange: (
|
|
16794
|
+
onChange: (p) => t?.(p || ""),
|
|
16795
16795
|
disabled: a,
|
|
16796
16796
|
countrySelectProps: { searchPlaceholder: o, emptyText: d },
|
|
16797
16797
|
onFocus: c,
|
|
@@ -16823,7 +16823,7 @@ function rx({
|
|
|
16823
16823
|
searchPlaceholder: a,
|
|
16824
16824
|
emptyText: s
|
|
16825
16825
|
}) {
|
|
16826
|
-
const [o, d] = m.useState(!1), [c, u] = m.useState(""), { error:
|
|
16826
|
+
const [o, d] = m.useState(!1), [c, u] = m.useState(""), { error: p } = m.useContext(pl);
|
|
16827
16827
|
return /* @__PURE__ */ i.jsxs(
|
|
16828
16828
|
Vn,
|
|
16829
16829
|
{
|
|
@@ -16840,7 +16840,7 @@ function rx({
|
|
|
16840
16840
|
variant: "outline",
|
|
16841
16841
|
className: ne(
|
|
16842
16842
|
"flex gap-1 rounded-r-none px-3",
|
|
16843
|
-
|
|
16843
|
+
p && "border-destructive"
|
|
16844
16844
|
),
|
|
16845
16845
|
disabled: e,
|
|
16846
16846
|
children: [
|
|
@@ -16875,7 +16875,7 @@ function rx({
|
|
|
16875
16875
|
/* @__PURE__ */ i.jsx(Ro, { children: /* @__PURE__ */ i.jsxs(bd, { className: "h-72", children: [
|
|
16876
16876
|
/* @__PURE__ */ i.jsx(Vo, { children: s }),
|
|
16877
16877
|
/* @__PURE__ */ i.jsx(Uo, { children: t.map(
|
|
16878
|
-
({ value: h, label:
|
|
16878
|
+
({ value: h, label: v }) => h ? /* @__PURE__ */ i.jsxs(
|
|
16879
16879
|
qo,
|
|
16880
16880
|
{
|
|
16881
16881
|
className: "gap-2",
|
|
@@ -16883,8 +16883,8 @@ function rx({
|
|
|
16883
16883
|
r(h), d(!1);
|
|
16884
16884
|
},
|
|
16885
16885
|
children: [
|
|
16886
|
-
/* @__PURE__ */ i.jsx(Lr, { country: h, countryName:
|
|
16887
|
-
/* @__PURE__ */ i.jsx("span", { className: "flex-1 text-sm", children:
|
|
16886
|
+
/* @__PURE__ */ i.jsx(Lr, { country: h, countryName: v }),
|
|
16887
|
+
/* @__PURE__ */ i.jsx("span", { className: "flex-1 text-sm", children: v }),
|
|
16888
16888
|
/* @__PURE__ */ i.jsx("span", { className: "text-muted-foreground text-sm", children: `+${sm(h)}` }),
|
|
16889
16889
|
/* @__PURE__ */ i.jsx(
|
|
16890
16890
|
$t,
|
|
@@ -16946,20 +16946,20 @@ function Hn({
|
|
|
16946
16946
|
fetchStates: d,
|
|
16947
16947
|
t: c,
|
|
16948
16948
|
onDelete: u,
|
|
16949
|
-
isDeleting:
|
|
16949
|
+
isDeleting: p = !1,
|
|
16950
16950
|
defaultCountry: h = "US",
|
|
16951
|
-
languageIso:
|
|
16952
|
-
presentation:
|
|
16951
|
+
languageIso: v,
|
|
16952
|
+
presentation: _ = "dialog"
|
|
16953
16953
|
}) {
|
|
16954
|
-
const [
|
|
16954
|
+
const [b, f] = m.useState(!1), y = m.useId(), E = ii(), [w, z] = m.useState(null);
|
|
16955
16955
|
m.useEffect(() => {
|
|
16956
|
-
e ||
|
|
16956
|
+
e || f(!1);
|
|
16957
16957
|
}, [e]), m.useEffect(() => {
|
|
16958
|
-
if (!
|
|
16959
|
-
const I = setTimeout(() =>
|
|
16958
|
+
if (!b) return;
|
|
16959
|
+
const I = setTimeout(() => f(!1), 3e3);
|
|
16960
16960
|
return () => clearTimeout(I);
|
|
16961
|
-
}, [
|
|
16962
|
-
const j = m.useMemo(() => c(
|
|
16961
|
+
}, [b]);
|
|
16962
|
+
const j = m.useMemo(() => c(p ? "deleting" : b ? "tap_to_confirm" : "delete_address"), [p, b, c]), { control: $, handleSubmit: C, reset: F, setValue: P, setError: k, clearErrors: D } = Zr(lx, {
|
|
16963
16963
|
defaultValues: {
|
|
16964
16964
|
name: "",
|
|
16965
16965
|
address1: "",
|
|
@@ -16975,14 +16975,14 @@ function Hn({
|
|
|
16975
16975
|
m.useEffect(() => {
|
|
16976
16976
|
if (!E || !L) return;
|
|
16977
16977
|
let I = !1;
|
|
16978
|
-
return z(null), E.fetchAddressFields(L,
|
|
16978
|
+
return z(null), E.fetchAddressFields(L, v).then((J) => {
|
|
16979
16979
|
I || z([...J.address_fields.fields]);
|
|
16980
16980
|
}).catch(() => {
|
|
16981
16981
|
I || z(null);
|
|
16982
16982
|
}), () => {
|
|
16983
16983
|
I = !0;
|
|
16984
16984
|
};
|
|
16985
|
-
}, [E, L,
|
|
16985
|
+
}, [E, L, v]);
|
|
16986
16986
|
const B = m.useMemo(() => oi(w), [w]), Y = m.useMemo(
|
|
16987
16987
|
() => di(B),
|
|
16988
16988
|
[B]
|
|
@@ -17139,7 +17139,7 @@ function Hn({
|
|
|
17139
17139
|
open: e,
|
|
17140
17140
|
onOpenChange: (I) => !I && n(),
|
|
17141
17141
|
title: c(ve ? "edit_address" : "add_an_address"),
|
|
17142
|
-
presentation:
|
|
17142
|
+
presentation: _,
|
|
17143
17143
|
size: "wide",
|
|
17144
17144
|
children: [
|
|
17145
17145
|
/* @__PURE__ */ i.jsxs("div", { className: "space-y-3 pt-2", children: [
|
|
@@ -17175,9 +17175,9 @@ function Hn({
|
|
|
17175
17175
|
type: "button",
|
|
17176
17176
|
variant: "ghost",
|
|
17177
17177
|
onClick: () => {
|
|
17178
|
-
|
|
17178
|
+
b ? u() : f(!0);
|
|
17179
17179
|
},
|
|
17180
|
-
disabled: a ||
|
|
17180
|
+
disabled: a || p,
|
|
17181
17181
|
className: "text-destructive hover:bg-destructive/10 hover:text-destructive",
|
|
17182
17182
|
children: [
|
|
17183
17183
|
/* @__PURE__ */ i.jsx(yn, { className: "size-4" }),
|
|
@@ -17198,7 +17198,7 @@ function Hn({
|
|
|
17198
17198
|
id: "set_as_default_address",
|
|
17199
17199
|
checked: I.value,
|
|
17200
17200
|
onCheckedChange: (J) => I.onChange(J === !0),
|
|
17201
|
-
disabled: a ||
|
|
17201
|
+
disabled: a || p
|
|
17202
17202
|
}
|
|
17203
17203
|
),
|
|
17204
17204
|
/* @__PURE__ */ i.jsx(
|
|
@@ -17217,7 +17217,7 @@ function Hn({
|
|
|
17217
17217
|
{
|
|
17218
17218
|
type: "submit",
|
|
17219
17219
|
onClick: Q,
|
|
17220
|
-
disabled: a ||
|
|
17220
|
+
disabled: a || p,
|
|
17221
17221
|
children: [
|
|
17222
17222
|
a && /* @__PURE__ */ i.jsx("div", { className: "mr-2 size-4 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
|
|
17223
17223
|
c(a ? "saving" : "save_address")
|
|
@@ -17240,7 +17240,7 @@ const Ha = () => typeof window < "u" && window.VGSCollect || null, Da = {
|
|
|
17240
17240
|
function sx() {
|
|
17241
17241
|
const [e, n] = m.useState(!1), [t, r] = m.useState(!1), [a, s] = m.useState(!1), [o, d] = m.useState(
|
|
17242
17242
|
void 0
|
|
17243
|
-
), [c, u] = m.useState(Da),
|
|
17243
|
+
), [c, u] = m.useState(Da), p = m.useRef(null), h = m.useRef(null), v = m.useRef(null);
|
|
17244
17244
|
m.useEffect(() => {
|
|
17245
17245
|
if (typeof window > "u") return;
|
|
17246
17246
|
if (Ha()) {
|
|
@@ -17253,10 +17253,10 @@ function sx() {
|
|
|
17253
17253
|
const w = document.createElement("script");
|
|
17254
17254
|
w.src = "https://js.verygoodvault.com/vgs-collect/3.3.0/vgs-collect.js", w.async = !0, w.onload = () => s(!0), w.onerror = () => {
|
|
17255
17255
|
const z = "Failed to load payment form";
|
|
17256
|
-
d(z),
|
|
17256
|
+
d(z), v.current?.(z);
|
|
17257
17257
|
}, document.head.appendChild(w);
|
|
17258
17258
|
}, [a]);
|
|
17259
|
-
const
|
|
17259
|
+
const _ = m.useCallback(
|
|
17260
17260
|
(E) => {
|
|
17261
17261
|
E && u((w) => {
|
|
17262
17262
|
const z = { ...w };
|
|
@@ -17277,22 +17277,22 @@ function sx() {
|
|
|
17277
17277
|
});
|
|
17278
17278
|
},
|
|
17279
17279
|
[]
|
|
17280
|
-
),
|
|
17281
|
-
if (
|
|
17280
|
+
), b = m.useCallback(() => {
|
|
17281
|
+
if (p.current) {
|
|
17282
17282
|
try {
|
|
17283
|
-
|
|
17283
|
+
p.current.unmount();
|
|
17284
17284
|
} catch (E) {
|
|
17285
17285
|
console.warn("VGS unmount error", E);
|
|
17286
17286
|
}
|
|
17287
|
-
|
|
17287
|
+
p.current = null;
|
|
17288
17288
|
}
|
|
17289
17289
|
n(!1), u({ ...Da });
|
|
17290
|
-
}, []),
|
|
17290
|
+
}, []), f = m.useCallback(
|
|
17291
17291
|
async (E) => {
|
|
17292
17292
|
if (!a) return;
|
|
17293
17293
|
const w = Ha();
|
|
17294
17294
|
if (!w) {
|
|
17295
|
-
|
|
17295
|
+
v.current?.("Payment script not loaded");
|
|
17296
17296
|
return;
|
|
17297
17297
|
}
|
|
17298
17298
|
try {
|
|
@@ -17300,9 +17300,9 @@ function sx() {
|
|
|
17300
17300
|
const z = E.vault.environment === "sandbox" ? "sandbox" : "live-eu-1", j = w.create(
|
|
17301
17301
|
E.vault.vault_id,
|
|
17302
17302
|
z,
|
|
17303
|
-
(B) =>
|
|
17303
|
+
(B) => _(B)
|
|
17304
17304
|
);
|
|
17305
|
-
E.vault.route_id && j.setRouteId(E.vault.route_id),
|
|
17305
|
+
E.vault.route_id && j.setRouteId(E.vault.route_id), p.current = j;
|
|
17306
17306
|
let $ = 0;
|
|
17307
17307
|
const C = 20, F = 200, P = async () => [
|
|
17308
17308
|
"vgs-card-number",
|
|
@@ -17363,52 +17363,52 @@ function sx() {
|
|
|
17363
17363
|
validations: ["required"]
|
|
17364
17364
|
}), n(!0);
|
|
17365
17365
|
} catch (z) {
|
|
17366
|
-
console.error("Failed to initialize VGS:", z),
|
|
17366
|
+
console.error("Failed to initialize VGS:", z), v.current?.("Failed to initialize payment form");
|
|
17367
17367
|
} finally {
|
|
17368
17368
|
r(!1);
|
|
17369
17369
|
}
|
|
17370
17370
|
},
|
|
17371
|
-
[a,
|
|
17371
|
+
[a, _]
|
|
17372
17372
|
), y = m.useCallback(() => {
|
|
17373
|
-
if (!
|
|
17374
|
-
|
|
17373
|
+
if (!p.current) {
|
|
17374
|
+
v.current?.("Form not initialized");
|
|
17375
17375
|
return;
|
|
17376
17376
|
}
|
|
17377
|
-
|
|
17377
|
+
p.current.submit(
|
|
17378
17378
|
"/post",
|
|
17379
17379
|
{},
|
|
17380
17380
|
(E, w) => {
|
|
17381
|
-
E >= 200 && E < 400 ? h.current?.(w) :
|
|
17381
|
+
E >= 200 && E < 400 ? h.current?.(w) : v.current?.("Payment failed");
|
|
17382
17382
|
},
|
|
17383
17383
|
(E) => {
|
|
17384
17384
|
const w = Object.values(E).flat().filter(
|
|
17385
17385
|
($) => typeof $ == "string" && $.trim().length > 0 && $ !== "Required"
|
|
17386
17386
|
), z = Array.from(new Set(w));
|
|
17387
17387
|
let j = "Please verify your payment details.";
|
|
17388
|
-
z.length > 0 ? j = z.join(", ") : Object.values(E).flat().length > 0 && (j = "Please fill in all required fields."),
|
|
17388
|
+
z.length > 0 ? j = z.join(", ") : Object.values(E).flat().length > 0 && (j = "Please fill in all required fields."), v.current?.(j);
|
|
17389
17389
|
}
|
|
17390
17390
|
);
|
|
17391
17391
|
}, []);
|
|
17392
17392
|
return m.useEffect(() => () => {
|
|
17393
|
-
if (
|
|
17393
|
+
if (p.current) {
|
|
17394
17394
|
try {
|
|
17395
|
-
|
|
17395
|
+
p.current.unmount();
|
|
17396
17396
|
} catch (E) {
|
|
17397
17397
|
console.warn("VGS unmount error", E);
|
|
17398
17398
|
}
|
|
17399
|
-
|
|
17399
|
+
p.current = null;
|
|
17400
17400
|
}
|
|
17401
17401
|
}, []), {
|
|
17402
17402
|
isFormReady: e,
|
|
17403
17403
|
isLoading: t,
|
|
17404
17404
|
isScriptLoaded: a,
|
|
17405
17405
|
scriptLoadError: o,
|
|
17406
|
-
initializeForm:
|
|
17406
|
+
initializeForm: f,
|
|
17407
17407
|
submitCard: y,
|
|
17408
17408
|
vgsFieldState: c,
|
|
17409
|
-
resetVgs:
|
|
17409
|
+
resetVgs: b,
|
|
17410
17410
|
onSuccessRef: h,
|
|
17411
|
-
onErrorRef:
|
|
17411
|
+
onErrorRef: v
|
|
17412
17412
|
};
|
|
17413
17413
|
}
|
|
17414
17414
|
const pt = "__create_new__", ox = Ft({
|
|
@@ -17519,11 +17519,11 @@ function es({
|
|
|
17519
17519
|
shippingAddress: d,
|
|
17520
17520
|
savedAddresses: c = [],
|
|
17521
17521
|
defaultBillingAddressId: u,
|
|
17522
|
-
renderAddressFormDialog:
|
|
17522
|
+
renderAddressFormDialog: p,
|
|
17523
17523
|
t: h,
|
|
17524
|
-
presentation:
|
|
17524
|
+
presentation: v = "dialog"
|
|
17525
17525
|
}) {
|
|
17526
|
-
const
|
|
17526
|
+
const _ = $c(), [b, f] = m.useState(void 0), [y, E] = m.useState(!1), [w, z] = m.useState([]), [j, $] = m.useState(!1), {
|
|
17527
17527
|
isFormReady: C,
|
|
17528
17528
|
isLoading: F,
|
|
17529
17529
|
isScriptLoaded: P,
|
|
@@ -17603,24 +17603,24 @@ function es({
|
|
|
17603
17603
|
(R) => {
|
|
17604
17604
|
const X = R?.card_exp;
|
|
17605
17605
|
if (!X) {
|
|
17606
|
-
|
|
17606
|
+
f("Missing expiration date from payment form"), E(!1);
|
|
17607
17607
|
return;
|
|
17608
17608
|
}
|
|
17609
17609
|
const A = X.replace(/\s+/g, ""), [Ee, de] = A.split("/");
|
|
17610
17610
|
if (!Ee || !de) {
|
|
17611
|
-
|
|
17611
|
+
f("Invalid expiration date format"), E(!1);
|
|
17612
17612
|
return;
|
|
17613
17613
|
}
|
|
17614
17614
|
const he = de.length === 2 ? `20${de}` : de, He = R?.card_holder?.trim();
|
|
17615
17615
|
if (!He) {
|
|
17616
|
-
|
|
17616
|
+
f("Cardholder name is required"), E(!1);
|
|
17617
17617
|
return;
|
|
17618
17618
|
}
|
|
17619
17619
|
ve(
|
|
17620
17620
|
(Te) => {
|
|
17621
17621
|
const be = Number(Te.billing_address_selection);
|
|
17622
17622
|
if (!Number.isFinite(be)) {
|
|
17623
|
-
|
|
17623
|
+
f("Please select a billing address."), E(!1);
|
|
17624
17624
|
return;
|
|
17625
17625
|
}
|
|
17626
17626
|
const Le = S.card_number;
|
|
@@ -17640,13 +17640,13 @@ function es({
|
|
|
17640
17640
|
}), E(!1);
|
|
17641
17641
|
},
|
|
17642
17642
|
() => {
|
|
17643
|
-
|
|
17643
|
+
f("Please select a billing address."), E(!1);
|
|
17644
17644
|
}
|
|
17645
17645
|
)();
|
|
17646
17646
|
},
|
|
17647
17647
|
[ve, t, S]
|
|
17648
17648
|
), De = m.useCallback((R) => {
|
|
17649
|
-
|
|
17649
|
+
f(R), E(!1);
|
|
17650
17650
|
}, []);
|
|
17651
17651
|
m.useEffect(() => {
|
|
17652
17652
|
T.current = Fe, B.current = De;
|
|
@@ -17655,19 +17655,19 @@ function es({
|
|
|
17655
17655
|
let R = !1;
|
|
17656
17656
|
return (async () => {
|
|
17657
17657
|
try {
|
|
17658
|
-
const A = await
|
|
17658
|
+
const A = await _.vault.fetchCredentials(o);
|
|
17659
17659
|
R || await D(A);
|
|
17660
17660
|
} catch (A) {
|
|
17661
|
-
console.error("Failed to fetch vault credentials:", A), R ||
|
|
17661
|
+
console.error("Failed to fetch vault credentials:", A), R || f("Failed to initialize payment form");
|
|
17662
17662
|
}
|
|
17663
17663
|
})(), () => {
|
|
17664
17664
|
R = !0;
|
|
17665
17665
|
};
|
|
17666
|
-
}, [e, P, o,
|
|
17666
|
+
}, [e, P, o, _, D]);
|
|
17667
17667
|
const Ce = () => {
|
|
17668
|
-
a || (V(), I(),
|
|
17668
|
+
a || (V(), I(), f(void 0), E(!1), $(!1), n());
|
|
17669
17669
|
}, Pe = ve(() => {
|
|
17670
|
-
E(!0),
|
|
17670
|
+
E(!0), f(void 0), L();
|
|
17671
17671
|
}), q = r || y;
|
|
17672
17672
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
17673
17673
|
/* @__PURE__ */ i.jsx(
|
|
@@ -17676,7 +17676,7 @@ function es({
|
|
|
17676
17676
|
open: e,
|
|
17677
17677
|
onOpenChange: (R) => !R && Ce(),
|
|
17678
17678
|
title: h("add_credit_card"),
|
|
17679
|
-
presentation:
|
|
17679
|
+
presentation: v,
|
|
17680
17680
|
size: "wide",
|
|
17681
17681
|
children: /* @__PURE__ */ i.jsxs("div", { className: "relative min-w-0 pt-1", children: [
|
|
17682
17682
|
(F || !C) && !k && /* @__PURE__ */ i.jsx("div", { className: "bg-background/80 absolute inset-0 z-10 flex items-center justify-center rounded backdrop-blur-[1px]", children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-center", children: [
|
|
@@ -17688,7 +17688,7 @@ function es({
|
|
|
17688
17688
|
dx,
|
|
17689
17689
|
{
|
|
17690
17690
|
vgsFieldState: S,
|
|
17691
|
-
networkError:
|
|
17691
|
+
networkError: b ?? k ?? s
|
|
17692
17692
|
}
|
|
17693
17693
|
),
|
|
17694
17694
|
/* @__PURE__ */ i.jsxs("div", { className: "space-y-3 pt-2", children: [
|
|
@@ -17790,7 +17790,7 @@ function es({
|
|
|
17790
17790
|
] })
|
|
17791
17791
|
}
|
|
17792
17792
|
),
|
|
17793
|
-
|
|
17793
|
+
p?.({
|
|
17794
17794
|
isOpen: j,
|
|
17795
17795
|
onClose: () => $(!1),
|
|
17796
17796
|
onAddressCreated: ze
|
|
@@ -17844,11 +17844,11 @@ function mx({
|
|
|
17844
17844
|
);
|
|
17845
17845
|
m.useEffect(() => {
|
|
17846
17846
|
if (!e) return;
|
|
17847
|
-
const
|
|
17847
|
+
const p = setTimeout(() => {
|
|
17848
17848
|
o.current(d.current.timedOut);
|
|
17849
17849
|
}, 39e4);
|
|
17850
17850
|
return () => {
|
|
17851
|
-
clearTimeout(
|
|
17851
|
+
clearTimeout(p);
|
|
17852
17852
|
};
|
|
17853
17853
|
}, [e]);
|
|
17854
17854
|
const u = () => {
|
|
@@ -17921,24 +17921,24 @@ function px({
|
|
|
17921
17921
|
merchantTxId: o,
|
|
17922
17922
|
onCanceled: d
|
|
17923
17923
|
}) {
|
|
17924
|
-
const c = m.useRef(!1), u = m.useRef(!1),
|
|
17924
|
+
const c = m.useRef(!1), u = m.useRef(!1), p = m.useRef(n);
|
|
17925
17925
|
m.useEffect(() => {
|
|
17926
|
-
|
|
17926
|
+
p.current = n;
|
|
17927
17927
|
});
|
|
17928
17928
|
const h = m.useEffectEvent((y) => {
|
|
17929
17929
|
r(y);
|
|
17930
|
-
}),
|
|
17930
|
+
}), v = m.useEffectEvent((y) => {
|
|
17931
17931
|
a(y);
|
|
17932
|
-
}),
|
|
17932
|
+
}), _ = m.useEffectEvent(() => {
|
|
17933
17933
|
d?.();
|
|
17934
|
-
}),
|
|
17934
|
+
}), b = m.useEffectEvent(() => t()), f = m.useEffectEvent(
|
|
17935
17935
|
(y) => {
|
|
17936
17936
|
c.current || (c.current = !0, y.status === "success" ? h({
|
|
17937
17937
|
success: !0,
|
|
17938
17938
|
...y.merchantTxId && { merchantTxId: y.merchantTxId },
|
|
17939
17939
|
transactionId: y.transactionId ?? "",
|
|
17940
17940
|
status: y.status
|
|
17941
|
-
}) :
|
|
17941
|
+
}) : v(y.errorMessage || "3DS verification failed"));
|
|
17942
17942
|
}
|
|
17943
17943
|
);
|
|
17944
17944
|
m.useEffect(() => {
|
|
@@ -17947,14 +17947,14 @@ function px({
|
|
|
17947
17947
|
if (!s || !e || c.current || u.current)
|
|
17948
17948
|
return;
|
|
17949
17949
|
let y = !1;
|
|
17950
|
-
const E =
|
|
17950
|
+
const E = p.current;
|
|
17951
17951
|
u.current = !0;
|
|
17952
17952
|
const w = E.subscribe(e), z = !!w;
|
|
17953
17953
|
z || (console.error(
|
|
17954
17954
|
"[VGS 3DS] realtime subscribe returned null — using status polling only"
|
|
17955
17955
|
), u.current = !1);
|
|
17956
17956
|
const j = (F) => {
|
|
17957
|
-
y || Ta(o, F.merchant_transaction_id) &&
|
|
17957
|
+
y || Ta(o, F.merchant_transaction_id) && f({
|
|
17958
17958
|
status: F.status,
|
|
17959
17959
|
errorMessage: F.error_message,
|
|
17960
17960
|
transactionId: F.merchant_transaction_id,
|
|
@@ -17964,13 +17964,13 @@ function px({
|
|
|
17964
17964
|
z && w.bind("vgs_3ds_challenge", j);
|
|
17965
17965
|
const $ = setInterval(async () => {
|
|
17966
17966
|
if (c.current || y) return;
|
|
17967
|
-
const F = await
|
|
17968
|
-
y || !F || Ta(o, F.merchantTxId) && (F.completed ?
|
|
17967
|
+
const F = await b();
|
|
17968
|
+
y || !F || Ta(o, F.merchantTxId) && (F.completed ? f({ status: "success", merchantTxId: F.merchantTxId }) : F.failed ? f({
|
|
17969
17969
|
status: "failed",
|
|
17970
17970
|
errorMessage: F.errorMessage || `3DS verification ${F.status || "failed"}`
|
|
17971
|
-
}) : F.canceled && (c.current || (c.current = !0,
|
|
17971
|
+
}) : F.canceled && (c.current || (c.current = !0, _())));
|
|
17972
17972
|
}, hx), C = setTimeout(() => {
|
|
17973
|
-
c.current || y || (console.error("[VGS 3DS] Timed out waiting for 3DS result"),
|
|
17973
|
+
c.current || y || (console.error("[VGS 3DS] Timed out waiting for 3DS result"), f({
|
|
17974
17974
|
status: "failed",
|
|
17975
17975
|
errorMessage: "Payment verification timed out. Please try again."
|
|
17976
17976
|
}));
|
|
@@ -18126,16 +18126,16 @@ function ls({
|
|
|
18126
18126
|
onCanceled: r,
|
|
18127
18127
|
t: a
|
|
18128
18128
|
}) {
|
|
18129
|
-
const [s, o] = m.useState(null), [d, c] = m.useState(null), u = m.useRef(null),
|
|
18129
|
+
const [s, o] = m.useState(null), [d, c] = m.useState(null), u = m.useRef(null), p = m.useEffectEvent(
|
|
18130
18130
|
(F) => n(F)
|
|
18131
|
-
), h = m.useEffectEvent((F) => t(F)),
|
|
18131
|
+
), h = m.useEffectEvent((F) => t(F)), v = m.useEffectEvent(() => r()), _ = () => {
|
|
18132
18132
|
u.current = null, o(null), c(null);
|
|
18133
|
-
},
|
|
18134
|
-
u.current && (
|
|
18135
|
-
},
|
|
18136
|
-
u.current && (
|
|
18133
|
+
}, b = async (F) => {
|
|
18134
|
+
u.current && (_(), await p(F));
|
|
18135
|
+
}, f = (F) => {
|
|
18136
|
+
u.current && (_(), h(F));
|
|
18137
18137
|
}, y = () => {
|
|
18138
|
-
u.current && (
|
|
18138
|
+
u.current && (_(), v());
|
|
18139
18139
|
}, E = (F) => La(F) === "three_ds_session_not_found" ? a("payment_verification_timed_out") : bx(
|
|
18140
18140
|
F,
|
|
18141
18141
|
a("payment_verification_didnt_complete")
|
|
@@ -18162,11 +18162,11 @@ function ls({
|
|
|
18162
18162
|
session_token: S.sessionToken
|
|
18163
18163
|
});
|
|
18164
18164
|
if (V.status === "approved") {
|
|
18165
|
-
await
|
|
18165
|
+
await b(V);
|
|
18166
18166
|
return;
|
|
18167
18167
|
}
|
|
18168
18168
|
if (!V.challenge_form) {
|
|
18169
|
-
|
|
18169
|
+
f(a("payment_verification_didnt_complete"));
|
|
18170
18170
|
return;
|
|
18171
18171
|
}
|
|
18172
18172
|
c({
|
|
@@ -18174,7 +18174,7 @@ function ls({
|
|
|
18174
18174
|
url: V.challenge_url ?? void 0
|
|
18175
18175
|
});
|
|
18176
18176
|
} catch (V) {
|
|
18177
|
-
|
|
18177
|
+
f(E(V));
|
|
18178
18178
|
}
|
|
18179
18179
|
}, z = async (F) => {
|
|
18180
18180
|
const P = u.current;
|
|
@@ -18185,10 +18185,10 @@ function ls({
|
|
|
18185
18185
|
});
|
|
18186
18186
|
if (u.current !== P) return;
|
|
18187
18187
|
if (k.status === "approved") {
|
|
18188
|
-
await
|
|
18188
|
+
await b(k);
|
|
18189
18189
|
return;
|
|
18190
18190
|
}
|
|
18191
|
-
|
|
18191
|
+
f(a("payment_verification_didnt_complete"));
|
|
18192
18192
|
} catch (k) {
|
|
18193
18193
|
if (u.current !== P) return;
|
|
18194
18194
|
if (F && La(k) === "three_ds_pending") {
|
|
@@ -18196,7 +18196,7 @@ function ls({
|
|
|
18196
18196
|
await z(!1);
|
|
18197
18197
|
return;
|
|
18198
18198
|
}
|
|
18199
|
-
|
|
18199
|
+
f(E(k));
|
|
18200
18200
|
}
|
|
18201
18201
|
}, j = async () => {
|
|
18202
18202
|
const F = u.current;
|
|
@@ -18219,13 +18219,13 @@ function ls({
|
|
|
18219
18219
|
onComplete: () => {
|
|
18220
18220
|
z(!0);
|
|
18221
18221
|
},
|
|
18222
|
-
onError: (F) =>
|
|
18222
|
+
onError: (F) => f(F),
|
|
18223
18223
|
onCanceled: y
|
|
18224
18224
|
});
|
|
18225
18225
|
const $ = (F) => {
|
|
18226
18226
|
const P = u.current;
|
|
18227
18227
|
P && e.cancelPaymentMethod3DS({ session_token: P.sessionToken }).catch(() => {
|
|
18228
|
-
}), F ?
|
|
18228
|
+
}), F ? f(F) : y();
|
|
18229
18229
|
}, C = /* @__PURE__ */ i.jsx(
|
|
18230
18230
|
mx,
|
|
18231
18231
|
{
|
|
@@ -18411,29 +18411,29 @@ function Ax({
|
|
|
18411
18411
|
onBundleClick: a,
|
|
18412
18412
|
bundles: s = jx
|
|
18413
18413
|
}) {
|
|
18414
|
-
const { t: o } = se(), [d, c] = m.useState("all"), u = !!e && !n, { data:
|
|
18414
|
+
const { t: o } = se(), [d, c] = m.useState("all"), u = !!e && !n, { data: p } = gr(
|
|
18415
18415
|
{ customerId: e, limit: Or },
|
|
18416
18416
|
{ enabled: u && d === "all" }
|
|
18417
|
-
), h =
|
|
18418
|
-
data:
|
|
18419
|
-
isLoading:
|
|
18420
|
-
isError:
|
|
18417
|
+
), h = p?.pages[0]?.counts, v = h && d !== "all" ? d : void 0, {
|
|
18418
|
+
data: _,
|
|
18419
|
+
isLoading: b,
|
|
18420
|
+
isError: f,
|
|
18421
18421
|
refetch: y,
|
|
18422
18422
|
fetchNextPage: E,
|
|
18423
18423
|
hasNextPage: w,
|
|
18424
18424
|
isFetchingNextPage: z
|
|
18425
18425
|
} = gr(
|
|
18426
|
-
{ customerId: e, limit: Or, status:
|
|
18426
|
+
{ customerId: e, limit: Or, status: v },
|
|
18427
18427
|
{ enabled: u }
|
|
18428
18428
|
), j = m.useMemo(
|
|
18429
|
-
() =>
|
|
18430
|
-
[
|
|
18429
|
+
() => _?.pages.flatMap((S) => S.subscriptions) ?? [],
|
|
18430
|
+
[_]
|
|
18431
18431
|
), $ = m.useMemo(
|
|
18432
|
-
() =>
|
|
18433
|
-
[
|
|
18432
|
+
() => _?.pages[0]?.counts ?? h ?? $x(j),
|
|
18433
|
+
[_, h, j]
|
|
18434
18434
|
), C = m.useMemo(
|
|
18435
|
-
() =>
|
|
18436
|
-
[j,
|
|
18435
|
+
() => v ? j : j.filter((S) => hn(d, S)),
|
|
18436
|
+
[j, v, d]
|
|
18437
18437
|
), F = m.useMemo(
|
|
18438
18438
|
() => s.filter((S) => S.subscription_count > 1),
|
|
18439
18439
|
[s]
|
|
@@ -18472,7 +18472,7 @@ function Ax({
|
|
|
18472
18472
|
t: o
|
|
18473
18473
|
}
|
|
18474
18474
|
),
|
|
18475
|
-
|
|
18475
|
+
b || n ? /* @__PURE__ */ i.jsx("div", { className: "mt-8 grid grid-cols-1 gap-5 md:grid-cols-2", children: Array(4).fill(0).map((S, V) => /* @__PURE__ */ i.jsx(Vx, {}, V)) }) : f ? /* @__PURE__ */ i.jsx(qx, { onRetry: () => y(), t: o }) : C.length === 0 ? /* @__PURE__ */ i.jsx(Ux, { filtered: d !== "all", t: o }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
18476
18476
|
(k || D.length > 0) && // Single grid for bundle cards + regular subscription cards so
|
|
18477
18477
|
// they share rows. CSS Grid's default `align-items: stretch`
|
|
18478
18478
|
// makes every cell in the same row match heights, which is
|
|
@@ -18583,9 +18583,9 @@ function Tx({
|
|
|
18583
18583
|
t
|
|
18584
18584
|
}) {
|
|
18585
18585
|
const [r, a] = m.useState(!1), { isMobile: s } = mt(), o = e.subscriptions.reduce(
|
|
18586
|
-
(h,
|
|
18586
|
+
(h, v) => h + v.price * (v.quantity ?? 1),
|
|
18587
18587
|
0
|
|
18588
|
-
), d = e.next_bill_date ? Dn(e.next_bill_date) : null, c = e.subscriptions.slice(0, kx), u = e.subscriptions.length - c.length,
|
|
18588
|
+
), d = e.next_bill_date ? Dn(e.next_bill_date) : null, c = e.subscriptions.slice(0, kx), u = e.subscriptions.length - c.length, p = (h) => {
|
|
18589
18589
|
n(h), a(!1);
|
|
18590
18590
|
};
|
|
18591
18591
|
return /* @__PURE__ */ i.jsxs("div", { className: "ring-border hover:ring-foreground/10 relative flex flex-col gap-4 rounded-2xl bg-transparent p-5 shadow-sm ring-1 transition-all duration-300 hover:shadow-lg", children: [
|
|
@@ -18600,7 +18600,7 @@ function Tx({
|
|
|
18600
18600
|
ur,
|
|
18601
18601
|
{
|
|
18602
18602
|
sub: h,
|
|
18603
|
-
onClick: () =>
|
|
18603
|
+
onClick: () => p(h.subscription_token),
|
|
18604
18604
|
t
|
|
18605
18605
|
},
|
|
18606
18606
|
h.subscription_token
|
|
@@ -18625,7 +18625,7 @@ function Tx({
|
|
|
18625
18625
|
ur,
|
|
18626
18626
|
{
|
|
18627
18627
|
sub: h,
|
|
18628
|
-
onClick: () =>
|
|
18628
|
+
onClick: () => p(h.subscription_token),
|
|
18629
18629
|
t
|
|
18630
18630
|
},
|
|
18631
18631
|
h.subscription_token
|
|
@@ -18652,7 +18652,7 @@ function Tx({
|
|
|
18652
18652
|
ur,
|
|
18653
18653
|
{
|
|
18654
18654
|
sub: h,
|
|
18655
|
-
onClick: () =>
|
|
18655
|
+
onClick: () => p(h.subscription_token),
|
|
18656
18656
|
t
|
|
18657
18657
|
},
|
|
18658
18658
|
h.subscription_token
|
|
@@ -18754,12 +18754,12 @@ function Ix({
|
|
|
18754
18754
|
onResume: t,
|
|
18755
18755
|
t: r
|
|
18756
18756
|
}) {
|
|
18757
|
-
const a = yt(e.status, r), s = Zt(e.variant), o = e.quantity ?? 1, d = a.kind === "paused", c = a.kind === "cancelled", u = a.kind === "past_due",
|
|
18757
|
+
const a = yt(e.status, r), s = Zt(e.variant), o = e.quantity ?? 1, d = a.kind === "paused", c = a.kind === "cancelled", u = a.kind === "past_due", p = gl(e.subscription_plan, r), h = e.next_bill_date ? Dn(e.next_bill_date) : null, v = e.last_bill_date ? Dn(e.last_bill_date) : null, _ = u && e.next_bill_date ? Math.max(
|
|
18758
18758
|
0,
|
|
18759
18759
|
Math.round(
|
|
18760
18760
|
(Date.now() - new Date(e.next_bill_date).getTime()) / (1e3 * 60 * 60 * 24)
|
|
18761
18761
|
)
|
|
18762
|
-
) : 0,
|
|
18762
|
+
) : 0, b = Nx(e.last_bill_date, e.next_bill_date, r), f = b != null && !d && !c && !u;
|
|
18763
18763
|
return /* @__PURE__ */ i.jsxs(
|
|
18764
18764
|
"div",
|
|
18765
18765
|
{
|
|
@@ -18784,7 +18784,7 @@ function Ix({
|
|
|
18784
18784
|
/* @__PURE__ */ i.jsxs("div", { className: "min-w-0 flex-1 pt-1", children: [
|
|
18785
18785
|
/* @__PURE__ */ i.jsx("div", { className: "text-foreground truncate text-base font-bold", children: e.variant.product.title || r("list_product_fallback") }),
|
|
18786
18786
|
s && /* @__PURE__ */ i.jsx("div", { className: "text-foreground/80 mt-0.5 truncate text-sm", children: s }),
|
|
18787
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mt-0.5 text-sm", children:
|
|
18787
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mt-0.5 text-sm", children: p }),
|
|
18788
18788
|
(d || c || u) && /* @__PURE__ */ i.jsxs(
|
|
18789
18789
|
"div",
|
|
18790
18790
|
{
|
|
@@ -18807,8 +18807,8 @@ function Ix({
|
|
|
18807
18807
|
"div",
|
|
18808
18808
|
{
|
|
18809
18809
|
className: `text-sm font-bold ${u ? "text-destructive" : "text-foreground"}`,
|
|
18810
|
-
children: u ?
|
|
18811
|
-
n: String(
|
|
18810
|
+
children: u ? _ === 1 ? r("list_bill_due_1_day_ago") : _ > 0 ? r("list_bill_due_n_days_ago", {
|
|
18811
|
+
n: String(_)
|
|
18812
18812
|
}) : r("list_bill_overdue") : r(d ? "list_last_bill_label" : "list_next_bill_label")
|
|
18813
18813
|
}
|
|
18814
18814
|
),
|
|
@@ -18819,7 +18819,7 @@ function Ix({
|
|
|
18819
18819
|
"div",
|
|
18820
18820
|
{
|
|
18821
18821
|
className: `mt-1 text-base font-bold tracking-tight tabular-nums ${u ? "text-destructive" : "text-foreground"}`,
|
|
18822
|
-
children: (d ?
|
|
18822
|
+
children: (d ? v : h) ?? "—"
|
|
18823
18823
|
}
|
|
18824
18824
|
)
|
|
18825
18825
|
] }),
|
|
@@ -18840,7 +18840,7 @@ function Ix({
|
|
|
18840
18840
|
] })
|
|
18841
18841
|
] })
|
|
18842
18842
|
] }),
|
|
18843
|
-
|
|
18843
|
+
f && b && /* @__PURE__ */ i.jsx(Ox, { cycle: b })
|
|
18844
18844
|
]
|
|
18845
18845
|
}
|
|
18846
18846
|
),
|
|
@@ -19010,7 +19010,7 @@ function Gx({
|
|
|
19010
19010
|
}) {
|
|
19011
19011
|
const [s, o] = m.useState(1), [d, c] = m.useState(
|
|
19012
19012
|
() => /* @__PURE__ */ new Set()
|
|
19013
|
-
), u = m.useMemo(() => /* @__PURE__ */ new Date(), []), [
|
|
19013
|
+
), u = m.useMemo(() => /* @__PURE__ */ new Date(), []), [p, h] = m.useState(u.getFullYear()), [v, _] = m.useState(null), [b, f] = m.useState(null), [y, E] = m.useState(
|
|
19014
19014
|
() => Ra(n, r)
|
|
19015
19015
|
), [w, z] = m.useState(() => Va(t, a));
|
|
19016
19016
|
m.useEffect(() => {
|
|
@@ -19038,33 +19038,33 @@ function Gx({
|
|
|
19038
19038
|
return { today: u, maxDate: Wd(B, u) };
|
|
19039
19039
|
}, [d, e, u]), C = m.useCallback(
|
|
19040
19040
|
(B) => {
|
|
19041
|
-
if (h(B),
|
|
19042
|
-
if (yl(B,
|
|
19043
|
-
|
|
19041
|
+
if (h(B), v != null) {
|
|
19042
|
+
if (yl(B, v, $)) {
|
|
19043
|
+
_(null), f(null);
|
|
19044
19044
|
return;
|
|
19045
19045
|
}
|
|
19046
|
-
|
|
19046
|
+
b != null && fn(B, v, b, $) && f(null);
|
|
19047
19047
|
}
|
|
19048
19048
|
},
|
|
19049
|
-
[
|
|
19049
|
+
[v, b, $]
|
|
19050
19050
|
), F = m.useCallback(
|
|
19051
19051
|
(B) => {
|
|
19052
|
-
|
|
19052
|
+
_(B), b != null && fn(p, B, b, $) && f(null);
|
|
19053
19053
|
},
|
|
19054
|
-
[
|
|
19055
|
-
), P = m.useCallback((B) =>
|
|
19056
|
-
if (
|
|
19057
|
-
const B = String(
|
|
19058
|
-
return `${
|
|
19059
|
-
}, [
|
|
19054
|
+
[b, p, $]
|
|
19055
|
+
), P = m.useCallback((B) => f(B), []), k = d.size >= 2, D = v !== null && b !== null && fn(p, v, b, $), L = v !== null && b !== null && !D, S = y != null, V = w != null, T = m.useMemo(() => {
|
|
19056
|
+
if (v == null || b == null) return null;
|
|
19057
|
+
const B = String(v + 1).padStart(2, "0"), Y = String(b).padStart(2, "0");
|
|
19058
|
+
return `${p}-${B}-${Y}`;
|
|
19059
|
+
}, [p, v, b]);
|
|
19060
19060
|
return {
|
|
19061
19061
|
step: s,
|
|
19062
19062
|
setStep: o,
|
|
19063
19063
|
selectedTokens: d,
|
|
19064
19064
|
toggleToken: j,
|
|
19065
|
-
selectedYear:
|
|
19066
|
-
selectedMonth:
|
|
19067
|
-
selectedDay:
|
|
19065
|
+
selectedYear: p,
|
|
19066
|
+
selectedMonth: v,
|
|
19067
|
+
selectedDay: b,
|
|
19068
19068
|
setYear: C,
|
|
19069
19069
|
setMonth: F,
|
|
19070
19070
|
setDay: P,
|
|
@@ -19254,7 +19254,7 @@ function Zx({
|
|
|
19254
19254
|
const { t: d } = se(), c = o.today.getFullYear(), u = m.useMemo(
|
|
19255
19255
|
() => [c, c + 1, c + 2],
|
|
19256
19256
|
[c]
|
|
19257
|
-
),
|
|
19257
|
+
), p = (b) => us(b, o), h = (b) => yl(e, b, o), v = n == null ? 31 : cs(e, n), _ = (b) => n == null ? !0 : fn(e, n, b, o);
|
|
19258
19258
|
return /* @__PURE__ */ i.jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children: [
|
|
19259
19259
|
/* @__PURE__ */ i.jsxs("div", { className: "mt-2", children: [
|
|
19260
19260
|
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground text-sm font-bold", children: d("bundle_select_new_bill_date") }),
|
|
@@ -19262,53 +19262,53 @@ function Zx({
|
|
|
19262
19262
|
] }),
|
|
19263
19263
|
/* @__PURE__ */ i.jsxs("div", { className: "mt-6", children: [
|
|
19264
19264
|
/* @__PURE__ */ i.jsx("h4", { className: "text-foreground mb-3 text-xs font-bold", children: d("bundle_year") }),
|
|
19265
|
-
/* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-3 gap-2", children: u.map((
|
|
19266
|
-
const
|
|
19265
|
+
/* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-3 gap-2", children: u.map((b) => {
|
|
19266
|
+
const f = e === b, y = p(b);
|
|
19267
19267
|
return /* @__PURE__ */ i.jsx(
|
|
19268
19268
|
"button",
|
|
19269
19269
|
{
|
|
19270
19270
|
type: "button",
|
|
19271
19271
|
disabled: y,
|
|
19272
|
-
onClick: () => r(
|
|
19273
|
-
className: `rounded-lg px-3 py-2.5 text-xs font-semibold transition-all ${
|
|
19274
|
-
children:
|
|
19272
|
+
onClick: () => r(b),
|
|
19273
|
+
className: `rounded-lg px-3 py-2.5 text-xs font-semibold transition-all ${f ? "bg-primary text-primary-foreground" : "text-foreground ring-border hover:ring-foreground/20 bg-transparent ring-1"} ${y ? "cursor-not-allowed opacity-40" : ""}`,
|
|
19274
|
+
children: b
|
|
19275
19275
|
},
|
|
19276
|
-
|
|
19276
|
+
b
|
|
19277
19277
|
);
|
|
19278
19278
|
}) })
|
|
19279
19279
|
] }),
|
|
19280
19280
|
/* @__PURE__ */ i.jsxs("div", { className: "mt-6", children: [
|
|
19281
19281
|
/* @__PURE__ */ i.jsx("h4", { className: "text-foreground mb-3 text-xs font-bold", children: d("bundle_month") }),
|
|
19282
|
-
/* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-4 gap-2", children: Xx.map((
|
|
19283
|
-
const y = n ===
|
|
19282
|
+
/* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-4 gap-2", children: Xx.map((b, f) => {
|
|
19283
|
+
const y = n === f, E = h(f);
|
|
19284
19284
|
return /* @__PURE__ */ i.jsx(
|
|
19285
19285
|
"button",
|
|
19286
19286
|
{
|
|
19287
19287
|
type: "button",
|
|
19288
19288
|
disabled: E,
|
|
19289
|
-
onClick: () => a(
|
|
19289
|
+
onClick: () => a(f),
|
|
19290
19290
|
className: `rounded-lg px-3 py-2.5 text-xs font-semibold transition-all ${y ? "bg-primary text-primary-foreground" : "text-foreground ring-border hover:ring-foreground/20 bg-transparent ring-1"} ${E ? "cursor-not-allowed opacity-40" : ""}`,
|
|
19291
|
-
children:
|
|
19291
|
+
children: b
|
|
19292
19292
|
},
|
|
19293
|
-
|
|
19293
|
+
b
|
|
19294
19294
|
);
|
|
19295
19295
|
}) })
|
|
19296
19296
|
] }),
|
|
19297
19297
|
/* @__PURE__ */ i.jsxs("div", { className: "mt-6", children: [
|
|
19298
19298
|
/* @__PURE__ */ i.jsx("h4", { className: "text-foreground mb-3 text-xs font-bold", children: d("bundle_day") }),
|
|
19299
|
-
/* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-8 gap-1.5", children: Array.from({ length:
|
|
19300
|
-
(
|
|
19301
|
-
const
|
|
19299
|
+
/* @__PURE__ */ i.jsx("div", { className: "grid grid-cols-8 gap-1.5", children: Array.from({ length: v }, (b, f) => f + 1).map(
|
|
19300
|
+
(b) => {
|
|
19301
|
+
const f = t === b, y = _(b);
|
|
19302
19302
|
return /* @__PURE__ */ i.jsx(
|
|
19303
19303
|
"button",
|
|
19304
19304
|
{
|
|
19305
19305
|
type: "button",
|
|
19306
19306
|
disabled: y,
|
|
19307
|
-
onClick: () => s(
|
|
19308
|
-
className: `rounded-lg py-2 text-xs font-semibold transition-all ${
|
|
19309
|
-
children:
|
|
19307
|
+
onClick: () => s(b),
|
|
19308
|
+
className: `rounded-lg py-2 text-xs font-semibold transition-all ${f ? "bg-primary text-primary-foreground" : "text-foreground ring-border hover:ring-foreground/20 bg-transparent ring-1"} ${y ? "cursor-not-allowed opacity-40" : ""}`,
|
|
19309
|
+
children: b
|
|
19310
19310
|
},
|
|
19311
|
-
|
|
19311
|
+
b
|
|
19312
19312
|
);
|
|
19313
19313
|
}
|
|
19314
19314
|
) })
|
|
@@ -19334,7 +19334,7 @@ function Jx({
|
|
|
19334
19334
|
/* @__PURE__ */ i.jsx("span", { className: "text-foreground font-semibold", children: Dn(a) })
|
|
19335
19335
|
] }),
|
|
19336
19336
|
/* @__PURE__ */ i.jsx("div", { className: "mt-4 space-y-2", role: "radiogroup", children: e.map((d, c) => {
|
|
19337
|
-
const u = n === d.id,
|
|
19337
|
+
const u = n === d.id, p = d.default || !o && c === 0;
|
|
19338
19338
|
return /* @__PURE__ */ i.jsxs(
|
|
19339
19339
|
"button",
|
|
19340
19340
|
{
|
|
@@ -19360,7 +19360,7 @@ function Jx({
|
|
|
19360
19360
|
/* @__PURE__ */ i.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
19361
19361
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
19362
19362
|
d.name && /* @__PURE__ */ i.jsx("p", { className: "text-foreground truncate text-xs font-bold", children: d.name }),
|
|
19363
|
-
|
|
19363
|
+
p && /* @__PURE__ */ i.jsx("span", { className: "text-foreground ring-border rounded-full bg-transparent px-2 py-0.5 text-xs font-bold ring-1", children: s("bundle_default_badge") })
|
|
19364
19364
|
] }),
|
|
19365
19365
|
/* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground mt-0.5 truncate text-xs", children: d.address1 }),
|
|
19366
19366
|
/* @__PURE__ */ i.jsxs("p", { className: "text-muted-foreground truncate text-xs", children: [
|
|
@@ -19396,7 +19396,7 @@ function ey({
|
|
|
19396
19396
|
const o = e.filter(xl), d = o.findIndex((u) => u.default);
|
|
19397
19397
|
if (d <= 0) return o;
|
|
19398
19398
|
const c = o[d];
|
|
19399
|
-
return c ? [c, ...o.filter((u,
|
|
19399
|
+
return c ? [c, ...o.filter((u, p) => p !== d)] : o;
|
|
19400
19400
|
}, [e]);
|
|
19401
19401
|
return /* @__PURE__ */ i.jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto px-6 py-4", children: [
|
|
19402
19402
|
/* @__PURE__ */ i.jsxs("div", { className: "mt-2", children: [
|
|
@@ -19470,80 +19470,80 @@ function ty({
|
|
|
19470
19470
|
onAddAddress: d,
|
|
19471
19471
|
onAddPaymentMethod: c,
|
|
19472
19472
|
onSubmit: u,
|
|
19473
|
-
isSubmitting:
|
|
19473
|
+
isSubmitting: p,
|
|
19474
19474
|
isLoadingSubscriptions: h,
|
|
19475
|
-
hasIncompleteSubscriptions:
|
|
19475
|
+
hasIncompleteSubscriptions: v
|
|
19476
19476
|
}) {
|
|
19477
|
-
const { t:
|
|
19477
|
+
const { t: _ } = se(), { isMobile: b } = mt(), f = Gx({
|
|
19478
19478
|
subscriptions: t,
|
|
19479
19479
|
addresses: r,
|
|
19480
19480
|
paymentMethods: a,
|
|
19481
19481
|
defaultAddressId: s,
|
|
19482
19482
|
defaultPaymentMethodId: o
|
|
19483
19483
|
}), y = () => n(!1), E = () => {
|
|
19484
|
-
|
|
19484
|
+
f.step < 4 && f.setStep(f.step + 1);
|
|
19485
19485
|
}, w = () => {
|
|
19486
|
-
|
|
19486
|
+
f.step === 1 ? y() : f.setStep(f.step - 1);
|
|
19487
19487
|
}, z = async () => {
|
|
19488
|
-
!j || !
|
|
19489
|
-
subscription_tokens: Array.from(
|
|
19490
|
-
next_bill_date:
|
|
19491
|
-
address_id:
|
|
19492
|
-
payment_method_id:
|
|
19488
|
+
!j || !f.canProceedFromStep2 || !f.canProceedFromStep3 || !f.canProceedFromStep4 || f.formattedDate == null || f.selectedAddressId == null || f.selectedPaymentMethodId == null || await u({
|
|
19489
|
+
subscription_tokens: Array.from(f.selectedTokens),
|
|
19490
|
+
next_bill_date: f.formattedDate,
|
|
19491
|
+
address_id: f.selectedAddressId,
|
|
19492
|
+
payment_method_id: f.selectedPaymentMethodId
|
|
19493
19493
|
});
|
|
19494
|
-
}, j =
|
|
19494
|
+
}, j = f.canProceedFromStep1 && !h, $ = f.step === 1 && !j || f.step === 2 && !f.canProceedFromStep2 || f.step === 3 && !f.canProceedFromStep3, C = /* @__PURE__ */ i.jsxs(
|
|
19495
19495
|
"div",
|
|
19496
19496
|
{
|
|
19497
|
-
className:
|
|
19497
|
+
className: b ? "flex min-h-[65dvh] flex-col" : "flex min-h-0 flex-1 flex-col",
|
|
19498
19498
|
children: [
|
|
19499
19499
|
/* @__PURE__ */ i.jsx(
|
|
19500
19500
|
Kx,
|
|
19501
19501
|
{
|
|
19502
|
-
step:
|
|
19503
|
-
onStepClick:
|
|
19502
|
+
step: f.step,
|
|
19503
|
+
onStepClick: f.setStep,
|
|
19504
19504
|
canProceedFromStep1: j,
|
|
19505
|
-
canProceedFromStep2:
|
|
19506
|
-
canProceedFromStep3:
|
|
19505
|
+
canProceedFromStep2: f.canProceedFromStep2,
|
|
19506
|
+
canProceedFromStep3: f.canProceedFromStep3
|
|
19507
19507
|
}
|
|
19508
19508
|
),
|
|
19509
|
-
|
|
19509
|
+
f.step === 1 && /* @__PURE__ */ i.jsx(
|
|
19510
19510
|
Qx,
|
|
19511
19511
|
{
|
|
19512
19512
|
subscriptions: t,
|
|
19513
|
-
selectedTokens:
|
|
19514
|
-
onToggle:
|
|
19513
|
+
selectedTokens: f.selectedTokens,
|
|
19514
|
+
onToggle: f.toggleToken,
|
|
19515
19515
|
isLoading: h,
|
|
19516
|
-
hasFailed:
|
|
19516
|
+
hasFailed: v
|
|
19517
19517
|
}
|
|
19518
19518
|
),
|
|
19519
|
-
|
|
19519
|
+
f.step === 2 && /* @__PURE__ */ i.jsx(
|
|
19520
19520
|
Zx,
|
|
19521
19521
|
{
|
|
19522
|
-
selectedYear:
|
|
19523
|
-
selectedMonth:
|
|
19524
|
-
selectedDay:
|
|
19525
|
-
onYearChange:
|
|
19526
|
-
onMonthChange:
|
|
19527
|
-
onDayChange:
|
|
19528
|
-
bounds:
|
|
19522
|
+
selectedYear: f.selectedYear,
|
|
19523
|
+
selectedMonth: f.selectedMonth,
|
|
19524
|
+
selectedDay: f.selectedDay,
|
|
19525
|
+
onYearChange: f.setYear,
|
|
19526
|
+
onMonthChange: f.setMonth,
|
|
19527
|
+
onDayChange: f.setDay,
|
|
19528
|
+
bounds: f.bounds
|
|
19529
19529
|
}
|
|
19530
19530
|
),
|
|
19531
|
-
|
|
19531
|
+
f.step === 3 && /* @__PURE__ */ i.jsx(
|
|
19532
19532
|
Jx,
|
|
19533
19533
|
{
|
|
19534
19534
|
addresses: r,
|
|
19535
|
-
selectedAddressId:
|
|
19536
|
-
onAddressSelect:
|
|
19535
|
+
selectedAddressId: f.selectedAddressId,
|
|
19536
|
+
onAddressSelect: f.setSelectedAddressId,
|
|
19537
19537
|
onAddAddress: d,
|
|
19538
|
-
formattedSelectedDate:
|
|
19538
|
+
formattedSelectedDate: f.formattedDate
|
|
19539
19539
|
}
|
|
19540
19540
|
),
|
|
19541
|
-
|
|
19541
|
+
f.step === 4 && /* @__PURE__ */ i.jsx(
|
|
19542
19542
|
ey,
|
|
19543
19543
|
{
|
|
19544
19544
|
paymentMethods: a,
|
|
19545
|
-
selectedPaymentMethodId:
|
|
19546
|
-
onPaymentMethodSelect:
|
|
19545
|
+
selectedPaymentMethodId: f.selectedPaymentMethodId,
|
|
19546
|
+
onPaymentMethodSelect: f.setSelectedPaymentMethodId,
|
|
19547
19547
|
onAddPaymentMethod: c
|
|
19548
19548
|
}
|
|
19549
19549
|
),
|
|
@@ -19554,38 +19554,38 @@ function ty({
|
|
|
19554
19554
|
type: "button",
|
|
19555
19555
|
onClick: w,
|
|
19556
19556
|
className: "text-foreground ring-border hover:bg-muted rounded-lg bg-transparent px-6 py-2.5 text-xs font-bold ring-1 transition-all",
|
|
19557
|
-
children:
|
|
19557
|
+
children: f.step === 1 ? _("bundle_done") : _("bundle_back")
|
|
19558
19558
|
}
|
|
19559
19559
|
),
|
|
19560
|
-
|
|
19560
|
+
f.step < 4 ? /* @__PURE__ */ i.jsx(
|
|
19561
19561
|
"button",
|
|
19562
19562
|
{
|
|
19563
19563
|
type: "button",
|
|
19564
19564
|
onClick: E,
|
|
19565
19565
|
disabled: $,
|
|
19566
19566
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 rounded-lg px-6 py-2.5 text-xs font-bold transition-all disabled:cursor-not-allowed disabled:opacity-40",
|
|
19567
|
-
children:
|
|
19567
|
+
children: _("next")
|
|
19568
19568
|
}
|
|
19569
19569
|
) : /* @__PURE__ */ i.jsx(
|
|
19570
19570
|
"button",
|
|
19571
19571
|
{
|
|
19572
19572
|
type: "button",
|
|
19573
19573
|
onClick: z,
|
|
19574
|
-
disabled: !
|
|
19574
|
+
disabled: !f.canProceedFromStep4 || p,
|
|
19575
19575
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 inline-flex min-w-[140px] items-center justify-center rounded-lg px-6 py-2.5 text-xs font-bold transition-all disabled:cursor-not-allowed disabled:opacity-40",
|
|
19576
|
-
children:
|
|
19576
|
+
children: p ? /* @__PURE__ */ i.jsx("span", { className: "border-primary-foreground size-5 animate-spin rounded-full border-2 border-t-transparent" }) : _("bundle_create")
|
|
19577
19577
|
}
|
|
19578
19578
|
)
|
|
19579
19579
|
] })
|
|
19580
19580
|
]
|
|
19581
19581
|
}
|
|
19582
19582
|
);
|
|
19583
|
-
return
|
|
19583
|
+
return b ? /* @__PURE__ */ i.jsx(
|
|
19584
19584
|
Ur,
|
|
19585
19585
|
{
|
|
19586
19586
|
open: e,
|
|
19587
19587
|
onOpenChange: n,
|
|
19588
|
-
title:
|
|
19588
|
+
title: _("bundle_subscriptions"),
|
|
19589
19589
|
children: C
|
|
19590
19590
|
}
|
|
19591
19591
|
) : /* @__PURE__ */ i.jsx(Qs, { open: e, onOpenChange: n, children: /* @__PURE__ */ i.jsxs(
|
|
@@ -19594,7 +19594,7 @@ function ty({
|
|
|
19594
19594
|
side: "right",
|
|
19595
19595
|
className: "bg-background flex h-full w-full flex-col gap-0 p-0 sm:max-w-md",
|
|
19596
19596
|
children: [
|
|
19597
|
-
/* @__PURE__ */ i.jsx("div", { className: "border-border flex items-center justify-between border-b px-6 py-4", children: /* @__PURE__ */ i.jsx(Zs, { className: "text-foreground text-base font-bold", children:
|
|
19597
|
+
/* @__PURE__ */ i.jsx("div", { className: "border-border flex items-center justify-between border-b px-6 py-4", children: /* @__PURE__ */ i.jsx(Zs, { className: "text-foreground text-base font-bold", children: _("bundle_subscriptions") }) }),
|
|
19598
19598
|
C
|
|
19599
19599
|
]
|
|
19600
19600
|
}
|
|
@@ -19656,11 +19656,11 @@ function ry({
|
|
|
19656
19656
|
isLoadingCustomer: n,
|
|
19657
19657
|
onToast: t
|
|
19658
19658
|
}) {
|
|
19659
|
-
const { isMobile: r } = mt(), { navigate: a } = t1(), s = Me(), o = rn(), d = qr(), { t: c } = se(), { t: u } = lt(), { config:
|
|
19659
|
+
const { isMobile: r } = mt(), { navigate: a } = t1(), s = Me(), o = rn(), d = qr(), { t: c } = se(), { t: u } = lt(), { config: p } = n1(), { locale: h } = In(), { data: v } = Lo(), _ = !!v?.bundle_subscriptions_enabled, { data: b = [] } = je({
|
|
19660
19660
|
queryKey: we.addresses.list(),
|
|
19661
19661
|
queryFn: async () => (await o.fetchAddresses()).addresses.map(Ua),
|
|
19662
19662
|
enabled: !!e && !n
|
|
19663
|
-
}), { data:
|
|
19663
|
+
}), { data: f = [] } = je({
|
|
19664
19664
|
queryKey: we.paymentMethods.list(),
|
|
19665
19665
|
queryFn: async () => (await o.fetchPaymentMethods()).payment_methods.map(rs),
|
|
19666
19666
|
enabled: !!e && !n
|
|
@@ -19682,7 +19682,7 @@ function ry({
|
|
|
19682
19682
|
),
|
|
19683
19683
|
[$]
|
|
19684
19684
|
), F = y?.pages[0]?.counts, P = F ? F.all - F.cancelled : C.length, { data: k } = Vd({
|
|
19685
|
-
enabled: !!e && !n &&
|
|
19685
|
+
enabled: !!e && !n && _
|
|
19686
19686
|
}), [D, L] = m.useState(!1), S = m.useRef(!1);
|
|
19687
19687
|
m.useEffect(() => {
|
|
19688
19688
|
if (!D) {
|
|
@@ -19720,7 +19720,7 @@ function ry({
|
|
|
19720
19720
|
// record when an identical address already exists, ignoring `name`). Snapshot
|
|
19721
19721
|
// the current id set before the request and compare against the returned id.
|
|
19722
19722
|
mutationFn: async (A) => {
|
|
19723
|
-
const Ee = new Set(
|
|
19723
|
+
const Ee = new Set(b.map((he) => he.id)), de = await o.createAddress({
|
|
19724
19724
|
address: {
|
|
19725
19725
|
name: A.address.name,
|
|
19726
19726
|
street1: A.address.address1,
|
|
@@ -19821,11 +19821,11 @@ function ry({
|
|
|
19821
19821
|
isLoadingCustomer: n,
|
|
19822
19822
|
onSubscriptionClick: X,
|
|
19823
19823
|
onResume: (A) => X(A.subscription_token),
|
|
19824
|
-
onBundleClick:
|
|
19825
|
-
bundles:
|
|
19824
|
+
onBundleClick: _ && P >= 2 ? q : void 0,
|
|
19825
|
+
bundles: _ ? k : void 0
|
|
19826
19826
|
}
|
|
19827
19827
|
),
|
|
19828
|
-
|
|
19828
|
+
_ && /* @__PURE__ */ i.jsx(
|
|
19829
19829
|
ty,
|
|
19830
19830
|
{
|
|
19831
19831
|
open: D,
|
|
@@ -19833,10 +19833,10 @@ function ry({
|
|
|
19833
19833
|
subscriptions: C,
|
|
19834
19834
|
isLoadingSubscriptions: V,
|
|
19835
19835
|
hasIncompleteSubscriptions: j && w,
|
|
19836
|
-
addresses:
|
|
19837
|
-
paymentMethods:
|
|
19838
|
-
defaultAddressId:
|
|
19839
|
-
defaultPaymentMethodId:
|
|
19836
|
+
addresses: b,
|
|
19837
|
+
paymentMethods: f,
|
|
19838
|
+
defaultAddressId: b.find((A) => A.default)?.id ?? b[0]?.id ?? null,
|
|
19839
|
+
defaultPaymentMethodId: f.find((A) => A.default)?.id ?? f[0]?.id ?? null,
|
|
19840
19840
|
onAddAddress: () => W({ open: !0, selected: null }),
|
|
19841
19841
|
onAddPaymentMethod: () => ie(!0),
|
|
19842
19842
|
onSubmit: R,
|
|
@@ -19851,7 +19851,7 @@ function ry({
|
|
|
19851
19851
|
isOpen: Y.open,
|
|
19852
19852
|
onClose: () => W({ open: !1, selected: null }),
|
|
19853
19853
|
selectedAddress: Y.selected,
|
|
19854
|
-
defaultCountry:
|
|
19854
|
+
defaultCountry: b.find((A) => A.default)?.country_code ?? p.countryIso ?? "US",
|
|
19855
19855
|
languageIso: h,
|
|
19856
19856
|
t: mr,
|
|
19857
19857
|
onSubmit: async (A) => {
|
|
@@ -19884,8 +19884,8 @@ function ry({
|
|
|
19884
19884
|
},
|
|
19885
19885
|
isSubmitting: De.isPending,
|
|
19886
19886
|
jwt: "",
|
|
19887
|
-
savedAddresses:
|
|
19888
|
-
defaultBillingAddressId:
|
|
19887
|
+
savedAddresses: b,
|
|
19888
|
+
defaultBillingAddressId: b.find((A) => A.default)?.id,
|
|
19889
19889
|
renderAddressFormDialog: ({ isOpen: A, onClose: Ee, onAddressCreated: de }) => /* @__PURE__ */ i.jsx(
|
|
19890
19890
|
Hn,
|
|
19891
19891
|
{
|
|
@@ -19893,7 +19893,7 @@ function ry({
|
|
|
19893
19893
|
isOpen: A,
|
|
19894
19894
|
onClose: Ee,
|
|
19895
19895
|
selectedAddress: null,
|
|
19896
|
-
defaultCountry:
|
|
19896
|
+
defaultCountry: b.find((he) => he.default)?.country_code ?? p.countryIso ?? "US",
|
|
19897
19897
|
languageIso: h,
|
|
19898
19898
|
t: mr,
|
|
19899
19899
|
onSubmit: async (he) => {
|
|
@@ -19927,60 +19927,61 @@ function ay({
|
|
|
19927
19927
|
onConfirm: t,
|
|
19928
19928
|
onPauseInstead: r,
|
|
19929
19929
|
errorMessage: a,
|
|
19930
|
-
|
|
19930
|
+
isPending: s = !1,
|
|
19931
|
+
presentation: o = "dialog"
|
|
19931
19932
|
}) {
|
|
19932
|
-
const { t:
|
|
19933
|
+
const { t: d } = se(), [c, u] = m.useState(!1), p = c || s, [h, v] = m.useState(
|
|
19933
19934
|
null
|
|
19934
19935
|
);
|
|
19935
19936
|
m.useEffect(() => {
|
|
19936
|
-
e ||
|
|
19937
|
+
e || v(null);
|
|
19937
19938
|
}, [e]);
|
|
19938
|
-
const
|
|
19939
|
-
const
|
|
19940
|
-
if (!(
|
|
19939
|
+
const _ = async () => {
|
|
19940
|
+
const f = t();
|
|
19941
|
+
if (!(f instanceof Promise)) {
|
|
19941
19942
|
n(!1);
|
|
19942
19943
|
return;
|
|
19943
19944
|
}
|
|
19944
|
-
|
|
19945
|
+
u(!0);
|
|
19945
19946
|
try {
|
|
19946
|
-
await
|
|
19947
|
-
} catch (
|
|
19948
|
-
console.error("CancelSubscriptionDialog: action rejected",
|
|
19947
|
+
await f, n(!1);
|
|
19948
|
+
} catch (y) {
|
|
19949
|
+
console.error("CancelSubscriptionDialog: action rejected", y);
|
|
19949
19950
|
} finally {
|
|
19950
|
-
|
|
19951
|
+
u(!1);
|
|
19951
19952
|
}
|
|
19952
|
-
},
|
|
19953
|
-
|
|
19953
|
+
}, b = () => {
|
|
19954
|
+
h && r(h);
|
|
19954
19955
|
};
|
|
19955
19956
|
return /* @__PURE__ */ i.jsxs(
|
|
19956
19957
|
Ve,
|
|
19957
19958
|
{
|
|
19958
19959
|
open: e,
|
|
19959
|
-
onOpenChange: (
|
|
19960
|
-
title:
|
|
19961
|
-
description:
|
|
19960
|
+
onOpenChange: (f) => !p && n(f),
|
|
19961
|
+
title: d("cancel_dialog_title"),
|
|
19962
|
+
description: d("cancel_dialog_description"),
|
|
19962
19963
|
role: "alertdialog",
|
|
19963
|
-
presentation:
|
|
19964
|
+
presentation: o,
|
|
19964
19965
|
children: [
|
|
19965
19966
|
/* @__PURE__ */ i.jsxs("div", { className: "border-border space-y-2 rounded-md border p-3", children: [
|
|
19966
|
-
/* @__PURE__ */ i.jsx("p", { className: "text-foreground text-sm font-medium", children:
|
|
19967
|
+
/* @__PURE__ */ i.jsx("p", { className: "text-foreground text-sm font-medium", children: d("cancel_dialog_pause_question") }),
|
|
19967
19968
|
/* @__PURE__ */ i.jsx(
|
|
19968
19969
|
$e,
|
|
19969
19970
|
{
|
|
19970
19971
|
htmlFor: "cancel-pause-months",
|
|
19971
19972
|
className: "text-foreground text-sm font-semibold",
|
|
19972
|
-
children:
|
|
19973
|
+
children: d("pause_for")
|
|
19973
19974
|
}
|
|
19974
19975
|
),
|
|
19975
19976
|
/* @__PURE__ */ i.jsxs(
|
|
19976
19977
|
Wr,
|
|
19977
19978
|
{
|
|
19978
|
-
value:
|
|
19979
|
-
onValueChange: (
|
|
19980
|
-
disabled:
|
|
19979
|
+
value: h ? String(h) : void 0,
|
|
19980
|
+
onValueChange: (f) => v(f ? Number(f) : null),
|
|
19981
|
+
disabled: p,
|
|
19981
19982
|
children: [
|
|
19982
|
-
/* @__PURE__ */ i.jsx(Kr, { id: "cancel-pause-months", className: "w-full", children: /* @__PURE__ */ i.jsx(Yr, { placeholder:
|
|
19983
|
-
/* @__PURE__ */ i.jsx(Qr, { children: ly.map((
|
|
19983
|
+
/* @__PURE__ */ i.jsx(Kr, { id: "cancel-pause-months", className: "w-full", children: /* @__PURE__ */ i.jsx(Yr, { placeholder: d("select_duration") }) }),
|
|
19984
|
+
/* @__PURE__ */ i.jsx(Qr, { children: ly.map((f) => /* @__PURE__ */ i.jsx(Xr, { value: String(f), children: f === 1 ? d("month_singular", { count: String(f) }) : d("month_plural", { count: String(f) }) }, f)) })
|
|
19984
19985
|
]
|
|
19985
19986
|
}
|
|
19986
19987
|
),
|
|
@@ -19988,10 +19989,10 @@ function ay({
|
|
|
19988
19989
|
Z,
|
|
19989
19990
|
{
|
|
19990
19991
|
variant: "outline",
|
|
19991
|
-
onClick:
|
|
19992
|
-
disabled:
|
|
19992
|
+
onClick: b,
|
|
19993
|
+
disabled: p || !h,
|
|
19993
19994
|
className: "w-full",
|
|
19994
|
-
children:
|
|
19995
|
+
children: d("cancel_dialog_pause_button")
|
|
19995
19996
|
}
|
|
19996
19997
|
)
|
|
19997
19998
|
] }),
|
|
@@ -20002,17 +20003,17 @@ function ay({
|
|
|
20002
20003
|
{
|
|
20003
20004
|
variant: "secondary",
|
|
20004
20005
|
onClick: () => n(!1),
|
|
20005
|
-
disabled:
|
|
20006
|
-
children:
|
|
20006
|
+
disabled: p,
|
|
20007
|
+
children: d("cancel_dialog_cancel_button")
|
|
20007
20008
|
}
|
|
20008
20009
|
),
|
|
20009
20010
|
/* @__PURE__ */ i.jsx(
|
|
20010
20011
|
Z,
|
|
20011
20012
|
{
|
|
20012
20013
|
variant: "destructive",
|
|
20013
|
-
onClick:
|
|
20014
|
-
disabled:
|
|
20015
|
-
children:
|
|
20014
|
+
onClick: _,
|
|
20015
|
+
disabled: p,
|
|
20016
|
+
children: d(p ? "loading_ellipsis" : "cancel_dialog_confirm_button")
|
|
20016
20017
|
}
|
|
20017
20018
|
)
|
|
20018
20019
|
] })
|
|
@@ -20146,35 +20147,35 @@ function uy({
|
|
|
20146
20147
|
billingIntervalUnit: d = "month",
|
|
20147
20148
|
presentation: c = "dialog"
|
|
20148
20149
|
}) {
|
|
20149
|
-
const { t: u, locale:
|
|
20150
|
+
const { t: u, locale: p } = se(), [h, v] = m.useState("indefinite"), [_, b] = m.useState(
|
|
20150
20151
|
null
|
|
20151
|
-
),
|
|
20152
|
+
), f = Yd(
|
|
20152
20153
|
o,
|
|
20153
20154
|
d,
|
|
20154
20155
|
s
|
|
20155
20156
|
), y = Array.from(
|
|
20156
|
-
{ length:
|
|
20157
|
+
{ length: f },
|
|
20157
20158
|
(C, F) => F + 1
|
|
20158
|
-
), E =
|
|
20159
|
+
), E = _ && s ? q1(
|
|
20159
20160
|
o,
|
|
20160
20161
|
d,
|
|
20161
|
-
|
|
20162
|
+
_,
|
|
20162
20163
|
s
|
|
20163
20164
|
) : null;
|
|
20164
20165
|
m.useEffect(() => {
|
|
20165
|
-
e && (
|
|
20166
|
+
e && (v("indefinite"), b(null));
|
|
20166
20167
|
}, [e]);
|
|
20167
20168
|
const w = () => {
|
|
20168
20169
|
if (h === "indefinite") {
|
|
20169
20170
|
t({ type: "indefinite" });
|
|
20170
20171
|
return;
|
|
20171
20172
|
}
|
|
20172
|
-
h === "order_count" &&
|
|
20173
|
+
h === "order_count" && _ && t({
|
|
20173
20174
|
type: "order_count",
|
|
20174
|
-
numberOfOrders:
|
|
20175
|
+
numberOfOrders: _
|
|
20175
20176
|
});
|
|
20176
20177
|
}, z = (C) => {
|
|
20177
|
-
C || (
|
|
20178
|
+
C || (v("indefinite"), b(null)), n(C);
|
|
20178
20179
|
}, j = (() => {
|
|
20179
20180
|
if (h === "indefinite")
|
|
20180
20181
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
@@ -20184,15 +20185,15 @@ function uy({
|
|
|
20184
20185
|
" ",
|
|
20185
20186
|
u("pause_indefinite_message_suffix")
|
|
20186
20187
|
] });
|
|
20187
|
-
if (!
|
|
20188
|
-
const C = E ? kn(E,
|
|
20188
|
+
if (!_) return null;
|
|
20189
|
+
const C = E ? kn(E, p) : u("a_future_date");
|
|
20189
20190
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
20190
20191
|
u("pause_resume_message_prefix"),
|
|
20191
20192
|
" ",
|
|
20192
20193
|
/* @__PURE__ */ i.jsx("span", { className: "font-semibold", children: C }),
|
|
20193
20194
|
u("pause_resume_message_suffix")
|
|
20194
20195
|
] });
|
|
20195
|
-
})(), $ = h === "order_count" && !
|
|
20196
|
+
})(), $ = h === "order_count" && !_;
|
|
20196
20197
|
return /* @__PURE__ */ i.jsxs(
|
|
20197
20198
|
Ve,
|
|
20198
20199
|
{
|
|
@@ -20210,7 +20211,7 @@ function uy({
|
|
|
20210
20211
|
id: "pause-indefinitely",
|
|
20211
20212
|
type: "radio",
|
|
20212
20213
|
checked: h === "indefinite",
|
|
20213
|
-
onChange: () =>
|
|
20214
|
+
onChange: () => v("indefinite"),
|
|
20214
20215
|
className: "border-border accent-primary size-4 focus:ring-0"
|
|
20215
20216
|
}
|
|
20216
20217
|
),
|
|
@@ -20231,8 +20232,8 @@ function uy({
|
|
|
20231
20232
|
id: "pause-order-count",
|
|
20232
20233
|
type: "radio",
|
|
20233
20234
|
checked: h === "order_count",
|
|
20234
|
-
onChange: () =>
|
|
20235
|
-
disabled:
|
|
20235
|
+
onChange: () => v("order_count"),
|
|
20236
|
+
disabled: f === 0,
|
|
20236
20237
|
className: "border-border accent-primary size-4 focus:ring-0 disabled:opacity-40"
|
|
20237
20238
|
}
|
|
20238
20239
|
),
|
|
@@ -20240,7 +20241,7 @@ function uy({
|
|
|
20240
20241
|
$e,
|
|
20241
20242
|
{
|
|
20242
20243
|
htmlFor: "pause-order-count",
|
|
20243
|
-
className: `text-sm font-medium ${
|
|
20244
|
+
className: `text-sm font-medium ${f === 0 ? "text-muted-foreground cursor-not-allowed" : "text-foreground cursor-pointer"}`,
|
|
20244
20245
|
children: u("pause_for_orders")
|
|
20245
20246
|
}
|
|
20246
20247
|
)
|
|
@@ -20250,8 +20251,8 @@ function uy({
|
|
|
20250
20251
|
/* @__PURE__ */ i.jsxs(
|
|
20251
20252
|
"select",
|
|
20252
20253
|
{
|
|
20253
|
-
value:
|
|
20254
|
-
onChange: (C) =>
|
|
20254
|
+
value: _ ?? "",
|
|
20255
|
+
onChange: (C) => b(Number(C.target.value)),
|
|
20255
20256
|
className: "border-input bg-background focus:border-ring focus:ring-ring h-10 w-full rounded-md border px-3 py-2 text-sm focus:ring-2 focus:outline-hidden",
|
|
20256
20257
|
children: [
|
|
20257
20258
|
/* @__PURE__ */ i.jsx("option", { value: "", disabled: !0, children: u("select") }),
|
|
@@ -20302,21 +20303,21 @@ function hy({
|
|
|
20302
20303
|
defaultNextBillDate: s,
|
|
20303
20304
|
presentation: o = "dialog"
|
|
20304
20305
|
}) {
|
|
20305
|
-
const { t: d, locale: c } = se(), [u,
|
|
20306
|
-
|
|
20307
|
-
const y = en(
|
|
20306
|
+
const { t: d, locale: c } = se(), [u, p] = m.useState(void 0), [h, v] = m.useState(!1), [_, b] = m.useState(null), f = /* @__PURE__ */ new Date();
|
|
20307
|
+
f.setHours(0, 0, 0, 0);
|
|
20308
|
+
const y = en(f, 1);
|
|
20308
20309
|
m.useEffect(() => {
|
|
20309
20310
|
if (e)
|
|
20310
20311
|
if (s) {
|
|
20311
20312
|
const z = vt(s);
|
|
20312
|
-
|
|
20313
|
+
p(z < y ? y : z);
|
|
20313
20314
|
} else
|
|
20314
|
-
|
|
20315
|
+
p(y);
|
|
20315
20316
|
}, [e, s]);
|
|
20316
20317
|
const E = () => {
|
|
20317
20318
|
u && t(st(u, "yyyy-MM-dd"));
|
|
20318
20319
|
}, w = (z) => {
|
|
20319
|
-
z || (
|
|
20320
|
+
z || (p(void 0), v(!1)), n(z);
|
|
20320
20321
|
};
|
|
20321
20322
|
return /* @__PURE__ */ i.jsxs(
|
|
20322
20323
|
Ve,
|
|
@@ -20330,7 +20331,7 @@ function hy({
|
|
|
20330
20331
|
children: [
|
|
20331
20332
|
/* @__PURE__ */ i.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ i.jsxs("div", { className: "space-y-2", children: [
|
|
20332
20333
|
/* @__PURE__ */ i.jsx($e, { className: "text-foreground text-sm font-semibold", children: d("resume_date") }),
|
|
20333
|
-
/* @__PURE__ */ i.jsx(r1, { container:
|
|
20334
|
+
/* @__PURE__ */ i.jsx(r1, { container: _, children: /* @__PURE__ */ i.jsxs(Vn, { open: h, onOpenChange: v, children: [
|
|
20334
20335
|
/* @__PURE__ */ i.jsx(Un, { asChild: !0, children: /* @__PURE__ */ i.jsxs(
|
|
20335
20336
|
Z,
|
|
20336
20337
|
{
|
|
@@ -20357,7 +20358,7 @@ function hy({
|
|
|
20357
20358
|
mode: "single",
|
|
20358
20359
|
selected: u,
|
|
20359
20360
|
onSelect: (z) => {
|
|
20360
|
-
|
|
20361
|
+
p(z), v(!1);
|
|
20361
20362
|
},
|
|
20362
20363
|
disabled: (z) => z < y,
|
|
20363
20364
|
defaultMonth: u,
|
|
@@ -20376,7 +20377,7 @@ function hy({
|
|
|
20376
20377
|
/* @__PURE__ */ i.jsx(
|
|
20377
20378
|
"div",
|
|
20378
20379
|
{
|
|
20379
|
-
ref:
|
|
20380
|
+
ref: b,
|
|
20380
20381
|
className: "pointer-events-none fixed inset-0 z-[9998]"
|
|
20381
20382
|
}
|
|
20382
20383
|
),
|
|
@@ -20449,9 +20450,9 @@ function vy({
|
|
|
20449
20450
|
billingIntervalUnit: d = "month",
|
|
20450
20451
|
otherSubscriptions: c,
|
|
20451
20452
|
onNavigateToSubscription: u,
|
|
20452
|
-
presentation:
|
|
20453
|
+
presentation: p = "dialog"
|
|
20453
20454
|
}) {
|
|
20454
|
-
const { t: h, locale:
|
|
20455
|
+
const { t: h, locale: v } = se(), [_, b] = m.useState(void 0), [f, y] = m.useState(!1), [E, w] = m.useState(null), z = /* @__PURE__ */ new Date();
|
|
20455
20456
|
z.setHours(0, 0, 0, 0);
|
|
20456
20457
|
const j = en(z, 1), $ = wn(
|
|
20457
20458
|
o,
|
|
@@ -20505,17 +20506,17 @@ function vy({
|
|
|
20505
20506
|
if (e)
|
|
20506
20507
|
if (s) {
|
|
20507
20508
|
const S = vt(s);
|
|
20508
|
-
|
|
20509
|
+
b(
|
|
20509
20510
|
S < j ? j : S > $ ? $ : S
|
|
20510
20511
|
);
|
|
20511
20512
|
} else
|
|
20512
|
-
|
|
20513
|
+
b(void 0);
|
|
20513
20514
|
}, [e, s]);
|
|
20514
20515
|
const k = () => {
|
|
20515
|
-
|
|
20516
|
+
_ && t(st(_, "yyyy-MM-dd"));
|
|
20516
20517
|
}, D = (S) => {
|
|
20517
|
-
S || (
|
|
20518
|
-
}, L =
|
|
20518
|
+
S || (b(void 0), y(!1)), n(S);
|
|
20519
|
+
}, L = _ ? kn(_, v) : s ? kn(vt(s), v) : h("a_future_date");
|
|
20519
20520
|
return /* @__PURE__ */ i.jsxs(
|
|
20520
20521
|
Ve,
|
|
20521
20522
|
{
|
|
@@ -20523,23 +20524,23 @@ function vy({
|
|
|
20523
20524
|
onOpenChange: D,
|
|
20524
20525
|
title: h("edit_bill_date_title"),
|
|
20525
20526
|
description: h("edit_bill_date_description"),
|
|
20526
|
-
presentation:
|
|
20527
|
+
presentation: p,
|
|
20527
20528
|
contentOverflow: "visible",
|
|
20528
20529
|
children: [
|
|
20529
20530
|
/* @__PURE__ */ i.jsxs("div", { className: "space-y-4", children: [
|
|
20530
20531
|
/* @__PURE__ */ i.jsxs("div", { className: "space-y-2", children: [
|
|
20531
20532
|
/* @__PURE__ */ i.jsx($e, { className: "text-foreground text-sm font-semibold", children: h("next_bill_date_label") }),
|
|
20532
|
-
/* @__PURE__ */ i.jsx(r1, { container: E, children: /* @__PURE__ */ i.jsxs(Vn, { open:
|
|
20533
|
+
/* @__PURE__ */ i.jsx(r1, { container: E, children: /* @__PURE__ */ i.jsxs(Vn, { open: f, onOpenChange: y, children: [
|
|
20533
20534
|
/* @__PURE__ */ i.jsx(Un, { asChild: !0, children: /* @__PURE__ */ i.jsxs(
|
|
20534
20535
|
Z,
|
|
20535
20536
|
{
|
|
20536
20537
|
variant: "outline",
|
|
20537
20538
|
className: ne(
|
|
20538
20539
|
"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground h-9 w-full justify-start border px-3 py-2 text-left font-normal",
|
|
20539
|
-
!
|
|
20540
|
+
!_ && "text-muted-foreground hover:text-muted-foreground"
|
|
20540
20541
|
),
|
|
20541
20542
|
children: [
|
|
20542
|
-
|
|
20543
|
+
_ ? st(_, "MM/dd/yyyy") : /* @__PURE__ */ i.jsx("span", { children: h("date_placeholder") }),
|
|
20543
20544
|
/* @__PURE__ */ i.jsx(E1, { className: "text-muted-foreground ml-auto size-4" })
|
|
20544
20545
|
]
|
|
20545
20546
|
}
|
|
@@ -20554,12 +20555,12 @@ function vy({
|
|
|
20554
20555
|
l1,
|
|
20555
20556
|
{
|
|
20556
20557
|
mode: "single",
|
|
20557
|
-
selected:
|
|
20558
|
+
selected: _,
|
|
20558
20559
|
onSelect: (S) => {
|
|
20559
|
-
|
|
20560
|
+
b(S), y(!1);
|
|
20560
20561
|
},
|
|
20561
20562
|
disabled: (S) => S < j || S > $,
|
|
20562
|
-
defaultMonth:
|
|
20563
|
+
defaultMonth: _ ?? (s ? vt(s) : void 0),
|
|
20563
20564
|
components: P,
|
|
20564
20565
|
initialFocus: !0
|
|
20565
20566
|
}
|
|
@@ -20575,7 +20576,7 @@ function vy({
|
|
|
20575
20576
|
className: "pointer-events-none fixed inset-0 z-[9998]"
|
|
20576
20577
|
}
|
|
20577
20578
|
),
|
|
20578
|
-
|
|
20579
|
+
_ && /* @__PURE__ */ i.jsxs("div", { className: "text-muted-foreground text-xs", children: [
|
|
20579
20580
|
h("bill_date_preview_prefix"),
|
|
20580
20581
|
" ",
|
|
20581
20582
|
/* @__PURE__ */ i.jsx("span", { className: "font-semibold", children: L }),
|
|
@@ -20624,7 +20625,7 @@ function vy({
|
|
|
20624
20625
|
),
|
|
20625
20626
|
/* @__PURE__ */ i.jsx("td", { className: "text-muted-foreground px-3 py-2 whitespace-nowrap", children: S.nextBillDate ? cy(
|
|
20626
20627
|
vt(S.nextBillDate),
|
|
20627
|
-
|
|
20628
|
+
v
|
|
20628
20629
|
) : "—" })
|
|
20629
20630
|
] }, S.token)) })
|
|
20630
20631
|
] }) })
|
|
@@ -20647,7 +20648,7 @@ function vy({
|
|
|
20647
20648
|
type: "button",
|
|
20648
20649
|
className: "h-10 min-w-[70px] rounded p-3",
|
|
20649
20650
|
onClick: k,
|
|
20650
|
-
disabled: !
|
|
20651
|
+
disabled: !_ || r,
|
|
20651
20652
|
children: r ? /* @__PURE__ */ i.jsx("div", { className: "border-primary-foreground size-5 animate-spin rounded-full border-4 border-t-4 border-t-transparent" }) : h("edit_bill_date_action")
|
|
20652
20653
|
}
|
|
20653
20654
|
)
|
|
@@ -20703,15 +20704,15 @@ function yy({
|
|
|
20703
20704
|
isRetryingPayment: d = !1,
|
|
20704
20705
|
isCheckingWaiver: c = !1,
|
|
20705
20706
|
recoveryDisabled: u = !1,
|
|
20706
|
-
className:
|
|
20707
|
+
className: p
|
|
20707
20708
|
}) {
|
|
20708
|
-
const { t: h } = se(),
|
|
20709
|
+
const { t: h } = se(), v = n != null, _ = v && (t ?? 0) >= 2, b = v ? e ? h("past_due_banner_heading_retry_scheduled_for_product", {
|
|
20709
20710
|
product: e
|
|
20710
|
-
}) : h("past_due_banner_heading_retry_scheduled") : e ? h("past_due_banner_heading_for_product", { product: e }) : h("past_due_banner_heading"),
|
|
20711
|
+
}) : h("past_due_banner_heading_retry_scheduled") : e ? h("past_due_banner_heading_for_product", { product: e }) : h("past_due_banner_heading"), f = (() => {
|
|
20711
20712
|
if (!n) return h("past_due_retry_when_shortly");
|
|
20712
20713
|
const w = new Date(n).getTime() - Date.now();
|
|
20713
20714
|
return w < 6e4 ? h("past_due_retry_when_shortly") : w < 720 * 60 * 1e3 ? h("past_due_retry_when_few_hours") : h("past_due_retry_when_within_day");
|
|
20714
|
-
})(), y =
|
|
20715
|
+
})(), y = _ ? h("past_due_banner_body_retry_failed", { when: f }) : h(v ? "past_due_banner_body_retry_scheduled" : "past_due_banner_body"), E = o ? h("retry_saved_payment", { method: o }) : h("retry_payment");
|
|
20715
20716
|
return /* @__PURE__ */ i.jsx(
|
|
20716
20717
|
"div",
|
|
20717
20718
|
{
|
|
@@ -20719,13 +20720,13 @@ function yy({
|
|
|
20719
20720
|
"aria-live": "polite",
|
|
20720
20721
|
className: Tn(
|
|
20721
20722
|
"border-destructive/50 bg-background rounded-xl border p-4 shadow-sm sm:p-5",
|
|
20722
|
-
|
|
20723
|
+
p
|
|
20723
20724
|
),
|
|
20724
20725
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex items-start gap-3 sm:gap-4", children: [
|
|
20725
20726
|
/* @__PURE__ */ i.jsx("div", { className: "bg-destructive/10 text-destructive mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-full", children: /* @__PURE__ */ i.jsx(e2, { className: "size-4", "aria-hidden": !0 }) }),
|
|
20726
20727
|
/* @__PURE__ */ i.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
|
|
20727
20728
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
20728
|
-
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground text-base font-bold tracking-tight sm:text-lg", children:
|
|
20729
|
+
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground text-base font-bold tracking-tight sm:text-lg", children: b }),
|
|
20729
20730
|
/* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground text-sm leading-relaxed", children: y })
|
|
20730
20731
|
] }),
|
|
20731
20732
|
(a || r) && /* @__PURE__ */ i.jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
@@ -20799,7 +20800,7 @@ function by({
|
|
|
20799
20800
|
nextShipDate: n.next_ship_date,
|
|
20800
20801
|
locale: c,
|
|
20801
20802
|
timezone: t
|
|
20802
|
-
}) : null,
|
|
20803
|
+
}) : null, p = n?.eligible === !0 && u != null, h = /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
20803
20804
|
u != null && /* @__PURE__ */ i.jsx("div", { className: "border-border bg-muted/60 rounded-lg border px-4 py-3", children: u.kind === "combined" ? /* @__PURE__ */ i.jsx("p", { className: "text-foreground text-sm font-medium", children: d("failed_cycle_waiver_next_bill_and_ship", {
|
|
20804
20805
|
date: u.date
|
|
20805
20806
|
}) }) : /* @__PURE__ */ i.jsxs("div", { className: "space-y-1", children: [
|
|
@@ -20826,7 +20827,7 @@ function by({
|
|
|
20826
20827
|
{
|
|
20827
20828
|
type: "button",
|
|
20828
20829
|
onClick: s,
|
|
20829
|
-
disabled: !
|
|
20830
|
+
disabled: !p || r,
|
|
20830
20831
|
"aria-busy": r,
|
|
20831
20832
|
children: [
|
|
20832
20833
|
r && /* @__PURE__ */ i.jsx(
|
|
@@ -20841,21 +20842,21 @@ function by({
|
|
|
20841
20842
|
}
|
|
20842
20843
|
)
|
|
20843
20844
|
] })
|
|
20844
|
-
] }),
|
|
20845
|
-
r || a(
|
|
20845
|
+
] }), v = (_) => {
|
|
20846
|
+
r || a(_);
|
|
20846
20847
|
};
|
|
20847
20848
|
return o === "bottom-sheet" ? /* @__PURE__ */ i.jsx(
|
|
20848
20849
|
Ve,
|
|
20849
20850
|
{
|
|
20850
20851
|
open: e,
|
|
20851
|
-
onOpenChange:
|
|
20852
|
+
onOpenChange: v,
|
|
20852
20853
|
title: d("failed_cycle_waiver_dialog_title"),
|
|
20853
20854
|
description: d("failed_cycle_waiver_dialog_description"),
|
|
20854
20855
|
presentation: "bottom-sheet",
|
|
20855
20856
|
size: "compact",
|
|
20856
20857
|
children: h
|
|
20857
20858
|
}
|
|
20858
|
-
) : /* @__PURE__ */ i.jsx(d1, { open: e, onOpenChange:
|
|
20859
|
+
) : /* @__PURE__ */ i.jsx(d1, { open: e, onOpenChange: v, children: /* @__PURE__ */ i.jsxs(
|
|
20859
20860
|
c1,
|
|
20860
20861
|
{
|
|
20861
20862
|
className: "rounded-xl sm:max-w-md",
|
|
@@ -20877,22 +20878,22 @@ function _y({
|
|
|
20877
20878
|
onNavigateToSubscription: r
|
|
20878
20879
|
}) {
|
|
20879
20880
|
const { t: a, locale: s } = se(), o = e.filter(
|
|
20880
|
-
(
|
|
20881
|
+
(f) => f.subscription_token !== n
|
|
20881
20882
|
), d = o[0];
|
|
20882
20883
|
if (!d)
|
|
20883
20884
|
return null;
|
|
20884
|
-
const c = t.billing_interval_unit.toLowerCase(), u = t.billing_interval,
|
|
20885
|
+
const c = t.billing_interval_unit.toLowerCase(), u = t.billing_interval, p = hs[c], h = a("bundled_with_cadence_n_units", {
|
|
20885
20886
|
n: String(u),
|
|
20886
|
-
unit:
|
|
20887
|
+
unit: p ? a(u === 1 ? p.singular : p.plural) : t.billing_interval_unit
|
|
20887
20888
|
});
|
|
20888
|
-
let
|
|
20889
|
-
u === 1 && c === "day" ?
|
|
20889
|
+
let v;
|
|
20890
|
+
u === 1 && c === "day" ? v = a("list_cadence_daily") : u === 1 && c === "week" ? v = a("list_cadence_weekly") : u === 1 && c === "month" ? v = a("list_cadence_monthly") : u === 1 && c === "year" ? v = a("list_cadence_yearly") : u === 3 && c === "month" ? v = a("list_cadence_quarterly") : v = a("list_cadence_every_n_units", {
|
|
20890
20891
|
n: String(u),
|
|
20891
|
-
unit:
|
|
20892
|
+
unit: p ? a(p.plural) : t.billing_interval_unit
|
|
20892
20893
|
});
|
|
20893
|
-
const
|
|
20894
|
-
cadence:
|
|
20895
|
-
}),
|
|
20894
|
+
const _ = a("bundled_with_plan_label", {
|
|
20895
|
+
cadence: v
|
|
20896
|
+
}), b = `#${d.subscription_token.slice(-8).toUpperCase()}`;
|
|
20896
20897
|
return /* @__PURE__ */ i.jsxs("div", { className: "border-border bg-background my-3 rounded-xl border p-4", children: [
|
|
20897
20898
|
/* @__PURE__ */ i.jsxs("div", { className: "text-foreground text-sm font-bold", children: [
|
|
20898
20899
|
a("bundled_with_title"),
|
|
@@ -20903,17 +20904,17 @@ function _y({
|
|
|
20903
20904
|
type: "button",
|
|
20904
20905
|
onClick: () => r(d.subscription_token),
|
|
20905
20906
|
className: "text-primary focus-visible:ring-foreground/30 rounded font-bold hover:underline focus-visible:ring-2 focus-visible:outline-none",
|
|
20906
|
-
children:
|
|
20907
|
+
children: b
|
|
20907
20908
|
}
|
|
20908
|
-
) : /* @__PURE__ */ i.jsx("span", { className: "text-primary font-bold", children:
|
|
20909
|
+
) : /* @__PURE__ */ i.jsx("span", { className: "text-primary font-bold", children: b })
|
|
20909
20910
|
] }),
|
|
20910
20911
|
/* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground mt-0.5 text-xs", children: a("bundled_with_subhead", { cadence: h }) }),
|
|
20911
|
-
/* @__PURE__ */ i.jsx("div", { className: "mt-3 flex flex-col gap-0.5", children: o.map((
|
|
20912
|
+
/* @__PURE__ */ i.jsx("div", { className: "mt-3 flex flex-col gap-0.5", children: o.map((f) => {
|
|
20912
20913
|
const y = /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
20913
|
-
/* @__PURE__ */ i.jsx("div", { className: "bg-muted size-12 shrink-0 overflow-hidden rounded-lg", children:
|
|
20914
|
+
/* @__PURE__ */ i.jsx("div", { className: "bg-muted size-12 shrink-0 overflow-hidden rounded-lg", children: f.image_url ? /* @__PURE__ */ i.jsx(
|
|
20914
20915
|
"img",
|
|
20915
20916
|
{
|
|
20916
|
-
src:
|
|
20917
|
+
src: f.image_url,
|
|
20917
20918
|
alt: "",
|
|
20918
20919
|
className: "size-full object-cover"
|
|
20919
20920
|
}
|
|
@@ -20923,49 +20924,49 @@ function _y({
|
|
|
20923
20924
|
"p",
|
|
20924
20925
|
{
|
|
20925
20926
|
className: "text-foreground truncate text-sm font-medium",
|
|
20926
|
-
title:
|
|
20927
|
-
children:
|
|
20927
|
+
title: f.product_title,
|
|
20928
|
+
children: f.product_title || a("list_product_fallback")
|
|
20928
20929
|
}
|
|
20929
20930
|
),
|
|
20930
|
-
|
|
20931
|
-
|
|
20932
|
-
|
|
20933
|
-
|
|
20931
|
+
f.variant_title && /* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground truncate text-xs", children: f.variant_title }),
|
|
20932
|
+
f.price !== null && /* @__PURE__ */ i.jsx("p", { className: "text-foreground text-sm font-medium", children: rt(
|
|
20933
|
+
f.price * f.quantity,
|
|
20934
|
+
f.currency?.code,
|
|
20934
20935
|
s
|
|
20935
20936
|
) }),
|
|
20936
|
-
|
|
20937
|
+
f.price !== null && f.quantity > 1 && /* @__PURE__ */ i.jsxs("p", { className: "text-muted-foreground text-xs tabular-nums", children: [
|
|
20937
20938
|
/* @__PURE__ */ i.jsxs("span", { className: "sr-only", children: [
|
|
20938
20939
|
a("list_quantity_times_label"),
|
|
20939
20940
|
" "
|
|
20940
20941
|
] }),
|
|
20941
20942
|
a("list_quantity_times_price", {
|
|
20942
|
-
n: String(
|
|
20943
|
+
n: String(f.quantity),
|
|
20943
20944
|
price: rt(
|
|
20944
|
-
|
|
20945
|
-
|
|
20945
|
+
f.price,
|
|
20946
|
+
f.currency?.code,
|
|
20946
20947
|
s
|
|
20947
20948
|
)
|
|
20948
20949
|
})
|
|
20949
20950
|
] })
|
|
20950
20951
|
] }),
|
|
20951
|
-
/* @__PURE__ */ i.jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children:
|
|
20952
|
+
/* @__PURE__ */ i.jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: _ })
|
|
20952
20953
|
] });
|
|
20953
20954
|
return r ? /* @__PURE__ */ i.jsx(
|
|
20954
20955
|
"button",
|
|
20955
20956
|
{
|
|
20956
20957
|
type: "button",
|
|
20957
|
-
onClick: () => r(
|
|
20958
|
+
onClick: () => r(f.subscription_token),
|
|
20958
20959
|
className: "hover:bg-muted/60 focus-visible:ring-foreground/30 -mx-2 flex items-center gap-3 rounded-lg p-2 text-left transition-colors focus-visible:ring-2 focus-visible:outline-none",
|
|
20959
20960
|
children: y
|
|
20960
20961
|
},
|
|
20961
|
-
|
|
20962
|
+
f.subscription_token
|
|
20962
20963
|
) : /* @__PURE__ */ i.jsx(
|
|
20963
20964
|
"div",
|
|
20964
20965
|
{
|
|
20965
20966
|
className: "-mx-2 flex items-center gap-3 rounded-lg p-2",
|
|
20966
20967
|
children: y
|
|
20967
20968
|
},
|
|
20968
|
-
|
|
20969
|
+
f.subscription_token
|
|
20969
20970
|
);
|
|
20970
20971
|
}) })
|
|
20971
20972
|
] });
|
|
@@ -21105,24 +21106,24 @@ function Cy({
|
|
|
21105
21106
|
decrementAriaLabel: o,
|
|
21106
21107
|
incrementAriaLabel: d
|
|
21107
21108
|
}) {
|
|
21108
|
-
const c = m.useRef(null), [u,
|
|
21109
|
+
const c = m.useRef(null), [u, p] = m.useState(String(n)), h = m.useRef(n), v = m.useRef(null), _ = m.useRef(a);
|
|
21109
21110
|
m.useEffect(() => {
|
|
21110
|
-
|
|
21111
|
+
_.current = a;
|
|
21111
21112
|
}, [a]), m.useEffect(
|
|
21112
21113
|
() => () => {
|
|
21113
|
-
|
|
21114
|
+
v.current && clearTimeout(v.current);
|
|
21114
21115
|
},
|
|
21115
21116
|
[]
|
|
21116
21117
|
), m.useEffect(() => {
|
|
21117
|
-
typeof document < "u" && document.activeElement === c.current ||
|
|
21118
|
+
typeof document < "u" && document.activeElement === c.current || p(String(n));
|
|
21118
21119
|
}, [n]);
|
|
21119
|
-
const
|
|
21120
|
-
|
|
21121
|
-
|
|
21120
|
+
const b = (C) => {
|
|
21121
|
+
v.current && clearTimeout(v.current), v.current = setTimeout(() => {
|
|
21122
|
+
_.current(C), h.current = C;
|
|
21122
21123
|
}, 500);
|
|
21123
|
-
},
|
|
21124
|
+
}, f = parseInt(u, 10), y = Number.isFinite(f) && f > 0 ? f : n, E = r || y <= 1, w = r || t != null && y >= t, z = (C) => t != null ? Math.min(t, Math.max(1, C)) : Math.max(1, C), j = (C) => {
|
|
21124
21125
|
const F = z(y + C);
|
|
21125
|
-
F !== y && (
|
|
21126
|
+
F !== y && (p(String(F)), b(F));
|
|
21126
21127
|
}, $ = ne(
|
|
21127
21128
|
"text-muted-foreground hover:text-foreground hover:bg-muted flex h-7 w-7 shrink-0 items-center justify-center rounded-full shadow-xs disabled:cursor-not-allowed"
|
|
21128
21129
|
);
|
|
@@ -21161,22 +21162,22 @@ function Cy({
|
|
|
21161
21162
|
},
|
|
21162
21163
|
onChange: (C) => {
|
|
21163
21164
|
const F = C.target.value;
|
|
21164
|
-
if (
|
|
21165
|
-
|
|
21165
|
+
if (p(F), F === "") {
|
|
21166
|
+
v.current && clearTimeout(v.current);
|
|
21166
21167
|
return;
|
|
21167
21168
|
}
|
|
21168
21169
|
const P = parseInt(F, 10);
|
|
21169
|
-
Number.isFinite(P) && P > 0 &&
|
|
21170
|
+
Number.isFinite(P) && P > 0 && b(z(P));
|
|
21170
21171
|
},
|
|
21171
21172
|
onBlur: () => {
|
|
21172
|
-
|
|
21173
|
+
v.current && clearTimeout(v.current);
|
|
21173
21174
|
const C = parseInt(u, 10);
|
|
21174
21175
|
if (Number.isFinite(C) && C > 0) {
|
|
21175
21176
|
const F = z(C);
|
|
21176
|
-
F !== C &&
|
|
21177
|
+
F !== C && p(String(F)), F !== n && a(F), h.current = F;
|
|
21177
21178
|
} else {
|
|
21178
21179
|
const F = h.current;
|
|
21179
|
-
|
|
21180
|
+
p(String(F)), F !== n && a(F);
|
|
21180
21181
|
}
|
|
21181
21182
|
},
|
|
21182
21183
|
readOnly: r,
|
|
@@ -21228,12 +21229,12 @@ function Ny({
|
|
|
21228
21229
|
isUpdatingQuantity: s = !1,
|
|
21229
21230
|
onNavigateToSubscription: o
|
|
21230
21231
|
}) {
|
|
21231
|
-
const { t: d, locale: c } = se(), u = e.variant,
|
|
21232
|
-
|
|
21233
|
-
|
|
21232
|
+
const { t: d, locale: c } = se(), u = e.variant, p = u?.product, h = n ?? e.quantity, v = Kn(e), _ = v === "past_due", b = `subscription-${e.subscription_token}-quantity`, f = qd(e), y = e.currency?.code, E = dy(
|
|
21233
|
+
f.subtotalUnit,
|
|
21234
|
+
f.totalUnit,
|
|
21234
21235
|
h,
|
|
21235
21236
|
y
|
|
21236
|
-
), w = E.discount, z = rt(E.subtotal, y, c), j = rt(E.total, y, c), $ = t ?? e.next_bill_date, C =
|
|
21237
|
+
), w = E.discount, z = rt(E.subtotal, y, c), j = rt(E.total, y, c), $ = t ?? e.next_bill_date, C = v === "completed" ? "" : Qd($, e.timezone, c), F = {
|
|
21237
21238
|
cancelled: d("date_cancelled"),
|
|
21238
21239
|
completed: d("list_status_completed"),
|
|
21239
21240
|
paused: d("date_paused"),
|
|
@@ -21245,10 +21246,10 @@ function Ny({
|
|
|
21245
21246
|
/* @__PURE__ */ i.jsxs("div", { className: "text-muted-foreground", children: [
|
|
21246
21247
|
/* @__PURE__ */ i.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
21247
21248
|
/* @__PURE__ */ i.jsxs("div", { className: "border-border border-r pr-4", children: [
|
|
21248
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mb-1 text-sm", children: d(
|
|
21249
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-foreground text-2xl font-bold", children:
|
|
21249
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mb-1 text-sm", children: d(_ ? "payment_failed_on" : "next_order_date") }),
|
|
21250
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-foreground text-2xl font-bold", children: _ ? e.last_failed_at ? G1(e.last_failed_at, c) : "—" : Xd(
|
|
21250
21251
|
$,
|
|
21251
|
-
|
|
21252
|
+
v,
|
|
21252
21253
|
F,
|
|
21253
21254
|
c
|
|
21254
21255
|
) }),
|
|
@@ -21279,10 +21280,10 @@ function Ny({
|
|
|
21279
21280
|
/* @__PURE__ */ i.jsx("div", { className: "py-6", children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-row items-center gap-x-4", children: [
|
|
21280
21281
|
/* @__PURE__ */ i.jsxs("div", { className: "flex min-w-0 flex-1 flex-row gap-x-4", children: [
|
|
21281
21282
|
/* @__PURE__ */ i.jsx("div", { className: "relative shrink-0", children: /* @__PURE__ */ i.jsxs("div", { className: "bg-muted h-24 w-24 overflow-hidden rounded", children: [
|
|
21282
|
-
|
|
21283
|
+
p?.image_url ? /* @__PURE__ */ i.jsx(
|
|
21283
21284
|
"img",
|
|
21284
21285
|
{
|
|
21285
|
-
src:
|
|
21286
|
+
src: p.image_url,
|
|
21286
21287
|
alt: u?.title || d("product_image_alt"),
|
|
21287
21288
|
width: 96,
|
|
21288
21289
|
height: 96,
|
|
@@ -21296,11 +21297,11 @@ function Ny({
|
|
|
21296
21297
|
"p",
|
|
21297
21298
|
{
|
|
21298
21299
|
className: "text-foreground truncate text-sm font-medium",
|
|
21299
|
-
title:
|
|
21300
|
-
children:
|
|
21300
|
+
title: p?.title,
|
|
21301
|
+
children: p?.title
|
|
21301
21302
|
}
|
|
21302
21303
|
),
|
|
21303
|
-
u?.title &&
|
|
21304
|
+
u?.title && p?.title && /* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground text-sm", children: u.title }),
|
|
21304
21305
|
/* @__PURE__ */ i.jsx("div", { children: /* @__PURE__ */ i.jsx("p", { className: "text-foreground text-sm font-medium", children: rt(
|
|
21305
21306
|
e.price * h,
|
|
21306
21307
|
y,
|
|
@@ -21312,7 +21313,7 @@ function Ny({
|
|
|
21312
21313
|
/* @__PURE__ */ i.jsx(
|
|
21313
21314
|
"label",
|
|
21314
21315
|
{
|
|
21315
|
-
htmlFor:
|
|
21316
|
+
htmlFor: b,
|
|
21316
21317
|
className: "text-muted-foreground mb-1 text-xs",
|
|
21317
21318
|
children: d("quantity_label")
|
|
21318
21319
|
}
|
|
@@ -21320,7 +21321,7 @@ function Ny({
|
|
|
21320
21321
|
/* @__PURE__ */ i.jsx(
|
|
21321
21322
|
Cy,
|
|
21322
21323
|
{
|
|
21323
|
-
inputId:
|
|
21324
|
+
inputId: b,
|
|
21324
21325
|
quantity: h,
|
|
21325
21326
|
maxQuantity: e.subscription_plan.max_quantity,
|
|
21326
21327
|
isUpdatingQuantity: s,
|
|
@@ -21333,7 +21334,7 @@ function Ny({
|
|
|
21333
21334
|
] })
|
|
21334
21335
|
] }) }),
|
|
21335
21336
|
/* @__PURE__ */ i.jsxs("div", { children: [
|
|
21336
|
-
|
|
21337
|
+
f.hasDiscount && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
21337
21338
|
/* @__PURE__ */ i.jsxs("div", { className: "flex justify-between text-sm", children: [
|
|
21338
21339
|
/* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground text-sm font-medium", children: d("subtotal") }),
|
|
21339
21340
|
/* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground text-sm font-medium", children: z })
|
|
@@ -21342,7 +21343,7 @@ function Ny({
|
|
|
21342
21343
|
My,
|
|
21343
21344
|
{
|
|
21344
21345
|
label: d("discount"),
|
|
21345
|
-
code:
|
|
21346
|
+
code: f.attachedDiscountCode,
|
|
21346
21347
|
amount: rt(w, y, c)
|
|
21347
21348
|
}
|
|
21348
21349
|
)
|
|
@@ -21366,28 +21367,28 @@ function Sy({
|
|
|
21366
21367
|
onResume: d,
|
|
21367
21368
|
onCancel: c,
|
|
21368
21369
|
onReactivate: u,
|
|
21369
|
-
onEditBillDate:
|
|
21370
|
+
onEditBillDate: p,
|
|
21370
21371
|
renderPaymentMethod: h,
|
|
21371
|
-
renderShippingAddress:
|
|
21372
|
-
renderAutoApplyPoints:
|
|
21373
|
-
presentation:
|
|
21372
|
+
renderShippingAddress: v,
|
|
21373
|
+
renderAutoApplyPoints: _,
|
|
21374
|
+
presentation: b
|
|
21374
21375
|
}) {
|
|
21375
|
-
const { t:
|
|
21376
|
+
const { t: f, locale: y } = se(), [E, w] = m.useState(!1), z = e.subscription_plan, j = e.quantity, $ = rt(
|
|
21376
21377
|
e.price * j,
|
|
21377
21378
|
e.currency?.code,
|
|
21378
21379
|
y
|
|
21379
21380
|
), C = Kn(e), F = Ey(z.billing_interval_unit), P = z.billing_interval, k = hs[z.billing_interval_unit.toLowerCase()];
|
|
21380
21381
|
let D;
|
|
21381
|
-
P === 1 && F ? D =
|
|
21382
|
+
P === 1 && F ? D = f(`list_cadence_${F}`) : k ? D = f("list_cadence_every_n_units", {
|
|
21382
21383
|
n: String(P),
|
|
21383
|
-
unit:
|
|
21384
|
-
}) : D =
|
|
21384
|
+
unit: f(k.plural)
|
|
21385
|
+
}) : D = f("list_cadence_every_unit", {
|
|
21385
21386
|
unit: Rr(z.billing_interval_unit)
|
|
21386
21387
|
});
|
|
21387
21388
|
const L = e.payment_method, S = L?.details ?? null, V = L ? vs(L, S) : null, T = "flex h-auto flex-row items-center justify-center gap-2 overflow-hidden border border-border bg-muted py-2 text-xs whitespace-nowrap text-foreground hover:bg-accent sm:text-sm";
|
|
21388
21389
|
return /* @__PURE__ */ i.jsx("div", { className: "bg-background col-span-4 flex-auto px-8 pt-4", children: /* @__PURE__ */ i.jsxs("div", { className: "mx-auto max-w-lg lg:mx-0 lg:mr-auto", children: [
|
|
21389
21390
|
n.order.length > 0 && /* @__PURE__ */ i.jsxs("div", { className: "border-border mb-6 border-b pb-6", children: [
|
|
21390
|
-
/* @__PURE__ */ i.jsx("h2", { className: "text-foreground mb-3 text-sm/6 font-semibold", children:
|
|
21391
|
+
/* @__PURE__ */ i.jsx("h2", { className: "text-foreground mb-3 text-sm/6 font-semibold", children: f("your_upcoming_order") }),
|
|
21391
21392
|
/* @__PURE__ */ i.jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: [
|
|
21392
21393
|
n.order.includes("skip_next_order") && /* @__PURE__ */ i.jsxs(
|
|
21393
21394
|
Z,
|
|
@@ -21398,7 +21399,7 @@ function Sy({
|
|
|
21398
21399
|
className: T,
|
|
21399
21400
|
children: [
|
|
21400
21401
|
/* @__PURE__ */ i.jsx(a2, { className: "h-3 w-3 shrink-0" }),
|
|
21401
|
-
/* @__PURE__ */ i.jsx("span", { className: "truncate", children:
|
|
21402
|
+
/* @__PURE__ */ i.jsx("span", { className: "truncate", children: f("skip_next_order") })
|
|
21402
21403
|
]
|
|
21403
21404
|
}
|
|
21404
21405
|
),
|
|
@@ -21406,12 +21407,12 @@ function Sy({
|
|
|
21406
21407
|
Z,
|
|
21407
21408
|
{
|
|
21408
21409
|
variant: "outline",
|
|
21409
|
-
onClick:
|
|
21410
|
+
onClick: p,
|
|
21410
21411
|
disabled: t,
|
|
21411
21412
|
className: T,
|
|
21412
21413
|
children: [
|
|
21413
21414
|
/* @__PURE__ */ i.jsx(Go, { className: "size-3 shrink-0" }),
|
|
21414
|
-
/* @__PURE__ */ i.jsx("span", { className: "truncate", children:
|
|
21415
|
+
/* @__PURE__ */ i.jsx("span", { className: "truncate", children: f("edit_bill_date") })
|
|
21415
21416
|
]
|
|
21416
21417
|
}
|
|
21417
21418
|
)
|
|
@@ -21419,10 +21420,10 @@ function Sy({
|
|
|
21419
21420
|
] }),
|
|
21420
21421
|
/* @__PURE__ */ i.jsxs("div", { className: "border-border mb-4 border-b", children: [
|
|
21421
21422
|
/* @__PURE__ */ i.jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
21422
|
-
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground text-sm/6 font-semibold", children:
|
|
21423
|
+
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground text-sm/6 font-semibold", children: f("subscription_details") }),
|
|
21423
21424
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
21424
|
-
/* @__PURE__ */ i.jsx(ps, { status: C, children: fs.has(C) ?
|
|
21425
|
-
n.menu.length > 0 && (
|
|
21425
|
+
/* @__PURE__ */ i.jsx(ps, { status: C, children: fs.has(C) ? f(`list_status_${C}`) : Rr(C) }),
|
|
21426
|
+
n.menu.length > 0 && (b === "bottom-sheet" ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
21426
21427
|
/* @__PURE__ */ i.jsx(
|
|
21427
21428
|
Z,
|
|
21428
21429
|
{
|
|
@@ -21430,7 +21431,7 @@ function Sy({
|
|
|
21430
21431
|
variant: "ghost",
|
|
21431
21432
|
size: "icon",
|
|
21432
21433
|
disabled: t,
|
|
21433
|
-
"aria-label":
|
|
21434
|
+
"aria-label": f("more_subscription_actions"),
|
|
21434
21435
|
onClick: () => w(!0),
|
|
21435
21436
|
children: /* @__PURE__ */ i.jsx(zl, { className: "size-4", "aria-hidden": !0 })
|
|
21436
21437
|
}
|
|
@@ -21440,19 +21441,19 @@ function Sy({
|
|
|
21440
21441
|
{
|
|
21441
21442
|
open: E,
|
|
21442
21443
|
onOpenChange: w,
|
|
21443
|
-
title:
|
|
21444
|
+
title: f("more_subscription_actions"),
|
|
21444
21445
|
actions: [
|
|
21445
21446
|
...n.menu.includes("pause_subscription") ? [
|
|
21446
21447
|
{
|
|
21447
21448
|
id: "pause",
|
|
21448
|
-
label:
|
|
21449
|
+
label: f("pause_subscription"),
|
|
21449
21450
|
onSelect: o
|
|
21450
21451
|
}
|
|
21451
21452
|
] : [],
|
|
21452
21453
|
...n.menu.includes("cancel_subscription") ? [
|
|
21453
21454
|
{
|
|
21454
21455
|
id: "cancel",
|
|
21455
|
-
label:
|
|
21456
|
+
label: f("cancel_subscription"),
|
|
21456
21457
|
variant: "destructive",
|
|
21457
21458
|
onSelect: c
|
|
21458
21459
|
}
|
|
@@ -21468,14 +21469,14 @@ function Sy({
|
|
|
21468
21469
|
variant: "ghost",
|
|
21469
21470
|
size: "icon",
|
|
21470
21471
|
disabled: t,
|
|
21471
|
-
"aria-label":
|
|
21472
|
+
"aria-label": f("more_subscription_actions"),
|
|
21472
21473
|
children: /* @__PURE__ */ i.jsx(zl, { className: "size-4", "aria-hidden": !0 })
|
|
21473
21474
|
}
|
|
21474
21475
|
) }),
|
|
21475
21476
|
/* @__PURE__ */ i.jsxs(x1, { align: "end", children: [
|
|
21476
21477
|
n.menu.includes("pause_subscription") && /* @__PURE__ */ i.jsxs(Dt, { onSelect: o, children: [
|
|
21477
21478
|
/* @__PURE__ */ i.jsx(Do, { className: "size-4", "aria-hidden": !0 }),
|
|
21478
|
-
|
|
21479
|
+
f("pause_subscription")
|
|
21479
21480
|
] }),
|
|
21480
21481
|
n.menu.includes("cancel_subscription") && /* @__PURE__ */ i.jsxs(
|
|
21481
21482
|
Dt,
|
|
@@ -21484,7 +21485,7 @@ function Sy({
|
|
|
21484
21485
|
className: "text-destructive focus:text-destructive",
|
|
21485
21486
|
children: [
|
|
21486
21487
|
/* @__PURE__ */ i.jsx(Zo, { className: "size-4", "aria-hidden": !0 }),
|
|
21487
|
-
|
|
21488
|
+
f("cancel_subscription")
|
|
21488
21489
|
]
|
|
21489
21490
|
}
|
|
21490
21491
|
)
|
|
@@ -21501,7 +21502,7 @@ function Sy({
|
|
|
21501
21502
|
className: "mb-4 w-full",
|
|
21502
21503
|
children: [
|
|
21503
21504
|
/* @__PURE__ */ i.jsx(_1, { className: "size-4", "aria-hidden": !0 }),
|
|
21504
|
-
|
|
21505
|
+
f("resume_subscription")
|
|
21505
21506
|
]
|
|
21506
21507
|
}
|
|
21507
21508
|
),
|
|
@@ -21514,30 +21515,30 @@ function Sy({
|
|
|
21514
21515
|
className: "mb-4 w-full",
|
|
21515
21516
|
children: [
|
|
21516
21517
|
/* @__PURE__ */ i.jsx(r2, { className: "size-4", "aria-hidden": !0 }),
|
|
21517
|
-
|
|
21518
|
+
f("reactivate_subscription")
|
|
21518
21519
|
]
|
|
21519
21520
|
}
|
|
21520
21521
|
),
|
|
21521
21522
|
/* @__PURE__ */ i.jsxs("div", { className: "divide-border mb-4 flex divide-x", children: [
|
|
21522
21523
|
/* @__PURE__ */ i.jsxs("div", { className: "flex-1 pr-4", children: [
|
|
21523
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground text-sm", children:
|
|
21524
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground text-sm", children: f("order_frequency") }),
|
|
21524
21525
|
/* @__PURE__ */ i.jsx("div", { className: "text-foreground font-medium", children: D })
|
|
21525
21526
|
] }),
|
|
21526
21527
|
e.last_ship_date && /* @__PURE__ */ i.jsxs("div", { className: "flex-1 px-4", children: [
|
|
21527
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground text-sm", children:
|
|
21528
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground text-sm", children: f("last_shipped") }),
|
|
21528
21529
|
/* @__PURE__ */ i.jsx("div", { className: "text-foreground font-medium", children: G1(e.last_ship_date, y) })
|
|
21529
21530
|
] }),
|
|
21530
21531
|
e.last_bill_date && /* @__PURE__ */ i.jsxs("div", { className: "flex-1 px-4", children: [
|
|
21531
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground text-sm", children:
|
|
21532
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground text-sm", children: f("last_bill_amount") }),
|
|
21532
21533
|
/* @__PURE__ */ i.jsx("div", { className: "text-foreground font-medium", children: $ }),
|
|
21533
21534
|
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground text-xs", children: al(e.last_bill_date, y) })
|
|
21534
21535
|
] })
|
|
21535
21536
|
] })
|
|
21536
21537
|
] }),
|
|
21537
21538
|
/* @__PURE__ */ i.jsxs("div", { className: "pt-2", children: [
|
|
21538
|
-
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground mb-4 text-sm/6 font-semibold", children:
|
|
21539
|
+
/* @__PURE__ */ i.jsx("h3", { className: "text-foreground mb-4 text-sm/6 font-semibold", children: f("payment_and_shipping") }),
|
|
21539
21540
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-col", children: [
|
|
21540
|
-
|
|
21541
|
+
v ? v({
|
|
21541
21542
|
addressId: e.address_id,
|
|
21542
21543
|
address: e.address,
|
|
21543
21544
|
subscriptionToken: e.subscription_token,
|
|
@@ -21545,7 +21546,7 @@ function Sy({
|
|
|
21545
21546
|
countryCode: e.address?.country_code ?? "US",
|
|
21546
21547
|
disabled: Ct(e)
|
|
21547
21548
|
}) : e.address && /* @__PURE__ */ i.jsxs("div", { className: "border-border mb-6 border-b pb-4", children: [
|
|
21548
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mt-3 mb-1 text-sm", children:
|
|
21549
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mt-3 mb-1 text-sm", children: f("shipping_address") }),
|
|
21549
21550
|
/* @__PURE__ */ i.jsxs("div", { className: "text-foreground text-sm", children: [
|
|
21550
21551
|
/* @__PURE__ */ i.jsx("p", { className: "font-medium", children: e.address.name }),
|
|
21551
21552
|
/* @__PURE__ */ i.jsx("p", { children: e.address.address1 }),
|
|
@@ -21579,7 +21580,7 @@ function Sy({
|
|
|
21579
21580
|
id: "subscription-payment-method-section",
|
|
21580
21581
|
className: "border-border mb-6 scroll-mt-24 border-b pb-4",
|
|
21581
21582
|
children: [
|
|
21582
|
-
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mb-1 text-sm", children:
|
|
21583
|
+
/* @__PURE__ */ i.jsx("div", { className: "text-muted-foreground mb-1 text-sm", children: f("payment_method") }),
|
|
21583
21584
|
/* @__PURE__ */ i.jsxs("div", { className: "text-foreground flex items-center gap-2 text-sm", children: [
|
|
21584
21585
|
V && /* @__PURE__ */ i.jsx(Fy, { display: V }),
|
|
21585
21586
|
V && /* @__PURE__ */ i.jsx("span", { className: "font-medium", children: V.label })
|
|
@@ -21587,7 +21588,7 @@ function Sy({
|
|
|
21587
21588
|
]
|
|
21588
21589
|
}
|
|
21589
21590
|
)),
|
|
21590
|
-
|
|
21591
|
+
_?.({
|
|
21591
21592
|
autoApplyPoints: e.auto_apply_points,
|
|
21592
21593
|
pointsEnabled: e.points_enabled,
|
|
21593
21594
|
subscriptionToken: e.subscription_token,
|
|
@@ -21635,11 +21636,11 @@ function jy({
|
|
|
21635
21636
|
renderShippingAddress: d,
|
|
21636
21637
|
renderAutoApplyPoints: c,
|
|
21637
21638
|
renderReactivateDialog: u,
|
|
21638
|
-
onUpdatePaymentClick:
|
|
21639
|
+
onUpdatePaymentClick: p,
|
|
21639
21640
|
presentation: h = "dialog"
|
|
21640
21641
|
}) {
|
|
21641
|
-
const { t:
|
|
21642
|
-
|
|
21642
|
+
const { t: v, locale: _ } = se(), b = Me(), f = m.useRef(e);
|
|
21643
|
+
f.current = e;
|
|
21643
21644
|
const [y, E] = m.useState(null), w = m.useCallback(
|
|
21644
21645
|
({
|
|
21645
21646
|
subscriptionToken: O,
|
|
@@ -21657,50 +21658,50 @@ function jy({
|
|
|
21657
21658
|
}), J = ve && I.isFetching, N = I.data?.failed_cycle_waiver, G = N?.next_bill_date != null && N.next_ship_date != null ? W1({
|
|
21658
21659
|
nextBillDate: N.next_bill_date,
|
|
21659
21660
|
nextShipDate: N.next_ship_date,
|
|
21660
|
-
locale:
|
|
21661
|
+
locale: _,
|
|
21661
21662
|
timezone: Q?.timezone ?? "UTC"
|
|
21662
21663
|
}) : null, ge = ve && !J && !I.isError && N?.eligible === !0 && G != null, me = U1({
|
|
21663
21664
|
subscriptionToken: e,
|
|
21664
|
-
onSucceeded: () => r?.(
|
|
21665
|
-
onFailed: () => r?.(
|
|
21666
|
-
onTimedOut: () => r?.(
|
|
21665
|
+
onSucceeded: () => r?.(v("payment_retry_succeeded"), "success"),
|
|
21666
|
+
onFailed: () => r?.(v("payment_retry_failed"), "error"),
|
|
21667
|
+
onTimedOut: () => r?.(v("payment_retry_processing"), "warning")
|
|
21667
21668
|
}), Ne = V1({
|
|
21668
21669
|
onSuccess: ({ subscriptionToken: O }) => {
|
|
21669
|
-
|
|
21670
|
+
f.current === O && me.start();
|
|
21670
21671
|
},
|
|
21671
21672
|
onError: (O, { subscriptionToken: ae }) => {
|
|
21672
|
-
|
|
21673
|
+
f.current === ae && a?.(v("unable_to_retry_payment"), O);
|
|
21673
21674
|
}
|
|
21674
21675
|
}), ze = Rd({
|
|
21675
21676
|
onSuccess: ({ subscriptionToken: O }) => {
|
|
21676
21677
|
T(
|
|
21677
21678
|
(ae) => ae === O ? null : ae
|
|
21678
|
-
),
|
|
21679
|
+
), f.current === O && r?.(v("failed_cycle_waiver_succeeded"), "success");
|
|
21679
21680
|
},
|
|
21680
21681
|
onError: (O, { subscriptionToken: ae }) => {
|
|
21681
21682
|
if (wy(O)) {
|
|
21682
21683
|
if (Promise.all([
|
|
21683
|
-
|
|
21684
|
+
b.invalidateQueries({
|
|
21684
21685
|
queryKey: ee.detail(ae),
|
|
21685
21686
|
exact: !0
|
|
21686
21687
|
}),
|
|
21687
|
-
|
|
21688
|
+
b.invalidateQueries({
|
|
21688
21689
|
queryKey: ee.failedCycleWaiver(ae),
|
|
21689
21690
|
exact: !0
|
|
21690
21691
|
})
|
|
21691
21692
|
]), T(
|
|
21692
21693
|
(qe) => qe === ae ? null : qe
|
|
21693
|
-
),
|
|
21694
|
-
r?.(
|
|
21694
|
+
), f.current !== ae) return;
|
|
21695
|
+
r?.(v("failed_cycle_waiver_state_changed"), "warning");
|
|
21695
21696
|
return;
|
|
21696
21697
|
}
|
|
21697
|
-
if (
|
|
21698
|
+
if (f.current !== ae) {
|
|
21698
21699
|
T(
|
|
21699
21700
|
(qe) => qe === ae ? null : qe
|
|
21700
21701
|
);
|
|
21701
21702
|
return;
|
|
21702
21703
|
}
|
|
21703
|
-
a?.(
|
|
21704
|
+
a?.(v("generic_error"), O);
|
|
21704
21705
|
}
|
|
21705
21706
|
}), Fe = Md(
|
|
21706
21707
|
{ perPage: 100 },
|
|
@@ -21708,44 +21709,44 @@ function jy({
|
|
|
21708
21709
|
), De = m.useMemo(
|
|
21709
21710
|
() => (Fe.data?.subscriptions ?? []).filter((O) => O.subscription_token !== e).map((O) => ({
|
|
21710
21711
|
token: O.subscription_token,
|
|
21711
|
-
productTitle: O.variant?.product?.title ??
|
|
21712
|
+
productTitle: O.variant?.product?.title ?? v("breadcrumb"),
|
|
21712
21713
|
nextBillDate: O.next_bill_date,
|
|
21713
21714
|
billingInterval: O.subscription_plan?.billing_interval ?? 1,
|
|
21714
21715
|
billingIntervalUnit: O.subscription_plan?.billing_interval_unit ?? "month"
|
|
21715
21716
|
})),
|
|
21716
|
-
[Fe.data, e,
|
|
21717
|
+
[Fe.data, e, v]
|
|
21717
21718
|
), Ce = Sd({
|
|
21718
|
-
onSuccess: () => r?.(
|
|
21719
|
-
onError: (O) => a?.(
|
|
21719
|
+
onSuccess: () => r?.(v("subscription_paused")),
|
|
21720
|
+
onError: (O) => a?.(v("failed_to_pause"), O)
|
|
21720
21721
|
}), Pe = Pd({
|
|
21721
|
-
onSuccess: () => r?.(
|
|
21722
|
-
onError: (O) => a?.(
|
|
21722
|
+
onSuccess: () => r?.(v("subscription_resumed")),
|
|
21723
|
+
onError: (O) => a?.(v("failed_to_resume"), O)
|
|
21723
21724
|
}), q = jd({
|
|
21724
|
-
onSuccess: () => r?.(
|
|
21725
|
-
onError: (O) => a?.(
|
|
21725
|
+
onSuccess: () => r?.(v("next_billing_skipped")),
|
|
21726
|
+
onError: (O) => a?.(v("failed_to_skip"), O)
|
|
21726
21727
|
}), R = Ad({
|
|
21727
21728
|
onSuccess: () => {
|
|
21728
|
-
r?.(
|
|
21729
|
+
r?.(v("subscription_cancelled")), j(!1);
|
|
21729
21730
|
},
|
|
21730
|
-
onError: (O) => a?.(
|
|
21731
|
+
onError: (O) => a?.(v("failed_to_cancel"), O)
|
|
21731
21732
|
}), X = Hd({
|
|
21732
|
-
onSuccess: () => r?.(
|
|
21733
|
-
onError: (O) => a?.(
|
|
21733
|
+
onSuccess: () => r?.(v("subscription_reactivated")),
|
|
21734
|
+
onError: (O) => a?.(v("failed_to_reactivate"), O)
|
|
21734
21735
|
}), [A, Ee] = m.useState(null), de = m.useRef(
|
|
21735
21736
|
null
|
|
21736
21737
|
), he = Tt({
|
|
21737
21738
|
onSuccess: ({ subscriptionToken: O }) => {
|
|
21738
|
-
|
|
21739
|
+
f.current === O && r?.(v("quantity_updated"));
|
|
21739
21740
|
},
|
|
21740
21741
|
onError: (O, { subscriptionToken: ae }) => {
|
|
21741
|
-
|
|
21742
|
+
f.current === ae && (Ee(null), a?.(v("failed_to_update_quantity"), O));
|
|
21742
21743
|
}
|
|
21743
21744
|
}), He = Tt({
|
|
21744
21745
|
onSuccess: ({ subscriptionToken: O }) => {
|
|
21745
|
-
|
|
21746
|
+
f.current === O && (r?.(v("bill_date_updated")), S(!1));
|
|
21746
21747
|
},
|
|
21747
21748
|
onError: (O, { subscriptionToken: ae }) => {
|
|
21748
|
-
|
|
21749
|
+
f.current === ae && (Y(null), a?.(v("failed_to_update_bill_date"), O));
|
|
21749
21750
|
}
|
|
21750
21751
|
}), Te = W?.subscription.next_bill_date ?? null;
|
|
21751
21752
|
m.useEffect(() => {
|
|
@@ -21859,7 +21860,7 @@ function jy({
|
|
|
21859
21860
|
isRetryingPayment: nr,
|
|
21860
21861
|
isCheckingWaiver: ln.recovery?.isCheckingWaiver === !0,
|
|
21861
21862
|
recoveryDisabled: rr,
|
|
21862
|
-
onUpdatePaymentClick:
|
|
21863
|
+
onUpdatePaymentClick: p ?? (() => {
|
|
21863
21864
|
const O = document.getElementById(
|
|
21864
21865
|
"subscription-payment-method-section"
|
|
21865
21866
|
);
|
|
@@ -21936,7 +21937,7 @@ function jy({
|
|
|
21936
21937
|
});
|
|
21937
21938
|
},
|
|
21938
21939
|
isLoading: He.isPending,
|
|
21939
|
-
errorMessage: He.isError ?
|
|
21940
|
+
errorMessage: He.isError ? v("bill_date_error") : void 0,
|
|
21940
21941
|
currentNextBillDate: Q.next_bill_date,
|
|
21941
21942
|
billingInterval: Ue.billing_interval,
|
|
21942
21943
|
billingIntervalUnit: Ue.billing_interval_unit,
|
|
@@ -21954,7 +21955,7 @@ function jy({
|
|
|
21954
21955
|
},
|
|
21955
21956
|
onConfirm: ws,
|
|
21956
21957
|
isLoading: Ce.isPending,
|
|
21957
|
-
errorMessage: Ce.isError ?
|
|
21958
|
+
errorMessage: Ce.isError ? v("generic_error") : void 0,
|
|
21958
21959
|
currentNextBillDate: Q.next_bill_date,
|
|
21959
21960
|
billingInterval: Ue.billing_interval,
|
|
21960
21961
|
billingIntervalUnit: Ue.billing_interval_unit
|
|
@@ -21970,7 +21971,7 @@ function jy({
|
|
|
21970
21971
|
},
|
|
21971
21972
|
onConfirm: $s,
|
|
21972
21973
|
isLoading: Pe.isPending,
|
|
21973
|
-
errorMessage: Pe.isError ?
|
|
21974
|
+
errorMessage: Pe.isError ? v("generic_error") : void 0,
|
|
21974
21975
|
defaultNextBillDate: Sl(
|
|
21975
21976
|
Ue.billing_interval,
|
|
21976
21977
|
Ue.billing_interval_unit
|
|
@@ -22018,25 +22019,25 @@ function Ay({
|
|
|
22018
22019
|
renderPaymentMethod: d,
|
|
22019
22020
|
renderShippingAddress: c,
|
|
22020
22021
|
renderAutoApplyPoints: u,
|
|
22021
|
-
renderReactivateDialog:
|
|
22022
|
+
renderReactivateDialog: p,
|
|
22022
22023
|
onUpdatePaymentClick: h,
|
|
22023
|
-
presentation:
|
|
22024
|
+
presentation: v = "dialog"
|
|
22024
22025
|
}) {
|
|
22025
|
-
const { t:
|
|
22026
|
+
const { t: _ } = se();
|
|
22026
22027
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
22027
22028
|
/* @__PURE__ */ i.jsx(e1, { children: /* @__PURE__ */ i.jsx(h1, { children: /* @__PURE__ */ i.jsxs(f1, { className: "text-lg", children: [
|
|
22028
22029
|
/* @__PURE__ */ i.jsx(vr, { children: /* @__PURE__ */ i.jsx(
|
|
22029
22030
|
So,
|
|
22030
22031
|
{
|
|
22031
22032
|
href: "#",
|
|
22032
|
-
onClick: (
|
|
22033
|
-
|
|
22033
|
+
onClick: (b) => {
|
|
22034
|
+
b.preventDefault(), n();
|
|
22034
22035
|
},
|
|
22035
|
-
children:
|
|
22036
|
+
children: _("breadcrumb")
|
|
22036
22037
|
}
|
|
22037
22038
|
) }),
|
|
22038
22039
|
/* @__PURE__ */ i.jsx(Po, {}),
|
|
22039
|
-
/* @__PURE__ */ i.jsx(vr, { children: /* @__PURE__ */ i.jsx(p1, { className: "font-semibold", children:
|
|
22040
|
+
/* @__PURE__ */ i.jsx(vr, { children: /* @__PURE__ */ i.jsx(p1, { className: "font-semibold", children: _("breadcrumb_detail", { token: e }) }) })
|
|
22040
22041
|
] }) }) }),
|
|
22041
22042
|
/* @__PURE__ */ i.jsx("div", { className: "mx-auto max-w-7xl px-4 py-4 sm:px-6 sm:py-6 lg:px-10 lg:py-8", children: /* @__PURE__ */ i.jsx(
|
|
22042
22043
|
jy,
|
|
@@ -22050,9 +22051,9 @@ function Ay({
|
|
|
22050
22051
|
renderPaymentMethod: d,
|
|
22051
22052
|
renderShippingAddress: c,
|
|
22052
22053
|
renderAutoApplyPoints: u,
|
|
22053
|
-
renderReactivateDialog:
|
|
22054
|
+
renderReactivateDialog: p,
|
|
22054
22055
|
onUpdatePaymentClick: h,
|
|
22055
|
-
presentation:
|
|
22056
|
+
presentation: v
|
|
22056
22057
|
}
|
|
22057
22058
|
) })
|
|
22058
22059
|
] });
|
|
@@ -22068,14 +22069,14 @@ function Hy({
|
|
|
22068
22069
|
onDeletePaymentMethod: d,
|
|
22069
22070
|
onMakeDefaultPaymentMethod: c,
|
|
22070
22071
|
addPaymentMethodLabel: u,
|
|
22071
|
-
showAddButton:
|
|
22072
|
+
showAddButton: p = !0,
|
|
22072
22073
|
isLoading: h = !1,
|
|
22073
|
-
isPending:
|
|
22074
|
-
className:
|
|
22075
|
-
presentation:
|
|
22074
|
+
isPending: v = !1,
|
|
22075
|
+
className: _ = "",
|
|
22076
|
+
presentation: b = "dialog"
|
|
22076
22077
|
}) {
|
|
22077
|
-
const { t:
|
|
22078
|
-
return /* @__PURE__ */ i.jsxs("div", { className: ne("border-border mb-6 border-b pb-4",
|
|
22078
|
+
const { t: f } = lt(), y = u ?? f("add_a_payment_method"), [E, w] = m.useState(!1), z = m.useId(), j = n ? Dl(n, f("card_expires")) : null;
|
|
22079
|
+
return /* @__PURE__ */ i.jsxs("div", { className: ne("border-border mb-6 border-b pb-4", _), children: [
|
|
22079
22080
|
/* @__PURE__ */ i.jsxs(
|
|
22080
22081
|
"button",
|
|
22081
22082
|
{
|
|
@@ -22114,7 +22115,7 @@ function Hy({
|
|
|
22114
22115
|
}
|
|
22115
22116
|
) }),
|
|
22116
22117
|
/* @__PURE__ */ i.jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
22117
|
-
/* @__PURE__ */ i.jsx("span", { className: "text-foreground text-sm font-medium", children: gt(n,
|
|
22118
|
+
/* @__PURE__ */ i.jsx("span", { className: "text-foreground text-sm font-medium", children: gt(n, f("card_fallback")) }),
|
|
22118
22119
|
j && /* @__PURE__ */ i.jsx("span", { className: "text-muted-foreground text-sm", children: j })
|
|
22119
22120
|
] })
|
|
22120
22121
|
]
|
|
@@ -22141,16 +22142,16 @@ function Hy({
|
|
|
22141
22142
|
},
|
|
22142
22143
|
`skeleton-${$}`
|
|
22143
22144
|
)) }) : t.map(($) => {
|
|
22144
|
-
const C = r === $.id, F = Dl($,
|
|
22145
|
-
|
|
22145
|
+
const C = r === $.id, F = Dl($, f("card_expires")), P = () => {
|
|
22146
|
+
v || a($);
|
|
22146
22147
|
};
|
|
22147
22148
|
return /* @__PURE__ */ i.jsxs(
|
|
22148
22149
|
"div",
|
|
22149
22150
|
{
|
|
22150
22151
|
role: "option",
|
|
22151
|
-
tabIndex:
|
|
22152
|
+
tabIndex: v ? -1 : 0,
|
|
22152
22153
|
"aria-selected": C,
|
|
22153
|
-
"aria-disabled":
|
|
22154
|
+
"aria-disabled": v,
|
|
22154
22155
|
onClick: P,
|
|
22155
22156
|
onKeyDown: (k) => {
|
|
22156
22157
|
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), P());
|
|
@@ -22176,7 +22177,7 @@ function Hy({
|
|
|
22176
22177
|
] })
|
|
22177
22178
|
] }),
|
|
22178
22179
|
/* @__PURE__ */ i.jsxs("div", { className: "flex shrink-0 flex-row items-center gap-2", children: [
|
|
22179
|
-
$.default && /* @__PURE__ */ i.jsx("span", { className: "bg-primary text-primary-foreground rounded px-2 py-0.5 text-xs font-medium", children:
|
|
22180
|
+
$.default && /* @__PURE__ */ i.jsx("span", { className: "bg-primary text-primary-foreground rounded px-2 py-0.5 text-xs font-medium", children: f("default") }),
|
|
22180
22181
|
(o || d || c) && /* @__PURE__ */ i.jsx(
|
|
22181
22182
|
"span",
|
|
22182
22183
|
{
|
|
@@ -22185,7 +22186,7 @@ function Hy({
|
|
|
22185
22186
|
children: /* @__PURE__ */ i.jsx(
|
|
22186
22187
|
ei,
|
|
22187
22188
|
{
|
|
22188
|
-
presentation:
|
|
22189
|
+
presentation: b,
|
|
22189
22190
|
onEdit: o ? () => o($) : void 0,
|
|
22190
22191
|
onDelete: d ? () => d($) : void 0,
|
|
22191
22192
|
onMakeDefault: !$.default && c ? () => c($) : void 0
|
|
@@ -22201,11 +22202,11 @@ function Hy({
|
|
|
22201
22202
|
})
|
|
22202
22203
|
}
|
|
22203
22204
|
),
|
|
22204
|
-
|
|
22205
|
+
p && /* @__PURE__ */ i.jsx(
|
|
22205
22206
|
"button",
|
|
22206
22207
|
{
|
|
22207
22208
|
type: "button",
|
|
22208
|
-
disabled:
|
|
22209
|
+
disabled: v,
|
|
22209
22210
|
className: "text-foreground mt-3 text-left text-sm disabled:cursor-not-allowed disabled:opacity-60",
|
|
22210
22211
|
onClick: s,
|
|
22211
22212
|
children: y
|
|
@@ -22299,12 +22300,12 @@ function Iy({
|
|
|
22299
22300
|
addDialogOpen: o,
|
|
22300
22301
|
onAddDialogOpenChange: d
|
|
22301
22302
|
}) {
|
|
22302
|
-
const { isMobile: c } = mt(), { t: u } = lt(), { t:
|
|
22303
|
-
|
|
22304
|
-
const
|
|
22305
|
-
|
|
22306
|
-
const
|
|
22307
|
-
|
|
22303
|
+
const { isMobile: c } = mt(), { t: u } = lt(), { t: p } = se(), { locale: h } = In(), v = m.useRef(n);
|
|
22304
|
+
v.current = n;
|
|
22305
|
+
const _ = m.useRef(t);
|
|
22306
|
+
_.current = t;
|
|
22307
|
+
const b = m.useRef(null), f = m.useRef(null), y = (M) => M !== null && bt(
|
|
22308
|
+
v.current,
|
|
22308
22309
|
M
|
|
22309
22310
|
), E = m.useCallback(
|
|
22310
22311
|
(M) => u(M),
|
|
@@ -22344,25 +22345,25 @@ function Iy({
|
|
|
22344
22345
|
[N]
|
|
22345
22346
|
), ge = U1({
|
|
22346
22347
|
subscriptionToken: n,
|
|
22347
|
-
onSucceeded: () => a?.(
|
|
22348
|
-
onFailed: () => a?.(
|
|
22348
|
+
onSucceeded: () => a?.(p("payment_retry_succeeded")),
|
|
22349
|
+
onFailed: () => a?.(p("payment_retry_failed"), "error"),
|
|
22349
22350
|
// The charge is taking longer than the poll window — confirm the card
|
|
22350
22351
|
// saved so the customer isn't left with no feedback (the banner keeps the
|
|
22351
22352
|
// "we'll update once processed" copy).
|
|
22352
|
-
onTimedOut: () => a?.(
|
|
22353
|
+
onTimedOut: () => a?.(p("payment_retry_processing"))
|
|
22353
22354
|
}), me = V1({
|
|
22354
22355
|
onSuccess: ({ subscriptionToken: M }) => {
|
|
22355
22356
|
bt(
|
|
22356
|
-
|
|
22357
|
+
v.current,
|
|
22357
22358
|
M
|
|
22358
|
-
) && !
|
|
22359
|
+
) && !_.current && ge.start();
|
|
22359
22360
|
},
|
|
22360
22361
|
onError: async (M, { subscriptionToken: K }) => {
|
|
22361
22362
|
await gs(
|
|
22362
22363
|
z,
|
|
22363
22364
|
K
|
|
22364
22365
|
), bt(
|
|
22365
|
-
|
|
22366
|
+
v.current,
|
|
22366
22367
|
K
|
|
22367
22368
|
) && s?.("Failed to queue retry", M);
|
|
22368
22369
|
}
|
|
@@ -22375,21 +22376,21 @@ function Iy({
|
|
|
22375
22376
|
await Dy({
|
|
22376
22377
|
queryClient: z,
|
|
22377
22378
|
updatedSubscriptionToken: M,
|
|
22378
|
-
getLatestSubscriptionToken: () =>
|
|
22379
|
-
isExternallyDisabled: () =>
|
|
22379
|
+
getLatestSubscriptionToken: () => v.current,
|
|
22380
|
+
isExternallyDisabled: () => _.current,
|
|
22380
22381
|
queueRetry: (K) => me.mutate({ subscriptionToken: K }),
|
|
22381
22382
|
notifyUpdated: () => a?.(u("default_payment_method_updated"))
|
|
22382
22383
|
});
|
|
22383
22384
|
},
|
|
22384
22385
|
onError: (M, { subscriptionToken: K }) => {
|
|
22385
22386
|
bt(
|
|
22386
|
-
|
|
22387
|
+
v.current,
|
|
22387
22388
|
K
|
|
22388
22389
|
) && s?.(u("failed_to_update_payment_method"), M);
|
|
22389
22390
|
}
|
|
22390
22391
|
}), ze = (M) => {
|
|
22391
|
-
const K =
|
|
22392
|
-
if (!y(K) ||
|
|
22392
|
+
const K = b.current;
|
|
22393
|
+
if (!y(K) || _.current)
|
|
22393
22394
|
return;
|
|
22394
22395
|
const Ye = k.current;
|
|
22395
22396
|
k.current = !1, Ye ? a?.(u("payment_method_added")) : Ne.mutate({
|
|
@@ -22400,13 +22401,13 @@ function Iy({
|
|
|
22400
22401
|
payApi: w,
|
|
22401
22402
|
t: E,
|
|
22402
22403
|
onApproved: async (M) => {
|
|
22403
|
-
const K =
|
|
22404
|
+
const K = b.current;
|
|
22404
22405
|
y(K) && (await z.invalidateQueries({
|
|
22405
22406
|
queryKey: we.paymentMethods.all
|
|
22406
22407
|
}), P(!1), ze(M.payment_method.id));
|
|
22407
22408
|
},
|
|
22408
22409
|
onFailed: (M) => {
|
|
22409
|
-
const K =
|
|
22410
|
+
const K = b.current;
|
|
22410
22411
|
y(K) && W(M);
|
|
22411
22412
|
},
|
|
22412
22413
|
onCanceled: () => {
|
|
@@ -22415,13 +22416,13 @@ function Iy({
|
|
|
22415
22416
|
m.useEffect(() => {
|
|
22416
22417
|
const M = te.current !== n;
|
|
22417
22418
|
M && (te.current = n, k.current = !1, L(null), V(null), B(void 0), W(null));
|
|
22418
|
-
const K =
|
|
22419
|
-
!Fe.isActive && (M || K) && (
|
|
22419
|
+
const K = b.current !== null && b.current !== n;
|
|
22420
|
+
!Fe.isActive && (M || K) && (b.current = null, P(!1));
|
|
22420
22421
|
}, [Fe.isActive, P, n]);
|
|
22421
22422
|
const De = as({
|
|
22422
22423
|
begin: Fe.begin,
|
|
22423
22424
|
onCreated: (M) => {
|
|
22424
|
-
const K =
|
|
22425
|
+
const K = b.current;
|
|
22425
22426
|
y(K) && (z.invalidateQueries({
|
|
22426
22427
|
queryKey: we.paymentMethods.all
|
|
22427
22428
|
}), P(!1), ze(M));
|
|
@@ -22445,10 +22446,10 @@ function Iy({
|
|
|
22445
22446
|
browser_info: ns()
|
|
22446
22447
|
}),
|
|
22447
22448
|
onSuccess: async (M) => {
|
|
22448
|
-
y(
|
|
22449
|
+
y(b.current) && await De(M);
|
|
22449
22450
|
},
|
|
22450
22451
|
onError: (M) => {
|
|
22451
|
-
const K =
|
|
22452
|
+
const K = b.current;
|
|
22452
22453
|
y(K) && s?.(u("failed_to_add_payment_method"), M);
|
|
22453
22454
|
}
|
|
22454
22455
|
}), Pe = fe({
|
|
@@ -22468,7 +22469,7 @@ function Iy({
|
|
|
22468
22469
|
z.invalidateQueries({ queryKey: we.addresses.all });
|
|
22469
22470
|
},
|
|
22470
22471
|
onError: (M) => {
|
|
22471
|
-
const K =
|
|
22472
|
+
const K = f.current;
|
|
22472
22473
|
y(K) && s?.(u("failed_to_create_address"), M);
|
|
22473
22474
|
}
|
|
22474
22475
|
}), q = fe({
|
|
@@ -22493,11 +22494,11 @@ function Iy({
|
|
|
22493
22494
|
await z.invalidateQueries({
|
|
22494
22495
|
queryKey: we.paymentMethods.all
|
|
22495
22496
|
});
|
|
22496
|
-
const M =
|
|
22497
|
+
const M = f.current;
|
|
22497
22498
|
y(M) && a?.(u("default_payment_method_updated"));
|
|
22498
22499
|
},
|
|
22499
22500
|
onError: (M) => {
|
|
22500
|
-
const K =
|
|
22501
|
+
const K = f.current;
|
|
22501
22502
|
y(K) && s?.(u("failed_to_update_payment_method"), M);
|
|
22502
22503
|
}
|
|
22503
22504
|
}), R = fe({
|
|
@@ -22506,7 +22507,7 @@ function Iy({
|
|
|
22506
22507
|
await z.invalidateQueries({
|
|
22507
22508
|
queryKey: we.paymentMethods.all
|
|
22508
22509
|
});
|
|
22509
|
-
const M =
|
|
22510
|
+
const M = f.current;
|
|
22510
22511
|
y(M) && a?.(u("payment_method_deleted"));
|
|
22511
22512
|
}
|
|
22512
22513
|
}), X = fe({
|
|
@@ -22528,17 +22529,17 @@ function Iy({
|
|
|
22528
22529
|
await z.invalidateQueries({
|
|
22529
22530
|
queryKey: we.paymentMethods.all
|
|
22530
22531
|
});
|
|
22531
|
-
const M =
|
|
22532
|
+
const M = f.current;
|
|
22532
22533
|
y(M) && a?.(u("default_payment_method_updated"));
|
|
22533
22534
|
},
|
|
22534
22535
|
onError: (M) => {
|
|
22535
|
-
const K =
|
|
22536
|
+
const K = f.current;
|
|
22536
22537
|
y(K) && s?.(u("failed_to_set_default_payment_method"), M);
|
|
22537
22538
|
}
|
|
22538
22539
|
}), A = Ty(
|
|
22539
22540
|
ie,
|
|
22540
22541
|
e
|
|
22541
|
-
), Ee = A.find((M) => M.id === e.id) ?? ky(e), de = Pe.isPending || q.isPending || R.isPending || X.isPending, he = Ce.isPending || Fe.isActive, He = Ne.isPending || me.isPending || ge.isProcessing || he || de, Te = Ne.isPending && Ne.variables?.subscriptionToken === n || me.isPending && me.variables?.subscriptionToken === n || ge.isProcessing || he &&
|
|
22542
|
+
), Ee = A.find((M) => M.id === e.id) ?? ky(e), de = Pe.isPending || q.isPending || R.isPending || X.isPending, he = Ce.isPending || Fe.isActive, He = Ne.isPending || me.isPending || ge.isProcessing || he || de, Te = Ne.isPending && Ne.variables?.subscriptionToken === n || me.isPending && me.variables?.subscriptionToken === n || ge.isProcessing || he && b.current === n || de && f.current === n, be = t || He;
|
|
22542
22543
|
m.useEffect(() => {
|
|
22543
22544
|
r?.({
|
|
22544
22545
|
subscriptionToken: n,
|
|
@@ -22556,7 +22557,7 @@ function Iy({
|
|
|
22556
22557
|
const Le = async () => {
|
|
22557
22558
|
if (be || !S) return;
|
|
22558
22559
|
const M = n;
|
|
22559
|
-
|
|
22560
|
+
f.current = M, B(void 0);
|
|
22560
22561
|
try {
|
|
22561
22562
|
await R.mutateAsync(S.id), y(M) && V(null);
|
|
22562
22563
|
} catch (K) {
|
|
@@ -22570,7 +22571,7 @@ function Iy({
|
|
|
22570
22571
|
Hy,
|
|
22571
22572
|
{
|
|
22572
22573
|
presentation: c ? "bottom-sheet" : "dialog",
|
|
22573
|
-
title:
|
|
22574
|
+
title: p("payment_method"),
|
|
22574
22575
|
displayPaymentMethod: Ee,
|
|
22575
22576
|
paymentMethodList: A,
|
|
22576
22577
|
onAddPaymentMethodClick: () => {
|
|
@@ -22592,7 +22593,7 @@ function Iy({
|
|
|
22592
22593
|
B(void 0), V(M);
|
|
22593
22594
|
},
|
|
22594
22595
|
onMakeDefaultPaymentMethod: be ? void 0 : (M) => {
|
|
22595
|
-
|
|
22596
|
+
f.current = n, X.mutate(M);
|
|
22596
22597
|
}
|
|
22597
22598
|
}
|
|
22598
22599
|
),
|
|
@@ -22602,13 +22603,13 @@ function Iy({
|
|
|
22602
22603
|
presentation: c ? "bottom-sheet" : "dialog",
|
|
22603
22604
|
isOpen: F,
|
|
22604
22605
|
onClose: () => {
|
|
22605
|
-
Fe.isActive || (k.current = !1,
|
|
22606
|
+
Fe.isActive || (k.current = !1, b.current = null, W(null), P(!1));
|
|
22606
22607
|
},
|
|
22607
22608
|
error: Y ?? void 0,
|
|
22608
22609
|
t: E,
|
|
22609
22610
|
onSubmit: async (M) => {
|
|
22610
22611
|
if (!be) {
|
|
22611
|
-
|
|
22612
|
+
b.current = n, W(null);
|
|
22612
22613
|
try {
|
|
22613
22614
|
await Ce.mutateAsync(M);
|
|
22614
22615
|
} catch {
|
|
@@ -22630,7 +22631,7 @@ function Iy({
|
|
|
22630
22631
|
onSubmit: async (Ue) => {
|
|
22631
22632
|
if (be) return;
|
|
22632
22633
|
const jt = n;
|
|
22633
|
-
|
|
22634
|
+
f.current = jt;
|
|
22634
22635
|
try {
|
|
22635
22636
|
const tr = await Pe.mutateAsync(Ue);
|
|
22636
22637
|
y(jt) && Ye(Wa(tr));
|
|
@@ -22657,7 +22658,7 @@ function Iy({
|
|
|
22657
22658
|
onSubmit: async (M) => {
|
|
22658
22659
|
if (be || !D) return;
|
|
22659
22660
|
const K = n;
|
|
22660
|
-
|
|
22661
|
+
f.current = K;
|
|
22661
22662
|
try {
|
|
22662
22663
|
await q.mutateAsync({
|
|
22663
22664
|
paymentMethodId: D.id,
|
|
@@ -22707,15 +22708,15 @@ function xs({
|
|
|
22707
22708
|
onDeleteAddress: d,
|
|
22708
22709
|
onMakeDefaultAddress: c,
|
|
22709
22710
|
addAddressLabel: u,
|
|
22710
|
-
showAddButton:
|
|
22711
|
+
showAddButton: p = !0,
|
|
22711
22712
|
isLoading: h = !1,
|
|
22712
|
-
isPending:
|
|
22713
|
-
defaultOpen:
|
|
22714
|
-
className:
|
|
22715
|
-
presentation:
|
|
22713
|
+
isPending: v = !1,
|
|
22714
|
+
defaultOpen: _ = !1,
|
|
22715
|
+
className: b = "",
|
|
22716
|
+
presentation: f = "dialog"
|
|
22716
22717
|
}) {
|
|
22717
|
-
const { t: y } = lt(), E = u ?? y("add_an_address"), [w, z] = m.useState(
|
|
22718
|
-
return /* @__PURE__ */ i.jsxs("div", { className: ne("border-border mb-6 border-b pb-4",
|
|
22718
|
+
const { t: y } = lt(), E = u ?? y("add_an_address"), [w, z] = m.useState(_), j = m.useId();
|
|
22719
|
+
return /* @__PURE__ */ i.jsxs("div", { className: ne("border-border mb-6 border-b pb-4", b), children: [
|
|
22719
22720
|
/* @__PURE__ */ i.jsxs(
|
|
22720
22721
|
"button",
|
|
22721
22722
|
{
|
|
@@ -22768,15 +22769,15 @@ function xs({
|
|
|
22768
22769
|
/* @__PURE__ */ i.jsx(oe, { className: "h-4 w-40" })
|
|
22769
22770
|
] }, `skeleton-${$}`)) }) : t.map(($) => {
|
|
22770
22771
|
const C = r === $.id, F = () => {
|
|
22771
|
-
|
|
22772
|
+
v || a($);
|
|
22772
22773
|
};
|
|
22773
22774
|
return /* @__PURE__ */ i.jsxs(
|
|
22774
22775
|
"div",
|
|
22775
22776
|
{
|
|
22776
22777
|
role: "option",
|
|
22777
|
-
tabIndex:
|
|
22778
|
+
tabIndex: v ? -1 : 0,
|
|
22778
22779
|
"aria-selected": C,
|
|
22779
|
-
"aria-disabled":
|
|
22780
|
+
"aria-disabled": v,
|
|
22780
22781
|
onClick: F,
|
|
22781
22782
|
onKeyDown: (P) => {
|
|
22782
22783
|
(P.key === "Enter" || P.key === " ") && (P.preventDefault(), F());
|
|
@@ -22803,7 +22804,7 @@ function xs({
|
|
|
22803
22804
|
children: /* @__PURE__ */ i.jsx(
|
|
22804
22805
|
ei,
|
|
22805
22806
|
{
|
|
22806
|
-
presentation:
|
|
22807
|
+
presentation: f,
|
|
22807
22808
|
onEdit: o ? () => o($) : void 0,
|
|
22808
22809
|
onDelete: d ? () => d($) : void 0,
|
|
22809
22810
|
onMakeDefault: !$.default && c ? () => c($) : void 0
|
|
@@ -22819,11 +22820,11 @@ function xs({
|
|
|
22819
22820
|
})
|
|
22820
22821
|
}
|
|
22821
22822
|
),
|
|
22822
|
-
|
|
22823
|
+
p && /* @__PURE__ */ i.jsx(
|
|
22823
22824
|
"button",
|
|
22824
22825
|
{
|
|
22825
22826
|
type: "button",
|
|
22826
|
-
disabled:
|
|
22827
|
+
disabled: v,
|
|
22827
22828
|
className: "text-foreground mt-3 text-left text-sm disabled:cursor-not-allowed disabled:opacity-60",
|
|
22828
22829
|
onClick: s,
|
|
22829
22830
|
children: E
|
|
@@ -22872,27 +22873,27 @@ function Uy({
|
|
|
22872
22873
|
onSuccess: a,
|
|
22873
22874
|
onError: s
|
|
22874
22875
|
}) {
|
|
22875
|
-
const { isMobile: o } = mt(), { t: d } = lt(), { t: c } = se(), { config: u } = n1(), { locale:
|
|
22876
|
+
const { isMobile: o } = mt(), { t: d } = lt(), { t: c } = se(), { config: u } = n1(), { locale: p } = In(), h = m.useRef(t);
|
|
22876
22877
|
h.current = t;
|
|
22877
|
-
const
|
|
22878
|
+
const v = (N) => bt(
|
|
22878
22879
|
h.current,
|
|
22879
22880
|
N
|
|
22880
|
-
),
|
|
22881
|
+
), _ = m.useCallback(
|
|
22881
22882
|
(N) => d(N),
|
|
22882
22883
|
[d]
|
|
22883
|
-
),
|
|
22884
|
-
() => vl(
|
|
22885
|
-
[
|
|
22884
|
+
), b = rn(), f = Me(), y = m.useMemo(
|
|
22885
|
+
() => vl(b),
|
|
22886
|
+
[b]
|
|
22886
22887
|
), [E, w] = m.useState(!1), [z, j] = m.useState(null), [$, C] = m.useState(null), [F, P] = m.useState(void 0), k = m.useRef(t);
|
|
22887
22888
|
m.useEffect(() => {
|
|
22888
22889
|
k.current !== t && (k.current = t, w(!1), j(null), C(null), P(void 0));
|
|
22889
22890
|
}, [t]);
|
|
22890
22891
|
const { data: D = [], isLoading: L } = je({
|
|
22891
22892
|
queryKey: we.addresses.list(),
|
|
22892
|
-
queryFn: async () => (await
|
|
22893
|
+
queryFn: async () => (await b.fetchAddresses()).addresses.map(By)
|
|
22893
22894
|
}), S = qr(), { data: V } = je({
|
|
22894
|
-
queryKey: Vr.countries(
|
|
22895
|
-
queryFn: () => S.listCountries({ languageIso:
|
|
22895
|
+
queryKey: Vr.countries(p),
|
|
22896
|
+
queryFn: () => S.listCountries({ languageIso: p }),
|
|
22896
22897
|
enabled: E
|
|
22897
22898
|
}), T = m.useMemo(
|
|
22898
22899
|
() => [...V?.countries ?? []].map((N) => ({ iso: N.code, name: N.name })).sort((N, G) => N.name.localeCompare(G.name)),
|
|
@@ -22922,7 +22923,7 @@ function Uy({
|
|
|
22922
22923
|
mutationFn: async ({
|
|
22923
22924
|
body: N
|
|
22924
22925
|
}) => {
|
|
22925
|
-
const G = new Set(D.map((me) => me.id)), ge = await
|
|
22926
|
+
const G = new Set(D.map((me) => me.id)), ge = await b.createAddress({
|
|
22926
22927
|
address: {
|
|
22927
22928
|
name: N.address.name,
|
|
22928
22929
|
street1: N.address.address1,
|
|
@@ -22938,16 +22939,16 @@ function Uy({
|
|
|
22938
22939
|
return { address: ge, deduped: G.has(ge.id) };
|
|
22939
22940
|
},
|
|
22940
22941
|
onSuccess: ({ deduped: N }, { subscriptionToken: G }) => {
|
|
22941
|
-
|
|
22942
|
+
f.invalidateQueries({ queryKey: we.addresses.all }), v(G) && (N ? a?.(d("address_already_exists"), "warning") : a?.(d("address_created"), "success"));
|
|
22942
22943
|
},
|
|
22943
22944
|
onError: (N, { subscriptionToken: G }) => {
|
|
22944
|
-
|
|
22945
|
+
v(G) && s?.(d("failed_to_create_address"), N);
|
|
22945
22946
|
}
|
|
22946
22947
|
}), ie = fe({
|
|
22947
22948
|
mutationFn: ({
|
|
22948
22949
|
addressId: N,
|
|
22949
22950
|
body: G
|
|
22950
|
-
}) =>
|
|
22951
|
+
}) => b.updateAddress(N, {
|
|
22951
22952
|
address: {
|
|
22952
22953
|
name: G.address.name,
|
|
22953
22954
|
street1: G.address.address1,
|
|
@@ -22961,22 +22962,22 @@ function Uy({
|
|
|
22961
22962
|
}
|
|
22962
22963
|
}),
|
|
22963
22964
|
onSuccess: (N, { subscriptionToken: G }) => {
|
|
22964
|
-
|
|
22965
|
+
f.invalidateQueries({ queryKey: we.addresses.all }), v(G) && a?.(d("address_updated"));
|
|
22965
22966
|
},
|
|
22966
22967
|
onError: (N, { subscriptionToken: G }) => {
|
|
22967
|
-
|
|
22968
|
+
v(G) && s?.(d("failed_to_update_address"), N);
|
|
22968
22969
|
}
|
|
22969
22970
|
}), Q = fe({
|
|
22970
22971
|
mutationFn: ({
|
|
22971
22972
|
addressId: N
|
|
22972
|
-
}) =>
|
|
22973
|
+
}) => b.deleteAddress(N),
|
|
22973
22974
|
onSuccess: (N, { subscriptionToken: G }) => {
|
|
22974
|
-
|
|
22975
|
+
f.invalidateQueries({ queryKey: we.addresses.all }), v(G) && a?.(d("address_deleted"));
|
|
22975
22976
|
}
|
|
22976
22977
|
}), le = fe({
|
|
22977
22978
|
mutationFn: ({
|
|
22978
22979
|
address: N
|
|
22979
|
-
}) =>
|
|
22980
|
+
}) => b.updateAddress(N.id, {
|
|
22980
22981
|
address: {
|
|
22981
22982
|
name: N.name ?? null,
|
|
22982
22983
|
street1: N.address1 ?? "",
|
|
@@ -22990,10 +22991,10 @@ function Uy({
|
|
|
22990
22991
|
}
|
|
22991
22992
|
}),
|
|
22992
22993
|
onSuccess: (N, { subscriptionToken: G }) => {
|
|
22993
|
-
|
|
22994
|
+
f.invalidateQueries({ queryKey: we.addresses.all }), v(G) && a?.(d("default_address_updated"));
|
|
22994
22995
|
},
|
|
22995
22996
|
onError: (N, { subscriptionToken: G }) => {
|
|
22996
|
-
|
|
22997
|
+
v(G) && s?.(d("failed_to_update_default_address"), N);
|
|
22997
22998
|
}
|
|
22998
22999
|
}), ve = (e !== null ? D.find((N) => N.id === e) : void 0) ?? (n ? D.find(
|
|
22999
23000
|
(N) => N.address1 === n.address1 && N.postal_code === n.postal_code && N.city === n.city
|
|
@@ -23007,9 +23008,9 @@ function Uy({
|
|
|
23007
23008
|
await Q.mutateAsync({
|
|
23008
23009
|
subscriptionToken: N,
|
|
23009
23010
|
addressId: $.id
|
|
23010
|
-
}),
|
|
23011
|
+
}), v(N) && C(null);
|
|
23011
23012
|
} catch (G) {
|
|
23012
|
-
|
|
23013
|
+
v(N) && P(
|
|
23013
23014
|
G instanceof Error ? G.message : d("unable_to_delete_address")
|
|
23014
23015
|
);
|
|
23015
23016
|
}
|
|
@@ -23056,8 +23057,8 @@ function Uy({
|
|
|
23056
23057
|
onClose: I,
|
|
23057
23058
|
selectedAddress: z,
|
|
23058
23059
|
defaultCountry: D.find((N) => N.default)?.country_code ?? n?.country_code ?? u.countryIso ?? "US",
|
|
23059
|
-
languageIso:
|
|
23060
|
-
t:
|
|
23060
|
+
languageIso: p,
|
|
23061
|
+
t: _,
|
|
23061
23062
|
onSubmit: async (N) => {
|
|
23062
23063
|
const G = t;
|
|
23063
23064
|
try {
|
|
@@ -23068,7 +23069,7 @@ function Uy({
|
|
|
23068
23069
|
}) : await te.mutateAsync({
|
|
23069
23070
|
subscriptionToken: G,
|
|
23070
23071
|
body: N
|
|
23071
|
-
}),
|
|
23072
|
+
}), v(G) && I();
|
|
23072
23073
|
} catch {
|
|
23073
23074
|
}
|
|
23074
23075
|
},
|
|
@@ -23131,12 +23132,12 @@ function qy({
|
|
|
23131
23132
|
exact: !0
|
|
23132
23133
|
}), o.current && o.current !== c.subscriptionToken)
|
|
23133
23134
|
return;
|
|
23134
|
-
const
|
|
23135
|
+
const p = s.getQueryData(
|
|
23135
23136
|
e.detail(c.subscriptionToken)
|
|
23136
23137
|
);
|
|
23137
23138
|
t?.({
|
|
23138
23139
|
result: d,
|
|
23139
|
-
refreshed:
|
|
23140
|
+
refreshed: p?.subscription.auto_apply_points === c.autoApplyPoints,
|
|
23140
23141
|
variables: c
|
|
23141
23142
|
});
|
|
23142
23143
|
},
|
|
@@ -23193,8 +23194,8 @@ function Qy({
|
|
|
23193
23194
|
Ve,
|
|
23194
23195
|
{
|
|
23195
23196
|
open: !0,
|
|
23196
|
-
onOpenChange: (
|
|
23197
|
-
|
|
23197
|
+
onOpenChange: (p) => {
|
|
23198
|
+
p || d();
|
|
23198
23199
|
},
|
|
23199
23200
|
title: c(
|
|
23200
23201
|
r ? "auto_apply_points_bundle_title" : "auto_apply_points_bundle_title_off",
|
|
@@ -23203,9 +23204,9 @@ function Qy({
|
|
|
23203
23204
|
description: c("auto_apply_points_bundle_body"),
|
|
23204
23205
|
presentation: a,
|
|
23205
23206
|
children: [
|
|
23206
|
-
/* @__PURE__ */ i.jsx("ul", { className: "space-y-1 text-sm", children: e.members.map((
|
|
23207
|
-
name:
|
|
23208
|
-
}) :
|
|
23207
|
+
/* @__PURE__ */ i.jsx("ul", { className: "space-y-1 text-sm", children: e.members.map((p) => /* @__PURE__ */ i.jsx("li", { className: "text-foreground", children: p.status === "paused" ? c("auto_apply_points_bundle_member_paused", {
|
|
23208
|
+
name: p.label
|
|
23209
|
+
}) : p.label }, p.subscription_token)) }),
|
|
23209
23210
|
u ? /* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground mt-3 text-sm", children: c("auto_apply_points_bundle_split_warning") }) : null,
|
|
23210
23211
|
/* @__PURE__ */ i.jsxs(tt, { children: [
|
|
23211
23212
|
/* @__PURE__ */ i.jsx(
|
|
@@ -23253,11 +23254,11 @@ function Xy({
|
|
|
23253
23254
|
presentation: d = "dialog",
|
|
23254
23255
|
fallbackWrite: c,
|
|
23255
23256
|
onSuccess: u,
|
|
23256
|
-
onError:
|
|
23257
|
+
onError: p
|
|
23257
23258
|
}) {
|
|
23258
|
-
const { t: h } = se(),
|
|
23259
|
-
|
|
23260
|
-
const [
|
|
23259
|
+
const { t: h } = se(), v = m.useId(), _ = Me(), b = m.useRef(t);
|
|
23260
|
+
b.current = t;
|
|
23261
|
+
const [f, y] = m.useState(null), E = m.useRef(!1), [w, z] = m.useState(t);
|
|
23261
23262
|
t !== w && (z(t), y(null), E.current = !1);
|
|
23262
23263
|
const j = fe({
|
|
23263
23264
|
mutationFn: (D) => c ? c(D) : Promise.reject(
|
|
@@ -23273,13 +23274,13 @@ function Xy({
|
|
|
23273
23274
|
autoApplyPoints: S
|
|
23274
23275
|
}) => {
|
|
23275
23276
|
for (const T of o.lists)
|
|
23276
|
-
|
|
23277
|
-
if (await
|
|
23277
|
+
_.invalidateQueries({ queryKey: T });
|
|
23278
|
+
if (await _.refetchQueries({
|
|
23278
23279
|
queryKey: o.detail(L),
|
|
23279
23280
|
exact: !0
|
|
23280
|
-
}),
|
|
23281
|
+
}), b.current !== L)
|
|
23281
23282
|
return;
|
|
23282
|
-
if (
|
|
23283
|
+
if (_.getQueryData(
|
|
23283
23284
|
o.detail(L)
|
|
23284
23285
|
)?.subscription.auto_apply_points !== S) {
|
|
23285
23286
|
u?.(
|
|
@@ -23293,7 +23294,7 @@ function Xy({
|
|
|
23293
23294
|
u?.(h("auto_apply_points_updated", { label: s }));
|
|
23294
23295
|
},
|
|
23295
23296
|
onError: (D, { subscriptionToken: L }) => {
|
|
23296
|
-
|
|
23297
|
+
b.current === L && p?.(
|
|
23297
23298
|
h("failed_to_update_auto_apply_points", { label: s }),
|
|
23298
23299
|
D
|
|
23299
23300
|
);
|
|
@@ -23333,10 +23334,10 @@ function Xy({
|
|
|
23333
23334
|
},
|
|
23334
23335
|
onError: (D) => {
|
|
23335
23336
|
if (D instanceof K1) {
|
|
23336
|
-
|
|
23337
|
+
p?.(h("auto_apply_points_bundle_conflict_retry"));
|
|
23337
23338
|
return;
|
|
23338
23339
|
}
|
|
23339
|
-
|
|
23340
|
+
p?.(
|
|
23340
23341
|
h("failed_to_update_auto_apply_points", { label: s }),
|
|
23341
23342
|
D
|
|
23342
23343
|
);
|
|
@@ -23381,7 +23382,7 @@ function Xy({
|
|
|
23381
23382
|
function k(D) {
|
|
23382
23383
|
if (E.current) return;
|
|
23383
23384
|
E.current = !0;
|
|
23384
|
-
const L =
|
|
23385
|
+
const L = f;
|
|
23385
23386
|
y(null), L !== null && $.mutate({
|
|
23386
23387
|
subscriptionToken: t,
|
|
23387
23388
|
autoApplyPoints: L,
|
|
@@ -23392,26 +23393,26 @@ function Xy({
|
|
|
23392
23393
|
return F.visible ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
23393
23394
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
23394
23395
|
/* @__PURE__ */ i.jsxs("div", { children: [
|
|
23395
|
-
/* @__PURE__ */ i.jsx("p", { id:
|
|
23396
|
+
/* @__PURE__ */ i.jsx("p", { id: v, className: "text-foreground text-sm font-medium", children: h("auto_apply_points_each_renewal", { label: s }) }),
|
|
23396
23397
|
/* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: h("auto_apply_points_partial_balance") })
|
|
23397
23398
|
] }),
|
|
23398
23399
|
/* @__PURE__ */ i.jsx(
|
|
23399
23400
|
ao,
|
|
23400
23401
|
{
|
|
23401
|
-
"aria-labelledby":
|
|
23402
|
+
"aria-labelledby": v,
|
|
23402
23403
|
checked: F.checked,
|
|
23403
23404
|
disabled: F.disabled,
|
|
23404
23405
|
onCheckedChange: P
|
|
23405
23406
|
}
|
|
23406
23407
|
)
|
|
23407
23408
|
] }),
|
|
23408
|
-
|
|
23409
|
+
f !== null && a ? /* @__PURE__ */ i.jsx(
|
|
23409
23410
|
Qy,
|
|
23410
23411
|
{
|
|
23411
23412
|
bundle: a,
|
|
23412
23413
|
pointsLabel: s,
|
|
23413
23414
|
targetToken: t,
|
|
23414
|
-
nextValue:
|
|
23415
|
+
nextValue: f,
|
|
23415
23416
|
presentation: d,
|
|
23416
23417
|
onConfirmAll: () => k("bundle"),
|
|
23417
23418
|
onConfirmOne: () => k("subscription"),
|
|
@@ -23477,16 +23478,16 @@ function tb({
|
|
|
23477
23478
|
queryKey: we.addresses.list(),
|
|
23478
23479
|
queryFn: async () => (await d.fetchAddresses()).addresses.map(Jy),
|
|
23479
23480
|
enabled: e
|
|
23480
|
-
}), [
|
|
23481
|
+
}), [p, h] = m.useState(
|
|
23481
23482
|
null
|
|
23482
23483
|
);
|
|
23483
23484
|
m.useEffect(() => {
|
|
23484
23485
|
e && h(null);
|
|
23485
23486
|
}, [e]);
|
|
23486
|
-
const
|
|
23487
|
-
() => c.find((w) => w.id ===
|
|
23488
|
-
[c,
|
|
23489
|
-
),
|
|
23487
|
+
const v = p != null && c.some((w) => w.id === p) ? p : null, _ = m.useMemo(
|
|
23488
|
+
() => c.find((w) => w.id === v) ?? null,
|
|
23489
|
+
[c, v]
|
|
23490
|
+
), f = !u && c.length === 0, y = (v != null || f) && !r, E = (w) => {
|
|
23490
23491
|
w || h(null), n(w);
|
|
23491
23492
|
};
|
|
23492
23493
|
return /* @__PURE__ */ i.jsxs(
|
|
@@ -23498,15 +23499,15 @@ function tb({
|
|
|
23498
23499
|
description: s("reactivate_dialog_description"),
|
|
23499
23500
|
presentation: o ? "bottom-sheet" : "dialog",
|
|
23500
23501
|
children: [
|
|
23501
|
-
/* @__PURE__ */ i.jsx("div", { className: "space-y-4", children: !
|
|
23502
|
+
/* @__PURE__ */ i.jsx("div", { className: "space-y-4", children: !f && /* @__PURE__ */ i.jsxs("div", { children: [
|
|
23502
23503
|
/* @__PURE__ */ i.jsx(
|
|
23503
23504
|
xs,
|
|
23504
23505
|
{
|
|
23505
23506
|
presentation: o ? "bottom-sheet" : "dialog",
|
|
23506
23507
|
title: s("shipping_address"),
|
|
23507
|
-
displayAddress:
|
|
23508
|
+
displayAddress: _,
|
|
23508
23509
|
addressList: c,
|
|
23509
|
-
selectedAddressId:
|
|
23510
|
+
selectedAddressId: v ?? 0,
|
|
23510
23511
|
onSelectAddress: (w) => h(w.id),
|
|
23511
23512
|
onAddAddressClick: () => {
|
|
23512
23513
|
},
|
|
@@ -23516,7 +23517,7 @@ function tb({
|
|
|
23516
23517
|
defaultOpen: !0
|
|
23517
23518
|
}
|
|
23518
23519
|
),
|
|
23519
|
-
|
|
23520
|
+
v == null && /* @__PURE__ */ i.jsx("p", { className: "text-destructive mt-1 text-xs", children: s("reactivate_select_address") })
|
|
23520
23521
|
] }) }),
|
|
23521
23522
|
a && /* @__PURE__ */ i.jsx("p", { className: "text-destructive text-left text-sm", children: s("failed_to_reactivate") }),
|
|
23522
23523
|
/* @__PURE__ */ i.jsx(tt, { children: /* @__PURE__ */ i.jsxs("div", { className: "flex w-full flex-row justify-between gap-x-2", children: [
|
|
@@ -23533,7 +23534,7 @@ function tb({
|
|
|
23533
23534
|
{
|
|
23534
23535
|
type: "button",
|
|
23535
23536
|
className: "bg-primary text-primary-foreground h-10 min-w-[70px] rounded p-3 hover:opacity-90 disabled:opacity-50",
|
|
23536
|
-
onClick: () => t({ addressId:
|
|
23537
|
+
onClick: () => t({ addressId: v }),
|
|
23537
23538
|
disabled: !y,
|
|
23538
23539
|
children: r ? /* @__PURE__ */ i.jsx("div", { className: "border-primary-foreground size-5 animate-spin rounded-full border-4 border-t-4 border-t-transparent" }) : s("reactivate")
|
|
23539
23540
|
}
|
|
@@ -23551,25 +23552,25 @@ function zb({
|
|
|
23551
23552
|
() => t("subscriptions"),
|
|
23552
23553
|
[t]
|
|
23553
23554
|
), c = m.useCallback(
|
|
23554
|
-
(
|
|
23555
|
+
(_) => t(`subscriptions/${_}`),
|
|
23555
23556
|
[t]
|
|
23556
23557
|
), u = m.useCallback(() => {
|
|
23557
23558
|
n(r("subscription_not_found"), "warning"), t("subscriptions");
|
|
23558
|
-
}, [n, t, r]),
|
|
23559
|
-
(
|
|
23560
|
-
const
|
|
23561
|
-
n(r("failed_to_load_subscription", { message:
|
|
23559
|
+
}, [n, t, r]), p = m.useCallback(
|
|
23560
|
+
(_) => {
|
|
23561
|
+
const b = _ instanceof Error ? _.message : r("error_occurred");
|
|
23562
|
+
n(r("failed_to_load_subscription", { message: b }), "error");
|
|
23562
23563
|
},
|
|
23563
23564
|
[n, r]
|
|
23564
23565
|
), h = m.useCallback(
|
|
23565
|
-
(
|
|
23566
|
-
n(
|
|
23566
|
+
(_, b = "success") => {
|
|
23567
|
+
n(_, b);
|
|
23567
23568
|
},
|
|
23568
23569
|
[n]
|
|
23569
|
-
),
|
|
23570
|
-
(
|
|
23571
|
-
const
|
|
23572
|
-
n(`${
|
|
23570
|
+
), v = m.useCallback(
|
|
23571
|
+
(_, b) => {
|
|
23572
|
+
const f = b instanceof Error ? b.message : r("error_occurred");
|
|
23573
|
+
n(`${_}: ${f}`, "error");
|
|
23573
23574
|
},
|
|
23574
23575
|
[n, r]
|
|
23575
23576
|
);
|
|
@@ -23581,46 +23582,46 @@ function zb({
|
|
|
23581
23582
|
onNavigateToList: d,
|
|
23582
23583
|
onNavigateToSubscription: c,
|
|
23583
23584
|
onNotFound: u,
|
|
23584
|
-
onError:
|
|
23585
|
+
onError: p,
|
|
23585
23586
|
onSuccess: h,
|
|
23586
|
-
onMutationError:
|
|
23587
|
+
onMutationError: v,
|
|
23587
23588
|
onUpdatePaymentClick: () => o(!0),
|
|
23588
|
-
renderPaymentMethod: (
|
|
23589
|
+
renderPaymentMethod: (_) => /* @__PURE__ */ i.jsx(
|
|
23589
23590
|
Ly,
|
|
23590
23591
|
{
|
|
23591
|
-
...
|
|
23592
|
-
onSuccess: (
|
|
23593
|
-
onError: (
|
|
23594
|
-
const y =
|
|
23595
|
-
n(`${
|
|
23592
|
+
..._,
|
|
23593
|
+
onSuccess: (b, f) => n(b, f ?? "success"),
|
|
23594
|
+
onError: (b, f) => {
|
|
23595
|
+
const y = f instanceof Error ? f.message : r("error_occurred");
|
|
23596
|
+
n(`${b}: ${y}`, "error");
|
|
23596
23597
|
},
|
|
23597
23598
|
addDialogOpen: s,
|
|
23598
23599
|
onAddDialogOpenChange: o
|
|
23599
23600
|
}
|
|
23600
23601
|
),
|
|
23601
|
-
renderShippingAddress: (
|
|
23602
|
+
renderShippingAddress: (_) => /* @__PURE__ */ i.jsx(
|
|
23602
23603
|
Vy,
|
|
23603
23604
|
{
|
|
23604
|
-
...
|
|
23605
|
-
onSuccess: (
|
|
23606
|
-
onError: (
|
|
23607
|
-
const y =
|
|
23608
|
-
n(`${
|
|
23605
|
+
..._,
|
|
23606
|
+
onSuccess: (b, f) => n(b, f ?? "success"),
|
|
23607
|
+
onError: (b, f) => {
|
|
23608
|
+
const y = f instanceof Error ? f.message : r("error_occurred");
|
|
23609
|
+
n(`${b}: ${y}`, "error");
|
|
23609
23610
|
}
|
|
23610
23611
|
}
|
|
23611
23612
|
),
|
|
23612
|
-
renderAutoApplyPoints: (
|
|
23613
|
+
renderAutoApplyPoints: (_) => /* @__PURE__ */ i.jsx(
|
|
23613
23614
|
Zy,
|
|
23614
23615
|
{
|
|
23615
|
-
...
|
|
23616
|
-
onSuccess: (
|
|
23617
|
-
onError: (
|
|
23618
|
-
const y =
|
|
23619
|
-
n(y ? `${
|
|
23616
|
+
..._,
|
|
23617
|
+
onSuccess: (b, f) => n(b, f ?? "success"),
|
|
23618
|
+
onError: (b, f) => {
|
|
23619
|
+
const y = f instanceof Error ? f.message : void 0;
|
|
23620
|
+
n(y ? `${b}: ${y}` : b, "error");
|
|
23620
23621
|
}
|
|
23621
23622
|
}
|
|
23622
23623
|
),
|
|
23623
|
-
renderReactivateDialog: (
|
|
23624
|
+
renderReactivateDialog: (_) => /* @__PURE__ */ i.jsx(eb, { ..._ })
|
|
23624
23625
|
}
|
|
23625
23626
|
);
|
|
23626
23627
|
}
|