@edx/frontend-app-alacarte-checkout 1.44.0 → 1.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/components/AlacarteConfirmation/AlacarteConfirmation.d.ts +1 -2
  2. package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js +7 -11
  3. package/dist/components/AlacarteConfirmation/AlacarteConfirmation.js.map +1 -1
  4. package/dist/components/AlacarteConfirmation/Messages.d.ts +20 -0
  5. package/dist/components/AlacarteConfirmation/Messages.js +23 -3
  6. package/dist/components/AlacarteConfirmation/Messages.js.map +1 -1
  7. package/dist/components/BrandMarks/BrandMarks.js +2 -1
  8. package/dist/components/BrandMarks/BrandMarks.js.map +1 -1
  9. package/dist/components/CartSummary/CartSummary.js +2 -2
  10. package/dist/components/CartSummary/CartSummary.js.map +1 -1
  11. package/dist/components/Checkout/Checkout.js +2 -2
  12. package/dist/components/Checkout/Checkout.js.map +1 -1
  13. package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js +2 -2
  14. package/dist/components/CourseEnrollmentCard/CourseEnrollmentCard.js.map +1 -1
  15. package/dist/components/CourseEnrollmentCard/Messages.d.ts +0 -5
  16. package/dist/components/CourseEnrollmentCard/Messages.js +0 -5
  17. package/dist/components/CourseEnrollmentCard/Messages.js.map +1 -1
  18. package/dist/components/ExpressCheckout/ExpressCheckout.js +1 -1
  19. package/dist/components/ExpressCheckout/ExpressCheckout.js.map +1 -1
  20. package/dist/components/PaymentFields/Messages.d.ts +8 -0
  21. package/dist/components/PaymentFields/Messages.js +10 -0
  22. package/dist/components/PaymentFields/Messages.js.map +1 -0
  23. package/dist/components/PaymentFields/PaymentFields.d.ts +3 -1
  24. package/dist/components/PaymentFields/PaymentFields.js +17 -1
  25. package/dist/components/PaymentFields/PaymentFields.js.map +1 -1
  26. package/dist/components/PaymentForm/PaymentForm.js +6 -6
  27. package/dist/components/PaymentForm/PaymentForm.js.map +1 -1
  28. package/dist/components/ProgramEnrollmentCard/Messages.d.ts +0 -5
  29. package/dist/components/ProgramEnrollmentCard/Messages.js +0 -5
  30. package/dist/components/ProgramEnrollmentCard/Messages.js.map +1 -1
  31. package/dist/components/ProgramEnrollmentCard/ProgramEnrollmentCard.js +6 -6
  32. package/dist/components/ProgramEnrollmentCard/ProgramEnrollmentCard.js.map +1 -1
  33. package/dist/components/PromoCode/Messages.d.ts +16 -1
  34. package/dist/components/PromoCode/Messages.js +19 -4
  35. package/dist/components/PromoCode/Messages.js.map +1 -1
  36. package/dist/components/PromoCode/PromoCode.js +11 -4
  37. package/dist/components/PromoCode/PromoCode.js.map +1 -1
  38. package/dist/constants.d.ts +1 -0
  39. package/dist/constants.js +1 -0
  40. package/dist/constants.js.map +1 -1
  41. package/dist/data/hooks/useCheckout.js +1 -1
  42. package/dist/data/hooks/useCheckout.js.map +1 -1
  43. package/dist/styles/components/promoCode.scss +27 -0
  44. package/dist/types/alacarte.d.ts +5 -2
  45. package/dist/types/alacarte.js.map +1 -1
  46. package/dist/types.d.ts +2 -0
  47. package/dist/types.js.map +1 -1
  48. package/dist/utils/provision.js +2 -2
  49. package/dist/utils/provision.js.map +1 -1
  50. package/package.json +1 -1
@@ -13,8 +13,7 @@ export interface AlacarteConfirmationProps {
13
13
  /** Learner order-history / dashboard URL for the secondary CTA. */
14
14
  orderHistoryUrl?: string | null;
15
15
  /** ISO timestamp the order was placed (tPlacedAt, falling back to
16
- * biCreatedAt). Drives both the purchase date and the refund deadline
17
- * (placedAt + 14 days); the refund line is hidden once that date passes. */
16
+ * biCreatedAt). Drives the purchase date. */
18
17
  placedAt?: string | null;
19
18
  }
20
19
  declare const AlacarteConfirmation: ({ order, awaiting, error, onContinue, productDetail, productTitle, ownedCourses, orderHistoryUrl, placedAt, }: AlacarteConfirmationProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -3,6 +3,7 @@ import { useMemo } from 'react';
3
3
  import { Alert, Button, Col, Icon, Row } from '@openedx/paragon';
4
4
  import { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';
5
5
  import { useIntl } from '@openedx/frontend-base';
6
+ import { BILLING_SUPPORT_EMAIL, REFUND_POLICY_URL } from '../../constants';
6
7
  import { ProcessingScreen } from '../StatusScreens/StatusScreens';
7
8
  import messages from './Messages';
8
9
  function normalizeName(name) {
@@ -18,11 +19,6 @@ function formatPurchaseDate(locale, date) {
18
19
  year: 'numeric',
19
20
  }).format(date);
20
21
  }
21
- function addDays(from, days) {
22
- const result = new Date(from);
23
- result.setDate(result.getDate() + days);
24
- return result;
25
- }
26
22
  const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetail = null, productTitle = null, ownedCourses = null, orderHistoryUrl = null, placedAt = null, }) => {
27
23
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
28
24
  const { formatMessage, locale = 'en-US' } = useIntl();
@@ -31,9 +27,6 @@ const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetai
31
27
  return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;
32
28
  }, [placedAt]);
33
29
  const purchaseDate = useMemo(() => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null), [locale, placedAtDate]);
34
- const refundDeadlineDate = useMemo(() => (placedAtDate ? addDays(placedAtDate, 14) : null), [placedAtDate]);
35
- const refundBy = useMemo(() => (refundDeadlineDate ? formatPurchaseDate(locale, refundDeadlineDate) : null), [locale, refundDeadlineDate]);
36
- const refundWindowOpen = !!refundDeadlineDate && refundDeadlineDate.getTime() >= Date.now();
37
30
  if (awaiting && !order) {
38
31
  return _jsx(ProcessingScreen, {});
39
32
  }
@@ -81,13 +74,16 @@ const AlacarteConfirmation = ({ order, awaiting, error, onContinue, productDetai
81
74
  .map((c) => { var _a; return (_a = c.name) === null || _a === void 0 ? void 0 : _a.trim(); })
82
75
  .filter((name) => !!name && !purchasedNameSet.has(normalizeName(name)));
83
76
  const programCourseTotal = (_v = (_u = programDetail === null || programDetail === void 0 ? void 0 : programDetail.tCourses) === null || _u === void 0 ? void 0 : _u.length) !== null && _v !== void 0 ? _v : (purchasedCourseNames.length + previouslyPurchased.length);
84
- const summaryCard = (_jsxs("aside", { className: "alacarte-confirmation__summary", "aria-label": formatMessage(messages.purchaseSummary), children: [_jsx("h2", { className: "alacarte-confirmation__summary-title font-weight-bold mb-0", children: formatMessage(messages.purchaseSummary) }), _jsx("hr", { className: "alacarte-confirmation__summary-divider" }), _jsxs("div", { className: "alacarte-confirmation__product d-flex align-items-start", children: [orgLogo ? (_jsx("img", { src: orgLogo, alt: "", className: "alacarte-confirmation__org-logo" })) : (_jsx("div", { className: "alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder", "aria-hidden": true })), _jsxs("div", { children: [_jsxs("span", { className: "alacarte-confirmation__badge", children: [_jsx(Icon, { src: Monitor, className: "alacarte-confirmation__badge-icon" }), formatMessage(messages.verifiedCertificate)] }), _jsx("p", { className: "alacarte-confirmation__product-name font-weight-bold mb-0", children: productLabel })] })] }), _jsx("hr", { className: "alacarte-confirmation__summary-divider" }), _jsxs("div", { className: "alacarte-confirmation__price-row", children: [_jsx("span", { children: formatMessage(messages.subtotal) }), _jsx("span", { children: money(subtotal) })] }), discount > 0 && (_jsxs("div", { className: "alacarte-confirmation__price-row alacarte-confirmation__price-row--discount", children: [_jsx("span", { children: formatMessage(messages.discountsApplied) }), _jsx("span", { children: formatMessage(messages.discountAmount, {
77
+ const summaryCard = (_jsxs("aside", { className: "alacarte-confirmation__summary", "aria-label": formatMessage(messages.purchaseSummary), children: [_jsx("h2", { className: "alacarte-confirmation__summary-title font-weight-bold mb-0", children: formatMessage(messages.purchaseSummary) }), _jsx("hr", { className: "alacarte-confirmation__summary-divider" }), _jsxs("div", { className: "alacarte-confirmation__product d-flex align-items-start", children: [orgLogo ? (_jsx("img", { src: orgLogo, alt: "", "aria-hidden": "true", className: "alacarte-confirmation__org-logo" })) : (_jsx("div", { className: "alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder", "aria-hidden": true })), _jsxs("div", { children: [_jsxs("span", { className: "alacarte-confirmation__badge", children: [_jsx(Icon, { src: Monitor, className: "alacarte-confirmation__badge-icon", "aria-hidden": "true" }), formatMessage(messages.verifiedCertificate)] }), _jsx("p", { className: "alacarte-confirmation__product-name font-weight-bold mb-0", children: productLabel })] })] }), _jsx("hr", { className: "alacarte-confirmation__summary-divider" }), _jsxs("div", { className: "alacarte-confirmation__price-row", children: [_jsx("span", { children: formatMessage(messages.subtotal) }), _jsx("span", { children: money(subtotal) })] }), discount > 0 && (_jsxs("div", { className: "alacarte-confirmation__price-row alacarte-confirmation__price-row--discount", children: [_jsx("span", { children: formatMessage(messages.discountsApplied) }), _jsx("span", { children: formatMessage(messages.discountAmount, {
85
78
  amount: discount.toFixed(2),
86
79
  currency,
87
80
  }) })] })), _jsxs("div", { className: "alacarte-confirmation__price-row alacarte-confirmation__price-row--paid", children: [_jsx("span", { children: formatMessage(messages.amountPaid) }), _jsx("span", { children: money(paid) })] })] }));
88
- return (_jsx("div", { className: "alacarte-confirmation", "data-testid": "alacarte-confirmation", children: _jsxs(Row, { className: "alacarte-confirmation__row", children: [_jsxs(Col, { xs: 12, lg: 7, className: "alacarte-confirmation__main", children: [_jsx("h1", { className: "alacarte-confirmation__headline font-weight-bold mb-4", children: formatMessage(messages.headline) }), _jsx("p", { className: "alacarte-confirmation__subheadline mb-4", children: formatMessage(programOrder ? messages.subheadlineProgram : messages.subheadlineCourse, { productLabel }) }), _jsxs("div", { className: "alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5", children: [_jsx(Button, { variant: "brand", className: "alacarte-confirmation__cta-primary", onClick: onContinue, children: formatMessage(programOrder ? messages.startProgram : messages.startCourse) }), orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, className: "alacarte-confirmation__order-history", children: formatMessage(messages.viewOrderHistory) }))] }), _jsx("div", { className: "alacarte-confirmation__summary-mobile d-lg-none", children: summaryCard }), programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (_jsxs("div", { className: "alacarte-confirmation__about-program mb-5", children: [_jsx("h2", { className: "alacarte-confirmation__about-title", children: formatMessage(messages.aboutProgram) }), purchasedCourseNames.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h3", { className: "alacarte-confirmation__courses-included", children: formatMessage(messages.coursesIncluded, { count: programCourseTotal }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: purchasedCourseNames.map((name) => (_jsx("li", { children: name }, name))) })] })), previouslyPurchased.length > 0 && (_jsxs("div", { className: "alacarte-confirmation__previously-purchased", "data-testid": "confirmation-previously-purchased", children: [_jsx("h3", { className: "alacarte-confirmation__previously-purchased-heading", children: formatMessage(messages.previouslyPurchased, {
81
+ return (_jsx("div", { className: "alacarte-confirmation", "data-testid": "alacarte-confirmation", children: _jsxs(Row, { className: "alacarte-confirmation__row", children: [_jsxs(Col, { xs: 12, lg: 7, className: "alacarte-confirmation__main", children: [_jsx("h1", { className: "alacarte-confirmation__headline font-weight-bold mb-4", children: formatMessage(messages.headline) }), _jsx("p", { className: "alacarte-confirmation__subheadline mb-4", children: formatMessage(programOrder ? messages.subheadlineProgram : messages.subheadlineCourse, { productLabel }) }), _jsxs("div", { className: "alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5", children: [_jsx(Button, { variant: "brand", className: "alacarte-confirmation__cta-primary", onClick: onContinue, children: formatMessage(programOrder ? messages.startProgram : messages.startCourse) }), orderHistoryUrl && (_jsx("a", { href: orderHistoryUrl, target: "_blank", rel: "noopener noreferrer", className: "alacarte-confirmation__order-history", "aria-label": formatMessage(messages.viewOrderHistoryLabel), children: formatMessage(messages.viewOrderHistory) }))] }), _jsx("div", { className: "alacarte-confirmation__summary-mobile d-lg-none", children: summaryCard }), programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (_jsxs("div", { className: "alacarte-confirmation__about-program mb-5", children: [_jsx("h2", { className: "alacarte-confirmation__about-title", children: formatMessage(messages.aboutProgram) }), purchasedCourseNames.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h3", { className: "alacarte-confirmation__courses-included", children: formatMessage(messages.coursesIncluded, { count: programCourseTotal }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: purchasedCourseNames.map((name) => (_jsx("li", { children: name }, name))) })] })), previouslyPurchased.length > 0 && (_jsxs("div", { className: "alacarte-confirmation__previously-purchased", "data-testid": "confirmation-previously-purchased", children: [_jsx("h3", { className: "alacarte-confirmation__previously-purchased-heading", children: formatMessage(messages.previouslyPurchased, {
89
82
  count: previouslyPurchased.length,
90
- }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: previouslyPurchased.map((name) => (_jsx("li", { children: name }, name))) })] }))] })), _jsxs(Row, { children: [_jsxs(Col, { xs: 12, md: 7, className: "mb-4", children: [_jsx("h2", { className: "h5 font-weight-bold mb-3", children: formatMessage(messages.whatsIncluded) }), _jsxs("ul", { className: "alacarte-confirmation__benefits", children: [_jsx("li", { children: formatMessage(messages.benefit1) }), _jsx("li", { children: formatMessage(messages.benefit2) }), _jsx("li", { children: formatMessage(messages.benefit3) })] })] }), _jsxs(Col, { xs: 12, md: 5, className: "mb-4", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h2", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.orderNumber) }), _jsx("p", { className: "text-muted mb-0", children: order.orderNumber })] }), _jsxs("div", { children: [_jsx("h2", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.purchaseDate) }), _jsx("p", { className: "text-muted mb-0", children: purchaseDate !== null && purchaseDate !== void 0 ? purchaseDate : '' })] })] })] }), refundWindowOpen && refundBy && (_jsxs(_Fragment, { children: [_jsx("hr", { className: "alacarte-confirmation__divider" }), _jsx("p", { className: "alacarte-confirmation__refund text-muted small mb-0", children: formatMessage(messages.refundNotice, { date: refundBy }) })] }))] }), _jsx(Col, { xs: 12, lg: 5, className: "alacarte-confirmation__summary-col d-none d-lg-block", children: summaryCard })] }) }));
83
+ }) }), _jsx("ul", { className: "alacarte-confirmation__course-list mb-0", children: previouslyPurchased.map((name) => (_jsx("li", { children: name }, name))) })] }))] })), _jsxs(Row, { children: [_jsxs(Col, { xs: 12, md: 7, className: "mb-4", children: [_jsx("h2", { className: "h5 font-weight-bold mb-3", children: formatMessage(messages.whatsIncluded) }), _jsxs("ul", { className: "alacarte-confirmation__benefits", children: [_jsx("li", { children: formatMessage(messages.benefit1) }), _jsx("li", { children: formatMessage(messages.benefit2) }), _jsx("li", { children: formatMessage(messages.benefit3) })] })] }), _jsxs(Col, { xs: 12, md: 5, className: "mb-4", children: [_jsxs("div", { className: "mb-3", children: [_jsx("h2", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.orderNumber) }), _jsx("p", { className: "text-muted mb-0", children: order.orderNumber })] }), _jsxs("div", { children: [_jsx("h2", { className: "alacarte-confirmation__detail-heading font-weight-bold mb-0", children: formatMessage(messages.purchaseDate) }), _jsx("p", { className: "text-muted mb-0", children: purchaseDate !== null && purchaseDate !== void 0 ? purchaseDate : '' })] })] })] }), _jsx("hr", { className: "alacarte-confirmation__divider" }), _jsx("p", { className: "alacarte-confirmation__refund text-muted small mb-0", children: formatMessage(messages.refundNotice, {
84
+ email: (_jsx("a", { href: `mailto:${BILLING_SUPPORT_EMAIL}`, "aria-label": formatMessage(messages.billingEmailLabel), children: BILLING_SUPPORT_EMAIL })),
85
+ refundPolicy: (_jsx("a", { href: REFUND_POLICY_URL, target: "_blank", rel: "noopener noreferrer", "aria-label": formatMessage(messages.refundPolicyLabel), children: formatMessage(messages.refundPolicy) })),
86
+ }) })] }), _jsx(Col, { xs: 12, lg: 5, className: "alacarte-confirmation__summary-col d-none d-lg-block", children: summaryCard })] }) }));
91
87
  };
92
88
  export default AlacarteConfirmation;
93
89
  //# sourceMappingURL=AlacarteConfirmation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlacarteConfirmation.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/AlacarteConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAqBlC,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,cAAc,CAAC,KAAkB;IACxC,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc,EAAE,IAAU;IACpD,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;QACrC,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,OAAO,CAAC,IAAU,EAAE,IAAY;IACvC,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACxC,OAAO,MAA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AAS,EAAC,gCAAgC,GAAG,EACjD,YAAG,SAAS,EAAC,qDAAqD,YAC/D,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,GACvD,IACH,CACJ,IACG,EAEN,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,sDAAsD,YACjF,WAAW,GACR,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import React, { useMemo } from 'react';\nimport { Alert, Button, Col, Icon, Row } from '@openedx/paragon';\nimport { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type {\n AlacarteProgramOwnedCourse, PlacedOrder, ProductDetail, ProgramDetail,\n} from '../../types/alacarte';\nimport messages from './Messages';\n\nexport interface AlacarteConfirmationProps {\n order: PlacedOrder | null,\n awaiting: boolean,\n error: string | null,\n onContinue?: () => void,\n /** Optional catalog detail from checkout — logo / brand. */\n productDetail?: ProductDetail | null,\n /** Display title from the checkout line (course or program name). */\n productTitle?: string | null,\n /** Program member courses already owned before this order. */\n ownedCourses?: AlacarteProgramOwnedCourse[] | null,\n /** Learner order-history / dashboard URL for the secondary CTA. */\n orderHistoryUrl?: string | null,\n /** ISO timestamp the order was placed (tPlacedAt, falling back to\n * biCreatedAt). Drives both the purchase date and the refund deadline\n * (placedAt + 14 days); the refund line is hidden once that date passes. */\n placedAt?: string | null,\n}\n\nfunction normalizeName(name: string): string {\n return name.trim().toLowerCase().replace(/\\s+/g, ' ');\n}\n\nfunction isProgramOrder(order: PlacedOrder): boolean {\n return order.lines.some((line) => line.kind === 'program' || !!line.programId);\n}\n\nfunction formatPurchaseDate(locale: string, date: Date): string {\n return new Intl.DateTimeFormat(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n}\n\nfunction addDays(from: Date, days: number): Date {\n const result = new Date(from);\n result.setDate(result.getDate() + days);\n return result;\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = null,\n ownedCourses = null,\n orderHistoryUrl = null,\n placedAt = null,\n}: AlacarteConfirmationProps) => {\n const { formatMessage, locale = 'en-US' } = useIntl();\n\n const placedAtDate = useMemo(() => {\n const parsed = placedAt ? new Date(placedAt) : null;\n return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;\n }, [placedAt]);\n\n const purchaseDate = useMemo(\n () => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null),\n [locale, placedAtDate],\n );\n const refundDeadlineDate = useMemo(\n () => (placedAtDate ? addDays(placedAtDate, 14) : null),\n [placedAtDate],\n );\n const refundBy = useMemo(\n () => (refundDeadlineDate ? formatPurchaseDate(locale, refundDeadlineDate) : null),\n [locale, refundDeadlineDate],\n );\n const refundWindowOpen = !!refundDeadlineDate && refundDeadlineDate.getTime() >= Date.now();\n\n if (awaiting && !order) {\n return <ProcessingScreen />;\n }\n\n if (error && !order) {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {formatMessage(messages.orderLoadError, { error })}\n </Alert>\n );\n }\n\n if (!order) {\n return null;\n }\n\n const programOrder = isProgramOrder(order);\n const courseDetail = productDetail && 'maId' in productDetail\n ? (productDetail as CourseDetail)\n : null;\n const programDetail = productDetail && 'tCourses' in productDetail\n ? (productDetail as ProgramDetail)\n : null;\n\n const firstLine = order.lines[0];\n const brand = courseDetail?.tBrandText?.trim()\n || programDetail?.tCourses?.[0]?.tBrandText?.trim()\n || '';\n const baseName = productTitle\n || firstLine?.name\n || (programOrder ? 'your program' : 'your course');\n\n const productLabel = !programOrder && brand && !productTitle?.includes(brand)\n ? `${brand}: ${baseName}`\n : baseName;\n\n const orgLogo = courseDetail?.imageUrl\n || programDetail?.tCourses?.[0]?.tOrgLogoUrl\n || programDetail?.tCourses?.[0]?.imageUrl\n || null;\n\n const currency = order.totals?.currency ?? 'USD';\n // Subtotal is price less owned-course deduction (before coupon/offer discount).\n const subtotal = Math.max(\n 0,\n (order.totals?.price ?? 0) - (order.totals?.deduction ?? 0),\n );\n const discount = order.totals?.discount ?? 0;\n const paid = order.totals?.paid ?? 0;\n\n const money = (amount: number) => formatMessage(messages.moneyAmount, {\n amount: amount.toFixed(2),\n currency,\n });\n\n const purchasedCourseNames = programOrder\n ? order.lines.map((line) => line.name?.trim()).filter((name): name is string => !!name)\n : [];\n const purchasedNameSet = new Set(purchasedCourseNames.map(normalizeName));\n\n const previouslyPurchased = (ownedCourses ?? [])\n .map((c) => c.name?.trim())\n .filter((name): name is string => !!name && !purchasedNameSet.has(normalizeName(name)));\n\n const programCourseTotal = programDetail?.tCourses?.length\n ?? (purchasedCourseNames.length + previouslyPurchased.length);\n\n const summaryCard = (\n <aside\n className=\"alacarte-confirmation__summary\"\n aria-label={formatMessage(messages.purchaseSummary)}\n >\n <h2 className=\"alacarte-confirmation__summary-title font-weight-bold mb-0\">\n {formatMessage(messages.purchaseSummary)}\n </h2>\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__product d-flex align-items-start\">\n {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\n className=\"alacarte-confirmation__org-logo\"\n />\n ) : (\n <div\n className=\"alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder\"\n aria-hidden\n />\n )}\n <div>\n <span className=\"alacarte-confirmation__badge\">\n <Icon src={Monitor} className=\"alacarte-confirmation__badge-icon\" />\n {formatMessage(messages.verifiedCertificate)}\n </span>\n <p className=\"alacarte-confirmation__product-name font-weight-bold mb-0\">\n {productLabel}\n </p>\n </div>\n </div>\n\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__price-row\">\n <span>{formatMessage(messages.subtotal)}</span>\n <span>{money(subtotal)}</span>\n </div>\n {discount > 0 && (\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--discount\">\n <span>{formatMessage(messages.discountsApplied)}</span>\n <span>\n {formatMessage(messages.discountAmount, {\n amount: discount.toFixed(2),\n currency,\n })}\n </span>\n </div>\n )}\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--paid\">\n <span>{formatMessage(messages.amountPaid)}</span>\n <span>{money(paid)}</span>\n </div>\n </aside>\n );\n\n return (\n <div className=\"alacarte-confirmation\" data-testid=\"alacarte-confirmation\">\n <Row className=\"alacarte-confirmation__row\">\n <Col xs={12} lg={7} className=\"alacarte-confirmation__main\">\n <h1 className=\"alacarte-confirmation__headline font-weight-bold mb-4\">\n {formatMessage(messages.headline)}\n </h1>\n <p className=\"alacarte-confirmation__subheadline mb-4\">\n {formatMessage(\n programOrder ? messages.subheadlineProgram : messages.subheadlineCourse,\n { productLabel },\n )}\n </p>\n\n <div className=\"alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5\">\n <Button\n variant=\"brand\"\n className=\"alacarte-confirmation__cta-primary\"\n onClick={onContinue}\n >\n {formatMessage(programOrder ? messages.startProgram : messages.startCourse)}\n </Button>\n {orderHistoryUrl && (\n <a href={orderHistoryUrl} className=\"alacarte-confirmation__order-history\">\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n </div>\n\n <div className=\"alacarte-confirmation__summary-mobile d-lg-none\">\n {summaryCard}\n </div>\n\n {programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (\n <div className=\"alacarte-confirmation__about-program mb-5\">\n <h2 className=\"alacarte-confirmation__about-title\">\n {formatMessage(messages.aboutProgram)}\n </h2>\n {purchasedCourseNames.length > 0 && (\n <>\n <h3 className=\"alacarte-confirmation__courses-included\">\n {formatMessage(messages.coursesIncluded, { count: programCourseTotal })}\n </h3>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {purchasedCourseNames.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </>\n )}\n {previouslyPurchased.length > 0 && (\n <div\n className=\"alacarte-confirmation__previously-purchased\"\n data-testid=\"confirmation-previously-purchased\"\n >\n <h3 className=\"alacarte-confirmation__previously-purchased-heading\">\n {formatMessage(messages.previouslyPurchased, {\n count: previouslyPurchased.length,\n })}\n </h3>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {previouslyPurchased.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n\n <Row>\n <Col xs={12} md={7} className=\"mb-4\">\n <h2 className=\"h5 font-weight-bold mb-3\">\n {formatMessage(messages.whatsIncluded)}\n </h2>\n <ul className=\"alacarte-confirmation__benefits\">\n <li>{formatMessage(messages.benefit1)}</li>\n <li>{formatMessage(messages.benefit2)}</li>\n <li>{formatMessage(messages.benefit3)}</li>\n </ul>\n </Col>\n <Col xs={12} md={5} className=\"mb-4\">\n <div className=\"mb-3\">\n <h2 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </h2>\n <p className=\"text-muted mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <h2 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </h2>\n <p className=\"text-muted mb-0\">{purchaseDate ?? ''}</p>\n </div>\n </Col>\n </Row>\n\n {refundWindowOpen && refundBy && (\n <>\n <hr className=\"alacarte-confirmation__divider\" />\n <p className=\"alacarte-confirmation__refund text-muted small mb-0\">\n {formatMessage(messages.refundNotice, { date: refundBy })}\n </p>\n </>\n )}\n </Col>\n\n <Col xs={12} lg={5} className=\"alacarte-confirmation__summary-col d-none d-lg-block\">\n {summaryCard}\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default AlacarteConfirmation;\n"]}
1
+ {"version":3,"file":"AlacarteConfirmation.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/AlacarteConfirmation.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAA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on';\nimport { Error as ErrorIcon, Monitor } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { BILLING_SUPPORT_EMAIL, REFUND_POLICY_URL } from '../../constants';\nimport { ProcessingScreen } from '../StatusScreens/StatusScreens';\nimport type { CourseDetail } from '../../types';\nimport type {\n AlacarteProgramOwnedCourse, PlacedOrder, ProductDetail, ProgramDetail,\n} from '../../types/alacarte';\nimport messages from './Messages';\n\nexport interface AlacarteConfirmationProps {\n order: PlacedOrder | null,\n awaiting: boolean,\n error: string | null,\n onContinue?: () => void,\n /** Optional catalog detail from checkout — logo / brand. */\n productDetail?: ProductDetail | null,\n /** Display title from the checkout line (course or program name). */\n productTitle?: string | null,\n /** Program member courses already owned before this order. */\n ownedCourses?: AlacarteProgramOwnedCourse[] | null,\n /** Learner order-history / dashboard URL for the secondary CTA. */\n orderHistoryUrl?: string | null,\n /** ISO timestamp the order was placed (tPlacedAt, falling back to\n * biCreatedAt). Drives the purchase date. */\n placedAt?: string | null,\n}\n\nfunction normalizeName(name: string): string {\n return name.trim().toLowerCase().replace(/\\s+/g, ' ');\n}\n\nfunction isProgramOrder(order: PlacedOrder): boolean {\n return order.lines.some((line) => line.kind === 'program' || !!line.programId);\n}\n\nfunction formatPurchaseDate(locale: string, date: Date): string {\n return new Intl.DateTimeFormat(locale, {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n}\n\nconst AlacarteConfirmation = ({\n order,\n awaiting,\n error,\n onContinue,\n productDetail = null,\n productTitle = null,\n ownedCourses = null,\n orderHistoryUrl = null,\n placedAt = null,\n}: AlacarteConfirmationProps) => {\n const { formatMessage, locale = 'en-US' } = useIntl();\n\n const placedAtDate = useMemo(() => {\n const parsed = placedAt ? new Date(placedAt) : null;\n return parsed && !Number.isNaN(parsed.getTime()) ? parsed : null;\n }, [placedAt]);\n\n const purchaseDate = useMemo(\n () => (placedAtDate ? formatPurchaseDate(locale, placedAtDate) : null),\n [locale, placedAtDate],\n );\n\n if (awaiting && !order) {\n return <ProcessingScreen />;\n }\n\n if (error && !order) {\n return (\n <Alert variant=\"danger\" icon={ErrorIcon}>\n {formatMessage(messages.orderLoadError, { error })}\n </Alert>\n );\n }\n\n if (!order) {\n return null;\n }\n\n const programOrder = isProgramOrder(order);\n const courseDetail = productDetail && 'maId' in productDetail\n ? (productDetail as CourseDetail)\n : null;\n const programDetail = productDetail && 'tCourses' in productDetail\n ? (productDetail as ProgramDetail)\n : null;\n\n const firstLine = order.lines[0];\n const brand = courseDetail?.tBrandText?.trim()\n || programDetail?.tCourses?.[0]?.tBrandText?.trim()\n || '';\n const baseName = productTitle\n || firstLine?.name\n || (programOrder ? 'your program' : 'your course');\n\n const productLabel = !programOrder && brand && !productTitle?.includes(brand)\n ? `${brand}: ${baseName}`\n : baseName;\n\n const orgLogo = courseDetail?.imageUrl\n || programDetail?.tCourses?.[0]?.tOrgLogoUrl\n || programDetail?.tCourses?.[0]?.imageUrl\n || null;\n\n const currency = order.totals?.currency ?? 'USD';\n // Subtotal is price less owned-course deduction (before coupon/offer discount).\n const subtotal = Math.max(\n 0,\n (order.totals?.price ?? 0) - (order.totals?.deduction ?? 0),\n );\n const discount = order.totals?.discount ?? 0;\n const paid = order.totals?.paid ?? 0;\n\n const money = (amount: number) => formatMessage(messages.moneyAmount, {\n amount: amount.toFixed(2),\n currency,\n });\n\n const purchasedCourseNames = programOrder\n ? order.lines.map((line) => line.name?.trim()).filter((name): name is string => !!name)\n : [];\n const purchasedNameSet = new Set(purchasedCourseNames.map(normalizeName));\n\n const previouslyPurchased = (ownedCourses ?? [])\n .map((c) => c.name?.trim())\n .filter((name): name is string => !!name && !purchasedNameSet.has(normalizeName(name)));\n\n const programCourseTotal = programDetail?.tCourses?.length\n ?? (purchasedCourseNames.length + previouslyPurchased.length);\n\n const summaryCard = (\n <aside\n className=\"alacarte-confirmation__summary\"\n aria-label={formatMessage(messages.purchaseSummary)}\n >\n <h2 className=\"alacarte-confirmation__summary-title font-weight-bold mb-0\">\n {formatMessage(messages.purchaseSummary)}\n </h2>\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__product d-flex align-items-start\">\n {/* Decorative — the institution is named in the product title. */}\n {orgLogo ? (\n <img\n src={orgLogo}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"alacarte-confirmation__org-logo\"\n />\n ) : (\n <div\n className=\"alacarte-confirmation__org-logo alacarte-confirmation__org-logo--placeholder\"\n aria-hidden\n />\n )}\n <div>\n <span className=\"alacarte-confirmation__badge\">\n <Icon src={Monitor} className=\"alacarte-confirmation__badge-icon\" aria-hidden=\"true\" />\n {formatMessage(messages.verifiedCertificate)}\n </span>\n <p className=\"alacarte-confirmation__product-name font-weight-bold mb-0\">\n {productLabel}\n </p>\n </div>\n </div>\n\n <hr className=\"alacarte-confirmation__summary-divider\" />\n\n <div className=\"alacarte-confirmation__price-row\">\n <span>{formatMessage(messages.subtotal)}</span>\n <span>{money(subtotal)}</span>\n </div>\n {discount > 0 && (\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--discount\">\n <span>{formatMessage(messages.discountsApplied)}</span>\n <span>\n {formatMessage(messages.discountAmount, {\n amount: discount.toFixed(2),\n currency,\n })}\n </span>\n </div>\n )}\n <div className=\"alacarte-confirmation__price-row alacarte-confirmation__price-row--paid\">\n <span>{formatMessage(messages.amountPaid)}</span>\n <span>{money(paid)}</span>\n </div>\n </aside>\n );\n\n return (\n <div className=\"alacarte-confirmation\" data-testid=\"alacarte-confirmation\">\n <Row className=\"alacarte-confirmation__row\">\n <Col xs={12} lg={7} className=\"alacarte-confirmation__main\">\n <h1 className=\"alacarte-confirmation__headline font-weight-bold mb-4\">\n {formatMessage(messages.headline)}\n </h1>\n <p className=\"alacarte-confirmation__subheadline mb-4\">\n {formatMessage(\n programOrder ? messages.subheadlineProgram : messages.subheadlineCourse,\n { productLabel },\n )}\n </p>\n\n <div className=\"alacarte-confirmation__ctas d-flex align-items-center flex-wrap mb-4.5\">\n <Button\n variant=\"brand\"\n className=\"alacarte-confirmation__cta-primary\"\n onClick={onContinue}\n >\n {formatMessage(programOrder ? messages.startProgram : messages.startCourse)}\n </Button>\n {orderHistoryUrl && (\n <a\n href={orderHistoryUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"alacarte-confirmation__order-history\"\n aria-label={formatMessage(messages.viewOrderHistoryLabel)}\n >\n {formatMessage(messages.viewOrderHistory)}\n </a>\n )}\n </div>\n\n <div className=\"alacarte-confirmation__summary-mobile d-lg-none\">\n {summaryCard}\n </div>\n\n {programOrder && (purchasedCourseNames.length > 0 || previouslyPurchased.length > 0) && (\n <div className=\"alacarte-confirmation__about-program mb-5\">\n <h2 className=\"alacarte-confirmation__about-title\">\n {formatMessage(messages.aboutProgram)}\n </h2>\n {purchasedCourseNames.length > 0 && (\n <>\n <h3 className=\"alacarte-confirmation__courses-included\">\n {formatMessage(messages.coursesIncluded, { count: programCourseTotal })}\n </h3>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {purchasedCourseNames.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </>\n )}\n {previouslyPurchased.length > 0 && (\n <div\n className=\"alacarte-confirmation__previously-purchased\"\n data-testid=\"confirmation-previously-purchased\"\n >\n <h3 className=\"alacarte-confirmation__previously-purchased-heading\">\n {formatMessage(messages.previouslyPurchased, {\n count: previouslyPurchased.length,\n })}\n </h3>\n <ul className=\"alacarte-confirmation__course-list mb-0\">\n {previouslyPurchased.map((name) => (\n <li key={name}>{name}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n\n <Row>\n <Col xs={12} md={7} className=\"mb-4\">\n <h2 className=\"h5 font-weight-bold mb-3\">\n {formatMessage(messages.whatsIncluded)}\n </h2>\n <ul className=\"alacarte-confirmation__benefits\">\n <li>{formatMessage(messages.benefit1)}</li>\n <li>{formatMessage(messages.benefit2)}</li>\n <li>{formatMessage(messages.benefit3)}</li>\n </ul>\n </Col>\n <Col xs={12} md={5} className=\"mb-4\">\n <div className=\"mb-3\">\n <h2 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.orderNumber)}\n </h2>\n <p className=\"text-muted mb-0\">{order.orderNumber}</p>\n </div>\n <div>\n <h2 className=\"alacarte-confirmation__detail-heading font-weight-bold mb-0\">\n {formatMessage(messages.purchaseDate)}\n </h2>\n <p className=\"text-muted mb-0\">{purchaseDate ?? ''}</p>\n </div>\n </Col>\n </Row>\n\n <hr className=\"alacarte-confirmation__divider\" />\n <p className=\"alacarte-confirmation__refund text-muted small mb-0\">\n {formatMessage(messages.refundNotice, {\n email: (\n <a\n href={`mailto:${BILLING_SUPPORT_EMAIL}`}\n aria-label={formatMessage(messages.billingEmailLabel)}\n >\n {BILLING_SUPPORT_EMAIL}\n </a>\n ),\n refundPolicy: (\n <a\n href={REFUND_POLICY_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={formatMessage(messages.refundPolicyLabel)}\n >\n {formatMessage(messages.refundPolicy)}\n </a>\n ),\n })}\n </p>\n </Col>\n\n <Col xs={12} lg={5} className=\"alacarte-confirmation__summary-col d-none d-lg-block\">\n {summaryCard}\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default AlacarteConfirmation;\n"]}
@@ -34,6 +34,11 @@ declare const messages: {
34
34
  defaultMessage: string;
35
35
  description: string;
36
36
  };
37
+ viewOrderHistoryLabel: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
37
42
  aboutProgram: {
38
43
  id: string;
39
44
  defaultMessage: string;
@@ -84,6 +89,21 @@ declare const messages: {
84
89
  defaultMessage: string;
85
90
  description: string;
86
91
  };
92
+ billingEmailLabel: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ refundPolicy: {
98
+ id: string;
99
+ defaultMessage: string;
100
+ description: string;
101
+ };
102
+ refundPolicyLabel: {
103
+ id: string;
104
+ defaultMessage: string;
105
+ description: string;
106
+ };
87
107
  purchaseSummary: {
88
108
  id: string;
89
109
  defaultMessage: string;
@@ -35,6 +35,11 @@ const messages = defineMessages({
35
35
  defaultMessage: 'View order history',
36
36
  description: 'Secondary link to the learner order history',
37
37
  },
38
+ viewOrderHistoryLabel: {
39
+ id: 'checkout.alacarteConfirmation.viewOrderHistoryLabel',
40
+ defaultMessage: 'View order history, opens in a new tab',
41
+ description: 'Accessible label for the order history link, which opens in a new tab',
42
+ },
38
43
  aboutProgram: {
39
44
  id: 'checkout.alacarteConfirmation.aboutProgram',
40
45
  defaultMessage: 'About program',
@@ -81,9 +86,24 @@ const messages = defineMessages({
81
86
  description: 'Purchase date label',
82
87
  },
83
88
  refundNotice: {
84
- id: 'checkout.alacarteConfirmation.refundNotice',
85
- defaultMessage: "Don't like your course? Unenroll by {date} to get a full refund.",
86
- description: 'Refund / unenroll notice at the bottom of the confirmation page',
89
+ id: 'checkout.alacarteConfirmation.refundContact',
90
+ defaultMessage: 'For course or program refunds, contact {email}. See our {refundPolicy} for details.',
91
+ description: 'Refund contact line at the bottom of the confirmation page; {email} is the billing email link, {refundPolicy} the Refund Policy link',
92
+ },
93
+ billingEmailLabel: {
94
+ id: 'checkout.alacarteConfirmation.billingEmailLabel',
95
+ defaultMessage: 'Email billing at edx dot org',
96
+ description: 'Accessible label for the billing@edx.org email link',
97
+ },
98
+ refundPolicy: {
99
+ id: 'checkout.alacarteConfirmation.refundPolicy',
100
+ defaultMessage: 'Refund Policy',
101
+ description: 'Link text for the refund policy in the refund contact line',
102
+ },
103
+ refundPolicyLabel: {
104
+ id: 'checkout.alacarteConfirmation.refundPolicyLabel',
105
+ defaultMessage: 'Refund Policy, opens in a new tab',
106
+ description: 'Accessible label for the Refund Policy link, which opens in a new tab',
87
107
  },
88
108
  purchaseSummary: {
89
109
  id: 'checkout.alacarteConfirmation.purchaseSummary',
@@ -1 +1 @@
1
- {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/Messages.ts"],"names":[],"mappings":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,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderLoadError: {\n id: 'checkout.alacarteConfirmation.orderLoadError',\n defaultMessage: 'We could not load your order ({error}). Please refresh or check your learner dashboard.',\n description: 'Error shown when tPlacedOrder fails on the confirmation page',\n },\n headline: {\n id: 'checkout.alacarteConfirmation.headline',\n defaultMessage: \"You're ready to begin learning.\",\n description: 'Main headline on the à la carte order confirmation page',\n },\n subheadlineCourse: {\n id: 'checkout.alacarteConfirmation.subheadlineCourse',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a course purchase',\n },\n subheadlineProgram: {\n id: 'checkout.alacarteConfirmation.subheadlineProgram',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a program purchase',\n },\n startCourse: {\n id: 'checkout.alacarteConfirmation.startCourse',\n defaultMessage: 'Start course',\n description: 'Primary CTA after buying a course',\n },\n startProgram: {\n id: 'checkout.alacarteConfirmation.startProgram',\n defaultMessage: 'Start program',\n description: 'Primary CTA after buying a program',\n },\n viewOrderHistory: {\n id: 'checkout.alacarteConfirmation.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Secondary link to the learner order history',\n },\n aboutProgram: {\n id: 'checkout.alacarteConfirmation.aboutProgram',\n defaultMessage: 'About program',\n description: 'Heading for the list of courses included in a program order',\n },\n coursesIncluded: {\n id: 'checkout.alacarteConfirmation.coursesIncluded',\n defaultMessage: 'Courses included in this program ({count}):',\n description: 'Subheading above newly purchased program courses; count is the full program size',\n },\n previouslyPurchased: {\n id: 'checkout.alacarteConfirmation.previouslyPurchased',\n defaultMessage: 'Previously purchased ({count}):',\n description: 'Heading above member courses the learner already owned before this order',\n },\n whatsIncluded: {\n id: 'checkout.alacarteConfirmation.whatsIncluded',\n defaultMessage: \"What's included\",\n description: 'Benefits section heading on the confirmation page',\n },\n benefit1: {\n id: 'checkout.alacarteConfirmation.benefit1',\n defaultMessage: 'Access to graded assignments and exams',\n description: 'First à la carte purchase benefit',\n },\n benefit2: {\n id: 'checkout.alacarteConfirmation.benefit2',\n defaultMessage: 'Shareable Certificate upon completion',\n description: 'Second à la carte purchase benefit',\n },\n benefit3: {\n id: 'checkout.alacarteConfirmation.benefit3',\n defaultMessage: '24/7 Global Support',\n description: 'Third à la carte purchase benefit',\n },\n orderNumber: {\n id: 'checkout.alacarteConfirmation.orderNumber',\n defaultMessage: 'Order number',\n description: 'Order number label',\n },\n purchaseDate: {\n id: 'checkout.alacarteConfirmation.purchaseDate',\n defaultMessage: 'Purchase date',\n description: 'Purchase date label',\n },\n refundNotice: {\n id: 'checkout.alacarteConfirmation.refundNotice',\n defaultMessage: \"Don't like your course? Unenroll by {date} to get a full refund.\",\n description: 'Refund / unenroll notice at the bottom of the confirmation page',\n },\n purchaseSummary: {\n id: 'checkout.alacarteConfirmation.purchaseSummary',\n defaultMessage: 'Purchase summary',\n description: 'Sidebar heading for the purchase summary card',\n },\n verifiedCertificate: {\n id: 'checkout.alacarteConfirmation.verifiedCertificate',\n defaultMessage: 'Verified certificate',\n description: 'Badge on the purchase summary product',\n },\n subtotal: {\n id: 'checkout.alacarteConfirmation.subtotal',\n defaultMessage: 'Subtotal',\n description: 'Subtotal row label',\n },\n discountsApplied: {\n id: 'checkout.alacarteConfirmation.discountsApplied',\n defaultMessage: 'Discounts applied',\n description: 'Discount row label',\n },\n amountPaid: {\n id: 'checkout.alacarteConfirmation.amountPaid',\n defaultMessage: 'Amount paid',\n description: 'Amount paid row label',\n },\n moneyAmount: {\n id: 'checkout.alacarteConfirmation.moneyAmount',\n defaultMessage: '${amount} {currency}',\n description: 'Formatted money amount e.g. $12.00 USD',\n },\n discountAmount: {\n id: 'checkout.alacarteConfirmation.discountAmount',\n defaultMessage: '-${amount} {currency}',\n description: 'Formatted discount amount e.g. -$10.00 USD',\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"Messages.js","sourceRoot":"","sources":["../../../src/components/AlacarteConfirmation/Messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,yFAAyF;QACzG,WAAW,EAAE,8DAA8D;KAC5E;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,iCAAiC;QACjD,WAAW,EAAE,yDAAyD;KACvE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,mGAAmG;QACnH,WAAW,EAAE,gDAAgD;KAC9D;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,kDAAkD;QACtD,cAAc,EAAE,mGAAmG;QACnH,WAAW,EAAE,iDAAiD;KAC/D;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,mCAAmC;KACjD;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,oCAAoC;KAClD;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,6CAA6C;KAC3D;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,wCAAwC;QACxD,WAAW,EAAE,uEAAuE;KACrF;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,6DAA6D;KAC3E;IACD,eAAe,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AAe,EAAE;QACf,EAAE,EAAE,+CAA+C;QACnD,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,+CAA+C;KAC7D;IACD,mBAAmB,EAAE;QACnB,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,uCAAuC;KACrD;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,oBAAoB;KAClC;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gDAAgD;QACpD,cAAc,EAAE,mBAAmB;QACnC,WAAW,EAAE,oBAAoB;KAClC;IACD,UAAU,EAAE;QACV,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,uBAAuB;KACrC;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,sBAAsB;QACtC,WAAW,EAAE,wCAAwC;KACtD;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n orderLoadError: {\n id: 'checkout.alacarteConfirmation.orderLoadError',\n defaultMessage: 'We could not load your order ({error}). Please refresh or check your learner dashboard.',\n description: 'Error shown when tPlacedOrder fails on the confirmation page',\n },\n headline: {\n id: 'checkout.alacarteConfirmation.headline',\n defaultMessage: \"You're ready to begin learning.\",\n description: 'Main headline on the à la carte order confirmation page',\n },\n subheadlineCourse: {\n id: 'checkout.alacarteConfirmation.subheadlineCourse',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a course purchase',\n },\n subheadlineProgram: {\n id: 'checkout.alacarteConfirmation.subheadlineProgram',\n defaultMessage: \"Your payment is complete and you're enrolled in {productLabel}. Below is a summary of your order.\",\n description: 'Confirmation subheadline for a program purchase',\n },\n startCourse: {\n id: 'checkout.alacarteConfirmation.startCourse',\n defaultMessage: 'Start course',\n description: 'Primary CTA after buying a course',\n },\n startProgram: {\n id: 'checkout.alacarteConfirmation.startProgram',\n defaultMessage: 'Start program',\n description: 'Primary CTA after buying a program',\n },\n viewOrderHistory: {\n id: 'checkout.alacarteConfirmation.viewOrderHistory',\n defaultMessage: 'View order history',\n description: 'Secondary link to the learner order history',\n },\n viewOrderHistoryLabel: {\n id: 'checkout.alacarteConfirmation.viewOrderHistoryLabel',\n defaultMessage: 'View order history, opens in a new tab',\n description: 'Accessible label for the order history link, which opens in a new tab',\n },\n aboutProgram: {\n id: 'checkout.alacarteConfirmation.aboutProgram',\n defaultMessage: 'About program',\n description: 'Heading for the list of courses included in a program order',\n },\n coursesIncluded: {\n id: 'checkout.alacarteConfirmation.coursesIncluded',\n defaultMessage: 'Courses included in this program ({count}):',\n description: 'Subheading above newly purchased program courses; count is the full program size',\n },\n previouslyPurchased: {\n id: 'checkout.alacarteConfirmation.previouslyPurchased',\n defaultMessage: 'Previously purchased ({count}):',\n description: 'Heading above member courses the learner already owned before this order',\n },\n whatsIncluded: {\n id: 'checkout.alacarteConfirmation.whatsIncluded',\n defaultMessage: \"What's included\",\n description: 'Benefits section heading on the confirmation page',\n },\n benefit1: {\n id: 'checkout.alacarteConfirmation.benefit1',\n defaultMessage: 'Access to graded assignments and exams',\n description: 'First à la carte purchase benefit',\n },\n benefit2: {\n id: 'checkout.alacarteConfirmation.benefit2',\n defaultMessage: 'Shareable Certificate upon completion',\n description: 'Second à la carte purchase benefit',\n },\n benefit3: {\n id: 'checkout.alacarteConfirmation.benefit3',\n defaultMessage: '24/7 Global Support',\n description: 'Third à la carte purchase benefit',\n },\n orderNumber: {\n id: 'checkout.alacarteConfirmation.orderNumber',\n defaultMessage: 'Order number',\n description: 'Order number label',\n },\n purchaseDate: {\n id: 'checkout.alacarteConfirmation.purchaseDate',\n defaultMessage: 'Purchase date',\n description: 'Purchase date label',\n },\n refundNotice: {\n id: 'checkout.alacarteConfirmation.refundContact',\n defaultMessage: 'For course or program refunds, contact {email}. See our {refundPolicy} for details.',\n description: 'Refund contact line at the bottom of the confirmation page; {email} is the billing email link, {refundPolicy} the Refund Policy link',\n },\n billingEmailLabel: {\n id: 'checkout.alacarteConfirmation.billingEmailLabel',\n defaultMessage: 'Email billing at edx dot org',\n description: 'Accessible label for the billing@edx.org email link',\n },\n refundPolicy: {\n id: 'checkout.alacarteConfirmation.refundPolicy',\n defaultMessage: 'Refund Policy',\n description: 'Link text for the refund policy in the refund contact line',\n },\n refundPolicyLabel: {\n id: 'checkout.alacarteConfirmation.refundPolicyLabel',\n defaultMessage: 'Refund Policy, opens in a new tab',\n description: 'Accessible label for the Refund Policy link, which opens in a new tab',\n },\n purchaseSummary: {\n id: 'checkout.alacarteConfirmation.purchaseSummary',\n defaultMessage: 'Purchase summary',\n description: 'Sidebar heading for the purchase summary card',\n },\n verifiedCertificate: {\n id: 'checkout.alacarteConfirmation.verifiedCertificate',\n defaultMessage: 'Verified certificate',\n description: 'Badge on the purchase summary product',\n },\n subtotal: {\n id: 'checkout.alacarteConfirmation.subtotal',\n defaultMessage: 'Subtotal',\n description: 'Subtotal row label',\n },\n discountsApplied: {\n id: 'checkout.alacarteConfirmation.discountsApplied',\n defaultMessage: 'Discounts applied',\n description: 'Discount row label',\n },\n amountPaid: {\n id: 'checkout.alacarteConfirmation.amountPaid',\n defaultMessage: 'Amount paid',\n description: 'Amount paid row label',\n },\n moneyAmount: {\n id: 'checkout.alacarteConfirmation.moneyAmount',\n defaultMessage: '${amount} {currency}',\n description: 'Formatted money amount e.g. $12.00 USD',\n },\n discountAmount: {\n id: 'checkout.alacarteConfirmation.discountAmount',\n defaultMessage: '-${amount} {currency}',\n description: 'Formatted discount amount e.g. -$10.00 USD',\n },\n});\n\nexport default messages;\n"]}
@@ -3,7 +3,8 @@ const Visa = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 2
3
3
  const Mastercard = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 22", role: "img", "aria-label": "Mastercard", children: [_jsx("rect", { width: "34", height: "22", rx: "3", fill: "#fff", stroke: "#E6E6E6" }), _jsx("circle", { cx: "14", cy: "11", r: "6", fill: "#EB001B" }), _jsx("circle", { cx: "20", cy: "11", r: "6", fill: "#F79E1B", fillOpacity: "0.9" })] }));
4
4
  const Amex = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 22", role: "img", "aria-label": "American Express", children: [_jsx("rect", { width: "34", height: "22", rx: "3", fill: "#1F72CD" }), _jsx("text", { x: "17", y: "14", textAnchor: "middle", fontFamily: "Arial, sans-serif", fontWeight: "700", fontSize: "6.5", fill: "#fff", children: "AMEX" })] }));
5
5
  const Discover = () => (_jsxs("svg", { width: "34", height: "22", viewBox: "0 0 34 22", role: "img", "aria-label": "Discover", children: [_jsx("rect", { width: "34", height: "22", rx: "3", fill: "#fff", stroke: "#E6E6E6" }), _jsx("circle", { cx: "25", cy: "11", r: "4", fill: "#F47216" }), _jsx("text", { x: "13", y: "14", textAnchor: "middle", fontFamily: "Arial, sans-serif", fontWeight: "700", fontSize: "5", fill: "#231F20", children: "DISCVR" })] }));
6
- export const CardBrands = () => (_jsxs("div", { className: "brand-marks__card-brands", children: [_jsx(Visa, {}), _jsx(Mastercard, {}), _jsx(Amex, {}), _jsx(Discover, {})] }));
6
+ // Decorative — PaymentFields announces the detected network via a live region.
7
+ export const CardBrands = () => (_jsxs("div", { className: "brand-marks__card-brands", "aria-hidden": "true", children: [_jsx(Visa, {}), _jsx(Mastercard, {}), _jsx(Amex, {}), _jsx(Discover, {})] }));
7
8
  export const PayPalWordmark = () => (_jsxs("span", { className: "brand-marks__paypal", children: [_jsx("span", { className: "brand-marks__paypal-pay", children: "Pay" }), _jsx("span", { className: "brand-marks__paypal-pal", children: "Pal" })] }));
8
9
  export const EdxUnlimitedLogo = ({ ariaLabel = 'edX Plus', } = {}) => (_jsx("span", { className: "brand-marks__edx-logo", children: _jsxs("svg", { width: "48", height: "25", viewBox: "0 0 48 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": ariaLabel, children: [_jsxs("g", { clipPath: "url(#clip0_4947_41473)", children: [_jsx("path", { d: "M28.4709 3.95479L29.3304 0H4.13314L0 19.0065H21.0675L19.9082 24.1061H40.0865L44.5391 3.95479H28.4709Z", fill: "#00262B" }), _jsx("path", { d: "M8.58538 16.5826C8.01563 16.5826 7.47552 16.4938 6.96835 16.3131C6.46118 16.1323 6.01658 15.8659 5.64114 15.517C5.2624 15.165 4.966 14.7337 4.74535 14.2199C4.5247 13.7061 4.41602 13.1163 4.41602 12.4503C4.41602 11.54 4.54775 10.7091 4.81122 9.96067C5.07468 9.21221 5.44024 8.57157 5.91119 8.0356C6.38214 7.49963 6.9453 7.08734 7.60067 6.79239C8.25604 6.50062 8.97728 6.35156 9.75781 6.35156C10.2847 6.35156 10.7853 6.44036 11.2563 6.61796C11.7305 6.79556 12.1422 7.05245 12.4979 7.3918C12.8535 7.73114 13.1368 8.1466 13.3442 8.64452C13.555 9.13926 13.6571 9.70695 13.6571 10.3508C13.6571 10.4491 13.6538 10.5632 13.6472 10.6933C13.6406 10.8265 13.6308 10.9597 13.6176 11.096C13.6044 11.2324 13.5912 11.3688 13.5814 11.4988C13.5682 11.6288 13.5517 11.743 13.5353 11.8318H6.13843C6.13184 11.9174 6.12855 11.9999 6.12526 12.0792C6.12196 12.1585 6.12196 12.2409 6.12196 12.3266C6.12196 12.834 6.19771 13.2653 6.3492 13.6237C6.5007 13.9821 6.6983 14.2738 6.9453 14.499C7.189 14.7242 7.46564 14.8891 7.76863 14.9906C8.07162 15.0921 8.38119 15.1428 8.69076 15.1428C9.36919 15.1428 9.91589 15.0286 10.3276 14.8035C10.7392 14.5783 11.0554 14.2707 11.2694 13.8869H13.0116C12.9029 14.2675 12.7251 14.6195 12.4781 14.9494C12.2311 15.2792 11.9182 15.5646 11.5395 15.8056C11.1608 16.0467 10.7228 16.237 10.2255 16.3733C9.73146 16.516 9.18147 16.5826 8.58538 16.5826ZM11.9281 10.5601C11.9347 10.5284 11.938 10.4744 11.9413 10.3888C11.9446 10.3064 11.9446 10.2239 11.9446 10.1446C11.9446 9.82112 11.8952 9.51349 11.7964 9.22172C11.6976 8.93312 11.5494 8.67623 11.3518 8.4574C11.1542 8.23857 10.9105 8.06414 10.6174 7.93411C10.3243 7.80726 9.98505 7.74066 9.59973 7.74066C9.20452 7.74066 8.83896 7.80726 8.49646 7.94363C8.15395 8.07683 7.84108 8.27029 7.56444 8.51766C7.28451 8.76503 7.0441 9.05998 6.83991 9.40566C6.63572 9.75135 6.47435 10.1351 6.35579 10.5569L11.9281 10.5601Z", fill: "white" }), _jsx("path", { d: "M18.3352 16.5837C17.8215 16.5837 17.3373 16.4918 16.8862 16.3046C16.435 16.1175 16.0398 15.8511 15.7006 15.5023C15.3613 15.1534 15.0913 14.7316 14.897 14.2369C14.6994 13.7421 14.6006 13.1903 14.6006 12.5782C14.6006 11.9851 14.6632 11.4174 14.785 10.8783C14.9102 10.3392 15.0847 9.83489 15.3119 9.37503C15.5392 8.912 15.8158 8.49654 16.1353 8.12231C16.4547 7.74808 16.8104 7.43094 17.2023 7.16771C17.5942 6.90448 18.0158 6.7015 18.4703 6.56196C18.9247 6.42242 19.399 6.34947 19.893 6.34947C20.2618 6.34947 20.6109 6.39705 20.9435 6.49536C21.2762 6.59368 21.5792 6.73005 21.8492 6.90448C22.1193 7.07891 22.3498 7.28822 22.5441 7.53559C22.7384 7.78297 22.88 8.05254 22.9689 8.34748H23.1204L24.3884 2.59766H26.0548L23.0085 16.4061H21.4277L21.7241 15.0583H21.5726C21.1971 15.5276 20.7295 15.8987 20.163 16.1714C19.5966 16.4473 18.9873 16.5837 18.3352 16.5837ZM18.8589 15.1629C19.3924 15.1629 19.8864 15.0424 20.3409 14.8014C20.7953 14.5603 21.1905 14.2305 21.5265 13.8119C21.8624 13.3932 22.1259 12.9017 22.3169 12.3372C22.5079 11.7726 22.6034 11.1606 22.6034 10.5072C22.6034 10.0854 22.5441 9.70803 22.4223 9.36869C22.3004 9.03252 22.1291 8.74709 21.9085 8.5124C21.6845 8.27771 21.4178 8.09377 21.0983 7.96691C20.7822 7.83688 20.4232 7.77345 20.0214 7.77345C19.4945 7.77345 19.0071 7.88762 18.5559 8.1128C18.1047 8.33797 17.7161 8.65194 17.3835 9.05789C17.0541 9.46066 16.7939 9.94272 16.6029 10.5009C16.4119 11.0591 16.3164 11.6743 16.3164 12.3403C16.3164 12.7558 16.379 13.1364 16.5041 13.4852C16.6293 13.8341 16.8005 14.1322 17.0245 14.3796C17.2484 14.6269 17.5119 14.8204 17.8248 14.9568C18.131 15.0931 18.4768 15.1629 18.8589 15.1629Z", fill: "white" }), _jsx("path", { d: "M46.6871 6.46441C46.506 6.46441 46.3347 6.43269 46.1766 6.36609C46.0185 6.29949 45.8769 6.21069 45.7584 6.09335C45.6365 5.976 45.5443 5.8428 45.4751 5.69057C45.406 5.53834 45.373 5.37343 45.373 5.199C45.373 5.02457 45.406 4.85966 45.4751 4.70743C45.5443 4.5552 45.6365 4.41882 45.7584 4.30465C45.8802 4.18731 46.0185 4.09851 46.1766 4.03191C46.3347 3.96531 46.506 3.93359 46.6871 3.93359C46.8682 3.93359 47.0395 3.96531 47.1976 4.03191C47.3556 4.09851 47.4972 4.18731 47.6158 4.30465C47.7377 4.422 47.8299 4.5552 47.899 4.70743C47.9682 4.85966 48.0011 5.02457 48.0011 5.199C48.0011 5.37343 47.9682 5.53834 47.899 5.69057C47.8299 5.8428 47.7377 5.97918 47.6158 6.09335C47.494 6.20752 47.3556 6.29949 47.1976 6.36609C47.0395 6.43269 46.8682 6.46441 46.6871 6.46441ZM46.6871 6.22972C46.8847 6.22972 47.0658 6.18215 47.2272 6.09018C47.3886 5.9982 47.517 5.87135 47.6158 5.71595C47.7113 5.56055 47.7607 5.38612 47.7607 5.19583C47.7607 5.00554 47.7113 4.83111 47.6158 4.67571C47.5203 4.52031 47.3886 4.39662 47.2272 4.30148C47.0658 4.20951 46.8847 4.16194 46.6871 4.16194C46.4895 4.16194 46.3084 4.20951 46.147 4.30148C45.9856 4.39345 45.8572 4.52031 45.7584 4.67571C45.6629 4.83111 45.6135 5.00554 45.6135 5.19583C45.6135 5.38612 45.6629 5.56055 45.7584 5.71595C45.8539 5.87135 45.9856 5.99503 46.147 6.09018C46.3084 6.18215 46.4895 6.22972 46.6871 6.22972ZM46.2392 5.76669V4.59643H46.8221C46.8847 4.59643 46.944 4.60911 47 4.63765C47.0592 4.6662 47.1053 4.70743 47.1416 4.76134C47.1811 4.81526 47.1976 4.88186 47.1976 4.96114C47.1976 5.04043 47.1778 5.1102 47.1383 5.16729C47.0988 5.22437 47.0494 5.26877 46.9901 5.30049C46.9308 5.3322 46.8682 5.34489 46.8056 5.34489H46.3545V5.18631H46.7497C46.8056 5.18631 46.855 5.16729 46.9012 5.12923C46.944 5.09117 46.967 5.03409 46.967 4.96431C46.967 4.89137 46.944 4.83746 46.9012 4.80574C46.8583 4.77403 46.8089 4.75817 46.7562 4.75817H46.45V5.76669H46.2392ZM46.9473 5.22437L47.2502 5.76669H47.0131L46.72 5.22437H46.9473Z", fill: "#00262B" }), _jsx("path", { d: "M40.9978 6.55273H37.2796L33.2288 11.386H33.0279L30.8839 6.55273H27.1262L30.3471 13.5743L23.3916 21.5093H27.0571L31.5228 16.4096H31.8225L34.2366 21.5093H37.9251L34.3584 13.9232L40.9978 6.55273Z", fill: "white" })] }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_4947_41473", children: _jsx("rect", { width: "48", height: "24.1061", fill: "white" }) }) })] }) }));
9
10
  //# sourceMappingURL=BrandMarks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrandMarks.js","sourceRoot":"","sources":["../../../src/components/BrandMarks/BrandMarks.tsx"],"names":[],"mappings":";AAEA,MAAM,IAAI,GAA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AAMF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,SAAS,GAAG,UAAU,MACG,EAAE,EAAE,EAAE,CAAC,CAChC,eAAM,SAAS,EAAC,uBAAuB,YACrC,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,KAAK,gBACE,SAAS,aAErB,aAAG,QAAQ,EAAC,wBAAwB,aAClC,eACE,CAAC,EAAC,uGAAuG,EACzG,IAAI,EAAC,SAAS,GACd,EACF,eACE,CAAC,EAAC,w0DAAw0D,EAC10D,IAAI,EAAC,OAAO,GACZ,EACF,eACE,CAAC,EAAC,qmDAAqmD,EACvmD,IAAI,EAAC,OAAO,GACZ,EACF,eACE,CAAC,EAAC,y6DAAy6D,EAC36D,IAAI,EAAC,SAAS,GACd,EACF,eACE,CAAC,EAAC,kMAAkM,EACpM,IAAI,EAAC,OAAO,GACZ,IACA,EACJ,yBACE,mBAAU,EAAE,EAAC,kBAAkB,YAC7B,eAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,GAAG,GACxC,GACN,IACH,GACD,CACR,CAAC","sourcesContent":["import React from 'react';\n\nconst Visa = () => (\n <svg width=\"34\" height=\"22\" viewBox=\"0 0 34 22\" role=\"img\" aria-label=\"Visa\">\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#1A1F71\" />\n <text\n x=\"17\"\n y=\"15\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontStyle=\"italic\"\n fontSize=\"10\"\n fill=\"#fff\"\n >\n VISA\n </text>\n </svg>\n);\n\nconst Mastercard = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"Mastercard\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#fff\" stroke=\"#E6E6E6\" />\n <circle cx=\"14\" cy=\"11\" r=\"6\" fill=\"#EB001B\" />\n <circle cx=\"20\" cy=\"11\" r=\"6\" fill=\"#F79E1B\" fillOpacity=\"0.9\" />\n </svg>\n);\n\nconst Amex = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"American Express\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#1F72CD\" />\n <text\n x=\"17\"\n y=\"14\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontSize=\"6.5\"\n fill=\"#fff\"\n >\n AMEX\n </text>\n </svg>\n);\n\nconst Discover = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"Discover\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#fff\" stroke=\"#E6E6E6\" />\n <circle cx=\"25\" cy=\"11\" r=\"4\" fill=\"#F47216\" />\n <text\n x=\"13\"\n y=\"14\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontSize=\"5\"\n fill=\"#231F20\"\n >\n DISCVR\n </text>\n </svg>\n);\n\nexport const CardBrands = () => (\n <div className=\"brand-marks__card-brands\">\n <Visa />\n <Mastercard />\n <Amex />\n <Discover />\n </div>\n);\n\nexport const PayPalWordmark = () => (\n <span className=\"brand-marks__paypal\">\n <span className=\"brand-marks__paypal-pay\">Pay</span>\n <span className=\"brand-marks__paypal-pal\">Pal</span>\n </span>\n);\n\ninterface EdxUnlimitedLogoProps {\n ariaLabel?: string,\n}\n\nexport const EdxUnlimitedLogo = ({\n ariaLabel = 'edX Plus',\n}: EdxUnlimitedLogoProps = {}) => (\n <span className=\"brand-marks__edx-logo\">\n <svg\n width=\"48\"\n height=\"25\"\n viewBox=\"0 0 48 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-label={ariaLabel}\n >\n <g clipPath=\"url(#clip0_4947_41473)\">\n <path\n d=\"M28.4709 3.95479L29.3304 0H4.13314L0 19.0065H21.0675L19.9082 24.1061H40.0865L44.5391 3.95479H28.4709Z\"\n fill=\"#00262B\"\n />\n <path\n d=\"M8.58538 16.5826C8.01563 16.5826 7.47552 16.4938 6.96835 16.3131C6.46118 16.1323 6.01658 15.8659 5.64114 15.517C5.2624 15.165 4.966 14.7337 4.74535 14.2199C4.5247 13.7061 4.41602 13.1163 4.41602 12.4503C4.41602 11.54 4.54775 10.7091 4.81122 9.96067C5.07468 9.21221 5.44024 8.57157 5.91119 8.0356C6.38214 7.49963 6.9453 7.08734 7.60067 6.79239C8.25604 6.50062 8.97728 6.35156 9.75781 6.35156C10.2847 6.35156 10.7853 6.44036 11.2563 6.61796C11.7305 6.79556 12.1422 7.05245 12.4979 7.3918C12.8535 7.73114 13.1368 8.1466 13.3442 8.64452C13.555 9.13926 13.6571 9.70695 13.6571 10.3508C13.6571 10.4491 13.6538 10.5632 13.6472 10.6933C13.6406 10.8265 13.6308 10.9597 13.6176 11.096C13.6044 11.2324 13.5912 11.3688 13.5814 11.4988C13.5682 11.6288 13.5517 11.743 13.5353 11.8318H6.13843C6.13184 11.9174 6.12855 11.9999 6.12526 12.0792C6.12196 12.1585 6.12196 12.2409 6.12196 12.3266C6.12196 12.834 6.19771 13.2653 6.3492 13.6237C6.5007 13.9821 6.6983 14.2738 6.9453 14.499C7.189 14.7242 7.46564 14.8891 7.76863 14.9906C8.07162 15.0921 8.38119 15.1428 8.69076 15.1428C9.36919 15.1428 9.91589 15.0286 10.3276 14.8035C10.7392 14.5783 11.0554 14.2707 11.2694 13.8869H13.0116C12.9029 14.2675 12.7251 14.6195 12.4781 14.9494C12.2311 15.2792 11.9182 15.5646 11.5395 15.8056C11.1608 16.0467 10.7228 16.237 10.2255 16.3733C9.73146 16.516 9.18147 16.5826 8.58538 16.5826ZM11.9281 10.5601C11.9347 10.5284 11.938 10.4744 11.9413 10.3888C11.9446 10.3064 11.9446 10.2239 11.9446 10.1446C11.9446 9.82112 11.8952 9.51349 11.7964 9.22172C11.6976 8.93312 11.5494 8.67623 11.3518 8.4574C11.1542 8.23857 10.9105 8.06414 10.6174 7.93411C10.3243 7.80726 9.98505 7.74066 9.59973 7.74066C9.20452 7.74066 8.83896 7.80726 8.49646 7.94363C8.15395 8.07683 7.84108 8.27029 7.56444 8.51766C7.28451 8.76503 7.0441 9.05998 6.83991 9.40566C6.63572 9.75135 6.47435 10.1351 6.35579 10.5569L11.9281 10.5601Z\"\n fill=\"white\"\n />\n <path\n d=\"M18.3352 16.5837C17.8215 16.5837 17.3373 16.4918 16.8862 16.3046C16.435 16.1175 16.0398 15.8511 15.7006 15.5023C15.3613 15.1534 15.0913 14.7316 14.897 14.2369C14.6994 13.7421 14.6006 13.1903 14.6006 12.5782C14.6006 11.9851 14.6632 11.4174 14.785 10.8783C14.9102 10.3392 15.0847 9.83489 15.3119 9.37503C15.5392 8.912 15.8158 8.49654 16.1353 8.12231C16.4547 7.74808 16.8104 7.43094 17.2023 7.16771C17.5942 6.90448 18.0158 6.7015 18.4703 6.56196C18.9247 6.42242 19.399 6.34947 19.893 6.34947C20.2618 6.34947 20.6109 6.39705 20.9435 6.49536C21.2762 6.59368 21.5792 6.73005 21.8492 6.90448C22.1193 7.07891 22.3498 7.28822 22.5441 7.53559C22.7384 7.78297 22.88 8.05254 22.9689 8.34748H23.1204L24.3884 2.59766H26.0548L23.0085 16.4061H21.4277L21.7241 15.0583H21.5726C21.1971 15.5276 20.7295 15.8987 20.163 16.1714C19.5966 16.4473 18.9873 16.5837 18.3352 16.5837ZM18.8589 15.1629C19.3924 15.1629 19.8864 15.0424 20.3409 14.8014C20.7953 14.5603 21.1905 14.2305 21.5265 13.8119C21.8624 13.3932 22.1259 12.9017 22.3169 12.3372C22.5079 11.7726 22.6034 11.1606 22.6034 10.5072C22.6034 10.0854 22.5441 9.70803 22.4223 9.36869C22.3004 9.03252 22.1291 8.74709 21.9085 8.5124C21.6845 8.27771 21.4178 8.09377 21.0983 7.96691C20.7822 7.83688 20.4232 7.77345 20.0214 7.77345C19.4945 7.77345 19.0071 7.88762 18.5559 8.1128C18.1047 8.33797 17.7161 8.65194 17.3835 9.05789C17.0541 9.46066 16.7939 9.94272 16.6029 10.5009C16.4119 11.0591 16.3164 11.6743 16.3164 12.3403C16.3164 12.7558 16.379 13.1364 16.5041 13.4852C16.6293 13.8341 16.8005 14.1322 17.0245 14.3796C17.2484 14.6269 17.5119 14.8204 17.8248 14.9568C18.131 15.0931 18.4768 15.1629 18.8589 15.1629Z\"\n fill=\"white\"\n />\n <path\n d=\"M46.6871 6.46441C46.506 6.46441 46.3347 6.43269 46.1766 6.36609C46.0185 6.29949 45.8769 6.21069 45.7584 6.09335C45.6365 5.976 45.5443 5.8428 45.4751 5.69057C45.406 5.53834 45.373 5.37343 45.373 5.199C45.373 5.02457 45.406 4.85966 45.4751 4.70743C45.5443 4.5552 45.6365 4.41882 45.7584 4.30465C45.8802 4.18731 46.0185 4.09851 46.1766 4.03191C46.3347 3.96531 46.506 3.93359 46.6871 3.93359C46.8682 3.93359 47.0395 3.96531 47.1976 4.03191C47.3556 4.09851 47.4972 4.18731 47.6158 4.30465C47.7377 4.422 47.8299 4.5552 47.899 4.70743C47.9682 4.85966 48.0011 5.02457 48.0011 5.199C48.0011 5.37343 47.9682 5.53834 47.899 5.69057C47.8299 5.8428 47.7377 5.97918 47.6158 6.09335C47.494 6.20752 47.3556 6.29949 47.1976 6.36609C47.0395 6.43269 46.8682 6.46441 46.6871 6.46441ZM46.6871 6.22972C46.8847 6.22972 47.0658 6.18215 47.2272 6.09018C47.3886 5.9982 47.517 5.87135 47.6158 5.71595C47.7113 5.56055 47.7607 5.38612 47.7607 5.19583C47.7607 5.00554 47.7113 4.83111 47.6158 4.67571C47.5203 4.52031 47.3886 4.39662 47.2272 4.30148C47.0658 4.20951 46.8847 4.16194 46.6871 4.16194C46.4895 4.16194 46.3084 4.20951 46.147 4.30148C45.9856 4.39345 45.8572 4.52031 45.7584 4.67571C45.6629 4.83111 45.6135 5.00554 45.6135 5.19583C45.6135 5.38612 45.6629 5.56055 45.7584 5.71595C45.8539 5.87135 45.9856 5.99503 46.147 6.09018C46.3084 6.18215 46.4895 6.22972 46.6871 6.22972ZM46.2392 5.76669V4.59643H46.8221C46.8847 4.59643 46.944 4.60911 47 4.63765C47.0592 4.6662 47.1053 4.70743 47.1416 4.76134C47.1811 4.81526 47.1976 4.88186 47.1976 4.96114C47.1976 5.04043 47.1778 5.1102 47.1383 5.16729C47.0988 5.22437 47.0494 5.26877 46.9901 5.30049C46.9308 5.3322 46.8682 5.34489 46.8056 5.34489H46.3545V5.18631H46.7497C46.8056 5.18631 46.855 5.16729 46.9012 5.12923C46.944 5.09117 46.967 5.03409 46.967 4.96431C46.967 4.89137 46.944 4.83746 46.9012 4.80574C46.8583 4.77403 46.8089 4.75817 46.7562 4.75817H46.45V5.76669H46.2392ZM46.9473 5.22437L47.2502 5.76669H47.0131L46.72 5.22437H46.9473Z\"\n fill=\"#00262B\"\n />\n <path\n d=\"M40.9978 6.55273H37.2796L33.2288 11.386H33.0279L30.8839 6.55273H27.1262L30.3471 13.5743L23.3916 21.5093H27.0571L31.5228 16.4096H31.8225L34.2366 21.5093H37.9251L34.3584 13.9232L40.9978 6.55273Z\"\n fill=\"white\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_4947_41473\">\n <rect width=\"48\" height=\"24.1061\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </span>\n);\n"]}
1
+ {"version":3,"file":"BrandMarks.js","sourceRoot":"","sources":["../../../src/components/BrandMarks/BrandMarks.tsx"],"names":[],"mappings":";AAEA,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CACjB,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,K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AAE,CAAC,CAChC,eAAM,SAAS,EAAC,uBAAuB,YACrC,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,KAAK,gBACE,SAAS,aAErB,aAAG,QAAQ,EAAC,wBAAwB,aAClC,eACE,CAAC,EAAC,uGAAuG,EACzG,IAAI,EAAC,SAAS,GACd,EACF,eACE,CAAC,EAAC,w0DAAw0D,EAC10D,IAAI,EAAC,OAAO,GACZ,EACF,eACE,CAAC,EAAC,qmDAAqmD,EACvmD,IAAI,EAAC,OAAO,GACZ,EACF,eACE,CAAC,EAAC,y6DAAy6D,EAC36D,IAAI,EAAC,SAAS,GACd,EACF,eACE,CAAC,EAAC,kMAAkM,EACpM,IAAI,EAAC,OAAO,GACZ,IACA,EACJ,yBACE,mBAAU,EAAE,EAAC,kBAAkB,YAC7B,eAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,GAAG,GACxC,GACN,IACH,GACD,CACR,CAAC","sourcesContent":["import React from 'react';\n\nconst Visa = () => (\n <svg width=\"34\" height=\"22\" viewBox=\"0 0 34 22\" role=\"img\" aria-label=\"Visa\">\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#1A1F71\" />\n <text\n x=\"17\"\n y=\"15\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontStyle=\"italic\"\n fontSize=\"10\"\n fill=\"#fff\"\n >\n VISA\n </text>\n </svg>\n);\n\nconst Mastercard = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"Mastercard\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#fff\" stroke=\"#E6E6E6\" />\n <circle cx=\"14\" cy=\"11\" r=\"6\" fill=\"#EB001B\" />\n <circle cx=\"20\" cy=\"11\" r=\"6\" fill=\"#F79E1B\" fillOpacity=\"0.9\" />\n </svg>\n);\n\nconst Amex = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"American Express\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#1F72CD\" />\n <text\n x=\"17\"\n y=\"14\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontSize=\"6.5\"\n fill=\"#fff\"\n >\n AMEX\n </text>\n </svg>\n);\n\nconst Discover = () => (\n <svg\n width=\"34\"\n height=\"22\"\n viewBox=\"0 0 34 22\"\n role=\"img\"\n aria-label=\"Discover\"\n >\n <rect width=\"34\" height=\"22\" rx=\"3\" fill=\"#fff\" stroke=\"#E6E6E6\" />\n <circle cx=\"25\" cy=\"11\" r=\"4\" fill=\"#F47216\" />\n <text\n x=\"13\"\n y=\"14\"\n textAnchor=\"middle\"\n fontFamily=\"Arial, sans-serif\"\n fontWeight=\"700\"\n fontSize=\"5\"\n fill=\"#231F20\"\n >\n DISCVR\n </text>\n </svg>\n);\n\n// Decorative — PaymentFields announces the detected network via a live region.\nexport const CardBrands = () => (\n <div className=\"brand-marks__card-brands\" aria-hidden=\"true\">\n <Visa />\n <Mastercard />\n <Amex />\n <Discover />\n </div>\n);\n\nexport const PayPalWordmark = () => (\n <span className=\"brand-marks__paypal\">\n <span className=\"brand-marks__paypal-pay\">Pay</span>\n <span className=\"brand-marks__paypal-pal\">Pal</span>\n </span>\n);\n\ninterface EdxUnlimitedLogoProps {\n ariaLabel?: string,\n}\n\nexport const EdxUnlimitedLogo = ({\n ariaLabel = 'edX Plus',\n}: EdxUnlimitedLogoProps = {}) => (\n <span className=\"brand-marks__edx-logo\">\n <svg\n width=\"48\"\n height=\"25\"\n viewBox=\"0 0 48 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n aria-label={ariaLabel}\n >\n <g clipPath=\"url(#clip0_4947_41473)\">\n <path\n d=\"M28.4709 3.95479L29.3304 0H4.13314L0 19.0065H21.0675L19.9082 24.1061H40.0865L44.5391 3.95479H28.4709Z\"\n fill=\"#00262B\"\n />\n <path\n d=\"M8.58538 16.5826C8.01563 16.5826 7.47552 16.4938 6.96835 16.3131C6.46118 16.1323 6.01658 15.8659 5.64114 15.517C5.2624 15.165 4.966 14.7337 4.74535 14.2199C4.5247 13.7061 4.41602 13.1163 4.41602 12.4503C4.41602 11.54 4.54775 10.7091 4.81122 9.96067C5.07468 9.21221 5.44024 8.57157 5.91119 8.0356C6.38214 7.49963 6.9453 7.08734 7.60067 6.79239C8.25604 6.50062 8.97728 6.35156 9.75781 6.35156C10.2847 6.35156 10.7853 6.44036 11.2563 6.61796C11.7305 6.79556 12.1422 7.05245 12.4979 7.3918C12.8535 7.73114 13.1368 8.1466 13.3442 8.64452C13.555 9.13926 13.6571 9.70695 13.6571 10.3508C13.6571 10.4491 13.6538 10.5632 13.6472 10.6933C13.6406 10.8265 13.6308 10.9597 13.6176 11.096C13.6044 11.2324 13.5912 11.3688 13.5814 11.4988C13.5682 11.6288 13.5517 11.743 13.5353 11.8318H6.13843C6.13184 11.9174 6.12855 11.9999 6.12526 12.0792C6.12196 12.1585 6.12196 12.2409 6.12196 12.3266C6.12196 12.834 6.19771 13.2653 6.3492 13.6237C6.5007 13.9821 6.6983 14.2738 6.9453 14.499C7.189 14.7242 7.46564 14.8891 7.76863 14.9906C8.07162 15.0921 8.38119 15.1428 8.69076 15.1428C9.36919 15.1428 9.91589 15.0286 10.3276 14.8035C10.7392 14.5783 11.0554 14.2707 11.2694 13.8869H13.0116C12.9029 14.2675 12.7251 14.6195 12.4781 14.9494C12.2311 15.2792 11.9182 15.5646 11.5395 15.8056C11.1608 16.0467 10.7228 16.237 10.2255 16.3733C9.73146 16.516 9.18147 16.5826 8.58538 16.5826ZM11.9281 10.5601C11.9347 10.5284 11.938 10.4744 11.9413 10.3888C11.9446 10.3064 11.9446 10.2239 11.9446 10.1446C11.9446 9.82112 11.8952 9.51349 11.7964 9.22172C11.6976 8.93312 11.5494 8.67623 11.3518 8.4574C11.1542 8.23857 10.9105 8.06414 10.6174 7.93411C10.3243 7.80726 9.98505 7.74066 9.59973 7.74066C9.20452 7.74066 8.83896 7.80726 8.49646 7.94363C8.15395 8.07683 7.84108 8.27029 7.56444 8.51766C7.28451 8.76503 7.0441 9.05998 6.83991 9.40566C6.63572 9.75135 6.47435 10.1351 6.35579 10.5569L11.9281 10.5601Z\"\n fill=\"white\"\n />\n <path\n d=\"M18.3352 16.5837C17.8215 16.5837 17.3373 16.4918 16.8862 16.3046C16.435 16.1175 16.0398 15.8511 15.7006 15.5023C15.3613 15.1534 15.0913 14.7316 14.897 14.2369C14.6994 13.7421 14.6006 13.1903 14.6006 12.5782C14.6006 11.9851 14.6632 11.4174 14.785 10.8783C14.9102 10.3392 15.0847 9.83489 15.3119 9.37503C15.5392 8.912 15.8158 8.49654 16.1353 8.12231C16.4547 7.74808 16.8104 7.43094 17.2023 7.16771C17.5942 6.90448 18.0158 6.7015 18.4703 6.56196C18.9247 6.42242 19.399 6.34947 19.893 6.34947C20.2618 6.34947 20.6109 6.39705 20.9435 6.49536C21.2762 6.59368 21.5792 6.73005 21.8492 6.90448C22.1193 7.07891 22.3498 7.28822 22.5441 7.53559C22.7384 7.78297 22.88 8.05254 22.9689 8.34748H23.1204L24.3884 2.59766H26.0548L23.0085 16.4061H21.4277L21.7241 15.0583H21.5726C21.1971 15.5276 20.7295 15.8987 20.163 16.1714C19.5966 16.4473 18.9873 16.5837 18.3352 16.5837ZM18.8589 15.1629C19.3924 15.1629 19.8864 15.0424 20.3409 14.8014C20.7953 14.5603 21.1905 14.2305 21.5265 13.8119C21.8624 13.3932 22.1259 12.9017 22.3169 12.3372C22.5079 11.7726 22.6034 11.1606 22.6034 10.5072C22.6034 10.0854 22.5441 9.70803 22.4223 9.36869C22.3004 9.03252 22.1291 8.74709 21.9085 8.5124C21.6845 8.27771 21.4178 8.09377 21.0983 7.96691C20.7822 7.83688 20.4232 7.77345 20.0214 7.77345C19.4945 7.77345 19.0071 7.88762 18.5559 8.1128C18.1047 8.33797 17.7161 8.65194 17.3835 9.05789C17.0541 9.46066 16.7939 9.94272 16.6029 10.5009C16.4119 11.0591 16.3164 11.6743 16.3164 12.3403C16.3164 12.7558 16.379 13.1364 16.5041 13.4852C16.6293 13.8341 16.8005 14.1322 17.0245 14.3796C17.2484 14.6269 17.5119 14.8204 17.8248 14.9568C18.131 15.0931 18.4768 15.1629 18.8589 15.1629Z\"\n fill=\"white\"\n />\n <path\n d=\"M46.6871 6.46441C46.506 6.46441 46.3347 6.43269 46.1766 6.36609C46.0185 6.29949 45.8769 6.21069 45.7584 6.09335C45.6365 5.976 45.5443 5.8428 45.4751 5.69057C45.406 5.53834 45.373 5.37343 45.373 5.199C45.373 5.02457 45.406 4.85966 45.4751 4.70743C45.5443 4.5552 45.6365 4.41882 45.7584 4.30465C45.8802 4.18731 46.0185 4.09851 46.1766 4.03191C46.3347 3.96531 46.506 3.93359 46.6871 3.93359C46.8682 3.93359 47.0395 3.96531 47.1976 4.03191C47.3556 4.09851 47.4972 4.18731 47.6158 4.30465C47.7377 4.422 47.8299 4.5552 47.899 4.70743C47.9682 4.85966 48.0011 5.02457 48.0011 5.199C48.0011 5.37343 47.9682 5.53834 47.899 5.69057C47.8299 5.8428 47.7377 5.97918 47.6158 6.09335C47.494 6.20752 47.3556 6.29949 47.1976 6.36609C47.0395 6.43269 46.8682 6.46441 46.6871 6.46441ZM46.6871 6.22972C46.8847 6.22972 47.0658 6.18215 47.2272 6.09018C47.3886 5.9982 47.517 5.87135 47.6158 5.71595C47.7113 5.56055 47.7607 5.38612 47.7607 5.19583C47.7607 5.00554 47.7113 4.83111 47.6158 4.67571C47.5203 4.52031 47.3886 4.39662 47.2272 4.30148C47.0658 4.20951 46.8847 4.16194 46.6871 4.16194C46.4895 4.16194 46.3084 4.20951 46.147 4.30148C45.9856 4.39345 45.8572 4.52031 45.7584 4.67571C45.6629 4.83111 45.6135 5.00554 45.6135 5.19583C45.6135 5.38612 45.6629 5.56055 45.7584 5.71595C45.8539 5.87135 45.9856 5.99503 46.147 6.09018C46.3084 6.18215 46.4895 6.22972 46.6871 6.22972ZM46.2392 5.76669V4.59643H46.8221C46.8847 4.59643 46.944 4.60911 47 4.63765C47.0592 4.6662 47.1053 4.70743 47.1416 4.76134C47.1811 4.81526 47.1976 4.88186 47.1976 4.96114C47.1976 5.04043 47.1778 5.1102 47.1383 5.16729C47.0988 5.22437 47.0494 5.26877 46.9901 5.30049C46.9308 5.3322 46.8682 5.34489 46.8056 5.34489H46.3545V5.18631H46.7497C46.8056 5.18631 46.855 5.16729 46.9012 5.12923C46.944 5.09117 46.967 5.03409 46.967 4.96431C46.967 4.89137 46.944 4.83746 46.9012 4.80574C46.8583 4.77403 46.8089 4.75817 46.7562 4.75817H46.45V5.76669H46.2392ZM46.9473 5.22437L47.2502 5.76669H47.0131L46.72 5.22437H46.9473Z\"\n fill=\"#00262B\"\n />\n <path\n d=\"M40.9978 6.55273H37.2796L33.2288 11.386H33.0279L30.8839 6.55273H27.1262L30.3471 13.5743L23.3916 21.5093H27.0571L31.5228 16.4096H31.8225L34.2366 21.5093H37.9251L34.3584 13.9232L40.9978 6.55273Z\"\n fill=\"white\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_4947_41473\">\n <rect width=\"48\" height=\"24.1061\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </span>\n);\n"]}
@@ -48,12 +48,12 @@ const CartSummary = ({ productTitle, productBlurb, learnerCount: learnerCountPro
48
48
  .filter(Boolean)
49
49
  .join(', ');
50
50
  const discount = (_g = alacarteLine === null || alacarteLine === void 0 ? void 0 : alacarteLine.discount) !== null && _g !== void 0 ? _g : null;
51
- return (_jsxs("div", { className: "cart-summary ", children: [_jsxs(Card, { className: "cart-summary__card p-3", children: [_jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0 pb-3", children: [_jsx("h2", { className: "cart-summary__heading font-weight-bold text-gray-900 mb-0", children: formatMessage(messages.summaryHeading) }), _jsxs(Badge, { variant: "light", className: "d-flex align-items-center px-2 py-1", children: [_jsx(Icon, { src: Group, className: "mr-1", style: { width: '1rem', height: '1rem' } }), subscriberCount == null ? (_jsx("span", { className: "cart-summary__count-skeleton", "aria-busy": "true", "aria-label": formatMessage(messages.loadingSubscribers), "data-testid": "subscriber-count-skeleton", children: _jsx(Skeleton, { width: 96, height: 12 }) })) : (formatMessage(messages.learnersSubscribed, {
51
+ return (_jsxs("aside", { className: "cart-summary", "aria-labelledby": "cart-summary-heading", children: [_jsxs(Card, { className: "cart-summary__card p-3", children: [_jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0 pb-3", children: [_jsx("h2", { id: "cart-summary-heading", className: "cart-summary__heading font-weight-bold text-gray-900 mb-0", children: formatMessage(messages.summaryHeading) }), _jsxs(Badge, { variant: "light", className: "d-flex align-items-center px-2 py-1", children: [_jsx(Icon, { src: Group, className: "mr-1", style: { width: '1rem', height: '1rem' } }), subscriberCount == null ? (_jsx("span", { className: "cart-summary__count-skeleton", "aria-busy": "true", "aria-label": formatMessage(messages.loadingSubscribers), "data-testid": "subscriber-count-skeleton", children: _jsx(Skeleton, { width: 96, height: 12 }) })) : (formatMessage(messages.learnersSubscribed, {
52
52
  count: subscriberCount.toLocaleString(),
53
53
  }))] })] }), _jsx(Card.Divider, {}), _jsxs(Card.Section, { className: "p-0 py-3", children: [course ? (_jsx(CourseEnrollmentCard, { course: course, variant: "summary" })) : programDetail ? (_jsx(ProgramEnrollmentCard, { program: programDetail, programName: lineName !== null && lineName !== void 0 ? lineName : '', ownedCourses: ownedCourses })) : lineName ? (_jsx("p", { className: "font-weight-bold mb-0 text-primary-500", children: lineName })) : (_jsxs("div", { className: "d-flex align-items-start", children: [_jsx(EdxUnlimitedLogo, { ariaLabel: "edX Plus" }), _jsxs("div", { children: [_jsx("p", { className: "font-weight-bold mb-0 text-primary-500", children: title }), _jsx("p", { className: "small mb-0 text-gray-900", children: blurb })] })] })), !programDetail && ownedCourseNames && (_jsx("p", { className: "cart-summary__already-yours small text-gray-700 mb-0 mt-2", "data-testid": "already-yours", children: formatMessage(messages.alreadyYours, { names: ownedCourseNames }) }))] }), _jsx(Card.Divider, {}), _jsxs(Card.Section, { className: "cart-summary__subtotal-row d-flex justify-content-between align-items-center p-0 pt-3", children: [_jsx("span", { className: "cart-summary__subtotal text-gray-900", children: formatMessage(messages.subtotal) }), _jsx("span", { className: "cart-summary__subtotal text-gray-900", children: subtotalText })] }), discount && (_jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0", "data-testid": "discount-row", children: [_jsx("span", { className: "text-success font-weight-bold", children: formatMessage(messages.discountApplied) }), _jsx("span", { className: "text-success font-weight-bold", children: formatMessage(messages.discountAmount, {
54
54
  amount: discount.amount.toFixed(2),
55
55
  currency: discount.currency,
56
- }) })] })), _jsxs(Card.Section, { className: "d-flex justify-content-between align-items-center p-0", children: [_jsx("span", { className: "cart-summary__total-label text-gray-900", children: formatMessage(messages.todaysTotal) }), _jsx("span", { className: "cart-summary__total-value mb-0 text-gray-900", children: totalText })] })] }), promoCode ? _jsx(PromoCode, Object.assign({}, promoCode)) : null, _jsxs("div", { className: "cart-summary__stats d-none d-lg-flex", children: [_jsxs("div", { className: "cart-summary__stat d-flex align-items-center mr-4", children: [_jsx("img", { src: learnersIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { children: [_jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-500 mb-0", children: formatMessage(messages.learnersCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-500 mb-0", children: formatMessage(messages.learnersLabel) })] })] }), _jsxs("div", { className: "cart-summary__stat d-flex align-items-center", children: [_jsx("img", { src: institutionsIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { children: [_jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-500 mb-0", children: formatMessage(messages.institutionsCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-500 mb-0", children: formatMessage(messages.institutionsLabel) })] })] })] })] }));
56
+ }) })] })), _jsx(Card.Section, { className: "p-0", children: _jsxs("div", { className: "d-flex justify-content-between align-items-center", "aria-live": "polite", "aria-atomic": "true", "data-testid": "todays-total", children: [_jsx("span", { className: "cart-summary__total-label text-gray-900", children: formatMessage(messages.todaysTotal) }), _jsx("span", { className: "cart-summary__total-value mb-0 text-gray-900", children: totalText })] }) })] }), promoCode ? _jsx(PromoCode, Object.assign({}, promoCode)) : null, _jsxs("div", { className: "cart-summary__stats d-none d-lg-flex", children: [_jsxs("div", { className: "cart-summary__stat d-flex align-items-center mr-4", children: [_jsx("img", { src: learnersIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { children: [_jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-500 mb-0", children: formatMessage(messages.learnersCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-500 mb-0", children: formatMessage(messages.learnersLabel) })] })] }), _jsxs("div", { className: "cart-summary__stat d-flex align-items-center", children: [_jsx("img", { src: institutionsIcon, alt: "", width: 50, height: 50, className: "mr-2" }), _jsxs("div", { children: [_jsx("p", { className: "cart-summary__stat-count font-weight-bold text-gray-500 mb-0", children: formatMessage(messages.institutionsCount) }), _jsx("p", { className: "cart-summary__stat-label text-gray-500 mb-0", children: formatMessage(messages.institutionsLabel) })] })] })] })] }));
57
57
  };
58
58
  export default CartSummary;
59
59
  //# sourceMappingURL=CartSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sourceRoot":"","sources":["../../../src/components/CartSummary/CartSummary.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,O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AC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React from 'react';\nimport { Badge, Card, Icon, Skeleton } from '@openedx/paragon';\nimport { Group } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { EdxUnlimitedLogo } from '../BrandMarks/BrandMarks';\nimport CourseEnrollmentCard from '../CourseEnrollmentCard/CourseEnrollmentCard';\nimport ProgramEnrollmentCard from '../ProgramEnrollmentCard/ProgramEnrollmentCard';\nimport PromoCode from '../PromoCode/PromoCode';\nimport type { PromoCodeProps } from '../PromoCode/PromoCode';\nimport type { CourseDetail } from '../../types';\nimport type { AlacarteLine, ProgramDetail } from '../../types/alacarte';\nimport messages from './Messages';\nimport learnersIcon from './world-icon.svg';\nimport institutionsIcon from './student-icon.svg';\n\nexport type BillingCycle = 'monthly' | 'annual';\n\nexport interface CartSummaryProps {\n productTitle?: string,\n productBlurb?: string,\n /** Promotional monthly price amount e.g. \"39\" */\n monthlyAmount?: string,\n /** Regular monthly price after the promo period e.g. \"59\" */\n monthlyRegularAmount?: string,\n /** Length of the promotional period in months */\n promoMonths?: number,\n /** Annual price amount e.g. \"299\" */\n annualAmount?: string,\n currency?: string,\n defaultCycle?: BillingCycle,\n monthlyRenewalLabel?: string,\n annualRenewalLabel?: string,\n /** Called when the learner switches monthly ↔ annual. */\n onCycleChange?: (cycle: BillingCycle) => void,\n learnerCount?: number,\n /** When set, shows the course enrollment preview card below the summary card. */\n course?: CourseDetail | null,\n /** À la carte checkout line — when present, drives the subtotal/total and\n * the product name shown, in place of the generic edX Plus placeholder. */\n alacarteLine?: AlacarteLine | null,\n /** Program catalog detail (filterTwouProgram) — when present, drives the\n * \"Courses included in this program\" list. */\n programDetail?: ProgramDetail | null,\n /** Fallback program name — used when there is no alacarteLine to provide it\n * (e.g. already-owned overlay). */\n programName?: string | null,\n /** Coupon input — when set, wires PromoCode to tCheckoutUpdate. */\n promoCode?: PromoCodeProps | null,\n}\n\nconst CartSummary = ({\n productTitle,\n productBlurb,\n learnerCount: learnerCountProp,\n course = null,\n alacarteLine = null,\n programDetail = null,\n programName: programNameProp = null,\n promoCode = null,\n}: CartSummaryProps) => {\n const { formatMessage } = useIntl();\n const title = productTitle ?? formatMessage(messages.productTitle);\n const blurb = productBlurb ?? formatMessage(messages.productBlurb);\n\n // Prefer the product's own enrollment count (course or program catalog field).\n const isProgramLine = alacarteLine?.kind === 'program';\n const subscriberCount = course?.tEnrollmentCount\n ?? programDetail?.tEnrollmentCount\n ?? learnerCountProp\n ?? null;\n\n // No fallback amount — an unresolved à la carte line means we don't know\n // the price yet, so the row is left blank rather than showing a made-up\n // number that could be mistaken for the real one.\n // Program subtotal is price less owned-course deduction (before coupon/discount).\n const deductionAmount = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.deduction?.amount ?? 0)\n : 0;\n const subtotalAmount = alacarteLine?.price\n ? Math.max(0, alacarteLine.price.amount - deductionAmount)\n : null;\n const subtotalText = subtotalAmount != null && alacarteLine?.price\n ? formatMessage(messages.subtotalAmount, {\n amount: subtotalAmount.toFixed(2), currency: alacarteLine.price.currency,\n })\n : '';\n const totalText = alacarteLine?.amountDue\n ? formatMessage(messages.todaysTotalValue, {\n amount: alacarteLine.amountDue.amount.toFixed(2), currency: alacarteLine.amountDue.currency,\n })\n : '';\n\n const lineName = alacarteLine\n ? (alacarteLine.kind === 'course' ? alacarteLine.courseName : alacarteLine.programName)\n : programNameProp;\n\n const ownedCourses = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.ownedCourses ?? [])\n : [];\n const ownedCourseNames = ownedCourses\n .map((c) => c.name)\n .filter(Boolean)\n .join(', ');\n const discount = alacarteLine?.discount ?? null;\n\n return (\n <div className=\"cart-summary \">\n <Card className=\"cart-summary__card p-3\">\n <Card.Section className=\"d-flex justify-content-between align-items-center p-0 pb-3\">\n <h2 className=\"cart-summary__heading font-weight-bold text-gray-900 mb-0\">\n {formatMessage(messages.summaryHeading)}\n </h2>\n <Badge\n variant=\"light\"\n className=\"d-flex align-items-center px-2 py-1\"\n >\n <Icon\n src={Group}\n className=\"mr-1\"\n style={{ width: '1rem', height: '1rem' }}\n />\n {subscriberCount == null ? (\n <span\n className=\"cart-summary__count-skeleton\"\n aria-busy=\"true\"\n aria-label={formatMessage(messages.loadingSubscribers)}\n data-testid=\"subscriber-count-skeleton\"\n >\n <Skeleton width={96} height={12} />\n </span>\n ) : (\n formatMessage(messages.learnersSubscribed, {\n count: subscriberCount.toLocaleString(),\n })\n )}\n </Badge>\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"p-0 py-3\">\n {course ? (\n <CourseEnrollmentCard course={course} variant=\"summary\" />\n ) : programDetail ? (\n <ProgramEnrollmentCard\n program={programDetail}\n programName={lineName ?? ''}\n ownedCourses={ownedCourses}\n />\n ) : lineName ? (\n <p className=\"font-weight-bold mb-0 text-primary-500\">{lineName}</p>\n ) : (\n <div className=\"d-flex align-items-start\">\n <EdxUnlimitedLogo ariaLabel=\"edX Plus\" />\n <div>\n <p className=\"font-weight-bold mb-0 text-primary-500\">{title}</p>\n <p className=\"small mb-0 text-gray-900\">{blurb}</p>\n </div>\n </div>\n )}\n {/* Fallback when catalog detail hasn't loaded yet — once it has,\n owned courses are listed under \"Previously purchased\" in the card. */}\n {!programDetail && ownedCourseNames && (\n <p\n className=\"cart-summary__already-yours small text-gray-700 mb-0 mt-2\"\n data-testid=\"already-yours\"\n >\n {formatMessage(messages.alreadyYours, { names: ownedCourseNames })}\n </p>\n )}\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"cart-summary__subtotal-row d-flex justify-content-between align-items-center p-0 pt-3\">\n <span className=\"cart-summary__subtotal text-gray-900\">\n {formatMessage(messages.subtotal)}\n </span>\n <span className=\"cart-summary__subtotal text-gray-900\">\n {subtotalText}\n </span>\n </Card.Section>\n\n {discount && (\n <Card.Section\n className=\"d-flex justify-content-between align-items-center p-0\"\n data-testid=\"discount-row\"\n >\n <span className=\"text-success font-weight-bold\">\n {formatMessage(messages.discountApplied)}\n </span>\n <span className=\"text-success font-weight-bold\">\n {formatMessage(messages.discountAmount, {\n amount: discount.amount.toFixed(2),\n currency: discount.currency,\n })}\n </span>\n </Card.Section>\n )}\n\n <Card.Section className=\"d-flex justify-content-between align-items-center p-0\">\n <span className=\"cart-summary__total-label text-gray-900\">\n {formatMessage(messages.todaysTotal)}\n </span>\n <span className=\"cart-summary__total-value mb-0 text-gray-900\">\n {totalText}\n </span>\n </Card.Section>\n </Card>\n\n {promoCode ? <PromoCode {...promoCode} /> : null}\n\n {/* Stats row */}\n <div className=\"cart-summary__stats d-none d-lg-flex\">\n <div className=\"cart-summary__stat d-flex align-items-center mr-4\">\n <img src={learnersIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-500 mb-0\">\n {formatMessage(messages.learnersCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-500 mb-0\">\n {formatMessage(messages.learnersLabel)}\n </p>\n </div>\n </div>\n <div className=\"cart-summary__stat d-flex align-items-center\">\n <img src={institutionsIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-500 mb-0\">\n {formatMessage(messages.institutionsCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-500 mb-0\">\n {formatMessage(messages.institutionsLabel)}\n </p>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default CartSummary;\n"]}
1
+ {"version":3,"file":"CartSummary.js","sourceRoot":"","sources":["../../../src/components/CartSummary/CartSummary.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,C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,IACF,IACA,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React from 'react';\nimport { Badge, Card, Icon, Skeleton } from '@openedx/paragon';\nimport { Group } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { EdxUnlimitedLogo } from '../BrandMarks/BrandMarks';\nimport CourseEnrollmentCard from '../CourseEnrollmentCard/CourseEnrollmentCard';\nimport ProgramEnrollmentCard from '../ProgramEnrollmentCard/ProgramEnrollmentCard';\nimport PromoCode from '../PromoCode/PromoCode';\nimport type { PromoCodeProps } from '../PromoCode/PromoCode';\nimport type { CourseDetail } from '../../types';\nimport type { AlacarteLine, ProgramDetail } from '../../types/alacarte';\nimport messages from './Messages';\nimport learnersIcon from './world-icon.svg';\nimport institutionsIcon from './student-icon.svg';\n\nexport type BillingCycle = 'monthly' | 'annual';\n\nexport interface CartSummaryProps {\n productTitle?: string,\n productBlurb?: string,\n /** Promotional monthly price amount e.g. \"39\" */\n monthlyAmount?: string,\n /** Regular monthly price after the promo period e.g. \"59\" */\n monthlyRegularAmount?: string,\n /** Length of the promotional period in months */\n promoMonths?: number,\n /** Annual price amount e.g. \"299\" */\n annualAmount?: string,\n currency?: string,\n defaultCycle?: BillingCycle,\n monthlyRenewalLabel?: string,\n annualRenewalLabel?: string,\n /** Called when the learner switches monthly ↔ annual. */\n onCycleChange?: (cycle: BillingCycle) => void,\n learnerCount?: number,\n /** When set, shows the course enrollment preview card below the summary card. */\n course?: CourseDetail | null,\n /** À la carte checkout line — when present, drives the subtotal/total and\n * the product name shown, in place of the generic edX Plus placeholder. */\n alacarteLine?: AlacarteLine | null,\n /** Program catalog detail (filterTwouProgram) — when present, drives the\n * \"Courses included in this program\" list. */\n programDetail?: ProgramDetail | null,\n /** Fallback program name — used when there is no alacarteLine to provide it\n * (e.g. already-owned overlay). */\n programName?: string | null,\n /** Coupon input — when set, wires PromoCode to tCheckoutUpdate. */\n promoCode?: PromoCodeProps | null,\n}\n\nconst CartSummary = ({\n productTitle,\n productBlurb,\n learnerCount: learnerCountProp,\n course = null,\n alacarteLine = null,\n programDetail = null,\n programName: programNameProp = null,\n promoCode = null,\n}: CartSummaryProps) => {\n const { formatMessage } = useIntl();\n const title = productTitle ?? formatMessage(messages.productTitle);\n const blurb = productBlurb ?? formatMessage(messages.productBlurb);\n\n // Prefer the product's own enrollment count (course or program catalog field).\n const isProgramLine = alacarteLine?.kind === 'program';\n const subscriberCount = course?.tEnrollmentCount\n ?? programDetail?.tEnrollmentCount\n ?? learnerCountProp\n ?? null;\n\n // No fallback amount — an unresolved à la carte line means we don't know\n // the price yet, so the row is left blank rather than showing a made-up\n // number that could be mistaken for the real one.\n // Program subtotal is price less owned-course deduction (before coupon/discount).\n const deductionAmount = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.deduction?.amount ?? 0)\n : 0;\n const subtotalAmount = alacarteLine?.price\n ? Math.max(0, alacarteLine.price.amount - deductionAmount)\n : null;\n const subtotalText = subtotalAmount != null && alacarteLine?.price\n ? formatMessage(messages.subtotalAmount, {\n amount: subtotalAmount.toFixed(2), currency: alacarteLine.price.currency,\n })\n : '';\n const totalText = alacarteLine?.amountDue\n ? formatMessage(messages.todaysTotalValue, {\n amount: alacarteLine.amountDue.amount.toFixed(2), currency: alacarteLine.amountDue.currency,\n })\n : '';\n\n const lineName = alacarteLine\n ? (alacarteLine.kind === 'course' ? alacarteLine.courseName : alacarteLine.programName)\n : programNameProp;\n\n const ownedCourses = isProgramLine && alacarteLine.kind === 'program'\n ? (alacarteLine.ownedCourses ?? [])\n : [];\n const ownedCourseNames = ownedCourses\n .map((c) => c.name)\n .filter(Boolean)\n .join(', ');\n const discount = alacarteLine?.discount ?? null;\n\n return (\n <aside className=\"cart-summary\" aria-labelledby=\"cart-summary-heading\">\n <Card className=\"cart-summary__card p-3\">\n <Card.Section className=\"d-flex justify-content-between align-items-center p-0 pb-3\">\n <h2 id=\"cart-summary-heading\" className=\"cart-summary__heading font-weight-bold text-gray-900 mb-0\">\n {formatMessage(messages.summaryHeading)}\n </h2>\n <Badge\n variant=\"light\"\n className=\"d-flex align-items-center px-2 py-1\"\n >\n <Icon\n src={Group}\n className=\"mr-1\"\n style={{ width: '1rem', height: '1rem' }}\n />\n {subscriberCount == null ? (\n <span\n className=\"cart-summary__count-skeleton\"\n aria-busy=\"true\"\n aria-label={formatMessage(messages.loadingSubscribers)}\n data-testid=\"subscriber-count-skeleton\"\n >\n <Skeleton width={96} height={12} />\n </span>\n ) : (\n formatMessage(messages.learnersSubscribed, {\n count: subscriberCount.toLocaleString(),\n })\n )}\n </Badge>\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"p-0 py-3\">\n {course ? (\n <CourseEnrollmentCard course={course} variant=\"summary\" />\n ) : programDetail ? (\n <ProgramEnrollmentCard\n program={programDetail}\n programName={lineName ?? ''}\n ownedCourses={ownedCourses}\n />\n ) : lineName ? (\n <p className=\"font-weight-bold mb-0 text-primary-500\">{lineName}</p>\n ) : (\n <div className=\"d-flex align-items-start\">\n <EdxUnlimitedLogo ariaLabel=\"edX Plus\" />\n <div>\n <p className=\"font-weight-bold mb-0 text-primary-500\">{title}</p>\n <p className=\"small mb-0 text-gray-900\">{blurb}</p>\n </div>\n </div>\n )}\n {/* Fallback when catalog detail hasn't loaded yet — once it has,\n owned courses are listed under \"Previously purchased\" in the card. */}\n {!programDetail && ownedCourseNames && (\n <p\n className=\"cart-summary__already-yours small text-gray-700 mb-0 mt-2\"\n data-testid=\"already-yours\"\n >\n {formatMessage(messages.alreadyYours, { names: ownedCourseNames })}\n </p>\n )}\n </Card.Section>\n\n <Card.Divider />\n\n <Card.Section className=\"cart-summary__subtotal-row d-flex justify-content-between align-items-center p-0 pt-3\">\n <span className=\"cart-summary__subtotal text-gray-900\">\n {formatMessage(messages.subtotal)}\n </span>\n <span className=\"cart-summary__subtotal text-gray-900\">\n {subtotalText}\n </span>\n </Card.Section>\n\n {discount && (\n <Card.Section\n className=\"d-flex justify-content-between align-items-center p-0\"\n data-testid=\"discount-row\"\n >\n <span className=\"text-success font-weight-bold\">\n {formatMessage(messages.discountApplied)}\n </span>\n <span className=\"text-success font-weight-bold\">\n {formatMessage(messages.discountAmount, {\n amount: discount.amount.toFixed(2),\n currency: discount.currency,\n })}\n </span>\n </Card.Section>\n )}\n\n <Card.Section className=\"p-0\">\n {/* Announces the new total when a coupon is applied or removed. */}\n <div\n className=\"d-flex justify-content-between align-items-center\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-testid=\"todays-total\"\n >\n <span className=\"cart-summary__total-label text-gray-900\">\n {formatMessage(messages.todaysTotal)}\n </span>\n <span className=\"cart-summary__total-value mb-0 text-gray-900\">\n {totalText}\n </span>\n </div>\n </Card.Section>\n </Card>\n\n {promoCode ? <PromoCode {...promoCode} /> : null}\n\n {/* Stats row */}\n <div className=\"cart-summary__stats d-none d-lg-flex\">\n <div className=\"cart-summary__stat d-flex align-items-center mr-4\">\n <img src={learnersIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-500 mb-0\">\n {formatMessage(messages.learnersCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-500 mb-0\">\n {formatMessage(messages.learnersLabel)}\n </p>\n </div>\n </div>\n <div className=\"cart-summary__stat d-flex align-items-center\">\n <img src={institutionsIcon} alt=\"\" width={50} height={50} className=\"mr-2\" />\n <div>\n <p className=\"cart-summary__stat-count font-weight-bold text-gray-500 mb-0\">\n {formatMessage(messages.institutionsCount)}\n </p>\n <p className=\"cart-summary__stat-label text-gray-500 mb-0\">\n {formatMessage(messages.institutionsLabel)}\n </p>\n </div>\n </div>\n </div>\n </aside>\n );\n};\n\nexport default CartSummary;\n"]}
@@ -228,13 +228,13 @@ const Checkout = (_a) => {
228
228
  amount: alacarte.line.amountDue.amount.toFixed(2),
229
229
  currency: alacarte.line.amountDue.currency,
230
230
  }) })), showForm && (_jsxs(_Fragment, { children: [showValidationBanner && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, className: "mb-3", children: formatMessage(messages.validationBanner) })), c.phase === 'failed' && (_jsx(Alert, { variant: "danger", icon: ErrorIcon, className: "mb-3", children: failedMessage
231
- || formatMessage(messages.paymentProcessingDescription) })), appliedCouponCode && appliedDiscount && dismissedCouponAlert !== appliedCouponCode && (_jsxs(Alert, { variant: "success", icon: CheckCircle, dismissible: true, closeLabel: formatMessage(messages.dismiss), onClose: () => setDismissedCouponAlert(appliedCouponCode), className: "coupon-applied-alert", "data-testid": "coupon-applied-alert", children: [_jsx("span", { "aria-hidden": "true", children: "\uD83C\uDF89 " }), formatMessage(messages.couponAppliedAlert)] })), alacarte.removedCouponCode && (() => {
231
+ || formatMessage(messages.paymentProcessingDescription) })), appliedCouponCode && appliedDiscount && dismissedCouponAlert !== appliedCouponCode && (_jsxs(Alert, { variant: "success", icon: CheckCircle, dismissible: true, closeLabel: formatMessage(messages.dismiss), onClose: () => setDismissedCouponAlert(appliedCouponCode), className: "coupon-applied-alert", "data-testid": "coupon-applied-alert", role: "status", children: [_jsx("span", { "aria-hidden": "true", children: "\uD83C\uDF89 " }), formatMessage(messages.couponAppliedAlert)] })), alacarte.removedCouponCode && (() => {
232
232
  const removedCode = alacarte.removedCouponCode;
233
233
  const removedText = formatMessage(messages.couponRemovedAlert, { code: removedCode });
234
234
  // Bold the interpolated code without baking markup into the
235
235
  // translation string — find it in the formatted sentence.
236
236
  const codeIndex = removedText.indexOf(removedCode);
237
- return (_jsx(Alert, { variant: "success", icon: CheckCircle, dismissible: true, closeLabel: formatMessage(messages.dismiss), onClose: alacarte.clearRemovedCouponCode, className: "coupon-removed-alert", "data-testid": "coupon-removed-alert", children: codeIndex === -1 ? removedText : (_jsxs(_Fragment, { children: [removedText.slice(0, codeIndex), _jsx("strong", { children: removedCode }), removedText.slice(codeIndex + removedCode.length)] })) }));
237
+ return (_jsx(Alert, { variant: "success", icon: CheckCircle, dismissible: true, closeLabel: formatMessage(messages.dismiss), onClose: alacarte.clearRemovedCouponCode, className: "coupon-removed-alert", "data-testid": "coupon-removed-alert", role: "status", children: codeIndex === -1 ? removedText : (_jsxs(_Fragment, { children: [removedText.slice(0, codeIndex), _jsx("strong", { children: removedCode }), removedText.slice(codeIndex + removedCode.length)] })) }));
238
238
  })(), _jsx(PaymentForm, { billing: c.billing, setField: c.setField, numberMountRef: c.numberMountRef, expiryMountRef: c.expiryMountRef, cvcMountRef: c.cvcMountRef, cardError: c.cardError, cardFieldStates: c.cardFieldStates, stripeReady: c.stripeReady, sessionReady: c.sessionReady, submitting: isAlacarteReady
239
239
  ? (alacarte.placingOrder || alacarte.awaitingPlacedOrder)
240
240
  : c.processingSubscription, onPlaceOrder: isAlacarteReady