summit-registration-lite 5.0.18 → 5.0.19
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/components/login-passwordless.js +1 -1
- package/dist/components/login-passwordless.js.map +1 -1
- package/dist/components/login.css +1 -1
- package/dist/components/login.js +7 -5
- package/dist/components/login.js.map +1 -1
- package/dist/index.css +5 -3
- package/dist/index.js +554 -258
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -104,7 +104,7 @@ const PasswordlessLoginComponent = ({
|
|
|
104
104
|
src: logoLight || (FNid_WHT_logo_rgb_default()),
|
|
105
105
|
alt: "FNid",
|
|
106
106
|
className: `${index_module.logo} ${index_module.logoLight}`
|
|
107
|
-
}), /*#__PURE__*/external_react_default().createElement("span", null, "We sent your single-use
|
|
107
|
+
}), /*#__PURE__*/external_react_default().createElement("span", null, "We sent your single-use code to ", /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
108
108
|
"data-testid": "email"
|
|
109
109
|
}, email), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
110
110
|
className: index_module.digits,
|
|
@@ -185,7 +185,7 @@ const EmailRounded_namespaceObject = require("@mui/icons-material/EmailRounded")
|
|
|
185
185
|
var EmailRounded_default = /*#__PURE__*/__webpack_require__.n(EmailRounded_namespaceObject);
|
|
186
186
|
;// CONCATENATED MODULE: ./src/components/login/index.module.scss
|
|
187
187
|
// extracted by mini-css-extract-plugin
|
|
188
|
-
/* harmony default export */ const index_module = ({"loginWrapper":"loginWrapper___sxUEn","innerWrapper":"innerWrapper___GQRkq","button":"button___QMZPu","loginCode":"loginCode___dDBup","primaryEmailButton":"primaryEmailButton___gH1fC","buttonDisabled":"buttonDisabled___T9tkn","pointerDisabled":"pointerDisabled___qt_HK","email_login_button":"email_login_button___seiLi","h2Styled":"h2Styled___rfIKD","input":"input___QR9sA"});
|
|
188
|
+
/* harmony default export */ const index_module = ({"loginWrapper":"loginWrapper___sxUEn","innerWrapper":"innerWrapper___GQRkq","button":"button___QMZPu","title":"title___NnwWR","loginCode":"loginCode___dDBup","primaryEmailButton":"primaryEmailButton___gH1fC","buttonDisabled":"buttonDisabled___T9tkn","pointerDisabled":"pointerDisabled___qt_HK","email_login_button":"email_login_button___seiLi","h2Styled":"h2Styled___rfIKD","input":"input___QR9sA"});
|
|
189
189
|
;// CONCATENATED MODULE: ./src/components/login/index.js
|
|
190
190
|
/**
|
|
191
191
|
* Copyright 2020 OpenStack Foundation
|
|
@@ -233,7 +233,7 @@ const LoginComponent = ({
|
|
|
233
233
|
};
|
|
234
234
|
|
|
235
235
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
236
|
-
className: `${index_module.loginWrapper}
|
|
236
|
+
className: `${index_module.loginWrapper}`
|
|
237
237
|
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
238
238
|
className: `${index_module.innerWrapper}`
|
|
239
239
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
@@ -241,7 +241,9 @@ const LoginComponent = ({
|
|
|
241
241
|
}, summitData?.secondary_logo && /*#__PURE__*/external_react_default().createElement("img", {
|
|
242
242
|
className: "login-logo",
|
|
243
243
|
src: `${summitData?.secondary_logo}`
|
|
244
|
-
}),
|
|
244
|
+
}), /*#__PURE__*/external_react_default().createElement("div", {
|
|
245
|
+
class: index_module.title
|
|
246
|
+
}, title), /*#__PURE__*/external_react_default().createElement("div", {
|
|
245
247
|
className: index_module.input
|
|
246
248
|
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
247
249
|
placeholder: "youremail@example.com",
|
|
@@ -255,9 +257,9 @@ const LoginComponent = ({
|
|
|
255
257
|
className: `${index_module.button} ${index_module.email_login_button} ${email === '' ? `${index_module.pointerDisabled} ${index_module.buttonDisabled}` : `${index_module.primaryEmailButton}`}`
|
|
256
258
|
}, /*#__PURE__*/external_react_default().createElement((EmailRounded_default()), {
|
|
257
259
|
style: {
|
|
258
|
-
fontSize:
|
|
260
|
+
fontSize: "20px"
|
|
259
261
|
}
|
|
260
|
-
}), /*#__PURE__*/external_react_default().createElement("span", null, "Email me a
|
|
262
|
+
}), /*#__PURE__*/external_react_default().createElement("span", null, "Email me a single-use code"), /*#__PURE__*/external_react_default().createElement("span", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
261
263
|
"data-testid": "email-error"
|
|
262
264
|
}, "Please enter a valid email address"), /*#__PURE__*/external_react_default().createElement("h2", {
|
|
263
265
|
className: index_module.h2Styled
|
|
@@ -344,6 +346,13 @@ module.exports = "data:image/svg+xml,%3c!-- Generator: Adobe Illustrator 25.4.1,
|
|
|
344
346
|
|
|
345
347
|
/***/ }),
|
|
346
348
|
|
|
349
|
+
/***/ 60:
|
|
350
|
+
/***/ ((module) => {
|
|
351
|
+
|
|
352
|
+
module.exports = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M8.11475 2.60519C9.64837 2.25868 11.2529 2.41721 12.6891 3.05713C13.0978 3.23923 13.5767 3.05555 13.7588 2.64686C13.9409 2.23817 13.7572 1.75925 13.3485 1.57714C11.5932 0.795024 9.6321 0.601267 7.75767 1.02477C5.88325 1.44827 4.19593 2.46634 2.94738 3.92714C1.69883 5.38795 0.955938 7.21321 0.829498 9.13072C0.703058 11.0482 1.19985 12.9552 2.24577 14.5673C3.2917 16.1794 4.83072 17.4103 6.6333 18.0762C8.43589 18.7422 10.4055 18.8076 12.2483 18.2627C14.0911 17.7179 15.7084 16.5919 16.859 15.0528C18.0096 13.5137 18.6319 11.6438 18.633 9.72216V8.97638C18.633 8.52896 18.2703 8.16625 17.8228 8.16625C17.3754 8.16625 17.0127 8.52896 17.0127 8.97638V9.72123C17.0118 11.2935 16.5027 12.8234 15.5613 14.0827C14.6199 15.342 13.2966 16.2632 11.7889 16.709C10.2811 17.1548 8.66965 17.1012 7.19481 16.5564C5.71996 16.0115 4.46077 15.0045 3.60501 13.6855C2.74925 12.3665 2.34279 10.8062 2.44624 9.23733C2.54969 7.66846 3.15751 6.17506 4.17905 4.97986C5.2006 3.78465 6.58112 2.95169 8.11475 2.60519Z' fill='%2392CD76'/%3e %3cpath d='M18.396 3.81325C18.7122 3.49672 18.7119 2.98378 18.3954 2.66756C18.0789 2.35134 17.5659 2.3516 17.2497 2.66813L9.72129 10.2041L7.86404 8.34683C7.54767 8.03046 7.03472 8.03046 6.71835 8.34683C6.40197 8.66321 6.40197 9.17615 6.71835 9.49253L9.14873 11.9229C9.30071 12.0749 9.50685 12.1602 9.72178 12.1602C9.93671 12.1601 10.1428 12.0747 10.2947 11.9226L18.396 3.81325Z' fill='%2392CD76'/%3e %3c/svg%3e"
|
|
353
|
+
|
|
354
|
+
/***/ }),
|
|
355
|
+
|
|
347
356
|
/***/ 267:
|
|
348
357
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
349
358
|
|
|
@@ -583,6 +592,152 @@ class LawPayProvider {
|
|
|
583
592
|
}
|
|
584
593
|
|
|
585
594
|
}
|
|
595
|
+
;// CONCATENATED MODULE: ./src/helpers/formatCurrency.js
|
|
596
|
+
const _excluded = ["locale"];
|
|
597
|
+
|
|
598
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
599
|
+
|
|
600
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { formatCurrency_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
601
|
+
|
|
602
|
+
function formatCurrency_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
603
|
+
|
|
604
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
605
|
+
|
|
606
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
607
|
+
|
|
608
|
+
const formatCurrency = (value, _ref) => {
|
|
609
|
+
let {
|
|
610
|
+
locale = 'en-US'
|
|
611
|
+
} = _ref,
|
|
612
|
+
options = _objectWithoutProperties(_ref, _excluded);
|
|
613
|
+
|
|
614
|
+
const defaultOptions = {
|
|
615
|
+
currency: 'USD',
|
|
616
|
+
minimumFractionDigits: 2,
|
|
617
|
+
maximumFractionDigits: 2
|
|
618
|
+
};
|
|
619
|
+
const formatter = new Intl.NumberFormat(locale, _objectSpread(_objectSpread({
|
|
620
|
+
style: 'currency'
|
|
621
|
+
}, defaultOptions), options));
|
|
622
|
+
return formatter.format(value);
|
|
623
|
+
};
|
|
624
|
+
;// CONCATENATED MODULE: ./src/helpers/capitalizeFirstLetter.js
|
|
625
|
+
const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
626
|
+
;// CONCATENATED MODULE: ./src/helpers/formatErrorMessage.js
|
|
627
|
+
|
|
628
|
+
const formatErrorMessage = string => {
|
|
629
|
+
const errorMessage = capitalizeFirstLetter(string);
|
|
630
|
+
return `${errorMessage}${errorMessage.endsWith('.') ? '' : '.'}`;
|
|
631
|
+
};
|
|
632
|
+
;// CONCATENATED MODULE: ./src/helpers/getTicketMaxQuantity.js
|
|
633
|
+
|
|
634
|
+
const getTicketMaxQuantity = ticket => {
|
|
635
|
+
if (!ticket) return 0;
|
|
636
|
+
if (isPrePaidTicketType(ticket)) return 1;
|
|
637
|
+
return Math.min((ticket.quantity_2_sell || Number.MAX_SAFE_INTEGER) - ticket.quantity_sold, ticket.max_quantity_per_order || Number.MAX_SAFE_INTEGER);
|
|
638
|
+
};
|
|
639
|
+
;// CONCATENATED MODULE: ./src/helpers/index.js
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
;// CONCATENATED MODULE: ./src/utils/constants.js
|
|
645
|
+
/**
|
|
646
|
+
* Copyright 2022 OpenStack Foundation
|
|
647
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
648
|
+
* you may not use this file except in compliance with the License.
|
|
649
|
+
* You may obtain a copy of the License at
|
|
650
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
651
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
652
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
653
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
654
|
+
* See the License for the specific language governing permissions and
|
|
655
|
+
* limitations under the License.
|
|
656
|
+
**/
|
|
657
|
+
const AUTH_ERROR_MESSAGE = 'Missing Auth info';
|
|
658
|
+
const AUTH_ERROR_MISSING_REFRESH_TOKEN = "missing Refresh Token";
|
|
659
|
+
const AUTH_ERROR_REQUEST_FAILED = 'Request failed';
|
|
660
|
+
const VirtualAccessLevel = 'VIRTUAL';
|
|
661
|
+
const DefaultBGColor = '#000000';
|
|
662
|
+
const DefaultTextColor = '#FFFFFF';
|
|
663
|
+
const DefaultHintColor = 'rgb(58, 63, 65)';
|
|
664
|
+
const EMAIL_REGEXP = /(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
|
665
|
+
const TICKET_OWNER_MYSELF = 'myself';
|
|
666
|
+
const TICKET_OWNER_SOMEONE = 'someoneElse';
|
|
667
|
+
const TICKET_OWNER_UNASSIGNED = 'unassigned';
|
|
668
|
+
const TICKET_TYPE_SUBTYPE_PREPAID = 'PrePaid';
|
|
669
|
+
const ORDER_STATUS_PAID = 'Paid';
|
|
670
|
+
const ORDER_PAYMENT_METHOD_OFFLINE = 'Offline';
|
|
671
|
+
const STEP_SELECT_TICKET_TYPE = 0;
|
|
672
|
+
const STEP_PERSONAL_INFO = 1;
|
|
673
|
+
const STEP_PAYMENT = 2;
|
|
674
|
+
const STEP_COMPLETE = 3;
|
|
675
|
+
;// CONCATENATED MODULE: ./src/utils/utils.js
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Copyright 2022 OpenStack Foundation
|
|
681
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
682
|
+
* you may not use this file except in compliance with the License.
|
|
683
|
+
* You may obtain a copy of the License at
|
|
684
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
685
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
686
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
687
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
688
|
+
* See the License for the specific language governing permissions and
|
|
689
|
+
* limitations under the License.
|
|
690
|
+
**/
|
|
691
|
+
|
|
692
|
+
const getCurrentProvider = summit => {
|
|
693
|
+
for (let profile of summit.payment_profiles) {
|
|
694
|
+
if (profile.application_type === 'Registration') {
|
|
695
|
+
return {
|
|
696
|
+
publicKey: profile.test_mode_enabled ? profile.test_publishable_key : profile.live_publishable_key,
|
|
697
|
+
provider: profile.provider
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return {
|
|
703
|
+
publicKey: null,
|
|
704
|
+
provider: ''
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
const ticketHasAccessLevel = (ticket, accessLevel) => {
|
|
708
|
+
if (!ticket) return false;
|
|
709
|
+
return ticket.badge?.type?.access_levels.map(al => al.name).includes(accessLevel);
|
|
710
|
+
};
|
|
711
|
+
const getCurrentUserLanguage = () => {
|
|
712
|
+
let language = 'en';
|
|
713
|
+
|
|
714
|
+
if (typeof navigator !== 'undefined') {
|
|
715
|
+
language = navigator.languages && navigator.languages[0] || navigator.language || navigator.userLanguage;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return language;
|
|
719
|
+
};
|
|
720
|
+
const isEmptyString = val => {
|
|
721
|
+
return typeof val === 'string' && val.trim().length == 0;
|
|
722
|
+
};
|
|
723
|
+
const getTicketTaxes = (ticket, taxes) => {
|
|
724
|
+
if (isPrePaidTicketType(ticket)) return '';
|
|
725
|
+
const ticketTaxes = taxes.filter(tax => tax.ticket_types.includes(ticket?.id));
|
|
726
|
+
return `${ticketTaxes.length > 0 ? ` plus ${taxes.map(t => t.name).join(' & ')}` : ''}`;
|
|
727
|
+
};
|
|
728
|
+
const hasDiscountApplied = ticketType => ticketType?.cost_with_applied_discount > 0;
|
|
729
|
+
const isFreeOrder = reservation => reservation.amount === 0;
|
|
730
|
+
const isPrePaidOrder = reservation => reservation.status === ORDER_STATUS_PAID && reservation.payment_method === ORDER_PAYMENT_METHOD_OFFLINE;
|
|
731
|
+
const getTicketCost = (ticket, quantity = 1) => {
|
|
732
|
+
return hasDiscountApplied(ticket) ? /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("s", null, formatCurrency(ticket.cost * quantity, {
|
|
733
|
+
currency: ticket.currency
|
|
734
|
+
}), " ", ticket.currency), "\xA0", /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, formatCurrency(ticket.cost_with_applied_discount * quantity, {
|
|
735
|
+
currency: ticket.currency
|
|
736
|
+
}), " ", ticket.currency)) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, formatCurrency(ticket.cost * quantity, {
|
|
737
|
+
currency: ticket.currency
|
|
738
|
+
}), " ", ticket.currency);
|
|
739
|
+
};
|
|
740
|
+
const isPrePaidTicketType = ticketType => ticketType?.sub_type === TICKET_TYPE_SUBTYPE_PREPAID;
|
|
586
741
|
;// CONCATENATED MODULE: ./src/utils/payment-providers/stripe-provider.js
|
|
587
742
|
function stripe_provider_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
588
743
|
|
|
@@ -590,6 +745,8 @@ function stripe_provider_defineProperty(obj, key, value) { if (key in obj) { Obj
|
|
|
590
745
|
|
|
591
746
|
|
|
592
747
|
|
|
748
|
+
|
|
749
|
+
|
|
593
750
|
class StripeProvider {
|
|
594
751
|
constructor({
|
|
595
752
|
reservation,
|
|
@@ -611,14 +768,14 @@ class StripeProvider {
|
|
|
611
768
|
case 404:
|
|
612
769
|
{
|
|
613
770
|
let msg = res.body.message;
|
|
614
|
-
external_sweetalert2_default().fire(
|
|
771
|
+
external_sweetalert2_default().fire('Validation Error', msg, 'warning');
|
|
615
772
|
}
|
|
616
773
|
break;
|
|
617
774
|
|
|
618
775
|
case 500:
|
|
619
776
|
{
|
|
620
777
|
let msg = res.body.message;
|
|
621
|
-
external_sweetalert2_default().fire(
|
|
778
|
+
external_sweetalert2_default().fire('Validation Error', msg, 'warning');
|
|
622
779
|
}
|
|
623
780
|
break;
|
|
624
781
|
|
|
@@ -642,56 +799,56 @@ class StripeProvider {
|
|
|
642
799
|
};
|
|
643
800
|
dispatch(startWidgetLoading());
|
|
644
801
|
|
|
645
|
-
if (this.reservation
|
|
646
|
-
const {
|
|
647
|
-
id
|
|
648
|
-
} = token;
|
|
649
|
-
stripe.confirmCardPayment(this.reservation.payment_gateway_client_token, {
|
|
650
|
-
payment_method: {
|
|
651
|
-
card: {
|
|
652
|
-
token: id
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}).then(result => {
|
|
656
|
-
if (result.error) {
|
|
657
|
-
// Reserve error.message in your UI.
|
|
658
|
-
external_sweetalert2_default().fire(result.error.message, "Please retry purchase.", "warning");
|
|
659
|
-
this.dispatch(changeStep(1));
|
|
660
|
-
this.dispatch(removeReservedTicket());
|
|
661
|
-
this.dispatch(stopWidgetLoading());
|
|
662
|
-
} else {
|
|
663
|
-
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
664
|
-
)(params)(this.dispatch).then(payload => {
|
|
665
|
-
this.dispatch(stopWidgetLoading());
|
|
666
|
-
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
667
|
-
this.dispatch(changeStep(3));
|
|
668
|
-
return payload;
|
|
669
|
-
}).catch(e => {
|
|
670
|
-
this.dispatch(stopWidgetLoading());
|
|
671
|
-
return e;
|
|
672
|
-
}); // The payment has succeeded. Display a success message.
|
|
673
|
-
}
|
|
674
|
-
}).catch(e => {
|
|
675
|
-
this.dispatch(removeReservedTicket());
|
|
676
|
-
this.dispatch(changeStep(1));
|
|
677
|
-
this.dispatch(stopWidgetLoading());
|
|
678
|
-
return e;
|
|
679
|
-
});
|
|
680
|
-
} else {
|
|
681
|
-
// FREE TICKET
|
|
802
|
+
if (isFreeOrder(this.reservation) || isPrePaidOrder(this.reservation)) {
|
|
682
803
|
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
683
804
|
)(params)(this.dispatch).then(payload => {
|
|
684
805
|
this.dispatch(stopWidgetLoading());
|
|
685
806
|
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
686
|
-
this.dispatch(changeStep(
|
|
807
|
+
this.dispatch(changeStep(STEP_COMPLETE));
|
|
687
808
|
return payload;
|
|
688
809
|
}).catch(e => {
|
|
689
810
|
this.dispatch(removeReservedTicket());
|
|
690
|
-
this.dispatch(changeStep(
|
|
811
|
+
this.dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
691
812
|
this.dispatch(stopWidgetLoading());
|
|
692
813
|
return e;
|
|
693
814
|
}); // The payment has succeeded. Display a success message.
|
|
694
|
-
}
|
|
815
|
+
} // regular flow
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
const {
|
|
819
|
+
id
|
|
820
|
+
} = token;
|
|
821
|
+
stripe.confirmCardPayment(this.reservation.payment_gateway_client_token, {
|
|
822
|
+
payment_method: {
|
|
823
|
+
card: {
|
|
824
|
+
token: id
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}).then(result => {
|
|
828
|
+
if (result.error) {
|
|
829
|
+
// Reserve error.message in your UI.
|
|
830
|
+
external_sweetalert2_default().fire(result.error.message, 'Please retry purchase.', 'warning');
|
|
831
|
+
this.dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
832
|
+
this.dispatch(removeReservedTicket());
|
|
833
|
+
this.dispatch(stopWidgetLoading());
|
|
834
|
+
} else {
|
|
835
|
+
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
836
|
+
)(params)(this.dispatch).then(payload => {
|
|
837
|
+
this.dispatch(stopWidgetLoading());
|
|
838
|
+
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
839
|
+
this.dispatch(changeStep(STEP_COMPLETE));
|
|
840
|
+
return payload;
|
|
841
|
+
}).catch(e => {
|
|
842
|
+
this.dispatch(stopWidgetLoading());
|
|
843
|
+
return e;
|
|
844
|
+
}); // The payment has succeeded. Display a success message.
|
|
845
|
+
}
|
|
846
|
+
}).catch(e => {
|
|
847
|
+
this.dispatch(removeReservedTicket());
|
|
848
|
+
this.dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
849
|
+
this.dispatch(stopWidgetLoading());
|
|
850
|
+
return e;
|
|
851
|
+
});
|
|
695
852
|
});
|
|
696
853
|
|
|
697
854
|
this.reservation = reservation;
|
|
@@ -704,9 +861,9 @@ class StripeProvider {
|
|
|
704
861
|
|
|
705
862
|
}
|
|
706
863
|
;// CONCATENATED MODULE: ./src/utils/payment-providers/payment-provider-factory.js
|
|
707
|
-
function
|
|
864
|
+
function payment_provider_factory_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
708
865
|
|
|
709
|
-
function
|
|
866
|
+
function payment_provider_factory_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? payment_provider_factory_ownKeys(Object(source), !0).forEach(function (key) { payment_provider_factory_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : payment_provider_factory_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
710
867
|
|
|
711
868
|
function payment_provider_factory_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
712
869
|
|
|
@@ -720,19 +877,22 @@ payment_provider_factory_defineProperty(PaymentProviderFactory, "build", (provid
|
|
|
720
877
|
switch (provider) {
|
|
721
878
|
case 'LawPay':
|
|
722
879
|
{
|
|
723
|
-
currentProvider = new LawPayProvider(
|
|
880
|
+
currentProvider = new LawPayProvider(payment_provider_factory_objectSpread({}, params));
|
|
724
881
|
break;
|
|
725
882
|
}
|
|
726
883
|
|
|
727
884
|
case 'Stripe':
|
|
728
885
|
{
|
|
729
|
-
currentProvider = new StripeProvider(
|
|
886
|
+
currentProvider = new StripeProvider(payment_provider_factory_objectSpread({}, params));
|
|
730
887
|
break;
|
|
731
888
|
}
|
|
732
889
|
}
|
|
733
890
|
|
|
734
891
|
return currentProvider;
|
|
735
892
|
});
|
|
893
|
+
;// CONCATENATED MODULE: external "urijs"
|
|
894
|
+
const external_urijs_namespaceObject = require("urijs");
|
|
895
|
+
var external_urijs_default = /*#__PURE__*/__webpack_require__.n(external_urijs_namespaceObject);
|
|
736
896
|
;// CONCATENATED MODULE: ./src/actions.js
|
|
737
897
|
function actions_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
738
898
|
|
|
@@ -757,6 +917,8 @@ function actions_defineProperty(obj, key, value) { if (key in obj) { Object.defi
|
|
|
757
917
|
|
|
758
918
|
|
|
759
919
|
|
|
920
|
+
|
|
921
|
+
|
|
760
922
|
const START_WIDGET_LOADING = 'START_WIDGET_LOADING';
|
|
761
923
|
const STOP_WIDGET_LOADING = 'STOP_WIDGET_LOADING';
|
|
762
924
|
const LOAD_INITIAL_VARS = 'LOAD_INITIAL_VARS';
|
|
@@ -781,6 +943,9 @@ const CLEAR_MY_INVITATION = 'CLEAR_MY_INVITATION';
|
|
|
781
943
|
const CLEAR_WIDGET_STATE = 'CLEAR_WIDGET_STATE';
|
|
782
944
|
const UPDATE_CLOCK = 'UPDATE_CLOCK';
|
|
783
945
|
const LOAD_PROFILE_DATA = 'LOAD_PROFILE_DATA';
|
|
946
|
+
const SET_CURRENT_PROMO_CODE = 'SET_CURRENT_PROMO_CODE';
|
|
947
|
+
const CLEAR_CURRENT_PROMO_CODE = 'CLEAR_CURRENT_PROMO_CODE';
|
|
948
|
+
const VALIDATE_PROMO_CODE = 'VALIDATE_PROMO_CODE';
|
|
784
949
|
const startWidgetLoading = (0,actions_namespaceObject.createAction)(START_WIDGET_LOADING);
|
|
785
950
|
const stopWidgetLoading = (0,actions_namespaceObject.createAction)(STOP_WIDGET_LOADING);
|
|
786
951
|
const loadSession = settings => dispatch => {
|
|
@@ -835,11 +1000,23 @@ const getTicketTypes = summitId => async (dispatch, getState, {
|
|
|
835
1000
|
getAccessToken
|
|
836
1001
|
}) => {
|
|
837
1002
|
try {
|
|
838
|
-
const accessToken = await getAccessToken();
|
|
1003
|
+
const accessToken = await getAccessToken(); // try to get the current promo code
|
|
1004
|
+
|
|
1005
|
+
const {
|
|
1006
|
+
registrationLiteState: {
|
|
1007
|
+
promoCode: currentPromoCode
|
|
1008
|
+
}
|
|
1009
|
+
} = getState();
|
|
839
1010
|
let params = {
|
|
840
1011
|
expand: 'badge_type,badge_type.access_levels,badge_type.badge_features',
|
|
841
1012
|
access_token: accessToken
|
|
842
1013
|
};
|
|
1014
|
+
|
|
1015
|
+
if (currentPromoCode !== '') {
|
|
1016
|
+
console.log(`getTicketTypes current promo code is ${currentPromoCode}`);
|
|
1017
|
+
params['filter'] = `promo_code==${currentPromoCode}`;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
843
1020
|
return (0,actions_namespaceObject.getRequest)((0,actions_namespaceObject.createAction)(REQUESTED_TICKET_TYPES), (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types/allowed`, customErrorHandler)(params)(dispatch).then(res => {
|
|
844
1021
|
return res;
|
|
845
1022
|
}).catch(error => {
|
|
@@ -876,6 +1053,97 @@ const getTaxesTypes = summitId => async (dispatch, getState, {
|
|
|
876
1053
|
}
|
|
877
1054
|
};
|
|
878
1055
|
|
|
1056
|
+
const applyPromoCode = currentPromoCode => (dispatch, getState) => {
|
|
1057
|
+
try {
|
|
1058
|
+
const {
|
|
1059
|
+
registrationLiteState: {
|
|
1060
|
+
settings: {
|
|
1061
|
+
summitId
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
} = getState(); // set the current promo code and get ticket types again
|
|
1065
|
+
|
|
1066
|
+
dispatch((0,actions_namespaceObject.createAction)(SET_CURRENT_PROMO_CODE)({
|
|
1067
|
+
currentPromoCode
|
|
1068
|
+
}));
|
|
1069
|
+
dispatch(getTicketTypes(summitId));
|
|
1070
|
+
} catch (e) {
|
|
1071
|
+
return Promise.reject(e);
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
1074
|
+
const removePromoCode = () => (dispatch, getState) => {
|
|
1075
|
+
try {
|
|
1076
|
+
const {
|
|
1077
|
+
registrationLiteState: {
|
|
1078
|
+
settings: {
|
|
1079
|
+
summitId
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
} = getState(); // clear the promo code and get the ticket types again
|
|
1083
|
+
|
|
1084
|
+
dispatch((0,actions_namespaceObject.createAction)(CLEAR_CURRENT_PROMO_CODE)({}));
|
|
1085
|
+
dispatch(getTicketTypes(summitId));
|
|
1086
|
+
} catch (e) {
|
|
1087
|
+
dispatch((0,actions_namespaceObject.createAction)(CLEAR_CURRENT_PROMO_CODE)({}));
|
|
1088
|
+
return Promise.reject(e);
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
const validatePromoCode = (ticketData, {
|
|
1092
|
+
onError
|
|
1093
|
+
}) => async (dispatch, getState, {
|
|
1094
|
+
apiBaseUrl,
|
|
1095
|
+
getAccessToken
|
|
1096
|
+
}) => {
|
|
1097
|
+
const {
|
|
1098
|
+
registrationLiteState: {
|
|
1099
|
+
settings: {
|
|
1100
|
+
summitId
|
|
1101
|
+
},
|
|
1102
|
+
promoCode: currentPromoCode
|
|
1103
|
+
}
|
|
1104
|
+
} = getState();
|
|
1105
|
+
|
|
1106
|
+
if (summitId && currentPromoCode) {
|
|
1107
|
+
dispatch(startWidgetLoading());
|
|
1108
|
+
const {
|
|
1109
|
+
ticketQuantity,
|
|
1110
|
+
id,
|
|
1111
|
+
sub_type
|
|
1112
|
+
} = ticketData;
|
|
1113
|
+
const access_token = await getAccessToken();
|
|
1114
|
+
let apiUrl = external_urijs_default()(`${apiBaseUrl}/api/v1/summits/${summitId}/promo-codes/${currentPromoCode}/apply`);
|
|
1115
|
+
apiUrl.addQuery('access_token', access_token);
|
|
1116
|
+
apiUrl.addQuery('filter[]', `ticket_type_id==${id}`);
|
|
1117
|
+
apiUrl.addQuery('filter[]', `ticket_type_qty==${ticketQuantity}`);
|
|
1118
|
+
apiUrl.addQuery('filter[]', `ticket_type_subtype==${sub_type}`);
|
|
1119
|
+
|
|
1120
|
+
const errorHandler = (err, res) => (dispatch, state) => {
|
|
1121
|
+
if (res && res.statusCode === 404 && onError) return onError(err, res);
|
|
1122
|
+
if (res && res.statusCode === 412 && onError) return onError(err, res);
|
|
1123
|
+
if (res && res.statusCode === 429 && onError) return onError(err, res);
|
|
1124
|
+
|
|
1125
|
+
if (res && res.statusCode === 500) {
|
|
1126
|
+
const defaultMessage = 'Server Error';
|
|
1127
|
+
const msg = res?.body?.message || defaultMessage;
|
|
1128
|
+
external_sweetalert2_default().fire("Server Error", msg, "error");
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(VALIDATE_PROMO_CODE), `${apiUrl}`, errorHandler)({})(dispatch).then(res => {
|
|
1136
|
+
dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
1137
|
+
dispatch(stopWidgetLoading());
|
|
1138
|
+
return res;
|
|
1139
|
+
}).catch(error => {
|
|
1140
|
+
dispatch(stopWidgetLoading());
|
|
1141
|
+
return Promise.reject(error);
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
return dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
1146
|
+
};
|
|
879
1147
|
const reserveTicket = ({
|
|
880
1148
|
provider,
|
|
881
1149
|
personalInformation,
|
|
@@ -892,7 +1160,8 @@ const reserveTicket = ({
|
|
|
892
1160
|
registrationLiteState: {
|
|
893
1161
|
settings: {
|
|
894
1162
|
summitId
|
|
895
|
-
}
|
|
1163
|
+
},
|
|
1164
|
+
promoCode: currentPromoCode
|
|
896
1165
|
}
|
|
897
1166
|
} = getState();
|
|
898
1167
|
let {
|
|
@@ -900,14 +1169,13 @@ const reserveTicket = ({
|
|
|
900
1169
|
lastName,
|
|
901
1170
|
email,
|
|
902
1171
|
company,
|
|
903
|
-
promoCode,
|
|
904
1172
|
attendee
|
|
905
1173
|
} = personalInformation;
|
|
906
1174
|
dispatch(startWidgetLoading());
|
|
907
1175
|
const access_token = await getAccessToken();
|
|
908
1176
|
const tickets = [...Array(ticketQuantity)].map(() => ({
|
|
909
1177
|
type_id: ticket.id,
|
|
910
|
-
promo_code:
|
|
1178
|
+
promo_code: currentPromoCode || null
|
|
911
1179
|
}));
|
|
912
1180
|
|
|
913
1181
|
if (tickets.length === 1 && attendee) {
|
|
@@ -932,13 +1200,15 @@ const reserveTicket = ({
|
|
|
932
1200
|
if (res && res.statusCode === 412 && onError) return onError(err, res);
|
|
933
1201
|
|
|
934
1202
|
if (res && res.statusCode === 404) {
|
|
935
|
-
const
|
|
1203
|
+
const defaultMessage = 'Validation Error';
|
|
1204
|
+
const msg = res?.body?.message || defaultMessage;
|
|
936
1205
|
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
937
1206
|
return;
|
|
938
1207
|
}
|
|
939
1208
|
|
|
940
1209
|
if (res && res.statusCode === 500) {
|
|
941
|
-
const
|
|
1210
|
+
const defaultMessage = 'Server Error';
|
|
1211
|
+
const msg = res?.body?.message || defaultMessage;
|
|
942
1212
|
external_sweetalert2_default().fire("Server Error", msg, "error");
|
|
943
1213
|
return;
|
|
944
1214
|
}
|
|
@@ -948,15 +1218,19 @@ const reserveTicket = ({
|
|
|
948
1218
|
|
|
949
1219
|
return (0,actions_namespaceObject.postRequest)((0,actions_namespaceObject.createAction)(CREATE_RESERVATION), (0,actions_namespaceObject.createAction)(CREATE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/reserve`, normalizedEntity, errorHandler // entity
|
|
950
1220
|
)(params)(dispatch).then(payload => {
|
|
1221
|
+
let {
|
|
1222
|
+
response: reservation
|
|
1223
|
+
} = payload;
|
|
951
1224
|
dispatch(stopWidgetLoading());
|
|
952
|
-
|
|
1225
|
+
reservation.promo_code = currentPromoCode || null;
|
|
953
1226
|
|
|
954
|
-
if (
|
|
1227
|
+
if (isFreeOrder(reservation) || isPrePaidOrder(reservation)) {
|
|
955
1228
|
dispatch(payTicketWithProvider(provider));
|
|
956
1229
|
return payload;
|
|
957
|
-
}
|
|
1230
|
+
} // we need to pay the reservation ...
|
|
958
1231
|
|
|
959
|
-
|
|
1232
|
+
|
|
1233
|
+
dispatch(changeStep(STEP_PAYMENT));
|
|
960
1234
|
return payload;
|
|
961
1235
|
}).catch(e => {
|
|
962
1236
|
dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
|
|
@@ -993,17 +1267,17 @@ const removeReservedTicket = () => async (dispatch, getState, {
|
|
|
993
1267
|
return (0,actions_namespaceObject.deleteRequest)((0,actions_namespaceObject.createAction)(DELETE_RESERVATION), (0,actions_namespaceObject.createAction)(DELETE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/${hash}`, {}, actions_namespaceObject.authErrorHandler // entity
|
|
994
1268
|
)(params)(dispatch).then(payload => {
|
|
995
1269
|
dispatch(stopWidgetLoading());
|
|
996
|
-
dispatch(changeStep(
|
|
1270
|
+
dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
997
1271
|
return payload;
|
|
998
1272
|
}).catch(e => {
|
|
999
1273
|
dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
|
|
1000
|
-
dispatch(changeStep(
|
|
1274
|
+
dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
1001
1275
|
dispatch(stopWidgetLoading());
|
|
1002
1276
|
return Promise.reject(e);
|
|
1003
1277
|
});
|
|
1004
1278
|
} catch (e) {
|
|
1005
1279
|
dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
|
|
1006
|
-
dispatch(changeStep(
|
|
1280
|
+
dispatch(changeStep(STEP_PERSONAL_INFO));
|
|
1007
1281
|
dispatch(stopWidgetLoading());
|
|
1008
1282
|
return Promise.reject(e);
|
|
1009
1283
|
}
|
|
@@ -1190,7 +1464,8 @@ const DEFAULT_STATE = {
|
|
|
1190
1464
|
summitId: null,
|
|
1191
1465
|
userProfile: null
|
|
1192
1466
|
},
|
|
1193
|
-
nowUtc: localNowUtc
|
|
1467
|
+
nowUtc: localNowUtc,
|
|
1468
|
+
promoCode: ''
|
|
1194
1469
|
};
|
|
1195
1470
|
|
|
1196
1471
|
const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
@@ -1332,14 +1607,11 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
1332
1607
|
}
|
|
1333
1608
|
|
|
1334
1609
|
case DELETE_RESERVATION_SUCCESS:
|
|
1335
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
1336
|
-
reservation: null
|
|
1337
|
-
});
|
|
1338
|
-
|
|
1339
1610
|
case CLEAR_RESERVATION:
|
|
1340
1611
|
{
|
|
1341
1612
|
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
1342
|
-
reservation: null
|
|
1613
|
+
reservation: null,
|
|
1614
|
+
promoCode: ''
|
|
1343
1615
|
});
|
|
1344
1616
|
}
|
|
1345
1617
|
|
|
@@ -1349,7 +1621,8 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
1349
1621
|
checkout: payload.response,
|
|
1350
1622
|
reservation: null,
|
|
1351
1623
|
userProfile: null,
|
|
1352
|
-
invitation: null
|
|
1624
|
+
invitation: null,
|
|
1625
|
+
promoCode: ''
|
|
1353
1626
|
});
|
|
1354
1627
|
}
|
|
1355
1628
|
|
|
@@ -1377,6 +1650,23 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
|
1377
1650
|
});
|
|
1378
1651
|
}
|
|
1379
1652
|
|
|
1653
|
+
case CLEAR_CURRENT_PROMO_CODE:
|
|
1654
|
+
{
|
|
1655
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
1656
|
+
promoCode: ''
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
case SET_CURRENT_PROMO_CODE:
|
|
1661
|
+
{
|
|
1662
|
+
const {
|
|
1663
|
+
currentPromoCode
|
|
1664
|
+
} = payload;
|
|
1665
|
+
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
1666
|
+
promoCode: currentPromoCode
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1380
1670
|
default:
|
|
1381
1671
|
{
|
|
1382
1672
|
return state;
|
|
@@ -1441,7 +1731,7 @@ const external_react_spring_namespaceObject = require("react-spring");
|
|
|
1441
1731
|
;// CONCATENATED MODULE: external "react-use"
|
|
1442
1732
|
const external_react_use_namespaceObject = require("react-use");
|
|
1443
1733
|
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/security/constants"
|
|
1444
|
-
const
|
|
1734
|
+
const security_constants_namespaceObject = require("openstack-uicore-foundation/lib/security/constants");
|
|
1445
1735
|
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/ajaxloader"
|
|
1446
1736
|
const ajaxloader_namespaceObject = require("openstack-uicore-foundation/lib/components/ajaxloader");
|
|
1447
1737
|
var ajaxloader_default = /*#__PURE__*/__webpack_require__.n(ajaxloader_namespaceObject);
|
|
@@ -1463,30 +1753,6 @@ const methods_namespaceObject = require("openstack-uicore-foundation/lib/utils/m
|
|
|
1463
1753
|
;// CONCATENATED MODULE: ./src/components/lawpay-form/index.module.scss
|
|
1464
1754
|
// extracted by mini-css-extract-plugin
|
|
1465
1755
|
/* harmony default export */ const lawpay_form_index_module = ({"form":"form___zXb7s","fieldWrapper":"fieldWrapper___G4Wqw","inputWrapper":"inputWrapper___Yz5zB","fieldRow":"fieldRow___NfZdJ","addressField":"addressField___vmAQh","lawpayWrapper":"lawpayWrapper___hpUBf","dateWrapper":"dateWrapper___XDfqs","dropdown":"dropdown___l3_bk","fieldError":"fieldError___Igq3U"});
|
|
1466
|
-
;// CONCATENATED MODULE: ./src/utils/constants.js
|
|
1467
|
-
/**
|
|
1468
|
-
* Copyright 2022 OpenStack Foundation
|
|
1469
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1470
|
-
* you may not use this file except in compliance with the License.
|
|
1471
|
-
* You may obtain a copy of the License at
|
|
1472
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1473
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1474
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1475
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1476
|
-
* See the License for the specific language governing permissions and
|
|
1477
|
-
* limitations under the License.
|
|
1478
|
-
**/
|
|
1479
|
-
const AUTH_ERROR_MESSAGE = 'Missing Auth info';
|
|
1480
|
-
const AUTH_ERROR_MISSING_REFRESH_TOKEN = "missing Refresh Token";
|
|
1481
|
-
const AUTH_ERROR_REQUEST_FAILED = 'Request failed';
|
|
1482
|
-
const VirtualAccessLevel = 'VIRTUAL';
|
|
1483
|
-
const DefaultBGColor = '#000000';
|
|
1484
|
-
const DefaultTextColor = '#FFFFFF';
|
|
1485
|
-
const DefaultHintColor = 'rgb(58, 63, 65)';
|
|
1486
|
-
const EMAIL_REGEXP = /(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
|
1487
|
-
const TICKET_OWNER_MYSELF = 'myself';
|
|
1488
|
-
const TICKET_OWNER_SOMEONE = 'someoneElse';
|
|
1489
|
-
const TICKET_OWNER_UNASSIGNED = 'unassigned';
|
|
1490
1756
|
;// CONCATENATED MODULE: ./src/components/lawpay-form/index.js
|
|
1491
1757
|
function lawpay_form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1492
1758
|
|
|
@@ -2151,14 +2417,6 @@ const PaymentComponent = ({
|
|
|
2151
2417
|
;// CONCATENATED MODULE: external "react-tooltip"
|
|
2152
2418
|
const external_react_tooltip_namespaceObject = require("react-tooltip");
|
|
2153
2419
|
var external_react_tooltip_default = /*#__PURE__*/__webpack_require__.n(external_react_tooltip_namespaceObject);
|
|
2154
|
-
;// CONCATENATED MODULE: ./src/helpers/capitalizeFirstLetter.js
|
|
2155
|
-
const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
2156
|
-
;// CONCATENATED MODULE: ./src/helpers/formatErrorMessage.js
|
|
2157
|
-
|
|
2158
|
-
const formatErrorMessage = string => {
|
|
2159
|
-
const errorMessage = capitalizeFirstLetter(string);
|
|
2160
|
-
return `${errorMessage}${errorMessage.endsWith('.') ? '' : '.'}`;
|
|
2161
|
-
};
|
|
2162
2420
|
;// CONCATENATED MODULE: ./src/components/personal-information/index.module.scss
|
|
2163
2421
|
// extracted by mini-css-extract-plugin
|
|
2164
2422
|
/* harmony default export */ const personal_information_index_module = ({"title":"title___ECoNz","form":"form___lDFka","fieldWrapper":"fieldWrapper___Mi_nL","fieldWrapperRadio":"fieldWrapperRadio___x18VG","inputWrapper":"inputWrapper___PEQFR","readOnly":"readOnly___WRazF","fieldError":"fieldError___ksJVe","moreInfo":"moreInfo___cQYdZ","moreInfoTooltip":"moreInfoTooltip___lslgT","ticketQuantityNotice":"ticketQuantityNotice___L6gis","formErrors":"formErrors___dQQMe"});
|
|
@@ -2193,6 +2451,7 @@ function personal_information_defineProperty(obj, key, value) { if (key in obj)
|
|
|
2193
2451
|
|
|
2194
2452
|
|
|
2195
2453
|
|
|
2454
|
+
|
|
2196
2455
|
const PersonalInfoComponent = ({
|
|
2197
2456
|
isActive,
|
|
2198
2457
|
changeForm,
|
|
@@ -2203,8 +2462,6 @@ const PersonalInfoComponent = ({
|
|
|
2203
2462
|
formValues,
|
|
2204
2463
|
formErrors = {},
|
|
2205
2464
|
invitation,
|
|
2206
|
-
showMultipleTicketTexts,
|
|
2207
|
-
allowPromoCodes,
|
|
2208
2465
|
showCompanyInput = true,
|
|
2209
2466
|
companyDDLPlaceholder,
|
|
2210
2467
|
showCompanyInputDefaultOptions,
|
|
@@ -2215,7 +2472,7 @@ const PersonalInfoComponent = ({
|
|
|
2215
2472
|
const [ticketOwnerOption, setTicketOwnerOption] = (0,external_react_.useState)('');
|
|
2216
2473
|
const [ticketOwnerError, setTicketOwnerError] = (0,external_react_.useState)(false); // if there's only one ticket on the order and there is no invitation available, display the radio button to assign the ticket
|
|
2217
2474
|
|
|
2218
|
-
const shouldDisplayTicketAssignment = () => formValues.ticketQuantity === 1 && !invitation;
|
|
2475
|
+
const shouldDisplayTicketAssignment = () => formValues.ticketQuantity === 1 && !invitation && !isPrePaidTicketType(formValues.ticketType);
|
|
2219
2476
|
|
|
2220
2477
|
const radioListOptions = [{
|
|
2221
2478
|
label: "Myself",
|
|
@@ -2235,7 +2492,6 @@ const PersonalInfoComponent = ({
|
|
|
2235
2492
|
id: null,
|
|
2236
2493
|
name: ''
|
|
2237
2494
|
},
|
|
2238
|
-
promoCode: '',
|
|
2239
2495
|
attendee: {
|
|
2240
2496
|
firstName: '',
|
|
2241
2497
|
lastName: '',
|
|
@@ -2455,14 +2711,7 @@ const PersonalInfoComponent = ({
|
|
|
2455
2711
|
}), companyError && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2456
2712
|
className: personal_information_index_module.fieldError,
|
|
2457
2713
|
"data-testid": "company-error"
|
|
2458
|
-
}, "This field is required."))),
|
|
2459
|
-
className: personal_information_index_module.fieldWrapper
|
|
2460
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2461
|
-
className: personal_information_index_module.inputWrapper
|
|
2462
|
-
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
2463
|
-
type: "text",
|
|
2464
|
-
placeholder: "Promo code"
|
|
2465
|
-
}, register("promoCode"))))), shouldDisplayTicketAssignment() && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2714
|
+
}, "This field is required."))), shouldDisplayTicketAssignment() && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2466
2715
|
className: personal_information_index_module.fieldWrapperRadio
|
|
2467
2716
|
}, /*#__PURE__*/external_react_default().createElement("label", null, "Ticket is for:"), /*#__PURE__*/external_react_default().createElement(components_namespaceObject.RadioList, {
|
|
2468
2717
|
id: `ticket-self-radio`,
|
|
@@ -2478,25 +2727,6 @@ const PersonalInfoComponent = ({
|
|
|
2478
2727
|
className: personal_information_index_module.fieldWrapper
|
|
2479
2728
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2480
2729
|
className: personal_information_index_module.inputWrapper
|
|
2481
|
-
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
2482
|
-
type: "text",
|
|
2483
|
-
placeholder: "Email *",
|
|
2484
|
-
defaultValue: personalInfo?.attendee?.email ?? ''
|
|
2485
|
-
}, register("attendee.email", {
|
|
2486
|
-
required: true,
|
|
2487
|
-
pattern: EMAIL_REGEXP
|
|
2488
|
-
}), {
|
|
2489
|
-
"data-testid": "attendee-email"
|
|
2490
|
-
}))), errors.attendee?.email?.type === 'emailRequired' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2491
|
-
className: personal_information_index_module.fieldError,
|
|
2492
|
-
"data-testid": "attendee-email-error-required"
|
|
2493
|
-
}, "This field is required."), errors.attendee?.email?.type === 'pattern' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2494
|
-
className: personal_information_index_module.fieldError,
|
|
2495
|
-
"data-testid": "attendee-email-error-invalid"
|
|
2496
|
-
}, "The email is invalid.")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2497
|
-
className: personal_information_index_module.fieldWrapper
|
|
2498
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2499
|
-
className: personal_information_index_module.inputWrapper
|
|
2500
2730
|
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
2501
2731
|
type: "text",
|
|
2502
2732
|
placeholder: "First name",
|
|
@@ -2519,18 +2749,26 @@ const PersonalInfoComponent = ({
|
|
|
2519
2749
|
maxLength: 100
|
|
2520
2750
|
}), {
|
|
2521
2751
|
"data-testid": "attendee-last-name"
|
|
2522
|
-
}))))
|
|
2523
|
-
className: personal_information_index_module.
|
|
2524
|
-
"data-tip": true,
|
|
2525
|
-
"data-for": "promo-code-info"
|
|
2526
|
-
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
2527
|
-
className: "glyphicon glyphicon-info-sign",
|
|
2528
|
-
"aria-hidden": "true"
|
|
2529
|
-
}), ` `, "Have multiple promo codes?"), /*#__PURE__*/external_react_default().createElement((external_react_tooltip_default()), {
|
|
2530
|
-
id: "promo-code-info"
|
|
2752
|
+
})))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2753
|
+
className: personal_information_index_module.fieldWrapper
|
|
2531
2754
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2532
|
-
className: personal_information_index_module.
|
|
2533
|
-
},
|
|
2755
|
+
className: personal_information_index_module.inputWrapper
|
|
2756
|
+
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
2757
|
+
type: "text",
|
|
2758
|
+
placeholder: "Email *",
|
|
2759
|
+
defaultValue: personalInfo?.attendee?.email ?? ''
|
|
2760
|
+
}, register("attendee.email", {
|
|
2761
|
+
required: true,
|
|
2762
|
+
pattern: EMAIL_REGEXP
|
|
2763
|
+
}), {
|
|
2764
|
+
"data-testid": "attendee-email"
|
|
2765
|
+
}))), errors.attendee?.email?.type === 'required' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2766
|
+
className: personal_information_index_module.fieldError,
|
|
2767
|
+
"data-testid": "attendee-email-error-required"
|
|
2768
|
+
}, "This field is required."), errors.attendee?.email?.type === 'pattern' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2769
|
+
className: personal_information_index_module.fieldError,
|
|
2770
|
+
"data-testid": "attendee-email-error-invalid"
|
|
2771
|
+
}, "The email is invalid."))))), formErrors.length > 0 && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2534
2772
|
className: `${personal_information_index_module.formErrors} alert alert-danger`
|
|
2535
2773
|
}, formErrors.map((error, index) => /*#__PURE__*/external_react_default().createElement("div", {
|
|
2536
2774
|
key: index
|
|
@@ -2543,60 +2781,10 @@ const raw_html_namespaceObject = require("openstack-uicore-foundation/lib/compon
|
|
|
2543
2781
|
var raw_html_default = /*#__PURE__*/__webpack_require__.n(raw_html_namespaceObject);
|
|
2544
2782
|
;// CONCATENATED MODULE: ./src/components/ticket-type/index.module.scss
|
|
2545
2783
|
// extracted by mini-css-extract-plugin
|
|
2546
|
-
/* harmony default export */ const ticket_type_index_module = ({"title":"title___DNZyl","summary":"summary___quWdZ","promoCode":"promoCode___bqTCw","crossOut":"crossOut___QZ7dy","discount":"discount___sEK_Q","taxes":"taxes___fe8oJ","promo":"promo___F8lPO","form":"form___aoo7w","dropdown":"dropdown____HWg0","quantity":"quantity___SIEQZ","soldOut":"soldOut___Hatfr","moreInfo":"moreInfo___LmwOe","moreInfoTooltip":"moreInfoTooltip___nOBf1","inPersonDisclaimer":"inPersonDisclaimer___PXGTz"});
|
|
2547
|
-
;// CONCATENATED MODULE: ./src/helpers/getTicketMaxQuantity.js
|
|
2548
|
-
const getTicketMaxQuantity = ticket => ticket ? Math.min((ticket.quantity_2_sell || Number.MAX_SAFE_INTEGER) - ticket.quantity_sold, ticket.max_quantity_per_order || Number.MAX_SAFE_INTEGER) : 0;
|
|
2784
|
+
/* harmony default export */ const ticket_type_index_module = ({"title":"title___DNZyl","summary":"summary___quWdZ","promoCode":"promoCode___bqTCw","crossOut":"crossOut___QZ7dy","discount":"discount___sEK_Q","promocodeError":"promocodeError___oxk4p","taxes":"taxes___fe8oJ","promo":"promo___F8lPO","form":"form___aoo7w","dropdown":"dropdown____HWg0","quantity":"quantity___SIEQZ","soldOut":"soldOut___Hatfr","moreInfo":"moreInfo___LmwOe","moreInfoTooltip":"moreInfoTooltip___nOBf1","inPersonDisclaimer":"inPersonDisclaimer___PXGTz"});
|
|
2549
2785
|
;// CONCATENATED MODULE: ./src/components/ticket-dropdown/index.module.scss
|
|
2550
2786
|
// extracted by mini-css-extract-plugin
|
|
2551
2787
|
/* harmony default export */ const ticket_dropdown_index_module = ({"placeholder":"placeholder___pcdCn","selectedTicket":"selectedTicket___qkbpH","inPersonDisclaimer":"inPersonDisclaimer___z_DzO","dropdown":"dropdown___mfbPG","soldOut":"soldOut___rBLC0"});
|
|
2552
|
-
;// CONCATENATED MODULE: ./src/utils/utils.js
|
|
2553
|
-
/**
|
|
2554
|
-
* Copyright 2022 OpenStack Foundation
|
|
2555
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2556
|
-
* you may not use this file except in compliance with the License.
|
|
2557
|
-
* You may obtain a copy of the License at
|
|
2558
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2559
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2560
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2561
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2562
|
-
* See the License for the specific language governing permissions and
|
|
2563
|
-
* limitations under the License.
|
|
2564
|
-
**/
|
|
2565
|
-
const getCurrentProvider = summit => {
|
|
2566
|
-
for (let profile of summit.payment_profiles) {
|
|
2567
|
-
if (profile.application_type === 'Registration') {
|
|
2568
|
-
return {
|
|
2569
|
-
publicKey: profile.test_mode_enabled ? profile.test_publishable_key : profile.live_publishable_key,
|
|
2570
|
-
provider: profile.provider
|
|
2571
|
-
};
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
|
|
2575
|
-
return {
|
|
2576
|
-
publicKey: null,
|
|
2577
|
-
provider: ''
|
|
2578
|
-
};
|
|
2579
|
-
};
|
|
2580
|
-
const ticketHasAccessLevel = (ticket, accessLevel) => {
|
|
2581
|
-
if (!ticket) return false;
|
|
2582
|
-
return ticket.badge?.type?.access_levels.map(al => al.name).includes(accessLevel);
|
|
2583
|
-
};
|
|
2584
|
-
const getCurrentUserLanguage = () => {
|
|
2585
|
-
let language = 'en';
|
|
2586
|
-
|
|
2587
|
-
if (typeof navigator !== 'undefined') {
|
|
2588
|
-
language = navigator.languages && navigator.languages[0] || navigator.language || navigator.userLanguage;
|
|
2589
|
-
}
|
|
2590
|
-
|
|
2591
|
-
return language;
|
|
2592
|
-
};
|
|
2593
|
-
const isEmptyString = val => {
|
|
2594
|
-
return typeof val === 'string' && val.trim().length == 0;
|
|
2595
|
-
};
|
|
2596
|
-
const getTicketTaxes = (ticket, taxes) => {
|
|
2597
|
-
const ticketTaxes = taxes.filter(tax => tax.ticket_types.includes(ticket?.id));
|
|
2598
|
-
return `${ticketTaxes.length > 0 ? ` plus ${taxes.map(t => t.name).join(' & ')}` : ''}`;
|
|
2599
|
-
};
|
|
2600
2788
|
;// CONCATENATED MODULE: ./src/components/ticket-dropdown/index.js
|
|
2601
2789
|
/**
|
|
2602
2790
|
* Copyright 2020 OpenStack Foundation
|
|
@@ -2637,8 +2825,7 @@ const TicketDropdownComponent = ({
|
|
|
2637
2825
|
}, selectedTicket ? /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", {
|
|
2638
2826
|
className: ticket_dropdown_index_module.selectedTicket,
|
|
2639
2827
|
"data-testid": "selected-ticket"
|
|
2640
|
-
}, `${selectedTicket.name} -
|
|
2641
|
-
${getTicketTaxes(selectedTicket, taxTypes)}`), /*#__PURE__*/external_react_default().createElement("i", {
|
|
2828
|
+
}, `${selectedTicket.name} - `, getTicketCost(selectedTicket), getTicketTaxes(selectedTicket, taxTypes)), /*#__PURE__*/external_react_default().createElement("i", {
|
|
2642
2829
|
className: "fa fa-chevron-down"
|
|
2643
2830
|
})) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", {
|
|
2644
2831
|
"data-testid": "no-ticket"
|
|
@@ -2658,40 +2845,85 @@ const TicketDropdownComponent = ({
|
|
|
2658
2845
|
if (isTicketSoldOut) return;
|
|
2659
2846
|
ticketSelect(t);
|
|
2660
2847
|
}
|
|
2661
|
-
}, t.name, " -", ` `, !isTicketSoldOut &&
|
|
2848
|
+
}, t.name, " -", ` `, !isTicketSoldOut && getTicketCost(t), getTicketTaxes(t, taxTypes), isTicketSoldOut && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, " Sold Out"));
|
|
2662
2849
|
})));
|
|
2663
2850
|
};
|
|
2664
2851
|
|
|
2665
2852
|
/* harmony default export */ const ticket_dropdown = (TicketDropdownComponent);
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2853
|
+
// EXTERNAL MODULE: ./src/assets/icon-check-circle.svg
|
|
2854
|
+
var icon_check_circle = __webpack_require__(60);
|
|
2855
|
+
var icon_check_circle_default = /*#__PURE__*/__webpack_require__.n(icon_check_circle);
|
|
2856
|
+
;// CONCATENATED MODULE: ./src/components/promocode-input/index.module.scss
|
|
2857
|
+
// extracted by mini-css-extract-plugin
|
|
2858
|
+
/* harmony default export */ const promocode_input_index_module = ({"promoCodeWrapper":"promoCodeWrapper___aw3Zx","promoCodeInput":"promoCodeInput___rDiET","promoCodeActive":"promoCodeActive___j7xnn","codeButtonWrapper":"codeButtonWrapper___jVZh5","noCode":"noCode___YUmVy","appliedCodeIcon":"appliedCodeIcon___pa3B4","moreInfo":"moreInfo___Ru3Rv","moreInfoTooltip":"moreInfoTooltip___eaYWm"});
|
|
2859
|
+
;// CONCATENATED MODULE: ./src/components/promocode-input/index.js
|
|
2860
|
+
/**
|
|
2861
|
+
* Copyright 2020 OpenStack Foundation
|
|
2862
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2863
|
+
* you may not use this file except in compliance with the License.
|
|
2864
|
+
* You may obtain a copy of the License at
|
|
2865
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2866
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2867
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2868
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2869
|
+
* See the License for the specific language governing permissions and
|
|
2870
|
+
* limitations under the License.
|
|
2871
|
+
**/
|
|
2670
2872
|
|
|
2671
|
-
function formatCurrency_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? formatCurrency_ownKeys(Object(source), !0).forEach(function (key) { formatCurrency_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : formatCurrency_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2672
2873
|
|
|
2673
|
-
function formatCurrency_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2674
2874
|
|
|
2675
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2676
2875
|
|
|
2677
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2678
2876
|
|
|
2679
|
-
const formatCurrency = (value, _ref) => {
|
|
2680
|
-
let {
|
|
2681
|
-
locale = 'en-US'
|
|
2682
|
-
} = _ref,
|
|
2683
|
-
options = _objectWithoutProperties(_ref, _excluded);
|
|
2684
2877
|
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2878
|
+
const PromoCodeInput = ({
|
|
2879
|
+
applyPromoCode,
|
|
2880
|
+
promoCode,
|
|
2881
|
+
removePromoCode,
|
|
2882
|
+
showMultipleTicketTexts
|
|
2883
|
+
}) => {
|
|
2884
|
+
const [statePromoCode, setStatePromoCode] = (0,external_react_.useState)(promoCode);
|
|
2885
|
+
(0,external_react_.useEffect)(() => {
|
|
2886
|
+
if (isEmptyString(promoCode)) setStatePromoCode('');
|
|
2887
|
+
}, [promoCode]);
|
|
2888
|
+
return /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2889
|
+
className: promocode_input_index_module.promoCodeWrapper
|
|
2890
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, "Do you have a promo code?"), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2891
|
+
className: promocode_input_index_module.promoCodeInput
|
|
2892
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
2893
|
+
className: `${promoCode ? promocode_input_index_module.promoCodeActive : ''}`,
|
|
2894
|
+
type: "text",
|
|
2895
|
+
value: statePromoCode,
|
|
2896
|
+
onChange: ev => setStatePromoCode(ev.target.value),
|
|
2897
|
+
placeholder: "Enter your promo code",
|
|
2898
|
+
onKeyDown: e => {
|
|
2899
|
+
if (e.key === "Enter") applyPromoCode(statePromoCode);
|
|
2900
|
+
},
|
|
2901
|
+
readOnly: !isEmptyString(promoCode)
|
|
2902
|
+
}), promoCode && /*#__PURE__*/external_react_default().createElement("img", {
|
|
2903
|
+
src: (icon_check_circle_default()),
|
|
2904
|
+
className: promocode_input_index_module.appliedCodeIcon
|
|
2905
|
+
}), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2906
|
+
className: `${promocode_input_index_module.codeButtonWrapper} ${statePromoCode ? '' : promocode_input_index_module.noCode}`
|
|
2907
|
+
}, promoCode !== '' ? /*#__PURE__*/external_react_default().createElement("button", {
|
|
2908
|
+
onClick: () => removePromoCode()
|
|
2909
|
+
}, "Remove") : /*#__PURE__*/external_react_default().createElement("button", {
|
|
2910
|
+
disabled: !statePromoCode,
|
|
2911
|
+
onClick: () => applyPromoCode(statePromoCode)
|
|
2912
|
+
}, "Apply"))), showMultipleTicketTexts && /*#__PURE__*/external_react_default().createElement("a", {
|
|
2913
|
+
className: promocode_input_index_module.moreInfo,
|
|
2914
|
+
"data-tip": true,
|
|
2915
|
+
"data-for": "promo-code-info"
|
|
2916
|
+
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
2917
|
+
className: "glyphicon glyphicon-info-sign",
|
|
2918
|
+
"aria-hidden": "true"
|
|
2919
|
+
}), ` `, "Have multiple promo codes?")), /*#__PURE__*/external_react_default().createElement((external_react_tooltip_default()), {
|
|
2920
|
+
id: "promo-code-info"
|
|
2921
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2922
|
+
className: promocode_input_index_module.moreInfoTooltip
|
|
2923
|
+
}, "Promo code will be applied to all tickets in this order. If you wish to utilize more than one promo code, simply place another order after you complete this registration order. Only one promo code can be applied per order.")));
|
|
2694
2924
|
};
|
|
2925
|
+
|
|
2926
|
+
/* harmony default export */ const promocode_input = (PromoCodeInput);
|
|
2695
2927
|
;// CONCATENATED MODULE: ./src/components/ticket-type/index.js
|
|
2696
2928
|
function ticket_type_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2697
2929
|
|
|
@@ -2723,14 +2955,22 @@ function ticket_type_defineProperty(obj, key, value) { if (key in obj) { Object.
|
|
|
2723
2955
|
|
|
2724
2956
|
|
|
2725
2957
|
|
|
2958
|
+
|
|
2726
2959
|
const TicketTypeComponent = ({
|
|
2727
|
-
|
|
2960
|
+
allowedTicketTypes,
|
|
2961
|
+
originalTicketTypes,
|
|
2962
|
+
// these are the original ones
|
|
2728
2963
|
taxTypes,
|
|
2729
2964
|
isActive,
|
|
2730
2965
|
changeForm,
|
|
2966
|
+
formErrors,
|
|
2731
2967
|
reservation,
|
|
2732
2968
|
inPersonDisclaimer,
|
|
2733
|
-
showMultipleTicketTexts
|
|
2969
|
+
showMultipleTicketTexts,
|
|
2970
|
+
allowPromoCodes,
|
|
2971
|
+
applyPromoCode,
|
|
2972
|
+
removePromoCode,
|
|
2973
|
+
promoCode
|
|
2734
2974
|
}) => {
|
|
2735
2975
|
const [ticket, setTicket] = (0,external_react_.useState)(null);
|
|
2736
2976
|
const [quantity, setQuantity] = (0,external_react_.useState)(1);
|
|
@@ -2754,7 +2994,7 @@ const TicketTypeComponent = ({
|
|
|
2754
2994
|
});
|
|
2755
2995
|
(0,external_react_.useEffect)(() => {
|
|
2756
2996
|
if (reservation && reservation.tickets?.length > 0) {
|
|
2757
|
-
setTicket(
|
|
2997
|
+
setTicket(allowedTicketTypes.find(t => t.id === reservation.tickets[0].ticket_type_id));
|
|
2758
2998
|
}
|
|
2759
2999
|
}, []);
|
|
2760
3000
|
(0,external_react_.useEffect)(() => {
|
|
@@ -2763,6 +3003,22 @@ const TicketTypeComponent = ({
|
|
|
2763
3003
|
ticketQuantity: quantity
|
|
2764
3004
|
});
|
|
2765
3005
|
}, [ticket, quantity]);
|
|
3006
|
+
(0,external_react_.useEffect)(() => {
|
|
3007
|
+
// if the promo code had changed ( set or not set)
|
|
3008
|
+
// try to find the updated ticket from the original ticket types collection from api
|
|
3009
|
+
// and update the current ticket that exist on component state
|
|
3010
|
+
// bc a discount could be applied to the current selected ticket type
|
|
3011
|
+
if (!ticket) return;
|
|
3012
|
+
const updatedCurrentTicket = originalTicketTypes.find(t => t?.id === ticket.id);
|
|
3013
|
+
|
|
3014
|
+
if (updatedCurrentTicket) {
|
|
3015
|
+
changeForm({
|
|
3016
|
+
ticketType: updatedCurrentTicket
|
|
3017
|
+
});
|
|
3018
|
+
setTicket(updatedCurrentTicket);
|
|
3019
|
+
}
|
|
3020
|
+
}, [promoCode, originalTicketTypes]);
|
|
3021
|
+
const isPrePaidReservation = (0,external_react_.useMemo)(() => reservation ? isPrePaidOrder(reservation) : false, [reservation]);
|
|
2766
3022
|
|
|
2767
3023
|
const handleTicketChange = t => {
|
|
2768
3024
|
setTicket(t);
|
|
@@ -2773,6 +3029,7 @@ const TicketTypeComponent = ({
|
|
|
2773
3029
|
|
|
2774
3030
|
const decrementQuantity = () => setQuantity(quantity - 1);
|
|
2775
3031
|
|
|
3032
|
+
const promoCodeError = Object.keys(formErrors).length > 0 ? formErrors : null;
|
|
2776
3033
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2777
3034
|
className: `${ticket_type_index_module.outerWrapper} step-wrapper`
|
|
2778
3035
|
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
@@ -2781,20 +3038,17 @@ const TicketTypeComponent = ({
|
|
|
2781
3038
|
className: ticket_type_index_module.title
|
|
2782
3039
|
}, /*#__PURE__*/external_react_default().createElement("span", null, "Ticket"), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2783
3040
|
className: ticket_type_index_module.summary
|
|
2784
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, `${ticket.name} (${quantity}):
|
|
2785
|
-
currency: ticket.currency
|
|
2786
|
-
})} ${ticket.currency}
|
|
2787
|
-
${getTicketTaxes(ticket, taxTypes)}`, !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", {
|
|
3041
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, `${ticket.name} (${quantity}): `, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, getTicketCost(ticket, quantity)), `${getTicketTaxes(ticket, taxTypes)}`, !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", {
|
|
2788
3042
|
className: ticket_type_index_module.promoCode
|
|
2789
3043
|
}, "Promo code\xA0", /*#__PURE__*/external_react_default().createElement("abbr", {
|
|
2790
3044
|
title: reservation.promo_code
|
|
2791
|
-
}, reservation.promo_code), "\xA0applied:"), /*#__PURE__*/external_react_default().createElement("span", {
|
|
3045
|
+
}, reservation.promo_code), "\xA0applied:"), !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement("span", {
|
|
2792
3046
|
className: ticket_type_index_module.discount
|
|
2793
3047
|
}, ` - ${formatCurrency(reservation.discount_amount, {
|
|
2794
3048
|
currency: ticket.currency
|
|
2795
|
-
})} ${ticket.currency}`)), !isActive && reservation && /*#__PURE__*/external_react_default().createElement("span", {
|
|
3049
|
+
})} ${ticket.currency}`)), !isActive && reservation && !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement("span", {
|
|
2796
3050
|
className: ticket_type_index_module.promo
|
|
2797
|
-
}, "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 => {
|
|
3051
|
+
}, "Subtotal: ", `${ticket?.currency_symbol} ${((reservation?.raw_amount_in_cents - reservation?.discount_amount_in_cents) / 100).toFixed(2)} ${ticket?.currency}`), !isActive && reservation?.taxes_amount > 0 && !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, reservation?.applied_taxes.map(tax => {
|
|
2798
3052
|
return /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, {
|
|
2799
3053
|
key: tax.id
|
|
2800
3054
|
}, /*#__PURE__*/external_react_default().createElement("span", {
|
|
@@ -2804,7 +3058,7 @@ const TicketTypeComponent = ({
|
|
|
2804
3058
|
}, tax.name), ` : ${formatCurrency(tax.amount, {
|
|
2805
3059
|
currency: ticket.currency
|
|
2806
3060
|
})} ${ticket.currency}`), /*#__PURE__*/external_react_default().createElement("br", null));
|
|
2807
|
-
})), !isActive && reservation && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), "Total: ", `${formatCurrency(reservation.amount, {
|
|
3061
|
+
})), !isActive && reservation && !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), "Total: ", `${formatCurrency(reservation.amount, {
|
|
2808
3062
|
currency: ticket.currency
|
|
2809
3063
|
})} ${ticket.currency}`)), !ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, "No ticket selected")))), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
2810
3064
|
style: ticket_type_objectSpread({
|
|
@@ -2818,10 +3072,10 @@ const TicketTypeComponent = ({
|
|
|
2818
3072
|
className: ticket_type_index_module.dropdown
|
|
2819
3073
|
}, /*#__PURE__*/external_react_default().createElement(ticket_dropdown, {
|
|
2820
3074
|
selectedTicket: ticket,
|
|
2821
|
-
ticketTypes:
|
|
3075
|
+
ticketTypes: allowedTicketTypes,
|
|
2822
3076
|
taxTypes: taxTypes,
|
|
2823
3077
|
onTicketSelect: handleTicketChange
|
|
2824
|
-
})), ticket && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3078
|
+
})), ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2825
3079
|
className: ticket_type_index_module.quantity
|
|
2826
3080
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2827
3081
|
className: "input-group"
|
|
@@ -2851,7 +3105,14 @@ const TicketTypeComponent = ({
|
|
|
2851
3105
|
disabled: maxQuantity === 0 || quantity >= maxQuantity
|
|
2852
3106
|
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
2853
3107
|
className: "glyphicon glyphicon-plus"
|
|
2854
|
-
})))))),
|
|
3108
|
+
}))))))), allowPromoCodes && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement(promocode_input, {
|
|
3109
|
+
promoCode: promoCode,
|
|
3110
|
+
applyPromoCode: applyPromoCode,
|
|
3111
|
+
showMultipleTicketTexts: showMultipleTicketTexts,
|
|
3112
|
+
removePromoCode: removePromoCode
|
|
3113
|
+
}), promoCodeError && Object.values(promoCodeError).map(er => /*#__PURE__*/external_react_default().createElement("div", {
|
|
3114
|
+
className: `${ticket_type_index_module.promocodeError} alert alert-danger`
|
|
3115
|
+
}, er))), showMultipleTicketTexts && /*#__PURE__*/external_react_default().createElement("a", {
|
|
2855
3116
|
className: ticket_type_index_module.moreInfo,
|
|
2856
3117
|
"data-tip": true,
|
|
2857
3118
|
"data-for": "ticket-quantity-info"
|
|
@@ -2872,6 +3133,12 @@ const TicketTypeComponent = ({
|
|
|
2872
3133
|
// extracted by mini-css-extract-plugin
|
|
2873
3134
|
/* harmony default export */ const button_bar_index_module = ({"button":"button___MZBIY","outerWrapper":"outerWrapper___XRnaq","innerWrapper":"innerWrapper___LFsOH","registration":"registration___jdf6T","actions":"actions___Gsf0y"});
|
|
2874
3135
|
;// CONCATENATED MODULE: ./src/components/button-bar/index.js
|
|
3136
|
+
function button_bar_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3137
|
+
|
|
3138
|
+
function button_bar_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? button_bar_ownKeys(Object(source), !0).forEach(function (key) { button_bar_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : button_bar_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3139
|
+
|
|
3140
|
+
function button_bar_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3141
|
+
|
|
2875
3142
|
/**
|
|
2876
3143
|
* Copyright 2020 OpenStack Foundation
|
|
2877
3144
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -2888,15 +3155,19 @@ const TicketTypeComponent = ({
|
|
|
2888
3155
|
|
|
2889
3156
|
|
|
2890
3157
|
|
|
3158
|
+
|
|
2891
3159
|
const ButtonBarComponent = ({
|
|
2892
3160
|
step,
|
|
2893
3161
|
changeStep,
|
|
3162
|
+
validatePromoCode,
|
|
3163
|
+
onValidateError,
|
|
2894
3164
|
formValues,
|
|
2895
3165
|
removeReservedTicket,
|
|
2896
3166
|
inPersonDisclaimer
|
|
2897
3167
|
}) => {
|
|
2898
3168
|
const {
|
|
2899
|
-
ticketType
|
|
3169
|
+
ticketType,
|
|
3170
|
+
ticketQuantity
|
|
2900
3171
|
} = formValues || {};
|
|
2901
3172
|
const nextButtonText = inPersonDisclaimer && ticketType && isInPersonTicketType(ticketType) ? 'Accept' : 'Next';
|
|
2902
3173
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
@@ -2907,25 +3178,27 @@ const ButtonBarComponent = ({
|
|
|
2907
3178
|
className: button_bar_index_module.required
|
|
2908
3179
|
}, step !== 0 && /*#__PURE__*/external_react_default().createElement("span", null, "* Required fields ", /*#__PURE__*/external_react_default().createElement("br", null), " ")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2909
3180
|
className: button_bar_index_module.actions
|
|
2910
|
-
}, step !==
|
|
3181
|
+
}, step !== STEP_SELECT_TICKET_TYPE && step !== STEP_PAYMENT && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2911
3182
|
className: `${button_bar_index_module.button} button`,
|
|
2912
3183
|
onClick: () => changeStep(step - 1)
|
|
2913
|
-
}, "< Back"), step !==
|
|
3184
|
+
}, "< Back"), step !== STEP_SELECT_TICKET_TYPE && step === STEP_PAYMENT && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2914
3185
|
className: `${button_bar_index_module.button} button`,
|
|
2915
3186
|
onClick: () => removeReservedTicket()
|
|
2916
|
-
}, "< Back"), step ===
|
|
3187
|
+
}, "< Back"), step === STEP_SELECT_TICKET_TYPE && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2917
3188
|
disabled: !ticketType,
|
|
2918
3189
|
className: `${button_bar_index_module.button} button`,
|
|
2919
|
-
onClick: () =>
|
|
2920
|
-
|
|
3190
|
+
onClick: () => validatePromoCode(button_bar_objectSpread(button_bar_objectSpread({}, ticketType), {}, {
|
|
3191
|
+
ticketQuantity
|
|
3192
|
+
}), onValidateError)
|
|
3193
|
+
}, nextButtonText), step === STEP_PERSONAL_INFO && ticketType?.cost === 0 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2921
3194
|
className: `${button_bar_index_module.button} button`,
|
|
2922
3195
|
type: "submit",
|
|
2923
3196
|
form: "personal-info-form"
|
|
2924
|
-
}, "Get Ticket"), step ===
|
|
3197
|
+
}, "Get Ticket"), step === STEP_PERSONAL_INFO && ticketType?.cost > 0 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2925
3198
|
className: `${button_bar_index_module.button} button`,
|
|
2926
3199
|
type: "submit",
|
|
2927
3200
|
form: "personal-info-form"
|
|
2928
|
-
}, "Next"), step ===
|
|
3201
|
+
}, "Next"), step === STEP_PAYMENT && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2929
3202
|
className: `${button_bar_index_module.button} button`,
|
|
2930
3203
|
type: "submit",
|
|
2931
3204
|
form: "payment-form"
|
|
@@ -3182,7 +3455,7 @@ const TicketTaxesError = ({
|
|
|
3182
3455
|
|
|
3183
3456
|
/* harmony default export */ const ticket_taxes_error = (TicketTaxesError);
|
|
3184
3457
|
;// CONCATENATED MODULE: ./src/components/registration-lite.js
|
|
3185
|
-
const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypesAndTaxes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToMyOrders", "goToEvent", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions", "invitation", "loginInitialEmailInputValue", "getMyInvitation", "showMultipleTicketTexts", "noAllowedTicketsMessage", "ticketTaxesErrorMessage", "authErrorCallback", "clearWidgetState", "requestedTicketTypes", "allowPromoCodes", "showCompanyInput", "companyDDLPlaceholder", "nowUtc", "updateClock", "completedExtraQuestions", "loadProfileData", "closeWidget", "hasVirtualAccessLevel", "logoLight", "logoDark", "showCompanyInputDefaultOptions", "companyDDLOptions2Show"];
|
|
3458
|
+
const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypesAndTaxes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToMyOrders", "goToEvent", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions", "invitation", "loginInitialEmailInputValue", "getMyInvitation", "showMultipleTicketTexts", "noAllowedTicketsMessage", "ticketTaxesErrorMessage", "authErrorCallback", "clearWidgetState", "requestedTicketTypes", "allowPromoCodes", "showCompanyInput", "companyDDLPlaceholder", "nowUtc", "updateClock", "completedExtraQuestions", "loadProfileData", "closeWidget", "hasVirtualAccessLevel", "logoLight", "logoDark", "showCompanyInputDefaultOptions", "companyDDLOptions2Show", "promoCode", "hasDiscount", "getTicketDiscount", "removePromoCode", "applyPromoCode", "validatePromoCode"];
|
|
3186
3459
|
|
|
3187
3460
|
function registration_lite_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3188
3461
|
|
|
@@ -3228,6 +3501,7 @@ function registration_lite_objectWithoutPropertiesLoose(source, excluded) { if (
|
|
|
3228
3501
|
|
|
3229
3502
|
|
|
3230
3503
|
|
|
3504
|
+
|
|
3231
3505
|
|
|
3232
3506
|
|
|
3233
3507
|
let language = getCurrentUserLanguage(); // language would be something like es-ES or es_ES
|
|
@@ -3307,7 +3581,13 @@ const RegistrationLite = _ref => {
|
|
|
3307
3581
|
logoLight,
|
|
3308
3582
|
logoDark,
|
|
3309
3583
|
showCompanyInputDefaultOptions,
|
|
3310
|
-
companyDDLOptions2Show
|
|
3584
|
+
companyDDLOptions2Show,
|
|
3585
|
+
promoCode,
|
|
3586
|
+
hasDiscount,
|
|
3587
|
+
getTicketDiscount,
|
|
3588
|
+
removePromoCode,
|
|
3589
|
+
applyPromoCode,
|
|
3590
|
+
validatePromoCode
|
|
3311
3591
|
} = _ref,
|
|
3312
3592
|
rest = registration_lite_objectWithoutProperties(_ref, registration_lite_excluded);
|
|
3313
3593
|
|
|
@@ -3408,7 +3688,7 @@ const RegistrationLite = _ref => {
|
|
|
3408
3688
|
message
|
|
3409
3689
|
} = error;
|
|
3410
3690
|
|
|
3411
|
-
if (message && (message.includes(
|
|
3691
|
+
if (message && (message.includes(security_constants_namespaceObject.AUTH_ERROR_MISSING_AUTH_INFO) || message.includes(security_constants_namespaceObject.AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(security_constants_namespaceObject.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR))) {
|
|
3412
3692
|
// we dont have an access token, init log out process
|
|
3413
3693
|
clearWidgetState();
|
|
3414
3694
|
return authErrorCallback(error);
|
|
@@ -3443,7 +3723,7 @@ const RegistrationLite = _ref => {
|
|
|
3443
3723
|
className: general_module.innerWrapper
|
|
3444
3724
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3445
3725
|
className: general_module.title
|
|
3446
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, summitData.name), /*#__PURE__*/external_react_default().createElement("i", {
|
|
3726
|
+
}, profileData && /*#__PURE__*/external_react_default().createElement("span", null, summitData.name), /*#__PURE__*/external_react_default().createElement("i", {
|
|
3447
3727
|
className: "fa fa-close",
|
|
3448
3728
|
"aria-label": "close",
|
|
3449
3729
|
onClick: handleCloseClick
|
|
@@ -3477,15 +3757,24 @@ const RegistrationLite = _ref => {
|
|
|
3477
3757
|
}), profileData && step !== 3 && allowedTicketTypes.length > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, ownedTickets.length > 0 && /*#__PURE__*/external_react_default().createElement(ticket_owned, {
|
|
3478
3758
|
ownedTickets: ownedTickets
|
|
3479
3759
|
}), /*#__PURE__*/external_react_default().createElement(ticket_type, {
|
|
3480
|
-
|
|
3760
|
+
allowedTicketTypes: allowedTicketTypes,
|
|
3761
|
+
originalTicketTypes: ticketTypes,
|
|
3481
3762
|
inPersonDisclaimer: inPersonDisclaimer,
|
|
3482
3763
|
taxTypes: taxTypes,
|
|
3483
3764
|
reservation: reservation,
|
|
3484
|
-
isActive: step ===
|
|
3765
|
+
isActive: step === STEP_SELECT_TICKET_TYPE,
|
|
3766
|
+
allowPromoCodes: allowPromoCodes,
|
|
3767
|
+
applyPromoCode: applyPromoCode,
|
|
3768
|
+
removePromoCode: () => {
|
|
3769
|
+
setFormErrors({});
|
|
3770
|
+
removePromoCode();
|
|
3771
|
+
},
|
|
3772
|
+
promoCode: promoCode,
|
|
3773
|
+
formErrors: formErrors,
|
|
3485
3774
|
changeForm: ticketForm => setFormValues(registration_lite_objectSpread(registration_lite_objectSpread({}, formValues), ticketForm)),
|
|
3486
3775
|
showMultipleTicketTexts: showMultipleTicketTexts
|
|
3487
3776
|
}), /*#__PURE__*/external_react_default().createElement(personal_information, {
|
|
3488
|
-
isActive: step ===
|
|
3777
|
+
isActive: step === STEP_PERSONAL_INFO,
|
|
3489
3778
|
reservation: reservation,
|
|
3490
3779
|
userProfile: profileData,
|
|
3491
3780
|
invitation: invitation,
|
|
@@ -3506,7 +3795,7 @@ const RegistrationLite = _ref => {
|
|
|
3506
3795
|
message
|
|
3507
3796
|
} = error;
|
|
3508
3797
|
|
|
3509
|
-
if (message && (message.includes(
|
|
3798
|
+
if (message && (message.includes(security_constants_namespaceObject.AUTH_ERROR_MISSING_AUTH_INFO) || message.includes(security_constants_namespaceObject.AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(security_constants_namespaceObject.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR))) {
|
|
3510
3799
|
// we dont have an access token, init log out process
|
|
3511
3800
|
clearWidgetState();
|
|
3512
3801
|
return authErrorCallback(error);
|
|
@@ -3517,7 +3806,6 @@ const RegistrationLite = _ref => {
|
|
|
3517
3806
|
formValues: formValues,
|
|
3518
3807
|
formErrors: formErrors,
|
|
3519
3808
|
showMultipleTicketTexts: showMultipleTicketTexts,
|
|
3520
|
-
allowPromoCodes: allowPromoCodes,
|
|
3521
3809
|
showCompanyInput: showCompanyInput,
|
|
3522
3810
|
companyDDLPlaceholder: companyDDLPlaceholder,
|
|
3523
3811
|
showCompanyInputDefaultOptions: showCompanyInputDefaultOptions,
|
|
@@ -3527,7 +3815,7 @@ const RegistrationLite = _ref => {
|
|
|
3527
3815
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3528
3816
|
ref: ref
|
|
3529
3817
|
}, /*#__PURE__*/external_react_default().createElement(payment, {
|
|
3530
|
-
isActive: step ===
|
|
3818
|
+
isActive: step === STEP_PAYMENT,
|
|
3531
3819
|
reservation: reservation,
|
|
3532
3820
|
payTicket: payTicketWithProvider,
|
|
3533
3821
|
userProfile: profileData,
|
|
@@ -3535,7 +3823,7 @@ const RegistrationLite = _ref => {
|
|
|
3535
3823
|
provider: provider,
|
|
3536
3824
|
providerKey: publicKey,
|
|
3537
3825
|
stripeOptions: stripeOptions
|
|
3538
|
-
})))), profileData && step ===
|
|
3826
|
+
})))), profileData && step === STEP_COMPLETE && /*#__PURE__*/external_react_default().createElement(purchase_complete, {
|
|
3539
3827
|
checkout: checkout,
|
|
3540
3828
|
user: profileData,
|
|
3541
3829
|
summit: summitData,
|
|
@@ -3560,6 +3848,10 @@ const RegistrationLite = _ref => {
|
|
|
3560
3848
|
inPersonDisclaimer: inPersonDisclaimer,
|
|
3561
3849
|
formValues: formValues,
|
|
3562
3850
|
removeReservedTicket: removeReservedTicket,
|
|
3851
|
+
validatePromoCode: validatePromoCode,
|
|
3852
|
+
onValidateError: {
|
|
3853
|
+
onError: (err, res) => setFormErrors(res.body.errors)
|
|
3854
|
+
},
|
|
3563
3855
|
changeStep: changeStep
|
|
3564
3856
|
})))));
|
|
3565
3857
|
};
|
|
@@ -3580,7 +3872,8 @@ const mapStateToProps = ({
|
|
|
3580
3872
|
passwordlessCode: registrationLiteState.passwordless.otp_length,
|
|
3581
3873
|
passwordlessCodeSent: registrationLiteState.passwordless.code_sent,
|
|
3582
3874
|
passwordlessCodeError: registrationLiteState.passwordless.error,
|
|
3583
|
-
nowUtc: registrationLiteState.nowUtc
|
|
3875
|
+
nowUtc: registrationLiteState.nowUtc,
|
|
3876
|
+
promoCode: registrationLiteState.promoCode
|
|
3584
3877
|
});
|
|
3585
3878
|
|
|
3586
3879
|
RegistrationLite.defaultProps = {
|
|
@@ -3632,7 +3925,10 @@ RegistrationLite.propTypes = {
|
|
|
3632
3925
|
getMyInvitation: getMyInvitation,
|
|
3633
3926
|
clearWidgetState: clearWidgetState,
|
|
3634
3927
|
updateClock: updateClock,
|
|
3635
|
-
loadProfileData: loadProfileData
|
|
3928
|
+
loadProfileData: loadProfileData,
|
|
3929
|
+
applyPromoCode: applyPromoCode,
|
|
3930
|
+
removePromoCode: removePromoCode,
|
|
3931
|
+
validatePromoCode: validatePromoCode
|
|
3636
3932
|
})(RegistrationLite));
|
|
3637
3933
|
;// CONCATENATED MODULE: ./src/summit-registration-lite.js
|
|
3638
3934
|
/**
|