summit-registration-lite 4.0.21 → 4.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -356,7 +356,7 @@ module.exports = require("react");
356
356
  /***/ ((module) => {
357
357
 
358
358
  "use strict";
359
- module.exports = JSON.parse('{"purchase_complete_step":{"title":" Your order is complete","initial_order_complete_1st_paragraph_label":"A ticket has been assigned to you. To complete your additional ticket details, please click the \\"{button}\\" button.","initial_order_complete_button":"Finish Now","order_complete_1st_paragraph_label":"You may visit the \\"My Orders/Tickets\\" tab in the top right-hand corner of the navigation bar to\\n assign/reassign tickets or to complete any required ticket details.","order_complete_button":"View MyOrders/Tickets","access_event_button":"Access Event Now","initial_order_footer_label":"If you wish to transfer your assigned ticket, close this window and visit the \\"My Orders/Tickets\\" tab in the top navigation bar. ","footer_assistance_text":"For further assistance, please email <a href=\\"mailto:{supportEmail}\\">{supportEmail}</a>","event_will_start_text":"The event will start on {date} at {time} {time_zone_label}"}}');
359
+ module.exports = JSON.parse('{"purchase_complete_step":{"title":" Your order is complete","initial_order_complete_1st_paragraph_label":"A ticket has been assigned to you. To complete your additional ticket details, please click the \\"{button}\\" button.","initial_order_complete_button":"Finish Now","order_complete_1st_paragraph_label":"You may visit the \\"My Orders/Tickets\\" tab in the top right-hand corner of the navigation bar to\\n assign/reassign tickets or to complete any required ticket details.","order_complete_button":"View My Orders/Tickets","access_event_button":"Access Event Now","initial_order_footer_label":"If you wish to transfer your assigned ticket, close this window and visit the \\"My Orders/Tickets\\" tab in the top navigation bar. ","footer_assistance_text":"For further assistance, please email <a href=\\"mailto:{supportEmail}\\">{supportEmail}</a>","event_will_start_text":"The event will start on {date} at {time} {time_zone_label}"}}');
360
360
 
361
361
  /***/ })
362
362
 
@@ -480,6 +480,8 @@ class LawPayProvider {
480
480
  _defineProperty(this, "payTicket", ({
481
481
  token = null
482
482
  }) => async dispatch => {
483
+ var _this$userProfile, _this$userProfile2, _this$userProfile3, _this$userProfile4, _this$userProfile5, _this$userProfile6;
484
+
483
485
  // Pay using affinity lawpay
484
486
  const errorHandler = (err, res) => (dispatch, state) => {
485
487
  let code = err.status;
@@ -510,12 +512,12 @@ class LawPayProvider {
510
512
  expand: 'tickets,' + 'tickets.owner,' + 'tickets.owner.extra_questions,' + 'tickets.badge,' + 'tickets.badge.type,' + 'tickets.badge.type.access_levels,' + 'tickets.badge.type.features,' + 'tickets.ticket_type,' + 'tickets.ticket_type.taxes'
511
513
  };
512
514
  let normalizedEntity = {
513
- billing_address_1: token ? token.address1 : this.userProfile?.address1 || '',
514
- billing_address_2: this.userProfile?.address2 || '',
515
- billing_address_zip_code: token ? token.postal_code : this.userProfile?.postal_code || '',
516
- billing_address_city: this.userProfile?.locality || '',
517
- billing_address_state: this.userProfile?.region || '',
518
- billing_address_country: this.userProfile?.country || ''
515
+ billing_address_1: token ? token.address1 : ((_this$userProfile = this.userProfile) === null || _this$userProfile === void 0 ? void 0 : _this$userProfile.address1) || '',
516
+ billing_address_2: ((_this$userProfile2 = this.userProfile) === null || _this$userProfile2 === void 0 ? void 0 : _this$userProfile2.address2) || '',
517
+ billing_address_zip_code: token ? token.postal_code : ((_this$userProfile3 = this.userProfile) === null || _this$userProfile3 === void 0 ? void 0 : _this$userProfile3.postal_code) || '',
518
+ billing_address_city: ((_this$userProfile4 = this.userProfile) === null || _this$userProfile4 === void 0 ? void 0 : _this$userProfile4.locality) || '',
519
+ billing_address_state: ((_this$userProfile5 = this.userProfile) === null || _this$userProfile5 === void 0 ? void 0 : _this$userProfile5.region) || '',
520
+ billing_address_country: ((_this$userProfile6 = this.userProfile) === null || _this$userProfile6 === void 0 ? void 0 : _this$userProfile6.country) || ''
519
521
  };
520
522
 
521
523
  if (token) {
@@ -567,6 +569,8 @@ class StripeProvider {
567
569
  stripe = null,
568
570
  zipCode = null
569
571
  }) => async dispatch => {
572
+ var _this$userProfile, _this$userProfile2, _this$userProfile3, _this$userProfile4, _this$userProfile5;
573
+
570
574
  const errorHandler = (err, res) => (dispatch, state) => {
571
575
  let code = err.status;
572
576
 
@@ -596,12 +600,12 @@ class StripeProvider {
596
600
  expand: 'tickets,' + 'tickets.owner,' + 'tickets.owner.extra_questions,' + 'tickets.badge,' + 'tickets.badge.type,' + 'tickets.badge.type.access_levels,' + 'tickets.badge.type.features,' + 'tickets.ticket_type,' + 'tickets.ticket_type.taxes'
597
601
  };
598
602
  let normalizedEntity = {
599
- billing_address_1: this.userProfile?.address1 || '',
600
- billing_address_2: this.userProfile?.address2 || '',
603
+ billing_address_1: ((_this$userProfile = this.userProfile) === null || _this$userProfile === void 0 ? void 0 : _this$userProfile.address1) || '',
604
+ billing_address_2: ((_this$userProfile2 = this.userProfile) === null || _this$userProfile2 === void 0 ? void 0 : _this$userProfile2.address2) || '',
601
605
  billing_address_zip_code: zipCode,
602
- billing_address_city: this.userProfile?.locality || '',
603
- billing_address_state: this.userProfile?.region || '',
604
- billing_address_country: this.userProfile?.country || ''
606
+ billing_address_city: ((_this$userProfile3 = this.userProfile) === null || _this$userProfile3 === void 0 ? void 0 : _this$userProfile3.locality) || '',
607
+ billing_address_state: ((_this$userProfile4 = this.userProfile) === null || _this$userProfile4 === void 0 ? void 0 : _this$userProfile4.region) || '',
608
+ billing_address_country: ((_this$userProfile5 = this.userProfile) === null || _this$userProfile5 === void 0 ? void 0 : _this$userProfile5.country) || ''
605
609
  };
606
610
  dispatch(startWidgetLoading());
607
611
 
@@ -1843,7 +1847,7 @@ const StripeForm = ({
1843
1847
  color: '#3486cd'
1844
1848
  }
1845
1849
  }
1846
- }, stripeOptions?.style);
1850
+ }, stripeOptions === null || stripeOptions === void 0 ? void 0 : stripeOptions.style);
1847
1851
 
1848
1852
  const onSubmit = async data => {
1849
1853
  setStripeErrors({});
@@ -1977,7 +1981,7 @@ const stripe_component_StripeProvider = ({
1977
1981
  }) => {
1978
1982
  const stripePromise = (0,external_react_.useMemo)(() => (0,stripe_js_namespaceObject.loadStripe)(providerKey), [providerKey]);
1979
1983
  const options = {
1980
- fonts: stripeOptions?.fonts
1984
+ fonts: stripeOptions === null || stripeOptions === void 0 ? void 0 : stripeOptions.fonts
1981
1985
  };
1982
1986
  return /*#__PURE__*/external_react_default().createElement(react_stripe_js_namespaceObject.Elements, {
1983
1987
  options: options,
@@ -2140,6 +2144,8 @@ const PersonalInfoComponent = ({
2140
2144
  showCompanyInput = true,
2141
2145
  companyDDLPlaceholder
2142
2146
  }) => {
2147
+ var _errors$email, _errors$email2;
2148
+
2143
2149
  const [personalInfo, setPersonalInfo] = (0,external_react_.useState)({
2144
2150
  firstName: userProfile.given_name || (invitation ? invitation.first_name : ''),
2145
2151
  lastName: userProfile.family_name || (invitation ? invitation.last_name : ''),
@@ -2283,10 +2289,10 @@ const PersonalInfoComponent = ({
2283
2289
  pattern: /^\S+@\S+$/i
2284
2290
  }), {
2285
2291
  "data-testid": "email"
2286
- }))), errors.email?.type === 'required' && /*#__PURE__*/external_react_default().createElement("div", {
2292
+ }))), ((_errors$email = errors.email) === null || _errors$email === void 0 ? void 0 : _errors$email.type) === 'required' && /*#__PURE__*/external_react_default().createElement("div", {
2287
2293
  className: personal_information_index_module.fieldError,
2288
2294
  "data-testid": "email-error-required"
2289
- }, "This field is required."), errors.email?.type === 'pattern' && /*#__PURE__*/external_react_default().createElement("div", {
2295
+ }, "This field is required."), ((_errors$email2 = errors.email) === null || _errors$email2 === void 0 ? void 0 : _errors$email2.type) === 'pattern' && /*#__PURE__*/external_react_default().createElement("div", {
2290
2296
  className: personal_information_index_module.fieldError,
2291
2297
  "data-testid": "email-error-invalid"
2292
2298
  }, "The email is invalid.")), showCompanyInput && /*#__PURE__*/external_react_default().createElement("div", {
@@ -2493,7 +2499,9 @@ const TicketTypeComponent = ({
2493
2499
  }
2494
2500
  });
2495
2501
  (0,external_react_.useEffect)(() => {
2496
- if (reservation && reservation.tickets?.length > 0) {
2502
+ var _reservation$tickets;
2503
+
2504
+ if (reservation && ((_reservation$tickets = reservation.tickets) === null || _reservation$tickets === void 0 ? void 0 : _reservation$tickets.length) > 0) {
2497
2505
  setTicket(ticketTypes.find(t => t.id === reservation.tickets[0].ticket_type_id));
2498
2506
  }
2499
2507
  }, []);
@@ -2523,7 +2531,7 @@ const TicketTypeComponent = ({
2523
2531
  className: ticket_type_index_module.summary
2524
2532
  }, /*#__PURE__*/external_react_default().createElement("span", null, ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, `${ticket.name} (${quantity}): ${formatCurrency(ticket.cost * quantity, {
2525
2533
  currency: ticket.currency
2526
- })} ${ticket.currency}`, !isActive && reservation?.discount_amount > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
2534
+ })} ${ticket.currency}`, !isActive && (reservation === null || reservation === void 0 ? void 0 : reservation.discount_amount) > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
2527
2535
  className: ticket_type_index_module.promoCode
2528
2536
  }, "Promo code\xA0", /*#__PURE__*/external_react_default().createElement("abbr", {
2529
2537
  title: reservation.promo_code
@@ -2533,7 +2541,7 @@ const TicketTypeComponent = ({
2533
2541
  currency: ticket.currency
2534
2542
  })} ${ticket.currency}`)), !isActive && reservation && /*#__PURE__*/external_react_default().createElement("span", {
2535
2543
  className: ticket_type_index_module.promo
2536
- }, "Subtotal: ", `${ticket?.currency_symbol} ${((reservation?.raw_amount_in_cents - reservation?.discount_amount_in_cents) / 100).toFixed(2)} ${ticket?.currency}`), !isActive && reservation?.taxes_amount > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, reservation?.applied_taxes.map(tax => {
2544
+ }, "Subtotal: ", `${ticket === null || ticket === void 0 ? void 0 : ticket.currency_symbol} ${(((reservation === null || reservation === void 0 ? void 0 : reservation.raw_amount_in_cents) - (reservation === null || reservation === void 0 ? void 0 : reservation.discount_amount_in_cents)) / 100).toFixed(2)} ${ticket === null || ticket === void 0 ? void 0 : ticket.currency}`), !isActive && (reservation === null || reservation === void 0 ? void 0 : reservation.taxes_amount) > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, reservation === null || reservation === void 0 ? void 0 : reservation.applied_taxes.map(tax => {
2537
2545
  return /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, {
2538
2546
  key: tax.id
2539
2547
  }, /*#__PURE__*/external_react_default().createElement("span", {
@@ -2655,11 +2663,11 @@ const ButtonBarComponent = ({
2655
2663
  disabled: !ticketType,
2656
2664
  className: `${button_bar_index_module.button} button`,
2657
2665
  onClick: () => changeStep(step + 1)
2658
- }, nextButtonText), step === 1 && ticketType?.cost === 0 && /*#__PURE__*/external_react_default().createElement("button", {
2666
+ }, nextButtonText), step === 1 && (ticketType === null || ticketType === void 0 ? void 0 : ticketType.cost) === 0 && /*#__PURE__*/external_react_default().createElement("button", {
2659
2667
  className: `${button_bar_index_module.button} button`,
2660
2668
  type: "submit",
2661
2669
  form: "personal-info-form"
2662
- }, "Get Ticket"), step === 1 && ticketType?.cost > 0 && /*#__PURE__*/external_react_default().createElement("button", {
2670
+ }, "Get Ticket"), step === 1 && (ticketType === null || ticketType === void 0 ? void 0 : ticketType.cost) > 0 && /*#__PURE__*/external_react_default().createElement("button", {
2663
2671
  className: `${button_bar_index_module.button} button`,
2664
2672
  type: "submit",
2665
2673
  form: "personal-info-form"
@@ -2703,8 +2711,10 @@ const getCurrentProvider = summit => {
2703
2711
  };
2704
2712
  };
2705
2713
  const ticketHasAccessLevel = (ticket, accessLevel) => {
2714
+ var _ticket$badge, _ticket$badge$type;
2715
+
2706
2716
  if (!ticket) return false;
2707
- return ticket.badge?.type?.access_levels.map(al => al.name).includes(accessLevel);
2717
+ return (_ticket$badge = ticket.badge) === null || _ticket$badge === void 0 ? void 0 : (_ticket$badge$type = _ticket$badge.type) === null || _ticket$badge$type === void 0 ? void 0 : _ticket$badge$type.access_levels.map(al => al.name).includes(accessLevel);
2708
2718
  };
2709
2719
  const getCurrentUserLanguage = () => {
2710
2720
  let language = 'en';
@@ -2806,7 +2816,11 @@ const PurchaseComplete = _ref2 => {
2806
2816
  onPurchaseComplete(checkout);
2807
2817
  }, []);
2808
2818
  const isActive = (0,external_react_.useMemo)(() => summit.start_date <= nowUtc && summit.end_date >= nowUtc, [summit, nowUtc]);
2809
- const currentUserTicket = (0,external_react_.useMemo)(() => checkout?.tickets.find(t => t?.owner?.email == user?.email), [user]);
2819
+ const currentUserTicket = (0,external_react_.useMemo)(() => checkout === null || checkout === void 0 ? void 0 : checkout.tickets.find(t => {
2820
+ var _t$owner;
2821
+
2822
+ return (t === null || t === void 0 ? void 0 : (_t$owner = t.owner) === null || _t$owner === void 0 ? void 0 : _t$owner.email) == (user === null || user === void 0 ? void 0 : user.email);
2823
+ }), [user]);
2810
2824
  const requireExtraQuestions = (0,external_react_.useMemo)(() => completedExtraQuestions(checkout), [user]);
2811
2825
 
2812
2826
  const _hasVirtualAccessLevel = hasVirtualAccessLevel || currentUserTicket && ticketHasAccessLevel(currentUserTicket, VirtualAccessLevel);
@@ -3032,6 +3046,8 @@ try {
3032
3046
  }
3033
3047
 
3034
3048
  const RegistrationLite = _ref => {
3049
+ var _formValues$ticketTyp, _formValues$ticketTyp2;
3050
+
3035
3051
  let {
3036
3052
  loadSession,
3037
3053
  setMarketingSettings,
@@ -3140,8 +3156,10 @@ const RegistrationLite = _ref => {
3140
3156
  }
3141
3157
  }, [summitData, profileData]);
3142
3158
  (0,external_react_.useEffect)(() => {
3159
+ var _registrationForm$val;
3160
+
3143
3161
  // check if there's personal information data and no ticket data to reset widget
3144
- if (step > 0 && !registrationForm.values?.ticketType) {
3162
+ if (step > 0 && !((_registrationForm$val = registrationForm.values) !== null && _registrationForm$val !== void 0 && _registrationForm$val.ticketType)) {
3145
3163
  changeStep(0);
3146
3164
  }
3147
3165
  }, [registrationForm.values, step]);
@@ -3156,8 +3174,8 @@ const RegistrationLite = _ref => {
3156
3174
  bounce: 0
3157
3175
  }, external_react_spring_namespaceObject.config.stiff),
3158
3176
  to: {
3159
- opacity: formValues?.ticketType?.cost === 0 ? 0 : 1,
3160
- height: formValues?.ticketType?.cost === 0 ? 0 : height
3177
+ opacity: (formValues === null || formValues === void 0 ? void 0 : (_formValues$ticketTyp = formValues.ticketType) === null || _formValues$ticketTyp === void 0 ? void 0 : _formValues$ticketTyp.cost) === 0 ? 0 : 1,
3178
+ height: (formValues === null || formValues === void 0 ? void 0 : (_formValues$ticketTyp2 = formValues.ticketType) === null || _formValues$ticketTyp2 === void 0 ? void 0 : _formValues$ticketTyp2.cost) === 0 ? 0 : height
3161
3179
  }
3162
3180
  });
3163
3181
 
@@ -3231,7 +3249,7 @@ const RegistrationLite = _ref => {
3231
3249
  onClick: handleCloseClick
3232
3250
  })), ticketTaxesError && profileData && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
3233
3251
  ticketTaxesErrorMessage: ticketTaxesErrorMessage,
3234
- retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData?.id)
3252
+ retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData === null || summitData === void 0 ? void 0 : summitData.id)
3235
3253
  }), !ticketTaxesError && profileData && allowedTicketTypes.length === 0 && requestedTicketTypes && step !== 3 && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
3236
3254
  noAllowedTicketsMessage: noAllowedTicketsMessage
3237
3255
  }), !ticketTaxesError && /*#__PURE__*/external_react_default().createElement("div", {
@@ -3270,14 +3288,16 @@ const RegistrationLite = _ref => {
3270
3288
  invitation: invitation,
3271
3289
  summitId: summitData.id,
3272
3290
  changeForm: personalInformation => {
3291
+ var _registrationForm$val2, _registrationForm$val3;
3292
+
3273
3293
  setFormValues(registration_lite_objectSpread(registration_lite_objectSpread({}, registrationForm.values), {}, {
3274
3294
  personalInformation
3275
3295
  }));
3276
3296
  reserveTicket({
3277
3297
  provider,
3278
3298
  personalInformation: personalInformation,
3279
- ticket: registrationForm.values?.ticketType,
3280
- ticketQuantity: registrationForm.values?.ticketQuantity
3299
+ ticket: (_registrationForm$val2 = registrationForm.values) === null || _registrationForm$val2 === void 0 ? void 0 : _registrationForm$val2.ticketType,
3300
+ ticketQuantity: (_registrationForm$val3 = registrationForm.values) === null || _registrationForm$val3 === void 0 ? void 0 : _registrationForm$val3.ticketQuantity
3281
3301
  }, {
3282
3302
  onError: (err, res) => setFormErrors(res.body.errors)
3283
3303
  }).catch(error => {