@mseva/upyog-ui-module-chb 1.1.0 → 1.1.1

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.
@@ -1,4 +1,4 @@
1
- import { TickMark, CardSubHeader, Modal, CardLabelDesc, CardLabel, CardText, Card, FormStep, Dropdown, TextArea, Loader as Loader$1, TextInput, MobileNumber, Toast, LabelFieldPair, UploadFile, Table, KeyNote, SubmitBar, CardHeader, InfoIcon, Calender, TelePhone, DisplayPhotos as DisplayPhotos$1, CardSectionHeader, CheckPoint, ConnectingCheckPoints, AppContainer, BackButton, PrivateRoute, PDFSvg as PDFSvg$2, StatusTable, Row, CheckBox, LinkButton, Banner, Header, MultiLink, SearchField, FilterFormField, RadioButtons, ComplaintIcon, InboxComposer, SearchForm, CardLabelError, DatePicker, EmployeeModuleCard, CloseSvg, Localities, RemoveableTag, FormComposer, ActionBar, Menu, OTPInput, Rating, CitizenHomeCard } from '@mseva/digit-ui-react-components';
1
+ import { TickMark, CardSubHeader, Modal as Modal$1, CardLabelDesc, CardLabel, CardText, Card, FormStep, Dropdown, TextArea, Loader as Loader$1, TextInput, MobileNumber, Toast, LabelFieldPair, UploadFile, Table, KeyNote, SubmitBar, CardHeader, InfoIcon, Calender, TelePhone, DisplayPhotos as DisplayPhotos$1, CardSectionHeader, CheckPoint, ConnectingCheckPoints, AppContainer, BackButton, PrivateRoute, PDFSvg as PDFSvg$2, StatusTable, Row, CheckBox, LinkButton, Banner, Header, MultiLink, SearchField, FilterFormField, RadioButtons, ComplaintIcon, InboxComposer, SearchForm, CardLabelError, DatePicker, EmployeeModuleCard, CloseSvg, Localities, RemoveableTag, FormComposer, ActionBar, Menu, OTPInput, Rating, CitizenHomeCard } from '@mseva/digit-ui-react-components';
2
2
  import React, { useState, useEffect, useRef, Fragment as Fragment$1, useMemo, useReducer, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
@@ -6,6 +6,7 @@ import { useForm, Controller, useFormContext } from 'react-hook-form';
6
6
  import { useQueryClient } from 'react-query';
7
7
  import jsxRuntime from 'react/jsx-runtime';
8
8
  import { useDispatch, useSelector } from 'react-redux';
9
+ import reactDom from 'react-dom';
9
10
  import { combineReducers } from 'redux';
10
11
 
11
12
  let actions = [];
@@ -168,7 +169,7 @@ const ChbCancellationPolicy = ({
168
169
  fontSize: '20px',
169
170
  textDecoration: 'none'
170
171
  }
171
- }, "Terms and Conditions")), showCancellationPolicy && /*#__PURE__*/React.createElement(Modal, {
172
+ }, "Terms and Conditions")), showCancellationPolicy && /*#__PURE__*/React.createElement(Modal$1, {
172
173
  headerBarMain: /*#__PURE__*/React.createElement(CardSubHeader, {
173
174
  style: {
174
175
  color: '#a82227',
@@ -216,7 +217,7 @@ const ChbCancellationPolicy = ({
216
217
  },
217
218
  isOpen: showCancellationPolicy,
218
219
  onClose: handleCancellationPolicyClick
219
- }), showPriceBreakup && /*#__PURE__*/React.createElement(Modal, {
220
+ }), showPriceBreakup && /*#__PURE__*/React.createElement(Modal$1, {
220
221
  headerBarMain: /*#__PURE__*/React.createElement(CardSubHeader, {
221
222
  style: {
222
223
  color: '#a82227',
@@ -16808,7 +16809,7 @@ const ChbCommunityHallDetails = ({
16808
16809
  }
16809
16810
  }, line.trim()));
16810
16811
  };
16811
- return /*#__PURE__*/React.createElement("div", null, showPopup && selectedHall && /*#__PURE__*/React.createElement(Modal, {
16812
+ return /*#__PURE__*/React.createElement("div", null, showPopup && selectedHall && /*#__PURE__*/React.createElement(Modal$1, {
16812
16813
  headerBarMain: /*#__PURE__*/React.createElement(CardSubHeader, {
16813
16814
  style: {
16814
16815
  color: '#a82227',
@@ -17119,7 +17120,7 @@ const BookingPopup = ({
17119
17120
  setIsDataSet(false);
17120
17121
  }
17121
17122
  }, [isDataSet, onSubmit]);
17122
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, {
17123
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal$1, {
17123
17124
  headerBarMain: /*#__PURE__*/React.createElement(Heading, {
17124
17125
  t: t
17125
17126
  }),
@@ -18558,7 +18559,7 @@ const ChbApplication = ({
18558
18559
  }), /*#__PURE__*/React.createElement(KeyNote, {
18559
18560
  keyValue: t("PT_COMMON_TABLE_COL_STATUS_LABEL"),
18560
18561
  note: t(`${application === null || application === void 0 ? void 0 : application.bookingStatus}`)
18561
- }), /*#__PURE__*/React.createElement("div", null, application.bookingStatus === "PENDING_FOR_PAYMENT" ? /*#__PURE__*/React.createElement(SubmitBar, {
18562
+ }), /*#__PURE__*/React.createElement("div", null, application.bookingStatus === "PENDING_PAYMENT" ? /*#__PURE__*/React.createElement(SubmitBar, {
18562
18563
  label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),
18563
18564
  onSubmit: handleMakePayment,
18564
18565
  style: {
@@ -18731,7 +18732,7 @@ function NDCDocument({
18731
18732
  const capitalize = text => text.substr(0, 1).toUpperCase() + text.substr(1);
18732
18733
  const ulbCamel = ulb => ulb.toLowerCase().split(" ").map(capitalize).join(" ");
18733
18734
  const getChbAcknowledgementData = async (application, tenantInfo, t) => {
18734
- var _application$document, _tenantInfo$city, _application$applican, _application$applican2, _application$applican3, _application$applican4, _application$specialC, _application$purpose, _application$applican5, _application$applican6, _application$applican7, _application$applican8, _application$applican9, _application$address;
18735
+ var _application$document, _tenantInfo$city, _application$applican, _application$applican2, _application$applican3, _application$applican4, _application$specialC, _application$purpose, _application$address;
18735
18736
  const filesArray = application === null || application === void 0 ? void 0 : (_application$document = application.documents) === null || _application$document === void 0 ? void 0 : _application$document.map(value => value === null || value === void 0 ? void 0 : value.fileStoreId);
18736
18737
  const res = (filesArray === null || filesArray === void 0 ? void 0 : filesArray.length) > 0 && (await Digit.UploadServices.Filefetch(filesArray, Digit.ULBService.getStateId()));
18737
18738
  const getBookingDateRange = bookingSlotDetails => {
@@ -18801,7 +18802,7 @@ const getChbAcknowledgementData = async (application, tenantInfo, t) => {
18801
18802
  title: t("CHB_EVENT_DETAILS"),
18802
18803
  values: [{
18803
18804
  title: t("CHB_SPECIAL_CATEGORY"),
18804
- value: application === null || application === void 0 ? void 0 : (_application$specialC = application.specialCategory) === null || _application$specialC === void 0 ? void 0 : _application$specialC.category
18805
+ value: t(application === null || application === void 0 ? void 0 : (_application$specialC = application.specialCategory) === null || _application$specialC === void 0 ? void 0 : _application$specialC.category)
18805
18806
  }, {
18806
18807
  title: t("CHB_PURPOSE"),
18807
18808
  value: application === null || application === void 0 ? void 0 : (_application$purpose = application.purpose) === null || _application$purpose === void 0 ? void 0 : _application$purpose.purpose
@@ -18809,24 +18810,6 @@ const getChbAcknowledgementData = async (application, tenantInfo, t) => {
18809
18810
  title: t("CHB_PURPOSE_DESCRIPTION"),
18810
18811
  value: application === null || application === void 0 ? void 0 : application.purposeDescription
18811
18812
  }]
18812
- }, {
18813
- title: t("CHB_BANK_DETAILS"),
18814
- values: [{
18815
- title: t("CHB_ACCOUNT_NUMBER"),
18816
- value: (application === null || application === void 0 ? void 0 : (_application$applican5 = application.applicantDetail) === null || _application$applican5 === void 0 ? void 0 : _application$applican5.accountNumber) || " N/A"
18817
- }, {
18818
- title: t("CHB_IFSC_CODE"),
18819
- value: (application === null || application === void 0 ? void 0 : (_application$applican6 = application.applicantDetail) === null || _application$applican6 === void 0 ? void 0 : _application$applican6.ifscCode) || " N/A"
18820
- }, {
18821
- title: t("CHB_BANK_NAME"),
18822
- value: (application === null || application === void 0 ? void 0 : (_application$applican7 = application.applicantDetail) === null || _application$applican7 === void 0 ? void 0 : _application$applican7.bankName) || " N/A"
18823
- }, {
18824
- title: t("CHB_BANK_BRANCH_NAME"),
18825
- value: (application === null || application === void 0 ? void 0 : (_application$applican8 = application.applicantDetail) === null || _application$applican8 === void 0 ? void 0 : _application$applican8.bankBranchName) || " N/A"
18826
- }, {
18827
- title: t("CHB_ACCOUNT_HOLDER_NAME"),
18828
- value: (application === null || application === void 0 ? void 0 : (_application$applican9 = application.applicantDetail) === null || _application$applican9 === void 0 ? void 0 : _application$applican9.accountHolderName) || " N/A"
18829
- }]
18830
18813
  }, {
18831
18814
  title: t("ADS_ADDRESS_DETAILS"),
18832
18815
  values: [{
@@ -41887,7 +41870,7 @@ const CHBApplicationDetails = () => {
41887
41870
  hallName: chb_details === null || chb_details === void 0 ? void 0 : chb_details.communityHallName,
41888
41871
  hallCode: t(slot.hallCode) + " - " + slot.capacity,
41889
41872
  bookingDate: slot.bookingDate,
41890
- bookingStatus: t(`WF_CHB_${slot === null || slot === void 0 ? void 0 : slot.status}`)
41873
+ bookingStatus: t(`WF_NEWTL_${slot === null || slot === void 0 ? void 0 : slot.status}`)
41891
41874
  }))) || [];
41892
41875
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
41893
41876
  className: "cardHeaderWithOptions",
@@ -42589,7 +42572,7 @@ const CHBCancelBooking = ({
42589
42572
  const {
42590
42573
  handleSubmit
42591
42574
  } = useForm();
42592
- return /*#__PURE__*/React.createElement(Modal, {
42575
+ return /*#__PURE__*/React.createElement(Modal$1, {
42593
42576
  headerBarMain: /*#__PURE__*/React.createElement(Heading, {
42594
42577
  t: t
42595
42578
  }),
@@ -43780,7 +43763,7 @@ const NDCModal = ({
43780
43763
  }
43781
43764
  }, [action, approvers, financialYears, selectedFinancialYear, uploadedFile]);
43782
43765
  if (!action || !config.form) return null;
43783
- return /*#__PURE__*/React.createElement(Modal, {
43766
+ return /*#__PURE__*/React.createElement(Modal$1, {
43784
43767
  headerBarMain: /*#__PURE__*/React.createElement(Heading$1, {
43785
43768
  label: t(config.label.heading)
43786
43769
  }),
@@ -45289,6 +45272,1669 @@ const NewADSStepperForm = () => {
45289
45272
  }));
45290
45273
  };
45291
45274
 
45275
+ var tabbable_1 = createCommonjsModule(function (module, exports) {
45276
+
45277
+ Object.defineProperty(exports, "__esModule", {
45278
+ value: true
45279
+ });
45280
+ exports.default = findTabbableDescendants;
45281
+ var DISPLAY_NONE = "none";
45282
+ var DISPLAY_CONTENTS = "contents";
45283
+ var tabbableNode = /^(input|select|textarea|button|object|iframe)$/;
45284
+ function isNotOverflowing(element, style) {
45285
+ return style.getPropertyValue("overflow") !== "visible" || element.scrollWidth <= 0 && element.scrollHeight <= 0;
45286
+ }
45287
+ function hidesContents(element) {
45288
+ var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
45289
+ if (zeroSize && !element.innerHTML) return true;
45290
+ try {
45291
+ var style = window.getComputedStyle(element);
45292
+ var displayValue = style.getPropertyValue("display");
45293
+ return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;
45294
+ } catch (exception) {
45295
+ console.warn("Failed to inspect element style");
45296
+ return false;
45297
+ }
45298
+ }
45299
+ function visible(element) {
45300
+ var parentElement = element;
45301
+ var rootNode = element.getRootNode && element.getRootNode();
45302
+ while (parentElement) {
45303
+ if (parentElement === document.body) break;
45304
+ if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;
45305
+ if (hidesContents(parentElement)) return false;
45306
+ parentElement = parentElement.parentNode;
45307
+ }
45308
+ return true;
45309
+ }
45310
+ function focusable(element, isTabIndexNotNaN) {
45311
+ var nodeName = element.nodeName.toLowerCase();
45312
+ var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
45313
+ return res && visible(element);
45314
+ }
45315
+ function tabbable(element) {
45316
+ var tabIndex = element.getAttribute("tabindex");
45317
+ if (tabIndex === null) tabIndex = undefined;
45318
+ var isTabIndexNaN = isNaN(tabIndex);
45319
+ return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);
45320
+ }
45321
+ function findTabbableDescendants(element) {
45322
+ var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function (finished, el) {
45323
+ return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));
45324
+ }, []);
45325
+ return descendants.filter(tabbable);
45326
+ }
45327
+ module.exports = exports["default"];
45328
+ });
45329
+ unwrapExports(tabbable_1);
45330
+
45331
+ var focusManager = createCommonjsModule(function (module, exports) {
45332
+
45333
+ Object.defineProperty(exports, "__esModule", {
45334
+ value: true
45335
+ });
45336
+ exports.resetState = resetState;
45337
+ exports.log = log;
45338
+ exports.handleBlur = handleBlur;
45339
+ exports.handleFocus = handleFocus;
45340
+ exports.markForFocusLater = markForFocusLater;
45341
+ exports.returnFocus = returnFocus;
45342
+ exports.popWithoutFocus = popWithoutFocus;
45343
+ exports.setupScopedFocus = setupScopedFocus;
45344
+ exports.teardownScopedFocus = teardownScopedFocus;
45345
+ var _tabbable2 = _interopRequireDefault(tabbable_1);
45346
+ function _interopRequireDefault(obj) {
45347
+ return obj && obj.__esModule ? obj : {
45348
+ default: obj
45349
+ };
45350
+ }
45351
+ var focusLaterElements = [];
45352
+ var modalElement = null;
45353
+ var needToFocus = false;
45354
+ function resetState() {
45355
+ focusLaterElements = [];
45356
+ }
45357
+ function log() {
45358
+ if (process.env.NODE_ENV !== "production") {
45359
+ console.log("focusManager ----------");
45360
+ focusLaterElements.forEach(function (f) {
45361
+ var check = f || {};
45362
+ console.log(check.nodeName, check.className, check.id);
45363
+ });
45364
+ console.log("end focusManager ----------");
45365
+ }
45366
+ }
45367
+ function handleBlur() {
45368
+ needToFocus = true;
45369
+ }
45370
+ function handleFocus() {
45371
+ if (needToFocus) {
45372
+ needToFocus = false;
45373
+ if (!modalElement) {
45374
+ return;
45375
+ }
45376
+ setTimeout(function () {
45377
+ if (modalElement.contains(document.activeElement)) {
45378
+ return;
45379
+ }
45380
+ var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;
45381
+ el.focus();
45382
+ }, 0);
45383
+ }
45384
+ }
45385
+ function markForFocusLater() {
45386
+ focusLaterElements.push(document.activeElement);
45387
+ }
45388
+ function returnFocus() {
45389
+ var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
45390
+ var toFocus = null;
45391
+ try {
45392
+ if (focusLaterElements.length !== 0) {
45393
+ toFocus = focusLaterElements.pop();
45394
+ toFocus.focus({
45395
+ preventScroll: preventScroll
45396
+ });
45397
+ }
45398
+ return;
45399
+ } catch (e) {
45400
+ console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" "));
45401
+ }
45402
+ }
45403
+ function popWithoutFocus() {
45404
+ focusLaterElements.length > 0 && focusLaterElements.pop();
45405
+ }
45406
+ function setupScopedFocus(element) {
45407
+ modalElement = element;
45408
+ if (window.addEventListener) {
45409
+ window.addEventListener("blur", handleBlur, false);
45410
+ document.addEventListener("focus", handleFocus, true);
45411
+ } else {
45412
+ window.attachEvent("onBlur", handleBlur);
45413
+ document.attachEvent("onFocus", handleFocus);
45414
+ }
45415
+ }
45416
+ function teardownScopedFocus() {
45417
+ modalElement = null;
45418
+ if (window.addEventListener) {
45419
+ window.removeEventListener("blur", handleBlur);
45420
+ document.removeEventListener("focus", handleFocus);
45421
+ } else {
45422
+ window.detachEvent("onBlur", handleBlur);
45423
+ document.detachEvent("onFocus", handleFocus);
45424
+ }
45425
+ }
45426
+ });
45427
+ unwrapExports(focusManager);
45428
+
45429
+ var scopeTab_1 = createCommonjsModule(function (module, exports) {
45430
+
45431
+ Object.defineProperty(exports, "__esModule", {
45432
+ value: true
45433
+ });
45434
+ exports.default = scopeTab;
45435
+ var _tabbable2 = _interopRequireDefault(tabbable_1);
45436
+ function _interopRequireDefault(obj) {
45437
+ return obj && obj.__esModule ? obj : {
45438
+ default: obj
45439
+ };
45440
+ }
45441
+ function getActiveElement() {
45442
+ var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
45443
+ return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;
45444
+ }
45445
+ function scopeTab(node, event) {
45446
+ var tabbable = (0, _tabbable2.default)(node);
45447
+ if (!tabbable.length) {
45448
+ event.preventDefault();
45449
+ return;
45450
+ }
45451
+ var target = void 0;
45452
+ var shiftKey = event.shiftKey;
45453
+ var head = tabbable[0];
45454
+ var tail = tabbable[tabbable.length - 1];
45455
+ var activeElement = getActiveElement();
45456
+ if (node === activeElement) {
45457
+ if (!shiftKey) return;
45458
+ target = tail;
45459
+ }
45460
+ if (tail === activeElement && !shiftKey) {
45461
+ target = head;
45462
+ }
45463
+ if (head === activeElement && shiftKey) {
45464
+ target = tail;
45465
+ }
45466
+ if (target) {
45467
+ event.preventDefault();
45468
+ target.focus();
45469
+ return;
45470
+ }
45471
+ var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);
45472
+ var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
45473
+ if (!isSafariDesktop) return;
45474
+ var x = tabbable.indexOf(activeElement);
45475
+ if (x > -1) {
45476
+ x += shiftKey ? -1 : 1;
45477
+ }
45478
+ target = tabbable[x];
45479
+ if (typeof target === "undefined") {
45480
+ event.preventDefault();
45481
+ target = shiftKey ? tail : head;
45482
+ target.focus();
45483
+ return;
45484
+ }
45485
+ event.preventDefault();
45486
+ target.focus();
45487
+ }
45488
+ module.exports = exports["default"];
45489
+ });
45490
+ unwrapExports(scopeTab_1);
45491
+
45492
+ var __DEV__ = process.env.NODE_ENV !== 'production';
45493
+ var warning = function () {};
45494
+ if (__DEV__) {
45495
+ var printWarning$2 = function printWarning(format, args) {
45496
+ var len = arguments.length;
45497
+ args = new Array(len > 1 ? len - 1 : 0);
45498
+ for (var key = 1; key < len; key++) {
45499
+ args[key - 1] = arguments[key];
45500
+ }
45501
+ var argIndex = 0;
45502
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
45503
+ return args[argIndex++];
45504
+ });
45505
+ if (typeof console !== 'undefined') {
45506
+ console.error(message);
45507
+ }
45508
+ try {
45509
+ throw new Error(message);
45510
+ } catch (x) {}
45511
+ };
45512
+ warning = function (condition, format, args) {
45513
+ var len = arguments.length;
45514
+ args = new Array(len > 2 ? len - 2 : 0);
45515
+ for (var key = 2; key < len; key++) {
45516
+ args[key - 2] = arguments[key];
45517
+ }
45518
+ if (format === undefined) {
45519
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
45520
+ }
45521
+ if (!condition) {
45522
+ printWarning$2.apply(null, [format].concat(args));
45523
+ }
45524
+ };
45525
+ }
45526
+ var warning_1 = warning;
45527
+
45528
+ var exenv = createCommonjsModule(function (module) {
45529
+ (function () {
45530
+
45531
+ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
45532
+ var ExecutionEnvironment = {
45533
+ canUseDOM: canUseDOM,
45534
+ canUseWorkers: typeof Worker !== 'undefined',
45535
+ canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
45536
+ canUseViewport: canUseDOM && !!window.screen
45537
+ };
45538
+ if ( module.exports) {
45539
+ module.exports = ExecutionEnvironment;
45540
+ } else {
45541
+ window.ExecutionEnvironment = ExecutionEnvironment;
45542
+ }
45543
+ })();
45544
+ });
45545
+
45546
+ var safeHTMLElement = createCommonjsModule(function (module, exports) {
45547
+
45548
+ Object.defineProperty(exports, "__esModule", {
45549
+ value: true
45550
+ });
45551
+ exports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;
45552
+ var _exenv2 = _interopRequireDefault(exenv);
45553
+ function _interopRequireDefault(obj) {
45554
+ return obj && obj.__esModule ? obj : {
45555
+ default: obj
45556
+ };
45557
+ }
45558
+ var EE = _exenv2.default;
45559
+ var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
45560
+ var SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
45561
+ var SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};
45562
+ var canUseDOM = exports.canUseDOM = EE.canUseDOM;
45563
+ exports.default = SafeHTMLElement;
45564
+ });
45565
+ unwrapExports(safeHTMLElement);
45566
+
45567
+ var ariaAppHider = createCommonjsModule(function (module, exports) {
45568
+
45569
+ Object.defineProperty(exports, "__esModule", {
45570
+ value: true
45571
+ });
45572
+ exports.resetState = resetState;
45573
+ exports.log = log;
45574
+ exports.assertNodeList = assertNodeList;
45575
+ exports.setElement = setElement;
45576
+ exports.validateElement = validateElement;
45577
+ exports.hide = hide;
45578
+ exports.show = show;
45579
+ exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
45580
+ var _warning2 = _interopRequireDefault(warning_1);
45581
+ function _interopRequireDefault(obj) {
45582
+ return obj && obj.__esModule ? obj : {
45583
+ default: obj
45584
+ };
45585
+ }
45586
+ var globalElement = null;
45587
+ function resetState() {
45588
+ if (globalElement) {
45589
+ if (globalElement.removeAttribute) {
45590
+ globalElement.removeAttribute("aria-hidden");
45591
+ } else if (globalElement.length != null) {
45592
+ globalElement.forEach(function (element) {
45593
+ return element.removeAttribute("aria-hidden");
45594
+ });
45595
+ } else {
45596
+ document.querySelectorAll(globalElement).forEach(function (element) {
45597
+ return element.removeAttribute("aria-hidden");
45598
+ });
45599
+ }
45600
+ }
45601
+ globalElement = null;
45602
+ }
45603
+ function log() {
45604
+ if (process.env.NODE_ENV !== "production") {
45605
+ var check = globalElement || {};
45606
+ console.log("ariaAppHider ----------");
45607
+ console.log(check.nodeName, check.className, check.id);
45608
+ console.log("end ariaAppHider ----------");
45609
+ }
45610
+ }
45611
+ function assertNodeList(nodeList, selector) {
45612
+ if (!nodeList || !nodeList.length) {
45613
+ throw new Error("react-modal: No elements were found for selector " + selector + ".");
45614
+ }
45615
+ }
45616
+ function setElement(element) {
45617
+ var useElement = element;
45618
+ if (typeof useElement === "string" && safeHTMLElement.canUseDOM) {
45619
+ var el = document.querySelectorAll(useElement);
45620
+ assertNodeList(el, useElement);
45621
+ useElement = el;
45622
+ }
45623
+ globalElement = useElement || globalElement;
45624
+ return globalElement;
45625
+ }
45626
+ function validateElement(appElement) {
45627
+ var el = appElement || globalElement;
45628
+ if (el) {
45629
+ return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];
45630
+ } else {
45631
+ (0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" "));
45632
+ return [];
45633
+ }
45634
+ }
45635
+ function hide(appElement) {
45636
+ var _iteratorNormalCompletion = true;
45637
+ var _didIteratorError = false;
45638
+ var _iteratorError = undefined;
45639
+ try {
45640
+ for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
45641
+ var el = _step.value;
45642
+ el.setAttribute("aria-hidden", "true");
45643
+ }
45644
+ } catch (err) {
45645
+ _didIteratorError = true;
45646
+ _iteratorError = err;
45647
+ } finally {
45648
+ try {
45649
+ if (!_iteratorNormalCompletion && _iterator.return) {
45650
+ _iterator.return();
45651
+ }
45652
+ } finally {
45653
+ if (_didIteratorError) {
45654
+ throw _iteratorError;
45655
+ }
45656
+ }
45657
+ }
45658
+ }
45659
+ function show(appElement) {
45660
+ var _iteratorNormalCompletion2 = true;
45661
+ var _didIteratorError2 = false;
45662
+ var _iteratorError2 = undefined;
45663
+ try {
45664
+ for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
45665
+ var el = _step2.value;
45666
+ el.removeAttribute("aria-hidden");
45667
+ }
45668
+ } catch (err) {
45669
+ _didIteratorError2 = true;
45670
+ _iteratorError2 = err;
45671
+ } finally {
45672
+ try {
45673
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
45674
+ _iterator2.return();
45675
+ }
45676
+ } finally {
45677
+ if (_didIteratorError2) {
45678
+ throw _iteratorError2;
45679
+ }
45680
+ }
45681
+ }
45682
+ }
45683
+ function documentNotReadyOrSSRTesting() {
45684
+ globalElement = null;
45685
+ }
45686
+ });
45687
+ unwrapExports(ariaAppHider);
45688
+
45689
+ var classList = createCommonjsModule(function (module, exports) {
45690
+
45691
+ Object.defineProperty(exports, "__esModule", {
45692
+ value: true
45693
+ });
45694
+ exports.resetState = resetState;
45695
+ exports.log = log;
45696
+ var htmlClassList = {};
45697
+ var docBodyClassList = {};
45698
+ function removeClass(at, cls) {
45699
+ at.classList.remove(cls);
45700
+ }
45701
+ function resetState() {
45702
+ var htmlElement = document.getElementsByTagName("html")[0];
45703
+ for (var cls in htmlClassList) {
45704
+ removeClass(htmlElement, htmlClassList[cls]);
45705
+ }
45706
+ var body = document.body;
45707
+ for (var _cls in docBodyClassList) {
45708
+ removeClass(body, docBodyClassList[_cls]);
45709
+ }
45710
+ htmlClassList = {};
45711
+ docBodyClassList = {};
45712
+ }
45713
+ function log() {
45714
+ if (process.env.NODE_ENV !== "production") {
45715
+ var classes = document.getElementsByTagName("html")[0].className;
45716
+ var buffer = "Show tracked classes:\n\n";
45717
+ buffer += "<html /> (" + classes + "):\n ";
45718
+ for (var x in htmlClassList) {
45719
+ buffer += " " + x + " " + htmlClassList[x] + "\n ";
45720
+ }
45721
+ classes = document.body.className;
45722
+ buffer += "\n\ndoc.body (" + classes + "):\n ";
45723
+ for (var _x in docBodyClassList) {
45724
+ buffer += " " + _x + " " + docBodyClassList[_x] + "\n ";
45725
+ }
45726
+ buffer += "\n";
45727
+ console.log(buffer);
45728
+ }
45729
+ }
45730
+ var incrementReference = function incrementReference(poll, className) {
45731
+ if (!poll[className]) {
45732
+ poll[className] = 0;
45733
+ }
45734
+ poll[className] += 1;
45735
+ return className;
45736
+ };
45737
+ var decrementReference = function decrementReference(poll, className) {
45738
+ if (poll[className]) {
45739
+ poll[className] -= 1;
45740
+ }
45741
+ return className;
45742
+ };
45743
+ var trackClass = function trackClass(classListRef, poll, classes) {
45744
+ classes.forEach(function (className) {
45745
+ incrementReference(poll, className);
45746
+ classListRef.add(className);
45747
+ });
45748
+ };
45749
+ var untrackClass = function untrackClass(classListRef, poll, classes) {
45750
+ classes.forEach(function (className) {
45751
+ decrementReference(poll, className);
45752
+ poll[className] === 0 && classListRef.remove(className);
45753
+ });
45754
+ };
45755
+ var add = exports.add = function add(element, classString) {
45756
+ return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
45757
+ };
45758
+ var remove = exports.remove = function remove(element, classString) {
45759
+ return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
45760
+ };
45761
+ });
45762
+ unwrapExports(classList);
45763
+
45764
+ var portalOpenInstances_1 = createCommonjsModule(function (module, exports) {
45765
+
45766
+ Object.defineProperty(exports, "__esModule", {
45767
+ value: true
45768
+ });
45769
+ exports.log = log;
45770
+ exports.resetState = resetState;
45771
+ function _classCallCheck(instance, Constructor) {
45772
+ if (!(instance instanceof Constructor)) {
45773
+ throw new TypeError("Cannot call a class as a function");
45774
+ }
45775
+ }
45776
+ var PortalOpenInstances = function PortalOpenInstances() {
45777
+ var _this = this;
45778
+ _classCallCheck(this, PortalOpenInstances);
45779
+ this.register = function (openInstance) {
45780
+ if (_this.openInstances.indexOf(openInstance) !== -1) {
45781
+ if (process.env.NODE_ENV !== "production") {
45782
+ console.warn("React-Modal: Cannot register modal instance that's already open");
45783
+ }
45784
+ return;
45785
+ }
45786
+ _this.openInstances.push(openInstance);
45787
+ _this.emit("register");
45788
+ };
45789
+ this.deregister = function (openInstance) {
45790
+ var index = _this.openInstances.indexOf(openInstance);
45791
+ if (index === -1) {
45792
+ if (process.env.NODE_ENV !== "production") {
45793
+ console.warn("React-Modal: Unable to deregister " + openInstance + " as " + "it was never registered");
45794
+ }
45795
+ return;
45796
+ }
45797
+ _this.openInstances.splice(index, 1);
45798
+ _this.emit("deregister");
45799
+ };
45800
+ this.subscribe = function (callback) {
45801
+ _this.subscribers.push(callback);
45802
+ };
45803
+ this.emit = function (eventType) {
45804
+ _this.subscribers.forEach(function (subscriber) {
45805
+ return subscriber(eventType, _this.openInstances.slice());
45806
+ });
45807
+ };
45808
+ this.openInstances = [];
45809
+ this.subscribers = [];
45810
+ };
45811
+ var portalOpenInstances = new PortalOpenInstances();
45812
+ function log() {
45813
+ console.log("portalOpenInstances ----------");
45814
+ console.log(portalOpenInstances.openInstances.length);
45815
+ portalOpenInstances.openInstances.forEach(function (p) {
45816
+ return console.log(p);
45817
+ });
45818
+ console.log("end portalOpenInstances ----------");
45819
+ }
45820
+ function resetState() {
45821
+ portalOpenInstances = new PortalOpenInstances();
45822
+ }
45823
+ exports.default = portalOpenInstances;
45824
+ });
45825
+ unwrapExports(portalOpenInstances_1);
45826
+
45827
+ var bodyTrap_1 = createCommonjsModule(function (module, exports) {
45828
+
45829
+ Object.defineProperty(exports, "__esModule", {
45830
+ value: true
45831
+ });
45832
+ exports.resetState = resetState;
45833
+ exports.log = log;
45834
+ var _portalOpenInstances2 = _interopRequireDefault(portalOpenInstances_1);
45835
+ function _interopRequireDefault(obj) {
45836
+ return obj && obj.__esModule ? obj : {
45837
+ default: obj
45838
+ };
45839
+ }
45840
+ var before = void 0,
45841
+ after = void 0,
45842
+ instances = [];
45843
+ function resetState() {
45844
+ var _arr = [before, after];
45845
+ for (var _i = 0; _i < _arr.length; _i++) {
45846
+ var item = _arr[_i];
45847
+ if (!item) continue;
45848
+ item.parentNode && item.parentNode.removeChild(item);
45849
+ }
45850
+ before = after = null;
45851
+ instances = [];
45852
+ }
45853
+ function log() {
45854
+ console.log("bodyTrap ----------");
45855
+ console.log(instances.length);
45856
+ var _arr2 = [before, after];
45857
+ for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
45858
+ var item = _arr2[_i2];
45859
+ var check = item || {};
45860
+ console.log(check.nodeName, check.className, check.id);
45861
+ }
45862
+ console.log("edn bodyTrap ----------");
45863
+ }
45864
+ function focusContent() {
45865
+ if (instances.length === 0) {
45866
+ if (process.env.NODE_ENV !== "production") {
45867
+ console.warn("React-Modal: Open instances > 0 expected");
45868
+ }
45869
+ return;
45870
+ }
45871
+ instances[instances.length - 1].focusContent();
45872
+ }
45873
+ function bodyTrap(eventType, openInstances) {
45874
+ if (!before && !after) {
45875
+ before = document.createElement("div");
45876
+ before.setAttribute("data-react-modal-body-trap", "");
45877
+ before.style.position = "absolute";
45878
+ before.style.opacity = "0";
45879
+ before.setAttribute("tabindex", "0");
45880
+ before.addEventListener("focus", focusContent);
45881
+ after = before.cloneNode();
45882
+ after.addEventListener("focus", focusContent);
45883
+ }
45884
+ instances = openInstances;
45885
+ if (instances.length > 0) {
45886
+ if (document.body.firstChild !== before) {
45887
+ document.body.insertBefore(before, document.body.firstChild);
45888
+ }
45889
+ if (document.body.lastChild !== after) {
45890
+ document.body.appendChild(after);
45891
+ }
45892
+ } else {
45893
+ if (before.parentElement) {
45894
+ before.parentElement.removeChild(before);
45895
+ }
45896
+ if (after.parentElement) {
45897
+ after.parentElement.removeChild(after);
45898
+ }
45899
+ }
45900
+ }
45901
+ _portalOpenInstances2.default.subscribe(bodyTrap);
45902
+ });
45903
+ unwrapExports(bodyTrap_1);
45904
+
45905
+ var ModalPortal_1 = createCommonjsModule(function (module, exports) {
45906
+
45907
+ Object.defineProperty(exports, "__esModule", {
45908
+ value: true
45909
+ });
45910
+ var _extends = Object.assign || function (target) {
45911
+ for (var i = 1; i < arguments.length; i++) {
45912
+ var source = arguments[i];
45913
+ for (var key in source) {
45914
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
45915
+ target[key] = source[key];
45916
+ }
45917
+ }
45918
+ }
45919
+ return target;
45920
+ };
45921
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
45922
+ return typeof obj;
45923
+ } : function (obj) {
45924
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
45925
+ };
45926
+ var _createClass = function () {
45927
+ function defineProperties(target, props) {
45928
+ for (var i = 0; i < props.length; i++) {
45929
+ var descriptor = props[i];
45930
+ descriptor.enumerable = descriptor.enumerable || false;
45931
+ descriptor.configurable = true;
45932
+ if ("value" in descriptor) descriptor.writable = true;
45933
+ Object.defineProperty(target, descriptor.key, descriptor);
45934
+ }
45935
+ }
45936
+ return function (Constructor, protoProps, staticProps) {
45937
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
45938
+ if (staticProps) defineProperties(Constructor, staticProps);
45939
+ return Constructor;
45940
+ };
45941
+ }();
45942
+ var _propTypes2 = _interopRequireDefault(propTypes);
45943
+ var focusManager$1 = _interopRequireWildcard(focusManager);
45944
+ var _scopeTab2 = _interopRequireDefault(scopeTab_1);
45945
+ var ariaAppHider$1 = _interopRequireWildcard(ariaAppHider);
45946
+ var classList$1 = _interopRequireWildcard(classList);
45947
+ var _safeHTMLElement2 = _interopRequireDefault(safeHTMLElement);
45948
+ var _portalOpenInstances2 = _interopRequireDefault(portalOpenInstances_1);
45949
+ function _interopRequireWildcard(obj) {
45950
+ if (obj && obj.__esModule) {
45951
+ return obj;
45952
+ } else {
45953
+ var newObj = {};
45954
+ if (obj != null) {
45955
+ for (var key in obj) {
45956
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
45957
+ }
45958
+ }
45959
+ newObj.default = obj;
45960
+ return newObj;
45961
+ }
45962
+ }
45963
+ function _interopRequireDefault(obj) {
45964
+ return obj && obj.__esModule ? obj : {
45965
+ default: obj
45966
+ };
45967
+ }
45968
+ function _classCallCheck(instance, Constructor) {
45969
+ if (!(instance instanceof Constructor)) {
45970
+ throw new TypeError("Cannot call a class as a function");
45971
+ }
45972
+ }
45973
+ function _possibleConstructorReturn(self, call) {
45974
+ if (!self) {
45975
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
45976
+ }
45977
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
45978
+ }
45979
+ function _inherits(subClass, superClass) {
45980
+ if (typeof superClass !== "function" && superClass !== null) {
45981
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
45982
+ }
45983
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
45984
+ constructor: {
45985
+ value: subClass,
45986
+ enumerable: false,
45987
+ writable: true,
45988
+ configurable: true
45989
+ }
45990
+ });
45991
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
45992
+ }
45993
+ var CLASS_NAMES = {
45994
+ overlay: "ReactModal__Overlay",
45995
+ content: "ReactModal__Content"
45996
+ };
45997
+ var isTabKey = function isTabKey(event) {
45998
+ return event.code === "Tab" || event.keyCode === 9;
45999
+ };
46000
+ var isEscKey = function isEscKey(event) {
46001
+ return event.code === "Escape" || event.keyCode === 27;
46002
+ };
46003
+ var ariaHiddenInstances = 0;
46004
+ var ModalPortal = function (_Component) {
46005
+ _inherits(ModalPortal, _Component);
46006
+ function ModalPortal(props) {
46007
+ _classCallCheck(this, ModalPortal);
46008
+ var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));
46009
+ _this.setOverlayRef = function (overlay) {
46010
+ _this.overlay = overlay;
46011
+ _this.props.overlayRef && _this.props.overlayRef(overlay);
46012
+ };
46013
+ _this.setContentRef = function (content) {
46014
+ _this.content = content;
46015
+ _this.props.contentRef && _this.props.contentRef(content);
46016
+ };
46017
+ _this.afterClose = function () {
46018
+ var _this$props = _this.props,
46019
+ appElement = _this$props.appElement,
46020
+ ariaHideApp = _this$props.ariaHideApp,
46021
+ htmlOpenClassName = _this$props.htmlOpenClassName,
46022
+ bodyOpenClassName = _this$props.bodyOpenClassName,
46023
+ parentSelector = _this$props.parentSelector;
46024
+ var parentDocument = parentSelector && parentSelector().ownerDocument || document;
46025
+ bodyOpenClassName && classList$1.remove(parentDocument.body, bodyOpenClassName);
46026
+ htmlOpenClassName && classList$1.remove(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
46027
+ if (ariaHideApp && ariaHiddenInstances > 0) {
46028
+ ariaHiddenInstances -= 1;
46029
+ if (ariaHiddenInstances === 0) {
46030
+ ariaAppHider$1.show(appElement);
46031
+ }
46032
+ }
46033
+ if (_this.props.shouldFocusAfterRender) {
46034
+ if (_this.props.shouldReturnFocusAfterClose) {
46035
+ focusManager$1.returnFocus(_this.props.preventScroll);
46036
+ focusManager$1.teardownScopedFocus();
46037
+ } else {
46038
+ focusManager$1.popWithoutFocus();
46039
+ }
46040
+ }
46041
+ if (_this.props.onAfterClose) {
46042
+ _this.props.onAfterClose();
46043
+ }
46044
+ _portalOpenInstances2.default.deregister(_this);
46045
+ };
46046
+ _this.open = function () {
46047
+ _this.beforeOpen();
46048
+ if (_this.state.afterOpen && _this.state.beforeClose) {
46049
+ clearTimeout(_this.closeTimer);
46050
+ _this.setState({
46051
+ beforeClose: false
46052
+ });
46053
+ } else {
46054
+ if (_this.props.shouldFocusAfterRender) {
46055
+ focusManager$1.setupScopedFocus(_this.node);
46056
+ focusManager$1.markForFocusLater();
46057
+ }
46058
+ _this.setState({
46059
+ isOpen: true
46060
+ }, function () {
46061
+ _this.openAnimationFrame = requestAnimationFrame(function () {
46062
+ _this.setState({
46063
+ afterOpen: true
46064
+ });
46065
+ if (_this.props.isOpen && _this.props.onAfterOpen) {
46066
+ _this.props.onAfterOpen({
46067
+ overlayEl: _this.overlay,
46068
+ contentEl: _this.content
46069
+ });
46070
+ }
46071
+ });
46072
+ });
46073
+ }
46074
+ };
46075
+ _this.close = function () {
46076
+ if (_this.props.closeTimeoutMS > 0) {
46077
+ _this.closeWithTimeout();
46078
+ } else {
46079
+ _this.closeWithoutTimeout();
46080
+ }
46081
+ };
46082
+ _this.focusContent = function () {
46083
+ return _this.content && !_this.contentHasFocus() && _this.content.focus({
46084
+ preventScroll: true
46085
+ });
46086
+ };
46087
+ _this.closeWithTimeout = function () {
46088
+ var closesAt = Date.now() + _this.props.closeTimeoutMS;
46089
+ _this.setState({
46090
+ beforeClose: true,
46091
+ closesAt: closesAt
46092
+ }, function () {
46093
+ _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());
46094
+ });
46095
+ };
46096
+ _this.closeWithoutTimeout = function () {
46097
+ _this.setState({
46098
+ beforeClose: false,
46099
+ isOpen: false,
46100
+ afterOpen: false,
46101
+ closesAt: null
46102
+ }, _this.afterClose);
46103
+ };
46104
+ _this.handleKeyDown = function (event) {
46105
+ if (isTabKey(event)) {
46106
+ (0, _scopeTab2.default)(_this.content, event);
46107
+ }
46108
+ if (_this.props.shouldCloseOnEsc && isEscKey(event)) {
46109
+ event.stopPropagation();
46110
+ _this.requestClose(event);
46111
+ }
46112
+ };
46113
+ _this.handleOverlayOnClick = function (event) {
46114
+ if (_this.shouldClose === null) {
46115
+ _this.shouldClose = true;
46116
+ }
46117
+ if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {
46118
+ if (_this.ownerHandlesClose()) {
46119
+ _this.requestClose(event);
46120
+ } else {
46121
+ _this.focusContent();
46122
+ }
46123
+ }
46124
+ _this.shouldClose = null;
46125
+ };
46126
+ _this.handleContentOnMouseUp = function () {
46127
+ _this.shouldClose = false;
46128
+ };
46129
+ _this.handleOverlayOnMouseDown = function (event) {
46130
+ if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {
46131
+ event.preventDefault();
46132
+ }
46133
+ };
46134
+ _this.handleContentOnClick = function () {
46135
+ _this.shouldClose = false;
46136
+ };
46137
+ _this.handleContentOnMouseDown = function () {
46138
+ _this.shouldClose = false;
46139
+ };
46140
+ _this.requestClose = function (event) {
46141
+ return _this.ownerHandlesClose() && _this.props.onRequestClose(event);
46142
+ };
46143
+ _this.ownerHandlesClose = function () {
46144
+ return _this.props.onRequestClose;
46145
+ };
46146
+ _this.shouldBeClosed = function () {
46147
+ return !_this.state.isOpen && !_this.state.beforeClose;
46148
+ };
46149
+ _this.contentHasFocus = function () {
46150
+ return document.activeElement === _this.content || _this.content.contains(document.activeElement);
46151
+ };
46152
+ _this.buildClassName = function (which, additional) {
46153
+ var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : {
46154
+ base: CLASS_NAMES[which],
46155
+ afterOpen: CLASS_NAMES[which] + "--after-open",
46156
+ beforeClose: CLASS_NAMES[which] + "--before-close"
46157
+ };
46158
+ var className = classNames.base;
46159
+ if (_this.state.afterOpen) {
46160
+ className = className + " " + classNames.afterOpen;
46161
+ }
46162
+ if (_this.state.beforeClose) {
46163
+ className = className + " " + classNames.beforeClose;
46164
+ }
46165
+ return typeof additional === "string" && additional ? className + " " + additional : className;
46166
+ };
46167
+ _this.attributesFromObject = function (prefix, items) {
46168
+ return Object.keys(items).reduce(function (acc, name) {
46169
+ acc[prefix + "-" + name] = items[name];
46170
+ return acc;
46171
+ }, {});
46172
+ };
46173
+ _this.state = {
46174
+ afterOpen: false,
46175
+ beforeClose: false
46176
+ };
46177
+ _this.shouldClose = null;
46178
+ _this.moveFromContentToOverlay = null;
46179
+ return _this;
46180
+ }
46181
+ _createClass(ModalPortal, [{
46182
+ key: "componentDidMount",
46183
+ value: function componentDidMount() {
46184
+ if (this.props.isOpen) {
46185
+ this.open();
46186
+ }
46187
+ }
46188
+ }, {
46189
+ key: "componentDidUpdate",
46190
+ value: function componentDidUpdate(prevProps, prevState) {
46191
+ if (process.env.NODE_ENV !== "production") {
46192
+ if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {
46193
+ console.warn('React-Modal: "bodyOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
46194
+ }
46195
+ if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {
46196
+ console.warn('React-Modal: "htmlOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
46197
+ }
46198
+ }
46199
+ if (this.props.isOpen && !prevProps.isOpen) {
46200
+ this.open();
46201
+ } else if (!this.props.isOpen && prevProps.isOpen) {
46202
+ this.close();
46203
+ }
46204
+ if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {
46205
+ this.focusContent();
46206
+ }
46207
+ }
46208
+ }, {
46209
+ key: "componentWillUnmount",
46210
+ value: function componentWillUnmount() {
46211
+ if (this.state.isOpen) {
46212
+ this.afterClose();
46213
+ }
46214
+ clearTimeout(this.closeTimer);
46215
+ cancelAnimationFrame(this.openAnimationFrame);
46216
+ }
46217
+ }, {
46218
+ key: "beforeOpen",
46219
+ value: function beforeOpen() {
46220
+ var _props = this.props,
46221
+ appElement = _props.appElement,
46222
+ ariaHideApp = _props.ariaHideApp,
46223
+ htmlOpenClassName = _props.htmlOpenClassName,
46224
+ bodyOpenClassName = _props.bodyOpenClassName,
46225
+ parentSelector = _props.parentSelector;
46226
+ var parentDocument = parentSelector && parentSelector().ownerDocument || document;
46227
+ bodyOpenClassName && classList$1.add(parentDocument.body, bodyOpenClassName);
46228
+ htmlOpenClassName && classList$1.add(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
46229
+ if (ariaHideApp) {
46230
+ ariaHiddenInstances += 1;
46231
+ ariaAppHider$1.hide(appElement);
46232
+ }
46233
+ _portalOpenInstances2.default.register(this);
46234
+ }
46235
+ }, {
46236
+ key: "render",
46237
+ value: function render() {
46238
+ var _props2 = this.props,
46239
+ id = _props2.id,
46240
+ className = _props2.className,
46241
+ overlayClassName = _props2.overlayClassName,
46242
+ defaultStyles = _props2.defaultStyles,
46243
+ children = _props2.children;
46244
+ var contentStyles = className ? {} : defaultStyles.content;
46245
+ var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;
46246
+ if (this.shouldBeClosed()) {
46247
+ return null;
46248
+ }
46249
+ var overlayProps = {
46250
+ ref: this.setOverlayRef,
46251
+ className: this.buildClassName("overlay", overlayClassName),
46252
+ style: _extends({}, overlayStyles, this.props.style.overlay),
46253
+ onClick: this.handleOverlayOnClick,
46254
+ onMouseDown: this.handleOverlayOnMouseDown
46255
+ };
46256
+ var contentProps = _extends({
46257
+ id: id,
46258
+ ref: this.setContentRef,
46259
+ style: _extends({}, contentStyles, this.props.style.content),
46260
+ className: this.buildClassName("content", className),
46261
+ tabIndex: "-1",
46262
+ onKeyDown: this.handleKeyDown,
46263
+ onMouseDown: this.handleContentOnMouseDown,
46264
+ onMouseUp: this.handleContentOnMouseUp,
46265
+ onClick: this.handleContentOnClick,
46266
+ role: this.props.role,
46267
+ "aria-label": this.props.contentLabel
46268
+ }, this.attributesFromObject("aria", _extends({
46269
+ modal: true
46270
+ }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
46271
+ "data-testid": this.props.testId
46272
+ });
46273
+ var contentElement = this.props.contentElement(contentProps, children);
46274
+ return this.props.overlayElement(overlayProps, contentElement);
46275
+ }
46276
+ }]);
46277
+ return ModalPortal;
46278
+ }(React.Component);
46279
+ ModalPortal.defaultProps = {
46280
+ style: {
46281
+ overlay: {},
46282
+ content: {}
46283
+ },
46284
+ defaultStyles: {}
46285
+ };
46286
+ ModalPortal.propTypes = {
46287
+ isOpen: _propTypes2.default.bool.isRequired,
46288
+ defaultStyles: _propTypes2.default.shape({
46289
+ content: _propTypes2.default.object,
46290
+ overlay: _propTypes2.default.object
46291
+ }),
46292
+ style: _propTypes2.default.shape({
46293
+ content: _propTypes2.default.object,
46294
+ overlay: _propTypes2.default.object
46295
+ }),
46296
+ className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
46297
+ overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
46298
+ parentSelector: _propTypes2.default.func,
46299
+ bodyOpenClassName: _propTypes2.default.string,
46300
+ htmlOpenClassName: _propTypes2.default.string,
46301
+ ariaHideApp: _propTypes2.default.bool,
46302
+ appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
46303
+ onAfterOpen: _propTypes2.default.func,
46304
+ onAfterClose: _propTypes2.default.func,
46305
+ onRequestClose: _propTypes2.default.func,
46306
+ closeTimeoutMS: _propTypes2.default.number,
46307
+ shouldFocusAfterRender: _propTypes2.default.bool,
46308
+ shouldCloseOnOverlayClick: _propTypes2.default.bool,
46309
+ shouldReturnFocusAfterClose: _propTypes2.default.bool,
46310
+ preventScroll: _propTypes2.default.bool,
46311
+ role: _propTypes2.default.string,
46312
+ contentLabel: _propTypes2.default.string,
46313
+ aria: _propTypes2.default.object,
46314
+ data: _propTypes2.default.object,
46315
+ children: _propTypes2.default.node,
46316
+ shouldCloseOnEsc: _propTypes2.default.bool,
46317
+ overlayRef: _propTypes2.default.func,
46318
+ contentRef: _propTypes2.default.func,
46319
+ id: _propTypes2.default.string,
46320
+ overlayElement: _propTypes2.default.func,
46321
+ contentElement: _propTypes2.default.func,
46322
+ testId: _propTypes2.default.string
46323
+ };
46324
+ exports.default = ModalPortal;
46325
+ module.exports = exports["default"];
46326
+ });
46327
+ unwrapExports(ModalPortal_1);
46328
+
46329
+ function componentWillMount() {
46330
+ var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
46331
+ if (state !== null && state !== undefined) {
46332
+ this.setState(state);
46333
+ }
46334
+ }
46335
+ function componentWillReceiveProps(nextProps) {
46336
+ function updater(prevState) {
46337
+ var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
46338
+ return state !== null && state !== undefined ? state : null;
46339
+ }
46340
+ this.setState(updater.bind(this));
46341
+ }
46342
+ function componentWillUpdate(nextProps, nextState) {
46343
+ try {
46344
+ var prevProps = this.props;
46345
+ var prevState = this.state;
46346
+ this.props = nextProps;
46347
+ this.state = nextState;
46348
+ this.__reactInternalSnapshotFlag = true;
46349
+ this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
46350
+ } finally {
46351
+ this.props = prevProps;
46352
+ this.state = prevState;
46353
+ }
46354
+ }
46355
+ componentWillMount.__suppressDeprecationWarning = true;
46356
+ componentWillReceiveProps.__suppressDeprecationWarning = true;
46357
+ componentWillUpdate.__suppressDeprecationWarning = true;
46358
+ function polyfill(Component) {
46359
+ var prototype = Component.prototype;
46360
+ if (!prototype || !prototype.isReactComponent) {
46361
+ throw new Error('Can only polyfill class components');
46362
+ }
46363
+ if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
46364
+ return Component;
46365
+ }
46366
+ var foundWillMountName = null;
46367
+ var foundWillReceivePropsName = null;
46368
+ var foundWillUpdateName = null;
46369
+ if (typeof prototype.componentWillMount === 'function') {
46370
+ foundWillMountName = 'componentWillMount';
46371
+ } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
46372
+ foundWillMountName = 'UNSAFE_componentWillMount';
46373
+ }
46374
+ if (typeof prototype.componentWillReceiveProps === 'function') {
46375
+ foundWillReceivePropsName = 'componentWillReceiveProps';
46376
+ } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
46377
+ foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
46378
+ }
46379
+ if (typeof prototype.componentWillUpdate === 'function') {
46380
+ foundWillUpdateName = 'componentWillUpdate';
46381
+ } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
46382
+ foundWillUpdateName = 'UNSAFE_componentWillUpdate';
46383
+ }
46384
+ if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
46385
+ var componentName = Component.displayName || Component.name;
46386
+ var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
46387
+ throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
46388
+ }
46389
+ if (typeof Component.getDerivedStateFromProps === 'function') {
46390
+ prototype.componentWillMount = componentWillMount;
46391
+ prototype.componentWillReceiveProps = componentWillReceiveProps;
46392
+ }
46393
+ if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
46394
+ if (typeof prototype.componentDidUpdate !== 'function') {
46395
+ throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
46396
+ }
46397
+ prototype.componentWillUpdate = componentWillUpdate;
46398
+ var componentDidUpdate = prototype.componentDidUpdate;
46399
+ prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
46400
+ var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
46401
+ componentDidUpdate.call(this, prevProps, prevState, snapshot);
46402
+ };
46403
+ }
46404
+ return Component;
46405
+ }
46406
+
46407
+ var reactLifecyclesCompat_es = {
46408
+ __proto__: null,
46409
+ polyfill: polyfill
46410
+ };
46411
+
46412
+ var Modal_1 = createCommonjsModule(function (module, exports) {
46413
+
46414
+ Object.defineProperty(exports, "__esModule", {
46415
+ value: true
46416
+ });
46417
+ exports.bodyOpenClassName = exports.portalClassName = undefined;
46418
+ var _extends = Object.assign || function (target) {
46419
+ for (var i = 1; i < arguments.length; i++) {
46420
+ var source = arguments[i];
46421
+ for (var key in source) {
46422
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
46423
+ target[key] = source[key];
46424
+ }
46425
+ }
46426
+ }
46427
+ return target;
46428
+ };
46429
+ var _createClass = function () {
46430
+ function defineProperties(target, props) {
46431
+ for (var i = 0; i < props.length; i++) {
46432
+ var descriptor = props[i];
46433
+ descriptor.enumerable = descriptor.enumerable || false;
46434
+ descriptor.configurable = true;
46435
+ if ("value" in descriptor) descriptor.writable = true;
46436
+ Object.defineProperty(target, descriptor.key, descriptor);
46437
+ }
46438
+ }
46439
+ return function (Constructor, protoProps, staticProps) {
46440
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
46441
+ if (staticProps) defineProperties(Constructor, staticProps);
46442
+ return Constructor;
46443
+ };
46444
+ }();
46445
+ var _react2 = _interopRequireDefault(React);
46446
+ var _reactDom2 = _interopRequireDefault(reactDom);
46447
+ var _propTypes2 = _interopRequireDefault(propTypes);
46448
+ var _ModalPortal2 = _interopRequireDefault(ModalPortal_1);
46449
+ var ariaAppHider$1 = _interopRequireWildcard(ariaAppHider);
46450
+ var _safeHTMLElement2 = _interopRequireDefault(safeHTMLElement);
46451
+ function _interopRequireWildcard(obj) {
46452
+ if (obj && obj.__esModule) {
46453
+ return obj;
46454
+ } else {
46455
+ var newObj = {};
46456
+ if (obj != null) {
46457
+ for (var key in obj) {
46458
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
46459
+ }
46460
+ }
46461
+ newObj.default = obj;
46462
+ return newObj;
46463
+ }
46464
+ }
46465
+ function _interopRequireDefault(obj) {
46466
+ return obj && obj.__esModule ? obj : {
46467
+ default: obj
46468
+ };
46469
+ }
46470
+ function _classCallCheck(instance, Constructor) {
46471
+ if (!(instance instanceof Constructor)) {
46472
+ throw new TypeError("Cannot call a class as a function");
46473
+ }
46474
+ }
46475
+ function _possibleConstructorReturn(self, call) {
46476
+ if (!self) {
46477
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
46478
+ }
46479
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
46480
+ }
46481
+ function _inherits(subClass, superClass) {
46482
+ if (typeof superClass !== "function" && superClass !== null) {
46483
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
46484
+ }
46485
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
46486
+ constructor: {
46487
+ value: subClass,
46488
+ enumerable: false,
46489
+ writable: true,
46490
+ configurable: true
46491
+ }
46492
+ });
46493
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
46494
+ }
46495
+ var portalClassName = exports.portalClassName = "ReactModalPortal";
46496
+ var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open";
46497
+ var isReact16 = safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;
46498
+ var createHTMLElement = function createHTMLElement(name) {
46499
+ return document.createElement(name);
46500
+ };
46501
+ var getCreatePortal = function getCreatePortal() {
46502
+ return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;
46503
+ };
46504
+ function getParentElement(parentSelector) {
46505
+ return parentSelector();
46506
+ }
46507
+ var Modal = function (_Component) {
46508
+ _inherits(Modal, _Component);
46509
+ function Modal() {
46510
+ var _ref;
46511
+ var _temp, _this, _ret;
46512
+ _classCallCheck(this, Modal);
46513
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
46514
+ args[_key] = arguments[_key];
46515
+ }
46516
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {
46517
+ !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);
46518
+ var parent = getParentElement(_this.props.parentSelector);
46519
+ if (parent && parent.contains(_this.node)) {
46520
+ parent.removeChild(_this.node);
46521
+ } else {
46522
+ console.warn('React-Modal: "parentSelector" prop did not returned any DOM ' + "element. Make sure that the parent element is unmounted to " + "avoid any memory leaks.");
46523
+ }
46524
+ }, _this.portalRef = function (ref) {
46525
+ _this.portal = ref;
46526
+ }, _this.renderPortal = function (props) {
46527
+ var createPortal = getCreatePortal();
46528
+ var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({
46529
+ defaultStyles: Modal.defaultStyles
46530
+ }, props)), _this.node);
46531
+ _this.portalRef(portal);
46532
+ }, _temp), _possibleConstructorReturn(_this, _ret);
46533
+ }
46534
+ _createClass(Modal, [{
46535
+ key: "componentDidMount",
46536
+ value: function componentDidMount() {
46537
+ if (!safeHTMLElement.canUseDOM) return;
46538
+ if (!isReact16) {
46539
+ this.node = createHTMLElement("div");
46540
+ }
46541
+ this.node.className = this.props.portalClassName;
46542
+ var parent = getParentElement(this.props.parentSelector);
46543
+ parent.appendChild(this.node);
46544
+ !isReact16 && this.renderPortal(this.props);
46545
+ }
46546
+ }, {
46547
+ key: "getSnapshotBeforeUpdate",
46548
+ value: function getSnapshotBeforeUpdate(prevProps) {
46549
+ var prevParent = getParentElement(prevProps.parentSelector);
46550
+ var nextParent = getParentElement(this.props.parentSelector);
46551
+ return {
46552
+ prevParent: prevParent,
46553
+ nextParent: nextParent
46554
+ };
46555
+ }
46556
+ }, {
46557
+ key: "componentDidUpdate",
46558
+ value: function componentDidUpdate(prevProps, _, snapshot) {
46559
+ if (!safeHTMLElement.canUseDOM) return;
46560
+ var _props = this.props,
46561
+ isOpen = _props.isOpen,
46562
+ portalClassName = _props.portalClassName;
46563
+ if (prevProps.portalClassName !== portalClassName) {
46564
+ this.node.className = portalClassName;
46565
+ }
46566
+ var prevParent = snapshot.prevParent,
46567
+ nextParent = snapshot.nextParent;
46568
+ if (nextParent !== prevParent) {
46569
+ prevParent.removeChild(this.node);
46570
+ nextParent.appendChild(this.node);
46571
+ }
46572
+ if (!prevProps.isOpen && !isOpen) return;
46573
+ !isReact16 && this.renderPortal(this.props);
46574
+ }
46575
+ }, {
46576
+ key: "componentWillUnmount",
46577
+ value: function componentWillUnmount() {
46578
+ if (!safeHTMLElement.canUseDOM || !this.node || !this.portal) return;
46579
+ var state = this.portal.state;
46580
+ var now = Date.now();
46581
+ var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);
46582
+ if (closesAt) {
46583
+ if (!state.beforeClose) {
46584
+ this.portal.closeWithTimeout();
46585
+ }
46586
+ setTimeout(this.removePortal, closesAt - now);
46587
+ } else {
46588
+ this.removePortal();
46589
+ }
46590
+ }
46591
+ }, {
46592
+ key: "render",
46593
+ value: function render() {
46594
+ if (!safeHTMLElement.canUseDOM || !isReact16) {
46595
+ return null;
46596
+ }
46597
+ if (!this.node && isReact16) {
46598
+ this.node = createHTMLElement("div");
46599
+ }
46600
+ var createPortal = getCreatePortal();
46601
+ return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({
46602
+ ref: this.portalRef,
46603
+ defaultStyles: Modal.defaultStyles
46604
+ }, this.props)), this.node);
46605
+ }
46606
+ }], [{
46607
+ key: "setAppElement",
46608
+ value: function setAppElement(element) {
46609
+ ariaAppHider$1.setElement(element);
46610
+ }
46611
+ }]);
46612
+ return Modal;
46613
+ }(React.Component);
46614
+ Modal.propTypes = {
46615
+ isOpen: _propTypes2.default.bool.isRequired,
46616
+ style: _propTypes2.default.shape({
46617
+ content: _propTypes2.default.object,
46618
+ overlay: _propTypes2.default.object
46619
+ }),
46620
+ portalClassName: _propTypes2.default.string,
46621
+ bodyOpenClassName: _propTypes2.default.string,
46622
+ htmlOpenClassName: _propTypes2.default.string,
46623
+ className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
46624
+ base: _propTypes2.default.string.isRequired,
46625
+ afterOpen: _propTypes2.default.string.isRequired,
46626
+ beforeClose: _propTypes2.default.string.isRequired
46627
+ })]),
46628
+ overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
46629
+ base: _propTypes2.default.string.isRequired,
46630
+ afterOpen: _propTypes2.default.string.isRequired,
46631
+ beforeClose: _propTypes2.default.string.isRequired
46632
+ })]),
46633
+ appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
46634
+ onAfterOpen: _propTypes2.default.func,
46635
+ onRequestClose: _propTypes2.default.func,
46636
+ closeTimeoutMS: _propTypes2.default.number,
46637
+ ariaHideApp: _propTypes2.default.bool,
46638
+ shouldFocusAfterRender: _propTypes2.default.bool,
46639
+ shouldCloseOnOverlayClick: _propTypes2.default.bool,
46640
+ shouldReturnFocusAfterClose: _propTypes2.default.bool,
46641
+ preventScroll: _propTypes2.default.bool,
46642
+ parentSelector: _propTypes2.default.func,
46643
+ aria: _propTypes2.default.object,
46644
+ data: _propTypes2.default.object,
46645
+ role: _propTypes2.default.string,
46646
+ contentLabel: _propTypes2.default.string,
46647
+ shouldCloseOnEsc: _propTypes2.default.bool,
46648
+ overlayRef: _propTypes2.default.func,
46649
+ contentRef: _propTypes2.default.func,
46650
+ id: _propTypes2.default.string,
46651
+ overlayElement: _propTypes2.default.func,
46652
+ contentElement: _propTypes2.default.func
46653
+ };
46654
+ Modal.defaultProps = {
46655
+ isOpen: false,
46656
+ portalClassName: portalClassName,
46657
+ bodyOpenClassName: bodyOpenClassName,
46658
+ role: "dialog",
46659
+ ariaHideApp: true,
46660
+ closeTimeoutMS: 0,
46661
+ shouldFocusAfterRender: true,
46662
+ shouldCloseOnEsc: true,
46663
+ shouldCloseOnOverlayClick: true,
46664
+ shouldReturnFocusAfterClose: true,
46665
+ preventScroll: false,
46666
+ parentSelector: function parentSelector() {
46667
+ return document.body;
46668
+ },
46669
+ overlayElement: function overlayElement(props, contentEl) {
46670
+ return _react2.default.createElement("div", props, contentEl);
46671
+ },
46672
+ contentElement: function contentElement(props, children) {
46673
+ return _react2.default.createElement("div", props, children);
46674
+ }
46675
+ };
46676
+ Modal.defaultStyles = {
46677
+ overlay: {
46678
+ position: "fixed",
46679
+ top: 0,
46680
+ left: 0,
46681
+ right: 0,
46682
+ bottom: 0,
46683
+ backgroundColor: "rgba(255, 255, 255, 0.75)"
46684
+ },
46685
+ content: {
46686
+ position: "absolute",
46687
+ top: "40px",
46688
+ left: "40px",
46689
+ right: "40px",
46690
+ bottom: "40px",
46691
+ border: "1px solid #ccc",
46692
+ background: "#fff",
46693
+ overflow: "auto",
46694
+ WebkitOverflowScrolling: "touch",
46695
+ borderRadius: "4px",
46696
+ outline: "none",
46697
+ padding: "20px"
46698
+ }
46699
+ };
46700
+ (0, reactLifecyclesCompat_es.polyfill)(Modal);
46701
+ if (process.env.NODE_ENV !== "production") {
46702
+ Modal.setCreateHTMLElement = function (fn) {
46703
+ return createHTMLElement = fn;
46704
+ };
46705
+ }
46706
+ exports.default = Modal;
46707
+ });
46708
+ unwrapExports(Modal_1);
46709
+
46710
+ var lib = createCommonjsModule(function (module, exports) {
46711
+
46712
+ Object.defineProperty(exports, "__esModule", {
46713
+ value: true
46714
+ });
46715
+ var _Modal2 = _interopRequireDefault(Modal_1);
46716
+ function _interopRequireDefault(obj) {
46717
+ return obj && obj.__esModule ? obj : {
46718
+ default: obj
46719
+ };
46720
+ }
46721
+ exports.default = _Modal2.default;
46722
+ module.exports = exports["default"];
46723
+ });
46724
+ var Modal = unwrapExports(lib);
46725
+
46726
+ const CitizenConsent = ({
46727
+ showTermsPopupOwner,
46728
+ setShowTermsPopupOwner,
46729
+ otpVerifiedTimestamp
46730
+ }) => {
46731
+ var _user$info, _user$info2;
46732
+ const {
46733
+ t
46734
+ } = useTranslation();
46735
+ const user = Digit.UserService.getUser();
46736
+ const ownername = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name;
46737
+ const ownermobileNumber = user === null || user === void 0 ? void 0 : user.info.mobileNumber;
46738
+ const ownerEmail = user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.emailId;
46739
+ const {
46740
+ id
46741
+ } = useParams();
46742
+ const tenantId = localStorage.getItem("CITIZEN.CITY");
46743
+ const [loader, setLoader] = useState(false);
46744
+ const {
46745
+ data,
46746
+ isLoading
46747
+ } = Digit.Hooks.obps.useBPADetailsPage(tenantId, {
46748
+ applicationNo: id
46749
+ });
46750
+ const [isUploading, setIsUploading] = useState(false);
46751
+ const [isFileUploaded, setIsFileUploaded] = useState(false);
46752
+ const isCitizenDeclared = sessionStorage.getItem("CitizenConsentdocFilestoreidCHB");
46753
+ const DateOnly = new Date();
46754
+ const selfdeclarationform = `
46755
+ <div style="font-family:'Times New Roman', Times, serif; color:#000; font-size:16px; line-height:1.18; margin-top:-100px; padding:0;">
46756
+
46757
+ <h2 style="text-align:center; font-size:20px; margin:0 0 6px 0; font-weight:700; text-transform:uppercase;">
46758
+ OWNER'S DECLARATION
46759
+ </h2>
46760
+
46761
+ <div style="margin-top:-52px;">
46762
+ <p style="margin-bottom:-32px;"><strong>To,</strong></p>
46763
+ <p style="margin-bottom:-32px;"><strong>Local Urban Bodies</strong></p>
46764
+ </div>
46765
+
46766
+ <p style="margin-top:-20px;"><strong>Dear Sir/Madam,</strong></p>
46767
+
46768
+ <p style="margin-top:-52px;margin-bottom:-32px; text-align:justify;">
46769
+ I/We further declare that I am/We are aware of all the actions taken have been authorized by me/us.
46770
+ </p>
46771
+
46772
+ <ol style="margin-top:-52px;margin-bottom:-32px; padding:0;">
46773
+ <li style="margin-top:-5px;margin-bottom:-25px;">1. That I am/We are sole owner(s) of the site.</li>
46774
+ <li style="margin-top:-5px;margin-bottom:-25px;">2. That there is no dispute regarding the site and if any dispute arises, then I/We shall be solely responsible for the same.</li>
46775
+ <li style="margin-top:-5px;margin-bottom:-25px;">3. That construction of the building will be undertaken as per the approved building plans and structural design given by the Structural Engineer.</li>
46776
+ <li style="margin-top:-5px;margin-bottom:-25px;">4. That above stated facts are true and the requisite documents have been uploaded with this building plan and nothing has been concealed thereof.</li>
46777
+ </ol>
46778
+
46779
+ <!-- Signature / details table -->
46780
+ <table style="width:100%; border-collapse:collapse; margin-top:6px; font-size:14px;">
46781
+ <tr>
46782
+ <td style="width:48%; vertical-align:top; padding:6px; border:1px dotted #000;">
46783
+ <div style="font-weight:700; margin-bottom:4px;">Date:</div>
46784
+ <div style="min-height:60px;">${DateOnly || "<Date of Sign>"}</div>
46785
+ </td>
46786
+
46787
+ <td style="width:52%; vertical-align:top; border:1px dotted #000;">
46788
+ <table style="width:100%; border-collapse:collapse;">
46789
+ <tr>
46790
+ <td style="padding:6px; border-bottom:1px dotted #000; width:40%; font-weight:700;">Name of Owner:</td>
46791
+ <td style="padding:6px; border-bottom:1px dotted #000;">${ownername}</td>
46792
+ </tr>
46793
+ <tr>
46794
+ <td style="padding:6px; border-bottom:1px dotted #000; font-weight:700;">e-Mail:</td>
46795
+ <td style="padding:6px; border-bottom:1px dotted #000;">${ownerEmail}</td>
46796
+ </tr>
46797
+ <tr>
46798
+ <td style="padding:6px; border-bottom:1px dotted #000; font-weight:700;">Mobile:</td>
46799
+ <td style="padding:6px; border-bottom:1px dotted #000;">${ownermobileNumber}</td>
46800
+ </tr>
46801
+ <tr>
46802
+ <td style="padding:6px; font-weight:700;">Signature:</td>
46803
+ <td style="padding:6px;">Verified through OTP</b></td>
46804
+ </tr>
46805
+ </table>
46806
+ </td>
46807
+ </tr>
46808
+ </table>
46809
+ </div>
46810
+ `;
46811
+ const closeModal = () => {
46812
+ setShowTermsPopupOwner(false);
46813
+ };
46814
+ const uploadSelfDeclaration = async () => {
46815
+ setLoader(true);
46816
+ const Chb = [{
46817
+ applicationNo: "CHB-0001",
46818
+ tenantId: "pb.amritsar",
46819
+ approvalDate: "2025-10-28",
46820
+ TimeStamp: "2025-10-28T12:30:00Z"
46821
+ }];
46822
+ try {
46823
+ var _result$filestoreIds$;
46824
+ setIsUploading(true);
46825
+ let result = await Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(), {
46826
+ Chb: Chb
46827
+ }, "communityhallowner");
46828
+ console.log(result, "RESULT");
46829
+ setLoader(false);
46830
+ if ((result === null || result === void 0 ? void 0 : (_result$filestoreIds$ = result.filestoreIds[0]) === null || _result$filestoreIds$ === void 0 ? void 0 : _result$filestoreIds$.length) > 0) {
46831
+ alert("File Uploaded Successfully");
46832
+ sessionStorage.setItem("CitizenConsentdocFilestoreidCHB", result === null || result === void 0 ? void 0 : result.filestoreIds[0]);
46833
+ setIsFileUploaded(true);
46834
+ } else {
46835
+ alert("File Upload Failed");
46836
+ }
46837
+ } catch (error) {
46838
+ alert("Error Uploading PDF:", error);
46839
+ setLoader(false);
46840
+ } finally {
46841
+ setLoader(false);
46842
+ setIsUploading(false);
46843
+ }
46844
+ };
46845
+ const modalStyles = {
46846
+ modal: {
46847
+ width: "100%",
46848
+ height: "100%",
46849
+ top: "0",
46850
+ position: "relative",
46851
+ backgroundColor: "rgba(0, 0, 0, 0.7)",
46852
+ display: "flex",
46853
+ justifyContent: "center",
46854
+ alignItems: "center"
46855
+ },
46856
+ modalOverlay: {
46857
+ position: "fixed",
46858
+ top: "0",
46859
+ left: "0",
46860
+ width: "100%",
46861
+ height: "100%",
46862
+ backgroundColor: "rgba(0, 0, 0, 0.7)"
46863
+ },
46864
+ modalContent: {
46865
+ backgroundColor: "#FFFFFF",
46866
+ padding: "2rem",
46867
+ borderRadius: "0.5rem",
46868
+ maxWidth: "800px",
46869
+ margin: "auto",
46870
+ fontFamily: "Roboto, serif",
46871
+ overflowX: "hidden",
46872
+ textAlign: "justify",
46873
+ boxShadow: "0 4px 8px rgba(0, 0, 0, 0.2)",
46874
+ maxHeight: "80vh",
46875
+ overflowY: "auto",
46876
+ lineHeight: "2"
46877
+ },
46878
+ heading: {
46879
+ textAlign: "center",
46880
+ fontWeight: "bold",
46881
+ marginBottom: "10px"
46882
+ },
46883
+ subheading: {
46884
+ textAlign: "center",
46885
+ fontWeight: "bold",
46886
+ marginBottom: "20px"
46887
+ },
46888
+ rightAlignedText: {
46889
+ textAlign: "right",
46890
+ whiteSpace: "pre-wrap",
46891
+ wordWrap: "break-word",
46892
+ fontFamily: "Roboto, serif",
46893
+ lineHeight: "2"
46894
+ }
46895
+ };
46896
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Modal, {
46897
+ isOpen: showTermsPopupOwner,
46898
+ onRequestClose: closeModal,
46899
+ contentLabel: "Self-Declaration",
46900
+ style: {
46901
+ modal: modalStyles.modal,
46902
+ overlay: modalStyles.modalOverlay,
46903
+ content: modalStyles.modalContent
46904
+ }
46905
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
46906
+ style: {
46907
+ whiteSpace: "pre-wrap",
46908
+ wordWrap: "break-word",
46909
+ textAlign: "justify",
46910
+ fontFamily: "Roboto, serif"
46911
+ }
46912
+ }, /*#__PURE__*/React.createElement("div", {
46913
+ dangerouslySetInnerHTML: {
46914
+ __html: selfdeclarationform
46915
+ }
46916
+ })), /*#__PURE__*/React.createElement("div", {
46917
+ style: {
46918
+ display: "flex",
46919
+ justifyContent: "flex-end"
46920
+ }
46921
+ }, /*#__PURE__*/React.createElement(SubmitBar, {
46922
+ label: t("BPA_CLOSE"),
46923
+ onSubmit: closeModal
46924
+ })), /*#__PURE__*/React.createElement("br", null), !isCitizenDeclared && /*#__PURE__*/React.createElement("div", {
46925
+ style: {
46926
+ display: "flex",
46927
+ justifyContent: "flex-end"
46928
+ }
46929
+ }, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(SubmitBar, {
46930
+ label: t("BPA_UPLOAD"),
46931
+ onSubmit: uploadSelfDeclaration,
46932
+ disabled: isUploading || isFileUploaded
46933
+ })))), loader && /*#__PURE__*/React.createElement(Loader, {
46934
+ page: true
46935
+ }));
46936
+ };
46937
+
45292
46938
  const CHBCitizenSecond = ({
45293
46939
  onGoBack,
45294
46940
  goNext,
@@ -45305,6 +46951,7 @@ const CHBCitizenSecond = ({
45305
46951
  const [uploadedFile, setUploadedFile] = useState(null);
45306
46952
  const [file, setFile] = useState(null);
45307
46953
  const [error, setError] = useState(null);
46954
+ const [showTermsPopup, setShowTermsPopup] = useState(false);
45308
46955
  const {
45309
46956
  control,
45310
46957
  handleSubmit,
@@ -45313,7 +46960,8 @@ const CHBCitizenSecond = ({
45313
46960
  formState: {
45314
46961
  errors
45315
46962
  },
45316
- getValues
46963
+ getValues,
46964
+ watch
45317
46965
  } = useForm({
45318
46966
  defaultValues: {
45319
46967
  shouldUnregister: false,
@@ -45399,10 +47047,19 @@ const CHBCitizenSecond = ({
45399
47047
  console.log("uploadedFile==??", uploadedFile);
45400
47048
  const userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
45401
47049
  const now = Date.now();
47050
+ const isCitizenDeclared = sessionStorage.getItem("CitizenConsentdocFilestoreidCHB");
47051
+ if (!isCitizenDeclared) {
47052
+ alert("Please upload Self Certificate");
47053
+ return;
47054
+ }
45402
47055
  const additionalDetails = {
45403
- reason: data === null || data === void 0 ? void 0 : (_data$reason = data.reason) === null || _data$reason === void 0 ? void 0 : _data$reason.reasonName,
45404
- discount: data === null || data === void 0 ? void 0 : data.discount,
45405
- disImage: uploadedFile
47056
+ disImage: isCitizenDeclared,
47057
+ ...((data === null || data === void 0 ? void 0 : (_data$reason = data.reason) === null || _data$reason === void 0 ? void 0 : _data$reason.reasonName) && {
47058
+ reason: data.reason.reasonName
47059
+ }),
47060
+ ...((data === null || data === void 0 ? void 0 : data.discountAmount) && {
47061
+ discountAmount: data.discountAmount
47062
+ })
45406
47063
  };
45407
47064
  const bookingSlotDetails = data === null || data === void 0 ? void 0 : (_data$slots = data.slots) === null || _data$slots === void 0 ? void 0 : _data$slots.map(slot => {
45408
47065
  var _CHBHallCode$CHB2, _CHBHallCode$CHB2$Hal;
@@ -45421,7 +47078,9 @@ const CHBCitizenSecond = ({
45421
47078
  const payload = {
45422
47079
  hallsBookingApplication: {
45423
47080
  tenantId,
45424
- additionalDetails,
47081
+ ...(additionalDetails && {
47082
+ additionalDetails
47083
+ }),
45425
47084
  bookingStatus: "INITIATED",
45426
47085
  applicationDate: now,
45427
47086
  communityHallCode: (getHallDetails === null || getHallDetails === void 0 ? void 0 : (_getHallDetails$ = getHallDetails[0]) === null || _getHallDetails$ === void 0 ? void 0 : _getHallDetails$.communityHallId) || "",
@@ -45453,11 +47112,13 @@ const CHBCitizenSecond = ({
45453
47112
  var _currentStepData$owne;
45454
47113
  const formattedData = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.hallsBookingApplication;
45455
47114
  if (formattedData) {
45456
- var _CHBHallCode$CHB3, _formattedData$bookin3, _formattedData$bookin4;
47115
+ var _CHBHallCode$CHB3, _CHBReason$CHB, _formattedData$bookin3, _formattedData$bookin4, _formattedData$bookin5, _formattedData$additi2;
45457
47116
  const communityHallsOptions = CHBLocations.CHB.CommunityHalls || [];
45458
47117
  const purposeOptions = CHBPurpose.CHB.Purpose || [];
45459
47118
  const specialCategoryOptions = SpecialCategory.CHB.SpecialCategory || [];
45460
47119
  const hallCodeOptions = CHBHallCode === null || CHBHallCode === void 0 ? void 0 : (_CHBHallCode$CHB3 = CHBHallCode.CHB) === null || _CHBHallCode$CHB3 === void 0 ? void 0 : _CHBHallCode$CHB3.HallCode;
47120
+ const discReasonOptions = CHBReason === null || CHBReason === void 0 ? void 0 : (_CHBReason$CHB = CHBReason.CHB) === null || _CHBReason$CHB === void 0 ? void 0 : _CHBReason$CHB.DiscountReason;
47121
+ console.log("discReasonOptions", discReasonOptions);
45461
47122
  const selectedCommHall = communityHallsOptions === null || communityHallsOptions === void 0 ? void 0 : communityHallsOptions.find(item => (item === null || item === void 0 ? void 0 : item.communityHallId) == (formattedData === null || formattedData === void 0 ? void 0 : formattedData.communityHallCode));
45462
47123
  const selectedPurpose = purposeOptions === null || purposeOptions === void 0 ? void 0 : purposeOptions.find(item => {
45463
47124
  var _formattedData$purpos;
@@ -45471,10 +47132,15 @@ const CHBCitizenSecond = ({
45471
47132
  var _formattedData$bookin, _formattedData$bookin2;
45472
47133
  return (item === null || item === void 0 ? void 0 : item.HallCode) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin = formattedData.bookingSlotDetails) === null || _formattedData$bookin === void 0 ? void 0 : (_formattedData$bookin2 = _formattedData$bookin[0]) === null || _formattedData$bookin2 === void 0 ? void 0 : _formattedData$bookin2.hallCode);
45473
47134
  });
47135
+ const selectReason = discReasonOptions === null || discReasonOptions === void 0 ? void 0 : discReasonOptions.find(item => {
47136
+ var _formattedData$additi;
47137
+ return (item === null || item === void 0 ? void 0 : item.reasonName) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$additi = formattedData.additionalDetails) === null || _formattedData$additi === void 0 ? void 0 : _formattedData$additi.reason);
47138
+ });
45474
47139
  console.log("formattedData", formattedData);
45475
47140
  setValue("siteId", selectedCommHall || null);
45476
47141
  setValue("hallCode", selectHallCode || null);
45477
47142
  setValue("startDate", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin3 = formattedData.bookingSlotDetails) === null || _formattedData$bookin3 === void 0 ? void 0 : (_formattedData$bookin4 = _formattedData$bookin3[0]) === null || _formattedData$bookin4 === void 0 ? void 0 : _formattedData$bookin4.bookingDate);
47143
+ setValue("endDate", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin5 = formattedData.bookingSlotDetails.at(-1)) === null || _formattedData$bookin5 === void 0 ? void 0 : _formattedData$bookin5.bookingEndDate);
45478
47144
  setShowInfo(true);
45479
47145
  fiterHalls(selectedCommHall);
45480
47146
  slotsSearch(selectHallCode).then(response => {
@@ -45486,14 +47152,13 @@ const CHBCitizenSecond = ({
45486
47152
  setValue("purpose", selectedPurpose || null);
45487
47153
  setValue("specialCategory", selectedSpecialCat || null);
45488
47154
  setValue("purposeDescription", formattedData.purposeDescription || "");
47155
+ setValue("discountAmount", (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$additi2 = formattedData.additionalDetails) === null || _formattedData$additi2 === void 0 ? void 0 : _formattedData$additi2.discountAmount) || "");
47156
+ setValue("reason", selectReason || null);
45489
47157
  }
45490
47158
  }, [currentStepData, setValue]);
45491
47159
  useEffect(() => {
45492
47160
  console.log("getSlots", getSlots);
45493
47161
  }, [getSlots]);
45494
- function selectfile(e) {
45495
- setFile(e.target.files[0]);
45496
- }
45497
47162
  useEffect(() => {
45498
47163
  (async () => {
45499
47164
  setError(null);
@@ -45521,6 +47186,7 @@ const CHBCitizenSecond = ({
45521
47186
  }
45522
47187
  })();
45523
47188
  }, [file]);
47189
+ const startDate = watch("startDate");
45524
47190
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("form", {
45525
47191
  onSubmit: handleSubmit(onSubmit)
45526
47192
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardLabel, null, t("SELECT_HALL_NAME"), " ", /*#__PURE__*/React.createElement("span", {
@@ -45618,13 +47284,14 @@ const CHBCitizenSecond = ({
45618
47284
  type: "date",
45619
47285
  className: "form-field",
45620
47286
  value: props.value,
45621
- min: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString().split("T")[0],
47287
+ min: startDate ? new Date(new Date(startDate).getTime() + 24 * 60 * 60 * 1000).toISOString().split("T")[0] : new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString().split("T")[0],
45622
47288
  onChange: e => {
45623
47289
  props.onChange(e.target.value);
45624
47290
  },
45625
47291
  onBlur: e => {
45626
47292
  props.onBlur(e);
45627
- }
47293
+ },
47294
+ disabled: !startDate
45628
47295
  })
45629
47296
  }))), /*#__PURE__*/React.createElement("div", {
45630
47297
  style: {
@@ -45800,14 +47467,58 @@ const CHBCitizenSecond = ({
45800
47467
  style: {
45801
47468
  color: "red"
45802
47469
  }
45803
- }, errors.specialCategory.message)), !isCitizen && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
47470
+ }, errors.specialCategory.message)), /*#__PURE__*/React.createElement(LabelFieldPair, {
47471
+ style: {
47472
+ marginBottom: "20px"
47473
+ }
47474
+ }, /*#__PURE__*/React.createElement(CardLabel, {
47475
+ className: "card-label-smaller"
47476
+ }, t("CHB_PURPOSE_DESCRIPTION"), " ", /*#__PURE__*/React.createElement("span", {
47477
+ style: {
47478
+ color: "red"
47479
+ }
47480
+ }, "*")), /*#__PURE__*/React.createElement("div", {
47481
+ className: "field",
47482
+ style: {
47483
+ width: "50%"
47484
+ }
47485
+ }, /*#__PURE__*/React.createElement(Controller, {
47486
+ control: control,
47487
+ name: "purposeDescription",
47488
+ defaultValue: "",
47489
+ rules: {
47490
+ required: t("CHB_PURPOSE_DESCRIPTION_REQUIRED"),
47491
+ minLength: {
47492
+ value: 5,
47493
+ message: t("CHB_PURPOSE_DESCRIPTION_REQUIRED_MIN")
47494
+ }
47495
+ },
47496
+ render: props => /*#__PURE__*/React.createElement(TextArea, {
47497
+ style: {
47498
+ marginBottom: 0,
47499
+ marginTop: 0
47500
+ },
47501
+ type: "textarea",
47502
+ value: props.value,
47503
+ onChange: e => {
47504
+ props.onChange(e.target.value);
47505
+ },
47506
+ onBlur: e => {
47507
+ props.onBlur(e);
47508
+ }
47509
+ })
47510
+ }), errors.purposeDescription && /*#__PURE__*/React.createElement("p", {
47511
+ style: {
47512
+ color: "red"
47513
+ }
47514
+ }, errors.purposeDescription.message))), !isCitizen && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
45804
47515
  style: {
45805
47516
  marginBottom: "20px",
45806
47517
  width: "50%"
45807
47518
  }
45808
47519
  }, /*#__PURE__*/React.createElement(CardLabel, null, `${t("CHB_DISCOUNT_AMOUNT")}`), /*#__PURE__*/React.createElement(Controller, {
45809
47520
  control: control,
45810
- name: "discount",
47521
+ name: "discountAmount",
45811
47522
  render: props => {
45812
47523
  var _errors$name;
45813
47524
  return /*#__PURE__*/React.createElement(TextInput, {
@@ -45840,7 +47551,7 @@ const CHBCitizenSecond = ({
45840
47551
  name: "reason",
45841
47552
  defaultValue: null,
45842
47553
  render: props => {
45843
- var _CHBReason$CHB;
47554
+ var _CHBReason$CHB2;
45844
47555
  return /*#__PURE__*/React.createElement(Dropdown, {
45845
47556
  style: {
45846
47557
  marginBottom: 0
@@ -45848,35 +47559,58 @@ const CHBCitizenSecond = ({
45848
47559
  className: "form-field",
45849
47560
  select: props.onChange,
45850
47561
  selected: props.value,
45851
- option: CHBReason === null || CHBReason === void 0 ? void 0 : (_CHBReason$CHB = CHBReason.CHB) === null || _CHBReason$CHB === void 0 ? void 0 : _CHBReason$CHB.DiscountReason,
47562
+ option: CHBReason === null || CHBReason === void 0 ? void 0 : (_CHBReason$CHB2 = CHBReason.CHB) === null || _CHBReason$CHB2 === void 0 ? void 0 : _CHBReason$CHB2.DiscountReason,
45852
47563
  optionKey: "reasonName"
45853
47564
  });
45854
47565
  }
45855
- })), /*#__PURE__*/React.createElement("div", {
47566
+ }))), /*#__PURE__*/React.createElement("div", {
45856
47567
  style: {
45857
- marginBottom: "20px"
47568
+ display: "flex",
47569
+ alignItems: "center",
47570
+ gap: "10px",
47571
+ cursor: "pointer"
45858
47572
  }
45859
- }, /*#__PURE__*/React.createElement(CardLabel, null, t("CHB_REAS_IMAGE")), /*#__PURE__*/React.createElement("div", {
45860
- className: "field"
45861
- }, /*#__PURE__*/React.createElement(UploadFile, {
45862
- onUpload: selectfile,
45863
- onDelete: () => {
45864
- setUploadedFile(null);
45865
- },
45866
- message: uploadedFile ? `1 ${t(`CS_ACTION_FILEUPLOADED`)}` : t(`CS_ACTION_NO_FILEUPLOADED`),
45867
- textStyles: {
45868
- width: "100%"
45869
- },
45870
- inputStyles: {
45871
- width: "280px"
47573
+ }, /*#__PURE__*/React.createElement(Controller, {
47574
+ control: control,
47575
+ name: "termsAccepted",
47576
+ rules: {
47577
+ required: t("PLEASE_ACCEPT_TERMS_CONDITIONS")
45872
47578
  },
45873
- accept: ".pdf, .jpeg, .jpg, .png",
45874
- buttonType: "button",
45875
- error: !uploadedFile
45876
- })))))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
47579
+ render: props => /*#__PURE__*/React.createElement("input", {
47580
+ id: "termsAccepted",
47581
+ type: "checkbox",
47582
+ checked: props.value || false,
47583
+ onChange: e => {
47584
+ props.onChange(e.target.checked);
47585
+ console.log("cal", e.target.checked);
47586
+ if (e.target.checked) setShowTermsPopup(true);
47587
+ },
47588
+ style: {
47589
+ width: "18px",
47590
+ height: "18px",
47591
+ cursor: "pointer"
47592
+ }
47593
+ })
47594
+ }), /*#__PURE__*/React.createElement("label", {
47595
+ htmlFor: "termsAccepted",
47596
+ style: {
47597
+ cursor: "pointer",
47598
+ color: "#007bff",
47599
+ textDecoration: "underline",
47600
+ margin: 0
47601
+ }
47602
+ }, t("CHB_SELF_LABEL"))), errors.termsAccepted && /*#__PURE__*/React.createElement("p", {
47603
+ style: {
47604
+ color: "red"
47605
+ }
47606
+ }, errors.termsAccepted.message))), /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
45877
47607
  label: "Next",
45878
47608
  submit: "submit"
45879
- }))), (CHBReasonLoading || CHBLocationLoading || CHBLoading || CHBPurposeLoading || CHBSpecialCategoryLoading || CHBHallCodeLoading || loader) && /*#__PURE__*/React.createElement(Loader, {
47609
+ }))), showTermsPopup && /*#__PURE__*/React.createElement(CitizenConsent, {
47610
+ showTermsPopupOwner: showTermsPopup,
47611
+ setShowTermsPopupOwner: setShowTermsPopup,
47612
+ tenantId: tenantId
47613
+ }), (CHBReasonLoading || CHBLocationLoading || CHBLoading || CHBPurposeLoading || CHBSpecialCategoryLoading || CHBHallCodeLoading || loader) && /*#__PURE__*/React.createElement(Loader, {
45880
47614
  page: true
45881
47615
  }));
45882
47616
  };
@@ -45896,6 +47630,7 @@ const NewADSStepFormOne = ({
45896
47630
  return state.chb.CHBApplicationFormReducer.formData;
45897
47631
  });
45898
47632
  function goNext(data) {
47633
+ console.log("data aa rea", data);
45899
47634
  dispatch(UPDATE_CHBApplication_FORM(config.key, data));
45900
47635
  onGoNext();
45901
47636
  }
@@ -45926,7 +47661,7 @@ const CHBCitizenDetailsNew = ({
45926
47661
  onGoBack
45927
47662
  }) => {
45928
47663
  var _user$info, _user$info2, _user$info3;
45929
- const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
47664
+ const tenantId = Digit.ULBService.getCurrentTenantId();
45930
47665
  const stateId = Digit.ULBService.getStateId();
45931
47666
  const user = Digit.UserService.getUser();
45932
47667
  const [loader, setLoader] = useState(false);
@@ -45945,31 +47680,6 @@ const CHBCitizenDetailsNew = ({
45945
47680
  address: ""
45946
47681
  }
45947
47682
  });
45948
- const slotsSearch = async data => {
45949
- var _data$hallsBookingApp, _refData$bookingSlotD, _refData$bookingSlotD2, _refData$bookingSlotD3, _refData$bookingSlotD4, _refData$bookingSlotD5, _refData$bookingSlotD6;
45950
- const refData = data === null || data === void 0 ? void 0 : (_data$hallsBookingApp = data.hallsBookingApplication) === null || _data$hallsBookingApp === void 0 ? void 0 : _data$hallsBookingApp[0];
45951
- console.log("refData", refData);
45952
- const payload = {
45953
- tenantId: tenantId,
45954
- communityHallCode: refData.communityHallCode,
45955
- hallCode: refData === null || refData === void 0 ? void 0 : (_refData$bookingSlotD = refData.bookingSlotDetails) === null || _refData$bookingSlotD === void 0 ? void 0 : (_refData$bookingSlotD2 = _refData$bookingSlotD[0]) === null || _refData$bookingSlotD2 === void 0 ? void 0 : _refData$bookingSlotD2.hallCode,
45956
- bookingStartDate: refData === null || refData === void 0 ? void 0 : (_refData$bookingSlotD3 = refData.bookingSlotDetails) === null || _refData$bookingSlotD3 === void 0 ? void 0 : (_refData$bookingSlotD4 = _refData$bookingSlotD3[0]) === null || _refData$bookingSlotD4 === void 0 ? void 0 : _refData$bookingSlotD4.bookingDate,
45957
- bookingEndDate: refData === null || refData === void 0 ? void 0 : (_refData$bookingSlotD5 = refData.bookingSlotDetails) === null || _refData$bookingSlotD5 === void 0 ? void 0 : (_refData$bookingSlotD6 = _refData$bookingSlotD5[0]) === null || _refData$bookingSlotD6 === void 0 ? void 0 : _refData$bookingSlotD6.bookingEndDate,
45958
- isTimerRequired: true,
45959
- bookingId: refData === null || refData === void 0 ? void 0 : refData.bookingId
45960
- };
45961
- console.log("payload", payload);
45962
- try {
45963
- const response = await Digit.CHBServices.slot_search({
45964
- filters: payload
45965
- });
45966
- goNext(data === null || data === void 0 ? void 0 : data.hallsBookingApplication);
45967
- setLoader(false);
45968
- return response;
45969
- } catch (error) {
45970
- setLoader(false);
45971
- }
45972
- };
45973
47683
  const onSubmit = async data => {
45974
47684
  var _currentStepData$venu, _currentStepData$venu2;
45975
47685
  setLoader(true);
@@ -46009,9 +47719,8 @@ const CHBCitizenDetailsNew = ({
46009
47719
  try {
46010
47720
  const response = await Digit.CHBServices.create(payload);
46011
47721
  console.log("response", response);
46012
- setTimeout(() => {
46013
- slotsSearch(response);
46014
- }, 10000);
47722
+ setLoader(false);
47723
+ goNext(response === null || response === void 0 ? void 0 : response.hallsBookingApplication);
46015
47724
  } catch (error) {
46016
47725
  setLoader(false);
46017
47726
  }
@@ -46022,8 +47731,9 @@ const CHBCitizenDetailsNew = ({
46022
47731
  console.log("currentStepData", currentStepData);
46023
47732
  const formattedData = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$venu3 = currentStepData.venueDetails) === null || _currentStepData$venu3 === void 0 ? void 0 : _currentStepData$venu3[0];
46024
47733
  if (formattedData) {
46025
- var _formattedData$addres;
47734
+ var _formattedData$addres, _formattedData$applic;
46026
47735
  setValue("address", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$addres = formattedData.address) === null || _formattedData$addres === void 0 ? void 0 : _formattedData$addres.addressLine1);
47736
+ setValue("emailId", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$applic = formattedData.applicantDetail) === null || _formattedData$applic === void 0 ? void 0 : _formattedData$applic.applicantEmailId);
46027
47737
  }
46028
47738
  }, [currentStepData, setValue]);
46029
47739
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("form", {
@@ -46976,9 +48686,6 @@ const CHBResponseCitizen = props => {
46976
48686
  const onGoToCHB = () => {
46977
48687
  if (isCitizen) history.push(`/digit-ui/citizen/chb-home`);else history.push(`/digit-ui/employee/chb/inbox`);
46978
48688
  };
46979
- const handleMakePayment = async () => {
46980
- if (isCitizen) history.push(`/digit-ui/citizen/payment/collect/chb-services/${ndcCode}/${tenantId}?tenantId=${tenantId}`);else history.push(`/digit-ui/employee/payment/collect/chb-services/${ndcCode}/${tenantId}?tenantId=${tenantId}`);
46981
- };
46982
48689
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Banner, {
46983
48690
  message: t("CHB_APPLICATION_CREATED"),
46984
48691
  applicationNumber: ndcCode,
@@ -47004,9 +48711,6 @@ const CHBResponseCitizen = props => {
47004
48711
  }), /*#__PURE__*/React.createElement(SubmitBar, {
47005
48712
  label: t("CORE_COMMON_GO_TO_CHB"),
47006
48713
  onSubmit: onGoToCHB
47007
- }), /*#__PURE__*/React.createElement(SubmitBar, {
47008
- label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),
47009
- onSubmit: handleMakePayment
47010
48714
  }))));
47011
48715
  };
47012
48716