@scbt-ecom/ui 0.93.0 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/lib/configs/tailwindConfigBase.js.map +1 -1
- package/dist/lib/configs/tailwindPresets/resetPreset.js.map +1 -1
- package/dist/lib/next/utils/hasWidget.js.map +1 -1
- package/dist/lib/next/utils/hideWidgetsWithQueryParams.js.map +1 -1
- package/dist/lib/next/utils/orderWidgetWithQueryParams.js.map +1 -1
- package/dist/lib/shared/api/apiInstance.js.map +1 -1
- package/dist/lib/shared/hooks/useClickOutside.js.map +1 -1
- package/dist/lib/shared/hooks/useDebounce.js.map +1 -1
- package/dist/lib/shared/hooks/useDevice.js.map +1 -1
- package/dist/lib/shared/hooks/useFieldsProgress.js.map +1 -1
- package/dist/lib/shared/hooks/useFloating.js.map +1 -1
- package/dist/lib/shared/hooks/useObserverWidgets.js.map +1 -1
- package/dist/lib/shared/hooks/useOverflow.js.map +1 -1
- package/dist/lib/shared/ui/accordion/Accordion.js.map +1 -1
- package/dist/lib/shared/ui/calendar/Calendar.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/MonthCaption.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/Navigation.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/SelectDate.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/ui/SelectList.js.map +1 -1
- package/dist/lib/shared/ui/carousel/CarouselNative.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useArrowNavigation.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useCarousel.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useDotsNavigation.js.map +1 -1
- package/dist/lib/shared/ui/carousel/ui/CarouselContent.js.map +1 -1
- package/dist/lib/shared/ui/dialog/Dialog.js.map +1 -1
- package/dist/lib/shared/ui/dropdownList/DropdownList.js.map +1 -1
- package/dist/lib/shared/ui/dropdownList/hooks/useKeyboardNavigation.js.map +1 -1
- package/dist/lib/shared/ui/dropdownList/ui/dropdownItem/DropdownItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/combobox/ComboboxControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/address/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/auto/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/country/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/fio/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/party/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/model/utils.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/range.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/single.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/model/config.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/Editor.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/setCustomLink.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/inputCurrency/InputCurrencyControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/inputCurrency/model/useInputCurrency.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/select/SelectControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/autocomplete/Autocomplete.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/checkbox/Checkbox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/combobox/combobox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/combobox/hooks/useCombobox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/dayPicker/DayPicker.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/input/Input.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/inputOtp/InputOtpBase.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/radio/RadioGroup.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/radio/ui/RadioItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/Select.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/hooks/useSelectController.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/ui/Chip.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/ui/SelectItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/model/useLogarithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/Slider.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/SliderAlgorithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/hooks/useSliderAlgorithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/SliderMarks.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/hooks/useSliderMarks.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/SliderStep.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/hooks/useSliderStep.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/switch/Switch.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/textarea/Textarea.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/UploaderBase.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/model/hooks/useUploader.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/ui/UploaderInput.js.map +1 -1
- package/dist/lib/shared/ui/modal/Modal.js.map +1 -1
- package/dist/lib/shared/ui/modal/ui/IframeModalContent.js.map +1 -1
- package/dist/lib/shared/ui/pagination/Pagination.js.map +1 -1
- package/dist/lib/shared/ui/providers/NotificationProvider.js.map +1 -1
- package/dist/lib/shared/ui/slot/Slot.js.map +1 -1
- package/dist/lib/shared/ui/slot/model/mergeProps.js.map +1 -1
- package/dist/lib/shared/ui/slot/ui/SlotClone.js.map +1 -1
- package/dist/lib/shared/ui/tabSwitcher/ui/TabContent.js.map +1 -1
- package/dist/lib/shared/ui/table/Mobile.js.map +1 -1
- package/dist/lib/shared/ui/table/model/TableUtils.js.map +1 -1
- package/dist/lib/shared/ui/table/ui/editableCell/EditableCell.js.map +1 -1
- package/dist/lib/shared/utils/localStorageActions.js.map +1 -1
- package/dist/lib/shared/utils/mergeRefs.js.map +1 -1
- package/dist/lib/shared/utils/scrollToElement.js.map +1 -1
- package/dist/lib/shared/utils/sessionStorage.js.map +1 -1
- package/dist/lib/shared/utils/typeGuards.js.map +1 -1
- package/dist/lib/shared/validation/base/base.constants.js.map +1 -1
- package/dist/lib/shared/validation/base/date.validators.js.map +1 -1
- package/dist/lib/shared/validation/base/phone.validators.js.map +1 -1
- package/dist/lib/shared/validation/base/select.validators.js.map +1 -1
- package/dist/lib/shared/validation/dadata/fio.validators.js.map +1 -1
- package/dist/lib/shared/validation/utils/zodUtils.js.map +1 -1
- package/dist/lib/widgets/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/lib/widgets/buttonWithHandlers/model/useButtonHandler.js.map +1 -1
- package/dist/lib/widgets/calculator/CalculatorView.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorFields/hooks/useAdditionalSlider.js.map +1 -1
- package/dist/lib/widgets/dynamicForm/DynamicForm.js.map +1 -1
- package/dist/lib/widgets/dynamicFormDialog/DynamicFormDialog.js.map +1 -1
- package/dist/lib/widgets/fieldMapper/FieldMapper.js.map +1 -1
- package/dist/lib/widgets/footer/ui/Ligal.js.map +1 -1
- package/dist/lib/widgets/htmlParser/baseHtmlParser.js.map +1 -1
- package/dist/lib/widgets/htmlParser/htmlParser.js.map +1 -1
- package/dist/lib/widgets/htmlParser/reactHtmlParser.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoriesDesktop.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoryTabs.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/rootTab/RootTab.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/Menu.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/MenuItem.js.map +1 -1
- package/dist/lib/widgets/userFeedback/model/hooks/useRating.js.map +1 -1
- package/dist/lib/widgets/userFeedback/ui/FeedbackTrigger.js.map +1 -1
- package/dist/lib/widgets/userFeedback/ui/UserReview.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectSpread2.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js.map +1 -1
- package/dist/node_modules/@date-fns/tz/date/index.js.map +1 -1
- package/dist/node_modules/@date-fns/tz/date/mini.js.map +1 -1
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js.map +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -1
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -1
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/internal/floating.js.map +1 -1
- package/dist/node_modules/@headlessui/react/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -1
- package/dist/node_modules/@headlessui/react/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useHover.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/utils.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/mutation.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/removable.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/retryer.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/thenable.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/suspense.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -1
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js.map +1 -1
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js.map +1 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js.map +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-character-count/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-color/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-history/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-list-item/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-text-style/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -1
- package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -1
- package/dist/node_modules/classnames/index.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/format/formatters.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -1
- package/dist/node_modules/date-fns/format.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/ru/_lib/formatRelative.js.map +1 -1
- package/dist/node_modules/date-fns/max.js.map +1 -1
- package/dist/node_modules/date-fns/min.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/Setter.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DateParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/EraParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/MonthParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/SecondParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/YearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/utils.js.map +1 -1
- package/dist/node_modules/date-fns/parse.js.map +1 -1
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -1
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js.map +1 -1
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -1
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -1
- package/dist/node_modules/file-selector/dist/es2015/file-selector.js.map +1 -1
- package/dist/node_modules/file-selector/dist/es2015/file.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/generators/inertia.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/generators/spring/find.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/generators/spring/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/easing/utils/map.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/frameloop/batcher.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/frameloop/render-step.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/frameloop/sync-time.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/Feature.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/animation/mix-values.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/transform.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/VisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/create-factory.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/config-motion.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/flat-tree.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/get-variant-context.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/motion-values.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/resolve-variants.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/setters.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/delay.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/interpolate.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/mix/complex.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/offsets/fill.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/subscription-manager.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/types/complex/filter.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/types/complex/index.js.map +1 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/controls/BaseGroup.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/controls/Group.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js.map +1 -1
- package/dist/node_modules/orderedmap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Handles/Handle.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Handles/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Marks/Mark.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Marks/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Slider.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Steps/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Tracks/Track.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Tracks/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/hooks/useDrag.js.map +1 -1
- package/dist/node_modules/rc-slider/es/hooks/useOffset.js.map +1 -1
- package/dist/node_modules/rc-slider/es/hooks/useRange.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useEvent.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useLayoutEffect.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useMergedState.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useState.js.map +1 -1
- package/dist/node_modules/rc-util/es/isEqual.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js.map +1 -1
- package/dist/node_modules/react-dropzone/dist/es/index.js.map +1 -1
- package/dist/node_modules/react-dropzone/dist/es/utils/index.js.map +1 -1
- package/dist/node_modules/react-hook-form/dist/index.esm.js +1 -1
- package/dist/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/dist/node_modules/react-number-format/dist/react-number-format.es.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -1
- package/dist/node_modules/rope-sequence/dist/index.js.map +1 -1
- package/dist/node_modules/tailwindcss/lib/public/create-plugin.js.map +1 -1
- package/dist/node_modules/tailwindcss/lib/util/createPlugin.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/zod/v3/ZodError.js.map +1 -1
- package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +1 -1
- package/dist/node_modules/zod/v3/helpers/util.js.map +1 -1
- package/dist/node_modules/zod/v3/types.js.map +1 -1
- package/dist/src/shared/utils/getDynamicSchema.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAdditionalSlider.js","sources":["../../../../../../../lib/widgets/calculator/ui/calculatorFields/hooks/useAdditionalSlider.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { type FieldValues, type Path, type PathValue, useFormContext } from 'react-hook-form'\nimport { TypeGuards } from '../../../../../shared/utils'\nimport { type AdditionalSliderGroupConfig, type SlidersGroupProps } from '../ui'\n\ninterface UseAdditionalSlider<T extends FieldValues> {\n additionalSliderGroupConfig?: AdditionalSliderGroupConfig<T>\n slidersGroupConfig?: SlidersGroupProps<T>\n}\n\nconst ADDITIONAL_MONEY_MINIMUM = 20_000\n\nexport const useAdditionalSlider = <T extends FieldValues>({\n slidersGroupConfig,\n additionalSliderGroupConfig\n}: UseAdditionalSlider<T>) => {\n const [sliderVisible, setSliderVisible] = useState<boolean>(false)\n\n const { watch, setValue } = useFormContext<T>()\n\n const sliderSumGroup = slidersGroupConfig?.fields.find(({ args }) => args.name === 'sum')\n const { args } = sliderSumGroup || {}\n const { max: sumMax, name: sumName, defaultValue: sumDefaultValue } = args || {}\n const sumValue = watch(sumName as Path<T>)\n\n const { min: additionalSliderMin, name: additionalSliderName } = additionalSliderGroupConfig?.args ?? {}\n const additionalSliderValue = watch(additionalSliderName as Path<T>)\n const additionalSliderMax = Number(sumMax ?? 0) - (sumValue ?? sumDefaultValue)\n\n useEffect(() => {\n if (additionalSliderValue > additionalSliderMax) {\n setValue(additionalSliderName as Path<T>, additionalSliderMax as PathValue<T, Path<T>>)\n }\n }, [additionalSliderMax, additionalSliderValue, setValue, sumValue])\n\n useEffect(() => {\n if (Number(sumMax) === sumValue) {\n setSliderVisible(false)\n }\n }, [setSliderVisible, sumMax, sumValue])\n\n const onCheckedChange = () => {\n setSliderVisible((prevValue) => !prevValue)\n\n if (additionalSliderValue <= 0) {\n setValue(additionalSliderName as Path<T>, additionalSliderMin as PathValue<T, Path<T>>)\n }\n\n if (Number(sumMax) === sumValue) {\n setValue((sumName ?? '') as Path<T>, (sumValue - ADDITIONAL_MONEY_MINIMUM) as PathValue<T, Path<T>>)\n setValue(additionalSliderName as Path<T>, additionalSliderMin as PathValue<T, Path<T>>)\n }\n }\n\n return {\n sliderVisible,\n setSliderVisible,\n sumMax,\n sumName,\n sumDefaultValue,\n sumValue,\n additionalSliderMax,\n onCheckedChange,\n sliderSumExist: !TypeGuards.isObjectEmpty(sliderSumGroup?.args),\n sliderSumCorrectType: sliderSumGroup?.args.componentType === 'algorithmic' || sliderSumGroup?.args.componentType === 'step'\n }\n}\n"],"names":["ADDITIONAL_MONEY_MINIMUM","useAdditionalSlider","slidersGroupConfig","additionalSliderGroupConfig","sliderVisible","setSliderVisible","useState","watch","setValue","useFormContext","sliderSumGroup","args","sumMax","sumName","sumDefaultValue","sumValue","additionalSliderMin","additionalSliderName","additionalSliderValue","additionalSliderMax","useEffect","prevValue","TypeGuards"],"mappings":"gPAUA,MAAMA,EAA2B,IAEpBC,EAAsB,CAAwB,CACzD,mBAAAC,EACA,4BAAAC,CACF,IAA8B,CAC5B,KAAM,CAACC,EAAeC,CAAgB,EAAIC,EAAkB,EAAK,EAE3D,CAAE,MAAAC,EAAO,SAAAC,CAAA,EAAaC,EAAA,EAEtBC,EAAiBR,GAAA,YAAAA,EAAoB,OAAO,KAAK,CAAC,CAAE,KAAAS,CAAAA,IAAWA,EAAK,OAAS,OAC7E,CAAE,KAAAA,GAASD,GAAkB,CAAA,EAC7B,CAAE,IAAKE,EAAQ,KAAMC,EAAS,aAAcC,GAAoBH,GAAQ,CAAA,EACxEI,EAAWR,EAAMM,CAAkB,EAEnC,CAAE,IAAKG,EAAqB,KAAMC,IAAyBd,GAAA,YAAAA,EAA6B,OAAQ,CAAA,EAChGe,EAAwBX,EAAMU,CAA+B,EAC7DE,EAAsB,OAAOP,GAAU,CAAC,GAAKG,GAAYD,GAE/D,OAAAM,EAAU,IAAM,CACVF,EAAwBC,GAC1BX,EAASS,EAAiCE,CAA4C,
|
|
1
|
+
{"version":3,"file":"useAdditionalSlider.js","sources":["../../../../../../../lib/widgets/calculator/ui/calculatorFields/hooks/useAdditionalSlider.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { type FieldValues, type Path, type PathValue, useFormContext } from 'react-hook-form'\nimport { TypeGuards } from '../../../../../shared/utils'\nimport { type AdditionalSliderGroupConfig, type SlidersGroupProps } from '../ui'\n\ninterface UseAdditionalSlider<T extends FieldValues> {\n additionalSliderGroupConfig?: AdditionalSliderGroupConfig<T>\n slidersGroupConfig?: SlidersGroupProps<T>\n}\n\nconst ADDITIONAL_MONEY_MINIMUM = 20_000\n\nexport const useAdditionalSlider = <T extends FieldValues>({\n slidersGroupConfig,\n additionalSliderGroupConfig\n}: UseAdditionalSlider<T>) => {\n const [sliderVisible, setSliderVisible] = useState<boolean>(false)\n\n const { watch, setValue } = useFormContext<T>()\n\n const sliderSumGroup = slidersGroupConfig?.fields.find(({ args }) => args.name === 'sum')\n const { args } = sliderSumGroup || {}\n const { max: sumMax, name: sumName, defaultValue: sumDefaultValue } = args || {}\n const sumValue = watch(sumName as Path<T>)\n\n const { min: additionalSliderMin, name: additionalSliderName } = additionalSliderGroupConfig?.args ?? {}\n const additionalSliderValue = watch(additionalSliderName as Path<T>)\n const additionalSliderMax = Number(sumMax ?? 0) - (sumValue ?? sumDefaultValue)\n\n useEffect(() => {\n if (additionalSliderValue > additionalSliderMax) {\n setValue(additionalSliderName as Path<T>, additionalSliderMax as PathValue<T, Path<T>>)\n }\n }, [additionalSliderMax, additionalSliderValue, setValue, sumValue])\n\n useEffect(() => {\n if (Number(sumMax) === sumValue) {\n setSliderVisible(false)\n }\n }, [setSliderVisible, sumMax, sumValue])\n\n const onCheckedChange = () => {\n setSliderVisible((prevValue) => !prevValue)\n\n if (additionalSliderValue <= 0) {\n setValue(additionalSliderName as Path<T>, additionalSliderMin as PathValue<T, Path<T>>)\n }\n\n if (Number(sumMax) === sumValue) {\n setValue((sumName ?? '') as Path<T>, (sumValue - ADDITIONAL_MONEY_MINIMUM) as PathValue<T, Path<T>>)\n setValue(additionalSliderName as Path<T>, additionalSliderMin as PathValue<T, Path<T>>)\n }\n }\n\n return {\n sliderVisible,\n setSliderVisible,\n sumMax,\n sumName,\n sumDefaultValue,\n sumValue,\n additionalSliderMax,\n onCheckedChange,\n sliderSumExist: !TypeGuards.isObjectEmpty(sliderSumGroup?.args),\n sliderSumCorrectType: sliderSumGroup?.args.componentType === 'algorithmic' || sliderSumGroup?.args.componentType === 'step'\n }\n}\n"],"names":["ADDITIONAL_MONEY_MINIMUM","useAdditionalSlider","slidersGroupConfig","additionalSliderGroupConfig","sliderVisible","setSliderVisible","useState","watch","setValue","useFormContext","sliderSumGroup","args","sumMax","sumName","sumDefaultValue","sumValue","additionalSliderMin","additionalSliderName","additionalSliderValue","additionalSliderMax","useEffect","prevValue","TypeGuards"],"mappings":"gPAUA,MAAMA,EAA2B,IAEpBC,EAAsB,CAAwB,CACzD,mBAAAC,EACA,4BAAAC,CACF,IAA8B,CAC5B,KAAM,CAACC,EAAeC,CAAgB,EAAIC,EAAkB,EAAK,EAE3D,CAAE,MAAAC,EAAO,SAAAC,CAAA,EAAaC,EAAA,EAEtBC,EAAiBR,GAAA,YAAAA,EAAoB,OAAO,KAAK,CAAC,CAAE,KAAAS,CAAAA,IAAWA,EAAK,OAAS,OAC7E,CAAE,KAAAA,GAASD,GAAkB,CAAA,EAC7B,CAAE,IAAKE,EAAQ,KAAMC,EAAS,aAAcC,GAAoBH,GAAQ,CAAA,EACxEI,EAAWR,EAAMM,CAAkB,EAEnC,CAAE,IAAKG,EAAqB,KAAMC,IAAyBd,GAAA,YAAAA,EAA6B,OAAQ,CAAA,EAChGe,EAAwBX,EAAMU,CAA+B,EAC7DE,EAAsB,OAAOP,GAAU,CAAC,GAAKG,GAAYD,GAE/D,OAAAM,EAAU,IAAM,CACVF,EAAwBC,GAC1BX,EAASS,EAAiCE,CAA4C,CAE1F,EAAG,CAACA,EAAqBD,EAAuBV,EAAUO,CAAQ,CAAC,EAEnEK,EAAU,IAAM,CACV,OAAOR,CAAM,IAAMG,GACrBV,EAAiB,EAAK,CAE1B,EAAG,CAACA,EAAkBO,EAAQG,CAAQ,CAAC,EAehC,CACL,cAAAX,EACA,iBAAAC,EACA,OAAAO,EACA,QAAAC,EACA,gBAAAC,EACA,SAAAC,EACA,oBAAAI,EACA,gBArBsB,IAAM,CAC5Bd,EAAkBgB,GAAc,CAACA,CAAS,EAEtCH,GAAyB,GAC3BV,EAASS,EAAiCD,CAA4C,EAGpF,OAAOJ,CAAM,IAAMG,IACrBP,EAAUK,GAAW,GAAiBE,EAAWf,CAAkD,EACnGQ,EAASS,EAAiCD,CAA4C,EAE1F,EAWE,eAAgB,CAACM,EAAW,cAAcZ,GAAA,YAAAA,EAAgB,IAAI,EAC9D,sBAAsBA,GAAA,YAAAA,EAAgB,KAAK,iBAAkB,gBAAiBA,GAAA,YAAAA,EAAgB,KAAK,iBAAkB,MAAA,CAEzH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.js","sources":["../../../../lib/widgets/dynamicForm/DynamicForm.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\nimport { type Control, type FieldValues, type SubmitHandler } from 'react-hook-form'\nimport { type TypeOf } from 'zod'\nimport { HTMLRenderer } from '../htmlParser'\nimport { widgetIds } from '../model'\nimport {\n type Approvement,\n type ApprovementType,\n type Chips,\n type ChipsType,\n getFieldsProgress,\n type Progress,\n type ProgressField,\n type ProgressType\n} from './model'\nimport { type FieldValidation, getDynamicSchema } from '@/shared/utils'\nimport { useControlledForm, useFieldsProgress } from '$/shared/hooks'\nimport {\n Button,\n type ButtonProps,\n CheckboxBase,\n type CheckedState,\n Heading,\n Icon,\n ProgressBar,\n ResponsiveContainer\n} from '$/shared/ui'\nimport { cn } from '$/shared/utils'\nimport { ZodUtils } from '$/shared/validation'\nimport { type FieldElement, FieldMapper } from '$/widgets/fieldMapper'\nimport { QueryClientProvider } from '$/widgets/queryClientProvider'\n\ntype SubmitProps = {\n submitCallback: <T extends FieldValues>(values: T) => void\n}\n\ntype ChipsClasses = {\n root?: string\n icon?: string\n}\ntype ApprovementClasses = {\n checkbox?: React.ComponentProps<typeof CheckboxBase>['classes']\n content?: string\n}\n\ntype DynamicFormClasses = {\n root?: string\n title?: string\n fields?: string\n form?: string\n chips?: ChipsClasses\n approvement?: ApprovementClasses\n progressBar?: React.ComponentProps<typeof ProgressBar>['classes']\n submit?: string\n}\n\nexport type DynamicFormProps<AType extends ApprovementType, CType extends ChipsType, PType extends ProgressType> = {\n fields: FieldElement<any, any, { validation: FieldValidation; progress: ProgressField }>[]\n title: string\n progress: Progress<PType>\n approvement: Approvement<AType>\n chips: Chips<CType>\n submitProps?: SubmitProps\n classes?: DynamicFormClasses\n buttonGroup: ButtonProps[]\n}\n\nconst withApprovement = <Type extends ApprovementType>(\n approvement: Approvement<Type>,\n checked: CheckedState,\n onCheckedChange: (checked: CheckedState) => void,\n classes?: ApprovementClasses\n): React.ReactNode => {\n if (approvement.type === 'off') return null\n\n if (approvement.type === 'text') {\n return <HTMLRenderer html={approvement.message} as='div' className={classes?.content} />\n }\n\n return (\n <label\n className={cn(\n 'mob-body-regular-s text-color-dark',\n 'desktop:desk-body-regular-m desktop:gap-x-4',\n 'flex items-center justify-items-start gap-x-3'\n )}\n >\n <CheckboxBase classes={classes?.checkbox} checked={checked} onCheckedChange={onCheckedChange} />\n <HTMLRenderer html={approvement.content} as='div' className={classes?.content} />\n </label>\n )\n}\n\nexport const DynamicForm = <AType extends ApprovementType, CType extends ChipsType, PType extends ProgressType>({\n fields,\n title,\n progress,\n approvement,\n chips,\n submitProps,\n classes,\n buttonGroup\n}: DynamicFormProps<AType, CType, PType>) => {\n const { submitCallback } = submitProps || {}\n\n const [checked, onCheckedChange] = useState<CheckedState>(false)\n\n const schema = getDynamicSchema(fields)\n const defaultValues = ZodUtils.getZodDefaults(schema)\n\n const { control, handleSubmit } = useControlledForm({\n schema,\n defaultValues,\n mode: 'onBlur'\n })\n\n const fieldsProgress = getFieldsProgress(progress, fields)\n\n const formattedProgress = useFieldsProgress({ control, fields: fieldsProgress || [], schema })\n\n const onSubmit: SubmitHandler<TypeOf<typeof schema>> = (values) => {\n if (submitCallback) submitCallback({ ...values, agree: checked })\n }\n\n return (\n <QueryClientProvider>\n <section id={widgetIds.form} data-test-id={widgetIds.form} className={cn('w-full', classes?.root)}>\n <ResponsiveContainer\n className={cn(\n '!max-w-[636px] border-warm-grey-200 px-4 desktop:gap-8 desktop:p-14',\n 'relative mx-auto flex flex-col gap-6 rounded-sm py-8 desktop:border'\n )}\n >\n {chips.enabled && (\n <div\n className={cn(\n 'desk-body-regular-l flex items-center gap-x-2 rounded-sm desktop:absolute',\n 'bg-color-blue-grey-100 px-2 py-1 text-color-tetriary',\n 'right-4 top-4 w-max',\n classes?.chips?.root\n )}\n >\n {chips.image && <Icon name={chips.image} className={cn('size-6', classes?.chips?.icon)} />}\n {chips.content}\n </div>\n )}\n <Heading as='h2' className={cn('desktop:hidden', classes?.title)}>\n {title}\n </Heading>\n <Heading as='h3' className={cn('mobile:hidden', classes?.title)}>\n {title}\n </Heading>\n <form\n onSubmit={handleSubmit(onSubmit)}\n className={cn('flex w-full flex-col gap-y-6', 'desktop:gap-y-8', classes?.form)}\n >\n {progress.enabled && (\n <ProgressBar\n progress={formattedProgress}\n topContent={<HTMLRenderer html={progress.title} />}\n bottomContent={<HTMLRenderer html={progress.subtitle} />}\n maxPercent={progress.maxPercent}\n classes={classes?.progressBar}\n />\n )}\n <FieldMapper control={control as unknown as Control} fields={fields} />\n <div className='mob-body-regular-m flex flex-col items-start justify-center gap-4'>\n {withApprovement(approvement, checked, onCheckedChange, classes?.approvement)}\n <div className='flex w-full flex-col items-center justify-center gap-4 desktop:flex-row'>\n {buttonGroup?.map((button, index) => {\n const disabled = button.type === 'submit' && approvement.type === 'checkbox' ? !checked : false\n\n return (\n <Button\n {...button}\n key={index}\n disabled={disabled}\n className={cn(\n 'w-full whitespace-nowrap',\n {\n 'w-full': Boolean(approvement)\n },\n classes?.submit\n )}\n />\n )\n })}\n </div>\n </div>\n </form>\n </ResponsiveContainer>\n </section>\n </QueryClientProvider>\n )\n}\n\nexport default DynamicForm\n"],"names":["withApprovement","approvement","checked","onCheckedChange","classes","jsx","HTMLRenderer","jsxs","cn","CheckboxBase","DynamicForm","fields","title","progress","chips","submitProps","buttonGroup","submitCallback","useState","schema","getDynamicSchema","defaultValues","ZodUtils","control","handleSubmit","useControlledForm","fieldsProgress","getFieldsProgress","formattedProgress","useFieldsProgress","onSubmit","values","QueryClientProvider","widgetIds","ResponsiveContainer","_a","Icon","_b","Heading","ProgressBar","FieldMapper","button","index","disabled","createElement","Button"],"mappings":"65FAqEA,MAAMA,EAAkB,CACtBC,EACAC,EACAC,EACAC,IAEIH,EAAY,OAAS,MAAc,KAEnCA,EAAY,OAAS,OAChBI,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,EAItFG,EAAC,QAAA,CACC,UAAWC,EACT,qCACA,8CACA,+CAAA,EAGF,SAAA,CAAAH,EAACI,EAAA,CAAa,QAASL,GAAA,YAAAA,EAAS,SAAU,QAAAF,EAAkB,gBAAAC,EAAkC,EAC9FE,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,CAAA,CAAA,CAAA,EAKxEM,GAAc,CAAqF,CAC9G,OAAAC,EACA,MAAAC,EACA,SAAAC,EACA,YAAAZ,EACA,MAAAa,EACA,YAAAC,EACA,QAAAX,EACA,YAAAY,CACF,IAA6C,SAC3C,KAAM,CAAE,eAAAC,GAAmBF,GAAe,CAAA,EAEpC,CAACb,EAASC,CAAe,EAAIe,EAAuB,EAAK,EAEzDC,EAASC,EAAiBT,CAAM,EAChCU,EAAgBC,EAAS,eAAeH,CAAM,EAE9C,CAAE,QAAAI,EAAS,aAAAC,CAAA,EAAiBC,EAAkB,CAClD,OAAAN,EACA,cAAAE,EACA,KAAM,QAAA,CACP,EAEKK,EAAiBC,EAAkBd,EAAUF,CAAM,EAEnDiB,EAAoBC,EAAkB,CAAE,QAAAN,EAAS,OAAQG,GAAkB,CAAA,EAAI,OAAAP,EAAQ,EAEvFW,EAAkDC,GAAW,CAC7Dd,GAAgBA,EAAe,CAAE,GAAGc,EAAQ,MAAO7B,EAAS,
|
|
1
|
+
{"version":3,"file":"DynamicForm.js","sources":["../../../../lib/widgets/dynamicForm/DynamicForm.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\nimport { type Control, type FieldValues, type SubmitHandler } from 'react-hook-form'\nimport { type TypeOf } from 'zod'\nimport { HTMLRenderer } from '../htmlParser'\nimport { widgetIds } from '../model'\nimport {\n type Approvement,\n type ApprovementType,\n type Chips,\n type ChipsType,\n getFieldsProgress,\n type Progress,\n type ProgressField,\n type ProgressType\n} from './model'\nimport { type FieldValidation, getDynamicSchema } from '@/shared/utils'\nimport { useControlledForm, useFieldsProgress } from '$/shared/hooks'\nimport {\n Button,\n type ButtonProps,\n CheckboxBase,\n type CheckedState,\n Heading,\n Icon,\n ProgressBar,\n ResponsiveContainer\n} from '$/shared/ui'\nimport { cn } from '$/shared/utils'\nimport { ZodUtils } from '$/shared/validation'\nimport { type FieldElement, FieldMapper } from '$/widgets/fieldMapper'\nimport { QueryClientProvider } from '$/widgets/queryClientProvider'\n\ntype SubmitProps = {\n submitCallback: <T extends FieldValues>(values: T) => void\n}\n\ntype ChipsClasses = {\n root?: string\n icon?: string\n}\ntype ApprovementClasses = {\n checkbox?: React.ComponentProps<typeof CheckboxBase>['classes']\n content?: string\n}\n\ntype DynamicFormClasses = {\n root?: string\n title?: string\n fields?: string\n form?: string\n chips?: ChipsClasses\n approvement?: ApprovementClasses\n progressBar?: React.ComponentProps<typeof ProgressBar>['classes']\n submit?: string\n}\n\nexport type DynamicFormProps<AType extends ApprovementType, CType extends ChipsType, PType extends ProgressType> = {\n fields: FieldElement<any, any, { validation: FieldValidation; progress: ProgressField }>[]\n title: string\n progress: Progress<PType>\n approvement: Approvement<AType>\n chips: Chips<CType>\n submitProps?: SubmitProps\n classes?: DynamicFormClasses\n buttonGroup: ButtonProps[]\n}\n\nconst withApprovement = <Type extends ApprovementType>(\n approvement: Approvement<Type>,\n checked: CheckedState,\n onCheckedChange: (checked: CheckedState) => void,\n classes?: ApprovementClasses\n): React.ReactNode => {\n if (approvement.type === 'off') return null\n\n if (approvement.type === 'text') {\n return <HTMLRenderer html={approvement.message} as='div' className={classes?.content} />\n }\n\n return (\n <label\n className={cn(\n 'mob-body-regular-s text-color-dark',\n 'desktop:desk-body-regular-m desktop:gap-x-4',\n 'flex items-center justify-items-start gap-x-3'\n )}\n >\n <CheckboxBase classes={classes?.checkbox} checked={checked} onCheckedChange={onCheckedChange} />\n <HTMLRenderer html={approvement.content} as='div' className={classes?.content} />\n </label>\n )\n}\n\nexport const DynamicForm = <AType extends ApprovementType, CType extends ChipsType, PType extends ProgressType>({\n fields,\n title,\n progress,\n approvement,\n chips,\n submitProps,\n classes,\n buttonGroup\n}: DynamicFormProps<AType, CType, PType>) => {\n const { submitCallback } = submitProps || {}\n\n const [checked, onCheckedChange] = useState<CheckedState>(false)\n\n const schema = getDynamicSchema(fields)\n const defaultValues = ZodUtils.getZodDefaults(schema)\n\n const { control, handleSubmit } = useControlledForm({\n schema,\n defaultValues,\n mode: 'onBlur'\n })\n\n const fieldsProgress = getFieldsProgress(progress, fields)\n\n const formattedProgress = useFieldsProgress({ control, fields: fieldsProgress || [], schema })\n\n const onSubmit: SubmitHandler<TypeOf<typeof schema>> = (values) => {\n if (submitCallback) submitCallback({ ...values, agree: checked })\n }\n\n return (\n <QueryClientProvider>\n <section id={widgetIds.form} data-test-id={widgetIds.form} className={cn('w-full', classes?.root)}>\n <ResponsiveContainer\n className={cn(\n '!max-w-[636px] border-warm-grey-200 px-4 desktop:gap-8 desktop:p-14',\n 'relative mx-auto flex flex-col gap-6 rounded-sm py-8 desktop:border'\n )}\n >\n {chips.enabled && (\n <div\n className={cn(\n 'desk-body-regular-l flex items-center gap-x-2 rounded-sm desktop:absolute',\n 'bg-color-blue-grey-100 px-2 py-1 text-color-tetriary',\n 'right-4 top-4 w-max',\n classes?.chips?.root\n )}\n >\n {chips.image && <Icon name={chips.image} className={cn('size-6', classes?.chips?.icon)} />}\n {chips.content}\n </div>\n )}\n <Heading as='h2' className={cn('desktop:hidden', classes?.title)}>\n {title}\n </Heading>\n <Heading as='h3' className={cn('mobile:hidden', classes?.title)}>\n {title}\n </Heading>\n <form\n onSubmit={handleSubmit(onSubmit)}\n className={cn('flex w-full flex-col gap-y-6', 'desktop:gap-y-8', classes?.form)}\n >\n {progress.enabled && (\n <ProgressBar\n progress={formattedProgress}\n topContent={<HTMLRenderer html={progress.title} />}\n bottomContent={<HTMLRenderer html={progress.subtitle} />}\n maxPercent={progress.maxPercent}\n classes={classes?.progressBar}\n />\n )}\n <FieldMapper control={control as unknown as Control} fields={fields} />\n <div className='mob-body-regular-m flex flex-col items-start justify-center gap-4'>\n {withApprovement(approvement, checked, onCheckedChange, classes?.approvement)}\n <div className='flex w-full flex-col items-center justify-center gap-4 desktop:flex-row'>\n {buttonGroup?.map((button, index) => {\n const disabled = button.type === 'submit' && approvement.type === 'checkbox' ? !checked : false\n\n return (\n <Button\n {...button}\n key={index}\n disabled={disabled}\n className={cn(\n 'w-full whitespace-nowrap',\n {\n 'w-full': Boolean(approvement)\n },\n classes?.submit\n )}\n />\n )\n })}\n </div>\n </div>\n </form>\n </ResponsiveContainer>\n </section>\n </QueryClientProvider>\n )\n}\n\nexport default DynamicForm\n"],"names":["withApprovement","approvement","checked","onCheckedChange","classes","jsx","HTMLRenderer","jsxs","cn","CheckboxBase","DynamicForm","fields","title","progress","chips","submitProps","buttonGroup","submitCallback","useState","schema","getDynamicSchema","defaultValues","ZodUtils","control","handleSubmit","useControlledForm","fieldsProgress","getFieldsProgress","formattedProgress","useFieldsProgress","onSubmit","values","QueryClientProvider","widgetIds","ResponsiveContainer","_a","Icon","_b","Heading","ProgressBar","FieldMapper","button","index","disabled","createElement","Button"],"mappings":"65FAqEA,MAAMA,EAAkB,CACtBC,EACAC,EACAC,EACAC,IAEIH,EAAY,OAAS,MAAc,KAEnCA,EAAY,OAAS,OAChBI,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,EAItFG,EAAC,QAAA,CACC,UAAWC,EACT,qCACA,8CACA,+CAAA,EAGF,SAAA,CAAAH,EAACI,EAAA,CAAa,QAASL,GAAA,YAAAA,EAAS,SAAU,QAAAF,EAAkB,gBAAAC,EAAkC,EAC9FE,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,CAAA,CAAA,CAAA,EAKxEM,GAAc,CAAqF,CAC9G,OAAAC,EACA,MAAAC,EACA,SAAAC,EACA,YAAAZ,EACA,MAAAa,EACA,YAAAC,EACA,QAAAX,EACA,YAAAY,CACF,IAA6C,SAC3C,KAAM,CAAE,eAAAC,GAAmBF,GAAe,CAAA,EAEpC,CAACb,EAASC,CAAe,EAAIe,EAAuB,EAAK,EAEzDC,EAASC,EAAiBT,CAAM,EAChCU,EAAgBC,EAAS,eAAeH,CAAM,EAE9C,CAAE,QAAAI,EAAS,aAAAC,CAAA,EAAiBC,EAAkB,CAClD,OAAAN,EACA,cAAAE,EACA,KAAM,QAAA,CACP,EAEKK,EAAiBC,EAAkBd,EAAUF,CAAM,EAEnDiB,EAAoBC,EAAkB,CAAE,QAAAN,EAAS,OAAQG,GAAkB,CAAA,EAAI,OAAAP,EAAQ,EAEvFW,EAAkDC,GAAW,CAC7Dd,GAAgBA,EAAe,CAAE,GAAGc,EAAQ,MAAO7B,EAAS,CAClE,EAEA,OACEG,EAAC2B,EAAA,CACC,SAAA3B,EAAC,UAAA,CAAQ,GAAI4B,EAAU,KAAM,eAAcA,EAAU,KAAM,UAAWzB,EAAG,SAAUJ,GAAA,YAAAA,EAAS,IAAI,EAC9F,SAAAG,EAAC2B,EAAA,CACC,UAAW1B,EACT,sEACA,qEAAA,EAGD,SAAA,CAAAM,EAAM,SACLP,EAAC,MAAA,CACC,UAAWC,EACT,4EACA,uDACA,uBACA2B,EAAA/B,GAAA,YAAAA,EAAS,QAAT,YAAA+B,EAAgB,IAAA,EAGjB,SAAA,CAAArB,EAAM,OAAST,EAAC+B,EAAA,CAAK,KAAMtB,EAAM,MAAO,UAAWN,EAAG,UAAU6B,EAAAjC,GAAA,YAAAA,EAAS,QAAT,YAAAiC,EAAgB,IAAI,CAAA,CAAG,EACvFvB,EAAM,OAAA,CAAA,CAAA,EAGXT,EAACiC,EAAA,CAAQ,GAAG,KAAK,UAAW9B,EAAG,iBAAkBJ,GAAA,YAAAA,EAAS,KAAK,EAC5D,SAAAQ,CAAA,CACH,EACAP,EAACiC,EAAA,CAAQ,GAAG,KAAK,UAAW9B,EAAG,gBAAiBJ,GAAA,YAAAA,EAAS,KAAK,EAC3D,SAAAQ,CAAA,CACH,EACAL,EAAC,OAAA,CACC,SAAUiB,EAAaM,CAAQ,EAC/B,UAAWtB,EAAG,+BAAgC,kBAAmBJ,GAAA,YAAAA,EAAS,IAAI,EAE7E,SAAA,CAAAS,EAAS,SACRR,EAACkC,EAAA,CACC,SAAUX,EACV,WAAYvB,EAACC,EAAA,CAAa,KAAMO,EAAS,MAAO,EAChD,cAAeR,EAACC,EAAA,CAAa,KAAMO,EAAS,SAAU,EACtD,WAAYA,EAAS,WACrB,QAAST,GAAA,YAAAA,EAAS,WAAA,CAAA,EAGtBC,EAACmC,EAAA,CAAY,QAAAjB,EAAwC,OAAAZ,CAAA,CAAgB,EACrEJ,EAAC,MAAA,CAAI,UAAU,oEACZ,SAAA,CAAAP,EAAgBC,EAAaC,EAASC,EAAiBC,GAAA,YAAAA,EAAS,WAAW,EAC5EC,EAAC,OAAI,UAAU,0EACZ,0BAAa,IAAI,CAACoC,EAAQC,IAAU,CACnC,MAAMC,EAAWF,EAAO,OAAS,UAAYxC,EAAY,OAAS,WAAa,CAACC,EAAU,GAE1F,OACE0C,EAACC,EAAA,CACE,GAAGJ,EACJ,IAAKC,EACL,SAAAC,EACA,UAAWnC,EACT,2BACA,CACE,SAAU,EAAQP,CAAW,EAE/BG,GAAA,YAAAA,EAAS,MAAA,CACX,CAAA,CAGN,EAAC,CACH,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CACF,CAAA,CAAA,EAEJ,CAAA,CACF,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFormDialog.js","sources":["../../../../lib/widgets/dynamicFormDialog/DynamicFormDialog.tsx"],"sourcesContent":["'use client'\nimport { useState } from 'react'\nimport type { Control, FieldValues, SubmitHandler } from 'react-hook-form'\nimport { type TypeOf } from 'zod'\nimport { HTMLRenderer } from '../htmlParser'\nimport type { Approvement, ApprovementType } from './model'\nimport { type FieldValidation, getDynamicSchema } from '@/shared/utils'\nimport { useControlledForm } from '$/shared/hooks'\nimport { Button, type ButtonProps, CheckboxBase, type CheckedState, Dialog } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\nimport { ZodUtils } from '$/shared/validation'\nimport { type FieldElement, FieldMapper } from '$/widgets/fieldMapper'\nimport { QueryClientProvider } from '$/widgets/queryClientProvider'\n\ntype SubmitProps = {\n submitCallback: <T extends FieldValues>(values: T) => void\n}\n\ntype ApprovementClasses = {\n checkbox?: React.ComponentProps<typeof CheckboxBase>['classes']\n content?: string\n}\n\ntype DynamicFormDialogClasses = {\n root?: string\n title?: string\n fields?: string\n form?: string\n approvement?: ApprovementClasses\n submit?: string\n}\n\nexport type DynamicFormDialogProps<AType extends ApprovementType> = React.DialogHTMLAttributes<HTMLDialogElement> & {\n fields: FieldElement<any, any, { validation: FieldValidation }>[]\n title: string\n approvement: Approvement<AType>\n dialogId: string\n submitProps?: SubmitProps\n classes?: DynamicFormDialogClasses\n buttonGroup: ButtonProps[]\n}\n\nconst withApprovement = <Type extends ApprovementType>(\n approvement: Approvement<Type>,\n checked: CheckedState,\n onCheckedChange: (checked: CheckedState) => void,\n classes?: ApprovementClasses\n) => {\n if (approvement.type === 'off') return null\n\n if (approvement.type === 'text') {\n return <HTMLRenderer html={approvement.message} as='div' className={classes?.content} />\n }\n\n return (\n <label\n className={cn(\n 'mob-body-regular-s text-color-dark',\n 'desktop:desk-body-regular-m desktop:gap-x-4',\n 'flex items-center justify-items-start gap-x-3'\n )}\n >\n <CheckboxBase classes={classes?.checkbox} checked={checked} onCheckedChange={onCheckedChange} />\n <HTMLRenderer html={approvement.content} as='div' className={classes?.content} />\n </label>\n )\n}\n\nexport const DynamicFormDialog = <AType extends ApprovementType>({\n fields,\n title,\n approvement,\n submitProps,\n dialogId,\n classes,\n buttonGroup,\n ...props\n}: DynamicFormDialogProps<AType>) => {\n const { submitCallback } = submitProps ?? {}\n\n const [checked, onCheckedChange] = useState<CheckedState>(false)\n\n const schema = getDynamicSchema(fields)\n const defaultValues = ZodUtils.getZodDefaults(schema)\n\n const { control, handleSubmit } = useControlledForm({\n schema,\n defaultValues,\n mode: 'onBlur'\n })\n\n const onSubmit: SubmitHandler<TypeOf<typeof schema>> = (values) => {\n if (submitCallback) submitCallback({ ...values, agree: checked })\n }\n\n return (\n <QueryClientProvider>\n <Dialog id={dialogId} title={title} {...props}>\n <form onSubmit={handleSubmit(onSubmit)} className='flex flex-col gap-6'>\n <FieldMapper control={control as unknown as Control} fields={fields} />\n {withApprovement(approvement, checked, onCheckedChange, classes?.approvement)}\n {buttonGroup?.map((button, index) => {\n const disabled = button.type === 'submit' && approvement.type === 'checkbox' ? !checked : false\n\n return (\n <Button\n {...button}\n key={index}\n disabled={disabled}\n className={cn(\n 'w-full whitespace-nowrap',\n {\n 'w-full': Boolean(approvement)\n },\n classes?.submit\n )}\n />\n )\n })}\n {/*<Button {...buttonProps} type='submit' disabled={approvement.type === 'checkbox' ? !checked : false} className='w-full'>*/}\n {/* {children ?? 'Отправить форму'}*/}\n {/*</Button>*/}\n </form>\n </Dialog>\n </QueryClientProvider>\n )\n}\n\nexport default DynamicFormDialog\n"],"names":["withApprovement","approvement","checked","onCheckedChange","classes","jsx","HTMLRenderer","jsxs","cn","CheckboxBase","DynamicFormDialog","fields","title","submitProps","dialogId","buttonGroup","props","submitCallback","useState","schema","getDynamicSchema","defaultValues","ZodUtils","control","handleSubmit","useControlledForm","QueryClientProvider","Dialog","values","FieldMapper","button","index","disabled","createElement","Button"],"mappings":"+/EA0CA,MAAMA,EAAkB,CACtBC,EACAC,EACAC,EACAC,IAEIH,EAAY,OAAS,MAAc,KAEnCA,EAAY,OAAS,OAChBI,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,EAItFG,EAAC,QAAA,CACC,UAAWC,EACT,qCACA,8CACA,+CAAA,EAGF,SAAA,CAAAH,EAACI,EAAA,CAAa,QAASL,GAAA,YAAAA,EAAS,SAAU,QAAAF,EAAkB,gBAAAC,EAAkC,EAC9FE,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,CAAA,CAAA,CAAA,EAKxEM,GAAoB,CAAgC,CAC/D,OAAAC,EACA,MAAAC,EACA,YAAAX,EACA,YAAAY,EACA,SAAAC,EACA,QAAAV,EACA,YAAAW,EACA,GAAGC,CACL,IAAqC,CACnC,KAAM,CAAE,eAAAC,GAAmBJ,GAAe,CAAA,EAEpC,CAACX,EAASC,CAAe,EAAIe,EAAuB,EAAK,EAEzDC,EAASC,EAAiBT,CAAM,EAChCU,EAAgBC,EAAS,eAAeH,CAAM,EAE9C,CAAE,QAAAI,EAAS,aAAAC,CAAA,EAAiBC,EAAkB,CAClD,OAAAN,EACA,cAAAE,EACA,KAAM,QAAA,CACP,EAMD,SACGK,EAAA,CACC,SAAArB,EAACsB,EAAA,CAAO,GAAIb,EAAU,MAAAF,EAAe,GAAGI,EACtC,SAAAT,EAAC,QAAK,SAAUiB,EAPkCI,GAAW,CAC7DX,GAAgBA,EAAe,CAAE,GAAGW,EAAQ,MAAO1B,EAAS,
|
|
1
|
+
{"version":3,"file":"DynamicFormDialog.js","sources":["../../../../lib/widgets/dynamicFormDialog/DynamicFormDialog.tsx"],"sourcesContent":["'use client'\nimport { useState } from 'react'\nimport type { Control, FieldValues, SubmitHandler } from 'react-hook-form'\nimport { type TypeOf } from 'zod'\nimport { HTMLRenderer } from '../htmlParser'\nimport type { Approvement, ApprovementType } from './model'\nimport { type FieldValidation, getDynamicSchema } from '@/shared/utils'\nimport { useControlledForm } from '$/shared/hooks'\nimport { Button, type ButtonProps, CheckboxBase, type CheckedState, Dialog } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\nimport { ZodUtils } from '$/shared/validation'\nimport { type FieldElement, FieldMapper } from '$/widgets/fieldMapper'\nimport { QueryClientProvider } from '$/widgets/queryClientProvider'\n\ntype SubmitProps = {\n submitCallback: <T extends FieldValues>(values: T) => void\n}\n\ntype ApprovementClasses = {\n checkbox?: React.ComponentProps<typeof CheckboxBase>['classes']\n content?: string\n}\n\ntype DynamicFormDialogClasses = {\n root?: string\n title?: string\n fields?: string\n form?: string\n approvement?: ApprovementClasses\n submit?: string\n}\n\nexport type DynamicFormDialogProps<AType extends ApprovementType> = React.DialogHTMLAttributes<HTMLDialogElement> & {\n fields: FieldElement<any, any, { validation: FieldValidation }>[]\n title: string\n approvement: Approvement<AType>\n dialogId: string\n submitProps?: SubmitProps\n classes?: DynamicFormDialogClasses\n buttonGroup: ButtonProps[]\n}\n\nconst withApprovement = <Type extends ApprovementType>(\n approvement: Approvement<Type>,\n checked: CheckedState,\n onCheckedChange: (checked: CheckedState) => void,\n classes?: ApprovementClasses\n) => {\n if (approvement.type === 'off') return null\n\n if (approvement.type === 'text') {\n return <HTMLRenderer html={approvement.message} as='div' className={classes?.content} />\n }\n\n return (\n <label\n className={cn(\n 'mob-body-regular-s text-color-dark',\n 'desktop:desk-body-regular-m desktop:gap-x-4',\n 'flex items-center justify-items-start gap-x-3'\n )}\n >\n <CheckboxBase classes={classes?.checkbox} checked={checked} onCheckedChange={onCheckedChange} />\n <HTMLRenderer html={approvement.content} as='div' className={classes?.content} />\n </label>\n )\n}\n\nexport const DynamicFormDialog = <AType extends ApprovementType>({\n fields,\n title,\n approvement,\n submitProps,\n dialogId,\n classes,\n buttonGroup,\n ...props\n}: DynamicFormDialogProps<AType>) => {\n const { submitCallback } = submitProps ?? {}\n\n const [checked, onCheckedChange] = useState<CheckedState>(false)\n\n const schema = getDynamicSchema(fields)\n const defaultValues = ZodUtils.getZodDefaults(schema)\n\n const { control, handleSubmit } = useControlledForm({\n schema,\n defaultValues,\n mode: 'onBlur'\n })\n\n const onSubmit: SubmitHandler<TypeOf<typeof schema>> = (values) => {\n if (submitCallback) submitCallback({ ...values, agree: checked })\n }\n\n return (\n <QueryClientProvider>\n <Dialog id={dialogId} title={title} {...props}>\n <form onSubmit={handleSubmit(onSubmit)} className='flex flex-col gap-6'>\n <FieldMapper control={control as unknown as Control} fields={fields} />\n {withApprovement(approvement, checked, onCheckedChange, classes?.approvement)}\n {buttonGroup?.map((button, index) => {\n const disabled = button.type === 'submit' && approvement.type === 'checkbox' ? !checked : false\n\n return (\n <Button\n {...button}\n key={index}\n disabled={disabled}\n className={cn(\n 'w-full whitespace-nowrap',\n {\n 'w-full': Boolean(approvement)\n },\n classes?.submit\n )}\n />\n )\n })}\n {/*<Button {...buttonProps} type='submit' disabled={approvement.type === 'checkbox' ? !checked : false} className='w-full'>*/}\n {/* {children ?? 'Отправить форму'}*/}\n {/*</Button>*/}\n </form>\n </Dialog>\n </QueryClientProvider>\n )\n}\n\nexport default DynamicFormDialog\n"],"names":["withApprovement","approvement","checked","onCheckedChange","classes","jsx","HTMLRenderer","jsxs","cn","CheckboxBase","DynamicFormDialog","fields","title","submitProps","dialogId","buttonGroup","props","submitCallback","useState","schema","getDynamicSchema","defaultValues","ZodUtils","control","handleSubmit","useControlledForm","QueryClientProvider","Dialog","values","FieldMapper","button","index","disabled","createElement","Button"],"mappings":"+/EA0CA,MAAMA,EAAkB,CACtBC,EACAC,EACAC,EACAC,IAEIH,EAAY,OAAS,MAAc,KAEnCA,EAAY,OAAS,OAChBI,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,EAItFG,EAAC,QAAA,CACC,UAAWC,EACT,qCACA,8CACA,+CAAA,EAGF,SAAA,CAAAH,EAACI,EAAA,CAAa,QAASL,GAAA,YAAAA,EAAS,SAAU,QAAAF,EAAkB,gBAAAC,EAAkC,EAC9FE,EAACC,GAAa,KAAML,EAAY,QAAS,GAAG,MAAM,UAAWG,GAAA,YAAAA,EAAS,OAAA,CAAS,CAAA,CAAA,CAAA,EAKxEM,GAAoB,CAAgC,CAC/D,OAAAC,EACA,MAAAC,EACA,YAAAX,EACA,YAAAY,EACA,SAAAC,EACA,QAAAV,EACA,YAAAW,EACA,GAAGC,CACL,IAAqC,CACnC,KAAM,CAAE,eAAAC,GAAmBJ,GAAe,CAAA,EAEpC,CAACX,EAASC,CAAe,EAAIe,EAAuB,EAAK,EAEzDC,EAASC,EAAiBT,CAAM,EAChCU,EAAgBC,EAAS,eAAeH,CAAM,EAE9C,CAAE,QAAAI,EAAS,aAAAC,CAAA,EAAiBC,EAAkB,CAClD,OAAAN,EACA,cAAAE,EACA,KAAM,QAAA,CACP,EAMD,SACGK,EAAA,CACC,SAAArB,EAACsB,EAAA,CAAO,GAAIb,EAAU,MAAAF,EAAe,GAAGI,EACtC,SAAAT,EAAC,QAAK,SAAUiB,EAPkCI,GAAW,CAC7DX,GAAgBA,EAAe,CAAE,GAAGW,EAAQ,MAAO1B,EAAS,CAClE,CAK2C,EAAG,UAAU,sBAChD,SAAA,CAAAG,EAACwB,EAAA,CAAY,QAAAN,EAAwC,OAAAZ,CAAA,CAAgB,EACpEX,EAAgBC,EAAaC,EAASC,EAAiBC,GAAA,YAAAA,EAAS,WAAW,EAC3EW,GAAA,YAAAA,EAAa,IAAI,CAACe,EAAQC,IAAU,CACnC,MAAMC,EAAWF,EAAO,OAAS,UAAY7B,EAAY,OAAS,WAAa,CAACC,EAAU,GAE1F,OACE+B,EAACC,EAAA,CACE,GAAGJ,EACJ,IAAKC,EACL,SAAAC,EACA,UAAWxB,EACT,2BACA,CACE,SAAU,EAAQP,CAAW,EAE/BG,GAAA,YAAAA,EAAS,MAAA,CACX,CAAA,CAGN,EAAC,CAAA,CAIH,EACF,EACF,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldMapper.js","sources":["../../../../lib/widgets/fieldMapper/FieldMapper.tsx"],"sourcesContent":["import { type Control, type FieldValues } from 'react-hook-form'\nimport type { FieldElement } from './model/types'\nimport { Controlled } from '$/shared/ui'\n\ntype FieldMapperProps<TFieldValues extends FieldValues> = {\n control: Control<TFieldValues>\n fields: FieldElement<TFieldValues>[]\n}\n\nexport const FieldMapper = <TFieldValues extends FieldValues>({ fields, control }: FieldMapperProps<TFieldValues>) => {\n return fields.map(({ type, args }) => {\n const Component = Controlled[type] as React.ComponentType<typeof args>\n\n return <Component {...args} key={args.name} control={control as Control} />\n })\n}\n"],"names":["FieldMapper","fields","control","type","args","Component","Controlled"],"mappings":"szDASO,MAAMA,EAAc,CAAmC,CAAE,OAAAC,EAAQ,QAAAC,KAC/DD,EAAO,IAAI,CAAC,CAAE,KAAAE,EAAM,KAAAC,KAAW,CACpC,MAAMC,EAAYC,EAAWH,CAAI,EAEjC,SAAQE,EAAA,CAAW,GAAGD,EAAM,IAAKA,EAAK,KAAM,QAAAF,EAA6B,
|
|
1
|
+
{"version":3,"file":"FieldMapper.js","sources":["../../../../lib/widgets/fieldMapper/FieldMapper.tsx"],"sourcesContent":["import { type Control, type FieldValues } from 'react-hook-form'\nimport type { FieldElement } from './model/types'\nimport { Controlled } from '$/shared/ui'\n\ntype FieldMapperProps<TFieldValues extends FieldValues> = {\n control: Control<TFieldValues>\n fields: FieldElement<TFieldValues>[]\n}\n\nexport const FieldMapper = <TFieldValues extends FieldValues>({ fields, control }: FieldMapperProps<TFieldValues>) => {\n return fields.map(({ type, args }) => {\n const Component = Controlled[type] as React.ComponentType<typeof args>\n\n return <Component {...args} key={args.name} control={control as Control} />\n })\n}\n"],"names":["FieldMapper","fields","control","type","args","Component","Controlled"],"mappings":"szDASO,MAAMA,EAAc,CAAmC,CAAE,OAAAC,EAAQ,QAAAC,KAC/DD,EAAO,IAAI,CAAC,CAAE,KAAAE,EAAM,KAAAC,KAAW,CACpC,MAAMC,EAAYC,EAAWH,CAAI,EAEjC,SAAQE,EAAA,CAAW,GAAGD,EAAM,IAAKA,EAAK,KAAM,QAAAF,EAA6B,CAC3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ligal.js","sources":["../../../../../lib/widgets/footer/ui/Ligal.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { cn } from '$/shared/utils'\n\ntype LigalClasses = {\n ligalRoot?: string\n ligalText?: string\n ligalButton?: string\n}\n\nexport interface LigalProps {\n text: string\n classes?: LigalClasses\n}\n\nexport const Ligal = ({ text, classes }: LigalProps) => {\n const [isExpanded, setIsExpanded] = React.useState(false)\n const [isClamped, setIsClamped] = React.useState(false)\n const ligalRef = React.useRef<HTMLParagraphElement | null>(null)\n\n React.useEffect(() => {\n const element = ligalRef.current\n if (element) {\n setIsClamped(element.scrollHeight > element.clientHeight)\n }\n }, [])\n\n return (\n <div className={cn('mt-8 flex flex-col gap-4', classes?.ligalRoot)}>\n <div\n ref={ligalRef}\n className={cn('desk-body-regular-m text-color-footer', { 'line-clamp-3': !isExpanded }, classes?.ligalText)}\n dangerouslySetInnerHTML={{ __html: text }}\n />\n\n {isClamped && (\n <div\n tabIndex={0}\n role='button'\n onClick={() => setIsExpanded((prev) => !prev)}\n className={cn(\n 'desk-body-regular-l w-max cursor-pointer font-medium text-color-footer transition-colors hover:text-color-white',\n classes?.ligalButton\n )}\n >\n Подробнее\n </div>\n )}\n </div>\n )\n}\n"],"names":["Ligal","text","classes","isExpanded","setIsExpanded","React","isClamped","setIsClamped","ligalRef","element","cn","jsx","prev"],"mappings":"2HAgBO,MAAMA,EAAQ,CAAC,CAAE,KAAAC,EAAM,QAAAC,KAA0B,CACtD,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAM,SAAS,EAAK,EAClD,CAACC,EAAWC,CAAY,EAAIF,EAAM,SAAS,EAAK,EAChDG,EAAWH,EAAM,OAAoC,IAAI,EAE/D,OAAAA,EAAM,UAAU,IAAM,CACpB,MAAMI,EAAUD,EAAS,QACrBC,GACFF,EAAaE,EAAQ,aAAeA,EAAQ,YAAY,
|
|
1
|
+
{"version":3,"file":"Ligal.js","sources":["../../../../../lib/widgets/footer/ui/Ligal.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { cn } from '$/shared/utils'\n\ntype LigalClasses = {\n ligalRoot?: string\n ligalText?: string\n ligalButton?: string\n}\n\nexport interface LigalProps {\n text: string\n classes?: LigalClasses\n}\n\nexport const Ligal = ({ text, classes }: LigalProps) => {\n const [isExpanded, setIsExpanded] = React.useState(false)\n const [isClamped, setIsClamped] = React.useState(false)\n const ligalRef = React.useRef<HTMLParagraphElement | null>(null)\n\n React.useEffect(() => {\n const element = ligalRef.current\n if (element) {\n setIsClamped(element.scrollHeight > element.clientHeight)\n }\n }, [])\n\n return (\n <div className={cn('mt-8 flex flex-col gap-4', classes?.ligalRoot)}>\n <div\n ref={ligalRef}\n className={cn('desk-body-regular-m text-color-footer', { 'line-clamp-3': !isExpanded }, classes?.ligalText)}\n dangerouslySetInnerHTML={{ __html: text }}\n />\n\n {isClamped && (\n <div\n tabIndex={0}\n role='button'\n onClick={() => setIsExpanded((prev) => !prev)}\n className={cn(\n 'desk-body-regular-l w-max cursor-pointer font-medium text-color-footer transition-colors hover:text-color-white',\n classes?.ligalButton\n )}\n >\n Подробнее\n </div>\n )}\n </div>\n )\n}\n"],"names":["Ligal","text","classes","isExpanded","setIsExpanded","React","isClamped","setIsClamped","ligalRef","element","cn","jsx","prev"],"mappings":"2HAgBO,MAAMA,EAAQ,CAAC,CAAE,KAAAC,EAAM,QAAAC,KAA0B,CACtD,KAAM,CAACC,EAAYC,CAAa,EAAIC,EAAM,SAAS,EAAK,EAClD,CAACC,EAAWC,CAAY,EAAIF,EAAM,SAAS,EAAK,EAChDG,EAAWH,EAAM,OAAoC,IAAI,EAE/D,OAAAA,EAAM,UAAU,IAAM,CACpB,MAAMI,EAAUD,EAAS,QACrBC,GACFF,EAAaE,EAAQ,aAAeA,EAAQ,YAAY,CAE5D,EAAG,CAAA,CAAE,IAGF,MAAA,CAAI,UAAWC,EAAG,2BAA4BR,GAAA,YAAAA,EAAS,SAAS,EAC/D,SAAA,CAAAS,EAAC,MAAA,CACC,IAAKH,EACL,UAAWE,EAAG,wCAAyC,CAAE,eAAgB,CAACP,CAAA,EAAcD,GAAA,YAAAA,EAAS,SAAS,EAC1G,wBAAyB,CAAE,OAAQD,CAAA,CAAK,CAAA,EAGzCK,GACCK,EAAC,MAAA,CACC,SAAU,EACV,KAAK,SACL,QAAS,IAAMP,EAAeQ,GAAS,CAACA,CAAI,EAC5C,UAAWF,EACT,kHACAR,GAAA,YAAAA,EAAS,WAAA,EAEZ,SAAA,WAAA,CAAA,CAED,EAEJ,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseHtmlParser.js","sources":["../../../../lib/widgets/htmlParser/baseHtmlParser.ts"],"sourcesContent":["'use client'\n\nexport type ParserOptions = {\n /**\n * включать элемент body\n */\n includeBody?: boolean\n /**\n * включать сплошной текст (вне тегов)\n */\n includeSolidText?: boolean\n /**\n * парсить рекурсивно\n */\n recursive?: boolean\n /**\n * фильтровать только нужные html теги\n */\n element?: keyof React.JSX.IntrinsicElements\n}\n\nexport abstract class BaseHTMLParser {\n private readonly TEXT_NODE = 3 as const\n private readonly ELEMENT_NODE = 1 as const\n\n protected constructor(private options?: ParserOptions) {}\n\n /**\n * Рекурсивно обходит DOM дерево и собирает данные в зависимости от опций.\n * @param node Текущий узел DOM дерева\n * @param elements Массив для сбора элементов\n * @param as Тип возвращаемых данных ('string' или 'node')\n */\n protected traverse(node: Node, as: 'string' | 'node' = 'string', elements: (string | Node)[]) {\n const { includeSolidText, recursive, element } = this.options || {}\n\n switch (node.nodeType) {\n // если узел - элемент\n case this.ELEMENT_NODE:\n const elementNode = node as Element\n const elementName = elementNode.tagName.toLowerCase()\n\n // если нашли элемент script, в целях безопасности пропускаем его\n if (elementName === 'script') {\n console.warn('Found script node. For better security this node will be skipped.')\n break\n }\n\n // если требуется только определенные элементы и текущий не подходит, пропускаем\n if (element && elementName !== element) {\n break\n }\n\n // добавляем элемент в зависимости от требуемого типа\n if (as === 'node') {\n elements.push(node)\n } else {\n const content = elementNode.outerHTML.trim()\n elements.push(content)\n }\n\n // если требуется рекурсивно обрабатывать дочерние ноды\n if (recursive) {\n for (const child of node.childNodes) {\n this.traverse(child, as, elements)\n }\n }\n break\n // если узел - текстовый и требуется его добавить, добавляем\n case this.TEXT_NODE:\n if (!includeSolidText) {\n break\n }\n\n if (as === 'node') {\n elements.push(node)\n } else {\n const content = node.textContent\n\n if (content) {\n elements.push(content)\n }\n }\n break\n }\n }\n\n /**\n * Парсит HTML строку и возвращает массив тегов или нод в зависимости от опций.\n * @param html HTML строка\n * @param as Тип возвращаемых данных ('string' или 'node')\n * @returns Массив тегов или нод\n */\n async parse(html: string, as: 'string' | 'node' = 'string'): Promise<{ stringNodes: string[]; nodes: Node[] }> {\n const { includeBody } = this.options || {}\n\n const stringNodes: string[] = []\n const nodes: Node[] = []\n const doc = await this.parseFromString(html)\n\n const elements = as === 'string' ? stringNodes : nodes\n\n if (includeBody) {\n this.traverse(doc.body, as, elements)\n } else {\n for (const child of doc.body.childNodes) {\n this.traverse(child, as, elements)\n }\n }\n\n return { stringNodes, nodes }\n }\n\n /**\n * Считает количество указанных тегов в HTML строке.\n * @param html HTML строка\n * @returns Количество найденных тегов\n */\n async countElements(html: string): Promise<number> {\n const { stringNodes } = await this.parse(html, 'string')\n\n return stringNodes.length\n }\n\n /**\n * Преобразует HTML строку в DOM объект.\n * @param html HTML строка\n * @returns DOM объект\n */\n protected abstract parseFromString(html: string): Promise<Document>\n}\n"],"names":["BaseHTMLParser","options","__publicField","node","as","elements","includeSolidText","recursive","element","elementNode","elementName","content","child","html","includeBody","stringNodes","nodes","doc"],"mappings":"oKAqBO,MAAeA,CAAe,CAIzB,YAAoBC,EAAyB,CAHtCC,EAAA,iBAAY,GACZA,EAAA,oBAAe,GAEF,KAAA,QAAAD,
|
|
1
|
+
{"version":3,"file":"baseHtmlParser.js","sources":["../../../../lib/widgets/htmlParser/baseHtmlParser.ts"],"sourcesContent":["'use client'\n\nexport type ParserOptions = {\n /**\n * включать элемент body\n */\n includeBody?: boolean\n /**\n * включать сплошной текст (вне тегов)\n */\n includeSolidText?: boolean\n /**\n * парсить рекурсивно\n */\n recursive?: boolean\n /**\n * фильтровать только нужные html теги\n */\n element?: keyof React.JSX.IntrinsicElements\n}\n\nexport abstract class BaseHTMLParser {\n private readonly TEXT_NODE = 3 as const\n private readonly ELEMENT_NODE = 1 as const\n\n protected constructor(private options?: ParserOptions) {}\n\n /**\n * Рекурсивно обходит DOM дерево и собирает данные в зависимости от опций.\n * @param node Текущий узел DOM дерева\n * @param elements Массив для сбора элементов\n * @param as Тип возвращаемых данных ('string' или 'node')\n */\n protected traverse(node: Node, as: 'string' | 'node' = 'string', elements: (string | Node)[]) {\n const { includeSolidText, recursive, element } = this.options || {}\n\n switch (node.nodeType) {\n // если узел - элемент\n case this.ELEMENT_NODE:\n const elementNode = node as Element\n const elementName = elementNode.tagName.toLowerCase()\n\n // если нашли элемент script, в целях безопасности пропускаем его\n if (elementName === 'script') {\n console.warn('Found script node. For better security this node will be skipped.')\n break\n }\n\n // если требуется только определенные элементы и текущий не подходит, пропускаем\n if (element && elementName !== element) {\n break\n }\n\n // добавляем элемент в зависимости от требуемого типа\n if (as === 'node') {\n elements.push(node)\n } else {\n const content = elementNode.outerHTML.trim()\n elements.push(content)\n }\n\n // если требуется рекурсивно обрабатывать дочерние ноды\n if (recursive) {\n for (const child of node.childNodes) {\n this.traverse(child, as, elements)\n }\n }\n break\n // если узел - текстовый и требуется его добавить, добавляем\n case this.TEXT_NODE:\n if (!includeSolidText) {\n break\n }\n\n if (as === 'node') {\n elements.push(node)\n } else {\n const content = node.textContent\n\n if (content) {\n elements.push(content)\n }\n }\n break\n }\n }\n\n /**\n * Парсит HTML строку и возвращает массив тегов или нод в зависимости от опций.\n * @param html HTML строка\n * @param as Тип возвращаемых данных ('string' или 'node')\n * @returns Массив тегов или нод\n */\n async parse(html: string, as: 'string' | 'node' = 'string'): Promise<{ stringNodes: string[]; nodes: Node[] }> {\n const { includeBody } = this.options || {}\n\n const stringNodes: string[] = []\n const nodes: Node[] = []\n const doc = await this.parseFromString(html)\n\n const elements = as === 'string' ? stringNodes : nodes\n\n if (includeBody) {\n this.traverse(doc.body, as, elements)\n } else {\n for (const child of doc.body.childNodes) {\n this.traverse(child, as, elements)\n }\n }\n\n return { stringNodes, nodes }\n }\n\n /**\n * Считает количество указанных тегов в HTML строке.\n * @param html HTML строка\n * @returns Количество найденных тегов\n */\n async countElements(html: string): Promise<number> {\n const { stringNodes } = await this.parse(html, 'string')\n\n return stringNodes.length\n }\n\n /**\n * Преобразует HTML строку в DOM объект.\n * @param html HTML строка\n * @returns DOM объект\n */\n protected abstract parseFromString(html: string): Promise<Document>\n}\n"],"names":["BaseHTMLParser","options","__publicField","node","as","elements","includeSolidText","recursive","element","elementNode","elementName","content","child","html","includeBody","stringNodes","nodes","doc"],"mappings":"oKAqBO,MAAeA,CAAe,CAIzB,YAAoBC,EAAyB,CAHtCC,EAAA,iBAAY,GACZA,EAAA,oBAAe,GAEF,KAAA,QAAAD,CAA0B,CAQ9C,SAASE,EAAYC,EAAwB,SAAUC,EAA6B,CAC5F,KAAM,CAAE,iBAAAC,EAAkB,UAAAC,EAAW,QAAAC,GAAY,KAAK,SAAW,CAAA,EAEjE,OAAQL,EAAK,SAAA,CAEX,KAAK,KAAK,aACR,MAAMM,EAAcN,EACdO,EAAcD,EAAY,QAAQ,YAAA,EAGxC,GAAIC,IAAgB,SAAU,CAC5B,QAAQ,KAAK,mEAAmE,EAChF,KACF,CAGA,GAAIF,GAAWE,IAAgBF,EAC7B,MAIF,GAAIJ,IAAO,OACTC,EAAS,KAAKF,CAAI,MACb,CACL,MAAMQ,EAAUF,EAAY,UAAU,KAAA,EACtCJ,EAAS,KAAKM,CAAO,CACvB,CAGA,GAAIJ,EACF,UAAWK,KAAST,EAAK,WACvB,KAAK,SAASS,EAAOR,EAAIC,CAAQ,EAGrC,MAEF,KAAK,KAAK,UACR,GAAI,CAACC,EACH,MAGF,GAAIF,IAAO,OACTC,EAAS,KAAKF,CAAI,MACb,CACL,MAAMQ,EAAUR,EAAK,YAEjBQ,GACFN,EAAS,KAAKM,CAAO,CAEzB,CACA,KAAA,CAEN,CAQA,MAAM,MAAME,EAAcT,EAAwB,SAA6D,CAC7G,KAAM,CAAE,YAAAU,CAAA,EAAgB,KAAK,SAAW,CAAA,EAElCC,EAAwB,CAAA,EACxBC,EAAgB,CAAA,EAChBC,EAAM,MAAM,KAAK,gBAAgBJ,CAAI,EAErCR,EAAWD,IAAO,SAAWW,EAAcC,EAEjD,GAAIF,EACF,KAAK,SAASG,EAAI,KAAMb,EAAIC,CAAQ,MAEpC,WAAWO,KAASK,EAAI,KAAK,WAC3B,KAAK,SAASL,EAAOR,EAAIC,CAAQ,EAIrC,MAAO,CAAE,YAAAU,EAAa,MAAAC,CAAA,CACxB,CAOA,MAAM,cAAcH,EAA+B,CACjD,KAAM,CAAE,YAAAE,CAAA,EAAgB,MAAM,KAAK,MAAMF,EAAM,QAAQ,EAEvD,OAAOE,EAAY,MACrB,CAQF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlParser.js","sources":["../../../../lib/widgets/htmlParser/htmlParser.ts"],"sourcesContent":["'use client'\n\nimport { BaseHTMLParser, type ParserOptions } from './baseHtmlParser'\n\nconst isBrowser = typeof window !== 'undefined'\n//\n// class BrowserHTMLParserError extends Error {\n// constructor(\n// message: string,\n// public originalError?: Error\n// ) {\n// super(message)\n// this.name = 'BrowserHTMLParserError'\n// }\n// }\n\nexport class HTMLParser extends BaseHTMLParser {\n constructor(options?: ParserOptions) {\n super(options)\n }\n\n async parseFromString(html: string): Promise<Document> {\n if (!isBrowser) {\n return Promise.reject()\n }\n\n const parser = new DOMParser()\n return parser.parseFromString(html, 'text/html')\n }\n}\n"],"names":["isBrowser","HTMLParser","BaseHTMLParser","options","html"],"mappings":"qDAIA,MAAMA,EAAY,OAAO,OAAW,IAY7B,MAAMC,UAAmBC,CAAe,CAC7C,YAAYC,EAAyB,CACnC,MAAMA,CAAO,
|
|
1
|
+
{"version":3,"file":"htmlParser.js","sources":["../../../../lib/widgets/htmlParser/htmlParser.ts"],"sourcesContent":["'use client'\n\nimport { BaseHTMLParser, type ParserOptions } from './baseHtmlParser'\n\nconst isBrowser = typeof window !== 'undefined'\n//\n// class BrowserHTMLParserError extends Error {\n// constructor(\n// message: string,\n// public originalError?: Error\n// ) {\n// super(message)\n// this.name = 'BrowserHTMLParserError'\n// }\n// }\n\nexport class HTMLParser extends BaseHTMLParser {\n constructor(options?: ParserOptions) {\n super(options)\n }\n\n async parseFromString(html: string): Promise<Document> {\n if (!isBrowser) {\n return Promise.reject()\n }\n\n const parser = new DOMParser()\n return parser.parseFromString(html, 'text/html')\n }\n}\n"],"names":["isBrowser","HTMLParser","BaseHTMLParser","options","html"],"mappings":"qDAIA,MAAMA,EAAY,OAAO,OAAW,IAY7B,MAAMC,UAAmBC,CAAe,CAC7C,YAAYC,EAAyB,CACnC,MAAMA,CAAO,CACf,CAEA,MAAM,gBAAgBC,EAAiC,CACrD,OAAKJ,EAIU,IAAI,UAAA,EACL,gBAAgBI,EAAM,WAAW,EAJtC,QAAQ,OAAA,CAKnB,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactHtmlParser.js","sources":["../../../../lib/widgets/htmlParser/reactHtmlParser.tsx"],"sourcesContent":["'use client'\n\nimport { createElement } from 'react'\nimport type { BaseHTMLParser, ParserOptions } from './baseHtmlParser'\nimport { HTMLParser } from './htmlParser'\n\nexport class ReactHTMLParser {\n private static readonly TEXT_NODE = 3 as const\n private static readonly ELEMENT_NODE = 1 as const\n\n /**\n * Функция для парсинга ноды в react элемент\n */\n private static parseNode(node: Node): React.ReactNode {\n // if node is text node\n if (node.nodeType === this.TEXT_NODE) {\n const content = node.textContent\n\n return content ?? null\n }\n // если node является элементом\n if (node.nodeType === this.ELEMENT_NODE) {\n const element = node as Element\n const tagName = element.tagName.toLowerCase()\n\n const attributes: Record<string, string | boolean | Record<string, string>> = {}\n // собираем атрибуты\n for (const attr of element.attributes) {\n let reactAttrName = attr.name\n let reactAttrValue: string | boolean | Record<string, string> = attr.value\n\n switch (attr.name) {\n case 'class':\n reactAttrName = 'className'\n break\n case 'for':\n reactAttrName = 'htmlFor'\n break\n case 'checked':\n case 'disabled':\n case 'selected':\n reactAttrValue = attr.value !== 'false'\n reactAttrValue = attr.value !== 'false'\n reactAttrValue = attr.value !== 'false'\n break\n case 'readonly':\n reactAttrName = 'readOnly'\n reactAttrValue = attr.value !== 'false'\n break\n case 'style':\n reactAttrName = 'style'\n const styles: Record<string, string> = {}\n attr.value.split(';').forEach((style) => {\n const [prop, value] = style.split(':')\n\n if (prop && value) {\n const camelProp = prop.trim().replace(/-([a-z])/g, (_, letter) => letter.toUpperCase())\n\n styles[camelProp] = value.trim()\n }\n })\n\n reactAttrValue = styles\n break\n }\n\n attributes[reactAttrName] = reactAttrValue\n }\n\n attributes.key = Math.random().toString(36).substring(2, 9)\n\n const children: React.ReactNode[] = []\n // рекурсивно парсим все внутренние ноды\n for (const child of element.childNodes) {\n const childNode = this.parseNode(child as Node)\n\n if (childNode) {\n children.push(childNode)\n }\n }\n\n return createElement(tagName, attributes, ...children)\n }\n\n return null\n }\n\n /**\n * функция для преобразования html строки в react элементы\n */\n static async toReactNodes(html: string, options?: ParserOptions) {\n const parser: BaseHTMLParser = new HTMLParser(options)\n const { nodes } = await parser.parse(html, 'node')\n\n return nodes.map((node) => this.parseNode(node))\n }\n}\n"],"names":["ReactHTMLParser","node","element","tagName","attributes","attr","reactAttrName","reactAttrValue","styles","style","prop","value","camelProp","_","letter","children","child","childNode","createElement","html","options","parser","HTMLParser","nodes","__publicField"],"mappings":"uPAMO,MAAMA,CAAgB,CAO3B,OAAe,UAAUC,EAA6B,CAEpD,GAAIA,EAAK,WAAa,KAAK,UAGzB,OAFgBA,EAAK,aAEH,KAGpB,GAAIA,EAAK,WAAa,KAAK,aAAc,CACvC,MAAMC,EAAUD,EACVE,EAAUD,EAAQ,QAAQ,YAAA,EAE1BE,EAAwE,CAAA,EAE9E,UAAWC,KAAQH,EAAQ,WAAY,CACrC,IAAII,EAAgBD,EAAK,KACrBE,EAA4DF,EAAK,MAErE,OAAQA,EAAK,KAAA,CACX,IAAK,QACHC,EAAgB,YAChB,MACF,IAAK,MACHA,EAAgB,UAChB,MACF,IAAK,UACL,IAAK,WACL,IAAK,WACHC,EAAiBF,EAAK,QAAU,QAChCE,EAAiBF,EAAK,QAAU,QAChCE,EAAiBF,EAAK,QAAU,QAChC,MACF,IAAK,WACHC,EAAgB,WAChBC,EAAiBF,EAAK,QAAU,QAChC,MACF,IAAK,QACHC,EAAgB,QAChB,MAAME,EAAiC,CAAA,EACvCH,EAAK,MAAM,MAAM,GAAG,EAAE,QAASI,GAAU,CACvC,KAAM,CAACC,EAAMC,CAAK,EAAIF,EAAM,MAAM,GAAG,EAErC,GAAIC,GAAQC,EAAO,CACjB,MAAMC,EAAYF,EAAK,KAAA,EAAO,QAAQ,YAAa,CAACG,EAAGC,IAAWA,EAAO,YAAA,CAAa,EAEtFN,EAAOI,CAAS,EAAID,EAAM,KAAA,
|
|
1
|
+
{"version":3,"file":"reactHtmlParser.js","sources":["../../../../lib/widgets/htmlParser/reactHtmlParser.tsx"],"sourcesContent":["'use client'\n\nimport { createElement } from 'react'\nimport type { BaseHTMLParser, ParserOptions } from './baseHtmlParser'\nimport { HTMLParser } from './htmlParser'\n\nexport class ReactHTMLParser {\n private static readonly TEXT_NODE = 3 as const\n private static readonly ELEMENT_NODE = 1 as const\n\n /**\n * Функция для парсинга ноды в react элемент\n */\n private static parseNode(node: Node): React.ReactNode {\n // if node is text node\n if (node.nodeType === this.TEXT_NODE) {\n const content = node.textContent\n\n return content ?? null\n }\n // если node является элементом\n if (node.nodeType === this.ELEMENT_NODE) {\n const element = node as Element\n const tagName = element.tagName.toLowerCase()\n\n const attributes: Record<string, string | boolean | Record<string, string>> = {}\n // собираем атрибуты\n for (const attr of element.attributes) {\n let reactAttrName = attr.name\n let reactAttrValue: string | boolean | Record<string, string> = attr.value\n\n switch (attr.name) {\n case 'class':\n reactAttrName = 'className'\n break\n case 'for':\n reactAttrName = 'htmlFor'\n break\n case 'checked':\n case 'disabled':\n case 'selected':\n reactAttrValue = attr.value !== 'false'\n reactAttrValue = attr.value !== 'false'\n reactAttrValue = attr.value !== 'false'\n break\n case 'readonly':\n reactAttrName = 'readOnly'\n reactAttrValue = attr.value !== 'false'\n break\n case 'style':\n reactAttrName = 'style'\n const styles: Record<string, string> = {}\n attr.value.split(';').forEach((style) => {\n const [prop, value] = style.split(':')\n\n if (prop && value) {\n const camelProp = prop.trim().replace(/-([a-z])/g, (_, letter) => letter.toUpperCase())\n\n styles[camelProp] = value.trim()\n }\n })\n\n reactAttrValue = styles\n break\n }\n\n attributes[reactAttrName] = reactAttrValue\n }\n\n attributes.key = Math.random().toString(36).substring(2, 9)\n\n const children: React.ReactNode[] = []\n // рекурсивно парсим все внутренние ноды\n for (const child of element.childNodes) {\n const childNode = this.parseNode(child as Node)\n\n if (childNode) {\n children.push(childNode)\n }\n }\n\n return createElement(tagName, attributes, ...children)\n }\n\n return null\n }\n\n /**\n * функция для преобразования html строки в react элементы\n */\n static async toReactNodes(html: string, options?: ParserOptions) {\n const parser: BaseHTMLParser = new HTMLParser(options)\n const { nodes } = await parser.parse(html, 'node')\n\n return nodes.map((node) => this.parseNode(node))\n }\n}\n"],"names":["ReactHTMLParser","node","element","tagName","attributes","attr","reactAttrName","reactAttrValue","styles","style","prop","value","camelProp","_","letter","children","child","childNode","createElement","html","options","parser","HTMLParser","nodes","__publicField"],"mappings":"uPAMO,MAAMA,CAAgB,CAO3B,OAAe,UAAUC,EAA6B,CAEpD,GAAIA,EAAK,WAAa,KAAK,UAGzB,OAFgBA,EAAK,aAEH,KAGpB,GAAIA,EAAK,WAAa,KAAK,aAAc,CACvC,MAAMC,EAAUD,EACVE,EAAUD,EAAQ,QAAQ,YAAA,EAE1BE,EAAwE,CAAA,EAE9E,UAAWC,KAAQH,EAAQ,WAAY,CACrC,IAAII,EAAgBD,EAAK,KACrBE,EAA4DF,EAAK,MAErE,OAAQA,EAAK,KAAA,CACX,IAAK,QACHC,EAAgB,YAChB,MACF,IAAK,MACHA,EAAgB,UAChB,MACF,IAAK,UACL,IAAK,WACL,IAAK,WACHC,EAAiBF,EAAK,QAAU,QAChCE,EAAiBF,EAAK,QAAU,QAChCE,EAAiBF,EAAK,QAAU,QAChC,MACF,IAAK,WACHC,EAAgB,WAChBC,EAAiBF,EAAK,QAAU,QAChC,MACF,IAAK,QACHC,EAAgB,QAChB,MAAME,EAAiC,CAAA,EACvCH,EAAK,MAAM,MAAM,GAAG,EAAE,QAASI,GAAU,CACvC,KAAM,CAACC,EAAMC,CAAK,EAAIF,EAAM,MAAM,GAAG,EAErC,GAAIC,GAAQC,EAAO,CACjB,MAAMC,EAAYF,EAAK,KAAA,EAAO,QAAQ,YAAa,CAACG,EAAGC,IAAWA,EAAO,YAAA,CAAa,EAEtFN,EAAOI,CAAS,EAAID,EAAM,KAAA,CAC5B,CACF,CAAC,EAEDJ,EAAiBC,EACjB,KAAA,CAGJJ,EAAWE,CAAa,EAAIC,CAC9B,CAEAH,EAAW,IAAM,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,UAAU,EAAG,CAAC,EAE1D,MAAMW,EAA8B,CAAA,EAEpC,UAAWC,KAASd,EAAQ,WAAY,CACtC,MAAMe,EAAY,KAAK,UAAUD,CAAa,EAE1CC,GACFF,EAAS,KAAKE,CAAS,CAE3B,CAEA,OAAOC,EAAcf,EAASC,EAAY,GAAGW,CAAQ,CACvD,CAEA,OAAO,IACT,CAKA,aAAa,aAAaI,EAAcC,EAAyB,CAC/D,MAAMC,EAAyB,IAAIC,EAAWF,CAAO,EAC/C,CAAE,MAAAG,CAAA,EAAU,MAAMF,EAAO,MAAMF,EAAM,MAAM,EAEjD,OAAOI,EAAM,IAAKtB,GAAS,KAAK,UAAUA,CAAI,CAAC,CACjD,CACF,CAzFEuB,EADWxB,EACa,YAAY,GACpCwB,EAFWxB,EAEa,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesDesktop.js","sources":["../../../../../../lib/widgets/seoHeader/ui/desktop/CategoriesDesktop.tsx"],"sourcesContent":["import { currentCategoryAction, rootCategoryAction, useCategoryReducer } from '../../hooks'\nimport type { Category, SeoHeaderHelpers } from '../../model'\nimport { CategoryTabs } from './CategoryTabs'\nimport { RootTab } from './rootTab'\nimport { Icon } from '$/shared/ui'\nimport { createPhoneNumber } from '$/shared/utils'\n\ntype DesktopCategoriesProps = {\n categories: Category[]\n helpers: SeoHeaderHelpers[]\n phone: string\n}\n\nexport const CategoriesDesktop = ({ categories, helpers, phone }: DesktopCategoriesProps) => {\n const [store, dispatch] = useCategoryReducer({ root: categories[0].children[0], current: categories[0].children[0] })\n\n return (\n <div className='mobile:hidden'>\n <div className='flex w-full items-center justify-between gap-x-4 border-b border-b-[rgba(234,237,241)] py-4'>\n <Icon name='brandLogos/logoMain' className='mr-auto w-[130px]' />\n {categories.map((category) => {\n const active = store.root.title === category.title\n\n return (\n <RootTab\n key={category.title}\n category={category}\n selectedCategory={store.current}\n onCurrentCategoryChange={(cat) => dispatch(currentCategoryAction(cat))}\n onRootCategoryChange={(cat) => dispatch(rootCategoryAction(cat))}\n active={active}\n />\n )\n })}\n <div className='h-3.5 w-[1px] rounded-sm bg-color-blue-grey-500' />\n {helpers.map((helper) => (\n <a\n key={helper.title}\n href={helper.link.href}\n className='desk-body-regular-m flex items-center gap-x-1 text-color-blue-grey-600 duration-100 hover:text-color-dark'\n >\n {helper.link.icon && <Icon name={helper.link.icon} className='size-4' />}\n {helper.title}\n </a>\n ))}\n <div className='h-3.5 w-[1px] rounded-sm bg-color-blue-grey-500' />\n <a\n href={`tel:${phone}`}\n className='desk-body-regular-m flex items-center gap-x-1 text-color-blue-grey-600 duration-100 hover:text-color-dark'\n >\n {createPhoneNumber(phone, 'x xxx xxx xx xx')}\n </a>\n </div>\n <CategoryTabs categories={store.current.children} />\n </div>\n )\n}\n"],"names":["CategoriesDesktop","categories","helpers","phone","store","dispatch","useCategoryReducer","jsxs","jsx","Icon","category","active","RootTab","cat","currentCategoryAction","rootCategoryAction","helper","createPhoneNumber","CategoryTabs"],"mappings":"ozEAaO,MAAMA,GAAoB,CAAC,CAAE,WAAAC,EAAY,QAAAC,EAAS,MAAAC,KAAoC,CAC3F,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAmB,CAAE,KAAML,EAAW,CAAC,EAAE,SAAS,CAAC,EAAG,QAASA,EAAW,CAAC,EAAE,SAAS,CAAC,EAAG,EAEpH,OACEM,EAAC,MAAA,CAAI,UAAU,gBACb,SAAA,CAAAA,EAAC,MAAA,CAAI,UAAU,8FACb,SAAA,CAAAC,EAACC,EAAA,CAAK,KAAK,sBAAsB,UAAU,oBAAoB,EAC9DR,EAAW,IAAKS,GAAa,CAC5B,MAAMC,EAASP,EAAM,KAAK,QAAUM,EAAS,MAE7C,OACEF,EAACI,EAAA,CAEC,SAAAF,EACA,iBAAkBN,EAAM,QACxB,wBAA0BS,GAAQR,EAASS,EAAsBD,CAAG,CAAC,EACrE,qBAAuBA,GAAQR,EAASU,EAAmBF,CAAG,CAAC,EAC/D,OAAAF,CAAA,EALKD,EAAS,KAAA,
|
|
1
|
+
{"version":3,"file":"CategoriesDesktop.js","sources":["../../../../../../lib/widgets/seoHeader/ui/desktop/CategoriesDesktop.tsx"],"sourcesContent":["import { currentCategoryAction, rootCategoryAction, useCategoryReducer } from '../../hooks'\nimport type { Category, SeoHeaderHelpers } from '../../model'\nimport { CategoryTabs } from './CategoryTabs'\nimport { RootTab } from './rootTab'\nimport { Icon } from '$/shared/ui'\nimport { createPhoneNumber } from '$/shared/utils'\n\ntype DesktopCategoriesProps = {\n categories: Category[]\n helpers: SeoHeaderHelpers[]\n phone: string\n}\n\nexport const CategoriesDesktop = ({ categories, helpers, phone }: DesktopCategoriesProps) => {\n const [store, dispatch] = useCategoryReducer({ root: categories[0].children[0], current: categories[0].children[0] })\n\n return (\n <div className='mobile:hidden'>\n <div className='flex w-full items-center justify-between gap-x-4 border-b border-b-[rgba(234,237,241)] py-4'>\n <Icon name='brandLogos/logoMain' className='mr-auto w-[130px]' />\n {categories.map((category) => {\n const active = store.root.title === category.title\n\n return (\n <RootTab\n key={category.title}\n category={category}\n selectedCategory={store.current}\n onCurrentCategoryChange={(cat) => dispatch(currentCategoryAction(cat))}\n onRootCategoryChange={(cat) => dispatch(rootCategoryAction(cat))}\n active={active}\n />\n )\n })}\n <div className='h-3.5 w-[1px] rounded-sm bg-color-blue-grey-500' />\n {helpers.map((helper) => (\n <a\n key={helper.title}\n href={helper.link.href}\n className='desk-body-regular-m flex items-center gap-x-1 text-color-blue-grey-600 duration-100 hover:text-color-dark'\n >\n {helper.link.icon && <Icon name={helper.link.icon} className='size-4' />}\n {helper.title}\n </a>\n ))}\n <div className='h-3.5 w-[1px] rounded-sm bg-color-blue-grey-500' />\n <a\n href={`tel:${phone}`}\n className='desk-body-regular-m flex items-center gap-x-1 text-color-blue-grey-600 duration-100 hover:text-color-dark'\n >\n {createPhoneNumber(phone, 'x xxx xxx xx xx')}\n </a>\n </div>\n <CategoryTabs categories={store.current.children} />\n </div>\n )\n}\n"],"names":["CategoriesDesktop","categories","helpers","phone","store","dispatch","useCategoryReducer","jsxs","jsx","Icon","category","active","RootTab","cat","currentCategoryAction","rootCategoryAction","helper","createPhoneNumber","CategoryTabs"],"mappings":"ozEAaO,MAAMA,GAAoB,CAAC,CAAE,WAAAC,EAAY,QAAAC,EAAS,MAAAC,KAAoC,CAC3F,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAmB,CAAE,KAAML,EAAW,CAAC,EAAE,SAAS,CAAC,EAAG,QAASA,EAAW,CAAC,EAAE,SAAS,CAAC,EAAG,EAEpH,OACEM,EAAC,MAAA,CAAI,UAAU,gBACb,SAAA,CAAAA,EAAC,MAAA,CAAI,UAAU,8FACb,SAAA,CAAAC,EAACC,EAAA,CAAK,KAAK,sBAAsB,UAAU,oBAAoB,EAC9DR,EAAW,IAAKS,GAAa,CAC5B,MAAMC,EAASP,EAAM,KAAK,QAAUM,EAAS,MAE7C,OACEF,EAACI,EAAA,CAEC,SAAAF,EACA,iBAAkBN,EAAM,QACxB,wBAA0BS,GAAQR,EAASS,EAAsBD,CAAG,CAAC,EACrE,qBAAuBA,GAAQR,EAASU,EAAmBF,CAAG,CAAC,EAC/D,OAAAF,CAAA,EALKD,EAAS,KAAA,CAQpB,CAAC,EACDF,EAAC,MAAA,CAAI,UAAU,iDAAA,CAAkD,EAChEN,EAAQ,IAAKc,GACZT,EAAC,IAAA,CAEC,KAAMS,EAAO,KAAK,KAClB,UAAU,4GAET,SAAA,CAAAA,EAAO,KAAK,MAAQR,EAACC,EAAA,CAAK,KAAMO,EAAO,KAAK,KAAM,UAAU,QAAA,CAAS,EACrEA,EAAO,KAAA,CAAA,EALHA,EAAO,KAAA,CAOf,EACDR,EAAC,MAAA,CAAI,UAAU,iDAAA,CAAkD,EACjEA,EAAC,IAAA,CACC,KAAM,OAAOL,CAAK,GAClB,UAAU,4GAET,SAAAc,EAAkBd,EAAO,iBAAiB,CAAA,CAAA,CAC7C,EACF,EACAK,EAACU,EAAA,CAAa,WAAYd,EAAM,QAAQ,QAAA,CAAU,CAAA,EACpD,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryTabs.js","sources":["../../../../../../lib/widgets/seoHeader/ui/desktop/CategoryTabs.tsx"],"sourcesContent":["import { memo, useCallback, useRef, useState } from 'react'\nimport { AnimatePresence } from 'framer-motion'\nimport type { Category } from '../../model'\nimport { Tab } from './tab'\n\ntype CategoryTabsProps = {\n categories: Category[]\n}\n\nconst InnerComponent = ({ categories }: CategoryTabsProps) => {\n const [activeTab, setActiveTab] = useState<string | null>(null)\n\n const onActiveTabChange = useCallback((active: string | null) => {\n setActiveTab(active)\n }, [])\n\n const triggerRef = useRef<HTMLDivElement>(null)\n\n return (\n <AnimatePresence mode='sync'>\n <div\n ref={triggerRef}\n id='tabs'\n className='relative flex w-full items-center justify-between gap-x-4 border-b border-b-[rgba(234,237,241)]'\n >\n {categories.map((category) => (\n <Tab\n key={category.title}\n ref={triggerRef}\n category={category}\n active={activeTab === category.title}\n onActiveTabChange={onActiveTabChange}\n />\n ))}\n <div className='ml-auto'>Личный кабинет</div>\n </div>\n </AnimatePresence>\n )\n}\n\nexport const CategoryTabs = memo(InnerComponent) as typeof InnerComponent\n"],"names":["InnerComponent","categories","activeTab","setActiveTab","useState","onActiveTabChange","useCallback","active","triggerRef","useRef","jsx","AnimatePresence","jsxs","category","Tab","CategoryTabs","memo"],"mappings":"qRASA,MAAMA,EAAiB,CAAC,CAAE,WAAAC,KAAoC,CAC5D,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAwB,IAAI,EAExDC,EAAoBC,EAAaC,GAA0B,CAC/DJ,EAAaI,CAAM,CAAA,
|
|
1
|
+
{"version":3,"file":"CategoryTabs.js","sources":["../../../../../../lib/widgets/seoHeader/ui/desktop/CategoryTabs.tsx"],"sourcesContent":["import { memo, useCallback, useRef, useState } from 'react'\nimport { AnimatePresence } from 'framer-motion'\nimport type { Category } from '../../model'\nimport { Tab } from './tab'\n\ntype CategoryTabsProps = {\n categories: Category[]\n}\n\nconst InnerComponent = ({ categories }: CategoryTabsProps) => {\n const [activeTab, setActiveTab] = useState<string | null>(null)\n\n const onActiveTabChange = useCallback((active: string | null) => {\n setActiveTab(active)\n }, [])\n\n const triggerRef = useRef<HTMLDivElement>(null)\n\n return (\n <AnimatePresence mode='sync'>\n <div\n ref={triggerRef}\n id='tabs'\n className='relative flex w-full items-center justify-between gap-x-4 border-b border-b-[rgba(234,237,241)]'\n >\n {categories.map((category) => (\n <Tab\n key={category.title}\n ref={triggerRef}\n category={category}\n active={activeTab === category.title}\n onActiveTabChange={onActiveTabChange}\n />\n ))}\n <div className='ml-auto'>Личный кабинет</div>\n </div>\n </AnimatePresence>\n )\n}\n\nexport const CategoryTabs = memo(InnerComponent) as typeof InnerComponent\n"],"names":["InnerComponent","categories","activeTab","setActiveTab","useState","onActiveTabChange","useCallback","active","triggerRef","useRef","jsx","AnimatePresence","jsxs","category","Tab","CategoryTabs","memo"],"mappings":"qRASA,MAAMA,EAAiB,CAAC,CAAE,WAAAC,KAAoC,CAC5D,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAwB,IAAI,EAExDC,EAAoBC,EAAaC,GAA0B,CAC/DJ,EAAaI,CAAM,CACrB,EAAG,CAAA,CAAE,EAECC,EAAaC,EAAuB,IAAI,EAE9C,OACEC,EAACC,EAAA,CAAgB,KAAK,OACpB,SAAAC,EAAC,MAAA,CACC,IAAKJ,EACL,GAAG,OACH,UAAU,kGAET,SAAA,CAAAP,EAAW,IAAKY,GACfH,EAACI,EAAA,CAEC,IAAKN,EACL,SAAAK,EACA,OAAQX,IAAcW,EAAS,MAC/B,kBAAAR,CAAA,EAJKQ,EAAS,KAAA,CAMjB,EACDH,EAAC,MAAA,CAAI,UAAU,UAAU,SAAA,gBAAA,CAAc,CAAA,CAAA,CAAA,EAE3C,CAEJ,EAEaK,EAAeC,EAAKhB,CAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootTab.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/desktop/rootTab/RootTab.tsx"],"sourcesContent":["import type { Category } from '../../../model'\nimport { cn } from '$/shared/utils'\n\ntype RootTabProps = React.HTMLAttributes<HTMLDivElement> & {\n category: Category\n selectedCategory: Category\n onCurrentCategoryChange: (category: Category) => void\n onRootCategoryChange: (category: Category) => void\n active: boolean\n}\n\nexport const RootTab = ({\n category,\n selectedCategory,\n onCurrentCategoryChange,\n onRootCategoryChange,\n active,\n ...props\n}: RootTabProps) => {\n return (\n <div\n {...props}\n onClick={() => {\n onCurrentCategoryChange(category.children[0])\n onRootCategoryChange(category)\n }}\n className={cn('group/category relative cursor-default text-color-blue-grey-600 duration-100 hover:text-color-dark', {\n 'text-color-dark': active\n })}\n >\n <span className='desk-body-regular-m'>{category.title}</span>\n {category.children.length > 1 && (\n <div\n className={cn(\n 'absolute right-0 top-full z-10 flex w-max flex-col',\n 'invisible bg-color-white opacity-0 shadow-sm group-hover/category:visible group-hover/category:opacity-100',\n 'rounded-sm p-1'\n )}\n >\n {category.children.map((child) => (\n <span\n onClick={(event) => {\n event.stopPropagation()\n event.nativeEvent.stopPropagation()\n\n onRootCategoryChange(category)\n onCurrentCategoryChange(child)\n }}\n key={child.title}\n className={cn(\n 'desk-body-regular-l rounded-sm px-3 py-3.5 text-color-dark duration-100 hover:bg-color-primary-tr-hover hover:text-color-dark',\n {\n 'text-color-primary-default': selectedCategory.title === child.title\n }\n )}\n >\n {child.title}\n </span>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"names":["RootTab","category","selectedCategory","onCurrentCategoryChange","onRootCategoryChange","active","props","jsxs","cn","jsx","child","event"],"mappings":"yGAWO,MAAMA,EAAU,CAAC,CACtB,SAAAC,EACA,iBAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,OAAAC,EACA,GAAGC,CACL,IAEIC,EAAC,MAAA,CACE,GAAGD,EACJ,QAAS,IAAM,CACbH,EAAwBF,EAAS,SAAS,CAAC,CAAC,EAC5CG,EAAqBH,CAAQ,
|
|
1
|
+
{"version":3,"file":"RootTab.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/desktop/rootTab/RootTab.tsx"],"sourcesContent":["import type { Category } from '../../../model'\nimport { cn } from '$/shared/utils'\n\ntype RootTabProps = React.HTMLAttributes<HTMLDivElement> & {\n category: Category\n selectedCategory: Category\n onCurrentCategoryChange: (category: Category) => void\n onRootCategoryChange: (category: Category) => void\n active: boolean\n}\n\nexport const RootTab = ({\n category,\n selectedCategory,\n onCurrentCategoryChange,\n onRootCategoryChange,\n active,\n ...props\n}: RootTabProps) => {\n return (\n <div\n {...props}\n onClick={() => {\n onCurrentCategoryChange(category.children[0])\n onRootCategoryChange(category)\n }}\n className={cn('group/category relative cursor-default text-color-blue-grey-600 duration-100 hover:text-color-dark', {\n 'text-color-dark': active\n })}\n >\n <span className='desk-body-regular-m'>{category.title}</span>\n {category.children.length > 1 && (\n <div\n className={cn(\n 'absolute right-0 top-full z-10 flex w-max flex-col',\n 'invisible bg-color-white opacity-0 shadow-sm group-hover/category:visible group-hover/category:opacity-100',\n 'rounded-sm p-1'\n )}\n >\n {category.children.map((child) => (\n <span\n onClick={(event) => {\n event.stopPropagation()\n event.nativeEvent.stopPropagation()\n\n onRootCategoryChange(category)\n onCurrentCategoryChange(child)\n }}\n key={child.title}\n className={cn(\n 'desk-body-regular-l rounded-sm px-3 py-3.5 text-color-dark duration-100 hover:bg-color-primary-tr-hover hover:text-color-dark',\n {\n 'text-color-primary-default': selectedCategory.title === child.title\n }\n )}\n >\n {child.title}\n </span>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"names":["RootTab","category","selectedCategory","onCurrentCategoryChange","onRootCategoryChange","active","props","jsxs","cn","jsx","child","event"],"mappings":"yGAWO,MAAMA,EAAU,CAAC,CACtB,SAAAC,EACA,iBAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,OAAAC,EACA,GAAGC,CACL,IAEIC,EAAC,MAAA,CACE,GAAGD,EACJ,QAAS,IAAM,CACbH,EAAwBF,EAAS,SAAS,CAAC,CAAC,EAC5CG,EAAqBH,CAAQ,CAC/B,EACA,UAAWO,EAAG,qGAAsG,CAClH,kBAAmBH,CAAA,CACpB,EAED,SAAA,CAAAI,EAAC,OAAA,CAAK,UAAU,sBAAuB,SAAAR,EAAS,MAAM,EACrDA,EAAS,SAAS,OAAS,GAC1BQ,EAAC,MAAA,CACC,UAAWD,EACT,qDACA,6GACA,gBAAA,EAGD,SAAAP,EAAS,SAAS,IAAKS,GACtBD,EAAC,OAAA,CACC,QAAUE,GAAU,CAClBA,EAAM,gBAAA,EACNA,EAAM,YAAY,gBAAA,EAElBP,EAAqBH,CAAQ,EAC7BE,EAAwBO,CAAK,CAC/B,EAEA,UAAWF,EACT,gIACA,CACE,6BAA8BN,EAAiB,QAAUQ,EAAM,KAAA,CACjE,EAGD,SAAAA,EAAM,KAAA,EARFA,EAAM,KAAA,CAUd,CAAA,CAAA,CACH,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabContent.js","sources":["../../../../../../../../../lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.tsx"],"sourcesContent":["import { createPortal } from 'react-dom'\nimport { motion } from 'framer-motion'\nimport type { Category } from '../../../../../model'\nimport { Icon } from '$/shared/ui'\n\ntype TabContentProps = React.ComponentProps<typeof motion.div> & {\n categories: Category[]\n}\n\nexport const TabContent = ({ categories, ...props }: TabContentProps) => {\n return createPortal(\n <motion.div\n {...props}\n layout\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className='absolute z-20 w-full bg-color-white after:absolute after:left-1/2 after:top-[-1px] after:h-[1px] after:w-full after:max-w-[636px] after:-translate-x-1/2 after:bg-color-blue-grey-200 after:content-[\"\"] after:desktop:max-w-[1140px]'\n >\n <div className='mx-auto flex w-full max-w-[1140px] gap-x-[56px] py-10'>\n {categories.map((category) => {\n const CategoryTitle = category.link ? 'a' : 'p'\n\n return (\n <div key={category.title} className='flex flex-col gap-y-6'>\n {category.title && (\n <CategoryTitle\n href={category.link?.href ?? undefined}\n className='flex items-center gap-x-1 text-16 uppercase text-color-primary-default'\n >\n {category.title}\n\n <Icon name='arrows/arrowLink' className='size-6' />\n </CategoryTitle>\n )}\n <ul className='w-[328px]'>\n {category.children.map((child) => (\n <li key={child.title} className='w-full [&:not(:last-child)]:mb-4'>\n <a href={child.link?.href} target={child.link?.target} className='w-full text-16'>\n {child.title}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )\n })}\n </div>\n </motion.div>,\n /**\n * Нужно для preview, чтобы категории рендерились в iframe\n */\n document.body.querySelector<HTMLIFrameElement>('#modal-preview')?.contentDocument?.body ?? document.body\n )\n}\n"],"names":["TabContent","categories","props","createPortal","jsx","motion","category","CategoryTitle","jsxs","_a","Icon","child","_b"],"mappings":"8zEASO,MAAMA,EAAa,CAAC,CAAE,WAAAC,EAAY,GAAGC,KAA6B,SACvE,OAAOC,EACLC,EAACC,EAAO,IAAP,CACE,GAAGH,EACJ,OAAM,GACN,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,CAAA,EACpB,WAAY,CAAE,SAAU,EAAA,EACxB,UAAU,wOAEV,WAAC,MAAA,CAAI,UAAU,wDACZ,SAAAD,EAAW,IAAKK,GAAa,OAC5B,MAAMC,EAAgBD,EAAS,KAAO,IAAM,IAE5C,OACEE,EAAC,MAAA,CAAyB,UAAU,wBACjC,SAAA,CAAAF,EAAS,OACRE,EAACD,EAAA,CACC,OAAME,EAAAH,EAAS,OAAT,YAAAG,EAAe,OAAQ,OAC7B,UAAU,yEAET,SAAA,CAAAH,EAAS,MAEVF,EAACM,EAAA,CAAK,KAAK,mBAAmB,UAAU,QAAA,CAAS,CAAA,CAAA,CAAA,EAGrDN,EAAC,KAAA,CAAG,UAAU,YACX,SAAAE,EAAS,SAAS,IAAKK,GAAA,SACtB,OAAAP,EAAC,KAAA,CAAqB,UAAU,mCAC9B,SAAAA,EAAC,IAAA,CAAE,MAAMK,EAAAE,EAAM,OAAN,YAAAF,EAAY,KAAM,QAAQG,EAAAD,EAAM,OAAN,YAAAC,EAAY,OAAQ,UAAU,iBAC9D,SAAAD,EAAM,KAAA,CACT,CAAA,EAHOA,EAAM,KAIf,EACD,CAAA,CACH,CAAA,CAAA,EAnBQL,EAAS,KAoBnB,
|
|
1
|
+
{"version":3,"file":"TabContent.js","sources":["../../../../../../../../../lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.tsx"],"sourcesContent":["import { createPortal } from 'react-dom'\nimport { motion } from 'framer-motion'\nimport type { Category } from '../../../../../model'\nimport { Icon } from '$/shared/ui'\n\ntype TabContentProps = React.ComponentProps<typeof motion.div> & {\n categories: Category[]\n}\n\nexport const TabContent = ({ categories, ...props }: TabContentProps) => {\n return createPortal(\n <motion.div\n {...props}\n layout\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className='absolute z-20 w-full bg-color-white after:absolute after:left-1/2 after:top-[-1px] after:h-[1px] after:w-full after:max-w-[636px] after:-translate-x-1/2 after:bg-color-blue-grey-200 after:content-[\"\"] after:desktop:max-w-[1140px]'\n >\n <div className='mx-auto flex w-full max-w-[1140px] gap-x-[56px] py-10'>\n {categories.map((category) => {\n const CategoryTitle = category.link ? 'a' : 'p'\n\n return (\n <div key={category.title} className='flex flex-col gap-y-6'>\n {category.title && (\n <CategoryTitle\n href={category.link?.href ?? undefined}\n className='flex items-center gap-x-1 text-16 uppercase text-color-primary-default'\n >\n {category.title}\n\n <Icon name='arrows/arrowLink' className='size-6' />\n </CategoryTitle>\n )}\n <ul className='w-[328px]'>\n {category.children.map((child) => (\n <li key={child.title} className='w-full [&:not(:last-child)]:mb-4'>\n <a href={child.link?.href} target={child.link?.target} className='w-full text-16'>\n {child.title}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )\n })}\n </div>\n </motion.div>,\n /**\n * Нужно для preview, чтобы категории рендерились в iframe\n */\n document.body.querySelector<HTMLIFrameElement>('#modal-preview')?.contentDocument?.body ?? document.body\n )\n}\n"],"names":["TabContent","categories","props","createPortal","jsx","motion","category","CategoryTitle","jsxs","_a","Icon","child","_b"],"mappings":"8zEASO,MAAMA,EAAa,CAAC,CAAE,WAAAC,EAAY,GAAGC,KAA6B,SACvE,OAAOC,EACLC,EAACC,EAAO,IAAP,CACE,GAAGH,EACJ,OAAM,GACN,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,CAAA,EACpB,WAAY,CAAE,SAAU,EAAA,EACxB,UAAU,wOAEV,WAAC,MAAA,CAAI,UAAU,wDACZ,SAAAD,EAAW,IAAKK,GAAa,OAC5B,MAAMC,EAAgBD,EAAS,KAAO,IAAM,IAE5C,OACEE,EAAC,MAAA,CAAyB,UAAU,wBACjC,SAAA,CAAAF,EAAS,OACRE,EAACD,EAAA,CACC,OAAME,EAAAH,EAAS,OAAT,YAAAG,EAAe,OAAQ,OAC7B,UAAU,yEAET,SAAA,CAAAH,EAAS,MAEVF,EAACM,EAAA,CAAK,KAAK,mBAAmB,UAAU,QAAA,CAAS,CAAA,CAAA,CAAA,EAGrDN,EAAC,KAAA,CAAG,UAAU,YACX,SAAAE,EAAS,SAAS,IAAKK,GAAA,SACtB,OAAAP,EAAC,KAAA,CAAqB,UAAU,mCAC9B,SAAAA,EAAC,IAAA,CAAE,MAAMK,EAAAE,EAAM,OAAN,YAAAF,EAAY,KAAM,QAAQG,EAAAD,EAAM,OAAN,YAAAC,EAAY,OAAQ,UAAU,iBAC9D,SAAAD,EAAM,KAAA,CACT,CAAA,EAHOA,EAAM,KAIf,EACD,CAAA,CACH,CAAA,CAAA,EAnBQL,EAAS,KAoBnB,CAEJ,CAAC,CAAA,CACH,CAAA,CAAA,IAKFM,GAAAH,EAAA,SAAS,KAAK,cAAiC,gBAAgB,IAA/D,YAAAA,EAAkE,kBAAlE,YAAAG,EAAmF,OAAQ,SAAS,IAAA,CAExG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/Menu.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { motion } from 'framer-motion'\nimport type { Category, SeoHeaderHelpers } from '../../../model'\nimport { MenuItem } from './MenuItem'\nimport { Icon, SelectBase, type SelectItemOption } from '$/shared/ui'\nimport { cn, createPhoneNumber, TypeGuards } from '$/shared/utils'\n\nexport type MenuProps = React.ComponentProps<typeof motion.div> & {\n categories: Category[]\n helpers: SeoHeaderHelpers[]\n phone: string\n}\n\nconst getSelectCategories = (categories: Category[]): SelectItemOption[] =>\n categories.map((category) => ({\n value: category.title ?? '',\n label: category.title ?? ''\n }))\n\nexport const Menu = ({ categories, helpers, phone, ...props }: MenuProps) => {\n const selectCategories = getSelectCategories(categories)\n\n const [selected, setSelected] = useState<SelectItemOption | SelectItemOption[] | undefined>(selectCategories[0])\n\n const onCategoryChange = (option?: SelectItemOption | SelectItemOption[]) => {\n if (TypeGuards.isUndefined(option) || TypeGuards.isArray(option)) return\n\n setSelected(option)\n }\n\n const selectedSubCategories = useMemo<Category[]>(() => {\n if (TypeGuards.isUndefined(selected) || TypeGuards.isArray(selected)) return []\n\n return categories.find((category) => category.title === selected.value)?.children ?? []\n }, [selected, categories])\n\n return (\n <motion.div\n {...props}\n className={cn(\n 'absolute z-10 w-full max-w-[calc(636px-32px)]',\n 'absolute left-1/2 top-full bg-color-white p-4',\n '-translate-x-1/2 overflow-x-hidden',\n 'flex flex-col items-center justify-center gap-y-4'\n )}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n >\n <SelectBase label='Категория' options={selectCategories} value={selected} onChange={onCategoryChange} />\n <div className='flex w-full flex-col items-center justify-center gap-y-1'>\n {selectedSubCategories.map((subCategory) => {\n if (TypeGuards.isArrayEmpty(subCategory.children)) {\n return (\n <div key={subCategory.title} className='w-full px-4 py-2.5'>\n <a href={subCategory.link?.href} className='desk-body-regular-m inline-block w-full'>\n {subCategory.title}\n </a>\n </div>\n )\n }\n\n return <MenuItem key={subCategory.title} category={subCategory} />\n })}\n </div>\n <div className='h-[1px] w-full bg-color-blue-grey-200' />\n <div className='flex w-full flex-col items-center justify-center gap-y-1'>\n {helpers.map((helper) => (\n <div key={helper.title} className='w-full px-4 py-2.5'>\n <a href={helper.link?.href} className='flex w-full items-center gap-x-1'>\n {helper.link?.icon && <Icon name={helper.link.icon} className='size-4' />}\n {helper.title}\n </a>\n </div>\n ))}\n <div className='w-full px-4 py-2.5'>\n <a href={`tel:${phone}`} className='flex w-full items-center gap-x-1'>\n <Icon name='communication/phone' className='size-4' />\n {createPhoneNumber(phone)}\n </a>\n </div>\n </div>\n </motion.div>\n )\n}\n"],"names":["getSelectCategories","categories","category","Menu","helpers","phone","props","selectCategories","selected","setSelected","useState","onCategoryChange","option","TypeGuards","selectedSubCategories","useMemo","_a","jsxs","motion","cn","jsx","SelectBase","subCategory","MenuItem","helper","_b","Icon","createPhoneNumber"],"mappings":"y5EAaA,MAAMA,EAAuBC,GAC3BA,EAAW,IAAKC,IAAc,CAC5B,MAAOA,EAAS,OAAS,GACzB,MAAOA,EAAS,OAAS,EAC3B,EAAE,EAESC,GAAO,CAAC,CAAE,WAAAF,EAAY,QAAAG,EAAS,MAAAC,EAAO,GAAGC,KAAuB,CAC3E,MAAMC,EAAmBP,EAAoBC,CAAU,EAEjD,CAACO,EAAUC,CAAW,EAAIC,EAA4DH,EAAiB,CAAC,CAAC,EAEzGI,EAAoBC,GAAmD,CACvEC,EAAW,YAAYD,CAAM,GAAKC,EAAW,QAAQD,CAAM,GAE/DH,EAAYG,CAAM,
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/Menu.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { motion } from 'framer-motion'\nimport type { Category, SeoHeaderHelpers } from '../../../model'\nimport { MenuItem } from './MenuItem'\nimport { Icon, SelectBase, type SelectItemOption } from '$/shared/ui'\nimport { cn, createPhoneNumber, TypeGuards } from '$/shared/utils'\n\nexport type MenuProps = React.ComponentProps<typeof motion.div> & {\n categories: Category[]\n helpers: SeoHeaderHelpers[]\n phone: string\n}\n\nconst getSelectCategories = (categories: Category[]): SelectItemOption[] =>\n categories.map((category) => ({\n value: category.title ?? '',\n label: category.title ?? ''\n }))\n\nexport const Menu = ({ categories, helpers, phone, ...props }: MenuProps) => {\n const selectCategories = getSelectCategories(categories)\n\n const [selected, setSelected] = useState<SelectItemOption | SelectItemOption[] | undefined>(selectCategories[0])\n\n const onCategoryChange = (option?: SelectItemOption | SelectItemOption[]) => {\n if (TypeGuards.isUndefined(option) || TypeGuards.isArray(option)) return\n\n setSelected(option)\n }\n\n const selectedSubCategories = useMemo<Category[]>(() => {\n if (TypeGuards.isUndefined(selected) || TypeGuards.isArray(selected)) return []\n\n return categories.find((category) => category.title === selected.value)?.children ?? []\n }, [selected, categories])\n\n return (\n <motion.div\n {...props}\n className={cn(\n 'absolute z-10 w-full max-w-[calc(636px-32px)]',\n 'absolute left-1/2 top-full bg-color-white p-4',\n '-translate-x-1/2 overflow-x-hidden',\n 'flex flex-col items-center justify-center gap-y-4'\n )}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n >\n <SelectBase label='Категория' options={selectCategories} value={selected} onChange={onCategoryChange} />\n <div className='flex w-full flex-col items-center justify-center gap-y-1'>\n {selectedSubCategories.map((subCategory) => {\n if (TypeGuards.isArrayEmpty(subCategory.children)) {\n return (\n <div key={subCategory.title} className='w-full px-4 py-2.5'>\n <a href={subCategory.link?.href} className='desk-body-regular-m inline-block w-full'>\n {subCategory.title}\n </a>\n </div>\n )\n }\n\n return <MenuItem key={subCategory.title} category={subCategory} />\n })}\n </div>\n <div className='h-[1px] w-full bg-color-blue-grey-200' />\n <div className='flex w-full flex-col items-center justify-center gap-y-1'>\n {helpers.map((helper) => (\n <div key={helper.title} className='w-full px-4 py-2.5'>\n <a href={helper.link?.href} className='flex w-full items-center gap-x-1'>\n {helper.link?.icon && <Icon name={helper.link.icon} className='size-4' />}\n {helper.title}\n </a>\n </div>\n ))}\n <div className='w-full px-4 py-2.5'>\n <a href={`tel:${phone}`} className='flex w-full items-center gap-x-1'>\n <Icon name='communication/phone' className='size-4' />\n {createPhoneNumber(phone)}\n </a>\n </div>\n </div>\n </motion.div>\n )\n}\n"],"names":["getSelectCategories","categories","category","Menu","helpers","phone","props","selectCategories","selected","setSelected","useState","onCategoryChange","option","TypeGuards","selectedSubCategories","useMemo","_a","jsxs","motion","cn","jsx","SelectBase","subCategory","MenuItem","helper","_b","Icon","createPhoneNumber"],"mappings":"y5EAaA,MAAMA,EAAuBC,GAC3BA,EAAW,IAAKC,IAAc,CAC5B,MAAOA,EAAS,OAAS,GACzB,MAAOA,EAAS,OAAS,EAC3B,EAAE,EAESC,GAAO,CAAC,CAAE,WAAAF,EAAY,QAAAG,EAAS,MAAAC,EAAO,GAAGC,KAAuB,CAC3E,MAAMC,EAAmBP,EAAoBC,CAAU,EAEjD,CAACO,EAAUC,CAAW,EAAIC,EAA4DH,EAAiB,CAAC,CAAC,EAEzGI,EAAoBC,GAAmD,CACvEC,EAAW,YAAYD,CAAM,GAAKC,EAAW,QAAQD,CAAM,GAE/DH,EAAYG,CAAM,CACpB,EAEME,EAAwBC,EAAoB,IAAM,OACtD,OAAIF,EAAW,YAAYL,CAAQ,GAAKK,EAAW,QAAQL,CAAQ,EAAU,CAAA,IAEtEQ,EAAAf,EAAW,KAAMC,GAAaA,EAAS,QAAUM,EAAS,KAAK,IAA/D,YAAAQ,EAAkE,WAAY,CAAA,CACvF,EAAG,CAACR,EAAUP,CAAU,CAAC,EAEzB,OACEgB,EAACC,EAAO,IAAP,CACE,GAAGZ,EACJ,UAAWa,EACT,gDACA,gDACA,qCACA,mDAAA,EAEF,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,CAAA,EAEpB,SAAA,CAAAC,EAACC,EAAA,CAAW,MAAM,YAAY,QAASd,EAAkB,MAAOC,EAAU,SAAUG,CAAA,CAAkB,IACrG,MAAA,CAAI,UAAU,2DACZ,SAAAG,EAAsB,IAAKQ,GAAgB,OAC1C,OAAIT,EAAW,aAAaS,EAAY,QAAQ,IAE3C,MAAA,CAA4B,UAAU,qBACrC,SAAAF,EAAC,KAAE,MAAMJ,EAAAM,EAAY,OAAZ,YAAAN,EAAkB,KAAM,UAAU,0CACxC,SAAAM,EAAY,MACf,CAAA,EAHQA,EAAY,KAItB,EAIGF,EAACG,EAAA,CAAiC,SAAUD,CAAA,EAA7BA,EAAY,KAA8B,CAClE,CAAC,CAAA,CACH,EACAF,EAAC,MAAA,CAAI,UAAU,uCAAA,CAAwC,EACvDH,EAAC,MAAA,CAAI,UAAU,2DACZ,SAAA,CAAAb,EAAQ,IAAKoB,GAAA,SACZ,OAAAJ,EAAC,OAAuB,UAAU,qBAChC,SAAAH,EAAC,IAAA,CAAE,MAAMD,EAAAQ,EAAO,OAAP,YAAAR,EAAa,KAAM,UAAU,mCACnC,SAAA,GAAAS,EAAAD,EAAO,OAAP,YAAAC,EAAa,OAAQL,EAACM,EAAA,CAAK,KAAMF,EAAO,KAAK,KAAM,UAAU,QAAA,CAAS,EACtEA,EAAO,KAAA,CAAA,CACV,CAAA,EAJQA,EAAO,KAKjB,EACD,EACDJ,EAAC,MAAA,CAAI,UAAU,qBACb,SAAAH,EAAC,IAAA,CAAE,KAAM,OAAOZ,CAAK,GAAI,UAAU,mCACjC,SAAA,CAAAe,EAACM,EAAA,CAAK,KAAK,sBAAsB,UAAU,SAAS,EACnDC,EAAkBtB,CAAK,CAAA,CAAA,CAC1B,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/MenuItem.tsx"],"sourcesContent":["import { type Category } from '../../../model'\nimport { Accordion, Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\ntype MenuItemProps = {\n category: Category\n}\n\nexport const MenuItem = ({ category }: MenuItemProps) => (\n <Accordion\n key={category.title}\n label={category.title ?? ''}\n icon={<Icon name='arrows/arrowRight' className='-rotate-90' />}\n classes={{\n root: 'w-full',\n header: {\n trigger: 'py-2 data-[open=false]:bg-color-white',\n label: 'desk-body-regular-m'\n },\n content: cn(\n 'relative',\n 'after:content-\"\" after:absolute after:w-[calc(100%-32px)]',\n 'after:bottom-0 after:left-1/2 after:-translate-x-1/2',\n 'after:h-[1px] after:bg-color-blue-grey-200'\n )\n }}\n >\n <div className='flex flex-col items-start justify-center gap-y-4'>\n {category.children.map((child) => {\n const isLink = Boolean(child.link)\n const Title = isLink ? 'a' : 'p'\n\n return (\n <ul key={child.title} className='w-full list-none p-0'>\n <Title\n href={isLink ? child.link?.href : undefined}\n className='mb-3 flex items-center gap-x-1 text-16 text-color-primary-default'\n >\n {child.title}\n <Icon name='arrows/arrowLink' />\n </Title>\n {child.children.map((innerChild) => (\n <li key={innerChild.title} className='inline-block w-full [&:not(:last-child)]:mb-3'>\n <a href={innerChild.link?.href} className='w-full'>\n {innerChild.title}\n </a>\n </li>\n ))}\n </ul>\n )\n })}\n </div>\n </Accordion>\n)\n"],"names":["MenuItem","category","jsx","Accordion","Icon","cn","child","isLink","jsxs","_a","innerChild"],"mappings":"mkEAQO,MAAMA,EAAW,CAAC,CAAE,SAAAC,CAAA,IACzBC,EAACC,EAAA,CAEC,MAAOF,EAAS,OAAS,GACzB,KAAMC,EAACE,EAAA,CAAK,KAAK,oBAAoB,UAAU,aAAa,EAC5D,QAAS,CACP,KAAM,SACN,OAAQ,CACN,QAAS,wCACT,MAAO,qBAAA,EAET,QAASC,EACP,WACA,4DACA,uDACA,4CAAA,CACF,EAGF,SAAAH,EAAC,OAAI,UAAU,mDACZ,WAAS,SAAS,IAAKI,GAAU,OAChC,MAAMC,EAAS,EAAQD,EAAM,KAG7B,OACEE,EAAC,KAAA,CAAqB,UAAU,uBAC9B,SAAA,CAAAA,EAJUD,EAAS,IAAM,IAIxB,CACC,KAAMA,GAASE,EAAAH,EAAM,OAAN,YAAAG,EAAY,KAAO,OAClC,UAAU,oEAET,SAAA,CAAAH,EAAM,MACPJ,EAACE,EAAA,CAAK,KAAK,kBAAA,CAAmB,CAAA,CAAA,CAAA,EAE/BE,EAAM,SAAS,IAAKI,UACnB,OAAAR,EAAC,KAAA,CAA0B,UAAU,gDACnC,SAAAA,EAAC,IAAA,CAAE,MAAMO,EAAAC,EAAW,OAAX,YAAAD,EAAiB,KAAM,UAAU,SACvC,WAAW,KAAA,CACd,GAHOC,EAAW,KAIpB,EACD,CAAA,CAAA,EAdMJ,EAAM,KAef,
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/MenuItem.tsx"],"sourcesContent":["import { type Category } from '../../../model'\nimport { Accordion, Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\ntype MenuItemProps = {\n category: Category\n}\n\nexport const MenuItem = ({ category }: MenuItemProps) => (\n <Accordion\n key={category.title}\n label={category.title ?? ''}\n icon={<Icon name='arrows/arrowRight' className='-rotate-90' />}\n classes={{\n root: 'w-full',\n header: {\n trigger: 'py-2 data-[open=false]:bg-color-white',\n label: 'desk-body-regular-m'\n },\n content: cn(\n 'relative',\n 'after:content-\"\" after:absolute after:w-[calc(100%-32px)]',\n 'after:bottom-0 after:left-1/2 after:-translate-x-1/2',\n 'after:h-[1px] after:bg-color-blue-grey-200'\n )\n }}\n >\n <div className='flex flex-col items-start justify-center gap-y-4'>\n {category.children.map((child) => {\n const isLink = Boolean(child.link)\n const Title = isLink ? 'a' : 'p'\n\n return (\n <ul key={child.title} className='w-full list-none p-0'>\n <Title\n href={isLink ? child.link?.href : undefined}\n className='mb-3 flex items-center gap-x-1 text-16 text-color-primary-default'\n >\n {child.title}\n <Icon name='arrows/arrowLink' />\n </Title>\n {child.children.map((innerChild) => (\n <li key={innerChild.title} className='inline-block w-full [&:not(:last-child)]:mb-3'>\n <a href={innerChild.link?.href} className='w-full'>\n {innerChild.title}\n </a>\n </li>\n ))}\n </ul>\n )\n })}\n </div>\n </Accordion>\n)\n"],"names":["MenuItem","category","jsx","Accordion","Icon","cn","child","isLink","jsxs","_a","innerChild"],"mappings":"mkEAQO,MAAMA,EAAW,CAAC,CAAE,SAAAC,CAAA,IACzBC,EAACC,EAAA,CAEC,MAAOF,EAAS,OAAS,GACzB,KAAMC,EAACE,EAAA,CAAK,KAAK,oBAAoB,UAAU,aAAa,EAC5D,QAAS,CACP,KAAM,SACN,OAAQ,CACN,QAAS,wCACT,MAAO,qBAAA,EAET,QAASC,EACP,WACA,4DACA,uDACA,4CAAA,CACF,EAGF,SAAAH,EAAC,OAAI,UAAU,mDACZ,WAAS,SAAS,IAAKI,GAAU,OAChC,MAAMC,EAAS,EAAQD,EAAM,KAG7B,OACEE,EAAC,KAAA,CAAqB,UAAU,uBAC9B,SAAA,CAAAA,EAJUD,EAAS,IAAM,IAIxB,CACC,KAAMA,GAASE,EAAAH,EAAM,OAAN,YAAAG,EAAY,KAAO,OAClC,UAAU,oEAET,SAAA,CAAAH,EAAM,MACPJ,EAACE,EAAA,CAAK,KAAK,kBAAA,CAAmB,CAAA,CAAA,CAAA,EAE/BE,EAAM,SAAS,IAAKI,UACnB,OAAAR,EAAC,KAAA,CAA0B,UAAU,gDACnC,SAAAA,EAAC,IAAA,CAAE,MAAMO,EAAAC,EAAW,OAAX,YAAAD,EAAiB,KAAM,UAAU,SACvC,WAAW,KAAA,CACd,GAHOC,EAAW,KAIpB,EACD,CAAA,CAAA,EAdMJ,EAAM,KAef,CAEJ,CAAC,CAAA,CACH,CAAA,EAzCKL,EAAS,KA0ChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRating.js","sources":["../../../../../../lib/widgets/userFeedback/model/hooks/useRating.ts"],"sourcesContent":["import { useState } from 'react'\nimport type { FormStepSetter } from '../types'\n\nexport type UseRatingReturn = {\n selectedRating: number\n hoveredRatings: number\n handleMouseEnter: (index: number) => void\n handleMouseLeave: () => void\n handleSelectRating: (index: number) => void\n}\n\nexport const useRating = (setFormStep: FormStepSetter): UseRatingReturn => {\n const [selectedRating, setSelectedRating] = useState(0)\n const [hoveredRatings, setHoveredRatings] = useState(0)\n\n const handleMouseEnter = (index: number) => {\n setHoveredRatings(index)\n }\n\n const handleMouseLeave = () => {\n setHoveredRatings(selectedRating)\n }\n\n const handleSelectRating = (index: number) => {\n setSelectedRating(index)\n setFormStep('review')\n }\n\n return {\n selectedRating,\n hoveredRatings,\n handleMouseEnter,\n handleMouseLeave,\n handleSelectRating\n }\n}\n"],"names":["useRating","setFormStep","selectedRating","setSelectedRating","useState","hoveredRatings","setHoveredRatings","index"],"mappings":"iCAWO,MAAMA,EAAaC,GAAiD,CACzE,KAAM,CAACC,EAAgBC,CAAiB,EAAIC,EAAS,CAAC,EAChD,CAACC,EAAgBC,CAAiB,EAAIF,EAAS,CAAC,EAetD,MAAO,CACL,eAAAF,EACA,eAAAG,EACA,iBAhBwBE,GAAkB,CAC1CD,EAAkBC,CAAK,
|
|
1
|
+
{"version":3,"file":"useRating.js","sources":["../../../../../../lib/widgets/userFeedback/model/hooks/useRating.ts"],"sourcesContent":["import { useState } from 'react'\nimport type { FormStepSetter } from '../types'\n\nexport type UseRatingReturn = {\n selectedRating: number\n hoveredRatings: number\n handleMouseEnter: (index: number) => void\n handleMouseLeave: () => void\n handleSelectRating: (index: number) => void\n}\n\nexport const useRating = (setFormStep: FormStepSetter): UseRatingReturn => {\n const [selectedRating, setSelectedRating] = useState(0)\n const [hoveredRatings, setHoveredRatings] = useState(0)\n\n const handleMouseEnter = (index: number) => {\n setHoveredRatings(index)\n }\n\n const handleMouseLeave = () => {\n setHoveredRatings(selectedRating)\n }\n\n const handleSelectRating = (index: number) => {\n setSelectedRating(index)\n setFormStep('review')\n }\n\n return {\n selectedRating,\n hoveredRatings,\n handleMouseEnter,\n handleMouseLeave,\n handleSelectRating\n }\n}\n"],"names":["useRating","setFormStep","selectedRating","setSelectedRating","useState","hoveredRatings","setHoveredRatings","index"],"mappings":"iCAWO,MAAMA,EAAaC,GAAiD,CACzE,KAAM,CAACC,EAAgBC,CAAiB,EAAIC,EAAS,CAAC,EAChD,CAACC,EAAgBC,CAAiB,EAAIF,EAAS,CAAC,EAetD,MAAO,CACL,eAAAF,EACA,eAAAG,EACA,iBAhBwBE,GAAkB,CAC1CD,EAAkBC,CAAK,CACzB,EAeE,iBAbuB,IAAM,CAC7BD,EAAkBJ,CAAc,CAClC,EAYE,mBAV0BK,GAAkB,CAC5CJ,EAAkBI,CAAK,EACvBN,EAAY,QAAQ,CACtB,CAOE,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackTrigger.js","sources":["../../../../../lib/widgets/userFeedback/ui/FeedbackTrigger.tsx"],"sourcesContent":["import { memo, useEffect, useState } from 'react'\nimport { useObserverWidgets } from '$/shared/hooks'\nimport { Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\nexport const FeedbackTrigger = memo(() => {\n const isObserved = useObserverWidgets({ ids: ['banner'] })\n const [isVisible, setIsVisible] = useState(false)\n\n useEffect(() => {\n setIsVisible(false)\n const timer = setTimeout(() => {\n setIsVisible(true)\n }, 10000)\n\n return () => clearTimeout(timer)\n }, [])\n\n return (\n <div\n className={cn(\n 'invisible flex size-16 items-center justify-center rounded-full bg-color-secondary-default opacity-0 transition-all hover:bg-color-secondary-hover',\n { 'opacity-1 visible': isVisible && !isObserved }\n )}\n >\n <Icon name='general/heart' className='size-7 fill-transparent stroke-white stroke-[3px]' />\n </div>\n )\n})\n"],"names":["FeedbackTrigger","memo","isObserved","useObserverWidgets","isVisible","setIsVisible","useState","useEffect","timer","jsx","cn","Icon"],"mappings":"0/DAKO,MAAMA,EAAkBC,EAAK,IAAM,CACxC,MAAMC,EAAaC,EAAmB,CAAE,IAAK,CAAC,QAAQ,EAAG,EACnD,CAACC,EAAWC,CAAY,EAAIC,EAAS,EAAK,EAEhD,OAAAC,EAAU,IAAM,CACdF,EAAa,EAAK,EAClB,MAAMG,EAAQ,WAAW,IAAM,CAC7BH,EAAa,EAAI,
|
|
1
|
+
{"version":3,"file":"FeedbackTrigger.js","sources":["../../../../../lib/widgets/userFeedback/ui/FeedbackTrigger.tsx"],"sourcesContent":["import { memo, useEffect, useState } from 'react'\nimport { useObserverWidgets } from '$/shared/hooks'\nimport { Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\nexport const FeedbackTrigger = memo(() => {\n const isObserved = useObserverWidgets({ ids: ['banner'] })\n const [isVisible, setIsVisible] = useState(false)\n\n useEffect(() => {\n setIsVisible(false)\n const timer = setTimeout(() => {\n setIsVisible(true)\n }, 10000)\n\n return () => clearTimeout(timer)\n }, [])\n\n return (\n <div\n className={cn(\n 'invisible flex size-16 items-center justify-center rounded-full bg-color-secondary-default opacity-0 transition-all hover:bg-color-secondary-hover',\n { 'opacity-1 visible': isVisible && !isObserved }\n )}\n >\n <Icon name='general/heart' className='size-7 fill-transparent stroke-white stroke-[3px]' />\n </div>\n )\n})\n"],"names":["FeedbackTrigger","memo","isObserved","useObserverWidgets","isVisible","setIsVisible","useState","useEffect","timer","jsx","cn","Icon"],"mappings":"0/DAKO,MAAMA,EAAkBC,EAAK,IAAM,CACxC,MAAMC,EAAaC,EAAmB,CAAE,IAAK,CAAC,QAAQ,EAAG,EACnD,CAACC,EAAWC,CAAY,EAAIC,EAAS,EAAK,EAEhD,OAAAC,EAAU,IAAM,CACdF,EAAa,EAAK,EAClB,MAAMG,EAAQ,WAAW,IAAM,CAC7BH,EAAa,EAAI,CACnB,EAAG,GAAK,EAER,MAAO,IAAM,aAAaG,CAAK,CACjC,EAAG,CAAA,CAAE,EAGHC,EAAC,MAAA,CACC,UAAWC,EACT,qJACA,CAAE,oBAAqBN,GAAa,CAACF,CAAA,CAAW,EAGlD,SAAAO,EAACE,EAAA,CAAK,KAAK,gBAAgB,UAAU,mDAAA,CAAoD,CAAA,CAAA,CAG/F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserReview.js","sources":["../../../../../lib/widgets/userFeedback/ui/UserReview.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { type FormStepSetter, type SubmitCallback, type UserReviewSchema, userReviewSchema } from '../model'\nimport { useControlledForm } from '$/shared/hooks'\nimport { Button, TextareaControl, type TextareaControlProps } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\nimport { ZodUtils } from '$/shared/validation'\n\nconst defaultTitle = 'Расскажите о впечатлениях'\nconst defaultSubtitle = (\n <>\n Вам нравится сайт банка? <br /> У вас есть предложения по его улучшению?\n </>\n)\n\nexport type UserReviewClasses = {\n form?: string\n textBlock?: string\n title?: string\n subtitle?: string\n textareaClasses?: TextareaControlProps['classes']\n button?: string\n}\n\nexport interface UserReviewProps {\n submitCallback: SubmitCallback\n setFormStep: FormStepSetter\n rating: number\n title?: string\n subtitle?: ReactNode\n classes?: UserReviewClasses\n}\n\nexport const UserReview = ({\n submitCallback,\n rating,\n setFormStep,\n title = defaultTitle,\n subtitle = defaultSubtitle,\n classes\n}: UserReviewProps) => {\n const { control, handleSubmit } = useControlledForm({\n mode: 'onBlur',\n schema: userReviewSchema,\n defaultValues: ZodUtils.getZodDefaults(userReviewSchema)\n })\n\n const onSubmit = async (values: UserReviewSchema) => {\n if (submitCallback) {\n await submitCallback({\n rating,\n pageUrl: window?.location?.href,\n ...values\n })\n setFormStep('finally')\n }\n }\n\n return (\n <form onSubmit={handleSubmit(onSubmit)} className={cn('flex flex-col gap-4', classes?.form)}>\n <div className={cn('flex flex-col gap-2 text-center', classes?.textBlock)}>\n <p className={cn('desk-body-medium-l', classes?.title)}>{title}</p>\n <p className={cn('desk-body-regular-l', classes?.subtitle)}>{subtitle}</p>\n </div>\n <TextareaControl control={control} name='review' label='Поделитесь вашим мнением' classes={classes?.textareaClasses} />\n <Button type='submit' size='sm' intent='negative' className={cn('w-full', classes?.button)}>\n Отправить\n </Button>\n </form>\n )\n}\n"],"names":["defaultTitle","defaultSubtitle","jsxs","Fragment","UserReview","submitCallback","rating","setFormStep","title","subtitle","classes","control","handleSubmit","useControlledForm","userReviewSchema","ZodUtils","values","_a","cn","jsx","TextareaControl","Button"],"mappings":"03EAOA,MAAMA,EAAe,4BACfC,EACJC,EAAAC,EAAA,CAAE,SAAA,CAAA,8BAC0B,KAAA,EAAG,EAAE,2CAAA,EACjC,EAqBWC,GAAa,CAAC,CACzB,eAAAC,EACA,OAAAC,EACA,YAAAC,EACA,MAAAC,EAAQR,EACR,SAAAS,EAAWR,EACX,QAAAS,CACF,IAAuB,CACrB,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAA,EAAiBC,EAAkB,CAClD,KAAM,SACN,OAAQC,EACR,cAAeC,EAAS,eAAeD,CAAgB,CAAA,CACxD,EAaD,OACEZ,EAAC,OAAA,CAAK,SAAUU,EAZD,MAAOI,GAA6B,OAC/CX,IACF,MAAMA,EAAe,CACnB,OAAAC,EACA,SAASW,EAAA,2BAAQ,WAAR,YAAAA,EAAkB,KAC3B,GAAGD,CAAA,CACJ,EACDT,EAAY,SAAS,
|
|
1
|
+
{"version":3,"file":"UserReview.js","sources":["../../../../../lib/widgets/userFeedback/ui/UserReview.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { type FormStepSetter, type SubmitCallback, type UserReviewSchema, userReviewSchema } from '../model'\nimport { useControlledForm } from '$/shared/hooks'\nimport { Button, TextareaControl, type TextareaControlProps } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\nimport { ZodUtils } from '$/shared/validation'\n\nconst defaultTitle = 'Расскажите о впечатлениях'\nconst defaultSubtitle = (\n <>\n Вам нравится сайт банка? <br /> У вас есть предложения по его улучшению?\n </>\n)\n\nexport type UserReviewClasses = {\n form?: string\n textBlock?: string\n title?: string\n subtitle?: string\n textareaClasses?: TextareaControlProps['classes']\n button?: string\n}\n\nexport interface UserReviewProps {\n submitCallback: SubmitCallback\n setFormStep: FormStepSetter\n rating: number\n title?: string\n subtitle?: ReactNode\n classes?: UserReviewClasses\n}\n\nexport const UserReview = ({\n submitCallback,\n rating,\n setFormStep,\n title = defaultTitle,\n subtitle = defaultSubtitle,\n classes\n}: UserReviewProps) => {\n const { control, handleSubmit } = useControlledForm({\n mode: 'onBlur',\n schema: userReviewSchema,\n defaultValues: ZodUtils.getZodDefaults(userReviewSchema)\n })\n\n const onSubmit = async (values: UserReviewSchema) => {\n if (submitCallback) {\n await submitCallback({\n rating,\n pageUrl: window?.location?.href,\n ...values\n })\n setFormStep('finally')\n }\n }\n\n return (\n <form onSubmit={handleSubmit(onSubmit)} className={cn('flex flex-col gap-4', classes?.form)}>\n <div className={cn('flex flex-col gap-2 text-center', classes?.textBlock)}>\n <p className={cn('desk-body-medium-l', classes?.title)}>{title}</p>\n <p className={cn('desk-body-regular-l', classes?.subtitle)}>{subtitle}</p>\n </div>\n <TextareaControl control={control} name='review' label='Поделитесь вашим мнением' classes={classes?.textareaClasses} />\n <Button type='submit' size='sm' intent='negative' className={cn('w-full', classes?.button)}>\n Отправить\n </Button>\n </form>\n )\n}\n"],"names":["defaultTitle","defaultSubtitle","jsxs","Fragment","UserReview","submitCallback","rating","setFormStep","title","subtitle","classes","control","handleSubmit","useControlledForm","userReviewSchema","ZodUtils","values","_a","cn","jsx","TextareaControl","Button"],"mappings":"03EAOA,MAAMA,EAAe,4BACfC,EACJC,EAAAC,EAAA,CAAE,SAAA,CAAA,8BAC0B,KAAA,EAAG,EAAE,2CAAA,EACjC,EAqBWC,GAAa,CAAC,CACzB,eAAAC,EACA,OAAAC,EACA,YAAAC,EACA,MAAAC,EAAQR,EACR,SAAAS,EAAWR,EACX,QAAAS,CACF,IAAuB,CACrB,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAA,EAAiBC,EAAkB,CAClD,KAAM,SACN,OAAQC,EACR,cAAeC,EAAS,eAAeD,CAAgB,CAAA,CACxD,EAaD,OACEZ,EAAC,OAAA,CAAK,SAAUU,EAZD,MAAOI,GAA6B,OAC/CX,IACF,MAAMA,EAAe,CACnB,OAAAC,EACA,SAASW,EAAA,2BAAQ,WAAR,YAAAA,EAAkB,KAC3B,GAAGD,CAAA,CACJ,EACDT,EAAY,SAAS,EAEzB,CAGuC,EAAG,UAAWW,EAAG,sBAAuBR,GAAA,YAAAA,EAAS,IAAI,EACxF,SAAA,CAAAR,EAAC,OAAI,UAAWgB,EAAG,kCAAmCR,GAAA,YAAAA,EAAS,SAAS,EACtE,SAAA,CAAAS,EAAC,KAAE,UAAWD,EAAG,qBAAsBR,GAAA,YAAAA,EAAS,KAAK,EAAI,SAAAF,EAAM,EAC/DW,EAAC,KAAE,UAAWD,EAAG,sBAAuBR,GAAA,YAAAA,EAAS,QAAQ,EAAI,SAAAD,CAAA,CAAS,CAAA,EACxE,EACAU,EAACC,GAAgB,QAAAT,EAAkB,KAAK,SAAS,MAAM,2BAA2B,QAASD,GAAA,YAAAA,EAAS,eAAA,CAAiB,EACrHS,EAACE,EAAA,CAAO,KAAK,SAAS,KAAK,KAAK,OAAO,WAAW,UAAWH,EAAG,SAAUR,GAAA,YAAAA,EAAS,MAAM,EAAG,SAAA,WAAA,CAE5F,CAAA,EACF,CAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extends.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":["_extends","n","e","t"],"mappings":"AAAA,SAASA,GAAW,CAClB,OAAOA,EAAW,OAAO,OAAS,OAAO,OAAO,KAAI,EAAK,SAAUC,EAAG,CACpE,QAASC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CACzC,IAAIC,EAAI,UAAUD,CAAC,EACnB,QAAS,KAAKC,GAAI,CAAA,GAAI,eAAe,KAAKA,EAAG,CAAC,IAAMF,EAAE,CAAC,EAAIE,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"extends.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":["_extends","n","e","t"],"mappings":"AAAA,SAASA,GAAW,CAClB,OAAOA,EAAW,OAAO,OAAS,OAAO,OAAO,KAAI,EAAK,SAAUC,EAAG,CACpE,QAASC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CACzC,IAAIC,EAAI,UAAUD,CAAC,EACnB,QAAS,KAAKC,GAAI,CAAA,GAAI,eAAe,KAAKA,EAAG,CAAC,IAAMF,EAAE,CAAC,EAAIE,EAAE,CAAC,EAChE,CACA,OAAOF,CACT,EAAGD,EAAS,MAAM,KAAM,SAAS,CACnC","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterableToArrayLimit.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"],"sourcesContent":["function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };"],"names":["_iterableToArrayLimit","r","l","e","n","i","u","a","f"],"mappings":"AAAA,SAASA,EAAsBC,EAAGC,EAAG,CACnC,IAAI,EAAYD,GAAR,KAAY,KAAsB,OAAO,OAAtB,KAAgCA,EAAE,OAAO,QAAQ,GAAKA,EAAE,YAAY,EAC/F,GAAY,GAAR,KAAW,CACb,IAAIE,EACFC,EACAC,EACAC,EACAC,EAAI,CAAA,EACJC,EAAI,GACJ,EAAI,GACN,GAAI,CACF,GAAIH,GAAK,EAAI,EAAE,KAAKJ,CAAC,GAAG,KAAYC,IAAN,EAAS,CACrC,GAAI,OAAO,CAAC,IAAM,EAAG,OACrBM,EAAI,
|
|
1
|
+
{"version":3,"file":"iterableToArrayLimit.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js"],"sourcesContent":["function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };"],"names":["_iterableToArrayLimit","r","l","e","n","i","u","a","f"],"mappings":"AAAA,SAASA,EAAsBC,EAAGC,EAAG,CACnC,IAAI,EAAYD,GAAR,KAAY,KAAsB,OAAO,OAAtB,KAAgCA,EAAE,OAAO,QAAQ,GAAKA,EAAE,YAAY,EAC/F,GAAY,GAAR,KAAW,CACb,IAAIE,EACFC,EACAC,EACAC,EACAC,EAAI,CAAA,EACJC,EAAI,GACJ,EAAI,GACN,GAAI,CACF,GAAIH,GAAK,EAAI,EAAE,KAAKJ,CAAC,GAAG,KAAYC,IAAN,EAAS,CACrC,GAAI,OAAO,CAAC,IAAM,EAAG,OACrBM,EAAI,EACN,KAAO,MAAO,EAAEA,GAAKL,EAAIE,EAAE,KAAK,CAAC,GAAG,QAAUE,EAAE,KAAKJ,EAAE,KAAK,EAAGI,EAAE,SAAWL,GAAIM,EAAI,GAAG,CACzF,OAASP,EAAG,CACV,EAAI,GAAIG,EAAIH,CACd,QAAC,CACC,GAAI,CACF,GAAI,CAACO,GAAa,EAAE,QAAV,OAAwBF,EAAI,EAAE,OAAS,EAAI,OAAOA,CAAC,IAAMA,GAAI,MACzE,QAAC,CACC,GAAI,EAAG,MAAMF,CACf,CACF,CACA,OAAOG,CACT,CACF","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectSpread2.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js"],"sourcesContent":["import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nexport { _objectSpread2 as default };"],"names":["ownKeys","e","r","t","o","_objectSpread2","defineProperty"],"mappings":"mCACA,SAASA,EAAQC,EAAGC,EAAG,CACrB,IAAIC,EAAI,OAAO,KAAKF,CAAC,EACrB,GAAI,OAAO,sBAAuB,CAChC,IAAIG,EAAI,OAAO,sBAAsBH,CAAC,EACtCC,IAAME,EAAIA,EAAE,OAAO,SAAUF,EAAG,CAC9B,OAAO,OAAO,yBAAyBD,EAAGC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"objectSpread2.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js"],"sourcesContent":["import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nexport { _objectSpread2 as default };"],"names":["ownKeys","e","r","t","o","_objectSpread2","defineProperty"],"mappings":"mCACA,SAASA,EAAQC,EAAGC,EAAG,CACrB,IAAIC,EAAI,OAAO,KAAKF,CAAC,EACrB,GAAI,OAAO,sBAAuB,CAChC,IAAIG,EAAI,OAAO,sBAAsBH,CAAC,EACtCC,IAAME,EAAIA,EAAE,OAAO,SAAUF,EAAG,CAC9B,OAAO,OAAO,yBAAyBD,EAAGC,CAAC,EAAE,UAC/C,CAAC,GAAIC,EAAE,KAAK,MAAMA,EAAGC,CAAC,CACxB,CACA,OAAOD,CACT,CACA,SAASE,EAAeJ,EAAG,CACzB,QAASC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CACzC,IAAIC,EAAY,UAAUD,CAAC,GAAnB,KAAuB,UAAUA,CAAC,EAAI,CAAA,EAC9CA,EAAI,EAAIF,EAAQ,OAAOG,CAAC,EAAG,EAAE,EAAE,QAAQ,SAAUD,EAAG,CAClDI,EAAeL,EAAGC,EAAGC,EAAED,CAAC,CAAC,CAC3B,CAAC,EAAI,OAAO,0BAA4B,OAAO,iBAAiBD,EAAG,OAAO,0BAA0BE,CAAC,CAAC,EAAIH,EAAQ,OAAOG,CAAC,CAAC,EAAE,QAAQ,SAAUD,EAAG,CAChJ,OAAO,eAAeD,EAAGC,EAAG,OAAO,yBAAyBC,EAAGD,CAAC,CAAC,CACnE,CAAC,CACH,CACA,OAAOD,CACT","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectWithoutProperties.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"],"sourcesContent":["import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = objectWithoutPropertiesLoose(e, t);\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\nexport { _objectWithoutProperties as default };"],"names":["_objectWithoutProperties","e","t","o","r","objectWithoutPropertiesLoose","n"],"mappings":"iDACA,SAASA,EAAyBC,EAAGC,EAAG,CACtC,GAAYD,GAAR,KAAW,MAAO,CAAA,EACtB,IAAIE,EACFC,EACA,EAAIC,EAA6BJ,EAAGC,CAAC,EACvC,GAAI,OAAO,sBAAuB,CAChC,IAAII,EAAI,OAAO,sBAAsBL,CAAC,EACtC,IAAKG,EAAI,EAAGA,EAAIE,EAAE,OAAQF,IAAKD,EAAIG,EAAEF,CAAC,EAAUF,EAAE,QAAQC,CAAC,IAAlB,IAAuB,CAAA,EAAG,qBAAqB,KAAKF,EAAGE,CAAC,IAAM,EAAEA,CAAC,EAAIF,EAAEE,CAAC,
|
|
1
|
+
{"version":3,"file":"objectWithoutProperties.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js"],"sourcesContent":["import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = objectWithoutPropertiesLoose(e, t);\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\nexport { _objectWithoutProperties as default };"],"names":["_objectWithoutProperties","e","t","o","r","objectWithoutPropertiesLoose","n"],"mappings":"iDACA,SAASA,EAAyBC,EAAGC,EAAG,CACtC,GAAYD,GAAR,KAAW,MAAO,CAAA,EACtB,IAAIE,EACFC,EACA,EAAIC,EAA6BJ,EAAGC,CAAC,EACvC,GAAI,OAAO,sBAAuB,CAChC,IAAII,EAAI,OAAO,sBAAsBL,CAAC,EACtC,IAAKG,EAAI,EAAGA,EAAIE,EAAE,OAAQF,IAAKD,EAAIG,EAAEF,CAAC,EAAUF,EAAE,QAAQC,CAAC,IAAlB,IAAuB,CAAA,EAAG,qBAAqB,KAAKF,EAAGE,CAAC,IAAM,EAAEA,CAAC,EAAIF,EAAEE,CAAC,EACnH,CACA,OAAO,CACT","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectWithoutPropertiesLoose.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n"],"mappings":"AAAA,SAASA,EAA8BC,EAAGC,EAAG,CAC3C,GAAYD,GAAR,KAAW,MAAO,CAAA,EACtB,IAAIE,EAAI,CAAA,EACR,QAASC,KAAKH,EAAG,GAAI,CAAA,EAAG,eAAe,KAAKA,EAAGG,CAAC,EAAG,CACjD,GAAWF,EAAE,QAAQE,CAAC,IAAlB,GAAqB,SACzBD,EAAEC,CAAC,EAAIH,EAAEG,CAAC,
|
|
1
|
+
{"version":3,"file":"objectWithoutPropertiesLoose.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":["_objectWithoutPropertiesLoose","r","e","t","n"],"mappings":"AAAA,SAASA,EAA8BC,EAAGC,EAAG,CAC3C,GAAYD,GAAR,KAAW,MAAO,CAAA,EACtB,IAAIE,EAAI,CAAA,EACR,QAASC,KAAKH,EAAG,GAAI,CAAA,EAAG,eAAe,KAAKA,EAAGG,CAAC,EAAG,CACjD,GAAWF,EAAE,QAAQE,CAAC,IAAlB,GAAqB,SACzBD,EAAEC,CAAC,EAAIH,EAAEG,CAAC,CACZ,CACA,OAAOD,CACT","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPrimitive.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"],"sourcesContent":["import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };"],"names":["toPrimitive","t","r","_typeof","i"],"mappings":"2BACA,SAASA,EAAYC,EAAGC,EAAG,CACzB,GAAgBC,EAAQF,CAAC,GAArB,UAA0B,CAACA,EAAG,OAAOA,EACzC,IAAI,EAAIA,EAAE,OAAO,WAAW,EAC5B,GAAe,IAAX,OAAc,CAChB,IAAIG,EAAI,EAAE,KAAKH,EAAGC,CAAc,EAChC,GAAgBC,EAAQC,CAAC,GAArB,SAAwB,OAAOA,EACnC,MAAM,IAAI,UAAU,8CAA8C,
|
|
1
|
+
{"version":3,"file":"toPrimitive.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"],"sourcesContent":["import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };"],"names":["toPrimitive","t","r","_typeof","i"],"mappings":"2BACA,SAASA,EAAYC,EAAGC,EAAG,CACzB,GAAgBC,EAAQF,CAAC,GAArB,UAA0B,CAACA,EAAG,OAAOA,EACzC,IAAI,EAAIA,EAAE,OAAO,WAAW,EAC5B,GAAe,IAAX,OAAc,CAChB,IAAIG,EAAI,EAAE,KAAKH,EAAGC,CAAc,EAChC,GAAgBC,EAAQC,CAAC,GAArB,SAAwB,OAAOA,EACnC,MAAM,IAAI,UAAU,8CAA8C,CACpE,CACA,OAAqBF,IAAb,SAAiB,OAAS,QAAQD,CAAC,CAC7C","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeof.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/typeof.js"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };"],"names":["_typeof","o"],"mappings":"AAAA,SAASA,EAAQC,EAAG,CAClB,0BAEA,OAAOD,EAAwB,OAAO,QAArB,YAA2C,OAAO,OAAO,UAA1B,SAAqC,SAAUC,EAAG,CAChG,OAAO,OAAOA,
|
|
1
|
+
{"version":3,"file":"typeof.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/typeof.js"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };"],"names":["_typeof","o"],"mappings":"AAAA,SAASA,EAAQC,EAAG,CAClB,0BAEA,OAAOD,EAAwB,OAAO,QAArB,YAA2C,OAAO,OAAO,UAA1B,SAAqC,SAAUC,EAAG,CAChG,OAAO,OAAOA,CAChB,EAAI,SAAUA,EAAG,CACf,OAAOA,GAAmB,OAAO,QAArB,YAA+BA,EAAE,cAAgB,QAAUA,IAAM,OAAO,UAAY,SAAW,OAAOA,CACpH,EAAGD,EAAQC,CAAC,CACd","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unsupportedIterableToArray.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"],"sourcesContent":["import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };"],"names":["_unsupportedIterableToArray","a","arrayLikeToArray"],"mappings":"qCACA,SAASA,EAA4B,EAAGC,EAAG,CACzC,GAAI,EAAG,CACL,GAAgB,OAAO,GAAnB,SAAsB,OAAOC,EAAiB,EAAGD,CAAC,EACtD,IAAI,EAAI,CAAA,EAAG,SAAS,KAAK,CAAC,EAAE,MAAM,EAAG,EAAE,EACvC,OAAoB,IAAb,UAAkB,EAAE,cAAgB,EAAI,EAAE,YAAY,MAAiB,IAAV,OAAyB,IAAV,MAAc,MAAM,KAAK,CAAC,EAAoB,IAAhB,aAAqB,2CAA2C,KAAK,CAAC,EAAIC,EAAiB,EAAGD,CAAC,EAAI,
|
|
1
|
+
{"version":3,"file":"unsupportedIterableToArray.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"],"sourcesContent":["import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };"],"names":["_unsupportedIterableToArray","a","arrayLikeToArray"],"mappings":"qCACA,SAASA,EAA4B,EAAGC,EAAG,CACzC,GAAI,EAAG,CACL,GAAgB,OAAO,GAAnB,SAAsB,OAAOC,EAAiB,EAAGD,CAAC,EACtD,IAAI,EAAI,CAAA,EAAG,SAAS,KAAK,CAAC,EAAE,MAAM,EAAG,EAAE,EACvC,OAAoB,IAAb,UAAkB,EAAE,cAAgB,EAAI,EAAE,YAAY,MAAiB,IAAV,OAAyB,IAAV,MAAc,MAAM,KAAK,CAAC,EAAoB,IAAhB,aAAqB,2CAA2C,KAAK,CAAC,EAAIC,EAAiB,EAAGD,CAAC,EAAI,MACtN,CACF","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@date-fns/tz/date/index.js"],"sourcesContent":["import { TZDateMini } from \"./mini.js\";\n\n/**\n * UTC date class. It maps getters and setters to corresponding UTC methods,\n * forcing all calculations in the UTC time zone.\n *\n * Combined with date-fns, it allows using the class the same way as\n * the original date class.\n *\n * This complete version provides not only getters, setters,\n * and `getTimezoneOffset`, but also the formatter functions, mirroring\n * all original `Date` functionality. Use this version when you need to format\n * a string or in an environment you don't fully control (a library).\n * For a minimal version, see `UTCDateMini`.\n */\nexport class TZDate extends TZDateMini {\n //#region static\n\n static tz(tz, ...args) {\n return args.length ? new TZDate(...args, tz) : new TZDate(Date.now(), tz);\n }\n\n //#endregion\n\n //#region representation\n\n toISOString() {\n const [sign, hours, minutes] = this.tzComponents();\n const tz = `${sign}${hours}:${minutes}`;\n return this.internal.toISOString().slice(0, -1) + tz;\n }\n toString() {\n // \"Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)\";\n return `${this.toDateString()} ${this.toTimeString()}`;\n }\n toDateString() {\n // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n const [day, date, month, year] = this.internal.toUTCString().split(\" \");\n // \"Tue Aug 13 2024\"\n return `${day?.slice(0, -1) /* Remove \",\" */} ${month} ${date} ${year}`;\n }\n toTimeString() {\n // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n const time = this.internal.toUTCString().split(\" \")[4];\n const [sign, hours, minutes] = this.tzComponents();\n // \"07:42:23 GMT+0800 (Singapore Standard Time)\"\n return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;\n }\n toLocaleString(locales, options) {\n return Date.prototype.toLocaleString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n toLocaleDateString(locales, options) {\n return Date.prototype.toLocaleDateString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n toLocaleTimeString(locales, options) {\n return Date.prototype.toLocaleTimeString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n\n //#endregion\n\n //#region private\n\n tzComponents() {\n const offset = this.getTimezoneOffset();\n const sign = offset > 0 ? \"-\" : \"+\";\n const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, \"0\");\n const minutes = String(Math.abs(offset) % 60).padStart(2, \"0\");\n return [sign, hours, minutes];\n }\n\n //#endregion\n\n withTimeZone(timeZone) {\n return new TZDate(+this, timeZone);\n }\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDate(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\nfunction tzName(tz, date) {\n return new Intl.DateTimeFormat(\"en-GB\", {\n timeZone: tz,\n timeZoneName: \"long\"\n }).format(date).slice(12);\n}"],"names":["TZDate","TZDateMini","tz","args","sign","hours","minutes","day","date","month","year","time","tzName","locales","options","offset","timeZone"],"mappings":"uCAeO,MAAMA,UAAeC,CAAW,CAGrC,OAAO,GAAGC,KAAOC,EAAM,CACrB,OAAOA,EAAK,OAAS,IAAIH,EAAO,GAAGG,EAAMD,CAAE,EAAI,IAAIF,EAAO,KAAK,IAAG,EAAIE,CAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@date-fns/tz/date/index.js"],"sourcesContent":["import { TZDateMini } from \"./mini.js\";\n\n/**\n * UTC date class. It maps getters and setters to corresponding UTC methods,\n * forcing all calculations in the UTC time zone.\n *\n * Combined with date-fns, it allows using the class the same way as\n * the original date class.\n *\n * This complete version provides not only getters, setters,\n * and `getTimezoneOffset`, but also the formatter functions, mirroring\n * all original `Date` functionality. Use this version when you need to format\n * a string or in an environment you don't fully control (a library).\n * For a minimal version, see `UTCDateMini`.\n */\nexport class TZDate extends TZDateMini {\n //#region static\n\n static tz(tz, ...args) {\n return args.length ? new TZDate(...args, tz) : new TZDate(Date.now(), tz);\n }\n\n //#endregion\n\n //#region representation\n\n toISOString() {\n const [sign, hours, minutes] = this.tzComponents();\n const tz = `${sign}${hours}:${minutes}`;\n return this.internal.toISOString().slice(0, -1) + tz;\n }\n toString() {\n // \"Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)\";\n return `${this.toDateString()} ${this.toTimeString()}`;\n }\n toDateString() {\n // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n const [day, date, month, year] = this.internal.toUTCString().split(\" \");\n // \"Tue Aug 13 2024\"\n return `${day?.slice(0, -1) /* Remove \",\" */} ${month} ${date} ${year}`;\n }\n toTimeString() {\n // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n const time = this.internal.toUTCString().split(\" \")[4];\n const [sign, hours, minutes] = this.tzComponents();\n // \"07:42:23 GMT+0800 (Singapore Standard Time)\"\n return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;\n }\n toLocaleString(locales, options) {\n return Date.prototype.toLocaleString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n toLocaleDateString(locales, options) {\n return Date.prototype.toLocaleDateString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n toLocaleTimeString(locales, options) {\n return Date.prototype.toLocaleTimeString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n\n //#endregion\n\n //#region private\n\n tzComponents() {\n const offset = this.getTimezoneOffset();\n const sign = offset > 0 ? \"-\" : \"+\";\n const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, \"0\");\n const minutes = String(Math.abs(offset) % 60).padStart(2, \"0\");\n return [sign, hours, minutes];\n }\n\n //#endregion\n\n withTimeZone(timeZone) {\n return new TZDate(+this, timeZone);\n }\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDate(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\nfunction tzName(tz, date) {\n return new Intl.DateTimeFormat(\"en-GB\", {\n timeZone: tz,\n timeZoneName: \"long\"\n }).format(date).slice(12);\n}"],"names":["TZDate","TZDateMini","tz","args","sign","hours","minutes","day","date","month","year","time","tzName","locales","options","offset","timeZone"],"mappings":"uCAeO,MAAMA,UAAeC,CAAW,CAGrC,OAAO,GAAGC,KAAOC,EAAM,CACrB,OAAOA,EAAK,OAAS,IAAIH,EAAO,GAAGG,EAAMD,CAAE,EAAI,IAAIF,EAAO,KAAK,IAAG,EAAIE,CAAE,CAC1E,CAMA,aAAc,CACZ,KAAM,CAACE,EAAMC,EAAOC,CAAO,EAAI,KAAK,aAAY,EAC1CJ,EAAK,GAAGE,CAAI,GAAGC,CAAK,IAAIC,CAAO,GACrC,OAAO,KAAK,SAAS,YAAW,EAAG,MAAM,EAAG,EAAE,EAAIJ,CACpD,CACA,UAAW,CAET,MAAO,GAAG,KAAK,aAAY,CAAE,IAAI,KAAK,aAAY,CAAE,EACtD,CACA,cAAe,CAEb,KAAM,CAACK,EAAKC,EAAMC,EAAOC,CAAI,EAAI,KAAK,SAAS,cAAc,MAAM,GAAG,EAEtE,MAAO,GAAGH,GAAA,YAAAA,EAAK,MAAM,EAAG,GAAG,IAAqBE,CAAK,IAAID,CAAI,IAAIE,CAAI,EACvE,CACA,cAAe,CAEb,MAAMC,EAAO,KAAK,SAAS,YAAW,EAAG,MAAM,GAAG,EAAE,CAAC,EAC/C,CAACP,EAAMC,EAAOC,CAAO,EAAI,KAAK,aAAY,EAEhD,MAAO,GAAGK,CAAI,OAAOP,CAAI,GAAGC,CAAK,GAAGC,CAAO,KAAKM,EAAO,KAAK,SAAU,IAAI,CAAC,GAC7E,CACA,eAAeC,EAASC,EAAS,CAC/B,OAAO,KAAK,UAAU,eAAe,KAAK,KAAMD,EAAS,CACvD,GAAGC,EACH,UAAUA,GAAA,YAAAA,EAAS,WAAY,KAAK,QAC1C,CAAK,CACH,CACA,mBAAmBD,EAASC,EAAS,CACnC,OAAO,KAAK,UAAU,mBAAmB,KAAK,KAAMD,EAAS,CAC3D,GAAGC,EACH,UAAUA,GAAA,YAAAA,EAAS,WAAY,KAAK,QAC1C,CAAK,CACH,CACA,mBAAmBD,EAASC,EAAS,CACnC,OAAO,KAAK,UAAU,mBAAmB,KAAK,KAAMD,EAAS,CAC3D,GAAGC,EACH,UAAUA,GAAA,YAAAA,EAAS,WAAY,KAAK,QAC1C,CAAK,CACH,CAMA,cAAe,CACb,MAAMC,EAAS,KAAK,kBAAiB,EAC/BX,EAAOW,EAAS,EAAI,IAAM,IAC1BV,EAAQ,OAAO,KAAK,MAAM,KAAK,IAAIU,CAAM,EAAI,EAAE,CAAC,EAAE,SAAS,EAAG,GAAG,EACjET,EAAU,OAAO,KAAK,IAAIS,CAAM,EAAI,EAAE,EAAE,SAAS,EAAG,GAAG,EAC7D,MAAO,CAACX,EAAMC,EAAOC,CAAO,CAC9B,CAIA,aAAaU,EAAU,CACrB,OAAO,IAAIhB,EAAO,CAAC,KAAMgB,CAAQ,CACnC,CAIA,CAAC,OAAO,IAAI,mBAAmB,CAAC,EAAER,EAAM,CACtC,OAAO,IAAIR,EAAO,CAAC,IAAI,KAAKQ,CAAI,EAAG,KAAK,QAAQ,CAClD,CAGF,CACA,SAASI,EAAOV,EAAIM,EAAM,CACxB,OAAO,IAAI,KAAK,eAAe,QAAS,CACtC,SAAUN,EACV,aAAc,MAClB,CAAG,EAAE,OAAOM,CAAI,EAAE,MAAM,EAAE,CAC1B","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mini.js","sources":["../../../../../node_modules/@date-fns/tz/date/mini.js"],"sourcesContent":["import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n return -tzOffset(this.timeZone, this);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const offset = tzOffset(date.timeZone, date);\n\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postOffset = tzOffset(date.timeZone, date);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newOffset = tzOffset(date.timeZone, date);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}"],"names":["TZDateMini","args","tzOffset","adjustToSystemTZ","syncToInternal","tz","timeZone","time","date","re","method","utcMethod","syncFromInternal","offset","prevHour","systemOffset","prevHourSystemOffset","systemDSTChange","dstShift","offsetDiff","postOffset","postOffsetDiff","offsetChanged","postDiff","newOffset","offsetChange"],"mappings":"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","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"mini.js","sources":["../../../../../node_modules/@date-fns/tz/date/mini.js"],"sourcesContent":["import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n return -tzOffset(this.timeZone, this);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const offset = tzOffset(date.timeZone, date);\n\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postOffset = tzOffset(date.timeZone, date);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newOffset = tzOffset(date.timeZone, date);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}"],"names":["TZDateMini","args","tzOffset","adjustToSystemTZ","syncToInternal","tz","timeZone","time","date","re","method","utcMethod","syncFromInternal","offset","prevHour","systemOffset","prevHourSystemOffset","systemDSTChange","dstShift","offsetDiff","postOffset","postOffsetDiff","offsetChanged","postDiff","newOffset","offsetChange"],"mappings":"gDACO,MAAMA,UAAmB,IAAK,CAGnC,eAAeC,EAAM,CACnB,MAAK,EACDA,EAAK,OAAS,GAAK,OAAOA,EAAKA,EAAK,OAAS,CAAC,GAAM,WACtD,KAAK,SAAWA,EAAK,IAAG,GAE1B,KAAK,SAAW,IAAI,KAChB,MAAMC,EAAS,KAAK,SAAU,IAAI,CAAC,EACrC,KAAK,QAAQ,GAAG,EAEXD,EAAK,OAEC,OAAOA,EAAK,CAAC,GAAM,WAAaA,EAAK,SAAW,GAAKA,EAAK,SAAW,GAAK,OAAOA,EAAK,CAAC,GAAM,UACtG,KAAK,QAAQA,EAAK,CAAC,CAAC,EACX,OAAOA,EAAK,CAAC,GAAM,SAC5B,KAAK,QAAQ,CAAC,IAAI,KAAKA,EAAK,CAAC,CAAC,CAAC,EACtBA,EAAK,CAAC,YAAa,KAC5B,KAAK,QAAQ,CAACA,EAAK,CAAC,CAAC,GAErB,KAAK,QAAQ,CAAC,IAAI,KAAK,GAAGA,CAAI,CAAC,EAC/BE,EAAiB,IAAS,EAC1BC,EAAe,IAAI,GAVnB,KAAK,QAAQ,KAAK,KAAK,CAa7B,CACA,OAAO,GAAGC,KAAOJ,EAAM,CACrB,OAAOA,EAAK,OAAS,IAAID,EAAW,GAAGC,EAAMI,CAAE,EAAI,IAAIL,EAAW,KAAK,IAAG,EAAIK,CAAE,CAClF,CAMA,aAAaC,EAAU,CACrB,OAAO,IAAIN,EAAW,CAAC,KAAMM,CAAQ,CACvC,CACA,mBAAoB,CAClB,MAAO,CAACJ,EAAS,KAAK,SAAU,IAAI,CACtC,CAMA,QAAQK,EAAM,CACZ,YAAK,UAAU,QAAQ,MAAM,KAAM,SAAS,EAC5CH,EAAe,IAAI,EACZ,CAAC,IACV,CAMA,CAAC,OAAO,IAAI,mBAAmB,CAAC,EAAEI,EAAM,CACtC,OAAO,IAAIR,EAAW,CAAC,IAAI,KAAKQ,CAAI,EAAG,KAAK,QAAQ,CACtD,CAGF,CAGA,MAAMC,EAAK,oBACX,OAAO,oBAAoB,KAAK,SAAS,EAAE,QAAQC,GAAU,CAC3D,GAAI,CAACD,EAAG,KAAKC,CAAM,EAAG,OACtB,MAAMC,EAAYD,EAAO,QAAQD,EAAI,OAAO,EAEvCT,EAAW,UAAUW,CAAS,IAC/BD,EAAO,WAAW,KAAK,EAEzBV,EAAW,UAAUU,CAAM,EAAI,UAAY,CACzC,OAAO,KAAK,SAASC,CAAS,EAAC,CACjC,GAGAX,EAAW,UAAUU,CAAM,EAAI,UAAY,CACzC,YAAK,UAAUC,CAAS,EAAE,MAAM,KAAK,SAAU,SAAS,EACxDC,EAAiB,IAAI,EACd,CAAC,IACV,EAGAZ,EAAW,UAAUW,CAAS,EAAI,UAAY,CAC5C,YAAK,UAAUA,CAAS,EAAE,MAAM,KAAM,SAAS,EAC/CP,EAAe,IAAI,EACZ,CAAC,IACV,GAEJ,CAAC,EAOD,SAASA,EAAeI,EAAM,CAC5BA,EAAK,SAAS,QAAQ,CAACA,CAAI,EAC3BA,EAAK,SAAS,cAAcA,EAAK,SAAS,cAAa,EAAKA,EAAK,mBAAmB,CACtF,CAQA,SAASI,EAAiBJ,EAAM,CAE9B,KAAK,UAAU,YAAY,KAAKA,EAAMA,EAAK,SAAS,eAAc,EAAIA,EAAK,SAAS,YAAW,EAAIA,EAAK,SAAS,YAAY,EAC7H,KAAK,UAAU,SAAS,KAAKA,EAAMA,EAAK,SAAS,cAAeA,EAAK,SAAS,cAAa,EAAIA,EAAK,SAAS,cAAa,EAAIA,EAAK,SAAS,oBAAoB,EAGhKL,EAAiBK,CAAI,CACvB,CAQA,SAASL,EAAiBK,EAAM,CAE9B,MAAMK,EAASX,EAASM,EAAK,SAAUA,CAAI,EA2BrCM,EAAW,IAAI,KAAK,CAACN,CAAI,EAG/BM,EAAS,YAAYA,EAAS,YAAW,EAAK,CAAC,EAG/C,MAAMC,EAAe,CAAC,IAAI,KAAK,CAACP,CAAI,EAAE,kBAAiB,EACjDQ,EAAuB,CAAC,IAAI,KAAK,CAACF,CAAQ,EAAE,kBAAiB,EAC7DG,EAAkBF,EAAeC,EAEjCE,EAAW,KAAK,UAAU,SAAS,MAAMV,CAAI,IAAMA,EAAK,SAAS,YAAW,EAG9ES,GAAmBC,GAAUV,EAAK,SAAS,cAAcA,EAAK,SAAS,cAAa,EAAKS,CAAe,EAU5G,MAAME,EAAaJ,EAAeF,EAC9BM,GAAY,KAAK,UAAU,cAAc,KAAKX,EAAM,KAAK,UAAU,cAAc,KAAKA,CAAI,EAAIW,CAAU,EAM5G,MAAMC,EAAalB,EAASM,EAAK,SAAUA,CAAI,EAEzCa,EADmB,CAAC,IAAI,KAAK,CAACb,CAAI,EAAE,kBAAiB,EACjBY,EACpCE,EAAgBF,IAAeP,EAC/BU,EAAWF,EAAiBF,EAClC,GAAIG,GAAiBC,EAAU,CAC7B,KAAK,UAAU,cAAc,KAAKf,EAAM,KAAK,UAAU,cAAc,KAAKA,CAAI,EAAIe,CAAQ,EAK1F,MAAMC,EAAYtB,EAASM,EAAK,SAAUA,CAAI,EACxCiB,EAAeL,EAAaI,EAC9BC,IACFjB,EAAK,SAAS,cAAcA,EAAK,SAAS,cAAa,EAAKiB,CAAY,EACxE,KAAK,UAAU,cAAc,KAAKjB,EAAM,KAAK,UAAU,cAAc,KAAKA,CAAI,EAAIiB,CAAY,EAElG,CAGF","x_google_ignoreList":[0]}
|