@123usmanhaider321/ui 0.1.8 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +416 -31
- package/dist/images/icon/1LINK.svg +50 -0
- package/dist/images/icon/CreditCard.svg +83 -0
- package/dist/images/icon/Easypaisa.png +0 -0
- package/dist/images/icon/MobileWallet.png +0 -0
- package/dist/images/icon/Raast-Logo.png +0 -0
- package/dist/images/icon/VISA.png +0 -0
- package/dist/images/icon/add-circle-1.svg +5 -0
- package/dist/images/icon/check-circle-broken.svg +3 -0
- package/dist/images/icon/close-circle.svg +5 -0
- package/dist/images/icon/jazzcash.png +0 -0
- package/dist/images/icon/loading_icon.json +3347 -0
- package/dist/images/icon/mastercard-logo.webp +0 -0
- package/dist/images/icon/paymo.jpeg +0 -0
- package/dist/images/icon/preview-svgrepo-com.svg +36 -0
- package/dist/images/icon/trash.svg +7 -0
- package/dist/images/icon/unionpay-logo.svg +9 -0
- package/dist/index-BLoegwT6.js +60476 -0
- package/dist/index-BLoegwT6.js.map +1 -0
- package/dist/index-CPnu5V8f.js +11119 -0
- package/dist/index-CPnu5V8f.js.map +1 -0
- package/dist/index.d.ts +1 -10
- package/dist/index.es-C5pDhGOr.js +16734 -0
- package/dist/index.es-C5pDhGOr.js.map +1 -0
- package/dist/index.js +40 -12
- package/dist/index.js.map +1 -1
- package/dist/loading_icon-n5H5dQBl.js +3375 -0
- package/dist/loading_icon-n5H5dQBl.js.map +1 -0
- package/dist/src/components/Alert/ErrorAlert.d.ts +6 -0
- package/dist/src/components/Alert/SuccessAlert.d.ts +6 -0
- package/dist/{components → src/components}/FormBuilder/DiscountInput.d.ts +3 -6
- package/dist/{components → src/components}/FormBuilder/FormBuilder.d.ts +2 -11
- package/dist/{components → src/components}/FormBuilder/QuestionCard.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/QuestionEditor.d.ts +0 -5
- package/dist/{components → src/components}/FormBuilder/SortableQuestionList.d.ts +0 -5
- package/dist/src/components/FormBuilder/questionIcons.d.ts +5 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventLayout.d.ts +2 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/AddEventStepper.d.ts +2 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/ConfirmationModal.d.ts +1 -1
- package/dist/src/components/NewAddEvent/components/EventSubmissionConfirmationModal.d.ts +14 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/TicketTierSection.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTierForm.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useStepperForm.d.ts +22 -22
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/hooks/useTicketTierForm.d.ts +63 -15
- package/dist/src/components/NewAddEvent/schemas/step1.d.ts +211 -0
- package/dist/src/components/NewAddEvent/schemas/step2.d.ts +411 -0
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/schemas/utils.d.ts +8 -2
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/IndividualFormStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/SocialProfilesStep.d.ts +1 -1
- package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/TeamFormStep.d.ts +1 -1
- package/dist/src/components/Spinner/spinner.d.ts +4 -0
- package/dist/src/components/TicketlyUIProvider.d.ts +35 -0
- package/dist/src/components/common/Loader/index.d.ts +8 -0
- package/dist/src/components/common/Modals/ConfirmationModal.d.ts +7 -0
- package/dist/{components/FormInput → src/components/ui}/FormInput.d.ts +1 -1
- package/dist/src/components/ui/Loader.d.ts +4 -0
- package/dist/{components/Button/Button.d.ts → src/components/ui/button.d.ts} +1 -1
- package/dist/src/index.d.ts +10 -0
- package/dist/{lib → src/lib}/actions.d.ts +0 -126
- package/dist/src/lib/dom-utils.d.ts +2 -0
- package/dist/src/lib/storage-utils.d.ts +5 -0
- package/dist/src/lib/types.d.ts +258 -0
- package/dist/src/redux/baseQuery.d.ts +16 -0
- package/dist/{services → src/redux/features}/eventApi.d.ts +1053 -1745
- package/dist/src/redux/features/globalSlice.d.ts +17 -0
- package/dist/{services → src/redux/features/single-event}/single-event-api.d.ts +856 -1190
- package/dist/src/redux/types.d.ts +2 -0
- package/dist/src/services/library-services.d.ts +15 -0
- package/dist/src/services/remote-config.d.ts +27 -0
- package/dist/{services → src/services}/utils.d.ts +1 -1
- package/dist/src/theme/colors.d.ts +127 -0
- package/dist/src/theme/typography.d.ts +13 -0
- package/dist/src/types/api.d.ts +18 -0
- package/dist/style.css +2984 -0
- package/dist/styles.css +3760 -4014
- package/package.json +78 -68
- package/dist/_virtual/_commonjsHelpers.js +0 -9
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/customParseFormat.js +0 -5
- package/dist/_virtual/customParseFormat.js.map +0 -1
- package/dist/_virtual/dayjs.min.js +0 -5
- package/dist/_virtual/dayjs.min.js.map +0 -1
- package/dist/_virtual/duration.js +0 -5
- package/dist/_virtual/duration.js.map +0 -1
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/isBetween.js +0 -5
- package/dist/_virtual/isBetween.js.map +0 -1
- package/dist/_virtual/relativeTime.js +0 -5
- package/dist/_virtual/relativeTime.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -5
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/_virtual/with-selector.development.js +0 -5
- package/dist/_virtual/with-selector.development.js.map +0 -1
- package/dist/_virtual/with-selector.js +0 -5
- package/dist/_virtual/with-selector.js.map +0 -1
- package/dist/_virtual/with-selector.production.js +0 -5
- package/dist/_virtual/with-selector.production.js.map +0 -1
- package/dist/components/Alert/Alert.js +0 -51
- package/dist/components/Alert/Alert.js.map +0 -1
- package/dist/components/Button/Button.js +0 -52
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.js +0 -50
- package/dist/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -25
- package/dist/components/CheckboxGroup/CheckboxGroup.js +0 -99
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +0 -1
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -15
- package/dist/components/ConfirmationModal/ConfirmationModal.js +0 -136
- package/dist/components/ConfirmationModal/ConfirmationModal.js.map +0 -1
- package/dist/components/ConfirmationModal/index.d.ts +0 -2
- package/dist/components/CustomSelect/CustomSelect.js +0 -259
- package/dist/components/CustomSelect/CustomSelect.js.map +0 -1
- package/dist/components/EventAddForm/AddEventLayout.js +0 -227
- package/dist/components/EventAddForm/AddEventLayout.js.map +0 -1
- package/dist/components/EventAddForm/AddEventStepper.js +0 -719
- package/dist/components/EventAddForm/AddEventStepper.js.map +0 -1
- package/dist/components/EventAddForm/common/ConfirmationModal.js +0 -136
- package/dist/components/EventAddForm/common/ConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/common/DescriptionModal.js +0 -70
- package/dist/components/EventAddForm/common/DescriptionModal.js.map +0 -1
- package/dist/components/EventAddForm/components/AnimatedBackground.d.ts +0 -8
- package/dist/components/EventAddForm/components/ApprovalConfirmationModal.d.ts +0 -7
- package/dist/components/EventAddForm/components/CheckboxGroup.js +0 -92
- package/dist/components/EventAddForm/components/CheckboxGroup.js.map +0 -1
- package/dist/components/EventAddForm/components/CustomMeetingForm.js +0 -237
- package/dist/components/EventAddForm/components/CustomMeetingForm.js.map +0 -1
- package/dist/components/EventAddForm/components/DateTimeField.js +0 -173
- package/dist/components/EventAddForm/components/DateTimeField.js.map +0 -1
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.d.ts +0 -33
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js +0 -366
- package/dist/components/EventAddForm/components/EventSubmissionConfirmationModal.js.map +0 -1
- package/dist/components/EventAddForm/components/FileUpload.js +0 -412
- package/dist/components/EventAddForm/components/FileUpload.js.map +0 -1
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js +0 -197
- package/dist/components/EventAddForm/components/FormBuilderProceedModal.js.map +0 -1
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js +0 -1179
- package/dist/components/EventAddForm/components/GoogleMapsAutocompleteInput.js.map +0 -1
- package/dist/components/EventAddForm/components/InputField.d.ts +0 -15
- package/dist/components/EventAddForm/components/RadioGroupButton.d.ts +0 -14
- package/dist/components/EventAddForm/components/SelectField.d.ts +0 -19
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js +0 -102
- package/dist/components/EventAddForm/components/SingleDateTimeInput.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js +0 -277
- package/dist/components/EventAddForm/components/StepTwo/CustomFormSection.js.map +0 -1
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js +0 -148
- package/dist/components/EventAddForm/components/StepTwo/TicketTierSection.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTierForm.js +0 -418
- package/dist/components/EventAddForm/components/TicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/components/TicketTypeSelection.js +0 -93
- package/dist/components/EventAddForm/components/TicketTypeSelection.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useStepperForm.js +0 -371
- package/dist/components/EventAddForm/hooks/useStepperForm.js.map +0 -1
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js +0 -237
- package/dist/components/EventAddForm/hooks/useTicketTierForm.js.map +0 -1
- package/dist/components/EventAddForm/index.d.ts +0 -3
- package/dist/components/EventAddForm/index.js +0 -41
- package/dist/components/EventAddForm/index.js.map +0 -1
- package/dist/components/EventAddForm/schemas/index.d.ts +0 -2
- package/dist/components/EventAddForm/schemas/step1.d.ts +0 -47
- package/dist/components/EventAddForm/schemas/step1.js +0 -135
- package/dist/components/EventAddForm/schemas/step1.js.map +0 -1
- package/dist/components/EventAddForm/schemas/step2.d.ts +0 -138
- package/dist/components/EventAddForm/schemas/step2.js +0 -94
- package/dist/components/EventAddForm/schemas/step2.js.map +0 -1
- package/dist/components/EventAddForm/schemas/utils.js +0 -28
- package/dist/components/EventAddForm/schemas/utils.js.map +0 -1
- package/dist/components/EventAddForm/steps/IndividualFormStep.js +0 -85
- package/dist/components/EventAddForm/steps/IndividualFormStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js +0 -123
- package/dist/components/EventAddForm/steps/SocialProfilesStep.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepOne.js +0 -462
- package/dist/components/EventAddForm/steps/StepOne.js.map +0 -1
- package/dist/components/EventAddForm/steps/StepTwo.js +0 -173
- package/dist/components/EventAddForm/steps/StepTwo.js.map +0 -1
- package/dist/components/EventAddForm/steps/TeamFormStep.js +0 -13
- package/dist/components/EventAddForm/steps/TeamFormStep.js.map +0 -1
- package/dist/components/FormBuilder/CategoryList.js +0 -242
- package/dist/components/FormBuilder/CategoryList.js.map +0 -1
- package/dist/components/FormBuilder/DiscountInput.js +0 -366
- package/dist/components/FormBuilder/DiscountInput.js.map +0 -1
- package/dist/components/FormBuilder/FormBuilder.js +0 -918
- package/dist/components/FormBuilder/FormBuilder.js.map +0 -1
- package/dist/components/FormBuilder/OptionList.js +0 -120
- package/dist/components/FormBuilder/OptionList.js.map +0 -1
- package/dist/components/FormBuilder/PaymentPreview.d.ts +0 -12
- package/dist/components/FormBuilder/PaymentPreview.js +0 -70
- package/dist/components/FormBuilder/PaymentPreview.js.map +0 -1
- package/dist/components/FormBuilder/PreviewInput.d.ts +0 -10
- package/dist/components/FormBuilder/PreviewInput.js +0 -143
- package/dist/components/FormBuilder/PreviewInput.js.map +0 -1
- package/dist/components/FormBuilder/QuestionCard.js +0 -252
- package/dist/components/FormBuilder/QuestionCard.js.map +0 -1
- package/dist/components/FormBuilder/QuestionEditor.js +0 -166
- package/dist/components/FormBuilder/QuestionEditor.js.map +0 -1
- package/dist/components/FormBuilder/RequiredToggle.js +0 -43
- package/dist/components/FormBuilder/RequiredToggle.js.map +0 -1
- package/dist/components/FormBuilder/SortableQuestionList.js +0 -137
- package/dist/components/FormBuilder/SortableQuestionList.js.map +0 -1
- package/dist/components/FormBuilder/index.d.ts +0 -4
- package/dist/components/FormBuilder/utils.js +0 -229
- package/dist/components/FormBuilder/utils.js.map +0 -1
- package/dist/components/FormInput/FormInput.js +0 -126
- package/dist/components/FormInput/FormInput.js.map +0 -1
- package/dist/components/FormInput/FormInput.test.d.ts +0 -1
- package/dist/components/FormInput/index.d.ts +0 -2
- package/dist/components/ImageCropModal/index.js +0 -464
- package/dist/components/ImageCropModal/index.js.map +0 -1
- package/dist/components/InformationPopover/InformationPopover.d.ts +0 -7
- package/dist/components/InformationPopover/InformationPopover.js +0 -19
- package/dist/components/InformationPopover/InformationPopover.js.map +0 -1
- package/dist/components/InformationPopover.js +0 -19
- package/dist/components/InformationPopover.js.map +0 -1
- package/dist/components/InputErrorMessage/InputErrorMessage.js +0 -21
- package/dist/components/InputErrorMessage/InputErrorMessage.js.map +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -15
- package/dist/components/Modal/Modal.js +0 -73
- package/dist/components/Modal/Modal.js.map +0 -1
- package/dist/components/Radio/Radio.js +0 -35
- package/dist/components/Radio/Radio.js.map +0 -1
- package/dist/components/Spinner/spinner.d.ts +0 -2
- package/dist/components/Spinner/spinner.js +0 -22
- package/dist/components/Spinner/spinner.js.map +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -16
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.js +0 -134
- package/dist/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/components/common/FallbackImage.js +0 -47
- package/dist/components/common/FallbackImage.js.map +0 -1
- package/dist/components/ui/Calendar/calendar-utils.js +0 -51
- package/dist/components/ui/Calendar/calendar-utils.js.map +0 -1
- package/dist/components/ui/Calendar/index.js +0 -142
- package/dist/components/ui/Calendar/index.js.map +0 -1
- package/dist/components/ui/Checkbox.d.ts +0 -9
- package/dist/components/ui/Checkbox.js +0 -50
- package/dist/components/ui/Checkbox.js.map +0 -1
- package/dist/components/ui/DatePicker/index.js +0 -188
- package/dist/components/ui/DatePicker/index.js.map +0 -1
- package/dist/components/ui/FormInput.js +0 -129
- package/dist/components/ui/FormInput.js.map +0 -1
- package/dist/components/ui/InputErrorMessage.d.ts +0 -7
- package/dist/components/ui/InputErrorMessage.js +0 -21
- package/dist/components/ui/InputErrorMessage.js.map +0 -1
- package/dist/components/ui/Modal/index.js +0 -73
- package/dist/components/ui/Modal/index.js.map +0 -1
- package/dist/components/ui/Radio.d.ts +0 -6
- package/dist/components/ui/Radio.js +0 -35
- package/dist/components/ui/Radio.js.map +0 -1
- package/dist/components/ui/RichTextEditor.js +0 -242
- package/dist/components/ui/RichTextEditor.js.map +0 -1
- package/dist/components/ui/TimePicker/index.js +0 -215
- package/dist/components/ui/TimePicker/index.js.map +0 -1
- package/dist/components/ui/TimeSelector/index.js +0 -138
- package/dist/components/ui/TimeSelector/index.js.map +0 -1
- package/dist/components/ui/Tooltip.d.ts +0 -12
- package/dist/components/ui/Tooltip.js +0 -136
- package/dist/components/ui/Tooltip.js.map +0 -1
- package/dist/hooks/useDropdownPosition.d.ts +0 -11
- package/dist/hooks/useFirebaseAuthState.d.ts +0 -6
- package/dist/hooks/useFirebaseAuthState.js +0 -23
- package/dist/hooks/useFirebaseAuthState.js.map +0 -1
- package/dist/hooks/useTicketTierForm.d.ts +0 -61
- package/dist/lib/actions.js +0 -32
- package/dist/lib/actions.js.map +0 -1
- package/dist/lib/cropImage.js +0 -113
- package/dist/lib/cropImage.js.map +0 -1
- package/dist/lib/imageAnalysis.js +0 -58
- package/dist/lib/imageAnalysis.js.map +0 -1
- package/dist/lib/utils.js +0 -9
- package/dist/lib/utils.js.map +0 -1
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -60
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +0 -3458
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -593
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +0 -1
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -302
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +0 -1
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js +0 -768
- package/dist/node_modules/@firebase/app/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js +0 -340
- package/dist/node_modules/@firebase/component/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js +0 -123
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/storage/dist/index.esm.js +0 -2623
- package/dist/node_modules/@firebase/storage/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/index.esm.js +0 -658
- package/dist/node_modules/@firebase/util/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@firebase/util/dist/postinstall.js +0 -5
- package/dist/node_modules/@firebase/util/dist/postinstall.js.map +0 -1
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +0 -3179
- package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +0 -60
- package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +0 -1
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js +0 -400
- package/dist/node_modules/@fortawesome/react-fontawesome/dist/index.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/CheckIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js +0 -27
- package/dist/node_modules/@heroicons/react/20/solid/esm/ChevronDownIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowRightIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/ClockIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentDuplicateIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/InformationCircleIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/LinkIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/MagnifyingGlassIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js +0 -33
- package/dist/node_modules/@heroicons/react/24/outline/esm/MapPinIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/VideoCameraIcon.js.map +0 -1
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js +0 -29
- package/dist/node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/index.js +0 -5446
- package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -21
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -78
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -100
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -317
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -66
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -86
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -80
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -98
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -423
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -1039
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -61
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -7
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -79
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -16
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -76
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -376
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +0 -650
- package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -97
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
- package/dist/node_modules/dayjs/dayjs.min.js +0 -283
- package/dist/node_modules/dayjs/dayjs.min.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/customParseFormat.js +0 -130
- package/dist/node_modules/dayjs/plugin/customParseFormat.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/duration.js +0 -137
- package/dist/node_modules/dayjs/plugin/duration.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/isBetween.js +0 -20
- package/dist/node_modules/dayjs/plugin/isBetween.js.map +0 -1
- package/dist/node_modules/dayjs/plugin/relativeTime.js +0 -49
- package/dist/node_modules/dayjs/plugin/relativeTime.js.map +0 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +0 -442
- package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
- package/dist/node_modules/idb/build/index.js +0 -70
- package/dist/node_modules/idb/build/index.js.map +0 -1
- package/dist/node_modules/idb/build/wrap-idb-value.js +0 -149
- package/dist/node_modules/idb/build/wrap-idb-value.js.map +0 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +0 -1159
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
- package/dist/node_modules/orderedmap/dist/index.js +0 -120
- package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +0 -527
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -137
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -221
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +0 -357
- package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -84
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +0 -3209
- package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -131
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +0 -936
- package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1881
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +0 -5232
- package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
- package/dist/node_modules/rope-sequence/dist/index.js +0 -184
- package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -82
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -78
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -63
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -13
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -106
- package/dist/node_modules/w3c-keyname/index.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/coerce.js +0 -10
- package/dist/node_modules/zod/v4/classic/coerce.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/compat.js +0 -8
- package/dist/node_modules/zod/v4/classic/compat.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.js +0 -45
- package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.js +0 -44
- package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.js +0 -30
- package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -711
- package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/api.js +0 -588
- package/dist/node_modules/zod/v4/core/api.js.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.js +0 -411
- package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
- package/dist/node_modules/zod/v4/core/core.js +0 -75
- package/dist/node_modules/zod/v4/core/core.js.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.js +0 -38
- package/dist/node_modules/zod/v4/core/doc.js.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.js +0 -73
- package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -359
- package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.js +0 -96
- package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.js +0 -84
- package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.js +0 -52
- package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1391
- package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -363
- package/dist/node_modules/zod/v4/core/to-json-schema.js.map +0 -1
- package/dist/node_modules/zod/v4/core/util.js +0 -431
- package/dist/node_modules/zod/v4/core/util.js.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.js +0 -9
- package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
- package/dist/redux/baseQuery.d.ts +0 -1
- package/dist/redux/baseQuery.js +0 -24
- package/dist/redux/baseQuery.js.map +0 -1
- package/dist/services/eventApi.js +0 -411
- package/dist/services/eventApi.js.map +0 -1
- package/dist/services/helpers.js +0 -115
- package/dist/services/helpers.js.map +0 -1
- package/dist/services/initialize-firebase.d.ts +0 -2
- package/dist/services/initialize-firebase.js +0 -20
- package/dist/services/initialize-firebase.js.map +0 -1
- package/dist/services/process-image-on-server.js +0 -30
- package/dist/services/process-image-on-server.js.map +0 -1
- package/dist/services/remote-config.d.ts +0 -5
- package/dist/services/remote-config.js +0 -9
- package/dist/services/remote-config.js.map +0 -1
- package/dist/services/single-event-api.js +0 -301
- package/dist/services/single-event-api.js.map +0 -1
- package/dist/services/utils.js +0 -107
- package/dist/services/utils.js.map +0 -1
- package/dist/setupTests.d.ts +0 -1
- package/dist/stories/Alert.stories.d.ts +0 -10
- package/dist/stories/Button.stories.d.ts +0 -13
- package/dist/types/redux-types.d.ts +0 -15
- package/dist/types/types.d.ts +0 -60
- package/dist/types/types.js +0 -10
- package/dist/types/types.js.map +0 -1
- package/dist/utils/cn.d.ts +0 -6
- package/dist/utils/cn.js +0 -9
- package/dist/utils/cn.js.map +0 -1
- package/dist/utils/date-range.d.ts +0 -4
- package/dist/utils/date-range.js +0 -13
- package/dist/utils/date-range.js.map +0 -1
- package/dist/utils/single-event-helpers.d.ts +0 -50
- package/dist/utils/single-event-helpers.js +0 -18
- package/dist/utils/single-event-helpers.js.map +0 -1
- package/dist/utils/social-validation.js +0 -42
- package/dist/utils/social-validation.js.map +0 -1
- package/dist/utils/utils.js +0 -20
- package/dist/utils/utils.js.map +0 -1
- /package/dist/{components/Alert/Alert.d.ts → src/components/Alert/index.d.ts} +0 -0
- /package/dist/{components → src/components}/FormBuilder/CategoryList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/OptionList.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/RequiredToggle.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/types.d.ts +0 -0
- /package/dist/{components → src/components}/FormBuilder/utils.d.ts +0 -0
- /package/dist/{components → src/components}/ImageCropModal/index.d.ts +0 -0
- /package/dist/{components → src/components}/InformationPopover.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/common/DescriptionModal.d.ts +0 -0
- /package/dist/{components/ui/FormInput.d.ts → src/components/NewAddEvent/components/AddEventFormInput.d.ts} +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CheckboxGroup.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/CustomMeetingForm.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/DateTimeField.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FileUpload.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/FormBuilderProceedModal.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/GoogleMapsAutocompleteInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/SingleDateTimeInput.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/StepTwo/CustomFormSection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/components/TicketTypeSelection.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepOne.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/steps/StepTwo.d.ts +0 -0
- /package/dist/{components/EventAddForm → src/components/NewAddEvent}/types.d.ts +0 -0
- /package/dist/{components → src/components}/common/FallbackImage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/calendar-utils.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Calendar/index.d.ts +0 -0
- /package/dist/{components/Checkbox → src/components/ui}/Checkbox.d.ts +0 -0
- /package/dist/{components/CustomSelect → src/components/ui}/CustomSelect.d.ts +0 -0
- /package/dist/{components → src/components}/ui/DatePicker/index.d.ts +0 -0
- /package/dist/{components/InputErrorMessage → src/components/ui}/InputErrorMessage.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Modal/index.d.ts +0 -0
- /package/dist/{components/Radio → src/components/ui}/Radio.d.ts +0 -0
- /package/dist/{components → src/components}/ui/RichTextEditor.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimePicker/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/TimeSelector/index.d.ts +0 -0
- /package/dist/{components → src/components}/ui/Tooltip/index.d.ts +0 -0
- /package/dist/{lib → src/lib}/constants.d.ts +0 -0
- /package/dist/{lib → src/lib}/cropImage.d.ts +0 -0
- /package/dist/{lib → src/lib}/imageAnalysis.d.ts +0 -0
- /package/dist/{utils → src/lib}/social-validation.d.ts +0 -0
- /package/dist/{lib/utils.d.ts → src/lib/tailwind-merge.d.ts} +0 -0
- /package/dist/{utils → src/lib}/utils.d.ts +0 -0
- /package/dist/{services → src/redux/features/single-event}/helpers.d.ts +0 -0
- /package/dist/{services → src/services}/process-image-on-server.d.ts +0 -0
- /package/dist/{types → src/types}/events.d.ts +0 -0
- /package/dist/{types → src/types}/question.d.ts +0 -0
|
@@ -1,719 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useState, useEffect, useRef, useMemo, useCallback } from "react";
|
|
3
|
-
import { useStepperForm } from "./hooks/useStepperForm.js";
|
|
4
|
-
import { useRouter } from "next/navigation";
|
|
5
|
-
import { AddEventLayout } from "./AddEventLayout.js";
|
|
6
|
-
import StepOne from "./steps/StepOne.js";
|
|
7
|
-
import StepTwo from "./steps/StepTwo.js";
|
|
8
|
-
import IndividualFormStep from "./steps/IndividualFormStep.js";
|
|
9
|
-
import TeamFormStep from "./steps/TeamFormStep.js";
|
|
10
|
-
import { useGetEventDetailsByIdQuery, useAddEventMutation, useUpdateEventMutation, useUpdateEventSocialProfilesMutation } from "../../services/single-event-api.js";
|
|
11
|
-
import { convertDateFormat } from "../../utils/utils.js";
|
|
12
|
-
import SocialProfilesStep from "./steps/SocialProfilesStep.js";
|
|
13
|
-
import FormBuilderProceedModal from "./components/FormBuilderProceedModal.js";
|
|
14
|
-
const BASE_STEPS = [
|
|
15
|
-
{ id: 1, title: "Create event" },
|
|
16
|
-
{ id: 2, title: "Ticket set up" }
|
|
17
|
-
];
|
|
18
|
-
const AddEventStepper = ({
|
|
19
|
-
edit,
|
|
20
|
-
id,
|
|
21
|
-
organizer_id,
|
|
22
|
-
onEventCreated,
|
|
23
|
-
isClearing = false,
|
|
24
|
-
SCOPED_ID_KEY = "",
|
|
25
|
-
SCOPED_FORM_KEY = "",
|
|
26
|
-
isSameQuestionTitleAllowed,
|
|
27
|
-
closed_loop_id,
|
|
28
|
-
initialStep,
|
|
29
|
-
mode
|
|
30
|
-
}) => {
|
|
31
|
-
const router = useRouter();
|
|
32
|
-
const [openExitConfirm, setOpenExitConfirm] = useState(false);
|
|
33
|
-
const [localEventId, setLocalEventId] = useState(null);
|
|
34
|
-
const [isStorageChecked, setIsStorageChecked] = useState(false);
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (!id && !edit) {
|
|
37
|
-
const storedId = localStorage.getItem(SCOPED_ID_KEY);
|
|
38
|
-
if (storedId) {
|
|
39
|
-
setLocalEventId(storedId);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
setIsStorageChecked(true);
|
|
43
|
-
}, [id, edit, SCOPED_ID_KEY]);
|
|
44
|
-
const activeEventId = id || localEventId || null;
|
|
45
|
-
const {
|
|
46
|
-
data: apiEventData,
|
|
47
|
-
isLoading: isFetchingEvent,
|
|
48
|
-
isError: isFetchError,
|
|
49
|
-
refetch: refetchEventDetails
|
|
50
|
-
} = useGetEventDetailsByIdQuery(activeEventId || "", {
|
|
51
|
-
skip: !activeEventId,
|
|
52
|
-
refetchOnMountOrArgChange: true,
|
|
53
|
-
refetchOnFocus: false,
|
|
54
|
-
refetchOnReconnect: false
|
|
55
|
-
});
|
|
56
|
-
const [openConfirmModal, setOpenConfirmModal] = useState(false);
|
|
57
|
-
const [openProceedModal, setOpenProceedModal] = useState(false);
|
|
58
|
-
const [isSubmittingData, setIsSubmittingData] = useState(false);
|
|
59
|
-
const [isSyncingData, setIsSyncingData] = useState(false);
|
|
60
|
-
const [isNavigating, setIsNavigating] = useState(false);
|
|
61
|
-
const [isChildBusy, setIsChildBusy] = useState(false);
|
|
62
|
-
const navigationCancelledRef = useRef(false);
|
|
63
|
-
const [lastSubmittedState, setLastSubmittedState] = useState(null);
|
|
64
|
-
const [addEvent] = useAddEventMutation();
|
|
65
|
-
const [updateEvent] = useUpdateEventMutation();
|
|
66
|
-
const [updateSocialProfiles] = useUpdateEventSocialProfilesMutation();
|
|
67
|
-
const initialData = useMemo(() => {
|
|
68
|
-
if (apiEventData) {
|
|
69
|
-
return apiEventData;
|
|
70
|
-
}
|
|
71
|
-
return {};
|
|
72
|
-
}, [apiEventData]);
|
|
73
|
-
const formProps = useStepperForm({
|
|
74
|
-
initialData,
|
|
75
|
-
storageKey: SCOPED_FORM_KEY,
|
|
76
|
-
// enableLocalStorage: !edit // Disable persistence entirely for Edit mode
|
|
77
|
-
initialStep
|
|
78
|
-
});
|
|
79
|
-
const [isNavigationBlocked, setNavigationBlocked] = useState(false);
|
|
80
|
-
const guardPushed = useRef(false);
|
|
81
|
-
const {
|
|
82
|
-
currentStep,
|
|
83
|
-
formState,
|
|
84
|
-
errors,
|
|
85
|
-
isSubmitting,
|
|
86
|
-
setField,
|
|
87
|
-
setMultipleFields,
|
|
88
|
-
handleNext: hookHandleNext,
|
|
89
|
-
handleBack,
|
|
90
|
-
handleSaveDraft,
|
|
91
|
-
setCurrentStep,
|
|
92
|
-
validateField,
|
|
93
|
-
setErrors,
|
|
94
|
-
alert,
|
|
95
|
-
setAlert,
|
|
96
|
-
closeAlert,
|
|
97
|
-
jumpToStep,
|
|
98
|
-
maxStepReached,
|
|
99
|
-
setMaxStepReached,
|
|
100
|
-
saveToLocalStorage,
|
|
101
|
-
validateStep,
|
|
102
|
-
validateFields,
|
|
103
|
-
// Allow manual triggering if strictly needed
|
|
104
|
-
touched
|
|
105
|
-
} = formProps;
|
|
106
|
-
const [isPolluted, setIsPolluted] = useState(false);
|
|
107
|
-
const STEPS = useMemo(() => {
|
|
108
|
-
if (mode === "social") {
|
|
109
|
-
const socialId = formState.participants_type === "BOTH" ? 5 : 4;
|
|
110
|
-
return [{ id: socialId, title: "Social Profiles" }];
|
|
111
|
-
}
|
|
112
|
-
if (mode === "questions") {
|
|
113
|
-
if (formState.participants_type === "BOTH") {
|
|
114
|
-
return [
|
|
115
|
-
{ id: 3, title: "Individual form setup" },
|
|
116
|
-
{ id: 4, title: "Team form setup" }
|
|
117
|
-
];
|
|
118
|
-
}
|
|
119
|
-
return [{ id: 3, title: "Information set up" }];
|
|
120
|
-
}
|
|
121
|
-
let steps = [...BASE_STEPS];
|
|
122
|
-
if (formState.participants_type === "BOTH") {
|
|
123
|
-
steps.push({ id: 3, title: "Individual form setup" });
|
|
124
|
-
steps.push({ id: 4, title: "Team form setup" });
|
|
125
|
-
steps.push({ id: 5, title: "Social Profiles" });
|
|
126
|
-
} else {
|
|
127
|
-
steps.push({ id: 3, title: "Information set up" });
|
|
128
|
-
steps.push({ id: 4, title: "Social Profiles" });
|
|
129
|
-
}
|
|
130
|
-
return steps;
|
|
131
|
-
}, [formState.participants_type, mode]);
|
|
132
|
-
useEffect(() => {
|
|
133
|
-
if (mode && STEPS.length > 0) {
|
|
134
|
-
const stepIds = STEPS.map((s) => s.id);
|
|
135
|
-
if (!stepIds.includes(currentStep)) {
|
|
136
|
-
setCurrentStep(stepIds[0]);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}, [mode, STEPS, currentStep, setCurrentStep]);
|
|
140
|
-
useEffect(() => {
|
|
141
|
-
if (!isStorageChecked) return;
|
|
142
|
-
if (!edit && !activeEventId && currentStep >= 3) {
|
|
143
|
-
setCurrentStep(1);
|
|
144
|
-
}
|
|
145
|
-
}, [currentStep, activeEventId, edit, isStorageChecked]);
|
|
146
|
-
const submitWithRetry = async (payload, isUpdate, maxRetries = 3) => {
|
|
147
|
-
let attempt = 0;
|
|
148
|
-
let delay = 1e3;
|
|
149
|
-
while (attempt < maxRetries) {
|
|
150
|
-
try {
|
|
151
|
-
const mutation = isUpdate ? updateEvent : addEvent;
|
|
152
|
-
const response = await mutation(payload).unwrap();
|
|
153
|
-
return response;
|
|
154
|
-
} catch (error) {
|
|
155
|
-
const status = error == null ? void 0 : error.status;
|
|
156
|
-
if (status === 401 || status === 403 || status === 500) {
|
|
157
|
-
throw error;
|
|
158
|
-
}
|
|
159
|
-
attempt++;
|
|
160
|
-
if (attempt === maxRetries) throw error;
|
|
161
|
-
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
162
|
-
delay *= 2;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
const buildPayload = useCallback((currentState) => {
|
|
167
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
168
|
-
const payload = {
|
|
169
|
-
closed_loop_id,
|
|
170
|
-
event_name: currentState.name,
|
|
171
|
-
venue: currentState.venue,
|
|
172
|
-
venue_place_id: currentState.venue_place_id,
|
|
173
|
-
description: currentState.description,
|
|
174
|
-
image_url: currentState == null ? void 0 : currentState.image_url,
|
|
175
|
-
thumbnail_url: (currentState == null ? void 0 : currentState.thumbnail_url) || (currentState == null ? void 0 : currentState.image_url),
|
|
176
|
-
event_start_timestamp: convertDateFormat(((_a = currentState.event_start_timestamp) == null ? void 0 : _a.date) && ((_b = currentState.event_start_timestamp) == null ? void 0 : _b.time) ? `${currentState.event_start_timestamp.date}T${currentState.event_start_timestamp.time}` : ""),
|
|
177
|
-
event_end_timestamp: convertDateFormat(((_c = currentState.event_end_timestamp) == null ? void 0 : _c.date) && ((_d = currentState.event_end_timestamp) == null ? void 0 : _d.time) ? `${currentState.event_end_timestamp.date}T${currentState.event_end_timestamp.time}` : ""),
|
|
178
|
-
registration_start_timestamp: convertDateFormat(((_e = currentState.registration_start_timestamp) == null ? void 0 : _e.date) && ((_f = currentState.registration_start_timestamp) == null ? void 0 : _f.time) ? `${currentState.registration_start_timestamp.date}T${currentState.registration_start_timestamp.time}` : ""),
|
|
179
|
-
registration_end_timestamp: convertDateFormat(((_g = currentState.registration_end_timestamp) == null ? void 0 : _g.date) && ((_h = currentState.registration_end_timestamp) == null ? void 0 : _h.time) ? `${currentState.registration_end_timestamp.date}T${currentState.registration_end_timestamp.time}` : ""),
|
|
180
|
-
// Backend expects array of strings
|
|
181
|
-
event_types: Array.isArray(currentState.event_type) ? currentState.event_type : [currentState.event_type],
|
|
182
|
-
categories: currentState.event_categories,
|
|
183
|
-
location_data: currentState.location_data,
|
|
184
|
-
location_type: (currentState.location_type || "in-person") === "in-person" ? "in-person" : "online",
|
|
185
|
-
custom_category: (currentState == null ? void 0 : currentState.custom_category) || "",
|
|
186
|
-
institution_name: (currentState == null ? void 0 : currentState.institution_name) || ""
|
|
187
|
-
};
|
|
188
|
-
if (!currentState.custom_category) delete payload.custom_category;
|
|
189
|
-
if (!((_i = currentState.event_type) == null ? void 0 : _i.includes("INTERNAL"))) delete payload.institution_name;
|
|
190
|
-
if (currentState.ticket_type === "TICKET_TIER") {
|
|
191
|
-
payload.capacity = Object.values(currentState.ticket_tiers || {}).reduce((sum, tier) => sum + (Number(tier.capacity) || 0), 0);
|
|
192
|
-
payload.ticket_tiers = Object.values(currentState.ticket_tiers || {}).map((val) => {
|
|
193
|
-
const tier = {
|
|
194
|
-
...!(val == null ? void 0 : val.isNew) ? { id: val == null ? void 0 : val.id } : {},
|
|
195
|
-
// Keep ID for existing tiers in edit mode
|
|
196
|
-
name: val == null ? void 0 : val.name,
|
|
197
|
-
description: (val == null ? void 0 : val.description) || "",
|
|
198
|
-
price: Number(val == null ? void 0 : val.price) || 0,
|
|
199
|
-
capacity: Number(val == null ? void 0 : val.capacity) || 0,
|
|
200
|
-
members: val == null ? void 0 : val.members,
|
|
201
|
-
availability_type: val == null ? void 0 : val.availability_type,
|
|
202
|
-
availability_schedule: val == null ? void 0 : val.availability_schedule
|
|
203
|
-
};
|
|
204
|
-
if (val == null ? void 0 : val.has_discount) {
|
|
205
|
-
tier.discounted_price = Number(val == null ? void 0 : val.discounted_price) || 0;
|
|
206
|
-
if (val == null ? void 0 : val.discount_valid_till) tier.discount_valid_till = convertDateFormat(val.discount_valid_till);
|
|
207
|
-
} else {
|
|
208
|
-
delete tier.discounted_price;
|
|
209
|
-
delete tier.discount_valid_till;
|
|
210
|
-
}
|
|
211
|
-
return tier;
|
|
212
|
-
});
|
|
213
|
-
payload.form = true;
|
|
214
|
-
payload.min_members = 1;
|
|
215
|
-
payload.max_members = 1;
|
|
216
|
-
payload.individual_additional_fee = 0;
|
|
217
|
-
payload.registration_fee = 0;
|
|
218
|
-
payload.capacity = (_j = payload.ticket_tiers) == null ? void 0 : _j.reduce((sum, tier) => sum + (Number(tier.capacity) || 0), 0);
|
|
219
|
-
payload.participants_type = "INDIVIDUAL";
|
|
220
|
-
} else if (currentState.ticket_type === "CUSTOM_FORM") {
|
|
221
|
-
payload.form = true;
|
|
222
|
-
payload.participants_type = currentState.participants_type;
|
|
223
|
-
if (currentState.participants_type === "TEAM" || currentState.participants_type === "BOTH") {
|
|
224
|
-
payload.min_members = Number(currentState.min_members) || 0;
|
|
225
|
-
payload.max_members = Number(currentState.max_members) || 0;
|
|
226
|
-
payload.capacity = Number(currentState.team_capacity) || 0;
|
|
227
|
-
payload.registration_fee = Number(currentState.team_price) || 0;
|
|
228
|
-
if (currentState.charge_per_delegate_fee === "YES") {
|
|
229
|
-
payload.individual_additional_fee = Number(currentState.per_member_fee) || 0;
|
|
230
|
-
} else {
|
|
231
|
-
payload.individual_additional_fee = 0;
|
|
232
|
-
}
|
|
233
|
-
if (currentState.participants_type !== "BOTH") {
|
|
234
|
-
delete payload.individual_registration_fee;
|
|
235
|
-
delete payload.individual_capacity;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if (currentState.participants_type === "INDIVIDUAL" || currentState.participants_type === "BOTH") {
|
|
239
|
-
if (currentState.participants_type !== "BOTH") {
|
|
240
|
-
payload.registration_fee = Number(currentState.individual_price || 0);
|
|
241
|
-
payload.capacity = Number(currentState.individual_capacity || 0);
|
|
242
|
-
payload.min_members = 1;
|
|
243
|
-
payload.max_members = 1;
|
|
244
|
-
payload.individual_additional_fee = 0;
|
|
245
|
-
delete payload.team_capacity;
|
|
246
|
-
delete payload.team_price;
|
|
247
|
-
} else {
|
|
248
|
-
payload.individual_registration_fee = Number(currentState.individual_price || 0);
|
|
249
|
-
payload.individual_capacity = Number(currentState.individual_capacity);
|
|
250
|
-
}
|
|
251
|
-
delete payload.ticket_tiers;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
if (activeEventId) {
|
|
255
|
-
payload.event_id = activeEventId;
|
|
256
|
-
}
|
|
257
|
-
return payload;
|
|
258
|
-
}, [organizer_id, activeEventId]);
|
|
259
|
-
const isStateDirty = useCallback((currentState, savedState) => {
|
|
260
|
-
var _a, _b, _c, _d, _e, _f;
|
|
261
|
-
if (!savedState) return true;
|
|
262
|
-
const currentPayload = buildPayload(currentState);
|
|
263
|
-
const savedPayload = buildPayload(savedState);
|
|
264
|
-
const isPayloadDirty = JSON.stringify(currentPayload) !== JSON.stringify(savedPayload);
|
|
265
|
-
if (isPayloadDirty) return true;
|
|
266
|
-
const currentSocials = {
|
|
267
|
-
instagram: ((_a = currentState.social_profiles) == null ? void 0 : _a.instagram) || "",
|
|
268
|
-
facebook: ((_b = currentState.social_profiles) == null ? void 0 : _b.facebook) || "",
|
|
269
|
-
twitter: ((_c = currentState.social_profiles) == null ? void 0 : _c.twitter) || ""
|
|
270
|
-
};
|
|
271
|
-
const savedSocials = {
|
|
272
|
-
instagram: ((_d = savedState == null ? void 0 : savedState.social_profiles) == null ? void 0 : _d.instagram) || "",
|
|
273
|
-
facebook: ((_e = savedState == null ? void 0 : savedState.social_profiles) == null ? void 0 : _e.facebook) || "",
|
|
274
|
-
twitter: ((_f = savedState == null ? void 0 : savedState.social_profiles) == null ? void 0 : _f.twitter) || ""
|
|
275
|
-
};
|
|
276
|
-
return JSON.stringify(currentSocials) !== JSON.stringify(savedSocials);
|
|
277
|
-
}, [buildPayload]);
|
|
278
|
-
const [switchConfirmation, setSwitchConfirmation] = useState({ isOpen: false, type: null });
|
|
279
|
-
const executeStep2Submit = async () => {
|
|
280
|
-
var _a, _b, _c, _d;
|
|
281
|
-
const isUpdate = !!activeEventId;
|
|
282
|
-
setIsSubmittingData(true);
|
|
283
|
-
try {
|
|
284
|
-
const payload = buildPayload(formState);
|
|
285
|
-
if (isUpdate) {
|
|
286
|
-
const serverState = apiEventData;
|
|
287
|
-
const baseline = lastSubmittedState || serverState;
|
|
288
|
-
if (baseline) {
|
|
289
|
-
const dirty = isStateDirty(formState, baseline);
|
|
290
|
-
if (!dirty) {
|
|
291
|
-
setCurrentStep(3);
|
|
292
|
-
setIsSubmittingData(false);
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
const response = await submitWithRetry(payload, isUpdate);
|
|
298
|
-
const newEventId = ((_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.event) == null ? void 0 : _b.id) || ((_c = response == null ? void 0 : response.event) == null ? void 0 : _c.id) || ((_d = response == null ? void 0 : response.data) == null ? void 0 : _d.id) || activeEventId;
|
|
299
|
-
if (newEventId) {
|
|
300
|
-
if (onEventCreated) {
|
|
301
|
-
onEventCreated(newEventId);
|
|
302
|
-
}
|
|
303
|
-
if (!edit) {
|
|
304
|
-
localStorage.setItem(SCOPED_ID_KEY, newEventId);
|
|
305
|
-
setLocalEventId(newEventId);
|
|
306
|
-
}
|
|
307
|
-
if (isUpdate) {
|
|
308
|
-
setIsSyncingData(true);
|
|
309
|
-
try {
|
|
310
|
-
await refetchEventDetails().unwrap();
|
|
311
|
-
} catch (e) {
|
|
312
|
-
console.error("Post-update sync failed", e);
|
|
313
|
-
} finally {
|
|
314
|
-
setIsSyncingData(false);
|
|
315
|
-
}
|
|
316
|
-
} else {
|
|
317
|
-
setIsSyncingData(true);
|
|
318
|
-
}
|
|
319
|
-
setLastSubmittedState(JSON.parse(JSON.stringify(formState)));
|
|
320
|
-
setMaxStepReached(3);
|
|
321
|
-
setIsPolluted(true);
|
|
322
|
-
if (!navigationCancelledRef.current) {
|
|
323
|
-
setCurrentStep(3);
|
|
324
|
-
saveToLocalStorage(formState, 3, 3);
|
|
325
|
-
} else {
|
|
326
|
-
navigationCancelledRef.current = false;
|
|
327
|
-
}
|
|
328
|
-
setAlert({
|
|
329
|
-
show: true,
|
|
330
|
-
message: isUpdate ? "Event updated successfully" : "Event created successfully",
|
|
331
|
-
type: "success"
|
|
332
|
-
});
|
|
333
|
-
} else {
|
|
334
|
-
throw new Error("No event ID returned");
|
|
335
|
-
}
|
|
336
|
-
} catch (err) {
|
|
337
|
-
console.error(err);
|
|
338
|
-
setAlert({
|
|
339
|
-
show: true,
|
|
340
|
-
message: (err == null ? void 0 : err.message) || "Failed to submit event. Please try again.",
|
|
341
|
-
type: "error"
|
|
342
|
-
});
|
|
343
|
-
} finally {
|
|
344
|
-
setIsSubmittingData(false);
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
useEffect(() => {
|
|
348
|
-
if (!edit && activeEventId && isSyncingData && !isFetchingEvent) {
|
|
349
|
-
setIsSyncingData(false);
|
|
350
|
-
}
|
|
351
|
-
}, [edit, activeEventId, isSyncingData, isFetchingEvent]);
|
|
352
|
-
const checkTypeSwitchConflict = () => {
|
|
353
|
-
const hasTiers = formState.ticket_tiers && Object.keys(formState.ticket_tiers).length > 0;
|
|
354
|
-
if (formState.ticket_type === "CUSTOM_FORM" && hasTiers) {
|
|
355
|
-
return "TO_CUSTOM";
|
|
356
|
-
}
|
|
357
|
-
if (formState.ticket_type === "TICKET_TIER") {
|
|
358
|
-
const hasCustomData = formState.participants_type && formState.participants_type !== "INDIVIDUAL" || (formState == null ? void 0 : formState.individual_price) && Number(formState == null ? void 0 : formState.individual_price) > 0 || formState.min_members && Number(formState.min_members) > 1;
|
|
359
|
-
if (hasCustomData) {
|
|
360
|
-
return "TO_TIER";
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
return null;
|
|
364
|
-
};
|
|
365
|
-
const handleSwitchConfirm = () => {
|
|
366
|
-
if (switchConfirmation.type === "TO_CUSTOM") {
|
|
367
|
-
setField("ticket_tiers", []);
|
|
368
|
-
} else if (switchConfirmation.type === "TO_TIER") {
|
|
369
|
-
setMultipleFields({
|
|
370
|
-
participants_type: void 0,
|
|
371
|
-
min_members: void 0,
|
|
372
|
-
max_members: void 0,
|
|
373
|
-
team_capacity: void 0,
|
|
374
|
-
team_price: void 0,
|
|
375
|
-
per_member_fee: void 0,
|
|
376
|
-
individual_price: void 0,
|
|
377
|
-
individual_capacity: void 0,
|
|
378
|
-
charge_per_delegate_fee: void 0,
|
|
379
|
-
charge_team_price: void 0
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
setSwitchConfirmation({ isOpen: false, type: null });
|
|
383
|
-
if (currentStep === 2) {
|
|
384
|
-
setTimeout(() => executeStep2Submit(), 0);
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
const CurrentStepComponent = useMemo(() => {
|
|
388
|
-
switch (currentStep) {
|
|
389
|
-
case 1:
|
|
390
|
-
return StepOne;
|
|
391
|
-
case 2:
|
|
392
|
-
return StepTwo;
|
|
393
|
-
case 3:
|
|
394
|
-
return IndividualFormStep;
|
|
395
|
-
case 4:
|
|
396
|
-
return formState.participants_type === "BOTH" ? TeamFormStep : SocialProfilesStep;
|
|
397
|
-
case 5:
|
|
398
|
-
return SocialProfilesStep;
|
|
399
|
-
default:
|
|
400
|
-
return StepOne;
|
|
401
|
-
}
|
|
402
|
-
}, [currentStep, formState.participants_type]);
|
|
403
|
-
const handleRouteBack = async () => {
|
|
404
|
-
var _a;
|
|
405
|
-
if ((_a = stepRef.current) == null ? void 0 : _a.save) {
|
|
406
|
-
try {
|
|
407
|
-
await stepRef.current.save();
|
|
408
|
-
} catch (err) {
|
|
409
|
-
console.error("Save-on-Click failed during Back action", err);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
if (isUnsaved) {
|
|
413
|
-
setOpenExitConfirm(true);
|
|
414
|
-
} else {
|
|
415
|
-
setIsNavigating(true);
|
|
416
|
-
router.push("/events-management");
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
const handleExitConfirm = () => {
|
|
420
|
-
setOpenExitConfirm(false);
|
|
421
|
-
setTimeout(() => {
|
|
422
|
-
setIsNavigating(true);
|
|
423
|
-
router.push("/events-management");
|
|
424
|
-
}, 200);
|
|
425
|
-
};
|
|
426
|
-
const isLastStep = STEPS.length > 0 && currentStep === STEPS[STEPS.length - 1].id;
|
|
427
|
-
const isSecondLastStep = STEPS.length > 1 && currentStep === STEPS[STEPS.length - 2].id;
|
|
428
|
-
const stepRef = useRef(null);
|
|
429
|
-
const isUnsaved = useMemo(() => {
|
|
430
|
-
var _a, _b;
|
|
431
|
-
const isBusy = ((_b = (_a = stepRef.current) == null ? void 0 : _a.isBusy) == null ? void 0 : _b.call(_a)) || isSubmitting || isSubmittingData;
|
|
432
|
-
if (isBusy) return true;
|
|
433
|
-
if (edit && apiEventData) {
|
|
434
|
-
const baseline = lastSubmittedState || apiEventData;
|
|
435
|
-
return isStateDirty(formState, baseline);
|
|
436
|
-
}
|
|
437
|
-
return false;
|
|
438
|
-
}, [edit, apiEventData, lastSubmittedState, formState, isStateDirty, isSubmitting, isSubmittingData]);
|
|
439
|
-
const isHandledByPopState = useRef(false);
|
|
440
|
-
const ignoreNextPop = useRef(false);
|
|
441
|
-
useEffect(() => {
|
|
442
|
-
const handleBeforeUnload = (e) => {
|
|
443
|
-
if (isHandledByPopState.current) {
|
|
444
|
-
isHandledByPopState.current = false;
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
if (isUnsaved) {
|
|
448
|
-
e.preventDefault();
|
|
449
|
-
e.returnValue = "";
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
const handlePopState = (e) => {
|
|
453
|
-
if (ignoreNextPop.current) {
|
|
454
|
-
ignoreNextPop.current = false;
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
if (isUnsaved) {
|
|
458
|
-
isHandledByPopState.current = true;
|
|
459
|
-
ignoreNextPop.current = true;
|
|
460
|
-
window.history.forward();
|
|
461
|
-
setTimeout(() => {
|
|
462
|
-
setOpenExitConfirm(true);
|
|
463
|
-
}, 50);
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
467
|
-
window.addEventListener("popstate", handlePopState);
|
|
468
|
-
const hasInteracted = Object.keys(touched || {}).length > 0 || isSubmittingData;
|
|
469
|
-
const shouldGuard = isUnsaved && (hasInteracted || !!edit || isSubmittingData);
|
|
470
|
-
if (shouldGuard && !guardPushed.current) {
|
|
471
|
-
window.history.pushState({ isGuard: true }, "", window.location.href);
|
|
472
|
-
guardPushed.current = true;
|
|
473
|
-
} else if (!isUnsaved && guardPushed.current) {
|
|
474
|
-
ignoreNextPop.current = true;
|
|
475
|
-
window.history.back();
|
|
476
|
-
guardPushed.current = false;
|
|
477
|
-
setTimeout(() => {
|
|
478
|
-
ignoreNextPop.current = false;
|
|
479
|
-
}, 300);
|
|
480
|
-
}
|
|
481
|
-
return () => {
|
|
482
|
-
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
483
|
-
window.removeEventListener("popstate", handlePopState);
|
|
484
|
-
};
|
|
485
|
-
}, [isUnsaved, touched, isSubmittingData]);
|
|
486
|
-
const onSaveDraft = () => {
|
|
487
|
-
handleSaveDraft();
|
|
488
|
-
setIsPolluted(true);
|
|
489
|
-
};
|
|
490
|
-
const handleNextAction = async () => {
|
|
491
|
-
var _a, _b, _c, _d, _e, _f;
|
|
492
|
-
if (currentStep === 1) {
|
|
493
|
-
hookHandleNext();
|
|
494
|
-
} else if (currentStep === 2) {
|
|
495
|
-
if (validateStep(2)) {
|
|
496
|
-
const conflictType = checkTypeSwitchConflict();
|
|
497
|
-
if (conflictType) {
|
|
498
|
-
setSwitchConfirmation({ isOpen: true, type: conflictType });
|
|
499
|
-
} else {
|
|
500
|
-
executeStep2Submit();
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
} else if (isLastStep) {
|
|
504
|
-
if (((_a = stepRef.current) == null ? void 0 : _a.validateNavigation) && !stepRef.current.validateNavigation()) {
|
|
505
|
-
return;
|
|
506
|
-
}
|
|
507
|
-
const isQuestionStep = ((_b = STEPS.find((s) => s.id === currentStep)) == null ? void 0 : _b.title.includes("form setup")) || ((_c = STEPS.find((s) => s.id === currentStep)) == null ? void 0 : _c.title) === "Information set up";
|
|
508
|
-
if (isQuestionStep && mode === "questions") {
|
|
509
|
-
setOpenProceedModal(true);
|
|
510
|
-
} else {
|
|
511
|
-
setOpenConfirmModal(true);
|
|
512
|
-
}
|
|
513
|
-
} else if (isSecondLastStep && mode !== "questions") {
|
|
514
|
-
if (((_d = stepRef.current) == null ? void 0 : _d.validateNavigation) && !stepRef.current.validateNavigation()) {
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
setOpenProceedModal(true);
|
|
518
|
-
} else {
|
|
519
|
-
if (((_e = stepRef.current) == null ? void 0 : _e.validateNavigation) && !stepRef.current.validateNavigation()) {
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
setIsSubmittingData(true);
|
|
523
|
-
try {
|
|
524
|
-
if ((_f = stepRef.current) == null ? void 0 : _f.saveForm) {
|
|
525
|
-
await stepRef.current.saveForm();
|
|
526
|
-
}
|
|
527
|
-
setCurrentStep((prev) => prev + 1);
|
|
528
|
-
} catch (err) {
|
|
529
|
-
setAlert({
|
|
530
|
-
show: true,
|
|
531
|
-
message: (err == null ? void 0 : err.message) || "Failed to save. Please try again.",
|
|
532
|
-
type: "error"
|
|
533
|
-
});
|
|
534
|
-
} finally {
|
|
535
|
-
setIsSubmittingData(false);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
540
|
-
/* @__PURE__ */ jsx(
|
|
541
|
-
FormBuilderProceedModal,
|
|
542
|
-
{
|
|
543
|
-
open: openProceedModal,
|
|
544
|
-
setOpen: setOpenProceedModal,
|
|
545
|
-
eventId: activeEventId || "",
|
|
546
|
-
eventData: apiEventData,
|
|
547
|
-
onConfirm: async () => {
|
|
548
|
-
var _a;
|
|
549
|
-
if ((_a = stepRef.current) == null ? void 0 : _a.saveForm) {
|
|
550
|
-
await stepRef.current.saveForm();
|
|
551
|
-
}
|
|
552
|
-
setOpenProceedModal(false);
|
|
553
|
-
if (isLastStep && mode === "questions") {
|
|
554
|
-
setOpenConfirmModal(true);
|
|
555
|
-
} else {
|
|
556
|
-
setCurrentStep((prev) => prev + 1);
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
),
|
|
561
|
-
/* @__PURE__ */ jsx(
|
|
562
|
-
AddEventLayout,
|
|
563
|
-
{
|
|
564
|
-
steps: STEPS,
|
|
565
|
-
currentStep,
|
|
566
|
-
maxStepReached,
|
|
567
|
-
isNavigationBlocked,
|
|
568
|
-
onJumpToStep: (id2) => {
|
|
569
|
-
var _a;
|
|
570
|
-
if (currentStep >= 3 && ((_a = stepRef.current) == null ? void 0 : _a.validateNavigation) && !stepRef.current.validateNavigation()) {
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
jumpToStep(id2);
|
|
574
|
-
},
|
|
575
|
-
onBack: () => {
|
|
576
|
-
var _a;
|
|
577
|
-
if (currentStep >= 3 && ((_a = stepRef.current) == null ? void 0 : _a.validateNavigation) && !stepRef.current.validateNavigation()) {
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
handleBack();
|
|
581
|
-
},
|
|
582
|
-
onNext: handleNextAction,
|
|
583
|
-
onSaveDraft,
|
|
584
|
-
isNavigating,
|
|
585
|
-
isSubmitting: isSubmittingData,
|
|
586
|
-
isSyncingData,
|
|
587
|
-
isChildBusy,
|
|
588
|
-
isProcessing: isClearing,
|
|
589
|
-
edit,
|
|
590
|
-
isFetching: isFetchingEvent,
|
|
591
|
-
isFetchError,
|
|
592
|
-
onRetryFetch: () => refetchEventDetails(),
|
|
593
|
-
alert,
|
|
594
|
-
onCloseAlert: closeAlert,
|
|
595
|
-
eventId: activeEventId,
|
|
596
|
-
eventData: apiEventData,
|
|
597
|
-
mode,
|
|
598
|
-
submissionModalProps: {
|
|
599
|
-
open: openConfirmModal,
|
|
600
|
-
setOpen: setOpenConfirmModal,
|
|
601
|
-
showPreview: !isLastStep,
|
|
602
|
-
isPolluted: (() => {
|
|
603
|
-
var _a, _b, _c, _d, _e, _f;
|
|
604
|
-
const currentSocials = {
|
|
605
|
-
instagram: ((_a = formState.social_profiles) == null ? void 0 : _a.instagram) || "",
|
|
606
|
-
facebook: ((_b = formState.social_profiles) == null ? void 0 : _b.facebook) || "",
|
|
607
|
-
twitter: ((_c = formState.social_profiles) == null ? void 0 : _c.twitter) || ""
|
|
608
|
-
};
|
|
609
|
-
const serverSocials = {
|
|
610
|
-
instagram: ((_d = apiEventData == null ? void 0 : apiEventData.social_profiles) == null ? void 0 : _d.instagram) || "",
|
|
611
|
-
facebook: ((_e = apiEventData == null ? void 0 : apiEventData.social_profiles) == null ? void 0 : _e.facebook) || "",
|
|
612
|
-
twitter: ((_f = apiEventData == null ? void 0 : apiEventData.social_profiles) == null ? void 0 : _f.twitter) || ""
|
|
613
|
-
};
|
|
614
|
-
const isSocialDirty = JSON.stringify(currentSocials) !== JSON.stringify(serverSocials);
|
|
615
|
-
return isPolluted || isSocialDirty;
|
|
616
|
-
})(),
|
|
617
|
-
onSubmit: async () => {
|
|
618
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
619
|
-
const currentStepTitle = (_a = STEPS.find((s) => s.id === currentStep)) == null ? void 0 : _a.title;
|
|
620
|
-
const isSocialStep = currentStepTitle === "Social Profiles";
|
|
621
|
-
if (isSocialStep) {
|
|
622
|
-
try {
|
|
623
|
-
const currentSocials = {
|
|
624
|
-
instagram: ((_b = formState.social_profiles) == null ? void 0 : _b.instagram) || "",
|
|
625
|
-
facebook: ((_c = formState.social_profiles) == null ? void 0 : _c.facebook) || "",
|
|
626
|
-
twitter: ((_d = formState.social_profiles) == null ? void 0 : _d.twitter) || ""
|
|
627
|
-
};
|
|
628
|
-
const serverSocials = {
|
|
629
|
-
instagram: ((_e = apiEventData == null ? void 0 : apiEventData.social_profiles) == null ? void 0 : _e.instagram) || "",
|
|
630
|
-
facebook: ((_f = apiEventData == null ? void 0 : apiEventData.social_profiles) == null ? void 0 : _f.facebook) || "",
|
|
631
|
-
twitter: ((_g = apiEventData == null ? void 0 : apiEventData.social_profiles) == null ? void 0 : _g.twitter) || ""
|
|
632
|
-
};
|
|
633
|
-
const isSocialDirty = JSON.stringify(currentSocials) !== JSON.stringify(serverSocials);
|
|
634
|
-
if (isSocialDirty) {
|
|
635
|
-
const cleanedProfiles = Object.fromEntries(
|
|
636
|
-
Object.entries(currentSocials).filter(([_, v]) => v !== "")
|
|
637
|
-
);
|
|
638
|
-
await updateSocialProfiles({
|
|
639
|
-
event_id: activeEventId,
|
|
640
|
-
social_profiles: cleanedProfiles
|
|
641
|
-
}).unwrap();
|
|
642
|
-
setIsPolluted(true);
|
|
643
|
-
}
|
|
644
|
-
return activeEventId || "";
|
|
645
|
-
} catch (err) {
|
|
646
|
-
console.error("Final submit failed", err);
|
|
647
|
-
throw new Error(((_h = err == null ? void 0 : err.data) == null ? void 0 : _h.message) || (err == null ? void 0 : err.message) || "Failed to submit social profiles. Please try again.");
|
|
648
|
-
}
|
|
649
|
-
} else {
|
|
650
|
-
if ((_i = stepRef.current) == null ? void 0 : _i.saveForm) {
|
|
651
|
-
try {
|
|
652
|
-
await stepRef.current.saveForm();
|
|
653
|
-
} catch (e) {
|
|
654
|
-
console.error("Save failed during submission", e);
|
|
655
|
-
throw new Error("Failed to save questions. Please try again.");
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
return activeEventId || "";
|
|
659
|
-
}
|
|
660
|
-
},
|
|
661
|
-
onSuccess: (type) => {
|
|
662
|
-
if (isLastStep) {
|
|
663
|
-
if (type === "submit") {
|
|
664
|
-
setTimeout(() => {
|
|
665
|
-
router.push("/events-management");
|
|
666
|
-
}, 300);
|
|
667
|
-
} else {
|
|
668
|
-
setTimeout(() => {
|
|
669
|
-
router.push("/events-management");
|
|
670
|
-
}, 300);
|
|
671
|
-
}
|
|
672
|
-
} else {
|
|
673
|
-
setCurrentStep((prev) => prev + 1);
|
|
674
|
-
setOpenConfirmModal(false);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
},
|
|
678
|
-
switchConfirmationModalProps: {
|
|
679
|
-
open: switchConfirmation.isOpen,
|
|
680
|
-
onClose: () => setSwitchConfirmation({ isOpen: false, type: null }),
|
|
681
|
-
onConfirm: handleSwitchConfirm,
|
|
682
|
-
title: "Please confirm before proceeding?",
|
|
683
|
-
description: switchConfirmation.type === "TO_CUSTOM" ? "You are proceeding to the next step while selecting 'Custom form', it will remove all your existing ticket tiers. This action cannot be undone." : "You are proceeding to the next step while selecting 'Ticket tier', it will remove all your existing custom form data. This action cannot be undone."
|
|
684
|
-
},
|
|
685
|
-
onRouteBack: handleRouteBack,
|
|
686
|
-
exitConfirmationModalProps: {
|
|
687
|
-
open: openExitConfirm,
|
|
688
|
-
onClose: () => setOpenExitConfirm(false),
|
|
689
|
-
onConfirm: handleExitConfirm
|
|
690
|
-
},
|
|
691
|
-
children: /* @__PURE__ */ jsx(
|
|
692
|
-
CurrentStepComponent,
|
|
693
|
-
{
|
|
694
|
-
ref: currentStep >= 3 ? stepRef : null,
|
|
695
|
-
formState,
|
|
696
|
-
setField,
|
|
697
|
-
setMultipleFields,
|
|
698
|
-
errors,
|
|
699
|
-
validateField,
|
|
700
|
-
setErrors,
|
|
701
|
-
eventData: apiEventData,
|
|
702
|
-
eventId: activeEventId || "",
|
|
703
|
-
setNavigationBlocked,
|
|
704
|
-
isSameQuestionTitleAllowed,
|
|
705
|
-
allowedDiscountQuestions: 1,
|
|
706
|
-
onBusyStateChange: setIsChildBusy,
|
|
707
|
-
isBusy: isChildBusy,
|
|
708
|
-
onPolluted: () => setIsPolluted(true)
|
|
709
|
-
}
|
|
710
|
-
)
|
|
711
|
-
}
|
|
712
|
-
)
|
|
713
|
-
] });
|
|
714
|
-
};
|
|
715
|
-
const AddEventStepper$1 = memo(AddEventStepper);
|
|
716
|
-
export {
|
|
717
|
-
AddEventStepper$1 as default
|
|
718
|
-
};
|
|
719
|
-
//# sourceMappingURL=AddEventStepper.js.map
|